svn commit: samba r7271 - in branches/SAMBA_4_0/source/build/smb_build: .

tridge at samba.org tridge at samba.org
Sat Jun 4 11:39:23 GMT 2005


Author: tridge
Date: 2005-06-04 11:39:23 +0000 (Sat, 04 Jun 2005)
New Revision: 7271

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

Log:
added the ability to specify a target specific set of CFLAGS for
binaries and libraries. This makes it possible to build heimdal with
our build system, which means users don't have to suffer two build
systems.

Modified:
   branches/SAMBA_4_0/source/build/smb_build/config_mk.pm
   branches/SAMBA_4_0/source/build/smb_build/makefile.pm


Changeset:
Modified: branches/SAMBA_4_0/source/build/smb_build/config_mk.pm
===================================================================
--- branches/SAMBA_4_0/source/build/smb_build/config_mk.pm	2005-06-04 11:17:05 UTC (rev 7270)
+++ branches/SAMBA_4_0/source/build/smb_build/config_mk.pm	2005-06-04 11:39:23 UTC (rev 7271)
@@ -23,7 +23,8 @@
 	"MAJOR_VERSION" => "string",
 	"MINOR_VERSION" => "string",
 	"RELEASE_VERSION" => "string",
-	"ENABLE" => "bool"
+	"ENABLE" => "bool",
+	"TARGET_CFLAGS" => "string"
 );
 
 ###########################################################

Modified: branches/SAMBA_4_0/source/build/smb_build/makefile.pm
===================================================================
--- branches/SAMBA_4_0/source/build/smb_build/makefile.pm	2005-06-04 11:17:05 UTC (rev 7270)
+++ branches/SAMBA_4_0/source/build/smb_build/makefile.pm	2005-06-04 11:39:23 UTC (rev 7271)
@@ -103,6 +103,24 @@
 	return $output;
 }
 
+
+#############################
+# return makefile fragment for 
+# target specific rules
+sub add_target_flags($$)
+{
+	my $ctx = shift;
+	my $name = shift;
+	my $output = "";
+	if ($ctx->{TARGET_CFLAGS}) {
+$output .= << "__EOD__";
+$name: TARGET_CFLAGS = $ctx->{TARGET_CFLAGS}
+__EOD__
+}
+        return $output;
+}
+
+
 sub _prepare_default_rule($)
 {
 	my $ctx = shift;
@@ -215,7 +233,7 @@
 # Start $comment
 .$src.$dst:
 	\@echo $message \$\*.$src
-	\@\$(CC) \$(CC_FLAGS) $flags -c \$< -o \$\@
+	\@\$(CC) \$(TARGET_CFLAGS) \$(CC_FLAGS) $flags -c \$< -o \$\@
 \@BROKEN_CC\@	-mv `echo \$\@ | sed 's%^.*/%%g'` \$\@
 #End $comment
 ###################################
@@ -400,11 +418,14 @@
 
 $output .= << "__EOD__";
 library_$ctx->{NAME}: basics bin/lib$ctx->{LIBRARY_NAME}
+
 # End Library $ctx->{NAME}
 ###################################
 
 __EOD__
 
+$output .= add_target_flags($ctx, "library_" . $ctx->{NAME});
+
 	return $output;
 }
 
@@ -461,6 +482,8 @@
 
 __EOD__
 
+$output .= add_target_flags($ctx, "library_" . $ctx->{NAME});
+
 	return $output;
 }
 
@@ -514,6 +537,8 @@
 
 __EOD__
 
+$output .= add_target_flags($ctx, "binary_" . $ctx->{BINARY});
+
 	return $output;
 }
 



More information about the samba-cvs mailing list