* configure.ac: If build != host, create a separate build-config.h
authorNathan Froyd <froydnj@codesourcery.com>
Sat, 14 Nov 2009 02:22:32 +0000 (02:22 +0000)
committerNathan Froyd <froydnj@codesourcery.com>
Sat, 14 Nov 2009 02:22:32 +0000 (02:22 +0000)
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.

sim/ppc/ChangeLog
sim/ppc/configure
sim/ppc/configure.ac
sim/ppc/dgen.c
sim/ppc/filter.c
sim/ppc/igen.c
sim/ppc/lf.c
sim/ppc/misc.c
sim/ppc/misc.h
sim/ppc/table.c

index 9f1d6136729af08797c690288229d00e18e9a46f..85c20f2c40028dfd0083800f42a4cef99d5a6bcb 100644 (file)
@@ -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.
index abdfdb20151f75c93d39046945a0fe9f42d4c3cb..f2f0be86f9ab776eaa25a06caec9bf35f8e1eedf 100755 (executable)
@@ -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
index e8ccfe97daf1148c76451b0006b0f10d87a3ac81..55699b228c0aa9dace193bb3893f5811e5c04b0c 100644 (file)
@@ -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
 
index 54e0e2657c9bf596141ccdff437402f59bcab4aa..98f9eb0d233cf2a8dbbc2a3bcb49287f2adefe53 100644 (file)
@@ -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"
index c901a1777f1129aca40ff85b63b123e1d4fd69cd..a1597757cd7f64034e8f198fb3e3e588bbf62dd1 100644 (file)
@@ -21,7 +21,7 @@
 
 #include <stdio.h>
 
-#include "config.h"
+#include "build-config.h"
 
 #ifdef HAVE_STRING_H
 #include <string.h>
index cc096626f84edbe4f516e99c27ff3198b18fa3f9..4ac6708c3ec410b16d87c912cdb3c5bf529c4ecf 100644 (file)
@@ -25,7 +25,7 @@
 #include "misc.h"
 #include "lf.h"
 #include "table.h"
-#include "config.h"
+#include "build-config.h"
 
 #include "filter.h"
 
index fc2a3c13524e6c6ea6b3ad63bd3069bb82f4c05f..e47dfda5da2f892f5f28d2657a776a344f743884 100644 (file)
@@ -23,7 +23,7 @@
 #include <stdarg.h>
 #include <ctype.h>
 
-#include "config.h"
+#include "build-config.h"
 #include "misc.h"
 #include "lf.h"
 
index d8e54ed497beb1ac06018f6866290e9e400c38f6..23e981a18476c29dd0e62a438ac5bac46321103c 100644 (file)
@@ -23,7 +23,7 @@
 #include <stdarg.h>
 #include <ctype.h>
 
-#include "config.h"
+#include "build-config.h"
 #include "misc.h"
 
 #ifdef HAVE_STDLIB_H
index 50301fd64fc2886091d4f4189e3e006463a7aedb..d09d5fecfdaf0de138c070fa58de81a7a84bb78a 100644 (file)
@@ -21,7 +21,7 @@
 
 /* Frustrating header junk */
 
-#include "config.h"
+#include "build-config.h"
 
 #include <stdio.h>
 #include <ctype.h>
index d9538b3d7d87a4f9c8bf63db3013da8debb85927..db3f783bb3e27b5687c4c5f7048041468bea350f 100644 (file)
@@ -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"