diff options
Diffstat (limited to 'source4/build')
-rw-r--r-- | source4/build/m4/check_cc.m4 | 14 | ||||
-rw-r--r-- | source4/build/smb_build/makefile.pm | 4 |
2 files changed, 13 insertions, 5 deletions
diff --git a/source4/build/m4/check_cc.m4 b/source4/build/m4/check_cc.m4 index 8bc160eb82..aa6c8752ed 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=no -else BROKEN_CC=yes +else + BROKEN_CC=no fi AC_SUBST(BROKEN_CC) @@ -152,7 +152,15 @@ if test -n "$DEVELOPER_CFLAGS"; then fi # allow for --with-hostcc=gcc -AC_ARG_WITH(hostcc,[ --with-hostcc=compiler choose host compiler],[HOSTCC=$withval],[HOSTCC=$CC]) +AC_ARG_WITH(hostcc,[ --with-hostcc=compiler choose host compiler], +[HOSTCC=$withval], +[ +if test z"$cross_compiling" = "yes"; then + HOSTCC=cc +else + HOSTCC=$CC +fi +]) AC_SUBST(HOSTCC) AC_PATH_PROG(GCOV,gcov) diff --git a/source4/build/smb_build/makefile.pm b/source4/build/smb_build/makefile.pm index 9215dee3a6..f0c17b693e 100644 --- a/source4/build/smb_build/makefile.pm +++ b/source4/build/smb_build/makefile.pm @@ -249,7 +249,7 @@ sub _prepare_std_CC_rule($$$$$) \@\$(CC) `script/cflags.sh \$\@` \$(CFLAGS) $flags -c \$< -o \$\@ __EOD__ if ($config{BROKEN_CC} eq "yes") { - $ret.= ' -mv `echo \$\@ | sed \'s%^.*/%%g\'` \$\@ + $ret.= ' -mv `echo $@ | sed \'s%^.*/%%g\'` $@ '; } return $ret."\n"; @@ -263,7 +263,7 @@ sub _prepare_hostcc_rule() \@\$(HOSTCC) `script/cflags.sh \$\@` \$(CFLAGS) -c \$< -o \$\@ __EOD__ if ($config{BROKEN_CC} eq "yes") { - $ret .= ' -mv `echo \$\@ | sed \'s%^.*/%%g\'` \$\@ + $ret .= ' -mv `echo $@ | sed \'s%^.*/%%g\' -e \'s%\.ho$$%.o%\'` $@ '; } |