~ubuntu-branches/ubuntu/intrepid/comedilib/intrepid

« back to all changes in this revision

Viewing changes to ltmain.sh

  • Committer: Bazaar Package Importer
  • Author(s): David Schleef
  • Date: 2004-11-04 11:43:51 UTC
  • mfrom: (1.1.1 upstream)
  • Revision ID: james.westby@ubuntu.com-20041104114351-a50kaei5yamka8r6
Tags: 0.7.22-2
It helps if the shared library is actually in the package.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
# ltmain.sh - Provide generalized library-building support services.
2
2
# NOTE: Changing this file will not affect anything until you rerun configure.
3
3
#
4
 
# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003
 
4
# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004
5
5
# Free Software Foundation, Inc.
6
6
# Originally by Gordon Matzigkeit <gord@gnu.ai.mit.edu>, 1996
7
7
#
24
24
# configuration script generated by Autoconf, you may include it under
25
25
# the same distribution terms that you use for the rest of that program.
26
26
 
 
27
basename="s,^.*/,,g"
 
28
 
 
29
# Work around backward compatibility issue on IRIX 6.5. On IRIX 6.4+, sh
 
30
# is ksh but when the shell is invoked as "sh" and the current value of
 
31
# the _XPG environment variable is not equal to 1 (one), the special
 
32
# positional parameter $0, within a function call, is the name of the
 
33
# function.
 
34
progpath="$0"
 
35
 
 
36
# The name of this program:
 
37
progname=`echo "$progpath" | $SED $basename`
 
38
modename="$progname"
 
39
 
 
40
# Global variables:
 
41
EXIT_SUCCESS=0
 
42
EXIT_FAILURE=1
 
43
 
 
44
PROGRAM=ltmain.sh
 
45
PACKAGE=libtool
 
46
VERSION=1.5.6
 
47
TIMESTAMP=" (1.1220.2.95 2004/04/11 05:50:42) Debian$Rev: 215 $"
 
48
 
 
49
 
27
50
# Check that we have a working $echo.
28
51
if test "X$1" = X--no-reexec; then
29
52
  # Discard the --no-reexec flag, and continue.
36
59
  :
37
60
else
38
61
  # Restart under the correct shell, and then maybe $echo will work.
39
 
  exec $SHELL "$0" --no-reexec ${1+"$@"}
 
62
  exec $SHELL "$progpath" --no-reexec ${1+"$@"}
40
63
fi
41
64
 
42
65
if test "X$1" = X--fallback-echo; then
45
68
  cat <<EOF
46
69
$*
47
70
EOF
48
 
  exit 0
 
71
  exit $EXIT_SUCCESS
49
72
fi
50
73
 
51
 
# The name of this program.
52
 
progname=`$echo "$0" | ${SED} 's%^.*/%%'`
53
 
modename="$progname"
54
 
 
55
 
# Constants.
56
 
PROGRAM=ltmain.sh
57
 
PACKAGE=libtool
58
 
VERSION=1.5.0a
59
 
TIMESTAMP=" (1.1220.2.25 2003/08/01 19:08:35) Debian$Rev: 49 $"
60
 
 
61
74
default_mode=
62
75
help="Try \`$progname --help' for more information."
63
76
magic="%%%MAGIC variable%%%"
100
113
if test "$build_libtool_libs" != yes && test "$build_old_libs" != yes; then
101
114
  $echo "$modename: not configured to build any kind of library" 1>&2
102
115
  $echo "Fatal configuration error.  See the $PACKAGE docs for more information." 1>&2
103
 
  exit 1
 
116
  exit $EXIT_FAILURE
104
117
fi
105
118
 
106
119
# Global variables.
119
132
# Shell function definitions:
120
133
# This seems to be the best place for them
121
134
 
 
135
# func_win32_libid arg
 
136
# return the library type of file 'arg'
 
137
#
122
138
# Need a lot of goo to handle *both* DLLs and import libs
123
139
# Has to be a shell function in order to 'eat' the argument
124
140
# that is supplied when $file_magic_command is called.
125
 
win32_libid () {
 
141
func_win32_libid () {
126
142
  win32_libid_type="unknown"
127
143
  win32_fileres=`file -L $1 2>/dev/null`
128
144
  case $win32_fileres in
131
147
    ;;
132
148
  *ar\ archive*) # could be an import, or static
133
149
    if eval $OBJDUMP -f $1 | $SED -e '10q' 2>/dev/null | \
134
 
      grep -E 'file format pe-i386(.*architecture: i386)?' >/dev/null ; then
 
150
      $EGREP -e 'file format pe-i386(.*architecture: i386)?' >/dev/null ; then
135
151
      win32_nmres=`eval $NM -f posix -A $1 | \
136
152
        sed -n -e '1,100{/ I /{x;/import/!{s/^/import/;h;p;};x;};}'`
137
153
      if test "X$win32_nmres" = "Ximport" ; then
141
157
      fi
142
158
    fi
143
159
    ;;
144
 
  *DLL*) 
 
160
  *DLL*)
145
161
    win32_libid_type="x86 DLL"
146
162
    ;;
147
163
  *executable*) # but shell scripts are "executable" too...
155
171
  $echo $win32_libid_type
156
172
}
157
173
 
 
174
 
 
175
# func_infer_tag arg
 
176
# Infer tagged configuration to use if any are available and
 
177
# if one wasn't chosen via the "--tag" command line option.
 
178
# Only attempt this if the compiler in the base compile
 
179
# command doesn't match the default compiler.
 
180
# arg is usually of the form 'gcc ...'
 
181
func_infer_tag () {
 
182
    if test -n "$available_tags" && test -z "$tagname"; then
 
183
      CC_quoted=
 
184
      for arg in $CC; do
 
185
        case $arg in
 
186
          *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
 
187
          arg="\"$arg\""
 
188
          ;;
 
189
        esac
 
190
        CC_quoted="$CC_quoted $arg"
 
191
      done
 
192
      case $@ in
 
193
      # Blanks in the command may have been stripped by the calling shell,
 
194
      # but not from the CC environment variable when configure was run.
 
195
      " $CC "* | "$CC "* | " `$echo $CC` "* | "`$echo $CC` "* | " $CC_quoted"* | "$CC_quoted "* | " `$echo $CC_quoted` "* | "`$echo $CC_quoted` "*) ;;
 
196
      # Blanks at the start of $base_compile will cause this to fail
 
197
      # if we don't check for them as well.
 
198
      *)
 
199
        for z in $available_tags; do
 
200
          if grep "^# ### BEGIN LIBTOOL TAG CONFIG: $z$" < "$progpath" > /dev/null; then
 
201
            # Evaluate the configuration.
 
202
            eval "`${SED} -n -e '/^# ### BEGIN LIBTOOL TAG CONFIG: '$z'$/,/^# ### END LIBTOOL TAG CONFIG: '$z'$/p' < $progpath`"
 
203
            CC_quoted=
 
204
            for arg in $CC; do
 
205
            # Double-quote args containing other shell metacharacters.
 
206
            case $arg in
 
207
              *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \     ]*|*]*|"")
 
208
              arg="\"$arg\""
 
209
              ;;
 
210
            esac
 
211
            CC_quoted="$CC_quoted $arg"
 
212
          done
 
213
            case "$@ " in
 
214
              " $CC "* | "$CC "* | " `$echo $CC` "* | "`$echo $CC` "* | " $CC_quoted"* | "$CC_quoted "* | " `$echo $CC_quoted` "* | "`$echo $CC_quoted` "*)
 
215
              # The compiler in the base compile command matches
 
216
              # the one in the tagged configuration.
 
217
              # Assume this is the tagged configuration we want.
 
218
              tagname=$z
 
219
              break
 
220
              ;;
 
221
            esac
 
222
          fi
 
223
        done
 
224
        # If $tagname still isn't set, then no tagged configuration
 
225
        # was found and let the user know that the "--tag" command
 
226
        # line option must be used.
 
227
        if test -z "$tagname"; then
 
228
          $echo "$modename: unable to infer tagged configuration"
 
229
          $echo "$modename: specify a tag with \`--tag'" 1>&2
 
230
          exit $EXIT_FAILURE
 
231
#        else
 
232
#          $echo "$modename: using $tagname tagged configuration"
 
233
        fi
 
234
        ;;
 
235
      esac
 
236
    fi
 
237
}
158
238
# End of Shell function definitions
159
239
#####################################
160
240
 
 
241
# Darwin sucks
 
242
eval std_shrext=\"$shrext_cmds\"
 
243
 
161
244
# Parse our command line options once, thoroughly.
162
245
while test "$#" -gt 0
163
246
do
177
260
      ;;
178
261
    tag)
179
262
      tagname="$arg"
 
263
      preserve_args="${preserve_args}=$arg"
180
264
 
181
265
      # Check whether tagname contains only valid characters
182
266
      case $tagname in
183
267
      *[!-_A-Za-z0-9,/]*)
184
268
        $echo "$progname: invalid tag name: $tagname" 1>&2
185
 
        exit 1
 
269
        exit $EXIT_FAILURE
186
270
        ;;
187
271
      esac
188
272
 
192
276
        # not specially marked.
193
277
        ;;
194
278
      *)
195
 
        if grep "^# ### BEGIN LIBTOOL TAG CONFIG: $tagname$" < "$0" > /dev/null; then
 
279
        if grep "^# ### BEGIN LIBTOOL TAG CONFIG: $tagname$" < "$progpath" > /dev/null; then
196
280
          taglist="$taglist $tagname"
197
281
          # Evaluate the configuration.
198
 
          eval "`${SED} -n -e '/^# ### BEGIN LIBTOOL TAG CONFIG: '$tagname'$/,/^# ### END LIBTOOL TAG CONFIG: '$tagname'$/p' < $0`"
 
282
          eval "`${SED} -n -e '/^# ### BEGIN LIBTOOL TAG CONFIG: '$tagname'$/,/^# ### END LIBTOOL TAG CONFIG: '$tagname'$/p' < $progpath`"
199
283
        else
200
284
          $echo "$progname: ignoring unknown tag $tagname" 1>&2
201
285
        fi
224
308
    $echo "Copyright (C) 2003  Free Software Foundation, Inc."
225
309
    $echo "This is free software; see the source for copying conditions.  There is NO"
226
310
    $echo "warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE."
227
 
    exit 0
 
311
    exit $EXIT_SUCCESS
228
312
    ;;
229
313
 
230
314
  --config)
231
 
    ${SED} -e '1,/^# ### BEGIN LIBTOOL CONFIG/d' -e '/^# ### END LIBTOOL CONFIG/,$d' $0
 
315
    ${SED} -e '1,/^# ### BEGIN LIBTOOL CONFIG/d' -e '/^# ### END LIBTOOL CONFIG/,$d' $progpath
