Blame m4/lib-link.m4

rpm-build 0a0c83
# lib-link.m4 serial 26 (gettext-0.18.2)
rpm-build 0a0c83
dnl Copyright (C) 2001-2013 Free Software Foundation, Inc.
rpm-build 0a0c83
dnl This file is free software; the Free Software Foundation
rpm-build 0a0c83
dnl gives unlimited permission to copy and/or distribute it,
rpm-build 0a0c83
dnl with or without modifications, as long as this notice is preserved.
rpm-build 0a0c83
rpm-build 0a0c83
dnl From Bruno Haible.
rpm-build 0a0c83
rpm-build 0a0c83
AC_PREREQ([2.54])
rpm-build 0a0c83
rpm-build 0a0c83
dnl AC_LIB_LINKFLAGS(name [, dependencies]) searches for libname and
rpm-build 0a0c83
dnl the libraries corresponding to explicit and implicit dependencies.
rpm-build 0a0c83
dnl Sets and AC_SUBSTs the LIB${NAME} and LTLIB${NAME} variables and
rpm-build 0a0c83
dnl augments the CPPFLAGS variable.
rpm-build 0a0c83
dnl Sets and AC_SUBSTs the LIB${NAME}_PREFIX variable to nonempty if libname
rpm-build 0a0c83
dnl was found in ${LIB${NAME}_PREFIX}/$acl_libdirstem.
rpm-build 0a0c83
AC_DEFUN([AC_LIB_LINKFLAGS],
rpm-build 0a0c83
[
rpm-build 0a0c83
  AC_REQUIRE([AC_LIB_PREPARE_PREFIX])
rpm-build 0a0c83
  AC_REQUIRE([AC_LIB_RPATH])
rpm-build 0a0c83
  pushdef([Name],[m4_translit([$1],[./+-], [____])])
rpm-build 0a0c83
  pushdef([NAME],[m4_translit([$1],[abcdefghijklmnopqrstuvwxyz./+-],
rpm-build 0a0c83
                                   [ABCDEFGHIJKLMNOPQRSTUVWXYZ____])])
rpm-build 0a0c83
  AC_CACHE_CHECK([how to link with lib[]$1], [ac_cv_lib[]Name[]_libs], [
rpm-build 0a0c83
    AC_LIB_LINKFLAGS_BODY([$1], [$2])
rpm-build 0a0c83
    ac_cv_lib[]Name[]_libs="$LIB[]NAME"
rpm-build 0a0c83
    ac_cv_lib[]Name[]_ltlibs="$LTLIB[]NAME"
rpm-build 0a0c83
    ac_cv_lib[]Name[]_cppflags="$INC[]NAME"
rpm-build 0a0c83
    ac_cv_lib[]Name[]_prefix="$LIB[]NAME[]_PREFIX"
rpm-build 0a0c83
  ])
rpm-build 0a0c83
  LIB[]NAME="$ac_cv_lib[]Name[]_libs"
rpm-build 0a0c83
  LTLIB[]NAME="$ac_cv_lib[]Name[]_ltlibs"
rpm-build 0a0c83
  INC[]NAME="$ac_cv_lib[]Name[]_cppflags"
rpm-build 0a0c83
  LIB[]NAME[]_PREFIX="$ac_cv_lib[]Name[]_prefix"
rpm-build 0a0c83
  AC_LIB_APPENDTOVAR([CPPFLAGS], [$INC]NAME)
rpm-build 0a0c83
  AC_SUBST([LIB]NAME)
rpm-build 0a0c83
  AC_SUBST([LTLIB]NAME)
rpm-build 0a0c83
  AC_SUBST([LIB]NAME[_PREFIX])
rpm-build 0a0c83
  dnl Also set HAVE_LIB[]NAME so that AC_LIB_HAVE_LINKFLAGS can reuse the
rpm-build 0a0c83
  dnl results of this search when this library appears as a dependency.
rpm-build 0a0c83
  HAVE_LIB[]NAME=yes
rpm-build 0a0c83
  popdef([NAME])
rpm-build 0a0c83
  popdef([Name])
rpm-build 0a0c83
])
rpm-build 0a0c83
rpm-build 0a0c83
dnl AC_LIB_HAVE_LINKFLAGS(name, dependencies, includes, testcode, [missing-message])
rpm-build 0a0c83
dnl searches for libname and the libraries corresponding to explicit and
rpm-build 0a0c83
dnl implicit dependencies, together with the specified include files and
rpm-build 0a0c83
dnl the ability to compile and link the specified testcode. The missing-message
rpm-build 0a0c83
dnl defaults to 'no' and may contain additional hints for the user.
rpm-build 0a0c83
dnl If found, it sets and AC_SUBSTs HAVE_LIB${NAME}=yes and the LIB${NAME}
rpm-build 0a0c83
dnl and LTLIB${NAME} variables and augments the CPPFLAGS variable, and
rpm-build 0a0c83
dnl #defines HAVE_LIB${NAME} to 1. Otherwise, it sets and AC_SUBSTs
rpm-build 0a0c83
dnl HAVE_LIB${NAME}=no and LIB${NAME} and LTLIB${NAME} to empty.
rpm-build 0a0c83
dnl Sets and AC_SUBSTs the LIB${NAME}_PREFIX variable to nonempty if libname
rpm-build 0a0c83
dnl was found in ${LIB${NAME}_PREFIX}/$acl_libdirstem.
rpm-build 0a0c83
AC_DEFUN([AC_LIB_HAVE_LINKFLAGS],
rpm-build 0a0c83
[
rpm-build 0a0c83
  AC_REQUIRE([AC_LIB_PREPARE_PREFIX])
rpm-build 0a0c83
  AC_REQUIRE([AC_LIB_RPATH])
rpm-build 0a0c83
  pushdef([Name],[m4_translit([$1],[./+-], [____])])
rpm-build 0a0c83
  pushdef([NAME],[m4_translit([$1],[abcdefghijklmnopqrstuvwxyz./+-],
rpm-build 0a0c83
                                   [ABCDEFGHIJKLMNOPQRSTUVWXYZ____])])
rpm-build 0a0c83
rpm-build 0a0c83
  dnl Search for lib[]Name and define LIB[]NAME, LTLIB[]NAME and INC[]NAME
rpm-build 0a0c83
  dnl accordingly.
rpm-build 0a0c83
  AC_LIB_LINKFLAGS_BODY([$1], [$2])
rpm-build 0a0c83
rpm-build 0a0c83
  dnl Add $INC[]NAME to CPPFLAGS before performing the following checks,
rpm-build 0a0c83
  dnl because if the user has installed lib[]Name and not disabled its use
rpm-build 0a0c83
  dnl via --without-lib[]Name-prefix, he wants to use it.
rpm-build 0a0c83
  ac_save_CPPFLAGS="$CPPFLAGS"
rpm-build 0a0c83
  AC_LIB_APPENDTOVAR([CPPFLAGS], [$INC]NAME)
rpm-build 0a0c83
rpm-build 0a0c83
  AC_CACHE_CHECK([for lib[]$1], [ac_cv_lib[]Name], [
rpm-build 0a0c83
    ac_save_LIBS="$LIBS"
rpm-build 0a0c83
    dnl If $LIB[]NAME contains some -l options, add it to the end of LIBS,
rpm-build 0a0c83
    dnl because these -l options might require -L options that are present in
rpm-build 0a0c83
    dnl LIBS. -l options benefit only from the -L options listed before it.
rpm-build 0a0c83
    dnl Otherwise, add it to the front of LIBS, because it may be a static
rpm-build 0a0c83
    dnl library that depends on another static library that is present in LIBS.
rpm-build 0a0c83
    dnl Static libraries benefit only from the static libraries listed after
rpm-build 0a0c83
    dnl it.
rpm-build 0a0c83
    case " $LIB[]NAME" in
rpm-build 0a0c83
      *" -l"*) LIBS="$LIBS $LIB[]NAME" ;;
rpm-build 0a0c83
      *)       LIBS="$LIB[]NAME $LIBS" ;;
rpm-build 0a0c83
    esac
rpm-build 0a0c83
    AC_LINK_IFELSE(
rpm-build 0a0c83
      [AC_LANG_PROGRAM([[$3]], [[$4]])],
rpm-build 0a0c83
      [ac_cv_lib[]Name=yes],
rpm-build 0a0c83
      [ac_cv_lib[]Name='m4_if([$5], [], [no], [[$5]])'])
rpm-build 0a0c83
    LIBS="$ac_save_LIBS"
rpm-build 0a0c83
  ])
