~ubuntu-branches/ubuntu/feisty/xfce-mcs-plugins/feisty

« back to all changes in this revision

Viewing changes to ltmain.sh

  • Committer: Bazaar Package Importer
  • Author(s): Simon Huggins
  • Date: 2004-04-27 22:08:03 UTC
  • Revision ID: james.westby@ubuntu.com-20040427220803-7jo3b14qrhdo9l29
Tags: 4.0.5-1
* New upstream release
* Update upstream's libtool

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: 203 $"
 
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
 
# define SED for historic ltconfig's generated by Libtool 1.3
52
 
test -z "$SED" && SED=sed
53
 
 
54
 
# The name of this program.
55
 
progname=`$echo "$0" | ${SED} 's%^.*/%%'`
56
 
modename="$progname"
57
 
 
58
 
# Constants.
59
 
PROGRAM=ltmain.sh
60
 
PACKAGE=libtool
61
 
VERSION=1.5
62
 
TIMESTAMP=" (1.1220.2.1 2003/04/14 22:48:00)"
63
 
 
64
74
default_mode=
65
75
help="Try \`$progname --help' for more information."
66
76
magic="%%%MAGIC variable%%%"
73
83
Xsed="${SED}"' -e 1s/^X//'
74
84
sed_quote_subst='s/\([\\`\\"$\\\\]\)/\\\1/g'
75
85
# test EBCDIC or ASCII
76
 
case `echo A|od -x` in
77
 
 *[Cc]1*) # EBCDIC based system
 
86
case `echo A|tr A '\301'` in
 
87
 A) # EBCDIC based system
78
88
  SP2NL="tr '\100' '\n'"
79
89
  NL2SP="tr '\r\n' '\100\100'"
80
90
  ;;
97
107
fi
98
108
 
99
109
# Make sure IFS has a sensible default
100
 
: ${IFS="       "}
 
110
: ${IFS="       
 
111
"}
101
112
 
102
113
if test "$build_libtool_libs" != yes && test "$build_old_libs" != yes; then
103
114
  $echo "$modename: not configured to build any kind of library" 1>&2
104
115
  $echo "Fatal configuration error.  See the $PACKAGE docs for more information." 1>&2
105
 
  exit 1
 
116
  exit $EXIT_FAILURE
106
117
fi
107
118
 
108
119
# Global variables.
121
132
# Shell function definitions:
122
133
# This seems to be the best place for them
123
134
 
 
135
# func_win32_libid arg
 
136
# return the library type of file 'arg'
 
137
#
124
138
# Need a lot of goo to handle *both* DLLs and import libs
125
139
# Has to be a shell function in order to 'eat' the argument
126
140
# that is supplied when $file_magic_command is called.
127
 
win32_libid () {
 
141
func_win32_libid () {
128
142
  win32_libid_type="unknown"
129
143
  win32_fileres=`file -L $1 2>/dev/null`
130
144
  case $win32_fileres in
133
147
    ;;
134
148
  *ar\ archive*) # could be an import, or static
135
149
    if eval $OBJDUMP -f $1 | $SED -e '10q' 2>/dev/null | \
136
 
      grep -E 'file format pe-i386(.*architecture: i386)?' >/dev/null ; then
 
150
      $EGREP -e 'file format pe-i386(.*architecture: i386)?' >/dev/null ; then
137
151
      win32_nmres=`eval $NM -f posix -A $1 | \
138
152
        sed -n -e '1,100{/ I /{x;/import/!{s/^/import/;h;p;};x;};}'`
139
153
      if test "X$win32_nmres" = "Ximport" ; then
143
157
      fi
144
158
    fi
145
159
    ;;
146
 
  *DLL*) 
 
160
  *DLL*)
147
161
    win32_libid_type="x86 DLL"
148
162
    ;;
149
163
  *executable*) # but shell scripts are "executable" too...
157
171
  $echo $win32_libid_type
158
172
}
159
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
}
160
238
# End of Shell function definitions
161
239
#####################################
162
240
 
 
241
# Darwin sucks
 
242
eval std_shrext=\"$shrext_cmds\"
 
243
 
163
244
# Parse our command line options once, thoroughly.
164
245
while test "$#" -gt 0
165
246
do
179
260
      ;;
180
261
    tag)
181
262
      tagname="$arg"
 
263
      preserve_args="${preserve_args}=$arg"
182
264
 
183
265
      # Check whether tagname contains only valid characters
184
266
      case $tagname in
185
267
      *[!-_A-Za-z0-9,/]*)
186
268
        $echo "$progname: invalid tag name: $tagname" 1>&2
187
 
        exit 1
 
269
        exit $EXIT_FAILURE
188
270
        ;;
189
271
      esac
190
272
 
194
276
        # not specially marked.
195
277
        ;;
196
278
      *)
197
 
        if grep "^# ### BEGIN LIBTOOL TAG CONFIG: $tagname$" < "$0" > /dev/null; then
 
279
        if grep "^# ### BEGIN LIBTOOL TAG CONFIG: $tagname$" < "$progpath" > /dev/null; then
198
280
          taglist="$taglist $tagname"
199
281
          # Evaluate the configuration.
200
 
          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`"
201
283
        else
202
284
          $echo "$progname: ignoring unknown tag $tagname" 1>&2
203
285
        fi
226
308
    $echo "Copyright (C) 2003  Free Software Foundation, Inc."
227
309
    $echo "This is free software; see the source for copying conditions.  There is NO"
228
310
    $echo "warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE."
229
 
    exit 0
 
311
    exit $EXIT_SUCCESS
230
312
    ;;
231
313
 
232
314
  --config)
233
 
    ${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
234
316
    # Now print the configurations for the tags.
235
317
    for tagname in $taglist; do
236
 
      ${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"
237
319
    done
238
 
    exit 0
 
320
    exit $EXIT_SUCCESS
239
321
    ;;
240
322
 
241
323
  --debug)
242
324
    $echo "$progname: enabling shell trace mode"
243
325
    set -x
 
326
    preserve_args="$preserve_args $arg"
244
327
    ;;
245
328
 
246
329
  --dry-run | -n)
259
342
    else
260
343
      $echo "disable static libraries"
261
344
    fi
262
 
    exit 0
 
345
    exit $EXIT_SUCCESS
263
346
    ;;
264
347
 
265
348
  --finish) mode="finish" ;;
271
354
 
272
355
  --quiet | --silent)
273
356
    show=:
 
357
    preserve_args="$preserve_args $arg"
274
358
    ;;
275
359
 
276
360
  --tag) prevopt="--tag" prev=tag ;;
278
362
    set tag "$optarg" ${1+"$@"}
279
363
    shift
280
364
    prev=tag
 
365
    preserve_args="$preserve_args --tag"
281
366
    ;;
282
367
 
283
368
  -dlopen)
288
373
  -*)
289
374
    $echo "$modename: unrecognized option \`$arg'" 1>&2
290
375
    $echo "$help" 1>&2
291
 
    exit 1
 
376
    exit $EXIT_FAILURE
292
377
    ;;
293
378
 
294
379
  *)
301
386
if test -n "$prevopt"; then
302
387
  $echo "$modename: option \`$prevopt' requires an argument" 1>&2
303
388
  $echo "$help" 1>&2
304
 
  exit 1
 
389
  exit $EXIT_FAILURE
305
390
fi
306
391
 
307
392
# If this variable is set in any of the actions, the command in it
357
442
  if test -n "$execute_dlfiles" && test "$mode" != execute; then
358
443
    $echo "$modename: unrecognized option \`-dlopen'" 1>&2
359
444
    $echo "$help" 1>&2
360
 
    exit 1
 
445
    exit $EXIT_FAILURE
361
446
  fi
362
447
 
363
448
  # Change the help message to a mode-specific one.
372
457
    # Get the compilation command and the source file.
373
458
    base_compile=
374
459
    srcfile="$nonopt"  #  always keep a non-empty value in "srcfile"
 
460
    suppress_opt=yes
375
461
    suppress_output=
376
462
    arg_mode=normal
377
463
    libobj=
 
464
    later=
378
465
 
379
466
    for arg
380
467
    do
397
484
        -o)
398
485
          if test -n "$libobj" ; then
399
486
            $echo "$modename: you cannot specify \`-o' more than once" 1>&2
400
 
            exit 1
 
487
            exit $EXIT_FAILURE
401
488
          fi
402
489
          arg_mode=target
403
490
          continue
404
491
          ;;
405
492
 
406
 
        -static)
407
 
          build_old_libs=yes
408
 
          continue
409
 
          ;;
410
 
 
411
 
        -prefer-pic)
412
 
          pic_mode=yes
413
 
          continue
414
 
          ;;
415
 
 
416
 
        -prefer-non-pic)
417
 
          pic_mode=no
 
493
        -static | -prefer-pic | -prefer-non-pic)
 
494
          later="$later $arg"
 
495
          continue
 
496
          ;;
 
497
 
 
498
        -no-suppress)
 
499
          suppress_opt=no
418
500
          continue
419
501
          ;;
420
502
 
427
509
          args=`$echo "X$arg" | $Xsed -e "s/^-Wc,//"`
428
510
          lastarg=
429
511
          save_ifs="$IFS"; IFS=','
430
 
          for arg in $args; do
 
512
          for arg in $args; do
431
513
            IFS="$save_ifs"
432
514
 
433
515
            # Double-quote args containing other shell metacharacters.
477
559
    case $arg_mode in
478
560
    arg)
479
561
      $echo "$modename: you must specify an argument for -Xcompile"
480
 
      exit 1
 
562
      exit $EXIT_FAILURE
481
563
      ;;
482
564
    target)
483
565
      $echo "$modename: you must specify a target with \`-o'" 1>&2
484
 
      exit 1
 
566
      exit $EXIT_FAILURE
485
567
      ;;
486
568
    *)
487
569
      # Get the name of the library object.
514
596
    *.lo) obj=`$echo "X$libobj" | $Xsed -e "$lo2o"` ;;
515
597
    *)
516
598
      $echo "$modename: cannot determine name of library object from \`$libobj'" 1>&2
517
 
      exit 1
 
599
      exit $EXIT_FAILURE
518
600
      ;;
519
601
    esac
520
602
 
521
 
    # Infer tagged configuration to use if any are available and
522
 
    # if one wasn't chosen via the "--tag" command line option.
523
 
    # Only attempt this if the compiler in the base compile
524
 
    # command doesn't match the default compiler.
525
 
    if test -n "$available_tags" && test -z "$tagname"; then
526
 
      case $base_compile in
527
 
      # Blanks in the command may have been stripped by the calling shell,
528
 
      # but not from the CC environment variable when configure was run.
529
 
      " $CC "* | "$CC "* | " `$echo $CC` "* | "`$echo $CC` "*) ;;
530
 
      # Blanks at the start of $base_compile will cause this to fail
531
 
      # if we don't check for them as well.
532
 
      *)
533
 
        for z in $available_tags; do
534
 
          if grep "^# ### BEGIN LIBTOOL TAG CONFIG: $z$" < "$0" > /dev/null; then
535
 
            # Evaluate the configuration.
536
 
            eval "`${SED} -n -e '/^# ### BEGIN LIBTOOL TAG CONFIG: '$z'$/,/^# ### END LIBTOOL TAG CONFIG: '$z'$/p' < $0`"
537
 
            case "$base_compile " in
538
 
            "$CC "* | " $CC "* | "`$echo $CC` "* | " `$echo $CC` "*)
539
 
              # The compiler in the base compile command matches
540
 
              # the one in the tagged configuration.
541
 
              # Assume this is the tagged configuration we want.
542
 
              tagname=$z
543
 
              break
544
 
              ;;
545
 
            esac
546
 
          fi
547
 
        done
548
 
        # If $tagname still isn't set, then no tagged configuration
549
 
        # was found and let the user know that the "--tag" command
550
 
        # line option must be used.
551
 
        if test -z "$tagname"; then
552
 
          $echo "$modename: unable to infer tagged configuration"
553
 
          $echo "$modename: specify a tag with \`--tag'" 1>&2
554
 
          exit 1
555
 
#        else
556
 
#          $echo "$modename: using $tagname tagged configuration"
557
 
        fi
 
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
558
620
        ;;
559
621
      esac
560
 
    fi
 
622
    done
561
623
 
562
624
    objname=`$echo "X$obj" | $Xsed -e 's%^.*/%%'`
563
625
    xdir=`$echo "X$obj" | $Xsed -e 's%/[^/]*$%%'`
571
633
    if test -z "$base_compile"; then
572
634
      $echo "$modename: you must specify a compilation command" 1>&2
573
635
      $echo "$help" 1>&2
574
 
      exit 1
 
636
      exit $EXIT_FAILURE
575
637
    fi
576
638
 
577
639
    # Delete any leftover library objects.
582
644
    fi
583
645
 
584
646
    $run $rm $removelist
585
 
    trap "$run $rm $removelist; exit 1" 1 2 15
 
647
    trap "$run $rm $removelist; exit $EXIT_FAILURE" 1 2 15
586
648
 
587
649
    # On Cygwin there's no "real" PIC flag so we must build both object types
588
650
    case $host_os in
601
663
      output_obj=`$echo "X$srcfile" | $Xsed -e 's%^.*/%%' -e 's%\.[^.]*$%%'`.${objext}
602
664
      lockfile="$output_obj.lock"
603
665
      removelist="$removelist $output_obj $lockfile"
604
 
      trap "$run $rm $removelist; exit 1" 1 2 15
 
666
      trap "$run $rm $removelist; exit $EXIT_FAILURE" 1 2 15
605
667
    else
606
668
      output_obj=
607
669
      need_locks=no
611
673
    # Lock this critical section if it is needed
612
674
    # We use this script file to make the link, it avoids creating a new file
613
675
    if test "$need_locks" = yes; then
614
 
      until $run ln "$0" "$lockfile" 2>/dev/null; do
 
676
      until $run ln "$progpath" "$lockfile" 2>/dev/null; do
615
677
        $show "Waiting for $lockfile to be removed"
616
678
        sleep 2
617
679
      done
629
691
compiler."
630
692
 
631
693
        $run $rm $removelist
632
 
        exit 1
 
694
        exit $EXIT_FAILURE
633
695
      fi
634
696
      $echo $srcfile > "$lockfile"
635
697
    fi
684
746
      if $run eval "$command"; then :
685
747
      else
686
748
        test -n "$output_obj" && $run $rm $removelist
687
 
        exit 1
 
749
        exit $EXIT_FAILURE
688
750
      fi
689
751
 
690
752
      if test "$need_locks" = warn &&
704
766
compiler."
705
767
 
706
768
        $run $rm $removelist
707
 
        exit 1
 
769
        exit $EXIT_FAILURE
708
770
      fi
709
771
 
710
772
      # Just move the object if needed, then go on to compile the next one
725
787
EOF
726
788
 
727
789
      # Allow error messages only from the first compilation.
728
 
      suppress_output=' >/dev/null 2>&1'
 
790
      if test "$suppress_opt" = yes; then
 
791
        suppress_output=' >/dev/null 2>&1'
 
792
      fi
729
793
    else
730
794
      # No PIC object so indicate it doesn't exist in the libtool
731
795
      # object file.
754
818
      if $run eval "$command"; then :
755
819
      else
756
820
        $run $rm $removelist
757
 
        exit 1
 
821
        exit $EXIT_FAILURE
758
822
      fi
759
823
 
760
824
      if test "$need_locks" = warn &&
774
838
compiler."
775
839
 
776
840
        $run $rm $removelist
777
 
        exit 1
 
841
        exit $EXIT_FAILURE
778
842
      fi
779
843
 
780
844
      # Just move the object if needed
812
876
      $run $rm "$lockfile"
813
877
    fi
814
878
 
815
 
    exit 0
 
879
    exit $EXIT_SUCCESS
816
880
    ;;
817
881
 
818
882
  # libtool link mode
838
902
      ;;
839
903
    esac
840
904
    libtool_args="$nonopt"
841
 
    base_compile="$nonopt"
 
905
    base_compile="$nonopt $@"
842
906
    compile_command="$nonopt"
843
907
    finalize_command="$nonopt"
844
908
 
870
934
    no_install=no
871
935
    objs=
872
936
    non_pic_objects=
 
937
    precious_files_regex=
873
938
    prefer_static_libs=no
874
939
    preload=no
875
940
    prev=
883
948
    vinfo=
884
949
    vinfo_number=no
885
950
 
 
951
    func_infer_tag $base_compile
 
952
 
886
953
    # We need to know -static, to get the right output filenames.
887
954
    for arg
888
955
    do
914
981
    # Go through the arguments, transforming them on the way.
915
982
    while test "$#" -gt 0; do
916
983
      arg="$1"
917
 
      base_compile="$base_compile $arg"
918
984
      shift
919
985
      case $arg in
920
986
      *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \     ]*|*]*|"")
978
1044
          export_symbols="$arg"
979
1045
          if test ! -f "$arg"; then
980
1046
            $echo "$modename: symbol file \`$arg' does not exist"
981
 
            exit 1
 
1047
            exit $EXIT_FAILURE
982
1048
          fi
983
1049
          prev=
984
1050
          continue
993
1059
          prev=
994
1060
          continue
995
1061
          ;;
 
1062
        precious_regex)
 
1063
          precious_files_regex="$arg"
 
1064
          prev=
 
1065
          continue
 
1066
          ;;
996
1067
        release)
997
1068
          release="-$arg"
998
1069
          prev=
1025
1096
                   test "$pic_object" = none && \
1026
1097
                   test "$non_pic_object" = none; then
1027
1098
                  $echo "$modename: cannot find name of object for \`$arg'" 1>&2
1028
 
                  exit 1
 
1099
                  exit $EXIT_FAILURE
1029
1100
                fi
1030
1101
 
1031
1102
                # Extract subdirectory from the argument.
1078
1149
                # Only an error if not doing a dry-run.
1079
1150
                if test -z "$run"; then
1080
1151
                  $echo "$modename: \`$arg' is not a valid libtool object" 1>&2
1081
 
                  exit 1
 
1152
                  exit $EXIT_FAILURE
1082
1153
                else
1083
1154
                  # Dry-run case.
1084
1155
 
1099
1170
            done
1100
1171
          else
1101
1172
            $echo "$modename: link input file \`$save_arg' does not exist"
1102
 
            exit 1
 
1173
            exit $EXIT_FAILURE
1103
1174
          fi
1104
1175
          arg=$save_arg
1105
1176
          prev=
1111
1182
          [\\/]* | [A-Za-z]:[\\/]*) ;;
1112
1183
          *)
1113
1184
            $echo "$modename: only absolute run-paths are allowed" 1>&2
1114
 
            exit 1
 
1185
            exit $EXIT_FAILURE
1115
1186
            ;;
1116
1187
          esac
1117
1188
          if test "$prev" = rpath; then
1151
1222
          finalize_command="$finalize_command $qarg"
1152
1223
          continue
1153
1224
          ;;
 
1225
        shrext)
 
1226
          shrext_cmds="$arg"
 
1227
          prev=
 
1228
          continue
 
1229
          ;;
1154
1230
        *)
1155
1231
          eval "$prev=\"\$arg\""
1156
1232
          prev=
1199
1275
      -export-symbols | -export-symbols-regex)
1200
1276
        if test -n "$export_symbols" || test -n "$export_symbols_regex"; then
1201
1277
          $echo "$modename: more than one -exported-symbols argument is not allowed"
1202
 
          exit 1
 
1278
          exit $EXIT_FAILURE
1203
1279
        fi
1204
1280
        if test "X$arg" = "X-export-symbols"; then
1205
1281
          prev=expsyms
1235
1311
          absdir=`cd "$dir" && pwd`
1236
1312
          if test -z "$absdir"; then
1237
1313
            $echo "$modename: cannot determine absolute directory name of \`$dir'" 1>&2
1238
 
            exit 1
 
1314
            exit $EXIT_FAILURE
1239
1315
          fi
1240
1316
          dir="$absdir"
1241
1317
          ;;
1290
1366
        continue
1291
1367
        ;;
1292
1368
 
 
1369
     -mt|-mthreads|-kthread|-Kthread|-pthread|-pthreads|--thread-safe)
 
1370
        deplibs="$deplibs $arg"
 
1371
        continue
 
1372
        ;;
 
1373
 
1293
1374
      -module)
1294
1375
        module=yes
1295
1376
        continue
1354
1435
 
1355
1436
      -o) prev=output ;;
1356
1437
 
 
1438
      -precious-files-regex)
 
1439
        prev=precious_regex
 
1440
        continue
 
1441
        ;;
 
1442
 
1357
1443
      -release)
1358
1444
        prev=release
1359
1445
        continue
1376
1462
        [\\/]* | [A-Za-z]:[\\/]*) ;;
1377
1463
        *)
1378
1464
          $echo "$modename: only absolute run-paths are allowed" 1>&2
1379
 
          exit 1
 
1465
          exit $EXIT_FAILURE
1380
1466
          ;;
1381
1467
        esac
1382
1468
        case "$xrpath " in
1499
1585
             test "$pic_object" = none && \
1500
1586
             test "$non_pic_object" = none; then
1501
1587
            $echo "$modename: cannot find name of object for \`$arg'" 1>&2
1502
 
            exit 1
 
1588
            exit $EXIT_FAILURE
1503
1589
          fi
1504
1590
 
1505
1591
          # Extract subdirectory from the argument.
1552
1638
          # Only an error if not doing a dry-run.
1553
1639
          if test -z "$run"; then
1554
1640
            $echo "$modename: \`$arg' is not a valid libtool object" 1>&2
1555
 
            exit 1
 
1641
            exit $EXIT_FAILURE
1556
1642
          else
1557
1643
            # Dry-run case.
1558
1644
 
1619
1705
    if test -n "$prev"; then
1620
1706
      $echo "$modename: the \`$prevarg' option requires an argument" 1>&2
1621
1707
      $echo "$help" 1>&2
1622
 
      exit 1
1623
 
    fi
1624
 
 
1625
 
    # Infer tagged configuration to use if any are available and
1626
 
    # if one wasn't chosen via the "--tag" command line option.
1627
 
    # Only attempt this if the compiler in the base link
1628
 
    # command doesn't match the default compiler.
1629
 
    if test -n "$available_tags" && test -z "$tagname"; then
1630
 
      case $base_compile in
1631
 
      # Blanks in the command may have been stripped by the calling shell,
1632
 
      # but not from the CC environment variable when configure was run.
1633
 
      "$CC "* | " $CC "* | "`$echo $CC` "* | " `$echo $CC` "*) ;;
1634
 
      # Blanks at the start of $base_compile will cause this to fail
1635
 
      # if we don't check for them as well.
1636
 
      *)
1637
 
        for z in $available_tags; do
1638
 
          if grep "^# ### BEGIN LIBTOOL TAG CONFIG: $z$" < "$0" > /dev/null; then
1639
 
            # Evaluate the configuration.
1640
 
            eval "`${SED} -n -e '/^# ### BEGIN LIBTOOL TAG CONFIG: '$z'$/,/^# ### END LIBTOOL TAG CONFIG: '$z'$/p' < $0`"
1641
 
            case $base_compile in
1642
 
            "$CC "* | " $CC "* | "`$echo $CC` "* | " `$echo $CC` "*)
1643
 
              # The compiler in $compile_command matches
1644
 
              # the one in the tagged configuration.
1645
 
              # Assume this is the tagged configuration we want.
1646
 
              tagname=$z
1647
 
              break
1648
 
              ;;
1649
 
            esac
1650
 
          fi
1651
 
        done
1652
 
        # If $tagname still isn't set, then no tagged configuration
1653
 
        # was found and let the user know that the "--tag" command
1654
 
        # line option must be used.
1655
 
        if test -z "$tagname"; then
1656
 
          $echo "$modename: unable to infer tagged configuration"
1657
 
          $echo "$modename: specify a tag with \`--tag'" 1>&2
1658
 
          exit 1
1659
 
#       else
1660
 
#         $echo "$modename: using $tagname tagged configuration"
1661
 
        fi
1662
 
        ;;
1663
 
      esac
 
1708
      exit $EXIT_FAILURE
1664
1709
    fi
1665
1710
 
1666
1711
    if test "$export_dynamic" = yes && test -n "$export_dynamic_flag_spec"; then
1704
1749
    "")
1705
1750
      $echo "$modename: you must specify an output file" 1>&2
1706
1751
      $echo "$help" 1>&2
1707
 
      exit 1
 
1752
      exit $EXIT_FAILURE
1708
1753
      ;;
1709
1754
    *.$libext) linkmode=oldlib ;;
1710
1755
    *.lo | *.$objext) linkmode=obj ;;
1714
1759
 
1715
1760
    case $host in
1716
1761
    *cygwin* | *mingw* | *pw32*)
1717
 
      # don't eliminate duplcations in $postdeps and $predeps
 
1762
      # don't eliminate duplications in $postdeps and $predeps
1718
1763
      duplicate_compiler_generated_deps=yes
1719
1764
      ;;
1720
1765
    *)
1767
1812
          *.la) ;;
1768
1813
          *)
1769
1814
            $echo "$modename: libraries can \`-dlopen' only libtool libraries: $file" 1>&2
1770
 
            exit 1
 
1815
            exit $EXIT_FAILURE
1771
1816
            ;;
1772
1817
          esac
1773
1818
        done
1793
1838
        case $pass in
1794
1839
        dlopen) libs="$dlfiles" ;;
1795
1840
        dlpreopen) libs="$dlprefiles" ;;
1796
 
        link) libs="$deplibs %DEPLIBS% $dependency_libs" ;;
 
1841
        link)
 
1842
          libs="$deplibs %DEPLIBS%"
 
1843
          test "X$link_all_deplibs" != Xno && libs="$libs $dependency_libs"
 
1844
          ;;
1797
1845
        esac
1798
1846
      fi
1799
1847
      if test "$pass" = dlopen; then
1805
1853
        lib=
1806
1854
        found=no
1807
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
          ;;
1808
1865
        -l*)
1809
1866
          if test "$linkmode" != lib && test "$linkmode" != prog; then
1810
1867
            $echo "$modename: warning: \`-l' is ignored for archives/objects" 1>&2
1816
1873
          fi
1817
1874
          name=`$echo "X$deplib" | $Xsed -e 's/^-l//'`
1818
1875
          for searchdir in $newlib_search_path $lib_search_path $sys_lib_search_path $shlib_search_path; do
1819
 
            # Search the libtool library
1820
 
            lib="$searchdir/lib${name}.la"
1821
 
            if test -f "$lib"; then
1822
 
              found=yes
1823
 
              break
1824
 
            fi
 
1876
            for search_ext in .la $std_shrext .so .a; do
 
1877
              # Search the libtool library
 
1878
              lib="$searchdir/lib${name}${search_ext}"
 
1879
              if test -f "$lib"; then
 
1880
                if test "$search_ext" = ".la"; then
 
1881
                  found=yes
 
1882
                else
 
1883
                  found=no
 
1884
                fi
 
1885
                break 2
 
1886
              fi
 
1887
            done
1825
1888
          done
1826
1889
          if test "$found" != yes; then
1827
1890
            # deplib doesn't seem to be a libtool library
1886
1949
            fi
1887
1950
            if test "$pass" = scan; then
1888
1951
              deplibs="$deplib $deplibs"
1889
 
              newlib_search_path="$newlib_search_path "`$echo "X$deplib" | $Xsed -e 's/^-L//'`
1890
1952
            else
1891
1953
              compile_deplibs="$deplib $compile_deplibs"
1892
1954
              finalize_deplibs="$deplib $finalize_deplibs"
1893
1955
            fi
 
1956
            newlib_search_path="$newlib_search_path "`$echo "X$deplib" | $Xsed -e 's/^-L//'`
1894
1957
            ;;
1895
1958
          *)
1896
1959
            $echo "$modename: warning: \`-L' is ignored for archives/objects" 1>&2
1969
2032
        if test "$found" = yes || test -f "$lib"; then :
1970
2033
        else
1971
2034
          $echo "$modename: cannot find the library \`$lib'" 1>&2
1972
 
          exit 1
 
2035
          exit $EXIT_FAILURE
1973
2036
        fi
1974
2037
 
1975
2038
        # Check to see that this really is a libtool archive.
1976
2039
        if (${SED} -e '2q' $lib | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then :
1977
2040
        else
1978
2041
          $echo "$modename: \`$lib' is not a valid libtool archive" 1>&2
1979
 
          exit 1
 
2042
          exit $EXIT_FAILURE
1980
2043
        fi
1981
2044
 
1982
2045
        ladir=`$echo "X$lib" | $Xsed -e 's%/[^/]*$%%'`
2012
2075
          if test -z "$libdir"; then
2013
2076
            if test -z "$old_library"; then
2014
2077
              $echo "$modename: cannot find name of link library for \`$lib'" 1>&2
2015
 
              exit 1
 
2078
              exit $EXIT_FAILURE
2016
2079
            fi
2017
2080
            # It is a libtool convenience library, so add in its objects.
2018
2081
            convenience="$convenience $ladir/$objdir/$old_library"
2029
2092
            done
2030
2093
          elif test "$linkmode" != prog && test "$linkmode" != lib; then
2031
2094
            $echo "$modename: \`$lib' is not a convenience library" 1>&2
2032
 
            exit 1
 
2095
            exit $EXIT_FAILURE
2033
2096
          fi
2034
2097
          continue
2035
2098
        fi # $pass = conv
2036
2099
 
2037
 
    
 
2100
 
2038
2101
        # Get the name of the library we link against.
2039
2102
        linklib=
2040
2103
        for l in $old_library $library_names; do
2042
2105
        done
2043
2106
        if test -z "$linklib"; then
2044
2107
          $echo "$modename: cannot find name of link library for \`$lib'" 1>&2
2045
 
          exit 1
 
2108
          exit $EXIT_FAILURE
2046
2109
        fi
2047
2110
 
2048
2111
        # This library was specified with -dlopen.
2049
2112
        if test "$pass" = dlopen; then
2050
2113
          if test -z "$libdir"; then
2051
2114
            $echo "$modename: cannot -dlopen a convenience library: \`$lib'" 1>&2
2052
 
            exit 1
 
2115
            exit $EXIT_FAILURE
2053
2116
          fi
2054
 
          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
2055
2120
            # If there is no dlname, no dlopen support or we're linking
2056
2121
            # statically, we need to preload.  We also need to preload any
2057
2122
            # dependent libraries so libltdl's deplib preloader doesn't
2100
2165
        if test "$pass" = dlpreopen; then
2101
2166
          if test -z "$libdir"; then
2102
2167
            $echo "$modename: cannot -dlpreopen a convenience library: \`$lib'" 1>&2
2103
 
            exit 1
 
2168
            exit $EXIT_FAILURE
2104
2169
          fi
2105
2170
          # Prefer using a static library (so that no silly _DYNAMIC symbols
2106
2171
          # are required to link).
2127
2192
          continue
2128
2193
        fi
2129
2194
 
2130
 
    
 
2195
 
2131
2196
        if test "$linkmode" = prog && test "$pass" != link; then
2132
2197
          newlib_search_path="$newlib_search_path $ladir"
2133
2198
          deplibs="$lib $deplibs"
2214
2279
            need_relink=yes
2215
2280
          fi
2216
2281
          # This is a shared library
2217
 
        
2218
 
      # Warn about portability, can't link against -module's on some systems (darwin)
2219
 
      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
2220
2286
            $echo
2221
2287
            if test "$linkmode" = prog; then
2222
2288
              $echo "*** Warning: Linking the executable $output against the loadable module"
2223
2289
            else
2224
2290
              $echo "*** Warning: Linking the shared library $output against the loadable module"
2225
2291
            fi
2226
 
            $echo "*** $linklib is not portable!"    
2227
 
      fi          
 
2292
            $echo "*** $linklib is not portable!"
 
2293
          fi
2228
2294
          if test "$linkmode" = lib &&
2229
2295
             test "$hardcode_into_libs" = yes; then
2230
2296
            # Hardcode the library path.
2282
2348
            else
2283
2349
              $show "extracting exported symbol list from \`$soname'"
2284
2350
              save_ifs="$IFS"; IFS='~'
2285
 
              eval cmds=\"$extract_expsyms_cmds\"
 
2351
              cmds=$extract_expsyms_cmds
2286
2352
              for cmd in $cmds; do
2287
2353
                IFS="$save_ifs"
 
2354
                eval cmd=\"$cmd\"
2288
2355
                $show "$cmd"
2289
2356
                $run eval "$cmd" || exit $?
2290
2357
              done
2295
2362
            if test -f "$output_objdir/$newlib"; then :; else
2296
2363
              $show "generating import library for \`$soname'"
2297
2364
              save_ifs="$IFS"; IFS='~'
2298
 
              eval cmds=\"$old_archive_from_expsyms_cmds\"
 
2365
              cmds=$old_archive_from_expsyms_cmds
2299
2366
              for cmd in $cmds; do
2300
2367
                IFS="$save_ifs"
 
2368
                eval cmd=\"$cmd\"
2301
2369
                $show "$cmd"
2302
2370
                $run eval "$cmd" || exit $?
2303
2371
              done
2320
2388
                case $host in
2321
2389
                  *-*-sco3.2v5* ) add_dir="-L$dir" ;;
2322
2390
                  *-*-darwin* )
2323
 
                    # if the lib is a module then we can not link against it, someone
2324
 
                    # is ignoring the new warnings I added
2325
 
                    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
2326
2394
                      $echo "** Warning, lib $linklib is a module, not a shared library"
2327
2395
                      if test -z "$old_library" ; then
2328
2396
                        $echo
2330
2398
                        $echo "** The link will probably fail, sorry"
2331
2399
                      else
2332
2400
                        add="$dir/$old_library"
2333
 
                      fi 
 
2401
                      fi
2334
2402
                    fi
2335
2403
                esac
2336
2404
              elif test "$hardcode_minus_L" = no; then
2372
2440
 
2373
2441
            if test "$lib_linked" != yes; then
2374
2442
              $echo "$modename: configuration error: unsupported hardcode properties"
2375
 
              exit 1
 
2443
              exit $EXIT_FAILURE
2376
2444
            fi
2377
2445
 
2378
2446
            if test -n "$add_shlibpath"; then
2415
2483
              esac
2416
2484
              add="-l$name"
2417
2485
            elif test "$hardcode_automatic" = yes; then
2418
 
              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
2419
2488
                add="$inst_prefix_dir$libdir/$linklib"
2420
2489
              else
2421
2490
                add="$libdir/$linklib"
2495
2564
 
2496
2565
        if test "$linkmode" = lib; then
2497
2566
          if test -n "$dependency_libs" &&
2498
 
             { test "$hardcode_into_libs" != yes || test "$build_old_libs" = yes ||
 
2567
             { test "$hardcode_into_libs" != yes ||
 
2568
               test "$build_old_libs" = yes ||
2499
2569
               test "$link_static" = yes; }; then
2500
2570
            # Extract -R from dependency_libs
2501
2571
            temp_deplibs=
2552
2622
                  eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $deplib`
2553
2623
                  if test -z "$libdir"; then
2554
2624
                    $echo "$modename: \`$deplib' is not a valid libtool archive" 1>&2
2555
 
                    exit 1
 
2625
                    exit $EXIT_FAILURE
2556
2626
                  fi
2557
2627
                  if test "$absdir" != "$libdir"; then
2558
2628
                    $echo "$modename: warning: \`$deplib' seems to be moved" 1>&2
2562
2632
                depdepl=
2563
2633
                case $host in
2564
2634
                *-*-darwin*)
2565
 
                  # 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
2566
2637
                  eval deplibrary_names=`${SED} -n -e 's/^library_names=\(.*\)$/\1/p' $deplib`
2567
2638
                  if test -n "$deplibrary_names" ; then
2568
2639
                    for tmp in $deplibrary_names ; do
2570
2641
                    done
2571
2642
                    if test -f "$path/$depdepl" ; then
2572
2643
                      depdepl="$path/$depdepl"
2573
 
                   fi
2574
 
                    newlib_search_path="$newlib_search_path $path"
2575
 
                    path=""
 
2644
                    fi
 
2645
                    # do not add paths which are already there
 
2646
                    case " $newlib_search_path " in
 
2647
                    *" $path "*) ;;
 
2648
                    *) newlib_search_path="$newlib_search_path $path";;
 
