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 $@
[EMAIL PROTECTED]@      -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:
        [EMAIL PROTECTED] $message \$\*.$src
        [EMAIL PROTECTED](CC) `script/cflags.sh [EMAIL PROTECTED] \$(CFLAGS) 
$flags -c \$< -o \$\@
[EMAIL PROTECTED]@      -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:
+       [EMAIL PROTECTED] Compiling \$\*.c with host compiler
+       [EMAIL PROTECTED](HOSTCC) `script/cflags.sh [EMAIL PROTECTED] 
\$(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();
        

Reply via email to