232
316
    # Now print the configurations for the tags.
233
317
    for tagname in $taglist; do
234
 
      ${SED} -n -e "/^# ### BEGIN LIBTOOL TAG CONFIG: $tagname$/,/^# ### END LIBTOOL TAG CONFIG: $tagname$/p" < "$0"
 
318
      ${SED} -n -e "/^# ### BEGIN LIBTOOL TAG CONFIG: $tagname$/,/^# ### END LIBTOOL TAG CONFIG: $tagname$/p" < "$progpath"
235
319
    done
236
 
    exit 0
 
320
    exit $EXIT_SUCCESS
237
321
    ;;
238
322
 
239
323
  --debug)
240
324
    $echo "$progname: enabling shell trace mode"
241
325
    set -x
 
326
    preserve_args="$preserve_args $arg"
242
327
    ;;
243
328
 
244
329
  --dry-run | -n)
257
342
    else
258
343
      $echo "disable static libraries"
259
344
    fi
260
 
    exit 0
 
345
    exit $EXIT_SUCCESS
261
346
    ;;
262
347
 
263
348
  --finish) mode="finish" ;;
269
354
 
270
355
  --quiet | --silent)
271
356
    show=:
 
357
    preserve_args="$preserve_args $arg"
272
358
    ;;
273
359
 
274
360
  --tag) prevopt="--tag" prev=tag ;;
276
362
    set tag "$optarg" ${1+"$@"}
277
363
    shift
278
364
    prev=tag
 
365
    preserve_args="$preserve_args --tag"
279
366
    ;;
280
367
 
281
368
  -dlopen)
286
373
  -*)
287
374
    $echo "$modename: unrecognized option \`$arg'" 1>&2
288
375
    $echo "$help" 1>&2
289
 
    exit 1
 
376
    exit $EXIT_FAILURE
290
377
    ;;
291
378
 
292
379
  *)
299
386
if test -n "$prevopt"; then
300
387
  $echo "$modename: option \`$prevopt' requires an argument" 1>&2
301
388
  $echo "$help" 1>&2
302
 
  exit 1
 
389
  exit $EXIT_FAILURE
303
390
fi
304
391
 
305
392
# If this variable is set in any of the actions, the command in it
355
442
  if test -n "$execute_dlfiles" && test "$mode" != execute; then
356
443
    $echo "$modename: unrecognized option \`-dlopen'" 1>&2
357
444
    $echo "$help" 1>&2
358
 
    exit 1
 
445
    exit $EXIT_FAILURE
359
446
  fi
360
447
 
361
448
  # Change the help message to a mode-specific one.
370
457
    # Get the compilation command and the source file.
371
458
    base_compile=
372
459
    srcfile="$nonopt"  #  always keep a non-empty value in "srcfile"
 
460
    suppress_opt=yes
373
461
    suppress_output=
374
462
    arg_mode=normal
375
463
    libobj=
 
464
    later=
376
465
 
377
466
    for arg
378
467
    do
395
484
        -o)
396
485
          if test -n "$libobj" ; then
397
486
            $echo "$modename: you cannot specify \`-o' more than once" 1>&2
398
 
            exit 1
 
487
            exit $EXIT_FAILURE
399
488
          fi
400
489
          arg_mode=target
401
490
          continue
402
491
          ;;
403
492
 
404
 
        -static)
405
 
          build_old_libs=yes
406
 
          continue
407
 
          ;;
408
 
 
409
 
        -prefer-pic)
410
 
          pic_mode=yes
411
 
          continue
412
 
          ;;
413
 
 
414
 
        -prefer-non-pic)
415
 
          pic_mode=no
 
493
        -static | -prefer-pic | -prefer-non-pic)
 
494
          later="$later $arg"
 
495
          continue
 
496
          ;;
 
497
 
 
498
        -no-suppress)
 
499
          suppress_opt=no
416
500
          continue
417
501
          ;;
418
502
 
425
509
          args=`$echo "X$arg" | $Xsed -e "s/^-Wc,//"`
426
510
          lastarg=
427
511
          save_ifs="$IFS"; IFS=','
428
 
          for arg in $args; do
 
512
          for arg in $args; do
429
513
            IFS="$save_ifs"
430
514
 
431
515
            # Double-quote args containing other shell metacharacters.
475
559
    case $arg_mode in
476
560
    arg)
477
561
      $echo "$modename: you must specify an argument for -Xcompile"
478
 
      exit 1
 
562
      exit $EXIT_FAILURE
479
563
      ;;
480
564
    target)
481
565
      $echo "$modename: you must specify a target with \`-o'" 1>&2
482
 
      exit 1
 
566
      exit $EXIT_FAILURE
483
567
      ;;
484
568
    *)
485
569
      # Get the name of the library object.
512
596
    *.lo) obj=`$echo "X$libobj" | $Xsed -e "$lo2o"` ;;
513
597
    *)
514
598
      $echo "$modename: cannot determine name of library object from \`$libobj'" 1>&2
515
 
      exit 1
 
599
      exit $EXIT_FAILURE
516
600
      ;;
517
601
    esac
518
602
 
519
 
    # Infer tagged configuration to use if any are available and
520
 
    # if one wasn't chosen via the "--tag" command line option.
521
 
    # Only attempt this if the compiler in the base compile
522
 
    # command doesn't match the default compiler.
523
 
    if test -n "$available_tags" && test -z "$tagname"; then
524
 
      case $base_compile in
525
 
      # Blanks in the command may have been stripped by the calling shell,
526
 
      # but not from the CC environment variable when configure was run.
527
 
      " $CC "* | "$CC "* | " `$echo $CC` "* | "`$echo $CC` "*) ;;
528
 
      # Blanks at the start of $base_compile will cause this to fail
529
 
      # if we don't check for them as well.
530
 
      *)
531
 
        for z in $available_tags; do
532
 
          if grep "^# ### BEGIN LIBTOOL TAG CONFIG: $z$" < "$0" > /dev/null; then
533
 
            # Evaluate the configuration.
534
 
            eval "`${SED} -n -e '/^# ### BEGIN LIBTOOL TAG CONFIG: '$z'$/,/^# ### END LIBTOOL TAG CONFIG: '$z'$/p' < $0`"
535
 
            case "$base_compile " in
536
 
            "$CC "* | " $CC "* | "`$echo $CC` "* | " `$echo $CC` "*)
537
 
              # The compiler in the base compile command matches
538
 
              # the one in the tagged configuration.
539
 
              # Assume this is the tagged configuration we want.
540
 
              tagname=$z
541
 
              break
542
 
              ;;
543
 
            esac
544
 
          fi
545
 
        done
546
 
        # If $tagname still isn't set, then no tagged configuration
547
 
        # was found and let the user know that the "--tag" command
548
 
        # line option must be used.
549
 
        if test -z "$tagname"; then
550
 
          $echo "$modename: unable to infer tagged configuration"
551
 
          $echo "$modename: specify a tag with \`--tag'" 1>&2
552
 
          exit 1
553
 
#        else
554
 
#          $echo "$modename: using $tagname tagged configuration"
555
 
        fi
 
603
    func_infer_tag $base_compile
 
604
 
 
605
    for arg in $later; do
 
606
      case $arg in
 
607
      -static)
 
608
        build_old_libs=yes
 
609
        continue
 
610
        ;;
 
611
 
 
612
      -prefer-pic)
 
613
        pic_mode=yes
 
614
        continue
 
615
        ;;
 
616
 
 
617
      -prefer-non-pic)
 
618
        pic_mode=no
 
619
        continue
556
620
        ;;
557
621
      esac
558
 
    fi
 
622
    done
559
623
 
560
624
    objname=`$echo "X$obj" | $Xsed -e 's%^.*/%%'`
561
625
    xdir=`$echo "X$obj" | $Xsed -e 's%/[^/]*$%%'`
569
633
    if test -z "$base_compile"; then
570
634
      $echo "$modename: you must specify a compilation command" 1>&2
571
635
      $echo "$help" 1>&2
572
 
      exit 1
 
636
      exit $EXIT_FAILURE
573
637
    fi
574
638
 
575
639
    # Delete any leftover library objects.
580
644
    fi
581
645
 
582
646
    $run $rm $removelist
583
 
    trap "$run $rm $removelist; exit 1" 1 2 15
 
647
    trap "$run $rm $removelist; exit $EXIT_FAILURE" 1 2 15
584
648
 
585
649
    # On Cygwin there's no "real" PIC flag so we must build both object types
586
650
    case $host_os in
599
663
      output_obj=`$echo "X$srcfile" | $Xsed -e 's%^.*/%%' -e 's%\.[^.]*$%%'`.${objext}
600
664
      lockfile="$output_obj.lock"
601
665
      removelist="$removelist $output_obj $lockfile"
602
 
      trap "$run $rm $removelist; exit 1" 1 2 15
 
666
      trap "$run $rm $removelist; exit $EXIT_FAILURE" 1 2 15
603
667
    else
604
668
      output_obj=
605
669
      need_locks=no
609
673
    # Lock this critical section if it is needed
610
674
    # We use this script file to make the link, it avoids creating a new file
611
675
    if test "$need_locks" = yes; then
612
 
      until $run ln "$0" "$lockfile" 2>/dev/null; do
 
676
      until $run ln "$progpath" "$lockfile" 2>/dev/null; do
613
677
        $show "Waiting for $lockfile to be removed"
614
678
        sleep 2
615
679
      done
627
691
compiler."
628
692
 
629
693
        $run $rm $removelist
630
 
        exit 1
 
694
        exit $EXIT_FAILURE
631
695
      fi
632
696
      $echo $srcfile > "$lockfile"
633
697
    fi
682
746
      if $run eval "$command"; then :
683
747
      else
684
748
        test -n "$output_obj" && $run $rm $removelist
685
 
        exit 1
 
749
        exit $EXIT_FAILURE
686
750
      fi
687
751
 
688
752
      if test "$need_locks" = warn &&
702
766
compiler."
703
767
 
704
768
        $run $rm $removelist
705
 
        exit 1
 
769
        exit $EXIT_FAILURE
706
770
      fi
707
771
 
708
772
      # Just move the object if needed, then go on to compile the next one
723
787
EOF
724
788
 
725
789
      # Allow error messages only from the first compilation.
726
 
      suppress_output=' >/dev/null 2>&1'
 
790
      if test "$suppress_opt" = yes; then
 
791
        suppress_output=' >/dev/null 2>&1'
 
792
      fi
727
793
    else
728
794
      # No PIC object so indicate it doesn't exist in the libtool
729
795
      # object file.
752
818
      if $run eval "$command"; then :
753
819
      else
754
820
        $run $rm $removelist
755
 
        exit 1
 
821
        exit $EXIT_FAILURE
756
822
      fi
757
823
 
758
824
      if test "$need_locks" = warn &&
772
838
compiler."
773
839
 
774
840
        $run $rm $removelist
775
 
        exit 1
 
841
        exit $EXIT_FAILURE
776
842
      fi
777
843
 
778
844
      # Just move the object if needed
810
876
      $run $rm "$lockfile"
811
877
    fi
812
878
 
813
 
    exit 0
 
879
    exit $EXIT_SUCCESS
814
880
    ;;
815
881
 
816
882
  # libtool link mode
836
902
      ;;
837
903
    esac
838
904
    libtool_args="$nonopt"
839
 
    base_compile="$nonopt"
 
905
    base_compile="$nonopt $@"
840
906
    compile_command="$nonopt"
841
907
    finalize_command="$nonopt"
842
908
 
868
934
    no_install=no
869
935
    objs=
870
936
    non_pic_objects=
 
937
    precious_files_regex=
871
938
    prefer_static_libs=no
872
939
    preload=no
873
940
    prev=
881
948
    vinfo=
882
949
    vinfo_number=no
883
950
 
 
951
    func_infer_tag $base_compile
 
952
 
884
953
    # We need to know -static, to get the right output filenames.
885
954
    for arg
886
955
    do
912
981
    # Go through the arguments, transforming them on the way.
913
982
    while test "$#" -gt 0; do
914
983
      arg="$1"
915
 
      base_compile="$base_compile $arg"
916
984
      shift
917
985
      case $arg in
918
986
      *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \     ]*|*]*|"")
976
1044
          export_symbols="$arg"
977
1045
          if test ! -f "$arg"; then
978
1046
            $echo "$modename: symbol file \`$arg' does not exist"
979
 
            exit 1
 
1047
            exit $EXIT_FAILURE
980
1048
          fi
981
1049
          prev=
982
1050
          continue
991
1059
          prev=
992
1060
          continue
993
1061
          ;;
 
1062
        precious_regex)
 
1063
          precious_files_regex="$arg"
 
1064
          prev=
 
1065
          continue
 
1066
          ;;
994
1067
        release)
995
1068
          release="-$arg"
996
1069
          prev=
1023
1096
                   test "$pic_object" = none && \
1024
1097
                   test "$non_pic_object" = none; then
1025
1098
                  $echo "$modename: cannot find name of object for \`$arg'" 1>&2
1026
 
                  exit 1
 
1099
                  exit $EXIT_FAILURE
1027
1100
                fi
1028
1101
 
1029
1102
                # Extract subdirectory from the argument.
1076
1149
                # Only an error if not doing a dry-run.
1077
1150
                if test -z "$run"; then
1078
1151
                  $echo "$modename: \`$arg' is not a valid libtool object" 1>&2
1079
 
                  exit 1
 
1152
                  exit $EXIT_FAILURE
1080
1153
                else
1081
1154
                  # Dry-run case.
1082
1155
 
1097
1170
            done
1098
1171
          else
1099
1172
            $echo "$modename: link input file \`$save_arg' does not exist"
1100
 
            exit 1
 
1173
            exit $EXIT_FAILURE
1101
1174
          fi
1102
1175
          arg=$save_arg
1103
1176
          prev=
1109
1182
          [\\/]* | [A-Za-z]:[\\/]*) ;;
1110
1183
          *)
1111
1184
            $echo "$modename: only absolute run-paths are allowed" 1>&2
1112
 
            exit 1
 
1185
            exit $EXIT_FAILURE
1113
1186
            ;;
1114
1187
          esac
1115
1188
          if test "$prev" = rpath; then
1149
1222
          finalize_command="$finalize_command $qarg"
1150
1223
          continue
1151
1224
          ;;
 
1225
        shrext)
 
1226
          shrext_cmds="$arg"
 
1227
          prev=
 
1228
          continue
 
1229
          ;;
1152
1230
        *)
1153
1231
          eval "$prev=\"\$arg\""
1154
1232
          prev=
1197
1275
      -export-symbols | -export-symbols-regex)
1198
1276
        if test -n "$export_symbols" || test -n "$export_symbols_regex"; then
1199
1277
          $echo "$modename: more than one -exported-symbols argument is not allowed"
1200
 
          exit 1
 
1278
          exit $EXIT_FAILURE
1201
1279
        fi
1202
1280
        if test "X$arg" = "X-export-symbols"; then
1203
1281
          prev=expsyms
1233
1311
          absdir=`cd "$dir" && pwd`
1234
1312
          if test -z "$absdir"; then
1235
1313
            $echo "$modename: cannot determine absolute directory name of \`$dir'" 1>&2
1236
 
            exit 1
 
1314
            exit $EXIT_FAILURE
1237
1315
          fi
1238
1316
          dir="$absdir"
1239
1317
          ;;
1288
1366
        continue
1289
1367
        ;;
1290
1368
 
 
1369
     -mt|-mthreads|-kthread|-Kthread|-pthread|-pthreads|--thread-safe)
 
1370
        deplibs="$deplibs $arg"
 
1371
        continue
 
1372
        ;;
 
1373
 
1291
1374
      -module)
1292
1375
        module=yes
1293
1376
        continue
1352
1435
 
1353
1436
      -o) prev=output ;;
1354
1437
 
 
1438
      -precious-files-regex)
 
1439
        prev=precious_regex
 
1440
        continue
 
1441
        ;;
 
1442
 
1355
1443
      -release)
1356
1444
        prev=release
1357
1445
        continue
1374
1462
        [\\/]* | [A-Za-z]:[\\/]*) ;;
1375
1463
        *)
1376
1464
          $echo "$modename: only absolute run-paths are allowed" 1>&2
1377
 
          exit 1
 
1465
          exit $EXIT_FAILURE
1378
1466
          ;;
1379
1467
        esac
1380
1468
        case "$xrpath " in
1497
1585
             test "$pic_object" = none && \
1498
1586
             test "$non_pic_object" = none; then
1499
1587
            $echo "$modename: cannot find name of object for \`$arg'" 1>&2
1500
 
            exit 1
 
1588
            exit $EXIT_FAILURE
1501
1589
          fi
1502
1590
 
1503
1591
          # Extract subdirectory from the argument.
1550
1638
          # Only an error if not doing a dry-run.
1551
1639
          if test -z "$run"; then
1552
1640
            $echo "$modename: \`$arg' is not a valid libtool object" 1>&2
1553
 
            exit 1
 
1641
            exit $EXIT_FAILURE
1554
1642
          else
1555
1643
            # Dry-run case.
1556
1644
 
1617
1705
    if test -n "$prev"; then
1618
1706
      $echo "$modename: the \`$prevarg' option requires an argument" 1>&2
1619
1707
      $echo "$help" 1>&2
1620
 
      exit 1
1621
 
    fi
1622
 
 
1623
 
    # Infer tagged configuration to use if any are available and
1624
 
    # if one wasn't chosen via the "--tag" command line option.
1625
 
    # Only attempt this if the compiler in the base link
1626
 
    # command doesn't match the default compiler.
1627
 
    if test -n "$available_tags" && test -z "$tagname"; then
1628
 
      case $base_compile in
1629
 
      # Blanks in the command may have been stripped by the calling shell,
1630
 
      # but not from the CC environment variable when configure was run.
1631
 
      "$CC "* | " $CC "* | "`$echo $CC` "* | " `$echo $CC` "*) ;;
1632
 
      # Blanks at the start of $base_compile will cause this to fail
1633
 
      # if we don't check for them as well.
1634
 
      *)
1635
 
        for z in $available_tags; do
1636
 
          if grep "^# ### BEGIN LIBTOOL TAG CONFIG: $z$" < "$0" > /dev/null; then
1637
 
            # Evaluate the configuration.
1638
 
            eval "`${SED} -n -e '/^# ### BEGIN LIBTOOL TAG CONFIG: '$z'$/,/^# ### END LIBTOOL TAG CONFIG: '$z'$/p' < $0`"
1639
 
            case $base_compile in
1640
 
            "$CC "* | " $CC "* | "`$echo $CC` "* | " `$echo $CC` "*)
1641
 
              # The compiler in $compile_command matches
1642
 
              # the one in the tagged configuration.
1643
 
              # Assume this is the tagged configuration we want.
1644
 
              tagname=$z
1645
 
              break
1646
 
              ;;
1647
 
            esac
1648
 
          fi
1649
 
        done
1650
 
        # If $tagname still isn't set, then no tagged configuration
1651
 
        # was found and let the user know that the "--tag" command
1652
 
        # line option must be used.
1653
 
        if test -z "$tagname"; then
1654
 
          $echo "$modename: unable to infer tagged configuration"
1655
 
          $echo "$modename: specify a tag with \`--tag'" 1>&2
1656
 
          exit 1
1657
 
#       else
1658
 
#         $echo "$modename: using $tagname tagged configuration"
1659
 
        fi
1660
 
        ;;
1661
 
      esac
 
1708
      exit $EXIT_FAILURE
1662
1709
    fi
1663
1710
 
1664
1711
    if test "$export_dynamic" = yes && test -n "$export_dynamic_flag_spec"; then
1702
1749
    "")
1703
1750
      $echo "$modename: you must specify an output file" 1>&2
1704
1751
      $echo "$help" 1>&2
1705
 
      exit 1
 
1752
      exit $EXIT_FAILURE
1706
1753
      ;;
1707
1754
    *.$libext) linkmode=oldlib ;;
1708
1755
    *.lo | *.$objext) linkmode=obj ;;
1712
1759
 
1713
1760
    case $host in
1714
1761
    *cygwin* | *mingw* | *pw32*)
1715
 
      # don't eliminate duplcations in $postdeps and $predeps
 
1762
      # don't eliminate duplications in $postdeps and $predeps
1716
1763
      duplicate_compiler_generated_deps=yes
1717
1764
      ;;
1718
1765
    *)
1765
1812
          *.la) ;;
1766
1813
          *)
1767
1814
            $echo "$modename: libraries can \`-dlopen' only libtool libraries: $file" 1>&2
1768
 
            exit 1
 
1815
            exit $EXIT_FAILURE
1769
1816
            ;;
1770
1817
          esac
1771
1818
        done
1791
1838
        case $pass in
1792
1839
        dlopen) libs="$dlfiles" ;;
1793
1840
        dlpreopen) libs="$dlprefiles" ;;
1794
 
        link) libs="$deplibs %DEPLIBS% $dependency_libs" ;;
 
1841
        link)
 
1842
          libs="$deplibs %DEPLIBS%"
 
1843
          test "X$link_all_deplibs" != Xno && libs="$libs $dependency_libs"
 
1844
          ;;
1795
1845
        esac