2649
                    esac
2576
2650
                  fi
 
2651
                  path=""
2577
2652
                  ;;
2578
2653
                *)
2579
 
                path="-L$path"
2580
 
                ;;
2581
 
                esac 
2582
 
                
2583
 
                ;;
2584
 
                  -l*)
 
2654
                  path="-L$path"
 
2655
                  ;;
 
2656
                esac
 
2657
                ;;
 
2658
              -l*)
2585
2659
                case $host in
2586
2660
                *-*-darwin*)
2587
 
                 # Again, we only want to link against shared libraries
2588
 
                 eval tmp_libs=`$echo "X$deplib" | $Xsed -e "s,^\-l,,"`
2589
 
                 for tmp in $newlib_search_path ; do
2590
 
                     if test -f "$tmp/lib$tmp_libs.dylib" ; then
2591
 
                       eval depdepl="$tmp/lib$tmp_libs.dylib"
2592
 
                       break
2593
 
                     fi  
2594
 
         done
2595
 
         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=""
2596
2670
                  ;;
2597
2671
                *) continue ;;
2598
 
                esac              
 
2672
                esac
2599
2673
                ;;
2600
2674
              *) continue ;;
2601
2675
              esac
2602
2676
              case " $deplibs " in
2603
2677
              *" $depdepl "*) ;;
2604
 
              *) deplibs="$deplibs $depdepl" ;;
2605
 
              esac            
 
2678
              *) deplibs="$depdepl $deplibs" ;;
 
2679
              esac
2606
2680
              case " $deplibs " in
2607
2681
              *" $path "*) ;;
2608
2682
              *) deplibs="$deplibs $path" ;;
2692
2766
          eval $var=\"$tmp_libs\"
2693
2767
        done # for var
2694
2768
      fi
2695
 
      # 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)
2696
2771
      tmp_libs=
2697
2772
      for i in $dependency_libs ; do
2698
2773
        case " $predeps $postdeps $compiler_lib_search_path " in
2752
2827
      case $outputname in
2753
2828
      lib*)
2754
2829
        name=`$echo "X$outputname" | $Xsed -e 's/\.la$//' -e 's/^lib//'`
2755
 
        eval shared_ext=\"$shrext\"
 
2830
        eval shared_ext=\"$shrext_cmds\"
2756
2831
        eval libname=\"$libname_spec\"
2757
2832
        ;;
2758
2833
      *)
2759
2834
        if test "$module" = no; then
2760
2835
          $echo "$modename: libtool library \`$output' must begin with \`lib'" 1>&2
