summaryrefslogtreecommitdiffstats
path: root/m4/mod_ssl.m4
blob: c431bceb4b044e0e4a01e95e5e7979c54fc05fd7 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
dnl CHECK_PATH_MOD_SSL([ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND]])
dnl Test for mod_ssl and openssl header directory.
dnl
AC_DEFUN(CHECK_PATH_MOD_SSL,
[dnl
AC_ARG_ENABLE(
		ssl,
		[AC_HELP_STRING([--enable-ssl],[Compile in SSL support])],
		ssl_val=yes,
		ssl_val=no
	)
AC_ARG_WITH(
		ssl-inc,
		[AC_HELP_STRING([--with-ssl-inc=DIR],[Location of SSL header files])],
		ssl_incdir="$withval",
	)
AC_ARG_WITH(
		db-inc,
		[AC_HELP_STRING([--with-db-inc=DIR],[Location of DB header files])],
		db_incdir="$withval",
		db_incdir="/usr/include/db1"
	)

	if test "x$ssl_val" = "xyes"; then
		ac_save_CFLAGS=$CFLAGS
		ac_save_CPPFLAGS=$CPPFLAGS
		MOD_SSL_CFLAGS="-I/usr/include/openssl"
		if test "x$ssl_incdir" != "x"; then
			MOD_SSL_CFLAGS="-I$ssl_incdir -I$ssl_incdir/openssl $MOD_SSL_CFLAGS"
		fi
		if test "x$db_incdir" != "x"; then
			MOD_SSL_CFLAGS="-I$db_incdir $MOD_SSL_CFLAGS"
		fi
		CFLAGS="$APACHE_CFLAGS $APACHE_CPPFLAGS $MOD_SSL_CFLAGS $CFLAGS"
		CPPFLAGS="$APACHE_CFLAGS $APACHE_CPPFLAGS $MOD_SSL_CFLAGS $CPPFLAGS"
		AC_CHECK_HEADERS([mod_ssl.h],
			mod_ssl_h=yes
		)
		CFLAGS=$ac_save_CFLAGS
		CPPFLAGS=$ac_save_CPPFLAGS
		if test "x$mod_ssl_h" = "x"; then
			ifelse([$2], , :, [$2])
		else
			AC_SUBST(MOD_SSL_CFLAGS)
			ifelse([$1], , :, [$1])
		fi
	else
		ifelse([$2], , :, [$2])
	fi
])