/[pcre]/code/tags/pcre-4.3/ltmain.sh
ViewVC logotype

Diff of /code/tags/pcre-4.3/ltmain.sh

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

code/trunk/ltmain.sh revision 41 by nigel, Sat Feb 24 21:39:17 2007 UTC code/tags/pcre-4.3/ltmain.sh revision 70 by nigel, Sat Feb 24 21:40:20 2007 UTC
# Line 1  Line 1 
1  # ltmain.sh - Provide generalized library-building support services.  # ltmain.sh - Provide generalized library-building support services.
2  # NOTE: Changing this file will not affect anything until you rerun ltconfig.  # NOTE: Changing this file will not affect anything until you rerun configure.
3  #  #
4  # Copyright (C) 1996-1999 Free Software Foundation, Inc.  # Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001
5    # Free Software Foundation, Inc.
6  # Originally by Gordon Matzigkeit <gord@gnu.ai.mit.edu>, 1996  # Originally by Gordon Matzigkeit <gord@gnu.ai.mit.edu>, 1996
7  #  #
8  # This program is free software; you can redistribute it and/or modify  # This program is free software; you can redistribute it and/or modify
# Line 47  EOF Line 48  EOF
48    exit 0    exit 0
49  fi  fi
50    
51    # Modification by PH (18-Feb-2003) to ensure that ${SED} is always set
52    # (it is not set on my system).
53    
54    case "X${SED}" in
55      X) SED=sed ;;
56    esac
57    
58  # The name of this program.  # The name of this program.
59  progname=`$echo "$0" | sed 's%^.*/%%'`  progname=`$echo "$0" | ${SED} 's%^.*/%%'`
60  modename="$progname"  modename="$progname"
61    
62  # Constants.  # Constants.
63  PROGRAM=ltmain.sh  PROGRAM=ltmain.sh
64  PACKAGE=libtool  PACKAGE=libtool
65  VERSION=1.3.4  VERSION=1.4.3
66  TIMESTAMP=" (1.385.2.196 1999/12/07 21:47:57)"  TIMESTAMP=" (1.922.2.110 2002/10/23 01:39:54)"
67    
68  default_mode=  default_mode=
69  help="Try \`$progname --help' for more information."  help="Try \`$progname --help' for more information."
# Line 66  rm="rm -f" Line 74  rm="rm -f"
74    
75  # Sed substitution that helps us do robust quoting.  It backslashifies  # Sed substitution that helps us do robust quoting.  It backslashifies
76  # metacharacters that are still active within double-quoted strings.  # metacharacters that are still active within double-quoted strings.
77  Xsed='sed -e 1s/^X//'  Xsed="${SED}"' -e 1s/^X//'
78  sed_quote_subst='s/\([\\`\\"$\\\\]\)/\\\1/g'  sed_quote_subst='s/\([\\`\\"$\\\\]\)/\\\1/g'
79  SP2NL='tr \040 \012'  # test EBCDIC or ASCII
80  NL2SP='tr \015\012 \040\040'  case `echo A|od -x` in
81     *[Cc]1*) # EBCDIC based system
82      SP2NL="tr '\100' '\n'"
83      NL2SP="tr '\r\n' '\100\100'"
84      ;;
85     *) # Assume ASCII based system
86      SP2NL="tr '\040' '\012'"
87      NL2SP="tr '\015\012' '\040\040'"
88      ;;
89    esac
90    
91  # NLS nuisances.  # NLS nuisances.
92  # Only set LANG and LC_ALL to C if already set.  # Only set LANG and LC_ALL to C if already set.
# Line 83  if test "${LANG+set}" = set; then Line 100  if test "${LANG+set}" = set; then
100    save_LANG="$LANG"; LANG=C; export LANG    save_LANG="$LANG"; LANG=C; export LANG
101  fi  fi
102    
103  if test "$LTCONFIG_VERSION" != "$VERSION"; then  # Make sure IFS has a sensible default
104    echo "$modename: ltconfig version \`$LTCONFIG_VERSION' does not match $PROGRAM version \`$VERSION'" 1>&2  : ${IFS="       "}
   echo "Fatal configuration error.  See the $PACKAGE docs for more information." 1>&2  
   exit 1  
 fi  
105    
106  if test "$build_libtool_libs" != yes && test "$build_old_libs" != yes; then  if test "$build_libtool_libs" != yes && test "$build_old_libs" != yes; then
107    echo "$modename: not configured to build any kind of library" 1>&2    echo "$modename: not configured to build any kind of library" 1>&2
# Line 113  do Line 127  do
127    arg="$1"    arg="$1"
128    shift    shift
129    
130    case "$arg" in    case $arg in
131    -*=*) optarg=`$echo "X$arg" | $Xsed -e 's/[-_a-zA-Z0-9]*=//'` ;;    -*=*) optarg=`$echo "X$arg" | $Xsed -e 's/[-_a-zA-Z0-9]*=//'` ;;
132    *) optarg= ;;    *) optarg= ;;
133    esac    esac
134    
135    # If the previous option needs an argument, assign it.    # If the previous option needs an argument, assign it.
136    if test -n "$prev"; then    if test -n "$prev"; then
137      case "$prev" in      case $prev in
138      execute_dlfiles)      execute_dlfiles)
139        eval "$prev=\"\$$prev \$arg\""        execute_dlfiles="$execute_dlfiles $arg"
140        ;;        ;;
141      *)      *)
142        eval "$prev=\$arg"        eval "$prev=\$arg"
# Line 135  do Line 149  do
149    fi    fi
150    
151    # Have we seen a non-optional argument yet?    # Have we seen a non-optional argument yet?
152    case "$arg" in    case $arg in
153    --help)    --help)
154      show_help=yes      show_help=yes
155      ;;      ;;
# Line 146  do Line 160  do
160      ;;      ;;
161    
162    --config)    --config)
163      sed -e '1,/^### BEGIN LIBTOOL CONFIG/d' -e '/^### END LIBTOOL CONFIG/,$d' $0      ${SED} -e '1,/^# ### BEGIN LIBTOOL CONFIG/d' -e '/^# ### END LIBTOOL CONFIG/,$d' $0
164      exit 0      exit 0
165      ;;      ;;
166    
# Line 179  do Line 193  do
193    --mode) prevopt="--mode" prev=mode ;;    --mode) prevopt="--mode" prev=mode ;;
194    --mode=*) mode="$optarg" ;;    --mode=*) mode="$optarg" ;;
195    
196      --preserve-dup-deps) duplicate_deps="yes" ;;
197    
198    --quiet | --silent)    --quiet | --silent)
199      show=:      show=:
200      ;;      ;;
# Line 207  if test -n "$prevopt"; then Line 223  if test -n "$prevopt"; then
223    exit 1    exit 1
224  fi  fi
225    
226    # If this variable is set in any of the actions, the command in it
227    # will be execed at the end.  This prevents here-documents from being
228    # left over by shells.
229    exec_cmd=
230    
231  if test -z "$show_help"; then  if test -z "$show_help"; then
232    
233    # Infer the operation mode.    # Infer the operation mode.
234    if test -z "$mode"; then    if test -z "$mode"; then
235      case "$nonopt" in      case $nonopt in
236      *cc | *++ | gcc* | *-gcc*)      *cc | *++ | gcc* | *-gcc* | xlc*)
237        mode=link        mode=link
238        for arg        for arg
239        do        do
240          case "$arg" in          case $arg in
241          -c)          -c)
242             mode=compile             mode=compile
243             break             break
# Line 261  if test -z "$show_help"; then Line 282  if test -z "$show_help"; then
282    help="Try \`$modename --help --mode=$mode' for more information."    help="Try \`$modename --help --mode=$mode' for more information."
283    
284    # These modes are in order of execution frequency so that they run quickly.    # These modes are in order of execution frequency so that they run quickly.
285    case "$mode" in    case $mode in
286    # libtool compile mode    # libtool compile mode
287    compile)    compile)
288      modename="$modename: compile"      modename="$modename: compile"
289      # Get the compilation command and the source file.      # Get the compilation command and the source file.
290      base_compile=      base_compile=
291        prev=
292      lastarg=      lastarg=
293      srcfile="$nonopt"      srcfile="$nonopt"
294      suppress_output=      suppress_output=
# Line 274  if test -z "$show_help"; then Line 296  if test -z "$show_help"; then
296      user_target=no      user_target=no
297      for arg      for arg
298      do      do
299          case $prev in
300          "") ;;
301          xcompiler)
302            # Aesthetically quote the previous argument.
303            prev=
304            lastarg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`
305    
306            case $arg in
307            # Double-quote args containing other shell metacharacters.
308            # Many Bourne shells cannot handle close brackets correctly
309            # in scan sets, so we specify it separately.
310            *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \   ]*|*]*|"")
311              arg="\"$arg\""
312              ;;
313            esac
314    
315            # Add the previous argument to base_compile.
316            if test -z "$base_compile"; then
317              base_compile="$lastarg"
318            else
319              base_compile="$base_compile $lastarg"
320            fi
321            continue
322            ;;
323          esac
324    
325        # Accept any command-line options.        # Accept any command-line options.
326        case "$arg" in        case $arg in
327        -o)        -o)
328          if test "$user_target" != "no"; then          if test "$user_target" != "no"; then
329            $echo "$modename: you cannot specify \`-o' more than once" 1>&2            $echo "$modename: you cannot specify \`-o' more than once" 1>&2
# Line 288  if test -z "$show_help"; then Line 336  if test -z "$show_help"; then
336          build_old_libs=yes          build_old_libs=yes
337          continue          continue
338          ;;          ;;
339    
340          -prefer-pic)
341            pic_mode=yes
342            continue
343            ;;
344    
345          -prefer-non-pic)
346            pic_mode=no
347            continue
348            ;;
349    
350          -Xcompiler)
351            prev=xcompiler
352            continue
353            ;;
354    
355          -Wc,*)
356            args=`$echo "X$arg" | $Xsed -e "s/^-Wc,//"`
357            lastarg=
358            save_ifs="$IFS"; IFS=','
359            for arg in $args; do
360              IFS="$save_ifs"
361    
362              # Double-quote args containing other shell metacharacters.
363              # Many Bourne shells cannot handle close brackets correctly
364              # in scan sets, so we specify it separately.
365              case $arg in
366                *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \       ]*|*]*|"")
367                arg="\"$arg\""
368                ;;
369              esac
370              lastarg="$lastarg $arg"
371            done
372            IFS="$save_ifs"
373            lastarg=`$echo "X$lastarg" | $Xsed -e "s/^ //"`
374    
375            # Add the arguments to base_compile.
376            if test -z "$base_compile"; then
377              base_compile="$lastarg"
378            else
379              base_compile="$base_compile $lastarg"
380            fi
381            continue
382            ;;
383        esac        esac
384    
385        case "$user_target" in        case $user_target in
386        next)        next)
387          # The next one is the -o target name          # The next one is the -o target name
388          user_target=yes          user_target=yes
# Line 316  if test -z "$show_help"; then Line 408  if test -z "$show_help"; then
408        lastarg=`$echo "X$lastarg" | $Xsed -e "$sed_quote_subst"`        lastarg=`$echo "X$lastarg" | $Xsed -e "$sed_quote_subst"`
409    
410        # Double-quote args containing other shell metacharacters.        # Double-quote args containing other shell metacharacters.
411        # Many Bourne shells cannot handle close brackets correctly in scan        # Many Bourne shells cannot handle close brackets correctly
412        # sets, so we specify it separately.        # in scan sets, so we specify it separately.
413        case "$lastarg" in        case $lastarg in
414        *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \     ]*|*]*)        *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \     ]*|*]*|"")
415          lastarg="\"$lastarg\""          lastarg="\"$lastarg\""
416          ;;          ;;
417        esac        esac
# Line 332  if test -z "$show_help"; then Line 424  if test -z "$show_help"; then
424        fi        fi
425      done      done
426    
427      case "$user_target" in      case $user_target in
428      set)      set)
429        ;;        ;;
430      no)      no)
# Line 348  if test -z "$show_help"; then Line 440  if test -z "$show_help"; then
440      # Recognize several different file suffixes.      # Recognize several different file suffixes.
441      # If the user specifies -o file.o, it is replaced with file.lo      # If the user specifies -o file.o, it is replaced with file.lo
442      xform='[cCFSfmso]'      xform='[cCFSfmso]'
443      case "$libobj" in      case $libobj in
444      *.ada) xform=ada ;;      *.ada) xform=ada ;;
445      *.adb) xform=adb ;;      *.adb) xform=adb ;;
446      *.ads) xform=ads ;;      *.ads) xform=ads ;;
# Line 363  if test -z "$show_help"; then Line 455  if test -z "$show_help"; then
455    
456      libobj=`$echo "X$libobj" | $Xsed -e "s/\.$xform$/.lo/"`      libobj=`$echo "X$libobj" | $Xsed -e "s/\.$xform$/.lo/"`
457    
458      case "$libobj" in      case $libobj in
459      *.lo) obj=`$echo "X$libobj" | $Xsed -e "$lo2o"` ;;      *.lo) obj=`$echo "X$libobj" | $Xsed -e "$lo2o"` ;;
460      *)      *)
461        $echo "$modename: cannot determine name of library object from \`$libobj'" 1>&2        $echo "$modename: cannot determine name of library object from \`$libobj'" 1>&2
# Line 387  if test -z "$show_help"; then Line 479  if test -z "$show_help"; then
479      $run $rm $removelist      $run $rm $removelist
480      trap "$run $rm $removelist; exit 1" 1 2 15      trap "$run $rm $removelist; exit 1" 1 2 15
481    
482        # On Cygwin there's no "real" PIC flag so we must build both object types
483        case $host_os in
484        cygwin* | mingw* | pw32* | os2*)
485          pic_mode=default
486          ;;
487        esac
488        if test "$pic_mode" = no && test "$deplibs_check_method" != pass_all; then
489          # non-PIC code in shared libraries is not supported
490          pic_mode=default
491        fi
492    
493      # Calculate the filename of the output object if compiler does      # Calculate the filename of the output object if compiler does
494      # not support -o with -c      # not support -o with -c
495      if test "$compiler_c_o" = no; then      if test "$compiler_c_o" = no; then
496        output_obj=`$echo "X$srcfile" | $Xsed -e 's%^.*/%%' -e 's%\..*$%%'`.${objext}        output_obj=`$echo "X$srcfile" | $Xsed -e 's%^.*/%%' -e 's%\.[^.]*$%%'`.${objext}
497        lockfile="$output_obj.lock"        lockfile="$output_obj.lock"
498        removelist="$removelist $output_obj $lockfile"        removelist="$removelist $output_obj $lockfile"
499        trap "$run $rm $removelist; exit 1" 1 2 15        trap "$run $rm $removelist; exit 1" 1 2 15
# Line 402  if test -z "$show_help"; then Line 505  if test -z "$show_help"; then
505      # Lock this critical section if it is needed      # Lock this critical section if it is needed
506      # We use this script file to make the link, it avoids creating a new file      # We use this script file to make the link, it avoids creating a new file
507      if test "$need_locks" = yes; then      if test "$need_locks" = yes; then
508        until ln "$0" "$lockfile" 2>/dev/null; do        until $run ln "$0" "$lockfile" 2>/dev/null; do
509          $show "Waiting for $lockfile to be removed"          $show "Waiting for $lockfile to be removed"
510          sleep 2          sleep 2
511        done        done
# Line 434  compiler." Line 537  compiler."
537        # Without this assignment, base_compile gets emptied.        # Without this assignment, base_compile gets emptied.
538        fbsd_hideous_sh_bug=$base_compile        fbsd_hideous_sh_bug=$base_compile
539    
540        # All platforms use -DPIC, to notify preprocessed assembler code.        if test "$pic_mode" != no; then
541        command="$base_compile $srcfile $pic_flag -DPIC"          # All platforms use -DPIC, to notify preprocessed assembler code.
542            command="$base_compile $srcfile $pic_flag -DPIC"
543          else
544            # Don't build PIC code
545            command="$base_compile $srcfile"
546          fi
547        if test "$build_old_libs" = yes; then        if test "$build_old_libs" = yes; then
548          lo_libobj="$libobj"          lo_libobj="$libobj"
549          dir=`$echo "X$libobj" | $Xsed -e 's%/[^/]*$%%'`          dir=`$echo "X$libobj" | $Xsed -e 's%/[^/]*$%%'`
# Line 506  compiler." Line 614  compiler."
614        fi        fi
615    
616        # If we have no pic_flag, then copy the object into place and finish.        # If we have no pic_flag, then copy the object into place and finish.
617        if test -z "$pic_flag" && test "$build_old_libs" = yes; then        if (test -z "$pic_flag" || test "$pic_mode" != default) &&
618             test "$build_old_libs" = yes; then
619          # Rename the .lo from within objdir to obj          # Rename the .lo from within objdir to obj
620          if test -f $obj; then          if test -f $obj; then
621            $show $rm $obj            $show $rm $obj
# Line 532  compiler." Line 641  compiler."
641          # Now arrange that obj and lo_libobj become the same file          # Now arrange that obj and lo_libobj become the same file
642          $show "(cd $xdir && $LN_S $baseobj $libobj)"          $show "(cd $xdir && $LN_S $baseobj $libobj)"
643          if $run eval '(cd $xdir && $LN_S $baseobj $libobj)'; then          if $run eval '(cd $xdir && $LN_S $baseobj $libobj)'; then
644              # Unlock the critical section if it was locked
645              if test "$need_locks" != no; then
646                $run $rm "$lockfile"
647              fi
648            exit 0            exit 0
649          else          else
650            error=$?            error=$?
# Line 546  compiler." Line 659  compiler."
659    
660      # Only build a position-dependent object if we build old libraries.      # Only build a position-dependent object if we build old libraries.
661      if test "$build_old_libs" = yes; then      if test "$build_old_libs" = yes; then
662        command="$base_compile $srcfile"        if test "$pic_mode" != yes; then
663            # Don't build PIC code
664            command="$base_compile $srcfile"
665          else
666            # All platforms use -DPIC, to notify preprocessed assembler code.
667            command="$base_compile $srcfile $pic_flag -DPIC"
668          fi
669        if test "$compiler_c_o" = yes; then        if test "$compiler_c_o" = yes; then
670          command="$command -o $obj"          command="$command -o $obj"
671          output_obj="$obj"          output_obj="$obj"
# Line 612  compiler." Line 731  compiler."
731    
732      # Unlock the critical section if it was locked      # Unlock the critical section if it was locked
733      if test "$need_locks" != no; then      if test "$need_locks" != no; then
734        $rm "$lockfile"        $run $rm "$lockfile"
735      fi      fi
736    
737      exit 0      exit 0
738      ;;      ;;
739    
740    # libtool link mode    # libtool link mode
741    link)    link | relink)
742      modename="$modename: link"      modename="$modename: link"
743      case "$host" in      case $host in
744      *-*-cygwin* | *-*-mingw* | *-*-os2*)      *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2*)
745        # It is impossible to link a dll without this setting, and        # It is impossible to link a dll without this setting, and
746        # we shouldn't force the makefile maintainer to figure out        # we shouldn't force the makefile maintainer to figure out
747        # which system we are compiling for in order to pass an extra        # which system we are compiling for in order to pass an extra
# Line 635  compiler." Line 754  compiler."
754        # -no-undefined on the libtool link line when we can be certain        # -no-undefined on the libtool link line when we can be certain
755        # that all symbols are satisfied, otherwise we get a static library.        # that all symbols are satisfied, otherwise we get a static library.
756        allow_undefined=yes        allow_undefined=yes
   
       # This is a source program that is used to create dlls on Windows  
       # Don't remove nor modify the starting and closing comments  
 # /* ltdll.c starts here */  
 # #define WIN32_LEAN_AND_MEAN  
 # #include <windows.h>  
 # #undef WIN32_LEAN_AND_MEAN  
 # #include <stdio.h>  
 #  
 # #ifndef __CYGWIN__  
 # #  ifdef __CYGWIN32__  
 # #    define __CYGWIN__ __CYGWIN32__  
 # #  endif  
 # #endif  
 #  
 # #ifdef __cplusplus  
 # extern "C" {  
 # #endif  
 # BOOL APIENTRY DllMain (HINSTANCE hInst, DWORD reason, LPVOID reserved);  
 # #ifdef __cplusplus  
 # }  
 # #endif  
 #  
 # #ifdef __CYGWIN__  
 # #include <cygwin/cygwin_dll.h>  
 # DECLARE_CYGWIN_DLL( DllMain );  
 # #endif  
 # HINSTANCE __hDllInstance_base;  
 #  
 # BOOL APIENTRY  
 # DllMain (HINSTANCE hInst, DWORD reason, LPVOID reserved)  
 # {  
 #   __hDllInstance_base = hInst;  
 #   return TRUE;  
 # }  
 # /* ltdll.c ends here */  
       # This is a source program that is used to create import libraries  
       # on Windows for dlls which lack them. Don't remove nor modify the  
       # starting and closing comments  
 # /* impgen.c starts here */  
 # /*   Copyright (C) 1999 Free Software Foundation, Inc.  
 #  
 #  This file is part of GNU libtool.  
 #  
 #  This program is free software; you can redistribute it and/or modify  
 #  it under the terms of the GNU General Public License as published by  
 #  the Free Software Foundation; either version 2 of the License, or  
 #  (at your option) any later version.  
 #  
 #  This program is distributed in the hope that it will be useful,  
 #  but WITHOUT ANY WARRANTY; without even the implied warranty of  
 #  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the  
 #  GNU General Public License for more details.  
 #  
 #  You should have received a copy of the GNU General Public License  
 #  along with this program; if not, write to the Free Software  
 #  Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  
 #  */  
 #  
 #  #include <stdio.h>           /* for printf() */  
 #  #include <unistd.h>          /* for open(), lseek(), read() */  
 #  #include <fcntl.h>           /* for O_RDONLY, O_BINARY */  
 #  #include <string.h>          /* for strdup() */  
 #  
 #  static unsigned int  
 #  pe_get16 (fd, offset)  
 #       int fd;  
 #       int offset;  
 #  {  
 #    unsigned char b[2];  
 #    lseek (fd, offset, SEEK_SET);  
 #    read (fd, b, 2);  
 #    return b[0] + (b[1]<<8);  
 #  }  
 #  
 #  static unsigned int  
 #  pe_get32 (fd, offset)  
 #      int fd;  
 #      int offset;  
 #  {  
 #    unsigned char b[4];  
 #    lseek (fd, offset, SEEK_SET);  
 #    read (fd, b, 4);  
 #    return b[0] + (b[1]<<8) + (b[2]<<16) + (b[3]<<24);  
 #  }  
 #  
 #  static unsigned int  
 #  pe_as32 (ptr)  
 #       void *ptr;  
 #  {  
 #    unsigned char *b = ptr;  
 #    return b[0] + (b[1]<<8) + (b[2]<<16) + (b[3]<<24);  
 #  }  
 #  
 #  int  
 #  main (argc, argv)  
 #      int argc;  
 #      char *argv[];  
 #  {  
 #      int dll;  
 #      unsigned long pe_header_offset, opthdr_ofs, num_entries, i;  
 #      unsigned long export_rva, export_size, nsections, secptr, expptr;  
 #      unsigned long name_rvas, nexp;  
 #      unsigned char *expdata, *erva;  
 #      char *filename, *dll_name;  
 #  
 #      filename = argv[1];  
 #  
 #      dll = open(filename, O_RDONLY|O_BINARY);  
 #      if (!dll)  
 #       return 1;  
 #  
 #      dll_name = filename;  
 #  
 #      for (i=0; filename[i]; i++)  
 #       if (filename[i] == '/' || filename[i] == '\\'  || filename[i] == ':')  
 #           dll_name = filename + i +1;  
 #  
 #      pe_header_offset = pe_get32 (dll, 0x3c);  
 #      opthdr_ofs = pe_header_offset + 4 + 20;  
 #      num_entries = pe_get32 (dll, opthdr_ofs + 92);  
 #  
 #      if (num_entries < 1) /* no exports */  
 #       return 1;  
 #  
 #      export_rva = pe_get32 (dll, opthdr_ofs + 96);  
 #      export_size = pe_get32 (dll, opthdr_ofs + 100);  
 #      nsections = pe_get16 (dll, pe_header_offset + 4 +2);  
 #      secptr = (pe_header_offset + 4 + 20 +  
 #             pe_get16 (dll, pe_header_offset + 4 + 16));  
 #  
 #      expptr = 0;  
 #      for (i = 0; i < nsections; i++)  
 #      {  
 #       char sname[8];  
 #       unsigned long secptr1 = secptr + 40 * i;  
 #       unsigned long vaddr = pe_get32 (dll, secptr1 + 12);  
 #       unsigned long vsize = pe_get32 (dll, secptr1 + 16);  
 #       unsigned long fptr = pe_get32 (dll, secptr1 + 20);  
 #       lseek(dll, secptr1, SEEK_SET);  
 #       read(dll, sname, 8);  
 #       if (vaddr <= export_rva && vaddr+vsize > export_rva)  
 #       {  
 #           expptr = fptr + (export_rva - vaddr);  
 #           if (export_rva + export_size > vaddr + vsize)  
 #               export_size = vsize - (export_rva - vaddr);  
 #           break;  
 #       }  
 #      }  
 #  
 #      expdata = (unsigned char*)malloc(export_size);  
 #      lseek (dll, expptr, SEEK_SET);  
 #      read (dll, expdata, export_size);  
 #      erva = expdata - export_rva;  
 #  
 #      nexp = pe_as32 (expdata+24);  
 #      name_rvas = pe_as32 (expdata+32);  
 #  
 #      printf ("EXPORTS\n");  
 #      for (i = 0; i<nexp; i++)  
 #      {  
 #       unsigned long name_rva = pe_as32 (erva+name_rvas+i*4);  
 #       printf ("\t%s @ %ld ;\n", erva+name_rva, 1+ i);  
 #      }  
 #  
 #      return 0;  
 #  }  
 # /* impgen.c ends here */  
757        ;;        ;;
758      *)      *)
759        allow_undefined=yes        allow_undefined=yes
760        ;;        ;;
761      esac      esac
762        libtool_args="$nonopt"
763      compile_command="$nonopt"      compile_command="$nonopt"
764      finalize_command="$nonopt"      finalize_command="$nonopt"
765    
# Line 818  compiler." Line 770  compiler."
770      convenience=      convenience=
771      old_convenience=      old_convenience=
772      deplibs=      deplibs=
773      linkopts=      old_deplibs=
774        compiler_flags=
775        linker_flags=
776        dllsearchpath=
777        lib_search_path=`pwd`
778    
     if test -n "$shlibpath_var"; then  
       # get the directories listed in $shlibpath_var  
       eval lib_search_path=\`\$echo \"X \${$shlibpath_var}\" \| \$Xsed -e \'s/:/ /g\'\`  
     else  
       lib_search_path=  
     fi  
     # now prepend the system-specific ones  
     eval lib_search_path=\"$sys_lib_search_path_spec\$lib_search_path\"  
     eval sys_lib_dlsearch_path=\"$sys_lib_dlsearch_path_spec\"  
   
779      avoid_version=no      avoid_version=no
780      dlfiles=      dlfiles=
781      dlprefiles=      dlprefiles=
# Line 839  compiler." Line 785  compiler."
785      export_symbols_regex=      export_symbols_regex=
786      generated=      generated=
787      libobjs=      libobjs=
     link_against_libtool_libs=  
788      ltlibs=      ltlibs=
789      module=no      module=no
790        no_install=no
791      objs=      objs=
792      prefer_static_libs=no      prefer_static_libs=no
793      preload=no      preload=no
# Line 858  compiler." Line 804  compiler."
804      # We need to know -static, to get the right output filenames.      # We need to know -static, to get the right output filenames.
805      for arg      for arg
806      do      do
807        case "$arg" in        case $arg in
808        -all-static | -static)        -all-static | -static)
809          if test "X$arg" = "X-all-static"; then          if test "X$arg" = "X-all-static"; then
810            if test "$build_libtool_libs" = yes && test -z "$link_static_flag"; then            if test "$build_libtool_libs" = yes && test -z "$link_static_flag"; then
# Line 887  compiler." Line 833  compiler."
833      while test $# -gt 0; do      while test $# -gt 0; do
834        arg="$1"        arg="$1"
835        shift        shift
836          case $arg in
837          *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \     ]*|*]*|"")
838            qarg=\"`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`\" ### testsuite: skip nested quoting test
839            ;;
840          *) qarg=$arg ;;
841          esac
842          libtool_args="$libtool_args $qarg"
843    
844        # If the previous option needs an argument, assign it.        # If the previous option needs an argument, assign it.
845        if test -n "$prev"; then        if test -n "$prev"; then
846          case "$prev" in          case $prev in
847          output)          output)
848            compile_command="$compile_command @OUTPUT@"            compile_command="$compile_command @OUTPUT@"
849            finalize_command="$finalize_command @OUTPUT@"            finalize_command="$finalize_command @OUTPUT@"
850            ;;            ;;
851          esac          esac
852    
853          case "$prev" in          case $prev in
854          dlfiles|dlprefiles)          dlfiles|dlprefiles)
855            if test "$preload" = no; then            if test "$preload" = no; then
856              # Add the symbol object into the linking commands.              # Add the symbol object into the linking commands.
# Line 905  compiler." Line 858  compiler."
858              finalize_command="$finalize_command @SYMFILE@"              finalize_command="$finalize_command @SYMFILE@"
859              preload=yes              preload=yes
860            fi            fi
861            case "$arg" in            case $arg in
862            *.la | *.lo) ;;  # We handle these cases below.            *.la | *.lo) ;;  # We handle these cases below.
863            force)            force)
864              if test "$dlself" = no; then              if test "$dlself" = no; then
# Line 934  compiler." Line 887  compiler."
887                dlprefiles="$dlprefiles $arg"                dlprefiles="$dlprefiles $arg"
888              fi              fi
889              prev=              prev=
890                continue
891              ;;              ;;
892            esac            esac
893            ;;            ;;
# Line 958  compiler." Line 912  compiler."
912            ;;            ;;
913          rpath | xrpath)          rpath | xrpath)
914            # We need an absolute path.            # We need an absolute path.
915            case "$arg" in            case $arg in
916            [\\/]* | [A-Za-z]:[\\/]*) ;;            [\\/]* | [A-Za-z]:[\\/]*) ;;
917            *)            *)
918              $echo "$modename: only absolute run-paths are allowed" 1>&2              $echo "$modename: only absolute run-paths are allowed" 1>&2
# Line 979  compiler." Line 933  compiler."
933            prev=            prev=
934            continue            continue
935            ;;            ;;
936            xcompiler)
937              compiler_flags="$compiler_flags $qarg"
938              prev=
939              compile_command="$compile_command $qarg"
940              finalize_command="$finalize_command $qarg"
941              continue
942              ;;
943            xlinker)
944              linker_flags="$linker_flags $qarg"
945              compiler_flags="$compiler_flags $wl$qarg"
946              prev=
947              compile_command="$compile_command $wl$qarg"
948              finalize_command="$finalize_command $wl$qarg"
949              continue
950              ;;
951          *)          *)
952            eval "$prev=\"\$arg\""            eval "$prev=\"\$arg\""
953            prev=            prev=
954            continue            continue
955            ;;            ;;
956          esac          esac
957        fi        fi # test -n $prev
958    
959        prevarg="$arg"        prevarg="$arg"
960    
961        case "$arg" in        case $arg in
962        -all-static)        -all-static)
963          if test -n "$link_static_flag"; then          if test -n "$link_static_flag"; then
964            compile_command="$compile_command $link_static_flag"            compile_command="$compile_command $link_static_flag"
# Line 1026  compiler." Line 995  compiler."
995    
996        -export-symbols | -export-symbols-regex)        -export-symbols | -export-symbols-regex)
997          if test -n "$export_symbols" || test -n "$export_symbols_regex"; then          if test -n "$export_symbols" || test -n "$export_symbols_regex"; then
998            $echo "$modename: not more than one -exported-symbols argument allowed"            $echo "$modename: more than one -exported-symbols argument is not allowed"
999            exit 1            exit 1
1000          fi          fi
1001          if test "X$arg" = "X-export-symbols"; then          if test "X$arg" = "X-export-symbols"; then
# Line 1037  compiler." Line 1006  compiler."
1006          continue          continue
1007          ;;          ;;
1008    
1009          # The native IRIX linker understands -LANG:*, -LIST:* and -LNO:*
1010          # so, if we see these flags be careful not to treat them like -L
1011          -L[A-Z][A-Z]*:*)
1012            case $with_gcc/$host in
1013            no/*-*-irix* | no/*-*-nonstopux*)
1014              compile_command="$compile_command $arg"
1015              finalize_command="$finalize_command $arg"
1016              ;;
1017            esac
1018            continue
1019            ;;
1020    
1021        -L*)        -L*)
1022          dir=`$echo "X$arg" | $Xsed -e 's/^-L//'`          dir=`$echo "X$arg" | $Xsed -e 's/^-L//'`
1023          # We need an absolute path.          # We need an absolute path.
1024          case "$dir" in          case $dir in
1025          [\\/]* | [A-Za-z]:[\\/]*) ;;          [\\/]* | [A-Za-z]:[\\/]*) ;;
1026          *)          *)
1027            absdir=`cd "$dir" && pwd`            absdir=`cd "$dir" && pwd`
1028            if test -z "$absdir"; then            if test -z "$absdir"; then
1029              $echo "$modename: warning: cannot determine absolute directory name of \`$dir'" 1>&2              $echo "$modename: cannot determine absolute directory name of \`$dir'" 1>&2
1030              $echo "$modename: passing it literally to the linker, although it might fail" 1>&2              exit 1
             absdir="$dir"  
1031            fi            fi
1032            dir="$absdir"            dir="$absdir"
1033            ;;            ;;
1034          esac          esac
1035          case " $deplibs " in          case "$deplibs " in
1036          *" $arg "*) ;;          *" -L$dir "*) ;;
1037          *) deplibs="$deplibs $arg";;          *)
1038          esac            deplibs="$deplibs -L$dir"
1039          case " $lib_search_path " in            lib_search_path="$lib_search_path $dir"
1040          *" $dir "*) ;;            ;;
         *) lib_search_path="$lib_search_path $dir";;  
1041          esac          esac
1042          case "$host" in          case $host in
1043          *-*-cygwin* | *-*-mingw* | *-*-os2*)          *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2*)
1044            dllsearchdir=`cd "$dir" && pwd || echo "$dir"`            case :$dllsearchpath: in
1045            case ":$dllsearchpath:" in            *":$dir:"*) ;;
1046            ::) dllsearchpath="$dllsearchdir";;            *) dllsearchpath="$dllsearchpath:$dir";;
           *":$dllsearchdir:"*) ;;  
           *) dllsearchpath="$dllsearchpath:$dllsearchdir";;  
1047            esac            esac
1048            ;;            ;;
1049          esac          esac
1050            continue
1051          ;;          ;;
1052    
1053        -l*)        -l*)
1054          if test "$arg" = "-lc"; then          if test "X$arg" = "X-lc" || test "X$arg" = "X-lm"; then
1055            case "$host" in            case $host in
1056            *-*-cygwin* | *-*-mingw* | *-*-os2* | *-*-beos*)            *-*-cygwin* | *-*-pw32* | *-*-beos*)
1057              # These systems don't actually have c library (as such)              # These systems don't actually have a C or math library (as such)
1058              continue              continue
1059              ;;              ;;
1060              *-*-mingw* | *-*-os2*)
1061                # These systems don't actually have a C library (as such)
1062                test "X$arg" = "X-lc" && continue
1063                ;;
1064              *-*-openbsd* | *-*-freebsd*)
1065                # Do not include libc due to us having libc/libc_r.
1066                test "X$arg" = "X-lc" && continue
1067                ;;
1068            esac            esac
1069          elif test "$arg" = "-lm"; then           elif test "X$arg" = "X-lc_r"; then
1070            case "$host" in            case $host in
1071            *-*-cygwin* | *-*-beos*)           *-*-openbsd* | *-*-freebsd*)
1072              # These systems don't actually have math library (as such)              # Do not include libc_r directly, use -pthread flag.
1073              continue              continue
1074              ;;              ;;
1075            esac            esac
1076          fi          fi
1077          deplibs="$deplibs $arg"          deplibs="$deplibs $arg"
1078            continue
1079          ;;          ;;
1080    
1081        -module)        -module)
# Line 1096  compiler." Line 1083  compiler."
1083          continue          continue
1084          ;;          ;;
1085    
1086          -no-fast-install)
1087            fast_install=no
1088            continue
1089            ;;
1090    
1091          -no-install)
1092            case $host in
1093            *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2*)
1094              # The PATH hackery in wrapper scripts is required on Windows
1095              # in order for the loader to find any dlls it needs.
1096              $echo "$modename: warning: \`-no-install' is ignored for $host" 1>&2
1097              $echo "$modename: warning: assuming \`-no-fast-install' instead" 1>&2
1098              fast_install=no
1099              ;;
1100            *) no_install=yes ;;
1101            esac
1102            continue
1103            ;;
1104    
1105        -no-undefined)        -no-undefined)
1106          allow_undefined=no          allow_undefined=no
1107          continue          continue
# Line 1121  compiler." Line 1127  compiler."
1127        -R*)        -R*)
1128          dir=`$echo "X$arg" | $Xsed -e 's/^-R//'`          dir=`$echo "X$arg" | $Xsed -e 's/^-R//'`
1129          # We need an absolute path.          # We need an absolute path.
1130          case "$dir" in          case $dir in
1131          [\\/]* | [A-Za-z]:[\\/]*) ;;          [\\/]* | [A-Za-z]:[\\/]*) ;;
1132          *)          *)
1133            $echo "$modename: only absolute run-paths are allowed" 1>&2            $echo "$modename: only absolute run-paths are allowed" 1>&2
# Line 1136  compiler." Line 1142  compiler."
1142          ;;          ;;
1143    
1144        -static)        -static)
1145          # If we have no pic_flag, then this is the same as -all-static.          # The effects of -static are defined in a previous loop.
1146          if test -z "$pic_flag" && test -n "$link_static_flag"; then          # We used to do the same as -all-static on platforms that
1147            compile_command="$compile_command $link_static_flag"          # didn't have a PIC flag, but the assumption that the effects
1148            finalize_command="$finalize_command $link_static_flag"          # would be equivalent was wrong.  It would break on at least
1149          fi          # Digital Unix and AIX.
1150          continue          continue
1151          ;;          ;;
1152    
# Line 1154  compiler." Line 1160  compiler."
1160          continue          continue
1161          ;;          ;;
1162    
1163          -Wc,*)
1164            args=`$echo "X$arg" | $Xsed -e "$sed_quote_subst" -e 's/^-Wc,//'`
1165            arg=
1166            save_ifs="$IFS"; IFS=','
1167            for flag in $args; do
1168              IFS="$save_ifs"
1169              case $flag in
1170                *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \       ]*|*]*|"")
1171                flag="\"$flag\""
1172                ;;
1173              esac
1174              arg="$arg $wl$flag"
1175              compiler_flags="$compiler_flags $flag"
1176            done
1177            IFS="$save_ifs"
1178            arg=`$echo "X$arg" | $Xsed -e "s/^ //"`
1179            ;;
1180    
1181          -Wl,*)
1182            args=`$echo "X$arg" | $Xsed -e "$sed_quote_subst" -e 's/^-Wl,//'`
1183            arg=
1184            save_ifs="$IFS"; IFS=','
1185            for flag in $args; do
1186              IFS="$save_ifs"
1187              case $flag in
1188                *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \       ]*|*]*|"")
1189                flag="\"$flag\""
1190                ;;
1191              esac
1192              arg="$arg $wl$flag"
1193              compiler_flags="$compiler_flags $wl$flag"
1194              linker_flags="$linker_flags $flag"
1195            done
1196            IFS="$save_ifs"
1197            arg=`$echo "X$arg" | $Xsed -e "s/^ //"`
1198            ;;
1199    
1200          -Xcompiler)
1201            prev=xcompiler
1202            continue
1203            ;;
1204    
1205          -Xlinker)
1206            prev=xlinker
1207            continue
1208            ;;
1209    
1210        # Some other compiler flag.        # Some other compiler flag.
1211        -* | +*)        -* | +*)
1212          # Unknown arguments in both finalize_command and compile_command need          # Unknown arguments in both finalize_command and compile_command need
1213          # to be aesthetically quoted because they are evaled later.          # to be aesthetically quoted because they are evaled later.
1214          arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`          arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`
1215          case "$arg" in          case $arg in
1216          *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \   ]*|*]*)          *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \   ]*|*]*|"")
1217            arg="\"$arg\""            arg="\"$arg\""
1218            ;;            ;;
1219          esac          esac
1220          ;;          ;;
1221    
1222        *.o | *.obj | *.a | *.lib)        *.lo | *.$objext)
1223          # A standard object.          # A library or standard object.
         objs="$objs $arg"  
         ;;  
   
       *.lo)  
         # A library object.  
1224          if test "$prev" = dlfiles; then          if test "$prev" = dlfiles; then
1225            dlfiles="$dlfiles $arg"            # This file was specified with -dlopen.
1226            if test "$build_libtool_libs" = yes && test "$dlopen" = yes; then            if test "$build_libtool_libs" = yes && test "$dlopen_support" = yes; then
1227                dlfiles="$dlfiles $arg"
1228              prev=              prev=
1229              continue              continue
1230            else            else
# Line 1188  compiler." Line 1237  compiler."
1237            # Preload the old-style object.            # Preload the old-style object.
1238            dlprefiles="$dlprefiles "`$echo "X$arg" | $Xsed -e "$lo2o"`            dlprefiles="$dlprefiles "`$echo "X$arg" | $Xsed -e "$lo2o"`
1239            prev=            prev=
1240            else
1241              case $arg in
1242              *.lo) libobjs="$libobjs $arg" ;;
1243              *) objs="$objs $arg" ;;
1244              esac
1245          fi          fi
1246          libobjs="$libobjs $arg"          ;;
1247    
1248          *.$libext)
1249            # An archive.
1250            deplibs="$deplibs $arg"
1251            old_deplibs="$old_deplibs $arg"
1252            continue
1253          ;;          ;;
1254    
1255        *.la)        *.la)
1256          # A libtool-controlled library.          # A libtool-controlled library.
1257    
1258          dlname=          if test "$prev" = dlfiles; then
1259          libdir=            # This library was specified with -dlopen.
1260          library_names=            dlfiles="$dlfiles $arg"
1261          old_library=            prev=
1262            elif test "$prev" = dlprefiles; then
1263          # Check to see that this really is a libtool archive.            # The library was specified with -dlpreopen.
1264          if (sed -e '2q' $arg | egrep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then :            dlprefiles="$dlprefiles $arg"
1265              prev=
1266          else          else
1267            $echo "$modename: \`$arg' is not a valid libtool archive" 1>&2            deplibs="$deplibs $arg"
           exit 1  
1268          fi          fi
1269            continue
1270            ;;
1271    
1272          # If the library was installed with an old release of libtool,        # Some other compiler argument.
1273          # it will not redefine variable installed.        *)
1274          installed=yes          # Unknown arguments in both finalize_command and compile_command need
1275            # to be aesthetically quoted because they are evaled later.
1276          # Read the .la file          arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`
1277          # If there is no directory component, then add one.          case $arg in
1278          case "$arg" in          *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \   ]*|*]*|"")
1279          */* | *\\*) . $arg ;;            arg="\"$arg\""
1280          *) . ./$arg ;;            ;;
1281          esac          esac
1282            ;;
1283          esac # arg
1284    
1285          # Get the name of the library we link against.        # Now actually substitute the argument into the commands.
1286          linklib=        if test -n "$arg"; then
1287          for l in $old_library $library_names; do          compile_command="$compile_command $arg"
1288            linklib="$l"          finalize_command="$finalize_command $arg"
1289          done        fi
1290        done # argument parsing loop
         if test -z "$linklib"; then  
           $echo "$modename: cannot find name of link library for \`$arg'" 1>&2  
           exit 1  
         fi  
   
         # Find the relevant object directory and library name.  
         name=`$echo "X$arg" | $Xsed -e 's%^.*/%%' -e 's/\.la$//' -e 's/^lib//'`  
   
         if test "X$installed" = Xyes; then  
           dir="$libdir"  
         else  
           dir=`$echo "X$arg" | $Xsed -e 's%/[^/]*$%%'`  
           if test "X$dir" = "X$arg"; then  
             dir="$objdir"  
           else  
             dir="$dir/$objdir"  
           fi  
         fi  
