]> git.ipfire.org Git - thirdparty/binutils-gdb.git/blobdiff - sim/ppc/configure.ac
sim: ppc: convert to bfd_endian
[thirdparty/binutils-gdb.git] / sim / ppc / configure.ac
index 1970291d1e93c1a34aaf46f49691f9d44309cb30..376c3ce07fa4ba9853209edc6e70a8f26927dd68 100644 (file)
@@ -1,7 +1,6 @@
 dnl Process this file with autoconf to produce a configure script.
-sinclude(../common/aclocal.m4)
-AC_PREREQ(2.59)dnl
 AC_INIT(Makefile.in)
+AC_CONFIG_MACRO_DIRS([../.. ../../config])
 
 AC_PROG_INSTALL
 AC_PROG_CC
@@ -20,29 +19,17 @@ ALL_LINGUAS=
 ZW_GNU_GETTEXT_SISTER_DIR(../../intl)
 
 
-AC_ARG_ENABLE(sim-alignment,
-[  --enable-sim-alignment=align                Specify strict or nonstrict alignment.],
-[case "${enableval}" in
-  yes | strict | STRICT)       sim_alignment="-DWITH_ALIGNMENT=STRICT_ALIGNMENT";;
-  no | nonstrict | NONSTRICT)  sim_alignment="-DWITH_ALIGNMENT=NONSTRICT_ALIGNMENT";;
-  0 | default | DEFAULT)       sim_alignment="-DWITH_ALIGNMENT=0";;
-  *)                           AC_MSG_ERROR("Unknown value $enableval passed to --enable-sim-alignment"); sim_alignment="";;
-esac
-if test x"$silent" != x"yes" && test x"$sim_alignment" != x""; then
-  echo "Setting alignment flags = $sim_alignment" 6>&1
-fi],[sim_alignment=""])dnl
-
-
+AC_MSG_CHECKING([whether to enable sim asserts])
+sim_assert="1"
 AC_ARG_ENABLE(sim-assert,
 [  --enable-sim-assert                 Specify whether to perform random assertions.],
 [case "${enableval}" in
-  yes) sim_assert="-DWITH_ASSERT=1";;
-  no)  sim_assert="-DWITH_ASSERT=0";;
-  *)   AC_MSG_ERROR("--enable-sim-assert does not take a value"); sim_assert="";;
-esac
-if test x"$silent" != x"yes" && test x"$sim_assert" != x""; then
-  echo "Setting assert flags = $sim_assert" 6>&1
-fi],[sim_assert=""])dnl
+  yes) sim_assert="1";;
+  no)  sim_assert="0";;
+  *)   AC_MSG_ERROR([--enable-sim-assert does not take a value]);;
+esac])dnl
+AC_DEFINE_UNQUOTED([WITH_ASSERT], [$sim_assert], [Sim assert settings])
+AC_MSG_RESULT($sim_assert)
 
 
 AC_ARG_ENABLE(sim-bitsize,
@@ -56,30 +43,6 @@ if test x"$silent" != x"yes" && test x"$sim_bitsize" != x""; then
 fi],[sim_bitsize=""])dnl
 
 
