summaryrefslogtreecommitdiff
path: root/source3/python
diff options
context:
space:
mode:
authorTim Potter <tpot@samba.org>2003-05-13 04:35:58 +0000
committerTim Potter <tpot@samba.org>2003-05-13 04:35:58 +0000
commit9b32fe9a2fb3a395a5f8ca6e3cb49d4e1659f2b6 (patch)
tree50b961f9d5ab3da80c3a29640961177fd902b1c1 /source3/python
parentd7ec9f68351a18e4d9107c7852b280de1cc1998f (diff)
downloadsamba-9b32fe9a2fb3a395a5f8ca6e3cb49d4e1659f2b6.tar.gz
samba-9b32fe9a2fb3a395a5f8ca6e3cb49d4e1659f2b6.tar.bz2
samba-9b32fe9a2fb3a395a5f8ca6e3cb49d4e1659f2b6.zip
Sync up with 3.0 version.
(This used to be commit b02ea3c137ebab506599ca4168bd50f77e1c995e)
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),