source: trunk/GDE/SINA/builddir/configure.ac

Last change on this file was 19170, checked in by westram, 2 years ago
  • sina source
    • unpack + remove tarball
    • no longer ignore sina builddir.
File size: 9.5 KB
Line 
1# Init
2
3AC_INIT([SINA],[1.7.2],[elmar@pruesse.net],,[http://github.com/epruesse/SINA])
4AC_COPYRIGHT([Copyright (c) 2005-2018 Elmar Pruesse])
5AC_CONFIG_AUX_DIR([build-aux])
6AC_CONFIG_MACRO_DIR([m4])
7AC_CONFIG_SRCDIR([src/sina.cpp])
8AM_INIT_AUTOMAKE([parallel-tests foreign subdir-objects])
9AC_PREREQ([2.50])
10
11# build rules for silent compile
12AM_SILENT_RULES([yes])
13
14# Check for programs
15
16# only run AR check if AM_PROG_AR defined
17# (automake > 1.11 needs it somehow, older ones don't have it)
18m4_ifdef([AM_PROG_AR], [AM_PROG_AR])
19
20# AC_PROG_CXX sets -O2, which we don't want if debug enabled, so we store this
21# as default flags for later decision
22saved_CXXFLAGS="$CXXFLAGS"
23AC_PROG_CXX
24default_CXXFLAGS="$CXXFLAGS"
25CXXFLAGS="$saved_CXXFLAGS"
26AC_PROG_LIBTOOL
27AC_PROG_SED
28AC_PROG_LN_S
29AC_PROG_INSTALL
30AC_PROG_MKDIR_P
31AC_CHECK_TOOL([BC], [bc], [:])
32AC_CHECK_TOOL([TEE], [tee], [:])
33AC_CHECK_TOOL([MKTEMP], [mktemp], [:])
34AC_CHECK_TOOL([SPHINX_BUILD], [sphinx-build], [:])
35AC_PROG_GREP
36
37LT_INIT([shared static])
38
39AC_REQUIRE_AUX_FILE([tap-driver.sh])
40
41# Check for C++ and required features
42
43AC_SUBST(CPPFLAGS)
44AC_SUBST(CXXFLAGS)
45AC_SUBST(LDFLAGS)
46AC_LANG([C++])
47AC_C_INLINE
48AC_TYPE_SIZE_T
49AC_TYPE_UINT32_T
50AC_TYPE_UINT64_T
51AC_HEADER_STDBOOL
52AX_CXX_COMPILE_STDCXX([11],[noext],[mandatory])
53
54# Check general functions
55
56AC_CHECK_FUNCS([strdup])
57AC_CHECK_FUNCS([gettimeofday])
58AC_CHECK_FUNCS([getpid])
59
60# Check headers
61
62AC_CHECK_HEADERS([sys/time.h])
63AC_CHECK_HEADER(cstdio)
64
65# Check for libraries
66
67AC_CHECK_LIB(z, compress, [Z_LIB=-lz], [AC_MSG_ERROR([libz.so not found!])])
68AC_SUBST(Z_LIB)
69AC_CHECK_LIB(rt, clock_gettime)
70
71# Need dladdr to locate libARBDB and thereby ARBHOME
72AC_SEARCH_LIBS([dladdr], [dl dld], [], [
73  AC_MSG_ERROR([unable to find the dladdr() function])
74])
75
76# Define something for PSTREAMS (to get rid of warnings)
77AH_TEMPLATE(REDI_EVISCERATE_PSTREAMS,
78            [Define interpreted by PSTREAMS header lib, only
79             set to supress Wundef warnings])
80AC_DEFINE(REDI_EVISCERATE_PSTREAMS, [0])
81
82# Add coverage option
83AX_CODE_COVERAGE
84AM_COND_IF([CODE_COVERAGE_ENABLED], [
85  AC_CACHE_CHECK([for coverage libs], [_cv_coverage_libs], [
86    _cv_coverage_libs=no
87    save_LIBS=$LIBS
88    res=
89    AC_LANG_CONFTEST([AC_LANG_CALL([], [main])])
90    for lib in '' "$CODE_COVERAGE_LIBS"; do
91      if test -z "$lib"; then
92        res="none required"
93      else
94        res=$CODE_COVERAGE_LIBS
95        LIBS="-l$lib $save_LIBS"
96      fi
97      AC_LINK_IFELSE([], [_cv_coverage_libs=$res])
98      AS_IF([test -n "$_cv_coverage_libs"], [break])
99    done
100    LIBS=$save_LIBS
101  ])
102  AC_MSG_NOTICE([here - $_cv_coverage_libs])
103  AS_IF([test x"$_cv_coverage_libs" != x"no"], [
104    AS_IF([test x"$_cv_coverage_libs" == x"none required"], [
105      CODE_COVERAGE_LIBS=
106    ],[
107      CODE_COVERAGE_LIBS=$_cv_coverage_libs
108    ])
109  ], [
110    missing_libs="$missing_libs
111    coverage libs ($CODE_COVERAGE_LIBS)"
112  ])
113])
114
115# Export all symbols to get helpful backtraces
116# (don't on Darwin, ld doesn't support these options there)
117#if test `uname` = Linux; then
118#  CXXFLAGS="$CXXFLAGS -rdynamic"
119#  LDFLAGS="$LDFLAGS -export-dynamic"
120#fi
121
122# Add debug option
123AH_TEMPLATE([DEBUG])
124AH_TEMPLATE([NDEBUG])
125AX_ARG_ENABLE([debug], [disable optimizations and add debug symbols],
126[
127  AM_COND_IF([CODE_COVERAGE_ENABLED], [
128    AC_MSG_WARN([Code Coverage enabled: using -DNDEBUG instead of -DDEBUG])
129    AC_DEFINE([NDEBUG])
130  ],[
131    AC_DEFINE([DEBUG])
132  ])
133  CXXFLAGS="$(echo $CXXFLAGS | sed 's/-O@<:@@<:@:alnum:@:>@@:>@*//g')"
134  CXXFLAGS="$CXXFLAGS -Og -ggdb3"
135  AX_CHECK_COMPILE_FLAG([-fno-omit-frame-pointer],[
136    CXXFLAGS="$CXXFLAGS -fno-omit-frame-pointer"
137  ])
138],[
139  CPPFLAGS="$CPPFLAGS -DNDEBUG"
140  CXXFLAGS="$default_CXXFLAGS $CXXFLAGS"
141])
142
143# Add address sanitizer option
144AX_ARG_ENABLE([asan], [enable AddressSanitizer], [
145  AX_CHECK_COMPILE_FLAG([-fsanitize=address],[
146    CXXFLAGS="$CXXFLAGS -fsanitize=address"
147  ])
148  AX_CHECK_LINK_FLAG([-fsanitize=address],[
149    LDFLAGS="$LDFLAGS -fsanitize=address"
150  ])
151])
152
153
154# Add option to disable building docs (needs latex...)
155AX_ARG_DISABLE([docs], [don't build documentation])
156
157AX_ARG_ENABLE([fat_tar], [try to build a fat tar containing deps])
158
159# Add profiling option
160AX_ARG_ENABLE([profiling], [add profiling information to build],
161[
162  CXXFLAGS="$CXXFLAGS -pg"
163  LDFLAGS="$LDFLAGS -pg"
164])
165
166
167# Add buildno option
168AC_ARG_WITH([buildinfo], AS_HELP_STRING([--with-buildinfo=<NO>]),
169  AC_DEFINE_UNQUOTED([PACKAGE_BUILDINFO], ["${withval}"], [Add extra buildinfo])
170  PACKAGE_BUILDINFO="$withval"
171)
172
173
174# ARB dependencies
175PKG_CHECK_MODULES([GLIB], [glib-2.0 > 2.2])
176if test x"$GLIB_LIBS" = x""; then
177  missing_libs="$missing_libs
178  glib-2.0 (libglib)"
179fi
180
181AX_LIB_ARBDB
182if test x"$ARB_LIBS" = x""; then
183  missing_libs="$missing_libs
184  ARB libraries (libARBDB)"
185fi
186
187AX_LIB_ARB_PROBE
188if test x"$ARB_PROBE_LIBS" = x""; then
189  missing_libs="$missing_libs
190  ARB PROBE library (PROBE_COM/client.a)"
191fi
192
193AX_LIB_ARB_HELIX
194if test x"$ARB_HELIX_LIBS" = x""; then
195  missing_libs="$missing_libs
196  ARB HELIX library (SL/HELIX/HELIX.a)"
197fi
198
199AX_ARB_CHECK_FUNC([GBT_FIND_SEQUENCE], [GBT_find_sequence(NULL, NULL)])
200AX_ARB_STATUS_RETURN_TYPE
201
202case "$host_os" in
203  darwin*)
204    LIBEXT=.dylib
205    OSNAME=macos
206    ;;
207  *)
208    LIBEXT=.so
209    OSNAME=linux
210    ;;
211esac
212AC_SUBST(LIBEXT)
213AC_SUBST(OSNAME)
214
215
216# Dynamic libs that need to be copied
217if test `uname` = Darwin; then
218  # need to copy glib for darwin (only present if provided by macports)
219  GLIB_LIBPATH=`$PKG_CONFIG --variable=libdir glib-2.0`
220  ARB_FILES="$ARB_FILES $GLIB_LIBPATH/libglib-2.0.0.dylib"
221fi
222
223for lib in CORE ARBDB; do
224  if test -e "$ARBHOME/lib/lib${lib}${LIBEXT}"; then
225    ARB_FILES="$ARB_FILES $ARBHOME/lib/lib${lib}${LIBEXT}"
226  fi
227done
228AC_SUBST(ARB_FILES)
229
230AX_LIB_TBB
231if test x"$TBB_LIB" = x""; then
232  missing_libs="$missing_libs
233  Intel Threading Building Blocks (libtbb)"
234fi
235
236AX_LIB_TBB_MALLOC
237
238AX_BOOST_BASE([1.62])
239AX_BOOST_THREAD
240if test x"$BOOST_THREAD_LIB" = x""; then
241  missing_libs="$missing_libs
242  BOOST Thread (libboost_thread)"
243fi
244AX_BOOST_PROGRAM_OPTIONS
245if test x"$BOOST_PROGRAM_OPTIONS_LIB" = x""; then
246  missing_libs="$missing_libs
247  BOOST Program Options (libboost_program_options)"
248fi
249AX_BOOST_IOSTREAMS
250if test x"$BOOST_IOSTREAMS_LIB" = x""; then
251  missing_libs="$missing_libs
252  BOOST Program Options (libboost_iostreams)"
253fi
254AX_BOOST_FILESYSTEM
255if test x"$BOOST_FILESYSTEM_LIB" = x""; then
256  missing_libs="$missing_libs
257  BOOST Program Options (libboost_filesystem)"
258fi
259
260AX_BOOST_SYSTEM
261if test x"$BOOST_SYSTEM_LIB" = x""; then
262  missing_libs="$missing_libs
263  BOOST System (libboost_system)"
264fi
265AX_BOOST_UNIT_TEST_FRAMEWORK
266#if test x"$BOOST_UNIT_TEST_FRAMEWORK_LIBS" = x""; then
267#  missing_libs="$missing_libs\n BOOST Unit Test Framework (libboost_unit_test_framework)"
268#fi
269
270# Allways show warnings
271CXXFLAGS="$CXXFLAGS -W"
272
273# Disable warnings creating too much clutter from within TBB
274CXXFLAGS="$CXXFLAGS -Wno-deprecated-copy"
275
276
277# Generate output
278
279AC_CONFIG_HEADERS([config.h])
280AC_CONFIG_FILES([
281  Makefile
282  tests/test_helper.sh
283])
284
285
286###### print some summaries
287
288AC_MSG_NOTICE([---------------------------------------])
289AC_MSG_NOTICE([  AC_PACKAGE_STRING summary])
290AC_MSG_NOTICE([---------------------------------------])
291AC_MSG_NOTICE([])
292AC_MSG_NOTICE([  prefix: $prefix])
293AC_MSG_NOTICE([  build:  $build])
294AC_MSG_NOTICE([  host:   $host])
295AC_MSG_NOTICE([])
296AC_MSG_NOTICE([  debug:     $enable_debug])
297AC_MSG_NOTICE([  profiling: $enable_profiling])
298AC_MSG_NOTICE([  coverage:  $CODE_COVERAGE_ENABLED])
299AC_MSG_NOTICE([  buildinfo: $PACKAGE_BUILDINFO])
300AC_MSG_NOTICE([  docs:      $enable_docs])
301AC_MSG_NOTICE([])
302AC_MSG_NOTICE([  CFLAGS:   $CFLAGS])
303AC_MSG_NOTICE([  CPPFLAGS: $CPPFLAGS])
304AC_MSG_NOTICE([  CXXFLAGS: $CXXFLAGS])
305AC_MSG_NOTICE([  LIBS:     $LIBS])
306AC_MSG_NOTICE([  LDFLAGS:  $LDFLAGS])
307AC_MSG_NOTICE([  CC:       $CC])
308AC_MSG_NOTICE([  CXX:      $CXX])
309AC_MSG_NOTICE([  LD:       $LD])
310AC_MSG_NOTICE([])
311AM_COND_IF([CODE_COVERAGE_ENABLED], [
312AC_MSG_NOTICE([  CODE COVERAGE:])
313AC_MSG_NOTICE([    CPPFLAGS:        $CODE_COVERAGE_CPPFLAGS])
314AC_MSG_NOTICE([    CFLAGS:          $CODE_COVERAGE_CFLAGS])
315AC_MSG_NOTICE([    CXXFLAGS:        $CODE_COVERAGE_CXXFLAGS])
316AC_MSG_NOTICE([    LIBS:            $CODE_COVERAGE_LIBS])
317AC_MSG_NOTICE([])
318])
319AC_MSG_NOTICE([  ARB:])
320AC_MSG_NOTICE([    ARBHOME:         ${ARBHOME}])
321AC_MSG_NOTICE([    CPPFLAGS:        ${ARB_CPPFLAGS}])
322AC_MSG_NOTICE([    LDFLAGS:         ${ARB_LDFLAGS}])
323AC_MSG_NOTICE([    LIBS:            ${ARB_LIBS}])
324AC_MSG_NOTICE([    PROBE LIBS:      ${ARB_PROBE_LIBS}])
325AC_MSG_NOTICE([    HELIX LIBS:      ${ARB_HELIX_LIBS}])
326AC_MSG_NOTICE([  BOOST:])
327AC_MSG_NOTICE([    LDFLAGS:         ${BOOST_LDFLAGS}])
328AC_MSG_NOTICE([    CPPFLAGS:        ${BOOST_CPPFLAGS}])
329AC_MSG_NOTICE([    PROGRAM_OPTIONS: ${BOOST_PROGRAM_OPTIONS_LIB}])
330AC_MSG_NOTICE([    THREAD:          ${BOOST_THREAD_LIB}])
331AC_MSG_NOTICE([    IOSTREAMS:       ${BOOST_IOSTREAMS_LIB}])
332AC_MSG_NOTICE([    SYSTEM:          ${BOOST_SYSTEM_LIB}])
333AC_MSG_NOTICE([    FILESYSTEM:      ${BOOST_FILESYSTEM_LIB}])
334AC_MSG_NOTICE([    UNIT_TEST:       ${BOOST_UNIT_TEST_FRAMEWORK_LIB}])
335AC_MSG_NOTICE([  zlib:])
336AC_MSG_NOTICE([    LIBS:            ${Z_LIB}])
337AC_MSG_NOTICE([  tbb:])
338AC_MSG_NOTICE([    CPPFLAGS:        ${TBB_CPPFLAGS}])
339AC_MSG_NOTICE([    LDFLAGS:         ${TBB_LDFLAGS}])
340AC_MSG_NOTICE([    LIBS:            ${TBB_LIB}])
341AC_MSG_NOTICE([  tbb malloc:])
342AC_MSG_NOTICE([    CPPFLAGS:        ${TBB_MALLOC_CPPFLAGS}])
343AC_MSG_NOTICE([    LDFLAGS:         ${TBB_MALLOC_LDFLAGS}])
344AC_MSG_NOTICE([    LIBS:            ${TBB_MALLOC_LIB}])
345
346
347### check that all deps are satisfied
348
349if test x"$missing_libs" != x""; then
350  AC_MSG_FAILURE(Required libraries found missing:  $missing_libs )
351fi
352
353AC_OUTPUT
Note: See TracBrowser for help on using the repository browser.