aboutsummaryrefslogtreecommitdiff
path: root/sim/ppc/configure.ac
diff options
context:
space:
mode:
authorNathan Froyd <froydnj@codesourcery.com>2009-11-14 02:22:32 +0000
committerNathan Froyd <froydnj@codesourcery.com>2009-11-14 02:22:32 +0000
commit68a3e151dab3d8be31eb5347e10db53daba25e2a (patch)
tree727033bc899e90f5dafd282d37a0ca64f3d8f1ab /sim/ppc/configure.ac
parent4473e00469e3453a1ddbb93e8f99b08cfe0702e0 (diff)
downloadgdb-68a3e151dab3d8be31eb5347e10db53daba25e2a.zip
gdb-68a3e151dab3d8be31eb5347e10db53daba25e2a.tar.gz
gdb-68a3e151dab3d8be31eb5347e10db53daba25e2a.tar.bz2
* 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.
Diffstat (limited to 'sim/ppc/configure.ac')
-rw-r--r--sim/ppc/configure.ac25
1 files changed, 25 insertions, 0 deletions
diff --git a/sim/ppc/configure.ac b/sim/ppc/configure.ac
index e8ccfe9..55699b2 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