rpm-build 0a0c83
  if test "$ac_cv_lib[]Name" = yes; then
rpm-build 0a0c83
    HAVE_LIB[]NAME=yes
rpm-build 0a0c83
    AC_DEFINE([HAVE_LIB]NAME, 1, [Define if you have the lib][$1 library.])
rpm-build 0a0c83
    AC_MSG_CHECKING([how to link with lib[]$1])
rpm-build 0a0c83
    AC_MSG_RESULT([$LIB[]NAME])
rpm-build 0a0c83
  else
rpm-build 0a0c83
    HAVE_LIB[]NAME=no
rpm-build 0a0c83
    dnl If $LIB[]NAME didn't lead to a usable library, we don't need
rpm-build 0a0c83
    dnl $INC[]NAME either.
rpm-build 0a0c83
    CPPFLAGS="$ac_save_CPPFLAGS"
rpm-build 0a0c83
    LIB[]NAME=
rpm-build 0a0c83
    LTLIB[]NAME=
rpm-build 0a0c83
    LIB[]NAME[]_PREFIX=
rpm-build 0a0c83
  fi
rpm-build 0a0c83
  AC_SUBST([HAVE_LIB]NAME)
rpm-build 0a0c83
  AC_SUBST([LIB]NAME)
rpm-build 0a0c83
  AC_SUBST([LTLIB]NAME)
rpm-build 0a0c83
  AC_SUBST([LIB]NAME[_PREFIX])
rpm-build 0a0c83
  popdef([NAME])
rpm-build 0a0c83
  popdef([Name])
