summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrew Tridgell <tridge@samba.org>2005-06-04 11:39:23 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 13:17:34 -0500
commit86bcccfba5ac348083f3d37911f30f1d18508688 (patch)
tree6b1c9f0f49b5a0f66d2485f346e92e36c7902af2
parentd26f46f72c4149cbe404ef23a43a76d7605edc96 (diff)
downloadsamba-86bcccfba5ac348083f3d37911f30f1d18508688.tar.gz
samba-86bcccfba5ac348083f3d37911f30f1d18508688.tar.bz2
samba-86bcccfba5ac348083f3d37911f30f1d18508688.zip
r7271: 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. (This used to be commit a31ec2a750d1e668e8ccdbbcb01762bfbc08cce5)
-rw-r--r--source4/build/smb_build/config_mk.pm3
-rw-r--r--source4/build/smb_build/makefile.pm27
2 files changed, 28 insertions, 2 deletions
diff --git a/source4/build/smb_build/config_mk.pm b/source4/build/smb_build/config_mk.pm
index f6e2e4bdcd..74ba8f2c2e 100644
--- a/source4/build/smb_build/config_mk.pm
+++ b/source4/build/smb_build/config_mk.pm
@@ -23,7 +23,8 @@ my %attribute_types = (
"MAJOR_VERSION" => "string",
"MINOR_VERSION" => "string",
"RELEASE_VERSION" => "string",
- "ENABLE" => "bool"
+ "ENABLE" => "bool",
+ "TARGET_CFLAGS" => "string"
);
###########################################################
diff --git a/source4/build/smb_build/makefile.pm b/source4/build/smb_build/makefile.pm
index 593fc5d65d..74ca539a09 100644
--- a/source4/build/smb_build/makefile.pm
+++ b/source4/build/smb_build/makefile.pm
@@ -103,6 +103,24 @@ __EOD__
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 @@ sub _prepare_std_CC_rule($$$$$)
# 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 @@ __EOD__
$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 @@ library_$ctx->{NAME}: basics $ctx->{TARGET}
__EOD__
+$output .= add_target_flags($ctx, "library_" . $ctx->{NAME});
+
return $output;
}
@@ -514,6 +537,8 @@ binary_$ctx->{BINARY}: basics bin/$ctx->{BINARY}
__EOD__
+$output .= add_target_flags($ctx, "binary_" . $ctx->{BINARY});
+
return $output;
}