config.rpath 13.8 KB
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513
#! /bin/sh
# Output a system dependent set of variables, describing how to set the
# run time search path of shared libraries in an executable.
#
#   Copyright 1996-2002 Free Software Foundation, Inc.
#   Taken from GNU libtool, 2001
#   Originally by Gordon Matzigkeit <gord@gnu.ai.mit.edu>, 1996
#
#   This program is free software; you can redistribute it and/or modify
#   it under the terms of the GNU General Public License as published by
#   the Free Software Foundation; either version 2 of the License, or
#   (at your option) any later version.
#
#   This program is distributed in the hope that it will be useful, but
#   WITHOUT ANY WARRANTY; without even the implied warranty of
#   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
#   General Public License for more details.
#
#   You should have received a copy of the GNU General Public License
#   along with this program; if not, write to the Free Software
#   Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#
#   As a special exception to the GNU General Public License, if you
#   distribute this file as part of a program that contains a
#   configuration script generated by Autoconf, you may include it under
#   the same distribution terms that you use for the rest of that program.
#
# The first argument passed to this file is the canonical host specification,
#    CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM
# or
#    CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM
# The environment variables CC, GCC, LDFLAGS, LD, with_gnu_ld
# should be set by the caller.
#
# The set of defined variables is at the end of this script.

# All known linkers require a `.a' archive for static linking (except M$VC,
# which needs '.lib').
libext=a
shlibext=

host="$1"
host_cpu=`echo "$host" | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'`
host_vendor=`echo "$host" | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'`
host_os=`echo "$host" | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'`

wl=
if test "$GCC" = yes; then
  wl='-Wl,'
else
  case "$host_os" in
    aix3* | aix4* | aix5*)
      wl='-Wl,'
      ;;
    hpux9* | hpux10* | hpux11*)
      wl='-Wl,'
      ;;
    irix5* | irix6*)
      wl='-Wl,'
      ;;
    linux*)
      echo '__INTEL_COMPILER' > conftest.$ac_ext
      if $CC -E conftest.$ac_ext >/dev/null | grep __INTEL_COMPILER >/dev/null
      then
        :
      else
        # Intel icc
        wl='-Qoption,ld,'
      fi
      ;;
    osf3* | osf4* | osf5*)
      wl='-Wl,'
      ;;
    solaris*)
      wl='-Wl,'
      ;;
    sunos4*)
      wl='-Qoption ld '
      ;;
    sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*)
      if test "x$host_vendor" = xsni; then
        wl='-LD'
      else
        wl='-Wl,'
      fi
      ;;
  esac
fi

hardcode_libdir_flag_spec=
hardcode_libdir_separator=
hardcode_direct=no
hardcode_minus_L=no

case "$host_os" in
  cygwin* | mingw* | pw32*)
    # FIXME: the MSVC++ port hasn't been tested in a loooong time
    # When not using gcc, we currently assume that we are using
    # Microsoft Visual C++.
    if test "$GCC" != yes; then
      with_gnu_ld=no
    fi
    ;;
  openbsd*)
    with_gnu_ld=no
    ;;
esac

ld_shlibs=yes
if test "$with_gnu_ld" = yes; then
  case "$host_os" in
    aix3* | aix4* | aix5*)
      # On AIX, the GNU linker is very broken
      ld_shlibs=no
      ;;
    amigaos*)
      hardcode_libdir_flag_spec='-L$libdir'
      hardcode_minus_L=yes
      # Samuel A. Falvo II <kc5tja@dolphin.openprojects.net> reports
      # that the semantics of dynamic libraries on AmigaOS, at least up
      # to version 4, is to share data among multiple programs linked
      # with the same dynamic library.  Since this doesn't match the
      # behavior of shared libraries on other platforms, we can use
      # them.
      ld_shlibs=no
      ;;
    beos*)
      if $LD --help 2>&1 | egrep ': supported targets:.* elf' > /dev/null; then
        :
      else
        ld_shlibs=no
      fi
      ;;
    cygwin* | mingw* | pw32*)
      # hardcode_libdir_flag_spec is actually meaningless, as there is
      # no search path for DLLs.
      hardcode_libdir_flag_spec='-L$libdir'
      ;;
    solaris* | sysv5*)
      if $LD -v 2>&1 | egrep 'BFD 2\.8' > /dev/null; then
        ld_shlibs=no
      elif $LD --help 2>&1 | egrep ': supported targets:.* elf' > /dev/null; then
        :
      else
        ld_shlibs=no
      fi
      ;;
    sunos4*)
      hardcode_direct=yes
      ;;
    *)
      if $LD --help 2>&1 | egrep ': supported targets:.* elf' > /dev/null; then
        :
      else
        ld_shlibs=no
      fi
      ;;
  esac
  if test "$ld_shlibs" = yes; then
    hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
  fi
else
  case "$host_os" in
    aix3*)
      # Note: this linker hardcodes the directories in LIBPATH if there
      # are no directories specified by -L.
      hardcode_minus_L=yes
      if test "$GCC" = yes; then
        # Neither direct hardcoding nor static linking is supported with a
        # broken collect2.
        hardcode_direct=unsupported
      fi
      ;;
    aix4* | aix5*)
      if test "$host_cpu" = ia64; then
        # On IA64, the linker does run time linking by default, so we don't
        # have to do anything special.
        aix_use_runtimelinking=no
      else
        aix_use_runtimelinking=no
        # Test if we are trying to use run time linking or normal
        # AIX style linking. If -brtl is somewhere in LDFLAGS, we
        # need to do runtime linking.
        case $host_os in aix4.[23]|aix4.[23].*|aix5*)
          for ld_flag in $LDFLAGS; do
            if (test $ld_flag = "-brtl" || test $ld_flag = "-Wl,-brtl"); then
              aix_use_runtimelinking=yes
              break
            fi
          done
        esac
      fi
      hardcode_direct=yes
      hardcode_libdir_separator=':'
      if test "$GCC" = yes; then
        case $host_os in aix4.[012]|aix4.[012].*)
          collect2name=`${CC} -print-prog-name=collect2`
          if test -f "$collect2name" && \
            strings "$collect2name" | grep resolve_lib_name >/dev/null
          then
            # We have reworked collect2
            hardcode_direct=yes
          else
            # We have old collect2
            hardcode_direct=unsupported
            hardcode_minus_L=yes
            hardcode_libdir_flag_spec='-L$libdir'
            hardcode_libdir_separator=
          fi
        esac
      fi
      if test "$aix_use_runtimelinking" = yes; then
        hardcode_libdir_flag_spec='${wl}-blibpath:$libdir:/usr/lib:/lib'
      else
        if test "$host_cpu" = ia64; then
          hardcode_libdir_flag_spec='${wl}-R $libdir:/usr/lib:/lib'
        else
          hardcode_libdir_flag_spec='${wl}-bnolibpath ${wl}-blibpath:$libdir:/usr/lib:/lib'
        fi
      fi
      ;;
    amigaos*)
      hardcode_libdir_flag_spec='-L$libdir'
      hardcode_minus_L=yes
      # see comment about different semantics on the GNU ld section
      ld_shlibs=no
      ;;
    cygwin* | mingw* | pw32*)
      # When not using gcc, we currently assume that we are using
      # Microsoft Visual C++.
      # hardcode_libdir_flag_spec is actually meaningless, as there is
      # no search path for DLLs.
      hardcode_libdir_flag_spec=' '
      libext=lib
      ;;
    darwin* | rhapsody*)
      hardcode_direct=yes
      ;;
    freebsd1*)
      ld_shlibs=no
      ;;
    freebsd2.2*)
      hardcode_libdir_flag_spec='-R$libdir'
      hardcode_direct=yes
      ;;
    freebsd2*)
      hardcode_direct=yes
      hardcode_minus_L=yes
      ;;
    freebsd*)
      hardcode_libdir_flag_spec='-R$libdir'
      hardcode_direct=yes
      ;;
    hpux9* | hpux10* | hpux11*)
      hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir'
      hardcode_libdir_separator=:
      hardcode_direct=yes
      hardcode_minus_L=yes # Not in the search PATH, but as the default
                           # location of the library.
      ;;
    irix5* | irix6*)
      hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
      hardcode_libdir_separator=:
      ;;
    netbsd*)
      hardcode_libdir_flag_spec='-R$libdir'
      hardcode_direct=yes
      ;;
    newsos6)
      hardcode_direct=yes
      hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
      hardcode_libdir_separator=:
      ;;
    openbsd*)
      hardcode_direct=yes
      if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
        hardcode_libdir_flag_spec='${wl}-rpath,$libdir'
      else
        case "$host_os" in
          openbsd[01].* | openbsd2.[0-7] | openbsd2.[0-7].*)
            hardcode_libdir_flag_spec='-R$libdir'
            ;;
          *)
            hardcode_libdir_flag_spec='${wl}-rpath,$libdir'
            ;;
        esac
      fi
      ;;
    os2*)
      hardcode_libdir_flag_spec='-L$libdir'
      hardcode_minus_L=yes
      ;;
    osf3*)
      hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
      hardcode_libdir_separator=:
      ;;
    osf4* | osf5*)
      if test "$GCC" = yes; then
        hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
      else
        # Both cc and cxx compiler support -rpath directly
        hardcode_libdir_flag_spec='-rpath $libdir'
      fi
      hardcode_libdir_separator=:
      ;;
    sco3.2v5*)
      ;;
    solaris*)
      hardcode_libdir_flag_spec='-R$libdir'
      ;;
    sunos4*)
      hardcode_libdir_flag_spec='-L$libdir'
      hardcode_direct=yes
      hardcode_minus_L=yes
      ;;
    sysv4)
      if test "x$host_vendor" = xsno; then
        hardcode_direct=yes # is this really true???
      else
        hardcode_direct=no # Motorola manual says yes, but my tests say they lie
      fi
      ;;
    sysv4.3*)
      ;;
    sysv5*)
      hardcode_libdir_flag_spec=
      ;;
    uts4*)
      hardcode_libdir_flag_spec='-L$libdir'
      ;;
    dgux*)
      hardcode_libdir_flag_spec='-L$libdir'
      ;;
    sysv4*MP*)
      if test -d /usr/nec; then
        ld_shlibs=yes
      fi
      ;;
    sysv4.2uw2*)
      hardcode_direct=yes
      hardcode_minus_L=no
      ;;
    sysv5uw7* | unixware7*)
      ;;
    *)
      ld_shlibs=no
      ;;
  esac
