ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/deliantra/server/utils/ltmain.sh
(Generate patch)

Comparing deliantra/server/utils/ltmain.sh (file contents):
Revision 1.5 by pippijn, Sun May 7 08:19:30 2006 UTC vs.
Revision 1.6 by root, Sun May 7 12:49:27 2006 UTC

41EXIT_SUCCESS=0 41EXIT_SUCCESS=0
42EXIT_FAILURE=1 42EXIT_FAILURE=1
43 43
44PROGRAM=ltmain.sh 44PROGRAM=ltmain.sh
45PACKAGE=libtool 45PACKAGE=libtool
46VERSION="1.5.22 Debian 1.5.22-4" 46VERSION=1.5.18
47TIMESTAMP=" (1.1220.2.365 2005/12/18 22:14:06)" 47TIMESTAMP=" (1.1220.2.246 2005/05/16 10:00:18)"
48 48
49# See if we are running on zsh, and set the options which allow our 49# See if we are running on zsh, and set the options which allow our
50# commands through without removal of \ escapes. 50# commands through without removal of \ escapes.
51if test -n "${ZSH_VERSION+set}" ; then 51if test -n "${ZSH_VERSION+set}" ; then
52 setopt NO_GLOB_SUBST 52 setopt NO_GLOB_SUBST
86# Sed substitution that helps us do robust quoting. It backslashifies 86# Sed substitution that helps us do robust quoting. It backslashifies
87# metacharacters that are still active within double-quoted strings. 87# metacharacters that are still active within double-quoted strings.
88Xsed="${SED}"' -e 1s/^X//' 88Xsed="${SED}"' -e 1s/^X//'
89sed_quote_subst='s/\([\\`\\"$\\\\]\)/\\\1/g' 89sed_quote_subst='s/\([\\`\\"$\\\\]\)/\\\1/g'
90# test EBCDIC or ASCII 90# test EBCDIC or ASCII
91case `echo X|tr X '\101'` in 91case `echo A|tr A '\301'` in
92 A) # ASCII based system 92 A) # EBCDIC based system
93 # \n is not interpreted correctly by Solaris 8 /usr/ucb/tr 93 SP2NL="tr '\100' '\n'"
94 SP2NL='tr \040 \012' 94 NL2SP="tr '\r\n' '\100\100'"
95 NL2SP='tr \015\012 \040\040'
96 ;; 95 ;;
97 *) # EBCDIC based system 96 *) # Assume ASCII based system
98 SP2NL='tr \100 \n' 97 SP2NL="tr '\040' '\012'"
99 NL2SP='tr \r\n \100\100' 98 NL2SP="tr '\015\012' '\040\040'"
100 ;; 99 ;;
101esac 100esac
102 101
103# NLS nuisances. 102# NLS nuisances.
104# Only set LANG and LC_ALL to C if already set. 103# Only set LANG and LC_ALL to C if already set.
130prevopt= 129prevopt=
131run= 130run=
132show="$echo" 131show="$echo"
133show_help= 132show_help=
134execute_dlfiles= 133execute_dlfiles=
135duplicate_deps=no
136preserve_args=
137lo2o="s/\\.lo\$/.${objext}/" 134lo2o="s/\\.lo\$/.${objext}/"
138o2lo="s/\\.${objext}\$/.lo/" 135o2lo="s/\\.${objext}\$/.lo/"
136quote_scanset='[[~#^*{};<>?'"'"' ]'
139 137
140##################################### 138#####################################
141# Shell function definitions: 139# Shell function definitions:
142# This seems to be the best place for them 140# This seems to be the best place for them
143
144# func_mktempdir [string]
145# Make a temporary directory that won't clash with other running
146# libtool processes, and avoids race conditions if possible. If
147# given, STRING is the basename for that directory.
148func_mktempdir ()
149{
150 my_template="${TMPDIR-/tmp}/${1-$progname}"
151
152 if test "$run" = ":"; then
153 # Return a directory name, but don't create it in dry-run mode
154 my_tmpdir="${my_template}-$$"
155 else
156
157 # If mktemp works, use that first and foremost
158 my_tmpdir=`mktemp -d "${my_template}-XXXXXXXX" 2>/dev/null`
159
160 if test ! -d "$my_tmpdir"; then
161 # Failing that, at least try and use $RANDOM to avoid a race
162 my_tmpdir="${my_template}-${RANDOM-0}$$"
163
164 save_mktempdir_umask=`umask`
165 umask 0077
166 $mkdir "$my_tmpdir"
167 umask $save_mktempdir_umask
168 fi
169
170 # If we're not in dry-run mode, bomb out on failure
171 test -d "$my_tmpdir" || {
172 $echo "cannot create temporary directory \`$my_tmpdir'" 1>&2
173 exit $EXIT_FAILURE
174 }
175 fi
176
177 $echo "X$my_tmpdir" | $Xsed
178}
179
180 141
181# func_win32_libid arg 142# func_win32_libid arg
182# return the library type of file 'arg' 143# return the library type of file 'arg'
183# 144#
184# Need a lot of goo to handle *both* DLLs and import libs 145# Need a lot of goo to handle *both* DLLs and import libs
194 ;; 155 ;;
195 *ar\ archive*) # could be an import, or static 156 *ar\ archive*) # could be an import, or static
196 if eval $OBJDUMP -f $1 | $SED -e '10q' 2>/dev/null | \ 157 if eval $OBJDUMP -f $1 | $SED -e '10q' 2>/dev/null | \
197 $EGREP -e 'file format pe-i386(.*architecture: i386)?' >/dev/null ; then 158 $EGREP -e 'file format pe-i386(.*architecture: i386)?' >/dev/null ; then
198 win32_nmres=`eval $NM -f posix -A $1 | \ 159 win32_nmres=`eval $NM -f posix -A $1 | \
199 $SED -n -e '1,100{/ I /{s,.*,import,;p;q;};}'` 160 sed -n -e '1,100{/ I /{x;/import/!{s/^/import/;h;p;};x;};}'`
200 case $win32_nmres in 161 if test "X$win32_nmres" = "Ximport" ; then
201 import*) win32_libid_type="x86 archive import";; 162 win32_libid_type="x86 archive import"
163 else
202 *) win32_libid_type="x86 archive static";; 164 win32_libid_type="x86 archive static"
203 esac 165 fi
204 fi 166 fi
205 ;; 167 ;;
206 *DLL*) 168 *DLL*)
207 win32_libid_type="x86 DLL" 169 win32_libid_type="x86 DLL"
208 ;; 170 ;;
228{ 190{
229 if test -n "$available_tags" && test -z "$tagname"; then 191 if test -n "$available_tags" && test -z "$tagname"; then
230 CC_quoted= 192 CC_quoted=
231 for arg in $CC; do 193 for arg in $CC; do
232 case $arg in 194 case $arg in
233 *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") 195 *$quote_scanset* | *]* | *\|* | *\&* | *\(* | *\)* | "")
234 arg="\"$arg\"" 196 arg="\"$arg\""
235 ;; 197 ;;
236 esac 198 esac
237 CC_quoted="$CC_quoted $arg" 199 CC_quoted="$CC_quoted $arg"
238 done 200 done
249 eval "`${SED} -n -e '/^# ### BEGIN LIBTOOL TAG CONFIG: '$z'$/,/^# ### END LIBTOOL TAG CONFIG: '$z'$/p' < $progpath`" 211 eval "`${SED} -n -e '/^# ### BEGIN LIBTOOL TAG CONFIG: '$z'$/,/^# ### END LIBTOOL TAG CONFIG: '$z'$/p' < $progpath`"
250 CC_quoted= 212 CC_quoted=
251 for arg in $CC; do 213 for arg in $CC; do
252 # Double-quote args containing other shell metacharacters. 214 # Double-quote args containing other shell metacharacters.
253 case $arg in 215 case $arg in
254 *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") 216 *$quote_scanset* | *]* | *\|* | *\&* | *\(* | *\)* | "")
255 arg="\"$arg\"" 217 arg="\"$arg\""
256 ;; 218 ;;
257 esac 219 esac
258 CC_quoted="$CC_quoted $arg" 220 CC_quoted="$CC_quoted $arg"
259 done 221 done
331 293
332 $show "${rm}r $my_xdir" 294 $show "${rm}r $my_xdir"
333 $run ${rm}r "$my_xdir" 295 $run ${rm}r "$my_xdir"
334 $show "$mkdir $my_xdir" 296 $show "$mkdir $my_xdir"
335 $run $mkdir "$my_xdir" 297 $run $mkdir "$my_xdir"
336 exit_status=$? 298 status=$?
337 if test "$exit_status" -ne 0 && test ! -d "$my_xdir"; then 299 if test "$status" -ne 0 && test ! -d "$my_xdir"; then
338 exit $exit_status 300 exit $status
339 fi 301 fi
340 case $host in 302 case $host in
341 *-darwin*) 303 *-darwin*)
342 $show "Extracting $my_xabs" 304 $show "Extracting $my_xabs"
343 # Do not bother doing anything if just a dry run 305 # Do not bother doing anything if just a dry run
373 else 335 else
374 cd "$darwin_orig_dir" 336 cd "$darwin_orig_dir"
375 func_extract_an_archive "$my_xdir" "$my_xabs" 337 func_extract_an_archive "$my_xdir" "$my_xabs"
376 fi # $darwin_arches 338 fi # $darwin_arches
377 fi # $run 339 fi # $run
378 ;; 340 ;;
379 *) 341 *)
380 func_extract_an_archive "$my_xdir" "$my_xabs" 342 func_extract_an_archive "$my_xdir" "$my_xabs"
381 ;; 343 ;;
382 esac 344 esac
383 my_oldobjs="$my_oldobjs "`find $my_xdir -name \*.$objext -print -o -name \*.lo -print | $NL2SP` 345 my_oldobjs="$my_oldobjs "`find $my_xdir -name \*.$objext -print -o -name \*.lo -print | $NL2SP`
387# End of Shell function definitions 349# End of Shell function definitions
388##################################### 350#####################################
389 351
390# Darwin sucks 352# Darwin sucks
391eval std_shrext=\"$shrext_cmds\" 353eval std_shrext=\"$shrext_cmds\"
392
393disable_libs=no
394 354
395# Parse our command line options once, thoroughly. 355# Parse our command line options once, thoroughly.
396while test "$#" -gt 0 356while test "$#" -gt 0
397do 357do
398 arg="$1" 358 arg="$1"
506 --quiet | --silent) 466 --quiet | --silent)
507 show=: 467 show=:
508 preserve_args="$preserve_args $arg" 468 preserve_args="$preserve_args $arg"
509 ;; 469 ;;
510 470
511 --tag) 471 --tag) prevopt="--tag" prev=tag ;;
512 prevopt="--tag"
513 prev=tag
514 preserve_args="$preserve_args --tag"
515 ;;
516 --tag=*) 472 --tag=*)
517 set tag "$optarg" ${1+"$@"} 473 set tag "$optarg" ${1+"$@"}
518 shift 474 shift
519 prev=tag 475 prev=tag
520 preserve_args="$preserve_args --tag" 476 preserve_args="$preserve_args --tag"
541if test -n "$prevopt"; then 497if test -n "$prevopt"; then
542 $echo "$modename: option \`$prevopt' requires an argument" 1>&2 498 $echo "$modename: option \`$prevopt' requires an argument" 1>&2
543 $echo "$help" 1>&2 499 $echo "$help" 1>&2
544 exit $EXIT_FAILURE 500 exit $EXIT_FAILURE
545fi 501fi
546
547case $disable_libs in
548no)
549 ;;
550shared)
551 build_libtool_libs=no
552 build_old_libs=yes
553 ;;
554static)
555 build_old_libs=`case $build_libtool_libs in yes) echo no;; *) echo yes;; esac`
556 ;;
557esac
558 502
559# If this variable is set in any of the actions, the command in it 503# If this variable is set in any of the actions, the command in it
560# will be execed at the end. This prevents here-documents from being 504# will be execed at the end. This prevents here-documents from being
561# left over by shells. 505# left over by shells.
562exec_cmd= 506exec_cmd=
630 libobj= 574 libobj=
631 later= 575 later=
632 576
633 for arg 577 for arg
634 do 578 do
635 case $arg_mode in 579 case "$arg_mode" in
636 arg ) 580 arg )
637 # do not "continue". Instead, add this to base_compile 581 # do not "continue". Instead, add this to base_compile
638 lastarg="$arg" 582 lastarg="$arg"
639 arg_mode=normal 583 arg_mode=normal
640 ;; 584 ;;
681 625
682 # Double-quote args containing other shell metacharacters. 626 # Double-quote args containing other shell metacharacters.
683 # Many Bourne shells cannot handle close brackets correctly 627 # Many Bourne shells cannot handle close brackets correctly
684 # in scan sets, so we specify it separately. 628 # in scan sets, so we specify it separately.
685 case $arg in 629 case $arg in
686 *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") 630 *$quote_scanset* | *]* | *\|* | *\&* | *\(* | *\)* | "")
687 arg="\"$arg\"" 631 arg="\"$arg\""
688 ;; 632 ;;
689 esac 633 esac
690 lastarg="$lastarg $arg" 634 lastarg="$lastarg $arg"
691 done 635 done
716 # Many Bourne shells cannot handle close brackets correctly 660 # Many Bourne shells cannot handle close brackets correctly
717 # in scan sets, and some SunOS ksh mistreat backslash-escaping 661 # in scan sets, and some SunOS ksh mistreat backslash-escaping
718 # in scan sets (worked around with variable expansion), 662 # in scan sets (worked around with variable expansion),
719 # and furthermore cannot handle '|' '&' '(' ')' in scan sets 663 # and furthermore cannot handle '|' '&' '(' ')' in scan sets
720 # at all, so we specify them separately. 664 # at all, so we specify them separately.
721 *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") 665 *$quote_scanset* | *]* | *\|* | *\&* | *\(* | *\)* | "")
722 lastarg="\"$lastarg\"" 666 lastarg="\"$lastarg\""
723 ;; 667 ;;
724 esac 668 esac
725 669
726 base_compile="$base_compile $lastarg" 670 base_compile="$base_compile $lastarg"
791 esac 735 esac
792 done 736 done
793 737
794 qlibobj=`$echo "X$libobj" | $Xsed -e "$sed_quote_subst"` 738 qlibobj=`$echo "X$libobj" | $Xsed -e "$sed_quote_subst"`
795 case $qlibobj in 739 case $qlibobj in
796 *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") 740 *$quote_scanset* | *]* | *\|* | *\&* | *\(* | *\)* | "")
797 qlibobj="\"$qlibobj\"" ;; 741 qlibobj="\"$qlibobj\"" ;;
798 esac 742 esac
799 test "X$libobj" != "X$qlibobj" \ 743 if test "X$libobj" != "X$qlibobj"; then
800 && $echo "X$libobj" | grep '[]~#^*{};<>?"'"'"' &()|`$[]' \
801 && $echo "$modename: libobj name \`$libobj' may not contain shell special characters." 744 $echo "$modename: libobj name \`$libobj' may not contain shell special characters."
745 exit $EXIT_FAILURE
746 fi
802 objname=`$echo "X$obj" | $Xsed -e 's%^.*/%%'` 747 objname=`$echo "X$obj" | $Xsed -e 's%^.*/%%'`
803 xdir=`$echo "X$obj" | $Xsed -e 's%/[^/]*$%%'` 748 xdir=`$echo "X$obj" | $Xsed -e 's%/[^/]*$%%'`
804 if test "X$xdir" = "X$obj"; then 749 if test "X$xdir" = "X$obj"; then
805 xdir= 750 xdir=
806 else 751 else
877 if test -n "$fix_srcfile_path"; then 822 if test -n "$fix_srcfile_path"; then
878 eval srcfile=\"$fix_srcfile_path\" 823 eval srcfile=\"$fix_srcfile_path\"
879 fi 824 fi
880 qsrcfile=`$echo "X$srcfile" | $Xsed -e "$sed_quote_subst"` 825 qsrcfile=`$echo "X$srcfile" | $Xsed -e "$sed_quote_subst"`
881 case $qsrcfile in 826 case $qsrcfile in
882 *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") 827 *$quote_scanset* | *]* | *\|* | *\&* | *\(* | *\)* | "")
883 qsrcfile="\"$qsrcfile\"" ;; 828 qsrcfile="\"$qsrcfile\"" ;;
884 esac 829 esac
885 830
886 $run $rm "$libobj" "${libobj}T" 831 $run $rm "$libobj" "${libobj}T"
887 832
910 fi 855 fi
911 856
912 if test ! -d "${xdir}$objdir"; then 857 if test ! -d "${xdir}$objdir"; then
913 $show "$mkdir ${xdir}$objdir" 858 $show "$mkdir ${xdir}$objdir"
914 $run $mkdir ${xdir}$objdir 859 $run $mkdir ${xdir}$objdir
915 exit_status=$? 860 status=$?
916 if test "$exit_status" -ne 0 && test ! -d "${xdir}$objdir"; then 861 if test "$status" -ne 0 && test ! -d "${xdir}$objdir"; then
917 exit $exit_status 862 exit $status
918 fi 863 fi
919 fi 864 fi
920 865
921 if test -z "$output_obj"; then 866 if test -z "$output_obj"; then
922 # Place PIC objects in $objdir 867 # Place PIC objects in $objdir
1115 ltlibs= 1060 ltlibs=
1116 module=no 1061 module=no
1117 no_install=no 1062 no_install=no
1118 objs= 1063 objs=
1119 non_pic_objects= 1064 non_pic_objects=
1120 notinst_path= # paths that contain not-installed libtool libraries
1121 precious_files_regex= 1065 precious_files_regex=
1122 prefer_static_libs=no 1066 prefer_static_libs=no
1123 preload=no 1067 preload=no
1124 prev= 1068 prev=
1125 prevarg= 1069 prevarg=
1144 $echo "$modename: warning: complete static linking is impossible in this configuration" 1>&2 1088 $echo "$modename: warning: complete static linking is impossible in this configuration" 1>&2
1145 fi 1089 fi
1146 if test -n "$link_static_flag"; then 1090 if test -n "$link_static_flag"; then
1147 dlopen_self=$dlopen_self_static 1091 dlopen_self=$dlopen_self_static
1148 fi 1092 fi
1149 prefer_static_libs=yes
1150 else 1093 else
1151 if test -z "$pic_flag" && test -n "$link_static_flag"; then 1094 if test -z "$pic_flag" && test -n "$link_static_flag"; then
1152 dlopen_self=$dlopen_self_static 1095 dlopen_self=$dlopen_self_static
1153 fi 1096 fi
1154 prefer_static_libs=built
1155 fi 1097 fi
1156 build_libtool_libs=no 1098 build_libtool_libs=no
1157 build_old_libs=yes 1099 build_old_libs=yes
1100 prefer_static_libs=yes
1158 break 1101 break
1159 ;; 1102 ;;
1160 esac 1103 esac
1161 done 1104 done
1162 1105
1166 # Go through the arguments, transforming them on the way. 1109 # Go through the arguments, transforming them on the way.
1167 while test "$#" -gt 0; do 1110 while test "$#" -gt 0; do
1168 arg="$1" 1111 arg="$1"
1169 shift 1112 shift
1170 case $arg in 1113 case $arg in
1171 *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") 1114 *$quote_scanset* | *]* | *\|* | *\&* | *\(* | *\)* | "")
1172 qarg=\"`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`\" ### testsuite: skip nested quoting test 1115 qarg=\"`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`\" ### testsuite: skip nested quoting test
1173 ;; 1116 ;;
1174 *) qarg=$arg ;; 1117 *) qarg=$arg ;;
1175 esac 1118 esac
1176 libtool_args="$libtool_args $qarg" 1119 libtool_args="$libtool_args $qarg"
1327 # A standard non-PIC object 1270 # A standard non-PIC object
1328 non_pic_objects="$non_pic_objects $non_pic_object" 1271 non_pic_objects="$non_pic_objects $non_pic_object"
1329 if test -z "$pic_object" || test "$pic_object" = none ; then 1272 if test -z "$pic_object" || test "$pic_object" = none ; then
1330 arg="$non_pic_object" 1273 arg="$non_pic_object"
1331 fi 1274 fi
1332 else
1333 # If the PIC object exists, use it instead.
1334 # $xdir was prepended to $pic_object above.
1335 non_pic_object="$pic_object"
1336 non_pic_objects="$non_pic_objects $non_pic_object"
1337 fi 1275 fi
1338 else 1276 else
1339 # Only an error if not doing a dry-run. 1277 # Only an error if not doing a dry-run.
1340 if test -z "$run"; then 1278 if test -z "$run"; then
1341 $echo "$modename: \`$arg' is not a valid libtool object" 1>&2 1279 $echo "$modename: \`$arg' is not a valid libtool object" 1>&2
1415 shrext) 1353 shrext)
1416 shrext_cmds="$arg" 1354 shrext_cmds="$arg"
1417 prev= 1355 prev=
1418 continue 1356 continue
1419 ;; 1357 ;;
1420 darwin_framework|darwin_framework_skip) 1358 darwin_framework)
1421 test "$prev" = "darwin_framework" && compiler_flags="$compiler_flags $arg" 1359 compiler_flags="$compiler_flags $arg"
1422 compile_command="$compile_command $arg" 1360 compile_command="$compile_command $arg"
1423 finalize_command="$finalize_command $arg" 1361 finalize_command="$finalize_command $arg"
1424 prev= 1362 prev=
1425 continue 1363 continue
1426 ;; 1364 ;;
1480 prev=expsyms_regex 1418 prev=expsyms_regex
1481 fi 1419 fi
1482 continue 1420 continue
1483 ;; 1421 ;;
1484 1422
1485 -framework|-arch|-isysroot) 1423 -framework)
1486 case " $CC " in
1487 *" ${arg} ${1} "* | *" ${arg} ${1} "*)
1488 prev=darwin_framework_skip ;;
1489 *) compiler_flags="$compiler_flags $arg"
1490 prev=darwin_framework ;; 1424 prev=darwin_framework
1491 esac 1425 compiler_flags="$compiler_flags $arg"
1492 compile_command="$compile_command $arg" 1426 compile_command="$compile_command $arg"
1493 finalize_command="$finalize_command $arg" 1427 finalize_command="$finalize_command $arg"
1494 continue 1428 continue
1495 ;; 1429 ;;
1496 1430
1497 -inst-prefix-dir) 1431 -inst-prefix-dir)
1498 prev=inst_prefix 1432 prev=inst_prefix
1499 continue 1433 continue
1500 ;; 1434 ;;
1518 [\\/]* | [A-Za-z]:[\\/]*) ;; 1452 [\\/]* | [A-Za-z]:[\\/]*) ;;
1519 *) 1453 *)
1520 absdir=`cd "$dir" && pwd` 1454 absdir=`cd "$dir" && pwd`
1521 if test -z "$absdir"; then 1455 if test -z "$absdir"; then
1522 $echo "$modename: cannot determine absolute directory name of \`$dir'" 1>&2 1456 $echo "$modename: cannot determine absolute directory name of \`$dir'" 1>&2
1523 absdir="$dir" 1457 exit $EXIT_FAILURE
1524 notinst_path="$notinst_path $dir"
1525 fi 1458 fi
1526 dir="$absdir" 1459 dir="$absdir"
1527 ;; 1460 ;;
1528 esac 1461 esac
1529 case "$deplibs " in 1462 case "$deplibs " in
1533 lib_search_path="$lib_search_path $dir" 1466 lib_search_path="$lib_search_path $dir"
1534 ;; 1467 ;;
1535 esac 1468 esac
1536 case $host in 1469 case $host in
1537 *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2*) 1470 *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2*)
1538 testbindir=`$echo "X$dir" | $Xsed -e 's*/lib$*/bin*'`
1539 case :$dllsearchpath: in 1471 case :$dllsearchpath: in
1540 *":$dir:"*) ;; 1472 *":$dir:"*) ;;
1541 *) dllsearchpath="$dllsearchpath:$dir";; 1473 *) dllsearchpath="$dllsearchpath:$dir";;
1542 esac 1474 esac
1543 case :$dllsearchpath: in
1544 *":$testbindir:"*) ;;
1545 *) dllsearchpath="$dllsearchpath:$testbindir";;
1546 esac
1547 ;; 1475 ;;
1548 esac 1476 esac
1549 continue 1477 continue
1550 ;; 1478 ;;
1551 1479
1552 -l*) 1480 -l*)
1553 if test "X$arg" = "X-lc" || test "X$arg" = "X-lm"; then 1481 if test "X$arg" = "X-lc" || test "X$arg" = "X-lm"; then
1554 case $host in 1482 case $host in
1555 *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-beos*) 1483 *-*-cygwin* | *-*-pw32* | *-*-beos*)
1556 # These systems don't actually have a C or math library (as such) 1484 # These systems don't actually have a C or math library (as such)
1557 continue 1485 continue
1558 ;; 1486 ;;
1559 *-*-os2*) 1487 *-*-mingw* | *-*-os2*)
1560 # These systems don't actually have a C library (as such) 1488 # These systems don't actually have a C library (as such)
1561 test "X$arg" = "X-lc" && continue 1489 test "X$arg" = "X-lc" && continue
1562 ;; 1490 ;;
1563 *-*-openbsd* | *-*-freebsd* | *-*-dragonfly*) 1491 *-*-openbsd* | *-*-freebsd* | *-*-dragonfly*)
1564 # Do not include libc due to us having libc/libc_r. 1492 # Do not include libc due to us having libc/libc_r.
1566 ;; 1494 ;;
1567 *-*-rhapsody* | *-*-darwin1.[012]) 1495 *-*-rhapsody* | *-*-darwin1.[012])
1568 # Rhapsody C and math libraries are in the System framework 1496 # Rhapsody C and math libraries are in the System framework
1569 deplibs="$deplibs -framework System" 1497 deplibs="$deplibs -framework System"
1570 continue 1498 continue
1571 ;;
1572 *-*-sco3.2v5* | *-*-sco5v6*)
1573 # Causes problems with __ctype
1574 test "X$arg" = "X-lc" && continue
1575 ;;
1576 *-*-sysv4.2uw2* | *-*-sysv5* | *-*-unixware* | *-*-OpenUNIX*)
1577 # Compiler inserts libc in the correct place for threads to work
1578 test "X$arg" = "X-lc" && continue
1579 ;;
1580 esac 1499 esac
1581 elif test "X$arg" = "X-lc_r"; then 1500 elif test "X$arg" = "X-lc_r"; then
1582 case $host in 1501 case $host in
1583 *-*-openbsd* | *-*-freebsd* | *-*-dragonfly*) 1502 *-*-openbsd* | *-*-freebsd* | *-*-dragonfly*)
1584 # Do not include libc_r directly, use -pthread flag. 1503 # Do not include libc_r directly, use -pthread flag.
1616 # -r[0-9][0-9]* specifies the processor on the SGI compiler 1535 # -r[0-9][0-9]* specifies the processor on the SGI compiler
1617 # -xarch=*, -xtarget=* enable 64-bit mode on the Sun compiler 1536 # -xarch=*, -xtarget=* enable 64-bit mode on the Sun compiler
1618 # +DA*, +DD* enable 64-bit mode on the HP compiler 1537 # +DA*, +DD* enable 64-bit mode on the HP compiler
1619 # -q* pass through compiler args for the IBM compiler 1538 # -q* pass through compiler args for the IBM compiler
1620 # -m* pass through architecture-specific compiler args for GCC 1539 # -m* pass through architecture-specific compiler args for GCC
1621 # -m*, -t[45]*, -txscale* pass through architecture-specific
1622 # compiler args for GCC
1623 # -pg pass through profiling flag for GCC
1624 # @file GCC response files
1625 -64|-mips[0-9]|-r[0-9][0-9]*|-xarch=*|-xtarget=*|+DA*|+DD*|-q*|-m*|-pg| \ 1540 -64|-mips[0-9]|-r[0-9][0-9]*|-xarch=*|-xtarget=*|+DA*|+DD*|-q*|-m*)
1626 -t[45]*|-txscale*|@*)
1627 1541
1628 # Unknown arguments in both finalize_command and compile_command need 1542 # Unknown arguments in both finalize_command and compile_command need
1629 # to be aesthetically quoted because they are evaled later. 1543 # to be aesthetically quoted because they are evaled later.
1630 arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"` 1544 arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`
1631 case $arg in 1545 case $arg in
1632 *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") 1546 *$quote_scanset* | *]* | *\|* | *\&* | *\(* | *\)* | "")
1633 arg="\"$arg\"" 1547 arg="\"$arg\""
1634 ;; 1548 ;;
1635 esac 1549 esac
1636 compile_command="$compile_command $arg" 1550 compile_command="$compile_command $arg"
1637 finalize_command="$finalize_command $arg" 1551 finalize_command="$finalize_command $arg"
1552 if test "$with_gcc" = "yes" ; then
1638 compiler_flags="$compiler_flags $arg" 1553 compiler_flags="$compiler_flags $arg"
1554 fi
1639 continue 1555 continue
1640 ;; 1556 ;;
1641 1557
1642 -shrext) 1558 -shrext)
1643 prev=shrext 1559 prev=shrext
1741 arg= 1657 arg=
1742 save_ifs="$IFS"; IFS=',' 1658 save_ifs="$IFS"; IFS=','
1743 for flag in $args; do 1659 for flag in $args; do
1744 IFS="$save_ifs" 1660 IFS="$save_ifs"
1745 case $flag in 1661 case $flag in
1746 *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") 1662 *$quote_scanset* | *]* | *\|* | *\&* | *\(* | *\)* | "")
1747 flag="\"$flag\"" 1663 flag="\"$flag\""
1748 ;; 1664 ;;
1749 esac 1665 esac
1750 arg="$arg $wl$flag" 1666 arg="$arg $wl$flag"
1751 compiler_flags="$compiler_flags $flag" 1667 compiler_flags="$compiler_flags $flag"
1759 arg= 1675 arg=
1760 save_ifs="$IFS"; IFS=',' 1676 save_ifs="$IFS"; IFS=','
1761 for flag in $args; do 1677 for flag in $args; do
1762 IFS="$save_ifs" 1678 IFS="$save_ifs"
1763 case $flag in 1679 case $flag in
1764 *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") 1680 *$quote_scanset* | *]* | *\|* | *\&* | *\(* | *\)* | "")
1765 flag="\"$flag\"" 1681 flag="\"$flag\""
1766 ;; 1682 ;;
1767 esac 1683 esac
1768 arg="$arg $wl$flag" 1684 arg="$arg $wl$flag"
1769 compiler_flags="$compiler_flags $wl$flag" 1685 compiler_flags="$compiler_flags $wl$flag"
1792 -* | +*) 1708 -* | +*)
1793 # Unknown arguments in both finalize_command and compile_command need 1709 # Unknown arguments in both finalize_command and compile_command need
1794 # to be aesthetically quoted because they are evaled later. 1710 # to be aesthetically quoted because they are evaled later.
1795 arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"` 1711 arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`
1796 case $arg in 1712 case $arg in
1797 *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") 1713 *$quote_scanset* | *]* | *\|* | *\&* | *\(* | *\)* | "")
1798 arg="\"$arg\"" 1714 arg="\"$arg\""
1799 ;; 1715 ;;
1800 esac 1716 esac
1801 ;; 1717 ;;
1802 1718
1871 # A standard non-PIC object 1787 # A standard non-PIC object
1872 non_pic_objects="$non_pic_objects $non_pic_object" 1788 non_pic_objects="$non_pic_objects $non_pic_object"
1873 if test -z "$pic_object" || test "$pic_object" = none ; then 1789 if test -z "$pic_object" || test "$pic_object" = none ; then
1874 arg="$non_pic_object" 1790 arg="$non_pic_object"
1875 fi 1791 fi
1876 else
1877 # If the PIC object exists, use it instead.
1878 # $xdir was prepended to $pic_object above.
1879 non_pic_object="$pic_object"
1880 non_pic_objects="$non_pic_objects $non_pic_object"
1881 fi 1792 fi
1882 else 1793 else
1883 # Only an error if not doing a dry-run. 1794 # Only an error if not doing a dry-run.
1884 if test -z "$run"; then 1795 if test -z "$run"; then
1885 $echo "$modename: \`$arg' is not a valid libtool object" 1>&2 1796 $echo "$modename: \`$arg' is not a valid libtool object" 1>&2
1931 *) 1842 *)
1932 # Unknown arguments in both finalize_command and compile_command need 1843 # Unknown arguments in both finalize_command and compile_command need
1933 # to be aesthetically quoted because they are evaled later. 1844 # to be aesthetically quoted because they are evaled later.
1934 arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"` 1845 arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`
1935 case $arg in 1846 case $arg in
1936 *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") 1847 *$quote_scanset* | *]* | *\|* | *\&* | *\(* | *\)* | "")
1937 arg="\"$arg\"" 1848 arg="\"$arg\""
1938 ;; 1849 ;;
1939 esac 1850 esac
1940 ;; 1851 ;;
1941 esac # arg 1852 esac # arg
1981 fi 1892 fi
1982 # Create the object directory. 1893 # Create the object directory.
1983 if test ! -d "$output_objdir"; then 1894 if test ! -d "$output_objdir"; then
1984 $show "$mkdir $output_objdir" 1895 $show "$mkdir $output_objdir"
1985 $run $mkdir $output_objdir 1896 $run $mkdir $output_objdir
1986 exit_status=$? 1897 status=$?
1987 if test "$exit_status" -ne 0 && test ! -d "$output_objdir"; then 1898 if test "$status" -ne 0 && test ! -d "$output_objdir"; then
1988 exit $exit_status 1899 exit $status
1989 fi 1900 fi
1990 fi 1901 fi
1991 1902
1992 # Determine the type of output 1903 # Determine the type of output
1993 case $output in 1904 case $output in
2046 deplibs= 1957 deplibs=
2047 newdependency_libs= 1958 newdependency_libs=
2048 newlib_search_path= 1959 newlib_search_path=
2049 need_relink=no # whether we're linking any uninstalled libtool libraries 1960 need_relink=no # whether we're linking any uninstalled libtool libraries
2050 notinst_deplibs= # not-installed libtool libraries 1961 notinst_deplibs= # not-installed libtool libraries
1962 notinst_path= # paths that contain not-installed libtool libraries
2051 case $linkmode in 1963 case $linkmode in
2052 lib) 1964 lib)
2053 passes="conv link" 1965 passes="conv link"
2054 for file in $dlfiles $dlprefiles; do 1966 for file in $dlfiles $dlprefiles; do
2055 case $file in 1967 case $file in
2071 ;; 1983 ;;
2072 *) passes="conv" 1984 *) passes="conv"
2073 ;; 1985 ;;
2074 esac 1986 esac
2075 for pass in $passes; do 1987 for pass in $passes; do
1988 # The preopen pass in lib mode reverses $deplibs; put it back here
1989 # so that -L comes before libs that need it for instance...
1990 if test "$linkmode,$pass" = "lib,link"; then
1991 ## FIXME: Find the place where the list is rebuilt in the wrong
1992 ## order, and fix it there properly
1993 tmp_deplibs=
1994 for deplib in $deplibs; do
1995 tmp_deplibs="$deplib $tmp_deplibs"
1996 done
1997 deplibs="$tmp_deplibs"
1998 fi
2076 if test "$linkmode,$pass" = "lib,link" || 1999 if test "$linkmode,$pass" = "lib,link" ||
2077 test "$linkmode,$pass" = "prog,scan"; then 2000 test "$linkmode,$pass" = "prog,scan"; then
2078 libs="$deplibs" 2001 libs="$deplibs"
2079 deplibs= 2002 deplibs=
2080 fi 2003 fi
2081 if test "$linkmode" = prog; then 2004 if test "$linkmode" = prog; then
2082 case $pass in 2005 case $pass in
2083 dlopen) libs="$dlfiles" ;; 2006 dlopen) libs="$dlfiles" ;;
2084 dlpreopen) libs="$dlprefiles" ;; 2007 dlpreopen) libs="$dlprefiles" ;;
2085 link) 2008 link) libs="$deplibs %DEPLIBS% $dependency_libs" ;;
2086 libs="$deplibs %DEPLIBS%"
2087 test "X$link_all_deplibs" != Xno && libs="$libs $dependency_libs"
2088 ;;
2089 esac 2009 esac
2090 fi 2010 fi
2091 if test "$pass" = dlopen; then 2011 if test "$pass" = dlopen; then
2092 # Collect dlpreopened libraries 2012 # Collect dlpreopened libraries
2093 save_deplibs="$deplibs" 2013 save_deplibs="$deplibs"
2284 continue 2204 continue
2285 ;; 2205 ;;
2286 esac # case $deplib 2206 esac # case $deplib
2287 if test "$found" = yes || test -f "$lib"; then : 2207 if test "$found" = yes || test -f "$lib"; then :
2288 else 2208 else
2289 $echo "$modename: cannot find the library \`$lib' or unhandled argument \`$deplib'" 1>&2 2209 $echo "$modename: cannot find the library \`$lib'" 1>&2
2290 exit $EXIT_FAILURE 2210 exit $EXIT_FAILURE
2291 fi 2211 fi
2292 2212
2293 # Check to see that this really is a libtool archive. 2213 # Check to see that this really is a libtool archive.
2294 if (${SED} -e '2q' $lib | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then : 2214 if (${SED} -e '2q' $lib | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then :
2335 exit $EXIT_FAILURE 2255 exit $EXIT_FAILURE
2336 fi 2256 fi
2337 # It is a libtool convenience library, so add in its objects. 2257 # It is a libtool convenience library, so add in its objects.
2338 convenience="$convenience $ladir/$objdir/$old_library" 2258 convenience="$convenience $ladir/$objdir/$old_library"
2339 old_convenience="$old_convenience $ladir/$objdir/$old_library" 2259 old_convenience="$old_convenience $ladir/$objdir/$old_library"
2340 tmp_libs=
2341 for deplib in $dependency_libs; do
2342 deplibs="$deplib $deplibs"
2343 if test "X$duplicate_deps" = "Xyes" ; then
2344 case "$tmp_libs " in
2345 *" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;;
2346 esac
2347 fi
2348 tmp_libs="$tmp_libs $deplib"
2349 done
2350 elif test "$linkmode" != prog && test "$linkmode" != lib; then 2260 elif test "$linkmode" != prog && test "$linkmode" != lib; then
2351 $echo "$modename: \`$lib' is not a convenience library" 1>&2 2261 $echo "$modename: \`$lib' is not a convenience library" 1>&2
2352 exit $EXIT_FAILURE 2262 exit $EXIT_FAILURE
2353 fi 2263 fi
2264 tmp_libs=
2265 for deplib in $dependency_libs; do
2266 deplibs="$deplib $deplibs"
2267 if test "X$duplicate_deps" = "Xyes" ; then
2268 case "$tmp_libs " in
2269 *" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;;
2270 esac
2271 fi
2272 tmp_libs="$tmp_libs $deplib"
2273 done
2354 continue 2274 continue
2355 fi # $pass = conv 2275 fi # $pass = conv
2356 2276
2357 2277
2358 # Get the name of the library we link against. 2278 # Get the name of the library we link against.
2535 continue 2455 continue
2536 fi 2456 fi
2537 fi 2457 fi
2538 2458
2539 link_static=no # Whether the deplib will be linked statically 2459 link_static=no # Whether the deplib will be linked statically
2540 use_static_libs=$prefer_static_libs
2541 if test "$use_static_libs" = built && test "$installed" = yes ; then
2542 use_static_libs=no
2543 fi
2544 if test -n "$library_names" && 2460 if test -n "$library_names" &&
2545 { test "$use_static_libs" = no || test -z "$old_library"; }; then 2461 { test "$prefer_static_libs" = no || test -z "$old_library"; }; then
2546 if test "$installed" = no; then 2462 if test "$installed" = no; then
2547 notinst_deplibs="$notinst_deplibs $lib" 2463 notinst_deplibs="$notinst_deplibs $lib"
2548 need_relink=yes 2464 need_relink=yes
2549 fi 2465 fi
2550 # This is a shared library 2466 # This is a shared library
2653 case $hardcode_action in 2569 case $hardcode_action in
2654 immediate | unsupported) 2570 immediate | unsupported)
2655 if test "$hardcode_direct" = no; then 2571 if test "$hardcode_direct" = no; then
2656 add="$dir/$linklib" 2572 add="$dir/$linklib"
2657 case $host in 2573 case $host in
2658 *-*-sco3.2v5.0.[024]*) add_dir="-L$dir" ;; 2574 *-*-sco3.2v5* ) add_dir="-L$dir" ;;
2659 *-*-sysv4*uw2*) add_dir="-L$dir" ;;
2660 *-*-sysv5OpenUNIX* | *-*-sysv5UnixWare7.[01].[10]* | \
2661 *-*-unixware7*) add_dir="-L$dir" ;;
2662 *-*-darwin* ) 2575 *-*-darwin* )
2663 # if the lib is a module then we can not link against 2576 # if the lib is a module then we can not link against
2664 # it, someone is ignoring the new warnings I added 2577 # it, someone is ignoring the new warnings I added
2665 if /usr/bin/file -L $add 2> /dev/null | 2578 if /usr/bin/file -L $add 2> /dev/null | $EGREP "bundle" >/dev/null ; then
2666 $EGREP ": [^:]* bundle" >/dev/null ; then
2667 $echo "** Warning, lib $linklib is a module, not a shared library" 2579 $echo "** Warning, lib $linklib is a module, not a shared library"
2668 if test -z "$old_library" ; then 2580 if test -z "$old_library" ; then
2669 $echo 2581 $echo
2670 $echo "** And there doesn't seem to be a static archive available" 2582 $echo "** And there doesn't seem to be a static archive available"
2671 $echo "** The link will probably fail, sorry" 2583 $echo "** The link will probably fail, sorry"
2692 add="$dir/$linklib" 2604 add="$dir/$linklib"
2693 elif test "$hardcode_minus_L" = yes; then 2605 elif test "$hardcode_minus_L" = yes; then
2694 add_dir="-L$dir" 2606 add_dir="-L$dir"
2695 # Try looking first in the location we're being installed to. 2607 # Try looking first in the location we're being installed to.
2696 if test -n "$inst_prefix_dir"; then 2608 if test -n "$inst_prefix_dir"; then
2697 case $libdir in 2609 case "$libdir" in
2698 [\\/]*) 2610 [\\/]*)
2699 add_dir="$add_dir -L$inst_prefix_dir$libdir" 2611 add_dir="$add_dir -L$inst_prefix_dir$libdir"
2700 ;; 2612 ;;
2701 esac 2613 esac
2702 fi 2614 fi
2742 if test "$linkmode" = prog || test "$mode" = relink; then 2654 if test "$linkmode" = prog || test "$mode" = relink; then
2743 add_shlibpath= 2655 add_shlibpath=
2744 add_dir= 2656 add_dir=
2745 add= 2657 add=
2746 # Finalize command for both is simple: just hardcode it. 2658 # Finalize command for both is simple: just hardcode it.
2747 if test "$hardcode_direct" = yes; then 2659 if test "$hardcode_direct" = yes && test -f $libdir/$linklib; then
2748 add="$libdir/$linklib" 2660 add="$libdir/$linklib"
2749 elif test "$hardcode_minus_L" = yes; then 2661 elif test "$hardcode_minus_L" = yes; then
2750 add_dir="-L$libdir" 2662 add_dir="-L$libdir"
2751 add="-l$name" 2663 add="-l$name"
2752 elif test "$hardcode_shlibpath_var" = yes; then 2664 elif test "$hardcode_shlibpath_var" = yes; then
2765 else 2677 else
2766 # We cannot seem to hardcode it, guess we'll fake it. 2678 # We cannot seem to hardcode it, guess we'll fake it.
2767 add_dir="-L$libdir" 2679 add_dir="-L$libdir"
2768 # Try looking first in the location we're being installed to. 2680 # Try looking first in the location we're being installed to.
2769 if test -n "$inst_prefix_dir"; then 2681 if test -n "$inst_prefix_dir"; then
2770 case $libdir in 2682 case "$libdir" in
2771 [\\/]*) 2683 [\\/]*)
2772 add_dir="$add_dir -L$inst_prefix_dir$libdir" 2684 add_dir="$add_dir -L$inst_prefix_dir$libdir"
2773 ;; 2685 ;;
2774 esac 2686 esac
2775 fi 2687 fi
3202 irix|nonstopux) 3114 irix|nonstopux)
3203 current=`expr $number_major + $number_minor - 1` 3115 current=`expr $number_major + $number_minor - 1`
3204 age="$number_minor" 3116 age="$number_minor"
3205 revision="$number_minor" 3117 revision="$number_minor"
3206 ;; 3118 ;;
3207 *)
3208 $echo "$modename: unknown library version type \`$version_type'" 1>&2
3209 $echo "Fatal configuration error. See the $PACKAGE docs for more information." 1>&2
3210 exit $EXIT_FAILURE
3211 ;;
3212 esac 3119 esac
3213 ;; 3120 ;;
3214 no) 3121 no)
3215 current="$2" 3122 current="$2"
3216 revision="$3" 3123 revision="$3"
3417 oldobjs="$objs "`$echo "X$libobjs" | $SP2NL | $Xsed -e '/\.'${libext}'$/d' -e "$lo2o" | $NL2SP` 3324 oldobjs="$objs "`$echo "X$libobjs" | $SP2NL | $Xsed -e '/\.'${libext}'$/d' -e "$lo2o" | $NL2SP`
3418 fi 3325 fi
3419 3326
3420 # Eliminate all temporary directories. 3327 # Eliminate all temporary directories.
3421 for path in $notinst_path; do 3328 for path in $notinst_path; do
3422 lib_search_path=`$echo "$lib_search_path " | ${SED} -e "s% $path % %g"` 3329 lib_search_path=`$echo "$lib_search_path " | ${SED} -e 's% $path % %g'`
3423 deplibs=`$echo "$deplibs " | ${SED} -e "s% -L$path % %g"` 3330 deplibs=`$echo "$deplibs " | ${SED} -e 's% -L$path % %g'`
3424 dependency_libs=`$echo "$dependency_libs " | ${SED} -e "s% -L$path % %g"` 3331 dependency_libs=`$echo "$dependency_libs " | ${SED} -e 's% -L$path % %g'`
3425 done 3332 done
3426 3333
3427 if test -n "$xrpath"; then 3334 if test -n "$xrpath"; then
3428 # If the user specified any rpath flags, then add them. 3335 # If the user specified any rpath flags, then add them.
3429 temp_xrpath= 3336 temp_xrpath=
3472 *-*-netbsd*) 3379 *-*-netbsd*)
3473 # Don't link with libc until the a.out ld.so is fixed. 3380 # Don't link with libc until the a.out ld.so is fixed.
3474 ;; 3381 ;;
3475 *-*-openbsd* | *-*-freebsd* | *-*-dragonfly*) 3382 *-*-openbsd* | *-*-freebsd* | *-*-dragonfly*)
3476 # Do not include libc due to us having libc/libc_r. 3383 # Do not include libc due to us having libc/libc_r.
3477 ;; 3384 test "X$arg" = "X-lc" && continue
3478 *-*-sco3.2v5* | *-*-sco5v6*)
3479 # Causes problems with __ctype
3480 ;;
3481 *-*-sysv4.2uw2* | *-*-sysv5* | *-*-unixware* | *-*-OpenUNIX*)
3482 # Compiler inserts libc in the correct place for threads to work
3483 ;; 3385 ;;
3484 *) 3386 *)
3485 # Add libc to deplibs on all other systems if necessary. 3387 # Add libc to deplibs on all other systems if necessary.
3486 if test "$build_libtool_need_lc" = "yes"; then 3388 if test "$build_libtool_need_lc" = "yes"; then
3487 deplibs="$deplibs -lc" 3389 deplibs="$deplibs -lc"
3521 $rm conftest.c 3423 $rm conftest.c
3522 cat > conftest.c <<EOF 3424 cat > conftest.c <<EOF
3523 int main() { return 0; } 3425 int main() { return 0; }
3524EOF 3426EOF
3525 $rm conftest 3427 $rm conftest
3526 $LTCC $LTCFLAGS -o conftest conftest.c $deplibs 3428 $LTCC -o conftest conftest.c $deplibs
3527 if test "$?" -eq 0 ; then 3429 if test "$?" -eq 0 ; then
3528 ldd_output=`ldd conftest` 3430 ldd_output=`ldd conftest`
3529 for i in $deplibs; do 3431 for i in $deplibs; do
3530 name=`expr $i : '-l\(.*\)'` 3432 name="`expr $i : '-l\(.*\)'`"
3531 # If $name is empty we are operating on a -L argument. 3433 # If $name is empty we are operating on a -L argument.
3532 if test "$name" != "" && test "$name" -ne "0"; then 3434 if test "$name" != "" && test "$name" -ne "0"; then
3533 if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then 3435 if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
3534 case " $predeps $postdeps " in 3436 case " $predeps $postdeps " in
3535 *" $i "*) 3437 *" $i "*)
3562 done 3464 done
3563 else 3465 else
3564 # Error occurred in the first compile. Let's try to salvage 3466 # Error occurred in the first compile. Let's try to salvage
3565 # the situation: Compile a separate program for each library. 3467 # the situation: Compile a separate program for each library.
3566 for i in $deplibs; do 3468 for i in $deplibs; do
3567 name=`expr $i : '-l\(.*\)'` 3469 name="`expr $i : '-l\(.*\)'`"
3568 # If $name is empty we are operating on a -L argument. 3470 # If $name is empty we are operating on a -L argument.
3569 if test "$name" != "" && test "$name" != "0"; then 3471 if test "$name" != "" && test "$name" != "0"; then
3570 $rm conftest 3472 $rm conftest
3571 $LTCC $LTCFLAGS -o conftest conftest.c $i 3473 $LTCC -o conftest conftest.c $i
3572 # Did it work? 3474 # Did it work?
3573 if test "$?" -eq 0 ; then 3475 if test "$?" -eq 0 ; then
3574 ldd_output=`ldd conftest` 3476 ldd_output=`ldd conftest`
3575 if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then 3477 if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
3576 case " $predeps $postdeps " in 3478 case " $predeps $postdeps " in
3614 ;; 3516 ;;
3615 file_magic*) 3517 file_magic*)
3616 set dummy $deplibs_check_method 3518 set dummy $deplibs_check_method
3617 file_magic_regex=`expr "$deplibs_check_method" : "$2 \(.*\)"` 3519 file_magic_regex=`expr "$deplibs_check_method" : "$2 \(.*\)"`
3618 for a_deplib in $deplibs; do 3520 for a_deplib in $deplibs; do
3619 name=`expr $a_deplib : '-l\(.*\)'` 3521 name="`expr $a_deplib : '-l\(.*\)'`"
3620 # If $name is empty we are operating on a -L argument. 3522 # If $name is empty we are operating on a -L argument.
3621 if test "$name" != "" && test "$name" != "0"; then 3523 if test "$name" != "" && test "$name" != "0"; then
3622 if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then 3524 if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
3623 case " $predeps $postdeps " in 3525 case " $predeps $postdeps " in
3624 *" $a_deplib "*) 3526 *" $a_deplib "*)
3683 ;; 3585 ;;
3684 match_pattern*) 3586 match_pattern*)
3685 set dummy $deplibs_check_method 3587 set dummy $deplibs_check_method
3686 match_pattern_regex=`expr "$deplibs_check_method" : "$2 \(.*\)"` 3588 match_pattern_regex=`expr "$deplibs_check_method" : "$2 \(.*\)"`
3687 for a_deplib in $deplibs; do 3589 for a_deplib in $deplibs; do
3688 name=`expr $a_deplib : '-l\(.*\)'` 3590 name="`expr $a_deplib : '-l\(.*\)'`"
3689 # If $name is empty we are operating on a -L argument. 3591 # If $name is empty we are operating on a -L argument.
3690 if test -n "$name" && test "$name" != "0"; then 3592 if test -n "$name" && test "$name" != "0"; then
3691 if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then 3593 if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
3692 case " $predeps $postdeps " in 3594 case " $predeps $postdeps " in
3693 *" $a_deplib "*) 3595 *" $a_deplib "*)
3813 fi 3715 fi
3814 # Done checking deplibs! 3716 # Done checking deplibs!
3815 deplibs=$newdeplibs 3717 deplibs=$newdeplibs
3816 fi 3718 fi
3817 3719
3818
3819 # move library search paths that coincide with paths to not yet
3820 # installed libraries to the beginning of the library search list
3821 new_libs=
3822 for path in $notinst_path; do
3823 case " $new_libs " in
3824 *" -L$path/$objdir "*) ;;
3825 *)
3826 case " $deplibs " in
3827 *" -L$path/$objdir "*)
3828 new_libs="$new_libs -L$path/$objdir" ;;
3829 esac
3830 ;;
3831 esac
3832 done
3833 for deplib in $deplibs; do
3834 case $deplib in
3835 -L*)
3836 case " $new_libs " in
3837 *" $deplib "*) ;;
3838 *) new_libs="$new_libs $deplib" ;;
3839 esac
3840 ;;
3841 *) new_libs="$new_libs $deplib" ;;
3842 esac
3843 done
3844 deplibs="$new_libs"
3845
3846
3847 # All the library-specific variables (install_libdir is set above). 3720 # All the library-specific variables (install_libdir is set above).
3848 library_names= 3721 library_names=
3849 old_library= 3722 old_library=
3850 dlname= 3723 dlname=
3851 3724
3925 if test -z "$dlname"; then 3798 if test -z "$dlname"; then
3926 dlname=$soname 3799 dlname=$soname
3927 fi 3800 fi
3928 3801
3929 lib="$output_objdir/$realname" 3802 lib="$output_objdir/$realname"
3930 linknames=
3931 for link 3803 for link
3932 do 3804 do
3933 linknames="$linknames $link" 3805 linknames="$linknames $link"
3934 done 3806 done
3935 3807
3954 skipped_export=false 3826 skipped_export=false
3955 else 3827 else
3956 # The command line is too long to execute in one step. 3828 # The command line is too long to execute in one step.
3957 $show "using reloadable object file for export list..." 3829 $show "using reloadable object file for export list..."
3958 skipped_export=: 3830 skipped_export=:
3959 # Break out early, otherwise skipped_export may be
3960 # set to false by a later but shorter cmd.
3961 break
3962 fi 3831 fi
3963 done 3832 done
3964 IFS="$save_ifs" 3833 IFS="$save_ifs"
3965 if test -n "$export_symbols_regex"; then 3834 if test -n "$export_symbols_regex"; then
3966 $show "$EGREP -e \"$export_symbols_regex\" \"$export_symbols\" > \"${export_symbols}T\"" 3835 $show "$EGREP -e \"$export_symbols_regex\" \"$export_symbols\" > \"${export_symbols}T\""
4026 eval test_cmds=\"$archive_cmds\" 3895 eval test_cmds=\"$archive_cmds\"
4027 cmds=$archive_cmds 3896 cmds=$archive_cmds
4028 fi 3897 fi
4029 fi 3898 fi
4030 3899
4031 if test "X$skipped_export" != "X:" && 3900 if test "X$skipped_export" != "X:" && len=`expr "X$test_cmds" : ".*"` &&
4032 len=`expr "X$test_cmds" : ".*" 2>/dev/null` &&
4033 test "$len" -le "$max_cmd_len" || test "$max_cmd_len" -le -1; then 3901 test "$len" -le "$max_cmd_len" || test "$max_cmd_len" -le -1; then
4034 : 3902 :
4035 else 3903 else
4036 # The command line is too long to link in one step, link piecewise. 3904 # The command line is too long to link in one step, link piecewise.
4037 $echo "creating reloadable object files..." 3905 $echo "creating reloadable object files..."
4062 # Loop over the list of objects to be linked. 3930 # Loop over the list of objects to be linked.
4063 for obj in $save_libobjs 3931 for obj in $save_libobjs
4064 do 3932 do
4065 eval test_cmds=\"$reload_cmds $objlist $last_robj\" 3933 eval test_cmds=\"$reload_cmds $objlist $last_robj\"
4066 if test "X$objlist" = X || 3934 if test "X$objlist" = X ||
4067 { len=`expr "X$test_cmds" : ".*" 2>/dev/null` && 3935 { len=`expr "X$test_cmds" : ".*"` &&
4068 test "$len" -le "$max_cmd_len"; }; then 3936 test "$len" -le "$max_cmd_len"; }; then
4069 objlist="$objlist $obj" 3937 objlist="$objlist $obj"
4070 else 3938 else
4071 # The command $test_cmds is almost too long, add a 3939 # The command $test_cmds is almost too long, add a
4072 # command to the queue. 3940 # command to the queue.
4152 save_ifs="$IFS"; IFS='~' 4020 save_ifs="$IFS"; IFS='~'
4153 for cmd in $cmds; do 4021 for cmd in $cmds; do
4154 IFS="$save_ifs" 4022 IFS="$save_ifs"
4155 eval cmd=\"$cmd\" 4023 eval cmd=\"$cmd\"
4156 $show "$cmd" 4024 $show "$cmd"
4157 $run eval "$cmd" || { 4025 $run eval "$cmd" || exit $?
4158 lt_exit=$?
4159
4160 # Restore the uninstalled library and exit
4161 if test "$mode" = relink; then
4162 $run eval '(cd $output_objdir && $rm ${realname}T && $mv ${realname}U $realname)'
4163 fi
4164
4165 exit $lt_exit
4166 }
4167 done 4026 done
4168 IFS="$save_ifs" 4027 IFS="$save_ifs"
4169 4028
4170 # Restore the uninstalled library and exit 4029 # Restore the uninstalled library and exit
4171 if test "$mode" = relink; then 4030 if test "$mode" = relink; then
4172 $run eval '(cd $output_objdir && $rm ${realname}T && $mv $realname ${realname}T && $mv "$realname"U $realname)' || exit $? 4031 $run eval '(cd $output_objdir && $rm ${realname}T && $mv $realname ${realname}T && $mv "$realname"U $realname)' || exit $?
4173
4174 if test -n "$convenience"; then
4175 if test -z "$whole_archive_flag_spec"; then
4176 $show "${rm}r $gentop"
4177 $run ${rm}r "$gentop"
4178 fi
4179 fi
4180
4181 exit $EXIT_SUCCESS 4032 exit $EXIT_SUCCESS
4182 fi 4033 fi
4183 4034
4184 # Create links to the real library. 4035 # Create links to the real library.
4185 for linkname in $linknames; do 4036 for linkname in $linknames; do
4356 compile_command="$compile_command ${wl}-bind_at_load" 4207 compile_command="$compile_command ${wl}-bind_at_load"
4357 finalize_command="$finalize_command ${wl}-bind_at_load" 4208 finalize_command="$finalize_command ${wl}-bind_at_load"
4358 fi 4209 fi
4359 ;; 4210 ;;
4360 esac 4211 esac
4361
4362
4363 # move library search paths that coincide with paths to not yet
4364 # installed libraries to the beginning of the library search list
4365 new_libs=
4366 for path in $notinst_path; do
4367 case " $new_libs " in
4368 *" -L$path/$objdir "*) ;;
4369 *)
4370 case " $compile_deplibs " in
4371 *" -L$path/$objdir "*)
4372 new_libs="$new_libs -L$path/$objdir" ;;
4373 esac
4374 ;;
4375 esac
4376 done
4377 for deplib in $compile_deplibs; do
4378 case $deplib in
4379 -L*)
4380 case " $new_libs " in
4381 *" $deplib "*) ;;
4382 *) new_libs="$new_libs $deplib" ;;
4383 esac
4384 ;;
4385 *) new_libs="$new_libs $deplib" ;;
4386 esac
4387 done
4388 compile_deplibs="$new_libs"
4389
4390 4212
4391 compile_command="$compile_command $compile_deplibs" 4213 compile_command="$compile_command $compile_deplibs"
4392 finalize_command="$finalize_command $finalize_deplibs" 4214 finalize_command="$finalize_command $finalize_deplibs"
4393 4215
4394 if test -n "$rpath$xrpath"; then 4216 if test -n "$rpath$xrpath"; then
4430 *) perm_rpath="$perm_rpath $libdir" ;; 4252 *) perm_rpath="$perm_rpath $libdir" ;;
4431 esac 4253 esac
4432 fi 4254 fi
4433 case $host in 4255 case $host in
4434 *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2*) 4256 *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2*)
4435 testbindir=`$echo "X$libdir" | $Xsed -e 's*/lib$*/bin*'`
4436 case :$dllsearchpath: in 4257 case :$dllsearchpath: in
4437 *":$libdir:"*) ;; 4258 *":$libdir:"*) ;;
4438 *) dllsearchpath="$dllsearchpath:$libdir";; 4259 *) dllsearchpath="$dllsearchpath:$libdir";;
4439 esac
4440 case :$dllsearchpath: in
4441 *":$testbindir:"*) ;;
4442 *) dllsearchpath="$dllsearchpath:$testbindir";;
4443 esac 4260 esac
4444 ;; 4261 ;;
4445 esac 4262 esac
4446 done 4263 done
4447 # Substitute the hardcoded libdirs into the rpath. 4264 # Substitute the hardcoded libdirs into the rpath.
4554 4371
4555 # Prepare the list of exported symbols 4372 # Prepare the list of exported symbols
4556 if test -z "$export_symbols"; then 4373 if test -z "$export_symbols"; then
4557 export_symbols="$output_objdir/$outputname.exp" 4374 export_symbols="$output_objdir/$outputname.exp"
4558 $run $rm $export_symbols 4375 $run $rm $export_symbols
4559 $run eval "${SED} -n -e '/^: @PROGRAM@ $/d' -e 's/^.* \(.*\)$/\1/p' "'< "$nlist" > "$export_symbols"' 4376 $run eval "${SED} -n -e '/^: @PROGRAM@$/d' -e 's/^.* \(.*\)$/\1/p' "'< "$nlist" > "$export_symbols"'
4560 case $host in
4561 *cygwin* | *mingw* )
4562 $run eval "echo EXPORTS "'> "$output_objdir/$outputname.def"'
4563 $run eval 'cat "$export_symbols" >> "$output_objdir/$outputname.def"'
4564 ;;
4565 esac
4566 else 4377 else
4567 $run eval "${SED} -e 's/\([].[*^$]\)/\\\\\1/g' -e 's/^/ /' -e 's/$/$/'"' < "$export_symbols" > "$output_objdir/$outputname.exp"' 4378 $run eval "${SED} -e 's/\([ ][.*^$]\)/\\\1/g' -e 's/^/ /' -e 's/$/$/'"' < "$export_symbols" > "$output_objdir/$outputname.exp"'
4568 $run eval 'grep -f "$output_objdir/$outputname.exp" < "$nlist" > "$nlist"T' 4379 $run eval 'grep -f "$output_objdir/$outputname.exp" < "$nlist" > "$nlist"T'
4569 $run eval 'mv "$nlist"T "$nlist"' 4380 $run eval 'mv "$nlist"T "$nlist"'
4570 case $host in
4571 *cygwin* | *mingw* )
4572 $run eval "echo EXPORTS "'> "$output_objdir/$outputname.def"'
4573 $run eval 'cat "$nlist" >> "$output_objdir/$outputname.def"'
4574 ;;
4575 esac
4576 fi 4381 fi
4577 fi 4382 fi
4578 4383
4579 for arg in $dlprefiles; do 4384 for arg in $dlprefiles; do
4580 $show "extracting global C symbols from \`$arg'" 4385 $show "extracting global C symbols from \`$arg'"
4687 *) pic_flag_for_symtable=" $pic_flag";; 4492 *) pic_flag_for_symtable=" $pic_flag";;
4688 esac 4493 esac
4689 esac 4494 esac
4690 4495
4691 # Now compile the dynamic symbol file. 4496 # Now compile the dynamic symbol file.
4692 $show "(cd $output_objdir && $LTCC $LTCFLAGS -c$no_builtin_flag$pic_flag_for_symtable \"$dlsyms\")" 4497 $show "(cd $output_objdir && $LTCC -c$no_builtin_flag$pic_flag_for_symtable \"$dlsyms\")"
4693 $run eval '(cd $output_objdir && $LTCC $LTCFLAGS -c$no_builtin_flag$pic_flag_for_symtable "$dlsyms")' || exit $? 4498 $run eval '(cd $output_objdir && $LTCC -c$no_builtin_flag$pic_flag_for_symtable "$dlsyms")' || exit $?
4694 4499
4695 # Clean up the generated files. 4500 # Clean up the generated files.
4696 $show "$rm $output_objdir/$dlsyms $nlist ${nlist}S ${nlist}T" 4501 $show "$rm $output_objdir/$dlsyms $nlist ${nlist}S ${nlist}T"
4697 $run $rm "$output_objdir/$dlsyms" "$nlist" "${nlist}S" "${nlist}T" 4502 $run $rm "$output_objdir/$dlsyms" "$nlist" "${nlist}S" "${nlist}T"
4698 4503
4699 # Transform the symbol file into the correct name. 4504 # Transform the symbol file into the correct name.
4700 case $host in
4701 *cygwin* | *mingw* )
4702 if test -f "$output_objdir/${outputname}.def" ; then
4703 compile_command=`$echo "X$compile_command" | $Xsed -e "s%@SYMFILE@%$output_objdir/${outputname}.def $output_objdir/${outputname}S.${objext}%"`
4704 finalize_command=`$echo "X$finalize_command" | $Xsed -e "s%@SYMFILE@%$output_objdir/${outputname}.def $output_objdir/${outputname}S.${objext}%"`
4705 else
4706 compile_command=`$echo "X$compile_command" | $Xsed -e "s%@SYMFILE@%$output_objdir/${outputname}S.${objext}%"`
4707 finalize_command=`$echo "X$finalize_command" | $Xsed -e "s%@SYMFILE@%$output_objdir/${outputname}S.${objext}%"`
4708 fi
4709 ;;
4710 * )
4711 compile_command=`$echo "X$compile_command" | $Xsed -e "s%@SYMFILE@%$output_objdir/${outputname}S.${objext}%"` 4505 compile_command=`$echo "X$compile_command" | $Xsed -e "s%@SYMFILE@%$output_objdir/${outputname}S.${objext}%"`
4712 finalize_command=`$echo "X$finalize_command" | $Xsed -e "s%@SYMFILE@%$output_objdir/${outputname}S.${objext}%"` 4506 finalize_command=`$echo "X$finalize_command" | $Xsed -e "s%@SYMFILE@%$output_objdir/${outputname}S.${objext}%"`
4713 ;;
4714 esac
4715 ;; 4507 ;;
4716 *) 4508 *)
4717 $echo "$modename: unknown suffix for \`$dlsyms'" 1>&2 4509 $echo "$modename: unknown suffix for \`$dlsyms'" 1>&2
4718 exit $EXIT_FAILURE 4510 exit $EXIT_FAILURE
4719 ;; 4511 ;;
4734 link_command="$compile_command$compile_rpath" 4526 link_command="$compile_command$compile_rpath"
4735 4527
4736 # We have no uninstalled library dependencies, so finalize right now. 4528 # We have no uninstalled library dependencies, so finalize right now.
4737 $show "$link_command" 4529 $show "$link_command"
4738 $run eval "$link_command" 4530 $run eval "$link_command"
4739 exit_status=$? 4531 status=$?
4740 4532
4741 # Delete the generated files. 4533 # Delete the generated files.
4742 if test -n "$dlsyms"; then 4534 if test -n "$dlsyms"; then
4743 $show "$rm $output_objdir/${outputname}S.${objext}" 4535 $show "$rm $output_objdir/${outputname}S.${objext}"
4744 $run $rm "$output_objdir/${outputname}S.${objext}" 4536 $run $rm "$output_objdir/${outputname}S.${objext}"
4745 fi 4537 fi
4746 4538
4747 exit $exit_status 4539 exit $status
4748 fi 4540 fi
4749 4541
4750 if test -n "$shlibpath_var"; then 4542 if test -n "$shlibpath_var"; then
4751 # We should set the shlibpath_var 4543 # We should set the shlibpath_var
4752 rpath= 4544 rpath=
4882 outputname=`$echo $outputname|${SED} 's,.exe$,,'` ;; 4674 outputname=`$echo $outputname|${SED} 's,.exe$,,'` ;;
4883 *) exeext= ;; 4675 *) exeext= ;;
4884 esac 4676 esac
4885 case $host in 4677 case $host in
4886 *cygwin* | *mingw* ) 4678 *cygwin* | *mingw* )
4887 output_name=`basename $output` 4679 cwrappersource=`$echo ${objdir}/lt-${outputname}.c`
4888 output_path=`dirname $output` 4680 cwrapper=`$echo ${output}.exe`
4889 cwrappersource="$output_path/$objdir/lt-$output_name.c"
4890 cwrapper="$output_path/$output_name.exe"
4891 $rm $cwrappersource $cwrapper 4681 $rm $cwrappersource $cwrapper
4892 trap "$rm $cwrappersource $cwrapper; exit $EXIT_FAILURE" 1 2 15 4682 trap "$rm $cwrappersource $cwrapper; exit $EXIT_FAILURE" 1 2 15
4893 4683
4894 cat > $cwrappersource <<EOF 4684 cat > $cwrappersource <<EOF
4895 4685
4896/* $cwrappersource - temporary wrapper executable for $objdir/$outputname 4686/* $cwrappersource - temporary wrapper executable for $objdir/$outputname
4897 Generated by $PROGRAM - GNU $PACKAGE $VERSION$TIMESTAMP 4687 Generated by $PROGRAM - GNU $PACKAGE $VERSION$TIMESTAMP
4912#include <stdlib.h> 4702#include <stdlib.h>
4913#include <unistd.h> 4703#include <unistd.h>
4914#include <malloc.h> 4704#include <malloc.h>
4915#include <stdarg.h> 4705#include <stdarg.h>
4916#include <assert.h> 4706#include <assert.h>
4917#include <string.h>
4918#include <ctype.h>
4919#include <sys/stat.h>
4920 4707
4921#if defined(PATH_MAX) 4708#if defined(PATH_MAX)
4922# define LT_PATHMAX PATH_MAX 4709# define LT_PATHMAX PATH_MAX
4923#elif defined(MAXPATHLEN) 4710#elif defined(MAXPATHLEN)
4924# define LT_PATHMAX MAXPATHLEN 4711# define LT_PATHMAX MAXPATHLEN
4925#else 4712#else
4926# define LT_PATHMAX 1024 4713# define LT_PATHMAX 1024
4927#endif 4714#endif
4928 4715
4929#ifndef DIR_SEPARATOR 4716#ifndef DIR_SEPARATOR
4930# define DIR_SEPARATOR '/' 4717#define DIR_SEPARATOR '/'
4931# define PATH_SEPARATOR ':'
4932#endif 4718#endif
4933 4719
4934#if defined (_WIN32) || defined (__MSDOS__) || defined (__DJGPP__) || \ 4720#if defined (_WIN32) || defined (__MSDOS__) || defined (__DJGPP__) || \
4935 defined (__OS2__) 4721 defined (__OS2__)
4936# define HAVE_DOS_BASED_FILE_SYSTEM 4722#define HAVE_DOS_BASED_FILE_SYSTEM
4937# ifndef DIR_SEPARATOR_2 4723#ifndef DIR_SEPARATOR_2
4938# define DIR_SEPARATOR_2 '\\' 4724#define DIR_SEPARATOR_2 '\\'
4939# endif 4725#endif
4940# ifndef PATH_SEPARATOR_2
4941# define PATH_SEPARATOR_2 ';'
4942# endif
4943#endif 4726#endif
4944 4727
4945#ifndef DIR_SEPARATOR_2 4728#ifndef DIR_SEPARATOR_2
4946# define IS_DIR_SEPARATOR(ch) ((ch) == DIR_SEPARATOR) 4729# define IS_DIR_SEPARATOR(ch) ((ch) == DIR_SEPARATOR)
4947#else /* DIR_SEPARATOR_2 */ 4730#else /* DIR_SEPARATOR_2 */
4948# define IS_DIR_SEPARATOR(ch) \ 4731# define IS_DIR_SEPARATOR(ch) \
4949 (((ch) == DIR_SEPARATOR) || ((ch) == DIR_SEPARATOR_2)) 4732 (((ch) == DIR_SEPARATOR) || ((ch) == DIR_SEPARATOR_2))
4950#endif /* DIR_SEPARATOR_2 */ 4733#endif /* DIR_SEPARATOR_2 */
4951 4734
4952#ifndef PATH_SEPARATOR_2
4953# define IS_PATH_SEPARATOR(ch) ((ch) == PATH_SEPARATOR)
4954#else /* PATH_SEPARATOR_2 */
4955# define IS_PATH_SEPARATOR(ch) ((ch) == PATH_SEPARATOR_2)
4956#endif /* PATH_SEPARATOR_2 */
4957
4958#define XMALLOC(type, num) ((type *) xmalloc ((num) * sizeof(type))) 4735#define XMALLOC(type, num) ((type *) xmalloc ((num) * sizeof(type)))
4959#define XFREE(stale) do { \ 4736#define XFREE(stale) do { \
4960 if (stale) { free ((void *) stale); stale = 0; } \ 4737 if (stale) { free ((void *) stale); stale = 0; } \
4961} while (0) 4738} while (0)
4962 4739
4963/* -DDEBUG is fairly common in CFLAGS. */
4964#undef DEBUG
4965#if defined DEBUGWRAPPER
4966# define DEBUG(format, ...) fprintf(stderr, format, __VA_ARGS__)
4967#else
4968# define DEBUG(format, ...)
4969#endif
4970
4971const char *program_name = NULL; 4740const char *program_name = NULL;
4972 4741
4973void * xmalloc (size_t num); 4742void * xmalloc (size_t num);
4974char * xstrdup (const char *string); 4743char * xstrdup (const char *string);
4975const char * base_name (const char *name); 4744char * basename (const char *name);
4976char * find_executable(const char *wrapper); 4745char * fnqualify(const char *path);
4977int check_executable(const char *path);
4978char * strendzap(char *str, const char *pat); 4746char * strendzap(char *str, const char *pat);
4979void lt_fatal (const char *message, ...); 4747void lt_fatal (const char *message, ...);
4980 4748
4981int 4749int
4982main (int argc, char *argv[]) 4750main (int argc, char *argv[])
4983{ 4751{
4984 char **newargz; 4752 char **newargz;
4985 int i; 4753 int i;
4986 4754
4987 program_name = (char *) xstrdup (base_name (argv[0])); 4755 program_name = (char *) xstrdup ((char *) basename (argv[0]));
4988 DEBUG("(main) argv[0] : %s\n",argv[0]);
4989 DEBUG("(main) program_name : %s\n",program_name);
4990 newargz = XMALLOC(char *, argc+2); 4756 newargz = XMALLOC(char *, argc+2);
4991EOF 4757EOF
4992 4758
4993 cat >> $cwrappersource <<EOF 4759 cat >> $cwrappersource <<EOF
4994 newargz[0] = (char *) xstrdup("$SHELL"); 4760 newargz[0] = "$SHELL";
4995EOF 4761EOF
4996 4762
4997 cat >> $cwrappersource <<"EOF" 4763 cat >> $cwrappersource <<"EOF"
4998 newargz[1] = find_executable(argv[0]); 4764 newargz[1] = fnqualify(argv[0]);
4999 if (newargz[1] == NULL)
5000 lt_fatal("Couldn't find %s", argv[0]);
5001 DEBUG("(main) found exe at : %s\n",newargz[1]);
5002 /* we know the script has the same name, without the .exe */ 4765 /* we know the script has the same name, without the .exe */
5003 /* so make sure newargz[1] doesn't end in .exe */ 4766 /* so make sure newargz[1] doesn't end in .exe */
5004 strendzap(newargz[1],".exe"); 4767 strendzap(newargz[1],".exe");
5005 for (i = 1; i < argc; i++) 4768 for (i = 1; i < argc; i++)
5006 newargz[i+1] = xstrdup(argv[i]); 4769 newargz[i+1] = xstrdup(argv[i]);
5007 newargz[argc+1] = NULL; 4770 newargz[argc+1] = NULL;
5008
5009 for (i=0; i<argc+1; i++)
5010 {
5011 DEBUG("(main) newargz[%d] : %s\n",i,newargz[i]);
5012 ;
5013 }
5014
5015EOF 4771EOF
5016 4772
5017 case $host_os in
5018 mingw*)
5019 cat >> $cwrappersource <<EOF 4773 cat >> $cwrappersource <<EOF
5020 execv("$SHELL",(char const **)newargz);
5021EOF
5022 ;;
5023 *)
5024 cat >> $cwrappersource <<EOF
5025 execv("$SHELL",newargz); 4774 execv("$SHELL",newargz);
5026EOF 4775EOF
5027 ;;
5028 esac
5029 4776
5030 cat >> $cwrappersource <<"EOF" 4777 cat >> $cwrappersource <<"EOF"
5031 return 127;
5032} 4778}
5033 4779
5034void * 4780void *
5035xmalloc (size_t num) 4781xmalloc (size_t num)
5036{ 4782{
5046{ 4792{
5047 return string ? strcpy ((char *) xmalloc (strlen (string) + 1), string) : NULL 4793 return string ? strcpy ((char *) xmalloc (strlen (string) + 1), string) : NULL
5048; 4794;
5049} 4795}
5050 4796
5051const char * 4797char *
5052base_name (const char *name) 4798basename (const char *name)
5053{ 4799{
5054 const char *base; 4800 const char *base;
5055 4801
5056#if defined (HAVE_DOS_BASED_FILE_SYSTEM) 4802#if defined (HAVE_DOS_BASED_FILE_SYSTEM)
5057 /* Skip over the disk name in MSDOS pathnames. */ 4803 /* Skip over the disk name in MSDOS pathnames. */
5058 if (isalpha ((unsigned char)name[0]) && name[1] == ':') 4804 if (isalpha (name[0]) && name[1] == ':')
5059 name += 2; 4805 name += 2;
5060#endif 4806#endif
5061 4807
5062 for (base = name; *name; name++) 4808 for (base = name; *name; name++)
5063 if (IS_DIR_SEPARATOR (*name)) 4809 if (IS_DIR_SEPARATOR (*name))
5064 base = name + 1; 4810 base = name + 1;
5065 return base; 4811 return (char *) base;
5066} 4812}
5067 4813
5068int 4814char *
5069check_executable(const char * path) 4815fnqualify(const char *path)
5070{ 4816{
5071 struct stat st; 4817 size_t size;
4818 char *p;
4819 char tmp[LT_PATHMAX + 1];
5072 4820
5073 DEBUG("(check_executable) : %s\n", path ? (*path ? path : "EMPTY!") : "NULL!"); 4821 assert(path != NULL);
5074 if ((!path) || (!*path))
5075 return 0;
5076 4822
5077 if ((stat (path, &st) >= 0) && 4823 /* Is it qualified already? */
5078 ( 4824#if defined (HAVE_DOS_BASED_FILE_SYSTEM)
5079 /* MinGW & native WIN32 do not support S_IXOTH or S_IXGRP */ 4825 if (isalpha (path[0]) && path[1] == ':')
5080#if defined (S_IXOTH) 4826 return xstrdup (path);
5081 ((st.st_mode & S_IXOTH) == S_IXOTH) ||
5082#endif 4827#endif
5083#if defined (S_IXGRP)
5084 ((st.st_mode & S_IXGRP) == S_IXGRP) ||
5085#endif
5086 ((st.st_mode & S_IXUSR) == S_IXUSR))
5087 )
5088 return 1;
5089 else
5090 return 0;
5091}
5092
5093/* Searches for the full path of the wrapper. Returns
5094 newly allocated full path name if found, NULL otherwise */
5095char *
5096find_executable (const char* wrapper)
5097{
5098 int has_slash = 0;
5099 const char* p;
5100 const char* p_next;
5101 /* static buffer for getcwd */
5102 char tmp[LT_PATHMAX + 1];
5103 int tmp_len;
5104 char* concat_name;
5105
5106 DEBUG("(find_executable) : %s\n", wrapper ? (*wrapper ? wrapper : "EMPTY!") : "NULL!");
5107
5108 if ((wrapper == NULL) || (*wrapper == '\0'))
5109 return NULL;
5110
5111 /* Absolute path? */
5112#if defined (HAVE_DOS_BASED_FILE_SYSTEM)
5113 if (isalpha ((unsigned char)wrapper[0]) && wrapper[1] == ':')
5114 {
5115 concat_name = xstrdup (wrapper);
5116 if (check_executable(concat_name))
5117 return concat_name;
5118 XFREE(concat_name);
5119 }
5120 else
5121 {
5122#endif
5123 if (IS_DIR_SEPARATOR (wrapper[0])) 4828 if (IS_DIR_SEPARATOR (path[0]))
5124 { 4829 return xstrdup (path);
5125 concat_name = xstrdup (wrapper);
5126 if (check_executable(concat_name))
5127 return concat_name;
5128 XFREE(concat_name);
5129 }
5130#if defined (HAVE_DOS_BASED_FILE_SYSTEM)
5131 }
5132#endif
5133 4830
5134 for (p = wrapper; *p; p++) 4831 /* prepend the current directory */
5135 if (*p == '/') 4832 /* doesn't handle '~' */
5136 {
5137 has_slash = 1;
5138 break;
5139 }
5140 if (!has_slash)
5141 {
5142 /* no slashes; search PATH */
5143 const char* path = getenv ("PATH");
5144 if (path != NULL)
5145 {
5146 for (p = path; *p; p = p_next)
5147 {
5148 const char* q;
5149 size_t p_len;
5150 for (q = p; *q; q++)
5151 if (IS_PATH_SEPARATOR(*q))
5152 break;
5153 p_len = q - p;
5154 p_next = (*q == '\0' ? q : q + 1);
5155 if (p_len == 0)
5156 {
5157 /* empty path: current directory */
5158 if (getcwd (tmp, LT_PATHMAX) == NULL)
5159 lt_fatal ("getcwd failed");
5160 tmp_len = strlen(tmp);
5161 concat_name = XMALLOC(char, tmp_len + 1 + strlen(wrapper) + 1);
5162 memcpy (concat_name, tmp, tmp_len);
5163 concat_name[tmp_len] = '/';
5164 strcpy (concat_name + tmp_len + 1, wrapper);
5165 }
5166 else
5167 {
5168 concat_name = XMALLOC(char, p_len + 1 + strlen(wrapper) + 1);
5169 memcpy (concat_name, p, p_len);
5170 concat_name[p_len] = '/';
5171 strcpy (concat_name + p_len + 1, wrapper);
5172 }
5173 if (check_executable(concat_name))
5174 return concat_name;
5175 XFREE(concat_name);
5176 }
5177 }
5178 /* not found in PATH; assume curdir */
5179 }
5180 /* Relative path | not found in path: prepend cwd */
5181 if (getcwd (tmp, LT_PATHMAX) == NULL) 4833 if (getcwd (tmp, LT_PATHMAX) == NULL)
5182 lt_fatal ("getcwd failed"); 4834 lt_fatal ("getcwd failed");
5183 tmp_len = strlen(tmp); 4835 size = strlen(tmp) + 1 + strlen(path) + 1; /* +2 for '/' and '\0' */
5184 concat_name = XMALLOC(char, tmp_len + 1 + strlen(wrapper) + 1); 4836 p = XMALLOC(char, size);
5185 memcpy (concat_name, tmp, tmp_len); 4837 sprintf(p, "%s%c%s", tmp, DIR_SEPARATOR, path);
5186 concat_name[tmp_len] = '/';
5187 strcpy (concat_name + tmp_len + 1, wrapper);
5188
5189 if (check_executable(concat_name))
5190 return concat_name;
5191 XFREE(concat_name);
5192 return NULL; 4838 return p;
5193} 4839}
5194 4840
5195char * 4841char *
5196strendzap(char *str, const char *pat) 4842strendzap(char *str, const char *pat)
5197{ 4843{
5231 va_start (ap, message); 4877 va_start (ap, message);
5232 lt_error_core (EXIT_FAILURE, "FATAL", message, ap); 4878 lt_error_core (EXIT_FAILURE, "FATAL", message, ap);
5233 va_end (ap); 4879 va_end (ap);
5234} 4880}
5235EOF 4881EOF
5236 # we should really use a build-platform specific compiler 4882 # we should really use a build-platform specific compiler
5237 # here, but OTOH, the wrappers (shell script and this C one) 4883 # here, but OTOH, the wrappers (shell script and this C one)
5238 # are only useful if you want to execute the "real" binary. 4884 # are only useful if you want to execute the "real" binary.
5239 # Since the "real" binary is built for $host, then this 4885 # Since the "real" binary is built for $host, then this
5240 # wrapper might as well be built for $host, too. 4886 # wrapper might as well be built for $host, too.
5241 $run $LTCC $LTCFLAGS -s -o $cwrapper $cwrappersource 4887 $run $LTCC -s -o $cwrapper $cwrappersource
5242 ;; 4888 ;;
5243 esac 4889 esac
5244 $rm $output 4890 $rm $output
5245 trap "$rm $output; exit $EXIT_FAILURE" 1 2 15 4891 trap "$rm $output; exit $EXIT_FAILURE" 1 2 15
5246 4892
5247 $echo > $output "\ 4893 $echo > $output "\
5248#! $SHELL 4894#! $SHELL
5249 4895
5250# $output - temporary wrapper script for $objdir/$outputname 4896# $output - temporary wrapper script for $objdir/$outputname
5390" 5036"
5391 case $host in 5037 case $host in
5392 # Backslashes separate directories on plain windows 5038 # Backslashes separate directories on plain windows
5393 *-*-mingw | *-*-os2*) 5039 *-*-mingw | *-*-os2*)
5394 $echo >> $output "\ 5040 $echo >> $output "\
5395 exec \"\$progdir\\\\\$program\" \${1+\"\$@\"} 5041 exec \$progdir\\\\\$program \${1+\"\$@\"}
5396" 5042"
5397 ;; 5043 ;;
5398 5044
5399 *) 5045 *)
5400 $echo >> $output "\ 5046 $echo >> $output "\
5401 exec \"\$progdir/\$program\" \${1+\"\$@\"} 5047 exec \$progdir/\$program \${1+\"\$@\"}
5402" 5048"
5403 ;; 5049 ;;
5404 esac 5050 esac
5405 $echo >> $output "\ 5051 $echo >> $output "\
5406 \$echo \"\$0: cannot exec \$program \${1+\"\$@\"}\" 5052 \$echo \"\$0: cannot exec \$program \${1+\"\$@\"}\"
5407 exit $EXIT_FAILURE 5053 exit $EXIT_FAILURE
5408 fi 5054 fi
5409 else 5055 else
5410 # The program doesn't exist. 5056 # The program doesn't exist.
5411 \$echo \"\$0: error: \\\`\$progdir/\$program' does not exist\" 1>&2 5057 \$echo \"\$0: error: \$progdir/\$program does not exist\" 1>&2
5412 \$echo \"This script is just a wrapper for \$program.\" 1>&2 5058 \$echo \"This script is just a wrapper for \$program.\" 1>&2
5413 $echo \"See the $PACKAGE documentation for more information.\" 1>&2 5059 $echo \"See the $PACKAGE documentation for more information.\" 1>&2
5414 exit $EXIT_FAILURE 5060 exit $EXIT_FAILURE
5415 fi 5061 fi
5416fi\ 5062fi\
5470 5116
5471 $show "${rm}r $gentop" 5117 $show "${rm}r $gentop"
5472 $run ${rm}r "$gentop" 5118 $run ${rm}r "$gentop"
5473 $show "$mkdir $gentop" 5119 $show "$mkdir $gentop"
5474 $run $mkdir "$gentop" 5120 $run $mkdir "$gentop"
5475 exit_status=$? 5121 status=$?
5476 if test "$exit_status" -ne 0 && test ! -d "$gentop"; then 5122 if test "$status" -ne 0 && test ! -d "$gentop"; then
5477 exit $exit_status 5123 exit $status
5478 fi 5124 fi
5479 fi 5125 fi
5480 5126
5481 save_oldobjs=$oldobjs 5127 save_oldobjs=$oldobjs
5482 oldobjs= 5128 oldobjs=
5529 for obj in $save_oldobjs 5175 for obj in $save_oldobjs
5530 do 5176 do
5531 oldobjs="$objlist $obj" 5177 oldobjs="$objlist $obj"
5532 objlist="$objlist $obj" 5178 objlist="$objlist $obj"
5533 eval test_cmds=\"$old_archive_cmds\" 5179 eval test_cmds=\"$old_archive_cmds\"
5534 if len=`expr "X$test_cmds" : ".*" 2>/dev/null` && 5180 if len=`expr "X$test_cmds" : ".*"` &&
5535 test "$len" -le "$max_cmd_len"; then 5181 test "$len" -le "$max_cmd_len"; then
5536 : 5182 :
5537 else 5183 else
5538 # the above command should be used before it gets too long 5184 # the above command should be used before it gets too long
5539 oldobjs=$objlist 5185 oldobjs=$objlist
5726 5372
5727 # There may be an optional sh(1) argument at the beginning of 5373 # There may be an optional sh(1) argument at the beginning of
5728 # install_prog (especially on Windows NT). 5374 # install_prog (especially on Windows NT).
5729 if test "$nonopt" = "$SHELL" || test "$nonopt" = /bin/sh || 5375 if test "$nonopt" = "$SHELL" || test "$nonopt" = /bin/sh ||
5730 # Allow the use of GNU shtool's install command. 5376 # Allow the use of GNU shtool's install command.
5731 $echo "X$nonopt" | grep shtool > /dev/null; then 5377 $echo "X$nonopt" | $Xsed | grep shtool > /dev/null; then
5732 # Aesthetically quote it. 5378 # Aesthetically quote it.
5733 arg=`$echo "X$nonopt" | $Xsed -e "$sed_quote_subst"` 5379 arg=`$echo "X$nonopt" | $Xsed -e "$sed_quote_subst"`
5734 case $arg in 5380 case $arg in
5735 *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") 5381 *$quote_scanset* | *]* | *\|* | *\&* | *\(* | *\)* | "")
5736 arg="\"$arg\"" 5382 arg="\"$arg\""
5737 ;; 5383 ;;
5738 esac 5384 esac
5739 install_prog="$arg " 5385 install_prog="$arg "
5740 arg="$1" 5386 arg="$1"
5741 shift 5387 shift
5742 else 5388 else
5743 install_prog= 5389 install_prog=
5744 arg=$nonopt 5390 arg="$nonopt"
5745 fi 5391 fi
5746 5392
5747 # The real first argument should be the name of the installation program. 5393 # The real first argument should be the name of the installation program.
5748 # Aesthetically quote it. 5394 # Aesthetically quote it.
5749 arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"` 5395 arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`
5750 case $arg in 5396 case $arg in
5751 *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") 5397 *$quote_scanset* | *]* | *\|* | *\&* | *\(* | *\)* | "")
5752 arg="\"$arg\"" 5398 arg="\"$arg\""
5753 ;; 5399 ;;
5754 esac 5400 esac
5755 install_prog="$install_prog$arg" 5401 install_prog="$install_prog$arg"
5756 5402
5764 stripme= 5410 stripme=
5765 for arg 5411 for arg
5766 do 5412 do
5767 if test -n "$dest"; then 5413 if test -n "$dest"; then
5768 files="$files $dest" 5414 files="$files $dest"
5769 dest=$arg 5415 dest="$arg"
5770 continue 5416 continue
5771 fi 5417 fi
5772 5418
5773 case $arg in 5419 case $arg in
5774 -d) isdir=yes ;; 5420 -d) isdir=yes ;;
5775 -f) 5421 -f) prev="-f" ;;
5776 case " $install_prog " in 5422 -g) prev="-g" ;;
5777 *[\\\ /]cp\ *) ;; 5423 -m) prev="-m" ;;
5778 *) prev=$arg ;; 5424 -o) prev="-o" ;;
5779 esac
5780 ;;
5781 -g | -m | -o) prev=$arg ;;
5782 -s) 5425 -s)
5783 stripme=" -s" 5426 stripme=" -s"
5784 continue 5427 continue
5785 ;; 5428 ;;
5786 -*) 5429 -*) ;;
5787 ;; 5430
5788 *) 5431 *)
5789 # If the previous option needed an argument, then skip it. 5432 # If the previous option needed an argument, then skip it.
5790 if test -n "$prev"; then 5433 if test -n "$prev"; then
5791 prev= 5434 prev=
5792 else 5435 else
5793 dest=$arg 5436 dest="$arg"
5794 continue 5437 continue
5795 fi 5438 fi
5796 ;; 5439 ;;
5797 esac 5440 esac
5798 5441
5799 # Aesthetically quote the argument. 5442 # Aesthetically quote the argument.
5800 arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"` 5443 arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`
5801 case $arg in 5444 case $arg in
5802 *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") 5445 *$quote_scanset* | *]* | *\|* | *\&* | *\(* | *\)* | "")
5803 arg="\"$arg\"" 5446 arg="\"$arg\""
5804 ;; 5447 ;;
5805 esac 5448 esac
5806 install_prog="$install_prog $arg" 5449 install_prog="$install_prog $arg"
5807 done 5450 done
5966 $run eval "$striplib $destdir/$realname" || exit $? 5609 $run eval "$striplib $destdir/$realname" || exit $?
5967 fi 5610 fi
5968 5611
5969 if test "$#" -gt 0; then 5612 if test "$#" -gt 0; then
5970 # Delete the old symlinks, and create new ones. 5613 # Delete the old symlinks, and create new ones.
5971 # Try `ln -sf' first, because the `ln' binary might depend on
5972 # the symlink we replace! Solaris /bin/ln does not understand -f,
5973 # so we also need to try rm && ln -s.
5974 for linkname 5614 for linkname
5975 do 5615 do
5976 if test "$linkname" != "$realname"; then 5616 if test "$linkname" != "$realname"; then
5977 $show "(cd $destdir && { $LN_S -f $realname $linkname || { $rm $linkname && $LN_S $realname $linkname; }; })" 5617 $show "(cd $destdir && $rm $linkname && $LN_S $realname $linkname)"
5978 $run eval "(cd $destdir && { $LN_S -f $realname $linkname || { $rm $linkname && $LN_S $realname $linkname; }; })" 5618 $run eval "(cd $destdir && $rm $linkname && $LN_S $realname $linkname)"
5979 fi 5619 fi
5980 done 5620 done
5981 fi 5621 fi
5982 5622
5983 # Do each command in the postinstall commands. 5623 # Do each command in the postinstall commands.
5986 save_ifs="$IFS"; IFS='~' 5626 save_ifs="$IFS"; IFS='~'
5987 for cmd in $cmds; do 5627 for cmd in $cmds; do
5988 IFS="$save_ifs" 5628 IFS="$save_ifs"
5989 eval cmd=\"$cmd\" 5629 eval cmd=\"$cmd\"
5990 $show "$cmd" 5630 $show "$cmd"
5991 $run eval "$cmd" || { 5631 $run eval "$cmd" || exit $?
5992 lt_exit=$?
5993
5994 # Restore the uninstalled library and exit
5995 if test "$mode" = relink; then
5996 $run eval '(cd $output_objdir && $rm ${realname}T && $mv ${realname}U $realname)'
5997 fi
5998
5999 exit $lt_exit
6000 }
6001 done 5632 done
6002 IFS="$save_ifs" 5633 IFS="$save_ifs"
6003 fi 5634 fi
6004 5635
6005 # Install the pseudo-library for information purposes. 5636 # Install the pseudo-library for information purposes.
6089 esac 5720 esac
6090 if (${SED} -e '4q' $wrapper | grep "^# Generated by .*$PACKAGE")>/dev/null 2>&1; then 5721 if (${SED} -e '4q' $wrapper | grep "^# Generated by .*$PACKAGE")>/dev/null 2>&1; then
6091 notinst_deplibs= 5722 notinst_deplibs=
6092 relink_command= 5723 relink_command=
6093 5724
6094 # Note that it is not necessary on cygwin/mingw to append a dot to 5725 # To insure that "foo" is sourced, and not "foo.exe",
6095 # foo even if both foo and FILE.exe exist: automatic-append-.exe 5726 # finese the cygwin/MSYS system by explicitly sourcing "foo."
6096 # behavior happens only for exec(3), not for open(2)! Also, sourcing 5727 # which disallows the automatic-append-.exe behavior.
6097 # `FILE.' does not work on cygwin managed mounts. 5728 case $build in
6098 # 5729 *cygwin* | *mingw*) wrapperdot=${wrapper}. ;;
5730 *) wrapperdot=${wrapper} ;;
5731 esac
6099 # If there is no directory component, then add one. 5732 # If there is no directory component, then add one.
6100 case $wrapper in 5733 case $file in
6101 */* | *\\*) . ${wrapper} ;; 5734 */* | *\\*) . ${wrapperdot} ;;
6102 *) . ./${wrapper} ;; 5735 *) . ./${wrapperdot} ;;
6103 esac 5736 esac
6104 5737
6105 # Check the variables that should have been set. 5738 # Check the variables that should have been set.
6106 if test -z "$notinst_deplibs"; then 5739 if test -z "$notinst_deplibs"; then
6107 $echo "$modename: invalid libtool wrapper script \`$wrapper'" 1>&2 5740 $echo "$modename: invalid libtool wrapper script \`$wrapper'" 1>&2
6125 finalize=no 5758 finalize=no
6126 fi 5759 fi
6127 done 5760 done
6128 5761
6129 relink_command= 5762 relink_command=
6130 # Note that it is not necessary on cygwin/mingw to append a dot to 5763 # To insure that "foo" is sourced, and not "foo.exe",
6131 # foo even if both foo and FILE.exe exist: automatic-append-.exe 5764 # finese the cygwin/MSYS system by explicitly sourcing "foo."
6132 # behavior happens only for exec(3), not for open(2)! Also, sourcing 5765 # which disallows the automatic-append-.exe behavior.
6133 # `FILE.' does not work on cygwin managed mounts. 5766 case $build in
6134 # 5767 *cygwin* | *mingw*) wrapperdot=${wrapper}. ;;
5768 *) wrapperdot=${wrapper} ;;
5769 esac
6135 # If there is no directory component, then add one. 5770 # If there is no directory component, then add one.
6136 case $wrapper in 5771 case $file in
6137 */* | *\\*) . ${wrapper} ;; 5772 */* | *\\*) . ${wrapperdot} ;;
6138 *) . ./${wrapper} ;; 5773 *) . ./${wrapperdot} ;;
6139 esac 5774 esac
6140 5775
6141 outputname= 5776 outputname=
6142 if test "$fast_install" = no && test -n "$relink_command"; then 5777 if test "$fast_install" = no && test -n "$relink_command"; then
6143 if test "$finalize" = yes && test -z "$run"; then 5778 if test "$finalize" = yes && test -z "$run"; then
6144 tmpdir=`func_mktempdir` 5779 tmpdir="/tmp"
5780 test -n "$TMPDIR" && tmpdir="$TMPDIR"
5781 tmpdir="$tmpdir/libtool-$$"
5782 save_umask=`umask`
5783 umask 0077
5784 if $mkdir "$tmpdir"; then
5785 umask $save_umask
5786 else
5787 umask $save_umask
5788 $echo "$modename: error: cannot create temporary directory \`$tmpdir'" 1>&2
5789 continue
5790 fi
6145 file=`$echo "X$file$stripped_ext" | $Xsed -e 's%^.*/%%'` 5791 file=`$echo "X$file$stripped_ext" | $Xsed -e 's%^.*/%%'`
6146 outputname="$tmpdir/$file" 5792 outputname="$tmpdir/$file"
6147 # Replace the output file specification. 5793 # Replace the output file specification.
6148 relink_command=`$echo "X$relink_command" | $Xsed -e 's%@OUTPUT@%'"$outputname"'%g'` 5794 relink_command=`$echo "X$relink_command" | $Xsed -e 's%@OUTPUT@%'"$outputname"'%g'`
6149 5795
6163 file=`$echo "X$file$stripped_ext" | $Xsed -e "s%\([^/]*\)$%$objdir/\1%"` 5809 file=`$echo "X$file$stripped_ext" | $Xsed -e "s%\([^/]*\)$%$objdir/\1%"`
6164 fi 5810 fi
6165 fi 5811 fi
6166 5812
6167 # remove .exe since cygwin /usr/bin/install will append another 5813 # remove .exe since cygwin /usr/bin/install will append another
6168 # one anyway 5814 # one anyways
6169 case $install_prog,$host in 5815 case $install_prog,$host in
6170 */usr/bin/install*,*cygwin*) 5816 */usr/bin/install*,*cygwin*)
6171 case $file:$destfile in 5817 case $file:$destfile in
6172 *.exe:*.exe) 5818 *.exe:*.exe)
6173 # this is ok 5819 # this is ok
6263 fi 5909 fi
6264 5910
6265 # Exit here if they wanted silent mode. 5911 # Exit here if they wanted silent mode.
6266 test "$show" = : && exit $EXIT_SUCCESS 5912 test "$show" = : && exit $EXIT_SUCCESS
6267 5913
6268 $echo "X----------------------------------------------------------------------" | $Xsed
6269 $echo "Libraries have been installed in:"
6270 for libdir in $libdirs; do
6271 $echo " $libdir"
6272 done
6273 $echo
6274 $echo "If you ever happen to want to link against installed libraries"
6275 $echo "in a given directory, LIBDIR, you must either use libtool, and"
6276 $echo "specify the full pathname of the library, or use the \`-LLIBDIR'"
6277 $echo "flag during linking and do at least one of the following:"
6278 if test -n "$shlibpath_var"; then
6279 $echo " - add LIBDIR to the \`$shlibpath_var' environment variable"
6280 $echo " during execution"
6281 fi
6282 if test -n "$runpath_var"; then
6283 $echo " - add LIBDIR to the \`$runpath_var' environment variable"
6284 $echo " during linking"
6285 fi
6286 if test -n "$hardcode_libdir_flag_spec"; then
6287 libdir=LIBDIR
6288 eval flag=\"$hardcode_libdir_flag_spec\"
6289
6290 $echo " - use the \`$flag' linker flag"
6291 fi
6292 if test -n "$admincmds"; then
6293 $echo " - have your system administrator run these commands:$admincmds"
6294 fi
6295 if test -f /etc/ld.so.conf; then
6296 $echo " - have your system administrator add LIBDIR to \`/etc/ld.so.conf'"
6297 fi
6298 $echo
6299 $echo "See any operating system documentation about shared libraries for"
6300 $echo "more information, such as the ld(1) and ld.so(8) manual pages."
6301 $echo "X----------------------------------------------------------------------" | $Xsed
6302 exit $EXIT_SUCCESS 5914 exit $EXIT_SUCCESS
6303 ;; 5915 ;;
6304 5916
6305 # libtool execute mode 5917 # libtool execute mode
6306 execute) 5918 execute)
6513 # Delete the libtool libraries and symlinks. 6125 # Delete the libtool libraries and symlinks.
6514 for n in $library_names; do 6126 for n in $library_names; do
6515 rmfiles="$rmfiles $objdir/$n" 6127 rmfiles="$rmfiles $objdir/$n"
6516 done 6128 done
6517 test -n "$old_library" && rmfiles="$rmfiles $objdir/$old_library" 6129 test -n "$old_library" && rmfiles="$rmfiles $objdir/$old_library"
6518
6519 case "$mode" in
6520 clean)
6521 case " $library_names " in
6522 # " " in the beginning catches empty $dlname
6523 *" $dlname "*) ;;
6524 *) rmfiles="$rmfiles $objdir/$dlname" ;;
6525 esac
6526 test -n "$libdir" && rmfiles="$rmfiles $objdir/$name $objdir/${name}i" 6130 test "$mode" = clean && rmfiles="$rmfiles $objdir/$name $objdir/${name}i"
6527 ;; 6131
6528 uninstall) 6132 if test "$mode" = uninstall; then
6529 if test -n "$library_names"; then 6133 if test -n "$library_names"; then
6530 # Do each command in the postuninstall commands. 6134 # Do each command in the postuninstall commands.
6531 cmds=$postuninstall_cmds 6135 cmds=$postuninstall_cmds
6532 save_ifs="$IFS"; IFS='~' 6136 save_ifs="$IFS"; IFS='~'
6533 for cmd in $cmds; do 6137 for cmd in $cmds; do
6556 fi 6160 fi
6557 done 6161 done
6558 IFS="$save_ifs" 6162 IFS="$save_ifs"
6559 fi 6163 fi
6560 # FIXME: should reinstall the best remaining shared library. 6164 # FIXME: should reinstall the best remaining shared library.
6561 ;; 6165 fi
6562 esac
6563 fi 6166 fi
6564 ;; 6167 ;;
6565 6168
6566 *.lo) 6169 *.lo)
6567 # Possibly a libtool object, so verify it. 6170 # Possibly a libtool object, so verify it.
6856# time on that platform, so we default to a shared-only configuration. 6459# time on that platform, so we default to a shared-only configuration.
6857# If a disable-shared tag is given, we'll fallback to a static-only 6460# If a disable-shared tag is given, we'll fallback to a static-only
6858# configuration. But we'll never go from static-only to shared-only. 6461# configuration. But we'll never go from static-only to shared-only.
6859 6462
6860# ### BEGIN LIBTOOL TAG CONFIG: disable-shared 6463# ### BEGIN LIBTOOL TAG CONFIG: disable-shared
6861disable_libs=shared 6464build_libtool_libs=no
6465build_old_libs=yes
6862# ### END LIBTOOL TAG CONFIG: disable-shared 6466# ### END LIBTOOL TAG CONFIG: disable-shared
6863 6467
6864# ### BEGIN LIBTOOL TAG CONFIG: disable-static 6468# ### BEGIN LIBTOOL TAG CONFIG: disable-static
6865disable_libs=static 6469build_old_libs=`case $build_libtool_libs in yes) $echo no;; *) $echo yes;; esac`
6866# ### END LIBTOOL TAG CONFIG: disable-static 6470# ### END LIBTOOL TAG CONFIG: disable-static
6867 6471
6868# Local Variables: 6472# Local Variables:
6869# mode:shell-script 6473# mode:shell-script
6870# sh-indentation:2 6474# sh-indentation:2

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines