~ubuntu-branches/ubuntu/jaunty/texlive-bin/jaunty-security

« back to all changes in this revision

Viewing changes to build/source/libs/expat/conftools/ltmain.sh

  • Committer: Bazaar Package Importer
  • Author(s): Norbert Preining
  • Date: 2008-06-26 23:14:59 UTC
  • mfrom: (2.1.30 intrepid)
  • Revision ID: james.westby@ubuntu.com-20080626231459-y02rjsrgtafu83yr
Tags: 2007.dfsg.2-3
add missing source roadmap.fig of roadmap.eps in fontinst documentation
(Closes: #482915) (urgency medium due to RC bug)
(new patch add-missing-fontinst-source)

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
# ltmain.sh - Provide generalized library-building support services.
 
2
# NOTE: Changing this file will not affect anything until you rerun ltconfig.
 
3
#
 
4
# Copyright (C) 1996-1999 Free Software Foundation, Inc.
 
5
# Originally by Gordon Matzigkeit <gord@gnu.ai.mit.edu>, 1996
 
6
#
 
7
# This program is free software; you can redistribute it and/or modify
 
8
# it under the terms of the GNU General Public License as published by
 
9
# the Free Software Foundation; either version 2 of the License, or
 
10
# (at your option) any later version.
 
11
#
 
12
# This program is distributed in the hope that it will be useful, but
 
13
# WITHOUT ANY WARRANTY; without even the implied warranty of
 
14
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 
15
# General Public License for more details.
 
16
#
 
17
# You should have received a copy of the GNU General Public License
 
18
# along with this program; if not, write to the Free Software
 
19
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
 
20
#
 
21
# As a special exception to the GNU General Public License, if you
 
22
# distribute this file as part of a program that contains a
 
23
# configuration script generated by Autoconf, you may include it under
 
24
# the same distribution terms that you use for the rest of that program.
 
25
 
 
26
# Check that we have a working $echo.
 
27
if test "X$1" = X--no-reexec; then
 
28
  # Discard the --no-reexec flag, and continue.
 
29
  shift
 
30
elif test "X$1" = X--fallback-echo; then
 
31
  # Avoid inline document here, it may be left over
 
32
  :
 
33
elif test "X`($echo '\t') 2>/dev/null`" = 'X\t'; then
 
34
  # Yippee, $echo works!
 
35
  :
 
36
else
 
37
  # Restart under the correct shell, and then maybe $echo will work.
 
38
  exec $SHELL "$0" --no-reexec ${1+"$@"}
 
39
fi
 
40
 
 
41
if test "X$1" = X--fallback-echo; then
 
42
  # used as fallback echo
 
43
  shift
 
44
  cat <<EOF
 
45
$*
 
46
EOF
 
47
  exit 0
 
48
fi
 
49
 
 
50
# The name of this program.
 
51
progname=`$echo "$0" | sed 's%^.*/%%'`
 
52
modename="$progname"
 
53
 
 
54
# Constants.
 
55
PROGRAM=ltmain.sh
 
56
PACKAGE=libtool
 
57
VERSION=1.3.5
 
58
TIMESTAMP=" (1.385.2.206 2000/05/27 11:12:27)"
 
59
 
 
60
default_mode=
 
61
help="Try \`$progname --help' for more information."
 
62
magic="%%%MAGIC variable%%%"
 
63
mkdir="mkdir"
 
64
mv="mv -f"
 
65
rm="rm -f"
 
66
 
 
67
# Sed substitution that helps us do robust quoting.  It backslashifies
 
68
# metacharacters that are still active within double-quoted strings.
 
69
Xsed='sed -e 1s/^X//'
 
70
sed_quote_subst='s/\([\\`\\"$\\\\]\)/\\\1/g'
 
71
SP2NL='tr \040 \012'
 
72
NL2SP='tr \015\012 \040\040'
 
73
 
 
74
# NLS nuisances.
 
75
# Only set LANG and LC_ALL to C if already set.
 
76
# These must not be set unconditionally because not all systems understand
 
77
# e.g. LANG=C (notably SCO).
 
78
# We save the old values to restore during execute mode.
 
79
if test "${LC_ALL+set}" = set; then
 
80
  save_LC_ALL="$LC_ALL"; LC_ALL=C; export LC_ALL
 
81
fi
 
82
if test "${LANG+set}" = set; then
 
83
  save_LANG="$LANG"; LANG=C; export LANG
 
84
fi
 
85
 
 
86
if test "$LTCONFIG_VERSION" != "$VERSION"; then
 
87
  echo "$modename: ltconfig version \`$LTCONFIG_VERSION' does not match $PROGRAM version \`$VERSION'" 1>&2
 
88
  echo "Fatal configuration error.  See the $PACKAGE docs for more information." 1>&2
 
89
  exit 1
 
90
fi
 
91
 
 
92
if test "$build_libtool_libs" != yes && test "$build_old_libs" != yes; then
 
93
  echo "$modename: not configured to build any kind of library" 1>&2
 
94
  echo "Fatal configuration error.  See the $PACKAGE docs for more information." 1>&2
 
95
  exit 1
 
96
fi
 
97
 
 
98
# Global variables.
 
99
mode=$default_mode
 
100
nonopt=
 
101
prev=
 
102
prevopt=
 
103
run=
 
104
show="$echo"
 
105
show_help=
 
106
execute_dlfiles=
 
107
lo2o="s/\\.lo\$/.${objext}/"
 
108
o2lo="s/\\.${objext}\$/.lo/"
 
109
 
 
110
# Parse our command line options once, thoroughly.
 
111
while test $# -gt 0
 
112
do
 
113
  arg="$1"
 
114
  shift
 
115
 
 
116
  case "$arg" in
 
117
  -*=*) optarg=`$echo "X$arg" | $Xsed -e 's/[-_a-zA-Z0-9]*=//'` ;;
 
118
  *) optarg= ;;
 
119
  esac
 
120
 
 
121
  # If the previous option needs an argument, assign it.
 
122
  if test -n "$prev"; then
 
123
    case "$prev" in
 
124
    execute_dlfiles)
 
125
      eval "$prev=\"\$$prev \$arg\""
 
126
      ;;
 
127
    *)
 
128
      eval "$prev=\$arg"
 
129
      ;;
 
130
    esac
 
131
 
 
132
    prev=
 
133
    prevopt=
 
134
    continue
 
135
  fi
 
136
 
 
137
  # Have we seen a non-optional argument yet?
 
138
  case "$arg" in
 
139
  --help)
 
140
    show_help=yes
 
141
    ;;
 
142
 
 
143
  --version)
 
144
    echo "$PROGRAM (GNU $PACKAGE) $VERSION$TIMESTAMP"
 
145
    exit 0
 
146
    ;;
 
147
 
 
148
  --config)
 
149
    sed -e '1,/^### BEGIN LIBTOOL CONFIG/d' -e '/^### END LIBTOOL CONFIG/,$d' $0
 
150
    exit 0
 
151
    ;;
 
152
 
 
153
  --debug)
 
154
    echo "$progname: enabling shell trace mode"
 
155
    set -x
 
156
    ;;
 
157
 
 
158
  --dry-run | -n)
 
159
    run=:
 
160
    ;;
 
161
 
 
162
  --features)
 
163
    echo "host: $host"
 
164
    if test "$build_libtool_libs" = yes; then
 
165
      echo "enable shared libraries"
 
166
    else
 
167
      echo "disable shared libraries"
 
168
    fi
 
169
    if test "$build_old_libs" = yes; then
 
170
      echo "enable static libraries"
 
171
    else
 
172
      echo "disable static libraries"
 
173
    fi
 
174
    exit 0
 
175
    ;;
 
176
 
 
177
  --finish) mode="finish" ;;
 
178
 
 
179
  --mode) prevopt="--mode" prev=mode ;;
 
180
  --mode=*) mode="$optarg" ;;
 
181
 
 
182
  --quiet | --silent)
 
183
    show=:
 
184
    ;;
 
185
 
 
186
  -dlopen)
 
187
    prevopt="-dlopen"
 
188
    prev=execute_dlfiles
 
189
    ;;
 
190
 
 
191
  -*)
 
192
    $echo "$modename: unrecognized option \`$arg'" 1>&2
 
193
    $echo "$help" 1>&2
 
194
    exit 1
 
195
    ;;
 
196
 
 
197
  *)
 
198
    nonopt="$arg"
 
199
    break
 
200
    ;;
 
201
  esac
 
202
done
 
203
 
 
204
if test -n "$prevopt"; then
 
205
  $echo "$modename: option \`$prevopt' requires an argument" 1>&2
 
206
  $echo "$help" 1>&2
 
207
  exit 1
 
208
fi
 
209
 
 
210
if test -z "$show_help"; then
 
211
 
 
212
  # Infer the operation mode.
 
213
  if test -z "$mode"; then
 
214
    case "$nonopt" in
 
215
    *cc | *++ | gcc* | *-gcc*)
 
216
      mode=link
 
217
      for arg
 
218
      do
 
219
        case "$arg" in
 
220
        -c)
 
221
           mode=compile
 
222
           break
 
223
           ;;
 
224
        esac
 
225
      done
 
226
      ;;
 
227
    *db | *dbx | *strace | *truss)
 
228
      mode=execute
 
229
      ;;
 
230
    *install*|cp|mv)
 
231
      mode=install
 
232
      ;;
 
233
    *rm)
 
234
      mode=uninstall
 
235
      ;;
 
236
    *)
 
237
      # If we have no mode, but dlfiles were specified, then do execute mode.
 
238
      test -n "$execute_dlfiles" && mode=execute
 
239
 
 
240
      # Just use the default operation mode.
 
241
      if test -z "$mode"; then
 
242
        if test -n "$nonopt"; then
 
243
          $echo "$modename: warning: cannot infer operation mode from \`$nonopt'" 1>&2
 
244
        else
 
245
          $echo "$modename: warning: cannot infer operation mode without MODE-ARGS" 1>&2
 
246
        fi
 
247
      fi
 
248
      ;;
 
249
    esac
 
250
  fi
 
251
 
 
252
  # Only execute mode is allowed to have -dlopen flags.
 
253
  if test -n "$execute_dlfiles" && test "$mode" != execute; then
 
254
    $echo "$modename: unrecognized option \`-dlopen'" 1>&2
 
255
    $echo "$help" 1>&2
 
256
    exit 1
 
257
  fi
 
258
 
 
259
  # Change the help message to a mode-specific one.
 
260
  generic_help="$help"
 
261
  help="Try \`$modename --help --mode=$mode' for more information."
 
262
 
 
263
  # These modes are in order of execution frequency so that they run quickly.
 
264
  case "$mode" in
 
265
  # libtool compile mode
 
266
  compile)
 
267
    modename="$modename: compile"
 
268
    # Get the compilation command and the source file.
 
269
    base_compile=
 
270
    lastarg=
 
271
    srcfile="$nonopt"
 
272
    suppress_output=
 
273
 
 
274
    user_target=no
 
275
    for arg
 
276
    do
 
277
      # Accept any command-line options.
 
278
      case "$arg" in
 
279
      -o)
 
280
        if test "$user_target" != "no"; then
 
281
          $echo "$modename: you cannot specify \`-o' more than once" 1>&2
 
282
          exit 1
 
283
        fi
 
284
        user_target=next
 
285
        ;;
 
286
 
 
287
      -static)
 
288
        build_old_libs=yes
 
289
        continue
 
290
        ;;
 
291
      esac
 
292
 
 
293
      case "$user_target" in
 
294
      next)
 
295
        # The next one is the -o target name
 
296
        user_target=yes
 
297
        continue
 
298
        ;;
 
299
      yes)
 
300
        # We got the output file
 
301
        user_target=set
 
302
        libobj="$arg"
 
303
        continue
 
304
        ;;
 
305
      esac
 
306
 
 
307
      # Accept the current argument as the source file.
 
308
      lastarg="$srcfile"
 
309
      srcfile="$arg"
 
310
 
 
311
      # Aesthetically quote the previous argument.
 
312
 
 
313
      # Backslashify any backslashes, double quotes, and dollar signs.
 
314
      # These are the only characters that are still specially
 
315
      # interpreted inside of double-quoted scrings.
 
316
      lastarg=`$echo "X$lastarg" | $Xsed -e "$sed_quote_subst"`
 
317
 
 
318
      # Double-quote args containing other shell metacharacters.
 
319
      # Many Bourne shells cannot handle close brackets correctly in scan
 
320
      # sets, so we specify it separately.
 
321
      case "$lastarg" in
 
322
      *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \     ]*|*]*)
 
323
        lastarg="\"$lastarg\""
 
324
        ;;
 
325
      esac
 
326
 
 
327
      # Add the previous argument to base_compile.
 
328
      if test -z "$base_compile"; then
 
329
        base_compile="$lastarg"
 
330
      else
 
331
        base_compile="$base_compile $lastarg"
 
332
      fi
 
333
    done
 
334
 
 
335
    case "$user_target" in
 
336
    set)
 
337
      ;;
 
338
    no)
 
339
      # Get the name of the library object.
 
340
      libobj=`$echo "X$srcfile" | $Xsed -e 's%^.*/%%'`
 
341
      ;;
 
342
    *)
 
343
      $echo "$modename: you must specify a target with \`-o'" 1>&2
 
344
      exit 1
 
345
      ;;
 
346
    esac
 
347
 
 
348
    # Recognize several different file suffixes.
 
349
    # If the user specifies -o file.o, it is replaced with file.lo
 
350
    xform='[cCFSfmso]'
 
351
    case "$libobj" in
 
352
    *.ada) xform=ada ;;
 
353
    *.adb) xform=adb ;;
 
354
    *.ads) xform=ads ;;
 
355
    *.asm) xform=asm ;;
 
356
    *.c++) xform=c++ ;;
 
357
    *.cc) xform=cc ;;
 
358
    *.cpp) xform=cpp ;;
 
359
    *.cxx) xform=cxx ;;
 
360
    *.f90) xform=f90 ;;
 
361
    *.for) xform=for ;;
 
362
    esac
 
363
 
 
364
    libobj=`$echo "X$libobj" | $Xsed -e "s/\.$xform$/.lo/"`
 
365
 
 
366
    case "$libobj" in
 
367
    *.lo) obj=`$echo "X$libobj" | $Xsed -e "$lo2o"` ;;
 
368
    *)
 
369
      $echo "$modename: cannot determine name of library object from \`$libobj'" 1>&2
 
370
      exit 1
 
371
      ;;
 
372
    esac
 
373
 
 
374
    if test -z "$base_compile"; then
 
375
      $echo "$modename: you must specify a compilation command" 1>&2
 
376
      $echo "$help" 1>&2
 
377
      exit 1
 
378
    fi
 
379
 
 
380
    # Delete any leftover library objects.
 
381
    if test "$build_old_libs" = yes; then
 
382
      removelist="$obj $libobj"
 
383
    else
 
384
      removelist="$libobj"
 
385
    fi
 
386
 
 
387
    $run $rm $removelist
 
388
    trap "$run $rm $removelist; exit 1" 1 2 15
 
389
 
 
390
    # Calculate the filename of the output object if compiler does
 
391
    # not support -o with -c
 
392
    if test "$compiler_c_o" = no; then
 
393
      output_obj=`$echo "X$srcfile" | $Xsed -e 's%^.*/%%' -e 's%\..*$%%'`.${objext}
 
394
      lockfile="$output_obj.lock"
 
395
      removelist="$removelist $output_obj $lockfile"
 
396
      trap "$run $rm $removelist; exit 1" 1 2 15
 
397
    else
 
398
      need_locks=no
 
399
      lockfile=
 
400
    fi
 
401
 
 
402
    # Lock this critical section if it is needed
 
403
    # We use this script file to make the link, it avoids creating a new file
 
404
    if test "$need_locks" = yes; then
 
405
      until ln "$0" "$lockfile" 2>/dev/null; do
 
406
        $show "Waiting for $lockfile to be removed"
 
407
        sleep 2
 
408
      done
 
409
    elif test "$need_locks" = warn; then
 
410
      if test -f "$lockfile"; then
 
411
        echo "\
 
412
*** ERROR, $lockfile exists and contains:
 
413
`cat $lockfile 2>/dev/null`
 
414
 
 
415
This indicates that another process is trying to use the same
 
416
temporary object file, and libtool could not work around it because
 
417
your compiler does not support \`-c' and \`-o' together.  If you
 
418
repeat this compilation, it may succeed, by chance, but you had better
 
419
avoid parallel builds (make -j) in this platform, or get a better
 
420
compiler."
 
421
 
 
422
        $run $rm $removelist
 
423
        exit 1
 
424
      fi
 
425
      echo $srcfile > "$lockfile"
 
426
    fi
 
427
 
 
428
    if test -n "$fix_srcfile_path"; then
 
429
      eval srcfile=\"$fix_srcfile_path\"
 
430
    fi
 
431
 
 
432
    # Only build a PIC object if we are building libtool libraries.
 
433
    if test "$build_libtool_libs" = yes; then
 
434
      # Without this assignment, base_compile gets emptied.
 
435
      fbsd_hideous_sh_bug=$base_compile
 
436
 
 
437
      # All platforms use -DPIC, to notify preprocessed assembler code.
 
438
      command="$base_compile $srcfile $pic_flag -DPIC"
 
439
      if test "$build_old_libs" = yes; then
 
440
        lo_libobj="$libobj"
 
441
        dir=`$echo "X$libobj" | $Xsed -e 's%/[^/]*$%%'`
 
442
        if test "X$dir" = "X$libobj"; then
 
443
          dir="$objdir"
 
444
        else
 
445
          dir="$dir/$objdir"
 
446
        fi
 
447
        libobj="$dir/"`$echo "X$libobj" | $Xsed -e 's%^.*/%%'`
 
448
 
 
449
        if test -d "$dir"; then
 
450
          $show "$rm $libobj"
 
451
          $run $rm $libobj
 
452
        else
 
453
          $show "$mkdir $dir"
 
454
          $run $mkdir $dir
 
455
          status=$?
 
456
          if test $status -ne 0 && test ! -d $dir; then
 
457
            exit $status
 
458
          fi
 
459
        fi
 
460
      fi
 
461
      if test "$compiler_o_lo" = yes; then
 
462
        output_obj="$libobj"
 
463
        command="$command -o $output_obj"
 
464
      elif test "$compiler_c_o" = yes; then
 
465
        output_obj="$obj"
 
466
        command="$command -o $output_obj"
 
467
      fi
 
468
 
 
469
      $run $rm "$output_obj"
 
470
      $show "$command"
 
471
      if $run eval "$command"; then :
 
472
      else
 
473
        test -n "$output_obj" && $run $rm $removelist
 
474
        exit 1
 
475
      fi
 
476
 
 
477
      if test "$need_locks" = warn &&
 
478
         test x"`cat $lockfile 2>/dev/null`" != x"$srcfile"; then
 
479
        echo "\
 
480
*** ERROR, $lockfile contains:
 
481
`cat $lockfile 2>/dev/null`
 
482
 
 
483
but it should contain:
 
484
$srcfile
 
485
 
 
486
This indicates that another process is trying to use the same
 
487
temporary object file, and libtool could not work around it because
 
488
your compiler does not support \`-c' and \`-o' together.  If you
 
489
repeat this compilation, it may succeed, by chance, but you had better
 
490
avoid parallel builds (make -j) in this platform, or get a better
 
491
compiler."
 
492
 
 
493
        $run $rm $removelist
 
494
        exit 1
 
495
      fi
 
496
 
 
497
      # Just move the object if needed, then go on to compile the next one
 
498
      if test x"$output_obj" != x"$libobj"; then
 
499
        $show "$mv $output_obj $libobj"
 
500
        if $run $mv $output_obj $libobj; then :
 
501
        else
 
502
          error=$?
 
503
          $run $rm $removelist
 
504
          exit $error
 
505
        fi
 
506
      fi
 
507
 
 
508
      # If we have no pic_flag, then copy the object into place and finish.
 
509
      if test -z "$pic_flag" && test "$build_old_libs" = yes; then
 
510
        # Rename the .lo from within objdir to obj
 
511
        if test -f $obj; then
 
512
          $show $rm $obj
 
513
          $run $rm $obj
 
514
        fi
 
515
 
 
516
        $show "$mv $libobj $obj"
 
517
        if $run $mv $libobj $obj; then :
 
518
        else
 
519
          error=$?
 
520
          $run $rm $removelist
 
521
          exit $error
 
522
        fi
 
523
 
 
524
        xdir=`$echo "X$obj" | $Xsed -e 's%/[^/]*$%%'`
 
525
        if test "X$xdir" = "X$obj"; then
 
526
          xdir="."
 
527
        else
 
528
          xdir="$xdir"
 
529
        fi
 
530
        baseobj=`$echo "X$obj" | $Xsed -e "s%.*/%%"`
 
531
        libobj=`$echo "X$baseobj" | $Xsed -e "$o2lo"`
 
532
        # Now arrange that obj and lo_libobj become the same file
 
533
        $show "(cd $xdir && $LN_S $baseobj $libobj)"
 
534
        if $run eval '(cd $xdir && $LN_S $baseobj $libobj)'; then
 
535
          exit 0
 
536
        else
 
537
          error=$?
 
538
          $run $rm $removelist
 
539
          exit $error
 
540
        fi
 
541
      fi
 
542
 
 
543
      # Allow error messages only from the first compilation.
 
544
      suppress_output=' >/dev/null 2>&1'
 
545
    fi
 
546
 
 
547
    # Only build a position-dependent object if we build old libraries.
 
548
    if test "$build_old_libs" = yes; then
 
549
      command="$base_compile $srcfile"
 
550
      if test "$compiler_c_o" = yes; then
 
551
        command="$command -o $obj"
 
552
        output_obj="$obj"
 
553
      fi
 
554
 
 
555
      # Suppress compiler output if we already did a PIC compilation.
 
556
      command="$command$suppress_output"
 
557
      $run $rm "$output_obj"
 
558
      $show "$command"
 
559
      if $run eval "$command"; then :
 
560
      else
 
561
        $run $rm $removelist
 
562
        exit 1
 
563
      fi
 
564
 
 
565
      if test "$need_locks" = warn &&
 
566
         test x"`cat $lockfile 2>/dev/null`" != x"$srcfile"; then
 
567
        echo "\
 
568
*** ERROR, $lockfile contains:
 
569
`cat $lockfile 2>/dev/null`
 
570
 
 
571
but it should contain:
 
572
$srcfile
 
573
 
 
574
This indicates that another process is trying to use the same
 
575
temporary object file, and libtool could not work around it because
 
576
your compiler does not support \`-c' and \`-o' together.  If you
 
577
repeat this compilation, it may succeed, by chance, but you had better
 
578
avoid parallel builds (make -j) in this platform, or get a better
 
579
compiler."
 
580
 
 
581
        $run $rm $removelist
 
582
        exit 1
 
583
      fi
 
584
 
 
585
      # Just move the object if needed
 
586
      if test x"$output_obj" != x"$obj"; then
 
587
        $show "$mv $output_obj $obj"
 
588
        if $run $mv $output_obj $obj; then :
 
589
        else
 
590
          error=$?
 
591
          $run $rm $removelist
 
592
          exit $error
 
593
        fi
 
594
      fi
 
595
 
 
596
      # Create an invalid libtool object if no PIC, so that we do not
 
597
      # accidentally link it into a program.
 
598
      if test "$build_libtool_libs" != yes; then
 
599
        $show "echo timestamp > $libobj"
 
600
        $run eval "echo timestamp > \$libobj" || exit $?
 
601
      else
 
602
        # Move the .lo from within objdir
 
603
        $show "$mv $libobj $lo_libobj"
 
604
        if $run $mv $libobj $lo_libobj; then :
 
605
        else
 
606
          error=$?
 
607
          $run $rm $removelist
 
608
          exit $error
 
609
        fi
 
610
      fi
 
611
    fi
 
612
 
 
613
    # Unlock the critical section if it was locked
 
614
    if test "$need_locks" != no; then
 
615
      $rm "$lockfile"
 
616
    fi
 
617
 
 
618
    exit 0
 
619
    ;;
 
620
 
 
621
  # libtool link mode
 
622
  link)
 
623
    modename="$modename: link"
 
624
    case "$host" in
 
625
    *-*-cygwin* | *-*-mingw* | *-*-os2*)
 
626
      # It is impossible to link a dll without this setting, and
 
627
      # we shouldn't force the makefile maintainer to figure out
 
628
      # which system we are compiling for in order to pass an extra
 
629
      # flag for every libtool invokation.
 
630
      allow_undefined=no
 
631
 
 
632
      # FIXME: Unfortunately, there are problems with the above when trying
 
633
      # to make a dll which has undefined symbols, in which case not
 
634
      # even a static library is built.  For now, we need to specify
 
635
      # -no-undefined on the libtool link line when we can be certain
 
636
      # that all symbols are satisfied, otherwise we get a static library.
 
637
      # allow_undefined=yes
 
638
 
 
639
      # This is a source program that is used to create dlls on Windows
 
640
      # Don't remove nor modify the starting and closing comments
 
641
# /* ltdll.c starts here */
 
642
# #define WIN32_LEAN_AND_MEAN
 
643
# #include <windows.h>
 
644
# #undef WIN32_LEAN_AND_MEAN
 
645
# #include <stdio.h>
 
646
#
 
647
# #ifndef __CYGWIN__
 
648
# #  ifdef __CYGWIN32__
 
649
# #    define __CYGWIN__ __CYGWIN32__
 
650
# #  endif
 
651
# #endif
 
652
#
 
653
# #ifdef __CYGWIN__
 
654
# #include <cygwin/cygwin_dll.h>
 
655
# DECLARE_CYGWIN_DLL( DllMain );
 
656
# #else
 
657
# #  ifdef __cplusplus
 
658
# extern "C" {
 
659
# #  endif
 
660
# BOOL APIENTRY DllMain (HINSTANCE hInst, DWORD reason, LPVOID reserved);
 
661
# #  ifdef __cplusplus
 
662
# }
 
663
# #  endif
 
664
#
 
665
# HINSTANCE __hDllInstance_base;
 
666
#
 
667
# BOOL APIENTRY
 
668
# DllMain (HINSTANCE hInst, DWORD reason, LPVOID reserved)
 
669
# {
 
670
#   __hDllInstance_base = hInst;
 
671
#   return TRUE;
 
672
# }
 
673
# #endif
 
674
# /* ltdll.c ends here */
 
675
      # This is a source program that is used to create import libraries
 
676
      # on Windows for dlls which lack them. Don't remove nor modify the
 
677
      # starting and closing comments
 
678
# /* impgen.c starts here */
 
679
# /*   Copyright (C) 1999 Free Software Foundation, Inc.
 
680
 
681
#  This file is part of GNU libtool.
 
682
 
683
#  This program is free software; you can redistribute it and/or modify
 
684
#  it under the terms of the GNU General Public License as published by
 
685
#  the Free Software Foundation; either version 2 of the License, or
 
686
#  (at your option) any later version.
 
687
 
688
#  This program is distributed in the hope that it will be useful,
 
689
#  but WITHOUT ANY WARRANTY; without even the implied warranty of
 
690
#  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 
691
#  GNU General Public License for more details.
 
692
 
693
#  You should have received a copy of the GNU General Public License
 
694
#  along with this program; if not, write to the Free Software
 
695
#  Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
 
696
#  */
 
697
 
698
#  #include <stdio.h>           /* for printf() */
 
699
#  #include <unistd.h>          /* for open(), lseek(), read() */
 
700
#  #include <fcntl.h>           /* for O_RDONLY, O_BINARY */
 
701
#  #include <string.h>          /* for strdup() */
 
702
 
703
#  static unsigned int
 
704
#  pe_get16 (fd, offset)
 
705
#       int fd;
 
706
#       int offset;
 
707
#  {
 
708
#    unsigned char b[2];
 
709
#    lseek (fd, offset, SEEK_SET);
 
710
#    read (fd, b, 2);
 
711
#    return b[0] + (b[1]<<8);
 
712
#  }
 
713
 
714
#  static unsigned int
 
715
#  pe_get32 (fd, offset)
 
716
#      int fd;
 
717
#      int offset;
 
718
#  {
 
719
#    unsigned char b[4];
 
720
#    lseek (fd, offset, SEEK_SET);
 
721
#    read (fd, b, 4);
 
722
#    return b[0] + (b[1]<<8) + (b[2]<<16) + (b[3]<<24);
 
723
#  }
 
724
 
725
#  static unsigned int
 
726
#  pe_as32 (ptr)
 
727
#       void *ptr;
 
728
#  {
 
729
#    unsigned char *b = ptr;
 
730
#    return b[0] + (b[1]<<8) + (b[2]<<16) + (b[3]<<24);
 
731
#  }
 
732
 
733
#  int
 
734
#  main (argc, argv)
 
735
#      int argc;
 
736
#      char *argv[];
 
737
#  {
 
738
#      int dll;
 
739
#      unsigned long pe_header_offset, opthdr_ofs, num_entries, i;
 
740
#      unsigned long export_rva, export_size, nsections, secptr, expptr;
 
741
#      unsigned long name_rvas, nexp;
 
742
#      unsigned char *expdata, *erva;
 
743
#      char *filename, *dll_name;
 
744
 
745
#      filename = argv[1];
 
746
 
747
#      dll = open(filename, O_RDONLY|O_BINARY);
 
748
#      if (!dll)
 
749
#       return 1;
 
750
 
751
#      dll_name = filename;
 
752
#    
 
753
#      for (i=0; filename[i]; i++)
 
754
#       if (filename[i] == '/' || filename[i] == '\\'  || filename[i] == ':')
 
755
#           dll_name = filename + i +1;
 
756
 
757
#      pe_header_offset = pe_get32 (dll, 0x3c);
 
758
#      opthdr_ofs = pe_header_offset + 4 + 20;
 
759
#      num_entries = pe_get32 (dll, opthdr_ofs + 92);
 
760
 
761
#      if (num_entries < 1) /* no exports */
 
762
#       return 1;
 
763
 
764
#      export_rva = pe_get32 (dll, opthdr_ofs + 96);
 
765
#      export_size = pe_get32 (dll, opthdr_ofs + 100);
 
766
#      nsections = pe_get16 (dll, pe_header_offset + 4 +2);
 
767
#      secptr = (pe_header_offset + 4 + 20 +
 
768
#             pe_get16 (dll, pe_header_offset + 4 + 16));
 
769
 
770
#      expptr = 0;
 
771
#      for (i = 0; i < nsections; i++)
 
772
#      {
 
773
#       char sname[8];
 
774
#       unsigned long secptr1 = secptr + 40 * i;
 
775
#       unsigned long vaddr = pe_get32 (dll, secptr1 + 12);
 
776
#       unsigned long vsize = pe_get32 (dll, secptr1 + 16);
 
777
#       unsigned long fptr = pe_get32 (dll, secptr1 + 20);
 
778
#       lseek(dll, secptr1, SEEK_SET);
 
779
#       read(dll, sname, 8);
 
780
#       if (vaddr <= export_rva && vaddr+vsize > export_rva)
 
781
#       {
 
782
#           expptr = fptr + (export_rva - vaddr);
 
783
#           if (export_rva + export_size > vaddr + vsize)
 
784
#               export_size = vsize - (export_rva - vaddr);
 
785
#           break;
 
786
#       }
 
787
#      }
 
788
 
789
#      expdata = (unsigned char*)malloc(export_size);
 
790
#      lseek (dll, expptr, SEEK_SET);
 
791
#      read (dll, expdata, export_size);
 
792
#      erva = expdata - export_rva;
 
793
 
794
#      nexp = pe_as32 (expdata+24);
 
795
#      name_rvas = pe_as32 (expdata+32);
 
796
 
797
#      printf ("EXPORTS\n");
 
798
#      for (i = 0; i<nexp; i++)
 
799
#      {
 
800
#       unsigned long name_rva = pe_as32 (erva+name_rvas+i*4);
 
801
#       printf ("\t%s @ %ld ;\n", erva+name_rva, 1+ i);
 
802
#      }
 
803
 
804
#      return 0;
 
805
#  }
 
806
# /* impgen.c ends here */
 
807
      ;;
 
808
    *)
 
809
      allow_undefined=yes
 
810
      ;;
 
811
    esac
 
812
    compile_command="$nonopt"
 
813
    finalize_command="$nonopt"
 
814
 
 
815
    compile_rpath=
 
816
    finalize_rpath=
 
817
    compile_shlibpath=
 
818
    finalize_shlibpath=
 
819
    convenience=
 
820
    old_convenience=
 
821
    deplibs=
 
822
    linkopts=
 
823
 
 
824
    if test -n "$shlibpath_var"; then
 
825
      # get the directories listed in $shlibpath_var
 
826
      eval lib_search_path=\`\$echo \"X \${$shlibpath_var}\" \| \$Xsed -e \'s/:/ /g\'\`
 
827
    else
 
828
      lib_search_path=
 
829
    fi
 
830
    # now prepend the system-specific ones
 
831
    eval lib_search_path=\"$sys_lib_search_path_spec\$lib_search_path\"
 
832
    eval sys_lib_dlsearch_path=\"$sys_lib_dlsearch_path_spec\"
 
833
    
 
834
    avoid_version=no
 
835
    dlfiles=
 
836
    dlprefiles=
 
837
    dlself=no
 
838
    export_dynamic=no
 
839
    export_symbols=
 
840
    export_symbols_regex=
 
841
    generated=
 
842
    libobjs=
 
843
    link_against_libtool_libs=
 
844
    ltlibs=
 
845
    module=no
 
846
    objs=
 
847
    prefer_static_libs=no
 
848
    preload=no
 
849
    prev=
 
850
    prevarg=
 
851
    release=
 
852
    rpath=
 
853
    xrpath=
 
854
    perm_rpath=
 
855
    temp_rpath=
 
856
    thread_safe=no
 
857
    vinfo=
 
858
 
 
859
    # We need to know -static, to get the right output filenames.
 
860
    for arg
 
861
    do
 
862
      case "$arg" in
 
863
      -all-static | -static)
 
864
        if test "X$arg" = "X-all-static"; then
 
865
          if test "$build_libtool_libs" = yes && test -z "$link_static_flag"; then
 
866
            $echo "$modename: warning: complete static linking is impossible in this configuration" 1>&2
 
867
          fi
 
868
          if test -n "$link_static_flag"; then
 
869
            dlopen_self=$dlopen_self_static
 
870
          fi
 
871
        else
 
872
          if test -z "$pic_flag" && test -n "$link_static_flag"; then
 
873
            dlopen_self=$dlopen_self_static
 
874
          fi
 
875
        fi
 
876
        build_libtool_libs=no
 
877
        build_old_libs=yes
 
878
        prefer_static_libs=yes
 
879
        break
 
880
        ;;
 
881
      esac
 
882
    done
 
883
 
 
884
    # See if our shared archives depend on static archives.
 
885
    test -n "$old_archive_from_new_cmds" && build_old_libs=yes
 
886
 
 
887
    # Go through the arguments, transforming them on the way.
 
888
    while test $# -gt 0; do
 
889
      arg="$1"
 
890
      shift
 
891
 
 
892
      # If the previous option needs an argument, assign it.
 
893
      if test -n "$prev"; then
 
894
        case "$prev" in
 
895
        output)
 
896
          compile_command="$compile_command @OUTPUT@"
 
897
          finalize_command="$finalize_command @OUTPUT@"
 
898
          ;;
 
899
        esac
 
900
 
 
901
        case "$prev" in
 
902
        dlfiles|dlprefiles)
 
903
          if test "$preload" = no; then
 
904
            # Add the symbol object into the linking commands.
 
905
            compile_command="$compile_command @SYMFILE@"
 
906
            finalize_command="$finalize_command @SYMFILE@"
 
907
            preload=yes
 
908
          fi
 
909
          case "$arg" in
 
910
          *.la | *.lo) ;;  # We handle these cases below.
 
911
          force)
 
912
            if test "$dlself" = no; then
 
913
              dlself=needless
 
914
              export_dynamic=yes
 
915
            fi
 
916
            prev=
 
917
            continue
 
918
            ;;
 
919
          self)
 
920
            if test "$prev" = dlprefiles; then
 
921
              dlself=yes
 
922
            elif test "$prev" = dlfiles && test "$dlopen_self" != yes; then
 
923
              dlself=yes
 
924
            else
 
925
              dlself=needless
 
926
              export_dynamic=yes
 
927
            fi
 
928
            prev=
 
929
            continue
 
930
            ;;
 
931
          *)
 
932
            if test "$prev" = dlfiles; then
 
933
              dlfiles="$dlfiles $arg"
 
934
            else
 
935
              dlprefiles="$dlprefiles $arg"
 
936
            fi
 
937
            prev=
 
938
            ;;
 
939
          esac
 
940
          ;;
 
941
        expsyms)
 
942
          export_symbols="$arg"
 
943
          if test ! -f "$arg"; then
 
944
            $echo "$modename: symbol file \`$arg' does not exist"
 
945
            exit 1
 
946
          fi
 
947
          prev=
 
948
          continue
 
949
          ;;
 
950
        expsyms_regex)
 
951
          export_symbols_regex="$arg"
 
952
          prev=
 
953
          continue
 
954
          ;;
 
955
        release)
 
956
          release="-$arg"
 
957
          prev=
 
958
          continue
 
959
          ;;
 
960
        rpath | xrpath)
 
961
          # We need an absolute path.
 
962
          case "$arg" in
 
963
          [\\/]* | [A-Za-z]:[\\/]*) ;;
 
964
          *)
 
965
            $echo "$modename: only absolute run-paths are allowed" 1>&2
 
966
            exit 1
 
967
            ;;
 
968
          esac
 
969
          if test "$prev" = rpath; then
 
970
            case "$rpath " in
 
971
            *" $arg "*) ;;
 
972
            *) rpath="$rpath $arg" ;;
 
973
            esac
 
974
          else
 
975
            case "$xrpath " in
 
976
            *" $arg "*) ;;
 
977
            *) xrpath="$xrpath $arg" ;;
 
978
            esac
 
979
          fi
 
980
          prev=
 
981
          continue
 
982
          ;;
 
983
        *)
 
984
          eval "$prev=\"\$arg\""
 
985
          prev=
 
986
          continue
 
987
          ;;
 
988
        esac
 
989
      fi
 
990
 
 
991
      prevarg="$arg"
 
992
 
 
993
      case "$arg" in
 
994
      -all-static)
 
995
        if test -n "$link_static_flag"; then
 
996
          compile_command="$compile_command $link_static_flag"
 
997
          finalize_command="$finalize_command $link_static_flag"
 
998
        fi
 
999
        continue
 
1000
        ;;
 
1001
 
 
1002
      -allow-undefined)
 
1003
        # FIXME: remove this flag sometime in the future.
 
1004
        $echo "$modename: \`-allow-undefined' is deprecated because it is the default" 1>&2
 
1005
        continue
 
1006
        ;;
 
1007
 
 
1008
      -avoid-version)
 
1009
        avoid_version=yes
 
1010
        continue
 
1011
        ;;
 
1012
 
 
1013
      -dlopen)
 
1014
        prev=dlfiles
 
1015
        continue
 
1016
        ;;
 
1017
 
 
1018
      -dlpreopen)
 
1019
        prev=dlprefiles
 
1020
        continue
 
1021
        ;;
 
1022
 
 
1023
      -export-dynamic)
 
1024
        export_dynamic=yes
 
1025
        continue
 
1026
        ;;
 
1027
 
 
1028
      -export-symbols | -export-symbols-regex)
 
1029
        if test -n "$export_symbols" || test -n "$export_symbols_regex"; then
 
1030
          $echo "$modename: not more than one -exported-symbols argument allowed"
 
1031
          exit 1
 
1032
        fi
 
1033
        if test "X$arg" = "X-export-symbols"; then
 
1034
          prev=expsyms
 
1035
        else
 
1036
          prev=expsyms_regex
 
1037
        fi
 
1038
        continue
 
1039
        ;;
 
1040
 
 
1041
      -L*)
 
1042
        dir=`$echo "X$arg" | $Xsed -e 's/^-L//'`
 
1043
        # We need an absolute path.
 
1044
        case "$dir" in
 
1045
        [\\/]* | [A-Za-z]:[\\/]*) ;;
 
1046
        *)
 
1047
          absdir=`cd "$dir" && pwd`
 
1048
          if test -z "$absdir"; then
 
1049
            $echo "$modename: warning: cannot determine absolute directory name of \`$dir'" 1>&2
 
1050
            $echo "$modename: passing it literally to the linker, although it might fail" 1>&2
 
1051
            absdir="$dir"
 
1052
          fi
 
1053
          dir="$absdir"
 
1054
          ;;
 
1055
        esac
 
1056
        case " $deplibs " in
 
1057
        *" $arg "*) ;;
 
1058
        *) deplibs="$deplibs $arg";;
 
1059
        esac
 
1060
        case " $lib_search_path " in
 
1061
        *" $dir "*) ;;
 
1062
        *) lib_search_path="$lib_search_path $dir";;
 
1063
        esac
 
1064
        case "$host" in
 
1065
        *-*-cygwin* | *-*-mingw* | *-*-os2*)
 
1066
          dllsearchdir=`cd "$dir" && pwd || echo "$dir"`
 
1067
          case ":$dllsearchpath:" in
 
1068
          ::) dllsearchpath="$dllsearchdir";;
 
1069
          *":$dllsearchdir:"*) ;;
 
1070
          *) dllsearchpath="$dllsearchpath:$dllsearchdir";;
 
1071
          esac
 
1072
          ;;
 
1073
        esac
 
1074
        ;;
 
1075
 
 
1076
      -l*)
 
1077
        if test "$arg" = "-lc"; then
 
1078
          case "$host" in
 
1079
          *-*-cygwin* | *-*-mingw* | *-*-os2* | *-*-beos*)
 
1080
            # These systems don't actually have c library (as such)
 
1081
            continue
 
1082
            ;;
 
1083
          esac
 
1084
        elif test "$arg" = "-lm"; then
 
1085
          case "$host" in
 
1086
          *-*-cygwin* | *-*-beos*)
 
1087
            # These systems don't actually have math library (as such)
 
1088
            continue
 
1089
            ;;
 
1090
          esac
 
1091
        fi
 
1092
        deplibs="$deplibs $arg"
 
1093
        ;;
 
1094
 
 
1095
      -module)
 
1096
        module=yes
 
1097
        continue
 
1098
        ;;
 
1099
 
 
1100
      -no-undefined)
 
1101
        allow_undefined=no
 
1102
        continue
 
1103
        ;;
 
1104
 
 
1105
      -o) prev=output ;;
 
1106
 
 
1107
      -release)
 
1108
        prev=release
 
1109
        continue
 
1110
        ;;
 
1111
 
 
1112
      -rpath)
 
1113
        prev=rpath
 
1114
        continue
 
1115
        ;;
 
1116
 
 
1117
      -R)
 
1118
        prev=xrpath
 
1119
        continue
 
1120
        ;;
 
1121
 
 
1122
      -R*)
 
1123
        dir=`$echo "X$arg" | $Xsed -e 's/^-R//'`
 
1124
        # We need an absolute path.
 
1125
        case "$dir" in
 
1126
        [\\/]* | [A-Za-z]:[\\/]*) ;;
 
1127
        *)
 
1128
          $echo "$modename: only absolute run-paths are allowed" 1>&2
 
1129
          exit 1
 
1130
          ;;
 
1131
        esac
 
1132
        case "$xrpath " in
 
1133
        *" $dir "*) ;;
 
1134
        *) xrpath="$xrpath $dir" ;;
 
1135
        esac
 
1136
        continue
 
1137
        ;;
 
1138
 
 
1139
      -static)
 
1140
        # If we have no pic_flag, then this is the same as -all-static.
 
1141
        if test -z "$pic_flag" && test -n "$link_static_flag"; then
 
1142
          compile_command="$compile_command $link_static_flag"
 
1143
          finalize_command="$finalize_command $link_static_flag"
 
1144
        fi
 
1145
        continue
 
1146
        ;;
 
1147
 
 
1148
      -thread-safe)
 
1149
        thread_safe=yes
 
1150
        continue
 
1151
        ;;
 
1152
 
 
1153
      -version-info)
 
1154
        prev=vinfo
 
1155
        continue
 
1156
        ;;
 
1157
 
 
1158
      # Some other compiler flag.
 
1159
      -* | +*)
 
1160
        # Unknown arguments in both finalize_command and compile_command need
 
1161
        # to be aesthetically quoted because they are evaled later.
 
1162
        arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`
 
1163
        case "$arg" in
 
1164
        *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \   ]*|*]*)
 
1165
          arg="\"$arg\""
 
1166
          ;;
 
1167
        esac
 
1168
        ;;
 
1169
 
 
1170
      *.o | *.obj | *.a | *.lib)
 
1171
        # A standard object.
 
1172
        objs="$objs $arg"
 
1173
        ;;
 
1174
 
 
1175
      *.lo)
 
1176
        # A library object.
 
1177
        if test "$prev" = dlfiles; then
 
1178
          dlfiles="$dlfiles $arg"
 
1179
          if test "$build_libtool_libs" = yes && test "$dlopen" = yes; then
 
1180
            prev=
 
1181
            continue
 
1182
          else
 
1183
            # If libtool objects are unsupported, then we need to preload.
 
1184
            prev=dlprefiles
 
1185
          fi
 
1186
        fi
 
1187
 
 
1188
        if test "$prev" = dlprefiles; then
 
1189
          # Preload the old-style object.
 
1190
          dlprefiles="$dlprefiles "`$echo "X$arg" | $Xsed -e "$lo2o"`
 
1191
          prev=
 
1192
        fi
 
1193
        libobjs="$libobjs $arg"
 
1194
        ;;
 
1195
 
 
1196
      *.la)
 
1197
        # A libtool-controlled library.
 
1198
 
 
1199
        dlname=
 
1200
        libdir=
 
1201
        library_names=
 
1202
        old_library=
 
1203
 
 
1204
        # Check to see that this really is a libtool archive.
 
1205
        if (sed -e '2q' $arg | egrep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then :
 
1206
        else
 
1207
          $echo "$modename: \`$arg' is not a valid libtool archive" 1>&2
 
1208
          exit 1
 
1209
        fi
 
1210
 
 
1211
        # If the library was installed with an old release of libtool,
 
1212
        # it will not redefine variable installed.
 
1213
        installed=yes
 
1214
 
 
1215
        # Read the .la file
 
1216
        # If there is no directory component, then add one.
 
1217
        case "$arg" in
 
1218
        */* | *\\*) . $arg ;;
 
1219
        *) . ./$arg ;;
 
1220
        esac
 
1221
 
 
1222
        # Get the name of the library we link against.
 
1223
        linklib=
 
1224
        for l in $old_library $library_names; do
 
1225
          linklib="$l"
 
1226
        done
 
1227
 
 
1228
        if test -z "$linklib"; then
 
1229
          $echo "$modename: cannot find name of link library for \`$arg'" 1>&2
 
1230
          exit 1
 
1231
        fi
 
1232
 
 
1233
        # Find the relevant object directory and library name.
 
1234
        name=`$echo "X$arg" | $Xsed -e 's%^.*/%%' -e 's/\.la$//' -e 's/^lib//'`
 
1235
 
 
1236
        if test "X$installed" = Xyes; then
 
1237
          dir="$libdir"
 
1238
        else
 
1239
          dir=`$echo "X$arg" | $Xsed -e 's%/[^/]*$%%'`
 
1240
          if test "X$dir" = "X$arg"; then
 
1241
            dir="$objdir"
 
1242
          else
 
1243
            dir="$dir/$objdir"
 
1244
          fi
 
1245
        fi
 
1246
 
 
1247
        if test -n "$dependency_libs"; then
 
1248
          # Extract -R and -L from dependency_libs
 
1249
          temp_deplibs=
 
1250
          for deplib in $dependency_libs; do
 
1251
            case "$deplib" in
 
1252
            -R*) temp_xrpath=`$echo "X$deplib" | $Xsed -e 's/^-R//'`
 
1253
                 case " $rpath $xrpath " in
 
1254
                 *" $temp_xrpath "*) ;;
 
1255
                 *) xrpath="$xrpath $temp_xrpath";;
 
1256
                 esac;;
 
1257
            -L*) case "$compile_command $temp_deplibs " in
 
1258
                 *" $deplib "*) ;;
 
1259
                 *) temp_deplibs="$temp_deplibs $deplib";;
 
1260
                 esac
 
1261
                 temp_dir=`$echo "X$deplib" | $Xsed -e 's/^-L//'`
 
1262
                 case " $lib_search_path " in
 
1263
                 *" $temp_dir "*) ;;
 
1264
                 *) lib_search_path="$lib_search_path $temp_dir";;
 
1265
                 esac
 
1266
                 ;;
 
1267
            *) temp_deplibs="$temp_deplibs $deplib";;
 
1268
            esac
 
1269
          done
 
1270
          dependency_libs="$temp_deplibs"
 
1271
        fi
 
1272
 
 
1273
        if test -z "$libdir"; then
 
1274
          # It is a libtool convenience library, so add in its objects.
 
1275
          convenience="$convenience $dir/$old_library"
 
1276
          old_convenience="$old_convenience $dir/$old_library"
 
1277
          deplibs="$deplibs$dependency_libs"
 
1278
          compile_command="$compile_command $dir/$old_library$dependency_libs"
 
1279
          finalize_command="$finalize_command $dir/$old_library$dependency_libs"
 
1280
          continue
 
1281
        fi
 
1282
 
 
1283
        # This library was specified with -dlopen.
 
1284
        if test "$prev" = dlfiles; then
 
1285
          dlfiles="$dlfiles $arg"
 
1286
          if test -z "$dlname" || test "$dlopen" != yes || test "$build_libtool_libs" = no; then
 
1287
            # If there is no dlname, no dlopen support or we're linking statically,
 
1288
            # we need to preload.
 
1289
            prev=dlprefiles
 
1290
          else
 
1291
            # We should not create a dependency on this library, but we
 
1292
            # may need any libraries it requires.
 
1293
            compile_command="$compile_command$dependency_libs"
 
1294
            finalize_command="$finalize_command$dependency_libs"
 
1295
            prev=
 
1296
            continue
 
1297
          fi
 
1298
        fi
 
1299
 
 
1300
        # The library was specified with -dlpreopen.
 
1301
        if test "$prev" = dlprefiles; then
 
1302
          # Prefer using a static library (so that no silly _DYNAMIC symbols
 
1303
          # are required to link).
 
1304
          if test -n "$old_library"; then
 
1305
            dlprefiles="$dlprefiles $dir/$old_library"
 
1306
          else
 
1307
            dlprefiles="$dlprefiles $dir/$linklib"
 
1308
          fi
 
1309
          prev=
 
1310
        fi
 
1311
 
 
1312
        if test -n "$library_names" &&
 
1313
           { test "$prefer_static_libs" = no || test -z "$old_library"; }; then
 
1314
          link_against_libtool_libs="$link_against_libtool_libs $arg"
 
1315
          if test -n "$shlibpath_var"; then
 
1316
            # Make sure the rpath contains only unique directories.
 
1317
            case "$temp_rpath " in
 
1318
            *" $dir "*) ;;
 
1319
            *) temp_rpath="$temp_rpath $dir" ;;
 
1320
            esac
 
1321
          fi
 
1322
 
 
1323
          # We need an absolute path.
 
1324
          case "$dir" in
 
1325
          [\\/] | [A-Za-z]:[\\/]*) absdir="$dir" ;;
 
1326
          *)
 
1327
            absdir=`cd "$dir" && pwd`
 
1328
            if test -z "$absdir"; then
 
1329
              $echo "$modename: warning: cannot determine absolute directory name of \`$dir'" 1>&2
 
1330
              $echo "$modename: passing it literally to the linker, although it might fail" 1>&2
 
1331
              absdir="$dir"
 
1332
            fi
 
1333
            ;;
 
1334
          esac
 
1335
          
 
1336
          # This is the magic to use -rpath.
 
1337
          # Skip directories that are in the system default run-time
 
1338
          # search path, unless they have been requested with -R.
 
1339
          case " $sys_lib_dlsearch_path " in
 
1340
          *" $absdir "*) ;;
 
1341
          *)
 
1342
            case "$compile_rpath " in
 
1343
            *" $absdir "*) ;;
 
1344
            *) compile_rpath="$compile_rpath $absdir" 
 
1345
            esac
 
1346
            ;;
 
1347
          esac
 
1348
 
 
1349
          case " $sys_lib_dlsearch_path " in
 
1350
          *" $libdir "*) ;;
 
1351
          *)
 
1352
            case "$finalize_rpath " in
 
1353
            *" $libdir "*) ;;
 
1354
            *) finalize_rpath="$finalize_rpath $libdir"
 
1355
            esac
 
1356
            ;;
 
1357
          esac
 
1358
 
 
1359
          lib_linked=yes
 
1360
          case "$hardcode_action" in
 
1361
          immediate | unsupported)
 
1362
            if test "$hardcode_direct" = no; then
 
1363
              compile_command="$compile_command $dir/$linklib"
 
1364
              deplibs="$deplibs $dir/$linklib"
 
1365
              case "$host" in
 
1366
              *-*-cygwin* | *-*-mingw* | *-*-os2*)
 
1367
                dllsearchdir=`cd "$dir" && pwd || echo "$dir"`
 
1368
                if test -n "$dllsearchpath"; then
 
1369
                  dllsearchpath="$dllsearchpath:$dllsearchdir"
 
1370
                else
 
1371
                  dllsearchpath="$dllsearchdir"
 
1372
                fi
 
1373
                ;;
 
1374
              esac
 
1375
            elif test "$hardcode_minus_L" = no; then
 
1376
              case "$host" in
 
1377
              *-*-sunos*)
 
1378
                compile_shlibpath="$compile_shlibpath$dir:"
 
1379
                ;;
 
1380
              esac
 
1381
              case "$compile_command " in
 
1382
              *" -L$dir "*) ;;
 
1383
              *) compile_command="$compile_command -L$dir";;
 
1384
              esac
 
1385
              compile_command="$compile_command -l$name"
 
1386
              deplibs="$deplibs -L$dir -l$name"
 
1387
            elif test "$hardcode_shlibpath_var" = no; then
 
1388
              case ":$compile_shlibpath:" in
 
1389
              *":$dir:"*) ;;
 
1390
              *) compile_shlibpath="$compile_shlibpath$dir:";;
 
1391
              esac
 
1392
              compile_command="$compile_command -l$name"
 
1393
              deplibs="$deplibs -l$name"
 
1394
            else
 
1395
              lib_linked=no
 
1396
            fi
 
1397
            ;;
 
1398
 
 
1399
          relink)
 
1400
            if test "$hardcode_direct" = yes; then
 
1401
              compile_command="$compile_command $absdir/$linklib"
 
1402
              deplibs="$deplibs $absdir/$linklib"
 
1403
            elif test "$hardcode_minus_L" = yes; then
 
1404
              case "$compile_command " in
 
1405
              *" -L$absdir "*) ;;
 
1406
              *) compile_command="$compile_command -L$absdir";;
 
1407
              esac
 
1408
              compile_command="$compile_command -l$name"
 
1409
              deplibs="$deplibs -L$absdir -l$name"
 
1410
            elif test "$hardcode_shlibpath_var" = yes; then
 
1411
              case ":$compile_shlibpath:" in
 
1412
              *":$absdir:"*) ;;
 
1413
              *) compile_shlibpath="$compile_shlibpath$absdir:";;
 
1414
              esac
 
1415
              compile_command="$compile_command -l$name"
 
1416
              deplibs="$deplibs -l$name"
 
1417
            else
 
1418
              lib_linked=no
 
1419
            fi
 
1420
            ;;
 
1421
 
 
1422
          *)
 
1423
            lib_linked=no
 
1424
            ;;
 
1425
          esac
 
1426
 
 
1427
          if test "$lib_linked" != yes; then
 
1428
            $echo "$modename: configuration error: unsupported hardcode properties"
 
1429
            exit 1
 
1430
          fi
 
1431
 
 
1432
          # Finalize command for both is simple: just hardcode it.
 
1433
          if test "$hardcode_direct" = yes; then
 
1434
            finalize_command="$finalize_command $libdir/$linklib"
 
1435
          elif test "$hardcode_minus_L" = yes; then
 
1436
            case "$finalize_command " in
 
1437
            *" -L$libdir "*) ;;
 
1438
            *) finalize_command="$finalize_command -L$libdir";;
 
1439
            esac
 
1440
            finalize_command="$finalize_command -l$name"
 
1441
          elif test "$hardcode_shlibpath_var" = yes; then
 
1442
            case ":$finalize_shlibpath:" in
 
1443
            *":$libdir:"*) ;;
 
1444
            *) finalize_shlibpath="$finalize_shlibpath$libdir:";;
 
1445
            esac
 
1446
            finalize_command="$finalize_command -l$name"
 
1447
          else
 
1448
            # We cannot seem to hardcode it, guess we'll fake it.
 
1449
            case "$finalize_command " in
 
1450
            *" -L$dir "*) ;;
 
1451
            *) finalize_command="$finalize_command -L$libdir";;
 
1452
            esac
 
1453
            finalize_command="$finalize_command -l$name"
 
1454
          fi
 
1455
        else
 
1456
          # Transform directly to old archives if we don't build new libraries.
 
1457
          if test -n "$pic_flag" && test -z "$old_library"; then
 
1458
            $echo "$modename: cannot find static library for \`$arg'" 1>&2
 
1459
            exit 1
 
1460
          fi
 
1461
 
 
1462
          # Here we assume that one of hardcode_direct or hardcode_minus_L
 
1463
          # is not unsupported.  This is valid on all known static and
 
1464
          # shared platforms.
 
1465
          if test "$hardcode_direct" != unsupported; then
 
1466
            test -n "$old_library" && linklib="$old_library"
 
1467
            compile_command="$compile_command $dir/$linklib"
 
1468
            finalize_command="$finalize_command $dir/$linklib"
 
1469
          else
 
1470
            case "$compile_command " in
 
1471
            *" -L$dir "*) ;;
 
1472
            *) compile_command="$compile_command -L$dir";;
 
1473
            esac
 
1474
            compile_command="$compile_command -l$name"
 
1475
            case "$finalize_command " in
 
1476
            *" -L$dir "*) ;;
 
1477
            *) finalize_command="$finalize_command -L$dir";;
 
1478
            esac
 
1479
            finalize_command="$finalize_command -l$name"
 
1480
          fi
 
1481
        fi
 
1482
 
 
1483
        # Add in any libraries that this one depends upon.
 
1484
        compile_command="$compile_command$dependency_libs"
 
1485
        finalize_command="$finalize_command$dependency_libs"
 
1486
        continue
 
1487
        ;;
 
1488
 
 
1489
      # Some other compiler argument.
 
1490
      *)
 
1491
        # Unknown arguments in both finalize_command and compile_command need
 
1492
        # to be aesthetically quoted because they are evaled later.
 
1493
        arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`
 
1494
        case "$arg" in
 
1495
        *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \   ]*|*]*)
 
1496
          arg="\"$arg\""
 
1497
          ;;
 
1498
        esac
 
1499
        ;;
 
1500
      esac
 
1501
 
 
1502
      # Now actually substitute the argument into the commands.
 
1503
      if test -n "$arg"; then
 
1504
        compile_command="$compile_command $arg"
 
1505
        finalize_command="$finalize_command $arg"
 
1506
      fi
 
1507
    done
 
1508
 
 
1509
    if test -n "$prev"; then
 
1510
      $echo "$modename: the \`$prevarg' option requires an argument" 1>&2
 
1511
      $echo "$help" 1>&2
 
1512
      exit 1
 
1513
    fi
 
1514
 
 
1515
    if test "$export_dynamic" = yes && test -n "$export_dynamic_flag_spec"; then
 
1516
      eval arg=\"$export_dynamic_flag_spec\"
 
1517
      compile_command="$compile_command $arg"
 
1518
      finalize_command="$finalize_command $arg"
 
1519
    fi
 
1520
 
 
1521
    oldlibs=
 
1522
    # calculate the name of the file, without its directory
 
1523
    outputname=`$echo "X$output" | $Xsed -e 's%^.*/%%'`
 
1524
    libobjs_save="$libobjs"
 
1525
 
 
1526
    case "$output" in
 
1527
    "")
 
1528
      $echo "$modename: you must specify an output file" 1>&2
 
1529
      $echo "$help" 1>&2
 
1530
      exit 1
 
1531
      ;;
 
1532
 
 
1533
    *.a | *.lib)
 
1534
      if test -n "$link_against_libtool_libs"; then
 
1535
        $echo "$modename: error: cannot link libtool libraries into archives" 1>&2
 
1536
        exit 1
 
1537
      fi
 
1538
 
 
1539
      if test -n "$deplibs"; then
 
1540
        $echo "$modename: warning: \`-l' and \`-L' are ignored for archives" 1>&2
 
1541
      fi
 
1542
 
 
1543
      if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then
 
1544
        $echo "$modename: warning: \`-dlopen' is ignored for archives" 1>&2
 
1545
      fi
 
1546
 
 
1547
      if test -n "$rpath"; then
 
1548
        $echo "$modename: warning: \`-rpath' is ignored for archives" 1>&2
 
1549
      fi
 
1550
 
 
1551
      if test -n "$xrpath"; then
 
1552
        $echo "$modename: warning: \`-R' is ignored for archives" 1>&2
 
1553
      fi
 
1554
 
 
1555
      if test -n "$vinfo"; then
 
1556
        $echo "$modename: warning: \`-version-info' is ignored for archives" 1>&2
 
1557
      fi
 
1558
 
 
1559
      if test -n "$release"; then
 
1560
        $echo "$modename: warning: \`-release' is ignored for archives" 1>&2
 
1561
      fi
 
1562
 
 
1563
      if test -n "$export_symbols" || test -n "$export_symbols_regex"; then
 
1564
        $echo "$modename: warning: \`-export-symbols' is ignored for archives" 1>&2
 
1565
      fi
 
1566
 
 
1567
      # Now set the variables for building old libraries.
 
1568
      build_libtool_libs=no
 
1569
      oldlibs="$output"
 
1570
      ;;
 
1571
 
 
1572
    *.la)
 
1573
      # Make sure we only generate libraries of the form `libNAME.la'.
 
1574
      case "$outputname" in
 
1575
      lib*)
 
1576
        name=`$echo "X$outputname" | $Xsed -e 's/\.la$//' -e 's/^lib//'`
 
1577
        eval libname=\"$libname_spec\"
 
1578
        ;;
 
1579
      *)
 
1580
        if test "$module" = no; then
 
1581
          $echo "$modename: libtool library \`$output' must begin with \`lib'" 1>&2
 
1582
          $echo "$help" 1>&2
 
1583
          exit 1
 
1584
        fi
 
1585
        if test "$need_lib_prefix" != no; then
 
1586
          # Add the "lib" prefix for modules if required
 
1587
          name=`$echo "X$outputname" | $Xsed -e 's/\.la$//'`
 
1588
          eval libname=\"$libname_spec\"
 
1589
        else
 
1590
          libname=`$echo "X$outputname" | $Xsed -e 's/\.la$//'`
 
1591
        fi
 
1592
        ;;
 
1593
      esac
 
1594
 
 
1595
      output_objdir=`$echo "X$output" | $Xsed -e 's%/[^/]*$%%'`
 
1596
      if test "X$output_objdir" = "X$output"; then
 
1597
        output_objdir="$objdir"
 
1598
      else
 
1599
        output_objdir="$output_objdir/$objdir"
 
1600
      fi
 
1601
 
 
1602
      if test -n "$objs"; then
 
1603
        $echo "$modename: cannot build libtool library \`$output' from non-libtool objects:$objs" 2>&1
 
1604
        exit 1
 
1605
      fi
 
1606
 
 
1607
      # How the heck are we supposed to write a wrapper for a shared library?
 
1608
      if test -n "$link_against_libtool_libs"; then
 
1609
         $echo "$modename: error: cannot link shared libraries into libtool libraries" 1>&2
 
1610
         exit 1
 
1611
      fi
 
1612
 
 
1613
      if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then
 
1614
        $echo "$modename: warning: \`-dlopen' is ignored for libtool libraries" 1>&2
 
1615
      fi
 
1616
 
 
1617
      set dummy $rpath
 
1618
      if test $# -gt 2; then
 
