aboutsummaryrefslogtreecommitdiff
path: root/configure.ac
diff options
context:
space:
mode:
Diffstat (limited to 'configure.ac')
-rw-r--r--configure.ac198
1 files changed, 193 insertions, 5 deletions
diff --git a/configure.ac b/configure.ac
index 5276c8b..5f6e8e5 100644
--- a/configure.ac
+++ b/configure.ac
@@ -20,17 +20,16 @@
20# Process this file with autoconf to produce a configure script. 20# Process this file with autoconf to produce a configure script.
21# 21#
22AC_PREREQ(2.61) 22AC_PREREQ(2.61)
23AC_INIT([gnunet-secushare],[0.0.0],[bug-gnunet@gnu.org]) 23AC_INIT([gnunet-secushare],[0.11.0],[bug-gnunet@gnu.org])
24AM_INIT_AUTOMAKE([gnunet-secushare], [0.0.0]) 24AM_INIT_AUTOMAKE
25AM_CONFIG_HEADER(gnunet_secushare_config.h) 25AC_CONFIG_HEADERS([gnunet_secushare_config.h])
26 26AC_CONFIG_MACRO_DIR([m4])
27AH_TOP([#define _GNU_SOURCE 1]) 27AH_TOP([#define _GNU_SOURCE 1])
28 28
29AC_ISC_POSIX 29AC_ISC_POSIX
30AC_PROG_AWK 30AC_PROG_AWK
31AC_PROG_CC 31AC_PROG_CC
32 32
33AC_PROG_MKDIR_P
34AC_PROG_CPP 33AC_PROG_CPP
35AC_PROG_INSTALL 34AC_PROG_INSTALL
36AC_PROG_LN_S 35AC_PROG_LN_S
@@ -40,6 +39,7 @@ AC_PROG_CC
40AM_PROG_CC_STDC 39AM_PROG_CC_STDC
41AC_HEADER_STDC 40AC_HEADER_STDC
42AC_CANONICAL_HOST 41AC_CANONICAL_HOST
42AC_SUBST(MKDIR_P)
43 43
44# dynamic libraries/plugins 44# dynamic libraries/plugins
45AC_DISABLE_STATIC 45AC_DISABLE_STATIC
@@ -168,6 +168,45 @@ then
168fi 168fi
169 169
170 170
171# gcov compilation
172AC_MSG_CHECKING(whether to compile with support for code coverage analysis)
173AC_ARG_ENABLE([coverage],
174 AS_HELP_STRING([--enable-coverage],
175 [compile the library with code coverage support]),
176 [use_gcov=${enableval}],
177 [use_gcov=no])
178AC_MSG_RESULT($use_gcov)
179AM_CONDITIONAL([USE_COVERAGE], [test "x$use_gcov" = "xyes"])
180
181# should 'make check' run tests?
182AC_MSG_CHECKING(whether to run tests)
183AC_ARG_ENABLE([testruns],
184 [AS_HELP_STRING([--disable-testruns], [disable running tests on make check (default is YES)])],
185 [enable_tests_run=${enableval}],
186 [enable_tests_run=yes])
187AC_MSG_RESULT($enable_test_run)
188AM_CONDITIONAL([ENABLE_TEST_RUN], [test "x$enable_tests_run" = "xyes"])
189
190
191
192# should gnunet-testing be compiled
193AC_MSG_CHECKING(wether to compile gnunet-testing)
194AC_ARG_ENABLE([testing],
195 [AS_HELP_STRING([--disable-testing], [do not build gnunet-testing])],
196 [enable_testing=${enableval}],
197 [enable_testing=yes])
198AC_MSG_RESULT($enable_testing)
199AM_CONDITIONAL([HAVE_TESTING], [test "x$enable_testing" = "xyes"])
200
201# should experimental code be compiled (code that may not yet compile)?
202AC_MSG_CHECKING(whether to compile experimental code)
203AC_ARG_ENABLE([experimental],
204 [AS_HELP_STRING([--enable-experimental], [enable compiling experimental code])],
205 [enable_experimental=${enableval}],
206 [enable_experimental=no])
207AC_MSG_RESULT($enable_experimental)
208AM_CONDITIONAL([HAVE_EXPERIMENTAL], [test "x$enable_experimental" = "xyes"])
209
171 210
172# Linker hardening options 211# Linker hardening options
173# Currently these options are ELF specific - you can't use this with MacOSX 212# Currently these options are ELF specific - you can't use this with MacOSX
@@ -178,6 +217,155 @@ AC_ARG_ENABLE(linker-hardening,
178fi]) 217fi])
179 218
180 219
220SAVE_LDFLAGS=$LDFLAGS
221SAVE_CPPFLAGS=$CPPFLAGS
222
223# test for sqlite
224sqlite=false
225AC_MSG_CHECKING(for SQLite)
226AC_ARG_WITH(sqlite,
227 [ --with-sqlite=PFX base of SQLite installation],
228 [AC_MSG_RESULT("$with_sqlite")
229 case $with_sqlite in
230 no)
231 ;;
232 yes)
233 AC_CHECK_HEADERS(sqlite3.h,
234 sqlite=true)
235 ;;
236 *)
237 LDFLAGS="-L$with_sqlite/lib $LDFLAGS"
238 CPPFLAGS="-I$with_sqlite/include $CPPFLAGS"
239 AC_CHECK_HEADERS(sqlite3.h,
240 EXT_LIB_PATH="-L$with_sqlite/lib $EXT_LIB_PATH"
241 SQLITE_LDFLAGS="-L$with_sqlite/lib"
242 SQLITE_CPPFLAGS="-I$with_sqlite/include"
243 sqlite=true)
244 LDFLAGS=$SAVE_LDFLAGS
245 CPPFLAGS=$SAVE_CPPFLAGS
246 ;;
247 esac
248 ],
249 [AC_MSG_RESULT([--with-sqlite not specified])
250 AC_CHECK_HEADERS(sqlite3.h, sqlite=true)])
251AM_CONDITIONAL(HAVE_SQLITE, test x$sqlite = xtrue)
252AC_SUBST(SQLITE_CPPFLAGS)
253AC_SUBST(SQLITE_LDFLAGS)
254
255LDFLAGS=$SAVE_LDFLAGS
256CPPFLAGS=$SAVE_CPPFLAGS
257
258# test for postgres
259postgres=false
260# even running the check for postgres breaks emscripten ...
261AS_IF([test "$taler_only" != yes],
262 [AX_LIB_POSTGRESQL([9.5],
263 [CPPFLAGS="$CPPFLAGS $POSTGRESQL_CPPFLAGS"
264 AC_CHECK_HEADERS([libpq-fe.h],
265 postgres=true)
266 ],
267 [AC_MSG_RESULT([no postgres])])])
268AM_CONDITIONAL(HAVE_POSTGRESQL, test x$postgres = xtrue)
269
270
271LDFLAGS=$SAVE_LDFLAGS
272CPPFLAGS=$SAVE_CPPFLAGS
273
274# mysql & windows
275AC_CHECK_TYPES([sigset_t, off_t], [], [], [#include <sys/types.h>])
276AC_CHECK_TYPES([size_t], [], [], [#include <stdio.h>])
277
278if test "$build_target" = "mingw"
279then
280 CYGWIN_MYSQL_MAGIC="#include <mysql/my_global.h>"
281fi
282
283# test for mysql
284mysql=false
285mysqlfail=false
286SAVE_LDFLAGS=$LDFLAGS
287SAVE_CPPFLAGS=$CPPFLAGS
288AC_MSG_CHECKING(for mysql)
289AC_ARG_WITH(mysql,
290 [ --with-mysql=PFX base of MySQL installation],
291 [AC_MSG_RESULT([$with_mysql])
292 case $with_mysql in
293 no)
294 ;;
295 yes|"")
296 AC_CHECK_HEADERS(mysql/mysql.h,
297 AC_CHECK_LIB(mysqlclient, mysql_init,
298
299 mysql=true), [], [$CYGWIN_MYSQL_MAGIC])
300 ;;
301 *)
302 LDFLAGS="-L$with_mysql/lib -L$with_mysql/lib/mysql $LDFLAGS $ZLIBS"
303 CPPFLAGS="-I$with_mysql/include $CPPFLAGS"
304 AC_CHECK_HEADERS(mysql/mysql.h,
305 AC_CHECK_LIB(mysqlclient, mysql_init,
306 MYSQL_LDFLAGS="-L$with_mysql/lib -L$with_mysql/lib/mysql"
307 MYSQL_CPPFLAGS="-I$with_mysql/include"
308
309 mysql=true), [], [$CYGWIN_MYSQL_MAGIC])
310 ;;
311 esac
312 ],
313 [AC_MSG_RESULT([--with-mysql not specified])
314 if test -d "/usr/lib64/mysql"; then
315 MYSQL_LIBDIR="/usr/lib64/mysql"
316 elif test -d "/usr/lib/mysql"; then
317 MYSQL_LIBDIR="/usr/lib/mysql"
318 else
319 MYSQL_LIBDIR="/usr/lib"
320 fi
321 LDFLAGS="-L$MYSQL_LIBDIR $LDFLAGS $ZLIBS"
322 AC_CHECK_LIB(mysqlclient, mysql_init,
323 [AC_CHECK_HEADERS(mysql/mysql.h,
324 MYSQL_LDFLAGS="-L$MYSQL_LIBDIR"
325 mysql=true
326
327 , [], [$CYGWIN_MYSQL_MAGIC])])
328 ])
329
330AC_SUBST(MYSQL_LDFLAGS)
331AC_SUBST(MYSQL_CPPFLAGS)
332
333# additional version check for mysql
334AC_ARG_ENABLE(mysql-version-check, [ --disable-mysql-version-check do not check MySQL version],, enable_mysql_version_check=yes)
335if test "$mysql" = "true" -a "x$enable_mysql_version_check" = "xyes"
336then
337 AC_MSG_CHECKING(mysql version)
338 AC_COMPILE_IFELSE([AC_LANG_PROGRAM(
339 [[$CYGWIN_MYSQL_MAGIC
340 #include <mysql/mysql.h>]],
341 [[
342 #if (MYSQL_VERSION_ID < 40100)
343 #error needs at least version >= 4.1
344 #endif
345 int main () { return 0; }
346 ]])
347 ],mysql=true,mysql=false)
348 if test "$mysql" = "false"
349 then
350 mysqlfail=true
351 AC_MSG_RESULT([fail, >= 4.1 required])
352 else
353 AC_MSG_RESULT(ok)
354 fi
355fi
356AM_CONDITIONAL(HAVE_MYSQL, test x$mysql = xtrue)
357AM_CONDITIONAL(HAVE_MYSQLE, false)
358# restore LIBS
359LIBS=$SAVE_LIBS
360LDFLAGS=$SAVE_LDFLAGS
361CPPFLAGS=$SAVE_CPPFLAGS
362
363if test "$sqlite" = 0 -a "$mysql" = 0
364then
365 AC_MSG_ERROR([GNUnet requires SQLite or MySQL])
366fi
367
368
181extra_logging=GNUNET_NO 369extra_logging=GNUNET_NO
182AC_ARG_ENABLE([logging], 370AC_ARG_ENABLE([logging],
183 AS_HELP_STRING([--enable-logging@<:@=value@:>@],[Enable logging calls. Possible values: yes,no,verbose,veryverbose ('yes' is the default)]), 371 AS_HELP_STRING([--enable-logging@<:@=value@:>@],[Enable logging calls. Possible values: yes,no,verbose,veryverbose ('yes' is the default)]),