* hppa.h (pa_opcodes): Use "cX" completer instead of "cx" in fstqx
[external/binutils.git] / sim / ppc / configure.ac
index 8a580c8..9c3fa54 100644 (file)
@@ -1,7 +1,7 @@
 dnl Process this file with autoconf to produce a configure script.
-sinclude(../common/aclocal.m4)
 AC_PREREQ(2.59)dnl
 AC_INIT(Makefile.in)
+sinclude(../common/acinclude.m4)
 
 AC_PROG_INSTALL
 AC_PROG_CC
@@ -301,7 +301,8 @@ else
 fi
 
 if test x"$ac_cv_has_union_semun" = x"yes" -a x"$ac_cv_sysv_sem" = x"yes" ; then
-  sim_hwflags="-DHAS_UNION_SEMUN";
+  AC_DEFINE(HAVE_UNION_SEMUN, 1,
+           [Define if union semun is defined in <sys/sem.h>])
 fi
 
 
@@ -667,7 +668,7 @@ AC_ARG_PROGRAM
 
 # BFD conditionally uses zlib, so we must link it in if libbfd does, by
 # using the same condition.
-AC_SEARCH_LIBS(zlibVersion, z, [AC_CHECK_HEADERS(zlib.h)])
+AM_ZLIB
 
 . ${srcdir}/../../bfd/configure.host
 
@@ -847,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