1
dnl vim: set sw=4 expandtab :
3
dnl Copyright 2007 GRAHAM DUMPLETON
5
dnl Licensed under the Apache License, Version 2.0 (the "License");
6
dnl you may not use this file except in compliance with the License.
7
dnl You may obtain a copy of the License at
9
dnl http://www.apache.org/licenses/LICENSE-2.0
11
dnl Unless required by applicable law or agreed to in writing, software
12
dnl distributed under the License is distributed on an "AS IS" BASIS,
13
dnl WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
dnl See the License for the specific language governing permissions and
15
dnl limitations under the License.
17
dnl Process this file with autoconf to produce a configure script.
21
AC_ARG_WITH(apxs, AC_HELP_STRING([--with-apxs=NAME],
22
[name of the apxs executable [[apxs]]]),
25
if test -z "${APXS}"; then
26
AC_PATH_PROGS(APXS, apxs2 apxs, [apxs],
27
[$PATH:/usr/local/apache/bin:/usr/sbin])
32
AC_ARG_WITH(python, AC_HELP_STRING([--with-python=NAME],
33
[name of the python executable [[python]]]),
34
[PYTHON="$with_python"])
36
if test -z "${PYTHON}"; then
37
AC_PATH_PROGS(PYTHON, python, [python],
38
[$PATH:/usr/local/bin])
43
PYTHON_VERSION=`${PYTHON} -c 'from distutils import sysconfig; \
44
print sysconfig.get_config_var("VERSION")'`
46
CPPFLAGS1=`${PYTHON} -c 'from distutils import sysconfig; \
47
print "-I" + sysconfig.get_config_var("INCLUDEPY")'`
49
CPPFLAGS2=`${PYTHON} -c 'from distutils import sysconfig; \
50
print " ".join(filter(lambda x: x.startswith("-D"), \
51
sysconfig.get_config_var("CFLAGS").split()))'`
53
CPPFLAGS="${CPPFLAGS1} ${CPPFLAGS2}"
57
PYTHONFRAMEWORKDIR=`${PYTHON} -c 'from distutils import sysconfig; \
58
print sysconfig.get_config_var("PYTHONFRAMEWORKDIR")'`
59
PYTHONFRAMEWORK=`${PYTHON} -c 'from distutils import sysconfig; \
60
print sysconfig.get_config_var("PYTHONFRAMEWORK")'`
62
if test "${PYTHONFRAMEWORKDIR}" = "no-framework"; then
63
LDFLAGS=`${PYTHON} -c 'import distutils.sysconfig; \
64
print "-L" + distutils.sysconfig.get_python_lib(plat_specific=1, \
65
standard_lib=1) +"/config"'`
67
LDLIBS1="-lpython${PYTHON_VERSION}"
68
LDLIBS2=`${PYTHON} -c 'from distutils import sysconfig; \
69
print sysconfig.get_config_var("LIBS")'`
71
LDLIBS="${LDLIBS1} ${LDLIBS2}"
73
LDFLAGS1="-framework ${PYTHONFRAMEWORK}"
75
VERSION="${PYTHON_VERSION}"
76
STRING="${PYTHONFRAMEWORKDIR}/Versions/${VERSION}/${PYTHONFRAMEWORK}"
77
LDFLAGS2=`${PYTHON} -c "from distutils import sysconfig; \
78
print sysconfig.get_config_var(\"LINKFORSHARED\").replace( \
81
LDFLAGS="${LDFLAGS1} ${LDFLAGS2}"
83
LDLIBS=`${PYTHON} -c 'from distutils import sysconfig; \
84
print sysconfig.get_config_var("LIBS")'`
90
AC_MSG_CHECKING(Apache version)
91
HTTPD="`${APXS} -q SBINDIR`/`${APXS} -q TARGET`"
92
HTTPD_VERSION=`$HTTPD -v | awk '/version/ {print $3}' | awk -F/ '{print $2}'`
93
AC_MSG_RESULT($HTTPD_VERSION)
95
LIBEXECDIR="`${APXS} -q LIBEXECDIR`"
98
HTTPD_MAJOR_VERSION=`echo ${HTTPD_VERSION} | sed -e 's/\..*//'`
101
ln -s Makefile-${HTTPD_MAJOR_VERSION}.X.in Makefile.in