1291    
1292          if test -n "$dependency_libs"; then      if test -n "$prev"; then
1293            # Extract -R and -L from dependency_libs        $echo "$modename: the \`$prevarg' option requires an argument" 1>&2
1294            temp_deplibs=        $echo "$help" 1>&2
1295            for deplib in $dependency_libs; do        exit 1
1296              case "$deplib" in      fi
             -R*) temp_xrpath=`$echo "X$deplib" | $Xsed -e 's/^-R//'`  
                  case " $rpath $xrpath " in  
                  *" $temp_xrpath "*) ;;  
                  *) xrpath="$xrpath $temp_xrpath";;  
                  esac;;  
             -L*) case "$compile_command $temp_deplibs " in  
                  *" $deplib "*) ;;  
                  *) temp_deplibs="$temp_deplibs $deplib";;  
                  esac  
                  temp_dir=`$echo "X$deplib" | $Xsed -e 's/^-L//'`  
                  case " $lib_search_path " in  
                  *" $temp_dir "*) ;;  
                  *) lib_search_path="$lib_search_path $temp_dir";;  
                  esac  
                  ;;  
             *) temp_deplibs="$temp_deplibs $deplib";;  
             esac  
           done  
           dependency_libs="$temp_deplibs"  
         fi  
1297    
1298          if test -z "$libdir"; then      if test "$export_dynamic" = yes && test -n "$export_dynamic_flag_spec"; then
1299            # It is a libtool convenience library, so add in its objects.        eval arg=\"$export_dynamic_flag_spec\"
1300            convenience="$convenience $dir/$old_library"        compile_command="$compile_command $arg"
1301            old_convenience="$old_convenience $dir/$old_library"        finalize_command="$finalize_command $arg"
1302            deplibs="$deplibs$dependency_libs"      fi
           compile_command="$compile_command $dir/$old_library$dependency_libs"  
           finalize_command="$finalize_command $dir/$old_library$dependency_libs"  
           continue  
         fi  
1303    
1304          # This library was specified with -dlopen.      # calculate the name of the file, without its directory
1305          if test "$prev" = dlfiles; then      outputname=`$echo "X$output" | $Xsed -e 's%^.*/%%'`
1306            dlfiles="$dlfiles $arg"      libobjs_save="$libobjs"
           if test -z "$dlname" || test "$dlopen" != yes || test "$build_libtool_libs" = no; then  
             # If there is no dlname, no dlopen support or we're linking statically,  
             # we need to preload.  
             prev=dlprefiles  
           else  
             # We should not create a dependency on this library, but we  
             # may need any libraries it requires.  
             compile_command="$compile_command$dependency_libs"  
             finalize_command="$finalize_command$dependency_libs"  
             prev=  
             continue  
           fi  
         fi  
1307    
1308          # The library was specified with -dlpreopen.      if test -n "$shlibpath_var"; then
1309          if test "$prev" = dlprefiles; then        # get the directories listed in $shlibpath_var
1310            # Prefer using a static library (so that no silly _DYNAMIC symbols        eval shlib_search_path=\`\$echo \"X\${$shlibpath_var}\" \| \$Xsed -e \'s/:/ /g\'\`
1311            # are required to link).      else
1312            if test -n "$old_library"; then        shlib_search_path=
1313              dlprefiles="$dlprefiles $dir/$old_library"      fi
1314            else      eval sys_lib_search_path=\"$sys_lib_search_path_spec\"
1315              dlprefiles="$dlprefiles $dir/$linklib"      eval sys_lib_dlsearch_path=\"$sys_lib_dlsearch_path_spec\"
           fi  
           prev=  
         fi  
1316    
1317          if test -n "$library_names" &&      output_objdir=`$echo "X$output" | $Xsed -e 's%/[^/]*$%%'`
1318             { test "$prefer_static_libs" = no || test -z "$old_library"; }; then      if test "X$output_objdir" = "X$output"; then
1319            link_against_libtool_libs="$link_against_libtool_libs $arg"        output_objdir="$objdir"
1320            if test -n "$shlibpath_var"; then      else
1321              # Make sure the rpath contains only unique directories.        output_objdir="$output_objdir/$objdir"
1322              case "$temp_rpath " in      fi
1323              *" $dir "*) ;;      # Create the object directory.
1324              *) temp_rpath="$temp_rpath $dir" ;;      if test ! -d $output_objdir; then
1325              esac        $show "$mkdir $output_objdir"
1326            fi        $run $mkdir $output_objdir
1327          status=$?
1328          if test $status -ne 0 && test ! -d $output_objdir; then
1329            exit $status
1330          fi
1331        fi
1332    
1333            # We need an absolute path.      # Determine the type of output
1334            case "$dir" in      case $output in
1335            [\\/] | [A-Za-z]:[\\/]*) absdir="$dir" ;;      "")
1336            *)        $echo "$modename: you must specify an output file" 1>&2
1337              absdir=`cd "$dir" && pwd`        $echo "$help" 1>&2
1338              if test -z "$absdir"; then        exit 1
1339                $echo "$modename: warning: cannot determine absolute directory name of \`$dir'" 1>&2        ;;
1340                $echo "$modename: passing it literally to the linker, although it might fail" 1>&2      *.$libext) linkmode=oldlib ;;
1341                absdir="$dir"      *.lo | *.$objext) linkmode=obj ;;
1342              fi      *.la) linkmode=lib ;;
1343              ;;      *) linkmode=prog ;; # Anything else should be a program.
1344            esac      esac
   
           # This is the magic to use -rpath.  
           # Skip directories that are in the system default run-time  
           # search path, unless they have been requested with -R.  
           case " $sys_lib_dlsearch_path " in  
           *" $absdir "*) ;;  
           *)  
             case "$compile_rpath " in  
             *" $absdir "*) ;;  
             *) compile_rpath="$compile_rpath $absdir"  
             esac  
             ;;  
           esac  
1345    
1346            case " $sys_lib_dlsearch_path " in      specialdeplibs=
1347            *" $libdir "*) ;;      libs=
1348        # Find all interdependent deplibs by searching for libraries
1349        # that are linked more than once (e.g. -la -lb -la)
1350        for deplib in $deplibs; do
1351          if test "X$duplicate_deps" = "Xyes" ; then
1352            case "$libs " in
1353            *" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;;
1354            esac
1355          fi
1356          libs="$libs $deplib"
1357        done
1358        deplibs=
1359        newdependency_libs=
1360        newlib_search_path=
1361        need_relink=no # whether we're linking any uninstalled libtool libraries
1362        notinst_deplibs= # not-installed libtool libraries
1363        notinst_path= # paths that contain not-installed libtool libraries
1364        case $linkmode in
1365        lib)
1366            passes="conv link"
1367            for file in $dlfiles $dlprefiles; do
1368              case $file in
1369              *.la) ;;
1370            *)            *)
1371              case "$finalize_rpath " in              $echo "$modename: libraries can \`-dlopen' only libtool libraries: $file" 1>&2
1372              *" $libdir "*) ;;              exit 1
             *) finalize_rpath="$finalize_rpath $libdir"  
             esac  
1373              ;;              ;;
1374            esac            esac
1375            done
1376            lib_linked=yes          ;;
1377            case "$hardcode_action" in      prog)
1378            immediate | unsupported)          compile_deplibs=
1379              if test "$hardcode_direct" = no; then          finalize_deplibs=
1380                compile_command="$compile_command $dir/$linklib"          alldeplibs=no
1381                deplibs="$deplibs $dir/$linklib"          newdlfiles=
1382                case "$host" in          newdlprefiles=
1383                *-*-cygwin* | *-*-mingw* | *-*-os2*)          passes="conv scan dlopen dlpreopen link"
1384                  dllsearchdir=`cd "$dir" && pwd || echo "$dir"`          ;;
1385                  if test -n "$dllsearchpath"; then      *)  passes="conv"
1386                    dllsearchpath="$dllsearchpath:$dllsearchdir"          ;;
1387                  else      esac
1388                    dllsearchpath="$dllsearchdir"      for pass in $passes; do
1389                  fi        if test $linkmode = prog; then
1390                  ;;          # Determine which files to process
1391                esac          case $pass in
1392              elif test "$hardcode_minus_L" = no; then          dlopen)
1393                case "$host" in            libs="$dlfiles"
1394                *-*-sunos*)            save_deplibs="$deplibs" # Collect dlpreopened libraries
1395                  compile_shlibpath="$compile_shlibpath$dir:"            deplibs=
1396                  ;;            ;;
1397                esac          dlpreopen) libs="$dlprefiles" ;;
1398                case "$compile_command " in          link) libs="$deplibs %DEPLIBS% $dependency_libs" ;;
1399                *" -L$dir "*) ;;          esac
1400                *) compile_command="$compile_command -L$dir";;        fi
1401                esac        for deplib in $libs; do
1402                compile_command="$compile_command -l$name"          lib=
1403                deplibs="$deplibs -L$dir -l$name"          found=no
1404              elif test "$hardcode_shlibpath_var" = no; then          case $deplib in
1405                case ":$compile_shlibpath:" in          -l*)
1406                *":$dir:"*) ;;            if test $linkmode = oldlib && test $linkmode = obj; then
1407                *) compile_shlibpath="$compile_shlibpath$dir:";;              $echo "$modename: warning: \`-l' is ignored for archives/objects: $deplib" 1>&2
1408                esac              continue
1409                compile_command="$compile_command -l$name"            fi
1410                deplibs="$deplibs -l$name"            if test $pass = conv; then
1411                deplibs="$deplib $deplibs"
1412                continue
1413              fi
1414              name=`$echo "X$deplib" | $Xsed -e 's/^-l//'`
1415              for searchdir in $newlib_search_path $lib_search_path $sys_lib_search_path $shlib_search_path; do
1416                # Search the libtool library
1417                lib="$searchdir/lib${name}.la"
1418                if test -f "$lib"; then
1419                  found=yes
1420                  break
1421                fi
1422              done
1423              if test "$found" != yes; then
1424                # deplib doesn't seem to be a libtool library
1425                if test "$linkmode,$pass" = "prog,link"; then
1426                  compile_deplibs="$deplib $compile_deplibs"
1427                  finalize_deplibs="$deplib $finalize_deplibs"
1428              else              else
1429                lib_linked=no                deplibs="$deplib $deplibs"
1430                  test $linkmode = lib && newdependency_libs="$deplib $newdependency_libs"
1431              fi              fi
1432                continue
1433              fi
1434              ;; # -l
1435            -L*)
1436              case $linkmode in
1437              lib)
1438                deplibs="$deplib $deplibs"
1439                test $pass = conv && continue
1440                newdependency_libs="$deplib $newdependency_libs"
1441                newlib_search_path="$newlib_search_path "`$echo "X$deplib" | $Xsed -e 's/^-L//'`
1442              ;;              ;;
1443              prog)
1444            relink)              if test $pass = conv; then
1445              if test "$hardcode_direct" = yes; then                deplibs="$deplib $deplibs"
1446                compile_command="$compile_command $absdir/$linklib"                continue
1447                deplibs="$deplibs $absdir/$linklib"              fi
1448              elif test "$hardcode_minus_L" = yes; then              if test $pass = scan; then
1449                case "$compile_command " in                deplibs="$deplib $deplibs"
1450                *" -L$absdir "*) ;;                newlib_search_path="$newlib_search_path "`$echo "X$deplib" | $Xsed -e 's/^-L//'`
               *) compile_command="$compile_command -L$absdir";;  
               esac  
               compile_command="$compile_command -l$name"  
               deplibs="$deplibs -L$absdir -l$name"  
             elif test "$hardcode_shlibpath_var" = yes; then  
               case ":$compile_shlibpath:" in  
               *":$absdir:"*) ;;  
               *) compile_shlibpath="$compile_shlibpath$absdir:";;  
               esac  
               compile_command="$compile_command -l$name"  
               deplibs="$deplibs -l$name"  
1451              else              else
1452                lib_linked=no                compile_deplibs="$deplib $compile_deplibs"
1453                  finalize_deplibs="$deplib $finalize_deplibs"
1454              fi              fi
1455              ;;              ;;
   
1456            *)            *)
1457              lib_linked=no              $echo "$modename: warning: \`-L' is ignored for archives/objects: $deplib" 1>&2
1458              ;;              ;;
1459            esac            esac # linkmode
1460              continue
1461              ;; # -L
1462            -R*)
1463              if test $pass = link; then
1464                dir=`$echo "X$deplib" | $Xsed -e 's/^-R//'`
1465                # Make sure the xrpath contains only unique directories.
1466                case "$xrpath " in
1467                *" $dir "*) ;;
1468                *) xrpath="$xrpath $dir" ;;
1469                esac
1470              fi
1471              deplibs="$deplib $deplibs"
1472              continue
1473              ;;
1474            *.la) lib="$deplib" ;;
1475            *.$libext)
1476              if test $pass = conv; then
1477                deplibs="$deplib $deplibs"
1478                continue
1479              fi
1480              case $linkmode in
1481              lib)
1482                if test "$deplibs_check_method" != pass_all; then
1483                  echo
1484                  echo "*** Warning: Trying to link with static lib archive $deplib."
1485                  echo "*** I have the capability to make that library automatically link in when"
1486                  echo "*** you link to this library.  But I can only do this if you have a"
1487                  echo "*** shared version of the library, which you do not appear to have"
1488                  echo "*** because the file extensions .$libext of this argument makes me believe"
1489                  echo "*** that it is just a static archive that I should not used here."
1490                else
1491                  echo
1492                  echo "*** Warning: Linking the shared library $output against the"
1493                  echo "*** static library $deplib is not portable!"
1494                  deplibs="$deplib $deplibs"
1495                fi
1496                continue
1497                ;;
1498              prog)
1499                if test $pass != link; then
1500                  deplibs="$deplib $deplibs"
1501                else
1502                  compile_deplibs="$deplib $compile_deplibs"
1503                  finalize_deplibs="$deplib $finalize_deplibs"
1504                fi
1505                continue
1506                ;;
1507              esac # linkmode
1508              ;; # *.$libext
1509            *.lo | *.$objext)
1510              if test $pass = dlpreopen || test "$dlopen_support" != yes || test "$build_libtool_libs" = no; then
1511                # If there is no dlopen support or we're linking statically,
1512                # we need to preload.
1513                newdlprefiles="$newdlprefiles $deplib"
1514                compile_deplibs="$deplib $compile_deplibs"
1515                finalize_deplibs="$deplib $finalize_deplibs"
1516              else
1517                newdlfiles="$newdlfiles $deplib"
1518              fi
1519              continue
1520              ;;
1521            %DEPLIBS%)
1522              alldeplibs=yes
1523              continue
1524              ;;
1525            esac # case $deplib
1526            if test $found = yes || test -f "$lib"; then :
1527            else
1528              $echo "$modename: cannot find the library \`$lib'" 1>&2
1529              exit 1
1530            fi
1531    
1532            # Check to see that this really is a libtool archive.
1533            if (${SED} -e '2q' $lib | egrep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then :
1534            else
1535              $echo "$modename: \`$lib' is not a valid libtool archive" 1>&2
1536              exit 1
1537            fi
1538    
1539            ladir=`$echo "X$lib" | $Xsed -e 's%/[^/]*$%%'`
1540            test "X$ladir" = "X$lib" && ladir="."
1541    
1542            dlname=
1543            dlopen=
1544            dlpreopen=
1545            libdir=
1546            library_names=
1547            old_library=
1548            # If the library was installed with an old release of libtool,
1549            # it will not redefine variable installed.
1550            installed=yes
1551    
1552            # Read the .la file
1553            case $lib in
1554            */* | *\\*) . $lib ;;
1555            *) . ./$lib ;;
1556            esac
1557    
1558            if test "$linkmode,$pass" = "lib,link" ||
1559               test "$linkmode,$pass" = "prog,scan" ||
1560               { test $linkmode = oldlib && test $linkmode = obj; }; then
1561               # Add dl[pre]opened files of deplib
1562              test -n "$dlopen" && dlfiles="$dlfiles $dlopen"
1563              test -n "$dlpreopen" && dlprefiles="$dlprefiles $dlpreopen"
1564            fi
1565    
1566            if test "$lib_linked" != yes; then          if test $pass = conv; then
1567              $echo "$modename: configuration error: unsupported hardcode properties"            # Only check for convenience libraries
1568              deplibs="$lib $deplibs"
1569              if test -z "$libdir"; then
1570                if test -z "$old_library"; then
1571                  $echo "$modename: cannot find name of link library for \`$lib'" 1>&2
1572                  exit 1
1573                fi
1574                # It is a libtool convenience library, so add in its objects.
1575                convenience="$convenience $ladir/$objdir/$old_library"
1576                old_convenience="$old_convenience $ladir/$objdir/$old_library"
1577                tmp_libs=
1578                for deplib in $dependency_libs; do
1579                  deplibs="$deplib $deplibs"
1580                  if test "X$duplicate_deps" = "Xyes" ; then
1581                    case "$tmp_libs " in
1582                    *" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;;
1583                    esac
1584                  fi
1585                  tmp_libs="$tmp_libs $deplib"
1586                done
1587              elif test $linkmode != prog && test $linkmode != lib; then
1588                $echo "$modename: \`$lib' is not a convenience library" 1>&2
1589              exit 1              exit 1
1590            fi            fi
1591              continue
1592            fi # $pass = conv
1593    
1594            # Finalize command for both is simple: just hardcode it.          # Get the name of the library we link against.
1595            if test "$hardcode_direct" = yes; then          linklib=
1596              finalize_command="$finalize_command $libdir/$linklib"          for l in $old_library $library_names; do
1597            elif test "$hardcode_minus_L" = yes; then            linklib="$l"
1598              case "$finalize_command " in          done
1599              *" -L$libdir "*) ;;          if test -z "$linklib"; then
1600              *) finalize_command="$finalize_command -L$libdir";;            $echo "$modename: cannot find name of link library for \`$lib'" 1>&2
1601              esac            exit 1
1602              finalize_command="$finalize_command -l$name"          fi
1603            elif test "$hardcode_shlibpath_var" = yes; then  
1604              case ":$finalize_shlibpath:" in          # This library was specified with -dlopen.
1605              *":$libdir:"*) ;;          if test $pass = dlopen; then
1606              *) finalize_shlibpath="$finalize_shlibpath$libdir:";;            if test -z "$libdir"; then
1607              esac              $echo "$modename: cannot -dlopen a convenience library: \`$lib'" 1>&2
1608              finalize_command="$finalize_command -l$name"              exit 1
1609              fi
1610              if test -z "$dlname" || test "$dlopen_support" != yes || test "$build_libtool_libs" = no; then
1611                # If there is no dlname, no dlopen support or we're linking
1612                # statically, we need to preload.
1613                dlprefiles="$dlprefiles $lib"
1614            else            else
1615              # We cannot seem to hardcode it, guess we'll fake it.              newdlfiles="$newdlfiles $lib"
1616              case "$finalize_command " in            fi
1617              *" -L$dir "*) ;;            continue
1618              *) finalize_command="$finalize_command -L$libdir";;          fi # $pass = dlopen
1619              esac  
1620              finalize_command="$finalize_command -l$name"          # We need an absolute path.
1621            case $ladir in
1622            [\\/]* | [A-Za-z]:[\\/]*) abs_ladir="$ladir" ;;
1623            *)
1624              abs_ladir=`cd "$ladir" && pwd`
1625              if test -z "$abs_ladir"; then
1626                $echo "$modename: warning: cannot determine absolute directory name of \`$ladir'" 1>&2
1627                $echo "$modename: passing it literally to the linker, although it might fail" 1>&2
1628                abs_ladir="$ladir"
1629              fi
1630              ;;
1631            esac
1632            laname=`$echo "X$lib" | $Xsed -e 's%^.*/%%'`
1633    
1634            # Find the relevant object directory and library name.
1635            if test "X$installed" = Xyes; then
1636              if test ! -f "$libdir/$linklib" && test -f "$abs_ladir/$linklib"; then
1637                $echo "$modename: warning: library \`$lib' was moved." 1>&2
1638                dir="$ladir"
1639                absdir="$abs_ladir"
1640                libdir="$abs_ladir"
1641              else
1642                dir="$libdir"
1643                absdir="$libdir"
1644            fi            fi
1645          else          else
1646            # Transform directly to old archives if we don't build new libraries.            dir="$ladir/$objdir"
1647            if test -n "$pic_flag" && test -z "$old_library"; then            absdir="$abs_ladir/$objdir"
1648              $echo "$modename: cannot find static library for \`$arg'" 1>&2            # Remove this search path later
1649              notinst_path="$notinst_path $abs_ladir"
1650            fi # $installed = yes
1651            name=`$echo "X$laname" | $Xsed -e 's/\.la$//' -e 's/^lib//'`
1652    
1653            # This library was specified with -dlpreopen.
1654            if test $pass = dlpreopen; then
1655              if test -z "$libdir"; then
1656                $echo "$modename: cannot -dlpreopen a convenience library: \`$lib'" 1>&2
1657              exit 1              exit 1
1658            fi            fi
1659              # Prefer using a static library (so that no silly _DYNAMIC symbols
1660              # are required to link).
1661              if test -n "$old_library"; then
1662                newdlprefiles="$newdlprefiles $dir/$old_library"
1663              # Otherwise, use the dlname, so that lt_dlopen finds it.
1664              elif test -n "$dlname"; then
1665                newdlprefiles="$newdlprefiles $dir/$dlname"
1666              else
1667                newdlprefiles="$newdlprefiles $dir/$linklib"
1668              fi
1669            fi # $pass = dlpreopen
1670    
1671            # Here we assume that one of hardcode_direct or hardcode_minus_L          if test -z "$libdir"; then
1672            # is not unsupported.  This is valid on all known static and            # Link the convenience library
1673            # shared platforms.            if test $linkmode = lib; then
1674            if test "$hardcode_direct" != unsupported; then              deplibs="$dir/$old_library $deplibs"
1675              test -n "$old_library" && linklib="$old_library"            elif test "$linkmode,$pass" = "prog,link"; then
1676              compile_command="$compile_command $dir/$linklib"              compile_deplibs="$dir/$old_library $compile_deplibs"
1677              finalize_command="$finalize_command $dir/$linklib"              finalize_deplibs="$dir/$old_library $finalize_deplibs"
1678            else            else
1679              case "$compile_command " in              deplibs="$lib $deplibs"
1680              *" -L$dir "*) ;;            fi
1681              *) compile_command="$compile_command -L$dir";;            continue
1682            fi
1683    
1684            if test $linkmode = prog && test $pass != link; then
1685              newlib_search_path="$newlib_search_path $ladir"
1686              deplibs="$lib $deplibs"
1687    
1688              linkalldeplibs=no
1689              if test "$link_all_deplibs" != no || test -z "$library_names" ||
1690                 test "$build_libtool_libs" = no; then
1691                linkalldeplibs=yes
1692              fi
1693    
1694              tmp_libs=
1695              for deplib in $dependency_libs; do
1696                case $deplib in
1697                -L*) newlib_search_path="$newlib_search_path "`$echo "X$deplib" | $Xsed -e 's/^-L//'`;; ### testsuite: skip nested quoting test
1698                esac
1699                # Need to link against all dependency_libs?
1700                if test $linkalldeplibs = yes; then
1701                  deplibs="$deplib $deplibs"
1702                else
1703                  # Need to hardcode shared library paths
1704                  # or/and link against static libraries
1705                  newdependency_libs="$deplib $newdependency_libs"
1706                fi
1707                if test "X$duplicate_deps" = "Xyes" ; then
1708                  case "$tmp_libs " in
1709                  *" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;;
1710                  esac
1711                fi
1712                tmp_libs="$tmp_libs $deplib"
1713              done # for deplib
1714              continue
1715            fi # $linkmode = prog...
1716    
1717            link_static=no # Whether the deplib will be linked statically
1718            if test -n "$library_names" &&
1719               { test "$prefer_static_libs" = no || test -z "$old_library"; }; then
1720              # Link against this shared library
1721    
1722              if test "$linkmode,$pass" = "prog,link" ||
1723               { test $linkmode = lib && test $hardcode_into_libs = yes; }; then
1724                # Hardcode the library path.
1725                # Skip directories that are in the system default run-time
1726                # search path.
1727                case " $sys_lib_dlsearch_path " in
1728                *" $absdir "*) ;;
1729                *)
1730                  case "$compile_rpath " in
1731                  *" $absdir "*) ;;
1732                  *) compile_rpath="$compile_rpath $absdir"
1733                  esac
1734                  ;;
1735              esac              esac
1736              compile_command="$compile_command -l$name"              case " $sys_lib_dlsearch_path " in
1737              case "$finalize_command " in              *" $libdir "*) ;;
1738              *" -L$dir "*) ;;              *)
1739              *) finalize_command="$finalize_command -L$dir";;                case "$finalize_rpath " in
1740                  *" $libdir "*) ;;
1741                  *) finalize_rpath="$finalize_rpath $libdir"
1742                  esac
1743                  ;;
1744              esac              esac
1745              finalize_command="$finalize_command -l$name"              if test $linkmode = prog; then
1746                  # We need to hardcode the library path
1747                  if test -n "$shlibpath_var"; then
1748                    # Make sure the rpath contains only unique directories.
1749                    case "$temp_rpath " in
1750                    *" $dir "*) ;;
1751                    *" $absdir "*) ;;
1752                    *) temp_rpath="$temp_rpath $dir" ;;
1753                    esac
1754                  fi
1755                fi
1756              fi # $linkmode,$pass = prog,link...
1757    
1758              if test "$alldeplibs" = yes &&
1759                 { test "$deplibs_check_method" = pass_all ||
1760                   { test "$build_libtool_libs" = yes &&
1761                     test -n "$library_names"; }; }; then
1762                # We only need to search for static libraries
1763                continue
1764            fi            fi
         fi  
