configure.ac 50 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771
  1. # This file is part of GNUnet.
  2. # (C) 2001--2015 Christian Grothoff (and other contributing authors)
  3. #
  4. # GNUnet is free software; you can redistribute it and/or modify
  5. # it under the terms of the GNU General Public License as published
  6. # by the Free Software Foundation; either version 3, or (at your
  7. # option) any later version.
  8. #
  9. # GNUnet is distributed in the hope that it will be useful, but
  10. # WITHOUT ANY WARRANTY; without even the implied warranty of
  11. # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  12. # General Public License for more details.
  13. #
  14. # You should have received a copy of the GNU General Public License
  15. # along with GNUnet; see the file COPYING. If not, write to the
  16. # Free Software Foundation, Inc., 59 Temple Place - Suite 330,
  17. # Boston, MA 02111-1307, USA.
  18. #
  19. #
  20. # Process this file with autoconf to produce a configure script.
  21. #
  22. #
  23. AC_PREREQ(2.61)
  24. # Checks for programs.
  25. AC_INIT([gnunet], [0.10.1], [bug-gnunet@gnu.org])
  26. AC_CANONICAL_TARGET
  27. AC_CANONICAL_HOST
  28. AC_CANONICAL_SYSTEM
  29. AM_INIT_AUTOMAKE
  30. m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])])
  31. AC_CONFIG_HEADERS([gnunet_config.h])
  32. AH_TOP([#define _GNU_SOURCE 1])
  33. AC_CONFIG_MACRO_DIR([m4])
  34. AC_PROG_AWK
  35. AC_PROG_CC
  36. AC_PROG_CPP
  37. AC_PROG_CXX
  38. AC_PROG_OBJC
  39. AC_PROG_INSTALL
  40. AC_PROG_LN_S
  41. AC_PROG_MAKE_SET
  42. AM_PROG_CC_C_O
  43. LT_INIT([disable-static dlopen win32-dll])
  44. AC_SUBST(MKDIR_P)
  45. # large file support
  46. AC_SYS_LARGEFILE
  47. AC_FUNC_FSEEKO
  48. CFLAGS="-Wall $CFLAGS"
  49. # use '-fno-strict-aliasing', but only if the compiler can take it
  50. if gcc -fno-strict-aliasing -S -o /dev/null -xc /dev/null >/dev/null 2>&1;
  51. then
  52. CFLAGS="-fno-strict-aliasing $CFLAGS"
  53. fi
  54. # Use Linux interface name unless the OS has a different preference
  55. DEFAULT_INTERFACE="\"eth0\""
  56. funcstocheck="getnameinfo gethostname gethostbyname gethostbyaddr getaddrinfo"
  57. # Srcdir in a form that native compiler understands (i.e. DOS path on W32)
  58. native_srcdir=$srcdir
  59. # Check system type
  60. case "$host_os" in
  61. *darwin* | *rhapsody* | *macosx*)
  62. AC_DEFINE_UNQUOTED(DARWIN,1,[This is an Apple Darwin system])
  63. CPPFLAGS="-D_APPLE_C_SOURCE $CPPFLAGS"
  64. CFLAGS="-fno-common $CFLAGS"
  65. AC_MSG_WARN([The VPN application cannot be compiled on your OS])
  66. build_target="darwin"
  67. DEFAULT_INTERFACE="\"en0\""
  68. LIBPREFIX=
  69. DLLDIR=lib
  70. UNIXONLY="#"
  71. ;;
  72. linux*)
  73. AC_DEFINE_UNQUOTED(LINUX,1,[This is a Linux kernel])
  74. build_target="linux"
  75. LIBPREFIX=
  76. DLLDIR=lib
  77. UNIXONLY="#"
  78. AC_PATH_XTRA
  79. ;;
  80. *freebsd*)
  81. AC_DEFINE_UNQUOTED(SOMEBSD,1,[This is a BSD system])
  82. AC_DEFINE_UNQUOTED(FREEBSD,1,[This is a FreeBSD system])
  83. CFLAGS="-D_THREAD_SAFE $CFLAGS"
  84. build_target="freebsd"
  85. LIBPREFIX=
  86. DLLDIR=lib
  87. UNIXONLY="#"
  88. ;;
  89. *openbsd*)
  90. AC_DEFINE_UNQUOTED(SOMEBSD,1,[This is a BSD system])
  91. AC_DEFINE_UNQUOTED(OPENBSD,1,[This is an OpenBSD system])
  92. LIBS=`echo $LIBS | sed -e "s/-ldl//"`
  93. build_target="openbsd"
  94. LIBPREFIX=
  95. DLLDIR=lib
  96. UNIXONLY="#"
  97. ;;
  98. *netbsd*)
  99. AC_DEFINE_UNQUOTED(SOMEBSD,1,[This is a BSD system])
  100. AC_DEFINE_UNQUOTED(NETBSD,1,[This is a NetBSD system])
  101. LIBPREFIX=
  102. DLLDIR=lib
  103. UNIXONLY="#"
  104. ;;
  105. *solaris*)
  106. AC_DEFINE_UNQUOTED(SOLARIS,1,[This is a Solaris system])
  107. AC_DEFINE_UNQUOTED(_REENTRANT,1,[Need with solaris or errno doesnt work])
  108. AC_CHECK_LIB(resolv, res_init)
  109. AC_CHECK_LIB(rt, nanosleep)
  110. build_target="solaris"
  111. LIBPREFIX=
  112. DLLDIR=lib
  113. UNIXONLY="#"
  114. ;;
  115. *arm-linux*)
  116. AC_DEFINE_UNQUOTED(LINUX,1,[This is a Linux kernel])
  117. CFLAGS="-D_REENTRANT -fPIC -pipe $CFLAGS"
  118. build_target="linux"
  119. LIBPREFIX=
  120. DLLDIR=lib
  121. UNIXONLY="#"
  122. ;;
  123. *cygwin*)
  124. AC_DEFINE_UNQUOTED(CYGWIN,1,[This is a Cygwin system])
  125. AC_DEFINE_UNQUOTED(WINDOWS,1,[This is a Windows system])
  126. AC_CHECK_LIB(intl, gettext)
  127. CFLAGS="-mms-bitfields $CFLAGS"
  128. build_target="cygwin"
  129. LIBPREFIX=lib
  130. DLLDIR=bin
  131. AC_PROG_CXX
  132. UNIXONLY=""
  133. ;;
  134. *mingw*)
  135. AC_DEFINE_UNQUOTED(MINGW,1,[This is a MinGW system])
  136. AC_DEFINE_UNQUOTED(WINDOWS,1,[This is a Windows system])
  137. AC_DEFINE_UNQUOTED(_WIN32,1,[This is a Windows system])
  138. AC_CHECK_LIB(intl, gettext)
  139. LDFLAGS="$LDFLAGS -Wl,--export-all-symbols"
  140. LIBS="$LIBS -lws2_32 -lplibc -lgnurx -lole32"
  141. CFLAGS="-mms-bitfields $CFLAGS"
  142. CPPFLAGS="-D_WIN32_WINNT=0x0501 -DHAVE_STAT64=1 -D__USE_MINGW_ANSI_STDIO=1 $CPPFLAGS"
  143. build_target="mingw"
  144. AC_PROG_CXX
  145. LIBPREFIX=lib
  146. DLLDIR=bin
  147. UNIXONLY=""
  148. funcstocheck=""
  149. native_srcdir=$(cd $srcdir; pwd -W)
  150. ;;
  151. gnu*)
  152. AC_DEFINE_UNQUOTED(GNU,1,[This is a GNU system])
  153. build_target="gnu"
  154. UNIXONLY="#"
  155. ;;
  156. *)
  157. AC_MSG_RESULT(Unrecognised OS $host_os)
  158. AC_DEFINE_UNQUOTED(OTHEROS,1,[Some strange OS])
  159. UNIXONLY=""
  160. ;;
  161. esac
  162. AC_DEFINE_UNQUOTED([GNUNET_DEFAULT_INTERFACE], $DEFAULT_INTERFACE, [This should be the default choice for the name of the first network interface])
  163. AC_SUBST(DEFAULT_INTERFACE)
  164. # Disable TCP-based IPC on systems that support UNIX domain
  165. # sockets in default configuratin:
  166. AC_SUBST(UNIXONLY)
  167. AC_MSG_CHECKING([for build target])
  168. AM_CONDITIONAL(DARWIN, test "$build_target" = "darwin")
  169. AM_CONDITIONAL(CYGWIN, test "$build_target" = "cygwin")
  170. AM_CONDITIONAL(MINGW, test "$build_target" = "mingw")
  171. AM_CONDITIONAL(SOLARIS, test "$build_target" = "solaris")
  172. AM_CONDITIONAL(XFREEBSD, test "$build_target" = "freebsd")
  173. AM_CONDITIONAL(OPENBSD, test "$build_target" = "openbsd")
  174. AM_CONDITIONAL(LINUX, test "$build_target" = "linux")
  175. AM_CONDITIONAL(GNU, test "$build_target" = "gnu")
  176. AC_MSG_RESULT([$build_target])
  177. AC_SUBST(build_target)
  178. AM_CONDITIONAL([am__fastdepOBJC], false)
  179. AC_UNALIGNED_64_ACCESS
  180. # some other checks for standard libs
  181. AC_SEARCH_LIBS([gethostbyname], [nsl ws2_32])
  182. AC_CHECK_LIB(socket, socket)
  183. AC_CHECK_LIB(m, log)
  184. AC_CHECK_LIB(c, getloadavg, AC_DEFINE(HAVE_GETLOADAVG,1,[getloadavg supported]))
  185. AC_CHECK_PROG(VAR_GETOPT_BINARY, getopt, true, false)
  186. AM_CONDITIONAL(HAVE_GETOPT_BINARY, $VAR_GETOPT_BINARY)
  187. AC_CHECK_MEMBER(struct tm.tm_gmtoff,
  188. [AC_DEFINE(HAVE_TM_GMTOFF, 1,
  189. [Define if struct tm has the tm_gmtoff member.])],
  190. ,
  191. [#include <time.h>])
  192. AC_CHECK_DECLS([_stati64])
  193. # 'save' libs; only those libs found so far will be
  194. # linked against _everywhere_. For the others, we
  195. # will be more selective!
  196. SAVE_LIBS=$LIBS
  197. # tests only run on Windows
  198. if test "x$build_target" = "xmingw"
  199. then
  200. AC_CHECK_LIB(plibc, plibc_init, [], [AC_MSG_ERROR([GNUnet requires PlibC on Windows])])
  201. AC_CHECK_LIB(gnurx, regexec, [], [AC_MSG_ERROR([GNUnet requires libgnurx on Windows])])
  202. fi
  203. # libgcrypt
  204. gcrypt=0
  205. NEED_LIBGCRYPT_API=1
  206. NEED_LIBGCRYPT_VERSION=1.6.0
  207. AM_PATH_LIBGCRYPT("$NEED_LIBGCRYPT_API:$NEED_LIBGCRYPT_VERSION", gcrypt=1)
  208. AC_CHECK_DECLS([gcry_mpi_set_opaque_copy], [], [], [[#include <gcrypt.h>]])
  209. if test $gcrypt = 0
  210. then
  211. AC_MSG_ERROR([[
  212. ***
  213. *** You need libgcrypt to build this program.
  214. ** This library is for example available at
  215. *** ftp://ftp.gnupg.org/gcrypt/libgcrypt/
  216. *** (at least version $NEED_LIBGCRYPT_VERSION (API $NEED_LIBGCRYPT_API)
  217. *** is required.)
  218. ***]])
  219. fi
  220. AC_DEFINE_UNQUOTED([NEED_LIBGCRYPT_VERSION], "$NEED_LIBGCRYPT_VERSION", [required libgcrypt version])
  221. # Adam shostack suggests the following for Windows:
  222. # -D_FORTIFY_SOURCE=2 -fstack-protector-all
  223. AC_ARG_ENABLE(gcc-hardening,
  224. AS_HELP_STRING(--enable-gcc-hardening, enable compiler security checks),
  225. [if test x$enableval = xyes; then
  226. CFLAGS="$CFLAGS -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=2 -fstack-protector-all"
  227. CFLAGS="$CFLAGS -fwrapv -fPIE -Wstack-protector"
  228. CFLAGS="$CFLAGS --param ssp-buffer-size=1"
  229. LDFLAGS="$LDFLAGS -pie"
  230. fi])
  231. # Linker hardening options
  232. # Currently these options are ELF specific - you can't use this with MacOSX
  233. AC_ARG_ENABLE(linker-hardening,
  234. AS_HELP_STRING(--enable-linker-hardening, enable linker security fixups),
  235. [if test x$enableval = xyes; then
  236. LDFLAGS="$LDFLAGS -z relro -z now"
  237. fi])
  238. extra_logging=GNUNET_NO
  239. AC_ARG_ENABLE([logging],
  240. AS_HELP_STRING([--enable-logging@<:@=value@:>@],[Enable logging calls. Possible values: yes,no,verbose,veryverbose ('yes' is the default)]),
  241. [AS_IF([test "x$enableval" = "xyes"], [],
  242. [test "x$enableval" = "xno"], [AC_DEFINE([GNUNET_CULL_LOGGING],[],[Define to cull all logging calls])],
  243. [test "x$enableval" = "xverbose"], [extra_logging=GNUNET_YES]
  244. [test "x$enableval" = "xveryverbose"], [extra_logging=\(GNUNET_YES+1\)])
  245. ], [])
  246. AC_DEFINE_UNQUOTED([GNUNET_EXTRA_LOGGING],[$extra_logging],[1 if extra logging is enabled, 2 for very verbose extra logging, 0 otherwise])
  247. # should memory poisoning be enabled?
  248. AC_MSG_CHECKING(whether to poison freed memory)
  249. AC_ARG_ENABLE([poisoning],
  250. [AS_HELP_STRING([--enable-poisoning], [enable poisoning of freed memory (good for debugging)])],
  251. [enable_poisoning=${enableval}],
  252. [
  253. if test "x$extra_logging" != "xGNUNET_NO"; then
  254. enable_poisoning="defaults to yes (extra logging is enabled)"
  255. else
  256. enable_poisoning=no
  257. fi
  258. ])
  259. AC_MSG_RESULT($enable_poisoning)
  260. if test ! "x$enable_poisoning" = "xno"; then
  261. enable_poisoning=1
  262. else
  263. enable_poisoning=0
  264. fi
  265. AC_DEFINE_UNQUOTED([ENABLE_POISONING],[$enable_poisoning],[1 if freed memory should be poisoned, 0 otherwise])
  266. if test $build = $target
  267. then
  268. AC_MSG_CHECKING([for working HMAC])
  269. AC_LANG_PUSH(C)
  270. LIBS="$LIBS $LIBGCRYPT_LIBS"
  271. CFLAGS="$CFLAGS $LIBGCRYPT_CFLAGS"
  272. AC_RUN_IFELSE(
  273. [AC_LANG_PROGRAM([#include <gcrypt.h>
  274. #include <stdio.h>], [[
  275. gcry_md_hd_t mac;
  276. unsigned char data[] = { 0xbf, 0x16, 0x6e, 0x46, 0x3a, 0x6c, 0xf3, 0x93, 0xa7, 0x72,
  277. 0x11, 0xa1, 0xdc, 0x0b, 0x07, 0xdb, 0x1a, 0x5e, 0xd9, 0xb9, 0x81, 0xbe,
  278. 0xea, 0xe4, 0x31, 0x5f, 0x24, 0xff, 0xfe, 0x50, 0x8a, 0xde };
  279. unsigned char key[] = { 0xfc, 0x62, 0x76, 0x35 };
  280. unsigned char result[] = {0xa2, 0xb, 0x1, 0xd9, 0xc0, 0x8b, 0x5a, 0x12, 0x80,
  281. 0xd5, 0x50, 0x12, 0x8e, 0xd0, 0x5b, 0xb6, 0x5c, 0x87, 0x24, 0xe2, 0xd0,
  282. 0xd2, 0xaf, 0x63, 0xae, 0xd1, 0xd6, 0x64, 0x14, 0xe3, 0x6e, 0x61, 0x5b,
  283. 0xd, 0xba, 0x17, 0x7d, 0xd3, 0x10, 0xb1, 0x37, 0x41, 0x91, 0x7d, 0xeb,
  284. 0x1, 0x4d, 0x71, 0xe8, 0x59, 0x71, 0x42, 0x8e, 0xd6, 0xf3, 0x29, 0x3b,
  285. 0x90, 0xf2, 0xd1, 0xaf, 0x65, 0x1e, 0xb3};
  286. if (!gcry_check_version (GCRYPT_VERSION))
  287. {
  288. fprintf (stderr, "Version mismatch %s <-> %s \n", gcry_check_version (NULL), GCRYPT_VERSION);
  289. return 1;
  290. }
  291. gcry_control (GCRYCTL_DISABLE_SECMEM, 0);
  292. gcry_control (GCRYCTL_INITIALIZATION_FINISHED, 0);
  293. if (gcry_md_open(&mac, GCRY_MD_SHA512, GCRY_MD_FLAG_HMAC) != GPG_ERR_NO_ERROR)
  294. {
  295. fprintf (stderr, "gcry_md_open error\n");
  296. return 2;
  297. }
  298. gcry_md_setkey (mac, key, sizeof (key));
  299. gcry_md_write (mac, data, sizeof (data));
  300. if (memcmp(gcry_md_read (mac, 0), result, gcry_md_get_algo_dlen (gcry_md_get_algo (mac))) != 0)
  301. {
  302. fprintf (stderr, "memcmp error\n");
  303. return 3;
  304. }
  305. gcry_md_close (mac);
  306. return 0;
  307. ]])],
  308. [AC_MSG_RESULT([yes])],
  309. [
  310. RESULT=$?
  311. if test $RESULT = 3
  312. then
  313. AC_MSG_FAILURE([HMAC test vector does not match. This is a known problem with libgcrypt 1.2.2 on Windows and fixed in 1.4.6.])
  314. fi
  315. if test $RESULT = 2
  316. then
  317. AC_MSG_FAILURE([HMAC test failed])
  318. fi
  319. if test $RESULT = 1
  320. then
  321. AC_MSG_FAILURE([libgcrypt header version does not match library version])
  322. fi
  323. ],
  324. [AC_MSG_RESULT([cross compiling, test skipped])])
  325. AC_LANG_POP(C)
  326. fi # $build = $target
  327. # check for bluetooth library
  328. bluetooth=0
  329. AC_CHECK_LIB(bluetooth, ba2str,[AC_CHECK_HEADER([bluetooth/bluetooth.h],bluetooth=1)])
  330. if test "$bluetooth" = 1
  331. then
  332. AM_CONDITIONAL(HAVE_LIBBLUETOOTH, true)
  333. AC_DEFINE([HAVE_LIBBLUETOOTH],[1],[Have bluetooth library])
  334. else
  335. AM_CONDITIONAL(HAVE_LIBBLUETOOTH, false)
  336. fi
  337. if test "$build_target" = "mingw"
  338. then
  339. bluetooth=1
  340. fi
  341. # check for libpulse(audio) library
  342. pulse=0
  343. AC_CHECK_LIB(pulse,pa_stream_peek,
  344. [AC_CHECK_HEADER([pulse/simple.h],pulse=1)])
  345. if test "$pulse" = 1
  346. then
  347. AC_DEFINE([HAVE_PULSE],[1],[Have libpulse(audio) library])
  348. fi
  349. if test "$build_target" = "mingw"
  350. then
  351. pulse=0
  352. fi
  353. # check for libopus(audio) library
  354. opus=0
  355. AC_CHECK_LIB(opus,opus_decode_float,
  356. [AC_CHECK_HEADER([opus/opus.h],
  357. [AC_CHECK_DECL([OPUS_SET_GAIN],[opus=1],[],[[#include <opus/opus.h>]]
  358. )]
  359. )]
  360. )
  361. if test "$opus" = 1
  362. then
  363. AC_DEFINE([HAVE_OPUS],[1],[Have libopus library])
  364. fi
  365. # libogg
  366. AC_CHECK_LIB(ogg, ogg_stream_flush_fill,
  367. [AC_CHECK_HEADERS([ogg/ogg.h],
  368. AM_CONDITIONAL(HAVE_OGG, true)
  369. ogg=1
  370. AC_DEFINE(HAVE_OGG,1,[Have ogg]),
  371. AM_CONDITIONAL(HAVE_OGG, false)
  372. ogg=0
  373. AC_DEFINE(HAVE_OGG,0,[lacking ogg]))],
  374. AM_CONDITIONAL(HAVE_OGG, false)
  375. ogg=0)
  376. gst=0
  377. PKG_CHECK_MODULES(
  378. [GST],
  379. [glib-2.0 gobject-2.0 gstreamer-1.0 gstreamer-app-1.0 gstreamer-audio-1.0],
  380. [
  381. gst=1
  382. AC_MSG_RESULT(ok)
  383. ], [
  384. gst=0
  385. AC_MSG_RESULT(not found)
  386. ])
  387. # Pulse Audio
  388. if test "x$pulse" != "x1" -o "x$opus" != "x1" -o "x$ogg" != "x1"
  389. then
  390. if test "x$gst" != "x1"
  391. then
  392. conversation_backend=none
  393. AM_CONDITIONAL(BUILD_PULSE_HELPERS, false)
  394. AM_CONDITIONAL(BUILD_GST_HELPERS, false)
  395. else
  396. conversation_backend=gst
  397. AM_CONDITIONAL(BUILD_PULSE_HELPERS, false)
  398. AM_CONDITIONAL(BUILD_GST_HELPERS, true)
  399. fi
  400. else
  401. conversation_backend=pulse
  402. AM_CONDITIONAL(BUILD_PULSE_HELPERS, true)
  403. AM_CONDITIONAL(BUILD_GST_HELPERS, false)
  404. fi
  405. # libgnurl
  406. LIBGNURL_CHECK_CONFIG(,7.34.0,gnurl=1,gnurl=0)
  407. if test "$gnurl" = 1
  408. then
  409. AM_CONDITIONAL(HAVE_LIBGNURL, true)
  410. AC_DEFINE([HAVE_LIBGNURL],[1],[Have libgnurl])
  411. else
  412. AM_CONDITIONAL(HAVE_LIBGNURL, false)
  413. fi
  414. SAVE_CPPFLAGS=$CPPFLAGS
  415. CPPFLAGS="$LIBGNURL_CPPFLAGS $LIBCURL_CPPFLAGS $CPPFLAGS"
  416. LIBS="$LIBGNURL $LIBCURL $LIBS"
  417. # libcurl-gnutls
  418. LIBCURL_CHECK_CONFIG(,7.34.0,[curl=true],[curl=false])
  419. if test "x$curl" = xtrue
  420. then
  421. AC_CHECK_HEADERS([curl/curl.h],
  422. AC_CHECK_DECLS(CURLINFO_TLS_SESSION,[curl=true],[curl=false],[[#include <curl/curl.h>]]),
  423. [curl=false])
  424. AC_CHECK_HEADERS([gnurl/curl.h],
  425. AC_CHECK_DECLS(CURLINFO_TLS_SESSION,[curl=true],,[[#include <gnurl/curl.h>]]))
  426. # need libcurl-gnutls.so, everything else is not acceptable
  427. AC_CHECK_LIB([curl-gnutls],[curl_easy_getinfo],,[curl=false])
  428. # cURL must support CURLINFO_TLS_SESSION, version >= 7.34
  429. fi
  430. # Check for curl/curl.h and gnurl/curl.h so we can use #ifdef
  431. # HAVE_CURL_CURL_H later (the above LIBCURL_CHECK_CONFIG accepted
  432. # *either* header set).
  433. AC_CHECK_HEADERS([curl/curl.h],,
  434. curl=false
  435. AC_CHECK_HEADERS([gnurl/curl.h],,
  436. gnurl=false))
  437. if test x$curl = xfalse
  438. then
  439. AM_CONDITIONAL(HAVE_LIBCURL, false)
  440. if test "$gnurl" = 0
  441. then
  442. AC_MSG_WARN([GNUnet requires libcurl-gnutls >= 7.34])
  443. fi
  444. else
  445. AM_CONDITIONAL(HAVE_LIBCURL, true)
  446. AC_DEFINE([HAVE_LIBCURL],[1],[Have CURL])
  447. fi
  448. # restore LIBS & CPPFLAGS
  449. LIBS=$SAVE_LIBS
  450. CPPFLAGS=$SAVE_CPPFLAGS
  451. AC_CHECK_HEADERS([glpk.h],[glpk=true],[gplk=false])
  452. # GLPK must support glpk_init_env, version >= 4.43
  453. AC_CHECK_LIB([glpk],[glp_init_env],,[gplk=false])
  454. # GLPK must support atm MLP presolving, version >= 4.32
  455. AC_CHECK_MEMBERS(glp_iocp.presolve,,[gplk=false],[[#include <glpk.h>]])
  456. if test x$gplk = xfalse
  457. then
  458. AM_CONDITIONAL(HAVE_LIBGLPK, false)
  459. AC_MSG_WARN([GNUnet requires GLPK >= 4.32])
  460. else
  461. AM_CONDITIONAL(HAVE_LIBGLPK, true)
  462. AC_DEFINE([HAVE_LIBGLPK],[1],[Have GLPK])
  463. fi
  464. AC_CHECK_HEADERS([nss.h],[nss=true],[nss=false])
  465. if test x$nss = xfalse
  466. then
  467. AM_CONDITIONAL(HAVE_GLIBCNSS, false)
  468. AC_MSG_WARN([No GNU libc nss header, will not build NSS plugin])
  469. else
  470. AM_CONDITIONAL(HAVE_GLIBCNSS, true)
  471. fi
  472. # test for kvm and kstat (for CPU stats under BSD/Solaris)
  473. AC_CHECK_LIB([kvm],[kvm_open])
  474. AC_CHECK_LIB([kstat],[kstat_open])
  475. # should the build process be restricted to the code required
  476. # for GNU Taler wallets?
  477. AC_MSG_CHECKING(whether to compile GNU Taler Wallet library ONLY)
  478. AC_ARG_ENABLE([taler-wallet],
  479. [AS_HELP_STRING([--enable-taler-wallet], [only compile for Taler wallet])],
  480. [taler_only=${enableval}],
  481. [taler_only=no])
  482. AC_MSG_RESULT($taler_only)
  483. AM_CONDITIONAL([TALER_ONLY], [test "x$taler_only" = "xyes"])
  484. # test for libextractor
  485. extractor=0
  486. AC_MSG_CHECKING(for libextractor)
  487. AC_ARG_WITH(extractor,
  488. [ --with-extractor=PFX base of libextractor installation],
  489. [AC_MSG_RESULT([$with_extractor])
  490. case $with_extractor in
  491. no)
  492. ;;
  493. yes)
  494. AC_CHECK_HEADERS(extractor.h,
  495. AC_CHECK_LIB([extractor], [EXTRACTOR_plugin_add_defaults],
  496. extractor=1))
  497. ;;
  498. *)
  499. LDFLAGS="-L$with_extractor/lib $LDFLAGS"
  500. CPPFLAGS="-I$with_extractor/include $CPPFLAGS"
  501. AC_CHECK_HEADERS(extractor.h,
  502. AC_CHECK_LIB([extractor], [EXTRACTOR_plugin_add_defaults],
  503. EXT_LIB_PATH="-L$with_extractor/lib $EXT_LIB_PATH"
  504. extractor=1))
  505. ;;
  506. esac
  507. ],
  508. [AC_MSG_RESULT([--with-extractor not specified])
  509. AC_CHECK_HEADERS(extractor.h,
  510. AC_CHECK_LIB([extractor], [EXTRACTOR_plugin_add_defaults],
  511. extractor=1))])
  512. # restore LIBS
  513. LIBS=$SAVE_LIBS
  514. if test "$extractor" != 1
  515. then
  516. AM_CONDITIONAL(HAVE_LIBEXTRACTOR, false)
  517. AC_DEFINE([HAVE_LIBEXTRACTOR],[0],[Lacking libextractor])
  518. else
  519. AM_CONDITIONAL(HAVE_LIBEXTRACTOR, true)
  520. AC_DEFINE([HAVE_LIBEXTRACTOR],[1],[Have libextractor])
  521. fi
  522. if test "$taler_only" != yes
  523. then
  524. # Check for libltdl header (#2999)
  525. ltdl=0
  526. AC_MSG_CHECKING(for libltdl)
  527. AC_ARG_WITH(ltdl,
  528. [ --with-ltdl=PFX base of libltdl installation],
  529. [AC_MSG_RESULT([$with_ltdl])
  530. case $with_ltdl in
  531. no)
  532. ;;
  533. yes)
  534. AC_CHECK_HEADERS(ltdl.h,
  535. AC_CHECK_LIB([ltdl], [lt_dlopenext],
  536. ltdl=1))
  537. ;;
  538. *)
  539. LDFLAGS="-L$with_ltdl/lib $LDFLAGS"
  540. CPPFLAGS="-I$with_ltdl/include $CPPFLAGS"
  541. AC_CHECK_HEADERS(ltdl.h,
  542. AC_CHECK_LIB([ltdl], [lt_dlopenext],
  543. EXT_LIB_PATH="-L$with_ltdl/lib $EXT_LIB_PATH"
  544. ltdl=1))
  545. ;;
  546. esac
  547. ],
  548. [AC_MSG_RESULT([--with-ltdl not specified])
  549. AC_CHECK_HEADERS(ltdl.h,
  550. AC_CHECK_LIB([ltdl], [lt_dlopenext],
  551. ltdl=1))])
  552. if test x$ltdl = x1
  553. then
  554. AC_MSG_RESULT([libltdl found])
  555. else
  556. AC_MSG_ERROR([GNUnet requires libltdl (from GNU libtool), try installing libltdl-dev])
  557. fi
  558. # restore LIBS
  559. LIBS=$SAVE_LIBS
  560. # libidn
  561. AC_MSG_CHECKING([if Libidn can be used])
  562. AC_ARG_WITH(libidn, AC_HELP_STRING([--with-libidn=[DIR]],
  563. [Support IDN (needs GNU Libidn)]),
  564. libidn=$withval, libidn=yes)
  565. if test "$libidn" != "no"; then
  566. if test "$libidn" != "yes"; then
  567. LDFLAGS="${LDFLAGS} -L$libidn/lib"
  568. CPPFLAGS="${CPPFLAGS} -I$libidn/include"
  569. fi
  570. fi
  571. libidn=no
  572. AC_CHECK_HEADER(idna.h,
  573. AC_CHECK_LIB(idn, stringprep_check_version,
  574. [libidn=yes LIBS="${LIBS} -lidn"], []), [])
  575. if test "$libidn" != "yes"; then
  576. AC_MSG_FAILURE([GNUnet requires libidn.
  577. libidn-1.13 should be sufficient, newer versions work too.])
  578. fi
  579. AC_MSG_RESULT($libidn)
  580. # test for zlib
  581. SAVE_LDFLAGS=$LDFLAGS
  582. SAVE_CPPFLAGS=$CPPFLAGS
  583. AC_ARG_WITH(zlib,
  584. [ --with-zlib[[=DIR]] use libz in DIR],
  585. [AS_IF([test "$withval" = "no"],
  586. [AC_MSG_ERROR([GNUnet requires zlib])],
  587. [test "$withval" != "yes"],
  588. [
  589. Z_DIR=$withval
  590. CPPFLAGS="${CPPFLAGS} -I$withval/include"
  591. LDFLAGS="${LDFLAGS} -L$withval/lib"
  592. ])
  593. ])
  594. AC_CHECK_HEADER(zlib.h,
  595. [],
  596. [AC_MSG_ERROR([GNUnet requires zlib])])
  597. AC_CHECK_LIB(z, compress2,
  598. [
  599. AC_DEFINE([HAVE_ZLIB], [], [Have compression library])
  600. if test "x${Z_DIR}" != "x"; then
  601. Z_CFLAGS="-I${Z_DIR}/include"
  602. Z_LIBS="-L${Z_DIR}/lib -lz"
  603. else
  604. Z_LIBS="-lz"
  605. fi],
  606. [AC_MSG_ERROR([GNUnet requires zlib])])
  607. AC_SUBST(Z_CFLAGS)
  608. AC_SUBST(Z_LIBS)
  609. if test "$enable_shared" = "no"
  610. then
  611. AC_MSG_ERROR([GNUnet only works with shared libraries. Sorry.])
  612. fi
  613. # restore LIBS
  614. LIBS=$SAVE_LIBS
  615. fi
  616. # check for iconv
  617. AM_ICONV
  618. # test for libunistring
  619. gl_LIBUNISTRING
  620. if test $HAVE_LIBUNISTRING != yes; then
  621. AC_MSG_ERROR([GNUnet requires libunistring])
  622. fi
  623. if test $gl_libunistring_hexversion -le 2305; then
  624. AC_MSG_ERROR([GNUnet requires libunistring >= 0.9.1.1])
  625. fi
  626. # restore LIBS
  627. LIBS=$SAVE_LIBS
  628. # Checks for standard header files.
  629. AC_HEADER_DIRENT
  630. AC_HEADER_STDC
  631. # Check for headers that are ALWAYS required
  632. AC_CHECK_HEADERS([fcntl.h math.h errno.h ctype.h limits.h stdio.h stdlib.h string.h unistd.h stdarg.h signal.h locale.h sys/stat.h sys/types.h],,AC_MSG_ERROR([Compiling GNUnet requires standard UNIX headers files]))
  633. # Checks for headers that are only required on some systems or opional (and where we do NOT abort if they are not there)
  634. AC_CHECK_HEADERS([malloc.h malloc/malloc.h malloc/malloc_np.h langinfo.h sys/param.h sys/mount.h sys/statvfs.h sys/select.h sockLib.h sys/mman.h sys/msg.h sys/vfs.h arpa/inet.h fcntl.h libintl.h netdb.h netinet/in.h sys/ioctl.h sys/socket.h sys/time.h unistd.h kstat.h sys/sysinfo.h kvm.h sys/file.h sys/resource.h ifaddrs.h mach/mach.h stddef.h sys/timeb.h terminos.h argz.h ucred.h sys/ucred.h endian.h sys/endian.h execinfo.h byteswap.h])
  635. # FreeBSD requires something more funky for netinet/in_systm.h and netinet/ip.h...
  636. AC_CHECK_HEADERS([sys/types.h netinet/in_systm.h netinet/in.h netinet/ip.h],,,
  637. [#ifdef HAVE_SYS_TYPES_H
  638. #include <sys/types.h>
  639. #endif
  640. #ifdef HAVE_NETINET_IN_SYSTM_H
  641. #include <netinet/in_systm.h>
  642. #endif
  643. #ifdef HAVE_NETINET_IN_H
  644. #include <netinet/in.h>
  645. #endif
  646. ])
  647. SAVE_LDFLAGS=$LDFLAGS
  648. SAVE_CPPFLAGS=$CPPFLAGS
  649. # test for sqlite
  650. sqlite=false
  651. AC_MSG_CHECKING(for SQLite)
  652. AC_ARG_WITH(sqlite,
  653. [ --with-sqlite=PFX base of SQLite installation],
  654. [AC_MSG_RESULT("$with_sqlite")
  655. case $with_sqlite in
  656. no)
  657. ;;
  658. yes)
  659. AC_CHECK_HEADERS(sqlite3.h,
  660. sqlite=true)
  661. ;;
  662. *)
  663. LDFLAGS="-L$with_sqlite/lib $LDFLAGS"
  664. CPPFLAGS="-I$with_sqlite/include $CPPFLAGS"
  665. AC_CHECK_HEADERS(sqlite3.h,
  666. EXT_LIB_PATH="-L$with_sqlite/lib $EXT_LIB_PATH"
  667. SQLITE_LDFLAGS="-L$with_sqlite/lib"
  668. SQLITE_CPPFLAGS="-I$with_sqlite/include"
  669. sqlite=true)
  670. LDFLAGS=$SAVE_LDFLAGS
  671. CPPFLAGS=$SAVE_CPPFLAGS
  672. ;;
  673. esac
  674. ],
  675. [AC_MSG_RESULT([--with-sqlite not specified])
  676. AC_CHECK_HEADERS(sqlite3.h, sqlite=true)])
  677. AM_CONDITIONAL(HAVE_SQLITE, test x$sqlite = xtrue)
  678. AC_SUBST(SQLITE_CPPFLAGS)
  679. AC_SUBST(SQLITE_LDFLAGS)
  680. # test for postgres
  681. postgres=false
  682. AX_LIB_POSTGRESQL([])
  683. if test "$found_postgresql" = "yes"; then
  684. postgres=true
  685. fi
  686. AM_CONDITIONAL(HAVE_POSTGRESQL, test x$postgres = xtrue)
  687. LDFLAGS=$SAVE_LDFLAGS
  688. CPPFLAGS=$SAVE_CPPFLAGS
  689. # mysql & windows
  690. AC_CHECK_TYPES([sigset_t, off_t], [], [], [#include <sys/types.h>])
  691. AC_CHECK_TYPES([size_t], [], [], [#include <stdio.h>])
  692. if test "$build_target" = "mingw"
  693. then
  694. CYGWIN_MYSQL_MAGIC="#include <mysql/my_global.h>"
  695. fi
  696. # test for mysql
  697. mysql=false
  698. mysqlfail=false
  699. SAVE_LDFLAGS=$LDFLAGS
  700. SAVE_CPPFLAGS=$CPPFLAGS
  701. AC_MSG_CHECKING(for mysql)
  702. AC_ARG_WITH(mysql,
  703. [ --with-mysql=PFX base of MySQL installation],
  704. [AC_MSG_RESULT("$with_mysql")
  705. if test "$with_mysql" != "no"
  706. then
  707. if test "$with_mysql" != "yes"
  708. then
  709. LDFLAGS="-L$with_mysql/lib -L$with_mysql/lib/mysql $LDFLAGS $ZLIBS"
  710. CPPFLAGS="-I$with_mysql/include $CPPFLAGS"
  711. fi
  712. AC_CHECK_HEADERS(mysql/mysql.h,
  713. AC_CHECK_LIB(mysqlclient, mysql_init,
  714. MYSQL_LDFLAGS="-L$with_mysql/lib -L$with_mysql/lib/mysql"
  715. MYSQL_CPPFLAGS="-I$with_mysql/include"
  716. mysql=true), [], [$CYGWIN_MYSQL_MAGIC])
  717. fi
  718. ],
  719. [AC_MSG_RESULT([--with-mysql not specified])
  720. if test -d "/usr/lib64/mysql"; then
  721. MYSQL_LIBDIR="/usr/lib64/mysql"
  722. elif test -d "/usr/lib/mysql"; then
  723. MYSQL_LIBDIR="/usr/lib/mysql"
  724. else
  725. MYSQL_LIBDIR="/usr/lib"
  726. fi
  727. LDFLAGS="-L$MYSQL_LIBDIR $LDFLAGS $ZLIBS"
  728. AC_CHECK_LIB(mysqlclient, mysql_init,
  729. [AC_CHECK_HEADERS(mysql/mysql.h,
  730. MYSQL_LDFLAGS="-L$MYSQL_LIBDIR"
  731. mysql=true
  732. , [], [$CYGWIN_MYSQL_MAGIC])])
  733. ])
  734. AC_SUBST(MYSQL_LDFLAGS)
  735. AC_SUBST(MYSQL_CPPFLAGS)
  736. # additional version check for mysql
  737. AC_ARG_ENABLE(mysql-version-check, [ --disable-mysql-version-check do not check MySQL version],, enable_mysql_version_check=yes)
  738. if test "$mysql" = "true" -a "x$enable_mysql_version_check" = "xyes"
  739. then
  740. AC_MSG_CHECKING(mysql version)
  741. AC_COMPILE_IFELSE([AC_LANG_PROGRAM(
  742. [[$CYGWIN_MYSQL_MAGIC
  743. #include <mysql/mysql.h>]],
  744. [[
  745. #if (MYSQL_VERSION_ID < 40100)
  746. #error needs at least version >= 4.1
  747. #endif
  748. int main () { return 0; }
  749. ]])
  750. ],mysql=true,mysql=false)
  751. if test "$mysql" = "false"
  752. then
  753. mysqlfail=true
  754. AC_MSG_RESULT([fail, >= 4.1 required])
  755. else
  756. AC_MSG_RESULT(ok)
  757. fi
  758. fi
  759. AM_CONDITIONAL(HAVE_MYSQL, test x$mysql = xtrue)
  760. AM_CONDITIONAL(HAVE_MYSQLE, test "0" = "1")
  761. # restore LIBS
  762. LIBS=$SAVE_LIBS
  763. LDFLAGS=$SAVE_LDFLAGS
  764. CPPFLAGS=$SAVE_CPPFLAGS
  765. if test "$sqlite" = 0 -a "$mysql" = 0
  766. then
  767. AC_MSG_ERROR([GNUnet requires SQLite or MySQL])
  768. fi
  769. # libmicrohttpd
  770. lmhd=0
  771. AC_MSG_CHECKING([for libmicrohttpd])
  772. AC_ARG_WITH(microhttpd,
  773. [ --with-microhttpd=PFX base of libmicrohttpd installation],
  774. [AC_MSG_RESULT([$with_microhttpd])
  775. case $with_microhttpd in
  776. no)
  777. ;;
  778. yes)
  779. AC_CHECK_HEADERS([microhttpd.h],
  780. AC_CHECK_DECL(MHD_OPTION_PER_IP_CONNECTION_LIMIT,
  781. AC_CHECK_LIB([microhttpd], [MHD_get_fdset2],
  782. [AC_MSG_CHECKING([for libmicrohttpd >= 0.9.32])
  783. AC_COMPILE_IFELSE([AC_LANG_SOURCE([
  784. #include "$native_srcdir/src/include/platform.h"
  785. #include <microhttpd.h>
  786. #if (MHD_VERSION < 0x0093200)
  787. #error needs at least version 0.9.32
  788. #endif
  789. int main () { return 0; }
  790. ])],
  791. [AC_MSG_RESULT(ok)
  792. lmhd=1],
  793. [AC_MSG_RESULT(failed)])]),
  794. [],[#include "$native_srcdir/src/include/platform.h"
  795. #include <microhttpd.h>]),,
  796. [#include "$native_srcdir/src/include/platform.h"])
  797. ;;
  798. *)
  799. LDFLAGS="-L$with_microhttpd/lib $LDFLAGS"
  800. CPPFLAGS="-I$with_microhttpd/include $CPPFLAGS"
  801. AC_CHECK_HEADERS(microhttpd.h,
  802. AC_CHECK_DECL(MHD_OPTION_PER_IP_CONNECTION_LIMIT,
  803. AC_CHECK_LIB([microhttpd], [MHD_get_fdset2],
  804. EXT_LIB_PATH="-L$with_microhttpd/lib $EXT_LIB_PATH"
  805. [AC_MSG_CHECKING([for libmicrohttpd >= 0.9.32])
  806. AC_COMPILE_IFELSE([AC_LANG_SOURCE([
  807. #include "$native_srcdir/src/include/platform.h"
  808. #include <microhttpd.h>
  809. #if (MHD_VERSION < 0x0093200)
  810. #error needs at least version 0.9.32
  811. #endif
  812. int main () { return 0; }
  813. ])],
  814. [AC_MSG_RESULT(ok)
  815. lmhd=1],
  816. [AC_MSG_RESULT(failed)])]),
  817. [],[#include "$native_srcdir/src/include/platform.h"
  818. #include <microhttpd.h>]),,
  819. [#include "$native_srcdir/src/include/platform.h"])
  820. ;;
  821. esac
  822. ],
  823. [AC_MSG_RESULT([--with-microhttpd not specified])
  824. AC_CHECK_HEADERS([microhttpd.h],
  825. AC_CHECK_DECL(MHD_OPTION_PER_IP_CONNECTION_LIMIT,
  826. AC_CHECK_LIB([microhttpd], [MHD_get_fdset2],
  827. [AC_MSG_CHECKING([for libmicrohttpd >= 0.9.32])
  828. AC_COMPILE_IFELSE([AC_LANG_SOURCE([
  829. #include "$native_srcdir/src/include/platform.h"
  830. #include <microhttpd.h>
  831. #if (MHD_VERSION < 0x0093200)
  832. #error needs at least version 0.9.32
  833. #endif
  834. ])],
  835. [AC_MSG_RESULT(ok)
  836. lmhd=1],
  837. [AC_MSG_RESULT(failed)])]),
  838. [],[#include "$native_srcdir/src/include/platform.h"
  839. #include <microhttpd.h>]),,
  840. [#include "$native_srcdir/src/include/platform.h"])])
  841. AM_CONDITIONAL(HAVE_MHD, test x$lmhd = x1)
  842. AC_DEFINE_UNQUOTED([HAVE_MHD], $lmhd, [We have libmicrohttpd])
  843. # restore LIBS
  844. LIBS=$SAVE_LIBS
  845. # check for python & pexpect (used for some testcases only)
  846. AM_PATH_PYTHON([2.6],, [:])
  847. AM_CONDITIONAL([HAVE_PYTHON], [test "$PYTHON" != :])
  848. # check for gettext
  849. AM_GNU_GETTEXT([external])
  850. AM_GNU_GETTEXT_VERSION([0.19.3])
  851. # Checks for standard typedefs, structures, and compiler characteristics.
  852. AC_TYPE_PID_T
  853. AC_TYPE_SIZE_T
  854. AC_TYPE_MODE_T
  855. AC_HEADER_TIME
  856. AC_HEADER_STAT
  857. AC_HEADER_STDBOOL
  858. AC_STRUCT_TM
  859. AC_CHECK_MEMBER([struct sockaddr_in.sin_len],
  860. [ AC_DEFINE(HAVE_SOCKADDR_IN_SIN_LEN, 1, [Do we have sockaddr_in.sin_len?])
  861. ],
  862. [],
  863. [
  864. #include <sys/types.h>
  865. #include <sys/socket.h>
  866. #include <netinet/in.h>
  867. ])
  868. # Checks for library functions.
  869. AC_FUNC_CLOSEDIR_VOID
  870. AC_FUNC_FORK
  871. AC_PROG_GCC_TRADITIONAL
  872. AC_FUNC_MEMCMP
  873. AC_FUNC_SELECT_ARGTYPES
  874. AC_FUNC_CHOWN
  875. AC_TYPE_SIGNAL
  876. AC_FUNC_STAT
  877. AC_FUNC_STRFTIME
  878. AC_FUNC_VPRINTF
  879. AC_HEADER_SYS_WAIT
  880. AC_TYPE_OFF_T
  881. AC_TYPE_UID_T
  882. AC_CHECK_FUNCS([atoll stat64 strnlen mremap getrlimit setrlimit sysconf initgroups strndup gethostbyname2 getpeerucred getpeereid setresuid $funcstocheck getifaddrs freeifaddrs getresgid mallinfo malloc_size malloc_usable_size getrusage random srandom stat statfs statvfs])
  883. # restore LIBS
  884. LIBS=$SAVE_LIBS
  885. GN_INTLINCL=""
  886. GN_LIBINTL="$LTLIBINTL"
  887. AC_ARG_ENABLE(framework, [ --enable-framework enable Mac OS X framework build helpers],enable_framework_build=$enableval)
  888. AM_CONDITIONAL(WANT_FRAMEWORK, test x$enable_framework_build = xyes)
  889. if test x$enable_framework_build = xyes
  890. then
  891. AC_DEFINE([FRAMEWORK_BUILD], 1, [Build a Mac OS X Framework])
  892. GN_INTLINCL='-I$(top_srcdir)/src/intlemu'
  893. GN_LIBINTL='$(top_builddir)/src/intlemu/libintlemu.la -framework CoreFoundation'
  894. AC_LIB_APPENDTOVAR([CPPFLAGS], [$GN_INTLINCL])
  895. fi
  896. GN_LIB_LDFLAGS="-export-dynamic -no-undefined"
  897. GN_PLUGIN_LDFLAGS="-export-dynamic -avoid-version -module -no-undefined"
  898. AC_SUBST(GN_LIB_LDFLAGS)
  899. AC_SUBST(GN_PLUGIN_LDFLAGS)
  900. AC_SUBST(GN_INTLINCL)
  901. AC_SUBST(GN_LIBINTL)
  902. AC_SUBST(CPPFLAGS)
  903. AC_SUBST(LIBS)
  904. AC_SUBST(LDFLAGS)
  905. AC_SUBST(EXT_LIB_PATH)
  906. AC_SUBST(EXT_LIBS)
  907. AC_SUBST(LIBPREFIX)
  908. AC_SUBST(DLLDIR)
  909. AC_SUBST(EXT_LIB_PATH)
  910. # test for sudo
  911. AC_MSG_CHECKING(for sudo)
  912. AC_ARG_WITH(sudo,
  913. [ --with-sudo=PATH path to sudo binary (or just yes)],
  914. [AC_MSG_RESULT("$with_sudo")
  915. case $with_sudo in
  916. no)
  917. SUDO_BINARY=
  918. ;;
  919. yes)
  920. SUDO_BINARY=sudo
  921. ;;
  922. *)
  923. SUDO_BINARY=$with_sudo
  924. ;;
  925. esac
  926. ],
  927. [AC_MSG_RESULT([no])])
  928. AC_SUBST(SUDO_BINARY)
  929. AM_CONDITIONAL([HAVE_SUDO], [test "x$SUDO_BINARY" != "x" -o -w /])
  930. # test for nssdir
  931. AC_MSG_CHECKING(with nssdir)
  932. AC_ARG_WITH(nssdir,
  933. [ --with-nssdir=PATH where to install NSS plugins],
  934. [AC_MSG_RESULT("$with_nssdir")
  935. case $with_nssdir in
  936. no)
  937. NSS_DIR=
  938. install_nss=0
  939. ;;
  940. yes)
  941. NSS_DIR="/lib"
  942. install_nss=1
  943. ;;
  944. *)
  945. NSS_DIR=$with_nssdir
  946. install_nss=1
  947. ;;
  948. esac
  949. ],
  950. [
  951. if test "x$SUDO_BINARY" != "x" -o -w /
  952. then
  953. NSS_DIR="/lib"
  954. install_nss=1
  955. AC_MSG_RESULT([yes, to /lib])
  956. else
  957. NSS_DIR=
  958. install_nss=0
  959. AC_MSG_RESULT([no])
  960. fi
  961. ])
  962. AC_SUBST(NSS_DIR)
  963. AM_CONDITIONAL([INSTALL_NSS], [test "x$install_nss" != "x0"])
  964. # test for gnunetdns group name
  965. GNUNETDNS_GROUP=gnunetdns
  966. AC_MSG_CHECKING(for gnunetdns group name)
  967. AC_ARG_WITH(gnunetdns,
  968. [ --with-gnunetdns=GRPNAME name for gnunetdns group],
  969. [AC_MSG_RESULT("$with_gnunetdns")
  970. case $with_gnunetdns in
  971. no)
  972. GNUNETDNS_GROUP=gnunet
  973. ;;
  974. yes)
  975. GNUNETDNS_GROUP=gnunetdns
  976. ;;
  977. *)
  978. GNUNETDNS_GROUP=$with_gnunetdns
  979. ;;
  980. esac
  981. ],
  982. [AC_MSG_RESULT([gnunetdns])])
  983. AC_SUBST(GNUNETDNS_GROUP)
  984. # gnutls
  985. gnutls=0
  986. gnutls_dane=0
  987. AC_MSG_CHECKING(for gnutls)
  988. AC_ARG_WITH(gnutls,
  989. [ --with-gnutls=PFX base of gnutls installation],
  990. [AC_MSG_RESULT([$with_gnutls])
  991. case $with_gnutls in
  992. no)
  993. ;;
  994. yes)
  995. AC_CHECK_HEADERS([gnutls/abstract.h],
  996. AC_CHECK_LIB([gnutls], [gnutls_priority_set],
  997. gnutls=true))
  998. AC_CHECK_HEADERS([gnutls/dane.h],
  999. AC_CHECK_LIB([gnutls-dane], [dane_verify_crt_raw],
  1000. gnutls_dane=1))
  1001. ;;
  1002. *)
  1003. LDFLAGS="-L$with_gnutls/lib $LDFLAGS"
  1004. CPPFLAGS="-I$with_gnutls/include $CPPFLAGS"
  1005. AC_CHECK_HEADERS([gnutls/abstract.h],
  1006. AC_CHECK_LIB([gnutls], [gnutls_priority_set],
  1007. EXT_LIB_PATH="-L$with_gnutls/lib $EXT_LIB_PATH"
  1008. gnutls=true))
  1009. AC_CHECK_HEADERS([gnutls/dane.h],
  1010. AC_CHECK_LIB([gnutls-dane], [dane_verify_crt_raw],
  1011. gnutls_dane=1))
  1012. ;;
  1013. esac
  1014. ],
  1015. [AC_MSG_RESULT([--with-gnutls not specified])
  1016. AC_CHECK_HEADERS([gnutls/abstract.h],
  1017. AC_CHECK_LIB([gnutls], [gnutls_priority_set],
  1018. gnutls=true))
  1019. AC_CHECK_HEADERS([gnutls/dane.h],
  1020. AC_CHECK_LIB([gnutls-dane], [dane_verify_crt_raw],
  1021. gnutls_dane=1))
  1022. ])
  1023. AM_CONDITIONAL(HAVE_GNUTLS, test x$gnutls = xtrue)
  1024. AC_DEFINE_UNQUOTED([HAVE_GNUTLS], $gnutls, [We have GnuTLS])
  1025. AM_CONDITIONAL(HAVE_GNUTLS_DANE, test x$gnutls_dane = x1)
  1026. AC_DEFINE_UNQUOTED([HAVE_GNUTLS_DANE], $gnutls_dane, [We have GnuTLS with DANE support])
  1027. # Test if we are building for superMUC
  1028. AC_MSG_CHECKING(if GNUnet is being configured to run on the SuperMUC)
  1029. AC_ARG_ENABLE([supermuc],
  1030. [AS_HELP_STRING([--enable-supermuc],
  1031. [build GNUnet with support to run on the SuperMUC (default is NO)])],
  1032. [if test "x$enable_supermuc" = "xno"
  1033. then
  1034. supermuc=0
  1035. else
  1036. supermuc=1
  1037. fi],
  1038. [supermuc=0
  1039. enable_supermuc=no])
  1040. AC_MSG_RESULT($enable_SUPERMUC)
  1041. AM_CONDITIONAL([ENABLE_SUPERMUC], [test "x$supermuc" = "x1"])
  1042. AC_DEFINE_UNQUOTED([ENABLE_SUPERMUC], [$supermuc], [Build with support for SuperMUC])
  1043. # Check if NSE has to send timestamp information to testbed logger for
  1044. # generating histogram of messages received
  1045. AC_MSG_CHECKING(if NSE has to send timestamp information to testbed logger)
  1046. AC_ARG_ENABLE([nse-histogram],
  1047. [AS_HELP_STRING([--enable-nse-histogram],
  1048. [have NSE send timestamp information to testbed logger for generating
  1049. histogram of received messages. NOT useful for production (default is
  1050. NO)])],
  1051. [if test "x$enableval" = "xno"
  1052. then
  1053. nse_histogram=0
  1054. else
  1055. nse_histogram=1
  1056. fi],
  1057. [nse_histogram=0
  1058. enable_nse_histogram=no])
  1059. AC_MSG_RESULT($enable_nse_histogram)
  1060. AM_CONDITIONAL([ENABLE_NSE_HISTOGRAM], [test "x$nse_histogram" = "x1"])
  1061. AC_DEFINE_UNQUOTED([ENABLE_NSE_HISTOGRAM], [$nse_histogram],
  1062. [have NSE send timestamp information to testbed logger])
  1063. # should 'make check' run tests?
  1064. AC_MSG_CHECKING(whether to run tests)
  1065. AC_ARG_ENABLE([testruns],
  1066. [AS_HELP_STRING([--disable-testruns], [disable running tests on make check (default is YES)])],
  1067. [enable_tests_run=${enableval}],
  1068. [enable_tests_run=yes])
  1069. AC_MSG_RESULT($enable_test_run)
  1070. AM_CONDITIONAL([ENABLE_TEST_RUN], [test "x$enable_tests_run" = "xyes"])
  1071. # should monkey be used when running (certain) services?
  1072. AC_MSG_CHECKING(whether to run with monkey)
  1073. AC_ARG_ENABLE([monkey],
  1074. [AS_HELP_STRING([--enable-monkey], [enable running with monkey])],
  1075. [enable_monkey=${enableval}],
  1076. [enable_monkey=no])
  1077. AC_MSG_RESULT($enable_monkey)
  1078. AM_CONDITIONAL([ENABLE_MONKEY], [test "x$enable_monkey" = "xyes"])
  1079. if test "x$enable_monkey" = "xyes"
  1080. then
  1081. MONKEYPREFIX="pathologist -d $(eval echo ${datarootdir}/gnunet/gnunet.sqlite) -p 30 --"
  1082. else
  1083. MONKEYPREFIX=""
  1084. fi
  1085. AC_SUBST(MONKEYPREFIX)
  1086. # should expensive tests be run?
  1087. AC_MSG_CHECKING(whether to run expensive tests)
  1088. AC_ARG_ENABLE([expensivetests],
  1089. [AS_HELP_STRING([--enable-expensivetests], [enable running expensive testcases])],
  1090. [enable_expensive=${enableval}],
  1091. [enable_expensive=no])
  1092. AC_MSG_RESULT($enable_expensive)
  1093. AM_CONDITIONAL([HAVE_EXPENSIVE_TESTS], [test "x$enable_expensive" = "xyes"])
  1094. # should ports be open for Java services?
  1095. AC_MSG_CHECKING(whether to enable ports for gnunet-java)
  1096. AC_ARG_ENABLE([javaports],
  1097. [AS_HELP_STRING([--enable-javaports], [use non-zero ports for services with Java bindings (default is NO)])],
  1098. [enable_java_ports=${enableval}],
  1099. [enable_java_ports=no])
  1100. AC_MSG_RESULT($enable_java_ports)
  1101. if test "x$enable_java_ports" = "xyes"
  1102. then
  1103. JAVAPORT=""
  1104. else
  1105. JAVAPORT="$UNIXONLY"
  1106. fi
  1107. AC_SUBST(JAVAPORT)
  1108. # should benchmarks be run?
  1109. AC_MSG_CHECKING(whether to run benchmarks during make check)
  1110. AC_ARG_ENABLE([benchmarks],
  1111. [AS_HELP_STRING([--enable-benchmarks], [enable running benchmarks during make check])],
  1112. [enable_benchmarks=${enableval}],
  1113. [enable_benchmarks=no])
  1114. AC_MSG_RESULT($enable_benchmarks)
  1115. AM_CONDITIONAL([HAVE_BENCHMARKS], [test "x$enable_benchmarks" = "xyes"])
  1116. # should gnunet-testing be compiled
  1117. AC_MSG_CHECKING(wether to compile gnunet-testing)
  1118. AC_ARG_ENABLE([testing],
  1119. [AS_HELP_STRING([--disable-testing], [do not build gnunet-testing])],
  1120. [enable_testing=${enableval}],
  1121. [enable_testing=yes])
  1122. AC_MSG_RESULT($enable_testing)
  1123. AM_CONDITIONAL([HAVE_TESTING], [test "x$enable_testing" = "xyes"])
  1124. # should experimental code be compiled (code that may not yet compile)?
  1125. AC_MSG_CHECKING(whether to compile experimental code)
  1126. AC_ARG_ENABLE([experimental],
  1127. [AS_HELP_STRING([--enable-experimental], [enable compiling experimental code])],
  1128. [enable_experimental=${enableval}],
  1129. [enable_experimental=no])
  1130. AC_MSG_RESULT($enable_experimental)
  1131. AM_CONDITIONAL([HAVE_EXPERIMENTAL], [test "x$enable_experimental" = "xyes"])
  1132. # FTBFS right now...
  1133. AC_MSG_CHECKING(whether to compile ATS test code)
  1134. AC_ARG_ENABLE([wachs],
  1135. [AS_HELP_STRING([--enable-wachs], [enable compiling ATS test code])],
  1136. [enable_wachs=${enableval}],
  1137. [enable_wachs=no])
  1138. AC_MSG_RESULT($enable_wachs)
  1139. AM_CONDITIONAL([HAVE_WACHS], [test "x$enable_wachs" = "xyes"])
  1140. # REST API
  1141. AC_MSG_CHECKING(whether to compile REST API)
  1142. AC_ARG_ENABLE([rest],
  1143. [AS_HELP_STRING([--enable-rest], [enable REST])],
  1144. [enable_rest=${enableval}],
  1145. [enable_rest=no])
  1146. AC_MSG_RESULT($enable_rest)
  1147. AM_CONDITIONAL([HAVE_REST], [test "x$enable_rest" = "xyes"])
  1148. # should malicious code be compiled (should only be used for testing)?
  1149. AC_MSG_CHECKING(whether to compile malicious code)
  1150. AC_ARG_ENABLE([malicious],
  1151. [AS_HELP_STRING([--enable-malicious], [enable compiling malicious code])],
  1152. [if test "x$enableval" = "xno"
  1153. then
  1154. malicious=0
  1155. else
  1156. malicious=1
  1157. fi],
  1158. [malicious=0
  1159. enable_malicious=no])
  1160. AC_MSG_RESULT($enable_malicious)
  1161. AM_CONDITIONAL([ENABLE_MALICIOUS], [test 1=$malicious])
  1162. AC_DEFINE_UNQUOTED([ENABLE_MALICIOUS], [$malicious],
  1163. [enable compilation of malicious code])
  1164. # should services be started by default when a peer starts? Some services may
  1165. # choose to never start by default and it is upto the service/module developer to
  1166. # decide it by having "AUTOSTART = NO" instead of "AUTOSTART = @AUTOSTART@" in
  1167. # the service/module's conf.in file.
  1168. AUTOSTART="YES"
  1169. AC_MSG_CHECKING(whether to auto-start peer's services by default)
  1170. AC_ARG_ENABLE([autostart],
  1171. [AS_HELP_STRING([--disable-autostart], [do not start peer's services by default])],
  1172. [enable_autostart=${enableval}
  1173. if test "x$enable_autostart" == "xno"
  1174. then
  1175. AUTOSTART="NO"
  1176. fi
  1177. ],
  1178. [enable_autostart=yes])
  1179. AC_MSG_RESULT($enable_autostart)
  1180. #AM_CONDITIONAL([HAVE_AUTOSTART], [test "x$enable_autostart" = "xyes"])
  1181. AC_SUBST(AUTOSTART)
  1182. # should memory statistics be kept (very expensive CPU-wise!)
  1183. AC_MSG_CHECKING(whether to create expensive statistics on memory use)
  1184. AC_ARG_ENABLE([heapstats],
  1185. [AS_HELP_STRING([--enable-heapstats], [enable expensive heap statistics])],
  1186. [enable_heapstats=1],
  1187. [enable_heapstats=0])
  1188. AC_MSG_RESULT($enable_heapstats)
  1189. AC_DEFINE_UNQUOTED([ENABLE_HEAP_STATISTICS],$enable_heapstats,[enable expensive heap statistics])
  1190. # should code be enabled that works around missing OS functionality on Windows?
  1191. # used for test cases
  1192. if test $build_target = "mingw"
  1193. then
  1194. workarounds=1
  1195. AC_LINK_IFELSE(
  1196. [AC_LANG_PROGRAM(
  1197. [#include <ws2tcpip.h>
  1198. ],[
  1199. int s = socket (0, 0, 0);])
  1200. ],[
  1201. AC_DEFINE_UNQUOTED([HAVE_SOCKET],1,[Define this if socket() is available])
  1202. ],[
  1203. AC_DEFINE_UNQUOTED([HAVE_SOCKET],0,[Define this if socket() is available])
  1204. ])
  1205. AC_LINK_IFELSE(
  1206. [AC_LANG_PROGRAM(
  1207. [#include <ws2tcpip.h>
  1208. ],[
  1209. int s = select (0, NULL, NULL, NULL, NULL);])
  1210. ],[
  1211. AC_DEFINE_UNQUOTED([HAVE_SELECT],1,[Define this if select() is available])
  1212. ],[
  1213. AC_DEFINE_UNQUOTED([HAVE_SELECT],0,[Define this if select() is available])
  1214. ])
  1215. AC_LINK_IFELSE(
  1216. [AC_LANG_PROGRAM(
  1217. [#include <ws2tcpip.h>
  1218. ],[
  1219. struct in_addr i;
  1220. char *s = inet_ntoa (i);])
  1221. ],[
  1222. AC_DEFINE_UNQUOTED([HAVE_INET_NTOA],1,[Define this if inet_ntoa() is available])
  1223. ],[
  1224. AC_DEFINE_UNQUOTED([HAVE_INET_NTOA],0,[Define this if inet_ntoa() is available])
  1225. ])
  1226. AC_LINK_IFELSE(
  1227. [AC_LANG_PROGRAM(
  1228. [#include <ws2tcpip.h>
  1229. ],[
  1230. int s = getnameinfo (NULL, 0, NULL, 0, NULL, 0, 0);])
  1231. ],[
  1232. AC_DEFINE_UNQUOTED([HAVE_GETNAMEINFO],1,[Define this if getnameinfo() is available])
  1233. ],[
  1234. AC_DEFINE_UNQUOTED([HAVE_GETNAMEINFO],0,[Define this if getnameinfo() is available])
  1235. ])
  1236. AC_LINK_IFELSE(
  1237. [AC_LANG_PROGRAM(
  1238. [#include <ws2tcpip.h>
  1239. ],[
  1240. int s = gethostname (NULL, 0);])
  1241. ],[
  1242. AC_DEFINE_UNQUOTED([HAVE_GETHOSTNAME],1,[Define this if gethostname() is available])
  1243. ],[
  1244. AC_DEFINE_UNQUOTED([HAVE_GETHOSTNAME],0,[Define this if gethostname() is available])
  1245. ])
  1246. AC_LINK_IFELSE(
  1247. [AC_LANG_PROGRAM(
  1248. [#include <ws2tcpip.h>
  1249. ],[
  1250. void *s = gethostbyname (NULL);])
  1251. ],[
  1252. AC_DEFINE_UNQUOTED([HAVE_GETHOSTBYNAME],1,[Define this if gethostbyname() is available])
  1253. ],[
  1254. AC_DEFINE_UNQUOTED([HAVE_GETHOSTBYNAME],0,[Define this if gethostbyname() is available])
  1255. ])
  1256. AC_LINK_IFELSE(
  1257. [AC_LANG_PROGRAM(
  1258. [#include <ws2tcpip.h>
  1259. ],[
  1260. void *s = gethostbyaddr (NULL, 0, 0);])
  1261. ],[
  1262. AC_DEFINE_UNQUOTED([HAVE_GETHOSTBYADDR],1,[Define this if gethostbyaddr() is available])
  1263. ],[
  1264. AC_DEFINE_UNQUOTED([HAVE_GETHOSTBYADDR],0,[Define this if gethostbyaddr() is available])
  1265. ])
  1266. AC_LINK_IFELSE(
  1267. [AC_LANG_PROGRAM(
  1268. [#include <ws2tcpip.h>
  1269. ],[
  1270. int s = getaddrinfo (NULL, NULL, NULL, NULL);])
  1271. ],[
  1272. AC_DEFINE_UNQUOTED([HAVE_GETADDRINFO],1,[Define this if getaddrinfo() is available])
  1273. ],[
  1274. AC_DEFINE_UNQUOTED([HAVE_GETADDRINFO],1,[Define this if getaddrinfo() is available])
  1275. ])
  1276. else
  1277. AC_MSG_CHECKING(whether to enable windows workarounds)
  1278. AC_ARG_ENABLE([windows_workarounds],
  1279. [AS_HELP_STRING([--enable-windows_workarounds], [enable workarounds used on Windows (only useful for test cases)])],
  1280. [enable_workarounds=${enableval}],
  1281. [enable_workarounds=no])
  1282. AC_MSG_RESULT($enable_workarounds)
  1283. if test x$enable_windows_workarounds = "xyes"
  1284. then
  1285. workarounds=1
  1286. else
  1287. workarounds=0
  1288. fi
  1289. fi
  1290. AC_DEFINE_UNQUOTED([ENABLE_WINDOWS_WORKAROUNDS], $workarounds, [enable workarounds used on Windows (only useful for test cases)])
  1291. # gcov compilation
  1292. AC_MSG_CHECKING(whether to compile with support for code coverage analysis)
  1293. AC_ARG_ENABLE([coverage],
  1294. AS_HELP_STRING([--enable-coverage],
  1295. [compile the library with code coverage support]),
  1296. [use_gcov=${enableval}],
  1297. [use_gcov=no])
  1298. AC_MSG_RESULT($use_gcov)
  1299. AM_CONDITIONAL([USE_COVERAGE], [test "x$use_gcov" = "xyes"])
  1300. # version info
  1301. AC_PATH_PROG(svnversioncommand, svnversion)
  1302. AC_PATH_PROG(gitcommand, git)
  1303. AC_MSG_CHECKING(for source being under a VCS)
  1304. svn_version=
  1305. gitsvn_version=
  1306. AS_IF([test ! "X$svnversioncommand" = "X"],
  1307. [
  1308. svn_version=$(cd $srcdir ; $svnversioncommand -n 2>/dev/null)
  1309. ])
  1310. AS_IF([test ! "X$gitcommand" = "X"],
  1311. [
  1312. gitsvn_version=$(cd $srcdir ; git log -1 2>/dev/null | grep "git-svn-id" | sed -e 's/.*@\([[0-9]]\+\) .*/\1/')
  1313. ])
  1314. AS_IF([test "X$svn_version" = "X" -o "X$svn_version" = "Xexported" -o "X$svn_version" = "XUnversioned directory"],
  1315. [
  1316. AS_IF([test "X$gitsvn_version" = "X"],
  1317. [
  1318. vcs_name="no"
  1319. vcs_version="\"release\""
  1320. ],
  1321. [
  1322. vcs_name="yes, git-svn"
  1323. vcs_version="\"svn-r$gitsvn_version\""
  1324. ])
  1325. ],
  1326. [
  1327. vcs_name="yes, svn"
  1328. vcs_version="\"svn-r$svn_version\""
  1329. ])
  1330. AC_MSG_RESULT($vcs_name)
  1331. AC_MSG_CHECKING(VCS version)
  1332. AC_MSG_RESULT($vcs_version)
  1333. AC_DEFINE_UNQUOTED(VCS_VERSION, [$vcs_version], [VCS revision/hash or tarball version])
  1334. AC_CONFIG_FILES([
  1335. Makefile
  1336. contrib/Makefile
  1337. doc/Makefile
  1338. doc/man/Makefile
  1339. doc/doxygen/Makefile
  1340. m4/Makefile
  1341. po/Makefile.in
  1342. src/Makefile
  1343. src/arm/Makefile
  1344. src/arm/arm.conf
  1345. src/ats/Makefile
  1346. src/ats/ats.conf
  1347. src/ats-tool/Makefile
  1348. src/ats-tests/Makefile
  1349. src/block/Makefile
  1350. src/cadet/Makefile
  1351. src/cadet/cadet.conf
  1352. src/core/Makefile
  1353. src/core/core.conf
  1354. src/consensus/Makefile
  1355. src/consensus/consensus.conf
  1356. src/conversation/Makefile
  1357. src/conversation/conversation.conf
  1358. src/datacache/Makefile
  1359. src/datastore/Makefile
  1360. src/datastore/datastore.conf
  1361. src/dht/Makefile
  1362. src/dht/dht.conf
  1363. src/dns/Makefile
  1364. src/dns/dns.conf
  1365. src/dv/Makefile
  1366. src/dv/dv.conf
  1367. src/env/Makefile
  1368. src/exit/Makefile
  1369. src/fragmentation/Makefile
  1370. src/fs/Makefile
  1371. src/fs/fs.conf
  1372. src/gns/Makefile
  1373. src/gns/gns.conf
  1374. src/gns/nss/Makefile
  1375. src/gnsrecord/Makefile
  1376. src/hello/Makefile
  1377. src/identity/Makefile
  1378. src/identity/identity.conf
  1379. src/include/Makefile
  1380. src/integration-tests/Makefile
  1381. src/hostlist/Makefile
  1382. src/multicast/Makefile
  1383. src/multicast/multicast.conf
  1384. src/mysql/Makefile
  1385. src/namecache/Makefile
  1386. src/namecache/namecache.conf
  1387. src/namestore/Makefile
  1388. src/namestore/namestore.conf
  1389. src/nat/Makefile
  1390. src/nse/Makefile
  1391. src/nse/nse.conf
  1392. src/peerinfo/Makefile
  1393. src/peerinfo/peerinfo.conf
  1394. src/peerinfo-tool/Makefile
  1395. src/peerstore/Makefile
  1396. src/peerstore/peerstore.conf
  1397. src/postgres/Makefile
  1398. src/psyc/Makefile
  1399. src/psyc/psyc.conf
  1400. src/psycstore/Makefile
  1401. src/psycstore/psycstore.conf
  1402. src/pt/Makefile
  1403. src/regex/Makefile
  1404. src/regex/regex.conf
  1405. src/revocation/Makefile
  1406. src/revocation/revocation.conf
  1407. src/rps/Makefile
  1408. src/rps/rps.conf
  1409. src/secretsharing/Makefile
  1410. src/secretsharing/secretsharing.conf
  1411. src/sensor/Makefile
  1412. src/sensor/sensor.conf
  1413. src/sensordashboard/Makefile
  1414. src/sensordashboard/sensordashboard.conf
  1415. src/scalarproduct/Makefile
  1416. src/scalarproduct/scalarproduct.conf
  1417. src/set/Makefile
  1418. src/set/set.conf
  1419. src/social/Makefile
  1420. src/social/social.conf
  1421. src/statistics/Makefile
  1422. src/statistics/statistics.conf
  1423. src/template/Makefile
  1424. src/testbed/Makefile
  1425. src/testbed/testbed.conf
  1426. src/testing/Makefile
  1427. src/topology/Makefile
  1428. src/transport/Makefile
  1429. src/transport/transport.conf
  1430. src/tun/Makefile
  1431. src/util/Makefile
  1432. src/util/resolver.conf
  1433. src/vpn/Makefile
  1434. src/vpn/vpn.conf
  1435. src/rest/Makefile
  1436. pkgconfig/Makefile
  1437. pkgconfig/gnunetarm.pc
  1438. pkgconfig/gnunetats.pc
  1439. pkgconfig/gnunetblock.pc
  1440. pkgconfig/gnunetcadet.pc
  1441. pkgconfig/gnunetconsensus.pc
  1442. pkgconfig/gnunetconversation.pc
  1443. pkgconfig/gnunetcore.pc
  1444. pkgconfig/gnunetdatacache.pc
  1445. pkgconfig/gnunetdatastore.pc
  1446. pkgconfig/gnunetdht.pc
  1447. pkgconfig/gnunetdns.pc
  1448. pkgconfig/gnunetdnsparser.pc
  1449. pkgconfig/gnunetdnsstub.pc
  1450. pkgconfig/gnunetdv.pc
  1451. pkgconfig/gnunetenv.pc
  1452. pkgconfig/gnunetfragmentation.pc
  1453. pkgconfig/gnunetfs.pc
  1454. pkgconfig/gnunetgns.pc
  1455. pkgconfig/gnunethello.pc
  1456. pkgconfig/gnunetidentity.pc
  1457. pkgconfig/gnunetmicrophone.pc
  1458. pkgconfig/gnunetmulticast.pc
  1459. pkgconfig/gnunetmysql.pc
  1460. pkgconfig/gnunetnamestore.pc
  1461. pkgconfig/gnunetnat.pc
  1462. pkgconfig/gnunetnse.pc
  1463. pkgconfig/gnunetpeerinfo.pc
  1464. pkgconfig/gnunetpostgres.pc
  1465. pkgconfig/gnunetpsyc.pc
  1466. pkgconfig/gnunetpsycstore.pc
  1467. pkgconfig/gnunetregex.pc
  1468. pkgconfig/gnunetrevocation.pc
  1469. pkgconfig/gnunetrps.pc
  1470. pkgconfig/gnunetscalarproduct.pc
  1471. pkgconfig/gnunetset.pc
  1472. pkgconfig/gnunetsocial.pc
  1473. pkgconfig/gnunetspeaker.pc
  1474. pkgconfig/gnunetstatistics.pc
  1475. pkgconfig/gnunettestbed.pc
  1476. pkgconfig/gnunettesting.pc
  1477. pkgconfig/gnunettransport.pc
  1478. pkgconfig/gnunettun.pc
  1479. pkgconfig/gnunetutil.pc
  1480. pkgconfig/gnunetvpn.pc
  1481. ])
  1482. AC_OUTPUT
  1483. # Finally: summary!
  1484. # warn user if mysql found but not used due to version
  1485. if test "$mysqlfail" = "true"
  1486. then
  1487. AC_MSG_NOTICE([NOTICE: MySQL found, but too old. MySQL support will not be compiled.])
  1488. fi
  1489. # sqlite
  1490. if test "x$sqlite" = "x0"
  1491. then
  1492. AC_MSG_ERROR([ERROR: sqlite3 not found, but sqlite3 is required.])
  1493. fi
  1494. # libgnurl
  1495. if test "x$gnurl" = "xfalse"
  1496. then
  1497. if test "x$curl" = "xfalse"
  1498. then
  1499. AC_MSG_NOTICE([NOTICE: libgnurl not found. http client support will not be compiled.])
  1500. AC_MSG_WARN([ERROR: libgnurl not found. hostlist daemon will not be compiled, and you probably WANT the hostlist daemon])
  1501. else
  1502. AC_MSG_NOTICE([WARNING: libgnurl not found, trying to use libcurl-gnutls instead.])
  1503. fi
  1504. fi
  1505. # bluetooth
  1506. if test "x$bluetooth" = "x0"
  1507. then
  1508. AC_MSG_NOTICE([NOTICE: bluetooth library not found. bluetooth support will not be compiled.])
  1509. fi
  1510. #gnutls
  1511. if test x$gnutls != xtrue
  1512. then
  1513. AC_MSG_NOTICE([NOTICE: GnuTLS not found, gnunet-gns-proxy will not be built])
  1514. else
  1515. if test "x$gnutls_dane" != "x1"
  1516. then
  1517. AC_MSG_NOTICE([NOTICE: GnuTLS has no DANE support, DANE validation will not be possible])
  1518. fi
  1519. fi
  1520. # java ports
  1521. if test "x$enable_java_ports" = "xyes"
  1522. then
  1523. AC_MSG_NOTICE([NOTICE: opening ports for gnunet-java bindings by default.])
  1524. fi
  1525. # MHD
  1526. if test "x$lmhd" != "x1"
  1527. then
  1528. AC_MSG_NOTICE([NOTICE: libmicrohttpd not found, http transport will not be installed.])
  1529. fi
  1530. # conversation
  1531. if test "x$conversation_backend" = "xnone"
  1532. then
  1533. if test "x$pulse" != "x1"
  1534. then
  1535. AC_MSG_NOTICE([NOTICE: libpulse(audio) not found, conversation will not be built.])
  1536. fi
  1537. if test "x$opus" != "x1"
  1538. then
  1539. AC_MSG_NOTICE([NOTICE: libopus not found, conversation will not be built.])
  1540. fi
  1541. if test "x$gst" != "x1"
  1542. then
  1543. AC_MSG_NOTICE([NOTICE: GStreamer not found, conversation will not be built.])
  1544. fi
  1545. fi
  1546. if test "$extractor" != 1
  1547. then
  1548. AC_MSG_WARN([NOTICE: libextractor not found, but various file-sharing functions require it])
  1549. fi
  1550. AC_MSG_NOTICE([NOTICE: Database support is set to MySQL: $mysql, SQLite: $sqlite, Postgres: $postgres])
  1551. if test "$enable_framework_build" = "yes"
  1552. then
  1553. AC_MSG_NOTICE([NOTICE: Mac OS X framework build enabled.])
  1554. fi
  1555. if test "x$SUDO_BINARY" = "x" -a ! -w /
  1556. then
  1557. AC_MSG_NOTICE([NOTICE: --with-sudo not specified and not running as 'root', will not install GNS NSS library])
  1558. fi
  1559. AC_MSG_NOTICE([********************************************
  1560. Please make sure NOW that you have created a user and group 'gnunet'
  1561. and additionally a group 'gnunetdns':
  1562. addgroup gnunetdns
  1563. adduser gnunet
  1564. Make sure that '/var/lib/gnunet' is owned (and writable) by user
  1565. 'gnunet'. Then, you can compile GNUnet with
  1566. make
  1567. After that, run (if necessary as 'root')
  1568. make install
  1569. to install everything.
  1570. Each GNUnet user should be added to the 'gnunet' group (may
  1571. require fresh login to come into effect):
  1572. adduser USERNAME gnunet
  1573. (run the above command as root once for each of your users, replacing
  1574. "USERNAME" with the respective login names). If you have a global IP
  1575. address, no further configuration is required.
  1576. Optionally, download and compile gnunet-gtk to get a GUI for
  1577. file-sharing and configuration. This is particularly recommended
  1578. if your network setup is non-trivial, as gnunet-setup can be
  1579. used to test in the GUI if your network configuration is working.
  1580. gnunet-setup should be run as the "gnunet" user under X. As it
  1581. does very little with the network, running it as "root" is likely
  1582. also harmless. You can also run it as a normal user, but then
  1583. you have to copy ~/.gnunet/gnunet.conf" over to the "gnunet" user's
  1584. home directory in the end.
  1585. Once you have configured your peer, run (as the 'gnunet' user)
  1586. gnunet-arm -s
  1587. to start the peer. You can then run the various GNUnet-tools as
  1588. your "normal" user (who should only be in the group 'gnunet').
  1589. ********************************************])