configure.in 18 KB

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