OSDN Git Service

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