/[libtool]/libtool/ltmain.in
ViewVC logotype

Diff of /libtool/ltmain.in

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

revision 1.272 by gary, Sat Aug 18 22:25:17 2001 UTC revision 1.273 by gary, Sun Sep 2 22:07:38 2001 UTC
# Line 127  do Line 127  do
127        *[!-_A-Za-z0-9,/]*)        *[!-_A-Za-z0-9,/]*)
128          echo "$progname: invalid tag name: $tagname" 1>&2          echo "$progname: invalid tag name: $tagname" 1>&2
129          exit 1          exit 1
130          ;;          ;;
131        esac        esac
132    
133        case $tagname in        case $tagname in
# Line 136  do Line 136  do
136          # not specially marked.          # not specially marked.
137          ;;          ;;
138        *)        *)
139          if grep "^# ### BEGIN LIBTOOL TAG CONFIG: $tagname$" < "$0" > /dev/null; then          if grep "^# ### BEGIN LIBTOOL TAG CONFIG: $tagname$" < "$0" > /dev/null; then
140            taglist="$taglist $tagname"            taglist="$taglist $tagname"
141            # Evaluate the configuration.            # Evaluate the configuration.
142            eval "`sed -n -e '/^# ### BEGIN LIBTOOL TAG CONFIG: '$tagname'$/,/^# ### END LIBTOOL TAG CONFIG: '$tagname'$/p' < $0`"            eval "`sed -n -e '/^# ### BEGIN LIBTOOL TAG CONFIG: '$tagname'$/,/^# ### END LIBTOOL TAG CONFIG: '$tagname'$/p' < $0`"
143          else          else
144            echo "$progname: ignoring unknown tag $tagname" 1>&2            echo "$progname: ignoring unknown tag $tagname" 1>&2
145          fi          fi
146          ;;          ;;
147        esac        esac
148        ;;        ;;
149      *)      *)
# Line 499  if test -z "$show_help"; then Line 499  if test -z "$show_help"; then
499        # but not from the CC environment variable when ltconfig was run.        # but not from the CC environment variable when ltconfig was run.
500        "`$echo $CC` "*) ;;        "`$echo $CC` "*) ;;
501        *)        *)
502          for z in $available_tags; do          for z in $available_tags; do
503            if grep "^# ### BEGIN LIBTOOL TAG CONFIG: $z$" < "$0" > /dev/null; then            if grep "^# ### BEGIN LIBTOOL TAG CONFIG: $z$" < "$0" > /dev/null; then
504              # Evaluate the configuration.              # Evaluate the configuration.
505              eval "`sed -n -e '/^# ### BEGIN LIBTOOL TAG CONFIG: '$z'$/,/^# ### END LIBTOOL TAG CONFIG: '$z'$/p' < $0`"              eval "`sed -n -e '/^# ### BEGIN LIBTOOL TAG CONFIG: '$z'$/,/^# ### END LIBTOOL TAG CONFIG: '$z'$/p' < $0`"
506              case $base_compile in              case $base_compile in
507              "$CC "*)              "$CC "*)
508                # The compiler in the base compile command matches                # The compiler in the base compile command matches
509                # the one in the tagged configuration.                # the one in the tagged configuration.
510                # Assume this is the tagged configuration we want.                # Assume this is the tagged configuration we want.
511                tagname=$z                tagname=$z
512                break                break
513                ;;                ;;
514              "`$echo $CC` "*)              "`$echo $CC` "*)
515                tagname=$z                tagname=$z
516                break                break
517                ;;                ;;
518              esac              esac
519            fi            fi
520          done          done
521          # If $tagname still isn't set, then no tagged configuration          # If $tagname still isn't set, then no tagged configuration
522          # was found and let the user know that the "--tag" command          # was found and let the user know that the "--tag" command
523          # line option must be used.          # line option must be used.
524          if test -z "$tagname"; then          if test -z "$tagname"; then
525            echo "$modename: unable to infer tagged configuration"            echo "$modename: unable to infer tagged configuration"
526            echo "$modename: specify a tag with \`--tag'" 1>&2            echo "$modename: specify a tag with \`--tag'" 1>&2
527            exit 1            exit 1
528  #        else  #        else
529  #          echo "$modename: using $tagname tagged configuration"  #          echo "$modename: using $tagname tagged configuration"
530          fi          fi
531          ;;          ;;
532        esac        esac
533      fi      fi
# Line 643  EOF Line 643  EOF
643          status=$?          status=$?
644          if test "$status" -ne 0 && test ! -d "${xdir}$objdir"; then          if test "$status" -ne 0 && test ! -d "${xdir}$objdir"; then
645            exit $status            exit $status
646          fi          fi
647        fi        fi
648    
649        if test -z "$output_obj"; then        if test -z "$output_obj"; then
650          # Place PIC objects in $objdir          # Place PIC objects in $objdir
651          command="$command -o $lobj"          command="$command -o $lobj"
652        fi        fi
653    
654        $run $rm "$lobj" "$output_obj"        $run $rm "$lobj" "$output_obj"
# Line 966  EOF Line 966  EOF
966            ;;            ;;
967          objectlist)          objectlist)
968            if test -f "$arg"; then            if test -f "$arg"; then
969              save_arg=$arg              save_arg=$arg
970              moreargs=              moreargs=
971              for fil in `cat $save_arg`              for fil in `cat $save_arg`
972              do              do
973  #             moreargs="$moreargs $fil"  #             moreargs="$moreargs $fil"
974                arg=$fil                arg=$fil
975                # A libtool-controlled object.                # A libtool-controlled object.
976    
977                # Check to see that this really is a libtool object.                # Check to see that this really is a libtool object.
978                if (sed -e '2q' $arg | egrep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then                if (sed -e '2q' $arg | egrep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then
979                  pic_object=                  pic_object=
980                  non_pic_object=                  non_pic_object=
981    
982                  # Read the .lo file                  # Read the .lo file
983                  # If there is no directory component, then add one.                  # If there is no directory component, then add one.
984                  case $arg in                  case $arg in
985                  */* | *\\*) . $arg ;;                  */* | *\\*) . $arg ;;
986                  *) . ./$arg ;;                  *) . ./$arg ;;
987                  esac                  esac
988    
989                  if test -z "$pic_object" || \                  if test -z "$pic_object" || \
990                     test -z "$non_pic_object" ||                     test -z "$non_pic_object" ||
991                     test "$pic_object" = none && \                     test "$pic_object" = none && \
992                     test "$non_pic_object" = none; then                     test "$non_pic_object" = none; then
993                    $echo "$modename: cannot find name of object for \`$arg'" 1>&2                    $echo "$modename: cannot find name of object for \`$arg'" 1>&2
994                    exit 1                    exit 1
995                  fi                  fi
996    
997                  # Extract subdirectory from the argument.                  # Extract subdirectory from the argument.
998                  xdir=`$echo "X$arg" | $Xsed -e 's%/[^/]*$%%'`                  xdir=`$echo "X$arg" | $Xsed -e 's%/[^/]*$%%'`
999                  if test "X$xdir" = "X$arg"; then                  if test "X$xdir" = "X$arg"; then
1000                    xdir=                    xdir=
1001                  else                  else
1002                    xdir="$xdir/"                    xdir="$xdir/"
1003                  fi                  fi
1004    
1005                  if test "$pic_object" != none; then                  if test "$pic_object" != none; then
1006                    # Prepend the subdirectory the object is found in.                    # Prepend the subdirectory the object is found in.
1007                    pic_object="$xdir$pic_object"                    pic_object="$xdir$pic_object"
1008    
1009                    if test "$prev" = dlfiles; then                    if test "$prev" = dlfiles; then
1010                      if test "$build_libtool_libs" = yes && test "$dlopen_support" = yes; then                      if test "$build_libtool_libs" = yes && test "$dlopen_support" = yes; then
1011                        dlfiles="$dlfiles $pic_object"                        dlfiles="$dlfiles $pic_object"
1012                        prev=                        prev=
1013                        continue                        continue
1014                      else                      else
1015                        # If libtool objects are unsupported, then we need to preload.                        # If libtool objects are unsupported, then we need to preload.
1016                        prev=dlprefiles                        prev=dlprefiles
1017                      fi                      fi
1018                    fi                    fi
1019    
1020                    # CHECK ME:  I think I busted this.  -Ossama                    # CHECK ME:  I think I busted this.  -Ossama
1021                    if test "$prev" = dlprefiles; then                    if test "$prev" = dlprefiles; then
1022                      # Preload the old-style object.                      # Preload the old-style object.
1023                      dlprefiles="$dlprefiles $pic_object"                      dlprefiles="$dlprefiles $pic_object"
1024                      prev=                      prev=
1025                    fi                    fi
1026    
1027                    # A PIC object.                    # A PIC object.
1028                    libobjs="$libobjs $pic_object"                    libobjs="$libobjs $pic_object"
1029                    arg="$pic_object"                    arg="$pic_object"
1030                  fi                  fi
1031    
1032                  # Non-PIC object.                  # Non-PIC object.
1033                  if test "$non_pic_object" != none; then                  if test "$non_pic_object" != none; then
1034                    # Prepend the subdirectory the object is found in.                    # Prepend the subdirectory the object is found in.
1035                    non_pic_object="$xdir$non_pic_object"                    non_pic_object="$xdir$non_pic_object"
1036    
1037                    # A standard non-PIC object                    # A standard non-PIC object
1038                    non_pic_objects="$non_pic_objects $non_pic_object"                    non_pic_objects="$non_pic_objects $non_pic_object"
1039                    if test -z "$pic_object" || test "$pic_object" = none ; then                    if test -z "$pic_object" || test "$pic_object" = none ; then
1040                      arg="$non_pic_object"                      arg="$non_pic_object"
1041                    fi                    fi
1042                  fi                  fi
1043                else                else
1044                  # Only an error if not doing a dry-run.                  # Only an error if not doing a dry-run.
1045                  if test -z "$run"; then                  if test -z "$run"; then
1046                    $echo "$modename: \`$arg' is not a valid libtool object" 1>&2                    $echo "$modename: \`$arg' is not a valid libtool object" 1>&2
1047                    exit 1                    exit 1
1048                  else                  else
1049                    # Dry-run case.                    # Dry-run case.
1050    
1051                    # Extract subdirectory from the argument.                    # Extract subdirectory from the argument.
1052                    xdir=`$echo "X$arg" | $Xsed -e 's%/[^/]*$%%'`                    xdir=`$echo "X$arg" | $Xsed -e 's%/[^/]*$%%'`
1053                    if test "X$xdir" = "X$arg"; then                    if test "X$xdir" = "X$arg"; then
1054                      xdir=                      xdir=
1055                    else                    else
1056                      xdir="$xdir/"                      xdir="$xdir/"
1057                    fi                    fi
1058    
1059                    pic_object=`$echo "X${xdir}${objdir}/${arg}" | $Xsed -e "$lo2o"`                    pic_object=`$echo "X${xdir}${objdir}/${arg}" | $Xsed -e "$lo2o"`
1060                    non_pic_object=`$echo "X${xdir}${arg}" | $Xsed -e "$lo2o"`                    non_pic_object=`$echo "X${xdir}${arg}" | $Xsed -e "$lo2o"`
1061                    libobjs="$libobjs $pic_object"                    libobjs="$libobjs $pic_object"
1062                    non_pic_objects="$non_pic_objects $non_pic_object"                    non_pic_objects="$non_pic_objects $non_pic_object"
1063                  fi                  fi
1064                fi                fi
1065              done              done
1066            else            else
1067              $echo "$modename: link input file \`$save_arg' does not exist"              $echo "$modename: link input file \`$save_arg' does not exist"
1068              exit 1              exit 1
1069            fi            fi
1070            arg=$save_arg            arg=$save_arg
1071            prev=            prev=
1072            continue            continue
1073            ;;            ;;
# Line 1232  EOF Line 1232  EOF
1232              continue              continue
1233            esac            esac
1234          fi          fi
1235          if test "X$arg" = "X-lc_r"; then          if test "X$arg" = "X-lc_r"; then
1236           case $host in           case $host in
1237           *-*-openbsd*)           *-*-openbsd*)
1238             # Do not include libc_r directly, use -pthread flag.             # Do not include libc_r directly, use -pthread flag.
1239             continue             continue
1240             ;;             ;;
1241           esac           esac
1242          fi          fi
1243          deplibs="$deplibs $arg"          deplibs="$deplibs $arg"
1244          continue          continue
1245          ;;          ;;
# Line 1400  EOF Line 1400  EOF
1400    
1401          # Check to see that this really is a libtool object.          # Check to see that this really is a libtool object.
1402          if (sed -e '2q' $arg | egrep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then          if (sed -e '2q' $arg | egrep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then
1403            pic_object=            pic_object=
1404            non_pic_object=            non_pic_object=
1405    
1406            # Read the .lo file            # Read the .lo file
1407            # If there is no directory component, then add one.            # If there is no directory component, then add one.
1408            case $arg in            case $arg in
1409            */* | *\\*) . $arg ;;            */* | *\\*) . $arg ;;
1410            *) . ./$arg ;;            *) . ./$arg ;;
1411            esac            esac
1412    
1413            if test -z "$pic_object" || \            if test -z "$pic_object" || \
1414               test -z "$non_pic_object" ||               test -z "$non_pic_object" ||
1415               test "$pic_object" = none && \               test "$pic_object" = none && \
1416               test "$non_pic_object" = none; then               test "$non_pic_object" = none; then
1417              $echo "$modename: cannot find name of object for \`$arg'" 1>&2              $echo "$modename: cannot find name of object for \`$arg'" 1>&2
1418              exit 1              exit 1
1419            fi            fi
1420    
1421            # Extract subdirectory from the argument.            # Extract subdirectory from the argument.
1422            xdir=`$echo "X$arg" | $Xsed -e 's%/[^/]*$%%'`            xdir=`$echo "X$arg" | $Xsed -e 's%/[^/]*$%%'`
# Line 1426  EOF Line 1426  EOF
1426              xdir="$xdir/"              xdir="$xdir/"
1427            fi            fi
1428    
1429            if test "$pic_object" != none; then            if test "$pic_object" != none; then
1430              # Prepend the subdirectory the object is found in.              # Prepend the subdirectory the object is found in.
1431              pic_object="$xdir$pic_object"              pic_object="$xdir$pic_object"
1432    
1433              if test "$prev" = dlfiles; then              if test "$prev" = dlfiles; then
1434                if test "$build_libtool_libs" = yes && test "$dlopen_support" = yes; then                if test "$build_libtool_libs" = yes && test "$dlopen_support" = yes; then
1435                  dlfiles="$dlfiles $pic_object"                  dlfiles="$dlfiles $pic_object"
1436                  prev=                  prev=
1437                  continue                  continue
1438                else                else
1439                  # If libtool objects are unsupported, then we need to preload.                  # If libtool objects are unsupported, then we need to preload.
1440                  prev=dlprefiles                  prev=dlprefiles
1441                fi                fi
1442              fi              fi
1443    
1444              # CHECK ME:  I think I busted this.  -Ossama              # CHECK ME:  I think I busted this.  -Ossama
1445              if test "$prev" = dlprefiles; then              if test "$prev" = dlprefiles; then
1446                # Preload the old-style object.                # Preload the old-style object.
1447                dlprefiles="$dlprefiles $pic_object"                dlprefiles="$dlprefiles $pic_object"
1448                prev=                prev=
1449              fi              fi
1450    
1451              # A PIC object.              # A PIC object.
1452              libobjs="$libobjs $pic_object"              libobjs="$libobjs $pic_object"
1453              arg="$pic_object"              arg="$pic_object"
1454            fi            fi
1455    
1456            # Non-PIC object.            # Non-PIC object.
1457            if test "$non_pic_object" != none; then            if test "$non_pic_object" != none; then
1458              # Prepend the subdirectory the object is found in.              # Prepend the subdirectory the object is found in.
1459              non_pic_object="$xdir$non_pic_object"              non_pic_object="$xdir$non_pic_object"
1460    
1461              # A standard non-PIC object              # A standard non-PIC object
1462              non_pic_objects="$non_pic_objects $non_pic_object"              non_pic_objects="$non_pic_objects $non_pic_object"
1463              if test -z "$pic_object" || test "$pic_object" = none ; then              if test -z "$pic_object" || test "$pic_object" = none ; then
1464                arg="$non_pic_object"                arg="$non_pic_object"
1465              fi              fi
1466            fi            fi
1467          else          else
1468            # Only an error if not doing a dry-run.            # Only an error if not doing a dry-run.
1469            if test -z "$run"; then            if test -z "$run"; then
1470              $echo "$modename: \`$arg' is not a valid libtool object" 1>&2              $echo "$modename: \`$arg' is not a valid libtool object" 1>&2
1471              exit 1              exit 1
1472            else            else
1473              # Dry-run case.              # Dry-run case.
1474    
1475              # Extract subdirectory from the argument.              # Extract subdirectory from the argument.
1476              xdir=`$echo "X$arg" | $Xsed -e 's%/[^/]*$%%'`              xdir=`$echo "X$arg" | $Xsed -e 's%/[^/]*$%%'`
# Line 1480  EOF Line 1480  EOF
1480                xdir="$xdir/"                xdir="$xdir/"
1481              fi              fi
1482    
1483              pic_object=`$echo "X${xdir}${objdir}/${arg}" | $Xsed -e "$lo2o"`              pic_object=`$echo "X${xdir}${objdir}/${arg}" | $Xsed -e "$lo2o"`
1484              non_pic_object=`$echo "X${xdir}${arg}" | $Xsed -e "$lo2o"`              non_pic_object=`$echo "X${xdir}${arg}" | $Xsed -e "$lo2o"`
1485              libobjs="$libobjs $pic_object"              libobjs="$libobjs $pic_object"
1486              non_pic_objects="$non_pic_objects $non_pic_object"              non_pic_objects="$non_pic_objects $non_pic_object"
1487            fi            fi
1488          fi          fi
1489          ;;          ;;
1490    
# Line 1549  EOF Line 1549  EOF
1549        # but not from the CC environment variable when ltconfig was run.        # but not from the CC environment variable when ltconfig was run.
1550        "`$echo $CC` "*) ;;        "`$echo $CC` "*) ;;
1551        *)        *)
1552          for z in $available_tags; do          for z in $available_tags; do
1553            if grep "^# ### BEGIN LIBTOOL TAG CONFIG: $z$" < "$0" > /dev/null; then            if grep "^# ### BEGIN LIBTOOL TAG CONFIG: $z$" < "$0" > /dev/null; then
1554              # Evaluate the configuration.              # Evaluate the configuration.
1555              eval "`sed -n -e '/^# ### BEGIN LIBTOOL TAG CONFIG: '$z'$/,/^# ### END LIBTOOL TAG CONFIG: '$z'$/p' < $0`"              eval "`sed -n -e '/^# ### BEGIN LIBTOOL TAG CONFIG: '$z'$/,/^# ### END LIBTOOL TAG CONFIG: '$z'$/p' < $0`"
1556              case $base_compile in              case $base_compile in
1557              "$CC "*)              "$CC "*)
1558                # The compiler in $compile_command matches                # The compiler in $compile_command matches
1559                # the one in the tagged configuration.                # the one in the tagged configuration.
1560                # Assume this is the tagged configuration we want.                # Assume this is the tagged configuration we want.
1561                tagname=$z                tagname=$z
1562                break                break
1563                ;;                ;;
1564              "`$echo $CC` "*)              "`$echo $CC` "*)
1565                tagname=$z                tagname=$z
1566                break                break
1567                ;;                ;;
1568              esac              esac
1569            fi            fi
1570          done          done
1571          # If $tagname still isn't set, then no tagged configuration          # If $tagname still isn't set, then no tagged configuration
1572          # was found and let the user know that the "--tag" command          # was found and let the user know that the "--tag" command
1573          # line option must be used.          # line option must be used.
1574          if test -z "$tagname"; then          if test -z "$tagname"; then
1575            echo "$modename: unable to infer tagged configuration"            echo "$modename: unable to infer tagged configuration"
1576            echo "$modename: specify a tag with \`--tag'" 1>&2            echo "$modename: specify a tag with \`--tag'" 1>&2
1577            exit 1            exit 1
1578  #       else  #       else
1579  #         echo "$modename: using $tagname tagged configuration"  #         echo "$modename: using $tagname tagged configuration"
1580          fi          fi
1581          ;;          ;;
1582        esac        esac
1583      fi      fi
# Line 1650  EOF Line 1650  EOF
1650        # not to be eliminated).        # not to be eliminated).
1651        pre_post_deps=        pre_post_deps=
1652        for pre_post_dep in $predeps $postdeps; do        for pre_post_dep in $predeps $postdeps; do
1653          case "$pre_post_deps " in          case "$pre_post_deps " in
1654          *" $pre_post_dep "*) specialdeplibs="$specialdeplibs $pre_post_deps" ;;          *" $pre_post_dep "*) specialdeplibs="$specialdeplibs $pre_post_deps" ;;
1655          esac          esac
1656          pre_post_deps="$pre_post_deps $pre_post_dep"          pre_post_deps="$pre_post_deps $pre_post_dep"
# Line 2067  EOF Line 2067  EOF
2067              continue              continue
2068            fi            fi
2069          fi          fi
2070    
2071          link_static=no # Whether the deplib will be linked statically          link_static=no # Whether the deplib will be linked statically
2072          if test -n "$library_names" &&          if test -n "$library_names" &&
2073             { test "$prefer_static_libs" = no || test -z "$old_library"; }; then             { test "$prefer_static_libs" = no || test -z "$old_library"; }; then
# Line 2285  EOF Line 2285  EOF
2285                echo "*** a static module, that should work as long as the dlopening application"                echo "*** a static module, that should work as long as the dlopening application"
2286                echo "*** is linked with the -dlopen flag to resolve symbols at runtime."                echo "*** is linked with the -dlopen flag to resolve symbols at runtime."
2287                if test -z "$global_symbol_pipe"; then                if test -z "$global_symbol_pipe"; then
2288                  echo                  echo
2289                  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"
2290                  echo "*** lists from a program, using \`nm' or equivalent, but libtool could"                  echo "*** lists from a program, using \`nm' or equivalent, but libtool could"
2291                  echo "*** not find such a program.  So, this module is probably useless."                  echo "*** not find such a program.  So, this module is probably useless."
2292                  echo "*** \`nm' from GNU binutils and a full rebuild may help."                  echo "*** \`nm' from GNU binutils and a full rebuild may help."
2293                fi                fi
2294                if test "$build_old_libs" = no; then                if test "$build_old_libs" = no; then
2295                  build_libtool_libs=module                  build_libtool_libs=module
2296                  build_old_libs=yes                  build_old_libs=yes
2297                else                else
2298                  build_libtool_libs=no                  build_libtool_libs=no
2299                fi                fi
2300              fi              fi
2301            else            else
# Line 2418  EOF Line 2418  EOF
2418              # Pragmatically, this seems to cause very few problems in              # Pragmatically, this seems to cause very few problems in
2419              # practice:              # practice:
2420              case $deplib in              case $deplib in
2421              -L*) new_libs="$deplib $new_libs" ;;              -L*) new_libs="$deplib $new_libs" ;;
2422              *)              *)
2423                # And here is the reason: when a library appears more                # And here is the reason: when a library appears more
2424                # than once as an explicit dependence of a library, or                # than once as an explicit dependence of a library, or
2425                # is implicitly linked in more than once by the                # is implicitly linked in more than once by the
# Line 2434  EOF Line 2434  EOF
2434                # such unportable linking tricks to link the library                # such unportable linking tricks to link the library
2435                # using -Wl,-lname, so that libtool does not consider it                # using -Wl,-lname, so that libtool does not consider it
2436                # for duplicate removal.                # for duplicate removal.
2437                case " $specialdeplibs " in                case " $specialdeplibs " in
2438                *" $deplib "*) new_libs="$deplib $new_libs" ;;                *" $deplib "*) new_libs="$deplib $new_libs" ;;
2439                *)                *)
2440                  case " $new_libs " in                  case " $new_libs " in
2441                  *" $deplib "*) ;;                  *" $deplib "*) ;;
2442                  *) new_libs="$deplib $new_libs" ;;                  *) new_libs="$deplib $new_libs" ;;
2443                  esac                  esac
2444                  ;;                  ;;
2445                esac                esac
2446                ;;                ;;
2447              esac              esac
2448            done            done
2449            tmp_libs=            tmp_libs=
2450            for deplib in $new_libs; do            for deplib in $new_libs; do
# Line 2553  EOF Line 2553  EOF
2553          if test "$build_libtool_libs" = yes; then          if test "$build_libtool_libs" = yes; then
2554            # Building a libtool convenience library.            # Building a libtool convenience library.
2555            # Some compilers have problems with a `.al' extension so            # Some compilers have problems with a `.al' extension so
2556            # convenience libraries should have the same extension an            # convenience libraries should have the same extension an
2557            # archive normally would.            # archive normally would.
2558            oldlibs="$output_objdir/$libname.$libext $oldlibs"            oldlibs="$output_objdir/$libname.$libext $oldlibs"
2559            build_libtool_libs=convenience            build_libtool_libs=convenience
2560            build_old_libs=yes            build_old_libs=yes
# Line 2706  EOF Line 2706  EOF
2706          # Clear the version info if we defaulted, and they specified a release.          # Clear the version info if we defaulted, and they specified a release.
2707          if test -z "$vinfo" && test -n "$release"; then          if test -z "$vinfo" && test -n "$release"; then
2708            major=            major=
2709            verstring="0.0"            case $version_type in
2710              darwin)
2711                # we can't check for "0.0" in archive_cmds due to quoting
2712                # problems, so we reset it completely
2713                verstring=
2714                ;;
2715              *)
2716                verstring="0.0"
2717                ;;
2718              esac
2719            if test "$need_version" = no; then            if test "$need_version" = no; then
2720              versuffix=              versuffix=
2721            else            else
# Line 2736  EOF Line 2745  EOF
2745    
2746        if test "$mode" != relink; then        if test "$mode" != relink; then
2747          # Remove our outputs, but don't remove object files since they          # Remove our outputs, but don't remove object files since they
2748          # may have been created when compiling PIC objects.          # may have been created when compiling PIC objects.
2749          removelist=          removelist=
2750          tempremovelist=`echo "$output_objdir/*"`          tempremovelist=`echo "$output_objdir/*"`
2751          for p in $tempremovelist; do          for p in $tempremovelist; do
2752            case $p in            case $p in
2753              *.$objext)              *.$objext)
2754                 ;;                 ;;
2755              $output_objdir/$outputname | $output_objdir/$libname.* | $output_objdir/${libname}${release}.*)              $output_objdir/$outputname | $output_objdir/$libname.* | $output_objdir/${libname}${release}.*)
2756                 removelist="$removelist $p"                 removelist="$removelist $p"
2757                 ;;                 ;;
2758              *) ;;              *) ;;
2759            esac            esac
2760          done          done
2761          if test -n "$removelist"; then          if test -n "$removelist"; then
2762            $show "${rm}r $removelist"            $show "${rm}r $removelist"
2763            $run ${rm}r $removelist            $run ${rm}r $removelist
2764          fi          fi
2765        fi        fi
2766    
2767        # Now set the variables for building old libraries.        # Now set the variables for building old libraries.
# Line 2818  EOF Line 2827  EOF
2827            *-*-netbsd*)            *-*-netbsd*)
2828              # 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.
2829              ;;              ;;
2830            *-*-openbsd*)            *-*-openbsd*)
2831              # Do not include libc due to us having libc/libc_r.              # Do not include libc due to us having libc/libc_r.
2832              test "X$arg" = "X-lc" && continue              test "X$arg" = "X-lc" && continue
2833              ;;              ;;
2834            *)            *)
2835              # Add libc to deplibs on all other systems if necessary.              # Add libc to deplibs on all other systems if necessary.
2836              if test "$build_libtool_need_lc" = "yes"; then              if test "$build_libtool_need_lc" = "yes"; then
# Line 2883  EOF Line 2892  EOF
2892                    echo "*** Warning: dynamic linker does not accept needed library $i."                    echo "*** Warning: dynamic linker does not accept needed library $i."
2893                    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"
2894                    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"
2895                    echo "*** shared version of the library, which I believe you do not have"                    echo "*** shared version of the library, which I believe you do not have"
2896                    echo "*** because a test_compile did reveal that the linker did not use it for"                    echo "*** because a test_compile did reveal that the linker did not use it for"
2897                    echo "*** its dynamic dependency list that programs get resolved with at runtime."                    echo "*** its dynamic dependency list that programs get resolved with at runtime."
2898                  fi                  fi
# Line 3280  EOF Line 3289  EOF
3289            eval cmds=\"$archive_cmds\"            eval cmds=\"$archive_cmds\"
3290          fi          fi
3291    
3292          if len=`expr "X$cmds" : ".*"` &&          if len=`expr "X$cmds" : ".*"` &&
3293             test "$len" -le "$max_cmd_len" || test "$max_cmd_len" -le -1; then             test "$len" -le "$max_cmd_len" || test "$max_cmd_len" -le -1; then
3294            :            :
3295          else          else
3296            # The command line is too long to link in one step, link piecewise.            # The command line is too long to link in one step, link piecewise.
3297            $echo "creating reloadable object files..."            $echo "creating reloadable object files..."
3298    
3299            # Save the value of $output and $libobjs because we want to            # Save the value of $output and $libobjs because we want to
3300            # use them later.  If we have whole_archive_flag_spec, we            # use them later.  If we have whole_archive_flag_spec, we
# Line 3298  EOF Line 3307  EOF
3307            if test -z "$convenience" || test -z "$whole_archive_flag_spec"; then            if test -z "$convenience" || test -z "$whole_archive_flag_spec"; then
3308              save_libobjs=$libobjs              save_libobjs=$libobjs
3309            fi            fi
3310            save_output=$output            save_output=$output
3311    
3312            # Clear the reloadable object creation command queue and            # Clear the reloadable object creation command queue and
3313            # initialize k to one.            # initialize k to one.
3314            test_cmds=            test_cmds=
3315            concat_cmds=            concat_cmds=
3316            objlist=            objlist=
3317            delfiles=            delfiles=
3318            last_robj=            last_robj=
3319            k=1            k=1
3320            output=$output_objdir/$save_output-${k}.$objext            output=$output_objdir/$save_output-${k}.$objext
3321            # Loop over the list of objects to be linked.            # Loop over the list of objects to be linked.
3322            for obj in $save_libobjs            for obj in $save_libobjs
3323            do            do
3324              eval test_cmds=\"$reload_cmds $objlist $last_robj\"              eval test_cmds=\"$reload_cmds $objlist $last_robj\"
3325              if test "X$objlist" = X ||              if test "X$objlist" = X ||
3326                 { len=`expr "X$test_cmds" : ".*"` &&                 { len=`expr "X$test_cmds" : ".*"` &&
3327                   test "$len" -le "$max_cmd_len"; }; then                   test "$len" -le "$max_cmd_len"; }; then
3328                objlist="$objlist $obj"                objlist="$objlist $obj"
3329              else              else
3330                # The command $test_cmds is almost too long, add a                # The command $test_cmds is almost too long, add a
3331                # command to the queue.                # command to the queue.
3332                if test "$k" -eq 1 ; then                if test "$k" -eq 1 ; then
3333                  # The first file doesn't have a previous command to add.                  # The first file doesn't have a previous command to add.
3334                  eval concat_cmds=\"$reload_cmds $objlist $last_robj\"                  eval concat_cmds=\"$reload_cmds $objlist $last_robj\"
3335                else                else
3336                  # All subsequent reloadable object files will link in                  # All subsequent reloadable object files will link in
3337                  # the last one created.                  # the last one created.
3338                  eval concat_cmds=\"\$concat_cmds~$reload_cmds $objlist $last_robj\"                  eval concat_cmds=\"\$concat_cmds~$reload_cmds $objlist $last_robj\"
3339                fi                fi
3340                last_robj=$output_objdir/$save_output-${k}.$objext                last_robj=$output_objdir/$save_output-${k}.$objext
3341                k=`expr $k + 1`                k=`expr $k + 1`
3342                output=$output_objdir/$save_output-${k}.$objext                output=$output_objdir/$save_output-${k}.$objext
3343                objlist=$obj                objlist=$obj
3344                len=1                len=1
3345              fi              fi
3346            done            done
3347            # Handle the remaining objects by creating one last            # Handle the remaining objects by creating one last
3348            # reloadable object file.  All subsequent reloadable object            # reloadable object file.  All subsequent reloadable object
3349            # files will link in the last one created.            # files will link in the last one created.
3350            test -z "$concat_cmds" || concat_cmds=$concat_cmds~            test -z "$concat_cmds" || concat_cmds=$concat_cmds~
3351            eval concat_cmds=\"\${concat_cmds}$reload_cmds $objlist $last_robj\"            eval concat_cmds=\"\${concat_cmds}$reload_cmds $objlist $last_robj\"
3352    
3353            # Set up a command to remove the reloadale object files            # Set up a command to remove the reloadale object files
3354            # after they are used.            # after they are used.
3355            i=0            i=0
3356            while test "$i" -lt "$k"            while test "$i" -lt "$k"
3357            do            do
3358              i=`expr $i + 1`              i=`expr $i + 1`
3359              delfiles="$delfiles $output_objdir/$save_output-${i}.$objext"              delfiles="$delfiles $output_objdir/$save_output-${i}.$objext"
3360            done            done
3361    
3362            $echo "creating a temporary reloadable object file: $output"            $echo "creating a temporary reloadable object file: $output"
3363    
3364            # Loop through the commands generated above and execute them.            # Loop through the commands generated above and execute them.
3365            IFS="${IFS=   }"; save_ifs="$IFS"; IFS='~'            IFS="${IFS=   }"; save_ifs="$IFS"; IFS='~'
3366            for cmd in $concat_cmds; do            for cmd in $concat_cmds; do
3367              IFS="$save_ifs"              IFS="$save_ifs"
3368              $show "$cmd"              $show "$cmd"
3369              $run eval "$cmd" || exit $?              $run eval "$cmd" || exit $?
3370            done            done
3371            IFS="$save_ifs"            IFS="$save_ifs"
3372    
3373            libobjs=$output            libobjs=$output
3374            # Restore the value of output.            # Restore the value of output.
3375            output=$save_output            output=$save_output
3376    
3377            if test -n "$convenience" && test -n "$whole_archive_flag_spec"; then            if test -n "$convenience" && test -n "$whole_archive_flag_spec"; then
3378              eval libobjs=\"\$libobjs $whole_archive_flag_spec\"              eval libobjs=\"\$libobjs $whole_archive_flag_spec\"
# Line 3372  EOF Line 3381  EOF
3381            # value of $libobjs for piecewise linking.            # value of $libobjs for piecewise linking.
3382    
3383            # Do each of the archive commands.            # Do each of the archive commands.
3384            if test -n "$export_symbols" && test -n "$archive_expsym_cmds"; then            if test -n "$export_symbols" && test -n "$archive_expsym_cmds"; then
3385              eval cmds=\"$archive_expsym_cmds\"              eval cmds=\"$archive_expsym_cmds\"
3386            else            else
3387              eval cmds=\"$archive_cmds\"              eval cmds=\"$archive_cmds\"
3388            fi            fi
3389    
3390            # Append the command to remove the reloadable object files            # Append the command to remove the reloadable object files
3391            # to the just-reset $cmds.            # to the just-reset $cmds.
3392            eval cmds=\"\$cmds~$rm $delfiles\"            eval cmds=\"\$cmds~$rm $delfiles\"
3393          fi          fi
3394          IFS="${IFS=     }"; save_ifs="$IFS"; IFS='~'          IFS="${IFS=     }"; save_ifs="$IFS"; IFS='~'
3395          for cmd in $cmds; do          for cmd in $cmds; do
3396            IFS="$save_ifs"            IFS="$save_ifs"
3397            $show "$cmd"            $show "$cmd"
3398            $run eval "$cmd" || exit $?            $run eval "$cmd" || exit $?
3399          done          done
3400          IFS="$save_ifs"          IFS="$save_ifs"
3401    
3402          # Restore the uninstalled library and exit          # Restore the uninstalled library and exit
3403          if test "$mode" = relink; then          if test "$mode" = relink; then
# Line 4126  else Line 4135  else
4135      if test -n \"\$relink_command\"; then      if test -n \"\$relink_command\"; then
4136        if relink_command_output=\`eval \$relink_command 2>&1\`; then :        if relink_command_output=\`eval \$relink_command 2>&1\`; then :
4137        else        else
4138          $echo \"\$relink_command_output\" >&2          $echo \"\$relink_command_output\" >&2
4139          $rm \"\$progdir/\$file\"          $rm \"\$progdir/\$file\"
4140          exit 1          exit 1
4141        fi        fi
# Line 4279  fi\ Line 4288  fi\
4288        else        else
4289          eval cmds=\"$old_archive_cmds\"          eval cmds=\"$old_archive_cmds\"
4290    
4291          if len=`expr "X$cmds" : ".*"` &&          if len=`expr "X$cmds" : ".*"` &&
4292               test "$len" -le "$max_cmd_len" || test "$max_cmd_len" -le -1; then               test "$len" -le "$max_cmd_len" || test "$max_cmd_len" -le -1; then
4293            :            :
4294          else          else
4295            # the command line is too long to link in one step, link in parts            # the command line is too long to link in one step, link in parts
4296            $echo "using piecewise archive linking..."            $echo "using piecewise archive linking..."
4297            save_RANLIB=$RANLIB            save_RANLIB=$RANLIB
4298            RANLIB=:            RANLIB=:
4299            objlist=            objlist=
4300            concat_cmds=            concat_cmds=
4301            save_oldobjs=$oldobjs            save_oldobjs=$oldobjs
4302            for obj in $save_oldobjs            for obj in $save_oldobjs
4303            do            do
4304              oldobjs="$objlist $obj"              oldobjs="$objlist $obj"
4305              objlist="$objlist $obj"              objlist="$objlist $obj"
4306              eval test_cmds=\"$old_archive_cmds\"              eval test_cmds=\"$old_archive_cmds\"
4307              if len=`expr "X$test_cmds" : ".*"` &&              if len=`expr "X$test_cmds" : ".*"` &&
4308                 test "$len" -le "$max_cmd_len"; then                 test "$len" -le "$max_cmd_len"; then
4309                :                :
4310              else              else
4311                # the above command should be used before it gets too long                # the above command should be used before it gets too long
4312                oldobjs=$objlist                oldobjs=$objlist
4313                test -z "$concat_cmds" || concat_cmds=$concat_cmds~                test -z "$concat_cmds" || concat_cmds=$concat_cmds~
4314                eval concat_cmds=\"\${concat_cmds}$old_archive_cmds\"                eval concat_cmds=\"\${concat_cmds}$old_archive_cmds\"
4315                objlist=                objlist=
4316              fi              fi
4317            done            done
4318            RANLIB=$save_RANLIB            RANLIB=$save_RANLIB
4319            oldobjs=$objlist            oldobjs=$objlist
4320            eval cmds=\"\$concat_cmds~$old_archive_cmds\"            eval cmds=\"\$concat_cmds~$old_archive_cmds\"
4321          fi          fi
4322        fi        fi
4323        IFS="${IFS=       }"; save_ifs="$IFS"; IFS='~'        IFS="${IFS=       }"; save_ifs="$IFS"; IFS='~'
4324        for cmd in $cmds; do        for cmd in $cmds; do
# Line 5158  relink_command=\"$relink_command\"" Line 5167  relink_command=\"$relink_command\""
5167    
5168        # Don't error if the file doesn't exist and rm -f was used.        # Don't error if the file doesn't exist and rm -f was used.
5169        if (test -L "$file") >/dev/null 2>&1 \        if (test -L "$file") >/dev/null 2>&1 \
5170          || (test -h "$file") >/dev/null 2>&1 \          || (test -h "$file") >/dev/null 2>&1 \
5171          || test -f "$file"; then          || test -f "$file"; then
5172          :          :
5173        elif test -d "$file"; then        elif test -d "$file"; then
5174          exit_status=1          exit_status=1
5175          continue          continue
5176        elif test "$rmforce" = yes; then        elif test "$rmforce" = yes; then
5177          continue          continue
5178        fi        fi
5179    
5180        rmfiles="$file"        rmfiles="$file"
# Line 5222  relink_command=\"$relink_command\"" Line 5231  relink_command=\"$relink_command\""
5231          # Possibly a libtool object, so verify it.          # Possibly a libtool object, so verify it.
5232          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
5233    
5234            # Read the .lo file            # Read the .lo file
5235            . $dir/$name            . $dir/$name
5236    
5237            # Add PIC object to the list of files to remove.            # Add PIC object to the list of files to remove.
5238            if test -n "$pic_object" \            if test -n "$pic_object" \
5239               && test "$pic_object" != none; then               && test "$pic_object" != none; then
5240              rmfiles="$rmfiles $dir/$pic_object"              rmfiles="$rmfiles $dir/$pic_object"
5241            fi            fi
5242    
5243            # Add non-PIC object to the list of files to remove.            # Add non-PIC object to the list of files to remove.
5244            if test -n "$non_pic_object" \            if test -n "$non_pic_object" \
5245               && test "$non_pic_object" != none; then               && test "$non_pic_object" != none; then
5246              rmfiles="$rmfiles $dir/$non_pic_object"              rmfiles="$rmfiles $dir/$non_pic_object"
5247            fi            fi
5248          fi          fi
5249          ;;          ;;
5250    

Legend:
Removed from v.1.272  
changed lines
  Added in v.1.273

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26