added removeobject tags.
[swftools.git] / ltmain.sh
blob32384b6ed5508b5180671cd3701a5e4f39fe34f5
1 # ltmain.sh - Provide generalized library-building support services.
2 # NOTE: Changing this file will not affect anything until you rerun configure.
4 # Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001
5 # Free Software Foundation, Inc.
6 # Originally by Gordon Matzigkeit <gord@gnu.ai.mit.edu>, 1996
8 # This program is free software; you can redistribute it and/or modify
9 # it under the terms of the GNU General Public License as published by
10 # the Free Software Foundation; either version 2 of the License, or
11 # (at your option) any later version.
13 # This program is distributed in the hope that it will be useful, but
14 # WITHOUT ANY WARRANTY; without even the implied warranty of
15 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16 # General Public License for more details.
18 # You should have received a copy of the GNU General Public License
19 # along with this program; if not, write to the Free Software
20 # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
22 # As a special exception to the GNU General Public License, if you
23 # distribute this file as part of a program that contains a
24 # configuration script generated by Autoconf, you may include it under
25 # the same distribution terms that you use for the rest of that program.
27 # Check that we have a working $echo.
28 if test "X$1" = X--no-reexec; then
29 # Discard the --no-reexec flag, and continue.
30 shift
31 elif test "X$1" = X--fallback-echo; then
32 # Avoid inline document here, it may be left over
34 elif test "X`($echo '\t') 2>/dev/null`" = 'X\t'; then
35 # Yippee, $echo works!
37 else
38 # Restart under the correct shell, and then maybe $echo will work.
39 exec $SHELL "$0" --no-reexec ${1+"$@"}
42 if test "X$1" = X--fallback-echo; then
43 # used as fallback echo
44 shift
45 cat <<EOF
47 EOF
48 exit 0
51 # define SED for historic ltconfig's generated by Libtool 1.3
52 test -z "$SED" && SED=sed
54 # The name of this program.
55 progname=`$echo "$0" | ${SED} 's%^.*/%%'`
56 modename="$progname"
58 # Constants.
59 PROGRAM=ltmain.sh
60 PACKAGE=libtool
61 VERSION=1.4.3
62 TIMESTAMP=" (1.922.2.111 2002/10/23 02:54:36)"
64 default_mode=
65 help="Try \`$progname --help' for more information."
66 magic="%%%MAGIC variable%%%"
67 mkdir="mkdir"
68 mv="mv -f"
69 rm="rm -f"
71 # Sed substitution that helps us do robust quoting. It backslashifies
72 # metacharacters that are still active within double-quoted strings.
73 Xsed="${SED}"' -e 1s/^X//'
74 sed_quote_subst='s/\([\\`\\"$\\\\]\)/\\\1/g'
75 # test EBCDIC or ASCII
76 case `echo A|od -x` in
77 *[Cc]1*) # EBCDIC based system
78 SP2NL="tr '\100' '\n'"
79 NL2SP="tr '\r\n' '\100\100'"
80 ;;
81 *) # Assume ASCII based system
82 SP2NL="tr '\040' '\012'"
83 NL2SP="tr '\015\012' '\040\040'"
84 ;;
85 esac
87 # NLS nuisances.
88 # Only set LANG and LC_ALL to C if already set.
89 # These must not be set unconditionally because not all systems understand
90 # e.g. LANG=C (notably SCO).
91 # We save the old values to restore during execute mode.
92 if test "${LC_ALL+set}" = set; then
93 save_LC_ALL="$LC_ALL"; LC_ALL=C; export LC_ALL
95 if test "${LANG+set}" = set; then
96 save_LANG="$LANG"; LANG=C; export LANG
99 # Make sure IFS has a sensible default
100 : ${IFS=" "}
102 if test "$build_libtool_libs" != yes && test "$build_old_libs" != yes; then
103 echo "$modename: not configured to build any kind of library" 1>&2
104 echo "Fatal configuration error. See the $PACKAGE docs for more information." 1>&2
105 exit 1
108 # Global variables.
109 mode=$default_mode
110 nonopt=
111 prev=
112 prevopt=
113 run=
114 show="$echo"
115 show_help=
116 execute_dlfiles=
117 lo2o="s/\\.lo\$/.${objext}/"
118 o2lo="s/\\.${objext}\$/.lo/"
120 # Parse our command line options once, thoroughly.
121 while test $# -gt 0
123 arg="$1"
124 shift
126 case $arg in
127 -*=*) optarg=`$echo "X$arg" | $Xsed -e 's/[-_a-zA-Z0-9]*=//'` ;;
128 *) optarg= ;;
129 esac
131 # If the previous option needs an argument, assign it.
132 if test -n "$prev"; then
133 case $prev in
134 execute_dlfiles)
135 execute_dlfiles="$execute_dlfiles $arg"
138 eval "$prev=\$arg"
140 esac
142 prev=
143 prevopt=
144 continue
147 # Have we seen a non-optional argument yet?
148 case $arg in
149 --help)
150 show_help=yes
153 --version)
154 echo "$PROGRAM (GNU $PACKAGE) $VERSION$TIMESTAMP"
155 exit 0
158 --config)
159 ${SED} -e '1,/^# ### BEGIN LIBTOOL CONFIG/d' -e '/^# ### END LIBTOOL CONFIG/,$d' $0
160 exit 0
163 --debug)
164 echo "$progname: enabling shell trace mode"
165 set -x
168 --dry-run | -n)
169 run=:
172 --features)
173 echo "host: $host"
174 if test "$build_libtool_libs" = yes; then
175 echo "enable shared libraries"
176 else
177 echo "disable shared libraries"
179 if test "$build_old_libs" = yes; then
180 echo "enable static libraries"
181 else
182 echo "disable static libraries"
184 exit 0
187 --finish) mode="finish" ;;
189 --mode) prevopt="--mode" prev=mode ;;
190 --mode=*) mode="$optarg" ;;
192 --preserve-dup-deps) duplicate_deps="yes" ;;
194 --quiet | --silent)
195 show=:
198 -dlopen)
199 prevopt="-dlopen"
200 prev=execute_dlfiles
204 $echo "$modename: unrecognized option \`$arg'" 1>&2
205 $echo "$help" 1>&2
206 exit 1
210 nonopt="$arg"
211 break
213 esac
214 done
216 if test -n "$prevopt"; then
217 $echo "$modename: option \`$prevopt' requires an argument" 1>&2
218 $echo "$help" 1>&2
219 exit 1
222 # Mandrake: (gc) It's bad to link C++ code with GCC, so we need to use the compiler name if provided
223 if test "$mode" = link && test -n "$archive_cmds" && test -x "/usr/bin/perl"; then
224 case $nonopt in
225 *cc | *++ | gcc* | *-gcc* | egcs*)
226 archive_cmds=`echo $archive_cmds | perl -pe 's/^\S+\s+//'`
227 archive_cmds="$nonopt $archive_cmds"
228 archive_expsym_cmds=`echo $archive_expsym_cmds | perl -pe 's/^\S+\s+//'`
229 archive_expsym_cmds="$nonopt $archive_expsym_cmds"
230 esac
233 # If this variable is set in any of the actions, the command in it
234 # will be execed at the end. This prevents here-documents from being
235 # left over by shells.
236 exec_cmd=
238 if test -z "$show_help"; then
240 # Infer the operation mode.
241 if test -z "$mode"; then
242 case $nonopt in
243 *cc | *++ | gcc* | *-gcc* | xlc*)
244 mode=link
245 for arg
247 case $arg in
249 mode=compile
250 break
252 esac
253 done
255 *db | *dbx | *strace | *truss)
256 mode=execute
258 *install*|cp|mv)
259 mode=install
261 *rm)
262 mode=uninstall
265 # If we have no mode, but dlfiles were specified, then do execute mode.
266 test -n "$execute_dlfiles" && mode=execute
268 # Just use the default operation mode.
269 if test -z "$mode"; then
270 if test -n "$nonopt"; then
271 $echo "$modename: warning: cannot infer operation mode from \`$nonopt'" 1>&2
272 else
273 $echo "$modename: warning: cannot infer operation mode without MODE-ARGS" 1>&2
277 esac
280 # Only execute mode is allowed to have -dlopen flags.
281 if test -n "$execute_dlfiles" && test "$mode" != execute; then
282 $echo "$modename: unrecognized option \`-dlopen'" 1>&2
283 $echo "$help" 1>&2
284 exit 1
287 # Change the help message to a mode-specific one.
288 generic_help="$help"
289 help="Try \`$modename --help --mode=$mode' for more information."
291 # These modes are in order of execution frequency so that they run quickly.
292 case $mode in
293 # libtool compile mode
294 compile)
295 modename="$modename: compile"
296 # Get the compilation command and the source file.
297 base_compile=
298 prev=
299 lastarg=
300 srcfile="$nonopt"
301 suppress_output=
303 user_target=no
304 for arg
306 case $prev in
307 "") ;;
308 xcompiler)
309 # Aesthetically quote the previous argument.
310 prev=
311 lastarg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`
313 case $arg in
314 # Double-quote args containing other shell metacharacters.
315 # Many Bourne shells cannot handle close brackets correctly
316 # in scan sets, so we specify it separately.
317 *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
318 arg="\"$arg\""
320 esac
322 # Add the previous argument to base_compile.
323 if test -z "$base_compile"; then
324 base_compile="$lastarg"
325 else
326 base_compile="$base_compile $lastarg"
328 continue
330 esac
332 # Accept any command-line options.
333 case $arg in
335 if test "$user_target" != "no"; then
336 $echo "$modename: you cannot specify \`-o' more than once" 1>&2
337 exit 1
339 user_target=next
342 -static)
343 build_old_libs=yes
344 continue
347 -prefer-pic)
348 pic_mode=yes
349 continue
352 -prefer-non-pic)
353 pic_mode=no
354 continue
357 -Xcompiler)
358 prev=xcompiler
359 continue
362 -Wc,*)
363 args=`$echo "X$arg" | $Xsed -e "s/^-Wc,//"`
364 lastarg=
365 save_ifs="$IFS"; IFS=','
366 for arg in $args; do
367 IFS="$save_ifs"
369 # Double-quote args containing other shell metacharacters.
370 # Many Bourne shells cannot handle close brackets correctly
371 # in scan sets, so we specify it separately.
372 case $arg in
373 *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
374 arg="\"$arg\""
376 esac
377 lastarg="$lastarg $arg"
378 done
379 IFS="$save_ifs"
380 lastarg=`$echo "X$lastarg" | $Xsed -e "s/^ //"`
382 # Add the arguments to base_compile.
383 if test -z "$base_compile"; then
384 base_compile="$lastarg"
385 else
386 base_compile="$base_compile $lastarg"
388 continue
390 esac
392 case $user_target in
393 next)
394 # The next one is the -o target name
395 user_target=yes
396 continue
398 yes)
399 # We got the output file
400 user_target=set
401 libobj="$arg"
402 continue
404 esac
406 # Accept the current argument as the source file.
407 lastarg="$srcfile"
408 srcfile="$arg"
410 # Aesthetically quote the previous argument.
412 # Backslashify any backslashes, double quotes, and dollar signs.
413 # These are the only characters that are still specially
414 # interpreted inside of double-quoted scrings.
415 lastarg=`$echo "X$lastarg" | $Xsed -e "$sed_quote_subst"`
417 # Double-quote args containing other shell metacharacters.
418 # Many Bourne shells cannot handle close brackets correctly
419 # in scan sets, so we specify it separately.
420 case $lastarg in
421 *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
422 lastarg="\"$lastarg\""
424 esac
426 # Add the previous argument to base_compile.
427 if test -z "$base_compile"; then
428 base_compile="$lastarg"
429 else
430 base_compile="$base_compile $lastarg"
432 done
434 case $user_target in
435 set)
438 # Get the name of the library object.
439 libobj=`$echo "X$srcfile" | $Xsed -e 's%^.*/%%'`
442 $echo "$modename: you must specify a target with \`-o'" 1>&2
443 exit 1
445 esac
447 # Recognize several different file suffixes.
448 # If the user specifies -o file.o, it is replaced with file.lo
449 xform='[cCFSfmso]'
450 case $libobj in
451 *.ada) xform=ada ;;
452 *.adb) xform=adb ;;
453 *.ads) xform=ads ;;
454 *.asm) xform=asm ;;
455 *.c++) xform=c++ ;;
456 *.cc) xform=cc ;;
457 *.cpp) xform=cpp ;;
458 *.cxx) xform=cxx ;;
459 *.f90) xform=f90 ;;
460 *.for) xform=for ;;
461 esac
463 libobj=`$echo "X$libobj" | $Xsed -e "s/\.$xform$/.lo/"`
465 case $libobj in
466 *.lo) obj=`$echo "X$libobj" | $Xsed -e "$lo2o"` ;;
468 $echo "$modename: cannot determine name of library object from \`$libobj'" 1>&2
469 exit 1
471 esac
473 if test -z "$base_compile"; then
474 $echo "$modename: you must specify a compilation command" 1>&2
475 $echo "$help" 1>&2
476 exit 1
479 # Delete any leftover library objects.
480 if test "$build_old_libs" = yes; then
481 removelist="$obj $libobj"
482 else
483 removelist="$libobj"
486 $run $rm $removelist
487 trap "$run $rm $removelist; exit 1" 1 2 15
489 # On Cygwin there's no "real" PIC flag so we must build both object types
490 case $host_os in
491 cygwin* | mingw* | pw32* | os2*)
492 pic_mode=default
494 esac
495 if test "$pic_mode" = no && test "$deplibs_check_method" != pass_all; then
496 # non-PIC code in shared libraries is not supported
497 pic_mode=default
500 # Calculate the filename of the output object if compiler does
501 # not support -o with -c
502 if test "$compiler_c_o" = no; then
503 output_obj=`$echo "X$srcfile" | $Xsed -e 's%^.*/%%' -e 's%\.[^.]*$%%'`.${objext}
504 lockfile="$output_obj.lock"
505 removelist="$removelist $output_obj $lockfile"
506 trap "$run $rm $removelist; exit 1" 1 2 15
507 else
508 need_locks=no
509 lockfile=
512 # Lock this critical section if it is needed
513 # We use this script file to make the link, it avoids creating a new file
514 if test "$need_locks" = yes; then
515 until $run ln "$0" "$lockfile" 2>/dev/null; do
516 $show "Waiting for $lockfile to be removed"
517 sleep 2
518 done
519 elif test "$need_locks" = warn; then
520 if test -f "$lockfile"; then
521 echo "\
522 *** ERROR, $lockfile exists and contains:
523 `cat $lockfile 2>/dev/null`
525 This indicates that another process is trying to use the same
526 temporary object file, and libtool could not work around it because
527 your compiler does not support \`-c' and \`-o' together. If you
528 repeat this compilation, it may succeed, by chance, but you had better
529 avoid parallel builds (make -j) in this platform, or get a better
530 compiler."
532 $run $rm $removelist
533 exit 1
535 echo $srcfile > "$lockfile"
538 if test -n "$fix_srcfile_path"; then
539 eval srcfile=\"$fix_srcfile_path\"
542 # Only build a PIC object if we are building libtool libraries.
543 if test "$build_libtool_libs" = yes; then
544 # Without this assignment, base_compile gets emptied.
545 fbsd_hideous_sh_bug=$base_compile
547 if test "$pic_mode" != no; then
548 # All platforms use -DPIC, to notify preprocessed assembler code.
549 command="$base_compile $srcfile $pic_flag -DPIC"
550 else
551 # Don't build PIC code
552 command="$base_compile $srcfile"
554 if test "$build_old_libs" = yes; then
555 lo_libobj="$libobj"
556 dir=`$echo "X$libobj" | $Xsed -e 's%/[^/]*$%%'`
557 if test "X$dir" = "X$libobj"; then
558 dir="$objdir"
559 else
560 dir="$dir/$objdir"
562 libobj="$dir/"`$echo "X$libobj" | $Xsed -e 's%^.*/%%'`
564 if test -d "$dir"; then
565 $show "$rm $libobj"
566 $run $rm $libobj
567 else
568 $show "$mkdir $dir"
569 $run $mkdir $dir
570 status=$?
571 if test $status -ne 0 && test ! -d $dir; then
572 exit $status
576 if test "$compiler_o_lo" = yes; then
577 output_obj="$libobj"
578 command="$command -o $output_obj"
579 elif test "$compiler_c_o" = yes; then
580 output_obj="$obj"
581 command="$command -o $output_obj"
584 $run $rm "$output_obj"
585 $show "$command"
586 if $run eval "$command"; then :
587 else
588 test -n "$output_obj" && $run $rm $removelist
589 exit 1
592 if test "$need_locks" = warn &&
593 test x"`cat $lockfile 2>/dev/null`" != x"$srcfile"; then
594 echo "\
595 *** ERROR, $lockfile contains:
596 `cat $lockfile 2>/dev/null`
598 but it should contain:
599 $srcfile
601 This indicates that another process is trying to use the same
602 temporary object file, and libtool could not work around it because
603 your compiler does not support \`-c' and \`-o' together. If you
604 repeat this compilation, it may succeed, by chance, but you had better
605 avoid parallel builds (make -j) in this platform, or get a better
606 compiler."
608 $run $rm $removelist
609 exit 1
612 # Just move the object if needed, then go on to compile the next one
613 if test x"$output_obj" != x"$libobj"; then
614 $show "$mv $output_obj $libobj"
615 if $run $mv $output_obj $libobj; then :
616 else
617 error=$?
618 $run $rm $removelist
619 exit $error
623 # If we have no pic_flag, then copy the object into place and finish.
624 if (test -z "$pic_flag" || test "$pic_mode" != default) &&
625 test "$build_old_libs" = yes; then
626 # Rename the .lo from within objdir to obj
627 if test -f $obj; then
628 $show $rm $obj
629 $run $rm $obj
632 $show "$mv $libobj $obj"
633 if $run $mv $libobj $obj; then :
634 else
635 error=$?
636 $run $rm $removelist
637 exit $error
640 xdir=`$echo "X$obj" | $Xsed -e 's%/[^/]*$%%'`
641 if test "X$xdir" = "X$obj"; then
642 xdir="."
643 else
644 xdir="$xdir"
646 baseobj=`$echo "X$obj" | $Xsed -e "s%.*/%%"`
647 libobj=`$echo "X$baseobj" | $Xsed -e "$o2lo"`
648 # Now arrange that obj and lo_libobj become the same file
649 $show "(cd $xdir && $LN_S $baseobj $libobj)"
650 if $run eval '(cd $xdir && $LN_S $baseobj $libobj)'; then
651 # Unlock the critical section if it was locked
652 if test "$need_locks" != no; then
653 $run $rm "$lockfile"
655 exit 0
656 else
657 error=$?
658 $run $rm $removelist
659 exit $error
663 # Allow error messages only from the first compilation.
664 suppress_output=' >/dev/null 2>&1'
667 # Only build a position-dependent object if we build old libraries.
668 if test "$build_old_libs" = yes; then
669 if test "$pic_mode" != yes; then
670 # Don't build PIC code
671 command="$base_compile $srcfile"
672 else
673 # All platforms use -DPIC, to notify preprocessed assembler code.
674 command="$base_compile $srcfile $pic_flag -DPIC"
676 if test "$compiler_c_o" = yes; then
677 command="$command -o $obj"
678 output_obj="$obj"
681 # Suppress compiler output if we already did a PIC compilation.
682 command="$command$suppress_output"
683 $run $rm "$output_obj"
684 $show "$command"
685 if $run eval "$command"; then :
686 else
687 $run $rm $removelist
688 exit 1
691 if test "$need_locks" = warn &&
692 test x"`cat $lockfile 2>/dev/null`" != x"$srcfile"; then
693 echo "\
694 *** ERROR, $lockfile contains:
695 `cat $lockfile 2>/dev/null`
697 but it should contain:
698 $srcfile
700 This indicates that another process is trying to use the same
701 temporary object file, and libtool could not work around it because
702 your compiler does not support \`-c' and \`-o' together. If you
703 repeat this compilation, it may succeed, by chance, but you had better
704 avoid parallel builds (make -j) in this platform, or get a better
705 compiler."
707 $run $rm $removelist
708 exit 1
711 # Just move the object if needed
712 if test x"$output_obj" != x"$obj"; then
713 $show "$mv $output_obj $obj"
714 if $run $mv $output_obj $obj; then :
715 else
716 error=$?
717 $run $rm $removelist
718 exit $error
722 # Create an invalid libtool object if no PIC, so that we do not
723 # accidentally link it into a program.
724 if test "$build_libtool_libs" != yes; then
725 $show "echo timestamp > $libobj"
726 $run eval "echo timestamp > \$libobj" || exit $?
727 else
728 # Move the .lo from within objdir
729 $show "$mv $libobj $lo_libobj"
730 if $run $mv $libobj $lo_libobj; then :
731 else
732 error=$?
733 $run $rm $removelist
734 exit $error
739 # Unlock the critical section if it was locked
740 if test "$need_locks" != no; then
741 $run $rm "$lockfile"
744 exit 0
747 # libtool link mode
748 link | relink)
749 modename="$modename: link"
750 case $host in
751 *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2*)
752 # It is impossible to link a dll without this setting, and
753 # we shouldn't force the makefile maintainer to figure out
754 # which system we are compiling for in order to pass an extra
755 # flag for every libtool invokation.
756 # allow_undefined=no
758 # FIXME: Unfortunately, there are problems with the above when trying
759 # to make a dll which has undefined symbols, in which case not
760 # even a static library is built. For now, we need to specify
761 # -no-undefined on the libtool link line when we can be certain
762 # that all symbols are satisfied, otherwise we get a static library.
763 allow_undefined=yes
766 allow_undefined=yes
768 esac
769 libtool_args="$nonopt"
770 compile_command="$nonopt"
771 finalize_command="$nonopt"
773 compile_rpath=
774 finalize_rpath=
775 compile_shlibpath=
776 finalize_shlibpath=
777 convenience=
778 old_convenience=
779 deplibs=
780 old_deplibs=
781 compiler_flags=
782 linker_flags=
783 dllsearchpath=
784 lib_search_path=`pwd`
785 inst_prefix_dir=
787 avoid_version=no
788 dlfiles=
789 dlprefiles=
790 dlself=no
791 export_dynamic=no
792 export_symbols=
793 export_symbols_regex=
794 generated=
795 libobjs=
796 ltlibs=
797 module=no
798 no_install=no
799 objs=
800 prefer_static_libs=no
801 preload=no
802 prev=
803 prevarg=
804 release=
805 rpath=
806 xrpath=
807 perm_rpath=
808 temp_rpath=
809 thread_safe=no
810 vinfo=
812 # We need to know -static, to get the right output filenames.
813 for arg
815 case $arg in
816 -all-static | -static)
817 if test "X$arg" = "X-all-static"; then
818 if test "$build_libtool_libs" = yes && test -z "$link_static_flag"; then
819 $echo "$modename: warning: complete static linking is impossible in this configuration" 1>&2
821 if test -n "$link_static_flag"; then
822 dlopen_self=$dlopen_self_static
824 else
825 if test -z "$pic_flag" && test -n "$link_static_flag"; then
826 dlopen_self=$dlopen_self_static
829 build_libtool_libs=no
830 build_old_libs=yes
831 prefer_static_libs=yes
832 break
834 esac
835 done
837 # See if our shared archives depend on static archives.
838 test -n "$old_archive_from_new_cmds" && build_old_libs=yes
840 # Go through the arguments, transforming them on the way.
841 while test $# -gt 0; do
842 arg="$1"
843 shift
844 case $arg in
845 *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
846 qarg=\"`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`\" ### testsuite: skip nested quoting test
848 *) qarg=$arg ;;
849 esac
850 libtool_args="$libtool_args $qarg"
852 # If the previous option needs an argument, assign it.
853 if test -n "$prev"; then
854 case $prev in
855 output)
856 compile_command="$compile_command @OUTPUT@"
857 finalize_command="$finalize_command @OUTPUT@"
859 esac
861 case $prev in
862 dlfiles|dlprefiles)
863 if test "$preload" = no; then
864 # Add the symbol object into the linking commands.
865 compile_command="$compile_command @SYMFILE@"
866 finalize_command="$finalize_command @SYMFILE@"
867 preload=yes
869 case $arg in
870 *.la | *.lo) ;; # We handle these cases below.
871 force)
872 if test "$dlself" = no; then
873 dlself=needless
874 export_dynamic=yes
876 prev=
877 continue
879 self)
880 if test "$prev" = dlprefiles; then
881 dlself=yes
882 elif test "$prev" = dlfiles && test "$dlopen_self" != yes; then
883 dlself=yes
884 else
885 dlself=needless
886 export_dynamic=yes
888 prev=
889 continue
892 if test "$prev" = dlfiles; then
893 dlfiles="$dlfiles $arg"
894 else
895 dlprefiles="$dlprefiles $arg"
897 prev=
898 continue
900 esac
902 expsyms)
903 export_symbols="$arg"
904 if test ! -f "$arg"; then
905 $echo "$modename: symbol file \`$arg' does not exist"
906 exit 1
908 prev=
909 continue
911 expsyms_regex)
912 export_symbols_regex="$arg"
913 prev=
914 continue
916 inst_prefix)
917 inst_prefix_dir="$arg"
918 prev=
919 continue
921 release)
922 release="-$arg"
923 prev=
924 continue
926 rpath | xrpath)
927 # We need an absolute path.
928 case $arg in
929 [\\/]* | [A-Za-z]:[\\/]*) ;;
931 $echo "$modename: only absolute run-paths are allowed" 1>&2
932 exit 1
934 esac
935 if test "$prev" = rpath; then
936 case "$rpath " in
937 *" $arg "*) ;;
938 *) rpath="$rpath $arg" ;;
939 esac
940 else
941 case "$xrpath " in
942 *" $arg "*) ;;
943 *) xrpath="$xrpath $arg" ;;
944 esac
946 prev=
947 continue
949 xcompiler)
950 compiler_flags="$compiler_flags $qarg"
951 prev=
952 compile_command="$compile_command $qarg"
953 finalize_command="$finalize_command $qarg"
954 continue
956 xlinker)
957 linker_flags="$linker_flags $qarg"
958 compiler_flags="$compiler_flags $wl$qarg"
959 prev=
960 compile_command="$compile_command $wl$qarg"
961 finalize_command="$finalize_command $wl$qarg"
962 continue
965 eval "$prev=\"\$arg\""
966 prev=
967 continue
969 esac
970 fi # test -n $prev
972 prevarg="$arg"
974 case $arg in
975 -all-static)
976 if test -n "$link_static_flag"; then
977 compile_command="$compile_command $link_static_flag"
978 finalize_command="$finalize_command $link_static_flag"
980 continue
983 -allow-undefined)
984 # FIXME: remove this flag sometime in the future.
985 $echo "$modename: \`-allow-undefined' is deprecated because it is the default" 1>&2
986 continue
989 -avoid-version)
990 avoid_version=yes
991 continue
994 -dlopen)
995 prev=dlfiles
996 continue
999 -dlpreopen)
1000 prev=dlprefiles
1001 continue
1004 -export-dynamic)
1005 export_dynamic=yes
1006 continue
1009 -export-symbols | -export-symbols-regex)
1010 if test -n "$export_symbols" || test -n "$export_symbols_regex"; then
1011 $echo "$modename: more than one -exported-symbols argument is not allowed"
1012 exit 1
1014 if test "X$arg" = "X-export-symbols"; then
1015 prev=expsyms
1016 else
1017 prev=expsyms_regex
1019 continue
1022 -inst-prefix-dir)
1023 prev=inst_prefix
1024 continue
1027 # The native IRIX linker understands -LANG:*, -LIST:* and -LNO:*
1028 # so, if we see these flags be careful not to treat them like -L
1029 -L[A-Z][A-Z]*:*)
1030 case $with_gcc/$host in
1031 no/*-*-irix* | no/*-*-nonstopux*)
1032 compile_command="$compile_command $arg"
1033 finalize_command="$finalize_command $arg"
1035 esac
1036 continue
1039 -L*)
1040 dir=`$echo "X$arg" | $Xsed -e 's/^-L//'`
1041 # We need an absolute path.
1042 case $dir in
1043 [\\/]* | [A-Za-z]:[\\/]*) ;;
1045 absdir=`cd "$dir" && pwd`
1046 if test -z "$absdir"; then
1047 $echo "$modename: cannot determine absolute directory name of \`$dir'" 1>&2
1048 exit 1
1050 dir="$absdir"
1052 esac
1053 case "$deplibs " in
1054 *" -L$dir "*) ;;
1056 deplibs="$deplibs -L$dir"
1057 lib_search_path="$lib_search_path $dir"
1059 esac
1060 case $host in
1061 *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2*)
1062 case :$dllsearchpath: in
1063 *":$dir:"*) ;;
1064 *) dllsearchpath="$dllsearchpath:$dir";;
1065 esac
1067 esac
1068 continue
1071 -l*)
1072 if test "X$arg" = "X-lc" || test "X$arg" = "X-lm"; then
1073 case $host in
1074 *-*-cygwin* | *-*-pw32* | *-*-beos*)
1075 # These systems don't actually have a C or math library (as such)
1076 continue
1078 *-*-mingw* | *-*-os2*)
1079 # These systems don't actually have a C library (as such)
1080 test "X$arg" = "X-lc" && continue
1082 *-*-openbsd* | *-*-freebsd*)
1083 # Do not include libc due to us having libc/libc_r.
1084 test "X$arg" = "X-lc" && continue
1086 esac
1087 elif test "X$arg" = "X-lc_r"; then
1088 case $host in
1089 *-*-openbsd* | *-*-freebsd*)
1090 # Do not include libc_r directly, use -pthread flag.
1091 continue
1093 esac
1095 deplibs="$deplibs $arg"
1096 continue
1099 -module)
1100 module=yes
1101 continue
1104 -no-fast-install)
1105 fast_install=no
1106 continue
1109 -no-install)
1110 case $host in
1111 *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2*)
1112 # The PATH hackery in wrapper scripts is required on Windows
1113 # in order for the loader to find any dlls it needs.
1114 $echo "$modename: warning: \`-no-install' is ignored for $host" 1>&2
1115 $echo "$modename: warning: assuming \`-no-fast-install' instead" 1>&2
1116 fast_install=no
1118 *) no_install=yes ;;
1119 esac
1120 continue
1123 -no-undefined)
1124 allow_undefined=no
1125 continue
1128 -o) prev=output ;;
1130 -release)
1131 prev=release
1132 continue
1135 -rpath)
1136 prev=rpath
1137 continue
1141 prev=xrpath
1142 continue
1145 -R*)
1146 dir=`$echo "X$arg" | $Xsed -e 's/^-R//'`
1147 # We need an absolute path.
1148 case $dir in
1149 [\\/]* | [A-Za-z]:[\\/]*) ;;
1151 $echo "$modename: only absolute run-paths are allowed" 1>&2
1152 exit 1
1154 esac
1155 case "$xrpath " in
1156 *" $dir "*) ;;
1157 *) xrpath="$xrpath $dir" ;;
1158 esac
1159 continue
1162 -static)
1163 # The effects of -static are defined in a previous loop.
1164 # We used to do the same as -all-static on platforms that
1165 # didn't have a PIC flag, but the assumption that the effects
1166 # would be equivalent was wrong. It would break on at least
1167 # Digital Unix and AIX.
1168 continue
1171 -thread-safe)
1172 thread_safe=yes
1173 continue
1176 -version-info)
1177 prev=vinfo
1178 continue
1181 -Wc,*)
1182 args=`$echo "X$arg" | $Xsed -e "$sed_quote_subst" -e 's/^-Wc,//'`
1183 arg=
1184 save_ifs="$IFS"; IFS=','
1185 for flag in $args; do
1186 IFS="$save_ifs"
1187 case $flag in
1188 *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
1189 flag="\"$flag\""
1191 esac
1192 arg="$arg $wl$flag"
1193 compiler_flags="$compiler_flags $flag"
1194 done
1195 IFS="$save_ifs"
1196 arg=`$echo "X$arg" | $Xsed -e "s/^ //"`
1199 -Wl,*)
1200 args=`$echo "X$arg" | $Xsed -e "$sed_quote_subst" -e 's/^-Wl,//'`
1201 arg=
1202 save_ifs="$IFS"; IFS=','
1203 for flag in $args; do
1204 IFS="$save_ifs"
1205 case $flag in
1206 *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
1207 flag="\"$flag\""
1209 esac
1210 arg="$arg $wl$flag"
1211 compiler_flags="$compiler_flags $wl$flag"
1212 linker_flags="$linker_flags $flag"
1213 done
1214 IFS="$save_ifs"
1215 arg=`$echo "X$arg" | $Xsed -e "s/^ //"`
1218 -Xcompiler)
1219 prev=xcompiler
1220 continue
1223 -Xlinker)
1224 prev=xlinker
1225 continue
1228 # Some other compiler flag.
1229 -* | +*)
1230 # Unknown arguments in both finalize_command and compile_command need
1231 # to be aesthetically quoted because they are evaled later.
1232 arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`
1233 case $arg in
1234 *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
1235 arg="\"$arg\""
1237 esac
1240 *.lo | *.$objext)
1241 # A library or standard object.
1242 if test "$prev" = dlfiles; then
1243 # This file was specified with -dlopen.
1244 if test "$build_libtool_libs" = yes && test "$dlopen_support" = yes; then
1245 dlfiles="$dlfiles $arg"
1246 prev=
1247 continue
1248 else
1249 # If libtool objects are unsupported, then we need to preload.
1250 prev=dlprefiles
1254 if test "$prev" = dlprefiles; then
1255 # Preload the old-style object.
1256 dlprefiles="$dlprefiles "`$echo "X$arg" | $Xsed -e "$lo2o"`
1257 prev=
1258 else
1259 case $arg in
1260 *.lo) libobjs="$libobjs $arg" ;;
1261 *) objs="$objs $arg" ;;
1262 esac
1266 *.$libext)
1267 # An archive.
1268 deplibs="$deplibs $arg"
1269 old_deplibs="$old_deplibs $arg"
1270 continue
1273 *.la)
1274 # A libtool-controlled library.
1276 if test "$prev" = dlfiles; then
1277 # This library was specified with -dlopen.
1278 dlfiles="$dlfiles $arg"
1279 prev=
1280 elif test "$prev" = dlprefiles; then
1281 # The library was specified with -dlpreopen.
1282 dlprefiles="$dlprefiles $arg"
1283 prev=
1284 else
1285 deplibs="$deplibs $arg"
1287 continue
1290 # Some other compiler argument.
1292 # Unknown arguments in both finalize_command and compile_command need
1293 # to be aesthetically quoted because they are evaled later.
1294 arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`
1295 case $arg in
1296 *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
1297 arg="\"$arg\""
1299 esac
1301 esac # arg
1303 # Now actually substitute the argument into the commands.
1304 if test -n "$arg"; then
1305 compile_command="$compile_command $arg"
1306 finalize_command="$finalize_command $arg"
1308 done # argument parsing loop
1310 if test -n "$prev"; then
1311 $echo "$modename: the \`$prevarg' option requires an argument" 1>&2
1312 $echo "$help" 1>&2
1313 exit 1
1316 if test "$export_dynamic" = yes && test -n "$export_dynamic_flag_spec"; then
1317 eval arg=\"$export_dynamic_flag_spec\"
1318 compile_command="$compile_command $arg"
1319 finalize_command="$finalize_command $arg"
1322 # calculate the name of the file, without its directory
1323 outputname=`$echo "X$output" | $Xsed -e 's%^.*/%%'`
1324 libobjs_save="$libobjs"
1326 if test -n "$shlibpath_var"; then
1327 # get the directories listed in $shlibpath_var
1328 eval shlib_search_path=\`\$echo \"X\${$shlibpath_var}\" \| \$Xsed -e \'s/:/ /g\'\`
1329 else
1330 shlib_search_path=
1332 eval sys_lib_search_path=\"$sys_lib_search_path_spec\"
1333 eval sys_lib_dlsearch_path=\"$sys_lib_dlsearch_path_spec\"
1335 output_objdir=`$echo "X$output" | $Xsed -e 's%/[^/]*$%%'`
1336 if test "X$output_objdir" = "X$output"; then
1337 output_objdir="$objdir"
1338 else
1339 output_objdir="$output_objdir/$objdir"
1341 # Create the object directory.
1342 if test ! -d $output_objdir; then
1343 $show "$mkdir $output_objdir"
1344 $run $mkdir $output_objdir
1345 status=$?
1346 if test $status -ne 0 && test ! -d $output_objdir; then
1347 exit $status
1351 # Determine the type of output
1352 case $output in
1354 $echo "$modename: you must specify an output file" 1>&2
1355 $echo "$help" 1>&2
1356 exit 1
1358 *.$libext) linkmode=oldlib ;;
1359 *.lo | *.$objext) linkmode=obj ;;
1360 *.la) linkmode=lib ;;
1361 *) linkmode=prog ;; # Anything else should be a program.
1362 esac
1364 specialdeplibs=
1365 libs=
1366 # Find all interdependent deplibs by searching for libraries
1367 # that are linked more than once (e.g. -la -lb -la)
1368 for deplib in $deplibs; do
1369 if test "X$duplicate_deps" = "Xyes" ; then
1370 case "$libs " in
1371 *" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;;
1372 esac
1374 libs="$libs $deplib"
1375 done
1376 deplibs=
1377 newdependency_libs=
1378 newlib_search_path=
1379 need_relink=no # whether we're linking any uninstalled libtool libraries
1380 notinst_deplibs= # not-installed libtool libraries
1381 notinst_path= # paths that contain not-installed libtool libraries
1382 case $linkmode in
1383 lib)
1384 passes="conv link"
1385 for file in $dlfiles $dlprefiles; do
1386 case $file in
1387 *.la) ;;
1389 $echo "$modename: libraries can \`-dlopen' only libtool libraries: $file" 1>&2
1390 exit 1
1392 esac
1393 done
1395 prog)
1396 compile_deplibs=
1397 finalize_deplibs=
1398 alldeplibs=no
1399 newdlfiles=
1400 newdlprefiles=
1401 passes="conv scan dlopen dlpreopen link"
1403 *) passes="conv"
1405 esac
1406 for pass in $passes; do
1407 if test $linkmode = prog; then
1408 # Determine which files to process
1409 case $pass in
1410 dlopen)
1411 libs="$dlfiles"
1412 save_deplibs="$deplibs" # Collect dlpreopened libraries
1413 deplibs=
1415 dlpreopen) libs="$dlprefiles" ;;
1416 link) libs="$deplibs %DEPLIBS% $dependency_libs" ;;
1417 esac
1419 for deplib in $libs; do
1420 lib=
1421 found=no
1422 case $deplib in
1423 -l*)
1424 if test $linkmode = oldlib && test $linkmode = obj; then
1425 $echo "$modename: warning: \`-l' is ignored for archives/objects: $deplib" 1>&2
1426 continue
1428 if test $pass = conv; then
1429 deplibs="$deplib $deplibs"
1430 continue
1432 name=`$echo "X$deplib" | $Xsed -e 's/^-l//'`
1433 for searchdir in $newlib_search_path $lib_search_path $sys_lib_search_path $shlib_search_path; do
1434 # Search the libtool library
1435 lib="$searchdir/lib${name}.la"
1436 if test -f "$lib"; then
1437 found=yes
1438 break
1440 done
1441 if test "$found" != yes; then
1442 # deplib doesn't seem to be a libtool library
1443 if test "$linkmode,$pass" = "prog,link"; then
1444 compile_deplibs="$deplib $compile_deplibs"
1445 finalize_deplibs="$deplib $finalize_deplibs"
1446 else
1447 deplibs="$deplib $deplibs"
1448 test $linkmode = lib && newdependency_libs="$deplib $newdependency_libs"
1450 continue
1452 ;; # -l
1453 -L*)
1454 case $linkmode in
1455 lib)
1456 deplibs="$deplib $deplibs"
1457 test $pass = conv && continue
1458 newdependency_libs="$deplib $newdependency_libs"
1459 newlib_search_path="$newlib_search_path "`$echo "X$deplib" | $Xsed -e 's/^-L//'`
1461 prog)
1462 if test $pass = conv; then
1463 deplibs="$deplib $deplibs"
1464 continue
1466 if test $pass = scan; then
1467 deplibs="$deplib $deplibs"
1468 newlib_search_path="$newlib_search_path "`$echo "X$deplib" | $Xsed -e 's/^-L//'`
1469 else
1470 compile_deplibs="$deplib $compile_deplibs"
1471 finalize_deplibs="$deplib $finalize_deplibs"
1475 $echo "$modename: warning: \`-L' is ignored for archives/objects: $deplib" 1>&2
1477 esac # linkmode
1478 continue
1479 ;; # -L
1480 -R*)
1481 if test $pass = link; then
1482 dir=`$echo "X$deplib" | $Xsed -e 's/^-R//'`
1483 # Make sure the xrpath contains only unique directories.
1484 case "$xrpath " in
1485 *" $dir "*) ;;
1486 *) xrpath="$xrpath $dir" ;;
1487 esac
1489 deplibs="$deplib $deplibs"
1490 continue
1492 *.la) lib="$deplib" ;;
1493 *.$libext)
1494 if test $pass = conv; then
1495 deplibs="$deplib $deplibs"
1496 continue
1498 case $linkmode in
1499 lib)
1500 if test "$deplibs_check_method" != pass_all; then
1501 echo
1502 echo "*** Warning: Trying to link with static lib archive $deplib."
1503 echo "*** I have the capability to make that library automatically link in when"
1504 echo "*** you link to this library. But I can only do this if you have a"
1505 echo "*** shared version of the library, which you do not appear to have"
1506 echo "*** because the file extensions .$libext of this argument makes me believe"
1507 echo "*** that it is just a static archive that I should not used here."
1508 else
1509 echo
1510 echo "*** Warning: Linking the shared library $output against the"
1511 echo "*** static library $deplib is not portable!"
1512 deplibs="$deplib $deplibs"
1514 continue
1516 prog)
1517 if test $pass != link; then
1518 deplibs="$deplib $deplibs"
1519 else
1520 compile_deplibs="$deplib $compile_deplibs"
1521 finalize_deplibs="$deplib $finalize_deplibs"
1523 continue
1525 esac # linkmode
1526 ;; # *.$libext
1527 *.lo | *.$objext)
1528 if test $pass = dlpreopen || test "$dlopen_support" != yes || test "$build_libtool_libs" = no; then
1529 # If there is no dlopen support or we're linking statically,
1530 # we need to preload.
1531 newdlprefiles="$newdlprefiles $deplib"
1532 compile_deplibs="$deplib $compile_deplibs"
1533 finalize_deplibs="$deplib $finalize_deplibs"
1534 else
1535 newdlfiles="$newdlfiles $deplib"
1537 continue
1539 %DEPLIBS%)
1540 alldeplibs=yes
1541 continue
1543 esac # case $deplib
1544 if test $found = yes || test -f "$lib"; then :
1545 else
1546 $echo "$modename: cannot find the library \`$lib'" 1>&2
1547 exit 1
1550 # Check to see that this really is a libtool archive.
1551 if (${SED} -e '2q' $lib | egrep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then :
1552 else
1553 $echo "$modename: \`$lib' is not a valid libtool archive" 1>&2
1554 exit 1
1557 ladir=`$echo "X$lib" | $Xsed -e 's%/[^/]*$%%'`
1558 test "X$ladir" = "X$lib" && ladir="."
1560 dlname=
1561 dlopen=
1562 dlpreopen=
1563 libdir=
1564 library_names=
1565 old_library=
1566 # If the library was installed with an old release of libtool,
1567 # it will not redefine variable installed.
1568 installed=yes
1570 # Read the .la file
1571 case $lib in
1572 */* | *\\*) . $lib ;;
1573 *) . ./$lib ;;
1574 esac
1576 if test "$linkmode,$pass" = "lib,link" ||
1577 test "$linkmode,$pass" = "prog,scan" ||
1578 { test $linkmode = oldlib && test $linkmode = obj; }; then
1579 # Add dl[pre]opened files of deplib
1580 test -n "$dlopen" && dlfiles="$dlfiles $dlopen"
1581 test -n "$dlpreopen" && dlprefiles="$dlprefiles $dlpreopen"
1584 if test $pass = conv; then
1585 # Only check for convenience libraries
1586 deplibs="$lib $deplibs"
1587 if test -z "$libdir"; then
1588 if test -z "$old_library"; then
1589 $echo "$modename: cannot find name of link library for \`$lib'" 1>&2
1590 exit 1
1592 # It is a libtool convenience library, so add in its objects.
1593 convenience="$convenience $ladir/$objdir/$old_library"
1594 old_convenience="$old_convenience $ladir/$objdir/$old_library"
1595 tmp_libs=
1596 for deplib in $dependency_libs; do
1597 deplibs="$deplib $deplibs"
1598 if test "X$duplicate_deps" = "Xyes" ; then
1599 case "$tmp_libs " in
1600 *" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;;
1601 esac
1603 tmp_libs="$tmp_libs $deplib"
1604 done
1605 elif test $linkmode != prog && test $linkmode != lib; then
1606 $echo "$modename: \`$lib' is not a convenience library" 1>&2
1607 exit 1
1609 continue
1610 fi # $pass = conv
1612 # Get the name of the library we link against.
1613 linklib=
1614 for l in $old_library $library_names; do
1615 linklib="$l"
1616 done
1617 if test -z "$linklib"; then
1618 $echo "$modename: cannot find name of link library for \`$lib'" 1>&2
1619 exit 1
1622 # This library was specified with -dlopen.
1623 if test $pass = dlopen; then
1624 if test -z "$libdir"; then
1625 $echo "$modename: cannot -dlopen a convenience library: \`$lib'" 1>&2
1626 exit 1
1628 if test -z "$dlname" || test "$dlopen_support" != yes || test "$build_libtool_libs" = no; then
1629 # If there is no dlname, no dlopen support or we're linking
1630 # statically, we need to preload.
1631 dlprefiles="$dlprefiles $lib"
1632 else
1633 newdlfiles="$newdlfiles $lib"
1635 continue
1636 fi # $pass = dlopen
1638 # We need an absolute path.
1639 case $ladir in
1640 [\\/]* | [A-Za-z]:[\\/]*) abs_ladir="$ladir" ;;
1642 abs_ladir=`cd "$ladir" && pwd`
1643 if test -z "$abs_ladir"; then
1644 $echo "$modename: warning: cannot determine absolute directory name of \`$ladir'" 1>&2
1645 $echo "$modename: passing it literally to the linker, although it might fail" 1>&2
1646 abs_ladir="$ladir"
1649 esac
1650 laname=`$echo "X$lib" | $Xsed -e 's%^.*/%%'`
1652 # Find the relevant object directory and library name.
1653 if test "X$installed" = Xyes; then
1654 if test ! -f "$libdir/$linklib" && test -f "$abs_ladir/$linklib"; then
1655 $echo "$modename: warning: library \`$lib' was moved." 1>&2
1656 dir="$ladir"
1657 absdir="$abs_ladir"
1658 libdir="$abs_ladir"
1659 else
1660 dir="$libdir"
1661 absdir="$libdir"
1663 else
1664 dir="$ladir/$objdir"
1665 absdir="$abs_ladir/$objdir"
1666 # Remove this search path later
1667 notinst_path="$notinst_path $abs_ladir"
1668 fi # $installed = yes
1669 name=`$echo "X$laname" | $Xsed -e 's/\.la$//' -e 's/^lib//'`
1671 # This library was specified with -dlpreopen.
1672 if test $pass = dlpreopen; then
1673 if test -z "$libdir"; then
1674 $echo "$modename: cannot -dlpreopen a convenience library: \`$lib'" 1>&2
1675 exit 1
1677 # Prefer using a static library (so that no silly _DYNAMIC symbols
1678 # are required to link).
1679 if test -n "$old_library"; then
1680 newdlprefiles="$newdlprefiles $dir/$old_library"
1681 # Otherwise, use the dlname, so that lt_dlopen finds it.
1682 elif test -n "$dlname"; then
1683 newdlprefiles="$newdlprefiles $dir/$dlname"
1684 else
1685 newdlprefiles="$newdlprefiles $dir/$linklib"
1687 fi # $pass = dlpreopen
1689 if test -z "$libdir"; then
1690 # Link the convenience library
1691 if test $linkmode = lib; then
1692 deplibs="$dir/$old_library $deplibs"
1693 elif test "$linkmode,$pass" = "prog,link"; then
1694 compile_deplibs="$dir/$old_library $compile_deplibs"
1695 finalize_deplibs="$dir/$old_library $finalize_deplibs"
1696 else
1697 deplibs="$lib $deplibs"
1699 continue
1702 if test $linkmode = prog && test $pass != link; then
1703 newlib_search_path="$newlib_search_path $ladir"
1704 deplibs="$lib $deplibs"
1706 linkalldeplibs=no
1707 if test "$link_all_deplibs" != no || test -z "$library_names" ||
1708 test "$build_libtool_libs" = no; then
1709 linkalldeplibs=yes
1712 tmp_libs=
1713 for deplib in $dependency_libs; do
1714 case $deplib in
1715 -L*) newlib_search_path="$newlib_search_path "`$echo "X$deplib" | $Xsed -e 's/^-L//'`;; ### testsuite: skip nested quoting test
1716 esac
1717 # Need to link against all dependency_libs?
1718 if test $linkalldeplibs = yes; then
1719 deplibs="$deplib $deplibs"
1720 else
1721 # Need to hardcode shared library paths
1722 # or/and link against static libraries
1723 newdependency_libs="$deplib $newdependency_libs"
1725 if test "X$duplicate_deps" = "Xyes" ; then
1726 case "$tmp_libs " in
1727 *" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;;
1728 esac
1730 tmp_libs="$tmp_libs $deplib"
1731 done # for deplib
1732 continue
1733 fi # $linkmode = prog...
1735 link_static=no # Whether the deplib will be linked statically
1736 if test -n "$library_names" &&
1737 { test "$prefer_static_libs" = no || test -z "$old_library"; }; then
1738 # Link against this shared library
1740 if test "$linkmode,$pass" = "prog,link" ||
1741 { test $linkmode = lib && test $hardcode_into_libs = yes; }; then
1742 # Hardcode the library path.
1743 # Skip directories that are in the system default run-time
1744 # search path.
1745 case " $sys_lib_dlsearch_path " in
1746 *" $absdir "*) ;;
1748 case "$compile_rpath " in
1749 *" $absdir "*) ;;
1750 *) compile_rpath="$compile_rpath $absdir"
1751 esac
1753 esac
1754 case " $sys_lib_dlsearch_path " in
1755 *" $libdir "*) ;;
1757 case "$finalize_rpath " in
1758 *" $libdir "*) ;;
1759 *) finalize_rpath="$finalize_rpath $libdir"
1760 esac
1762 esac
1763 if test $linkmode = prog; then
1764 # We need to hardcode the library path
1765 if test -n "$shlibpath_var"; then
1766 # Make sure the rpath contains only unique directories.
1767 case "$temp_rpath " in
1768 *" $dir "*) ;;
1769 *" $absdir "*) ;;
1770 *) temp_rpath="$temp_rpath $dir" ;;
1771 esac
1774 fi # $linkmode,$pass = prog,link...
1776 if test "$alldeplibs" = yes &&
1777 { test "$deplibs_check_method" = pass_all ||
1778 { test "$build_libtool_libs" = yes &&
1779 test -n "$library_names"; }; }; then
1780 # We only need to search for static libraries
1781 continue
1784 if test "$installed" = no; then
1785 notinst_deplibs="$notinst_deplibs $lib"
1786 need_relink=yes
1789 if test -n "$old_archive_from_expsyms_cmds"; then
1790 # figure out the soname
1791 set dummy $library_names
1792 realname="$2"
1793 shift; shift
1794 libname=`eval \\$echo \"$libname_spec\"`
1795 # use dlname if we got it. it's perfectly good, no?
1796 if test -n "$dlname"; then
1797 soname="$dlname"
1798 elif test -n "$soname_spec"; then
1799 # bleh windows
1800 case $host in
1801 *cygwin*)
1802 major=`expr $current - $age`
1803 versuffix="-$major"
1805 esac
1806 eval soname=\"$soname_spec\"
1807 else
1808 soname="$realname"
1811 # Make a new name for the extract_expsyms_cmds to use
1812 soroot="$soname"
1813 soname=`echo $soroot | ${SED} -e 's/^.*\///'`
1814 newlib="libimp-`echo $soname | ${SED} 's/^lib//;s/\.dll$//'`.a"
1816 # If the library has no export list, then create one now
1817 if test -f "$output_objdir/$soname-def"; then :
1818 else
1819 $show "extracting exported symbol list from \`$soname'"
1820 save_ifs="$IFS"; IFS='~'
1821 eval cmds=\"$extract_expsyms_cmds\"
1822 for cmd in $cmds; do
1823 IFS="$save_ifs"
1824 $show "$cmd"
1825 $run eval "$cmd" || exit $?
1826 done
1827 IFS="$save_ifs"
1830 # Create $newlib
1831 if test -f "$output_objdir/$newlib"; then :; else
1832 $show "generating import library for \`$soname'"
1833 save_ifs="$IFS"; IFS='~'
1834 eval cmds=\"$old_archive_from_expsyms_cmds\"
1835 for cmd in $cmds; do
1836 IFS="$save_ifs"
1837 $show "$cmd"
1838 $run eval "$cmd" || exit $?
1839 done
1840 IFS="$save_ifs"
1842 # make sure the library variables are pointing to the new library
1843 dir=$output_objdir
1844 linklib=$newlib
1845 fi # test -n $old_archive_from_expsyms_cmds
1847 if test $linkmode = prog || test "$mode" != relink; then
1848 add_shlibpath=
1849 add_dir=
1850 add=
1851 lib_linked=yes
1852 case $hardcode_action in
1853 immediate | unsupported)
1854 if test "$hardcode_direct" = no; then
1855 add="$dir/$linklib"
1856 elif test "$hardcode_minus_L" = no; then
1857 case $host in
1858 *-*-sunos*) add_shlibpath="$dir" ;;
1859 esac
1860 add_dir="-L$dir"
1861 add="-l$name"
1862 elif test "$hardcode_shlibpath_var" = no; then
1863 add_shlibpath="$dir"
1864 add="-l$name"
1865 else
1866 lib_linked=no
1869 relink)
1870 if test "$hardcode_direct" = yes; then
1871 add="$dir/$linklib"
1872 elif test "$hardcode_minus_L" = yes; then
1873 add_dir="-L$dir"
1874 add="-l$name"
1875 elif test "$hardcode_shlibpath_var" = yes; then
1876 add_shlibpath="$dir"
1877 add="-l$name"
1878 else
1879 lib_linked=no
1882 *) lib_linked=no ;;
1883 esac
1885 if test "$lib_linked" != yes; then
1886 $echo "$modename: configuration error: unsupported hardcode properties"
1887 exit 1
1890 if test -n "$add_shlibpath"; then
1891 case :$compile_shlibpath: in
1892 *":$add_shlibpath:"*) ;;
1893 *) compile_shlibpath="$compile_shlibpath$add_shlibpath:" ;;
1894 esac
1896 if test $linkmode = prog; then
1897 test -n "$add_dir" && compile_deplibs="$add_dir $compile_deplibs"
1898 test -n "$add" && compile_deplibs="$add $compile_deplibs"
1899 else
1900 test -n "$add_dir" && deplibs="$add_dir $deplibs"
1901 test -n "$add" && deplibs="$add $deplibs"
1902 if test "$hardcode_direct" != yes && \
1903 test "$hardcode_minus_L" != yes && \
1904 test "$hardcode_shlibpath_var" = yes; then
1905 case :$finalize_shlibpath: in
1906 *":$libdir:"*) ;;
1907 *) finalize_shlibpath="$finalize_shlibpath$libdir:" ;;
1908 esac
1913 if test $linkmode = prog || test "$mode" = relink; then
1914 add_shlibpath=
1915 add_dir=
1916 add=
1917 # Finalize command for both is simple: just hardcode it.
1918 if test "$hardcode_direct" = yes; then
1919 add="$libdir/$linklib"
1920 elif test "$hardcode_minus_L" = yes; then
1921 # Try looking first in the location we're being installed to.
1922 add_dir=
1923 if test -n "$inst_prefix_dir"; then
1924 case "$libdir" in
1925 [\\/]*)
1926 add_dir="-L$inst_prefix_dir$libdir"
1928 esac
1930 add_dir="$add_dir -L$libdir"
1931 add="-l$name"
1932 elif test "$hardcode_shlibpath_var" = yes; then
1933 case :$finalize_shlibpath: in
1934 *":$libdir:"*) ;;
1935 *) finalize_shlibpath="$finalize_shlibpath$libdir:" ;;
1936 esac
1937 add="-l$name"
1938 else
1939 # We cannot seem to hardcode it, guess we'll fake it.
1940 # Try looking first in the location we're being installed to.
1941 add_dir=
1942 if test -n "$inst_prefix_dir"; then
1943 case "$libdir" in
1944 [\\/]*)
1945 add_dir="-L$inst_prefix_dir$libdir"
1947 esac
1949 add_dir="$add_dir -L$libdir"
1950 add="-l$name"
1953 if test $linkmode = prog; then
1954 test -n "$add_dir" && finalize_deplibs="$add_dir $finalize_deplibs"
1955 test -n "$add" && finalize_deplibs="$add $finalize_deplibs"
1956 else
1957 test -n "$add_dir" && deplibs="$add_dir $deplibs"
1958 test -n "$add" && deplibs="$add $deplibs"
1961 elif test $linkmode = prog; then
1962 if test "$alldeplibs" = yes &&
1963 { test "$deplibs_check_method" = pass_all ||
1964 { test "$build_libtool_libs" = yes &&
1965 test -n "$library_names"; }; }; then
1966 # We only need to search for static libraries
1967 continue
1970 # Try to link the static library
1971 # Here we assume that one of hardcode_direct or hardcode_minus_L
1972 # is not unsupported. This is valid on all known static and
1973 # shared platforms.
1974 if test "$hardcode_direct" != unsupported; then
1975 test -n "$old_library" && linklib="$old_library"
1976 compile_deplibs="$dir/$linklib $compile_deplibs"
1977 finalize_deplibs="$dir/$linklib $finalize_deplibs"
1978 else
1979 compile_deplibs="-l$name -L$dir $compile_deplibs"
1980 finalize_deplibs="-l$name -L$dir $finalize_deplibs"
1982 elif test "$build_libtool_libs" = yes; then
1983 # Not a shared library
1984 if test "$deplibs_check_method" != pass_all; then
1985 # We're trying link a shared library against a static one
1986 # but the system doesn't support it.
1988 # Just print a warning and add the library to dependency_libs so
1989 # that the program can be linked against the static library.
1990 echo
1991 echo "*** Warning: This system can not link to static lib archive $lib."
1992 echo "*** I have the capability to make that library automatically link in when"
1993 echo "*** you link to this library. But I can only do this if you have a"
1994 echo "*** shared version of the library, which you do not appear to have."
1995 if test "$module" = yes; then
1996 echo "*** But as you try to build a module library, libtool will still create "
1997 echo "*** a static module, that should work as long as the dlopening application"
1998 echo "*** is linked with the -dlopen flag to resolve symbols at runtime."
1999 if test -z "$global_symbol_pipe"; then
2000 echo
2001 echo "*** However, this would only work if libtool was able to extract symbol"
2002 echo "*** lists from a program, using \`nm' or equivalent, but libtool could"
2003 echo "*** not find such a program. So, this module is probably useless."
2004 echo "*** \`nm' from GNU binutils and a full rebuild may help."
2006 if test "$build_old_libs" = no; then
2007 build_libtool_libs=module
2008 build_old_libs=yes
2009 else
2010 build_libtool_libs=no
2013 else
2014 convenience="$convenience $dir/$old_library"
2015 old_convenience="$old_convenience $dir/$old_library"
2016 deplibs="$dir/$old_library $deplibs"
2017 link_static=yes
2019 fi # link shared/static library?
2021 if test $linkmode = lib; then
2022 if test -n "$dependency_libs" &&
2023 { test $hardcode_into_libs != yes || test $build_old_libs = yes ||
2024 test $link_static = yes; }; then
2025 # Extract -R from dependency_libs
2026 temp_deplibs=
2027 for libdir in $dependency_libs; do
2028 case $libdir in
2029 -R*) temp_xrpath=`$echo "X$libdir" | $Xsed -e 's/^-R//'`
2030 case " $xrpath " in
2031 *" $temp_xrpath "*) ;;
2032 *) xrpath="$xrpath $temp_xrpath";;
2033 esac;;
2034 *) temp_deplibs="$temp_deplibs $libdir";;
2035 esac
2036 done
2037 dependency_libs="$temp_deplibs"
2040 newlib_search_path="$newlib_search_path $absdir"
2041 # Link against this library
2042 test "$link_static" = no && newdependency_libs="$abs_ladir/$laname $newdependency_libs"
2043 # ... and its dependency_libs
2044 tmp_libs=
2045 for deplib in $dependency_libs; do
2046 newdependency_libs="$deplib $newdependency_libs"
2047 if test "X$duplicate_deps" = "Xyes" ; then
2048 case "$tmp_libs " in
2049 *" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;;
2050 esac
2052 tmp_libs="$tmp_libs $deplib"
2053 done
2055 if test $link_all_deplibs != no; then
2056 # Add the search paths of all dependency libraries
2057 for deplib in $dependency_libs; do
2058 case $deplib in
2059 -L*) path="$deplib" ;;
2060 *.la)
2061 dir=`$echo "X$deplib" | $Xsed -e 's%/[^/]*$%%'`
2062 test "X$dir" = "X$deplib" && dir="."
2063 # We need an absolute path.
2064 case $dir in
2065 [\\/]* | [A-Za-z]:[\\/]*) absdir="$dir" ;;
2067 absdir=`cd "$dir" && pwd`
2068 if test -z "$absdir"; then
2069 $echo "$modename: warning: cannot determine absolute directory name of \`$dir'" 1>&2
2070 absdir="$dir"
2073 esac
2074 if grep "^installed=no" $deplib > /dev/null; then
2075 path="-L$absdir/$objdir"
2076 else
2077 eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $deplib`
2078 if test -z "$libdir"; then
2079 $echo "$modename: \`$deplib' is not a valid libtool archive" 1>&2
2080 exit 1
2082 if test "$absdir" != "$libdir"; then
2083 $echo "$modename: warning: \`$deplib' seems to be moved" 1>&2
2085 path="-L$absdir"
2088 *) continue ;;
2089 esac
2090 case " $deplibs " in
2091 *" $path "*) ;;
2092 *) deplibs="$deplibs $path" ;;
2093 esac
2094 done
2095 fi # link_all_deplibs != no
2096 fi # linkmode = lib
2097 done # for deplib in $libs
2098 if test $pass = dlpreopen; then
2099 # Link the dlpreopened libraries before other libraries
2100 for deplib in $save_deplibs; do
2101 deplibs="$deplib $deplibs"
2102 done
2104 if test $pass != dlopen; then
2105 test $pass != scan && dependency_libs="$newdependency_libs"
2106 if test $pass != conv; then
2107 # Make sure lib_search_path contains only unique directories.
2108 lib_search_path=
2109 for dir in $newlib_search_path; do
2110 case "$lib_search_path " in
2111 *" $dir "*) ;;
2112 *) lib_search_path="$lib_search_path $dir" ;;
2113 esac
2114 done
2115 newlib_search_path=
2118 if test "$linkmode,$pass" != "prog,link"; then
2119 vars="deplibs"
2120 else
2121 vars="compile_deplibs finalize_deplibs"
2123 for var in $vars dependency_libs; do
2124 # Add libraries to $var in reverse order
2125 eval tmp_libs=\"\$$var\"
2126 new_libs=
2127 for deplib in $tmp_libs; do
2128 case $deplib in
2129 -L*) new_libs="$deplib $new_libs" ;;
2131 case " $specialdeplibs " in
2132 *" $deplib "*) new_libs="$deplib $new_libs" ;;
2134 case " $new_libs " in
2135 *" $deplib "*) ;;
2136 *) new_libs="$deplib $new_libs" ;;
2137 esac
2139 esac
2141 esac
2142 done
2143 tmp_libs=
2144 for deplib in $new_libs; do
2145 case $deplib in
2146 -L*)
2147 case " $tmp_libs " in
2148 *" $deplib "*) ;;
2149 *) tmp_libs="$tmp_libs $deplib" ;;
2150 esac
2152 *) tmp_libs="$tmp_libs $deplib" ;;
2153 esac
2154 done
2155 eval $var=\"$tmp_libs\"
2156 done # for var
2158 if test "$pass" = "conv" &&
2159 { test "$linkmode" = "lib" || test "$linkmode" = "prog"; }; then
2160 libs="$deplibs" # reset libs
2161 deplibs=
2163 done # for pass
2164 if test $linkmode = prog; then
2165 dlfiles="$newdlfiles"
2166 dlprefiles="$newdlprefiles"
2169 case $linkmode in
2170 oldlib)
2171 if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then
2172 $echo "$modename: warning: \`-dlopen' is ignored for archives" 1>&2
2175 if test -n "$rpath"; then
2176 $echo "$modename: warning: \`-rpath' is ignored for archives" 1>&2
2179 if test -n "$xrpath"; then
2180 $echo "$modename: warning: \`-R' is ignored for archives" 1>&2
2183 if test -n "$vinfo"; then
2184 $echo "$modename: warning: \`-version-info' is ignored for archives" 1>&2
2187 if test -n "$release"; then
2188 $echo "$modename: warning: \`-release' is ignored for archives" 1>&2
2191 if test -n "$export_symbols" || test -n "$export_symbols_regex"; then
2192 $echo "$modename: warning: \`-export-symbols' is ignored for archives" 1>&2
2195 # Now set the variables for building old libraries.
2196 build_libtool_libs=no
2197 oldlibs="$output"
2198 objs="$objs$old_deplibs"
2201 lib)
2202 # Make sure we only generate libraries of the form `libNAME.la'.
2203 case $outputname in
2204 lib*)
2205 name=`$echo "X$outputname" | $Xsed -e 's/\.la$//' -e 's/^lib//'`
2206 eval libname=\"$libname_spec\"
2209 if test "$module" = no; then
2210 $echo "$modename: libtool library \`$output' must begin with \`lib'" 1>&2
2211 $echo "$help" 1>&2
2212 exit 1
2214 if test "$need_lib_prefix" != no; then
2215 # Add the "lib" prefix for modules if required
2216 name=`$echo "X$outputname" | $Xsed -e 's/\.la$//'`
2217 eval libname=\"$libname_spec\"
2218 else
2219 libname=`$echo "X$outputname" | $Xsed -e 's/\.la$//'`
2222 esac
2224 if test -n "$objs"; then
2225 if test "$deplibs_check_method" != pass_all; then
2226 $echo "$modename: cannot build libtool library \`$output' from non-libtool objects on this host:$objs" 2>&1
2227 exit 1
2228 else
2229 echo
2230 echo "*** Warning: Linking the shared library $output against the non-libtool"
2231 echo "*** objects $objs is not portable!"
2232 libobjs="$libobjs $objs"
2236 if test "$dlself" != no; then
2237 $echo "$modename: warning: \`-dlopen self' is ignored for libtool libraries" 1>&2
2240 set dummy $rpath
2241 if test $# -gt 2; then
2242 $echo "$modename: warning: ignoring multiple \`-rpath's for a libtool library" 1>&2
2244 install_libdir="$2"
2246 oldlibs=
2247 if test -z "$rpath"; then
2248 if test "$build_libtool_libs" = yes; then
2249 # Building a libtool convenience library.
2250 libext=al
2251 oldlibs="$output_objdir/$libname.$libext $oldlibs"
2252 build_libtool_libs=convenience
2253 build_old_libs=yes
2256 if test -n "$vinfo"; then
2257 $echo "$modename: warning: \`-version-info' is ignored for convenience libraries" 1>&2
2260 if test -n "$release"; then
2261 $echo "$modename: warning: \`-release' is ignored for convenience libraries" 1>&2
2263 else
2265 # Parse the version information argument.
2266 save_ifs="$IFS"; IFS=':'
2267 set dummy $vinfo 0 0 0
2268 IFS="$save_ifs"
2270 if test -n "$8"; then
2271 $echo "$modename: too many parameters to \`-version-info'" 1>&2
2272 $echo "$help" 1>&2
2273 exit 1
2276 current="$2"
2277 revision="$3"
2278 age="$4"
2280 # Check that each of the things are valid numbers.
2281 case $current in
2282 [0-9]*) ;;
2284 $echo "$modename: CURRENT \`$current' is not a nonnegative integer" 1>&2
2285 $echo "$modename: \`$vinfo' is not valid version information" 1>&2
2286 exit 1
2288 esac
2290 case $revision in
2291 [0-9]*) ;;
2293 $echo "$modename: REVISION \`$revision' is not a nonnegative integer" 1>&2
2294 $echo "$modename: \`$vinfo' is not valid version information" 1>&2
2295 exit 1
2297 esac
2299 case $age in
2300 [0-9]*) ;;
2302 $echo "$modename: AGE \`$age' is not a nonnegative integer" 1>&2
2303 $echo "$modename: \`$vinfo' is not valid version information" 1>&2
2304 exit 1
2306 esac
2308 if test $age -gt $current; then
2309 $echo "$modename: AGE \`$age' is greater than the current interface number \`$current'" 1>&2
2310 $echo "$modename: \`$vinfo' is not valid version information" 1>&2
2311 exit 1
2314 # Calculate the version variables.
2315 major=
2316 versuffix=
2317 verstring=
2318 case $version_type in
2319 none) ;;
2321 darwin)
2322 # Like Linux, but with the current version available in
2323 # verstring for coding it into the library header
2324 major=.`expr $current - $age`
2325 versuffix="$major.$age.$revision"
2326 # Darwin ld doesn't like 0 for these options...
2327 minor_current=`expr $current + 1`
2328 verstring="-compatibility_version $minor_current -current_version $minor_current.$revision"
2331 freebsd-aout)
2332 major=".$current"
2333 versuffix=".$current.$revision";
2336 freebsd-elf)
2337 major=".$current"
2338 versuffix=".$current";
2341 irix | nonstopux)
2342 major=`expr $current - $age + 1`
2344 case $version_type in
2345 nonstopux) verstring_prefix=nonstopux ;;
2346 *) verstring_prefix=sgi ;;
2347 esac
2348 verstring="$verstring_prefix$major.$revision"
2350 # Add in all the interfaces that we are compatible with.
2351 loop=$revision
2352 while test $loop != 0; do
2353 iface=`expr $revision - $loop`
2354 loop=`expr $loop - 1`
2355 verstring="$verstring_prefix$major.$iface:$verstring"
2356 done
2358 # Before this point, $major must not contain `.'.
2359 major=.$major
2360 versuffix="$major.$revision"
2363 linux)
2364 major=.`expr $current - $age`
2365 versuffix="$major.$age.$revision"
2368 osf)
2369 major=.`expr $current - $age`
2370 versuffix=".$current.$age.$revision"
2371 verstring="$current.$age.$revision"
2373 # Add in all the interfaces that we are compatible with.
2374 loop=$age
2375 while test $loop != 0; do
2376 iface=`expr $current - $loop`
2377 loop=`expr $loop - 1`
2378 verstring="$verstring:${iface}.0"
2379 done
2381 # Make executables depend on our current version.
2382 verstring="$verstring:${current}.0"
2385 sunos)
2386 major=".$current"
2387 versuffix=".$current.$revision"
2390 windows)
2391 # Use '-' rather than '.', since we only want one
2392 # extension on DOS 8.3 filesystems.
2393 major=`expr $current - $age`
2394 versuffix="-$major"
2398 $echo "$modename: unknown library version type \`$version_type'" 1>&2
2399 echo "Fatal configuration error. See the $PACKAGE docs for more information." 1>&2
2400 exit 1
2402 esac
2404 # Clear the version info if we defaulted, and they specified a release.
2405 if test -z "$vinfo" && test -n "$release"; then
2406 major=
2407 verstring="0.0"
2408 case $version_type in
2409 darwin)
2410 # we can't check for "0.0" in archive_cmds due to quoting
2411 # problems, so we reset it completely
2412 verstring=""
2415 verstring="0.0"
2417 esac
2418 if test "$need_version" = no; then
2419 versuffix=
2420 else
2421 versuffix=".0.0"
2425 # Remove version info from name if versioning should be avoided
2426 if test "$avoid_version" = yes && test "$need_version" = no; then
2427 major=
2428 versuffix=
2429 verstring=""
2432 # Check to see if the archive will have undefined symbols.
2433 if test "$allow_undefined" = yes; then
2434 if test "$allow_undefined_flag" = unsupported; then
2435 $echo "$modename: warning: undefined symbols not allowed in $host shared libraries" 1>&2
2436 build_libtool_libs=no
2437 build_old_libs=yes
2439 else
2440 # Don't allow undefined symbols.
2441 allow_undefined_flag="$no_undefined_flag"
2445 if test "$mode" != relink; then
2446 # Remove our outputs.
2447 $show "${rm}r $output_objdir/$outputname $output_objdir/$libname.* $output_objdir/${libname}${release}.*"
2448 $run ${rm}r $output_objdir/$outputname $output_objdir/$libname.* $output_objdir/${libname}${release}.*
2451 # Now set the variables for building old libraries.
2452 if test "$build_old_libs" = yes && test "$build_libtool_libs" != convenience ; then
2453 oldlibs="$oldlibs $output_objdir/$libname.$libext"
2455 # Transform .lo files to .o files.
2456 oldobjs="$objs "`$echo "X$libobjs" | $SP2NL | $Xsed -e '/\.'${libext}'$/d' -e "$lo2o" | $NL2SP`
2459 # Eliminate all temporary directories.
2460 for path in $notinst_path; do
2461 lib_search_path=`echo "$lib_search_path " | ${SED} -e 's% $path % %g'`
2462 deplibs=`echo "$deplibs " | ${SED} -e 's% -L$path % %g'`
2463 dependency_libs=`echo "$dependency_libs " | ${SED} -e 's% -L$path % %g'`
2464 done
2466 if test -n "$xrpath"; then
2467 # If the user specified any rpath flags, then add them.
2468 temp_xrpath=
2469 for libdir in $xrpath; do
2470 temp_xrpath="$temp_xrpath -R$libdir"
2471 case "$finalize_rpath " in
2472 *" $libdir "*) ;;
2473 *) finalize_rpath="$finalize_rpath $libdir" ;;
2474 esac
2475 done
2476 if test $hardcode_into_libs != yes || test $build_old_libs = yes; then
2477 dependency_libs="$temp_xrpath $dependency_libs"
2481 # Make sure dlfiles contains only unique files that won't be dlpreopened
2482 old_dlfiles="$dlfiles"
2483 dlfiles=
2484 for lib in $old_dlfiles; do
2485 case " $dlprefiles $dlfiles " in
2486 *" $lib "*) ;;
2487 *) dlfiles="$dlfiles $lib" ;;
2488 esac
2489 done
2491 # Make sure dlprefiles contains only unique files
2492 old_dlprefiles="$dlprefiles"
2493 dlprefiles=
2494 for lib in $old_dlprefiles; do
2495 case "$dlprefiles " in
2496 *" $lib "*) ;;
2497 *) dlprefiles="$dlprefiles $lib" ;;
2498 esac
2499 done
2501 if test "$build_libtool_libs" = yes; then
2502 if test -n "$rpath"; then
2503 case $host in
2504 *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-*-beos*)
2505 # these systems don't actually have a c library (as such)!
2507 *-*-rhapsody* | *-*-darwin1.[012])
2508 # Rhapsody C library is in the System framework
2509 deplibs="$deplibs -framework System"
2511 *-*-netbsd*)
2512 # Don't link with libc until the a.out ld.so is fixed.
2514 *-*-openbsd* | *-*-freebsd*)
2515 # Do not include libc due to us having libc/libc_r.
2518 # Add libc to deplibs on all other systems if necessary.
2519 if test $build_libtool_need_lc = "yes"; then
2520 deplibs="$deplibs -lc"
2523 esac
2526 # Transform deplibs into only deplibs that can be linked in shared.
2527 name_save=$name
2528 libname_save=$libname
2529 release_save=$release
2530 versuffix_save=$versuffix
2531 major_save=$major
2532 # I'm not sure if I'm treating the release correctly. I think
2533 # release should show up in the -l (ie -lgmp5) so we don't want to
2534 # add it in twice. Is that correct?
2535 release=""
2536 versuffix=""
2537 major=""
2538 newdeplibs=
2539 droppeddeps=no
2540 case $deplibs_check_method in
2541 pass_all)
2542 # Don't check for shared/static. Everything works.
2543 # This might be a little naive. We might want to check
2544 # whether the library exists or not. But this is on
2545 # osf3 & osf4 and I'm not really sure... Just
2546 # implementing what was already the behaviour.
2547 newdeplibs=$deplibs
2549 test_compile)
2550 # This code stresses the "libraries are programs" paradigm to its
2551 # limits. Maybe even breaks it. We compile a program, linking it
2552 # against the deplibs as a proxy for the library. Then we can check
2553 # whether they linked in statically or dynamically with ldd.
2554 $rm conftest.c
2555 cat > conftest.c <<EOF
2556 int main() { return 0; }
2558 $rm conftest
2559 $CC -o conftest conftest.c $deplibs
2560 if test $? -eq 0 ; then
2561 ldd_output=`ldd conftest`
2562 for i in $deplibs; do
2563 name="`expr $i : '-l\(.*\)'`"
2564 # If $name is empty we are operating on a -L argument.
2565 if test -n "$name" && test "$name" != "0"; then
2566 libname=`eval \\$echo \"$libname_spec\"`
2567 deplib_matches=`eval \\$echo \"$library_names_spec\"`
2568 set dummy $deplib_matches
2569 deplib_match=$2
2570 if test `expr "$ldd_output" : ".*$deplib_match"` -ne 0 ; then
2571 newdeplibs="$newdeplibs $i"
2572 else
2573 droppeddeps=yes
2574 echo
2575 echo "*** Warning: dynamic linker does not accept needed library $i."
2576 echo "*** I have the capability to make that library automatically link in when"
2577 echo "*** you link to this library. But I can only do this if you have a"
2578 echo "*** shared version of the library, which I believe you do not have"
2579 echo "*** because a test_compile did reveal that the linker did not use it for"
2580 echo "*** its dynamic dependency list that programs get resolved with at runtime."
2582 else
2583 newdeplibs="$newdeplibs $i"
2585 done
2586 else
2587 # Error occured in the first compile. Let's try to salvage
2588 # the situation: Compile a separate program for each library.
2589 for i in $deplibs; do
2590 name="`expr $i : '-l\(.*\)'`"
2591 # If $name is empty we are operating on a -L argument.
2592 if test -n "$name" && test "$name" != "0"; then
2593 $rm conftest
2594 $CC -o conftest conftest.c $i
2595 # Did it work?
2596 if test $? -eq 0 ; then
2597 ldd_output=`ldd conftest`
2598 libname=`eval \\$echo \"$libname_spec\"`
2599 deplib_matches=`eval \\$echo \"$library_names_spec\"`
2600 set dummy $deplib_matches
2601 deplib_match=$2
2602 if test `expr "$ldd_output" : ".*$deplib_match"` -ne 0 ; then
2603 newdeplibs="$newdeplibs $i"
2604 else
2605 droppeddeps=yes
2606 echo
2607 echo "*** Warning: dynamic linker does not accept needed library $i."
2608 echo "*** I have the capability to make that library automatically link in when"
2609 echo "*** you link to this library. But I can only do this if you have a"
2610 echo "*** shared version of the library, which you do not appear to have"
2611 echo "*** because a test_compile did reveal that the linker did not use this one"
2612 echo "*** as a dynamic dependency that programs can get resolved with at runtime."
2614 else
2615 droppeddeps=yes
2616 echo
2617 echo "*** Warning! Library $i is needed by this library but I was not able to"
2618 echo "*** make it link in! You will probably need to install it or some"
2619 echo "*** library that it depends on before this library will be fully"
2620 echo "*** functional. Installing it before continuing would be even better."
2622 else
2623 newdeplibs="$newdeplibs $i"
2625 done
2628 file_magic*)
2629 set dummy $deplibs_check_method
2630 file_magic_regex=`expr "$deplibs_check_method" : "$2 \(.*\)"`
2631 for a_deplib in $deplibs; do
2632 name="`expr $a_deplib : '-l\(.*\)'`"
2633 # If $name is empty we are operating on a -L argument.
2634 if test -n "$name" && test "$name" != "0"; then
2635 libname=`eval \\$echo \"$libname_spec\"`
2636 for i in $lib_search_path $sys_lib_search_path $shlib_search_path; do
2637 potential_libs=`ls $i/$libname[.-]* 2>/dev/null`
2638 for potent_lib in $potential_libs; do
2639 # Follow soft links.
2640 if ls -lLd "$potent_lib" 2>/dev/null \
2641 | grep " -> " >/dev/null; then
2642 continue
2644 # The statement above tries to avoid entering an
2645 # endless loop below, in case of cyclic links.
2646 # We might still enter an endless loop, since a link
2647 # loop can be closed while we follow links,
2648 # but so what?
2649 potlib="$potent_lib"
2650 while test -h "$potlib" 2>/dev/null; do
2651 potliblink=`ls -ld $potlib | ${SED} 's/.* -> //'`
2652 case $potliblink in
2653 [\\/]* | [A-Za-z]:[\\/]*) potlib="$potliblink";;
2654 *) potlib=`$echo "X$potlib" | $Xsed -e 's,[^/]*$,,'`"$potliblink";;
2655 esac
2656 done
2657 # It is ok to link against an archive when
2658 # building a shared library.
2659 if $AR -t $potlib > /dev/null 2>&1; then
2660 newdeplibs="$newdeplibs $a_deplib"
2661 a_deplib=""
2662 break 2
2664 if eval $file_magic_cmd \"\$potlib\" 2>/dev/null \
2665 | ${SED} 10q \
2666 | egrep "$file_magic_regex" > /dev/null; then
2667 newdeplibs="$newdeplibs $a_deplib"
2668 a_deplib=""
2669 break 2
2671 done
2672 done
2673 if test -n "$a_deplib" ; then
2674 droppeddeps=yes
2675 echo
2676 echo "*** Warning: linker path does not have real file for library $a_deplib."
2677 echo "*** I have the capability to make that library automatically link in when"
2678 echo "*** you link to this library. But I can only do this if you have a"
2679 echo "*** shared version of the library, which you do not appear to have"
2680 echo "*** because I did check the linker path looking for a file starting"
2681 if test -z "$potlib" ; then
2682 echo "*** with $libname but no candidates were found. (...for file magic test)"
2683 else
2684 echo "*** with $libname and none of the candidates passed a file format test"
2685 echo "*** using a file magic. Last file checked: $potlib"
2688 else
2689 # Add a -L argument.
2690 newdeplibs="$newdeplibs $a_deplib"
2692 done # Gone through all deplibs.
2694 match_pattern*)
2695 set dummy $deplibs_check_method
2696 match_pattern_regex=`expr "$deplibs_check_method" : "$2 \(.*\)"`
2697 for a_deplib in $deplibs; do
2698 name="`expr $a_deplib : '-l\(.*\)'`"
2699 # If $name is empty we are operating on a -L argument.
2700 if test -n "$name" && test "$name" != "0"; then
2701 libname=`eval \\$echo \"$libname_spec\"`
2702 for i in $lib_search_path $sys_lib_search_path $shlib_search_path; do
2703 potential_libs=`ls $i/$libname[.-]* 2>/dev/null`
2704 for potent_lib in $potential_libs; do
2705 potlib="$potent_lib" # see symlink-check below in file_magic test
2706 if eval echo \"$potent_lib\" 2>/dev/null \
2707 | ${SED} 10q \
2708 | egrep "$match_pattern_regex" > /dev/null; then
2709 newdeplibs="$newdeplibs $a_deplib"
2710 a_deplib=""
2711 break 2
2713 done
2714 done
2715 if test -n "$a_deplib" ; then
2716 droppeddeps=yes
2717 echo
2718 echo "*** Warning: linker path does not have real file for library $a_deplib."
2719 echo "*** I have the capability to make that library automatically link in when"
2720 echo "*** you link to this library. But I can only do this if you have a"
2721 echo "*** shared version of the library, which you do not appear to have"
2722 echo "*** because I did check the linker path looking for a file starting"
2723 if test -z "$potlib" ; then
2724 echo "*** with $libname but no candidates were found. (...for regex pattern test)"
2725 else
2726 echo "*** with $libname and none of the candidates passed a file format test"
2727 echo "*** using a regex pattern. Last file checked: $potlib"
2730 else
2731 # Add a -L argument.
2732 newdeplibs="$newdeplibs $a_deplib"
2734 done # Gone through all deplibs.
2736 none | unknown | *)
2737 newdeplibs=""
2738 if $echo "X $deplibs" | $Xsed -e 's/ -lc$//' \
2739 -e 's/ -[LR][^ ]*//g' -e 's/[ ]//g' |
2740 grep . >/dev/null; then
2741 echo
2742 if test "X$deplibs_check_method" = "Xnone"; then
2743 echo "*** Warning: inter-library dependencies are not supported in this platform."
2744 else
2745 echo "*** Warning: inter-library dependencies are not known to be supported."
2747 echo "*** All declared inter-library dependencies are being dropped."
2748 droppeddeps=yes
2751 esac
2752 versuffix=$versuffix_save
2753 major=$major_save
2754 release=$release_save
2755 libname=$libname_save
2756 name=$name_save
2758 case $host in
2759 *-*-rhapsody* | *-*-darwin1.[012])
2760 # On Rhapsody replace the C library is the System framework
2761 newdeplibs=`$echo "X $newdeplibs" | $Xsed -e 's/ -lc / -framework System /'`
2763 esac
2765 if test "$droppeddeps" = yes; then
2766 if test "$module" = yes; then
2767 echo
2768 echo "*** Warning: libtool could not satisfy all declared inter-library"
2769 echo "*** dependencies of module $libname. Therefore, libtool will create"
2770 echo "*** a static module, that should work as long as the dlopening"
2771 echo "*** application is linked with the -dlopen flag."
2772 if test -z "$global_symbol_pipe"; then
2773 echo
2774 echo "*** However, this would only work if libtool was able to extract symbol"
2775 echo "*** lists from a program, using \`nm' or equivalent, but libtool could"
2776 echo "*** not find such a program. So, this module is probably useless."
2777 echo "*** \`nm' from GNU binutils and a full rebuild may help."
2779 if test "$build_old_libs" = no; then
2780 oldlibs="$output_objdir/$libname.$libext"
2781 build_libtool_libs=module
2782 build_old_libs=yes
2783 else
2784 build_libtool_libs=no
2786 else
2787 echo "*** The inter-library dependencies that have been dropped here will be"
2788 echo "*** automatically added whenever a program is linked with this library"
2789 echo "*** or is declared to -dlopen it."
2791 if test $allow_undefined = no; then
2792 echo
2793 echo "*** Since this library must not contain undefined symbols,"
2794 echo "*** because either the platform does not support them or"
2795 echo "*** it was explicitly requested with -no-undefined,"
2796 echo "*** libtool will only create a static version of it."
2797 if test "$build_old_libs" = no; then
2798 oldlibs="$output_objdir/$libname.$libext"
2799 build_libtool_libs=module
2800 build_old_libs=yes
2801 else
2802 build_libtool_libs=no
2807 # Done checking deplibs!
2808 deplibs=$newdeplibs
2811 # All the library-specific variables (install_libdir is set above).
2812 library_names=
2813 old_library=
2814 dlname=
2816 # Test again, we may have decided not to build it any more
2817 if test "$build_libtool_libs" = yes; then
2818 if test $hardcode_into_libs = yes; then
2819 # Hardcode the library paths
2820 hardcode_libdirs=
2821 dep_rpath=
2822 rpath="$finalize_rpath"
2823 test "$mode" != relink && rpath="$compile_rpath$rpath"
2824 for libdir in $rpath; do
2825 if test -n "$hardcode_libdir_flag_spec"; then
2826 if test -n "$hardcode_libdir_separator"; then
2827 if test -z "$hardcode_libdirs"; then
2828 hardcode_libdirs="$libdir"
2829 else
2830 # Just accumulate the unique libdirs.
2831 case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in
2832 *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*)
2835 hardcode_libdirs="$hardcode_libdirs$hardcode_libdir_separator$libdir"
2837 esac
2839 else
2840 eval flag=\"$hardcode_libdir_flag_spec\"
2841 dep_rpath="$dep_rpath $flag"
2843 elif test -n "$runpath_var"; then
2844 case "$perm_rpath " in
2845 *" $libdir "*) ;;
2846 *) perm_rpath="$perm_rpath $libdir" ;;
2847 esac
2849 done
2850 # Substitute the hardcoded libdirs into the rpath.
2851 if test -n "$hardcode_libdir_separator" &&
2852 test -n "$hardcode_libdirs"; then
2853 libdir="$hardcode_libdirs"
2854 eval dep_rpath=\"$hardcode_libdir_flag_spec\"
2856 if test -n "$runpath_var" && test -n "$perm_rpath"; then
2857 # We should set the runpath_var.
2858 rpath=
2859 for dir in $perm_rpath; do
2860 rpath="$rpath$dir:"
2861 done
2862 eval "$runpath_var='$rpath\$$runpath_var'; export $runpath_var"
2864 test -n "$dep_rpath" && deplibs="$dep_rpath $deplibs"
2867 shlibpath="$finalize_shlibpath"
2868 test "$mode" != relink && shlibpath="$compile_shlibpath$shlibpath"
2869 if test -n "$shlibpath"; then
2870 eval "$shlibpath_var='$shlibpath\$$shlibpath_var'; export $shlibpath_var"
2873 # Get the real and link names of the library.
2874 eval library_names=\"$library_names_spec\"
2875 set dummy $library_names
2876 realname="$2"
2877 shift; shift
2879 if test -n "$soname_spec"; then
2880 eval soname=\"$soname_spec\"
2881 else
2882 soname="$realname"
2884 test -z "$dlname" && dlname=$soname
2886 lib="$output_objdir/$realname"
2887 for link
2889 linknames="$linknames $link"
2890 done
2892 # Ensure that we have .o objects for linkers which dislike .lo
2893 # (e.g. aix) in case we are running --disable-static
2894 for obj in $libobjs; do
2895 xdir=`$echo "X$obj" | $Xsed -e 's%/[^/]*$%%'`
2896 if test "X$xdir" = "X$obj"; then
2897 xdir="."
2898 else
2899 xdir="$xdir"
2901 baseobj=`$echo "X$obj" | $Xsed -e 's%^.*/%%'`
2902 oldobj=`$echo "X$baseobj" | $Xsed -e "$lo2o"`
2903 if test ! -f $xdir/$oldobj; then
2904 $show "(cd $xdir && ${LN_S} $baseobj $oldobj)"
2905 $run eval '(cd $xdir && ${LN_S} $baseobj $oldobj)' || exit $?
2907 done
2909 # Use standard objects if they are pic
2910 test -z "$pic_flag" && libobjs=`$echo "X$libobjs" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP`
2912 # Prepare the list of exported symbols
2913 if test -z "$export_symbols"; then
2914 if test "$always_export_symbols" = yes || test -n "$export_symbols_regex"; then
2915 $show "generating symbol list for \`$libname.la'"
2916 export_symbols="$output_objdir/$libname.exp"
2917 $run $rm $export_symbols
2918 eval cmds=\"$export_symbols_cmds\"
2919 save_ifs="$IFS"; IFS='~'
2920 for cmd in $cmds; do
2921 IFS="$save_ifs"
2922 $show "$cmd"
2923 $run eval "$cmd" || exit $?
2924 done
2925 IFS="$save_ifs"
2926 if test -n "$export_symbols_regex"; then
2927 $show "egrep -e \"$export_symbols_regex\" \"$export_symbols\" > \"${export_symbols}T\""
2928 $run eval 'egrep -e "$export_symbols_regex" "$export_symbols" > "${export_symbols}T"'
2929 $show "$mv \"${export_symbols}T\" \"$export_symbols\""
2930 $run eval '$mv "${export_symbols}T" "$export_symbols"'
2935 if test -n "$export_symbols" && test -n "$include_expsyms"; then
2936 $run eval '$echo "X$include_expsyms" | $SP2NL >> "$export_symbols"'
2939 if test -n "$convenience"; then
2940 if test -n "$whole_archive_flag_spec"; then
2941 eval libobjs=\"\$libobjs $whole_archive_flag_spec\"
2942 else
2943 gentop="$output_objdir/${outputname}x"
2944 $show "${rm}r $gentop"
2945 $run ${rm}r "$gentop"
2946 $show "mkdir $gentop"
2947 $run mkdir "$gentop"
2948 status=$?
2949 if test $status -ne 0 && test ! -d "$gentop"; then
2950 exit $status
2952 generated="$generated $gentop"
2954 for xlib in $convenience; do
2955 # Extract the objects.
2956 case $xlib in
2957 [\\/]* | [A-Za-z]:[\\/]*) xabs="$xlib" ;;
2958 *) xabs=`pwd`"/$xlib" ;;
2959 esac
2960 xlib=`$echo "X$xlib" | $Xsed -e 's%^.*/%%'`
2961 xdir="$gentop/$xlib"
2963 $show "${rm}r $xdir"
2964 $run ${rm}r "$xdir"
2965 $show "mkdir $xdir"
2966 $run mkdir "$xdir"
2967 status=$?
2968 if test $status -ne 0 && test ! -d "$xdir"; then
2969 exit $status
2971 $show "(cd $xdir && $AR x $xabs)"
2972 $run eval "(cd \$xdir && $AR x \$xabs)" || exit $?
2974 libobjs="$libobjs "`find $xdir -name \*.o -print -o -name \*.lo -print | $NL2SP`
2975 done
2979 if test "$thread_safe" = yes && test -n "$thread_safe_flag_spec"; then
2980 eval flag=\"$thread_safe_flag_spec\"
2981 linker_flags="$linker_flags $flag"
2984 # Make a backup of the uninstalled library when relinking
2985 if test "$mode" = relink; then
2986 $run eval '(cd $output_objdir && $rm ${realname}U && $mv $realname ${realname}U)' || exit $?
2989 # Do each of the archive commands.
2990 if test -n "$export_symbols" && test -n "$archive_expsym_cmds"; then
2991 eval cmds=\"$archive_expsym_cmds\"
2992 else
2993 save_deplibs="$deplibs"
2994 for conv in $convenience; do
2995 tmp_deplibs=
2996 for test_deplib in $deplibs; do
2997 if test "$test_deplib" != "$conv"; then
2998 tmp_deplibs="$tmp_deplibs $test_deplib"
3000 done
3001 deplibs="$tmp_deplibs"
3002 done
3003 eval cmds=\"$archive_cmds\"
3004 deplibs="$save_deplibs"
3006 save_ifs="$IFS"; IFS='~'
3007 for cmd in $cmds; do
3008 IFS="$save_ifs"
3009 $show "$cmd"
3010 $run eval "$cmd" || exit $?
3011 done
3012 IFS="$save_ifs"
3014 # Restore the uninstalled library and exit
3015 if test "$mode" = relink; then
3016 $run eval '(cd $output_objdir && $rm ${realname}T && $mv $realname ${realname}T && $mv "$realname"U $realname)' || exit $?
3017 exit 0
3020 # Create links to the real library.
3021 for linkname in $linknames; do
3022 if test "$realname" != "$linkname"; then
3023 $show "(cd $output_objdir && $rm $linkname && $LN_S $realname $linkname)"
3024 $run eval '(cd $output_objdir && $rm $linkname && $LN_S $realname $linkname)' || exit $?
3026 done
3028 # If -module or -export-dynamic was specified, set the dlname.
3029 if test "$module" = yes || test "$export_dynamic" = yes; then
3030 # On all known operating systems, these are identical.
3031 dlname="$soname"
3036 obj)
3037 if test -n "$deplibs"; then
3038 $echo "$modename: warning: \`-l' and \`-L' are ignored for objects" 1>&2
3041 if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then
3042 $echo "$modename: warning: \`-dlopen' is ignored for objects" 1>&2
3045 if test -n "$rpath"; then
3046 $echo "$modename: warning: \`-rpath' is ignored for objects" 1>&2
3049 if test -n "$xrpath"; then
3050 $echo "$modename: warning: \`-R' is ignored for objects" 1>&2
3053 if test -n "$vinfo"; then
3054 $echo "$modename: warning: \`-version-info' is ignored for objects" 1>&2
3057 if test -n "$release"; then
3058 $echo "$modename: warning: \`-release' is ignored for objects" 1>&2
3061 case $output in
3062 *.lo)
3063 if test -n "$objs$old_deplibs"; then
3064 $echo "$modename: cannot build library object \`$output' from non-libtool objects" 1>&2
3065 exit 1
3067 libobj="$output"
3068 obj=`$echo "X$output" | $Xsed -e "$lo2o"`
3071 libobj=
3072 obj="$output"
3074 esac
3076 # Delete the old objects.
3077 $run $rm $obj $libobj
3079 # Objects from convenience libraries. This assumes
3080 # single-version convenience libraries. Whenever we create
3081 # different ones for PIC/non-PIC, this we'll have to duplicate
3082 # the extraction.
3083 reload_conv_objs=
3084 gentop=
3085 # reload_cmds runs $LD directly, so let us get rid of
3086 # -Wl from whole_archive_flag_spec
3089 if test -n "$convenience"; then
3090 if test -n "$whole_archive_flag_spec"; then
3091 eval reload_conv_objs=\"\$reload_objs $whole_archive_flag_spec\"
3092 else
3093 gentop="$output_objdir/${obj}x"
3094 $show "${rm}r $gentop"
3095 $run ${rm}r "$gentop"
3096 $show "mkdir $gentop"
3097 $run mkdir "$gentop"
3098 status=$?
3099 if test $status -ne 0 && test ! -d "$gentop"; then
3100 exit $status
3102 generated="$generated $gentop"
3104 for xlib in $convenience; do
3105 # Extract the objects.
3106 case $xlib in
3107 [\\/]* | [A-Za-z]:[\\/]*) xabs="$xlib" ;;
3108 *) xabs=`pwd`"/$xlib" ;;
3109 esac
3110 xlib=`$echo "X$xlib" | $Xsed -e 's%^.*/%%'`
3111 xdir="$gentop/$xlib"
3113 $show "${rm}r $xdir"
3114 $run ${rm}r "$xdir"
3115 $show "mkdir $xdir"
3116 $run mkdir "$xdir"
3117 status=$?
3118 if test $status -ne 0 && test ! -d "$xdir"; then
3119 exit $status
3121 $show "(cd $xdir && $AR x $xabs)"
3122 $run eval "(cd \$xdir && $AR x \$xabs)" || exit $?
3124 reload_conv_objs="$reload_objs "`find $xdir -name \*.o -print -o -name \*.lo -print | $NL2SP`
3125 done
3129 # Create the old-style object.
3130 reload_objs="$objs$old_deplibs "`$echo "X$libobjs" | $SP2NL | $Xsed -e '/\.'${libext}$'/d' -e '/\.lib$/d' -e "$lo2o" | $NL2SP`" $reload_conv_objs" ### testsuite: skip nested quoting test
3132 output="$obj"
3133 eval cmds=\"$reload_cmds\"
3134 save_ifs="$IFS"; IFS='~'
3135 for cmd in $cmds; do
3136 IFS="$save_ifs"
3137 $show "$cmd"
3138 $run eval "$cmd" || exit $?
3139 done
3140 IFS="$save_ifs"
3142 # Exit if we aren't doing a library object file.
3143 if test -z "$libobj"; then
3144 if test -n "$gentop"; then
3145 $show "${rm}r $gentop"
3146 $run ${rm}r $gentop
3149 exit 0
3152 if test "$build_libtool_libs" != yes; then
3153 if test -n "$gentop"; then
3154 $show "${rm}r $gentop"
3155 $run ${rm}r $gentop
3158 # Create an invalid libtool object if no PIC, so that we don't
3159 # accidentally link it into a program.
3160 $show "echo timestamp > $libobj"
3161 $run eval "echo timestamp > $libobj" || exit $?
3162 exit 0
3165 if test -n "$pic_flag" || test "$pic_mode" != default; then
3166 # Only do commands if we really have different PIC objects.
3167 reload_objs="$libobjs $reload_conv_objs"
3168 output="$libobj"
3169 eval cmds=\"$reload_cmds\"
3170 save_ifs="$IFS"; IFS='~'
3171 for cmd in $cmds; do
3172 IFS="$save_ifs"
3173 $show "$cmd"
3174 $run eval "$cmd" || exit $?
3175 done
3176 IFS="$save_ifs"
3177 else
3178 # Just create a symlink.
3179 $show $rm $libobj
3180 $run $rm $libobj
3181 xdir=`$echo "X$libobj" | $Xsed -e 's%/[^/]*$%%'`
3182 if test "X$xdir" = "X$libobj"; then
3183 xdir="."
3184 else
3185 xdir="$xdir"
3187 baseobj=`$echo "X$libobj" | $Xsed -e 's%^.*/%%'`
3188 oldobj=`$echo "X$baseobj" | $Xsed -e "$lo2o"`
3189 $show "(cd $xdir && $LN_S $oldobj $baseobj)"
3190 $run eval '(cd $xdir && $LN_S $oldobj $baseobj)' || exit $?
3193 if test -n "$gentop"; then
3194 $show "${rm}r $gentop"
3195 $run ${rm}r $gentop
3198 exit 0
3201 prog)
3202 case $host in
3203 *cygwin*) output=`echo $output | ${SED} -e 's,.exe$,,;s,$,.exe,'` ;;
3204 esac
3205 if test -n "$vinfo"; then
3206 $echo "$modename: warning: \`-version-info' is ignored for programs" 1>&2
3209 if test -n "$release"; then
3210 $echo "$modename: warning: \`-release' is ignored for programs" 1>&2
3213 if test "$preload" = yes; then
3214 if test "$dlopen_support" = unknown && test "$dlopen_self" = unknown &&
3215 test "$dlopen_self_static" = unknown; then
3216 $echo "$modename: warning: \`AC_LIBTOOL_DLOPEN' not used. Assuming no dlopen support."
3220 case $host in
3221 *-*-rhapsody* | *-*-darwin1.[012])
3222 # On Rhapsody replace the C library is the System framework
3223 compile_deplibs=`$echo "X $compile_deplibs" | $Xsed -e 's/ -lc / -framework System /'`
3224 finalize_deplibs=`$echo "X $finalize_deplibs" | $Xsed -e 's/ -lc / -framework System /'`
3225 case $host in
3226 *darwin*)
3227 # Don't allow lazy linking, it breaks C++ global constructors
3228 compile_command="$compile_command ${wl}-bind_at_load"
3229 finalize_command="$finalize_command ${wl}-bind_at_load"
3231 esac
3233 esac
3235 compile_command="$compile_command $compile_deplibs"
3236 finalize_command="$finalize_command $finalize_deplibs"
3238 if test -n "$rpath$xrpath"; then
3239 # If the user specified any rpath flags, then add them.
3240 for libdir in $rpath $xrpath; do
3241 # This is the magic to use -rpath.
3242 case "$finalize_rpath " in
3243 *" $libdir "*) ;;
3244 *) finalize_rpath="$finalize_rpath $libdir" ;;
3245 esac
3246 done
3249 # Now hardcode the library paths
3250 rpath=
3251 hardcode_libdirs=
3252 for libdir in $compile_rpath $finalize_rpath; do
3253 if test -n "$hardcode_libdir_flag_spec"; then
3254 if test -n "$hardcode_libdir_separator"; then
3255 if test -z "$hardcode_libdirs"; then
3256 hardcode_libdirs="$libdir"
3257 else
3258 # Just accumulate the unique libdirs.
3259 case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in
3260 *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*)
3263 hardcode_libdirs="$hardcode_libdirs$hardcode_libdir_separator$libdir"
3265 esac
3267 else
3268 eval flag=\"$hardcode_libdir_flag_spec\"
3269 rpath="$rpath $flag"
3271 elif test -n "$runpath_var"; then
3272 case "$perm_rpath " in
3273 *" $libdir "*) ;;
3274 *) perm_rpath="$perm_rpath $libdir" ;;
3275 esac
3277 case $host in
3278 *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2*)
3279 case :$dllsearchpath: in
3280 *":$libdir:"*) ;;
3281 *) dllsearchpath="$dllsearchpath:$libdir";;
3282 esac
3284 esac
3285 done
3286 # Substitute the hardcoded libdirs into the rpath.
3287 if test -n "$hardcode_libdir_separator" &&
3288 test -n "$hardcode_libdirs"; then
3289 libdir="$hardcode_libdirs"
3290 eval rpath=\" $hardcode_libdir_flag_spec\"
3292 compile_rpath="$rpath"
3294 rpath=
3295 hardcode_libdirs=
3296 for libdir in $finalize_rpath; do
3297 if test -n "$hardcode_libdir_flag_spec"; then
3298 if test -n "$hardcode_libdir_separator"; then
3299 if test -z "$hardcode_libdirs"; then
3300 hardcode_libdirs="$libdir"
3301 else
3302 # Just accumulate the unique libdirs.
3303 case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in
3304 *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*)
3307 hardcode_libdirs="$hardcode_libdirs$hardcode_libdir_separator$libdir"
3309 esac
3311 else
3312 eval flag=\"$hardcode_libdir_flag_spec\"
3313 rpath="$rpath $flag"
3315 elif test -n "$runpath_var"; then
3316 case "$finalize_perm_rpath " in
3317 *" $libdir "*) ;;
3318 *) finalize_perm_rpath="$finalize_perm_rpath $libdir" ;;
3319 esac
3321 done
3322 # Substitute the hardcoded libdirs into the rpath.
3323 if test -n "$hardcode_libdir_separator" &&
3324 test -n "$hardcode_libdirs"; then
3325 libdir="$hardcode_libdirs"
3326 eval rpath=\" $hardcode_libdir_flag_spec\"
3328 finalize_rpath="$rpath"
3330 if test -n "$libobjs" && test "$build_old_libs" = yes; then
3331 # Transform all the library objects into standard objects.
3332 compile_command=`$echo "X$compile_command" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP`
3333 finalize_command=`$echo "X$finalize_command" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP`
3336 dlsyms=
3337 if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then
3338 if test -n "$NM" && test -n "$global_symbol_pipe"; then
3339 dlsyms="${outputname}S.c"
3340 else
3341 $echo "$modename: not configured to extract global symbols from dlpreopened files" 1>&2
3345 if test -n "$dlsyms"; then
3346 case $dlsyms in
3347 "") ;;
3348 *.c)
3349 # Discover the nlist of each of the dlfiles.
3350 nlist="$output_objdir/${outputname}.nm"
3352 $show "$rm $nlist ${nlist}S ${nlist}T"
3353 $run $rm "$nlist" "${nlist}S" "${nlist}T"
3355 # Parse the name list into a source file.
3356 $show "creating $output_objdir/$dlsyms"
3358 test -z "$run" && $echo > "$output_objdir/$dlsyms" "\
3359 /* $dlsyms - symbol resolution table for \`$outputname' dlsym emulation. */
3360 /* Generated by $PROGRAM - GNU $PACKAGE $VERSION$TIMESTAMP */
3362 #ifdef __cplusplus
3363 extern \"C\" {
3364 #endif
3366 /* Prevent the only kind of declaration conflicts we can make. */
3367 #define lt_preloaded_symbols some_other_symbol
3369 /* External symbol declarations for the compiler. */\
3372 if test "$dlself" = yes; then
3373 $show "generating symbol list for \`$output'"
3375 test -z "$run" && $echo ': @PROGRAM@ ' > "$nlist"
3377 # Add our own program objects to the symbol list.
3378 progfiles=`$echo "X$objs$old_deplibs" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP`
3379 for arg in $progfiles; do
3380 $show "extracting global C symbols from \`$arg'"
3381 $run eval "$NM $arg | $global_symbol_pipe >> '$nlist'"
3382 done
3384 if test -n "$exclude_expsyms"; then
3385 $run eval 'egrep -v " ($exclude_expsyms)$" "$nlist" > "$nlist"T'
3386 $run eval '$mv "$nlist"T "$nlist"'
3389 if test -n "$export_symbols_regex"; then
3390 $run eval 'egrep -e "$export_symbols_regex" "$nlist" > "$nlist"T'
3391 $run eval '$mv "$nlist"T "$nlist"'
3394 # Prepare the list of exported symbols
3395 if test -z "$export_symbols"; then
3396 export_symbols="$output_objdir/$output.exp"
3397 $run $rm $export_symbols
3398 $run eval "${SED} -n -e '/^: @PROGRAM@$/d' -e 's/^.* \(.*\)$/\1/p' "'< "$nlist" > "$export_symbols"'
3399 else
3400 $run eval "${SED} -e 's/\([][.*^$]\)/\\\1/g' -e 's/^/ /' -e 's/$/$/'"' < "$export_symbols" > "$output_objdir/$output.exp"'
3401 $run eval 'grep -f "$output_objdir/$output.exp" < "$nlist" > "$nlist"T'
3402 $run eval 'mv "$nlist"T "$nlist"'
3406 for arg in $dlprefiles; do
3407 $show "extracting global C symbols from \`$arg'"
3408 name=`echo "$arg" | ${SED} -e 's%^.*/%%'`
3409 $run eval 'echo ": $name " >> "$nlist"'
3410 $run eval "$NM $arg | $global_symbol_pipe >> '$nlist'"
3411 done
3413 if test -z "$run"; then
3414 # Make sure we have at least an empty file.
3415 test -f "$nlist" || : > "$nlist"
3417 if test -n "$exclude_expsyms"; then
3418 egrep -v " ($exclude_expsyms)$" "$nlist" > "$nlist"T
3419 $mv "$nlist"T "$nlist"
3422 # Try sorting and uniquifying the output.
3423 if grep -v "^: " < "$nlist" |
3424 if sort -k 3 </dev/null >/dev/null 2>&1; then
3425 sort -k 3
3426 else
3427 sort +2
3428 fi |
3429 uniq > "$nlist"S; then
3431 else
3432 grep -v "^: " < "$nlist" > "$nlist"S
3435 if test -f "$nlist"S; then
3436 eval "$global_symbol_to_cdecl"' < "$nlist"S >> "$output_objdir/$dlsyms"'
3437 else
3438 echo '/* NONE */' >> "$output_objdir/$dlsyms"
3441 $echo >> "$output_objdir/$dlsyms" "\
3443 #undef lt_preloaded_symbols
3445 #if defined (__STDC__) && __STDC__
3446 # define lt_ptr void *
3447 #else
3448 # define lt_ptr char *
3449 # define const
3450 #endif
3452 /* The mapping between symbol names and symbols. */
3453 const struct {
3454 const char *name;
3455 lt_ptr address;
3457 lt_preloaded_symbols[] =
3461 eval "$global_symbol_to_c_name_address" < "$nlist" >> "$output_objdir/$dlsyms"
3463 $echo >> "$output_objdir/$dlsyms" "\
3464 {0, (lt_ptr) 0}
3467 /* This works around a problem in FreeBSD linker */
3468 #ifdef FREEBSD_WORKAROUND
3469 static const void *lt_preloaded_setup() {
3470 return lt_preloaded_symbols;
3472 #endif
3474 #ifdef __cplusplus
3476 #endif\
3480 pic_flag_for_symtable=
3481 case $host in
3482 # compiling the symbol table file with pic_flag works around
3483 # a FreeBSD bug that causes programs to crash when -lm is
3484 # linked before any other PIC object. But we must not use
3485 # pic_flag when linking with -static. The problem exists in
3486 # FreeBSD 2.2.6 and is fixed in FreeBSD 3.1.
3487 *-*-freebsd2*|*-*-freebsd3.0*|*-*-freebsdelf3.0*)
3488 case "$compile_command " in
3489 *" -static "*) ;;
3490 *) pic_flag_for_symtable=" $pic_flag -DPIC -DFREEBSD_WORKAROUND";;
3491 esac;;
3492 *-*-hpux*)
3493 case "$compile_command " in
3494 *" -static "*) ;;
3495 *) pic_flag_for_symtable=" $pic_flag -DPIC";;
3496 esac
3497 esac
3499 # Now compile the dynamic symbol file.
3500 $show "(cd $output_objdir && $CC -c$no_builtin_flag$pic_flag_for_symtable \"$dlsyms\")"
3501 $run eval '(cd $output_objdir && $CC -c$no_builtin_flag$pic_flag_for_symtable "$dlsyms")' || exit $?
3503 # Clean up the generated files.
3504 $show "$rm $output_objdir/$dlsyms $nlist ${nlist}S ${nlist}T"
3505 $run $rm "$output_objdir/$dlsyms" "$nlist" "${nlist}S" "${nlist}T"
3507 # Transform the symbol file into the correct name.
3508 compile_command=`$echo "X$compile_command" | $Xsed -e "s%@SYMFILE@%$output_objdir/${outputname}S.${objext}%"`
3509 finalize_command=`$echo "X$finalize_command" | $Xsed -e "s%@SYMFILE@%$output_objdir/${outputname}S.${objext}%"`
3512 $echo "$modename: unknown suffix for \`$dlsyms'" 1>&2
3513 exit 1
3515 esac
3516 else
3517 # We keep going just in case the user didn't refer to
3518 # lt_preloaded_symbols. The linker will fail if global_symbol_pipe
3519 # really was required.
3521 # Nullify the symbol file.
3522 compile_command=`$echo "X$compile_command" | $Xsed -e "s% @SYMFILE@%%"`
3523 finalize_command=`$echo "X$finalize_command" | $Xsed -e "s% @SYMFILE@%%"`
3526 if test $need_relink = no || test "$build_libtool_libs" != yes; then
3527 # Replace the output file specification.
3528 compile_command=`$echo "X$compile_command" | $Xsed -e 's%@OUTPUT@%'"$output"'%g'`
3529 link_command="$compile_command$compile_rpath"
3531 # We have no uninstalled library dependencies, so finalize right now.
3532 $show "$link_command"
3533 $run eval "$link_command"
3534 status=$?
3536 # Delete the generated files.
3537 if test -n "$dlsyms"; then
3538 $show "$rm $output_objdir/${outputname}S.${objext}"
3539 $run $rm "$output_objdir/${outputname}S.${objext}"
3542 exit $status
3545 if test -n "$shlibpath_var"; then
3546 # We should set the shlibpath_var
3547 rpath=
3548 for dir in $temp_rpath; do
3549 case $dir in
3550 [\\/]* | [A-Za-z]:[\\/]*)
3551 # Absolute path.
3552 rpath="$rpath$dir:"
3555 # Relative path: add a thisdir entry.
3556 rpath="$rpath\$thisdir/$dir:"
3558 esac
3559 done
3560 temp_rpath="$rpath"
3563 if test -n "$compile_shlibpath$finalize_shlibpath"; then
3564 compile_command="$shlibpath_var=\"$compile_shlibpath$finalize_shlibpath\$$shlibpath_var\" $compile_command"
3566 if test -n "$finalize_shlibpath"; then
3567 finalize_command="$shlibpath_var=\"$finalize_shlibpath\$$shlibpath_var\" $finalize_command"
3570 compile_var=
3571 finalize_var=
3572 if test -n "$runpath_var"; then
3573 if test -n "$perm_rpath"; then
3574 # We should set the runpath_var.
3575 rpath=
3576 for dir in $perm_rpath; do
3577 rpath="$rpath$dir:"
3578 done
3579 compile_var="$runpath_var=\"$rpath\$$runpath_var\" "
3581 if test -n "$finalize_perm_rpath"; then
3582 # We should set the runpath_var.
3583 rpath=
3584 for dir in $finalize_perm_rpath; do
3585 rpath="$rpath$dir:"
3586 done
3587 finalize_var="$runpath_var=\"$rpath\$$runpath_var\" "
3591 if test "$no_install" = yes; then
3592 # We don't need to create a wrapper script.
3593 link_command="$compile_var$compile_command$compile_rpath"
3594 # Replace the output file specification.
3595 link_command=`$echo "X$link_command" | $Xsed -e 's%@OUTPUT@%'"$output"'%g'`
3596 # Delete the old output file.
3597 $run $rm $output
3598 # Link the executable and exit
3599 $show "$link_command"
3600 $run eval "$link_command" || exit $?
3601 exit 0
3604 if test "$hardcode_action" = relink; then
3605 # Fast installation is not supported
3606 link_command="$compile_var$compile_command$compile_rpath"
3607 relink_command="$finalize_var$finalize_command$finalize_rpath"
3609 $echo "$modename: warning: this platform does not like uninstalled shared libraries" 1>&2
3610 $echo "$modename: \`$output' will be relinked during installation" 1>&2
3611 else
3612 if test "$fast_install" != no; then
3613 link_command="$finalize_var$compile_command$finalize_rpath"
3614 if test "$fast_install" = yes; then
3615 relink_command=`$echo "X$compile_var$compile_command$compile_rpath" | $Xsed -e 's%@OUTPUT@%\$progdir/\$file%g'`
3616 else
3617 # fast_install is set to needless
3618 relink_command=
3620 else
3621 link_command="$compile_var$compile_command$compile_rpath"
3622 relink_command="$finalize_var$finalize_command$finalize_rpath"
3626 # Replace the output file specification.
3627 link_command=`$echo "X$link_command" | $Xsed -e 's%@OUTPUT@%'"$output_objdir/$outputname"'%g'`
3629 # Delete the old output files.
3630 $run $rm $output $output_objdir/$outputname $output_objdir/lt-$outputname
3632 $show "$link_command"
3633 $run eval "$link_command" || exit $?
3635 # Now create the wrapper script.
3636 $show "creating $output"
3638 # Quote the relink command for shipping.
3639 if test -n "$relink_command"; then
3640 # Preserve any variables that may affect compiler behavior
3641 for var in $variables_saved_for_relink; do
3642 if eval test -z \"\${$var+set}\"; then
3643 relink_command="{ test -z \"\${$var+set}\" || unset $var || { $var=; export $var; }; }; $relink_command"
3644 elif eval var_value=\$$var; test -z "$var_value"; then
3645 relink_command="$var=; export $var; $relink_command"
3646 else
3647 var_value=`$echo "X$var_value" | $Xsed -e "$sed_quote_subst"`
3648 relink_command="$var=\"$var_value\"; export $var; $relink_command"
3650 done
3651 relink_command="(cd `pwd`; $relink_command)"
3652 relink_command=`$echo "X$relink_command" | $Xsed -e "$sed_quote_subst"`
3655 # Quote $echo for shipping.
3656 if test "X$echo" = "X$SHELL $0 --fallback-echo"; then
3657 case $0 in
3658 [\\/]* | [A-Za-z]:[\\/]*) qecho="$SHELL $0 --fallback-echo";;
3659 *) qecho="$SHELL `pwd`/$0 --fallback-echo";;
3660 esac
3661 qecho=`$echo "X$qecho" | $Xsed -e "$sed_quote_subst"`
3662 else
3663 qecho=`$echo "X$echo" | $Xsed -e "$sed_quote_subst"`
3666 # Only actually do things if our run command is non-null.
3667 if test -z "$run"; then
3668 # win32 will think the script is a binary if it has
3669 # a .exe suffix, so we strip it off here.
3670 case $output in
3671 *.exe) output=`echo $output|${SED} 's,.exe$,,'` ;;
3672 esac
3673 # test for cygwin because mv fails w/o .exe extensions
3674 case $host in
3675 *cygwin*) exeext=.exe ;;
3676 *) exeext= ;;
3677 esac
3678 $rm $output
3679 trap "$rm $output; exit 1" 1 2 15
3681 $echo > $output "\
3682 #! $SHELL
3684 # $output - temporary wrapper script for $objdir/$outputname
3685 # Generated by $PROGRAM - GNU $PACKAGE $VERSION$TIMESTAMP
3687 # The $output program cannot be directly executed until all the libtool
3688 # libraries that it depends on are installed.
3690 # This wrapper script should never be moved out of the build directory.
3691 # If it is, it will not operate correctly.
3693 # Sed substitution that helps us do robust quoting. It backslashifies
3694 # metacharacters that are still active within double-quoted strings.
3695 Xsed="${SED}"' -e 1s/^X//'
3696 sed_quote_subst='$sed_quote_subst'
3698 # The HP-UX ksh and POSIX shell print the target directory to stdout
3699 # if CDPATH is set.
3700 if test \"\${CDPATH+set}\" = set; then CDPATH=:; export CDPATH; fi
3702 relink_command=\"$relink_command\"
3704 # This environment variable determines our operation mode.
3705 if test \"\$libtool_install_magic\" = \"$magic\"; then
3706 # install mode needs the following variable:
3707 notinst_deplibs='$notinst_deplibs'
3708 else
3709 # When we are sourced in execute mode, \$file and \$echo are already set.
3710 if test \"\$libtool_execute_magic\" != \"$magic\"; then
3711 echo=\"$qecho\"
3712 file=\"\$0\"
3713 # Make sure echo works.
3714 if test \"X\$1\" = X--no-reexec; then
3715 # Discard the --no-reexec flag, and continue.
3716 shift
3717 elif test \"X\`(\$echo '\t') 2>/dev/null\`\" = 'X\t'; then
3718 # Yippee, \$echo works!
3720 else
3721 # Restart under the correct shell, and then maybe \$echo will work.
3722 exec $SHELL \"\$0\" --no-reexec \${1+\"\$@\"}
3726 $echo >> $output "\
3728 # Find the directory that this script lives in.
3729 thisdir=\`\$echo \"X\$file\" | \$Xsed -e 's%/[^/]*$%%'\`
3730 test \"x\$thisdir\" = \"x\$file\" && thisdir=.
3732 # Follow symbolic links until we get to the real thisdir.
3733 file=\`ls -ld \"\$file\" | ${SED} -n 's/.*-> //p'\`
3734 while test -n \"\$file\"; do
3735 destdir=\`\$echo \"X\$file\" | \$Xsed -e 's%/[^/]*\$%%'\`
3737 # If there was a directory component, then change thisdir.
3738 if test \"x\$destdir\" != \"x\$file\"; then
3739 case \"\$destdir\" in
3740 [\\\\/]* | [A-Za-z]:[\\\\/]*) thisdir=\"\$destdir\" ;;
3741 *) thisdir=\"\$thisdir/\$destdir\" ;;
3742 esac
3745 file=\`\$echo \"X\$file\" | \$Xsed -e 's%^.*/%%'\`
3746 file=\`ls -ld \"\$thisdir/\$file\" | ${SED} -n 's/.*-> //p'\`
3747 done
3749 # Try to get the absolute directory name.
3750 absdir=\`cd \"\$thisdir\" && pwd\`
3751 test -n \"\$absdir\" && thisdir=\"\$absdir\"
3754 if test "$fast_install" = yes; then
3755 echo >> $output "\
3756 program=lt-'$outputname'$exeext
3757 progdir=\"\$thisdir/$objdir\"
3759 if test ! -f \"\$progdir/\$program\" || \\
3760 { file=\`ls -1dt \"\$progdir/\$program\" \"\$progdir/../\$program\" 2>/dev/null | ${SED} 1q\`; \\
3761 test \"X\$file\" != \"X\$progdir/\$program\"; }; then
3763 file=\"\$\$-\$program\"
3765 if test ! -d \"\$progdir\"; then
3766 $mkdir \"\$progdir\"
3767 else
3768 $rm \"\$progdir/\$file\"
3771 echo >> $output "\
3773 # relink executable if necessary
3774 if test -n \"\$relink_command\"; then
3775 if relink_command_output=\`eval \$relink_command 2>&1\`; then :
3776 else
3777 $echo \"\$relink_command_output\" >&2
3778 $rm \"\$progdir/\$file\"
3779 exit 1
3783 $mv \"\$progdir/\$file\" \"\$progdir/\$program\" 2>/dev/null ||
3784 { $rm \"\$progdir/\$program\";
3785 $mv \"\$progdir/\$file\" \"\$progdir/\$program\"; }
3786 $rm \"\$progdir/\$file\"
3788 else
3789 echo >> $output "\
3790 program='$outputname'
3791 progdir=\"\$thisdir/$objdir\"
3795 echo >> $output "\
3797 if test -f \"\$progdir/\$program\"; then"
3799 # Export our shlibpath_var if we have one.
3800 if test "$shlibpath_overrides_runpath" = yes && test -n "$shlibpath_var" && test -n "$temp_rpath"; then
3801 $echo >> $output "\
3802 # Add our own library path to $shlibpath_var
3803 $shlibpath_var=\"$temp_rpath\$$shlibpath_var\"
3805 # Some systems cannot cope with colon-terminated $shlibpath_var
3806 # The second colon is a workaround for a bug in BeOS R4 ${SED}
3807 $shlibpath_var=\`\$echo \"X\$$shlibpath_var\" | \$Xsed -e 's/::*\$//'\`
3809 export $shlibpath_var
3813 # fixup the dll searchpath if we need to.
3814 if test -n "$dllsearchpath"; then
3815 $echo >> $output "\
3816 # Add the dll search path components to the executable PATH
3817 PATH=$dllsearchpath:\$PATH
3821 $echo >> $output "\
3822 if test \"\$libtool_execute_magic\" != \"$magic\"; then
3823 # Run the actual program with our arguments.
3825 case $host in
3826 # win32 systems need to use the prog path for dll
3827 # lookup to work
3828 *-*-cygwin* | *-*-pw32*)
3829 $echo >> $output "\
3830 exec \$progdir/\$program \${1+\"\$@\"}
3834 # Backslashes separate directories on plain windows
3835 *-*-mingw | *-*-os2*)
3836 $echo >> $output "\
3837 exec \$progdir\\\\\$program \${1+\"\$@\"}
3842 $echo >> $output "\
3843 # Export the path to the program.
3844 PATH=\"\$progdir:\$PATH\"
3845 export PATH
3847 exec \$program \${1+\"\$@\"}
3850 esac
3851 $echo >> $output "\
3852 \$echo \"\$0: cannot exec \$program \${1+\"\$@\"}\"
3853 exit 1
3855 else
3856 # The program doesn't exist.
3857 \$echo \"\$0: error: \$progdir/\$program does not exist\" 1>&2
3858 \$echo \"This script is just a wrapper for \$program.\" 1>&2
3859 echo \"See the $PACKAGE documentation for more information.\" 1>&2
3860 exit 1
3864 chmod +x $output
3866 exit 0
3868 esac
3870 # See if we need to build an old-fashioned archive.
3871 for oldlib in $oldlibs; do
3873 if test "$build_libtool_libs" = convenience; then
3874 oldobjs="$libobjs_save"
3875 addlibs="$convenience"
3876 build_libtool_libs=no
3877 else
3878 if test "$build_libtool_libs" = module; then
3879 oldobjs="$libobjs_save"
3880 build_libtool_libs=no
3881 else
3882 oldobjs="$objs$old_deplibs "`$echo "X$libobjs_save" | $SP2NL | $Xsed -e '/\.'${libext}'$/d' -e '/\.lib$/d' -e "$lo2o" | $NL2SP`
3884 addlibs="$old_convenience"
3887 if test -n "$addlibs"; then
3888 gentop="$output_objdir/${outputname}x"
3889 $show "${rm}r $gentop"
3890 $run ${rm}r "$gentop"
3891 $show "mkdir $gentop"
3892 $run mkdir "$gentop"
3893 status=$?
3894 if test $status -ne 0 && test ! -d "$gentop"; then
3895 exit $status
3897 generated="$generated $gentop"
3899 # Add in members from convenience archives.
3900 for xlib in $addlibs; do
3901 # Extract the objects.
3902 case $xlib in
3903 [\\/]* | [A-Za-z]:[\\/]*) xabs="$xlib" ;;
3904 *) xabs=`pwd`"/$xlib" ;;
3905 esac
3906 xlib=`$echo "X$xlib" | $Xsed -e 's%^.*/%%'`
3907 xdir="$gentop/$xlib"
3909 $show "${rm}r $xdir"
3910 $run ${rm}r "$xdir"
3911 $show "mkdir $xdir"
3912 $run mkdir "$xdir"
3913 status=$?
3914 if test $status -ne 0 && test ! -d "$xdir"; then
3915 exit $status
3917 $show "(cd $xdir && $AR x $xabs)"
3918 $run eval "(cd \$xdir && $AR x \$xabs)" || exit $?
3920 oldobjs="$oldobjs "`find $xdir -name \*.${objext} -print -o -name \*.lo -print | $NL2SP`
3921 done
3924 # Do each command in the archive commands.
3925 if test -n "$old_archive_from_new_cmds" && test "$build_libtool_libs" = yes; then
3926 eval cmds=\"$old_archive_from_new_cmds\"
3927 else
3928 # Ensure that we have .o objects in place in case we decided
3929 # not to build a shared library, and have fallen back to building
3930 # static libs even though --disable-static was passed!
3931 for oldobj in $oldobjs; do
3932 if test ! -f $oldobj; then
3933 xdir=`$echo "X$oldobj" | $Xsed -e 's%/[^/]*$%%'`
3934 if test "X$xdir" = "X$oldobj"; then
3935 xdir="."
3936 else
3937 xdir="$xdir"
3939 baseobj=`$echo "X$oldobj" | $Xsed -e 's%^.*/%%'`
3940 obj=`$echo "X$baseobj" | $Xsed -e "$o2lo"`
3941 $show "(cd $xdir && ${LN_S} $obj $baseobj)"
3942 $run eval '(cd $xdir && ${LN_S} $obj $baseobj)' || exit $?
3944 done
3946 eval cmds=\"$old_archive_cmds\"
3948 save_ifs="$IFS"; IFS='~'
3949 for cmd in $cmds; do
3950 IFS="$save_ifs"
3951 $show "$cmd"
3952 $run eval "$cmd" || exit $?
3953 done
3954 IFS="$save_ifs"
3955 done
3957 if test -n "$generated"; then
3958 $show "${rm}r$generated"
3959 $run ${rm}r$generated
3962 # Now create the libtool archive.
3963 case $output in
3964 *.la)
3965 old_library=
3966 test "$build_old_libs" = yes && old_library="$libname.$libext"
3967 $show "creating $output"
3969 # Preserve any variables that may affect compiler behavior
3970 for var in $variables_saved_for_relink; do
3971 if eval test -z \"\${$var+set}\"; then
3972 relink_command="{ test -z \"\${$var+set}\" || unset $var || { $var=; export $var; }; }; $relink_command"
3973 elif eval var_value=\$$var; test -z "$var_value"; then
3974 relink_command="$var=; export $var; $relink_command"
3975 else
3976 var_value=`$echo "X$var_value" | $Xsed -e "$sed_quote_subst"`
3977 relink_command="$var=\"$var_value\"; export $var; $relink_command"
3979 done
3980 # Quote the link command for shipping.
3981 relink_command="(cd `pwd`; $SHELL $0 --mode=relink $libtool_args @inst_prefix_dir@)"
3982 relink_command=`$echo "X$relink_command" | $Xsed -e "$sed_quote_subst"`
3984 # Only create the output if not a dry run.
3985 if test -z "$run"; then
3986 for installed in no yes; do
3987 if test "$installed" = yes; then
3988 if test -z "$install_libdir"; then
3989 break
3991 output="$output_objdir/$outputname"i
3992 # Replace all uninstalled libtool libraries with the installed ones
3993 newdependency_libs=
3994 for deplib in $dependency_libs; do
3995 case $deplib in
3996 *.la)
3997 name=`$echo "X$deplib" | $Xsed -e 's%^.*/%%'`
3998 eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $deplib`
3999 if test -z "$libdir"; then
4000 $echo "$modename: \`$deplib' is not a valid libtool archive" 1>&2
4001 exit 1
4003 # We do not want portage's install root ($D) present. Check only for
4004 # this if the .la is being installed.
4005 if test "$installed" = yes && test "$D"; then
4006 eval mynewdependency_lib="`echo "$libdir/$name" |sed -e "s:$D::g" -e 's://:/:g'`"
4007 else
4008 mynewdependency_lib="$libdir/$name"
4010 # Do not add duplicates
4011 if test "$mynewdependency_lib"; then
4012 if test -z "`echo $newdependency_libs |grep -e "$mynewdependency_lib"`"; then
4013 newdependency_libs="$newdependency_libs $mynewdependency_lib"
4018 if test "$installed" = yes; then
4019 # Rather use S=WORKDIR if our version of portage supports it.
4020 # This is because some ebuild (gcc) do not use $S as buildroot.
4021 if test "$PWORKDIR"; then
4022 S="$PWORKDIR"
4024 # We do not want portage's build root ($S) present.
4025 if test -n "`echo $deplib |grep -e "$S"`" && test "$S"; then
4026 mynewdependency_lib=""
4027 # We do not want portage's install root ($D) present.
4028 elif test -n "`echo $deplib |grep -e "$D"`" && test "$D"; then
4029 eval mynewdependency_lib="`echo "$deplib" |sed -e "s:$D::g" -e 's://:/:g'`"
4030 else
4031 mynewdependency_lib="$deplib"
4033 else
4034 mynewdependency_lib="$deplib"
4036 # Do not add duplicates
4037 if test "$mynewdependency_lib"; then
4038 if test -z "`echo $newdependency_libs |grep -e "$mynewdependency_lib"`"; then
4039 newdependency_libs="$newdependency_libs $mynewdependency_lib"
4043 esac
4044 done
4045 dependency_libs="$newdependency_libs"
4046 newdlfiles=
4047 for lib in $dlfiles; do
4048 name=`$echo "X$lib" | $Xsed -e 's%^.*/%%'`
4049 eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $lib`
4050 if test -z "$libdir"; then
4051 $echo "$modename: \`$lib' is not a valid libtool archive" 1>&2
4052 exit 1
4054 newdlfiles="$newdlfiles $libdir/$name"
4055 done
4056 dlfiles="$newdlfiles"
4057 newdlprefiles=
4058 for lib in $dlprefiles; do
4059 name=`$echo "X$lib" | $Xsed -e 's%^.*/%%'`
4060 eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $lib`
4061 if test -z "$libdir"; then
4062 $echo "$modename: \`$lib' is not a valid libtool archive" 1>&2
4063 exit 1
4065 newdlprefiles="$newdlprefiles $libdir/$name"
4066 done
4067 dlprefiles="$newdlprefiles"
4069 $rm $output
4070 # place dlname in correct position for cygwin
4071 tdlname=$dlname
4072 case $host,$output,$installed,$module,$dlname in
4073 *cygwin*,*lai,yes,no,*.dll) tdlname=../bin/$dlname ;;
4074 esac
4075 # Do not add duplicates
4076 if test "$installed" = yes && test "$D"; then
4077 install_libdir="`echo "$install_libdir" |sed -e "s:$D::g" -e 's://:/:g'`"
4079 $echo > $output "\
4080 # $outputname - a libtool library file
4081 # Generated by $PROGRAM - GNU $PACKAGE $VERSION$TIMESTAMP
4083 # Please DO NOT delete this file!
4084 # It is necessary for linking the library.
4086 # The name that we can dlopen(3).
4087 dlname='$tdlname'
4089 # Names of this library.
4090 library_names='$library_names'
4092 # The name of the static archive.
4093 old_library='$old_library'
4095 # Libraries that this one depends upon.
4096 dependency_libs='$dependency_libs'
4098 # Version information for $libname.
4099 current=$current
4100 age=$age
4101 revision=$revision
4103 # Is this an already installed library?
4104 installed=$installed
4106 # Files to dlopen/dlpreopen
4107 dlopen='$dlfiles'
4108 dlpreopen='$dlprefiles'
4110 # Directory that this library needs to be installed in:
4111 libdir='$install_libdir'"
4112 if test "$installed" = no && test $need_relink = yes; then
4113 $echo >> $output "\
4114 relink_command=\"$relink_command\""
4116 done
4119 # Do a symbolic link so that the libtool archive can be found in
4120 # LD_LIBRARY_PATH before the program is installed.
4121 $show "(cd $output_objdir && $rm $outputname && $LN_S ../$outputname $outputname)"
4122 $run eval '(cd $output_objdir && $rm $outputname && $LN_S ../$outputname $outputname)' || exit $?
4124 esac
4125 exit 0
4128 # libtool install mode
4129 install)
4130 modename="$modename: install"
4132 # There may be an optional sh(1) argument at the beginning of
4133 # install_prog (especially on Windows NT).
4134 if test "$nonopt" = "$SHELL" || test "$nonopt" = /bin/sh ||
4135 # Allow the use of GNU shtool's install command.
4136 $echo "X$nonopt" | $Xsed | grep shtool > /dev/null; then
4137 # Aesthetically quote it.
4138 arg=`$echo "X$nonopt" | $Xsed -e "$sed_quote_subst"`
4139 case $arg in
4140 *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*)
4141 arg="\"$arg\""
4143 esac
4144 install_prog="$arg "
4145 arg="$1"
4146 shift
4147 else
4148 install_prog=
4149 arg="$nonopt"
4152 # The real first argument should be the name of the installation program.
4153 # Aesthetically quote it.
4154 arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`
4155 case $arg in
4156 *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*)
4157 arg="\"$arg\""
4159 esac
4160 install_prog="$install_prog$arg"
4162 # We need to accept at least all the BSD install flags.
4163 dest=
4164 files=
4165 opts=
4166 prev=
4167 install_type=
4168 isdir=no
4169 stripme=
4170 for arg
4172 if test -n "$dest"; then
4173 files="$files $dest"
4174 dest="$arg"
4175 continue
4178 case $arg in
4179 -d) isdir=yes ;;
4180 -f) prev="-f" ;;
4181 -g) prev="-g" ;;
4182 -m) prev="-m" ;;
4183 -o) prev="-o" ;;
4185 stripme=" -s"
4186 continue
4188 -*) ;;
4191 # If the previous option needed an argument, then skip it.
4192 if test -n "$prev"; then
4193 prev=
4194 else
4195 dest="$arg"
4196 continue
4199 esac
4201 # Aesthetically quote the argument.
4202 arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`
4203 case $arg in
4204 *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*)
4205 arg="\"$arg\""
4207 esac
4208 install_prog="$install_prog $arg"
4209 done
4211 if test -z "$install_prog"; then
4212 $echo "$modename: you must specify an install program" 1>&2
4213 $echo "$help" 1>&2
4214 exit 1
4217 if test -n "$prev"; then
4218 $echo "$modename: the \`$prev' option requires an argument" 1>&2
4219 $echo "$help" 1>&2
4220 exit 1
4223 if test -z "$files"; then
4224 if test -z "$dest"; then
4225 $echo "$modename: no file or destination specified" 1>&2
4226 else
4227 $echo "$modename: you must specify a destination" 1>&2
4229 $echo "$help" 1>&2
4230 exit 1
4233 # Strip any trailing slash from the destination.
4234 dest=`$echo "X$dest" | $Xsed -e 's%/$%%'`
4236 # Check to see that the destination is a directory.
4237 test -d "$dest" && isdir=yes
4238 if test "$isdir" = yes; then
4239 destdir="$dest"
4240 destname=
4241 else
4242 destdir=`$echo "X$dest" | $Xsed -e 's%/[^/]*$%%'`
4243 test "X$destdir" = "X$dest" && destdir=.
4244 destname=`$echo "X$dest" | $Xsed -e 's%^.*/%%'`
4246 # Not a directory, so check to see that there is only one file specified.
4247 set dummy $files
4248 if test $# -gt 2; then
4249 $echo "$modename: \`$dest' is not a directory" 1>&2
4250 $echo "$help" 1>&2
4251 exit 1
4254 case $destdir in
4255 [\\/]* | [A-Za-z]:[\\/]*) ;;
4257 for file in $files; do
4258 case $file in
4259 *.lo) ;;
4261 $echo "$modename: \`$destdir' must be an absolute directory name" 1>&2
4262 $echo "$help" 1>&2
4263 exit 1
4265 esac
4266 done
4268 esac
4270 # This variable tells wrapper scripts just to set variables rather
4271 # than running their programs.
4272 libtool_install_magic="$magic"
4274 staticlibs=
4275 future_libdirs=
4276 current_libdirs=
4277 for file in $files; do
4279 # Do each installation.
4280 case $file in
4281 *.$libext)
4282 # Do the static libraries later.
4283 staticlibs="$staticlibs $file"
4286 *.la)
4287 # Check to see that this really is a libtool archive.
4288 if (${SED} -e '2q' $file | egrep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then :
4289 else
4290 $echo "$modename: \`$file' is not a valid libtool archive" 1>&2
4291 $echo "$help" 1>&2
4292 exit 1
4295 library_names=
4296 old_library=
4297 relink_command=
4298 # If there is no directory component, then add one.
4299 case $file in
4300 */* | *\\*) . $file ;;
4301 *) . ./$file ;;
4302 esac
4304 # Add the libdir to current_libdirs if it is the destination.
4305 if test "X$destdir" = "X$libdir"; then
4306 case "$current_libdirs " in
4307 *" $libdir "*) ;;
4308 *) current_libdirs="$current_libdirs $libdir" ;;
4309 esac
4310 else
4311 # Note the libdir as a future libdir.
4312 case "$future_libdirs " in
4313 *" $libdir "*) ;;
4314 *) future_libdirs="$future_libdirs $libdir" ;;
4315 esac
4318 dir=`$echo "X$file" | $Xsed -e 's%/[^/]*$%%'`/
4319 test "X$dir" = "X$file/" && dir=
4320 dir="$dir$objdir"
4322 if test -n "$relink_command"; then
4323 # Determine the prefix the user has applied to our future dir.
4324 inst_prefix_dir=`$echo "$destdir" | sed "s%$libdir\$%%"`
4326 # Don't allow the user to place us outside of our expected
4327 # location b/c this prevents finding dependent libraries that
4328 # are installed to the same prefix.
4329 if test "$inst_prefix_dir" = "$destdir"; then
4330 $echo "$modename: error: cannot install \`$file' to a directory not ending in $libdir" 1>&2
4331 exit 1
4334 if test -n "$inst_prefix_dir"; then
4335 # Stick the inst_prefix_dir data into the link command.
4336 relink_command=`$echo "$relink_command" | sed "s%@inst_prefix_dir@%-inst-prefix-dir $inst_prefix_dir%"`
4337 else
4338 relink_command=`$echo "$relink_command" | sed "s%@inst_prefix_dir@%%"`
4341 $echo "$modename: warning: relinking \`$file'" 1>&2
4342 $show "$relink_command"
4343 if $run eval "$relink_command"; then :
4344 else
4345 $echo "$modename: error: relink \`$file' with the above command before installing it" 1>&2
4346 exit 1
4350 # See the names of the shared library.
4351 set dummy $library_names
4352 if test -n "$2"; then
4353 realname="$2"
4354 shift
4355 shift
4357 srcname="$realname"
4358 test -n "$relink_command" && srcname="$realname"T
4360 # Install the shared library and build the symlinks.
4361 $show "$install_prog $dir/$srcname $destdir/$realname"
4362 $run eval "$install_prog $dir/$srcname $destdir/$realname" || exit $?
4363 if test -n "$stripme" && test -n "$striplib"; then
4364 $show "$striplib $destdir/$realname"
4365 $run eval "$striplib $destdir/$realname" || exit $?
4368 if test $# -gt 0; then
4369 # Delete the old symlinks, and create new ones.
4370 for linkname
4372 if test "$linkname" != "$realname"; then
4373 $show "(cd $destdir && $rm $linkname && $LN_S $realname $linkname)"
4374 $run eval "(cd $destdir && $rm $linkname && $LN_S $realname $linkname)"
4376 done
4379 # Do each command in the postinstall commands.
4380 lib="$destdir/$realname"
4381 eval cmds=\"$postinstall_cmds\"
4382 save_ifs="$IFS"; IFS='~'
4383 for cmd in $cmds; do
4384 IFS="$save_ifs"
4385 $show "$cmd"
4386 $run eval "$cmd" || exit $?
4387 done
4388 IFS="$save_ifs"
4391 # Install the pseudo-library for information purposes.
4392 name=`$echo "X$file" | $Xsed -e 's%^.*/%%'`
4393 instname="$dir/$name"i
4394 $show "$install_prog $instname $destdir/$name"
4395 $run eval "$install_prog $instname $destdir/$name" || exit $?
4397 # Maybe install the static library, too.
4398 test -n "$old_library" && staticlibs="$staticlibs $dir/$old_library"
4401 *.lo)
4402 # Install (i.e. copy) a libtool object.
4404 # Figure out destination file name, if it wasn't already specified.
4405 if test -n "$destname"; then
4406 destfile="$destdir/$destname"
4407 else
4408 destfile=`$echo "X$file" | $Xsed -e 's%^.*/%%'`
4409 destfile="$destdir/$destfile"
4412 # Deduce the name of the destination old-style object file.
4413 case $destfile in
4414 *.lo)
4415 staticdest=`$echo "X$destfile" | $Xsed -e "$lo2o"`
4417 *.$objext)
4418 staticdest="$destfile"
4419 destfile=
4422 $echo "$modename: cannot copy a libtool object to \`$destfile'" 1>&2
4423 $echo "$help" 1>&2
4424 exit 1
4426 esac
4428 # Install the libtool object if requested.
4429 if test -n "$destfile"; then
4430 $show "$install_prog $file $destfile"
4431 $run eval "$install_prog $file $destfile" || exit $?
4434 # Install the old object if enabled.
4435 if test "$build_old_libs" = yes; then
4436 # Deduce the name of the old-style object file.
4437 staticobj=`$echo "X$file" | $Xsed -e "$lo2o"`
4439 $show "$install_prog $staticobj $staticdest"
4440 $run eval "$install_prog \$staticobj \$staticdest" || exit $?
4442 exit 0
4446 # Figure out destination file name, if it wasn't already specified.
4447 if test -n "$destname"; then
4448 destfile="$destdir/$destname"
4449 else
4450 destfile=`$echo "X$file" | $Xsed -e 's%^.*/%%'`
4451 destfile="$destdir/$destfile"
4454 # Do a test to see if this is really a libtool program.
4455 case $host in
4456 *cygwin*|*mingw*)
4457 wrapper=`echo $file | ${SED} -e 's,.exe$,,'`
4460 wrapper=$file
4462 esac
4463 if (${SED} -e '4q' $wrapper | egrep "^# Generated by .*$PACKAGE")>/dev/null 2>&1; then
4464 notinst_deplibs=
4465 relink_command=
4467 # If there is no directory component, then add one.
4468 case $file in
4469 */* | *\\*) . $wrapper ;;
4470 *) . ./$wrapper ;;
4471 esac
4473 # Check the variables that should have been set.
4474 if test -z "$notinst_deplibs"; then
4475 $echo "$modename: invalid libtool wrapper script \`$wrapper'" 1>&2
4476 exit 1
4479 finalize=yes
4480 for lib in $notinst_deplibs; do
4481 # Check to see that each library is installed.
4482 libdir=
4483 if test -f "$lib"; then
4484 # If there is no directory component, then add one.
4485 case $lib in
4486 */* | *\\*) . $lib ;;
4487 *) . ./$lib ;;
4488 esac
4490 libfile="$libdir/"`$echo "X$lib" | $Xsed -e 's%^.*/%%g'` ### testsuite: skip nested quoting test
4491 if test -n "$libdir" && test ! -f "$libfile"; then
4492 $echo "$modename: warning: \`$lib' has not been installed in \`$libdir'" 1>&2
4493 finalize=no
4495 done
4497 relink_command=
4498 # If there is no directory component, then add one.
4499 case $file in
4500 */* | *\\*) . $wrapper ;;
4501 *) . ./$wrapper ;;
4502 esac
4504 outputname=
4505 if test "$fast_install" = no && test -n "$relink_command"; then
4506 if test "$finalize" = yes && test -z "$run"; then
4507 tmpdir="/tmp"
4508 test -n "$TMPDIR" && tmpdir="$TMPDIR"
4509 tmpdir=`mktemp -d $tmpdir/libtool-XXXXXX 2> /dev/null`
4510 if test $? = 0 ; then :
4511 else
4512 tmpdir="$tmpdir/libtool-$$"
4514 if $mkdir -p "$tmpdir" && chmod 700 "$tmpdir"; then :
4515 else
4516 $echo "$modename: error: cannot create temporary directory \`$tmpdir'" 1>&2
4517 continue
4519 file=`$echo "X$file" | $Xsed -e 's%^.*/%%'`
4520 outputname="$tmpdir/$file"
4521 # Replace the output file specification.
4522 relink_command=`$echo "X$relink_command" | $Xsed -e 's%@OUTPUT@%'"$outputname"'%g'`
4524 $show "$relink_command"
4525 if $run eval "$relink_command"; then :
4526 else
4527 $echo "$modename: error: relink \`$file' with the above command before installing it" 1>&2
4528 ${rm}r "$tmpdir"
4529 continue
4531 file="$outputname"
4532 else
4533 $echo "$modename: warning: cannot relink \`$file'" 1>&2
4535 else
4536 # Install the binary that we compiled earlier.
4537 file=`$echo "X$file" | $Xsed -e "s%\([^/]*\)$%$objdir/\1%"`
4541 # remove .exe since cygwin /usr/bin/install will append another
4542 # one anyways
4543 case $install_prog,$host in
4544 /usr/bin/install*,*cygwin*)
4545 case $file:$destfile in
4546 *.exe:*.exe)
4547 # this is ok
4549 *.exe:*)
4550 destfile=$destfile.exe
4552 *:*.exe)
4553 destfile=`echo $destfile | ${SED} -e 's,.exe$,,'`
4555 esac
4557 esac
4558 $show "$install_prog$stripme $file $destfile"
4559 $run eval "$install_prog\$stripme \$file \$destfile" || exit $?
4560 test -n "$outputname" && ${rm}r "$tmpdir"
4562 esac
4563 done
4565 for file in $staticlibs; do
4566 name=`$echo "X$file" | $Xsed -e 's%^.*/%%'`
4568 # Set up the ranlib parameters.
4569 oldlib="$destdir/$name"
4571 $show "$install_prog $file $oldlib"
4572 $run eval "$install_prog \$file \$oldlib" || exit $?
4574 if test -n "$stripme" && test -n "$striplib"; then
4575 $show "$old_striplib $oldlib"
4576 $run eval "$old_striplib $oldlib" || exit $?
4579 # Do each command in the postinstall commands.
4580 eval cmds=\"$old_postinstall_cmds\"
4581 save_ifs="$IFS"; IFS='~'
4582 for cmd in $cmds; do
4583 IFS="$save_ifs"
4584 $show "$cmd"
4585 $run eval "$cmd" || exit $?
4586 done
4587 IFS="$save_ifs"
4588 done
4590 if test -n "$future_libdirs"; then
4591 $echo "$modename: warning: remember to run \`$progname --finish$future_libdirs'" 1>&2
4594 if test -n "$current_libdirs"; then
4595 # Maybe just do a dry run.
4596 test -n "$run" && current_libdirs=" -n$current_libdirs"
4597 exec_cmd='$SHELL $0 --finish$current_libdirs'
4598 else
4599 exit 0
4603 # libtool finish mode
4604 finish)
4605 modename="$modename: finish"
4606 libdirs="$nonopt"
4607 admincmds=
4609 if test -n "$finish_cmds$finish_eval" && test -n "$libdirs"; then
4610 for dir
4612 libdirs="$libdirs $dir"
4613 done
4615 for libdir in $libdirs; do
4616 if test -n "$finish_cmds"; then
4617 # Do each command in the finish commands.
4618 eval cmds=\"$finish_cmds\"
4619 save_ifs="$IFS"; IFS='~'
4620 for cmd in $cmds; do
4621 IFS="$save_ifs"
4622 $show "$cmd"
4623 $run eval "$cmd" || admincmds="$admincmds
4624 $cmd"
4625 done
4626 IFS="$save_ifs"
4628 if test -n "$finish_eval"; then
4629 # Do the single finish_eval.
4630 eval cmds=\"$finish_eval\"
4631 $run eval "$cmds" || admincmds="$admincmds
4632 $cmds"
4634 done
4637 # Exit here if they wanted silent mode.
4638 test "$show" = ":" && exit 0
4640 echo "----------------------------------------------------------------------"
4641 echo "Libraries have been installed in:"
4642 for libdir in $libdirs; do
4643 echo " $libdir"
4644 done
4645 echo
4646 echo "If you ever happen to want to link against installed libraries"
4647 echo "in a given directory, LIBDIR, you must either use libtool, and"
4648 echo "specify the full pathname of the library, or use the \`-LLIBDIR'"
4649 echo "flag during linking and do at least one of the following:"
4650 if test -n "$shlibpath_var"; then
4651 echo " - add LIBDIR to the \`$shlibpath_var' environment variable"
4652 echo " during execution"
4654 if test -n "$runpath_var"; then
4655 echo " - add LIBDIR to the \`$runpath_var' environment variable"
4656 echo " during linking"
4658 if test -n "$hardcode_libdir_flag_spec"; then
4659 libdir=LIBDIR
4660 eval flag=\"$hardcode_libdir_flag_spec\"
4662 echo " - use the \`$flag' linker flag"
4664 if test -n "$admincmds"; then
4665 echo " - have your system administrator run these commands:$admincmds"
4667 if test -f /etc/ld.so.conf; then
4668 echo " - have your system administrator add LIBDIR to \`/etc/ld.so.conf'"
4670 echo
4671 echo "See any operating system documentation about shared libraries for"
4672 echo "more information, such as the ld(1) and ld.so(8) manual pages."
4673 echo "----------------------------------------------------------------------"
4674 exit 0
4677 # libtool execute mode
4678 execute)
4679 modename="$modename: execute"
4681 # The first argument is the command name.
4682 cmd="$nonopt"
4683 if test -z "$cmd"; then
4684 $echo "$modename: you must specify a COMMAND" 1>&2
4685 $echo "$help"
4686 exit 1
4689 # Handle -dlopen flags immediately.
4690 for file in $execute_dlfiles; do
4691 if test ! -f "$file"; then
4692 $echo "$modename: \`$file' is not a file" 1>&2
4693 $echo "$help" 1>&2
4694 exit 1
4697 dir=
4698 case $file in
4699 *.la)
4700 # Check to see that this really is a libtool archive.
4701 if (${SED} -e '2q' $file | egrep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then :
4702 else
4703 $echo "$modename: \`$lib' is not a valid libtool archive" 1>&2
4704 $echo "$help" 1>&2
4705 exit 1
4708 # Read the libtool library.
4709 dlname=
4710 library_names=
4712 # If there is no directory component, then add one.
4713 case $file in
4714 */* | *\\*) . $file ;;
4715 *) . ./$file ;;
4716 esac
4718 # Skip this library if it cannot be dlopened.
4719 if test -z "$dlname"; then
4720 # Warn if it was a shared library.
4721 test -n "$library_names" && $echo "$modename: warning: \`$file' was not linked with \`-export-dynamic'"
4722 continue
4725 dir=`$echo "X$file" | $Xsed -e 's%/[^/]*$%%'`
4726 test "X$dir" = "X$file" && dir=.
4728 if test -f "$dir/$objdir/$dlname"; then
4729 dir="$dir/$objdir"
4730 else
4731 $echo "$modename: cannot find \`$dlname' in \`$dir' or \`$dir/$objdir'" 1>&2
4732 exit 1
4736 *.lo)
4737 # Just add the directory containing the .lo file.
4738 dir=`$echo "X$file" | $Xsed -e 's%/[^/]*$%%'`
4739 test "X$dir" = "X$file" && dir=.
4743 $echo "$modename: warning \`-dlopen' is ignored for non-libtool libraries and objects" 1>&2
4744 continue
4746 esac
4748 # Get the absolute pathname.
4749 absdir=`cd "$dir" && pwd`
4750 test -n "$absdir" && dir="$absdir"
4752 # Now add the directory to shlibpath_var.
4753 if eval "test -z \"\$$shlibpath_var\""; then
4754 eval "$shlibpath_var=\"\$dir\""
4755 else
4756 eval "$shlibpath_var=\"\$dir:\$$shlibpath_var\""
4758 done
4760 # This variable tells wrapper scripts just to set shlibpath_var
4761 # rather than running their programs.
4762 libtool_execute_magic="$magic"
4764 # Check if any of the arguments is a wrapper script.
4765 args=
4766 for file
4768 case $file in
4769 -*) ;;
4771 # Do a test to see if this is really a libtool program.
4772 if (${SED} -e '4q' $file | egrep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then
4773 # If there is no directory component, then add one.
4774 case $file in
4775 */* | *\\*) . $file ;;
4776 *) . ./$file ;;
4777 esac
4779 # Transform arg to wrapped name.
4780 file="$progdir/$program"
4783 esac
4784 # Quote arguments (to preserve shell metacharacters).
4785 file=`$echo "X$file" | $Xsed -e "$sed_quote_subst"`
4786 args="$args \"$file\""
4787 done
4789 if test -z "$run"; then
4790 if test -n "$shlibpath_var"; then
4791 # Export the shlibpath_var.
4792 eval "export $shlibpath_var"
4795 # Restore saved enviroment variables
4796 if test "${save_LC_ALL+set}" = set; then
4797 LC_ALL="$save_LC_ALL"; export LC_ALL
4799 if test "${save_LANG+set}" = set; then
4800 LANG="$save_LANG"; export LANG
4803 # Now prepare to actually exec the command.
4804 exec_cmd="\$cmd$args"
4805 else
4806 # Display what would be done.
4807 if test -n "$shlibpath_var"; then
4808 eval "\$echo \"\$shlibpath_var=\$$shlibpath_var\""
4809 $echo "export $shlibpath_var"
4811 $echo "$cmd$args"
4812 exit 0
4816 # libtool clean and uninstall mode
4817 clean | uninstall)
4818 modename="$modename: $mode"
4819 rm="$nonopt"
4820 files=
4821 rmforce=
4822 exit_status=0
4824 # This variable tells wrapper scripts just to set variables rather
4825 # than running their programs.
4826 libtool_install_magic="$magic"
4828 for arg
4830 case $arg in
4831 -f) rm="$rm $arg"; rmforce=yes ;;
4832 -*) rm="$rm $arg" ;;
4833 *) files="$files $arg" ;;
4834 esac
4835 done
4837 if test -z "$rm"; then
4838 $echo "$modename: you must specify an RM program" 1>&2
4839 $echo "$help" 1>&2
4840 exit 1
4843 rmdirs=
4845 for file in $files; do
4846 dir=`$echo "X$file" | $Xsed -e 's%/[^/]*$%%'`
4847 if test "X$dir" = "X$file"; then
4848 dir=.
4849 objdir="$objdir"
4850 else
4851 objdir="$dir/$objdir"
4853 name=`$echo "X$file" | $Xsed -e 's%^.*/%%'`
4854 test $mode = uninstall && objdir="$dir"
4856 # Remember objdir for removal later, being careful to avoid duplicates
4857 if test $mode = clean; then
4858 case " $rmdirs " in
4859 *" $objdir "*) ;;
4860 *) rmdirs="$rmdirs $objdir" ;;
4861 esac
4864 # Don't error if the file doesn't exist and rm -f was used.
4865 if (test -L "$file") >/dev/null 2>&1 \
4866 || (test -h "$file") >/dev/null 2>&1 \
4867 || test -f "$file"; then
4869 elif test -d "$file"; then
4870 exit_status=1
4871 continue
4872 elif test "$rmforce" = yes; then
4873 continue
4876 rmfiles="$file"
4878 case $name in
4879 *.la)
4880 # Possibly a libtool archive, so verify it.
4881 if (${SED} -e '2q' $file | egrep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then
4882 . $dir/$name
4884 # Delete the libtool libraries and symlinks.
4885 for n in $library_names; do
4886 rmfiles="$rmfiles $objdir/$n"
4887 done
4888 test -n "$old_library" && rmfiles="$rmfiles $objdir/$old_library"
4889 test $mode = clean && rmfiles="$rmfiles $objdir/$name $objdir/${name}i"
4891 if test $mode = uninstall; then
4892 if test -n "$library_names"; then
4893 # Do each command in the postuninstall commands.
4894 eval cmds=\"$postuninstall_cmds\"
4895 save_ifs="$IFS"; IFS='~'
4896 for cmd in $cmds; do
4897 IFS="$save_ifs"
4898 $show "$cmd"
4899 $run eval "$cmd"
4900 if test $? != 0 && test "$rmforce" != yes; then
4901 exit_status=1
4903 done
4904 IFS="$save_ifs"
4907 if test -n "$old_library"; then
4908 # Do each command in the old_postuninstall commands.
4909 eval cmds=\"$old_postuninstall_cmds\"
4910 save_ifs="$IFS"; IFS='~'
4911 for cmd in $cmds; do
4912 IFS="$save_ifs"
4913 $show "$cmd"
4914 $run eval "$cmd"
4915 if test $? != 0 && test "$rmforce" != yes; then
4916 exit_status=1
4918 done
4919 IFS="$save_ifs"
4921 # FIXME: should reinstall the best remaining shared library.
4926 *.lo)
4927 if test "$build_old_libs" = yes; then
4928 oldobj=`$echo "X$name" | $Xsed -e "$lo2o"`
4929 rmfiles="$rmfiles $dir/$oldobj"
4934 # Do a test to see if this is a libtool program.
4935 if test $mode = clean &&
4936 (${SED} -e '4q' $file | egrep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then
4937 relink_command=
4938 . $dir/$file
4940 rmfiles="$rmfiles $objdir/$name $objdir/${name}S.${objext}"
4941 if test "$fast_install" = yes && test -n "$relink_command"; then
4942 rmfiles="$rmfiles $objdir/lt-$name"
4946 esac
4947 $show "$rm $rmfiles"
4948 $run $rm $rmfiles || exit_status=1
4949 done
4951 # Try to remove the ${objdir}s in the directories where we deleted files
4952 for dir in $rmdirs; do
4953 if test -d "$dir"; then
4954 $show "rmdir $dir"
4955 $run rmdir $dir >/dev/null 2>&1
4957 done
4959 exit $exit_status
4963 $echo "$modename: you must specify a MODE" 1>&2
4964 $echo "$generic_help" 1>&2
4965 exit 1
4967 esac
4969 if test -z "$exec_cmd"; then
4970 $echo "$modename: invalid operation mode \`$mode'" 1>&2
4971 $echo "$generic_help" 1>&2
4972 exit 1
4974 fi # test -z "$show_help"
4976 if test -n "$exec_cmd"; then
4977 eval exec $exec_cmd
4978 exit 1
4981 # We need to display help for each of the modes.
4982 case $mode in
4983 "") $echo \
4984 "Usage: $modename [OPTION]... [MODE-ARG]...
4986 Provide generalized library-building support services.
4988 --config show all configuration variables
4989 --debug enable verbose shell tracing
4990 -n, --dry-run display commands without modifying any files
4991 --features display basic configuration information and exit
4992 --finish same as \`--mode=finish'
4993 --help display this help message and exit
4994 --mode=MODE use operation mode MODE [default=inferred from MODE-ARGS]
4995 --quiet same as \`--silent'
4996 --silent don't print informational messages
4997 --version print version information
4999 MODE must be one of the following:
5001 clean remove files from the build directory
5002 compile compile a source file into a libtool object
5003 execute automatically set library path, then run a program
5004 finish complete the installation of libtool libraries
5005 install install libraries or executables
5006 link create a library or an executable
5007 uninstall remove libraries from an installed directory
5009 MODE-ARGS vary depending on the MODE. Try \`$modename --help --mode=MODE' for
5010 a more detailed description of MODE."
5011 exit 0
5014 clean)
5015 $echo \
5016 "Usage: $modename [OPTION]... --mode=clean RM [RM-OPTION]... FILE...
5018 Remove files from the build directory.
5020 RM is the name of the program to use to delete files associated with each FILE
5021 (typically \`/bin/rm'). RM-OPTIONS are options (such as \`-f') to be passed
5022 to RM.
5024 If FILE is a libtool library, object or program, all the files associated
5025 with it are deleted. Otherwise, only FILE itself is deleted using RM."
5028 compile)
5029 $echo \
5030 "Usage: $modename [OPTION]... --mode=compile COMPILE-COMMAND... SOURCEFILE
5032 Compile a source file into a libtool library object.
5034 This mode accepts the following additional options:
5036 -o OUTPUT-FILE set the output file name to OUTPUT-FILE
5037 -prefer-pic try to building PIC objects only
5038 -prefer-non-pic try to building non-PIC objects only
5039 -static always build a \`.o' file suitable for static linking
5041 COMPILE-COMMAND is a command to be used in creating a \`standard' object file
5042 from the given SOURCEFILE.
5044 The output file name is determined by removing the directory component from
5045 SOURCEFILE, then substituting the C source code suffix \`.c' with the
5046 library object suffix, \`.lo'."
5049 execute)
5050 $echo \
5051 "Usage: $modename [OPTION]... --mode=execute COMMAND [ARGS]...
5053 Automatically set library path, then run a program.
5055 This mode accepts the following additional options:
5057 -dlopen FILE add the directory containing FILE to the library path
5059 This mode sets the library path environment variable according to \`-dlopen'
5060 flags.
5062 If any of the ARGS are libtool executable wrappers, then they are translated
5063 into their corresponding uninstalled binary, and any of their required library
5064 directories are added to the library path.
5066 Then, COMMAND is executed, with ARGS as arguments."
5069 finish)
5070 $echo \
5071 "Usage: $modename [OPTION]... --mode=finish [LIBDIR]...
5073 Complete the installation of libtool libraries.
5075 Each LIBDIR is a directory that contains libtool libraries.
5077 The commands that this mode executes may require superuser privileges. Use
5078 the \`--dry-run' option if you just want to see what would be executed."
5081 install)
5082 $echo \
5083 "Usage: $modename [OPTION]... --mode=install INSTALL-COMMAND...
5085 Install executables or libraries.
5087 INSTALL-COMMAND is the installation command. The first component should be
5088 either the \`install' or \`cp' program.
5090 The rest of the components are interpreted as arguments to that command (only
5091 BSD-compatible install options are recognized)."
5094 link)
5095 $echo \
5096 "Usage: $modename [OPTION]... --mode=link LINK-COMMAND...
5098 Link object files or libraries together to form another library, or to
5099 create an executable program.
5101 LINK-COMMAND is a command using the C compiler that you would use to create
5102 a program from several object files.
5104 The following components of LINK-COMMAND are treated specially:
5106 -all-static do not do any dynamic linking at all
5107 -avoid-version do not add a version suffix if possible
5108 -dlopen FILE \`-dlpreopen' FILE if it cannot be dlopened at runtime
5109 -dlpreopen FILE link in FILE and add its symbols to lt_preloaded_symbols
5110 -export-dynamic allow symbols from OUTPUT-FILE to be resolved with dlsym(3)
5111 -export-symbols SYMFILE
5112 try to export only the symbols listed in SYMFILE
5113 -export-symbols-regex REGEX
5114 try to export only the symbols matching REGEX
5115 -LLIBDIR search LIBDIR for required installed libraries
5116 -lNAME OUTPUT-FILE requires the installed library libNAME
5117 -module build a library that can dlopened
5118 -no-fast-install disable the fast-install mode
5119 -no-install link a not-installable executable
5120 -no-undefined declare that a library does not refer to external symbols
5121 -o OUTPUT-FILE create OUTPUT-FILE from the specified objects
5122 -release RELEASE specify package release information
5123 -rpath LIBDIR the created library will eventually be installed in LIBDIR
5124 -R[ ]LIBDIR add LIBDIR to the runtime path of programs and libraries
5125 -static do not do any dynamic linking of libtool libraries
5126 -version-info CURRENT[:REVISION[:AGE]]
5127 specify library version info [each variable defaults to 0]
5129 All other options (arguments beginning with \`-') are ignored.
5131 Every other argument is treated as a filename. Files ending in \`.la' are
5132 treated as uninstalled libtool libraries, other files are standard or library
5133 object files.
5135 If the OUTPUT-FILE ends in \`.la', then a libtool library is created,
5136 only library objects (\`.lo' files) may be specified, and \`-rpath' is
5137 required, except when creating a convenience library.
5139 If OUTPUT-FILE ends in \`.a' or \`.lib', then a standard library is created
5140 using \`ar' and \`ranlib', or on Windows using \`lib'.
5142 If OUTPUT-FILE ends in \`.lo' or \`.${objext}', then a reloadable object file
5143 is created, otherwise an executable program is created."
5146 uninstall)
5147 $echo \
5148 "Usage: $modename [OPTION]... --mode=uninstall RM [RM-OPTION]... FILE...
5150 Remove libraries from an installation directory.
5152 RM is the name of the program to use to delete files associated with each FILE
5153 (typically \`/bin/rm'). RM-OPTIONS are options (such as \`-f') to be passed
5154 to RM.
5156 If FILE is a libtool library, all the files associated with it are deleted.
5157 Otherwise, only FILE itself is deleted using RM."
5161 $echo "$modename: invalid operation mode \`$mode'" 1>&2
5162 $echo "$help" 1>&2
5163 exit 1
5165 esac
5167 echo
5168 $echo "Try \`$modename --help' for more information about other modes."
5170 exit 0
5172 # Local Variables:
5173 # mode:shell-script
5174 # sh-indentation:2
5175 # End: