Deleted Added
full compact
ltmain.sh (156283) ltmain.sh (159985)
1# ltmain.sh - Provide generalized library-building support services.
2# NOTE: Changing this file will not affect anything until you rerun configure.
3#
4# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005
5# Free Software Foundation, Inc.
6# Originally by Gordon Matzigkeit <gord@gnu.ai.mit.edu>, 1996
7#
8# This program is free software; you can redistribute it and/or modify

--- 29 unchanged lines hidden (view full) ---

38modename="$progname"
39
40# Global variables:
41EXIT_SUCCESS=0
42EXIT_FAILURE=1
43
44PROGRAM=ltmain.sh
45PACKAGE=libtool
1# ltmain.sh - Provide generalized library-building support services.
2# NOTE: Changing this file will not affect anything until you rerun configure.
3#
4# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005
5# Free Software Foundation, Inc.
6# Originally by Gordon Matzigkeit <gord@gnu.ai.mit.edu>, 1996
7#
8# This program is free software; you can redistribute it and/or modify

--- 29 unchanged lines hidden (view full) ---

38modename="$progname"
39
40# Global variables:
41EXIT_SUCCESS=0
42EXIT_FAILURE=1
43
44PROGRAM=ltmain.sh
45PACKAGE=libtool
46VERSION=1.5.20
47TIMESTAMP=" (1.1220.2.287 2005/08/31 18:54:15)"
46VERSION=1.5.22
47TIMESTAMP=" (1.1220.2.365 2005/12/18 22:14:06)"
48
49# See if we are running on zsh, and set the options which allow our
50# commands through without removal of \ escapes.
51if test -n "${ZSH_VERSION+set}" ; then
52 setopt NO_GLOB_SUBST
53fi
54
55# Check that we have a working $echo.

--- 71 unchanged lines hidden (view full) ---

127mode=$default_mode
128nonopt=
129prev=
130prevopt=
131run=
132show="$echo"
133show_help=
134execute_dlfiles=
48
49# See if we are running on zsh, and set the options which allow our
50# commands through without removal of \ escapes.
51if test -n "${ZSH_VERSION+set}" ; then
52 setopt NO_GLOB_SUBST
53fi
54
55# Check that we have a working $echo.

--- 71 unchanged lines hidden (view full) ---

127mode=$default_mode
128nonopt=
129prev=
130prevopt=
131run=
132show="$echo"
133show_help=
134execute_dlfiles=
135duplicate_deps=no
136preserve_args=
135lo2o="s/\\.lo\$/.${objext}/"
136o2lo="s/\\.${objext}\$/.lo/"
137
138#####################################
139# Shell function definitions:
140# This seems to be the best place for them
141
137lo2o="s/\\.lo\$/.${objext}/"
138o2lo="s/\\.${objext}\$/.lo/"
139
140#####################################
141# Shell function definitions:
142# 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
142# func_win32_libid arg
143# return the library type of file 'arg'
144#
145# Need a lot of goo to handle *both* DLLs and import libs
146# Has to be a shell function in order to 'eat' the argument
147# that is supplied when $file_magic_command is called.
148func_win32_libid ()
149{
150 win32_libid_type="unknown"
151 win32_fileres=`file -L $1 2>/dev/null`
152 case $win32_fileres in
153 *ar\ archive\ import\ library*) # definitely import
154 win32_libid_type="x86 archive import"
155 ;;
156 *ar\ archive*) # could be an import, or static
157 if eval $OBJDUMP -f $1 | $SED -e '10q' 2>/dev/null | \
158 $EGREP -e 'file format pe-i386(.*architecture: i386)?' >/dev/null ; then
159 win32_nmres=`eval $NM -f posix -A $1 | \
181# func_win32_libid arg
182# return the library type of file 'arg'
183#
184# Need a lot of goo to handle *both* DLLs and import libs
185# Has to be a shell function in order to 'eat' the argument
186# that is supplied when $file_magic_command is called.
187func_win32_libid ()
188{
189 win32_libid_type="unknown"
190 win32_fileres=`file -L $1 2>/dev/null`
191 case $win32_fileres in
192 *ar\ archive\ import\ library*) # definitely import
193 win32_libid_type="x86 archive import"
194 ;;
195 *ar\ archive*) # could be an import, or static
196 if eval $OBJDUMP -f $1 | $SED -e '10q' 2>/dev/null | \
197 $EGREP -e 'file format pe-i386(.*architecture: i386)?' >/dev/null ; then
198 win32_nmres=`eval $NM -f posix -A $1 | \
160 sed -n -e '1,100{/ I /{x;/import/!{s/^/import/;h;p;};x;};}'`
161 if test "X$win32_nmres" = "Ximport" ; then
162 win32_libid_type="x86 archive import"
163 else
164 win32_libid_type="x86 archive static"
165 fi
199 $SED -n -e '1,100{/ I /{s,.*,import,;p;q;};}'`
200 case $win32_nmres in
201 import*) win32_libid_type="x86 archive import";;
202 *) win32_libid_type="x86 archive static";;
203 esac
166 fi
167 ;;
168 *DLL*)
169 win32_libid_type="x86 DLL"
170 ;;
171 *executable*) # but shell scripts are "executable" too...
172 case $win32_fileres in
173 *MS\ Windows\ PE\ Intel*)

--- 9 unchanged lines hidden (view full) ---

183# func_infer_tag arg
184# Infer tagged configuration to use if any are available and
185# if one wasn't chosen via the "--tag" command line option.
186# Only attempt this if the compiler in the base compile
187# command doesn't match the default compiler.
188# arg is usually of the form 'gcc ...'
189func_infer_tag ()
190{
204 fi
205 ;;
206 *DLL*)
207 win32_libid_type="x86 DLL"
208 ;;
209 *executable*) # but shell scripts are "executable" too...
210 case $win32_fileres in
211 *MS\ Windows\ PE\ Intel*)

--- 9 unchanged lines hidden (view full) ---

221# func_infer_tag arg
222# Infer tagged configuration to use if any are available and
223# if one wasn't chosen via the "--tag" command line option.
224# Only attempt this if the compiler in the base compile
225# command doesn't match the default compiler.
226# arg is usually of the form 'gcc ...'
227func_infer_tag ()
228{
229 # FreeBSD-specific: where we install compilers with non-standard names
230 tag_compilers_CC="*cc cc* *gcc gcc*"
231 tag_compilers_CXX="*c++ c++* *g++ g++*"
232 base_compiler=`set -- "$@"; echo $1`
233
234 # If $tagname isn't set, then try to infer if the default "CC" tag applies
235 if test -z "$tagname"; then
236 for zp in $tag_compilers_CC; do
237 case $base_compiler in
238 $zp) tagname="CC"; break;;
239 esac
240 done
241 fi
242
191 if test -n "$available_tags" && test -z "$tagname"; then
192 CC_quoted=
193 for arg in $CC; do
194 case $arg in
195 *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
196 arg="\"$arg\""
197 ;;
198 esac

--- 24 unchanged lines hidden (view full) ---

223 " $CC "* | "$CC "* | " `$echo $CC` "* | "`$echo $CC` "* | " $CC_quoted"* | "$CC_quoted "* | " `$echo $CC_quoted` "* | "`$echo $CC_quoted` "*)
224 # The compiler in the base compile command matches
225 # the one in the tagged configuration.
226 # Assume this is the tagged configuration we want.
227 tagname=$z
228 break
229 ;;
230 esac
243 if test -n "$available_tags" && test -z "$tagname"; then
244 CC_quoted=
245 for arg in $CC; do
246 case $arg in
247 *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
248 arg="\"$arg\""
249 ;;
250 esac

--- 24 unchanged lines hidden (view full) ---

275 " $CC "* | "$CC "* | " `$echo $CC` "* | "`$echo $CC` "* | " $CC_quoted"* | "$CC_quoted "* | " `$echo $CC_quoted` "* | "`$echo $CC_quoted` "*)
276 # The compiler in the base compile command matches
277 # the one in the tagged configuration.
278 # Assume this is the tagged configuration we want.
279 tagname=$z
280 break
281 ;;
282 esac
231 fi
283
284 # FreeBSD-specific: try compilers based on inferred tag
285 if test -z "$tagname"; then
286 eval "tag_compilers=\$tag_compilers_${z}"
287 if test -n "$tag_compilers"; then
288 for zp in $tag_compilers; do
289 case $base_compiler in
290 $zp) tagname=$z; break;;
291 esac
292 done
293 if test -n "$tagname"; then
294 break
295 fi
296 fi
297 fi
298 fi
232 done
233 # If $tagname still isn't set, then no tagged configuration
234 # was found and let the user know that the "--tag" command
235 # line option must be used.
236 if test -z "$tagname"; then
237 $echo "$modename: unable to infer tagged configuration"
238 $echo "$modename: specify a tag with \`--tag'" 1>&2
239 exit $EXIT_FAILURE

--- 50 unchanged lines hidden (view full) ---

290 esac
291 my_xlib=`$echo "X$my_xlib" | $Xsed -e 's%^.*/%%'`
292 my_xdir="$my_gentop/$my_xlib"
293
294 $show "${rm}r $my_xdir"
295 $run ${rm}r "$my_xdir"
296 $show "$mkdir $my_xdir"
297 $run $mkdir "$my_xdir"
299 done
300 # If $tagname still isn't set, then no tagged configuration
301 # was found and let the user know that the "--tag" command
302 # line option must be used.
303 if test -z "$tagname"; then
304 $echo "$modename: unable to infer tagged configuration"
305 $echo "$modename: specify a tag with \`--tag'" 1>&2
306 exit $EXIT_FAILURE

--- 50 unchanged lines hidden (view full) ---

357 esac
358 my_xlib=`$echo "X$my_xlib" | $Xsed -e 's%^.*/%%'`
359 my_xdir="$my_gentop/$my_xlib"
360
361 $show "${rm}r $my_xdir"
362 $run ${rm}r "$my_xdir"
363 $show "$mkdir $my_xdir"
364 $run $mkdir "$my_xdir"
298 status=$?
299 if test "$status" -ne 0 && test ! -d "$my_xdir"; then
300 exit $status
365 exit_status=$?
366 if test "$exit_status" -ne 0 && test ! -d "$my_xdir"; then
367 exit $exit_status
301 fi
302 case $host in
303 *-darwin*)
304 $show "Extracting $my_xabs"
305 # Do not bother doing anything if just a dry run
306 if test -z "$run"; then
307 darwin_orig_dir=`pwd`
308 cd $my_xdir || exit $?

--- 38 unchanged lines hidden (view full) ---

347 func_extract_archives_result="$my_oldobjs"
348}
349# End of Shell function definitions
350#####################################
351
352# Darwin sucks
353eval std_shrext=\"$shrext_cmds\"
354
368 fi
369 case $host in
370 *-darwin*)
371 $show "Extracting $my_xabs"
372 # Do not bother doing anything if just a dry run
373 if test -z "$run"; then
374 darwin_orig_dir=`pwd`
375 cd $my_xdir || exit $?

--- 38 unchanged lines hidden (view full) ---

414 func_extract_archives_result="$my_oldobjs"
415}
416# End of Shell function definitions
417#####################################
418
419# Darwin sucks
420eval std_shrext=\"$shrext_cmds\"
421
422disable_libs=no
423
355# Parse our command line options once, thoroughly.
356while test "$#" -gt 0
357do
358 arg="$1"
359 shift
360
361 case $arg in
362 -*=*) optarg=`$echo "X$arg" | $Xsed -e 's/[-_a-zA-Z0-9]*=//'` ;;

--- 100 unchanged lines hidden (view full) ---

463
464 --preserve-dup-deps) duplicate_deps="yes" ;;
465
466 --quiet | --silent)
467 show=:
468 preserve_args="$preserve_args $arg"
469 ;;
470
424# Parse our command line options once, thoroughly.
425while test "$#" -gt 0
426do
427 arg="$1"
428 shift
429
430 case $arg in
431 -*=*) optarg=`$echo "X$arg" | $Xsed -e 's/[-_a-zA-Z0-9]*=//'` ;;