1619
        $echo "$modename: warning: ignoring multiple \`-rpath's for a libtool library" 1>&2
 
1620
      fi
 
1621
      install_libdir="$2"
 
1622
 
 
1623
      oldlibs=
 
1624
      if test -z "$rpath"; then
 
1625
        if test "$build_libtool_libs" = yes; then
 
1626
          # Building a libtool convenience library.
 
1627
          libext=al
 
1628
          oldlibs="$output_objdir/$libname.$libext $oldlibs"
 
1629
          build_libtool_libs=convenience
 
1630
          build_old_libs=yes
 
1631
        fi
 
1632
        dependency_libs="$deplibs"
 
1633
 
 
1634
        if test -n "$vinfo"; then
 
1635
          $echo "$modename: warning: \`-version-info' is ignored for convenience libraries" 1>&2
 
1636
        fi
 
1637
 
 
1638
        if test -n "$release"; then
 
1639
          $echo "$modename: warning: \`-release' is ignored for convenience libraries" 1>&2
 
1640
        fi
 
1641
      else
 
1642
 
 
1643
        # Parse the version information argument.
 
1644
        IFS="${IFS=     }"; save_ifs="$IFS"; IFS=':'
 
1645
        set dummy $vinfo 0 0 0
 
1646
        IFS="$save_ifs"
 
1647
 
 
1648
        if test -n "$8"; then
 
1649
          $echo "$modename: too many parameters to \`-version-info'" 1>&2
 
1650
          $echo "$help" 1>&2
 
1651
          exit 1
 
1652
        fi
 
1653
 
 
1654
        current="$2"
 
1655
        revision="$3"
 
1656
        age="$4"
 
1657
 
 
1658
        # Check that each of the things are valid numbers.
 
1659
        case "$current" in
 
1660
        0 | [1-9] | [1-9][0-9]*) ;;
 
1661
        *)
 
1662
          $echo "$modename: CURRENT \`$current' is not a nonnegative integer" 1>&2
 
1663
          $echo "$modename: \`$vinfo' is not valid version information" 1>&2
 
1664
          exit 1
 
1665
          ;;
 
1666
        esac
 
1667
 
 
1668
        case "$revision" in
 
1669
        0 | [1-9] | [1-9][0-9]*) ;;
 
1670
        *)
 
1671
          $echo "$modename: REVISION \`$revision' is not a nonnegative integer" 1>&2
 
1672
          $echo "$modename: \`$vinfo' is not valid version information" 1>&2
 
1673
          exit 1
 
1674
          ;;
 
1675
        esac
 
1676
 
 
1677
        case "$age" in
 
1678
        0 | [1-9] | [1-9][0-9]*) ;;
 
1679
        *)
 
1680
          $echo "$modename: AGE \`$age' is not a nonnegative integer" 1>&2
 
1681
          $echo "$modename: \`$vinfo' is not valid version information" 1>&2
 
1682
          exit 1
 
1683
          ;;
 
1684
        esac
 
1685
 
 
1686
        if test $age -gt $current; then
 
1687
          $echo "$modename: AGE \`$age' is greater than the current interface number \`$current'" 1>&2
 
1688
          $echo "$modename: \`$vinfo' is not valid version information" 1>&2
 
1689
          exit 1
 
1690
        fi
 
1691
 
 
1692
        # Calculate the version variables.
 
1693
        major=
 
1694
        versuffix=
 
1695
        verstring=
 
1696
        case "$version_type" in
 
1697
        none) ;;
 
1698
 
 
1699
        irix)
 
1700
          major=`expr $current - $age + 1`
 
1701
          versuffix="$major.$revision"
 
1702
          verstring="sgi$major.$revision"
 
1703
 
 
1704
          # Add in all the interfaces that we are compatible with.
 
1705
          loop=$revision
 
1706
          while test $loop != 0; do
 
1707
            iface=`expr $revision - $loop`
 
1708
            loop=`expr $loop - 1`
 
1709
            verstring="sgi$major.$iface:$verstring"
 
1710
          done
 
1711
          ;;
 
1712
 
 
1713
        linux)
 
1714
          major=.`expr $current - $age`
 
1715
          versuffix="$major.$age.$revision"
 
1716
          ;;
 
1717
 
 
1718
        osf)
 
1719
          major=`expr $current - $age`
 
1720
          versuffix=".$current.$age.$revision"
 
1721
          verstring="$current.$age.$revision"
 
1722
 
 
1723
          # Add in all the interfaces that we are compatible with.
 
1724
          loop=$age
 
1725
          while test $loop != 0; do
 
1726
            iface=`expr $current - $loop`
 
1727
            loop=`expr $loop - 1`
 
1728
            verstring="$verstring:${iface}.0"
 
1729
          done
 
1730
 
 
1731
          # Make executables depend on our current version.
 
1732
          verstring="$verstring:${current}.0"
 
1733
          ;;
 
1734
 
 
1735
        sunos)
 
1736
          major=".$current"
 
1737
          versuffix=".$current.$revision"
 
1738
          ;;
 
1739
 
 
1740
        freebsd-aout)
 
1741
          major=".$current"
 
1742
          versuffix=".$current.$revision";
 
1743
          ;;
 
1744
 
 
1745
        freebsd-elf)
 
1746
          major=".$current"
 
1747
          versuffix=".$current";
 
1748
          ;;
 
1749
 
 
1750
        windows)
 
1751
          # Like Linux, but with '-' rather than '.', since we only
 
1752
          # want one extension on Windows 95.
 
1753
          major=`expr $current - $age`
 
1754
          versuffix="-$major-$age-$revision"
 
1755
          ;;
 
1756
 
 
1757
        *)
 
1758
          $echo "$modename: unknown library version type \`$version_type'" 1>&2
 
1759
          echo "Fatal configuration error.  See the $PACKAGE docs for more information." 1>&2
 
1760
          exit 1
 
1761
          ;;
 
1762
        esac
 
1763
 
 
1764
        # Clear the version info if we defaulted, and they specified a release.
 
1765
        if test -z "$vinfo" && test -n "$release"; then
 
1766
          major=
 
1767
          verstring="0.0"
 
1768
          if test "$need_version" = no; then
 
1769
            versuffix=
 
1770
          else
 
1771
            versuffix=".0.0"
 
1772
          fi
 
1773
        fi
 
1774
 
 
1775
        # Remove version info from name if versioning should be avoided
 
1776
        if test "$avoid_version" = yes && test "$need_version" = no; then
 
1777
          major=
 
1778
          versuffix=
 
1779
          verstring=""
 
1780
        fi
 
1781
        
 
1782
        # Check to see if the archive will have undefined symbols.
 
1783
        if test "$allow_undefined" = yes; then
 
1784
          if test "$allow_undefined_flag" = unsupported; then
 
1785
            $echo "$modename: warning: undefined symbols not allowed in $host shared libraries" 1>&2
 
1786
            build_libtool_libs=no
 
1787
            build_old_libs=yes
 
1788
          fi
 
1789
        else
 
1790
          # Don't allow undefined symbols.
 
1791
          allow_undefined_flag="$no_undefined_flag"
 
1792
        fi
 
1793
 
 
1794
        dependency_libs="$deplibs"
 
1795
        case "$host" in
 
1796
        *-*-cygwin* | *-*-mingw* | *-*-os2* | *-*-beos*)
 
1797
          # these systems don't actually have a c library (as such)!
 
1798
          ;;
 
1799
        *-*-rhapsody*)
 
1800
          # rhapsody is a little odd...
 
1801
          deplibs="$deplibs -framework System"
 
1802
          ;;
 
1803
        *)
 
1804
          # Add libc to deplibs on all other systems.
 
1805
          deplibs="$deplibs -lc"
 
1806
          ;;
 
1807
        esac
 
1808
      fi
 
1809
 
 
1810
      # Create the output directory, or remove our outputs if we need to.
 
1811
      if test -d $output_objdir; then
 
1812
        $show "${rm}r $output_objdir/$outputname $output_objdir/$libname.* $output_objdir/${libname}${release}.*"
 
1813
        $run ${rm}r $output_objdir/$outputname $output_objdir/$libname.* $output_objdir/${libname}${release}.*
 
1814
      else
 
1815
        $show "$mkdir $output_objdir"
 
1816
        $run $mkdir $output_objdir
 
1817
        status=$?
 
1818
        if test $status -ne 0 && test ! -d $output_objdir; then
 
1819
          exit $status
 
1820
        fi
 
1821
      fi
 
1822
 
 
1823
      # Now set the variables for building old libraries.
 
1824
      if test "$build_old_libs" = yes && test "$build_libtool_libs" != convenience ; then
 
1825
        oldlibs="$oldlibs $output_objdir/$libname.$libext"
 
1826
 
 
1827
        # Transform .lo files to .o files.
 
1828
        oldobjs="$objs "`$echo "X$libobjs" | $SP2NL | $Xsed -e '/\.'${libext}'$/d' -e "$lo2o" | $NL2SP`
 
1829
      fi
 
1830
 
 
1831
      if test "$build_libtool_libs" = yes; then
 
1832
        # Transform deplibs into only deplibs that can be linked in shared.
 
1833
        name_save=$name
 
1834
        libname_save=$libname
 
1835
        release_save=$release
 
1836
        versuffix_save=$versuffix
 
1837
        major_save=$major
 
1838
        # I'm not sure if I'm treating the release correctly.  I think
 
1839
        # release should show up in the -l (ie -lgmp5) so we don't want to
 
1840
        # add it in twice.  Is that correct?
 
1841
        release=""
 
1842
        versuffix=""
 
1843
        major=""
 
1844
        newdeplibs=
 
1845
        droppeddeps=no
 
1846
        case "$deplibs_check_method" in
 
1847
        pass_all)
 
1848
          # Don't check for shared/static.  Everything works.
 
1849
          # This might be a little naive.  We might want to check
 
1850
          # whether the library exists or not.  But this is on
 
1851
          # osf3 & osf4 and I'm not really sure... Just
 
1852
          # implementing what was already the behaviour.
 
1853
          newdeplibs=$deplibs
 
1854
          ;;
 
1855
        test_compile)
 
1856
          # This code stresses the "libraries are programs" paradigm to its
 
1857
          # limits. Maybe even breaks it.  We compile a program, linking it
 
1858
          # against the deplibs as a proxy for the library.  Then we can check
 
1859
          # whether they linked in statically or dynamically with ldd.
 
1860
          $rm conftest.c
 
1861
          cat > conftest.c <<EOF
 
1862
          int main() { return 0; }
 
1863
EOF
 
1864
          $rm conftest
 
1865
          $CC -o conftest conftest.c $deplibs
 
1866
          if test $? -eq 0 ; then
 
1867
            ldd_output=`ldd conftest`
 
1868
            for i in $deplibs; do
 
1869
              name="`expr $i : '-l\(.*\)'`"
 
1870
              # If $name is empty we are operating on a -L argument.
 
1871
              if test "$name" != "" ; then
 
1872
                libname=`eval \\$echo \"$libname_spec\"`
 
1873
                deplib_matches=`eval \\$echo \"$library_names_spec\"`
 
1874
                set dummy $deplib_matches
 
1875
                deplib_match=$2
 
1876
                if test `expr "$ldd_output" : ".*$deplib_match"` -ne 0 ; then
 
1877
                  newdeplibs="$newdeplibs $i"
 
1878
                else
 
1879
                  droppeddeps=yes
 
1880
                  echo
 
1881
                  echo "*** Warning: This library needs some functionality provided by $i."
 
1882
                  echo "*** I have the capability to make that library automatically link in when"
 
1883
                  echo "*** you link to this library.  But I can only do this if you have a"
 
1884
                  echo "*** shared version of the library, which you do not appear to have."
 
1885
                fi
 
1886
              else
 
1887
                newdeplibs="$newdeplibs $i"
 
1888
              fi
 
1889
            done
 
1890
          else
 
1891
            # Error occured in the first compile.  Let's try to salvage the situation:
 
1892
            # Compile a seperate program for each library.
 
1893
            for i in $deplibs; do
 
1894
              name="`expr $i : '-l\(.*\)'`"
 
1895
             # If $name is empty we are operating on a -L argument.
 
1896
              if test "$name" != "" ; then
 
1897
                $rm conftest
 
1898
                $CC -o conftest conftest.c $i
 
1899
                # Did it work?
 
1900
                if test $? -eq 0 ; then
 
1901
                  ldd_output=`ldd conftest`
 
1902
                  libname=`eval \\$echo \"$libname_spec\"`
 
1903
                  deplib_matches=`eval \\$echo \"$library_names_spec\"`
 
1904
                  set dummy $deplib_matches
 
1905
                  deplib_match=$2
 
1906
                  if test `expr "$ldd_output" : ".*$deplib_match"` -ne 0 ; then
 
1907
                    newdeplibs="$newdeplibs $i"
 
1908
                  else
 
1909
                    droppeddeps=yes
 
1910
                    echo
 
1911
                    echo "*** Warning: This library needs some functionality provided by $i."
 
1912
                    echo "*** I have the capability to make that library automatically link in when"
 
1913
                    echo "*** you link to this library.  But I can only do this if you have a"
 
1914
                    echo "*** shared version of the library, which you do not appear to have."
 
1915
                  fi
 
1916
                else
 
1917
                  droppeddeps=yes
 
1918
                  echo
 
1919
                  echo "*** Warning!  Library $i is needed by this library but I was not able to"
 
1920
                  echo "***  make it link in!  You will probably need to install it or some"
 
1921
                  echo "*** library that it depends on before this library will be fully"
 
1922
                  echo "*** functional.  Installing it before continuing would be even better."
 
1923
                fi
 
1924
              else
 
1925
                newdeplibs="$newdeplibs $i"
 
1926
              fi
 
1927
            done
 
1928
          fi
 
1929
          ;;
 
1930
        file_magic*)
 
1931
          set dummy $deplibs_check_method
 
1932
          file_magic_regex="`expr \"$deplibs_check_method\" : \"$2 \(.*\)\"`"
 
1933
          for a_deplib in $deplibs; do
 
1934
            name="`expr $a_deplib : '-l\(.*\)'`"
 
1935
            # If $name is empty we are operating on a -L argument.
 
1936
            if test "$name" != "" ; then
 
1937
              libname=`eval \\$echo \"$libname_spec\"`
 
1938
              for i in $lib_search_path; do
 
1939
                    potential_libs=`ls $i/$libname[.-]* 2>/dev/null`
 
1940
                    for potent_lib in $potential_libs; do
 
1941
                      # Follow soft links.
 
1942
                      if ls -lLd "$potent_lib" 2>/dev/null \
 
1943
                         | grep " -> " >/dev/null; then
 
1944
                        continue 
 
1945
                      fi
 
1946
                      # The statement above tries to avoid entering an
 
1947
                      # endless loop below, in case of cyclic links.
 
1948
                      # We might still enter an endless loop, since a link
 
1949
                      # loop can be closed while we follow links,
 
1950
                      # but so what?
 
1951
                      potlib="$potent_lib"
 
1952
                      while test -h "$potlib" 2>/dev/null; do
 
1953
                        potliblink=`ls -ld $potlib | sed 's/.* -> //'`
 
1954
                        case "$potliblink" in
 
1955
                        [\\/]* | [A-Za-z]:[\\/]*) potlib="$potliblink";;
 
1956
                        *) potlib=`$echo "X$potlib" | $Xsed -e 's,[^/]*$,,'`"$potliblink";;
 
1957
                        esac
 
1958
                      done
 
1959
                      if eval $file_magic_cmd \"\$potlib\" 2>/dev/null \
 
1960
                         | sed 10q \
 
1961
                         | egrep "$file_magic_regex" > /dev/null; then
 
1962
                        newdeplibs="$newdeplibs $a_deplib"
 
1963
                        a_deplib=""
 
1964
                        break 2
 
1965
                      fi
 
1966
                    done
 
1967
              done
 
1968
              if test -n "$a_deplib" ; then
 
1969
                droppeddeps=yes
 
1970
                echo
 
1971
                echo "*** Warning: This library needs some functionality provided by $a_deplib."
 
1972
                echo "*** I have the capability to make that library automatically link in when"
 
1973
                echo "*** you link to this library.  But I can only do this if you have a"
 
1974
                echo "*** shared version of the library, which you do not appear to have."
 
1975
              fi
 
1976
            else
 
1977
              # Add a -L argument.
 
1978
              newdeplibs="$newdeplibs $a_deplib"
 
1979
            fi
 
1980
          done # Gone through all deplibs.
 
1981
          ;;
 
1982
        none | unknown | *)
 
1983
          newdeplibs=""
 
1984
          if $echo "X $deplibs" | $Xsed -e 's/ -lc$//' \
 
1985
               -e 's/ -[LR][^ ]*//g' -e 's/[    ]//g' |
 
1986
             grep . >/dev/null; then
 
1987
            echo
 
1988
            if test "X$deplibs_check_method" = "Xnone"; then
 
1989
              echo "*** Warning: inter-library dependencies are not supported in this platform."
 
1990
            else
 
1991
              echo "*** Warning: inter-library dependencies are not known to be supported."
 
1992
            fi
 
1993
            echo "*** All declared inter-library dependencies are being dropped."
 
1994
            droppeddeps=yes
 
1995
          fi
 
1996
          ;;
 
1997
        esac
 
1998
        versuffix=$versuffix_save
 
1999
        major=$major_save
 
2000
        release=$release_save
 
2001
        libname=$libname_save
 
2002
        name=$name_save
 
2003
 
 
2004
        if test "$droppeddeps" = yes; then
 
2005
          if test "$module" = yes; then
 
2006
            echo
 
2007
            echo "*** Warning: libtool could not satisfy all declared inter-library"
 
2008
            echo "*** dependencies of module $libname.  Therefore, libtool will create"
 
2009
            echo "*** a static module, that should work as long as the dlopening"
 
2010
            echo "*** application is linked with the -dlopen flag."
 
2011
            if test -z "$global_symbol_pipe"; then
 
2012
              echo
 
2013
              echo "*** However, this would only work if libtool was able to extract symbol"
 
2014
              echo "*** lists from a program, using \`nm' or equivalent, but libtool could"
 
2015
              echo "*** not find such a program.  So, this module is probably useless."
 
2016
              echo "*** \`nm' from GNU binutils and a full rebuild may help."
 
2017
            fi
 
2018
            if test "$build_old_libs" = no; then
 
2019
              oldlibs="$output_objdir/$libname.$libext"
 
2020
              build_libtool_libs=module
 
2021
              build_old_libs=yes
 
2022
            else
 
2023
              build_libtool_libs=no
 
2024
            fi
 
2025
          else
 
2026
            echo "*** The inter-library dependencies that have been dropped here will be"
 
2027
            echo "*** automatically added whenever a program is linked with this library"
 
2028
            echo "*** or is declared to -dlopen it."
 
2029
          fi
 
2030
        fi
 
2031
        # Done checking deplibs!
 
2032
        deplibs=$newdeplibs
 
2033
      fi
 
2034
 
 
2035
      # All the library-specific variables (install_libdir is set above).
 
2036
      library_names=
 
2037
      old_library=
 
2038
      dlname=
 
2039
      
 
2040
      # Test again, we may have decided not to build it any more
 
2041
      if test "$build_libtool_libs" = yes; then
 
2042
        # Get the real and link names of the library.
 
2043
        eval library_names=\"$library_names_spec\"
 
2044
        set dummy $library_names
 
2045
        realname="$2"
 
2046
        shift; shift
 
2047
 
 
2048
        if test -n "$soname_spec"; then
 
2049
          eval soname=\"$soname_spec\"
 
2050
        else
 
2051
          soname="$realname"
 
2052
        fi
 
2053
 
 
2054
        lib="$output_objdir/$realname"
 
2055
        for link
 
2056
        do
 
2057
          linknames="$linknames $link"
 
2058
        done
 
2059
 
 
2060
        # Ensure that we have .o objects for linkers which dislike .lo
 
2061
        # (e.g. aix) in case we are running --disable-static
 
2062
        for obj in $libobjs; do
 
2063
          xdir=`$echo "X$obj" | $Xsed -e 's%/[^/]*$%%'`
 
2064
          if test "X$xdir" = "X$obj"; then
 
2065
            xdir="."
 
2066
          else
 
2067
            xdir="$xdir"
 
2068
          fi
 
2069
          baseobj=`$echo "X$obj" | $Xsed -e 's%^.*/%%'`
 
2070
          oldobj=`$echo "X$baseobj" | $Xsed -e "$lo2o"`
 
2071
          if test ! -f $xdir/$oldobj; then
 
2072
            $show "(cd $xdir && ${LN_S} $baseobj $oldobj)"
 
2073
            $run eval '(cd $xdir && ${LN_S} $baseobj $oldobj)' || exit $?
 
2074
          fi
 
2075
        done
 
2076
 
 
2077
        # Use standard objects if they are pic
 
2078
        test -z "$pic_flag" && libobjs=`$echo "X$libobjs" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP`
 
2079
 
 
2080
        # Prepare the list of exported symbols
 
2081
        if test -z "$export_symbols"; then
 
2082
          if test "$always_export_symbols" = yes || test -n "$export_symbols_regex"; then
 
2083
            $show "generating symbol list for \`$libname.la'"
 
2084
            export_symbols="$output_objdir/$libname.exp"
 
2085
            $run $rm $export_symbols
 
2086
            eval cmds=\"$export_symbols_cmds\"
 
2087
            IFS="${IFS=         }"; save_ifs="$IFS"; IFS='~'
 
2088
            for cmd in $cmds; do
 
2089
              IFS="$save_ifs"
 
2090
              $show "$cmd"
 
