[SCM] Samba Shared Repository - branch v3-2-test updated - initial-v3-2-unstable-211-g760f24f

Stefan Metzmacher metze at samba.org
Tue Nov 6 08:40:25 GMT 2007


The branch, v3-2-test has been updated
       via  760f24f10cbea7ce22acd0772fb5b125f718d129 (commit)
       via  20ec1f472566bbc570fa138cce5dbd0407aef530 (commit)
       via  4d02b1344b76c6147944188161f73ad3917b8abc (commit)
       via  57bea8cd02cb7964bbb64ba26b83c372f0e12b94 (commit)
       via  0ec16729299887b4a80a7e24fbd1750632276691 (commit)
       via  9f862e9faf0fa9cddfcc2f87d9f247082718b3e0 (commit)
       via  322cf8002bab1e449616d9fcea0bd4c9535cfe6a (commit)
       via  63b7690335360a073dc1ae111f740a7934f1a92f (commit)
       via  48c70f604071fcf7c0887fe0136bdc2dda4c8ff4 (commit)
       via  4904af51cdccd4e52d2805bd62f39276447c4646 (commit)
       via  809fee4bef66eb8b8687f88257c0d6f77d3b4063 (commit)
      from  e1fcd851ab38165eb0e959cdc02ff067614f8b28 (commit)

http://gitweb.samba.org/?p=samba.git;a=shortlog;h=v3-2-test


- Log -----------------------------------------------------------------
commit 760f24f10cbea7ce22acd0772fb5b125f718d129
Author: metze <metze at 0c0555d6-39d7-0310-84fc-f1cc0bd64818>
Date:   Tue Nov 6 07:01:17 2007 +0000

    libreplace: we should only have one location where we check for required functions
    
    metze
    
    git-svn-id: svn+ssh://svn.samba.org/data/svn/samba/branches/SAMBA_4_0@25864 0c0555d6-39d7-0310-84fc-f1cc0bd64818

commit 20ec1f472566bbc570fa138cce5dbd0407aef530
Author: metze <metze at 0c0555d6-39d7-0310-84fc-f1cc0bd64818>
Date:   Tue Nov 6 06:54:49 2007 +0000

    libreplace: we need include <unistd.h> before nss_wrapper.h
    
    metze
    
    git-svn-id: svn+ssh://svn.samba.org/data/svn/samba/branches/SAMBA_4_0@25863 0c0555d6-39d7-0310-84fc-f1cc0bd64818

commit 4d02b1344b76c6147944188161f73ad3917b8abc
Author: jelmer <jelmer at 0c0555d6-39d7-0310-84fc-f1cc0bd64818>
Date:   Tue Nov 6 04:59:50 2007 +0000

    Fix export dynamic for HPUX.
    
    git-svn-id: svn+ssh://svn.samba.org/data/svn/samba/branches/SAMBA_4_0@25861 0c0555d6-39d7-0310-84fc-f1cc0bd64818

commit 57bea8cd02cb7964bbb64ba26b83c372f0e12b94
Author: jelmer <jelmer at 0c0555d6-39d7-0310-84fc-f1cc0bd64818>
Date:   Tue Nov 6 04:26:57 2007 +0000

    Remove flag that causes problems on some hosts.
    
    git-svn-id: svn+ssh://svn.samba.org/data/svn/samba/branches/SAMBA_4_0@25860 0c0555d6-39d7-0310-84fc-f1cc0bd64818

commit 0ec16729299887b4a80a7e24fbd1750632276691
Author: jelmer <jelmer at 0c0555d6-39d7-0310-84fc-f1cc0bd64818>
Date:   Tue Nov 6 04:26:52 2007 +0000

    Wrap native HPUX functions in dl implementation.
    
    git-svn-id: svn+ssh://svn.samba.org/data/svn/samba/branches/SAMBA_4_0@25859 0c0555d6-39d7-0310-84fc-f1cc0bd64818

commit 9f862e9faf0fa9cddfcc2f87d9f247082718b3e0
Author: jelmer <jelmer at 0c0555d6-39d7-0310-84fc-f1cc0bd64818>
Date:   Tue Nov 6 03:43:50 2007 +0000

    Check for HPUX dl functions.
    
    git-svn-id: svn+ssh://svn.samba.org/data/svn/samba/branches/SAMBA_4_0@25855 0c0555d6-39d7-0310-84fc-f1cc0bd64818

