acinclude.m4.disablemods 18 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577
  1. dnl APACHE_HELP_STRING(LHS, RHS)
  2. dnl Autoconf 2.50 can not handle substr correctly. It does have
  3. dnl AC_HELP_STRING, so let's try to call it if we can.
  4. dnl Note: this define must be on one line so that it can be properly returned
  5. dnl as the help string.
  6. AC_DEFUN(APACHE_HELP_STRING,[ifelse(regexp(AC_ACVERSION, 2\.1), -1, AC_HELP_STRING($1,$2),[ ]$1 substr([ ],len($1))$2)])dnl
  7. dnl APACHE_SUBST(VARIABLE)
  8. dnl Makes VARIABLE available in generated files
  9. dnl (do not use @variable@ in Makefiles, but $(variable))
  10. AC_DEFUN(APACHE_SUBST,[
  11. APACHE_VAR_SUBST="$APACHE_VAR_SUBST $1"
  12. AC_SUBST($1)
  13. ])
  14. dnl APACHE_FAST_OUTPUT(FILENAME)
  15. dnl Perform substitutions on FILENAME (Makefiles only)
  16. AC_DEFUN(APACHE_FAST_OUTPUT,[
  17. APACHE_FAST_OUTPUT_FILES="$APACHE_FAST_OUTPUT_FILES $1"
  18. ])
  19. dnl APACHE_GEN_CONFIG_VARS
  20. dnl Creates config_vars.mk
  21. AC_DEFUN(APACHE_GEN_CONFIG_VARS,[
  22. APACHE_SUBST(abs_srcdir)
  23. APACHE_SUBST(bindir)
  24. APACHE_SUBST(sbindir)
  25. APACHE_SUBST(cgidir)
  26. APACHE_SUBST(logfiledir)
  27. APACHE_SUBST(exec_prefix)
  28. APACHE_SUBST(datadir)
  29. APACHE_SUBST(localstatedir)
  30. APACHE_SUBST(mandir)
  31. APACHE_SUBST(libdir)
  32. APACHE_SUBST(libexecdir)
  33. APACHE_SUBST(htdocsdir)
  34. APACHE_SUBST(manualdir)
  35. APACHE_SUBST(includedir)
  36. APACHE_SUBST(errordir)
  37. APACHE_SUBST(iconsdir)
  38. APACHE_SUBST(sysconfdir)
  39. APACHE_SUBST(installbuilddir)
  40. APACHE_SUBST(runtimedir)
  41. APACHE_SUBST(proxycachedir)
  42. APACHE_SUBST(other_targets)
  43. APACHE_SUBST(progname)
  44. APACHE_SUBST(prefix)
  45. APACHE_SUBST(AWK)
  46. APACHE_SUBST(CC)
  47. APACHE_SUBST(CPP)
  48. APACHE_SUBST(CXX)
  49. APACHE_SUBST(CPPFLAGS)
  50. APACHE_SUBST(CFLAGS)
  51. APACHE_SUBST(CXXFLAGS)
  52. APACHE_SUBST(LTFLAGS)
  53. APACHE_SUBST(LDFLAGS)
  54. APACHE_SUBST(LT_LDFLAGS)
  55. APACHE_SUBST(SH_LDFLAGS)
  56. APACHE_SUBST(HTTPD_LDFLAGS)
  57. APACHE_SUBST(UTIL_LDFLAGS)
  58. APACHE_SUBST(LIBS)
  59. APACHE_SUBST(DEFS)
  60. APACHE_SUBST(INCLUDES)
  61. APACHE_SUBST(NOTEST_CPPFLAGS)
  62. APACHE_SUBST(NOTEST_CFLAGS)
  63. APACHE_SUBST(NOTEST_CXXFLAGS)
  64. APACHE_SUBST(NOTEST_LDFLAGS)
  65. APACHE_SUBST(NOTEST_LIBS)
  66. APACHE_SUBST(EXTRA_CPPFLAGS)
  67. APACHE_SUBST(EXTRA_CFLAGS)
  68. APACHE_SUBST(EXTRA_CXXFLAGS)
  69. APACHE_SUBST(EXTRA_LDFLAGS)
  70. APACHE_SUBST(EXTRA_LIBS)
  71. APACHE_SUBST(EXTRA_INCLUDES)
  72. APACHE_SUBST(LIBTOOL)
  73. APACHE_SUBST(SHELL)
  74. APACHE_SUBST(RSYNC)
  75. APACHE_SUBST(MODULE_DIRS)
  76. APACHE_SUBST(MODULE_CLEANDIRS)
  77. APACHE_SUBST(PORT)
  78. APACHE_SUBST(SSLPORT)
  79. APACHE_SUBST(nonssl_listen_stmt_1)
  80. APACHE_SUBST(nonssl_listen_stmt_2)
  81. APACHE_SUBST(CORE_IMPLIB_FILE)
  82. APACHE_SUBST(CORE_IMPLIB)
  83. APACHE_SUBST(SH_LIBS)
  84. APACHE_SUBST(SH_LIBTOOL)
  85. APACHE_SUBST(MK_IMPLIB)
  86. APACHE_SUBST(MKDEP)
  87. APACHE_SUBST(INSTALL_PROG_FLAGS)
  88. APACHE_SUBST(DSO_MODULES)
  89. APACHE_SUBST(APR_BINDIR)
  90. APACHE_SUBST(APR_INCLUDEDIR)
  91. APACHE_SUBST(APR_VERSION)
  92. APACHE_SUBST(APR_CONFIG)
  93. APACHE_SUBST(APU_BINDIR)
  94. APACHE_SUBST(APU_INCLUDEDIR)
  95. APACHE_SUBST(APU_VERSION)
  96. APACHE_SUBST(APU_CONFIG)
  97. abs_srcdir="`(cd $srcdir && pwd)`"
  98. echo creating config_vars.mk
  99. test -d build || $mkdir_p build
  100. > build/config_vars.mk
  101. for i in $APACHE_VAR_SUBST; do
  102. eval echo "$i = \$$i" >> build/config_vars.mk
  103. done
  104. ])
  105. dnl APACHE_GEN_MAKEFILES
  106. dnl Creates Makefiles
  107. AC_DEFUN(APACHE_GEN_MAKEFILES,[
  108. $SHELL $srcdir/build/fastgen.sh $srcdir $ac_cv_mkdir_p $BSD_MAKEFILE $APACHE_FAST_OUTPUT_FILES
  109. ])
  110. dnl ## APACHE_OUTPUT(file)
  111. dnl ## adds "file" to the list of files generated by AC_OUTPUT
  112. dnl ## This macro can be used several times.
  113. AC_DEFUN(APACHE_OUTPUT, [
  114. APACHE_OUTPUT_FILES="$APACHE_OUTPUT_FILES $1"
  115. ])
  116. dnl
  117. dnl APACHE_TYPE_RLIM_T
  118. dnl
  119. dnl If rlim_t is not defined, define it to int
  120. dnl
  121. AC_DEFUN(APACHE_TYPE_RLIM_T, [
  122. AC_CACHE_CHECK([for rlim_t], ac_cv_type_rlim_t, [
  123. AC_TRY_COMPILE([
  124. #include <sys/types.h>
  125. #include <sys/time.h>
  126. #include <sys/resource.h>
  127. ], [rlim_t spoon;], [
  128. ac_cv_type_rlim_t=yes
  129. ],[ac_cv_type_rlim_t=no
  130. ])
  131. ])
  132. if test "$ac_cv_type_rlim_t" = "no" ; then
  133. AC_DEFINE(rlim_t, int,
  134. [Define to 'int' if <sys/resource.h> doesn't define it for us])
  135. fi
  136. ])
  137. dnl APACHE_MODPATH_INIT(modpath)
  138. AC_DEFUN(APACHE_MODPATH_INIT,[
  139. current_dir=$1
  140. modpath_current=modules/$1
  141. modpath_static=
  142. modpath_shared=
  143. test -d $1 || $srcdir/build/mkdir.sh $modpath_current
  144. > $modpath_current/modules.mk
  145. ])dnl
  146. dnl
  147. AC_DEFUN(APACHE_MODPATH_FINISH,[
  148. echo "DISTCLEAN_TARGETS = modules.mk" >> $modpath_current/modules.mk
  149. echo "static = $modpath_static" >> $modpath_current/modules.mk
  150. echo "shared = $modpath_shared" >> $modpath_current/modules.mk
  151. if test ! -z "$modpath_static" -o ! -z "$modpath_shared"; then
  152. MODULE_DIRS="$MODULE_DIRS $current_dir"
  153. else
  154. MODULE_CLEANDIRS="$MODULE_CLEANDIRS $current_dir"
  155. fi
  156. APACHE_FAST_OUTPUT($modpath_current/Makefile)
  157. ])dnl
  158. dnl
  159. dnl APACHE_MODPATH_ADD(name[, shared[, objects [, ldflags[, libs]]]])
  160. AC_DEFUN(APACHE_MODPATH_ADD,[
  161. if test -z "$3"; then
  162. objects="mod_$1.lo"
  163. else
  164. objects="$3"
  165. fi
  166. if test -z "$module_standalone"; then
  167. if test -z "$2"; then
  168. # The filename of a convenience library must have a "lib" prefix:
  169. libname="libmod_$1.la"
  170. BUILTIN_LIBS="$BUILTIN_LIBS $modpath_current/$libname"
  171. modpath_static="$modpath_static $libname"
  172. cat >>$modpath_current/modules.mk<<EOF
  173. $libname: $objects
  174. \$(MOD_LINK) $objects $5
  175. EOF
  176. else
  177. apache_need_shared=yes
  178. libname="mod_$1.la"
  179. shobjects=`echo $objects | sed 's/\.lo/.slo/g'`
  180. modpath_shared="$modpath_shared $libname"
  181. cat >>$modpath_current/modules.mk<<EOF
  182. $libname: $shobjects
  183. \$(SH_LINK) -rpath \$(libexecdir) -module -avoid-version $4 $objects $5
  184. EOF
  185. fi
  186. fi
  187. ])dnl
  188. dnl
  189. dnl APACHE_MODULE(name, helptext[, objects[, structname[, default[, config]]]])
  190. dnl
  191. dnl default is one of:
  192. dnl yes -- enabled by default. user must explicitly disable.
  193. dnl no -- disabled under default, most, all. user must explicitly enable.
  194. dnl most -- disabled by default. enabled explicitly or with most or all.
  195. dnl static -- enabled as static by default, must be explicitly changed.
  196. dnl "" -- disabled under default, most. enabled explicitly or with all.
  197. dnl
  198. dnl basically: yes/no is a hard setting. "most" means follow the "most"
  199. dnl setting. otherwise, fall under the "all" setting.
  200. dnl explicit yes/no always overrides.
  201. dnl
  202. AC_DEFUN(APACHE_MODULE,[
  203. AC_MSG_CHECKING(whether to enable mod_$1)
  204. define([optname],[--]ifelse($5,yes,disable,enable)[-]translit($1,_,-))dnl
  205. AC_ARG_ENABLE(translit($1,_,-),APACHE_HELP_STRING(optname(),$2),,enable_$1=ifelse($5,,maybe-all,$5))
  206. undefine([optname])dnl
  207. _apmod_extra_msg=""
  208. dnl When --enable-modules=most is set and the module was not explicitly
  209. dnl requested, allow a module to disable itself if its pre-reqs fail.
  210. if test "$module_selection" = "most" -a "$enable_$1" = "most"; then
  211. _apmod_error_fatal="no"
  212. else
  213. _apmod_error_fatal="yes"
  214. fi
  215. if test "$enable_$1" = "static"; then
  216. enable_$1=yes
  217. elif test "$enable_$1" = "yes"; then
  218. enable_$1=$module_default
  219. _apmod_extra_msg=" ($module_selection)"
  220. elif test "$enable_$1" = "most"; then
  221. if test "$module_selection" = "most" -o "$module_selection" = "all"; then
  222. enable_$1=$module_default
  223. _apmod_extra_msg=" ($module_selection)"
  224. elif test "$enable_$1" != "yes"; then
  225. enable_$1=no
  226. fi
  227. elif test "$enable_$1" = "maybe-all"; then
  228. if test "$module_selection" = "all"; then
  229. enable_$1=$module_default
  230. _apmod_extra_msg=" (all)"
  231. else
  232. enable_$1=no
  233. fi
  234. fi
  235. if test "$enable_$1" != "no"; then
  236. dnl If we plan to enable it, allow the module to run some autoconf magic
  237. dnl that may disable it because of missing dependencies.
  238. ifelse([$6],,:,[AC_MSG_RESULT([checking dependencies])
  239. $6
  240. AC_MSG_CHECKING(whether to enable mod_$1)
  241. if test "$enable_$1" = "no"; then
  242. if test "$_apmod_error_fatal" = "no"; then
  243. _apmod_extra_msg=" (disabled)"
  244. else
  245. AC_MSG_ERROR([mod_$1 has been requested but can not be built due to prerequisite failures])
  246. fi
  247. fi])
  248. fi
  249. AC_MSG_RESULT($enable_$1$_apmod_extra_msg)
  250. if test "$enable_$1" != "no"; then
  251. case "$enable_$1" in
  252. shared*)
  253. enable_$1=`echo $enable_$1|sed 's/shared,*//'`
  254. sharedobjs=yes
  255. shared=yes
  256. DSO_MODULES="$DSO_MODULES $1"
  257. ;;
  258. *)
  259. MODLIST="$MODLIST ifelse($4,,$1,$4)"
  260. if test "$1" = "so"; then
  261. sharedobjs=yes
  262. fi
  263. shared="";;
  264. esac
  265. define([modprefix], [MOD_]translit($1, [a-z-], [A-Z_]))
  266. APACHE_MODPATH_ADD($1, $shared, $3,, [\$(]modprefix[_LDADD)])
  267. APACHE_SUBST(modprefix[_LDADD])
  268. undefine([modprefix])
  269. fi
  270. ])dnl
  271. dnl
  272. dnl APACHE_ENABLE_MODULES
  273. dnl
  274. AC_DEFUN(APACHE_ENABLE_MODULES,[
  275. module_selection=default
  276. module_default=yes
  277. AC_ARG_ENABLE(modules,
  278. APACHE_HELP_STRING(--enable-modules=MODULE-LIST,Space-separated list of modules to enable | "all" | "most"),[
  279. for i in $enableval; do
  280. if test "$i" = "all" -o "$i" = "most"; then
  281. module_selection=$i
  282. else
  283. i=`echo $i | sed 's/-/_/g'`
  284. eval "enable_$i=yes"
  285. fi
  286. done
  287. ])
  288. AC_ARG_ENABLE(mods-shared,
  289. APACHE_HELP_STRING(--enable-mods-shared=MODULE-LIST,Space-separated list of shared modules to enable | "all" | "most"),[
  290. for i in $enableval; do
  291. if test "$i" = "all" -o "$i" = "most"; then
  292. module_selection=$i
  293. module_default=shared
  294. else
  295. i=`echo $i | sed 's/-/_/g'`
  296. eval "enable_$i=shared"
  297. fi
  298. done
  299. ])
  300. ])
  301. AC_DEFUN(APACHE_REQUIRE_CXX,[
  302. if test -z "$apache_cxx_done"; then
  303. AC_PROG_CXX
  304. AC_PROG_CXXCPP
  305. apache_cxx_done=yes
  306. fi
  307. ])
  308. dnl
  309. dnl APACHE_CHECK_SSL_TOOLKIT
  310. dnl
  311. dnl Configure for the detected openssl/ssl-c toolkit installation, giving
  312. dnl preference to "--with-ssl=<path>" if it was specified.
  313. dnl
  314. AC_DEFUN(APACHE_CHECK_SSL_TOOLKIT,[
  315. if test "x$ap_ssltk_configured" = "x"; then
  316. dnl initialise the variables we use
  317. ap_ssltk_base=""
  318. ap_ssltk_libs=""
  319. ap_ssltk_type=""
  320. dnl Determine the SSL/TLS toolkit's base directory, if any
  321. AC_MSG_CHECKING([for SSL/TLS toolkit base])
  322. AC_ARG_WITH(sslc, APACHE_HELP_STRING(--with-sslc=DIR,RSA SSL-C SSL/TLS toolkit), [
  323. dnl If --with-sslc specifies a directory, we use that directory or fail
  324. if test "x$withval" != "xyes" -a "x$withval" != "x"; then
  325. dnl This ensures $withval is actually a directory and that it is absolute
  326. ap_ssltk_base="`cd $withval ; pwd`"
  327. fi
  328. ap_ssltk_type="sslc"
  329. ])
  330. AC_ARG_WITH(ssl, APACHE_HELP_STRING(--with-ssl=DIR,OpenSSL SSL/TLS toolkit), [
  331. dnl If --with-ssl specifies a directory, we use that directory or fail
  332. if test "x$withval" != "xyes" -a "x$withval" != "x"; then
  333. dnl This ensures $withval is actually a directory and that it is absolute
  334. ap_ssltk_base="`cd $withval ; pwd`"
  335. fi
  336. ])
  337. if test "x$ap_ssltk_base" = "x"; then
  338. AC_MSG_RESULT(none)
  339. else
  340. AC_MSG_RESULT($ap_ssltk_base)
  341. fi
  342. dnl Run header and version checks
  343. saved_CPPFLAGS="$CPPFLAGS"
  344. saved_LIBS="$LIBS"
  345. if test "x$ap_ssltk_base" != "x"; then
  346. APR_ADDTO(CPPFLAGS, [-I$ap_ssltk_base/include])
  347. APR_ADDTO(INCLUDES, [-I$ap_ssltk_base/include])
  348. APR_ADDTO(LDFLAGS, [-L$ap_ssltk_base/lib])
  349. if test "x$ap_platform_runtime_link_flag" != "x"; then
  350. APR_ADDTO(LDFLAGS, [$ap_platform_runtime_link_flag$ap_ssltk_base/lib])
  351. fi
  352. fi
  353. if test "x$ap_ssltk_type" = "x"; then
  354. AC_MSG_CHECKING([for OpenSSL version])
  355. dnl First check for manditory headers
  356. AC_CHECK_HEADERS([openssl/opensslv.h openssl/ssl.h], [ap_ssltk_type="openssl"], [])
  357. if test "$ap_ssltk_type" = "openssl"; then
  358. dnl so it's OpenSSL - test for a good version
  359. AC_TRY_COMPILE([#include <openssl/opensslv.h>],[
  360. #if !defined(OPENSSL_VERSION_NUMBER)
  361. #error "Missing openssl version"
  362. #endif
  363. #if (OPENSSL_VERSION_NUMBER < 0x009060af) \
  364. || ((OPENSSL_VERSION_NUMBER > 0x00907000) && (OPENSSL_VERSION_NUMBER < 0x0090702f))
  365. #error "Insecure openssl version " OPENSSL_VERSION_TEXT
  366. #endif],
  367. [AC_MSG_RESULT(OK)],
  368. [dnl Replace this with OPENSSL_VERSION_TEXT from opensslv.h?
  369. AC_MSG_RESULT([not encouraging])
  370. echo "WARNING: OpenSSL version may contain security vulnerabilities!"
  371. echo " Ensure the latest security patches have been applied!"
  372. ])
  373. else
  374. AC_MSG_RESULT([no OpenSSL headers found])
  375. fi
  376. fi
  377. if test "$ap_ssltk_type" != "openssl"; then
  378. dnl Might be SSL-C - report, then test anything relevant
  379. AC_MSG_CHECKING([for SSL-C version])
  380. AC_CHECK_HEADERS([sslc.h], [ap_ssltk_type="sslc"], [ap_ssltk_type=""])
  381. if test "$ap_ssltk_type" = "sslc"; then
  382. ap_ssltk_libs="-lsslc"
  383. AC_MSG_CHECKING([for SSL-C version])
  384. AC_TRY_COMPILE([#include <sslc.h>],[
  385. #if !defined(SSLC_VERSION_NUMBER)
  386. #error "Missing SSL-C version"
  387. #endif
  388. #if SSLC_VERSION_NUMBER < 0x2310
  389. #define stringize_ver(x) #x
  390. #error "Insecure SSL-C version " stringize_ver(SSLC_VERSION_NUMBER)
  391. #endif],
  392. [AC_MSG_RESULT(OK)],
  393. [dnl Replace this with SSLC_VERSION_NUMBER?
  394. AC_MSG_RESULT([not encouraging])
  395. echo "WARNING: SSL-C version may contain security vulnerabilities!"
  396. echo " Ensure the latest security patches have been applied!"
  397. ])
  398. else
  399. AC_MSG_RESULT([no SSL-C headers found])
  400. fi
  401. fi
  402. if test "x$ap_ssltk_type" = "x"; then
  403. AC_MSG_ERROR([...No recognized SSL/TLS toolkit detected])
  404. fi
  405. if test "$ap_ssltk_type" = "openssl"; then
  406. if test "x$ap_ssltk_base" != "x" -a \
  407. -f "${ap_ssltk_base}/lib/pkgconfig/openssl.pc"; then
  408. dnl Ensure that the given path is used by pkg-config too, otherwise
  409. dnl the system openssl.pc might be picked up instead.
  410. PKG_CONFIG_PATH="${ap_ssltk_base}/lib/pkgconfig${PKG_CONFIG_PATH+:}${PKG_CONFIG_PATH}"
  411. export PKG_CONFIG_PATH
  412. fi
  413. if test -n "$PKGCONFIG"; then
  414. ap_ssltk_libs="`$PKGCONFIG --libs-only-l openssl`"
  415. if test $? -eq 0; then
  416. pkglookup="`$PKGCONFIG --cflags-only-I openssl`"
  417. APR_ADDTO(CPPFLAGS, [$pkglookup])
  418. APR_ADDTO(INCLUDES, [$pkglookup])
  419. pkglookup="`$PKGCONFIG --libs-only-L --libs-only-other openssl`"
  420. APR_ADDTO(LDFLAGS, [$pkglookup])
  421. else
  422. ap_ssltk_libs="-lssl -lcrypto `$apr_config --libs`"
  423. fi
  424. else
  425. ap_ssltk_libs="-lssl -lcrypto `$apr_config --libs`"
  426. fi
  427. fi
  428. APR_SETVAR(SSL_LIBS, [$ap_ssltk_libs])
  429. APR_ADDTO(LIBS, [$ap_ssltk_libs])
  430. APACHE_SUBST(SSL_LIBS)
  431. dnl Run library and function checks
  432. liberrors=""
  433. if test "$ap_ssltk_type" = "openssl"; then
  434. AC_CHECK_HEADERS([openssl/engine.h])
  435. AC_CHECK_FUNCS([SSLeay_version SSL_CTX_new], [], [liberrors="yes"])
  436. AC_CHECK_FUNCS([ENGINE_init ENGINE_load_builtin_engines])
  437. else
  438. AC_CHECK_FUNCS([SSLC_library_version SSL_CTX_new], [], [liberrors="yes"])
  439. AC_CHECK_FUNCS(SSL_set_state)
  440. fi
  441. AC_CHECK_FUNCS(SSL_set_cert_store)
  442. dnl restore
  443. CPPFLAGS="$saved_CPPFLAGS"
  444. LIBS="$saved_LIBS"
  445. if test "x$liberrors" != "x"; then
  446. AC_MSG_ERROR([... Error, SSL/TLS libraries were missing or unusable])
  447. fi
  448. dnl Adjust apache's configuration based on what we found above.
  449. dnl (a) define preprocessor symbols
  450. if test "$ap_ssltk_type" = "openssl"; then
  451. AC_DEFINE(HAVE_OPENSSL, 1, [Define if SSL is supported using OpenSSL])
  452. else
  453. AC_DEFINE(HAVE_SSLC, 1, [Define if SSL is supported using SSL-C])
  454. fi
  455. fi
  456. ])
  457. dnl
  458. dnl APACHE_EXPORT_ARGUMENTS
  459. dnl Export (via APACHE_SUBST) the various path-related variables that
  460. dnl apache will use while generating scripts like autoconf and apxs and
  461. dnl the default config file.
  462. AC_DEFUN(APACHE_SUBST_EXPANDED_ARG,[
  463. APR_EXPAND_VAR(exp_$1, [$]$1)
  464. APACHE_SUBST(exp_$1)
  465. APR_PATH_RELATIVE(rel_$1, [$]exp_$1, ${prefix})
  466. APACHE_SUBST(rel_$1)
  467. ])
  468. AC_DEFUN(APACHE_EXPORT_ARGUMENTS,[
  469. APACHE_SUBST_EXPANDED_ARG(exec_prefix)
  470. APACHE_SUBST_EXPANDED_ARG(bindir)
  471. APACHE_SUBST_EXPANDED_ARG(sbindir)
  472. APACHE_SUBST_EXPANDED_ARG(libdir)
  473. APACHE_SUBST_EXPANDED_ARG(libexecdir)
  474. APACHE_SUBST_EXPANDED_ARG(mandir)
  475. APACHE_SUBST_EXPANDED_ARG(sysconfdir)
  476. APACHE_SUBST_EXPANDED_ARG(datadir)
  477. APACHE_SUBST_EXPANDED_ARG(installbuilddir)
  478. APACHE_SUBST_EXPANDED_ARG(errordir)
  479. APACHE_SUBST_EXPANDED_ARG(iconsdir)
  480. APACHE_SUBST_EXPANDED_ARG(htdocsdir)
  481. APACHE_SUBST_EXPANDED_ARG(manualdir)
  482. APACHE_SUBST_EXPANDED_ARG(cgidir)
  483. APACHE_SUBST_EXPANDED_ARG(includedir)
  484. APACHE_SUBST_EXPANDED_ARG(localstatedir)
  485. APACHE_SUBST_EXPANDED_ARG(runtimedir)
  486. APACHE_SUBST_EXPANDED_ARG(logfiledir)
  487. APACHE_SUBST_EXPANDED_ARG(proxycachedir)
  488. ])
  489. dnl
  490. dnl APACHE_CHECK_APxVER({apr|apu}, major, minor,
  491. dnl [actions-if-ok], [actions-if-not-ok])
  492. dnl
  493. dnl Checks for APR or APR-util of given major/minor version or later;
  494. dnl if so, runs actions-if-ok; otherwise runs actions-if-not-ok if given.
  495. dnl If the version is not satisfactory and actions-if-not-ok is not
  496. dnl given, then an error is printed and the configure script is aborted.
  497. dnl
  498. dnl The first argument must be [apr] or [apu].
  499. dnl
  500. AC_DEFUN([APACHE_CHECK_APxVER], [
  501. define(ap_ckver_major, translit($1, [apru], [APRU])[_MAJOR_VERSION])
  502. define(ap_ckver_minor, translit($1, [apru], [APRU])[_MINOR_VERSION])
  503. define(ap_ckver_cvar, [ap_cv_$1ver$2$3])
  504. define(ap_ckver_name, ifelse([$1],[apr],[APR],[APR-util]))
  505. ap_ckver_CPPFLAGS="$CPPFLAGS"
  506. CPPFLAGS="$CPPFLAGS `$[$1]_config --includes`"
  507. AC_CACHE_CHECK([for ap_ckver_name version $2.$3.0 or later], ap_ckver_cvar, [
  508. AC_EGREP_CPP([good], [
  509. #include <$1_version.h>
  510. #if ]ap_ckver_major[ > $2 || (]ap_ckver_major[ == $2 && ]ap_ckver_minor[ >= $3)
  511. good
  512. #endif
  513. ], [ap_ckver_cvar=yes], [ap_ckver_cvar=no])])
  514. if test "$ap_ckver_cvar" = "yes"; then
  515. ifelse([$4],[],[:],[$4])
  516. else
  517. ifelse([$5],[],[AC_MSG_ERROR([ap_ckver_name version $2.$3.0 or later is required])], [$5])
  518. fi
  519. CPPFLAGS="$ap_ckver_CPPFLAGS"
  520. undefine([ap_ckver_major])
  521. undefine([ap_ckver_minor])
  522. undefine([ap_ckver_cvar])
  523. undefine([ap_ckver_name])
  524. ])
  525. dnl
  526. dnl APACHE_CHECK_VOID_PTR_LEN
  527. dnl
  528. dnl Checks if the size of a void pointer is at least as big as a "long"
  529. dnl integer type.
  530. dnl
  531. AC_DEFUN([APACHE_CHECK_VOID_PTR_LEN], [
  532. AC_CACHE_CHECK([for void pointer length], [ap_cv_void_ptr_lt_long],
  533. [AC_TRY_RUN([
  534. int main(void)
  535. {
  536. return sizeof(void *) < sizeof(long);
  537. }], [ap_cv_void_ptr_lt_long=no], [ap_cv_void_ptr_lt_long=yes],
  538. [ap_cv_void_ptr_lt_long=yes])])
  539. if test "$ap_cv_void_ptr_lt_long" = "yes"; then
  540. AC_MSG_ERROR([Size of "void *" is less than size of "long"])
  541. fi
  542. ])