summaryrefslogtreecommitdiff
path: root/source3/python
diff options
context:
space:
mode:
authorTim Potter <tpot@samba.org>2003-05-05 06:21:26 +0000
committerTim Potter <tpot@samba.org>2003-05-05 06:21:26 +0000
commitda18088eea1140ad926892291abd6c1c0256e280 (patch)
tree2883d06aea727cb2b57cfddc54803b8f663d543a /source3/python
parent423bd582f4f0f03ff086054060954e8e23cd02cd (diff)
downloadsamba-da18088eea1140ad926892291abd6c1c0256e280.tar.gz
samba-da18088eea1140ad926892291abd6c1c0256e280.tar.bz2
samba-da18088eea1140ad926892291abd6c1c0256e280.zip
Fix for bug #60. Our autoconf code adds both libraries and linker
flags in the $LIBS make variable. Separate the two so the python extensions can build. (This used to be commit 164ea3835724409d5b9badbad689d154307d2b59)
Diffstat (limited to 'source3/python')
-rwxr-xr-xsource3/python/setup.py51
1 files changed, 30 insertions, 21 deletions
diff --git a/source3/python/setup.py b/source3/python/setup.py
index 6569331031..a9f220f195 100755
--- a/source3/python/setup.py
+++ b/source3/python/setup.py
@@ -41,15 +41,24 @@ samba_srcdir = os.environ.get("SRCDIR", "")
samba_libs = os.environ.get("LIBS", "")
-# Convert libs and objs from space separated strings to lists of strings
-# for distutils to digest. Split "-l" prefix off library list.
-
obj_list = string.split(samba_objs)
-lib_list = []
+# Unfortunately the samba_libs variable contains both shared libraries
+# and linker flags. The python distutils doesn't like this so we have
+# to split $samba_libs into a flags component and a library component.
+
+libraries = []
+library_dirs = []
for lib in string.split(samba_libs):
- lib_list.append(string.replace(lib, "-l", ""))
+ if lib[0:2] == "-l":
+ libraries.append(lib[2:])
+ continue
+ if lib[0:2] == "-L":
+ library_dirs.append(lib[2:])
+ continue
+ print "Unknown entry '%s' in $LIBS variable passed to setup.py" % lib
+ sys.exit(1)
flags_list = string.split(samba_cflags)
@@ -96,8 +105,8 @@ setup(
samba_srcdir + "python/py_spoolss_jobs.c",
samba_srcdir + "python/py_spoolss_jobs_conv.c",
],
- libraries = lib_list,
- library_dirs = ["/usr/kerberos/lib"],
+ libraries = libraries,
+ library_dirs = ["/usr/kerberos/lib"] + library_dirs,
extra_compile_args = flags_list,
extra_objects = obj_list),
@@ -107,8 +116,8 @@ setup(
sources = [samba_srcdir + "python/py_lsa.c",
samba_srcdir + "python/py_common.c",
samba_srcdir + "python/py_ntsec.c"],
- libraries = lib_list,
- library_dirs = ["/usr/kerberos/lib"],
+ libraries = libraries,
+ library_dirs = ["/usr/kerberos/lib"] + library_dirs,
extra_compile_args = flags_list,
extra_objects = obj_list),
@@ -119,8 +128,8 @@ setup(
samba_srcdir + "python/py_conv.c",
samba_srcdir + "python/py_samr_conv.c",
samba_srcdir + "python/py_common.c"],
- libraries = lib_list,
- library_dirs = ["/usr/kerberos/lib"],
+ libraries = libraries,
+ library_dirs = ["/usr/kerberos/lib"] + library_dirs,
extra_compile_args = flags_list,
extra_objects = obj_list),
@@ -131,8 +140,8 @@ setup(
samba_srcdir + "python/py_winbind_conv.c",
samba_srcdir + "python/py_conv.c",
samba_srcdir + "python/py_common.c"],
- libraries = lib_list,
- library_dirs = ["/usr/kerberos/lib"],
+ libraries = libraries,
+ library_dirs = ["/usr/kerberos/lib"] + library_dirs,
extra_compile_args = flags_list,
extra_objects = obj_list),
@@ -141,8 +150,8 @@ setup(
Extension(name = "winreg",
sources = [samba_srcdir + "python/py_winreg.c",
samba_srcdir + "python/py_common.c"],
- libraries = lib_list,
- library_dirs = ["/usr/kerberos/lib"],
+ libraries = libraries,
+ library_dirs = ["/usr/kerberos/lib"] + library_dirs,
extra_compile_args = flags_list,
extra_objects = obj_list),
@@ -153,8 +162,8 @@ setup(
samba_srcdir + "python/py_conv.c",
samba_srcdir + "python/py_srvsvc_conv.c",
samba_srcdir + "python/py_common.c"],
- libraries = lib_list,
- library_dirs = ["/usr/kerberos/lib"],
+ libraries = libraries,
+ library_dirs = ["/usr/kerberos/lib"] + library_dirs,
extra_compile_args = flags_list,
extra_objects = obj_list),
@@ -162,8 +171,8 @@ setup(
Extension(name = "tdb",
sources = [samba_srcdir + "python/py_tdb.c"],
- libraries = lib_list,
- library_dirs = ["/usr/kerberos/lib"],
+ libraries = libraries,
+ library_dirs = ["/usr/kerberos/lib"] + library_dirs,
extra_compile_args = flags_list,
extra_objects = obj_list),
@@ -173,8 +182,8 @@ setup(
sources = [samba_srcdir + "python/py_smb.c",
samba_srcdir + "python/py_common.c",
samba_srcdir + "python/py_ntsec.c"],
- libraries = lib_list,
- library_dirs = ["/usr/kerberos/lib"],
+ libraries = libraries,
+ library_dirs = ["/usr/kerberos/lib"] + library_dirs,
extra_compile_args = flags_list,
extra_objects = obj_list),