2091
              $run eval "$cmd" || exit $?
 
2092
            done
 
2093
            IFS="$save_ifs"
 
2094
            if test -n "$export_symbols_regex"; then
 
2095
              $show "egrep -e \"$export_symbols_regex\" \"$export_symbols\" > \"${export_symbols}T\""
 
2096
              $run eval 'egrep -e "$export_symbols_regex" "$export_symbols" > "${export_symbols}T"'
 
2097
              $show "$mv \"${export_symbols}T\" \"$export_symbols\""
 
2098
              $run eval '$mv "${export_symbols}T" "$export_symbols"'
 
2099
            fi
 
2100
          fi
 
2101
        fi
 
2102
 
 
2103
        if test -n "$export_symbols" && test -n "$include_expsyms"; then
 
2104
          $run eval '$echo "X$include_expsyms" | $SP2NL >> "$export_symbols"'
 
2105
        fi
 
2106
 
 
2107
        if test -n "$convenience"; then
 
2108
          if test -n "$whole_archive_flag_spec"; then
 
2109
            eval libobjs=\"\$libobjs $whole_archive_flag_spec\"
 
2110
          else
 
2111
            gentop="$output_objdir/${outputname}x"
 
2112
            $show "${rm}r $gentop"
 
2113
            $run ${rm}r "$gentop"
 
2114
            $show "mkdir $gentop"
 
2115
            $run mkdir "$gentop"
 
2116
            status=$?
 
2117
            if test $status -ne 0 && test ! -d "$gentop"; then
 
2118
              exit $status
 
2119
            fi
 
2120
            generated="$generated $gentop"
 
2121
 
 
2122
            for xlib in $convenience; do
 
2123
              # Extract the objects.
 
2124
              case "$xlib" in
 
2125
              [\\/]* | [A-Za-z]:[\\/]*) xabs="$xlib" ;;
 
2126
              *) xabs=`pwd`"/$xlib" ;;
 
2127
              esac
 
2128
              xlib=`$echo "X$xlib" | $Xsed -e 's%^.*/%%'`
 
2129
              xdir="$gentop/$xlib"
 
2130
 
 
2131
              $show "${rm}r $xdir"
 
2132
              $run ${rm}r "$xdir"
 
2133
              $show "mkdir $xdir"
 
2134
              $run mkdir "$xdir"
 
2135
              status=$?
 
2136
              if test $status -ne 0 && test ! -d "$xdir"; then
 
2137
                exit $status
 
2138
              fi
 
2139
              $show "(cd $xdir && $AR x $xabs)"
 
2140
              $run eval "(cd \$xdir && $AR x \$xabs)" || exit $?
 
2141
 
 
2142
              libobjs="$libobjs "`find $xdir -name \*.o -print -o -name \*.lo -print | $NL2SP`
 
2143
            done
 
2144
          fi
 
2145
        fi
 
2146
 
 
2147
        if test "$thread_safe" = yes && test -n "$thread_safe_flag_spec"; then
 
2148
          eval flag=\"$thread_safe_flag_spec\"
 
2149
          linkopts="$linkopts $flag"
 
2150
        fi
 
2151
 
 
2152
        # Do each of the archive commands.
 
2153
        if test -n "$export_symbols" && test -n "$archive_expsym_cmds"; then
 
2154
          eval cmds=\"$archive_expsym_cmds\"
 
2155
        else
 
2156
          eval cmds=\"$archive_cmds\"
 
2157
        fi
 
2158
        IFS="${IFS=     }"; save_ifs="$IFS"; IFS='~'
 
2159
        for cmd in $cmds; do
 
2160
          IFS="$save_ifs"
 
2161
          $show "$cmd"
 
2162
          $run eval "$cmd" || exit $?
 
2163
        done
 
2164
        IFS="$save_ifs"
 
2165
 
 
2166
        # Create links to the real library.
 
2167
        for linkname in $linknames; do
 
2168
          if test "$realname" != "$linkname"; then
 
2169
            $show "(cd $output_objdir && $rm $linkname && $LN_S $realname $linkname)"
 
2170
            $run eval '(cd $output_objdir && $rm $linkname && $LN_S $realname $linkname)' || exit $?
 
2171
          fi
 
2172
        done
 
2173
 
 
2174
        # If -module or -export-dynamic was specified, set the dlname.
 
2175
        if test "$module" = yes || test "$export_dynamic" = yes; then
 
2176
          # On all known operating systems, these are identical.
 
2177
          dlname="$soname"
 
2178
        fi
 
2179
      fi
 
2180
      ;;
 
2181
 
 
2182
    *.lo | *.o | *.obj)
 
2183
      if test -n "$link_against_libtool_libs"; then
 
2184
        $echo "$modename: error: cannot link libtool libraries into objects" 1>&2
 
2185
        exit 1
 
2186
      fi
 
2187
 
 
2188
      if test -n "$deplibs"; then
 
2189
        $echo "$modename: warning: \`-l' and \`-L' are ignored for objects" 1>&2
 
2190
      fi
 
2191
 
 
2192
      if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then
 
2193
        $echo "$modename: warning: \`-dlopen' is ignored for objects" 1>&2
 
2194
      fi
 
2195
 
 
2196
      if test -n "$rpath"; then
 
2197
        $echo "$modename: warning: \`-rpath' is ignored for objects" 1>&2
 
2198
      fi
 
2199
 
 
2200
      if test -n "$xrpath"; then
 
2201
        $echo "$modename: warning: \`-R' is ignored for objects" 1>&2
 
2202
      fi
 
2203
 
 
2204
      if test -n "$vinfo"; then
 
2205
        $echo "$modename: warning: \`-version-info' is ignored for objects" 1>&2
 
2206
      fi
 
2207
 
 
2208
      if test -n "$release"; then
 
2209
        $echo "$modename: warning: \`-release' is ignored for objects" 1>&2
 
2210
      fi
 
2211
 
 
2212
      case "$output" in
 
2213
      *.lo)
 
2214
        if test -n "$objs"; then
 
2215
          $echo "$modename: cannot build library object \`$output' from non-libtool objects" 1>&2
 
2216
          exit 1
 
2217
        fi
 
2218
        libobj="$output"
 
2219
        obj=`$echo "X$output" | $Xsed -e "$lo2o"`
 
2220
        ;;
 
2221
      *)
 
2222
        libobj=
 
2223
        obj="$output"
 
2224
        ;;
 
2225
      esac
 
2226
 
 
2227
      # Delete the old objects.
 
2228
      $run $rm $obj $libobj
 
2229
 
 
2230
      # Objects from convenience libraries.  This assumes
 
2231
      # single-version convenience libraries.  Whenever we create
 
2232
      # different ones for PIC/non-PIC, this we'll have to duplicate
 
2233
      # the extraction.
 
2234
      reload_conv_objs=
 
2235
      gentop=
 
2236
      # reload_cmds runs $LD directly, so let us get rid of
 
2237
      # -Wl from whole_archive_flag_spec
 
2238
      wl= 
 
2239
 
 
2240
      if test -n "$convenience"; then
 
2241
        if test -n "$whole_archive_flag_spec"; then
 
2242
          eval reload_conv_objs=\"\$reload_objs $whole_archive_flag_spec\"
 
2243
        else
 
2244
          gentop="$output_objdir/${obj}x"
 
2245
          $show "${rm}r $gentop"
 
2246
          $run ${rm}r "$gentop"
 
2247
          $show "mkdir $gentop"
 
2248
          $run mkdir "$gentop"
 
2249
          status=$?
 
2250
          if test $status -ne 0 && test ! -d "$gentop"; then
 
2251
            exit $status
 
2252
          fi
 
2253
          generated="$generated $gentop"
 
2254
 
 
2255
          for xlib in $convenience; do
 
2256
            # Extract the objects.
 
2257
            case "$xlib" in
 
2258
            [\\/]* | [A-Za-z]:[\\/]*) xabs="$xlib" ;;
 
2259
            *) xabs=`pwd`"/$xlib" ;;
 
2260
            esac
 
2261
            xlib=`$echo "X$xlib" | $Xsed -e 's%^.*/%%'`
 
2262
            xdir="$gentop/$xlib"
 
2263
 
 
2264
            $show "${rm}r $xdir"
 
2265
            $run ${rm}r "$xdir"
 
2266
            $show "mkdir $xdir"
 
2267
            $run mkdir "$xdir"
 
2268
            status=$?
 
2269
            if test $status -ne 0 && test ! -d "$xdir"; then
 
2270
              exit $status
 
2271
            fi
 
2272
            $show "(cd $xdir && $AR x $xabs)"
 
2273
            $run eval "(cd \$xdir && $AR x \$xabs)" || exit $?
 
2274
 
 
2275
            reload_conv_objs="$reload_objs "`find $xdir -name \*.o -print -o -name \*.lo -print | $NL2SP`
 
2276
          done
 
2277
        fi
 
2278
      fi
 
2279
 
 
2280
      # Create the old-style object.
 
2281
      reload_objs="$objs "`$echo "X$libobjs" | $SP2NL | $Xsed -e '/\.'${libext}$'/d' -e '/\.lib$/d' -e "$lo2o" | $NL2SP`" $reload_conv_objs"
 
2282
 
 
2283
      output="$obj"
 
2284
      eval cmds=\"$reload_cmds\"
 
2285
      IFS="${IFS=       }"; save_ifs="$IFS"; IFS='~'
 
2286
      for cmd in $cmds; do
 
2287
        IFS="$save_ifs"
 
2288
        $show "$cmd"
 
2289
        $run eval "$cmd" || exit $?
 
2290
      done
 
2291
      IFS="$save_ifs"
 
2292
 
 
2293
      # Exit if we aren't doing a library object file.
 
2294
      if test -z "$libobj"; then
 
2295
        if test -n "$gentop"; then
 
2296
          $show "${rm}r $gentop"
 
2297
          $run ${rm}r $gentop
 
2298
        fi
 
2299
 
 
2300
        exit 0
 
2301
      fi
 
2302
 
 
2303
      if test "$build_libtool_libs" != yes; then
 
2304
        if test -n "$gentop"; then
 
2305
          $show "${rm}r $gentop"
 
2306
          $run ${rm}r $gentop
 
2307
        fi
 
2308
 
 
2309
        # Create an invalid libtool object if no PIC, so that we don't
 
2310
        # accidentally link it into a program.
 
2311
        $show "echo timestamp > $libobj"
 
2312
        $run eval "echo timestamp > $libobj" || exit $?
 
2313
        exit 0
 
2314
      fi
 
2315
 
 
2316
      if test -n "$pic_flag"; then
 
2317
        # Only do commands if we really have different PIC objects.
 
2318
        reload_objs="$libobjs $reload_conv_objs"
 
2319
        output="$libobj"
 
2320
        eval cmds=\"$reload_cmds\"
 
2321
        IFS="${IFS=     }"; save_ifs="$IFS"; IFS='~'
 
2322
        for cmd in $cmds; do
 
2323
          IFS="$save_ifs"
 
2324
          $show "$cmd"
 
2325
          $run eval "$cmd" || exit $?
 
2326
        done
 
2327
        IFS="$save_ifs"
 
2328
      else
 
2329
        # Just create a symlink.
 
2330
        $show $rm $libobj
 
2331
        $run $rm $libobj
 
2332
        xdir=`$echo "X$libobj" | $Xsed -e 's%/[^/]*$%%'`
 
2333
        if test "X$xdir" = "X$libobj"; then
 
2334
          xdir="."
 
2335
        else
 
2336
          xdir="$xdir"
 
2337
        fi
 
2338
        baseobj=`$echo "X$libobj" | $Xsed -e 's%^.*/%%'`
 
2339
        oldobj=`$echo "X$baseobj" | $Xsed -e "$lo2o"`
 
2340
        $show "(cd $xdir && $LN_S $oldobj $baseobj)"
 
2341
        $run eval '(cd $xdir && $LN_S $oldobj $baseobj)' || exit $?
 
2342
      fi
 
2343
 
 
2344
      if test -n "$gentop"; then
 
2345
        $show "${rm}r $gentop"
 
2346
        $run ${rm}r $gentop
 
2347
      fi
 
2348
 
 
2349
      exit 0
 
2350
      ;;
 
2351
 
 
2352
    # Anything else should be a program.
 
2353
    *)
 
2354
      if test -n "$vinfo"; then
 
2355
        $echo "$modename: warning: \`-version-info' is ignored for programs" 1>&2
 
2356
      fi
 
2357
 
 
2358
      if test -n "$release"; then
 
2359
        $echo "$modename: warning: \`-release' is ignored for programs" 1>&2
 
2360
      fi
 
2361
 
 
2362
      if test "$preload" = yes; then
 
2363
        if test "$dlopen" = unknown && test "$dlopen_self" = unknown &&
 
2364
           test "$dlopen_self_static" = unknown; then
 
2365
          $echo "$modename: warning: \`AC_LIBTOOL_DLOPEN' not used. Assuming no dlopen support."
 
2366
        fi 
 
2367
      fi
 
2368
    
 
2369
      if test -n "$rpath$xrpath"; then
 
2370
        # If the user specified any rpath flags, then add them.
 
2371
        for libdir in $rpath $xrpath; do
 
2372
          # This is the magic to use -rpath.
 
2373
          case "$compile_rpath " in
 
2374
          *" $libdir "*) ;;
 
2375
          *) compile_rpath="$compile_rpath $libdir" ;;
 
2376
          esac
 
2377
          case "$finalize_rpath " in
 
2378
          *" $libdir "*) ;;
 
2379
          *) finalize_rpath="$finalize_rpath $libdir" ;;
 
2380
          esac
 
2381
        done
 
2382
      fi
 
2383
 
 
2384
      # Now hardcode the library paths
 
2385
      rpath=
 
2386
      hardcode_libdirs=
 
2387
      for libdir in $compile_rpath $finalize_rpath; do
 
2388
        if test -n "$hardcode_libdir_flag_spec"; then
 
2389
          if test -n "$hardcode_libdir_separator"; then
 
2390
            if test -z "$hardcode_libdirs"; then
 
2391
              hardcode_libdirs="$libdir"
 
2392
            else
 
2393
              # Just accumulate the unique libdirs.
 
2394
              case "$hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator" in
 
2395
              *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*)
 
2396
                ;;
 
2397
              *)
 
2398
                hardcode_libdirs="$hardcode_libdirs$hardcode_libdir_separator$libdir"
 
2399
                ;;
 
2400
              esac
 
2401
            fi
 
2402
          else
 
2403
            eval flag=\"$hardcode_libdir_flag_spec\"
 
2404
            rpath="$rpath $flag"
 
2405
          fi
 
2406
        elif test -n "$runpath_var"; then
 
2407
          case "$perm_rpath " in
 
2408
          *" $libdir "*) ;;
 
2409
          *) perm_rpath="$perm_rpath $libdir" ;;
 
2410
          esac
 
2411
        fi
 
2412
      done
 
2413
      # Substitute the hardcoded libdirs into the rpath.
 
2414
      if test -n "$hardcode_libdir_separator" &&
 
2415
         test -n "$hardcode_libdirs"; then
 
2416
        libdir="$hardcode_libdirs"
 
2417
        eval rpath=\" $hardcode_libdir_flag_spec\"
 
2418
      fi
 
2419
      compile_rpath="$rpath"
 
2420
 
 
2421
      rpath=
 
2422
      hardcode_libdirs=
 
2423
      for libdir in $finalize_rpath; do
 
2424
        if test -n "$hardcode_libdir_flag_spec"; then
 
2425
          if test -n "$hardcode_libdir_separator"; then
 
2426
            if test -z "$hardcode_libdirs"; then
 
2427
              hardcode_libdirs="$libdir"
 
2428
            else
 
2429
              # Just accumulate the unique libdirs.
 
2430
              case "$hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator" in
 
2431
              *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*)
 
2432
                ;;
 
2433
              *)
 
2434
                hardcode_libdirs="$hardcode_libdirs$hardcode_libdir_separator$libdir"
 
2435
                ;;
 
2436
              esac
 
2437
            fi
 
2438
          else
 
2439
            eval flag=\"$hardcode_libdir_flag_spec\"
 
2440
            rpath="$rpath $flag"
 
2441
          fi
 
2442
        elif test -n "$runpath_var"; then
 
2443
          case "$finalize_perm_rpath " in
 
2444
          *" $libdir "*) ;;
 
2445
          *) finalize_perm_rpath="$finalize_perm_rpath $libdir" ;;
 
2446
          esac
 
2447
        fi
 
2448
      done
 
2449
      # Substitute the hardcoded libdirs into the rpath.
 
2450
      if test -n "$hardcode_libdir_separator" &&
 
2451
         test -n "$hardcode_libdirs"; then
 
2452
        libdir="$hardcode_libdirs"
 
2453
        eval rpath=\" $hardcode_libdir_flag_spec\"
 
2454
      fi
 
2455
      finalize_rpath="$rpath"
 
2456
 
 
2457
      output_objdir=`$echo "X$output" | $Xsed -e 's%/[^/]*$%%'`
 
2458
      if test "X$output_objdir" = "X$output"; then
 
2459
        output_objdir="$objdir"
 
2460
      else
 
2461
        output_objdir="$output_objdir/$objdir"
 
2462
      fi
 
2463
 
 
2464
      # Create the binary in the object directory, then wrap it.
 
2465
      if test ! -d $output_objdir; then
 
2466
        $show "$mkdir $output_objdir"
 
2467
        $run $mkdir $output_objdir
 
2468
        status=$?
 
2469
        if test $status -ne 0 && test ! -d $output_objdir; then
 
2470
          exit $status
 
2471
        fi
 
2472
      fi
 
2473
 
 
2474
      if test -n "$libobjs" && test "$build_old_libs" = yes; then
 
2475
        # Transform all the library objects into standard objects.
 
2476
        compile_command=`$echo "X$compile_command" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP`
 
2477
        finalize_command=`$echo "X$finalize_command" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP`
 
2478
      fi
 
2479
 
 
2480
      dlsyms=
 
2481
      if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then
 
2482
        if test -n "$NM" && test -n "$global_symbol_pipe"; then
 
2483
          dlsyms="${outputname}S.c"
 
2484
        else
 
2485
          $echo "$modename: not configured to extract global symbols from dlpreopened files" 1>&2
 
2486
        fi
 
2487
      fi
 
2488
 
 
2489
      if test -n "$dlsyms"; then
 
2490
        case "$dlsyms" in
 
2491
        "") ;;
 
2492
        *.c)
 
2493
          # Discover the nlist of each of the dlfiles.
 
2494
          nlist="$output_objdir/${outputname}.nm"
 
2495
 
 
2496
          $show "$rm $nlist ${nlist}S ${nlist}T"
 
2497
          $run $rm "$nlist" "${nlist}S" "${nlist}T"
 
2498
 
 
2499
          # Parse the name list into a source file.
 
2500
          $show "creating $output_objdir/$dlsyms"
 
2501
 
 
2502
          test -z "$run" && $echo > "$output_objdir/$dlsyms" "\
 
2503
/* $dlsyms - symbol resolution table for \`$outputname' dlsym emulation. */
 
2504
/* Generated by $PROGRAM - GNU $PACKAGE $VERSION$TIMESTAMP */
 
2505
 
 
2506
#ifdef __cplusplus
 
2507
extern \"C\" {
 
2508
#endif
 
2509
 
 
2510
/* Prevent the only kind of declaration conflicts we can make. */
 
2511
#define lt_preloaded_symbols some_other_symbol
 
2512
 
 
2513
/* External symbol declarations for the compiler. */\
 
2514
"
 
2515
 
 
2516
          if test "$dlself" = yes; then
 
2517
            $show "generating symbol list for \`$output'"
 
2518
 
 
2519
            test -z "$run" && $echo ': @PROGRAM@ ' > "$nlist"
 
2520
 
 
2521
            # Add our own program objects to the symbol list.
 
2522
            progfiles=`$echo "X$objs" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP`
 
2523
            for arg in $progfiles; do
 
2524
              $show "extracting global C symbols from \`$arg'"
 
2525
              $run eval "$NM $arg | $global_symbol_pipe >> '$nlist'"
 
2526
            done
 
2527
 
 
2528
            if test -n "$exclude_expsyms"; then
 
2529
              $run eval 'egrep -v " ($exclude_expsyms)$" "$nlist" > "$nlist"T'
 
2530
              $run eval '$mv "$nlist"T "$nlist"'
 
2531
            fi
 
2532
            
 
2533
            if test -n "$export_symbols_regex"; then
 
2534
              $run eval 'egrep -e "$export_symbols_regex" "$nlist" > "$nlist"T'
 
2535
              $run eval '$mv "$nlist"T "$nlist"'
 
2536
            fi
 
2537
 
 
2538
            # Prepare the list of exported symbols
 
2539
            if test -z "$export_symbols"; then
 
2540
              export_symbols="$output_objdir/$output.exp"
 
2541
              $run $rm $export_symbols
 
2542
              $run eval "sed -n -e '/^: @PROGRAM@$/d' -e 's/^.* \(.*\)$/\1/p' "'< "$nlist" > "$export_symbols"'
 
2543
            else
 
2544
              $run eval "sed -e 's/\([][.*^$]\)/\\\1/g' -e 's/^/ /' -e 's/$/$/'"' < "$export_symbols" > "$output_objdir/$output.exp"'
 
2545
              $run eval 'grep -f "$output_objdir/$output.exp" < "$nlist" > "$nlist"T'
 
2546
              $run eval 'mv "$nlist"T "$nlist"'
 
2547
            fi
 
2548
          fi
 
2549
 
 
2550
          for arg in $dlprefiles; do
 
2551
            $show "extracting global C symbols from \`$arg'"
 
2552
            name=`echo "$arg" | sed -e 's%^.*/%%'`
 
2553
            $run eval 'echo ": $name " >> "$nlist"'
 
2554
            $run eval "$NM $arg | $global_symbol_pipe >> '$nlist'"
 
2555
          done
 
2556
 
 
2557
          if test -z "$run"; then
 
2558
            # Make sure we have at least an empty file.
 
2559
            test -f "$nlist" || : > "$nlist"
 
2560
 
 
2561
            if test -n "$exclude_expsyms"; then
 
2562
              egrep -v " ($exclude_expsyms)$" "$nlist" > "$nlist"T
 
2563
              $mv "$nlist"T "$nlist"
 
2564
            fi
 
2565
 
 
2566
            # Try sorting and uniquifying the output.
 
2567
            if grep -v "^: " < "$nlist" | sort +2 | uniq > "$nlist"S; then
 
2568
              :
 
2569
            else
 
2570
              grep -v "^: " < "$nlist" > "$nlist"S
 
2571
            fi
 
2572
 
 
2573
            if test -f "$nlist"S; then
 
2574
              eval "$global_symbol_to_cdecl"' < "$nlist"S >> "$output_objdir/$dlsyms"'
 
2575
            else
 
2576
              echo '/* NONE */' >> "$output_objdir/$dlsyms"
 
2577
            fi
 
2578
 
 
2579
            $echo >> "$output_objdir/$dlsyms" "\
 
2580
 
 
2581
#undef lt_preloaded_symbols
 
2582
 
 
2583
#if defined (__STDC__) && __STDC__
 
2584
# define lt_ptr_t void *
 
2585
#else
 
2586
# define lt_ptr_t char *
 
2587
# define const
 
2588
#endif
 
2589
 
 
2590
/* The mapping between symbol names and symbols. */
 
2591
const struct {
 
2592
  const char *name;
 
2593
  lt_ptr_t address;
 
2594
}
 
2595
lt_preloaded_symbols[] =
 
2596
{\
 
2597
"
 
2598
 
 
2599
            sed -n -e 's/^: \([^ ]*\) $/  {\"\1\", (lt_ptr_t) 0},/p' \
 
2600
                -e 's/^. \([^ ]*\) \([^ ]*\)$/  {"\2", (lt_ptr_t) \&\2},/p' \
 
2601
                  < "$nlist" >> "$output_objdir/$dlsyms"
 
2602
 
 
2603
            $echo >> "$output_objdir/$dlsyms" "\
 
2604
  {0, (lt_ptr_t) 0}
 
2605
};
 
2606
 
 
2607
/* This works around a problem in FreeBSD linker */
 
2608
#ifdef FREEBSD_WORKAROUND
 
2609
static const void *lt_preloaded_setup() {
 
2610
  return lt_preloaded_symbols;
 
2611
}
 
2612
#endif
 
2613
 
 
2614
#ifdef __cplusplus
 
2615
}
 
2616
#endif\
 
2617
"
 
2618
          fi
 
2619
 
 
2620
          pic_flag_for_symtable=
 
2621
          case "$host" in
 
2622
          # compiling the symbol table file with pic_flag works around
 
2623
          # a FreeBSD bug that causes programs to crash when -lm is
 
2624
          # linked before any other PIC object.  But we must not use
 
2625
          # pic_flag when linking with -static.  The problem exists in
 
2626
          # FreeBSD 2.2.6 and is fixed in FreeBSD 3.1.
 
2627
          *-*-freebsd2*|*-*-freebsd3.0*|*-*-freebsdelf3.0*)
 
2628
            case "$compile_command " in
 
2629
            *" -static "*) ;;
 
2630
            *) pic_flag_for_symtable=" $pic_flag -DPIC -DFREEBSD_WORKAROUND";;
 
2631
            esac;;
 
2632
          *-*-hpux*)
 
2633
            case "$compile_command " in
 
2634
            *" -static "*) ;;
 
2635
            *) pic_flag_for_symtable=" $pic_flag -DPIC";;
 
2636
            esac
 
2637
          esac
 
2638
 
 
2639
          # Now compile the dynamic symbol file.
 
2640
          $show "(cd $output_objdir && $CC -c$no_builtin_flag$pic_flag_for_symtable \"$dlsyms\")"
 
2641
          $run eval '(cd $output_objdir && $CC -c$no_builtin_flag$pic_flag_for_symtable "$dlsyms")' || exit $?
 
2642
 
 
2643
          # Clean up the generated files.
 
2644
          $show "$rm $output_objdir/$dlsyms $nlist ${nlist}S ${nlist}T"
 
2645
          $run $rm "$output_objdir/$dlsyms" "$nlist" "${nlist}S" "${nlist}T"
 
2646
 
 
2647
          # Transform the symbol file into the correct name.
 
2648
          compile_command=`$echo "X$compile_command" | $Xsed -e "s%@SYMFILE@%$output_objdir/${outputname}S.${objext}%"`
 
2649
          finalize_command=`$echo "X$finalize_command" | $Xsed -e "s%@SYMFILE@%$output_objdir/${outputname}S.${objext}%"`
 
2650
          ;;
 
2651
        *)
 
2652
          $echo "$modename: unknown suffix for \`$dlsyms'" 1>&2
 
2653
          exit 1
 
2654
          ;;
 
2655
        esac
 
2656
      else
 
2657
        # We keep going just in case the user didn't refer to
 
2658
        # lt_preloaded_symbols.  The linker will fail if global_symbol_pipe
 
2659
        # really was required.
 
2660
 
 
2661
        # Nullify the symbol file.
 
2662
        compile_command=`$echo "X$compile_command" | $Xsed -e "s% @SYMFILE@%%"`
 
2663
        finalize_command=`$echo "X$finalize_command" | $Xsed -e "s% @SYMFILE@%%"`
 
2664
      fi
 
2665
 
 
2666
      if test -z "$link_against_libtool_libs" || test "$build_libtool_libs" != yes; then
 
2667
        # Replace the output file specification.
 
2668
        compile_command=`$echo "X$compile_command" | $Xsed -e 's%@OUTPUT@%'"$output"'%g'`
 
2669
        link_command="$compile_command$compile_rpath"
 
2670
 
 
2671
        # We have no uninstalled library dependencies, so finalize right now.
 
2672
        $show "$link_command"
 
2673
        $run eval "$link_command"
 
2674
        status=$?
 
2675
        
 
2676
        # Delete the generated files.
 
2677
        if test -n "$dlsyms"; then
 
2678
          $show "$rm $output_objdir/${outputname}S.${objext}"
 
2679
          $run $rm "$output_objdir/${outputname}S.${objext}"
 
2680
        fi
 
2681
 
 
2682
        exit $status
 
2683
      fi
 
2684
 
 
2685
      if test -n "$shlibpath_var"; then
 
2686
        # We should set the shlibpath_var
 
2687
        rpath=
 
2688
        for dir in $temp_rpath; do
 
2689
          case "$dir" in
 
2690
          [\\/]* | [A-Za-z]:[\\/]*)
 
2691
            # Absolute path.
 
2692
            rpath="$rpath$dir:"
 
2693
            ;;
 
2694
          *)
 
2695
            # Relative path: add a thisdir entry.
 
2696
            rpath="$rpath\$thisdir/$dir:"
 
2697
            ;;
 
2698
          esac
 
2699
        done
 
2700
        temp_rpath="$rpath"
 
2701
      fi
 
2702
 
 
2703
      if test -n "$compile_shlibpath$finalize_shlibpath"; then
 
2704
        compile_command="$shlibpath_var=\"$compile_shlibpath$finalize_shlibpath\$$shlibpath_var\" $compile_command"
 
2705
      fi
 
2706
      if test -n "$finalize_shlibpath"; then
 
2707
        finalize_command="$shlibpath_var=\"$finalize_shlibpath\$$shlibpath_var\" $finalize_command"
 
2708
      fi
 
2709
 
 
2710
      compile_var=
 
2711
      finalize_var=
 
2712
      if test -n "$runpath_var"; then
 
2713
        if test -n "$perm_rpath"; then
 
2714
          # We should set the runpath_var.
 
2715
          rpath=
 
2716
          for dir in $perm_rpath; do
 
2717
            rpath="$rpath$dir:"
 
2718
          done
 
2719
          compile_var="$runpath_var=\"$rpath\$$runpath_var\" "
 
2720
        fi
 
2721
        if test -n "$finalize_perm_rpath"; then
 
2722
          # We should set the runpath_var.
 
2723
          rpath=
 
2724
          for dir in $finalize_perm_rpath; do
 
2725
            rpath="$rpath$dir:"
 
2726
          done
 
2727
          finalize_var="$runpath_var=\"$rpath\$$runpath_var\" "
 
2728
        fi
 
2729
      fi
 
2730
 
 
2731
      if test "$hardcode_action" = relink; then
 
2732
        # Fast installation is not supported
 
2733
        link_command="$compile_var$compile_command$compile_rpath"
 
2734
        relink_command="$finalize_var$finalize_command$finalize_rpath"
 
2735
        
 
2736
        $echo "$modename: warning: this platform does not like uninstalled shared libraries" 1>&2
 
2737
        $echo "$modename: \`$output' will be relinked during installation" 1>&2
 
2738
      else
 
2739
        if test "$fast_install" != no; then
 
2740
          link_command="$finalize_var$compile_command$finalize_rpath"
 
2741
          if test "$fast_install" = yes; then
 
2742
            relink_command=`$echo "X$compile_var$compile_command$compile_rpath" | $Xsed -e 's%@OUTPUT@%\$progdir/\$file%g'`
 
2743
          else
 
2744
            # fast_install is set to needless
 
2745
            relink_command=
 
2746
          fi
 
2747
        else
 
2748
          link_command="$compile_var$compile_command$compile_rpath"
 
2749
          relink_command="$finalize_var$finalize_command$finalize_rpath"
 
2750
        fi
 
2751
      fi
 
2752
 
 
2753
      # Replace the output file specification.
 
2754
      link_command=`$echo "X$link_command" | $Xsed -e 's%@OUTPUT@%'"$output_objdir/$outputname"'%g'`
 
2755
      
 
2756
      # Delete the old output files.
 
2757
      $run $rm $output $output_objdir/$outputname $output_objdir/lt-$outputname
 
2758
 
 
2759
      $show "$link_command"
 
2760
      $run eval "$link_command" || exit $?
 
2761
 
 
2762
      # Now create the wrapper script.
 
2763
      $show "creating $output"
 
2764
 
 
2765
      # Quote the relink command for shipping.
 
2766
      if test -n "$relink_command"; then
 
2767
        relink_command=`$echo "X$relink_command" | $Xsed -e "$sed_quote_subst"`
 
2768
      fi
 
2769
 
 
2770
      # Quote $echo for shipping.
 
2771
      if test "X$echo" = "X$SHELL $0 --fallback-echo"; then
 
2772
        case "$0" in
 
2773
        [\\/]* | [A-Za-z]:[\\/]*) qecho="$SHELL $0 --fallback-echo";;
 
2774
        *) qecho="$SHELL `pwd`/$0 --fallback-echo";;
 
2775
        esac
 
2776
        qecho=`$echo "X$qecho" | $Xsed -e "$sed_quote_subst"`
 
2777
      else
 
2778
        qecho=`$echo "X$echo" | $Xsed -e "$sed_quote_subst"`
 
2779
      fi
 
2780
 
 
2781
      # Only actually do things if our run command is non-null.
 
2782
      if test -z "$run"; then
 
2783
        # win32 will think the script is a binary if it has
 
2784
        # a .exe suffix, so we strip it off here.
 
2785
        case $output in
 
2786
          *.exe) output=`echo $output|sed 's,.exe$,,'` ;;
 
2787
        esac
 
2788
        $rm $output
 
2789
        trap "$rm $output; exit 1" 1 2 15
 
2790
 
 
2791
        $echo > $output "\
 
2792
#! $SHELL
 
2793
 
 
2794
# $output - temporary wrapper script for $objdir/$outputname
 
2795
# Generated by $PROGRAM - GNU $PACKAGE $VERSION$TIMESTAMP
 
2796
#
 
2797
# The $output program cannot be directly executed until all the libtool
 
2798
# libraries that it depends on are installed.
 
2799
#
 
2800
# This wrapper script should never be moved out of the build directory.
 
2801
# If it is, it will not operate correctly.
 
2802
 
 
2803
# Sed substitution that helps us do robust quoting.  It backslashifies
 
2804
# metacharacters that are still active within double-quoted strings.
 
2805
Xsed='sed -e 1s/^X//'
 
2806
sed_quote_subst='$sed_quote_subst'
 
2807
 
 
2808
# The HP-UX ksh and POSIX shell print the target directory to stdout
 
2809
# if CDPATH is set.
 
2810
if test \"\${CDPATH+set}\" = set; then CDPATH=:; export CDPATH; fi
 
2811
 
 
2812
relink_command=\"$relink_command\"
 
2813
 
 
2814
# This environment variable determines our operation mode.
 
2815
if test \"\$libtool_install_magic\" = \"$magic\"; then
 
2816
  # install mode needs the following variable:
 
2817
  link_against_libtool_libs='$link_against_libtool_libs'
 
2818
else
 
2819
  # When we are sourced in execute mode, \$file and \$echo are already set.
 
2820
  if test \"\$libtool_execute_magic\" != \"$magic\"; then
 
2821
    echo=\"$qecho\"
 
2822
    file=\"\$0\"
 
2823
    # Make sure echo works.
 
2824
    if test \"X\$1\" = X--no-reexec; then
 
2825
      # Discard the --no-reexec flag, and continue.
 
2826
      shift
 
2827
    elif test \"X\`(\$echo '\t') 2>/dev/null\`\" = 'X\t'; then
 
2828
      # Yippee, \$echo works!
 
2829
      :
 
2830
    else
 
2831
      # Restart under the correct shell, and then maybe \$echo will work.
 
2832
      exec $SHELL \"\$0\" --no-reexec \${1+\"\$@\"}
 
2833
    fi
 
2834
  fi\
 
2835
"
 
2836
        $echo >> $output "\
 
2837
 
 
2838
  # Find the directory that this script lives in.
 
2839
  thisdir=\`\$echo \"X\$file\" | \$Xsed -e 's%/[^/]*$%%'\`
 
2840
  test \"x\$thisdir\" = \"x\$file\" && thisdir=.
 
2841
 
 
2842
  # Follow symbolic links until we get to the real thisdir.
 
2843
  file=\`ls -ld \"\$file\" | sed -n 's/.*-> //p'\`
 
2844
  while test -n \"\$file\"; do
 
2845
    destdir=\`\$echo \"X\$file\" | \$Xsed -e 's%/[^/]*\$%%'\`
 
2846
 
 
2847
    # If there was a directory component, then change thisdir.
 
2848
    if test \"x\$destdir\" != \"x\$file\"; then
 
2849
      case \"\$destdir\" in
 
2850
      [\\/]* | [A-Za-z]:[\\/]*) thisdir=\"\$destdir\" ;;
 
2851
      *) thisdir=\"\$thisdir/\$destdir\" ;;
 
2852
      esac
 
2853
    fi
 
2854
 
 
2855
    file=\`\$echo \"X\$file\" | \$Xsed -e 's%^.*/%%'\`
 
2856
    file=\`ls -ld \"\$thisdir/\$file\" | sed -n 's/.*-> //p'\`
 
2857
  done
 
2858
 
 
2859
  # Try to get the absolute directory name.
 
2860
  absdir=\`cd \"\$thisdir\" && pwd\`
 
2861
  test -n \"\$absdir\" && thisdir=\"\$absdir\"
 
2862
"
 
2863
 
 
2864
        if test "$fast_install" = yes; then
 
2865
          echo >> $output "\
 
2866
  program=lt-'$outputname'
 
2867
  progdir=\"\$thisdir/$objdir\"
 
2868
  
 
2869
  if test ! -f \"\$progdir/\$program\" || \\
 
2870
     { file=\`ls -1dt \"\$progdir/\$program\" \"\$progdir/../\$program\" 2>/dev/null | sed 1q\`; \\
 
2871
       test \"X\$file\" != \"X\$progdir/\$program\"; }; then
 
2872
 
 
2873
    file=\"\$\$-\$program\"
 
2874
 
 
2875
    if test ! -d \"\$progdir\"; then
 
2876
      $mkdir \"\$progdir\"
 
2877
    else
 
2878
      $rm \"\$progdir/\$file\"
 
2879
    fi"
 
2880
 
 
2881
          echo >> $output "\
 
2882
 
 
2883
    # relink executable if necessary
 
2884
    if test -n \"\$relink_command\"; then
 
2885
      if (cd \"\$thisdir\" && eval \$relink_command); then :
 
2886
      else
 
2887
        $rm \"\$progdir/\$file\"
 
2888
        exit 1
 
2889
      fi
 
2890
    fi
 
2891
 
 
2892
    $mv \"\$progdir/\$file\" \"\$progdir/\$program\" 2>/dev/null ||
 
2893
    { $rm \"\$progdir/\$program\";
 
2894
      $mv \"\$progdir/\$file\" \"\$progdir/\$program\"; }
 
2895
    $rm \"\$progdir/\$file\"
 
2896
  fi"
 
2897
        else
 
2898
          echo >> $output "\
 
2899
  program='$outputname'
 
2900
  progdir=\"\$thisdir/$objdir\"
 
2901
"
 
2902
        fi
 
2903
 
 
2904
        echo >> $output "\
 
2905
 
 
2906
  if test -f \"\$progdir/\$program\"; then"
 
2907
 
 
2908
        # Export our shlibpath_var if we have one.
 
2909
        if test "$shlibpath_overrides_runpath" = yes && test -n "$shlibpath_var" && test -n "$temp_rpath"; then
 
2910
          $echo >> $output "\
 
2911
    # Add our own library path to $shlibpath_var
 
2912
    $shlibpath_var=\"$temp_rpath\$$shlibpath_var\"
 
2913
 
 
2914
    # Some systems cannot cope with colon-terminated $shlibpath_var
 
2915
    # The second colon is a workaround for a bug in BeOS R4 sed
 
2916
    $shlibpath_var=\`\$echo \"X\$$shlibpath_var\" | \$Xsed -e 's/::*\$//'\`
 
2917
 
 
2918
    export $shlibpath_var
 
2919
"
 
2920
        fi
 
2921
 
 
2922
        # fixup the dll searchpath if we need to.
 
2923
        if test -n "$dllsearchpath"; then
 
2924
          $echo >> $output "\
 
2925
    # Add the dll search path components to the executable PATH
 
2926
    PATH=$dllsearchpath:\$PATH
 
2927
"
 
2928
        fi
 
2929
 
 
2930
        $echo >> $output "\
 
2931
    if test \"\$libtool_execute_magic\" != \"$magic\"; then
 
2932
      # Run the actual program with our arguments.
 
2933
"
 
2934
        case $host in
 
2935
          # win32 systems need to use the prog path for dll
 
2936
          # lookup to work
 
2937
        *-*-cygwin*)
 
2938
          $echo >> $output "\
 
2939
      exec \$progdir/\$program \${1+\"\$@\"}
 
2940
"
 
2941
          ;;
 
2942
 
 
2943
        # Backslashes separate directories on plain windows
 
2944
        *-*-mingw | *-*-os2*)
 
2945
          $echo >> $output "\
 
2946
      exec \$progdir\\\\\$program \${1+\"\$@\"}
 
2947
"
 
2948
          ;;
 
2949
 
 
2950
        *)
 
2951
          $echo >> $output "\
 
2952
      # Export the path to the program.
 
2953
      PATH=\"\$progdir:\$PATH\"
 
2954
      export PATH
 
2955
 
 
2956
      exec \$program \${1+\"\$@\"}
 
2957
"
 
2958
          ;;
 
2959
        esac
 
2960
        $echo >> $output "\
 
2961
      \$echo \"\$0: cannot exec \$program \${1+\"\$@\"}\"
 
2962
      exit 1
 
2963
    fi
 
2964
  else
 
2965
    # The program doesn't exist.
 
2966
    \$echo \"\$0: error: \$progdir/\$program does not exist\" 1>&2
 
2967
    \$echo \"This script is just a wrapper for \$program.\" 1>&2
 
2968
    echo \"See the $PACKAGE documentation for more information.\" 1>&2
 
2969
    exit 1
 
2970
  fi
 
2971
fi\
 
2972
"
 
2973
        chmod +x $output
 
2974
      fi
 
2975
      exit 0
 
2976
      ;;
 
2977
    esac
 
2978
 
 
2979
    # See if we need to build an old-fashioned archive.
 
2980
    for oldlib in $oldlibs; do
 
2981
 
 
2982
      if test "$build_libtool_libs" = convenience; then
 
2983
        oldobjs="$libobjs_save"
 
2984
        addlibs="$convenience"
 
2985
        build_libtool_libs=no
 
2986
      else
 
2987
        if test "$build_libtool_libs" = module; then
 
2988
          oldobjs="$libobjs_save"
 
2989
          build_libtool_libs=no
 
2990
        else
 
2991
          oldobjs="$objs "`$echo "X$libobjs_save" | $SP2NL | $Xsed -e '/\.'${libext}'$/d' -e '/\.lib$/d' -e "$lo2o" | $NL2SP`
 
2992
        fi
 
2993
        addlibs="$old_convenience"
 
2994
      fi
 
2995
 
 
2996
      if test -n "$addlibs"; then
 
2997
        gentop="$output_objdir/${outputname}x"
 
2998
        $show "${rm}r $gentop"
 
2999
        $run ${rm}r "$gentop"
 
3000
        $show "mkdir $gentop"
 
3001
        $run mkdir "$gentop"
 
3002
        status=$?
 
3003
        if test $status -ne 0 && test ! -d "$gentop"; then
 
3004
          exit $status
 
3005
        fi
 
3006
        generated="$generated $gentop"
 
3007
          
 
3008
        # Add in members from convenience archives.
 
3009
        for xlib in $addlibs; do
 
3010
          # Extract the objects.
 
3011
          case "$xlib" in
 
3012
          [\\/]* | [A-Za-z]:[\\/]*) xabs="$xlib" ;;
 
3013
          *) xabs=`pwd`"/$xlib" ;;
 
3014
          esac
 
3015
          xlib=`$echo "X$xlib" | $Xsed -e 's%^.*/%%'`
 
3016
          xdir="$gentop/$xlib"
 
3017
 
 
3018
          $show "${rm}r $xdir"
 
3019
          $run ${rm}r "$xdir"
 
3020
          $show "mkdir $xdir"
 
3021
          $run mkdir "$xdir"
 
3022
          status=$?
 
3023
          if test $status -ne 0 && test ! -d "$xdir"; then
 
3024
            exit $status
 
3025
          fi
 
3026
          $show "(cd $xdir && $AR x $xabs)"
 
3027
          $run eval "(cd \$xdir && $AR x \$xabs)" || exit $?
 
3028
 
 
3029
          oldobjs="$oldobjs "`find $xdir -name \*.${objext} -print -o -name \*.lo -print | $NL2SP`
 
3030
        done
 
3031
      fi
 
3032
 
 
3033
      # Do each command in the archive commands.
 
3034
      if test -n "$old_archive_from_new_cmds" && test "$build_libtool_libs" = yes; then
 
3035
        eval cmds=\"$old_archive_from_new_cmds\"
 
3036
      else
 
3037
        # Ensure that we have .o objects in place in case we decided
 
3038
        # not to build a shared library, and have fallen back to building
 
3039
        # static libs even though --disable-static was passed!
 
3040
        for oldobj in $oldobjs; do
 
3041
          if test ! -f $oldobj; then
 
3042
            xdir=`$echo "X$oldobj" | $Xsed -e 's%/[^/]*$%%'`
 
3043
            if test "X$xdir" = "X$oldobj"; then
 
3044
              xdir="."
 
3045
            else
 
3046
              xdir="$xdir"
 
3047
            fi
 
3048
            baseobj=`$echo "X$oldobj" | $Xsed -e 's%^.*/%%'`
 
3049
            obj=`$echo "X$baseobj" | $Xsed -e "$o2lo"`
 
3050
            $show "(cd $xdir && ${LN_S} $obj $baseobj)"
 
3051
            $run eval '(cd $xdir && ${LN_S} $obj $baseobj)' || exit $?
 
3052
          fi
 
3053
        done
 
3054
 
 
3055
        eval cmds=\"$old_archive_cmds\"
 
3056
      fi
 
3057
      IFS="${IFS=       }"; save_ifs="$IFS"; IFS='~'
 
3058
      for cmd in $cmds; do
 
3059
        IFS="$save_ifs"
 
3060
        $show "$cmd"
 
3061
        $run eval "$cmd" || exit $?
 
3062
      done
 
3063
      IFS="$save_ifs"
 
3064
    done
 
3065
 
 
3066
    if test -n "$generated"; then
 
3067
      $show "${rm}r$generated"
 
3068
      $run ${rm}r$generated
 
3069
    fi
 
3070
 
 
3071
    # Now create the libtool archive.
 
3072
    case "$output" in
 
3073
    *.la)
 
3074
      old_library=
 
3075
      test "$build_old_libs" = yes && old_library="$libname.$libext"
 
3076
      $show "creating $output"
 
3077
 
 
3078
      if test -n "$xrpath"; then
 
3079
        temp_xrpath=
 
3080
        for libdir in $xrpath; do
 
3081
          temp_xrpath="$temp_xrpath -R$libdir"
 
3082
        done
 
3083
        dependency_libs="$temp_xrpath $dependency_libs"
 
3084
      fi
 
3085
 
 
3086
      # Only create the output if not a dry run.
 
3087
      if test -z "$run"; then
 
3088
        for installed in no yes; do
 
3089
          if test "$installed" = yes; then
 
3090
            if test -z "$install_libdir"; then
 
3091
              break
 
3092
            fi
 
3093
            output="$output_objdir/$outputname"i
 
3094
          fi
 
3095
          $rm $output
 
3096
          $echo > $output "\
 
3097
# $outputname - a libtool library file
 
3098
# Generated by $PROGRAM - GNU $PACKAGE $VERSION$TIMESTAMP
 
3099
#
 
3100
# Please DO NOT delete this file!
 
3101
# It is necessary for linking the library.
 
3102
 
 
3103
# The name that we can dlopen(3).
 
3104
dlname='$dlname'
 
3105
 
 
3106
# Names of this library.
 
3107
library_names='$library_names'
 
3108
 
 
3109
# The name of the static archive.
 
3110
old_library='$old_library'
 
3111
 
 
3112
# Libraries that this one depends upon.
 
3113
dependency_libs='$dependency_libs'
 
3114
 
 
3115
# Version information for $libname.
 
3116
current=$current
 
3117
age=$age
 
3118
revision=$revision
 
3119
 
 
3120
# Is this an already installed library?
 
3121
installed=$installed
 
3122
 
 
3123
# Directory that this library needs to be installed in:
 
3124
libdir='$install_libdir'\
 
3125
"
 
3126
        done
 
3127
      fi
 
3128
 
 
3129
      # Do a symbolic link so that the libtool archive can be found in
 
3130
      # LD_LIBRARY_PATH before the program is installed.
 
3131
      $show "(cd $output_objdir && $rm $outputname && $LN_S ../$outputname $outputname)"
 
3132
      $run eval "(cd $output_objdir && $rm $outputname && $LN_S ../$outputname $outputname)" || exit $?
 
3133
      ;;
 
3134
    esac
 
3135
    exit 0
 
3136
    ;;
 
3137
 
 
3138
  # libtool install mode
 
3139
  install)
 
3140
    modename="$modename: install"
 
3141
 
 
3142
    # There may be an optional sh(1) argument at the beginning of
 
3143
    # install_prog (especially on Windows NT).
 
3144
    if test "$nonopt" = "$SHELL" || test "$nonopt" = /bin/sh; then
 
3145
      # Aesthetically quote it.
 
3146
      arg=`$echo "X$nonopt" | $Xsed -e "$sed_quote_subst"`
 
3147
      case "$arg" in
 
3148
      *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \     ]*|*]*)
 
3149
        arg="\"$arg\""
 
3150
        ;;
 
3151
      esac
 
3152
      install_prog="$arg "
 
3153
      arg="$1"
 
3154
      shift
 
3155
    else
 
3156
      install_prog=
 
3157
      arg="$nonopt"
 
3158
    fi
 
3159
 
 
3160
    # The real first argument should be the name of the installation program.
 
3161
    # Aesthetically quote it.
 
3162
    arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`
 
3163
    case "$arg" in
 
3164
    *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \       ]*|*]*)
 
3165
      arg="\"$arg\""
 
3166
      ;;
 
3167
    esac
 
3168
    install_prog="$install_prog$arg"
 
3169
 
 
3170
    # We need to accept at least all the BSD install flags.
 
3171
    dest=
 
3172
    files=
 
3173
    opts=
 
3174
    prev=
 
3175
    install_type=
 
3176
    isdir=no
 
3177
    stripme=
 
3178
    for arg
 
3179
    do
 
3180
      if test -n "$dest"; then
 
3181
        files="$files $dest"
 
3182
        dest="$arg"
 
3183
        continue
 
3184
      fi
 
3185
 
 
3186
      case "$arg" in
 
3187
      -d) isdir=yes ;;
 
3188
      -f) prev="-f" ;;
 
3189
      -g) prev="-g" ;;
 
3190
      -m) prev="-m" ;;
 
3191
      -o) prev="-o" ;;
 
3192
      -s)
 
3193
        stripme=" -s"
 
3194
        continue
 
3195
        ;;
 
3196
      -*) ;;
 
3197
 
 
3198
      *)
 
3199
        # If the previous option needed an argument, then skip it.
 
3200
        if test -n "$prev"; then
 
3201
          prev=
 
3202
        else
 
3203
          dest="$arg"
 
3204
          continue
 
3205
        fi
 
3206
        ;;
 
3207
      esac
 
3208
 
 
3209
      # Aesthetically quote the argument.
 
3210
      arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`
 
3211
      case "$arg" in
 
3212
      *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \     ]*|*]*)
 
3213
        arg="\"$arg\""
 
3214
        ;;
 
3215
      esac
 
3216
      install_prog="$install_prog $arg"
 
3217
    done
 
3218
 
 
3219
    if test -z "$install_prog"; then
 
3220
      $echo "$modename: you must specify an install program" 1>&2
 
3221
      $echo "$help" 1>&2
 
3222
      exit 1
 
3223
    fi
 
3224
 
 
3225
    if test -n "$prev"; then
 
3226
      $echo "$modename: the \`$prev' option requires an argument" 1>&2
 
3227
      $echo "$help" 1>&2
 
3228
      exit 1
 
3229
    fi
 
3230
 
 
3231
    if test -z "$files"; then
 
3232
      if test -z "$dest"; then
 
3233
        $echo "$modename: no file or destination specified" 1>&2
 
3234
      else
 
3235
        $echo "$modename: you must specify a destination" 1>&2
 
3236
      fi
 
3237
      $echo "$help" 1>&2
 
3238
      exit 1
 
3239
    fi
 
3240
 
 
3241
    # Strip any trailing slash from the destination.
 
3242
    dest=`$echo "X$dest" | $Xsed -e 's%/$%%'`
 
3243
 
 
3244
    # Check to see that the destination is a directory.
 
3245
    test -d "$dest" && isdir=yes
 
3246
    if test "$isdir" = yes; then
 
3247
      destdir="$dest"
 
3248
      destname=
 
3249
    else
 
3250
      destdir=`$echo "X$dest" | $Xsed -e 's%/[^/]*$%%'`
 
3251
      test "X$destdir" = "X$dest" && destdir=.
 
3252
      destname=`$echo "X$dest" | $Xsed -e 's%^.*/%%'`
 
3253
 
 
3254
      # Not a directory, so check to see that there is only one file specified.
 
3255
      set dummy $files
 
3256
      if test $# -gt 2; then
 
3257
        $echo "$modename: \`$dest' is not a directory" 1>&2
 
3258
        $echo "$help" 1>&2
 
3259
        exit 1
 
3260
      fi
 
3261
    fi
 
3262
    case "$destdir" in
 
3263
    [\\/]* | [A-Za-z]:[\\/]*) ;;
 
3264
    *)
 
3265
      for file in $files; do
 
3266
        case "$file" in
 
3267
        *.lo) ;;
 
3268
        *)
 
3269
          $echo "$modename: \`$destdir' must be an absolute directory name" 1>&2
 
3270
          $echo "$help" 1>&2
 
3271
          exit 1
 
3272
          ;;
 
3273
        esac
 
3274
      done
 
3275
      ;;
 
3276
    esac
 
3277
 
 
3278
    # This variable tells wrapper scripts just to set variables rather
 
3279
    # than running their programs.
 
3280
    libtool_install_magic="$magic"
 
3281
 
 
3282
    staticlibs=
 
3283
    future_libdirs=
 
3284
    current_libdirs=
 
3285
    for file in $files; do
 
3286
 
 
3287
      # Do each installation.
 
3288
      case "$file" in
 
3289
      *.a | *.lib)
 
3290
        # Do the static libraries later.
 
3291
        staticlibs="$staticlibs $file"
 
3292
        ;;
 
3293
 
 
3294
      *.la)
 
3295
        # Check to see that this really is a libtool archive.
 
3296
        if (sed -e '2q' $file | egrep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then :
 
3297
        else
 
3298
          $echo "$modename: \`$file' is not a valid libtool archive" 1>&2
 
3299
          $echo "$help" 1>&2
 
3300
          exit 1
 
3301
        fi
 
3302
 
 
3303
        library_names=
 
3304
        old_library=
 
3305
        # If there is no directory component, then add one.
 
3306
        case "$file" in
 
3307
        */* | *\\*) . $file ;;
 
3308
        *) . ./$file ;;
 
3309
        esac
 
3310
 
 
3311
        # Add the libdir to current_libdirs if it is the destination.
 
3312
        if test "X$destdir" = "X$libdir"; then
 
3313
          case "$current_libdirs " in
 
3314
          *" $libdir "*) ;;
 
3315
          *) current_libdirs="$current_libdirs $libdir" ;;
 
3316
          esac
 
3317
        else
 
3318
          # Note the libdir as a future libdir.
 
3319
          case "$future_libdirs " in
 
3320
          *" $libdir "*) ;;
 
3321
          *) future_libdirs="$future_libdirs $libdir" ;;
 
3322
          esac
 
3323
        fi
 
3324
 
 
3325
        dir="`$echo "X$file" | $Xsed -e 's%/[^/]*$%%'`/"
 
3326
        test "X$dir" = "X$file/" && dir=
 
3327
        dir="$dir$objdir"
 
3328
 
 
3329
        # See the names of the shared library.
 
3330
        set dummy $library_names
 
3331
        if test -n "$2"; then
 
3332
          realname="$2"
 
3333
          shift
 
3334
          shift
 
3335
 
 
3336
          # Install the shared library and build the symlinks.
 
3337
          $show "$install_prog $dir/$realname $destdir/$realname"
 
3338
          $run eval "$install_prog $dir/$realname $destdir/$realname" || exit $?
 
3339
 
 
3340
          if test $# -gt 0; then
 
3341
            # Delete the old symlinks, and create new ones.
 
3342
            for linkname
 
3343
            do
 
3344
              if test "$linkname" != "$realname"; then
 
3345
                $show "(cd $destdir && $rm $linkname && $LN_S $realname $linkname)"
 
3346
                $run eval "(cd $destdir && $rm $linkname && $LN_S $realname $linkname)"
 
3347
              fi
 
3348
            done
 
3349
          fi
 
3350
 
 
3351
          # Do each command in the postinstall commands.
 
3352
          lib="$destdir/$realname"
 
3353
          eval cmds=\"$postinstall_cmds\"
 
3354
          IFS="${IFS=   }"; save_ifs="$IFS"; IFS='~'
 
3355
          for cmd in $cmds; do
 
3356
            IFS="$save_ifs"
 
3357
            $show "$cmd"
 
3358
            $run eval "$cmd" || exit $?
 
3359
          done
 
3360
          IFS="$save_ifs"
 
3361
        fi
 
3362
 
 
3363
        # Install the pseudo-library for information purposes.
 
3364
        name=`$echo "X$file" | $Xsed -e 's%^.*/%%'`
 
3365
        instname="$dir/$name"i
 
3366
        $show "$install_prog $instname $destdir/$name"
 
3367
        $run eval "$install_prog $instname $destdir/$name" || exit $?
 
3368
 
 
3369
        # Maybe install the static library, too.
 
3370
        test -n "$old_library" && staticlibs="$staticlibs $dir/$old_library"
 
3371
        ;;
 
3372
 
 
3373
      *.lo)
 
3374
        # Install (i.e. copy) a libtool object.
 
3375
 
 
3376
        # Figure out destination file name, if it wasn't already specified.
 
3377
        if test -n "$destname"; then
 
3378
          destfile="$destdir/$destname"
 
3379
        else
 
3380
          destfile=`$echo "X$file" | $Xsed -e 's%^.*/%%'`
 
3381
          destfile="$destdir/$destfile"
 
3382
        fi
 
3383
 
 
3384
        # Deduce the name of the destination old-style object file.
 
3385
        case "$destfile" in
 
3386
        *.lo)
 
3387
          staticdest=`$echo "X$destfile" | $Xsed -e "$lo2o"`
 
3388
          ;;
 
3389
        *.o | *.obj)
 
3390
          staticdest="$destfile"
 
3391
          destfile=
 
3392
          ;;
 
3393
        *)
 
3394
          $echo "$modename: cannot copy a libtool object to \`$destfile'" 1>&2
 
3395
          $echo "$help" 1>&2
 
3396
          exit 1
 
3397
          ;;
 
3398
        esac
 
3399
 
 
3400
        # Install the libtool object if requested.
 
3401
        if test -n "$destfile"; then
 
3402
          $show "$install_prog $file $destfile"
 
3403
          $run eval "$install_prog $file $destfile" || exit $?
 
3404
        fi
 
3405
 
 
3406
        # Install the old object if enabled.
 
3407
        if test "$build_old_libs" = yes; then
 
3408
          # Deduce the name of the old-style object file.
 
3409
          staticobj=`$echo "X$file" | $Xsed -e "$lo2o"`
 
3410
 
 
3411
          $show "$install_prog $staticobj $staticdest"
 
3412
          $run eval "$install_prog \$staticobj \$staticdest" || exit $?
 
3413
        fi
 
3414
        exit 0
 
3415
        ;;
 
3416
 
 
3417
      *)
 
3418
        # Figure out destination file name, if it wasn't already specified.
 
3419
        if test -n "$destname"; then
 
3420
          destfile="$destdir/$destname"
 
3421
        else
 
3422
          destfile=`$echo "X$file" | $Xsed -e 's%^.*/%%'`
 
3423
          destfile="$destdir/$destfile"
 
3424
        fi
 
3425
 
 
3426
        # Do a test to see if this is really a libtool program.
 
3427
        if (sed -e '4q' $file | egrep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then
 
3428
          link_against_libtool_libs=
 
3429
          relink_command=
 
3430
 
 
3431
          # If there is no directory component, then add one.
 
3432
          case "$file" in
 
3433
          */* | *\\*) . $file ;;
 
3434
          *) . ./$file ;;
 
3435
          esac
 
3436
 
 
3437
          # Check the variables that should have been set.
 
3438
          if test -z "$link_against_libtool_libs"; then
 
3439
            $echo "$modename: invalid libtool wrapper script \`$file'" 1>&2
 
3440
            exit 1
 
3441
          fi
 
3442
 
 
3443
          finalize=yes
 
3444
          for lib in $link_against_libtool_libs; do
 
3445
            # Check to see that each library is installed.
 
3446
            libdir=
 
3447
            if test -f "$lib"; then
 
3448
              # If there is no directory component, then add one.
 
3449
              case "$lib" in
 
3450
              */* | *\\*) . $lib ;;
 
3451
              *) . ./$lib ;;
 
3452
              esac
 
3453
            fi
 
3454
            libfile="$libdir/`$echo "X$lib" | $Xsed -e 's%^.*/%%g'`"
 
3455
            if test -n "$libdir" && test ! -f "$libfile"; then
 
3456
              $echo "$modename: warning: \`$lib' has not been installed in \`$libdir'" 1>&2
 
3457
              finalize=no
 
3458
            fi
 
3459
          done
 
3460
 
 
3461
          outputname=
 
3462
          if test "$fast_install" = no && test -n "$relink_command"; then
 
3463
            if test "$finalize" = yes && test -z "$run"; then
 
3464
              tmpdir="/tmp"
 
3465
              test -n "$TMPDIR" && tmpdir="$TMPDIR"
 
3466
              tmpdir="$tmpdir/libtool-$$"
 
3467
              if $mkdir -p "$tmpdir" && chmod 700 "$tmpdir"; then :
 
3468
              else
 
3469
                $echo "$modename: error: cannot create temporary directory \`$tmpdir'" 1>&2
 
3470
                continue
 
3471
              fi
 
3472
              outputname="$tmpdir/$file"
 
3473
              # Replace the output file specification.
 
3474
              relink_command=`$echo "X$relink_command" | $Xsed -e 's%@OUTPUT@%'"$outputname"'%g'`
 
3475
 
 
3476
              $show "$relink_command"
 
3477
              if $run eval "$relink_command"; then :
 
3478
              else
 
3479
                $echo "$modename: error: relink \`$file' with the above command before installing it" 1>&2
 
3480
                ${rm}r "$tmpdir"
 
3481
                continue
 
3482
              fi
 
3483
              file="$outputname"
 
3484
            else
 
3485
              $echo "$modename: warning: cannot relink \`$file'" 1>&2
 
3486
            fi
 
3487
          else
 
3488
            # Install the binary that we compiled earlier.
 
3489
            file=`$echo "X$file" | $Xsed -e "s%\([^/]*\)$%$objdir/\1%"`
 
3490
          fi
 
3491
        fi
 
3492
 
 
3493
        $show "$install_prog$stripme $file $destfile"
 
3494
        $run eval "$install_prog\$stripme \$file \$destfile" || exit $?
 
3495
        test -n "$outputname" && ${rm}r "$tmpdir"
 
3496
        ;;
 
3497
      esac
 
3498
    done
 
3499
 
 
3500
    for file in $staticlibs; do
 
3501
      name=`$echo "X$file" | $Xsed -e 's%^.*/%%'`
 
3502
 
 
3503
      # Set up the ranlib parameters.
 
3504
      oldlib="$destdir/$name"
 
3505
 
 
3506
      $show "$install_prog $file $oldlib"
 
3507
      $run eval "$install_prog \$file \$oldlib" || exit $?
 
3508
 
 
3509
      # Do each command in the postinstall commands.
 
3510
      eval cmds=\"$old_postinstall_cmds\"
 
3511
      IFS="${IFS=       }"; save_ifs="$IFS"; IFS='~'
 
3512
      for cmd in $cmds; do
 
3513
        IFS="$save_ifs"
 
3514
        $show "$cmd"
 
3515
        $run eval "$cmd" || exit $?
 
3516
      done
 
3517
      IFS="$save_ifs"
 
3518
    done
 
3519
 
 
3520
    if test -n "$future_libdirs"; then
 
3521
      $echo "$modename: warning: remember to run \`$progname --finish$future_libdirs'" 1>&2
 
3522
    fi
 
3523
 
 
3524
    if test -n "$current_libdirs"; then
 
3525
      # Maybe just do a dry run.
 
3526
      test -n "$run" && current_libdirs=" -n$current_libdirs"
 
3527
      exec $SHELL $0 --finish$current_libdirs
 
3528
      exit 1
 
3529
    fi
 
3530
 
 
3531
    exit 0
 
3532
    ;;
 
3533
 
 
3534
  # libtool finish mode
 
3535
  finish)
 
3536
    modename="$modename: finish"
 
3537
    libdirs="$nonopt"
 
3538
    admincmds=
 
3539
 
 
3540
    if test -n "$finish_cmds$finish_eval" && test -n "$libdirs"; then
 
3541
      for dir
 
3542
      do
 
3543
        libdirs="$libdirs $dir"
 
3544
      done
 
3545
 
 
3546
      for libdir in $libdirs; do
 
3547
        if test -n "$finish_cmds"; then
 
3548
          # Do each command in the finish commands.
 
3549
          eval cmds=\"$finish_cmds\"
 
3550
          IFS="${IFS=   }"; save_ifs="$IFS"; IFS='~'
 
3551
          for cmd in $cmds; do
 
3552
            IFS="$save_ifs"
 
3553
            $show "$cmd"
 
3554
            $run eval "$cmd" || admincmds="$admincmds
 
3555
       $cmd"
 
3556
          done
 
3557
          IFS="$save_ifs"
 
3558
        fi
 
3559
        if test -n "$finish_eval"; then
 
3560
          # Do the single finish_eval.
 
3561
          eval cmds=\"$finish_eval\"
 
3562
          $run eval "$cmds" || admincmds="$admincmds
 
3563
       $cmds"
 
3564
        fi
 
3565
      done
 
3566
    fi
 
3567
 
 
3568
    # Exit here if they wanted silent mode.
 
3569
    test "$show" = : && exit 0
 
3570
 
 
3571
    echo "----------------------------------------------------------------------"
 
3572
    echo "Libraries have been installed in:"
 
3573
    for libdir in $libdirs; do
 
3574
      echo "   $libdir"
 
3575
    done
 
3576
    echo
 
3577
    echo "If you ever happen to want to link against installed libraries"
 
3578
    echo "in a given directory, LIBDIR, you must either use libtool, and"
 
3579
    echo "specify the full pathname of the library, or use \`-LLIBDIR'"
 
3580
    echo "flag during linking and do at least one of the following:"
 
3581
    if test -n "$shlibpath_var"; then
 
3582
      echo "   - add LIBDIR to the \`$shlibpath_var' environment variable"
 
3583
      echo "     during execution"
 
3584
    fi
 
3585
    if test -n "$runpath_var"; then
 
3586
      echo "   - add LIBDIR to the \`$runpath_var' environment variable"
 
3587
      echo "     during linking"
 
3588
    fi
 
3589
    if test -n "$hardcode_libdir_flag_spec"; then
 
3590
      libdir=LIBDIR
 
3591
      eval flag=\"$hardcode_libdir_flag_spec\"
 
3592
 
 
3593
      echo "   - use the \`$flag' linker flag"
 
3594
    fi
 
3595
    if test -n "$admincmds"; then
 
3596
      echo "   - have your system administrator run these commands:$admincmds"
 
3597
    fi
 
3598
    if test -f /etc/ld.so.conf; then
 
3599
      echo "   - have your system administrator add LIBDIR to \`/etc/ld.so.conf'"
 
3600
    fi
 
3601
    echo
 
3602
    echo "See any operating system documentation about shared libraries for"
 
3603
    echo "more information, such as the ld(1) and ld.so(8) manual pages."
 
3604
    echo "----------------------------------------------------------------------"
 
3605
    exit 0
 
3606
    ;;
 
3607
 
 
3608
  # libtool execute mode
 
3609
  execute)
 
3610
    modename="$modename: execute"
 
3611
 
 
3612
    # The first argument is the command name.
 
3613
    cmd="$nonopt"
 
3614
    if test -z "$cmd"; then
 
3615
      $echo "$modename: you must specify a COMMAND" 1>&2
 
3616
      $echo "$help"
 
3617
      exit 1
 
3618
    fi
 
3619
 
 
3620
    # Handle -dlopen flags immediately.
 
3621
    for file in $execute_dlfiles; do
 
3622
      if test ! -f "$file"; then
 
3623
        $echo "$modename: \`$file' is not a file" 1>&2
 
3624
        $echo "$help" 1>&2
 
3625
        exit 1
 
3626
      fi
 
3627
 
 
3628
      dir=
 
3629
      case "$file" in
 
3630
      *.la)
 
3631
        # Check to see that this really is a libtool archive.
 
3632
        if (sed -e '2q' $file | egrep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then :
 
3633
        else
 
3634
          $echo "$modename: \`$lib' is not a valid libtool archive" 1>&2
 
3635
          $echo "$help" 1>&2
 
3636
          exit 1
 
3637
        fi
 
3638
 
 
3639
        # Read the libtool library.
 
3640
        dlname=
 
3641
        library_names=
 
3642
 
 
3643
        # If there is no directory component, then add one.
 
3644
        case "$file" in
 
3645
        */* | *\\*) . $file ;;
 
3646
        *) . ./$file ;;
 
3647
        esac
 
3648
 
 
3649
        # Skip this library if it cannot be dlopened.
 
3650
        if test -z "$dlname"; then
 
3651
          # Warn if it was a shared library.
 
3652
          test -n "$library_names" && $echo "$modename: warning: \`$file' was not linked with \`-export-dynamic'"
 
3653
          continue
 
3654
        fi
 
3655
 
 
3656
        dir=`$echo "X$file" | $Xsed -e 's%/[^/]*$%%'`
 
3657
        test "X$dir" = "X$file" && dir=.
 
3658
 
 
3659
        if test -f "$dir/$objdir/$dlname"; then
 
3660
          dir="$dir/$objdir"
 
3661
        else
 
3662
          $echo "$modename: cannot find \`$dlname' in \`$dir' or \`$dir/$objdir'" 1>&2
 
3663
          exit 1
 
3664
        fi
 
3665
        ;;
 
3666
 
 
3667
      *.lo)
 
3668
        # Just add the directory containing the .lo file.
 
3669
        dir=`$echo "X$file" | $Xsed -e 's%/[^/]*$%%'`
 
3670
        test "X$dir" = "X$file" && dir=.
 
3671
        ;;
 
3672
 
 
3673
      *)
 
3674
        $echo "$modename: warning \`-dlopen' is ignored for non-libtool libraries and objects" 1>&2
 
3675
        continue
 
3676
        ;;
 
3677
      esac
 
3678
 
 
3679
      # Get the absolute pathname.
 
3680
      absdir=`cd "$dir" && pwd`
 
3681
      test -n "$absdir" && dir="$absdir"
 
3682
 
 
3683
      # Now add the directory to shlibpath_var.
 
3684
      if eval "test -z \"\$$shlibpath_var\""; then
 
3685
        eval "$shlibpath_var=\"\$dir\""
 
3686
      else
 
3687
        eval "$shlibpath_var=\"\$dir:\$$shlibpath_var\""
 
3688
      fi
 
3689
    done
 
3690
 
 
3691
    # This variable tells wrapper scripts just to set shlibpath_var
 
3692
    # rather than running their programs.
 
3693
    libtool_execute_magic="$magic"
 
3694
 
 
3695
    # Check if any of the arguments is a wrapper script.
 
3696
    args=
 
3697
    for file
 
3698
    do
 
3699
      case "$file" in
 
3700
      -*) ;;
 
3701
      *)
 
3702
        # Do a test to see if this is really a libtool program.
 
3703
        if (sed -e '4q' $file | egrep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then
 
3704
          # If there is no directory component, then add one.
 
3705
          case "$file" in
 
3706
          */* | *\\*) . $file ;;
 
3707
          *) . ./$file ;;
 
3708
          esac
 
3709
 
 
3710
          # Transform arg to wrapped name.
 
3711
          file="$progdir/$program"
 
3712
        fi
 
3713
        ;;
 
3714
      esac
 
3715
      # Quote arguments (to preserve shell metacharacters).
 
3716
      file=`$echo "X$file" | $Xsed -e "$sed_quote_subst"`
 
3717
      args="$args \"$file\""
 
3718
    done
 
3719
 
 
3720
    if test -z "$run"; then
 
3721
      if test -n "$shlibpath_var"; then
 
3722
        # Export the shlibpath_var.
 
3723
        eval "export $shlibpath_var"
 
3724
      fi
 
3725
 
 
3726
      # Restore saved enviroment variables
 
3727
      if test "${save_LC_ALL+set}" = set; then
 
3728
        LC_ALL="$save_LC_ALL"; export LC_ALL
 
3729
      fi
 
3730
      if test "${save_LANG+set}" = set; then
 
3731
        LANG="$save_LANG"; export LANG
 
3732
      fi
 
3733
 
 
3734
      # Now actually exec the command.
 
3735
      eval "exec \$cmd$args"
 
3736
 
 
3737
      $echo "$modename: cannot exec \$cmd$args"
 
3738
      exit 1
 
3739
    else
 
3740
      # Display what would be done.
 
3741
      if test -n "$shlibpath_var"; then
 
3742
        eval "\$echo \"\$shlibpath_var=\$$shlibpath_var\""
 
3743
        $echo "export $shlibpath_var"
 
3744
      fi
 
3745
      $echo "$cmd$args"
 
3746
      exit 0
 
3747
    fi
 
3748
    ;;
 
3749
 
 
3750
  # libtool uninstall mode
 
3751
  uninstall)
 
3752
    modename="$modename: uninstall"
 
3753
    rm="$nonopt"
 
3754
    files=
 
3755
 
 
3756
    for arg
 
3757
    do
 
3758
      case "$arg" in
 
3759
      -*) rm="$rm $arg" ;;
 
3760
      *) files="$files $arg" ;;
 
3761
      esac
 
3762
    done
 
3763
 
 
3764
    if test -z "$rm"; then
 
3765
      $echo "$modename: you must specify an RM program" 1>&2
 
3766
      $echo "$help" 1>&2
 
3767
      exit 1
 
3768
    fi
 
3769
 
 
3770
    for file in $files; do
 
3771
      dir=`$echo "X$file" | $Xsed -e 's%/[^/]*$%%'`
 
3772
      test "X$dir" = "X$file" && dir=.
 
3773
      name=`$echo "X$file" | $Xsed -e 's%^.*/%%'`
 
3774
 
 
3775
      rmfiles="$file"
 
3776
 
 
3777
      case "$name" in
 
3778
      *.la)
 
3779
        # Possibly a libtool archive, so verify it.
 
3780
        if (sed -e '2q' $file | egrep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then
 
3781
          . $dir/$name
 
3782
 
 
3783
          # Delete the libtool libraries and symlinks.
 
3784
          for n in $library_names; do
 
3785
            rmfiles="$rmfiles $dir/$n"
 
3786
          done
 
3787
          test -n "$old_library" && rmfiles="$rmfiles $dir/$old_library"
 
3788
 
 
3789
          $show "$rm $rmfiles"
 
3790
          $run $rm $rmfiles
 
3791
 
 
3792
          if test -n "$library_names"; then
 
3793
            # Do each command in the postuninstall commands.
 
3794
            eval cmds=\"$postuninstall_cmds\"
 
3795
            IFS="${IFS=         }"; save_ifs="$IFS"; IFS='~'
 
3796
            for cmd in $cmds; do
 
3797
              IFS="$save_ifs"
 
3798
              $show "$cmd"
 
3799
              $run eval "$cmd"
 
3800
            done
 
3801
            IFS="$save_ifs"
 
3802
          fi
 
3803
 
 
3804
          if test -n "$old_library"; then
 
3805
            # Do each command in the old_postuninstall commands.
 
3806
            eval cmds=\"$old_postuninstall_cmds\"
 
3807
            IFS="${IFS=         }"; save_ifs="$IFS"; IFS='~'
 
3808
            for cmd in $cmds; do
 
3809
              IFS="$save_ifs"
 
3810
              $show "$cmd"
 
3811
              $run eval "$cmd"
 
3812
            done
 
3813
            IFS="$save_ifs"
 
3814
          fi
 
3815
 
 
3816
          # FIXME: should reinstall the best remaining shared library.
 
3817
        fi
 
3818
        ;;
 
3819
 
 
3820
      *.lo)
 
3821
        if test "$build_old_libs" = yes; then
 
3822
          oldobj=`$echo "X$name" | $Xsed -e "$lo2o"`
 
3823
          rmfiles="$rmfiles $dir/$oldobj"
 
3824
        fi
 
3825
        $show "$rm $rmfiles"
 
3826
        $run $rm $rmfiles
 
3827
        ;;
 
3828
 
 
3829
      *)
 
3830
        $show "$rm $rmfiles"
 
3831
        $run $rm $rmfiles
 
3832
        ;;
 
3833
      esac
 
3834
    done
 
3835
    exit 0
 
3836
    ;;
 
3837
 
 
3838
  "")
 
3839
    $echo "$modename: you must specify a MODE" 1>&2
 
3840
    $echo "$generic_help" 1>&2
 
3841
    exit 1
 
3842
    ;;
 
3843
  esac
 
3844
 
 
3845
  $echo "$modename: invalid operation mode \`$mode'" 1>&2
 
3846
  $echo "$generic_help" 1>&2
 
3847
  exit 1
 
3848
fi # test -z "$show_help"
 
3849
 
 
3850
# We need to display help for each of the modes.
 
3851
case "$mode" in
 
3852
"") $echo \
 
3853
"Usage: $modename [OPTION]... [MODE-ARG]...
 
3854
 
 
3855
Provide generalized library-building support services.
 
3856
 
 
3857
    --config          show all configuration variables
 
3858
    --debug           enable verbose shell tracing
 
3859
-n, --dry-run         display commands without modifying any files
 
3860
    --features        display basic configuration information and exit
 
3861
    --finish          same as \`--mode=finish'
 
3862
    --help            display this help message and exit
 
3863
    --mode=MODE       use operation mode MODE [default=inferred from MODE-ARGS]
 
3864
    --quiet           same as \`--silent'
 
3865
    --silent          don't print informational messages
 
3866
    --version         print version information
 
3867
 
 
3868
MODE must be one of the following:
 
3869
 
 
3870
      compile         compile a source file into a libtool object
 
3871
      execute         automatically set library path, then run a program
 
3872
      finish          complete the installation of libtool libraries
 
3873
      install         install libraries or executables
 
3874
      link            create a library or an executable
 
3875
      uninstall       remove libraries from an installed directory
 
3876
 
 
3877
MODE-ARGS vary depending on the MODE.  Try \`$modename --help --mode=MODE' for
 
3878
a more detailed description of MODE."
 
3879
  exit 0
 
3880
  ;;
 
3881
 
 
3882
compile)
 
3883
  $echo \
 
3884
"Usage: $modename [OPTION]... --mode=compile COMPILE-COMMAND... SOURCEFILE
 
3885
 
 
3886
Compile a source file into a libtool library object.
 
3887
 
 
3888
This mode accepts the following additional options:
 
3889
 
 
3890
  -o OUTPUT-FILE    set the output file name to OUTPUT-FILE
 
3891
  -static           always build a \`.o' file suitable for static linking
 
3892
 
 
3893
COMPILE-COMMAND is a command to be used in creating a \`standard' object file
 
3894
from the given SOURCEFILE.
 
3895
 
 
3896
The output file name is determined by removing the directory component from
 
3897
SOURCEFILE, then substituting the C source code suffix \`.c' with the
 
3898
library object suffix, \`.lo'."
 
3899
  ;;
 
3900
 
 
3901
execute)
 
3902
  $echo \
 
3903
"Usage: $modename [OPTION]... --mode=execute COMMAND [ARGS]...
 
3904
 
 
3905
Automatically set library path, then run a program.
 
3906
 
 
3907
This mode accepts the following additional options:
 
3908
 
 
3909
  -dlopen FILE      add the directory containing FILE to the library path
 
3910
 
 
3911
This mode sets the library path environment variable according to \`-dlopen'
 
3912
flags.
 
3913
 
 
3914
If any of the ARGS are libtool executable wrappers, then they are translated
 
3915
into their corresponding uninstalled binary, and any of their required library
 
3916
directories are added to the library path.
 
3917
 
 
3918
Then, COMMAND is executed, with ARGS as arguments."
 
3919
  ;;
 
3920
 
 
3921
finish)
 
3922
  $echo \
 
3923
"Usage: $modename [OPTION]... --mode=finish [LIBDIR]...
 
3924
 
 
3925
Complete the installation of libtool libraries.
 
3926
 
 
3927
Each LIBDIR is a directory that contains libtool libraries.
 
3928
 
 
3929
The commands that this mode executes may require superuser privileges.  Use
 
3930
the \`--dry-run' option if you just want to see what would be executed."
 
3931
  ;;
 
3932
 
 
3933
install)
 
3934
  $echo \
 
3935
"Usage: $modename [OPTION]... --mode=install INSTALL-COMMAND...
 
3936
 
 
3937
Install executables or libraries.
 
3938
 
 
3939
INSTALL-COMMAND is the installation command.  The first component should be
 
3940
either the \`install' or \`cp' program.
 
3941
 
 
3942
The rest of the components are interpreted as arguments to that command (only
 
3943
BSD-compatible install options are recognized)."
 
3944
  ;;
 
3945
 
 
3946
link)
 
3947
  $echo \
 
3948
"Usage: $modename [OPTION]... --mode=link LINK-COMMAND...
 
3949
 
 
3950
Link object files or libraries together to form another library, or to
 
3951
create an executable program.
 
3952
 
 
3953
LINK-COMMAND is a command using the C compiler that you would use to create
 
3954
a program from several object files.
 
3955
 
 
3956
The following components of LINK-COMMAND are treated specially:
 
3957
 
 
3958
  -all-static       do not do any dynamic linking at all
 
3959
  -avoid-version    do not add a version suffix if possible
 
3960
  -dlopen FILE      \`-dlpreopen' FILE if it cannot be dlopened at runtime
 
3961
  -dlpreopen FILE   link in FILE and add its symbols to lt_preloaded_symbols
 
3962
  -export-dynamic   allow symbols from OUTPUT-FILE to be resolved with dlsym(3)
 
3963
  -export-symbols SYMFILE
 
3964
                    try to export only the symbols listed in SYMFILE
 
3965
  -export-symbols-regex REGEX
 
3966
                    try to export only the symbols matching REGEX
 
3967
  -LLIBDIR          search LIBDIR for required installed libraries
 
3968
  -lNAME            OUTPUT-FILE requires the installed library libNAME
 
3969
  -module           build a library that can dlopened
 
3970
  -no-undefined     declare that a library does not refer to external symbols
 
3971
  -o OUTPUT-FILE    create OUTPUT-FILE from the specified objects
 
3972
  -release RELEASE  specify package release information
 
3973
  -rpath LIBDIR     the created library will eventually be installed in LIBDIR
 
3974
  -R[ ]LIBDIR       add LIBDIR to the runtime path of programs and libraries
 
3975
  -static           do not do any dynamic linking of libtool libraries
 
3976
  -version-info CURRENT[:REVISION[:AGE]]
 
3977
                    specify library version info [each variable defaults to 0]
 
3978
 
 
3979
All other options (arguments beginning with \`-') are ignored.
 
3980
 
 
3981
Every other argument is treated as a filename.  Files ending in \`.la' are
 
3982
treated as uninstalled libtool libraries, other files are standard or library
 
3983
object files.
 
3984
 
 
3985
If the OUTPUT-FILE ends in \`.la', then a libtool library is created,
 
3986
only library objects (\`.lo' files) may be specified, and \`-rpath' is
 
3987
required, except when creating a convenience library.
 
3988
 
 
3989
If OUTPUT-FILE ends in \`.a' or \`.lib', then a standard library is created
 
3990
using \`ar' and \`ranlib', or on Windows using \`lib'.
 
3991
 
 
3992
If OUTPUT-FILE ends in \`.lo' or \`.${objext}', then a reloadable object file
 
3993
is created, otherwise an executable program is created."
 
3994
  ;;
 
3995
 
 
3996
uninstall)
 
3997
  $echo \
 
3998
"Usage: $modename [OPTION]... --mode=uninstall RM [RM-OPTION]... FILE...
 
3999
 
 
4000
Remove libraries from an installation directory.
 
4001
 
 
4002
RM is the name of the program to use to delete files associated with each FILE
 
4003
(typically \`/bin/rm').  RM-OPTIONS are options (such as \`-f') to be passed
 
4004
to RM.
 
4005
 
 
4006
If FILE is a libtool library, all the files associated with it are deleted.
 
4007
Otherwise, only FILE itself is deleted using RM."
 
4008
  ;;
 
4009
 
 
4010
*)
 
4011
  $echo "$modename: invalid operation mode \`$mode'" 1>&2
 
4012
  $echo "$help" 1>&2
 
4013
  exit 1
 
4014
  ;;
 
4015
esac
 
4016
 
 
4017
echo
 
4018
$echo "Try \`$modename --help' for more information about other modes."
 
4019
 
 
4020
exit 0
 
4021
 
 
4022
# Local Variables:
 
4023
# mode:shell-script
 
4024
# sh-indentation:2
 
4025
# End: