Difference for utils/ltmain.sh from version 1.2 to 1.3


version 1.2 version 1.3
Line 49
 
Line 49
 fi  fi
   
 # The name of this program.  # The name of this program.
 progname=`$echo "$0" | ${SED} 's%^.*/%%'`  progname=`$echo "$0" | sed 's%^.*/%%'`
 modename="$progname"  modename="$progname"
   
 # Constants.  # Constants.
 PROGRAM=ltmain.sh  PROGRAM=ltmain.sh
 PACKAGE=libtool  PACKAGE=libtool
 VERSION=1.4.3  VERSION=1.4.2
 TIMESTAMP=" (1.922.2.110 2002/10/23 01:39:54)"  TIMESTAMP=" (1.922.2.54 2001/09/11 03:33:37)"
   
 default_mode=  default_mode=
 help="Try \`$progname --help' for more information."  help="Try \`$progname --help' for more information."
Line 67
 
Line 67
   
 # Sed substitution that helps us do robust quoting.  It backslashifies  # Sed substitution that helps us do robust quoting.  It backslashifies
 # metacharacters that are still active within double-quoted strings.  # metacharacters that are still active within double-quoted strings.
 Xsed="${SED}"' -e 1s/^X//'  Xsed='sed -e 1s/^X//'
 sed_quote_subst='s/\([\\`\\"$\\\\]\)/\\\1/g'  sed_quote_subst='s/\([\\`\\"$\\\\]\)/\\\1/g'
 # test EBCDIC or ASCII                                                           SP2NL='tr \040 \012'
 case `echo A|od -x` in                                                           NL2SP='tr \015\012 \040\040'
  *[Cc]1*) # EBCDIC based system                                                  
   SP2NL="tr '\100' '\n'"                                                         
   NL2SP="tr '\r\n' '\100\100'"                                                   
   ;;                                                                             
  *) # Assume ASCII based system                                                  
   SP2NL="tr '\040' '\012'"                                                       
   NL2SP="tr '\015\012' '\040\040'"                                               
   ;;                                                                             
 esac                                                                             
   
 # NLS nuisances.  # NLS nuisances.
 # Only set LANG and LC_ALL to C if already set.  # Only set LANG and LC_ALL to C if already set.
Line 153
 
Line 144
     ;;      ;;
   
   --config)    --config)
     ${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
     exit 0      exit 0
     ;;      ;;
   
Line 226
 
Line 217
   # Infer the operation mode.    # Infer the operation mode.
   if test -z "$mode"; then    if test -z "$mode"; then
     case $nonopt in      case $nonopt in
     *cc | *++ | gcc* | *-gcc* | xlc*)      *cc | *++ | gcc* | *-gcc*)
       mode=link        mode=link
       for arg        for arg
       do        do
Line 768
 
Line 759
     linker_flags=      linker_flags=
     dllsearchpath=      dllsearchpath=
     lib_search_path=`pwd`      lib_search_path=`pwd`
       inst_prefix_dir=
   
     avoid_version=no      avoid_version=no
     dlfiles=      dlfiles=
Line 898
 
Line 890
    prev=     prev=
    continue     continue
    ;;     ;;
           inst_prefix)
      inst_prefix_dir="$arg"
      prev=
      continue
      ;;
  release)   release)
    release="-$arg"     release="-$arg"
    prev=     prev=
Line 999
 