rpm-build 0a0c83
])
rpm-build 0a0c83
rpm-build 0a0c83
dnl Determine the platform dependent parameters needed to use rpath:
rpm-build 0a0c83
dnl   acl_libext,
rpm-build 0a0c83
dnl   acl_shlibext,
rpm-build 0a0c83
dnl   acl_libname_spec,
rpm-build 0a0c83
dnl   acl_library_names_spec,
rpm-build 0a0c83
dnl   acl_hardcode_libdir_flag_spec,
rpm-build 0a0c83
dnl   acl_hardcode_libdir_separator,
rpm-build 0a0c83
dnl   acl_hardcode_direct,
rpm-build 0a0c83
dnl   acl_hardcode_minus_L.
rpm-build 0a0c83
AC_DEFUN([AC_LIB_RPATH],
rpm-build 0a0c83
[
rpm-build 0a0c83
  dnl Tell automake >= 1.10 to complain if config.rpath is missing.
rpm-build 0a0c83
  m4_ifdef([AC_REQUIRE_AUX_FILE], [AC_REQUIRE_AUX_FILE([config.rpath])])
rpm-build 0a0c83
  AC_REQUIRE([AC_PROG_CC])                dnl we use $CC, $GCC, $LDFLAGS
rpm-build 0a0c83
  AC_REQUIRE([AC_LIB_PROG_LD])            dnl we use $LD, $with_gnu_ld
rpm-build 0a0c83
  AC_REQUIRE([AC_CANONICAL_HOST])         dnl we use $host
rpm-build 0a0c83
  AC_REQUIRE([AC_CONFIG_AUX_DIR_DEFAULT]) dnl we use $ac_aux_dir
rpm-build 0a0c83
  AC_CACHE_CHECK([for shared library run path origin], [acl_cv_rpath], [
rpm-build 0a0c83
    CC="$CC" GCC="$GCC" LDFLAGS="$LDFLAGS" LD="$LD" with_gnu_ld="$with_gnu_ld" \
rpm-build 0a0c83
    ${CONFIG_SHELL-/bin/sh} "$ac_aux_dir/config.rpath" "$host" > conftest.sh
rpm-build 0a0c83
    . ./conftest.sh
rpm-build 0a0c83
    rm -f ./conftest.sh
rpm-build 0a0c83
    acl_cv_rpath=done
rpm-build 0a0c83
  ])
rpm-build 0a0c83
  wl="$acl_cv_wl"
rpm-build 0a0c83
  acl_libext="$acl_cv_libext"
rpm-build 0a0c83
  acl_shlibext="$acl_cv_shlibext"
rpm-build 0a0c83
  acl_libname_spec="$acl_cv_libname_spec"
rpm-build 0a0c83
  acl_library_names_spec="$acl_cv_library_names_spec"
rpm-build 0a0c83
  acl_hardcode_libdir_flag_spec="$acl_cv_hardcode_libdir_flag_spec"
rpm-build 0a0c83
  acl_hardcode_libdir_separator="$acl_cv_hardcode_libdir_separator"
rpm-build 0a0c83
  acl_hardcode_direct="$acl_cv_hardcode_direct"
rpm-build 0a0c83
  acl_hardcode_minus_L="$acl_cv_hardcode_minus_L"
rpm-build 0a0c83
  dnl Determine whether the user wants rpath handling at all.
rpm-build 0a0c83
  AC_ARG_ENABLE([rpath],
rpm-build 0a0c83
    [  --disable-rpath         do not hardcode runtime library paths],
rpm-build 0a0c83
    :, enable_rpath=yes)
rpm-build 0a0c83
])
rpm-build 0a0c83
rpm-build 0a0c83
dnl AC_LIB_FROMPACKAGE(name, package)
rpm-build 0a0c83
dnl declares that libname comes from the given package. The configure file
rpm-build 0a0c83
dnl will then not have a --with-libname-prefix option but a
rpm-build 0a0c83
dnl --with-package-prefix option. Several libraries can come from the same
rpm-build 0a0c83
dnl package. This declaration must occur before an AC_LIB_LINKFLAGS or similar
rpm-build 0a0c83
dnl macro call that searches for libname.
rpm-build 0a0c83
AC_DEFUN([AC_LIB_FROMPACKAGE],
rpm-build 0a0c83
[
rpm-build 0a0c83
  pushdef([NAME],[m4_translit([$1],[abcdefghijklmnopqrstuvwxyz./+-],
rpm-build 0a0c83
                                   [ABCDEFGHIJKLMNOPQRSTUVWXYZ____])])
rpm-build 0a0c83
  define([acl_frompackage_]NAME, [$2])
rpm-build 0a0c83
  popdef([NAME])
rpm-build 0a0c83
  pushdef([PACK],[$2])
rpm-build 0a0c83
  pushdef([PACKUP],[m4_translit(PACK,[abcdefghijklmnopqrstuvwxyz./+-],
rpm-build 0a0c83
                                     [ABCDEFGHIJKLMNOPQRSTUVWXYZ____])])
rpm-build 0a0c83
  define([acl_libsinpackage_]PACKUP,
rpm-build 0a0c83
    m4_ifdef([acl_libsinpackage_]PACKUP, [m4_defn([acl_libsinpackage_]PACKUP)[, ]],)[lib$1])
rpm-build 0a0c83
  popdef([PACKUP])
rpm-build 0a0c83
  popdef([PACK])
rpm-build 0a0c83
])
rpm-build 0a0c83
rpm-build 0a0c83
dnl AC_LIB_LINKFLAGS_BODY(name [, dependencies]) searches for libname and
rpm-build 0a0c83
dnl the libraries corresponding to explicit and implicit dependencies.
rpm-build 0a0c83
dnl Sets the LIB${NAME}, LTLIB${NAME} and INC${NAME} variables.
rpm-build 0a0c83
dnl Also, sets the LIB${NAME}_PREFIX variable to nonempty if libname was found
rpm-build 0a0c83
dnl in ${LIB${NAME}_PREFIX}/$acl_libdirstem.
rpm-build 0a0c83
AC_DEFUN([AC_LIB_LINKFLAGS_BODY],
rpm-build 0a0c83
[
rpm-build 0a0c83
  AC_REQUIRE([AC_LIB_PREPARE_MULTILIB])
rpm-build 0a0c83
  pushdef([NAME],[m4_translit([$1],[abcdefghijklmnopqrstuvwxyz./+-],
rpm-build 0a0c83
                                   [ABCDEFGHIJKLMNOPQRSTUVWXYZ____])])
rpm-build 0a0c83
  pushdef([PACK],[m4_ifdef([acl_frompackage_]NAME, [acl_frompackage_]NAME, lib[$1])])
rpm-build 0a0c83
  pushdef([PACKUP],[m4_translit(PACK,[abcdefghijklmnopqrstuvwxyz./+-],
rpm-build 0a0c83
                                     [ABCDEFGHIJKLMNOPQRSTUVWXYZ____])])
rpm-build 0a0c83
  pushdef([PACKLIBS],[m4_ifdef([acl_frompackage_]NAME, [acl_libsinpackage_]PACKUP, lib[$1])])
rpm-build 0a0c83
  dnl Autoconf >= 2.61 supports dots in --with options.
rpm-build 0a0c83
  pushdef([P_A_C_K],[m4_if(m4_version_compare(m4_defn([m4_PACKAGE_VERSION]),[2.61]),[-1],[m4_translit(PACK,[.],[_])],PACK)])
rpm-build 0a0c83
  dnl By default, look in $includedir and $libdir.
rpm-build 0a0c83
  use_additional=yes
rpm-build 0a0c83
  AC_LIB_WITH_FINAL_PREFIX([
rpm-build 0a0c83
    eval additional_includedir=\"$includedir\"
rpm-build 0a0c83
    eval additional_libdir=\"$libdir\"
rpm-build 0a0c83
  ])
rpm-build 0a0c83
  AC_ARG_WITH(P_A_C_K[-prefix],
rpm-build 0a0c83
[[  --with-]]P_A_C_K[[-prefix[=DIR]  search for ]PACKLIBS[ in DIR/include and DIR/lib
rpm-build 0a0c83
  --without-]]P_A_C_K[[-prefix     don't search for ]PACKLIBS[ in includedir and libdir]],
rpm-build 0a0c83
[
rpm-build 0a0c83
    if test "X$withval" = "Xno"; then
rpm-build 0a0c83
      use_additional=no
rpm-build 0a0c83
    else
rpm-build 0a0c83
      if test "X$withval" = "X"; then
rpm-build 0a0c83
        AC_LIB_WITH_FINAL_PREFIX([
rpm-build 0a0c83
          eval additional_includedir=\"$includedir\"
rpm-build 0a0c83
          eval additional_libdir=\"$libdir\"
rpm-build 0a0c83
        ])
rpm-build 0a0c83
      else
rpm-build 0a0c83
        additional_includedir="$withval/include"
rpm-build 0a0c83
        additional_libdir="$withval/$acl_libdirstem"
rpm-build 0a0c83
        if test "$acl_libdirstem2" != "$acl_libdirstem" \
rpm-build 0a0c83
           && ! test -d "$withval/$acl_libdirstem"; then
rpm-build 0a0c83
          additional_libdir="$withval/$acl_libdirstem2"
rpm-build 0a0c83
        fi
rpm-build 0a0c83
      fi
rpm-build 0a0c83
    fi
rpm-build 0a0c83
])
rpm-build 0a0c83
  dnl Search the library and its dependencies in $additional_libdir and
rpm-build 0a0c83
  dnl $LDFLAGS. Using breadth-first-seach.
rpm-build 0a0c83
  LIB[]NAME=
rpm-build 0a0c83
  LTLIB[]NAME=
rpm-build 0a0c83
  INC[]NAME=
rpm-build 0a0c83
  LIB[]NAME[]_PREFIX=
rpm-build 0a0c83
  dnl HAVE_LIB${NAME} is an indicator that LIB${NAME}, LTLIB${NAME} have been
rpm-build 0a0c83
  dnl computed. So it has to be reset here.
rpm-build 0a0c83
  HAVE_LIB[]NAME=
rpm-build 0a0c83
  rpathdirs=
rpm-build 0a0c83
  ltrpathdirs=
rpm-build 0a0c83
  names_already_handled=
rpm-build 0a0c83
  names_next_round='$1 $2'
rpm-build 0a0c83
  while test -n "$names_next_round"; do
rpm-build 0a0c83
    names_this_round="$names_next_round"
rpm-build 0a0c83
    names_next_round=
rpm-build 0a0c83
    for name in $names_this_round; do
rpm-build 0a0c83
      already_handled=
rpm-build 0a0c83
      for n in $names_already_handled; do
rpm-build 0a0c83
        if test "$n" = "$name"; then
rpm-build 0a0c83
          already_handled=yes
rpm-build 0a0c83
          break
rpm-build 0a0c83
        fi
rpm-build 0a0c83
      done
rpm-build 0a0c83
      if test -z "$already_handled"; then
rpm-build 0a0c83
        names_already_handled="$names_already_handled $name"
rpm-build 0a0c83
        dnl See if it was already located by an earlier AC_LIB_LINKFLAGS
rpm-build 0a0c83
        dnl or AC_LIB_HAVE_LINKFLAGS call.
rpm-build 0a0c83
        uppername=`echo "$name" | sed -e 'y|abcdefghijklmnopqrstuvwxyz./+-|ABCDEFGHIJKLMNOPQRSTUVWXYZ____|'`
rpm-build 0a0c83
        eval value=\"\$HAVE_LIB$uppername\"
rpm-build 0a0c83
        if test -n "$value"; then
rpm-build 0a0c83
          if test "$value" = yes; then
rpm-build 0a0c83
            eval value=\"\$LIB$uppername\"
rpm-build 0a0c83
            test -z "$value" || LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$value"
rpm-build 0a0c83
            eval value=\"\$LTLIB$uppername\"
rpm-build 0a0c83
            test -z "$value" || LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }$value"
rpm-build 0a0c83
          else
rpm-build 0a0c83
            dnl An earlier call to AC_LIB_HAVE_LINKFLAGS has determined
rpm-build 0a0c83
            dnl that this library doesn't exist. So just drop it.
rpm-build 0a0c83
            :
rpm-build 0a0c83
          fi
rpm-build 0a0c83
        else
rpm-build 0a0c83
          dnl Search the library lib$name in $additional_libdir and $LDFLAGS
rpm-build 0a0c83
          dnl and the already constructed $LIBNAME/$LTLIBNAME.
rpm-build 0a0c83
          found_dir=
rpm-build 0a0c83
          found_la=
rpm-build 0a0c83
          found_so=
rpm-build 0a0c83
          found_a=
rpm-build 0a0c83
          eval libname=\"$acl_libname_spec\"    # typically: libname=lib$name
rpm-build 0a0c83
          if test -n "$acl_shlibext"; then
rpm-build 0a0c83
            shrext=".$acl_shlibext"             # typically: shrext=.so
rpm-build 0a0c83
          else
rpm-build 0a0c83
            shrext=
rpm-build 0a0c83
          fi
rpm-build 0a0c83
          if test $use_additional = yes; then
rpm-build 0a0c83
            dir="$additional_libdir"
rpm-build 0a0c83
            dnl The same code as in the loop below:
rpm-build 0a0c83
            dnl First look for a shared library.
rpm-build 0a0c83
            if test -n "$acl_shlibext"; then
rpm-build 0a0c83
              if test -f "$dir/$libname$shrext"; then
rpm-build 0a0c83
                found_dir="$dir"
rpm-build 0a0c83
                found_so="$dir/$libname$shrext"
rpm-build 0a0c83
              else
rpm-build 0a0c83
                if test "$acl_library_names_spec" = '$libname$shrext$versuffix'; then
rpm-build 0a0c83
                  ver=`(cd "$dir" && \
rpm-build 0a0c83
                        for f in "$libname$shrext".*; do echo "$f"; done \
rpm-build 0a0c83
                        | sed -e "s,^$libname$shrext\\\\.,," \
rpm-build 0a0c83
                        | sort -t '.' -n -r -k1,1 -k2,2 -k3,3 -k4,4 -k5,5 \
rpm-build 0a0c83
                        | sed 1q ) 2>/dev/null`
rpm-build 0a0c83
                  if test -n "$ver" && test -f "$dir/$libname$shrext.$ver"; then
rpm-build 0a0c83
                    found_dir="$dir"
rpm-build 0a0c83
                    found_so="$dir/$libname$shrext.$ver"
rpm-build 0a0c83
                  fi
rpm-build 0a0c83
                else
rpm-build 0a0c83
                  eval library_names=\"$acl_library_names_spec\"
rpm-build 0a0c83
                  for f in $library_names; do
rpm-build 0a0c83
                    if test -f "$dir/$f"; then
rpm-build 0a0c83
                      found_dir="$dir"
rpm-build 0a0c83
                      found_so="$dir/$f"
rpm-build 0a0c83
                      break
rpm-build 0a0c83
                    fi
rpm-build 0a0c83
                  done
rpm-build 0a0c83
                fi
rpm-build 0a0c83
              fi
rpm-build 0a0c83
            fi
rpm-build 0a0c83
            dnl Then look for a static library.
rpm-build 0a0c83
            if test "X$found_dir" = "X"; then
rpm-build 0a0c83
              if test -f "$dir/$libname.$acl_libext"; then
rpm-build 0a0c83
                found_dir="$dir"
rpm-build 0a0c83
                found_a="$dir/$libname.$acl_libext"
rpm-build 0a0c83
              fi
rpm-build 0a0c83
            fi
rpm-build 0a0c83
            if test "X$found_dir" != "X"; then
rpm-build 0a0c83
              if test -f "$dir/$libname.la"; then
rpm-build 0a0c83
                found_la="$dir/$libname.la"
rpm-build 0a0c83
              fi
rpm-build 0a0c83
            fi
rpm-build 0a0c83
          fi
rpm-build 0a0c83
          if test "X$found_dir" = "X"; then
rpm-build 0a0c83
            for x in $LDFLAGS $LTLIB[]NAME; do
rpm-build 0a0c83
              AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"])
rpm-build 0a0c83
              case "$x" in
rpm-build 0a0c83
                -L*)
rpm-build 0a0c83
                  dir=`echo "X$x" | sed -e 's/^X-L//'`
rpm-build 0a0c83
                  dnl First look for a shared library.
rpm-build 0a0c83
                  if test -n "$acl_shlibext"; then
rpm-build 0a0c83
                    if test -f "$dir/$libname$shrext"; then
rpm-build 0a0c83
                      found_dir="$dir"
rpm-build 0a0c83
                      found_so="$dir/$libname$shrext"
rpm-build 0a0c83
                    else
rpm-build 0a0c83
                      if test "$acl_library_names_spec" = '$libname$shrext$versuffix'; then
rpm-build 0a0c83
                        ver=`(cd "$dir" && \
rpm-build 0a0c83
                              for f in "$libname$shrext".*; do echo "$f"; done \
rpm-build 0a0c83
                              | sed -e "s,^$libname$shrext\\\\.,," \
rpm-build 0a0c83
                              | sort -t '.' -n -r -k1,1 -k2,2 -k3,3 -k4,4 -k5,5 \
rpm-build 0a0c83
                              | sed 1q ) 2>/dev/null`
rpm-build 0a0c83
                        if test -n "$ver" && test -f "$dir/$libname$shrext.$ver"; then
rpm-build 0a0c83
                          found_dir="$dir"
rpm-build 0a0c83
                          found_so="$dir/$libname$shrext.$ver"
rpm-build 0a0c83
                        fi
rpm-build 0a0c83
                      else
rpm-build 0a0c83
                        eval library_names=\"$acl_library_names_spec\"
rpm-build 0a0c83
                        for f in $library_names; do
rpm-build 0a0c83
                          if test -f "$dir/$f"; then
rpm-build 0a0c83
                            found_dir="$dir"
rpm-build 0a0c83
                            found_so="$dir/$f"
rpm-build 0a0c83
                            break
rpm-build 0a0c83
                          fi
rpm-build 0a0c83
                        done
rpm-build 0a0c83
                      fi
rpm-build 0a0c83
                    fi
rpm-build 0a0c83
                  fi
rpm-build 0a0c83
                  dnl Then look for a static library.
rpm-build 0a0c83
                  if test "X$found_dir" = "X"; then
rpm-build 0a0c83
                    if test -f "$dir/$libname.$acl_libext"; then
rpm-build 0a0c83
                      found_dir="$dir"
rpm-build 0a0c83
                      found_a="$dir/$libname.$acl_libext"
rpm-build 0a0c83
                    fi
rpm-build 0a0c83
                  fi
rpm-build 0a0c83
                  if test "X$found_dir" != "X"; then
rpm-build 0a0c83
                    if test -f "$dir/$libname.la"; then
rpm-build 0a0c83
                      found_la="$dir/$libname.la"
rpm-build 0a0c83
                    fi
rpm-build 0a0c83
                  fi
rpm-build 0a0c83
                  ;;
rpm-build 0a0c83
              esac
rpm-build 0a0c83
              if test "X$found_dir" != "X"; then
rpm-build 0a0c83
                break
rpm-build 0a0c83
              fi
rpm-build 0a0c83
            done
rpm-build 0a0c83
          fi
rpm-build 0a0c83
          if test "X$found_dir" != "X"; then
rpm-build 0a0c83
            dnl Found the library.
rpm-build 0a0c83
            LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }-L$found_dir -l$name"
rpm-build 0a0c83
            if test "X$found_so" != "X"; then
rpm-build 0a0c83
              dnl Linking with a shared library. We attempt to hardcode its
rpm-build 0a0c83
              dnl directory into the executable's runpath, unless it's the
rpm-build 0a0c83
              dnl standard /usr/lib.
rpm-build 0a0c83
              if test "$enable_rpath" = no \
rpm-build 0a0c83
                 || test "X$found_dir" = "X/usr/$acl_libdirstem" \
rpm-build 0a0c83
                 || test "X$found_dir" = "X/usr/$acl_libdirstem2"; then
rpm-build 0a0c83
                dnl No hardcoding is needed.
rpm-build 0a0c83
                LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$found_so"
rpm-build 0a0c83
              else
rpm-build 0a0c83
                dnl Use an explicit option to hardcode DIR into the resulting
rpm-build 0a0c83
                dnl binary.
rpm-build 0a0c83
                dnl Potentially add DIR to ltrpathdirs.
rpm-build 0a0c83
                dnl The ltrpathdirs will be appended to $LTLIBNAME at the end.
rpm-build 0a0c83
                haveit=
rpm-build 0a0c83
                for x in $ltrpathdirs; do
rpm-build 0a0c83
                  if test "X$x" = "X$found_dir"; then
rpm-build 0a0c83
                    haveit=yes
rpm-build 0a0c83
                    break
rpm-build 0a0c83
                  fi
rpm-build 0a0c83
                done
rpm-build 0a0c83
                if test -z "$haveit"; then
rpm-build 0a0c83
                  ltrpathdirs="$ltrpathdirs $found_dir"
rpm-build 0a0c83
                fi
rpm-build 0a0c83
                dnl The hardcoding into $LIBNAME is system dependent.
rpm-build 0a0c83
                if test "$acl_hardcode_direct" = yes; then
rpm-build 0a0c83
                  dnl Using DIR/libNAME.so during linking hardcodes DIR into the
rpm-build 0a0c83
                  dnl resulting binary.
rpm-build 0a0c83
                  LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$found_so"
rpm-build 0a0c83
                else
rpm-build 0a0c83
                  if test -n "$acl_hardcode_libdir_flag_spec" && test "$acl_hardcode_minus_L" = no; then
rpm-build 0a0c83
                    dnl Use an explicit option to hardcode DIR into the resulting
rpm-build 0a0c83
                    dnl binary.
rpm-build 0a0c83
                    LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$found_so"
rpm-build 0a0c83
                    dnl Potentially add DIR to rpathdirs.
rpm-build 0a0c83
                    dnl The rpathdirs will be appended to $LIBNAME at the end.
rpm-build 0a0c83
                    haveit=
rpm-build 0a0c83
                    for x in $rpathdirs; do
rpm-build 0a0c83
                      if test "X$x" = "X$found_dir"; then
rpm-build 0a0c83
                        haveit=yes
rpm-build 0a0c83
                        break
rpm-build 0a0c83
                      fi
rpm-build 0a0c83
                    done
rpm-build 0a0c83
                    if test -z "$haveit"; then
rpm-build 0a0c83
                      rpathdirs="$rpathdirs $found_dir"
rpm-build 0a0c83
                    fi
rpm-build 0a0c83
                  else
rpm-build 0a0c83
                    dnl Rely on "-L$found_dir".
rpm-build 0a0c83
                    dnl But don't add it if it's already contained in the LDFLAGS
rpm-build 0a0c83
                    dnl or the already constructed $LIBNAME
rpm-build 0a0c83
                    haveit=
rpm-build 0a0c83
                    for x in $LDFLAGS $LIB[]NAME; do
rpm-build 0a0c83
                      AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"])
rpm-build 0a0c83
                      if test "X$x" = "X-L$found_dir"; then
rpm-build 0a0c83
                        haveit=yes
rpm-build 0a0c83
                        break
rpm-build 0a0c83
                      fi
rpm-build 0a0c83
                    done
rpm-build 0a0c83
                    if test -z "$haveit"; then
rpm-build 0a0c83
                      LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }-L$found_dir"