-AC_ARG_ENABLE(sim-bswap,
-[  --enable-sim-bswap                  Use the BSWAP instruction on Intel 486s and Pentiums.],
-[case "${enableval}" in
-  yes) sim_bswap="-DWITH_BSWAP=1";;
-  no)  sim_bswap="-DWITH_BSWAP=0";;
-  *)   AC_MSG_ERROR("--enable-sim-bswap does not take a value"); sim_bswap="";;
-esac
-if test x"$silent" != x"yes" && test x"$sim_bswap" != x""; then
-  echo "Setting bswap flags = $sim_bswap" 6>&1
-fi],[sim_bswap=""])dnl
-
-
-AC_ARG_ENABLE(sim-cflags,
-[  --enable-sim-cflags=opts            Extra CFLAGS for use in building simulator],
-[case "${enableval}" in
-  yes) sim_cflags="-O2 -fomit-frame-pointer";;
-  no)  sim_cflags="";;
-  *)   sim_cflags=`echo "${enableval}" | sed -e "s/,/ /g"`;;
-esac
-if test x"$silent" != x"yes" && test x"$sim_cflags" != x""; then
-  echo "Setting sim cflags = $sim_cflags" 6>&1
-fi],[sim_cflags=""])dnl
-
-
 AC_ARG_ENABLE(sim-config,
 [  --enable-sim-config=file            Override default config file],
 [case "${enableval}" in
@@ -147,13 +110,13 @@ AC_ARG_ENABLE(sim-endian,
 [  --enable-sim-endian=endian          Specify target byte endian orientation.],
 [case "${enableval}" in
   yes) case "$target" in
-         *powerpc-*) sim_endian="-DWITH_TARGET_BYTE_ORDER=BIG_ENDIAN";;
-         *powerpcle-*) sim_endian="-DWITH_TARGET_BYTE_ORDER=LITTLE_ENDIAN";;
-         *) echo "Unknown target $target" 1>&6; sim_endian="-DWITH_TARGET_BYTE_ORDER=0";;
+         *powerpc-*) sim_endian="-DWITH_TARGET_BYTE_ORDER=BFD_ENDIAN_BIG";;
+         *powerpcle-*) sim_endian="-DWITH_TARGET_BYTE_ORDER=BFD_ENDIAN_LITTLE";;
+         *) echo "Unknown target $target" 1>&6; sim_endian="-DWITH_TARGET_BYTE_ORDER=BFD_ENDIAN_UNKNOWN";;
        esac;;
-  no)   sim_endian="-DWITH_TARGET_BYTE_ORDER=0";;
-  b*|B*) sim_endian="-DWITH_TARGET_BYTE_ORDER=BIG_ENDIAN";;
-  l*|L*) sim_endian="-DWITH_TARGET_BYTE_ORDER=LITTLE_ENDIAN";;
+  no)   sim_endian="-DWITH_TARGET_BYTE_ORDER=BFD_ENDIAN_UNKNOWN";;
+  b*|B*) sim_endian="-DWITH_TARGET_BYTE_ORDER=BFD_ENDIAN_BIG";;
+  l*|L*) sim_endian="-DWITH_TARGET_BYTE_ORDER=BFD_ENDIAN_LITTLE";;
   *)    AC_MSG_ERROR("Unknown value $enableval for --enable-sim-endian"); sim_endian="";;
 esac
 if test x"$silent" != x"yes" && test x"$sim_endian" != x""; then
@@ -161,20 +124,6 @@ if test x"$silent" != x"yes" && test x"$sim_endian" != x""; then
 fi],[sim_endian=""])dnl
 
 
-AC_ARG_ENABLE(sim-env,
-[  --enable-sim-env=env                        Specify target environment (operating, virtual, user).],
-[case "${enableval}" in
-  operating | os | oea)        sim_env="-DWITH_ENVIRONMENT=OPERATING_ENVIRONMENT";;
-  virtual | vea)       sim_env="-DWITH_ENVIRONMENT=VIRTUAL_ENVIRONMENT";;
-  user | uea)          sim_env="-DWITH_ENVIRONMENT=USER_ENVIRONMENT";;
-  no)                  sim_env="-DWITH_ENVIRONMENT=0";;
-  *)                   AC_MSG_ERROR("Unknown value $enableval passed to --enable-sim-env"); sim_env="";;
-esac
-if test x"$silent" != x"yes" && test x"$sim_env" != x""; then
-  echo "Setting env flags = $sim_env" 6>&1
-fi],[sim_env=""])dnl
-
-
 AC_ARG_ENABLE(sim-filter,
 [  --enable-sim-filter=rule            Specify filter rules.],
 [case "${enableval}" in
@@ -338,29 +287,6 @@ if test x"$silent" != x"yes" && test x"$sim_hostbitsize" != x""; then
 fi],[sim_hostbitsize=""])dnl
 
 