--- 100 unchanged lines hidden (view full) ---

532
533 --preserve-dup-deps) duplicate_deps="yes" ;;
534
535 --quiet | --silent)
536 show=:
537 preserve_args="$preserve_args $arg"
538 ;;
539
471 --tag) prevopt="--tag" prev=tag ;;
540 --tag)
541 prevopt="--tag"
542 prev=tag
543 preserve_args="$preserve_args --tag"
544 ;;
472 --tag=*)
473 set tag "$optarg" ${1+"$@"}
474 shift
475 prev=tag
476 preserve_args="$preserve_args --tag"
477 ;;
478
479 -dlopen)

--- 15 unchanged lines hidden (view full) ---

495done
496
497if test -n "$prevopt"; then
498 $echo "$modename: option \`$prevopt' requires an argument" 1>&2
499 $echo "$help" 1>&2
500 exit $EXIT_FAILURE
501fi
502
545 --tag=*)
546 set tag "$optarg" ${1+"$@"}
547 shift
548 prev=tag
549 preserve_args="$preserve_args --tag"
550 ;;
551
552 -dlopen)

--- 15 unchanged lines hidden (view full) ---

568done
569
570if test -n "$prevopt"; then
571 $echo "$modename: option \`$prevopt' requires an argument" 1>&2
572 $echo "$help" 1>&2
573 exit $EXIT_FAILURE
574fi
575
576case $disable_libs in
577no)
578 ;;
579shared)
580 build_libtool_libs=no
581 build_old_libs=yes
582 ;;
583static)
584 build_old_libs=`case $build_libtool_libs in yes) echo no;; *) echo yes;; esac`
585 ;;
586esac
587
503# If this variable is set in any of the actions, the command in it
504# will be execed at the end. This prevents here-documents from being
505# left over by shells.
506exec_cmd=
507
508if test -z "$show_help"; then
509
510 # Infer the operation mode.

--- 340 unchanged lines hidden (view full) ---

851 else
852 # Don't build PIC code
853 command="$base_compile $qsrcfile"
854 fi
855
856 if test ! -d "${xdir}$objdir"; then
857 $show "$mkdir ${xdir}$objdir"
858 $run $mkdir ${xdir}$objdir
588# If this variable is set in any of the actions, the command in it
589# will be execed at the end. This prevents here-documents from being
590# left over by shells.
591exec_cmd=
592
593if test -z "$show_help"; then
594
595 # Infer the operation mode.

--- 340 unchanged lines hidden (view full) ---

936 else
937 # Don't build PIC code
938 command="$base_compile $qsrcfile"
939 fi
940
941 if test ! -d "${xdir}$objdir"; then
942 $show "$mkdir ${xdir}$objdir"
943 $run $mkdir ${xdir}$objdir
859 status=$?
860 if test "$status" -ne 0 && test ! -d "${xdir}$objdir"; then
861 exit $status
944 exit_status=$?
945 if test "$exit_status" -ne 0 && test ! -d "${xdir}$objdir"; then
946 exit $exit_status
862 fi
863 fi
864
865 if test -z "$output_obj"; then
866 # Place PIC objects in $objdir
867 command="$command -o $lobj"
868 fi
869

--- 186 unchanged lines hidden (view full) ---

1056 export_symbols_regex=
1057 generated=
1058 libobjs=
1059 ltlibs=
1060 module=no
1061 no_install=no
1062 objs=
1063 non_pic_objects=
947 fi
948 fi
949
950 if test -z "$output_obj"; then
951 # Place PIC objects in $objdir
952 command="$command -o $lobj"
953 fi
954

--- 186 unchanged lines hidden (view full) ---

1141 export_symbols_regex=
1142 generated=
1143 libobjs=
1144 ltlibs=
1145 module=no
1146 no_install=no
1147 objs=
1148 non_pic_objects=
1149 notinst_path= # paths that contain not-installed libtool libraries
1064 precious_files_regex=
1065 prefer_static_libs=no
1066 preload=no
1067 prev=
1068 prevarg=
1069 release=
1070 rpath=
1071 xrpath=

--- 12 unchanged lines hidden (view full) ---

1084 -all-static | -static)
1085 if test "X$arg" = "X-all-static"; then
1086 if test "$build_libtool_libs" = yes && test -z "$link_static_flag"; then
1087 $echo "$modename: warning: complete static linking is impossible in this configuration" 1>&2
1088 fi
1089 if test -n "$link_static_flag"; then
1090 dlopen_self=$dlopen_self_static
1091 fi
1150 precious_files_regex=
1151 prefer_static_libs=no
1152 preload=no
1153 prev=
1154 prevarg=
1155 release=
1156 rpath=
1157 xrpath=

--- 12 unchanged lines hidden (view full) ---

1170 -all-static | -static)
1171 if test "X$arg" = "X-all-static"; then
1172 if test "$build_libtool_libs" = yes && test -z "$link_static_flag"; then
1173 $echo "$modename: warning: complete static linking is impossible in this configuration" 1>&2
1174 fi
1175 if test -n "$link_static_flag"; then
1176 dlopen_self=$dlopen_self_static
1177 fi
1178 prefer_static_libs=yes
1092 else
1093 if test -z "$pic_flag" && test -n "$link_static_flag"; then
1094 dlopen_self=$dlopen_self_static
1095 fi
1179 else
1180 if test -z "$pic_flag" && test -n "$link_static_flag"; then
1181 dlopen_self=$dlopen_self_static
1182 fi
1183 prefer_static_libs=built
1096 fi
1097 build_libtool_libs=no
1098 build_old_libs=yes
1184 fi
1185 build_libtool_libs=no
1186 build_old_libs=yes
1099 prefer_static_libs=yes
1100 break
1101 ;;
1102 esac
1103 done
1104
1105 # See if our shared archives depend on static archives.
1106 test -n "$old_archive_from_new_cmds" && build_old_libs=yes
1107

--- 158 unchanged lines hidden (view full) ---

1266 # Prepend the subdirectory the object is found in.
1267 non_pic_object="$xdir$non_pic_object"
1268
1269 # A standard non-PIC object
1270 non_pic_objects="$non_pic_objects $non_pic_object"
1271 if test -z "$pic_object" || test "$pic_object" = none ; then
1272 arg="$non_pic_object"
1273 fi
1187 break
1188 ;;
1189 esac
1190 done
1191
1192 # See if our shared archives depend on static archives.
1193 test -n "$old_archive_from_new_cmds" && build_old_libs=yes
1194

--- 158 unchanged lines hidden (view full) ---

1353 # Prepend the subdirectory the object is found in.
1354 non_pic_object="$xdir$non_pic_object"
1355
1356 # A standard non-PIC object
1357 non_pic_objects="$non_pic_objects $non_pic_object"
1358 if test -z "$pic_object" || test "$pic_object" = none ; then
1359 arg="$non_pic_object"
1360 fi
1361 else
1362 # If the PIC object exists, use it instead.
1363 # $xdir was prepended to $pic_object above.
1364 non_pic_object="$pic_object"
1365 non_pic_objects="$non_pic_objects $non_pic_object"
1274 fi
1275 else
1276 # Only an error if not doing a dry-run.
1277 if test -z "$run"; then
1278 $echo "$modename: \`$arg' is not a valid libtool object" 1>&2
1279 exit $EXIT_FAILURE
1280 else
1281 # Dry-run case.

--- 67 unchanged lines hidden (view full) ---

1349 finalize_command="$finalize_command $qarg"
1350 continue
1351 ;;
1352 shrext)
1353 shrext_cmds="$arg"
1354 prev=
1355 continue
1356 ;;
1366 fi
1367 else
1368 # Only an error if not doing a dry-run.
1369 if test -z "$run"; then
1370 $echo "$modename: \`$arg' is not a valid libtool object" 1>&2
1371 exit $EXIT_FAILURE
1372 else
1373 # Dry-run case.

--- 67 unchanged lines hidden (view full) ---

1441 finalize_command="$finalize_command $qarg"
1442 continue
1443 ;;
1444 shrext)
1445 shrext_cmds="$arg"
1446 prev=
1447 continue
1448 ;;
1357 darwin_framework)
1358 compiler_flags="$compiler_flags $arg"
1449 darwin_framework|darwin_framework_skip)
1450 test "$prev" = "darwin_framework" && compiler_flags="$compiler_flags $arg"
1359 compile_command="$compile_command $arg"
1360 finalize_command="$finalize_command $arg"
1361 prev=
1362 continue
1363 ;;
1364 *)
1365 eval "$prev=\"\$arg\""
1366 prev=

--- 47 unchanged lines hidden (view full) ---

1414 if test "X$arg" = "X-export-symbols"; then
1415 prev=expsyms
1416 else
1417 prev=expsyms_regex
1418 fi
1419 continue
1420 ;;
1421
1451 compile_command="$compile_command $arg"
1452 finalize_command="$finalize_command $arg"
1453 prev=
1454 continue
1455 ;;
1456 *)
1457 eval "$prev=\"\$arg\""
1458 prev=

--- 47 unchanged lines hidden (view full) ---

1506 if test "X$arg" = "X-export-symbols"; then
1507 prev=expsyms
1508 else
1509 prev=expsyms_regex
1510 fi
1511 continue
1512 ;;
1513
1422 -framework|-arch)
1423 prev=darwin_framework
1424 compiler_flags="$compiler_flags $arg"
1514 -framework|-arch|-isysroot)
1515 case " $CC " in
1516 *" ${arg} ${1} "* | *" ${arg} ${1} "*)
1517 prev=darwin_framework_skip ;;
1518 *) compiler_flags="$compiler_flags $arg"
1519 prev=darwin_framework ;;
1520 esac
1425 compile_command="$compile_command $arg"
1426 finalize_command="$finalize_command $arg"
1521 compile_command="$compile_command $arg"
1522 finalize_command="$finalize_command $arg"
1427 continue
1428 ;;
1523 continue
1524 ;;
1429
1430 -inst-prefix-dir)
1431 prev=inst_prefix
1432 continue
1433 ;;
1434
1435 # The native IRIX linker understands -LANG:*, -LIST:* and -LNO:*
1436 # so, if we see these flags be careful not to treat them like -L

--- 11 unchanged lines hidden (view full) ---

1448 dir=`$echo "X$arg" | $Xsed -e 's/^-L//'`
1449 # We need an absolute path.
1450 case $dir in
1451 [\\/]* | [A-Za-z]:[\\/]*) ;;
1452 *)
1453 absdir=`cd "$dir" && pwd`
1454 if test -z "$absdir"; then
1455 $echo "$modename: cannot determine absolute directory name of \`$dir'" 1>&2
1525
1526 -inst-prefix-dir)
1527 prev=inst_prefix
1528 continue
1529 ;;
1530
1531 # The native IRIX linker understands -LANG:*, -LIST:* and -LNO:*
1532 # so, if we see these flags be careful not to treat them like -L

--- 11 unchanged lines hidden (view full) ---