1765    
1766          # Add in any libraries that this one depends upon.            if test "$installed" = no; then
1767          compile_command="$compile_command$dependency_libs"              notinst_deplibs="$notinst_deplibs $lib"
1768          finalize_command="$finalize_command$dependency_libs"              need_relink=yes
1769          continue            fi
1770          ;;  
1771              if test -n "$old_archive_from_expsyms_cmds"; then
1772                # figure out the soname
1773                set dummy $library_names
1774                realname="$2"
1775                shift; shift
1776                libname=`eval \\$echo \"$libname_spec\"`
1777                # use dlname if we got it. it's perfectly good, no?
1778                if test -n "$dlname"; then
1779                  soname="$dlname"
1780                elif test -n "$soname_spec"; then
1781                  # bleh windows
1782                  case $host in
1783                  *cygwin*)
1784                    major=`expr $current - $age`
1785                    versuffix="-$major"
1786                    ;;
1787                  esac
1788                  eval soname=\"$soname_spec\"
1789                else
1790                  soname="$realname"
1791                fi
1792    
1793        # Some other compiler argument.              # Make a new name for the extract_expsyms_cmds to use
1794        *)              soroot="$soname"
1795          # Unknown arguments in both finalize_command and compile_command need              soname=`echo $soroot | ${SED} -e 's/^.*\///'`
1796          # to be aesthetically quoted because they are evaled later.              newlib="libimp-`echo $soname | ${SED} 's/^lib//;s/\.dll$//'`.a"
         arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`  
         case "$arg" in  
         *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \   ]*|*]*)  
           arg="\"$arg\""  
           ;;  
         esac  
         ;;  
       esac  
1797    
1798        # Now actually substitute the argument into the commands.              # If the library has no export list, then create one now
1799        if test -n "$arg"; then              if test -f "$output_objdir/$soname-def"; then :
1800          compile_command="$compile_command $arg"              else
1801          finalize_command="$finalize_command $arg"                $show "extracting exported symbol list from \`$soname'"
1802        fi                save_ifs="$IFS"; IFS='~'
1803      done                eval cmds=\"$extract_expsyms_cmds\"
1804                  for cmd in $cmds; do
1805                    IFS="$save_ifs"
1806                    $show "$cmd"
1807                    $run eval "$cmd" || exit $?
1808                  done
1809                  IFS="$save_ifs"
1810                fi
1811    
1812      if test -n "$prev"; then              # Create $newlib
1813        $echo "$modename: the \`$prevarg' option requires an argument" 1>&2              if test -f "$output_objdir/$newlib"; then :; else
1814        $echo "$help" 1>&2                $show "generating import library for \`$soname'"
1815        exit 1                save_ifs="$IFS"; IFS='~'
1816      fi                eval cmds=\"$old_archive_from_expsyms_cmds\"
1817                  for cmd in $cmds; do
1818                    IFS="$save_ifs"
1819                    $show "$cmd"
1820                    $run eval "$cmd" || exit $?
1821                  done
1822                  IFS="$save_ifs"
1823                fi
1824                # make sure the library variables are pointing to the new library
1825                dir=$output_objdir
1826                linklib=$newlib
1827              fi # test -n $old_archive_from_expsyms_cmds
1828    
1829              if test $linkmode = prog || test "$mode" != relink; then
1830                add_shlibpath=
1831                add_dir=
1832                add=
1833                lib_linked=yes
1834                case $hardcode_action in
1835                immediate | unsupported)
1836                  if test "$hardcode_direct" = no; then
1837                    add="$dir/$linklib"
1838                  elif test "$hardcode_minus_L" = no; then
1839                    case $host in
1840                    *-*-sunos*) add_shlibpath="$dir" ;;
1841                    esac
1842                    add_dir="-L$dir"
1843                    add="-l$name"
1844                  elif test "$hardcode_shlibpath_var" = no; then
1845                    add_shlibpath="$dir"
1846                    add="-l$name"
1847                  else
1848                    lib_linked=no
1849                  fi
1850                  ;;
1851                relink)
1852                  if test "$hardcode_direct" = yes; then
1853                    add="$dir/$linklib"
1854                  elif test "$hardcode_minus_L" = yes; then
1855                    add_dir="-L$dir"
1856                    add="-l$name"
1857                  elif test "$hardcode_shlibpath_var" = yes; then
1858                    add_shlibpath="$dir"
1859                    add="-l$name"
1860                  else
1861                    lib_linked=no
1862                  fi
1863                  ;;
1864                *) lib_linked=no ;;
1865                esac
1866    
1867      if test "$export_dynamic" = yes && test -n "$export_dynamic_flag_spec"; then              if test "$lib_linked" != yes; then
1868        eval arg=\"$export_dynamic_flag_spec\"                $echo "$modename: configuration error: unsupported hardcode properties"
1869        compile_command="$compile_command $arg"                exit 1
1870        finalize_command="$finalize_command $arg"              fi
     fi  
1871    
1872      oldlibs=              if test -n "$add_shlibpath"; then
1873      # calculate the name of the file, without its directory                case :$compile_shlibpath: in
1874      outputname=`$echo "X$output" | $Xsed -e 's%^.*/%%'`                *":$add_shlibpath:"*) ;;
1875      libobjs_save="$libobjs"                *) compile_shlibpath="$compile_shlibpath$add_shlibpath:" ;;
1876                  esac
1877                fi
1878                if test $linkmode = prog; then
1879                  test -n "$add_dir" && compile_deplibs="$add_dir $compile_deplibs"
1880                  test -n "$add" && compile_deplibs="$add $compile_deplibs"
1881                else
1882                  test -n "$add_dir" && deplibs="$add_dir $deplibs"
1883                  test -n "$add" && deplibs="$add $deplibs"
1884                  if test "$hardcode_direct" != yes && \
1885                     test "$hardcode_minus_L" != yes && \
1886                     test "$hardcode_shlibpath_var" = yes; then
1887                    case :$finalize_shlibpath: in
1888                    *":$libdir:"*) ;;
1889                    *) finalize_shlibpath="$finalize_shlibpath$libdir:" ;;
1890                    esac
1891                  fi
1892                fi
1893              fi
1894    
1895      case "$output" in            if test $linkmode = prog || test "$mode" = relink; then
1896      "")              add_shlibpath=
1897        $echo "$modename: you must specify an output file" 1>&2              add_dir=
1898        $echo "$help" 1>&2              add=
1899        exit 1              # Finalize command for both is simple: just hardcode it.
1900        ;;              if test "$hardcode_direct" = yes; then
1901                  add="$libdir/$linklib"
1902                elif test "$hardcode_minus_L" = yes; then
1903                  add_dir="-L$libdir"
1904                  add="-l$name"
1905                elif test "$hardcode_shlibpath_var" = yes; then
1906                  case :$finalize_shlibpath: in
1907                  *":$libdir:"*) ;;
1908                  *) finalize_shlibpath="$finalize_shlibpath$libdir:" ;;
1909                  esac
1910                  add="-l$name"
1911                else
1912                  # We cannot seem to hardcode it, guess we'll fake it.
1913                  add_dir="-L$libdir"
1914                  add="-l$name"
1915                fi
1916    
1917      *.a | *.lib)              if test $linkmode = prog; then
1918        if test -n "$link_against_libtool_libs"; then                test -n "$add_dir" && finalize_deplibs="$add_dir $finalize_deplibs"
1919          $echo "$modename: error: cannot link libtool libraries into archives" 1>&2                test -n "$add" && finalize_deplibs="$add $finalize_deplibs"
1920          exit 1              else
1921                  test -n "$add_dir" && deplibs="$add_dir $deplibs"
1922                  test -n "$add" && deplibs="$add $deplibs"
1923                fi
1924              fi
1925            elif test $linkmode = prog; then
1926              if test "$alldeplibs" = yes &&
1927                 { test "$deplibs_check_method" = pass_all ||
1928                   { test "$build_libtool_libs" = yes &&
1929                     test -n "$library_names"; }; }; then
1930                # We only need to search for static libraries
1931                continue
1932              fi
1933    
1934              # Try to link the static library
1935              # Here we assume that one of hardcode_direct or hardcode_minus_L
1936              # is not unsupported.  This is valid on all known static and
1937              # shared platforms.
1938              if test "$hardcode_direct" != unsupported; then
1939                test -n "$old_library" && linklib="$old_library"
1940                compile_deplibs="$dir/$linklib $compile_deplibs"
1941                finalize_deplibs="$dir/$linklib $finalize_deplibs"
1942              else
1943                compile_deplibs="-l$name -L$dir $compile_deplibs"
1944                finalize_deplibs="-l$name -L$dir $finalize_deplibs"
1945              fi
1946            elif test "$build_libtool_libs" = yes; then
1947              # Not a shared library
1948              if test "$deplibs_check_method" != pass_all; then
1949                # We're trying link a shared library against a static one
1950                # but the system doesn't support it.
1951    
1952                # Just print a warning and add the library to dependency_libs so
1953                # that the program can be linked against the static library.
1954                echo
1955                echo "*** Warning: This system can not link to static lib archive $lib."
1956                echo "*** I have the capability to make that library automatically link in when"
1957                echo "*** you link to this library.  But I can only do this if you have a"
1958                echo "*** shared version of the library, which you do not appear to have."
1959                if test "$module" = yes; then
1960                  echo "*** But as you try to build a module library, libtool will still create "
1961                  echo "*** a static module, that should work as long as the dlopening application"
1962                  echo "*** is linked with the -dlopen flag to resolve symbols at runtime."
1963                  if test -z "$global_symbol_pipe"; then
1964                    echo
1965                    echo "*** However, this would only work if libtool was able to extract symbol"
1966                    echo "*** lists from a program, using \`nm' or equivalent, but libtool could"
1967                    echo "*** not find such a program.  So, this module is probably useless."
1968                    echo "*** \`nm' from GNU binutils and a full rebuild may help."
1969                  fi
1970                  if test "$build_old_libs" = no; then
1971                    build_libtool_libs=module
1972                    build_old_libs=yes
1973                  else
1974                    build_libtool_libs=no
1975                  fi
1976                fi
1977              else
1978                convenience="$convenience $dir/$old_library"
1979                old_convenience="$old_convenience $dir/$old_library"
1980                deplibs="$dir/$old_library $deplibs"
1981                link_static=yes
1982              fi
1983            fi # link shared/static library?
1984    
1985            if test $linkmode = lib; then
1986              if test -n "$dependency_libs" &&
1987                 { test $hardcode_into_libs != yes || test $build_old_libs = yes ||
1988                   test $link_static = yes; }; then
1989                # Extract -R from dependency_libs
1990                temp_deplibs=
1991                for libdir in $dependency_libs; do
1992                  case $libdir in
1993                  -R*) temp_xrpath=`$echo "X$libdir" | $Xsed -e 's/^-R//'`
1994                       case " $xrpath " in
1995                       *" $temp_xrpath "*) ;;
1996                       *) xrpath="$xrpath $temp_xrpath";;
1997                       esac;;
1998                  *) temp_deplibs="$temp_deplibs $libdir";;
1999                  esac
2000                done
2001                dependency_libs="$temp_deplibs"
2002              fi
2003    
2004              newlib_search_path="$newlib_search_path $absdir"
2005              # Link against this library
2006              test "$link_static" = no && newdependency_libs="$abs_ladir/$laname $newdependency_libs"
2007              # ... and its dependency_libs
2008              tmp_libs=
2009              for deplib in $dependency_libs; do
2010                newdependency_libs="$deplib $newdependency_libs"
2011                if test "X$duplicate_deps" = "Xyes" ; then
2012                  case "$tmp_libs " in
2013                  *" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;;
2014                  esac
2015                fi
2016                tmp_libs="$tmp_libs $deplib"
2017              done
2018    
2019              if test $link_all_deplibs != no; then
2020                # Add the search paths of all dependency libraries
2021                for deplib in $dependency_libs; do
2022                  case $deplib in
2023                  -L*) path="$deplib" ;;
2024                  *.la)
2025                    dir=`$echo "X$deplib" | $Xsed -e 's%/[^/]*$%%'`
2026                    test "X$dir" = "X$deplib" && dir="."
2027                    # We need an absolute path.
2028                    case $dir in
2029                    [\\/]* | [A-Za-z]:[\\/]*) absdir="$dir" ;;
2030                    *)
2031                      absdir=`cd "$dir" && pwd`
2032                      if test -z "$absdir"; then
2033                        $echo "$modename: warning: cannot determine absolute directory name of \`$dir'" 1>&2
2034                        absdir="$dir"
2035                      fi
2036                      ;;
2037                    esac
2038                    if grep "^installed=no" $deplib > /dev/null; then
2039                      path="-L$absdir/$objdir"
2040                    else
2041                      eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $deplib`
2042                      if test -z "$libdir"; then
2043                        $echo "$modename: \`$deplib' is not a valid libtool archive" 1>&2
2044                        exit 1
2045                      fi
2046                      if test "$absdir" != "$libdir"; then
2047                        $echo "$modename: warning: \`$deplib' seems to be moved" 1>&2
2048                      fi
2049                      path="-L$absdir"
2050                    fi
2051                    ;;
2052                  *) continue ;;
2053                  esac
2054                  case " $deplibs " in
2055                  *" $path "*) ;;
2056                  *) deplibs="$deplibs $path" ;;
2057                  esac
2058                done
2059              fi # link_all_deplibs != no
2060            fi # linkmode = lib
2061          done # for deplib in $libs
2062          if test $pass = dlpreopen; then
2063            # Link the dlpreopened libraries before other libraries
2064            for deplib in $save_deplibs; do
2065              deplibs="$deplib $deplibs"
2066            done
2067        fi        fi
2068          if test $pass != dlopen; then
2069            test $pass != scan && dependency_libs="$newdependency_libs"
2070            if test $pass != conv; then
2071              # Make sure lib_search_path contains only unique directories.
2072              lib_search_path=
2073              for dir in $newlib_search_path; do
2074                case "$lib_search_path " in
2075                *" $dir "*) ;;
2076                *) lib_search_path="$lib_search_path $dir" ;;
2077                esac
2078              done
2079              newlib_search_path=
2080            fi
2081    
2082        if test -n "$deplibs"; then          if test "$linkmode,$pass" != "prog,link"; then
2083          $echo "$modename: warning: \`-l' and \`-L' are ignored for archives" 1>&2            vars="deplibs"
2084            else
2085              vars="compile_deplibs finalize_deplibs"
2086            fi
2087            for var in $vars dependency_libs; do
2088              # Add libraries to $var in reverse order
2089              eval tmp_libs=\"\$$var\"
2090              new_libs=
2091              for deplib in $tmp_libs; do
2092                case $deplib in
2093                -L*) new_libs="$deplib $new_libs" ;;
2094                *)
2095                  case " $specialdeplibs " in
2096                  *" $deplib "*) new_libs="$deplib $new_libs" ;;
2097                  *)
2098                    case " $new_libs " in
2099                    *" $deplib "*) ;;
2100                    *) new_libs="$deplib $new_libs" ;;
2101                    esac
2102                    ;;
2103                  esac
2104                  ;;
2105                esac
2106              done
2107              tmp_libs=
2108              for deplib in $new_libs; do
2109                case $deplib in
2110                -L*)
2111                  case " $tmp_libs " in
2112                  *" $deplib "*) ;;
2113                  *) tmp_libs="$tmp_libs $deplib" ;;
2114                  esac
2115                  ;;
2116                *) tmp_libs="$tmp_libs $deplib" ;;
2117                esac
2118              done
2119              eval $var=\"$tmp_libs\"
2120            done # for var
2121        fi        fi
2122          if test "$pass" = "conv" &&
2123           { test "$linkmode" = "lib" || test "$linkmode" = "prog"; }; then
2124            libs="$deplibs" # reset libs
2125            deplibs=
2126          fi
2127        done # for pass
2128        if test $linkmode = prog; then
2129          dlfiles="$newdlfiles"
2130          dlprefiles="$newdlprefiles"
2131        fi
2132    
2133        case $linkmode in
2134        oldlib)
2135        if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then        if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then
2136          $echo "$modename: warning: \`-dlopen' is ignored for archives" 1>&2          $echo "$modename: warning: \`-dlopen' is ignored for archives" 1>&2
2137        fi        fi
# Line 1566  compiler." Line 2159  compiler."
2159        # Now set the variables for building old libraries.        # Now set the variables for building old libraries.
2160        build_libtool_libs=no        build_libtool_libs=no
2161        oldlibs="$output"        oldlibs="$output"
2162          objs="$objs$old_deplibs"
2163        ;;        ;;
2164    
2165      *.la)      lib)
2166        # Make sure we only generate libraries of the form `libNAME.la'.        # Make sure we only generate libraries of the form `libNAME.la'.
2167        case "$outputname" in        case $outputname in
2168        lib*)        lib*)
2169          name=`$echo "X$outputname" | $Xsed -e 's/\.la$//' -e 's/^lib//'`          name=`$echo "X$outputname" | $Xsed -e 's/\.la$//' -e 's/^lib//'`
2170          eval libname=\"$libname_spec\"          eval libname=\"$libname_spec\"
# Line 1591  compiler." Line 2185  compiler."
2185          ;;          ;;
2186        esac        esac
2187    
       output_objdir=`$echo "X$output" | $Xsed -e 's%/[^/]*$%%'`  
       if test "X$output_objdir" = "X$output"; then  
         output_objdir="$objdir"  
       else  
         output_objdir="$output_objdir/$objdir"  
       fi  
   
2188        if test -n "$objs"; then        if test -n "$objs"; then
2189          $echo "$modename: cannot build libtool library \`$output' from non-libtool objects:$objs" 2>&1          if test "$deplibs_check_method" != pass_all; then
2190          exit 1            $echo "$modename: cannot build libtool library \`$output' from non-libtool objects on this host:$objs" 2>&1
2191        fi            exit 1
2192            else
2193        # How the heck are we supposed to write a wrapper for a shared library?            echo
2194        if test -n "$link_against_libtool_libs"; then            echo "*** Warning: Linking the shared library $output against the non-libtool"
2195           $echo "$modename: error: cannot link shared libraries into libtool libraries" 1>&2            echo "*** objects $objs is not portable!"
2196           exit 1            libobjs="$libobjs $objs"
2197            fi
2198        fi        fi
2199    
2200        if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then        if test "$dlself" != no; then
2201          $echo "$modename: warning: \`-dlopen' is ignored for libtool libraries" 1>&2          $echo "$modename: warning: \`-dlopen self' is ignored for libtool libraries" 1>&2
2202        fi        fi
2203    
2204        set dummy $rpath        set dummy $rpath
# Line 1628  compiler." Line 2216  compiler."
2216            build_libtool_libs=convenience            build_libtool_libs=convenience
2217            build_old_libs=yes            build_old_libs=yes
2218          fi          fi
         dependency_libs="$deplibs"  
2219    
2220          if test -n "$vinfo"; then          if test -n "$vinfo"; then
2221            $echo "$modename: warning: \`-version-info' is ignored for convenience libraries" 1>&2            $echo "$modename: warning: \`-version-info' is ignored for convenience libraries" 1>&2
# Line 1640  compiler." Line 2227  compiler."
2227        else        else
2228    
2229          # Parse the version information argument.          # Parse the version information argument.
2230          IFS="${IFS=     }"; save_ifs="$IFS"; IFS=':'          save_ifs="$IFS"; IFS=':'
2231          set dummy $vinfo 0 0 0          set dummy $vinfo 0 0 0
2232          IFS="$save_ifs"          IFS="$save_ifs"
2233    
# Line 1655  compiler." Line 2242  compiler."
2242          age="$4"          age="$4"
2243    
2244          # Check that each of the things are valid numbers.          # Check that each of the things are valid numbers.
2245          case "$current" in          case $current in
2246          0 | [1-9] | [1-9][0-9]*) ;;          0 | [1-9] | [1-9][0-9] | [1-9][0-9][0-9]) ;;
2247          *)          *)
2248            $echo "$modename: CURRENT \`$current' is not a nonnegative integer" 1>&2            $echo "$modename: CURRENT \`$current' is not a nonnegative integer" 1>&2
2249            $echo "$modename: \`$vinfo' is not valid version information" 1>&2            $echo "$modename: \`$vinfo' is not valid version information" 1>&2
# Line 1664  compiler." Line 2251  compiler."
2251            ;;            ;;
2252          esac          esac
2253    
2254          case "$revision" in          case $revision in
2255          0 | [1-9] | [1-9][0-9]*) ;;          0 | [1-9] | [1-9][0-9] | [1-9][0-9][0-9]) ;;
2256          *)          *)
2257            $echo "$modename: REVISION \`$revision' is not a nonnegative integer" 1>&2            $echo "$modename: REVISION \`$revision' is not a nonnegative integer" 1>&2
2258            $echo "$modename: \`$vinfo' is not valid version information" 1>&2            $echo "$modename: \`$vinfo' is not valid version information" 1>&2
# Line 1673  compiler." Line 2260  compiler."
2260            ;;            ;;
2261          esac          esac
2262    
2263          case "$age" in          case $age in
2264          0 | [1-9] | [1-9][0-9]*) ;;          0 | [1-9] | [1-9][0-9] | [1-9][0-9][0-9]) ;;
2265          *)          *)
2266            $echo "$modename: AGE \`$age' is not a nonnegative integer" 1>&2            $echo "$modename: AGE \`$age' is not a nonnegative integer" 1>&2
2267            $echo "$modename: \`$vinfo' is not valid version information" 1>&2            $echo "$modename: \`$vinfo' is not valid version information" 1>&2
# Line 1692  compiler." Line 2279  compiler."
2279          major=          major=
2280          versuffix=          versuffix=
2281          verstring=          verstring=
2282          case "$version_type" in          case $version_type in
2283          none) ;;          none) ;;
2284    
2285          irix)          darwin)
2286              # Like Linux, but with the current version available in
2287              # verstring for coding it into the library header
2288              major=.`expr $current - $age`
2289              versuffix="$major.$age.$revision"
2290              # Darwin ld doesn't like 0 for these options...
2291              minor_current=`expr $current + 1`
2292              verstring="-compatibility_version $minor_current -current_version $minor_current.$revision"
2293              ;;
2294    
2295            freebsd-aout)
2296              major=".$current"
2297              versuffix=".$current.$revision";
2298              ;;
2299    
2300            freebsd-elf)
2301              major=".$current"
2302              versuffix=".$current";
2303              ;;
2304    
2305            irix | nonstopux)
2306            major=`expr $current - $age + 1`            major=`expr $current - $age + 1`
2307            versuffix="$major.$revision"  
2308            verstring="sgi$major.$revision"            case $version_type in
2309                nonstopux) verstring_prefix=nonstopux ;;
2310                *)         verstring_prefix=sgi ;;
2311              esac
2312              verstring="$verstring_prefix$major.$revision"
2313    
2314            # Add in all the interfaces that we are compatible with.            # Add in all the interfaces that we are compatible with.
2315            loop=$revision            loop=$revision
2316            while test $loop != 0; do            while test $loop != 0; do
2317              iface=`expr $revision - $loop`              iface=`expr $revision - $loop`
2318              loop=`expr $loop - 1`              loop=`expr $loop - 1`
2319              verstring="sgi$major.$iface:$verstring"              verstring="$verstring_prefix$major.$iface:$verstring"
2320            done            done
2321    
2322              # Before this point, $major must not contain `.'.
2323              major=.$major
2324              versuffix="$major.$revision"
2325            ;;            ;;
2326    
2327          linux)          linux)
# Line 1715  compiler." Line 2330  compiler."
2330            ;;            ;;
2331    
2332          osf)          osf)
2333            major=`expr $current - $age`            major=.`expr $current - $age`
2334            versuffix=".$current.$age.$revision"            versuffix=".$current.$age.$revision"
2335            verstring="$current.$age.$revision"            verstring="$current.$age.$revision"
2336    
# Line 1736  compiler." Line 2351  compiler."
2351            versuffix=".$current.$revision"            versuffix=".$current.$revision"
2352            ;;            ;;
2353    
         freebsd-aout)  
           major=".$current"  
           versuffix=".$current.$revision";  
           ;;  
   
         freebsd-elf)  
           major=".$current"  
           versuffix=".$current";  
           ;;  
   
2354          windows)          windows)
2355            # Like Linux, but with '-' rather than '.', since we only            # Use '-' rather than '.', since we only want one
2356            # want one extension on Windows 95.            # extension on DOS 8.3 filesystems.
2357            major=`expr $current - $age`            major=`expr $current - $age`
2358            versuffix="-$major-$age-$revision"            versuffix="-$major"
2359            ;;            ;;
2360    
2361          *)          *)
# Line 1764  compiler." Line 2369  compiler."
2369          if test -z "$vinfo" && test -n "$release"; then          if test -z "$vinfo" && test -n "$release"; then
2370            major=            major=
2371            verstring="0.0"            verstring="0.0"
2372              case $version_type in
2373              darwin)
2374                # we can't check for "0.0" in archive_cmds due to quoting
2375                # problems, so we reset it completely
2376                verstring=""
2377                ;;
2378              *)
2379                verstring="0.0"
2380                ;;
2381              esac
2382            if test "$need_version" = no; then            if test "$need_version" = no; then
2383              versuffix=              versuffix=
2384            else            else
# Line 1777  compiler." Line 2392  compiler."
2392            versuffix=            versuffix=
2393            verstring=""            verstring=""
2394          fi          fi
2395    
2396          # Check to see if the archive will have undefined symbols.          # Check to see if the archive will have undefined symbols.
2397          if test "$allow_undefined" = yes; then          if test "$allow_undefined" = yes; then
2398            if test "$allow_undefined_flag" = unsupported; then            if test "$allow_undefined_flag" = unsupported; then
# Line 1789  compiler." Line 2404  compiler."
2404            # Don't allow undefined symbols.            # Don't allow undefined symbols.
2405            allow_undefined_flag="$no_undefined_flag"            allow_undefined_flag="$no_undefined_flag"
2406          fi          fi
   
         dependency_libs="$deplibs"  
         case "$host" in  
         *-*-cygwin* | *-*-mingw* | *-*-os2* | *-*-beos*)  
           # these systems don't actually have a c library (as such)!  
           ;;  
         *)  
           # Add libc to deplibs on all other systems.  
           deplibs="$deplibs -lc"  
           ;;  
         esac  
2407        fi        fi
2408    
2409        # Create the output directory, or remove our outputs if we need to.        if test "$mode" != relink; then
2410        if test -d $output_objdir; then          # Remove our outputs.
2411          $show "${rm}r $output_objdir/$outputname $output_objdir/$libname.* $output_objdir/${libname}${release}.*"          $show "${rm}r $output_objdir/$outputname $output_objdir/$libname.* $output_objdir/${libname}${release}.*"
2412          $run ${rm}r $output_objdir/$outputname $output_objdir/$libname.* $output_objdir/${libname}${release}.*          $run ${rm}r $output_objdir/$outputname $output_objdir/$libname.* $output_objdir/${libname}${release}.*
       else  
         $show "$mkdir $output_objdir"  
         $run $mkdir $output_objdir  
         status=$?  
         if test $status -ne 0 && test ! -d $output_objdir; then  
           exit $status  
         fi  
