aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--sim/ppc/ChangeLog13
-rwxr-xr-xsim/ppc/configure28
-rw-r--r--sim/ppc/configure.ac25
-rw-r--r--sim/ppc/dgen.c2
-rw-r--r--sim/ppc/filter.c2
-rw-r--r--sim/ppc/igen.c2
-rw-r--r--sim/ppc/lf.c2
-rw-r--r--sim/ppc/misc.c2
-rw-r--r--sim/ppc/misc.h2
-rw-r--r--sim/ppc/table.c2
10 files changed, 73 insertions, 7 deletions
diff --git a/sim/ppc/ChangeLog b/sim/ppc/ChangeLog
index 9f1d613..85c20f2 100644
--- a/sim/ppc/ChangeLog
+++ b/sim/ppc/ChangeLog
@@ -1,3 +1,16 @@
+2009-11-13 Nathan Froyd <froydnj@codesourcery.com>
+
+ * 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 <joel.sherrill@oarcorp.com>
* std-config.h: Fix spelling error.
diff --git a/sim/ppc/configure b/sim/ppc/configure
index abdfdb2..f2f0be8 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 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
diff --git a/sim/ppc/dgen.c b/sim/ppc/dgen.c
index 54e0e26..98f9eb0 100644
--- a/sim/ppc/dgen.c
+++ b/sim/ppc/dgen.c
@@ -27,7 +27,7 @@
#include <ctype.h>
#include <stdarg.h>
-#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 c901a17..a159775 100644
--- a/sim/ppc/filter.c
+++ b/sim/ppc/filter.c
@@ -21,7 +21,7 @@
#include <stdio.h>
-#include "config.h"
+#include "build-config.h"
#ifdef HAVE_STRING_H
#include <string.h>
diff --git a/sim/ppc/igen.c b/sim/ppc/igen.c
index cc09662..4ac6708 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 fc2a3c1..e47dfda 100644
--- a/sim/ppc/lf.c
+++ b/sim/ppc/lf.c
@@ -23,7 +23,7 @@
#include <stdarg.h>
#include <ctype.h>
-#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 d8e54ed..23e981a 100644
--- a/sim/ppc/misc.c
+++ b/sim/ppc/misc.c
@@ -23,7 +23,7 @@
#include <stdarg.h>
#include <ctype.h>
-#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 50301fd..d09d5fe 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 <stdio.h>
#include <ctype.h>
diff --git a/sim/ppc/table.c b/sim/ppc/table.c
index d9538b3..db3f783 100644
--- a/sim/ppc/table.c
+++ b/sim/ppc/table.c
@@ -25,7 +25,7 @@
#include <fcntl.h>
#include <ctype.h>
-#include "config.h"
+#include "build-config.h"
#include "misc.h"
#include "lf.h"
#include "table.h"