root/morphix/trunk/clusterix/openmosix-tools-0.3.6-2/ltmain.sh

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

Initial import, branching from morphix svn

Line 
1 # ltmain.sh - Provide generalized library-building support services.
2 # NOTE: Changing this file will not affect anything until you rerun configure.
3 #
4 # Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003
5 # Free Software Foundation, Inc.
6 # Originally by Gordon Matzigkeit <gord@gnu.ai.mit.edu>, 1996
7 #
8 # This program is free software; you can redistribute it and/or modify
9 # it under the terms of the GNU General Public License as published by
10 # the Free Software Foundation; either version 2 of the License, or
11 # (at your option) any later version.
12 #
13 # This program is distributed in the hope that it will be useful, but
14 # WITHOUT ANY WARRANTY; without even the implied warranty of
15 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
16 # General Public License for more details.
17 #
18 # You should have received a copy of the GNU General Public License
19 # along with this program; if not, write to the Free Software
20 # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
21 #
22 # As a special exception to the GNU General Public License, if you
23 # distribute this file as part of a program that contains a
24 # configuration script generated by Autoconf, you may include it under
25 # the same distribution terms that you use for the rest of that program.
26
27 # Check that we have a working $echo.
28 if test "X$1" = X--no-reexec; then
29   # Discard the --no-reexec flag, and continue.
30   shift
31 elif test "X$1" = X--fallback-echo; then
32   # Avoid inline document here, it may be left over
33   :
34 elif test "X`($echo '\t') 2>/dev/null`" = 'X\t'; then
35   # Yippee, $echo works!
36   :
37 else
38   # Restart under the correct shell, and then maybe $echo will work.
39   exec $SHELL "$0" --no-reexec ${1+"$@"}
40 fi
41
42 if test "X$1" = X--fallback-echo; then
43   # used as fallback echo
44   shift
45   cat <<EOF
46 $*
47 EOF
48   exit 0
49 fi
50
51 # define SED for historic ltconfig's generated by Libtool 1.3
52 test -z "$SED" && SED=sed
53
54 # The name of this program.
55 progname=`$echo "$0" | ${SED} 's%^.*/%%'`
56 modename="$progname"
57
58 # Constants.
59 PROGRAM=ltmain.sh
60 PACKAGE=libtool
61 VERSION=1.5
62 TIMESTAMP=" (1.1220.2.1 2003/04/14 22:48:00)"
63
64 default_mode=
65 help="Try \`$progname --help' for more information."
66 magic="%%%MAGIC variable%%%"
67 mkdir="mkdir"
68 mv="mv -f"
69 rm="rm -f"
70
71 # Sed substitution that helps us do robust quoting.  It backslashifies
72 # metacharacters that are still active within double-quoted strings.
73 Xsed="${SED}"' -e 1s/^X//'
74 sed_quote_subst='s/\([\\`\\"$\\\\]\)/\\\1/g'
75 # test EBCDIC or ASCII
76 case `echo A|od -x` in
77  *[Cc]1*) # EBCDIC based system
78   SP2NL="tr '\100' '\n'"
79   NL2SP="tr '\r\n' '\100\100'"
80   ;;
81  *) # Assume ASCII based system
82   SP2NL="tr '\040' '\012'"
83   NL2SP="tr '\015\012' '\040\040'"
84   ;;
85 esac
86
87 # NLS nuisances.
88 # Only set LANG and LC_ALL to C if already set.
89 # These must not be set unconditionally because not all systems understand
90 # e.g. LANG=C (notably SCO).
91 # We save the old values to restore during execute mode.
92 if test "${LC_ALL+set}" = set; then
93   save_LC_ALL="$LC_ALL"; LC_ALL=C; export LC_ALL
94 fi
95 if test "${LANG+set}" = set; then
96   save_LANG="$LANG"; LANG=C; export LANG
97 fi
98
99 # Make sure IFS has a sensible default
100 : ${IFS="       "}
101
102 if test "$build_libtool_libs" != yes && test "$build_old_libs" != yes; then
103   $echo "$modename: not configured to build any kind of library" 1>&2
104   $echo "Fatal configuration error.  See the $PACKAGE docs for more information." 1>&2
105   exit 1
106 fi
107
108 # Global variables.
109 mode=$default_mode
110 nonopt=
111 prev=
112 prevopt=
113 run=
114 show="$echo"
115 show_help=
116 execute_dlfiles=
117 lo2o="s/\\.lo\$/.${objext}/"
118 o2lo="s/\\.${objext}\$/.lo/"
119
120 #####################################
121 # Shell function definitions:
122 # This seems to be the best place for them
123
124 # Need a lot of goo to handle *both* DLLs and import libs
125 # Has to be a shell function in order to 'eat' the argument
126 # that is supplied when $file_magic_command is called.
127 win32_libid () {
128   win32_libid_type="unknown"
129   win32_fileres=`file -L $1 2>/dev/null`
130   case $win32_fileres in
131   *ar\ archive\ import\ library*) # definitely import
132     win32_libid_type="x86 archive import"
133     ;;
134   *ar\ archive*) # could be an import, or static
135     if eval $OBJDUMP -f $1 | $SED -e '10q' 2>/dev/null | \
136       grep -E 'file format pe-i386(.*architecture: i386)?' >/dev/null ; then
137       win32_nmres=`eval $NM -f posix -A $1 | \
138         sed -n -e '1,100{/ I /{x;/import/!{s/^/import/;h;p;};x;};}'`
139       if test "X$win32_nmres" = "Ximport" ; then
140         win32_libid_type="x86 archive import"
141       else
142         win32_libid_type="x86 archive static"
143       fi
144     fi
145     ;;
146   *DLL*)
147     win32_libid_type="x86 DLL"
148     ;;
149   *executable*) # but shell scripts are "executable" too...
150     case $win32_fileres in
151     *MS\ Windows\ PE\ Intel*)
152       win32_libid_type="x86 DLL"
153       ;;
154     esac
155     ;;
156   esac
157   $echo $win32_libid_type
158 }
159
160 # End of Shell function definitions
161 #####################################
162
163 # Parse our command line options once, thoroughly.
164 while test "$#" -gt 0
165 do
166   arg="$1"
167   shift
168
169   case $arg in
170   -*=*) optarg=`$echo "X$arg" | $Xsed -e 's/[-_a-zA-Z0-9]*=//'` ;;
171   *) optarg= ;;
172   esac
173
174   # If the previous option needs an argument, assign it.
175   if test -n "$prev"; then
176     case $prev in
177     execute_dlfiles)
178       execute_dlfiles="$execute_dlfiles $arg"
179       ;;
180     tag)
181       tagname="$arg"
182
183       # Check whether tagname contains only valid characters
184       case $tagname in
185       *[!-_A-Za-z0-9,/]*)
186         $echo "$progname: invalid tag name: $tagname" 1>&2
187         exit 1
188         ;;
189       esac
190
191       case $tagname in
192       CC)
193         # Don't test for the "default" C tag, as we know, it's there, but
194         # not specially marked.
195         ;;
196       *)
197         if grep "^# ### BEGIN LIBTOOL TAG CONFIG: $tagname$" < "$0" > /dev/null; then
198           taglist="$taglist $tagname"
199           # Evaluate the configuration.
200           eval "`${SED} -n -e '/^# ### BEGIN LIBTOOL TAG CONFIG: '$tagname'$/,/^# ### END LIBTOOL TAG CONFIG: '$tagname'$/p' < $0`"
201         else
202           $echo "$progname: ignoring unknown tag $tagname" 1>&2
203         fi
204         ;;
205       esac
206       ;;
207     *)
208       eval "$prev=\$arg"
209       ;;
210     esac
211
212     prev=
213     prevopt=
214     continue
215   fi
216
217   # Have we seen a non-optional argument yet?
218   case $arg in
219   --help)
220     show_help=yes
221     ;;
222
223   --version)
224     $echo "$PROGRAM (GNU $PACKAGE) $VERSION$TIMESTAMP"
225     $echo
226     $echo "Copyright (C) 2003  Free Software Foundation, Inc."
227     $echo "This is free software; see the source for copying conditions.  There is NO"
228     $echo "warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE."
229     exit 0
230     ;;
231
232   --config)
233     ${SED} -e '1,/^# ### BEGIN LIBTOOL CONFIG/d' -e '/^# ### END LIBTOOL CONFIG/,$d' $0
234     # Now print the configurations for the tags.
235     for tagname in $taglist; do
236       ${SED} -n -e "/^# ### BEGIN LIBTOOL TAG CONFIG: $tagname$/,/^# ### END LIBTOOL TAG CONFIG: $tagname$/p" < "$0"
237     done
238     exit 0
239     ;;
240
241   --debug)
242     $echo "$progname: enabling shell trace mode"
243     set -x
244     ;;
245
246   --dry-run | -n)
247     run=:
248     ;;
249
250   --features)
251     $echo "host: $host"
252     if test "$build_libtool_libs" = yes; then
253       $echo "enable shared libraries"
254     else
255       $echo "disable shared libraries"
256     fi
257     if test "$build_old_libs" = yes; then
258       $echo "enable static libraries"
259     else
260       $echo "disable static libraries"
261     fi
262     exit 0
263     ;;
264
265   --finish) mode="finish" ;;
266
267   --mode) prevopt="--mode" prev=mode ;;
268   --mode=*) mode="$optarg" ;;
269
270   --preserve-dup-deps) duplicate_deps="yes" ;;
271
272   --quiet | --silent)
273     show=:
274     ;;
275
276   --tag) prevopt="--tag" prev=tag ;;
277   --tag=*)
278     set tag "$optarg" ${1+"$@"}
279     shift
280     prev=tag
281     ;;
282
283   -dlopen)
284     prevopt="-dlopen"
285     prev=execute_dlfiles
286     ;;
287
288   -*)
289     $echo "$modename: unrecognized option \`$arg'" 1>&2
290     $echo "$help" 1>&2
291     exit 1
292     ;;
293
294   *)
295     nonopt="$arg"
296     break
297     ;;
298   esac
299 done
300
301 if test -n "$prevopt"; then
302   $echo "$modename: option \`$prevopt' requires an argument" 1>&2
303   $echo "$help" 1>&2
304   exit 1
305 fi
306
307 # If this variable is set in any of the actions, the command in it
308 # will be execed at the end.  This prevents here-documents from being
309 # left over by shells.
310 exec_cmd=
311
312 if test -z "$show_help"; then
313
314   # Infer the operation mode.
315   if test -z "$mode"; then
316     $echo "*** Warning: inferring the mode of operation is deprecated." 1>&2
317     $echo "*** Future versions of Libtool will require -mode=MODE be specified." 1>&2
318     case $nonopt in
319     *cc | cc* | *++ | gcc* | *-gcc* | g++* | xlc*)
320       mode=link
321       for arg
322       do
323         case $arg in
324         -c)
325            mode=compile
326            break
327            ;;
328         esac
329       done
330       ;;
331     *db | *dbx | *strace | *truss)
332       mode=execute
333       ;;
334     *install*|cp|mv)
335       mode=install
336       ;;
337     *rm)
338       mode=uninstall
339       ;;
340     *)
341       # If we have no mode, but dlfiles were specified, then do execute mode.
342       test -n "$execute_dlfiles" && mode=execute
343
344       # Just use the default operation mode.
345       if test -z "$mode"; then
346         if test -n "$nonopt"; then
347           $echo "$modename: warning: cannot infer operation mode from \`$nonopt'" 1>&2
348         else
349           $echo "$modename: warning: cannot infer operation mode without MODE-ARGS" 1>&2
350         fi
351       fi
352       ;;
353     esac
354   fi
355
356   # Only execute mode is allowed to have -dlopen flags.
357   if test -n "$execute_dlfiles" && test "$mode" != execute; then
358     $echo "$modename: unrecognized option \`-dlopen'" 1>&2
359     $echo "$help" 1>&2
360     exit 1
361   fi
362
363   # Change the help message to a mode-specific one.
364   generic_help="$help"
365   help="Try \`$modename --help --mode=$mode' for more information."
366
367   # These modes are in order of execution frequency so that they run quickly.
368   case $mode in
369   # libtool compile mode
370   compile)
371     modename="$modename: compile"
372     # Get the compilation command and the source file.
373     base_compile=
374     srcfile="$nonopt"  #  always keep a non-empty value in "srcfile"
375     suppress_output=
376     arg_mode=normal
377     libobj=
378
379     for arg
380     do
381       case "$arg_mode" in
382       arg  )
383         # do not "continue".  Instead, add this to base_compile
384         lastarg="$arg"
385         arg_mode=normal
386         ;;
387
388       target )
389         libobj="$arg"
390         arg_mode=normal
391         continue
392         ;;
393
394       normal )
395         # Accept any command-line options.
396         case $arg in
397         -o)
398           if test -n "$libobj" ; then
399             $echo "$modename: you cannot specify \`-o' more than once" 1>&2
400             exit 1
401           fi
402           arg_mode=target
403           continue
404           ;;
405
406         -static)
407           build_old_libs=yes
408           continue
409           ;;
410
411         -prefer-pic)
412           pic_mode=yes
413           continue
414           ;;
415
416         -prefer-non-pic)
417           pic_mode=no
418           continue
419           ;;
420
421         -Xcompiler)
422           arg_mode=arg  #  the next one goes into the "base_compile" arg list
423           continue      #  The current "srcfile" will either be retained or
424           ;;            #  replaced later.  I would guess that would be a bug.
425
426         -Wc,*)
427           args=`$echo "X$arg" | $Xsed -e "s/^-Wc,//"`
428           lastarg=
429           save_ifs="$IFS"; IFS=','
430           for arg in $args; do
431             IFS="$save_ifs"
432
433             # Double-quote args containing other shell metacharacters.
434             # Many Bourne shells cannot handle close brackets correctly
435             # in scan sets, so we specify it separately.
436             case $arg in
437               *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \     ]*|*]*|"")
438               arg="\"$arg\""
439               ;;
440             esac
441             lastarg="$lastarg $arg"
442           done
443           IFS="$save_ifs"
444           lastarg=`$echo "X$lastarg" | $Xsed -e "s/^ //"`
445
446           # Add the arguments to base_compile.
447           base_compile="$base_compile $lastarg"
448           continue
449           ;;
450
451         * )
452           # Accept the current argument as the source file.
453           # The previous "srcfile" becomes the current argument.
454           #
455           lastarg="$srcfile"
456           srcfile="$arg"
457           ;;
458         esac  #  case $arg
459         ;;
460       esac    #  case $arg_mode
461
462       # Aesthetically quote the previous argument.
463       lastarg=`$echo "X$lastarg" | $Xsed -e "$sed_quote_subst"`
464
465       case $lastarg in
466       # Double-quote args containing other shell metacharacters.
467       # Many Bourne shells cannot handle close brackets correctly
468       # in scan sets, so we specify it separately.
469       *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \     ]*|*]*|"")
470         lastarg="\"$lastarg\""
471         ;;
472       esac
473
474       base_compile="$base_compile $lastarg"
475     done # for arg
476
477     case $arg_mode in
478     arg)
479       $echo "$modename: you must specify an argument for -Xcompile"
480       exit 1
481       ;;
482     target)
483       $echo "$modename: you must specify a target with \`-o'" 1>&2
484       exit 1
485       ;;
486     *)
487       # Get the name of the library object.
488       [ -z "$libobj" ] && libobj=`$echo "X$srcfile" | $Xsed -e 's%^.*/%%'`
489       ;;
490     esac
491
492     # Recognize several different file suffixes.
493     # If the user specifies -o file.o, it is replaced with file.lo
494     xform='[cCFSifmso]'
495     case $libobj in
496     *.ada) xform=ada ;;
497     *.adb) xform=adb ;;
498     *.ads) xform=ads ;;
499     *.asm) xform=asm ;;
500     *.c++) xform=c++ ;;
501     *.cc) xform=cc ;;
502     *.ii) xform=ii ;;
503     *.class) xform=class ;;
504     *.cpp) xform=cpp ;;
505     *.cxx) xform=cxx ;;
506     *.f90) xform=f90 ;;
507     *.for) xform=for ;;
508     *.java) xform=java ;;
509     esac
510
511     libobj=`$echo "X$libobj" | $Xsed -e "s/\.$xform$/.lo/"`
512
513     case $libobj in
514     *.lo) obj=`$echo "X$libobj" | $Xsed -e "$lo2o"` ;;
515     *)
516       $echo "$modename: cannot determine name of library object from \`$libobj'" 1>&2
517       exit 1
518       ;;
519     esac
520
521     # Infer tagged configuration to use if any are available and
522     # if one wasn't chosen via the "--tag" command line option.
523     # Only attempt this if the compiler in the base compile
524     # command doesn't match the default compiler.
525     if test -n "$available_tags" && test -z "$tagname"; then
526       case $base_compile in
527       # Blanks in the command may have been stripped by the calling shell,
528       # but not from the CC environment variable when configure was run.
529       " $CC "* | "$CC "* | " `$echo $CC` "* | "`$echo $CC` "*) ;;
530       # Blanks at the start of $base_compile will cause this to fail
531       # if we don't check for them as well.
532       *)
533         for z in $available_tags; do
534           if grep "^# ### BEGIN LIBTOOL TAG CONFIG: $z$" < "$0" > /dev/null; then
535             # Evaluate the configuration.
536             eval "`${SED} -n -e '/^# ### BEGIN LIBTOOL TAG CONFIG: '$z'$/,/^# ### END LIBTOOL TAG CONFIG: '$z'$/p' < $0`"
537             case "$base_compile " in
538             "$CC "* | " $CC "* | "`$echo $CC` "* | " `$echo $CC` "*)
539               # The compiler in the base compile command matches
540               # the one in the tagged configuration.
541               # Assume this is the tagged configuration we want.
542               tagname=$z
543               break
544               ;;
545             esac
546           fi
547         done
548         # If $tagname still isn't set, then no tagged configuration
549         # was found and let the user know that the "--tag" command
550         # line option must be used.
551         if test -z "$tagname"; then
552           $echo "$modename: unable to infer tagged configuration"
553           $echo "$modename: specify a tag with \`--tag'" 1>&2
554           exit 1
555 #        else
556 #          $echo "$modename: using $tagname tagged configuration"
557         fi
558         ;;
559       esac
560     fi
561
562     objname=`$echo "X$obj" | $Xsed -e 's%^.*/%%'`
563     xdir=`$echo "X$obj" | $Xsed -e 's%/[^/]*$%%'`
564     if test "X$xdir" = "X$obj"; then
565       xdir=
566     else
567       xdir=$xdir/
568     fi
569     lobj=${xdir}$objdir/$objname
570
571     if test -z "$base_compile"; then
572       $echo "$modename: you must specify a compilation command" 1>&2
573       $echo "$help" 1>&2
574       exit 1
575     fi
576
577     # Delete any leftover library objects.
578     if test "$build_old_libs" = yes; then
579       removelist="$obj $lobj $libobj ${libobj}T"
580     else
581       removelist="$lobj $libobj ${libobj}T"
582     fi
583
584     $run $rm $removelist
585     trap "$run $rm $removelist; exit 1" 1 2 15
586
587     # On Cygwin there's no "real" PIC flag so we must build both object types
588     case $host_os in
589     cygwin* | mingw* | pw32* | os2*)
590       pic_mode=default
591       ;;
592     esac
593     if test "$pic_mode" = no && test "$deplibs_check_method" != pass_all; then
594       # non-PIC code in shared libraries is not supported
595       pic_mode=default
596     fi
597
598     # Calculate the filename of the output object if compiler does
599     # not support -o with -c
600     if test "$compiler_c_o" = no; then
601       output_obj=`$echo "X$srcfile" | $Xsed -e 's%^.*/%%' -e 's%\.[^.]*$%%'`.${objext}
602       lockfile="$output_obj.lock"
603       removelist="$removelist $output_obj $lockfile"
604       trap "$run $rm $removelist; exit 1" 1 2 15
605     else
606       output_obj=
607       need_locks=no
608       lockfile=
609     fi
610
611     # Lock this critical section if it is needed
612     # We use this script file to make the link, it avoids creating a new file
613     if test "$need_locks" = yes; then
614       until $run ln "$0" "$lockfile" 2>/dev/null; do
615         $show "Waiting for $lockfile to be removed"
616         sleep 2
617       done
618     elif test "$need_locks" = warn; then
619       if test -f "$lockfile"; then
620         $echo "\
621 *** ERROR, $lockfile exists and contains:
622 `cat $lockfile 2>/dev/null`
623
624 This indicates that another process is trying to use the same
625 temporary object file, and libtool could not work around it because
626 your compiler does not support \`-c' and \`-o' together.  If you
627 repeat this compilation, it may succeed, by chance, but you had better
628 avoid parallel builds (make -j) in this platform, or get a better
629 compiler."
630
631         $run $rm $removelist
632         exit 1
633       fi
634       $echo $srcfile > "$lockfile"
635     fi
636
637     if test -n "$fix_srcfile_path"; then
638       eval srcfile=\"$fix_srcfile_path\"
639     fi
640
641     $run $rm "$libobj" "${libobj}T"
642
643     # Create a libtool object file (analogous to a ".la" file),
644     # but don't create it if we're doing a dry run.
645     test -z "$run" && cat > ${libobj}T <<EOF
646 # $libobj - a libtool object file
647 # Generated by $PROGRAM - GNU $PACKAGE $VERSION$TIMESTAMP
648 #
649 # Please DO NOT delete this file!
650 # It is necessary for linking the library.
651
652 # Name of the PIC object.
653 EOF
654
655     # Only build a PIC object if we are building libtool libraries.
656     if test "$build_libtool_libs" = yes; then
657       # Without this assignment, base_compile gets emptied.
658       fbsd_hideous_sh_bug=$base_compile
659
660       if test "$pic_mode" != no; then
661         command="$base_compile $srcfile $pic_flag"
662       else
663         # Don't build PIC code
664         command="$base_compile $srcfile"
665       fi
666
667       if test ! -d "${xdir}$objdir"; then
668         $show "$mkdir ${xdir}$objdir"
669         $run $mkdir ${xdir}$objdir
670         status=$?
671         if test "$status" -ne 0 && test ! -d "${xdir}$objdir"; then
672           exit $status
673         fi
674       fi
675
676       if test -z "$output_obj"; then
677         # Place PIC objects in $objdir
678         command="$command -o $lobj"
679       fi
680
681       $run $rm "$lobj" "$output_obj"
682
683       $show "$command"
684       if $run eval "$command"; then :
685       else
686         test -n "$output_obj" && $run $rm $removelist
687         exit 1
688       fi
689
690       if test "$need_locks" = warn &&
691          test "X`cat $lockfile 2>/dev/null`" != "X$srcfile"; then
692         $echo "\
693 *** ERROR, $lockfile contains:
694 `cat $lockfile 2>/dev/null`
695
696 but it should contain:
697 $srcfile
698
699 This indicates that another process is trying to use the same
700 temporary object file, and libtool could not work around it because
701 your compiler does not support \`-c' and \`-o' together.  If you
702 repeat this compilation, it may succeed, by chance, but you had better
703 avoid parallel builds (make -j) in this platform, or get a better
704 compiler."
705
706         $run $rm $removelist
707         exit 1
708       fi
709
710       # Just move the object if needed, then go on to compile the next one
711       if test -n "$output_obj" && test "X$output_obj" != "X$lobj"; then
712         $show "$mv $output_obj $lobj"
713         if $run $mv $output_obj $lobj; then :
714         else
715           error=$?
716           $run $rm $removelist
717           exit $error
718         fi
719       fi
720
721       # Append the name of the PIC object to the libtool object file.
722       test -z "$run" && cat >> ${libobj}T <<EOF
723 pic_object='$objdir/$objname'
724
725 EOF
726
727       # Allow error messages only from the first compilation.
728       suppress_output=' >/dev/null 2>&1'
729     else
730       # No PIC object so indicate it doesn't exist in the libtool
731       # object file.
732       test -z "$run" && cat >> ${libobj}T <<EOF
733 pic_object=none
734
735 EOF
736     fi
737
738     # Only build a position-dependent object if we build old libraries.
739     if test "$build_old_libs" = yes; then
740       if test "$pic_mode" != yes; then
741         # Don't build PIC code
742         command="$base_compile $srcfile"
743       else
744         command="$base_compile $srcfile $pic_flag"
745       fi
746       if test "$compiler_c_o" = yes; then
747         command="$command -o $obj"
748       fi
749
750       # Suppress compiler output if we already did a PIC compilation.
751       command="$command$suppress_output"
752       $run $rm "$obj" "$output_obj"
753       $show "$command"
754       if $run eval "$command"; then :
755       else
756         $run $rm $removelist
757         exit 1
758       fi
759
760       if test "$need_locks" = warn &&
761          test "X`cat $lockfile 2>/dev/null`" != "X$srcfile"; then
762         $echo "\
763 *** ERROR, $lockfile contains:
764 `cat $lockfile 2>/dev/null`
765
766 but it should contain:
767 $srcfile
768
769 This indicates that another process is trying to use the same
770 temporary object file, and libtool could not work around it because
771 your compiler does not support \`-c' and \`-o' together.  If you
772 repeat this compilation, it may succeed, by chance, but you had better
773 avoid parallel builds (make -j) in this platform, or get a better
774 compiler."
775
776         $run $rm $removelist
777         exit 1
778       fi
779
780       # Just move the object if needed
781       if test -n "$output_obj" && test "X$output_obj" != "X$obj"; then
782         $show "$mv $output_obj $obj"
783         if $run $mv $output_obj $obj; then :
784         else
785           error=$?
786           $run $rm $removelist
787           exit $error
788         fi
789       fi
790
791       # Append the name of the non-PIC object the libtool object file.
792       # Only append if the libtool object file exists.
793       test -z "$run" && cat >> ${libobj}T <<EOF
794 # Name of the non-PIC object.
795 non_pic_object='$objname'
796
797 EOF
798     else
799       # Append the name of the non-PIC object the libtool object file.
800       # Only append if the libtool object file exists.
801       test -z "$run" && cat >> ${libobj}T <<EOF
802 # Name of the non-PIC object.
803 non_pic_object=none
804
805 EOF
806     fi
807
808     $run $mv "${libobj}T" "${libobj}"
809
810     # Unlock the critical section if it was locked
811     if test "$need_locks" != no; then
812       $run $rm "$lockfile"
813     fi
814
815     exit 0
816     ;;
817
818   # libtool link mode
819   link | relink)
820     modename="$modename: link"
821     case $host in
822     *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2*)
823       # It is impossible to link a dll without this setting, and
824       # we shouldn't force the makefile maintainer to figure out
825       # which system we are compiling for in order to pass an extra
826       # flag for every libtool invocation.
827       # allow_undefined=no
828
829       # FIXME: Unfortunately, there are problems with the above when trying
830       # to make a dll which has undefined symbols, in which case not
831       # even a static library is built.  For now, we need to specify
832       # -no-undefined on the libtool link line when we can be certain
833       # that all symbols are satisfied, otherwise we get a static library.
834       allow_undefined=yes
835       ;;
836     *)
837</