1796
1846
      fi
1797
1847
      if test "$pass" = dlopen; then
1803
1853
        lib=
1804
1854
        found=no
1805
1855
        case $deplib in
 
1856
        -mt|-mthreads|-kthread|-Kthread|-pthread|-pthreads|--thread-safe)
 
1857
          if test "$linkmode,$pass" = "prog,link"; then
 
1858
            compile_deplibs="$deplib $compile_deplibs"
 
1859
            finalize_deplibs="$deplib $finalize_deplibs"
 
1860
          else
 
1861
            deplibs="$deplib $deplibs"
 
1862
          fi
 
1863
          continue
 
1864
          ;;
1806
1865
        -l*)
1807
1866
          if test "$linkmode" != lib && test "$linkmode" != prog; then
1808
1867
            $echo "$modename: warning: \`-l' is ignored for archives/objects" 1>&2
1814
1873
          fi
1815
1874
          name=`$echo "X$deplib" | $Xsed -e 's/^-l//'`
1816
1875
          for searchdir in $newlib_search_path $lib_search_path $sys_lib_search_path $shlib_search_path; do
1817
 
            for search_ext in .la $shrext .so .a; do
 
1876
            for search_ext in .la $std_shrext .so .a; do
1818
1877
              # Search the libtool library
1819
1878
              lib="$searchdir/lib${name}${search_ext}"
1820
1879
              if test -f "$lib"; then
1890
1949
            fi
1891
1950
            if test "$pass" = scan; then
1892
1951
              deplibs="$deplib $deplibs"
1893
 
              newlib_search_path="$newlib_search_path "`$echo "X$deplib" | $Xsed -e 's/^-L//'`
1894
1952
            else
1895
1953
              compile_deplibs="$deplib $compile_deplibs"
1896
1954
              finalize_deplibs="$deplib $finalize_deplibs"
1897
1955
            fi
 
1956
            newlib_search_path="$newlib_search_path "`$echo "X$deplib" | $Xsed -e 's/^-L//'`
1898
1957
            ;;
1899
1958
          *)
1900
1959
            $echo "$modename: warning: \`-L' is ignored for archives/objects" 1>&2
1973
2032
        if test "$found" = yes || test -f "$lib"; then :
1974
2033
        else
1975
2034
          $echo "$modename: cannot find the library \`$lib'" 1>&2
1976
 
          exit 1
 
2035
          exit $EXIT_FAILURE
1977
2036
        fi
1978
2037
 
1979
2038
        # Check to see that this really is a libtool archive.
1980
2039
        if (${SED} -e '2q' $lib | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then :
1981
2040
        else
1982
2041
          $echo "$modename: \`$lib' is not a valid libtool archive" 1>&2
1983
 
          exit 1
 
2042
          exit $EXIT_FAILURE
1984
2043
        fi
1985
2044
 
1986
2045
        ladir=`$echo "X$lib" | $Xsed -e 's%/[^/]*$%%'`
2016
2075
          if test -z "$libdir"; then
2017
2076
            if test -z "$old_library"; then
2018
2077
              $echo "$modename: cannot find name of link library for \`$lib'" 1>&2
2019
 
              exit 1
 
2078
              exit $EXIT_FAILURE
2020
2079
            fi
2021
2080
            # It is a libtool convenience library, so add in its objects.
2022
2081
            convenience="$convenience $ladir/$objdir/$old_library"
2033
2092
            done
2034
2093
          elif test "$linkmode" != prog && test "$linkmode" != lib; then
2035
2094
            $echo "$modename: \`$lib' is not a convenience library" 1>&2
2036
 
            exit 1
 
2095
            exit $EXIT_FAILURE
2037
2096
          fi
2038
2097
          continue
2039
2098
        fi # $pass = conv
2040
2099
 
2041
 
    
 
2100
 
2042
2101
        # Get the name of the library we link against.
2043
2102
        linklib=
2044
2103
        for l in $old_library $library_names; do
2046
2105
        done
2047
2106
        if test -z "$linklib"; then
2048
2107
          $echo "$modename: cannot find name of link library for \`$lib'" 1>&2
2049
 
          exit 1
 
2108
          exit $EXIT_FAILURE
2050
2109
        fi
2051
2110
 
2052
2111
        # This library was specified with -dlopen.
2053
2112
        if test "$pass" = dlopen; then
2054
2113
          if test -z "$libdir"; then
2055
2114
            $echo "$modename: cannot -dlopen a convenience library: \`$lib'" 1>&2
2056
 
            exit 1
 
2115
            exit $EXIT_FAILURE
2057
2116
          fi
2058
 
          if test -z "$dlname" || test "$dlopen_support" != yes || test "$build_libtool_libs" = no; then
 
2117
          if test -z "$dlname" ||
 
2118
             test "$dlopen_support" != yes ||
 
2119
             test "$build_libtool_libs" = no; then
2059
2120
            # If there is no dlname, no dlopen support or we're linking
2060
2121
            # statically, we need to preload.  We also need to preload any
2061
2122
            # dependent libraries so libltdl's deplib preloader doesn't
2104
2165
        if test "$pass" = dlpreopen; then
2105
2166
          if test -z "$libdir"; then
2106
2167
            $echo "$modename: cannot -dlpreopen a convenience library: \`$lib'" 1>&2
2107
 
            exit 1
 
2168
            exit $EXIT_FAILURE
2108
2169
          fi
2109
2170
          # Prefer using a static library (so that no silly _DYNAMIC symbols
2110
2171
          # are required to link).
2131
2192
          continue
2132
2193
        fi
2133
2194
 
2134
 
    
 
2195
 
2135
2196
        if test "$linkmode" = prog && test "$pass" != link; then
2136
2197
          newlib_search_path="$newlib_search_path $ladir"
2137
2198
          deplibs="$lib $deplibs"
2218
2279
            need_relink=yes
2219
2280
          fi
2220
2281
          # This is a shared library
2221
 
        
2222
 
      # Warn about portability, can't link against -module's on some systems (darwin)
2223
 
      if test "$shouldnotlink" = yes && test "$pass" = link ; then
 
2282
 
 
2283
          # Warn about portability, can't link against -module's on
 
2284
          # some systems (darwin)
 
2285
          if test "$shouldnotlink" = yes && test "$pass" = link ; then
2224
2286
            $echo
2225
2287
            if test "$linkmode" = prog; then
2226
2288
              $echo "*** Warning: Linking the executable $output against the loadable module"
2227
2289
            else
2228
2290
              $echo "*** Warning: Linking the shared library $output against the loadable module"
2229
2291
            fi
2230
 
            $echo "*** $linklib is not portable!"    
2231
 
      fi          
 
2292
            $echo "*** $linklib is not portable!"
 
2293
          fi
2232
2294
          if test "$linkmode" = lib &&
2233
2295
             test "$hardcode_into_libs" = yes; then
2234
2296
            # Hardcode the library path.
2286
2348
            else
2287
2349
              $show "extracting exported symbol list from \`$soname'"
2288
2350
              save_ifs="$IFS"; IFS='~'
2289
 
              eval cmds=\"$extract_expsyms_cmds\"
 
2351
              cmds=$extract_expsyms_cmds
2290
2352
              for cmd in $cmds; do
2291
2353
                IFS="$save_ifs"
 
2354
                eval cmd=\"$cmd\"
2292
2355
                $show "$cmd"
2293
2356
                $run eval "$cmd" || exit $?
2294
2357
              done
2299
2362
            if test -f "$output_objdir/$newlib"; then :; else
2300
2363
              $show "generating import library for \`$soname'"
2301
2364
              save_ifs="$IFS"; IFS='~'
2302
 
              eval cmds=\"$old_archive_from_expsyms_cmds\"
 
2365
              cmds=$old_archive_from_expsyms_cmds
2303
2366
              for cmd in $cmds; do
2304
2367
                IFS="$save_ifs"
 
2368
                eval cmd=\"$cmd\"
2305
2369
                $show "$cmd"
2306
2370
                $run eval "$cmd" || exit $?
2307
2371
              done
2324
2388
                case $host in
2325
2389
                  *-*-sco3.2v5* ) add_dir="-L$dir" ;;
2326
2390
                  *-*-darwin* )
2327
 
                    # if the lib is a module then we can not link against it, someone
2328
 
                    # is ignoring the new warnings I added
2329
 
                    if /usr/bin/file -L $add 2> /dev/null | grep "bundle" >/dev/null ; then
 
2391
                    # if the lib is a module then we can not link against
 
2392
                    # it, someone is ignoring the new warnings I added
 
2393
                    if /usr/bin/file -L $add 2> /dev/null | $EGREP "bundle" >/dev/null ; then
2330
2394
                      $echo "** Warning, lib $linklib is a module, not a shared library"
2331
2395
                      if test -z "$old_library" ; then
2332
2396
                        $echo
2334
2398
                        $echo "** The link will probably fail, sorry"
2335
2399
                      else
2336
2400
                        add="$dir/$old_library"
2337
 
                      fi 
 
2401
                      fi
2338
2402
                    fi
2339
2403
                esac
2340
2404
              elif test "$hardcode_minus_L" = no; then
2376
2440
 
2377
2441
            if test "$lib_linked" != yes; then
2378
2442
              $echo "$modename: configuration error: unsupported hardcode properties"
2379
 
              exit 1
 
2443
              exit $EXIT_FAILURE
2380
2444
            fi
2381
2445
 
2382
2446
            if test -n "$add_shlibpath"; then
2419
2483
              esac
2420
2484
              add="-l$name"
2421
2485
            elif test "$hardcode_automatic" = yes; then
2422
 
              if test -n "$inst_prefix_dir" && test -f "$inst_prefix_dir$libdir/$linklib" ; then
 
2486
              if test -n "$inst_prefix_dir" &&
 
2487
                 test -f "$inst_prefix_dir$libdir/$linklib" ; then
2423
2488
                add="$inst_prefix_dir$libdir/$linklib"
2424
2489
              else
2425
2490
                add="$libdir/$linklib"
2499
2564
 
2500
2565
        if test "$linkmode" = lib; then
2501
2566
          if test -n "$dependency_libs" &&