-AC_ARG_ENABLE(sim-hostendian,
-[  --enable-sim-hostendian=end         Specify host byte endian orientation.],
-[case "${enableval}" in
-  no)   sim_hostendian="-DWITH_HOST_BYTE_ORDER=0";;
-  b*|B*) sim_hostendian="-DWITH_HOST_BYTE_ORDER=BIG_ENDIAN";;
-  l*|L*) sim_hostendian="-DWITH_HOST_BYTE_ORDER=LITTLE_ENDIAN";;
-  *)    AC_MSG_ERROR("Unknown value $enableval for --enable-sim-hostendian"); sim_hostendian="";;
-esac
-if test x"$silent" != x"yes" && test x"$sim_hostendian" != x""; then
-  echo "Setting hostendian flags = $sim_hostendian" 6>&1
-fi],[
-if test "x$cross_compiling" = "xno"; then
-  AC_C_BIGENDIAN
-  if test $ac_cv_c_bigendian = yes; then
-    sim_hostendian="-DWITH_HOST_BYTE_ORDER=BIG_ENDIAN"
-  else
-    sim_hostendian="-DWITH_HOST_BYTE_ORDER=LITTLE_ENDIAN"
-  fi
-else
-  sim_hostendian="-DWITH_HOST_BYTE_ORDER=0"
-fi])dnl
-
-
 AC_ARG_ENABLE(sim-icache,
 [  --enable-sim-icache=size            Specify instruction-decode cache size and type.],
 [icache="-R"
@@ -480,7 +406,7 @@ AC_ARG_ENABLE(sim-monitor,
   no)          sim_monitor="-DWITH_MON=0";;
   instruction) sim_monitor="-DWITH_MON=MONITOR_INSTRUCTION_ISSUE";;
   memory)      sim_monitor="-DWITH_MON=MONITOR_LOAD_STORE_UNIT";;
-  *)           AC_MSG_ERROR("Unknown value $enableval passed to --enable-sim-mon"); sim_env="";;
+  *)           AC_MSG_ERROR("Unknown value $enableval passed to --enable-sim-mon");;
 esac
 if test x"$silent" != x"yes" && test x"$sim_monitor" != x""; then
   echo "Setting monitor flags = $sim_monitor" 6>&1
@@ -530,19 +456,6 @@ if test x"$silent" != x"yes"; then
 fi])dnl
 
 
-AC_ARG_ENABLE(sim-regparm,
-[  --enable-sim-regparm=nr-parm                Pass parameters in registers instead of on the stack - x86/GCC specific.],
-[case "${enableval}" in
-  0*|1*|2*|3*|4*|5*|6*|7*|8*|9*) sim_regparm="-DWITH_REGPARM=${enableval}";;
-  no)                            sim_regparm="" ;;
-  yes)                           sim_regparm="-DWITH_REGPARM=3";;
-  *)   AC_MSG_ERROR("Unknown value $enableval for --enable-sim-regparm"); sim_regparm="";;
-esac
-if test x"$silent" != x"yes" && test x"$sim_regparm" != x""; then
-  echo "Setting regparm flags = $sim_regparm" 6>&1
-fi],[sim_regparm=""])dnl
-
-
 AC_ARG_ENABLE(sim-reserved-bits,
 [  --enable-sim-reserved-bits          Specify whether to check reserved bits in instruction.],
 [case "${enableval}" in
@@ -570,31 +483,6 @@ if test x"$silent" != x"yes"; then
 fi])dnl
 
 