Line 996
  continue   continue
  ;;   ;;
   
         -inst-prefix-dir)
    prev=inst_prefix
    continue
    ;;
   
       # The native IRIX linker understands -LANG:*, -LIST:* and -LNO:*        # The native IRIX linker understands -LANG:*, -LIST:* and -LNO:*
       # so, if we see these flags be careful not to treat them like -L        # so, if we see these flags be careful not to treat them like -L
       -L[A-Z][A-Z]*:*)        -L[A-Z][A-Z]*:*)
  case $with_gcc/$host in   case $with_gcc/$host in
  no/*-*-irix* | no/*-*-nonstopux*)   no/*-*-irix*)
    compile_command="$compile_command $arg"     compile_command="$compile_command $arg"
    finalize_command="$finalize_command $arg"     finalize_command="$finalize_command $arg"
    ;;     ;;
Line 1054
 
Line 1056
      # These systems don't actually have a C library (as such)       # These systems don't actually have a C library (as such)
      test "X$arg" = "X-lc" && continue       test "X$arg" = "X-lc" && continue
      ;;       ;;
    *-*-openbsd* | *-*-freebsd*)     *-*-openbsd*)
      # Do not include libc due to us having libc/libc_r.       # Do not include libc due to us having libc/libc_r.
      test "X$arg" = "X-lc" && continue       test "X$arg" = "X-lc" && continue
      ;;       ;;
    esac     esac
  elif test "X$arg" = "X-lc_r"; then   elif test "X$arg" = "X-lc_r"; then
    case $host in     case $host in
  *-*-openbsd* | *-*-freebsd*)     *-*-openbsd*)
      # Do not include libc_r directly, use -pthread flag.       # Do not include libc_r directly, use -pthread flag.
      continue       continue
      ;;       ;;
Line 1314
 
Line 1316
       output_objdir="$output_objdir/$objdir"        output_objdir="$output_objdir/$objdir"
     fi      fi
     # Create the object directory.      # Create the object directory.
     if test ! -d $output_objdir; then      if test ! -d "$output_objdir"; then
       $show "$mkdir $output_objdir"        $show "$mkdir $output_objdir"
       $run $mkdir $output_objdir        $run $mkdir $output_objdir
       status=$?        status=$?
       if test $status -ne 0 && test ! -d $output_objdir; then        if test "$status" -ne 0 && test ! -d "$output_objdir"; then
  exit $status   exit $status
       fi        fi
     fi      fi
Line 1348
 
Line 1350
       fi        fi
       libs="$libs $deplib"        libs="$libs $deplib"
     done      done
   
       if test "$linkmode" = lib; then
         libs="$predeps $libs $compiler_lib_search_path $postdeps"
   
         # Compute libraries that are listed more than once in $predeps
         # $postdeps and mark them as special (i.e., whose duplicates are
         # not to be eliminated).
         pre_post_deps=
         if test "X$duplicate_deps" = "Xyes" ; then
    for pre_post_dep in $predeps $postdeps; do
      case "$pre_post_deps " in
      *" $pre_post_dep "*) specialdeplibs="$specialdeplibs $pre_post_deps" ;;
      esac
      pre_post_deps="$pre_post_deps $pre_post_dep"
    done
         fi
         pre_post_deps=
       fi
   
     deplibs=      deplibs=
     newdependency_libs=      newdependency_libs=
     newlib_search_path=      newlib_search_path=
Line 1379
 
Line 1400
  ;;   ;;
     esac      esac
     for pass in $passes; do      for pass in $passes; do
       if test $linkmode = prog; then        if test "$linkmode" = prog; then
  # Determine which files to process   # Determine which files to process
  case $pass in   case $pass in
  dlopen)   dlopen)
Line 1396
 
Line 1417
  found=no   found=no
  case $deplib in   case $deplib in
  -l*)   -l*)
    if test $linkmode = oldlib && test $linkmode = obj; then     if test "$linkmode" = oldlib && test "$linkmode" = obj; then
      $echo "$modename: warning: \`-l' is ignored for archives/objects: $deplib" 1>&2       $echo "$modename: warning: \`-l' is ignored for archives/objects: $deplib" 1>&2
      continue       continue
    fi     fi
    if test $pass = conv; then     if test "$pass" = conv; then
      deplibs="$deplib $deplibs"       deplibs="$deplib $deplibs"
      continue       continue
    fi     fi
Line 1420
 
Line 1441
        finalize_deplibs="$deplib $finalize_deplibs"         finalize_deplibs="$deplib $finalize_deplibs"
      else       else
        deplibs="$deplib $deplibs"         deplibs="$deplib $deplibs"
        test $linkmode = lib && newdependency_libs="$deplib $newdependency_libs"         test "$linkmode" = lib && newdependency_libs="$deplib $newdependency_libs"
      fi       fi
      continue       continue
    fi     fi
Line 1429
 
Line 1450
    case $linkmode in     case $linkmode in
    lib)     lib)
      deplibs="$deplib $deplibs"       deplibs="$deplib $deplibs"
      test $pass = conv && continue       test "$pass" = conv && continue
      newdependency_libs="$deplib $newdependency_libs"       newdependency_libs="$deplib $newdependency_libs"
      newlib_search_path="$newlib_search_path "`$echo "X$deplib" | $Xsed -e 's/^-L//'`       newlib_search_path="$newlib_search_path "`$echo "X$deplib" | $Xsed -e 's/^-L//'`
      ;;       ;;
    prog)     prog)
      if test $pass = conv; then       if test "$pass" = conv; then
        deplibs="$deplib $deplibs"         deplibs="$deplib $deplibs"
        continue         continue
      fi       fi
      if test $pass = scan; then       if test "$pass" = scan; then
        deplibs="$deplib $deplibs"         deplibs="$deplib $deplibs"
        newlib_search_path="$newlib_search_path "`$echo "X$deplib" | $Xsed -e 's/^-L//'`         newlib_search_path="$newlib_search_path "`$echo "X$deplib" | $Xsed -e 's/^-L//'`
      else       else
Line 1453
 
Line 1474
    continue     continue
    ;; # -L     ;; # -L
  -R*)   -R*)
    if test $pass = link; then     if test "$pass" = link; then
      dir=`$echo "X$deplib" | $Xsed -e 's/^-R//'`       dir=`$echo "X$deplib" | $Xsed -e 's/^-R//'`
      # Make sure the xrpath contains only unique directories.       # Make sure the xrpath contains only unique directories.
      case "$xrpath " in       case "$xrpath " in
Line 1466
 
Line 1487
    ;;     ;;
  *.la) lib="$deplib" ;;   *.la) lib="$deplib" ;;
  *.$libext)   *.$libext)
    if test $pass = conv; then     if test "$pass" = conv; then
      deplibs="$deplib $deplibs"       deplibs="$deplib $deplibs"
      continue       continue
    fi     fi
Line 1474
 
Line 1495
    lib)     lib)
      if test "$deplibs_check_method" != pass_all; then       if test "$deplibs_check_method" != pass_all; then
        echo         echo
        echo "*** Warning: Trying to link with static lib archive $deplib."         echo "*** Warning: This library needs some functionality provided by $deplib."
        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"
        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"
        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."
        echo "*** because the file extensions .$libext of this argument makes me believe"  
        echo "*** that it is just a static archive that I should not used here."  
      else       else
        echo         echo
        echo "*** Warning: Linking the shared library $output against the"         echo "*** Warning: Linking the shared library $output against the"
Line 1489
 
Line 1508
      continue       continue
      ;;       ;;
    prog)     prog)
      if test $pass != link; then       if test "$pass" != link; then
        deplibs="$deplib $deplibs"         deplibs="$deplib $deplibs"
      else       else
        compile_deplibs="$deplib $compile_deplibs"         compile_deplibs="$deplib $compile_deplibs"
Line 1500
 
Line 1519
    esac # linkmode     esac # linkmode
    ;; # *.$libext     ;; # *.$libext
  *.lo | *.$objext)   *.lo | *.$objext)
    if test $pass = dlpreopen || test "$dlopen_support" != yes || test "$build_libtool_libs" = no; then     if test "$pass" = dlpreopen || test "$dlopen_support" != yes || test "$build_libtool_libs" = no; then
      # If there is no dlopen support or we're linking statically,       # If there is no dlopen support or we're linking statically,
      # we need to preload.       # we need to preload.
      newdlprefiles="$newdlprefiles $deplib"       newdlprefiles="$newdlprefiles $deplib"
Line 1516
 
Line 1535
    continue     continue
    ;;     ;;
  esac # case $deplib   esac # case $deplib
  if test $found = yes || test -f "$lib"; then :   if test "$found" = yes || test -f "$lib"; then :
  else   else
    $echo "$modename: cannot find the library \`$lib'" 1>&2     $echo "$modename: cannot find the library \`$lib'" 1>&2
    exit 1     exit 1
  fi   fi
   
  # Check to see that this really is a libtool archive.   # Check to see that this really is a libtool archive.
  if (${SED} -e '2q' $lib | egrep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then :   if (sed -e '2q' $lib | egrep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then :
  else   else
    $echo "$modename: \`$lib' is not a valid libtool archive" 1>&2     $echo "$modename: \`$lib' is not a valid libtool archive" 1>&2
    exit 1     exit 1
Line 1550
 
Line 1569
   
  if test "$linkmode,$pass" = "lib,link" ||   if test "$linkmode,$pass" = "lib,link" ||
     test "$linkmode,$pass" = "prog,scan" ||      test "$linkmode,$pass" = "prog,scan" ||
     { test $linkmode = oldlib && test $linkmode = obj; }; then      { test "$linkmode" = oldlib && test "$linkmode" = obj; }; then
     # Add dl[pre]opened files of deplib      # Add dl[pre]opened files of deplib
    test -n "$dlopen" && dlfiles="$dlfiles $dlopen"     test -n "$dlopen" && dlfiles="$dlfiles $dlopen"
    test -n "$dlpreopen" && dlprefiles="$dlprefiles $dlpreopen"     test -n "$dlpreopen" && dlprefiles="$dlprefiles $dlpreopen"
  fi   fi
   
  if test $pass = conv; then   if test "$pass" = conv; then
    # Only check for convenience libraries     # Only check for convenience libraries
    deplibs="$lib $deplibs"     deplibs="$lib $deplibs"
    if test -z "$libdir"; then     if test -z "$libdir"; then
Line 1577
 
Line 1596
               fi                fi
        tmp_libs="$tmp_libs $deplib"         tmp_libs="$tmp_libs $deplib"
      done       done
    elif test $linkmode != prog && test $linkmode != lib; then     elif test "$linkmode" != prog && test "$linkmode" != lib; then
      $echo "$modename: \`$lib' is not a convenience library" 1>&2       $echo "$modename: \`$lib' is not a convenience library" 1>&2
      exit 1       exit 1
    fi     fi
Line 1595
 
Line 1614
  fi   fi
   
  # This library was specified with -dlopen.   # This library was specified with -dlopen.
  if test $pass = dlopen; then   if test "$pass" = dlopen; then
    if test -z "$libdir"; then     if test -z "$libdir"; then
      $echo "$modename: cannot -dlopen a convenience library: \`$lib'" 1>&2       $echo "$modename: cannot -dlopen a convenience library: \`$lib'" 1>&2
      exit 1       exit 1
Line 1644
 
Line 1663
  name=`$echo "X$laname" | $Xsed -e 's/\.la$//' -e 's/^lib//'`   name=`$echo "X$laname" | $Xsed -e 's/\.la$//' -e 's/^lib//'`
   
  # This library was specified with -dlpreopen.   # This library was specified with -dlpreopen.
  if test $pass = dlpreopen; then   if test "$pass" = dlpreopen; then
    if test -z "$libdir"; then     if test -z "$libdir"; then
      $echo "$modename: cannot -dlpreopen a convenience library: \`$lib'" 1>&2       $echo "$modename: cannot -dlpreopen a convenience library: \`$lib'" 1>&2
      exit 1       exit 1
Line 1663
 
Line 1682
   
  if test -z "$libdir"; then   if test -z "$libdir"; then
    # Link the convenience library     # Link the convenience library
    if test $linkmode = lib; then     if test "$linkmode" = lib; then
      deplibs="$dir/$old_library $deplibs"       deplibs="$dir/$old_library $deplibs"
    elif test "$linkmode,$pass" = "prog,link"; then     elif test "$linkmode,$pass" = "prog,link"; then
      compile_deplibs="$dir/$old_library $compile_deplibs"       compile_deplibs="$dir/$old_library $compile_deplibs"
Line 1674
 
Line 1693
    continue     continue
  fi   fi
   
  if test $linkmode = prog && test $pass != link; then   if test "$linkmode" = prog && test "$pass" != link; then
    newlib_search_path="$newlib_search_path $ladir"     newlib_search_path="$newlib_search_path $ladir"
    deplibs="$lib $deplibs"     deplibs="$lib $deplibs"
   
Line 1690
 
Line 1709
      -L*) newlib_search_path="$newlib_search_path "`$echo "X$deplib" | $Xsed -e 's/^-L//'`;; ### testsuite: skip nested quoting test       -L*) newlib_search_path="$newlib_search_path "`$echo "X$deplib" | $Xsed -e 's/^-L//'`;; ### testsuite: skip nested quoting test
      esac       esac
      # Need to link against all dependency_libs?       # Need to link against all dependency_libs?
      if test $linkalldeplibs = yes; then       if test "$linkalldeplibs" = yes; then
        deplibs="$deplib $deplibs"         deplibs="$deplib $deplibs"
      else       else
        # Need to hardcode shared library paths         # Need to hardcode shared library paths
Line 1713
 
Line 1732
    # Link against this shared library     # Link against this shared library
   
    if test "$linkmode,$pass" = "prog,link" ||     if test "$linkmode,$pass" = "prog,link" ||
     { test $linkmode = lib && test $hardcode_into_libs = yes; }; then      { test "$linkmode" = lib && test "$hardcode_into_libs" = yes; }; then
      # Hardcode the library path.       # Hardcode the library path.
      # Skip directories that are in the system default run-time       # Skip directories that are in the system default run-time
      # search path.       # search path.
Line 1735
 
Line 1754
        esac         esac
        ;;         ;;
      esac       esac
      if test $linkmode = prog; then       if test "$linkmode" = prog; then
        # We need to hardcode the library path         # We need to hardcode the library path
        if test -n "$shlibpath_var"; then         if test -n "$shlibpath_var"; then
  # Make sure the rpath contains only unique directories.   # Make sure the rpath contains only unique directories.
Line 1785
 
Line 1804
   
      # Make a new name for the extract_expsyms_cmds to use       # Make a new name for the extract_expsyms_cmds to use
      soroot="$soname"       soroot="$soname"
      soname=`echo $soroot | ${SED} -e 's/^.*\///'`       soname=`echo $soroot | sed -e 's/^.*\///'`
      newlib="libimp-`echo $soname | ${SED} 's/^lib//;s/\.dll$//'`.a"       newlib="libimp-`echo $soname | sed 's/^lib//;s/\.dll$//'`.a"
   
      # If the library has no export list, then create one now       # If the library has no export list, then create one now
      if test -f "$output_objdir/$soname-def"; then :       if test -f "$output_objdir/$soname-def"; then :
Line 1817
 
Line 1836
      # make sure the library variables are pointing to the new library       # make sure the library variables are pointing to the new library
      dir=$output_objdir       dir=$output_objdir
      linklib=$newlib       linklib=$newlib
    fi # test -n $old_archive_from_expsyms_cmds     fi # test -n "$old_archive_from_expsyms_cmds"
   
    if test $linkmode = prog || test "$mode" != relink; then     if test "$linkmode" = prog || test "$mode" != relink; then
      add_shlibpath=       add_shlibpath=
      add_dir=       add_dir=
      add=       add=
Line 1868
 
Line 1887
        *) compile_shlibpath="$compile_shlibpath$add_shlibpath:" ;;         *) compile_shlibpath="$compile_shlibpath$add_shlibpath:" ;;
        esac         esac
      fi       fi
      if test $linkmode = prog; then       if test "$linkmode" = prog; then
        test -n "$add_dir" && compile_deplibs="$add_dir $compile_deplibs"         test -n "$add_dir" && compile_deplibs="$add_dir $compile_deplibs"
        test -n "$add" && compile_deplibs="$add $compile_deplibs"         test -n "$add" && compile_deplibs="$add $compile_deplibs"
      else       else
Line 1885
 
Line 1904
      fi       fi
    fi     fi
   
    if test $linkmode = prog || test "$mode" = relink; then     if test "$linkmode" = prog || test "$mode" = relink; then
      add_shlibpath=       add_shlibpath=
      add_dir=       add_dir=
      add=       add=
Line 1893
 
Line 1912
      if test "$hardcode_direct" = yes; then       if test "$hardcode_direct" = yes; then
        add="$libdir/$linklib"         add="$libdir/$linklib"
      elif test "$hardcode_minus_L" = yes; then       elif test "$hardcode_minus_L" = yes; then
        add_dir="-L$libdir"         # Try looking first in the location we're being installed to.
          add_dir=
          if test -n "$inst_prefix_dir"; then
    case "$libdir" in
    [\\/]*)
      add_dir="-L$inst_prefix_dir$libdir"
      ;;
    esac
          fi
          add_dir="$add_dir -L$libdir"
        add="-l$name"         add="-l$name"
      elif test "$hardcode_shlibpath_var" = yes; then       elif test "$hardcode_shlibpath_var" = yes; then
        case :$finalize_shlibpath: in         case :$finalize_shlibpath: in
Line 1903
 
Line 1931
        add="-l$name"         add="-l$name"
      else       else
        # We cannot seem to hardcode it, guess we'll fake it.         # We cannot seem to hardcode it, guess we'll fake it.
        add_dir="-L$libdir"         # Try looking first in the location we're being installed to.
          add_dir=
          if test -n "$inst_prefix_dir"; then
    case "$libdir" in
    [\\/]*)
      add_dir="-L$inst_prefix_dir$libdir"
      ;;
    esac
          fi
          add_dir="$add_dir -L$libdir"
        add="-l$name"         add="-l$name"
      fi       fi
   
      if test $linkmode = prog; then       if test "$linkmode" = prog; then
        test -n "$add_dir" && finalize_deplibs="$add_dir $finalize_deplibs"         test -n "$add_dir" && finalize_deplibs="$add_dir $finalize_deplibs"
        test -n "$add" && finalize_deplibs="$add $finalize_deplibs"         test -n "$add" && finalize_deplibs="$add $finalize_deplibs"
      else       else
Line 1915
 
Line 1952
        test -n "$add" && deplibs="$add $deplibs"         test -n "$add" && deplibs="$add $deplibs"
      fi       fi
    fi     fi
  elif test $linkmode = prog; then   elif test "$linkmode" = prog; then
    if test "$alldeplibs" = yes &&     if test "$alldeplibs" = yes &&
       { test "$deplibs_check_method" = pass_all ||        { test "$deplibs_check_method" = pass_all ||
         { test "$build_libtool_libs" = yes &&          { test "$build_libtool_libs" = yes &&
Line 1945
 
Line 1982
      # Just print a warning and add the library to dependency_libs so       # Just print a warning and add the library to dependency_libs so
      # that the program can be linked against the static library.       # that the program can be linked against the static library.
      echo       echo
      echo "*** Warning: This system can not link to static lib archive $lib."       echo "*** Warning: This library needs some functionality provided by $lib."
      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"
      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"
      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."
      if test "$module" = yes; then       if test "$module" = yes; then
        echo "*** But as you try to build a module library, libtool will still create "         echo "*** Therefore, libtool will create a static module, that should work "
        echo "*** a static module, that should work as long as the dlopening application"         echo "*** as long as the dlopening application is linked with the -dlopen flag."
        echo "*** is linked with the -dlopen flag to resolve symbols at runtime."  
        if test -z "$global_symbol_pipe"; then         if test -z "$global_symbol_pipe"; then
  echo   echo
  echo "*** However, this would only work if libtool was able to extract symbol"   echo "*** However, this would only work if libtool was able to extract symbol"
Line 1975
 
Line 2011
    fi     fi
  fi # link shared/static library?   fi # link shared/static library?
   
  if test $linkmode = lib; then   if test "$linkmode" = lib; then
    if test -n "$dependency_libs" &&     if test -n "$dependency_libs" &&
       { test $hardcode_into_libs != yes || test $build_old_libs = yes ||        { test "$hardcode_into_libs" != yes || test "$build_old_libs" = yes ||
         test $link_static = yes; }; then          test "$link_static" = yes; }; then
      # Extract -R from dependency_libs       # Extract -R from dependency_libs
      temp_deplibs=       temp_deplibs=
      for libdir in $dependency_libs; do       for libdir in $dependency_libs; do
Line 2009
 
Line 2045
      tmp_libs="$tmp_libs $deplib"       tmp_libs="$tmp_libs $deplib"
    done     done
   
    if test $link_all_deplibs != no; then     if test "$link_all_deplibs" != no; then
      # Add the search paths of all dependency libraries       # Add the search paths of all dependency libraries
      for deplib in $dependency_libs; do       for deplib in $dependency_libs; do
        case $deplib in         case $deplib in
Line 2031
 
Line 2067
  if grep "^installed=no" $deplib > /dev/null; then   if grep "^installed=no" $deplib > /dev/null; then
    path="-L$absdir/$objdir"     path="-L$absdir/$objdir"
  else   else
    eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $deplib`     eval libdir=`sed -n -e 's/^libdir=\(.*\)$/\1/p' $deplib`
    if test -z "$libdir"; then     if test -z "$libdir"; then
      $echo "$modename: \`$deplib' is not a valid libtool archive" 1>&2       $echo "$modename: \`$deplib' is not a valid libtool archive" 1>&2
      exit 1       exit 1
Line 2052
 
Line 2088
    fi # link_all_deplibs != no     fi # link_all_deplibs != no
  fi # linkmode = lib   fi # linkmode = lib
       done # for deplib in $libs        done # for deplib in $libs
       if test $pass = dlpreopen; then        if test "$pass" = dlpreopen; then
  # Link the dlpreopened libraries before other libraries   # Link the dlpreopened libraries before other libraries
  for deplib in $save_deplibs; do   for deplib in $save_deplibs; do
    deplibs="$deplib $deplibs"     deplibs="$deplib $deplibs"
  done   done
       fi        fi
       if test $pass != dlopen; then        if test "$pass" != dlopen; then
  test $pass != scan && dependency_libs="$newdependency_libs"   test "$pass" != scan && dependency_libs="$newdependency_libs"
  if test $pass != conv; then   if test "$pass" != conv; then
    # Make sure lib_search_path contains only unique directories.     # Make sure lib_search_path contains only unique directories.
    lib_search_path=     lib_search_path=
    for dir in $newlib_search_path; do     for dir in $newlib_search_path; do
Line 2118
 
Line 2154
  deplibs=   deplibs=
       fi        fi
     done # for pass      done # for pass
     if test $linkmode = prog; then      if test "$linkmode" = prog; then
       dlfiles="$newdlfiles"        dlfiles="$newdlfiles"
       dlprefiles="$newdlprefiles"        dlprefiles="$newdlprefiles"
     fi      fi
Line 2195
 
Line 2231
       fi        fi
   
       set dummy $rpath        set dummy $rpath
       if test $# -gt 2; then        if test "$#" -gt 2; then
  $echo "$modename: warning: ignoring multiple \`-rpath's for a libtool library" 1>&2   $echo "$modename: warning: ignoring multiple \`-rpath's for a libtool library" 1>&2
       fi        fi
       install_libdir="$2"        install_libdir="$2"
Line 2236
 
Line 2272
   
  # Check that each of the things are valid numbers.   # Check that each of the things are valid numbers.
  case $current in   case $current in
  0 | [1-9] | [1-9][0-9] | [1-9][0-9][0-9]) ;;   [0-9]*) ;;
  *)   *)
    $echo "$modename: CURRENT \`$current' is not a nonnegative integer" 1>&2     $echo "$modename: CURRENT \`$current' is not a nonnegative integer" 1>&2
    $echo "$modename: \`$vinfo' is not valid version information" 1>&2     $echo "$modename: \`$vinfo' is not valid version information" 1>&2
Line 2245
 
Line 2281
  esac   esac
   
  case $revision in   case $revision in
  0 | [1-9] | [1-9][0-9] | [1-9][0-9][0-9]) ;;   [0-9]*) ;;
  *)   *)
    $echo "$modename: REVISION \`$revision' is not a nonnegative integer" 1>&2     $echo "$modename: REVISION \`$revision' is not a nonnegative integer" 1>&2
    $echo "$modename: \`$vinfo' is not valid version information" 1>&2     $echo "$modename: \`$vinfo' is not valid version information" 1>&2
Line 2254
 
Line 2290
  esac   esac
   
  case $age in   case $age in
  0 | [1-9] | [1-9][0-9] | [1-9][0-9][0-9]) ;;   [0-9]*) ;;
  *)   *)
    $echo "$modename: AGE \`$age' is not a nonnegative integer" 1>&2     $echo "$modename: AGE \`$age' is not a nonnegative integer" 1>&2
    $echo "$modename: \`$vinfo' is not valid version information" 1>&2     $echo "$modename: \`$vinfo' is not valid version information" 1>&2
Line 2262
 
Line 2298
    ;;     ;;
  esac   esac
   
  if test $age -gt $current; then   if test "$age" -gt "$current"; then
    $echo "$modename: AGE \`$age' is greater than the current interface number \`$current'" 1>&2     $echo "$modename: AGE \`$age' is greater than the current interface number \`$current'" 1>&2
    $echo "$modename: \`$vinfo' is not valid version information" 1>&2     $echo "$modename: \`$vinfo' is not valid version information" 1>&2
    exit 1     exit 1
Line 2295
 
Line 2331
    versuffix=".$current";     versuffix=".$current";
    ;;     ;;
   
  irix | nonstopux)   irix)
    major=`expr $current - $age + 1`     major=`expr $current - $age + 1`
      verstring="sgi$major.$revision"
    case $version_type in  
      nonstopux) verstring_prefix=nonstopux ;;  
      *)         verstring_prefix=sgi ;;  
    esac  
    verstring="$verstring_prefix$major.$revision"  
   
    # Add in all the interfaces that we are compatible with.     # Add in all the interfaces that we are compatible with.
    loop=$revision     loop=$revision
    while test $loop != 0; do     while test "$loop" -ne 0; do
      iface=`expr $revision - $loop`       iface=`expr $revision - $loop`
      loop=`expr $loop - 1`       loop=`expr $loop - 1`
      verstring="$verstring_prefix$major.$iface:$verstring"       verstring="sgi$major.$iface:$verstring"
    done     done
   
    # Before this point, $major must not contain `.'.     # Before this point, $major must not contain `.'.
Line 2323
 
Line 2354
    ;;     ;;
   
  osf)   osf)
    major=.`expr $current - $age`     major=`expr $current - $age`
    versuffix=".$current.$age.$revision"     versuffix=".$current.$age.$revision"
    verstring="$current.$age.$revision"     verstring="$current.$age.$revision"
   
    # Add in all the interfaces that we are compatible with.     # Add in all the interfaces that we are compatible with.
    loop=$age     loop=$age
    while test $loop != 0; do     while test "$loop" -ne 0; do
      iface=`expr $current - $loop`       iface=`expr $current - $loop`
      loop=`expr $loop - 1`       loop=`expr $loop - 1`
      verstring="$verstring:${iface}.0"       verstring="$verstring:${iface}.0"
Line 2415
 
Line 2446
   
       # Eliminate all temporary directories.        # Eliminate all temporary directories.
       for path in $notinst_path; do        for path in $notinst_path; do
  lib_search_path=`echo "$lib_search_path " | ${SED} -e 's% $path % %g'`   lib_search_path=`echo "$lib_search_path " | sed -e 's% $path % %g'`
  deplibs=`echo "$deplibs " | ${SED} -e 's% -L$path % %g'`   deplibs=`echo "$deplibs " | sed -e 's% -L$path % %g'`
  dependency_libs=`echo "$dependency_libs " | ${SED} -e 's% -L$path % %g'`   dependency_libs=`echo "$dependency_libs " | sed -e 's% -L$path % %g'`
       done        done
   
       if test -n "$xrpath"; then        if test -n "$xrpath"; then
Line 2430
 
Line 2461
    *) finalize_rpath="$finalize_rpath $libdir" ;;     *) finalize_rpath="$finalize_rpath $libdir" ;;
    esac     esac
  done   done
  if test $hardcode_into_libs != yes || test $build_old_libs = yes; then   if test "$hardcode_into_libs" != yes || test "$build_old_libs" = yes; then
    dependency_libs="$temp_xrpath $dependency_libs"     dependency_libs="$temp_xrpath $dependency_libs"
  fi   fi
       fi        fi
Line 2468
 
Line 2499
    *-*-netbsd*)     *-*-netbsd*)
      # Don't link with libc until the a.out ld.so is fixed.       # Don't link with libc until the a.out ld.so is fixed.
      ;;       ;;
    *-*-openbsd* | *-*-freebsd*)     *-*-openbsd*)
      # Do not include libc due to us having libc/libc_r.       # Do not include libc due to us having libc/libc_r.
      ;;       ;;
    *)     *)
      # Add libc to deplibs on all other systems if necessary.       # Add libc to deplibs on all other systems if necessary.
      if test $build_libtool_need_lc = "yes"; then       if test "$build_libtool_need_lc" = "yes"; then
        deplibs="$deplibs -lc"         deplibs="$deplibs -lc"
      fi       fi
      ;;       ;;
Line 2514
 
Line 2545
 EOF  EOF
    $rm conftest     $rm conftest
    $CC -o conftest conftest.c $deplibs     $CC -o conftest conftest.c $deplibs
    if test $? -eq 0 ; then     if test "$?" -eq 0 ; then
      ldd_output=`ldd conftest`       ldd_output=`ldd conftest`
      for i in $deplibs; do       for i in $deplibs; do
        name="`expr $i : '-l\(.*\)'`"         name="`expr $i : '-l\(.*\)'`"
Line 2529
 
Line 2560
  else   else
    droppeddeps=yes     droppeddeps=yes
    echo     echo
    echo "*** Warning: dynamic linker does not accept needed library $i."     echo "*** Warning: This library needs some functionality provided by $i."
    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"
    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"
    echo "*** shared version of the library, which I believe you do not have"     echo "*** shared version of the library, which you do not appear to have."
    echo "*** because a test_compile did reveal that the linker did not use it for"  
    echo "*** its dynamic dependency list that programs get resolved with at runtime."  
  fi   fi
        else         else
  newdeplibs="$newdeplibs $i"   newdeplibs="$newdeplibs $i"
        fi         fi
      done       done
    else     else
      # Error occured in the first compile.  Let's try to salvage       # Error occured in the first compile.  Let's try to salvage the situation:
      # the situation: Compile a separate program for each library.       # Compile a seperate program for each library.
      for i in $deplibs; do       for i in $deplibs; do
        name="`expr $i : '-l\(.*\)'`"         name="`expr $i : '-l\(.*\)'`"
       # If $name is empty we are operating on a -L argument.        # If $name is empty we are operating on a -L argument.
Line 2550
 
Line 2579
  $rm conftest   $rm conftest
  $CC -o conftest conftest.c $i   $CC -o conftest conftest.c $i
  # Did it work?   # Did it work?
  if test $? -eq 0 ; then   if test "$?" -eq 0 ; then
    ldd_output=`ldd conftest`     ldd_output=`ldd conftest`
    libname=`eval \\$echo \"$libname_spec\"`     libname=`eval \\$echo \"$libname_spec\"`
    deplib_matches=`eval \\$echo \"$library_names_spec\"`     deplib_matches=`eval \\$echo \"$library_names_spec\"`
Line 2561
 
Line 2590
    else     else
      droppeddeps=yes       droppeddeps=yes
      echo       echo
      echo "*** Warning: dynamic linker does not accept needed library $i."       echo "*** Warning: This library needs some functionality provided by $i."
      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"
      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"
      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."
      echo "*** because a test_compile did reveal that the linker did not use this one"  
      echo "*** as a dynamic dependency that programs can get resolved with at runtime."  
    fi     fi
  else   else
    droppeddeps=yes     droppeddeps=yes
Line 2605
 
Line 2632
        # but so what?         # but so what?
        potlib="$potent_lib"         potlib="$potent_lib"
        while test -h "$potlib" 2>/dev/null; do         while test -h "$potlib" 2>/dev/null; do
  potliblink=`ls -ld $potlib | ${SED} 's/.* -> //'`   potliblink=`ls -ld $potlib | sed 's/.* -> //'`
  case $potliblink in   case $potliblink in
  [\\/]* | [A-Za-z]:[\\/]*) potlib="$potliblink";;   [\\/]* | [A-Za-z]:[\\/]*) potlib="$potliblink";;
  *) potlib=`$echo "X$potlib" | $Xsed -e 's,[^/]*$,,'`"$potliblink";;   *) potlib=`$echo "X$potlib" | $Xsed -e 's,[^/]*$,,'`"$potliblink";;
  esac   esac
        done         done
        if eval $file_magic_cmd \"\$potlib\" 2>/dev/null \         if eval $file_magic_cmd \"\$potlib\" 2>/dev/null \
  | ${SED} 10q \   | sed 10q \
  | egrep "$file_magic_regex" > /dev/null; then   | egrep "$file_magic_regex" > /dev/null; then
  newdeplibs="$newdeplibs $a_deplib"   newdeplibs="$newdeplibs $a_deplib"
  a_deplib=""   a_deplib=""
Line 2623
 
Line 2650
        if test -n "$a_deplib" ; then         if test -n "$a_deplib" ; then
  droppeddeps=yes   droppeddeps=yes
  echo   echo
  echo "*** Warning: linker path does not have real file for library $a_deplib."   echo "*** Warning: This library needs some functionality provided by $a_deplib."
  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"
  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"
  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."
  echo "*** because I did check the linker path looking for a file starting"  
  if test -z "$potlib" ; then  
    echo "*** with $libname but no candidates were found. (...for file magic test)"  
  else  
    echo "*** with $libname and none of the candidates passed a file format test"  
    echo "*** using a file magic. Last file checked: $potlib"  
  fi  
        fi         fi
      else       else
        # Add a -L argument.         # Add a -L argument.
Line 2652
 
Line 2672
        for i in $lib_search_path $sys_lib_search_path $shlib_search_path; do         for i in $lib_search_path $sys_lib_search_path $shlib_search_path; do
  potential_libs=`ls $i/$libname[.-]* 2>/dev/null`   potential_libs=`ls $i/$libname[.-]* 2>/dev/null`
  for potent_lib in $potential_libs; do   for potent_lib in $potential_libs; do
    potlib="$potent_lib" # see symlink-check below in file_magic test  
    if eval echo \"$potent_lib\" 2>/dev/null \     if eval echo \"$potent_lib\" 2>/dev/null \
        | ${SED} 10q \         | sed 10q \
        | egrep "$match_pattern_regex" > /dev/null; then         | egrep "$match_pattern_regex" > /dev/null; then
      newdeplibs="$newdeplibs $a_deplib"       newdeplibs="$newdeplibs $a_deplib"
      a_deplib=""       a_deplib=""
Line 2665
 
Line 2684
        if test -n "$a_deplib" ; then         if test -n "$a_deplib" ; then
  droppeddeps=yes   droppeddeps=yes
  echo   echo
  echo "*** Warning: linker path does not have real file for library $a_deplib."   echo "*** Warning: This library needs some functionality provided by $a_deplib."
  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"
  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"
  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."
  echo "*** because I did check the linker path looking for a file starting"  
  if test -z "$potlib" ; then  
    echo "*** with $libname but no candidates were found. (...for regex pattern test)"  
  else  
    echo "*** with $libname and none of the candidates passed a file format test"  
    echo "*** using a regex pattern. Last file checked: $potlib"  
  fi  
        fi         fi
      else       else
        # Add a -L argument.         # Add a -L argument.
Line 2738
 
Line 2750
      echo "*** automatically added whenever a program is linked with this library"       echo "*** automatically added whenever a program is linked with this library"
      echo "*** or is declared to -dlopen it."       echo "*** or is declared to -dlopen it."
   
      if test $allow_undefined = no; then       if test "$allow_undefined" = no; then
        echo         echo
        echo "*** Since this library must not contain undefined symbols,"         echo "*** Since this library must not contain undefined symbols,"
        echo "*** because either the platform does not support them or"         echo "*** because either the platform does not support them or"
Line 2765
 
Line 2777
   
       # Test again, we may have decided not to build it any more        # Test again, we may have decided not to build it any more
       if test "$build_libtool_libs" = yes; then        if test "$build_libtool_libs" = yes; then
  if test $hardcode_into_libs = yes; then   if test "$hardcode_into_libs" = yes; then
    # Hardcode the library paths     # Hardcode the library paths
    hardcode_libdirs=     hardcode_libdirs=
    dep_rpath=     dep_rpath=
Line 2896
 
Line 2908
      $show "mkdir $gentop"       $show "mkdir $gentop"
      $run mkdir "$gentop"       $run mkdir "$gentop"
      status=$?       status=$?
      if test $status -ne 0 && test ! -d "$gentop"; then       if test "$status" -ne 0 && test ! -d "$gentop"; then
        exit $status         exit $status
      fi       fi
      generated="$generated $gentop"       generated="$generated $gentop"
Line 2915
 
Line 2927
        $show "mkdir $xdir"         $show "mkdir $xdir"
        $run mkdir "$xdir"         $run mkdir "$xdir"
        status=$?         status=$?
        if test $status -ne 0 && test ! -d "$xdir"; then         if test "$status" -ne 0 && test ! -d "$xdir"; then
  exit $status   exit $status
        fi         fi
        $show "(cd $xdir && $AR x $xabs)"         $show "(cd $xdir && $AR x $xabs)"
Line 2940
 
Line 2952
  if test -n "$export_symbols" && test -n "$archive_expsym_cmds"; then   if test -n "$export_symbols" && test -n "$archive_expsym_cmds"; then
    eval cmds=\"$archive_expsym_cmds\"     eval cmds=\"$archive_expsym_cmds\"
  else   else
    save_deplibs="$deplibs"  
    for conv in $convenience; do  
      tmp_deplibs=  
      for test_deplib in $deplibs; do  
        if test "$test_deplib" != "$conv"; then  
  tmp_deplibs="$tmp_deplibs $test_deplib"  
        fi  
      done  
      deplibs="$tmp_deplibs"  
    done  
    eval cmds=\"$archive_cmds\"     eval cmds=\"$archive_cmds\"
    deplibs="$save_deplibs"  
  fi   fi
  save_ifs="$IFS"; IFS='~'   save_ifs="$IFS"; IFS='~'
  for cmd in $cmds; do   for cmd in $cmds; do
Line 3046
 
Line 3047
    $show "mkdir $gentop"     $show "mkdir $gentop"
    $run mkdir "$gentop"     $run mkdir "$gentop"
    status=$?     status=$?
    if test $status -ne 0 && test ! -d "$gentop"; then     if test "$status" -ne 0 && test ! -d "$gentop"; then
      exit $status       exit $status
    fi     fi
    generated="$generated $gentop"     generated="$generated $gentop"
Line 3065
 
Line 3066
      $show "mkdir $xdir"       $show "mkdir $xdir"
      $run mkdir "$xdir"       $run mkdir "$xdir"
      status=$?       status=$?
      if test $status -ne 0 && test ! -d "$xdir"; then       if test "$status" -ne 0 && test ! -d "$xdir"; then
        exit $status         exit $status
      fi       fi
      $show "(cd $xdir && $AR x $xabs)"       $show "(cd $xdir && $AR x $xabs)"
Line 3150
 
Line 3151
   
     prog)      prog)
       case $host in        case $host in
  *cygwin*) output=`echo $output | ${SED} -e 's,.exe$,,;s,$,.exe,'` ;;   *cygwin*) output=`echo $output | sed -e 's,.exe$,,;s,$,.exe,'` ;;
       esac        esac
       if test -n "$vinfo"; then        if test -n "$vinfo"; then
  $echo "$modename: warning: \`-version-info' is ignored for programs" 1>&2   $echo "$modename: warning: \`-version-info' is ignored for programs" 1>&2
Line 3172
 
Line 3173
  # On Rhapsody replace the C library is the System framework   # On Rhapsody replace the C library is the System framework
  compile_deplibs=`$echo "X $compile_deplibs" | $Xsed -e 's/ -lc / -framework System /'`   compile_deplibs=`$echo "X $compile_deplibs" | $Xsed -e 's/ -lc / -framework System /'`
  finalize_deplibs=`$echo "X $finalize_deplibs" | $Xsed -e 's/ -lc / -framework System /'`   finalize_deplibs=`$echo "X $finalize_deplibs" | $Xsed -e 's/ -lc / -framework System /'`
  case $host in  
  *darwin*)  
    # Don't allow lazy linking, it breaks C++ global constructors  
    compile_command="$compile_command ${wl}-bind_at_load"  
    finalize_command="$finalize_command ${wl}-bind_at_load"  
    ;;  
  esac  
  ;;   ;;
       esac        esac
   
Line 3345
 
Line 3339
      if test -z "$export_symbols"; then       if test -z "$export_symbols"; then
        export_symbols="$output_objdir/$output.exp"         export_symbols="$output_objdir/$output.exp"
        $run $rm $export_symbols         $run $rm $export_symbols
        $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"'
      else       else
        $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"'
        $run eval 'grep -f "$output_objdir/$output.exp" < "$nlist" > "$nlist"T'         $run eval 'grep -f "$output_objdir/$output.exp" < "$nlist" > "$nlist"T'
        $run eval 'mv "$nlist"T "$nlist"'         $run eval 'mv "$nlist"T "$nlist"'
      fi       fi
Line 3355
 
Line 3349
   
    for arg in $dlprefiles; do     for arg in $dlprefiles; do
      $show "extracting global C symbols from \`$arg'"       $show "extracting global C symbols from \`$arg'"
      name=`echo "$arg" | ${SED} -e 's%^.*/%%'`       name=`echo "$arg" | sed -e 's%^.*/%%'`
      $run eval 'echo ": $name " >> "$nlist"'       $run eval 'echo ": $name " >> "$nlist"'
      $run eval "$NM $arg | $global_symbol_pipe >> '$nlist'"       $run eval "$NM $arg | $global_symbol_pipe >> '$nlist'"
    done     done