1544 dir=`$echo "X$arg" | $Xsed -e 's/^-L//'`
1545 # We need an absolute path.
1546 case $dir in
1547 [\\/]* | [A-Za-z]:[\\/]*) ;;
1548 *)
1549 absdir=`cd "$dir" && pwd`
1550 if test -z "$absdir"; then
1551 $echo "$modename: cannot determine absolute directory name of \`$dir'" 1>&2
1456 exit $EXIT_FAILURE
1552 absdir="$dir"
1553 notinst_path="$notinst_path $dir"
1457 fi
1458 dir="$absdir"
1459 ;;
1460 esac
1461 case "$deplibs " in
1462 *" -L$dir "*) ;;
1463 *)
1464 deplibs="$deplibs -L$dir"
1465 lib_search_path="$lib_search_path $dir"
1466 ;;
1467 esac
1468 case $host in
1469 *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2*)
1554 fi
1555 dir="$absdir"
1556 ;;
1557 esac
1558 case "$deplibs " in
1559 *" -L$dir "*) ;;
1560 *)
1561 deplibs="$deplibs -L$dir"
1562 lib_search_path="$lib_search_path $dir"
1563 ;;
1564 esac
1565 case $host in
1566 *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2*)
1567 testbindir=`$echo "X$dir" | $Xsed -e 's*/lib$*/bin*'`
1470 case :$dllsearchpath: in
1471 *":$dir:"*) ;;
1472 *) dllsearchpath="$dllsearchpath:$dir";;
1473 esac
1568 case :$dllsearchpath: in
1569 *":$dir:"*) ;;
1570 *) dllsearchpath="$dllsearchpath:$dir";;
1571 esac
1572 case :$dllsearchpath: in
1573 *":$testbindir:"*) ;;
1574 *) dllsearchpath="$dllsearchpath:$testbindir";;
1575 esac
1474 ;;
1475 esac
1476 continue
1477 ;;
1478
1479 -l*)
1480 if test "X$arg" = "X-lc" || test "X$arg" = "X-lm"; then
1481 case $host in
1576 ;;
1577 esac
1578 continue
1579 ;;
1580
1581 -l*)
1582 if test "X$arg" = "X-lc" || test "X$arg" = "X-lm"; then
1583 case $host in
1482 *-*-cygwin* | *-*-pw32* | *-*-beos*)
1584 *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-beos*)
1483 # These systems don't actually have a C or math library (as such)
1484 continue
1485 ;;
1585 # These systems don't actually have a C or math library (as such)
1586 continue
1587 ;;
1486 *-*-mingw* | *-*-os2*)
1588 *-*-os2*)
1487 # These systems don't actually have a C library (as such)
1488 test "X$arg" = "X-lc" && continue
1489 ;;
1490 *-*-openbsd* | *-*-freebsd* | *-*-dragonfly*)
1491 # Do not include libc due to us having libc/libc_r.
1492 test "X$arg" = "X-lc" && continue
1493 ;;
1494 *-*-rhapsody* | *-*-darwin1.[012])
1495 # Rhapsody C and math libraries are in the System framework
1496 deplibs="$deplibs -framework System"
1497 continue
1589 # These systems don't actually have a C library (as such)
1590 test "X$arg" = "X-lc" && continue
1591 ;;
1592 *-*-openbsd* | *-*-freebsd* | *-*-dragonfly*)
1593 # Do not include libc due to us having libc/libc_r.
1594 test "X$arg" = "X-lc" && continue
1595 ;;
1596 *-*-rhapsody* | *-*-darwin1.[012])
1597 # Rhapsody C and math libraries are in the System framework
1598 deplibs="$deplibs -framework System"
1599 continue
1600 ;;
1601 *-*-sco3.2v5* | *-*-sco5v6*)
1602 # Causes problems with __ctype
1603 test "X$arg" = "X-lc" && continue
1604 ;;
1605 *-*-sysv4.2uw2* | *-*-sysv5* | *-*-unixware* | *-*-OpenUNIX*)
1606 # Compiler inserts libc in the correct place for threads to work
1607 test "X$arg" = "X-lc" && continue
1608 ;;
1498 esac
1499 elif test "X$arg" = "X-lc_r"; then
1500 case $host in
1501 *-*-openbsd* | *-*-freebsd* | *-*-dragonfly*)
1502 # Do not include libc_r directly, use -pthread flag.
1503 continue
1504 ;;
1505 esac

--- 11 unchanged lines hidden (view full) ---

1517 prev=xcompiler
1518 continue
1519 ;;
1520
1521 -mt|-mthreads|-kthread|-Kthread|-pthread|-pthreads|--thread-safe)
1522 compiler_flags="$compiler_flags $arg"
1523 compile_command="$compile_command $arg"
1524 finalize_command="$finalize_command $arg"
1609 esac
1610 elif test "X$arg" = "X-lc_r"; then
1611 case $host in
1612 *-*-openbsd* | *-*-freebsd* | *-*-dragonfly*)
1613 # Do not include libc_r directly, use -pthread flag.
1614 continue
1615 ;;
1616 esac

--- 11 unchanged lines hidden (view full) ---

1628 prev=xcompiler
1629 continue
1630 ;;
1631
1632 -mt|-mthreads|-kthread|-Kthread|-pthread|-pthreads|--thread-safe)
1633 compiler_flags="$compiler_flags $arg"
1634 compile_command="$compile_command $arg"
1635 finalize_command="$finalize_command $arg"
1636 deplibs="$deplibs $arg"
1525 continue
1526 ;;
1527
1528 -module)
1529 module=yes
1530 continue
1531 ;;
1532
1533 # -64, -mips[0-9] enable 64-bit mode on the SGI compiler
1534 # -r[0-9][0-9]* specifies the processor on the SGI compiler
1535 # -xarch=*, -xtarget=* enable 64-bit mode on the Sun compiler
1536 # +DA*, +DD* enable 64-bit mode on the HP compiler
1537 # -q* pass through compiler args for the IBM compiler
1538 # -m* pass through architecture-specific compiler args for GCC
1637 continue
1638 ;;
1639
1640 -module)
1641 module=yes
1642 continue
1643 ;;
1644
1645 # -64, -mips[0-9] enable 64-bit mode on the SGI compiler
1646 # -r[0-9][0-9]* specifies the processor on the SGI compiler
1647 # -xarch=*, -xtarget=* enable 64-bit mode on the Sun compiler
1648 # +DA*, +DD* enable 64-bit mode on the HP compiler
1649 # -q* pass through compiler args for the IBM compiler
1650 # -m* pass through architecture-specific compiler args for GCC
1539 -64|-mips[0-9]|-r[0-9][0-9]*|-xarch=*|-xtarget=*|+DA*|+DD*|-q*|-m*)
1651 # -m*, -t[45]*, -txscale* pass through architecture-specific
1652 # compiler args for GCC
1653 # -pg pass through profiling flag for GCC
1654 # @file GCC response files
1655 -64|-mips[0-9]|-r[0-9][0-9]*|-xarch=*|-xtarget=*|+DA*|+DD*|-q*|-m*|-pg| \
1656 -t[45]*|-txscale*|@*)
1540
1541 # Unknown arguments in both finalize_command and compile_command need
1542 # to be aesthetically quoted because they are evaled later.
1543 arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`
1544 case $arg in
1545 *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
1546 arg="\"$arg\""
1547 ;;
1548 esac
1549 compile_command="$compile_command $arg"
1550 finalize_command="$finalize_command $arg"
1657
1658 # Unknown arguments in both finalize_command and compile_command need
1659 # to be aesthetically quoted because they are evaled later.
1660 arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`
1661 case $arg in
1662 *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
1663 arg="\"$arg\""
1664 ;;
1665 esac
1666 compile_command="$compile_command $arg"
1667 finalize_command="$finalize_command $arg"
1551 if test "$with_gcc" = "yes" ; then
1552 compiler_flags="$compiler_flags $arg"
1553 fi
1668 compiler_flags="$compiler_flags $arg"
1554 continue
1555 ;;
1556
1557 -shrext)
1558 prev=shrext
1559 continue
1560 ;;
1561

--- 221 unchanged lines hidden (view full) ---

1783 # Prepend the subdirectory the object is found in.
1784 non_pic_object="$xdir$non_pic_object"
1785
1786 # A standard non-PIC object
1787 non_pic_objects="$non_pic_objects $non_pic_object"
1788 if test -z "$pic_object" || test "$pic_object" = none ; then
1789 arg="$non_pic_object"
1790 fi
1669 continue
1670 ;;
1671
1672 -shrext)
1673 prev=shrext
1674 continue
1675 ;;
1676

--- 221 unchanged lines hidden (view full) ---

1898 # Prepend the subdirectory the object is found in.
1899 non_pic_object="$xdir$non_pic_object"
1900
1901 # A standard non-PIC object
1902 non_pic_objects="$non_pic_objects $non_pic_object"
1903 if test -z "$pic_object" || test "$pic_object" = none ; then
1904 arg="$non_pic_object"
1905 fi
1906 else
1907 # If the PIC object exists, use it instead.
1908 # $xdir was prepended to $pic_object above.
1909 non_pic_object="$pic_object"
1910 non_pic_objects="$non_pic_objects $non_pic_object"
1791 fi
1792 else
1793 # Only an error if not doing a dry-run.
1794 if test -z "$run"; then
1795 $echo "$modename: \`$arg' is not a valid libtool object" 1>&2
1796 exit $EXIT_FAILURE
1797 else
1798 # Dry-run case.

--- 89 unchanged lines hidden (view full) ---

1888 output_objdir="$objdir"
1889 else
1890 output_objdir="$output_objdir/$objdir"
1891 fi
1892 # Create the object directory.
1893 if test ! -d "$output_objdir"; then
1894 $show "$mkdir $output_objdir"
1895 $run $mkdir $output_objdir
1911 fi
1912 else
1913 # Only an error if not doing a dry-run.
1914 if test -z "$run"; then
1915 $echo "$modename: \`$arg' is not a valid libtool object" 1>&2
1916 exit $EXIT_FAILURE
1917 else
1918 # Dry-run case.

--- 89 unchanged lines hidden (view full) ---

2008 output_objdir="$objdir"
2009 else
2010 output_objdir="$output_objdir/$objdir"
2011 fi
2012 # Create the object directory.
2013 if test ! -d "$output_objdir"; then
2014 $show "$mkdir $output_objdir"
2015 $run $mkdir $output_objdir
1896 status=$?
1897 if test "$status" -ne 0 && test ! -d "$output_objdir"; then
1898 exit $status
2016 exit_status=$?
2017 if test "$exit_status" -ne 0 && test ! -d "$output_objdir"; then
2018 exit $exit_status
1899 fi
1900 fi
1901
1902 # Determine the type of output
1903 case $output in
1904 "")
1905 $echo "$modename: you must specify an output file" 1>&2
1906 $echo "$help" 1>&2

--- 46 unchanged lines hidden (view full) ---

1953 pre_post_deps=
1954 fi
1955
1956 deplibs=
1957 newdependency_libs=
1958 newlib_search_path=
1959 need_relink=no # whether we're linking any uninstalled libtool libraries
1960 notinst_deplibs= # not-installed libtool libraries
2019 fi
2020 fi
2021
2022 # Determine the type of output
2023 case $output in
2024 "")
2025 $echo "$modename: you must specify an output file" 1>&2
2026 $echo "$help" 1>&2

--- 46 unchanged lines hidden (view full) ---

2073 pre_post_deps=
2074 fi
2075
2076 deplibs=
2077 newdependency_libs=
2078 newlib_search_path=
2079 need_relink=no # whether we're linking any uninstalled libtool libraries
2080 notinst_deplibs= # not-installed libtool libraries
1961 notinst_path= # paths that contain not-installed libtool libraries
1962 case $linkmode in
1963 lib)
1964 passes="conv link"
1965 for file in $dlfiles $dlprefiles; do
1966 case $file in
1967 *.la) ;;
1968 *)
1969 $echo "$modename: libraries can \`-dlopen' only libtool libraries: $file" 1>&2

--- 37 unchanged lines hidden (view full) ---

2007 case $deplib in
2008 -mt|-mthreads|-kthread|-Kthread|-pthread|-pthreads|--thread-safe)
2009 if test "$linkmode,$pass" = "prog,link"; then
2010 compile_deplibs="$deplib $compile_deplibs"
2011 finalize_deplibs="$deplib $finalize_deplibs"
2012 else
2013 compiler_flags="$compiler_flags $deplib"
2014 fi
2081 case $linkmode in
2082 lib)
2083 passes="conv link"
2084 for file in $dlfiles $dlprefiles; do
2085 case $file in
2086 *.la) ;;
2087 *)
2088 $echo "$modename: libraries can \`-dlopen' only libtool libraries: $file" 1>&2

--- 37 unchanged lines hidden (view full) ---

2126 case $deplib in
2127 -mt|-mthreads|-kthread|-Kthread|-pthread|-pthreads|--thread-safe)
2128 if test "$linkmode,$pass" = "prog,link"; then
2129 compile_deplibs="$deplib $compile_deplibs"
2130 finalize_deplibs="$deplib $finalize_deplibs"
2131 else
2132 compiler_flags="$compiler_flags $deplib"
2133 fi
2134
2135 case $linkmode in
2136 lib)
2137 deplibs="$deplib $deplibs"
2138 test "$pass" = conv && continue
2139 newdependency_libs="$deplib $newdependency_libs"
2140 ;;
2141 prog)
2142 if test "$pass" = conv; then
2143 deplibs="$deplib $deplibs"
2144 continue
2145 fi
2146 if test "$pass" = scan; then
2147 deplibs="$deplib $deplibs"
2148 else
2149 compile_deplibs="$deplib $compile_deplibs"
2150 finalize_deplibs="$deplib $finalize_deplibs"
2151 fi
2152 ;;
2153 *)
2154 ;;
2155 esac # linkmode
2156
2015 continue
2016 ;;
2017 -l*)
2018 if test "$linkmode" != lib && test "$linkmode" != prog; then
2019 $echo "$modename: warning: \`-l' is ignored for archives/objects" 1>&2
2020 continue
2021 fi
2022 name=`$echo "X$deplib" | $Xsed -e 's/^-l//'`

--- 166 unchanged lines hidden (view full) ---

2189 ;;
2190 %DEPLIBS%)
2191 alldeplibs=yes
2192 continue
2193 ;;
2194 esac # case $deplib
2195 if test "$found" = yes || test -f "$lib"; then :
2196 else
2157 continue
2158 ;;
2159 -l*)
2160 if test "$linkmode" != lib && test "$linkmode" != prog; then
2161 $echo "$modename: warning: \`-l' is ignored for archives/objects" 1>&2
2162 continue
2163 fi
2164 name=`$echo "X$deplib" | $Xsed -e 's/^-l//'`

--- 166 unchanged lines hidden (view full) ---

2331 ;;
2332 %DEPLIBS%)
2333 alldeplibs=yes
2334 continue
2335 ;;
2336 esac # case $deplib
2337 if test "$found" = yes || test -f "$lib"; then :
2338 else
2197 $echo "$modename: cannot find the library \`$lib'" 1>&2
2339 $echo "$modename: cannot find the library \`$lib' or unhandled argument \`$deplib'" 1>&2
2198 exit $EXIT_FAILURE
2199 fi
2200
2201 # Check to see that this really is a libtool archive.
2202 if (${SED} -e '2q' $lib | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then :
2203 else
2204 $echo "$modename: \`$lib' is not a valid libtool archive" 1>&2
2205 exit $EXIT_FAILURE

--- 234 unchanged lines hidden (view full) ---

2440 { test "$build_libtool_libs" = yes &&
2441 test -n "$library_names"; }; }; then
2442 # We only need to search for static libraries
2443 continue
2444 fi
2445 fi
2446
2447 link_static=no # Whether the deplib will be linked statically
2340 exit $EXIT_FAILURE
2341 fi
2342
2343 # Check to see that this really is a libtool archive.
2344 if (${SED} -e '2q' $lib | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then :
2345 else
2346 $echo "$modename: \`$lib' is not a valid libtool archive" 1>&2
2347 exit $EXIT_FAILURE

--- 234 unchanged lines hidden (view full) ---

2582 { test "$build_libtool_libs" = yes &&
2583 test -n "$library_names"; }; }; then
2584 # We only need to search for static libraries
2585 continue
2586 fi
2587 fi
2588
2589 link_static=no # Whether the deplib will be linked statically
2590 use_static_libs=$prefer_static_libs
2591 if test "$use_static_libs" = built && test "$installed" = yes ; then
2592 use_static_libs=no
2593 fi
2448 if test -n "$library_names" &&
2594 if test -n "$library_names" &&
2449 { test "$prefer_static_libs" = no || test -z "$old_library"; }; then
2595 { test "$use_static_libs" = no || test -z "$old_library"; }; then
2450 if test "$installed" = no; then
2451 notinst_deplibs="$notinst_deplibs $lib"
2452 need_relink=yes
2453 fi
2454 # This is a shared library
2455
2456 # Warn about portability, can't link against -module's on
2457 # some systems (darwin)

--- 96 unchanged lines hidden (view full) ---

2554 add_dir=
2555 add=
2556 lib_linked=yes
2557 case $hardcode_action in
2558 immediate | unsupported)
2559 if test "$hardcode_direct" = no; then
2560 add="$dir/$linklib"
2561 case $host in
2596 if test "$installed" = no; then
2597 notinst_deplibs="$notinst_deplibs $lib"
2598 need_relink=yes
2599 fi
2600 # This is a shared library
2601
2602 # Warn about portability, can't link against -module's on
2603 # some systems (darwin)

--- 96 unchanged lines hidden (view full) ---

2700 add_dir=
2701 add=
2702 lib_linked=yes
2703 case $hardcode_action in
2704 immediate | unsupported)
2705 if test "$hardcode_direct" = no; then
2706 add="$dir/$linklib"
2707 case $host in
2562 *-*-sco3.2v5* ) add_dir="-L$dir" ;;
2708 *-*-sco3.2v5.0.[024]*) add_dir="-L$dir" ;;
2709 *-*-sysv4*uw2*) add_dir="-L$dir" ;;
2710 *-*-sysv5OpenUNIX* | *-*-sysv5UnixWare7.[01].[10]* | \
2711 *-*-unixware7*) add_dir="-L$dir" ;;
2563 *-*-darwin* )
2564 # if the lib is a module then we can not link against
2565 # it, someone is ignoring the new warnings I added
2712 *-*-darwin* )
2713 # if the lib is a module then we can not link against
2714 # it, someone is ignoring the new warnings I added
2566 if /usr/bin/file -L $add 2> /dev/null | $EGREP "bundle" >/dev/null ; then
2715 if /usr/bin/file -L $add 2> /dev/null |
2716 $EGREP ": [^:]* bundle" >/dev/null ; then
2567 $echo "** Warning, lib $linklib is a module, not a shared library"
2568 if test -z "$old_library" ; then
2569 $echo
2570 $echo "** And there doesn't seem to be a static archive available"
2571 $echo "** The link will probably fail, sorry"
2572 else
2573 add="$dir/$old_library"
2574 fi

--- 734 unchanged lines hidden (view full) ---

3309 oldlibs="$oldlibs $output_objdir/$libname.$libext"
3310
3311 # Transform .lo files to .o files.
3312 oldobjs="$objs "`$echo "X$libobjs" | $SP2NL | $Xsed -e '/\.'${libext}'$/d' -e "$lo2o" | $NL2SP`
3313 fi
3314
3315 # Eliminate all temporary directories.
3316 for path in $notinst_path; do
2717 $echo "** Warning, lib $linklib is a module, not a shared library"
2718 if test -z "$old_library" ; then
2719 $echo
2720 $echo "** And there doesn't seem to be a static archive available"
2721 $echo "** The link will probably fail, sorry"
2722 else
2723 add="$dir/$old_library"
2724 fi

--- 734 unchanged lines hidden (view full) ---

3459 oldlibs="$oldlibs $output_objdir/$libname.$libext"
3460
3461 # Transform .lo files to .o files.
3462 oldobjs="$objs "`$echo "X$libobjs" | $SP2NL | $Xsed -e '/\.'${libext}'$/d' -e "$lo2o" | $NL2SP`
3463 fi
3464
3465 # Eliminate all temporary directories.
3466 for path in $notinst_path; do
3317 lib_search_path=`$echo "$lib_search_path " | ${SED} -e 's% $path % %g'`
3318 deplibs=`$echo "$deplibs " | ${SED} -e 's% -L$path % %g'`
3319 dependency_libs=`$echo "$dependency_libs " | ${SED} -e 's% -L$path % %g'`
3467 lib_search_path=`$echo "$lib_search_path " | ${SED} -e "s% $path % %g"`
3468 deplibs=`$echo "$deplibs " | ${SED} -e "s% -L$path % %g"`
3469 dependency_libs=`$echo "$dependency_libs " | ${SED} -e "s% -L$path % %g"`
3320 done
3321
3322 if test -n "$xrpath"; then
3323 # If the user specified any rpath flags, then add them.
3324 temp_xrpath=
3325 for libdir in $xrpath; do
3326 temp_xrpath="$temp_xrpath -R$libdir"
3327 case "$finalize_rpath " in

--- 36 unchanged lines hidden (view full) ---

3364 # Rhapsody C library is in the System framework
3365 deplibs="$deplibs -framework System"
3366 ;;
3367 *-*-netbsd*)
3368 # Don't link with libc until the a.out ld.so is fixed.
3369 ;;
3370 *-*-openbsd* | *-*-freebsd* | *-*-dragonfly*)
3371 # Do not include libc due to us having libc/libc_r.
3470 done
3471
3472 if test -n "$xrpath"; then
3473 # If the user specified any rpath flags, then add them.
3474 temp_xrpath=
3475 for libdir in $xrpath; do
3476 temp_xrpath="$temp_xrpath -R$libdir"
3477 case "$finalize_rpath " in

--- 36 unchanged lines hidden (view full) ---

3514 # Rhapsody C library is in the System framework
3515 deplibs="$deplibs -framework System"
3516 ;;
3517 *-*-netbsd*)
3518 # Don't link with libc until the a.out ld.so is fixed.
3519 ;;
3520 *-*-openbsd* | *-*-freebsd* | *-*-dragonfly*)
3521 # Do not include libc due to us having libc/libc_r.
3372 test "X$arg" = "X-lc" && continue
3373 ;;
3522 ;;
3523 *-*-sco3.2v5* | *-*-sco5v6*)
3524 # Causes problems with __ctype
3525 ;;
3526 *-*-sysv4.2uw2* | *-*-sysv5* | *-*-unixware* | *-*-OpenUNIX*)
3527 # Compiler inserts libc in the correct place for threads to work
3528 ;;
3374 *)
3375 # Add libc to deplibs on all other systems if necessary.
3376 if test "$build_libtool_need_lc" = "yes"; then
3377 deplibs="$deplibs -lc"
3378 fi
3379 ;;
3380 esac
3381 fi

--- 26 unchanged lines hidden (view full) ---

3408 # limits. Maybe even breaks it. We compile a program, linking it
3409 # against the deplibs as a proxy for the library. Then we can check
3410 # whether they linked in statically or dynamically with ldd.
3411 $rm conftest.c
3412 cat > conftest.c <<EOF
3413 int main() { return 0; }
3414EOF
3415 $rm conftest
3529 *)
3530 # Add libc to deplibs on all other systems if necessary.
3531 if test "$build_libtool_need_lc" = "yes"; then
3532 deplibs="$deplibs -lc"
3533 fi
3534 ;;
3535 esac
3536 fi

--- 26 unchanged lines hidden (view full) ---

3563 # limits. Maybe even breaks it. We compile a program, linking it
3564 # against the deplibs as a proxy for the library. Then we can check
3565 # whether they linked in statically or dynamically with ldd.
3566 $rm conftest.c
3567 cat > conftest.c <<EOF
3568 int main() { return 0; }
3569EOF
3570 $rm conftest
3416 $LTCC -o conftest conftest.c $deplibs
3571 $LTCC $LTCFLAGS -o conftest conftest.c $deplibs
3417 if test "$?" -eq 0 ; then
3418 ldd_output=`ldd conftest`
3419 for i in $deplibs; do
3420 name=`expr $i : '-l\(.*\)'`
3421 # If $name is empty we are operating on a -L argument.
3422 if test "$name" != "" && test "$name" -ne "0"; then
3423 if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
3424 case " $predeps $postdeps " in

--- 28 unchanged lines hidden (view full) ---

3453 else
3454 # Error occurred in the first compile. Let's try to salvage
3455 # the situation: Compile a separate program for each library.
3456 for i in $deplibs; do
3457 name=`expr $i : '-l\(.*\)'`
3458 # If $name is empty we are operating on a -L argument.
3459 if test "$name" != "" && test "$name" != "0"; then
3460 $rm conftest
3572 if test "$?" -eq 0 ; then
3573 ldd_output=`ldd conftest`
3574 for i in $deplibs; do
3575 name=`expr $i : '-l\(.*\)'`
3576 # If $name is empty we are operating on a -L argument.
3577 if test "$name" != "" && test "$name" -ne "0"; then
3578 if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
3579 case " $predeps $postdeps " in

--- 28 unchanged lines hidden (view full) ---

3608 else
3609 # Error occurred in the first compile. Let's try to salvage
3610 # the situation: Compile a separate program for each library.
3611 for i in $deplibs; do
3612 name=`expr $i : '-l\(.*\)'`
3613 # If $name is empty we are operating on a -L argument.
3614 if test "$name" != "" && test "$name" != "0"; then
3615 $rm conftest
3461 $LTCC -o conftest conftest.c $i
3616 $LTCC $LTCFLAGS -o conftest conftest.c $i
3462 # Did it work?
3463 if test "$?" -eq 0 ; then
3464 ldd_output=`ldd conftest`
3465 if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
3466 case " $predeps $postdeps " in
3467 *" $i "*)
3468 newdeplibs="$newdeplibs $i"
3469 i=""

--- 230 unchanged lines hidden (view full) ---

3700 fi
3701 fi
3702 fi
3703 fi
3704 # Done checking deplibs!
3705 deplibs=$newdeplibs
3706 fi
3707
3617 # Did it work?
3618 if test "$?" -eq 0 ; then
3619 ldd_output=`ldd conftest`
3620 if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
3621 case " $predeps $postdeps " in
3622 *" $i "*)
3623 newdeplibs="$newdeplibs $i"
3624 i=""

--- 230 unchanged lines hidden (view full) ---

3855 fi
3856 fi
3857 fi
3858 fi
3859 # Done checking deplibs!
3860 deplibs=$newdeplibs
3861 fi
3862
3863
3864 # move library search paths that coincide with paths to not yet
3865 # installed libraries to the beginning of the library search list
3866 new_libs=
3867 for path in $notinst_path; do
3868 case " $new_libs " in
3869 *" -L$path/$objdir "*) ;;
3870 *)
3871 case " $deplibs " in
3872 *" -L$path/$objdir "*)
3873 new_libs="$new_libs -L$path/$objdir" ;;
3874 esac
3875 ;;
3876 esac
3877 done
3878 for deplib in $deplibs; do
3879 case $deplib in
3880 -L*)
3881 case " $new_libs " in
3882 *" $deplib "*) ;;
3883 *) new_libs="$new_libs $deplib" ;;
3884 esac
3885 ;;
3886 *) new_libs="$new_libs $deplib" ;;
3887 esac
3888 done
3889 deplibs="$new_libs"
3890
3891
3708 # All the library-specific variables (install_libdir is set above).
3709 library_names=
3710 old_library=
3711 dlname=
3712
3713 # Test again, we may have decided not to build it any more
3714 if test "$build_libtool_libs" = yes; then
3715 if test "$hardcode_into_libs" = yes; then

--- 67 unchanged lines hidden (view full) ---

3783 else
3784 soname="$realname"
3785 fi
3786 if test -z "$dlname"; then
3787 dlname=$soname
3788 fi
3789
3790 lib="$output_objdir/$realname"
3892 # All the library-specific variables (install_libdir is set above).
3893 library_names=
3894 old_library=
3895 dlname=
3896
3897 # Test again, we may have decided not to build it any more
3898 if test "$build_libtool_libs" = yes; then
3899 if test "$hardcode_into_libs" = yes; then

--- 67 unchanged lines hidden (view full) ---

3967 else
3968 soname="$realname"
3969 fi
3970 if test -z "$dlname"; then
3971 dlname=$soname
3972 fi
3973
3974 lib="$output_objdir/$realname"
3975 linknames=
3791 for link
3792 do
3793 linknames="$linknames $link"
3794 done
3795
3796 # Use standard objects if they are pic
3797 test -z "$pic_flag" && libobjs=`$echo "X$libobjs" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP`
3798

--- 415 unchanged lines hidden (view full) ---

4214 # Don't allow lazy linking, it breaks C++ global constructors
4215 if test "$tagname" = CXX ; then
4216 compile_command="$compile_command ${wl}-bind_at_load"
4217 finalize_command="$finalize_command ${wl}-bind_at_load"
4218 fi
4219 ;;
4220 esac
4221
3976 for link
3977 do
3978 linknames="$linknames $link"
3979 done
3980
3981 # Use standard objects if they are pic
3982 test -z "$pic_flag" && libobjs=`$echo "X$libobjs" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP`
3983

--- 415 unchanged lines hidden (view full) ---

4399 # Don't allow lazy linking, it breaks C++ global constructors
4400 if test "$tagname" = CXX ; then
4401 compile_command="$compile_command ${wl}-bind_at_load"
4402 finalize_command="$finalize_command ${wl}-bind_at_load"
4403 fi
4404 ;;
4405 esac
4406
4407
4408 # move library search paths that coincide with paths to not yet
4409 # installed libraries to the beginning of the library search list
4410 new_libs=
4411 for path in $notinst_path; do
4412 case " $new_libs " in
4413 *" -L$path/$objdir "*) ;;
4414 *)
4415 case " $compile_deplibs " in
4416 *" -L$path/$objdir "*)
4417 new_libs="$new_libs -L$path/$objdir" ;;
4418 esac
4419 ;;
4420 esac
4421 done
4422 for deplib in $compile_deplibs; do
4423 case $deplib in
4424 -L*)
4425 case " $new_libs " in
4426 *" $deplib "*) ;;
4427 *) new_libs="$new_libs $deplib" ;;
4428 esac
4429 ;;
4430 *) new_libs="$new_libs $deplib" ;;
4431 esac
4432 done
4433 compile_deplibs="$new_libs"
4434
4435
4222 compile_command="$compile_command $compile_deplibs"
4223 finalize_command="$finalize_command $finalize_deplibs"
4224
4225 if test -n "$rpath$xrpath"; then
4226 # If the user specified any rpath flags, then add them.
4227 for libdir in $rpath $xrpath; do
4228 # This is the magic to use -rpath.
4229 case "$finalize_rpath " in

--- 28 unchanged lines hidden (view full) ---

4258 elif test -n "$runpath_var"; then
4259 case "$perm_rpath " in
4260 *" $libdir "*) ;;
4261 *) perm_rpath="$perm_rpath $libdir" ;;
4262 esac
4263 fi
4264 case $host in
4265 *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2*)
4436 compile_command="$compile_command $compile_deplibs"
4437 finalize_command="$finalize_command $finalize_deplibs"
4438
4439 if test -n "$rpath$xrpath"; then
4440 # If the user specified any rpath flags, then add them.
4441 for libdir in $rpath $xrpath; do
4442 # This is the magic to use -rpath.
4443 case "$finalize_rpath " in

--- 28 unchanged lines hidden (view full) ---

4472 elif test -n "$runpath_var"; then
4473 case "$perm_rpath " in
4474 *" $libdir "*) ;;
4475 *) perm_rpath="$perm_rpath $libdir" ;;
4476 esac
4477 fi
4478 case $host in
4479 *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2*)
4480 testbindir=`$echo "X$libdir" | $Xsed -e 's*/lib$*/bin*'`
4266 case :$dllsearchpath: in
4267 *":$libdir:"*) ;;
4268 *) dllsearchpath="$dllsearchpath:$libdir";;
4269 esac
4481 case :$dllsearchpath: in
4482 *":$libdir:"*) ;;
4483 *) dllsearchpath="$dllsearchpath:$libdir";;
4484 esac
4485 case :$dllsearchpath: in
4486 *":$testbindir:"*) ;;
4487 *) dllsearchpath="$dllsearchpath:$testbindir";;
4488 esac
4270 ;;
4271 esac
4272 done
4273 # Substitute the hardcoded libdirs into the rpath.
4274 if test -n "$hardcode_libdir_separator" &&
4275 test -n "$hardcode_libdirs"; then
4276 libdir="$hardcode_libdirs"
4277 eval rpath=\" $hardcode_libdir_flag_spec\"

--- 100 unchanged lines hidden (view full) ---

4378 $run eval '$mv "$nlist"T "$nlist"'
4379 fi
4380
4381 # Prepare the list of exported symbols
4382 if test -z "$export_symbols"; then
4383 export_symbols="$output_objdir/$outputname.exp"
4384 $run $rm $export_symbols
4385 $run eval "${SED} -n -e '/^: @PROGRAM@ $/d' -e 's/^.* \(.*\)$/\1/p' "'< "$nlist" > "$export_symbols"'
4489 ;;
4490 esac
4491 done
4492 # Substitute the hardcoded libdirs into the rpath.
4493 if test -n "$hardcode_libdir_separator" &&
4494 test -n "$hardcode_libdirs"; then
4495 libdir="$hardcode_libdirs"
4496 eval rpath=\" $hardcode_libdir_flag_spec\"

--- 100 unchanged lines hidden (view full) ---

4597 $run eval '$mv "$nlist"T "$nlist"'
4598 fi
4599
4600 # Prepare the list of exported symbols
4601 if test -z "$export_symbols"; then
4602 export_symbols="$output_objdir/$outputname.exp"
4603 $run $rm $export_symbols
4604 $run eval "${SED} -n -e '/^: @PROGRAM@ $/d' -e 's/^.* \(.*\)$/\1/p' "'< "$nlist" > "$export_symbols"'
4605 case $host in
4606 *cygwin* | *mingw* )
4607 $run eval "echo EXPORTS "'> "$output_objdir/$outputname.def"'
4608 $run eval 'cat "$export_symbols" >> "$output_objdir/$outputname.def"'
4609 ;;
4610 esac
4386 else
4611 else
4387 $run eval "${SED} -e 's/\([ ][.*^$]\)/\\\1/g' -e 's/^/ /' -e 's/$/$/'"' < "$export_symbols" > "$output_objdir/$outputname.exp"'
4612 $run eval "${SED} -e 's/\([].[*^$]\)/\\\\\1/g' -e 's/^/ /' -e 's/$/$/'"' < "$export_symbols" > "$output_objdir/$outputname.exp"'
4388 $run eval 'grep -f "$output_objdir/$outputname.exp" < "$nlist" > "$nlist"T'
4389 $run eval 'mv "$nlist"T "$nlist"'
4613 $run eval 'grep -f "$output_objdir/$outputname.exp" < "$nlist" > "$nlist"T'
4614 $run eval 'mv "$nlist"T "$nlist"'
4615 case $host in
4616 *cygwin* | *mingw* )
4617 $run eval "echo EXPORTS "'> "$output_objdir/$outputname.def"'
4618 $run eval 'cat "$nlist" >> "$output_objdir/$outputname.def"'
4619 ;;
4620 esac
4390 fi
4391 fi
4392
4393 for arg in $dlprefiles; do
4394 $show "extracting global C symbols from \`$arg'"
4395 name=`$echo "$arg" | ${SED} -e 's%^.*/%%'`
4396 $run eval '$echo ": $name " >> "$nlist"'
4397 $run eval "$NM $arg | $global_symbol_pipe >> '$nlist'"

--- 100 unchanged lines hidden (view full) ---

4498 *-*-hpux*)
4499 case "$compile_command " in
4500 *" -static "*) ;;
4501 *) pic_flag_for_symtable=" $pic_flag";;
4502 esac
4503 esac
4504
4505 # Now compile the dynamic symbol file.
4621 fi
4622 fi
4623
4624 for arg in $dlprefiles; do
4625 $show "extracting global C symbols from \`$arg'"
4626 name=`$echo "$arg" | ${SED} -e 's%^.*/%%'`
4627 $run eval '$echo ": $name " >> "$nlist"'
4628 $run eval "$NM $arg | $global_symbol_pipe >> '$nlist'"

--- 100 unchanged lines hidden (view full) ---

