2
0

configure.ac 60 KB

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