Branch: Tag:

2009-10-19

2009-10-19 14:52:15 by Marcus Comstedt <marcus@mc.pp.se>

When using gcc -print-search-dirs to add ABI library directories,
make sure to do it _after_ adding other ABI directories, so that
their relative position in the link order is preserved. If this
is not done so, the order between lib directories will not match
the order between include directories, leading to weird problems
if a package exists in more than one location.

Rev: src/configure.in:1.1087

1: - AC_REVISION("$Id: configure.in,v 1.1086 2009/10/17 20:05:07 grubba Exp $") + AC_REVISION("$Id: configure.in,v 1.1087 2009/10/19 14:52:15 marcus Exp $")   AC_INIT(interpret.c)   AC_CONFIG_HEADER(machine.h)   
2451:    # MinGW system.    cat <<\EOF   #!/bin/sh - # Automatically generated by $Id: configure.in,v 1.1086 2009/10/17 20:05:07 grubba Exp $. + # Automatically generated by $Id: configure.in,v 1.1087 2009/10/19 14:52:15 marcus Exp $.   # MinGW-version. Do NOT edit.   posix_name="`cat`"   posix_prefix="/"
2489:    # Native POSIX system.    cat <<\EOF   #!/bin/sh - # Automatically generated by $Id: configure.in,v 1.1086 2009/10/17 20:05:07 grubba Exp $. + # Automatically generated by $Id: configure.in,v 1.1087 2009/10/19 14:52:15 marcus Exp $.   # POSIX-version. Do NOT edit.   cat   EOF
2498:    # rntcl-style    cat <<\EOF   #!/bin/sh - # Automatically generated by $Id: configure.in,v 1.1086 2009/10/17 20:05:07 grubba Exp $. + # Automatically generated by $Id: configure.in,v 1.1087 2009/10/19 14:52:15 marcus Exp $.   # RNTCL-version. Do NOT edit.   sed -e "$PIKE_PATH_TRANSLATE"   EOF
2533:   PIKE_INIT_REAL_DIRS      if test "x$with_lib_path" = "x"; then -  if test "x$with_dynamic_modules" = "xno"; then :; else -  if test "x$GCC" = "xno"; then :; else -  # Extract the default library paths from gcc, -  # so that we can pass them along to ld later on. -  for dd in `$CC -print-search-dirs 2>/dev/null | sed -e '/^libraries:/s/^[[^=]]*=//p' -ed | sed -e 's/\/:/ /g' -e 's/:/ /g' -e 's/\/$//'` /lib; do -  if test -d "$dd"; then :; else continue; fi -  # Normalize the paths. -  dd=`cd "$dd" && pwd` -  if test "$dd" = "/lib"; then continue; fi -  if test "$dd" = "/usr/lib"; then continue; fi -  for suff in $pike_cv_abi_suffixes; do -  d="$dd$suff" -  PIKE_CHECK_ABI_DIR($d, [ -  AC_MSG_CHECKING([if we need to add -L$real_dir to LDFLAGS]) -  case " $LDFLAGS " in -  *\ -L$d\ *) -  AC_MSG_RESULT([no - already added]) -  ;; -  *\ -L$real_dir\ *) -  AC_MSG_RESULT([no - already added]) -  ;; -  *) -  LDFLAGS="$LDFLAGS -L$real_dir" -  AC_MSG_RESULT([yes - added]) -  ;; -  esac -  AC_MSG_CHECKING([if we need to add -R$real_dir to LDFLAGS]) -  case " $LDFLAGS " in -  *\ -R$d\ *) -  AC_MSG_RESULT([no - already added]) -  ;; -  *\ -R$real_dir\ *) -  AC_MSG_RESULT([no - already added]) -  ;; -  *) -  if test "x$abi_dir_dynamic" = "xyes"; then -  LDFLAGS="$LDFLAGS -R$real_dir" -  AC_MSG_RESULT([yes - added]) +  : # Actual code for this case appears later...   else -  AC_MSG_RESULT([no - does not contain dynamic objects]) -  fi -  ;; -  esac -  ]) -  done -  done -  fi -  fi - 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
2751:   #Restore preprocessor warning sensitivity   ac_c_preproc_warn_flag="$OLD_ac_c_preproc_warn_flag"    + if test "x$with_lib_path" = "x"; then +  if test "x$with_dynamic_modules" = "xno"; then :; else +  if test "x$GCC" = "xno"; then :; else +  # Extract the default library paths from gcc, +  # so that we can pass them along to ld later on. +  for dd in `$CC -print-search-dirs 2>/dev/null | sed -e '/^libraries:/s/^[[^=]]*=//p' -ed | sed -e 's/\/:/ /g' -e 's/:/ /g' -e 's/\/$//'` /lib; do +  if test -d "$dd"; then :; else continue; fi +  # Normalize the paths. +  dd=`cd "$dd" && pwd` +  if test "$dd" = "/lib"; then continue; fi +  if test "$dd" = "/usr/lib"; then continue; fi +  for suff in $pike_cv_abi_suffixes; do +  d="$dd$suff" +  PIKE_CHECK_ABI_DIR($d, [ +  AC_MSG_CHECKING([if we need to add -L$real_dir to LDFLAGS]) +  case " $LDFLAGS " in +  *\ -L$d\ *) +  AC_MSG_RESULT([no - already added]) +  ;; +  *\ -L$real_dir\ *) +  AC_MSG_RESULT([no - already added]) +  ;; +  *) +  LDFLAGS="$LDFLAGS -L$real_dir" +  AC_MSG_RESULT([yes - added]) +  ;; +  esac +  AC_MSG_CHECKING([if we need to add -R$real_dir to LDFLAGS]) +  case " $LDFLAGS " in +  *\ -R$d\ *) +  AC_MSG_RESULT([no - already added]) +  ;; +  *\ -R$real_dir\ *) +  AC_MSG_RESULT([no - already added]) +  ;; +  *) +  if test "x$abi_dir_dynamic" = "xyes"; then +  LDFLAGS="$LDFLAGS -R$real_dir" +  AC_MSG_RESULT([yes - added])    else -  +  AC_MSG_RESULT([no - does not contain dynamic objects]) +  fi +  ;; +  esac +  ]) +  done +  done +  fi +  fi + fi +  + else    # We are running NT without MinGW    :   fi