X-Git-Url: http://drtracing.org/?a=blobdiff_plain;f=sim%2Fppc%2Fconfigure.ac;h=97030ed635c1a94eb14800a9ac644e0c7d7e997a;hb=2951f6c068f961a2ea1de892fc82cf0229af67da;hp=730091b31afa359a24dbaba11a1736dee4d1c554;hpb=35689115d0866e52f5dcfd43f9d4fb2fc02a72bd;p=deliverable%2Fbinutils-gdb.git diff --git a/sim/ppc/configure.ac b/sim/ppc/configure.ac index 730091b31a..97030ed635 100644 --- a/sim/ppc/configure.ac +++ b/sim/ppc/configure.ac @@ -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) +sinclude(../common/acinclude.m4) AC_PROG_INSTALL AC_PROG_CC @@ -33,16 +32,17 @@ if test x"$silent" != x"yes" && test x"$sim_alignment" != x""; then 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 +56,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 @@ -161,18 +137,19 @@ if test x"$silent" != x"yes" && test x"$sim_endian" != x""; then fi],[sim_endian=""])dnl +AC_MSG_CHECKING([default sim environment setting]) +sim_env="0" 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 + operating | os | oea) sim_env="OPERATING_ENVIRONMENT";; + virtual | vea) sim_env="VIRTUAL_ENVIRONMENT";; + user | uea) sim_env="USER_ENVIRONMENT";; + no) sim_env="0";; + *) AC_MSG_ERROR([Unknown value $enableval passed to --enable-sim-env]);; +esac])dnl +AC_DEFINE_UNQUOTED([WITH_ENVIRONMENT], [$sim_env], [Sim default environment]) +AC_MSG_RESULT($sim_env) AC_ARG_ENABLE(sim-filter, @@ -209,10 +186,106 @@ case "${target}" in esac ])dnl +AC_CACHE_CHECK([if union semun defined], + ac_cv_HAS_UNION_SEMUN, + [AC_TRY_COMPILE([ +#include +#include +#include ], +[union semun arg ;], +[ac_cv_has_union_semun="yes"], +[ac_cv_has_union_semun="no"]) +AC_MSG_RESULT($ac_cv_has_union_semun) +]) + + +if test "$ac_cv_has_union_semun" = "yes"; then + AC_CACHE_CHECK(whether System V semaphores are supported, + ac_cv_sysv_sem, + [ + AC_TRY_RUN( + [ + #include + #include + #include + int main () { + union semun arg ; + + int id=semget(IPC_PRIVATE,1,IPC_CREAT|0400); + if (id == -1) + exit(1); + arg.val = 0; /* avoid implicit type cast to union */ + if (semctl(id, 0, IPC_RMID, arg) == -1) + exit(1); + exit(0); + } + ], + ac_cv_sysv_sem="yes", ac_cv_sysv_sem="no", :) + ]) +else # semun is not defined + AC_CACHE_CHECK(whether System V semaphores are supported, + ac_cv_sysv_sem, + [ + AC_TRY_RUN( + [ + #include + #include + #include + union semun { + int val; + struct semid_ds *buf; + ushort *array; + }; + int main () { + union semun arg ; + + int id=semget(IPC_PRIVATE,1,IPC_CREAT|0400); + if (id == -1) + exit(1); + arg.val = 0; /* avoid implicit type cast to union */ + if (semctl(id, 0, IPC_RMID, arg) == -1) + exit(1); + exit(0); + } + ], + ac_cv_sysv_sem="yes", ac_cv_sysv_sem="no", :) + ]) +fi + +AC_CACHE_CHECK(whether System V shared memory is supported, +ac_cv_sysv_shm, +[ +AC_TRY_RUN([ +#include +#include +#include +int main () { + int id=shmget(IPC_PRIVATE,1,IPC_CREAT|0400); + if (id == -1) + exit(1); + if (shmctl(id, IPC_RMID, 0) == -1) + exit(1); + exit(0); +} +], +ac_cv_sysv_shm="yes", ac_cv_sysv_shm="no", :) +]) + +if test x"$ac_cv_sysv_shm" = x"yes" -a x"$ac_cv_sysv_sem" = x"yes" ; then + sim_sysv_ipc_hw=",sem,shm"; +else + sim_sysv_ipc_hw=""; +fi + +if test x"$ac_cv_has_union_semun" = x"yes" -a x"$ac_cv_sysv_sem" = x"yes" ; then + AC_DEFINE(HAVE_UNION_SEMUN, 1, + [Define if union semun is defined in ]) +fi + AC_ARG_ENABLE(sim-hardware, [ --enable-sim-hardware=list Specify the hardware to be included in the build.], -[hardware="cpu,memory,nvram,iobus,htab,disk,trace,register,vm,init,core,pal,com,eeprom,opic,glue,phb,ide" +[hardware="cpu,memory,nvram,iobus,htab,disk,trace,register,vm,init,core,pal,com,eeprom,opic,glue,phb,ide${sim_sysv_ipc_hw}" case "${enableval}" in yes) ;; no) AC_MSG_ERROR("List of hardware must be specified for --enable-sim-hardware"); hardware="";; @@ -224,14 +297,13 @@ sim_hw_src=`echo $hardware | sed -e 's/,/.c hw_/g' -e 's/^/hw_/' -e s'/$/.c/'` sim_hw_obj=`echo $sim_hw_src | sed -e 's/\.c/.o/g'` if test x"$silent" != x"yes" && test x"$hardware" != x""; then echo "Setting hardware to $sim_hw_src, $sim_hw_obj" -fi],[hardware="cpu,memory,nvram,iobus,htab,disk,trace,register,vm,init,core,pal,com,eeprom,opic,glue,phb,ide" +fi],[hardware="cpu,memory,nvram,iobus,htab,disk,trace,register,vm,init,core,pal,com,eeprom,opic,glue,phb,ide${sim_sysv_ipc_hw}" sim_hw_src=`echo $hardware | sed -e 's/,/.c hw_/g' -e 's/^/hw_/' -e s'/$/.c/'` sim_hw_obj=`echo $sim_hw_src | sed -e 's/\.c/.o/g'` if test x"$silent" != x"yes"; then echo "Setting hardware to $sim_hw_src, $sim_hw_obj" fi])dnl - AC_ARG_ENABLE(sim-hostbitsize, [ --enable-sim-hostbitsize=32|64 Specify host bitsize (32 or 64).], [case "${enableval}" in @@ -435,19 +507,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 @@ -475,29 +534,17 @@ 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_MSG_CHECKING([for sim stdio debug behavior]) +sim_stdio=0 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 + yes) sim_stdio="DO_USE_STDIO";; + no) sim_stdio="DONT_USE_STDIO";; + *) AC_MSG_ERROR([Unknown value $enableval passed to --enable-sim-stdio]);; +esac])dnl +AC_DEFINE_UNQUOTED([WITH_STDIO], [$sim_stdio], [How to route I/O]) +AC_MSG_RESULT($sim_stdio) AC_ARG_ENABLE(sim-switch, @@ -527,16 +574,17 @@ if test x"$silent" != x"yes" && test x"$sim_timebase" != x""; then fi],[sim_timebase=""])dnl +AC_MSG_CHECKING([for sim trace settings]) +sim_trace="1" 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="";; -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 + yes) sim_trace="1";; + no) sim_trace="0";; + *) AC_MSG_ERROR([--enable-sim-trace does not take a value]);; +esac])dnl +AC_DEFINE_UNQUOTED([WITH_TRACE], [$sim_trace], [Sim trace settings]) +AC_MSG_RESULT($sim_trace) AC_ARG_ENABLE(sim-warnings, @@ -573,7 +621,10 @@ 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 + +# BFD uses libdl when when plugins enabled. +AC_PLUGINS . ${srcdir}/../../bfd/configure.host @@ -753,6 +804,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 @@ -763,7 +839,6 @@ 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) @@ -779,28 +854,21 @@ 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)