[mod_python] static build link errors: Python 2.3.2, mod_python 2.7.8, Apache 1.3.29

Bryn Dyment bryn at bigtrouble.com
Mon Nov 10 13:07:22 EST 2003


I'm getting link errors when building Apache with mod_python (static).
(I've successfully built mod_perl and PHP statically, so I'm somewhat
familiar with the process.)  Ideas?


Versions:
  Python: 2.3.2
  mod_python: 2.7.8
  Apache: 1.3.29


First, I built Python with:
  ./configure --enable-shared
  make
  make install


Next, mod_python with:
  ./configure --with-apache=../apache_1.3.29
  make static
  make install


Then, Apache with:
  ./configure --with-layout=FreeBSD
--activate-module=src/modules/python/libpython.a
  make


Here's where things went south:

---
gcc  -funsigned-char -DUSE_EXPAT -I./lib/expat-lite -DNO_DL_NEEDED `./apaci`
-Wl,--export-dynamic    -o httpd buildmark.o modules.o
modules/standard/libstandard.a  modules/python/libpython.a  main/libmain.a
./os/unix/libos.a  ap/libap.a  lib/expat-lite/libexpat.a  -lcrypt -lm
/usr/local/lib/python2.3/config/libpython2.3.a    -lutil   -lm
/usr/local/lib/python2.3/config/libpython2.3.a(posixmodule.o): In function
`posix_tmpnam':
/usr/local/src/Python-2.3.2/./Modules/posixmodule.c:5785: warning: tmpnam()
possibly used unsafely; consider using mkstemp()
/usr/local/lib/python2.3/config/libpython2.3.a(posixmodule.o): In function
`posix_tempnam':
/usr/local/src/Python-2.3.2/./Modules/posixmodule.c:5738: warning: tempnam()
possibly used unsafely; consider using mkstemp()
/usr/local/lib/python2.3/config/libpython2.3.a(thread.o): In function
`find_key':
/usr/local/src/Python-2.3.2/Python/thread_pthread.h:279: undefined reference
to `pthread_self'
/usr/local/src/Python-2.3.2/Python/thread_pthread.h:391: undefined reference
to `sem_wait'
/usr/local/src/Python-2.3.2/Python/thread_pthread.h:432: undefined reference
to `sem_post'
/usr/local/lib/python2.3/config/libpython2.3.a(thread.o): In function
`PyThread_delete_key':
/usr/local/src/Python-2.3.2/Python/thread_pthread.h:391: undefined reference
to `sem_wait'
/usr/local/src/Python-2.3.2/Python/thread_pthread.h:432: undefined reference
to `sem_post'
/usr/local/lib/python2.3/config/libpython2.3.a(thread.o): In function
`PyThread_delete_key_value':
/usr/local/src/Python-2.3.2/Python/thread_pthread.h:279: undefined reference
to `pthread_self'
/usr/local/src/Python-2.3.2/Python/thread_pthread.h:391: undefined reference
to `sem_wait'
/usr/local/src/Python-2.3.2/Python/thread_pthread.h:432: undefined reference
to `sem_post'
.
.
.
---


Here are the results of ./configure --with-layout=FreeBSD
--activate-module=src/modules/python/libpython.a:

---
Configuring for Apache, Version 1.3.29
 + using installation path layout: FreeBSD (config.layout)
 + activated python module (modules/python/libpython.a)
Creating Makefile
Creating Configuration.apaci in src
Creating Makefile in src
 + configured for FreeBSD 4.9 platform
 + setting C compiler to gcc
 + setting C pre-processor to gcc -E
 + using "tr [a-z] [A-Z]" to uppercase
 + checking for system header files
 + adding selected modules
    o python_module uses ConfigStart/End
 + using builtin Expat
 + checking sizeof various data types
 + doing sanity check on compiler and options
Creating Makefile in src/support
Creating Makefile in src/os/unix
Creating Makefile in src/ap
Creating Makefile in src/main
Creating Makefile in src/lib/expat-lite
Creating Makefile in src/modules/standard
Creating Makefile in src/modules/python
---




More information about the Mod_python mailing list