Line 3370
 
Line 3364
      fi       fi
   
      # Try sorting and uniquifying the output.       # Try sorting and uniquifying the output.
      if grep -v "^: " < "$nlist" |       if grep -v "^: " < "$nlist" | sort +2 | uniq > "$nlist"S; then
  if sort -k 3 </dev/null >/dev/null 2>&1; then  
    sort -k 3  
  else  
    sort +2  
  fi |  
  uniq > "$nlist"S; then  
        :         :
      else       else
        grep -v "^: " < "$nlist" > "$nlist"S         grep -v "^: " < "$nlist" > "$nlist"S
Line 3473
 
Line 3461
  finalize_command=`$echo "X$finalize_command" | $Xsed -e "s% @SYMFILE@%%"`   finalize_command=`$echo "X$finalize_command" | $Xsed -e "s% @SYMFILE@%%"`
       fi        fi
   
       if test $need_relink = no || test "$build_libtool_libs" != yes; then        if test "$need_relink" = no || test "$build_libtool_libs" != yes; then
  # Replace the output file specification.   # Replace the output file specification.
  compile_command=`$echo "X$compile_command" | $Xsed -e 's%@OUTPUT@%'"$output"'%g'`   compile_command=`$echo "X$compile_command" | $Xsed -e 's%@OUTPUT@%'"$output"'%g'`
  link_command="$compile_command$compile_rpath"   link_command="$compile_command$compile_rpath"
