109
109
# check Apache version
110
AC_MSG_CHECKING(Apache version)
111
HTTPD="`${APXS} -q SBINDIR`/`${APXS} -q TARGET`"
112
ver=`$HTTPD -v | awk '/version/ {print $3}' | awk -F/ '{print $2}'`
110
# peterh: Remove apache version check for debian package, since we don't
111
# want to build-depend on apache2.
112
# AC_MSG_CHECKING(Apache version)
113
# HTTPD="`${APXS} -q SBINDIR`/`${APXS} -q TARGET`"
114
# ver=`$HTTPD -v | awk '/version/ {print $3}' | awk -F/ '{print $2}'`
115
# AC_MSG_RESULT($ver)
115
117
# make sure version begins with 2
116
if test -z "`echo $ver | egrep \^2`"; then
117
AC_MSG_ERROR([This version of mod_python only works with Apache 2. The one you have seems to be $ver.])
118
# if test -z "`echo $ver | egrep \^2`"; then
119
# AC_MSG_ERROR([This version of mod_python only works with Apache 2. The one you have seems to be $ver.])
120
122
# determine LIBEXEC
121
123
AC_MSG_CHECKING(for Apache libexec directory)
221
223
# set python std library variable
225
PyLIBPL=${PyLIBP}/config
226
PyPYTHONLIBS=${PyLIBPL}/libpython${PyVERSION}.a
227
PyLIBS=`grep "^LIB[[SMC]]=" ${PyLIBPL}/Makefile | cut -f2 -d= | tr '\011\012\015' ' '`
228
PyMODLIBS=`grep "^LOCALMODLIBS=" ${PyLIBPL}/Makefile | cut -f2 -d= | tr '\011\012\015' ' '`
229
PyFRAMEWORK=`grep "^PYTHONFRAMEWORK=" ${PyLIBPL}/Makefile | cut -f2 -d= | tr '\011\012\015' ' '`
230
PyFRAMEWORKDIR=`grep "^PYTHONFRAMEWORKDIR=" ${PyLIBPL}/Makefile | cut -f2 -d= | tr '\011\012\015' ' ' | awk '{print $1}'`
232
save_LDFLAGS="$LDFLAGS"
234
if test "$PyFRAMEWORKDIR" != "no-framework"; then
235
if test -n "$PyFRAMEWORK"; then
236
PyPYTHONLIBS="-framework $PyFRAMEWORK"
237
LDFLAGS="${LDFLAGS} -Wl,-framework,Python"
240
LDFLAGS="${LDFLAGS} -L${PyLIBPL}"
241
AC_CHECK_LIB(python${PyVERSION}, Py_NewInterpreter,
242
[ PyPYTHONLIBS="-lpython${PyVERSION}" ],
243
[ LDFLAGS="$save_LDFLAGS"
244
if test -f ${PyLIBPL}/libpython${PyVERSION}.a; then
245
PyPYTHONLIBS=${PyLIBPL}/libpython${PyVERSION}.a
247
AC_ERROR(Can not link to python)
250
[ ${PyLIBS} ${PyMODLIBS} ] )
254
226
# (actually this check already just happened above)
255
227
AC_MSG_CHECKING(what libraries Python was linked with)
256
PY_LIBS="${PyPYTHONLIBS} ${PyLIBS} ${PyMODLIBS}"
228
PY_LIBS=`${PYTHON_BIN}-config --libs`
258
230
## XXX this is a small work around for a weird RedHat problem
259
231
## erase -lieee from library list
267
239
AC_MSG_CHECKING(linker flags used to link Python)
268
240
AC_SUBST(LDFLAGS)
269
PyLFS=`grep "^LINKFORSHARED=" ${PyLIBPL}/Makefile | cut -f2 -d= | tr '\011\012\015' ' '`
270
PyLDFLAGS=`grep "^LDFLAGS=" ${PyLIBPL}/Makefile | cut -f2 -d= | tr '\011\012\015' ' '`
271
LDFLAGS="${LDFLAGS} ${PyLFS} ${PyLDFLAGS}"
241
PY_LDFLAGS=`${PYTHON_BIN}-config --ldflags`
272
242
LDFLAGS="${LDFLAGS} ${PY_LDFLAGS}"
273
243
AC_MSG_RESULT($PY_LDFLAGS)
275
245
AC_MSG_CHECKING(where Python include files are)
276
246
AC_SUBST(INCLUDES)
277
PY_INCLUDES="-I${PyEXEC_INSTALLDIR}/include/python${PyVERSION}"
247
PY_INCLUDES=`${PYTHON_BIN}-config --includes`
278
248
INCLUDES="${INCLUDES} ${AP_INCLUDES} ${PY_INCLUDES}"
279
249
AC_MSG_RESULT($PY_INCLUDES)
287
257
# get the mod_python version
288
258
AC_SUBST(MP_VERSION)
289
259
MP_VERSION=`awk '/MPV_STRING/ {print $3}' src/include/mpversion.h`
290
MP_VERSION=`echo $MP_VERSION | sed 's/["]//g'`
260
MP_VERSION=`echo $MP_VERSION | sed 's/"//g'`
292
262
# get --with-python-src. The python src is required to generate the documentation
293
263
# It is not required to compile or install mod_python itself