svn commit: samba r25851 - in branches/SAMBA_4_0: . source/build/m4 source/lib/ldb source/lib/replace

jelmer at samba.org jelmer at samba.org
Tue Nov 6 02:17:06 GMT 2007


Author: jelmer
Date: 2007-11-06 02:17:05 +0000 (Tue, 06 Nov 2007)
New Revision: 25851

WebSVN: http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=rev&root=samba&rev=25851

Log:
Move system-specific ldflags checks to libreplace so they can be used by ldb.
Modified:
   branches/SAMBA_4_0/
   branches/SAMBA_4_0/.bzrignore
   branches/SAMBA_4_0/source/build/m4/check_ld.m4
   branches/SAMBA_4_0/source/lib/ldb/Makefile.in
   branches/SAMBA_4_0/source/lib/ldb/configure.ac
   branches/SAMBA_4_0/source/lib/replace/libreplace_ld.m4


Changeset:

Property changes on: branches/SAMBA_4_0
___________________________________________________________________
Name: bzr:revision-info
...skipped...
Name: bzr:revision-id:v3-trunk0
...skipped...

Modified: branches/SAMBA_4_0/.bzrignore
===================================================================
--- branches/SAMBA_4_0/.bzrignore	2007-11-06 02:16:55 UTC (rev 25850)
+++ branches/SAMBA_4_0/.bzrignore	2007-11-06 02:17:05 UTC (rev 25851)
@@ -204,3 +204,4 @@
 source/torture/winbind/proto.h
 source/lib/ldb/tdbtest.ldb
 source/lib/ldb/tdbtest.ldb
+*.po

Modified: branches/SAMBA_4_0/source/build/m4/check_ld.m4
===================================================================
--- branches/SAMBA_4_0/source/build/m4/check_ld.m4	2007-11-06 02:16:55 UTC (rev 25850)
+++ branches/SAMBA_4_0/source/build/m4/check_ld.m4	2007-11-06 02:17:05 UTC (rev 25851)
@@ -31,7 +31,6 @@
 BLDSHARED="false"
 LD="${CC}"
 SHLD="${CC}"
-SHLD_FLAGS="-shared"
 SHLIBEXT="so"
 SONAMEFLAG=""
 PICFLAG=""
@@ -53,29 +52,22 @@
 case "$host_os" in
 	*linux*)
 		BLDSHARED="true"
-		SHLD_FLAGS="-shared -Wl,-Bsymbolic"
 		SHLD_UNDEF_FLAGS="-Wl,--allow-shlib-undefined"
 		LDFLAGS="$LDFLAGS -Wl,--export-dynamic"
 		SONAMEFLAG="-Wl,-soname="
 		;;
 	*solaris*)
 		BLDSHARED="true"
-		SHLD_FLAGS="-G"
 		SONAMEFLAG="-h "
 		if test "${GCC}" = "yes"; then
 			SONAMEFLAG="-Wl,-soname="
 			if test "${ac_cv_prog_gnu_ld}" = "yes"; then
 				LDFLAGS="$LDFLAGS -Wl,-E"
 			fi
-		else
-			## ${CFLAGS} added for building 64-bit shared 
-			## libs using Sun's Compiler
-			SHLD_FLAGS="-G \${CFLAGS}"
 		fi
 		;;
 	*sunos*)
 		BLDSHARED="true"
-		SHLD_FLAGS="-G"
 		SONAMEFLAG="-Wl,-h,"
 		;;
 	*netbsd* | *freebsd* | *dragonfly* )  
@@ -92,21 +84,18 @@
 	*irix*)
 		# disabled because us4 fails to link libtorture.so
 		BLDSHARED="false"
-		SHLD_FLAGS="-set_version sgi1.0 -shared"
 		SONAMEFLAG="-soname "
 		SHLD="${PROG_LD}"
 		;;
 	*aix*)
 		# disabled because us4 fails to link libtorture.so
 		BLDSHARED="false"
-		SHLD_FLAGS="-Wl,-G,-bexpall,-bbigtoc"
 		LDFLAGS="$LDFLAGS -Wl,-brtl,-bexpall,-bbigtoc"
 		;;
 	*hpux*)
 		# Use special PIC flags for the native HP-UX compiler.
 		if test $ac_cv_prog_cc_Ae = yes; then
 			BLDSHARED="true"
-			SHLD_FLAGS="-b -Wl,-B,symbolic,-b,-z"
 			SONAMEFLAG="-Wl,+h "
 		elif test "${GCC}" = "yes"; then
 			BLDSHARED="true" # I hope this is correct
@@ -130,7 +119,6 @@
 		;;
 	*darwin*)
 		BLDSHARED="true"
-		SHLD_FLAGS="-bundle -flat_namespace -undefined suppress"
 		SHLIBEXT="dylib"
 		;;
 esac
@@ -150,6 +138,8 @@
 AC_MSG_RESULT([$STLD_FLAGS])
 
 AC_LD_PICFLAG
+AC_LD_EXPORT_DYNAMIC
+AC_LD_SHLDFLAGS
 
 AC_ARG_ENABLE(shared,
 [  --disable-shared        Disable testing for building shared libraries],

Modified: branches/SAMBA_4_0/source/lib/ldb/Makefile.in
===================================================================
--- branches/SAMBA_4_0/source/lib/ldb/Makefile.in	2007-11-06 02:16:55 UTC (rev 25850)
+++ branches/SAMBA_4_0/source/lib/ldb/Makefile.in	2007-11-06 02:17:05 UTC (rev 25851)
@@ -35,6 +35,7 @@
 SHLIBEXT = @SHLIBEXT@
 
 LD_EXPORT_DYNAMIC = @LD_EXPORT_DYNAMIC@
+SHLD_FLAGS = @SHLD_FLAGS@
 
 PICFLAG = @PICFLAG@
 CFLAGS=-g -I$(srcdir)/include -Iinclude -I$(srcdir) -I$(srcdir)/.. \
@@ -112,10 +113,10 @@
 	@-ranlib $@
 
 lib/libnss_ldb.so.2: $(NSS_OBJ) $(LIBS) bin/libldb.a
-	$(CC) -shared -Wl,-soname,libnss_ldb.so.2 -o lib/libnss_ldb.so.2 $(NSS_OBJ) $(OBJS) $(LIB_FLAGS)
+	$(CC) $(SHLD_FLAGS) -Wl,-soname,libnss_ldb.so.2 -o lib/libnss_ldb.so.2 $(NSS_OBJ) $(OBJS) $(LIB_FLAGS)
 
 sample_module.$(SHLIBEXT): tests/sample_module.po 
-	$(CC) -shared -o $@ tests/sample_module.po 
+	$(CC) $(SHLD_FLAGS) -o $@ tests/sample_module.po 
 
 bin/ldbadd: tools/ldbadd.o tools/cmdline.o $(LIBS)
 	$(CC) -o bin/ldbadd tools/ldbadd.o tools/cmdline.o $(LIB_FLAGS) $(LD_EXPORT_DYNAMIC)

Modified: branches/SAMBA_4_0/source/lib/ldb/configure.ac
===================================================================
--- branches/SAMBA_4_0/source/lib/ldb/configure.ac	2007-11-06 02:16:55 UTC (rev 25850)
+++ branches/SAMBA_4_0/source/lib/ldb/configure.ac	2007-11-06 02:17:05 UTC (rev 25851)
@@ -73,6 +73,7 @@
 
 AC_LD_EXPORT_DYNAMIC
 AC_LD_PICFLAG
+AC_LD_SHLDFLAGS
 
 m4_include(libldb.m4)
 AC_OUTPUT(Makefile ldb.pc)

Modified: branches/SAMBA_4_0/source/lib/replace/libreplace_ld.m4
===================================================================
--- branches/SAMBA_4_0/source/lib/replace/libreplace_ld.m4	2007-11-06 02:16:55 UTC (rev 25850)
+++ branches/SAMBA_4_0/source/lib/replace/libreplace_ld.m4	2007-11-06 02:17:05 UTC (rev 25851)
@@ -63,3 +63,41 @@
 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="-set_version sgi1.0 -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)
+])



More information about the samba-cvs mailing list