rpm-build 0a0c83
                    fi
rpm-build 0a0c83
                    if test "$acl_hardcode_minus_L" != no; then
rpm-build 0a0c83
                      dnl FIXME: Not sure whether we should use
rpm-build 0a0c83
                      dnl "-L$found_dir -l$name" or "-L$found_dir $found_so"
rpm-build 0a0c83
                      dnl here.
rpm-build 0a0c83
                      LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$found_so"
rpm-build 0a0c83
                    else
rpm-build 0a0c83
                      dnl We cannot use $acl_hardcode_runpath_var and LD_RUN_PATH
rpm-build 0a0c83
                      dnl here, because this doesn't fit in flags passed to the
rpm-build 0a0c83
                      dnl compiler. So give up. No hardcoding. This affects only
rpm-build 0a0c83
                      dnl very old systems.
rpm-build 0a0c83
                      dnl FIXME: Not sure whether we should use
rpm-build 0a0c83
                      dnl "-L$found_dir -l$name" or "-L$found_dir $found_so"
rpm-build 0a0c83
                      dnl here.
rpm-build 0a0c83
                      LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }-l$name"
rpm-build 0a0c83
                    fi
rpm-build 0a0c83
                  fi
rpm-build 0a0c83
                fi
rpm-build 0a0c83
              fi