2761
2836
          $echo "$help" 1>&2
2762
 
          exit 1
 
2837
          exit $EXIT_FAILURE
2763
2838
        fi
2764
2839
        if test "$need_lib_prefix" != no; then
2765
2840
          # Add the "lib" prefix for modules if required
2766
2841
          name=`$echo "X$outputname" | $Xsed -e 's/\.la$//'`
2767
 
          eval shared_ext=\"$shrext\"
 
2842
          eval shared_ext=\"$shrext_cmds\"
2768
2843
          eval libname=\"$libname_spec\"
2769
2844
        else
2770
2845
          libname=`$echo "X$outputname" | $Xsed -e 's/\.la$//'`
2775
2850
      if test -n "$objs"; then
2776
2851
        if test "$deplibs_check_method" != pass_all; then
2777
2852
          $echo "$modename: cannot build libtool library \`$output' from non-libtool objects on this host:$objs" 2>&1
2778
 
          exit 1
 
2853
          exit $EXIT_FAILURE
2779
2854
        else
2780
2855
          $echo
2781
2856
          $echo "*** Warning: Linking the shared library $output against the non-libtool"
2823
2898
        if test -n "$8"; then
2824
2899
          $echo "$modename: too many parameters to \`-version-info'" 1>&2
2825
2900
          $echo "$help" 1>&2
2826
 
          exit 1
 
2901
          exit $EXIT_FAILURE
2827
2902
        fi
2828
2903
 
2829
2904
        # convert absolute version numbers to libtool ages
2830
2905
        # this retains compatibility with .la files and attempts
2831
2906
        # to make the code below a bit more comprehensible
2832
 
        
 
2907
 
2833
2908
        case $vinfo_number in
2834
2909
        yes)
2835
2910
          number_major="$2"
2869
2944
 
2870
2945
        # Check that each of the things are valid numbers.
2871
2946
        case $current in
2872
 
        [0-9]*) ;;
 
2947
        0 | [1-9] | [1-9][0-9] | [1-9][0-9][0-9]) ;;
2873
2948
        *)
2874
2949
          $echo "$modename: CURRENT \`$current' is not a nonnegative integer" 1>&2
2875
2950
          $echo "$modename: \`$vinfo' is not valid version information" 1>&2
2876
 
          exit 1
 
2951
          exit $EXIT_FAILURE
2877
2952
          ;;
2878
2953
        esac
2879
2954
 
2880
2955
        case $revision in
2881
 
        [0-9]*) ;;
 
2956
        0 | [1-9] | [1-9][0-9] | [1-9][0-9][0-9]) ;;
2882
2957
        *)
2883
2958
          $echo "$modename: REVISION \`$revision' is not a nonnegative integer" 1>&2
2884
2959
          $echo "$modename: \`$vinfo' is not valid version information" 1>&2
2885
 
          exit 1
 
2960
          exit $EXIT_FAILURE
2886
2961
          ;;
2887
2962
        esac
2888
2963
 
2889
2964
        case $age in
2890
 
        [0-9]*) ;;
 
2965
        0 | [1-9] | [1-9][0-9] | [1-9][0-9][0-9]) ;;
2891
2966
        *)
2892
2967
          $echo "$modename: AGE \`$age' is not a nonnegative integer" 1>&2
2893
2968
          $echo "$modename: \`$vinfo' is not valid version information" 1>&2
2894
 
          exit 1
 
2969
          exit $EXIT_FAILURE
2895
2970
          ;;
2896
2971
        esac
2897
2972
 
2898
2973
        if test "$age" -gt "$current"; then
2899
2974
          $echo "$modename: AGE \`$age' is greater than the current interface number \`$current'" 1>&2
2900
2975
          $echo "$modename: \`$vinfo' is not valid version information" 1>&2
2901
 
          exit 1
 
2976
          exit $EXIT_FAILURE
2902
2977
        fi
2903
2978
 
2904
2979
        # Calculate the version variables.
2987
3062
        *)
2988
3063
          $echo "$modename: unknown library version type \`$version_type'" 1>&2
2989
3064
          $echo "Fatal configuration error.  See the $PACKAGE docs for more information." 1>&2
2990
 
          exit 1
 
3065
          exit $EXIT_FAILURE
2991
3066
          ;;
2992
3067
        esac
2993
3068
 
3041
3116
            *.$objext)
3042
3117
               ;;
3043
3118
            $output_objdir/$outputname | $output_objdir/$libname.* | $output_objdir/${libname}${release}.*)
 
3119
               if test "X$precious_files_regex" != "X"; then
 
3120
                 if echo $p | $EGREP -e "$precious_files_regex" >/dev/null 2>&1
 
3121
                 then
 
3122
                   continue
 
3123
                 fi
 
3124
               fi
3044
3125
               removelist="$removelist $p"
3045
3126
               ;;
3046
3127
            *) ;;
3520
3601
        fi
3521
3602
 
3522
3603
        # Get the real and link names of the library.
3523
 
        eval shared_ext=\"$shrext\"
 
3604
        eval shared_ext=\"$shrext_cmds\"
3524
3605
        eval library_names=\"$library_names_spec\"
3525
3606
        set dummy $library_names
3526
3607
        realname="$2"
3550
3631
            $show "generating symbol list for \`$libname.la'"
3551
3632
            export_symbols="$output_objdir/$libname.exp"
3552
3633
            $run $rm $export_symbols
3553
 
            eval cmds=\"$export_symbols_cmds\"
 
3634
            cmds=$export_symbols_cmds
3554
3635
            save_ifs="$IFS"; IFS='~'
3555
3636
            for cmd in $cmds; do
3556
3637
              IFS="$save_ifs"
 
3638
              eval cmd=\"$cmd\"
3557
3639
              if len=`expr "X$cmd" : ".*"` &&
3558
3640
               test "$len" -le "$max_cmd_len" || test "$max_cmd_len" -le -1; then
3559
3641
                $show "$cmd"
3583
3665
        for test_deplib in $deplibs; do
3584
3666
                case " $convenience " in
3585
3667
                *" $test_deplib "*) ;;
3586
 
                *) 
 
3668
                *)
3587
3669
                        tmp_deplibs="$tmp_deplibs $test_deplib"
3588
3670
                        ;;
3589
3671
                esac
3590
3672
        done
3591
 
        deplibs="$tmp_deplibs" 
 
3673
        deplibs="$tmp_deplibs"
3592
3674
 
3593
3675
        if test -n "$convenience"; then
3594
3676
          if test -n "$whole_archive_flag_spec"; then
3670
3752
        # Do each of the archive commands.
3671
3753
        if test "$module" = yes && test -n "$module_cmds" ; then
3672
3754
          if test -n "$export_symbols" && test -n "$module_expsym_cmds"; then
3673
 
            eval cmds=\"$module_expsym_cmds\"
 
3755
            eval test_cmds=\"$module_expsym_cmds\"
 
3756
            cmds=$module_expsym_cmds
3674
3757
          else
3675
 
            eval cmds=\"$module_cmds\"
 
3758
            eval test_cmds=\"$module_cmds\"
 
3759
            cmds=$module_cmds
3676
3760
          fi
3677
3761
        else
3678
3762
        if test -n "$export_symbols" && test -n "$archive_expsym_cmds"; then
3679
 
          eval cmds=\"$archive_expsym_cmds\"
 
3763
          eval test_cmds=\"$archive_expsym_cmds\"
 
3764
          cmds=$archive_expsym_cmds
3680
3765
        else
3681
 
          eval cmds=\"$archive_cmds\"
 
3766
          eval test_cmds=\"$archive_cmds\"
 
3767
          cmds=$archive_cmds
3682
3768
          fi
3683
3769
        fi
3684
3770
 
3685
 
        if test "X$skipped_export" != "X:" && len=`expr "X$cmds" : ".*"` &&
 
3771
        if test "X$skipped_export" != "X:" && len=`expr "X$test_cmds" : ".*"` &&
3686
3772
           test "$len" -le "$max_cmd_len" || test "$max_cmd_len" -le -1; then
3687
3773
          :
3688
3774
        else
3783
3869
          # value of $libobjs for piecewise linking.
3784
3870
 
3785
3871
          # Do each of the archive commands.
 
3872
          if test "$module" = yes && test -n "$module_cmds" ; then
 
3873
            if test -n "$export_symbols" && test -n "$module_expsym_cmds"; then
 
3874
              cmds=$module_expsym_cmds
 
3875
            else
 
3876
              cmds=$module_cmds
 
3877
            fi
 
3878
          else
3786
3879
          if test -n "$export_symbols" && test -n "$archive_expsym_cmds"; then
3787
 
            eval cmds=\"$archive_expsym_cmds\"
 
3880
            cmds=$archive_expsym_cmds
3788
3881
          else
3789
 
            eval cmds=\"$archive_cmds\"
 
3882
            cmds=$archive_cmds
 
3883
            fi
3790
3884
          fi
3791
3885
 
3792
3886
          # Append the command to remove the reloadable object files
3793
3887
          # to the just-reset $cmds.
3794
 
          eval cmds=\"\$cmds~$rm $delfiles\"
 
3888
          eval cmds=\"\$cmds~\$rm $delfiles\"
3795
3889
        fi
3796
3890
        save_ifs="$IFS"; IFS='~'
3797
3891
        for cmd in $cmds; do
3798
3892
          IFS="$save_ifs"
 
3893
          eval cmd=\"$cmd\"
3799
3894
          $show "$cmd"
3800
3895
          $run eval "$cmd" || exit $?
3801
3896
        done
3804
3899
        # Restore the uninstalled library and exit
3805
3900
        if test "$mode" = relink; then
3806
3901
          $run eval '(cd $output_objdir && $rm ${realname}T && $mv $realname ${realname}T && $mv "$realname"U $realname)' || exit $?
3807
 
          exit 0
 
3902
          exit $EXIT_SUCCESS
3808
3903
        fi
3809
3904
 
3810
3905
        # Create links to the real library.
3852
3947
      *.lo)
3853
3948
        if test -n "$objs$old_deplibs"; then
3854
3949
          $echo "$modename: cannot build library object \`$output' from non-libtool objects" 1>&2
3855
 
          exit 1
 
3950
          exit $EXIT_FAILURE
3856
3951
        fi
3857
3952
        libobj="$output"
3858
3953
        obj=`$echo "X$output" | $Xsed -e "$lo2o"`
3946
4041
      reload_objs="$objs$old_deplibs "`$echo "X$libobjs" | $SP2NL | $Xsed -e '/\.'${libext}$'/d' -e '/\.lib$/d' -e "$lo2o" | $NL2SP`" $reload_conv_objs" ### testsuite: skip nested quoting test
3947
4042
 
3948
4043
      output="$obj"
3949
 
      eval cmds=\"$reload_cmds\"
 
4044
      cmds=$reload_cmds
3950
4045
      save_ifs="$IFS"; IFS='~'
3951
4046
      for cmd in $cmds; do
3952
4047
        IFS="$save_ifs"
 
4048
        eval cmd=\"$cmd\"
3953
4049
        $show "$cmd"
3954
4050
        $run eval "$cmd" || exit $?
3955
4051
      done
3962
4058
          $run ${rm}r $gentop
3963
4059
        fi
3964
4060
 
3965
 
        exit 0
 
4061
        exit $EXIT_SUCCESS
3966
4062
      fi
3967
4063
 
3968
4064
      if test "$build_libtool_libs" != yes; then
3975
4071
        # accidentally link it into a program.
3976
4072
        # $show "echo timestamp > $libobj"
3977
4073
        # $run eval "echo timestamp > $libobj" || exit $?
3978
 
        exit 0
 
4074
        exit $EXIT_SUCCESS
3979
4075
      fi
3980
4076
 
3981
4077
      if test -n "$pic_flag" || test "$pic_mode" != default; then
3982
4078
        # Only do commands if we really have different PIC objects.
3983
4079
        reload_objs="$libobjs $reload_conv_objs"
3984
4080
        output="$libobj"
3985
 
        eval cmds=\"$reload_cmds\"
 
4081
        cmds=$reload_cmds
3986
4082
        save_ifs="$IFS"; IFS='~'
3987
4083
        for cmd in $cmds; do
3988
4084
          IFS="$save_ifs"
 
4085
          eval cmd=\"$cmd\"
3989
4086
          $show "$cmd"
3990
4087
          $run eval "$cmd" || exit $?
3991
4088
        done
3997
4094
        $run ${rm}r $gentop
3998
4095
      fi
3999
4096
 
4000
 
      exit 0
 
4097
      exit $EXIT_SUCCESS
4001
4098
      ;;
4002
4099
 
4003
4100
    prog)
4315
4412
          ;;
4316
4413
        *)
4317
4414
          $echo "$modename: unknown suffix for \`$dlsyms'" 1>&2
4318
 
          exit 1
 
4415
          exit $EXIT_FAILURE
4319
4416
          ;;
4320
4417
        esac
4321
4418
      else
4403
4500
        # Link the executable and exit
4404
4501
        $show "$link_command"
4405
4502
        $run eval "$link_command" || exit $?
4406
 
        exit 0
 
4503
        exit $EXIT_SUCCESS
4407
4504
      fi
4408
4505
 
4409
4506
      if test "$hardcode_action" = relink; then
4458
4555
      fi
4459
4556
 
4460
4557
      # Quote $echo for shipping.
4461
 
      if test "X$echo" = "X$SHELL $0 --fallback-echo"; then
4462
 
        case $0 in
4463
 
        [\\/]* | [A-Za-z]:[\\/]*) qecho="$SHELL $0 --fallback-echo";;
4464
 
        *) qecho="$SHELL `pwd`/$0 --fallback-echo";;
 
4558
      if test "X$echo" = "X$SHELL $progpath --fallback-echo"; then
 
4559
        case $progpath in
 
4560
        [\\/]* | [A-Za-z]:[\\/]*) qecho="$SHELL $progpath --fallback-echo";;
 
4561
        *) qecho="$SHELL `pwd`/$progpath --fallback-echo";;
4465
4562
        esac
4466
4563
        qecho=`$echo "X$qecho" | $Xsed -e "$sed_quote_subst"`
4467
4564
      else
4487
4584
            cwrappersource=`$echo ${objdir}/lt-${output}.c`
4488
4585
            cwrapper=`$echo ${output}.exe`
4489
4586
            $rm $cwrappersource $cwrapper
4490
 
            trap "$rm $cwrappersource $cwrapper; exit 1" 1 2 15
 
4587
            trap "$rm $cwrappersource $cwrapper; exit $EXIT_FAILURE" 1 2 15
4491
4588
 
4492
4589
            cat > $cwrappersource <<EOF
4493
4590
 
4496
4593
 
4497
4594
   The $output program cannot be directly executed until all the libtool
4498
4595
   libraries that it depends on are installed.
4499
 
   
 
4596
 
4500
4597
   This wrapper executable should never be moved out of the build directory.
4501
4598
   If it is, it will not operate correctly.
4502
4599
 
4528
4625
#if defined (_WIN32) || defined (__MSDOS__) || defined (__DJGPP__) || \
4529
4626
  defined (__OS2__)
4530
4627
#define HAVE_DOS_BASED_FILE_SYSTEM
4531
 
#ifndef DIR_SEPARATOR_2 
 
4628
#ifndef DIR_SEPARATOR_2
4532
4629
#define DIR_SEPARATOR_2 '\\'
4533
4630
#endif
4534
4631
#endif
4559
4656
{
4560
4657
  char **newargz;
4561
4658
  int i;
4562
 
  
 
4659
 
4563
4660
  program_name = (char *) xstrdup ((char *) basename (argv[0]));
4564
4661
  newargz = XMALLOC(char *, argc+2);
4565
4662
EOF
4572
4669
  newargz[1] = fnqualify(argv[0]);
4573
4670
  /* we know the script has the same name, without the .exe */
4574
4671
  /* so make sure newargz[1] doesn't end in .exe */
4575
 
  strendzap(newargz[1],".exe"); 
 
4672
  strendzap(newargz[1],".exe");
4576
4673
  for (i = 1; i < argc; i++)
4577
4674
    newargz[i+1] = xstrdup(argv[i]);
4578
4675
  newargz[argc+1] = NULL;
4595
4692
  return p;
4596
4693
}
4597
4694
 
4598
 
char * 
 
4695
char *
4599
4696
xstrdup (const char *string)
4600
4697
{
4601
4698
  return string ? strcpy ((char *) xmalloc (strlen (string) + 1), string) : NULL
4609
4706
 
4610
4707
#if defined (HAVE_DOS_BASED_FILE_SYSTEM)
4611
4708
  /* Skip over the disk name in MSDOS pathnames. */
4612
 
  if (isalpha (name[0]) && name[1] == ':') 
 
4709
  if (isalpha (name[0]) && name[1] == ':')
4613
4710
    name += 2;
4614
4711
#endif
4615
4712
 
4619
4716
  return (char *) base;
4620
4717
}
4621
4718
 
4622
 
char * 
 
4719
char *
4623
4720
fnqualify(const char *path)
4624
4721
{
4625
4722
  size_t size;
4647
4744
}
4648
4745
 
4649
4746
char *
4650
 
strendzap(char *str, const char *pat) 
 
4747
strendzap(char *str, const char *pat)
4651
4748
{
4652
4749
  size_t len, patlen;
4653
4750
 
4667
4764
}
4668
4765
 
4669
4766
static void
4670
 