4729 *-*-hpux*)
4730 case "$compile_command " in
4731 *" -static "*) ;;
4732 *) pic_flag_for_symtable=" $pic_flag";;
4733 esac
4734 esac
4735
4736 # Now compile the dynamic symbol file.
4506 $show "(cd $output_objdir && $LTCC -c$no_builtin_flag$pic_flag_for_symtable \"$dlsyms\")"
4507 $run eval '(cd $output_objdir && $LTCC -c$no_builtin_flag$pic_flag_for_symtable "$dlsyms")' || exit $?
4737 $show "(cd $output_objdir && $LTCC $LTCFLAGS -c$no_builtin_flag$pic_flag_for_symtable \"$dlsyms\")"
4738 $run eval '(cd $output_objdir && $LTCC $LTCFLAGS -c$no_builtin_flag$pic_flag_for_symtable "$dlsyms")' || exit $?
4508
4509 # Clean up the generated files.
4510 $show "$rm $output_objdir/$dlsyms $nlist ${nlist}S ${nlist}T"
4511 $run $rm "$output_objdir/$dlsyms" "$nlist" "${nlist}S" "${nlist}T"
4512
4513 # Transform the symbol file into the correct name.
4739
4740 # Clean up the generated files.
4741 $show "$rm $output_objdir/$dlsyms $nlist ${nlist}S ${nlist}T"
4742 $run $rm "$output_objdir/$dlsyms" "$nlist" "${nlist}S" "${nlist}T"
4743
4744 # Transform the symbol file into the correct name.
4514 compile_command=`$echo "X$compile_command" | $Xsed -e "s%@SYMFILE@%$output_objdir/${outputname}S.${objext}%"`
4515 finalize_command=`$echo "X$finalize_command" | $Xsed -e "s%@SYMFILE@%$output_objdir/${outputname}S.${objext}%"`
4745 case $host in
4746 *cygwin* | *mingw* )
4747 if test -f "$output_objdir/${outputname}.def" ; then
4748 compile_command=`$echo "X$compile_command" | $Xsed -e "s%@SYMFILE@%$output_objdir/${outputname}.def $output_objdir/${outputname}S.${objext}%"`
4749 finalize_command=`$echo "X$finalize_command" | $Xsed -e "s%@SYMFILE@%$output_objdir/${outputname}.def $output_objdir/${outputname}S.${objext}%"`
4750 else
4751 compile_command=`$echo "X$compile_command" | $Xsed -e "s%@SYMFILE@%$output_objdir/${outputname}S.${objext}%"`
4752 finalize_command=`$echo "X$finalize_command" | $Xsed -e "s%@SYMFILE@%$output_objdir/${outputname}S.${objext}%"`
4753 fi
4754 ;;
4755 * )
4756 compile_command=`$echo "X$compile_command" | $Xsed -e "s%@SYMFILE@%$output_objdir/${outputname}S.${objext}%"`
4757 finalize_command=`$echo "X$finalize_command" | $Xsed -e "s%@SYMFILE@%$output_objdir/${outputname}S.${objext}%"`
4758 ;;
4759 esac
4516 ;;
4760 ;;
4761 *-*-freebsd*)
4762 # FreeBSD doesn't need this...
4763 ;;
4517 *)
4518 $echo "$modename: unknown suffix for \`$dlsyms'" 1>&2
4519 exit $EXIT_FAILURE
4520 ;;
4521 esac
4522 else
4523 # We keep going just in case the user didn't refer to
4524 # lt_preloaded_symbols. The linker will fail if global_symbol_pipe

--- 7 unchanged lines hidden (view full) ---

4532 if test "$need_relink" = no || test "$build_libtool_libs" != yes; then
4533 # Replace the output file specification.
4534 compile_command=`$echo "X$compile_command" | $Xsed -e 's%@OUTPUT@%'"$output"'%g'`
4535 link_command="$compile_command$compile_rpath"
4536
4537 # We have no uninstalled library dependencies, so finalize right now.
4538 $show "$link_command"
4539 $run eval "$link_command"
4764 *)
4765 $echo "$modename: unknown suffix for \`$dlsyms'" 1>&2
4766 exit $EXIT_FAILURE
4767 ;;
4768 esac
4769 else
4770 # We keep going just in case the user didn't refer to
4771 # lt_preloaded_symbols. The linker will fail if global_symbol_pipe

--- 7 unchanged lines hidden (view full) ---

4779 if test "$need_relink" = no || test "$build_libtool_libs" != yes; then
4780 # Replace the output file specification.
4781 compile_command=`$echo "X$compile_command" | $Xsed -e 's%@OUTPUT@%'"$output"'%g'`
4782 link_command="$compile_command$compile_rpath"
4783
4784 # We have no uninstalled library dependencies, so finalize right now.
4785 $show "$link_command"
4786 $run eval "$link_command"
4540 status=$?
4787 exit_status=$?
4541
4542 # Delete the generated files.
4543 if test -n "$dlsyms"; then
4544 $show "$rm $output_objdir/${outputname}S.${objext}"
4545 $run $rm "$output_objdir/${outputname}S.${objext}"
4546 fi
4547
4788
4789 # Delete the generated files.
4790 if test -n "$dlsyms"; then
4791 $show "$rm $output_objdir/${outputname}S.${objext}"
4792 $run $rm "$output_objdir/${outputname}S.${objext}"
4793 fi
4794
4548 exit $status
4795 exit $exit_status
4549 fi
4550
4551 if test -n "$shlibpath_var"; then
4552 # We should set the shlibpath_var
4553 rpath=
4554 for dir in $temp_rpath; do
4555 case $dir in
4556 [\\/]* | [A-Za-z]:[\\/]*)

--- 123 unchanged lines hidden (view full) ---

4680 case $host in
4681 *cygwin*)
4682 exeext=.exe
4683 outputname=`$echo $outputname|${SED} 's,.exe$,,'` ;;
4684 *) exeext= ;;
4685 esac
4686 case $host in
4687 *cygwin* | *mingw* )
4796 fi
4797
4798 if test -n "$shlibpath_var"; then
4799 # We should set the shlibpath_var
4800 rpath=
4801 for dir in $temp_rpath; do
4802 case $dir in
4803 [\\/]* | [A-Za-z]:[\\/]*)

--- 123 unchanged lines hidden (view full) ---