Line 3618
 
Line 3606
  # win32 will think the script is a binary if it has   # win32 will think the script is a binary if it has
  # a .exe suffix, so we strip it off here.   # a .exe suffix, so we strip it off here.
  case $output in   case $output in
    *.exe) output=`echo $output|${SED} 's,.exe$,,'` ;;     *.exe) output=`echo $output|sed 's,.exe$,,'` ;;
  esac   esac
  # test for cygwin because mv fails w/o .exe extensions   # test for cygwin because mv fails w/o .exe extensions
  case $host in   case $host in
Line 3642
 
Line 3630
   
 # Sed substitution that helps us do robust quoting.  It backslashifies  # Sed substitution that helps us do robust quoting.  It backslashifies
 # metacharacters that are still active within double-quoted strings.  # metacharacters that are still active within double-quoted strings.
 Xsed="${SED}"' -e 1s/^X//'  Xsed='sed -e 1s/^X//'
 sed_quote_subst='$sed_quote_subst'  sed_quote_subst='$sed_quote_subst'
   
 # 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 3680
 
Line 3668
   test \"x\$thisdir\" = \"x\$file\" && thisdir=.    test \"x\$thisdir\" = \"x\$file\" && thisdir=.
   
   # Follow symbolic links until we get to the real thisdir.    # Follow symbolic links until we get to the real thisdir.
   file=\`ls -ld \"\$file\" | ${SED} -n 's/.*-> //p'\`    file=\`ls -ld \"\$file\" | sed -n 's/.*-> //p'\`
   while test -n \"\$file\"; do    while test -n \"\$file\"; do
     destdir=\`\$echo \"X\$file\" | \$Xsed -e 's%/[^/]*\$%%'\`      destdir=\`\$echo \"X\$file\" | \$Xsed -e 's%/[^/]*\$%%'\`
   
Line 3693
 
Line 3681
     fi      fi
   
     file=\`\$echo \"X\$file\" | \$Xsed -e 's%^.*/%%'\`      file=\`\$echo \"X\$file\" | \$Xsed -e 's%^.*/%%'\`
     file=\`ls -ld \"\$thisdir/\$file\" | ${SED} -n 's/.*-> //p'\`      file=\`ls -ld \"\$thisdir/\$file\" | sed -n 's/.*-> //p'\`
   done    done
   
   # Try to get the absolute directory name.    # Try to get the absolute directory name.
Line 3707
 
Line 3695
   progdir=\"\$thisdir/$objdir\"    progdir=\"\$thisdir/$objdir\"
   
   if test ! -f \"\$progdir/\$program\" || \\    if test ! -f \"\$progdir/\$program\" || \\
      { file=\`ls -1dt \"\$progdir/\$program\" \"\$progdir/../\$program\" 2>/dev/null | ${SED} 1q\`; \\       { file=\`ls -1dt \"\$progdir/\$program\" \"\$progdir/../\$program\" 2>/dev/null | sed 1q\`; \\
        test \"X\$file\" != \"X\$progdir/\$program\"; }; then         test \"X\$file\" != \"X\$progdir/\$program\"; }; then
   
     file=\"\$\$-\$program\"      file=\"\$\$-\$program\"
Line 3753
 
Line 3741
     $shlibpath_var=\"$temp_rpath\$$shlibpath_var\"      $shlibpath_var=\"$temp_rpath\$$shlibpath_var\"
   
     # Some systems cannot cope with colon-terminated $shlibpath_var      # Some systems cannot cope with colon-terminated $shlibpath_var
     # 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
     $shlibpath_var=\`\$echo \"X\$$shlibpath_var\" | \$Xsed -e 's/::*\$//'\`      $shlibpath_var=\`\$echo \"X\$$shlibpath_var\" | \$Xsed -e 's/::*\$//'\`
   
     export $shlibpath_var      export $shlibpath_var
Line 3841
 
Line 3829
  $show "mkdir $gentop"   $show "mkdir $gentop"
  $run mkdir "$gentop"   $run mkdir "$gentop"
  status=$?   status=$?
  if test $status -ne 0 && test ! -d "$gentop"; then   if test "$status" -ne 0 && test ! -d "$gentop"; then
    exit $status     exit $status
  fi   fi
  generated="$generated $gentop"   generated="$generated $gentop"
Line 3861
 
Line 3849
    $show "mkdir $xdir"     $show "mkdir $xdir"
    $run mkdir "$xdir"     $run mkdir "$xdir"
    status=$?     status=$?
    if test $status -ne 0 && test ! -d "$xdir"; then     if test "$status" -ne 0 && test ! -d "$xdir"; then
      exit $status       exit $status
    fi     fi
    $show "(cd $xdir && $AR x $xabs)"     $show "(cd $xdir && $AR x $xabs)"
Line 3928
 
Line 3916
  fi   fi
       done        done
       # Quote the link command for shipping.        # Quote the link command for shipping.
       relink_command="(cd `pwd`; $SHELL $0 --mode=relink $libtool_args)"        relink_command="(cd `pwd`; $SHELL $0 --mode=relink $libtool_args @inst_prefix_dir@)"
       relink_command=`$echo "X$relink_command" | $Xsed -e "$sed_quote_subst"`        relink_command=`$echo "X$relink_command" | $Xsed -e "$sed_quote_subst"`
   
       # Only create the output if not a dry run.        # Only create the output if not a dry run.
Line 3945
 
Line 3933
        case $deplib in         case $deplib in
        *.la)         *.la)
  name=`$echo "X$deplib" | $Xsed -e 's%^.*/%%'`   name=`$echo "X$deplib" | $Xsed -e 's%^.*/%%'`
  eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $deplib`   eval libdir=`sed -n -e 's/^libdir=\(.*\)$/\1/p' $deplib`
  if test -z "$libdir"; then   if test -z "$libdir"; then
    $echo "$modename: \`$deplib' is not a valid libtool archive" 1>&2     $echo "$modename: \`$deplib' is not a valid libtool archive" 1>&2
    exit 1     exit 1
Line 3959
 
Line 3947
      newdlfiles=       newdlfiles=
      for lib in $dlfiles; do       for lib in $dlfiles; do
        name=`$echo "X$lib" | $Xsed -e 's%^.*/%%'`         name=`$echo "X$lib" | $Xsed -e 's%^.*/%%'`
        eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $lib`         eval libdir=`sed -n -e 's/^libdir=\(.*\)$/\1/p' $lib`
        if test -z "$libdir"; then         if test -z "$libdir"; then
  $echo "$modename: \`$lib' is not a valid libtool archive" 1>&2   $echo "$modename: \`$lib' is not a valid libtool archive" 1>&2
  exit 1   exit 1
Line 3970
 
Line 3958
      newdlprefiles=       newdlprefiles=
      for lib in $dlprefiles; do       for lib in $dlprefiles; do
        name=`$echo "X$lib" | $Xsed -e 's%^.*/%%'`         name=`$echo "X$lib" | $Xsed -e 's%^.*/%%'`
        eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $lib`         eval libdir=`sed -n -e 's/^libdir=\(.*\)$/\1/p' $lib`
        if test -z "$libdir"; then         if test -z "$libdir"; then
  $echo "$modename: \`$lib' is not a valid libtool archive" 1>&2   $echo "$modename: \`$lib' is not a valid libtool archive" 1>&2
  exit 1   exit 1
