lighttpd 1.4.x https://www.lighttpd.net/
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

1781 lines
46 KiB

  1. dnl -*- Autoconf -*-
  2. dnl Process this file with autoconf to produce a configure script.
  3. dnl
  4. dnl Indentation rules:
  5. dnl - closing braces not at the beginning of a line must match opening
  6. dnl braces earlier on that line
  7. dnl - closing braces at the beginning of a line:
  8. dnl - must not be followed by anything else apart from "," or comments
  9. dnl - must match opening braces from another line and indented the
  10. dnl same as that other line
  11. dnl - if one argument was put on a new line, all following arguments
  12. dnl must be on their own line too
  13. dnl - if an argument uses more than one line and is not a single
  14. dnl function call, the argument should be on different lines than the
  15. dnl wrapping braces
  16. AC_PREREQ(2.60)
  17. AC_INIT([lighttpd], [1.4.56], [https://redmine.lighttpd.net/projects/lighttpd/boards/2], [lighttpd], [https://www.lighttpd.net/])
  18. AC_CONFIG_SRCDIR([src/server.c])
  19. AC_CONFIG_HEADER([config.h])
  20. AC_CONFIG_MACRO_DIR([m4])
  21. AC_CANONICAL_HOST
  22. AM_INIT_AUTOMAKE([1.13 -Wall -Wno-portability -Wno-override foreign dist-xz tar-ustar serial-tests silent-rules subdir-objects])
  23. dnl @synopsis TRY_CFLAGS [compiler flags]
  24. dnl @summary check whether compiler supports given flags and adds them to CFLAGS
  25. AC_DEFUN([TRY_CFLAGS],
  26. [dnl
  27. AC_MSG_CHECKING([if $CC supports $1])
  28. AC_LANG_PUSH([C])
  29. ac_try_cflags_saved_cflags="${CFLAGS}"
  30. CFLAGS="${CFLAGS} $1"
  31. AC_COMPILE_IFELSE([AC_LANG_PROGRAM([])],
  32. [AC_MSG_RESULT([yes])],
  33. [
  34. AC_MSG_ERROR([no])
  35. CFLAGS="${ac_try_cflags_saved_cflags}"
  36. ]
  37. )
  38. AC_LANG_POP([C])
  39. ])
  40. dnl @synopsis TRY_LDFLAGS [linker flags]
  41. dnl @summary check whether linker supports given flags and adds them to LDFLAGS
  42. AC_DEFUN([TRY_LDFLAGS],
  43. [dnl
  44. AC_MSG_CHECKING([if $LD supports $1])
  45. AC_LANG_PUSH([C])
  46. ac_try_ldflags_saved_ldflags="${LDFLAGS}"
  47. LDFLAGS="${LDFLAGS} $1"
  48. AC_LINK_IFELSE([AC_LANG_PROGRAM([])],
  49. [AC_MSG_RESULT([yes])],
  50. [
  51. AC_MSG_ERROR([no])
  52. LDFLAGS="${ac_try_ldflags_saved_cflags}"
  53. ]
  54. )
  55. AC_LANG_POP([C])
  56. ])
  57. dnl Checks for programs.
  58. AC_PROG_CC
  59. AC_PROG_CC_STDC
  60. AX_PROG_CC_FOR_BUILD
  61. AC_PROG_LD
  62. AC_PROG_INSTALL
  63. AC_PROG_CPP
  64. AC_PROG_MAKE_SET
  65. AC_USE_SYSTEM_EXTENSIONS
  66. AM_PROG_AR
  67. dnl AC_CANONICAL_HOST
  68. case "$host_os" in
  69. *darwin*|*cygwin*|*aix*|*mingw*|*midipix* ) NO_RDYNAMIC=yes ;;
  70. * ) NO_RDYNAMIC=no ;;
  71. esac
  72. AM_CONDITIONAL([NO_RDYNAMIC], [test "$NO_RDYNAMIC" = yes])
  73. AM_CONDITIONAL([LIGHTTPD_STATIC], [test "$LIGHTTPD_STATIC" = yes])
  74. AC_EXEEXT
  75. dnl libtool
  76. AC_DISABLE_STATIC
  77. AC_ENABLE_SHARED
  78. AC_LIBTOOL_DLOPEN
  79. AC_PROG_LIBTOOL
  80. dnl for solaris
  81. CPPFLAGS="${CPPFLAGS} -D_REENTRANT"
  82. dnl Checks for header files.
  83. dnl check for:
  84. dnl inttypes.h => HAVE_INTTYPES_H
  85. dnl stdint.h => HAVE_STDINT_H
  86. dnl and maybe more (which shouldn't be relied on)
  87. AC_HEADER_STDC
  88. dnl checks for sys/wait.h => HAVE_SYS_WAIT_H
  89. AC_HEADER_SYS_WAIT
  90. AC_CHECK_HEADERS([\
  91. getopt.h \
  92. poll.h \
  93. port.h \
  94. pwd.h \
  95. stdlib.h \
  96. strings.h \
  97. sys/devpoll.h \
  98. sys/epoll.h \
  99. sys/event.h \
  100. sys/filio.h \
  101. sys/loadavg.h \
  102. sys/mman.h \
  103. sys/poll.h \
  104. sys/prctl.h \
  105. sys/resource.h \
  106. sys/select.h \
  107. sys/sendfile.h \
  108. sys/time.h \
  109. sys/uio.h \
  110. sys/un.h \
  111. syslog.h \
  112. uuid/uuid.h \
  113. ])
  114. dnl Checks for typedefs, structures, and compiler characteristics.
  115. AC_C_CONST
  116. AC_C_INLINE
  117. AC_TYPE_OFF_T
  118. AC_TYPE_PID_T
  119. AC_TYPE_SIZE_T
  120. AC_CHECK_MEMBER([struct tm.tm_gmtoff],
  121. [AC_DEFINE([HAVE_STRUCT_TM_GMTOFF], [1], [gmtoff in struct tm])],
  122. [],
  123. [#include <time.h>]
  124. )
  125. AC_CHECK_TYPES([socklen_t],
  126. [], dnl defines HAVE_SOCKLEN_T
  127. [],
  128. [
  129. #include <sys/types.h>
  130. #include <sys/socket.h>
  131. ]
  132. )
  133. dnl openssl on solaris needs -lsocket -lnsl
  134. AC_SEARCH_LIBS([socket], [socket])
  135. AC_SEARCH_LIBS([gethostbyname], [nsl socket])
  136. dnl On Haiku accept() and friends are in libnetwork
  137. AC_SEARCH_LIBS([accept], [network])
  138. dnl clock_gettime() needs -lrt with glibc < 2.17, and possibly other platforms
  139. AC_SEARCH_LIBS([clock_gettime], [rt])
  140. dnl FreeBSD elftc_copyfile()
  141. save_LIBS=$LIBS
  142. LIBS=
  143. AC_SEARCH_LIBS([elftc_copyfile], [elftc], [
  144. AC_CHECK_HEADERS([libelftc.h], [
  145. ELFTC_LIB=$LIBS
  146. AC_DEFINE([HAVE_LIBELFTC], [1], [libelftc])
  147. AC_DEFINE([HAVE_ELFTC_COPYFILE], [1], [elftc_copyfile])
  148. ])
  149. ])
  150. LIBS=$save_LIBS
  151. AC_SUBST([ELFTC_LIB])
  152. dnl need dlopen/-ldl to load plugins (when not on windows)
  153. save_LIBS=$LIBS
  154. LIBS=
  155. AC_SEARCH_LIBS([dlopen], [dl], [
  156. AC_CHECK_HEADERS([dlfcn.h], [
  157. DL_LIB=$LIBS
  158. AC_DEFINE([HAVE_LIBDL], [1], [libdl])
  159. AC_DEFINE([HAVE_DLFCN_H], [1])
  160. ])
  161. ])
  162. LIBS=$save_LIBS
  163. AC_SUBST([DL_LIB])
  164. dnl prepare pkg-config usage below
  165. PKG_PROG_PKG_CONFIG
  166. dnl checking for libev
  167. AC_MSG_NOTICE([----------------------------------------])
  168. AC_MSG_CHECKING([for libev support])
  169. AC_ARG_WITH([libev],
  170. [AC_HELP_STRING([--with-libev@<:@=PATH@:>@],
  171. [Include libev support for fdevent handlers in PATH/include and PATH/lib]
  172. )],
  173. [WITH_LIBEV=$withval],
  174. [WITH_LIBEV=no]
  175. )
  176. AC_MSG_RESULT([$WITH_LIBEV])
  177. LIBEV_CFLAGS=
  178. LIBEV_LIBS=
  179. if test "$WITH_LIBEV" != no; then
  180. PKG_CHECK_MODULES([LIBEV], [libev], [], [
  181. dnl no pkg-config for libev, searching manually:
  182. if test "$WITH_LIBEV" != yes; then
  183. LIBEV_CFLAGS="-I$WITH_LIBEV/include"
  184. LIBEV_LIBS="-L$WITH_LIBEV/lib -lev"
  185. else
  186. AC_CHECK_HEADERS([ev.h],
  187. [AC_CHECK_LIB([ev], [ev_time],
  188. [
  189. LIBEV_CFLAGS=
  190. LIBEV_LIBS="-lev"
  191. ],
  192. [AC_MSG_ERROR([libev not found])]
  193. )],
  194. [AC_MSG_ERROR([libev header not found])]
  195. )
  196. fi
  197. ])
  198. AC_DEFINE([HAVE_LIBEV], [1], [libev support])
  199. fi
  200. AC_SUBST([LIBEV_CFLAGS])
  201. AC_SUBST([LIBEV_LIBS])
  202. dnl Checks for mysql
  203. AC_MSG_NOTICE([----------------------------------------])
  204. AC_MSG_CHECKING([for MySQL support])
  205. AC_ARG_WITH([mysql],
  206. [AC_HELP_STRING([--with-mysql@<:@=PATH@:>@],
  207. [Include MySQL support. PATH is the path to 'mysql_config']
  208. )],
  209. [WITH_MYSQL=$withval],
  210. [WITH_MYSQL=no]
  211. )
  212. AC_MSG_RESULT([$WITH_MYSQL])
  213. MYSQL_CFLAGS=
  214. MYSQL_LIBS=
  215. if test "$WITH_MYSQL" != no; then
  216. if test "$WITH_MYSQL" = yes; then
  217. PKG_CHECK_MODULES([MYSQL],[mariadb],[
  218. MYSQL_CONFIG=$PKG_CONFIG
  219. ],[
  220. PKG_CHECK_MODULES([MYSQL],[mysqlclient],[
  221. MYSQL_CONFIG=$PKG_CONFIG
  222. ],[
  223. AC_PATH_PROG([MYSQL_CONFIG], [mysql_config])
  224. ])
  225. ])
  226. else
  227. MYSQL_CONFIG=$WITH_MYSQL
  228. fi
  229. if test "$MYSQL_CONFIG" != "$PKG_CONFIG"; then
  230. if test -z "$MYSQL_CONFIG"; then
  231. AC_MSG_ERROR([mysql_config is not found])
  232. fi
  233. if test ! -x "$MYSQL_CONFIG"; then
  234. AC_MSG_ERROR([mysql_config not exists or not executable, use --with-mysql=path-to-mysql_config])
  235. fi
  236. if "$MYSQL_CONFIG" | grep -- '--include' > /dev/null ; then
  237. MYSQL_CFLAGS=`"$MYSQL_CONFIG" --include | sed s/\'//g`
  238. else
  239. MYSQL_CFLAGS=`"$MYSQL_CONFIG" --cflags | sed s/\'//g`
  240. fi
  241. MYSQL_LIBS=`"$MYSQL_CONFIG" --libs | sed s/\'//g`
  242. fi
  243. AC_MSG_CHECKING([for MySQL includes at])
  244. AC_MSG_RESULT([$MYSQL_CFLAGS])
  245. AC_MSG_CHECKING([for MySQL libraries at])
  246. AC_MSG_RESULT([$MYSQL_LIBS])
  247. AC_DEFINE([HAVE_MYSQL], [1], [mysql support])
  248. fi
  249. AM_CONDITIONAL([BUILD_WITH_MYSQL], [test "$WITH_MYSQL" != no])
  250. AC_SUBST([MYSQL_LIBS])
  251. AC_SUBST([MYSQL_CFLAGS])
  252. dnl Checks for pgsql
  253. AC_MSG_NOTICE([----------------------------------------])
  254. AC_MSG_CHECKING([for PgSQL support])
  255. AC_ARG_WITH([pgsql],
  256. [AC_HELP_STRING([--with-pgsql@<:@=PATH@:>@],
  257. [Include PgSQL support. PATH is the path to 'pg_config']
  258. )],
  259. [WITH_PGSQL=$withval],
  260. [WITH_PGSQL=no]
  261. )
  262. AC_MSG_RESULT([$WITH_PGSQL])
  263. PGSQL_CFLAGS=
  264. PGSQL_LIBS=
  265. if test "$WITH_PGSQL" != no; then
  266. if test "$WITH_PGSQL" = yes; then
  267. PKG_CHECK_MODULES([PGSQL],[libpq],[
  268. PGSQL_CONFIG=$PKG_CONFIG
  269. ],[
  270. AC_PATH_PROG([PGSQL_CONFIG], [pg_config])
  271. ])
  272. else
  273. PGSQL_CONFIG=$WITH_PGSQL
  274. fi
  275. if test "$PGSQL_CONFIG" != "$PKG_CONFIG"; then
  276. if test -z "$PGSQL_CONFIG"; then
  277. AC_MSG_ERROR([pg_config is not found])
  278. fi
  279. if test ! -x "$PGSQL_CONFIG"; then
  280. AC_MSG_ERROR([pg_config not exists or not executable, use --with-pgsql=path-to-pg_config])
  281. fi
  282. PGSQL_CFLAGS="-I`"$PGSQL_CONFIG" --includedir`"
  283. PGSQL_LIBS="-L`"$PGSQL_CONFIG" --libdir` -lpq"
  284. fi
  285. AC_MSG_CHECKING([for PgSQL includes at])
  286. AC_MSG_RESULT([$PGSQL_CFLAGS])
  287. AC_MSG_CHECKING([for PgSQL libraries at])
  288. AC_MSG_RESULT([$PGSQL_LIBS])
  289. AC_DEFINE([HAVE_PGSQL], [1], [pgsql support])
  290. fi
  291. AM_CONDITIONAL([BUILD_WITH_PGSQL], [test "$WITH_PGSQL" != no])
  292. AC_SUBST([PGSQL_LIBS])
  293. AC_SUBST([PGSQL_CFLAGS])
  294. dnl Checks for libdbi library
  295. AC_MSG_NOTICE([----------------------------------------])
  296. AC_MSG_CHECKING([for LibDBI support])
  297. AC_ARG_WITH([dbi],
  298. [AC_HELP_STRING([--with-dbi@<:@=PATH@:>@],
  299. [Include DBI support in PATH/include/dbi.h and PATH/lib]
  300. )],
  301. [WITH_DBI=$withval],
  302. [WITH_DBI=no]
  303. )
  304. AC_MSG_RESULT([$WITH_DBI])
  305. DBI_INCLUDE=
  306. DBI_LIBS=
  307. if test "$WITH_DBI" != no; then
  308. if test "$WITH_DBI" != yes; then
  309. DBI_CFLAGS="-I$WITH_DBI/include"
  310. DBI_LIBS="-L$WITH_DBI/lib -ldbi"
  311. else
  312. AC_CHECK_HEADERS([dbi/dbi.h],
  313. [AC_CHECK_LIB([dbi], [dbi_version],
  314. [
  315. DBI_CFLAGS=
  316. DBI_LIBS="-ldbi"
  317. ],
  318. [AC_MSG_ERROR([LibDBI not found])]
  319. )],
  320. [AC_MSG_ERROR([LibDBI header not found])]
  321. )
  322. fi
  323. AC_DEFINE([HAVE_DBI], [1], [LibDBI support])
  324. fi
  325. AM_CONDITIONAL([BUILD_WITH_DBI], [test "$WITH_DBI" != no])
  326. AC_SUBST([DBI_LIBS])
  327. AC_SUBST([DBI_CFLAGS])
  328. dnl Checks for libsasl2 library
  329. AC_MSG_NOTICE([----------------------------------------])
  330. AC_MSG_CHECKING([for LibSASL support])
  331. AC_ARG_WITH([sasl],
  332. [AC_HELP_STRING([--with-sasl@<:@=PATH@:>@],
  333. [Include SASL support in PATH/include/sasl/sasl.h and PATH/lib]
  334. )],
  335. [WITH_SASL=$withval],
  336. [WITH_SASL=no]
  337. )
  338. AC_MSG_RESULT([$WITH_SASL])
  339. SASL_INCLUDE=
  340. SASL_LIBS=
  341. if test "$WITH_SASL" != no; then
  342. if test "$WITH_SASL" != yes; then
  343. SASL_CFLAGS="-I$WITH_SASL/include"
  344. SASL_LIBS="-L$WITH_SASL/lib -lsasl2"
  345. else
  346. AC_CHECK_HEADERS([sasl/sasl.h],
  347. [AC_CHECK_LIB([sasl2], [sasl_server_init],
  348. [
  349. SASL_CFLAGS=
  350. SASL_LIBS="-lsasl2"
  351. ],
  352. [AC_MSG_ERROR([libsasl2 not found])]
  353. )],
  354. [AC_MSG_ERROR([SASL header not found])]
  355. )
  356. fi
  357. AC_DEFINE([HAVE_SASL], [1], [LibSASL support])
  358. fi
  359. AM_CONDITIONAL([BUILD_WITH_SASL], [test "$WITH_SASL" != no])
  360. AC_SUBST([SASL_LIBS])
  361. AC_SUBST([SASL_CFLAGS])
  362. dnl Check for LDAP
  363. AC_MSG_NOTICE([----------------------------------------])
  364. AC_MSG_CHECKING([for LDAP support])
  365. AC_ARG_WITH([ldap],
  366. [AC_HELP_STRING([--with-ldap], [enable LDAP support])],
  367. [WITH_LDAP=$withval],
  368. [WITH_LDAP=no]
  369. )
  370. AC_MSG_RESULT([$WITH_LDAP])
  371. if test "$WITH_LDAP" != no; then
  372. AC_CHECK_LIB([ldap], [ldap_sasl_bind_s],
  373. [AC_CHECK_HEADERS([ldap.h],
  374. [
  375. LDAP_LIB=-lldap
  376. AC_DEFINE([HAVE_LIBLDAP], [1], [libldap])
  377. AC_DEFINE([HAVE_LDAP_H], [1])
  378. ],
  379. [AC_MSG_ERROR([ldap headers not found, install them or build without --with-ldap])]
  380. )],
  381. [AC_MSG_ERROR([ldap library not found, install it or build without --with-ldap])]
  382. )
  383. AC_SUBST([LDAP_LIB])
  384. AC_CHECK_LIB([lber], [ber_printf],
  385. [AC_CHECK_HEADERS([lber.h],
  386. [
  387. LBER_LIB=-llber
  388. AC_DEFINE([HAVE_LIBLBER], [1], [liblber])
  389. AC_DEFINE([HAVE_LBER_H], [1])
  390. ],
  391. [AC_MSG_ERROR([lber headers not found, install them or build without --with-ldap])]
  392. )],
  393. [AC_MSG_ERROR([lber library not found, install it or build without --with-ldap])]
  394. )
  395. AC_SUBST([LBER_LIB])
  396. fi
  397. AM_CONDITIONAL([BUILD_WITH_LDAP], [test "$WITH_LDAP" != no])
  398. dnl Check for PAM
  399. AC_MSG_NOTICE([----------------------------------------])
  400. AC_MSG_CHECKING(for PAM support)
  401. AC_ARG_WITH([pam],
  402. [AC_HELP_STRING([--with-pam],[enable PAM support])],
  403. [WITH_PAM=$withval],
  404. [WITH_PAM=no]
  405. )
  406. AC_MSG_RESULT([$withval])
  407. if test "$WITH_PAM" != "no"; then
  408. AC_CHECK_LIB([pam], [pam_start],
  409. [AC_CHECK_HEADERS([security/pam_appl.h],[
  410. PAM_LIB=-lpam
  411. AC_DEFINE([HAVE_PAM], [1], [libpam])
  412. AC_DEFINE([HAVE_SECURITY_PAM_APPL_H], [1])
  413. ],
  414. [AC_MSG_ERROR([pam headers not found, install them or build without --with-pam])]
  415. )],
  416. [AC_MSG_ERROR([pam library not found, install it or build without --with-pam])]
  417. )
  418. AC_SUBST(PAM_LIB)
  419. fi
  420. AM_CONDITIONAL([BUILD_WITH_PAM], [test "$WITH_PAM" != no])
  421. dnl Check for xattr
  422. AC_MSG_NOTICE([----------------------------------------])
  423. AC_MSG_CHECKING([for extended attributes support])
  424. AC_ARG_WITH([attr],
  425. [AC_HELP_STRING([--with-attr], [enable extended attribute support])],
  426. [WITH_ATTR=$withval],
  427. [WITH_ATTR=no]
  428. )
  429. AC_MSG_RESULT([$WITH_ATTR])
  430. if test "$WITH_ATTR" != no; then
  431. have_xattr=no
  432. # libattr (linux only?)
  433. AC_CHECK_LIB([attr], [attr_get], [
  434. AC_CHECK_HEADERS([attr/attributes.h], [
  435. ATTR_LIB=-lattr
  436. AC_DEFINE([HAVE_XATTR], [1], [libattr])
  437. AC_DEFINE([HAVE_ATTR_ATTRIBUTES_H], [1])
  438. have_xattr=yes
  439. ])
  440. ])
  441. AC_SUBST([ATTR_LIB])
  442. # Linux getxattr
  443. AC_CHECK_FUNC([getxattr], [
  444. AC_CHECK_HEADERS([sys/xattr.h], [
  445. AC_DEFINE([HAVE_XATTR], [1], [Linux extended attributes])
  446. AC_DEFINE([HAVE_SYS_XATTR_H], [1])
  447. have_xattr=yes
  448. ])
  449. ])
  450. # (Free)BSD extattr
  451. AC_CHECK_FUNC([extattr_get_file], [
  452. AC_CHECK_HEADERS([sys/extattr.h], [
  453. AC_DEFINE([HAVE_EXTATTR], [1], [BSD extended attributes])
  454. AC_DEFINE([HAVE_SYS_EXTATTR_H], [1])
  455. have_xattr=yes
  456. ])
  457. ])
  458. if test "$have_xattr" = no; then
  459. AC_MSG_ERROR([no backend found implementing extended attributes])
  460. fi
  461. fi
  462. dnl Check for valgrind
  463. AC_MSG_NOTICE([----------------------------------------])
  464. AC_MSG_CHECKING([for valgrind])
  465. AC_ARG_WITH([valgrind],
  466. [AC_HELP_STRING([--with-valgrind],
  467. [enable internal support for valgrind]
  468. )],
  469. [WITH_VALGRIND=$withval],
  470. [WITH_VALGRIND=no]
  471. )
  472. AC_MSG_RESULT([$WITH_VALGRIND])
  473. if test "$WITH_VALGRIND" != no; then
  474. AC_CHECK_HEADERS([valgrind/valgrind.h], [], [
  475. AC_MSG_ERROR([valgrind headers not found. install them or build without --with-valgrind])
  476. ])
  477. fi
  478. dnl Checking for libunwind
  479. AC_MSG_NOTICE([----------------------------------------])
  480. AC_MSG_CHECKING([for libunwind])
  481. AC_ARG_WITH([libunwind],
  482. [AC_HELP_STRING([--with-libunwind],
  483. [Include libunwind support for backtraces on assert failures]
  484. )],
  485. [WITH_LIBUNWIND=$withval],
  486. [WITH_LIBUNWIND=no]
  487. )
  488. AC_MSG_RESULT([$WITH_LIBUNWIND])
  489. if test "$WITH_LIBUNWIND" != no; then
  490. PKG_CHECK_MODULES([LIBUNWIND], [libunwind], [], [
  491. AC_MSG_ERROR([libunwind not found. install it or build without --with-libunwind])
  492. ])
  493. AC_DEFINE([HAVE_LIBUNWIND], [1], [Have libunwind support])
  494. fi
  495. dnl Checking for kerberos5
  496. AC_MSG_NOTICE([----------------------------------------])
  497. AC_MSG_CHECKING([for kerberos5])
  498. AC_ARG_WITH([krb5],
  499. [AC_HELP_STRING([--with-krb5@<:@=DIR@:>@], [Use Kerberos 5])],
  500. [WITH_KRB5=$withval],
  501. [WITH_KRB5=no]
  502. )
  503. AC_MSG_RESULT([$WITH_KRB5])
  504. if test "$WITH_KRB5" != no; then
  505. if test "$WITH_KRB5" != yes; then
  506. krb5_append_CPPFLAGS=" -I$WITH_KRB5/include"
  507. krb5_append_LDFLAGS=" -L$WITH_KRB5/lib"
  508. fi
  509. fi
  510. AC_MSG_CHECKING([custom include directory for kerberos5])
  511. AC_ARG_WITH([krb5-includes],
  512. [AC_HELP_STRING([--with-krb5-includes=DIR], [Kerberos includes])],
  513. [
  514. if test "$WITH_KRB5" = no; then
  515. AC_MSG_ERROR([build --with-krb5 to use --with-krb5-includes])
  516. fi
  517. krb5_append_CPPFLAGS=" -I$withval"
  518. AC_MSG_RESULT([$withval])
  519. ],
  520. [AC_MSG_RESULT([no])]
  521. )
  522. AC_MSG_CHECKING([custom lib directory for kerberos5])
  523. AC_ARG_WITH([krb5-libs],
  524. [AC_HELP_STRING([--with-krb5-libs=DIR], [Kerberos libraries])],
  525. [
  526. if test "$WITH_KRB5" = no; then
  527. AC_MSG_ERROR([build --with-krb5 to use --with-krb5-libs])
  528. fi
  529. krb5_append_LDFLAGS=" -L$withval"
  530. AC_MSG_RESULT([$withval])
  531. ],
  532. [AC_MSG_RESULT([no])]
  533. )
  534. if test "$WITH_KRB5" != no; then
  535. CPPFLAGS="${CPPFLAGS}${krb5_append_CPPFLAGS}"
  536. LDFLAGS="${LDFLAGS}${krb5_append_LDFLAGS}"
  537. AC_CHECK_LIB([gssapi_krb5], [gss_acquire_cred],
  538. [AC_CHECK_HEADERS([gssapi/gssapi_krb5.h],
  539. [
  540. KRB5_LIB="-lkrb5 -lgssapi_krb5"
  541. AC_DEFINE([HAVE_KRB5], [1], [libgssapi_krb5])
  542. ],
  543. [AC_MSG_ERROR([gssapi_krb5 headers were not found, install them or build without --with-krb5])]
  544. )],
  545. [AC_MSG_ERROR([gssapi_krb5 libs were not found, install them or build without --with-krb5])]
  546. )
  547. case "$host_os" in
  548. *darwin*|*cygwin* ) KRB5_LIB="$KRB5_LIB -lcom_err" ;;
  549. * ) ;;
  550. esac
  551. fi
  552. AM_CONDITIONAL([BUILD_WITH_KRB5], [test "$WITH_KRB5" != no])
  553. AC_SUBST([KRB5_LIB])
  554. dnl Check for openssl
  555. AC_MSG_NOTICE([----------------------------------------])
  556. AC_MSG_CHECKING([for OpenSSL])
  557. AC_ARG_WITH([openssl],
  558. [AC_HELP_STRING([--with-openssl@<:@=DIR@:>@],
  559. [Include openssl support (default no)]
  560. )],
  561. [WITH_OPENSSL=$withval],
  562. [WITH_OPENSSL=no]
  563. )
  564. AC_MSG_RESULT([$WITH_OPENSSL])
  565. AM_CONDITIONAL([BUILD_WITH_OPENSSL], test ! "$WITH_OPENSSL" = no)
  566. if test "$WITH_OPENSSL" != no; then
  567. if test "$WITH_OPENSSL" != yes; then
  568. openssl_append_CPPFLAGS=" -I$WITH_OPENSSL/include"
  569. openssl_append_LDFLAGS=" -L$WITH_OPENSSL/lib"
  570. fi
  571. fi
  572. AC_MSG_CHECKING([custom include directory for openssl])
  573. AC_ARG_WITH([openssl-includes],
  574. [AC_HELP_STRING([--with-openssl-includes=DIR], [OpenSSL includes])],
  575. [
  576. if test "$WITH_OPENSSL" = no; then
  577. AC_MSG_ERROR([build --with-openssl to use --with-openssl-includes])
  578. fi
  579. openssl_append_CPPFLAGS=" -I$withval"
  580. AC_MSG_RESULT([$withval])
  581. ],
  582. [AC_MSG_RESULT([no])]
  583. )
  584. AC_MSG_CHECKING([custom lib directory for openssl])
  585. AC_ARG_WITH([openssl-libs],
  586. [AC_HELP_STRING([--with-openssl-libs=DIR], [OpenSSL libraries])],
  587. [
  588. if test "$WITH_OPENSSL" = no; then
  589. AC_MSG_ERROR([build --with-openssl to use --with-openssl-libs])
  590. fi
  591. openssl_append_LDFLAGS=" -L$withval"
  592. AC_MSG_RESULT([$withval])
  593. ],
  594. [AC_MSG_RESULT([no])]
  595. )
  596. if test "$WITH_OPENSSL" != no; then
  597. if test "$WITH_KRB5" != no; then
  598. AC_DEFINE([USE_OPENSSL_KERBEROS], [1], [with kerberos])
  599. fi
  600. CPPFLAGS="${CPPFLAGS}${openssl_append_CPPFLAGS}"
  601. LDFLAGS="${LDFLAGS}${openssl_append_LDFLAGS}"
  602. AC_CHECK_HEADERS([openssl/ssl.h], [], [
  603. AC_MSG_ERROR([openssl headers not found. install them or build without --with-openssl])
  604. ])
  605. AC_CHECK_LIB([crypto], [BIO_f_base64],
  606. [CRYPTO_LIB="-lcrypto"],
  607. [AC_MSG_ERROR([openssl crypto library not found. install it or build without --with-openssl])]
  608. )
  609. AC_CHECK_LIB([ssl], [SSL_new],
  610. [OPENSSL_LIBS="${openssl_append_LDFLAGS} -lssl -lcrypto"],
  611. [AC_MSG_ERROR([openssl ssl library not found. install it or build without --with-openssl])],
  612. [ -lcrypto "$DL_LIB" ]
  613. )
  614. AC_DEFINE([HAVE_LIBSSL], [1], [Have libssl])
  615. OPENSSL_CFLAGS="${openssl_append_CPPFLAGS}"
  616. AC_SUBST([OPENSSL_CFLAGS])
  617. AC_SUBST([OPENSSL_LIBS])
  618. AC_SUBST([CRYPTO_LIB])
  619. fi
  620. dnl Check for wolfSSL
  621. AC_MSG_NOTICE([----------------------------------------])
  622. AC_MSG_CHECKING([for wolfSSL])
  623. AC_ARG_WITH([wolfssl],
  624. [AC_HELP_STRING([--with-wolfssl@<:@=DIR@:>@],
  625. [Include wolfSSL support (default no)]
  626. )],
  627. [WITH_WOLFSSL=$withval],
  628. [WITH_WOLFSSL=no]
  629. )
  630. AC_MSG_RESULT([$WITH_WOLFSSL])
  631. AM_CONDITIONAL([BUILD_WITH_WOLFSSL], test ! "$WITH_WOLFSSL" = no)
  632. if test "$WITH_WOLFSSL" != no; then
  633. CPPFLAGS_SAVE="${CPPFLAGS}"
  634. LDFLAGS_SAVE="${LDFLAGS}"
  635. if test "$WITH_WOLFSSL" != yes; then
  636. WOLFSSL_CFLAGS="-I$WITH_WOLFSSL/include -I$WITH_WOLFSSL/include/wolfssl"
  637. WOLFSSL_LIBS="-L$WITH_WOLFSSL/lib -lwolfssl"
  638. CPPFLAGS="${CPPFLAGS} $WOLFSSL_CFLAGS"
  639. LDFLAGS="${LDFLAGS} $WOLFSSL_LIBS"
  640. fi
  641. AC_CHECK_HEADERS([wolfssl/ssl.h], [], [
  642. AC_MSG_ERROR([wolfssl headers not found. install them or build without --with-wolfssl])
  643. ])
  644. AC_CHECK_LIB([wolfssl], [wolfSSL_Init],
  645. [WOLFSSL_CRYPTO_LIB="-lwolfssl"],
  646. [AC_MSG_ERROR([wolfssl crypto library not found. install it or build without --with-wolfssl])]
  647. )
  648. AC_COMPILE_IFELSE([AC_LANG_SOURCE([[
  649. #include <wolfssl/options.h>
  650. #if !defined(HAVE_LIGHTY) && !defined(OPENSSL_ALL)
  651. #error HAVE_LIGHTY macro not defined
  652. #endif
  653. ]])], [], [AC_MSG_ERROR([wolfssl must be built with ./configure --enable-lighty])])
  654. AC_SUBST([WOLFSSL_CFLAGS])
  655. AC_SUBST([WOLFSSL_LIBS])
  656. if test "$WITH_OPENSSL" = no; then
  657. CRYPTO_LIB="$WOLFSSL_CRYPTO_LIB"
  658. AC_SUBST([CRYPTO_LIB])
  659. else
  660. CPPFLAGS="${CPPFLAGS_SAVE}"
  661. LDFLAGS="${LDFLAGS_SAVE}"
  662. fi
  663. fi
  664. dnl Check for mbedTLS
  665. AC_MSG_NOTICE([----------------------------------------])
  666. AC_MSG_CHECKING([for mbedTLS])
  667. AC_ARG_WITH([mbedtls],
  668. AC_HELP_STRING([--with-mbedtls@<:@=DIR@:>@],[Include mbedTLS support. DIR points to the installation root. (default no)]),
  669. [WITH_MBEDTLS=$withval],
  670. [WITH_MBEDTLS=no]
  671. )
  672. if test "$WITH_MBEDTLS" != "no"; then
  673. use_mbedtls=yes
  674. if test "$WITH_MBEDTLS" != "yes"; then
  675. CPPFLAGS="$CPPFLAGS -I$WITH_MBEDTLS/include"
  676. LDFLAGS="$LDFLAGS -L$WITH_MBEDTLS/lib"
  677. fi
  678. else
  679. use_mbedtls=no
  680. fi
  681. AC_MSG_RESULT([$use_mbedtls])
  682. AM_CONDITIONAL(BUILD_WITH_MBEDTLS, test ! $WITH_MBEDTLS = no)
  683. if test "x$use_mbedtls" = "xyes"; then
  684. AC_CHECK_HEADERS([mbedtls/ssl.h])
  685. OLDLIBS="$LIBS"
  686. AC_CHECK_LIB(mbedcrypto,mbedtls_base64_encode,
  687. [AC_CHECK_LIB(mbedx509, mbedtls_x509_get_name,
  688. [AC_CHECK_LIB(mbedtls, mbedtls_cipher_info_from_type,
  689. [MTLS_LIBS="-lmbedtls -lmbedx509 -lmbedcrypto"
  690. CRYPTO_LIB="-lmbedcrypto"
  691. AC_DEFINE(HAVE_LIBMBEDTLS, [1], [Have libmbedtls library])
  692. AC_DEFINE(HAVE_LIBMBEDX509, [1], [Have libmbedx509 library])
  693. AC_DEFINE(HAVE_LIBMBEDCRYPTO, [1], [Have libmbedcrypto library]) ],
  694. [],[-lmbedcrypto "$DL_LIB"])
  695. ],[],[-lmbedcrypto "$DL_LIB"])
  696. ],[],[])
  697. LIBS="$OLDLIBS"
  698. AC_SUBST(MTLS_LIBS)
  699. AC_SUBST(CRYPTO_LIB)
  700. fi
  701. dnl Check for Nettle (and overwrite CRYPTO_LIB if set by OpenSSL or wolfSSL)
  702. AC_MSG_NOTICE([----------------------------------------])
  703. AC_MSG_CHECKING([for Nettle])
  704. AC_ARG_WITH([nettle],
  705. [AC_HELP_STRING([--with-nettle@<:@=DIR@:>@],
  706. [Include Nettle support (default no)]
  707. )],
  708. [WITH_NETTLE=$withval],
  709. [WITH_NETTLE=no]
  710. )
  711. AC_MSG_RESULT([$WITH_NETTLE])
  712. if test "$WITH_NETTLE" != no; then
  713. if test "$WITH_NETTLE" != yes; then
  714. CPPFLAGS="${CPPFLAGS} -I$WITH_NETTLE/include"
  715. LDFLAGS="${LDFLAGS} -L$WITH_NETTLE/lib"
  716. fi
  717. AC_CHECK_HEADERS([nettle/nettle-types.h], [], [
  718. AC_MSG_ERROR([nettle headers not found. install them or build without --with-nettle])
  719. ])
  720. AC_CHECK_LIB([nettle], [nettle_md5_init],
  721. [CRYPTO_LIB="-lnettle"],
  722. [AC_MSG_ERROR([nettle crypto library not found. install it or build without --with-nettle])]
  723. )
  724. AC_SUBST([CRYPTO_LIB])
  725. fi
  726. dnl Check for GnuTLS
  727. AC_MSG_NOTICE([----------------------------------------])
  728. AC_MSG_CHECKING([for GnuTLS])
  729. AC_ARG_WITH([gnutls],
  730. AC_HELP_STRING([--with-gnutls@<:@=DIR@:>@],[Include GnuTLS support. DIR points to the installation root. (default no)]),
  731. [WITH_GNUTLS=$withval],
  732. [WITH_GNUTLS=no]
  733. )
  734. if test "$WITH_GNUTLS" != "no"; then
  735. use_gnutls=yes
  736. else
  737. use_gnutls=no
  738. fi
  739. AC_MSG_RESULT([$use_gnutls])
  740. AM_CONDITIONAL(BUILD_WITH_GNUTLS, test ! $WITH_GNUTLS = no)
  741. GNUTLS_CFLAGS=
  742. GNUTLS_LIBS=
  743. if test "x$use_gnutls" = "xyes"; then
  744. if test "$WITH_GNUTLS" != "yes"; then
  745. GNUTLS_CFLAGS="-I$WITH_GNUTLS/include"
  746. GNUTLS_LIBS="-L$WITH_GNUTLS/lib"
  747. else
  748. dnl oldest GnuTLS supported release is 3.3.x at time this is being written
  749. PKG_CHECK_MODULES([GNUTLS], [gnutls >= 3.3.0])
  750. fi
  751. AC_SUBST([GNUTLS_CFLAGS])
  752. AC_SUBST([GNUTLS_LIBS])
  753. AC_DEFINE([HAVE_GNUTLS_CRYPTO_H], [1], [gnutls/crypto.h])
  754. if test "$WITH_OPENSSL" = no && test "$WITH_WOLFSSL" = no && \
  755. test "$WITH_MBEDTLS" = no && test "$WITH_NETTLE" = no; then
  756. AC_SUBST([CRYPTO_LIB],[$GNUTLS_LIBS])
  757. fi
  758. fi
  759. dnl Check for NSS
  760. AC_MSG_NOTICE([----------------------------------------])
  761. AC_MSG_CHECKING([for NSS])
  762. AC_ARG_WITH([nss],
  763. AC_HELP_STRING([--with-nss@<:@=DIR@:>@],[Include NSS support. DIR points to the installation root. (default no)]),
  764. [WITH_NSS=$withval],
  765. [WITH_NSS=no]
  766. )
  767. if test "$WITH_NSS" != "no"; then
  768. use_nss=yes
  769. else
  770. use_nss=no
  771. fi
  772. AC_MSG_RESULT([$use_nss])
  773. AM_CONDITIONAL(BUILD_WITH_NSS, test ! $WITH_NSS = no)
  774. NSS_CFLAGS=
  775. NSS_LIBS=
  776. if test "x$use_nss" = "xyes"; then
  777. if test "$WITH_NSS" != "yes"; then
  778. NSS_CFLAGS="-I$WITH_NSS/include"
  779. NSS_LIBS="-L$WITH_NSS/lib"
  780. else
  781. PKG_CHECK_MODULES([NSS],[nss])
  782. CPPFLAGS="$CPPFLAGS -I/usr/include/nspr4"
  783. fi
  784. AC_DEFINE([HAVE_NSS3_NSS_H], [1], [nss3/nss.h])
  785. AC_SUBST([NSS_CFLAGS])
  786. AC_SUBST([NSS_LIBS])
  787. if test "x$CRYPTO_LIB" = "x"; then
  788. CRYPTO_LIB="-lnss3"
  789. AC_SUBST([CRYPTO_LIB])
  790. fi
  791. fi
  792. dnl pcre support
  793. AC_MSG_NOTICE([----------------------------------------])
  794. AC_MSG_CHECKING([for perl regular expressions support])
  795. AC_ARG_WITH([pcre],
  796. [AC_HELP_STRING([--with-pcre], [Enable pcre support (default yes)])],
  797. [WITH_PCRE=$withval],
  798. [WITH_PCRE=yes]
  799. )
  800. AC_MSG_RESULT([$WITH_PCRE])
  801. if test "$WITH_PCRE" != no; then
  802. if test "$WITH_PCRE" != yes; then
  803. PCRE_LIB="-L$WITH_PCRE/lib -lpcre"
  804. CPPFLAGS="$CPPFLAGS -I$WITH_PCRE/include"
  805. else
  806. AC_PATH_PROG([PCRECONFIG], [pcre-config])
  807. if test -n "$PCRECONFIG"; then
  808. PCRE_LIB=`"$PCRECONFIG" --libs`
  809. CPPFLAGS="$CPPFLAGS `"$PCRECONFIG" --cflags`"
  810. fi
  811. fi
  812. if test -z "$PCRE_LIB"; then
  813. AC_MSG_ERROR([pcre-config not found, install the pcre-devel package or build with --without-pcre])
  814. fi
  815. AC_DEFINE([HAVE_LIBPCRE], [1], [libpcre])
  816. AC_DEFINE([HAVE_PCRE_H], [1], [pcre.h])
  817. AC_SUBST([PCRE_LIB])
  818. fi
  819. dnl zlib
  820. AC_MSG_NOTICE([----------------------------------------])
  821. AC_MSG_CHECKING([for zlib support])
  822. AC_ARG_WITH([zlib],
  823. [AC_HELP_STRING([--with-zlib],
  824. [Enable zlib support for mod_deflate]
  825. )],
  826. [WITH_ZLIB=$withval],
  827. [WITH_ZLIB=yes]
  828. )
  829. AC_MSG_RESULT([$WITH_ZLIB])
  830. if test "$WITH_ZLIB" != no; then
  831. if test "$WITH_ZLIB" != yes; then
  832. Z_LIB="-L$WITH_ZLIB -lz"
  833. CPPFLAGS="$CPPFLAGS -I$WITH_ZLIB"
  834. else
  835. AC_CHECK_HEADERS([zlib.h], [],
  836. [AC_MSG_ERROR([zlib headers not found, install them or build without --with-zlib])]
  837. )
  838. AC_CHECK_LIB([z], [deflate],
  839. [Z_LIB=-lz],
  840. [AC_MSG_ERROR([zlib library not found, install it or build without --with-zlib])]
  841. )
  842. fi
  843. AC_DEFINE([HAVE_LIBZ], [1], [libz])
  844. AC_DEFINE([HAVE_ZLIB_H], [1])
  845. AC_SUBST([Z_LIB])
  846. fi
  847. dnl bzip2
  848. AC_MSG_NOTICE([----------------------------------------])
  849. AC_MSG_CHECKING([for bzip2 support])
  850. AC_ARG_WITH([bzip2],
  851. [AC_HELP_STRING([--with-bzip2],
  852. [Enable bzip2 support for mod_deflate]
  853. )],
  854. [WITH_BZIP2=$withval],
  855. [WITH_BZIP2=no]
  856. )
  857. AC_MSG_RESULT([$WITH_BZIP2])
  858. if test "$WITH_BZIP2" != no; then
  859. if test "$WITH_BZIP2" != yes; then
  860. BZ_LIB="-L$WITH_BZIP2 -lbz2"
  861. CPPFLAGS="$CPPFLAGS -I$WITH_BZIP2"
  862. else
  863. AC_CHECK_HEADERS([bzlib.h], [], [
  864. AC_MSG_ERROR([bzip2 headers not found, install them or build without --with-bzip2])
  865. ])
  866. AC_CHECK_LIB([bz2], [BZ2_bzCompress],
  867. [BZ_LIB=-lbz2],
  868. [AC_MSG_ERROR([bzip2 library not found, install it or build without --with-bzip2])]
  869. )
  870. fi
  871. AC_DEFINE([HAVE_LIBBZ2], [1], [libbz2])
  872. AC_DEFINE([HAVE_BZLIB_H], [1])
  873. AC_SUBST([BZ_LIB])
  874. fi
  875. dnl brotli
  876. AC_MSG_NOTICE([----------------------------------------])
  877. AC_MSG_CHECKING([for brotli support])
  878. AC_ARG_WITH([brotli],
  879. [AC_HELP_STRING([--with-brotli],
  880. [Enable brotli support for mod_deflate]
  881. )],
  882. [WITH_BROTLI=$withval],
  883. [WITH_BROTLI=no]
  884. )
  885. AC_MSG_RESULT([$WITH_BROTLI])
  886. if test "$WITH_BROTLI" != no; then
  887. if test "$WITH_BROTLI" != yes; then
  888. BROTLI_LIB="-L$WITH_BROTLI -lbrotlienc"
  889. CPPFLAGS="$CPPFLAGS -I$WITH_BROTLI"
  890. else
  891. PKG_CHECK_MODULES([BROTLI], [libbrotlienc], [], [
  892. AC_MSG_ERROR([brotli not found, install it or build without --with-brotli])
  893. ])
  894. fi
  895. AC_DEFINE([HAVE_BROTLI_ENCODE_H], [1], [brotli/encode.h])
  896. AC_DEFINE([HAVE_BROTLI], [1], [libbrotlienc])
  897. AC_SUBST([BROTLI_CFLAGS])
  898. AC_SUBST([BROTLI_LIBS])
  899. fi
  900. dnl Check for fam/gamin
  901. AC_MSG_NOTICE([----------------------------------------])
  902. AC_MSG_CHECKING([for FAM])
  903. AC_ARG_WITH([fam],
  904. [AC_HELP_STRING([--with-fam],
  905. [fam/gamin for reducing number of stat() calls]
  906. )],
  907. [WITH_FAM=$withval],
  908. [WITH_FAM=no]
  909. )
  910. AC_MSG_RESULT([$WITH_FAM])
  911. if test "$WITH_FAM" != no; then
  912. if test "$WITH_FAM" != yes; then
  913. FAM_LIBS="-L$WITH_FAM -lfam"
  914. CPPFLAGS="$CPPFLAGS -I$WITH_FAM"
  915. else
  916. AC_CHECK_LIB([fam], [FAMOpen2], [
  917. AC_CHECK_HEADERS([fam.h], [FAM_LIBS=-lfam])
  918. ])
  919. dnl fam has no pkg-config so far, so just search for gamin as fallback
  920. if test -z "$FAM_LIBS"; then
  921. PKG_CHECK_MODULES([FAM], [gamin >= 0.1.0])
  922. fi
  923. fi
  924. if test -z "$FAM_LIBS"; then
  925. AC_MSG_ERROR([fam/gamin headers and/or libs were not found, install them or build without --with-fam])
  926. fi
  927. OLD_LIBS=$LIBS
  928. LIBS=$FAM_LIBS
  929. AC_CHECK_FUNCS([FAMNoExists])
  930. LIBS=$OLD_LIBS
  931. AC_DEFINE([HAVE_LIBFAM], [1], [libfam])
  932. AC_DEFINE([HAVE_FAM_H], [1], [fam.h])
  933. AC_SUBST([FAM_LIBS])
  934. fi
  935. dnl webdav props (xml2 and sqlite3)
  936. AC_MSG_NOTICE([----------------------------------------])
  937. AC_MSG_CHECKING([for properties in mod_webdav])
  938. AC_ARG_WITH([webdav-props],
  939. [AC_HELP_STRING([--with-webdav-props], [properties in mod_webdav])],
  940. [WITH_WEBDAV_PROPS=$withval],
  941. [WITH_WEBDAV_PROPS=no]
  942. )
  943. AC_MSG_RESULT([$WITH_WEBDAV_PROPS])
  944. if test "$WITH_WEBDAV_PROPS" != no; then
  945. AC_MSG_CHECKING([for libxml2])
  946. AC_ARG_WITH([libxml],
  947. [AC_HELP_STRING([--with-libxml],
  948. [libxml2 for properties in mod_webdav]
  949. )],
  950. [WITH_LIBXML=$withval],
  951. [WITH_LIBXML=yes]
  952. )
  953. AC_MSG_RESULT([$WITH_LIBXML])
  954. if test "$WITH_LIBXML" = no; then
  955. AC_MSG_ERROR([--with-webdav-props requires libxml])
  956. fi
  957. if test "$WITH_LIBXML" != yes; then
  958. XML_LIBS="-L$WITH_LIBXML/.libs -lxml2"
  959. XML_CFLAGS="-I$WITH_LIBXML/include"
  960. else
  961. PKG_CHECK_MODULES([XML], [libxml-2.0], [], [
  962. AC_MSG_ERROR([libxml2 not found, install it or build without --with-webdav-props])
  963. ])
  964. fi
  965. AC_DEFINE([HAVE_LIBXML2], [1], [libxml2])
  966. AC_DEFINE([HAVE_LIBXML_H], [1], [libxml.h])
  967. AC_SUBST([XML_LIBS])
  968. AC_SUBST([XML_CFLAGS])
  969. AC_MSG_CHECKING([for sqlite])
  970. AC_ARG_WITH([sqlite],
  971. [AC_HELP_STRING([--with-sqlite],
  972. [sqlite for properties in mod_webdav]
  973. )],
  974. [WITH_SQLITE=$withval],
  975. [WITH_SQLITE=yes]
  976. )
  977. AC_MSG_RESULT([$WITH_SQLITE])
  978. if test "$WITH_SQLITE" = no; then
  979. AC_MSG_ERROR([--with-webdav-props requires sqlite])
  980. fi
  981. if test "$WITH_SQLITE" != yes; then
  982. SQLITE_LIBS="-L$WITH_SQLITE/.libs -lsqlite3"
  983. SQLITE_CFLAGS="-I$WITH_SQLITE"
  984. else
  985. PKG_CHECK_MODULES([SQLITE], [sqlite3], [], [
  986. AC_MSG_ERROR([sqlite3 not found, install it or build without --with-webdav-props])
  987. ])
  988. fi
  989. AC_DEFINE([HAVE_SQLITE3], [1], [libsqlite3])
  990. AC_DEFINE([HAVE_SQLITE3_H], [1], [sqlite3.h])
  991. AC_SUBST([SQLITE_LIBS])
  992. AC_SUBST([SQLITE_CFLAGS])
  993. fi
  994. dnl webdav locks (uuid)
  995. AC_MSG_NOTICE([----------------------------------------])
  996. AC_MSG_CHECKING([for locks in mod_webdav])
  997. AC_ARG_WITH([webdav-locks],
  998. [AC_HELP_STRING([--with-webdav-locks],
  999. [locks in mod_webdav (requires webdav properties)]
  1000. )],
  1001. [WITH_WEBDAV_LOCKS=$withval],
  1002. [WITH_WEBDAV_LOCKS=no]
  1003. )
  1004. AC_MSG_RESULT([$WITH_WEBDAV_LOCKS])
  1005. if test "$WITH_WEBDAV_LOCKS" != no; then
  1006. if test "$WITH_WEBDAV_PROPS" = no; then
  1007. AC_MSG_ERROR([--with-webdav-locks requires --with-webdav-props])
  1008. fi
  1009. AC_MSG_CHECKING([for libuuid])
  1010. AC_ARG_WITH([uuid],
  1011. [AC_HELP_STRING([--with-uuid], [uuid for locks in mod_webdav])],
  1012. [WITH_UUID=$withval],
  1013. [WITH_UUID=yes]
  1014. )
  1015. AC_MSG_RESULT([$WITH_UUID])
  1016. if test "$WITH_UUID" = no; then
  1017. AC_MSG_ERROR([--with-webdav-locks requires uuid])
  1018. fi
  1019. if test "$WITH_UUID" != yes; then
  1020. UUID_LIBS="-L$WITH_UUID -luuid"
  1021. CPPFLAGS="$CPPFLAGS -I$WITH_UUID"
  1022. else
  1023. AC_CHECK_LIB([uuid], [uuid_unparse],
  1024. [UUID_LIBS=-luuid],
  1025. [AC_MSG_ERROR([uuid lib not found, install it or build without --with-webdav-locks])]
  1026. )
  1027. AC_CHECK_HEADERS([uuid/uuid.h], [],
  1028. [AC_MSG_ERROR([uuid headers not found, install them or build without --with-webdav-locks])]
  1029. )
  1030. fi
  1031. AC_DEFINE([HAVE_LIBUUID], [1], [libuuid])
  1032. AC_DEFINE([HAVE_UUID_UUID_H], [1], [uuid/uuid.h is available])
  1033. AC_SUBST([UUID_LIBS])
  1034. fi
  1035. dnl Check for gdbm
  1036. AC_MSG_NOTICE([----------------------------------------])
  1037. AC_MSG_CHECKING([for gdbm])
  1038. AC_ARG_WITH([gdbm],
  1039. [AC_HELP_STRING([--with-gdbm], [gdbm storage for mod_trigger_b4_dl])],
  1040. [WITH_GDBM=$withval],
  1041. [WITH_GDBM=no]
  1042. )
  1043. AC_MSG_RESULT([$WITH_GDBM])
  1044. if test "$WITH_GDBM" != no; then
  1045. if test "$WITH_GDBM" != yes; then
  1046. GDBM_LIB="-L$WITH_GDBM -lgdbm"
  1047. CPPFLAGS="$CPPFLAGS -I$WITH_GDBM"
  1048. else
  1049. AC_CHECK_LIB([gdbm], [gdbm_open],
  1050. [GDBM_LIB=-lgdbm],
  1051. [AC_MSG_ERROR([gdbm lib not found, install it or build without --with-gdbm])]
  1052. )
  1053. AC_CHECK_HEADERS([gdbm.h], [],
  1054. [AC_MSG_ERROR([gdbm headers not found, install them or build without --with-gdbm])]
  1055. )
  1056. fi
  1057. AC_DEFINE([HAVE_GDBM], [1], [libgdbm])
  1058. AC_DEFINE([HAVE_GDBM_H], [1])
  1059. AC_SUBST([GDBM_LIB])
  1060. fi
  1061. AM_CONDITIONAL([BUILD_WITH_GDBM], [test "$WITH_GDBM" != no])
  1062. dnl Check for GeoIP
  1063. AC_MSG_NOTICE([----------------------------------------])
  1064. AC_MSG_CHECKING([for GeoIP])
  1065. AC_ARG_WITH([geoip],
  1066. [AC_HELP_STRING([--with-geoip], [IP-based geolocation lookup])],
  1067. [WITH_GEOIP=$withval],
  1068. [WITH_GEOIP=no]
  1069. )
  1070. AC_MSG_RESULT([$WITH_GEOIP])
  1071. if test "$WITH_GEOIP" != no; then
  1072. if test "$WITH_GEOIP" != yes; then
  1073. GEOIP_LIB="-L$WITH_GEOIP -lGeoIP"
  1074. CPPFLAGS="$CPPFLAGS -I$WITH_GEOIP"
  1075. else
  1076. AC_CHECK_LIB([GeoIP], [GeoIP_country_name_by_addr],
  1077. [GEOIP_LIB=-lGeoIP],
  1078. [AC_MSG_ERROR([GeoIP lib not found, install it or build without --with-geoip])]
  1079. )
  1080. AC_CHECK_HEADERS([GeoIP.h], [],
  1081. [AC_MSG_ERROR([GeoIP headers not found, install them or build without --with-geoip])]
  1082. )
  1083. fi
  1084. AC_DEFINE([HAVE_GEOIP], [1], [libGeoIP])
  1085. AC_DEFINE([HAVE_GEOIP_H], [1])
  1086. AC_SUBST([GEOIP_LIB])
  1087. fi
  1088. AM_CONDITIONAL([BUILD_WITH_GEOIP], [test "$WITH_GEOIP" != no])
  1089. dnl Check for maxminddb
  1090. AC_MSG_NOTICE([----------------------------------------])
  1091. AC_MSG_CHECKING([for maxminddb])
  1092. AC_ARG_WITH([maxminddb],
  1093. [AC_HELP_STRING([--with-maxminddb], [IP-based geolocation lookup])],
  1094. [WITH_MAXMINDDB=$withval],
  1095. [WITH_MAXMINDDB=no]
  1096. )
  1097. AC_MSG_RESULT([$WITH_MAXMINDDB])
  1098. if test "$WITH_MAXMINDDB" != no; then
  1099. if test "$WITH_MAXMINDDB" != yes; then
  1100. MAXMINDDB_LIB="-L$WITH_MAXMINDDB -lmaxminddb"
  1101. CPPFLAGS="$CPPFLAGS -I$WITH_MAXMINDDB"
  1102. else
  1103. AC_CHECK_LIB([maxminddb], [MMDB_open],
  1104. [MAXMINDDB_LIB=-lmaxminddb],
  1105. [AC_MSG_ERROR([maxminddb lib not found, install it or build without --with-maxminddb])]
  1106. )
  1107. AC_CHECK_HEADERS([maxminddb.h], [],
  1108. [AC_MSG_ERROR([maxminddb headers not found, install them or build without --with-maxminddb])]
  1109. )
  1110. fi
  1111. AC_DEFINE([HAVE_MAXMINDDB], [1], [libmaxminddb])
  1112. AC_DEFINE([HAVE_MAXMINDDB_H], [1])
  1113. AC_SUBST([MAXMINDDB_LIB])
  1114. fi
  1115. AM_CONDITIONAL([BUILD_WITH_MAXMINDDB], [test "$WITH_MAXMINDDB" != no])
  1116. dnl Check for memcached
  1117. AC_MSG_NOTICE([----------------------------------------])
  1118. AC_MSG_CHECKING([for memcached])
  1119. AC_ARG_WITH([memcached],
  1120. [AC_HELP_STRING([--with-memcached],
  1121. [memcached storage for mod_trigger_b4_dl/mod_cml]
  1122. )],
  1123. [WITH_MEMCACHED=$withval],
  1124. [WITH_MEMCACHED=no]
  1125. )
  1126. AC_MSG_RESULT([$WITH_MEMCACHED])
  1127. if test "$WITH_MEMCACHED" != no; then
  1128. if test "$WITH_MEMCACHED" != yes; then
  1129. MEMCACHED_LIB="-L$WITH_MEMCACHED -lMEMCACHED"
  1130. CPPFLAGS="$CPPFLAGS -I$WITH_MEMCACHED"
  1131. else
  1132. AC_CHECK_LIB([memcached], [memcached],
  1133. [ MEMCACHED_LIB=-lmemcached ],
  1134. [AC_MSG_ERROR([memcached lib not found, install it or build without --with-memcached])]
  1135. )
  1136. AC_CHECK_HEADERS([libmemcached/memcached.h], [],
  1137. [AC_MSG_ERROR([memcached headers not found, install them or build without --with-memcached])]
  1138. )
  1139. fi
  1140. AC_DEFINE([USE_MEMCACHED], [1], [libmemcached])
  1141. AC_SUBST([MEMCACHED_LIB])
  1142. fi
  1143. AM_CONDITIONAL([BUILD_WITH_MEMCACHED], [test "$WITH_MEMCACHED" != no])
  1144. BUILD_MOD_TRIGGER_B4_DL=no
  1145. if test "$WITH_MEMCACHED" != no || test "$WITH_GDBM" != no ; then
  1146. BUILD_MOD_TRIGGER_B4_DL=yes
  1147. fi
  1148. AM_CONDITIONAL([BUILD_MOD_TRIGGER_B4_DL], [test "$BUILD_MOD_TRIGGER_B4_DL" != no])
  1149. dnl Check for lua
  1150. AC_MSG_NOTICE([----------------------------------------])
  1151. AC_MSG_CHECKING([if lua-support is requested])
  1152. AC_ARG_WITH([lua],
  1153. [AC_HELP_STRING([--with-lua], [lua engine for mod_magnet/mod_cml])],
  1154. [WITH_LUA=$withval],
  1155. [WITH_LUA=no]
  1156. )
  1157. AC_MSG_RESULT([$WITH_LUA])
  1158. if test "$WITH_LUA" != no; then
  1159. found_lua=0
  1160. if test "$WITH_LUA" != yes; then
  1161. PKG_CHECK_MODULES([LUA], [$WITH_LUA >= 5.1],
  1162. [found_lua=1],
  1163. [AC_MSG_NOTICE([Couldn\'t find requested lua pkg-config module $WITH_LUA])]
  1164. )
  1165. if test "$found_lua" = "0"; then
  1166. LUA_LIBS="-L$WITH_LUA -llua"
  1167. LUA_CFLAGS="-I$WITH_LUA"
  1168. fi
  1169. else
  1170. for luaname in lua5.3 lua-5.3 lua5.2 lua-5.2 lua5.1 lua-5.1 lua; do
  1171. if test "$found_lua" = "0"; then
  1172. PKG_CHECK_MODULES([LUA], [$luaname >= 5.1],
  1173. [found_lua=1],
  1174. [AC_MSG_NOTICE([Couldn\'t find $luaname])]
  1175. )
  1176. fi
  1177. done
  1178. if test "$found_lua" = "0"; then
  1179. AC_MSG_ERROR([Couldn\'t find any lua pkg-config module])
  1180. fi
  1181. fi
  1182. AC_DEFINE([HAVE_LUA], [1], [liblua])
  1183. AC_DEFINE([HAVE_LUA_H], [1], [lua.h])
  1184. AC_SUBST([LUA_LIBS])
  1185. AC_SUBST([LUA_CFLAGS])
  1186. fi
  1187. AM_CONDITIONAL([BUILD_WITH_LUA], [test "$WITH_LUA" != no])
  1188. dnl "--with-FEATURE" blocks end
  1189. AC_MSG_NOTICE([----------------------------------------])
  1190. dnl search for crypt_r and (fallback) for crypt
  1191. save_LIBS=$LIBS
  1192. LIBS=
  1193. found_crypt=no
  1194. AC_SEARCH_LIBS([crypt_r], [crypt],
  1195. [
  1196. AC_DEFINE([HAVE_CRYPT_R], [1], [crypt_r])
  1197. AC_CHECK_HEADERS([crypt.h])
  1198. CRYPT_LIB=$LIBS
  1199. found_crypt=crypt_r
  1200. ],
  1201. [AC_SEARCH_LIBS([crypt], [crypt], [
  1202. AC_DEFINE([HAVE_CRYPT], [1], [crypt])
  1203. AC_CHECK_HEADERS([crypt.h])
  1204. CRYPT_LIB=$LIBS
  1205. found_crypt=crypt
  1206. ])]
  1207. )
  1208. LIBS=$save_LIBS
  1209. AC_SUBST([CRYPT_LIB])
  1210. AC_MSG_CHECKING([crypt_r/crypt support])
  1211. AC_MSG_RESULT([$found_crypt])
  1212. dnl check whether sendfilev needs -lsendfile
  1213. AC_MSG_NOTICE([----------------------------------------])
  1214. save_LIBS=$LIBS
  1215. LIBS=
  1216. have_sendfilev=no
  1217. AC_SEARCH_LIBS([sendfilev], [sendfile], [
  1218. if test -z "$LIBS"; then
  1219. have_sendfilev=yes
  1220. else
  1221. have_sendfilev=$LIBS
  1222. fi
  1223. SENDFILE_LIB=$LIBS
  1224. AC_DEFINE([HAVE_SENDFILEV], [1], [solaris sendfilev])
  1225. ])
  1226. LIBS=$save_LIBS
  1227. AC_SUBST([SENDFILE_LIB])
  1228. AC_MSG_CHECKING([solaris sendfilev present])
  1229. AC_MSG_RESULT([$have_sendfilev])
  1230. AC_MSG_NOTICE([----------------------------------------])
  1231. case "$host_os" in
  1232. *mingw* ) LIBS="$LIBS -lwsock32" ;;
  1233. * ) ;;
  1234. esac
  1235. AC_CHECK_FUNCS([\
  1236. arc4random_buf \
  1237. chroot \
  1238. clock_gettime \
  1239. copy_file_range \
  1240. epoll_ctl \
  1241. explicit_bzero \
  1242. explicit_memset \
  1243. fork \
  1244. getloadavg \
  1245. getrlimit \
  1246. getuid \
  1247. gmtime_r \
  1248. inet_pton \
  1249. issetugid \
  1250. jrand48 \
  1251. kqueue \
  1252. localtime_r \
  1253. lstat \
  1254. madvise \
  1255. memset \
  1256. memset_s \
  1257. mmap \
  1258. pathconf \
  1259. pipe2 \
  1260. poll \
  1261. port_create \
  1262. select \
  1263. send_file \
  1264. sendfile \
  1265. sendfile64 \
  1266. sigaction \
  1267. signal \
  1268. srandom \
  1269. writev \
  1270. ])
  1271. AC_CHECK_HEADERS([sys/random.h], [AC_CHECK_FUNCS([getentropy])])
  1272. AC_CHECK_HEADERS([linux/random.h], [AC_CHECK_FUNCS([getrandom])])
  1273. AC_MSG_NOTICE([----------------------------------------])
  1274. AC_MSG_CHECKING([if weak symbols are supported])
  1275. AC_LINK_IFELSE(
  1276. [AC_LANG_PROGRAM([[
  1277. __attribute__((weak)) void __dummy(void *x) { }
  1278. void f(void *x) { __dummy(x); }
  1279. ]])],
  1280. [
  1281. AC_MSG_RESULT([yes])
  1282. AC_DEFINE([HAVE_WEAK_SYMBOLS], [1], [weak symbols are supported])
  1283. ],
  1284. [AC_MSG_RESULT([no])]
  1285. )
  1286. AC_MSG_NOTICE([----------------------------------------])
  1287. AC_MSG_CHECKING([for Large File System support])
  1288. AC_ARG_ENABLE([lfs],
  1289. [AC_HELP_STRING([--enable-lfs],
  1290. [Turn on Large File System (default)]
  1291. )],
  1292. [
  1293. case "${enableval}" in
  1294. yes) ENABLE_LFS=yes ;;
  1295. no) ENABLE_LFS=no ;;
  1296. *) AC_MSG_ERROR([bad value ${enableval} for --enable-lfs]) ;;
  1297. esac
  1298. ],
  1299. [ ENABLE_LFS=yes ]
  1300. )
  1301. AC_MSG_RESULT([$ENABLE_LFS])
  1302. if test "$ENABLE_LFS" = yes; then
  1303. CPPFLAGS="${CPPFLAGS} -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -D_LARGE_FILES"
  1304. fi
  1305. dnl check if sendfile works
  1306. if test "$ac_cv_func_sendfile" = yes; then
  1307. AC_MSG_NOTICE([----------------------------------------])
  1308. AC_MSG_CHECKING([if sendfile works])
  1309. if test "$cross_compiling" = no; then
  1310. AC_TRY_RUN(
  1311. [
  1312. #ifdef HAVE_SYS_SENDFILE_H
  1313. #include <sys/sendfile.h>
  1314. #endif /* HAVE_SYS_SENDFILE_H */
  1315. #include <errno.h>
  1316. int main() {
  1317. int o = 0;
  1318. if (-1 == sendfile(-1, 0, &o, 0) && errno == ENOSYS) return -1;
  1319. return 0;
  1320. }
  1321. ],
  1322. [AC_MSG_RESULT([yes])],
  1323. [
  1324. AC_MSG_RESULT([no])
  1325. AC_DEFINE([HAVE_SENDFILE_BROKEN], [1], [broken sendfile])
  1326. ]
  1327. )
  1328. fi
  1329. fi
  1330. dnl Check for IPv6 support
  1331. AC_MSG_NOTICE([----------------------------------------])
  1332. AC_ARG_ENABLE([ipv6],
  1333. [AC_HELP_STRING([--disable-ipv6], [disable IPv6 support])],
  1334. [
  1335. case "${enableval}" in
  1336. yes) ipv6=true ;;
  1337. no) ipv6=false ;;
  1338. *) AC_MSG_ERROR([bad value ${enableval} for --enable-ipv6]) ;;
  1339. esac
  1340. ],
  1341. [ipv6=true]
  1342. )
  1343. if test "$ipv6" = true; then
  1344. AC_CACHE_CHECK([for IPv6 support], [ac_cv_ipv6_support], [
  1345. AC_TRY_LINK(
  1346. [
  1347. #include <sys/types.h>
  1348. #include <sys/socket.h>
  1349. #include <netinet/in.h>
  1350. ],
  1351. [
  1352. struct sockaddr_in6 s; struct in6_addr t=in6addr_any; int i=AF_INET6; s; t.s6_addr[0] = 0;
  1353. ],
  1354. [ac_cv_ipv6_support=yes],
  1355. [ac_cv_ipv6_support=no]
  1356. )
  1357. ])
  1358. if test "$ac_cv_ipv6_support" = yes; then
  1359. AC_DEFINE([HAVE_IPV6], [1], [Whether to enable IPv6 support])
  1360. else
  1361. AC_MSG_ERROR([IPv6 seems broken. Fix it or build with --disable-ipv6])
  1362. fi
  1363. fi
  1364. # disable mmap by default
  1365. # lighttpd may always use mmap with files it owns (created tmp files)
  1366. AC_MSG_NOTICE([----------------------------------------])
  1367. AC_MSG_CHECKING([use mmap if available])
  1368. AC_ARG_ENABLE([mmap],
  1369. [AC_HELP_STRING([--enable-mmap],
  1370. [use mmap if available]
  1371. )],
  1372. [
  1373. case "${enableval}" in
  1374. yes) mmap=true ;;
  1375. no) mmap=false ;;
  1376. *) AC_MSG_ERROR([bad value ${enableval} for --enable-mmap]) ;;
  1377. esac
  1378. ],
  1379. [mmap=false]
  1380. )
  1381. AC_MSG_RESULT([$mmap])
  1382. if test "$mmap" = true; then
  1383. AC_DEFINE([ENABLE_MMAP], [1], [Use mmap if available])
  1384. fi
  1385. dnl check for fastcgi lib, for the tests only
  1386. AC_MSG_NOTICE([----------------------------------------])
  1387. fastcgi_found=no
  1388. AC_CHECK_LIB([fcgi], [FCGI_Accept], [
  1389. AC_CHECK_HEADERS([fastcgi.h fastcgi/fastcgi.h], [
  1390. fastcgi_found=yes
  1391. ])
  1392. ])
  1393. AM_CONDITIONAL([CHECK_WITH_FASTCGI], [test "$fastcgi_found" = yes])
  1394. AC_MSG_NOTICE([----------------------------------------])
  1395. dnl check for extra compiler options (warning options)
  1396. if test "${GCC}" = yes; then
  1397. TRY_CFLAGS([-Wall -W -Wshadow -pedantic])
  1398. fi
  1399. AC_ARG_ENABLE([extra-warnings],
  1400. [AC_HELP_STRING([--enable-extra-warnings],
  1401. [enable extra warnings (gcc specific)]
  1402. )],
  1403. [
  1404. case "${enableval}" in
  1405. error) extrawarnings=error ;;
  1406. yes) extrawarnings=true ;;
  1407. no) extrawarnings=false ;;
  1408. *) AC_MSG_ERROR([bad value ${enableval} for --enable-extra-warnings]) ;;
  1409. esac
  1410. ],
  1411. [extrawarnings=false]
  1412. )
  1413. if test "$extrawarnings" = true || test "$extrawarnings" = error; then
  1414. TRY_CFLAGS([-g -O2 -g2 -Wall -Wmissing-declarations -Wcast-align -Wsign-compare -Wnested-externs -Wpointer-arith -D_FORTIFY_SOURCE=2 -fstack-protector --param=ssp-buffer-size=4 -Wformat -Werror=format-security])
  1415. TRY_LDFLAGS([-Wl,--as-needed])
  1416. if test "$extrawarnings" = error; then
  1417. AS_VAR_APPEND([CFLAGS], [" -Werror"])
  1418. AS_VAR_APPEND([LDFLAGS], [" -Wl,--fatal-warnings"])
  1419. fi
  1420. fi
  1421. dnl build version-id
  1422. LIGHTTPD_VERSION_ID=m4_format([0x%x%02x%02x], m4_unquote(m4_split(AC_PACKAGE_VERSION, [\.])))
  1423. AC_DEFINE_UNQUOTED([LIGHTTPD_VERSION_ID], [$LIGHTTPD_VERSION_ID], [lighttpd-version-id])
  1424. AC_CONFIG_FILES([\
  1425. distribute.sh \
  1426. doc/config/conf.d/Makefile \
  1427. doc/config/Makefile \
  1428. doc/config/vhosts.d/Makefile \
  1429. doc/Makefile \
  1430. doc/outdated/Makefile \
  1431. doc/scripts/Makefile \
  1432. doc/systemd/Makefile \
  1433. Makefile \
  1434. src/Makefile \
  1435. tests/docroot/123/Makefile \
  1436. tests/docroot/Makefile \
  1437. tests/docroot/www/expire/Makefile \
  1438. tests/docroot/www/go/Makefile \
  1439. tests/docroot/www/indexfile/Makefile \
  1440. tests/docroot/www/Makefile \
  1441. tests/Makefile \
  1442. ])
  1443. AC_OUTPUT
  1444. do_build="\
  1445. mod_access \
  1446. mod_accesslog \
  1447. mod_alias \
  1448. mod_auth \
  1449. mod_authn_file \
  1450. mod_cgi \
  1451. mod_deflate \
  1452. mod_dirlisting \
  1453. mod_evhost \
  1454. mod_expire \
  1455. mod_extforward \
  1456. mod_fastcgi \
  1457. mod_flv_streaming \
  1458. mod_indexfile \
  1459. mod_proxy \
  1460. mod_redirect \
  1461. mod_rewrite \
  1462. mod_rrdtool \
  1463. mod_scgi \
  1464. mod_secdownload \
  1465. mod_setenv \
  1466. mod_simple_vhost \
  1467. mod_sockproxy \
  1468. mod_ssi \
  1469. mod_staticfile \
  1470. mod_status \
  1471. mod_userdir \
  1472. mod_usertrack \
  1473. mod_vhostdb \
  1474. mod_webdav \
  1475. mod_wstunnel \
  1476. "
  1477. lighty_track_feature() {
  1478. if eval "$3"; then
  1479. enable_feature="$enable_feature $1"
  1480. do_build="$do_build $2"
  1481. else
  1482. disable_feature="$disable_feature $1"
  1483. no_build="$no_build $2"
  1484. fi
  1485. }
  1486. lighty_track_feature "regex-conditionals" "" \
  1487. 'test "$WITH_PCRE" != no'
  1488. lighty_track_feature "storage-gdbm" "" \
  1489. 'test "$WITH_GDBM" != no'
  1490. lighty_track_feature "storage-memcached" "" \
  1491. 'test "$WITH_MEMCACHED" != no'
  1492. lighty_track_feature "" "mod_trigger_b4_dl" \
  1493. 'test "$BUILD_MOD_TRIGGER_B4_DL" != no'
  1494. lighty_track_feature "mysql" "mod_authn_mysql mod_mysql_vhost mod_vhostdb_mysql" \
  1495. 'test "$WITH_MYSQL" != no'
  1496. lighty_track_feature "postgresql" "mod_vhostdb_pgsql" \
  1497. 'test "$WITH_PGSQL" != no'
  1498. lighty_track_feature "dbi" "mod_authn_dbi mod_vhostdb_dbi" \
  1499. 'test "$WITH_DBI" != no'
  1500. lighty_track_feature "lua" "mod_cml mod_magnet" \
  1501. 'test "$WITH_LUA" != no'
  1502. lighty_track_feature "geoip" "mod_geoip" \
  1503. 'test "$WITH_GEOIP" != no'
  1504. lighty_track_feature "maxminddb" "mod_maxminddb" \
  1505. 'test "$WITH_MAXMINDDB" != no'
  1506. lighty_track_feature "compress-gzip compress-deflate" "" \
  1507. 'test "$WITH_ZLIB" != no'
  1508. lighty_track_feature "compress-bzip2" "" \
  1509. 'test "$WITH_BZIP2" != no'
  1510. lighty_track_feature "compress-brotli" "" \
  1511. 'test "$WITH_BROTLI" != no'
  1512. lighty_track_feature "kerberos" "mod_authn_gssapi" \
  1513. 'test "$WITH_KRB5" != no'
  1514. lighty_track_feature "ldap" "mod_authn_ldap mod_vhostdb_ldap" \
  1515. 'test "$WITH_LDAP" != no'
  1516. lighty_track_feature "pam" "mod_authn_pam" \
  1517. 'test "$WITH_PAM" != no'
  1518. lighty_track_feature "network-openssl" "mod_openssl" \
  1519. 'test "$WITH_OPENSSL" != no'
  1520. lighty_track_feature "network-mbedtls" "mod_mbedtls" \
  1521. 'test "$WITH_MBEDTLS" != no'
  1522. lighty_track_feature "network-gnutls" "mod_gnutls" \
  1523. 'test "$WITH_GNUTLS" != no'
  1524. lighty_track_feature "network-nss" "mod_nss" \
  1525. 'test "$WITH_NSS" != no'
  1526. lighty_track_feature "network-wolfssl" "mod_wolfssl" \
  1527. 'test "$WITH_WOLFSSL" != no'
  1528. lighty_track_feature "auth-crypt" "" \
  1529. 'test "$found_crypt" != no'
  1530. lighty_track_feature "network-ipv6" "" \
  1531. 'test "$ac_cv_ipv6_support" != no'
  1532. lighty_track_feature "large-files" "" \
  1533. 'test "$ENABLE_LFS" = yes'
  1534. lighty_track_feature "stat-cache-fam" "" \
  1535. 'test "$WITH_FAM" != no'
  1536. lighty_track_feature "webdav-properties" "" \
  1537. 'test "$WITH_WEBDAV_PROPS" != no'
  1538. lighty_track_feature "webdav-locks" "" \
  1539. 'test "$WITH_WEBDAV_LOCKS" != no'
  1540. dnl output
  1541. $ECHO
  1542. $ECHO "Plugins:"
  1543. $ECHO
  1544. $ECHO "enabled: "
  1545. for p in $do_build; do
  1546. $ECHO " $p"
  1547. done | sort
  1548. $ECHO "disabled: "
  1549. for p in $no_build; do
  1550. $ECHO " $p"
  1551. done | sort
  1552. $ECHO
  1553. $ECHO "Features:"
  1554. $ECHO
  1555. $ECHO "enabled: "
  1556. for p in $enable_feature; do
  1557. $ECHO " $p"
  1558. done | sort
  1559. $ECHO "disabled: "
  1560. for p in $disable_feature; do
  1561. $ECHO " $p"
  1562. done | sort
  1563. $ECHO