-AC_ARG_ENABLE(sim-stdcall,
-[  --enable-sim-stdcall=type           Use an alternative function call/return mechanism - x86/GCC specific.],
-[case "${enableval}" in
-  no)          sim_stdcall="" ;;
-  std*)                sim_stdcall="-DWITH_STDCALL=1";;
-  yes)         sim_stdcall="-DWITH_STDCALL=1";;
-  *)   AC_MSG_ERROR("Unknown value $enableval for --enable-sim-stdcall"); sim_stdcall="";;
-esac
-if test x"$silent" != x"yes" && test x"$sim_stdcall" != x""; then
-  echo "Setting function call flags = $sim_stdcall" 6>&1
-fi],[sim_stdcall=""])dnl
-
-
-AC_ARG_ENABLE(sim-stdio,
-[  --enable-sim-stdio                  Specify whether to use stdio for console input/output.],
-[case "${enableval}" in
-  yes) sim_stdio="-DWITH_STDIO=DO_USE_STDIO";;
-  no)  sim_stdio="-DWITH_STDIO=DONT_USE_STDIO";;
-  *)   AC_MSG_ERROR("Unknown value $enableval passed to --enable-sim-stdio"); sim_stdio="";;
-esac
-if test x"$silent" != x"yes" && test x"$sim_stdio" != x""; then
-  echo "Setting stdio flags = $sim_stdio" 6>&1
-fi],[sim_stdio=""])dnl
-
-
 AC_ARG_ENABLE(sim-switch,
 [  --enable-sim-switch                 Use a switch instead of a table for instruction call.],
 [case "${enableval}" in
@@ -622,17 +510,27 @@ if test x"$silent" != x"yes" && test x"$sim_timebase" != x""; then
 fi],[sim_timebase=""])dnl
 
 
-AC_ARG_ENABLE(sim-trace,
-[  --enable-sim-trace                  Specify whether tracing is supported.],
-[case "${enableval}" in
-  yes) sim_trace="-DWITH_TRACE=1";;
-  no)  sim_trace="-DWITH_TRACE=0";;
-  *)   AC_MSG_ERROR("--enable-sim-trace does not take a value"); sim_trace="";;
+AC_ARG_ENABLE(werror,
+  AS_HELP_STRING([--enable-werror], [treat compile warnings as errors]),
+  [case "${enableval}" in
+     yes | y) ERROR_ON_WARNING="yes" ;;
+     no | n)  ERROR_ON_WARNING="no" ;;
+     *) AC_MSG_ERROR(bad value ${enableval} for --enable-werror) ;;
+   esac])
+# Enable -Werror by default when using gcc
+if test "${GCC}" = yes -a -z "${ERROR_ON_WARNING}" ; then
+  ERROR_ON_WARNING=yes
+fi
+WERROR_CFLAGS=""
+if test "${ERROR_ON_WARNING}" = yes ; then
+  WERROR_CFLAGS="-Werror"
+fi
+dnl Enable -Wno-format by default when using gcc on mingw since many
+dnl GCC versions complain about %I64.
+case "${host}" in
+  *-*-mingw32*) WERROR_CFLAGS="$WERROR_CFLAGS -Wno-format" ;;
 esac
-if test x"$silent" != x"yes" && test x"$sim_trace" != x""; then
-  echo "Setting trace flags = $sim_trace" 6>&1
-fi],[sim_trace=""])dnl
-
+AC_SUBST(WERROR_CFLAGS)
 
 AC_ARG_ENABLE(sim-warnings,
 [  --enable-sim-warnings=opts          Extra CFLAGS for turning on compiler warnings except for idecode.o, semantics.o and psim.o],
@@ -658,11 +556,6 @@ if test x"$silent" != x"yes" && test x"$sim_xor_endian" != x""; then
 fi],[sim_xor_endian=""])dnl
 
 