Line 4018
 
Line 4006
   
 # Directory that this library needs to be installed in:  # Directory that this library needs to be installed in:
 libdir='$install_libdir'"  libdir='$install_libdir'"
    if test "$installed" = no && test $need_relink = yes; then     if test "$installed" = no && test "$need_relink" = yes; then
      $echo >> $output "\       $echo >> $output "\
 relink_command=\"$relink_command\""  relink_command=\"$relink_command\""
    fi     fi
Line 4154
 
Line 4142
   
       # Not a directory, so check to see that there is only one file specified.        # Not a directory, so check to see that there is only one file specified.
       set dummy $files        set dummy $files
       if test $# -gt 2; then        if test "$#" -gt 2; then
  $echo "$modename: \`$dest' is not a directory" 1>&2   $echo "$modename: \`$dest' is not a directory" 1>&2
  $echo "$help" 1>&2   $echo "$help" 1>&2
  exit 1   exit 1
Line 4194
 
Line 4182
   
       *.la)        *.la)
  # Check to see that this really is a libtool archive.   # Check to see that this really is a libtool archive.
  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 :
  else   else
    $echo "$modename: \`$file' is not a valid libtool archive" 1>&2     $echo "$modename: \`$file' is not a valid libtool archive" 1>&2
    $echo "$help" 1>&2     $echo "$help" 1>&2
