I was trying to compile Python extensions for Samba on FreeBSD with the external
libiconv preselected and linking of the modules failed, as linker wasn't able to
find location of the libiconv. After looking into the Makefile, I found, that
$(LDFLAGS) or it's equivalent is not passed together with the list of libraries
to the setup.py program. After adding it setup.py start to die, complaining
about unknown -Wl,/usr/local/lib flag. So, here are the patches to fix the problem:
--- python/setup.py.orig Thu Mar 4 05:28:18 2004
+++ python/setup.py Thu Mar 4 05:29:35 2004
@@ -57,6 +57,9 @@
if lib[0:2] == "-L":
+ if lib[0:2] == "-W":
+ # Skip linker flags
print "Unknown entry '%s' in $LIBS variable passed to setup.py" % lib
--- Makefile.in.orig Fri Feb 6 23:40:27 2004
+++ Makefile.in Thu Mar 4 05:47:34 2004
@@ -1276,7 +1277,7 @@
PYTHON_CFLAGS="$(CFLAGS) $(CPPFLAGS) $(FLAGS)" \
- LIBS="$(LIBS) $(PASSDB_LIBS) $(IDMAP_LIBS) $(KRB5LIBS) $(LDAP_LIBS)" \
+ LIBS="$(LDFLAGS) $(LIBS) $(PASSDB_LIBS) $(IDMAP_LIBS) $(KRB5LIBS)
$(PYTHON) python/setup.py build
@@ -1286,7 +1287,7 @@
PYTHON_CFLAGS="$(CFLAGS) $(CPPFLAGS)" \
- LIBS="$(LIBS)" \
+ LIBS="$(LDFLAGS) $(LIBS)" \
$(PYTHON) python/setup.py install
I haven't check pythion_install: target, just copied necessary files as sugested
in python/README, but passing just $(LIBS) in it also looks a bit suspicious...
moving to 3.0
Yeah this is a bit of a workaround for bugs in configure where libraries are
incorrectly stored in LDPATH instead of LIBS. Applied anyway.
Thanks for the patch. Enjoy your python!
sorry for the same, cleaning up the database to prevent unecessary reopens of bugs.