-ACX_PKGVERSION([GDB])
-ACX_BUGURL([http://www.gnu.org/software/gdb/bugs/])
-AC_DEFINE_UNQUOTED([PKGVERSION], ["$PKGVERSION"], [Additional package description])
-AC_DEFINE_UNQUOTED([REPORT_BUGS_TO], ["$REPORT_BUGS_TO"], [Bug reporting address])
-
 AC_CANONICAL_SYSTEM
 AC_ARG_PROGRAM
 
@@ -670,7 +563,8 @@ AC_ARG_PROGRAM
 # using the same condition.
 AM_ZLIB
 
-. ${srcdir}/../../bfd/configure.host
+# BFD uses libdl when when plugins enabled.
+AC_PLUGINS
 
 case ${host} in
   *mingw32*)
@@ -684,23 +578,6 @@ esac
 
 AC_CONFIG_HEADER(config.h:config.in)
 
-AC_STRUCT_ST_BLKSIZE
-AC_STRUCT_ST_BLOCKS
-AC_STRUCT_ST_RDEV
-AC_STRUCT_TIMEZONE
-
-AC_TYPE_GETGROUPS
-AC_TYPE_MODE_T
-AC_TYPE_OFF_T
-AC_TYPE_PID_T
-AC_TYPE_SIGNAL
-AC_TYPE_SIZE_T
-AC_TYPE_UID_T
-
-AC_CHECK_FUNCS(access cfgetispeed cfgetospeed cfsetispeed cfsetospeed chdir chmod chown dup dup2 fchmod fchown fcntl fstat fstatfs getdirentries getegid geteuid getgid getpid getppid getrusage gettimeofday getuid ioctl kill link lseek lstat mkdir pipe readlink rmdir setreuid setregid stat sigprocmask stat symlink tcgetattr tcsetattr tcsendbreak tcdrain tcflush tcflow tcgetpgrp tcsetpgrp time umask unlink)
-
-AC_CHECK_HEADERS(fcntl.h stdlib.h string.h strings.h sys/ioctl.h sys/mount.h sys/param.h sys/resource.h sys/stat.h sys/termio.h sys/termios.h sys/time.h sys/times.h sys/types.h time.h unistd.h sys/vfs.h sys/statfs.h)
-AC_HEADER_DIRENT
 
 dnl Figure out what type of termio/termios support there is
 sim_termio=""
@@ -879,11 +756,9 @@ AC_EXEEXT
 AC_SUBST(CC_FOR_BUILD)
 AC_SUBST(CFLAGS_FOR_BUILD)
 AC_SUBST(CFLAGS)
-AC_SUBST(HDEFINES)
 AR=${AR-ar}
 AC_SUBST(AR)
 AC_PROG_RANLIB
-AC_SUBST(sim_cflags)
 AC_SUBST(sim_warnings)
 AC_SUBST(sim_line_nr)
 AC_SUBST(sim_config)
@@ -899,28 +774,19 @@ AC_SUBST(sim_hw_obj)
 AC_SUBST(sim_pk_src)
 AC_SUBST(sim_pk_obj)
 AC_SUBST(sim_inline)
-AC_SUBST(sim_bswap)
 AC_SUBST(sim_endian)
-AC_SUBST(sim_regparm)
-AC_SUBST(sim_stdcall)
 AC_SUBST(sim_xor_endian)
-AC_SUBST(sim_hostendian)
 AC_SUBST(sim_smp)
 AC_SUBST(sim_igen_smp)
 AC_SUBST(sim_bitsize)
 AC_SUBST(sim_hostbitsize)
-AC_SUBST(sim_env)
 AC_SUBST(sim_timebase)
-AC_SUBST(sim_alignment)
 AC_SUBST(sim_float)
-AC_SUBST(sim_trace)
-AC_SUBST(sim_assert)
 AC_SUBST(sim_reserved)
 AC_SUBST(sim_monitor)
 AC_SUBST(sim_model)
 AC_SUBST(sim_default_model)
 AC_SUBST(sim_model_issue)
-AC_SUBST(sim_stdio)
 AC_SUBST(sim_termio)
 AC_SUBST(sim_devzero)
 AC_SUBST(sim_callback)