2502
 
             { test "$hardcode_into_libs" != yes || test "$build_old_libs" = yes ||
 
2567
             { test "$hardcode_into_libs" != yes ||
 
2568
               test "$build_old_libs" = yes ||
2503
2569
               test "$link_static" = yes; }; then
2504
2570
            # Extract -R from dependency_libs
2505
2571
            temp_deplibs=
2556
2622
                  eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $deplib`
2557
2623
                  if test -z "$libdir"; then
2558
2624
                    $echo "$modename: \`$deplib' is not a valid libtool archive" 1>&2
2559
 
                    exit 1
 
2625
                    exit $EXIT_FAILURE
2560
2626
                  fi
2561
2627
                  if test "$absdir" != "$libdir"; then
2562
2628
                    $echo "$modename: warning: \`$deplib' seems to be moved" 1>&2
2566
2632
                depdepl=
2567
2633
                case $host in
2568
2634
                *-*-darwin*)
2569
 
                  # we do not want to link against static libs, but need to link against shared
 
2635
                  # we do not want to link against static libs,
 
2636
                  # but need to link against shared
2570
2637
                  eval deplibrary_names=`${SED} -n -e 's/^library_names=\(.*\)$/\1/p' $deplib`
2571
2638
                  if test -n "$deplibrary_names" ; then
2572
2639
                    for tmp in $deplibrary_names ; do
2574
2641
                    done
2575
2642
                    if test -f "$path/$depdepl" ; then
2576
2643
                      depdepl="$path/$depdepl"
2577
 
                   fi
 
2644
                    fi
2578
2645
                    # do not add paths which are already there
2579
2646
                    case " $newlib_search_path " in
2580
2647
                    *" $path "*) ;;
2581
2648
                    *) newlib_search_path="$newlib_search_path $path";;
2582
2649
                    esac
2583
 
                    path=""
2584
2650
                  fi
 
2651
                  path=""
2585
2652
                  ;;
2586
2653
                *)
2587
 
                path="-L$path"
2588
 
                ;;
2589
 
                esac 
2590
 
                
2591
 
                ;;
2592
 
                  -l*)
 
2654
                  path="-L$path"
 
2655
                  ;;
 
2656
                esac
 
2657
                ;;
 
2658
              -l*)
2593
2659
                case $host in
2594
2660
                *-*-darwin*)
2595
 
                 # Again, we only want to link against shared libraries
2596
 
                 eval tmp_libs=`$echo "X$deplib" | $Xsed -e "s,^\-l,,"`
2597
 
                 for tmp in $newlib_search_path ; do
2598
 
                     if test -f "$tmp/lib$tmp_libs.dylib" ; then
2599
 
                       eval depdepl="$tmp/lib$tmp_libs.dylib"
2600
 
                       break
2601
 
                     fi  
2602
 
         done
2603
 
         path=""
 
2661
                  # Again, we only want to link against shared libraries
 
2662
                  eval tmp_libs=`$echo "X$deplib" | $Xsed -e "s,^\-l,,"`
 
2663
                  for tmp in $newlib_search_path ; do
 
2664
                    if test -f "$tmp/lib$tmp_libs.dylib" ; then
 
2665
                      eval depdepl="$tmp/lib$tmp_libs.dylib"
 
2666
                      break
 
2667
                    fi
 
2668
                  done
 
2669
                  path=""
2604
2670
                  ;;
2605
2671
                *) continue ;;
2606
 
                esac              
 
2672
                esac
2607
2673
                ;;
2608
2674
              *) continue ;;
2609
2675
              esac
2610
2676
              case " $deplibs " in
2611
2677
              *" $depdepl "*) ;;
2612
 
              *) deplibs="$deplibs $depdepl" ;;
2613
 
              esac            
 
2678
              *) deplibs="$depdepl $deplibs" ;;
 
2679
              esac
2614
2680
              case " $deplibs " in
2615
2681
              *" $path "*) ;;
2616
2682
              *) deplibs="$deplibs $path" ;;
2700
2766
          eval $var=\"$tmp_libs\"
2701
2767
        done # for var
2702
2768
      fi
2703
 
      # Last step: remove runtime libs from dependency_libs (they stay in deplibs)
 
2769
      # Last step: remove runtime libs from dependency_libs
 
2770
      # (they stay in deplibs)
2704
2771
      tmp_libs=
2705
2772
      for i in $dependency_libs ; do
2706
2773
        case " $predeps $postdeps $compiler_lib_search_path " in
2760
2827
      case $outputname in
2761
2828
      lib*)
2762
2829
        name=`$echo "X$outputname" | $Xsed -e 's/\.la$//' -e 's/^lib//'`
2763
 
        eval shared_ext=\"$shrext\"
 
2830
        eval shared_ext=\"$shrext_cmds\"
2764
2831
        eval libname=\"$libname_spec\"
2765
2832
        ;;
2766
2833
      *)
2767
2834
        if test "$module" = no; then
2768
2835
          $echo "$modename: libtool library \`$output' must begin with \`lib'" 1>&2
2769
2836
          $echo "$help" 1>&2
2770
 
          exit 1
 
2837
          exit $EXIT_FAILURE
2771
2838
        fi
2772
2839
        if test "$need_lib_prefix" != no; then
2773
2840
          # Add the "lib" prefix for modules if required
2774
2841
          name=`$echo "X$outputname" | $Xsed -e 's/\.la$//'`
2775
 
          eval shared_ext=\"$shrext\"
 
2842
          eval shared_ext=\"$shrext_cmds\"
2776
2843
          eval libname=\"$libname_spec\"
2777
2844
        else
2778
2845
          libname=`$echo "X$outputname" | $Xsed -e 's/\.la$//'`
2783
2850
      if test -n "$objs"; then
2784
2851
        if test "$deplibs_check_method" != pass_all; then
2785
2852
          $echo "$modename: cannot build libtool library \`$output' from non-libtool objects on this host:$objs" 2>&1
2786
 
          exit 1
 
2853
          exit $EXIT_FAILURE
2787
2854
        else
2788
2855
          $echo
2789
2856
          $echo "*** Warning: Linking the shared library $output against the non-libtool"
2831
2898
        if test -n "$8"; then
2832
2899
          $echo "$modename: too many parameters to \`-version-info'" 1>&2
2833
2900
          $echo "$help" 1>&2
2834
 
          exit 1
 
2901
          exit $EXIT_FAILURE
2835
2902
        fi
2836
2903
 
2837
2904
        # convert absolute version numbers to libtool ages
2838
2905
        # this retains compatibility with .la files and attempts
2839
2906
        # to make the code below a bit more comprehensible
2840
 
        
 
2907
 
2841
2908
        case $vinfo_number in
2842
2909
        yes)
2843
2910
          number_major="$2"
2866
2933
            age="$number_minor"
2867
2934
            revision="$number_minor"
2868
2935
            ;;
 
2936
          *)
 
2937
            $echo "$modename: unknown library version type \`$version_type'" 1>&2
 
2938
            $echo "Fatal configuration error.  See the $PACKAGE docs for more information." 1>&2
 
2939
            exit $EXIT_FAILURE
 
2940
            ;;
2869
2941
          esac
2870
2942
          ;;
2871
2943
        no)
2881
2953
        *)
2882
2954
          $echo "$modename: CURRENT \`$current' is not a nonnegative integer" 1>&2
2883
2955
          $echo "$modename: \`$vinfo' is not valid version information" 1>&2
2884
 
          exit 1
 
2956
          exit $EXIT_FAILURE
2885
2957
          ;;
2886
2958
        esac
2887
2959
 
2890
2962
        *)
2891
2963
          $echo "$modename: REVISION \`$revision' is not a nonnegative integer" 1>&2
2892
2964
          $echo "$modename: \`$vinfo' is not valid version information" 1>&2
2893
 
          exit 1
 
2965
          exit $EXIT_FAILURE
2894
2966
          ;;
2895
2967
        esac
2896
2968
 
2899
2971
        *)
2900
2972
          $echo "$modename: AGE \`$age' is not a nonnegative integer" 1>&2
2901
2973
          $echo "$modename: \`$vinfo' is not valid version information" 1>&2
2902
 
          exit 1
 
2974
          exit $EXIT_FAILURE
2903
2975
          ;;
2904
2976
        esac
2905
2977
 
2906
2978
        if test "$age" -gt "$current"; then
2907
2979
          $echo "$modename: AGE \`$age' is greater than the current interface number \`$current'" 1>&2
2908
2980
          $echo "$modename: \`$vinfo' is not valid version information" 1>&2
2909
 
          exit 1
 
2981
          exit $EXIT_FAILURE
2910
2982
        fi
2911
2983
 
2912
2984
        # Calculate the version variables.
2995
3067
        *)
2996
3068
          $echo "$modename: unknown library version type \`$version_type'" 1>&2
2997
3069
          $echo "Fatal configuration error.  See the $PACKAGE docs for more information." 1>&2
2998
 
          exit 1
 
3070
          exit $EXIT_FAILURE
2999
3071
          ;;
3000
3072
        esac
3001
3073
 
3049
3121
            *.$objext)
3050
3122
               ;;
3051
3123
            $output_objdir/$outputname | $output_objdir/$libname.* | $output_objdir/${libname}${release}.*)
 
3124
               if test "X$precious_files_regex" != "X"; then
 
3125
                 if echo $p | $EGREP -e "$precious_files_regex" >/dev/null 2>&1
 
3126
                 then
 
3127
                   continue
 
3128
                 fi
 
3129
               fi
3052
3130
               removelist="$removelist $p"
3053
3131
               ;;
3054
3132
            *) ;;
3528
3606
        fi
3529
3607
 
3530
3608
        # Get the real and link names of the library.
3531
 
        eval shared_ext=\"$shrext\"
 
3609
        eval shared_ext=\"$shrext_cmds\"
3532
3610
        eval library_names=\"$library_names_spec\"
3533
3611
        set dummy $library_names
3534
3612
        realname="$2"
3558
3636
            $show "generating symbol list for \`$libname.la'"
3559
3637
            export_symbols="$output_objdir/$libname.exp"
3560
3638
            $run $rm $export_symbols
3561
 
            eval cmds=\"$export_symbols_cmds\"
 
3639
            cmds=$export_symbols_cmds
3562
3640
            save_ifs="$IFS"; IFS='~'
3563
3641
            for cmd in $cmds; do
3564
3642
              IFS="$save_ifs"
 
3643
              eval cmd=\"$cmd\"
3565
3644
              if len=`expr "X$cmd" : ".*"` &&
3566
3645
               test "$len" -le "$max_cmd_len" || test "$max_cmd_len" -le -1; then
3567
3646
                $show "$cmd"
3591
3670
        for test_deplib in $deplibs; do
3592
3671
                case " $convenience " in
3593
3672
                *" $test_deplib "*) ;;
3594
 
                *) 
 
3673
                *)
3595
3674
                        tmp_deplibs="$tmp_deplibs $test_deplib"
3596
3675
                        ;;
3597
3676
                esac
3598
3677
        done
3599
 
        deplibs="$tmp_deplibs" 
 
3678
        deplibs="$tmp_deplibs"
3600
3679
 
3601
3680
        if test -n "$convenience"; then
3602
3681
          if test -n "$whole_archive_flag_spec"; then
3678
3757
        # Do each of the archive commands.
3679
3758
        if test "$module" = yes && test -n "$module_cmds" ; then
3680
3759
          if test -n "$export_symbols" && test -n "$module_expsym_cmds"; then
3681
 
            eval cmds=\"$module_expsym_cmds\"
 
3760
            eval test_cmds=\"$module_expsym_cmds\"
 
3761
            cmds=$module_expsym_cmds
3682
3762
          else
3683
 
            eval cmds=\"$module_cmds\"
 
3763
            eval test_cmds=\"$module_cmds\"
 
3764
            cmds=$module_cmds
3684
3765
          fi
3685
3766
        else
3686
3767
        if test -n "$export_symbols" && test -n "$archive_expsym_cmds"; then
3687
 
          eval cmds=\"$archive_expsym_cmds\"
 
3768
          eval test_cmds=\"$archive_expsym_cmds\"
 
3769
          cmds=$archive_expsym_cmds
3688
3770
        else
3689
 
          eval cmds=\"$archive_cmds\"
 
3771
          eval test_cmds=\"$archive_cmds\"
 
3772
          cmds=$archive_cmds
3690
3773
          fi
3691
3774
        fi
3692
3775
 
3693
 
        if test "X$skipped_export" != "X:" && len=`expr "X$cmds" : ".*"` &&
 
3776
        if test "X$skipped_export" != "X:" && len=`expr "X$test_cmds" : ".*"` &&
3694
3777
           test "$len" -le "$max_cmd_len" || test "$max_cmd_len" -le -1; then
3695
3778
          :
3696
3779
        else
3791
3874
          # value of $libobjs for piecewise linking.
3792
3875
 
3793
3876
          # Do each of the archive commands.
 
3877
          if test "$module" = yes && test -n "$module_cmds" ; then
 
3878
            if test -n "$export_symbols" && test -n "$module_expsym_cmds"; then
 
3879
              cmds=$module_expsym_cmds
 
3880
            else
 
3881
              cmds=$module_cmds
 
3882
            fi
 
3883
          else
3794
3884
          if test -n "$export_symbols" && test -n "$archive_expsym_cmds"; then
3795
 
            eval cmds=\"$archive_expsym_cmds\"
 
3885
            cmds=$archive_expsym_cmds
3796
3886
          else
3797
 
            eval cmds=\"$archive_cmds\"
 
3887
            cmds=$archive_cmds
 
3888
            fi
3798
3889
          fi
3799
3890
 
3800
3891
          # Append the command to remove the reloadable object files
3801
3892
          # to the just-reset $cmds.
3802
 
          eval cmds=\"\$cmds~$rm $delfiles\"
 
3893
          eval cmds=\"\$cmds~\$rm $delfiles\"
3803
3894
        fi
3804
3895
        save_ifs="$IFS"; IFS='~'
3805
3896
        for cmd in $cmds; do
3806
3897
          IFS="$save_ifs"
 
3898
          eval cmd=\"$cmd\"
3807
3899
          $show "$cmd"
3808
3900
          $run eval "$cmd" || exit $?
3809
3901
        done
3812
3904
        # Restore the uninstalled library and exit
3813
3905
        if test "$mode" = relink; then
3814
3906
          $run eval '(cd $output_objdir && $rm ${realname}T && $mv $realname ${realname}T && $mv "$realname"U $realname)' || exit $?
3815
 
          exit 0
 
3907
          exit $EXIT_SUCCESS
3816
3908
        fi
3817
3909
 
3818
3910
        # Create links to the real library.
3860
3952
      *.lo)
3861
3953
        if test -n "$objs$old_deplibs"; then
3862
3954
          $echo "$modename: cannot build library object \`$output' from non-libtool objects" 1>&2
3863
 
          exit 1
 
3955
          exit $EXIT_FAILURE
3864
3956
        fi
3865
3957
        libobj="$output"
3866
3958
        obj=`$echo "X$output" | $Xsed -e "$lo2o"`
3954
4046
      reload_objs="$objs$old_deplibs "`$echo "X$libobjs" | $SP2NL | $Xsed -e '/\.'${libext}$'/d' -e '/\.lib$/d' -e "$lo2o" | $NL2SP`" $reload_conv_objs" ### testsuite: skip nested quoting test
3955
4047
 
3956
4048
      output="$obj"
3957
 
      eval cmds=\"$reload_cmds\"
 
4049
      cmds=$reload_cmds
3958
4050
      save_ifs="$IFS"; IFS='~'
3959
4051
      for cmd in $cmds; do
3960
4052
        IFS="$save_ifs"
 
4053
        eval cmd=\"$cmd\"
3961
4054
        $show "$cmd"
3962
4055
        $run eval "$cmd" || exit $?
3963
4056
      done
3970
4063
          $run ${rm}r $gentop
3971
4064
        fi
3972
4065
 
3973
 
        exit 0
 
4066
        exit $EXIT_SUCCESS
3974
4067
      fi
3975
4068
 
3976
4069
      if test "$build_libtool_libs" != yes; then
3983
4076
        # accidentally link it into a program.
3984
4077
        # $show "echo timestamp > $libobj"
3985
4078
        # $run eval "echo timestamp > $libobj" || exit $?
3986
 
        exit 0
 
4079
        exit $EXIT_SUCCESS
3987
4080
      fi
3988
4081
 
3989
4082
      if test -n "$pic_flag" || test "$pic_mode" != default; then
3990
4083
        # Only do commands if we really have different PIC objects.
3991
4084
        reload_objs="$libobjs $reload_conv_objs"
3992
4085
        output="$libobj"
3993
 
        eval cmds=\"$reload_cmds\"
 
4086
        cmds=$reload_cmds
3994
4087
        save_ifs="$IFS"; IFS='~'
3995
4088
        for cmd in $cmds; do
3996
4089
          IFS="$save_ifs"
 
4090
          eval cmd=\"$cmd\"
3997
4091
          $show "$cmd"
3998
4092
          $run eval "$cmd" || exit $?
3999
4093
        done
4005
4099
        $run ${rm}r $gentop
4006
4100
      fi
4007
4101
 
4008
 
      exit 0
 
4102
      exit $EXIT_SUCCESS
4009
4103
      ;;
4010
4104
 
4011
4105
    prog)
4323
4417
          ;;
4324
4418
        *)
4325
4419
          $echo "$modename: unknown suffix for \`$dlsyms'" 1>&2
4326
 
          exit 1
 
4420
          exit $EXIT_FAILURE
4327
4421
          ;;
4328
4422
        esac
4329
4423
      else
4411
4505
        # Link the executable and exit
4412
4506
        $show "$link_command"
4413
4507
        $run eval "$link_command" || exit $?
4414
 
        exit 0
 
4508
        exit $EXIT_SUCCESS
4415
4509
      fi
4416
4510
 
4417
4511
      if test "$hardcode_action" = relink; then
4466
4560
      fi
4467
4561
 
4468
4562
      # Quote $echo for shipping.
4469
 
      if test "X$echo" = "X$SHELL $0 --fallback-echo"; then
4470
 
        case $0 in
4471
 
        [\\/]* | [A-Za-z]:[\\/]*) qecho="$SHELL $0 --fallback-echo";;
4472
 
        *) qecho="$SHELL `pwd`/$0 --fallback-echo";;
 
4563
      if test "X$echo" = "X$SHELL $progpath --fallback-echo"; then
 
4564
        case $progpath in
 
4565
        [\\/]* | [A-Za-z]:[\\/]*) qecho="$SHELL $progpath --fallback-echo";;
 
4566
        *) qecho="$SHELL `pwd`/$progpath --fallback-echo";;
4473
4567
        esac
4474
4568
        qecho=`$echo "X$qecho" | $Xsed -e "$sed_quote_subst"`
4475
4569
      else
4495
4589
            cwrappersource=`$echo ${objdir}/lt-${output}.c`
4496
4590
            cwrapper=`$echo ${output}.exe`
4497
4591
            $rm $cwrappersource $cwrapper
4498
 
            trap "$rm $cwrappersource $cwrapper; exit 1" 1 2 15
 
4592
            trap "$rm $cwrappersource $cwrapper; exit $EXIT_FAILURE" 1 2 15
4499
4593
 
4500
4594
            cat > $cwrappersource <<EOF
4501
4595
 
4504
4598
 
4505
4599
   The $output program cannot be directly executed until all the libtool
4506
4600
   libraries that it depends on are installed.
4507
 
   
 
4601
 
4508
4602
   This wrapper executable should never be moved out of the build directory.
4509
4603
   If it is, it will not operate correctly.
4510
4604
 
4536
4630
#if defined (_WIN32) || defined (__MSDOS__) || defined (__DJGPP__) || \
4537
4631
  defined (__OS2__)
4538
4632
#define HAVE_DOS_BASED_FILE_SYSTEM
4539
 
#ifndef DIR_SEPARATOR_2 
 
4633
#ifndef DIR_SEPARATOR_2
4540
4634
#define DIR_SEPARATOR_2 '\\'
4541
4635
#endif
4542
4636
#endif
4567
4661
{
4568
4662
  char **newargz;
4569
4663
  int i;
4570
 
  
 
4664
 
4571
4665
  program_name = (char *) xstrdup ((char *) basename (argv[0]));
4572
4666
  newargz = XMALLOC(char *, argc+2);
4573
4667
EOF
4580
4674
  newargz[1] = fnqualify(argv[0]);
4581
4675
  /* we know the script has the same name, without the .exe */
4582
4676
  /* so make sure newargz[1] doesn't end in .exe */
4583
 
  strendzap(newargz[1],".exe"); 
 
4677
  strendzap(newargz[1],".exe");
4584
4678
  for (i = 1; i < argc; i++)
4585
4679
    newargz[i+1] = xstrdup(argv[i]);
4586
4680
  newargz[argc+1] = NULL;
4603
4697
  return p;
4604
4698
}
4605
4699
 
4606
 
char * 
 
4700
char *
4607
4701
xstrdup (const char *string)
4608
4702
{
4609
4703
  return string ? strcpy ((char *) xmalloc (strlen (string) + 1), string) : NULL
4617
4711
 
4618
4712
#if defined (HAVE_DOS_BASED_FILE_SYSTEM)
4619
4713
  /* Skip over the disk name in MSDOS pathnames. */
4620
 
  if (isalpha (name[0]) && name[1] == ':') 
 
4714
  if (isalpha (name[0]) && name[1] == ':')
4621
4715
    name += 2;
4622
4716
#endif
4623
4717
 
4627
4721
  return (char *) base;
4628
4722
}
4629
4723
 
4630
 
char * 
 
4724
char *
4631
4725
fnqualify(const char *path)
4632
4726
{
4633
4727
  size_t size;
4655
4749
}
4656
4750
 
4657
4751
char *
4658
 
strendzap(char *str, const char *pat) 
 
4752
strendzap(char *str, const char *pat)
4659
4753
{
4660
4754
  size_t len, patlen;
4661
4755
 
4675
4769
}
4676
4770
 
4677
4771
static void
4678
 
lt_error_core (int exit_status, const char * mode, 
 
4772
lt_error_core (int exit_status, const char * mode,
4679
4773
          const char * message, va_list ap)
4680
4774
{
4681
4775
  fprintf (stderr, "%s: %s: ", program_name, mode);
4704
4798
          ;;
4705
4799
        esac
4706
4800
        $rm $output
4707
 
        trap "$rm $output; exit 1" 1 2 15
 
4801
        trap "$rm $output; exit $EXIT_FAILURE" 1 2 15
4708
4802
 
4709
4803
        $echo > $output "\
4710
4804
#! $SHELL
4804
4898
      else
4805
4899
        $echo \"\$relink_command_output\" >&2
4806
4900
        $rm \"\$progdir/\$file\"
4807
 
        exit 1
 
4901
        exit $EXIT_FAILURE
4808
4902
      fi
4809
4903
    fi
4810
4904
 
4866
4960
        esac
4867
4961
        $echo >> $output "\
4868
4962
      \$echo \"\$0: cannot exec \$program \${1+\"\$@\"}\"
4869
 
      exit 1
 
4963
      exit $EXIT_FAILURE
4870
4964
    fi
4871
4965
  else
4872
4966
    # The program doesn't exist.
4873
4967
    \$echo \"\$0: error: \$progdir/\$program does not exist\" 1>&2
4874
4968
    \$echo \"This script is just a wrapper for \$program.\" 1>&2
4875
4969
    $echo \"See the $PACKAGE documentation for more information.\" 1>&2
4876
 
    exit 1
 
4970
    exit $EXIT_FAILURE
4877
4971
  fi
4878
4972
fi\
4879
4973
"
4880
4974
        chmod +x $output
4881
4975
      fi
4882
 
      exit 0
 
4976
      exit $EXIT_SUCCESS
4883
4977
      ;;
4884
4978
    esac
4885
4979
 
4965
5059
 
4966
5060
      # Do each command in the archive commands.
4967
5061
      if test -n "$old_archive_from_new_cmds" && test "$build_libtool_libs" = yes; then
4968
 
        eval cmds=\"$old_archive_from_new_cmds\"
 
5062
       cmds=$old_archive_from_new_cmds
4969
5063
      else
4970
5064
        eval cmds=\"$old_archive_cmds\"
4971
5065
 
4972
5066
        if len=`expr "X$cmds" : ".*"` &&
4973
5067
             test "$len" -le "$max_cmd_len" || test "$max_cmd_len" -le -1; then
4974
 
          :
 
5068
          cmds=$old_archive_cmds
4975
5069
        else
4976
5070
          # the command line is too long to link in one step, link in parts
4977
5071
          $echo "using piecewise archive linking..."
4998
5092
          for obj in $save_oldobjs
4999
5093
          do
5000
5094
            last_oldobj=$obj
5001
 
          done  
 
5095
          done
5002
5096
          for obj in $save_oldobjs
5003
5097
          do
5004
5098
            oldobjs="$objlist $obj"
5012
5106
              oldobjs=$objlist
5013
5107
              if test "$obj" = "$last_oldobj" ; then
5014
5108
                RANLIB=$save_RANLIB
5015
 
              fi  
 
5109
              fi
5016
5110
              test -z "$concat_cmds" || concat_cmds=$concat_cmds~
5017
5111
              eval concat_cmds=\"\${concat_cmds}$old_archive_cmds\"
5018
5112
              objlist=
5023
5117
          if test "X$oldobjs" = "X" ; then
5024
5118
            eval cmds=\"\$concat_cmds\"
5025
5119
          else
5026
 
            eval cmds=\"\$concat_cmds~$old_archive_cmds\"
 
5120
            eval cmds=\"\$concat_cmds~\$old_archive_cmds\"
5027
5121
          fi
5028
5122
        fi
5029
5123
      fi
5030
5124
      save_ifs="$IFS"; IFS='~'
5031
5125
      for cmd in $cmds; do
 
5126
        eval cmd=\"$cmd\"
5032
5127
        IFS="$save_ifs"
5033
5128
        $show "$cmd"
5034
5129
        $run eval "$cmd" || exit $?
5060
5155
        fi
5061
5156
      done
5062
5157
      # Quote the link command for shipping.
5063
 
      relink_command="(cd `pwd`; $SHELL $0 --mode=relink $libtool_args @inst_prefix_dir@)"
 
5158
      relink_command="(cd `pwd`; $SHELL $progpath $preserve_args --mode=relink $libtool_args @inst_prefix_dir@)"
5064
5159
      relink_command=`$echo "X$relink_command" | $Xsed -e "$sed_quote_subst"`
5065
5160
      if test "$hardcode_automatic" = yes ; then
5066
 
        relink_command=
5067
 
      fi  
 
5161
        relink_command=
 
5162
      fi
 
5163
 
 
5164
 
5068
5165
      # Only create the output if not a dry run.
5069
5166
      if test -z "$run"; then
5070
5167
        for installed in no yes; do
5082
5179
                eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $deplib`
5083
5180
                if test -z "$libdir"; then
5084
5181
                  $echo "$modename: \`$deplib' is not a valid libtool archive" 1>&2
5085
 
                  exit 1
 
5182
                  exit $EXIT_FAILURE
5086
5183
                fi
5087
5184
                newdependency_libs="$newdependency_libs $libdir/$name"
5088
5185
                ;;
5096
5193
              eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $lib`
5097
5194
              if test -z "$libdir"; then
5098
5195
                $echo "$modename: \`$lib' is not a valid libtool archive" 1>&2
5099
 
                exit 1
 
5196
                exit $EXIT_FAILURE
5100
5197
              fi
5101
5198
              newdlfiles="$newdlfiles $libdir/$name"
5102
5199
            done
5107
5204
              eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $lib`
5108
5205
              if test -z "$libdir"; then
5109
5206
                $echo "$modename: \`$lib' is not a valid libtool archive" 1>&2
5110
 
                exit 1
 
5207
                exit $EXIT_FAILURE
5111
5208
              fi
5112
5209
              newdlprefiles="$newdlprefiles $libdir/$name"
5113
5210
            done
5115
5212
          else
5116
5213
            newdlfiles=
5117
5214
            for lib in $dlfiles; do
5118
 
              case $lib in 
 
5215
              case $lib in
5119
5216
                [\\/]* | [A-Za-z]:[\\/]*) abs="$lib" ;;
