configure.ng 19 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722
  1. #
  2. # ngIRCd -- The Next Generation IRC Daemon
  3. # Copyright (c)2001-2012 Alexander Barton (alex@barton.de) and Contributors
  4. #
  5. # This program is free software; you can redistribute it and/or modify
  6. # it under the terms of the GNU General Public License as published by
  7. # the Free Software Foundation; either version 2 of the License, or
  8. # (at your option) any later version.
  9. # Please read the file COPYING, README and AUTHORS for more information.
  10. #
  11. define(VERSION_ID,esyscmd([
  12. V=`git describe 2>/dev/null | sed -e 's/rel-//g' | sed -e 's/-/~/'`;
  13. [ -z "$V" -a -r configure ] \
  14. && V=`grep "PACKAGE_STRING=" configure | cut -d"'" -f2 | cut -d' ' -f2`
  15. ( [ -n "$V" ] && echo "$V" || echo "??" ) | tr -d '\n';
  16. ]))
  17. m4_ifdef([AM_SILENT_RULES],
  18. [m4_define([ng_color_tests], [color-tests])],
  19. [m4_define([ng_color_tests], [])])
  20. # -- Initialisation --
  21. AC_PREREQ([2.61])
  22. AC_INIT([ngIRCd], VERSION_ID,
  23. [ngircd-ml@ngircd.barton.de], [ngircd], [http://ngircd.barton.de/])
  24. AC_CONFIG_SRCDIR([src/ngircd/ngircd.c])
  25. AC_CONFIG_HEADER([src/config.h])
  26. AC_CANONICAL_HOST
  27. AM_INIT_AUTOMAKE([-Wall 1.10 ]ng_color_tests)
  28. m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])])
  29. # -- Templates for config.h --
  30. AH_TEMPLATE([DEBUG], [Define if debug-mode should be enabled])
  31. AH_TEMPLATE([HAVE_sockaddr_in_len], [Define if sockaddr_in.sin_len exists])
  32. AH_TEMPLATE([HAVE_socklen_t], [Define if socklen_t exists])
  33. AH_TEMPLATE([ICONV], [Define if libiconv can be used, e.g. for CHARCONV])
  34. AH_TEMPLATE([IDENTAUTH], [Define if the server should do IDENT requests])
  35. AH_TEMPLATE([IRCPLUS], [Define if IRC+ protocol should be used])
  36. AH_TEMPLATE([PAM], [Define if PAM should be used])
  37. AH_TEMPLATE([SNIFFER], [Define if IRC sniffer should be enabled])
  38. AH_TEMPLATE([STRICT_RFC], [Define if ngIRCd should behave strict RFC compliant])
  39. AH_TEMPLATE([SYSLOG], [Define if syslog should be used for logging])
  40. AH_TEMPLATE([TCPWRAP], [Define if TCP wrappers should be used])
  41. AH_TEMPLATE([WANT_IPV6], [Define if IPV6 protocol should be enabled])
  42. AH_TEMPLATE([ZLIB], [Define if zlib compression should be enabled])
  43. AH_TEMPLATE([HOST_OS], [Target operating system name])
  44. AH_TEMPLATE([HOST_VENDOR], [Target system vendor])
  45. AH_TEMPLATE([HOST_CPU], [Target CPU name])
  46. # -- C Compiler --
  47. AC_PROG_CC
  48. AC_PROG_CC_STDC
  49. # -- Helper programs --
  50. m4_ifdef([AM_PROG_AR], [AM_PROG_AR])
  51. AC_PROG_AWK
  52. AC_PROG_INSTALL
  53. AC_PROG_LN_S
  54. AC_PROG_MAKE_SET
  55. AC_PROG_RANLIB
  56. # -- Compiler Features --
  57. AC_C_CONST
  58. AC_C_INLINE
  59. __ng_PROTOTYPES__
  60. # -- Hard coded system and compiler dependencies/features/options ... --
  61. AC_DEFUN([GCC_STACK_PROTECT_CC],[
  62. ssp_cc=yes
  63. # we use -fstack-protector-all for the test to enfoce the use of the guard variable
  64. AC_MSG_CHECKING([whether ${CC} accepts -fstack-protector])
  65. ssp_old_cflags="$CFLAGS"
  66. CFLAGS="$CFLAGS -fstack-protector-all"
  67. AC_TRY_LINK(,,, ssp_cc=no)
  68. echo $ssp_cc
  69. CFLAGS="$ssp_old_cflags"
  70. if test "X$ssp_cc" = "Xyes"; then
  71. CFLAGS="$CFLAGS -fstack-protector"
  72. AC_DEFINE([ENABLE_SSP_CC], 1, [Define if SSP C support is enabled.])
  73. fi
  74. ])
  75. if test "$GCC" = "yes"; then
  76. # We are using the GNU C compiler. Good!
  77. CFLAGS="$CFLAGS -pipe -W -Wall -Wpointer-arith -Wstrict-prototypes"
  78. GCC_STACK_PROTECT_CC
  79. fi
  80. case "$host_os" in
  81. hpux*)
  82. # This is HP/UX, we need to define _XOPEN_SOURCE_EXTENDED
  83. # (tested with HP/UX 11.11)
  84. CFLAGS="$CFLAGS -D_XOPEN_SOURCE_EXTENDED"
  85. ;;
  86. esac
  87. # Add additional CFLAGS, eventually specified on the command line:
  88. test -n "$CFLAGS_ADD" && CFLAGS="$CFLAGS $CFLAGS_ADD"
  89. CFLAGS="$CFLAGS -DSYSCONFDIR='\"\$(sysconfdir)\"'"
  90. # -- Headers --
  91. AC_HEADER_STDC
  92. AC_HEADER_SYS_WAIT
  93. AC_HEADER_TIME
  94. # Required header files
  95. AC_CHECK_HEADERS([ \
  96. fcntl.h netdb.h netinet/in.h netinet/in_systm.h stdlib.h string.h \
  97. strings.h sys/socket.h sys/time.h unistd.h \
  98. ],,AC_MSG_ERROR([required C header missing!]))
  99. # Optional header files
  100. AC_CHECK_HEADERS_ONCE([ \
  101. arpa/inet.h inttypes.h malloc.h netinet/ip.h stdbool.h stddef.h \
  102. stdint.h varargs.h \
  103. ])
  104. # -- Datatypes --
  105. AC_MSG_CHECKING(whether socklen_t exists)
  106. AC_TRY_COMPILE([
  107. #include <sys/types.h>
  108. #include <sys/socket.h>
  109. ],[
  110. socklen_t a, b;
  111. a = 2; b = 4; a += b;
  112. ],[
  113. AC_DEFINE(HAVE_socklen_t) AC_MSG_RESULT(yes)
  114. ],[
  115. AC_MSG_RESULT(no)
  116. ])
  117. AC_TYPE_PID_T
  118. AC_TYPE_SIGNAL
  119. AC_TYPE_SIZE_T
  120. AC_TYPE_SSIZE_T
  121. AC_TYPE_UID_T
  122. AC_TYPE_UINT16_T
  123. AC_TYPE_UINT32_T
  124. AC_TYPE_UINT8_T
  125. AC_CHECK_MEMBER([struct sockaddr_in.sin_len], AC_DEFINE(HAVE_sockaddr_in_len),,
  126. [#include <arpa/inet.h>])
  127. # -- Libraries --
  128. # memmove: A/UX libUTIL
  129. AC_SEARCH_LIBS([memmove], [UTIL], [], [
  130. AC_MSG_ERROR([unable to find the memmove() function])
  131. ])
  132. # gethostbyname: Solaris libnsl
  133. AC_SEARCH_LIBS([gethostbyname], [bind nsl network], [], [
  134. AC_MSG_ERROR([unable to find the gethostbyname() function])
  135. ])
  136. # bind: SVR4 libsocket
  137. AC_SEARCH_LIBS([bind], [socket network], [], [
  138. AC_MSG_ERROR([unable to find the bind() function])
  139. ])
  140. # -- Functions --
  141. AC_FUNC_FORK
  142. AC_FUNC_STRFTIME
  143. # Required functions
  144. AC_CHECK_FUNCS([ \
  145. alarm dup2 endpwent gethostbyaddr gethostbyname gethostname \
  146. gettimeofday inet_ntoa memmove memset setsid socket strcasecmp \
  147. strchr strcspn strerror strncasecmp strrchr strspn strstr \
  148. ],,
  149. AC_MSG_ERROR([required function missing!]))
  150. # Optional functions
  151. AC_CHECK_FUNCS_ONCE([ \
  152. gai_strerror getaddrinfo getnameinfo inet_aton sigaction sigprocmask \
  153. snprintf vsnprintf strdup strlcpy strlcat strtok_r waitpid])
  154. # -- Configuration options --
  155. # use syslog?
  156. x_syslog_on=no
  157. AC_ARG_WITH(syslog,
  158. AS_HELP_STRING([--without-syslog],
  159. [disable syslog (autodetected by default)]),
  160. [ if test "$withval" != "no"; then
  161. if test "$withval" != "yes"; then
  162. CFLAGS="-I$withval/include $CFLAGS"
  163. CPPFLAGS="-I$withval/include $CPPFLAGS"
  164. LDFLAGS="-L$withval/lib $LDFLAGS"
  165. fi
  166. AC_SEARCH_LIBS([syslog], [be], [x_syslog_on=yes], [
  167. AC_MSG_ERROR([Can't enable syslog!])
  168. ])
  169. fi
  170. ],
  171. [ AC_SEARCH_LIBS([syslog], [be], [x_syslog_on=yes])
  172. ]
  173. )
  174. if test "$x_syslog_on" = "yes"; then
  175. AC_DEFINE(SYSLOG, 1)
  176. AC_CHECK_HEADERS(syslog.h,,AC_MSG_ERROR([required C header missing!]))
  177. fi
  178. # use zlib compression?
  179. x_zlib_on=no
  180. AC_ARG_WITH(zlib,
  181. AS_HELP_STRING([--without-zlib],
  182. [disable zlib compression (autodetected by default)]),
  183. [ if test "$withval" != "no"; then
  184. if test "$withval" != "yes"; then
  185. CFLAGS="-I$withval/include $CFLAGS"
  186. CPPFLAGS="-I$withval/include $CPPFLAGS"
  187. LDFLAGS="-L$withval/lib $LDFLAGS"
  188. fi
  189. AC_CHECK_LIB(z, deflate)
  190. AC_CHECK_FUNCS(deflate, x_zlib_on=yes,
  191. AC_MSG_ERROR([Can't enable zlib!])
  192. )
  193. fi
  194. ],
  195. [ AC_CHECK_LIB(z, deflate)
  196. AC_CHECK_FUNCS(deflate, x_zlib_on=yes)
  197. ]
  198. )
  199. if test "$x_zlib_on" = "yes"; then
  200. AC_DEFINE(ZLIB, 1)
  201. AC_CHECK_HEADERS(zlib.h,,AC_MSG_ERROR([required C header missing!]))
  202. fi
  203. # detect which IO API to use:
  204. x_io_backend=none
  205. AC_ARG_WITH(select,
  206. AS_HELP_STRING([--without-select],
  207. [disable select IO support (autodetected by default)]),
  208. [ if test "$withval" != "no"; then
  209. if test "$withval" != "yes"; then
  210. CFLAGS="-I$withval/include $CFLAGS"
  211. CPPFLAGS="-I$withval/include $CPPFLAGS"
  212. LDFLAGS="-L$withval/lib $LDFLAGS"
  213. fi
  214. AC_CHECK_FUNCS(select, x_io_select=yes,
  215. AC_MSG_ERROR([Can't enable select IO support!])
  216. )
  217. fi
  218. ],
  219. [
  220. AC_CHECK_FUNCS(select, x_io_select=yes)
  221. ]
  222. )
  223. AC_ARG_WITH(poll,
  224. AS_HELP_STRING([--without-poll],
  225. [disable poll support (autodetected by default)]),
  226. [ if test "$withval" != "no"; then
  227. if test "$withval" != "yes"; then
  228. CFLAGS="-I$withval/include $CFLAGS"
  229. CPPFLAGS="-I$withval/include $CPPFLAGS"
  230. LDFLAGS="-L$withval/lib $LDFLAGS"
  231. fi
  232. AC_CHECK_FUNCS(poll, [
  233. AC_CHECK_HEADERS(poll.h,
  234. x_io_backend=poll\(\),
  235. AC_MSG_ERROR(
  236. [Can't enable poll IO support!])
  237. )
  238. ], [
  239. AC_MSG_ERROR([Can't enable poll IO support!])
  240. ])
  241. fi
  242. ],
  243. [
  244. AC_CHECK_FUNCS(poll, [
  245. AC_CHECK_HEADERS(poll.h, x_io_backend=poll\(\))
  246. ])
  247. ]
  248. )
  249. AC_ARG_WITH(devpoll,
  250. AS_HELP_STRING([--without-devpoll],
  251. [disable /dev/poll IO support (autodetected by default)]),
  252. [ if test "$withval" != "no"; then
  253. if test "$withval" != "yes"; then
  254. CFLAGS="-I$withval/include $CFLAGS"
  255. CPPFLAGS="-I$withval/include $CPPFLAGS"
  256. LDFLAGS="-L$withval/lib $LDFLAGS"
  257. fi
  258. AC_CHECK_HEADERS(sys/devpoll.h,,AC_MSG_ERROR([required C header missing!]))
  259. fi
  260. ],
  261. [
  262. AC_CHECK_HEADERS(sys/devpoll.h, x_io_backend=/dev/poll)
  263. ]
  264. )
  265. AC_ARG_WITH(epoll,
  266. AS_HELP_STRING([--without-epoll],
  267. [disable epoll IO support (autodetected by default)]),
  268. [ if test "$withval" != "no"; then
  269. if test "$withval" != "yes"; then
  270. CFLAGS="-I$withval/include $CFLAGS"
  271. CPPFLAGS="-I$withval/include $CPPFLAGS"
  272. LDFLAGS="-L$withval/lib $LDFLAGS"
  273. fi
  274. AC_CHECK_FUNCS(epoll_create, x_io_epoll=yes,
  275. AC_MSG_ERROR([Can't enable epoll IO support!])
  276. )
  277. fi
  278. ],
  279. [
  280. AC_CHECK_FUNCS(epoll_create, x_io_epoll=yes)
  281. ]
  282. )
  283. AC_ARG_WITH(kqueue,
  284. AS_HELP_STRING([--without-kqueue],
  285. [disable kqueue IO support (autodetected by default)]),
  286. [ if test "$withval" != "no"; then
  287. if test "$withval" != "yes"; then
  288. CFLAGS="-I$withval/include $CFLAGS"
  289. CPPFLAGS="-I$withval/include $CPPFLAGS"
  290. LDFLAGS="-L$withval/lib $LDFLAGS"
  291. fi
  292. AC_CHECK_FUNCS(kqueue, x_io_backend=kqueue\(\),
  293. AC_MSG_ERROR([Can't enable kqueue IO support!])
  294. )
  295. fi
  296. ],
  297. [
  298. AC_CHECK_FUNCS(kqueue, x_io_backend=kqueue\(\))
  299. ]
  300. )
  301. if test "$x_io_epoll" = "yes" -a "$x_io_select" = "yes"; then
  302. # when epoll() and select() are available, we'll use both!
  303. x_io_backend="epoll(), select()"
  304. else
  305. if test "$x_io_epoll" = "yes"; then
  306. # we prefere epoll() if it is available
  307. x_io_backend="epoll()"
  308. else
  309. if test "$x_io_select" = "yes" -a "$x_io_backend" = "none"; then
  310. # we'll use select, when available and no "better"
  311. # interface has been detected ...
  312. x_io_backend="select()"
  313. fi
  314. fi
  315. fi
  316. if test "$x_io_backend" = "none"; then
  317. AC_MSG_ERROR([No useable IO API activated/found!?])
  318. fi
  319. # use SSL?
  320. AC_ARG_WITH(openssl,
  321. AS_HELP_STRING([--with-openssl],
  322. [enable SSL support using OpenSSL]),
  323. [ if test "$withval" != "no"; then
  324. if test "$withval" != "yes"; then
  325. CFLAGS="-I$withval/include $CFLAGS"
  326. CPPFLAGS="-I$withval/include $CPPFLAGS"
  327. LDFLAGS="-L$withval/lib $LDFLAGS"
  328. fi
  329. AC_CHECK_LIB(crypto, BIO_s_mem)
  330. AC_CHECK_LIB(ssl, SSL_library_init)
  331. AC_CHECK_FUNCS(SSL_library_init, x_ssl_openssl=yes,
  332. AC_MSG_ERROR([Can't enable openssl])
  333. )
  334. fi
  335. ]
  336. )
  337. AC_ARG_WITH(gnutls,
  338. AS_HELP_STRING([--with-gnutls],
  339. [enable SSL support using gnutls]),
  340. [ if test "$withval" != "no"; then
  341. if test "$withval" != "yes"; then
  342. CFLAGS="-I$withval/include $CFLAGS"
  343. CPPFLAGS="-I$withval/include $CPPFLAGS"
  344. LDFLAGS="-L$withval/lib $LDFLAGS"
  345. fi
  346. AC_CHECK_LIB(gnutls, gnutls_global_init)
  347. AC_CHECK_FUNCS(gnutls_global_init, x_ssl_gnutls=yes,
  348. AC_MSG_ERROR([Can't enable gnutls])
  349. )
  350. fi
  351. ]
  352. )
  353. x_ssl_lib="no"
  354. if test "$x_ssl_gnutls" = "yes"; then
  355. if test "$x_ssl_openssl" = "yes";then
  356. AC_MSG_ERROR([Cannot enable both gnutls and openssl])
  357. fi
  358. x_ssl_lib=gnutls
  359. fi
  360. if test "$x_ssl_openssl" = "yes"; then
  361. x_ssl_lib=openssl
  362. fi
  363. # use TCP wrappers?
  364. x_tcpwrap_on=no
  365. AC_ARG_WITH(tcp-wrappers,
  366. AS_HELP_STRING([--with-tcp-wrappers],
  367. [enable TCP wrappers support]),
  368. [ if test "$withval" != "no"; then
  369. if test "$withval" != "yes"; then
  370. CFLAGS="-I$withval/include $CFLAGS"
  371. CPPFLAGS="-I$withval/include $CPPFLAGS"
  372. LDFLAGS="-L$withval/lib $LDFLAGS"
  373. fi
  374. AC_MSG_CHECKING(for hosts_access)
  375. LIBS="-lwrap $LIBS"
  376. AC_TRY_LINK([
  377. #include <tcpd.h>
  378. int allow_severity = 0;
  379. int deny_severity = 0;
  380. ],[
  381. tcpd_warn("link test");
  382. ],[
  383. AC_MSG_RESULT(yes)
  384. AC_DEFINE(TCPWRAP, 1)
  385. x_tcpwrap_on=yes
  386. ],[
  387. AC_MSG_RESULT(no)
  388. AC_MSG_ERROR([Can't enable TCP wrappers!])
  389. ])
  390. fi
  391. ]
  392. )
  393. # do IDENT requests using libident?
  394. x_identauth_on=no
  395. AC_ARG_WITH(ident,
  396. AS_HELP_STRING([--with-ident],
  397. [enable "IDENT" ("AUTH") protocol support]),
  398. [ if test "$withval" != "no"; then
  399. if test "$withval" != "yes"; then
  400. CFLAGS="-I$withval/include $CFLAGS"
  401. CPPFLAGS="-I$withval/include $CPPFLAGS"
  402. LDFLAGS="-L$withval/lib $LDFLAGS"
  403. fi
  404. AC_CHECK_LIB(ident, ident_id)
  405. AC_CHECK_FUNCS(ident_id, x_identauth_on=yes,
  406. AC_MSG_ERROR([Can't enable IDENT support!])
  407. )
  408. fi
  409. ]
  410. )
  411. if test "$x_identauth_on" = "yes"; then
  412. AC_DEFINE(IDENTAUTH, 1)
  413. AC_CHECK_HEADERS(ident.h,,AC_MSG_ERROR([required C header missing!]))
  414. fi
  415. # compile in PAM support?
  416. x_pam_on=no
  417. AC_ARG_WITH(pam,
  418. AS_HELP_STRING([--with-pam],
  419. [enable user authentication using PAM]),
  420. [ if test "$withval" != "no"; then
  421. if test "$withval" != "yes"; then
  422. CFLAGS="-I$withval/include $CFLAGS"
  423. CPPFLAGS="-I$withval/include $CPPFLAGS"
  424. LDFLAGS="-L$withval/lib $LDFLAGS"
  425. fi
  426. AC_CHECK_LIB(pam, pam_authenticate)
  427. AC_CHECK_FUNCS(pam_authenticate, x_pam_on=yes,
  428. AC_MSG_ERROR([Can't enable PAM support!])
  429. )
  430. fi
  431. ]
  432. )
  433. if test "$x_pam_on" = "yes"; then
  434. AC_DEFINE(PAM, 1)
  435. AC_CHECK_HEADERS(security/pam_appl.h,pam_ok=yes)
  436. if test "$pam_ok" != "yes"; then
  437. AC_CHECK_HEADERS(pam/pam_appl.h,pam_ok=yes,
  438. AC_MSG_ERROR([required C header missing!]))
  439. fi
  440. fi
  441. # compile in IRC+ protocol support?
  442. x_ircplus_on=yes
  443. AC_ARG_ENABLE(ircplus,
  444. AS_HELP_STRING([--disable-ircplus],
  445. [disable IRC+ protocol]),
  446. if test "$enableval" = "no"; then x_ircplus_on=no; fi
  447. )
  448. if test "$x_ircplus_on" = "yes"; then
  449. AC_DEFINE(IRCPLUS, 1)
  450. # Compile in iconv support?
  451. # We only check for it when IRC+ is enabled, because the IRC+ command
  452. # CHARCONV is the only function depending on it.
  453. x_iconv_on=no
  454. AC_ARG_WITH(iconv,
  455. [ --with-iconv enable character conversation using libiconv],
  456. [ if test "$withval" != "no"; then
  457. if test "$withval" != "yes"; then
  458. CFLAGS="-I$withval/include $CFLAGS"
  459. CPPFLAGS="-I$withval/include $CPPFLAGS"
  460. LDFLAGS="-L$withval/lib $LDFLAGS"
  461. fi
  462. AC_CHECK_LIB(iconv, iconv_open)
  463. AC_CHECK_FUNCS(iconv_open, x_iconv_on=yes,
  464. AC_MSG_ERROR([Can't enable libiconv support!])
  465. )
  466. fi
  467. ]
  468. )
  469. if test "$x_iconv_on" = "yes"; then
  470. AC_DEFINE(ICONV, 1)
  471. fi
  472. fi
  473. # enable support for IPv6?
  474. x_ipv6_on=no
  475. AC_ARG_ENABLE(ipv6,
  476. AS_HELP_STRING([--enable-ipv6],
  477. [enable IPv6 protocol support]),
  478. if test "$enableval" = "yes"; then x_ipv6_on=yes; fi
  479. )
  480. if test "$x_ipv6_on" = "yes"; then
  481. # getaddrinfo() and getnameinfo() are optional when not compiling
  482. # with IPv6 support, but are required for IPv6 to work!
  483. AC_CHECK_FUNCS([ \
  484. getaddrinfo getnameinfo \
  485. ],,AC_MSG_ERROR([required function missing for IPv6 support!]))
  486. AC_DEFINE(WANT_IPV6, 1)
  487. fi
  488. # compile in IRC "sniffer"?
  489. x_sniffer_on=no; x_debug_on=no
  490. AC_ARG_ENABLE(sniffer,
  491. AS_HELP_STRING([--enable-sniffer],
  492. [enable IRC traffic sniffer (enables debug mode)]),
  493. if test "$enableval" = "yes"; then
  494. AC_DEFINE(SNIFFER, 1)
  495. x_sniffer_on=yes; x_debug_on=yes
  496. fi
  497. )
  498. # enable additional debugging code?
  499. AC_ARG_ENABLE(debug,
  500. AS_HELP_STRING([--enable-debug],
  501. [show additional debug output]),
  502. if test "$enableval" = "yes"; then x_debug_on=yes; fi
  503. )
  504. if test "$x_debug_on" = "yes"; then
  505. AC_DEFINE(DEBUG, 1)
  506. test "$GCC" = "yes" && CFLAGS="-pedantic $CFLAGS"
  507. AC_CHECK_FUNCS(mtrace)
  508. fi
  509. # enable "strict RFC rules"?
  510. x_strict_rfc_on=no
  511. AC_ARG_ENABLE(strict-rfc,
  512. AS_HELP_STRING([--enable-strict-rfc],
  513. [strict RFC conformance -- may break clients!]),
  514. if test "$enableval" = "yes"; then
  515. AC_DEFINE(STRICT_RFC, 1)
  516. x_strict_rfc_on=yes
  517. fi
  518. )
  519. # -- Definitions --
  520. AC_DEFINE_UNQUOTED(HOST_CPU, "$host_cpu" )
  521. AC_DEFINE_UNQUOTED(HOST_VENDOR, "$host_vendor" )
  522. AC_DEFINE_UNQUOTED(HOST_OS, "$host_os" )
  523. # Add additional CFLAGS, eventually specified on the command line, but after
  524. # running this configure script. Useful for "-Werror" for example.
  525. test -n "$CFLAGS_END" && CFLAGS="$CFLAGS $CFLAGS_END"
  526. # -- Generate files --
  527. AC_CONFIG_FILES([ \
  528. Makefile \
  529. contrib/Debian/Makefile \
  530. contrib/MacOSX/Makefile \
  531. contrib/MacOSX/ngIRCd.pmdoc/Makefile \
  532. contrib/MacOSX/ngIRCd.xcodeproj/Makefile \
  533. contrib/Makefile \
  534. doc/Makefile \
  535. doc/src/Makefile \
  536. man/Makefile \
  537. src/ipaddr/Makefile \
  538. src/Makefile \
  539. src/ngircd/Makefile \
  540. src/portab/Makefile \
  541. src/testsuite/Makefile \
  542. src/tool/Makefile \
  543. ])
  544. AC_OUTPUT
  545. type dpkg >/dev/null 2>&1
  546. if test $? -eq 0; then
  547. # Generate debian/ link if the dpkg command exists
  548. # (read: if we are running on a debian compatible system)
  549. echo "creating Debian-specific links ..."
  550. test -f debian/rules || ln -s contrib/Debian debian
  551. fi
  552. # -- Result --
  553. echo
  554. echo "ngIRCd $PACKAGE_VERSION has been configured with the following options:"
  555. echo
  556. # Someone please show me a better way :) [borrowed by OpenSSH]
  557. B=`eval echo ${bindir}` ; B=`eval echo ${B}`
  558. S=`eval echo ${sbindir}` ; S=`eval echo ${S}`
  559. C=`eval echo ${sysconfdir}` ; C=`eval echo ${C}`
  560. M=`eval echo ${mandir}` ; M=`eval echo ${M}`
  561. D=`eval echo ${docdir}` ; D=`eval echo ${D}`
  562. echo " Host: ${host}"
  563. echo " Compiler: ${CC}"
  564. test -n "$CFLAGS" && echo " Compiler flags: ${CFLAGS}"
  565. test -n "$CPPFLAGS" && echo " Preprocessor flags: ${CPPFLAGS}"
  566. test -n "$LDFLAGS" && echo " Linker flags: ${LDFLAGS}"
  567. test -n "$LIBS" && echo " Libraries: ${LIBS}"
  568. echo
  569. echo " 'ngircd' binary: $S"
  570. echo " Configuration file: $C"
  571. echo " Manual pages: $M"
  572. echo " Documentation: $D"
  573. echo
  574. echo $ECHO_N " Syslog support: $ECHO_C"
  575. test "$x_syslog_on" = "yes" \
  576. && echo $ECHO_N "yes $ECHO_C" \
  577. || echo $ECHO_N "no $ECHO_C"
  578. echo $ECHO_N " Enable debug code: $ECHO_C"
  579. test "$x_debug_on" = "yes" \
  580. && echo "yes" \
  581. || echo "no"
  582. echo $ECHO_N " zlib compression: $ECHO_C"
  583. test "$x_zlib_on" = "yes" \
  584. && echo $ECHO_N "yes $ECHO_C" \
  585. || echo $ECHO_N "no $ECHO_C"
  586. echo $ECHO_N " IRC sniffer: $ECHO_C"
  587. test "$x_sniffer_on" = "yes" \
  588. && echo "yes" \
  589. || echo "no"
  590. echo $ECHO_N " Use TCP Wrappers: $ECHO_C"
  591. test "$x_tcpwrap_on" = "yes" \
  592. && echo $ECHO_N "yes $ECHO_C" \
  593. || echo $ECHO_N "no $ECHO_C"
  594. echo $ECHO_N " Strict RFC mode: $ECHO_C"
  595. test "$x_strict_rfc_on" = "yes" \
  596. && echo "yes" \
  597. || echo "no"
  598. echo $ECHO_N " IDENT support: $ECHO_C"
  599. test "$x_identauth_on" = "yes" \
  600. && echo $ECHO_N "yes $ECHO_C" \
  601. || echo $ECHO_N "no $ECHO_C"
  602. echo $ECHO_N " IRC+ protocol: $ECHO_C"
  603. test "$x_ircplus_on" = "yes" \
  604. && echo "yes" \
  605. || echo "no"
  606. echo $ECHO_N " IPv6 protocol: $ECHO_C"
  607. test "$x_ipv6_on" = "yes" \
  608. && echo $ECHO_N "yes $ECHO_C" \
  609. || echo $ECHO_N "no $ECHO_C"
  610. echo $ECHO_N " I/O backend: $ECHO_C"
  611. echo "\"$x_io_backend\""
  612. echo $ECHO_N " PAM support: $ECHO_C"
  613. test "$x_pam_on" = "yes" \
  614. && echo $ECHO_N "yes $ECHO_C" \
  615. || echo $ECHO_N "no $ECHO_C"
  616. echo $ECHO_N " SSL support: $ECHO_C"
  617. echo "$x_ssl_lib"
  618. echo $ECHO_N " libiconv support: $ECHO_C"
  619. echo "$x_iconv_on"
  620. echo
  621. if ! grep "^AUTOMAKE_OPTIONS = ../portab/ansi2knr" src/ngircd/Makefile.am >/dev/null 2>&1; then
  622. echo "WARNING:"
  623. echo "This GNU automake generated build system does not support \"de-ANSI-fication\","
  624. echo "therefore don't use it to generate \"official\" distribution archives!"
  625. echo "(Most probably you want to use GNU automake 1.11.x for this purpose ...)"
  626. echo
  627. fi
  628. # -eof-