configure.ac 66 KB

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