5120
5217
                *) abs=`pwd`"/$lib" ;;
5121
5218
              esac
5124
5221
            dlfiles="$newdlfiles"
5125
5222
            newdlprefiles=
5126
5223
            for lib in $dlprefiles; do
5127
 
              case $lib in 
 
5224
              case $lib in
5128
5225
                [\\/]* | [A-Za-z]:[\\/]*) abs="$lib" ;;
5129
5226
                *) abs=`pwd`"/$lib" ;;
5130
5227
              esac
5187
5284
      $run eval '(cd $output_objdir && $rm $outputname && $LN_S ../$outputname $outputname)' || exit $?
5188
5285
      ;;
5189
5286
    esac
5190
 
    exit 0
 
5287
    exit $EXIT_SUCCESS
5191
5288
    ;;
5192
5289
 
5193
5290
  # libtool install mode
5276
5373
    if test -z "$install_prog"; then
5277
5374
      $echo "$modename: you must specify an install program" 1>&2
5278
5375
      $echo "$help" 1>&2
5279
 
      exit 1
 
5376
      exit $EXIT_FAILURE
5280
5377
    fi
5281
5378
 
5282
5379
    if test -n "$prev"; then
5283
5380
      $echo "$modename: the \`$prev' option requires an argument" 1>&2
