[mod_python] compiling mod_python with httpd 2.2.2

Jim Gallacher jpg at jgassociates.ca
Thu Jun 8 08:12:38 EDT 2006

Mika Borner wrote:
> Hi
> I have problems compiling mod_python against httpd 2.2.2. I tried out
> the newest version under trunk as well as the 3.2.x tree under Branch...
> My system runs Solaris 10 (Sparc). 
> /usr/include/sys/feature_tests.h:188:1: warning: this is the location of
> the previous definition
> /u00/appl/apache2/apr-httpd/build-1/libtool --silent --mode=link gcc -o
> mod_python.la  -rpath /u00/appl/apache2/modules -module -avoid-version  
>  hlistobject.lo hlist.lo filterobject.lo connobject.lo serverobject.lo
> util.lo tableobject.lo requestobject.lo _apachemodule.lo mod_python.lo
> -L/u00/appl/python/lib/python2.4/config -lm -lpython2.4 -lresolv
> -lsocket -lnsl -lrt -ldl -lm _eprintf.o _floatdidf.o _muldi3.o
> *** Warning: Linking the shared library mod_python.la against the
> non-libtool
> *** objects  _eprintf.o _floatdidf.o _muldi3.o is not portable!
> Text relocation remains                         referenced
>     against symbol                  offset      in file
> <unknown>                           0x0        
> /u00/appl/python/lib/python2.4/config/libpython2.4.a(floatobject.o)
> <unknown>                           0x4        
> /u00/appl/python/lib/python2.4/config/libpython2.4.a(floatobject.o)
> <unknown>                           0x8        
> /u00/appl/python/lib/python2.4/config/libpython2.4.a(floatobject.o)
> ...
> Vehis looks like a difference in the gawk vs you awk, as well as your shellry Long List (ommitted)
> ...
> ld: fatal: relocations remain against allocatable but non-writable
> sections
> collect2: ld returned 1 exit status
> apxs:Error: Command failed with rc=65536
> httpd was compiled with options:
> ./configure --prefix=/u00/appl/apache2 \
> --enable-mods-shared=all \
> --libdir=/usr/local/lib \
> --with-apr=/u00/appl/apache2/apr-httpd \
> --with-apr-util=/u00/appl/apache2/apr-util-httpd \
> --enable-so
> mod_python was compiled with options:
> ./configure --with-apxs=/u00/appl/apache2/bin/apxs
> --with-python=/u00/appl/python/bin/python
> --with-python-src=/usr/local/src/Python-2.4.3
> --with-flex=/usr/local/bin/flex

I can't help you with the libtool issues. I know Ron Reisor successfully 
built mod_python 3.2.7 on Solaris 10. (3.2.8 is essentially the same - 
just a small security fix for FileSession). Hopefully if Ron is still on 
the list he can offer you some insight.

You only need --with-python-src if you want to build the documentation. 
You don't need it, but it's not the cause of your problem.

> During configure also this error is raised (might be a non issue):  
> checking for --with-flex... /usr/local/bin/flex
> found /usr/local/bin/flex, we'll use this. Use --with-flex to specify
> another.
> checking flex version... awk: syntax error near line 1
> awk: bailing out near line 1
> awk: syntax error near line 1
> awk: bailing out near line 1
> awk: syntax error near line 1
> awk: bailing out near line 1
> ./configure: line 3187: test: : integer expression expected
> configure: WARNING: Flex version 2.5.31 found.
>     Version 2.5.31 or greater is required.  You can generally ignore
> this
>     warning unless you need to regenerate psp_parser.c from psp_parse.l.
>     If you do need regenerate psp_parser.c, use --with-flex to specify
> the
>     location of the correct flex version. See the README for more
> information.

Ignoring the syntax error for a minute, it is indeed not a problem if 
you don't have the correct flex version unless you want to modify 
psp_parse.l, but why would you want to do that when you haven't got 
mod_python working yet? ;)

It looks like the awk you are using is different from gawk. Could you 
check your version? Also what shell are you using? The comparison done 
in line 3187 works in bash, but may not be compatible in other shells.

Non of the flex errors will cause your libtool problem, as flex should 
not need to be called anyway. I would like to fix them so that configure 
runs smoothly however.


More information about the Mod_python mailing list