2413        fi        fi
2414    
2415        # Now set the variables for building old libraries.        # Now set the variables for building old libraries.
# Line 1823  compiler." Line 2420  compiler."
2420          oldobjs="$objs "`$echo "X$libobjs" | $SP2NL | $Xsed -e '/\.'${libext}'$/d' -e "$lo2o" | $NL2SP`          oldobjs="$objs "`$echo "X$libobjs" | $SP2NL | $Xsed -e '/\.'${libext}'$/d' -e "$lo2o" | $NL2SP`
2421        fi        fi
2422    
2423          # Eliminate all temporary directories.
2424          for path in $notinst_path; do
2425            lib_search_path=`echo "$lib_search_path " | ${SED} -e 's% $path % %g'`
2426            deplibs=`echo "$deplibs " | ${SED} -e 's% -L$path % %g'`
2427            dependency_libs=`echo "$dependency_libs " | ${SED} -e 's% -L$path % %g'`
2428          done
2429    
2430          if test -n "$xrpath"; then
2431            # If the user specified any rpath flags, then add them.
2432            temp_xrpath=
2433            for libdir in $xrpath; do
2434              temp_xrpath="$temp_xrpath -R$libdir"
2435              case "$finalize_rpath " in
2436              *" $libdir "*) ;;
2437              *) finalize_rpath="$finalize_rpath $libdir" ;;
2438              esac
2439            done
2440            if test $hardcode_into_libs != yes || test $build_old_libs = yes; then
2441              dependency_libs="$temp_xrpath $dependency_libs"
2442            fi
2443          fi
2444    
2445          # Make sure dlfiles contains only unique files that won't be dlpreopened
2446          old_dlfiles="$dlfiles"
2447          dlfiles=
2448          for lib in $old_dlfiles; do
2449            case " $dlprefiles $dlfiles " in
2450            *" $lib "*) ;;
2451            *) dlfiles="$dlfiles $lib" ;;
2452            esac
2453          done
2454    
2455          # Make sure dlprefiles contains only unique files
2456          old_dlprefiles="$dlprefiles"
2457          dlprefiles=
2458          for lib in $old_dlprefiles; do
2459            case "$dlprefiles " in
2460            *" $lib "*) ;;
2461            *) dlprefiles="$dlprefiles $lib" ;;
2462            esac
2463          done
2464    
2465        if test "$build_libtool_libs" = yes; then        if test "$build_libtool_libs" = yes; then
2466            if test -n "$rpath"; then
2467              case $host in
2468              *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-*-beos*)
2469                # these systems don't actually have a c library (as such)!
2470                ;;
2471              *-*-rhapsody* | *-*-darwin1.[012])
2472                # Rhapsody C library is in the System framework
2473                deplibs="$deplibs -framework System"
2474                ;;
2475              *-*-netbsd*)
2476                # Don't link with libc until the a.out ld.so is fixed.
2477                ;;
2478              *-*-openbsd* | *-*-freebsd*)
2479                # Do not include libc due to us having libc/libc_r.
2480                ;;
2481              *)
2482                # Add libc to deplibs on all other systems if necessary.
2483                if test $build_libtool_need_lc = "yes"; then
2484                  deplibs="$deplibs -lc"
2485                fi
2486                ;;
2487              esac
2488            fi
2489    
2490          # Transform deplibs into only deplibs that can be linked in shared.          # Transform deplibs into only deplibs that can be linked in shared.
2491          name_save=$name          name_save=$name
2492          libname_save=$libname          libname_save=$libname
# Line 1838  compiler." Line 2501  compiler."
2501          major=""          major=""
2502          newdeplibs=          newdeplibs=
2503          droppeddeps=no          droppeddeps=no
2504          case "$deplibs_check_method" in          case $deplibs_check_method in
2505          pass_all)          pass_all)
2506            # Don't check for shared/static.  Everything works.            # Don't check for shared/static.  Everything works.
2507            # This might be a little naive.  We might want to check            # This might be a little naive.  We might want to check
2508            # whether the library exists or not.  But this is on            # whether the library exists or not.  But this is on
2509            # osf3 & osf4 and I'm not really sure... Just            # osf3 & osf4 and I'm not really sure... Just
2510            # implementing what was already the behaviour.            # implementing what was already the behaviour.
2511            newdeplibs=$deplibs            newdeplibs=$deplibs
# Line 1863  EOF Line 2526  EOF
2526              for i in $deplibs; do              for i in $deplibs; do
2527                name="`expr $i : '-l\(.*\)'`"                name="`expr $i : '-l\(.*\)'`"
2528                # If $name is empty we are operating on a -L argument.                # If $name is empty we are operating on a -L argument.
2529                if test "$name" != "" ; then                if test -n "$name" && test "$name" != "0"; then
2530                  libname=`eval \\$echo \"$libname_spec\"`                  libname=`eval \\$echo \"$libname_spec\"`
2531                  deplib_matches=`eval \\$echo \"$library_names_spec\"`                  deplib_matches=`eval \\$echo \"$library_names_spec\"`
2532                  set dummy $deplib_matches                  set dummy $deplib_matches
# Line 1873  EOF Line 2536  EOF
2536                  else                  else
2537                    droppeddeps=yes                    droppeddeps=yes
2538                    echo                    echo
2539                    echo "*** Warning: This library needs some functionality provided by $i."                    echo "*** Warning: dynamic linker does not accept needed library $i."
2540                    echo "*** I have the capability to make that library automatically link in when"                    echo "*** I have the capability to make that library automatically link in when"
2541                    echo "*** you link to this library.  But I can only do this if you have a"                    echo "*** you link to this library.  But I can only do this if you have a"
2542                    echo "*** shared version of the library, which you do not appear to have."                    echo "*** shared version of the library, which I believe you do not have"
2543                      echo "*** because a test_compile did reveal that the linker did not use it for"
2544                      echo "*** its dynamic dependency list that programs get resolved with at runtime."
2545                  fi                  fi
2546                else                else
2547                  newdeplibs="$newdeplibs $i"                  newdeplibs="$newdeplibs $i"
2548                fi                fi
2549              done              done
2550            else            else
2551              # Error occured in the first compile.  Let's try to salvage the situation:              # Error occured in the first compile.  Let's try to salvage
2552              # Compile a seperate program for each library.              # the situation: Compile a separate program for each library.
2553              for i in $deplibs; do              for i in $deplibs; do
2554                name="`expr $i : '-l\(.*\)'`"                name="`expr $i : '-l\(.*\)'`"
2555               # If $name is empty we are operating on a -L argument.               # If $name is empty we are operating on a -L argument.
2556                if test "$name" != "" ; then                if test -n "$name" && test "$name" != "0"; then
2557                  $rm conftest                  $rm conftest
2558                  $CC -o conftest conftest.c $i                  $CC -o conftest conftest.c $i
2559                  # Did it work?                  # Did it work?
# Line 1903  EOF Line 2568  EOF
2568                    else                    else
2569                      droppeddeps=yes                      droppeddeps=yes
2570                      echo                      echo
2571                      echo "*** Warning: This library needs some functionality provided by $i."                      echo "*** Warning: dynamic linker does not accept needed library $i."
2572                      echo "*** I have the capability to make that library automatically link in when"                      echo "*** I have the capability to make that library automatically link in when"
2573                      echo "*** you link to this library.  But I can only do this if you have a"                      echo "*** you link to this library.  But I can only do this if you have a"
2574                      echo "*** shared version of the library, which you do not appear to have."                      echo "*** shared version of the library, which you do not appear to have"
2575                        echo "*** because a test_compile did reveal that the linker did not use this one"
2576                        echo "*** as a dynamic dependency that programs can get resolved with at runtime."
2577                    fi                    fi
2578                  else                  else
2579                    droppeddeps=yes                    droppeddeps=yes
# Line 1924  EOF Line 2591  EOF
2591            ;;            ;;
2592          file_magic*)          file_magic*)
2593            set dummy $deplibs_check_method            set dummy $deplibs_check_method
2594            file_magic_regex="`expr \"$deplibs_check_method\" : \"$2 \(.*\)\"`"            file_magic_regex=`expr "$deplibs_check_method" : "$2 \(.*\)"`
2595            for a_deplib in $deplibs; do            for a_deplib in $deplibs; do
2596              name="`expr $a_deplib : '-l\(.*\)'`"              name="`expr $a_deplib : '-l\(.*\)'`"
2597              # If $name is empty we are operating on a -L argument.              # If $name is empty we are operating on a -L argument.
2598              if test "$name" != "" ; then              if test -n "$name" && test "$name" != "0"; then
2599                libname=`eval \\$echo \"$libname_spec\"`                libname=`eval \\$echo \"$libname_spec\"`
2600                for i in $lib_search_path; do                for i in $lib_search_path $sys_lib_search_path $shlib_search_path; do
2601                      potential_libs=`ls $i/$libname[.-]* 2>/dev/null`                      potential_libs=`ls $i/$libname[.-]* 2>/dev/null`
2602                      for potent_lib in $potential_libs; do                      for potent_lib in $potential_libs; do
2603                        # Follow soft links.                        # Follow soft links.
2604                        if ls -lLd "$potent_lib" 2>/dev/null \                        if ls -lLd "$potent_lib" 2>/dev/null \
2605                           | grep " -> " >/dev/null; then                           | grep " -> " >/dev/null; then
2606                          continue                          continue
2607                        fi                        fi
2608                        # The statement above tries to avoid entering an                        # The statement above tries to avoid entering an
2609                        # endless loop below, in case of cyclic links.                        # endless loop below, in case of cyclic links.
# Line 1945  EOF Line 2612  EOF
2612                        # but so what?                        # but so what?
2613                        potlib="$potent_lib"                        potlib="$potent_lib"
2614                        while test -h "$potlib" 2>/dev/null; do                        while test -h "$potlib" 2>/dev/null; do
2615                          potliblink=`ls -ld $potlib | sed 's/.* -> //'`                          potliblink=`ls -ld $potlib | ${SED} 's/.* -> //'`
2616                          case "$potliblink" in                          case $potliblink in
2617                          [\\/]* | [A-Za-z]:[\\/]*) potlib="$potliblink";;                          [\\/]* | [A-Za-z]:[\\/]*) potlib="$potliblink";;
2618                          *) potlib=`$echo "X$potlib" | $Xsed -e 's,[^/]*$,,'`"$potliblink";;                          *) potlib=`$echo "X$potlib" | $Xsed -e 's,[^/]*$,,'`"$potliblink";;
2619                          esac                          esac
2620                        done                        done
2621                        if eval $file_magic_cmd \"\$potlib\" 2>/dev/null \                        if eval $file_magic_cmd \"\$potlib\" 2>/dev/null \
2622                           | sed 10q \                           | ${SED} 10q \
2623                           | egrep "$file_magic_regex" > /dev/null; then                           | egrep "$file_magic_regex" > /dev/null; then
2624                          newdeplibs="$newdeplibs $a_deplib"                          newdeplibs="$newdeplibs $a_deplib"
2625                          a_deplib=""                          a_deplib=""
# Line 1963  EOF Line 2630  EOF
2630                if test -n "$a_deplib" ; then                if test -n "$a_deplib" ; then
2631                  droppeddeps=yes                  droppeddeps=yes
2632                  echo                  echo
2633                  echo "*** Warning: This library needs some functionality provided by $a_deplib."                  echo "*** Warning: linker path does not have real file for library $a_deplib."
2634                    echo "*** I have the capability to make that library automatically link in when"
2635                    echo "*** you link to this library.  But I can only do this if you have a"
2636                    echo "*** shared version of the library, which you do not appear to have"
2637                    echo "*** because I did check the linker path looking for a file starting"
2638                    if test -z "$potlib" ; then
2639                      echo "*** with $libname but no candidates were found. (...for file magic test)"
2640                    else
2641                      echo "*** with $libname and none of the candidates passed a file format test"
2642                      echo "*** using a file magic. Last file checked: $potlib"
2643                    fi
2644                  fi
2645                else
2646                  # Add a -L argument.
2647                  newdeplibs="$newdeplibs $a_deplib"
2648                fi
2649              done # Gone through all deplibs.
2650              ;;
2651            match_pattern*)
2652              set dummy $deplibs_check_method
2653              match_pattern_regex=`expr "$deplibs_check_method" : "$2 \(.*\)"`
2654              for a_deplib in $deplibs; do
2655                name="`expr $a_deplib : '-l\(.*\)'`"
2656                # If $name is empty we are operating on a -L argument.
2657                if test -n "$name" && test "$name" != "0"; then
2658                  libname=`eval \\$echo \"$libname_spec\"`
2659                  for i in $lib_search_path $sys_lib_search_path $shlib_search_path; do
2660                    potential_libs=`ls $i/$libname[.-]* 2>/dev/null`
2661                    for potent_lib in $potential_libs; do
2662                      potlib="$potent_lib" # see symlink-check below in file_magic test
2663                      if eval echo \"$potent_lib\" 2>/dev/null \
2664                          | ${SED} 10q \
2665                          | egrep "$match_pattern_regex" > /dev/null; then
2666                        newdeplibs="$newdeplibs $a_deplib"
2667                        a_deplib=""
2668                        break 2
2669                      fi
2670                    done
2671                  done
2672                  if test -n "$a_deplib" ; then
2673                    droppeddeps=yes
2674                    echo
2675                    echo "*** Warning: linker path does not have real file for library $a_deplib."
2676                  echo "*** I have the capability to make that library automatically link in when"                  echo "*** I have the capability to make that library automatically link in when"
2677                  echo "*** you link to this library.  But I can only do this if you have a"                  echo "*** you link to this library.  But I can only do this if you have a"
2678                  echo "*** shared version of the library, which you do not appear to have."                  echo "*** shared version of the library, which you do not appear to have"
2679                    echo "*** because I did check the linker path looking for a file starting"
2680                    if test -z "$potlib" ; then
2681                      echo "*** with $libname but no candidates were found. (...for regex pattern test)"
2682                    else
2683                      echo "*** with $libname and none of the candidates passed a file format test"
2684                      echo "*** using a regex pattern. Last file checked: $potlib"
2685                    fi
2686                fi                fi
2687              else              else
2688                # Add a -L argument.                # Add a -L argument.
# Line 1977  EOF Line 2693  EOF
2693          none | unknown | *)          none | unknown | *)
2694            newdeplibs=""            newdeplibs=""
2695            if $echo "X $deplibs" | $Xsed -e 's/ -lc$//' \            if $echo "X $deplibs" | $Xsed -e 's/ -lc$//' \
2696                 -e 's/ -[LR][^ ]*//g' -e 's/[    ]//g' |                 -e 's/ -[LR][^ ]*//g' -e 's/[    ]//g' |
2697               grep . >/dev/null; then               grep . >/dev/null; then
2698              echo              echo
2699              if test "X$deplibs_check_method" = "Xnone"; then              if test "X$deplibs_check_method" = "Xnone"; then
# Line 1996  EOF Line 2712  EOF
2712          libname=$libname_save          libname=$libname_save
2713          name=$name_save          name=$name_save
2714    
2715            case $host in
2716            *-*-rhapsody* | *-*-darwin1.[012])
2717              # On Rhapsody replace the C library is the System framework
2718              newdeplibs=`$echo "X $newdeplibs" | $Xsed -e 's/ -lc / -framework System /'`
2719              ;;
2720            esac
2721    
2722          if test "$droppeddeps" = yes; then          if test "$droppeddeps" = yes; then
2723            if test "$module" = yes; then            if test "$module" = yes; then
2724              echo              echo
2725              echo "*** Warning: libtool could not satisfy all declared inter-library"              echo "*** Warning: libtool could not satisfy all declared inter-library"
2726              echo "*** dependencies of module $libname.  Therefore, libtool will create"              echo "*** dependencies of module $libname.  Therefore, libtool will create"
2727              echo "*** a static module, that should work as long as the dlopening"              echo "*** a static module, that should work as long as the dlopening"
2728              echo "*** application is linked with the -dlopen flag."              echo "*** application is linked with the -dlopen flag."
2729              if test -z "$global_symbol_pipe"; then              if test -z "$global_symbol_pipe"; then
# Line 2021  EOF Line 2744  EOF
2744              echo "*** The inter-library dependencies that have been dropped here will be"              echo "*** The inter-library dependencies that have been dropped here will be"
2745              echo "*** automatically added whenever a program is linked with this library"              echo "*** automatically added whenever a program is linked with this library"
2746              echo "*** or is declared to -dlopen it."              echo "*** or is declared to -dlopen it."
2747    
2748                if test $allow_undefined = no; then
2749                  echo
2750                  echo "*** Since this library must not contain undefined symbols,"
2751                  echo "*** because either the platform does not support them or"
2752                  echo "*** it was explicitly requested with -no-undefined,"
2753                  echo "*** libtool will only create a static version of it."
2754                  if test "$build_old_libs" = no; then
2755                    oldlibs="$output_objdir/$libname.$libext"
2756                    build_libtool_libs=module
2757                    build_old_libs=yes
2758                  else
2759                    build_libtool_libs=no
2760                  fi
2761                fi
2762            fi            fi
2763          fi          fi
2764          # Done checking deplibs!          # Done checking deplibs!
# Line 2031  EOF Line 2769  EOF
2769        library_names=        library_names=
2770        old_library=        old_library=
2771        dlname=        dlname=
2772    
2773        # Test again, we may have decided not to build it any more        # Test again, we may have decided not to build it any more
2774        if test "$build_libtool_libs" = yes; then        if test "$build_libtool_libs" = yes; then
2775            if test $hardcode_into_libs = yes; then
2776              # Hardcode the library paths
2777              hardcode_libdirs=
2778              dep_rpath=
2779              rpath="$finalize_rpath"
2780              test "$mode" != relink && rpath="$compile_rpath$rpath"
2781              for libdir in $rpath; do
2782                if test -n "$hardcode_libdir_flag_spec"; then
2783                  if test -n "$hardcode_libdir_separator"; then
2784                    if test -z "$hardcode_libdirs"; then
2785                      hardcode_libdirs="$libdir"
2786                    else
2787                      # Just accumulate the unique libdirs.
2788                      case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in
2789                      *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*)
2790                        ;;
2791                      *)
2792                        hardcode_libdirs="$hardcode_libdirs$hardcode_libdir_separator$libdir"
2793                        ;;
2794                      esac
2795                    fi
2796                  else
2797                    eval flag=\"$hardcode_libdir_flag_spec\"
2798                    dep_rpath="$dep_rpath $flag"
2799                  fi
2800                elif test -n "$runpath_var"; then
2801                  case "$perm_rpath " in
2802                  *" $libdir "*) ;;
2803                  *) perm_rpath="$perm_rpath $libdir" ;;
2804                  esac
2805                fi
2806              done
2807              # Substitute the hardcoded libdirs into the rpath.
2808              if test -n "$hardcode_libdir_separator" &&
2809                 test -n "$hardcode_libdirs"; then
2810                libdir="$hardcode_libdirs"
2811                eval dep_rpath=\"$hardcode_libdir_flag_spec\"
2812              fi
2813              if test -n "$runpath_var" && test -n "$perm_rpath"; then
2814                # We should set the runpath_var.
2815                rpath=
2816                for dir in $perm_rpath; do
2817                  rpath="$rpath$dir:"
2818                done
2819                eval "$runpath_var='$rpath\$$runpath_var'; export $runpath_var"
2820              fi
2821              test -n "$dep_rpath" && deplibs="$dep_rpath $deplibs"
2822            fi
2823    
2824            shlibpath="$finalize_shlibpath"
2825            test "$mode" != relink && shlibpath="$compile_shlibpath$shlibpath"
2826            if test -n "$shlibpath"; then
2827              eval "$shlibpath_var='$shlibpath\$$shlibpath_var'; export $shlibpath_var"
2828            fi
2829    
2830          # Get the real and link names of the library.          # Get the real and link names of the library.
2831          eval library_names=\"$library_names_spec\"          eval library_names=\"$library_names_spec\"
2832          set dummy $library_names          set dummy $library_names
# Line 2045  EOF Line 2838  EOF
2838          else          else
2839            soname="$realname"            soname="$realname"
2840          fi          fi
2841            test -z "$dlname" && dlname=$soname
2842    
2843          lib="$output_objdir/$realname"          lib="$output_objdir/$realname"
2844          for link          for link
# Line 2079  EOF Line 2873  EOF
2873              export_symbols="$output_objdir/$libname.exp"              export_symbols="$output_objdir/$libname.exp"
2874              $run $rm $export_symbols              $run $rm $export_symbols
2875              eval cmds=\"$export_symbols_cmds\"              eval cmds=\"$export_symbols_cmds\"
2876              IFS="${IFS=         }"; save_ifs="$IFS"; IFS='~'              save_ifs="$IFS"; IFS='~'
2877              for cmd in $cmds; do              for cmd in $cmds; do
2878                IFS="$save_ifs"                IFS="$save_ifs"
2879                $show "$cmd"                $show "$cmd"
# Line 2116  EOF Line 2910  EOF
2910    
2911              for xlib in $convenience; do              for xlib in $convenience; do
2912                # Extract the objects.                # Extract the objects.
2913                case "$xlib" in                case $xlib in
2914                [\\/]* | [A-Za-z]:[\\/]*) xabs="$xlib" ;;                [\\/]* | [A-Za-z]:[\\/]*) xabs="$xlib" ;;
2915                *) xabs=`pwd`"/$xlib" ;;                *) xabs=`pwd`"/$xlib" ;;
2916                esac                esac
# Line 2141  EOF Line 2935  EOF
2935    
2936          if test "$thread_safe" = yes && test -n "$thread_safe_flag_spec"; then          if test "$thread_safe" = yes && test -n "$thread_safe_flag_spec"; then
2937            eval flag=\"$thread_safe_flag_spec\"            eval flag=\"$thread_safe_flag_spec\"
2938            linkopts="$linkopts $flag"            linker_flags="$linker_flags $flag"
2939            fi
2940    
2941            # Make a backup of the uninstalled library when relinking
2942            if test "$mode" = relink; then
2943              $run eval '(cd $output_objdir && $rm ${realname}U && $mv $realname ${realname}U)' || exit $?
2944          fi          fi
2945    
2946          # Do each of the archive commands.          # Do each of the archive commands.
2947          if test -n "$export_symbols" && test -n "$archive_expsym_cmds"; then          if test -n "$export_symbols" && test -n "$archive_expsym_cmds"; then
2948            eval cmds=\"$archive_expsym_cmds\"            eval cmds=\"$archive_expsym_cmds\"
2949          else          else
2950              save_deplibs="$deplibs"
2951              for conv in $convenience; do
2952                tmp_deplibs=
2953                for test_deplib in $deplibs; do
2954                  if test "$test_deplib" != "$conv"; then
2955                    tmp_deplibs="$tmp_deplibs $test_deplib"
2956                  fi
2957                done
2958                deplibs="$tmp_deplibs"
2959              done
2960            eval cmds=\"$archive_cmds\"            eval cmds=\"$archive_cmds\"
2961              deplibs="$save_deplibs"
2962          fi          fi
2963          IFS="${IFS=     }"; save_ifs="$IFS"; IFS='~'          save_ifs="$IFS"; IFS='~'
2964          for cmd in $cmds; do          for cmd in $cmds; do
2965            IFS="$save_ifs"            IFS="$save_ifs"
2966            $show "$cmd"            $show "$cmd"
# Line 2158  EOF Line 2968  EOF
2968          done          done
2969          IFS="$save_ifs"          IFS="$save_ifs"
2970    
2971            # Restore the uninstalled library and exit
2972            if test "$mode" = relink; then
2973              $run eval '(cd $output_objdir && $rm ${realname}T && $mv $realname ${realname}T && $mv "$realname"U $realname)' || exit $?
2974              exit 0
2975            fi
2976    
2977          # Create links to the real library.          # Create links to the real library.
2978          for linkname in $linknames; do          for linkname in $linknames; do
2979            if test "$realname" != "$linkname"; then            if test "$realname" != "$linkname"; then
# Line 2174  EOF Line 2990  EOF
2990        fi        fi
2991        ;;        ;;
2992    
2993      *.lo | *.o | *.obj)      obj)
       if test -n "$link_against_libtool_libs"; then  
         $echo "$modename: error: cannot link libtool libraries into objects" 1>&2  
         exit 1  
       fi  
   
2994        if test -n "$deplibs"; then        if test -n "$deplibs"; then
2995          $echo "$modename: warning: \`-l' and \`-L' are ignored for objects" 1>&2          $echo "$modename: warning: \`-l' and \`-L' are ignored for objects" 1>&2
2996        fi        fi
# Line 2204  EOF Line 3015  EOF
3015          $echo "$modename: warning: \`-release' is ignored for objects" 1>&2          $echo "$modename: warning: \`-release' is ignored for objects" 1>&2
3016        fi        fi
3017    
3018        case "$output" in        case $output in
3019        *.lo)        *.lo)
3020          if test -n "$objs"; then          if test -n "$objs$old_deplibs"; then
3021            $echo "$modename: cannot build library object \`$output' from non-libtool objects" 1>&2            $echo "$modename: cannot build library object \`$output' from non-libtool objects" 1>&2
3022            exit 1            exit 1
3023          fi          fi
# Line 2230  EOF Line 3041  EOF
3041        gentop=        gentop=
3042        # reload_cmds runs $LD directly, so let us get rid of        # reload_cmds runs $LD directly, so let us get rid of
3043        # -Wl from whole_archive_flag_spec        # -Wl from whole_archive_flag_spec
3044        wl=        wl=
3045    
3046        if test -n "$convenience"; then        if test -n "$convenience"; then
3047          if test -n "$whole_archive_flag_spec"; then          if test -n "$whole_archive_flag_spec"; then
# Line 2249  EOF Line 3060  EOF
3060    
3061            for xlib in $convenience; do            for xlib in $convenience; do
3062              # Extract the objects.              # Extract the objects.
3063              case "$xlib" in              case $xlib in
3064              [\\/]* | [A-Za-z]:[\\/]*) xabs="$xlib" ;;              [\\/]* | [A-Za-z]:[\\/]*) xabs="$xlib" ;;
3065              *) xabs=`pwd`"/$xlib" ;;              *) xabs=`pwd`"/$xlib" ;;
3066              esac              esac
# Line 2273  EOF Line 3084  EOF
3084        fi        fi
3085    
3086        # Create the old-style object.        # Create the old-style object.
3087        reload_objs="$objs "`$echo "X$libobjs" | $SP2NL | $Xsed -e '/\.'${libext}$'/d' -e '/\.lib$/d' -e "$lo2o" | $NL2SP`" $reload_conv_objs"        reload_objs="$objs$old_deplibs "`$echo "X$libobjs" | $SP2NL | $Xsed -e '/\.'${libext}$'/d' -e '/\.lib$/d' -e "$lo2o" | $NL2SP`" $reload_conv_objs" ### testsuite: skip nested quoting test
3088    
3089        output="$obj"        output="$obj"
3090        eval cmds=\"$reload_cmds\"        eval cmds=\"$reload_cmds\"
3091        IFS="${IFS=       }"; save_ifs="$IFS"; IFS='~'        save_ifs="$IFS"; IFS='~'
3092        for cmd in $cmds; do        for cmd in $cmds; do
3093          IFS="$save_ifs"          IFS="$save_ifs"
3094          $show "$cmd"          $show "$cmd"
# Line 2308  EOF Line 3119  EOF
3119          exit 0          exit 0
3120        fi        fi
3121    
3122        if test -n "$pic_flag"; then        if test -n "$pic_flag" || test "$pic_mode" != default; then
3123          # Only do commands if we really have different PIC objects.          # Only do commands if we really have different PIC objects.
3124          reload_objs="$libobjs $reload_conv_objs"          reload_objs="$libobjs $reload_conv_objs"
3125          output="$libobj"          output="$libobj"
3126          eval cmds=\"$reload_cmds\"          eval cmds=\"$reload_cmds\"
3127          IFS="${IFS=     }"; save_ifs="$IFS"; IFS='~'          save_ifs="$IFS"; IFS='~'
3128          for cmd in $cmds; do          for cmd in $cmds; do
3129            IFS="$save_ifs"            IFS="$save_ifs"
3130            $show "$cmd"            $show "$cmd"
# Line 2344  EOF Line 3155  EOF
3155        exit 0        exit 0
3156        ;;        ;;
3157    
3158      # Anything else should be a program.      prog)
3159      *)        case $host in
3160            *cygwin*) output=`echo $output | ${SED} -e 's,.exe$,,;s,$,.exe,'` ;;
3161          esac
3162        if test -n "$vinfo"; then        if test -n "$vinfo"; then
3163          $echo "$modename: warning: \`-version-info' is ignored for programs" 1>&2          $echo "$modename: warning: \`-version-info' is ignored for programs" 1>&2
3164        fi        fi
# Line 2355  EOF Line 3168  EOF
3168        fi        fi
3169    
3170        if test "$preload" = yes; then        if test "$preload" = yes; then
3171          if test "$dlopen" = unknown && test "$dlopen_self" = unknown &&          if test "$dlopen_support" = unknown && test "$dlopen_self" = unknown &&
3172             test "$dlopen_self_static" = unknown; then             test "$dlopen_self_static" = unknown; then
3173            $echo "$modename: warning: \`AC_LIBTOOL_DLOPEN' not used. Assuming no dlopen support."            $echo "$modename: warning: \`AC_LIBTOOL_DLOPEN' not used. Assuming no dlopen support."
3174          fi          fi
3175        fi        fi
3176    
3177          case $host in
3178          *-*-rhapsody* | *-*-darwin1.[012])
3179            # On Rhapsody replace the C library is the System framework
3180            compile_deplibs=`$echo "X $compile_deplibs" | $Xsed -e 's/ -lc / -framework System /'`
3181            finalize_deplibs=`$echo "X $finalize_deplibs" | $Xsed -e 's/ -lc / -framework System /'`
3182            case $host in
3183            *darwin*)
3184              # Don't allow lazy linking, it breaks C++ global constructors
3185              compile_command="$compile_command ${wl}-bind_at_load"
3186              finalize_command="$finalize_command ${wl}-bind_at_load"
3187              ;;
3188            esac
3189            ;;
3190          esac
3191    
3192          compile_command="$compile_command $compile_deplibs"
3193          finalize_command="$finalize_command $finalize_deplibs"
3194    
3195        if test -n "$rpath$xrpath"; then        if test -n "$rpath$xrpath"; then
3196          # If the user specified any rpath flags, then add them.          # If the user specified any rpath flags, then add them.
3197          for libdir in $rpath $xrpath; do          for libdir in $rpath $xrpath; do
3198            # This is the magic to use -rpath.            # This is the magic to use -rpath.
           case "$compile_rpath " in  
           *" $libdir "*) ;;  
           *) compile_rpath="$compile_rpath $libdir" ;;  
           esac  
3199            case "$finalize_rpath " in            case "$finalize_rpath " in
3200            *" $libdir "*) ;;            *" $libdir "*) ;;
3201            *) finalize_rpath="$finalize_rpath $libdir" ;;            *) finalize_rpath="$finalize_rpath $libdir" ;;
# Line 2386  EOF Line 3213  EOF
3213                hardcode_libdirs="$libdir"                hardcode_libdirs="$libdir"
3214              else              else
3215                # Just accumulate the unique libdirs.                # Just accumulate the unique libdirs.
3216                case "$hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator" in                case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in
3217                *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*)                *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*)
3218                  ;;                  ;;
3219                *)                *)
# Line 2404  EOF Line 3231  EOF
3231            *) perm_rpath="$perm_rpath $libdir" ;;            *) perm_rpath="$perm_rpath $libdir" ;;
3232            esac            esac
3233          fi          fi
3234            case $host in
3235            *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2*)
3236              case :$dllsearchpath: in
3237              *":$libdir:"*) ;;
3238              *) dllsearchpath="$dllsearchpath:$libdir";;
3239              esac
3240              ;;
3241            esac
3242        done        done
3243        # Substitute the hardcoded libdirs into the rpath.        # Substitute the hardcoded libdirs into the rpath.
3244        if test -n "$hardcode_libdir_separator" &&        if test -n "$hardcode_libdir_separator" &&
# Line 2422  EOF Line 3257  EOF
3257                hardcode_libdirs="$libdir"                hardcode_libdirs="$libdir"
3258              else              else
3259                # Just accumulate the unique libdirs.                # Just accumulate the unique libdirs.
3260                case "$hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator" in                case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in
3261                *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*)                *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*)
3262                  ;;                  ;;
3263                *)                *)
# Line 2449  EOF Line 3284  EOF
3284        fi        fi
3285        finalize_rpath="$rpath"        finalize_rpath="$rpath"
3286    
       output_objdir=`$echo "X$output" | $Xsed -e 's%/[^/]*$%%'`  
       if test "X$output_objdir" = "X$output"; then  
         output_objdir="$objdir"  
       else  
         output_objdir="$output_objdir/$objdir"  
       fi  
   
       # Create the binary in the object directory, then wrap it.  
       if test ! -d $output_objdir; then  
         $show "$mkdir $output_objdir"  
         $run $mkdir $output_objdir  
         status=$?  
         if test $status -ne 0 && test ! -d $output_objdir; then  
           exit $status  
         fi  
       fi  
   
