architekt1024 / modwsgi

Automatically exported from code.google.com/p/modwsgi
0 stars 0 forks source link

Compile failed with Apache 1.3 and Python 2.7 #317

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
You can see from the posted code. 
If you are using a system like ours (Apache 1.3 and Python 2.7), you won't get 
a definition for 'wsgi_set_dont_write_bytecode', but it is called anyway.

Line 9630:
#if PY_MAJOR_VERSION == 2 && PY_MINOR_VERSION >= 6
    { "WSGIPy3kWarningFlag", wsgi_set_py3k_warning_flag, NULL,
        RSRC_CONF, TAKE1, "Enable/Disable Python 3.0 warnings." },
    { "WSGIDontWriteBytecode", wsgi_set_dont_write_bytecode, NULL,
        RSRC_CONF, TAKE1, "Enable/Disable writing of byte code." },
#endif

Line 8174~8258:
#if AP_SERVER_MAJORVERSION_NUMBER >= 2
...
static const char *wsgi_set_dont_write_bytecode(cmd_parms *cmd, void *mconfig,
                                                const char *f)

Line 15727:
#if PY_MAJOR_VERSION == 2 && PY_MINOR_VERSION >= 6
    AP_INIT_TAKE1("WSGIPy3kWarningFlag", wsgi_set_py3k_warning_flag,
        NULL, RSRC_CONF, "Enable/Disable Python 3.0 warnings."),
    AP_INIT_TAKE1("WSGIDontWriteBytecode", wsgi_set_dont_write_bytecode,
        NULL, RSRC_CONF, "Enable/Disable writing of byte code."),
#endif

Error details:
"/home/users/qa/automation/python/dirty-sun4/include/python2.7/pyconfig.h", 
line 1133: warning: macro redefined: _FILE_OFFSET_BITS
"mod_wsgi.c", line 9633: undefined symbol: wsgi_set_dont_write_bytecode
"mod_wsgi.c", line 9633: warning: improper pointer/integer combination: op "="
"mod_wsgi.c", line 9633: non-constant initializer: op "NAME"
cc: acomp failed for mod_wsgi.c
apxs:Break: Command failed with rc=2
*** Error code 1
make: Fatal error: Command failed for target `mod_wsgi.so'

Temp solution:
I changed Line 9630 to
#if PY_MAJOR_VERSION == 2 && PY_MINOR_VERSION >= 8
then, compile passed.

Original issue reported on code.google.com by zhouxiao...@gmail.com on 10 Mar 2014 at 8:54

GoogleCodeExporter commented 8 years ago
That is not technically the correct fix. More than likely the #endif after the 
wsgi_set_dont_write_bytecode() has to be moved above it.

Why are you still using Apache 1.3? Apache 1.3 is very very very old and is no 
longer supported in any way by the Apache software foundation. Apache 1.3 
support has been removed for the next major version of mod_wsgi.

Original comment by Graham.Dumpleton@gmail.com on 11 Mar 2014 at 2:27

GoogleCodeExporter commented 8 years ago
Believe this was fixed at some point in 3.X branch. Support for Apache 1.3 has 
been dropped from 4.X so not relevant there.

Original comment by Graham.Dumpleton@gmail.com on 12 Nov 2014 at 10:19