bug-gnulib
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

update havelib module


From: Bruno Haible
Subject: update havelib module
Date: Sat, 22 Jul 2006 18:57:04 +0200
User-agent: KMail/1.9.1

Merge from gettext. Just a new convenience macro.

2006-03-25  Bruno Haible  <address@hidden>

        * lib-link.m4 (AC_LIB_LINKFLAGS_FROM_LIBS): New macro.

*** lib-link.m4 2 Sep 2005 11:20:50 -0000       1.11
--- lib-link.m4 22 Jul 2006 16:58:52 -0000
***************
*** 1,5 ****
! # lib-link.m4 serial 7 (gettext-0.15)
! dnl Copyright (C) 2001-2005 Free Software Foundation, Inc.
  dnl This file is free software; the Free Software Foundation
  dnl gives unlimited permission to copy and/or distribute it,
  dnl with or without modifications, as long as this notice is preserved.
--- 1,5 ----
! # lib-link.m4 serial 8 (gettext-0.15)
! dnl Copyright (C) 2001-2006 Free Software Foundation, Inc.
  dnl This file is free software; the Free Software Foundation
  dnl gives unlimited permission to copy and/or distribute it,
  dnl with or without modifications, as long as this notice is preserved.
***************
*** 552,554 ****
--- 552,630 ----
      fi
    done
  ])
+ 
+ dnl For those cases where a variable contains several -L and -l options
+ dnl referring to unknown libraries and directories, this macro determines the
+ dnl necessary additional linker options for the runtime path.
+ dnl AC_LIB_LINKFLAGS_FROM_LIBS([LDADDVAR], [LIBSVALUE], [USE-LIBTOOL])
+ dnl sets LDADDVAR to linker options needed together with LIBSVALUE.
+ dnl If USE-LIBTOOL evaluates to non-empty, linking with libtool is assumed,
+ dnl otherwise linking without libtool is assumed.
+ AC_DEFUN([AC_LIB_LINKFLAGS_FROM_LIBS],
+ [
+   AC_REQUIRE([AC_LIB_RPATH])
+   AC_REQUIRE([AC_LIB_PREPARE_MULTILIB])
+   $1=
+   if test "$enable_rpath" != no; then
+     if test -n "$hardcode_libdir_flag_spec" && test "$hardcode_minus_L" = no; 
then
+       dnl Use an explicit option to hardcode directories into the resulting
+       dnl binary.
+       rpathdirs=
+       next=
+       for opt in $2; do
+         if test -n "$next"; then
+           dir="$next"
+           dnl No need to hardcode the standard /usr/lib.
+           if test "X$dir" != "X/usr/$acl_libdirstem"; then
+             rpathdirs="$rpathdirs $dir"
+           fi
+           next=
+         else
+           case $opt in
+             -L) next=yes ;;
+             -L*) dir=`echo "X$opt" | sed -e 's,^X-L,,'`
+                  dnl No need to hardcode the standard /usr/lib.
+                  if test "X$dir" != "X/usr/$acl_libdirstem"; then
+                    rpathdirs="$rpathdirs $dir"
+                  fi
+                  next= ;;
+             *) next= ;;
+           esac
+         fi
+       done
+       if test "X$rpathdirs" != "X"; then
+         if test -n ""$3""; then
+           dnl libtool is used for linking. Use -R options.
+           for dir in $rpathdirs; do
+             $1="${$1}${$1:+ }-R$dir"
+           done
+         else
+           dnl The linker is used for linking directly.
+           if test -n "$hardcode_libdir_separator"; then
+             dnl Weird platform: only the last -rpath option counts, the user
+             dnl must pass all path elements in one option.
+             alldirs=
+             for dir in $rpathdirs; do
+               alldirs="${alldirs}${alldirs:+$hardcode_libdir_separator}$dir"
+             done
+             acl_save_libdir="$libdir"
+             libdir="$alldirs"
+             eval flag=\"$hardcode_libdir_flag_spec\"
+             libdir="$acl_save_libdir"
+             $1="$flag"
+           else
+             dnl The -rpath options are cumulative.
+             for dir in $rpathdirs; do
+               acl_save_libdir="$libdir"
+               libdir="$dir"
+               eval flag=\"$hardcode_libdir_flag_spec\"
+               libdir="$acl_save_libdir"
+               $1="${$1}${$1:+ }$flag"
+             done
+           fi
+         fi
+       fi
+     fi
+   fi
+   AC_SUBST([$1])
+ ])




reply via email to

[Prev in Thread] Current Thread [Next in Thread]