summaryrefslogtreecommitdiffstats
path: root/ltmain.sh
diff options
context:
space:
mode:
authorAlexandre Oliva <aoliva@redhat.com>2001-05-20 18:55:59 +0000
committerAlexandre Oliva <aoliva@gcc.gnu.org>2001-05-20 18:55:59 +0000
commit334564454e0f95111edb9164bd2c86813fb26f1f (patch)
tree89773e562cc705e997b9ac2a2ab602c831644c67 /ltmain.sh
parent* invoke.texi: Add more options to summary list. (diff)
downloadgcc-334564454e0f95111edb9164bd2c86813fb26f1f.tar.gz
gcc-334564454e0f95111edb9164bd2c86813fb26f1f.tar.bz2
gcc-334564454e0f95111edb9164bd2c86813fb26f1f.tar.xz
ltconfig, [...]: Upgraded to libtool 1.4a 1.641.2.254.
* ltconfig, ltmain.sh, libtool.m4, ltcf-c.sh, ltcf-cxx.sh, ltcf-gcj.sh: Upgraded to libtool 1.4a 1.641.2.254. Rebuilt a number of subdir/configure scripts to use the new libtool.m4. From-SVN: r42351
Diffstat (limited to 'ltmain.sh')
-rw-r--r--ltmain.sh395
1 files changed, 191 insertions, 204 deletions
diff --git a/ltmain.sh b/ltmain.sh
index daaf6bb5e9e..bc2183585d7 100644
--- a/ltmain.sh
+++ b/ltmain.sh
@@ -56,7 +56,7 @@ modename="$progname"
56PROGRAM=ltmain.sh 56PROGRAM=ltmain.sh
57PACKAGE=libtool 57PACKAGE=libtool
58VERSION=1.4a 58VERSION=1.4a
59TIMESTAMP=" (1.641.2.228 2001/04/20 08:53:18)" 59TIMESTAMP=" (1.641.2.254 2001/05/20 18:44:55)"
60 60
61default_mode= 61default_mode=
62help="Try \`$progname --help' for more information." 62help="Try \`$progname --help' for more information."
@@ -246,6 +246,11 @@ if test -n "$prevopt"; then
246 exit 1 246 exit 1
247fi 247fi
248 248
249# If this variable is set in any of the actions, the command in it
250# will be execed at the end. This prevents here-documents from being
251# left over by shells.
252exec_cmd=
253
249if test -z "$show_help"; then 254if test -z "$show_help"; then
250 255
251 # Infer the operation mode. 256 # Infer the operation mode.
@@ -1110,7 +1115,7 @@ EOF
1110 continue 1115 continue
1111 ;; 1116 ;;
1112 esac 1117 esac
1113 fi 1118 fi # test -n $prev
1114 1119
1115 prevarg="$arg" 1120 prevarg="$arg"
1116 1121
@@ -1151,7 +1156,7 @@ EOF
1151 1156
1152 -export-symbols | -export-symbols-regex) 1157 -export-symbols | -export-symbols-regex)
1153 if test -n "$export_symbols" || test -n "$export_symbols_regex"; then 1158 if test -n "$export_symbols" || test -n "$export_symbols_regex"; then
1154 $echo "$modename: not more than one -exported-symbols argument allowed" 1159 $echo "$modename: more than one -exported-symbols argument is not allowed"
1155 exit 1 1160 exit 1
1156 fi 1161 fi
1157 if test "X$arg" = "X-export-symbols"; then 1162 if test "X$arg" = "X-export-symbols"; then
@@ -1173,7 +1178,7 @@ EOF
1173 esac 1178 esac
1174 continue 1179 continue
1175 ;; 1180 ;;
1176 1181
1177 -L*) 1182 -L*)
1178 dir=`$echo "X$arg" | $Xsed -e 's/^-L//'` 1183 dir=`$echo "X$arg" | $Xsed -e 's/^-L//'`
1179 # We need an absolute path. 1184 # We need an absolute path.
@@ -1207,28 +1212,15 @@ EOF
1207 ;; 1212 ;;
1208 1213
1209 -l*) 1214 -l*)
1210 if test "$arg" = "-lc"; then 1215 if test "X$arg" = "X-lc" || test "X$arg" = "X-lm"; then
1211 case $host in
1212 *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-*-beos*)
1213 # These systems don't actually have c library (as such)
1214 continue
1215 ;;
1216 *-*-rhapsody* | *-*-darwin1.[012])
1217 # Rhapsody C library is in the System framework
1218 deplibs="$deplibs -framework System"
1219 continue
1220 ;;
1221 esac
1222 elif test "$arg" = "-lm"; then
1223 case $host in 1216 case $host in
1224 *-*-cygwin* | *-*-pw32* | *-*-beos*) 1217 *-*-cygwin* | *-*-pw32* | *-*-beos*)
1225 # These systems don't actually have math library (as such) 1218 # These systems don't actually have a C or math library (as such)
1226 continue 1219 continue
1227 ;; 1220 ;;
1228 *-*-rhapsody* | *-*-darwin1.[012]) 1221 *-*-mingw* | *-*-os2*)
1229 # Rhapsody math library is in the System framework 1222 # These systems don't actually have a C library (as such)
1230 deplibs="$deplibs -framework System" 1223 test "X$arg" = "X-lc" && continue
1231 continue
1232 ;; 1224 ;;
1233 esac 1225 esac
1234 fi 1226 fi
@@ -1255,9 +1247,7 @@ EOF
1255 $echo "$modename: warning: assuming \`-no-fast-install' instead" 1>&2 1247 $echo "$modename: warning: assuming \`-no-fast-install' instead" 1>&2
1256 fast_install=no 1248 fast_install=no
1257 ;; 1249 ;;
1258 *) 1250 *) no_install=yes ;;
1259 no_install=yes
1260 ;;
1261 esac 1251 esac
1262 continue 1252 continue
1263 ;; 1253 ;;
@@ -1307,7 +1297,7 @@ EOF
1307 ;; 1297 ;;
1308 1298
1309 -static) 1299 -static)
1310 # The effects of -static are defined in a previous loop. 1300 # The effects of -static are defined in a previous loop.
1311 # We used to do the same as -all-static on platforms that 1301 # We used to do the same as -all-static on platforms that
1312 # didn't have a PIC flag, but the assumption that the effects 1302 # didn't have a PIC flag, but the assumption that the effects
1313 # would be equivalent was wrong. It would break on at least 1303 # would be equivalent was wrong. It would break on at least
@@ -1517,14 +1507,14 @@ EOF
1517 ;; 1507 ;;
1518 esac 1508 esac
1519 ;; 1509 ;;
1520 esac 1510 esac # arg
1521 1511
1522 # Now actually substitute the argument into the commands. 1512 # Now actually substitute the argument into the commands.
1523 if test -n "$arg"; then 1513 if test -n "$arg"; then
1524 compile_command="$compile_command $arg" 1514 compile_command="$compile_command $arg"
1525 finalize_command="$finalize_command $arg" 1515 finalize_command="$finalize_command $arg"
1526 fi 1516 fi
1527 done 1517 done # argument parsing loop
1528 1518
1529 if test -n "$prev"; then 1519 if test -n "$prev"; then
1530 $echo "$modename: the \`$prevarg' option requires an argument" 1>&2 1520 $echo "$modename: the \`$prevarg' option requires an argument" 1>&2
@@ -1582,7 +1572,6 @@ EOF
1582 finalize_command="$finalize_command $arg" 1572 finalize_command="$finalize_command $arg"
1583 fi 1573 fi
1584 1574
1585 oldlibs=
1586 # calculate the name of the file, without its directory 1575 # calculate the name of the file, without its directory
1587 outputname=`$echo "X$output" | $Xsed -e 's%^.*/%%'` 1576 outputname=`$echo "X$output" | $Xsed -e 's%^.*/%%'`
1588 libobjs_save="$libobjs" 1577 libobjs_save="$libobjs"
@@ -1656,8 +1645,8 @@ EOF
1656 newdependency_libs= 1645 newdependency_libs=
1657 newlib_search_path= 1646 newlib_search_path=
1658 need_relink=no # whether we're linking any uninstalled libtool libraries 1647 need_relink=no # whether we're linking any uninstalled libtool libraries
1659 uninst_deplibs= # uninstalled libtool libraries 1648 notinst_deplibs= # not-installed libtool libraries
1660 uninst_path= # paths that contain uninstalled libtool libraries 1649 notinst_path= # paths that contain not-installed libtool libraries
1661 case $linkmode in 1650 case $linkmode in
1662 lib) 1651 lib)
1663 passes="conv link" 1652 passes="conv link"
@@ -1679,34 +1668,29 @@ EOF
1679 newdlprefiles= 1668 newdlprefiles=
1680 passes="conv scan dlopen dlpreopen link" 1669 passes="conv scan dlopen dlpreopen link"
1681 ;; 1670 ;;
1682 *) passes="conv" 1671 *) passes="conv"
1683 ;; 1672 ;;
1684 esac 1673 esac
1685 for pass in $passes; do 1674 for pass in $passes; do
1686 if test "$linkmode,$pass" = "lib,link" ||
1687 test "$linkmode,$pass" = "prog,scan"; then
1688 libs="$deplibs"
1689 deplibs=
1690 fi
1691 if test $linkmode = prog; then 1675 if test $linkmode = prog; then
1676 # Determine which files to process
1692 case $pass in 1677 case $pass in
1693 dlopen) libs="$dlfiles" ;; 1678 dlopen)
1679 libs="$dlfiles"
1680 save_deplibs="$deplibs" # Collect dlpreopened libraries
1681 deplibs=
1682 ;;
1694 dlpreopen) libs="$dlprefiles" ;; 1683 dlpreopen) libs="$dlprefiles" ;;
1695 link) libs="$deplibs %DEPLIBS% $dependency_libs" ;; 1684 link) libs="$deplibs %DEPLIBS% $dependency_libs" ;;
1696 esac 1685 esac
1697 fi 1686 fi
1698 if test $pass = dlopen; then
1699 # Collect dlpreopened libraries
1700 save_deplibs="$deplibs"
1701 deplibs=
1702 fi
1703 for deplib in $libs; do 1687 for deplib in $libs; do
1704 lib= 1688 lib=
1705 found=no 1689 found=no
1706 case $deplib in 1690 case $deplib in
1707 -l*) 1691 -l*)
1708 if test $linkmode != lib && test $linkmode != prog; then 1692 if test $linkmode = oldlib && test $linkmode = obj; then
1709 $echo "$modename: warning: \`-l' is ignored for archives/objects" 1>&2 1693 $echo "$modename: warning: \`-l' is ignored for archives/objects: $deplib" 1>&2
1710 continue 1694 continue
1711 fi 1695 fi
1712 if test $pass = conv; then 1696 if test $pass = conv; then
@@ -1723,6 +1707,7 @@ EOF
1723 fi 1707 fi
1724 done 1708 done
1725 if test "$found" != yes; then 1709 if test "$found" != yes; then
1710 # deplib doesn't seem to be a libtool library
1726 if test "$linkmode,$pass" = "prog,link"; then 1711 if test "$linkmode,$pass" = "prog,link"; then
1727 compile_deplibs="$deplib $compile_deplibs" 1712 compile_deplibs="$deplib $compile_deplibs"
1728 finalize_deplibs="$deplib $finalize_deplibs" 1713 finalize_deplibs="$deplib $finalize_deplibs"
@@ -1732,7 +1717,7 @@ EOF
1732 fi 1717 fi
1733 continue 1718 continue
1734 fi 1719 fi
1735 ;; 1720 ;; # -l
1736 -L*) 1721 -L*)
1737 case $linkmode in 1722 case $linkmode in
1738 lib) 1723 lib)
@@ -1755,11 +1740,11 @@ EOF
1755 fi 1740 fi
1756 ;; 1741 ;;
1757 *) 1742 *)
1758 $echo "$modename: warning: \`-L' is ignored for archives/objects" 1>&2 1743 $echo "$modename: warning: \`-L' is ignored for archives/objects: $deplib" 1>&2
1759 ;; 1744 ;;
1760 esac 1745 esac # linkmode
1761 continue 1746 continue
1762 ;; 1747 ;; # -L
1763 -R*) 1748 -R*)
1764 if test $pass = link; then 1749 if test $pass = link; then
1765 dir=`$echo "X$deplib" | $Xsed -e 's/^-R//'` 1750 dir=`$echo "X$deplib" | $Xsed -e 's/^-R//'`
@@ -1803,21 +1788,17 @@ EOF
1803 fi 1788 fi
1804 continue 1789 continue
1805 ;; 1790 ;;
1806 esac 1791 esac # linkmode
1807 ;; 1792 ;; # *.$libext
1808 *.lo | *.$objext) 1793 *.lo | *.$objext)
1809 if test $pass = conv; then 1794 if test $pass = dlpreopen || test "$dlopen_support" != yes || test "$build_libtool_libs" = no; then
1810 deplibs="$deplib $deplibs" 1795 # If there is no dlopen support or we're linking statically,
1811 elif test $linkmode = prog; then 1796 # we need to preload.
1812 if test $pass = dlpreopen || test "$dlopen_support" != yes || test "$build_libtool_libs" = no; then 1797 newdlprefiles="$newdlprefiles $deplib"
1813 # If there is no dlopen support or we're linking statically, 1798 compile_deplibs="$deplib $compile_deplibs"
1814 # we need to preload. 1799 finalize_deplibs="$deplib $finalize_deplibs"
1815 newdlprefiles="$newdlprefiles $deplib" 1800 else
1816 compile_deplibs="$deplib $compile_deplibs" 1801 newdlfiles="$newdlfiles $deplib"
1817 finalize_deplibs="$deplib $finalize_deplibs"
1818 else
1819 newdlfiles="$newdlfiles $deplib"
1820 fi
1821 fi 1802 fi
1822 continue 1803 continue
1823 ;; 1804 ;;
@@ -1825,7 +1806,7 @@ EOF
1825 alldeplibs=yes 1806 alldeplibs=yes
1826 continue 1807 continue
1827 ;; 1808 ;;
1828 esac 1809 esac # case $deplib
1829 if test $found = yes || test -f "$lib"; then : 1810 if test $found = yes || test -f "$lib"; then :
1830 else 1811 else
1831 $echo "$modename: cannot find the library \`$lib'" 1>&2 1812 $echo "$modename: cannot find the library \`$lib'" 1>&2
@@ -1860,13 +1841,14 @@ EOF
1860 1841
1861 if test "$linkmode,$pass" = "lib,link" || 1842 if test "$linkmode,$pass" = "lib,link" ||
1862 test "$linkmode,$pass" = "prog,scan" || 1843 test "$linkmode,$pass" = "prog,scan" ||
1863 { test $linkmode != prog && test $linkmode != lib; }; then 1844 { test $linkmode = oldlib && test $linkmode = obj; }; then
1845 # Add dl[pre]opened files of deplib
1864 test -n "$dlopen" && dlfiles="$dlfiles $dlopen" 1846 test -n "$dlopen" && dlfiles="$dlfiles $dlopen"
1865 test -n "$dlpreopen" && dlprefiles="$dlprefiles $dlpreopen" 1847 test -n "$dlpreopen" && dlprefiles="$dlprefiles $dlpreopen"
1866 fi 1848 fi
1867 1849
1868 if test $pass = conv; then 1850 if test $pass = conv; then
1869 # only check for convenience libraries 1851 # Only check for convenience libraries
1870 deplibs="$lib $deplibs" 1852 deplibs="$lib $deplibs"
1871 if test -z "$libdir"; then 1853 if test -z "$libdir"; then
1872 if test -z "$old_library"; then 1854 if test -z "$old_library"; then
@@ -1889,7 +1871,7 @@ EOF
1889 exit 1 1871 exit 1
1890 fi 1872 fi
1891 continue 1873 continue
1892 fi 1874 fi # $pass = conv
1893 1875
1894 # Get the name of the library we link against. 1876 # Get the name of the library we link against.
1895 linklib= 1877 linklib=
@@ -1909,15 +1891,13 @@ EOF
1909 fi 1891 fi
1910 if test -z "$dlname" || test "$dlopen_support" != yes || test "$build_libtool_libs" = no; then 1892 if test -z "$dlname" || test "$dlopen_support" != yes || test "$build_libtool_libs" = no; then
1911 # If there is no dlname, no dlopen support or we're linking 1893 # If there is no dlname, no dlopen support or we're linking
1912 # statically, we need to preload. We also need to preload any 1894 # statically, we need to preload.
1913 # dependent libraries so libltdl's deplib preloader doesn't 1895 dlprefiles="$dlprefiles $lib"
1914 # bomb out in the load deplibs phase.
1915 dlprefiles="$dlprefiles $lib $dependency_libs"
1916 else 1896 else
1917 newdlfiles="$newdlfiles $lib" 1897 newdlfiles="$newdlfiles $lib"
1918 fi 1898 fi
1919 continue 1899 continue
1920 fi 1900 fi # $pass = dlopen
1921 1901
1922 # We need an absolute path. 1902 # We need an absolute path.
1923 case $ladir in 1903 case $ladir in
@@ -1948,8 +1928,8 @@ EOF
1948 dir="$ladir/$objdir" 1928 dir="$ladir/$objdir"
1949 absdir="$abs_ladir/$objdir" 1929 absdir="$abs_ladir/$objdir"
1950 # Remove this search path later 1930 # Remove this search path later
1951 uninst_path="$uninst_path $abs_ladir" 1931 notinst_path="$notinst_path $abs_ladir"
1952 fi 1932 fi # $installed = yes
1953 name=`$echo "X$laname" | $Xsed -e 's/\.la$//' -e 's/^lib//'` 1933 name=`$echo "X$laname" | $Xsed -e 's/\.la$//' -e 's/^lib//'`
1954 1934
1955 # This library was specified with -dlpreopen. 1935 # This library was specified with -dlpreopen.
@@ -1968,17 +1948,17 @@ EOF
1968 else 1948 else
1969 newdlprefiles="$newdlprefiles $dir/$linklib" 1949 newdlprefiles="$newdlprefiles $dir/$linklib"
1970 fi 1950 fi
1971 fi 1951 fi # $pass = dlpreopen
1972 1952
1973 if test -z "$libdir"; then 1953 if test -z "$libdir"; then
1974 # link the convenience library 1954 # Link the convenience library
1975 if test $linkmode = lib; then 1955 if test $linkmode = lib; then
1976 deplibs="$dir/$old_library $deplibs" 1956 deplibs="$dir/$old_library $deplibs"
1977 elif test "$linkmode,$pass" = "prog,link"; then 1957 elif test "$linkmode,$pass" = "prog,link"; then
1978 compile_deplibs="$dir/$old_library $compile_deplibs" 1958 compile_deplibs="$dir/$old_library $compile_deplibs"
1979 finalize_deplibs="$dir/$old_library $finalize_deplibs" 1959 finalize_deplibs="$dir/$old_library $finalize_deplibs"
1980 else 1960 else
1981 deplibs="$lib $deplibs" # used for prog,scan pass 1961 deplibs="$lib $deplibs"
1982 fi 1962 fi
1983 continue 1963 continue
1984 fi 1964 fi
@@ -2010,23 +1990,17 @@ EOF
2010 *" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;; 1990 *" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;;
2011 esac 1991 esac
2012 tmp_libs="$tmp_libs $deplib" 1992 tmp_libs="$tmp_libs $deplib"
2013 done 1993 done # for deplib
2014 continue 1994 continue
2015 fi 1995 fi # $linkmode = prog...
2016 1996
2017 if test "$linkmode,$pass" = "prog,link"; then 1997 link_static=no # Whether the deplib will be linked statically
2018 if test -n "$library_names" && 1998 if test -n "$library_names" &&
2019 { test "$prefer_static_libs" = no || test -z "$old_library"; }; then 1999 { test "$prefer_static_libs" = no || test -z "$old_library"; }; then
2020 # We need to hardcode the library path 2000 # Link against this shared library
2021 if test -n "$shlibpath_var"; then
2022 # Make sure the rpath contains only unique directories.
2023 case "$temp_rpath " in
2024 *" $dir "*) ;;
2025 *" $absdir "*) ;;
2026 *) temp_rpath="$temp_rpath $dir" ;;
2027 esac
2028 fi
2029 2001
2002 if test "$linkmode,$pass" = "prog,link" ||
2003 { test $linkmode = lib && test $hardcode_into_libs = yes; }; then
2030 # Hardcode the library path. 2004 # Hardcode the library path.
2031 # Skip directories that are in the system default run-time 2005 # Skip directories that are in the system default run-time
2032 # search path. 2006 # search path.
@@ -2039,7 +2013,6 @@ EOF
2039 esac 2013 esac
2040 ;; 2014 ;;
2041 esac 2015 esac
2042
2043 case " $sys_lib_dlsearch_path " in 2016 case " $sys_lib_dlsearch_path " in
2044 *" $libdir "*) ;; 2017 *" $libdir "*) ;;
2045 *) 2018 *)
@@ -2049,7 +2022,18 @@ EOF
2049 esac 2022 esac
2050 ;; 2023 ;;
2051 esac 2024 esac
2052 fi 2025 if test $linkmode = prog; then
2026 # We need to hardcode the library path
2027 if test -n "$shlibpath_var"; then
2028 # Make sure the rpath contains only unique directories.
2029 case "$temp_rpath " in
2030 *" $dir "*) ;;
2031 *" $absdir "*) ;;
2032 *) temp_rpath="$temp_rpath $dir" ;;
2033 esac
2034 fi
2035 fi
2036 fi # $linkmode,$pass = prog,link...
2053 2037
2054 if test "$alldeplibs" = yes && 2038 if test "$alldeplibs" = yes &&
2055 { test "$deplibs_check_method" = pass_all || 2039 { test "$deplibs_check_method" = pass_all ||
@@ -2058,40 +2042,11 @@ EOF
2058 # We only need to search for static libraries 2042 # We only need to search for static libraries
2059 continue 2043 continue
2060 fi 2044 fi
2061 fi
2062 2045
2063 link_static=no # Whether the deplib will be linked statically
2064 if test -n "$library_names" &&
2065 { test "$prefer_static_libs" = no || test -z "$old_library"; }; then
2066 if test "$installed" = no; then 2046 if test "$installed" = no; then
2067 uninst_deplibs="$uninst_deplibs $lib" 2047 notinst_deplibs="$notinst_deplibs $lib"
2068 need_relink=yes 2048 need_relink=yes
2069 fi 2049 fi
2070 # This is a shared library
2071 if test $linkmode = lib &&
2072 test $hardcode_into_libs = yes; then
2073 # Hardcode the library path.
2074 # Skip directories that are in the system default run-time
2075 # search path.
2076 case " $sys_lib_dlsearch_path " in
2077 *" $absdir "*) ;;
2078 *)
2079 case "$compile_rpath " in
2080 *" $absdir "*) ;;
2081 *) compile_rpath="$compile_rpath $absdir"
2082 esac
2083 ;;
2084 esac
2085 case " $sys_lib_dlsearch_path " in
2086 *" $libdir "*) ;;
2087 *)
2088 case "$finalize_rpath " in
2089 *" $libdir "*) ;;
2090 *) finalize_rpath="$finalize_rpath $libdir"
2091 esac
2092 ;;
2093 esac
2094 fi
2095 2050
2096 if test -n "$old_archive_from_expsyms_cmds"; then 2051 if test -n "$old_archive_from_expsyms_cmds"; then
2097 # figure out the soname 2052 # figure out the soname
@@ -2149,7 +2104,7 @@ EOF
2149 # make sure the library variables are pointing to the new library 2104 # make sure the library variables are pointing to the new library
2150 dir=$output_objdir 2105 dir=$output_objdir
2151 linklib=$newlib 2106 linklib=$newlib
2152 fi 2107 fi # test -n $old_archive_from_expsyms_cmds
2153 2108
2154 if test $linkmode = prog || test "$mode" != relink; then 2109 if test $linkmode = prog || test "$mode" != relink; then
2155 add_shlibpath= 2110 add_shlibpath=
@@ -2248,6 +2203,15 @@ EOF
2248 fi 2203 fi
2249 fi 2204 fi
2250 elif test $linkmode = prog; then 2205 elif test $linkmode = prog; then
2206 if test "$alldeplibs" = yes &&
2207 { test "$deplibs_check_method" = pass_all ||
2208 { test "$build_libtool_libs" = yes &&
2209 test -n "$library_names"; }; }; then
2210 # We only need to search for static libraries
2211 continue
2212 fi
2213
2214 # Try to link the static library
2251 # Here we assume that one of hardcode_direct or hardcode_minus_L 2215 # Here we assume that one of hardcode_direct or hardcode_minus_L
2252 # is not unsupported. This is valid on all known static and 2216 # is not unsupported. This is valid on all known static and
2253 # shared platforms. 2217 # shared platforms.
@@ -2264,6 +2228,7 @@ EOF
2264 if test "$deplibs_check_method" != pass_all; then 2228 if test "$deplibs_check_method" != pass_all; then
2265 # We're trying link a shared library against a static one 2229 # We're trying link a shared library against a static one
2266 # but the system doesn't support it. 2230 # but the system doesn't support it.
2231
2267 # Just print a warning and add the library to dependency_libs so 2232 # Just print a warning and add the library to dependency_libs so
2268 # that the program can be linked against the static library. 2233 # that the program can be linked against the static library.
2269 echo 2234 echo
@@ -2271,13 +2236,30 @@ EOF
2271 echo "*** I have the capability to make that library automatically link in when" 2236 echo "*** I have the capability to make that library automatically link in when"
2272 echo "*** you link to this library. But I can only do this if you have a" 2237 echo "*** you link to this library. But I can only do this if you have a"
2273 echo "*** shared version of the library, which you do not appear to have." 2238 echo "*** shared version of the library, which you do not appear to have."
2239 if test "$module" = yes; then
2240 echo "*** Therefore, libtool will create a static module, that should work "
2241 echo "*** as long as the dlopening application is linked with the -dlopen flag."
2242 if test -z "$global_symbol_pipe"; then
2243 echo
2244 echo "*** However, this would only work if libtool was able to extract symbol"
2245 echo "*** lists from a program, using \`nm' or equivalent, but libtool could"
2246 echo "*** not find such a program. So, this module is probably useless."
2247 echo "*** \`nm' from GNU binutils and a full rebuild may help."
2248 fi
2249 if test "$build_old_libs" = no; then
2250 build_libtool_libs=module
2251 build_old_libs=yes
2252 else
2253 build_libtool_libs=no
2254 fi
2255 fi
2274 else 2256 else
2275 convenience="$convenience $dir/$old_library" 2257 convenience="$convenience $dir/$old_library"
2276 old_convenience="$old_convenience $dir/$old_library" 2258 old_convenience="$old_convenience $dir/$old_library"
2277 deplibs="$dir/$old_library $deplibs" 2259 deplibs="$dir/$old_library $deplibs"
2278 link_static=yes 2260 link_static=yes
2279 fi 2261 fi
2280 fi 2262 fi # link shared/static library?
2281 2263
2282 if test $linkmode = lib; then 2264 if test $linkmode = lib; then
2283 if test -n "$dependency_libs" && 2265 if test -n "$dependency_libs" &&
@@ -2351,10 +2333,9 @@ EOF
2351 *) deplibs="$path $deplibs" ;; 2333 *) deplibs="$path $deplibs" ;;
2352 esac 2334 esac
2353 done 2335 done
2354 fi 2336 fi # link_all_deplibs != no
2355 fi 2337 fi # linkmode = lib
2356 done 2338 done # for deplib in $libs
2357 dependency_libs="$newdependency_libs"
2358 if test $pass = dlpreopen; then 2339 if test $pass = dlpreopen; then
2359 # Link the dlpreopened libraries before other libraries 2340 # Link the dlpreopened libraries before other libraries
2360 for deplib in $save_deplibs; do 2341 for deplib in $save_deplibs; do
@@ -2362,6 +2343,7 @@ EOF
2362 done 2343 done
2363 fi 2344 fi
2364 if test $pass != dlopen; then 2345 if test $pass != dlopen; then
2346 test $pass != scan && dependency_libs="$newdependency_libs"
2365 if test $pass != conv; then 2347 if test $pass != conv; then
2366 # Make sure lib_search_path contains only unique directories. 2348 # Make sure lib_search_path contains only unique directories.
2367 lib_search_path= 2349 lib_search_path=
@@ -2384,40 +2366,20 @@ EOF
2384 eval tmp_libs=\"\$$var\" 2366 eval tmp_libs=\"\$$var\"
2385 new_libs= 2367 new_libs=
2386 for deplib in $tmp_libs; do 2368 for deplib in $tmp_libs; do
2387 # FIXME: Pedantically, this is the right thing to do, so
2388 # that some nasty dependency loop isn't accidentally
2389 # broken:
2390 #new_libs="$deplib $new_libs"
2391 # Pragmatically, this seems to cause very few problems in
2392 # practice:
2393 case $deplib in 2369 case $deplib in
2394 -L*) new_libs="$deplib $new_libs" ;; 2370 -L*) new_libs="$deplib $new_libs" ;;
2395 *) 2371 *)
2396 # And here is the reason: when a library appears more 2372 case " $specialdeplibs " in
2397 # than once as an explicit dependence of a library, or 2373 *" $deplib "*) new_libs="$deplib $new_libs" ;;
2398 # is implicitly linked in more than once by the 2374 *)
2399 # compiler, it is considered special, and multiple 2375 case " $new_libs " in
2400 # occurrences thereof are not removed. Compare this 2376 *" $deplib "*) ;;
2401 # with having the same library being listed as a 2377 *) new_libs="$deplib $new_libs" ;;
2402 # dependency of multiple other libraries: in this case, 2378 esac
2403 # we know (pedantically, we assume) the library does not 2379 ;;
2404 # need to be listed more than once, so we keep only the 2380 esac
2405 # last copy. This is not always right, but it is rare 2381 ;;
2406 # enough that we require users that really mean to play 2382 esac
2407 # such unportable linking tricks to link the library
2408 # using -Wl,-lname, so that libtool does not consider it
2409 # for duplicate removal.
2410 case " $specialdeplibs " in
2411 *" $deplib "*) new_libs="$deplib $new_libs" ;;
2412 *)
2413 case " $new_libs " in
2414 *" $deplib "*) ;;
2415 *) new_libs="$deplib $new_libs" ;;
2416 esac
2417 ;;
2418 esac
2419 ;;
2420 esac
2421 done 2383 done
2422 tmp_libs= 2384 tmp_libs=
2423 for deplib in $new_libs; do 2385 for deplib in $new_libs; do
@@ -2432,9 +2394,14 @@ EOF
2432 esac 2394 esac
2433 done 2395 done
2434 eval $var=\"$tmp_libs\" 2396 eval $var=\"$tmp_libs\"
2435 done 2397 done # for var
2436 fi 2398 fi
2437 done 2399 if test "$pass" = "conv" &&
2400 { test "$linkmode" = "lib" || test "$linkmode" = "prog"; }; then
2401 libs="$deplibs" # reset libs
2402 deplibs=
2403 fi
2404 done # for pass
2438 if test $linkmode = prog; then 2405 if test $linkmode = prog; then
2439 dlfiles="$newdlfiles" 2406 dlfiles="$newdlfiles"
2440 dlprefiles="$newdlprefiles" 2407 dlprefiles="$newdlprefiles"
@@ -2442,10 +2409,6 @@ EOF
2442 2409
2443 case $linkmode in 2410 case $linkmode in
2444 oldlib) 2411 oldlib)
2445 if test -n "$deplibs"; then
2446 $echo "$modename: warning: \`-l' and \`-L' are ignored for archives" 1>&2
2447 fi
2448
2449 if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then 2412 if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then
2450 $echo "$modename: warning: \`-dlopen' is ignored for archives" 1>&2 2413 $echo "$modename: warning: \`-dlopen' is ignored for archives" 1>&2
2451 fi 2414 fi
@@ -2737,7 +2700,7 @@ EOF
2737 fi 2700 fi
2738 2701
2739 # Eliminate all temporary directories. 2702 # Eliminate all temporary directories.
2740 for path in $uninst_path; do 2703 for path in $notinst_path; do
2741 lib_search_path=`echo "$lib_search_path " | sed -e 's% $path % %g'` 2704 lib_search_path=`echo "$lib_search_path " | sed -e 's% $path % %g'`
2742 deplibs=`echo "$deplibs " | sed -e 's% -L$path % %g'` 2705 deplibs=`echo "$deplibs " | sed -e 's% -L$path % %g'`
2743 dependency_libs=`echo "$dependency_libs " | sed -e 's% -L$path % %g'` 2706 dependency_libs=`echo "$dependency_libs " | sed -e 's% -L$path % %g'`
@@ -2788,11 +2751,14 @@ EOF
2788 # Rhapsody C library is in the System framework 2751 # Rhapsody C library is in the System framework
2789 deplibs="$deplibs -framework System" 2752 deplibs="$deplibs -framework System"
2790 ;; 2753 ;;
2754 *-*-netbsd*)
2755 # Don't link with libc until the a.out ld.so is fixed.
2756 ;;
2791 *) 2757 *)
2792 # Add libc to deplibs on all other systems if necessary. 2758 # Add libc to deplibs on all other systems if necessary.
2793 if test $build_libtool_need_lc = "yes"; then 2759 if test $build_libtool_need_lc = "yes"; then
2794 deplibs="$deplibs -lc" 2760 deplibs="$deplibs -lc"
2795 fi 2761 fi
2796 ;; 2762 ;;
2797 esac 2763 esac
2798 fi 2764 fi
@@ -2836,7 +2802,7 @@ EOF
2836 for i in $deplibs; do 2802 for i in $deplibs; do
2837 name="`expr $i : '-l\(.*\)'`" 2803 name="`expr $i : '-l\(.*\)'`"
2838 # If $name is empty we are operating on a -L argument. 2804 # If $name is empty we are operating on a -L argument.
2839 if test "$name" != "" -a "$name" != "0"; then 2805 if test -n "$name" && test "$name" != "0"; then
2840 libname=`eval \\$echo \"$libname_spec\"` 2806 libname=`eval \\$echo \"$libname_spec\"`
2841 deplib_matches=`eval \\$echo \"$library_names_spec\"` 2807 deplib_matches=`eval \\$echo \"$library_names_spec\"`
2842 set dummy $deplib_matches 2808 set dummy $deplib_matches
@@ -2861,7 +2827,7 @@ EOF
2861 for i in $deplibs; do 2827 for i in $deplibs; do
2862 name="`expr $i : '-l\(.*\)'`" 2828 name="`expr $i : '-l\(.*\)'`"
2863 # If $name is empty we are operating on a -L argument. 2829 # If $name is empty we are operating on a -L argument.
2864 if test "$name" != "" -a "$name" != "0"; then 2830 if test -n "$name" && test "$name" != "0"; then
2865 $rm conftest 2831 $rm conftest
2866 $LTCC -o conftest conftest.c $i 2832 $LTCC -o conftest conftest.c $i
2867 # Did it work? 2833 # Did it work?
@@ -2901,7 +2867,7 @@ EOF
2901 for a_deplib in $deplibs; do 2867 for a_deplib in $deplibs; do
2902 name="`expr $a_deplib : '-l\(.*\)'`" 2868 name="`expr $a_deplib : '-l\(.*\)'`"
2903 # If $name is empty we are operating on a -L argument. 2869 # If $name is empty we are operating on a -L argument.
2904 if test "$name" != "" -a "$name" != "0"; then 2870 if test -n "$name" && test "$name" != "0"; then
2905 libname=`eval \\$echo \"$libname_spec\"` 2871 libname=`eval \\$echo \"$libname_spec\"`
2906 for i in $lib_search_path $sys_lib_search_path $shlib_search_path; do 2872 for i in $lib_search_path $sys_lib_search_path $shlib_search_path; do
2907 potential_libs=`ls $i/$libname[.-]* 2>/dev/null` 2873 potential_libs=`ls $i/$libname[.-]* 2>/dev/null`
@@ -2953,7 +2919,7 @@ EOF
2953 for a_deplib in $deplibs; do 2919 for a_deplib in $deplibs; do
2954 name="`expr $a_deplib : '-l\(.*\)'`" 2920 name="`expr $a_deplib : '-l\(.*\)'`"
2955 # If $name is empty we are operating on a -L argument. 2921 # If $name is empty we are operating on a -L argument.
2956 if test "$name" != "" -a "$name" != "0"; then 2922 if test -n "$name" && test "$name" != "0"; then
2957 libname=`eval \\$echo \"$libname_spec\"` 2923 libname=`eval \\$echo \"$libname_spec\"`
2958 for i in $lib_search_path $sys_lib_search_path $shlib_search_path; do 2924 for i in $lib_search_path $sys_lib_search_path $shlib_search_path; do
2959 potential_libs=`ls $i/$libname[.-]* 2>/dev/null` 2925 potential_libs=`ls $i/$libname[.-]* 2>/dev/null`
@@ -3003,6 +2969,13 @@ EOF
3003 libname=$libname_save 2969 libname=$libname_save
3004 name=$name_save 2970 name=$name_save
3005 2971
2972 case $host in
2973 *-*-rhapsody* | *-*-darwin1.[012])
2974 # On Rhapsody replace the C library is the System framework
2975 newdeplibs=`$echo "X $newdeplibs" | $Xsed -e 's/ -lc / -framework System /'`
2976 ;;
2977 esac
2978
3006 if test "$droppeddeps" = yes; then 2979 if test "$droppeddeps" = yes; then
3007 if test "$module" = yes; then 2980 if test "$module" = yes; then
3008 echo 2981 echo
@@ -3122,9 +3095,7 @@ EOF
3122 else 3095 else
3123 soname="$realname" 3096 soname="$realname"
3124 fi 3097 fi
3125 if test x$dlname = x; then 3098 test -z "$dlname" && dlname=$soname
3126 dlname=$soname
3127 fi
3128 3099
3129 lib="$output_objdir/$realname" 3100 lib="$output_objdir/$realname"
3130 for link 3101 for link
@@ -3535,7 +3506,7 @@ EOF
3535 3506
3536 prog) 3507 prog)
3537 case $host in 3508 case $host in
3538 *cygwin*) output=`echo $output | sed -e 's,.exe$,,;s,$,.exe,'` ;; 3509 *cygwin*) output=`echo $output | sed -e 's,.exe$,,;s,$,.exe,'` ;;
3539 esac 3510 esac
3540 if test -n "$vinfo"; then 3511 if test -n "$vinfo"; then
3541 $echo "$modename: warning: \`-version-info' is ignored for programs" 1>&2 3512 $echo "$modename: warning: \`-version-info' is ignored for programs" 1>&2
@@ -3552,6 +3523,14 @@ EOF
3552 fi 3523 fi
3553 fi 3524 fi
3554 3525
3526 case $host in
3527 *-*-rhapsody* | *-*-darwin1.[012])
3528 # On Rhapsody replace the C library is the System framework
3529 compile_deplibs=`$echo "X $compile_deplibs" | $Xsed -e 's/ -lc / -framework System /'`
3530 finalize_deplibs=`$echo "X $finalize_deplibs" | $Xsed -e 's/ -lc / -framework System /'`
3531 ;;
3532 esac
3533
3555 compile_command="$compile_command $compile_deplibs" 3534 compile_command="$compile_command $compile_deplibs"
3556 finalize_command="$finalize_command $finalize_deplibs" 3535 finalize_command="$finalize_command $finalize_deplibs"
3557 3536
@@ -4014,7 +3993,7 @@ relink_command=\"$relink_command\"
4014# This environment variable determines our operation mode. 3993# This environment variable determines our operation mode.
4015if test \"\$libtool_install_magic\" = \"$magic\"; then 3994if test \"\$libtool_install_magic\" = \"$magic\"; then
4016 # install mode needs the following variable: 3995 # install mode needs the following variable:
4017 uninst_deplibs='$uninst_deplibs' 3996 notinst_deplibs='$notinst_deplibs'
4018else 3997else
4019 # When we are sourced in execute mode, \$file and \$echo are already set. 3998 # When we are sourced in execute mode, \$file and \$echo are already set.
4020 if test \"\$libtool_execute_magic\" != \"$magic\"; then 3999 if test \"\$libtool_execute_magic\" != \"$magic\"; then
@@ -4082,8 +4061,9 @@ else
4082 4061
4083 # relink executable if necessary 4062 # relink executable if necessary
4084 if test -n \"\$relink_command\"; then 4063 if test -n \"\$relink_command\"; then
4085 if (eval \$relink_command); then : 4064 if relink_command_output=\`eval \$relink_command 2>&1\`; then :
4086 else 4065 else
4066 $echo \"\$relink_command_output\" >&2
4087 $rm \"\$progdir/\$file\" 4067 $rm \"\$progdir/\$file\"
4088 exit 1 4068 exit 1
4089 fi 4069 fi
@@ -4735,7 +4715,7 @@ relink_command=\"$relink_command\""
4735 4715
4736 # Do a test to see if this is really a libtool program. 4716 # Do a test to see if this is really a libtool program.
4737 if (sed -e '4q' $file | egrep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then 4717 if (sed -e '4q' $file | egrep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then
4738 uninst_deplibs= 4718 notinst_deplibs=
4739 relink_command= 4719 relink_command=
4740 4720
4741 # If there is no directory component, then add one. 4721 # If there is no directory component, then add one.
@@ -4745,13 +4725,13 @@ relink_command=\"$relink_command\""
4745 esac 4725 esac
4746 4726
4747 # Check the variables that should have been set. 4727 # Check the variables that should have been set.
4748 if test -z "$uninst_deplibs"; then 4728 if test -z "$notinst_deplibs"; then
4749 $echo "$modename: invalid libtool wrapper script \`$file'" 1>&2 4729 $echo "$modename: invalid libtool wrapper script \`$file'" 1>&2
4750 exit 1 4730 exit 1
4751 fi 4731 fi
4752 4732
4753 finalize=yes 4733 finalize=yes
4754 for lib in $uninst_deplibs; do 4734 for lib in $notinst_deplibs; do
4755 # Check to see that each library is installed. 4735 # Check to see that each library is installed.
4756 libdir= 4736 libdir=
4757 if test -f "$lib"; then 4737 if test -f "$lib"; then
@@ -4866,11 +4846,10 @@ relink_command=\"$relink_command\""
4866 if test -n "$current_libdirs"; then 4846 if test -n "$current_libdirs"; then
4867 # Maybe just do a dry run. 4847 # Maybe just do a dry run.
4868 test -n "$run" && current_libdirs=" -n$current_libdirs" 4848 test -n "$run" && current_libdirs=" -n$current_libdirs"
4869 exec $SHELL $0 --finish$current_libdirs 4849 exec_cmd='$SHELL $0 --finish$current_libdirs'
4870 exit 1 4850 else
4851 exit 0
4871 fi 4852 fi
4872
4873 exit 0
4874 ;; 4853 ;;
4875 4854
4876 # libtool finish mode 4855 # libtool finish mode
@@ -4908,7 +4887,7 @@ relink_command=\"$relink_command\""
4908 fi 4887 fi
4909 4888
4910 # Exit here if they wanted silent mode. 4889 # Exit here if they wanted silent mode.
4911 test "$show" = : && exit 0 4890 test "$show" = ":" && exit 0
4912 4891
4913 echo "----------------------------------------------------------------------" 4892 echo "----------------------------------------------------------------------"
4914 echo "Libraries have been installed in:" 4893 echo "Libraries have been installed in:"
@@ -5073,11 +5052,8 @@ relink_command=\"$relink_command\""
5073 LANG="$save_LANG"; export LANG 5052 LANG="$save_LANG"; export LANG
5074 fi 5053 fi
5075 5054
5076 # Now actually exec the command. 5055 # Now prepare to actually exec the command.
5077 eval "exec \$cmd$args" 5056 exec_cmd='"$cmd"$args'
5078
5079 $echo "$modename: cannot exec \$cmd$args"
5080 exit 1
5081 else 5057 else
5082 # Display what would be done. 5058 # Display what would be done.
5083 if test -n "$shlibpath_var"; then 5059 if test -n "$shlibpath_var"; then
@@ -5131,14 +5107,16 @@ relink_command=\"$relink_command\""
5131 5107
5132 # Remember objdir for removal later, being careful to avoid duplicates 5108 # Remember objdir for removal later, being careful to avoid duplicates
5133 if test $mode = clean; then 5109 if test $mode = clean; then
5134 case " $rmdirs " in 5110 case " $rmdirs " in
5135 *" $objdir "*) ;; 5111 *" $objdir "*) ;;
5136 *) rmdirs="$rmdirs $objdir" ;; 5112 *) rmdirs="$rmdirs $objdir" ;;
5137 esac 5113 esac
5138 fi 5114 fi
5139 5115
5140 # Don't error if the file doesn't exist and rm -f was used. 5116 # Don't error if the file doesn't exist and rm -f was used.
5141 if test -L "$file" >/dev/null 2>&1 || test -f "$file"; then 5117 if (test -L "$file") >/dev/null 2>&1 \
5118 || (test -h "$file") >/dev/null 2>&1 \
5119 || test -f "$file"; then
5142 : 5120 :
5143 elif test -d "$file"; then 5121 elif test -d "$file"; then
5144 exit_status=1 5122 exit_status=1
@@ -5239,8 +5217,8 @@ relink_command=\"$relink_command\""
5239 # Try to remove the ${objdir}s in the directories where we deleted files 5217 # Try to remove the ${objdir}s in the directories where we deleted files
5240 for dir in $rmdirs; do 5218 for dir in $rmdirs; do
5241 if test -d "$dir"; then 5219 if test -d "$dir"; then
5242 $show "rmdir $dir" 5220 $show "rmdir $dir"
5243 $run rmdir $dir >/dev/null 2>&1 5221 $run rmdir $dir >/dev/null 2>&1
5244 fi 5222 fi
5245 done 5223 done
5246 5224
@@ -5254,11 +5232,18 @@ relink_command=\"$relink_command\""
5254 ;; 5232 ;;
5255 esac 5233 esac
5256 5234
5257 $echo "$modename: invalid operation mode \`$mode'" 1>&2 5235 if test -z "$exec_cmd"; then
5258 $echo "$generic_help" 1>&2 5236 $echo "$modename: invalid operation mode \`$mode'" 1>&2
5259 exit 1 5237 $echo "$generic_help" 1>&2
5238 exit 1
5239 fi
5260fi # test -z "$show_help" 5240fi # test -z "$show_help"
5261 5241
5242if test -n "$exec_cmd"; then
5243 eval exec $exec_cmd
5244 exit 1
5245fi
5246
5262# We need to display help for each of the modes. 5247# We need to display help for each of the modes.
5263case $mode in 5248case $mode in
5264"") $echo \ 5249"") $echo \
@@ -5316,6 +5301,8 @@ Compile a source file into a libtool library object.
5316This mode accepts the following additional options: 5301This mode accepts the following additional options:
5317 5302
5318 -o OUTPUT-FILE set the output file name to OUTPUT-FILE 5303 -o OUTPUT-FILE set the output file name to OUTPUT-FILE
5304 -prefer-pic try to building PIC objects only
5305 -prefer-non-pic try to building non-PIC objects only
5319 -static always build a \`.o' file suitable for static linking 5306 -static always build a \`.o' file suitable for static linking
5320 5307
5321COMPILE-COMMAND is a command to be used in creating a \`standard' object file 5308COMPILE-COMMAND is a command to be used in creating a \`standard' object file