commit 322cf8002bab1e449616d9fcea0bd4c9535cfe6a
Author: jelmer <jelmer at samba.org>
Date:   Tue Nov 6 02:35:46 2007 +0000

    Move SHLIBEXT determination into a test as well.
    
    git-svn-id: svn+ssh://svn.samba.org/data/svn/samba/branches/SAMBA_4_0@25852 0c0555d6-39d7-0310-84fc-f1cc0bd64818

commit 63b7690335360a073dc1ae111f740a7934f1a92f
Author: jelmer <jelmer at samba.org>
Date:   Tue Nov 6 02:17:05 2007 +0000

    Move system-specific ldflags checks to libreplace so they can be used by ldb.
    
    git-svn-id: svn+ssh://svn.samba.org/data/svn/samba/branches/SAMBA_4_0@25851 0c0555d6-39d7-0310-84fc-f1cc0bd64818

commit 48c70f604071fcf7c0887fe0136bdc2dda4c8ff4
Author: jelmer <jelmer at samba.org>
Date:   Tue Nov 6 02:16:55 2007 +0000

    Add macro for picflag.
    
    git-svn-id: svn+ssh://svn.samba.org/data/svn/samba/branches/SAMBA_4_0@25850 0c0555d6-39d7-0310-84fc-f1cc0bd64818

commit 4904af51cdccd4e52d2805bd62f39276447c4646
Author: jelmer <jelmer at samba.org>
Date:   Tue Nov 6 01:05:19 2007 +0000

    Add configure test for -Wl,--export-dynamic.
    
    git-svn-id: svn+ssh://svn.samba.org/data/svn/samba/branches/SAMBA_4_0@25846 0c0555d6-39d7-0310-84fc-f1cc0bd64818

commit 809fee4bef66eb8b8687f88257c0d6f77d3b4063
Author: metze <metze at 0c0555d6-39d7-0310-84fc-f1cc0bd64818>
Date:   Mon Nov 5 15:45:08 2007 +0000

    libreplace: include nss_wrapper.h if NSS_WRAPPER is defined
    
    metze
    
    git-svn-id: svn+ssh://svn.samba.org/data/svn/samba/branches/SAMBA_4_0@25838 0c0555d6-39d7-0310-84fc-f1cc0bd64818

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

Summary of changes:
 source/lib/replace/dlfcn.c          |   16 ++++
 source/lib/replace/dlfcn.m4         |    5 ++
 source/lib/replace/libreplace.m4    |    6 +-
 source/lib/replace/libreplace_ld.m4 |  129 +++++++++++++++++++++++++++++++++++
 source/lib/replace/system/passwd.h  |   10 +++
 5 files changed, 162 insertions(+), 4 deletions(-)
 create mode 100644 source/lib/replace/libreplace_ld.m4


Changeset truncated at 500 lines:

diff --git a/source/lib/replace/dlfcn.c b/source/lib/replace/dlfcn.c
index 46aaaa4..4284884 100644
--- a/source/lib/replace/dlfcn.c
+++ b/source/lib/replace/dlfcn.c
@@ -23,6 +23,9 @@
 */
 
 #include "replace.h"
+#ifdef HAVE_DL_H
+#include <dl.h>
+#endif
 
 #ifndef HAVE_DLOPEN
 #ifdef DLOPEN_TAKES_UNSIGNED_FLAGS
@@ -31,13 +34,22 @@ void *rep_dlopen(const char *name, unsigned int flags)
 void *rep_dlopen(const char *name, int flags)
 #endif
 {
+#ifdef HAVE_SHL_LOAD
+	return (void *)shl_load(name, flags, 0);
+#else
 	return NULL;
+#endif
 }
 #endif
 
 #ifndef HAVE_DLSYM
 void *rep_dlsym(void *handle, const char *symbol)
 {
+#ifdef HAVE_SHL_FINDSYM
+	void *sym_addr;
+	if (!shl_findsym((shl_t *)&handle, symbol, TYPE_UNDEFINED, &sym_addr))
+		return sym_addr;
+#endif
     return NULL;
 }
 #endif
@@ -52,6 +64,10 @@ char *rep_dlerror(void)
 #ifndef HAVE_DLCLOSE
 int rep_dlclose(void *handle)
 {
+#ifdef HAVE_SHL_CLOSE
+	return shl_unload((shl_t)handle);
+#else
 	return 0;
+#endif
 }
 #endif
diff --git a/source/lib/replace/dlfcn.m4 b/source/lib/replace/dlfcn.m4
index c5b7597..42f56f2 100644
--- a/source/lib/replace/dlfcn.m4
+++ b/source/lib/replace/dlfcn.m4
@@ -8,6 +8,11 @@ AC_SEARCH_LIBS(dlopen, dl)
 AC_CHECK_HEADERS(dlfcn.h)
 AC_CHECK_FUNCS([dlopen dlsym dlerror dlclose],[],[libreplace_cv_dlfcn=yes])
 
+libreplace_cv_shl=no
+AC_SEARCH_LIBS(shl_load, sl)
+AC_CHECK_HEADERS(dl.h)
+AC_CHECK_FUNCS([shl_load shl_unload shl_findsym],[],[libreplace_cv_shl=yes])
+
 AC_VERIFY_C_PROTOTYPE([void *dlopen(const char* filename, unsigned int flags)],
 	[
 	return 0;
diff --git a/source/lib/replace/libreplace.m4 b/source/lib/replace/libreplace.m4
index dd7dbf4..c10a4b2 100644
--- a/source/lib/replace/libreplace.m4
+++ b/source/lib/replace/libreplace.m4
@@ -280,9 +280,6 @@ AC_TRY_CPP([
 eprintf("bla", "bar");
 ], AC_DEFINE(HAVE__VA_ARGS__MACRO, 1, [Whether the __VA_ARGS__ macro is available]))
 
-# Check prerequisites
-AC_CHECK_FUNCS([memset printf syslog], [], 
-			   [ AC_MSG_ERROR([Required function not found])])
 
 AC_CACHE_CHECK([for sig_atomic_t type],samba_cv_sig_atomic_t, [
     AC_TRY_COMPILE([
@@ -331,7 +328,7 @@ m4_include(inet_pton.m4)
 m4_include(getaddrinfo.m4)
 m4_include(repdir.m4)
 
-AC_CHECK_FUNCS([syslog memset memcpy],,[AC_MSG_ERROR([Required function not found])])
+AC_CHECK_FUNCS([syslog printf memset memcpy],,[AC_MSG_ERROR([Required function not found])])
 
 echo "LIBREPLACE_BROKEN_CHECKS: END"
 ]) dnl end AC_LIBREPLACE_BROKEN_CHECKS
@@ -355,5 +352,6 @@ CFLAGS="$CFLAGS -I$libreplacedir"
 ])
 
 m4_include(libreplace_cc.m4)
+m4_include(libreplace_ld.m4)
 m4_include(libreplace_macros.m4)
 m4_include(autoconf-2.60.m4)
diff --git a/source/lib/replace/libreplace_ld.m4 b/source/lib/replace/libreplace_ld.m4
new file mode 100644
index 0000000..cc5cefa
--- /dev/null
+++ b/source/lib/replace/libreplace_ld.m4
@@ -0,0 +1,129 @@
+AC_DEFUN([AC_LD_EXPORT_DYNAMIC],
+[
+saved_LDFLAGS="$LDFLAGS"
+if AC_TRY_COMMAND([${CC-cc} $CFLAGS -Wl,--version 2>&1 | grep "GNU ld" >/dev/null]); then
+	LD_EXPORT_DYNAMIC="-Wl,-export-dynamic"
+else
+	case "$host_os" in
+		hpux* )
+		  LD_EXPORT_DYNAMIC="-Wl,-E"
+		  ;;
+		* )
+		  LD_EXPORT_DYNAMIC=""
+		  ;;
+	  esac
+fi
+AC_SUBST(LD_EXPORT_DYNAMIC)
+LDFLAGS="$saved_LDFLAGS"
+])
+
+AC_DEFUN([AC_LD_PICFLAG],
+[
+case "$host_os" in
+	*linux*) 
+		PICFLAG="-fPIC" 
+		;;
+	*solaris*)
+		if test "${GCC}" = "yes"; then
+			PICFLAG="-fPIC"
+		else
+			PICFLAG="-KPIC"
+		fi
+		;;
+	*sunos*)
+		PICFLAG="-KPIC"   # Is this correct for SunOS
+		;;
+	*netbsd* | *freebsd* | *dragonfly* )  
+		PICFLAG="-fPIC -DPIC"
+		;;
+	*openbsd*)
+		PICFLAG="-fPIC"
+		;;
+	*irix*)
+		if test "${GCC}" = "yes"; then
+			PICFLAG="-fPIC"
+		else 
+			PICFLAG="-KPIC"
+		fi
+		;;
+	*aix*)
+		# as AIX code is always position independent...
+		PICFLAG="-O2"
+		;;
+	*hpux*)
+		if test $ac_cv_prog_cc_Ae = yes; then
+			PICFLAG="+z +ESnolit"
+		elif test "${GCC}" = "yes"; then
+			PICFLAG="-fPIC"
+		fi
+		if test "$host_cpu" = "ia64"; then
+			PICFLAG="+z"
+		fi
+		;;
+	*osf*)
+		PICFLAG="-fPIC"
+		;;
+	*unixware*)
+		PICFLAG="-KPIC"
+		;;
+	*darwin*)
+		;;
+esac
+AC_SUBST(PICFLAG)
+])
+
+AC_DEFUN([AC_LD_SHLDFLAGS],
+[
+	SHLD_FLAGS="-shared"
+
+	case "$host_os" in
+		*linux*)
+			SHLD_FLAGS="-shared -Wl,-Bsymbolic"
+			;;
+		*solaris*)
+			SHLD_FLAGS="-G"
+			if test "${GCC}" = "no"; then
+				## ${CFLAGS} added for building 64-bit shared 
+				## libs using Sun's Compiler
+				SHLD_FLAGS="-G \${CFLAGS}"
+			fi
+			;;
+		*sunos*)
+			SHLD_FLAGS="-G"
+			;;
+		*irix*)
+			SHLD_FLAGS="-shared"
+			;;
+		*aix*)
+			SHLD_FLAGS="-Wl,-G,-bexpall,-bbigtoc"
+			;;
+		*hpux*)
+			if test $ac_cv_prog_cc_Ae = yes; then
+				SHLD_FLAGS="-b -Wl,-B,symbolic,-b,-z"
+			fi
+			;;
+		*darwin*)
+			SHLD_FLAGS="-bundle -flat_namespace -undefined suppress"
+			;;
+	esac
+
+	AC_SUBST(SHLD_FLAGS)
+])
+
+AC_DEFUN([AC_LD_SHLIBEXT],
+[
+	SHLIBEXT="so"
+	case "$host_os" in
+		*hpux*)
+			if test "$host_cpu" = "ia64"; then
+				SHLIBEXT="so"
+			else
+				SHLIBEXT="sl"
+			fi
+		;;
+		*darwin*)
+			SHLIBEXT="dylib"
+		;;
+	esac
+	AC_SUBST(SHLIBEXT)
+])
diff --git a/source/lib/replace/system/passwd.h b/source/lib/replace/system/passwd.h
index 53d35e7..36fca7b 100644
--- a/source/lib/replace/system/passwd.h
+++ b/source/lib/replace/system/passwd.h
@@ -27,6 +27,9 @@
 
 */
 
+/* this needs to be included before nss_wrapper.h on some systems */
+#include <unistd.h>
+
 #ifdef HAVE_PWD_H
 #include <pwd.h>
 #endif
@@ -93,4 +96,11 @@ char *rep_getpass(const char *prompt);
 #define ULTRIX_AUTH 1
 #endif
 
+#ifdef NSS_WRAPPER
+#ifndef NSS_WRAPPER_NOT_REPLACE
+#define NSS_WRAPPER_REPLACE
+#endif
+#include "lib/nss_wrapper/nss_wrapper.h"
+#endif
+
 #endif


-- 
Samba Shared Repository


More information about the samba-cvs mailing list