configure.ac 72 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137
  1. # This file is part of GNUnet.
  2. # (C) 2001--2019 GNUnet e.V.
  3. #
  4. # GNUnet is free software: you can redistribute it and/or modify it
  5. # under the terms of the GNU Affero General Public License as published
  6. # by the Free Software Foundation, either version 3 of the License,
  7. # or (at your 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. # Affero General Public License for more details.
  13. #
  14. # You should have received a copy of the GNU Affero General Public License
  15. # along with this program. If not, see <http://www.gnu.org/licenses/>.
  16. #
  17. # SPDX-License-Identifier: AGPL3.0-or-later
  18. #
  19. # Process this file with autoconf to produce a configure script.
  20. #
  21. #
  22. AC_PREREQ(2.61)
  23. # Checks for programs.
  24. AC_INIT([gnunet], [0.11.7], [bug-gnunet@gnu.org])
  25. AC_CONFIG_AUX_DIR([build-aux])
  26. # check for legacy option that is no longer supported (#5627) and fail hard
  27. AC_ARG_WITH(nssdir,
  28. [ --with-nssdir=DIR legacy switch, no longer supported, do not use],
  29. [AC_MSG_RESULT([$with_nssdir])
  30. AS_CASE([$with_nssdir],
  31. [no],[],
  32. [AC_MSG_ERROR([--with-nssdir is no longer supported])])
  33. ])
  34. AC_CANONICAL_TARGET
  35. AC_CANONICAL_HOST
  36. AC_CANONICAL_SYSTEM
  37. AM_INIT_AUTOMAKE
  38. m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])], [AM_DEFAULT_VERBOSITY=1 AC_SUBST(AM_DEFAULT_VERBOSITY)])
  39. AC_CONFIG_HEADERS([gnunet_config.h])
  40. AH_TOP([#define _GNU_SOURCE 1])
  41. AC_CONFIG_MACRO_DIR([m4])
  42. AC_PROG_AWK
  43. AC_PROG_CC_C99
  44. AC_PROG_OBJC
  45. AC_PROG_INSTALL
  46. AC_PROG_LN_S
  47. AC_PROG_MAKE_SET
  48. AM_PROG_CC_C_O
  49. LT_INIT([disable-static dlopen win32-dll])
  50. AC_SUBST(MKDIR_P)
  51. # allow for different autotools
  52. AS_AUTOTOOLS_ALTERNATE
  53. # large file support
  54. AC_SYS_LARGEFILE
  55. AC_FUNC_FSEEKO
  56. CFLAGS="-Wall $CFLAGS"
  57. AC_MSG_CHECKING(whether cc can use -fno-strict-aliasing)
  58. # use '-fno-strict-aliasing', but only if the compiler can take it
  59. AS_IF([$CC -fno-strict-aliasing -S -o /dev/null -xc /dev/null >/dev/null 2>&1],
  60. [CFLAGS="-fno-strict-aliasing $CFLAGS"])
  61. # A helper which allows us to check cflags if compiler
  62. AC_DEFUN([CC_CHECK_CFLAGS_SILENT], [
  63. AC_CACHE_VAL(AS_TR_SH([cc_cv_cflags_$1]),
  64. [ac_save_CFLAGS="$CFLAGS"
  65. CFLAGS="$CFLAGS $1 -Werror"
  66. AC_LINK_IFELSE([AC_LANG_SOURCE([int main() { return 0; }])],
  67. [eval "AS_TR_SH([cc_cv_cflags_$1])='yes'"],
  68. [eval "AS_TR_SH([cc_cv_cflags_$1])='no'"])
  69. CFLAGS="$ac_save_CFLAGS"
  70. ])
  71. AS_IF([eval test x$]AS_TR_SH([cc_cv_cflags_$1])[ = xyes],
  72. [$2], [$3])
  73. ])
  74. # CC_CHECK_CFLAG_APPEND(FLAG, [action-if-found], [action-if-not-found])
  75. # Check for CFLAG and appends them to CFLAGS if supported
  76. AC_DEFUN([CC_CHECK_CFLAG_APPEND], [
  77. AC_CACHE_CHECK([if $CC supports -Wno-$1 flag],
  78. AS_TR_SH([cc_cv_cflags_-W$1]),
  79. CC_CHECK_CFLAGS_SILENT([-W$1]) #gcc is stupid. It does not fail with the -W-no option for backwards compat but then shows the error "in case something goes wrong".
  80. )
  81. AS_IF([eval test x$]AS_TR_SH([cc_cv_cflags_-W$1])[ = xyes],
  82. [CFLAGS="$CFLAGS -Wno-$1"; $2], [$3])
  83. ])
  84. # We make heavy use of this, llvm/gcc and gcc-9 give warnings so disable.
  85. CC_CHECK_CFLAG_APPEND([address-of-packed-member])
  86. # Use Linux interface name unless the OS has a different preference
  87. DEFAULT_INTERFACE="\"eth0\""
  88. funcstocheck="getnameinfo gethostname gethostbyname gethostbyaddr getaddrinfo getaddrinfo_a"
  89. # Srcdir in a form that native compiler understands (i.e. DOS path on W32)
  90. native_srcdir=$srcdir
  91. OLD_LDFLAGS="$LDFLAGS"
  92. LDFLAGS="$LDFLAGS -Wl,--unresolved-symbols=report-all"
  93. # Check system type
  94. AS_CASE(["$host_os"],
  95. [*darwin* | *rhapsody* | *macosx*],[
  96. AC_DEFINE_UNQUOTED(DARWIN,1,[This is an Apple Darwin system])
  97. CPPFLAGS="-D_APPLE_C_SOURCE $CPPFLAGS"
  98. CFLAGS="-fno-common $CFLAGS"
  99. LDFLAGS="$OLD_LDFLAGS"
  100. AC_MSG_WARN([WARNING: The VPN application cannot be compiled on your OS])
  101. AC_CHECK_LIB(intl, gettext)
  102. build_target="darwin"
  103. DEFAULT_INTERFACE="\"en0\""
  104. LIBPREFIX=
  105. DLLDIR=lib
  106. UNIXONLY="#"
  107. ],
  108. [linux*],[
  109. AC_DEFINE_UNQUOTED(LINUX,1,[This is a Linux kernel])
  110. build_target="linux"
  111. LIBPREFIX=
  112. DLLDIR=lib
  113. UNIXONLY="#"
  114. AC_PATH_XTRA
  115. ],
  116. [*freebsd*],[
  117. AC_DEFINE_UNQUOTED(SOMEBSD,1,[This is a BSD system])
  118. AC_DEFINE_UNQUOTED(FREEBSD,1,[This is a FreeBSD system])
  119. CFLAGS="-D_THREAD_SAFE $CFLAGS"
  120. build_target="freebsd"
  121. LIBPREFIX=
  122. DLLDIR=lib
  123. UNIXONLY="#"
  124. ],
  125. [*openbsd*],[
  126. AC_DEFINE_UNQUOTED(SOMEBSD,1,[This is a BSD system])
  127. AC_DEFINE_UNQUOTED(OPENBSD,1,[This is an OpenBSD system])
  128. LIBS=`echo $LIBS | sed -e "s/-ldl//"`
  129. build_target="openbsd"
  130. LIBPREFIX=
  131. DLLDIR=lib
  132. UNIXONLY="#"
  133. ],
  134. [*netbsd*],[
  135. AC_DEFINE_UNQUOTED(SOMEBSD,1,[This is a BSD system])
  136. AC_DEFINE_UNQUOTED(NETBSD,1,[This is a NetBSD system])
  137. build_target="netbsd"
  138. LIBPREFIX=
  139. DLLDIR=lib
  140. UNIXONLY="#"
  141. ],
  142. [*solaris*],[
  143. AC_DEFINE_UNQUOTED(SOLARIS,1,[This is a Solaris system])
  144. AC_DEFINE_UNQUOTED(_REENTRANT,1,[Need with solaris or errno doesnt work])
  145. AC_CHECK_LIB(resolv, res_init)
  146. AC_CHECK_LIB(rt, nanosleep)
  147. build_target="solaris"
  148. LIBPREFIX=
  149. DLLDIR=lib
  150. UNIXONLY="#"
  151. ],
  152. [*arm-linux*],[
  153. AC_DEFINE_UNQUOTED(LINUX,1,[This is a Linux kernel])
  154. CFLAGS="-D_REENTRANT -fPIC -pipe $CFLAGS"
  155. build_target="linux"
  156. LIBPREFIX=
  157. DLLDIR=lib
  158. UNIXONLY="#"
  159. ],
  160. [gnu*],[
  161. AC_DEFINE_UNQUOTED(GNU,1,[This is a GNU system])
  162. build_target="gnu"
  163. UNIXONLY="#"
  164. ],
  165. [
  166. AC_MSG_RESULT(Unrecognised OS $host_os)
  167. AC_DEFINE_UNQUOTED(OTHEROS,1,[Some strange OS])
  168. UNIXONLY=""
  169. ])
  170. AC_DEFINE_UNQUOTED([GNUNET_DEFAULT_INTERFACE], $DEFAULT_INTERFACE, [This should be the default choice for the name of the first network interface])
  171. AC_SUBST(DEFAULT_INTERFACE)
  172. # Disable TCP-based IPC on systems that support UNIX domain
  173. # sockets in default configuratin:
  174. AC_SUBST(UNIXONLY)
  175. AC_MSG_CHECKING([for build target])
  176. AM_CONDITIONAL(DARWIN, test "$build_target" = "darwin")
  177. AM_CONDITIONAL(SOLARIS, test "$build_target" = "solaris")
  178. AM_CONDITIONAL(XNETBSD, test "$build_target" = "netbsd")
  179. AM_CONDITIONAL(XFREEBSD, test "$build_target" = "freebsd")
  180. AM_CONDITIONAL(OPENBSD, test "$build_target" = "openbsd")
  181. AM_CONDITIONAL(LINUX, test "$build_target" = "linux")
  182. AM_CONDITIONAL(GNU, test "$build_target" = "gnu")
  183. AC_MSG_RESULT([$build_target])
  184. AC_SUBST(build_target)
  185. AM_CONDITIONAL([am__fastdepOBJC], false)
  186. AC_UNALIGNED_64_ACCESS
  187. # some other checks for standard libs
  188. AC_SEARCH_LIBS([gethostbyname], [nsl ws2_32])
  189. AC_SEARCH_LIBS([memrchr], [],
  190. AC_DEFINE(HAVE_MEMRCHR,1,[memrchr supported]), [])
  191. AC_SEARCH_LIBS([memset_s], [],
  192. AC_DEFINE(HAVE_MEMSET_S,1,[memset_s supported]), [])
  193. AC_SEARCH_LIBS([memset_s], [],
  194. AC_DEFINE(HAVE_EXPLICIT_BZERO,1,[explicit_bzero supported]), [])
  195. AC_CHECK_LIB(socket, socket)
  196. AC_CHECK_LIB(m, log)
  197. AC_CHECK_LIB(c, getloadavg, AC_DEFINE(HAVE_GETLOADAVG,1,[getloadavg supported]))
  198. AC_CHECK_PROG(VAR_GETOPT_BINARY, getopt, true, false)
  199. AM_CONDITIONAL(HAVE_GETOPT_BINARY, $VAR_GETOPT_BINARY)
  200. AC_CHECK_PROG(VAR_SSH_BINARY, ssh, true, false)
  201. AM_CONDITIONAL(HAVE_SSH_BINARY, $VAR_SSH_BINARY)
  202. AM_CONDITIONAL(HAVE_SSH_KEY, ssh -D 12345 -o "BatchMode yes" -o "UserKnownHostsFile /tmp/gnunet_test_cosks_ssh_garbage" -o "StrictHostKeyChecking no" 127.0.0.1 echo -n)
  203. rm -f /tmp/gnunet_test_cosks_ssh_garbage
  204. # autotools' m4 for python has no maximum version!
  205. # python3.4 - python3.8 for tests (3.8 unchecked)
  206. # TODO: document how to override the lowest version
  207. # TODO: found by this.
  208. m4_define_default([_AM_PYTHON_INTERPRETER_LIST],[python3 python3.4 python3.5 python3.6 python3.7 python3.8 python])
  209. AM_PATH_PYTHON([3.4],, [:])
  210. AC_SUBST([PYTHON])
  211. AM_CONDITIONAL([HAVE_PYTHON], [test "$PYTHON" != :])
  212. # perl
  213. AC_PATH_PROG( PERL, perl, ,
  214. $PATH:/usr/local/bin/perl:/usr/bin/:/usr/local/bin )
  215. AC_SUBST([PERL])
  216. # iptables is a soft requirement to run tests
  217. AC_PATH_TARGET_TOOL(VAR_IPTABLES_BINARY, iptables, false)
  218. AS_IF([test x"$VAR_IPTABLES_BINARY" = x"false"],
  219. [AS_IF([test -x "/sbin/iptables"],
  220. [VAR_IPTABLES_BINARY="/sbin/iptables"],
  221. [AS_IF([test -x "/usr/sbin/iptables"],
  222. [VAR_IPTABLES_BINARY="/usr/sbin/iptables"])])])
  223. AS_IF([test x"$VAR_IPTABLES_BINARY" != x"false"],
  224. [AC_DEFINE_UNQUOTED([IPTABLES], "$VAR_IPTABLES_BINARY", [Path to iptables])],
  225. [AC_MSG_WARN([warning: 'iptables' not found.])])
  226. # ip6tables is a soft requirement for some features
  227. AC_PATH_TARGET_TOOL(VAR_IP6TABLES_BINARY, ip6tables, false)
  228. AS_IF([test x"$VAR_IP6TABLES_BINARY" = x"false"],
  229. [AS_IF([test -x "/sbin/ip6tables"],
  230. [VAR_IP6TABLES_BINARY="/sbin/ip6tables"],
  231. [AS_IF([test -x "/usr/sbin/ip6tables"],
  232. [VAR_IP6TABLES_BINARY="/usr/sbin/ip6tables"])])])
  233. AS_IF([test x"$VAR_IP6TABLES_BINARY" != x"false"],
  234. [AC_DEFINE_UNQUOTED([IP6TABLES], "$VAR_IP6TABLES_BINARY", [Path to ip6tables])],
  235. [AC_MSG_WARN([warning: 'ip6tables' not found.])])
  236. # ip is a soft requirement for some features
  237. AC_PATH_TARGET_TOOL(VAR_IP_BINARY, ip, false)
  238. AS_IF([test x"$VAR_IP_BINARY" = x"false"],
  239. [AS_IF([test -x "/sbin/ip"],
  240. [VAR_IP_BINARY="/sbin/ip"],
  241. [AS_IF([test -x "/usr/sbin/ip"],
  242. [VAR_IP_BINARY="/usr/sbin/ip"])])])
  243. AS_IF([test x"$VAR_IP_BINARY" != x"false"],
  244. [AC_DEFINE_UNQUOTED([PATH_TO_IP], "$VAR_IP_BINARY", [Path to ip])],
  245. [AC_MSG_WARN([warning: 'ip' not found.])])
  246. # locate 'ifconfig'
  247. AC_PATH_TARGET_TOOL(VAR_IFCONFIG_BINARY, ifconfig, false)
  248. AC_CHECK_PROG(VAR_IFCONFIG_BINARY, ifconfig, true, false)
  249. AS_IF([test x"$VAR_IFCONFIG_BINARY" = x"false"],
  250. [AS_IF([test -x "/sbin/ifconfig"],
  251. [VAR_IFCONFIG_BINARY="/sbin/ifconfig"],
  252. [AS_IF([test -x "/usr/sbin/ifconfig"],
  253. [VAR_IFCONFIG_BINARY="/usr/sbin/ifconfig"])])])
  254. AS_IF([test x"$VAR_IFCONFIG_BINARY" != x"false"],
  255. [AC_DEFINE_UNQUOTED([IFCONFIG], "$VAR_IFCONFIG_BINARY", [Path to ifconfig])],
  256. [AC_MSG_WARN(['ifconfig' not found.])])
  257. AC_PATH_TARGET_TOOL(VAR_SYSCTL_BINARY, sysctl, false)
  258. AC_CHECK_PROG(VAR_SYSCTL_BINARY, sysctl, true, false)
  259. AS_IF([test x"$VAR_SYSCTL_BINARY" = x"false"],
  260. [AS_IF([test -x "/sbin/sysctl"],
  261. [VAR_SYSCTL_BINARY="/sbin/sysctl"],
  262. [AS_IF([test -x "/usr/sbin/sysctl"],
  263. [VAR_SYSCTL_BINARY="/usr/sbin/sysctl"])])])
  264. AS_IF([test x"$VAR_SYSCTL_BINARY" != x"false"],
  265. [AC_DEFINE_UNQUOTED([SYSCTL], "$VAR_SYSCTL_BINARY", [Path to sysctl])],
  266. [AC_MSG_WARN(['sysctl' not found.])])
  267. # miniupnpc / upnpc binary is a soft runtime requirement
  268. AC_PATH_TARGET_TOOL(VAR_UPNPC_BINARY, upnpc, false)
  269. AS_IF([test x"$VAR_UPNPC_BINARY" != x"false"],
  270. [AC_DEFINE_UNQUOTED([UPNPC], "$VAR_UPNPC_BINARY", [Path to upnpc binary])],
  271. [AC_MSG_WARN([warning: 'upnpc' binary not found.])])
  272. # uncrustify
  273. # TODO: maybe add flag to pass location
  274. AC_CHECK_PROG(UNCRUSTIFY_BINARY, uncrustify, true)
  275. AM_CONDITIONAL(HAVE_UNCRUSTIFY_BINARY, $UNCRUSTIFY_BINARY)
  276. # yapf
  277. # TODO: less repetition, add flag to pass name
  278. AC_CHECK_PROGS(YAPF_BINARY, [yapf yapf3.0 yapf3.1 yapf3.2 yapf3.3 yapf3.4 yapf3.5 yapf3.6 yapf3.7 yapf3.8 yapf3.9 yapf4.0], false)
  279. AM_CONDITIONAL(HAVE_YAPF_BINARY, test x$YAPF_BINARY != xfalse)
  280. AC_CHECK_MEMBER(struct tm.tm_gmtoff,
  281. [AC_DEFINE(HAVE_TM_GMTOFF, 1,
  282. [Define if struct tm has the tm_gmtoff member.])],
  283. ,
  284. [#include <time.h>])
  285. # 'save' libs; only those libs found so far will be
  286. # linked against _everywhere_. For the others, we
  287. # will be more selective!
  288. SAVE_LIBS=$LIBS
  289. have_addrinfo_a=0
  290. AC_CHECK_LIB(anl,
  291. getaddrinfo_a,
  292. [have_addrinfo_a=1 AC_DEFINE(HAVE_GETADDRINFO_A,
  293. 1,
  294. [getaddrinfo_a supported])])
  295. AM_CONDITIONAL(HAVE_GETADDRINFO_A,
  296. [test "$have_addrinfo_a" = 1])
  297. # libgcrypt
  298. gcrypt=0
  299. NEED_LIBGCRYPT_API=1
  300. NEED_LIBGCRYPT_VERSION=1.6.0
  301. AM_PATH_LIBGCRYPT("$NEED_LIBGCRYPT_API:$NEED_LIBGCRYPT_VERSION", gcrypt=1)
  302. AC_CHECK_DECLS([gcry_mpi_set_opaque_copy], [], [], [[#include <gcrypt.h>]])
  303. AS_IF([test $gcrypt = 0],
  304. [
  305. AC_MSG_ERROR([[
  306. ***
  307. *** You need libgcrypt to build this program.
  308. *** This library is for example available at
  309. *** ftp://ftp.gnupg.org/gcrypt/libgcrypt/.
  310. *** At least version $NEED_LIBGCRYPT_VERSION (API $NEED_LIBGCRYPT_API)
  311. *** is required.
  312. ***]])
  313. ])
  314. AC_DEFINE_UNQUOTED([NEED_LIBGCRYPT_VERSION], "$NEED_LIBGCRYPT_VERSION", [required libgcrypt version])
  315. AC_CHECK_DECLS([struct in6_ifreq], [], [], [[#include <linux/if_tun.h>]])
  316. # should the build process be building the documentation?
  317. AC_MSG_CHECKING(whether to build documentation)
  318. AC_ARG_ENABLE([documentation],
  319. [AS_HELP_STRING([--disable-documentation],
  320. [do not build the documentation])],
  321. [documentation=${enableval}],
  322. [documentation=yes])
  323. AC_MSG_RESULT($documentation)
  324. AS_IF([test "x$documentation" = "xyes"],
  325. [AM_CONDITIONAL([DOCUMENTATION],
  326. true)
  327. AC_DEFINE([DOCUMENTATION],
  328. [1],
  329. [Building the documentation])],
  330. [AM_CONDITIONAL([DOCUMENTATION],
  331. false)
  332. AC_DEFINE([DOCUMENTATION],
  333. [0],
  334. [Not building the documentation])])
  335. # COMMENT: Check wether to transpile texinfo to mdoc.
  336. # COMMENT: This is TRUE when --enable-texi2mdoc-generation
  337. # COMMENT: but ERRORS when texi2mdoc binary is missing in your $PATH
  338. # COMMENT: and makes the configure fail if it is missing.
  339. # COMMENT: Consequential the DEFINE and CONDITIONAL are set to true.
  340. # COMMENT: This is FALSE when --disable-texi2mdoc-generation was set
  341. # COMMENT: or nothing was set (this is the default).
  342. # COMMENT: There are 2 nested AS_IFs because we need to catch the
  343. # COMMENT: potential non-existence of the texi2mdoc binary.
  344. # COMMENT: Default return value / setting: no
  345. AC_MSG_CHECKING(wether to include generated texi2mdoc output in installation)
  346. AC_ARG_ENABLE([texi2mdoc-generation],
  347. [AS_HELP_STRING([--enable-texi2mdoc-generation],
  348. [include generated texi2mdoc output in installation])],
  349. [texi2mdoc_generation=${enableval}],
  350. [texi2mdoc_generation=no])
  351. AC_MSG_RESULT($texi2mdoc_generation)
  352. AS_IF([test "x$texi2mdoc_generation" = "xyes"],
  353. [AS_IF([test "$texi2mdoc" = 0],
  354. [AC_MSG_WARN([ERROR: transpiled mdoc output requires texi2mdoc.])
  355. AC_MSG_WARN([ERROR: texi2mdoc can be obtained via your])
  356. AC_MSG_WARN([ERROR: Operating System package manager or from])
  357. AC_MSG_WARN([ERROR: https://mandoc.bsd.lv/texi2mdoc/])],
  358. [AM_CONDITIONAL([TEXI2MDOC_GENERATION],true)
  359. AC_DEFINE([TEXI2MDOC_GENERATION],
  360. [1],
  361. [Building section 7 mdoc output])])],
  362. [AM_CONDITIONAL([TEXI2MDOC_GENERATION],
  363. false)
  364. AC_DEFINE([TEXI2MDOC_GENERATION],
  365. [0],
  366. [Not building section 7 mdoc output])])
  367. # should the build process be building only the documentation?
  368. AC_MSG_CHECKING(whether to build only documentation)
  369. AC_ARG_ENABLE([documentation-only],
  370. [AS_HELP_STRING([--enable-documentation-only],
  371. [build only the documentation])],
  372. [documentation_only=${enableval}],
  373. [documentation_only=no])
  374. AC_MSG_RESULT($documentation_only)
  375. AS_IF([test "x$documentation_only" = "xyes"],
  376. [
  377. AM_CONDITIONAL([DOCUMENTATION_ONLY],true)
  378. AC_DEFINE([DOCUMENTATION_ONLY],[1],[Building only the documentation])
  379. ],[
  380. AM_CONDITIONAL([DOCUMENTATION_ONLY],false)
  381. AC_DEFINE([DOCUMENTATION_ONLY],[0],[Doing a normal build, more than only documentation])
  382. ])
  383. # should the build process be including the manpages? (default: yes)
  384. AC_MSG_CHECKING(whether to include man pages)
  385. AC_ARG_ENABLE([include-manpages],
  386. [AS_HELP_STRING([--disable-include-manpages],
  387. [Do not include the man pages in build and installation])],
  388. [include_manpages=${enableval}],
  389. [include_manpages=yes])
  390. AC_MSG_RESULT($include_manpages)
  391. AS_IF([test "x$include_manpages" = "xyes"],
  392. [
  393. AM_CONDITIONAL([INCLUDE_MANPAGES],true)
  394. AC_DEFINE([INCLUDE_MANPAGES],[1],[Including the man pages in the build and installation])
  395. ],[
  396. AM_CONDITIONAL([INCLUDE_MANPAGES],false)
  397. AC_DEFINE([INCLUDE_MANPAGES],[0],[Not including the man pages in the build and installation])
  398. ])
  399. # Do we have texinfo4? If yes, it is used to set texinfo4 specific switches
  400. # (not syntax!) to the commandline tools which generate the html. If not,
  401. # texinfo5 switches are used. This comes with no version checks, is
  402. # enabled only at distributors action (ie defaults to "no").
  403. # Mantis #3914 for more details (https://bugs.gnunet.org/view.php?id=3914)
  404. AC_MSG_CHECKING(whether to enable texinfo4 switches)
  405. AC_ARG_ENABLE([texinfo4],
  406. [AS_HELP_STRING([--enable-texinfo4], [Use texinfo version 4 specific switches])],
  407. [activate_texinfo4=${enableval}],
  408. [activate_texinfo4=no])
  409. AC_MSG_RESULT($activate_texinfo4)
  410. AS_IF([test "x$activate_texinfo4" = "xyes"],
  411. [
  412. AM_CONDITIONAL([ACTIVATE_TEXINFO4],true)
  413. AC_DEFINE([ACTIVATE_TEXINFO4],[1],[Using texinfo version 4 specific switches])
  414. ],[
  415. AM_CONDITIONAL([ACTIVATE_TEXINFO4],false)
  416. AC_DEFINE([INCLUDE_MANPAGES],[0],[Using texinfo version 5 or later switches])
  417. ])
  418. # Adam shostack suggests the following for Windows:
  419. # -D_FORTIFY_SOURCE=2 -fstack-protector-all
  420. AC_ARG_ENABLE(gcc-hardening,
  421. AS_HELP_STRING(--enable-gcc-hardening, enable compiler security checks),
  422. [AS_IF([test x$enableval = xyes],[
  423. CFLAGS="$CFLAGS -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=2 -fstack-protector-all"
  424. CFLAGS="$CFLAGS -fwrapv -fPIE -Wstack-protector"
  425. CFLAGS="$CFLAGS --param ssp-buffer-size=1"
  426. LDFLAGS="$LDFLAGS -pie"
  427. ])])
  428. # Linker hardening options
  429. # Currently these options are ELF specific - you can't use this with MacOSX
  430. AC_ARG_ENABLE(linker-hardening,
  431. AS_HELP_STRING(--enable-linker-hardening, enable linker security fixups),
  432. [AS_IF([test x$enableval = xyes],
  433. [LDFLAGS="$LDFLAGS -z relro -z now"])])
  434. AC_ARG_ENABLE(sanitizer,
  435. AS_HELP_STRING(--enable-sanitizer, enable Address Sanitizer and Undefined Behavior Sanitizer),
  436. [AS_IF([test x$enableval = xyes],[
  437. LDFLAGS="$CFLAGS -fsanitize=address,undefined -fno-omit-frame-pointer"
  438. ])])
  439. extra_logging=GNUNET_NO
  440. AC_ARG_ENABLE([logging],
  441. AS_HELP_STRING([--enable-logging@<:@=value@:>@],[Enable logging calls. Possible values: yes,no,verbose,veryverbose ('yes' is the default)]),
  442. [AS_IF([test "x$enableval" = "xyes"], [],
  443. [test "x$enableval" = "xno"], [AC_DEFINE([GNUNET_CULL_LOGGING],[],[Define to cull all logging calls])],
  444. [test "x$enableval" = "xverbose"], [extra_logging=GNUNET_YES]
  445. [test "x$enableval" = "xveryverbose"], [extra_logging=\(GNUNET_YES+1\)])
  446. ], [])
  447. AC_DEFINE_UNQUOTED([GNUNET_EXTRA_LOGGING],[$extra_logging],[1 if extra logging is enabled, 2 for very verbose extra logging, 0 otherwise])
  448. # should memory poisoning be enabled?
  449. AC_MSG_CHECKING(whether to poison freed memory)
  450. AC_ARG_ENABLE([poisoning],
  451. [AS_HELP_STRING([--enable-poisoning], [enable poisoning of freed memory (good for debugging)])],
  452. [enable_poisoning=${enableval}],
  453. [
  454. AS_IF([test "x$extra_logging" != "xGNUNET_NO"],
  455. [enable_poisoning="defaults to yes (extra logging is enabled)"],
  456. [enable_poisoning=no])
  457. ])
  458. AC_MSG_RESULT($enable_poisoning)
  459. AS_IF([test ! "x$enable_poisoning" = "xno"],
  460. [enable_poisoning=1],
  461. [enable_poisoning=0])
  462. AC_DEFINE_UNQUOTED([ENABLE_POISONING],[$enable_poisoning],[1 if freed memory should be poisoned, 0 otherwise])
  463. AS_IF([test $build = $target],
  464. [
  465. AC_MSG_CHECKING([for working HMAC])
  466. AC_LANG_PUSH(C)
  467. LIBS="$LIBS $LIBGCRYPT_LIBS"
  468. CFLAGS="$CFLAGS $LIBGCRYPT_CFLAGS"
  469. AC_RUN_IFELSE(
  470. [AC_LANG_PROGRAM([#include <gcrypt.h>
  471. #include <stdio.h>], [[
  472. gcry_md_hd_t mac;
  473. unsigned char data[] = { 0xbf, 0x16, 0x6e, 0x46, 0x3a, 0x6c, 0xf3, 0x93, 0xa7, 0x72,
  474. 0x11, 0xa1, 0xdc, 0x0b, 0x07, 0xdb, 0x1a, 0x5e, 0xd9, 0xb9, 0x81, 0xbe,
  475. 0xea, 0xe4, 0x31, 0x5f, 0x24, 0xff, 0xfe, 0x50, 0x8a, 0xde };
  476. unsigned char key[] = { 0xfc, 0x62, 0x76, 0x35 };
  477. unsigned char result[] = {0xa2, 0xb, 0x1, 0xd9, 0xc0, 0x8b, 0x5a, 0x12, 0x80,
  478. 0xd5, 0x50, 0x12, 0x8e, 0xd0, 0x5b, 0xb6, 0x5c, 0x87, 0x24, 0xe2, 0xd0,
  479. 0xd2, 0xaf, 0x63, 0xae, 0xd1, 0xd6, 0x64, 0x14, 0xe3, 0x6e, 0x61, 0x5b,
  480. 0xd, 0xba, 0x17, 0x7d, 0xd3, 0x10, 0xb1, 0x37, 0x41, 0x91, 0x7d, 0xeb,
  481. 0x1, 0x4d, 0x71, 0xe8, 0x59, 0x71, 0x42, 0x8e, 0xd6, 0xf3, 0x29, 0x3b,
  482. 0x90, 0xf2, 0xd1, 0xaf, 0x65, 0x1e, 0xb3};
  483. if (!gcry_check_version (GCRYPT_VERSION))
  484. {
  485. fprintf (stderr, "Version mismatch %s <-> %s \n", gcry_check_version (NULL), GCRYPT_VERSION);
  486. return 1;
  487. }
  488. gcry_control (GCRYCTL_DISABLE_SECMEM, 0);
  489. gcry_control (GCRYCTL_INITIALIZATION_FINISHED, 0);
  490. if (gcry_md_open(&mac, GCRY_MD_SHA512, GCRY_MD_FLAG_HMAC) != GPG_ERR_NO_ERROR)
  491. {
  492. fprintf (stderr, "gcry_md_open error\n");
  493. return 2;
  494. }
  495. gcry_md_setkey (mac, key, sizeof (key));
  496. gcry_md_write (mac, data, sizeof (data));
  497. if (memcmp(gcry_md_read (mac, 0), result, gcry_md_get_algo_dlen (gcry_md_get_algo (mac))) != 0)
  498. {
  499. fprintf (stderr, "memcmp error\n");
  500. return 3;
  501. }
  502. gcry_md_close (mac);
  503. return 0;
  504. ]])],
  505. [AC_MSG_RESULT([yes])],
  506. [
  507. RESULT=$?
  508. if test $RESULT = 3
  509. then
  510. 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.])
  511. fi
  512. if test $RESULT = 2
  513. then
  514. AC_MSG_FAILURE([HMAC test failed])
  515. fi
  516. if test $RESULT = 1
  517. then
  518. AC_MSG_FAILURE([libgcrypt header version does not match library version])
  519. fi
  520. ],
  521. [AC_MSG_RESULT([cross compiling, test skipped])])
  522. AC_LANG_POP(C)
  523. ]) # $build = $target
  524. # check for bluetooth library
  525. bluetooth=0
  526. AC_MSG_CHECKING(for libbluetooth)
  527. AC_ARG_WITH(libbluetooth,
  528. [ --with-libbluetooth=PREFIX (base of libbluetooth installation)],
  529. [AC_MSG_RESULT([$with_libbluetooth])
  530. AS_CASE([$with_libbluetooth],
  531. [no],[],
  532. [yes],[
  533. CHECK_LIBHEADER(BLUETOOTH,
  534. bluetooth,
  535. ba2str,
  536. bluetooth/bluetooth.h,
  537. bluetooth=1,)
  538. ],[
  539. LDFLAGS="-L$with_libbluetooth/lib $LDFLAGS"
  540. CPPFLAGS="-I$with_libbluetooth/include $CPPFLAGS"
  541. AC_CHECK_HEADERS(bluetooth/bluetooth.h,
  542. AC_CHECK_LIB([bluetooth],
  543. [ba2str],
  544. EXT_LIB_PATH="-L$with_libbluetooth/lib $EXT_LIB_PATH"
  545. bluetooth=1))
  546. ])
  547. ],
  548. [AC_MSG_RESULT([--with-libbluetooth not specified])
  549. CHECK_LIBHEADER(BLUETOOTH,
  550. bluetooth,
  551. ba2str,
  552. bluetooth/bluetooth.h,
  553. bluetooth=1,)])
  554. AM_CONDITIONAL(HAVE_LIBBLUETOOTH, [test "$bluetooth" = 1])
  555. AS_IF([test "$bluetooth" = 1],
  556. [AC_DEFINE([HAVE_LIBBLUETOOTH],[1],[Have bluetooth library])],
  557. [AC_DEFINE([HAVE_LIBBLUETOOTH],[0],[Lacking bluetooth library])])
  558. # check for zbar library
  559. zbar=0
  560. AC_MSG_CHECKING(for libzbar)
  561. AC_ARG_WITH(zbar,
  562. [ --with-zbar=PREFIX (base of libzbar installation)],
  563. [AC_MSG_RESULT([$with_zbar])
  564. AS_CASE([$with_zbar],
  565. [no],[],
  566. [yes],[CHECK_LIBHEADER(ZBAR, zbar, zbar_processor_create, zbar.h,zbar=1,,)],
  567. [
  568. LDFLAGS="-L$with_zbar/lib $LDFLAGS"
  569. CPPFLAGS="-I$with_zbar/include $CPPFLAGS"
  570. AC_CHECK_HEADERS(zbar.h,
  571. AC_CHECK_LIB([zbar], [zbar_processor_create],
  572. EXT_LIB_PATH="-L$with_zbar/lib $EXT_LIB_PATH"
  573. zbar=1))
  574. ])
  575. ],
  576. [AC_MSG_RESULT([--with-zbar not specified])
  577. CHECK_LIBHEADER(ZBAR, zbar, zbar_processor_create, zbar.h,zbar=1,,)])
  578. AM_CONDITIONAL(HAVE_ZBAR, [test "$zbar" = 1])
  579. AS_IF([test "x$zbar" = x1],
  580. [AC_DEFINE([HAVE_ZBAR],[1],[Have zbar library])],
  581. [AC_DEFINE([HAVE_ZBAR],[0],[Lacking zbar library])])
  582. # check for jansson library
  583. jansson=0
  584. AC_MSG_CHECKING(for libjansson)
  585. AC_ARG_WITH(jansson,
  586. [ --with-jansson=PREFIX (base of libjansson installation)],
  587. [AC_MSG_RESULT([$with_jansson])
  588. AS_CASE([$with_jansson],
  589. [no],[],
  590. [yes],[
  591. CHECK_LIBHEADER(JANSSON, jansson, json_loads, jansson.h,jansson=1,)
  592. ],[
  593. LDFLAGS="-L$with_jansson/lib $LDFLAGS"
  594. CPPFLAGS="-I$with_jansson/include $CPPFLAGS"
  595. AC_CHECK_HEADERS(jansson.h,
  596. AC_CHECK_LIB([jansson], [json_loads],
  597. EXT_LIB_PATH="-L$with_jansson/lib $EXT_LIB_PATH"
  598. jansson=1))
  599. ])
  600. ],
  601. [AC_MSG_RESULT([--with-jansson not specified])
  602. CHECK_LIBHEADER(JANSSON, jansson, json_loads, jansson.h,jansson=1,)])
  603. AM_CONDITIONAL(HAVE_JANSSON, [test "$jansson" = 1])
  604. AM_CONDITIONAL(HAVE_JSON, [test x$jansson = x1])
  605. AS_IF([test "x$jansson" = x1],
  606. [AC_DEFINE([HAVE_JANSSON],[1],[Have jansson library])],
  607. [AC_DEFINE([HAVE_JANSSON],[0],[Lacking jansson library])])
  608. # check for libpulse(audio) library
  609. pulse=0
  610. libpulse_msg="no"
  611. AC_MSG_CHECKING(for libpulse)
  612. # TODO: --with-libpulse or --with-pulseaudio? What is more established
  613. # TODO: in this context?
  614. AC_ARG_WITH(libpulse,
  615. [ --with-libpulse=PREFIX (base of libpulse installation)],
  616. [AC_MSG_RESULT([$with_libpulse])
  617. AS_CASE([$with_libpulse],
  618. [no],[],
  619. [yes],[
  620. CHECK_LIBHEADER(LIBPULSE,
  621. pulse,
  622. pa_stream_peek,
  623. pulse/simple.h,
  624. pulse=1,)
  625. ],[
  626. LDFLAGS="-L$with_libpulse/lib $LDFLAGS"
  627. CPPFLAGS="-I$with_libpulse/include $CPPFLAGS"
  628. AC_CHECK_HEADERS(pulse/simple.h,
  629. AC_CHECK_LIB([pulse],
  630. [pa_stream_peek],
  631. EXT_LIB_PATH="-L$with_libpulse/lib $EXT_LIB_PATH"
  632. pulse=1))
  633. ])
  634. ],
  635. [AC_MSG_RESULT([--with-libpulse not specified])
  636. CHECK_LIBHEADER(LIBPULSE,
  637. pulse,
  638. pa_stream_peek,
  639. pulse/simple.h,
  640. pulse=1,)])
  641. AM_CONDITIONAL(HAVE_PULSE, [test "$pulse" = 1])
  642. AS_IF([test x"$pulse" = x1],
  643. [AC_DEFINE([HAVE_PULSE],[1],[Have libpulse(audio) library])
  644. libpulse_msg="yes"],
  645. [AC_DEFINE([HAVE_PULSE],[0],[Lacking libpulse(audio) library])
  646. libpulse_msg="no"])
  647. # check for libopus(audio) library
  648. opus=0
  649. libopus_msg="no"
  650. AC_MSG_CHECKING(for libopus)
  651. AC_ARG_WITH(libopus,
  652. [ --with-libopus=PREFIX (base of libopus installation)],
  653. [AC_MSG_RESULT([$with_libopus])
  654. AS_CASE([$with_libopus],
  655. [no],[],
  656. [yes],[
  657. CHECK_LIBHEADER(LIBOPUS,
  658. opus,
  659. opus_decode_float,
  660. opus/opus.h,
  661. AC_CHECK_DECL([OPUS_SET_GAIN],
  662. [opus=1],
  663. [],
  664. [[
  665. #include <opus/opus.h>
  666. ]]))
  667. ],[
  668. LDFLAGS="-L$with_libopus/lib $LDFLAGS"
  669. CPPFLAGS="-I$with_libopus/include $CPPFLAGS"
  670. AC_CHECK_HEADERS(opus/opus.h,
  671. AC_CHECK_LIB([opus],
  672. [OPUS_SET_GAIN],
  673. EXT_LIB_PATH="-L$with_libopus/lib $EXT_LIB_PATH"
  674. opus=1))
  675. ])
  676. ],
  677. [AC_MSG_RESULT([--with-libopus not specified])
  678. CHECK_LIBHEADER(LIBOPUS,
  679. opus,
  680. opus_decode_float,
  681. opus/opus.h,
  682. AC_CHECK_DECL([OPUS_SET_GAIN],
  683. [opus=1],
  684. [],
  685. [[
  686. #include <opus/opus.h>
  687. ]]))])
  688. AM_CONDITIONAL(HAVE_OPUS, [test "$opus" = 1])
  689. AS_IF([test "x$opus" = x1],
  690. [AC_DEFINE([HAVE_OPUS],[1],[Have libopus library])
  691. libopus_msg="yes"],
  692. [AC_DEFINE([HAVE_OPUS],[0],[Lacking libopus library])
  693. libopus_msg="no"])
  694. # libogg
  695. AC_MSG_CHECKING(for libogg)
  696. AC_ARG_WITH(libogg,
  697. [ --with-libogg=PREFIX (base of libogg installation)],
  698. [AC_MSG_RESULT([$with_libogg])
  699. AS_CASE([$with_libogg],
  700. [no],[],
  701. [yes],[
  702. CHECK_LIBHEADER(LIBOGG,
  703. ogg,
  704. ogg_stream_flush_fill,
  705. ogg/ogg.h,
  706. ogg=1,)
  707. ],[
  708. LDFLAGS="-L$with_libogg/lib $LDFLAGS"
  709. CPPFLAGS="-I$with_libogg/include $CPPFLAGS"
  710. AC_CHECK_HEADERS(ogg/ogg.h,
  711. AC_CHECK_LIB([ogg],
  712. [ogg_stream_flush_fill],
  713. EXT_LIB_PATH="-L$with_libogg/lib $EXT_LIB_PATH"
  714. ogg=1))
  715. ])
  716. ],
  717. [AC_MSG_RESULT([--with-libogg not specified])
  718. CHECK_LIBHEADER(LIBOGG,
  719. ogg,
  720. ogg_stream_flush_fill,
  721. ogg/ogg.h,
  722. ogg=1,)])
  723. AM_CONDITIONAL(HAVE_OGG, [test "$ogg" = 1])
  724. AS_IF([test x"$ogg" = x1],
  725. [AC_DEFINE([HAVE_OGG],[1],[Have ogg])]
  726. [AC_DEFINE([HAVE_OGG],[0],[Lacking ogg])])
  727. PKG_CHECK_MODULES([GLIB],
  728. [glib-2.0],
  729. [# check for pbc library
  730. pbc=0
  731. AC_CHECK_HEADER([pbc/pbc.h],pbc=1)
  732. AC_CHECK_HEADER([gabe.h],abe=1)
  733. AM_CONDITIONAL(HAVE_PBC, [test "x$pbc" = x1])
  734. AM_CONDITIONAL(HAVE_ABE, [test "x$abe" = x1])
  735. AS_IF([test "x$pbc" = x1],
  736. [AC_DEFINE([HAVE_PBC],[1],[Have pbc library])],
  737. [AC_DEFINE([HAVE_PBC],[0],[Lacking pbc library])])
  738. AS_IF([test "x$abe" = x1],
  739. [AC_DEFINE([HAVE_ABE],[1],[Have ABE library])],
  740. [AC_DEFINE([HAVE_ABE],[0],[Lacking ABE library])])],
  741. [# glib-2 not found
  742. AM_CONDITIONAL(HAVE_PBC, [false])
  743. AM_CONDITIONAL(HAVE_ABE, [false])
  744. AC_DEFINE([HAVE_PBC],[0],[Lacking glib library])])
  745. gst=0
  746. gstreamer_msg="no"
  747. AC_MSG_CHECKING(for gstreamer)
  748. PKG_CHECK_MODULES(
  749. [GST],
  750. [glib-2.0 gobject-2.0 gstreamer-1.0 gstreamer-app-1.0 gstreamer-audio-1.0],
  751. [gst=1
  752. gstreamer_msg="yes"],
  753. [gst=0])
  754. # conversation
  755. AC_MSG_CHECKING(conversation feature set to build)
  756. AS_IF([test "x$pulse" != "x1" -o "x$opus" != "x1" -o "x$ogg" != "x1"],[
  757. AS_IF([test "x$gst" != "x1"],[
  758. conversation_backend=none
  759. AM_CONDITIONAL(BUILD_PULSE_HELPERS, false)
  760. AM_CONDITIONAL(BUILD_GST_HELPERS, false)
  761. AM_CONDITIONAL(BUILD_EXPERIMENTAL_HELPERS, false)
  762. ],[
  763. conversation_backend=gst
  764. AM_CONDITIONAL(BUILD_PULSE_HELPERS, false)
  765. AM_CONDITIONAL(BUILD_GST_HELPERS, true)
  766. AM_CONDITIONAL(BUILD_EXPERIMENTAL_HELPERS, false)
  767. ])
  768. ],[
  769. conversation_backend=pulse
  770. AM_CONDITIONAL(BUILD_PULSE_HELPERS, true)
  771. AM_CONDITIONAL(BUILD_GST_HELPERS, false)
  772. AM_CONDITIONAL(BUILD_EXPERIMENTAL_HELPERS, false)
  773. ])
  774. AS_IF([test "x$conversation_backend" = "xnone"],
  775. AM_CONDITIONAL(BUILD_CONVERSATION, false),
  776. AM_CONDITIONAL(BUILD_CONVERSATION, true))
  777. # libgnurl
  778. LIBGNURL_CHECK_CONFIG(,7.34.0,gnurl=1,gnurl=0)
  779. SAVE_CPPFLAGS=$CPPFLAGS
  780. CPPFLAGS="$LIBGNURL_CPPFLAGS $LIBCURL_CPPFLAGS $CPPFLAGS"
  781. LIBS="$LIBGNURL $LIBCURL $LIBS"
  782. # libcurl-gnutls
  783. LIBCURL_CHECK_CONFIG(,7.34.0,[curl=true],[curl=false])
  784. AS_IF([test "x$curl" = xtrue],[
  785. AC_CHECK_HEADER([curl/curl.h],
  786. AC_CHECK_DECLS(CURLINFO_TLS_SESSION,[curl=true],[curl=false],[[#include <curl/curl.h>]]),
  787. [curl=false])
  788. # need libcurl-gnutls.so, everything else is not acceptable
  789. AC_CHECK_LIB([curl-gnutls],[curl_easy_getinfo],,[curl=false])
  790. # cURL must support CURLINFO_TLS_SESSION, version >= 7.34
  791. ])
  792. # libcurl and libgnurl should be mutually exclusive
  793. AS_IF([test "$gnurl" = 1],
  794. [AM_CONDITIONAL(HAVE_LIBGNURL, true)
  795. AC_DEFINE([HAVE_LIBGNURL],[1],[Have libgnurl])
  796. AM_CONDITIONAL(HAVE_LIBCURL, false)
  797. AC_DEFINE([HAVE_LIBCURL],[0],[Lacking libcurl])],
  798. [AS_IF([test "$curl" = true],
  799. [AM_CONDITIONAL(HAVE_LIBGNURL, false)
  800. AC_DEFINE([HAVE_LIBGNURL],[0],[Lacking libgnurl])
  801. AM_CONDITIONAL(HAVE_LIBCURL, true)
  802. AC_DEFINE([HAVE_LIBCURL],[1],[Have libcurl])],
  803. [AC_MSG_WARN([ERROR: GNUnet requires libcurl-gnutls or gnurl >= 7.34])
  804. AM_CONDITIONAL(HAVE_LIBGNURL, false)
  805. AC_DEFINE([HAVE_LIBGNURL],[0],[Lacking libgnurl])
  806. AM_CONDITIONAL(HAVE_LIBCURL, false)
  807. AC_DEFINE([HAVE_LIBCURL],[0],[Lacking libcurl])])])
  808. AC_SEARCH_LIBS(__atomic_load_8, atomic, [have_libatomic=1 AC_DEFINE(HAVE_LIBATOMIC,1,[external libatomic])])
  809. AM_CONDITIONAL(HAVE_LIBATOMIC, [test "$have_libatomic" = 1])
  810. # restore LIBS & CPPFLAGS
  811. LIBS=$SAVE_LIBS
  812. CPPFLAGS=$SAVE_CPPFLAGS
  813. AC_CHECK_HEADERS([nss.h],[nss=true],[nss=false])
  814. AS_IF([test x$nss = xfalse],
  815. [
  816. AM_CONDITIONAL(HAVE_GLIBCNSS, false)
  817. AC_MSG_WARN([No GNU libc nss header, will not build NSS plugin])
  818. ],[
  819. NSS_INCLUDES="
  820. #include <nss.h>
  821. "
  822. AC_CHECK_DECL([NSS_STATUS_UNAVAIL],
  823. [AM_CONDITIONAL(HAVE_GLIBCNSS, true)],
  824. [AM_CONDITIONAL(HAVE_GLIBCNSS, false)
  825. AC_MSG_WARN([No nss header fails to define NSS_STATUS_UNAVAIl, will not build NSS plugin])],
  826. [$NSS_INCLUDES])
  827. ])
  828. # test for kvm and kstat (for CPU stats under BSD/Solaris)
  829. AC_CHECK_LIB([kvm],[kvm_open])
  830. AC_CHECK_LIB([kstat],[kstat_open])
  831. # should the build process be restricted to the code required
  832. # for GNU Taler wallets?
  833. AC_MSG_CHECKING(whether to compile GNU Taler Wallet library ONLY)
  834. AC_ARG_ENABLE([taler-wallet],
  835. [AS_HELP_STRING([--enable-taler-wallet], [only compile for Taler wallet])],
  836. [taler_only=${enableval}],
  837. [taler_only=no])
  838. AC_MSG_RESULT($taler_only)
  839. AS_IF([test "x$taler_only" = "xyes"],
  840. [
  841. AM_CONDITIONAL([TALER_ONLY],true)
  842. AC_DEFINE([TALER_WALLET_ONLY],[1],[Compiling for Taler wallet])
  843. ],[
  844. AM_CONDITIONAL([TALER_ONLY],false)
  845. AC_DEFINE([TALER_WALLET_ONLY],[0],[Canonical compilation])
  846. ])
  847. # test for libextractor
  848. extractor=0
  849. AC_MSG_CHECKING(for libextractor)
  850. AC_ARG_WITH(extractor,
  851. [ --with-extractor=PREFIX (base of libextractor installation)],
  852. [AC_MSG_RESULT([$with_extractor])
  853. AS_CASE([$with_extractor],
  854. [no],[],
  855. [yes],[
  856. AC_CHECK_HEADERS([extractor.h],
  857. AC_CHECK_LIB([extractor], [EXTRACTOR_plugin_add_defaults],
  858. extractor=1))
  859. ],[
  860. LDFLAGS="-L$with_extractor/lib $LDFLAGS"
  861. CPPFLAGS="-I$with_extractor/include $CPPFLAGS"
  862. AC_CHECK_HEADERS([extractor.h],
  863. AC_CHECK_LIB([extractor], [EXTRACTOR_plugin_add_defaults],
  864. EXT_LIB_PATH="-L$with_extractor/lib $EXT_LIB_PATH"
  865. extractor=1))
  866. ])
  867. ],
  868. [AC_MSG_RESULT([--with-extractor not specified])
  869. AC_CHECK_HEADERS([extractor.h],
  870. AC_CHECK_LIB([extractor], [EXTRACTOR_plugin_add_defaults],
  871. extractor=1))])
  872. # restore LIBS
  873. LIBS=$SAVE_LIBS
  874. AS_IF([test "$extractor" != 1],
  875. [
  876. AM_CONDITIONAL(HAVE_LIBEXTRACTOR, false)
  877. AC_DEFINE([HAVE_LIBEXTRACTOR],[0],[Lacking libextractor])
  878. ],[
  879. AM_CONDITIONAL(HAVE_LIBEXTRACTOR, true)
  880. AC_DEFINE([HAVE_LIBEXTRACTOR],[1],[Have libextractor])
  881. ])
  882. AS_IF([test "$taler_only" != yes],[
  883. # Check for libltdl header (#2999)
  884. ltdl=0
  885. AC_MSG_CHECKING(for libltdl)
  886. AC_ARG_WITH(ltdl,
  887. [AS_HELP_STRING([--with-ltdl=PREFIX],[base of libltdl installation])],
  888. [AC_MSG_RESULT([$with_ltdl])
  889. AS_CASE([$with_ltdl],
  890. [no],[],
  891. [yes],[
  892. AC_CHECK_HEADERS(ltdl.h,
  893. AC_CHECK_LIB([ltdl], [lt_dlopenext],
  894. ltdl=1))
  895. ],[
  896. LDFLAGS="-L$with_ltdl/lib $LDFLAGS"
  897. CPPFLAGS="-I$with_ltdl/include $CPPFLAGS"
  898. AC_CHECK_HEADERS(ltdl.h,
  899. AC_CHECK_LIB([ltdl], [lt_dlopenext],
  900. EXT_LIB_PATH="-L$with_ltdl/lib $EXT_LIB_PATH"
  901. ltdl=1))
  902. ])
  903. ],
  904. [AC_MSG_RESULT([--with-ltdl not specified])
  905. AC_CHECK_HEADERS(ltdl.h,
  906. AC_CHECK_LIB([ltdl], [lt_dlopenext],
  907. ltdl=1))])
  908. AS_IF([test x$ltdl = x1],
  909. [
  910. AC_MSG_RESULT([libltdl found])
  911. ],[
  912. AC_MSG_ERROR([GNUnet requires libltdl (from GNU libtool), try installing libltdl-dev])
  913. ])
  914. # restore LIBS
  915. LIBS=$SAVE_LIBS
  916. # libidn and libidn2. The ideal goal is this:
  917. # check for libidn2, if it doesn't exist check for libidn
  918. # if both exist, prefer libidn2
  919. # if none exist, fail and message that libidn or libidn2
  920. # is required with a preference for libidn2.
  921. # TODO: What we have right here can probably be improved.
  922. AC_MSG_CHECKING(for idn or idn2)
  923. AC_MSG_CHECKING(for idn)
  924. my_with_libidn=1
  925. AC_ARG_WITH(libidn,
  926. AS_HELP_STRING([--with-libidn=pathname],
  927. [Support IDN (needs libidn)]),
  928. [],
  929. [withval="yes"])
  930. AS_IF([test x_$withval = x_yes],
  931. [AC_CHECK_HEADERS([idna.h],
  932. AC_MSG_NOTICE([Found idna.h]),
  933. AC_CHECK_HEADERS([idn/idna.h],
  934. AC_MSG_NOTICE([Found idn/idna.h]),
  935. my_with_libidn=0))],
  936. [AS_IF([test x_$withval != x_no],
  937. [CFLAGS="$CFLAGS -I$withval/include"
  938. LDFLAGS="$LDFLAGS -L$withval/lib"
  939. AC_CHECK_HEADERS([idna.h],
  940. AC_MSG_NOTICE([Found idna.h]),
  941. [AC_MSG_NOTICE([Failed to find idna.h])
  942. my_with_libidn=0])],
  943. [my_with_libidn=0])])
  944. AC_MSG_CHECKING(for idn2)
  945. my_with_libidn2=1
  946. AC_ARG_WITH(libidn2,
  947. AS_HELP_STRING([--with-libidn2=pathname],
  948. [Support IDN (needs libidn2)]),
  949. [],
  950. [withval="yes"])
  951. AS_IF([test x_$withval = x_yes],
  952. [AC_CHECK_HEADERS([idn2.h],
  953. AC_MSG_NOTICE([Found idn2.h]),
  954. AC_CHECK_HEADERS([idn2/idn2.h],
  955. AC_MSG_NOTICE([Found idn2/idn2.h]),
  956. [AC_MSG_NOTICE([Failed to find idn2.h])
  957. my_with_libidn2=0]))],
  958. [AS_IF([test x_$withval != x_no],
  959. [CFLAGS="$CFLAGS -I$withval/include"
  960. LDFLAGS="$LDFLAGS -L$withval/lib"],
  961. [my_with_libidn2=0])])
  962. AC_MSG_CHECKING([if libidn can be used])
  963. # Check for LIBIDNs
  964. there_can_only_be_one=1
  965. working_libidn1=0
  966. working_libidn2=0
  967. AS_IF([test x$my_with_libidn2 = x1],
  968. [AC_MSG_NOTICE([Checking for libidn2])
  969. AC_CHECK_LIB([idn2],
  970. [idn2_to_unicode_8z8z],
  971. [working_libidn2=1
  972. LIBS="-lidn2 $LIBS"
  973. AC_DEFINE_UNQUOTED([HAVE_LIBIDN2],
  974. [1],
  975. [Define to 1 if you have 'libidn2' (-lidn2).])],
  976. [MISSING_DEPS="${MISSING_DEPS}${MISSING_SEP}libidn2"
  977. MISSING_SEP=", "])])
  978. AM_CONDITIONAL(HAVE_LIBIDN2,
  979. test x$working_libidn2 = x1)
  980. AS_IF([test x$working_libidn2 = x0],
  981. [AS_IF([test x$my_with_libidn = x1],
  982. [AC_MSG_NOTICE([Checking for libidn])
  983. AC_CHECK_LIB([idn],
  984. [idna_to_ascii_8z],
  985. [working_libidn1=1
  986. LIBS="-lidn $LIBS"
  987. AC_DEFINE_UNQUOTED([HAVE_LIBIDN],
  988. [1],
  989. [Define to 1 if you have 'libidn' (-lidn).])],
  990. [there_can_only_be_one=0])],
  991. [AS_IF([test x$my_with_libidn2 = x1],
  992. [there_can_only_be_one=0
  993. AC_MSG_FAILURE([* There can only be one libidn.
  994. * Provide either libidn >= 1.13
  995. * or
  996. * libidn2 to the configure
  997. * script via
  998. * --with-libidn2
  999. * --with-libidn])])])])
  1000. AM_CONDITIONAL(HAVE_LIBIDN, test x$working_libidn1 = x1)
  1001. AS_IF([test "$working_libidn1" = 0 -a "$working_libidn2" = 0],
  1002. [AC_MSG_ERROR([GNUnet requires libidn (or libidn2)])])
  1003. AS_IF([test x$there_can_only_be_one = x0],
  1004. [AC_MSG_FAILURE([Missing dependencies: $MISSING_DEPS])])
  1005. # test for zlib
  1006. SAVE_LDFLAGS=$LDFLAGS
  1007. SAVE_CPPFLAGS=$CPPFLAGS
  1008. AC_ARG_WITH(zlib,
  1009. [ --with-zlib[[=DIR]] use libz in DIR],
  1010. [AS_IF([test "$withval" = "no"],
  1011. [AC_MSG_ERROR([GNUnet requires zlib])],
  1012. [test "$withval" != "yes"],
  1013. [Z_DIR=$withval
  1014. CPPFLAGS="${CPPFLAGS} -I$withval/include"
  1015. LDFLAGS="${LDFLAGS} -L$withval/lib"])])
  1016. AC_CHECK_HEADER(zlib.h,
  1017. [],
  1018. [AC_MSG_ERROR([GNUnet requires zlib])])
  1019. AC_CHECK_LIB(z,
  1020. compress2,
  1021. [AC_DEFINE([HAVE_ZLIB],
  1022. [],
  1023. [Have compression library])
  1024. if test "x${Z_DIR}" != "x"; then
  1025. Z_CFLAGS="-I${Z_DIR}/include"
  1026. Z_LIBS="-L${Z_DIR}/lib -lz"
  1027. else
  1028. Z_LIBS="-lz"
  1029. fi],
  1030. [AC_MSG_ERROR([GNUnet requires zlib])])
  1031. AC_SUBST(Z_CFLAGS)
  1032. AC_SUBST(Z_LIBS)
  1033. AS_IF([test "$enable_shared" = "no"],
  1034. [AC_MSG_ERROR([GNUnet only works with shared libraries. Sorry.])])
  1035. # restore LIBS
  1036. LIBS=$SAVE_LIBS
  1037. # end of taler-only being false
  1038. ])
  1039. # check for iconv
  1040. AM_ICONV
  1041. # test for libunistring
  1042. gl_LIBUNISTRING
  1043. AS_IF([test $HAVE_LIBUNISTRING != yes],
  1044. [AC_MSG_ERROR([GNUnet requires libunistring])])
  1045. # under emscripten, $gl_libunistring_hexversion is undefined
  1046. if test "$taler_only" != yes; then
  1047. AS_IF([test "x$gl_libunistring_hexversion" = "x" || test "$gl_libunistring_hexversion" -le 2305],
  1048. [AC_MSG_ERROR([GNUnet requires libunistring >= 0.9.1.1])])
  1049. fi
  1050. AC_CHECK_HEADERS([unistr.h],
  1051. ,
  1052. AC_MSG_ERROR([Compiling GNUnet requires unistr.h (from libunistring) to be installed]))
  1053. # restore LIBS
  1054. LIBS=$SAVE_LIBS
  1055. # Checks for standard header files.
  1056. AC_HEADER_DIRENT
  1057. AC_HEADER_STDC
  1058. # Check for headers that are ALWAYS required
  1059. 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: 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]))
  1060. # Checks for headers that are only required on some systems or
  1061. # opional (and where we do NOT abort if they are not there)
  1062. AC_CHECK_HEADERS([stdatomic.h 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 argz.h ucred.h sys/ucred.h endian.h sys/endian.h execinfo.h byteswap.h])
  1063. # FreeBSD requires this for netinet/in_systm.h and netinet/ip.h
  1064. AC_CHECK_HEADERS([sys/types.h netinet/in_systm.h netinet/in.h netinet/ip.h],,,
  1065. [#ifdef HAVE_SYS_TYPES_H
  1066. #include <sys/types.h>
  1067. #endif
  1068. #ifdef HAVE_NETINET_IN_SYSTM_H
  1069. #include <netinet/in_systm.h>
  1070. #endif
  1071. #ifdef HAVE_NETINET_IN_H
  1072. #include <netinet/in.h>
  1073. #endif
  1074. ])
  1075. SAVE_LDFLAGS=$LDFLAGS
  1076. SAVE_CPPFLAGS=$CPPFLAGS
  1077. # test for sqlite
  1078. sqlite=false
  1079. AC_MSG_CHECKING(for SQLite)
  1080. AC_ARG_WITH(sqlite,
  1081. [ --with-sqlite=PFX base of SQLite installation],
  1082. [AC_MSG_RESULT("$with_sqlite")
  1083. AS_CASE([$with_sqlite],
  1084. [no],[],
  1085. [yes],[
  1086. AC_CHECK_HEADERS(sqlite3.h,
  1087. sqlite=true)],
  1088. [
  1089. LDFLAGS="-L$with_sqlite/lib $LDFLAGS"
  1090. CPPFLAGS="-I$with_sqlite/include $CPPFLAGS"
  1091. AC_CHECK_HEADERS(sqlite3.h,
  1092. EXT_LIB_PATH="-L$with_sqlite/lib $EXT_LIB_PATH"
  1093. SQLITE_LDFLAGS="-L$with_sqlite/lib"
  1094. SQLITE_CPPFLAGS="-I$with_sqlite/include"
  1095. sqlite=true)
  1096. LDFLAGS=$SAVE_LDFLAGS
  1097. CPPFLAGS=$SAVE_CPPFLAGS
  1098. ])
  1099. ],
  1100. [AC_MSG_RESULT([--with-sqlite not specified])
  1101. AC_CHECK_HEADERS(sqlite3.h, sqlite=true)])
  1102. AM_CONDITIONAL(HAVE_SQLITE, test x$sqlite = xtrue)
  1103. AC_SUBST(SQLITE_CPPFLAGS)
  1104. AC_SUBST(SQLITE_LDFLAGS)
  1105. LDFLAGS=$SAVE_LDFLAGS
  1106. CPPFLAGS=$SAVE_CPPFLAGS
  1107. # test for postgres
  1108. postgres=false
  1109. # even running the check for postgres breaks emscripten ...
  1110. AS_IF([test "$taler_only" != yes],
  1111. [AX_LIB_POSTGRESQL([9.5],
  1112. [CPPFLAGS="$CPPFLAGS $POSTGRESQL_CPPFLAGS"
  1113. AC_CHECK_HEADERS([libpq-fe.h],
  1114. postgres=true)
  1115. ],
  1116. [AC_MSG_RESULT([no postgres])])])
  1117. AM_CONDITIONAL(HAVE_POSTGRESQL, test x$postgres = xtrue)
  1118. LDFLAGS=$SAVE_LDFLAGS
  1119. CPPFLAGS=$SAVE_CPPFLAGS
  1120. # mysql & windows
  1121. AC_CHECK_TYPES([sigset_t, off_t], [], [], [#include <sys/types.h>])
  1122. AC_CHECK_TYPES([size_t], [], [], [#include <stdio.h>])
  1123. # test for mysql
  1124. mysql=false
  1125. mysqlfail=false
  1126. SAVE_LDFLAGS=$LDFLAGS
  1127. SAVE_CPPFLAGS=$CPPFLAGS
  1128. AC_MSG_CHECKING(for mysql)
  1129. AC_ARG_WITH(mysql,
  1130. [ --with-mysql=PFX base of MySQL installation],
  1131. [AC_MSG_RESULT([$with_mysql])
  1132. AS_CASE([$with_mysql],
  1133. [no],[],
  1134. [yes|""],[
  1135. AC_CHECK_HEADERS(mysql/mysql.h,
  1136. AC_CHECK_LIB(mysqlclient, mysql_init,
  1137. mysql=true), [], [])
  1138. ],[
  1139. LDFLAGS="-L$with_mysql/lib -L$with_mysql/lib/mysql $LDFLAGS $ZLIBS"
  1140. CPPFLAGS="-I$with_mysql/include $CPPFLAGS"
  1141. AC_CHECK_HEADERS(mysql/mysql.h,
  1142. AC_CHECK_LIB(mysqlclient, mysql_init,
  1143. MYSQL_LDFLAGS="-L$with_mysql/lib -L$with_mysql/lib/mysql"
  1144. MYSQL_CPPFLAGS="-I$with_mysql/include"
  1145. mysql=true), [], [])
  1146. ])
  1147. ],
  1148. [AC_MSG_RESULT([--with-mysql not specified])
  1149. if test -d "/usr/lib64/mysql"; then
  1150. MYSQL_LIBDIR="/usr/lib64/mysql"
  1151. elif test -d "/usr/lib/mysql"; then
  1152. MYSQL_LIBDIR="/usr/lib/mysql"
  1153. else
  1154. MYSQL_LIBDIR="/usr/lib"
  1155. fi
  1156. LDFLAGS="-L$MYSQL_LIBDIR $LDFLAGS $ZLIBS"
  1157. AC_CHECK_LIB(mysqlclient, mysql_init,
  1158. [AC_CHECK_HEADERS(mysql/mysql.h,
  1159. MYSQL_LDFLAGS="-L$MYSQL_LIBDIR"
  1160. mysql=true
  1161. , [], [])])
  1162. ])
  1163. AC_SUBST(MYSQL_LDFLAGS)
  1164. AC_SUBST(MYSQL_CPPFLAGS)
  1165. # additional version check for mysql
  1166. AC_ARG_ENABLE(mysql-version-check, [ --disable-mysql-version-check do not check MySQL version],, enable_mysql_version_check=yes)
  1167. AS_IF([test "$mysql" = "true" -a "x$enable_mysql_version_check" = "xyes"],
  1168. [
  1169. AC_MSG_CHECKING(mysql version)
  1170. AC_COMPILE_IFELSE([AC_LANG_PROGRAM(
  1171. [[
  1172. #include <mysql/mysql.h>]],
  1173. [[
  1174. #if (MYSQL_VERSION_ID < 40100)
  1175. #error needs at least version >= 4.1
  1176. #endif
  1177. int main () { return 0; }
  1178. ]])
  1179. ],mysql=true,mysql=false)
  1180. AS_IF([test "$mysql" = "false"],
  1181. [
  1182. mysqlfail=true
  1183. AC_MSG_RESULT([fail, >= 4.1 required])
  1184. ],[
  1185. AC_MSG_RESULT(ok)
  1186. ])
  1187. ])
  1188. AM_CONDITIONAL(HAVE_MYSQL, test x$mysql = xtrue)
  1189. AM_CONDITIONAL(HAVE_MYSQLE, false)
  1190. # restore LIBS
  1191. LIBS=$SAVE_LIBS
  1192. LDFLAGS=$SAVE_LDFLAGS
  1193. CPPFLAGS=$SAVE_CPPFLAGS
  1194. # TODO: should this test for "or" not "and"?
  1195. # TODO: Add postgres?
  1196. AS_IF([test "$sqlite" = 0 -a "$mysql" = 0],
  1197. [
  1198. AC_MSG_ERROR([GNUnet requires SQLite or MySQL / MariaDB.])
  1199. ])
  1200. # libmicrohttpd
  1201. lmhd=0
  1202. m4_define([MHD_MODULE], [libmicrohttpd >= 0.9.63])
  1203. AC_ARG_WITH(microhttpd,
  1204. [AS_HELP_STRING([--with-microhttpd[[=PFX]]],
  1205. [base of libmicrohttpd installation])],
  1206. [],
  1207. [with_microhttpd=check])
  1208. AS_CASE([$with_microhttpd],
  1209. [no], [],
  1210. [yes], [PKG_CHECK_MODULES([MHD], [MHD_MODULE], [lmhd=1])],
  1211. [check], [PKG_CHECK_MODULES([MHD], [MHD_MODULE],
  1212. [lmhd=1],
  1213. [AC_MSG_WARN([Building without libmicrohttpd])])],
  1214. [SAVE_PKG_CONFIG_PATH=$PKG_CONFIG_PATH
  1215. PKG_CONFIG_PATH=$with_microhttpd/lib/pkgconfig
  1216. export PKG_CONFIG_PATH
  1217. PKG_CHECK_MODULES([MHD], [MHD_MODULE], [lmhd=1])
  1218. PKG_CONFIG_PATH=$SAVE_PKG_CONFIG_PATH])
  1219. AM_CONDITIONAL(HAVE_MHD, test x$lmhd = x1)
  1220. AC_DEFINE_UNQUOTED([HAVE_MHD], $lmhd, [We have libmicrohttpd])
  1221. AM_CONDITIONAL(HAVE_JSON, [test x$jansson = x1])
  1222. # restore LIBS
  1223. LIBS=$SAVE_LIBS
  1224. # check for gettext
  1225. AM_GNU_GETTEXT([external])
  1226. AM_GNU_GETTEXT_VERSION([0.18.1])
  1227. # Checks for standard typedefs, structures, and compiler characteristics.
  1228. AC_TYPE_PID_T
  1229. AC_TYPE_SIZE_T
  1230. AC_TYPE_MODE_T
  1231. AC_HEADER_TIME
  1232. AC_HEADER_STAT
  1233. AC_HEADER_STDBOOL
  1234. AC_STRUCT_TM
  1235. AC_CHECK_MEMBER([struct sockaddr_in.sin_len],
  1236. [ AC_DEFINE(HAVE_SOCKADDR_IN_SIN_LEN, 1, [Do we have sockaddr_in.sin_len?])
  1237. ],
  1238. [],
  1239. [
  1240. #include <sys/types.h>
  1241. #include <sys/socket.h>
  1242. #include <netinet/in.h>
  1243. ])
  1244. AC_CHECK_MEMBER([struct sockaddr_un.sun_len],
  1245. [ AC_DEFINE(HAVE_SOCKADDR_UN_SUN_LEN,
  1246. 1,
  1247. [Do we have sockaddr_un.sun_len?])],
  1248. [],
  1249. [
  1250. #include <sys/types.h>
  1251. #include <sys/socket.h>
  1252. #include <sys/un.h>
  1253. ])
  1254. # Checks for library functions.
  1255. AC_FUNC_CLOSEDIR_VOID
  1256. AC_FUNC_FORK
  1257. AC_PROG_GCC_TRADITIONAL
  1258. AC_FUNC_MEMCMP
  1259. AC_FUNC_SELECT_ARGTYPES
  1260. AC_FUNC_CHOWN
  1261. AC_TYPE_SIGNAL
  1262. AC_FUNC_STAT
  1263. AC_FUNC_STRFTIME
  1264. AC_FUNC_VPRINTF
  1265. AC_HEADER_SYS_WAIT
  1266. AC_TYPE_OFF_T
  1267. AC_TYPE_UID_T
  1268. 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 wait4])
  1269. # restore LIBS
  1270. LIBS=$SAVE_LIBS
  1271. GN_INTLINCL=""
  1272. GN_LIBINTL="$LTLIBINTL"
  1273. AC_ARG_ENABLE(framework,
  1274. [AS_HELP_STRING([--enable-framework],[enable Mac OS X framework build helpers])],
  1275. enable_framework_build=$enableval)
  1276. AM_CONDITIONAL(WANT_FRAMEWORK,
  1277. test x$enable_framework_build = xyes)
  1278. AS_IF([test x$enable_framework_build = xyes],
  1279. [AC_DEFINE([FRAMEWORK_BUILD],
  1280. 1,
  1281. [Build a Mac OS X Framework])
  1282. GN_INTLINCL='-I$(top_srcdir)/src/intlemu'
  1283. GN_LIBINTL='$(top_builddir)/src/intlemu/libintlemu.la -framework CoreFoundation'
  1284. AC_LIB_APPENDTOVAR([CPPFLAGS],
  1285. [$GN_INTLINCL])])
  1286. GN_LIB_LDFLAGS="-export-dynamic -no-undefined"
  1287. GN_PLUGIN_LDFLAGS="-export-dynamic -avoid-version -module -no-undefined"
  1288. AC_SUBST(GN_LIB_LDFLAGS)
  1289. AC_SUBST(GN_PLUGIN_LDFLAGS)
  1290. AC_SUBST(GN_INTLINCL)
  1291. AC_SUBST(GN_LIBINTL)
  1292. AC_SUBST(CPPFLAGS)
  1293. AC_SUBST(LIBS)
  1294. AC_SUBST(LDFLAGS)
  1295. AC_SUBST(EXT_LIB_PATH)
  1296. AC_SUBST(EXT_LIBS)
  1297. AC_SUBST(LIBPREFIX)
  1298. AC_SUBST(DLLDIR)
  1299. AC_SUBST(EXT_LIB_PATH)
  1300. DATAROOTDIR=$datarootdir
  1301. AC_SUBST(DATAROOTDIR)
  1302. # test for sudo
  1303. AC_MSG_CHECKING(for sudo)
  1304. #AC_CHECK_PROGS(SUDO_BINARY, [sudo], false)
  1305. #AM_CONDITIONAL(HAVE_SUDO, test x$SUDO_BINARY != xfalse)
  1306. AC_ARG_WITH(sudo,
  1307. [ --with-sudo=PATH path to sudo binary (or just yes)],
  1308. [AC_MSG_RESULT("$with_sudo")
  1309. AS_CASE([$with_sudo],
  1310. [no],[SUDO_BINARY=],
  1311. [yes],[SUDO_BINARY=sudo],
  1312. [SUDO_BINARY=$with_sudo])],
  1313. [AC_MSG_RESULT([no])])
  1314. AC_SUBST(SUDO_BINARY)
  1315. AM_CONDITIONAL([HAVE_SUDO],
  1316. [test "x$SUDO_BINARY" != "x" -o -w /])
  1317. # test for doas
  1318. AC_MSG_CHECKING(for doas)
  1319. AC_CHECK_PROGS(DOAS_BINARY, [doas], false)
  1320. AM_CONDITIONAL(HAVE_DOAS_BINARY, test x$DOAS_BINARY != xfalse)
  1321. # test for gnunetdns group name
  1322. GNUNETDNS_GROUP=gnunetdns
  1323. AC_MSG_CHECKING(for gnunetdns group name)
  1324. AC_ARG_WITH(gnunetdns,
  1325. [ --with-gnunetdns=GRPNAME name for gnunetdns group],
  1326. [AC_MSG_RESULT("$with_gnunetdns")
  1327. AS_CASE([$with_gnunetdns],
  1328. [no],[GNUNETDNS_GROUP=gnunet],
  1329. [yes],[GNUNETDNS_GROUP=gnunetdns],
  1330. [GNUNETDNS_GROUP=$with_gnunetdns])],
  1331. [AC_MSG_RESULT([gnunetdns])])
  1332. AC_SUBST(GNUNETDNS_GROUP)
  1333. # gnutls
  1334. gnutls=0
  1335. gnutls_dane=0
  1336. AC_MSG_CHECKING(for gnutls)
  1337. AC_ARG_WITH(gnutls,
  1338. [ --with-gnutls=PFX base of gnutls installation],
  1339. [AC_MSG_RESULT([$with_gnutls])
  1340. AS_CASE([$with_gnutls],
  1341. [no],[],
  1342. [yes],
  1343. [AC_CHECK_HEADERS([gnutls/abstract.h],
  1344. AC_CHECK_LIB([gnutls],
  1345. [gnutls_priority_set],
  1346. gnutls=true))
  1347. AC_CHECK_HEADERS([gnutls/dane.h],
  1348. AC_CHECK_LIB([gnutls-dane],
  1349. [dane_verify_crt_raw],
  1350. gnutls_dane=1))],
  1351. [LDFLAGS="-L$with_gnutls/lib $LDFLAGS"
  1352. CPPFLAGS="-I$with_gnutls/include $CPPFLAGS"
  1353. AC_CHECK_HEADERS([gnutls/abstract.h],
  1354. AC_CHECK_LIB([gnutls], [gnutls_priority_set],
  1355. EXT_LIB_PATH="-L$with_gnutls/lib $EXT_LIB_PATH"
  1356. gnutls=true))
  1357. AC_CHECK_HEADERS([gnutls/dane.h],
  1358. AC_CHECK_LIB([gnutls-dane], [dane_verify_crt_raw],
  1359. gnutls_dane=1))
  1360. ])
  1361. ],
  1362. [AC_MSG_RESULT([--with-gnutls not specified])
  1363. AC_CHECK_HEADERS([gnutls/abstract.h],
  1364. AC_CHECK_LIB([gnutls], [gnutls_priority_set],
  1365. gnutls=true))
  1366. AC_CHECK_HEADERS([gnutls/dane.h],
  1367. AC_CHECK_LIB([gnutls-dane], [dane_verify_crt_raw],
  1368. gnutls_dane=1))
  1369. ])
  1370. AM_CONDITIONAL(HAVE_GNUTLS, test x$gnutls = xtrue)
  1371. AC_DEFINE_UNQUOTED([HAVE_GNUTLS], $gnutls, [We have GnuTLS])
  1372. AM_CONDITIONAL(HAVE_GNUTLS_DANE, test x$gnutls_dane = x1)
  1373. AC_DEFINE_UNQUOTED([HAVE_GNUTLS_DANE], $gnutls_dane, [We have GnuTLS with DANE support])
  1374. # Test if we are building for superMUC
  1375. AC_MSG_CHECKING(if GNUnet is being configured to run on the SuperMUC)
  1376. AC_ARG_ENABLE([supermuc],
  1377. [AS_HELP_STRING([--enable-supermuc],
  1378. [build GNUnet with support to run on the SuperMUC (default is NO)])],
  1379. [AS_IF([test "x$enable_supermuc" = "xno"],
  1380. [supermuc=0],
  1381. [supermuc=1])],
  1382. [supermuc=0
  1383. enable_supermuc=no])
  1384. AC_MSG_RESULT($enable_SUPERMUC)
  1385. AM_CONDITIONAL([ENABLE_SUPERMUC], [test "x$supermuc" = "x1"])
  1386. AC_DEFINE_UNQUOTED([ENABLE_SUPERMUC], [$supermuc], [Build with support for SuperMUC])
  1387. # Check if NSE has to send timestamp information to testbed logger for
  1388. # generating histogram of messages received
  1389. AC_MSG_CHECKING(if NSE has to send timestamp information to testbed logger)
  1390. AC_ARG_ENABLE([nse-histogram],
  1391. [AS_HELP_STRING([--enable-nse-histogram],
  1392. [have NSE send timestamp information to testbed logger for generating
  1393. histogram of received messages. NOT useful for production (default is
  1394. NO)])],
  1395. [AS_IF([test "x$enableval" = "xno"],
  1396. [nse_histogram=0],
  1397. [nse_histogram=1])],
  1398. [nse_histogram=0
  1399. enable_nse_histogram=no])
  1400. AC_MSG_RESULT($enable_nse_histogram)
  1401. AM_CONDITIONAL([ENABLE_NSE_HISTOGRAM], [test "x$nse_histogram" = "x1"])
  1402. AC_DEFINE_UNQUOTED([ENABLE_NSE_HISTOGRAM], [$nse_histogram],
  1403. [have NSE send timestamp information to testbed logger])
  1404. # should 'make check' run tests?
  1405. AC_MSG_CHECKING(whether to run tests)
  1406. AC_ARG_ENABLE([testruns],
  1407. [AS_HELP_STRING([--disable-testruns], [disable running tests on make check (default is YES)])],
  1408. [enable_tests_run=${enableval}],
  1409. [enable_tests_run=yes])
  1410. AC_MSG_RESULT($enable_test_run)
  1411. AM_CONDITIONAL([ENABLE_TEST_RUN], [test "x$enable_tests_run" = "xyes"])
  1412. AC_MSG_CHECKING([whether to compile in benchmarks (currently for http and crypto)])
  1413. AC_ARG_ENABLE([benchmark],
  1414. [AS_HELP_STRING([--enable-benchmark], [enable benchmarking])],
  1415. [enable_benchmark=${enableval}],
  1416. [enable_benchmark=no])
  1417. AC_MSG_RESULT($enable_benchmark)
  1418. AS_IF([test "x$enable_benchmark" = "xyes"],
  1419. [AC_DEFINE_UNQUOTED(ENABLE_BENCHMARK,1,[Benchmarks are enabled])])
  1420. AM_CONDITIONAL([ENABLE_BENCHMARK], [test "x$enable_benchmark" = "xyes"])
  1421. # should expensive tests be run?
  1422. AC_MSG_CHECKING(whether to run expensive tests)
  1423. AC_ARG_ENABLE([expensivetests],
  1424. [AS_HELP_STRING([--enable-expensivetests], [enable running expensive testcases])],
  1425. [enable_expensive=${enableval}],
  1426. [enable_expensive=no])
  1427. AC_MSG_RESULT($enable_expensive)
  1428. AM_CONDITIONAL([HAVE_EXPENSIVE_TESTS], [test "x$enable_expensive" = "xyes"])
  1429. # should ports be open for Java services?
  1430. AC_MSG_CHECKING(whether to enable ports for gnunet-java)
  1431. AC_ARG_ENABLE([javaports],
  1432. [AS_HELP_STRING([--enable-javaports], [use non-zero ports for services with Java bindings (default is NO)])],
  1433. [enable_java_ports=${enableval}],
  1434. [enable_java_ports=no])
  1435. AC_MSG_RESULT($enable_java_ports)
  1436. AS_IF([test "x$enable_java_ports" = "xyes"],
  1437. [JAVAPORT=""],
  1438. [JAVAPORT="$UNIXONLY"])
  1439. AC_SUBST(JAVAPORT)
  1440. # should benchmarks be run?
  1441. AC_MSG_CHECKING(whether to run benchmarks during make check)
  1442. AC_ARG_ENABLE([benchmarks],
  1443. [AS_HELP_STRING([--enable-benchmarks], [enable running benchmarks during make check])],
  1444. [enable_benchmarks=${enableval}],
  1445. [enable_benchmarks=no])
  1446. AC_MSG_RESULT($enable_benchmarks)
  1447. AM_CONDITIONAL([HAVE_BENCHMARKS], [test "x$enable_benchmarks" = "xyes"])
  1448. # should gnunet-testing be compiled
  1449. AC_MSG_CHECKING(wether to compile gnunet-testing)
  1450. AC_ARG_ENABLE([testing],
  1451. [AS_HELP_STRING([--disable-testing], [do not build gnunet-testing])],
  1452. [enable_testing=${enableval}],
  1453. [enable_testing=yes])
  1454. AC_MSG_RESULT($enable_testing)
  1455. AM_CONDITIONAL([HAVE_TESTING], [test "x$enable_testing" = "xyes"])
  1456. # should experimental code be compiled (code that may not yet compile)?
  1457. AC_MSG_CHECKING(whether to compile experimental code)
  1458. AC_ARG_ENABLE([experimental],
  1459. [AS_HELP_STRING([--enable-experimental], [enable compiling experimental code])],
  1460. [enable_experimental=${enableval}],
  1461. [enable_experimental=no])
  1462. AC_MSG_RESULT($enable_experimental)
  1463. AM_CONDITIONAL([HAVE_EXPERIMENTAL], [test "x$enable_experimental" = "xyes"])
  1464. # should malicious code be compiled (should only be used for testing)?
  1465. AC_MSG_CHECKING(whether to compile malicious code)
  1466. AC_ARG_ENABLE([malicious],
  1467. [AS_HELP_STRING([--enable-malicious], [enable compiling malicious code])],
  1468. [AS_IF([test "x$enableval" = "xno"],
  1469. [malicious=0],
  1470. [malicious=1])],
  1471. [malicious=0
  1472. enable_malicious=no])
  1473. AC_MSG_RESULT($enable_malicious)
  1474. AM_CONDITIONAL([ENABLE_MALICIOUS], [test 1=$malicious])
  1475. AC_DEFINE_UNQUOTED([ENABLE_MALICIOUS], [$malicious],
  1476. [enable compilation of malicious code])
  1477. # should services be started on demand when needed?
  1478. # Some services may choose to never start by default
  1479. # and it is up to the service/module developer to decide
  1480. # by having "START_ON_DEMAND = NO" instead of
  1481. # "START_ON_DEMAND = @START_ON_DEMAND@"
  1482. # in the service/module's conf.in file.
  1483. # See also IMMEDIATE_START for an unconditional immediate start.
  1484. START_ON_DEMAND="YES"
  1485. AC_MSG_CHECKING(whether to start peer's services on demand by default)
  1486. AC_ARG_ENABLE([autostart],
  1487. [AS_HELP_STRING([--disable-autostart], [do not start peer's services by default])],
  1488. [enable_autostart=${enableval}
  1489. AS_IF([test "x$enable_autostart" = "xno"],
  1490. [START_ON_DEMAND="NO"])
  1491. ],
  1492. [enable_autostart=yes])
  1493. AC_MSG_RESULT($enable_autostart)
  1494. #AM_CONDITIONAL([HAVE_START_ON_DEMAND], [test "x$enable_autostart" = "xyes"])
  1495. AC_SUBST(START_ON_DEMAND)
  1496. # should memory statistics be kept (very expensive CPU-wise!)
  1497. AC_MSG_CHECKING(whether to create expensive statistics on memory use)
  1498. AC_ARG_ENABLE([heapstats],
  1499. [AS_HELP_STRING([--enable-heapstats], [enable expensive heap statistics])],
  1500. [enable_heapstats=1],
  1501. [enable_heapstats=0])
  1502. AC_MSG_RESULT($enable_heapstats)
  1503. AC_DEFINE_UNQUOTED([ENABLE_HEAP_STATISTICS],$enable_heapstats,[enable expensive heap statistics])
  1504. # Check if the __thread storage class for
  1505. # thread-local storage is available.
  1506. AC_MSG_CHECKING(whether __thread is supported)
  1507. AC_LINK_IFELSE(
  1508. [AC_LANG_PROGRAM([#include <stdlib.h>
  1509. #undef __thread
  1510. static __thread int a = 1;],
  1511. [exit(a-1);])],
  1512. [have_thread_local_gcc=1],[have_thread_local_gcc=0])
  1513. AC_DEFINE_UNQUOTED([HAVE_THREAD_LOCAL_GCC],$have_thread_local_gcc,[Define this if __thread is supported])
  1514. AS_IF([test "x$have_thread_local_gcc" = "x1"],
  1515. [AC_MSG_RESULT(yes)],
  1516. [AC_MSG_RESULT(no)])
  1517. # gcov compilation
  1518. AC_MSG_CHECKING(whether to compile with support for code coverage analysis)
  1519. AC_ARG_ENABLE([coverage],
  1520. AS_HELP_STRING([--enable-coverage],
  1521. [compile the library with code coverage support]),
  1522. [use_gcov=${enableval}],
  1523. [use_gcov=no])
  1524. AC_MSG_RESULT($use_gcov)
  1525. AM_CONDITIONAL([USE_COVERAGE], [test "x$use_gcov" = "xyes"])
  1526. # version info
  1527. # TODO: git blame says this predates our switch to git.
  1528. # git-svn should be adjusted to simply git, or
  1529. # an external script that does the job.
  1530. AC_PATH_PROG(svnversioncommand, svnversion)
  1531. AC_PATH_PROG(gitcommand, git)
  1532. AC_MSG_CHECKING(for source being under a VCS)
  1533. # version info
  1534. AC_PATH_PROG(gitcommand, git)
  1535. AC_MSG_CHECKING(for source being under a VCS)
  1536. git_version=
  1537. AS_IF([test ! "X$gitcommand" = "X"],
  1538. [
  1539. git_version=$(cd $srcdir ; git rev-list --full-history --all --abbrev-commit | head -n 1 2>/dev/null)
  1540. ])
  1541. AS_IF([test "X$git_version" = "X"],
  1542. [
  1543. vcs_name="no"
  1544. vcs_version="\"release\""
  1545. ],
  1546. [
  1547. vcs_name="yes, git-svn"
  1548. vcs_version="\"git-$git_version\""
  1549. ])
  1550. AC_MSG_RESULT($vcs_name)
  1551. AC_MSG_CHECKING(VCS version)
  1552. AC_MSG_RESULT($vcs_version)
  1553. AC_DEFINE_UNQUOTED(VCS_VERSION, [$vcs_version], [VCS revision/hash or tarball version])
  1554. AC_CONFIG_FILES([
  1555. Makefile
  1556. contrib/Makefile
  1557. contrib/hellos/Makefile
  1558. contrib/services/Makefile
  1559. contrib/services/openrc/Makefile
  1560. contrib/services/systemd/Makefile
  1561. contrib/scripts/Makefile
  1562. contrib/scripts/gnunet-logread/Makefile
  1563. doc/Makefile
  1564. doc/man/Makefile
  1565. doc/doxygen/Makefile
  1566. doc/handbook/Makefile
  1567. doc/tutorial/Makefile
  1568. lint/Makefile
  1569. m4/Makefile
  1570. po/Makefile.in
  1571. src/Makefile
  1572. src/arm/Makefile
  1573. src/arm/arm.conf
  1574. src/ats/Makefile
  1575. src/ats/ats.conf
  1576. src/ats-tool/Makefile
  1577. src/ats-tests/Makefile
  1578. src/auction/Makefile
  1579. src/block/Makefile
  1580. src/cadet/Makefile
  1581. src/cadet/cadet.conf
  1582. src/core/Makefile
  1583. src/core/core.conf
  1584. src/consensus/Makefile
  1585. src/consensus/consensus.conf
  1586. src/conversation/Makefile
  1587. src/conversation/conversation.conf
  1588. src/curl/Makefile
  1589. src/datacache/Makefile
  1590. src/datastore/Makefile
  1591. src/datastore/datastore.conf
  1592. src/dht/Makefile
  1593. src/dht/dht.conf
  1594. src/dns/Makefile
  1595. src/dns/dns.conf
  1596. src/exit/Makefile
  1597. src/fragmentation/Makefile
  1598. src/fs/Makefile
  1599. src/fs/fs.conf
  1600. src/gns/Makefile
  1601. src/gns/gns.conf
  1602. src/gns/nss/Makefile
  1603. src/gnsrecord/Makefile
  1604. src/hello/Makefile
  1605. src/identity/Makefile
  1606. src/identity/identity.conf
  1607. src/abd/Makefile
  1608. src/abd/abd.conf
  1609. src/include/Makefile
  1610. src/integration-tests/Makefile
  1611. src/json/Makefile
  1612. src/hostlist/Makefile
  1613. src/my/Makefile
  1614. src/mysql/Makefile
  1615. src/namecache/Makefile
  1616. src/namecache/namecache.conf
  1617. src/namestore/Makefile
  1618. src/namestore/namestore.conf
  1619. src/nat/Makefile
  1620. src/nat/nat.conf
  1621. src/nat-auto/Makefile
  1622. src/nat-auto/nat-auto.conf
  1623. src/nse/Makefile
  1624. src/nse/nse.conf
  1625. src/nt/Makefile
  1626. src/peerinfo/Makefile
  1627. src/peerinfo/peerinfo.conf
  1628. src/peerinfo-tool/Makefile
  1629. src/peerstore/Makefile
  1630. src/peerstore/peerstore.conf
  1631. src/pq/Makefile
  1632. src/pt/Makefile
  1633. src/regex/Makefile
  1634. src/regex/regex.conf
  1635. src/revocation/Makefile
  1636. src/revocation/revocation.conf
  1637. src/rps/Makefile
  1638. src/rps/rps.conf
  1639. src/secretsharing/Makefile
  1640. src/secretsharing/secretsharing.conf
  1641. src/scalarproduct/Makefile
  1642. src/scalarproduct/scalarproduct.conf
  1643. src/set/Makefile
  1644. src/set/set.conf
  1645. src/sq/Makefile
  1646. src/statistics/Makefile
  1647. src/statistics/statistics.conf
  1648. src/template/Makefile
  1649. src/testbed/Makefile
  1650. src/testbed/testbed.conf
  1651. src/testbed-logger/Makefile
  1652. src/testbed-logger/testbed-logger.conf
  1653. src/testing/Makefile
  1654. src/topology/Makefile
  1655. src/transport/Makefile
  1656. src/transport/transport.conf
  1657. src/util/Makefile
  1658. src/util/resolver.conf
  1659. src/vpn/Makefile
  1660. src/vpn/vpn.conf
  1661. src/zonemaster/Makefile
  1662. src/zonemaster/zonemaster.conf
  1663. src/rest/Makefile
  1664. src/abe/Makefile
  1665. src/reclaim-attribute/Makefile
  1666. src/reclaim/Makefile
  1667. pkgconfig/Makefile
  1668. pkgconfig/gnunetarm.pc
  1669. pkgconfig/gnunetats.pc
  1670. pkgconfig/gnunetblock.pc
  1671. pkgconfig/gnunetcadet.pc
  1672. pkgconfig/gnunetconsensus.pc
  1673. pkgconfig/gnunetconversation.pc
  1674. pkgconfig/gnunetcore.pc
  1675. pkgconfig/gnunetdatacache.pc
  1676. pkgconfig/gnunetdatastore.pc
  1677. pkgconfig/gnunetdht.pc
  1678. pkgconfig/gnunetdns.pc
  1679. pkgconfig/gnunetenv.pc
  1680. pkgconfig/gnunetfragmentation.pc
  1681. pkgconfig/gnunetfs.pc
  1682. pkgconfig/gnunetgns.pc
  1683. pkgconfig/gnunethello.pc
  1684. pkgconfig/gnunetidentity.pc
  1685. pkgconfig/gnunetmicrophone.pc
  1686. pkgconfig/gnunetmysql.pc
  1687. pkgconfig/gnunetnamestore.pc
  1688. pkgconfig/gnunetnat.pc
  1689. pkgconfig/gnunetnse.pc
  1690. pkgconfig/gnunetpeerinfo.pc
  1691. pkgconfig/gnunetpq.pc
  1692. pkgconfig/gnunetregex.pc
  1693. pkgconfig/gnunetrevocation.pc
  1694. pkgconfig/gnunetrps.pc
  1695. pkgconfig/gnunetscalarproduct.pc
  1696. pkgconfig/gnunetset.pc
  1697. pkgconfig/gnunetspeaker.pc
  1698. pkgconfig/gnunetstatistics.pc
  1699. pkgconfig/gnunettestbed.pc
  1700. pkgconfig/gnunettesting.pc
  1701. pkgconfig/gnunettransport.pc
  1702. pkgconfig/gnunetutil.pc
  1703. pkgconfig/gnunetvpn.pc
  1704. ])
  1705. AC_OUTPUT
  1706. # FIXME: `some modules' -> be more specific which exact modules.
  1707. # java ports
  1708. AS_IF([test "x$enable_java_ports" = "xyes"],
  1709. [AC_MSG_NOTICE([NOTICE: Opening ports for gnunet-java bindings by default.])])
  1710. ####
  1711. #### Lasciate ogne speranza, voi ch'intrate
  1712. ####
  1713. #### This could be moved to the checks above,
  1714. #### but for now let's keep it here.
  1715. ####
  1716. # -- print message regarding enabled experimental features
  1717. AS_IF([test "x$enable_experimental" = "xyes"],
  1718. [experimental_msg="experimental features enabled"])
  1719. # -- OSX Framework
  1720. AS_IF([test "$enable_framework_build" = "yes"],
  1721. [macosx_framework_msg="yes"],
  1722. [macosx_framework_msg="no"])
  1723. # -- libidn 2
  1724. AS_IF([test "x$working_libidn2" = x1],
  1725. [libidn2_msg="libidn2"])
  1726. # -- libidn 1
  1727. AS_IF([test "x$working_libidn1" = x1],
  1728. [libidn1_msg="libidn1"])
  1729. # -- texi2mdoc
  1730. AS_IF([test "x$texi2mdoc_generation" = x1],
  1731. [mdoc_msg="yes"],
  1732. [mdoc_msg="no"])
  1733. # -- texinfo
  1734. AS_IF([test "x$makeinfo" != "x1"],
  1735. [texinfo_msg="no"],
  1736. [texinfo_msg="yes"])
  1737. # -- conversation
  1738. AS_IF([test "x$conversation_backend" = "xnone"],
  1739. [AS_IF([test "x$pulse" != "x1"],
  1740. [AC_MSG_NOTICE([WARNING: libpulse(audio) not found, conversation will not be built.])
  1741. libpulse_msg="no"],
  1742. [libpulse_msg="yes"])
  1743. AS_IF([test "x$opus" != "x1"],
  1744. [AC_MSG_NOTICE([WARNING: libopus not found, conversation will not be built.])
  1745. libopus_msg="no"],
  1746. [libopus_msg="yes"])
  1747. AS_IF([test "x$gst" != "x1"],
  1748. [AC_MSG_NOTICE([WARNING: GStreamer not found, conversation will not be built.])
  1749. gstreamer_msg="no"],
  1750. [gstreamer_msg="yes"])],
  1751. [features_msg="$features_msg conversation"])
  1752. # -- interface
  1753. interface_msg=`echo $DEFAULT_INTERFACE | tr -d \"`
  1754. # -- libmicrohttpd
  1755. AS_IF([test "x$lmhd" != "x1"],
  1756. [libmicrohttpd_msg="no (optional)"],
  1757. [libmicrohttpd_msg="yes"])
  1758. # -- jansson
  1759. AS_IF([test "x$jansson" = "x0"],
  1760. [jansson_msg="no (optional)"],
  1761. [jansson_msg="yes"])
  1762. # -- libextractor
  1763. AS_IF([test "$extractor" != 1],
  1764. [AC_MSG_WARN([ERROR: libextractor not found, but various file-sharing functions require it])],
  1765. [libextractor_msg="yes"])
  1766. # -- libzbar
  1767. AS_IF([test "x$zbar" = "x1"],
  1768. [libzbar_msg="yes"
  1769. features_msg="$features_msg gnunet-qr"],
  1770. [AC_MSG_NOTICE([WARNING: zbar not found, gnunet-qr will not be built.])
  1771. libzbar_msg="no"])
  1772. # -- libgnurl
  1773. AS_IF([test "$gnurl" = "0"],
  1774. [AS_IF([test "x$curl" = "xfalse"],
  1775. [AC_MSG_NOTICE([WARNING: libgnurl not found. http client support will not be compiled.])
  1776. AC_MSG_WARN([ERROR: libgnurl not found. hostlist daemon will not be compiled, and you probably WANT the hostlist daemon])
  1777. curl_msg="no"],
  1778. [AC_MSG_NOTICE([WARNING: libgnurl not found, trying to use libcurl-gnutls instead.])
  1779. curl_msg="yes"])],
  1780. [gnurl_msg="yes"])
  1781. # -- ifconfig
  1782. AS_IF([test "$VAR_IFCONFIG_BINARY" = "false"],
  1783. [AC_MSG_NOTICE([WARNING: optional ifconfig not found])
  1784. ifconfig_msg="no (optional)"],
  1785. [ifconfig_msg="yes"])
  1786. # -- upnpc
  1787. AS_IF([test "$VAR_UPNPC_BINARY" = "false"],
  1788. [AC_MSG_NOTICE([WARNING: optional upnpc binary not found])
  1789. upnpc_msg="no (optional)"],
  1790. [upnpc_msg="yes"])
  1791. # -- iptables
  1792. AS_IF([test "$VAR_IPTABLES_BINARY" = "false"],
  1793. [AC_MSG_NOTICE([WARNING: optional iptables not found])
  1794. iptables_msg="no (optional)"],
  1795. [iptables_msg="yes"])
  1796. # -- bluetooth
  1797. AS_IF([test "x$bluetooth" = "x0"],
  1798. [AC_MSG_NOTICE([WARNING: optional bluetooth library not found.])
  1799. bluetooth_msg="no (optional)"],
  1800. [bluetooth_msg="yes"])
  1801. # -- gnutls
  1802. AS_IF([test x$gnutls != xtrue],
  1803. [AC_MSG_NOTICE([WARNING: GnuTLS not found, gnunet-gns-proxy will not be built])
  1804. gnutls_msg="no"],
  1805. [AS_IF([test "x$gnutls_dane" != "x1"],
  1806. [AC_MSG_NOTICE([WARNING: GnuTLS has no DANE support, DANE validation will not be possible])
  1807. gnutls_msg="yes (without DANE support)"],
  1808. [gnutls_msg="yes (with DANE support)"])])
  1809. # -- databases
  1810. # TODO: this always returns true, the check might
  1811. # TODO: not be working as intended (for msqlfail).
  1812. AS_IF([test x$mysqlfail = "true"]
  1813. [AC_MSG_NOTICE([WARNING: optional MySQL not found (or too old)])])
  1814. AS_IF([test "$mysql" = true],
  1815. [features_msg="$features_msg mysql"
  1816. mysql_msg="yes"],
  1817. [mysql_msg="no"])
  1818. AS_IF([test "$sqlite" = true],
  1819. [features_msg="$features_msg sqlite"
  1820. sqlite_msg="yes"],
  1821. [AC_MSG_ERROR([ERROR: sqlite3 not found, but sqlite3 is required.])
  1822. sqlite_msg="no"])
  1823. AS_IF([test "$postgres" = true],
  1824. [features_msg="$features_msg postgres"
  1825. postgres_msg="yes"],
  1826. [postgres_msg="no"])
  1827. # -- features
  1828. # ---- 1. replace spaces with newlines,
  1829. # ---- 2. sort the lines,
  1830. # ---- 3. replace the newlines with spaces.
  1831. features_msg=`echo $features_msg | tr ' ' '\012' | sort | tr '\012' ' '`
  1832. AC_SUBST(features_msg)
  1833. # The summary
  1834. # TODO: reduce the length of the last message block ("the message")
  1835. AC_MSG_NOTICE([
  1836. GNUnet Configuration
  1837. gnunet version: ${VERSION}
  1838. Host setup: ${host}
  1839. Install prefix: ${prefix}
  1840. Compiler: ${CC}
  1841. CFLAGS: ${CFLAGS}
  1842. CPPFLAGS: ${CPPFLAGS}
  1843. LDFLAGS: ${LDFLAGS}
  1844. LIBS: ${LIBS}
  1845. Build Target: $build_target
  1846. Mac OSX framework build: ${macosx_framework_msg}
  1847. Default Interface: ${interface_msg}
  1848. MySQL: ${mysql_msg}
  1849. PostgreSQL: ${postgres_msg}
  1850. sqlite3: ${sqlite_msg}
  1851. gnurl: ${gnurl_msg}
  1852. curl: ${curl_msg}
  1853. bluetooth: ${bluetooth_msg}
  1854. jansson: ${jansson_msg}
  1855. iptables: ${iptables_msg}
  1856. ifconfig: ${ifconfig_msg}
  1857. upnpc: ${upnpc_msg}
  1858. gnutls: ${gnutls_msg}
  1859. libzbar: ${libzbar_msg}
  1860. java: ${java_msg}
  1861. libmicrohttpd: ${libmicrohttpd_msg}
  1862. libidn: ${libidn1_msg}${libidn2_msg}
  1863. libopus: ${libopus_msg}
  1864. gstreamer: ${gstreamer_msg}
  1865. libpulse: ${libpulse_msg}
  1866. libextractor: ${libextractor_msg}
  1867. texinfo manual: ${texinfo_msg}
  1868. transpiled mdoc manual: ${mdoc_msg}
  1869. features: ${features_msg}
  1870. experimental: ${experimental_msg}
  1871. IMPORTANT:
  1872. Please make sure NOW that you have created a user and group 'gnunet'
  1873. and additionally a group 'gnunetdns'. On Debian and Ubuntu GNU/Linux,
  1874. type:
  1875. addgroup gnunetdns
  1876. adduser --system --group --disabled-login --home /var/lib/gnunet gnunet
  1877. Make sure that '/var/lib/gnunet' is owned (and writable) by user
  1878. 'gnunet'. Then, you can compile GNUnet with
  1879. make
  1880. After that, run (if necessary as 'root')
  1881. make install
  1882. to install everything.
  1883. Each GNUnet user should be added to the 'gnunet' group (may
  1884. require fresh login to come into effect):
  1885. adduser USERNAME gnunet
  1886. (run the above command as root once for each of your users, replacing
  1887. "USERNAME" with the respective login names). If you have a global IP
  1888. address, no further configuration is required.
  1889. For more detailed setup instructions, see https://docs.gnunet.org/
  1890. Optionally, download and compile gnunet-gtk to get a GUI for
  1891. file-sharing and configuration. This is particularly recommended
  1892. if your network setup is non-trivial, as gnunet-setup can be
  1893. used to test in the GUI if your network configuration is working.
  1894. gnunet-setup should be run as the "gnunet" user under X. As it
  1895. does very little with the network, running it as "root" is likely
  1896. also harmless. You can also run it as a normal user, but then
  1897. you have to copy ~/.gnunet/gnunet.conf" over to the "gnunet" user's
  1898. home directory in the end.
  1899. Once you have configured your peer, run (as the 'gnunet' user)
  1900. gnunet-arm -s
  1901. to start the peer. You can then run the various GNUnet-tools as
  1902. your "normal" user (who should only be in the group 'gnunet').
  1903. ])