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