root/morphix/trunk/clusterix/openmosix-tools-0.3.6-2/libtool

Revision 2, 195.1 kB (checked in by nextime, 2 years ago)

Initial import, branching from morphix svn

  • Property svn:executable set to
Line 
1 #! /bin/sh
2
3 # libtoolT - Provide generalized library-building support services.
4 # Generated automatically by  (GNU openmosix-tools 0.3.6-2)
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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, 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.
33 SED="/bin/sed"
34
35 # Sed that helps us avoid accidentally triggering echo(1) options like -n.
36 Xsed="/bin/sed -e s/^X//"
37
38 # The HP-UX ksh and POSIX shell print the target directory to stdout
39 # if CDPATH is set.
40 if test "X${CDPATH+set}" = Xset; then CDPATH=:; export CDPATH; fi
41
42 # The names of the tagged configurations supported by this script.
43 available_tags=" CXX"
44
45 # ### BEGIN LIBTOOL CONFIG
46
47 # Libtool was configured on host node1:
48
49 # Shell to use when invoking shell scripts.
50 SHELL="/bin/sh"
51
52 # Whether or not to build shared libraries.
53 build_libtool_libs=yes
54
55 # Whether or not to build static libraries.
56 build_old_libs=yes
57
58 # Whether or not to add -lc for building shared libraries.
59 build_libtool_need_lc=no
60
61 # Whether or not to disallow shared libs when runtime libs are static
62 allow_libtool_libs_with_static_runtimes=no
63
64 # Whether or not to optimize for fast installation.
65 fast_install=yes
66
67 # The host system.
68 host_alias=
69 host=i686-pc-linux-gnu
70
71 # An echo program that does not interpret backslashes.
72 echo="echo"
73
74 # The archiver.
75 AR="ar"
76 AR_FLAGS="cru"
77
78 # A C compiler.
79 LTCC="gcc"
80
81 # A language-specific compiler.
82 CC="gcc"
83
84 # Is the compiler the GNU C compiler?
85 with_gcc=yes
86
87 # An ERE matcher.
88 EGREP="grep -E"
89
90 # The linker used to build libraries.
91 LD="/usr/bin/ld"
92
93 # Whether we need hard or soft links.
94 LN_S="ln -s"
95
96 # A BSD-compatible nm program.
97 NM="/usr/bin/nm -B"
98
99 # A symbol stripping program
100 STRIP=strip
101
102 # Used to examine libraries when file_magic_cmd begins "file"
103 MAGIC_CMD=file
104
105 # Used on cygwin: DLL creation program.
106 DLLTOOL="dlltool"
107
108 # Used on cygwin: object dumper.
109 OBJDUMP="objdump"
110
111 # Used on cygwin: assembler.
112 AS="as"
113
114 # The name of the directory that contains temporary libtool files.
115 objdir=.libs
116
117 # How to create reloadable object files.
118 reload_flag=" -r"
119 reload_cmds="\$LD\$reload_flag -o \$output\$reload_objs"
120
121 # How to pass a linker flag through the compiler.
122 wl="-Wl,"
123
124 # Object file suffix (normally "o").
125 objext="o"
126
127 # Old archive suffix (normally "a").
128 libext="a"
129
130 # Shared library suffix (normally ".so").
131 shrext='.so'
132
133 # Executable file suffix (normally "").
134 exeext=""
135
136 # Additional compiler flags for building library objects.
137 pic_flag=" -fPIC -DPIC"
138 pic_mode=default
139
140 # What is the maximum length of a command?
141 max_cmd_len=32768
142
143 # Does compiler simultaneously support -c and -o options?
144 compiler_c_o="yes"
145
146 # Must we lock files when doing compilation ?
147 need_locks="no"
148
149 # Do we need the lib prefix for modules?
150 need_lib_prefix=no
151
152 # Do we need a version for libraries?
153 need_version=no
154
155 # Whether dlopen is supported.
156 dlopen_support=unknown
157
158 # Whether dlopen of programs is supported.
159 dlopen_self=unknown
160
161 # Whether dlopen of statically linked programs is supported.
162 dlopen_self_static=unknown
163
164 # Compiler flag to prevent dynamic linking.
165 link_static_flag="-static"
166
167 # Compiler flag to turn off builtin functions.
168 no_builtin_flag=" -fno-builtin"
169
170 # Compiler flag to allow reflexive dlopens.
171 export_dynamic_flag_spec="\${wl}--export-dynamic"
172
173 # Compiler flag to generate shared objects directly from archives.
174 whole_archive_flag_spec="\${wl}--whole-archive\$convenience \${wl}--no-whole-archive"
175
176 # Compiler flag to generate thread-safe objects.
177 thread_safe_flag_spec=""
178
179 # Library versioning type.
180 version_type=linux
181
182 # Format of library name prefix.
183 libname_spec="lib\$name"
184
185 # List of archive names.  First name is the real one, the rest are links.
186 # The last name is the one that the linker finds with -lNAME.
187 library_names_spec="\${libname}\${release}\${shared_ext}\$versuffix \${libname}\${release}\${shared_ext}\$major \$libname\${shared_ext}"
188
189 # The coded name of the library, if different from the real name.
190 soname_spec="\${libname}\${release}\${shared_ext}\$major"
191
192 # Commands used to build and install an old-style archive.
193 RANLIB="ranlib"
194 old_archive_cmds="\$AR \$AR_FLAGS \$oldlib\$oldobjs\$old_deplibs~\$RANLIB \$oldlib"
195 old_postinstall_cmds="\$RANLIB \$oldlib~chmod 644 \$oldlib"
196 old_postuninstall_cmds=""
197
198 # Create an old-style archive from a shared archive.
199 old_archive_from_new_cmds=""
200
201 # Create a temporary old-style archive to link instead of a shared archive.
202 old_archive_from_expsyms_cmds=""
203
204 # Commands used to build and install a shared archive.
205 archive_cmds="\$CC -shared \$libobjs \$deplibs \$compiler_flags \${wl}-soname \$wl\$soname -o \$lib"
206 archive_expsym_cmds="\$echo \\\"{ global:\\\" > \$output_objdir/\$libname.ver~
207 cat \$export_symbols | sed -e \\\"s/\\\\(.*\\\\)/\\\\1;/\\\" >> \$output_objdir/\$libname.ver~
208 \$echo \\\"local: *; };\\\" >> \$output_objdir/\$libname.ver~
209         \$CC -shared \$libobjs \$deplibs \$compiler_flags \${wl}-soname \$wl\$soname \${wl}-version-script \${wl}\$output_objdir/\$libname.ver -o \$lib"
210 postinstall_cmds=""
211 postuninstall_cmds=""
212
213 # Commands used to build a loadable module (assumed same as above if empty)
214 module_cmds=""
215 module_expsym_cmds=""
216
217 # Commands to strip libraries.
218 old_striplib="strip --strip-debug"
219 striplib="strip --strip-unneeded"
220
221 # Dependencies to place before the objects being linked to create a
222 # shared library.
223 predep_objects=""
224
225 # Dependencies to place after the objects being linked to create a
226 # shared library.
227 postdep_objects=""
228
229 # Dependencies to place before the objects being linked to create a
230 # shared library.
231 predeps=""
232
233 # Dependencies to place after the objects being linked to create a
234 # shared library.
235 postdeps=""
236
237 # The library search path used internally by the compiler when linking
238 # a shared library.
239 compiler_lib_search_path=""
240
241 # Method to check whether dependent libraries are shared objects.
242 deplibs_check_method="pass_all"
243
244 # Command to use when deplibs_check_method == file_magic.
245 file_magic_cmd="\$MAGIC_CMD"
246
247 # Flag that allows shared libraries with undefined symbols to be built.
248 allow_undefined_flag=""
249
250 # Flag that forces no undefined symbols.
251 no_undefined_flag=""
252
253 # Commands used to finish a libtool library installation in a directory.
254 finish_cmds="PATH=\\\"\\\$PATH:/sbin\\\" ldconfig -n \$libdir"
255
256 # Same as above, but a single script fragment to be evaled but not shown.
257 finish_eval=""
258
259 # Take the output of nm and produce a listing of raw symbols and C names.
260 global_symbol_pipe="sed -n -e 's/^.*[   ]\\([ABCDGIRSTW][ABCDGIRSTW]*\\)[       ][      ]*\\(\\)\\([_A-Za-z][_A-Za-z0-9]*\\)\$/\\1 \\2\\3 \\3/p'"
261
262 # Transform the output of nm in a proper C declaration
263 global_symbol_to_cdecl="sed -n -e 's/^. .* \\(.*\\)\$/extern int \\1;/p'"
264
265 # Transform the output of nm in a C name address pair
266 global_symbol_to_c_name_address="sed -n -e 's/^: \\([^ ]*\\) \$/  {\\\"\\1\\\", (lt_ptr) 0},/p' -e 's/^[BCDEGRST] \\([^ ]*\\) \\([^ ]*\\)\$/  {\"\\2\", (lt_ptr) \\&\\2},/p'"
267
268 # This is the shared library runtime path variable.
269 runpath_var=LD_RUN_PATH
270
271 # This is the shared library path variable.
272 shlibpath_var=LD_LIBRARY_PATH
273
274 # Is shlibpath searched before the hard-coded library search path?
275 shlibpath_overrides_runpath=no
276
277 # How to hardcode a shared library path into an executable.
278 hardcode_action=immediate
279
280 # Whether we should hardcode library paths into libraries.
281 hardcode_into_libs=yes
282
283 # Flag to hardcode $libdir into a binary during linking.
284 # This must work even if $libdir does not exist.
285 hardcode_libdir_flag_spec="\${wl}--rpath \${wl}\$libdir"
286
287 # If ld is used when linking, flag to hardcode $libdir into
288 # a binary during linking. This must work even if $libdir does
289 # not exist.
290 hardcode_libdir_flag_spec_ld=""
291
292 # Whether we need a single -rpath flag with a separated argument.
293 hardcode_libdir_separator=""
294
295 # Set to yes if using DIR/libNAME during linking hardcodes DIR into the
296 # resulting binary.
297 hardcode_direct=no
298
299 # Set to yes if using the -LDIR flag during linking hardcodes DIR into the
300 # resulting binary.
301 hardcode_minus_L=no
302
303 # Set to yes if using SHLIBPATH_VAR=DIR during linking hardcodes DIR into
304 # the resulting binary.
305 hardcode_shlibpath_var=unsupported
306
307 # Set to yes if building a shared library automatically hardcodes DIR into the library
308 # and all subsequent libraries and executables linked against it.
309 hardcode_automatic=no
310
311 # Variables whose values should be saved in libtool wrapper scripts and
312 # restored at relink time.
313 variables_saved_for_relink="PATH  LD_RUN_PATH GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH"
314
315 # Whether libtool must link a program against all its dependency libraries.
316 link_all_deplibs=unknown
317
318 # Compile-time system search path for libraries
319 sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib"
320
321 # Run-time system search path for libraries
322 sys_lib_dlsearch_path_spec="/lib /usr/lib"
323
324 # Fix the shell variable $srcfile for the compiler.
325 fix_srcfile_path=""
326
327 # Set to yes if exported symbols are required.
328 always_export_symbols=no
329
330 # The commands to list exported symbols.
331 export_symbols_cmds="\$NM \$libobjs \$convenience | \$global_symbol_pipe | \$SED 's/.* //' | sort | uniq > \$export_symbols"
332
333 # The commands to extract the exported symbol list from a shared archive.
334 extract_expsyms_cmds=""
335
336 # Symbols that should not be listed in the preloaded symbols.
337 exclude_expsyms="_GLOBAL_OFFSET_TABLE_"
338
339 # Symbols that must always be exported.
340 include_expsyms=""
341
342 # ### END LIBTOOL CONFIG
343
344 # ltmain.sh - Provide generalized library-building support services.
345 # NOTE: Changing this file will not affect anything until you rerun configure.
346 #
347 # Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003
348 # Free Software Foundation, Inc.
349 # Originally by Gordon Matzigkeit <gord@gnu.ai.mit.edu>, 1996
350 #
351 # This program is free software; you can redistribute it and/or modify
352 # it under the terms of the GNU General Public License as published by
353 # the Free Software Foundation; either version 2 of the License, or
354 # (at your option) any later version.
355 #
356 # This program is distributed in the hope that it will be useful, but
357 # WITHOUT ANY WARRANTY; without even the implied warranty of
358 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
359 # General Public License for more details.
360 #
361 # You should have received a copy of the GNU General Public License
362 # along with this program; if not, write to the Free Software
363 # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
364 #
365 # As a special exception to the GNU General Public License, if you
366 # distribute this file as part of a program that contains a
367 # configuration script generated by Autoconf, you may include it under
368 # the same distribution terms that you use for the rest of that program.
369
370 # Check that we have a working $echo.
371 if test "X$1" = X--no-reexec; then
372   # Discard the --no-reexec flag, and continue.
373   shift
374 elif test "X$1" = X--fallback-echo; then
375   # Avoid inline document here, it may be left over
376   :
377 elif test "X`($echo '\t') 2>/dev/null`" = 'X\t'; then
378   # Yippee, $echo works!
379   :
380 else
381   # Restart under the correct shell, and then maybe $echo will work.
382   exec $SHELL "$0" --no-reexec ${1+"$@"}
383 fi
384
385 if test "X$1" = X--fallback-echo; then
386   # used as fallback echo
387   shift
388   cat <<EOF
389 $*
390 EOF
391   exit 0
392 fi
393
394 # define SED for historic ltconfig's generated by Libtool 1.3
395 test -z "$SED" && SED=sed
396
397 # The name of this program.
398 progname=`$echo "$0" | ${SED} 's%^.*/%%'`
399 modename="$progname"
400
401 # Constants.
402 PROGRAM=ltmain.sh
403 PACKAGE=libtool
404 VERSION=1.5
405 TIMESTAMP=" (1.1220.2.1 2003/04/14 22:48:00)"
406
407 default_mode=
408 help="Try \`$progname --help' for more information."
409 magic="%%%MAGIC variable%%%"
410 mkdir="mkdir"
411 mv="mv -f"
412 rm="rm -f"
413
414 # Sed substitution that helps us do robust quoting.  It backslashifies
415 # metacharacters that are still active within double-quoted strings.
416 Xsed="${SED}"' -e 1s/^X//'
417 sed_quote_subst='s/\([\\`\\"$\\\\]\)/\\\1/g'
418 # test EBCDIC or ASCII
419 case `echo A|od -x` in
420  *[Cc]1*) # EBCDIC based system
421   SP2NL="tr '\100' '\n'"
422   NL2SP="tr '\r\n' '\100\100'"
423   ;;
424  *) # Assume ASCII based system
425   SP2NL="tr '\040' '\012'"
426   NL2SP="tr '\015\012' '\040\040'"
427   ;;
428 esac
429
430 # NLS nuisances.
431 # Only set LANG and LC_ALL to C if already set.
432 # These must not be set unconditionally because not all systems understand
433 # e.g. LANG=C (notably SCO).
434 # We save the old values to restore during execute mode.
435 if test "${LC_ALL+set}" = set; then
436   save_LC_ALL="$LC_ALL"; LC_ALL=C; export LC_ALL
437 fi
438 if test "${LANG+set}" = set; then
439   save_LANG="$LANG"; LANG=C; export LANG
440 fi
441
442 # Make sure IFS has a sensible default
443 : ${IFS="       "}
444
445 if test "$build_libtool_libs" != yes && test "$build_old_libs" != yes; then
446   $echo "$modename: not configured to build any kind of library" 1>&2
447   $echo "Fatal configuration error.  See the $PACKAGE docs for more information." 1>&2
448   exit 1
449 fi
450
451 # Global variables.
452 mode=$default_mode
453 nonopt=
454 prev=
455 prevopt=
456 run=
457 show="$echo"
458 show_help=
459 execute_dlfiles=
460 lo2o="s/\\.lo\$/.${objext}/"
461 o2lo="s/\\.${objext}\$/.lo/"
462
463 #####################################
464 # Shell function definitions:
465 # This seems to be the best place for them
466
467 # Need a lot of goo to handle *both* DLLs and import libs
468 # Has to be a shell function in order to 'eat' the argument
469 # that is supplied when $file_magic_command is called.
470 win32_libid () {
471   win32_libid_type="unknown"
472   win32_fileres=`file -L $1 2>/dev/null`
473   case $win32_fileres in
474   *ar\ archive\ import\ library*) # definitely import
475     win32_libid_type="x86 archive import"
476     ;;
477   *ar\ archive*) # could be an import, or static
478     if eval $OBJDUMP -f $1 | $SED -e '10q' 2>/dev/null | \
479       grep -E 'file format pe-i386(.*architecture: i386)?' >/dev/null ; then
480       win32_nmres=`eval $NM -f posix -A $1 | \
481         sed -n -e '1,100{/ I /{x;/import/!{s/^/import/;h;p;};x;};}'`
482       if test "X$win32_nmres" = "Ximport" ; then
483         win32_libid_type="x86 archive import"
484       else
485         win32_libid_type="x86 archive static"
486       fi
487     fi
488     ;;
489   *DLL*)
490     win32_libid_type="x86 DLL"
491     ;;
492   *executable*) # but shell scripts are "executable" too...
493     case $win32_fileres in
494     *MS\ Windows\ PE\ Intel*)
495       win32_libid_type="x86 DLL"
496       ;;
497     esac
498     ;;
499   esac
500   $echo $win32_libid_type
501 }
502
503 # End of Shell function definitions
504 #####################################
505
506 # Parse our command line options once, thoroughly.
507 while test "$#" -gt 0
508 do
509   arg="$1"
510   shift
511
512   case $arg in
513   -*=*) optarg=`$echo "X$arg" | $Xsed -e 's/[-_a-zA-Z0-9]*=//'` ;;
514   *) optarg= ;;
515   esac
516
517   # If the previous option needs an argument, assign it.
518   if test -n "$prev"; then
519     case $prev in
520     execute_dlfiles)
521       execute_dlfiles="$execute_dlfiles $arg"
522       ;;
523     tag)
524       tagname="$arg"
525
526       # Check whether tagname contains only valid characters
527       case $tagname in
528       *[!-_A-Za-z0-9,/]*)
529         $echo "$progname: invalid tag name: $tagname" 1>&2
530         exit 1
531         ;;
532       esac
533
534       case $tagname in
535       CC)
536         # Don't test for the "default" C tag, as we know, it's there, but
537         # not specially marked.
538         ;;
539       *)
540         if grep "^# ### BEGIN LIBTOOL TAG CONFIG: $tagname$" < "$0" > /dev/null; then
541           taglist="$taglist $tagname"
542           # Evaluate the configuration.
543           eval "`${SED} -n -e '/^# ### BEGIN LIBTOOL TAG CONFIG: '$tagname'$/,/^# ### END LIBTOOL TAG CONFIG: '$tagname'$/p' < $0`"
544         else
545           $echo "$progname: ignoring unknown tag $tagname" 1>&2
546         fi
547         ;;
548       esac
549       ;;
550     *)
551       eval "$prev=\$arg"
552       ;;
553     esac
554
555     prev=
556     prevopt=
557     continue
558   fi
559
560   # Have we seen a non-optional argument yet?
561   case $arg in
562   --help)
563     show_help=yes
564     ;;
565
566   --version)
567     $echo "$PROGRAM (GNU $PACKAGE) $VERSION$TIMESTAMP"
568     $echo
569     $echo "Copyright (C) 2003  Free Software Foundation, Inc."
570     $echo "This is free software; see the source for copying conditions.  There is NO"
571     $echo "warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE."
572     exit 0
573     ;;
574
575   --config)
576     ${SED} -e '1,/^# ### BEGIN LIBTOOL CONFIG/d' -e '/^# ### END LIBTOOL CONFIG/,$d' $0
577     # Now print the configurations for the tags.
578     for tagname in $taglist; do
579       ${SED} -n -e "/^# ### BEGIN LIBTOOL TAG CONFIG: $tagname$/,/^# ### END LIBTOOL TAG CONFIG: $tagname$/p" < "$0"
580     done
581     exit 0
582     ;;
583
584   --debug)
585     $echo "$progname: enabling shell trace mode"
586     set -x
587     ;;
588
589   --dry-run | -n)
590     run=:
591     ;;
592
593   --features)
594     $echo "host: $host"
595     if test "$build_libtool_libs" = yes; then
596       $echo "enable shared libraries"
597     else
598       $echo "disable shared libraries"
599     fi
600     if test "$build_old_libs" = yes; then
601       $echo "enable static libraries"
602     else
603       $echo "disable static libraries"
604     fi
605     exit 0
606     ;;
607
608   --finish) mode="finish" ;;
609
610   --mode) prevopt="--mode" prev=mode ;;
611   --mode=*) mode="$optarg" ;;
612
613   --preserve-dup-deps) duplicate_deps="yes" ;;
614
615   --quiet | --silent)
616     show=:
617     ;;
618
619   --tag) prevopt="--tag" prev=tag ;;
620   --tag=*)
621     set tag "$optarg" ${1+"$@"}
622     shift
623     prev=tag
624     ;;
625
626   -dlopen)
627     prevopt="-dlopen"
628     prev=execute_dlfiles
629     ;;
630
631   -*)
632     $echo "$modename: unrecognized option \`$arg'" 1>&2
633     $echo "$help" 1>&2
634     exit 1
635     ;;
636
637   *)
638     nonopt="$arg"
639     break
640     ;;
641   esac
642 done
643
644 if test -n "$prevopt"; then
645   $echo "$modename: option \`$prevopt' requires an argument" 1>&2
646   $echo "$help" 1>&2
647   exit 1
648 fi
649
650 # If this variable is set in any of the actions, the command in it
651 # will be execed at the end.  This prevents here-documents from being
652 # left over by shells.
653 exec_cmd=
654
655 if test -z "$show_help"; then
656
657   # Infer the operation mode.
658   if test -z "$mode"; then
659     $echo "*** Warning: inferring the mode of operation is deprecated." 1>&2
660     $echo "*** Future versions of Libtool will require -mode=MODE be specified." 1>&2
661     case $nonopt in
662     *cc | cc* | *++ | gcc* | *-gcc* | g++* | xlc*)
663       mode=link
664       for arg
665       do
666         case $arg in
667         -c)
668            mode=compile
669            break
670            ;;
671         esac
672       done
673       ;;
674     *db | *dbx | *strace | *truss)
675       mode=execute
676       ;;
677     *install*|cp|mv)
678       mode=install
679       ;;
680     *rm)
681       mode=uninstall
682       ;;
683     *)
684       # If we have no mode, but dlfiles were specified, then do execute mode.
685       test -n "$execute_dlfiles" && mode=execute
686
687       # Just use the default operation mode.
688       if test -z "$mode"; then
689         if test -n "$nonopt"; then
690           $echo "$modename: warning: cannot infer operation mode from \`$nonopt'" 1>&2
691         else
692           $echo "$modename: warning: cannot infer operation mode without MODE-ARGS" 1>&2
693         fi
694       fi
695       ;;
696     esac
697   fi
698
699   # Only execute mode is allowed to have -dlopen flags.
700   if test -n "$execute_dlfiles" && test "$mode" != execute; then
701     $echo "$modename: unrecognized option \`-dlopen'" 1>&2
702     $echo "$help" 1>&2
703     exit 1
704   fi
705
706   # Change the help message to a mode-specific one.
707   generic_help="$help"
708   help="Try \`$modename --help --mode=$mode' for more information."
709
710   # These modes are in order of execution frequency so that they run quickly.
711   case $mode in
712   # libtool compile mode
713   compile)
714     modename="$modename: compile"
715     # Get the compilation command and the source file.
716     base_compile=
717     srcfile="$nonopt"  #  always keep a non-empty value in "srcfile"
718     suppress_output=
719     arg_mode=normal
720     libobj=
721
722     for arg
723     do
724       case "$arg_mode" in
725       arg  )
726         # do not "continue".  Instead, add this to base_compile
727         lastarg="$arg"
728         arg_mode=normal
729         ;;
730
731       target )
732         libobj="$arg"
733         arg_mode=normal
734         continue
735         ;;
736
737       normal )
738         # Accept any command-line options.
739         case $arg in
740         -o)
741           if test -n "$libobj" ; then
742             $echo "$modename: you cannot specify \`-o' more than once" 1>&2
743             exit 1
744           fi
745           arg_mode=target
746           continue
747           ;;
748
749         -static)
750           build_old_libs=yes
751           continue
752           ;;
753
754         -prefer-pic)
755           pic_mode=yes
756           continue
757           ;;
758
759         -prefer-non-pic)
760           pic_mode=no
761           continue
762           ;;
763
764         -Xcompiler)
765           arg_mode=arg  #  the next one goes into the "base_compile" arg list
766           continue      #  The current "srcfile" will either be retained or
767           ;;            #  replaced later.  I would guess that would be a bug.
768
769         -Wc,*)
770           args=`$echo "X$arg" | $Xsed -e "s/^-Wc,//"`
771           lastarg=
772           save_ifs="$IFS"; IFS=','
773           for arg in $args; do
774             IFS="$save_ifs"
775
776             # Double-quote args containing other shell metacharacters.
777             # Many Bourne shells cannot handle close brackets correctly
778             # in scan sets, so we specify it separately.
779             case $arg in
780               *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \     ]*|*]*|"")
781               arg="\"$arg\""
782               ;;
783             esac
784             lastarg="$lastarg $arg"
785           done
786           IFS="$save_ifs"
787           lastarg=`$echo "X$lastarg" | $Xsed -e "s/^ //"`
788
789           # Add the arguments to base_compile.
790           base_compile="$base_compile $lastarg"
791           continue
792           ;;
793
794         * )
795           # Accept the current argument as the source file.
796           # The previous "srcfile" becomes the current argument.
797           #
798           lastarg="$srcfile"
799           srcfile="$arg"
800           ;;
801         esac  #  case $arg
802         ;;
803       esac    #  case $arg_mode
804
805       # Aesthetically quote the previous argument.
806       lastarg=`$echo "X$lastarg" | $Xsed -e "$sed_quote_subst"`
807
808       case $lastarg in
809       # Double-quote args containing other shell metacharacters.
810       # Many Bourne shells cannot handle close brackets correctly
811       # in scan sets, so we specify it separately.
812       *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \     ]*|*]*|"")
813         lastarg="\"$lastarg\""
814         ;;
815       esac
816
817       base_compile="$base_compile $lastarg"
818     done # for arg
819
820     case $arg_mode in
821     arg)
822       $echo "$modename: you must specify an argument for -Xcompile"
823       exit 1
824       ;;
825     target)
826       $echo "$modename: you must specify a target with \`-o'" 1>&2
827       exit 1
828       ;;
829     *)
830       # Get the name of the library object.
831       [ -z "$libobj" ] && libobj=`$echo "X$srcfile" | $Xsed -e 's%^.*/%%'`
832       ;;
833     esac
834
835     # Recognize several different file suffixes.
836     # If the user specifies -o file.o, it is replaced with file.lo
837     xform='[cCFSifmso]'
838     case $libobj in
839     *.ada) xform=ada ;;
840     *.adb) xform=adb ;;
841     *.ads) xform=ads ;;
842     *.asm) xform=asm ;;
843     *.c++) xform=c++ ;;
844     *.cc) xform=cc ;;
845     *.ii) xform=ii ;;
846     *.class) xform=class ;;
847     *.cpp) xform=cpp ;;
848     *.cxx) xform=cxx ;;
849     *.f90) xform=f90 ;;
850     *.for) xform=for ;;
851     *.java) xform=java ;;
852     esac
853
854     libobj=`$echo "X$libobj" | $Xsed -e "s/\.$xform$/.lo/"`
855
856     case $libobj in
857     *.lo) obj=`$echo "X$libobj" | $Xsed -e "$lo2o"` ;;
858     *)
859       $echo "$modename: cannot determine name of library object from \`$libobj'" 1>&2
860       exit 1
861       ;;
862     esac
863
864     # Infer tagged configuration to use if any are available and
865     # if one wasn't chosen via the "--tag" command line option.
866     # Only attempt this if the compiler in the base compile
867     # command doesn't match the default compiler.
868     if test -n "$available_tags" && test -z "$tagname"; then
869       case $base_compile in
870       # Blanks in the command may have been stripped by the calling shell,
871       # but not from the CC environment variable when configure was run.
872       " $CC "* | "$CC "* | " `$echo $CC` "* | "`$echo $CC` "*) ;;
873       # Blanks at the start of $base_compile will cause this to fail
874       # if we don't check for them as well.
875       *)
876         for z in $available_tags; do
877           if grep "^# ### BEGIN LIBTOOL TAG CONFIG: $z$" < "$0" > /dev/null; then
878             # Evaluate the configuration.
879             eval "`${SED} -n -e '/^# ### BEGIN LIBTOOL TAG CONFIG: '$z'$/,/^# ### END LIBTOOL TAG CONFIG: '$z'$/p' < $0`"
880             case "$base_compile " in
881             "$CC "* | " $CC "* | "`$echo $CC` "* | " `$echo $CC` "*)
882               # The compiler in the base compile command matches
883               # the one in the tagged configuration.
884               # Assume this is the tagged configuration we want.
885               tagname=$z
886               break
887               ;;
888             esac
889           fi
890         done
891         # If $tagname still isn't set, then no tagged configuration
892         # was found and let the user know that the "--tag" command
893         # line option must be used.
894         if test -z "$tagname"; then
895           $echo "$modename: unable to infer tagged configuration"
896           $echo "$modename: specify a tag with \`--tag'" 1>&2
897           exit 1
898 #        else
899 #          $echo "$modename: using $tagname tagged configuration"
900         fi
901         ;;
902       esac
903     fi
904
905     objname=`$echo "X$obj" | $Xsed -e 's%^.*/%%'`
906     xdir=`$echo "X$obj" | $Xsed -e 's%/[^/]*$%%'`
907     if test "X$xdir" = "X$obj"; then
908       xdir=
909     else
910       xdir=$xdir/
911     fi
912     lobj=${xdir}$objdir/$objname
913
914     if test -z "$base_compile"; then
915       $echo "$modename: you must specify a compilation command" 1>&2
916       $echo "$help" 1>&2
917       exit 1
918     fi
919
920     # Delete any leftover library objects.
921     if test "$build_old_libs" = yes; then
922       removelist="$obj $lobj $libobj ${libobj}T"
923     else
924       removelist="$lobj $libobj ${libobj}T"
925     fi
926
927     $run $rm $removelist
928     trap "$run $rm $removelist; exit 1" 1 2 15
929
930     # On Cygwin there's no "real" PIC flag so we must build both object types
931     case $host_os in
932     cygwin* | mingw* | pw32* | os2*)
933       pic_mode=default
934       ;;
935     esac
936     if test "$pic_mode" = no && test "$deplibs_check_method" != pass_all; then
937       # non-PIC code in shared libraries is not supported
938       pic_mode=default
939     fi
940
941     # Calculate the filename of the output object if compiler does
942     # not support -o with -c
943     if test "$compiler_c_o" = no; then
944       output_obj=`$echo "X$srcfile" | $Xsed -e 's%^.*/%%' -e 's%\.[^.]*$%%'`.${objext}
945       lockfile="$output_obj.lock"
946       removelist="$removelist $output_obj $lockfile"
947       trap "$run $rm $removelist; exit 1" 1 2 15
948     else
949       output_obj=
950       need_locks=no
951       lockfile=
952     fi
953
954     # Lock this critical section if it is needed
955     # We use this script file to make the link, it avoids creating a new file
956     if test "$need_locks" = yes; then
957       until $run ln "$0" "$lockfile" 2>/dev/null; do
958         $show "Waiting for $lockfile to be removed"
959         sleep 2
960       done
961     elif test "$need_locks" = warn; then
962       if test -f "$lockfile"; then
963         $echo "\
964 *** ERROR, $lockfile exists and contains:
965 `cat $lockfile 2>/dev/null`
966
967 This indicates that another process is trying to use the same
968 temporary object file, and libtool could not work around it because
969 your compiler does not support \`-c' and \`-o' together.  If you
970 repeat this compilation, it may succeed, by chance, but you had better
971 avoid parallel builds (make -j) in this platform, or get a better
972 compiler."
973
974         $run $rm $removelist
975         exit 1
976       fi
977       $echo $srcfile > "$lockfile"
978     fi
979
980     if test -n "$fix_srcfile_path"; then
981       eval srcfile=\"$fix_srcfile_path\"
982     fi
983
984     $run $rm "$libobj" "${libobj}T"
985
986     # Create a libtool object file (analogous to a ".la" file),
987     # but don't create it if we're doing a dry run.
988     test -z "$run" && cat > ${libobj}T <<EOF
989 # $libobj - a libtool object file
990 # Generated by $PROGRAM - GNU $PACKAGE $VERSION$TIMESTAMP
991 #
992 # Please DO NOT delete this file!
993 # It is necessary for linking the library.
994
995 # Name of the PIC object.
996 EOF
997
998     # Only build a PIC object if we are building libtool libraries.
999     if test "$build_libtool_libs" = yes; then
1000       # Without this assignment, base_compile gets emptied.
1001       fbsd_hideous_sh_bug=$base_compile
1002
1003       if test "$pic_mode" != no; then
1004         command="$base_compile $srcfile $pic_flag"
1005       else
1006         # Don't build PIC code
1007         command="$base_compile $srcfile"
1008       fi
1009
1010       if test ! -d "${xdir}$objdir"; then
1011         $show "$mkdir ${xdir}$objdir"
1012         $run $mkdir ${xdir}$objdir
1013         status=$?
1014         if test "$status" -ne 0 && test ! -d "${xdir}$objdir"; then
1015           exit $status
1016         fi
1017       fi
1018
1019       if test -z "$output_obj"; then
1020         # Place PIC objects in $objdir
1021         command="$command -o $lobj"
1022       fi
1023
1024       $run $rm "$lobj" "$output_obj"
1025
1026       $show "$command"
1027       if $run eval "$command"; then :
1028       else
1029         test -n "$output_obj" && $run $rm $removelist
1030         exit 1
1031       fi
1032
1033       if test "$need_locks" = warn &&
1034          test "X`cat $lockfile 2>/dev/null`" != "X$srcfile"; then
1035         $echo "\
1036 *** ERROR, $lockfile contains:
1037 `cat $lockfile 2>/dev/null`
1038
1039 but it should contain:
1040 $srcfile
1041
1042 This indicates that another process is trying to use the same
1043 temporary object file, and libtool could not work around it because
1044 your compiler does not support \`-c' and \`-o' together.  If you
1045 repeat this compilation, it may succeed, by chance, but you had better
1046 avoid parallel builds (make -j) in this platform, or get a better
1047 compiler."
1048
1049         $run $rm $removelist
1050         exit 1
1051       fi
1052
1053       # Just move the object if needed, then go on to compile the next one
1054       if test -n "$output_obj" && test "X$output_obj" != "X$lobj"; then
1055         $show "$mv $output_obj $lobj"
1056         if $run $mv $output_obj $lobj; then :
1057         else
1058           error=$?
1059           $run $rm $removelist
1060           exit $error
1061         fi
1062       fi
1063
1064       # Append the name of the PIC object to the libtool object file.
1065       test -z "$run" && cat >> ${libobj}T <<EOF
1066 pic_object='$objdir/$objname'
1067
1068 EOF
1069
1070       # Allow error messages only from the first compilation.
1071       suppress_output=' >/dev/null 2>&1'
1072     else
1073       # No PIC object so indicate it doesn't exist in the libtool
1074       # object file.
1075       test -z "$run" && cat >> ${libobj}T <<EOF
1076 pic_object=none
1077
1078 EOF
1079     fi
1080
1081     # Only build a position-dependent object if we build old libraries.
1082     if test "$build_old_libs" = yes; then
1083       if test "$pic_mode" != yes; then
1084         # Don't build PIC code
1085         command="$base_compile $srcfile"
1086       else
1087         command="$base_compile $srcfile $pic_flag"
1088       fi
1089       if test "$compiler_c_o" = yes; then
1090         command="$command -o $obj"
1091       fi
1092
1093       # Suppress compiler output if we already did a PIC compilation.
1094       command="$command$suppress_output"
1095       $run $rm "$obj" "$output_obj"
1096       $show "$command"
1097       if $run eval "$command"; then :
1098       else
1099         $run $rm $removelist
1100         exit 1
1101       fi
1102
1103       if test "$need_locks" = warn &&
1104          test "X`cat $lockfile 2>/dev/null`" != "X$srcfile"; then
1105         $echo "\
1106 *** ERROR, $lockfile contains:
1107 `cat $lockfile 2>/dev/null`
1108
1109 but it should contain:
1110 $srcfile
1111
1112 This indicates that another process is trying to use the same
1113 temporary object file, and libtool could not work around it because
1114 your compiler does not support \`-c' and \`-o' together.  If you
1115 repeat this compilation, it may succeed, by chance, but you had better
1116 avoid parallel builds (make -j) in this platform, or get a better
1117 compiler."
1118
1119         $run $rm $removelist
1120         exit 1
1121       fi
1122
1123       # Just move the object if needed
1124       if test -n "$output_obj" && test "X$output_obj" != "X$obj"; then
1125         $show "$mv $output_obj $obj"
1126         if $run $mv $output_obj $obj; then :
1127         else
1128           error=$?
1129           $run $rm $removelist
1130           exit $error
1131         fi
1132       fi
1133
1134       # Append the name of the non-PIC object the libtool object file.
1135       # Only append if the libtool object file exists.
1136       test -z "$run" && cat >> ${libobj}T <<EOF
1137 # Name of the non-PIC object.
1138 non_pic_object='$objname'
1139
1140 EOF
1141     else
1142       # Append the name of the non-PIC object the libtool object file.
1143       # Only append if the libtool object file exists.
1144       test -z "$run" && cat >> ${libobj}T <<EOF
1145 # Name of the non-PIC object.
1146 non_pic_object=none
1147
1148 EOF
1149     fi
1150
1151     $run $mv "${libobj}T" "${libobj}"
1152
1153     # Unlock the critical section if it was locked
1154     if test "$need_locks" != no; then
1155       $run $rm "$lockfile"
1156     fi
1157
1158     exit 0
1159     ;;
1160
1161   # libtool link mode
1162   link | relink)
1163     modename="$modename: link"
1164     case $host in
1165     *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2*)
1166       # It is impossible to link a dll without this setting, and
1167       # we shouldn't force the makefile maintainer to figure out
1168       # which system we are compiling for in order to pass an extra
1169       # flag for every libtool invocation.
1170       # allow_undefined=no
1171
1172       # FIXME: Unfortunately, there are problems with the above when trying
1173       # to make a dll which has undefined symbols, in which case not
1174       # even a static library is built.  For now, we need to specify
1175       # -no-undefined on the libtool link line when we can be certain
1176       # that all symbols are satisfied, otherwise we get a static library.
1177       allow_undefined=yes
1178       ;;
1179     *)
1180       allow_undefined=yes
1181       ;;
1182     esac
1183     libtool_args="$nonopt"
1184     base_compile="$nonopt"
1185     compile_command="$nonopt"
1186     finalize_command="$nonopt"
1187
1188     compile_rpath=
1189     finalize_rpath=
1190     compile_shlibpath=
1191     finalize_shlibpath=
1192     convenience=
1193     old_convenience=
1194     deplibs=
1195     old_deplibs=
1196     compiler_flags=
1197     linker_flags=
1198     dllsearchpath=
1199     lib_search_path=`pwd`
1200     inst_prefix_dir=
1201
1202     avoid_version=no
1203     dlfiles=
1204     dlprefiles=
1205     dlself=no
1206     export_dynamic=no
1207     export_symbols=
1208     export_symbols_regex=
1209     generated=
1210     libobjs=
1211     ltlibs=
1212     module=no
1213     no_install=no
1214     objs=
1215     non_pic_objects=
1216     prefer_static_libs=no
1217     preload=no
1218     prev=
1219     prevarg=
1220     release=
1221     rpath=
1222     xrpath=
1223     perm_rpath=
1224     temp_rpath=
1225     thread_safe=no
1226     vinfo=
1227     vinfo_number=no
1228
1229     # We need to know -static, to get the right output filenames.
1230     for arg
1231     do
1232       case $arg in
1233       -all-static | -static)
1234         if test "X$arg" = "X-all-static"; then
1235           if test "$build_libtool_libs" = yes && test -z "$link_static_flag"; then
1236             $echo "$modename: warning: complete static linking is impossible in this configuration" 1>&2
1237           fi
1238           if test -n "$link_static_flag"; then
1239             dlopen_self=$dlopen_self_static
1240           fi
1241         else
1242           if test -z "$pic_flag" && test -n "$link_static_flag"; then
1243             dlopen_self=$dlopen_self_static
1244           fi
1245         fi
1246         build_libtool_libs=no
1247         build_old_libs=yes
1248         prefer_static_libs=yes
1249         break
1250         ;;
1251       esac
1252     done
1253
1254     # See if our shared archives depend on static archives.
1255     test -n "$old_archive_from_new_cmds" && build_old_libs=yes
1256
1257     # Go through the arguments, transforming them on the way.
1258     while test "$#" -gt 0; do
1259       arg="$1"</