5284
5381
      $echo "$help" 1>&2
5285
 
      exit 1
 
5382
      exit $EXIT_FAILURE
5286
5383
    fi
5287
5384
 
5288
5385
    if test -z "$files"; then
5292
5389
        $echo "$modename: you must specify a destination" 1>&2
5293
5390
      fi
5294
5391
      $echo "$help" 1>&2
5295
 
      exit 1
 
5392
      exit $EXIT_FAILURE
5296
5393
    fi
5297
5394
 
5298
5395
    # Strip any trailing slash from the destination.
5313
5410
      if test "$#" -gt 2; then
5314
5411
        $echo "$modename: \`$dest' is not a directory" 1>&2
5315
5412
        $echo "$help" 1>&2
5316
 
        exit 1
 
5413
        exit $EXIT_FAILURE
5317
5414
      fi
5318
5415
    fi
5319
5416
    case $destdir in
5325
5422
        *)
5326
5423
          $echo "$modename: \`$destdir' must be an absolute directory name" 1>&2
5327
5424
          $echo "$help" 1>&2
5328
 
          exit 1
 
5425
          exit $EXIT_FAILURE
5329
5426
          ;;
5330
5427
        esac
5331
5428
      done
5354
5451
        else
5355
5452
          $echo "$modename: \`$file' is not a valid libtool archive" 1>&2
5356
5453
          $echo "$help" 1>&2
5357
 
          exit 1
 
5454
          exit $EXIT_FAILURE
5358
5455
        fi
5359
5456
 
5360
5457
        library_names=
5396
5493
          # but it's something to keep an eye on.
5397
5494
          if test "$inst_prefix_dir" = "$destdir"; then
5398
5495
            $echo "$modename: error: cannot install \`$file' to a directory not ending in $libdir" 1>&2
5399
 
            exit 1
 
5496
            exit $EXIT_FAILURE
5400
5497
          fi
5401
5498
 
5402
5499
          if test -n "$inst_prefix_dir"; then
5411
5508
          if $run eval "$relink_command"; then :
5412
5509
          else
5413
5510
            $echo "$modename: error: relink \`$file' with the above command before installing it" 1>&2
5414
 
            exit 1
 
5511
            exit $EXIT_FAILURE
5415
5512
          fi
5416
5513
        fi
5417
5514
 
5446
5543
 
5447
5544
          # Do each command in the postinstall commands.
5448
5545
          lib="$destdir/$realname"
5449
 
          eval cmds=\"$postinstall_cmds\"
 
5546
          cmds=$postinstall_cmds
5450
5547
          save_ifs="$IFS"; IFS='~'
5451
5548
          for cmd in $cmds; do
5452
5549
            IFS="$save_ifs"
 
5550
            eval cmd=\"$cmd\"
5453
5551
            $show "$cmd"
5454
5552
            $run eval "$cmd" || exit $?
