Ticket #20193: jpeg-7.diff

File jpeg-7.diff, 260.2 KB (added by nox@…, 15 years ago)
  • files/patch-jpeglib.h

     
    1 --- jpeglib.h.org       Sat Feb 21 14:48:14 1998
    2 +++ jpeglib.h   Tue Feb 25 16:49:36 2003
    3 @@ -13,6 +13,10 @@
    4  #ifndef JPEGLIB_H
    5  #define JPEGLIB_H
    6  
    7 +#ifdef __cplusplus
    8 +extern "C" {
    9 +#endif
    10 +
    11  /*
    12   * First we include the configuration files that record how this
    13   * installation of the JPEG library is set up.  jconfig.h can be
    14 @@ -1091,6 +1095,10 @@
    15  #ifdef JPEG_INTERNALS
    16  #include "jpegint.h"           /* fetch private declarations */
    17  #include "jerror.h"            /* fetch error codes too */
    18 +#endif
    19 +
    20 +#ifdef __cplusplus
    21 +}
    22  #endif
    23  
    24  #endif /* JPEGLIB_H */
  • files/patch-ltconfig

     
    1 --- ltconfig.orig       Wed Mar 25 10:25:39 1998
    2 +++ ltconfig    Sun Mar 16 16:58:11 2003
    3 @@ -1,8 +1,8 @@
    4  #! /bin/sh
    5  
    6  # ltconfig - Create a system-specific libtool.
    7 -# Copyright (C) 1996-1998 Free Software Foundation, Inc.
    8 -# Gordon Matzigkeit <gord@gnu.ai.mit.edu>, 1996
    9 +# Copyright (C) 1996-1999 Free Software Foundation, Inc.
    10 +# Originally by Gordon Matzigkeit <gord@gnu.ai.mit.edu>, 1996
    11  #
    12  # This file is free software; you can redistribute it and/or modify it
    13  # under the terms of the GNU General Public License as published by
    14 @@ -25,30 +25,129 @@
    15  
    16  # A lot of this script is taken from autoconf-2.10.
    17  
    18 +# Check that we are running under the correct shell.
    19 +SHELL=${CONFIG_SHELL-/bin/sh}
    20 +echo=echo
    21 +if test "X$1" = X--no-reexec; then
    22 +  # Discard the --no-reexec flag, and continue.
    23 +  shift
    24 +elif test "X$1" = X--fallback-echo; then
    25 +  # Avoid inline document here, it may be left over
    26 +  :
    27 +elif test "X`($echo '\t') 2>/dev/null`" = 'X\t'; then
    28 +  # Yippee, $echo works!
    29 +  :
    30 +else
    31 +  # Restart under the correct shell.
    32 +  exec "$SHELL" "$0" --no-reexec ${1+"$@"}
    33 +fi
    34 +
    35 +if test "X$1" = X--fallback-echo; then
    36 +  # used as fallback echo
    37 +  shift
    38 +  cat <<EOF
    39 +$*
    40 +EOF
    41 +  exit 0
    42 +fi
    43 +
    44 +# Find the correct PATH separator.  Usually this is `:', but
    45 +# DJGPP uses `;' like DOS.
    46 +if test "X${PATH_SEPARATOR+set}" != Xset; then
    47 +  UNAME=${UNAME-`uname 2>/dev/null`}
    48 +  case X$UNAME in
    49 +    *-DOS) PATH_SEPARATOR=';' ;;
    50 +    *)     PATH_SEPARATOR=':' ;;
    51 +  esac
    52 +fi
    53 +
    54  # The HP-UX ksh and POSIX shell print the target directory to stdout
    55  # if CDPATH is set.
    56 -if test "${CDPATH+set}" = set; then CDPATH=; export CDPATH; fi
    57 +if test "X${CDPATH+set}" = Xset; then CDPATH=:; export CDPATH; fi
    58  
    59 -echo=echo
    60 -if test "X`($echo '\t') 2>/dev/null`" = 'X\t'; then :
    61 -else
    62 -  # The Solaris and AIX default echo program unquotes backslashes.
    63 -  # This makes it impossible to quote backslashes using
    64 +if test "X${echo_test_string+set}" != Xset; then
    65 +  # find a string as large as possible, as long as the shell can cope with it
    66 +  for cmd in 'sed 50q "$0"' 'sed 20q "$0"' 'sed 10q "$0"' 'sed 2q "$0"' 'echo test'; do
    67 +    # expected sizes: less than 2Kb, 1Kb, 512 bytes, 16 bytes, ...
    68 +    if (echo_test_string="`eval $cmd`") 2>/dev/null &&
    69 +       echo_test_string="`eval $cmd`" &&
    70 +       (test "X$echo_test_string" = "X$echo_test_string") 2>/dev/null; then
    71 +      break
    72 +    fi
    73 +  done
    74 +fi
    75 +
    76 +if test "X`($echo '\t') 2>/dev/null`" != 'X\t' ||
    77 +   test "X`($echo "$echo_test_string") 2>/dev/null`" != X"$echo_test_string"; then
    78 +  # The Solaris, AIX, and Digital Unix default echo programs unquote
    79 +  # backslashes.  This makes it impossible to quote backslashes using
    80    #   echo "$something" | sed 's/\\/\\\\/g'
    81 -  # So, we emulate echo with printf '%s\n'
    82 -  echo="printf %s\\n"
    83 -  if test "X`($echo '\t') 2>/dev/null`" = 'X\t'; then :
    84 -  else
    85 -    # Oops.  We have no working printf.  Try to find a not-so-buggy echo.
    86 -    echo=echo
    87 -    IFS="${IFS=        }"; save_ifs="$IFS"; IFS="${IFS}:"
    88 -    for dir in $PATH /usr/ucb; do
    89 -      if test -f $dir/echo && test "X`$dir/echo '\t'`" = 'X\t'; then
    90 -        echo="$dir/echo"
    91 -        break
    92 +  #
    93 +  # So, first we look for a working echo in the user's PATH.
    94 +
    95 +  IFS="${IFS=  }"; save_ifs="$IFS"; IFS="${IFS}${PATH_SEPARATOR}"
    96 +  for dir in $PATH /usr/ucb; do
    97 +    if (test -f $dir/echo || test -f $dir/echo$ac_exeext) &&
    98 +       test "X`($dir/echo '\t') 2>/dev/null`" = 'X\t' &&
    99 +       test "X`($dir/echo "$echo_test_string") 2>/dev/null`" = X"$echo_test_string"; then
    100 +      echo="$dir/echo"
    101 +      break
    102 +    fi
    103 +  done
    104 +  IFS="$save_ifs"
    105 +
    106 +  if test "X$echo" = Xecho; then
    107 +    # We didn't find a better echo, so look for alternatives.
    108 +    if test "X`(print -r '\t') 2>/dev/null`" = 'X\t' &&
    109 +       test "X`(print -r "$echo_test_string") 2>/dev/null`" = X"$echo_test_string"; then
    110 +      # This shell has a builtin print -r that does the trick.
    111 +      echo='print -r'
    112 +    elif (test -f /bin/ksh || test -f /bin/ksh$ac_exeext) &&
    113 +        test "X$CONFIG_SHELL" != X/bin/ksh; then
    114 +      # If we have ksh, try running ltconfig again with it.
    115 +      ORIGINAL_CONFIG_SHELL="${CONFIG_SHELL-/bin/sh}"
    116 +      export ORIGINAL_CONFIG_SHELL
    117 +      CONFIG_SHELL=/bin/ksh
    118 +      export CONFIG_SHELL
    119 +      exec "$CONFIG_SHELL" "$0" --no-reexec ${1+"$@"}
    120 +    else
    121 +      # Try using printf.
    122 +      echo='printf "%s\n"'
    123 +      if test "X`($echo '\t') 2>/dev/null`" = 'X\t' &&
    124 +        test "X`($echo "$echo_test_string") 2>/dev/null`" = X"$echo_test_string"; then
    125 +       # Cool, printf works
    126 +       :
    127 +      elif test "X`("$ORIGINAL_CONFIG_SHELL" "$0" --fallback-echo '\t') 2>/dev/null`" = 'X\t' &&
    128 +          test "X`("$ORIGINAL_CONFIG_SHELL" "$0" --fallback-echo "$echo_test_string") 2>/dev/null`" = X"$echo_test_string"; then
    129 +       CONFIG_SHELL="$ORIGINAL_CONFIG_SHELL"
    130 +       export CONFIG_SHELL
    131 +       SHELL="$CONFIG_SHELL"
    132 +       export SHELL
    133 +       echo="$CONFIG_SHELL $0 --fallback-echo"
    134 +      elif test "X`("$CONFIG_SHELL" "$0" --fallback-echo '\t') 2>/dev/null`" = 'X\t' &&
    135 +          test "X`("$CONFIG_SHELL" "$0" --fallback-echo "$echo_test_string") 2>/dev/null`" = X"$echo_test_string"; then
    136 +       echo="$CONFIG_SHELL $0 --fallback-echo"
    137 +      else
    138 +       # maybe with a smaller string...
    139 +       prev=:
    140 +
    141 +       for cmd in 'echo test' 'sed 2q "$0"' 'sed 10q "$0"' 'sed 20q "$0"' 'sed 50q "$0"'; do
    142 +         if (test "X$echo_test_string" = "X`eval $cmd`") 2>/dev/null; then
    143 +           break
    144 +         fi
    145 +         prev="$cmd"
    146 +       done
    147 +
    148 +       if test "$prev" != 'sed 50q "$0"'; then
    149 +         echo_test_string=`eval $prev`
    150 +         export echo_test_string
    151 +         exec "${ORIGINAL_CONFIG_SHELL}" "$0" ${1+"$@"}
    152 +       else
    153 +         # Oops.  We lost completely, so just stick with echo.
    154 +         echo=echo
    155 +       fi
    156        fi
    157 -    done
    158 -    IFS="$save_ifs"
    159 +    fi
    160    fi
    161  fi
    162  
    163 @@ -60,24 +159,34 @@
    164  # Same as above, but do not quote variable references.
    165  double_quote_subst='s/\([\\"\\`\\\\]\)/\\\1/g'
    166  
    167 +# Sed substitution to delay expansion of an escaped shell variable in a
    168 +# double_quote_subst'ed string.
    169 +delay_variable_subst='s/\\\\\\\\\\\$/\\\\\\$/g'
    170 +
    171  # The name of this program.
    172  progname=`$echo "X$0" | $Xsed -e 's%^.*/%%'`
    173  
    174  # Constants:
    175  PROGRAM=ltconfig
    176  PACKAGE=libtool
    177 -VERSION=1.2
    178 -ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.c 1>&5'
    179 -ac_link='${CC-cc} -o conftest $CFLAGS $CPPFLAGS $LDFLAGS conftest.c $LIBS 1>&5'
    180 +VERSION=1.3.5
    181 +TIMESTAMP=" (1.385.2.206 2000/05/27 11:12:27)"
    182 +ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
    183 +ac_link='${CC-cc} -o conftest $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
    184  rm="rm -f"
    185  
    186  help="Try \`$progname --help' for more information."
    187  
    188  # Global variables:
    189 +default_ofile=libtool
    190  can_build_shared=yes
    191  enable_shared=yes
    192 -# All known linkers require a `.a' archive for static linking.
    193 +# All known linkers require a `.a' archive for static linking (except M$VC,
    194 +# which needs '.lib').
    195  enable_static=yes
    196 +enable_fast_install=yes
    197 +enable_dlopen=unknown
    198 +enable_win32_dll=no
    199  ltmain=
    200  silent=
    201  srcdir=
    202 @@ -85,18 +194,30 @@
    203  ac_config_sub=
    204  host=
    205  nonopt=
    206 +ofile="$default_ofile"
    207  verify_host=yes
    208  with_gcc=no
    209  with_gnu_ld=no
    210 +need_locks=yes
    211 +ac_ext=c
    212 +objext=o
    213 +libext=a
    214 +exeext=
    215 +cache_file=
    216  
    217  old_AR="$AR"
    218  old_CC="$CC"
    219  old_CFLAGS="$CFLAGS"
    220  old_CPPFLAGS="$CPPFLAGS"
    221 +old_LDFLAGS="$LDFLAGS"
    222  old_LD="$LD"
    223  old_LN_S="$LN_S"
    224 +old_LIBS="$LIBS"
    225  old_NM="$NM"
    226  old_RANLIB="$RANLIB"
    227 +old_DLLTOOL="$DLLTOOL"
    228 +old_OBJDUMP="$OBJDUMP"
    229 +old_AS="$AS"
    230  
    231  # Parse the command line options.
    232  args=
    233 @@ -117,33 +238,51 @@
    234  
    235    case "$option" in
    236    --help) cat <<EOM
    237 -Usage: $progname [OPTION]... LTMAIN [HOST]
    238 +Usage: $progname [OPTION]... [HOST [LTMAIN]]
    239  
    240  Generate a system-specific libtool script.
    241  
    242 +    --debug                enable verbose shell tracing
    243      --disable-shared       do not build shared libraries
    244      --disable-static       do not build static libraries
    245 +    --disable-fast-install do not optimize for fast installation
    246 +    --enable-dlopen        enable dlopen support
    247 +    --enable-win32-dll     enable building dlls on win32 hosts
    248      --help                 display this help and exit
    249      --no-verify            do not verify that HOST is a valid host type
    250 +-o, --output=FILE          specify the output file [default=$default_ofile]
    251      --quiet                same as \`--silent'
    252      --silent               do not print informational messages
    253      --srcdir=DIR           find \`config.guess' in DIR
    254      --version              output version information and exit
    255      --with-gcc             assume that the GNU C compiler will be used
    256      --with-gnu-ld          assume that the C compiler uses the GNU linker
    257 +    --disable-lock         disable file locking
    258 +    --cache-file=FILE      configure cache file
    259  
    260 -LTMAIN is the \`ltmain.sh' shell script fragment that provides basic libtool
    261 -functionality.
    262 +LTMAIN is the \`ltmain.sh' shell script fragment or \`ltmain.c' program
    263 +that provides basic libtool functionality.
    264  
    265  HOST is the canonical host system name [default=guessed].
    266  EOM
    267    exit 0
    268    ;;
    269  
    270 +  --debug)
    271 +    echo "$progname: enabling shell trace mode"
    272 +    set -x
    273 +    ;;
    274 +
    275    --disable-shared) enable_shared=no ;;
    276  
    277    --disable-static) enable_static=no ;;
    278  
    279 +  --disable-fast-install) enable_fast_install=no ;;
    280 +
    281 +  --enable-dlopen) enable_dlopen=yes ;;
    282 +
    283 +  --enable-win32-dll) enable_win32_dll=yes ;;
    284 +
    285    --quiet | --silent) silent=yes ;;
    286  
    287    --srcdir) prev=srcdir ;;
    288 @@ -151,11 +290,18 @@
    289  
    290    --no-verify) verify_host=no ;;
    291  
    292 -  --version) echo "$PROGRAM (GNU $PACKAGE) $VERSION"; exit 0 ;;
    293 +  --output | -o) prev=ofile ;;
    294 +  --output=*) ofile="$optarg" ;;
    295 +
    296 +  --version) echo "$PROGRAM (GNU $PACKAGE) $VERSION$TIMESTAMP"; exit 0 ;;
    297  
    298    --with-gcc) with_gcc=yes ;;
    299    --with-gnu-ld) with_gnu_ld=yes ;;
    300  
    301 +  --disable-lock) need_locks=no ;;
    302 +
    303 +  --cache-file=*) cache_file="$optarg" ;;
    304 +
    305    -*)
    306      echo "$progname: unrecognized option \`$option'" 1>&2
    307      echo "$help" 1>&2
    308 @@ -185,8 +331,7 @@
    309    exit 1
    310  fi
    311  
    312 -if test -f "$ltmain"; then :
    313 -else
    314 +if test ! -f "$ltmain"; then
    315    echo "$progname: \`$ltmain' does not exist" 1>&2
    316    echo "$help" 1>&2
    317    exit 1
    318 @@ -224,8 +369,13 @@
    319  # Only set LANG and LC_ALL to C if already set.
    320  # These must not be set unconditionally because not all systems understand
    321  # e.g. LANG=C (notably SCO).
    322 -if test "${LC_ALL+set}" = set; then LC_ALL=C; export LC_ALL; fi
    323 -if test "${LANG+set}"   = set; then LANG=C;   export LANG;   fi
    324 +if test "X${LC_ALL+set}" = Xset; then LC_ALL=C; export LC_ALL; fi
    325 +if test "X${LANG+set}"   = Xset; then LANG=C;   export LANG;   fi
    326 +
    327 +if test -n "$cache_file" && test -r "$cache_file"; then
    328 +  echo "loading cache $cache_file within ltconfig"
    329 +  . $cache_file
    330 +fi
    331  
    332  if (echo "testing\c"; echo 1,2,3) | grep c >/dev/null; then
    333    # Stardent Vistra SVR4 grep lacks -e, says ghazi@caip.rutgers.edu.
    334 @@ -240,8 +390,8 @@
    335  fi
    336  
    337  if test -z "$srcdir"; then
    338 -  # Assume the source directory is the same one as the path to ltmain.sh.
    339 -  srcdir=`$echo "$ltmain" | $Xsed -e 's%/[^/]*$%%'`
    340 +  # Assume the source directory is the same one as the path to LTMAIN.
    341 +  srcdir=`$echo "X$ltmain" | $Xsed -e 's%/[^/]*$%%'`
    342    test "$srcdir" = "$ltmain" && srcdir=.
    343  fi
    344  
    345 @@ -264,7 +414,7 @@
    346    ac_config_sub=$ac_aux_dir/config.sub
    347  
    348    # Make sure we can run config.sub.
    349 -  if $ac_config_sub sun4 >/dev/null 2>&1; then :
    350 +  if $SHELL $ac_config_sub sun4 >/dev/null 2>&1; then :
    351    else
    352      echo "$progname: cannot run $ac_config_sub" 1>&2
    353      echo "$help" 1>&2
    354 @@ -276,14 +426,14 @@
    355    host_alias=$host
    356    case "$host_alias" in
    357    "")
    358 -    if host_alias=`$ac_config_guess`; then :
    359 +    if host_alias=`$SHELL $ac_config_guess`; then :
    360      else
    361        echo "$progname: cannot guess host type; you must specify one" 1>&2
    362        echo "$help" 1>&2
    363        exit 1
    364      fi ;;
    365    esac
    366 -  host=`$ac_config_sub $host_alias`
    367 +  host=`$SHELL $ac_config_sub $host_alias`
    368    echo "$ac_t$host" 1>&6
    369  
    370    # Make sure the host verified.
    371 @@ -312,7 +462,7 @@
    372    # AIX sometimes has problems with the GCC collect2 program.  For some
    373    # reason, if we set the COLLECT_NAMES environment variable, the problems
    374    # vanish in a puff of smoke.
    375 -  if test "${COLLECT_NAMES+set}" != set; then
    376 +  if test "X${COLLECT_NAMES+set}" != Xset; then
    377      COLLECT_NAMES=
    378      export COLLECT_NAMES
    379    fi
    380 @@ -327,15 +477,18 @@
    381  # Set a sane default for `AR'.
    382  test -z "$AR" && AR=ar
    383  
    384 +# Set a sane default for `OBJDUMP'.
    385 +test -z "$OBJDUMP" && OBJDUMP=objdump
    386 +
    387  # If RANLIB is not set, then run the test.
    388  if test "${RANLIB+set}" != "set"; then
    389    result=no
    390  
    391    echo $ac_n "checking for ranlib... $ac_c" 1>&6
    392 -  IFS="${IFS=  }"; save_ifs="$IFS"; IFS="${IFS}:"
    393 +  IFS="${IFS=  }"; save_ifs="$IFS"; IFS="${IFS}${PATH_SEPARATOR}"
    394    for dir in $PATH; do
    395      test -z "$dir" && dir=.
    396 -    if test -f $dir/ranlib; then
    397 +    if test -f $dir/ranlib || test -f $dir/ranlib$ac_exeext; then
    398        RANLIB="ranlib"
    399        result="ranlib"
    400        break
    401 @@ -347,20 +500,24 @@
    402  fi
    403  
    404  if test -n "$RANLIB"; then
    405 -  old_archive_cmds="$old_archive_cmds;\$RANLIB \$oldlib"
    406 -  old_postinstall_cmds="\$RANLIB \$oldlib;$old_postinstall_cmds"
    407 +  old_archive_cmds="$old_archive_cmds~\$RANLIB \$oldlib"
    408 +  old_postinstall_cmds="\$RANLIB \$oldlib~$old_postinstall_cmds"
    409  fi
    410  
    411 +# Set sane defaults for `DLLTOOL', `OBJDUMP', and `AS', used on cygwin.
    412 +test -z "$DLLTOOL" && DLLTOOL=dlltool
    413 +test -z "$OBJDUMP" && OBJDUMP=objdump
    414 +test -z "$AS" && AS=as
    415 +
    416  # Check to see if we are using GCC.
    417  if test "$with_gcc" != yes || test -z "$CC"; then
    418    # If CC is not set, then try to find GCC or a usable CC.
    419    if test -z "$CC"; then
    420      echo $ac_n "checking for gcc... $ac_c" 1>&6
    421 -    IFS="${IFS=        }"; save_ifs="$IFS"; IFS="${IFS}:"
    422 +    IFS="${IFS=        }"; save_ifs="$IFS"; IFS="${IFS}${PATH_SEPARATOR}"
    423      for dir in $PATH; do
    424 -      IFS="$save_ifs"
    425        test -z "$dir" && dir=.
    426 -      if test -f $dir/gcc; then
    427 +      if test -f $dir/gcc || test -f $dir/gcc$ac_exeext; then
    428         CC="gcc"
    429         break
    430        fi
    431 @@ -377,11 +534,11 @@
    432    # Not "gcc", so try "cc", rejecting "/usr/ucb/cc".
    433    if test -z "$CC"; then
    434      echo $ac_n "checking for cc... $ac_c" 1>&6
    435 -    IFS="${IFS=        }"; save_ifs="$IFS"; IFS="${IFS}:"
    436 +    IFS="${IFS=        }"; save_ifs="$IFS"; IFS="${IFS}${PATH_SEPARATOR}"
    437      cc_rejected=no
    438      for dir in $PATH; do
    439        test -z "$dir" && dir=.
    440 -      if test -f $dir/cc; then
    441 +      if test -f $dir/cc || test -f $dir/cc$ac_exeext; then
    442         if test "$dir/cc" = "/usr/ucb/cc"; then
    443           cc_rejected=yes
    444           continue
    445 @@ -421,7 +578,7 @@
    446    # Now see if the compiler is really GCC.
    447    with_gcc=no
    448    echo $ac_n "checking whether we are using GNU C... $ac_c" 1>&6
    449 -  echo "$progname:424: checking whether we are using GNU C" >&5
    450 +  echo "$progname:581: checking whether we are using GNU C" >&5
    451  
    452    $rm conftest.c
    453    cat > conftest.c <<EOF
    454 @@ -429,7 +586,7 @@
    455    yes;
    456  #endif
    457  EOF
    458 -  if { ac_try='${CC-cc} -E conftest.c'; { (eval echo $progname:432: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then
    459 +  if { ac_try='${CC-cc} -E conftest.c'; { (eval echo $progname:589: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then
    460      with_gcc=yes
    461    fi
    462    $rm conftest.c
    463 @@ -440,6 +597,60 @@
    464  set dummy $CC
    465  compiler="$2"
    466  
    467 +echo $ac_n "checking for object suffix... $ac_c" 1>&6
    468 +$rm conftest*
    469 +echo 'int i = 1;' > conftest.c
    470 +echo "$progname:603: checking for object suffix" >& 5
    471 +if { (eval echo $progname:604: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>conftest.err; }; then
    472 +  # Append any warnings to the config.log.
    473 +  cat conftest.err 1>&5
    474 +
    475 +  for ac_file in conftest.*; do
    476 +    case $ac_file in
    477 +    *.c) ;;
    478 +    *) objext=`echo $ac_file | sed -e s/conftest.//` ;;
    479 +    esac
    480 +  done
    481 +else
    482 +  cat conftest.err 1>&5
    483 +  echo "$progname: failed program was:" >&5
    484 +  cat conftest.c >&5
    485 +fi
    486 +$rm conftest*
    487 +echo "$ac_t$objext" 1>&6
    488 +
    489 +echo $ac_n "checking for executable suffix... $ac_c" 1>&6
    490 +if eval "test \"`echo '$''{'ac_cv_exeext'+set}'`\" = set"; then
    491 +  echo $ac_n "(cached) $ac_c" 1>&6
    492 +else
    493 +  ac_cv_exeext="no"
    494 +  $rm conftest*
    495 +  echo 'main () { return 0; }' > conftest.c
    496 +  echo "$progname:629: checking for executable suffix" >& 5
    497 +  if { (eval echo $progname:630: \"$ac_link\") 1>&5; (eval $ac_link) 2>conftest.err; }; then
    498 +    # Append any warnings to the config.log.
    499 +    cat conftest.err 1>&5
    500 +
    501 +    for ac_file in conftest.*; do
    502 +      case $ac_file in
    503 +      *.c | *.err | *.$objext ) ;;
    504 +      *) ac_cv_exeext=.`echo $ac_file | sed -e s/conftest.//` ;;
    505 +      esac
    506 +    done
    507 +  else
    508 +    cat conftest.err 1>&5
    509 +    echo "$progname: failed program was:" >&5
    510 +    cat conftest.c >&5
    511 +  fi
    512 +  $rm conftest*
    513 +fi
    514 +if test "X$ac_cv_exeext" = Xno; then
    515 +  exeext=""
    516 +else
    517 +  exeext="$ac_cv_exeext"
    518 +fi
    519 +echo "$ac_t$ac_cv_exeext" 1>&6
    520 +
    521  echo $ac_n "checking for $compiler option to produce PIC... $ac_c" 1>&6
    522  pic_flag=
    523  special_shlib_compile_flags=
    524 @@ -450,21 +661,39 @@
    525  if test "$with_gcc" = yes; then
    526    wl='-Wl,'
    527    link_static_flag='-static'
    528 -  no_builtin_flag=' -fno-builtin'
    529  
    530    case "$host_os" in
    531 -  aix3* | aix4* | irix5* | irix6* | osf3* | osf4*)
    532 +  beos* | irix5* | irix6* | osf3* | osf4* | osf5*)
    533      # PIC is the default for these OSes.
    534      ;;
    535 -  os2*)
    536 +  aix*)
    537 +    # Below there is a dirty hack to force normal static linking with -ldl
    538 +    # The problem is because libdl dynamically linked with both libc and
    539 +    # libC (AIX C++ library), which obviously doesn't included in libraries
    540 +    # list by gcc. This cause undefined symbols with -static flags.
    541 +    # This hack allows C programs to be linked with "-static -ldl", but
    542 +    # we not sure about C++ programs.
    543 +    link_static_flag="$link_static_flag ${wl}-lC"
    544 +    ;;
    545 +  cygwin* | mingw* | os2*)
    546      # We can build DLLs from non-PIC.
    547      ;;
    548 +  darwin* | rhapsody*)
    549 +    # PIC is the default on this platform
    550 +    # Common symbols not allowed in MH_DYLIB files
    551 +    pic_flag='-fno-common'
    552 +    ;;
    553    amigaos*)
    554      # FIXME: we need at least 68020 code to build shared libraries, but
    555      # adding the `-m68020' flag to GCC prevents building anything better,
    556      # like `-m68040'.
    557      pic_flag='-m68020 -resident32 -malways-restore-a4'
    558      ;;
    559 +  sysv4*MP*)
    560 +    if test -d /usr/nec; then
    561 +       pic_flag=-Kconform_pic
    562 +    fi
    563 +    ;;
    564    *)
    565      pic_flag='-fPIC'
    566      ;;
    567 @@ -477,7 +706,7 @@
    568      link_static_flag='-bnso -bI:/lib/syscalls.exp'
    569      ;;
    570  
    571 -  hpux9* | hpux10*)
    572 +  hpux9* | hpux10* | hpux11*)
    573      # Is there a better link_static_flag that works with the bundled CC?
    574      wl='-Wl,'
    575      link_static_flag="${wl}-a ${wl}archive"
    576 @@ -490,11 +719,11 @@
    577      # PIC (with -KPIC) is the default.
    578      ;;
    579  
    580 -  os2*)
    581 +  cygwin* | mingw* | os2*)
    582      # We can build DLLs from non-PIC.
    583      ;;
    584  
    585 -  osf3* | osf4*)
    586 +  osf3* | osf4* | osf5*)
    587      # All OSF/1 code is PIC.
    588      wl='-Wl,'
    589      link_static_flag='-non_shared'
    590 @@ -506,7 +735,7 @@
    591      special_shlib_compile_flags='-belf'
    592      ;;
    593  
    594 -  solaris2*)
    595 +  solaris*)
    596      pic_flag='-KPIC'
    597      link_static_flag='-Bstatic'
    598      wl='-Wl,'
    599 @@ -518,7 +747,7 @@
    600      wl='-Qoption ld '
    601      ;;
    602  
    603 -  sysv4.2uw2*)
    604 +  sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*)
    605      pic_flag='-KPIC'
    606      link_static_flag='-Bstatic'
    607      wl='-Wl,'
    608 @@ -528,7 +757,12 @@
    609      pic_flag='-pic'
    610      link_static_flag='-Bstatic'
    611      ;;
    612 -
    613 +  sysv4*MP*)
    614 +    if test -d /usr/nec ;then
    615 +      pic_flag='-Kconform_pic'
    616 +      link_static_flag='-Bstatic'
    617 +    fi
    618 +    ;;
    619    *)
    620      can_build_shared=no
    621      ;;
    622 @@ -541,25 +775,33 @@
    623    # Check to make sure the pic_flag actually works.
    624    echo $ac_n "checking if $compiler PIC flag $pic_flag works... $ac_c" 1>&6
    625    $rm conftest*
    626 -  echo > conftest.c
    627 +  echo "int some_variable = 0;" > conftest.c
    628    save_CFLAGS="$CFLAGS"
    629    CFLAGS="$CFLAGS $pic_flag -DPIC"
    630 -  echo "$progname:547: checking if $compiler PIC flag $pic_flag works" >&5
    631 -  if { (eval echo $progname:548: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>conftest.err; } && test -s conftest.o; then
    632 +  echo "$progname:781: checking if $compiler PIC flag $pic_flag works" >&5
    633 +  if { (eval echo $progname:782: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>conftest.err; } && test -s conftest.$objext; then
    634      # Append any warnings to the config.log.
    635      cat conftest.err 1>&5
    636 -
    637 -    # On HP-UX, both CC and GCC only warn that PIC is supported... then they
    638 -    # create non-PIC objects.  So, if there were any warnings, we assume that
    639 -    # PIC is not supported.
    640 -    if test -s conftest.err; then
    641 -      echo "$ac_t"no 1>&6
    642 -      can_build_shared=no
    643 -      pic_flag=
    644 -    else
    645 +   
    646 +    case "$host_os" in
    647 +    hpux9* | hpux10* | hpux11*)
    648 +      # On HP-UX, both CC and GCC only warn that PIC is supported... then they
    649 +      # create non-PIC objects.  So, if there were any warnings, we assume that
    650 +      # PIC is not supported.
    651 +      if test -s conftest.err; then
    652 +       echo "$ac_t"no 1>&6
    653 +       can_build_shared=no
    654 +       pic_flag=
    655 +      else
    656 +       echo "$ac_t"yes 1>&6
    657 +       pic_flag=" $pic_flag"
    658 +      fi
    659 +      ;;
    660 +    *)
    661        echo "$ac_t"yes 1>&6
    662        pic_flag=" $pic_flag"
    663 -    fi
    664 +      ;;
    665 +    esac
    666    else
    667      # Append any errors to the config.log.
    668      cat conftest.err 1>&5
    669 @@ -573,6 +815,136 @@
    670    echo "$ac_t"none 1>&6
    671  fi
    672  
    673 +# Check to see if options -o and -c are simultaneously supported by compiler
    674 +echo $ac_n "checking if $compiler supports -c -o file.o... $ac_c" 1>&6
    675 +$rm -r conftest 2>/dev/null
    676 +mkdir conftest
    677 +cd conftest
    678 +$rm conftest*
    679 +echo "int some_variable = 0;" > conftest.c
    680 +mkdir out
    681 +# According to Tom Tromey, Ian Lance Taylor reported there are C compilers
    682 +# that will create temporary files in the current directory regardless of
    683 +# the output directory.  Thus, making CWD read-only will cause this test
    684 +# to fail, enabling locking or at least warning the user not to do parallel
    685 +# builds.
    686 +chmod -w .
    687 +save_CFLAGS="$CFLAGS"
    688 +CFLAGS="$CFLAGS -o out/conftest2.o"
    689 +echo "$progname:834: checking if $compiler supports -c -o file.o" >&5
    690 +if { (eval echo $progname:835: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>out/conftest.err; } && test -s out/conftest2.o; then
    691 +
    692 +  # The compiler can only warn and ignore the option if not recognized
    693 +  # So say no if there are warnings
    694 +    if test -s out/conftest.err; then
    695 +      echo "$ac_t"no 1>&6
    696 +      compiler_c_o=no
    697 +    else
    698 +      echo "$ac_t"yes 1>&6
    699 +      compiler_c_o=yes
    700 +    fi
    701 +else
    702 +  # Append any errors to the config.log.
    703 +  cat out/conftest.err 1>&5
    704 +  compiler_c_o=no
    705 +  echo "$ac_t"no 1>&6
    706 +fi
    707 +CFLAGS="$save_CFLAGS"
    708 +chmod u+w .
    709 +$rm conftest* out/*
    710 +rmdir out
    711 +cd ..
    712 +rmdir conftest
    713 +$rm -r conftest 2>/dev/null
    714 +
    715 +if test x"$compiler_c_o" = x"yes"; then
    716 +  # Check to see if we can write to a .lo
    717 +  echo $ac_n "checking if $compiler supports -c -o file.lo... $ac_c" 1>&6
    718 +  $rm conftest*
    719 +  echo "int some_variable = 0;" > conftest.c
    720 +  save_CFLAGS="$CFLAGS"
    721 +  CFLAGS="$CFLAGS -c -o conftest.lo"
    722 +  echo "$progname:867: checking if $compiler supports -c -o file.lo" >&5
    723 +if { (eval echo $progname:868: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>conftest.err; } && test -s conftest.lo; then
    724 +
    725 +    # The compiler can only warn and ignore the option if not recognized
    726 +    # So say no if there are warnings
    727 +      if test -s conftest.err; then
    728 +       echo "$ac_t"no 1>&6
    729 +       compiler_o_lo=no
    730 +      else
    731 +       echo "$ac_t"yes 1>&6
    732 +       compiler_o_lo=yes
    733 +      fi
    734 +  else
    735 +    # Append any errors to the config.log.
    736 +    cat conftest.err 1>&5
    737 +    compiler_o_lo=no
    738 +    echo "$ac_t"no 1>&6
    739 +  fi
    740 +  CFLAGS="$save_CFLAGS"
    741 +  $rm conftest*
    742 +else
    743 +  compiler_o_lo=no
    744 +fi
    745 +
    746 +# Check to see if we can do hard links to lock some files if needed
    747 +hard_links="nottested"
    748 +if test "$compiler_c_o" = no && test "$need_locks" != no; then
    749 +  # do not overwrite the value of need_locks provided by the user
    750 +  echo $ac_n "checking if we can lock with hard links... $ac_c" 1>&6
    751 +  hard_links=yes
    752 +  $rm conftest*
    753 +  ln conftest.a conftest.b 2>/dev/null && hard_links=no
    754 +  touch conftest.a
    755 +  ln conftest.a conftest.b 2>&5 || hard_links=no
    756 +  ln conftest.a conftest.b 2>/dev/null && hard_links=no
    757 +  echo "$ac_t$hard_links" 1>&6
    758 +  $rm conftest*
    759 +  if test "$hard_links" = no; then
    760 +    echo "*** WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&2
    761 +    need_locks=warn
    762 +  fi
    763 +else
    764 +  need_locks=no
    765 +fi
    766 +
    767 +if test "$with_gcc" = yes; then
    768 +  # Check to see if options -fno-rtti -fno-exceptions are supported by compiler
    769 +  echo $ac_n "checking if $compiler supports -fno-rtti -fno-exceptions ... $ac_c" 1>&6
    770 +  $rm conftest*
    771 +  echo "int some_variable = 0;" > conftest.c
    772 +  save_CFLAGS="$CFLAGS"
    773 +  CFLAGS="$CFLAGS -fno-rtti -fno-exceptions -c conftest.c"
    774 +  echo "$progname:919: checking if $compiler supports -fno-rtti -fno-exceptions" >&5
    775 +  if { (eval echo $progname:920: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>conftest.err; } && test -s conftest.o; then
    776 +
    777 +    # The compiler can only warn and ignore the option if not recognized
    778 +    # So say no if there are warnings
    779 +      if test -s conftest.err; then
    780 +       echo "$ac_t"no 1>&6
    781 +       compiler_rtti_exceptions=no
    782 +      else
    783 +       echo "$ac_t"yes 1>&6
    784 +       compiler_rtti_exceptions=yes
    785 +      fi
    786 +  else
    787 +    # Append any errors to the config.log.
    788 +    cat conftest.err 1>&5
    789 +    compiler_rtti_exceptions=no
    790 +    echo "$ac_t"no 1>&6
    791 +  fi
    792 +  CFLAGS="$save_CFLAGS"
    793 +  $rm conftest*
    794 +
    795 +  if test "$compiler_rtti_exceptions" = "yes"; then
    796 +    no_builtin_flag=' -fno-builtin -fno-rtti -fno-exceptions'
    797 +  else
    798 +    no_builtin_flag=' -fno-builtin'
    799 +  fi
    800 
    801 +fi
    802 +
    803  # Check for any special shared library compilation flags.
    804  if test -n "$special_shlib_compile_flags"; then
    805    echo "$progname: warning: \`$CC' requires \`$special_shlib_compile_flags' to build shared libraries" 1>&2
    806 @@ -588,8 +960,8 @@
    807  echo 'main(){return(0);}' > conftest.c
    808  save_LDFLAGS="$LDFLAGS"
    809  LDFLAGS="$LDFLAGS $link_static_flag"
    810 -echo "$progname:591: checking if $compiler static flag $link_static_flag works" >&5
    811 -if { (eval echo $progname:592: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
    812 +echo "$progname:963: checking if $compiler static flag $link_static_flag works" >&5
    813 +if { (eval echo $progname:964: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
    814    echo "$ac_t$link_static_flag" 1>&6
    815  else
    816    echo "$ac_t"none 1>&6
    817 @@ -601,9 +973,9 @@
    818  if test -z "$LN_S"; then
    819    # Check to see if we can use ln -s, or we need hard links.
    820    echo $ac_n "checking whether ln -s works... $ac_c" 1>&6
    821 -  $rm conftestdata
    822 -  if ln -s X conftestdata 2>/dev/null; then
    823 -    $rm conftestdata
    824 +  $rm conftest.dat
    825 +  if ln -s X conftest.dat 2>/dev/null; then
    826 +    $rm conftest.dat
    827      LN_S="ln -s"
    828    else
    829      LN_S=ln
    830 @@ -621,11 +993,17 @@
    831    if test "$with_gcc" = yes; then
    832      # Check if gcc -print-prog-name=ld gives a path.
    833      echo $ac_n "checking for ld used by GCC... $ac_c" 1>&6
    834 -    echo "$progname:624: checking for ld used by GCC" >&5
    835 +    echo "$progname:996: checking for ld used by GCC" >&5
    836      ac_prog=`($CC -print-prog-name=ld) 2>&5`
    837      case "$ac_prog" in
    838      # Accept absolute paths.
    839 -    /* | [A-Za-z]:\\*)
    840 +    [\\/]* | [A-Za-z]:[\\/]*)
    841 +      re_direlt='/[^/][^/]*/\.\./'
    842 +      # Canonicalize the path of ld
    843 +      ac_prog=`echo $ac_prog| sed 's%\\\\%/%g'`
    844 +      while echo $ac_prog | grep "$re_direlt" > /dev/null 2>&1; do
    845 +       ac_prog=`echo $ac_prog| sed "s%$re_direlt%/%"`
    846 +      done
    847        test -z "$LD" && LD="$ac_prog"
    848        ;;
    849      "")
    850 @@ -639,17 +1017,17 @@
    851      esac
    852    elif test "$with_gnu_ld" = yes; then
    853      echo $ac_n "checking for GNU ld... $ac_c" 1>&6
    854 -    echo "$progname:642: checking for GNU ld" >&5
    855 +    echo "$progname:1020: checking for GNU ld" >&5
    856    else
    857      echo $ac_n "checking for non-GNU ld""... $ac_c" 1>&6
    858 -    echo "$progname:645: checking for non-GNU ld" >&5
    859 +    echo "$progname:1023: checking for non-GNU ld" >&5
    860    fi
    861  
    862    if test -z "$LD"; then
    863 -    IFS="${IFS=        }"; ac_save_ifs="$IFS"; IFS="${IFS}:"
    864 +    IFS="${IFS=        }"; ac_save_ifs="$IFS"; IFS="${IFS}${PATH_SEPARATOR}"
    865      for ac_dir in $PATH; do
    866        test -z "$ac_dir" && ac_dir=.
    867 -      if test -f "$ac_dir/$ac_prog"; then
    868 +      if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then
    869         LD="$ac_dir/$ac_prog"
    870         # Check to see if the program is GNU ld.  I'd rather use --version,
    871         # but apparently some GNU ld's only accept -v.
    872 @@ -691,48 +1069,208 @@
    873  
    874  allow_undefined_flag=
    875  no_undefined_flag=
    876 +need_lib_prefix=unknown
    877 +need_version=unknown
    878 +# when you set need_version to no, make sure it does not cause -set_version
    879 +# flags to be left without arguments
    880  archive_cmds=
    881 +archive_expsym_cmds=
    882  old_archive_from_new_cmds=
    883  export_dynamic_flag_spec=
    884 +whole_archive_flag_spec=
    885 +thread_safe_flag_spec=
    886  hardcode_libdir_flag_spec=
    887  hardcode_libdir_separator=
    888  hardcode_direct=no
    889  hardcode_minus_L=no
    890  hardcode_shlibpath_var=unsupported
    891  runpath_var=
    892 +always_export_symbols=no
    893 +export_symbols_cmds='$NM $libobjs $convenience | $global_symbol_pipe | sed '\''s/.* //'\'' | sort | uniq > $export_symbols'
    894 +# include_expsyms should be a list of space-separated symbols to be *always*
    895 +# included in the symbol list
    896 +include_expsyms=
    897 +# exclude_expsyms can be an egrep regular expression of symbols to exclude
    898 +# it will be wrapped by ` (' and `)$', so one must not match beginning or
    899 +# end of line.  Example: `a|bc|.*d.*' will exclude the symbols `a' and `bc',
    900 +# as well as any symbol that contains `d'.
    901 +exclude_expsyms="_GLOBAL_OFFSET_TABLE_"
    902 +# Although _GLOBAL_OFFSET_TABLE_ is a valid symbol C name, most a.out
    903 +# platforms (ab)use it in PIC code, but their linkers get confused if
    904 +# the symbol is explicitly referenced.  Since portable code cannot
    905 +# rely on this symbol name, it's probably fine to never include it in
    906 +# preloaded symbol tables.
    907  
    908  case "$host_os" in
    909 -amigaos* | sunos4*)
    910 -  # On these operating systems, we should treat GNU ld like the system ld.
    911 -  gnu_ld_acts_native=yes
    912 -  ;;
    913 -*)
    914 -  gnu_ld_acts_native=no
    915 +cygwin* | mingw*)
    916 +  # FIXME: the MSVC++ port hasn't been tested in a loooong time
    917 +  # When not using gcc, we currently assume that we are using
    918 +  # Microsoft Visual C++.
    919 +  if test "$with_gcc" != yes; then
    920 +    with_gnu_ld=no
    921 +  fi
    922    ;;
    923 +
    924  esac
    925  
    926  ld_shlibs=yes
    927 -if test "$with_gnu_ld" = yes && test "$gnu_ld_acts_native" != yes; then
    928 +if test "$with_gnu_ld" = yes; then
    929 +  # If archive_cmds runs LD, not CC, wlarc should be empty
    930 +  wlarc='${wl}'
    931  
    932    # See if GNU ld supports shared libraries.
    933 -  if $LD --help 2>&1 | egrep ': supported targets:.* elf' > /dev/null; then
    934 -    archive_cmds='$CC -shared ${wl}-soname $wl$soname -o $lib$libobjs'
    935 -    runpath_var=LD_RUN_PATH
    936 -    ld_shlibs=yes
    937 -  else
    938 +  case "$host_os" in
    939 +  aix3* | aix4*)
    940 +    # On AIX, the GNU linker is very broken
    941      ld_shlibs=no
    942 -  fi
    943 +    cat <<EOF 1>&2
    944 +
    945 +*** Warning: the GNU linker, at least up to release 2.9.1, is reported
    946 +*** to be unable to reliably create shared libraries on AIX.
    947 +*** Therefore, libtool is disabling shared libraries support.  If you
    948 +*** really care for shared libraries, you may want to modify your PATH
    949 +*** so that a non-GNU linker is found, and then restart.
    950 +
    951 +EOF
    952 +    ;;
    953 +
    954 +  amigaos*)
    955 +    archive_cmds='$rm $objdir/a2ixlibrary.data~$echo "#define NAME $libname" > $objdir/a2ixlibrary.data~$echo "#define LIBRARY_ID 1" >> $objdir/a2ixlibrary.data~$echo "#define VERSION $major" >> $objdir/a2ixlibrary.data~$echo "#define REVISION $revision" >> $objdir/a2ixlibrary.data~$AR cru $lib $libobjs~$RANLIB $lib~(cd $objdir && a2ixlibrary -32)'
    956 +    hardcode_libdir_flag_spec='-L$libdir'
    957 +    hardcode_minus_L=yes
    958 +
    959 +    # Samuel A. Falvo II <kc5tja@dolphin.openprojects.net> reports
    960 +    # that the semantics of dynamic libraries on AmigaOS, at least up
    961 +    # to version 4, is to share data among multiple programs linked
    962 +    # with the same dynamic library.  Since this doesn't match the
    963 +    # behavior of shared libraries on other platforms, we can use
    964 +    # them.
    965 +    ld_shlibs=no
    966 +    ;;
    967 +
    968 +  beos*)
    969 +    if $LD --help 2>&1 | egrep ': supported targets:.* elf' > /dev/null; then
    970 +      allow_undefined_flag=unsupported
    971 +      # Joseph Beckenbach <jrb3@best.com> says some releases of gcc
    972 +      # support --undefined.  This deserves some investigation.  FIXME
    973 +      archive_cmds='$CC -nostart $libobjs $deplibs $linkopts ${wl}-soname $wl$soname -o $lib'
    974 +    else
    975 +      ld_shlibs=no
    976 +    fi
    977 +    ;;
    978 +
    979 +  cygwin* | mingw*)
    980 +    # hardcode_libdir_flag_spec is actually meaningless, as there is
    981 +    # no search path for DLLs.
    982 +    hardcode_libdir_flag_spec='-L$libdir'
    983 +    allow_undefined_flag=unsupported
    984 +    always_export_symbols=yes
    985 +
    986 +    # Extract the symbol export list from an `--export-all' def file,
    987 +    # then regenerate the def file from the symbol export list, so that
    988 +    # the compiled dll only exports the symbol export list.
    989 +    # Be careful not to strip the DATA tag left by newer dlltools.
    990 +    export_symbols_cmds='test -f $objdir/$soname-ltdll.c || sed -e "/^# \/\* ltdll\.c starts here \*\//,/^# \/\* ltdll.c ends here \*\// { s/^# //; p; }" -e d < $0 > $objdir/$soname-ltdll.c~
    991 +      test -f $objdir/$soname-ltdll.$objext || (cd $objdir && $CC -c $soname-ltdll.c)~
    992 +      $DLLTOOL --export-all --exclude-symbols DllMain@12,_cygwin_dll_entry@12,_cygwin_noncygwin_dll_entry@12 --output-def $objdir/$soname-def  $objdir/$soname-ltdll.$objext $libobjs $convenience~
    993 +      sed -e "1,/EXPORTS/d" -e "s/ @ [0-9]*//" -e "s/ *;.*$//" < $objdir/$soname-def > $export_symbols'
    994 +
    995 +    # If DATA tags from a recent dlltool are present, honour them!
    996 +    archive_expsym_cmds='echo EXPORTS > $objdir/$soname-def~
    997 +      _lt_hint=1;
    998 +      cat $export_symbols | while read symbol; do
    999 +        set dummy \$symbol;
    1000 +        case \$# in
    1001 +          2) echo "    \$2 @ \$_lt_hint ; " >> $objdir/$soname-def;;
    1002 +          *) echo "     \$2 @ \$_lt_hint \$3 ; " >> $objdir/$soname-def;;
    1003 +        esac;
    1004 +       _lt_hint=`expr 1 + \$_lt_hint`;
    1005 +      done~
    1006 +      test -f $objdir/$soname-ltdll.c || sed -e "/^# \/\* ltdll\.c starts here \*\//,/^# \/\* ltdll.c ends here \*\// { s/^# //; p; }" -e d < $0 > $objdir/$soname-ltdll.c~
    1007 +      test -f $objdir/$soname-ltdll.$objext || (cd $objdir && $CC -c $soname-ltdll.c)~
    1008 +      $CC -Wl,--base-file,$objdir/$soname-base -Wl,--dll -nostartfiles -Wl,-e,__cygwin_dll_entry@12 -o $lib $objdir/$soname-ltdll.$objext $libobjs $deplibs $linkopts~
    1009 +      $DLLTOOL --as=$AS --dllname $soname --exclude-symbols DllMain@12,_cygwin_dll_entry@12,_cygwin_noncygwin_dll_entry@12 --def $objdir/$soname-def --base-file $objdir/$soname-base --output-exp $objdir/$soname-exp~
    1010 +      $CC -Wl,--base-file,$objdir/$soname-base $objdir/$soname-exp -Wl,--dll -nostartfiles -Wl,-e,__cygwin_dll_entry@12 -o $lib $objdir/$soname-ltdll.$objext $libobjs $deplibs $linkopts~
    1011 +      $DLLTOOL --as=$AS --dllname $soname --exclude-symbols DllMain@12,_cygwin_dll_entry@12,_cygwin_noncygwin_dll_entry@12 --def $objdir/$soname-def --base-file $objdir/$soname-base --output-exp $objdir/$soname-exp~
    1012 +      $CC $objdir/$soname-exp -Wl,--dll -nostartfiles -Wl,-e,__cygwin_dll_entry@12 -o $lib $objdir/$soname-ltdll.$objext $libobjs $deplibs $linkopts'
    1013 +
    1014 +      old_archive_from_new_cmds='$DLLTOOL --as=$AS --dllname $soname --def $objdir/$soname-def --output-lib $objdir/$libname.a'
    1015 +    ;;
    1016 +
    1017 +  netbsd*)
    1018 +    if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then
    1019 +      archive_cmds='$CC -shared $libobjs $deplibs $linkopts ${wl}-soname $wl$soname -o $lib'
    1020 +      archive_expsym_cmds='$CC -shared $libobjs $deplibs $linkopts ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
    1021 +    else
    1022 +      archive_cmds='$LD -Bshareable $libobjs $deplibs $linkopts -o $lib'
    1023 +      # can we support soname and/or expsyms with a.out? -oliva
    1024 +    fi
    1025 +    ;;
    1026 +
    1027 +  solaris* | sysv5*)
    1028 +    if $LD -v 2>&1 | egrep 'BFD 2\.8' > /dev/null; then
    1029 +      ld_shlibs=no
    1030 +      cat <<EOF 1>&2
    1031 +
    1032 +*** Warning: The releases 2.8.* of the GNU linker cannot reliably
    1033 +*** create shared libraries on Solaris systems.  Therefore, libtool
    1034 +*** is disabling shared libraries support.  We urge you to upgrade GNU
    1035 +*** binutils to release 2.9.1 or newer.  Another option is to modify
    1036 +*** your PATH or compiler configuration so that the native linker is
    1037 +*** used, and then restart.
    1038 +
    1039 +EOF
    1040 +    elif $LD --help 2>&1 | egrep ': supported targets:.* elf' > /dev/null; then
    1041 +      archive_cmds='$CC -shared $libobjs $deplibs $linkopts ${wl}-soname $wl$soname -o $lib'
    1042 +      archive_expsym_cmds='$CC -shared $libobjs $deplibs $linkopts ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
    1043 +    else
    1044 +      ld_shlibs=no
    1045 +    fi
    1046 +    ;;     
    1047 +
    1048 +  sunos4*)
    1049 +    archive_cmds='$LD -assert pure-text -Bshareable -o $lib $libobjs $deplibs $linkopts'
    1050 +    wlarc=
    1051 +    hardcode_direct=yes
    1052 +    hardcode_shlibpath_var=no
    1053 +    ;;
    1054 +
    1055 +  *)
    1056 +    if $LD --help 2>&1 | egrep ': supported targets:.* elf' > /dev/null; then
    1057 +      archive_cmds='$CC -shared $libobjs $deplibs $linkopts ${wl}-soname $wl$soname -o $lib'
    1058 +      archive_expsym_cmds='$CC -shared $libobjs $deplibs $linkopts ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
    1059 +    else
    1060 +      ld_shlibs=no
    1061 +    fi
    1062 +    ;;
    1063 +  esac
    1064  
    1065    if test "$ld_shlibs" = yes; then
    1066 +    runpath_var=LD_RUN_PATH
    1067      hardcode_libdir_flag_spec='${wl}--rpath ${wl}$libdir'
    1068      export_dynamic_flag_spec='${wl}--export-dynamic'
    1069 +    case $host_os in
    1070 +    cygwin* | mingw*)
    1071 +      # dlltool doesn't understand --whole-archive et. al.
    1072 +      whole_archive_flag_spec=
    1073 +      ;;
    1074 +    *)
    1075 +      # ancient GNU ld didn't support --whole-archive et. al.
    1076 +      if $LD --help 2>&1 | egrep 'no-whole-archive' > /dev/null; then
    1077 +        whole_archive_flag_spec="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive'
    1078 +      else
    1079 +        whole_archive_flag_spec=
    1080 +      fi
    1081 +      ;;
    1082 +    esac
    1083    fi
    1084  else
    1085    # PORTME fill in a description of your system's linker (not GNU ld)
    1086    case "$host_os" in
    1087    aix3*)
    1088      allow_undefined_flag=unsupported
    1089 -    archive_cmds='$NM$libobjs | $global_symbol_pipe | sed '\''s/.* //'\'' > $lib.exp;$LD -o $objdir/$soname$libobjs -bE:$lib.exp -T512 -H512 -bM:SRE;$AR cru $lib $objdir/$soname'
    1090 +    always_export_symbols=yes
    1091 +    archive_expsym_cmds='$LD -o $objdir/$soname $libobjs $deplibs $linkopts -bE:$export_symbols -T512 -H512 -bM:SRE~$AR cru $lib $objdir/$soname'
    1092      # Note: this linker hardcodes the directories in LIBPATH if there
    1093      # are no directories specified by -L.
    1094      hardcode_minus_L=yes
    1095 @@ -744,16 +1282,67 @@
    1096      ;;
    1097  
    1098    aix4*)
    1099 -    allow_undefined_flag=unsupported
    1100 -    archive_cmds='$NM$libobjs | $global_symbol_pipe | sed '\''s/.* //'\'' > $lib.exp;$CC -o $objdir/$soname$libobjs ${wl}-bE:$lib.exp ${wl}-bM:SRE ${wl}-bnoentry;$AR cru $lib $objdir/$soname'
    1101 -    hardcode_direct=yes
    1102 -    hardcode_minus_L=yes
    1103 -    ;;
    1104 +    hardcode_libdir_flag_spec='${wl}-b ${wl}nolibpath ${wl}-b ${wl}libpath:$libdir:/usr/lib:/lib'
    1105 +    hardcode_libdir_separator=':'
    1106 +    if test "$with_gcc" = yes; then
    1107 +      collect2name=`${CC} -print-prog-name=collect2`
    1108 +      if test -f "$collect2name" && \
    1109 +        strings "$collect2name" | grep resolve_lib_name >/dev/null
    1110 +      then
    1111 +       # We have reworked collect2
    1112 +       hardcode_direct=yes
    1113 +      else
    1114 +       # We have old collect2
    1115 +       hardcode_direct=unsupported
    1116 +       # It fails to find uninstalled libraries when the uninstalled
    1117 +       # path is not listed in the libpath.  Setting hardcode_minus_L
    1118 +       # to unsupported forces relinking
    1119 +       hardcode_minus_L=yes
    1120 +       hardcode_libdir_flag_spec='-L$libdir'
    1121 +       hardcode_libdir_separator=
    1122 +      fi
    1123 +      shared_flag='-shared'
    1124 +    else
    1125 +      shared_flag='${wl}-bM:SRE'
    1126 +      hardcode_direct=yes
    1127 +    fi
    1128 +    allow_undefined_flag=' ${wl}-berok'
    1129 +    archive_cmds="\$CC $shared_flag"' -o $objdir/$soname $libobjs $deplibs $linkopts ${wl}-bexpall ${wl}-bnoentry${allow_undefined_flag}'
    1130 +    archive_expsym_cmds="\$CC $shared_flag"' -o $objdir/$soname $libobjs $deplibs $linkopts ${wl}-bE:$export_symbols ${wl}-bnoentry${allow_undefined_flag}'
    1131 +    case "$host_os" in aix4.[01]|aix4.[01].*)
    1132 +      # According to Greg Wooledge, -bexpall is only supported from AIX 4.2 on
    1133 +      always_export_symbols=yes ;;
    1134 +    esac
    1135 +   ;;
    1136  
    1137    amigaos*)
    1138 -    archive_cmds='$rm $objdir/a2ixlibrary.data;$echo "#define NAME $libname" > $objdir/a2ixlibrary.data;$echo "#define LIBRARY_ID 1" >> $objdir/a2ixlibrary.data;$echo "#define VERSION $major" >> $objdir/a2ixlibrary.data;$echo "#define REVISION $revision" >> $objdir/a2ixlibrary.data;$AR cru $lib$libobjs;$RANLIB $lib;(cd $objdir && a2ixlibrary -32)'
    1139 +    archive_cmds='$rm $objdir/a2ixlibrary.data~$echo "#define NAME $libname" > $objdir/a2ixlibrary.data~$echo "#define LIBRARY_ID 1" >> $objdir/a2ixlibrary.data~$echo "#define VERSION $major" >> $objdir/a2ixlibrary.data~$echo "#define REVISION $revision" >> $objdir/a2ixlibrary.data~$AR cru $lib $libobjs~$RANLIB $lib~(cd $objdir && a2ixlibrary -32)'
    1140      hardcode_libdir_flag_spec='-L$libdir'
    1141      hardcode_minus_L=yes
    1142 +    # see comment about different semantics on the GNU ld section
    1143 +    ld_shlibs=no
    1144 +    ;;
    1145 +
    1146 +  cygwin* | mingw*)
    1147 +    # When not using gcc, we currently assume that we are using
    1148 +    # Microsoft Visual C++.
    1149 +    # hardcode_libdir_flag_spec is actually meaningless, as there is
    1150 +    # no search path for DLLs.
    1151 +    hardcode_libdir_flag_spec=' '
    1152 +    allow_undefined_flag=unsupported
    1153 +    # Tell ltmain to make .lib files, not .a files.
    1154 +    libext=lib
    1155 +    # FIXME: Setting linknames here is a bad hack.
    1156 +    archive_cmds='$CC -o $lib $libobjs $linkopts `echo "$deplibs" | sed -e '\''s/ -lc$//'\''` -link -dll~linknames='
    1157 +    # The linker will automatically build a .lib file if we build a DLL.
    1158 +    old_archive_from_new_cmds='true'
    1159 +    # FIXME: Should let the user specify the lib program.
    1160 +    old_archive_cmds='lib /OUT:$oldlib$oldobjs'
    1161 +    fix_srcfile_path='`cygpath -w $srcfile`'
    1162 +    ;;
    1163 +
    1164 +  freebsd1*)
    1165 +    ld_shlibs=no
    1166      ;;
    1167  
    1168    # FreeBSD 2.2.[012] allows us to include c++rt0.o to get C++ constructor
    1169 @@ -761,61 +1350,81 @@
    1170    # does not break anything, and helps significantly (at the cost of a little
    1171    # extra space).
    1172    freebsd2.2*)
    1173 -    archive_cmds='$LD -Bshareable -o $lib$libobjs /usr/lib/c++rt0.o'
    1174 +    archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linkopts /usr/lib/c++rt0.o'
    1175      hardcode_libdir_flag_spec='-R$libdir'
    1176      hardcode_direct=yes
    1177 -    hardcode_minus_L=yes
    1178      hardcode_shlibpath_var=no
    1179      ;;
    1180  
    1181    # Unfortunately, older versions of FreeBSD 2 do not have this feature.
    1182    freebsd2*)
    1183 -    archive_cmds='$LD -Bshareable -o $lib$libobjs'
    1184 +    archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linkopts'
    1185      hardcode_direct=yes
    1186      hardcode_minus_L=yes
    1187      hardcode_shlibpath_var=no
    1188      ;;
    1189  
    1190 -  # FreeBSD 3, at last, uses gcc -shared to do shared libraries.
    1191 -  freebsd3*)
    1192 -    archive_cmds='$CC -shared -o $lib$libobjs'
    1193 +  # FreeBSD 3 and greater uses gcc -shared to do shared libraries.
    1194 +  freebsd*)
    1195 +    archive_cmds='$CC -shared -o $lib $libobjs $deplibs $linkopts'
    1196      hardcode_libdir_flag_spec='-R$libdir'
    1197      hardcode_direct=yes
    1198 -    hardcode_minus_L=yes
    1199      hardcode_shlibpath_var=no
    1200      ;;
    1201  
    1202 -  hpux9*)
    1203 -    archive_cmds='$rm $objdir/$soname;$LD -b +s +b $install_libdir -o $objdir/$soname$libobjs;mv $objdir/$soname $lib'
    1204 -    hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir'
    1205 +  darwin* | rhapsody*)
    1206 +    case "$host_os" in
    1207 +    rhapsody* | darwin1.[012])
    1208 +      allow_undefined_flag='-undefined suppress'
    1209 +      ;;
    1210 +    *) # Darwin 1.3 on
    1211 +      allow_undefined_flag='-flat_namespace -undefined suppress'
    1212 +      ;;
    1213 +    esac
    1214 +    archive_cmds='$nonopt $(test .$module = .yes && echo -bundle || echo -dynamiclib) $allow_undefined_flag -o $lib $libobjs $deplibs $linkopts $(test .$module != .yes && echo -install_name $rpath/$soname $verstring)'
    1215 +    # We need to add '_' to the symbols in $export_symbols first
    1216 +    #archive_expsym_cmds="$archive_cmds"' && strip -s $export_symbols $lib'
    1217      hardcode_direct=yes
    1218 -    hardcode_minus_L=yes
    1219 -    export_dynamic_flag_spec='${wl}-E'
    1220 +    hardcode_shlibpath_var=no
    1221 +    whole_archive_flag_spec='-all_load $convenience'
    1222      ;;
    1223  
    1224 -  hpux10*)
    1225 -    archive_cmds='$LD -b +h $soname +s +b $install_libdir -o $lib$libobjs'
    1226 +  hpux9* | hpux10* | hpux11*)
    1227 +    case "$host_os" in
    1228 +    hpux9*) archive_cmds='$rm $objdir/$soname~$LD -b +b $install_libdir -o $objdir/$soname $libobjs $deplibs $linkopts~test $objdir/$soname = $lib || mv $objdir/$soname $lib' ;;
    1229 +    *) archive_cmds='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linkopts' ;;
    1230 +    esac
    1231      hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir'
    1232 +    hardcode_libdir_separator=:
    1233      hardcode_direct=yes
    1234 -    hardcode_minus_L=yes
    1235 +    hardcode_minus_L=yes # Not in the search PATH, but as the default
    1236 +                        # location of the library.
    1237      export_dynamic_flag_spec='${wl}-E'
    1238      ;;
    1239  
    1240    irix5* | irix6*)
    1241 -    archive_cmds='$LD -shared -o $lib -soname $soname -set_version $verstring$libobjs'
    1242 +    if test "$with_gcc" = yes; then
    1243 +      archive_cmds='$CC -shared $libobjs $deplibs $linkopts ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${objdir}/so_locations -o $lib'
    1244 +    else
    1245 +      archive_cmds='$LD -shared $libobjs $deplibs $linkopts -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${objdir}/so_locations -o $lib'
    1246 +    fi
    1247      hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
    1248 +    hardcode_libdir_separator=:
    1249      ;;
    1250  
    1251    netbsd*)
    1252 -    # Tested with NetBSD 1.2 ld
    1253 -    archive_cmds='$LD -Bshareable -o $lib$libobjs'
    1254 -    hardcode_libdir_flag_spec='-R$libdir'
    1255 +    if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then
    1256 +      archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linkopts'  # a.out
    1257 +    else
    1258 +      archive_cmds='$LD -shared -o $lib $libobjs $deplibs $linkopts'      # ELF
    1259 +    fi
    1260 +    hardcode_libdir_flag_spec='${wl}-R$libdir'
    1261      hardcode_direct=yes
    1262      hardcode_shlibpath_var=no
    1263      ;;
    1264  
    1265    openbsd*)
    1266 -    archive_cmds='$LD -Bshareable -o $lib$libobjs'
    1267 +    archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linkopts'
    1268      hardcode_libdir_flag_spec='-R$libdir'
    1269      hardcode_direct=yes
    1270      hardcode_shlibpath_var=no
    1271 @@ -825,88 +1434,163 @@
    1272      hardcode_libdir_flag_spec='-L$libdir'
    1273      hardcode_minus_L=yes
    1274      allow_undefined_flag=unsupported
    1275 -    archive_cmds='$echo "LIBRARY $libname INITINSTANCE" > $objdir/$libname.def;$echo "DESCRIPTION \"$libname\"" >> $objdir/$libname.def;$echo DATA >> $objdir/$libname.def;$echo " SINGLE NONSHARED" >> $objdir/$libname.def;$echo EXPORTS >> $objdir/$libname.def;emxexp$libobjs >> $objdir/$libname.def;$CC -Zdll -Zcrtdll -o $lib$libobjs $objdir/$libname.def'
    1276 +    archive_cmds='$echo "LIBRARY $libname INITINSTANCE" > $objdir/$libname.def~$echo "DESCRIPTION \"$libname\"" >> $objdir/$libname.def~$echo DATA >> $objdir/$libname.def~$echo " SINGLE NONSHARED" >> $objdir/$libname.def~$echo EXPORTS >> $objdir/$libname.def~emxexp $libobjs >> $objdir/$libname.def~$CC -Zdll -Zcrtdll -o $lib $libobjs $deplibs $linkopts $objdir/$libname.def'
    1277      old_archive_from_new_cmds='emximp -o $objdir/$libname.a $objdir/$libname.def'
    1278      ;;
    1279  
    1280 -  osf3* | osf4*)
    1281 -    allow_undefined_flag=' -expect_unresolved \*'
    1282 -    archive_cmds='$LD -shared${allow_undefined_flag} -o $lib -soname $soname -set_version $verstring$libobjs$deplibs'
    1283 +  osf3*)
    1284 +    if test "$with_gcc" = yes; then
    1285 +      allow_undefined_flag=' ${wl}-expect_unresolved ${wl}\*'
    1286 +      archive_cmds='$CC -shared${allow_undefined_flag} $libobjs $deplibs $linkopts ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${objdir}/so_locations -o $lib'
    1287 +    else
    1288 +      allow_undefined_flag=' -expect_unresolved \*'
    1289 +      archive_cmds='$LD -shared${allow_undefined_flag} $libobjs $deplibs $linkopts -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${objdir}/so_locations -o $lib'
    1290 +    fi
    1291      hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
    1292      hardcode_libdir_separator=:
    1293      ;;
    1294  
    1295 +  osf4* | osf5*)  # As osf3* with the addition of the -msym flag
    1296 +    if test "$with_gcc" = yes; then
    1297 +      allow_undefined_flag=' ${wl}-expect_unresolved ${wl}\*'
    1298 +      archive_cmds='$CC -shared${allow_undefined_flag} $libobjs $deplibs $linkopts ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${objdir}/so_locations -o $lib'
    1299 +    else
    1300 +      allow_undefined_flag=' -expect_unresolved \*'
    1301 +      archive_cmds='$LD -shared${allow_undefined_flag} $libobjs $deplibs $linkopts -msym -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${objdir}/so_locations -o $lib'
    1302 +    fi
    1303 +    hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
    1304 +    hardcode_libdir_separator=:
    1305 +    ;;
    1306 +                                       
    1307    sco3.2v5*)
    1308 -    archive_cmds='$LD -G -o $lib$libobjs'
    1309 -    hardcode_direct=yes
    1310 +    archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linkopts'
    1311 +    hardcode_shlibpath_var=no
    1312 +    runpath_var=LD_RUN_PATH
    1313 +    hardcode_runpath_var=yes
    1314      ;;
    1315  
    1316 -  solaris2*)
    1317 +  solaris*)
    1318      no_undefined_flag=' -z text'
    1319 -    archive_cmds='$LD -G${allow_undefined_flag} -h $soname -o $lib$libobjs'
    1320 +    # $CC -shared without GNU ld will not create a library from C++
    1321 +    # object files and a static libstdc++, better avoid it by now
    1322 +    archive_cmds='$LD -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $linkopts'
    1323 +    archive_expsym_cmds='$echo "{ global:" > $lib.exp~cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~
    1324 +               $LD -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linkopts~$rm $lib.exp'
    1325      hardcode_libdir_flag_spec='-R$libdir'
    1326      hardcode_shlibpath_var=no
    1327 -
    1328 -    # Solaris 2 before 2.5 hardcodes -L paths.
    1329      case "$host_os" in
    1330 -    solaris2.[0-4]*)
    1331 -      hardcode_minus_L=yes
    1332 -      ;;
    1333 +    solaris2.[0-5] | solaris2.[0-5].*) ;;
    1334 +    *) # Supported since Solaris 2.6 (maybe 2.5.1?)
    1335 +      whole_archive_flag_spec='-z allextract$convenience -z defaultextract' ;;
    1336      esac
    1337      ;;
    1338  
    1339    sunos4*)
    1340 -    if test "$with_gcc" = yes; then
    1341 -      archive_cmds='$CC -shared -o $lib$libobjs'
    1342 -    else
    1343 -      archive_cmds='$LD -assert pure-text -Bstatic -o $lib$libobjs'
    1344 -    fi
    1345 -
    1346 -    if test "$with_gnu_ld" = yes; then
    1347 -      export_dynamic_flag_spec='${wl}-export-dynamic'
    1348 -    fi
    1349 +    archive_cmds='$LD -assert pure-text -Bstatic -o $lib $libobjs $deplibs $linkopts'
    1350      hardcode_libdir_flag_spec='-L$libdir'
    1351      hardcode_direct=yes
    1352      hardcode_minus_L=yes
    1353      hardcode_shlibpath_var=no
    1354      ;;
    1355  
    1356 -  uts4*)
    1357 -    archive_cmds='$LD -G -h $soname -o $lib$libobjs'
    1358 -    hardcode_libdir_flag_spec='-L$libdir'
    1359 -    hardcode_direct=no
    1360 -    hardcode_minus_L=no
    1361 +  sysv4)
    1362 +    if test "x$host_vendor" = xsequent; then
    1363 +      # Use $CC to link under sequent, because it throws in some extra .o
    1364 +      # files that make .init and .fini sections work.
    1365 +      archive_cmds='$CC -G ${wl}-h $soname -o $lib $libobjs $deplibs $linkopts'
    1366 +    else
    1367 +      archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linkopts'
    1368 +    fi
    1369 +    runpath_var='LD_RUN_PATH'
    1370 +    hardcode_shlibpath_var=no
    1371 +    hardcode_direct=no #Motorola manual says yes, but my tests say they lie
    1372 +    ;; 
    1373 +
    1374 +  sysv4.3*)
    1375 +    archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linkopts'
    1376 +    hardcode_shlibpath_var=no
    1377 +    export_dynamic_flag_spec='-Bexport'
    1378 +    ;;
    1379 +
    1380 +  sysv5*)
    1381 +    no_undefined_flag=' -z text'
    1382 +    # $CC -shared without GNU ld will not create a library from C++
    1383 +    # object files and a static libstdc++, better avoid it by now
    1384 +    archive_cmds='$LD -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $linkopts'
    1385 +    archive_expsym_cmds='$echo "{ global:" > $lib.exp~cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~
    1386 +               $LD -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linkopts~$rm $lib.exp'
    1387 +    hardcode_libdir_flag_spec=
    1388 +    hardcode_shlibpath_var=no
    1389 +    runpath_var='LD_RUN_PATH'
    1390 +    ;;
    1391 +
    1392 +  uts4*)
    1393 +    archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linkopts'
    1394 +    hardcode_libdir_flag_spec='-L$libdir'
    1395 +    hardcode_shlibpath_var=no
    1396 +    ;;
    1397 +
    1398 +  dgux*)
    1399 +    archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linkopts'
    1400 +    hardcode_libdir_flag_spec='-L$libdir'
    1401 +    hardcode_shlibpath_var=no
    1402 +    ;;
    1403 +
    1404 +  sysv4*MP*)
    1405 +    if test -d /usr/nec; then
    1406 +      archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linkopts'
    1407 +      hardcode_shlibpath_var=no
    1408 +      runpath_var=LD_RUN_PATH
    1409 +      hardcode_runpath_var=yes
    1410 +      ld_shlibs=yes
    1411 +    fi
    1412 +    ;;
    1413 +
    1414 +  sysv4.2uw2*)
    1415 +    archive_cmds='$LD -G -o $lib $libobjs $deplibs $linkopts'
    1416 +    hardcode_direct=yes
    1417 +    hardcode_minus_L=no
    1418 +    hardcode_shlibpath_var=no
    1419 +    hardcode_runpath_var=yes
    1420 +    runpath_var=LD_RUN_PATH
    1421 +    ;;
    1422 +
    1423 +  unixware7*)
    1424 +    archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linkopts'
    1425 +    runpath_var='LD_RUN_PATH'
    1426      hardcode_shlibpath_var=no
    1427      ;;
    1428  
    1429    *)
    1430      ld_shlibs=no
    1431 -    can_build_shared=no
    1432      ;;
    1433    esac
    1434  fi
    1435  echo "$ac_t$ld_shlibs" 1>&6
    1436 +test "$ld_shlibs" = no && can_build_shared=no
    1437  
    1438  if test -z "$NM"; then
    1439    echo $ac_n "checking for BSD-compatible nm... $ac_c" 1>&6
    1440    case "$NM" in
    1441 -  /* | [A-Za-z]:\\*) ;; # Let the user override the test with a path.
    1442 +  [\\/]* | [A-Za-z]:[\\/]*) ;; # Let the user override the test with a path.
    1443    *)
    1444 -    IFS="${IFS=        }"; ac_save_ifs="$IFS"; IFS="${IFS}:"
    1445 -    for ac_dir in /usr/ucb /usr/ccs/bin $PATH /bin; do
    1446 +    IFS="${IFS=        }"; ac_save_ifs="$IFS"; IFS="${IFS}${PATH_SEPARATOR}"
    1447 +    for ac_dir in $PATH /usr/ucb /usr/ccs/bin /bin; do
    1448        test -z "$ac_dir" && ac_dir=.
    1449 -      if test -f $ac_dir/nm; then
    1450 -        # Check to see if the nm accepts a BSD-compat flag.
    1451 -        # Adding the `sed 1q' prevents false positives on HP-UX, which says:
    1452 -        #   nm: unknown option "B" ignored
    1453 -        if ($ac_dir/nm -B /dev/null 2>&1 | sed '1q'; exit 0) | egrep /dev/null >/dev/null; then
    1454 -          NM="$ac_dir/nm -B"
    1455 -        elif ($ac_dir/nm -p /dev/null 2>&1 | sed '1q'; exit 0) | egrep /dev/null >/dev/null; then
    1456 -          NM="$ac_dir/nm -p"
    1457 +      if test -f $ac_dir/nm || test -f $ac_dir/nm$ac_exeext; then
    1458 +       # Check to see if the nm accepts a BSD-compat flag.
    1459 +       # Adding the `sed 1q' prevents false positives on HP-UX, which says:
    1460 +       #   nm: unknown option "B" ignored
    1461 +       if ($ac_dir/nm -B /dev/null 2>&1 | sed '1q'; exit 0) | egrep /dev/null >/dev/null; then
    1462 +         NM="$ac_dir/nm -B"
    1463 +         break
    1464 +       elif ($ac_dir/nm -p /dev/null 2>&1 | sed '1q'; exit 0) | egrep /dev/null >/dev/null; then
    1465 +         NM="$ac_dir/nm -p"
    1466 +         break
    1467         else
    1468 -          NM="$ac_dir/nm"
    1469 +         NM=${NM="$ac_dir/nm"} # keep the first match, but
    1470 +         continue # so that we can try to find one that supports BSD flags
    1471         fi
    1472 -        break
    1473        fi
    1474      done
    1475      IFS="$ac_save_ifs"
    1476 @@ -923,40 +1607,54 @@
    1477  # [They come from Ultrix.  What could be older than Ultrix?!! ;)]
    1478  
    1479  # Character class describing NM global symbol codes.
    1480 -symcode='[BCDEGRSTU]'
    1481 +symcode='[BCDEGRST]'
    1482  
    1483  # Regexp to match symbols that can be accessed directly from C.
    1484  sympat='\([_A-Za-z][_A-Za-z0-9]*\)'
    1485  
    1486  # Transform the above into a raw symbol and a C symbol.
    1487 -symxfrm='\1 \1'
    1488 +symxfrm='\1 \2\3 \3'
    1489 +
    1490 +# Transform an extracted symbol line into a proper C declaration
    1491 +global_symbol_to_cdecl="sed -n -e 's/^. .* \(.*\)$/extern char \1;/p'"
    1492  
    1493  # Define system-specific variables.
    1494  case "$host_os" in
    1495  aix*)
    1496 -  symcode='[BCDTU]'
    1497 +  symcode='[BCDT]'
    1498 +  ;;
    1499 +cygwin* | mingw*)
    1500 +  symcode='[ABCDGISTW]'
    1501 +  ;;
    1502 +hpux*) # Its linker distinguishes data from code symbols
    1503 +  global_symbol_to_cdecl="sed -n -e 's/^T .* \(.*\)$/extern char \1();/p' -e 's/^. .* \(.*\)$/extern char \1;/p'"
    1504    ;;
    1505  irix*)
    1506 -  # Cannot use undefined symbols on IRIX because inlined functions mess us up.
    1507    symcode='[BCDEGRST]'
    1508    ;;
    1509 -solaris2*)
    1510 -  symcode='[BDTU]'
    1511 +solaris*)
    1512 +  symcode='[BDT]'
    1513 +  ;;
    1514 +sysv4)
    1515 +  symcode='[DFNSTU]'
    1516    ;;
    1517  esac
    1518  
    1519  # If we're using GNU nm, then use its standard symbol codes.
    1520  if $NM -V 2>&1 | egrep '(GNU|with BFD)' > /dev/null; then
    1521 -  symcode='[ABCDGISTUW]'
    1522 +  symcode='[ABCDGISTW]'
    1523  fi
    1524  
    1525 -# Write the raw and C identifiers.
    1526 -global_symbol_pipe="sed -n -e 's/^.* $symcode $sympat$/$symxfrm/p'"
    1527 +# Try without a prefix undercore, then with it.
    1528 +for ac_symprfx in "" "_"; do
    1529  
    1530 -# Check to see that the pipe works correctly.
    1531 -pipe_works=no
    1532 -$rm conftest*
    1533 -cat > conftest.c <<EOF
    1534 +  # Write the raw and C identifiers.
    1535 +  global_symbol_pipe="sed -n -e 's/^.*[        ]\($symcode\)[  ][      ]*\($ac_symprfx\)$sympat$/$symxfrm/p'"
    1536 +
    1537 +  # Check to see that the pipe works correctly.
    1538 +  pipe_works=no
    1539 +  $rm conftest*
    1540 +  cat > conftest.c <<EOF
    1541  #ifdef __cplusplus
    1542  extern "C" {
    1543  #endif
    1544 @@ -968,93 +1666,100 @@
    1545  main(){nm_test_var='a';nm_test_func();return(0);}
    1546  EOF
    1547  
    1548 -echo "$progname:971: checking if global_symbol_pipe works" >&5
    1549 -if { (eval echo $progname:972: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; } && test -s conftest.o; then
    1550 -  # Now try to grab the symbols.
    1551 -  nlist=conftest.nm
    1552 -  if { echo "$progname:975: eval \"$NM conftest.o | $global_symbol_pipe > $nlist\"" >&5; eval "$NM conftest.o | $global_symbol_pipe > $nlist 2>&5"; } && test -s "$nlist"; then
    1553 -
    1554 -    # Try sorting and uniquifying the output.
    1555 -    if sort "$nlist" | uniq > "$nlist"T; then
    1556 -      mv -f "$nlist"T "$nlist"
    1557 -      wcout=`wc "$nlist" 2>/dev/null`
    1558 -      count=`$echo "X$wcout" | $Xsed -e 's/^[  ]*\([0-9][0-9]*\).*$/\1/'`
    1559 -      (test "$count" -ge 0) 2>/dev/null || count=-1
    1560 -    else
    1561 -      rm -f "$nlist"T
    1562 -      count=-1
    1563 -    fi
    1564 +  echo "$progname:1669: checking if global_symbol_pipe works" >&5
    1565 +  if { (eval echo $progname:1670: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; } && test -s conftest.$objext; then
    1566 +    # Now try to grab the symbols.
    1567 +    nlist=conftest.nm
    1568 +    if { echo "$progname:1673: eval \"$NM conftest.$objext | $global_symbol_pipe > $nlist\"" >&5; eval "$NM conftest.$objext | $global_symbol_pipe > $nlist 2>&5"; } && test -s "$nlist"; then
    1569 +
    1570 +      # Try sorting and uniquifying the output.
    1571 +      if sort "$nlist" | uniq > "$nlist"T; then
    1572 +       mv -f "$nlist"T "$nlist"
    1573 +      else
    1574 +       rm -f "$nlist"T
    1575 +      fi
    1576  
    1577 -    # Make sure that we snagged all the symbols we need.
    1578 -    if egrep ' nm_test_var$' "$nlist" >/dev/null; then
    1579 -      if egrep ' nm_test_func$' "$nlist" >/dev/null; then
    1580 -       cat <<EOF > conftest.c
    1581 +      # Make sure that we snagged all the symbols we need.
    1582 +      if egrep ' nm_test_var$' "$nlist" >/dev/null; then
    1583 +       if egrep ' nm_test_func$' "$nlist" >/dev/null; then
    1584 +         cat <<EOF > conftest.c
    1585  #ifdef __cplusplus
    1586  extern "C" {
    1587  #endif
    1588  
    1589  EOF
    1590 -        # Now generate the symbol file.
    1591 -        sed 's/^.* \(.*\)$/extern char \1;/' < "$nlist" >> conftest.c
    1592 +         # Now generate the symbol file.
    1593 +         eval "$global_symbol_to_cdecl"' < "$nlist" >> conftest.c'
    1594  
    1595 -       cat <<EOF >> conftest.c
    1596 +         cat <<EOF >> conftest.c
    1597  #if defined (__STDC__) && __STDC__
    1598 -# define __ptr_t void *
    1599 +# define lt_ptr_t void *
    1600  #else
    1601 -# define __ptr_t char *
    1602 +# define lt_ptr_t char *
    1603 +# define const
    1604  #endif
    1605  
    1606 -/* The number of symbols in dld_preloaded_symbols, -1 if unsorted. */
    1607 -int dld_preloaded_symbol_count = $count;
    1608 -
    1609  /* The mapping between symbol names and symbols. */
    1610 -struct {
    1611 -  char *name;
    1612 -  __ptr_t address;
    1613 +const struct {
    1614 +  const char *name;
    1615 +  lt_ptr_t address;
    1616  }
    1617 -dld_preloaded_symbols[] =
    1618 +lt_preloaded_symbols[] =
    1619  {
    1620  EOF
    1621 -        sed 's/^\(.*\) \(.*\)$/  {"\1", (__ptr_t) \&\2},/' < "$nlist" >> conftest.c
    1622 -        cat <<\EOF >> conftest.c
    1623 -  {0, (__ptr_t) 0}
    1624 +         sed 's/^. \(.*\) \(.*\)$/  {"\2", (lt_ptr_t) \&\2},/' < "$nlist" >> conftest.c
    1625 +         cat <<\EOF >> conftest.c
    1626 +  {0, (lt_ptr_t) 0}
    1627  };
    1628  
    1629  #ifdef __cplusplus
    1630  }
    1631  #endif
    1632  EOF
    1633 -        # Now try linking the two files.
    1634 -        mv conftest.o conftestm.o
    1635 -       save_LIBS="$LIBS"
    1636 -       save_CFLAGS="$CFLAGS"
    1637 -        LIBS='conftestm.o'
    1638 -       CFLAGS="$CFLAGS$no_builtin_flag"
    1639 -        if { (eval echo $progname:1033: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
    1640 -          pipe_works=yes
    1641 -        else
    1642 -          echo "$progname: failed program was:" >&5
    1643 -          cat conftest.c >&5
    1644 -        fi
    1645 -        LIBS="$save_LIBS"
    1646 +         # Now try linking the two files.
    1647 +         mv conftest.$objext conftstm.$objext
    1648 +         save_LIBS="$LIBS"
    1649 +         save_CFLAGS="$CFLAGS"
    1650 +         LIBS="conftstm.$objext"
    1651 +         CFLAGS="$CFLAGS$no_builtin_flag"
    1652 +         if { (eval echo $progname:1725: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
    1653 +           pipe_works=yes
    1654 +         else
    1655 +           echo "$progname: failed program was:" >&5
    1656 +           cat conftest.c >&5
    1657 +         fi
    1658 +         LIBS="$save_LIBS"
    1659 +       else
    1660 +         echo "cannot find nm_test_func in $nlist" >&5
    1661 +       fi
    1662        else
    1663 -        echo "cannot find nm_test_func in $nlist" >&5
    1664 +       echo "cannot find nm_test_var in $nlist" >&5
    1665        fi
    1666      else
    1667 -      echo "cannot find nm_test_var in $nlist" >&5
    1668 +      echo "cannot run $global_symbol_pipe" >&5
    1669      fi
    1670    else
    1671 -    echo "cannot run $global_symbol_pipe" >&5
    1672 +    echo "$progname: failed program was:" >&5
    1673 +    cat conftest.c >&5
    1674    fi
    1675 +  $rm conftest* conftst*
    1676 +
    1677 +  # Do not use the global_symbol_pipe unless it works.
    1678 +  if test "$pipe_works" = yes; then
    1679 +    break
    1680 +  else
    1681 +    global_symbol_pipe=
    1682 +  fi
    1683 +done
    1684 +if test "$pipe_works" = yes; then
    1685 +  echo "${ac_t}ok" 1>&6
    1686  else
    1687 -  echo "$progname: failed program was:" >&5
    1688 -  cat conftest.c >&5
    1689 +  echo "${ac_t}failed" 1>&6
    1690  fi
    1691 -$rm conftest*
    1692  
    1693 -# Do not use the global_symbol_pipe unless it works.
    1694 -echo "$ac_t$pipe_works" 1>&6
    1695 -test "$pipe_works" = yes || global_symbol_pipe=
    1696 +if test -z "$global_symbol_pipe"; then
    1697 +  global_symbol_to_cdecl=
    1698 +fi
    1699  
    1700  # Check hardcoding attributes.
    1701  echo $ac_n "checking how to hardcode library paths into programs... $ac_c" 1>&6
    1702 @@ -1063,35 +1768,32 @@
    1703     test -n "$runpath_var"; then
    1704  
    1705    # We can hardcode non-existant directories.
    1706 -  if test "$hardcode_direct" != no && \
    1707 -     test "$hardcode_minus_L" != no && \
    1708 -     test "$hardcode_shlibpath_var" != no; then
    1709 -
    1710 +  if test "$hardcode_direct" != no &&
    1711 +     # If the only mechanism to avoid hardcoding is shlibpath_var, we
    1712 +     # have to relink, otherwise we might link with an installed library
    1713 +     # when we should be linking with a yet-to-be-installed one
    1714 +     ## test "$hardcode_shlibpath_var" != no &&
    1715 +     test "$hardcode_minus_L" != no; then
    1716      # Linking always hardcodes the temporary library directory.
    1717      hardcode_action=relink
    1718    else
    1719      # We can link without hardcoding, and we can hardcode nonexisting dirs.
    1720      hardcode_action=immediate
    1721    fi
    1722 -elif test "$hardcode_direct" != yes && \
    1723 -     test "$hardcode_minus_L" != yes && \
    1724 -     test "$hardcode_shlibpath_var" != yes; then
    1725 -  # We cannot hardcode anything.
    1726 -  hardcode_action=unsupported
    1727  else
    1728 -  # We can only hardcode existing directories.
    1729 -  hardcode_action=relink
    1730 +  # We cannot hardcode anything, or else we can only hardcode existing
    1731 +  # directories.
    1732 +  hardcode_action=unsupported
    1733  fi
    1734  echo "$ac_t$hardcode_action" 1>&6
    1735 -test "$hardcode_action" = unsupported && can_build_shared=no
    1736  
    1737  
    1738  reload_flag=
    1739  reload_cmds='$LD$reload_flag -o $output$reload_objs'
    1740  echo $ac_n "checking for $LD option to reload object files... $ac_c" 1>&6
    1741 -# PORTME Some linker may need a different reload flag.
    1742 +# PORTME Some linkers may need a different reload flag.
    1743  reload_flag='-r'
    1744 -echo "$ac_t$reload_flag"
    1745 +echo "$ac_t$reload_flag" 1>&6
    1746  test -n "$reload_flag" && reload_flag=" $reload_flag"
    1747  
    1748  # PORTME Fill in your ld.so characteristics
    1749 @@ -1103,18 +1805,45 @@
    1750  finish_cmds=
    1751  finish_eval=
    1752  shlibpath_var=
    1753 +shlibpath_overrides_runpath=unknown
    1754  version_type=none
    1755  dynamic_linker="$host_os ld.so"
    1756 -
    1757 +sys_lib_dlsearch_path_spec="/lib /usr/lib"
    1758 +sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib"
    1759 +file_magic_cmd=
    1760 +file_magic_test_file=
    1761 +deplibs_check_method='unknown'
    1762 +# Need to set the preceding variable on all platforms that support
    1763 +# interlibrary dependencies.
    1764 +# 'none' -- dependencies not supported.
    1765 +# `unknown' -- same as none, but documents that we really don't know.
    1766 +# 'pass_all' -- all dependencies passed with no checks.
    1767 +# 'test_compile' -- check by making test program.
    1768 +# 'file_magic [regex]' -- check by looking for files in library path
    1769 +# which responds to the $file_magic_cmd with a given egrep regex.
    1770 +# If you have `file' or equivalent on your system and you're not sure
    1771 +# whether `pass_all' will *always* work, you probably want this one.
    1772  echo $ac_n "checking dynamic linker characteristics... $ac_c" 1>&6
    1773  case "$host_os" in
    1774 -aix3* | aix4*)
    1775 +aix3*)
    1776    version_type=linux
    1777 -  library_names_spec='${libname}${release}.so.$versuffix $libname.a'
    1778 +  library_names_spec='${libname}${release}.so$versuffix $libname.a'
    1779    shlibpath_var=LIBPATH
    1780  
    1781    # AIX has no versioning support, so we append a major version to the name.
    1782 -  soname_spec='${libname}${release}.so.$major'
    1783 +  soname_spec='${libname}${release}.so$major'
    1784 +  ;;
    1785 +
    1786 +aix4*)
    1787 +  version_type=linux
    1788 +  # AIX has no versioning support, so currently we can not hardcode correct
    1789 +  # soname into executable. Probably we can add versioning support to
    1790 +  # collect2, so additional links can be useful in future.
    1791 +  # We preserve .a as extension for shared libraries though AIX4.2
    1792 +  # and later linker supports .so
    1793 +  library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major $libname.a'
    1794 +  shlibpath_var=LIBPATH
    1795 +  deplibs_check_method=pass_all
    1796    ;;
    1797  
    1798  amigaos*)
    1799 @@ -1123,36 +1852,166 @@
    1800    finish_eval='for lib in `ls $libdir/*.ixlibrary 2>/dev/null`; do libname=`$echo "X$lib" | $Xsed -e '\''s%^.*/\([^/]*\)\.ixlibrary$%\1%'\''`; test $rm /sys/libs/${libname}_ixlibrary.a; $show "(cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a)"; (cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a) || exit 1; done'
    1801    ;;
    1802  
    1803 -freebsd2* | freebsd3*)
    1804 -  version_type=sunos
    1805 -  library_names_spec='${libname}${release}.so.$versuffix $libname.so'
    1806 -  finish_cmds='PATH="$PATH:/sbin" ldconfig -m $libdir'
    1807 +beos*)
    1808 +  library_names_spec='${libname}.so'
    1809 +  dynamic_linker="$host_os ld.so"
    1810 +  shlibpath_var=LIBRARY_PATH
    1811 +  deplibs_check_method=pass_all
    1812 +  lt_cv_dlopen="load_add_on"
    1813 +  lt_cv_dlopen_libs=
    1814 +  lt_cv_dlopen_self=yes
    1815 +  ;;
    1816 +
    1817 +bsdi4*)
    1818 +  version_type=linux
    1819 +  need_version=no
    1820 +  library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major $libname.so'
    1821 +  soname_spec='${libname}${release}.so$major'
    1822 +  finish_cmds='PATH="\$PATH:/sbin" ldconfig $libdir'
    1823    shlibpath_var=LD_LIBRARY_PATH
    1824 +  deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [ML]SB (shared object|dynamic lib)'
    1825 +  file_magic_cmd=/usr/bin/file
    1826 +  file_magic_test_file=/shlib/libc.so
    1827 +  sys_lib_search_path_spec="/shlib /usr/lib /usr/X11/lib /usr/contrib/lib /lib /usr/local/lib"
    1828 +  sys_lib_dlsearch_path_spec="/shlib /usr/lib /usr/local/lib"
    1829 +  export_dynamic_flag_spec=-rdynamic
    1830 +  # the default ld.so.conf also contains /usr/contrib/lib and
    1831 +  # /usr/X11R6/lib (/usr/X11 is a link to /usr/X11R6), but let us allow
    1832 +  # libtool to hard-code these into programs
    1833 +  ;;
    1834 +
    1835 +cygwin* | mingw*)
    1836 +  version_type=windows
    1837 +  need_version=no
    1838 +  need_lib_prefix=no
    1839 +  if test "$with_gcc" = yes; then
    1840 +    library_names_spec='${libname}`echo ${release} | sed -e 's/[.]/-/g'`${versuffix}.dll $libname.a'
    1841 +  else
    1842 +    library_names_spec='${libname}`echo ${release} | sed -e 's/[.]/-/g'`${versuffix}.dll $libname.lib'
    1843 +  fi
    1844 +  dynamic_linker='Win32 ld.exe'
    1845 +  deplibs_check_method='file_magic file format pei*-i386(.*architecture: i386)?'
    1846 +  file_magic_cmd='${OBJDUMP} -f'
    1847 +  # FIXME: first we should search . and the directory the executable is in
    1848 +  shlibpath_var=PATH
    1849 +  lt_cv_dlopen="LoadLibrary"
    1850 +  lt_cv_dlopen_libs=
    1851 +  ;;
    1852 +
    1853 +freebsd1*)
    1854 +  dynamic_linker=no
    1855 +  ;;
    1856 
    1857 +freebsd*)
    1858 +  objformat=`test -x /usr/bin/objformat && /usr/bin/objformat || echo aout`
    1859 +  version_type=freebsd-$objformat
    1860 +  case "$version_type" in
    1861 +    freebsd-elf*)
    1862 +      deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [LM]SB shared object'
    1863 +      file_magic_cmd=/usr/bin/file
    1864 +      file_magic_test_file=`echo /usr/lib/libc.so*`
    1865 +      library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so $libname.so'
    1866 +      need_version=no
    1867 +      need_lib_prefix=no
    1868 +      ;;
    1869 +    freebsd-*)
    1870 +      deplibs_check_method=unknown
    1871 +      library_names_spec='${libname}${release}.so$versuffix $libname.so$versuffix'
    1872 +      need_version=yes
    1873 +      ;;
    1874 +  esac
    1875 +  shlibpath_var=LD_LIBRARY_PATH
    1876 +  case "$host_os" in
    1877 +  freebsd2* | freebsd3.[01]* | freebsdelf3.[01]*)
    1878 +    shlibpath_overrides_runpath=yes
    1879 +    ;;
    1880 +  *) # from 3.2 on
    1881 +    shlibpath_overrides_runpath=no
    1882 +    ;;
    1883 +  esac
    1884 +  ;;
    1885 +
    1886 +darwin* | rhapsody*)
    1887 +  dynamic_linker="$host_os dyld"
    1888 +  version_type=darwin
    1889 +  need_lib_prefix=no
    1890 +  need_version=no
    1891 +  deplibs_check_method='file_magic Mach-O dynamically linked shared library'
    1892 +  file_magic_cmd='/usr/bin/file -L'
    1893 +  case "$host_os" in
    1894 +  rhapsody* | darwin1.[012])
    1895 +    file_magic_test_file='/System/Library/Frameworks/System.framework/System'
    1896 +    ;;
    1897 +  *) # Darwin 1.3 on
    1898 +    file_magic_test_file='/usr/lib/libSystem.dylib'
    1899 +    ;;
    1900 +  esac
    1901 +  library_names_spec='${libname}${release}${versuffix}.$(test .$module = .yes && echo so || echo dylib) ${libname}${release}${major}.$(test .$module = .yes && echo so || echo dylib) ${libname}.$(test .$module = .yes && echo so || echo dylib)'
    1902 +  soname_spec='${libname}${release}${major}.$(test .$module = .yes && echo so || echo dylib)'
    1903 +  shlibpath_overrides_runpath=yes
    1904 +  shlibpath_var=DYLD_LIBRARY_PATH
    1905    ;;
    1906  
    1907  gnu*)
    1908 -  version_type=sunos
    1909 -  library_names_spec='${libname}${release}.so.$versuffix'
    1910 +  version_type=linux
    1911 +  need_lib_prefix=no
    1912 +  need_version=no
    1913 +  library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so${major} ${libname}.so'
    1914 +  soname_spec='${libname}${release}.so$major'
    1915    shlibpath_var=LD_LIBRARY_PATH
    1916    ;;
    1917  
    1918 -hpux9* | hpux10*)
    1919 +hpux9* | hpux10* | hpux11*)
    1920    # Give a soname corresponding to the major version so that dld.sl refuses to
    1921    # link against other versions.
    1922    dynamic_linker="$host_os dld.sl"
    1923    version_type=sunos
    1924 +  need_lib_prefix=no
    1925 +  need_version=no
    1926    shlibpath_var=SHLIB_PATH
    1927 -  library_names_spec='${libname}${release}.sl.$versuffix ${libname}${release}.sl.$major $libname.sl'
    1928 -  soname_spec='${libname}${release}.sl.$major'
    1929 +  shlibpath_overrides_runpath=no # +s is required to enable SHLIB_PATH
    1930 +  library_names_spec='${libname}${release}.sl$versuffix ${libname}${release}.sl$major $libname.sl'
    1931 +  soname_spec='${libname}${release}.sl$major'
    1932    # HP-UX runs *really* slowly unless shared libraries are mode 555.
    1933    postinstall_cmds='chmod 555 $lib'
    1934 +  case "$host_os" in
    1935 +  hpux10.20*)
    1936 +    # TODO:  Does this work for hpux-11 too?
    1937 +    deplibs_check_method='file_magic (s[0-9][0-9][0-9]|PA-RISC[0-9].[0-9]) shared library'
    1938 +    file_magic_cmd=/usr/bin/file
    1939 +    file_magic_test_file=/usr/lib/libc.sl
    1940 +    ;;
    1941 +  esac
    1942    ;;
    1943  
    1944  irix5* | irix6*)
    1945 -  version_type=osf
    1946 -  soname_spec='${libname}${release}.so'
    1947 -  library_names_spec='${libname}${release}.so.$versuffix $libname.so'
    1948 -  shlibpath_var=LD_LIBRARY_PATH
    1949 +  version_type=irix
    1950 +  need_lib_prefix=no
    1951 +  need_version=no
    1952 +  soname_spec='${libname}${release}.so.$major'
    1953 +  library_names_spec='${libname}${release}.so.$versuffix ${libname}${release}.so.$major ${libname}${release}.so $libname.so'
    1954 +  case "$host_os" in
    1955 +  irix5*)
    1956 +    libsuff= shlibsuff=
    1957 +    # this will be overridden with pass_all, but let us keep it just in case
    1958 +    deplibs_check_method="file_magic ELF 32-bit MSB dynamic lib MIPS - version 1"
    1959 +    ;;
    1960 +  *)
    1961 +    case "$LD" in # libtool.m4 will add one of these switches to LD
    1962 +    *-32|*"-32 ") libsuff= shlibsuff= libmagic=32-bit;;
    1963 +    *-n32|*"-n32 ") libsuff=32 shlibsuff=N32 libmagic=N32;;
    1964 +    *-64|*"-64 ") libsuff=64 shlibsuff=64 libmagic=64-bit;;
    1965 +    *) libsuff= shlibsuff= libmagic=never-match;;
    1966 +    esac
    1967 +    ;;
    1968 +  esac
    1969 +  shlibpath_var=LD_LIBRARY${shlibsuff}_PATH
    1970 +  shlibpath_overrides_runpath=no
    1971 +  sys_lib_search_path_spec="/usr/lib${libsuff} /lib${libsuff} /usr/local/lib${libsuff}"
    1972 +  sys_lib_dlsearch_path_spec="/usr/lib${libsuff} /lib${libsuff}"
    1973 +  file_magic_cmd=/usr/bin/file
    1974 +  file_magic_test_file=`echo /lib${libsuff}/libc.so*`
    1975 +  deplibs_check_method='pass_all'
    1976    ;;
    1977  
    1978  # No shared lib support for Linux oldld, aout, or coff.
    1979 @@ -1163,10 +2022,14 @@
    1980  # This must be Linux ELF.
    1981  linux-gnu*)
    1982    version_type=linux
    1983 -  library_names_spec='${libname}${release}.so.$versuffix ${libname}${release}.so.$major $libname.so'
    1984 -  soname_spec='${libname}${release}.so.$major'
    1985 -  finish_cmds='PATH="$PATH:/sbin" ldconfig -n $libdir'
    1986 +  need_lib_prefix=no
    1987 +  need_version=no
    1988 +  library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major $libname.so'
    1989 +  soname_spec='${libname}${release}.so$major'
    1990 +  finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir'
    1991    shlibpath_var=LD_LIBRARY_PATH
    1992 +  shlibpath_overrides_runpath=no
    1993 +  deplibs_check_method=pass_all
    1994  
    1995    if test -f /lib/ld.so.1; then
    1996      dynamic_linker='GNU ld.so'
    1997 @@ -1179,85 +2042,200 @@
    1998    fi
    1999    ;;
    2000  
    2001 -netbsd* | openbsd*)
    2002 +netbsd*)
    2003 +  version_type=sunos
    2004 +  if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then
    2005 +    library_names_spec='${libname}${release}.so$versuffix ${libname}.so$versuffix'
    2006 +    finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir'
    2007 +    dynamic_linker='NetBSD (a.out) ld.so'
    2008 +  else
    2009 +    library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major ${libname}${release}.so ${libname}.so'
    2010 +    soname_spec='${libname}${release}.so$major'
    2011 +    dynamic_linker='NetBSD ld.elf_so'
    2012 +  fi
    2013 +  shlibpath_var=LD_LIBRARY_PATH
    2014 +  ;;
    2015 +
    2016 +openbsd*)
    2017    version_type=sunos
    2018 -  library_names_spec='${libname}${release}.so.$versuffix'
    2019 -  finish_cmds='PATH="$PATH:/sbin" ldconfig -m $libdir'
    2020 +  if test "$with_gnu_ld" = yes; then
    2021 +    need_lib_prefix=no
    2022 +    need_version=no
    2023 +  fi
    2024 +  library_names_spec='${libname}${release}.so$versuffix ${libname}.so$versuffix'
    2025 +  finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir'
    2026    shlibpath_var=LD_LIBRARY_PATH
    2027    ;;
    2028  
    2029  os2*)
    2030    libname_spec='$name'
    2031 +  need_lib_prefix=no
    2032    library_names_spec='$libname.dll $libname.a'
    2033    dynamic_linker='OS/2 ld.exe'
    2034    shlibpath_var=LIBPATH
    2035    ;;
    2036  
    2037 -osf3* | osf4*)
    2038 +osf3* | osf4* | osf5*)
    2039    version_type=osf
    2040 +  need_version=no
    2041    soname_spec='${libname}${release}.so'
    2042 -  library_names_spec='${libname}${release}.so.$versuffix $libname.so'
    2043 +  library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so $libname.so'
    2044    shlibpath_var=LD_LIBRARY_PATH
    2045 +  # this will be overridden with pass_all, but let us keep it just in case
    2046 +  deplibs_check_method='file_magic COFF format alpha shared library'
    2047 +  file_magic_cmd=/usr/bin/file
    2048 +  file_magic_test_file=/shlib/libc.so
    2049 +  deplibs_check_method='pass_all'
    2050 +  sys_lib_search_path_spec="/usr/shlib /usr/ccs/lib /usr/lib/cmplrs/cc /usr/lib /usr/local/lib /var/shlib"
    2051 +  sys_lib_dlsearch_path_spec="$sys_lib_search_path_spec"
    2052    ;;
    2053  
    2054  sco3.2v5*)
    2055    version_type=osf
    2056 -  soname_spec='${libname}${release}.so.$major'
    2057 -  library_names_spec='${libname}${release}.so.$versuffix ${libname}${release}.so.$major $libname.so'
    2058 +  soname_spec='${libname}${release}.so$major'
    2059 +  library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major $libname.so'
    2060    shlibpath_var=LD_LIBRARY_PATH
    2061    ;;
    2062  
    2063 -solaris2*)
    2064 +solaris*)
    2065    version_type=linux
    2066 -  library_names_spec='${libname}${release}.so.$versuffix ${libname}${release}.so.$major $libname.so'
    2067 -  soname_spec='${libname}${release}.so.$major'
    2068 +  need_lib_prefix=no
    2069 +  need_version=no
    2070 +  library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major $libname.so'
    2071 +  soname_spec='${libname}${release}.so$major'
    2072    shlibpath_var=LD_LIBRARY_PATH
    2073 +  shlibpath_overrides_runpath=yes
    2074 +  # ldd complains unless libraries are executable
    2075 +  postinstall_cmds='chmod +x $lib'
    2076 +  deplibs_check_method="file_magic ELF [0-9][0-9]-bit [LM]SB dynamic lib"
    2077 +  file_magic_cmd=/usr/bin/file
    2078 +  file_magic_test_file=/lib/libc.so
    2079    ;;
    2080  
    2081  sunos4*)
    2082    version_type=sunos
    2083 -  library_names_spec='${libname}${release}.so.$versuffix'
    2084 -  finish_cmds='PATH="$PATH:/usr/etc" ldconfig $libdir'
    2085 +  library_names_spec='${libname}${release}.so$versuffix ${libname}.so$versuffix'
    2086 +  finish_cmds='PATH="\$PATH:/usr/etc" ldconfig $libdir'
    2087    shlibpath_var=LD_LIBRARY_PATH
    2088 +  shlibpath_overrides_runpath=yes
    2089 +  if test "$with_gnu_ld" = yes; then
    2090 +    need_lib_prefix=no
    2091 +  fi
    2092 +  need_version=yes
    2093    ;;
    2094  
    2095 -sysv4.2uw2*)
    2096 +sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*)
    2097    version_type=linux
    2098 -  library_names_spec='${libname}${release}.so.$versuffix ${libname}${release}.so.$major $libname.so'
    2099 -  soname_spec='${libname}${release}.so.$major'
    2100 +  library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major $libname.so'
    2101 +  soname_spec='${libname}${release}.so$major'
    2102    shlibpath_var=LD_LIBRARY_PATH
    2103 +  case "$host_vendor" in
    2104 +    sequent)
    2105 +      file_magic_cmd='/bin/file'
    2106 +      deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [LM]SB (shared object|dynamic lib )'
    2107 +      ;;
    2108 +    ncr)
    2109 +      deplibs_check_method='pass_all'
    2110 +      ;;
    2111 +    motorola)
    2112 +      need_lib_prefix=no
    2113 +      need_version=no
    2114 +      shlibpath_overrides_runpath=no
    2115 +      sys_lib_search_path_spec='/lib /usr/lib /usr/ccs/lib'
    2116 +      deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [ML]SB (shared object|dynamic lib) M[0-9][0-9]* Version [0-9]'
    2117 +      file_magic_cmd=/usr/bin/file
    2118 +      file_magic_test_file=`echo /usr/lib/libc.so*`
    2119 +      ;;
    2120 +  esac
    2121    ;;
    2122  
    2123  uts4*)
    2124    version_type=linux
    2125 -  library_names_spec='${libname}${release}.so.$versuffix ${libname}${release}.so.$major $libname.so'
    2126 -  soname_spec='${libname}${release}.so.$major'
    2127 +  library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major $libname.so'
    2128 +  soname_spec='${libname}${release}.so$major'
    2129 +  shlibpath_var=LD_LIBRARY_PATH
    2130 +  ;;
    2131 +
    2132 +dgux*)
    2133 +  version_type=linux
    2134 +  need_lib_prefix=no
    2135 +  need_version=no
    2136 +  library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major $libname.so'
    2137 +  soname_spec='${libname}${release}.so$major'
    2138    shlibpath_var=LD_LIBRARY_PATH
    2139    ;;
    2140  
    2141 +sysv4*MP*)
    2142 +  if test -d /usr/nec ;then
    2143 +    version_type=linux
    2144 +    library_names_spec='$libname.so.$versuffix $libname.so.$major $libname.so'
    2145 +    soname_spec='$libname.so.$major'
    2146 +    shlibpath_var=LD_LIBRARY_PATH
    2147 +  fi
    2148 +  ;;
    2149 +
    2150  *)
    2151    dynamic_linker=no
    2152    ;;
    2153  esac
    2154 -echo "$ac_t$dynamic_linker"
    2155 +echo "$ac_t$dynamic_linker" 1>&6
    2156  test "$dynamic_linker" = no && can_build_shared=no
    2157  
    2158  # Report the final consequences.
    2159  echo "checking if libtool supports shared libraries... $can_build_shared" 1>&6
    2160  
    2161 +# Only try to build win32 dlls if AC_LIBTOOL_WIN32_DLL was used in
    2162 +# configure.in, otherwise build static only libraries.
    2163 +case "$host_os" in
    2164 +cygwin* | mingw* | os2*)
    2165 +  if test x$can_build_shared = xyes; then
    2166 +    test x$enable_win32_dll = xno && can_build_shared=no
    2167 +    echo "checking if package supports dlls... $can_build_shared" 1>&6
    2168 +  fi
    2169 +;;
    2170 +esac
    2171 +
    2172 +if test -n "$file_magic_test_file" && test -n "$file_magic_cmd"; then
    2173 +  case "$deplibs_check_method" in
    2174 +  "file_magic "*)
    2175 +    file_magic_regex="`expr \"$deplibs_check_method\" : \"file_magic \(.*\)\"`"
    2176 +    if eval $file_magic_cmd \$file_magic_test_file 2> /dev/null |
    2177 +       egrep "$file_magic_regex" > /dev/null; then
    2178 +      :
    2179 +    else
    2180 +      cat <<EOF 1>&2
    2181 +
    2182 +*** Warning: the command libtool uses to detect shared libraries,
    2183 +*** $file_magic_cmd, produces output that libtool cannot recognize.
    2184 +*** The result is that libtool may fail to recognize shared libraries
    2185 +*** as such.  This will affect the creation of libtool libraries that
    2186 +*** depend on shared libraries, but programs linked with such libtool
    2187 +*** libraries will work regardless of this problem.  Nevertheless, you
    2188 +*** may want to report the problem to your system manager and/or to
    2189 +*** bug-libtool@gnu.org
    2190 +
    2191 +EOF
    2192 +    fi ;;
    2193 +  esac
    2194 +fi
    2195 +
    2196  echo $ac_n "checking whether to build shared libraries... $ac_c" 1>&6
    2197  test "$can_build_shared" = "no" && enable_shared=no
    2198  
    2199  # On AIX, shared libraries and static libraries use the same namespace, and
    2200  # are all built from PIC.
    2201  case "$host_os" in
    2202 -aix*)
    2203 +aix3*)
    2204    test "$enable_shared" = yes && enable_static=no
    2205    if test -n "$RANLIB"; then
    2206 -    archive_cmds="$archive_cmds;\$RANLIB \$lib"
    2207 +    archive_cmds="$archive_cmds~\$RANLIB \$lib"
    2208      postinstall_cmds='$RANLIB $lib'
    2209    fi
    2210    ;;
    2211 +
    2212 +aix4*)
    2213 +  test "$enable_shared" = yes && enable_static=no
    2214 +  ;;
    2215  esac
    2216  
    2217  echo "$ac_t$enable_shared" 1>&6
    2218 @@ -1267,6 +2245,15 @@
    2219  
    2220  echo "checking whether to build static libraries... $enable_static" 1>&6
    2221  
    2222 +if test "$hardcode_action" = relink; then
    2223 +  # Fast installation is not supported
    2224 +  enable_fast_install=no
    2225 +elif test "$shlibpath_overrides_runpath" = yes ||
    2226 +     test "$enable_shared" = no; then
    2227 +  # Fast installation is not necessary
    2228 +  enable_fast_install=needless
    2229 +fi
    2230 +
    2231  echo $ac_n "checking for objdir... $ac_c" 1>&6
    2232  rm -f .libs 2>/dev/null
    2233  mkdir .libs 2>/dev/null
    2234 @@ -1279,47 +2266,512 @@
    2235  rmdir .libs 2>/dev/null
    2236  echo "$ac_t$objdir" 1>&6
    2237  
    2238 +if test "x$enable_dlopen" != xyes; then
    2239 +  enable_dlopen=unknown
    2240 +  enable_dlopen_self=unknown
    2241 +  enable_dlopen_self_static=unknown
    2242 +else
    2243 +if eval "test \"`echo '$''{'lt_cv_dlopen'+set}'`\" != set"; then
    2244 +  lt_cv_dlopen=no lt_cv_dlopen_libs=
    2245 +echo $ac_n "checking for dlopen in -ldl""... $ac_c" 1>&6
    2246 +echo "$progname:2277: checking for dlopen in -ldl" >&5
    2247 +ac_lib_var=`echo dl'_'dlopen | sed 'y%./+-%__p_%'`
    2248 +if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
    2249 +  echo $ac_n "(cached) $ac_c" 1>&6
    2250 +else
    2251 +  ac_save_LIBS="$LIBS"
    2252 +LIBS="-ldl  $LIBS"
    2253 +cat > conftest.$ac_ext <<EOF
    2254 +#line 2285 "ltconfig"
    2255 +/* Override any gcc2 internal prototype to avoid an error.  */
    2256 +/* We use char because int might match the return type of a gcc2
    2257 +    builtin and then its argument prototype would still apply.  */
    2258 +#ifdef __cplusplus
    2259 +extern "C"
    2260 +#endif
    2261 +char dlopen();
    2262 +
    2263 +int main() {
    2264 +dlopen()
    2265 +; return 0; }
    2266 +EOF
    2267 +if { (eval echo $progname:2298: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
    2268 +  rm -rf conftest*
    2269 +  eval "ac_cv_lib_$ac_lib_var=yes"
    2270 +else
    2271 +  echo "$progname: failed program was:" >&5
    2272 +  cat conftest.$ac_ext >&5
    2273 +  rm -rf conftest*
    2274 +  eval "ac_cv_lib_$ac_lib_var=no"
    2275 +fi
    2276 +rm -f conftest*
    2277 +LIBS="$ac_save_LIBS"
    2278 +
    2279 +fi
    2280 +if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
    2281 +  echo "$ac_t""yes" 1>&6
    2282 +  lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl"
    2283 +else
    2284 +  echo "$ac_t""no" 1>&6
    2285 +echo $ac_n "checking for dlopen""... $ac_c" 1>&6
    2286 +echo "$progname:2317: checking for dlopen" >&5
    2287 +if eval "test \"`echo '$''{'ac_cv_func_dlopen'+set}'`\" = set"; then
    2288 +  echo $ac_n "(cached) $ac_c" 1>&6
    2289 +else
    2290 +  cat > conftest.$ac_ext <<EOF
    2291 +#line 2322 "ltconfig"
    2292 +/* System header to define __stub macros and hopefully few prototypes,
    2293 +    which can conflict with char dlopen(); below.  */
    2294 +#include <assert.h>
    2295 +/* Override any gcc2 internal prototype to avoid an error.  */
    2296 +/* We use char because int might match the return type of a gcc2
    2297 +    builtin and then its argument prototype would still apply.  */
    2298 +#ifdef __cplusplus
    2299 +extern "C"
    2300 +#endif
    2301 +char dlopen();
    2302 +
    2303 +int main() {
    2304 +
    2305 +/* The GNU C library defines this for functions which it implements
    2306 +    to always fail with ENOSYS.  Some functions are actually named
    2307 +    something starting with __ and the normal name is an alias.  */
    2308 +#if defined (__stub_dlopen) || defined (__stub___dlopen)
    2309 +choke me
    2310 +#else
    2311 +dlopen();
    2312 +#endif
    2313 +
    2314 +; return 0; }
    2315 +EOF
    2316 +if { (eval echo $progname:2347: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
    2317 +  rm -rf conftest*
    2318 +  eval "ac_cv_func_dlopen=yes"
    2319 +else
    2320 +  echo "$progname: failed program was:" >&5
    2321 +  cat conftest.$ac_ext >&5
    2322 +  rm -rf conftest*
    2323 +  eval "ac_cv_func_dlopen=no"
    2324 +fi
    2325 +rm -f conftest*
    2326 +fi
    2327 +if eval "test \"`echo '$ac_cv_func_'dlopen`\" = yes"; then
    2328 +  echo "$ac_t""yes" 1>&6
    2329 +  lt_cv_dlopen="dlopen"
    2330 +else
    2331 +  echo "$ac_t""no" 1>&6
    2332 +echo $ac_n "checking for dld_link in -ldld""... $ac_c" 1>&6
    2333 +echo "$progname:2364: checking for dld_link in -ldld" >&5
    2334 +ac_lib_var=`echo dld'_'dld_link | sed 'y%./+-%__p_%'`
    2335 +if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
    2336 +  echo $ac_n "(cached) $ac_c" 1>&6
    2337 +else
    2338 +  ac_save_LIBS="$LIBS"
    2339 +LIBS="-ldld  $LIBS"
    2340 +cat > conftest.$ac_ext <<EOF
    2341 +#line 2372 "ltconfig"
    2342 +/* Override any gcc2 internal prototype to avoid an error.  */
    2343 +/* We use char because int might match the return type of a gcc2
    2344 +    builtin and then its argument prototype would still apply.  */
    2345 +#ifdef __cplusplus
    2346 +extern "C"
    2347 +#endif
    2348 +char dld_link();
    2349 +
    2350 +int main() {
    2351 +dld_link()
    2352 +; return 0; }
    2353 +EOF
    2354 +if { (eval echo $progname:2385: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
    2355 +  rm -rf conftest*
    2356 +  eval "ac_cv_lib_$ac_lib_var=yes"
    2357 +else
    2358 +  echo "$progname: failed program was:" >&5
    2359 +  cat conftest.$ac_ext >&5
    2360 +  rm -rf conftest*
    2361 +  eval "ac_cv_lib_$ac_lib_var=no"
    2362 +fi
    2363 +rm -f conftest*
    2364 +LIBS="$ac_save_LIBS"
    2365 +
    2366 +fi
    2367 +if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
    2368 +  echo "$ac_t""yes" 1>&6
    2369 +  lt_cv_dlopen="dld_link" lt_cv_dlopen_libs="-ldld"
    2370 +else
    2371 +  echo "$ac_t""no" 1>&6
    2372 +echo $ac_n "checking for shl_load""... $ac_c" 1>&6
    2373 +echo "$progname:2404: checking for shl_load" >&5
    2374 +if eval "test \"`echo '$''{'ac_cv_func_shl_load'+set}'`\" = set"; then
    2375 +  echo $ac_n "(cached) $ac_c" 1>&6
    2376 +else
    2377 +  cat > conftest.$ac_ext <<EOF
    2378 +#line 2409 "ltconfig"
    2379 +/* System header to define __stub macros and hopefully few prototypes,
    2380 +    which can conflict with char shl_load(); below.  */
    2381 +#include <assert.h>
    2382 +/* Override any gcc2 internal prototype to avoid an error.  */
    2383 +/* We use char because int might match the return type of a gcc2
    2384 +    builtin and then its argument prototype would still apply.  */
    2385 +#ifdef __cplusplus
    2386 +extern "C"
    2387 +#endif
    2388 +char shl_load();
    2389 +
    2390 +int main() {
    2391 +
    2392 +/* The GNU C library defines this for functions which it implements
    2393 +    to always fail with ENOSYS.  Some functions are actually named
    2394 +    something starting with __ and the normal name is an alias.  */
    2395 +#if defined (__stub_shl_load) || defined (__stub___shl_load)
    2396 +choke me
    2397 +#else
    2398 +shl_load();
    2399 +#endif
    2400 +
    2401 +; return 0; }
    2402 +EOF
    2403 +if { (eval echo $progname:2434: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
    2404 +  rm -rf conftest*
    2405 +  eval "ac_cv_func_shl_load=yes"
    2406 +else
    2407 +  echo "$progname: failed program was:" >&5
    2408 +  cat conftest.$ac_ext >&5
    2409 +  rm -rf conftest*
    2410 +  eval "ac_cv_func_shl_load=no"
    2411 +fi
    2412 +rm -f conftest*
    2413 +fi
    2414 +
    2415 +if eval "test \"`echo '$ac_cv_func_'shl_load`\" = yes"; then
    2416 +  echo "$ac_t""yes" 1>&6
    2417 +  lt_cv_dlopen="shl_load"
    2418 +else
    2419 +  echo "$ac_t""no" 1>&6
    2420 +echo $ac_n "checking for shl_load in -ldld""... $ac_c" 1>&6
    2421 +echo "$progname:2452: checking for shl_load in -ldld" >&5
    2422 +ac_lib_var=`echo dld'_'shl_load | sed 'y%./+-%__p_%'`
    2423 +if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
    2424 +  echo $ac_n "(cached) $ac_c" 1>&6
    2425 +else
    2426 +  ac_save_LIBS="$LIBS"
    2427 +LIBS="-ldld  $LIBS"
    2428 +cat > conftest.$ac_ext <<EOF
    2429 +#line 2460 "ltconfig"
    2430 +#include "confdefs.h"
    2431 +/* Override any gcc2 internal prototype to avoid an error.  */
    2432 +/* We use char because int might match the return type of a gcc2
    2433 +    builtin and then its argument prototype would still apply.  */
    2434 +#ifdef __cplusplus
    2435 +extern "C"
    2436 +#endif
    2437 +char shl_load();
    2438 +
    2439 +int main() {
    2440 +shl_load()
    2441 +; return 0; }
    2442 +EOF
    2443 +if { (eval echo $progname:2474: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
    2444 +  rm -rf conftest*
    2445 +  eval "ac_cv_lib_$ac_lib_var=yes"
    2446 +else
    2447 +  echo "$progname: failed program was:" >&5
    2448 +  cat conftest.$ac_ext >&5
    2449 +  rm -rf conftest*
    2450 +  eval "ac_cv_lib_$ac_lib_var=no"
    2451 +fi
    2452 +rm -f conftest*
    2453 +LIBS="$ac_save_LIBS"
    2454 +
    2455 +fi
    2456 +if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
    2457 +  echo "$ac_t""yes" 1>&6
    2458 +  lt_cv_dlopen="shl_load" lt_cv_dlopen_libs="-ldld"
    2459 +else
    2460 +  echo "$ac_t""no" 1>&6
    2461 +fi
    2462 +
    2463 +
    2464 +fi
    2465 +
    2466 +   
    2467 +fi
    2468 +
    2469 
    2470 +fi
    2471 +
    2472 +
    2473 +fi
    2474 +
    2475 +fi
    2476 +
    2477 +  if test "x$lt_cv_dlopen" != xno; then
    2478 +    enable_dlopen=yes
    2479 +  fi
    2480 +
    2481 +  case "$lt_cv_dlopen" in
    2482 +  dlopen)
    2483 +for ac_hdr in dlfcn.h; do
    2484 +ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
    2485 +echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
    2486 +echo "$progname:2517: checking for $ac_hdr" >&5
    2487 +if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
    2488 +  echo $ac_n "(cached) $ac_c" 1>&6
    2489 +else
    2490 +  cat > conftest.$ac_ext <<EOF
    2491 +#line 2522 "ltconfig"
    2492 +#include <$ac_hdr>
    2493 +int fnord = 0;
    2494 +EOF
    2495 +ac_try="$ac_compile >/dev/null 2>conftest.out"
    2496 +{ (eval echo $progname:2527: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
    2497 +ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
    2498 +if test -z "$ac_err"; then
    2499 +  rm -rf conftest*
    2500 +  eval "ac_cv_header_$ac_safe=yes"
    2501 +else
    2502 +  echo "$ac_err" >&5
    2503 +  echo "$progname: failed program was:" >&5
    2504 +  cat conftest.$ac_ext >&5
    2505 +  rm -rf conftest*
    2506 +  eval "ac_cv_header_$ac_safe=no"
    2507 +fi
    2508 +rm -f conftest*
    2509 +fi
    2510 +if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
    2511 +  echo "$ac_t""yes" 1>&6
    2512 +else
    2513 +  echo "$ac_t""no" 1>&6
    2514 +fi
    2515 +done
    2516 +
    2517 +    if test "x$ac_cv_header_dlfcn_h" = xyes; then
    2518 +      CPPFLAGS="$CPPFLAGS -DHAVE_DLFCN_H"
    2519 +    fi
    2520 +    eval LDFLAGS=\"\$LDFLAGS $export_dynamic_flag_spec\"
    2521 +    LIBS="$lt_cv_dlopen_libs $LIBS"
    2522 +
    2523 +  echo $ac_n "checking whether a program can dlopen itself""... $ac_c" 1>&6
    2524 +echo "$progname:2555: checking whether a program can dlopen itself" >&5
    2525 +if test "${lt_cv_dlopen_self+set}" = set; then
    2526 +  echo $ac_n "(cached) $ac_c" 1>&6
    2527 +else
    2528 +  if test "$cross_compiling" = yes; then
    2529 +    lt_cv_dlopen_self=cross
    2530 +  else
    2531 +    cat > conftest.c <<EOF
    2532 +#line 2563 "ltconfig"
    2533 +
    2534 +#if HAVE_DLFCN_H
    2535 +#include <dlfcn.h>
    2536 +#endif
    2537 +
    2538 +#include <stdio.h>
    2539 +
    2540 +#ifdef RTLD_GLOBAL
    2541 +# define LTDL_GLOBAL   RTLD_GLOBAL
    2542 +#else
    2543 +# ifdef DL_GLOBAL
    2544 +#  define LTDL_GLOBAL  DL_GLOBAL
    2545 +# else
    2546 +#  define LTDL_GLOBAL  0
    2547 +# endif
    2548 +#endif
    2549 +
    2550 +/* We may have to define LTDL_LAZY_OR_NOW in the command line if we
    2551 +   find out it does not work in some platform. */
    2552 +#ifndef LTDL_LAZY_OR_NOW
    2553 +# ifdef RTLD_LAZY
    2554 +#  define LTDL_LAZY_OR_NOW     RTLD_LAZY
    2555 +# else
    2556 +#  ifdef DL_LAZY
    2557 +#   define LTDL_LAZY_OR_NOW    DL_LAZY
    2558 +#  else
    2559 +#   ifdef RTLD_NOW
    2560 +#    define LTDL_LAZY_OR_NOW   RTLD_NOW
    2561 +#   else
    2562 +#    ifdef DL_NOW
    2563 +#     define LTDL_LAZY_OR_NOW  DL_NOW
    2564 +#    else
    2565 +#     define LTDL_LAZY_OR_NOW  0
    2566 +#    endif
    2567 +#   endif
    2568 +#  endif
    2569 +# endif
    2570 +#endif
    2571 +
    2572 +fnord() { int i=42;}
    2573 +main() { void *self, *ptr1, *ptr2; self=dlopen(0,LTDL_GLOBAL|LTDL_LAZY_OR_NOW);
    2574 +    if(self) { ptr1=dlsym(self,"fnord"); ptr2=dlsym(self,"_fnord");
    2575 +              if(ptr1 || ptr2) { dlclose(self); exit(0); } } exit(1); }
    2576 +
    2577 +EOF
    2578 +if { (eval echo $progname:2609: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null
    2579 +then
    2580 +  lt_cv_dlopen_self=yes
    2581 +else
    2582 +  echo "$progname: failed program was:" >&5
    2583 +  cat conftest.$ac_ext >&5
    2584 +  rm -fr conftest*
    2585 +  lt_cv_dlopen_self=no
    2586 +fi
    2587 +rm -fr conftest*
    2588 +fi
    2589 +
    2590 +fi
    2591 +
    2592 +echo "$ac_t""$lt_cv_dlopen_self" 1>&6
    2593 +
    2594 +  if test "$lt_cv_dlopen_self" = yes; then
    2595 +    LDFLAGS="$LDFLAGS $link_static_flag"
    2596 +  echo $ac_n "checking whether a statically linked program can dlopen itself""... $ac_c" 1>&6
    2597 +echo "$progname:2628: checking whether a statically linked program can dlopen itself" >&5
    2598 +if test "${lt_cv_dlopen_self_static+set}" = set; then
    2599 +  echo $ac_n "(cached) $ac_c" 1>&6
    2600 +else
    2601 +  if test "$cross_compiling" = yes; then
    2602 +    lt_cv_dlopen_self_static=cross
    2603 +  else
    2604 +    cat > conftest.c <<EOF
    2605 +#line 2636 "ltconfig"
    2606 +
    2607 +#if HAVE_DLFCN_H
    2608 +#include <dlfcn.h>
    2609 +#endif
    2610 +
    2611 +#include <stdio.h>
    2612 +
    2613 +#ifdef RTLD_GLOBAL
    2614 +# define LTDL_GLOBAL   RTLD_GLOBAL
    2615 +#else
    2616 +# ifdef DL_GLOBAL
    2617 +#  define LTDL_GLOBAL  DL_GLOBAL
    2618 +# else
    2619 +#  define LTDL_GLOBAL  0
    2620 +# endif
    2621 +#endif
    2622 +
    2623 +/* We may have to define LTDL_LAZY_OR_NOW in the command line if we
    2624 +   find out it does not work in some platform. */
    2625 +#ifndef LTDL_LAZY_OR_NOW
    2626 +# ifdef RTLD_LAZY
    2627 +#  define LTDL_LAZY_OR_NOW     RTLD_LAZY
    2628 +# else
    2629 +#  ifdef DL_LAZY
    2630 +#   define LTDL_LAZY_OR_NOW    DL_LAZY
    2631 +#  else
    2632 +#   ifdef RTLD_NOW
    2633 +#    define LTDL_LAZY_OR_NOW   RTLD_NOW
    2634 +#   else
    2635 +#    ifdef DL_NOW
    2636 +#     define LTDL_LAZY_OR_NOW  DL_NOW
    2637 +#    else
    2638 +#     define LTDL_LAZY_OR_NOW  0
    2639 +#    endif
    2640 +#   endif
    2641 +#  endif
    2642 +# endif
    2643 +#endif
    2644 +
    2645 +fnord() { int i=42;}
    2646 +main() { void *self, *ptr1, *ptr2; self=dlopen(0,LTDL_GLOBAL|LTDL_LAZY_OR_NOW);
    2647 +    if(self) { ptr1=dlsym(self,"fnord"); ptr2=dlsym(self,"_fnord");
    2648 +    if(ptr1 || ptr2) { dlclose(self); exit(0); } } exit(1); }
    2649 +
    2650 +EOF
    2651 +if { (eval echo $progname:2682: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null
    2652 +then
    2653 +  lt_cv_dlopen_self_static=yes
    2654 +else
    2655 +  echo "$progname: failed program was:" >&5
    2656 +  cat conftest.$ac_ext >&5
    2657 +  rm -fr conftest*
    2658 +  lt_cv_dlopen_self_static=no
    2659 +fi
    2660 +rm -fr conftest*
    2661 +fi
    2662 +
    2663 +fi
    2664 +
    2665 +echo "$ac_t""$lt_cv_dlopen_self_static" 1>&6
    2666 +fi
    2667 +    ;;
    2668 +  esac
    2669 +
    2670 +  case "$lt_cv_dlopen_self" in
    2671 +  yes|no) enable_dlopen_self=$lt_cv_dlopen_self ;;
    2672 +  *) enable_dlopen_self=unknown ;;
    2673 +  esac
    2674 +
    2675 +  case "$lt_cv_dlopen_self_static" in
    2676 +  yes|no) enable_dlopen_self_static=$lt_cv_dlopen_self_static ;;
    2677 +  *) enable_dlopen_self_static=unknown ;;
    2678 +  esac
    2679 +fi
    2680 +
    2681  # Copy echo and quote the copy, instead of the original, because it is
    2682  # used later.
    2683  ltecho="$echo"
    2684 +if test "X$ltecho" = "X$CONFIG_SHELL $0 --fallback-echo"; then
    2685 +   ltecho="$CONFIG_SHELL \$0 --fallback-echo"
    2686 +fi
    2687 +LTSHELL="$SHELL"
    2688  
    2689 -# Now quote all the things that may contain metacharacters.
    2690 -for var in ltecho old_CC old_CFLAGS old_CPPFLAGS old_LD old_NM old_RANLIB \
    2691 -  old_LN_S AR CC LD LN_S NM reload_flag reload_cmds wl pic_flag \
    2692 -  link_static_flag no_builtin_flag export_dynamic_flag_spec \
    2693 -  libname_spec library_names_spec soname_spec RANLIB \
    2694 -  old_archive_cmds old_archive_from_new_cmds old_postinstall_cmds \
    2695 -  old_postuninstall_cmds archive_cmds postinstall_cmds postuninstall_cmds \
    2696 -  allow_undefined_flag no_undefined_flag \
    2697 -  finish_cmds finish_eval global_symbol_pipe \
    2698 -  hardcode_libdir_flag_spec hardcode_libdir_separator; do
    2699 -
    2700 -  case "$var" in
    2701 -  reload_cmds | old_archive_cmds | old_archive_from_new_cmds | \
    2702 -  old_postinstall_cmds | old_postuninstall_cmds | archive_cmds | \
    2703 -  postinstall_cmds | postuninstall_cmds | finish_cmds)
    2704 -    # Double-quote double-evaled strings.
    2705 -    eval "$var=\`\$echo \"X\$$var\" | \$Xsed -e \"\$double_quote_subst\" -e \"\$sed_quote_subst\"\`"
    2706 -    ;;
    2707 -  *)
    2708 -    eval "$var=\`\$echo \"X\$$var\" | \$Xsed -e \"\$sed_quote_subst\"\`"
    2709 +LTCONFIG_VERSION="$VERSION"
    2710 +
    2711 +# Only quote variables if we're using ltmain.sh.
    2712 +case "$ltmain" in
    2713 +*.sh)
    2714 +  # Now quote all the things that may contain metacharacters.
    2715 +  for var in ltecho old_CC old_CFLAGS old_CPPFLAGS \
    2716 +    old_LD old_LDFLAGS old_LIBS \
    2717 +    old_NM old_RANLIB old_LN_S old_DLLTOOL old_OBJDUMP old_AS \
    2718 +    AR CC LD LN_S NM LTSHELL LTCONFIG_VERSION \
    2719 +    reload_flag reload_cmds wl \
    2720 +    pic_flag link_static_flag no_builtin_flag export_dynamic_flag_spec \
    2721 +    thread_safe_flag_spec whole_archive_flag_spec libname_spec \
    2722 +    library_names_spec soname_spec \
    2723 +    RANLIB old_archive_cmds old_archive_from_new_cmds old_postinstall_cmds \
    2724 +    old_postuninstall_cmds archive_cmds archive_expsym_cmds postinstall_cmds postuninstall_cmds \
    2725 +    file_magic_cmd export_symbols_cmds deplibs_check_method allow_undefined_flag no_undefined_flag \
    2726 +    finish_cmds finish_eval global_symbol_pipe global_symbol_to_cdecl \
    2727 +    hardcode_libdir_flag_spec hardcode_libdir_separator  \
    2728 +    sys_lib_search_path_spec sys_lib_dlsearch_path_spec \
    2729 +    compiler_c_o compiler_o_lo need_locks exclude_expsyms include_expsyms; do
    2730 +
    2731 +    case "$var" in
    2732 +    reload_cmds | old_archive_cmds | old_archive_from_new_cmds | \
    2733 +    old_postinstall_cmds | old_postuninstall_cmds | \
    2734 +    export_symbols_cmds | archive_cmds | archive_expsym_cmds | \
    2735 +    postinstall_cmds | postuninstall_cmds | \
    2736 +    finish_cmds | sys_lib_search_path_spec | sys_lib_dlsearch_path_spec)
    2737 +      # Double-quote double-evaled strings.
    2738 +      eval "$var=\\\"\`\$echo \"X\$$var\" | \$Xsed -e \"\$double_quote_subst\" -e \"\$sed_quote_subst\" -e \"\$delay_variable_subst\"\`\\\""
    2739 +      ;;
    2740 +    *)
    2741 +      eval "$var=\\\"\`\$echo \"X\$$var\" | \$Xsed -e \"\$sed_quote_subst\"\`\\\""
    2742 +      ;;
    2743 +    esac
    2744 +  done
    2745 +
    2746 +  case "$ltecho" in
    2747 +  *'\$0 --fallback-echo"')
    2748 +    ltecho=`$echo "X$ltecho" | $Xsed -e 's/\\\\\\\$0 --fallback-echo"$/$0 --fallback-echo"/'`
    2749      ;;
    2750    esac
    2751 -done
    2752  
    2753 -ofile=libtool
    2754 -trap "$rm $ofile; exit 1" 1 2 15
    2755 -echo creating $ofile
    2756 -$rm $ofile
    2757 -cat <<EOF > $ofile
    2758 -#! /bin/sh
    2759 +  trap "$rm \"$ofile\"; exit 1" 1 2 15
    2760 +  echo "creating $ofile"
    2761 +  $rm "$ofile"
    2762 +  cat <<EOF > "$ofile"
    2763 +#! $SHELL
    2764  
    2765 -# libtool - Provide generalized library-building support services.
    2766 -# Generated automatically by $PROGRAM - GNU $PACKAGE $VERSION
    2767 +# `$echo "$ofile" | sed 's%^.*/%%'` - Provide generalized library-building support services.
    2768 +# Generated automatically by $PROGRAM (GNU $PACKAGE $VERSION$TIMESTAMP)
    2769  # NOTE: Changes made to this file will be lost: look at ltconfig or ltmain.sh.
    2770  #
    2771 -# Copyright (C) 1996-1998 Free Software Foundation, Inc.
    2772 -# Gordon Matzigkeit <gord@gnu.ai.mit.edu>, 1996
    2773 +# Copyright (C) 1996-1999 Free Software Foundation, Inc.
    2774 +# Originally by Gordon Matzigkeit <gord@gnu.ai.mit.edu>, 1996
    2775  #
    2776  # This program is free software; you can redistribute it and/or modify
    2777  # it under the terms of the GNU General Public License as published by
    2778 @@ -1340,120 +2792,208 @@
    2779  # configuration script generated by Autoconf, you may include it under
    2780  # the same distribution terms that you use for the rest of that program.
    2781  
    2782 -# This program was configured as follows,
    2783 -# on host `(hostname || uname -n) 2>/dev/null | sed 1q`:
    2784 -#
    2785 -# CC="$old_CC" CFLAGS="$old_CFLAGS" CPPFLAGS="$old_CPPFLAGS" \\
    2786 -# LD="$old_LD" NM="$old_NM" RANLIB="$old_RANLIB" LN_S="$old_LN_S" \\
    2787 -#   $0$ltconfig_args
    2788 -#
    2789 -# Compiler and other test output produced by $progname, useful for
    2790 -# debugging $progname, is in ./config.log if it exists.
    2791 -
    2792  # Sed that helps us avoid accidentally triggering echo(1) options like -n.
    2793  Xsed="sed -e s/^X//"
    2794  
    2795  # The HP-UX ksh and POSIX shell print the target directory to stdout
    2796  # if CDPATH is set.
    2797 -if test "\${CDPATH+set}" = set; then CDPATH=; export CDPATH; fi
    2798 +if test "X\${CDPATH+set}" = Xset; then CDPATH=:; export CDPATH; fi
    2799  
    2800 -# An echo program that does not interpret backslashes.
    2801 -echo="$ltecho"
    2802 +### BEGIN LIBTOOL CONFIG
    2803 +EOF
    2804 +  cfgfile="$ofile"
    2805 +  ;;
    2806 +
    2807 +*)
    2808 +  # Double-quote the variables that need it (for aesthetics).
    2809 +  for var in old_CC old_CFLAGS old_CPPFLAGS \
    2810 +    old_LD old_LDFLAGS old_LIBS \
    2811 +    old_NM old_RANLIB old_LN_S old_DLLTOOL old_OBJDUMP old_AS; do
    2812 +    eval "$var=\\\"\$var\\\""
    2813 +  done
    2814 +
    2815 +  # Just create a config file.
    2816 +  cfgfile="$ofile.cfg"
    2817 +  trap "$rm \"$cfgfile\"; exit 1" 1 2 15
    2818 +  echo "creating $cfgfile"
    2819 +  $rm "$cfgfile"
    2820 +  cat <<EOF > "$cfgfile"
    2821 +# `$echo "$cfgfile" | sed 's%^.*/%%'` - Libtool configuration file.
    2822 +# Generated automatically by $PROGRAM (GNU $PACKAGE $VERSION$TIMESTAMP)
    2823 +EOF
    2824 +  ;;
    2825 +esac
    2826 +
    2827 +cat <<EOF >> "$cfgfile"
    2828 +# Libtool was configured as follows, on host `(hostname || uname -n) 2>/dev/null | sed 1q`:
    2829 +#
    2830 +# CC=$old_CC CFLAGS=$old_CFLAGS CPPFLAGS=$old_CPPFLAGS \\
    2831 +# LD=$old_LD LDFLAGS=$old_LDFLAGS LIBS=$old_LIBS \\
    2832 +# NM=$old_NM RANLIB=$old_RANLIB LN_S=$old_LN_S \\
    2833 +# DLLTOOL=$old_DLLTOOL OBJDUMP=$old_OBJDUMP AS=$old_AS \\
    2834 +#   $0$ltconfig_args
    2835 +#
    2836 +# Compiler and other test output produced by $progname, useful for
    2837 +# debugging $progname, is in ./config.log if it exists.
    2838  
    2839  # The version of $progname that generated this script.
    2840 -LTCONFIG_VERSION="$VERSION"
    2841 +LTCONFIG_VERSION=$LTCONFIG_VERSION
    2842  
    2843  # Shell to use when invoking shell scripts.
    2844 -SHELL=${CONFIG_SHELL-/bin/sh}
    2845 +SHELL=$LTSHELL
    2846  
    2847 -# Whether or not to build libtool libraries.
    2848 +# Whether or not to build shared libraries.
    2849  build_libtool_libs=$enable_shared
    2850  
    2851 -# Whether or not to build old-style libraries.
    2852 +# Whether or not to build static libraries.
    2853  build_old_libs=$enable_static
    2854  
    2855 +# Whether or not to optimize for fast installation.
    2856 +fast_install=$enable_fast_install
    2857 +
    2858  # The host system.
    2859 -host_alias="$host_alias"
    2860 -host="$host"
    2861 +host_alias=$host_alias
    2862 +host=$host
    2863 +
    2864 +# An echo program that does not interpret backslashes.
    2865 +echo=$ltecho
    2866  
    2867  # The archiver.
    2868 -AR="$AR"
    2869 +AR=$AR
    2870  
    2871  # The default C compiler.
    2872 -CC="$CC"
    2873 +CC=$CC
    2874  
    2875  # The linker used to build libraries.
    2876 -LD="$LD"
    2877 +LD=$LD
    2878  
    2879  # Whether we need hard or soft links.
    2880 -LN_S="$LN_S"
    2881 +LN_S=$LN_S
    2882  
    2883  # A BSD-compatible nm program.
    2884 -NM="$NM"
    2885 +NM=$NM
    2886 +
    2887 +# Used on cygwin: DLL creation program.
    2888 +DLLTOOL="$DLLTOOL"
    2889 +
    2890 +# Used on cygwin: object dumper.
    2891 +OBJDUMP="$OBJDUMP"
    2892 +
    2893 +# Used on cygwin: assembler.
    2894 +AS="$AS"
    2895  
    2896  # The name of the directory that contains temporary libtool files.
    2897 -objdir="$objdir"
    2898 +objdir=$objdir
    2899  
    2900  # How to create reloadable object files.
    2901 -reload_flag="$reload_flag"
    2902 -reload_cmds="$reload_cmds"
    2903 +reload_flag=$reload_flag
    2904 +reload_cmds=$reload_cmds
    2905  
    2906  # How to pass a linker flag through the compiler.
    2907 -wl="$wl"
    2908 +wl=$wl
    2909 +
    2910 +# Object file suffix (normally "o").
    2911 +objext="$objext"
    2912 +
    2913 +# Old archive suffix (normally "a").
    2914 +libext="$libext"
    2915 +
    2916 +# Executable file suffix (normally "").
    2917 +exeext="$exeext"
    2918  
    2919  # Additional compiler flags for building library objects.
    2920 -pic_flag="$pic_flag"
    2921 +pic_flag=$pic_flag
    2922 +
    2923 +# Does compiler simultaneously support -c and -o options?
    2924 +compiler_c_o=$compiler_c_o
    2925 +
    2926 +# Can we write directly to a .lo ?
    2927 +compiler_o_lo=$compiler_o_lo
    2928 +
    2929 +# Must we lock files when doing compilation ?
    2930 +need_locks=$need_locks
    2931 +
    2932 +# Do we need the lib prefix for modules?
    2933 +need_lib_prefix=$need_lib_prefix
    2934 +
    2935 +# Do we need a version for libraries?
    2936 +need_version=$need_version
    2937 +
    2938 +# Whether dlopen is supported.
    2939 +dlopen=$enable_dlopen
    2940 +
    2941 +# Whether dlopen of programs is supported.
    2942 +dlopen_self=$enable_dlopen_self
    2943 +
    2944 +# Whether dlopen of statically linked programs is supported.
    2945 +dlopen_self_static=$enable_dlopen_self_static
    2946  
    2947  # Compiler flag to prevent dynamic linking.
    2948 -link_static_flag="$link_static_flag"
    2949 +link_static_flag=$link_static_flag
    2950  
    2951  # Compiler flag to turn off builtin functions.
    2952 -no_builtin_flag="$no_builtin_flag"
    2953 +no_builtin_flag=$no_builtin_flag
    2954  
    2955  # Compiler flag to allow reflexive dlopens.
    2956 -export_dynamic_flag_spec="$export_dynamic_flag_spec"
    2957 +export_dynamic_flag_spec=$export_dynamic_flag_spec
    2958 +
    2959 +# Compiler flag to generate shared objects directly from archives.
    2960 +whole_archive_flag_spec=$whole_archive_flag_spec
    2961 +
    2962 +# Compiler flag to generate thread-safe objects.
    2963 +thread_safe_flag_spec=$thread_safe_flag_spec
    2964  
    2965  # Library versioning type.
    2966  version_type=$version_type
    2967  
    2968  # Format of library name prefix.
    2969 -libname_spec="$libname_spec"
    2970 +libname_spec=$libname_spec
    2971  
    2972  # List of archive names.  First name is the real one, the rest are links.
    2973  # The last name is the one that the linker finds with -lNAME.
    2974 -library_names_spec="$library_names_spec"
    2975 +library_names_spec=$library_names_spec
    2976  
    2977  # The coded name of the library, if different from the real name.
    2978 -soname_spec="$soname_spec"
    2979 +soname_spec=$soname_spec
    2980  
    2981  # Commands used to build and install an old-style archive.
    2982 -RANLIB="$RANLIB"
    2983 -old_archive_cmds="$old_archive_cmds"
    2984 -old_postinstall_cmds="$old_postinstall_cmds"
    2985 -old_postuninstall_cmds="$old_postuninstall_cmds"
    2986 +RANLIB=$RANLIB
    2987 +old_archive_cmds=$old_archive_cmds
    2988 +old_postinstall_cmds=$old_postinstall_cmds
    2989 +old_postuninstall_cmds=$old_postuninstall_cmds
    2990  
    2991  # Create an old-style archive from a shared archive.
    2992 -old_archive_from_new_cmds="$old_archive_from_new_cmds"
    2993 +old_archive_from_new_cmds=$old_archive_from_new_cmds
    2994  
    2995  # Commands used to build and install a shared archive.
    2996 -archive_cmds="$archive_cmds"
    2997 -postinstall_cmds="$postinstall_cmds"
    2998 -postuninstall_cmds="$postuninstall_cmds"
    2999 +archive_cmds=$archive_cmds
    3000 +archive_expsym_cmds=$archive_expsym_cmds
    3001 +postinstall_cmds=$postinstall_cmds
    3002 +postuninstall_cmds=$postuninstall_cmds
    3003 +
    3004 +# Method to check whether dependent libraries are shared objects.
    3005 +deplibs_check_method=$deplibs_check_method
    3006 +
    3007 +# Command to use when deplibs_check_method == file_magic.
    3008 +file_magic_cmd=$file_magic_cmd
    3009  
    3010  # Flag that allows shared libraries with undefined symbols to be built.
    3011 -allow_undefined_flag="$allow_undefined_flag"
    3012 +allow_undefined_flag=$allow_undefined_flag
    3013  
    3014  # Flag that forces no undefined symbols.
    3015 -no_undefined_flag="$no_undefined_flag"
    3016 +no_undefined_flag=$no_undefined_flag
    3017  
    3018  # Commands used to finish a libtool library installation in a directory.
    3019 -finish_cmds="$finish_cmds"
    3020 +finish_cmds=$finish_cmds
    3021  
    3022  # Same as above, but a single script fragment to be evaled but not shown.
    3023 -finish_eval="$finish_eval"
    3024 +finish_eval=$finish_eval
    3025  
    3026  # Take the output of nm and produce a listing of raw symbols and C names.
    3027 -global_symbol_pipe="$global_symbol_pipe"
    3028 +global_symbol_pipe=$global_symbol_pipe
    3029 +
    3030 +# Transform the output of nm in a proper C declaration
    3031 +global_symbol_to_cdecl=$global_symbol_to_cdecl
    3032  
    3033  # This is the shared library runtime path variable.
    3034  runpath_var=$runpath_var
    3035 @@ -1461,15 +3001,18 @@
    3036  # This is the shared library path variable.
    3037  shlibpath_var=$shlibpath_var
    3038  
    3039 +# Is shlibpath searched before the hard-coded library search path?
    3040 +shlibpath_overrides_runpath=$shlibpath_overrides_runpath
    3041 +
    3042  # How to hardcode a shared library path into an executable.
    3043  hardcode_action=$hardcode_action
    3044  
    3045  # Flag to hardcode \$libdir into a binary during linking.
    3046  # This must work even if \$libdir does not exist.
    3047 -hardcode_libdir_flag_spec="$hardcode_libdir_flag_spec"
    3048 +hardcode_libdir_flag_spec=$hardcode_libdir_flag_spec
    3049  
    3050  # Whether we need a single -rpath flag with a separated argument.
    3051 -hardcode_libdir_separator="$hardcode_libdir_separator"
    3052 +hardcode_libdir_separator=$hardcode_libdir_separator
    3053  
    3054  # Set to yes if using DIR/libNAME.so during linking hardcodes DIR into the
    3055  # resulting binary.
    3056 @@ -1483,27 +3026,115 @@
    3057  # the resulting binary.
    3058  hardcode_shlibpath_var=$hardcode_shlibpath_var
    3059  
    3060 +# Compile-time system search path for libraries
    3061 +sys_lib_search_path_spec=$sys_lib_search_path_spec
    3062 +
    3063 +# Run-time system search path for libraries
    3064 +sys_lib_dlsearch_path_spec=$sys_lib_dlsearch_path_spec
    3065 +
    3066 +# Fix the shell variable \$srcfile for the compiler.
    3067 +fix_srcfile_path="$fix_srcfile_path"
    3068 +
    3069 +# Set to yes if exported symbols are required.
    3070 +always_export_symbols=$always_export_symbols
    3071 +
    3072 +# The commands to list exported symbols.
    3073 +export_symbols_cmds=$export_symbols_cmds
    3074 +
    3075 +# Symbols that should not be listed in the preloaded symbols.
    3076 +exclude_expsyms=$exclude_expsyms
    3077 +
    3078 +# Symbols that must always be exported.
    3079 +include_expsyms=$include_expsyms
    3080 +
    3081  EOF
    3082  
    3083 -case "$host_os" in
    3084 -aix3*)
    3085 -  cat <<\EOF >> $ofile
    3086 +case "$ltmain" in
    3087 +*.sh)
    3088 +  echo '### END LIBTOOL CONFIG' >> "$ofile"
    3089 +  echo >> "$ofile"
    3090 +  case "$host_os" in
    3091 +  aix3*)
    3092 +    cat <<\EOF >> "$ofile"
    3093 +
    3094  # AIX sometimes has problems with the GCC collect2 program.  For some
    3095  # reason, if we set the COLLECT_NAMES environment variable, the problems
    3096  # vanish in a puff of smoke.
    3097 -if test "${COLLECT_NAMES+set}" != set; then
    3098 +if test "X${COLLECT_NAMES+set}" != Xset; then
    3099    COLLECT_NAMES=
    3100    export COLLECT_NAMES
    3101  fi
    3102 -
    3103  EOF
    3104 +    ;;
    3105 +  esac
    3106 +
    3107 +  # Append the ltmain.sh script.
    3108 +  sed '$q' "$ltmain" >> "$ofile" || (rm -f "$ofile"; exit 1)
    3109 +  # We use sed instead of cat because bash on DJGPP gets confused if
    3110 +  # if finds mixed CR/LF and LF-only lines.  Since sed operates in
    3111 +  # text mode, it properly converts lines to CR/LF.  This bash problem
    3112 +  # is reportedly fixed, but why not run on old versions too?
    3113 +
    3114 +  chmod +x "$ofile"
    3115 +  ;;
    3116 +
    3117 +*)
    3118 +  # Compile the libtool program.
    3119 +  echo "FIXME: would compile $ltmain"
    3120    ;;
    3121  esac
    3122  
    3123 -# Append the ltmain.sh script.
    3124 -cat "$ltmain" >> $ofile || (rm -f $ofile; exit 1)
    3125 +test -n "$cache_file" || exit 0
    3126 +
    3127 +# AC_CACHE_SAVE
    3128 +trap '' 1 2 15
    3129 +cat > confcache <<\EOF
    3130 +# This file is a shell script that caches the results of configure
    3131 +# tests run on this system so they can be shared between configure
    3132 +# scripts and configure runs.  It is not useful on other systems.
    3133 +# If it contains results you don't want to keep, you may remove or edit it.
    3134 +#
    3135 +# By default, configure uses ./config.cache as the cache file,
    3136 +# creating it if it does not exist already.  You can give configure
    3137 +# the --cache-file=FILE option to use a different cache file; that is
    3138 +# what configure does when it calls configure scripts in
    3139 +# subdirectories, so they share the cache.
    3140 +# Giving --cache-file=/dev/null disables caching, for debugging configure.
    3141 +# config.status only pays attention to the cache file if you give it the
    3142 +# --recheck option to rerun configure.
    3143 +#
    3144 +EOF
    3145 +# The following way of writing the cache mishandles newlines in values,
    3146 +# but we know of no workaround that is simple, portable, and efficient.
    3147 +# So, don't put newlines in cache variables' values.
    3148 +# Ultrix sh set writes to stderr and can't be redirected directly,
    3149 +# and sets the high bit in the cache file unless we assign to the vars.
    3150 +(set) 2>&1 |
    3151 +  case `(ac_space=' '; set | grep ac_space) 2>&1` in
    3152 +  *ac_space=\ *)
    3153 +    # `set' does not quote correctly, so add quotes (double-quote substitution
    3154 +    # turns \\\\ into \\, and sed turns \\ into \).
    3155 +    sed -n \
    3156 +      -e "s/'/'\\\\''/g" \
    3157 +      -e "s/^\\([a-zA-Z0-9_]*_cv_[a-zA-Z0-9_]*\\)=\\(.*\\)/\\1=\${\\1='\\2'}/p"
    3158 +    ;;
    3159 +  *)
    3160 +    # `set' quotes correctly as required by POSIX, so do not add quotes.
    3161 +    sed -n -e 's/^\([a-zA-Z0-9_]*_cv_[a-zA-Z0-9_]*\)=\(.*\)/\1=${\1=\2}/p'
    3162 +    ;;
    3163 +  esac >> confcache
    3164 +if cmp -s $cache_file confcache; then
    3165 +  :
    3166 +else
    3167 +  if test -w $cache_file; then
    3168 +    echo "updating cache $cache_file"
    3169 +    cat confcache > $cache_file
    3170 +  else
    3171 +    echo "not updating unwritable cache $cache_file"
    3172 +  fi
    3173 +fi
    3174 +rm -f confcache
    3175  
    3176 -chmod +x $ofile
    3177  exit 0
    3178  
    3179  # Local Variables:
  • files/patch-config.guess

     
    1 --- config.guess.old    Sun Mar 16 22:10:53 2003
    2 +++ config.guess        Sun Mar 16 22:12:11 2003
    3 @@ -51,6 +51,9 @@
    4  # Note: order is significant - the case branches are not exclusive.
    5  
    6  case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in
    7 +    *:Darwin:*:*)
    8 +       echo `uname -p`-apple-darwin${UNAME_RELEASE}
    9 +       exit 0 ;;
    10      alpha:OSF1:*:*)
    11         if test $UNAME_RELEASE = "V4.0"; then
    12                 UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $3}'`
  • files/patch-makefile.cfg

     
    1 --- makefile.cfg        1998-03-21 20:08:57.000000000 +0100
    2 +++ makefile.cfg        2007-12-13 00:50:27.000000000 +0100
    3 @@ -17,7 +17,7 @@
    4  binprefix =
    5  manprefix =
    6  manext = 1
    7 -mandir = $(prefix)/man/man$(manext)
    8 +mandir = $(prefix)/share/man/man$(manext)
    9  
    10  # The name of your C compiler:
    11  CC= @CC@
    12 @@ -168,8 +168,8 @@
    13  
    14  # with libtool:
    15  libjpeg.la: @A2K_DEPS@ $(LIBOBJECTS)
    16 -       $(LIBTOOL) --mode=link $(CC) -o libjpeg.la $(LIBOBJECTS) \
    17 -               -rpath $(libdir) -version-info $(JPEG_LIB_VERSION)
    18 +       $(LIBTOOL) --mode=link "$(CC) $(CFLAGS)" -o libjpeg.la $(LIBOBJECTS) \
    19 +               -rpath $(libdir) -no-undefined -version-info $(JPEG_LIB_VERSION)
    20  
    21  # sample programs:
    22  
  • files/patch-config.sub

     
    1 --- config.sub.old      Sun Mar 16 22:13:44 2003
    2 +++ config.sub  Sun Mar 16 22:15:37 2003
    3 @@ -711,7 +711,7 @@
    4               | -aos* \
    5               | -nindy* | -vxsim* | -vxworks* | -ebmon* | -hms* | -mvs* \
    6               | -clix* | -riscos* | -uniplus* | -iris* | -rtu* | -xenix* \
    7 -             | -hiux* | -386bsd* | -netbsd* | -openbsd* | -freebsd* | -riscix* \
    8 +             | -hiux* | -386bsd* | -netbsd* | -openbsd* | -freebsd* | -darwin* | -riscix* \
    9               | -lynxos* | -bosx* | -nextstep* | -cxux* | -aout* | -elf* \
    10               | -ptx* | -coff* | -ecoff* | -winnt* | -domain* | -vsta* \
    11               | -udi* | -eabi* | -lites* | -ieee* | -go32* | -aux* \
  • files/patch-ltmain.sh

     
    1 --- ltmain.sh.orig      Wed Mar 25 10:25:39 1998
    2 +++ ltmain.sh   Sun Mar 16 16:58:11 2003
    3 @@ -1,8 +1,8 @@
    4  # ltmain.sh - Provide generalized library-building support services.
    5  # NOTE: Changing this file will not affect anything until you rerun ltconfig.
    6  #
    7 -# Copyright (C) 1996-1998 Free Software Foundation, Inc.
    8 -# Gordon Matzigkeit <gord@gnu.ai.mit.edu>, 1996
    9 +# Copyright (C) 1996-1999 Free Software Foundation, Inc.
    10 +# Originally by Gordon Matzigkeit <gord@gnu.ai.mit.edu>, 1996
    11  #
    12  # This program is free software; you can redistribute it and/or modify
    13  # it under the terms of the GNU General Public License as published by
    14 @@ -23,6 +23,30 @@
    15  # configuration script generated by Autoconf, you may include it under
    16  # the same distribution terms that you use for the rest of that program.
    17  
    18 +# Check that we have a working $echo.
    19 +if test "X$1" = X--no-reexec; then
    20 +  # Discard the --no-reexec flag, and continue.
    21 +  shift
    22 +elif test "X$1" = X--fallback-echo; then
    23 +  # Avoid inline document here, it may be left over
    24 +  :
    25 +elif test "X`($echo '\t') 2>/dev/null`" = 'X\t'; then
    26 +  # Yippee, $echo works!
    27 +  :
    28 +else
    29 +  # Restart under the correct shell, and then maybe $echo will work.
    30 +  exec $SHELL "$0" --no-reexec ${1+"$@"}
    31 +fi
    32 +
    33 +if test "X$1" = X--fallback-echo; then
    34 +  # used as fallback echo
    35 +  shift
    36 +  cat <<EOF
    37 +$*
    38 +EOF
    39 +  exit 0
    40 +fi
    41 +
    42  # The name of this program.
    43  progname=`$echo "$0" | sed 's%^.*/%%'`
    44  modename="$progname"
    45 @@ -30,7 +54,8 @@
    46  # Constants.
    47  PROGRAM=ltmain.sh
    48  PACKAGE=libtool
    49 -VERSION=1.2
    50 +VERSION=1.3.5
    51 +TIMESTAMP=" (1.385.2.206 2000/05/27 11:12:27)"
    52  
    53  default_mode=
    54  help="Try \`$progname --help' for more information."
    55 @@ -41,15 +66,22 @@
    56  
    57  # Sed substitution that helps us do robust quoting.  It backslashifies
    58  # metacharacters that are still active within double-quoted strings.
    59 -Xsed='sed -e s/^X//'
    60 +Xsed='sed -e 1s/^X//'
    61  sed_quote_subst='s/\([\\`\\"$\\\\]\)/\\\1/g'
    62 +SP2NL='tr \040 \012'
    63 +NL2SP='tr \015\012 \040\040'
    64  
    65  # NLS nuisances.
    66  # Only set LANG and LC_ALL to C if already set.
    67  # These must not be set unconditionally because not all systems understand
    68  # e.g. LANG=C (notably SCO).
    69 -if test "${LC_ALL+set}" = set; then LC_ALL=C; export LC_ALL; fi
    70 -if test "${LANG+set}"   = set; then LANG=C;   export LANG;   fi
    71 +# We save the old values to restore during execute mode.
    72 +if test "${LC_ALL+set}" = set; then
    73 +  save_LC_ALL="$LC_ALL"; LC_ALL=C; export LC_ALL
    74 +fi
    75 +if test "${LANG+set}" = set; then
    76 +  save_LANG="$LANG"; LANG=C; export LANG
    77 +fi
    78  
    79  if test "$LTCONFIG_VERSION" != "$VERSION"; then
    80    echo "$modename: ltconfig version \`$LTCONFIG_VERSION' does not match $PROGRAM version \`$VERSION'" 1>&2
    81 @@ -72,6 +104,8 @@
    82  show="$echo"
    83  show_help=
    84  execute_dlfiles=
    85 +lo2o="s/\\.lo\$/.${objext}/"
    86 +o2lo="s/\\.${objext}\$/.lo/"
    87  
    88  # Parse our command line options once, thoroughly.
    89  while test $# -gt 0
    90 @@ -107,10 +141,20 @@
    91      ;;
    92  
    93    --version)
    94 -    echo "$PROGRAM (GNU $PACKAGE) $VERSION"
    95 +    echo "$PROGRAM (GNU $PACKAGE) $VERSION$TIMESTAMP"
    96 +    exit 0
    97 +    ;;
    98 +
    99 +  --config)
    100 +    sed -e '1,/^### BEGIN LIBTOOL CONFIG/d' -e '/^### END LIBTOOL CONFIG/,$d' $0
    101      exit 0
    102      ;;
    103  
    104 +  --debug)
    105 +    echo "$progname: enabling shell trace mode"
    106 +    set -x
    107 +    ;;
    108 +
    109    --dry-run | -n)
    110      run=:
    111      ;;
    112 @@ -172,15 +216,15 @@
    113        mode=link
    114        for arg
    115        do
    116 -        case "$arg" in
    117 -        -c)
    118 -           mode=compile
    119 -           break
    120 -           ;;
    121 -        esac
    122 +       case "$arg" in
    123 +       -c)
    124 +          mode=compile
    125 +          break
    126 +          ;;
    127 +       esac
    128        done
    129        ;;
    130 -    *db | *dbx)
    131 +    *db | *dbx | *strace | *truss)
    132        mode=execute
    133        ;;
    134      *install*|cp|mv)
    135 @@ -195,11 +239,11 @@
    136  
    137        # Just use the default operation mode.
    138        if test -z "$mode"; then
    139 -        if test -n "$nonopt"; then
    140 -          $echo "$modename: warning: cannot infer operation mode from \`$nonopt'" 1>&2
    141 -        else
    142 -          $echo "$modename: warning: cannot infer operation mode without MODE-ARGS" 1>&2
    143 -        fi
    144 +       if test -n "$nonopt"; then
    145 +         $echo "$modename: warning: cannot infer operation mode from \`$nonopt'" 1>&2
    146 +       else
    147 +         $echo "$modename: warning: cannot infer operation mode without MODE-ARGS" 1>&2
    148 +       fi
    149        fi
    150        ;;
    151      esac
    152 @@ -227,23 +271,39 @@
    153      srcfile="$nonopt"
    154      suppress_output=
    155  
    156 +    user_target=no
    157      for arg
    158      do
    159        # Accept any command-line options.
    160        case "$arg" in
    161        -o)
    162 -       $echo "$modename: you cannot specify the output filename with \`-o'" 1>&2
    163 -       $echo "$help" 1>&2
    164 -       exit 1
    165 +       if test "$user_target" != "no"; then
    166 +         $echo "$modename: you cannot specify \`-o' more than once" 1>&2
    167 +         exit 1
    168 +       fi
    169 +       user_target=next
    170         ;;
    171  
    172        -static)
    173 -       build_libtool_libs=no
    174         build_old_libs=yes
    175         continue
    176         ;;
    177        esac
    178  
    179 +      case "$user_target" in
    180 +      next)
    181 +       # The next one is the -o target name
    182 +       user_target=yes
    183 +       continue
    184 +       ;;
    185 +      yes)
    186 +       # We got the output file
    187 +       user_target=set
    188 +       libobj="$arg"
    189 +       continue
    190 +       ;;
    191 +      esac
    192 +
    193        # Accept the current argument as the source file.
    194        lastarg="$srcfile"
    195        srcfile="$arg"
    196 @@ -272,11 +332,22 @@
    197        fi
    198      done
    199  
    200 -    # Get the name of the library object.
    201 -    libobj=`$echo "X$srcfile" | $Xsed -e 's%^.*/%%'`
    202 +    case "$user_target" in
    203 +    set)
    204 +      ;;
    205 +    no)
    206 +      # Get the name of the library object.
    207 +      libobj=`$echo "X$srcfile" | $Xsed -e 's%^.*/%%'`
    208 +      ;;
    209 +    *)
    210 +      $echo "$modename: you must specify a target with \`-o'" 1>&2
    211 +      exit 1
    212 +      ;;
    213 +    esac
    214  
    215      # Recognize several different file suffixes.
    216 -    xform='[cCFSfms]'
    217 +    # If the user specifies -o file.o, it is replaced with file.lo
    218 +    xform='[cCFSfmso]'
    219      case "$libobj" in
    220      *.ada) xform=ada ;;
    221      *.adb) xform=adb ;;
    222 @@ -293,9 +364,9 @@
    223      libobj=`$echo "X$libobj" | $Xsed -e "s/\.$xform$/.lo/"`
    224  
    225      case "$libobj" in
    226 -    *.lo) obj=`$echo "X$libobj" | $Xsed -e 's/\.lo$/.o/'` ;;
    227 +    *.lo) obj=`$echo "X$libobj" | $Xsed -e "$lo2o"` ;;
    228      *)
    229 -      $echo "$modename: cannot determine name of library object from \`$srcfile'" 1>&2
    230 +      $echo "$modename: cannot determine name of library object from \`$libobj'" 1>&2
    231        exit 1
    232        ;;
    233      esac
    234 @@ -308,11 +379,54 @@
    235  
    236      # Delete any leftover library objects.
    237      if test "$build_old_libs" = yes; then
    238 -      $run $rm $obj $libobj
    239 -      trap "$run $rm $obj $libobj; exit 1" 1 2 15
    240 +      removelist="$obj $libobj"
    241 +    else
    242 +      removelist="$libobj"
    243 +    fi
    244 +
    245 +    $run $rm $removelist
    246 +    trap "$run $rm $removelist; exit 1" 1 2 15
    247 +
    248 +    # Calculate the filename of the output object if compiler does
    249 +    # not support -o with -c
    250 +    if test "$compiler_c_o" = no; then
    251 +      output_obj=`$echo "X$srcfile" | $Xsed -e 's%^.*/%%' -e 's%\..*$%%'`.${objext}
    252 +      lockfile="$output_obj.lock"
    253 +      removelist="$removelist $output_obj $lockfile"
    254 +      trap "$run $rm $removelist; exit 1" 1 2 15
    255      else
    256 -      $run $rm $libobj
    257 -      trap "$run $rm $libobj; exit 1" 1 2 15
    258 +      need_locks=no
    259 +      lockfile=
    260 +    fi
    261 +
    262 +    # Lock this critical section if it is needed
    263 +    # We use this script file to make the link, it avoids creating a new file
    264 +    if test "$need_locks" = yes; then
    265 +      until ln "$0" "$lockfile" 2>/dev/null; do
    266 +       $show "Waiting for $lockfile to be removed"
    267 +       sleep 2
    268 +      done
    269 +    elif test "$need_locks" = warn; then
    270 +      if test -f "$lockfile"; then
    271 +       echo "\
    272 +*** ERROR, $lockfile exists and contains:
    273 +`cat $lockfile 2>/dev/null`
    274 +
    275 +This indicates that another process is trying to use the same
    276 +temporary object file, and libtool could not work around it because
    277 +your compiler does not support \`-c' and \`-o' together.  If you
    278 +repeat this compilation, it may succeed, by chance, but you had better
    279 +avoid parallel builds (make -j) in this platform, or get a better
    280 +compiler."
    281 +
    282 +       $run $rm $removelist
    283 +       exit 1
    284 +      fi
    285 +      echo $srcfile > "$lockfile"
    286 +    fi
    287 +
    288 +    if test -n "$fix_srcfile_path"; then
    289 +      eval srcfile=\"$fix_srcfile_path\"
    290      fi
    291  
    292      # Only build a PIC object if we are building libtool libraries.
    293 @@ -321,23 +435,110 @@
    294        fbsd_hideous_sh_bug=$base_compile
    295  
    296        # All platforms use -DPIC, to notify preprocessed assembler code.
    297 -      $show "$base_compile$pic_flag -DPIC $srcfile"
    298 -      if $run eval "$base_compile\$pic_flag -DPIC \$srcfile"; then :
    299 +      command="$base_compile $srcfile $pic_flag -DPIC"
    300 +      if test "$build_old_libs" = yes; then
    301 +       lo_libobj="$libobj"
    302 +       dir=`$echo "X$libobj" | $Xsed -e 's%/[^/]*$%%'`
    303 +       if test "X$dir" = "X$libobj"; then
    304 +         dir="$objdir"
    305 +       else
    306 +         dir="$dir/$objdir"
    307 +       fi
    308 +       libobj="$dir/"`$echo "X$libobj" | $Xsed -e 's%^.*/%%'`
    309 +
    310 +       if test -d "$dir"; then
    311 +         $show "$rm $libobj"
    312 +         $run $rm $libobj
    313 +       else
    314 +         $show "$mkdir $dir"
    315 +         $run $mkdir $dir
    316 +         status=$?
    317 +         if test $status -ne 0 && test ! -d $dir; then
    318 +           exit $status
    319 +         fi
    320 +       fi
    321 +      fi
    322 +      if test "$compiler_o_lo" = yes; then
    323 +       output_obj="$libobj"
    324 +       command="$command -o $output_obj"
    325 +      elif test "$compiler_c_o" = yes; then
    326 +       output_obj="$obj"
    327 +       command="$command -o $output_obj"
    328 +      fi
    329 +
    330 +      $run $rm "$output_obj"
    331 +      $show "$command"
    332 +      if $run eval "$command"; then :
    333        else
    334 -        test -n "$obj" && $run $rm $obj
    335 -        exit 1
    336 +       test -n "$output_obj" && $run $rm $removelist
    337 +       exit 1
    338        fi
    339  
    340 -      # If we have no pic_flag, then copy the object into place and finish.
    341 -      if test -z "$pic_flag"; then
    342 -        $show "$LN_S $obj $libobj"
    343 -        $run $LN_S $obj $libobj
    344 -        exit $?
    345 +      if test "$need_locks" = warn &&
    346 +        test x"`cat $lockfile 2>/dev/null`" != x"$srcfile"; then
    347 +       echo "\
    348 +*** ERROR, $lockfile contains:
    349 +`cat $lockfile 2>/dev/null`
    350 +
    351 +but it should contain:
    352 +$srcfile
    353 +
    354 +This indicates that another process is trying to use the same
    355 +temporary object file, and libtool could not work around it because
    356 +your compiler does not support \`-c' and \`-o' together.  If you
    357 +repeat this compilation, it may succeed, by chance, but you had better
    358 +avoid parallel builds (make -j) in this platform, or get a better
    359 +compiler."
    360 +
    361 +       $run $rm $removelist
    362 +       exit 1
    363 +      fi
    364 +
    365 +      # Just move the object if needed, then go on to compile the next one
    366 +      if test x"$output_obj" != x"$libobj"; then
    367 +       $show "$mv $output_obj $libobj"
    368 +       if $run $mv $output_obj $libobj; then :
    369 +       else
    370 +         error=$?
    371 +         $run $rm $removelist
    372 +         exit $error
    373 +       fi
    374        fi
    375  
    376 -      # Just move the object, then go on to compile the next one
    377 -      $show "$mv $obj $libobj"
    378 -      $run $mv $obj $libobj || exit 1
    379 +      # If we have no pic_flag, then copy the object into place and finish.
    380 +      if test -z "$pic_flag" && test "$build_old_libs" = yes; then
    381 +       # Rename the .lo from within objdir to obj
    382 +       if test -f $obj; then
    383 +         $show $rm $obj
    384 +         $run $rm $obj
    385 +       fi
    386 +
    387 +       $show "$mv $libobj $obj"
    388 +       if $run $mv $libobj $obj; then :
    389 +       else
    390 +         error=$?
    391 +         $run $rm $removelist
    392 +         exit $error
    393 +       fi
    394 +
    395 +       xdir=`$echo "X$obj" | $Xsed -e 's%/[^/]*$%%'`
    396 +       if test "X$xdir" = "X$obj"; then
    397 +         xdir="."
    398 +       else
    399 +         xdir="$xdir"
    400 +       fi
    401 +       baseobj=`$echo "X$obj" | $Xsed -e "s%.*/%%"`
    402 +       libobj=`$echo "X$baseobj" | $Xsed -e "$o2lo"`
    403 +       # Now arrange that obj and lo_libobj become the same file
    404 +       $show "(cd $xdir && $LN_S $baseobj $libobj)"
    405 +       if $run eval '(cd $xdir && $LN_S $baseobj $libobj)'; then
    406 +         exit 0
    407 +       else
    408 +         error=$?
    409 +         $run $rm $removelist
    410 +         exit $error
    411 +       fi
    412 +      fi
    413  
    414        # Allow error messages only from the first compilation.
    415        suppress_output=' >/dev/null 2>&1'
    416 @@ -345,20 +546,73 @@
    417  
    418      # Only build a position-dependent object if we build old libraries.
    419      if test "$build_old_libs" = yes; then
    420 +      command="$base_compile $srcfile"
    421 +      if test "$compiler_c_o" = yes; then
    422 +       command="$command -o $obj"
    423 +       output_obj="$obj"
    424 +      fi
    425 +
    426        # Suppress compiler output if we already did a PIC compilation.
    427 -      $show "$base_compile $srcfile$suppress_output"
    428 -      if $run eval "$base_compile \$srcfile$suppress_output"; then :
    429 +      command="$command$suppress_output"
    430 +      $run $rm "$output_obj"
    431 +      $show "$command"
    432 +      if $run eval "$command"; then :
    433 +      else
    434 +       $run $rm $removelist
    435 +       exit 1
    436 +      fi
    437 +
    438 +      if test "$need_locks" = warn &&
    439 +        test x"`cat $lockfile 2>/dev/null`" != x"$srcfile"; then
    440 +       echo "\
    441 +*** ERROR, $lockfile contains:
    442 +`cat $lockfile 2>/dev/null`
    443 +
    444 +but it should contain:
    445 +$srcfile
    446 +
    447 +This indicates that another process is trying to use the same
    448 +temporary object file, and libtool could not work around it because
    449 +your compiler does not support \`-c' and \`-o' together.  If you
    450 +repeat this compilation, it may succeed, by chance, but you had better
    451 +avoid parallel builds (make -j) in this platform, or get a better
    452 +compiler."
    453 +
    454 +       $run $rm $removelist
    455 +       exit 1
    456 +      fi
    457 +
    458 +      # Just move the object if needed
    459 +      if test x"$output_obj" != x"$obj"; then
    460 +       $show "$mv $output_obj $obj"
    461 +       if $run $mv $output_obj $obj; then :
    462 +       else
    463 +         error=$?
    464 +         $run $rm $removelist
    465 +         exit $error
    466 +       fi
    467 +      fi
    468 +
    469 +      # Create an invalid libtool object if no PIC, so that we do not
    470 +      # accidentally link it into a program.
    471 +      if test "$build_libtool_libs" != yes; then
    472 +       $show "echo timestamp > $libobj"
    473 +       $run eval "echo timestamp > \$libobj" || exit $?
    474        else
    475 -        $run $rm $obj $libobj
    476 -        exit 1
    477 +       # Move the .lo from within objdir
    478 +       $show "$mv $libobj $lo_libobj"
    479 +       if $run $mv $libobj $lo_libobj; then :
    480 +       else
    481 +         error=$?
    482 +         $run $rm $removelist
    483 +         exit $error
    484 +       fi
    485        fi
    486      fi
    487  
    488 -    # Create an invalid libtool object if no PIC, so that we do not
    489 -    # accidentally link it into a program.
    490 -    if test "$build_libtool_libs" != yes; then
    491 -      $show "echo timestamp > $libobj"
    492 -      $run eval "echo timestamp > \$libobj" || exit $?
    493 +    # Unlock the critical section if it was locked
    494 +    if test "$need_locks" != no; then
    495 +      $rm "$lockfile"
    496      fi
    497  
    498      exit 0
    499 @@ -367,28 +621,238 @@
    500    # libtool link mode
    501    link)
    502      modename="$modename: link"
    503 -    CC="$nonopt"
    504 -    allow_undefined=yes
    505 -    compile_command="$CC"
    506 -    finalize_command="$CC"
    507 +    case "$host" in
    508 +    *-*-cygwin* | *-*-mingw* | *-*-os2*)
    509 +      # It is impossible to link a dll without this setting, and
    510 +      # we shouldn't force the makefile maintainer to figure out
    511 +      # which system we are compiling for in order to pass an extra
    512 +      # flag for every libtool invokation.
    513 +      # allow_undefined=no
    514 +
    515 +      # FIXME: Unfortunately, there are problems with the above when trying
    516 +      # to make a dll which has undefined symbols, in which case not
    517 +      # even a static library is built.  For now, we need to specify
    518 +      # -no-undefined on the libtool link line when we can be certain
    519 +      # that all symbols are satisfied, otherwise we get a static library.
    520 +      allow_undefined=yes
    521 +
    522 +      # This is a source program that is used to create dlls on Windows
    523 +      # Don't remove nor modify the starting and closing comments
    524 +# /* ltdll.c starts here */
    525 +# #define WIN32_LEAN_AND_MEAN
    526 +# #include <windows.h>
    527 +# #undef WIN32_LEAN_AND_MEAN
    528 +# #include <stdio.h>
    529 +#
    530 +# #ifndef __CYGWIN__
    531 +# #  ifdef __CYGWIN32__
    532 +# #    define __CYGWIN__ __CYGWIN32__
    533 +# #  endif
    534 +# #endif
    535 +#
    536 +# #ifdef __cplusplus
    537 +# extern "C" {
    538 +# #endif
    539 +# BOOL APIENTRY DllMain (HINSTANCE hInst, DWORD reason, LPVOID reserved);
    540 +# #ifdef __cplusplus
    541 +# }
    542 +# #endif
    543 +#
    544 +# #ifdef __CYGWIN__
    545 +# #include <cygwin/cygwin_dll.h>
    546 +# DECLARE_CYGWIN_DLL( DllMain );
    547 +# #endif
    548 +# HINSTANCE __hDllInstance_base;
    549 +#
    550 +# BOOL APIENTRY
    551 +# DllMain (HINSTANCE hInst, DWORD reason, LPVOID reserved)
    552 +# {
    553 +#   __hDllInstance_base = hInst;
    554 +#   return TRUE;
    555 +# }
    556 +# /* ltdll.c ends here */
    557 +      # This is a source program that is used to create import libraries
    558 +      # on Windows for dlls which lack them. Don't remove nor modify the
    559 +      # starting and closing comments
    560 +# /* impgen.c starts here */
    561 +# /*   Copyright (C) 1999 Free Software Foundation, Inc.
    562 +#
    563 +#  This file is part of GNU libtool.
    564 +#
    565 +#  This program is free software; you can redistribute it and/or modify
    566 +#  it under the terms of the GNU General Public License as published by
    567 +#  the Free Software Foundation; either version 2 of the License, or
    568 +#  (at your option) any later version.
    569 +#
    570 +#  This program is distributed in the hope that it will be useful,
    571 +#  but WITHOUT ANY WARRANTY; without even the implied warranty of
    572 +#  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    573 +#  GNU General Public License for more details.
    574 +#
    575 +#  You should have received a copy of the GNU General Public License
    576 +#  along with this program; if not, write to the Free Software
    577 +#  Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
    578 +#  */
    579 +#
    580 +#  #include <stdio.h>          /* for printf() */
    581 +#  #include <unistd.h>         /* for open(), lseek(), read() */
    582 +#  #include <fcntl.h>          /* for O_RDONLY, O_BINARY */
    583 +#  #include <string.h>         /* for strdup() */
    584 +#
    585 +#  static unsigned int
    586 +#  pe_get16 (fd, offset)
    587 +#       int fd;
    588 +#       int offset;
    589 +#  {
    590 +#    unsigned char b[2];
    591 +#    lseek (fd, offset, SEEK_SET);
    592 +#    read (fd, b, 2);
    593 +#    return b[0] + (b[1]<<8);
    594 +#  }
    595 +#
    596 +#  static unsigned int
    597 +#  pe_get32 (fd, offset)
    598 +#      int fd;
    599 +#      int offset;
    600 +#  {
    601 +#    unsigned char b[4];
    602 +#    lseek (fd, offset, SEEK_SET);
    603 +#    read (fd, b, 4);
    604 +#    return b[0] + (b[1]<<8) + (b[2]<<16) + (b[3]<<24);
    605 +#  }
    606 +#
    607 +#  static unsigned int
    608 +#  pe_as32 (ptr)
    609 +#       void *ptr;
    610 +#  {
    611 +#    unsigned char *b = ptr;
    612 +#    return b[0] + (b[1]<<8) + (b[2]<<16) + (b[3]<<24);
    613 +#  }
    614 +#
    615 +#  int
    616 +#  main (argc, argv)
    617 +#      int argc;
    618 +#      char *argv[];
    619 +#  {
    620 +#      int dll;
    621 +#      unsigned long pe_header_offset, opthdr_ofs, num_entries, i;
    622 +#      unsigned long export_rva, export_size, nsections, secptr, expptr;
    623 +#      unsigned long name_rvas, nexp;
    624 +#      unsigned char *expdata, *erva;
    625 +#      char *filename, *dll_name;
    626 +#
    627 +#      filename = argv[1];
    628 +#
    629 +#      dll = open(filename, O_RDONLY|O_BINARY);
    630 +#      if (!dll)
    631 +#      return 1;
    632 +#
    633 +#      dll_name = filename;
    634 +#   
    635 +#      for (i=0; filename[i]; i++)
    636 +#      if (filename[i] == '/' || filename[i] == '\\'  || filename[i] == ':')
    637 +#          dll_name = filename + i +1;
    638 +#
    639 +#      pe_header_offset = pe_get32 (dll, 0x3c);
    640 +#      opthdr_ofs = pe_header_offset + 4 + 20;
    641 +#      num_entries = pe_get32 (dll, opthdr_ofs + 92);
    642 +#
    643 +#      if (num_entries < 1) /* no exports */
    644 +#      return 1;
    645 +#
    646 +#      export_rva = pe_get32 (dll, opthdr_ofs + 96);
    647 +#      export_size = pe_get32 (dll, opthdr_ofs + 100);
    648 +#      nsections = pe_get16 (dll, pe_header_offset + 4 +2);
    649 +#      secptr = (pe_header_offset + 4 + 20 +
    650 +#            pe_get16 (dll, pe_header_offset + 4 + 16));
    651 +#
    652 +#      expptr = 0;
    653 +#      for (i = 0; i < nsections; i++)
    654 +#      {
    655 +#      char sname[8];
    656 +#      unsigned long secptr1 = secptr + 40 * i;
    657 +#      unsigned long vaddr = pe_get32 (dll, secptr1 + 12);
    658 +#      unsigned long vsize = pe_get32 (dll, secptr1 + 16);
    659 +#      unsigned long fptr = pe_get32 (dll, secptr1 + 20);
    660 +#      lseek(dll, secptr1, SEEK_SET);
    661 +#      read(dll, sname, 8);
    662 +#      if (vaddr <= export_rva && vaddr+vsize > export_rva)
    663 +#      {
    664 +#          expptr = fptr + (export_rva - vaddr);
    665 +#          if (export_rva + export_size > vaddr + vsize)
    666 +#              export_size = vsize - (export_rva - vaddr);
    667 +#          break;
    668 +#      }
    669 +#      }
    670 +#
    671 +#      expdata = (unsigned char*)malloc(export_size);
    672 +#      lseek (dll, expptr, SEEK_SET);
    673 +#      read (dll, expdata, export_size);
    674 +#      erva = expdata - export_rva;
    675 +#
    676 +#      nexp = pe_as32 (expdata+24);
    677 +#      name_rvas = pe_as32 (expdata+32);
    678 +#
    679 +#      printf ("EXPORTS\n");
    680 +#      for (i = 0; i<nexp; i++)
    681 +#      {
    682 +#      unsigned long name_rva = pe_as32 (erva+name_rvas+i*4);
    683 +#      printf ("\t%s @ %ld ;\n", erva+name_rva, 1+ i);
    684 +#      }
    685 +#
    686 +#      return 0;
    687 +#  }
    688 +# /* impgen.c ends here */
    689 +      ;;
    690 +    *)
    691 +      allow_undefined=yes
    692 +      ;;
    693 +    esac
    694 +    compile_command="$nonopt"
    695 +    finalize_command="$nonopt"
    696  
    697 +    compile_rpath=
    698 +    finalize_rpath=
    699      compile_shlibpath=
    700      finalize_shlibpath=
    701 +    convenience=
    702 +    old_convenience=
    703      deplibs=
    704 +    linkopts=
    705 +
    706 +    if test -n "$shlibpath_var"; then
    707 +      # get the directories listed in $shlibpath_var
    708 +      eval lib_search_path=\`\$echo \"X \${$shlibpath_var}\" \| \$Xsed -e \'s/:/ /g\'\`
    709 +    else
    710 +      lib_search_path=
    711 +    fi
    712 +    # now prepend the system-specific ones
    713 +    eval lib_search_path=\"$sys_lib_search_path_spec\$lib_search_path\"
    714 +    eval sys_lib_dlsearch_path=\"$sys_lib_dlsearch_path_spec\"
    715 +   
    716 +    avoid_version=no
    717      dlfiles=
    718      dlprefiles=
    719 +    dlself=no
    720      export_dynamic=no
    721 -    hardcode_libdirs=
    722 +    export_symbols=
    723 +    export_symbols_regex=
    724 +    generated=
    725      libobjs=
    726      link_against_libtool_libs=
    727      ltlibs=
    728 +    module=no
    729      objs=
    730 +    prefer_static_libs=no
    731 +    preload=no
    732      prev=
    733      prevarg=
    734      release=
    735      rpath=
    736 +    xrpath=
    737      perm_rpath=
    738      temp_rpath=
    739 +    thread_safe=no
    740      vinfo=
    741  
    742      # We need to know -static, to get the right output filenames.
    743 @@ -396,13 +860,23 @@
    744      do
    745        case "$arg" in
    746        -all-static | -static)
    747 -        if test "X$arg" = "X-all-static" && test "$build_libtool_libs" = yes && test -z "$link_static_flag"; then
    748 +       if test "X$arg" = "X-all-static"; then
    749 +         if test "$build_libtool_libs" = yes && test -z "$link_static_flag"; then
    750             $echo "$modename: warning: complete static linking is impossible in this configuration" 1>&2
    751 -        fi
    752 -        build_libtool_libs=no
    753 +         fi
    754 +         if test -n "$link_static_flag"; then
    755 +           dlopen_self=$dlopen_self_static
    756 +         fi
    757 +       else
    758 +         if test -z "$pic_flag" && test -n "$link_static_flag"; then
    759 +           dlopen_self=$dlopen_self_static
    760 +         fi
    761 +       fi
    762 +       build_libtool_libs=no
    763         build_old_libs=yes
    764 -        break
    765 -        ;;
    766 +       prefer_static_libs=yes
    767 +       break
    768 +       ;;
    769        esac
    770      done
    771  
    772 @@ -410,44 +884,107 @@
    773      test -n "$old_archive_from_new_cmds" && build_old_libs=yes
    774  
    775      # Go through the arguments, transforming them on the way.
    776 -    for arg
    777 -    do
    778 +    while test $# -gt 0; do
    779 +      arg="$1"
    780 +      shift
    781 +
    782        # If the previous option needs an argument, assign it.
    783        if test -n "$prev"; then
    784 -        case "$prev" in
    785 -        output)
    786 -          compile_command="$compile_command @OUTPUT@"
    787 -          finalize_command="$finalize_command @OUTPUT@"
    788 -          ;;
    789 -        esac
    790 -
    791 -        case "$prev" in
    792 -        dlfiles|dlprefiles)
    793 -          case "$arg" in
    794 -          *.la | *.lo) ;;  # We handle these cases below.
    795 -          *)
    796 -            dlprefiles="$dlprefiles $arg"
    797 -            test "$prev" = dlfiles && dlfiles="$dlfiles $arg"
    798 -            prev=
    799 -            ;;
    800 -          esac
    801 -          ;;
    802 +       case "$prev" in
    803 +       output)
    804 +         compile_command="$compile_command @OUTPUT@"
    805 +         finalize_command="$finalize_command @OUTPUT@"
    806 +         ;;
    807 +       esac
    808 +
    809 +       case "$prev" in
    810 +       dlfiles|dlprefiles)
    811 +         if test "$preload" = no; then
    812 +           # Add the symbol object into the linking commands.
    813 +           compile_command="$compile_command @SYMFILE@"
    814 +           finalize_command="$finalize_command @SYMFILE@"
    815 +           preload=yes
    816 +         fi
    817 +         case "$arg" in
    818 +         *.la | *.lo) ;;  # We handle these cases below.
    819 +         force)
    820 +           if test "$dlself" = no; then
    821 +             dlself=needless
    822 +             export_dynamic=yes
    823 +           fi
    824 +           prev=
    825 +           continue
    826 +           ;;
    827 +         self)
    828 +           if test "$prev" = dlprefiles; then
    829 +             dlself=yes
    830 +           elif test "$prev" = dlfiles && test "$dlopen_self" != yes; then
    831 +             dlself=yes
    832 +           else
    833 +             dlself=needless
    834 +             export_dynamic=yes
    835 +           fi
    836 +           prev=
    837 +           continue
    838 +           ;;
    839 +         *)
    840 +           if test "$prev" = dlfiles; then
    841 +             dlfiles="$dlfiles $arg"
    842 +           else
    843 +             dlprefiles="$dlprefiles $arg"
    844 +           fi
    845 +           prev=
    846 +           ;;
    847 +         esac
    848 +         ;;
    849 +       expsyms)
    850 +         export_symbols="$arg"
    851 +         if test ! -f "$arg"; then
    852 +           $echo "$modename: symbol file \`$arg' does not exist"
    853 +           exit 1
    854 +         fi
    855 +         prev=
    856 +         continue
    857 +         ;;
    858 +       expsyms_regex)
    859 +         export_symbols_regex="$arg"
    860 +         prev=
    861 +         continue
    862 +         ;;
    863         release)
    864           release="-$arg"
    865           prev=
    866           continue
    867           ;;
    868 -        rpath)
    869 -          rpath="$rpath $arg"
    870 +       rpath | xrpath)
    871 +         # We need an absolute path.
    872 +         case "$arg" in
    873 +         [\\/]* | [A-Za-z]:[\\/]*) ;;
    874 +         *)
    875 +           $echo "$modename: only absolute run-paths are allowed" 1>&2
    876 +           exit 1
    877 +           ;;
    878 +         esac
    879 +         if test "$prev" = rpath; then
    880 +           case "$rpath " in
    881 +           *" $arg "*) ;;
    882 +           *) rpath="$rpath $arg" ;;
    883 +           esac
    884 +         else
    885 +           case "$xrpath " in
    886 +           *" $arg "*) ;;
    887 +           *) xrpath="$xrpath $arg" ;;
    888 +           esac
    889 +         fi
    890 +         prev=
    891 +         continue
    892 +         ;;
    893 +       *)
    894 +         eval "$prev=\"\$arg\""
    895           prev=
    896           continue
    897           ;;
    898 -        *)
    899 -          eval "$prev=\"\$arg\""
    900 -          prev=
    901 -          continue
    902 -          ;;
    903 -        esac
    904 +       esac
    905        fi
    906  
    907        prevarg="$arg"
    908 @@ -455,10 +992,10 @@
    909        case "$arg" in
    910        -all-static)
    911         if test -n "$link_static_flag"; then
    912 -          compile_command="$compile_command $link_static_flag"
    913 +         compile_command="$compile_command $link_static_flag"
    914           finalize_command="$finalize_command $link_static_flag"
    915 -        fi
    916 -        continue
    917 +       fi
    918 +       continue
    919         ;;
    920  
    921        -allow-undefined)
    922 @@ -467,46 +1004,107 @@
    923         continue
    924         ;;
    925  
    926 +      -avoid-version)
    927 +       avoid_version=yes
    928 +       continue
    929 +       ;;
    930 +
    931        -dlopen)
    932 -        prev=dlfiles
    933 -        continue
    934 -        ;;
    935 +       prev=dlfiles
    936 +       continue
    937 +       ;;
    938  
    939        -dlpreopen)
    940 -        prev=dlprefiles
    941 -        continue
    942 -        ;;
    943 +       prev=dlprefiles
    944 +       continue
    945 +       ;;
    946  
    947        -export-dynamic)
    948 -        if test "$export_dynamic" != yes; then
    949 -          export_dynamic=yes
    950 -         if test -n "$export_dynamic_flag_spec"; then
    951 -           eval arg=\"$export_dynamic_flag_spec\"
    952 -         else
    953 -           arg=
    954 -         fi
    955 +       export_dynamic=yes
    956 +       continue
    957 +       ;;
    958  
    959 -          # Add the symbol object into the linking commands.
    960 -         compile_command="$compile_command @SYMFILE@"
    961 -         finalize_command="$finalize_command @SYMFILE@"
    962 -        fi
    963 -        ;;
    964 +      -export-symbols | -export-symbols-regex)
    965 +       if test -n "$export_symbols" || test -n "$export_symbols_regex"; then
    966 +         $echo "$modename: not more than one -exported-symbols argument allowed"
    967 +         exit 1
    968 +       fi
    969 +       if test "X$arg" = "X-export-symbols"; then
    970 +         prev=expsyms
    971 +       else
    972 +         prev=expsyms_regex
    973 +       fi
    974 +       continue
    975 +       ;;
    976  
    977        -L*)
    978 -        dir=`$echo "X$arg" | $Xsed -e 's%^-L\(.*\)$%\1%'`
    979 -        case "$dir" in
    980 -        /* | [A-Za-z]:\\*)
    981 -         # Add the corresponding hardcode_libdir_flag, if it is not identical.
    982 -          ;;
    983 -        *)
    984 -          $echo "$modename: \`-L$dir' cannot specify a relative directory" 1>&2
    985 -          exit 1
    986 -          ;;
    987 -        esac
    988 -        deplibs="$deplibs $arg"
    989 -        ;;
    990 +       dir=`$echo "X$arg" | $Xsed -e 's/^-L//'`
    991 +       # We need an absolute path.
    992 +       case "$dir" in
    993 +       [\\/]* | [A-Za-z]:[\\/]*) ;;
    994 +       *)
    995 +         absdir=`cd "$dir" && pwd`
    996 +         if test -z "$absdir"; then
    997 +           $echo "$modename: warning: cannot determine absolute directory name of \`$dir'" 1>&2
    998 +           $echo "$modename: passing it literally to the linker, although it might fail" 1>&2
    999 +           absdir="$dir"
    1000 +         fi
    1001 +         dir="$absdir"
    1002 +         ;;
    1003 +       esac
    1004 +       case " $deplibs " in
    1005 +       *" $arg "*) ;;
    1006 +       *) deplibs="$deplibs $arg";;
    1007 +       esac
    1008 +       case " $lib_search_path " in
    1009 +       *" $dir "*) ;;
    1010 +       *) lib_search_path="$lib_search_path $dir";;
    1011 +       esac
    1012 +       case "$host" in
    1013 +       *-*-cygwin* | *-*-mingw* | *-*-os2*)
    1014 +         dllsearchdir=`cd "$dir" && pwd || echo "$dir"`
    1015 +         case ":$dllsearchpath:" in
    1016 +         ::) dllsearchpath="$dllsearchdir";;
    1017 +         *":$dllsearchdir:"*) ;;
    1018 +         *) dllsearchpath="$dllsearchpath:$dllsearchdir";;
    1019 +         esac
    1020 +         ;;
    1021 +       esac
    1022 +       ;;
    1023 +
    1024 +      -l*)
    1025 +       if test "$arg" = "-lc"; then
    1026 +         case "$host" in
    1027 +         *-*-cygwin* | *-*-mingw* | *-*-os2* | *-*-beos*)
    1028 +           # These systems don't actually have c library (as such)
    1029 +           continue
    1030 +           ;;
    1031 +         *-*-rhapsody* | *-*-darwin1.[012])
    1032 +           # Rhapsody C library is in the System framework
    1033 +           deplibs="$deplibs -framework System"
    1034 +           continue
    1035 +           ;;
    1036 +         esac
    1037 +       elif test "$arg" = "-lm"; then
    1038 +         case "$host" in
    1039 +         *-*-cygwin* | *-*-beos*)
    1040 +           # These systems don't actually have math library (as such)
    1041 +           continue
    1042 +           ;;
    1043 +         *-*-rhapsody* | *-*-darwin1.[012])
    1044 +           # Rhapsody math library is in the System framework
    1045 +           deplibs="$deplibs -framework System"
    1046 +           continue
    1047 +           ;;
    1048 +         esac
    1049 +       fi
    1050 +       deplibs="$deplibs $arg"
    1051 +       ;;
    1052  
    1053 -      -l*) deplibs="$deplibs $arg" ;;
    1054 +      -module)
    1055 +       module=yes
    1056 +       continue
    1057 +       ;;
    1058  
    1059        -no-undefined)
    1060         allow_undefined=no
    1061 @@ -521,23 +1119,50 @@
    1062         ;;
    1063  
    1064        -rpath)
    1065 -        prev=rpath
    1066 -        continue
    1067 -        ;;
    1068 +       prev=rpath
    1069 +       continue
    1070 +       ;;
    1071 +
    1072 +      -R)
    1073 +       prev=xrpath
    1074 +       continue
    1075 +       ;;
    1076 +
    1077 +      -R*)
    1078 +       dir=`$echo "X$arg" | $Xsed -e 's/^-R//'`
    1079 +       # We need an absolute path.
    1080 +       case "$dir" in
    1081 +       [\\/]* | [A-Za-z]:[\\/]*) ;;
    1082 +       *)
    1083 +         $echo "$modename: only absolute run-paths are allowed" 1>&2
    1084 +         exit 1
    1085 +         ;;
    1086 +       esac
    1087 +       case "$xrpath " in
    1088 +       *" $dir "*) ;;
    1089 +       *) xrpath="$xrpath $dir" ;;
    1090 +       esac
    1091 +       continue
    1092 +       ;;
    1093  
    1094        -static)
    1095         # If we have no pic_flag, then this is the same as -all-static.
    1096         if test -z "$pic_flag" && test -n "$link_static_flag"; then
    1097 -          compile_command="$compile_command $link_static_flag"
    1098 +         compile_command="$compile_command $link_static_flag"
    1099           finalize_command="$finalize_command $link_static_flag"
    1100 -        fi
    1101 +       fi
    1102 +       continue
    1103 +       ;;
    1104 +
    1105 +      -thread-safe)
    1106 +       thread_safe=yes
    1107         continue
    1108         ;;
    1109  
    1110        -version-info)
    1111 -        prev=vinfo
    1112 -        continue
    1113 -        ;;
    1114 +       prev=vinfo
    1115 +       continue
    1116 +       ;;
    1117  
    1118        # Some other compiler flag.
    1119        -* | +*)
    1120 @@ -549,18 +1174,18 @@
    1121           arg="\"$arg\""
    1122           ;;
    1123         esac
    1124 -        ;;
    1125 +       ;;
    1126  
    1127 -      *.o | *.a)
    1128 -        # A standard object.
    1129 -        objs="$objs $arg"
    1130 -        ;;
    1131 +      *.o | *.obj | *.a | *.lib)
    1132 +       # A standard object.
    1133 +       objs="$objs $arg"
    1134 +       ;;
    1135  
    1136        *.lo)
    1137 -        # A library object.
    1138 +       # A library object.
    1139         if test "$prev" = dlfiles; then
    1140           dlfiles="$dlfiles $arg"
    1141 -         if test "$build_libtool_libs" = yes; then
    1142 +         if test "$build_libtool_libs" = yes && test "$dlopen" = yes; then
    1143             prev=
    1144             continue
    1145           else
    1146 @@ -571,225 +1196,319 @@
    1147  
    1148         if test "$prev" = dlprefiles; then
    1149           # Preload the old-style object.
    1150 -         dlprefiles="$dlprefiles "`$echo "X$arg" | $Xsed -e 's/\.lo$/\.o/'`
    1151 +         dlprefiles="$dlprefiles "`$echo "X$arg" | $Xsed -e "$lo2o"`
    1152           prev=
    1153         fi
    1154         libobjs="$libobjs $arg"
    1155 -        ;;
    1156 +       ;;
    1157  
    1158        *.la)
    1159 -        # A libtool-controlled library.
    1160 -
    1161 -        dlname=
    1162 -        libdir=
    1163 -        library_names=
    1164 -        old_library=
    1165 -
    1166 -        # Check to see that this really is a libtool archive.
    1167 -        if (sed -e '2q' $arg | egrep '^# Generated by ltmain\.sh') >/dev/null 2>&1; then :
    1168 -        else
    1169 -          $echo "$modename: \`$arg' is not a valid libtool archive" 1>&2
    1170 -          exit 1
    1171 -        fi
    1172 -
    1173 -        # If there is no directory component, then add one.
    1174 -        case "$arg" in
    1175 -        */* | *\\*) . $arg ;;
    1176 -        *) . ./$arg ;;
    1177 -        esac
    1178 -
    1179 -        if test -z "$libdir"; then
    1180 -          $echo "$modename: \`$arg' contains no -rpath information" 1>&2
    1181 -          exit 1
    1182 -        fi
    1183 -
    1184 -        # Get the name of the library we link against.
    1185 -        linklib=
    1186 -        for l in $old_library $library_names; do
    1187 -          linklib="$l"
    1188 -        done
    1189 -
    1190 -        if test -z "$linklib"; then
    1191 -          $echo "$modename: cannot find name of link library for \`$arg'" 1>&2
    1192 -          exit 1
    1193 -        fi
    1194 -
    1195 -        # Find the relevant object directory and library name.
    1196 -        name=`$echo "X$arg" | $Xsed -e 's%^.*/%%' -e 's/\.la$//' -e 's/^lib//'`
    1197 -        dir=`$echo "X$arg" | $Xsed -e 's%/[^/]*$%%'`
    1198 -        if test "X$dir" = "X$arg"; then
    1199 -          dir="$objdir"
    1200 -        else
    1201 -          dir="$dir/$objdir"
    1202 -        fi
    1203 -
    1204 -        # This library was specified with -dlopen.
    1205 -        if test "$prev" = dlfiles; then
    1206 -          dlfiles="$dlfiles $arg"
    1207 -          if test -z "$dlname"; then
    1208 -            # If there is no dlname, we need to preload.
    1209 -            prev=dlprefiles
    1210 -          else
    1211 -            # We should not create a dependency on this library, but we
    1212 -           # may need any libraries it requires.
    1213 -           compile_command="$compile_command$dependency_libs"
    1214 -           finalize_command="$finalize_command$dependency_libs"
    1215 -            prev=
    1216 -            continue
    1217 -          fi
    1218 -        fi
    1219 -
    1220 -        # The library was specified with -dlpreopen.
    1221 -        if test "$prev" = dlprefiles; then
    1222 -          # Prefer using a static library (so that no silly _DYNAMIC symbols
    1223 -          # are required to link).
    1224 -          if test -n "$old_library"; then
    1225 -            dlprefiles="$dlprefiles $dir/$old_library"
    1226 -          else
    1227 -            dlprefiles="$dlprefiles $dir/$linklib"
    1228 -          fi
    1229 -          prev=
    1230 -        fi
    1231 -
    1232 -        if test "$build_libtool_libs" = yes && test -n "$library_names"; then
    1233 -          link_against_libtool_libs="$link_against_libtool_libs $arg"
    1234 -          if test -n "$shlibpath_var"; then
    1235 -            # Make sure the rpath contains only unique directories.
    1236 -            case "$temp_rpath " in
    1237 -            *" $dir "*) ;;
    1238 -            *) temp_rpath="$temp_rpath $dir" ;;
    1239 -            esac
    1240 -          fi
    1241 +       # A libtool-controlled library.
    1242  
    1243 -         # This is the magic to use -rpath.
    1244 -          if test -n "$hardcode_libdir_flag_spec"; then
    1245 -            if test -n "$hardcode_libdir_separator"; then
    1246 -              if test -z "$hardcode_libdirs"; then
    1247 -                # Put the magic libdir with the hardcode flag.
    1248 -                hardcode_libdirs="$libdir"
    1249 -                libdir="@HARDCODE_LIBDIRS@"
    1250 -              else
    1251 -                # Just accumulate the unique libdirs.
    1252 -               case "$hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator" in
    1253 -               *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*)
    1254 -                 ;;
    1255 -               *)
    1256 -                 hardcode_libdirs="$hardcode_libdirs$hardcode_libdir_separator$libdir"
    1257 -                 ;;
    1258 -               esac
    1259 -                libdir=
    1260 -              fi
    1261 -            fi
    1262 -
    1263 -            if test -n "$libdir"; then
    1264 -              eval flag=\"$hardcode_libdir_flag_spec\"
    1265 -
    1266 -              compile_command="$compile_command $flag"
    1267 -              finalize_command="$finalize_command $flag"
    1268 -            fi
    1269 -          elif test -n "$runpath_var"; then
    1270 -            # Do the same for the permanent run path.
    1271 -            case "$perm_rpath " in
    1272 -            *" $libdir "*) ;;
    1273 -            *) perm_rpath="$perm_rpath $libdir" ;;
    1274 -            esac
    1275 -          fi
    1276 -
    1277 -
    1278 -          case "$hardcode_action" in
    1279 -          immediate)
    1280 -            if test "$hardcode_direct" = no; then
    1281 -              compile_command="$compile_command $dir/$linklib"
    1282 -            elif test "$hardcode_minus_L" = no; then
    1283 -              compile_command="$compile_command -L$dir -l$name"
    1284 -            elif test "$hardcode_shlibpath_var" = no; then
    1285 -              compile_shlibpath="$compile_shlibpath$dir:"
    1286 -              compile_command="$compile_command -l$name"
    1287 -            fi
    1288 -            ;;
    1289 -
    1290 -          relink)
    1291 -            # We need an absolute path.
    1292 -            case "$dir" in
    1293 -            /* | [A-Za-z]:\\*) ;;
    1294 -            *)
    1295 -              absdir=`cd "$dir" && pwd`
    1296 -              if test -z "$absdir"; then
    1297 -                $echo "$modename: cannot determine absolute directory name of \`$dir'" 1>&2
    1298 -                exit 1
    1299 -              fi
    1300 -              dir="$absdir"
    1301 -              ;;
    1302 -            esac
    1303 -
    1304 -            if test "$hardcode_direct" = yes; then
    1305 -              compile_command="$compile_command $dir/$linklib"
    1306 -            elif test "$hardcode_minus_L" = yes; then
    1307 -              compile_command="$compile_command -L$dir -l$name"
    1308 -            elif test "$hardcode_shlibpath_var" = yes; then
    1309 -              compile_shlibpath="$compile_shlibpath$dir:"
    1310 -              compile_command="$compile_command -l$name"
    1311 -            fi
    1312 -            ;;
    1313 -
    1314 -          *)
    1315 -            $echo "$modename: \`$hardcode_action' is an unknown hardcode action" 1>&2
    1316 -            exit 1
    1317 -            ;;
    1318 -          esac
    1319 -
    1320 -          # Finalize command for both is simple: just hardcode it.
    1321 -          if test "$hardcode_direct" = yes; then
    1322 -            finalize_command="$finalize_command $libdir/$linklib"
    1323 -          elif test "$hardcode_minus_L" = yes; then
    1324 -            finalize_command="$finalize_command -L$libdir -l$name"
    1325 -          elif test "$hardcode_shlibpath_var" = yes; then
    1326 -            finalize_shlibpath="$finalize_shlibpath$libdir:"
    1327 -            finalize_command="$finalize_command -l$name"
    1328 -          else
    1329 -            # We cannot seem to hardcode it, guess we'll fake it.
    1330 -            finalize_command="$finalize_command -L$libdir -l$name"
    1331 -          fi
    1332 -        else
    1333 -          # Transform directly to old archives if we don't build new libraries.
    1334 -          if test -n "$pic_flag" && test -z "$old_library"; then
    1335 -            $echo "$modename: cannot find static library for \`$arg'" 1>&2
    1336 -            exit 1
    1337 -          fi
    1338 +       dlname=
    1339 +       libdir=
    1340 +       library_names=
    1341 +       old_library=
    1342  
    1343 -         # Here we assume that one of hardcode_direct or hardcode_minus_L
    1344 -         # is not unsupported.  This is valid on all known static and
    1345 -         # shared platforms.
    1346 -         if test "$hardcode_direct" != unsupported; then
    1347 -           test -n "$old_library" && linklib="$old_library"
    1348 -           compile_command="$compile_command $dir/$linklib"
    1349 -           finalize_command="$finalize_command $dir/$linklib"
    1350 -         else
    1351 -           compile_command="$compile_command -L$dir -l$name"
    1352 -           finalize_command="$finalize_command -L$dir -l$name"
    1353 -         fi
    1354 -        fi
    1355 +       # Check to see that this really is a libtool archive.
    1356 +       if (sed -e '2q' $arg | egrep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then :
    1357 +       else
    1358 +         $echo "$modename: \`$arg' is not a valid libtool archive" 1>&2
    1359 +         exit 1
    1360 +       fi
    1361  
    1362 -       # Add in any libraries that this one depends upon.
    1363 -       compile_command="$compile_command$dependency_libs"
    1364 -       finalize_command="$finalize_command$dependency_libs"
    1365 -       continue
    1366 -        ;;
    1367 +       # If the library was installed with an old release of libtool,
    1368 +       # it will not redefine variable installed.
    1369 +       installed=yes
    1370  
    1371 -      # Some other compiler argument.
    1372 -      *)
    1373 -       # Unknown arguments in both finalize_command and compile_command need
    1374 -       # to be aesthetically quoted because they are evaled later.
    1375 -       arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`
    1376 +       # Read the .la file
    1377 +       # If there is no directory component, then add one.
    1378         case "$arg" in
    1379 -       *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \   ]*|*]*)
    1380 -         arg="\"$arg\""
    1381 -         ;;
    1382 +       */* | *\\*) . $arg ;;
    1383 +       *) . ./$arg ;;
    1384         esac
    1385 -        ;;
    1386 -      esac
    1387  
    1388 -      # Now actually substitute the argument into the commands.
    1389 +       # Get the name of the library we link against.
    1390 +       linklib=
    1391 +       for l in $old_library $library_names; do
    1392 +         linklib="$l"
    1393 +       done
    1394 +
    1395 +       if test -z "$linklib"; then
    1396 +         $echo "$modename: cannot find name of link library for \`$arg'" 1>&2
    1397 +         exit 1
    1398 +       fi
    1399 +
    1400 +       # Find the relevant object directory and library name.
    1401 +       name=`$echo "X$arg" | $Xsed -e 's%^.*/%%' -e 's/\.la$//' -e 's/^lib//'`
    1402 +
    1403 +       if test "X$installed" = Xyes; then
    1404 +         dir="$libdir"
    1405 +       else
    1406 +         dir=`$echo "X$arg" | $Xsed -e 's%/[^/]*$%%'`
    1407 +         if test "X$dir" = "X$arg"; then
    1408 +           dir="$objdir"
    1409 +         else
    1410 +           dir="$dir/$objdir"
    1411 +         fi
    1412 +       fi
    1413 +
    1414 +       if test -n "$dependency_libs"; then
    1415 +         # Extract -R and -L from dependency_libs
    1416 +         temp_deplibs=
    1417 +         for deplib in $dependency_libs; do
    1418 +           case "$deplib" in
    1419 +           -R*) temp_xrpath=`$echo "X$deplib" | $Xsed -e 's/^-R//'`
    1420 +                case " $rpath $xrpath " in
    1421 +                *" $temp_xrpath "*) ;;
    1422 +                *) xrpath="$xrpath $temp_xrpath";;
    1423 +                esac;;
    1424 +           -L*) case "$compile_command $temp_deplibs " in
    1425 +                *" $deplib "*) ;;
    1426 +                *) temp_deplibs="$temp_deplibs $deplib";;
    1427 +                esac
    1428 +                temp_dir=`$echo "X$deplib" | $Xsed -e 's/^-L//'`
    1429 +                case " $lib_search_path " in
    1430 +                *" $temp_dir "*) ;;
    1431 +                *) lib_search_path="$lib_search_path $temp_dir";;
    1432 +                esac
    1433 +                ;;
    1434 +           *) temp_deplibs="$temp_deplibs $deplib";;
    1435 +           esac
    1436 +         done
    1437 +         dependency_libs="$temp_deplibs"
    1438 +       fi
    1439 +
    1440 +       if test -z "$libdir"; then
    1441 +         # It is a libtool convenience library, so add in its objects.
    1442 +         convenience="$convenience $dir/$old_library"
    1443 +         old_convenience="$old_convenience $dir/$old_library"
    1444 +         deplibs="$deplibs$dependency_libs"
    1445 +         compile_command="$compile_command $dir/$old_library$dependency_libs"
    1446 +         finalize_command="$finalize_command $dir/$old_library$dependency_libs"
    1447 +         continue
    1448 +       fi
    1449 +
    1450 +       # This library was specified with -dlopen.
    1451 +       if test "$prev" = dlfiles; then
    1452 +         dlfiles="$dlfiles $arg"
    1453 +         if test -z "$dlname" || test "$dlopen" != yes || test "$build_libtool_libs" = no; then
    1454 +           # If there is no dlname, no dlopen support or we're linking statically,
    1455 +           # we need to preload.
    1456 +           prev=dlprefiles
    1457 +         else
    1458 +           # We should not create a dependency on this library, but we
    1459 +           # may need any libraries it requires.
    1460 +           compile_command="$compile_command$dependency_libs"
    1461 +           finalize_command="$finalize_command$dependency_libs"
    1462 +           prev=
    1463 +           continue
    1464 +         fi
    1465 +       fi
    1466 +
    1467 +       # The library was specified with -dlpreopen.
    1468 +       if test "$prev" = dlprefiles; then
    1469 +         # Prefer using a static library (so that no silly _DYNAMIC symbols
    1470 +         # are required to link).
    1471 +         if test -n "$old_library"; then
    1472 +           dlprefiles="$dlprefiles $dir/$old_library"
    1473 +         else
    1474 +           dlprefiles="$dlprefiles $dir/$linklib"
    1475 +         fi
    1476 +         prev=
    1477 +       fi
    1478 +
    1479 +       if test -n "$library_names" &&
    1480 +          { test "$prefer_static_libs" = no || test -z "$old_library"; }; then
    1481 +         link_against_libtool_libs="$link_against_libtool_libs $arg"
    1482 +         if test -n "$shlibpath_var"; then
    1483 +           # Make sure the rpath contains only unique directories.
    1484 +           case "$temp_rpath " in
    1485 +           *" $dir "*) ;;
    1486 +           *) temp_rpath="$temp_rpath $dir" ;;
    1487 +           esac
    1488 +         fi
    1489 +
    1490 +         # We need an absolute path.
    1491 +         case "$dir" in
    1492 +         [\\/] | [A-Za-z]:[\\/]*) absdir="$dir" ;;
    1493 +         *)
    1494 +           absdir=`cd "$dir" && pwd`
    1495 +           if test -z "$absdir"; then
    1496 +             $echo "$modename: warning: cannot determine absolute directory name of \`$dir'" 1>&2
    1497 +             $echo "$modename: passing it literally to the linker, although it might fail" 1>&2
    1498 +             absdir="$dir"
    1499 +           fi
    1500 +           ;;
    1501 +         esac
    1502 +         
    1503 +         # This is the magic to use -rpath.
    1504 +         # Skip directories that are in the system default run-time
    1505 +         # search path, unless they have been requested with -R.
    1506 +         case " $sys_lib_dlsearch_path " in
    1507 +         *" $absdir "*) ;;
    1508 +         *)
    1509 +           case "$compile_rpath " in
    1510 +           *" $absdir "*) ;;
    1511 +           *) compile_rpath="$compile_rpath $absdir"
    1512 +           esac
    1513 +           ;;
    1514 +         esac
    1515 +
    1516 +         case " $sys_lib_dlsearch_path " in
    1517 +         *" $libdir "*) ;;
    1518 +         *)
    1519 +           case "$finalize_rpath " in
    1520 +           *" $libdir "*) ;;
    1521 +           *) finalize_rpath="$finalize_rpath $libdir"
    1522 +           esac
    1523 +           ;;
    1524 +         esac
    1525 +
    1526 +         lib_linked=yes
    1527 +         case "$hardcode_action" in
    1528 +         immediate | unsupported)
    1529 +           if test "$hardcode_direct" = no; then
    1530 +             compile_command="$compile_command $dir/$linklib"
    1531 +             deplibs="$deplibs $dir/$linklib"
    1532 +             case "$host" in
    1533 +             *-*-cygwin* | *-*-mingw* | *-*-os2*)
    1534 +               dllsearchdir=`cd "$dir" && pwd || echo "$dir"`
    1535 +               if test -n "$dllsearchpath"; then
    1536 +                 dllsearchpath="$dllsearchpath:$dllsearchdir"
    1537 +               else
    1538 +                 dllsearchpath="$dllsearchdir"
    1539 +               fi
    1540 +               ;;
    1541 +             esac
    1542 +           elif test "$hardcode_minus_L" = no; then
    1543 +             case "$host" in
    1544 +             *-*-sunos*)
    1545 +               compile_shlibpath="$compile_shlibpath$dir:"
    1546 +               ;;
    1547 +             esac
    1548 +             case "$compile_command " in
    1549 +             *" -L$dir "*) ;;
    1550 +             *) compile_command="$compile_command -L$dir";;
    1551 +             esac
    1552 +             compile_command="$compile_command -l$name"
    1553 +             deplibs="$deplibs -L$dir -l$name"
    1554 +           elif test "$hardcode_shlibpath_var" = no; then
    1555 +             case ":$compile_shlibpath:" in
    1556 +             *":$dir:"*) ;;
    1557 +             *) compile_shlibpath="$compile_shlibpath$dir:";;
    1558 +             esac
    1559 +             compile_command="$compile_command -l$name"
    1560 +             deplibs="$deplibs -l$name"
    1561 +           else
    1562 +             lib_linked=no
    1563 +           fi
    1564 +           ;;
    1565 +
    1566 +         relink)
    1567 +           if test "$hardcode_direct" = yes; then
    1568 +             compile_command="$compile_command $absdir/$linklib"
    1569 +             deplibs="$deplibs $absdir/$linklib"
    1570 +           elif test "$hardcode_minus_L" = yes; then
    1571 +             case "$compile_command " in
    1572 +             *" -L$absdir "*) ;;
    1573 +             *) compile_command="$compile_command -L$absdir";;
    1574 +             esac
    1575 +             compile_command="$compile_command -l$name"
    1576 +             deplibs="$deplibs -L$absdir -l$name"
    1577 +           elif test "$hardcode_shlibpath_var" = yes; then
    1578 +             case ":$compile_shlibpath:" in
    1579 +             *":$absdir:"*) ;;
    1580 +             *) compile_shlibpath="$compile_shlibpath$absdir:";;
    1581 +             esac
    1582 +             compile_command="$compile_command -l$name"
    1583 +             deplibs="$deplibs -l$name"
    1584 +           else
    1585 +             lib_linked=no
    1586 +           fi
    1587 +           ;;
    1588 +
    1589 +         *)
    1590 +           lib_linked=no
    1591 +           ;;
    1592 +         esac
    1593 +
    1594 +         if test "$lib_linked" != yes; then
    1595 +           $echo "$modename: configuration error: unsupported hardcode properties"
    1596 +           exit 1
    1597 +         fi
    1598 +
    1599 +         # Finalize command for both is simple: just hardcode it.
    1600 +         if test "$hardcode_direct" = yes; then
    1601 +           finalize_command="$finalize_command $libdir/$linklib"
    1602 +         elif test "$hardcode_minus_L" = yes; then
    1603 +           case "$finalize_command " in
    1604 +           *" -L$libdir "*) ;;
    1605 +           *) finalize_command="$finalize_command -L$libdir";;
    1606 +           esac
    1607 +           finalize_command="$finalize_command -l$name"
    1608 +         elif test "$hardcode_shlibpath_var" = yes; then
    1609 +           case ":$finalize_shlibpath:" in
    1610 +           *":$libdir:"*) ;;
    1611 +           *) finalize_shlibpath="$finalize_shlibpath$libdir:";;
    1612 +           esac
    1613 +           finalize_command="$finalize_command -l$name"
    1614 +         else
    1615 +           # We cannot seem to hardcode it, guess we'll fake it.
    1616 +           case "$finalize_command " in
    1617 +           *" -L$dir "*) ;;
    1618 +           *) finalize_command="$finalize_command -L$libdir";;
    1619 +           esac
    1620 +           finalize_command="$finalize_command -l$name"
    1621 +         fi
    1622 +       else
    1623 +         # Transform directly to old archives if we don't build new libraries.
    1624 +         if test -n "$pic_flag" && test -z "$old_library"; then
    1625 +           $echo "$modename: cannot find static library for \`$arg'" 1>&2
    1626 +           exit 1
    1627 +         fi
    1628 +
    1629 +         # Here we assume that one of hardcode_direct or hardcode_minus_L
    1630 +         # is not unsupported.  This is valid on all known static and
    1631 +         # shared platforms.
    1632 +         if test "$hardcode_direct" != unsupported; then
    1633 +           test -n "$old_library" && linklib="$old_library"
    1634 +           compile_command="$compile_command $dir/$linklib"
    1635 +           finalize_command="$finalize_command $dir/$linklib"
    1636 +         else
    1637 +           case "$compile_command " in
    1638 +           *" -L$dir "*) ;;
    1639 +           *) compile_command="$compile_command -L$dir";;
    1640 +           esac
    1641 +           compile_command="$compile_command -l$name"
    1642 +           case "$finalize_command " in
    1643 +           *" -L$dir "*) ;;
    1644 +           *) finalize_command="$finalize_command -L$dir";;
    1645 +           esac
    1646 +           finalize_command="$finalize_command -l$name"
    1647 +         fi
    1648 +       fi
    1649 +
    1650 +       # Add in any libraries that this one depends upon.
    1651 +       compile_command="$compile_command$dependency_libs"
    1652 +       finalize_command="$finalize_command$dependency_libs"
    1653 +       continue
    1654 +       ;;
    1655 +
    1656 +      # Some other compiler argument.
    1657 +      *)
    1658 +       # Unknown arguments in both finalize_command and compile_command need
    1659 +       # to be aesthetically quoted because they are evaled later.
    1660 +       arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`
    1661 +       case "$arg" in
    1662 +       *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \   ]*|*]*)
    1663 +         arg="\"$arg\""
    1664 +         ;;
    1665 +       esac
    1666 +       ;;
    1667 +      esac
    1668 +
    1669 +      # Now actually substitute the argument into the commands.
    1670        if test -n "$arg"; then
    1671         compile_command="$compile_command $arg"
    1672         finalize_command="$finalize_command $arg"
    1673 @@ -802,14 +1521,17 @@
    1674        exit 1
    1675      fi
    1676  
    1677 -    if test -n "$vinfo" && test -n "$release"; then
    1678 -      $echo "$modename: you cannot specify both \`-version-info' and \`-release'" 1>&2
    1679 -      $echo "$help" 1>&2
    1680 -      exit 1
    1681 +    if test "$export_dynamic" = yes && test -n "$export_dynamic_flag_spec"; then
    1682 +      eval arg=\"$export_dynamic_flag_spec\"
    1683 +      compile_command="$compile_command $arg"
    1684 +      finalize_command="$finalize_command $arg"
    1685      fi
    1686  
    1687 -    oldlib=
    1688 -    oldobjs=
    1689 +    oldlibs=
    1690 +    # calculate the name of the file, without its directory
    1691 +    outputname=`$echo "X$output" | $Xsed -e 's%^.*/%%'`
    1692 +    libobjs_save="$libobjs"
    1693 +
    1694      case "$output" in
    1695      "")
    1696        $echo "$modename: you must specify an output file" 1>&2
    1697 @@ -817,64 +1539,88 @@
    1698        exit 1
    1699        ;;
    1700  
    1701 -    */* | *\\*)
    1702 -      $echo "$modename: output file \`$output' must have no directory components" 1>&2
    1703 -      exit 1
    1704 -      ;;
    1705 +    *.a | *.lib)
    1706 +      if test -n "$link_against_libtool_libs"; then
    1707 +       $echo "$modename: error: cannot link libtool libraries into archives" 1>&2
    1708 +       exit 1
    1709 +      fi
    1710 +
    1711 +      if test -n "$deplibs"; then
    1712 +       $echo "$modename: warning: \`-l' and \`-L' are ignored for archives" 1>&2
    1713 +      fi
    1714 +
    1715 +      if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then
    1716 +       $echo "$modename: warning: \`-dlopen' is ignored for archives" 1>&2
    1717 +      fi
    1718 +
    1719 +      if test -n "$rpath"; then
    1720 +       $echo "$modename: warning: \`-rpath' is ignored for archives" 1>&2
    1721 +      fi
    1722 +
    1723 +      if test -n "$xrpath"; then
    1724 +       $echo "$modename: warning: \`-R' is ignored for archives" 1>&2
    1725 +      fi
    1726 +
    1727 +      if test -n "$vinfo"; then
    1728 +       $echo "$modename: warning: \`-version-info' is ignored for archives" 1>&2
    1729 +      fi
    1730 +
    1731 +      if test -n "$release"; then
    1732 +       $echo "$modename: warning: \`-release' is ignored for archives" 1>&2
    1733 +      fi
    1734 +
    1735 +      if test -n "$export_symbols" || test -n "$export_symbols_regex"; then
    1736 +       $echo "$modename: warning: \`-export-symbols' is ignored for archives" 1>&2
    1737 +      fi
    1738  
    1739 -    *.a)
    1740        # Now set the variables for building old libraries.
    1741        build_libtool_libs=no
    1742 -      build_old_libs=yes
    1743 -      oldlib="$output"
    1744 -      $show "$rm $oldlib"
    1745 -      $run $rm $oldlib
    1746 +      oldlibs="$output"
    1747        ;;
    1748  
    1749      *.la)
    1750        # Make sure we only generate libraries of the form `libNAME.la'.
    1751 -      case "$output" in
    1752 -      lib*) ;;
    1753 +      case "$outputname" in
    1754 +      lib*)
    1755 +       name=`$echo "X$outputname" | $Xsed -e 's/\.la$//' -e 's/^lib//'`
    1756 +       eval libname=\"$libname_spec\"
    1757 +       ;;
    1758        *)
    1759 -       $echo "$modename: libtool library \`$arg' must begin with \`lib'" 1>&2
    1760 -       $echo "$help" 1>&2
    1761 -       exit 1
    1762 +       if test "$module" = no; then
    1763 +         $echo "$modename: libtool library \`$output' must begin with \`lib'" 1>&2
    1764 +         $echo "$help" 1>&2
    1765 +         exit 1
    1766 +       fi
    1767 +       if test "$need_lib_prefix" != no; then
    1768 +         # Add the "lib" prefix for modules if required
    1769 +         name=`$echo "X$outputname" | $Xsed -e 's/\.la$//'`
    1770 +         eval libname=\"$libname_spec\"
    1771 +       else
    1772 +         libname=`$echo "X$outputname" | $Xsed -e 's/\.la$//'`
    1773 +       fi
    1774         ;;
    1775        esac
    1776  
    1777 -      name=`$echo "X$output" | $Xsed -e 's/\.la$//' -e 's/^lib//'`
    1778 -      eval libname=\"$libname_spec\"
    1779 -
    1780 -      # All the library-specific variables (install_libdir is set above).
    1781 -      library_names=
    1782 -      old_library=
    1783 -      dlname=
    1784 -      current=0
    1785 -      revision=0
    1786 -      age=0
    1787 +      output_objdir=`$echo "X$output" | $Xsed -e 's%/[^/]*$%%'`
    1788 +      if test "X$output_objdir" = "X$output"; then
    1789 +       output_objdir="$objdir"
    1790 +      else
    1791 +       output_objdir="$output_objdir/$objdir"
    1792 +      fi
    1793  
    1794        if test -n "$objs"; then
    1795 -        $echo "$modename: cannot build libtool library \`$output' from non-libtool objects:$objs" 2>&1
    1796 -        exit 1
    1797 +       $echo "$modename: cannot build libtool library \`$output' from non-libtool objects:$objs" 2>&1
    1798 +       exit 1
    1799        fi
    1800  
    1801        # How the heck are we supposed to write a wrapper for a shared library?
    1802        if test -n "$link_against_libtool_libs"; then
    1803 -        $echo "$modename: libtool library \`$output' may not depend on uninstalled libraries:$link_against_libtool_libs" 1>&2
    1804 -        exit 1
    1805 +        $echo "$modename: error: cannot link shared libraries into libtool libraries" 1>&2
    1806 +        exit 1
    1807        fi
    1808  
    1809 -      if test -n "$dlfiles$dlprefiles"; then
    1810 -        $echo "$modename: warning: \`-dlopen' is ignored while creating libtool libraries" 1>&2
    1811 -        # Nullify the symbol file.
    1812 -        compile_command=`$echo "X$compile_command" | $Xsed -e "s% @SYMFILE@%%"`
    1813 -        finalize_command=`$echo "X$finalize_command" | $Xsed -e "s% @SYMFILE@%%"`
    1814 -      fi
    1815 -
    1816 -      if test -z "$rpath"; then
    1817 -        $echo "$modename: you must specify an installation directory with \`-rpath'" 1>&2
    1818 -       $echo "$help" 1>&2
    1819 -        exit 1
    1820 +      if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then
    1821 +       $echo "$modename: warning: \`-dlopen' is ignored for libtool libraries" 1>&2
    1822        fi
    1823  
    1824        set dummy $rpath
    1825 @@ -883,587 +1629,1239 @@
    1826        fi
    1827        install_libdir="$2"
    1828  
    1829 -      # Parse the version information argument.
    1830 -      IFS="${IFS=      }"; save_ifs="$IFS"; IFS=':'
    1831 -      set dummy $vinfo
    1832 -      IFS="$save_ifs"
    1833 +      oldlibs=
    1834 +      if test -z "$rpath"; then
    1835 +       if test "$build_libtool_libs" = yes; then
    1836 +         # Building a libtool convenience library.
    1837 +         libext=al
    1838 +         oldlibs="$output_objdir/$libname.$libext $oldlibs"
    1839 +         build_libtool_libs=convenience
    1840 +         build_old_libs=yes
    1841 +       fi
    1842 +       dependency_libs="$deplibs"
    1843  
    1844 -      if test -n "$5"; then
    1845 -        $echo "$modename: too many parameters to \`-version-info'" 1>&2
    1846 -        $echo "$help" 1>&2
    1847 -        exit 1
    1848 -      fi
    1849 +       if test -n "$vinfo"; then
    1850 +         $echo "$modename: warning: \`-version-info' is ignored for convenience libraries" 1>&2
    1851 +       fi
    1852  
    1853 -      test -n "$2" && current="$2"
    1854 -      test -n "$3" && revision="$3"
    1855 -      test -n "$4" && age="$4"
    1856 -
    1857 -      # Check that each of the things are valid numbers.
    1858 -      case "$current" in
    1859 -      0 | [1-9] | [1-9][0-9]*) ;;
    1860 -      *)
    1861 -        $echo "$modename: CURRENT \`$current' is not a nonnegative integer" 1>&2
    1862 -        $echo "$modename: \`$vinfo' is not valid version information" 1>&2
    1863 -        exit 1
    1864 -        ;;
    1865 -      esac
    1866 +       if test -n "$release"; then
    1867 +         $echo "$modename: warning: \`-release' is ignored for convenience libraries" 1>&2
    1868 +       fi
    1869 +      else
    1870  
    1871 -      case "$revision" in
    1872 -      0 | [1-9] | [1-9][0-9]*) ;;
    1873 -      *)
    1874 -        $echo "$modename: REVISION \`$revision' is not a nonnegative integer" 1>&2
    1875 -        $echo "$modename: \`$vinfo' is not valid version information" 1>&2
    1876 -        exit 1
    1877 -        ;;
    1878 -      esac
    1879 +       # Parse the version information argument.
    1880 +       IFS="${IFS=     }"; save_ifs="$IFS"; IFS=':'
    1881 +       set dummy $vinfo 0 0 0
    1882 +       IFS="$save_ifs"
    1883 +
    1884 +       if test -n "$8"; then
    1885 +         $echo "$modename: too many parameters to \`-version-info'" 1>&2
    1886 +         $echo "$help" 1>&2
    1887 +         exit 1
    1888 +       fi
    1889  
    1890 -      case "$age" in
    1891 -      0 | [1-9] | [1-9][0-9]*) ;;
    1892 -      *)
    1893 -        $echo "$modename: AGE \`$age' is not a nonnegative integer" 1>&2
    1894 -        $echo "$modename: \`$vinfo' is not valid version information" 1>&2
    1895 -        exit 1
    1896 -        ;;
    1897 -      esac
    1898 +       current="$2"
    1899 +       revision="$3"
    1900 +       age="$4"
    1901 +
    1902 +       # Check that each of the things are valid numbers.
    1903 +       case "$current" in
    1904 +       0 | [1-9] | [1-9][0-9]*) ;;
    1905 +       *)
    1906 +         $echo "$modename: CURRENT \`$current' is not a nonnegative integer" 1>&2
    1907 +         $echo "$modename: \`$vinfo' is not valid version information" 1>&2
    1908 +         exit 1
    1909 +         ;;
    1910 +       esac
    1911  
    1912 -      if test $age -gt $current; then
    1913 -        $echo "$modename: AGE \`$age' is greater than the current interface number \`$current'" 1>&2
    1914 -        $echo "$modename: \`$vinfo' is not valid version information" 1>&2
    1915 -        exit 1
    1916 -      fi
    1917 -
    1918 -      # Calculate the version variables.
    1919 -      version_vars="version_type current age revision"
    1920 -      case "$version_type" in
    1921 -      none) ;;
    1922 -
    1923 -      linux)
    1924 -        version_vars="$version_vars major versuffix"
    1925 -        major=`expr $current - $age`
    1926 -        versuffix="$major.$age.$revision"
    1927 -        ;;
    1928 -
    1929 -      osf)
    1930 -        version_vars="$version_vars versuffix verstring"
    1931 -        major=`expr $current - $age`
    1932 -        versuffix="$current.$age.$revision"
    1933 -        verstring="$versuffix"
    1934 -
    1935 -        # Add in all the interfaces that we are compatible with.
    1936 -        loop=$age
    1937 -        while test $loop != 0; do
    1938 -          iface=`expr $current - $loop`
    1939 -          loop=`expr $loop - 1`
    1940 -          verstring="$verstring:${iface}.0"
    1941 -        done
    1942 -
    1943 -        # Make executables depend on our current version.
    1944 -        verstring="$verstring:${current}.0"
    1945 -        ;;
    1946 -
    1947 -      sunos)
    1948 -        version_vars="$version_vars major versuffix"
    1949 -        major="$current"
    1950 -        versuffix="$current.$revision"
    1951 -        ;;
    1952 +       case "$revision" in
    1953 +       0 | [1-9] | [1-9][0-9]*) ;;
    1954 +       *)
    1955 +         $echo "$modename: REVISION \`$revision' is not a nonnegative integer" 1>&2
    1956 +         $echo "$modename: \`$vinfo' is not valid version information" 1>&2
    1957 +         exit 1
    1958 +         ;;
    1959 +       esac
    1960  
    1961 -      *)
    1962 -        $echo "$modename: unknown library version type \`$version_type'" 1>&2
    1963 -        echo "Fatal configuration error.  See the $PACKAGE docs for more information." 1>&2
    1964 -        exit 1
    1965 -        ;;
    1966 -      esac
    1967 +       case "$age" in
    1968 +       0 | [1-9] | [1-9][0-9]*) ;;
    1969 +       *)
    1970 +         $echo "$modename: AGE \`$age' is not a nonnegative integer" 1>&2
    1971 +         $echo "$modename: \`$vinfo' is not valid version information" 1>&2
    1972 +         exit 1
    1973 +         ;;
    1974 +       esac
    1975 +
    1976 +       if test $age -gt $current; then
    1977 +         $echo "$modename: AGE \`$age' is greater than the current interface number \`$current'" 1>&2
    1978 +         $echo "$modename: \`$vinfo' is not valid version information" 1>&2
    1979 +         exit 1
    1980 +       fi
    1981 +
    1982 +       # Calculate the version variables.
    1983 +       major=
    1984 +       versuffix=
    1985 +       verstring=
    1986 +       case "$version_type" in
    1987 +       none) ;;
    1988 +
    1989 +       irix)
    1990 +         major=`expr $current - $age + 1`
    1991 +         versuffix="$major.$revision"
    1992 +         verstring="sgi$major.$revision"
    1993 +
    1994 +         # Add in all the interfaces that we are compatible with.
    1995 +         loop=$revision
    1996 +         while test $loop != 0; do
    1997 +           iface=`expr $revision - $loop`
    1998 +           loop=`expr $loop - 1`
    1999 +           verstring="sgi$major.$iface:$verstring"
    2000 +         done
    2001 +         ;;
    2002 +
    2003 +       linux)
    2004 +         major=.`expr $current - $age`
    2005 +         versuffix="$major.$age.$revision"
    2006 +         ;;
    2007 +
    2008 +       osf)
    2009 +         major=`expr $current - $age`
    2010 +         versuffix=".$current.$age.$revision"
    2011 +         verstring="$current.$age.$revision"
    2012 +
    2013 +         # Add in all the interfaces that we are compatible with.
    2014 +         loop=$age
    2015 +         while test $loop != 0; do
    2016 +           iface=`expr $current - $loop`
    2017 +           loop=`expr $loop - 1`
    2018 +           verstring="$verstring:${iface}.0"
    2019 +         done
    2020 +
    2021 +         # Make executables depend on our current version.
    2022 +         verstring="$verstring:${current}.0"
    2023 +         ;;
    2024 +
    2025 +       sunos)
    2026 +         major=".$current"
    2027 +         versuffix=".$current.$revision"
    2028 +         ;;
    2029 +
    2030 +       freebsd-aout)
    2031 +         major=".$current"
    2032 +         versuffix=".$current.$revision";
    2033 +         ;;
    2034 +
    2035 +       freebsd-elf)
    2036 +         major=".$current"
    2037 +         versuffix=".$current";
    2038 +         ;;
    2039 +
    2040 +       windows)
    2041 +         # Like Linux, but with '-' rather than '.', since we only
    2042 +         # want one extension on Windows 95.
    2043 +         major=`expr $current - $age`
    2044 +         versuffix="-$major-$age-$revision"
    2045 +         ;;
    2046 +
    2047 +       darwin)
    2048 +         # Like Linux, but with the current version available in
    2049 +         # verstring for coding it into the library header
    2050 +         major=.`expr $current - $age`
    2051 +         versuffix="$major.$age.$revision"
    2052 +         # Darwin ld doesn't like 0 for these options...
    2053 +         minor_current=`expr $current + 1`
    2054 +         verstring="-compatibility_version $minor_current -current_version $minor_current.$revision"
    2055 +         ;;
    2056 +
    2057 +       *)
    2058 +         $echo "$modename: unknown library version type \`$version_type'" 1>&2
    2059 +         echo "Fatal configuration error.  See the $PACKAGE docs for more information." 1>&2
    2060 +         exit 1
    2061 +         ;;
    2062 +       esac
    2063 +
    2064 +       # Clear the version info if we defaulted, and they specified a release.
    2065 +       if test -z "$vinfo" && test -n "$release"; then
    2066 +         major=
    2067 +         case "$version_type" in
    2068 +         darwin)
    2069 +           # we can't check for "0.0" in archive_cmds due to quoting
    2070 +           # problems, so we reset it completely
    2071 +           verstring=""
    2072 +           ;;
    2073 +         *)
    2074 +           verstring="0.0"
    2075 +           ;;
    2076 +         esac
    2077 +         if test "$need_version" = no; then
    2078 +           versuffix=
    2079 +         else
    2080 +           versuffix=".0.0"
    2081 +         fi
    2082 +       fi
    2083 +
    2084 +       # Remove version info from name if versioning should be avoided
    2085 +       if test "$avoid_version" = yes && test "$need_version" = no; then
    2086 +         major=
    2087 +         versuffix=
    2088 +         verstring=""
    2089 +       fi
    2090 +       
    2091 +       # Check to see if the archive will have undefined symbols.
    2092 +       if test "$allow_undefined" = yes; then
    2093 +         if test "$allow_undefined_flag" = unsupported; then
    2094 +           $echo "$modename: warning: undefined symbols not allowed in $host shared libraries" 1>&2
    2095 +           build_libtool_libs=no
    2096 +           build_old_libs=yes
    2097 +         fi
    2098 +       else
    2099 +         # Don't allow undefined symbols.
    2100 +         allow_undefined_flag="$no_undefined_flag"
    2101 +       fi
    2102 +
    2103 +       dependency_libs="$deplibs"
    2104 +       case "$host" in
    2105 +       *-*-cygwin* | *-*-mingw* | *-*-os2* | *-*-beos*)
    2106 +         # these systems don't actually have a c library (as such)!
    2107 +         ;;
    2108 +        *-*-rhapsody* | *-*-darwin1.[012])
    2109 +         # Rhapsody C library is in the System framework
    2110 +         deplibs="$deplibs -framework System"
    2111 +         ;;
    2112 +       *)
    2113 +         # Add libc to deplibs on all other systems.
    2114 +         deplibs="$deplibs -lc"
    2115 +         ;;
    2116 +       esac
    2117 +      fi
    2118  
    2119        # Create the output directory, or remove our outputs if we need to.
    2120 -      if test -d $objdir; then
    2121 -        $show "$rm $objdir/$output $objdir/$libname.* $objdir/${libname}${release}.*"
    2122 -        $run $rm $objdir/$output $objdir/$libname.* $objdir/${libname}${release}.*
    2123 +      if test -d $output_objdir; then
    2124 +       $show "${rm}r $output_objdir/$outputname $output_objdir/$libname.* $output_objdir/${libname}${release}.*"
    2125 +       $run ${rm}r $output_objdir/$outputname $output_objdir/$libname.* $output_objdir/${libname}${release}.*
    2126        else
    2127 -        $show "$mkdir $objdir"
    2128 -        $run $mkdir $objdir
    2129 +       $show "$mkdir $output_objdir"
    2130 +       $run $mkdir $output_objdir
    2131         status=$?
    2132 -       if test $status -eq 0 || test -d $objdir; then :
    2133 -       else
    2134 +       if test $status -ne 0 && test ! -d $output_objdir; then
    2135           exit $status
    2136         fi
    2137        fi
    2138  
    2139 -      # Check to see if the archive will have undefined symbols.
    2140 -      if test "$allow_undefined" = yes; then
    2141 -        if test "$allow_undefined_flag" = unsupported; then
    2142 -          $echo "$modename: warning: undefined symbols not allowed in $host shared libraries" 1>&2
    2143 -          build_libtool_libs=no
    2144 -         build_old_libs=yes
    2145 -        fi
    2146 -      else
    2147 -        # Don't allow undefined symbols.
    2148 -        allow_undefined_flag="$no_undefined_flag"
    2149 +      # Now set the variables for building old libraries.
    2150 +      if test "$build_old_libs" = yes && test "$build_libtool_libs" != convenience ; then
    2151 +       oldlibs="$oldlibs $output_objdir/$libname.$libext"
    2152 +
    2153 +       # Transform .lo files to .o files.
    2154 +       oldobjs="$objs "`$echo "X$libobjs" | $SP2NL | $Xsed -e '/\.'${libext}'$/d' -e "$lo2o" | $NL2SP`
    2155        fi
    2156  
    2157 -      # Add libc to deplibs on all systems.
    2158 -      dependency_libs="$deplibs"
    2159 -      deplibs="$deplibs -lc"
    2160 +      if test "$build_libtool_libs" = yes; then
    2161 +       # Transform deplibs into only deplibs that can be linked in shared.
    2162 +       name_save=$name
    2163 +       libname_save=$libname
    2164 +       release_save=$release
    2165 +       versuffix_save=$versuffix
    2166 +       major_save=$major
    2167 +       # I'm not sure if I'm treating the release correctly.  I think
    2168 +       # release should show up in the -l (ie -lgmp5) so we don't want to
    2169 +       # add it in twice.  Is that correct?
    2170 +       release=""
    2171 +       versuffix=""
    2172 +       major=""
    2173 +       newdeplibs=
    2174 +       droppeddeps=no
    2175 +       case "$deplibs_check_method" in
    2176 +       pass_all)
    2177 +         # Don't check for shared/static.  Everything works.
    2178 +         # This might be a little naive.  We might want to check
    2179 +         # whether the library exists or not.  But this is on
    2180 +         # osf3 & osf4 and I'm not really sure... Just
    2181 +         # implementing what was already the behaviour.
    2182 +         newdeplibs=$deplibs
    2183 +         ;;
    2184 +       test_compile)
    2185 +         # This code stresses the "libraries are programs" paradigm to its
    2186 +         # limits. Maybe even breaks it.  We compile a program, linking it
    2187 +         # against the deplibs as a proxy for the library.  Then we can check
    2188 +         # whether they linked in statically or dynamically with ldd.
    2189 +         $rm conftest.c
    2190 +         cat > conftest.c <<EOF
    2191 +         int main() { return 0; }
    2192 +EOF
    2193 +         $rm conftest
    2194 +         $CC -o conftest conftest.c $deplibs
    2195 +         if test $? -eq 0 ; then
    2196 +           ldd_output=`ldd conftest`
    2197 +           for i in $deplibs; do
    2198 +             name="`expr $i : '-l\(.*\)'`"
    2199 +             # If $name is empty we are operating on a -L argument.
    2200 +             if test "$name" != "" ; then
    2201 +               libname=`eval \\$echo \"$libname_spec\"`
    2202 +               deplib_matches=`eval \\$echo \"$library_names_spec\"`
    2203 +               set dummy $deplib_matches
    2204 +               deplib_match=$2
    2205 +               if test `expr "$ldd_output" : ".*$deplib_match"` -ne 0 ; then
    2206 +                 newdeplibs="$newdeplibs $i"
    2207 +               else
    2208 +                 droppeddeps=yes
    2209 +                 echo
    2210 +                 echo "*** Warning: This library needs some functionality provided by $i."
    2211 +                 echo "*** I have the capability to make that library automatically link in when"
    2212 +                 echo "*** you link to this library.  But I can only do this if you have a"
    2213 +                 echo "*** shared version of the library, which you do not appear to have."
    2214 +               fi
    2215 +             else
    2216 +               newdeplibs="$newdeplibs $i"
    2217 +             fi
    2218 +           done
    2219 +         else
    2220 +           # Error occured in the first compile.  Let's try to salvage the situation:
    2221 +           # Compile a seperate program for each library.
    2222 +           for i in $deplibs; do
    2223 +             name="`expr $i : '-l\(.*\)'`"
    2224 +            # If $name is empty we are operating on a -L argument.
    2225 +             if test "$name" != "" ; then
    2226 +               $rm conftest
    2227 +               $CC -o conftest conftest.c $i
    2228 +               # Did it work?
    2229 +               if test $? -eq 0 ; then
    2230 +                 ldd_output=`ldd conftest`
    2231 +                 libname=`eval \\$echo \"$libname_spec\"`
    2232 +                 deplib_matches=`eval \\$echo \"$library_names_spec\"`
    2233 +                 set dummy $deplib_matches
    2234 +                 deplib_match=$2
    2235 +                 if test `expr "$ldd_output" : ".*$deplib_match"` -ne 0 ; then
    2236 +                   newdeplibs="$newdeplibs $i"
    2237 +                 else
    2238 +                   droppeddeps=yes
    2239 +                   echo
    2240 +                   echo "*** Warning: This library needs some functionality provided by $i."
    2241 +                   echo "*** I have the capability to make that library automatically link in when"
    2242 +                   echo "*** you link to this library.  But I can only do this if you have a"
    2243 +                   echo "*** shared version of the library, which you do not appear to have."
    2244 +                 fi
    2245 +               else
    2246 +                 droppeddeps=yes
    2247 +                 echo
    2248 +                 echo "*** Warning!  Library $i is needed by this library but I was not able to"
    2249 +                 echo "***  make it link in!  You will probably need to install it or some"
    2250 +                 echo "*** library that it depends on before this library will be fully"
    2251 +                 echo "*** functional.  Installing it before continuing would be even better."
    2252 +               fi
    2253 +             else
    2254 +               newdeplibs="$newdeplibs $i"
    2255 +             fi
    2256 +           done
    2257 +         fi
    2258 +         ;;
    2259 +       file_magic*)
    2260 +         set dummy $deplibs_check_method
    2261 +         file_magic_regex="`expr \"$deplibs_check_method\" : \"$2 \(.*\)\"`"
    2262 +         for a_deplib in $deplibs; do
    2263 +           name="`expr $a_deplib : '-l\(.*\)'`"
    2264 +           # If $name is empty we are operating on a -L argument.
    2265 +           if test "$name" != "" ; then
    2266 +             libname=`eval \\$echo \"$libname_spec\"`
    2267 +             for i in $lib_search_path; do
    2268 +                   potential_libs=`ls $i/$libname[.-]* 2>/dev/null`
    2269 +                   for potent_lib in $potential_libs; do
    2270 +                     # Follow soft links.
    2271 +                     if ls -lLd "$potent_lib" 2>/dev/null \
    2272 +                        | grep " -> " >/dev/null; then
    2273 +                       continue
    2274 +                     fi
    2275 +                     # The statement above tries to avoid entering an
    2276 +                     # endless loop below, in case of cyclic links.
    2277 +                     # We might still enter an endless loop, since a link
    2278 +                     # loop can be closed while we follow links,
    2279 +                     # but so what?
    2280 +                     potlib="$potent_lib"
    2281 +                     while test -h "$potlib" 2>/dev/null; do
    2282 +                       potliblink=`ls -ld $potlib | sed 's/.* -> //'`
    2283 +                       case "$potliblink" in
    2284 +                       [\\/]* | [A-Za-z]:[\\/]*) potlib="$potliblink";;
    2285 +                       *) potlib=`$echo "X$potlib" | $Xsed -e 's,[^/]*$,,'`"$potliblink";;
    2286 +                       esac
    2287 +                     done
    2288 +                     if eval $file_magic_cmd \"\$potlib\" 2>/dev/null \
    2289 +                        | sed 10q \
    2290 +                        | egrep "$file_magic_regex" > /dev/null; then
    2291 +                       newdeplibs="$newdeplibs $a_deplib"
    2292 +                       a_deplib=""
    2293 +                       break 2
    2294 +                     fi
    2295 +                   done
    2296 +             done
    2297 +             if test -n "$a_deplib" ; then
    2298 +               droppeddeps=yes
    2299 +               echo
    2300 +               echo "*** Warning: This library needs some functionality provided by $a_deplib."
    2301 +               echo "*** I have the capability to make that library automatically link in when"
    2302 +               echo "*** you link to this library.  But I can only do this if you have a"
    2303 +               echo "*** shared version of the library, which you do not appear to have."
    2304 +             fi
    2305 +           else
    2306 +             # Add a -L argument.
    2307 +             newdeplibs="$newdeplibs $a_deplib"
    2308 +           fi
    2309 +         done # Gone through all deplibs.
    2310 +         ;;
    2311 +       none | unknown | *)
    2312 +         newdeplibs=""
    2313 +         if $echo "X $deplibs" | $Xsed -e 's/ -lc$//' \
    2314 +              -e 's/ -[LR][^ ]*//g' -e 's/[    ]//g' |
    2315 +            grep . >/dev/null; then
    2316 +           echo
    2317 +           if test "X$deplibs_check_method" = "Xnone"; then
    2318 +             echo "*** Warning: inter-library dependencies are not supported in this platform."
    2319 +           else
    2320 +             echo "*** Warning: inter-library dependencies are not known to be supported."
    2321 +           fi
    2322 +           echo "*** All declared inter-library dependencies are being dropped."
    2323 +           droppeddeps=yes
    2324 +         fi
    2325 +         ;;
    2326 +       esac
    2327 +       versuffix=$versuffix_save
    2328 +       major=$major_save
    2329 +       release=$release_save
    2330 +       libname=$libname_save
    2331 +       name=$name_save
    2332 +
    2333 +       if test "$droppeddeps" = yes; then
    2334 +         if test "$module" = yes; then
    2335 +           echo
    2336 +           echo "*** Warning: libtool could not satisfy all declared inter-library"
    2337 +           echo "*** dependencies of module $libname.  Therefore, libtool will create"
    2338 +           echo "*** a static module, that should work as long as the dlopening"
    2339 +           echo "*** application is linked with the -dlopen flag."
    2340 +           if test -z "$global_symbol_pipe"; then
    2341 +             echo
    2342 +             echo "*** However, this would only work if libtool was able to extract symbol"
    2343 +             echo "*** lists from a program, using \`nm' or equivalent, but libtool could"
    2344 +             echo "*** not find such a program.  So, this module is probably useless."
    2345 +             echo "*** \`nm' from GNU binutils and a full rebuild may help."
    2346 +           fi
    2347 +           if test "$build_old_libs" = no; then
    2348 +             oldlibs="$output_objdir/$libname.$libext"
    2349 +             build_libtool_libs=module
    2350 +             build_old_libs=yes
    2351 +           else
    2352 +             build_libtool_libs=no
    2353 +           fi
    2354 +         else
    2355 +           echo "*** The inter-library dependencies that have been dropped here will be"
    2356 +           echo "*** automatically added whenever a program is linked with this library"
    2357 +           echo "*** or is declared to -dlopen it."
    2358 +         fi
    2359 +       fi
    2360 +       # Done checking deplibs!
    2361 +       deplibs=$newdeplibs
    2362 +      fi
    2363  
    2364 +      # All the library-specific variables (install_libdir is set above).
    2365 +      library_names=
    2366 +      old_library=
    2367 +      dlname=
    2368 +     
    2369 +      # Test again, we may have decided not to build it any more
    2370        if test "$build_libtool_libs" = yes; then
    2371 -        # Get the real and link names of the library.
    2372 -        eval library_names=\"$library_names_spec\"
    2373 -        set dummy $library_names
    2374 -        realname="$2"
    2375 -        shift; shift
    2376 -
    2377 -        if test -n "$soname_spec"; then
    2378 -          eval soname=\"$soname_spec\"
    2379 -        else
    2380 -          soname="$realname"
    2381 -        fi
    2382 +       # Get the real and link names of the library.
    2383 +       eval library_names=\"$library_names_spec\"
    2384 +       set dummy $library_names
    2385 +       realname="$2"
    2386 +       shift; shift
    2387  
    2388 -        lib="$objdir/$realname"
    2389 +       if test -n "$soname_spec"; then
    2390 +         eval soname=\"$soname_spec\"
    2391 +       else
    2392 +         soname="$realname"
    2393 +       fi
    2394 +
    2395 +       lib="$output_objdir/$realname"
    2396         for link
    2397         do
    2398           linknames="$linknames $link"
    2399         done
    2400  
    2401 -        # Use standard objects if they are PIC.
    2402 -        test -z "$pic_flag" && libobjs=`$echo "X$libobjs " | $Xsed -e 's/\.lo /.o /g' -e 's/ $//g'`
    2403 +       # Ensure that we have .o objects for linkers which dislike .lo
    2404 +       # (e.g. aix) in case we are running --disable-static
    2405 +       for obj in $libobjs; do
    2406 +         xdir=`$echo "X$obj" | $Xsed -e 's%/[^/]*$%%'`
    2407 +         if test "X$xdir" = "X$obj"; then
    2408 +           xdir="."
    2409 +         else
    2410 +           xdir="$xdir"
    2411 +         fi
    2412 +         baseobj=`$echo "X$obj" | $Xsed -e 's%^.*/%%'`
    2413 +         oldobj=`$echo "X$baseobj" | $Xsed -e "$lo2o"`
    2414 +         if test ! -f $xdir/$oldobj; then
    2415 +           $show "(cd $xdir && ${LN_S} $baseobj $oldobj)"
    2416 +           $run eval '(cd $xdir && ${LN_S} $baseobj $oldobj)' || exit $?
    2417 +         fi
    2418 +       done
    2419  
    2420 -        # Do each of the archive commands.
    2421 -        eval cmds=\"$archive_cmds\"
    2422 -        IFS="${IFS=    }"; save_ifs="$IFS"; IFS=';'
    2423 -        for cmd in $cmds; do
    2424 -          IFS="$save_ifs"
    2425 -          $show "$cmd"
    2426 -          $run eval "$cmd" || exit $?
    2427 -        done
    2428 -        IFS="$save_ifs"
    2429 -
    2430 -        # Create links to the real library.
    2431 -        for linkname in $linknames; do
    2432 -          $show "(cd $objdir && $LN_S $realname $linkname)"
    2433 -          $run eval '(cd $objdir && $LN_S $realname $linkname)' || exit $?
    2434 -        done
    2435 -
    2436 -        # If -export-dynamic was specified, set the dlname.
    2437 -        if test "$export_dynamic" = yes; then
    2438 -          # On all known operating systems, these are identical.
    2439 -          dlname="$soname"
    2440 -        fi
    2441 -      fi
    2442 +       # Use standard objects if they are pic
    2443 +       test -z "$pic_flag" && libobjs=`$echo "X$libobjs" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP`
    2444  
    2445 -      # Now set the variables for building old libraries.
    2446 -      oldlib="$objdir/$libname.a"
    2447 +       # Prepare the list of exported symbols
    2448 +       if test -z "$export_symbols"; then
    2449 +         if test "$always_export_symbols" = yes || test -n "$export_symbols_regex"; then
    2450 +           $show "generating symbol list for \`$libname.la'"
    2451 +           export_symbols="$output_objdir/$libname.exp"
    2452 +           $run $rm $export_symbols
    2453 +           eval cmds=\"$export_symbols_cmds\"
    2454 +           IFS="${IFS=         }"; save_ifs="$IFS"; IFS='~'
    2455 +           for cmd in $cmds; do
    2456 +             IFS="$save_ifs"
    2457 +             $show "$cmd"
    2458 +             $run eval "$cmd" || exit $?
    2459 +           done
    2460 +           IFS="$save_ifs"
    2461 +           if test -n "$export_symbols_regex"; then
    2462 +             $show "egrep -e \"$export_symbols_regex\" \"$export_symbols\" > \"${export_symbols}T\""
    2463 +             $run eval 'egrep -e "$export_symbols_regex" "$export_symbols" > "${export_symbols}T"'
    2464 +             $show "$mv \"${export_symbols}T\" \"$export_symbols\""
    2465 +             $run eval '$mv "${export_symbols}T" "$export_symbols"'
    2466 +           fi
    2467 +         fi
    2468 +       fi
    2469 +
    2470 +       if test -n "$export_symbols" && test -n "$include_expsyms"; then
    2471 +         $run eval '$echo "X$include_expsyms" | $SP2NL >> "$export_symbols"'
    2472 +       fi
    2473 +
    2474 +       if test -n "$convenience"; then
    2475 +         if test -n "$whole_archive_flag_spec"; then
    2476 +           eval libobjs=\"\$libobjs $whole_archive_flag_spec\"
    2477 +         else
    2478 +           gentop="$output_objdir/${outputname}x"
    2479 +           $show "${rm}r $gentop"
    2480 +           $run ${rm}r "$gentop"
    2481 +           $show "mkdir $gentop"
    2482 +           $run mkdir "$gentop"
    2483 +           status=$?
    2484 +           if test $status -ne 0 && test ! -d "$gentop"; then
    2485 +             exit $status
    2486 +           fi
    2487 +           generated="$generated $gentop"
    2488 +
    2489 +           for xlib in $convenience; do
    2490 +             # Extract the objects.
    2491 +             case "$xlib" in
    2492 +             [\\/]* | [A-Za-z]:[\\/]*) xabs="$xlib" ;;
    2493 +             *) xabs=`pwd`"/$xlib" ;;
    2494 +             esac
    2495 +             xlib=`$echo "X$xlib" | $Xsed -e 's%^.*/%%'`
    2496 +             xdir="$gentop/$xlib"
    2497 +
    2498 +             $show "${rm}r $xdir"
    2499 +             $run ${rm}r "$xdir"
    2500 +             $show "mkdir $xdir"
    2501 +             $run mkdir "$xdir"
    2502 +             status=$?
    2503 +             if test $status -ne 0 && test ! -d "$xdir"; then
    2504 +               exit $status
    2505 +             fi
    2506 +             $show "(cd $xdir && $AR x $xabs)"
    2507 +             $run eval "(cd \$xdir && $AR x \$xabs)" || exit $?
    2508 +
    2509 +             libobjs="$libobjs "`find $xdir -name \*.o -print -o -name \*.lo -print | $NL2SP`
    2510 +           done
    2511 +         fi
    2512 +       fi
    2513 +
    2514 +       if test "$thread_safe" = yes && test -n "$thread_safe_flag_spec"; then
    2515 +         eval flag=\"$thread_safe_flag_spec\"
    2516 +         linkopts="$linkopts $flag"
    2517 +       fi
    2518 +
    2519 +       # Do each of the archive commands.
    2520 +       if test -n "$export_symbols" && test -n "$archive_expsym_cmds"; then
    2521 +         eval cmds=\"$archive_expsym_cmds\"
    2522 +       else
    2523 +         eval cmds=\"$archive_cmds\"
    2524 +       fi
    2525 +       IFS="${IFS=     }"; save_ifs="$IFS"; IFS='~'
    2526 +       for cmd in $cmds; do
    2527 +         IFS="$save_ifs"
    2528 +         $show "$cmd"
    2529 +         $run eval "$cmd" || exit $?
    2530 +       done
    2531 +       IFS="$save_ifs"
    2532 +
    2533 +       # Create links to the real library.
    2534 +       for linkname in $linknames; do
    2535 +         if test "$realname" != "$linkname"; then
    2536 +           $show "(cd $output_objdir && $rm $linkname && $LN_S $realname $linkname)"
    2537 +           $run eval '(cd $output_objdir && $rm $linkname && $LN_S $realname $linkname)' || exit $?
    2538 +         fi
    2539 +       done
    2540 +
    2541 +       # If -module or -export-dynamic was specified, set the dlname.
    2542 +       if test "$module" = yes || test "$export_dynamic" = yes; then
    2543 +         # On all known operating systems, these are identical.
    2544 +         dlname="$soname"
    2545 +       fi
    2546 +      fi
    2547        ;;
    2548  
    2549 -    *.lo | *.o)
    2550 +    *.lo | *.o | *.obj)
    2551        if test -n "$link_against_libtool_libs"; then
    2552 -        $echo "$modename: error: cannot link libtool libraries into reloadable objects" 1>&2
    2553 -        exit 1
    2554 +       $echo "$modename: error: cannot link libtool libraries into objects" 1>&2
    2555 +       exit 1
    2556        fi
    2557  
    2558        if test -n "$deplibs"; then
    2559 -        $echo "$modename: warning: \`-l' and \`-L' are ignored while creating objects" 1>&2
    2560 +       $echo "$modename: warning: \`-l' and \`-L' are ignored for objects" 1>&2
    2561        fi
    2562  
    2563 -      if test -n "$dlfiles$dlprefiles"; then
    2564 -        $echo "$modename: warning: \`-dlopen' is ignored while creating objects" 1>&2
    2565 -        # Nullify the symbol file.
    2566 -        compile_command=`$echo "X$compile_command" | $Xsed -e "s% @SYMFILE@%%"`
    2567 -        finalize_command=`$echo "X$finalize_command" | $Xsed -e "s% @SYMFILE@%%"`
    2568 +      if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then
    2569 +       $echo "$modename: warning: \`-dlopen' is ignored for objects" 1>&2
    2570        fi
    2571  
    2572        if test -n "$rpath"; then
    2573 -        $echo "$modename: warning: \`-rpath' is ignored while creating objects" 1>&2
    2574 +       $echo "$modename: warning: \`-rpath' is ignored for objects" 1>&2
    2575 +      fi
    2576 +
    2577 +      if test -n "$xrpath"; then
    2578 +       $echo "$modename: warning: \`-R' is ignored for objects" 1>&2
    2579        fi
    2580  
    2581        if test -n "$vinfo"; then
    2582 -        $echo "$modename: warning: \`-version-info' is ignored while creating objects" 1>&2
    2583 +       $echo "$modename: warning: \`-version-info' is ignored for objects" 1>&2
    2584        fi
    2585  
    2586        if test -n "$release"; then
    2587 -        $echo "$modename: warning: \`-release' is ignored while creating objects" 1>&2
    2588 +       $echo "$modename: warning: \`-release' is ignored for objects" 1>&2
    2589        fi
    2590  
    2591        case "$output" in
    2592        *.lo)
    2593 -        if test -n "$objs"; then
    2594 -          $echo "$modename: cannot build library object \`$output' from non-libtool objects" 1>&2
    2595 -          exit 1
    2596 -        fi
    2597 -        libobj="$output"
    2598 -        obj=`$echo "X$output" | $Xsed -e 's/\.lo$/.o/'`
    2599 -        ;;
    2600 +       if test -n "$objs"; then
    2601 +         $echo "$modename: cannot build library object \`$output' from non-libtool objects" 1>&2
    2602 +         exit 1
    2603 +       fi
    2604 +       libobj="$output"
    2605 +       obj=`$echo "X$output" | $Xsed -e "$lo2o"`
    2606 +       ;;
    2607        *)
    2608 -        libobj=
    2609 -        obj="$output"
    2610 -        ;;
    2611 +       libobj=
    2612 +       obj="$output"
    2613 +       ;;
    2614        esac
    2615  
    2616        # Delete the old objects.
    2617        $run $rm $obj $libobj
    2618  
    2619 +      # Objects from convenience libraries.  This assumes
    2620 +      # single-version convenience libraries.  Whenever we create
    2621 +      # different ones for PIC/non-PIC, this we'll have to duplicate
    2622 +      # the extraction.
    2623 +      reload_conv_objs=
    2624 +      gentop=
    2625 +      # reload_cmds runs $LD directly, so let us get rid of
    2626 +      # -Wl from whole_archive_flag_spec
    2627 +      wl=
    2628 +
    2629 +      if test -n "$convenience"; then
    2630 +       if test -n "$whole_archive_flag_spec"; then
    2631 +         eval reload_conv_objs=\"\$reload_objs $whole_archive_flag_spec\"
    2632 +       else
    2633 +         gentop="$output_objdir/${obj}x"
    2634 +         $show "${rm}r $gentop"
    2635 +         $run ${rm}r "$gentop"
    2636 +         $show "mkdir $gentop"
    2637 +         $run mkdir "$gentop"
    2638 +         status=$?
    2639 +         if test $status -ne 0 && test ! -d "$gentop"; then
    2640 +           exit $status
    2641 +         fi
    2642 +         generated="$generated $gentop"
    2643 +
    2644 +         for xlib in $convenience; do
    2645 +           # Extract the objects.
    2646 +           case "$xlib" in
    2647 +           [\\/]* | [A-Za-z]:[\\/]*) xabs="$xlib" ;;
    2648 +           *) xabs=`pwd`"/$xlib" ;;
    2649 +           esac
    2650 +           xlib=`$echo "X$xlib" | $Xsed -e 's%^.*/%%'`
    2651 +           xdir="$gentop/$xlib"
    2652 +
    2653 +           $show "${rm}r $xdir"
    2654 +           $run ${rm}r "$xdir"
    2655 +           $show "mkdir $xdir"
    2656 +           $run mkdir "$xdir"
    2657 +           status=$?
    2658 +           if test $status -ne 0 && test ! -d "$xdir"; then
    2659 +             exit $status
    2660 +           fi
    2661 +           $show "(cd $xdir && $AR x $xabs)"
    2662 +           $run eval "(cd \$xdir && $AR x \$xabs)" || exit $?
    2663 +
    2664 +           reload_conv_objs="$reload_objs "`find $xdir -name \*.o -print -o -name \*.lo -print | $NL2SP`
    2665 +         done
    2666 +       fi
    2667 +      fi
    2668 +
    2669        # Create the old-style object.
    2670 -      reload_objs="$objs"`$echo "X$libobjs " | $Xsed -e 's/[^       ]*\.a //g' -e 's/\.lo /.o /g' -e 's/ $//g'`
    2671 +      reload_objs="$objs "`$echo "X$libobjs" | $SP2NL | $Xsed -e '/\.'${libext}$'/d' -e '/\.lib$/d' -e "$lo2o" | $NL2SP`" $reload_conv_objs"
    2672  
    2673        output="$obj"
    2674        eval cmds=\"$reload_cmds\"
    2675 -      IFS="${IFS=      }"; save_ifs="$IFS"; IFS=';'
    2676 +      IFS="${IFS=      }"; save_ifs="$IFS"; IFS='~'
    2677        for cmd in $cmds; do
    2678 -        IFS="$save_ifs"
    2679 -        $show "$cmd"
    2680 -        $run eval "$cmd" || exit $?
    2681 +       IFS="$save_ifs"
    2682 +       $show "$cmd"
    2683 +       $run eval "$cmd" || exit $?
    2684        done
    2685        IFS="$save_ifs"
    2686  
    2687        # Exit if we aren't doing a library object file.
    2688 -      test -z "$libobj" && exit 0
    2689 +      if test -z "$libobj"; then
    2690 +       if test -n "$gentop"; then
    2691 +         $show "${rm}r $gentop"
    2692 +         $run ${rm}r $gentop
    2693 +       fi
    2694 +
    2695 +       exit 0
    2696 +      fi
    2697  
    2698        if test "$build_libtool_libs" != yes; then
    2699 -        # Create an invalid libtool object if no PIC, so that we don't
    2700 -        # accidentally link it into a program.
    2701 -        $show "echo timestamp > $libobj"
    2702 -        $run eval "echo timestamp > $libobj" || exit $?
    2703 -        exit 0
    2704 +       if test -n "$gentop"; then
    2705 +         $show "${rm}r $gentop"
    2706 +         $run ${rm}r $gentop
    2707 +       fi
    2708 +
    2709 +       # Create an invalid libtool object if no PIC, so that we don't
    2710 +       # accidentally link it into a program.
    2711 +       $show "echo timestamp > $libobj"
    2712 +       $run eval "echo timestamp > $libobj" || exit $?
    2713 +       exit 0
    2714        fi
    2715  
    2716        if test -n "$pic_flag"; then
    2717 -        # Only do commands if we really have different PIC objects.
    2718 -        reload_objs="$libobjs"
    2719 -        output="$libobj"
    2720 -        eval cmds=\"$reload_cmds\"
    2721 -        IFS="${IFS=    }"; save_ifs="$IFS"; IFS=';'
    2722 -        for cmd in $cmds; do
    2723 -          IFS="$save_ifs"
    2724 -          $show "$cmd"
    2725 -          $run eval "$cmd" || exit $?
    2726 -        done
    2727 -        IFS="$save_ifs"
    2728 +       # Only do commands if we really have different PIC objects.
    2729 +       reload_objs="$libobjs $reload_conv_objs"
    2730 +       output="$libobj"
    2731 +       eval cmds=\"$reload_cmds\"
    2732 +       IFS="${IFS=     }"; save_ifs="$IFS"; IFS='~'
    2733 +       for cmd in $cmds; do
    2734 +         IFS="$save_ifs"
    2735 +         $show "$cmd"
    2736 +         $run eval "$cmd" || exit $?
    2737 +       done
    2738 +       IFS="$save_ifs"
    2739        else
    2740 -        # Just create a symlink.
    2741 -        $show "$LN_S $obj $libobj"
    2742 -        $run $LN_S $obj $libobj || exit 1
    2743 +       # Just create a symlink.
    2744 +       $show $rm $libobj
    2745 +       $run $rm $libobj
    2746 +       xdir=`$echo "X$libobj" | $Xsed -e 's%/[^/]*$%%'`
    2747 +       if test "X$xdir" = "X$libobj"; then
    2748 +         xdir="."
    2749 +       else
    2750 +         xdir="$xdir"
    2751 +       fi
    2752 +       baseobj=`$echo "X$libobj" | $Xsed -e 's%^.*/%%'`
    2753 +       oldobj=`$echo "X$baseobj" | $Xsed -e "$lo2o"`
    2754 +       $show "(cd $xdir && $LN_S $oldobj $baseobj)"
    2755 +       $run eval '(cd $xdir && $LN_S $oldobj $baseobj)' || exit $?
    2756 +      fi
    2757 +
    2758 +      if test -n "$gentop"; then
    2759 +       $show "${rm}r $gentop"
    2760 +       $run ${rm}r $gentop
    2761        fi
    2762  
    2763        exit 0
    2764        ;;
    2765  
    2766 +    # Anything else should be a program.
    2767      *)
    2768        if test -n "$vinfo"; then
    2769 -        $echo "$modename: warning: \`-version-info' is ignored while linking programs" 1>&2
    2770 +       $echo "$modename: warning: \`-version-info' is ignored for programs" 1>&2
    2771        fi
    2772  
    2773        if test -n "$release"; then
    2774 -        $echo "$modename: warning: \`-release' is ignored while creating objects" 1>&2
    2775 +       $echo "$modename: warning: \`-release' is ignored for programs" 1>&2
    2776        fi
    2777  
    2778 -      if test -n "$rpath"; then
    2779 +      if test "$preload" = yes; then
    2780 +       if test "$dlopen" = unknown && test "$dlopen_self" = unknown &&
    2781 +          test "$dlopen_self_static" = unknown; then
    2782 +         $echo "$modename: warning: \`AC_LIBTOOL_DLOPEN' not used. Assuming no dlopen support."
    2783 +       fi
    2784 +      fi
    2785 +   
    2786 +      if test -n "$rpath$xrpath"; then
    2787         # If the user specified any rpath flags, then add them.
    2788 -       for libdir in $rpath; do
    2789 -          if test -n "$hardcode_libdir_flag_spec"; then
    2790 -            if test -n "$hardcode_libdir_separator"; then
    2791 -              if test -z "$hardcode_libdirs"; then
    2792 -                # Put the magic libdir with the hardcode flag.
    2793 -                hardcode_libdirs="$libdir"
    2794 -                libdir="@HARDCODE_LIBDIRS@"
    2795 -              else
    2796 -                # Just accumulate the unique libdirs.
    2797 -               case "$hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator" in
    2798 -               *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*)
    2799 -                 ;;
    2800 -               *)
    2801 -                 hardcode_libdirs="$hardcode_libdirs$hardcode_libdir_separator$libdir"
    2802 -                 ;;
    2803 -               esac
    2804 -                libdir=
    2805 -              fi
    2806 -            fi
    2807 -
    2808 -            if test -n "$libdir"; then
    2809 -              eval flag=\"$hardcode_libdir_flag_spec\"
    2810 -
    2811 -              compile_command="$compile_command $flag"
    2812 -              finalize_command="$finalize_command $flag"
    2813 -            fi
    2814 -          elif test -n "$runpath_var"; then
    2815 -            case "$perm_rpath " in
    2816 -            *" $libdir "*) ;;
    2817 -            *) perm_rpath="$perm_rpath $libdir" ;;
    2818 -            esac
    2819 -          fi
    2820 +       for libdir in $rpath $xrpath; do
    2821 +         # This is the magic to use -rpath.
    2822 +         case "$compile_rpath " in
    2823 +         *" $libdir "*) ;;
    2824 +         *) compile_rpath="$compile_rpath $libdir" ;;
    2825 +         esac
    2826 +         case "$finalize_rpath " in
    2827 +         *" $libdir "*) ;;
    2828 +         *) finalize_rpath="$finalize_rpath $libdir" ;;
    2829 +         esac
    2830         done
    2831        fi
    2832  
    2833 -      # Substitute the hardcoded libdirs into the compile commands.
    2834 -      if test -n "$hardcode_libdir_separator"; then
    2835 -       compile_command=`$echo "X$compile_command" | $Xsed -e "s%@HARDCODE_LIBDIRS@%$hardcode_libdirs%g"`
    2836 -       finalize_command=`$echo "X$finalize_command" | $Xsed -e "s%@HARDCODE_LIBDIRS@%$hardcode_libdirs%g"`
    2837 +      # Now hardcode the library paths
    2838 +      rpath=
    2839 +      hardcode_libdirs=
    2840 +      for libdir in $compile_rpath $finalize_rpath; do
    2841 +       if test -n "$hardcode_libdir_flag_spec"; then
    2842 +         if test -n "$hardcode_libdir_separator"; then
    2843 +           if test -z "$hardcode_libdirs"; then
    2844 +             hardcode_libdirs="$libdir"
    2845 +           else
    2846 +             # Just accumulate the unique libdirs.
    2847 +             case "$hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator" in
    2848 +             *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*)
    2849 +               ;;
    2850 +             *)
    2851 +               hardcode_libdirs="$hardcode_libdirs$hardcode_libdir_separator$libdir"
    2852 +               ;;
    2853 +             esac
    2854 +           fi
    2855 +         else
    2856 +           eval flag=\"$hardcode_libdir_flag_spec\"
    2857 +           rpath="$rpath $flag"
    2858 +         fi
    2859 +       elif test -n "$runpath_var"; then
    2860 +         case "$perm_rpath " in
    2861 +         *" $libdir "*) ;;
    2862 +         *) perm_rpath="$perm_rpath $libdir" ;;
    2863 +         esac
    2864 +       fi
    2865 +      done
    2866 +      # Substitute the hardcoded libdirs into the rpath.
    2867 +      if test -n "$hardcode_libdir_separator" &&
    2868 +        test -n "$hardcode_libdirs"; then
    2869 +       libdir="$hardcode_libdirs"
    2870 +       eval rpath=\" $hardcode_libdir_flag_spec\"
    2871 +      fi
    2872 +      compile_rpath="$rpath"
    2873 +
    2874 +      rpath=
    2875 +      hardcode_libdirs=
    2876 +      for libdir in $finalize_rpath; do
    2877 +       if test -n "$hardcode_libdir_flag_spec"; then
    2878 +         if test -n "$hardcode_libdir_separator"; then
    2879 +           if test -z "$hardcode_libdirs"; then
    2880 +             hardcode_libdirs="$libdir"
    2881 +           else
    2882 +             # Just accumulate the unique libdirs.
    2883 +             case "$hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator" in
    2884 +             *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*)
    2885 +               ;;
    2886 +             *)
    2887 +               hardcode_libdirs="$hardcode_libdirs$hardcode_libdir_separator$libdir"
    2888 +               ;;
    2889 +             esac
    2890 +           fi
    2891 +         else
    2892 +           eval flag=\"$hardcode_libdir_flag_spec\"
    2893 +           rpath="$rpath $flag"
    2894 +         fi
    2895 +       elif test -n "$runpath_var"; then
    2896 +         case "$finalize_perm_rpath " in
    2897 +         *" $libdir "*) ;;
    2898 +         *) finalize_perm_rpath="$finalize_perm_rpath $libdir" ;;
    2899 +         esac
    2900 +       fi
    2901 +      done
    2902 +      # Substitute the hardcoded libdirs into the rpath.
    2903 +      if test -n "$hardcode_libdir_separator" &&
    2904 +        test -n "$hardcode_libdirs"; then
    2905 +       libdir="$hardcode_libdirs"
    2906 +       eval rpath=\" $hardcode_libdir_flag_spec\"
    2907 +      fi
    2908 +      finalize_rpath="$rpath"
    2909 +
    2910 +      output_objdir=`$echo "X$output" | $Xsed -e 's%/[^/]*$%%'`
    2911 +      if test "X$output_objdir" = "X$output"; then
    2912 +       output_objdir="$objdir"
    2913 +      else
    2914 +       output_objdir="$output_objdir/$objdir"
    2915 +      fi
    2916 +
    2917 +      # Create the binary in the object directory, then wrap it.
    2918 +      if test ! -d $output_objdir; then
    2919 +       $show "$mkdir $output_objdir"
    2920 +       $run $mkdir $output_objdir
    2921 +       status=$?
    2922 +       if test $status -ne 0 && test ! -d $output_objdir; then
    2923 +         exit $status
    2924 +       fi
    2925        fi
    2926  
    2927        if test -n "$libobjs" && test "$build_old_libs" = yes; then
    2928 -        # Transform all the library objects into standard objects.
    2929 -        compile_command=`$echo "X$compile_command " | $Xsed -e 's/\.lo /.o /g' -e 's/ $//'`
    2930 -        finalize_command=`$echo "X$finalize_command " | $Xsed -e 's/\.lo /.o /g' -e 's/ $//'`
    2931 -      fi
    2932 -
    2933 -      if test "$export_dynamic" = yes && test -n "$NM" && test -n "$global_symbol_pipe"; then
    2934 -        dlsyms="${output}S.c"
    2935 -      else
    2936 -        dlsyms=
    2937 +       # Transform all the library objects into standard objects.
    2938 +       compile_command=`$echo "X$compile_command" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP`
    2939 +       finalize_command=`$echo "X$finalize_command" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP`
    2940        fi
    2941  
    2942 -      if test -n "$dlsyms"; then
    2943 -        # Add our own program objects to the preloaded list.
    2944 -        dlprefiles=`$echo "X$objs$dlprefiles " | $Xsed -e 's/\.lo /.o /g' -e 's/ $//'`
    2945 -
    2946 -       # Discover the nlist of each of the dlfiles.
    2947 -        nlist="$objdir/${output}.nm"
    2948 -
    2949 -       if test -d $objdir; then
    2950 -         $show "$rm $nlist ${nlist}T"
    2951 -         $run $rm "$nlist" "${nlist}T"
    2952 +      dlsyms=
    2953 +      if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then
    2954 +       if test -n "$NM" && test -n "$global_symbol_pipe"; then
    2955 +         dlsyms="${outputname}S.c"
    2956         else
    2957 -         $show "$mkdir $objdir"
    2958 -         $run $mkdir $objdir
    2959 -         status=$?
    2960 -         if test $status -eq 0 || test -d $objdir; then :
    2961 -         else
    2962 -           exit $status
    2963 -         fi
    2964 +         $echo "$modename: not configured to extract global symbols from dlpreopened files" 1>&2
    2965         fi
    2966 +      fi
    2967  
    2968 -        for arg in $dlprefiles; do
    2969 -         $show "extracting global C symbols from \`$arg'"
    2970 -         $run eval "$NM $arg | $global_symbol_pipe >> '$nlist'"
    2971 -        done
    2972 -
    2973 -        # Parse the name list into a source file.
    2974 -        $show "creating $objdir/$dlsyms"
    2975 -        if test -z "$run"; then
    2976 -         # Make sure we at least have an empty file.
    2977 -         test -f "$nlist" || : > "$nlist"
    2978 -
    2979 -         # Try sorting and uniquifying the output.
    2980 -         if sort "$nlist" | uniq > "$nlist"T; then
    2981 -           mv -f "$nlist"T "$nlist"
    2982 -           wcout=`wc "$nlist" 2>/dev/null`
    2983 -           count=`echo "X$wcout" | $Xsed -e 's/^[      ]*\([0-9][0-9]*\).*$/\1/'`
    2984 -           (test "$count" -ge 0) 2>/dev/null || count=-1
    2985 -         else
    2986 -           $rm "$nlist"T
    2987 -           count=-1
    2988 -         fi
    2989 -
    2990 -         case "$dlsyms" in
    2991 -         "") ;;
    2992 -         *.c)
    2993 -           $echo > "$objdir/$dlsyms" "\
    2994 -/* $dlsyms - symbol resolution table for \`$output' dlsym emulation. */
    2995 -/* Generated by $PROGRAM - GNU $PACKAGE $VERSION */
    2996 +      if test -n "$dlsyms"; then
    2997 +       case "$dlsyms" in
    2998 +       "") ;;
    2999 +       *.c)
    3000 +         # Discover the nlist of each of the dlfiles.
    3001 +         nlist="$output_objdir/${outputname}.nm"
    3002 +
    3003 +         $show "$rm $nlist ${nlist}S ${nlist}T"
    3004 +         $run $rm "$nlist" "${nlist}S" "${nlist}T"
    3005 +
    3006 +         # Parse the name list into a source file.
    3007 +         $show "creating $output_objdir/$dlsyms"
    3008 +
    3009 +         test -z "$run" && $echo > "$output_objdir/$dlsyms" "\
    3010 +/* $dlsyms - symbol resolution table for \`$outputname' dlsym emulation. */
    3011 +/* Generated by $PROGRAM - GNU $PACKAGE $VERSION$TIMESTAMP */
    3012  
    3013  #ifdef __cplusplus
    3014  extern \"C\" {
    3015  #endif
    3016  
    3017  /* Prevent the only kind of declaration conflicts we can make. */
    3018 -#define dld_preloaded_symbol_count some_other_symbol
    3019 -#define dld_preloaded_symbols some_other_symbol
    3020 +#define lt_preloaded_symbols some_other_symbol
    3021  
    3022  /* External symbol declarations for the compiler. */\
    3023  "
    3024  
    3025 -           if test -f "$nlist"; then
    3026 -             sed -e 's/^.* \(.*\)$/extern char \1;/' < "$nlist" >> "$objdir/$dlsyms"
    3027 +         if test "$dlself" = yes; then
    3028 +           $show "generating symbol list for \`$output'"
    3029 +
    3030 +           test -z "$run" && $echo ': @PROGRAM@ ' > "$nlist"
    3031 +
    3032 +           # Add our own program objects to the symbol list.
    3033 +           progfiles=`$echo "X$objs" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP`
    3034 +           for arg in $progfiles; do
    3035 +             $show "extracting global C symbols from \`$arg'"
    3036 +             $run eval "$NM $arg | $global_symbol_pipe >> '$nlist'"
    3037 +           done
    3038 +
    3039 +           if test -n "$exclude_expsyms"; then
    3040 +             $run eval 'egrep -v " ($exclude_expsyms)$" "$nlist" > "$nlist"T'
    3041 +             $run eval '$mv "$nlist"T "$nlist"'
    3042 +           fi
    3043 +           
    3044 +           if test -n "$export_symbols_regex"; then
    3045 +             $run eval 'egrep -e "$export_symbols_regex" "$nlist" > "$nlist"T'
    3046 +             $run eval '$mv "$nlist"T "$nlist"'
    3047 +           fi
    3048 +
    3049 +           # Prepare the list of exported symbols
    3050 +           if test -z "$export_symbols"; then
    3051 +             export_symbols="$output_objdir/$output.exp"
    3052 +             $run $rm $export_symbols
    3053 +             $run eval "sed -n -e '/^: @PROGRAM@$/d' -e 's/^.* \(.*\)$/\1/p' "'< "$nlist" > "$export_symbols"'
    3054             else
    3055 -             echo '/* NONE */' >> "$objdir/$dlsyms"
    3056 +             $run eval "sed -e 's/\([][.*^$]\)/\\\1/g' -e 's/^/ /' -e 's/$/$/'"' < "$export_symbols" > "$output_objdir/$output.exp"'
    3057 +             $run eval 'grep -f "$output_objdir/$output.exp" < "$nlist" > "$nlist"T'
    3058 +             $run eval 'mv "$nlist"T "$nlist"'
    3059 +           fi
    3060 +         fi
    3061 +
    3062 +         for arg in $dlprefiles; do
    3063 +           $show "extracting global C symbols from \`$arg'"
    3064 +           name=`echo "$arg" | sed -e 's%^.*/%%'`
    3065 +           $run eval 'echo ": $name " >> "$nlist"'
    3066 +           $run eval "$NM $arg | $global_symbol_pipe >> '$nlist'"
    3067 +         done
    3068 +
    3069 +         if test -z "$run"; then
    3070 +           # Make sure we have at least an empty file.
    3071 +           test -f "$nlist" || : > "$nlist"
    3072 +
    3073 +           if test -n "$exclude_expsyms"; then
    3074 +             egrep -v " ($exclude_expsyms)$" "$nlist" > "$nlist"T
    3075 +             $mv "$nlist"T "$nlist"
    3076 +           fi
    3077 +
    3078 +           # Try sorting and uniquifying the output.
    3079 +           if grep -v "^: " < "$nlist" | sort +2 | uniq > "$nlist"S; then
    3080 +             :
    3081 +           else
    3082 +             grep -v "^: " < "$nlist" > "$nlist"S
    3083 +           fi
    3084 +
    3085 +           if test -f "$nlist"S; then
    3086 +             eval "$global_symbol_to_cdecl"' < "$nlist"S >> "$output_objdir/$dlsyms"'
    3087 +           else
    3088 +             echo '/* NONE */' >> "$output_objdir/$dlsyms"
    3089             fi
    3090  
    3091 -           $echo >> "$objdir/$dlsyms" "\
    3092 +           $echo >> "$output_objdir/$dlsyms" "\
    3093  
    3094 -#undef dld_preloaded_symbol_count
    3095 -#undef dld_preloaded_symbols
    3096 +#undef lt_preloaded_symbols
    3097  
    3098  #if defined (__STDC__) && __STDC__
    3099 -# define __ptr_t void *
    3100 +# define lt_ptr_t void *
    3101  #else
    3102 -# define __ptr_t char *
    3103 +# define lt_ptr_t char *
    3104 +# define const
    3105  #endif
    3106  
    3107 -/* The number of symbols in dld_preloaded_symbols, -1 if unsorted. */
    3108 -int dld_preloaded_symbol_count = $count;
    3109 -
    3110  /* The mapping between symbol names and symbols. */
    3111 -struct {
    3112 -  char *name;
    3113 -  __ptr_t address;
    3114 +const struct {
    3115 +  const char *name;
    3116 +  lt_ptr_t address;
    3117  }
    3118 -dld_preloaded_symbols[] =
    3119 +lt_preloaded_symbols[] =
    3120  {\
    3121  "
    3122  
    3123 -           if test -f "$nlist"; then
    3124 -             sed 's/^\(.*\) \(.*\)$/  {"\1", (__ptr_t) \&\2},/' < "$nlist" >> "$objdir/$dlsyms"
    3125 -           fi
    3126 +           sed -n -e 's/^: \([^ ]*\) $/  {\"\1\", (lt_ptr_t) 0},/p' \
    3127 +               -e 's/^. \([^ ]*\) \([^ ]*\)$/  {"\2", (lt_ptr_t) \&\2},/p' \
    3128 +                 < "$nlist" >> "$output_objdir/$dlsyms"
    3129  
    3130 -           $echo >> "$objdir/$dlsyms" "\
    3131 -  {0, (__ptr_t) 0}
    3132 +           $echo >> "$output_objdir/$dlsyms" "\
    3133 +  {0, (lt_ptr_t) 0}
    3134  };
    3135  
    3136 +/* This works around a problem in FreeBSD linker */
    3137 +#ifdef FREEBSD_WORKAROUND
    3138 +static const void *lt_preloaded_setup() {
    3139 +  return lt_preloaded_symbols;
    3140 +}
    3141 +#endif
    3142 +
    3143  #ifdef __cplusplus
    3144  }
    3145  #endif\
    3146  "
    3147 -           ;;
    3148 +         fi
    3149  
    3150 -         *)
    3151 -           $echo "$modename: unknown suffix for \`$dlsyms'" 1>&2
    3152 -           exit 1
    3153 -           ;;
    3154 +         pic_flag_for_symtable=
    3155 +         case "$host" in
    3156 +         # compiling the symbol table file with pic_flag works around
    3157 +         # a FreeBSD bug that causes programs to crash when -lm is
    3158 +         # linked before any other PIC object.  But we must not use
    3159 +         # pic_flag when linking with -static.  The problem exists in
    3160 +         # FreeBSD 2.2.6 and is fixed in FreeBSD 3.1.
    3161 +         *-*-freebsd2*|*-*-freebsd3.0*|*-*-freebsdelf3.0*)
    3162 +           case "$compile_command " in
    3163 +           *" -static "*) ;;
    3164 +           *) pic_flag_for_symtable=" $pic_flag -DPIC -DFREEBSD_WORKAROUND";;
    3165 +           esac;;
    3166 +         *-*-hpux*)
    3167 +           case "$compile_command " in
    3168 +           *" -static "*) ;;
    3169 +           *) pic_flag_for_symtable=" $pic_flag -DPIC";;
    3170 +           esac
    3171           esac
    3172 -        fi
    3173  
    3174 -        # Now compile the dynamic symbol file.
    3175 -        $show "(cd $objdir && $CC -c$no_builtin_flag \"$dlsyms\")"
    3176 -        $run eval '(cd $objdir && $CC -c$no_builtin_flag "$dlsyms")' || exit $?
    3177 -
    3178 -        # Transform the symbol file into the correct name.
    3179 -        compile_command=`$echo "X$compile_command" | $Xsed -e "s%@SYMFILE@%$objdir/${output}S.o%"`
    3180 -        finalize_command=`$echo "X$finalize_command" | $Xsed -e "s%@SYMFILE@%$objdir/${output}S.o%"`
    3181 -      elif test "$export_dynamic" != yes; then
    3182 -        test -n "$dlfiles$dlprefiles" && $echo "$modename: warning: \`-dlopen' and \`-dlpreopen' are ignored without \`-export-dynamic'" 1>&2
    3183 +         # Now compile the dynamic symbol file.
    3184 +         $show "(cd $output_objdir && $CC -c$no_builtin_flag$pic_flag_for_symtable \"$dlsyms\")"
    3185 +         $run eval '(cd $output_objdir && $CC -c$no_builtin_flag$pic_flag_for_symtable "$dlsyms")' || exit $?
    3186 +
    3187 +         # Clean up the generated files.
    3188 +         $show "$rm $output_objdir/$dlsyms $nlist ${nlist}S ${nlist}T"
    3189 +         $run $rm "$output_objdir/$dlsyms" "$nlist" "${nlist}S" "${nlist}T"
    3190 +
    3191 +         # Transform the symbol file into the correct name.
    3192 +         compile_command=`$echo "X$compile_command" | $Xsed -e "s%@SYMFILE@%$output_objdir/${outputname}S.${objext}%"`
    3193 +         finalize_command=`$echo "X$finalize_command" | $Xsed -e "s%@SYMFILE@%$output_objdir/${outputname}S.${objext}%"`
    3194 +         ;;
    3195 +       *)
    3196 +         $echo "$modename: unknown suffix for \`$dlsyms'" 1>&2
    3197 +         exit 1
    3198 +         ;;
    3199 +       esac
    3200        else
    3201 -        # We keep going just in case the user didn't refer to
    3202 -        # dld_preloaded_symbols.  The linker will fail if global_symbol_pipe
    3203 -        # really was required.
    3204 -        $echo "$modename: not configured to extract global symbols from dlpreopened files" 1>&2
    3205 -
    3206 -        # Nullify the symbol file.
    3207 -        compile_command=`$echo "X$compile_command" | $Xsed -e "s% @SYMFILE@%%"`
    3208 -        finalize_command=`$echo "X$finalize_command" | $Xsed -e "s% @SYMFILE@%%"`
    3209 +       # We keep going just in case the user didn't refer to
    3210 +       # lt_preloaded_symbols.  The linker will fail if global_symbol_pipe
    3211 +       # really was required.
    3212 +
    3213 +       # Nullify the symbol file.
    3214 +       compile_command=`$echo "X$compile_command" | $Xsed -e "s% @SYMFILE@%%"`
    3215 +       finalize_command=`$echo "X$finalize_command" | $Xsed -e "s% @SYMFILE@%%"`
    3216        fi
    3217  
    3218        if test -z "$link_against_libtool_libs" || test "$build_libtool_libs" != yes; then
    3219 -        # Replace the output file specification.
    3220 -        compile_command=`$echo "X$compile_command" | $Xsed -e 's%@OUTPUT@%'"$output"'%g'`
    3221 -        finalize_command=`$echo "X$finalize_command" | $Xsed -e 's%@OUTPUT@%'"$output"'%g'`
    3222 -
    3223 -        # We have no uninstalled library dependencies, so finalize right now.
    3224 -        $show "$compile_command"
    3225 -        $run eval "$compile_command"
    3226 -        exit $?
    3227 -      fi
    3228 -
    3229 -      # Replace the output file specification.
    3230 -      compile_command=`$echo "X$compile_command" | $Xsed -e 's%@OUTPUT@%'"$objdir/$output"'%g'`
    3231 -      finalize_command=`$echo "X$finalize_command" | $Xsed -e 's%@OUTPUT@%'"$objdir/$output"'T%g'`
    3232 -
    3233 -      # Create the binary in the object directory, then wrap it.
    3234 -      if test -d $objdir; then :
    3235 -      else
    3236 -        $show "$mkdir $objdir"
    3237 -       $run $mkdir $objdir
    3238 +       # Replace the output file specification.
    3239 +       compile_command=`$echo "X$compile_command" | $Xsed -e 's%@OUTPUT@%'"$output"'%g'`
    3240 +       link_command="$compile_command$compile_rpath"
    3241 +
    3242 +       # We have no uninstalled library dependencies, so finalize right now.
    3243 +       $show "$link_command"
    3244 +       $run eval "$link_command"
    3245         status=$?
    3246 -       if test $status -eq 0 || test -d $objdir; then :
    3247 -       else
    3248 -         exit $status
    3249 +       
    3250 +       # Delete the generated files.
    3251 +       if test -n "$dlsyms"; then
    3252 +         $show "$rm $output_objdir/${outputname}S.${objext}"
    3253 +         $run $rm "$output_objdir/${outputname}S.${objext}"
    3254         fi
    3255 +
    3256 +       exit $status
    3257        fi
    3258  
    3259        if test -n "$shlibpath_var"; then
    3260 -        # We should set the shlibpath_var
    3261 -        rpath=
    3262 -        for dir in $temp_rpath; do
    3263 -          case "$dir" in
    3264 -          /* | [A-Za-z]:\\*)
    3265 -            # Absolute path.
    3266 -            rpath="$rpath$dir:"
    3267 -            ;;
    3268 -          *)
    3269 -            # Relative path: add a thisdir entry.
    3270 -            rpath="$rpath\$thisdir/$dir:"
    3271 -            ;;
    3272 -          esac
    3273 -        done
    3274 -        temp_rpath="$rpath"
    3275 +       # We should set the shlibpath_var
    3276 +       rpath=
    3277 +       for dir in $temp_rpath; do
    3278 +         case "$dir" in
    3279 +         [\\/]* | [A-Za-z]:[\\/]*)
    3280 +           # Absolute path.
    3281 +           rpath="$rpath$dir:"
    3282 +           ;;
    3283 +         *)
    3284 +           # Relative path: add a thisdir entry.
    3285 +           rpath="$rpath\$thisdir/$dir:"
    3286 +           ;;
    3287 +         esac
    3288 +       done
    3289 +       temp_rpath="$rpath"
    3290        fi
    3291  
    3292 -      # Delete the old output file.
    3293 -      $run $rm $output
    3294 -
    3295 -      if test -n "$compile_shlibpath"; then
    3296 -        compile_command="$shlibpath_var=\"$compile_shlibpath\$$shlibpath_var\" $compile_command"
    3297 +      if test -n "$compile_shlibpath$finalize_shlibpath"; then
    3298 +       compile_command="$shlibpath_var=\"$compile_shlibpath$finalize_shlibpath\$$shlibpath_var\" $compile_command"
    3299        fi
    3300        if test -n "$finalize_shlibpath"; then
    3301 -        finalize_command="$shlibpath_var=\"$finalize_shlibpath\$$shlibpath_var\" $finalize_command"
    3302 +       finalize_command="$shlibpath_var=\"$finalize_shlibpath\$$shlibpath_var\" $finalize_command"
    3303        fi
    3304  
    3305 -      if test -n "$runpath_var" && test -n "$perm_rpath"; then
    3306 -        # We should set the runpath_var.
    3307 -        rpath=
    3308 -        for dir in $perm_rpath; do
    3309 -          rpath="$rpath$dir:"
    3310 -        done
    3311 -        compile_command="$runpath_var=\"$rpath\$$runpath_var\" $compile_command"
    3312 -        finalize_command="$runpath_var=\"$rpath\$$runpath_var\" $finalize_command"
    3313 -      fi
    3314 -
    3315 -      case "$hardcode_action" in
    3316 -      relink)
    3317 -        # AGH! Flame the AIX and HP-UX people for me, will ya?
    3318 -        $echo "$modename: warning: using a buggy system linker" 1>&2
    3319 -        $echo "$modename: relinking will be required before \`$output' can be installed" 1>&2
    3320 -        ;;
    3321 -      esac
    3322 +      compile_var=
    3323 +      finalize_var=
    3324 +      if test -n "$runpath_var"; then
    3325 +       if test -n "$perm_rpath"; then
    3326 +         # We should set the runpath_var.
    3327 +         rpath=
    3328 +         for dir in $perm_rpath; do
    3329 +           rpath="$rpath$dir:"
    3330 +         done
    3331 +         compile_var="$runpath_var=\"$rpath\$$runpath_var\" "
    3332 +       fi
    3333 +       if test -n "$finalize_perm_rpath"; then
    3334 +         # We should set the runpath_var.
    3335 +         rpath=
    3336 +         for dir in $finalize_perm_rpath; do
    3337 +           rpath="$rpath$dir:"
    3338 +         done
    3339 +         finalize_var="$runpath_var=\"$rpath\$$runpath_var\" "
    3340 +       fi
    3341 +      fi
    3342 +
    3343 +      if test "$hardcode_action" = relink; then
    3344 +       # Fast installation is not supported
    3345 +       link_command="$compile_var$compile_command$compile_rpath"
    3346 +       relink_command="$finalize_var$finalize_command$finalize_rpath"
    3347 +       
    3348 +       $echo "$modename: warning: this platform does not like uninstalled shared libraries" 1>&2
    3349 +       $echo "$modename: \`$output' will be relinked during installation" 1>&2
    3350 +      else
    3351 +       if test "$fast_install" != no; then
    3352 +         link_command="$finalize_var$compile_command$finalize_rpath"
    3353 +         if test "$fast_install" = yes; then
    3354 +           relink_command=`$echo "X$compile_var$compile_command$compile_rpath" | $Xsed -e 's%@OUTPUT@%\$progdir/\$file%g'`
    3355 +         else
    3356 +           # fast_install is set to needless
    3357 +           relink_command=
    3358 +         fi
    3359 +       else
    3360 +         link_command="$compile_var$compile_command$compile_rpath"
    3361 +         relink_command="$finalize_var$finalize_command$finalize_rpath"
    3362 +       fi
    3363 +      fi
    3364 +
    3365 +      # Replace the output file specification.
    3366 +      link_command=`$echo "X$link_command" | $Xsed -e 's%@OUTPUT@%'"$output_objdir/$outputname"'%g'`
    3367 +     
    3368 +      # Delete the old output files.
    3369 +      $run $rm $output $output_objdir/$outputname $output_objdir/lt-$outputname
    3370  
    3371 -      $show "$compile_command"
    3372 -      $run eval "$compile_command" || exit $?
    3373 +      $show "$link_command"
    3374 +      $run eval "$link_command" || exit $?
    3375  
    3376        # Now create the wrapper script.
    3377        $show "creating $output"
    3378  
    3379 -      # Quote the finalize command for shipping.
    3380 -      finalize_command=`$echo "X$finalize_command" | $Xsed -e "$sed_quote_subst"`
    3381 +      # Quote the relink command for shipping.
    3382 +      if test -n "$relink_command"; then
    3383 +       relink_command=`$echo "X$relink_command" | $Xsed -e "$sed_quote_subst"`
    3384 +      fi
    3385  
    3386        # Quote $echo for shipping.
    3387 -      qecho=`$echo "X$echo" | $Xsed -e "$sed_quote_subst"`
    3388 +      if test "X$echo" = "X$SHELL $0 --fallback-echo"; then
    3389 +       case "$0" in
    3390 +       [\\/]* | [A-Za-z]:[\\/]*) qecho="$SHELL $0 --fallback-echo";;
    3391 +       *) qecho="$SHELL `pwd`/$0 --fallback-echo";;
    3392 +       esac
    3393 +       qecho=`$echo "X$qecho" | $Xsed -e "$sed_quote_subst"`
    3394 +      else
    3395 +       qecho=`$echo "X$echo" | $Xsed -e "$sed_quote_subst"`
    3396 +      fi
    3397  
    3398        # Only actually do things if our run command is non-null.
    3399        if test -z "$run"; then
    3400 -        $rm $output
    3401 -        trap "$rm $output; exit 1" 1 2 15
    3402 +       # win32 will think the script is a binary if it has
    3403 +       # a .exe suffix, so we strip it off here.
    3404 +       case $output in
    3405 +         *.exe) output=`echo $output|sed 's,.exe$,,'` ;;
    3406 +       esac
    3407 +       $rm $output
    3408 +       trap "$rm $output; exit 1" 1 2 15
    3409  
    3410 -        $echo > $output "\
    3411 -#! /bin/sh
    3412 +       $echo > $output "\
    3413 +#! $SHELL
    3414  
    3415 -# $output - temporary wrapper script for $objdir/$output
    3416 -# Generated by ltmain.sh - GNU $PACKAGE $VERSION
    3417 +# $output - temporary wrapper script for $objdir/$outputname
    3418 +# Generated by $PROGRAM - GNU $PACKAGE $VERSION$TIMESTAMP
    3419  #
    3420  # The $output program cannot be directly executed until all the libtool
    3421  # libraries that it depends on are installed.
    3422  #
    3423 -# This wrapper script should never be moved out of \``pwd`'.
    3424 +# This wrapper script should never be moved out of the build directory.
    3425  # If it is, it will not operate correctly.
    3426  
    3427  # Sed substitution that helps us do robust quoting.  It backslashifies
    3428  # metacharacters that are still active within double-quoted strings.
    3429 -Xsed='sed -e s/^X//'
    3430 +Xsed='sed -e 1s/^X//'
    3431  sed_quote_subst='$sed_quote_subst'
    3432  
    3433  # The HP-UX ksh and POSIX shell print the target directory to stdout
    3434  # if CDPATH is set.
    3435 -if test \"\${CDPATH+set}\" = set; then CDPATH=; export CDPATH; fi
    3436 +if test \"\${CDPATH+set}\" = set; then CDPATH=:; export CDPATH; fi
    3437 +
    3438 +relink_command=\"$relink_command\"
    3439  
    3440  # This environment variable determines our operation mode.
    3441  if test \"\$libtool_install_magic\" = \"$magic\"; then
    3442 -  # install mode needs the following variables:
    3443 +  # install mode needs the following variable:
    3444    link_against_libtool_libs='$link_against_libtool_libs'
    3445 -  finalize_command=\"$finalize_command\"
    3446  else
    3447    # When we are sourced in execute mode, \$file and \$echo are already set.
    3448 -  if test \"\$libtool_execute_magic\" = \"$magic\"; then :
    3449 -  else
    3450 +  if test \"\$libtool_execute_magic\" != \"$magic\"; then
    3451      echo=\"$qecho\"
    3452      file=\"\$0\"
    3453 +    # Make sure echo works.
    3454 +    if test \"X\$1\" = X--no-reexec; then
    3455 +      # Discard the --no-reexec flag, and continue.
    3456 +      shift
    3457 +    elif test \"X\`(\$echo '\t') 2>/dev/null\`\" = 'X\t'; then
    3458 +      # Yippee, \$echo works!
    3459 +      :
    3460 +    else
    3461 +      # Restart under the correct shell, and then maybe \$echo will work.
    3462 +      exec $SHELL \"\$0\" --no-reexec \${1+\"\$@\"}
    3463 +    fi
    3464    fi\
    3465  "
    3466 -        $echo >> $output "\
    3467 +       $echo >> $output "\
    3468  
    3469    # Find the directory that this script lives in.
    3470    thisdir=\`\$echo \"X\$file\" | \$Xsed -e 's%/[^/]*$%%'\`
    3471 @@ -1477,7 +2875,7 @@
    3472      # If there was a directory component, then change thisdir.
    3473      if test \"x\$destdir\" != \"x\$file\"; then
    3474        case \"\$destdir\" in
    3475 -      /* | [A-Za-z]:\\*) thisdir=\"\$destdir\" ;;
    3476 +      [\\/]* | [A-Za-z]:[\\/]*) thisdir=\"\$destdir\" ;;
    3477        *) thisdir=\"\$thisdir/\$destdir\" ;;
    3478        esac
    3479      fi
    3480 @@ -1489,35 +2887,105 @@
    3481    # Try to get the absolute directory name.
    3482    absdir=\`cd \"\$thisdir\" && pwd\`
    3483    test -n \"\$absdir\" && thisdir=\"\$absdir\"
    3484 +"
    3485 +
    3486 +       if test "$fast_install" = yes; then
    3487 +         echo >> $output "\
    3488 +  program=lt-'$outputname'
    3489 +  progdir=\"\$thisdir/$objdir\"
    3490 
    3491 +  if test ! -f \"\$progdir/\$program\" || \\
    3492 +     { file=\`ls -1dt \"\$progdir/\$program\" \"\$progdir/../\$program\" 2>/dev/null | sed 1q\`; \\
    3493 +       test \"X\$file\" != \"X\$progdir/\$program\"; }; then
    3494  
    3495 +    file=\"\$\$-\$program\"
    3496 +
    3497 +    if test ! -d \"\$progdir\"; then
    3498 +      $mkdir \"\$progdir\"
    3499 +    else
    3500 +      $rm \"\$progdir/\$file\"
    3501 +    fi"
    3502 +
    3503 +         echo >> $output "\
    3504 +
    3505 +    # relink executable if necessary
    3506 +    if test -n \"\$relink_command\"; then
    3507 +      if (cd \"\$thisdir\" && eval \$relink_command); then :
    3508 +      else
    3509 +       $rm \"\$progdir/\$file\"
    3510 +       exit 1
    3511 +      fi
    3512 +    fi
    3513 +
    3514 +    $mv \"\$progdir/\$file\" \"\$progdir/\$program\" 2>/dev/null ||
    3515 +    { $rm \"\$progdir/\$program\";
    3516 +      $mv \"\$progdir/\$file\" \"\$progdir/\$program\"; }
    3517 +    $rm \"\$progdir/\$file\"
    3518 +  fi"
    3519 +       else
    3520 +         echo >> $output "\
    3521 +  program='$outputname'
    3522    progdir=\"\$thisdir/$objdir\"
    3523 -  program='$output'
    3524 +"
    3525 +       fi
    3526 +
    3527 +       echo >> $output "\
    3528  
    3529    if test -f \"\$progdir/\$program\"; then"
    3530  
    3531 -        # Export our shlibpath_var if we have one.
    3532 -        if test -n "$shlibpath_var" && test -n "$temp_rpath"; then
    3533 -          $echo >> $output "\
    3534 +       # Export our shlibpath_var if we have one.
    3535 +       if test "$shlibpath_overrides_runpath" = yes && test -n "$shlibpath_var" && test -n "$temp_rpath"; then
    3536 +         $echo >> $output "\
    3537      # Add our own library path to $shlibpath_var
    3538      $shlibpath_var=\"$temp_rpath\$$shlibpath_var\"
    3539  
    3540      # Some systems cannot cope with colon-terminated $shlibpath_var
    3541 -    $shlibpath_var=\`\$echo \"X\$$shlibpath_var\" | \$Xsed -e 's/:*\$//'\`
    3542 +    # The second colon is a workaround for a bug in BeOS R4 sed
    3543 +    $shlibpath_var=\`\$echo \"X\$$shlibpath_var\" | \$Xsed -e 's/::*\$//'\`
    3544  
    3545      export $shlibpath_var
    3546  "
    3547 -        fi
    3548 +       fi
    3549 +
    3550 +       # fixup the dll searchpath if we need to.
    3551 +       if test -n "$dllsearchpath"; then
    3552 +         $echo >> $output "\
    3553 +    # Add the dll search path components to the executable PATH
    3554 +    PATH=$dllsearchpath:\$PATH
    3555 +"
    3556 +       fi
    3557  
    3558 -        $echo >> $output "\
    3559 +       $echo >> $output "\
    3560      if test \"\$libtool_execute_magic\" != \"$magic\"; then
    3561        # Run the actual program with our arguments.
    3562 +"
    3563 +       case $host in
    3564 +         # win32 systems need to use the prog path for dll
    3565 +         # lookup to work
    3566 +       *-*-cygwin*)
    3567 +         $echo >> $output "\
    3568 +      exec \$progdir/\$program \${1+\"\$@\"}
    3569 +"
    3570 +         ;;
    3571  
    3572 +       # Backslashes separate directories on plain windows
    3573 +       *-*-mingw | *-*-os2*)
    3574 +         $echo >> $output "\
    3575 +      exec \$progdir\\\\\$program \${1+\"\$@\"}
    3576 +"
    3577 +         ;;
    3578 +
    3579 +       *)
    3580 +         $echo >> $output "\
    3581        # Export the path to the program.
    3582        PATH=\"\$progdir:\$PATH\"
    3583        export PATH
    3584  
    3585        exec \$program \${1+\"\$@\"}
    3586 -
    3587 +"
    3588 +         ;;
    3589 +       esac
    3590 +       $echo >> $output "\
    3591        \$echo \"\$0: cannot exec \$program \${1+\"\$@\"}\"
    3592        exit 1
    3593      fi
    3594 @@ -1530,45 +2998,135 @@
    3595    fi
    3596  fi\
    3597  "
    3598 -        chmod +x $output
    3599 +       chmod +x $output
    3600        fi
    3601        exit 0
    3602        ;;
    3603      esac
    3604  
    3605      # See if we need to build an old-fashioned archive.
    3606 -    if test "$build_old_libs" = "yes"; then
    3607 -      # Transform .lo files to .o files.
    3608 -      oldobjs="$objs"`$echo "X$libobjs " | $Xsed -e 's/[^   ]*\.a //g' -e 's/\.lo /.o /g' -e 's/ $//g'`
    3609 +    for oldlib in $oldlibs; do
    3610 +
    3611 +      if test "$build_libtool_libs" = convenience; then
    3612 +       oldobjs="$libobjs_save"
    3613 +       addlibs="$convenience"
    3614 +       build_libtool_libs=no
    3615 +      else
    3616 +       if test "$build_libtool_libs" = module; then
    3617 +         oldobjs="$libobjs_save"
    3618 +         build_libtool_libs=no
    3619 +       else
    3620 +         oldobjs="$objs "`$echo "X$libobjs_save" | $SP2NL | $Xsed -e '/\.'${libext}'$/d' -e '/\.lib$/d' -e "$lo2o" | $NL2SP`
    3621 +       fi
    3622 +       addlibs="$old_convenience"
    3623 +      fi
    3624 +
    3625 +      if test -n "$addlibs"; then
    3626 +       gentop="$output_objdir/${outputname}x"
    3627 +       $show "${rm}r $gentop"
    3628 +       $run ${rm}r "$gentop"
    3629 +       $show "mkdir $gentop"
    3630 +       $run mkdir "$gentop"
    3631 +       status=$?
    3632 +       if test $status -ne 0 && test ! -d "$gentop"; then
    3633 +         exit $status
    3634 +       fi
    3635 +       generated="$generated $gentop"
    3636 +         
    3637 +       # Add in members from convenience archives.
    3638 +       for xlib in $addlibs; do
    3639 +         # Extract the objects.
    3640 +         case "$xlib" in
    3641 +         [\\/]* | [A-Za-z]:[\\/]*) xabs="$xlib" ;;
    3642 +         *) xabs=`pwd`"/$xlib" ;;
    3643 +         esac
    3644 +         xlib=`$echo "X$xlib" | $Xsed -e 's%^.*/%%'`
    3645 +         xdir="$gentop/$xlib"
    3646 +
    3647 +         $show "${rm}r $xdir"
    3648 +         $run ${rm}r "$xdir"
    3649 +         $show "mkdir $xdir"
    3650 +         $run mkdir "$xdir"
    3651 +         status=$?
    3652 +         if test $status -ne 0 && test ! -d "$xdir"; then
    3653 +           exit $status
    3654 +         fi
    3655 +         $show "(cd $xdir && $AR x $xabs)"
    3656 +         $run eval "(cd \$xdir && $AR x \$xabs)" || exit $?
    3657 +
    3658 +         oldobjs="$oldobjs "`find $xdir -name \*.${objext} -print -o -name \*.lo -print | $NL2SP`
    3659 +       done
    3660 +      fi
    3661  
    3662        # Do each command in the archive commands.
    3663        if test -n "$old_archive_from_new_cmds" && test "$build_libtool_libs" = yes; then
    3664         eval cmds=\"$old_archive_from_new_cmds\"
    3665        else
    3666 +       # Ensure that we have .o objects in place in case we decided
    3667 +       # not to build a shared library, and have fallen back to building
    3668 +       # static libs even though --disable-static was passed!
    3669 +       for oldobj in $oldobjs; do
    3670 +         if test ! -f $oldobj; then
    3671 +           xdir=`$echo "X$oldobj" | $Xsed -e 's%/[^/]*$%%'`
    3672 +           if test "X$xdir" = "X$oldobj"; then
    3673 +             xdir="."
    3674 +           else
    3675 +             xdir="$xdir"
    3676 +           fi
    3677 +           baseobj=`$echo "X$oldobj" | $Xsed -e 's%^.*/%%'`
    3678 +           obj=`$echo "X$baseobj" | $Xsed -e "$o2lo"`
    3679 +           $show "(cd $xdir && ${LN_S} $obj $baseobj)"
    3680 +           $run eval '(cd $xdir && ${LN_S} $obj $baseobj)' || exit $?
    3681 +         fi
    3682 +       done
    3683 +
    3684         eval cmds=\"$old_archive_cmds\"
    3685        fi
    3686 -      IFS="${IFS=      }"; save_ifs="$IFS"; IFS=';'
    3687 +      IFS="${IFS=      }"; save_ifs="$IFS"; IFS='~'
    3688        for cmd in $cmds; do
    3689 -        IFS="$save_ifs"
    3690 -        $show "$cmd"
    3691 -        $run eval "$cmd" || exit $?
    3692 +       IFS="$save_ifs"
    3693 +       $show "$cmd"
    3694 +       $run eval "$cmd" || exit $?
    3695        done
    3696        IFS="$save_ifs"
    3697 +    done
    3698 +
    3699 +    if test -n "$generated"; then
    3700 +      $show "${rm}r$generated"
    3701 +      $run ${rm}r$generated
    3702      fi
    3703  
    3704      # Now create the libtool archive.
    3705      case "$output" in
    3706      *.la)
    3707        old_library=
    3708 -      test "$build_old_libs" = yes && old_library="$libname.a"
    3709 -
    3710 +      test "$build_old_libs" = yes && old_library="$libname.$libext"
    3711        $show "creating $output"
    3712  
    3713 +      if test -n "$xrpath"; then
    3714 +       temp_xrpath=
    3715 +       for libdir in $xrpath; do
    3716 +         temp_xrpath="$temp_xrpath -R$libdir"
    3717 +       done
    3718 +       dependency_libs="$temp_xrpath $dependency_libs"
    3719 +      fi
    3720 +
    3721        # Only create the output if not a dry run.
    3722        if test -z "$run"; then
    3723 -        $echo > $output "\
    3724 -# $output - a libtool library file
    3725 -# Generated by ltmain.sh - GNU $PACKAGE $VERSION
    3726 +       for installed in no yes; do
    3727 +         if test "$installed" = yes; then
    3728 +           if test -z "$install_libdir"; then
    3729 +             break
    3730 +           fi
    3731 +           output="$output_objdir/$outputname"i
    3732 +         fi
    3733 +         $rm $output
    3734 +         $echo > $output "\
    3735 +# $outputname - a libtool library file
    3736 +# Generated by $PROGRAM - GNU $PACKAGE $VERSION$TIMESTAMP
    3737 +#
    3738 +# Please DO NOT delete this file!
    3739 +# It is necessary for linking the library.
    3740  
    3741  # The name that we can dlopen(3).
    3742  dlname='$dlname'
    3743 @@ -1587,15 +3145,19 @@
    3744  age=$age
    3745  revision=$revision
    3746  
    3747 +# Is this an already installed library?
    3748 +installed=$installed
    3749 +
    3750  # Directory that this library needs to be installed in:
    3751  libdir='$install_libdir'\
    3752  "
    3753 +       done
    3754        fi
    3755  
    3756        # Do a symbolic link so that the libtool archive can be found in
    3757        # LD_LIBRARY_PATH before the program is installed.
    3758 -      $show "(cd $objdir && $LN_S ../$output $output)"
    3759 -      $run eval "(cd $objdir && $LN_S ../$output $output)" || exit 1
    3760 +      $show "(cd $output_objdir && $rm $outputname && $LN_S ../$outputname $outputname)"
    3761 +      $run eval "(cd $output_objdir && $rm $outputname && $LN_S ../$outputname $outputname)" || exit $?
    3762        ;;
    3763      esac
    3764      exit 0
    3765 @@ -1605,9 +3167,9 @@
    3766    install)
    3767      modename="$modename: install"
    3768  
    3769 -    # There may be an optional /bin/sh argument at the beginning of
    3770 +    # There may be an optional sh(1) argument at the beginning of
    3771      # install_prog (especially on Windows NT).
    3772 -    if test "$nonopt" = "$SHELL"; then
    3773 +    if test "$nonopt" = "$SHELL" || test "$nonopt" = /bin/sh; then
    3774        # Aesthetically quote it.
    3775        arg=`$echo "X$nonopt" | $Xsed -e "$sed_quote_subst"`
    3776        case "$arg" in
    3777 @@ -1639,14 +3201,14 @@
    3778      opts=
    3779      prev=
    3780      install_type=
    3781 -    isdir=
    3782 +    isdir=no
    3783      stripme=
    3784      for arg
    3785      do
    3786        if test -n "$dest"; then
    3787 -        files="$files $dest"
    3788 -        dest="$arg"
    3789 -        continue
    3790 +       files="$files $dest"
    3791 +       dest="$arg"
    3792 +       continue
    3793        fi
    3794  
    3795        case "$arg" in
    3796 @@ -1656,20 +3218,20 @@
    3797        -m) prev="-m" ;;
    3798        -o) prev="-o" ;;
    3799        -s)
    3800 -        stripme=" -s"
    3801 -        continue
    3802 -        ;;
    3803 +       stripme=" -s"
    3804 +       continue
    3805 +       ;;
    3806        -*) ;;
    3807  
    3808        *)
    3809 -        # If the previous option needed an argument, then skip it.
    3810 -        if test -n "$prev"; then
    3811 -          prev=
    3812 -        else
    3813 -          dest="$arg"
    3814 -          continue
    3815 -        fi
    3816 -        ;;
    3817 +       # If the previous option needed an argument, then skip it.
    3818 +       if test -n "$prev"; then
    3819 +         prev=
    3820 +       else
    3821 +         dest="$arg"
    3822 +         continue
    3823 +       fi
    3824 +       ;;
    3825        esac
    3826  
    3827        # Aesthetically quote the argument.
    3828 @@ -1696,9 +3258,9 @@
    3829  
    3830      if test -z "$files"; then
    3831        if test -z "$dest"; then
    3832 -        $echo "$modename: no file or destination specified" 1>&2
    3833 +       $echo "$modename: no file or destination specified" 1>&2
    3834        else
    3835 -        $echo "$modename: you must specify a destination" 1>&2
    3836 +       $echo "$modename: you must specify a destination" 1>&2
    3837        fi
    3838        $echo "$help" 1>&2
    3839        exit 1
    3840 @@ -1709,7 +3271,7 @@
    3841  
    3842      # Check to see that the destination is a directory.
    3843      test -d "$dest" && isdir=yes
    3844 -    if test -n "$isdir"; then
    3845 +    if test "$isdir" = yes; then
    3846        destdir="$dest"
    3847        destname=
    3848      else
    3849 @@ -1720,23 +3282,23 @@
    3850        # Not a directory, so check to see that there is only one file specified.
    3851        set dummy $files
    3852        if test $# -gt 2; then
    3853 -        $echo "$modename: \`$dest' is not a directory" 1>&2
    3854 -        $echo "$help" 1>&2
    3855 -        exit 1
    3856 +       $echo "$modename: \`$dest' is not a directory" 1>&2
    3857 +       $echo "$help" 1>&2
    3858 +       exit 1
    3859        fi
    3860      fi
    3861      case "$destdir" in
    3862 -    /* | [A-Za-z]:\\*) ;;
    3863 +    [\\/]* | [A-Za-z]:[\\/]*) ;;
    3864      *)
    3865        for file in $files; do
    3866 -        case "$file" in
    3867 -        *.lo) ;;
    3868 -        *)
    3869 -          $echo "$modename: \`$destdir' must be an absolute directory name" 1>&2
    3870 -          $echo "$help" 1>&2
    3871 -          exit 1
    3872 -          ;;
    3873 -        esac
    3874 +       case "$file" in
    3875 +       *.lo) ;;
    3876 +       *)
    3877 +         $echo "$modename: \`$destdir' must be an absolute directory name" 1>&2
    3878 +         $echo "$help" 1>&2
    3879 +         exit 1
    3880 +         ;;
    3881 +       esac
    3882        done
    3883        ;;
    3884      esac
    3885 @@ -1752,209 +3314,214 @@
    3886  
    3887        # Do each installation.
    3888        case "$file" in
    3889 -      *.a)
    3890 -        # Do the static libraries later.
    3891 -        staticlibs="$staticlibs $file"
    3892 -        ;;
    3893 +      *.a | *.lib)
    3894 +       # Do the static libraries later.
    3895 +       staticlibs="$staticlibs $file"
    3896 +       ;;
    3897  
    3898        *.la)
    3899 -        # Check to see that this really is a libtool archive.
    3900 -        if (sed -e '2q' $file | egrep '^# Generated by ltmain\.sh') >/dev/null 2>&1; then :
    3901 -        else
    3902 -          $echo "$modename: \`$file' is not a valid libtool archive" 1>&2
    3903 -          $echo "$help" 1>&2
    3904 -          exit 1
    3905 -        fi
    3906 -
    3907 -        library_names=
    3908 -        old_library=
    3909 -        # If there is no directory component, then add one.
    3910 -        case "$file" in
    3911 -        */* | *\\*) . $file ;;
    3912 -        *) . ./$file ;;
    3913 -        esac
    3914 -
    3915 -        # Add the libdir to current_libdirs if it is the destination.
    3916 -        if test "X$destdir" = "X$libdir"; then
    3917 -          case "$current_libdirs " in
    3918 -          *" $libdir "*) ;;
    3919 -          *) current_libdirs="$current_libdirs $libdir" ;;
    3920 -          esac
    3921 -        else
    3922 -          # Note the libdir as a future libdir.
    3923 -          case "$future_libdirs " in
    3924 -          *" $libdir "*) ;;
    3925 -          *) future_libdirs="$future_libdirs $libdir" ;;
    3926 -          esac
    3927 -        fi
    3928 -
    3929 -        dir="`$echo "X$file" | $Xsed -e 's%/[^/]*$%%'`/"
    3930 -        test "X$dir" = "X$file/" && dir=
    3931 -        dir="$dir$objdir"
    3932 -
    3933 -        # See the names of the shared library.
    3934 -        set dummy $library_names
    3935 -        if test -n "$2"; then
    3936 -          realname="$2"
    3937 -          shift
    3938 -          shift
    3939 -
    3940 -          # Install the shared library and build the symlinks.
    3941 -          $show "$install_prog $dir/$realname $destdir/$realname"
    3942 -          $run eval "$install_prog $dir/$realname $destdir/$realname" || exit $?
    3943 -          test "X$dlname" = "X$realname" && dlname=
    3944 -
    3945 -          if test $# -gt 0; then
    3946 -            # Delete the old symlinks.
    3947 -            rmcmd="$rm"
    3948 -            for linkname
    3949 -            do
    3950 -              rmcmd="$rmcmd $destdir/$linkname"
    3951 -            done
    3952 -            $show "$rmcmd"
    3953 -            $run $rmcmd
    3954 -
    3955 -            # ... and create new ones.
    3956 -            for linkname
    3957 -            do
    3958 -              test "X$dlname" = "X$linkname" && dlname=
    3959 -              $show "(cd $destdir && $LN_S $realname $linkname)"
    3960 -              $run eval "(cd $destdir && $LN_S $realname $linkname)"
    3961 -            done
    3962 -          fi
    3963 -
    3964 -          if test -n "$dlname"; then
    3965 -            # Install the dynamically-loadable library.
    3966 -            $show "$install_prog $dir/$dlname $destdir/$dlname"
    3967 -            $run eval "$install_prog $dir/$dlname $destdir/$dlname" || exit $?
    3968 -          fi
    3969 -
    3970 -          # Do each command in the postinstall commands.
    3971 -          lib="$destdir/$realname"
    3972 -          eval cmds=\"$postinstall_cmds\"
    3973 -          IFS="${IFS=  }"; save_ifs="$IFS"; IFS=';'
    3974 -          for cmd in $cmds; do
    3975 -            IFS="$save_ifs"
    3976 -            $show "$cmd"
    3977 -            $run eval "$cmd" || exit $?
    3978 -          done
    3979 -          IFS="$save_ifs"
    3980 -        fi
    3981 -
    3982 -        # Install the pseudo-library for information purposes.
    3983 -        name=`$echo "X$file" | $Xsed -e 's%^.*/%%'`
    3984 -        $show "$install_prog $file $destdir/$name"
    3985 -        $run eval "$install_prog $file $destdir/$name" || exit $?
    3986 -
    3987 -        # Maybe install the static library, too.
    3988 -        test -n "$old_library" && staticlibs="$staticlibs $dir/$old_library"
    3989 -        ;;
    3990 +       # Check to see that this really is a libtool archive.
    3991 +       if (sed -e '2q' $file | egrep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then :
    3992 +       else
    3993 +         $echo "$modename: \`$file' is not a valid libtool archive" 1>&2
    3994 +         $echo "$help" 1>&2
    3995 +         exit 1
    3996 +       fi
    3997 +
    3998 +       library_names=
    3999 +       old_library=
    4000 +       # If there is no directory component, then add one.
    4001 +       case "$file" in
    4002 +       */* | *\\*) . $file ;;
    4003 +       *) . ./$file ;;
    4004 +       esac
    4005 +
    4006 +       # Add the libdir to current_libdirs if it is the destination.
    4007 +       if test "X$destdir" = "X$libdir"; then
    4008 +         case "$current_libdirs " in
    4009 +         *" $libdir "*) ;;
    4010 +         *) current_libdirs="$current_libdirs $libdir" ;;
    4011 +         esac
    4012 +       else
    4013 +         # Note the libdir as a future libdir.
    4014 +         case "$future_libdirs " in
    4015 +         *" $libdir "*) ;;
    4016 +         *) future_libdirs="$future_libdirs $libdir" ;;
    4017 +         esac
    4018 +       fi
    4019 +
    4020 +       dir="`$echo "X$file" | $Xsed -e 's%/[^/]*$%%'`/"
    4021 +       test "X$dir" = "X$file/" && dir=
    4022 +       dir="$dir$objdir"
    4023 +
    4024 +       # See the names of the shared library.
    4025 +       set dummy $library_names
    4026 +       if test -n "$2"; then
    4027 +         realname="$2"
    4028 +         shift
    4029 +         shift
    4030 +
    4031 +         # Install the shared library and build the symlinks.
    4032 +         $show "$install_prog $dir/$realname $destdir/$realname"
    4033 +         $run eval "$install_prog $dir/$realname $destdir/$realname" || exit $?
    4034 +
    4035 +         if test $# -gt 0; then
    4036 +           # Delete the old symlinks, and create new ones.
    4037 +           for linkname
    4038 +           do
    4039 +             if test "$linkname" != "$realname"; then
    4040 +               $show "(cd $destdir && $rm $linkname && $LN_S $realname $linkname)"
    4041 +               $run eval "(cd $destdir && $rm $linkname && $LN_S $realname $linkname)"
    4042 +             fi
    4043 +           done
    4044 +         fi
    4045 +
    4046 +         # Do each command in the postinstall commands.
    4047 +         lib="$destdir/$realname"
    4048 +         eval cmds=\"$postinstall_cmds\"
    4049 +         IFS="${IFS=   }"; save_ifs="$IFS"; IFS='~'
    4050 +         for cmd in $cmds; do
    4051 +           IFS="$save_ifs"
    4052 +           $show "$cmd"
    4053 +           $run eval "$cmd" || exit $?
    4054 +         done
    4055 +         IFS="$save_ifs"
    4056 +       fi
    4057 +
    4058 +       # Install the pseudo-library for information purposes.
    4059 +       name=`$echo "X$file" | $Xsed -e 's%^.*/%%'`
    4060 +       instname="$dir/$name"i
    4061 +       $show "$install_prog $instname $destdir/$name"
    4062 +       $run eval "$install_prog $instname $destdir/$name" || exit $?
    4063 +
    4064 +       # Maybe install the static library, too.
    4065 +       test -n "$old_library" && staticlibs="$staticlibs $dir/$old_library"
    4066 +       ;;
    4067  
    4068        *.lo)
    4069 -        # Install (i.e. copy) a libtool object.
    4070 +       # Install (i.e. copy) a libtool object.
    4071 +
    4072 +       # Figure out destination file name, if it wasn't already specified.
    4073 +       if test -n "$destname"; then
    4074 +         destfile="$destdir/$destname"
    4075 +       else
    4076 +         destfile=`$echo "X$file" | $Xsed -e 's%^.*/%%'`
    4077 +         destfile="$destdir/$destfile"
    4078 +       fi
    4079 +
    4080 +       # Deduce the name of the destination old-style object file.
    4081 +       case "$destfile" in
    4082 +       *.lo)
    4083 +         staticdest=`$echo "X$destfile" | $Xsed -e "$lo2o"`
    4084 +         ;;
    4085 +       *.o | *.obj)
    4086 +         staticdest="$destfile"
    4087 +         destfile=
    4088 +         ;;
    4089 +       *)
    4090 +         $echo "$modename: cannot copy a libtool object to \`$destfile'" 1>&2
    4091 +         $echo "$help" 1>&2
    4092 +         exit 1
    4093 +         ;;
    4094 +       esac
    4095 +
    4096 +       # Install the libtool object if requested.
    4097 +       if test -n "$destfile"; then
    4098 +         $show "$install_prog $file $destfile"
    4099 +         $run eval "$install_prog $file $destfile" || exit $?
    4100 +       fi
    4101 +
    4102 +       # Install the old object if enabled.
    4103 +       if test "$build_old_libs" = yes; then
    4104 +         # Deduce the name of the old-style object file.
    4105 +         staticobj=`$echo "X$file" | $Xsed -e "$lo2o"`
    4106  
    4107 -        # Figure out destination file name, if it wasn't already specified.
    4108 -        if test -n "$destname"; then
    4109 -          destfile="$destdir/$destname"
    4110 -        else
    4111 -          destfile=`$echo "X$file" | $Xsed -e 's%^.*/%%'`
    4112 -          destfile="$destdir/$destfile"
    4113 -        fi
    4114 -
    4115 -        # Deduce the name of the destination old-style object file.
    4116 -        case "$destfile" in
    4117 -        *.lo)
    4118 -          staticdest=`$echo "X$destfile" | $Xsed -e 's/\.lo$/\.o/'`
    4119 -          ;;
    4120 -        *.o)
    4121 -          staticdest="$destfile"
    4122 -          destfile=
    4123 -          ;;
    4124 -        *)
    4125 -          $echo "$modename: cannot copy a libtool object to \`$destfile'" 1>&2
    4126 -          $echo "$help" 1>&2
    4127 -          exit 1
    4128 -          ;;
    4129 -        esac
    4130 -
    4131 -        # Install the libtool object if requested.
    4132 -        if test -n "$destfile"; then
    4133 -          $show "$install_prog $file $destfile"
    4134 -          $run eval "$install_prog $file $destfile" || exit $?
    4135 -        fi
    4136 -
    4137 -        # Install the old object if enabled.
    4138 -        if test "$build_old_libs" = yes; then
    4139 -          # Deduce the name of the old-style object file.
    4140 -          staticobj=`$echo "X$file" | $Xsed -e 's/\.lo$/\.o/'`
    4141 -
    4142 -          $show "$install_prog $staticobj $staticdest"
    4143 -          $run eval "$install_prog \$staticobj \$staticdest" || exit $?
    4144 -        fi
    4145 -        exit 0
    4146 -        ;;
    4147 +         $show "$install_prog $staticobj $staticdest"
    4148 +         $run eval "$install_prog \$staticobj \$staticdest" || exit $?
    4149 +       fi
    4150 +       exit 0
    4151 +       ;;
    4152  
    4153        *)
    4154 -        # Do a test to see if this is really a libtool program.
    4155 -        if (sed -e '4q' $file | egrep '^# Generated by ltmain\.sh') >/dev/null 2>&1; then
    4156 -          link_against_libtool_libs=
    4157 -          finalize_command=
    4158 -
    4159 -          # If there is no directory component, then add one.
    4160 -          case "$file" in
    4161 -          */* | *\\*) . $file ;;
    4162 -          *) . ./$file ;;
    4163 -          esac
    4164 -
    4165 -          # Check the variables that should have been set.
    4166 -          if test -z "$link_against_libtool_libs" || test -z "$finalize_command"; then
    4167 -            $echo "$modename: invalid libtool wrapper script \`$file'" 1>&2
    4168 -            exit 1
    4169 -          fi
    4170 -
    4171 -          finalize=yes
    4172 -          for lib in $link_against_libtool_libs; do
    4173 -            # Check to see that each library is installed.
    4174 -            libdir=
    4175 -            if test -f "$lib"; then
    4176 -              # If there is no directory component, then add one.
    4177 -              case "$lib" in
    4178 -              */* | *\\*) . $lib ;;
    4179 -              *) . ./$lib ;;
    4180 -              esac
    4181 -            fi
    4182 -            libfile="$libdir/`$echo "X$lib" | $Xsed -e 's%^.*/%%g'`"
    4183 -            if test -z "$libdir"; then
    4184 -              $echo "$modename: warning: \`$lib' contains no -rpath information" 1>&2
    4185 -            elif test -f "$libfile"; then :
    4186 -            else
    4187 -              $echo "$modename: warning: \`$lib' has not been installed in \`$libdir'" 1>&2
    4188 -              finalize=no
    4189 -            fi
    4190 -          done
    4191 -
    4192 -          if test "$hardcode_action" = relink; then
    4193 -            if test "$finalize" = yes; then
    4194 -              $echo "$modename: warning: relinking \`$file' on behalf of your buggy system linker" 1>&2
    4195 -              $show "$finalize_command"
    4196 -              if $run eval "$finalize_command"; then :
    4197 -              else
    4198 -                $echo "$modename: error: relink \`$file' with the above command before installing it" 1>&2
    4199 -                continue
    4200 -              fi
    4201 -              file="$objdir/$file"T
    4202 -            else
    4203 -              $echo "$modename: warning: cannot relink \`$file' on behalf of your buggy system linker" 1>&2
    4204 -            fi
    4205 -          else
    4206 -            # Install the binary that we compiled earlier.
    4207 +       # Figure out destination file name, if it wasn't already specified.
    4208 +       if test -n "$destname"; then
    4209 +         destfile="$destdir/$destname"
    4210 +       else
    4211 +         destfile=`$echo "X$file" | $Xsed -e 's%^.*/%%'`
    4212 +         destfile="$destdir/$destfile"
    4213 +       fi
    4214 +
    4215 +       # Do a test to see if this is really a libtool program.
    4216 +       if (sed -e '4q' $file | egrep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then
    4217 +         link_against_libtool_libs=
    4218 +         relink_command=
    4219 +
    4220 +         # If there is no directory component, then add one.
    4221 +         case "$file" in
    4222 +         */* | *\\*) . $file ;;
    4223 +         *) . ./$file ;;
    4224 +         esac
    4225 +
    4226 +         # Check the variables that should have been set.
    4227 +         if test -z "$link_against_libtool_libs"; then
    4228 +           $echo "$modename: invalid libtool wrapper script \`$file'" 1>&2
    4229 +           exit 1
    4230 +         fi
    4231 +
    4232 +         finalize=yes
    4233 +         for lib in $link_against_libtool_libs; do
    4234 +           # Check to see that each library is installed.
    4235 +           libdir=
    4236 +           if test -f "$lib"; then
    4237 +             # If there is no directory component, then add one.
    4238 +             case "$lib" in
    4239 +             */* | *\\*) . $lib ;;
    4240 +             *) . ./$lib ;;
    4241 +             esac
    4242 +           fi
    4243 +           libfile="$libdir/`$echo "X$lib" | $Xsed -e 's%^.*/%%g'`"
    4244 +           if test -n "$libdir" && test ! -f "$libfile"; then
    4245 +             $echo "$modename: warning: \`$lib' has not been installed in \`$libdir'" 1>&2
    4246 +             finalize=no
    4247 +           fi
    4248 +         done
    4249 +
    4250 +         outputname=
    4251 +         if test "$fast_install" = no && test -n "$relink_command"; then
    4252 +           if test "$finalize" = yes && test -z "$run"; then
    4253 +             tmpdir="/tmp"
    4254 +             test -n "$TMPDIR" && tmpdir="$TMPDIR"
    4255 +             tmpdir="$tmpdir/libtool-$$"
    4256 +             if $mkdir -p "$tmpdir" && chmod 700 "$tmpdir"; then :
    4257 +             else
    4258 +               $echo "$modename: error: cannot create temporary directory \`$tmpdir'" 1>&2
    4259 +               continue
    4260 +             fi
    4261 +             outputname="$tmpdir/$file"
    4262 +             # Replace the output file specification.
    4263 +             relink_command=`$echo "X$relink_command" | $Xsed -e 's%@OUTPUT@%'"$outputname"'%g'`
    4264 +
    4265 +             $show "$relink_command"
    4266 +             if $run eval "$relink_command"; then :
    4267 +             else
    4268 +               $echo "$modename: error: relink \`$file' with the above command before installing it" 1>&2
    4269 +               ${rm}r "$tmpdir"
    4270 +               continue
    4271 +             fi
    4272 +             file="$outputname"
    4273 +           else
    4274 +             $echo "$modename: warning: cannot relink \`$file'" 1>&2
    4275 +           fi
    4276 +         else
    4277 +           # Install the binary that we compiled earlier.
    4278             file=`$echo "X$file" | $Xsed -e "s%\([^/]*\)$%$objdir/\1%"`
    4279 -          fi
    4280 -        fi
    4281 +         fi
    4282 +       fi
    4283  
    4284 -        $show "$install_prog$stripme $file $dest"
    4285 -        $run eval "$install_prog\$stripme \$file \$dest" || exit $?
    4286 -        ;;
    4287 +       $show "$install_prog$stripme $file $destfile"
    4288 +       $run eval "$install_prog\$stripme \$file \$destfile" || exit $?
    4289 +       test -n "$outputname" && ${rm}r "$tmpdir"
    4290 +       ;;
    4291        esac
    4292      done
    4293  
    4294 @@ -1969,11 +3536,11 @@
    4295  
    4296        # Do each command in the postinstall commands.
    4297        eval cmds=\"$old_postinstall_cmds\"
    4298 -      IFS="${IFS=      }"; save_ifs="$IFS"; IFS=';'
    4299 +      IFS="${IFS=      }"; save_ifs="$IFS"; IFS='~'
    4300        for cmd in $cmds; do
    4301 -        IFS="$save_ifs"
    4302 -        $show "$cmd"
    4303 -        $run eval "$cmd" || exit $?
    4304 +       IFS="$save_ifs"
    4305 +       $show "$cmd"
    4306 +       $run eval "$cmd" || exit $?
    4307        done
    4308        IFS="$save_ifs"
    4309      done
    4310 @@ -1996,43 +3563,49 @@
    4311    finish)
    4312      modename="$modename: finish"
    4313      libdirs="$nonopt"
    4314 +    admincmds=
    4315  
    4316      if test -n "$finish_cmds$finish_eval" && test -n "$libdirs"; then
    4317        for dir
    4318        do
    4319 -        libdirs="$libdirs $dir"
    4320 +       libdirs="$libdirs $dir"
    4321        done
    4322  
    4323        for libdir in $libdirs; do
    4324         if test -n "$finish_cmds"; then
    4325           # Do each command in the finish commands.
    4326           eval cmds=\"$finish_cmds\"
    4327 -          IFS="${IFS=  }"; save_ifs="$IFS"; IFS=';'
    4328 -          for cmd in $cmds; do
    4329 -            IFS="$save_ifs"
    4330 -            $show "$cmd"
    4331 -            $run eval "$cmd"
    4332 -          done
    4333 -          IFS="$save_ifs"
    4334 +         IFS="${IFS=   }"; save_ifs="$IFS"; IFS='~'
    4335 +         for cmd in $cmds; do
    4336 +           IFS="$save_ifs"
    4337 +           $show "$cmd"
    4338 +           $run eval "$cmd" || admincmds="$admincmds
    4339 +       $cmd"
    4340 +         done
    4341 +         IFS="$save_ifs"
    4342         fi
    4343         if test -n "$finish_eval"; then
    4344           # Do the single finish_eval.
    4345           eval cmds=\"$finish_eval\"
    4346 -         $run eval "$cmds"
    4347 +         $run eval "$cmds" || admincmds="$admincmds
    4348 +       $cmds"
    4349         fi
    4350        done
    4351      fi
    4352  
    4353 -    echo "------------------------------------------------------------------------------"
    4354 +    # Exit here if they wanted silent mode.
    4355 +    test "$show" = : && exit 0
    4356 +
    4357 +    echo "----------------------------------------------------------------------"
    4358      echo "Libraries have been installed in:"
    4359      for libdir in $libdirs; do
    4360        echo "   $libdir"
    4361      done
    4362      echo
    4363 -    echo "To link against installed libraries in a given directory, LIBDIR,"
    4364 -    echo "you must use the \`-LLIBDIR' flag during linking."
    4365 -    echo
    4366 -    echo " You will also need to do one of the following:"
    4367 +    echo "If you ever happen to want to link against installed libraries"
    4368 +    echo "in a given directory, LIBDIR, you must either use libtool, and"
    4369 +    echo "specify the full pathname of the library, or use \`-LLIBDIR'"
    4370 +    echo "flag during linking and do at least one of the following:"
    4371      if test -n "$shlibpath_var"; then
    4372        echo "   - add LIBDIR to the \`$shlibpath_var' environment variable"
    4373        echo "     during execution"
    4374 @@ -2047,13 +3620,16 @@
    4375  
    4376        echo "   - use the \`$flag' linker flag"
    4377      fi
    4378 +    if test -n "$admincmds"; then
    4379 +      echo "   - have your system administrator run these commands:$admincmds"
    4380 +    fi
    4381      if test -f /etc/ld.so.conf; then
    4382        echo "   - have your system administrator add LIBDIR to \`/etc/ld.so.conf'"
    4383      fi
    4384      echo
    4385      echo "See any operating system documentation about shared libraries for"
    4386      echo "more information, such as the ld(1) and ld.so(8) manual pages."
    4387 -    echo "------------------------------------------------------------------------------"
    4388 +    echo "----------------------------------------------------------------------"
    4389      exit 0
    4390      ;;
    4391  
    4392 @@ -2071,8 +3647,7 @@
    4393  
    4394      # Handle -dlopen flags immediately.
    4395      for file in $execute_dlfiles; do
    4396 -      if test -f "$file"; then :
    4397 -      else
    4398 +      if test ! -f "$file"; then
    4399         $echo "$modename: \`$file' is not a file" 1>&2
    4400         $echo "$help" 1>&2
    4401         exit 1
    4402 @@ -2081,22 +3656,22 @@
    4403        dir=
    4404        case "$file" in
    4405        *.la)
    4406 -        # Check to see that this really is a libtool archive.
    4407 -        if (sed -e '2q' $file | egrep '^# Generated by ltmain\.sh') >/dev/null 2>&1; then :
    4408 -        else
    4409 -          $echo "$modename: \`$lib' is not a valid libtool archive" 1>&2
    4410 -          $echo "$help" 1>&2
    4411 -          exit 1
    4412 -        fi
    4413 +       # Check to see that this really is a libtool archive.
    4414 +       if (sed -e '2q' $file | egrep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then :
    4415 +       else
    4416 +         $echo "$modename: \`$lib' is not a valid libtool archive" 1>&2
    4417 +         $echo "$help" 1>&2
    4418 +         exit 1
    4419 +       fi
    4420  
    4421         # Read the libtool library.
    4422         dlname=
    4423         library_names=
    4424  
    4425 -        # If there is no directory component, then add one.
    4426 +       # If there is no directory component, then add one.
    4427         case "$file" in
    4428         */* | *\\*) . $file ;;
    4429 -        *) . ./$file ;;
    4430 +       *) . ./$file ;;
    4431         esac
    4432  
    4433         # Skip this library if it cannot be dlopened.
    4434 @@ -2125,7 +3700,7 @@
    4435  
    4436        *)
    4437         $echo "$modename: warning \`-dlopen' is ignored for non-libtool libraries and objects" 1>&2
    4438 -        continue
    4439 +       continue
    4440         ;;
    4441        esac
    4442  
    4443 @@ -2152,8 +3727,8 @@
    4444        case "$file" in
    4445        -*) ;;
    4446        *)
    4447 -        # Do a test to see if this is really a libtool program.
    4448 -        if (sed -e '4q' $file | egrep '^# Generated by ltmain\.sh') >/dev/null 2>&1; then
    4449 +       # Do a test to see if this is really a libtool program.
    4450 +       if (sed -e '4q' $file | egrep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then
    4451           # If there is no directory component, then add one.
    4452           case "$file" in
    4453           */* | *\\*) . $file ;;
    4454 @@ -2163,7 +3738,7 @@
    4455           # Transform arg to wrapped name.
    4456           file="$progdir/$program"
    4457         fi
    4458 -        ;;
    4459 +       ;;
    4460        esac
    4461        # Quote arguments (to preserve shell metacharacters).
    4462        file=`$echo "X$file" | $Xsed -e "$sed_quote_subst"`
    4463 @@ -2171,8 +3746,18 @@
    4464      done
    4465  
    4466      if test -z "$run"; then
    4467 -      # Export the shlibpath_var.
    4468 -      eval "export $shlibpath_var"
    4469 +      if test -n "$shlibpath_var"; then
    4470 +        # Export the shlibpath_var.
    4471 +        eval "export $shlibpath_var"
    4472 +      fi
    4473 +
    4474 +      # Restore saved enviroment variables
    4475 +      if test "${save_LC_ALL+set}" = set; then
    4476 +       LC_ALL="$save_LC_ALL"; export LC_ALL
    4477 +      fi
    4478 +      if test "${save_LANG+set}" = set; then
    4479 +       LANG="$save_LANG"; export LANG
    4480 +      fi
    4481  
    4482        # Now actually exec the command.
    4483        eval "exec \$cmd$args"
    4484 @@ -2181,8 +3766,10 @@
    4485        exit 1
    4486      else
    4487        # Display what would be done.
    4488 -      eval "\$echo \"\$shlibpath_var=\$$shlibpath_var\""
    4489 -      $echo "export $shlibpath_var"
    4490 +      if test -n "$shlibpath_var"; then
    4491 +        eval "\$echo \"\$shlibpath_var=\$$shlibpath_var\""
    4492 +        $echo "export $shlibpath_var"
    4493 +      fi
    4494        $echo "$cmd$args"
    4495        exit 0
    4496      fi
    4497 @@ -2217,17 +3804,15 @@
    4498  
    4499        case "$name" in
    4500        *.la)
    4501 -        # Possibly a libtool archive, so verify it.
    4502 -        if (sed -e '2q' $file | egrep '^# Generated by ltmain\.sh') >/dev/null 2>&1; then
    4503 -          . $dir/$name
    4504 -
    4505 -          # Delete the libtool libraries and symlinks.
    4506 -          for n in $library_names; do
    4507 -            rmfiles="$rmfiles $dir/$n"
    4508 -            test "X$n" = "X$dlname" && dlname=
    4509 -          done
    4510 -          test -n "$dlname" && rmfiles="$rmfiles $dir/$dlname"
    4511 -          test -n "$old_library" && rmfiles="$rmfiles $dir/$old_library"
    4512 +       # Possibly a libtool archive, so verify it.
    4513 +       if (sed -e '2q' $file | egrep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then
    4514 +         . $dir/$name
    4515 +
    4516 +         # Delete the libtool libraries and symlinks.
    4517 +         for n in $library_names; do
    4518 +           rmfiles="$rmfiles $dir/$n"
    4519 +         done
    4520 +         test -n "$old_library" && rmfiles="$rmfiles $dir/$old_library"
    4521  
    4522           $show "$rm $rmfiles"
    4523           $run $rm $rmfiles
    4524 @@ -2235,7 +3820,7 @@
    4525           if test -n "$library_names"; then
    4526             # Do each command in the postuninstall commands.
    4527             eval cmds=\"$postuninstall_cmds\"
    4528 -           IFS="${IFS=         }"; save_ifs="$IFS"; IFS=';'
    4529 +           IFS="${IFS=         }"; save_ifs="$IFS"; IFS='~'
    4530             for cmd in $cmds; do
    4531               IFS="$save_ifs"
    4532               $show "$cmd"
    4533 @@ -2244,10 +3829,10 @@
    4534             IFS="$save_ifs"
    4535           fi
    4536  
    4537 -          if test -n "$old_library"; then
    4538 +         if test -n "$old_library"; then
    4539             # Do each command in the old_postuninstall commands.
    4540             eval cmds=\"$old_postuninstall_cmds\"
    4541 -           IFS="${IFS=         }"; save_ifs="$IFS"; IFS=';'
    4542 +           IFS="${IFS=         }"; save_ifs="$IFS"; IFS='~'
    4543             for cmd in $cmds; do
    4544               IFS="$save_ifs"
    4545               $show "$cmd"
    4546 @@ -2256,21 +3841,21 @@
    4547             IFS="$save_ifs"
    4548           fi
    4549  
    4550 -          # FIXME: should reinstall the best remaining shared library.
    4551 -        fi
    4552 -        ;;
    4553 +         # FIXME: should reinstall the best remaining shared library.
    4554 +       fi
    4555 +       ;;
    4556  
    4557        *.lo)
    4558 -        if test "$build_old_libs" = yes; then
    4559 -          oldobj=`$echo "X$name" | $Xsed -e 's/\.lo$/\.o/'`
    4560 -          rmfiles="$rmfiles $dir/$oldobj"
    4561 -        fi
    4562 +       if test "$build_old_libs" = yes; then
    4563 +         oldobj=`$echo "X$name" | $Xsed -e "$lo2o"`
    4564 +         rmfiles="$rmfiles $dir/$oldobj"
    4565 +       fi
    4566         $show "$rm $rmfiles"
    4567         $run $rm $rmfiles
    4568 -        ;;
    4569 +       ;;
    4570  
    4571        *)
    4572 -       $show "$rm $rmfiles"
    4573 +       $show "$rm $rmfiles"
    4574         $run $rm $rmfiles
    4575         ;;
    4576        esac
    4577 @@ -2297,8 +3882,10 @@
    4578  
    4579  Provide generalized library-building support services.
    4580  
    4581 +    --config          show all configuration variables
    4582 +    --debug           enable verbose shell tracing
    4583  -n, --dry-run         display commands without modifying any files
    4584 -    --features        display configuration information and exit
    4585 +    --features        display basic configuration information and exit
    4586      --finish          same as \`--mode=finish'
    4587      --help            display this help message and exit
    4588      --mode=MODE       use operation mode MODE [default=inferred from MODE-ARGS]
    4589 @@ -2326,6 +3913,11 @@
    4590  
    4591  Compile a source file into a libtool library object.
    4592  
    4593 +This mode accepts the following additional options:
    4594 +
    4595 +  -o OUTPUT-FILE    set the output file name to OUTPUT-FILE
    4596 +  -static           always build a \`.o' file suitable for static linking
    4597 +
    4598  COMPILE-COMMAND is a command to be used in creating a \`standard' object file
    4599  from the given SOURCEFILE.
    4600  
    4601 @@ -2392,18 +3984,25 @@
    4602  The following components of LINK-COMMAND are treated specially:
    4603  
    4604    -all-static       do not do any dynamic linking at all
    4605 +  -avoid-version    do not add a version suffix if possible
    4606    -dlopen FILE      \`-dlpreopen' FILE if it cannot be dlopened at runtime
    4607 -  -dlpreopen FILE   link in FILE and add its symbols to dld_preloaded_symbols
    4608 +  -dlpreopen FILE   link in FILE and add its symbols to lt_preloaded_symbols
    4609    -export-dynamic   allow symbols from OUTPUT-FILE to be resolved with dlsym(3)
    4610 +  -export-symbols SYMFILE
    4611 +                   try to export only the symbols listed in SYMFILE
    4612 +  -export-symbols-regex REGEX
    4613 +                   try to export only the symbols matching REGEX
    4614    -LLIBDIR          search LIBDIR for required installed libraries
    4615    -lNAME            OUTPUT-FILE requires the installed library libNAME
    4616 +  -module           build a library that can dlopened
    4617    -no-undefined     declare that a library does not refer to external symbols
    4618    -o OUTPUT-FILE    create OUTPUT-FILE from the specified objects
    4619    -release RELEASE  specify package release information
    4620    -rpath LIBDIR     the created library will eventually be installed in LIBDIR
    4621 +  -R[ ]LIBDIR       add LIBDIR to the runtime path of programs and libraries
    4622    -static           do not do any dynamic linking of libtool libraries
    4623    -version-info CURRENT[:REVISION[:AGE]]
    4624 -                    specify library version info [each variable defaults to 0]
    4625 +                   specify library version info [each variable defaults to 0]
    4626  
    4627  All other options (arguments beginning with \`-') are ignored.
    4628  
    4629 @@ -2411,18 +4010,19 @@
    4630  treated as uninstalled libtool libraries, other files are standard or library
    4631  object files.
    4632  
    4633 -If the OUTPUT-FILE ends in \`.la', then a libtool library is created, only
    4634 -library objects (\`.lo' files) may be specified, and \`-rpath' is required.
    4635 +If the OUTPUT-FILE ends in \`.la', then a libtool library is created,
    4636 +only library objects (\`.lo' files) may be specified, and \`-rpath' is
    4637 +required, except when creating a convenience library.
    4638  
    4639 -If OUTPUT-FILE ends in \`.a', then a standard library is created using \`ar'
    4640 -and \`ranlib'.
    4641 +If OUTPUT-FILE ends in \`.a' or \`.lib', then a standard library is created
    4642 +using \`ar' and \`ranlib', or on Windows using \`lib'.
    4643  
    4644 -If OUTPUT-FILE ends in \`.lo' or \`.o', then a reloadable object file is
    4645 -created, otherwise an executable program is created."
    4646 +If OUTPUT-FILE ends in \`.lo' or \`.${objext}', then a reloadable object file
    4647 +is created, otherwise an executable program is created."
    4648    ;;
    4649  
    4650  uninstall)
    4651 -  $echo
    4652 +  $echo \
    4653  "Usage: $modename [OPTION]... --mode=uninstall RM [RM-OPTION]... FILE...
    4654  
    4655  Remove libraries from an installation directory.
  • Portfile

     
    33PortSystem      1.0
    44
    55name            jpeg
    6 version         6b
    7 revision        3
     6version         7
    87categories      graphics
    98maintainers     waqar
    109description     Library for manipulating JPEG images
     
    2726
    2827distname        ${name}src.v${version}
    2928worksrcdir      ${name}-${version}
    30 set jpegmain    ${distname}${extract.suffix}
    31 distfiles       ${jpegmain} \
    32                 droppatch.tar.gz:drop
    3329               
    34 checksums       ${jpegmain} md5 dbd5f3b47ed13132f04c685d608a7547 \
    35                 droppatch.tar.gz md5 511c39779ac96cd41ca1e0a87b239287
    36 extract.only    ${jpegmain}
     30checksums       md5     382ef33b339c299b56baf1296cda9785 \
     31                sha1    88cced0fc3dbdbc82115e1d08abce4e9d23a4b47 \
     32                rmd160  6049c5fee2682c0757d4b51740abd981d1b24487
    3733
    38 patchfiles      patch-config.sub patch-config.guess patch-ltmain.sh \
    39                 patch-ltconfig patch-makefile.cfg patch-jpeglib.h
    40 post-patch {
    41     system "cd ${worksrcpath} &&
    42         tar zxf ${distpath}/droppatch.tar.gz"
     34configure.ldflags-delete        -L${prefix}/lib
     35configure.cppflags-delete       -I${prefix}/include
    4336
    44     # Reorder link flags so that so that local -L options come first (especially before -L${prefix}/lib)
    45     #     (see http://trac.macports.org/ticket/16411).
    46     reinplace {s|\(.*\)\($(LDFLAGS)\)\(.*\)\($(LDLIBS)\)\(.*\)|\1\4\3\2\5|} ${worksrcpath}/makefile.cfg
    47 
    48     # As in the case of -L, CPPFLAGS come before -I. during compilation.
    49     configure.cppflags-append -isystem${prefix}/include
    50     configure.cppflags-delete -I${prefix}/include
    51 }
    52 
    53 configure.args      --enable-shared --enable-static
    54 
    5537use_parallel_build  yes
    5638
    57 destroot.destdir    prefix=${destroot}${prefix}
    58 pre-destroot {
    59     xinstall -d ${destroot}${prefix}/bin
    60     xinstall -d ${destroot}${prefix}/share/man/man1
    61     xinstall -d ${destroot}${prefix}/include
    62     xinstall -d ${destroot}${prefix}/lib
    63 }
    64 
    65 
    6639livecheck.check regex
    6740livecheck.url   [lindex $master_sites 0]/?M=D
    6841livecheck.regex [suffix ${name}src.v(.*?)]