Bug 1152 - LIBS doesn't include all the necessary library paths
LIBS doesn't include all the necessary library paths
Status: CLOSED FIXED
Product: Samba 3.0
Classification: Unclassified
Component: python
3.0.2a
All FreeBSD
: P3 normal
: none
Assigned To: Tim Potter
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2004-03-04 11:29 UTC by Timur Bakeyev
Modified: 2005-11-14 09:24 UTC (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Timur Bakeyev 2004-03-04 11:29:18 UTC
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":
         library_dirs.append(lib[2:])
         continue
+    if lib[0:2] == "-W":
+       # Skip linker flags
+       continue
     print "Unknown entry '%s' in $LIBS variable passed to setup.py" % lib
     sys.exit(1)
--- Makefile.in.orig    Fri Feb  6 23:40:27 2004
+++ Makefile.in Thu Mar  4 05:47:34 2004
@@ -1276,7 +1277,7 @@
        fi
        PYTHON_OBJS="$(PYTHON_PICOBJS)" \
        PYTHON_CFLAGS="$(CFLAGS) $(CPPFLAGS) $(FLAGS)" \
-       LIBS="$(LIBS) $(PASSDB_LIBS) $(IDMAP_LIBS) $(KRB5LIBS) $(LDAP_LIBS)" \
+       LIBS="$(LDFLAGS) $(LIBS) $(PASSDB_LIBS) $(IDMAP_LIBS) $(KRB5LIBS)
$(LDAP_LIBS)" \
                $(PYTHON) python/setup.py build
  
 python_install: $(PYTHON_PICOBJS)
@@ -1286,7 +1287,7 @@
        fi
        PYTHON_OBJS="$(PYTHON_PICOBJS)" \
        PYTHON_CFLAGS="$(CFLAGS) $(CPPFLAGS)" \
-       LIBS="$(LIBS)" \
+       LIBS="$(LDFLAGS) $(LIBS)" \
                $(PYTHON) python/setup.py install
  
 python_clean:


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...
Comment 1 Gerald (Jerry) Carter 2004-03-18 07:06:07 UTC
moving to 3.0
Comment 2 Gerald (Jerry) Carter 2004-03-18 07:15:58 UTC
resetting component
Comment 3 Tim Potter 2004-03-24 15:46:24 UTC
Yeah this is a bit of a workaround for bugs in configure where libraries are
incorrectly stored in LDPATH instead of LIBS.  Applied anyway.
Comment 4 Tim Potter 2004-03-24 15:53:22 UTC
Thanks for the patch.  Enjoy your python!
Comment 5 Gerald (Jerry) Carter 2005-08-24 10:21:20 UTC
sorry for the same, cleaning up the database to prevent unecessary reopens of bugs.
Comment 6 Gerald (Jerry) Carter 2005-11-14 09:24:47 UTC
database cleanup