rpm-build 0a0c83
            else
rpm-build 0a0c83
              if test "X$found_a" != "X"; then
rpm-build 0a0c83
                dnl Linking with a static library.
rpm-build 0a0c83
                LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$found_a"
rpm-build 0a0c83
              else
rpm-build 0a0c83
                dnl We shouldn't come here, but anyway it's good to have a
rpm-build 0a0c83
                dnl fallback.
rpm-build 0a0c83
                LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }-L$found_dir -l$name"
rpm-build 0a0c83
              fi
rpm-build 0a0c83
            fi
rpm-build 0a0c83
            dnl Assume the include files are nearby.
rpm-build 0a0c83
            additional_includedir=
rpm-build 0a0c83
            case "$found_dir" in
rpm-build 0a0c83
              */$acl_libdirstem | */$acl_libdirstem/)
rpm-build 0a0c83
                basedir=`echo "X$found_dir" | sed -e 's,^X,,' -e "s,/$acl_libdirstem/"'*$,,'`
rpm-build 0a0c83
                if test "$name" = '$1'; then
rpm-build 0a0c83
                  LIB[]NAME[]_PREFIX="$basedir"
rpm-build 0a0c83
                fi
rpm-build 0a0c83
                additional_includedir="$basedir/include"
rpm-build 0a0c83
                ;;
rpm-build 0a0c83
              */$acl_libdirstem2 | */$acl_libdirstem2/)
rpm-build 0a0c83
                basedir=`echo "X$found_dir" | sed -e 's,^X,,' -e "s,/$acl_libdirstem2/"'*$,,'`
rpm-build 0a0c83
                if test "$name" = '$1'; then
rpm-build 0a0c83
                  LIB[]NAME[]_PREFIX="$basedir"
rpm-build 0a0c83
                fi
rpm-build 0a0c83
                additional_includedir="$basedir/include"
rpm-build 0a0c83
                ;;
rpm-build 0a0c83
            esac
rpm-build 0a0c83
            if test "X$additional_includedir" != "X"; then
rpm-build 0a0c83
              dnl Potentially add $additional_includedir to $INCNAME.
rpm-build 0a0c83
              dnl But don't add it
rpm-build 0a0c83
              dnl   1. if it's the standard /usr/include,
rpm-build 0a0c83
              dnl   2. if it's /usr/local/include and we are using GCC on Linux,
rpm-build 0a0c83
              dnl   3. if it's already present in $CPPFLAGS or the already
rpm-build 0a0c83
              dnl      constructed $INCNAME,
rpm-build 0a0c83
              dnl   4. if it doesn't exist as a directory.
rpm-build 0a0c83
              if test "X$additional_includedir" != "X/usr/include"; then
rpm-build 0a0c83
                haveit=
rpm-build 0a0c83
                if test "X$additional_includedir" = "X/usr/local/include"; then
rpm-build 0a0c83
                  if test -n "$GCC"; then
rpm-build 0a0c83
                    case $host_os in
rpm-build 0a0c83
                      linux* | gnu* | k*bsd*-gnu) haveit=yes;;
rpm-build 0a0c83
                    esac
rpm-build 0a0c83
                  fi
rpm-build 0a0c83
                fi
rpm-build 0a0c83
                if test -z "$haveit"; then
rpm-build 0a0c83
                  for x in $CPPFLAGS $INC[]NAME; do
rpm-build 0a0c83
                    AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"])
rpm-build 0a0c83
                    if test "X$x" = "X-I$additional_includedir"; then
rpm-build 0a0c83
                      haveit=yes
rpm-build 0a0c83
                      break
rpm-build 0a0c83
                    fi
rpm-build 0a0c83
                  done
rpm-build 0a0c83
                  if test -z "$haveit"; then
rpm-build 0a0c83
                    if test -d "$additional_includedir"; then
rpm-build 0a0c83
                      dnl Really add $additional_includedir to $INCNAME.
rpm-build 0a0c83
                      INC[]NAME="${INC[]NAME}${INC[]NAME:+ }-I$additional_includedir"
rpm-build 0a0c83
                    fi
rpm-build 0a0c83
                  fi
rpm-build 0a0c83
                fi
rpm-build 0a0c83
              fi
rpm-build 0a0c83
            fi
rpm-build 0a0c83
            dnl Look for dependencies.
rpm-build 0a0c83
            if test -n "$found_la"; then
rpm-build 0a0c83
              dnl Read the .la file. It defines the variables
rpm-build 0a0c83
              dnl dlname, library_names, old_library, dependency_libs, current,
rpm-build 0a0c83
              dnl age, revision, installed, dlopen, dlpreopen, libdir.
rpm-build 0a0c83
              save_libdir="$libdir"
rpm-build 0a0c83
              case "$found_la" in
rpm-build 0a0c83
                */* | *\\*) . "$found_la" ;;
rpm-build 0a0c83
                *) . "./$found_la" ;;
rpm-build 0a0c83
              esac
rpm-build 0a0c83
              libdir="$save_libdir"
rpm-build 0a0c83
              dnl We use only dependency_libs.
rpm-build 0a0c83
              for dep in $dependency_libs; do
rpm-build 0a0c83
                case "$dep" in
rpm-build 0a0c83
                  -L*)
rpm-build 0a0c83
                    additional_libdir=`echo "X$dep" | sed -e 's/^X-L//'`
rpm-build 0a0c83
                    dnl Potentially add $additional_libdir to $LIBNAME and $LTLIBNAME.
rpm-build 0a0c83
                    dnl But don't add it
rpm-build 0a0c83
                    dnl   1. if it's the standard /usr/lib,
rpm-build 0a0c83
                    dnl   2. if it's /usr/local/lib and we are using GCC on Linux,
rpm-build 0a0c83
                    dnl   3. if it's already present in $LDFLAGS or the already
rpm-build 0a0c83
                    dnl      constructed $LIBNAME,
rpm-build 0a0c83
                    dnl   4. if it doesn't exist as a directory.
rpm-build 0a0c83
                    if test "X$additional_libdir" != "X/usr/$acl_libdirstem" \
rpm-build 0a0c83
                       && test "X$additional_libdir" != "X/usr/$acl_libdirstem2"; then
rpm-build 0a0c83
                      haveit=
rpm-build 0a0c83
                      if test "X$additional_libdir" = "X/usr/local/$acl_libdirstem" \
rpm-build 0a0c83
                         || test "X$additional_libdir" = "X/usr/local/$acl_libdirstem2"; then
rpm-build 0a0c83
                        if test -n "$GCC"; then
rpm-build 0a0c83
                          case $host_os in
rpm-build 0a0c83
                            linux* | gnu* | k*bsd*-gnu) haveit=yes;;
rpm-build 0a0c83
                          esac
rpm-build 0a0c83
                        fi
rpm-build 0a0c83
                      fi
rpm-build 0a0c83
                      if test -z "$haveit"; then
rpm-build 0a0c83
                        haveit=
rpm-build 0a0c83
                        for x in $LDFLAGS $LIB[]NAME; do
rpm-build 0a0c83
                          AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"])
rpm-build 0a0c83
                          if test "X$x" = "X-L$additional_libdir"; then
rpm-build 0a0c83
                            haveit=yes
rpm-build 0a0c83
                            break
rpm-build 0a0c83
                          fi
rpm-build 0a0c83
                        done
rpm-build 0a0c83
                        if test -z "$haveit"; then
rpm-build 0a0c83
                          if test -d "$additional_libdir"; then
rpm-build 0a0c83
                            dnl Really add $additional_libdir to $LIBNAME.
rpm-build 0a0c83
                            LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }-L$additional_libdir"
rpm-build 0a0c83
                          fi
rpm-build 0a0c83
                        fi
rpm-build 0a0c83
                        haveit=
rpm-build 0a0c83
                        for x in $LDFLAGS $LTLIB[]NAME; do
rpm-build 0a0c83
                          AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"])
rpm-build 0a0c83
                          if test "X$x" = "X-L$additional_libdir"; then
rpm-build 0a0c83
                            haveit=yes
rpm-build 0a0c83
                            break
rpm-build 0a0c83
                          fi
rpm-build 0a0c83
                        done
rpm-build 0a0c83
                        if test -z "$haveit"; then
rpm-build 0a0c83
                          if test -d "$additional_libdir"; then
rpm-build 0a0c83
                            dnl Really add $additional_libdir to $LTLIBNAME.
rpm-build 0a0c83
                            LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }-L$additional_libdir"
rpm-build 0a0c83
                          fi
rpm-build 0a0c83
                        fi
rpm-build 0a0c83
                      fi
rpm-build 0a0c83
                    fi
rpm-build 0a0c83
                    ;;
rpm-build 0a0c83
                  -R*)
rpm-build 0a0c83
                    dir=`echo "X$dep" | sed -e 's/^X-R//'`
rpm-build 0a0c83
                    if test "$enable_rpath" != no; then
rpm-build 0a0c83
                      dnl Potentially add DIR to rpathdirs.
rpm-build 0a0c83
                      dnl The rpathdirs will be appended to $LIBNAME at the end.
rpm-build 0a0c83
                      haveit=
rpm-build 0a0c83
                      for x in $rpathdirs; do
rpm-build 0a0c83
                        if test "X$x" = "X$dir"; then
rpm-build 0a0c83
                          haveit=yes
rpm-build 0a0c83
                          break
rpm-build 0a0c83
                        fi
rpm-build 0a0c83
                      done
rpm-build 0a0c83
                      if test -z "$haveit"; then
rpm-build 0a0c83
                        rpathdirs="$rpathdirs $dir"
rpm-build 0a0c83
                      fi
rpm-build 0a0c83
                      dnl Potentially add DIR to ltrpathdirs.
rpm-build 0a0c83
                      dnl The ltrpathdirs will be appended to $LTLIBNAME at the end.
rpm-build 0a0c83
                      haveit=
rpm-build 0a0c83
                      for x in $ltrpathdirs; do
rpm-build 0a0c83
                        if test "X$x" = "X$dir"; then
rpm-build 0a0c83
                          haveit=yes
rpm-build 0a0c83
                          break
rpm-build 0a0c83
                        fi
rpm-build 0a0c83
                      done
rpm-build 0a0c83
                      if test -z "$haveit"; then
rpm-build 0a0c83
                        ltrpathdirs="$ltrpathdirs $dir"
rpm-build 0a0c83
                      fi
rpm-build 0a0c83
                    fi
rpm-build 0a0c83
                    ;;
rpm-build 0a0c83
                  -l*)
rpm-build 0a0c83
                    dnl Handle this in the next round.
rpm-build 0a0c83
                    names_next_round="$names_next_round "`echo "X$dep" | sed -e 's/^X-l//'`
rpm-build 0a0c83
                    ;;
rpm-build 0a0c83
                  *.la)
rpm-build 0a0c83
                    dnl Handle this in the next round. Throw away the .la's
rpm-build 0a0c83
                    dnl directory; it is already contained in a preceding -L
rpm-build 0a0c83
                    dnl option.
rpm-build 0a0c83
                    names_next_round="$names_next_round "`echo "X$dep" | sed -e 's,^X.*/,,' -e 's,^lib,,' -e 's,\.la$,,'`
rpm-build 0a0c83
                    ;;
rpm-build 0a0c83
                  *)
rpm-build 0a0c83
                    dnl Most likely an immediate library name.
rpm-build 0a0c83
                    LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$dep"
rpm-build 0a0c83
                    LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }$dep"
rpm-build 0a0c83
                    ;;
rpm-build 0a0c83
                esac
rpm-build 0a0c83
              done
rpm-build 0a0c83
            fi
rpm-build 0a0c83
          else
rpm-build 0a0c83
            dnl Didn't find the library; assume it is in the system directories
rpm-build 0a0c83
            dnl known to the linker and runtime loader. (All the system
rpm-build 0a0c83
            dnl directories known to the linker should also be known to the
rpm-build 0a0c83
            dnl runtime loader, otherwise the system is severely misconfigured.)
rpm-build 0a0c83
            LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }-l$name"
rpm-build 0a0c83
            LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }-l$name"
rpm-build 0a0c83
          fi
rpm-build 0a0c83
        fi
rpm-build 0a0c83
      fi
rpm-build 0a0c83
    done
rpm-build 0a0c83
  done
rpm-build 0a0c83
  if test "X$rpathdirs" != "X"; then
rpm-build 0a0c83
    if test -n "$acl_hardcode_libdir_separator"; then
rpm-build 0a0c83
      dnl Weird platform: only the last -rpath option counts, the user must
rpm-build 0a0c83
      dnl pass all path elements in one option. We can arrange that for a
rpm-build 0a0c83
      dnl single library, but not when more than one $LIBNAMEs are used.
rpm-build 0a0c83
      alldirs=
rpm-build 0a0c83
      for found_dir in $rpathdirs; do
rpm-build 0a0c83
        alldirs="${alldirs}${alldirs:+$acl_hardcode_libdir_separator}$found_dir"
rpm-build 0a0c83
      done
rpm-build 0a0c83
      dnl Note: acl_hardcode_libdir_flag_spec uses $libdir and $wl.
rpm-build 0a0c83
      acl_save_libdir="$libdir"
rpm-build 0a0c83
      libdir="$alldirs"
rpm-build 0a0c83
      eval flag=\"$acl_hardcode_libdir_flag_spec\"
rpm-build 0a0c83
      libdir="$acl_save_libdir"
rpm-build 0a0c83
      LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$flag"
rpm-build 0a0c83
    else
rpm-build 0a0c83
      dnl The -rpath options are cumulative.
rpm-build 0a0c83
      for found_dir in $rpathdirs; do
rpm-build 0a0c83
        acl_save_libdir="$libdir"
rpm-build 0a0c83
        libdir="$found_dir"
rpm-build 0a0c83
        eval flag=\"$acl_hardcode_libdir_flag_spec\"
rpm-build 0a0c83
        libdir="$acl_save_libdir"
rpm-build 0a0c83
        LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$flag"
rpm-build 0a0c83
      done
rpm-build 0a0c83
    fi
rpm-build 0a0c83
  fi
rpm-build 0a0c83
  if test "X$ltrpathdirs" != "X"; then
rpm-build 0a0c83
    dnl When using libtool, the option that works for both libraries and
rpm-build 0a0c83
    dnl executables is -R. The -R options are cumulative.
rpm-build 0a0c83
    for found_dir in $ltrpathdirs; do
rpm-build 0a0c83
      LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }-R$found_dir"
rpm-build 0a0c83
    done
rpm-build 0a0c83
  fi
rpm-build 0a0c83
  popdef([P_A_C_K])
rpm-build 0a0c83
  popdef([PACKLIBS])
rpm-build 0a0c83
  popdef([PACKUP])
rpm-build 0a0c83
  popdef([PACK])
rpm-build 0a0c83
  popdef([NAME])
rpm-build 0a0c83
])
rpm-build 0a0c83
rpm-build 0a0c83
dnl AC_LIB_APPENDTOVAR(VAR, CONTENTS) appends the elements of CONTENTS to VAR,
rpm-build 0a0c83
dnl unless already present in VAR.
rpm-build 0a0c83
dnl Works only for CPPFLAGS, not for LIB* variables because that sometimes
rpm-build 0a0c83
dnl contains two or three consecutive elements that belong together.
rpm-build 0a0c83
AC_DEFUN([AC_LIB_APPENDTOVAR],
rpm-build 0a0c83
[
rpm-build 0a0c83
  for element in [$2]; do
rpm-build 0a0c83
    haveit=
rpm-build 0a0c83
    for x in $[$1]; do
rpm-build 0a0c83
      AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"])
rpm-build 0a0c83
      if test "X$x" = "X$element"; then
rpm-build 0a0c83
        haveit=yes
rpm-build 0a0c83
        break
rpm-build 0a0c83
      fi
rpm-build 0a0c83
    done
rpm-build 0a0c83
    if test -z "$haveit"; then
rpm-build 0a0c83
      [$1]="${[$1]}${[$1]:+ }$element"
rpm-build 0a0c83
    fi
rpm-build 0a0c83
  done
rpm-build 0a0c83
])
rpm-build 0a0c83
rpm-build 0a0c83
dnl For those cases where a variable contains several -L and -l options
rpm-build 0a0c83
dnl referring to unknown libraries and directories, this macro determines the
rpm-build 0a0c83
dnl necessary additional linker options for the runtime path.
rpm-build 0a0c83
dnl AC_LIB_LINKFLAGS_FROM_LIBS([LDADDVAR], [LIBSVALUE], [USE-LIBTOOL])
rpm-build 0a0c83
dnl sets LDADDVAR to linker options needed together with LIBSVALUE.
rpm-build 0a0c83
dnl If USE-LIBTOOL evaluates to non-empty, linking with libtool is assumed,
rpm-build 0a0c83
dnl otherwise linking without libtool is assumed.
rpm-build 0a0c83
AC_DEFUN([AC_LIB_LINKFLAGS_FROM_LIBS],
rpm-build 0a0c83
[
rpm-build 0a0c83
  AC_REQUIRE([AC_LIB_RPATH])
rpm-build 0a0c83
  AC_REQUIRE([AC_LIB_PREPARE_MULTILIB])
rpm-build 0a0c83
  $1=
rpm-build 0a0c83
  if test "$enable_rpath" != no; then
rpm-build 0a0c83
    if test -n "$acl_hardcode_libdir_flag_spec" && test "$acl_hardcode_minus_L" = no; then
rpm-build 0a0c83
      dnl Use an explicit option to hardcode directories into the resulting
rpm-build 0a0c83
      dnl binary.
rpm-build 0a0c83
      rpathdirs=
rpm-build 0a0c83
      next=
rpm-build 0a0c83
      for opt in $2; do
rpm-build 0a0c83
        if test -n "$next"; then
rpm-build 0a0c83
          dir="$next"
rpm-build 0a0c83
          dnl No need to hardcode the standard /usr/lib.
rpm-build 0a0c83
          if test "X$dir" != "X/usr/$acl_libdirstem" \
rpm-build 0a0c83
             && test "X$dir" != "X/usr/$acl_libdirstem2"; then
rpm-build 0a0c83
            rpathdirs="$rpathdirs $dir"
rpm-build 0a0c83
          fi
rpm-build 0a0c83
          next=
rpm-build 0a0c83
        else
rpm-build 0a0c83
          case $opt in
rpm-build 0a0c83
            -L) next=yes ;;
rpm-build 0a0c83
            -L*) dir=`echo "X$opt" | sed -e 's,^X-L,,'`
rpm-build 0a0c83
                 dnl No need to hardcode the standard /usr/lib.
rpm-build 0a0c83
                 if test "X$dir" != "X/usr/$acl_libdirstem" \
rpm-build 0a0c83
                    && test "X$dir" != "X/usr/$acl_libdirstem2"; then
rpm-build 0a0c83
                   rpathdirs="$rpathdirs $dir"
rpm-build 0a0c83
                 fi
rpm-build 0a0c83
                 next= ;;
rpm-build 0a0c83
            *) next= ;;
rpm-build 0a0c83
          esac
rpm-build 0a0c83
        fi
rpm-build 0a0c83
      done
rpm-build 0a0c83
      if test "X$rpathdirs" != "X"; then
rpm-build 0a0c83
        if test -n ""$3""; then
rpm-build 0a0c83
          dnl libtool is used for linking. Use -R options.
rpm-build 0a0c83
          for dir in $rpathdirs; do
rpm-build 0a0c83
            $1="${$1}${$1:+ }-R$dir"
rpm-build 0a0c83
          done
rpm-build 0a0c83
        else
rpm-build 0a0c83
          dnl The linker is used for linking directly.
rpm-build 0a0c83
          if test -n "$acl_hardcode_libdir_separator"; then
rpm-build 0a0c83
            dnl Weird platform: only the last -rpath option counts, the user
rpm-build 0a0c83
            dnl must pass all path elements in one option.
rpm-build 0a0c83
            alldirs=
rpm-build 0a0c83
            for dir in $rpathdirs; do
rpm-build 0a0c83
              alldirs="${alldirs}${alldirs:+$acl_hardcode_libdir_separator}$dir"
rpm-build 0a0c83
            done
rpm-build 0a0c83
            acl_save_libdir="$libdir"
rpm-build 0a0c83
            libdir="$alldirs"
rpm-build 0a0c83
            eval flag=\"$acl_hardcode_libdir_flag_spec\"
rpm-build 0a0c83
            libdir="$acl_save_libdir"
rpm-build 0a0c83
            $1="$flag"
rpm-build 0a0c83
          else
rpm-build 0a0c83
            dnl The -rpath options are cumulative.
rpm-build 0a0c83
            for dir in $rpathdirs; do
rpm-build 0a0c83
              acl_save_libdir="$libdir"
rpm-build 0a0c83
              libdir="$dir"
rpm-build 0a0c83
              eval flag=\"$acl_hardcode_libdir_flag_spec\"
rpm-build 0a0c83
              libdir="$acl_save_libdir"
rpm-build 0a0c83
              $1="${$1}${$1:+ }$flag"
rpm-build 0a0c83
            done
rpm-build 0a0c83
          fi
rpm-build 0a0c83
        fi
rpm-build 0a0c83
      fi
rpm-build 0a0c83
    fi
rpm-build 0a0c83
  fi
rpm-build 0a0c83
  AC_SUBST([$1])
rpm-build 0a0c83
])