5455
5553
          done
5489
5587
        *)
5490
5588
          $echo "$modename: cannot copy a libtool object to \`$destfile'" 1>&2
5491
5589
          $echo "$help" 1>&2
5492
 
          exit 1
 
5590
          exit $EXIT_FAILURE
5493
5591
          ;;
5494
5592
        esac
5495
5593
 
5507
5605
          $show "$install_prog $staticobj $staticdest"
5508
5606
          $run eval "$install_prog \$staticobj \$staticdest" || exit $?
5509
5607
        fi
5510
 
        exit 0
 
5608
        exit $EXIT_SUCCESS
5511
5609
        ;;
5512
5610
 
5513
5611
      *)
5561
5659
          # Check the variables that should have been set.
5562
5660
          if test -z "$notinst_deplibs"; then
5563
5661
            $echo "$modename: invalid libtool wrapper script \`$wrapper'" 1>&2
5564
 
            exit 1
 
5662
            exit $EXIT_FAILURE
5565
5663
          fi
5566
5664
 
5567
5665
          finalize=yes
5602
5700
              tmpdir="/tmp"
5603
5701
              test -n "$TMPDIR" && tmpdir="$TMPDIR"
5604
5702
              tmpdir="$tmpdir/libtool-$$"
5605
 
              if $mkdir -p "$tmpdir" && chmod 700 "$tmpdir"; then :
 
5703
              save_umask=`umask`
 
5704
              umask 0077
 
5705
              if $mkdir "$tmpdir"; then
 
5706
                umask $save_umask
5606
5707
              else
 
5708
                umask $save_umask
5607
5709
                $echo "$modename: error: cannot create temporary directory \`$tmpdir'" 1>&2
5608
5710
                continue
5609
5711
              fi
5662
5764
      $show "$install_prog $file $oldlib"
5663
5765
      $run eval "$install_prog \$file \$oldlib" || exit $?
5664
5766
 
5665
 
      if test -n "$stripme" && test -n "$striplib"; then
 
5767
      if test -n "$stripme" && test -n "$old_striplib"; then
5666
5768
        $show "$old_striplib $oldlib"
5667
5769
        $run eval "$old_striplib $oldlib" || exit $?
5668
5770
      fi
5669
5771
 
5670
5772
      # Do each command in the postinstall commands.
5671
 
      eval cmds=\"$old_postinstall_cmds\"
 
5773
      cmds=$old_postinstall_cmds
5672
5774
      save_ifs="$IFS"; IFS='~'
5673
5775
      for cmd in $cmds; do
5674
5776
        IFS="$save_ifs"
 
5777
        eval cmd=\"$cmd\"
5675
5778
        $show "$cmd"
5676
5779
        $run eval "$cmd" || exit $?
5677
5780
      done
5685
5788
    if test -n "$current_libdirs"; then
5686
5789
      # Maybe just do a dry run.
5687
5790
      test -n "$run" && current_libdirs=" -n$current_libdirs"
5688
 
      exec_cmd='$SHELL $0 --finish$current_libdirs'
 
5791
      exec_cmd='$SHELL $progpath $preserve_args --finish$current_libdirs'
5689
5792
    else
5690
 
      exit 0
 
5793
      exit $EXIT_SUCCESS
5691
5794
    fi
5692
5795
    ;;
5693
5796
 
5706
5809
      for libdir in $libdirs; do
5707
5810
        if test -n "$finish_cmds"; then
5708
5811
          # Do each command in the finish commands.
5709
 
          eval cmds=\"$finish_cmds\"
 
5812
          cmds=$finish_cmds
5710
5813
          save_ifs="$IFS"; IFS='~'
5711
5814
          for cmd in $cmds; do
5712
5815
            IFS="$save_ifs"
 
5816
            eval cmd=\"$cmd\"
5713
5817
            $show "$cmd"
5714
5818
            $run eval "$cmd" || admincmds="$admincmds
5715
5819
       $cmd"
5726
5830
    fi
5727
5831
 
5728
5832
    # Exit here if they wanted silent mode.
5729
 
    test "$show" = : && exit 0
 
5833
    test "$show" = : && exit $EXIT_SUCCESS
5730
5834
 
5731
5835
    $echo "----------------------------------------------------------------------"
5732
5836
    $echo "Libraries have been installed in:"
5762
5866
    $echo "See any operating system documentation about shared libraries for"
5763
5867
    $echo "more information, such as the ld(1) and ld.so(8) manual pages."
5764
5868
    $echo "----------------------------------------------------------------------"
5765
 
    exit 0
 
5869
    exit $EXIT_SUCCESS
5766
5870
    ;;
5767
5871
 
5768
5872
  # libtool execute mode
5774
5878
    if test -z "$cmd"; then
5775
5879
      $echo "$modename: you must specify a COMMAND" 1>&2
5776
5880
      $echo "$help"
5777
 
      exit 1
 
5881
      exit $EXIT_FAILURE
5778
5882
    fi
5779
5883
 
5780
5884
    # Handle -dlopen flags immediately.
5782
5886
      if test ! -f "$file"; then
5783
5887
        $echo "$modename: \`$file' is not a file" 1>&2
5784
5888
        $echo "$help" 1>&2
5785
 
        exit 1
 
5889
        exit $EXIT_FAILURE
5786
5890
      fi
5787
5891
 
5788
5892
      dir=
5793
5897
        else
5794
5898
          $echo "$modename: \`$lib' is not a valid libtool archive" 1>&2
5795
5899
          $echo "$help" 1>&2
5796
 
          exit 1
 
5900
          exit $EXIT_FAILURE
5797
5901
        fi
5798
5902
 
5799
5903
        # Read the libtool library.
5820
5924
          dir="$dir/$objdir"
5821
5925
        else
5822
5926
          $echo "$modename: cannot find \`$dlname' in \`$dir' or \`$dir/$objdir'" 1>&2
5823
 
          exit 1
 
5927
          exit $EXIT_FAILURE
5824
5928
        fi
5825
5929
        ;;
5826
5930
 
5900
6004
        $echo "export $shlibpath_var"
5901
6005
      fi
5902
6006
      $echo "$cmd$args"
5903
 
      exit 0
 
6007
      exit $EXIT_SUCCESS
5904
6008
    fi
5905
6009
    ;;
5906
6010
 
5928
6032
    if test -z "$rm"; then
5929
6033
      $echo "$modename: you must specify an RM program" 1>&2
5930
6034
      $echo "$help" 1>&2
5931
 
      exit 1
 
6035
      exit $EXIT_FAILURE
5932
6036
    fi
5933
6037
 
5934
6038
    rmdirs=
5983
6087
          if test "$mode" = uninstall; then
5984
6088
            if test -n "$library_names"; then
5985
6089
              # Do each command in the postuninstall commands.
5986
 
              eval cmds=\"$postuninstall_cmds\"
 
6090
              cmds=$postuninstall_cmds
5987
6091
              save_ifs="$IFS"; IFS='~'
5988
6092
              for cmd in $cmds; do
5989
6093
                IFS="$save_ifs"
 
6094
                eval cmd=\"$cmd\"
5990
6095
                $show "$cmd"
5991
6096
                $run eval "$cmd"
5992
6097
                if test "$?" -ne 0 && test "$rmforce" != yes; then
5998
6103
 
5999
6104
            if test -n "$old_library"; then
6000
6105
              # Do each command in the old_postuninstall commands.
6001
 
              eval cmds=\"$old_postuninstall_cmds\"
 
6106
              cmds=$old_postuninstall_cmds
6002
6107
              save_ifs="$IFS"; IFS='~'
6003
6108
              for cmd in $cmds; do
6004
6109
                IFS="$save_ifs"
 
6110
                eval cmd=\"$cmd\"
6005
6111
                $show "$cmd"
6006
6112
                $run eval "$cmd"
6007
6113
                if test "$?" -ne 0 && test "$rmforce" != yes; then
6040
6146
        if test "$mode" = clean ; then
6041
6147
          noexename=$name
6042
6148
          case $file in
6043
 
          *.exe) 
 
6149
          *.exe)
6044
6150
            file=`$echo $file|${SED} 's,.exe$,,'`
6045
6151
            noexename=`$echo $name|${SED} 's,.exe$,,'`
6046
6152
            # $file with .exe has already been added to rmfiles,
6085
6191
  "")
6086
6192
    $echo "$modename: you must specify a MODE" 1>&2
6087
6193
    $echo "$generic_help" 1>&2
6088
 
    exit 1
 
6194
    exit $EXIT_FAILURE
6089
6195
    ;;
6090
6196
  esac
6091
6197
 
6092
6198
  if test -z "$exec_cmd"; then
6093
6199
    $echo "$modename: invalid operation mode \`$mode'" 1>&2
6094
6200
    $echo "$generic_help" 1>&2
6095
 
    exit 1
 
6201
    exit $EXIT_FAILURE
6096
6202
  fi
6097
6203
fi # test -z "$show_help"
6098
6204
 
6099
6205
if test -n "$exec_cmd"; then
6100
6206
  eval exec $exec_cmd
6101
 
  exit 1
 
6207
  exit $EXIT_FAILURE
6102
6208
fi
6103
6209
 
6104
6210
# We need to display help for each of the modes.
6134
6240
a more detailed description of MODE.
6135
6241
 
6136
6242
Report bugs to <bug-libtool@gnu.org>."
6137
 
  exit 0
 
6243
  exit $EXIT_SUCCESS
6138
6244
  ;;
6139
6245
 
6140
6246
clean)
6246
6352
  -no-undefined     declare that a library does not refer to external symbols
6247
6353
  -o OUTPUT-FILE    create OUTPUT-FILE from the specified objects
6248
6354
  -objectlist FILE  Use a list of object files found in FILE to specify objects
 
6355
  -precious-files-regex REGEX
 
6356
                    don't remove output files matching REGEX
6249
6357
  -release RELEASE  specify package release information
6250
6358
  -rpath LIBDIR     the created library will eventually be installed in LIBDIR
6251
6359
  -R[ ]LIBDIR       add LIBDIR to the runtime path of programs and libraries
6287
6395
*)
6288
6396
  $echo "$modename: invalid operation mode \`$mode'" 1>&2
6289
6397
  $echo "$help" 1>&2
6290
 
  exit 1
 
6398
  exit $EXIT_FAILURE
6291
6399
  ;;
6292
6400
esac
6293
6401
 
6294
6402
$echo
6295
6403
$echo "Try \`$modename --help' for more information about other modes."
6296
6404
 
6297
 
exit 0
 
6405
exit $EXIT_SUCCESS
6298
6406
 
6299
6407
# The TAGs below are defined such that we never get into a situation
6300
6408
# in which we disable both kinds of libraries.  Given conflicting