summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGraham.Dumpleton <devnull@localhost>2009-08-12 05:30:57 +0000
committerGraham.Dumpleton <devnull@localhost>2009-08-12 05:30:57 +0000
commitd8abbced282085e7d0469d441e3a7f8b3757596e (patch)
treef7d4a94508861d281b80a2c5326b8f0d54ea6f1d
parenteb5a49cb83d9f4f41c550f68d73fc72b29c84c11 (diff)
downloadmod_wsgi-d8abbced282085e7d0469d441e3a7f8b3757596e.tar.gz
Require configure option to enable Python 3.X support. For Windows, will need
to manually modify makefile to provide require preprocessor define to enable it.
-rwxr-xr-xconfigure17
-rw-r--r--configure.ac13
-rw-r--r--mod_wsgi.c6
3 files changed, 34 insertions, 2 deletions
diff --git a/configure b/configure
index b84897f..8a85103 100755
--- a/configure
+++ b/configure
@@ -1196,6 +1196,7 @@ Optional Features:
--disable-FEATURE do not include FEATURE (same as --enable-FEATURE=no)
--enable-FEATURE[=ARG] include FEATURE [ARG=yes]
--disable-embedded disable mod_wsgi embedded mode
+ --enable-py3k enable mod_wsgi Python 3.X support
Optional Packages:
--with-PACKAGE[=ARG] use PACKAGE [ARG=yes]
@@ -1631,6 +1632,14 @@ else
fi
+# Check whether --enable-py3k was given.
+if test "${enable_py3k+set}" = set; then
+ enableval=$enable_py3k; ENABLE_PY3K=$enableval
+else
+ ENABLE_PY3K=no
+fi
+
+
# Check whether --with-apxs was given.
if test "${with_apxs+set}" = set; then
@@ -1793,7 +1802,13 @@ else
CPPFLAGS3=""
fi
-CPPFLAGS="${CPPFLAGS} ${CPPFLAGS1} ${CPPFLAGS2} ${CPPFLAGS3}"
+if test "${ENABLE_PY3K}" = "yes"; then
+CPPFLAGS4="-DMOD_WSGI_ENABLE_PY3K"
+else
+CPPFLAGS4=""
+fi
+
+CPPFLAGS="${CPPFLAGS} ${CPPFLAGS1} ${CPPFLAGS2} ${CPPFLAGS3} ${CPPFLAGS4}"
diff --git a/configure.ac b/configure.ac
index ebac745..9db0d1a 100644
--- a/configure.ac
+++ b/configure.ac
@@ -23,6 +23,11 @@ AC_ARG_ENABLE(embedded, AC_HELP_STRING([--disable-embedded],
[ENABLE_EMBEDDED=$enableval],
[ENABLE_EMBEDDED=yes])
+AC_ARG_ENABLE(py3k, AC_HELP_STRING([--enable-py3k],
+ [enable mod_wsgi Python 3.X support]),
+ [ENABLE_PY3K=$enableval],
+ [ENABLE_PY3K=no])
+
AC_ARG_WITH(apxs, AC_HELP_STRING([--with-apxs=NAME],
[name of the apxs executable [[apxs]]]),
[APXS="$with_apxs"])
@@ -87,7 +92,13 @@ else
CPPFLAGS3=""
fi
-CPPFLAGS="${CPPFLAGS} ${CPPFLAGS1} ${CPPFLAGS2} ${CPPFLAGS3}"
+if test "${ENABLE_PY3K}" = "yes"; then
+CPPFLAGS4="-DMOD_WSGI_ENABLE_PY3K"
+else
+CPPFLAGS4=""
+fi
+
+CPPFLAGS="${CPPFLAGS} ${CPPFLAGS1} ${CPPFLAGS2} ${CPPFLAGS3} ${CPPFLAGS4}"
AC_SUBST(CPPFLAGS)
diff --git a/mod_wsgi.c b/mod_wsgi.c
index f91a5e4..fbb07ef 100644
--- a/mod_wsgi.c
+++ b/mod_wsgi.c
@@ -133,6 +133,12 @@ typedef regmatch_t ap_regmatch_t;
#error Sorry, mod_wsgi requires at least Python 2.3.0.
#endif
+#if !defined(MOD_WSGI_ENABLE_PY3K)
+#if PY_VERSION_HEX >= 0x03000000
+#error Sorry, there is no WSGI specification for Python 3.X as yet.
+#endif
+#endif
+
#if !defined(WITH_THREAD)
#error Sorry, mod_wsgi requires that Python supporting thread.
#endif