-
Notifications
You must be signed in to change notification settings - Fork 21
/
configure.ac
90 lines (80 loc) · 2.7 KB
/
configure.ac
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
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
AC_INIT(mod_psgi, 0.0.1, [email protected])
AC_ARG_WITH(apxs, AC_HELP_STRING([--with-apxs=NAME],
[name of the apxs executable [[apxs]]]),
[APXS="$with_apxs"])
if test -z "${APXS}"; then
AC_PATH_PROGS(APXS, apxs2 apxs, no, [$PATH:/usr/sbin:/usr/local/apache2/bin])
fi
if test "$APXS" = no; then
AC_MSG_ERROR([apxs not found. set apxs with --with-apxs.])
fi
AC_SUBST(APXS)
AP_INSTALLBUILDDIR=`$APXS -q installbuilddir`
AP_TOP_BUILDDIR=`dirname $AP_INSTALLBUILDDIR`
AP_TOP_SRCDIR=$AP_TOP_BUILDDIR
AC_SUBST(AP_INSTALLBUILDDIR)
AC_SUBST(AP_TOP_BUILDDIR)
AC_SUBST(AP_TOP_SRCDIR)
AC_ARG_WITH(apachectl, AC_HELP_STRING([--with-apachectl=NAME],
[name of the apachectl executable [[apachectl]]]),
[APACHECTL="$with_apachectl"])
if test -z "${APACHECTL}"; then
AC_PATH_PROGS(APACHECTL, apache2ctl apachectl, no, [$PATH:/usr/sbin:/usr/local/apache2/bin])
fi
if test "$APACHECTL" = no; then
AC_MSG_ERROR([apachectl not found. set apachectl with --with-apachectl.])
fi
AC_SUBST(APACHECTL)
AC_ARG_WITH(perl, AC_HELP_STRING([--with-perl=NAME],
[name of the perl executable [[perl]]]),
[PERL="$with_perl"])
if test -z "${PERL}"; then
AC_PATH_PROG(PERL, perl, no, [$PATH])
fi
if test "$PERL" = no; then
AC_MSG_ERROR([perl not found. set perl with --with-perl.])
fi
AC_SUBST(PERL)
HAS_EXTUTILS_EMBED=`$PERL -MExtUtils::Embed -e 'print "yes"'`
if test "$HAS_EXTUTILS_EMBED" != "yes"; then
AC_MSG_ERROR([ExtUtils::Embed not found. Please install it.])
fi
PERL_CCOPTS=`$PERL -MExtUtils::Embed -e ccopts | sed -e 's/-D_FILE_OFFSET_BITS=64//'`
PERL_LDOPTS=`$PERL -MExtUtils::Embed -e ldopts`
AC_SUBST(PERL_CCOPTS)
AC_SUBST(PERL_LDOPTS)
AC_ARG_WITH(prove, AC_HELP_STRING([--with-prove=NAME],
[name of the prove executable [[prove]]]),
[PROVE="$with_prove"])
if test -z "${PROVE}"; then
AC_PATH_PROG(PROVE, prove, no, [$PATH])
fi
if test "$PROVE" = no; then
PROVE="prove"
fi
AC_SUBST(PROVE)
AC_ARG_ENABLE(debug, AC_HELP_STRING([--enable-debug],
[enable debug mode]),
[ENABLE_DEBUG="$enable_debug"],
[ENABLE_DEBUG="no"])
AP_LIBTOOL=`$APXS -q LIBTOOL`
eval `$AP_LIBTOOL --config | grep "^CC"`
if test "$CC" = "gcc"; then
EXTRA_CFLAGS="-Wall"
if test "$ENABLE_DEBUG" = "yes"; then
EXTRA_CFLAGS+=" -O0 -g"
DEBUG_DEFS="-DMOD_PSGI_DEBUG"
AC_SUBST(DEBUG_DEFS)
fi
AC_SUBST(EXTRA_CFLAGS)
fi
AC_OUTPUT([Makefile t/Config.pm])
echo "
$PACKAGE_NAME $PACKAGE_VERSION configuration:
-----------------------
apxs: ${APXS}
apachectl: ${APACHECTL}
perl: ${PERL}
prove ${PROVE}
Now type 'make' to build $PACKAGE_NAME $PACKAGE_VERSION!
"