source: trunk/ORBit2-2.14.0/libtool@ 198

Last change on this file since 198 was 92, checked in by cinc, 19 years ago

Orbit2 modified for use with NOM

File size: 199.1 KB
Line 
1#! sh
2
3# libtoolT - Provide generalized library-building support services.
4# Generated automatically by (GNU ORBit2 2.14.0)
5# NOTE: Changes made to this file will be lost: look at ltmain.sh.
6#
7# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001
8# Free Software Foundation, Inc.
9#
10# This file is part of GNU Libtool:
11# Originally by Gordon Matzigkeit <gord@gnu.ai.mit.edu>, 1996
12#
13# This program is free software; you can redistribute it and/or modify
14# it under the terms of the GNU General Public License as published by
15# the Free Software Foundation; either version 2 of the License, or
16# (at your option) any later version.
17#
18# This program is distributed in the hope that it will be useful, but
19# WITHOUT ANY WARRANTY; without even the implied warranty of
20# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
21# General Public License for more details.
22#
23# You should have received a copy of the GNU General Public License
24# along with this program; if not, write to the Free Software
25# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
26#
27# As a special exception to the GNU General Public License, if you
28# distribute this file as part of a program that contains a
29# configuration script generated by Autoconf, you may include it under
30# the same distribution terms that you use for the rest of that program.
31
32# A sed program that does not truncate output.
33SED="Z:/BIN/sed.exe"
34
35# Sed that helps us avoid accidentally triggering echo(1) options like -n.
36Xsed="Z:/BIN/sed.exe -e 1s/^X//"
37
38# The HP-UX ksh and POSIX shell print the target directory to stdout
39# if CDPATH is set.
40(unset CDPATH) >/dev/null 2>&1 && unset CDPATH
41
42# The names of the tagged configurations supported by this script.
43available_tags=""
44
45# ### BEGIN LIBTOOL CONFIG
46
47# Libtool was configured on host localhost:
48
49# Shell to use when invoking shell scripts.
50SHELL="sh"
51
52# Whether or not to build shared libraries.
53build_libtool_libs=yes
54
55# Whether or not to build static libraries.
56build_old_libs=yes
57
58# Whether or not to add -lc for building shared libraries.
59build_libtool_need_lc=yes
60
61# Whether or not to disallow shared libs when runtime libs are static
62allow_libtool_libs_with_static_runtimes=no
63
64# Whether or not to optimize for fast installation.
65fast_install=yes
66
67# The host system.
68host_alias=
69host=i386-pc-os2-emx
70host_os=os2-emx
71
72# The build system.
73build_alias=
74build=i386-pc-os2-emx
75build_os=os2-emx
76
77# An echo program that does not interpret backslashes.
78echo="echo"
79
80# The archiver.
81AR="ar.exe"
82AR_FLAGS="cru"
83
84# A C compiler.
85LTCC="gcc"
86
87# A language-specific compiler.
88CC="gcc"
89
90# Is the compiler the GNU C compiler?
91with_gcc=yes
92
93# An ERE matcher.
94EGREP="grep -E"
95
96# The linker used to build libraries.
97LD="ld.exe"
98
99# Whether we need hard or soft links.
100LN_S="cp -p"
101
102# A BSD-compatible nm program.
103NM="L:/usr/i386-pc-os2-emx/bin/nm -B"
104
105# A symbol stripping program
106STRIP="strip"
107
108# Used to examine libraries when file_magic_cmd begins "file"
109MAGIC_CMD=file
110
111# Used on cygwin: DLL creation program.
112DLLTOOL="dlltool"
113
114# Used on cygwin: object dumper.
115OBJDUMP="objdump"
116
117# Used on cygwin: assembler.
118AS="as"
119
120# The name of the directory that contains temporary libtool files.
121objdir=.libs
122
123# How to create reloadable object files.
124reload_flag=" -r"
125reload_cmds="\$LD\$reload_flag -o \$output\$reload_objs"
126
127# How to pass a linker flag through the compiler.
128wl="-Wl,"
129
130# Object file suffix (normally "o").
131objext="o"
132
133# Old archive suffix (normally "a").
134libext="a"
135
136# Shared library suffix (normally ".so").
137shrext_cmds='.dll'
138
139# Executable file suffix (normally "").
140exeext=""
141
142# Additional compiler flags for building library objects.
143pic_flag=" -DDLL_EXPORT -DPIC"
144pic_mode=default
145
146# What is the maximum length of a command?
147max_cmd_len=8192
148
149# Does compiler simultaneously support -c and -o options?
150compiler_c_o="yes"
151
152# Must we lock files when doing compilation?
153need_locks="no"
154
155# Do we need the lib prefix for modules?
156need_lib_prefix=no
157
158# Do we need a version for libraries?
159need_version=unknown
160
161# Whether dlopen is supported.
162dlopen_support=yes
163
164# Whether dlopen of programs is supported.
165dlopen_self=no
166
167# Whether dlopen of statically linked programs is supported.
168dlopen_self_static=unknown
169
170# Compiler flag to prevent dynamic linking.
171link_static_flag="-static"
172
173# Compiler flag to turn off builtin functions.
174no_builtin_flag=" -fno-builtin"
175
176# Compiler flag to allow reflexive dlopens.
177export_dynamic_flag_spec=""
178
179# Compiler flag to generate shared objects directly from archives.
180whole_archive_flag_spec=""
181
182# Compiler flag to generate thread-safe objects.
183thread_safe_flag_spec=""
184
185# Library versioning type.
186version_type=none
187
188# Format of library name prefix.
189libname_spec="\$name"
190
191# List of archive names. First name is the real one, the rest are links.
192# The last name is the one that the linker finds with -lNAME.
193library_names_spec="\$libname\${shared_ext} \$libname.a"
194
195# The coded name of the library, if different from the real name.
196soname_spec=""
197
198# Commands used to build and install an old-style archive.
199RANLIB="echo"
200old_archive_cmds="\$AR \$AR_FLAGS \$oldlib\$oldobjs\$old_deplibs~\$RANLIB \$oldlib"
201old_postinstall_cmds="\$RANLIB \$oldlib~chmod 644 \$oldlib"
202old_postuninstall_cmds=""
203
204# Create an old-style archive from a shared archive.
205old_archive_from_new_cmds=""
206
207# Create a temporary old-style archive to link instead of a shared archive.
208old_archive_from_expsyms_cmds=""
209
210# Commands used to build and install a shared archive.
211archive_cmds="\$echo \\\"LIBRARY \$libname INITINSTANCE\\\" > \$output_objdir/\$libname.def~\$echo \\\"DESCRIPTION \\\\\\\"\$libname\\\\\\\"\\\" >> \$output_objdir/\$libname.def~\$echo DATA >> \$output_objdir/\$libname.def~\$echo \\\" SINGLE NONSHARED\\\" >> \$output_objdir/\$libname.def~\$echo EXPORTS >> \$output_objdir/\$libname.def~emxexp \$libobjs >> \$output_objdir/\$libname.def~\$CC -Zdll -Zcrtdll -o \$lib \$libobjs \$deplibs \$compiler_flags \$output_objdir/\$libname.def"
212archive_expsym_cmds=""
213postinstall_cmds=""
214postuninstall_cmds=""
215
216# Commands used to build a loadable module (assumed same as above if empty)
217module_cmds=""
218module_expsym_cmds=""
219
220# Commands to strip libraries.
221old_striplib="strip --strip-debug"
222striplib="strip --strip-unneeded"
223
224# Dependencies to place before the objects being linked to create a
225# shared library.
226predep_objects=""
227
228# Dependencies to place after the objects being linked to create a
229# shared library.
230postdep_objects=""
231
232# Dependencies to place before the objects being linked to create a
233# shared library.
234predeps=""
235
236# Dependencies to place after the objects being linked to create a
237# shared library.
238postdeps=""
239
240# The library search path used internally by the compiler when linking
241# a shared library.
242compiler_lib_search_path=""
243
244# Method to check whether dependent libraries are shared objects.
245deplibs_check_method="unknown"
246
247# Command to use when deplibs_check_method == file_magic.
248file_magic_cmd="\$MAGIC_CMD"
249
250# Flag that allows shared libraries with undefined symbols to be built.
251allow_undefined_flag="unsupported"
252
253# Flag that forces no undefined symbols.
254no_undefined_flag=""
255
256# Commands used to finish a libtool library installation in a directory.
257finish_cmds=""
258
259# Same as above, but a single script fragment to be evaled but not shown.
260finish_eval=""
261
262# Take the output of nm and produce a listing of raw symbols and C names.
263global_symbol_pipe="sed -n -e 's/^.*[ ]\\([ABCDGIRSTW][ABCDGIRSTW]*\\)[ ][ ]*_\\([_A-Za-z][_A-Za-z0-9]*\\)\$/\\1 _\\2 \\2/p'"
264
265# Transform the output of nm in a proper C declaration
266global_symbol_to_cdecl="sed -n -e 's/^. .* \\(.*\\)\$/extern int \\1;/p'"
267
268# Transform the output of nm in a C name address pair
269global_symbol_to_c_name_address="sed -n -e 's/^: \\([^ ]*\\) \$/ {\\\"\\1\\\", (lt_ptr) 0},/p' -e 's/^[BCDEGRST] \\([^ ]*\\) \\([^ ]*\\)\$/ {\"\\2\", (lt_ptr) \\&\\2},/p'"
270
271# This is the shared library runtime path variable.
272runpath_var=
273
274# This is the shared library path variable.
275shlibpath_var=LIBPATH
276
277# Is shlibpath searched before the hard-coded library search path?
278shlibpath_overrides_runpath=unknown
279
280# How to hardcode a shared library path into an executable.
281hardcode_action=immediate
282
283# Whether we should hardcode library paths into libraries.
284hardcode_into_libs=no
285
286# Flag to hardcode $libdir into a binary during linking.
287# This must work even if $libdir does not exist.
288hardcode_libdir_flag_spec="-L\$libdir"
289
290# If ld is used when linking, flag to hardcode $libdir into
291# a binary during linking. This must work even if $libdir does
292# not exist.
293hardcode_libdir_flag_spec_ld=""
294
295# Whether we need a single -rpath flag with a separated argument.
296hardcode_libdir_separator=""
297
298# Set to yes if using DIR/libNAME during linking hardcodes DIR into the
299# resulting binary.
300hardcode_direct=no
301
302# Set to yes if using the -LDIR flag during linking hardcodes DIR into the
303# resulting binary.
304hardcode_minus_L=yes
305
306# Set to yes if using SHLIBPATH_VAR=DIR during linking hardcodes DIR into
307# the resulting binary.
308hardcode_shlibpath_var=unsupported
309
310# Set to yes if building a shared library automatically hardcodes DIR into the library
311# and all subsequent libraries and executables linked against it.
312hardcode_automatic=no
313
314# Variables whose values should be saved in libtool wrapper scripts and
315# restored at relink time.
316variables_saved_for_relink="PATH GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH"
317
318# Whether libtool must link a program against all its dependency libraries.
319link_all_deplibs=unknown
320
321# Compile-time system search path for libraries
322sys_lib_search_path_spec=" =L:/usr/lib/gcc-lib/i386-pc-os2-emx/3.3.5/ L:/usr/lib/gcc-lib/ L:/usr/lib/gcc-lib/i386-pc-os2-emx/3.3.5/i386-pc-os2-emx/3.3.5/ L:/usr/lib/gcc-lib/i386-pc-os2-emx/3.3.5/ L:/usr/lib/i386-pc-os2-emx/3.3.5/ L:/usr/lib/ Z:/lib/i386-pc-os2-emx/3.3.5/ Z:/lib/ R:/emx/lib/i386-pc-os2-emx/3.3.5/ R:/emx/lib/ F:/emx/lib/i386-pc-os2-emx/3.3.5/ F:/emx/lib/ L:/orbit2-2.14.0/i386-pc-os2-emx/3.3.5/ L:/orbit2-2.14.0/ L:/USR/lib/gcc-lib/i386-pc-os2-emx/3.3.5/ L:/usr/lib/gcc/i386-pc-os2-emx/3.3.5/ L:/usr/i386-pc-os2-emx/lib/i386-pc-os2-emx/3.3.5/ L:/usr/i386-pc-os2-emx/lib/ L:/USR/i386-pc-os2-emx/lib/i386-pc-os2-emx/3.3.5/ L:/USR/i386-pc-os2-emx/lib/ L:/usr/lib/i386-pc-os2-emx/3.3.5/ L:/usr/lib/ L:/gcc/lib/i386-pc-os2-emx/3.3.5/ L:/gcc/lib/ L:/lib/i386-pc-os2-emx/3.3.5/ L:/lib/ L:/usr/lib/i386-pc-os2-emx/3.3.5/ L:/usr/lib/"
323
324# Run-time system search path for libraries
325sys_lib_dlsearch_path_spec="/lib /usr/lib"
326
327# Fix the shell variable $srcfile for the compiler.
328fix_srcfile_path=""
329
330# Set to yes if exported symbols are required.
331always_export_symbols=no
332
333# The commands to list exported symbols.
334export_symbols_cmds="\$NM \$libobjs \$convenience | \$global_symbol_pipe | \$SED 's/.* //' | sort | uniq > \$export_symbols"
335
336# The commands to extract the exported symbol list from a shared archive.
337extract_expsyms_cmds=""
338
339# Symbols that should not be listed in the preloaded symbols.
340exclude_expsyms="_GLOBAL_OFFSET_TABLE_"
341
342# Symbols that must always be exported.
343include_expsyms=""
344
345# ### END LIBTOOL CONFIG
346
347# ltmain.sh - Provide generalized library-building support services.
348# NOTE: Changing this file will not affect anything until you rerun configure.
349#
350# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005
351# Free Software Foundation, Inc.
352# Originally by Gordon Matzigkeit <gord@gnu.ai.mit.edu>, 1996
353#
354# This program is free software; you can redistribute it and/or modify
355# it under the terms of the GNU General Public License as published by
356# the Free Software Foundation; either version 2 of the License, or
357# (at your option) any later version.
358#
359# This program is distributed in the hope that it will be useful, but
360# WITHOUT ANY WARRANTY; without even the implied warranty of
361# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
362# General Public License for more details.
363#
364# You should have received a copy of the GNU General Public License
365# along with this program; if not, write to the Free Software
366# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
367#
368# As a special exception to the GNU General Public License, if you
369# distribute this file as part of a program that contains a
370# configuration script generated by Autoconf, you may include it under
371# the same distribution terms that you use for the rest of that program.
372
373basename="s,^.*/,,g"
374
375# Work around backward compatibility issue on IRIX 6.5. On IRIX 6.4+, sh
376# is ksh but when the shell is invoked as "sh" and the current value of
377# the _XPG environment variable is not equal to 1 (one), the special
378# positional parameter $0, within a function call, is the name of the
379# function.
380progpath="$0"
381
382# The name of this program:
383progname=`echo "$progpath" | $SED $basename`
384modename="$progname"
385
386# Global variables:
387EXIT_SUCCESS=0
388EXIT_FAILURE=1
389
390PROGRAM=ltmain.sh
391PACKAGE=libtool
392VERSION=1.5.18
393TIMESTAMP=" (1.1220.2.245 2005/05/16 08:55:27)"
394
395# See if we are running on zsh, and set the options which allow our
396# commands through without removal of \ escapes.
397if test -n "${ZSH_VERSION+set}" ; then
398 setopt NO_GLOB_SUBST
399fi
400
401# Check that we have a working $echo.
402if test "X$1" = X--no-reexec; then
403 # Discard the --no-reexec flag, and continue.
404 shift
405elif test "X$1" = X--fallback-echo; then
406 # Avoid inline document here, it may be left over
407 :
408elif test "X`($echo '\t') 2>/dev/null`" = 'X\t'; then
409 # Yippee, $echo works!
410 :
411else
412 # Restart under the correct shell, and then maybe $echo will work.
413 exec $SHELL "$progpath" --no-reexec ${1+"$@"}
414fi
415
416if test "X$1" = X--fallback-echo; then
417 # used as fallback echo
418 shift
419 cat <<EOF
420$*
421EOF
422 exit $EXIT_SUCCESS
423fi
424
425default_mode=
426help="Try \`$progname --help' for more information."
427magic="%%%MAGIC variable%%%"
428mkdir="mkdir"
429mv="mv -f"
430rm="rm -f"
431
432# Sed substitution that helps us do robust quoting. It backslashifies
433# metacharacters that are still active within double-quoted strings.
434Xsed="${SED}"' -e 1s/^X//'
435sed_quote_subst='s/\([\\`\\"$\\\\]\)/\\\1/g'
436# test EBCDIC or ASCII
437case `echo A|tr A '\301'` in
438 A) # EBCDIC based system
439 SP2NL="tr '\100' '\n'"
440 NL2SP="tr '\r\n' '\100\100'"
441 ;;
442 *) # Assume ASCII based system
443 SP2NL="tr '\040' '\012'"
444 NL2SP="tr '\015\012' '\040\040'"
445 ;;
446esac
447
448# NLS nuisances.
449# Only set LANG and LC_ALL to C if already set.
450# These must not be set unconditionally because not all systems understand
451# e.g. LANG=C (notably SCO).
452# We save the old values to restore during execute mode.
453if test "${LC_ALL+set}" = set; then
454 save_LC_ALL="$LC_ALL"; LC_ALL=C; export LC_ALL
455fi
456if test "${LANG+set}" = set; then
457 save_LANG="$LANG"; LANG=C; export LANG
458fi
459
460# Make sure IFS has a sensible default
461lt_nl='
462'
463IFS=" $lt_nl"
464
465if test "$build_libtool_libs" != yes && test "$build_old_libs" != yes; then
466 $echo "$modename: not configured to build any kind of library" 1>&2
467 $echo "Fatal configuration error. See the $PACKAGE docs for more information." 1>&2
468 exit $EXIT_FAILURE
469fi
470
471# Global variables.
472mode=$default_mode
473nonopt=
474prev=
475prevopt=
476run=
477show="$echo"
478show_help=
479execute_dlfiles=
480lo2o="s/\\.lo\$/.${objext}/"
481o2lo="s/\\.${objext}\$/.lo/"
482quote_scanset='[[~#^*{};<>?'"'"' ]'
483
484#####################################
485# Shell function definitions:
486# This seems to be the best place for them
487
488# func_win32_libid arg
489# return the library type of file 'arg'
490#
491# Need a lot of goo to handle *both* DLLs and import libs
492# Has to be a shell function in order to 'eat' the argument
493# that is supplied when $file_magic_command is called.
494func_win32_libid ()
495{
496 win32_libid_type="unknown"
497 win32_fileres=`file -L $1 2>/dev/null`
498 case $win32_fileres in
499 *ar\ archive\ import\ library*) # definitely import
500 win32_libid_type="x86 archive import"
501 ;;
502 *ar\ archive*) # could be an import, or static
503 if eval $OBJDUMP -f $1 | $SED -e '10q' 2>/dev/null | \
504 $EGREP -e 'file format pe-i386(.*architecture: i386)?' >/dev/null ; then
505 win32_nmres=`eval $NM -f posix -A $1 | \
506 sed -n -e '1,100{/ I /{x;/import/!{s/^/import/;h;p;};x;};}'`
507 if test "X$win32_nmres" = "Ximport" ; then
508 win32_libid_type="x86 archive import"
509 else
510 win32_libid_type="x86 archive static"
511 fi
512 fi
513 ;;
514 *DLL*)
515 win32_libid_type="x86 DLL"
516 ;;
517 *executable*) # but shell scripts are "executable" too...
518 case $win32_fileres in
519 *MS\ Windows\ PE\ Intel*)
520 win32_libid_type="x86 DLL"
521 ;;
522 esac
523 ;;
524 esac
525 $echo $win32_libid_type
526}
527
528
529# func_infer_tag arg
530# Infer tagged configuration to use if any are available and
531# if one wasn't chosen via the "--tag" command line option.
532# Only attempt this if the compiler in the base compile
533# command doesn't match the default compiler.
534# arg is usually of the form 'gcc ...'
535func_infer_tag ()
536{
537 if test -n "$available_tags" && test -z "$tagname"; then
538 CC_quoted=
539 for arg in $CC; do
540 case $arg in
541 *$quote_scanset* | *]* | *\|* | *\&* | *\(* | *\)* | "")
542 arg="\"$arg\""
543 ;;
544 esac
545 CC_quoted="$CC_quoted $arg"
546 done
547 case $@ in
548 # Blanks in the command may have been stripped by the calling shell,
549 # but not from the CC environment variable when configure was run.
550 " $CC "* | "$CC "* | " `$echo $CC` "* | "`$echo $CC` "* | " $CC_quoted"* | "$CC_quoted "* | " `$echo $CC_quoted` "* | "`$echo $CC_quoted` "*) ;;
551 # Blanks at the start of $base_compile will cause this to fail
552 # if we don't check for them as well.
553 *)
554 for z in $available_tags; do
555 if grep "^# ### BEGIN LIBTOOL TAG CONFIG: $z$" < "$progpath" > /dev/null; then
556 # Evaluate the configuration.
557 eval "`${SED} -n -e '/^# ### BEGIN LIBTOOL TAG CONFIG: '$z'$/,/^# ### END LIBTOOL TAG CONFIG: '$z'$/p' < $progpath`"
558 CC_quoted=
559 for arg in $CC; do
560 # Double-quote args containing other shell metacharacters.
561 case $arg in
562 *$quote_scanset* | *]* | *\|* | *\&* | *\(* | *\)* | "")
563 arg="\"$arg\""
564 ;;
565 esac
566 CC_quoted="$CC_quoted $arg"
567 done
568 case "$@ " in
569 " $CC "* | "$CC "* | " `$echo $CC` "* | "`$echo $CC` "* | " $CC_quoted"* | "$CC_quoted "* | " `$echo $CC_quoted` "* | "`$echo $CC_quoted` "*)
570 # The compiler in the base compile command matches
571 # the one in the tagged configuration.
572 # Assume this is the tagged configuration we want.
573 tagname=$z
574 break
575 ;;
576 esac
577 fi
578 done
579 # If $tagname still isn't set, then no tagged configuration
580 # was found and let the user know that the "--tag" command
581 # line option must be used.
582 if test -z "$tagname"; then
583 $echo "$modename: unable to infer tagged configuration"
584 $echo "$modename: specify a tag with \`--tag'" 1>&2
585 exit $EXIT_FAILURE
586# else
587# $echo "$modename: using $tagname tagged configuration"
588 fi
589 ;;
590 esac
591 fi
592}
593
594
595# func_extract_an_archive dir oldlib
596func_extract_an_archive ()
597{
598 f_ex_an_ar_dir="$1"; shift
599 f_ex_an_ar_oldlib="$1"
600
601 $show "(cd $f_ex_an_ar_dir && $AR x $f_ex_an_ar_oldlib)"
602 $run eval "(cd \$f_ex_an_ar_dir && $AR x \$f_ex_an_ar_oldlib)" || exit $?
603 if ($AR t "$f_ex_an_ar_oldlib" | sort | sort -uc >/dev/null 2>&1); then
604 :
605 else
606 $echo "$modename: ERROR: object name conflicts: $f_ex_an_ar_dir/$f_ex_an_ar_oldlib" 1>&2
607 exit $EXIT_FAILURE
608 fi
609}
610
611# func_extract_archives gentop oldlib ...
612func_extract_archives ()
613{
614 my_gentop="$1"; shift
615 my_oldlibs=${1+"$@"}
616 my_oldobjs=""
617 my_xlib=""
618 my_xabs=""
619 my_xdir=""
620 my_status=""
621
622 $show "${rm}r $my_gentop"
623 $run ${rm}r "$my_gentop"
624 $show "$mkdir $my_gentop"
625 $run $mkdir "$my_gentop"
626 my_status=$?
627 if test "$my_status" -ne 0 && test ! -d "$my_gentop"; then
628 exit $my_status
629 fi
630
631 for my_xlib in $my_oldlibs; do
632 # Extract the objects.
633 case $my_xlib in
634 [\\/]* | [A-Za-z]:[\\/]*) my_xabs="$my_xlib" ;;
635 *) my_xabs=`pwd`"/$my_xlib" ;;
636 esac
637 my_xlib=`$echo "X$my_xlib" | $Xsed -e 's%^.*/%%'`
638 my_xdir="$my_gentop/$my_xlib"
639
640 $show "${rm}r $my_xdir"
641 $run ${rm}r "$my_xdir"
642 $show "$mkdir $my_xdir"
643 $run $mkdir "$my_xdir"
644 status=$?
645 if test "$status" -ne 0 && test ! -d "$my_xdir"; then
646 exit $status
647 fi
648 case $host in
649 *-darwin*)
650 $show "Extracting $my_xabs"
651 # Do not bother doing anything if just a dry run
652 if test -z "$run"; then
653 darwin_orig_dir=`pwd`
654 cd $my_xdir || exit $?
655 darwin_archive=$my_xabs
656 darwin_curdir=`pwd`
657 darwin_base_archive=`$echo "X$darwin_archive" | $Xsed -e 's%^.*/%%'`
658 darwin_arches=`lipo -info "$darwin_archive" 2>/dev/null | $EGREP Architectures 2>/dev/null`
659 if test -n "$darwin_arches"; then
660 darwin_arches=`echo "$darwin_arches" | $SED -e 's/.*are://'`
661 darwin_arch=
662 $show "$darwin_base_archive has multiple architectures $darwin_arches"
663 for darwin_arch in $darwin_arches ; do
664 mkdir -p "unfat-$$/${darwin_base_archive}-${darwin_arch}"
665 lipo -thin $darwin_arch -output "unfat-$$/${darwin_base_archive}-${darwin_arch}/${darwin_base_archive}" "${darwin_archive}"
666 cd "unfat-$$/${darwin_base_archive}-${darwin_arch}"
667 func_extract_an_archive "`pwd`" "${darwin_base_archive}"
668 cd "$darwin_curdir"
669 $rm "unfat-$$/${darwin_base_archive}-${darwin_arch}/${darwin_base_archive}"
670 done # $darwin_arches
671 ## Okay now we have a bunch of thin objects, gotta fatten them up :)
672 darwin_filelist=`find unfat-$$ -type f -name \*.o -print -o -name \*.lo -print| xargs basename | sort -u | $NL2SP`
673 darwin_file=
674 darwin_files=
675 for darwin_file in $darwin_filelist; do
676 darwin_files=`find unfat-$$ -name $darwin_file -print | $NL2SP`
677 lipo -create -output "$darwin_file" $darwin_files
678 done # $darwin_filelist
679 ${rm}r unfat-$$
680 cd "$darwin_orig_dir"
681 else
682 cd "$darwin_orig_dir"
683 func_extract_an_archive "$my_xdir" "$my_xabs"
684 fi # $darwin_arches
685 fi # $run
686 ;;
687 *)
688 func_extract_an_archive "$my_xdir" "$my_xabs"
689 ;;
690 esac
691 my_oldobjs="$my_oldobjs "`find $my_xdir -name \*.$objext -print -o -name \*.lo -print | $NL2SP`
692 done
693 func_extract_archives_result="$my_oldobjs"
694}
695# End of Shell function definitions
696#####################################
697
698# Darwin sucks
699eval std_shrext=\"$shrext_cmds\"
700
701# Parse our command line options once, thoroughly.
702while test "$#" -gt 0
703do
704 arg="$1"
705 shift
706
707 case $arg in
708 -*=*) optarg=`$echo "X$arg" | $Xsed -e 's/[-_a-zA-Z0-9]*=//'` ;;
709 *) optarg= ;;
710 esac
711
712 # If the previous option needs an argument, assign it.
713 if test -n "$prev"; then
714 case $prev in
715 execute_dlfiles)
716 execute_dlfiles="$execute_dlfiles $arg"
717 ;;
718 tag)
719 tagname="$arg"
720 preserve_args="${preserve_args}=$arg"
721
722 # Check whether tagname contains only valid characters
723 case $tagname in
724 *[!-_A-Za-z0-9,/]*)
725 $echo "$progname: invalid tag name: $tagname" 1>&2
726 exit $EXIT_FAILURE
727 ;;
728 esac
729
730 case $tagname in
731 CC)
732 # Don't test for the "default" C tag, as we know, it's there, but
733 # not specially marked.
734 ;;
735 *)
736 if grep "^# ### BEGIN LIBTOOL TAG CONFIG: $tagname$" < "$progpath" > /dev/null; then
737 taglist="$taglist $tagname"
738 # Evaluate the configuration.
739 eval "`${SED} -n -e '/^# ### BEGIN LIBTOOL TAG CONFIG: '$tagname'$/,/^# ### END LIBTOOL TAG CONFIG: '$tagname'$/p' < $progpath`"
740 else
741 $echo "$progname: ignoring unknown tag $tagname" 1>&2
742 fi
743 ;;
744 esac
745 ;;
746 *)
747 eval "$prev=\$arg"
748 ;;
749 esac
750
751 prev=
752 prevopt=
753 continue
754 fi
755
756 # Have we seen a non-optional argument yet?
757 case $arg in
758 --help)
759 show_help=yes
760 ;;
761
762 --version)
763 $echo "$PROGRAM (GNU $PACKAGE) $VERSION$TIMESTAMP"
764 $echo
765 $echo "Copyright (C) 2005 Free Software Foundation, Inc."
766 $echo "This is free software; see the source for copying conditions. There is NO"
767 $echo "warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE."
768 exit $?
769 ;;
770
771 --config)
772 ${SED} -e '1,/^# ### BEGIN LIBTOOL CONFIG/d' -e '/^# ### END LIBTOOL CONFIG/,$d' $progpath
773 # Now print the configurations for the tags.
774 for tagname in $taglist; do
775 ${SED} -n -e "/^# ### BEGIN LIBTOOL TAG CONFIG: $tagname$/,/^# ### END LIBTOOL TAG CONFIG: $tagname$/p" < "$progpath"
776 done
777 exit $?
778 ;;
779
780 --debug)
781 $echo "$progname: enabling shell trace mode"
782 set -x
783 preserve_args="$preserve_args $arg"
784 ;;
785
786 --dry-run | -n)
787 run=:
788 ;;
789
790 --features)
791 $echo "host: $host"
792 if test "$build_libtool_libs" = yes; then
793 $echo "enable shared libraries"
794 else
795 $echo "disable shared libraries"
796 fi
797 if test "$build_old_libs" = yes; then
798 $echo "enable static libraries"
799 else
800 $echo "disable static libraries"
801 fi
802 exit $?
803 ;;
804
805 --finish) mode="finish" ;;
806
807 --mode) prevopt="--mode" prev=mode ;;
808 --mode=*) mode="$optarg" ;;
809
810 --preserve-dup-deps) duplicate_deps="yes" ;;
811
812 --quiet | --silent)
813 show=:
814 preserve_args="$preserve_args $arg"
815 ;;
816
817 --tag) prevopt="--tag" prev=tag ;;
818 --tag=*)
819 set tag "$optarg" ${1+"$@"}
820 shift
821 prev=tag
822 preserve_args="$preserve_args --tag"
823 ;;
824
825 -dlopen)
826 prevopt="-dlopen"
827 prev=execute_dlfiles
828 ;;
829
830 -*)
831 $echo "$modename: unrecognized option \`$arg'" 1>&2
832 $echo "$help" 1>&2
833 exit $EXIT_FAILURE
834 ;;
835
836 *)
837 nonopt="$arg"
838 break
839 ;;
840 esac
841done
842
843if test -n "$prevopt"; then
844 $echo "$modename: option \`$prevopt' requires an argument" 1>&2
845 $echo "$help" 1>&2
846 exit $EXIT_FAILURE
847fi
848
849# If this variable is set in any of the actions, the command in it
850# will be execed at the end. This prevents here-documents from being
851# left over by shells.
852exec_cmd=
853
854if test -z "$show_help"; then
855
856 # Infer the operation mode.
857 if test -z "$mode"; then
858 $echo "*** Warning: inferring the mode of operation is deprecated." 1>&2
859 $echo "*** Future versions of Libtool will require --mode=MODE be specified." 1>&2
860 case $nonopt in
861 *cc | cc* | *++ | gcc* | *-gcc* | g++* | xlc*)
862 mode=link
863 for arg
864 do
865 case $arg in
866 -c)
867 mode=compile
868 break
869 ;;
870 esac
871 done
872 ;;
873 *db | *dbx | *strace | *truss)
874 mode=execute
875 ;;
876 *install*|cp|mv)
877 mode=install
878 ;;
879 *rm)
880 mode=uninstall
881 ;;
882 *)
883 # If we have no mode, but dlfiles were specified, then do execute mode.
884 test -n "$execute_dlfiles" && mode=execute
885
886 # Just use the default operation mode.
887 if test -z "$mode"; then
888 if test -n "$nonopt"; then
889 $echo "$modename: warning: cannot infer operation mode from \`$nonopt'" 1>&2
890 else
891 $echo "$modename: warning: cannot infer operation mode without MODE-ARGS" 1>&2
892 fi
893 fi
894 ;;
895 esac
896 fi
897
898 # Only execute mode is allowed to have -dlopen flags.
899 if test -n "$execute_dlfiles" && test "$mode" != execute; then
900 $echo "$modename: unrecognized option \`-dlopen'" 1>&2
901 $echo "$help" 1>&2
902 exit $EXIT_FAILURE
903 fi
904
905 # Change the help message to a mode-specific one.
906 generic_help="$help"
907 help="Try \`$modename --help --mode=$mode' for more information."
908
909 # These modes are in order of execution frequency so that they run quickly.
910 case $mode in
911 # libtool compile mode
912 compile)
913 modename="$modename: compile"
914 # Get the compilation command and the source file.
915 base_compile=
916 srcfile="$nonopt" # always keep a non-empty value in "srcfile"
917 suppress_opt=yes
918 suppress_output=
919 arg_mode=normal
920 libobj=
921 later=
922
923 for arg
924 do
925 case "$arg_mode" in
926 arg )
927 # do not "continue". Instead, add this to base_compile
928 lastarg="$arg"
929 arg_mode=normal
930 ;;
931
932 target )
933 libobj="$arg"
934 arg_mode=normal
935 continue
936 ;;
937
938 normal )
939 # Accept any command-line options.
940 case $arg in
941 -o)
942 if test -n "$libobj" ; then
943 $echo "$modename: you cannot specify \`-o' more than once" 1>&2
944 exit $EXIT_FAILURE
945 fi
946 arg_mode=target
947 continue
948 ;;
949
950 -static | -prefer-pic | -prefer-non-pic)
951 later="$later $arg"
952 continue
953 ;;
954
955 -no-suppress)
956 suppress_opt=no
957 continue
958 ;;
959
960 -Xcompiler)
961 arg_mode=arg # the next one goes into the "base_compile" arg list
962 continue # The current "srcfile" will either be retained or
963 ;; # replaced later. I would guess that would be a bug.
964
965 -Wc,*)
966 args=`$echo "X$arg" | $Xsed -e "s/^-Wc,//"`
967 lastarg=
968 save_ifs="$IFS"; IFS=','
969 for arg in $args; do
970 IFS="$save_ifs"
971
972 # Double-quote args containing other shell metacharacters.
973 # Many Bourne shells cannot handle close brackets correctly
974 # in scan sets, so we specify it separately.
975 case $arg in
976 *$quote_scanset* | *]* | *\|* | *\&* | *\(* | *\)* | "")
977 arg="\"$arg\""
978 ;;
979 esac
980 lastarg="$lastarg $arg"
981 done
982 IFS="$save_ifs"
983 lastarg=`$echo "X$lastarg" | $Xsed -e "s/^ //"`
984
985 # Add the arguments to base_compile.
986 base_compile="$base_compile $lastarg"
987 continue
988 ;;
989
990 * )
991 # Accept the current argument as the source file.
992 # The previous "srcfile" becomes the current argument.
993 #
994 lastarg="$srcfile"
995 srcfile="$arg"
996 ;;
997 esac # case $arg
998 ;;
999 esac # case $arg_mode
1000
1001 # Aesthetically quote the previous argument.
1002 lastarg=`$echo "X$lastarg" | $Xsed -e "$sed_quote_subst"`
1003
1004 case $lastarg in
1005 # Double-quote args containing other shell metacharacters.
1006 # Many Bourne shells cannot handle close brackets correctly
1007 # in scan sets, and some SunOS ksh mistreat backslash-escaping
1008 # in scan sets (worked around with variable expansion),
1009 # and furthermore cannot handle '|' '&' '(' ')' in scan sets
1010 # at all, so we specify them separately.
1011 *$quote_scanset* | *]* | *\|* | *\&* | *\(* | *\)* | "")
1012 lastarg="\"$lastarg\""
1013 ;;
1014 esac
1015
1016 base_compile="$base_compile $lastarg"
1017 done # for arg
1018
1019 case $arg_mode in
1020 arg)
1021 $echo "$modename: you must specify an argument for -Xcompile"
1022 exit $EXIT_FAILURE
1023 ;;
1024 target)
1025 $echo "$modename: you must specify a target with \`-o'" 1>&2
1026 exit $EXIT_FAILURE
1027 ;;
1028 *)
1029 # Get the name of the library object.
1030 [ -z "$libobj" ] && libobj=`$echo "X$srcfile" | $Xsed -e 's%^.*/%%'`
1031 ;;
1032 esac
1033
1034 # Recognize several different file suffixes.
1035 # If the user specifies -o file.o, it is replaced with file.lo
1036 xform='[cCFSifmso]'
1037 case $libobj in
1038 *.ada) xform=ada ;;
1039 *.adb) xform=adb ;;
1040 *.ads) xform=ads ;;
1041 *.asm) xform=asm ;;
1042 *.c++) xform=c++ ;;
1043 *.cc) xform=cc ;;
1044 *.ii) xform=ii ;;
1045 *.class) xform=class ;;
1046 *.cpp) xform=cpp ;;
1047 *.cxx) xform=cxx ;;
1048 *.f90) xform=f90 ;;
1049 *.for) xform=for ;;
1050 *.java) xform=java ;;
1051 esac
1052
1053 libobj=`$echo "X$libobj" | $Xsed -e "s/\.$xform$/.lo/"`
1054
1055 case $libobj in
1056 *.lo) obj=`$echo "X$libobj" | $Xsed -e "$lo2o"` ;;
1057 *)
1058 $echo "$modename: cannot determine name of library object from \`$libobj'" 1>&2
1059 exit $EXIT_FAILURE
1060 ;;
1061 esac
1062
1063 func_infer_tag $base_compile
1064
1065 for arg in $later; do
1066 case $arg in
1067 -static)
1068 build_old_libs=yes
1069 continue
1070 ;;
1071
1072 -prefer-pic)
1073 pic_mode=yes
1074 continue
1075 ;;
1076
1077 -prefer-non-pic)
1078 pic_mode=no
1079 continue
1080 ;;
1081 esac
1082 done
1083
1084 qlibobj=`$echo "X$libobj" | $Xsed -e "$sed_quote_subst"`
1085 case $qlibobj in
1086 *$quote_scanset* | *]* | *\|* | *\&* | *\(* | *\)* | "")
1087 qlibobj="\"$qlibobj\"" ;;
1088 esac
1089 if test "X$libobj" != "X$qlibobj"; then
1090 $echo "$modename: libobj name \`$libobj' may not contain shell special characters."
1091 exit $EXIT_FAILURE
1092 fi
1093 objname=`$echo "X$obj" | $Xsed -e 's%^.*/%%'`
1094 xdir=`$echo "X$obj" | $Xsed -e 's%/[^/]*$%%'`
1095 if test "X$xdir" = "X$obj"; then
1096 xdir=
1097 else
1098 xdir=$xdir/
1099 fi
1100 lobj=${xdir}$objdir/$objname
1101
1102 if test -z "$base_compile"; then
1103 $echo "$modename: you must specify a compilation command" 1>&2
1104 $echo "$help" 1>&2
1105 exit $EXIT_FAILURE
1106 fi
1107
1108 # Delete any leftover library objects.
1109 if test "$build_old_libs" = yes; then
1110 removelist="$obj $lobj $libobj ${libobj}T"
1111 else
1112 removelist="$lobj $libobj ${libobj}T"
1113 fi
1114
1115 $run $rm $removelist
1116 trap "$run $rm $removelist; exit $EXIT_FAILURE" 1 2 15
1117
1118 # On Cygwin there's no "real" PIC flag so we must build both object types
1119 case $host_os in
1120 cygwin* | mingw* | pw32* | os2*)
1121 pic_mode=default
1122 ;;
1123 esac
1124 if test "$pic_mode" = no && test "$deplibs_check_method" != pass_all; then
1125 # non-PIC code in shared libraries is not supported
1126 pic_mode=default
1127 fi
1128
1129 # Calculate the filename of the output object if compiler does
1130 # not support -o with -c
1131 if test "$compiler_c_o" = no; then
1132 output_obj=`$echo "X$srcfile" | $Xsed -e 's%^.*/%%' -e 's%\.[^.]*$%%'`.${objext}
1133 lockfile="$output_obj.lock"
1134 removelist="$removelist $output_obj $lockfile"
1135 trap "$run $rm $removelist; exit $EXIT_FAILURE" 1 2 15
1136 else
1137 output_obj=
1138 need_locks=no
1139 lockfile=
1140 fi
1141
1142 # Lock this critical section if it is needed
1143 # We use this script file to make the link, it avoids creating a new file
1144 if test "$need_locks" = yes; then
1145 until $run ln "$progpath" "$lockfile" 2>/dev/null; do
1146 $show "Waiting for $lockfile to be removed"
1147 sleep 2
1148 done
1149 elif test "$need_locks" = warn; then
1150 if test -f "$lockfile"; then
1151 $echo "\
1152*** ERROR, $lockfile exists and contains:
1153`cat $lockfile 2>/dev/null`
1154
1155This indicates that another process is trying to use the same
1156temporary object file, and libtool could not work around it because
1157your compiler does not support \`-c' and \`-o' together. If you
1158repeat this compilation, it may succeed, by chance, but you had better
1159avoid parallel builds (make -j) in this platform, or get a better
1160compiler."
1161
1162 $run $rm $removelist
1163 exit $EXIT_FAILURE
1164 fi
1165 $echo "$srcfile" > "$lockfile"
1166 fi
1167
1168 if test -n "$fix_srcfile_path"; then
1169 eval srcfile=\"$fix_srcfile_path\"
1170 fi
1171 qsrcfile=`$echo "X$srcfile" | $Xsed -e "$sed_quote_subst"`
1172 case $qsrcfile in
1173 *$quote_scanset* | *]* | *\|* | *\&* | *\(* | *\)* | "")
1174 qsrcfile="\"$qsrcfile\"" ;;
1175 esac
1176
1177 $run $rm "$libobj" "${libobj}T"
1178
1179 # Create a libtool object file (analogous to a ".la" file),
1180 # but don't create it if we're doing a dry run.
1181 test -z "$run" && cat > ${libobj}T <<EOF
1182# $libobj - a libtool object file
1183# Generated by $PROGRAM - GNU $PACKAGE $VERSION$TIMESTAMP
1184#
1185# Please DO NOT delete this file!
1186# It is necessary for linking the library.
1187
1188# Name of the PIC object.
1189EOF
1190
1191 # Only build a PIC object if we are building libtool libraries.
1192 if test "$build_libtool_libs" = yes; then
1193 # Without this assignment, base_compile gets emptied.
1194 fbsd_hideous_sh_bug=$base_compile
1195
1196 if test "$pic_mode" != no; then
1197 command="$base_compile $qsrcfile $pic_flag"
1198 else
1199 # Don't build PIC code
1200 command="$base_compile $qsrcfile"
1201 fi
1202
1203 if test ! -d "${xdir}$objdir"; then
1204 $show "$mkdir ${xdir}$objdir"
1205 $run $mkdir ${xdir}$objdir
1206 status=$?
1207 if test "$status" -ne 0 && test ! -d "${xdir}$objdir"; then
1208 exit $status
1209 fi
1210 fi
1211
1212 if test -z "$output_obj"; then
1213 # Place PIC objects in $objdir
1214 command="$command -o $lobj"
1215 fi
1216
1217 $run $rm "$lobj" "$output_obj"
1218
1219 $show "$command"
1220 if $run eval "$command"; then :
1221 else
1222 test -n "$output_obj" && $run $rm $removelist
1223 exit $EXIT_FAILURE
1224 fi
1225
1226 if test "$need_locks" = warn &&
1227 test "X`cat $lockfile 2>/dev/null`" != "X$srcfile"; then
1228 $echo "\
1229*** ERROR, $lockfile contains:
1230`cat $lockfile 2>/dev/null`
1231
1232but it should contain:
1233$srcfile
1234
1235This indicates that another process is trying to use the same
1236temporary object file, and libtool could not work around it because
1237your compiler does not support \`-c' and \`-o' together. If you
1238repeat this compilation, it may succeed, by chance, but you had better
1239avoid parallel builds (make -j) in this platform, or get a better
1240compiler."
1241
1242 $run $rm $removelist
1243 exit $EXIT_FAILURE
1244 fi
1245
1246 # Just move the object if needed, then go on to compile the next one
1247 if test -n "$output_obj" && test "X$output_obj" != "X$lobj"; then
1248 $show "$mv $output_obj $lobj"
1249 if $run $mv $output_obj $lobj; then :
1250 else
1251 error=$?
1252 $run $rm $removelist
1253 exit $error
1254 fi
1255 fi
1256
1257 # Append the name of the PIC object to the libtool object file.
1258 test -z "$run" && cat >> ${libobj}T <<EOF
1259pic_object='$objdir/$objname'
1260
1261EOF
1262
1263 # Allow error messages only from the first compilation.
1264 if test "$suppress_opt" = yes; then
1265 suppress_output=' >/dev/null 2>&1'
1266 fi
1267 else
1268 # No PIC object so indicate it doesn't exist in the libtool
1269 # object file.
1270 test -z "$run" && cat >> ${libobj}T <<EOF
1271pic_object=none
1272
1273EOF
1274 fi
1275
1276 # Only build a position-dependent object if we build old libraries.
1277 if test "$build_old_libs" = yes; then
1278 if test "$pic_mode" != yes; then
1279 # Don't build PIC code
1280 command="$base_compile $qsrcfile"
1281 else
1282 command="$base_compile $qsrcfile $pic_flag"
1283 fi
1284 if test "$compiler_c_o" = yes; then
1285 command="$command -o $obj"
1286 fi
1287
1288 # Suppress compiler output if we already did a PIC compilation.
1289 command="$command$suppress_output"
1290 $run $rm "$obj" "$output_obj"
1291 $show "$command"
1292 if $run eval "$command"; then :
1293 else
1294 $run $rm $removelist
1295 exit $EXIT_FAILURE
1296 fi
1297
1298 if test "$need_locks" = warn &&
1299 test "X`cat $lockfile 2>/dev/null`" != "X$srcfile"; then
1300 $echo "\
1301*** ERROR, $lockfile contains:
1302`cat $lockfile 2>/dev/null`
1303
1304but it should contain:
1305$srcfile
1306
1307This indicates that another process is trying to use the same
1308temporary object file, and libtool could not work around it because
1309your compiler does not support \`-c' and \`-o' together. If you
1310repeat this compilation, it may succeed, by chance, but you had better
1311avoid parallel builds (make -j) in this platform, or get a better
1312compiler."
1313
1314 $run $rm $removelist
1315 exit $EXIT_FAILURE
1316 fi
1317
1318 # Just move the object if needed
1319 if test -n "$output_obj" && test "X$output_obj" != "X$obj"; then
1320 $show "$mv $output_obj $obj"
1321 if $run $mv $output_obj $obj; then :
1322 else
1323 error=$?
1324 $run $rm $removelist
1325 exit $error
1326 fi
1327 fi
1328
1329 # Append the name of the non-PIC object the libtool object file.
1330 # Only append if the libtool object file exists.
1331 test -z "$run" && cat >> ${libobj}T <<EOF
1332# Name of the non-PIC object.
1333non_pic_object='$objname'
1334
1335EOF
1336 else
1337 # Append the name of the non-PIC object the libtool object file.
1338 # Only append if the libtool object file exists.
1339 test -z "$run" && cat >> ${libobj}T <<EOF
1340# Name of the non-PIC object.
1341non_pic_object=none
1342
1343EOF
1344 fi
1345
1346 $run $mv "${libobj}T" "${libobj}"
1347
1348 # Unlock the critical section if it was locked
1349 if test "$need_locks" != no; then
1350 $run $rm "$lockfile"
1351 fi
1352
1353 exit $EXIT_SUCCESS
1354 ;;
1355
1356 # libtool link mode
1357 link | relink)
1358 modename="$modename: link"
1359 case $host in
1360 *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2*)
1361 # It is impossible to link a dll without this setting, and
1362 # we shouldn't force the makefile maintainer to figure out
1363 # which system we are compiling for in order to pass an extra
1364 # flag for every libtool invocation.
1365 # allow_undefined=no
1366
1367 # FIXME: Unfortunately, there are problems with the above when trying
1368 # to make a dll which has undefined symbols, in which case not
1369 # even a static library is built. For now, we need to specify
1370 # -no-undefined on the libtool link line when we can be certain
1371 # that all symbols are satisfied, otherwise we get a static library.
1372 allow_undefined=yes
1373 ;;
1374 *)
1375 allow_undefined=yes
1376 ;;
1377 esac
1378 libtool_args="$nonopt"
1379 base_compile="$nonopt $@"
1380 compile_command="$nonopt"
1381 finalize_command="$nonopt"
1382
1383 compile_rpath=
1384 finalize_rpath=
1385 compile_shlibpath=
1386 finalize_shlibpath=
1387 convenience=
1388 old_convenience=
1389 deplibs=
1390 old_deplibs=
1391 compiler_flags=
1392 linker_flags=
1393 dllsearchpath=
1394 lib_search_path=`pwd`
1395 inst_prefix_dir=
1396
1397 avoid_version=no
1398 dlfiles=
1399 dlprefiles=
1400 dlself=no
1401 export_dynamic=no
1402 export_symbols=
1403 export_symbols_regex=
1404 generated=
1405 libobjs=
1406 ltlibs=
1407 module=no
1408 no_install=no
1409 objs=
1410 non_pic_objects=
1411 precious_files_regex=
1412 prefer_static_libs=no
1413 preload=no
1414 prev=
1415 prevarg=
1416 release=
1417 rpath=
1418 xrpath=
1419 perm_rpath=
1420 temp_rpath=
1421 thread_safe=no
1422 vinfo=
1423 vinfo_number=no
1424
1425 func_infer_tag $base_compile
1426
1427 # We need to know -static, to get the right output filenames.
1428 for arg
1429 do
1430 case $arg in
1431 -all-static | -static)
1432 if test "X$arg" = "X-all-static"; then
1433 if test "$build_libtool_libs" = yes && test -z "$link_static_flag"; then
1434 $echo "$modename: warning: complete static linking is impossible in this configuration" 1>&2
1435 fi
1436 if test -n "$link_static_flag"; then
1437 dlopen_self=$dlopen_self_static
1438 fi
1439 else
1440 if test -z "$pic_flag" && test -n "$link_static_flag"; then
1441 dlopen_self=$dlopen_self_static
1442 fi
1443 fi
1444 build_libtool_libs=no
1445 build_old_libs=yes
1446 prefer_static_libs=yes
1447 break
1448 ;;
1449 esac
1450 done
1451
1452 # See if our shared archives depend on static archives.
1453 test -n "$old_archive_from_new_cmds" && build_old_libs=yes
1454
1455 # Go through the arguments, transforming them on the way.
1456 while test "$#" -gt 0; do
1457 arg="$1"
1458 shift
1459 case $arg in
1460 *$quote_scanset* | *]* | *\|* | *\&* | *\(* | *\)* | "")
1461 qarg=\"`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`\" ### testsuite: skip nested quoting test
1462 ;;
1463 *) qarg=$arg ;;
1464 esac
1465 libtool_args="$libtool_args $qarg"
1466
1467 # If the previous option needs an argument, assign it.
1468 if test -n "$prev"; then
1469 case $prev in
1470 output)
1471 compile_command="$compile_command @OUTPUT@"
1472 finalize_command="$finalize_command @OUTPUT@"
1473 ;;
1474 esac
1475
1476 case $prev in
1477 dlfiles|dlprefiles)
1478 if test "$preload" = no; then
1479 # Add the symbol object into the linking commands.
1480 compile_command="$compile_command @SYMFILE@"
1481 finalize_command="$finalize_command @SYMFILE@"
1482 preload=yes
1483 fi
1484 case $arg in
1485 *.la | *.lo) ;; # We handle these cases below.
1486 force)
1487 if test "$dlself" = no; then
1488 dlself=needless
1489 export_dynamic=yes
1490 fi
1491 prev=
1492 continue
1493 ;;
1494 self)
1495 if test "$prev" = dlprefiles; then
1496 dlself=yes
1497 elif test "$prev" = dlfiles && test "$dlopen_self" != yes; then
1498 dlself=yes
1499 else
1500 dlself=needless
1501 export_dynamic=yes
1502 fi
1503 prev=
1504 continue
1505 ;;
1506 *)
1507 if test "$prev" = dlfiles; then
1508 dlfiles="$dlfiles $arg"
1509 else
1510 dlprefiles="$dlprefiles $arg"
1511 fi
1512 prev=
1513 continue
1514 ;;
1515 esac
1516 ;;
1517 expsyms)
1518 export_symbols="$arg"
1519 if test ! -f "$arg"; then
1520 $echo "$modename: symbol file \`$arg' does not exist"
1521 exit $EXIT_FAILURE
1522 fi
1523 prev=
1524 continue
1525 ;;
1526 expsyms_regex)
1527 export_symbols_regex="$arg"
1528 prev=
1529 continue
1530 ;;
1531 inst_prefix)
1532 inst_prefix_dir="$arg"
1533 prev=
1534 continue
1535 ;;
1536 precious_regex)
1537 precious_files_regex="$arg"
1538 prev=
1539 continue
1540 ;;
1541 release)
1542 release="-$arg"
1543 prev=
1544 continue
1545 ;;
1546 objectlist)
1547 if test -f "$arg"; then
1548 save_arg=$arg
1549 moreargs=
1550 for fil in `cat $save_arg`
1551 do
1552# moreargs="$moreargs $fil"
1553 arg=$fil
1554 # A libtool-controlled object.
1555
1556 # Check to see that this really is a libtool object.
1557 if (${SED} -e '2q' $arg | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then
1558 pic_object=
1559 non_pic_object=
1560
1561 # Read the .lo file
1562 # If there is no directory component, then add one.
1563 case $arg in
1564 */* | *\\*) . $arg ;;
1565 *) . ./$arg ;;
1566 esac
1567
1568 if test -z "$pic_object" || \
1569 test -z "$non_pic_object" ||
1570 test "$pic_object" = none && \
1571 test "$non_pic_object" = none; then
1572 $echo "$modename: cannot find name of object for \`$arg'" 1>&2
1573 exit $EXIT_FAILURE
1574 fi
1575
1576 # Extract subdirectory from the argument.
1577 xdir=`$echo "X$arg" | $Xsed -e 's%/[^/]*$%%'`
1578 if test "X$xdir" = "X$arg"; then
1579 xdir=
1580 else
1581 xdir="$xdir/"
1582 fi
1583
1584 if test "$pic_object" != none; then
1585 # Prepend the subdirectory the object is found in.
1586 pic_object="$xdir$pic_object"
1587
1588 if test "$prev" = dlfiles; then
1589 if test "$build_libtool_libs" = yes && test "$dlopen_support" = yes; then
1590 dlfiles="$dlfiles $pic_object"
1591 prev=
1592 continue
1593 else
1594 # If libtool objects are unsupported, then we need to preload.
1595 prev=dlprefiles
1596 fi
1597 fi
1598
1599 # CHECK ME: I think I busted this. -Ossama
1600 if test "$prev" = dlprefiles; then
1601 # Preload the old-style object.
1602 dlprefiles="$dlprefiles $pic_object"
1603 prev=
1604 fi
1605
1606 # A PIC object.
1607 libobjs="$libobjs $pic_object"
1608 arg="$pic_object"
1609 fi
1610
1611 # Non-PIC object.
1612 if test "$non_pic_object" != none; then
1613 # Prepend the subdirectory the object is found in.
1614 non_pic_object="$xdir$non_pic_object"
1615
1616 # A standard non-PIC object
1617 non_pic_objects="$non_pic_objects $non_pic_object"
1618 if test -z "$pic_object" || test "$pic_object" = none ; then
1619 arg="$non_pic_object"
1620 fi
1621 fi
1622 else
1623 # Only an error if not doing a dry-run.
1624 if test -z "$run"; then
1625 $echo "$modename: \`$arg' is not a valid libtool object" 1>&2
1626 exit $EXIT_FAILURE
1627 else
1628 # Dry-run case.
1629
1630 # Extract subdirectory from the argument.
1631 xdir=`$echo "X$arg" | $Xsed -e 's%/[^/]*$%%'`
1632 if test "X$xdir" = "X$arg"; then
1633 xdir=
1634 else
1635 xdir="$xdir/"
1636 fi
1637
1638 pic_object=`$echo "X${xdir}${objdir}/${arg}" | $Xsed -e "$lo2o"`
1639 non_pic_object=`$echo "X${xdir}${arg}" | $Xsed -e "$lo2o"`
1640 libobjs="$libobjs $pic_object"
1641 non_pic_objects="$non_pic_objects $non_pic_object"
1642 fi
1643 fi
1644 done
1645 else
1646 $echo "$modename: link input file \`$save_arg' does not exist"
1647 exit $EXIT_FAILURE
1648 fi
1649 arg=$save_arg
1650 prev=
1651 continue
1652 ;;
1653 rpath | xrpath)
1654 # We need an absolute path.
1655 case $arg in
1656 [\\/]* | [A-Za-z]:[\\/]*) ;;
1657 *)
1658 $echo "$modename: only absolute run-paths are allowed" 1>&2
1659 exit $EXIT_FAILURE
1660 ;;
1661 esac
1662 if test "$prev" = rpath; then
1663 case "$rpath " in
1664 *" $arg "*) ;;
1665 *) rpath="$rpath $arg" ;;
1666 esac
1667 else
1668 case "$xrpath " in
1669 *" $arg "*) ;;
1670 *) xrpath="$xrpath $arg" ;;
1671 esac
1672 fi
1673 prev=
1674 continue
1675 ;;
1676 xcompiler)
1677 compiler_flags="$compiler_flags $qarg"
1678 prev=
1679 compile_command="$compile_command $qarg"
1680 finalize_command="$finalize_command $qarg"
1681 continue
1682 ;;
1683 xlinker)
1684 linker_flags="$linker_flags $qarg"
1685 compiler_flags="$compiler_flags $wl$qarg"
1686 prev=
1687 compile_command="$compile_command $wl$qarg"
1688 finalize_command="$finalize_command $wl$qarg"
1689 continue
1690 ;;
1691 xcclinker)
1692 linker_flags="$linker_flags $qarg"
1693 compiler_flags="$compiler_flags $qarg"
1694 prev=
1695 compile_command="$compile_command $qarg"
1696 finalize_command="$finalize_command $qarg"
1697 continue
1698 ;;
1699 shrext)
1700 shrext_cmds="$arg"
1701 prev=
1702 continue
1703 ;;
1704 darwin_framework)
1705 compiler_flags="$compiler_flags $arg"
1706 compile_command="$compile_command $arg"
1707 finalize_command="$finalize_command $arg"
1708 prev=
1709 continue
1710 ;;
1711 *)
1712 eval "$prev=\"\$arg\""
1713 prev=
1714 continue
1715 ;;
1716 esac
1717 fi # test -n "$prev"
1718
1719 prevarg="$arg"
1720
1721 case $arg in
1722 -all-static)
1723 if test -n "$link_static_flag"; then
1724 compile_command="$compile_command $link_static_flag"
1725 finalize_command="$finalize_command $link_static_flag"
1726 fi
1727 continue
1728 ;;
1729
1730 -allow-undefined)
1731 # FIXME: remove this flag sometime in the future.
1732 $echo "$modename: \`-allow-undefined' is deprecated because it is the default" 1>&2
1733 continue
1734 ;;
1735
1736 -avoid-version)
1737 avoid_version=yes
1738 continue
1739 ;;
1740
1741 -dlopen)
1742 prev=dlfiles
1743 continue
1744 ;;
1745
1746 -dlpreopen)
1747 prev=dlprefiles
1748 continue
1749 ;;
1750
1751 -export-dynamic)
1752 export_dynamic=yes
1753 continue
1754 ;;
1755
1756 -export-symbols | -export-symbols-regex)
1757 if test -n "$export_symbols" || test -n "$export_symbols_regex"; then
1758 $echo "$modename: more than one -exported-symbols argument is not allowed"
1759 exit $EXIT_FAILURE
1760 fi
1761 if test "X$arg" = "X-export-symbols"; then
1762 prev=expsyms
1763 else
1764 prev=expsyms_regex
1765 fi
1766 continue
1767 ;;
1768
1769 -framework)
1770 prev=darwin_framework
1771 compiler_flags="$compiler_flags $arg"
1772 compile_command="$compile_command $arg"
1773 finalize_command="$finalize_command $arg"
1774 continue
1775 ;;
1776
1777 -inst-prefix-dir)
1778 prev=inst_prefix
1779 continue
1780 ;;
1781
1782 # The native IRIX linker understands -LANG:*, -LIST:* and -LNO:*
1783 # so, if we see these flags be careful not to treat them like -L
1784 -L[A-Z][A-Z]*:*)
1785 case $with_gcc/$host in
1786 no/*-*-irix* | /*-*-irix*)
1787 compile_command="$compile_command $arg"
1788 finalize_command="$finalize_command $arg"
1789 ;;
1790 esac
1791 continue
1792 ;;
1793
1794 -L*)
1795 dir=`$echo "X$arg" | $Xsed -e 's/^-L//'`
1796 # We need an absolute path.
1797 case $dir in
1798 [\\/]* | [A-Za-z]:[\\/]*) ;;
1799 *)
1800 absdir=`cd "$dir" && pwd`
1801 if test -z "$absdir"; then
1802 $echo "$modename: cannot determine absolute directory name of \`$dir'" 1>&2
1803 exit $EXIT_FAILURE
1804 fi
1805 dir="$absdir"
1806 ;;
1807 esac
1808 case "$deplibs " in
1809 *" -L$dir "*) ;;
1810 *)
1811 deplibs="$deplibs -L$dir"
1812 lib_search_path="$lib_search_path $dir"
1813 ;;
1814 esac
1815 case $host in
1816 *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2*)
1817 case :$dllsearchpath: in
1818 *":$dir:"*) ;;
1819 *) dllsearchpath="$dllsearchpath:$dir";;
1820 esac
1821 ;;
1822 esac
1823 continue
1824 ;;
1825
1826 -l*)
1827 if test "X$arg" = "X-lc" || test "X$arg" = "X-lm"; then
1828 case $host in
1829 *-*-cygwin* | *-*-pw32* | *-*-beos*)
1830 # These systems don't actually have a C or math library (as such)
1831 continue
1832 ;;
1833 *-*-mingw* | *-*-os2*)
1834 # These systems don't actually have a C library (as such)
1835 test "X$arg" = "X-lc" && continue
1836 ;;
1837 *-*-openbsd* | *-*-freebsd* | *-*-dragonfly*)
1838 # Do not include libc due to us having libc/libc_r.
1839 test "X$arg" = "X-lc" && continue
1840 ;;
1841 *-*-rhapsody* | *-*-darwin1.[012])
1842 # Rhapsody C and math libraries are in the System framework
1843 deplibs="$deplibs -framework System"
1844 continue
1845 esac
1846 elif test "X$arg" = "X-lc_r"; then
1847 case $host in
1848 *-*-openbsd* | *-*-freebsd* | *-*-dragonfly*)
1849 # Do not include libc_r directly, use -pthread flag.
1850 continue
1851 ;;
1852 esac
1853 fi
1854 deplibs="$deplibs $arg"
1855 continue
1856 ;;
1857
1858 # Tru64 UNIX uses -model [arg] to determine the layout of C++
1859 # classes, name mangling, and exception handling.
1860 -model)
1861 compile_command="$compile_command $arg"
1862 compiler_flags="$compiler_flags $arg"
1863 finalize_command="$finalize_command $arg"
1864 prev=xcompiler
1865 continue
1866 ;;
1867
1868 -mt|-mthreads|-kthread|-Kthread|-pthread|-pthreads|--thread-safe)
1869 compiler_flags="$compiler_flags $arg"
1870 compile_command="$compile_command $arg"
1871 finalize_command="$finalize_command $arg"
1872 continue
1873 ;;
1874
1875 -module)
1876 module=yes
1877 continue
1878 ;;
1879
1880 # -64, -mips[0-9] enable 64-bit mode on the SGI compiler
1881 # -r[0-9][0-9]* specifies the processor on the SGI compiler
1882 # -xarch=*, -xtarget=* enable 64-bit mode on the Sun compiler
1883 # +DA*, +DD* enable 64-bit mode on the HP compiler
1884 # -q* pass through compiler args for the IBM compiler
1885 # -m* pass through architecture-specific compiler args for GCC
1886 -64|-mips[0-9]|-r[0-9][0-9]*|-xarch=*|-xtarget=*|+DA*|+DD*|-q*|-m*)
1887
1888 # Unknown arguments in both finalize_command and compile_command need
1889 # to be aesthetically quoted because they are evaled later.
1890 arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`
1891 case $arg in
1892 *$quote_scanset* | *]* | *\|* | *\&* | *\(* | *\)* | "")
1893 arg="\"$arg\""
1894 ;;
1895 esac
1896 compile_command="$compile_command $arg"
1897 finalize_command="$finalize_command $arg"
1898 if test "$with_gcc" = "yes" ; then
1899 compiler_flags="$compiler_flags $arg"
1900 fi
1901 continue
1902 ;;
1903
1904 -shrext)
1905 prev=shrext
1906 continue
1907 ;;
1908
1909 -no-fast-install)
1910 fast_install=no
1911 continue
1912 ;;
1913
1914 -no-install)
1915 case $host in
1916 *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2*)
1917 # The PATH hackery in wrapper scripts is required on Windows
1918 # in order for the loader to find any dlls it needs.
1919 $echo "$modename: warning: \`-no-install' is ignored for $host" 1>&2
1920 $echo "$modename: warning: assuming \`-no-fast-install' instead" 1>&2
1921 fast_install=no
1922 ;;
1923 *) no_install=yes ;;
1924 esac
1925 continue
1926 ;;
1927
1928 -no-undefined)
1929 allow_undefined=no
1930 continue
1931 ;;
1932
1933 -objectlist)
1934 prev=objectlist
1935 continue
1936 ;;
1937
1938 -o) prev=output ;;
1939
1940 -precious-files-regex)
1941 prev=precious_regex
1942 continue
1943 ;;
1944
1945 -release)
1946 prev=release
1947 continue
1948 ;;
1949
1950 -rpath)
1951 prev=rpath
1952 continue
1953 ;;
1954
1955 -R)
1956 prev=xrpath
1957 continue
1958 ;;
1959
1960 -R*)
1961 dir=`$echo "X$arg" | $Xsed -e 's/^-R//'`
1962 # We need an absolute path.
1963 case $dir in
1964 [\\/]* | [A-Za-z]:[\\/]*) ;;
1965 *)
1966 $echo "$modename: only absolute run-paths are allowed" 1>&2
1967 exit $EXIT_FAILURE
1968 ;;
1969 esac
1970 case "$xrpath " in
1971 *" $dir "*) ;;
1972 *) xrpath="$xrpath $dir" ;;
1973 esac
1974 continue
1975 ;;
1976
1977 -static)
1978 # The effects of -static are defined in a previous loop.
1979 # We used to do the same as -all-static on platforms that
1980 # didn't have a PIC flag, but the assumption that the effects
1981 # would be equivalent was wrong. It would break on at least
1982 # Digital Unix and AIX.
1983 continue
1984 ;;
1985
1986 -thread-safe)
1987 thread_safe=yes
1988 continue
1989 ;;
1990
1991 -version-info)
1992 prev=vinfo
1993 continue
1994 ;;
1995 -version-number)
1996 prev=vinfo
1997 vinfo_number=yes
1998 continue
1999 ;;
2000
2001 -Wc,*)
2002 args=`$echo "X$arg" | $Xsed -e "$sed_quote_subst" -e 's/^-Wc,//'`
2003 arg=
2004 save_ifs="$IFS"; IFS=','
2005 for flag in $args; do
2006 IFS="$save_ifs"
2007 case $flag in
2008 *$quote_scanset* | *]* | *\|* | *\&* | *\(* | *\)* | "")
2009 flag="\"$flag\""
2010 ;;
2011 esac
2012 arg="$arg $wl$flag"
2013 compiler_flags="$compiler_flags $flag"
2014 done
2015 IFS="$save_ifs"
2016 arg=`$echo "X$arg" | $Xsed -e "s/^ //"`
2017 ;;
2018
2019 -Wl,*)
2020 args=`$echo "X$arg" | $Xsed -e "$sed_quote_subst" -e 's/^-Wl,//'`
2021 arg=
2022 save_ifs="$IFS"; IFS=','
2023 for flag in $args; do
2024 IFS="$save_ifs"
2025 case $flag in
2026 *$quote_scanset* | *]* | *\|* | *\&* | *\(* | *\)* | "")
2027 flag="\"$flag\""
2028 ;;
2029 esac
2030 arg="$arg $wl$flag"
2031 compiler_flags="$compiler_flags $wl$flag"
2032 linker_flags="$linker_flags $flag"
2033 done
2034 IFS="$save_ifs"
2035 arg=`$echo "X$arg" | $Xsed -e "s/^ //"`
2036 ;;
2037
2038 -Xcompiler)
2039 prev=xcompiler
2040 continue
2041 ;;
2042
2043 -Xlinker)
2044 prev=xlinker
2045 continue
2046 ;;
2047
2048 -XCClinker)
2049 prev=xcclinker
2050 continue
2051 ;;
2052
2053 # Some other compiler flag.
2054 -* | +*)
2055 # Unknown arguments in both finalize_command and compile_command need
2056 # to be aesthetically quoted because they are evaled later.
2057 arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`
2058 case $arg in
2059 *$quote_scanset* | *]* | *\|* | *\&* | *\(* | *\)* | "")
2060 arg="\"$arg\""
2061 ;;
2062 esac
2063 ;;
2064
2065 *.$objext)
2066 # A standard object.
2067 objs="$objs $arg"
2068 ;;
2069
2070 *.lo)
2071 # A libtool-controlled object.
2072
2073 # Check to see that this really is a libtool object.
2074 if (${SED} -e '2q' $arg | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then
2075 pic_object=
2076 non_pic_object=
2077
2078 # Read the .lo file
2079 # If there is no directory component, then add one.
2080 case $arg in
2081 */* | *\\*) . $arg ;;
2082 *) . ./$arg ;;
2083 esac
2084
2085 if test -z "$pic_object" || \
2086 test -z "$non_pic_object" ||
2087 test "$pic_object" = none && \
2088 test "$non_pic_object" = none; then
2089 $echo "$modename: cannot find name of object for \`$arg'" 1>&2
2090 exit $EXIT_FAILURE
2091 fi
2092
2093 # Extract subdirectory from the argument.
2094 xdir=`$echo "X$arg" | $Xsed -e 's%/[^/]*$%%'`
2095 if test "X$xdir" = "X$arg"; then
2096 xdir=
2097 else
2098 xdir="$xdir/"
2099 fi
2100
2101 if test "$pic_object" != none; then
2102 # Prepend the subdirectory the object is found in.
2103 pic_object="$xdir$pic_object"
2104
2105 if test "$prev" = dlfiles; then
2106 if test "$build_libtool_libs" = yes && test "$dlopen_support" = yes; then
2107 dlfiles="$dlfiles $pic_object"
2108 prev=
2109 continue
2110 else
2111 # If libtool objects are unsupported, then we need to preload.
2112 prev=dlprefiles
2113 fi
2114 fi
2115
2116 # CHECK ME: I think I busted this. -Ossama
2117 if test "$prev" = dlprefiles; then
2118 # Preload the old-style object.
2119 dlprefiles="$dlprefiles $pic_object"
2120 prev=
2121 fi
2122
2123 # A PIC object.
2124 libobjs="$libobjs $pic_object"
2125 arg="$pic_object"
2126 fi
2127
2128 # Non-PIC object.
2129 if test "$non_pic_object" != none; then
2130 # Prepend the subdirectory the object is found in.
2131 non_pic_object="$xdir$non_pic_object"
2132
2133 # A standard non-PIC object
2134 non_pic_objects="$non_pic_objects $non_pic_object"
2135 if test -z "$pic_object" || test "$pic_object" = none ; then
2136 arg="$non_pic_object"
2137 fi
2138 fi
2139 else
2140 # Only an error if not doing a dry-run.
2141 if test -z "$run"; then
2142 $echo "$modename: \`$arg' is not a valid libtool object" 1>&2
2143 exit $EXIT_FAILURE
2144 else
2145 # Dry-run case.
2146
2147 # Extract subdirectory from the argument.
2148 xdir=`$echo "X$arg" | $Xsed -e 's%/[^/]*$%%'`
2149 if test "X$xdir" = "X$arg"; then
2150 xdir=
2151 else
2152 xdir="$xdir/"
2153 fi
2154
2155 pic_object=`$echo "X${xdir}${objdir}/${arg}" | $Xsed -e "$lo2o"`
2156 non_pic_object=`$echo "X${xdir}${arg}" | $Xsed -e "$lo2o"`
2157 libobjs="$libobjs $pic_object"
2158 non_pic_objects="$non_pic_objects $non_pic_object"
2159 fi
2160 fi
2161 ;;
2162
2163 *.$libext)
2164 # An archive.
2165 deplibs="$deplibs $arg"
2166 old_deplibs="$old_deplibs $arg"
2167 continue
2168 ;;
2169
2170 *.la)
2171 # A libtool-controlled library.
2172
2173 if test "$prev" = dlfiles; then
2174 # This library was specified with -dlopen.
2175 dlfiles="$dlfiles $arg"
2176 prev=
2177 elif test "$prev" = dlprefiles; then
2178 # The library was specified with -dlpreopen.
2179 dlprefiles="$dlprefiles $arg"
2180 prev=
2181 else
2182 deplibs="$deplibs $arg"
2183 fi
2184 continue
2185 ;;
2186
2187 # Some other compiler argument.
2188 *)
2189 # Unknown arguments in both finalize_command and compile_command need
2190 # to be aesthetically quoted because they are evaled later.
2191 arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`
2192 case $arg in
2193 *$quote_scanset* | *]* | *\|* | *\&* | *\(* | *\)* | "")
2194 arg="\"$arg\""
2195 ;;
2196 esac
2197 ;;
2198 esac # arg
2199
2200 # Now actually substitute the argument into the commands.
2201 if test -n "$arg"; then
2202 compile_command="$compile_command $arg"
2203 finalize_command="$finalize_command $arg"
2204 fi
2205 done # argument parsing loop
2206
2207 if test -n "$prev"; then
2208 $echo "$modename: the \`$prevarg' option requires an argument" 1>&2
2209 $echo "$help" 1>&2
2210 exit $EXIT_FAILURE
2211 fi
2212
2213 if test "$export_dynamic" = yes && test -n "$export_dynamic_flag_spec"; then
2214 eval arg=\"$export_dynamic_flag_spec\"
2215 compile_command="$compile_command $arg"
2216 finalize_command="$finalize_command $arg"
2217 fi
2218
2219 oldlibs=
2220 # calculate the name of the file, without its directory
2221 outputname=`$echo "X$output" | $Xsed -e 's%^.*/%%'`
2222 libobjs_save="$libobjs"
2223
2224 if test -n "$shlibpath_var"; then
2225 # get the directories listed in $shlibpath_var
2226 eval shlib_search_path=\`\$echo \"X\${$shlibpath_var}\" \| \$Xsed -e \'s/:/ /g\'\`
2227 else
2228 shlib_search_path=
2229 fi
2230 eval sys_lib_search_path=\"$sys_lib_search_path_spec\"
2231 eval sys_lib_dlsearch_path=\"$sys_lib_dlsearch_path_spec\"
2232
2233 output_objdir=`$echo "X$output" | $Xsed -e 's%/[^/]*$%%'`
2234 if test "X$output_objdir" = "X$output"; then
2235 output_objdir="$objdir"
2236 else
2237 output_objdir="$output_objdir/$objdir"
2238 fi
2239 # Create the object directory.
2240 if test ! -d "$output_objdir"; then
2241 $show "$mkdir $output_objdir"
2242 $run $mkdir $output_objdir
2243 status=$?
2244 if test "$status" -ne 0 && test ! -d "$output_objdir"; then
2245 exit $status
2246 fi
2247 fi
2248
2249 # Determine the type of output
2250 case $output in
2251 "")
2252 $echo "$modename: you must specify an output file" 1>&2
2253 $echo "$help" 1>&2
2254 exit $EXIT_FAILURE
2255 ;;
2256 *.$libext) linkmode=oldlib ;;
2257 *.lo | *.$objext) linkmode=obj ;;
2258 *.la) linkmode=lib ;;
2259 *) linkmode=prog ;; # Anything else should be a program.
2260 esac
2261
2262 case $host in
2263 *cygwin* | *mingw* | *pw32*)
2264 # don't eliminate duplications in $postdeps and $predeps
2265 duplicate_compiler_generated_deps=yes
2266 ;;
2267 *)
2268 duplicate_compiler_generated_deps=$duplicate_deps
2269 ;;
2270 esac
2271 specialdeplibs=
2272
2273 libs=
2274 # Find all interdependent deplibs by searching for libraries
2275 # that are linked more than once (e.g. -la -lb -la)
2276 for deplib in $deplibs; do
2277 if test "X$duplicate_deps" = "Xyes" ; then
2278 case "$libs " in
2279 *" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;;
2280 esac
2281 fi
2282 libs="$libs $deplib"
2283 done
2284
2285 if test "$linkmode" = lib; then
2286 libs="$predeps $libs $compiler_lib_search_path $postdeps"
2287
2288 # Compute libraries that are listed more than once in $predeps
2289 # $postdeps and mark them as special (i.e., whose duplicates are
2290 # not to be eliminated).
2291 pre_post_deps=
2292 if test "X$duplicate_compiler_generated_deps" = "Xyes" ; then
2293 for pre_post_dep in $predeps $postdeps; do
2294 case "$pre_post_deps " in
2295 *" $pre_post_dep "*) specialdeplibs="$specialdeplibs $pre_post_deps" ;;
2296 esac
2297 pre_post_deps="$pre_post_deps $pre_post_dep"
2298 done
2299 fi
2300 pre_post_deps=
2301 fi
2302
2303 deplibs=
2304 newdependency_libs=
2305 newlib_search_path=
2306 need_relink=no # whether we're linking any uninstalled libtool libraries
2307 notinst_deplibs= # not-installed libtool libraries
2308 notinst_path= # paths that contain not-installed libtool libraries
2309 case $linkmode in
2310 lib)
2311 passes="conv link"
2312 for file in $dlfiles $dlprefiles; do
2313 case $file in
2314 *.la) ;;
2315 *)
2316 $echo "$modename: libraries can \`-dlopen' only libtool libraries: $file" 1>&2
2317 exit $EXIT_FAILURE
2318 ;;
2319 esac
2320 done
2321 ;;
2322 prog)
2323 compile_deplibs=
2324 finalize_deplibs=
2325 alldeplibs=no
2326 newdlfiles=
2327 newdlprefiles=
2328 passes="conv scan dlopen dlpreopen link"
2329 ;;
2330 *) passes="conv"
2331 ;;
2332 esac
2333 for pass in $passes; do
2334 if test "$linkmode,$pass" = "lib,link" ||
2335 test "$linkmode,$pass" = "prog,scan"; then
2336 libs="$deplibs"
2337 deplibs=
2338 fi
2339 if test "$linkmode" = prog; then
2340 case $pass in
2341 dlopen) libs="$dlfiles" ;;
2342 dlpreopen) libs="$dlprefiles" ;;
2343 link) libs="$deplibs %DEPLIBS% $dependency_libs" ;;
2344 esac
2345 fi
2346 if test "$pass" = dlopen; then
2347 # Collect dlpreopened libraries
2348 save_deplibs="$deplibs"
2349 deplibs=
2350 fi
2351 for deplib in $libs; do
2352 lib=
2353 found=no
2354 case $deplib in
2355 -mt|-mthreads|-kthread|-Kthread|-pthread|-pthreads|--thread-safe)
2356 if test "$linkmode,$pass" = "prog,link"; then
2357 compile_deplibs="$deplib $compile_deplibs"
2358 finalize_deplibs="$deplib $finalize_deplibs"
2359 else
2360 compiler_flags="$compiler_flags $deplib"
2361 fi
2362 continue
2363 ;;
2364 -l*)
2365 if test "$linkmode" != lib && test "$linkmode" != prog; then
2366 $echo "$modename: warning: \`-l' is ignored for archives/objects" 1>&2
2367 continue
2368 fi
2369 name=`$echo "X$deplib" | $Xsed -e 's/^-l//'`
2370 for searchdir in $newlib_search_path $lib_search_path $sys_lib_search_path $shlib_search_path; do
2371 for search_ext in .la $std_shrext .so .a; do
2372 # Search the libtool library
2373 lib="$searchdir/lib${name}${search_ext}"
2374 if test -f "$lib"; then
2375 if test "$search_ext" = ".la"; then
2376 found=yes
2377 else
2378 found=no
2379 fi
2380 break 2
2381 fi
2382 done
2383 done
2384 if test "$found" != yes; then
2385 # deplib doesn't seem to be a libtool library
2386 if test "$linkmode,$pass" = "prog,link"; then
2387 compile_deplibs="$deplib $compile_deplibs"
2388 finalize_deplibs="$deplib $finalize_deplibs"
2389 else
2390 deplibs="$deplib $deplibs"
2391 test "$linkmode" = lib && newdependency_libs="$deplib $newdependency_libs"
2392 fi
2393 continue
2394 else # deplib is a libtool library
2395 # If $allow_libtool_libs_with_static_runtimes && $deplib is a stdlib,
2396 # We need to do some special things here, and not later.
2397 if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
2398 case " $predeps $postdeps " in
2399 *" $deplib "*)
2400 if (${SED} -e '2q' $lib |
2401 grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then
2402 library_names=
2403 old_library=
2404 case $lib in
2405 */* | *\\*) . $lib ;;
2406 *) . ./$lib ;;
2407 esac
2408 for l in $old_library $library_names; do
2409 ll="$l"
2410 done
2411 if test "X$ll" = "X$old_library" ; then # only static version available
2412 found=no
2413 ladir=`$echo "X$lib" | $Xsed -e 's%/[^/]*$%%'`
2414 test "X$ladir" = "X$lib" && ladir="."
2415 lib=$ladir/$old_library
2416 if test "$linkmode,$pass" = "prog,link"; then
2417 compile_deplibs="$deplib $compile_deplibs"
2418 finalize_deplibs="$deplib $finalize_deplibs"
2419 else
2420 deplibs="$deplib $deplibs"
2421 test "$linkmode" = lib && newdependency_libs="$deplib $newdependency_libs"
2422 fi
2423 continue
2424 fi
2425 fi
2426 ;;
2427 *) ;;
2428 esac
2429 fi
2430 fi
2431 ;; # -l
2432 -L*)
2433 case $linkmode in
2434 lib)
2435 deplibs="$deplib $deplibs"
2436 test "$pass" = conv && continue
2437 newdependency_libs="$deplib $newdependency_libs"
2438 newlib_search_path="$newlib_search_path "`$echo "X$deplib" | $Xsed -e 's/^-L//'`
2439 ;;
2440 prog)
2441 if test "$pass" = conv; then
2442 deplibs="$deplib $deplibs"
2443 continue
2444 fi
2445 if test "$pass" = scan; then
2446 deplibs="$deplib $deplibs"
2447 else
2448 compile_deplibs="$deplib $compile_deplibs"
2449 finalize_deplibs="$deplib $finalize_deplibs"
2450 fi
2451 newlib_search_path="$newlib_search_path "`$echo "X$deplib" | $Xsed -e 's/^-L//'`
2452 ;;
2453 *)
2454 $echo "$modename: warning: \`-L' is ignored for archives/objects" 1>&2
2455 ;;
2456 esac # linkmode
2457 continue
2458 ;; # -L
2459 -R*)
2460 if test "$pass" = link; then
2461 dir=`$echo "X$deplib" | $Xsed -e 's/^-R//'`
2462 # Make sure the xrpath contains only unique directories.
2463 case "$xrpath " in
2464 *" $dir "*) ;;
2465 *) xrpath="$xrpath $dir" ;;
2466 esac
2467 fi
2468 deplibs="$deplib $deplibs"
2469 continue
2470 ;;
2471 *.la) lib="$deplib" ;;
2472 *.$libext)
2473 if test "$pass" = conv; then
2474 deplibs="$deplib $deplibs"
2475 continue
2476 fi
2477 case $linkmode in
2478 lib)
2479 valid_a_lib=no
2480 case $deplibs_check_method in
2481 match_pattern*)
2482 set dummy $deplibs_check_method
2483 match_pattern_regex=`expr "$deplibs_check_method" : "$2 \(.*\)"`
2484 if eval $echo \"$deplib\" 2>/dev/null \
2485 | $SED 10q \
2486 | $EGREP "$match_pattern_regex" > /dev/null; then
2487 valid_a_lib=yes
2488 fi
2489 ;;
2490 pass_all)
2491 valid_a_lib=yes
2492 ;;
2493 esac
2494 if test "$valid_a_lib" != yes; then
2495 $echo
2496 $echo "*** Warning: Trying to link with static lib archive $deplib."
2497 $echo "*** I have the capability to make that library automatically link in when"
2498 $echo "*** you link to this library. But I can only do this if you have a"
2499 $echo "*** shared version of the library, which you do not appear to have"
2500 $echo "*** because the file extensions .$libext of this argument makes me believe"
2501 $echo "*** that it is just a static archive that I should not used here."
2502 else
2503 $echo
2504 $echo "*** Warning: Linking the shared library $output against the"
2505 $echo "*** static library $deplib is not portable!"
2506 deplibs="$deplib $deplibs"
2507 fi
2508 continue
2509 ;;
2510 prog)
2511 if test "$pass" != link; then
2512 deplibs="$deplib $deplibs"
2513 else
2514 compile_deplibs="$deplib $compile_deplibs"
2515 finalize_deplibs="$deplib $finalize_deplibs"
2516 fi
2517 continue
2518 ;;
2519 esac # linkmode
2520 ;; # *.$libext
2521 *.lo | *.$objext)
2522 if test "$pass" = conv; then
2523 deplibs="$deplib $deplibs"
2524 elif test "$linkmode" = prog; then
2525 if test "$pass" = dlpreopen || test "$dlopen_support" != yes || test "$build_libtool_libs" = no; then
2526 # If there is no dlopen support or we're linking statically,
2527 # we need to preload.
2528 newdlprefiles="$newdlprefiles $deplib"
2529 compile_deplibs="$deplib $compile_deplibs"
2530 finalize_deplibs="$deplib $finalize_deplibs"
2531 else
2532 newdlfiles="$newdlfiles $deplib"
2533 fi
2534 fi
2535 continue
2536 ;;
2537 %DEPLIBS%)
2538 alldeplibs=yes
2539 continue
2540 ;;
2541 esac # case $deplib
2542 if test "$found" = yes || test -f "$lib"; then :
2543 else
2544 $echo "$modename: cannot find the library \`$lib'" 1>&2
2545 exit $EXIT_FAILURE
2546 fi
2547
2548 # Check to see that this really is a libtool archive.
2549 if (${SED} -e '2q' $lib | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then :
2550 else
2551 $echo "$modename: \`$lib' is not a valid libtool archive" 1>&2
2552 exit $EXIT_FAILURE
2553 fi
2554
2555 ladir=`$echo "X$lib" | $Xsed -e 's%/[^/]*$%%'`
2556 test "X$ladir" = "X$lib" && ladir="."
2557
2558 dlname=
2559 dlopen=
2560 dlpreopen=
2561 libdir=
2562 library_names=
2563 old_library=
2564 # If the library was installed with an old release of libtool,
2565 # it will not redefine variables installed, or shouldnotlink
2566 installed=yes
2567 shouldnotlink=no
2568 avoidtemprpath=
2569
2570
2571 # Read the .la file
2572 case $lib in
2573 */* | *\\*) . $lib ;;
2574 *) . ./$lib ;;
2575 esac
2576
2577 if test "$linkmode,$pass" = "lib,link" ||
2578 test "$linkmode,$pass" = "prog,scan" ||
2579 { test "$linkmode" != prog && test "$linkmode" != lib; }; then
2580 test -n "$dlopen" && dlfiles="$dlfiles $dlopen"
2581 test -n "$dlpreopen" && dlprefiles="$dlprefiles $dlpreopen"
2582 fi
2583
2584 if test "$pass" = conv; then
2585 # Only check for convenience libraries
2586 deplibs="$lib $deplibs"
2587 if test -z "$libdir"; then
2588 if test -z "$old_library"; then
2589 $echo "$modename: cannot find name of link library for \`$lib'" 1>&2
2590 exit $EXIT_FAILURE
2591 fi
2592 # It is a libtool convenience library, so add in its objects.
2593 convenience="$convenience $ladir/$objdir/$old_library"
2594 old_convenience="$old_convenience $ladir/$objdir/$old_library"
2595 tmp_libs=
2596 for deplib in $dependency_libs; do
2597 deplibs="$deplib $deplibs"
2598 if test "X$duplicate_deps" = "Xyes" ; then
2599 case "$tmp_libs " in
2600 *" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;;
2601 esac
2602 fi
2603 tmp_libs="$tmp_libs $deplib"
2604 done
2605 elif test "$linkmode" != prog && test "$linkmode" != lib; then
2606 $echo "$modename: \`$lib' is not a convenience library" 1>&2
2607 exit $EXIT_FAILURE
2608 fi
2609 continue
2610 fi # $pass = conv
2611
2612
2613 # Get the name of the library we link against.
2614 linklib=
2615 for l in $old_library $library_names; do
2616 linklib="$l"
2617 done
2618 if test -z "$linklib"; then
2619 $echo "$modename: cannot find name of link library for \`$lib'" 1>&2
2620 exit $EXIT_FAILURE
2621 fi
2622
2623 # This library was specified with -dlopen.
2624 if test "$pass" = dlopen; then
2625 if test -z "$libdir"; then
2626 $echo "$modename: cannot -dlopen a convenience library: \`$lib'" 1>&2
2627 exit $EXIT_FAILURE
2628 fi
2629 if test -z "$dlname" ||
2630 test "$dlopen_support" != yes ||
2631 test "$build_libtool_libs" = no; then
2632 # If there is no dlname, no dlopen support or we're linking
2633 # statically, we need to preload. We also need to preload any
2634 # dependent libraries so libltdl's deplib preloader doesn't
2635 # bomb out in the load deplibs phase.
2636 dlprefiles="$dlprefiles $lib $dependency_libs"
2637 else
2638 newdlfiles="$newdlfiles $lib"
2639 fi
2640 continue
2641 fi # $pass = dlopen
2642
2643 # We need an absolute path.
2644 case $ladir in
2645 [\\/]* | [A-Za-z]:[\\/]*) abs_ladir="$ladir" ;;
2646 *)
2647 abs_ladir=`cd "$ladir" && pwd`
2648 if test -z "$abs_ladir"; then
2649 $echo "$modename: warning: cannot determine absolute directory name of \`$ladir'" 1>&2
2650 $echo "$modename: passing it literally to the linker, although it might fail" 1>&2
2651 abs_ladir="$ladir"
2652 fi
2653 ;;
2654 esac
2655 laname=`$echo "X$lib" | $Xsed -e 's%^.*/%%'`
2656
2657 # Find the relevant object directory and library name.
2658 if test "X$installed" = Xyes; then
2659 if test ! -f "$libdir/$linklib" && test -f "$abs_ladir/$linklib"; then
2660 $echo "$modename: warning: library \`$lib' was moved." 1>&2
2661 dir="$ladir"
2662 absdir="$abs_ladir"
2663 libdir="$abs_ladir"
2664 else
2665 dir="$libdir"
2666 absdir="$libdir"
2667 fi
2668 test "X$hardcode_automatic" = Xyes && avoidtemprpath=yes
2669 else
2670 if test ! -f "$ladir/$objdir/$linklib" && test -f "$abs_ladir/$linklib"; then
2671 dir="$ladir"
2672 absdir="$abs_ladir"
2673 # Remove this search path later
2674 notinst_path="$notinst_path $abs_ladir"
2675 else
2676 dir="$ladir/$objdir"
2677 absdir="$abs_ladir/$objdir"
2678 # Remove this search path later
2679 notinst_path="$notinst_path $abs_ladir"
2680 fi
2681 fi # $installed = yes
2682 name=`$echo "X$laname" | $Xsed -e 's/\.la$//' -e 's/^lib//'`
2683
2684 # This library was specified with -dlpreopen.
2685 if test "$pass" = dlpreopen; then
2686 if test -z "$libdir"; then
2687 $echo "$modename: cannot -dlpreopen a convenience library: \`$lib'" 1>&2
2688 exit $EXIT_FAILURE
2689 fi
2690 # Prefer using a static library (so that no silly _DYNAMIC symbols
2691 # are required to link).
2692 if test -n "$old_library"; then
2693 newdlprefiles="$newdlprefiles $dir/$old_library"
2694 # Otherwise, use the dlname, so that lt_dlopen finds it.
2695 elif test -n "$dlname"; then
2696 newdlprefiles="$newdlprefiles $dir/$dlname"
2697 else
2698 newdlprefiles="$newdlprefiles $dir/$linklib"
2699 fi
2700 fi # $pass = dlpreopen
2701
2702 if test -z "$libdir"; then
2703 # Link the convenience library
2704 if test "$linkmode" = lib; then
2705 deplibs="$dir/$old_library $deplibs"
2706 elif test "$linkmode,$pass" = "prog,link"; then
2707 compile_deplibs="$dir/$old_library $compile_deplibs"
2708 finalize_deplibs="$dir/$old_library $finalize_deplibs"
2709 else
2710 deplibs="$lib $deplibs" # used for prog,scan pass
2711 fi
2712 continue
2713 fi
2714
2715
2716 if test "$linkmode" = prog && test "$pass" != link; then
2717 newlib_search_path="$newlib_search_path $ladir"
2718 deplibs="$lib $deplibs"
2719
2720 linkalldeplibs=no
2721 if test "$link_all_deplibs" != no || test -z "$library_names" ||
2722 test "$build_libtool_libs" = no; then
2723 linkalldeplibs=yes
2724 fi
2725
2726 tmp_libs=
2727 for deplib in $dependency_libs; do
2728 case $deplib in
2729 -L*) newlib_search_path="$newlib_search_path "`$echo "X$deplib" | $Xsed -e 's/^-L//'`;; ### testsuite: skip nested quoting test
2730 esac
2731 # Need to link against all dependency_libs?
2732 if test "$linkalldeplibs" = yes; then
2733 deplibs="$deplib $deplibs"
2734 else
2735 # Need to hardcode shared library paths
2736 # or/and link against static libraries
2737 newdependency_libs="$deplib $newdependency_libs"
2738 fi
2739 if test "X$duplicate_deps" = "Xyes" ; then
2740 case "$tmp_libs " in
2741 *" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;;
2742 esac
2743 fi
2744 tmp_libs="$tmp_libs $deplib"
2745 done # for deplib
2746 continue
2747 fi # $linkmode = prog...
2748
2749 if test "$linkmode,$pass" = "prog,link"; then
2750 if test -n "$library_names" &&
2751 { test "$prefer_static_libs" = no || test -z "$old_library"; }; then
2752 # We need to hardcode the library path
2753 if test -n "$shlibpath_var" && test -z "$avoidtemprpath" ; then
2754 # Make sure the rpath contains only unique directories.
2755 case "$temp_rpath " in
2756 *" $dir "*) ;;
2757 *" $absdir "*) ;;
2758 *) temp_rpath="$temp_rpath $dir" ;;
2759 esac
2760 fi
2761
2762 # Hardcode the library path.
2763 # Skip directories that are in the system default run-time
2764 # search path.
2765 case " $sys_lib_dlsearch_path " in
2766 *" $absdir "*) ;;
2767 *)
2768 case "$compile_rpath " in
2769 *" $absdir "*) ;;
2770 *) compile_rpath="$compile_rpath $absdir"
2771 esac
2772 ;;
2773 esac
2774 case " $sys_lib_dlsearch_path " in
2775 *" $libdir "*) ;;
2776 *)
2777 case "$finalize_rpath " in
2778 *" $libdir "*) ;;
2779 *) finalize_rpath="$finalize_rpath $libdir"
2780 esac
2781 ;;
2782 esac
2783 fi # $linkmode,$pass = prog,link...
2784
2785 if test "$alldeplibs" = yes &&
2786 { test "$deplibs_check_method" = pass_all ||
2787 { test "$build_libtool_libs" = yes &&
2788 test -n "$library_names"; }; }; then
2789 # We only need to search for static libraries
2790 continue
2791 fi
2792 fi
2793
2794 link_static=no # Whether the deplib will be linked statically
2795 if test -n "$library_names" &&
2796 { test "$prefer_static_libs" = no || test -z "$old_library"; }; then
2797 if test "$installed" = no; then
2798 notinst_deplibs="$notinst_deplibs $lib"
2799 need_relink=yes
2800 fi
2801 # This is a shared library
2802
2803 # Warn about portability, can't link against -module's on
2804 # some systems (darwin)
2805 if test "$shouldnotlink" = yes && test "$pass" = link ; then
2806 $echo
2807 if test "$linkmode" = prog; then
2808 $echo "*** Warning: Linking the executable $output against the loadable module"
2809 else
2810 $echo "*** Warning: Linking the shared library $output against the loadable module"
2811 fi
2812 $echo "*** $linklib is not portable!"
2813 fi
2814 if test "$linkmode" = lib &&
2815 test "$hardcode_into_libs" = yes; then
2816 # Hardcode the library path.
2817 # Skip directories that are in the system default run-time
2818 # search path.
2819 case " $sys_lib_dlsearch_path " in
2820 *" $absdir "*) ;;
2821 *)
2822 case "$compile_rpath " in
2823 *" $absdir "*) ;;
2824 *) compile_rpath="$compile_rpath $absdir"
2825 esac
2826 ;;
2827 esac
2828 case " $sys_lib_dlsearch_path " in
2829 *" $libdir "*) ;;
2830 *)
2831 case "$finalize_rpath " in
2832 *" $libdir "*) ;;
2833 *) finalize_rpath="$finalize_rpath $libdir"
2834 esac
2835 ;;
2836 esac
2837 fi
2838
2839 if test -n "$old_archive_from_expsyms_cmds"; then
2840 # figure out the soname
2841 set dummy $library_names
2842 realname="$2"
2843 shift; shift
2844 libname=`eval \\$echo \"$libname_spec\"`
2845 # use dlname if we got it. it's perfectly good, no?
2846 if test -n "$dlname"; then
2847 soname="$dlname"
2848 elif test -n "$soname_spec"; then
2849 # bleh windows
2850 case $host in
2851 *cygwin* | mingw*)
2852 major=`expr $current - $age`
2853 versuffix="-$major"
2854 ;;
2855 esac
2856 eval soname=\"$soname_spec\"
2857 else
2858 soname="$realname"
2859 fi
2860
2861 # Make a new name for the extract_expsyms_cmds to use
2862 soroot="$soname"
2863 soname=`$echo $soroot | ${SED} -e 's/^.*\///'`
2864 newlib="libimp-`$echo $soname | ${SED} 's/^lib//;s/\.dll$//'`.a"
2865
2866 # If the library has no export list, then create one now
2867 if test -f "$output_objdir/$soname-def"; then :
2868 else
2869 $show "extracting exported symbol list from \`$soname'"
2870 save_ifs="$IFS"; IFS='~'
2871 cmds=$extract_expsyms_cmds
2872 for cmd in $cmds; do
2873 IFS="$save_ifs"
2874 eval cmd=\"$cmd\"
2875 $show "$cmd"
2876 $run eval "$cmd" || exit $?
2877 done
2878 IFS="$save_ifs"
2879 fi
2880
2881 # Create $newlib
2882 if test -f "$output_objdir/$newlib"; then :; else
2883 $show "generating import library for \`$soname'"
2884 save_ifs="$IFS"; IFS='~'
2885 cmds=$old_archive_from_expsyms_cmds
2886 for cmd in $cmds; do
2887 IFS="$save_ifs"
2888 eval cmd=\"$cmd\"
2889 $show "$cmd"
2890 $run eval "$cmd" || exit $?
2891 done
2892 IFS="$save_ifs"
2893 fi
2894 # make sure the library variables are pointing to the new library
2895 dir=$output_objdir
2896 linklib=$newlib
2897 fi # test -n "$old_archive_from_expsyms_cmds"
2898
2899 if test "$linkmode" = prog || test "$mode" != relink; then
2900 add_shlibpath=
2901 add_dir=
2902 add=
2903 lib_linked=yes
2904 case $hardcode_action in
2905 immediate | unsupported)
2906 if test "$hardcode_direct" = no; then
2907 add="$dir/$linklib"
2908 case $host in
2909 *-*-sco3.2v5* ) add_dir="-L$dir" ;;
2910 *-*-darwin* )
2911 # if the lib is a module then we can not link against
2912 # it, someone is ignoring the new warnings I added
2913 if /usr/bin/file -L $add 2> /dev/null | $EGREP "bundle" >/dev/null ; then
2914 $echo "** Warning, lib $linklib is a module, not a shared library"
2915 if test -z "$old_library" ; then
2916 $echo
2917 $echo "** And there doesn't seem to be a static archive available"
2918 $echo "** The link will probably fail, sorry"
2919 else
2920 add="$dir/$old_library"
2921 fi
2922 fi
2923 esac
2924 elif test "$hardcode_minus_L" = no; then
2925 case $host in
2926 *-*-sunos*) add_shlibpath="$dir" ;;
2927 esac
2928 add_dir="-L$dir"
2929 add="-l$name"
2930 elif test "$hardcode_shlibpath_var" = no; then
2931 add_shlibpath="$dir"
2932 add="-l$name"
2933 else
2934 lib_linked=no
2935 fi
2936 ;;
2937 relink)
2938 if test "$hardcode_direct" = yes; then
2939 add="$dir/$linklib"
2940 elif test "$hardcode_minus_L" = yes; then
2941 add_dir="-L$dir"
2942 # Try looking first in the location we're being installed to.
2943 if test -n "$inst_prefix_dir"; then
2944 case "$libdir" in
2945 [\\/]*)
2946 add_dir="$add_dir -L$inst_prefix_dir$libdir"
2947 ;;
2948 esac
2949 fi
2950 add="-l$name"
2951 elif test "$hardcode_shlibpath_var" = yes; then
2952 add_shlibpath="$dir"
2953 add="-l$name"
2954 else
2955 lib_linked=no
2956 fi
2957 ;;
2958 *) lib_linked=no ;;
2959 esac
2960
2961 if test "$lib_linked" != yes; then
2962 $echo "$modename: configuration error: unsupported hardcode properties"
2963 exit $EXIT_FAILURE
2964 fi
2965
2966 if test -n "$add_shlibpath"; then
2967 case :$compile_shlibpath: in
2968 *":$add_shlibpath:"*) ;;
2969 *) compile_shlibpath="$compile_shlibpath$add_shlibpath:" ;;
2970 esac
2971 fi
2972 if test "$linkmode" = prog; then
2973 test -n "$add_dir" && compile_deplibs="$add_dir $compile_deplibs"
2974 test -n "$add" && compile_deplibs="$add $compile_deplibs"
2975 else
2976 test -n "$add_dir" && deplibs="$add_dir $deplibs"
2977 test -n "$add" && deplibs="$add $deplibs"
2978 if test "$hardcode_direct" != yes && \
2979 test "$hardcode_minus_L" != yes && \
2980 test "$hardcode_shlibpath_var" = yes; then
2981 case :$finalize_shlibpath: in
2982 *":$libdir:"*) ;;
2983 *) finalize_shlibpath="$finalize_shlibpath$libdir:" ;;
2984 esac
2985 fi
2986 fi
2987 fi
2988
2989 if test "$linkmode" = prog || test "$mode" = relink; then
2990 add_shlibpath=
2991 add_dir=
2992 add=
2993 # Finalize command for both is simple: just hardcode it.
2994 if test "$hardcode_direct" = yes; then
2995 add="$libdir/$linklib"
2996 elif test "$hardcode_minus_L" = yes; then
2997 add_dir="-L$libdir"
2998 add="-l$name"
2999 elif test "$hardcode_shlibpath_var" = yes; then
3000 case :$finalize_shlibpath: in
3001 *":$libdir:"*) ;;
3002 *) finalize_shlibpath="$finalize_shlibpath$libdir:" ;;
3003 esac
3004 add="-l$name"
3005 elif test "$hardcode_automatic" = yes; then
3006 if test -n "$inst_prefix_dir" &&
3007 test -f "$inst_prefix_dir$libdir/$linklib" ; then
3008 add="$inst_prefix_dir$libdir/$linklib"
3009 else
3010 add="$libdir/$linklib"
3011 fi
3012 else
3013 # We cannot seem to hardcode it, guess we'll fake it.
3014 add_dir="-L$libdir"
3015 # Try looking first in the location we're being installed to.
3016 if test -n "$inst_prefix_dir"; then
3017 case "$libdir" in
3018 [\\/]*)
3019 add_dir="$add_dir -L$inst_prefix_dir$libdir"
3020 ;;
3021 esac
3022 fi
3023 add="-l$name"
3024 fi
3025
3026 if test "$linkmode" = prog; then
3027 test -n "$add_dir" && finalize_deplibs="$add_dir $finalize_deplibs"
3028 test -n "$add" && finalize_deplibs="$add $finalize_deplibs"
3029 else
3030 test -n "$add_dir" && deplibs="$add_dir $deplibs"
3031 test -n "$add" && deplibs="$add $deplibs"
3032 fi
3033 fi
3034 elif test "$linkmode" = prog; then
3035 # Here we assume that one of hardcode_direct or hardcode_minus_L
3036 # is not unsupported. This is valid on all known static and
3037 # shared platforms.
3038 if test "$hardcode_direct" != unsupported; then
3039 test -n "$old_library" && linklib="$old_library"
3040 compile_deplibs="$dir/$linklib $compile_deplibs"
3041 finalize_deplibs="$dir/$linklib $finalize_deplibs"
3042 else
3043 compile_deplibs="-l$name -L$dir $compile_deplibs"
3044 finalize_deplibs="-l$name -L$dir $finalize_deplibs"
3045 fi
3046 elif test "$build_libtool_libs" = yes; then
3047 # Not a shared library
3048 if test "$deplibs_check_method" != pass_all; then
3049 # We're trying link a shared library against a static one
3050 # but the system doesn't support it.
3051
3052 # Just print a warning and add the library to dependency_libs so
3053 # that the program can be linked against the static library.
3054 $echo
3055 $echo "*** Warning: This system can not link to static lib archive $lib."
3056 $echo "*** I have the capability to make that library automatically link in when"
3057 $echo "*** you link to this library. But I can only do this if you have a"
3058 $echo "*** shared version of the library, which you do not appear to have."
3059 if test "$module" = yes; then
3060 $echo "*** But as you try to build a module library, libtool will still create "
3061 $echo "*** a static module, that should work as long as the dlopening application"
3062 $echo "*** is linked with the -dlopen flag to resolve symbols at runtime."
3063 if test -z "$global_symbol_pipe"; then
3064 $echo
3065 $echo "*** However, this would only work if libtool was able to extract symbol"
3066 $echo "*** lists from a program, using \`nm' or equivalent, but libtool could"
3067 $echo "*** not find such a program. So, this module is probably useless."
3068 $echo "*** \`nm' from GNU binutils and a full rebuild may help."
3069 fi
3070 if test "$build_old_libs" = no; then
3071 build_libtool_libs=module
3072 build_old_libs=yes
3073 else
3074 build_libtool_libs=no
3075 fi
3076 fi
3077 else
3078 convenience="$convenience $dir/$old_library"
3079 old_convenience="$old_convenience $dir/$old_library"
3080 deplibs="$dir/$old_library $deplibs"
3081 link_static=yes
3082 fi
3083 fi # link shared/static library?
3084
3085 if test "$linkmode" = lib; then
3086 if test -n "$dependency_libs" &&
3087 { test "$hardcode_into_libs" != yes ||
3088 test "$build_old_libs" = yes ||
3089 test "$link_static" = yes; }; then
3090 # Extract -R from dependency_libs
3091 temp_deplibs=
3092 for libdir in $dependency_libs; do
3093 case $libdir in
3094 -R*) temp_xrpath=`$echo "X$libdir" | $Xsed -e 's/^-R//'`
3095 case " $xrpath " in
3096 *" $temp_xrpath "*) ;;
3097 *) xrpath="$xrpath $temp_xrpath";;
3098 esac;;
3099 *) temp_deplibs="$temp_deplibs $libdir";;
3100 esac
3101 done
3102 dependency_libs="$temp_deplibs"
3103 fi
3104
3105 newlib_search_path="$newlib_search_path $absdir"
3106 # Link against this library
3107 test "$link_static" = no && newdependency_libs="$abs_ladir/$laname $newdependency_libs"
3108 # ... and its dependency_libs
3109 tmp_libs=
3110 for deplib in $dependency_libs; do
3111 newdependency_libs="$deplib $newdependency_libs"
3112 if test "X$duplicate_deps" = "Xyes" ; then
3113 case "$tmp_libs " in
3114 *" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;;
3115 esac
3116 fi
3117 tmp_libs="$tmp_libs $deplib"
3118 done
3119
3120 if test "$link_all_deplibs" != no; then
3121 # Add the search paths of all dependency libraries
3122 for deplib in $dependency_libs; do
3123 case $deplib in
3124 -L*) path="$deplib" ;;
3125 *.la)
3126 dir=`$echo "X$deplib" | $Xsed -e 's%/[^/]*$%%'`
3127 test "X$dir" = "X$deplib" && dir="."
3128 # We need an absolute path.
3129 case $dir in
3130 [\\/]* | [A-Za-z]:[\\/]*) absdir="$dir" ;;
3131 *)
3132 absdir=`cd "$dir" && pwd`
3133 if test -z "$absdir"; then
3134 $echo "$modename: warning: cannot determine absolute directory name of \`$dir'" 1>&2
3135 absdir="$dir"
3136 fi
3137 ;;
3138 esac
3139 if grep "^installed=no" $deplib > /dev/null; then
3140 path="$absdir/$objdir"
3141 else
3142 eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $deplib`
3143 if test -z "$libdir"; then
3144 $echo "$modename: \`$deplib' is not a valid libtool archive" 1>&2
3145 exit $EXIT_FAILURE
3146 fi
3147 if test "$absdir" != "$libdir"; then
3148 $echo "$modename: warning: \`$deplib' seems to be moved" 1>&2
3149 fi
3150 path="$absdir"
3151 fi
3152 depdepl=
3153 case $host in
3154 *-*-darwin*)
3155 # we do not want to link against static libs,
3156 # but need to link against shared
3157 eval deplibrary_names=`${SED} -n -e 's/^library_names=\(.*\)$/\1/p' $deplib`
3158 if test -n "$deplibrary_names" ; then
3159 for tmp in $deplibrary_names ; do
3160 depdepl=$tmp
3161 done
3162 if test -f "$path/$depdepl" ; then
3163 depdepl="$path/$depdepl"
3164 fi
3165 # do not add paths which are already there
3166 case " $newlib_search_path " in
3167 *" $path "*) ;;
3168 *) newlib_search_path="$newlib_search_path $path";;
3169 esac
3170 fi
3171 path=""
3172 ;;
3173 *)
3174 path="-L$path"
3175 ;;
3176 esac
3177 ;;
3178 -l*)
3179 case $host in
3180 *-*-darwin*)
3181 # Again, we only want to link against shared libraries
3182 eval tmp_libs=`$echo "X$deplib" | $Xsed -e "s,^\-l,,"`
3183 for tmp in $newlib_search_path ; do
3184 if test -f "$tmp/lib$tmp_libs.dylib" ; then
3185 eval depdepl="$tmp/lib$tmp_libs.dylib"
3186 break
3187 fi
3188 done
3189 path=""
3190 ;;
3191 *) continue ;;
3192 esac
3193 ;;
3194 *) continue ;;
3195 esac
3196 case " $deplibs " in
3197 *" $path "*) ;;
3198 *) deplibs="$path $deplibs" ;;
3199 esac
3200 case " $deplibs " in
3201 *" $depdepl "*) ;;
3202 *) deplibs="$depdepl $deplibs" ;;
3203 esac
3204 done
3205 fi # link_all_deplibs != no
3206 fi # linkmode = lib
3207 done # for deplib in $libs
3208 dependency_libs="$newdependency_libs"
3209 if test "$pass" = dlpreopen; then
3210 # Link the dlpreopened libraries before other libraries
3211 for deplib in $save_deplibs; do
3212 deplibs="$deplib $deplibs"
3213 done
3214 fi
3215 if test "$pass" != dlopen; then
3216 if test "$pass" != conv; then
3217 # Make sure lib_search_path contains only unique directories.
3218 lib_search_path=
3219 for dir in $newlib_search_path; do
3220 case "$lib_search_path " in
3221 *" $dir "*) ;;
3222 *) lib_search_path="$lib_search_path $dir" ;;
3223 esac
3224 done
3225 newlib_search_path=
3226 fi
3227
3228 if test "$linkmode,$pass" != "prog,link"; then
3229 vars="deplibs"
3230 else
3231 vars="compile_deplibs finalize_deplibs"
3232 fi
3233 for var in $vars dependency_libs; do
3234 # Add libraries to $var in reverse order
3235 eval tmp_libs=\"\$$var\"
3236 new_libs=
3237 for deplib in $tmp_libs; do
3238 # FIXME: Pedantically, this is the right thing to do, so
3239 # that some nasty dependency loop isn't accidentally
3240 # broken:
3241 #new_libs="$deplib $new_libs"
3242 # Pragmatically, this seems to cause very few problems in
3243 # practice:
3244 case $deplib in
3245 -L*) new_libs="$deplib $new_libs" ;;
3246 -R*) ;;
3247 *)
3248 # And here is the reason: when a library appears more
3249 # than once as an explicit dependence of a library, or
3250 # is implicitly linked in more than once by the
3251 # compiler, it is considered special, and multiple
3252 # occurrences thereof are not removed. Compare this
3253 # with having the same library being listed as a
3254 # dependency of multiple other libraries: in this case,
3255 # we know (pedantically, we assume) the library does not
3256 # need to be listed more than once, so we keep only the
3257 # last copy. This is not always right, but it is rare
3258 # enough that we require users that really mean to play
3259 # such unportable linking tricks to link the library
3260 # using -Wl,-lname, so that libtool does not consider it
3261 # for duplicate removal.
3262 case " $specialdeplibs " in
3263 *" $deplib "*) new_libs="$deplib $new_libs" ;;
3264 *)
3265 case " $new_libs " in
3266 *" $deplib "*) ;;
3267 *) new_libs="$deplib $new_libs" ;;
3268 esac
3269 ;;
3270 esac
3271 ;;
3272 esac
3273 done
3274 tmp_libs=
3275 for deplib in $new_libs; do
3276 case $deplib in
3277 -L*)
3278 case " $tmp_libs " in
3279 *" $deplib "*) ;;
3280 *) tmp_libs="$tmp_libs $deplib" ;;
3281 esac
3282 ;;
3283 *) tmp_libs="$tmp_libs $deplib" ;;
3284 esac
3285 done
3286 eval $var=\"$tmp_libs\"
3287 done # for var
3288 fi
3289 # Last step: remove runtime libs from dependency_libs
3290 # (they stay in deplibs)
3291 tmp_libs=
3292 for i in $dependency_libs ; do
3293 case " $predeps $postdeps $compiler_lib_search_path " in
3294 *" $i "*)
3295 i=""
3296 ;;
3297 esac
3298 if test -n "$i" ; then
3299 tmp_libs="$tmp_libs $i"
3300 fi
3301 done
3302 dependency_libs=$tmp_libs
3303 done # for pass
3304 if test "$linkmode" = prog; then
3305 dlfiles="$newdlfiles"
3306 dlprefiles="$newdlprefiles"
3307 fi
3308
3309 case $linkmode in
3310 oldlib)
3311 if test -n "$deplibs"; then
3312 $echo "$modename: warning: \`-l' and \`-L' are ignored for archives" 1>&2
3313 fi
3314
3315 if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then
3316 $echo "$modename: warning: \`-dlopen' is ignored for archives" 1>&2
3317 fi
3318
3319 if test -n "$rpath"; then
3320 $echo "$modename: warning: \`-rpath' is ignored for archives" 1>&2
3321 fi
3322
3323 if test -n "$xrpath"; then
3324 $echo "$modename: warning: \`-R' is ignored for archives" 1>&2
3325 fi
3326
3327 if test -n "$vinfo"; then
3328 $echo "$modename: warning: \`-version-info/-version-number' is ignored for archives" 1>&2
3329 fi
3330
3331 if test -n "$release"; then
3332 $echo "$modename: warning: \`-release' is ignored for archives" 1>&2
3333 fi
3334
3335 if test -n "$export_symbols" || test -n "$export_symbols_regex"; then
3336 $echo "$modename: warning: \`-export-symbols' is ignored for archives" 1>&2
3337 fi
3338
3339 # Now set the variables for building old libraries.
3340 build_libtool_libs=no
3341 oldlibs="$output"
3342 objs="$objs$old_deplibs"
3343 ;;
3344
3345 lib)
3346 # Make sure we only generate libraries of the form `libNAME.la'.
3347 case $outputname in
3348 lib*)
3349 name=`$echo "X$outputname" | $Xsed -e 's/\.la$//' -e 's/^lib//'`
3350 eval shared_ext=\"$shrext_cmds\"
3351 eval libname=\"$libname_spec\"
3352 ;;
3353 *)
3354 if test "$module" = no; then
3355 $echo "$modename: libtool library \`$output' must begin with \`lib'" 1>&2
3356 $echo "$help" 1>&2
3357 exit $EXIT_FAILURE
3358 fi
3359 if test "$need_lib_prefix" != no; then
3360 # Add the "lib" prefix for modules if required
3361 name=`$echo "X$outputname" | $Xsed -e 's/\.la$//'`
3362 eval shared_ext=\"$shrext_cmds\"
3363 eval libname=\"$libname_spec\"
3364 else
3365 libname=`$echo "X$outputname" | $Xsed -e 's/\.la$//'`
3366 fi
3367 ;;
3368 esac
3369
3370 if test -n "$objs"; then
3371 if test "$deplibs_check_method" != pass_all; then
3372 $echo "$modename: cannot build libtool library \`$output' from non-libtool objects on this host:$objs" 2>&1
3373 exit $EXIT_FAILURE
3374 else
3375 $echo
3376 $echo "*** Warning: Linking the shared library $output against the non-libtool"
3377 $echo "*** objects $objs is not portable!"
3378 libobjs="$libobjs $objs"
3379 fi
3380 fi
3381
3382 if test "$dlself" != no; then
3383 $echo "$modename: warning: \`-dlopen self' is ignored for libtool libraries" 1>&2
3384 fi
3385
3386 set dummy $rpath
3387 if test "$#" -gt 2; then
3388 $echo "$modename: warning: ignoring multiple \`-rpath's for a libtool library" 1>&2
3389 fi
3390 install_libdir="$2"
3391
3392 oldlibs=
3393 if test -z "$rpath"; then
3394 if test "$build_libtool_libs" = yes; then
3395 # Building a libtool convenience library.
3396 # Some compilers have problems with a `.al' extension so
3397 # convenience libraries should have the same extension an
3398 # archive normally would.
3399 oldlibs="$output_objdir/$libname.$libext $oldlibs"
3400 build_libtool_libs=convenience
3401 build_old_libs=yes
3402 fi
3403
3404 if test -n "$vinfo"; then
3405 $echo "$modename: warning: \`-version-info/-version-number' is ignored for convenience libraries" 1>&2
3406 fi
3407
3408 if test -n "$release"; then
3409 $echo "$modename: warning: \`-release' is ignored for convenience libraries" 1>&2
3410 fi
3411 else
3412
3413 # Parse the version information argument.
3414 save_ifs="$IFS"; IFS=':'
3415 set dummy $vinfo 0 0 0
3416 IFS="$save_ifs"
3417
3418 if test -n "$8"; then
3419 $echo "$modename: too many parameters to \`-version-info'" 1>&2
3420 $echo "$help" 1>&2
3421 exit $EXIT_FAILURE
3422 fi
3423
3424 # convert absolute version numbers to libtool ages
3425 # this retains compatibility with .la files and attempts
3426 # to make the code below a bit more comprehensible
3427
3428 case $vinfo_number in
3429 yes)
3430 number_major="$2"
3431 number_minor="$3"
3432 number_revision="$4"
3433 #
3434 # There are really only two kinds -- those that
3435 # use the current revision as the major version
3436 # and those that subtract age and use age as
3437 # a minor version. But, then there is irix
3438 # which has an extra 1 added just for fun
3439 #
3440 case $version_type in
3441 darwin|linux|osf|windows)
3442 current=`expr $number_major + $number_minor`
3443 age="$number_minor"
3444 revision="$number_revision"
3445 ;;
3446 freebsd-aout|freebsd-elf|sunos)
3447 current="$number_major"
3448 revision="$number_minor"
3449 age="0"
3450 ;;
3451 irix|nonstopux)
3452 current=`expr $number_major + $number_minor - 1`
3453 age="$number_minor"
3454 revision="$number_minor"
3455 ;;
3456 esac
3457 ;;
3458 no)
3459 current="$2"
3460 revision="$3"
3461 age="$4"
3462 ;;
3463 esac
3464
3465 # Check that each of the things are valid numbers.
3466 case $current in
3467 0|[1-9]|[1-9][0-9]|[1-9][0-9][0-9]|[1-9][0-9][0-9][0-9]|[1-9][0-9][0-9][0-9][0-9]) ;;
3468 *)
3469 $echo "$modename: CURRENT \`$current' must be a nonnegative integer" 1>&2
3470 $echo "$modename: \`$vinfo' is not valid version information" 1>&2
3471 exit $EXIT_FAILURE
3472 ;;
3473 esac
3474
3475 case $revision in
3476 0|[1-9]|[1-9][0-9]|[1-9][0-9][0-9]|[1-9][0-9][0-9][0-9]|[1-9][0-9][0-9][0-9][0-9]) ;;
3477 *)
3478 $echo "$modename: REVISION \`$revision' must be a nonnegative integer" 1>&2
3479 $echo "$modename: \`$vinfo' is not valid version information" 1>&2
3480 exit $EXIT_FAILURE
3481 ;;
3482 esac
3483
3484 case $age in
3485 0|[1-9]|[1-9][0-9]|[1-9][0-9][0-9]|[1-9][0-9][0-9][0-9]|[1-9][0-9][0-9][0-9][0-9]) ;;
3486 *)
3487 $echo "$modename: AGE \`$age' must be a nonnegative integer" 1>&2
3488 $echo "$modename: \`$vinfo' is not valid version information" 1>&2
3489 exit $EXIT_FAILURE
3490 ;;
3491 esac
3492
3493 if test "$age" -gt "$current"; then
3494 $echo "$modename: AGE \`$age' is greater than the current interface number \`$current'" 1>&2
3495 $echo "$modename: \`$vinfo' is not valid version information" 1>&2
3496 exit $EXIT_FAILURE
3497 fi
3498
3499 # Calculate the version variables.
3500 major=
3501 versuffix=
3502 verstring=
3503 case $version_type in
3504 none) ;;
3505
3506 darwin)
3507 # Like Linux, but with the current version available in
3508 # verstring for coding it into the library header
3509 major=.`expr $current - $age`
3510 versuffix="$major.$age.$revision"
3511 # Darwin ld doesn't like 0 for these options...
3512 minor_current=`expr $current + 1`
3513 verstring="${wl}-compatibility_version ${wl}$minor_current ${wl}-current_version ${wl}$minor_current.$revision"
3514 ;;
3515
3516 freebsd-aout)
3517 major=".$current"
3518 versuffix=".$current.$revision";
3519 ;;
3520
3521 freebsd-elf)
3522 major=".$current"
3523 versuffix=".$current";
3524 ;;
3525
3526 irix | nonstopux)
3527 major=`expr $current - $age + 1`
3528
3529 case $version_type in
3530 nonstopux) verstring_prefix=nonstopux ;;
3531 *) verstring_prefix=sgi ;;
3532 esac
3533 verstring="$verstring_prefix$major.$revision"
3534
3535 # Add in all the interfaces that we are compatible with.
3536 loop=$revision
3537 while test "$loop" -ne 0; do
3538 iface=`expr $revision - $loop`
3539 loop=`expr $loop - 1`
3540 verstring="$verstring_prefix$major.$iface:$verstring"
3541 done
3542
3543 # Before this point, $major must not contain `.'.
3544 major=.$major
3545 versuffix="$major.$revision"
3546 ;;
3547
3548 linux)
3549 major=.`expr $current - $age`
3550 versuffix="$major.$age.$revision"
3551 ;;
3552
3553 osf)
3554 major=.`expr $current - $age`
3555 versuffix=".$current.$age.$revision"
3556 verstring="$current.$age.$revision"
3557
3558 # Add in all the interfaces that we are compatible with.
3559 loop=$age
3560 while test "$loop" -ne 0; do
3561 iface=`expr $current - $loop`
3562 loop=`expr $loop - 1`
3563 verstring="$verstring:${iface}.0"
3564 done
3565
3566 # Make executables depend on our current version.
3567 verstring="$verstring:${current}.0"
3568 ;;
3569
3570 sunos)
3571 major=".$current"
3572 versuffix=".$current.$revision"
3573 ;;
3574
3575 windows)
3576 # Use '-' rather than '.', since we only want one
3577 # extension on DOS 8.3 filesystems.
3578 major=`expr $current - $age`
3579 versuffix="-$major"
3580 ;;
3581
3582 *)
3583 $echo "$modename: unknown library version type \`$version_type'" 1>&2
3584 $echo "Fatal configuration error. See the $PACKAGE docs for more information." 1>&2
3585 exit $EXIT_FAILURE
3586 ;;
3587 esac
3588
3589 # Clear the version info if we defaulted, and they specified a release.
3590 if test -z "$vinfo" && test -n "$release"; then
3591 major=
3592 case $version_type in
3593 darwin)
3594 # we can't check for "0.0" in archive_cmds due to quoting
3595 # problems, so we reset it completely
3596 verstring=
3597 ;;
3598 *)
3599 verstring="0.0"
3600 ;;
3601 esac
3602 if test "$need_version" = no; then
3603 versuffix=
3604 else
3605 versuffix=".0.0"
3606 fi
3607 fi
3608
3609 # Remove version info from name if versioning should be avoided
3610 if test "$avoid_version" = yes && test "$need_version" = no; then
3611 major=
3612 versuffix=
3613 verstring=""
3614 fi
3615
3616 # Check to see if the archive will have undefined symbols.
3617 if test "$allow_undefined" = yes; then
3618 if test "$allow_undefined_flag" = unsupported; then
3619 $echo "$modename: warning: undefined symbols not allowed in $host shared libraries" 1>&2
3620 build_libtool_libs=no
3621 build_old_libs=yes
3622 fi
3623 else
3624 # Don't allow undefined symbols.
3625 allow_undefined_flag="$no_undefined_flag"
3626 fi
3627 fi
3628
3629 if test "$mode" != relink; then
3630 # Remove our outputs, but don't remove object files since they
3631 # may have been created when compiling PIC objects.
3632 removelist=
3633 tempremovelist=`$echo "$output_objdir/*"`
3634 for p in $tempremovelist; do
3635 case $p in
3636 *.$objext)
3637 ;;
3638 $output_objdir/$outputname | $output_objdir/$libname.* | $output_objdir/${libname}${release}.*)
3639 if test "X$precious_files_regex" != "X"; then
3640 if echo $p | $EGREP -e "$precious_files_regex" >/dev/null 2>&1
3641 then
3642 continue
3643 fi
3644 fi
3645 removelist="$removelist $p"
3646 ;;
3647 *) ;;
3648 esac
3649 done
3650 if test -n "$removelist"; then
3651 $show "${rm}r $removelist"
3652 $run ${rm}r $removelist
3653 fi
3654 fi
3655
3656 # Now set the variables for building old libraries.
3657 if test "$build_old_libs" = yes && test "$build_libtool_libs" != convenience ; then
3658 oldlibs="$oldlibs $output_objdir/$libname.$libext"
3659
3660 # Transform .lo files to .o files.
3661 oldobjs="$objs "`$echo "X$libobjs" | $SP2NL | $Xsed -e '/\.'${libext}'$/d' -e "$lo2o" | $NL2SP`
3662 fi
3663
3664 # Eliminate all temporary directories.
3665 for path in $notinst_path; do
3666 lib_search_path=`$echo "$lib_search_path " | ${SED} -e 's% $path % %g'`
3667 deplibs=`$echo "$deplibs " | ${SED} -e 's% -L$path % %g'`
3668 dependency_libs=`$echo "$dependency_libs " | ${SED} -e 's% -L$path % %g'`
3669 done
3670
3671 if test -n "$xrpath"; then
3672 # If the user specified any rpath flags, then add them.
3673 temp_xrpath=
3674 for libdir in $xrpath; do
3675 temp_xrpath="$temp_xrpath -R$libdir"
3676 case "$finalize_rpath " in
3677 *" $libdir "*) ;;
3678 *) finalize_rpath="$finalize_rpath $libdir" ;;
3679 esac
3680 done
3681 if test "$hardcode_into_libs" != yes || test "$build_old_libs" = yes; then
3682 dependency_libs="$temp_xrpath $dependency_libs"
3683 fi
3684 fi
3685
3686 # Make sure dlfiles contains only unique files that won't be dlpreopened
3687 old_dlfiles="$dlfiles"
3688 dlfiles=
3689 for lib in $old_dlfiles; do
3690 case " $dlprefiles $dlfiles " in
3691 *" $lib "*) ;;
3692 *) dlfiles="$dlfiles $lib" ;;
3693 esac
3694 done
3695
3696 # Make sure dlprefiles contains only unique files
3697 old_dlprefiles="$dlprefiles"
3698 dlprefiles=
3699 for lib in $old_dlprefiles; do
3700 case "$dlprefiles " in
3701 *" $lib "*) ;;
3702 *) dlprefiles="$dlprefiles $lib" ;;
3703 esac
3704 done
3705
3706 if test "$build_libtool_libs" = yes; then
3707 if test -n "$rpath"; then
3708 case $host in
3709 *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-*-beos*)
3710 # these systems don't actually have a c library (as such)!
3711 ;;
3712 *-*-rhapsody* | *-*-darwin1.[012])
3713 # Rhapsody C library is in the System framework
3714 deplibs="$deplibs -framework System"
3715 ;;
3716 *-*-netbsd*)
3717 # Don't link with libc until the a.out ld.so is fixed.
3718 ;;
3719 *-*-openbsd* | *-*-freebsd* | *-*-dragonfly*)
3720 # Do not include libc due to us having libc/libc_r.
3721 test "X$arg" = "X-lc" && continue
3722 ;;
3723 *)
3724 # Add libc to deplibs on all other systems if necessary.
3725 if test "$build_libtool_need_lc" = "yes"; then
3726 deplibs="$deplibs -lc"
3727 fi
3728 ;;
3729 esac
3730 fi
3731
3732 # Transform deplibs into only deplibs that can be linked in shared.
3733 name_save=$name
3734 libname_save=$libname
3735 release_save=$release
3736 versuffix_save=$versuffix
3737 major_save=$major
3738 # I'm not sure if I'm treating the release correctly. I think
3739 # release should show up in the -l (ie -lgmp5) so we don't want to
3740 # add it in twice. Is that correct?
3741 release=""
3742 versuffix=""
3743 major=""
3744 newdeplibs=
3745 droppeddeps=no
3746 case $deplibs_check_method in
3747 pass_all)
3748 # Don't check for shared/static. Everything works.
3749 # This might be a little naive. We might want to check
3750 # whether the library exists or not. But this is on
3751 # osf3 & osf4 and I'm not really sure... Just
3752 # implementing what was already the behavior.
3753 newdeplibs=$deplibs
3754 ;;
3755 test_compile)
3756 # This code stresses the "libraries are programs" paradigm to its
3757 # limits. Maybe even breaks it. We compile a program, linking it
3758 # against the deplibs as a proxy for the library. Then we can check
3759 # whether they linked in statically or dynamically with ldd.
3760 $rm conftest.c
3761 cat > conftest.c <<EOF
3762 int main() { return 0; }
3763EOF
3764 $rm conftest
3765 $LTCC -o conftest conftest.c $deplibs
3766 if test "$?" -eq 0 ; then
3767 ldd_output=`ldd conftest`
3768 for i in $deplibs; do
3769 name="`expr $i : '-l\(.*\)'`"
3770 # If $name is empty we are operating on a -L argument.
3771 if test "$name" != "" && test "$name" -ne "0"; then
3772 if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
3773 case " $predeps $postdeps " in
3774 *" $i "*)
3775 newdeplibs="$newdeplibs $i"
3776 i=""
3777 ;;
3778 esac
3779 fi
3780 if test -n "$i" ; then
3781 libname=`eval \\$echo \"$libname_spec\"`
3782 deplib_matches=`eval \\$echo \"$library_names_spec\"`
3783 set dummy $deplib_matches
3784 deplib_match=$2
3785 if test `expr "$ldd_output" : ".*$deplib_match"` -ne 0 ; then
3786 newdeplibs="$newdeplibs $i"
3787 else
3788 droppeddeps=yes
3789 $echo
3790 $echo "*** Warning: dynamic linker does not accept needed library $i."
3791 $echo "*** I have the capability to make that library automatically link in when"
3792 $echo "*** you link to this library. But I can only do this if you have a"
3793 $echo "*** shared version of the library, which I believe you do not have"
3794 $echo "*** because a test_compile did reveal that the linker did not use it for"
3795 $echo "*** its dynamic dependency list that programs get resolved with at runtime."
3796 fi
3797 fi
3798 else
3799 newdeplibs="$newdeplibs $i"
3800 fi
3801 done
3802 else
3803 # Error occurred in the first compile. Let's try to salvage
3804 # the situation: Compile a separate program for each library.
3805 for i in $deplibs; do
3806 name="`expr $i : '-l\(.*\)'`"
3807 # If $name is empty we are operating on a -L argument.
3808 if test "$name" != "" && test "$name" != "0"; then
3809 $rm conftest
3810 $LTCC -o conftest conftest.c $i
3811 # Did it work?
3812 if test "$?" -eq 0 ; then
3813 ldd_output=`ldd conftest`
3814 if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
3815 case " $predeps $postdeps " in
3816 *" $i "*)
3817 newdeplibs="$newdeplibs $i"
3818 i=""
3819 ;;
3820 esac
3821 fi
3822 if test -n "$i" ; then
3823 libname=`eval \\$echo \"$libname_spec\"`
3824 deplib_matches=`eval \\$echo \"$library_names_spec\"`
3825 set dummy $deplib_matches
3826 deplib_match=$2
3827 if test `expr "$ldd_output" : ".*$deplib_match"` -ne 0 ; then
3828 newdeplibs="$newdeplibs $i"
3829 else
3830 droppeddeps=yes
3831 $echo
3832 $echo "*** Warning: dynamic linker does not accept needed library $i."
3833 $echo "*** I have the capability to make that library automatically link in when"
3834 $echo "*** you link to this library. But I can only do this if you have a"
3835 $echo "*** shared version of the library, which you do not appear to have"
3836 $echo "*** because a test_compile did reveal that the linker did not use this one"
3837 $echo "*** as a dynamic dependency that programs can get resolved with at runtime."
3838 fi
3839 fi
3840 else
3841 droppeddeps=yes
3842 $echo
3843 $echo "*** Warning! Library $i is needed by this library but I was not able to"
3844 $echo "*** make it link in! You will probably need to install it or some"
3845 $echo "*** library that it depends on before this library will be fully"
3846 $echo "*** functional. Installing it before continuing would be even better."
3847 fi
3848 else
3849 newdeplibs="$newdeplibs $i"
3850 fi
3851 done
3852 fi
3853 ;;
3854 file_magic*)
3855 set dummy $deplibs_check_method
3856 file_magic_regex=`expr "$deplibs_check_method" : "$2 \(.*\)"`
3857 for a_deplib in $deplibs; do
3858 name="`expr $a_deplib : '-l\(.*\)'`"
3859 # If $name is empty we are operating on a -L argument.
3860 if test "$name" != "" && test "$name" != "0"; then
3861 if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
3862 case " $predeps $postdeps " in
3863 *" $a_deplib "*)
3864 newdeplibs="$newdeplibs $a_deplib"
3865 a_deplib=""
3866 ;;
3867 esac
3868 fi
3869 if test -n "$a_deplib" ; then
3870 libname=`eval \\$echo \"$libname_spec\"`
3871 for i in $lib_search_path $sys_lib_search_path $shlib_search_path; do
3872 potential_libs=`ls $i/$libname[.-]* 2>/dev/null`
3873 for potent_lib in $potential_libs; do
3874 # Follow soft links.
3875 if ls -lLd "$potent_lib" 2>/dev/null \
3876 | grep " -> " >/dev/null; then
3877 continue
3878 fi
3879 # The statement above tries to avoid entering an
3880 # endless loop below, in case of cyclic links.
3881 # We might still enter an endless loop, since a link
3882 # loop can be closed while we follow links,
3883 # but so what?
3884 potlib="$potent_lib"
3885 while test -h "$potlib" 2>/dev/null; do
3886 potliblink=`ls -ld $potlib | ${SED} 's/.* -> //'`
3887 case $potliblink in
3888 [\\/]* | [A-Za-z]:[\\/]*) potlib="$potliblink";;
3889 *) potlib=`$echo "X$potlib" | $Xsed -e 's,[^/]*$,,'`"$potliblink";;
3890 esac
3891 done
3892 if eval $file_magic_cmd \"\$potlib\" 2>/dev/null \
3893 | ${SED} 10q \
3894 | $EGREP "$file_magic_regex" > /dev/null; then
3895 newdeplibs="$newdeplibs $a_deplib"
3896 a_deplib=""
3897 break 2
3898 fi
3899 done
3900 done
3901 fi
3902 if test -n "$a_deplib" ; then
3903 droppeddeps=yes
3904 $echo
3905 $echo "*** Warning: linker path does not have real file for library $a_deplib."
3906 $echo "*** I have the capability to make that library automatically link in when"
3907 $echo "*** you link to this library. But I can only do this if you have a"
3908 $echo "*** shared version of the library, which you do not appear to have"
3909 $echo "*** because I did check the linker path looking for a file starting"
3910 if test -z "$potlib" ; then
3911 $echo "*** with $libname but no candidates were found. (...for file magic test)"
3912 else
3913 $echo "*** with $libname and none of the candidates passed a file format test"
3914 $echo "*** using a file magic. Last file checked: $potlib"
3915 fi
3916 fi
3917 else
3918 # Add a -L argument.
3919 newdeplibs="$newdeplibs $a_deplib"
3920 fi
3921 done # Gone through all deplibs.
3922 ;;
3923 match_pattern*)
3924 set dummy $deplibs_check_method
3925 match_pattern_regex=`expr "$deplibs_check_method" : "$2 \(.*\)"`
3926 for a_deplib in $deplibs; do
3927 name="`expr $a_deplib : '-l\(.*\)'`"
3928 # If $name is empty we are operating on a -L argument.
3929 if test -n "$name" && test "$name" != "0"; then
3930 if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
3931 case " $predeps $postdeps " in
3932 *" $a_deplib "*)
3933 newdeplibs="$newdeplibs $a_deplib"
3934 a_deplib=""
3935 ;;
3936 esac
3937 fi
3938 if test -n "$a_deplib" ; then
3939 libname=`eval \\$echo \"$libname_spec\"`
3940 for i in $lib_search_path $sys_lib_search_path $shlib_search_path; do
3941 potential_libs=`ls $i/$libname[.-]* 2>/dev/null`
3942 for potent_lib in $potential_libs; do
3943 potlib="$potent_lib" # see symlink-check above in file_magic test
3944 if eval $echo \"$potent_lib\" 2>/dev/null \
3945 | ${SED} 10q \
3946 | $EGREP "$match_pattern_regex" > /dev/null; then
3947 newdeplibs="$newdeplibs $a_deplib"
3948 a_deplib=""
3949 break 2
3950 fi
3951 done
3952 done
3953 fi
3954 if test -n "$a_deplib" ; then
3955 droppeddeps=yes
3956 $echo
3957 $echo "*** Warning: linker path does not have real file for library $a_deplib."
3958 $echo "*** I have the capability to make that library automatically link in when"
3959 $echo "*** you link to this library. But I can only do this if you have a"
3960 $echo "*** shared version of the library, which you do not appear to have"
3961 $echo "*** because I did check the linker path looking for a file starting"
3962 if test -z "$potlib" ; then
3963 $echo "*** with $libname but no candidates were found. (...for regex pattern test)"
3964 else
3965 $echo "*** with $libname and none of the candidates passed a file format test"
3966 $echo "*** using a regex pattern. Last file checked: $potlib"
3967 fi
3968 fi
3969 else
3970 # Add a -L argument.
3971 newdeplibs="$newdeplibs $a_deplib"
3972 fi
3973 done # Gone through all deplibs.
3974 ;;
3975 none | unknown | *)
3976 newdeplibs=""
3977 tmp_deplibs=`$echo "X $deplibs" | $Xsed -e 's/ -lc$//' \
3978 -e 's/ -[LR][^ ]*//g'`
3979 if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
3980 for i in $predeps $postdeps ; do
3981 # can't use Xsed below, because $i might contain '/'
3982 tmp_deplibs=`$echo "X $tmp_deplibs" | ${SED} -e "1s,^X,," -e "s,$i,,"`
3983 done
3984 fi
3985 if $echo "X $tmp_deplibs" | $Xsed -e 's/[ ]//g' \
3986 | grep . >/dev/null; then
3987 $echo
3988 if test "X$deplibs_check_method" = "Xnone"; then
3989 $echo "*** Warning: inter-library dependencies are not supported in this platform."
3990 else
3991 $echo "*** Warning: inter-library dependencies are not known to be supported."
3992 fi
3993 $echo "*** All declared inter-library dependencies are being dropped."
3994 droppeddeps=yes
3995 fi
3996 ;;
3997 esac
3998 versuffix=$versuffix_save
3999 major=$major_save
4000 release=$release_save
4001 libname=$libname_save
4002 name=$name_save
4003
4004 case $host in
4005 *-*-rhapsody* | *-*-darwin1.[012])
4006 # On Rhapsody replace the C library is the System framework
4007 newdeplibs=`$echo "X $newdeplibs" | $Xsed -e 's/ -lc / -framework System /'`
4008 ;;
4009 esac
4010
4011 if test "$droppeddeps" = yes; then
4012 if test "$module" = yes; then
4013 $echo
4014 $echo "*** Warning: libtool could not satisfy all declared inter-library"
4015 $echo "*** dependencies of module $libname. Therefore, libtool will create"
4016 $echo "*** a static module, that should work as long as the dlopening"
4017 $echo "*** application is linked with the -dlopen flag."
4018 if test -z "$global_symbol_pipe"; then
4019 $echo
4020 $echo "*** However, this would only work if libtool was able to extract symbol"
4021 $echo "*** lists from a program, using \`nm' or equivalent, but libtool could"
4022 $echo "*** not find such a program. So, this module is probably useless."
4023 $echo "*** \`nm' from GNU binutils and a full rebuild may help."
4024 fi
4025 if test "$build_old_libs" = no; then
4026 oldlibs="$output_objdir/$libname.$libext"
4027 build_libtool_libs=module
4028 build_old_libs=yes
4029 else
4030 build_libtool_libs=no
4031 fi
4032 else
4033 $echo "*** The inter-library dependencies that have been dropped here will be"
4034 $echo "*** automatically added whenever a program is linked with this library"
4035 $echo "*** or is declared to -dlopen it."
4036
4037 if test "$allow_undefined" = no; then
4038 $echo
4039 $echo "*** Since this library must not contain undefined symbols,"
4040 $echo "*** because either the platform does not support them or"
4041 $echo "*** it was explicitly requested with -no-undefined,"
4042 $echo "*** libtool will only create a static version of it."
4043 if test "$build_old_libs" = no; then
4044 oldlibs="$output_objdir/$libname.$libext"
4045 build_libtool_libs=module
4046 build_old_libs=yes
4047 else
4048 build_libtool_libs=no
4049 fi
4050 fi
4051 fi
4052 fi
4053 # Done checking deplibs!
4054 deplibs=$newdeplibs
4055 fi
4056
4057 # All the library-specific variables (install_libdir is set above).
4058 library_names=
4059 old_library=
4060 dlname=
4061
4062 # Test again, we may have decided not to build it any more
4063 if test "$build_libtool_libs" = yes; then
4064 if test "$hardcode_into_libs" = yes; then
4065 # Hardcode the library paths
4066 hardcode_libdirs=
4067 dep_rpath=
4068 rpath="$finalize_rpath"
4069 test "$mode" != relink && rpath="$compile_rpath$rpath"
4070 for libdir in $rpath; do
4071 if test -n "$hardcode_libdir_flag_spec"; then
4072 if test -n "$hardcode_libdir_separator"; then
4073 if test -z "$hardcode_libdirs"; then
4074 hardcode_libdirs="$libdir"
4075 else
4076 # Just accumulate the unique libdirs.
4077 case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in
4078 *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*)
4079 ;;
4080 *)
4081 hardcode_libdirs="$hardcode_libdirs$hardcode_libdir_separator$libdir"
4082 ;;
4083 esac
4084 fi
4085 else
4086 eval flag=\"$hardcode_libdir_flag_spec\"
4087 dep_rpath="$dep_rpath $flag"
4088 fi
4089 elif test -n "$runpath_var"; then
4090 case "$perm_rpath " in
4091 *" $libdir "*) ;;
4092 *) perm_rpath="$perm_rpath $libdir" ;;
4093 esac
4094 fi
4095 done
4096 # Substitute the hardcoded libdirs into the rpath.
4097 if test -n "$hardcode_libdir_separator" &&
4098 test -n "$hardcode_libdirs"; then
4099 libdir="$hardcode_libdirs"
4100 if test -n "$hardcode_libdir_flag_spec_ld"; then
4101 eval dep_rpath=\"$hardcode_libdir_flag_spec_ld\"
4102 else
4103 eval dep_rpath=\"$hardcode_libdir_flag_spec\"
4104 fi
4105 fi
4106 if test -n "$runpath_var" && test -n "$perm_rpath"; then
4107 # We should set the runpath_var.
4108 rpath=
4109 for dir in $perm_rpath; do
4110 rpath="$rpath$dir:"
4111 done
4112 eval "$runpath_var='$rpath\$$runpath_var'; export $runpath_var"
4113 fi
4114 test -n "$dep_rpath" && deplibs="$dep_rpath $deplibs"
4115 fi
4116
4117 shlibpath="$finalize_shlibpath"
4118 test "$mode" != relink && shlibpath="$compile_shlibpath$shlibpath"
4119 if test -n "$shlibpath"; then
4120 eval "$shlibpath_var='$shlibpath\$$shlibpath_var'; export $shlibpath_var"
4121 fi
4122
4123 # Get the real and link names of the library.
4124 eval shared_ext=\"$shrext_cmds\"
4125 eval library_names=\"$library_names_spec\"
4126 set dummy $library_names
4127 realname="$2"
4128 shift; shift
4129
4130 if test -n "$soname_spec"; then
4131 eval soname=\"$soname_spec\"
4132 else
4133 soname="$realname"
4134 fi
4135 if test -z "$dlname"; then
4136 dlname=$soname
4137 fi
4138
4139 lib="$output_objdir/$realname"
4140 for link
4141 do
4142 linknames="$linknames $link"
4143 done
4144
4145 # Use standard objects if they are pic
4146 test -z "$pic_flag" && libobjs=`$echo "X$libobjs" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP`
4147
4148 # Prepare the list of exported symbols
4149 if test -z "$export_symbols"; then
4150 if test "$always_export_symbols" = yes || test -n "$export_symbols_regex"; then
4151 $show "generating symbol list for \`$libname.la'"
4152 export_symbols="$output_objdir/$libname.exp"
4153 $run $rm $export_symbols
4154 cmds=$export_symbols_cmds
4155 save_ifs="$IFS"; IFS='~'
4156 for cmd in $cmds; do
4157 IFS="$save_ifs"
4158 eval cmd=\"$cmd\"
4159 if len=`expr "X$cmd" : ".*"` &&
4160 test "$len" -le "$max_cmd_len" || test "$max_cmd_len" -le -1; then
4161 $show "$cmd"
4162 $run eval "$cmd" || exit $?
4163 skipped_export=false
4164 else
4165 # The command line is too long to execute in one step.
4166 $show "using reloadable object file for export list..."
4167 skipped_export=:
4168 fi
4169 done
4170 IFS="$save_ifs"
4171 if test -n "$export_symbols_regex"; then
4172 $show "$EGREP -e \"$export_symbols_regex\" \"$export_symbols\" > \"${export_symbols}T\""
4173 $run eval '$EGREP -e "$export_symbols_regex" "$export_symbols" > "${export_symbols}T"'
4174 $show "$mv \"${export_symbols}T\" \"$export_symbols\""
4175 $run eval '$mv "${export_symbols}T" "$export_symbols"'
4176 fi
4177 fi
4178 fi
4179
4180 if test -n "$export_symbols" && test -n "$include_expsyms"; then
4181 $run eval '$echo "X$include_expsyms" | $SP2NL >> "$export_symbols"'
4182 fi
4183
4184 tmp_deplibs=
4185 for test_deplib in $deplibs; do
4186 case " $convenience " in
4187 *" $test_deplib "*) ;;
4188 *)
4189 tmp_deplibs="$tmp_deplibs $test_deplib"
4190 ;;
4191 esac
4192 done
4193 deplibs="$tmp_deplibs"
4194
4195 if test -n "$convenience"; then
4196 if test -n "$whole_archive_flag_spec"; then
4197 save_libobjs=$libobjs
4198 eval libobjs=\"\$libobjs $whole_archive_flag_spec\"
4199 else
4200 gentop="$output_objdir/${outputname}x"
4201 generated="$generated $gentop"
4202
4203 func_extract_archives $gentop $convenience
4204 libobjs="$libobjs $func_extract_archives_result"
4205 fi
4206 fi
4207
4208 if test "$thread_safe" = yes && test -n "$thread_safe_flag_spec"; then
4209 eval flag=\"$thread_safe_flag_spec\"
4210 linker_flags="$linker_flags $flag"
4211 fi
4212
4213 # Make a backup of the uninstalled library when relinking
4214 if test "$mode" = relink; then
4215 $run eval '(cd $output_objdir && $rm ${realname}U && $mv $realname ${realname}U)' || exit $?
4216 fi
4217
4218 # Do each of the archive commands.
4219 if test "$module" = yes && test -n "$module_cmds" ; then
4220 if test -n "$export_symbols" && test -n "$module_expsym_cmds"; then
4221 eval test_cmds=\"$module_expsym_cmds\"
4222 cmds=$module_expsym_cmds
4223 else
4224 eval test_cmds=\"$module_cmds\"
4225 cmds=$module_cmds
4226 fi
4227 else
4228 if test -n "$export_symbols" && test -n "$archive_expsym_cmds"; then
4229 eval test_cmds=\"$archive_expsym_cmds\"
4230 cmds=$archive_expsym_cmds
4231 else
4232 eval test_cmds=\"$archive_cmds\"
4233 cmds=$archive_cmds
4234 fi
4235 fi
4236
4237 if test "X$skipped_export" != "X:" && len=`expr "X$test_cmds" : ".*"` &&
4238 test "$len" -le "$max_cmd_len" || test "$max_cmd_len" -le -1; then
4239 :
4240 else
4241 # The command line is too long to link in one step, link piecewise.
4242 $echo "creating reloadable object files..."
4243
4244 # Save the value of $output and $libobjs because we want to
4245 # use them later. If we have whole_archive_flag_spec, we
4246 # want to use save_libobjs as it was before
4247 # whole_archive_flag_spec was expanded, because we can't
4248 # assume the linker understands whole_archive_flag_spec.
4249 # This may have to be revisited, in case too many
4250 # convenience libraries get linked in and end up exceeding
4251 # the spec.
4252 if test -z "$convenience" || test -z "$whole_archive_flag_spec"; then
4253 save_libobjs=$libobjs
4254 fi
4255 save_output=$output
4256 output_la=`$echo "X$output" | $Xsed -e "$basename"`
4257
4258 # Clear the reloadable object creation command queue and
4259 # initialize k to one.
4260 test_cmds=
4261 concat_cmds=
4262 objlist=
4263 delfiles=
4264 last_robj=
4265 k=1
4266 output=$output_objdir/$output_la-${k}.$objext
4267 # Loop over the list of objects to be linked.
4268 for obj in $save_libobjs
4269 do
4270 eval test_cmds=\"$reload_cmds $objlist $last_robj\"
4271 if test "X$objlist" = X ||
4272 { len=`expr "X$test_cmds" : ".*"` &&
4273 test "$len" -le "$max_cmd_len"; }; then
4274 objlist="$objlist $obj"
4275 else
4276 # The command $test_cmds is almost too long, add a
4277 # command to the queue.
4278 if test "$k" -eq 1 ; then
4279 # The first file doesn't have a previous command to add.
4280 eval concat_cmds=\"$reload_cmds $objlist $last_robj\"
4281 else
4282 # All subsequent reloadable object files will link in
4283 # the last one created.
4284 eval concat_cmds=\"\$concat_cmds~$reload_cmds $objlist $last_robj\"
4285 fi
4286 last_robj=$output_objdir/$output_la-${k}.$objext
4287 k=`expr $k + 1`
4288 output=$output_objdir/$output_la-${k}.$objext
4289 objlist=$obj
4290 len=1
4291 fi
4292 done
4293 # Handle the remaining objects by creating one last
4294 # reloadable object file. All subsequent reloadable object
4295 # files will link in the last one created.
4296 test -z "$concat_cmds" || concat_cmds=$concat_cmds~
4297 eval concat_cmds=\"\${concat_cmds}$reload_cmds $objlist $last_robj\"
4298
4299 if ${skipped_export-false}; then
4300 $show "generating symbol list for \`$libname.la'"
4301 export_symbols="$output_objdir/$libname.exp"
4302 $run $rm $export_symbols
4303 libobjs=$output
4304 # Append the command to create the export file.
4305 eval concat_cmds=\"\$concat_cmds~$export_symbols_cmds\"
4306 fi
4307
4308 # Set up a command to remove the reloadable object files
4309 # after they are used.
4310 i=0
4311 while test "$i" -lt "$k"
4312 do
4313 i=`expr $i + 1`
4314 delfiles="$delfiles $output_objdir/$output_la-${i}.$objext"
4315 done
4316
4317 $echo "creating a temporary reloadable object file: $output"
4318
4319 # Loop through the commands generated above and execute them.
4320 save_ifs="$IFS"; IFS='~'
4321 for cmd in $concat_cmds; do
4322 IFS="$save_ifs"
4323 $show "$cmd"
4324 $run eval "$cmd" || exit $?
4325 done
4326 IFS="$save_ifs"
4327
4328 libobjs=$output
4329 # Restore the value of output.
4330 output=$save_output
4331
4332 if test -n "$convenience" && test -n "$whole_archive_flag_spec"; then
4333 eval libobjs=\"\$libobjs $whole_archive_flag_spec\"
4334 fi
4335 # Expand the library linking commands again to reset the
4336 # value of $libobjs for piecewise linking.
4337
4338 # Do each of the archive commands.
4339 if test "$module" = yes && test -n "$module_cmds" ; then
4340 if test -n "$export_symbols" && test -n "$module_expsym_cmds"; then
4341 cmds=$module_expsym_cmds
4342 else
4343 cmds=$module_cmds
4344 fi
4345 else
4346 if test -n "$export_symbols" && test -n "$archive_expsym_cmds"; then
4347 cmds=$archive_expsym_cmds
4348 else
4349 cmds=$archive_cmds
4350 fi
4351 fi
4352
4353 # Append the command to remove the reloadable object files
4354 # to the just-reset $cmds.
4355 eval cmds=\"\$cmds~\$rm $delfiles\"
4356 fi
4357 save_ifs="$IFS"; IFS='~'
4358 for cmd in $cmds; do
4359 IFS="$save_ifs"
4360 eval cmd=\"$cmd\"
4361 $show "$cmd"
4362 $run eval "$cmd" || exit $?
4363 done
4364 IFS="$save_ifs"
4365
4366 # Restore the uninstalled library and exit
4367 if test "$mode" = relink; then
4368 $run eval '(cd $output_objdir && $rm ${realname}T && $mv $realname ${realname}T && $mv "$realname"U $realname)' || exit $?
4369 exit $EXIT_SUCCESS
4370 fi
4371
4372 # Create links to the real library.
4373 for linkname in $linknames; do
4374 if test "$realname" != "$linkname"; then
4375 $show "(cd $output_objdir && $rm $linkname && $LN_S $realname $linkname)"
4376 $run eval '(cd $output_objdir && $rm $linkname && $LN_S $realname $linkname)' || exit $?
4377 fi
4378 done
4379
4380 # If -module or -export-dynamic was specified, set the dlname.
4381 if test "$module" = yes || test "$export_dynamic" = yes; then
4382 # On all known operating systems, these are identical.
4383 dlname="$soname"
4384 fi
4385 fi
4386 ;;
4387
4388 obj)
4389 if test -n "$deplibs"; then
4390 $echo "$modename: warning: \`-l' and \`-L' are ignored for objects" 1>&2
4391 fi
4392
4393 if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then
4394 $echo "$modename: warning: \`-dlopen' is ignored for objects" 1>&2
4395 fi
4396
4397 if test -n "$rpath"; then
4398 $echo "$modename: warning: \`-rpath' is ignored for objects" 1>&2
4399 fi
4400
4401 if test -n "$xrpath"; then
4402 $echo "$modename: warning: \`-R' is ignored for objects" 1>&2
4403 fi
4404
4405 if test -n "$vinfo"; then
4406 $echo "$modename: warning: \`-version-info' is ignored for objects" 1>&2
4407 fi
4408
4409 if test -n "$release"; then
4410 $echo "$modename: warning: \`-release' is ignored for objects" 1>&2
4411 fi
4412
4413 case $output in
4414 *.lo)
4415 if test -n "$objs$old_deplibs"; then
4416 $echo "$modename: cannot build library object \`$output' from non-libtool objects" 1>&2
4417 exit $EXIT_FAILURE
4418 fi
4419 libobj="$output"
4420 obj=`$echo "X$output" | $Xsed -e "$lo2o"`
4421 ;;
4422 *)
4423 libobj=
4424 obj="$output"
4425 ;;
4426 esac
4427
4428 # Delete the old objects.
4429 $run $rm $obj $libobj
4430
4431 # Objects from convenience libraries. This assumes
4432 # single-version convenience libraries. Whenever we create
4433 # different ones for PIC/non-PIC, this we'll have to duplicate
4434 # the extraction.
4435 reload_conv_objs=
4436 gentop=
4437 # reload_cmds runs $LD directly, so let us get rid of
4438 # -Wl from whole_archive_flag_spec
4439 wl=
4440
4441 if test -n "$convenience"; then
4442 if test -n "$whole_archive_flag_spec"; then
4443 eval reload_conv_objs=\"\$reload_objs $whole_archive_flag_spec\"
4444 else
4445 gentop="$output_objdir/${obj}x"
4446 generated="$generated $gentop"
4447
4448 func_extract_archives $gentop $convenience
4449 reload_conv_objs="$reload_objs $func_extract_archives_result"
4450 fi
4451 fi
4452
4453 # Create the old-style object.
4454 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
4455
4456 output="$obj"
4457 cmds=$reload_cmds
4458 save_ifs="$IFS"; IFS='~'
4459 for cmd in $cmds; do
4460 IFS="$save_ifs"
4461 eval cmd=\"$cmd\"
4462 $show "$cmd"
4463 $run eval "$cmd" || exit $?
4464 done
4465 IFS="$save_ifs"
4466
4467 # Exit if we aren't doing a library object file.
4468 if test -z "$libobj"; then
4469 if test -n "$gentop"; then
4470 $show "${rm}r $gentop"
4471 $run ${rm}r $gentop
4472 fi
4473
4474 exit $EXIT_SUCCESS
4475 fi
4476
4477 if test "$build_libtool_libs" != yes; then
4478 if test -n "$gentop"; then
4479 $show "${rm}r $gentop"
4480 $run ${rm}r $gentop
4481 fi
4482
4483 # Create an invalid libtool object if no PIC, so that we don't
4484 # accidentally link it into a program.
4485 # $show "echo timestamp > $libobj"
4486 # $run eval "echo timestamp > $libobj" || exit $?
4487 exit $EXIT_SUCCESS
4488 fi
4489
4490 if test -n "$pic_flag" || test "$pic_mode" != default; then
4491 # Only do commands if we really have different PIC objects.
4492 reload_objs="$libobjs $reload_conv_objs"
4493 output="$libobj"
4494 cmds=$reload_cmds
4495 save_ifs="$IFS"; IFS='~'
4496 for cmd in $cmds; do
4497 IFS="$save_ifs"
4498 eval cmd=\"$cmd\"
4499 $show "$cmd"
4500 $run eval "$cmd" || exit $?
4501 done
4502 IFS="$save_ifs"
4503 fi
4504
4505 if test -n "$gentop"; then
4506 $show "${rm}r $gentop"
4507 $run ${rm}r $gentop
4508 fi
4509
4510 exit $EXIT_SUCCESS
4511 ;;
4512
4513 prog)
4514 case $host in
4515 *cygwin*) output=`$echo $output | ${SED} -e 's,.exe$,,;s,$,.exe,'` ;;
4516 esac
4517 if test -n "$vinfo"; then
4518 $echo "$modename: warning: \`-version-info' is ignored for programs" 1>&2
4519 fi
4520
4521 if test -n "$release"; then
4522 $echo "$modename: warning: \`-release' is ignored for programs" 1>&2
4523 fi
4524
4525 if test "$preload" = yes; then
4526 if test "$dlopen_support" = unknown && test "$dlopen_self" = unknown &&
4527 test "$dlopen_self_static" = unknown; then
4528 $echo "$modename: warning: \`AC_LIBTOOL_DLOPEN' not used. Assuming no dlopen support."
4529 fi
4530 fi
4531
4532 case $host in
4533 *-*-rhapsody* | *-*-darwin1.[012])
4534 # On Rhapsody replace the C library is the System framework
4535 compile_deplibs=`$echo "X $compile_deplibs" | $Xsed -e 's/ -lc / -framework System /'`
4536 finalize_deplibs=`$echo "X $finalize_deplibs" | $Xsed -e 's/ -lc / -framework System /'`
4537 ;;
4538 esac
4539
4540 case $host in
4541 *darwin*)
4542 # Don't allow lazy linking, it breaks C++ global constructors
4543 if test "$tagname" = CXX ; then
4544 compile_command="$compile_command ${wl}-bind_at_load"
4545 finalize_command="$finalize_command ${wl}-bind_at_load"
4546 fi
4547 ;;
4548 esac
4549
4550 compile_command="$compile_command $compile_deplibs"
4551 finalize_command="$finalize_command $finalize_deplibs"
4552
4553 if test -n "$rpath$xrpath"; then
4554 # If the user specified any rpath flags, then add them.
4555 for libdir in $rpath $xrpath; do
4556 # This is the magic to use -rpath.
4557 case "$finalize_rpath " in
4558 *" $libdir "*) ;;
4559 *) finalize_rpath="$finalize_rpath $libdir" ;;
4560 esac
4561 done
4562 fi
4563
4564 # Now hardcode the library paths
4565 rpath=
4566 hardcode_libdirs=
4567 for libdir in $compile_rpath $finalize_rpath; do
4568 if test -n "$hardcode_libdir_flag_spec"; then
4569 if test -n "$hardcode_libdir_separator"; then
4570 if test -z "$hardcode_libdirs"; then
4571 hardcode_libdirs="$libdir"
4572 else
4573 # Just accumulate the unique libdirs.
4574 case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in
4575 *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*)
4576 ;;
4577 *)
4578 hardcode_libdirs="$hardcode_libdirs$hardcode_libdir_separator$libdir"
4579 ;;
4580 esac
4581 fi
4582 else
4583 eval flag=\"$hardcode_libdir_flag_spec\"
4584 rpath="$rpath $flag"
4585 fi
4586 elif test -n "$runpath_var"; then
4587 case "$perm_rpath " in
4588 *" $libdir "*) ;;
4589 *) perm_rpath="$perm_rpath $libdir" ;;
4590 esac
4591 fi
4592 case $host in
4593 *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2*)
4594 case :$dllsearchpath: in
4595 *":$libdir:"*) ;;
4596 *) dllsearchpath="$dllsearchpath:$libdir";;
4597 esac
4598 ;;
4599 esac
4600 done
4601 # Substitute the hardcoded libdirs into the rpath.
4602 if test -n "$hardcode_libdir_separator" &&
4603 test -n "$hardcode_libdirs"; then
4604 libdir="$hardcode_libdirs"
4605 eval rpath=\" $hardcode_libdir_flag_spec\"
4606 fi
4607 compile_rpath="$rpath"
4608
4609 rpath=
4610 hardcode_libdirs=
4611 for libdir in $finalize_rpath; do
4612 if test -n "$hardcode_libdir_flag_spec"; then
4613 if test -n "$hardcode_libdir_separator"; then
4614 if test -z "$hardcode_libdirs"; then
4615 hardcode_libdirs="$libdir"
4616 else
4617 # Just accumulate the unique libdirs.
4618 case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in
4619 *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*)
4620 ;;
4621 *)
4622 hardcode_libdirs="$hardcode_libdirs$hardcode_libdir_separator$libdir"
4623 ;;
4624 esac
4625 fi
4626 else
4627 eval flag=\"$hardcode_libdir_flag_spec\"
4628 rpath="$rpath $flag"
4629 fi
4630 elif test -n "$runpath_var"; then
4631 case "$finalize_perm_rpath " in
4632 *" $libdir "*) ;;
4633 *) finalize_perm_rpath="$finalize_perm_rpath $libdir" ;;
4634 esac
4635 fi
4636 done
4637 # Substitute the hardcoded libdirs into the rpath.
4638 if test -n "$hardcode_libdir_separator" &&
4639 test -n "$hardcode_libdirs"; then
4640 libdir="$hardcode_libdirs"
4641 eval rpath=\" $hardcode_libdir_flag_spec\"
4642 fi
4643 finalize_rpath="$rpath"
4644
4645 if test -n "$libobjs" && test "$build_old_libs" = yes; then
4646 # Transform all the library objects into standard objects.
4647 compile_command=`$echo "X$compile_command" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP`
4648 finalize_command=`$echo "X$finalize_command" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP`
4649 fi
4650
4651 dlsyms=
4652 if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then
4653 if test -n "$NM" && test -n "$global_symbol_pipe"; then
4654 dlsyms="${outputname}S.c"
4655 else
4656 $echo "$modename: not configured to extract global symbols from dlpreopened files" 1>&2
4657 fi
4658 fi
4659
4660 if test -n "$dlsyms"; then
4661 case $dlsyms in
4662 "") ;;
4663 *.c)
4664 # Discover the nlist of each of the dlfiles.
4665 nlist="$output_objdir/${outputname}.nm"
4666
4667 $show "$rm $nlist ${nlist}S ${nlist}T"
4668 $run $rm "$nlist" "${nlist}S" "${nlist}T"
4669
4670 # Parse the name list into a source file.
4671 $show "creating $output_objdir/$dlsyms"
4672
4673 test -z "$run" && $echo > "$output_objdir/$dlsyms" "\
4674/* $dlsyms - symbol resolution table for \`$outputname' dlsym emulation. */
4675/* Generated by $PROGRAM - GNU $PACKAGE $VERSION$TIMESTAMP */
4676
4677#ifdef __cplusplus
4678extern \"C\" {
4679#endif
4680
4681/* Prevent the only kind of declaration conflicts we can make. */
4682#define lt_preloaded_symbols some_other_symbol
4683
4684/* External symbol declarations for the compiler. */\
4685"
4686
4687 if test "$dlself" = yes; then
4688 $show "generating symbol list for \`$output'"
4689
4690 test -z "$run" && $echo ': @PROGRAM@ ' > "$nlist"
4691
4692 # Add our own program objects to the symbol list.
4693 progfiles=`$echo "X$objs$old_deplibs" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP`
4694 for arg in $progfiles; do
4695 $show "extracting global C symbols from \`$arg'"
4696 $run eval "$NM $arg | $global_symbol_pipe >> '$nlist'"
4697 done
4698
4699 if test -n "$exclude_expsyms"; then
4700 $run eval '$EGREP -v " ($exclude_expsyms)$" "$nlist" > "$nlist"T'
4701 $run eval '$mv "$nlist"T "$nlist"'
4702 fi
4703
4704 if test -n "$export_symbols_regex"; then
4705 $run eval '$EGREP -e "$export_symbols_regex" "$nlist" > "$nlist"T'
4706 $run eval '$mv "$nlist"T "$nlist"'
4707 fi
4708
4709 # Prepare the list of exported symbols
4710 if test -z "$export_symbols"; then
4711 export_symbols="$output_objdir/$outputname.exp"
4712 $run $rm $export_symbols
4713 $run eval "${SED} -n -e '/^: @PROGRAM@$/d' -e 's/^.* \(.*\)$/\1/p' "'< "$nlist" > "$export_symbols"'
4714 else
4715 $run eval "${SED} -e 's/\([ ][.*^$]\)/\\\1/g' -e 's/^/ /' -e 's/$/$/'"' < "$export_symbols" > "$output_objdir/$outputname.exp"'
4716 $run eval 'grep -f "$output_objdir/$outputname.exp" < "$nlist" > "$nlist"T'
4717 $run eval 'mv "$nlist"T "$nlist"'
4718 fi
4719 fi
4720
4721 for arg in $dlprefiles; do
4722 $show "extracting global C symbols from \`$arg'"
4723 name=`$echo "$arg" | ${SED} -e 's%^.*/%%'`
4724 $run eval '$echo ": $name " >> "$nlist"'
4725 $run eval "$NM $arg | $global_symbol_pipe >> '$nlist'"
4726 done
4727
4728 if test -z "$run"; then
4729 # Make sure we have at least an empty file.
4730 test -f "$nlist" || : > "$nlist"
4731
4732 if test -n "$exclude_expsyms"; then
4733 $EGREP -v " ($exclude_expsyms)$" "$nlist" > "$nlist"T
4734 $mv "$nlist"T "$nlist"
4735 fi
4736
4737 # Try sorting and uniquifying the output.
4738 if grep -v "^: " < "$nlist" |
4739 if sort -k 3 </dev/null >/dev/null 2>&1; then
4740 sort -k 3
4741 else
4742 sort +2
4743 fi |
4744 uniq > "$nlist"S; then
4745 :
4746 else
4747 grep -v "^: " < "$nlist" > "$nlist"S
4748 fi
4749
4750 if test -f "$nlist"S; then
4751 eval "$global_symbol_to_cdecl"' < "$nlist"S >> "$output_objdir/$dlsyms"'
4752 else
4753 $echo '/* NONE */' >> "$output_objdir/$dlsyms"
4754 fi
4755
4756 $echo >> "$output_objdir/$dlsyms" "\
4757
4758#undef lt_preloaded_symbols
4759
4760#if defined (__STDC__) && __STDC__
4761# define lt_ptr void *
4762#else
4763# define lt_ptr char *
4764# define const
4765#endif
4766
4767/* The mapping between symbol names and symbols. */
4768"
4769
4770 case $host in
4771 *cygwin* | *mingw* )
4772 $echo >> "$output_objdir/$dlsyms" "\
4773/* DATA imports from DLLs on WIN32 can't be const, because
4774 runtime relocations are performed -- see ld's documentation
4775 on pseudo-relocs */
4776struct {
4777"
4778 ;;
4779 * )
4780 $echo >> "$output_objdir/$dlsyms" "\
4781const struct {
4782"
4783 ;;
4784 esac
4785
4786
4787 $echo >> "$output_objdir/$dlsyms" "\
4788 const char *name;
4789 lt_ptr address;
4790}
4791lt_preloaded_symbols[] =
4792{\
4793"
4794
4795 eval "$global_symbol_to_c_name_address" < "$nlist" >> "$output_objdir/$dlsyms"
4796
4797 $echo >> "$output_objdir/$dlsyms" "\
4798 {0, (lt_ptr) 0}
4799};
4800
4801/* This works around a problem in FreeBSD linker */
4802#ifdef FREEBSD_WORKAROUND
4803static const void *lt_preloaded_setup() {
4804 return lt_preloaded_symbols;
4805}
4806#endif
4807
4808#ifdef __cplusplus
4809}
4810#endif\
4811"
4812 fi
4813
4814 pic_flag_for_symtable=
4815 case $host in
4816 # compiling the symbol table file with pic_flag works around
4817 # a FreeBSD bug that causes programs to crash when -lm is
4818 # linked before any other PIC object. But we must not use
4819 # pic_flag when linking with -static. The problem exists in
4820 # FreeBSD 2.2.6 and is fixed in FreeBSD 3.1.
4821 *-*-freebsd2*|*-*-freebsd3.0*|*-*-freebsdelf3.0*)
4822 case "$compile_command " in
4823 *" -static "*) ;;
4824 *) pic_flag_for_symtable=" $pic_flag -DFREEBSD_WORKAROUND";;
4825 esac;;
4826 *-*-hpux*)
4827 case "$compile_command " in
4828 *" -static "*) ;;
4829 *) pic_flag_for_symtable=" $pic_flag";;
4830 esac
4831 esac
4832
4833 # Now compile the dynamic symbol file.
4834 $show "(cd $output_objdir && $LTCC -c$no_builtin_flag$pic_flag_for_symtable \"$dlsyms\")"
4835 $run eval '(cd $output_objdir && $LTCC -c$no_builtin_flag$pic_flag_for_symtable "$dlsyms")' || exit $?
4836
4837 # Clean up the generated files.
4838 $show "$rm $output_objdir/$dlsyms $nlist ${nlist}S ${nlist}T"
4839 $run $rm "$output_objdir/$dlsyms" "$nlist" "${nlist}S" "${nlist}T"
4840
4841 # Transform the symbol file into the correct name.
4842 compile_command=`$echo "X$compile_command" | $Xsed -e "s%@SYMFILE@%$output_objdir/${outputname}S.${objext}%"`
4843 finalize_command=`$echo "X$finalize_command" | $Xsed -e "s%@SYMFILE@%$output_objdir/${outputname}S.${objext}%"`
4844 ;;
4845 *)
4846 $echo "$modename: unknown suffix for \`$dlsyms'" 1>&2
4847 exit $EXIT_FAILURE
4848 ;;
4849 esac
4850 else
4851 # We keep going just in case the user didn't refer to
4852 # lt_preloaded_symbols. The linker will fail if global_symbol_pipe
4853 # really was required.
4854
4855 # Nullify the symbol file.
4856 compile_command=`$echo "X$compile_command" | $Xsed -e "s% @SYMFILE@%%"`
4857 finalize_command=`$echo "X$finalize_command" | $Xsed -e "s% @SYMFILE@%%"`
4858 fi
4859
4860 if test "$need_relink" = no || test "$build_libtool_libs" != yes; then
4861 # Replace the output file specification.
4862 compile_command=`$echo "X$compile_command" | $Xsed -e 's%@OUTPUT@%'"$output"'%g'`
4863 link_command="$compile_command$compile_rpath"
4864
4865 # We have no uninstalled library dependencies, so finalize right now.
4866 $show "$link_command"
4867 $run eval "$link_command"
4868 status=$?
4869
4870 # Delete the generated files.
4871 if test -n "$dlsyms"; then
4872 $show "$rm $output_objdir/${outputname}S.${objext}"
4873 $run $rm "$output_objdir/${outputname}S.${objext}"
4874 fi
4875
4876 exit $status
4877 fi
4878
4879 if test -n "$shlibpath_var"; then
4880 # We should set the shlibpath_var
4881 rpath=
4882 for dir in $temp_rpath; do
4883 case $dir in
4884 [\\/]* | [A-Za-z]:[\\/]*)
4885 # Absolute path.
4886 rpath="$rpath$dir:"
4887 ;;
4888 *)
4889 # Relative path: add a thisdir entry.
4890 rpath="$rpath\$thisdir/$dir:"
4891 ;;
4892 esac
4893 done
4894 temp_rpath="$rpath"
4895 fi
4896
4897 if test -n "$compile_shlibpath$finalize_shlibpath"; then
4898 compile_command="$shlibpath_var=\"$compile_shlibpath$finalize_shlibpath\$$shlibpath_var\" $compile_command"
4899 fi
4900 if test -n "$finalize_shlibpath"; then
4901 finalize_command="$shlibpath_var=\"$finalize_shlibpath\$$shlibpath_var\" $finalize_command"
4902 fi
4903
4904 compile_var=
4905 finalize_var=
4906 if test -n "$runpath_var"; then
4907 if test -n "$perm_rpath"; then
4908 # We should set the runpath_var.
4909 rpath=
4910 for dir in $perm_rpath; do
4911 rpath="$rpath$dir:"
4912 done
4913 compile_var="$runpath_var=\"$rpath\$$runpath_var\" "
4914 fi
4915 if test -n "$finalize_perm_rpath"; then
4916 # We should set the runpath_var.
4917 rpath=
4918 for dir in $finalize_perm_rpath; do
4919 rpath="$rpath$dir:"
4920 done
4921 finalize_var="$runpath_var=\"$rpath\$$runpath_var\" "
4922 fi
4923 fi
4924
4925 if test "$no_install" = yes; then
4926 # We don't need to create a wrapper script.
4927 link_command="$compile_var$compile_command$compile_rpath"
4928 # Replace the output file specification.
4929 link_command=`$echo "X$link_command" | $Xsed -e 's%@OUTPUT@%'"$output"'%g'`
4930 # Delete the old output file.
4931 $run $rm $output
4932 # Link the executable and exit
4933 $show "$link_command"
4934 $run eval "$link_command" || exit $?
4935 exit $EXIT_SUCCESS
4936 fi
4937
4938 if test "$hardcode_action" = relink; then
4939 # Fast installation is not supported
4940 link_command="$compile_var$compile_command$compile_rpath"
4941 relink_command="$finalize_var$finalize_command$finalize_rpath"
4942
4943 $echo "$modename: warning: this platform does not like uninstalled shared libraries" 1>&2
4944 $echo "$modename: \`$output' will be relinked during installation" 1>&2
4945 else
4946 if test "$fast_install" != no; then
4947 link_command="$finalize_var$compile_command$finalize_rpath"
4948 if test "$fast_install" = yes; then
4949 relink_command=`$echo "X$compile_var$compile_command$compile_rpath" | $Xsed -e 's%@OUTPUT@%\$progdir/\$file%g'`
4950 else
4951 # fast_install is set to needless
4952 relink_command=
4953 fi
4954 else
4955 link_command="$compile_var$compile_command$compile_rpath"
4956 relink_command="$finalize_var$finalize_command$finalize_rpath"
4957 fi
4958 fi
4959
4960 # Replace the output file specification.
4961 link_command=`$echo "X$link_command" | $Xsed -e 's%@OUTPUT@%'"$output_objdir/$outputname"'%g'`
4962
4963 # Delete the old output files.
4964 $run $rm $output $output_objdir/$outputname $output_objdir/lt-$outputname
4965
4966 $show "$link_command"
4967 $run eval "$link_command" || exit $?
4968
4969 # Now create the wrapper script.
4970 $show "creating $output"
4971
4972 # Quote the relink command for shipping.
4973 if test -n "$relink_command"; then
4974 # Preserve any variables that may affect compiler behavior
4975 for var in $variables_saved_for_relink; do
4976 if eval test -z \"\${$var+set}\"; then
4977 relink_command="{ test -z \"\${$var+set}\" || unset $var || { $var=; export $var; }; }; $relink_command"
4978 elif eval var_value=\$$var; test -z "$var_value"; then
4979 relink_command="$var=; export $var; $relink_command"
4980 else
4981 var_value=`$echo "X$var_value" | $Xsed -e "$sed_quote_subst"`
4982 relink_command="$var=\"$var_value\"; export $var; $relink_command"
4983 fi
4984 done
4985 relink_command="(cd `pwd`; $relink_command)"
4986 relink_command=`$echo "X$relink_command" | $Xsed -e "$sed_quote_subst"`
4987 fi
4988
4989 # Quote $echo for shipping.
4990 if test "X$echo" = "X$SHELL $progpath --fallback-echo"; then
4991 case $progpath in
4992 [\\/]* | [A-Za-z]:[\\/]*) qecho="$SHELL $progpath --fallback-echo";;
4993 *) qecho="$SHELL `pwd`/$progpath --fallback-echo";;
4994 esac
4995 qecho=`$echo "X$qecho" | $Xsed -e "$sed_quote_subst"`
4996 else
4997 qecho=`$echo "X$echo" | $Xsed -e "$sed_quote_subst"`
4998 fi
4999
5000 # Only actually do things if our run command is non-null.
5001 if test -z "$run"; then
5002 # win32 will think the script is a binary if it has
5003 # a .exe suffix, so we strip it off here.
5004 case $output in
5005 *.exe) output=`$echo $output|${SED} 's,.exe$,,'` ;;
5006 esac
5007 # test for cygwin because mv fails w/o .exe extensions
5008 case $host in
5009 *cygwin*)
5010 exeext=.exe
5011 outputname=`$echo $outputname|${SED} 's,.exe$,,'` ;;
5012 *) exeext= ;;
5013 esac
5014 case $host in
5015 *cygwin* | *mingw* )
5016 cwrappersource=`$echo ${objdir}/lt-${outputname}.c`
5017 cwrapper=`$echo ${output}.exe`
5018 $rm $cwrappersource $cwrapper
5019 trap "$rm $cwrappersource $cwrapper; exit $EXIT_FAILURE" 1 2 15
5020
5021 cat > $cwrappersource <<EOF
5022
5023/* $cwrappersource - temporary wrapper executable for $objdir/$outputname
5024 Generated by $PROGRAM - GNU $PACKAGE $VERSION$TIMESTAMP
5025
5026 The $output program cannot be directly executed until all the libtool
5027 libraries that it depends on are installed.
5028
5029 This wrapper executable should never be moved out of the build directory.
5030 If it is, it will not operate correctly.
5031
5032 Currently, it simply execs the wrapper *script* "/bin/sh $output",
5033 but could eventually absorb all of the scripts functionality and
5034 exec $objdir/$outputname directly.
5035*/
5036EOF
5037 cat >> $cwrappersource<<"EOF"
5038#include <stdio.h>
5039#include <stdlib.h>
5040#include <unistd.h>
5041#include <malloc.h>
5042#include <stdarg.h>
5043#include <assert.h>
5044
5045#if defined(PATH_MAX)
5046# define LT_PATHMAX PATH_MAX
5047#elif defined(MAXPATHLEN)
5048# define LT_PATHMAX MAXPATHLEN
5049#else
5050# define LT_PATHMAX 1024
5051#endif
5052
5053#ifndef DIR_SEPARATOR
5054#define DIR_SEPARATOR '/'
5055#endif
5056
5057#if defined (_WIN32) || defined (__MSDOS__) || defined (__DJGPP__) || \
5058 defined (__OS2__)
5059#define HAVE_DOS_BASED_FILE_SYSTEM
5060#ifndef DIR_SEPARATOR_2
5061#define DIR_SEPARATOR_2 '\\'
5062#endif
5063#endif
5064
5065#ifndef DIR_SEPARATOR_2
5066# define IS_DIR_SEPARATOR(ch) ((ch) == DIR_SEPARATOR)
5067#else /* DIR_SEPARATOR_2 */
5068# define IS_DIR_SEPARATOR(ch) \
5069 (((ch) == DIR_SEPARATOR) || ((ch) == DIR_SEPARATOR_2))
5070#endif /* DIR_SEPARATOR_2 */
5071
5072#define XMALLOC(type, num) ((type *) xmalloc ((num) * sizeof(type)))
5073#define XFREE(stale) do { \
5074 if (stale) { free ((void *) stale); stale = 0; } \
5075} while (0)
5076
5077const char *program_name = NULL;
5078
5079void * xmalloc (size_t num);
5080char * xstrdup (const char *string);
5081char * basename (const char *name);
5082char * fnqualify(const char *path);
5083char * strendzap(char *str, const char *pat);
5084void lt_fatal (const char *message, ...);
5085
5086int
5087main (int argc, char *argv[])
5088{
5089 char **newargz;
5090 int i;
5091
5092 program_name = (char *) xstrdup ((char *) basename (argv[0]));
5093 newargz = XMALLOC(char *, argc+2);
5094EOF
5095
5096 cat >> $cwrappersource <<EOF
5097 newargz[0] = "$SHELL";
5098EOF
5099
5100 cat >> $cwrappersource <<"EOF"
5101 newargz[1] = fnqualify(argv[0]);
5102 /* we know the script has the same name, without the .exe */
5103 /* so make sure newargz[1] doesn't end in .exe */
5104 strendzap(newargz[1],".exe");
5105 for (i = 1; i < argc; i++)
5106 newargz[i+1] = xstrdup(argv[i]);
5107 newargz[argc+1] = NULL;
5108EOF
5109
5110 cat >> $cwrappersource <<EOF
5111 execv("$SHELL",newargz);
5112EOF
5113
5114 cat >> $cwrappersource <<"EOF"
5115}
5116
5117void *
5118xmalloc (size_t num)
5119{
5120 void * p = (void *) malloc (num);
5121 if (!p)
5122 lt_fatal ("Memory exhausted");
5123
5124 return p;
5125}
5126
5127char *
5128xstrdup (const char *string)
5129{
5130 return string ? strcpy ((char *) xmalloc (strlen (string) + 1), string) : NULL
5131;
5132}
5133
5134char *
5135basename (const char *name)
5136{
5137 const char *base;
5138
5139#if defined (HAVE_DOS_BASED_FILE_SYSTEM)
5140 /* Skip over the disk name in MSDOS pathnames. */
5141 if (isalpha (name[0]) && name[1] == ':')
5142 name += 2;
5143#endif
5144
5145 for (base = name; *name; name++)
5146 if (IS_DIR_SEPARATOR (*name))
5147 base = name + 1;
5148 return (char *) base;
5149}
5150
5151char *
5152fnqualify(const char *path)
5153{
5154 size_t size;
5155 char *p;
5156 char tmp[LT_PATHMAX + 1];
5157
5158 assert(path != NULL);
5159
5160 /* Is it qualified already? */
5161#if defined (HAVE_DOS_BASED_FILE_SYSTEM)
5162 if (isalpha (path[0]) && path[1] == ':')
5163 return xstrdup (path);
5164#endif
5165 if (IS_DIR_SEPARATOR (path[0]))
5166 return xstrdup (path);
5167
5168 /* prepend the current directory */
5169 /* doesn't handle '~' */
5170 if (getcwd (tmp, LT_PATHMAX) == NULL)
5171 lt_fatal ("getcwd failed");
5172 size = strlen(tmp) + 1 + strlen(path) + 1; /* +2 for '/' and '\0' */
5173 p = XMALLOC(char, size);
5174 sprintf(p, "%s%c%s", tmp, DIR_SEPARATOR, path);
5175 return p;
5176}
5177
5178char *
5179strendzap(char *str, const char *pat)
5180{
5181 size_t len, patlen;
5182
5183 assert(str != NULL);
5184 assert(pat != NULL);
5185
5186 len = strlen(str);
5187 patlen = strlen(pat);
5188
5189 if (patlen <= len)
5190 {
5191 str += len - patlen;
5192 if (strcmp(str, pat) == 0)
5193 *str = '\0';
5194 }
5195 return str;
5196}
5197
5198static void
5199lt_error_core (int exit_status, const char * mode,
5200 const char * message, va_list ap)
5201{
5202 fprintf (stderr, "%s: %s: ", program_name, mode);
5203 vfprintf (stderr, message, ap);
5204 fprintf (stderr, ".\n");
5205
5206 if (exit_status >= 0)
5207 exit (exit_status);
5208}
5209
5210void
5211lt_fatal (const char *message, ...)
5212{
5213 va_list ap;
5214 va_start (ap, message);
5215 lt_error_core (EXIT_FAILURE, "FATAL", message, ap);
5216 va_end (ap);
5217}
5218EOF
5219 # we should really use a build-platform specific compiler
5220 # here, but OTOH, the wrappers (shell script and this C one)
5221 # are only useful if you want to execute the "real" binary.
5222 # Since the "real" binary is built for $host, then this
5223 # wrapper might as well be built for $host, too.
5224 $run $LTCC -s -o $cwrapper $cwrappersource
5225 ;;
5226 esac
5227 $rm $output
5228 trap "$rm $output; exit $EXIT_FAILURE" 1 2 15
5229
5230 $echo > $output "\
5231#! $SHELL
5232
5233# $output - temporary wrapper script for $objdir/$outputname
5234# Generated by $PROGRAM - GNU $PACKAGE $VERSION$TIMESTAMP
5235#
5236# The $output program cannot be directly executed until all the libtool
5237# libraries that it depends on are installed.
5238#
5239# This wrapper script should never be moved out of the build directory.
5240# If it is, it will not operate correctly.
5241
5242# Sed substitution that helps us do robust quoting. It backslashifies
5243# metacharacters that are still active within double-quoted strings.
5244Xsed='${SED} -e 1s/^X//'
5245sed_quote_subst='$sed_quote_subst'
5246
5247# The HP-UX ksh and POSIX shell print the target directory to stdout
5248# if CDPATH is set.
5249(unset CDPATH) >/dev/null 2>&1 && unset CDPATH
5250
5251relink_command=\"$relink_command\"
5252
5253# This environment variable determines our operation mode.
5254if test \"\$libtool_install_magic\" = \"$magic\"; then
5255 # install mode needs the following variable:
5256 notinst_deplibs='$notinst_deplibs'
5257else
5258 # When we are sourced in execute mode, \$file and \$echo are already set.
5259 if test \"\$libtool_execute_magic\" != \"$magic\"; then
5260 echo=\"$qecho\"
5261 file=\"\$0\"
5262 # Make sure echo works.
5263 if test \"X\$1\" = X--no-reexec; then
5264 # Discard the --no-reexec flag, and continue.
5265 shift
5266 elif test \"X\`(\$echo '\t') 2>/dev/null\`\" = 'X\t'; then
5267 # Yippee, \$echo works!
5268 :
5269 else
5270 # Restart under the correct shell, and then maybe \$echo will work.
5271 exec $SHELL \"\$0\" --no-reexec \${1+\"\$@\"}
5272 fi
5273 fi\
5274"
5275 $echo >> $output "\
5276
5277 # Find the directory that this script lives in.
5278 thisdir=\`\$echo \"X\$file\" | \$Xsed -e 's%/[^/]*$%%'\`
5279 test \"x\$thisdir\" = \"x\$file\" && thisdir=.
5280
5281 # Follow symbolic links until we get to the real thisdir.
5282 file=\`ls -ld \"\$file\" | ${SED} -n 's/.*-> //p'\`
5283 while test -n \"\$file\"; do
5284 destdir=\`\$echo \"X\$file\" | \$Xsed -e 's%/[^/]*\$%%'\`
5285
5286 # If there was a directory component, then change thisdir.
5287 if test \"x\$destdir\" != \"x\$file\"; then
5288 case \"\$destdir\" in
5289 [\\\\/]* | [A-Za-z]:[\\\\/]*) thisdir=\"\$destdir\" ;;
5290 *) thisdir=\"\$thisdir/\$destdir\" ;;
5291 esac
5292 fi
5293
5294 file=\`\$echo \"X\$file\" | \$Xsed -e 's%^.*/%%'\`
5295 file=\`ls -ld \"\$thisdir/\$file\" | ${SED} -n 's/.*-> //p'\`
5296 done
5297
5298 # Try to get the absolute directory name.
5299 absdir=\`cd \"\$thisdir\" && pwd\`
5300 test -n \"\$absdir\" && thisdir=\"\$absdir\"
5301"
5302
5303 if test "$fast_install" = yes; then
5304 $echo >> $output "\
5305 program=lt-'$outputname'$exeext
5306 progdir=\"\$thisdir/$objdir\"
5307
5308 if test ! -f \"\$progdir/\$program\" || \\
5309 { file=\`ls -1dt \"\$progdir/\$program\" \"\$progdir/../\$program\" 2>/dev/null | ${SED} 1q\`; \\
5310 test \"X\$file\" != \"X\$progdir/\$program\"; }; then
5311
5312 file=\"\$\$-\$program\"
5313
5314 if test ! -d \"\$progdir\"; then
5315 $mkdir \"\$progdir\"
5316 else
5317 $rm \"\$progdir/\$file\"
5318 fi"
5319
5320 $echo >> $output "\
5321
5322 # relink executable if necessary
5323 if test -n \"\$relink_command\"; then
5324 if relink_command_output=\`eval \$relink_command 2>&1\`; then :
5325 else
5326 $echo \"\$relink_command_output\" >&2
5327 $rm \"\$progdir/\$file\"
5328 exit $EXIT_FAILURE
5329 fi
5330 fi
5331
5332 $mv \"\$progdir/\$file\" \"\$progdir/\$program\" 2>/dev/null ||
5333 { $rm \"\$progdir/\$program\";
5334 $mv \"\$progdir/\$file\" \"\$progdir/\$program\"; }
5335 $rm \"\$progdir/\$file\"
5336 fi"
5337 else
5338 $echo >> $output "\
5339 program='$outputname'
5340 progdir=\"\$thisdir/$objdir\"
5341"
5342 fi
5343
5344 $echo >> $output "\
5345
5346 if test -f \"\$progdir/\$program\"; then"
5347
5348 # Export our shlibpath_var if we have one.
5349 if test "$shlibpath_overrides_runpath" = yes && test -n "$shlibpath_var" && test -n "$temp_rpath"; then
5350 $echo >> $output "\
5351 # Add our own library path to $shlibpath_var
5352 $shlibpath_var=\"$temp_rpath\$$shlibpath_var\"
5353
5354 # Some systems cannot cope with colon-terminated $shlibpath_var
5355 # The second colon is a workaround for a bug in BeOS R4 sed
5356 $shlibpath_var=\`\$echo \"X\$$shlibpath_var\" | \$Xsed -e 's/::*\$//'\`
5357
5358 export $shlibpath_var
5359"
5360 fi
5361
5362 # fixup the dll searchpath if we need to.
5363 if test -n "$dllsearchpath"; then
5364 $echo >> $output "\
5365 # Add the dll search path components to the executable PATH
5366 PATH=$dllsearchpath:\$PATH
5367"
5368 fi
5369
5370 $echo >> $output "\
5371 if test \"\$libtool_execute_magic\" != \"$magic\"; then
5372 # Run the actual program with our arguments.
5373"
5374 case $host in
5375 # Backslashes separate directories on plain windows
5376 *-*-mingw | *-*-os2*)
5377 $echo >> $output "\
5378 exec \$progdir\\\\\$program \${1+\"\$@\"}
5379"
5380 ;;
5381
5382 *)
5383 $echo >> $output "\
5384 exec \$progdir/\$program \${1+\"\$@\"}
5385"
5386 ;;
5387 esac
5388 $echo >> $output "\
5389 \$echo \"\$0: cannot exec \$program \${1+\"\$@\"}\"
5390 exit $EXIT_FAILURE
5391 fi
5392 else
5393 # The program doesn't exist.
5394 \$echo \"\$0: error: \$progdir/\$program does not exist\" 1>&2
5395 \$echo \"This script is just a wrapper for \$program.\" 1>&2
5396 $echo \"See the $PACKAGE documentation for more information.\" 1>&2
5397 exit $EXIT_FAILURE
5398 fi
5399fi\
5400"
5401 chmod +x $output
5402 fi
5403 exit $EXIT_SUCCESS
5404 ;;
5405 esac
5406
5407 # See if we need to build an old-fashioned archive.
5408 for oldlib in $oldlibs; do
5409
5410 if test "$build_libtool_libs" = convenience; then
5411 oldobjs="$libobjs_save"
5412 addlibs="$convenience"
5413 build_libtool_libs=no
5414 else
5415 if test "$build_libtool_libs" = module; then
5416 oldobjs="$libobjs_save"
5417 build_libtool_libs=no
5418 else
5419 oldobjs="$old_deplibs $non_pic_objects"
5420 fi
5421 addlibs="$old_convenience"
5422 fi
5423
5424 if test -n "$addlibs"; then
5425 gentop="$output_objdir/${outputname}x"
5426 generated="$generated $gentop"
5427
5428 func_extract_archives $gentop $addlibs
5429 oldobjs="$oldobjs $func_extract_archives_result"
5430 fi
5431
5432 # Do each command in the archive commands.
5433 if test -n "$old_archive_from_new_cmds" && test "$build_libtool_libs" = yes; then
5434 cmds=$old_archive_from_new_cmds
5435 else
5436 # POSIX demands no paths to be encoded in archives. We have
5437 # to avoid creating archives with duplicate basenames if we
5438 # might have to extract them afterwards, e.g., when creating a
5439 # static archive out of a convenience library, or when linking
5440 # the entirety of a libtool archive into another (currently
5441 # not supported by libtool).
5442 if (for obj in $oldobjs
5443 do
5444 $echo "X$obj" | $Xsed -e 's%^.*/%%'
5445 done | sort | sort -uc >/dev/null 2>&1); then
5446 :
5447 else
5448 $echo "copying selected object files to avoid basename conflicts..."
5449
5450 if test -z "$gentop"; then
5451 gentop="$output_objdir/${outputname}x"
5452 generated="$generated $gentop"
5453
5454 $show "${rm}r $gentop"
5455 $run ${rm}r "$gentop"
5456 $show "$mkdir $gentop"
5457 $run $mkdir "$gentop"
5458 status=$?
5459 if test "$status" -ne 0 && test ! -d "$gentop"; then
5460 exit $status
5461 fi
5462 fi
5463
5464 save_oldobjs=$oldobjs
5465 oldobjs=
5466 counter=1
5467 for obj in $save_oldobjs
5468 do
5469 objbase=`$echo "X$obj" | $Xsed -e 's%^.*/%%'`
5470 case " $oldobjs " in
5471 " ") oldobjs=$obj ;;
5472 *[\ /]"$objbase "*)
5473 while :; do
5474 # Make sure we don't pick an alternate name that also
5475 # overlaps.
5476 newobj=lt$counter-$objbase
5477 counter=`expr $counter + 1`
5478 case " $oldobjs " in
5479 *[\ /]"$newobj "*) ;;
5480 *) if test ! -f "$gentop/$newobj"; then break; fi ;;
5481 esac
5482 done
5483 $show "ln $obj $gentop/$newobj || cp $obj $gentop/$newobj"
5484 $run ln "$obj" "$gentop/$newobj" ||
5485 $run cp "$obj" "$gentop/$newobj"
5486 oldobjs="$oldobjs $gentop/$newobj"
5487 ;;
5488 *) oldobjs="$oldobjs $obj" ;;
5489 esac
5490 done
5491 fi
5492
5493 eval cmds=\"$old_archive_cmds\"
5494
5495 if len=`expr "X$cmds" : ".*"` &&
5496 test "$len" -le "$max_cmd_len" || test "$max_cmd_len" -le -1; then
5497 cmds=$old_archive_cmds
5498 else
5499 # the command line is too long to link in one step, link in parts
5500 $echo "using piecewise archive linking..."
5501 save_RANLIB=$RANLIB
5502 RANLIB=:
5503 objlist=
5504 concat_cmds=
5505 save_oldobjs=$oldobjs
5506
5507 # Is there a better way of finding the last object in the list?
5508 for obj in $save_oldobjs
5509 do
5510 last_oldobj=$obj
5511 done
5512 for obj in $save_oldobjs
5513 do
5514 oldobjs="$objlist $obj"
5515 objlist="$objlist $obj"
5516 eval test_cmds=\"$old_archive_cmds\"
5517 if len=`expr "X$test_cmds" : ".*"` &&
5518 test "$len" -le "$max_cmd_len"; then
5519 :
5520 else
5521 # the above command should be used before it gets too long
5522 oldobjs=$objlist
5523 if test "$obj" = "$last_oldobj" ; then
5524 RANLIB=$save_RANLIB
5525 fi
5526 test -z "$concat_cmds" || concat_cmds=$concat_cmds~
5527 eval concat_cmds=\"\${concat_cmds}$old_archive_cmds\"
5528 objlist=
5529 fi
5530 done
5531 RANLIB=$save_RANLIB
5532 oldobjs=$objlist
5533 if test "X$oldobjs" = "X" ; then
5534 eval cmds=\"\$concat_cmds\"
5535 else
5536 eval cmds=\"\$concat_cmds~\$old_archive_cmds\"
5537 fi
5538 fi
5539 fi
5540 save_ifs="$IFS"; IFS='~'
5541 for cmd in $cmds; do
5542 eval cmd=\"$cmd\"
5543 IFS="$save_ifs"
5544 $show "$cmd"
5545 $run eval "$cmd" || exit $?
5546 done
5547 IFS="$save_ifs"
5548 done
5549
5550 if test -n "$generated"; then
5551 $show "${rm}r$generated"
5552 $run ${rm}r$generated
5553 fi
5554
5555 # Now create the libtool archive.
5556 case $output in
5557 *.la)
5558 old_library=
5559 test "$build_old_libs" = yes && old_library="$libname.$libext"
5560 $show "creating $output"
5561
5562 # Preserve any variables that may affect compiler behavior
5563 for var in $variables_saved_for_relink; do
5564 if eval test -z \"\${$var+set}\"; then
5565 relink_command="{ test -z \"\${$var+set}\" || unset $var || { $var=; export $var; }; }; $relink_command"
5566 elif eval var_value=\$$var; test -z "$var_value"; then
5567 relink_command="$var=; export $var; $relink_command"
5568 else
5569 var_value=`$echo "X$var_value" | $Xsed -e "$sed_quote_subst"`
5570 relink_command="$var=\"$var_value\"; export $var; $relink_command"
5571 fi
5572 done
5573 # Quote the link command for shipping.
5574 relink_command="(cd `pwd`; $SHELL $progpath $preserve_args --mode=relink $libtool_args @inst_prefix_dir@)"
5575 relink_command=`$echo "X$relink_command" | $Xsed -e "$sed_quote_subst"`
5576 if test "$hardcode_automatic" = yes ; then
5577 relink_command=
5578 fi
5579
5580
5581 # Only create the output if not a dry run.
5582 if test -z "$run"; then
5583 for installed in no yes; do
5584 if test "$installed" = yes; then
5585 if test -z "$install_libdir"; then
5586 break
5587 fi
5588 output="$output_objdir/$outputname"i
5589 # Replace all uninstalled libtool libraries with the installed ones
5590 newdependency_libs=
5591 for deplib in $dependency_libs; do
5592 case $deplib in
5593 *.la)
5594 name=`$echo "X$deplib" | $Xsed -e 's%^.*/%%'`
5595 eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $deplib`
5596 if test -z "$libdir"; then
5597 $echo "$modename: \`$deplib' is not a valid libtool archive" 1>&2
5598 exit $EXIT_FAILURE
5599 fi
5600 newdependency_libs="$newdependency_libs $libdir/$name"
5601 ;;
5602 *) newdependency_libs="$newdependency_libs $deplib" ;;
5603 esac
5604 done
5605 dependency_libs="$newdependency_libs"
5606 newdlfiles=
5607 for lib in $dlfiles; do
5608 name=`$echo "X$lib" | $Xsed -e 's%^.*/%%'`
5609 eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $lib`
5610 if test -z "$libdir"; then
5611 $echo "$modename: \`$lib' is not a valid libtool archive" 1>&2
5612 exit $EXIT_FAILURE
5613 fi
5614 newdlfiles="$newdlfiles $libdir/$name"
5615 done
5616 dlfiles="$newdlfiles"
5617 newdlprefiles=
5618 for lib in $dlprefiles; do
5619 name=`$echo "X$lib" | $Xsed -e 's%^.*/%%'`
5620 eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $lib`
5621 if test -z "$libdir"; then
5622 $echo "$modename: \`$lib' is not a valid libtool archive" 1>&2
5623 exit $EXIT_FAILURE
5624 fi
5625 newdlprefiles="$newdlprefiles $libdir/$name"
5626 done
5627 dlprefiles="$newdlprefiles"
5628 else
5629 newdlfiles=
5630 for lib in $dlfiles; do
5631 case $lib in
5632 [\\/]* | [A-Za-z]:[\\/]*) abs="$lib" ;;
5633 *) abs=`pwd`"/$lib" ;;
5634 esac
5635 newdlfiles="$newdlfiles $abs"
5636 done
5637 dlfiles="$newdlfiles"
5638 newdlprefiles=
5639 for lib in $dlprefiles; do
5640 case $lib in
5641 [\\/]* | [A-Za-z]:[\\/]*) abs="$lib" ;;
5642 *) abs=`pwd`"/$lib" ;;
5643 esac
5644 newdlprefiles="$newdlprefiles $abs"
5645 done
5646 dlprefiles="$newdlprefiles"
5647 fi
5648 $rm $output
5649 # place dlname in correct position for cygwin
5650 tdlname=$dlname
5651 case $host,$output,$installed,$module,$dlname in
5652 *cygwin*,*lai,yes,no,*.dll | *mingw*,*lai,yes,no,*.dll) tdlname=../bin/$dlname ;;
5653 esac
5654 $echo > $output "\
5655# $outputname - a libtool library file
5656# Generated by $PROGRAM - GNU $PACKAGE $VERSION$TIMESTAMP
5657#
5658# Please DO NOT delete this file!
5659# It is necessary for linking the library.
5660
5661# The name that we can dlopen(3).
5662dlname='$tdlname'
5663
5664# Names of this library.
5665library_names='$library_names'
5666
5667# The name of the static archive.
5668old_library='$old_library'
5669
5670# Libraries that this one depends upon.
5671dependency_libs='$dependency_libs'
5672
5673# Version information for $libname.
5674current=$current
5675age=$age
5676revision=$revision
5677
5678# Is this an already installed library?
5679installed=$installed
5680
5681# Should we warn about portability when linking against -modules?
5682shouldnotlink=$module
5683
5684# Files to dlopen/dlpreopen
5685dlopen='$dlfiles'
5686dlpreopen='$dlprefiles'
5687
5688# Directory that this library needs to be installed in:
5689libdir='$install_libdir'"
5690 if test "$installed" = no && test "$need_relink" = yes; then
5691 $echo >> $output "\
5692relink_command=\"$relink_command\""
5693 fi
5694 done
5695 fi
5696
5697 # Do a symbolic link so that the libtool archive can be found in
5698 # LD_LIBRARY_PATH before the program is installed.
5699 $show "(cd $output_objdir && $rm $outputname && $LN_S ../$outputname $outputname)"
5700 $run eval '(cd $output_objdir && $rm $outputname && $LN_S ../$outputname $outputname)' || exit $?
5701 ;;
5702 esac
5703 exit $EXIT_SUCCESS
5704 ;;
5705
5706 # libtool install mode
5707 install)
5708 modename="$modename: install"
5709
5710 # There may be an optional sh(1) argument at the beginning of
5711 # install_prog (especially on Windows NT).
5712 if test "$nonopt" = "$SHELL" || test "$nonopt" = /bin/sh ||
5713 # Allow the use of GNU shtool's install command.
5714 $echo "X$nonopt" | $Xsed | grep shtool > /dev/null; then
5715 # Aesthetically quote it.
5716 arg=`$echo "X$nonopt" | $Xsed -e "$sed_quote_subst"`
5717 case $arg in
5718 *$quote_scanset* | *]* | *\|* | *\&* | *\(* | *\)* | "")
5719 arg="\"$arg\""
5720 ;;
5721 esac
5722 install_prog="$arg "
5723 arg="$1"
5724 shift
5725 else
5726 install_prog=
5727 arg="$nonopt"
5728 fi
5729
5730 # The real first argument should be the name of the installation program.
5731 # Aesthetically quote it.
5732 arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`
5733 case $arg in
5734 *$quote_scanset* | *]* | *\|* | *\&* | *\(* | *\)* | "")
5735 arg="\"$arg\""
5736 ;;
5737 esac
5738 install_prog="$install_prog$arg"
5739
5740 # We need to accept at least all the BSD install flags.
5741 dest=
5742 files=
5743 opts=
5744 prev=
5745 install_type=
5746 isdir=no
5747 stripme=
5748 for arg
5749 do
5750 if test -n "$dest"; then
5751 files="$files $dest"
5752 dest="$arg"
5753 continue
5754 fi
5755
5756 case $arg in
5757 -d) isdir=yes ;;
5758 -f) prev="-f" ;;
5759 -g) prev="-g" ;;
5760 -m) prev="-m" ;;
5761 -o) prev="-o" ;;
5762 -s)
5763 stripme=" -s"
5764 continue
5765 ;;
5766 -*) ;;
5767
5768 *)
5769 # If the previous option needed an argument, then skip it.
5770 if test -n "$prev"; then
5771 prev=
5772 else
5773 dest="$arg"
5774 continue
5775 fi
5776 ;;
5777 esac
5778
5779 # Aesthetically quote the argument.
5780 arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`
5781 case $arg in
5782 *$quote_scanset* | *]* | *\|* | *\&* | *\(* | *\)* | "")
5783 arg="\"$arg\""
5784 ;;
5785 esac
5786 install_prog="$install_prog $arg"
5787 done
5788
5789 if test -z "$install_prog"; then
5790 $echo "$modename: you must specify an install program" 1>&2
5791 $echo "$help" 1>&2
5792 exit $EXIT_FAILURE
5793 fi
5794
5795 if test -n "$prev"; then
5796 $echo "$modename: the \`$prev' option requires an argument" 1>&2
5797 $echo "$help" 1>&2
5798 exit $EXIT_FAILURE
5799 fi
5800
5801 if test -z "$files"; then
5802 if test -z "$dest"; then
5803 $echo "$modename: no file or destination specified" 1>&2
5804 else
5805 $echo "$modename: you must specify a destination" 1>&2
5806 fi
5807 $echo "$help" 1>&2
5808 exit $EXIT_FAILURE
5809 fi
5810
5811 # Strip any trailing slash from the destination.
5812 dest=`$echo "X$dest" | $Xsed -e 's%/$%%'`
5813
5814 # Check to see that the destination is a directory.
5815 test -d "$dest" && isdir=yes
5816 if test "$isdir" = yes; then
5817 destdir="$dest"
5818 destname=
5819 else
5820 destdir=`$echo "X$dest" | $Xsed -e 's%/[^/]*$%%'`
5821 test "X$destdir" = "X$dest" && destdir=.
5822 destname=`$echo "X$dest" | $Xsed -e 's%^.*/%%'`
5823
5824 # Not a directory, so check to see that there is only one file specified.
5825 set dummy $files
5826 if test "$#" -gt 2; then
5827 $echo "$modename: \`$dest' is not a directory" 1>&2
5828 $echo "$help" 1>&2
5829 exit $EXIT_FAILURE
5830 fi
5831 fi
5832 case $destdir in
5833 [\\/]* | [A-Za-z]:[\\/]*) ;;
5834 *)
5835 for file in $files; do
5836 case $file in
5837 *.lo) ;;
5838 *)
5839 $echo "$modename: \`$destdir' must be an absolute directory name" 1>&2
5840 $echo "$help" 1>&2
5841 exit $EXIT_FAILURE
5842 ;;
5843 esac
5844 done
5845 ;;
5846 esac
5847
5848 # This variable tells wrapper scripts just to set variables rather
5849 # than running their programs.
5850 libtool_install_magic="$magic"
5851
5852 staticlibs=
5853 future_libdirs=
5854 current_libdirs=
5855 for file in $files; do
5856
5857 # Do each installation.
5858 case $file in
5859 *.$libext)
5860 # Do the static libraries later.
5861 staticlibs="$staticlibs $file"
5862 ;;
5863
5864 *.la)
5865 # Check to see that this really is a libtool archive.
5866 if (${SED} -e '2q' $file | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then :
5867 else
5868 $echo "$modename: \`$file' is not a valid libtool archive" 1>&2
5869 $echo "$help" 1>&2
5870 exit $EXIT_FAILURE
5871 fi
5872
5873 library_names=
5874 old_library=
5875 relink_command=
5876 # If there is no directory component, then add one.
5877 case $file in
5878 */* | *\\*) . $file ;;
5879 *) . ./$file ;;
5880 esac
5881
5882 # Add the libdir to current_libdirs if it is the destination.
5883 if test "X$destdir" = "X$libdir"; then
5884 case "$current_libdirs " in
5885 *" $libdir "*) ;;
5886 *) current_libdirs="$current_libdirs $libdir" ;;
5887 esac
5888 else
5889 # Note the libdir as a future libdir.
5890 case "$future_libdirs " in
5891 *" $libdir "*) ;;
5892 *) future_libdirs="$future_libdirs $libdir" ;;
5893 esac
5894 fi
5895
5896 dir=`$echo "X$file" | $Xsed -e 's%/[^/]*$%%'`/
5897 test "X$dir" = "X$file/" && dir=
5898 dir="$dir$objdir"
5899
5900 if test -n "$relink_command"; then
5901 # Determine the prefix the user has applied to our future dir.
5902 inst_prefix_dir=`$echo "$destdir" | $SED "s%$libdir\$%%"`
5903
5904 # Don't allow the user to place us outside of our expected
5905 # location b/c this prevents finding dependent libraries that
5906 # are installed to the same prefix.
5907 # At present, this check doesn't affect windows .dll's that
5908 # are installed into $libdir/../bin (currently, that works fine)
5909 # but it's something to keep an eye on.
5910 if test "$inst_prefix_dir" = "$destdir"; then
5911 $echo "$modename: error: cannot install \`$file' to a directory not ending in $libdir" 1>&2
5912 exit $EXIT_FAILURE
5913 fi
5914
5915 if test -n "$inst_prefix_dir"; then
5916 # Stick the inst_prefix_dir data into the link command.
5917 relink_command=`$echo "$relink_command" | $SED "s%@inst_prefix_dir@%-inst-prefix-dir $inst_prefix_dir%"`
5918 else
5919 relink_command=`$echo "$relink_command" | $SED "s%@inst_prefix_dir@%%"`
5920 fi
5921
5922 $echo "$modename: warning: relinking \`$file'" 1>&2
5923 $show "$relink_command"
5924 if $run eval "$relink_command"; then :
5925 else
5926 $echo "$modename: error: relink \`$file' with the above command before installing it" 1>&2
5927 exit $EXIT_FAILURE
5928 fi
5929 fi
5930
5931 # See the names of the shared library.
5932 set dummy $library_names
5933 if test -n "$2"; then
5934 realname="$2"
5935 shift
5936 shift
5937
5938 srcname="$realname"
5939 test -n "$relink_command" && srcname="$realname"T
5940
5941 # Install the shared library and build the symlinks.
5942 $show "$install_prog $dir/$srcname $destdir/$realname"
5943 $run eval "$install_prog $dir/$srcname $destdir/$realname" || exit $?
5944 if test -n "$stripme" && test -n "$striplib"; then
5945 $show "$striplib $destdir/$realname"
5946 $run eval "$striplib $destdir/$realname" || exit $?
5947 fi
5948
5949 if test "$#" -gt 0; then
5950 # Delete the old symlinks, and create new ones.
5951 for linkname
5952 do
5953 if test "$linkname" != "$realname"; then
5954 $show "(cd $destdir && $rm $linkname && $LN_S $realname $linkname)"
5955 $run eval "(cd $destdir && $rm $linkname && $LN_S $realname $linkname)"
5956 fi
5957 done
5958 fi
5959
5960 # Do each command in the postinstall commands.
5961 lib="$destdir/$realname"
5962 cmds=$postinstall_cmds
5963 save_ifs="$IFS"; IFS='~'
5964 for cmd in $cmds; do
5965 IFS="$save_ifs"
5966 eval cmd=\"$cmd\"
5967 $show "$cmd"
5968 $run eval "$cmd" || exit $?
5969 done
5970 IFS="$save_ifs"
5971 fi
5972
5973 # Install the pseudo-library for information purposes.
5974 name=`$echo "X$file" | $Xsed -e 's%^.*/%%'`
5975 instname="$dir/$name"i
5976 $show "$install_prog $instname $destdir/$name"
5977 $run eval "$install_prog $instname $destdir/$name" || exit $?
5978
5979 # Maybe install the static library, too.
5980 test -n "$old_library" && staticlibs="$staticlibs $dir/$old_library"
5981 ;;
5982
5983 *.lo)
5984 # Install (i.e. copy) a libtool object.
5985
5986 # Figure out destination file name, if it wasn't already specified.
5987 if test -n "$destname"; then
5988 destfile="$destdir/$destname"
5989 else
5990 destfile=`$echo "X$file" | $Xsed -e 's%^.*/%%'`
5991 destfile="$destdir/$destfile"
5992 fi
5993
5994 # Deduce the name of the destination old-style object file.
5995 case $destfile in
5996 *.lo)
5997 staticdest=`$echo "X$destfile" | $Xsed -e "$lo2o"`
5998 ;;
5999 *.$objext)
6000 staticdest="$destfile"
6001 destfile=
6002 ;;
6003 *)
6004 $echo "$modename: cannot copy a libtool object to \`$destfile'" 1>&2
6005 $echo "$help" 1>&2
6006 exit $EXIT_FAILURE
6007 ;;
6008 esac
6009
6010 # Install the libtool object if requested.
6011 if test -n "$destfile"; then
6012 $show "$install_prog $file $destfile"
6013 $run eval "$install_prog $file $destfile" || exit $?
6014 fi
6015
6016 # Install the old object if enabled.
6017 if test "$build_old_libs" = yes; then
6018 # Deduce the name of the old-style object file.
6019 staticobj=`$echo "X$file" | $Xsed -e "$lo2o"`
6020
6021 $show "$install_prog $staticobj $staticdest"
6022 $run eval "$install_prog \$staticobj \$staticdest" || exit $?
6023 fi
6024 exit $EXIT_SUCCESS
6025 ;;
6026
6027 *)
6028 # Figure out destination file name, if it wasn't already specified.
6029 if test -n "$destname"; then
6030 destfile="$destdir/$destname"
6031 else
6032 destfile=`$echo "X$file" | $Xsed -e 's%^.*/%%'`
6033 destfile="$destdir/$destfile"
6034 fi
6035
6036 # If the file is missing, and there is a .exe on the end, strip it
6037 # because it is most likely a libtool script we actually want to
6038 # install
6039 stripped_ext=""
6040 case $file in
6041 *.exe)
6042 if test ! -f "$file"; then
6043 file=`$echo $file|${SED} 's,.exe$,,'`
6044 stripped_ext=".exe"
6045 fi
6046 ;;
6047 esac
6048
6049 # Do a test to see if this is really a libtool program.
6050 case $host in
6051 *cygwin*|*mingw*)
6052 wrapper=`$echo $file | ${SED} -e 's,.exe$,,'`
6053 ;;
6054 *)
6055 wrapper=$file
6056 ;;
6057 esac
6058 if (${SED} -e '4q' $wrapper | grep "^# Generated by .*$PACKAGE")>/dev/null 2>&1; then
6059 notinst_deplibs=
6060 relink_command=
6061
6062 # To insure that "foo" is sourced, and not "foo.exe",
6063 # finese the cygwin/MSYS system by explicitly sourcing "foo."
6064 # which disallows the automatic-append-.exe behavior.
6065 case $build in
6066 *cygwin* | *mingw*) wrapperdot=${wrapper}. ;;
6067 *) wrapperdot=${wrapper} ;;
6068 esac
6069 # If there is no directory component, then add one.
6070 case $file in
6071 */* | *\\*) . ${wrapperdot} ;;
6072 *) . ./${wrapperdot} ;;
6073 esac
6074
6075 # Check the variables that should have been set.
6076 if test -z "$notinst_deplibs"; then
6077 $echo "$modename: invalid libtool wrapper script \`$wrapper'" 1>&2
6078 exit $EXIT_FAILURE
6079 fi
6080
6081 finalize=yes
6082 for lib in $notinst_deplibs; do
6083 # Check to see that each library is installed.
6084 libdir=
6085 if test -f "$lib"; then
6086 # If there is no directory component, then add one.
6087 case $lib in
6088 */* | *\\*) . $lib ;;
6089 *) . ./$lib ;;
6090 esac
6091 fi
6092 libfile="$libdir/"`$echo "X$lib" | $Xsed -e 's%^.*/%%g'` ### testsuite: skip nested quoting test
6093 if test -n "$libdir" && test ! -f "$libfile"; then
6094 $echo "$modename: warning: \`$lib' has not been installed in \`$libdir'" 1>&2
6095 finalize=no
6096 fi
6097 done
6098
6099 relink_command=
6100 # To insure that "foo" is sourced, and not "foo.exe",
6101 # finese the cygwin/MSYS system by explicitly sourcing "foo."
6102 # which disallows the automatic-append-.exe behavior.
6103 case $build in
6104 *cygwin* | *mingw*) wrapperdot=${wrapper}. ;;
6105 *) wrapperdot=${wrapper} ;;
6106 esac
6107 # If there is no directory component, then add one.
6108 case $file in
6109 */* | *\\*) . ${wrapperdot} ;;
6110 *) . ./${wrapperdot} ;;
6111 esac
6112
6113 outputname=
6114 if test "$fast_install" = no && test -n "$relink_command"; then
6115 if test "$finalize" = yes && test -z "$run"; then
6116 tmpdir="/tmp"
6117 test -n "$TMPDIR" && tmpdir="$TMPDIR"
6118 tmpdir="$tmpdir/libtool-$$"
6119 save_umask=`umask`
6120 umask 0077
6121 if $mkdir "$tmpdir"; then
6122 umask $save_umask
6123 else
6124 umask $save_umask
6125 $echo "$modename: error: cannot create temporary directory \`$tmpdir'" 1>&2
6126 continue
6127 fi
6128 file=`$echo "X$file$stripped_ext" | $Xsed -e 's%^.*/%%'`
6129 outputname="$tmpdir/$file"
6130 # Replace the output file specification.
6131 relink_command=`$echo "X$relink_command" | $Xsed -e 's%@OUTPUT@%'"$outputname"'%g'`
6132
6133 $show "$relink_command"
6134 if $run eval "$relink_command"; then :
6135 else
6136 $echo "$modename: error: relink \`$file' with the above command before installing it" 1>&2
6137 ${rm}r "$tmpdir"
6138 continue
6139 fi
6140 file="$outputname"
6141 else
6142 $echo "$modename: warning: cannot relink \`$file'" 1>&2
6143 fi
6144 else
6145 # Install the binary that we compiled earlier.
6146 file=`$echo "X$file$stripped_ext" | $Xsed -e "s%\([^/]*\)$%$objdir/\1%"`
6147 fi
6148 fi
6149
6150 # remove .exe since cygwin /usr/bin/install will append another
6151 # one anyways
6152 case $install_prog,$host in
6153 */usr/bin/install*,*cygwin*)
6154 case $file:$destfile in
6155 *.exe:*.exe)
6156 # this is ok
6157 ;;
6158 *.exe:*)
6159 destfile=$destfile.exe
6160 ;;
6161 *:*.exe)
6162 destfile=`$echo $destfile | ${SED} -e 's,.exe$,,'`
6163 ;;
6164 esac
6165 ;;
6166 esac
6167 $show "$install_prog$stripme $file $destfile"
6168 $run eval "$install_prog\$stripme \$file \$destfile" || exit $?
6169 test -n "$outputname" && ${rm}r "$tmpdir"
6170 ;;
6171 esac
6172 done
6173
6174 for file in $staticlibs; do
6175 name=`$echo "X$file" | $Xsed -e 's%^.*/%%'`
6176
6177 # Set up the ranlib parameters.
6178 oldlib="$destdir/$name"
6179
6180 $show "$install_prog $file $oldlib"
6181 $run eval "$install_prog \$file \$oldlib" || exit $?
6182
6183 if test -n "$stripme" && test -n "$old_striplib"; then
6184 $show "$old_striplib $oldlib"
6185 $run eval "$old_striplib $oldlib" || exit $?
6186 fi
6187
6188 # Do each command in the postinstall commands.
6189 cmds=$old_postinstall_cmds
6190 save_ifs="$IFS"; IFS='~'
6191 for cmd in $cmds; do
6192 IFS="$save_ifs"
6193 eval cmd=\"$cmd\"
6194 $show "$cmd"
6195 $run eval "$cmd" || exit $?
6196 done
6197 IFS="$save_ifs"
6198 done
6199
6200 if test -n "$future_libdirs"; then
6201 $echo "$modename: warning: remember to run \`$progname --finish$future_libdirs'" 1>&2
6202 fi
6203
6204 if test -n "$current_libdirs"; then
6205 # Maybe just do a dry run.
6206 test -n "$run" && current_libdirs=" -n$current_libdirs"
6207 exec_cmd='$SHELL $progpath $preserve_args --finish$current_libdirs'
6208 else
6209 exit $EXIT_SUCCESS
6210 fi
6211 ;;
6212
6213 # libtool finish mode
6214 finish)
6215 modename="$modename: finish"
6216 libdirs="$nonopt"
6217 admincmds=
6218
6219 if test -n "$finish_cmds$finish_eval" && test -n "$libdirs"; then
6220 for dir
6221 do
6222 libdirs="$libdirs $dir"
6223 done
6224
6225 for libdir in $libdirs; do
6226 if test -n "$finish_cmds"; then
6227 # Do each command in the finish commands.
6228 cmds=$finish_cmds
6229 save_ifs="$IFS"; IFS='~'
6230 for cmd in $cmds; do
6231 IFS="$save_ifs"
6232 eval cmd=\"$cmd\"
6233 $show "$cmd"
6234 $run eval "$cmd" || admincmds="$admincmds
6235 $cmd"
6236 done
6237 IFS="$save_ifs"
6238 fi
6239 if test -n "$finish_eval"; then
6240 # Do the single finish_eval.
6241 eval cmds=\"$finish_eval\"
6242 $run eval "$cmds" || admincmds="$admincmds
6243 $cmds"
6244 fi
6245 done
6246 fi
6247
6248 # Exit here if they wanted silent mode.
6249 test "$show" = : && exit $EXIT_SUCCESS
6250
6251 $echo "----------------------------------------------------------------------"
6252 $echo "Libraries have been installed in:"
6253 for libdir in $libdirs; do
6254 $echo " $libdir"
6255 done
6256 $echo
6257 $echo "If you ever happen to want to link against installed libraries"
6258 $echo "in a given directory, LIBDIR, you must either use libtool, and"
6259 $echo "specify the full pathname of the library, or use the \`-LLIBDIR'"
6260 $echo "flag during linking and do at least one of the following:"
6261 if test -n "$shlibpath_var"; then
6262 $echo " - add LIBDIR to the \`$shlibpath_var' environment variable"
6263 $echo " during execution"
6264 fi
6265 if test -n "$runpath_var"; then
6266 $echo " - add LIBDIR to the \`$runpath_var' environment variable"
6267 $echo " during linking"
6268 fi
6269 if test -n "$hardcode_libdir_flag_spec"; then
6270 libdir=LIBDIR
6271 eval flag=\"$hardcode_libdir_flag_spec\"
6272
6273 $echo " - use the \`$flag' linker flag"
6274 fi
6275 if test -n "$admincmds"; then
6276 $echo " - have your system administrator run these commands:$admincmds"
6277 fi
6278 if test -f /etc/ld.so.conf; then
6279 $echo " - have your system administrator add LIBDIR to \`/etc/ld.so.conf'"
6280 fi
6281 $echo
6282 $echo "See any operating system documentation about shared libraries for"
6283 $echo "more information, such as the ld(1) and ld.so(8) manual pages."
6284 $echo "----------------------------------------------------------------------"
6285 exit $EXIT_SUCCESS
6286 ;;
6287
6288 # libtool execute mode
6289 execute)
6290 modename="$modename: execute"
6291
6292 # The first argument is the command name.
6293 cmd="$nonopt"
6294 if test -z "$cmd"; then
6295 $echo "$modename: you must specify a COMMAND" 1>&2
6296 $echo "$help"
6297 exit $EXIT_FAILURE
6298 fi
6299
6300 # Handle -dlopen flags immediately.
6301 for file in $execute_dlfiles; do
6302 if test ! -f "$file"; then
6303 $echo "$modename: \`$file' is not a file" 1>&2
6304 $echo "$help" 1>&2
6305 exit $EXIT_FAILURE
6306 fi
6307
6308 dir=
6309 case $file in
6310 *.la)
6311 # Check to see that this really is a libtool archive.
6312 if (${SED} -e '2q' $file | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then :
6313 else
6314 $echo "$modename: \`$lib' is not a valid libtool archive" 1>&2
6315 $echo "$help" 1>&2
6316 exit $EXIT_FAILURE
6317 fi
6318
6319 # Read the libtool library.
6320 dlname=
6321 library_names=
6322
6323 # If there is no directory component, then add one.
6324 case $file in
6325 */* | *\\*) . $file ;;
6326 *) . ./$file ;;
6327 esac
6328
6329 # Skip this library if it cannot be dlopened.
6330 if test -z "$dlname"; then
6331 # Warn if it was a shared library.
6332 test -n "$library_names" && $echo "$modename: warning: \`$file' was not linked with \`-export-dynamic'"
6333 continue
6334 fi
6335
6336 dir=`$echo "X$file" | $Xsed -e 's%/[^/]*$%%'`
6337 test "X$dir" = "X$file" && dir=.
6338
6339 if test -f "$dir/$objdir/$dlname"; then
6340 dir="$dir/$objdir"
6341 else
6342 $echo "$modename: cannot find \`$dlname' in \`$dir' or \`$dir/$objdir'" 1>&2
6343 exit $EXIT_FAILURE
6344 fi
6345 ;;
6346
6347 *.lo)
6348 # Just add the directory containing the .lo file.
6349 dir=`$echo "X$file" | $Xsed -e 's%/[^/]*$%%'`
6350 test "X$dir" = "X$file" && dir=.
6351 ;;
6352
6353 *)
6354 $echo "$modename: warning \`-dlopen' is ignored for non-libtool libraries and objects" 1>&2
6355 continue
6356 ;;
6357 esac
6358
6359 # Get the absolute pathname.
6360 absdir=`cd "$dir" && pwd`
6361 test -n "$absdir" && dir="$absdir"
6362
6363 # Now add the directory to shlibpath_var.
6364 if eval "test -z \"\$$shlibpath_var\""; then
6365 eval "$shlibpath_var=\"\$dir\""
6366 else
6367 eval "$shlibpath_var=\"\$dir:\$$shlibpath_var\""
6368 fi
6369 done
6370
6371 # This variable tells wrapper scripts just to set shlibpath_var
6372 # rather than running their programs.
6373 libtool_execute_magic="$magic"
6374
6375 # Check if any of the arguments is a wrapper script.
6376 args=
6377 for file
6378 do
6379 case $file in
6380 -*) ;;
6381 *)
6382 # Do a test to see if this is really a libtool program.
6383 if (${SED} -e '4q' $file | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then
6384 # If there is no directory component, then add one.
6385 case $file in
6386 */* | *\\*) . $file ;;
6387 *) . ./$file ;;
6388 esac
6389
6390 # Transform arg to wrapped name.
6391 file="$progdir/$program"
6392 fi
6393 ;;
6394 esac
6395 # Quote arguments (to preserve shell metacharacters).
6396 file=`$echo "X$file" | $Xsed -e "$sed_quote_subst"`
6397 args="$args \"$file\""
6398 done
6399
6400 if test -z "$run"; then
6401 if test -n "$shlibpath_var"; then
6402 # Export the shlibpath_var.
6403 eval "export $shlibpath_var"
6404 fi
6405
6406 # Restore saved environment variables
6407 if test "${save_LC_ALL+set}" = set; then
6408 LC_ALL="$save_LC_ALL"; export LC_ALL
6409 fi
6410 if test "${save_LANG+set}" = set; then
6411 LANG="$save_LANG"; export LANG
6412 fi
6413
6414 # Now prepare to actually exec the command.
6415 exec_cmd="\$cmd$args"
6416 else
6417 # Display what would be done.
6418 if test -n "$shlibpath_var"; then
6419 eval "\$echo \"\$shlibpath_var=\$$shlibpath_var\""
6420 $echo "export $shlibpath_var"
6421 fi
6422 $echo "$cmd$args"
6423 exit $EXIT_SUCCESS
6424 fi
6425 ;;
6426
6427 # libtool clean and uninstall mode
6428 clean | uninstall)
6429 modename="$modename: $mode"
6430 rm="$nonopt"
6431 files=
6432 rmforce=
6433 exit_status=0
6434
6435 # This variable tells wrapper scripts just to set variables rather
6436 # than running their programs.
6437 libtool_install_magic="$magic"
6438
6439 for arg
6440 do
6441 case $arg in
6442 -f) rm="$rm $arg"; rmforce=yes ;;
6443 -*) rm="$rm $arg" ;;
6444 *) files="$files $arg" ;;
6445 esac
6446 done
6447
6448 if test -z "$rm"; then
6449 $echo "$modename: you must specify an RM program" 1>&2
6450 $echo "$help" 1>&2
6451 exit $EXIT_FAILURE
6452 fi
6453
6454 rmdirs=
6455
6456 origobjdir="$objdir"
6457 for file in $files; do
6458 dir=`$echo "X$file" | $Xsed -e 's%/[^/]*$%%'`
6459 if test "X$dir" = "X$file"; then
6460 dir=.
6461 objdir="$origobjdir"
6462 else
6463 objdir="$dir/$origobjdir"
6464 fi
6465 name=`$echo "X$file" | $Xsed -e 's%^.*/%%'`
6466 test "$mode" = uninstall && objdir="$dir"
6467
6468 # Remember objdir for removal later, being careful to avoid duplicates
6469 if test "$mode" = clean; then
6470 case " $rmdirs " in
6471 *" $objdir "*) ;;
6472 *) rmdirs="$rmdirs $objdir" ;;
6473 esac
6474 fi
6475
6476 # Don't error if the file doesn't exist and rm -f was used.
6477 if (test -L "$file") >/dev/null 2>&1 \
6478 || (test -h "$file") >/dev/null 2>&1 \
6479 || test -f "$file"; then
6480 :
6481 elif test -d "$file"; then
6482 exit_status=1
6483 continue
6484 elif test "$rmforce" = yes; then
6485 continue
6486 fi
6487
6488 rmfiles="$file"
6489
6490 case $name in
6491 *.la)
6492 # Possibly a libtool archive, so verify it.
6493 if (${SED} -e '2q' $file | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then
6494 . $dir/$name
6495
6496 # Delete the libtool libraries and symlinks.
6497 for n in $library_names; do
6498 rmfiles="$rmfiles $objdir/$n"
6499 done
6500 test -n "$old_library" && rmfiles="$rmfiles $objdir/$old_library"
6501 test "$mode" = clean && rmfiles="$rmfiles $objdir/$name $objdir/${name}i"
6502
6503 if test "$mode" = uninstall; then
6504 if test -n "$library_names"; then
6505 # Do each command in the postuninstall commands.
6506 cmds=$postuninstall_cmds
6507 save_ifs="$IFS"; IFS='~'
6508 for cmd in $cmds; do
6509 IFS="$save_ifs"
6510 eval cmd=\"$cmd\"
6511 $show "$cmd"
6512 $run eval "$cmd"
6513 if test "$?" -ne 0 && test "$rmforce" != yes; then
6514 exit_status=1
6515 fi
6516 done
6517 IFS="$save_ifs"
6518 fi
6519
6520 if test -n "$old_library"; then
6521 # Do each command in the old_postuninstall commands.
6522 cmds=$old_postuninstall_cmds
6523 save_ifs="$IFS"; IFS='~'
6524 for cmd in $cmds; do
6525 IFS="$save_ifs"
6526 eval cmd=\"$cmd\"
6527 $show "$cmd"
6528 $run eval "$cmd"
6529 if test "$?" -ne 0 && test "$rmforce" != yes; then
6530 exit_status=1
6531 fi
6532 done
6533 IFS="$save_ifs"
6534 fi
6535 # FIXME: should reinstall the best remaining shared library.
6536 fi
6537 fi
6538 ;;
6539
6540 *.lo)
6541 # Possibly a libtool object, so verify it.
6542 if (${SED} -e '2q' $file | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then
6543
6544 # Read the .lo file
6545 . $dir/$name
6546
6547 # Add PIC object to the list of files to remove.
6548 if test -n "$pic_object" \
6549 && test "$pic_object" != none; then
6550 rmfiles="$rmfiles $dir/$pic_object"
6551 fi
6552
6553 # Add non-PIC object to the list of files to remove.
6554 if test -n "$non_pic_object" \
6555 && test "$non_pic_object" != none; then
6556 rmfiles="$rmfiles $dir/$non_pic_object"
6557 fi
6558 fi
6559 ;;
6560
6561 *)
6562 if test "$mode" = clean ; then
6563 noexename=$name
6564 case $file in
6565 *.exe)
6566 file=`$echo $file|${SED} 's,.exe$,,'`
6567 noexename=`$echo $name|${SED} 's,.exe$,,'`
6568 # $file with .exe has already been added to rmfiles,
6569 # add $file without .exe
6570 rmfiles="$rmfiles $file"
6571 ;;
6572 esac
6573 # Do a test to see if this is a libtool program.
6574 if (${SED} -e '4q' $file | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then
6575 relink_command=
6576 . $dir/$noexename
6577
6578 # note $name still contains .exe if it was in $file originally
6579 # as does the version of $file that was added into $rmfiles
6580 rmfiles="$rmfiles $objdir/$name $objdir/${name}S.${objext}"
6581 if test "$fast_install" = yes && test -n "$relink_command"; then
6582 rmfiles="$rmfiles $objdir/lt-$name"
6583 fi
6584 if test "X$noexename" != "X$name" ; then
6585 rmfiles="$rmfiles $objdir/lt-${noexename}.c"
6586 fi
6587 fi
6588 fi
6589 ;;
6590 esac
6591 $show "$rm $rmfiles"
6592 $run $rm $rmfiles || exit_status=1
6593 done
6594 objdir="$origobjdir"
6595
6596 # Try to remove the ${objdir}s in the directories where we deleted files
6597 for dir in $rmdirs; do
6598 if test -d "$dir"; then
6599 $show "rmdir $dir"
6600 $run rmdir $dir >/dev/null 2>&1
6601 fi
6602 done
6603
6604 exit $exit_status
6605 ;;
6606
6607 "")
6608 $echo "$modename: you must specify a MODE" 1>&2
6609 $echo "$generic_help" 1>&2
6610 exit $EXIT_FAILURE
6611 ;;
6612 esac
6613
6614 if test -z "$exec_cmd"; then
6615 $echo "$modename: invalid operation mode \`$mode'" 1>&2
6616 $echo "$generic_help" 1>&2
6617 exit $EXIT_FAILURE
6618 fi
6619fi # test -z "$show_help"
6620
6621if test -n "$exec_cmd"; then
6622 eval exec $exec_cmd
6623 exit $EXIT_FAILURE
6624fi
6625
6626# We need to display help for each of the modes.
6627case $mode in
6628"") $echo \
6629"Usage: $modename [OPTION]... [MODE-ARG]...
6630
6631Provide generalized library-building support services.
6632
6633 --config show all configuration variables
6634 --debug enable verbose shell tracing
6635-n, --dry-run display commands without modifying any files
6636 --features display basic configuration information and exit
6637 --finish same as \`--mode=finish'
6638 --help display this help message and exit
6639 --mode=MODE use operation mode MODE [default=inferred from MODE-ARGS]
6640 --quiet same as \`--silent'
6641 --silent don't print informational messages
6642 --tag=TAG use configuration variables from tag TAG
6643 --version print version information
6644
6645MODE must be one of the following:
6646
6647 clean remove files from the build directory
6648 compile compile a source file into a libtool object
6649 execute automatically set library path, then run a program
6650 finish complete the installation of libtool libraries
6651 install install libraries or executables
6652 link create a library or an executable
6653 uninstall remove libraries from an installed directory
6654
6655MODE-ARGS vary depending on the MODE. Try \`$modename --help --mode=MODE' for
6656a more detailed description of MODE.
6657
6658Report bugs to <bug-libtool@gnu.org>."
6659 exit $EXIT_SUCCESS
6660 ;;
6661
6662clean)
6663 $echo \
6664"Usage: $modename [OPTION]... --mode=clean RM [RM-OPTION]... FILE...
6665
6666Remove files from the build directory.
6667
6668RM is the name of the program to use to delete files associated with each FILE
6669(typically \`/bin/rm'). RM-OPTIONS are options (such as \`-f') to be passed
6670to RM.
6671
6672If FILE is a libtool library, object or program, all the files associated
6673with it are deleted. Otherwise, only FILE itself is deleted using RM."
6674 ;;
6675
6676compile)
6677 $echo \
6678"Usage: $modename [OPTION]... --mode=compile COMPILE-COMMAND... SOURCEFILE
6679
6680Compile a source file into a libtool library object.
6681
6682This mode accepts the following additional options:
6683
6684 -o OUTPUT-FILE set the output file name to OUTPUT-FILE
6685 -prefer-pic try to building PIC objects only
6686 -prefer-non-pic try to building non-PIC objects only
6687 -static always build a \`.o' file suitable for static linking
6688
6689COMPILE-COMMAND is a command to be used in creating a \`standard' object file
6690from the given SOURCEFILE.
6691
6692The output file name is determined by removing the directory component from
6693SOURCEFILE, then substituting the C source code suffix \`.c' with the
6694library object suffix, \`.lo'."
6695 ;;
6696
6697execute)
6698 $echo \
6699"Usage: $modename [OPTION]... --mode=execute COMMAND [ARGS]...
6700
6701Automatically set library path, then run a program.
6702
6703This mode accepts the following additional options:
6704
6705 -dlopen FILE add the directory containing FILE to the library path
6706
6707This mode sets the library path environment variable according to \`-dlopen'
6708flags.
6709
6710If any of the ARGS are libtool executable wrappers, then they are translated
6711into their corresponding uninstalled binary, and any of their required library
6712directories are added to the library path.
6713
6714Then, COMMAND is executed, with ARGS as arguments."
6715 ;;
6716
6717finish)
6718 $echo \
6719"Usage: $modename [OPTION]... --mode=finish [LIBDIR]...
6720
6721Complete the installation of libtool libraries.
6722
6723Each LIBDIR is a directory that contains libtool libraries.
6724
6725The commands that this mode executes may require superuser privileges. Use
6726the \`--dry-run' option if you just want to see what would be executed."
6727 ;;
6728
6729install)
6730 $echo \
6731"Usage: $modename [OPTION]... --mode=install INSTALL-COMMAND...
6732
6733Install executables or libraries.
6734
6735INSTALL-COMMAND is the installation command. The first component should be
6736either the \`install' or \`cp' program.
6737
6738The rest of the components are interpreted as arguments to that command (only
6739BSD-compatible install options are recognized)."
6740 ;;
6741
6742link)
6743 $echo \
6744"Usage: $modename [OPTION]... --mode=link LINK-COMMAND...
6745
6746Link object files or libraries together to form another library, or to
6747create an executable program.
6748
6749LINK-COMMAND is a command using the C compiler that you would use to create
6750a program from several object files.
6751
6752The following components of LINK-COMMAND are treated specially:
6753
6754 -all-static do not do any dynamic linking at all
6755 -avoid-version do not add a version suffix if possible
6756 -dlopen FILE \`-dlpreopen' FILE if it cannot be dlopened at runtime
6757 -dlpreopen FILE link in FILE and add its symbols to lt_preloaded_symbols
6758 -export-dynamic allow symbols from OUTPUT-FILE to be resolved with dlsym(3)
6759 -export-symbols SYMFILE
6760 try to export only the symbols listed in SYMFILE
6761 -export-symbols-regex REGEX
6762 try to export only the symbols matching REGEX
6763 -LLIBDIR search LIBDIR for required installed libraries
6764 -lNAME OUTPUT-FILE requires the installed library libNAME
6765 -module build a library that can dlopened
6766 -no-fast-install disable the fast-install mode
6767 -no-install link a not-installable executable
6768 -no-undefined declare that a library does not refer to external symbols
6769 -o OUTPUT-FILE create OUTPUT-FILE from the specified objects
6770 -objectlist FILE Use a list of object files found in FILE to specify objects
6771 -precious-files-regex REGEX
6772 don't remove output files matching REGEX
6773 -release RELEASE specify package release information
6774 -rpath LIBDIR the created library will eventually be installed in LIBDIR
6775 -R[ ]LIBDIR add LIBDIR to the runtime path of programs and libraries
6776 -static do not do any dynamic linking of libtool libraries
6777 -version-info CURRENT[:REVISION[:AGE]]
6778 specify library version info [each variable defaults to 0]
6779
6780All other options (arguments beginning with \`-') are ignored.
6781
6782Every other argument is treated as a filename. Files ending in \`.la' are
6783treated as uninstalled libtool libraries, other files are standard or library
6784object files.
6785
6786If the OUTPUT-FILE ends in \`.la', then a libtool library is created,
6787only library objects (\`.lo' files) may be specified, and \`-rpath' is
6788required, except when creating a convenience library.
6789
6790If OUTPUT-FILE ends in \`.a' or \`.lib', then a standard library is created
6791using \`ar' and \`ranlib', or on Windows using \`lib'.
6792
6793If OUTPUT-FILE ends in \`.lo' or \`.${objext}', then a reloadable object file
6794is created, otherwise an executable program is created."
6795 ;;
6796
6797uninstall)
6798 $echo \
6799"Usage: $modename [OPTION]... --mode=uninstall RM [RM-OPTION]... FILE...
6800
6801Remove libraries from an installation directory.
6802
6803RM is the name of the program to use to delete files associated with each FILE
6804(typically \`/bin/rm'). RM-OPTIONS are options (such as \`-f') to be passed
6805to RM.
6806
6807If FILE is a libtool library, all the files associated with it are deleted.
6808Otherwise, only FILE itself is deleted using RM."
6809 ;;
6810
6811*)
6812 $echo "$modename: invalid operation mode \`$mode'" 1>&2
6813 $echo "$help" 1>&2
6814 exit $EXIT_FAILURE
6815 ;;
6816esac
6817
6818$echo
6819$echo "Try \`$modename --help' for more information about other modes."
6820
6821exit $?
6822
6823# The TAGs below are defined such that we never get into a situation
6824# in which we disable both kinds of libraries. Given conflicting
6825# choices, we go for a static library, that is the most portable,
6826# since we can't tell whether shared libraries were disabled because
6827# the user asked for that or because the platform doesn't support
6828# them. This is particularly important on AIX, because we don't
6829# support having both static and shared libraries enabled at the same
6830# time on that platform, so we default to a shared-only configuration.
6831# If a disable-shared tag is given, we'll fallback to a static-only
6832# configuration. But we'll never go from static-only to shared-only.
6833
6834# ### BEGIN LIBTOOL TAG CONFIG: disable-shared
6835build_libtool_libs=no
6836build_old_libs=yes
6837# ### END LIBTOOL TAG CONFIG: disable-shared
6838
6839# ### BEGIN LIBTOOL TAG CONFIG: disable-static
6840build_old_libs=`case $build_libtool_libs in yes) $echo no;; *) $echo yes;; esac`
6841# ### END LIBTOOL TAG CONFIG: disable-static
6842
6843# Local Variables:
6844# mode:shell-script
6845# sh-indentation:2
6846# End:
Note: See TracBrowser for help on using the repository browser.