~ubuntu-branches/ubuntu/saucy/mod-wsgi/saucy-updates

« back to all changes in this revision

Viewing changes to configure.ac

  • Committer: Bazaar Package Importer
  • Author(s): Bernd Zeimetz
  • Date: 2007-10-30 03:04:20 UTC
  • Revision ID: james.westby@ubuntu.com-20071030030420-vvnxb7zu4em5psjz
Tags: upstream-1.2
ImportĀ upstreamĀ versionĀ 1.2

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
dnl  vim: set sw=4 expandtab :
 
2
dnl
 
3
dnl  Copyright 2007 GRAHAM DUMPLETON
 
4
dnl 
 
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
 
8
dnl 
 
9
dnl      http://www.apache.org/licenses/LICENSE-2.0
 
10
dnl 
 
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.
 
16
 
 
17
dnl Process this file with autoconf to produce a configure script.
 
18
 
 
19
AC_INIT(mod_wsgi.c)
 
20
 
 
21
AC_ARG_WITH(apxs, AC_HELP_STRING([--with-apxs=NAME],
 
22
            [name of the apxs executable [[apxs]]]),
 
23
            [APXS="$with_apxs"])
 
24
 
 
25
if test -z "${APXS}"; then
 
26
    AC_PATH_PROGS(APXS, apxs2 apxs, [apxs],
 
27
                   [$PATH:/usr/local/apache/bin:/usr/sbin])
 
28
fi
 
29
 
 
30
AC_SUBST(APXS)
 
31
 
 
32
AC_ARG_WITH(python, AC_HELP_STRING([--with-python=NAME],
 
33
            [name of the python executable [[python]]]),
 
34
            [PYTHON="$with_python"])
 
35
 
 
36
if test -z "${PYTHON}"; then
 
37
    AC_PATH_PROGS(PYTHON, python, [python],
 
38
                   [$PATH:/usr/local/bin])
 
39
fi
 
40
 
 
41
AC_SUBST(PYTHON)
 
42
 
 
43
PYTHON_VERSION=`${PYTHON} -c 'from distutils import sysconfig; \
 
44
    print sysconfig.get_config_var("VERSION")'`
 
45
 
 
46
CPPFLAGS1=`${PYTHON} -c 'from distutils import sysconfig; \
 
47
    print "-I" + sysconfig.get_config_var("INCLUDEPY")'`
 
48
 
 
49
CPPFLAGS2=`${PYTHON} -c 'from distutils import sysconfig; \
 
50
    print " ".join(filter(lambda x: x.startswith("-D"), \
 
51
    sysconfig.get_config_var("CFLAGS").split()))'`
 
52
 
 
53
CPPFLAGS="${CPPFLAGS1} ${CPPFLAGS2}"
 
54
 
 
55
AC_SUBST(CPPFLAGS)
 
56
 
 
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")'`
 
61
 
 
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"'`
 
66
 
 
67
    LDLIBS1="-lpython${PYTHON_VERSION}"
 
68
    LDLIBS2=`${PYTHON} -c 'from distutils import sysconfig; \
 
69
        print sysconfig.get_config_var("LIBS")'`
 
70
 
 
71
    LDLIBS="${LDLIBS1} ${LDLIBS2}"
 
72
else
 
73
    LDFLAGS1="-framework ${PYTHONFRAMEWORK}"
 
74
 
 
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( \
 
79
        \"${STRING}\", '')"`
 
80
 
 
81
    LDFLAGS="${LDFLAGS1} ${LDFLAGS2}"
 
82
 
 
83
    LDLIBS=`${PYTHON} -c 'from distutils import sysconfig; \
 
84
        print sysconfig.get_config_var("LIBS")'`
 
85
fi
 
86
 
 
87
AC_SUBST(LDFLAGS)
 
88
AC_SUBST(LDLIBS)
 
89
 
 
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)
 
94
 
 
95
LIBEXECDIR="`${APXS} -q LIBEXECDIR`"
 
96
AC_SUBST(LIBEXECDIR)
 
97
 
 
98
HTTPD_MAJOR_VERSION=`echo ${HTTPD_VERSION} | sed -e 's/\..*//'`
 
99
 
 
100
rm -f Makefile.in
 
101
ln -s Makefile-${HTTPD_MAJOR_VERSION}.X.in Makefile.in
 
102
 
 
103
AC_OUTPUT(Makefile)