fi

# Check dynamic linker characteristics
libname_spec='lib$name'
sys_lib_dlsearch_path_spec="/lib /usr/lib"
sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib"
case "$host_os" in
  aix3*)
    shlibext=so
    ;;
  aix4* | aix5*)
    shlibext=so
    ;;
  amigaos*)
    shlibext=ixlibrary
    ;;
  beos*)
    shlibext=so
    ;;
  bsdi4*)
    shlibext=so
    sys_lib_search_path_spec="/shlib /usr/lib /usr/X11/lib /usr/contrib/lib /lib /usr/local/lib"
    sys_lib_dlsearch_path_spec="/shlib /usr/lib /usr/local/lib"
    ;;
  cygwin* | mingw* | pw32*)
    case $GCC,$host_os in
      yes,cygwin*)
        shlibext=dll.a
        ;;
      yes,mingw*)
        shlibext=dll
        sys_lib_search_path_spec=`$CC -print-search-dirs | grep "^libraries:" | sed -e "s/^libraries://" -e "s/;/ /g"`
        ;;
      yes,pw32*)
        shlibext=dll
        ;;
      *)
        shlibext=dll
        ;;
    esac
    ;;
  darwin* | rhapsody*)
    shlibext=dylib
    ;;
  freebsd1*)
    ;;
  freebsd*)
    shlibext=so
    ;;
  gnu*)
    shlibext=so
    ;;
  hpux9* | hpux10* | hpux11*)
    shlibext=sl
    ;;
  irix5* | irix6*)
    shlibext=so
    case "$host_os" in
      irix5*)
        libsuff= shlibsuff=
        ;;
      *)
        case $LD in
          *-32|*"-32 ") libsuff= shlibsuff= ;;
          *-n32|*"-n32 ") libsuff=32 shlibsuff=N32 ;;
          *-64|*"-64 ") libsuff=64 shlibsuff=64 ;;
          *) libsuff= shlibsuff= ;;
        esac
        ;;
    esac
    sys_lib_search_path_spec="/usr/lib${libsuff} /lib${libsuff} /usr/local/lib${libsuff}"
    sys_lib_dlsearch_path_spec="/usr/lib${libsuff} /lib${libsuff}"
    ;;
  linux-gnuoldld* | linux-gnuaout* | linux-gnucoff*)
    ;;
  linux-gnu*)
    shlibext=so
    ;;
  netbsd*)
    shlibext=so
    ;;
  newsos6)
    shlibext=so
    ;;
  openbsd*)
    shlibext=so
    ;;
  os2*)
    libname_spec='$name'
    shlibext=dll
    ;;
  osf3* | osf4* | osf5*)
    shlibext=so
    sys_lib_search_path_spec="/usr/shlib /usr/ccs/lib /usr/lib/cmplrs/cc /usr/lib /usr/local/lib /var/shlib"
    sys_lib_dlsearch_path_spec="$sys_lib_search_path_spec"
    ;;
  sco3.2v5*)
    shlibext=so
    ;;
  solaris*)
    shlibext=so
    ;;
  sunos4*)
    shlibext=so
    ;;
  sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*)
    shlibext=so
    case "$host_vendor" in
      motorola)
        sys_lib_search_path_spec='/lib /usr/lib /usr/ccs/lib'
        ;;
    esac
    ;;
  uts4*)
    shlibext=so
    ;;
  dgux*)
    shlibext=so
    ;;
  sysv4*MP*)
    if test -d /usr/nec; then
      shlibext=so
    fi
    ;;
