Branch: Tag:

2006-01-05

2006-01-05 14:15:02 by Henrik Grubbström (Grubba) <grubba@grubba.org>

Extracted ABI selection stuff to separate macros.

Rev: src/aclocal.m4:1.104
Rev: src/configure.in:1.933

1: - AC_REVISION("$Id: configure.in,v 1.932 2005/12/30 16:32:42 nilsson Exp $") + AC_REVISION("$Id: configure.in,v 1.933 2006/01/05 14:15:02 grubba Exp $")   AC_INIT(interpret.c)   AC_CONFIG_HEADER(machine.h)   
289:      # ABI selection.    - AC_ARG_WITH(abi, MY_DESCR([--with-abi=32/64], -  [specify ABI to use in case there are multiple])) + PIKE_SELECT_ABI    - AC_MSG_CHECKING([default compiler ABI]) - AC_CACHE_VAL(pike_cv_default_compiler_abi, [ -  cat >"conftest.$ac_ext" <<\EOF - int main(int argc, char **argv) - { -  return 0; - } - EOF -  pike_cv_default_compiler_abi="unknown" -  if (eval $ac_compile) 2>&AC_FD_CC; then -  filetype=`file "conftest.$ac_cv_objext" 2>/dev/null | sed -e 's/.*://'` -  case "$filetype" in -  *64-bit*) -  pike_cv_default_compiler_abi=64 -  ;; -  *32-bit*) -  pike_cv_default_compiler_abi=32 -  ;; -  *64*) -  pike_cv_default_compiler_abi=64 -  ;; -  *32*) -  pike_cv_default_compiler_abi=32 -  ;; -  *386*) -  # Probably NT or SCO file for i386: -  # iAPX 386 executable (COFF) -  # 80386 COFF executable -  pike_cv_default_compiler_abi=32 -  ;; -  *) -  # Unknown. Probably cross-compiling. -  PIKE_MSG_WARN([Unrecognized object file format: $filetype]) -  if dd if="conftest.$ac_cv_objext" count=2 bs=1 2>/dev/null | \ -  grep 'L' >/dev/null; then -  # A common case is rntcl... -  # If the file begins with 0x4c 0x01 it's a 80386 COFF executable. -  pike_cv_default_compiler_abi=32 -  fi -  ;; -  esac -  fi -  rm -f conftest.$ac_cv_objext conftest.$ac_ext - ]) - AC_MSG_RESULT($pike_cv_default_compiler_abi) -  - AC_MSG_CHECKING([which ABI to use]) - case "x$with_abi" in -  *32) -  with_abi="32" -  ;; -  *64) -  with_abi="64" -  ;; -  *) -  # Defaults -  with_abi="32" -  case "x`uname -m`" in -  xia64) -  with_abi="64" -  ;; -  xx86_64) -  with_abi="64" -  ;; -  xalpha) -  with_abi="64" -  ;; -  esac -  if type isainfo 2>/dev/null >/dev/null; then -  # Solaris -  with_abi="`isainfo -b`" -  elif type sysctl 2>/dev/null >/dev/null; then -  # MacOS X or Linux. -  # -  # On MacOS X hw.optional.64bitop is set to 1 if -  # 64bit is supported and useful. -  if test "`sysctl -n hw.optional.64bitops 2>/dev/null`" = "1"; then -  with_abi="64" -  fi -  fi -  ;; - esac - AC_MSG_RESULT(attempt $with_abi) -  - if test "x$with_abi" = "x64"; then -  # -  # We want 64bit mode if possible. -  # -  AC_SYS_COMPILER_FLAG(-q64, q64, CC) -  AC_SYS_COMPILER_FLAG(-m64, m64, CC) -  # Sun Studio 10 -  AC_SYS_COMPILER_FLAG(-xtarget=generic64, xtarget_generic64, CC) -  AC_SYS_COMPILER_FLAG(-xarch=generic64, xarch_generic64, CC) -  if test "$pike_cv_option_q64:$pike_cv_option_m64:$pike_cv_option_xtarget_generic64:$pike_cv_option_xarch_generic64" = "no:no:no:no"; then -  AC_SYS_COMPILER_FLAG(-q32, q32, CC) -  AC_SYS_COMPILER_FLAG(-m32, m32, CC) -  AC_SYS_COMPILER_FLAG(-xtarget=generic32, xtarget_generic32, CC) -  AC_SYS_COMPILER_FLAG(-xarch=generic32, xarch_generic32, CC) -  if test "$pike_cv_option_q32:$pike_cv_option_m32:$pike_cv_option_xtarget_generic32:$pike_cv_option_xarch_generic32" = "no:no:no:no"; then -  PIKE_MSG_WARN([Found no option to force 64 bit ABI.]) -  -  if test "x$pike_cv_default_compiler_abi" = "xunknown"; then :; else -  if test "x$pike_cv_default_compiler_abi" = "x$with_abi"; then -  : -  else -  PIKE_MSG_WARN([Using compiler default ABI: $pike_cv_default_compiler_abi]) -  with_abi="$pike_cv_default_compiler_abi" -  fi -  fi -  else -  PIKE_MSG_WARN([$CC does not support 64 bit ABI.]) -  with_abi=32 -  fi -  fi - else -  # -  # Try to force 32bit mode. -  # -  AC_SYS_COMPILER_FLAG(-q32, q32, CC) -  AC_SYS_COMPILER_FLAG(-m32, m32, CC) -  AC_SYS_COMPILER_FLAG(-xtarget=generic32, xtarget_generic32, CC) -  AC_SYS_COMPILER_FLAG(-xarch=generic32, xarch_generic32, CC) -  if test "$pike_cv_option_q32:$pike_cv_option_m32:$pike_cv_option_xtarget_generic32:$pike_cv_option_xarch_generic64" = "no:no:no:no"; then -  AC_SYS_COMPILER_FLAG(-q64, q64, CC) -  AC_SYS_COMPILER_FLAG(-m64, m64, CC) -  AC_SYS_COMPILER_FLAG(-xtarget=generic64, xtarget_generic64, CC) -  AC_SYS_COMPILER_FLAG(-xarch=generic64, arch_generic64, CC) -  if test "$pike_cv_option_q64:$pike_cv_option_m64:$pike_cv_option_xtarget_generic64:$pike_cv_option_xarch_generic64" = "no:no:no:no"; then -  PIKE_MSG_WARN([Found no option to force 32 bit ABI.]) -  -  if test "x$pike_cv_default_compiler_abi" = "xunknown"; then :; else -  if test "x$pike_cv_default_compiler_abi" = "x$with_abi"; then -  : -  else -  PIKE_MSG_WARN([Using compiler default ABI: $pike_cv_default_compiler_abi]) -  with_abi="$pike_cv_default_compiler_abi" -  fi -  fi -  else -  PIKE_MSG_WARN([$CC does not support 32 bit ABI.]) -  with_abi=64 -  fi -  fi -  if test "x$with_abi" = "x32"; then -  # -  # Make sure no later tests will add -q64 or -m64. -  # -  pike_disabled_option_q64=yes -  pike_disabled_option_m64=yes -  fi - fi -  - extra_abi_dirs="" - if type isainfo 2>/dev/null >/dev/null; then -  # Solaris -  # Some installations lack the symlink 64 -> amd64 or sparcv9, -  # or the corresponding 32 link. -  extra_abi_dirs=`isainfo -v 2>/dev/null|awk "/$with_abi"'-bit/ { print $2 }'` -  if test "x$extra_abi_dirs" = "x"; then :; else -  extra_abi_dirs="/$extra_abi_dirs" -  fi - fi -  - echo - echo "Using ABI $with_abi." - echo -  +    #############################################################################      if test "x$GCC" = "x"; then
1402:    test -d bundles/include/. || mkdir bundles/include    CPPFLAGS="$CPPFLAGS -I$pike_bundle_prefix/include"    test -d bundles/lib/. || mkdir bundles/lib -  for d in "$with_abi" "/$with_abi" $extra_abi_dirs ""; do +  for d in $pike_cv_abi_suffixes; do    test -d "bundles/lib$d/." || mkdir "bundles/lib$d"    LDFLAGS="$LDFLAGS -L$pike_bundle_prefix/lib$d"    done
2334:    # MinGW system.    cat <<\EOF   #!/bin/sh - # Automatically generated by $Id: configure.in,v 1.932 2005/12/30 16:32:42 nilsson Exp $. + # Automatically generated by $Id: configure.in,v 1.933 2006/01/05 14:15:02 grubba Exp $.   # MinGW-version. Do NOT edit.   posix_name="`cat`"   posix_prefix="/"
2372:    # Native POSIX system.    cat <<\EOF   #!/bin/sh - # Automatically generated by $Id: configure.in,v 1.932 2005/12/30 16:32:42 nilsson Exp $. + # Automatically generated by $Id: configure.in,v 1.933 2006/01/05 14:15:02 grubba Exp $.   # POSIX-version. Do NOT edit.   cat   EOF
2381:    # rntcl-style    cat <<\EOF   #!/bin/sh - # Automatically generated by $Id: configure.in,v 1.932 2005/12/30 16:32:42 nilsson Exp $. + # Automatically generated by $Id: configure.in,v 1.933 2006/01/05 14:15:02 grubba Exp $.   # RNTCL-version. Do NOT edit.   sed -e "$PIKE_PATH_TRANSLATE"   EOF
2421:    for dd in `echo $with_lib_path | sed -e 's/:/ /g'`; do    if test "$dd" = "/lib"; then continue; fi    if test "$dd" = "/usr/lib"; then continue; fi -  for suff in "$with_abi" "/$with_abi" $extra_abi_dirs ""; do +  for suff in $pike_cv_abi_suffixes; do    d="$dd$suff"    AC_MSG_CHECKING($d)    if test -d "$d/." ; then