lt_error_core (int exit_status, const char * mode, 
 
4767
lt_error_core (int exit_status, const char * mode,
4671
4768
          const char * message, va_list ap)
4672
4769
{
4673
4770
  fprintf (stderr, "%s: %s: ", program_name, mode);
4696
4793
          ;;
4697
4794
        esac
4698
4795
        $rm $output
4699
 
        trap "$rm $output; exit 1" 1 2 15
 
4796
        trap "$rm $output; exit $EXIT_FAILURE" 1 2 15
4700
4797
 
4701
4798
        $echo > $output "\
4702
4799
#! $SHELL
4796
4893
      else
4797
4894
        $echo \"\$relink_command_output\" >&2
4798
4895
        $rm \"\$progdir/\$file\"
4799
 
        exit 1
 
4896
        exit $EXIT_FAILURE
4800
4897
      fi
4801
4898
    fi
4802
4899
 
4858
4955
        esac
4859
4956
        $echo >> $output "\
4860
4957
      \$echo \"\$0: cannot exec \$program \${1+\"\$@\"}\"
4861
 
      exit 1
 
4958
      exit $EXIT_FAILURE
4862
4959
    fi
4863
4960
  else
4864
4961
    # The program doesn't exist.
4865
4962
    \$echo \"\$0: error: \$progdir/\$program does not exist\" 1>&2
4866
4963
    \$echo \"This script is just a wrapper for \$program.\" 1>&2
4867
4964
    $echo \"See the $PACKAGE documentation for more information.\" 1>&2
4868
 
    exit 1
 
4965
    exit $EXIT_FAILURE
4869
4966
  fi
4870
4967
fi\
4871
4968
"
4872
4969
        chmod +x $output
4873
4970
      fi
4874
 
      exit 0
 
4971
      exit $EXIT_SUCCESS
4875
4972
      ;;
4876
4973
    esac
4877
4974
 
4957
5054
 
4958
5055
      # Do each command in the archive commands.
4959
5056
      if test -n "$old_archive_from_new_cmds" && test "$build_libtool_libs" = yes; then
4960
 
        eval cmds=\"$old_archive_from_new_cmds\"
 
5057
       cmds=$old_archive_from_new_cmds
4961
5058
      else
4962
5059
        eval cmds=\"$old_archive_cmds\"
4963
5060
 
4964
5061
        if len=`expr "X$cmds" : ".*"` &&
4965
5062
             test "$len" -le "$max_cmd_len" || test "$max_cmd_len" -le -1; then
4966
 
          :
 
5063
          cmds=$old_archive_cmds
4967
5064
        else
4968
5065
          # the command line is too long to link in one step, link in parts
4969
5066
          $echo "using piecewise archive linking..."
4990
5087
          for obj in $save_oldobjs
4991
5088
          do
4992
5089
            last_oldobj=$obj
4993
 
          done  
 
5090
          done
4994
5091
          for obj in $save_oldobjs
4995
5092
          do
4996
5093
            oldobjs="$objlist $obj"
5004
5101
              oldobjs=$objlist
5005
5102
              if test "$obj" = "$last_oldobj" ; then
5006
5103
                RANLIB=$save_RANLIB
5007
 
              fi  
 
5104
              fi
5008
5105
              test -z "$concat_cmds" || concat_cmds=$concat_cmds~
5009
5106
              eval concat_cmds=\"\${concat_cmds}$old_archive_cmds\"
5010
5107
              objlist=
5015
5112
          if test "X$oldobjs" = "X" ; then
5016
5113
            eval cmds=\"\$concat_cmds\"
5017
5114
          else
5018
 
            eval cmds=\"\$concat_cmds~$old_archive_cmds\"
 
5115
            eval cmds=\"\$concat_cmds~\$old_archive_cmds\"
5019
5116
          fi
5020
5117
        fi
5021
5118
      fi
5022
5119
      save_ifs="$IFS"; IFS='~'
5023
5120
      for cmd in $cmds; do
 
5121
        eval cmd=\"$cmd\"
5024
5122
        IFS="$save_ifs"
5025
5123
        $show "$cmd"
5026
5124
        $run eval "$cmd" || exit $?
5052
5150
        fi
5053
5151
      done
5054
5152
      # Quote the link command for shipping.
5055
 
      relink_command="(cd `pwd`; $SHELL $0 --mode=relink $libtool_args @inst_prefix_dir@)"
 
5153
      relink_command="(cd `pwd`; $SHELL $progpath $preserve_args --mode=relink $libtool_args @inst_prefix_dir@)"
5056
5154
      relink_command=`$echo "X$relink_command" | $Xsed -e "$sed_quote_subst"`
 
5155
      if test "$hardcode_automatic" = yes ; then
 
5156
        relink_command=
 
5157
      fi
 
5158
 
5057
5159
 
5058
5160
      # Only create the output if not a dry run.
5059
5161
      if test -z "$run"; then
5072
5174
                eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $deplib`
5073
5175
                if test -z "$libdir"; then
5074
5176
                  $echo "$modename: \`$deplib' is not a valid libtool archive" 1>&2
5075
 
                  exit 1
 
5177
                  exit $EXIT_FAILURE
5076
5178
                fi
5077
5179
                newdependency_libs="$newdependency_libs $libdir/$name"
5078
5180
                ;;
5086
5188
              eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $lib`
5087
5189
              if test -z "$libdir"; then
5088
5190
                $echo "$modename: \`$lib' is not a valid libtool archive" 1>&2
5089
 
                exit 1
 
5191
                exit $EXIT_FAILURE
5090
5192
              fi
5091
5193
              newdlfiles="$newdlfiles $libdir/$name"
5092
5194
            done
5097
5199
              eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $lib`
5098
5200
              if test -z "$libdir"; then
5099
5201
                $echo "$modename: \`$lib' is not a valid libtool archive" 1>&2
5100
 
                exit 1
 
5202
                exit $EXIT_FAILURE
5101
5203
              fi
5102
5204
              newdlprefiles="$newdlprefiles $libdir/$name"
5103
5205
            done
5104
5206
            dlprefiles="$newdlprefiles"
 
5207
          else
 
5208
            newdlfiles=
 
5209
            for lib in $dlfiles; do
 
5210
              case $lib in
 
5211
                [\\/]* | [A-Za-z]:[\\/]*) abs="$lib" ;;
 
5212
                *) abs=`pwd`"/$lib" ;;
 
5213
              esac
 
5214
              newdlfiles="$newdlfiles $abs"
 
5215
            done
 
5216
            dlfiles="$newdlfiles"
 
5217
            newdlprefiles=
 
5218
            for lib in $dlprefiles; do
 
5219
              case $lib in
 
5220
                [\\/]* | [A-Za-z]:[\\/]*) abs="$lib" ;;
 
5221
                *) abs=`pwd`"/$lib" ;;
 
5222
              esac
 
5223
              newdlprefiles="$newdlprefiles $abs"
 
5224
            done
 
5225
            dlprefiles="$newdlprefiles"
5105
5226
          fi
5106
5227
          $rm $output
5107
5228
          # place dlname in correct position for cygwin
5158
5279
      $run eval '(cd $output_objdir && $rm $outputname && $LN_S ../$outputname $outputname)' || exit $?
5159
5280
      ;;
5160
5281
    esac
5161
 
    exit 0
 
5282
    exit $EXIT_SUCCESS
5162
5283
    ;;
5163
5284
 
5164
5285
  # libtool install mode
5247
5368
    if test -z "$install_prog"; then
5248
5369
      $echo "$modename: you must specify an install program" 1>&2
5249
5370
      $echo "$help" 1>&2
5250
 
      exit 1
 
5371
      exit $EXIT_FAILURE
5251
5372
    fi
5252
5373
 
5253
5374
    if test -n "$prev"; then
5254
5375
      $echo "$modename: the \`$prev' option requires an argument" 1>&2
5255
5376
      $echo "$help" 1>&2
5256
 
      exit 1
 
5377
      exit $EXIT_FAILURE
5257
5378
    fi
5258
5379
 
5259
5380
    if test -z "$files"; then
5263
5384
        $echo "$modename: you must specify a destination" 1>&2
5264
5385
      fi
5265
5386
      $echo "$help" 1>&2
5266
 
      exit 1
 
5387
      exit $EXIT_FAILURE
5267
5388
    fi
5268
5389
 
5269
5390
    # Strip any trailing slash from the destination.
5284
5405
      if test "$#" -gt 2; then
5285
5406
        $echo "$modename: \`$dest' is not a directory" 1>&2
5286
5407
        $echo "$help" 1>&2
5287
 
        exit 1
 
5408
        exit $EXIT_FAILURE
5288
5409
      fi
5289
5410
    fi
5290
5411
    case $destdir in
5296
5417
        *)
5297
5418
          $echo "$modename: \`$destdir' must be an absolute directory name" 1>&2
5298
5419
          $echo "$help" 1>&2
5299
 
          exit 1
 
5420
          exit $EXIT_FAILURE
5300
5421
          ;;
5301
5422
        esac
5302
5423
      done
5325
5446
        else
5326
5447
          $echo "$modename: \`$file' is not a valid libtool archive" 1>&2
5327
5448
          $echo "$help" 1>&2
5328
 
          exit 1
 
5449
          exit $EXIT_FAILURE
5329
5450
        fi
5330
5451
 
5331
5452
        library_names=
5367
5488
          # but it's something to keep an eye on.
5368
5489
          if test "$inst_prefix_dir" = "$destdir"; then
5369
5490
            $echo "$modename: error: cannot install \`$file' to a directory not ending in $libdir" 1>&2
5370
 
            exit 1
 
5491
            exit $EXIT_FAILURE
5371
5492
          fi
5372
5493
 
5373
5494
          if test -n "$inst_prefix_dir"; then
5382
5503
          if $run eval "$relink_command"; then :
5383
5504
          else
5384
5505
            $echo "$modename: error: relink \`$file' with the above command before installing it" 1>&2
5385
 
            exit 1
 
5506
            exit $EXIT_FAILURE
5386
5507
          fi
5387
5508
        fi
5388
5509
 
5417
5538
 
5418
5539
          # Do each command in the postinstall commands.
5419
5540
          lib="$destdir/$realname"
5420
 
          eval cmds=\"$postinstall_cmds\"
 
5541
          cmds=$postinstall_cmds
5421
5542
          save_ifs="$IFS"; IFS='~'
5422
5543
          for cmd in $cmds; do
5423
5544
            IFS="$save_ifs"
 
5545
            eval cmd=\"$cmd\"
5424
5546
            $show "$cmd"
5425
5547
            $run eval "$cmd" || exit $?
5426
5548
          done
5460
5582
        *)
5461
5583
          $echo "$modename: cannot copy a libtool object to \`$destfile'" 1>&2
5462
5584
          $echo "$help" 1>&2
5463
 
          exit 1
 
5585
          exit $EXIT_FAILURE
5464
5586
          ;;
5465
5587
        esac
5466
5588
 
5478
5600
          $show "$install_prog $staticobj $staticdest"
5479
5601
          $run eval "$install_prog \$staticobj \$staticdest" || exit $?
5480
5602
        fi
5481
 
        exit 0
 
5603
        exit $EXIT_SUCCESS
5482
5604
        ;;
5483
5605
 
5484
5606
      *)
5532
5654
          # Check the variables that should have been set.
5533
5655
          if test -z "$notinst_deplibs"; then
5534
5656
            $echo "$modename: invalid libtool wrapper script \`$wrapper'" 1>&2
5535
 
            exit 1
 
5657
            exit $EXIT_FAILURE
5536
5658
          fi
5537
5659
 
5538
5660
          finalize=yes
5572
5694
            if test "$finalize" = yes && test -z "$run"; then
5573
5695
              tmpdir="/tmp"
5574
5696
              test -n "$TMPDIR" && tmpdir="$TMPDIR"
5575
 
              tmpdir_mktemp=`mktemp -d $tmpdir/libtool-XXXXXX 2> /dev/null`
5576
 
              if test "$?" = 0 ; then
5577
 
                tmpdir="$tmpdir_mktemp"
5578
 
                unset tmpdir_mktemp
5579
 
               else
5580
 
                tmpdir="$tmpdir/libtool-$$"
5581
 
              fi
5582
 
              if $mkdir -p "$tmpdir" && chmod 700 "$tmpdir"; then :
 
5697
              tmpdir="$tmpdir/libtool-$$"
 
5698
              save_umask=`umask`
 
5699
              umask 0077
 
5700
              if $mkdir "$tmpdir"; then
 
5701
                umask $save_umask
5583
5702
              else
 
5703
                umask $save_umask
5584
5704
                $echo "$modename: error: cannot create temporary directory \`$tmpdir'" 1>&2
5585
5705
                continue
5586
5706
              fi
5639
5759
      $show "$install_prog $file $oldlib"
5640
5760
      $run eval "$install_prog \$file \$oldlib" || exit $?
5641
5761
 
5642
 
      if test -n "$stripme" && test -n "$striplib"; then
 
5762
      if test -n "$stripme" && test -n "$old_striplib"; then
5643
5763
        $show "$old_striplib $oldlib"
5644
5764
        $run eval "$old_striplib $oldlib" || exit $?
5645
5765
      fi
5646
5766
 
5647
5767
      # Do each command in the postinstall commands.
5648
 
      eval cmds=\"$old_postinstall_cmds\"
 
5768
      cmds=$old_postinstall_cmds
5649
5769
      save_ifs="$IFS"; IFS='~'
5650
5770
      for cmd in $cmds; do
5651
5771
        IFS="$save_ifs"
 
5772
        eval cmd=\"$cmd\"
5652
5773
        $show "$cmd"
5653
5774
        $run eval "$cmd" || exit $?
5654
5775
      done
5662
5783
    if test -n "$current_libdirs"; then
5663
5784
      # Maybe just do a dry run.
5664
5785
      test -n "$run" && current_libdirs=" -n$current_libdirs"
5665
 
      exec_cmd='$SHELL $0 --finish$current_libdirs'
 
5786
      exec_cmd='$SHELL $progpath $preserve_args --finish$current_libdirs'
5666
5787
    else
5667
 
      exit 0
 
5788
      exit $EXIT_SUCCESS
5668
5789
    fi
5669
5790
    ;;
5670
5791
 
5683
5804
      for libdir in $libdirs; do
5684
5805
        if test -n "$finish_cmds"; then
5685
5806
          # Do each command in the finish commands.
5686
 
          eval cmds=\"$finish_cmds\"
 
5807
          cmds=$finish_cmds
5687
5808
          save_ifs="$IFS"; IFS='~'
5688
5809
          for cmd in $cmds; do
5689
5810
            IFS="$save_ifs"
 
5811
            eval cmd=\"$cmd\"
5690
5812
            $show "$cmd"
5691
5813
            $run eval "$cmd" || admincmds="$admincmds
5692
5814
       $cmd"
5703
5825
    fi
5704
5826
 
5705
5827
    # Exit here if they wanted silent mode.
5706
 
    test "$show" = : && exit 0
 
5828
    test "$show" = : && exit $EXIT_SUCCESS
5707
5829
 
5708
5830
    $echo "----------------------------------------------------------------------"
5709
5831
    $echo "Libraries have been installed in:"
5739
5861
    $echo "See any operating system documentation about shared libraries for"
5740
5862
    $echo "more information, such as the ld(1) and ld.so(8) manual pages."
5741
5863
    $echo "----------------------------------------------------------------------"
5742
 
    exit 0
 
5864
    exit $EXIT_SUCCESS
5743
5865
    ;;
5744
5866
 
5745
5867
  # libtool execute mode
5751
5873
    if test -z "$cmd"; then
5752
5874
      $echo "$modename: you must specify a COMMAND" 1>&2
5753
5875
      $echo "$help"
5754
 
      exit 1
 
5876
      exit $EXIT_FAILURE
5755
5877
    fi
5756
5878
 
5757
5879
    # Handle -dlopen flags immediately.
5759
5881
      if test ! -f "$file"; then
5760
5882
        $echo "$modename: \`$file' is not a file" 1>&2
5761
5883
        $echo "$help" 1>&2
5762
 
        exit 1
 
5884
        exit $EXIT_FAILURE
5763
5885
      fi
5764
5886
 
5765
5887
      dir=
5770
5892
        else
5771
5893
          $echo "$modename: \`$lib' is not a valid libtool archive" 1>&2
5772
5894
          $echo "$help" 1>&2
5773
 
          exit 1
 
5895
          exit $EXIT_FAILURE
5774
5896
        fi
5775
5897
 
5776
5898
        # Read the libtool library.
5797
5919
          dir="$dir/$objdir"
5798
5920
        else
5799
5921
          $echo "$modename: cannot find \`$dlname' in \`$dir' or \`$dir/$objdir'" 1>&2
5800
 
          exit 1
 
5922
          exit $EXIT_FAILURE
5801
5923
        fi
5802
5924
        ;;
5803
5925
 
5877
5999
        $echo "export $shlibpath_var"
5878
6000
      fi
5879
6001
      $echo "$cmd$args"
5880
 
      exit 0
 
6002
      exit $EXIT_SUCCESS
5881
6003
    fi
5882
6004
    ;;
5883
6005
 
5905
6027
    if test -z "$rm"; then
5906
6028
      $echo "$modename: you must specify an RM program" 1>&2
5907
6029
      $echo "$help" 1>&2
5908
 
      exit 1
 
6030
      exit $EXIT_FAILURE
5909
6031
    fi
5910
6032
 
5911
6033
    rmdirs=
5960
6082
          if test "$mode" = uninstall; then
5961
6083
            if test -n "$library_names"; then
5962
6084
              # Do each command in the postuninstall commands.
5963
 
              eval cmds=\"$postuninstall_cmds\"
 
6085
              cmds=$postuninstall_cmds
5964
6086
              save_ifs="$IFS"; IFS='~'
5965
6087
              for cmd in $cmds; do
5966
6088
                IFS="$save_ifs"
 
6089
                eval cmd=\"$cmd\"
5967
6090
                $show "$cmd"
5968
6091
                $run eval "$cmd"
5969
6092
                if test "$?" -ne 0 && test "$rmforce" != yes; then
5975
6098
 
5976
6099
            if test -n "$old_library"; then
5977
6100
              # Do each command in the old_postuninstall commands.
5978
 
              eval cmds=\"$old_postuninstall_cmds\"
 
6101
              cmds=$old_postuninstall_cmds
5979
6102
              save_ifs="$IFS"; IFS='~'
5980
6103
              for cmd in $cmds; do
5981
6104
                IFS="$save_ifs"
 
6105
                eval cmd=\"$cmd\"
5982
6106
                $show "$cmd"
5983
6107
                $run eval "$cmd"
5984
6108
                if test "$?" -ne 0 && test "$rmforce" != yes; then
6017
6141
        if test "$mode" = clean ; then
6018
6142
          noexename=$name
6019
6143
          case $file in
6020
 
          *.exe) 
 
6144
          *.exe)
6021
6145
            file=`$echo $file|${SED} 's,.exe$,,'`
6022
6146
            noexename=`$echo $name|${SED} 's,.exe$,,'`
6023
6147
            # $file with .exe has already been added to rmfiles,
6062
6186
  "")
6063
6187
    $echo "$modename: you must specify a MODE" 1>&2
6064
6188
    $echo "$generic_help" 1>&2
6065
 
    exit 1
 
6189
    exit $EXIT_FAILURE
6066
6190
    ;;
6067
6191
  esac
6068
6192
 
6069
6193
  if test -z "$exec_cmd"; then
6070
6194
    $echo "$modename: invalid operation mode \`$mode'" 1>&2
6071
6195
    $echo "$generic_help" 1>&2
6072
 
    exit 1
 
6196
    exit $EXIT_FAILURE
6073
6197
  fi
6074
6198
fi # test -z "$show_help"
6075
6199
 
6076
6200
if test -n "$exec_cmd"; then
6077
6201
  eval exec $exec_cmd
6078
 
  exit 1
 
6202
  exit $EXIT_FAILURE
6079
6203
fi
6080
6204
 
6081
6205
# We need to display help for each of the modes.
6111
6235
a more detailed description of MODE.
6112
6236
 
6113
6237
Report bugs to <bug-libtool@gnu.org>."
6114
 
  exit 0
 
6238
  exit $EXIT_SUCCESS
6115
6239
  ;;
6116
6240
 
6117
6241
clean)
6223
6347
  -no-undefined     declare that a library does not refer to external symbols
6224
6348
  -o OUTPUT-FILE    create OUTPUT-FILE from the specified objects
6225
6349
  -objectlist FILE  Use a list of object files found in FILE to specify objects
 
6350
  -precious-files-regex REGEX
 
6351
                    don't remove output files matching REGEX
6226
6352
  -release RELEASE  specify package release information
6227
6353
  -rpath LIBDIR     the created library will eventually be installed in LIBDIR
6228
6354
  -R[ ]LIBDIR       add LIBDIR to the runtime path of programs and libraries
6264
6390
*)
6265
6391
  $echo "$modename: invalid operation mode \`$mode'" 1>&2
6266
6392
  $echo "$help" 1>&2
6267
 
  exit 1
 
6393
  exit $EXIT_FAILURE
6268
6394
  ;;
6269
6395
esac
6270
6396
 
6271
6397
$echo
6272
6398
$echo "Try \`$modename --help' for more information about other modes."
6273
6399
 
6274
 
exit 0
 
6400
exit $EXIT_SUCCESS
6275
6401
 
6276
6402
# The TAGs below are defined such that we never get into a situation
6277
6403
# in which we disable both kinds of libraries.  Given conflicting