[SCM] Samba Shared Repository - branch master updated

Matthieu Patou mat at samba.org
Sun Oct 31 10:36:02 MDT 2010


The branch, master has been updated
       via  c3fa203 build: In some case the flags for the sun studio linker are wrong
       via  9f0fb02 build: check that if we provide -liconv we can build shared libs
      from  97c0def s4-auth: added a dependency on com_err

http://gitweb.samba.org/?p=samba.git;a=shortlog;h=master


- Log -----------------------------------------------------------------
commit c3fa203435b82d14805024db8e4a3660859cbdf0
Author: Matthieu Patou <mat at matws.net>
Date:   Sun Oct 31 18:50:15 2010 +0300

    build: In some case the flags for the sun studio linker are wrong
    
    In this case we test if the -Wl,-h,%s works and if so use this form
    
    Autobuild-User: Matthieu Patou <mat at samba.org>
    Autobuild-Date: Sun Oct 31 16:35:17 UTC 2010 on sn-devel-104

commit 9f0fb0261ecdecb093ced28024a36973bf1938b9
Author: Matthieu Patou <mat at matws.net>
Date:   Sun Oct 31 16:24:46 2010 +0300

    build: check that if we provide -liconv we can build shared libs
    
    On Solaris with sun studio compiling an executable with -liconv even if
    there is no libiconv.so or libiconv.a will work but not for a shared
    lib.
    
    This problem leads to build problem as the linker won't be able to find
    libiconv when building shared lib as liconv is wrongly specified

-----------------------------------------------------------------------

Summary of changes:
 buildtools/wafsamba/samba_autoconf.py  |   15 +++++++++++++--
 buildtools/wafsamba/samba_conftests.py |   14 ++++++++++++++
 buildtools/wafsamba/wscript            |   10 ++++++++++
 lib/util/charset/wscript_configure     |    6 ++++++
 4 files changed, 43 insertions(+), 2 deletions(-)


Changeset truncated at 500 lines:

diff --git a/buildtools/wafsamba/samba_autoconf.py b/buildtools/wafsamba/samba_autoconf.py
index f987d1d..e84a456 100644
--- a/buildtools/wafsamba/samba_autoconf.py
+++ b/buildtools/wafsamba/samba_autoconf.py
@@ -474,12 +474,19 @@ def library_flags(conf, libs):
 
 
 @conf
-def CHECK_LIB(conf, libs, mandatory=False, empty_decl=True, set_target=True):
+def CHECK_LIB(conf, libs, mandatory=False, empty_decl=True, set_target=True, shlib=False):
     '''check if a set of libraries exist as system libraries
 
     returns the sublist of libs that do exist as a syslib or []
     '''
 
+    fragment= '''
+int foo()
+{
+    int v = 2;
+    return v*2;
+}
+'''
     ret = []
     liblist  = TO_LIST(libs)
     for lib in liblist[:]:
@@ -488,8 +495,12 @@ def CHECK_LIB(conf, libs, mandatory=False, empty_decl=True, set_target=True):
             continue
 
         (ccflags, ldflags) = library_flags(conf, lib)
+        if shlib:
+            res = conf.check(features='cc cshlib', fragment=fragment, lib=lib, uselib_store=lib, ccflags=ccflags, ldflags=ldflags)
+        else:
+            res = conf.check(lib=lib, uselib_store=lib, ccflags=ccflags, ldflags=ldflags)
 
-        if not conf.check(lib=lib, uselib_store=lib, ccflags=ccflags, ldflags=ldflags):
+        if not res:
             if mandatory:
                 Logs.error("Mandatory library '%s' not found for functions '%s'" % (lib, list))
                 sys.exit(1)
diff --git a/buildtools/wafsamba/samba_conftests.py b/buildtools/wafsamba/samba_conftests.py
index 49cd4ff..4811614 100644
--- a/buildtools/wafsamba/samba_conftests.py
+++ b/buildtools/wafsamba/samba_conftests.py
@@ -94,6 +94,20 @@ def find_config_dir(conf):
     return dir
 
 @conf
+def CHECK_SHLIB_INTRASINC_NAME_FLAGS(conf, msg):
+    '''
+        check if the waf default flags for setting the name of lib
+        are ok
+    '''
+
+    snip = '''
+int foo(int v) {
+    return v * 2;
+}
+'''
+    return conf.check(features='cc cshlib',vnum="1",fragment=snip,msg=msg)
+
+ at conf
 def CHECK_SHLIB_W_PYTHON(conf, msg):
     '''check if we need -undefined dynamic_lookup'''
 
diff --git a/buildtools/wafsamba/wscript b/buildtools/wafsamba/wscript
index 90aeb45..b9b06ab 100644
--- a/buildtools/wafsamba/wscript
+++ b/buildtools/wafsamba/wscript
@@ -275,6 +275,16 @@ def configure(conf):
     else:
         conf.ADD_CFLAGS('-fPIC', testflags=True)
 
+    # On Solaris 8 with suncc (at least) the flags for the linker to define the name of the
+    # library are not always working (if the command line is very very long and with a lot
+    # files)
+
+    if conf.env['COMPILER_CC'] == "suncc":
+        save = conf.env['SONAME_ST']
+        conf.env['SONAME_ST'] = '-Wl,-h,%s'
+        if not conf.CHECK_SHLIB_INTRASINC_NAME_FLAGS("Checking if flags %s are ok" % conf.env['SONAME_ST']):
+            conf.env['SONAME_ST'] = save
+
     conf.CHECK_INLINE()
 
     # check for pkgconfig
diff --git a/lib/util/charset/wscript_configure b/lib/util/charset/wscript_configure
index 274a2d7..e54bfcc 100644
--- a/lib/util/charset/wscript_configure
+++ b/lib/util/charset/wscript_configure
@@ -4,6 +4,12 @@
 # as the external libiconv can use a macro to override iconv_open to libiconv_open
 # and then we may find the wrong iconv.h later due to other packages looking
 # in /usr/local
+# We check for the lib iconv when building a shared lib has some compiler/linker
+# managed to link when specifying -liconv a executable even if there is no
+# libiconv.so or libiconv.a
+
+conf.CHECK_LIB(libs="iconv", shlib=True)
+
 if (conf.CHECK_FUNCS_IN('iconv_open', 'iconv', checklibc=False, headers='iconv.h') or
     conf.CHECK_FUNCS('iconv_open', headers='iconv.h')):
     conf.DEFINE('HAVE_NATIVE_ICONV', 1)


-- 
Samba Shared Repository


More information about the samba-cvs mailing list