diff options
author | Jelmer Vernooij <jelmer@samba.org> | 2005-09-17 00:42:05 +0000 |
---|---|---|
committer | Gerald (Jerry) Carter <jerry@samba.org> | 2007-10-10 13:38:13 -0500 |
commit | 3a4da8c0dbe1d50ca4de013fdb7c860a5196f4ca (patch) | |
tree | e106776239615391608d99554a8cee39b731d56a /source4 | |
parent | 5c708830bc07e1b59c063ae1c04b8fdf2b972318 (diff) | |
download | samba-3a4da8c0dbe1d50ca4de013fdb7c860a5196f4ca.tar.gz samba-3a4da8c0dbe1d50ca4de013fdb7c860a5196f4ca.tar.bz2 samba-3a4da8c0dbe1d50ca4de013fdb7c860a5196f4ca.zip |
r10283: 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.
(This used to be commit c675ba0ee437ade4abe839a2fb193b9e3a98a3de)
Diffstat (limited to 'source4')
-rw-r--r-- | source4/build/m4/check_cc.m4 | 4 | ||||
-rw-r--r-- | source4/build/smb_build/makefile.pm | 44 |
2 files changed, 37 insertions, 11 deletions
diff --git a/source4/build/m4/check_cc.m4 b/source4/build/m4/check_cc.m4 index 19261d50b6..8bc160eb82 100644 --- a/source4/build/m4/check_cc.m4 +++ b/source4/build/m4/check_cc.m4 @@ -29,9 +29,9 @@ AC_ISC_POSIX 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) diff --git a/source4/build/smb_build/makefile.pm b/source4/build/smb_build/makefile.pm index 2027c27cdc..9215dee3a6 100644 --- a/source4/build/smb_build/makefile.pm +++ b/source4/build/smb_build/makefile.pm @@ -77,6 +77,8 @@ PERL=$config{PERL} 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 @@ __EOD__ 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 @@ sub _prepare_dummy_MAKEDIR() { 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 $@ -@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 @@ sub _prepare_std_CC_rule($$$$$) { 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 @@ sub _prepare_makefile_in($) $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(); |