summaryrefslogtreecommitdiff
path: root/source4/build
diff options
context:
space:
mode:
authorJelmer Vernooij <jelmer@samba.org>2005-09-17 02:10:15 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 13:38:13 -0500
commit7f08aa1dd516dfe0e8a79575ed736e1e09a10f9d (patch)
tree2d424c7bd5576cf06162cefdedf3ce5dca3b84f5 /source4/build
parentf3bce652c8c33712ffbb6c0a731f61b05f9d4be0 (diff)
downloadsamba-7f08aa1dd516dfe0e8a79575ed736e1e09a10f9d.tar.gz
samba-7f08aa1dd516dfe0e8a79575ed736e1e09a10f9d.tar.bz2
samba-7f08aa1dd516dfe0e8a79575ed736e1e09a10f9d.zip
r10287: Compile compilers for build host. This fixes some bits of
the mingw32 build (it now fails on missing inet_aton / in_addr definitions). Find sane default for HOSTCC (This used to be commit 1a833690b8fd9a22169882c41704d24f2d52b2d9)
Diffstat (limited to 'source4/build')
-rw-r--r--source4/build/m4/check_cc.m414
-rw-r--r--source4/build/smb_build/makefile.pm4
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%\'` $@
';
}