Line 4229
 
Line 4217
  dir="$dir$objdir"   dir="$dir$objdir"
   
  if test -n "$relink_command"; then   if test -n "$relink_command"; then
      # Determine the prefix the user has applied to our future dir.
      inst_prefix_dir=`$echo "$destdir" | sed "s%$libdir\$%%"`
   
      # Don't allow the user to place us outside of our expected
      # location b/c this prevents finding dependent libraries that
      # are installed to the same prefix.
      if test "$inst_prefix_dir" = "$destdir"; then
        $echo "$modename: error: cannot install \`$file' to a directory not ending in $libdir" 1>&2
        exit 1
      fi
   
      if test -n "$inst_prefix_dir"; then
        # Stick the inst_prefix_dir data into the link command.
        relink_command=`$echo "$relink_command" | sed "s%@inst_prefix_dir@%-inst-prefix-dir $inst_prefix_dir%"`
      else
        relink_command=`$echo "$relink_command" | sed "s%@inst_prefix_dir@%%"`
      fi
   
    $echo "$modename: warning: relinking \`$file'" 1>&2     $echo "$modename: warning: relinking \`$file'" 1>&2
    $show "$relink_command"     $show "$relink_command"
    if $run eval "$relink_command"; then :     if $run eval "$relink_command"; then :
    else     else
      $echo "$modename: error: relink \`$file' with the above command before installing it" 1>&2       $echo "$modename: error: relink \`$file' with the above command before installing it" 1>&2
      continue       exit 1
    fi     fi
  fi   fi
   
