configure.ac 63 KB

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