4927 case $host in
4928 *cygwin*)
4929 exeext=.exe
4930 outputname=`$echo $outputname|${SED} 's,.exe$,,'` ;;
4931 *) exeext= ;;
4932 esac
4933 case $host in
4934 *cygwin* | *mingw* )
4688 cwrappersource=`$echo ${objdir}/lt-${outputname}.c`
4689 cwrapper=`$echo ${output}.exe`
4690 $rm $cwrappersource $cwrapper
4691 trap "$rm $cwrappersource $cwrapper; exit $EXIT_FAILURE" 1 2 15
4935 output_name=`basename $output`
4936 output_path=`dirname $output`
4937 cwrappersource="$output_path/$objdir/lt-$output_name.c"
4938 cwrapper="$output_path/$output_name.exe"
4939 $rm $cwrappersource $cwrapper
4940 trap "$rm $cwrappersource $cwrapper; exit $EXIT_FAILURE" 1 2 15
4692
4693 cat > $cwrappersource <<EOF
4694
4695/* $cwrappersource - temporary wrapper executable for $objdir/$outputname
4696 Generated by $PROGRAM - GNU $PACKAGE $VERSION$TIMESTAMP
4697
4698 The $output program cannot be directly executed until all the libtool
4699 libraries that it depends on are installed.

--- 8 unchanged lines hidden (view full) ---

4708EOF
4709 cat >> $cwrappersource<<"EOF"
4710#include <stdio.h>
4711#include <stdlib.h>
4712#include <unistd.h>
4713#include <malloc.h>
4714#include <stdarg.h>
4715#include <assert.h>
4941
4942 cat > $cwrappersource <<EOF
4943
4944/* $cwrappersource - temporary wrapper executable for $objdir/$outputname
4945 Generated by $PROGRAM - GNU $PACKAGE $VERSION$TIMESTAMP
4946
4947 The $output program cannot be directly executed until all the libtool
4948 libraries that it depends on are installed.

--- 8 unchanged lines hidden (view full) ---

4957EOF
4958 cat >> $cwrappersource<<"EOF"
4959#include <stdio.h>
4960#include <stdlib.h>
4961#include <unistd.h>
4962#include <malloc.h>
4963#include <stdarg.h>
4964#include <assert.h>
4965#include <string.h>
4966#include <ctype.h>
4967#include <sys/stat.h>
4716
4717#if defined(PATH_MAX)
4718# define LT_PATHMAX PATH_MAX
4719#elif defined(MAXPATHLEN)
4720# define LT_PATHMAX MAXPATHLEN
4721#else
4722# define LT_PATHMAX 1024
4723#endif
4724
4725#ifndef DIR_SEPARATOR
4968
4969#if defined(PATH_MAX)
4970# define LT_PATHMAX PATH_MAX
4971#elif defined(MAXPATHLEN)
4972# define LT_PATHMAX MAXPATHLEN
4973#else
4974# define LT_PATHMAX 1024
4975#endif
4976
4977#ifndef DIR_SEPARATOR
4726#define DIR_SEPARATOR '/'
4978# define DIR_SEPARATOR '/'
4979# define PATH_SEPARATOR ':'
4727#endif
4728
4729#if defined (_WIN32) || defined (__MSDOS__) || defined (__DJGPP__) || \
4730 defined (__OS2__)
4980#endif
4981
4982#if defined (_WIN32) || defined (__MSDOS__) || defined (__DJGPP__) || \
4983 defined (__OS2__)
4731#define HAVE_DOS_BASED_FILE_SYSTEM
4732#ifndef DIR_SEPARATOR_2
4733#define DIR_SEPARATOR_2 '\\'
4984# define HAVE_DOS_BASED_FILE_SYSTEM
4985# ifndef DIR_SEPARATOR_2
4986# define DIR_SEPARATOR_2 '\\'
4987# endif
4988# ifndef PATH_SEPARATOR_2
4989# define PATH_SEPARATOR_2 ';'
4990# endif
4734#endif
4991#endif
4735#endif
4736
4737#ifndef DIR_SEPARATOR_2
4738# define IS_DIR_SEPARATOR(ch) ((ch) == DIR_SEPARATOR)
4739#else /* DIR_SEPARATOR_2 */
4740# define IS_DIR_SEPARATOR(ch) \
4741 (((ch) == DIR_SEPARATOR) || ((ch) == DIR_SEPARATOR_2))
4742#endif /* DIR_SEPARATOR_2 */
4743
4992
4993#ifndef DIR_SEPARATOR_2
4994# define IS_DIR_SEPARATOR(ch) ((ch) == DIR_SEPARATOR)
4995#else /* DIR_SEPARATOR_2 */
4996# define IS_DIR_SEPARATOR(ch) \
4997 (((ch) == DIR_SEPARATOR) || ((ch) == DIR_SEPARATOR_2))
4998#endif /* DIR_SEPARATOR_2 */
4999
5000#ifndef PATH_SEPARATOR_2
5001# define IS_PATH_SEPARATOR(ch) ((ch) == PATH_SEPARATOR)
5002#else /* PATH_SEPARATOR_2 */
5003# define IS_PATH_SEPARATOR(ch) ((ch) == PATH_SEPARATOR_2)
5004#endif /* PATH_SEPARATOR_2 */
5005
4744#define XMALLOC(type, num) ((type *) xmalloc ((num) * sizeof(type)))
4745#define XFREE(stale) do { \
4746 if (stale) { free ((void *) stale); stale = 0; } \
4747} while (0)
4748
5006#define XMALLOC(type, num) ((type *) xmalloc ((num) * sizeof(type)))
5007#define XFREE(stale) do { \
5008 if (stale) { free ((void *) stale); stale = 0; } \
5009} while (0)
5010
5011/* -DDEBUG is fairly common in CFLAGS. */
5012#undef DEBUG
5013#if defined DEBUGWRAPPER
5014# define DEBUG(format, ...) fprintf(stderr, format, __VA_ARGS__)
5015#else
5016# define DEBUG(format, ...)
5017#endif
5018
4749const char *program_name = NULL;
4750
4751void * xmalloc (size_t num);
4752char * xstrdup (const char *string);
5019const char *program_name = NULL;
5020
5021void * xmalloc (size_t num);
5022char * xstrdup (const char *string);
4753char * basename (const char *name);
4754char * fnqualify(const char *path);
5023const char * base_name (const char *name);
5024char * find_executable(const char *wrapper);
5025int check_executable(const char *path);
4755char * strendzap(char *str, const char *pat);
4756void lt_fatal (const char *message, ...);
4757
4758int
4759main (int argc, char *argv[])
4760{
4761 char **newargz;
4762 int i;
4763
5026char * strendzap(char *str, const char *pat);
5027void lt_fatal (const char *message, ...);
5028
5029int
5030main (int argc, char *argv[])
5031{
5032 char **newargz;
5033 int i;
5034
4764 program_name = (char *) xstrdup ((char *) basename (argv[0]));
5035 program_name = (char *) xstrdup (base_name (argv[0]));
5036 DEBUG("(main) argv[0] : %s\n",argv[0]);
5037 DEBUG("(main) program_name : %s\n",program_name);
4765 newargz = XMALLOC(char *, argc+2);
4766EOF
4767
5038 newargz = XMALLOC(char *, argc+2);
5039EOF
5040
4768 cat >> $cwrappersource <<EOF
4769 newargz[0] = "$SHELL";
5041 cat >> $cwrappersource <<EOF
5042 newargz[0] = (char *) xstrdup("$SHELL");
4770EOF
4771
5043EOF
5044
4772 cat >> $cwrappersource <<"EOF"
4773 newargz[1] = fnqualify(argv[0]);
5045 cat >> $cwrappersource <<"EOF"
5046 newargz[1] = find_executable(argv[0]);
5047 if (newargz[1] == NULL)
5048 lt_fatal("Couldn't find %s", argv[0]);
5049 DEBUG("(main) found exe at : %s\n",newargz[1]);
4774 /* we know the script has the same name, without the .exe */
4775 /* so make sure newargz[1] doesn't end in .exe */
4776 strendzap(newargz[1],".exe");
4777 for (i = 1; i < argc; i++)
4778 newargz[i+1] = xstrdup(argv[i]);
4779 newargz[argc+1] = NULL;
5050 /* we know the script has the same name, without the .exe */
5051 /* so make sure newargz[1] doesn't end in .exe */
5052 strendzap(newargz[1],".exe");
5053 for (i = 1; i < argc; i++)
5054 newargz[i+1] = xstrdup(argv[i]);
5055 newargz[argc+1] = NULL;
5056
5057 for (i=0; i<argc+1; i++)
5058 {
5059 DEBUG("(main) newargz[%d] : %s\n",i,newargz[i]);
5060 ;
5061 }
5062
4780EOF
4781
5063EOF
5064
4782 cat >> $cwrappersource <<EOF
5065 case $host_os in
5066 mingw*)
5067 cat >> $cwrappersource <<EOF
5068 execv("$SHELL",(char const **)newargz);
5069EOF
5070 ;;
5071 *)
5072 cat >> $cwrappersource <<EOF
4783 execv("$SHELL",newargz);
4784EOF
5073 execv("$SHELL",newargz);
5074EOF
5075 ;;
5076 esac
4785
5077
4786 cat >> $cwrappersource <<"EOF"
5078 cat >> $cwrappersource <<"EOF"
4787 return 127;
4788}
4789
4790void *
4791xmalloc (size_t num)
4792{
4793 void * p = (void *) malloc (num);
4794 if (!p)

--- 4 unchanged lines hidden (view full) ---

4799
4800char *
4801xstrdup (const char *string)
4802{
4803 return string ? strcpy ((char *) xmalloc (strlen (string) + 1), string) : NULL
4804;
4805}
4806
5079 return 127;
5080}
5081
5082void *
5083xmalloc (size_t num)
5084{
5085 void * p = (void *) malloc (num);
5086 if (!p)

--- 4 unchanged lines hidden (view full) ---

5091
5092char *
5093xstrdup (const char *string)
5094{
5095 return string ? strcpy ((char *) xmalloc (strlen (string) + 1), string) : NULL
5096;
5097}
5098
4807char *
4808basename (const char *name)
5099const char *
5100base_name (const char *name)
4809{
4810 const char *base;
4811
4812#if defined (HAVE_DOS_BASED_FILE_SYSTEM)
4813 /* Skip over the disk name in MSDOS pathnames. */
5101{
5102 const char *base;
5103
5104#if defined (HAVE_DOS_BASED_FILE_SYSTEM)
5105 /* Skip over the disk name in MSDOS pathnames. */
4814 if (isalpha (name[0]) && name[1] == ':')
5106 if (isalpha ((unsigned char)name[0]) && name[1] == ':')
4815 name += 2;
4816#endif
4817
4818 for (base = name; *name; name++)
4819 if (IS_DIR_SEPARATOR (*name))
4820 base = name + 1;
5107 name += 2;
5108#endif
5109
5110 for (base = name; *name; name++)
5111 if (IS_DIR_SEPARATOR (*name))
5112 base = name + 1;
4821 return (char *) base;
5113 return base;
4822}
4823
5114}
5115
5116int
5117check_executable(const char * path)
5118{
5119 struct stat st;
5120
5121 DEBUG("(check_executable) : %s\n", path ? (*path ? path : "EMPTY!") : "NULL!");
5122 if ((!path) || (!*path))
5123 return 0;
5124
5125 if ((stat (path, &st) >= 0) &&
5126 (
5127 /* MinGW & native WIN32 do not support S_IXOTH or S_IXGRP */
5128#if defined (S_IXOTH)
5129 ((st.st_mode & S_IXOTH) == S_IXOTH) ||
5130#endif
5131#if defined (S_IXGRP)
5132 ((st.st_mode & S_IXGRP) == S_IXGRP) ||
5133#endif
5134 ((st.st_mode & S_IXUSR) == S_IXUSR))
5135 )
5136 return 1;
5137 else
5138 return 0;
5139}
5140
5141/* Searches for the full path of the wrapper. Returns
5142 newly allocated full path name if found, NULL otherwise */
4824char *
5143char *
4825fnqualify(const char *path)
5144find_executable (const char* wrapper)
4826{
5145{
4827 size_t size;
4828 char *p;
5146 int has_slash = 0;
5147 const char* p;
5148 const char* p_next;
5149 /* static buffer for getcwd */
4829 char tmp[LT_PATHMAX + 1];
5150 char tmp[LT_PATHMAX + 1];
5151 int tmp_len;
5152 char* concat_name;
4830
5153
4831 assert(path != NULL);
5154 DEBUG("(find_executable) : %s\n", wrapper ? (*wrapper ? wrapper : "EMPTY!") : "NULL!");
4832
5155
4833 /* Is it qualified already? */
5156 if ((wrapper == NULL) || (*wrapper == '\0'))
5157 return NULL;
5158
5159 /* Absolute path? */
4834#if defined (HAVE_DOS_BASED_FILE_SYSTEM)
5160#if defined (HAVE_DOS_BASED_FILE_SYSTEM)
4835 if (isalpha (path[0]) && path[1] == ':')
4836 return xstrdup (path);
5161 if (isalpha ((unsigned char)wrapper[0]) && wrapper[1] == ':')
5162 {
5163 concat_name = xstrdup (wrapper);
5164 if (check_executable(concat_name))
5165 return concat_name;
5166 XFREE(concat_name);
5167 }
5168 else
5169 {
4837#endif
5170#endif
4838 if (IS_DIR_SEPARATOR (path[0]))
4839 return xstrdup (path);
5171 if (IS_DIR_SEPARATOR (wrapper[0]))
5172 {
5173 concat_name = xstrdup (wrapper);
5174 if (check_executable(concat_name))
5175 return concat_name;
5176 XFREE(concat_name);
5177 }
5178#if defined (HAVE_DOS_BASED_FILE_SYSTEM)
5179 }
5180#endif
4840
5181
4841 /* prepend the current directory */
4842 /* doesn't handle '~' */
5182 for (p = wrapper; *p; p++)
5183 if (*p == '/')
5184 {
5185 has_slash = 1;
5186 break;
5187 }
5188 if (!has_slash)
5189 {
5190 /* no slashes; search PATH */
5191 const char* path = getenv ("PATH");
5192 if (path != NULL)
5193 {
5194 for (p = path; *p; p = p_next)
5195 {
5196 const char* q;
5197 size_t p_len;
5198 for (q = p; *q; q++)
5199 if (IS_PATH_SEPARATOR(*q))
5200 break;
5201 p_len = q - p;
5202 p_next = (*q == '\0' ? q : q + 1);
5203 if (p_len == 0)
5204 {
5205 /* empty path: current directory */
5206 if (getcwd (tmp, LT_PATHMAX) == NULL)
5207 lt_fatal ("getcwd failed");
5208 tmp_len = strlen(tmp);
5209 concat_name = XMALLOC(char, tmp_len + 1 + strlen(wrapper) + 1);
5210 memcpy (concat_name, tmp, tmp_len);
5211 concat_name[tmp_len] = '/';
5212 strcpy (concat_name + tmp_len + 1, wrapper);
5213 }
5214 else
5215 {
5216 concat_name = XMALLOC(char, p_len + 1 + strlen(wrapper) + 1);
5217 memcpy (concat_name, p, p_len);
5218 concat_name[p_len] = '/';
5219 strcpy (concat_name + p_len + 1, wrapper);
5220 }
5221 if (check_executable(concat_name))
5222 return concat_name;
5223 XFREE(concat_name);
5224 }
5225 }
5226 /* not found in PATH; assume curdir */
5227 }
5228 /* Relative path | not found in path: prepend cwd */
4843 if (getcwd (tmp, LT_PATHMAX) == NULL)
4844 lt_fatal ("getcwd failed");
5229 if (getcwd (tmp, LT_PATHMAX) == NULL)
5230 lt_fatal ("getcwd failed");
4845 size = strlen(tmp) + 1 + strlen(path) + 1; /* +2 for '/' and '\0' */
4846 p = XMALLOC(char, size);
4847 sprintf(p, "%s%c%s", tmp, DIR_SEPARATOR, path);
4848 return p;
5231 tmp_len = strlen(tmp);
5232 concat_name = XMALLOC(char, tmp_len + 1 + strlen(wrapper) + 1);
5233 memcpy (concat_name, tmp, tmp_len);
5234 concat_name[tmp_len] = '/';
5235 strcpy (concat_name + tmp_len + 1, wrapper);
5236
5237 if (check_executable(concat_name))
5238 return concat_name;
5239 XFREE(concat_name);
5240 return NULL;
4849}
4850
4851char *
4852strendzap(char *str, const char *pat)
4853{
4854 size_t len, patlen;
4855
4856 assert(str != NULL);

--- 27 unchanged lines hidden (view full) ---

4884lt_fatal (const char *message, ...)
4885{
4886 va_list ap;
4887 va_start (ap, message);
4888 lt_error_core (EXIT_FAILURE, "FATAL", message, ap);
4889 va_end (ap);
4890}
4891EOF
5241}
5242
5243char *
5244strendzap(char *str, const char *pat)
5245{
5246 size_t len, patlen;
5247
5248 assert(str != NULL);

--- 27 unchanged lines hidden (view full) ---

5276lt_fatal (const char *message, ...)
5277{
5278 va_list ap;
5279 va_start (ap, message);
5280 lt_error_core (EXIT_FAILURE, "FATAL", message, ap);
5281 va_end (ap);
5282}
5283EOF
4892 # we should really use a build-platform specific compiler
4893 # here, but OTOH, the wrappers (shell script and this C one)
4894 # are only useful if you want to execute the "real" binary.
4895 # Since the "real" binary is built for $host, then this
4896 # wrapper might as well be built for $host, too.
4897 $run $LTCC -s -o $cwrapper $cwrappersource
4898 ;;
4899 esac
4900 $rm $output
4901 trap "$rm $output; exit $EXIT_FAILURE" 1 2 15
5284 # we should really use a build-platform specific compiler
5285 # here, but OTOH, the wrappers (shell script and this C one)
5286 # are only useful if you want to execute the "real" binary.
5287 # Since the "real" binary is built for $host, then this
5288 # wrapper might as well be built for $host, too.
5289 $run $LTCC $LTCFLAGS -s -o $cwrapper $cwrappersource
5290 ;;
5291 esac
5292 $rm $output
5293 trap "$rm $output; exit $EXIT_FAILURE" 1 2 15
4902
4903 $echo > $output "\
4904#! $SHELL
4905
4906# $output - temporary wrapper script for $objdir/$outputname
4907# Generated by $PROGRAM - GNU $PACKAGE $VERSION$TIMESTAMP
4908#
4909# The $output program cannot be directly executed until all the libtool

--- 213 unchanged lines hidden (view full) ---

5123 if test -z "$gentop"; then
5124 gentop="$output_objdir/${outputname}x"
5125 generated="$generated $gentop"
5126
5127 $show "${rm}r $gentop"
5128 $run ${rm}r "$gentop"
5129 $show "$mkdir $gentop"
5130 $run $mkdir "$gentop"
5294
5295 $echo > $output "\
5296#! $SHELL
5297
5298# $output - temporary wrapper script for $objdir/$outputname
5299# Generated by $PROGRAM - GNU $PACKAGE $VERSION$TIMESTAMP
5300#
5301# The $output program cannot be directly executed until all the libtool

--- 213 unchanged lines hidden (view full) ---

5515 if test -z "$gentop"; then
5516 gentop="$output_objdir/${outputname}x"
5517 generated="$generated $gentop"
5518
5519 $show "${rm}r $gentop"
5520 $run ${rm}r "$gentop"
5521 $show "$mkdir $gentop"
5522 $run $mkdir "$gentop"
5131 status=$?
5132 if test "$status" -ne 0 && test ! -d "$gentop"; then
5133 exit $status
5523 exit_status=$?
5524 if test "$exit_status" -ne 0 && test ! -d "$gentop"; then
5525 exit $exit_status
5134 fi
5135 fi
5136
5137 save_oldobjs=$oldobjs
5138 oldobjs=
5139 counter=1
5140 for obj in $save_oldobjs
5141 do

--- 650 unchanged lines hidden (view full) ---

5792 case $wrapper in
5793 */* | *\\*) . ${wrapper} ;;
5794 *) . ./${wrapper} ;;
5795 esac
5796
5797 outputname=
5798 if test "$fast_install" = no && test -n "$relink_command"; then
5799 if test "$finalize" = yes && test -z "$run"; then
5526 fi
5527 fi
5528
5529 save_oldobjs=$oldobjs
5530 oldobjs=
5531 counter=1
5532 for obj in $save_oldobjs
5533 do

--- 650 unchanged lines hidden (view full) ---

6184 case $wrapper in
6185 */* | *\\*) . ${wrapper} ;;
6186 *) . ./${wrapper} ;;
6187 esac
6188
6189 outputname=
6190 if test "$fast_install" = no && test -n "$relink_command"; then
6191 if test "$finalize" = yes && test -z "$run"; then
5800 tmpdir="/tmp"
5801 test -n "$TMPDIR" && tmpdir="$TMPDIR"
5802 tmpdir="$tmpdir/libtool-$$"
5803 save_umask=`umask`
5804 umask 0077
5805 if $mkdir "$tmpdir"; then
5806 umask $save_umask
5807 else
5808 umask $save_umask
5809 $echo "$modename: error: cannot create temporary directory \`$tmpdir'" 1>&2
5810 continue
5811 fi
6192 tmpdir=`func_mktempdir`
5812 file=`$echo "X$file$stripped_ext" | $Xsed -e 's%^.*/%%'`
5813 outputname="$tmpdir/$file"
5814 # Replace the output file specification.
5815 relink_command=`$echo "X$relink_command" | $Xsed -e 's%@OUTPUT@%'"$outputname"'%g'`
5816
5817 $show "$relink_command"
5818 if $run eval "$relink_command"; then :
5819 else

--- 107 unchanged lines hidden (view full) ---

5927 $cmds"
5928 fi
5929 done
5930 fi
5931
5932 # Exit here if they wanted silent mode.
5933 test "$show" = : && exit $EXIT_SUCCESS
5934
6193 file=`$echo "X$file$stripped_ext" | $Xsed -e 's%^.*/%%'`
6194 outputname="$tmpdir/$file"
6195 # Replace the output file specification.
6196 relink_command=`$echo "X$relink_command" | $Xsed -e 's%@OUTPUT@%'"$outputname"'%g'`
6197
6198 $show "$relink_command"
6199 if $run eval "$relink_command"; then :
6200 else

--- 107 unchanged lines hidden (view full) ---

6308 $cmds"
6309 fi
6310 done
6311 fi
6312
6313 # Exit here if they wanted silent mode.
6314 test "$show" = : && exit $EXIT_SUCCESS
6315
5935 $echo "----------------------------------------------------------------------"
6316 $echo "X----------------------------------------------------------------------" | $Xsed
5936 $echo "Libraries have been installed in:"
5937 for libdir in $libdirs; do
5938 $echo " $libdir"
5939 done
5940 $echo
5941 $echo "If you ever happen to want to link against installed libraries"
5942 $echo "in a given directory, LIBDIR, you must either use libtool, and"
5943 $echo "specify the full pathname of the library, or use the \`-LLIBDIR'"

--- 16 unchanged lines hidden (view full) ---

5960 $echo " - have your system administrator run these commands:$admincmds"
5961 fi
5962 if test -f /etc/ld.so.conf; then
5963 $echo " - have your system administrator add LIBDIR to \`/etc/ld.so.conf'"
5964 fi
5965 $echo
5966 $echo "See any operating system documentation about shared libraries for"
5967 $echo "more information, such as the ld(1) and ld.so(8) manual pages."
6317 $echo "Libraries have been installed in:"
6318 for libdir in $libdirs; do
6319 $echo " $libdir"
6320 done
6321 $echo
6322 $echo "If you ever happen to want to link against installed libraries"
6323 $echo "in a given directory, LIBDIR, you must either use libtool, and"
6324 $echo "specify the full pathname of the library, or use the \`-LLIBDIR'"

--- 16 unchanged lines hidden (view full) ---

6341 $echo " - have your system administrator run these commands:$admincmds"
6342 fi
6343 if test -f /etc/ld.so.conf; then
6344 $echo " - have your system administrator add LIBDIR to \`/etc/ld.so.conf'"
6345 fi
6346 $echo
6347 $echo "See any operating system documentation about shared libraries for"
6348 $echo "more information, such as the ld(1) and ld.so(8) manual pages."
5968 $echo "----------------------------------------------------------------------"
6349 $echo "X----------------------------------------------------------------------" | $Xsed
5969 exit $EXIT_SUCCESS
5970 ;;
5971
5972 # libtool execute mode
5973 execute)
5974 modename="$modename: execute"
5975
5976 # The first argument is the command name.

--- 200 unchanged lines hidden (view full) ---

6177 if (${SED} -e '2q' $file | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then
6178 . $dir/$name
6179
6180 # Delete the libtool libraries and symlinks.
6181 for n in $library_names; do
6182 rmfiles="$rmfiles $objdir/$n"
6183 done
6184 test -n "$old_library" && rmfiles="$rmfiles $objdir/$old_library"
6350 exit $EXIT_SUCCESS
6351 ;;
6352
6353 # libtool execute mode
6354 execute)
6355 modename="$modename: execute"
6356
6357 # The first argument is the command name.

--- 200 unchanged lines hidden (view full) ---

6558 if (${SED} -e '2q' $file | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then
6559 . $dir/$name
6560
6561 # Delete the libtool libraries and symlinks.
6562 for n in $library_names; do
6563 rmfiles="$rmfiles $objdir/$n"
6564 done
6565 test -n "$old_library" && rmfiles="$rmfiles $objdir/$old_library"
6185 test "$mode" = clean && rmfiles="$rmfiles $objdir/$name $objdir/${name}i"
6186
6566
6187 if test "$mode" = uninstall; then
6567 case "$mode" in
6568 clean)
6569 case " $library_names " in
6570 # " " in the beginning catches empty $dlname
6571 *" $dlname "*) ;;
6572 *) rmfiles="$rmfiles $objdir/$dlname" ;;
6573 esac
6574 test -n "$libdir" && rmfiles="$rmfiles $objdir/$name $objdir/${name}i"
6575 ;;
6576 uninstall)
6188 if test -n "$library_names"; then
6189 # Do each command in the postuninstall commands.
6190 cmds=$postuninstall_cmds
6191 save_ifs="$IFS"; IFS='~'
6192 for cmd in $cmds; do
6193 IFS="$save_ifs"
6194 eval cmd=\"$cmd\"
6195 $show "$cmd"

--- 16 unchanged lines hidden (view full) ---

6212 $run eval "$cmd"
6213 if test "$?" -ne 0 && test "$rmforce" != yes; then
6214 exit_status=1
6215 fi
6216 done
6217 IFS="$save_ifs"
6218 fi
6219 # FIXME: should reinstall the best remaining shared library.
6577 if test -n "$library_names"; then
6578 # Do each command in the postuninstall commands.
6579 cmds=$postuninstall_cmds
6580 save_ifs="$IFS"; IFS='~'
6581 for cmd in $cmds; do
6582 IFS="$save_ifs"
6583 eval cmd=\"$cmd\"
6584 $show "$cmd"

--- 16 unchanged lines hidden (view full) ---

6601 $run eval "$cmd"
6602 if test "$?" -ne 0 && test "$rmforce" != yes; then
6603 exit_status=1
6604 fi
6605 done
6606 IFS="$save_ifs"
6607 fi
6608 # FIXME: should reinstall the best remaining shared library.
6220 fi
6609 ;;
6610 esac
6221 fi
6222 ;;
6223
6224 *.lo)
6225 # Possibly a libtool object, so verify it.
6226 if (${SED} -e '2q' $file | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then
6227
6228 # Read the .lo file

--- 282 unchanged lines hidden (view full) ---

6511# the user asked for that or because the platform doesn't support
6512# them. This is particularly important on AIX, because we don't
6513# support having both static and shared libraries enabled at the same
6514# time on that platform, so we default to a shared-only configuration.
6515# If a disable-shared tag is given, we'll fallback to a static-only
6516# configuration. But we'll never go from static-only to shared-only.
6517
6518# ### BEGIN LIBTOOL TAG CONFIG: disable-shared
6611 fi
6612 ;;
6613
6614 *.lo)
6615 # Possibly a libtool object, so verify it.
6616 if (${SED} -e '2q' $file | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then
6617
6618 # Read the .lo file

--- 282 unchanged lines hidden (view full) ---

6901# the user asked for that or because the platform doesn't support
6902# them. This is particularly important on AIX, because we don't
6903# support having both static and shared libraries enabled at the same
6904# time on that platform, so we default to a shared-only configuration.
6905# If a disable-shared tag is given, we'll fallback to a static-only
6906# configuration. But we'll never go from static-only to shared-only.
6907
6908# ### BEGIN LIBTOOL TAG CONFIG: disable-shared
6519build_libtool_libs=no
6520build_old_libs=yes
6909disable_libs=shared
6521# ### END LIBTOOL TAG CONFIG: disable-shared
6522
6523# ### BEGIN LIBTOOL TAG CONFIG: disable-static
6910# ### END LIBTOOL TAG CONFIG: disable-shared
6911
6912# ### BEGIN LIBTOOL TAG CONFIG: disable-static
6524build_old_libs=`case $build_libtool_libs in yes) $echo no;; *) $echo yes;; esac`
6913disable_libs=static
6525# ### END LIBTOOL TAG CONFIG: disable-static
6526
6527# Local Variables:
6528# mode:shell-script
6529# sh-indentation:2
6530# End:
6914# ### END LIBTOOL TAG CONFIG: disable-static
6915
6916# Local Variables:
6917# mode:shell-script
6918# sh-indentation:2
6919# End: