svn commit: samba r22035 - in branches/SAMBA_4_0/source/build: m4 smb_build

jpeach at samba.org jpeach at samba.org
Mon Apr 2 17:23:24 GMT 2007


Author: jpeach
Date: 2007-04-02 17:23:23 +0000 (Mon, 02 Apr 2007)
New Revision: 22035

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

Log:
Introduce HOSTLD which is needed to link the asn1 compiler when cross
compiling.

Modified:
   branches/SAMBA_4_0/source/build/m4/check_ld.m4
   branches/SAMBA_4_0/source/build/smb_build/makefile.pm


Changeset:
Modified: branches/SAMBA_4_0/source/build/m4/check_ld.m4
===================================================================
--- branches/SAMBA_4_0/source/build/m4/check_ld.m4	2007-04-02 17:17:40 UTC (rev 22034)
+++ branches/SAMBA_4_0/source/build/m4/check_ld.m4	2007-04-02 17:23:23 UTC (rev 22035)
@@ -36,6 +36,17 @@
 SONAMEFLAG=""
 PICFLAG=""
 
+# allow for --with-hostld=gcc
+AC_ARG_WITH(hostld,[  --with-hostld=linker    choose host linker],
+[HOSTLD=$withval],
+[
+if test z"$cross_compiling" = "yes"; then
+	HOSTLD='$(HOSTCC)'
+else
+	HOSTLD='$(LD)'
+fi
+])
+
 AC_MSG_CHECKING([ability to build shared libraries])
 
 # and these are for particular systems
@@ -144,6 +155,8 @@
 AC_MSG_CHECKING([LDFLAGS])
 AC_MSG_RESULT([$LDFLAGS])
 
+AC_SUBST(HOSTLD)
+
 AC_MSG_CHECKING([STLD])
 AC_MSG_RESULT([$STLD])
 AC_MSG_CHECKING([STLD_FLAGS])

Modified: branches/SAMBA_4_0/source/build/smb_build/makefile.pm
===================================================================
--- branches/SAMBA_4_0/source/build/smb_build/makefile.pm	2007-04-02 17:17:40 UTC (rev 22034)
+++ branches/SAMBA_4_0/source/build/smb_build/makefile.pm	2007-04-02 17:23:23 UTC (rev 22035)
@@ -141,6 +141,9 @@
 LD=$self->{config}->{LD} 
 LDFLAGS=$self->{config}->{LDFLAGS} -L$libdir
 
+HOSTLD=$self->{config}->{HOSTLD}
+# It's possible that we ought to have HOSTLD_LDFLAGS as well
+
 STLD=$self->{config}->{STLD}
 STLD_FLAGS=$self->{config}->{STLD_FLAGS}
 
@@ -387,11 +390,23 @@
 $self->output(<< "__EOD__"
 $installdir/$ctx->{BINARY}: \$($ctx->{TYPE}_$ctx->{NAME}_DEPEND_LIST) \$($ctx->{TYPE}_$ctx->{NAME}_FULL_OBJ_LIST)
 	\@echo Linking \$\@
+__EOD__
+	);
+
+	if ($ctx->{"USE_HOSTCC"} =~ m/yes/i) {
+		$self->output(<< "__EOD__"
+	\@\$(HOSTLD) \$(LDFLAGS) -o \$\@ \$(INSTALL_LINK_FLAGS) \\
+		\$\($ctx->{TYPE}_$ctx->{NAME}_LINK_FLAGS)
+__EOD__
+		);
+	} else {
+		$self->output(<< "__EOD__"
 	\@\$(LD) \$(LDFLAGS) -o \$\@ \$(INSTALL_LINK_FLAGS) \\
 		\$\($ctx->{TYPE}_$ctx->{NAME}_LINK_FLAGS) 
 
 __EOD__
-);
+		);
+	}
 }
 
 sub Manpage($$)



More information about the samba-cvs mailing list