From: Nathan Froyd Date: Sat, 14 Nov 2009 02:22:32 +0000 (+0000) Subject: * configure.ac: If build != host, create a separate build-config.h X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=68a3e151dab3d8be31eb5347e10db53daba25e2a;p=binutils-gdb.git * configure.ac: If build != host, create a separate build-config.h file desecribing the build machine. * configure: Regenerate. * lf.c: Include build-config.h instead of config.h. * dgen.c: Likewise. * igen.c: Likewise. * misc.c: Likewise. * misc.h: Likewise. * filter.c: Likewise. * table.c: Likewise. --- diff --git a/sim/ppc/ChangeLog b/sim/ppc/ChangeLog index 9f1d6136729..85c20f2c400 100644 --- a/sim/ppc/ChangeLog +++ b/sim/ppc/ChangeLog @@ -1,3 +1,16 @@ +2009-11-13 Nathan Froyd + + * configure.ac: If build != host, create a separate build-config.h + file desecribing the build machine. + * configure: Regenerate. + * lf.c: Include build-config.h instead of config.h. + * dgen.c: Likewise. + * igen.c: Likewise. + * misc.c: Likewise. + * misc.h: Likewise. + * filter.c: Likewise. + * table.c: Likewise. + 2009-10-15 Joel Sherrill * std-config.h: Fix spelling error. diff --git a/sim/ppc/configure b/sim/ppc/configure index abdfdb20151..f2f0be86f9a 100755 --- a/sim/ppc/configure +++ b/sim/ppc/configure @@ -5867,6 +5867,32 @@ $as_echo "no" >&6; } sim_fpu= fi +# Since we run commands on the build system, we have to create a +# separate config header for the build system if build != host. +if test x$host = x$build; then + ac_config_commands="$ac_config_commands build-config.h" + +else + tempdir=build.$$ + rm -rf $tempdir + mkdir $tempdir + cd $tempdir + case ${srcdir} in + /* | A-Za-z:\\/* ) realsrcdir=${srcdir};; + *) realsrcdir=../${srcdir};; + esac + saved_CFLAGS="${CFLAGS}" + CC="${CC_FOR_BUILD}" CFLAGS="${CFLAGS_FOR_BUILD}" \ + LDFLAGS="${LDFLAGS_FOR_BUILD}" \ + ${realsrcdir}/configure \ + --enable-languages=${enable_languages-all} \ + --target=$target_alias --host=$build_alias --build=$build_alias + CFLAGS="${saved_CFLAGS}" + mv config.h ../build-config.h + cd .. + rm -rf $tempdir +fi + @@ -6701,6 +6727,7 @@ for ac_config_target in $ac_config_targets do case $ac_config_target in "config.h") CONFIG_HEADERS="$CONFIG_HEADERS config.h:config.in" ;; + "build-config.h") CONFIG_COMMANDS="$CONFIG_COMMANDS build-config.h" ;; "Makefile") CONFIG_FILES="$CONFIG_FILES Makefile" ;; "default") CONFIG_COMMANDS="$CONFIG_COMMANDS default" ;; @@ -7247,6 +7274,7 @@ $as_echo "$as_me: executing $ac_file commands" >&6;} case $ac_file$ac_mode in + "build-config.h":C) cp config.h build-config.h ;; "default":C) case x$CONFIG_HEADERS in xconfig.h:config.in) echo > stamp-h ;; esac ;; esac diff --git a/sim/ppc/configure.ac b/sim/ppc/configure.ac index e8ccfe97daf..55699b228c0 100644 --- a/sim/ppc/configure.ac +++ b/sim/ppc/configure.ac @@ -848,6 +848,31 @@ else sim_fpu= fi +# Since we run commands on the build system, we have to create a +# separate config header for the build system if build != host. +if test x$host = x$build; then + AC_CONFIG_COMMANDS([build-config.h],[cp config.h build-config.h]) +else + tempdir=build.$$ + rm -rf $tempdir + mkdir $tempdir + cd $tempdir + case ${srcdir} in + /* | [A-Za-z]:[\\/]* ) realsrcdir=${srcdir};; + *) realsrcdir=../${srcdir};; + esac + saved_CFLAGS="${CFLAGS}" + CC="${CC_FOR_BUILD}" CFLAGS="${CFLAGS_FOR_BUILD}" \ + LDFLAGS="${LDFLAGS_FOR_BUILD}" \ + ${realsrcdir}/configure \ + --enable-languages=${enable_languages-all} \ + --target=$target_alias --host=$build_alias --build=$build_alias + CFLAGS="${saved_CFLAGS}" + mv config.h ../build-config.h + cd .. + rm -rf $tempdir +fi + dnl Check for exe extension AC_EXEEXT diff --git a/sim/ppc/dgen.c b/sim/ppc/dgen.c index 54e0e2657c9..98f9eb0d233 100644 --- a/sim/ppc/dgen.c +++ b/sim/ppc/dgen.c @@ -27,7 +27,7 @@ #include #include -#include "config.h" +#include "build-config.h" #include "misc.h" #include "lf.h" #include "table.h" diff --git a/sim/ppc/filter.c b/sim/ppc/filter.c index c901a1777f1..a1597757cd7 100644 --- a/sim/ppc/filter.c +++ b/sim/ppc/filter.c @@ -21,7 +21,7 @@ #include -#include "config.h" +#include "build-config.h" #ifdef HAVE_STRING_H #include diff --git a/sim/ppc/igen.c b/sim/ppc/igen.c index cc096626f84..4ac6708c3ec 100644 --- a/sim/ppc/igen.c +++ b/sim/ppc/igen.c @@ -25,7 +25,7 @@ #include "misc.h" #include "lf.h" #include "table.h" -#include "config.h" +#include "build-config.h" #include "filter.h" diff --git a/sim/ppc/lf.c b/sim/ppc/lf.c index fc2a3c13524..e47dfda5da2 100644 --- a/sim/ppc/lf.c +++ b/sim/ppc/lf.c @@ -23,7 +23,7 @@ #include #include -#include "config.h" +#include "build-config.h" #include "misc.h" #include "lf.h" diff --git a/sim/ppc/misc.c b/sim/ppc/misc.c index d8e54ed497b..23e981a1847 100644 --- a/sim/ppc/misc.c +++ b/sim/ppc/misc.c @@ -23,7 +23,7 @@ #include #include -#include "config.h" +#include "build-config.h" #include "misc.h" #ifdef HAVE_STDLIB_H diff --git a/sim/ppc/misc.h b/sim/ppc/misc.h index 50301fd64fc..d09d5fecfda 100644 --- a/sim/ppc/misc.h +++ b/sim/ppc/misc.h @@ -21,7 +21,7 @@ /* Frustrating header junk */ -#include "config.h" +#include "build-config.h" #include #include diff --git a/sim/ppc/table.c b/sim/ppc/table.c index d9538b3d7d8..db3f783bb3e 100644 --- a/sim/ppc/table.c +++ b/sim/ppc/table.c @@ -25,7 +25,7 @@ #include #include -#include "config.h" +#include "build-config.h" #include "misc.h" #include "lf.h" #include "table.h"