Branch: Tag:

2005-06-15

2005-06-15 12:41:14 by Henrik Grubbström (Grubba) <grubba@grubba.org>

Joined lib and include directory checks to one pass.
Now doesn't add include directories that correspond to libraries with the wrong abi.

Rev: src/configure.in:1.898

1: - AC_REVISION("$Id: configure.in,v 1.897 2005/06/15 11:01:16 grubba Exp $") + AC_REVISION("$Id: configure.in,v 1.898 2005/06/15 12:41:14 grubba Exp $")   AC_INIT(interpret.c)   AC_CONFIG_HEADER(machine.h)   
2351:    # MinGW system.    cat <<\EOF   #!/bin/sh - # Automatically generated by $Id: configure.in,v 1.897 2005/06/15 11:01:16 grubba Exp $. + # Automatically generated by $Id: configure.in,v 1.898 2005/06/15 12:41:14 grubba Exp $.   # MinGW-version. Do NOT edit.   posix_name="`cat`"   posix_prefix="/"
2389:    # Native POSIX system.    cat <<\EOF   #!/bin/sh - # Automatically generated by $Id: configure.in,v 1.897 2005/06/15 11:01:16 grubba Exp $. + # Automatically generated by $Id: configure.in,v 1.898 2005/06/15 12:41:14 grubba Exp $.   # POSIX-version. Do NOT edit.   cat   EOF
2398:    # rntcl-style    cat <<\EOF   #!/bin/sh - # Automatically generated by $Id: configure.in,v 1.897 2005/06/15 11:01:16 grubba Exp $. + # Automatically generated by $Id: configure.in,v 1.898 2005/06/15 12:41:14 grubba Exp $.   # RNTCL-version. Do NOT edit.   sed -e "$PIKE_PATH_TRANSLATE"   EOF
2420:      if test x$"pike_cv_sys_os" != xWindows_NT ; then    - echo Searching for include-file directories... + 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 Searching for library and include directories... +    #Don't add include dirs if they give us warnings...   OLD_ac_c_preproc_warn_flag="$ac_c_preproc_warn_flag"   ac_c_preproc_warn_flag=yes    - if test $cppflags_is_set = no -a x${C_INCLUDE_PATH-} = x ; then -  real_include_dirs='' -  for d in `echo ${with_include_path} | sed 's/:/ /g'` \ -  `echo "${with_site_prefixes}/include"|sed -e 's/:/\/include /g'` \ -  `echo $prefix | sed "s@^NONE@$with_root$ac_default_prefix@g"`/include \ -  $with_root/usr/local/include $with_root/sw/local/include \ -  $with_root/usr/gnu/include $with_root/opt/gnu/include \ -  $with_root/sw/gnu/include $with_root/sw/include \ -  $with_root/usr/freeware/include $with_root/usr/pkg/include \ -  $with_root/usr/sfw/include $with_root/opt/sfw/include \ -  $with_root/opt/csw/include \ -  `echo $with_root/opt/gnome*/include | sort -r` \ -  `echo $with_root/usr/X11*/include | sort -r` -  do + real_dirs='/ /usr' + real_libs='/lib /usr/lib' + real_incs='/include /usr/include' +  + if test "x$with_lib_path" = "x"; then :; else +  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 +  d="$dd$suff"    AC_MSG_CHECKING($d) -  case x$d in -  x/usr/include | x/usr//include) +  if test -d "$d/." ; then +  real_dir=`cd "$d/." && /bin/pwd 2>/dev/null` +  if test "x$real_dir" = "x"; then :; else +  case " $real_libs " in +  *\ $real_dir\ *) +  AC_MSG_RESULT(already checked) +  continue    ;; -  +  esac +  real_libs="$real_libs $real_dir" +  fi +  bad_abi="" +  for f in "$d"/* no; do +  if test -f "$f"; then +  filetype=`file "$f" 2>/dev/null | sed -e 's/.*://'` +  if echo "$filetype" | grep "$with_abi-bit" >/dev/null; then +  bad_abi="" +  break; +  elif echo "$filetype" | grep "32-bit" >/dev/null; then +  bad_abi=32; +  elif echo "$filetype" | grep "64-bit" >/dev/null; then +  bad_abi=64; +  fi +  fi +  done +  if test "x$bad_abi" = "x"; then :; else +  AC_MSG_RESULT([no, contains only $bad_abi-bit ABI files]) +  continue; +  fi +  case " $LDFLAGS " in +  *\ -L$d\ -R$d\ * | *\ -R$d\ -L$d\ *) +  AC_MSG_RESULT(already added) +  libs_found="yes" +  ;;    *) -  if test -d "$d/." ; then -  REALDIR="`cd $d/. ; /bin/pwd`" -  if test "x$REALDIR" = x ; then -  REALDIR=UNKNOWN +  OLD_LDFLAGS="${LDFLAGS}" +  LDFLAGS="${LDFLAGS} -R$d -L$d -lm" +  AC_TRY_RUN([ + #include <stdio.h> + #include <math.h> + int main(int argc, char **argv) + { +  double (*foo)(double) = ceil; +  exit(0); + } +  ],[ LDFLAGS="$OLD_LDFLAGS -R$d -L$d" +  AC_MSG_RESULT(yes) +  libs_found="yes" +  ],[ LDFLAGS="$OLD_LDFLAGS" +  AC_MSG_RESULT(no) +  ],[AC_TRY_LINK([ + #include <stdio.h> + #include <math.h> +  ],[ +  double (*foo)(double) = ceil; +  exit(0); +  ],[ LDFLAGS="$OLD_LDFLAGS -R$d -L$d" +  AC_MSG_RESULT(probably) +  libs_found="yes" +  ],[ LDFLAGS="$OLD_LDFLAGS" +  AC_MSG_RESULT(no) +  ])]) +  ;; +  esac    else -  : +  AC_MSG_RESULT(no)    fi -  +  done +  done + fi    -  case " $CPPFLAGS $real_include_dirs -I/usr/include " in -  *\ -I$d\ * | *\ -I$REALDIR\ *) + if test "x$with_include_path" = "x"; then :; else +  for d in `echo $with_include_path | sed -e 's/:/ /g'`; do +  if test "$d" = "/lib/include"; then continue; fi +  if test "$d" = "/usr/lib/include"; then continue; fi +  AC_MSG_CHECKING($d) +  if test -d "$d/." ; then +  real_dir=`cd "$d/." && /bin/pwd 2>/dev/null` +  if test "x$real_dir" = "x"; then +  real_dir="UNKNOWN" +  else +  case " $real_incs " in +  *\ $real_dir\ *) +  AC_MSG_RESULT(already checked) +  continue +  ;; +  esac +  real_incs="$real_incs $real_dir" +  fi +  case " $CPPFLAGS " in +  *\ -I$d\ * | *\ -I$real_dir\ *)    AC_MSG_RESULT(already added)    ;;    *)
2462:    CPPFLAGS="${CPPFLAGS} -I$d"    AC_TRY_CPP([#include <stdio.h>], [    AC_MSG_RESULT(added) -  if test "x$REALDIR" != xUNKNOWN; then -  real_include_dirs="${real_include_dirs} -I$REALDIR" -  else -  : -  fi +     ], [    AC_MSG_RESULT(fails)    CPPFLAGS="${OLD_CPPFLAGS}"
2476:    else    AC_MSG_RESULT(no)    fi -  ;; -  esac +     done - else -  : +    fi    - #Restore preprocessor warning sensitivity - ac_c_preproc_warn_flag="$OLD_ac_c_preproc_warn_flag" -  - 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" + if test $ldflags_is_set = yes -a $cppflags_is_set = yes ; then :; else +  for dd in \ +  `echo "${with_site_prefixes}"|sed -e 's/:/ /g'` \ +  `echo $exec_prefix | sed "s@^NONE@$prefix@g" | sed "s@^NONE@$with_root$ac_default_prefix@g"` \ +  $with_root/usr/local $with_root/sw/local $with_root/sw \ +  $with_root/usr/gnu $with_root/opt/gnu $with_root/sw/gnu \ +  $with_root/usr/freeware $with_root/usr/pkg \ +  $with_root/usr/sfw $with_root/opt/sfw $with_root/opt/csw \ +  `echo $with_root/opt/gnome* | sort -r` \ +  `echo $with_root/usr/X* | sort -r` +  do +  if test "$dd" = "/"; then continue; fi +  if test "$dd" = "/usr"; then continue; fi +  AC_MSG_CHECKING($dd) +  if test -d "$dd/."; then :; else +  AC_MSG_RESULT(no) +  continue    fi -  +  real_dir=`cd "$dd/." && /bin/pwd 2>/dev/null` +  if test "x$real_dir" = "x"; then +  AC_MSG_RESULT(ok but pwd failed) +  else case " $real_dirs " in +  *\ $real_dir\ *) +  AC_MSG_RESULT(already checked) +  continue +  ;; +  esac +  AC_MSG_RESULT(ok) +  real_dirs="$real_dirs $real_dir"    fi -  - echo Searching for library directories... - if test $ldflags_is_set = no ; then -  for dd in `echo ${with_lib_path} | sed 's/:/ /g'` \ -  `echo "${with_site_prefixes}/lib"|sed -e 's/:/\/lib /g'` \ -  `echo $exec_prefix | sed "s@^NONE@$prefix/lib@g" | sed "s@^NONE@$with_root$ac_default_prefix@g"` \ -  $with_root/usr/local/lib $with_root/sw/local/lib $with_root/sw/lib \ -  $with_root/usr/gnu/lib $with_root/opt/gnu/lib $with_root/sw/gnu/lib \ -  $with_root/usr/freeware/lib $with_root/usr/pkg/lib \ -  $with_root/usr/sfw/lib $with_root/opt/sfw/lib \ -  $with_root/opt/csw/lib $with_root/opt/gnome-1.4/lib \ -  `echo $with_root/usr/X11*/lib | sort -r` -  do -  if test "$dd" = "/lib"; then continue; fi -  if test "$dd" = "/usr/lib"; then continue; fi +  libs_found="" +  if test $ldflags_is_set = yes ; then :; else    for suff in "$with_abi" "/$with_abi" $extra_abi_dirs ""; do -  d="$dd$suff" +  d="$dd/lib$suff"    AC_MSG_CHECKING($d)    if test -d "$d/." ; then -  +  real_dir=`cd "$d/." && /bin/pwd 2>/dev/null` +  if test "x$real_dir" = "x"; then :; else +  case " $real_libs " in +  *\ $real_dir\ *) +  AC_MSG_RESULT(already checked) +  continue +  ;; +  esac +  real_libs="$real_libs $real_dir" +  fi    bad_abi=""    for f in "$d"/* no; do    if test -f "$f"; then    filetype=`file "$f" 2>/dev/null | sed -e 's/.*://'`    if echo "$filetype" | grep "$with_abi-bit" >/dev/null; then -  bad_abi=""; +  bad_abi=""    break;    elif echo "$filetype" | grep "32-bit" >/dev/null; then    bad_abi=32;
2531:    done    if test "x$bad_abi" = "x"; then :; else    AC_MSG_RESULT([no, contains only $bad_abi-bit ABI files]) +  if test "x$libs_found" = "x"; then +  libs_found="no" +  fi    continue;    fi    case " $LDFLAGS " in    *\ -L$d\ -R$d\ * | *\ -R$d\ -L$d\ *)    AC_MSG_RESULT(already added) -  +  libs_found="yes"    ;;    *)    OLD_LDFLAGS="${LDFLAGS}"
2550:   }    ],[ LDFLAGS="$OLD_LDFLAGS -R$d -L$d"    AC_MSG_RESULT(yes) +  libs_found="yes"    ],[ LDFLAGS="$OLD_LDFLAGS"    AC_MSG_RESULT(no)    ],[AC_TRY_LINK([
2560:    exit(0);    ],[ LDFLAGS="$OLD_LDFLAGS -R$d -L$d"    AC_MSG_RESULT(probably) +  libs_found="yes"    ],[ LDFLAGS="$OLD_LDFLAGS" -  AC_MSG_RESULT(no)])]) +  AC_MSG_RESULT(no) +  ])])    ;;    esac    else    AC_MSG_RESULT(no)    fi    done -  done +  fi +  if test $cppflags_is_set = no -a "x$C_INCLUDE_PATH" = "x"; then +  d="$dd/include" +  AC_MSG_CHECKING($d) +  if test "x$libs_found" = "xno"; then +  # Don't add includes that correspond to libraries for the wrong ABI. +  AC_MSG_RESULT(skipped - bad libraries) +  continue +  fi +  if test -d "$d/." ; then +  real_dir=`cd "$d/." && /bin/pwd 2>/dev/null` +  if test "x$real_dir" = "x"; then +  real_dir="UNKNOWN"    else -  : +  case " $real_incs " in +  *\ $real_dir\ *) +  AC_MSG_RESULT(already checked) +  continue +  ;; +  esac +  real_incs="$real_incs $real_dir"    fi -  +  case " $CPPFLAGS " in +  *\ -I$d\ * | *\ -I$real_dir\ *) +  AC_MSG_RESULT(already added) +  ;; +  *) +  OLD_CPPFLAGS="${CPPFLAGS}" +  CPPFLAGS="${CPPFLAGS} -I$d" +  AC_TRY_CPP([#include <stdio.h>], [ +  AC_MSG_RESULT(added) +  ], [ +  AC_MSG_RESULT(fails) +  CPPFLAGS="${OLD_CPPFLAGS}" +  ]) +  ;; +  esac +  else +  AC_MSG_RESULT(no) +  fi +  fi +  done + fi    -  + #Restore preprocessor warning sensitivity + ac_c_preproc_warn_flag="$OLD_ac_c_preproc_warn_flag" +    echo Searching for binary directories...   for d in `echo $exec_prefix | sed "s@^NONE@$prefix@g" | sed "s@^NONE@$with_root$ac_default_prefix@g"` \    `echo "${with_site_prefixes}"|sed -e 's/:/ /g'` \