acinclude.m4 18 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582
  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. if test "$enableval" = "none"; then
  280. module_default=no
  281. module_selection=none
  282. else
  283. for i in $enableval; do
  284. if test "$i" = "all" -o "$i" = "most"; then
  285. module_selection=$i
  286. else
  287. i=`echo $i | sed 's/-/_/g'`
  288. eval "enable_$i=yes"
  289. fi
  290. done
  291. fi
  292. ])
  293. AC_ARG_ENABLE(mods-shared,
  294. APACHE_HELP_STRING(--enable-mods-shared=MODULE-LIST,Space-separated list of shared modules to enable | "all" | "most"),[
  295. for i in $enableval; do
  296. if test "$i" = "all" -o "$i" = "most"; then
  297. module_selection=$i
  298. module_default=shared
  299. else
  300. i=`echo $i | sed 's/-/_/g'`
  301. eval "enable_$i=shared"
  302. fi
  303. done
  304. ])
  305. ])
  306. AC_DEFUN(APACHE_REQUIRE_CXX,[
  307. if test -z "$apache_cxx_done"; then
  308. AC_PROG_CXX
  309. AC_PROG_CXXCPP
  310. apache_cxx_done=yes
  311. fi
  312. ])
  313. dnl
  314. dnl APACHE_CHECK_SSL_TOOLKIT
  315. dnl
  316. dnl Configure for the detected openssl/ssl-c toolkit installation, giving
  317. dnl preference to "--with-ssl=<path>" if it was specified.
  318. dnl
  319. AC_DEFUN(APACHE_CHECK_SSL_TOOLKIT,[
  320. if test "x$ap_ssltk_configured" = "x"; then
  321. dnl initialise the variables we use
  322. ap_ssltk_base=""
  323. ap_ssltk_libs=""
  324. ap_ssltk_type=""
  325. dnl Determine the SSL/TLS toolkit's base directory, if any
  326. AC_MSG_CHECKING([for SSL/TLS toolkit base])
  327. AC_ARG_WITH(sslc, APACHE_HELP_STRING(--with-sslc=DIR,RSA SSL-C SSL/TLS toolkit), [
  328. dnl If --with-sslc specifies a directory, we use that directory or fail
  329. if test "x$withval" != "xyes" -a "x$withval" != "x"; then
  330. dnl This ensures $withval is actually a directory and that it is absolute
  331. ap_ssltk_base="`cd $withval ; pwd`"
  332. fi
  333. ap_ssltk_type="sslc"
  334. ])
  335. AC_ARG_WITH(ssl, APACHE_HELP_STRING(--with-ssl=DIR,OpenSSL SSL/TLS toolkit), [
  336. dnl If --with-ssl specifies a directory, we use that directory or fail
  337. if test "x$withval" != "xyes" -a "x$withval" != "x"; then
  338. dnl This ensures $withval is actually a directory and that it is absolute
  339. ap_ssltk_base="`cd $withval ; pwd`"
  340. fi
  341. ])
  342. if test "x$ap_ssltk_base" = "x"; then
  343. AC_MSG_RESULT(none)
  344. else
  345. AC_MSG_RESULT($ap_ssltk_base)
  346. fi
  347. dnl Run header and version checks
  348. saved_CPPFLAGS="$CPPFLAGS"
  349. saved_LIBS="$LIBS"
  350. if test "x$ap_ssltk_base" != "x"; then
  351. APR_ADDTO(CPPFLAGS, [-I$ap_ssltk_base/include])
  352. APR_ADDTO(INCLUDES, [-I$ap_ssltk_base/include])
  353. APR_ADDTO(LDFLAGS, [-L$ap_ssltk_base/lib])
  354. if test "x$ap_platform_runtime_link_flag" != "x"; then
  355. APR_ADDTO(LDFLAGS, [$ap_platform_runtime_link_flag$ap_ssltk_base/lib])
  356. fi
  357. fi
  358. if test "x$ap_ssltk_type" = "x"; then
  359. AC_MSG_CHECKING([for OpenSSL version])
  360. dnl First check for manditory headers
  361. AC_CHECK_HEADERS([openssl/opensslv.h openssl/ssl.h], [ap_ssltk_type="openssl"], [])
  362. if test "$ap_ssltk_type" = "openssl"; then
  363. dnl so it's OpenSSL - test for a good version
  364. AC_TRY_COMPILE([#include <openssl/opensslv.h>],[
  365. #if !defined(OPENSSL_VERSION_NUMBER)
  366. #error "Missing openssl version"
  367. #endif
  368. #if (OPENSSL_VERSION_NUMBER < 0x009060af) \
  369. || ((OPENSSL_VERSION_NUMBER > 0x00907000) && (OPENSSL_VERSION_NUMBER < 0x0090702f))
  370. #error "Insecure openssl version " OPENSSL_VERSION_TEXT
  371. #endif],
  372. [AC_MSG_RESULT(OK)],
  373. [dnl Replace this with OPENSSL_VERSION_TEXT from opensslv.h?
  374. AC_MSG_RESULT([not encouraging])
  375. echo "WARNING: OpenSSL version may contain security vulnerabilities!"
  376. echo " Ensure the latest security patches have been applied!"
  377. ])
  378. else
  379. AC_MSG_RESULT([no OpenSSL headers found])
  380. fi
  381. fi
  382. if test "$ap_ssltk_type" != "openssl"; then
  383. dnl Might be SSL-C - report, then test anything relevant
  384. AC_MSG_CHECKING([for SSL-C version])
  385. AC_CHECK_HEADERS([sslc.h], [ap_ssltk_type="sslc"], [ap_ssltk_type=""])
  386. if test "$ap_ssltk_type" = "sslc"; then
  387. ap_ssltk_libs="-lsslc"
  388. AC_MSG_CHECKING([for SSL-C version])
  389. AC_TRY_COMPILE([#include <sslc.h>],[
  390. #if !defined(SSLC_VERSION_NUMBER)
  391. #error "Missing SSL-C version"
  392. #endif
  393. #if SSLC_VERSION_NUMBER < 0x2310
  394. #define stringize_ver(x) #x
  395. #error "Insecure SSL-C version " stringize_ver(SSLC_VERSION_NUMBER)
  396. #endif],
  397. [AC_MSG_RESULT(OK)],
  398. [dnl Replace this with SSLC_VERSION_NUMBER?
  399. AC_MSG_RESULT([not encouraging])
  400. echo "WARNING: SSL-C version may contain security vulnerabilities!"
  401. echo " Ensure the latest security patches have been applied!"
  402. ])
  403. else
  404. AC_MSG_RESULT([no SSL-C headers found])
  405. fi
  406. fi
  407. if test "x$ap_ssltk_type" = "x"; then
  408. AC_MSG_ERROR([...No recognized SSL/TLS toolkit detected])
  409. fi
  410. if test "$ap_ssltk_type" = "openssl"; then
  411. if test "x$ap_ssltk_base" != "x" -a \
  412. -f "${ap_ssltk_base}/lib/pkgconfig/openssl.pc"; then
  413. dnl Ensure that the given path is used by pkg-config too, otherwise
  414. dnl the system openssl.pc might be picked up instead.
  415. PKG_CONFIG_PATH="${ap_ssltk_base}/lib/pkgconfig${PKG_CONFIG_PATH+:}${PKG_CONFIG_PATH}"
  416. export PKG_CONFIG_PATH
  417. fi
  418. if test -n "$PKGCONFIG"; then
  419. ap_ssltk_libs="`$PKGCONFIG --libs-only-l openssl`"
  420. if test $? -eq 0; then
  421. pkglookup="`$PKGCONFIG --cflags-only-I openssl`"
  422. APR_ADDTO(CPPFLAGS, [$pkglookup])
  423. APR_ADDTO(INCLUDES, [$pkglookup])
  424. pkglookup="`$PKGCONFIG --libs-only-L --libs-only-other openssl`"
  425. APR_ADDTO(LDFLAGS, [$pkglookup])
  426. else
  427. ap_ssltk_libs="-lssl -lcrypto `$apr_config --libs`"
  428. fi
  429. else
  430. ap_ssltk_libs="-lssl -lcrypto `$apr_config --libs`"
  431. fi
  432. fi
  433. APR_SETVAR(SSL_LIBS, [$ap_ssltk_libs])
  434. APR_ADDTO(LIBS, [$ap_ssltk_libs])
  435. APACHE_SUBST(SSL_LIBS)
  436. dnl Run library and function checks
  437. liberrors=""
  438. if test "$ap_ssltk_type" = "openssl"; then
  439. AC_CHECK_HEADERS([openssl/engine.h])
  440. AC_CHECK_FUNCS([SSLeay_version SSL_CTX_new], [], [liberrors="yes"])
  441. AC_CHECK_FUNCS([ENGINE_init ENGINE_load_builtin_engines])
  442. else
  443. AC_CHECK_FUNCS([SSLC_library_version SSL_CTX_new], [], [liberrors="yes"])
  444. AC_CHECK_FUNCS(SSL_set_state)
  445. fi
  446. AC_CHECK_FUNCS(SSL_set_cert_store)
  447. dnl restore
  448. CPPFLAGS="$saved_CPPFLAGS"
  449. LIBS="$saved_LIBS"
  450. if test "x$liberrors" != "x"; then
  451. AC_MSG_ERROR([... Error, SSL/TLS libraries were missing or unusable])
  452. fi
  453. dnl Adjust apache's configuration based on what we found above.
  454. dnl (a) define preprocessor symbols
  455. if test "$ap_ssltk_type" = "openssl"; then
  456. AC_DEFINE(HAVE_OPENSSL, 1, [Define if SSL is supported using OpenSSL])
  457. else
  458. AC_DEFINE(HAVE_SSLC, 1, [Define if SSL is supported using SSL-C])
  459. fi
  460. fi
  461. ])
  462. dnl
  463. dnl APACHE_EXPORT_ARGUMENTS
  464. dnl Export (via APACHE_SUBST) the various path-related variables that
  465. dnl apache will use while generating scripts like autoconf and apxs and
  466. dnl the default config file.
  467. AC_DEFUN(APACHE_SUBST_EXPANDED_ARG,[
  468. APR_EXPAND_VAR(exp_$1, [$]$1)
  469. APACHE_SUBST(exp_$1)
  470. APR_PATH_RELATIVE(rel_$1, [$]exp_$1, ${prefix})
  471. APACHE_SUBST(rel_$1)
  472. ])
  473. AC_DEFUN(APACHE_EXPORT_ARGUMENTS,[
  474. APACHE_SUBST_EXPANDED_ARG(exec_prefix)
  475. APACHE_SUBST_EXPANDED_ARG(bindir)
  476. APACHE_SUBST_EXPANDED_ARG(sbindir)
  477. APACHE_SUBST_EXPANDED_ARG(libdir)
  478. APACHE_SUBST_EXPANDED_ARG(libexecdir)
  479. APACHE_SUBST_EXPANDED_ARG(mandir)
  480. APACHE_SUBST_EXPANDED_ARG(sysconfdir)
  481. APACHE_SUBST_EXPANDED_ARG(datadir)
  482. APACHE_SUBST_EXPANDED_ARG(installbuilddir)
  483. APACHE_SUBST_EXPANDED_ARG(errordir)
  484. APACHE_SUBST_EXPANDED_ARG(iconsdir)
  485. APACHE_SUBST_EXPANDED_ARG(htdocsdir)
  486. APACHE_SUBST_EXPANDED_ARG(manualdir)
  487. APACHE_SUBST_EXPANDED_ARG(cgidir)
  488. APACHE_SUBST_EXPANDED_ARG(includedir)
  489. APACHE_SUBST_EXPANDED_ARG(localstatedir)
  490. APACHE_SUBST_EXPANDED_ARG(runtimedir)
  491. APACHE_SUBST_EXPANDED_ARG(logfiledir)
  492. APACHE_SUBST_EXPANDED_ARG(proxycachedir)
  493. ])
  494. dnl
  495. dnl APACHE_CHECK_APxVER({apr|apu}, major, minor,
  496. dnl [actions-if-ok], [actions-if-not-ok])
  497. dnl
  498. dnl Checks for APR or APR-util of given major/minor version or later;
  499. dnl if so, runs actions-if-ok; otherwise runs actions-if-not-ok if given.
  500. dnl If the version is not satisfactory and actions-if-not-ok is not
  501. dnl given, then an error is printed and the configure script is aborted.
  502. dnl
  503. dnl The first argument must be [apr] or [apu].
  504. dnl
  505. AC_DEFUN([APACHE_CHECK_APxVER], [
  506. define(ap_ckver_major, translit($1, [apru], [APRU])[_MAJOR_VERSION])
  507. define(ap_ckver_minor, translit($1, [apru], [APRU])[_MINOR_VERSION])
  508. define(ap_ckver_cvar, [ap_cv_$1ver$2$3])
  509. define(ap_ckver_name, ifelse([$1],[apr],[APR],[APR-util]))
  510. ap_ckver_CPPFLAGS="$CPPFLAGS"
  511. CPPFLAGS="$CPPFLAGS `$[$1]_config --includes`"
  512. AC_CACHE_CHECK([for ap_ckver_name version $2.$3.0 or later], ap_ckver_cvar, [
  513. AC_EGREP_CPP([good], [
  514. #include <$1_version.h>
  515. #if ]ap_ckver_major[ > $2 || (]ap_ckver_major[ == $2 && ]ap_ckver_minor[ >= $3)
  516. good
  517. #endif
  518. ], [ap_ckver_cvar=yes], [ap_ckver_cvar=no])])
  519. if test "$ap_ckver_cvar" = "yes"; then
  520. ifelse([$4],[],[:],[$4])
  521. else
  522. ifelse([$5],[],[AC_MSG_ERROR([ap_ckver_name version $2.$3.0 or later is required])], [$5])
  523. fi
  524. CPPFLAGS="$ap_ckver_CPPFLAGS"
  525. undefine([ap_ckver_major])
  526. undefine([ap_ckver_minor])
  527. undefine([ap_ckver_cvar])
  528. undefine([ap_ckver_name])
  529. ])
  530. dnl
  531. dnl APACHE_CHECK_VOID_PTR_LEN
  532. dnl
  533. dnl Checks if the size of a void pointer is at least as big as a "long"
  534. dnl integer type.
  535. dnl
  536. AC_DEFUN([APACHE_CHECK_VOID_PTR_LEN], [
  537. AC_CACHE_CHECK([for void pointer length], [ap_cv_void_ptr_lt_long],
  538. [AC_TRY_RUN([
  539. int main(void)
  540. {
  541. return sizeof(void *) < sizeof(long);
  542. }], [ap_cv_void_ptr_lt_long=no], [ap_cv_void_ptr_lt_long=yes],
  543. [ap_cv_void_ptr_lt_long=yes])])
  544. if test "$ap_cv_void_ptr_lt_long" = "yes"; then
  545. AC_MSG_ERROR([Size of "void *" is less than size of "long"])
  546. fi
  547. ])