1
1
# ltmain.sh - Provide generalized library-building support services.
2
2
# NOTE: Changing this file will not affect anything until you rerun configure.
4
# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003
4
# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004
5
5
# Free Software Foundation, Inc.
6
6
# Originally by Gordon Matzigkeit <gord@gnu.ai.mit.edu>, 1996
24
24
# configuration script generated by Autoconf, you may include it under
25
25
# the same distribution terms that you use for the rest of that program.
29
# Work around backward compatibility issue on IRIX 6.5. On IRIX 6.4+, sh
30
# is ksh but when the shell is invoked as "sh" and the current value of
31
# the _XPG environment variable is not equal to 1 (one), the special
32
# positional parameter $0, within a function call, is the name of the
36
# RH: define SED for historic ltconfig's generated by Libtool 1.3
37
[ -z "$SED" ] && SED=sed
39
# The name of this program:
40
progname=`echo "$progpath" | $SED $basename`
50
TIMESTAMP=" (1.1220.2.95 2004/04/11 05:50:42)"
27
53
# Check that we have a working $echo.
28
54
if test "X$1" = X--no-reexec; then
29
55
# Discard the --no-reexec flag, and continue.
38
64
# Restart under the correct shell, and then maybe $echo will work.
39
exec $SHELL "$0" --no-reexec ${1+"$@"}
65
exec $SHELL "$progpath" --no-reexec ${1+"$@"}
42
68
if test "X$1" = X--fallback-echo; then
51
# define SED for historic ltconfig's generated by Libtool 1.3
52
test -z "$SED" && SED=sed
54
# The name of this program.
55
progname=`$echo "$0" | ${SED} 's%^.*/%%'`
62
TIMESTAMP=" (1.1220.2.60 2004/01/25 12:25:08)"
65
78
help="Try \`$progname --help' for more information."
66
79
magic="%%%MAGIC variable%%%"
118
131
lo2o="s/\\.lo\$/.${objext}/"
119
132
o2lo="s/\\.${objext}\$/.lo/"
121
if test -z "$max_cmd_len"; then
126
# If test is not a shell built-in, we'll probably end up computing a
127
# maximum length that is only half of the actual maximum length, but
129
while (test "X"`$SHELL $0 --fallback-echo "X$testring" 2>/dev/null` \
130
= "XX$testring") >/dev/null 2>&1 &&
131
new_result=`expr "X$testring" : ".*" 2>&1` &&
132
max_cmd_len="$new_result" &&
133
test $i != 17 # 1/2 MB should be enough
136
testring="$testring$testring"
139
# Add a significant safety factor because C++ compilers can tack on massive
140
# amounts of additional arguments before passing them to the linker.
141
# It appears as though 1/2 is a usable value.
142
max_cmd_len=`expr $max_cmd_len \/ 2`
145
134
#####################################
146
135
# Shell function definitions:
147
136
# This seems to be the best place for them
138
# func_win32_libid arg
139
# return the library type of file 'arg'
149
141
# Need a lot of goo to handle *both* DLLs and import libs
150
142
# Has to be a shell function in order to 'eat' the argument
151
143
# that is supplied when $file_magic_command is called.
144
func_win32_libid () {
153
145
win32_libid_type="unknown"
154
146
win32_fileres=`file -L $1 2>/dev/null`
155
147
case $win32_fileres in
159
151
*ar\ archive*) # could be an import, or static
160
152
if eval $OBJDUMP -f $1 | $SED -e '10q' 2>/dev/null | \
161
grep -E 'file format pe-i386(.*architecture: i386)?' >/dev/null ; then
153
$EGREP -e 'file format pe-i386(.*architecture: i386)?' >/dev/null ; then
162
154
win32_nmres=`eval $NM -f posix -A $1 | \
163
155
sed -n -e '1,100{/ I /{x;/import/!{s/^/import/;h;p;};x;};}'`
164
156
if test "X$win32_nmres" = "Ximport" ; then
182
174
$echo $win32_libid_type
179
# Infer tagged configuration to use if any are available and
180
# if one wasn't chosen via the "--tag" command line option.
181
# Only attempt this if the compiler in the base compile
182
# command doesn't match the default compiler.
183
# arg is usually of the form 'gcc ...'
185
if test -n "$available_tags" && test -z "$tagname"; then
189
*[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
193
CC_quoted="$CC_quoted $arg"
196
# Blanks in the command may have been stripped by the calling shell,
197
# but not from the CC environment variable when configure was run.
198
" $CC "* | "$CC "* | " `$echo $CC` "* | "`$echo $CC` "* | " $CC_quoted"* | "$CC_quoted "* | " `$echo $CC_quoted` "* | "`$echo $CC_quoted` "*) ;;
199
# Blanks at the start of $base_compile will cause this to fail
200
# if we don't check for them as well.
202
for z in $available_tags; do
203
if grep "^# ### BEGIN LIBTOOL TAG CONFIG: $z$" < "$progpath" > /dev/null; then
204
# Evaluate the configuration.
205
eval "`${SED} -n -e '/^# ### BEGIN LIBTOOL TAG CONFIG: '$z'$/,/^# ### END LIBTOOL TAG CONFIG: '$z'$/p' < $progpath`"
208
# Double-quote args containing other shell metacharacters.
210
*[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
214
CC_quoted="$CC_quoted $arg"
217
" $CC "* | "$CC "* | " `$echo $CC` "* | "`$echo $CC` "* | " $CC_quoted"* | "$CC_quoted "* | " `$echo $CC_quoted` "* | "`$echo $CC_quoted` "*)
218
# The compiler in the base compile command matches
219
# the one in the tagged configuration.
220
# Assume this is the tagged configuration we want.
227
# If $tagname still isn't set, then no tagged configuration
228
# was found and let the user know that the "--tag" command
229
# line option must be used.
230
if test -z "$tagname"; then
231
$echo "$modename: unable to infer tagged configuration"
232
$echo "$modename: specify a tag with \`--tag'" 1>&2
235
# $echo "$modename: using $tagname tagged configuration"
185
241
# End of Shell function definitions
186
242
#####################################
245
eval std_shrext=\"$shrext_cmds\"
188
247
# Parse our command line options once, thoroughly.
189
248
while test "$#" -gt 0
220
279
# not specially marked.
223
if grep "^# ### BEGIN LIBTOOL TAG CONFIG: $tagname$" < "$0" > /dev/null; then
282
if grep "^# ### BEGIN LIBTOOL TAG CONFIG: $tagname$" < "$progpath" > /dev/null; then
224
283
taglist="$taglist $tagname"
225
284
# Evaluate the configuration.
226
eval "`${SED} -n -e '/^# ### BEGIN LIBTOOL TAG CONFIG: '$tagname'$/,/^# ### END LIBTOOL TAG CONFIG: '$tagname'$/p' < $0`"
285
eval "`${SED} -n -e '/^# ### BEGIN LIBTOOL TAG CONFIG: '$tagname'$/,/^# ### END LIBTOOL TAG CONFIG: '$tagname'$/p' < $progpath`"
228
287
$echo "$progname: ignoring unknown tag $tagname" 1>&2
252
311
$echo "Copyright (C) 2003 Free Software Foundation, Inc."
253
312
$echo "This is free software; see the source for copying conditions. There is NO"
254
313
$echo "warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE."
259
${SED} -e '1,/^# ### BEGIN LIBTOOL CONFIG/d' -e '/^# ### END LIBTOOL CONFIG/,$d' $0
318
${SED} -e '1,/^# ### BEGIN LIBTOOL CONFIG/d' -e '/^# ### END LIBTOOL CONFIG/,$d' $progpath
260
319
# Now print the configurations for the tags.
261
320
for tagname in $taglist; do
262
${SED} -n -e "/^# ### BEGIN LIBTOOL TAG CONFIG: $tagname$/,/^# ### END LIBTOOL TAG CONFIG: $tagname$/p" < "$0"
321
${SED} -n -e "/^# ### BEGIN LIBTOOL TAG CONFIG: $tagname$/,/^# ### END LIBTOOL TAG CONFIG: $tagname$/p" < "$progpath"
540
599
*.lo) obj=`$echo "X$libobj" | $Xsed -e "$lo2o"` ;;
542
601
$echo "$modename: cannot determine name of library object from \`$libobj'" 1>&2
547
# Infer tagged configuration to use if any are available and
548
# if one wasn't chosen via the "--tag" command line option.
549
# Only attempt this if the compiler in the base compile
550
# command doesn't match the default compiler.
551
if test -n "$available_tags" && test -z "$tagname"; then
552
case $base_compile in
553
# Blanks in the command may have been stripped by the calling shell,
554
# but not from the CC environment variable when configure was run.
555
" $CC "* | "$CC "* | " `$echo $CC` "* | "`$echo $CC` "*) ;;
556
# Blanks at the start of $base_compile will cause this to fail
557
# if we don't check for them as well.
559
for z in $available_tags; do
560
if grep "^# ### BEGIN LIBTOOL TAG CONFIG: $z$" < "$0" > /dev/null; then
561
# Evaluate the configuration.
562
eval "`${SED} -n -e '/^# ### BEGIN LIBTOOL TAG CONFIG: '$z'$/,/^# ### END LIBTOOL TAG CONFIG: '$z'$/p' < $0`"
563
case "$base_compile " in
564
"$CC "* | " $CC "* | "`$echo $CC` "* | " `$echo $CC` "*)
565
# The compiler in the base compile command matches
566
# the one in the tagged configuration.
567
# Assume this is the tagged configuration we want.
574
# If $tagname still isn't set, then no tagged configuration
575
# was found and let the user know that the "--tag" command
576
# line option must be used.
577
if test -z "$tagname"; then
578
$echo "$modename: unable to infer tagged configuration"
579
$echo "$modename: specify a tag with \`--tag'" 1>&2
582
# $echo "$modename: using $tagname tagged configuration"
606
func_infer_tag $base_compile
588
608
for arg in $later; do
646
666
output_obj=`$echo "X$srcfile" | $Xsed -e 's%^.*/%%' -e 's%\.[^.]*$%%'`.${objext}
647
667
lockfile="$output_obj.lock"
648
668
removelist="$removelist $output_obj $lockfile"
649
trap "$run $rm $removelist; exit 1" 1 2 15
669
trap "$run $rm $removelist; exit $EXIT_FAILURE" 1 2 15
656
676
# Lock this critical section if it is needed
657
677
# We use this script file to make the link, it avoids creating a new file
658
678
if test "$need_locks" = yes; then
659
until $run ln "$0" "$lockfile" 2>/dev/null; do
679
until $run ln "$progpath" "$lockfile" 2>/dev/null; do
660
680
$show "Waiting for $lockfile to be removed"
934
# Infer tagged configuration to use if any are available and
935
# if one wasn't chosen via the "--tag" command line option.
936
# Only attempt this if the compiler in the base link
937
# command doesn't match the default compiler.
938
if test -n "$available_tags" && test -z "$tagname"; then
939
case $base_compile in
940
# Blanks in the command may have been stripped by the calling shell,
941
# but not from the CC environment variable when configure was run.
942
"$CC "* | " $CC "* | "`$echo $CC` "* | " `$echo $CC` "*) ;;
943
# Blanks at the start of $base_compile will cause this to fail
944
# if we don't check for them as well.
946
for z in $available_tags; do
947
if grep "^# ### BEGIN LIBTOOL TAG CONFIG: $z$" < "$0" > /dev/null; then
948
# Evaluate the configuration.
949
eval "`${SED} -n -e '/^# ### BEGIN LIBTOOL TAG CONFIG: '$z'$/,/^# ### END LIBTOOL TAG CONFIG: '$z'$/p' < $0`"
950
case $base_compile in
951
"$CC "* | " $CC "* | "`$echo $CC` "* | " `$echo $CC` "*)
952
# The compiler in $compile_command matches
953
# the one in the tagged configuration.
954
# Assume this is the tagged configuration we want.
961
# If $tagname still isn't set, then no tagged configuration
962
# was found and let the user know that the "--tag" command
963
# line option must be used.
964
if test -z "$tagname"; then
965
$echo "$modename: unable to infer tagged configuration"
966
$echo "$modename: specify a tag with \`--tag'" 1>&2
969
# $echo "$modename: using $tagname tagged configuration"
954
func_infer_tag $base_compile
975
956
# We need to know -static, to get the right output filenames.
1893
1874
name=`$echo "X$deplib" | $Xsed -e 's/^-l//'`
1894
1875
for searchdir in $newlib_search_path $lib_search_path $sys_lib_search_path $shlib_search_path; do
1895
for search_ext in .la $shrext .so .a; do
1876
for search_ext in .la $std_shrext .so .a; do
1896
1877
# Search the libtool library
1897
1878
lib="$searchdir/lib${name}${search_ext}"
1898
1879
if test -f "$lib"; then
1969
1950
if test "$pass" = scan; then
1970
1951
deplibs="$deplib $deplibs"
1971
newlib_search_path="$newlib_search_path "`$echo "X$deplib" | $Xsed -e 's/^-L//'`
1973
1953
compile_deplibs="$deplib $compile_deplibs"
1974
1954
finalize_deplibs="$deplib $finalize_deplibs"
1956
newlib_search_path="$newlib_search_path "`$echo "X$deplib" | $Xsed -e 's/^-L//'`
1978
1959
$echo "$modename: warning: \`-L' is ignored for archives/objects" 1>&2
2051
2032
if test "$found" = yes || test -f "$lib"; then :
2053
2034
$echo "$modename: cannot find the library \`$lib'" 1>&2
2057
2038
# Check to see that this really is a libtool archive.
2058
2039
if (${SED} -e '2q' $lib | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then :
2060
2041
$echo "$modename: \`$lib' is not a valid libtool archive" 1>&2
2064
2045
ladir=`$echo "X$lib" | $Xsed -e 's%/[^/]*$%%'`
2094
2075
if test -z "$libdir"; then
2095
2076
if test -z "$old_library"; then
2096
2077
$echo "$modename: cannot find name of link library for \`$lib'" 1>&2
2099
2080
# It is a libtool convenience library, so add in its objects.
2100
2081
convenience="$convenience $ladir/$objdir/$old_library"
2125
2106
if test -z "$linklib"; then
2126
2107
$echo "$modename: cannot find name of link library for \`$lib'" 1>&2
2130
2111
# This library was specified with -dlopen.
2131
2112
if test "$pass" = dlopen; then
2132
2113
if test -z "$libdir"; then
2133
2114
$echo "$modename: cannot -dlopen a convenience library: \`$lib'" 1>&2
2136
if test -z "$dlname" || test "$dlopen_support" != yes || test "$build_libtool_libs" = no; then
2117
if test -z "$dlname" ||
2118
test "$dlopen_support" != yes ||
2119
test "$build_libtool_libs" = no; then
2137
2120
# If there is no dlname, no dlopen support or we're linking
2138
2121
# statically, we need to preload. We also need to preload any
2139
2122
# dependent libraries so libltdl's deplib preloader doesn't
2296
2279
need_relink=yes
2298
2281
# This is a shared library
2300
# Warn about portability, can't link against -module's on some systems (darwin)
2301
if test "$shouldnotlink" = yes && test "$pass" = link ; then
2283
# Warn about portability, can't link against -module's on
2284
# some systems (darwin)
2285
if test "$shouldnotlink" = yes && test "$pass" = link ; then
2303
2287
if test "$linkmode" = prog; then
2304
2288
$echo "*** Warning: Linking the executable $output against the loadable module"
2306
2290
$echo "*** Warning: Linking the shared library $output against the loadable module"
2308
$echo "*** $linklib is not portable!"
2292
$echo "*** $linklib is not portable!"
2310
2294
if test "$linkmode" = lib &&
2311
2295
test "$hardcode_into_libs" = yes; then
2312
2296
# Hardcode the library path.
2405
2389
*-*-sco3.2v5* ) add_dir="-L$dir" ;;
2407
# if the lib is a module then we can not link against it, someone
2408
# is ignoring the new warnings I added
2409
if /usr/bin/file -L $add 2> /dev/null | grep "bundle" >/dev/null ; then
2391
# if the lib is a module then we can not link against
2392
# it, someone is ignoring the new warnings I added
2393
if /usr/bin/file -L $add 2> /dev/null | $EGREP "bundle" >/dev/null ; then
2410
2394
$echo "** Warning, lib $linklib is a module, not a shared library"
2411
2395
if test -z "$old_library" ; then
2501
2485
elif test "$hardcode_automatic" = yes; then
2502
if test -n "$inst_prefix_dir" && test -f "$inst_prefix_dir$libdir/$linklib" ; then
2486
if test -n "$inst_prefix_dir" &&
2487
test -f "$inst_prefix_dir$libdir/$linklib" ; then
2503
2488
add="$inst_prefix_dir$libdir/$linklib"
2505
2490
add="$libdir/$linklib"
2580
2565
if test "$linkmode" = lib; then
2581
2566
if test -n "$dependency_libs" &&
2582
{ test "$hardcode_into_libs" != yes || test "$build_old_libs" = yes ||
2567
{ test "$hardcode_into_libs" != yes ||
2568
test "$build_old_libs" = yes ||
2583
2569
test "$link_static" = yes; }; then
2584
2570
# Extract -R from dependency_libs
2636
2622
eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $deplib`
2637
2623
if test -z "$libdir"; then
2638
2624
$echo "$modename: \`$deplib' is not a valid libtool archive" 1>&2
2641
2627
if test "$absdir" != "$libdir"; then
2642
2628
$echo "$modename: warning: \`$deplib' seems to be moved" 1>&2
2649
# we do not want to link against static libs, but need to link against shared
2635
# we do not want to link against static libs,
2636
# but need to link against shared
2650
2637
eval deplibrary_names=`${SED} -n -e 's/^library_names=\(.*\)$/\1/p' $deplib`
2651
2638
if test -n "$deplibrary_names" ; then
2652
2639
for tmp in $deplibrary_names ; do
2675
# Again, we only want to link against shared libraries
2676
eval tmp_libs=`$echo "X$deplib" | $Xsed -e "s,^\-l,,"`
2677
for tmp in $newlib_search_path ; do
2678
if test -f "$tmp/lib$tmp_libs.dylib" ; then
2679
eval depdepl="$tmp/lib$tmp_libs.dylib"
2661
# Again, we only want to link against shared libraries
2662
eval tmp_libs=`$echo "X$deplib" | $Xsed -e "s,^\-l,,"`
2663
for tmp in $newlib_search_path ; do
2664
if test -f "$tmp/lib$tmp_libs.dylib" ; then
2665
eval depdepl="$tmp/lib$tmp_libs.dylib"
2690
2676
case " $deplibs " in
2691
2677
*" $depdepl "*) ;;
2692
*) deplibs="$deplibs $depdepl" ;;
2678
*) deplibs="$depdepl $deplibs" ;;
2694
2680
case " $deplibs " in
2695
2681
*" $path "*) ;;
2696
2682
*) deplibs="$deplibs $path" ;;
2840
2827
case $outputname in
2842
2829
name=`$echo "X$outputname" | $Xsed -e 's/\.la$//' -e 's/^lib//'`
2843
eval shared_ext=\"$shrext\"
2830
eval shared_ext=\"$shrext_cmds\"
2844
2831
eval libname=\"$libname_spec\"
2847
2834
if test "$module" = no; then
2848
2835
$echo "$modename: libtool library \`$output' must begin with \`lib'" 1>&2
2849
2836
$echo "$help" 1>&2
2852
2839
if test "$need_lib_prefix" != no; then
2853
2840
# Add the "lib" prefix for modules if required
2854
2841
name=`$echo "X$outputname" | $Xsed -e 's/\.la$//'`
2855
eval shared_ext=\"$shrext\"
2842
eval shared_ext=\"$shrext_cmds\"
2856
2843
eval libname=\"$libname_spec\"
2858
2845
libname=`$echo "X$outputname" | $Xsed -e 's/\.la$//'`
2980
2967
$echo "$modename: AGE \`$age' is not a nonnegative integer" 1>&2
2981
2968
$echo "$modename: \`$vinfo' is not valid version information" 1>&2
2986
2973
if test "$age" -gt "$current"; then
2987
2974
$echo "$modename: AGE \`$age' is greater than the current interface number \`$current'" 1>&2
2988
2975
$echo "$modename: \`$vinfo' is not valid version information" 1>&2
2992
2979
# Calculate the version variables.
3131
3118
$output_objdir/$outputname | $output_objdir/$libname.* | $output_objdir/${libname}${release}.*)
3132
if echo $p | $EGREP -e "$precious_files_regex" >/dev/null 2>&1
3119
if test "X$precious_files_regex" != "X"; then
3120
if echo $p | $EGREP -e "$precious_files_regex" >/dev/null 2>&1
3136
3125
removelist="$removelist $p"
3380
3369
*) potlib=`$echo "X$potlib" | $Xsed -e 's,[^/]*$,,'`"$potliblink";;
3383
# It is ok to link against an archive when
3384
# building a shared library.
3385
if $AR -t $potlib > /dev/null 2>&1; then
3386
newdeplibs="$newdeplibs $a_deplib"
3390
3372
if eval $file_magic_cmd \"\$potlib\" 2>/dev/null \
3392
3374
| $EGREP "$file_magic_regex" > /dev/null; then
4576
4557
# Quote $echo for shipping.
4577
if test "X$echo" = "X$SHELL $0 --fallback-echo"; then
4579
[\\/]* | [A-Za-z]:[\\/]*) qecho="$SHELL $0 --fallback-echo";;
4580
*) qecho="$SHELL `pwd`/$0 --fallback-echo";;
4558
if test "X$echo" = "X$SHELL $progpath --fallback-echo"; then
4560
[\\/]* | [A-Za-z]:[\\/]*) qecho="$SHELL $progpath --fallback-echo";;
4561
*) qecho="$SHELL `pwd`/$progpath --fallback-echo";;
4582
4563
qecho=`$echo "X$qecho" | $Xsed -e "$sed_quote_subst"`
4603
4584
cwrappersource=`$echo ${objdir}/lt-${output}.c`
4604
4585
cwrapper=`$echo ${output}.exe`
4605
4586
$rm $cwrappersource $cwrapper
4606
trap "$rm $cwrappersource $cwrapper; exit 1" 1 2 15
4587
trap "$rm $cwrappersource $cwrapper; exit $EXIT_FAILURE" 1 2 15
4608
4589
cat > $cwrappersource <<EOF
4613
4594
The $output program cannot be directly executed until all the libtool
4614
4595
libraries that it depends on are installed.
4616
4597
This wrapper executable should never be moved out of the build directory.
4617
4598
If it is, it will not operate correctly.
4688
4669
newargz[1] = fnqualify(argv[0]);
4689
4670
/* we know the script has the same name, without the .exe */
4690
4671
/* so make sure newargz[1] doesn't end in .exe */
4691
strendzap(newargz[1],".exe");
4672
strendzap(newargz[1],".exe");
4692
4673
for (i = 1; i < argc; i++)
4693
4674
newargz[i+1] = xstrdup(argv[i]);
4694
4675
newargz[argc+1] = NULL;
4786
lt_error_core (int exit_status, const char * mode,
4767
lt_error_core (int exit_status, const char * mode,
4787
4768
const char * message, va_list ap)
4789
4770
fprintf (stderr, "%s: %s: ", program_name, mode);
4975
4956
$echo >> $output "\
4976
4957
\$echo \"\$0: cannot exec \$program \${1+\"\$@\"}\"
4980
4961
# The program doesn't exist.
4981
4962
\$echo \"\$0: error: \$progdir/\$program does not exist\" 1>&2
4982
4963
\$echo \"This script is just a wrapper for \$program.\" 1>&2
4983
4964
$echo \"See the $PACKAGE documentation for more information.\" 1>&2
4988
4969
chmod +x $output
5171
5152
# Quote the link command for shipping.
5172
relink_command="(cd `pwd`; $SHELL $0 $preserve_args --mode=relink $libtool_args @inst_prefix_dir@)"
5153
relink_command="(cd `pwd`; $SHELL $progpath $preserve_args --mode=relink $libtool_args @inst_prefix_dir@)"
5173
5154
relink_command=`$echo "X$relink_command" | $Xsed -e "$sed_quote_subst"`
5174
5155
if test "$hardcode_automatic" = yes ; then
5177
5160
# Only create the output if not a dry run.
5178
5161
if test -z "$run"; then
5179
5162
for installed in no yes; do
5191
5174
eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $deplib`
5192
5175
if test -z "$libdir"; then
5193
5176
$echo "$modename: \`$deplib' is not a valid libtool archive" 1>&2
5196
# We do not want portage's install root ($D) present. Check only for
5197
# this if the .la is being installed.
5198
if test "$installed" = yes && test "$D"; then
5199
eval mynewdependency_lib="`echo "$libdir/$name" |sed -e "s:$D::g" -e 's://:/:g'`"
5201
mynewdependency_lib="$libdir/$name"
5203
# Do not add duplicates
5204
if test "$mynewdependency_lib"; then
5205
if test -z "`echo $newdependency_libs |grep -e "$mynewdependency_lib"`"; then
5206
newdependency_libs="$newdependency_libs $mynewdependency_lib"
5211
if test "$installed" = yes; then
5212
# Rather use S=WORKDIR if our version of portage supports it.
5213
# This is because some ebuild (gcc) do not use $S as buildroot.
5214
if test "$PWORKDIR"; then
5217
# We do not want portage's build root ($S) present.
5218
if test -n "`echo $deplib |grep -e "$S"`" && test "$S"; then
5219
mynewdependency_lib=""
5220
# We do not want portage's install root ($D) present.
5221
elif test -n "`echo $deplib |grep -e "$D"`" && test "$D"; then
5222
eval mynewdependency_lib="`echo "$deplib" |sed -e "s:$D::g" -e 's://:/:g'`"
5224
mynewdependency_lib="$deplib"
5227
mynewdependency_lib="$deplib"
5229
# Do not add duplicates
5230
if test "$mynewdependency_lib"; then
5231
if test -z "`echo $newdependency_libs |grep -e "$mynewdependency_lib"`"; then
5232
newdependency_libs="$newdependency_libs $mynewdependency_lib"
5179
newdependency_libs="$newdependency_libs $libdir/$name"
5181
*) newdependency_libs="$newdependency_libs $deplib" ;;
5238
5184
dependency_libs="$newdependency_libs"
5284
5230
case $host,$output,$installed,$module,$dlname in
5285
5231
*cygwin*,*lai,yes,no,*.dll | *mingw*,*lai,yes,no,*.dll) tdlname=../bin/$dlname ;;
5287
# Do not add duplicates
5288
if test "$installed" = yes && test "$D"; then
5289
install_libdir="`echo "$install_libdir" |sed -e "s:$D::g" -e 's://:/:g'`"
5291
5233
$echo > $output "\
5292
5234
# $outputname - a libtool library file
5293
5235
# Generated by $PROGRAM - GNU $PACKAGE $VERSION$TIMESTAMP
5754
5696
test -n "$TMPDIR" && tmpdir="$TMPDIR"
5755
5697
tmpdir="$tmpdir/libtool-$$"
5756
if $mkdir "$tmpdir" && chmod 700 "$tmpdir"; then :
5700
if $mkdir "$tmpdir"; then
5758
5704
$echo "$modename: error: cannot create temporary directory \`$tmpdir'" 1>&2
5837
5783
if test -n "$current_libdirs"; then
5838
5784
# Maybe just do a dry run.
5839
5785
test -n "$run" && current_libdirs=" -n$current_libdirs"
5840
exec_cmd='$SHELL $0 $preserve_args --finish$current_libdirs'
5786
exec_cmd='$SHELL $progpath $preserve_args --finish$current_libdirs'
5881
5827
# Exit here if they wanted silent mode.
5882
test "$show" = : && exit 0
5828
test "$show" = : && exit $EXIT_SUCCESS
5884
5830
$echo "----------------------------------------------------------------------"
5885
5831
$echo "Libraries have been installed in:"
6195
6141
if test "$mode" = clean ; then
6196
6142
noexename=$name
6199
6145
file=`$echo $file|${SED} 's,.exe$,,'`
6200
6146
noexename=`$echo $name|${SED} 's,.exe$,,'`
6201
6147
# $file with .exe has already been added to rmfiles,
6241
6187
$echo "$modename: you must specify a MODE" 1>&2
6242
6188
$echo "$generic_help" 1>&2
6247
6193
if test -z "$exec_cmd"; then
6248
6194
$echo "$modename: invalid operation mode \`$mode'" 1>&2
6249
6195
$echo "$generic_help" 1>&2
6252
6198
fi # test -z "$show_help"
6254
6200
if test -n "$exec_cmd"; then
6255
6201
eval exec $exec_cmd
6259
6205
# We need to display help for each of the modes.