Commit 0c3824702d3d59d37f8c177d646303f546187683

Josh Triplett 2014-03-26T14:51:32

Always set CC_FOR_TARGET for dejagnu, to make the testsuite respect $CC This fixes cross-compilation and compilation with CC="gcc -m32".

diff --git a/.travis.yml b/.travis.yml
index 6633e6f..7c8d302 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -3,15 +3,15 @@ compiler:
   - gcc
   - clang
 env:
-  - build32=false
-  - build32=true
+  -
+  - HOST=i386-pc-linux-gnu
 matrix:
   exclude:
     - compiler: clang
-      env: build32=true
+      env: HOST=i386-pc-linux-gnu
 
 before_script:
   - sudo apt-get install dejagnu texinfo
-  - if $build32 ; then sudo apt-get install gcc-multilib g++-multilib ; fi
+  - if [ "$HOST" = i386-pc-linux-gnu ] ; then sudo apt-get install gcc-multilib g++-multilib && CC="$CC -m32" ; fi
 
-script: run= && if $build32 ; then run=i386 && mkdir path32 && PATH="$(pwd)/path32:$PATH" && printf '#!/bin/sh\nexec /usr/bin/'"$CC"' -m32 "$@"' > "path32/$CC" && chmod a+x "path32/$CC" ; fi && ./autogen.sh && $run ./configure && make && make dist && make check
+script: ./autogen.sh && ./configure ${HOST+--host=$HOST} && make && make dist && make check
diff --git a/configure.ac b/configure.ac
index 3c1632c..0369b30 100644
--- a/configure.ac
+++ b/configure.ac
@@ -53,12 +53,11 @@ fi
 
 if test "x$GCC" = "xyes"; then
   CFLAGS="$CFLAGS -fexceptions"
-  touch local.exp
-else
-  cat > local.exp <<EOF
+fi
+
+cat > local.exp <<EOF
 set CC_FOR_TARGET "$CC"
 EOF
-fi
 
 AM_MAINTAINER_MODE