svn commit: samba r10283 - in branches/SAMBA_4_0/source/build: m4
smb_build
jelmer at samba.org
jelmer at samba.org
Sat Sep 17 00:42:06 GMT 2005
Author: jelmer
Date: 2005-09-17 00:42:05 +0000 (Sat, 17 Sep 2005)
New Revision: 10283
WebSVN: http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=rev&root=samba&rev=10283
Log:
Eliminate some more use of autoconf substitution variables.
Add makefile rule for '.ho' files (compiled with host compiler). This
does not allow for cross-compiling yet as that requires a HOSTLD as well.
Modified:
branches/SAMBA_4_0/source/build/m4/check_cc.m4
branches/SAMBA_4_0/source/build/smb_build/makefile.pm
Changeset:
Modified: branches/SAMBA_4_0/source/build/m4/check_cc.m4
===================================================================
--- branches/SAMBA_4_0/source/build/m4/check_cc.m4 2005-09-17 00:28:06 UTC (rev 10282)
+++ branches/SAMBA_4_0/source/build/m4/check_cc.m4 2005-09-17 00:42:05 UTC (rev 10283)
@@ -29,9 +29,9 @@
dnl Check if C compiler understands -c and -o at the same time
AC_PROG_CC_C_O
if eval "test \"`echo '$ac_cv_prog_cc_'${ac_cc}_c_o`\" = no"; then
- BROKEN_CC=
+ BROKEN_CC=no
else
- BROKEN_CC=#
+ BROKEN_CC=yes
fi
AC_SUBST(BROKEN_CC)
Modified: branches/SAMBA_4_0/source/build/smb_build/makefile.pm
===================================================================
--- branches/SAMBA_4_0/source/build/smb_build/makefile.pm 2005-09-17 00:28:06 UTC (rev 10282)
+++ branches/SAMBA_4_0/source/build/smb_build/makefile.pm 2005-09-17 00:42:05 UTC (rev 10283)
@@ -77,6 +77,8 @@
CC=$config{CC}
CFLAGS=-I\$(srcdir)/include -I\$(srcdir) -I\$(srcdir)/lib -D_SAMBA_BUILD_ -DHAVE_CONFIG_H $config{CFLAGS} $config{CPPFLAGS}
+PICFLAG=$config{PICFLAG}
+HOSTCC=$config{HOSTCC}
CPP=$config{CPP}
CPPFLAGS=$config{CPPFLAGS}
@@ -114,7 +116,7 @@
sub _prepare_SUFFIXES()
{
return << '__EOD__';
-.SUFFIXES: .x .c .et .y .l .d .o .h .h.gch .a .so .1 .1.xml .3 .3.xml .5 .5.xml .7 .7.xml
+.SUFFIXES: .x .c .et .y .l .d .o .h .h.gch .a .so .1 .1.xml .3 .3.xml .5 .5.xml .7 .7.xml .ho
__EOD__
}
@@ -194,16 +196,19 @@
{
my $ctx = shift;
- return << '__EOD__';
+ my $ret = << '__EOD__';
bin/.dummy:
@: >> $@ || : > $@
dynconfig.o: dynconfig.c Makefile
@echo Compiling $*.c
- @$(CC) $(CFLAGS) @PICFLAG@ $(PATH_FLAGS) -c $< -o $@
- at BROKEN_CC@ -mv `echo $@ | sed 's%^.*/%%g'` $@
-
+ @$(CC) $(CFLAGS) $(PICFLAG) $(PATH_FLAGS) -c $< -o $@
__EOD__
+ if ($config{BROKEN_CC} eq "yes") {
+ $ret .= ' -mv `echo $@ | sed \'s%^.*/%%g\'` $@
+';
+ }
+ return $ret."\n";
}
sub _prepare_depend_CC_rule()
@@ -237,16 +242,36 @@
{
my ($src,$dst,$flags,$message,$comment) = @_;
- return << "__EOD__";
+ my $ret = << "__EOD__";
# $comment
.$src.$dst:
\@echo $message \$\*.$src
\@\$(CC) `script/cflags.sh \$\@` \$(CFLAGS) $flags -c \$< -o \$\@
-\@BROKEN_CC\@ -mv `echo \$\@ | sed 's%^.*/%%g'` \$\@
+__EOD__
+ if ($config{BROKEN_CC} eq "yes") {
+ $ret.= ' -mv `echo \$\@ | sed \'s%^.*/%%g\'` \$\@
+';
+ }
+ return $ret."\n";
+}
+sub _prepare_hostcc_rule()
+{
+ my $ret = << "__EOD__";
+.c.ho:
+ \@echo Compiling \$\*.c with host compiler
+ \@\$(HOSTCC) `script/cflags.sh \$\@` \$(CFLAGS) -c \$< -o \$\@
__EOD__
+ if ($config{BROKEN_CC} eq "yes") {
+ $ret .= ' -mv `echo \$\@ | sed \'s%^.*/%%g\'` \$\@
+';
+ }
+
+ return $ret."\n";
}
+
+
sub array2oneperline($)
{
my $array = shift;
@@ -611,8 +636,9 @@
$output .= _prepare_default_rule();
$output .= _prepare_SUFFIXES();
$output .= _prepare_dummy_MAKEDIR();
- $output .= _prepare_std_CC_rule("c","o",$config{PICFLAG},"Compiling","Rule for std objectfiles");
- $output .= _prepare_std_CC_rule("h","h.gch",$config{PICFLAG},"Precompiling","Rule for precompiled headerfiles");
+ $output .= _prepare_hostcc_rule();
+ $output .= _prepare_std_CC_rule("c","o",'$(PICFLAG)',"Compiling","Rule for std objectfiles");
+ $output .= _prepare_std_CC_rule("h","h.gch",'$(PICFLAG)',"Precompiling","Rule for precompiled headerfiles");
$output .= _prepare_depend_CC_rule();
More information about the samba-cvs
mailing list