configure.ac 67 KB

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