diff options
Diffstat (limited to 'sim/ppc/configure.in')
-rw-r--r-- | sim/ppc/configure.in | 330 |
1 files changed, 214 insertions, 116 deletions
diff --git a/sim/ppc/configure.in b/sim/ppc/configure.in index 2f24d64..a3c1f39 100644 --- a/sim/ppc/configure.in +++ b/sim/ppc/configure.in @@ -2,6 +2,196 @@ dnl Process this file with autoconf to produce a configure script. AC_PREREQ(2.3)dnl AC_INIT(Makefile.in) +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/,/ /"`;; +esac],[sim_cflags=""])dnl + +AC_ARG_ENABLE(sim-config, +[ --enable-sim-config=file Override default config file], +[case "${enableval}" in + yes) sim_config="std-config.h";; + no) sim_config="std-config.h";; + *) sim_config="${enableval}";; +esac],[sim_config="std-config.h]")dnl + +AC_ARG_ENABLE(sim-opcode, +[ --enable-sim-opcode=which Override default opcode lookup.], +[case "${enableval}" in + yes) sim_opcode="ppc-opcode-simple";; + no) sim_opcode="ppc-opcode-simple";; + *) sim_opcode="ppc-opcode-${enableval}";; +esac],[sim_opcode="ppc-opcode-simple"])dnl + +AC_ARG_ENABLE(sim-switch, +[ --enable-sim-switch Use a switch instead of a table for instruction call.], +[case "${enableval}" in + yes) sim_switch="-s";; + *) sim_switch="";; +esac],[sim_switch=""])dnl + +AC_ARG_ENABLE(sim-duplicate, +[ --enable-sim-duplicate Expand (duplicate) semantic functions.], +[case "${enableval}" in + yes) sim_dup="-e";; + *) sim_dup="";; +esac],[sim_dup=""])dnl + +AC_ARG_ENABLE(sim-filter, +[ --enable-sim-filter=rule Specify filter rules.], +[case "${enableval}" in + yes) sim_filter="";; + *) sim_filter="-f $enableval";; +esac],[sim_filter="-f 64"])dnl + +AC_ARG_ENABLE(sim-icache, +[ --enable-sim-icache=size Specify instruction cache size.], +[case "${enableval}" in + yes) sim_icache="-r 1024";; + *) sim_icache="";; +esac],[sim_icache=""])dnl + +AC_ARG_ENABLE(sim-inline, +[ --enable-sim-inline=inlines Specify which functions should be inlined.], +[sim_inline="" +case "$enableval" in + no) flags="";; + 0) flags="-DDEFAULT_INLINE=0";; + yes | 2) flags="-DDEFAULT_INLINE=2";; + 1) flags="-DDEFAULT_INLINE=1";; + *) for x in `echo "$enableval" | sed -e "s/,/ /g"`; do + new_flag="" + case "$x" in + *_INLINE=*) new_flag="-D$x";; + *_INLINE) new_flag="-D$x=2";; + *=*) new_flag=`sed -e "s/=/_INLINE=/" -e "s/^/-D/"`;; + *) new_flag="-D$x""_INLINE=2";; + esac + if x"$sim_inline" = x""; then + sim_inline="$new_flag" + else + sim_inline="$flags $new_flag" + fi + done;; +esac],[sim_inline=""])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";; + *) sim_bswap="";; +esac],[sim_bswap=""])dnl + +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";; + 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";; + *) sim_endian="";; +esac],[sim_endian=""])dnl + +AC_ARG_ENABLE(sim-hostendian, +[ --enable-sim-hostendain=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";; + *) sim_hostendian="";; +esac],[sim_hostendian=""])dnl + +AC_ARG_ENABLE(sim-smp, +[ --enable-sim-smp=n Specify number of processors to configure for.], +[case "${enableval}" in + yes) sim_smp="-DWITH_SMP=2";; + no) sim_smp="-DWITH_SMP=0";; + *) sim_smp="-DWITH_SMP=$enableval";; +esac],[sim_smp=""])dnl + +AC_ARG_ENABLE(sim-bitsize, +[ --enable-sim-bitsize=n Specify target bitsize (32 or 64).], +[case "${enableval}" in + yes) sim_bitsize="";; + no) sim_bitsize="";; + *) sim_bitsize="-DWITH_TARGET_WORD_BITSIZE=$enableval";; +esac],[sim_bitsize=""])dnl + +AC_ARG_ENABLE(sim-hostbitsize, +[ --enable-sim-hostbitsize=n Specify host bitsize (32 or 64).], +[case "${enableval}" in + yes) sim_hostbitsize="";; + no) sim_hostbitsize="";; + *) sim_hostbitsize="-DWITH_HOST_WORD_BITSIZE=$enableval";; +esac],[sim_hostbitsize=""])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";; + *) sim_env="";; +esac],[sim_env=""])dnl + +AC_ARG_ENABLE(sim-timebase, +[ --enable-sim-timebase Specify whether the PPC timebase is supported.], +[case "${enableval}" in + yes) sim_timebase="-DWITH_TIME_BASE=1";; + no) sim_timebase="-DWITH_TIME_BASE=0";; + *) sim_timebase="";; +esac],[sim_timebase=""])dnl + +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=NOSTRICT_ALIGNMENT";; + *) sim_alignment="-DWITH_ALIGNMENT=$enableval";; +esac],[sim_alignment=""])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";; + *) sim_trace="";; +esac],[sim_trace=""])dnl + +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";; + *) sim_assert="";; +esac],[sim_assert=""])dnl + +AC_ARG_ENABLE(sim-float, +[ --enable-sim-float Specify whether to use host floating point or simulate.], +[case "${enableval}" in + yes | hard) sim_float="-DWITH_FLOATING_POINT=HARD_FLOATING_POINT";; + no | soft) sim_float="-DWITH_FLOATING_POINT=SOFT_FLOATING_POINT";; + *) sim_float="";; +esac],[sim_float=""])dnl + +AC_ARG_ENABLE(sim-monitor, +[ --enable-sim-monitor=mon Specify whether to enable monitoring events.], +[case "${enableval}" in + yes) sim_mon="-DWITH_MON='MONITOR_INSTRUCTION_ISSUE | MONITOR_LOAD_STORE_UNIT'";; + no) sim_mon="-DWITH_MON=0";; + instruction) sim_mon="-DWITH_MON=MONITOR_INSTRUCTION_ISSUE";; + memory) sim_mon="-DWITH_MON=MONITOR_LOAD_STORE_UNIT";; + *) sim_mon="-DWITH_MON='$enableval'";; +esac],[sim_float=""])dnl + AC_CONFIG_HEADER(config.h:config.in) AC_CONFIG_AUX_DIR(`cd $srcdir;pwd`/../..) @@ -16,6 +206,29 @@ AC_SUBST(HDEFINES) AR=${AR-ar} AC_SUBST(AR) AC_PROG_RANLIB +AC_SUBST(sim_cflags) +AC_SUBST(sim_config) +AC_SUBST(sim_opcode) +AC_SUBST(sim_switch) +AC_SUBST(sim_dup) +AC_SUBST(sim_filter) +AC_SUBST(sim_icache) +AC_SUBST(sim_inline) +AC_SUBST(sim_bswap) +AC_SUBST(sim_endian) +AC_SUBST(sim_hostendian) +AC_SUBST(sim_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_monitor) + +AC_CHECK_FUNCS(getrusage) # Put a plausible default for CC_FOR_BUILD in Makefile. AC_C_CROSS @@ -26,122 +239,7 @@ else fi AC_SUBST(CC_FOR_BUILD) -AC_CHECK_HEADERS(string.h strings.h stdlib.h time.h sys/times.h) +AC_CHECK_HEADERS(string.h strings.h stdlib.h time.h sys/times.h unistd.h sys/resource.h) AC_OUTPUT(Makefile, [case x$CONFIG_HEADERS in xconfig.h:config.in) echo > stamp-h ;; esac]) - -if test x"$enable_sim_cflags" != x"" -a x"$enable_sim_cflags" != x"no"; then - if test "$enable_sim_cflags" = "yes"; then - enable_sim_cflags="-fomit-frame-pointer,-O2" - fi - echo "Setting SIM_CFLAGS=$enable_sim_cflags" | sed -e "s/,/ /g" 1>&6 - (echo; echo "# --enable-sim-cflags=$enable_sim_cflags"; - echo "SIM_CFLAGS = $enable_sim_cflags" | sed -e "s/,/ /g") >> Makefile -else - echo "Setting SIM_CFLAGS=" 1>&6 - (echo; echo "# no --enable-sim-cflags"; echo "SIM_CFLAGS =") >> Makefile -fi - -$srcdir/config.make Makefile CONFIG_FILE --enable-sim-config "$enable_sim_config" \ - "" "std-config.h" "no" "std-config.h" "yes" "std-config.h" "*" "$enable_sim_config" 1>&6 - -$srcdir/config.make Makefile IGEN_OPCODE_RULES --enable-sim-opcode "$enable_sim_opcode" \ - "" "ppc-opcode-simple" "no" "ppc-opcode-simple" "yes" "ppc-opcode-simple" \ - "complex" "ppc-opcode-complex" "simple" "ppc-opcode-simple" "stupid" "ppc-opcode-stupid" 1>&6 - -$srcdir/config.make Makefile DGEN_FLAGS --enable-sim-switch "$enable_sim_switch" \ - "" "" "no" "" "yes" "-s" 1>&6 - -$srcdir/config.make Makefile IGEN_DUPLICATE --enable-sim-duplicate "$enable_sim_duplicate" \ - "" "" "no" "" "yes" "-e" 1>&6 - -$srcdir/config.make Makefile IGEN_FILTER --enable-sim-filter "$enable_sim_filter" \ - "" "-f 64" "no" "" "yes" "-f 64" "*" "$enable_sim_filter" 1>&6 - -$srcdir/config.make Makefile IGEN_ICACHE --enable-sim-icache "$enable_sim_icache" \ - "" "" "no" "" "yes" "-r 1024" "*" "-r $enable_sim_icache" 1>&6 - -flags="" -if test x"$enable_sim_inline" != x""; then - case "$enable_sim_inline" in - no) flags="";; - 0) flags=" -DDEFAULT_INLINE=0";; - yes | 2) flags=" -DDEFAULT_INLINE=2";; - 1) flags=" -DDEFAULT_INLINE=1";; - *) for x in `echo "$enable_sim_inline" | sed -e "s/,/ /g"`; do - case "$x" in - *_INLINE=*) flags="$flags -D$x";; - *_INLINE) flags="$flags -D$x=2";; - *=*) x=`sed -e "s/=/_INLINE=/"`; flags="$flags -D$x";; - *) flags="$flags -D$x""_INLINE=2";; - esac - done;; - esac -fi -if test x"$flags" != x""; then - echo "Setting INLINE_CFLAGS=$flags" 1>&6 - (echo; echo "# --enable-sim-inline=$enable_sim_inline"; echo "INLINE_CFLAGS =$flags") >> Makefile -else - echo "Setting INLINE_CFLAGS=" 1>&6 - (echo; echo "# no --enable-sim-inline"; echo "INLINE_CFLAGS =") >> Makefile -fi - -$srcdir/config.hdr config.h WITH_BSWAP --enable-sim-bswap "$enable_sim_bswap" "yes" 1 - -case "$target" in - *powerpc-*) endian="BIG_ENDIAN";; - *powerpcle-*) endian="LITTLE_ENDIAN";; - *) echo "Unknown $target" 1>&6; endian="0";; -esac - -$srcdir/config.hdr config.h WITH_TARGET_BYTE_ORDER --enable-sim-endian "$enable_sim_endian" \ - "" "0" "no" "0" "yes" "$endian" \ - "b" "BIG_ENDIAN" "big" "BIG_ENDIAN" "big-endian" "BIG_ENDIAN" \ - "B" "BIG_ENDIAN" "BIG" "BIG_ENDIAN" "BIG-ENDIAN" "BIG_ENDIAN" \ - "l" "LITTLE_ENDIAN" "little" "LITTLE_ENDIAN" "little-endian" "LITTLE_ENDIAN" \ - "L" "LITTLE_ENDIAN" "little" "LITTLE_ENDIAN" "little-endian" "LITTLE_ENDIAN" 1>&6 - -$srcdir/config.hdr config.h WITH_HOST_BYTE_ORDER --enable-sim-hostendian "$enable_sim_hostendian" \ - "b" "BIG_ENDIAN" "big" "BIG_ENDIAN" "big-endian" "BIG_ENDIAN" \ - "B" "BIG_ENDIAN" "BIG" "BIG_ENDIAN" "BIG-ENDIAN" "BIG_ENDIAN" \ - "l" "LITTLE_ENDIAN" "little" "LITTLE_ENDIAN" "little-endian" "LITTLE_ENDIAN" \ - "L" "LITTLE_ENDIAN" "little" "LITTLE_ENDIAN" "little-endian" "LITTLE_ENDIAN" 1>&6 - -$srcdir/config.hdr config.h WITH_SMP --enable-sim-smp "$enable_sim_smp" \ - "" "0" "no" "0" "yes" "2" "*" "$enable_sim_smp" 1>&6 - -$srcdir/config.hdr config.h WITH_TARGET_WORD_BITSIZE --enable-sim-bitsize "$enable_sim_bitsize" \ - "yes" "32" "32" "32" "32" "64" "64" 1>&6 - -$srcdir/config.hdr config.h WITH_HOST_WORD_BITSIZE --enable-sim-hostbitsize "$enable_sim_hostbitsize" \ - "yes" "32" "32" "32" "32" "64" "64" 1>&6 - -$srcdir/config.hdr config.h WITH_ENVIRONMENT --enable-sim-env "$enable_sim_env" \ - "yes" "0" \ - "operating" "OPERATING_ENVIRONMENT" "os" "OPERATING_ENVIRONMENT" "oea" "OPERATING_ENVIRONMENT" \ - "virtual" "VIRTUAL_ENVIRONMENT" "vea" "VIRTUAL_ENVIRONMENT" \ - "user" "USER_ENVIRONMENT" "uea" "USER_ENVIRONMENT" \ - 1>&6 - -$srcdir/config.hdr config.h WITH_TIME_BASE --enable-sim-timebase "$enable_sim_timebase" \ - "no" "0" "yes" "1" 1>&6 - -$srcdir/config.hdr config.h WITH_ALIGNMENT --enable-sim-alignment "$enable_sim_alignment" \ - "no" "NONSTRICT_ALIGNMENT" "nonstrict" "NONSTRICT_ALIGNMENT" \ - "yes" "STRICT_ALIGNMENT" "strict" "STRICT_ALIGNMENT" 1>&6 - -$srcdir/config.hdr config.h WITH_FLOATING_POINT --enable-sim-float "$enable_sim_float" \ - "no" "SOFT_FLOATING_POINT" "soft" "SOFT_FLOATING_POINT" \ - "yes" "HARD_FLOATING_POINT" "hard" "HARD_FLOATING_POINT" 1>&6 - -$srcdir/config.hdr config.h WITH_TRACE --enable-sim-trace "$enable_sim_trace" \ - "no" "0" "yes" "1" 1>&6 - -$srcdir/config.hdr config.h WITH_ASSERT --enable-sim-assert "$enable_sim_assert" \ - "no" "0" "yes" "1" 1>&6 - -$srcdir/config.hdr config.h WITH_MON --enable-sim-monitor "$enable_sim_monitor" \ - "no" "0" "yes" "MONITOR_INSTRUCTION_ISSUE|MONITOR_LOAD_STORE_UNIT" \ - "instruction" "MONITOR_INSTRUCTION_ISSUE" \ - "memory" "MONITOR_LOAD_STORE_UNIT" 1>&6 |