3287        if test -n "$libobjs" && test "$build_old_libs" = yes; then        if test -n "$libobjs" && test "$build_old_libs" = yes; then
3288          # Transform all the library objects into standard objects.          # Transform all the library objects into standard objects.
3289          compile_command=`$echo "X$compile_command" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP`          compile_command=`$echo "X$compile_command" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP`
# Line 2482  EOF Line 3300  EOF
3300        fi        fi
3301    
3302        if test -n "$dlsyms"; then        if test -n "$dlsyms"; then
3303          case "$dlsyms" in          case $dlsyms in
3304          "") ;;          "") ;;
3305          *.c)          *.c)
3306            # Discover the nlist of each of the dlfiles.            # Discover the nlist of each of the dlfiles.
# Line 2514  extern \"C\" { Line 3332  extern \"C\" {
3332              test -z "$run" && $echo ': @PROGRAM@ ' > "$nlist"              test -z "$run" && $echo ': @PROGRAM@ ' > "$nlist"
3333    
3334              # Add our own program objects to the symbol list.              # Add our own program objects to the symbol list.
3335              progfiles=`$echo "X$objs" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP`              progfiles=`$echo "X$objs$old_deplibs" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP`
3336              for arg in $progfiles; do              for arg in $progfiles; do
3337                $show "extracting global C symbols from \`$arg'"                $show "extracting global C symbols from \`$arg'"
3338                $run eval "$NM $arg | $global_symbol_pipe >> '$nlist'"                $run eval "$NM $arg | $global_symbol_pipe >> '$nlist'"
# Line 2524  extern \"C\" { Line 3342  extern \"C\" {
3342                $run eval 'egrep -v " ($exclude_expsyms)$" "$nlist" > "$nlist"T'                $run eval 'egrep -v " ($exclude_expsyms)$" "$nlist" > "$nlist"T'
3343                $run eval '$mv "$nlist"T "$nlist"'                $run eval '$mv "$nlist"T "$nlist"'
3344              fi              fi
3345    
3346              if test -n "$export_symbols_regex"; then              if test -n "$export_symbols_regex"; then
3347                $run eval 'egrep -e "$export_symbols_regex" "$nlist" > "$nlist"T'                $run eval 'egrep -e "$export_symbols_regex" "$nlist" > "$nlist"T'
3348                $run eval '$mv "$nlist"T "$nlist"'                $run eval '$mv "$nlist"T "$nlist"'
# Line 2534  extern \"C\" { Line 3352  extern \"C\" {
3352              if test -z "$export_symbols"; then              if test -z "$export_symbols"; then
3353                export_symbols="$output_objdir/$output.exp"                export_symbols="$output_objdir/$output.exp"
3354                $run $rm $export_symbols                $run $rm $export_symbols
3355                $run eval "sed -n -e '/^: @PROGRAM@$/d' -e 's/^.* \(.*\)$/\1/p' "'< "$nlist" > "$export_symbols"'                $run eval "${SED} -n -e '/^: @PROGRAM@$/d' -e 's/^.* \(.*\)$/\1/p' "'< "$nlist" > "$export_symbols"'
3356              else              else
3357                $run eval "sed -e 's/\([][.*^$]\)/\\\1/g' -e 's/^/ /' -e 's/$/$/'"' < "$export_symbols" > "$output_objdir/$output.exp"'                $run eval "${SED} -e 's/\([][.*^$]\)/\\\1/g' -e 's/^/ /' -e 's/$/$/'"' < "$export_symbols" > "$output_objdir/$output.exp"'
3358                $run eval 'grep -f "$output_objdir/$output.exp" < "$nlist" > "$nlist"T'                $run eval 'grep -f "$output_objdir/$output.exp" < "$nlist" > "$nlist"T'
3359                $run eval 'mv "$nlist"T "$nlist"'                $run eval 'mv "$nlist"T "$nlist"'
3360              fi              fi
# Line 2544  extern \"C\" { Line 3362  extern \"C\" {
3362    
3363            for arg in $dlprefiles; do            for arg in $dlprefiles; do
3364              $show "extracting global C symbols from \`$arg'"              $show "extracting global C symbols from \`$arg'"
3365              name=`echo "$arg" | sed -e 's%^.*/%%'`              name=`echo "$arg" | ${SED} -e 's%^.*/%%'`
3366              $run eval 'echo ": $name " >> "$nlist"'              $run eval 'echo ": $name " >> "$nlist"'
3367              $run eval "$NM $arg | $global_symbol_pipe >> '$nlist'"              $run eval "$NM $arg | $global_symbol_pipe >> '$nlist'"
3368            done            done
# Line 2559  extern \"C\" { Line 3377  extern \"C\" {
3377              fi              fi
3378    
3379              # Try sorting and uniquifying the output.              # Try sorting and uniquifying the output.
3380              if grep -v "^: " < "$nlist" | sort +2 | uniq > "$nlist"S; then              if grep -v "^: " < "$nlist" |
3381                    if sort -k 3 </dev/null >/dev/null 2>&1; then
3382                      sort -k 3
3383                    else
3384                      sort +2
3385                    fi |
3386                    uniq > "$nlist"S; then
3387                :                :
3388              else              else
3389                grep -v "^: " < "$nlist" > "$nlist"S                grep -v "^: " < "$nlist" > "$nlist"S
# Line 2576  extern \"C\" { Line 3400  extern \"C\" {
3400  #undef lt_preloaded_symbols  #undef lt_preloaded_symbols
3401    
3402  #if defined (__STDC__) && __STDC__  #if defined (__STDC__) && __STDC__
3403  # define lt_ptr_t void *  # define lt_ptr void *
3404  #else  #else
3405  # define lt_ptr_t char *  # define lt_ptr char *
3406  # define const  # define const
3407  #endif  #endif
3408    
3409  /* The mapping between symbol names and symbols. */  /* The mapping between symbol names and symbols. */
3410  const struct {  const struct {
3411    const char *name;    const char *name;
3412    lt_ptr_t address;    lt_ptr address;
3413  }  }
3414  lt_preloaded_symbols[] =  lt_preloaded_symbols[] =
3415  {\  {\
3416  "  "
3417    
3418              sed -n -e 's/^: \([^ ]*\) $/  {\"\1\", (lt_ptr_t) 0},/p' \              eval "$global_symbol_to_c_name_address" < "$nlist" >> "$output_objdir/$dlsyms"
                 -e 's/^. \([^ ]*\) \([^ ]*\)$/  {"\2", (lt_ptr_t) \&\2},/p' \  
                   < "$nlist" >> "$output_objdir/$dlsyms"  
3419    
3420              $echo >> "$output_objdir/$dlsyms" "\              $echo >> "$output_objdir/$dlsyms" "\
3421    {0, (lt_ptr_t) 0}    {0, (lt_ptr) 0}
3422  };  };
3423    
3424  /* This works around a problem in FreeBSD linker */  /* This works around a problem in FreeBSD linker */
# Line 2613  static const void *lt_preloaded_setup() Line 3435  static const void *lt_preloaded_setup()
3435            fi            fi
3436    
3437            pic_flag_for_symtable=            pic_flag_for_symtable=
3438            case "$host" in            case $host in
3439            # compiling the symbol table file with pic_flag works around            # compiling the symbol table file with pic_flag works around
3440            # a FreeBSD bug that causes programs to crash when -lm is            # a FreeBSD bug that causes programs to crash when -lm is
3441            # linked before any other PIC object.  But we must not use            # linked before any other PIC object.  But we must not use
3442            # pic_flag when linking with -static.  The problem exists in            # pic_flag when linking with -static.  The problem exists in
3443            # FreeBSD 2.2.6 and is fixed in FreeBSD 3.1.            # FreeBSD 2.2.6 and is fixed in FreeBSD 3.1.
3444            *-*-freebsd2*|*-*-freebsd3.0*|*-*-freebsdelf3.0*)            *-*-freebsd2*|*-*-freebsd3.0*|*-*-freebsdelf3.0*)
3445              case "$compile_command " in              case "$compile_command " in
3446              *" -static "*) ;;              *" -static "*) ;;
3447              *) pic_flag_for_symtable=" $pic_flag -DPIC -DFREEBSD_WORKAROUND";;              *) pic_flag_for_symtable=" $pic_flag -DPIC -DFREEBSD_WORKAROUND";;
# Line 2658  static const void *lt_preloaded_setup() Line 3480  static const void *lt_preloaded_setup()
3480          finalize_command=`$echo "X$finalize_command" | $Xsed -e "s% @SYMFILE@%%"`          finalize_command=`$echo "X$finalize_command" | $Xsed -e "s% @SYMFILE@%%"`
3481        fi        fi
3482    
3483        if test -z "$link_against_libtool_libs" || test "$build_libtool_libs" != yes; then        if test $need_relink = no || test "$build_libtool_libs" != yes; then
3484          # Replace the output file specification.          # Replace the output file specification.
3485          compile_command=`$echo "X$compile_command" | $Xsed -e 's%@OUTPUT@%'"$output"'%g'`          compile_command=`$echo "X$compile_command" | $Xsed -e 's%@OUTPUT@%'"$output"'%g'`
3486          link_command="$compile_command$compile_rpath"          link_command="$compile_command$compile_rpath"
# Line 2667  static const void *lt_preloaded_setup() Line 3489  static const void *lt_preloaded_setup()
3489          $show "$link_command"          $show "$link_command"
3490          $run eval "$link_command"          $run eval "$link_command"
3491          status=$?          status=$?
3492    
3493          # Delete the generated files.          # Delete the generated files.
3494          if test -n "$dlsyms"; then          if test -n "$dlsyms"; then
3495            $show "$rm $output_objdir/${outputname}S.${objext}"            $show "$rm $output_objdir/${outputname}S.${objext}"
# Line 2681  static const void *lt_preloaded_setup() Line 3503  static const void *lt_preloaded_setup()
3503          # We should set the shlibpath_var          # We should set the shlibpath_var
3504          rpath=          rpath=
3505          for dir in $temp_rpath; do          for dir in $temp_rpath; do
3506            case "$dir" in            case $dir in
3507            [\\/]* | [A-Za-z]:[\\/]*)            [\\/]* | [A-Za-z]:[\\/]*)
3508              # Absolute path.              # Absolute path.
3509              rpath="$rpath$dir:"              rpath="$rpath$dir:"
# Line 2723  static const void *lt_preloaded_setup() Line 3545  static const void *lt_preloaded_setup()
3545          fi          fi
3546        fi        fi
3547    
3548          if test "$no_install" = yes; then
3549            # We don't need to create a wrapper script.
3550            link_command="$compile_var$compile_command$compile_rpath"
3551            # Replace the output file specification.
3552            link_command=`$echo "X$link_command" | $Xsed -e 's%@OUTPUT@%'"$output"'%g'`
3553            # Delete the old output file.
3554            $run $rm $output
3555            # Link the executable and exit
3556            $show "$link_command"
3557            $run eval "$link_command" || exit $?
3558            exit 0
3559          fi
3560    
3561        if test "$hardcode_action" = relink; then        if test "$hardcode_action" = relink; then
3562          # Fast installation is not supported          # Fast installation is not supported
3563          link_command="$compile_var$compile_command$compile_rpath"          link_command="$compile_var$compile_command$compile_rpath"
3564          relink_command="$finalize_var$finalize_command$finalize_rpath"          relink_command="$finalize_var$finalize_command$finalize_rpath"
3565    
3566          $echo "$modename: warning: this platform does not like uninstalled shared libraries" 1>&2          $echo "$modename: warning: this platform does not like uninstalled shared libraries" 1>&2
3567          $echo "$modename: \`$output' will be relinked during installation" 1>&2          $echo "$modename: \`$output' will be relinked during installation" 1>&2
3568        else        else
# Line 2747  static const void *lt_preloaded_setup() Line 3582  static const void *lt_preloaded_setup()
3582    
3583        # Replace the output file specification.        # Replace the output file specification.
3584        link_command=`$echo "X$link_command" | $Xsed -e 's%@OUTPUT@%'"$output_objdir/$outputname"'%g'`        link_command=`$echo "X$link_command" | $Xsed -e 's%@OUTPUT@%'"$output_objdir/$outputname"'%g'`
3585    
3586        # Delete the old output files.        # Delete the old output files.
3587        $run $rm $output $output_objdir/$outputname $output_objdir/lt-$outputname        $run $rm $output $output_objdir/$outputname $output_objdir/lt-$outputname
3588    
# Line 2759  static const void *lt_preloaded_setup() Line 3594  static const void *lt_preloaded_setup()
3594    
3595        # Quote the relink command for shipping.        # Quote the relink command for shipping.
3596        if test -n "$relink_command"; then        if test -n "$relink_command"; then
3597            # Preserve any variables that may affect compiler behavior
3598            for var in $variables_saved_for_relink; do
3599              if eval test -z \"\${$var+set}\"; then
3600                relink_command="{ test -z \"\${$var+set}\" || unset $var || { $var=; export $var; }; }; $relink_command"
3601              elif eval var_value=\$$var; test -z "$var_value"; then
3602                relink_command="$var=; export $var; $relink_command"
3603              else
3604                var_value=`$echo "X$var_value" | $Xsed -e "$sed_quote_subst"`
3605                relink_command="$var=\"$var_value\"; export $var; $relink_command"
3606              fi
3607            done
3608            relink_command="(cd `pwd`; $relink_command)"
3609          relink_command=`$echo "X$relink_command" | $Xsed -e "$sed_quote_subst"`          relink_command=`$echo "X$relink_command" | $Xsed -e "$sed_quote_subst"`
3610        fi        fi
3611    
3612        # Quote $echo for shipping.        # Quote $echo for shipping.
3613        if test "X$echo" = "X$SHELL $0 --fallback-echo"; then        if test "X$echo" = "X$SHELL $0 --fallback-echo"; then
3614          case "$0" in          case $0 in
3615          [\\/]* | [A-Za-z]:[\\/]*) qecho="$SHELL $0 --fallback-echo";;          [\\/]* | [A-Za-z]:[\\/]*) qecho="$SHELL $0 --fallback-echo";;
3616          *) qecho="$SHELL `pwd`/$0 --fallback-echo";;          *) qecho="$SHELL `pwd`/$0 --fallback-echo";;
3617          esac          esac
# Line 2778  static const void *lt_preloaded_setup() Line 3625  static const void *lt_preloaded_setup()
3625          # win32 will think the script is a binary if it has          # win32 will think the script is a binary if it has
3626          # a .exe suffix, so we strip it off here.          # a .exe suffix, so we strip it off here.
3627          case $output in          case $output in
3628            *.exe) output=`echo $output|sed 's,.exe$,,'` ;;            *.exe) output=`echo $output|${SED} 's,.exe$,,'` ;;
3629            esac
3630            # test for cygwin because mv fails w/o .exe extensions
3631            case $host in
3632              *cygwin*) exeext=.exe ;;
3633              *) exeext= ;;
3634          esac          esac
3635          $rm $output          $rm $output
3636          trap "$rm $output; exit 1" 1 2 15          trap "$rm $output; exit 1" 1 2 15
# Line 2797  static const void *lt_preloaded_setup() Line 3649  static const void *lt_preloaded_setup()
3649    
3650  # Sed substitution that helps us do robust quoting.  It backslashifies  # Sed substitution that helps us do robust quoting.  It backslashifies
3651  # metacharacters that are still active within double-quoted strings.  # metacharacters that are still active within double-quoted strings.
3652  Xsed='sed -e 1s/^X//'  Xsed="${SED}"' -e 1s/^X//'
3653  sed_quote_subst='$sed_quote_subst'  sed_quote_subst='$sed_quote_subst'
3654    
3655  # The HP-UX ksh and POSIX shell print the target directory to stdout  # The HP-UX ksh and POSIX shell print the target directory to stdout
# Line 2809  relink_command=\"$relink_command\" Line 3661  relink_command=\"$relink_command\"
3661  # This environment variable determines our operation mode.  # This environment variable determines our operation mode.
3662  if test \"\$libtool_install_magic\" = \"$magic\"; then  if test \"\$libtool_install_magic\" = \"$magic\"; then
3663    # install mode needs the following variable:    # install mode needs the following variable:
3664    link_against_libtool_libs='$link_against_libtool_libs'    notinst_deplibs='$notinst_deplibs'
3665  else  else
3666    # When we are sourced in execute mode, \$file and \$echo are already set.    # When we are sourced in execute mode, \$file and \$echo are already set.
3667    if test \"\$libtool_execute_magic\" != \"$magic\"; then    if test \"\$libtool_execute_magic\" != \"$magic\"; then
# Line 2835  else Line 3687  else
3687    test \"x\$thisdir\" = \"x\$file\" && thisdir=.    test \"x\$thisdir\" = \"x\$file\" && thisdir=.
3688    
3689    # Follow symbolic links until we get to the real thisdir.    # Follow symbolic links until we get to the real thisdir.
3690    file=\`ls -ld \"\$file\" | sed -n 's/.*-> //p'\`    file=\`ls -ld \"\$file\" | ${SED} -n 's/.*-> //p'\`
3691    while test -n \"\$file\"; do    while test -n \"\$file\"; do
3692      destdir=\`\$echo \"X\$file\" | \$Xsed -e 's%/[^/]*\$%%'\`      destdir=\`\$echo \"X\$file\" | \$Xsed -e 's%/[^/]*\$%%'\`
3693    
3694      # If there was a directory component, then change thisdir.      # If there was a directory component, then change thisdir.
3695      if test \"x\$destdir\" != \"x\$file\"; then      if test \"x\$destdir\" != \"x\$file\"; then
3696        case \"\$destdir\" in        case \"\$destdir\" in
3697        [\\/]* | [A-Za-z]:[\\/]*) thisdir=\"\$destdir\" ;;        [\\\\/]* | [A-Za-z]:[\\\\/]*) thisdir=\"\$destdir\" ;;
3698        *) thisdir=\"\$thisdir/\$destdir\" ;;        *) thisdir=\"\$thisdir/\$destdir\" ;;
3699        esac        esac
3700      fi      fi
3701    
3702      file=\`\$echo \"X\$file\" | \$Xsed -e 's%^.*/%%'\`      file=\`\$echo \"X\$file\" | \$Xsed -e 's%^.*/%%'\`
3703      file=\`ls -ld \"\$thisdir/\$file\" | sed -n 's/.*-> //p'\`      file=\`ls -ld \"\$thisdir/\$file\" | ${SED} -n 's/.*-> //p'\`
3704    done    done
3705    
3706    # Try to get the absolute directory name.    # Try to get the absolute directory name.
# Line 2858  else Line 3710  else
3710    
3711          if test "$fast_install" = yes; then          if test "$fast_install" = yes; then
3712            echo >> $output "\            echo >> $output "\
3713    program=lt-'$outputname'    program=lt-'$outputname'$exeext
3714    progdir=\"\$thisdir/$objdir\"    progdir=\"\$thisdir/$objdir\"
3715    
3716    if test ! -f \"\$progdir/\$program\" || \\    if test ! -f \"\$progdir/\$program\" || \\
3717       { file=\`ls -1dt \"\$progdir/\$program\" \"\$progdir/../\$program\" 2>/dev/null | sed 1q\`; \\       { file=\`ls -1dt \"\$progdir/\$program\" \"\$progdir/../\$program\" 2>/dev/null | ${SED} 1q\`; \\
3718         test \"X\$file\" != \"X\$progdir/\$program\"; }; then         test \"X\$file\" != \"X\$progdir/\$program\"; }; then
3719    
3720      file=\"\$\$-\$program\"      file=\"\$\$-\$program\"
# Line 2877  else Line 3729  else
3729    
3730      # relink executable if necessary      # relink executable if necessary
3731      if test -n \"\$relink_command\"; then      if test -n \"\$relink_command\"; then
3732        if (cd \"\$thisdir\" && eval \$relink_command); then :        if relink_command_output=\`eval \$relink_command 2>&1\`; then :
3733        else        else
3734            $echo \"\$relink_command_output\" >&2
3735          $rm \"\$progdir/\$file\"          $rm \"\$progdir/\$file\"
3736          exit 1          exit 1
3737        fi        fi
# Line 2907  else Line 3760  else
3760      $shlibpath_var=\"$temp_rpath\$$shlibpath_var\"      $shlibpath_var=\"$temp_rpath\$$shlibpath_var\"
3761    
3762      # Some systems cannot cope with colon-terminated $shlibpath_var      # Some systems cannot cope with colon-terminated $shlibpath_var
3763      # The second colon is a workaround for a bug in BeOS R4 sed      # The second colon is a workaround for a bug in BeOS R4 ${SED}
3764      $shlibpath_var=\`\$echo \"X\$$shlibpath_var\" | \$Xsed -e 's/::*\$//'\`      $shlibpath_var=\`\$echo \"X\$$shlibpath_var\" | \$Xsed -e 's/::*\$//'\`
3765    
3766      export $shlibpath_var      export $shlibpath_var
# Line 2927  else Line 3780  else
3780        # Run the actual program with our arguments.        # Run the actual program with our arguments.
3781  "  "
3782          case $host in          case $host in
3783          *-*-cygwin* | *-*-mingw | *-*-os2*)          # win32 systems need to use the prog path for dll
3784            # win32 systems need to use the prog path for dll          # lookup to work
3785            # lookup to work          *-*-cygwin* | *-*-pw32*)
3786              $echo >> $output "\
3787          exec \$progdir/\$program \${1+\"\$@\"}
3788    "
3789              ;;
3790    
3791            # Backslashes separate directories on plain windows
3792            *-*-mingw | *-*-os2*)
3793            $echo >> $output "\            $echo >> $output "\
3794        exec \$progdir\\\\\$program \${1+\"\$@\"}        exec \$progdir\\\\\$program \${1+\"\$@\"}
3795  "  "
3796            ;;            ;;
3797    
3798          *)          *)
3799            $echo >> $output "\            $echo >> $output "\
3800        # Export the path to the program.        # Export the path to the program.
# Line 2975  fi\ Line 3836  fi\
3836            oldobjs="$libobjs_save"            oldobjs="$libobjs_save"
3837            build_libtool_libs=no            build_libtool_libs=no
3838          else          else
3839            oldobjs="$objs "`$echo "X$libobjs_save" | $SP2NL | $Xsed -e '/\.'${libext}'$/d' -e '/\.lib$/d' -e "$lo2o" | $NL2SP`            oldobjs="$objs$old_deplibs "`$echo "X$libobjs_save" | $SP2NL | $Xsed -e '/\.'${libext}'$/d' -e '/\.lib$/d' -e "$lo2o" | $NL2SP`
3840          fi          fi
3841          addlibs="$old_convenience"          addlibs="$old_convenience"
3842        fi        fi
# Line 2991  fi\ Line 3852  fi\
3852            exit $status            exit $status
3853          fi          fi
3854          generated="$generated $gentop"          generated="$generated $gentop"
3855    
3856          # Add in members from convenience archives.          # Add in members from convenience archives.
3857          for xlib in $addlibs; do          for xlib in $addlibs; do
3858            # Extract the objects.            # Extract the objects.
3859            case "$xlib" in            case $xlib in
3860            [\\/]* | [A-Za-z]:[\\/]*) xabs="$xlib" ;;            [\\/]* | [A-Za-z]:[\\/]*) xabs="$xlib" ;;
3861            *) xabs=`pwd`"/$xlib" ;;            *) xabs=`pwd`"/$xlib" ;;
3862            esac            esac
# Line 3041  fi\ Line 3902  fi\
3902    
3903          eval cmds=\"$old_archive_cmds\"          eval cmds=\"$old_archive_cmds\"
3904        fi        fi
3905        IFS="${IFS=       }"; save_ifs="$IFS"; IFS='~'        save_ifs="$IFS"; IFS='~'
3906        for cmd in $cmds; do        for cmd in $cmds; do
3907          IFS="$save_ifs"          IFS="$save_ifs"
3908          $show "$cmd"          $show "$cmd"
# Line 3056  fi\ Line 3917  fi\
3917      fi      fi
3918    
3919      # Now create the libtool archive.      # Now create the libtool archive.
3920      case "$output" in      case $output in
3921      *.la)      *.la)
3922        old_library=        old_library=
3923        test "$build_old_libs" = yes && old_library="$libname.$libext"        test "$build_old_libs" = yes && old_library="$libname.$libext"
3924        $show "creating $output"        $show "creating $output"
3925    
3926        if test -n "$xrpath"; then        # Preserve any variables that may affect compiler behavior
3927          temp_xrpath=        for var in $variables_saved_for_relink; do
3928          for libdir in $xrpath; do          if eval test -z \"\${$var+set}\"; then
3929            temp_xrpath="$temp_xrpath -R$libdir"            relink_command="{ test -z \"\${$var+set}\" || unset $var || { $var=; export $var; }; }; $relink_command"
3930          done          elif eval var_value=\$$var; test -z "$var_value"; then
3931          dependency_libs="$temp_xrpath $dependency_libs"            relink_command="$var=; export $var; $relink_command"
3932        fi          else
3933              var_value=`$echo "X$var_value" | $Xsed -e "$sed_quote_subst"`
3934              relink_command="$var=\"$var_value\"; export $var; $relink_command"
3935            fi
3936          done
3937          # Quote the link command for shipping.
3938          relink_command="(cd `pwd`; $SHELL $0 --mode=relink $libtool_args)"
3939          relink_command=`$echo "X$relink_command" | $Xsed -e "$sed_quote_subst"`
3940    
3941        # Only create the output if not a dry run.        # Only create the output if not a dry run.
3942        if test -z "$run"; then        if test -z "$run"; then
# Line 3078  fi\ Line 3946  fi\
3946                break                break
3947              fi              fi
3948              output="$output_objdir/$outputname"i              output="$output_objdir/$outputname"i
3949                # Replace all uninstalled libtool libraries with the installed ones
3950                newdependency_libs=
3951                for deplib in $dependency_libs; do
3952                  case $deplib in
3953                  *.la)
3954                    name=`$echo "X$deplib" | $Xsed -e 's%^.*/%%'`
3955                    eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $deplib`
3956                    if test -z "$libdir"; then
3957                      $echo "$modename: \`$deplib' is not a valid libtool archive" 1>&2
3958                      exit 1
3959                    fi
3960                    newdependency_libs="$newdependency_libs $libdir/$name"
3961                    ;;
3962                  *) newdependency_libs="$newdependency_libs $deplib" ;;
3963                  esac
3964                done
3965                dependency_libs="$newdependency_libs"
3966                newdlfiles=
3967                for lib in $dlfiles; do
3968                  name=`$echo "X$lib" | $Xsed -e 's%^.*/%%'`
3969                  eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $lib`
3970                  if test -z "$libdir"; then
3971                    $echo "$modename: \`$lib' is not a valid libtool archive" 1>&2
3972                    exit 1
3973                  fi
3974                  newdlfiles="$newdlfiles $libdir/$name"
3975                done
3976                dlfiles="$newdlfiles"
3977                newdlprefiles=
3978                for lib in $dlprefiles; do
3979                  name=`$echo "X$lib" | $Xsed -e 's%^.*/%%'`
3980                  eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $lib`
3981                  if test -z "$libdir"; then
3982                    $echo "$modename: \`$lib' is not a valid libtool archive" 1>&2
3983                    exit 1
3984                  fi
3985                  newdlprefiles="$newdlprefiles $libdir/$name"
3986                done
3987                dlprefiles="$newdlprefiles"
3988            fi            fi
3989            $rm $output            $rm $output
3990              # place dlname in correct position for cygwin
3991              tdlname=$dlname
3992              case $host,$output,$installed,$module,$dlname in
3993                *cygwin*,*lai,yes,no,*.dll) tdlname=../bin/$dlname ;;
3994              esac
3995            $echo > $output "\            $echo > $output "\
3996  # $outputname - a libtool library file  # $outputname - a libtool library file
3997  # Generated by $PROGRAM - GNU $PACKAGE $VERSION$TIMESTAMP  # Generated by $PROGRAM - GNU $PACKAGE $VERSION$TIMESTAMP
# Line 3088  fi\ Line 4000  fi\
4000  # It is necessary for linking the library.  # It is necessary for linking the library.
4001    
4002  # The name that we can dlopen(3).  # The name that we can dlopen(3).
4003  dlname='$dlname'  dlname='$tdlname'
4004    
4005  # Names of this library.  # Names of this library.
4006  library_names='$library_names'  library_names='$library_names'
# Line 3107  revision=$revision Line 4019  revision=$revision
4019  # Is this an already installed library?  # Is this an already installed library?
4020  installed=$installed  installed=$installed
4021    
4022    # Files to dlopen/dlpreopen
4023    dlopen='$dlfiles'
4024    dlpreopen='$dlprefiles'
4025    
4026  # Directory that this library needs to be installed in:  # Directory that this library needs to be installed in:
4027  libdir='$install_libdir'\  libdir='$install_libdir'"
4028  "            if test "$installed" = no && test $need_relink = yes; then
4029                $echo >> $output "\
4030    relink_command=\"$relink_command\""
4031              fi
4032          done          done
4033        fi        fi
4034    
4035        # Do a symbolic link so that the libtool archive can be found in        # Do a symbolic link so that the libtool archive can be found in
4036        # LD_LIBRARY_PATH before the program is installed.        # LD_LIBRARY_PATH before the program is installed.
4037        $show "(cd $output_objdir && $rm $outputname && $LN_S ../$outputname $outputname)"        $show "(cd $output_objdir && $rm $outputname && $LN_S ../$outputname $outputname)"
4038        $run eval "(cd $output_objdir && $rm $outputname && $LN_S ../$outputname $outputname)" || exit $?        $run eval '(cd $output_objdir && $rm $outputname && $LN_S ../$outputname $outputname)' || exit $?
4039        ;;        ;;
4040      esac      esac
4041      exit 0      exit 0
# Line 3128  libdir='$install_libdir'\ Line 4047  libdir='$install_libdir'\
4047    
4048      # There may be an optional sh(1) argument at the beginning of      # There may be an optional sh(1) argument at the beginning of
4049      # install_prog (especially on Windows NT).      # install_prog (especially on Windows NT).
4050      if test "$nonopt" = "$SHELL" || test "$nonopt" = /bin/sh; then      if test "$nonopt" = "$SHELL" || test "$nonopt" = /bin/sh ||
4051           # Allow the use of GNU shtool's install command.
4052           $echo "X$nonopt" | $Xsed | grep shtool > /dev/null; then
4053        # Aesthetically quote it.        # Aesthetically quote it.
4054        arg=`$echo "X$nonopt" | $Xsed -e "$sed_quote_subst"`        arg=`$echo "X$nonopt" | $Xsed -e "$sed_quote_subst"`
4055        case "$arg" in        case $arg in
4056        *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \     ]*|*]*)        *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \     ]*|*]*)
4057          arg="\"$arg\""          arg="\"$arg\""
4058          ;;          ;;
# Line 3147  libdir='$install_libdir'\ Line 4068  libdir='$install_libdir'\
4068      # The real first argument should be the name of the installation program.      # The real first argument should be the name of the installation program.
4069      # Aesthetically quote it.      # Aesthetically quote it.
4070      arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`      arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`
4071      case "$arg" in      case $arg in
4072      *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \       ]*|*]*)      *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \       ]*|*]*)
4073        arg="\"$arg\""        arg="\"$arg\""
4074        ;;        ;;
# Line 3170  libdir='$install_libdir'\ Line 4091  libdir='$install_libdir'\
4091          continue          continue
4092        fi        fi
4093    
4094        case "$arg" in        case $arg in
4095        -d) isdir=yes ;;        -d) isdir=yes ;;
4096        -f) prev="-f" ;;        -f) prev="-f" ;;
4097        -g) prev="-g" ;;        -g) prev="-g" ;;
# Line 3195  libdir='$install_libdir'\ Line 4116  libdir='$install_libdir'\
4116    
4117        # Aesthetically quote the argument.        # Aesthetically quote the argument.
4118        arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`        arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`
4119        case "$arg" in        case $arg in
4120        *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \     ]*|*]*)        *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \     ]*|*]*)
4121          arg="\"$arg\""          arg="\"$arg\""
4122          ;;          ;;
# Line 3246  libdir='$install_libdir'\ Line 4167  libdir='$install_libdir'\
4167          exit 1          exit 1
4168        fi        fi
4169      fi      fi
4170      case "$destdir" in      case $destdir in
4171      [\\/]* | [A-Za-z]:[\\/]*) ;;      [\\/]* | [A-Za-z]:[\\/]*) ;;
4172      *)      *)
4173        for file in $files; do        for file in $files; do
4174          case "$file" in          case $file in
4175          *.lo) ;;          *.lo) ;;
4176          *)          *)
4177            $echo "$modename: \`$destdir' must be an absolute directory name" 1>&2            $echo "$modename: \`$destdir' must be an absolute directory name" 1>&2
# Line 3272  libdir='$install_libdir'\ Line 4193  libdir='$install_libdir'\
4193      for file in $files; do      for file in $files; do
4194    
4195        # Do each installation.        # Do each installation.
4196        case "$file" in        case $file in
4197        *.a | *.lib)        *.$libext)
4198          # Do the static libraries later.          # Do the static libraries later.
4199          staticlibs="$staticlibs $file"          staticlibs="$staticlibs $file"
4200          ;;          ;;
4201    
4202        *.la)        *.la)
4203          # Check to see that this really is a libtool archive.          # Check to see that this really is a libtool archive.
4204          if (sed -e '2q' $file | egrep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then :          if (${SED} -e '2q' $file | egrep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then :
4205          else          else
4206            $echo "$modename: \`$file' is not a valid libtool archive" 1>&2            $echo "$modename: \`$file' is not a valid libtool archive" 1>&2
4207            $echo "$help" 1>&2            $echo "$help" 1>&2
# Line 3289  libdir='$install_libdir'\ Line 4210  libdir='$install_libdir'\
4210    
4211          library_names=          library_names=
4212          old_library=          old_library=
4213            relink_command=
4214          # If there is no directory component, then add one.          # If there is no directory component, then add one.
4215          case "$file" in          case $file in
4216          */* | *\\*) . $file ;;          */* | *\\*) . $file ;;
4217          *) . ./$file ;;          *) . ./$file ;;
4218          esac          esac
# Line 3309  libdir='$install_libdir'\ Line 4231  libdir='$install_libdir'\
4231            esac            esac
4232          fi          fi
4233    
4234          dir="`$echo "X$file" | $Xsed -e 's%/[^/]*$%%'`/"          dir=`$echo "X$file" | $Xsed -e 's%/[^/]*$%%'`/
4235          test "X$dir" = "X$file/" && dir=          test "X$dir" = "X$file/" && dir=
4236          dir="$dir$objdir"          dir="$dir$objdir"
4237    
4238            if test -n "$relink_command"; then
4239              $echo "$modename: warning: relinking \`$file'" 1>&2
4240              $show "$relink_command"
4241              if $run eval "$relink_command"; then :
4242              else
4243                $echo "$modename: error: relink \`$file' with the above command before installing it" 1>&2
4244                continue
4245              fi
4246            fi
4247    
4248          # See the names of the shared library.          # See the names of the shared library.
4249          set dummy $library_names          set dummy $library_names
4250          if test -n "$2"; then          if test -n "$2"; then
# Line 3320  libdir='$install_libdir'\ Line 4252  libdir='$install_libdir'\
4252            shift            shift
4253            shift            shift
4254    
4255              srcname="$realname"
4256              test -n "$relink_command" && srcname="$realname"T
4257    
4258            # Install the shared library and build the symlinks.            # Install the shared library and build the symlinks.
4259            $show "$install_prog $dir/$realname $destdir/$realname"            $show "$install_prog $dir/$srcname $destdir/$realname"
4260            $run eval "$install_prog $dir/$realname $destdir/$realname" || exit $?            $run eval "$install_prog $dir/$srcname $destdir/$realname" || exit $?
4261              if test -n "$stripme" && test -n "$striplib"; then
4262                $show "$striplib $destdir/$realname"
4263                $run eval "$striplib $destdir/$realname" || exit $?
4264              fi
4265    
4266            if test $# -gt 0; then            if test $# -gt 0; then
4267              # Delete the old symlinks, and create new ones.              # Delete the old symlinks, and create new ones.
# Line 3338  libdir='$install_libdir'\ Line 4277  libdir='$install_libdir'\
4277            # Do each command in the postinstall commands.            # Do each command in the postinstall commands.
4278            lib="$destdir/$realname"            lib="$destdir/$realname"
4279            eval cmds=\"$postinstall_cmds\"            eval cmds=\"$postinstall_cmds\"
4280            IFS="${IFS=   }"; save_ifs="$IFS"; IFS='~'            save_ifs="$IFS"; IFS='~'
4281            for cmd in $cmds; do            for cmd in $cmds; do
4282              IFS="$save_ifs"              IFS="$save_ifs"
4283              $show "$cmd"              $show "$cmd"
# Line 3369  libdir='$install_libdir'\ Line 4308  libdir='$install_libdir'\
4308          fi          fi
4309    
4310          # Deduce the name of the destination old-style object file.          # Deduce the name of the destination old-style object file.
4311          case "$destfile" in          case $destfile in
4312          *.lo)          *.lo)
4313            staticdest=`$echo "X$destfile" | $Xsed -e "$lo2o"`            staticdest=`$echo "X$destfile" | $Xsed -e "$lo2o"`
4314            ;;            ;;
4315          *.o | *.obj)          *.$objext)
4316            staticdest="$destfile"            staticdest="$destfile"
4317            destfile=            destfile=
4318            ;;            ;;
# Line 3411  libdir='$install_libdir'\ Line 4350  libdir='$install_libdir'\
4350          fi          fi
4351    
4352          # Do a test to see if this is really a libtool program.          # Do a test to see if this is really a libtool program.
4353          if (sed -e '4q' $file | egrep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then          case $host in
4354            link_against_libtool_libs=          *cygwin*|*mingw*)
4355                wrapper=`echo $file | ${SED} -e 's,.exe$,,'`
4356                ;;
4357            *)
4358                wrapper=$file
4359                ;;
4360            esac
4361            if (${SED} -e '4q' $wrapper | egrep "^# Generated by .*$PACKAGE")>/dev/null 2>&1; then
4362              notinst_deplibs=
4363            relink_command=            relink_command=
4364    
4365            # If there is no directory component, then add one.            # If there is no directory component, then add one.
4366            case "$file" in            case $file in
4367            */* | *\\*) . $file ;;            */* | *\\*) . $wrapper ;;
4368            *) . ./$file ;;            *) . ./$wrapper ;;
4369            esac            esac
4370    
4371            # Check the variables that should have been set.            # Check the variables that should have been set.
4372            if test -z "$link_against_libtool_libs"; then            if test -z "$notinst_deplibs"; then
4373              $echo "$modename: invalid libtool wrapper script \`$file'" 1>&2              $echo "$modename: invalid libtool wrapper script \`$wrapper'" 1>&2
4374              exit 1              exit 1
4375            fi            fi
4376    
4377            finalize=yes            finalize=yes
4378            for lib in $link_against_libtool_libs; do            for lib in $notinst_deplibs; do
4379              # Check to see that each library is installed.              # Check to see that each library is installed.
4380              libdir=              libdir=
4381              if test -f "$lib"; then              if test -f "$lib"; then
4382                # If there is no directory component, then add one.                # If there is no directory component, then add one.
4383                case "$lib" in                case $lib in
4384                */* | *\\*) . $lib ;;                */* | *\\*) . $lib ;;
4385                *) . ./$lib ;;                *) . ./$lib ;;
4386                esac                esac
4387              fi              fi
4388              libfile="$libdir/`$echo "X$lib" | $Xsed -e 's%^.*/%%g'`"              libfile="$libdir/"`$echo "X$lib" | $Xsed -e 's%^.*/%%g'` ### testsuite: skip nested quoting test
4389              if test -n "$libdir" && test ! -f "$libfile"; then              if test -n "$libdir" && test ! -f "$libfile"; then
4390                $echo "$modename: warning: \`$lib' has not been installed in \`$libdir'" 1>&2                $echo "$modename: warning: \`$lib' has not been installed in \`$libdir'" 1>&2
4391                finalize=no                finalize=no
4392              fi              fi
4393            done            done
4394    
4395              relink_command=
4396              # If there is no directory component, then add one.
4397              case $file in
4398              */* | *\\*) . $wrapper ;;
4399              *) . ./$wrapper ;;
4400              esac
4401    
4402            outputname=            outputname=
4403            if test "$fast_install" = no && test -n "$relink_command"; then            if test "$fast_install" = no && test -n "$relink_command"; then
4404              if test "$finalize" = yes && test -z "$run"; then              if test "$finalize" = yes && test -z "$run"; then
# Line 3456  libdir='$install_libdir'\ Line 4410  libdir='$install_libdir'\
4410                  $echo "$modename: error: cannot create temporary directory \`$tmpdir'" 1>&2                  $echo "$modename: error: cannot create temporary directory \`$tmpdir'" 1>&2
4411                  continue                  continue
4412                fi                fi
4413                  file=`$echo "X$file" | $Xsed -e 's%^.*/%%'`
4414                outputname="$tmpdir/$file"                outputname="$tmpdir/$file"
4415                # Replace the output file specification.                # Replace the output file specification.
4416                relink_command=`$echo "X$relink_command" | $Xsed -e 's%@OUTPUT@%'"$outputname"'%g'`                relink_command=`$echo "X$relink_command" | $Xsed -e 's%@OUTPUT@%'"$outputname"'%g'`
# Line 3477  libdir='$install_libdir'\ Line 4432  libdir='$install_libdir'\
4432            fi            fi
4433          fi          fi
4434    
4435            # remove .exe since cygwin /usr/bin/install will append another
4436            # one anyways
4437            case $install_prog,$host in
4438            /usr/bin/install*,*cygwin*)
4439              case $file:$destfile in
4440              *.exe:*.exe)
4441                # this is ok
4442                ;;
4443              *.exe:*)
4444                destfile=$destfile.exe
4445                ;;
4446              *:*.exe)
4447                destfile=`echo $destfile | ${SED} -e 's,.exe$,,'`
4448                ;;
4449              esac
4450              ;;
4451            esac
4452          $show "$install_prog$stripme $file $destfile"          $show "$install_prog$stripme $file $destfile"
4453          $run eval "$install_prog\$stripme \$file \$destfile" || exit $?          $run eval "$install_prog\$stripme \$file \$destfile" || exit $?
4454          test -n "$outputname" && ${rm}r "$tmpdir"          test -n "$outputname" && ${rm}r "$tmpdir"
# Line 3493  libdir='$install_libdir'\ Line 4465  libdir='$install_libdir'\
4465        $show "$install_prog $file $oldlib"        $show "$install_prog $file $oldlib"
4466        $run eval "$install_prog \$file \$oldlib" || exit $?        $run eval "$install_prog \$file \$oldlib" || exit $?
4467    
4468          if test -n "$stripme" && test -n "$striplib"; then
4469            $show "$old_striplib $oldlib"
4470            $run eval "$old_striplib $oldlib" || exit $?
4471          fi
4472    
4473        # Do each command in the postinstall commands.        # Do each command in the postinstall commands.
4474        eval cmds=\"$old_postinstall_cmds\"        eval cmds=\"$old_postinstall_cmds\"
4475        IFS="${IFS=       }"; save_ifs="$IFS"; IFS='~'        save_ifs="$IFS"; IFS='~'
4476        for cmd in $cmds; do        for cmd in $cmds; do
4477          IFS="$save_ifs"          IFS="$save_ifs"
4478          $show "$cmd"          $show "$cmd"
# Line 3511  libdir='$install_libdir'\ Line 4488  libdir='$install_libdir'\
4488      if test -n "$current_libdirs"; then      if test -n "$current_libdirs"; then
4489        # Maybe just do a dry run.        # Maybe just do a dry run.
4490        test -n "$run" && current_libdirs=" -n$current_libdirs"        test -n "$run" && current_libdirs=" -n$current_libdirs"
4491        exec $SHELL $0 --finish$current_libdirs        exec_cmd='$SHELL $0 --finish$current_libdirs'
4492        exit 1      else
4493          exit 0
4494      fi      fi
   
     exit 0  
4495      ;;      ;;
4496    
4497    # libtool finish mode    # libtool finish mode
# Line 3534  libdir='$install_libdir'\