esac

sed_quote_subst='s/\(["`$\\]\)/\\\1/g'
escaped_wl=`echo "X$wl" | sed -e 's/^X//' -e "$sed_quote_subst"`
escaped_hardcode_libdir_flag_spec=`echo "X$hardcode_libdir_flag_spec" | sed -e 's/^X//' -e "$sed_quote_subst"`
escaped_sys_lib_search_path_spec=`echo "X$sys_lib_search_path_spec" | sed -e 's/^X//' -e "$sed_quote_subst"`
escaped_sys_lib_dlsearch_path_spec=`echo "X$sys_lib_dlsearch_path_spec" | sed -e 's/^X//' -e "$sed_quote_subst"`

sed -e 's/^\([a-zA-Z0-9_]*\)=/acl_cv_\1=/' <<EOF

# How to pass a linker flag through the compiler.
wl="$escaped_wl"

# Static library suffix (normally "a").
libext="$libext"

# Shared library suffix (normally "so").
shlibext="$shlibext"

# Flag to hardcode \$libdir into a binary during linking.
# This must work even if \$libdir does not exist.
hardcode_libdir_flag_spec="$escaped_hardcode_libdir_flag_spec"

# Whether we need a single -rpath flag with a separated argument.
hardcode_libdir_separator="$hardcode_libdir_separator"

# Set to yes if using DIR/libNAME.so during linking hardcodes DIR into the
# resulting binary.
hardcode_direct="$hardcode_direct"

# Set to yes if using the -LDIR flag during linking hardcodes DIR into the
# resulting binary.
hardcode_minus_L="$hardcode_minus_L"

# Compile-time system search path for libraries
sys_lib_search_path_spec="$escaped_sys_lib_search_path_spec"

# Run-time system search path for libraries
sys_lib_dlsearch_path_spec="$escaped_sys_lib_dlsearch_path_spec"

EOF