Line 4256
 
Line 4262
      $run eval "$striplib $destdir/$realname" || exit $?       $run eval "$striplib $destdir/$realname" || exit $?
    fi     fi
   
    if test $# -gt 0; then     if test "$#" -gt 0; then
      # Delete the old symlinks, and create new ones.       # Delete the old symlinks, and create new ones.
      for linkname       for linkname
      do       do
Line 4343
 
Line 4349
  fi   fi
   
  # Do a test to see if this is really a libtool program.   # Do a test to see if this is really a libtool program.
  case $host in   if (sed -e '4q' $file | egrep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then
  *cygwin*|*mingw*)  
      wrapper=`echo $file | ${SED} -e 's,.exe$,,'`  
      ;;  
  *)  
      wrapper=$file  
      ;;  
  esac  
  if (${SED} -e '4q' $wrapper | egrep "^# Generated by .*$PACKAGE")>/dev/null 2>&1; then  
    notinst_deplibs=     notinst_deplibs=
    relink_command=     relink_command=
   
    # If there is no directory component, then add one.     # If there is no directory component, then add one.
    case $file in     case $file in
    */* | *\\*) . $wrapper ;;     */* | *\\*) . $file ;;
    *) . ./$wrapper ;;     *) . ./$file ;;
    esac     esac
   
    # Check the variables that should have been set.     # Check the variables that should have been set.
    if test -z "$notinst_deplibs"; then     if test -z "$notinst_deplibs"; then
      $echo "$modename: invalid libtool wrapper script \`$wrapper'" 1>&2       $echo "$modename: invalid libtool wrapper script \`$file'" 1>&2
      exit 1       exit 1
    fi     fi
   
Line 4388
 
Line 4386
    relink_command=     relink_command=
    # If there is no directory component, then add one.     # If there is no directory component, then add one.
    case $file in     case $file in
    */* | *\\*) . $wrapper ;;     */* | *\\*) . $file ;;
    *) . ./$wrapper ;;     *) . ./$file ;;
    esac     esac
   
    outputname=     outputname=
Line 4397
 
Line 4395
      if test "$finalize" = yes && test -z "$run"; then       if test "$finalize" = yes && test -z "$run"; then
        tmpdir="/tmp"         tmpdir="/tmp"
        test -n "$TMPDIR" && tmpdir="$TMPDIR"         test -n "$TMPDIR" && tmpdir="$TMPDIR"
                 tmpdir=`mktemp -d $tmpdir/libtool-XXXXXX 2> /dev/null`
                 if test $? = 0 ; then :
                 else
        tmpdir="$tmpdir/libtool-$$"         tmpdir="$tmpdir/libtool-$$"
                 fi
        if $mkdir -p "$tmpdir" && chmod 700 "$tmpdir"; then :         if $mkdir -p "$tmpdir" && chmod 700 "$tmpdir"; then :
        else         else
  $echo "$modename: error: cannot create temporary directory \`$tmpdir'" 1>&2   $echo "$modename: error: cannot create temporary directory \`$tmpdir'" 1>&2
Line 4437
 
Line 4439
      destfile=$destfile.exe       destfile=$destfile.exe
      ;;       ;;
    *:*.exe)     *:*.exe)
      destfile=`echo $destfile | ${SED} -e 's,.exe$,,'`       destfile=`echo $destfile | sed -e 's,.exe$,,'`
      ;;       ;;
    esac     esac
    ;;     ;;
Line 4522
 
Line 4524
     fi      fi
   
     # Exit here if they wanted silent mode.      # Exit here if they wanted silent mode.
     test "$show" = ":" && exit 0      test "$show" = : && exit 0
   
     echo "----------------------------------------------------------------------"      echo "----------------------------------------------------------------------"
     echo "Libraries have been installed in:"      echo "Libraries have been installed in:"
Line 4585
 
Line 4587
       case $file in        case $file in
       *.la)        *.la)
  # Check to see that this really is a libtool archive.   # Check to see that this really is a libtool archive.
  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 :
  else   else
    $echo "$modename: \`$lib' is not a valid libtool archive" 1>&2     $echo "$modename: \`$lib' is not a valid libtool archive" 1>&2
    $echo "$help" 1>&2     $echo "$help" 1>&2
Line 4656
 
Line 4658
       -*) ;;        -*) ;;
       *)        *)
  # Do a test to see if this is really a libtool program.   # Do a test to see if this is really a libtool program.
  if (${SED} -e '4q' $file | egrep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then   if (sed -e '4q' $file | egrep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then
    # If there is no directory component, then add one.     # If there is no directory component, then add one.
    case $file in     case $file in
    */* | *\\*) . $file ;;     */* | *\\*) . $file ;;
Line 4738
 
Line 4740
  objdir="$dir/$objdir"   objdir="$dir/$objdir"
       fi        fi
       name=`$echo "X$file" | $Xsed -e 's%^.*/%%'`        name=`$echo "X$file" | $Xsed -e 's%^.*/%%'`
       test $mode = uninstall && objdir="$dir"        test "$mode" = uninstall && objdir="$dir"
   
       # Remember objdir for removal later, being careful to avoid duplicates        # Remember objdir for removal later, being careful to avoid duplicates
       if test $mode = clean; then        if test "$mode" = clean; then
  case " $rmdirs " in   case " $rmdirs " in
    *" $objdir "*) ;;     *" $objdir "*) ;;
    *) rmdirs="$rmdirs $objdir" ;;     *) rmdirs="$rmdirs $objdir" ;;
Line 4765
 
Line 4767
       case $name in        case $name in
       *.la)        *.la)
  # Possibly a libtool archive, so verify it.   # Possibly a libtool archive, so verify it.
  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
    . $dir/$name     . $dir/$name
   
    # Delete the libtool libraries and symlinks.     # Delete the libtool libraries and symlinks.
Line 4773
 
Line 4775
      rmfiles="$rmfiles $objdir/$n"       rmfiles="$rmfiles $objdir/$n"
    done     done
    test -n "$old_library" && rmfiles="$rmfiles $objdir/$old_library"     test -n "$old_library" && rmfiles="$rmfiles $objdir/$old_library"
    test $mode = clean && rmfiles="$rmfiles $objdir/$name $objdir/${name}i"     test "$mode" = clean && rmfiles="$rmfiles $objdir/$name $objdir/${name}i"
   
    if test $mode = uninstall; then     if test "$mode" = uninstall; then
      if test -n "$library_names"; then       if test -n "$library_names"; then
        # Do each command in the postuninstall commands.         # Do each command in the postuninstall commands.
        eval cmds=\"$postuninstall_cmds\"         eval cmds=\"$postuninstall_cmds\"
Line 4784
 
Line 4786
  IFS="$save_ifs"   IFS="$save_ifs"
  $show "$cmd"   $show "$cmd"
  $run eval "$cmd"   $run eval "$cmd"
  if test $? != 0 && test "$rmforce" != yes; then   if test "$?" -ne 0 && test "$rmforce" != yes; then
    exit_status=1     exit_status=1
  fi   fi
        done         done
Line 4799
 
Line 4801
  IFS="$save_ifs"   IFS="$save_ifs"
  $show "$cmd"   $show "$cmd"
  $run eval "$cmd"   $run eval "$cmd"
  if test $? != 0 && test "$rmforce" != yes; then   if test "$?" -ne 0 && test "$rmforce" != yes; then
    exit_status=1     exit_status=1
  fi   fi
        done         done
Line 4819
 
Line 4821
   
       *)        *)
  # Do a test to see if this is a libtool program.   # Do a test to see if this is a libtool program.
  if test $mode = clean &&   if test "$mode" = clean &&
     (${SED} -e '4q' $file | egrep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then      (sed -e '4q' $file | egrep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then
    relink_command=     relink_command=
    . $dir/$file     . $dir/$file
   


Legend:
line(s) removed in v.1.2 
line(s) changed
 line(s) added in v.1.3

File made using version 1.98 of cvs2html by leaf at 2011-07-21 17:03