configure.ac 71 KB

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