~ubuntu-branches/ubuntu/gutsy/libnss-mysql-bg/gutsy

« back to all changes in this revision

Viewing changes to aux/ltmain.sh

  • Committer: Bazaar Package Importer
  • Author(s): Emmanuel Lacour
  • Date: 2006-02-12 21:03:46 UTC
  • mfrom: (3.1.1 etch)
  • Revision ID: james.westby@ubuntu.com-20060212210346-yalbtma8s4905101
Tags: 1.5-1
* New upstream release
* debian/control: built with libmysqlclient15-dev (closes: #343773)
* debian/control: typo (closes: #300017)

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
# RH: define SED for historic ltconfig's generated by Libtool 1.3
 
37
[ -z "$SED" ] && SED=sed
 
38
 
 
39
# The name of this program:
 
40
progname=`echo "$progpath" | $SED $basename`
 
41
modename="$progname"
 
42
 
 
43
# Global variables:
 
44
EXIT_SUCCESS=0
 
45
EXIT_FAILURE=1
 
46
 
 
47
PROGRAM=ltmain.sh
 
48
PACKAGE=libtool
 
49
VERSION=1.5.6
 
50
TIMESTAMP=" (1.1220.2.95 2004/04/11 05:50:42)"
 
51
 
 
52
 
27
53
# Check that we have a working $echo.
28
54
if test "X$1" = X--no-reexec; then
29
55
  # Discard the --no-reexec flag, and continue.
36
62
  :
37
63
else
38
64
  # Restart under the correct shell, and then maybe $echo will work.
39
 
  exec $SHELL "$0" --no-reexec ${1+"$@"}
 
65
  exec $SHELL "$progpath" --no-reexec ${1+"$@"}
40
66
fi
41
67
 
42
68
if test "X$1" = X--fallback-echo; then
45
71
  cat <<EOF
46
72
$*
47
73
EOF
48
 
  exit 0
 
74
  exit $EXIT_SUCCESS
49
75
fi
50
76
 
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.2
59
 
TIMESTAMP=" (1.1220.2.60 2004/01/25 12:25:08)"
60
 
 
61
77
default_mode=
62
78
help="Try \`$progname --help' for more information."
63
79
magic="%%%MAGIC variable%%%"
100
116
if test "$build_libtool_libs" != yes && test "$build_old_libs" != yes; then
101
117
  $echo "$modename: not configured to build any kind of library" 1>&2
102
118
  $echo "Fatal configuration error.  See the $PACKAGE docs for more information." 1>&2
103
 
  exit 1
 
119
  exit $EXIT_FAILURE
104
120
fi
105
121
 
106
122
# Global variables.
119
135
# Shell function definitions:
120
136
# This seems to be the best place for them
121
137
 
 
138
# func_win32_libid arg
 
139
# return the library type of file 'arg'
 
140
#
122
141
# Need a lot of goo to handle *both* DLLs and import libs
123
142
# Has to be a shell function in order to 'eat' the argument
124
143
# that is supplied when $file_magic_command is called.
125
 
win32_libid () {
 
144
func_win32_libid () {
126
145
  win32_libid_type="unknown"
127
146
  win32_fileres=`file -L $1 2>/dev/null`
128
147
  case $win32_fileres in
131
150
    ;;
132
151
  *ar\ archive*) # could be an import, or static
133
152
    if eval $OBJDUMP -f $1 | $SED -e '10q' 2>/dev/null | \
134
 
      grep -E 'file format pe-i386(.*architecture: i386)?' >/dev/null ; then
 
153
      $EGREP -e 'file format pe-i386(.*architecture: i386)?' >/dev/null ; then
135
154
      win32_nmres=`eval $NM -f posix -A $1 | \
136
155
        sed -n -e '1,100{/ I /{x;/import/!{s/^/import/;h;p;};x;};}'`
137
156
      if test "X$win32_nmres" = "Ximport" ; then
141
160
      fi
142
161
    fi
143
162
    ;;
144
 
  *DLL*) 
 
163
  *DLL*)
145
164
    win32_libid_type="x86 DLL"
146
165
    ;;
147
166
  *executable*) # but shell scripts are "executable" too...
155
174
  $echo $win32_libid_type
156
175
}
157
176
 
 
177
 
 
178
# func_infer_tag arg
 
179
# Infer tagged configuration to use if any are available and
 
180
# if one wasn't chosen via the "--tag" command line option.
 
181
# Only attempt this if the compiler in the base compile
 
182
# command doesn't match the default compiler.
 
183
# arg is usually of the form 'gcc ...'
 
184
func_infer_tag () {
 
185
    if test -n "$available_tags" && test -z "$tagname"; then
 
186
      CC_quoted=
 
187
      for arg in $CC; do
 
188
        case $arg in
 
189
          *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
 
190
          arg="\"$arg\""
 
191
          ;;
 
192
        esac
 
193
        CC_quoted="$CC_quoted $arg"
 
194
      done
 
195
      case $@ in
 
196
      # Blanks in the command may have been stripped by the calling shell,
 
197
      # but not from the CC environment variable when configure was run.
 
198
      " $CC "* | "$CC "* | " `$echo $CC` "* | "`$echo $CC` "* | " $CC_quoted"* | "$CC_quoted "* | " `$echo $CC_quoted` "* | "`$echo $CC_quoted` "*) ;;
 
199
      # Blanks at the start of $base_compile will cause this to fail
 
200
      # if we don't check for them as well.
 
201
      *)
 
202
        for z in $available_tags; do
 
203
          if grep "^# ### BEGIN LIBTOOL TAG CONFIG: $z$" < "$progpath" > /dev/null; then
 
204
            # Evaluate the configuration.
 
205
            eval "`${SED} -n -e '/^# ### BEGIN LIBTOOL TAG CONFIG: '$z'$/,/^# ### END LIBTOOL TAG CONFIG: '$z'$/p' < $progpath`"
 
206
            CC_quoted=
 
207
            for arg in $CC; do
 
208
            # Double-quote args containing other shell metacharacters.
 
209
            case $arg in
 
210
              *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \     ]*|*]*|"")
 
211
              arg="\"$arg\""
 
212
              ;;
 
213
            esac
 
214
            CC_quoted="$CC_quoted $arg"
 
215
          done
 
216
            case "$@ " in
 
217
              " $CC "* | "$CC "* | " `$echo $CC` "* | "`$echo $CC` "* | " $CC_quoted"* | "$CC_quoted "* | " `$echo $CC_quoted` "* | "`$echo $CC_quoted` "*)
 
218
              # The compiler in the base compile command matches
 
219
              # the one in the tagged configuration.
 
220
              # Assume this is the tagged configuration we want.
 
221
              tagname=$z
 
222
              break
 
223
              ;;
 
224
            esac
 
225
          fi
 
226
        done
 
227
        # If $tagname still isn't set, then no tagged configuration
 
228
        # was found and let the user know that the "--tag" command
 
229
        # line option must be used.
 
230
        if test -z "$tagname"; then
 
231
          $echo "$modename: unable to infer tagged configuration"
 
232
          $echo "$modename: specify a tag with \`--tag'" 1>&2
 
233
          exit $EXIT_FAILURE
 
234
#        else
 
235
#          $echo "$modename: using $tagname tagged configuration"
 
236
        fi
 
237
        ;;
 
238
      esac
 
239
    fi
 
240
}
158
241
# End of Shell function definitions
159
242
#####################################
160
243
 
 
244
# Darwin sucks
 
245
eval std_shrext=\"$shrext_cmds\"
 
246
 
161
247
# Parse our command line options once, thoroughly.
162
248
while test "$#" -gt 0
163
249
do
183
269
      case $tagname in
184
270
      *[!-_A-Za-z0-9,/]*)
185
271
        $echo "$progname: invalid tag name: $tagname" 1>&2
186
 
        exit 1
 
272
        exit $EXIT_FAILURE
187
273
        ;;
188
274
      esac
189
275
 
193
279
        # not specially marked.
194
280
        ;;
195
281
      *)
196
 
        if grep "^# ### BEGIN LIBTOOL TAG CONFIG: $tagname$" < "$0" > /dev/null; then
 
282
        if grep "^# ### BEGIN LIBTOOL TAG CONFIG: $tagname$" < "$progpath" > /dev/null; then
197
283
          taglist="$taglist $tagname"
198
284
          # Evaluate the configuration.
199
 
          eval "`${SED} -n -e '/^# ### BEGIN LIBTOOL TAG CONFIG: '$tagname'$/,/^# ### END LIBTOOL TAG CONFIG: '$tagname'$/p' < $0`"
 
285
          eval "`${SED} -n -e '/^# ### BEGIN LIBTOOL TAG CONFIG: '$tagname'$/,/^# ### END LIBTOOL TAG CONFIG: '$tagname'$/p' < $progpath`"
200
286
        else
201
287
          $echo "$progname: ignoring unknown tag $tagname" 1>&2
202
288
        fi
225
311
    $echo "Copyright (C) 2003  Free Software Foundation, Inc."
226
312
    $echo "This is free software; see the source for copying conditions.  There is NO"
227
313
    $echo "warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE."
228
 
    exit 0
 
314
    exit $EXIT_SUCCESS
229
315
    ;;
230
316
 
231
317
  --config)
232
 
    ${SED} -e '1,/^# ### BEGIN LIBTOOL CONFIG/d' -e '/^# ### END LIBTOOL CONFIG/,$d' $0
 
318
    ${SED} -e '1,/^# ### BEGIN LIBTOOL CONFIG/d' -e '/^# ### END LIBTOOL CONFIG/,$d' $progpath
233
319
    # Now print the configurations for the tags.
234
320
    for tagname in $taglist; do
235
 
      ${SED} -n -e "/^# ### BEGIN LIBTOOL TAG CONFIG: $tagname$/,/^# ### END LIBTOOL TAG CONFIG: $tagname$/p" < "$0"
 
321
      ${SED} -n -e "/^# ### BEGIN LIBTOOL TAG CONFIG: $tagname$/,/^# ### END LIBTOOL TAG CONFIG: $tagname$/p" < "$progpath"
236
322
    done
237
 
    exit 0
 
323
    exit $EXIT_SUCCESS
238
324
    ;;
239
325
 
240
326
  --debug)
259
345
    else
260
346
      $echo "disable static libraries"
261
347
    fi
262
 
    exit 0
 
348
    exit $EXIT_SUCCESS
263
349
    ;;
264
350
 
265
351
  --finish) mode="finish" ;;
290
376
  -*)
291
377
    $echo "$modename: unrecognized option \`$arg'" 1>&2
292
378
    $echo "$help" 1>&2
293
 
    exit 1
 
379
    exit $EXIT_FAILURE
294
380
    ;;
295
381
 
296
382
  *)
303
389
if test -n "$prevopt"; then
304
390
  $echo "$modename: option \`$prevopt' requires an argument" 1>&2
305
391
  $echo "$help" 1>&2
306
 
  exit 1
 
392
  exit $EXIT_FAILURE
307
393
fi
308
394
 
309
395
# If this variable is set in any of the actions, the command in it
359
445
  if test -n "$execute_dlfiles" && test "$mode" != execute; then
360
446
    $echo "$modename: unrecognized option \`-dlopen'" 1>&2
361
447
    $echo "$help" 1>&2
362
 
    exit 1
 
448
    exit $EXIT_FAILURE
363
449
  fi
364
450
 
365
451
  # Change the help message to a mode-specific one.
401
487
        -o)
402
488
          if test -n "$libobj" ; then
403
489
            $echo "$modename: you cannot specify \`-o' more than once" 1>&2
404
 
            exit 1
 
490
            exit $EXIT_FAILURE
405
491
          fi
406
492
          arg_mode=target
407
493
          continue
426
512
          args=`$echo "X$arg" | $Xsed -e "s/^-Wc,//"`
427
513
          lastarg=
428
514
          save_ifs="$IFS"; IFS=','
429
 
          for arg in $args; do
 
515
          for arg in $args; do
430
516
            IFS="$save_ifs"
431
517
 
432
518
            # Double-quote args containing other shell metacharacters.
476
562
    case $arg_mode in
477
563
    arg)
478
564
      $echo "$modename: you must specify an argument for -Xcompile"
479
 
      exit 1
 
565
      exit $EXIT_FAILURE
480
566
      ;;
481
567
    target)
482
568
      $echo "$modename: you must specify a target with \`-o'" 1>&2
483
 
      exit 1
 
569
      exit $EXIT_FAILURE
484
570
      ;;
485
571
    *)
486
572
      # Get the name of the library object.
513
599
    *.lo) obj=`$echo "X$libobj" | $Xsed -e "$lo2o"` ;;
514
600
    *)
515
601
      $echo "$modename: cannot determine name of library object from \`$libobj'" 1>&2
516
 
      exit 1
 
602
      exit $EXIT_FAILURE
517
603
      ;;
518
604
    esac
519
605
 
520
 
    # Infer tagged configuration to use if any are available and
521
 
    # if one wasn't chosen via the "--tag" command line option.
522
 
    # Only attempt this if the compiler in the base compile
523
 
    # command doesn't match the default compiler.
524
 
    if test -n "$available_tags" && test -z "$tagname"; then
525
 
      case $base_compile in
526
 
      # Blanks in the command may have been stripped by the calling shell,
527
 
      # but not from the CC environment variable when configure was run.
528
 
      " $CC "* | "$CC "* | " `$echo $CC` "* | "`$echo $CC` "*) ;;
529
 
      # Blanks at the start of $base_compile will cause this to fail
530
 
      # if we don't check for them as well.
531
 
      *)
532
 
        for z in $available_tags; do
533
 
          if grep "^# ### BEGIN LIBTOOL TAG CONFIG: $z$" < "$0" > /dev/null; then
534
 
            # Evaluate the configuration.
535
 
            eval "`${SED} -n -e '/^# ### BEGIN LIBTOOL TAG CONFIG: '$z'$/,/^# ### END LIBTOOL TAG CONFIG: '$z'$/p' < $0`"
536
 
            case "$base_compile " in
537
 
            "$CC "* | " $CC "* | "`$echo $CC` "* | " `$echo $CC` "*)
538
 
              # The compiler in the base compile command matches
539
 
              # the one in the tagged configuration.
540
 
              # Assume this is the tagged configuration we want.
541
 
              tagname=$z
542
 
              break
543
 
              ;;
544
 
            esac
545
 
          fi
546
 
        done
547
 
        # If $tagname still isn't set, then no tagged configuration
548
 
        # was found and let the user know that the "--tag" command
549
 
        # line option must be used.
550
 
        if test -z "$tagname"; then
551
 
          $echo "$modename: unable to infer tagged configuration"
552
 
          $echo "$modename: specify a tag with \`--tag'" 1>&2
553
 
          exit 1
554
 
#        else
555
 
#          $echo "$modename: using $tagname tagged configuration"
556
 
        fi
557
 
        ;;
558
 
      esac
559
 
    fi
 
606
    func_infer_tag $base_compile
560
607
 
561
608
    for arg in $later; do
562
609
      case $arg in
589
636
    if test -z "$base_compile"; then
590
637
      $echo "$modename: you must specify a compilation command" 1>&2
591
638
      $echo "$help" 1>&2
592
 
      exit 1
 
639
      exit $EXIT_FAILURE
593
640
    fi
594
641
 
595
642
    # Delete any leftover library objects.
600
647
    fi
601
648
 
602
649
    $run $rm $removelist
603
 
    trap "$run $rm $removelist; exit 1" 1 2 15
 
650
    trap "$run $rm $removelist; exit $EXIT_FAILURE" 1 2 15
604
651
 
605
652
    # On Cygwin there's no "real" PIC flag so we must build both object types
606
653
    case $host_os in
619
666
      output_obj=`$echo "X$srcfile" | $Xsed -e 's%^.*/%%' -e 's%\.[^.]*$%%'`.${objext}
620
667
      lockfile="$output_obj.lock"
621
668
      removelist="$removelist $output_obj $lockfile"
622
 
      trap "$run $rm $removelist; exit 1" 1 2 15
 
669
      trap "$run $rm $removelist; exit $EXIT_FAILURE" 1 2 15
623
670
    else
624
671
      output_obj=
625
672
      need_locks=no
629
676
    # Lock this critical section if it is needed
630
677
    # We use this script file to make the link, it avoids creating a new file
631
678
    if test "$need_locks" = yes; then
632
 
      until $run ln "$0" "$lockfile" 2>/dev/null; do
 
679
      until $run ln "$progpath" "$lockfile" 2>/dev/null; do
633
680
        $show "Waiting for $lockfile to be removed"
634
681
        sleep 2
635
682
      done
647
694
compiler."
648
695
 
649
696
        $run $rm $removelist
650
 
        exit 1
 
697
        exit $EXIT_FAILURE
651
698
      fi
652
699
      $echo $srcfile > "$lockfile"
653
700
    fi
702
749
      if $run eval "$command"; then :
703
750
      else
704
751
        test -n "$output_obj" && $run $rm $removelist
705
 
        exit 1
 
752
        exit $EXIT_FAILURE
706
753
      fi
707
754
 
708
755
      if test "$need_locks" = warn &&
722
769
compiler."
723
770
 
724
771
        $run $rm $removelist
725
 
        exit 1
 
772
        exit $EXIT_FAILURE
726
773
      fi
727
774
 
728
775
      # Just move the object if needed, then go on to compile the next one
774
821
      if $run eval "$command"; then :
775
822
      else
776
823
        $run $rm $removelist
777
 
        exit 1
 
824
        exit $EXIT_FAILURE
778
825
      fi
779
826
 
780
827
      if test "$need_locks" = warn &&
794
841
compiler."
795
842
 
796
843
        $run $rm $removelist
797
 
        exit 1
 
844
        exit $EXIT_FAILURE
798
845
      fi
799
846
 
800
847
      # Just move the object if needed
832
879
      $run $rm "$lockfile"
833
880
    fi
834
881
 
835
 
    exit 0
 
882
    exit $EXIT_SUCCESS
836
883
    ;;
837
884
 
838
885
  # libtool link mode
904
951
    vinfo=
905
952
    vinfo_number=no
906
953
 
907
 
    # Infer tagged configuration to use if any are available and
908
 
    # if one wasn't chosen via the "--tag" command line option.
909
 
    # Only attempt this if the compiler in the base link
910
 
    # command doesn't match the default compiler.
911
 
    if test -n "$available_tags" && test -z "$tagname"; then
912
 
      case $base_compile in
913
 
      # Blanks in the command may have been stripped by the calling shell,
914
 
      # but not from the CC environment variable when configure was run.
915
 
      "$CC "* | " $CC "* | "`$echo $CC` "* | " `$echo $CC` "*) ;;
916
 
      # Blanks at the start of $base_compile will cause this to fail
917
 
      # if we don't check for them as well.
918
 
      *)
919
 
        for z in $available_tags; do
920
 
          if grep "^# ### BEGIN LIBTOOL TAG CONFIG: $z$" < "$0" > /dev/null; then
921
 
            # Evaluate the configuration.
922
 
            eval "`${SED} -n -e '/^# ### BEGIN LIBTOOL TAG CONFIG: '$z'$/,/^# ### END LIBTOOL TAG CONFIG: '$z'$/p' < $0`"
923
 
            case $base_compile in
924
 
            "$CC "* | " $CC "* | "`$echo $CC` "* | " `$echo $CC` "*)
925
 
              # The compiler in $compile_command matches
926
 
              # the one in the tagged configuration.
927
 
              # Assume this is the tagged configuration we want.
928
 
              tagname=$z
929
 
              break
930
 
              ;;
931
 
            esac
932
 
          fi
933
 
        done
934
 
        # If $tagname still isn't set, then no tagged configuration
935
 
        # was found and let the user know that the "--tag" command
936
 
        # line option must be used.
937
 
        if test -z "$tagname"; then
938
 
          $echo "$modename: unable to infer tagged configuration"
939
 
          $echo "$modename: specify a tag with \`--tag'" 1>&2
940
 
          exit 1
941
 
#       else
942
 
#         $echo "$modename: using $tagname tagged configuration"
943
 
        fi
944
 
        ;;
945
 
      esac
946
 
    fi
 
954
    func_infer_tag $base_compile
947
955
 
948
956
    # We need to know -static, to get the right output filenames.
949
957
    for arg
1039
1047
          export_symbols="$arg"
1040
1048
          if test ! -f "$arg"; then
1041
1049
            $echo "$modename: symbol file \`$arg' does not exist"
1042
 
            exit 1
 
1050
            exit $EXIT_FAILURE
1043
1051
          fi
1044
1052
          prev=
1045
1053
          continue
1091
1099
                   test "$pic_object" = none && \
1092
1100
                   test "$non_pic_object" = none; then
1093
1101
                  $echo "$modename: cannot find name of object for \`$arg'" 1>&2
1094
 
                  exit 1
 
1102
                  exit $EXIT_FAILURE
1095
1103
                fi
1096
1104
 
1097
1105
                # Extract subdirectory from the argument.
1144
1152
                # Only an error if not doing a dry-run.
1145
1153
                if test -z "$run"; then
1146
1154
                  $echo "$modename: \`$arg' is not a valid libtool object" 1>&2
1147
 
                  exit 1
 
1155
                  exit $EXIT_FAILURE
1148
1156
                else
1149
1157
                  # Dry-run case.
1150
1158
 
1165
1173
            done
1166
1174
          else
1167
1175
            $echo "$modename: link input file \`$save_arg' does not exist"
1168
 
            exit 1
 
1176
            exit $EXIT_FAILURE
1169
1177
          fi
1170
1178
          arg=$save_arg
1171
1179
          prev=
1177
1185
          [\\/]* | [A-Za-z]:[\\/]*) ;;
1178
1186
          *)
1179
1187
            $echo "$modename: only absolute run-paths are allowed" 1>&2
1180
 
            exit 1
 
1188
            exit $EXIT_FAILURE
1181
1189
            ;;
1182
1190
          esac
1183
1191
          if test "$prev" = rpath; then
1217
1225
          finalize_command="$finalize_command $qarg"
1218
1226
          continue
1219
1227
          ;;
 
1228
        shrext)
 
1229
          shrext_cmds="$arg"
 
1230
          prev=
 
1231
          continue
 
1232
          ;;
1220
1233
        *)
1221
1234
          eval "$prev=\"\$arg\""
1222
1235
          prev=
1265
1278
      -export-symbols | -export-symbols-regex)
1266
1279
        if test -n "$export_symbols" || test -n "$export_symbols_regex"; then
1267
1280
          $echo "$modename: more than one -exported-symbols argument is not allowed"
1268
 
          exit 1
 
1281
          exit $EXIT_FAILURE
1269
1282
        fi
1270
1283
        if test "X$arg" = "X-export-symbols"; then
1271
1284
          prev=expsyms
1301
1314
          absdir=`cd "$dir" && pwd`
1302
1315
          if test -z "$absdir"; then
1303
1316
            $echo "$modename: cannot determine absolute directory name of \`$dir'" 1>&2
1304
 
            exit 1
 
1317
            exit $EXIT_FAILURE
1305
1318
          fi
1306
1319
          dir="$absdir"
1307
1320
          ;;
1452
1465
        [\\/]* | [A-Za-z]:[\\/]*) ;;
1453
1466
        *)
1454
1467
          $echo "$modename: only absolute run-paths are allowed" 1>&2
1455
 
          exit 1
 
1468
          exit $EXIT_FAILURE
1456
1469
          ;;
1457
1470
        esac
1458
1471
        case "$xrpath " in
1575
1588
             test "$pic_object" = none && \
1576
1589
             test "$non_pic_object" = none; then
1577
1590
            $echo "$modename: cannot find name of object for \`$arg'" 1>&2
1578
 
            exit 1
 
1591
            exit $EXIT_FAILURE
1579
1592
          fi
1580
1593
 
1581
1594
          # Extract subdirectory from the argument.
1628
1641
          # Only an error if not doing a dry-run.
1629
1642
          if test -z "$run"; then
1630
1643
            $echo "$modename: \`$arg' is not a valid libtool object" 1>&2
1631
 
            exit 1
 
1644
            exit $EXIT_FAILURE
1632
1645
          else
1633
1646
            # Dry-run case.
1634
1647
 
1695
1708
    if test -n "$prev"; then
1696
1709
      $echo "$modename: the \`$prevarg' option requires an argument" 1>&2
1697
1710
      $echo "$help" 1>&2
1698
 
      exit 1
 
1711
      exit $EXIT_FAILURE
1699
1712
    fi
1700
1713
 
1701
1714
    if test "$export_dynamic" = yes && test -n "$export_dynamic_flag_spec"; then
1739
1752
    "")
1740
1753
      $echo "$modename: you must specify an output file" 1>&2
1741
1754
      $echo "$help" 1>&2
1742
 
      exit 1
 
1755
      exit $EXIT_FAILURE
1743
1756
      ;;
1744
1757
    *.$libext) linkmode=oldlib ;;
1745
1758
    *.lo | *.$objext) linkmode=obj ;;
1749
1762
 
1750
1763
    case $host in
1751
1764
    *cygwin* | *mingw* | *pw32*)
1752
 
      # don't eliminate duplcations in $postdeps and $predeps
 
1765
      # don't eliminate duplications in $postdeps and $predeps
1753
1766
      duplicate_compiler_generated_deps=yes
1754
1767
      ;;
1755
1768
    *)
1802
1815
          *.la) ;;
1803
1816
          *)
1804
1817
            $echo "$modename: libraries can \`-dlopen' only libtool libraries: $file" 1>&2
1805
 
            exit 1
 
1818
            exit $EXIT_FAILURE
1806
1819
            ;;
1807
1820
          esac
1808
1821
        done
1860
1873
          fi
1861
1874
          name=`$echo "X$deplib" | $Xsed -e 's/^-l//'`
1862
1875
          for searchdir in $newlib_search_path $lib_search_path $sys_lib_search_path $shlib_search_path; do
1863
 
            for search_ext in .la $shrext .so .a; do
 
1876
            for search_ext in .la $std_shrext .so .a; do
1864
1877
              # Search the libtool library
1865
1878
              lib="$searchdir/lib${name}${search_ext}"
1866
1879
              if test -f "$lib"; then
1936
1949
            fi
1937
1950
            if test "$pass" = scan; then
1938
1951
              deplibs="$deplib $deplibs"
1939
 
              newlib_search_path="$newlib_search_path "`$echo "X$deplib" | $Xsed -e 's/^-L//'`
1940
1952
            else
1941
1953
              compile_deplibs="$deplib $compile_deplibs"
1942
1954
              finalize_deplibs="$deplib $finalize_deplibs"
1943
1955
            fi
 
1956
            newlib_search_path="$newlib_search_path "`$echo "X$deplib" | $Xsed -e 's/^-L//'`
1944
1957
            ;;
1945
1958
          *)
1946
1959
            $echo "$modename: warning: \`-L' is ignored for archives/objects" 1>&2
2019
2032
        if test "$found" = yes || test -f "$lib"; then :
2020
2033
        else
2021
2034
          $echo "$modename: cannot find the library \`$lib'" 1>&2
2022
 
          exit 1
 
2035
          exit $EXIT_FAILURE
2023
2036
        fi
2024
2037
 
2025
2038
        # Check to see that this really is a libtool archive.
2026
2039
        if (${SED} -e '2q' $lib | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then :
2027
2040
        else
2028
2041
          $echo "$modename: \`$lib' is not a valid libtool archive" 1>&2
2029
 
          exit 1
 
2042
          exit $EXIT_FAILURE
2030
2043
        fi
2031
2044
 
2032
2045
        ladir=`$echo "X$lib" | $Xsed -e 's%/[^/]*$%%'`
2062
2075
          if test -z "$libdir"; then
2063
2076
            if test -z "$old_library"; then
2064
2077
              $echo "$modename: cannot find name of link library for \`$lib'" 1>&2
2065
 
              exit 1
 
2078
              exit $EXIT_FAILURE
2066
2079
            fi
2067
2080
            # It is a libtool convenience library, so add in its objects.
2068
2081
            convenience="$convenience $ladir/$objdir/$old_library"
2079
2092
            done
2080
2093
          elif test "$linkmode" != prog && test "$linkmode" != lib; then
2081
2094
            $echo "$modename: \`$lib' is not a convenience library" 1>&2
2082
 
            exit 1
 
2095
            exit $EXIT_FAILURE
2083
2096
          fi
2084
2097
          continue
2085
2098
        fi # $pass = conv
2086
2099
 
2087
 
    
 
2100
 
2088
2101
        # Get the name of the library we link against.
2089
2102
        linklib=
2090
2103
        for l in $old_library $library_names; do
2092
2105
        done
2093
2106
        if test -z "$linklib"; then
2094
2107
          $echo "$modename: cannot find name of link library for \`$lib'" 1>&2
2095
 
          exit 1
 
2108
          exit $EXIT_FAILURE
2096
2109
        fi
2097
2110
 
2098
2111
        # This library was specified with -dlopen.
2099
2112
        if test "$pass" = dlopen; then
2100
2113
          if test -z "$libdir"; then
2101
2114
            $echo "$modename: cannot -dlopen a convenience library: \`$lib'" 1>&2
2102
 
            exit 1
 
2115
            exit $EXIT_FAILURE
2103
2116
          fi
2104
 
          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
2105
2120
            # If there is no dlname, no dlopen support or we're linking
2106
2121
            # statically, we need to preload.  We also need to preload any
2107
2122
            # dependent libraries so libltdl's deplib preloader doesn't
2150
2165
        if test "$pass" = dlpreopen; then
2151
2166
          if test -z "$libdir"; then
2152
2167
            $echo "$modename: cannot -dlpreopen a convenience library: \`$lib'" 1>&2
2153
 
            exit 1
 
2168
            exit $EXIT_FAILURE
2154
2169
          fi
2155
2170
          # Prefer using a static library (so that no silly _DYNAMIC symbols
2156
2171
          # are required to link).
2177
2192
          continue
2178
2193
        fi
2179
2194
 
2180
 
    
 
2195
 
2181
2196
        if test "$linkmode" = prog && test "$pass" != link; then
2182
2197
          newlib_search_path="$newlib_search_path $ladir"
2183
2198
          deplibs="$lib $deplibs"
2264
2279
            need_relink=yes
2265
2280
          fi
2266
2281
          # This is a shared library
2267
 
        
2268
 
      # Warn about portability, can't link against -module's on some systems (darwin)
2269
 
      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
2270
2286
            $echo
2271
2287
            if test "$linkmode" = prog; then
2272
2288
              $echo "*** Warning: Linking the executable $output against the loadable module"
2273
2289
            else
2274
2290
              $echo "*** Warning: Linking the shared library $output against the loadable module"
2275
2291
            fi
2276
 
            $echo "*** $linklib is not portable!"    
2277
 
      fi          
 
2292
            $echo "*** $linklib is not portable!"
 
2293
          fi
2278
2294
          if test "$linkmode" = lib &&
2279
2295
             test "$hardcode_into_libs" = yes; then
2280
2296
            # Hardcode the library path.
2372
2388
                case $host in
2373
2389
                  *-*-sco3.2v5* ) add_dir="-L$dir" ;;
2374
2390
                  *-*-darwin* )
2375
 
                    # if the lib is a module then we can not link against it, someone
2376
 
                    # is ignoring the new warnings I added
2377
 
                    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
2378
2394
                      $echo "** Warning, lib $linklib is a module, not a shared library"
2379
2395
                      if test -z "$old_library" ; then
2380
2396
                        $echo
2382
2398
                        $echo "** The link will probably fail, sorry"
2383
2399
                      else
2384
2400
                        add="$dir/$old_library"
2385
 
                      fi 
 
2401
                      fi
2386
2402
                    fi
2387
2403
                esac
2388
2404
              elif test "$hardcode_minus_L" = no; then
2424
2440
 
2425
2441
            if test "$lib_linked" != yes; then
2426
2442
              $echo "$modename: configuration error: unsupported hardcode properties"
2427
 
              exit 1
 
2443
              exit $EXIT_FAILURE
2428
2444
            fi
2429
2445
 
2430
2446
            if test -n "$add_shlibpath"; then
2467
2483
              esac
2468
2484
              add="-l$name"
2469
2485
            elif test "$hardcode_automatic" = yes; then
2470
 
              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
2471
2488
                add="$inst_prefix_dir$libdir/$linklib"
2472
2489
              else
2473
2490
                add="$libdir/$linklib"
2547
2564
 
2548
2565
        if test "$linkmode" = lib; then
2549
2566
          if test -n "$dependency_libs" &&
2550
 
             { test "$hardcode_into_libs" != yes || test "$build_old_libs" = yes ||
 
2567
             { test "$hardcode_into_libs" != yes ||
 
2568
               test "$build_old_libs" = yes ||
2551
2569
               test "$link_static" = yes; }; then
2552
2570
            # Extract -R from dependency_libs
2553
2571
            temp_deplibs=
2604
2622
                  eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $deplib`
2605
2623
                  if test -z "$libdir"; then
2606
2624
                    $echo "$modename: \`$deplib' is not a valid libtool archive" 1>&2
2607
 
                    exit 1
 
2625
                    exit $EXIT_FAILURE
2608
2626
                  fi
2609
2627
                  if test "$absdir" != "$libdir"; then
2610
2628
                    $echo "$modename: warning: \`$deplib' seems to be moved" 1>&2
2614
2632
                depdepl=
2615
2633
                case $host in
2616
2634
                *-*-darwin*)
2617
 
                  # 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
2618
2637
                  eval deplibrary_names=`${SED} -n -e 's/^library_names=\(.*\)$/\1/p' $deplib`
2619
2638
                  if test -n "$deplibrary_names" ; then
2620
2639
                    for tmp in $deplibrary_names ; do
2622
2641
                    done
2623
2642
                    if test -f "$path/$depdepl" ; then
2624
2643
                      depdepl="$path/$depdepl"
2625
 
                   fi
 
2644
                    fi
2626
2645
                    # do not add paths which are already there
2627
2646
                    case " $newlib_search_path " in
2628
2647
                    *" $path "*) ;;
2632
2651
                  path=""
2633
2652
                  ;;
2634
2653
                *)
2635
 
                path="-L$path"
2636
 
                ;;
2637
 
                esac 
2638
 
                
2639
 
                ;;
2640
 
                  -l*)
 
2654
                  path="-L$path"
 
2655
                  ;;
 
2656
                esac
 
2657
                ;;
 
2658
              -l*)
2641
2659
                case $host in
2642
2660
                *-*-darwin*)
2643
 
                 # Again, we only want to link against shared libraries
2644
 
                 eval tmp_libs=`$echo "X$deplib" | $Xsed -e "s,^\-l,,"`
2645
 
                 for tmp in $newlib_search_path ; do
2646
 
                     if test -f "$tmp/lib$tmp_libs.dylib" ; then
2647
 
                       eval depdepl="$tmp/lib$tmp_libs.dylib"
2648
 
                       break
2649
 
                     fi  
2650
 
         done
2651
 
         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=""
2652
2670
                  ;;
2653
2671
                *) continue ;;
2654
 
                esac              
 
2672
                esac
2655
2673
                ;;
2656
2674
              *) continue ;;
2657
2675
              esac
2658
2676
              case " $deplibs " in
2659
2677
              *" $depdepl "*) ;;
2660
 
              *) deplibs="$deplibs $depdepl" ;;
2661
 
              esac            
 
2678
              *) deplibs="$depdepl $deplibs" ;;
 
2679
              esac
2662
2680
              case " $deplibs " in
2663
2681
              *" $path "*) ;;
2664
2682
              *) deplibs="$deplibs $path" ;;
2748
2766
          eval $var=\"$tmp_libs\"
2749
2767
        done # for var
2750
2768
      fi
2751
 
      # 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)
2752
2771
      tmp_libs=
2753
2772
      for i in $dependency_libs ; do
2754
2773
        case " $predeps $postdeps $compiler_lib_search_path " in
2808
2827
      case $outputname in
2809
2828
      lib*)
2810
2829
        name=`$echo "X$outputname" | $Xsed -e 's/\.la$//' -e 's/^lib//'`
2811
 
        eval shared_ext=\"$shrext\"
 
2830
        eval shared_ext=\"$shrext_cmds\"
2812
2831
        eval libname=\"$libname_spec\"
2813
2832
        ;;
2814
2833
      *)
2815
2834
        if test "$module" = no; then
2816
2835
          $echo "$modename: libtool library \`$output' must begin with \`lib'" 1>&2
2817
2836
          $echo "$help" 1>&2
2818
 
          exit 1
 
2837
          exit $EXIT_FAILURE
2819
2838
        fi
2820
2839
        if test "$need_lib_prefix" != no; then
2821
2840
          # Add the "lib" prefix for modules if required
2822
2841
          name=`$echo "X$outputname" | $Xsed -e 's/\.la$//'`
2823
 
          eval shared_ext=\"$shrext\"
 
2842
          eval shared_ext=\"$shrext_cmds\"
2824
2843
          eval libname=\"$libname_spec\"
2825
2844
        else
2826
2845
          libname=`$echo "X$outputname" | $Xsed -e 's/\.la$//'`
2831
2850
      if test -n "$objs"; then
2832
2851
        if test "$deplibs_check_method" != pass_all; then
2833
2852
          $echo "$modename: cannot build libtool library \`$output' from non-libtool objects on this host:$objs" 2>&1
2834
 
          exit 1
 
2853
          exit $EXIT_FAILURE
2835
2854
        else
2836
2855
          $echo
2837
2856
          $echo "*** Warning: Linking the shared library $output against the non-libtool"
2879
2898
        if test -n "$8"; then
2880
2899
          $echo "$modename: too many parameters to \`-version-info'" 1>&2
2881
2900
          $echo "$help" 1>&2
2882
 
          exit 1
 
2901
          exit $EXIT_FAILURE
2883
2902
        fi
2884
2903
 
2885
2904
        # convert absolute version numbers to libtool ages
2886
2905
        # this retains compatibility with .la files and attempts
2887
2906
        # to make the code below a bit more comprehensible
2888
 
        
 
2907
 
2889
2908
        case $vinfo_number in
2890
2909
        yes)
2891
2910
          number_major="$2"
2925
2944
 
2926
2945
        # Check that each of the things are valid numbers.
2927
2946
        case $current in
2928
 
        0 | [1-9] | [1-9][0-9] | [1-9][0-9][0-9]) ;;
 
2947
        [0-9]*) ;;
2929
2948
        *)
2930
2949
          $echo "$modename: CURRENT \`$current' is not a nonnegative integer" 1>&2
2931
2950
          $echo "$modename: \`$vinfo' is not valid version information" 1>&2
2932
 
          exit 1
 
2951
          exit $EXIT_FAILURE
2933
2952
          ;;
2934
2953
        esac
2935
2954
 
2936
2955
        case $revision in
2937
 
        0 | [1-9] | [1-9][0-9] | [1-9][0-9][0-9]) ;;
 
2956
        [0-9]*) ;;
2938
2957
        *)
2939
2958
          $echo "$modename: REVISION \`$revision' is not a nonnegative integer" 1>&2
2940
2959
          $echo "$modename: \`$vinfo' is not valid version information" 1>&2
2941
 
          exit 1
 
2960
          exit $EXIT_FAILURE
2942
2961
          ;;
2943
2962
        esac
2944
2963
 
2945
2964
        case $age in
2946
 
        0 | [1-9] | [1-9][0-9] | [1-9][0-9][0-9]) ;;
 
2965
        [0-9]*) ;;
2947
2966
        *)
2948
2967
          $echo "$modename: AGE \`$age' is not a nonnegative integer" 1>&2
2949
2968
          $echo "$modename: \`$vinfo' is not valid version information" 1>&2
2950
 
          exit 1
 
2969
          exit $EXIT_FAILURE
2951
2970
          ;;
2952
2971
        esac
2953
2972
 
2954
2973
        if test "$age" -gt "$current"; then
2955
2974
          $echo "$modename: AGE \`$age' is greater than the current interface number \`$current'" 1>&2
2956
2975
          $echo "$modename: \`$vinfo' is not valid version information" 1>&2
2957
 
          exit 1
 
2976
          exit $EXIT_FAILURE
2958
2977
        fi
2959
2978
 
2960
2979
        # Calculate the version variables.
3043
3062
        *)
3044
3063
          $echo "$modename: unknown library version type \`$version_type'" 1>&2
3045
3064
          $echo "Fatal configuration error.  See the $PACKAGE docs for more information." 1>&2
3046
 
          exit 1
 
3065
          exit $EXIT_FAILURE
3047
3066
          ;;
3048
3067
        esac
3049
3068
 
3097
3116
            *.$objext)
3098
3117
               ;;
3099
3118
            $output_objdir/$outputname | $output_objdir/$libname.* | $output_objdir/${libname}${release}.*)
3100
 
               if echo $p | $EGREP -e "$precious_files_regex" >/dev/null 2>&1
3101
 
               then
3102
 
                 continue
 
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
3103
3124
               fi
3104
3125
               removelist="$removelist $p"
3105
3126
               ;;
3580
3601
        fi
3581
3602
 
3582
3603
        # Get the real and link names of the library.
3583
 
        eval shared_ext=\"$shrext\"
 
3604
        eval shared_ext=\"$shrext_cmds\"
3584
3605
        eval library_names=\"$library_names_spec\"
3585
3606
        set dummy $library_names
3586
3607
        realname="$2"
3644
3665
        for test_deplib in $deplibs; do
3645
3666
                case " $convenience " in
3646
3667
                *" $test_deplib "*) ;;
3647
 
                *) 
 
3668
                *)
3648
3669
                        tmp_deplibs="$tmp_deplibs $test_deplib"
3649
3670
                        ;;
3650
3671
                esac
3651
3672
        done
3652
 
        deplibs="$tmp_deplibs" 
 
3673
        deplibs="$tmp_deplibs"
3653
3674
 
3654
3675
        if test -n "$convenience"; then
3655
3676
          if test -n "$whole_archive_flag_spec"; then
3832
3853
          save_ifs="$IFS"; IFS='~'
3833
3854
          for cmd in $concat_cmds; do
3834
3855
            IFS="$save_ifs"
3835
 
            eval cmd=\"$cmd\"
3836
3856
            $show "$cmd"
3837
3857
            $run eval "$cmd" || exit $?
3838
3858
          done
3879
3899
        # Restore the uninstalled library and exit
3880
3900
        if test "$mode" = relink; then
3881
3901
          $run eval '(cd $output_objdir && $rm ${realname}T && $mv $realname ${realname}T && $mv "$realname"U $realname)' || exit $?
3882
 
          exit 0
 
3902
          exit $EXIT_SUCCESS
3883
3903
        fi
3884
3904
 
3885
3905
        # Create links to the real library.
3927
3947
      *.lo)
3928
3948
        if test -n "$objs$old_deplibs"; then
3929
3949
          $echo "$modename: cannot build library object \`$output' from non-libtool objects" 1>&2
3930
 
          exit 1
 
3950
          exit $EXIT_FAILURE
3931
3951
        fi
3932
3952
        libobj="$output"
3933
3953
        obj=`$echo "X$output" | $Xsed -e "$lo2o"`
4038
4058
          $run ${rm}r $gentop
4039
4059
        fi
4040
4060
 
4041
 
        exit 0
 
4061
        exit $EXIT_SUCCESS
4042
4062
      fi
4043
4063
 
4044
4064
      if test "$build_libtool_libs" != yes; then
4051
4071
        # accidentally link it into a program.
4052
4072
        # $show "echo timestamp > $libobj"
4053
4073
        # $run eval "echo timestamp > $libobj" || exit $?
4054
 
        exit 0
 
4074
        exit $EXIT_SUCCESS
4055
4075
      fi
4056
4076
 
4057
4077
      if test -n "$pic_flag" || test "$pic_mode" != default; then
4074
4094
        $run ${rm}r $gentop
4075
4095
      fi
4076
4096
 
4077
 
      exit 0
 
4097
      exit $EXIT_SUCCESS
4078
4098
      ;;
4079
4099
 
4080
4100
    prog)
4392
4412
          ;;
4393
4413
        *)
4394
4414
          $echo "$modename: unknown suffix for \`$dlsyms'" 1>&2
4395
 
          exit 1
 
4415
          exit $EXIT_FAILURE
4396
4416
          ;;
4397
4417
        esac
4398
4418
      else
4480
4500
        # Link the executable and exit
4481
4501
        $show "$link_command"
4482
4502
        $run eval "$link_command" || exit $?
4483
 
        exit 0
 
4503
        exit $EXIT_SUCCESS
4484
4504
      fi
4485
4505
 
4486
4506
      if test "$hardcode_action" = relink; then
4535
4555
      fi
4536
4556
 
4537
4557
      # Quote $echo for shipping.
4538
 
      if test "X$echo" = "X$SHELL $0 --fallback-echo"; then
4539
 
        case $0 in
4540
 
        [\\/]* | [A-Za-z]:[\\/]*) qecho="$SHELL $0 --fallback-echo";;
4541
 
        *) 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";;
4542
4562
        esac
4543
4563
        qecho=`$echo "X$qecho" | $Xsed -e "$sed_quote_subst"`
4544
4564
      else
4564
4584
            cwrappersource=`$echo ${objdir}/lt-${output}.c`
4565
4585
            cwrapper=`$echo ${output}.exe`
4566
4586
            $rm $cwrappersource $cwrapper
4567
 
            trap "$rm $cwrappersource $cwrapper; exit 1" 1 2 15
 
4587
            trap "$rm $cwrappersource $cwrapper; exit $EXIT_FAILURE" 1 2 15
4568
4588
 
4569
4589
            cat > $cwrappersource <<EOF
4570
4590
 
4573
4593
 
4574
4594
   The $output program cannot be directly executed until all the libtool
4575
4595
   libraries that it depends on are installed.
4576
 
   
 
4596
 
4577
4597
   This wrapper executable should never be moved out of the build directory.
4578
4598
   If it is, it will not operate correctly.
4579
4599
 
4605
4625
#if defined (_WIN32) || defined (__MSDOS__) || defined (__DJGPP__) || \
4606
4626
  defined (__OS2__)
4607
4627
#define HAVE_DOS_BASED_FILE_SYSTEM
4608
 
#ifndef DIR_SEPARATOR_2 
 
4628
#ifndef DIR_SEPARATOR_2
4609
4629
#define DIR_SEPARATOR_2 '\\'
4610
4630
#endif
4611
4631
#endif
4636
4656
{
4637
4657
  char **newargz;
4638
4658
  int i;
4639
 
  
 
4659
 
4640
4660
  program_name = (char *) xstrdup ((char *) basename (argv[0]));
4641
4661
  newargz = XMALLOC(char *, argc+2);
4642
4662
EOF
4649
4669
  newargz[1] = fnqualify(argv[0]);
4650
4670
  /* we know the script has the same name, without the .exe */
4651
4671
  /* so make sure newargz[1] doesn't end in .exe */
4652
 
  strendzap(newargz[1],".exe"); 
 
4672
  strendzap(newargz[1],".exe");
4653
4673
  for (i = 1; i < argc; i++)
4654
4674
    newargz[i+1] = xstrdup(argv[i]);
4655
4675
  newargz[argc+1] = NULL;
4672
4692
  return p;
4673
4693
}
4674
4694
 
4675
 
char * 
 
4695
char *
4676
4696
xstrdup (const char *string)
4677
4697
{
4678
4698
  return string ? strcpy ((char *) xmalloc (strlen (string) + 1), string) : NULL
4686
4706
 
4687
4707
#if defined (HAVE_DOS_BASED_FILE_SYSTEM)
4688
4708
  /* Skip over the disk name in MSDOS pathnames. */
4689
 
  if (isalpha (name[0]) && name[1] == ':') 
 
4709
  if (isalpha (name[0]) && name[1] == ':')
4690
4710
    name += 2;
4691
4711
#endif
4692
4712
 
4696
4716
  return (char *) base;
4697
4717
}
4698
4718
 
4699
 
char * 
 
4719
char *
4700
4720
fnqualify(const char *path)
4701
4721
{
4702
4722
  size_t size;
4724
4744
}
4725
4745
 
4726
4746
char *
4727
 
strendzap(char *str, const char *pat) 
 
4747
strendzap(char *str, const char *pat)
4728
4748
{
4729
4749
  size_t len, patlen;
4730
4750
 
4744
4764
}
4745
4765
 
4746
4766
static void
4747
 
lt_error_core (int exit_status, const char * mode, 
 
4767
lt_error_core (int exit_status, const char * mode,
4748
4768
          const char * message, va_list ap)
4749
4769
{
4750
4770
  fprintf (stderr, "%s: %s: ", program_name, mode);
4773
4793
          ;;
4774
4794
        esac
4775
4795
        $rm $output
4776
 
        trap "$rm $output; exit 1" 1 2 15
 
4796
        trap "$rm $output; exit $EXIT_FAILURE" 1 2 15
4777
4797
 
4778
4798
        $echo > $output "\
4779
4799
#! $SHELL
4873
4893
      else
4874
4894
        $echo \"\$relink_command_output\" >&2
4875
4895
        $rm \"\$progdir/\$file\"
4876
 
        exit 1
 
4896
        exit $EXIT_FAILURE
4877
4897
      fi
4878
4898
    fi
4879
4899
 
4935
4955
        esac
4936
4956
        $echo >> $output "\
4937
4957
      \$echo \"\$0: cannot exec \$program \${1+\"\$@\"}\"
4938
 
      exit 1
 
4958
      exit $EXIT_FAILURE
4939
4959
    fi
4940
4960
  else
4941
4961
    # The program doesn't exist.
4942
4962
    \$echo \"\$0: error: \$progdir/\$program does not exist\" 1>&2
4943
4963
    \$echo \"This script is just a wrapper for \$program.\" 1>&2
4944
4964
    $echo \"See the $PACKAGE documentation for more information.\" 1>&2
4945
 
    exit 1
 
4965
    exit $EXIT_FAILURE
4946
4966
  fi
4947
4967
fi\
4948
4968
"
4949
4969
        chmod +x $output
4950
4970
      fi
4951
 
      exit 0
 
4971
      exit $EXIT_SUCCESS
4952
4972
      ;;
4953
4973
    esac
4954
4974
 
5067
5087
          for obj in $save_oldobjs
5068
5088
          do
5069
5089
            last_oldobj=$obj
5070
 
          done  
 
5090
          done
5071
5091
          for obj in $save_oldobjs
5072
5092
          do
5073
5093
            oldobjs="$objlist $obj"
5081
5101
              oldobjs=$objlist
5082
5102
              if test "$obj" = "$last_oldobj" ; then
5083
5103
                RANLIB=$save_RANLIB
5084
 
              fi  
 
5104
              fi
5085
5105
              test -z "$concat_cmds" || concat_cmds=$concat_cmds~
5086
5106
              eval concat_cmds=\"\${concat_cmds}$old_archive_cmds\"
5087
5107
              objlist=
5130
5150
        fi
5131
5151
      done
5132
5152
      # Quote the link command for shipping.
5133
 
      relink_command="(cd `pwd`; $SHELL $0 $preserve_args --mode=relink $libtool_args @inst_prefix_dir@)"
 
5153
      relink_command="(cd `pwd`; $SHELL $progpath $preserve_args --mode=relink $libtool_args @inst_prefix_dir@)"
5134
5154
      relink_command=`$echo "X$relink_command" | $Xsed -e "$sed_quote_subst"`
5135
5155
      if test "$hardcode_automatic" = yes ; then
5136
 
        relink_command=
5137
 
      fi  
 
5156
        relink_command=
 
5157
      fi
 
5158
 
 
5159
 
5138
5160
      # Only create the output if not a dry run.
5139
5161
      if test -z "$run"; then
5140
5162
        for installed in no yes; do
5152
5174
                eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $deplib`
5153
5175
                if test -z "$libdir"; then
5154
5176
                  $echo "$modename: \`$deplib' is not a valid libtool archive" 1>&2
5155
 
                  exit 1
 
5177
                  exit $EXIT_FAILURE
5156
5178
                fi
5157
5179
                newdependency_libs="$newdependency_libs $libdir/$name"
5158
5180
                ;;
5166
5188
              eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $lib`
5167
5189
              if test -z "$libdir"; then
5168
5190
                $echo "$modename: \`$lib' is not a valid libtool archive" 1>&2
5169
 
                exit 1
 
5191
                exit $EXIT_FAILURE
5170
5192
              fi
5171
5193
              newdlfiles="$newdlfiles $libdir/$name"
5172
5194
            done
5177
5199
              eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $lib`
5178
5200
              if test -z "$libdir"; then
5179
5201
                $echo "$modename: \`$lib' is not a valid libtool archive" 1>&2
5180
 
                exit 1
 
5202
                exit $EXIT_FAILURE
5181
5203
              fi
5182
5204
              newdlprefiles="$newdlprefiles $libdir/$name"
5183
5205
            done
5185
5207
          else
5186
5208
            newdlfiles=
5187
5209
            for lib in $dlfiles; do
5188
 
              case $lib in 
 
5210
              case $lib in
5189
5211
                [\\/]* | [A-Za-z]:[\\/]*) abs="$lib" ;;
5190
5212
                *) abs=`pwd`"/$lib" ;;
5191
5213
              esac
5194
5216
            dlfiles="$newdlfiles"
5195
5217
            newdlprefiles=
5196
5218
            for lib in $dlprefiles; do
5197
 
              case $lib in 
 
5219
              case $lib in
5198
5220
                [\\/]* | [A-Za-z]:[\\/]*) abs="$lib" ;;
5199
5221
                *) abs=`pwd`"/$lib" ;;
5200
5222
              esac
5257
5279
      $run eval '(cd $output_objdir && $rm $outputname && $LN_S ../$outputname $outputname)' || exit $?
5258
5280
      ;;
5259
5281
    esac
5260
 
    exit 0
 
5282
    exit $EXIT_SUCCESS
5261
5283
    ;;
5262
5284
 
5263
5285
  # libtool install mode
5346
5368
    if test -z "$install_prog"; then
5347
5369
      $echo "$modename: you must specify an install program" 1>&2
5348
5370
      $echo "$help" 1>&2
5349
 
      exit 1
 
5371
      exit $EXIT_FAILURE
5350
5372
    fi
5351
5373
 
5352
5374
    if test -n "$prev"; then
5353
5375
      $echo "$modename: the \`$prev' option requires an argument" 1>&2
5354
5376
      $echo "$help" 1>&2
5355
 
      exit 1
 
5377
      exit $EXIT_FAILURE
5356
5378
    fi
5357
5379
 
5358
5380
    if test -z "$files"; then
5362
5384
        $echo "$modename: you must specify a destination" 1>&2
5363
5385
      fi
5364
5386
      $echo "$help" 1>&2
5365
 
      exit 1
 
5387
      exit $EXIT_FAILURE
5366
5388
    fi
5367
5389
 
5368
5390
    # Strip any trailing slash from the destination.
5383
5405
      if test "$#" -gt 2; then
5384
5406
        $echo "$modename: \`$dest' is not a directory" 1>&2
5385
5407
        $echo "$help" 1>&2
5386
 
        exit 1
 
5408
        exit $EXIT_FAILURE
5387
5409
      fi
5388
5410
    fi
5389
5411
    case $destdir in
5395
5417
        *)
5396
5418
          $echo "$modename: \`$destdir' must be an absolute directory name" 1>&2
5397
5419
          $echo "$help" 1>&2
5398
 
          exit 1
 
5420
          exit $EXIT_FAILURE
5399
5421
          ;;
5400
5422
        esac
5401
5423
      done
5424
5446
        else
5425
5447
          $echo "$modename: \`$file' is not a valid libtool archive" 1>&2
5426
5448
          $echo "$help" 1>&2
5427
 
          exit 1
 
5449
          exit $EXIT_FAILURE
5428
5450
        fi
5429
5451
 
5430
5452
        library_names=
5466
5488
          # but it's something to keep an eye on.
5467
5489
          if test "$inst_prefix_dir" = "$destdir"; then
5468
5490
            $echo "$modename: error: cannot install \`$file' to a directory not ending in $libdir" 1>&2
5469
 
            exit 1
 
5491
            exit $EXIT_FAILURE
5470
5492
          fi
5471
5493
 
5472
5494
          if test -n "$inst_prefix_dir"; then
5481
5503
          if $run eval "$relink_command"; then :
5482
5504
          else
5483
5505
            $echo "$modename: error: relink \`$file' with the above command before installing it" 1>&2
5484
 
            exit 1
 
5506
            exit $EXIT_FAILURE
5485
5507
          fi
5486
5508
        fi
5487
5509
 
5560
5582
        *)
5561
5583
          $echo "$modename: cannot copy a libtool object to \`$destfile'" 1>&2
5562
5584
          $echo "$help" 1>&2
5563
 
          exit 1
 
5585
          exit $EXIT_FAILURE
5564
5586
          ;;
5565
5587
        esac
5566
5588
 
5578
5600
          $show "$install_prog $staticobj $staticdest"
5579
5601
          $run eval "$install_prog \$staticobj \$staticdest" || exit $?
5580
5602
        fi
5581
 
        exit 0
 
5603
        exit $EXIT_SUCCESS
5582
5604
        ;;
5583
5605
 
5584
5606
      *)
5632
5654
          # Check the variables that should have been set.
5633
5655
          if test -z "$notinst_deplibs"; then
5634
5656
            $echo "$modename: invalid libtool wrapper script \`$wrapper'" 1>&2
5635
 
            exit 1
 
5657
            exit $EXIT_FAILURE
5636
5658
          fi
5637
5659
 
5638
5660
          finalize=yes
5673
5695
              tmpdir="/tmp"
5674
5696
              test -n "$TMPDIR" && tmpdir="$TMPDIR"
5675
5697
              tmpdir="$tmpdir/libtool-$$"
5676
 
              if $mkdir "$tmpdir" && chmod 700 "$tmpdir"; then :
 
5698
              save_umask=`umask`
 
5699
              umask 0077
 
5700
              if $mkdir "$tmpdir"; then
 
5701
                umask $save_umask
5677
5702
              else
 
5703
                umask $save_umask
5678
5704
                $echo "$modename: error: cannot create temporary directory \`$tmpdir'" 1>&2
5679
5705
                continue
5680
5706
              fi
5757
5783
    if test -n "$current_libdirs"; then
5758
5784
      # Maybe just do a dry run.
5759
5785
      test -n "$run" && current_libdirs=" -n$current_libdirs"
5760
 
      exec_cmd='$SHELL $0 $preserve_args --finish$current_libdirs'
 
5786
      exec_cmd='$SHELL $progpath $preserve_args --finish$current_libdirs'
5761
5787
    else
5762
 
      exit 0
 
5788
      exit $EXIT_SUCCESS
5763
5789
    fi
5764
5790
    ;;
5765
5791
 
5799
5825
    fi
5800
5826
 
5801
5827
    # Exit here if they wanted silent mode.
5802
 
    test "$show" = : && exit 0
 
5828
    test "$show" = : && exit $EXIT_SUCCESS
5803
5829
 
5804
5830
    $echo "----------------------------------------------------------------------"
5805
5831
    $echo "Libraries have been installed in:"
5835
5861
    $echo "See any operating system documentation about shared libraries for"
5836
5862
    $echo "more information, such as the ld(1) and ld.so(8) manual pages."
5837
5863
    $echo "----------------------------------------------------------------------"
5838
 
    exit 0
 
5864
    exit $EXIT_SUCCESS
5839
5865
    ;;
5840
5866
 
5841
5867
  # libtool execute mode
5847
5873
    if test -z "$cmd"; then
5848
5874
      $echo "$modename: you must specify a COMMAND" 1>&2
5849
5875
      $echo "$help"
5850
 
      exit 1
 
5876
      exit $EXIT_FAILURE
5851
5877
    fi
5852
5878
 
5853
5879
    # Handle -dlopen flags immediately.
5855
5881
      if test ! -f "$file"; then
5856
5882
        $echo "$modename: \`$file' is not a file" 1>&2
5857
5883
        $echo "$help" 1>&2
5858
 
        exit 1
 
5884
        exit $EXIT_FAILURE
5859
5885
      fi
5860
5886
 
5861
5887
      dir=
5866
5892
        else
5867
5893
          $echo "$modename: \`$lib' is not a valid libtool archive" 1>&2
5868
5894
          $echo "$help" 1>&2
5869
 
          exit 1
 
5895
          exit $EXIT_FAILURE
5870
5896
        fi
5871
5897
 
5872
5898
        # Read the libtool library.
5893
5919
          dir="$dir/$objdir"
5894
5920
        else
5895
5921
          $echo "$modename: cannot find \`$dlname' in \`$dir' or \`$dir/$objdir'" 1>&2
5896
 
          exit 1
 
5922
          exit $EXIT_FAILURE
5897
5923
        fi
5898
5924
        ;;
5899
5925
 
5973
5999
        $echo "export $shlibpath_var"
5974
6000
      fi
5975
6001
      $echo "$cmd$args"
5976
 
      exit 0
 
6002
      exit $EXIT_SUCCESS
5977
6003
    fi
5978
6004
    ;;
5979
6005
 
6001
6027
    if test -z "$rm"; then
6002
6028
      $echo "$modename: you must specify an RM program" 1>&2
6003
6029
      $echo "$help" 1>&2
6004
 
      exit 1
 
6030
      exit $EXIT_FAILURE
6005
6031
    fi
6006
6032
 
6007
6033
    rmdirs=
6115
6141
        if test "$mode" = clean ; then
6116
6142
          noexename=$name
6117
6143
          case $file in
6118
 
          *.exe) 
 
6144
          *.exe)
6119
6145
            file=`$echo $file|${SED} 's,.exe$,,'`
6120
6146
            noexename=`$echo $name|${SED} 's,.exe$,,'`
6121
6147
            # $file with .exe has already been added to rmfiles,
6160
6186
  "")
6161
6187
    $echo "$modename: you must specify a MODE" 1>&2
6162
6188
    $echo "$generic_help" 1>&2
6163
 
    exit 1
 
6189
    exit $EXIT_FAILURE
6164
6190
    ;;
6165
6191
  esac
6166
6192
 
6167
6193
  if test -z "$exec_cmd"; then
6168
6194
    $echo "$modename: invalid operation mode \`$mode'" 1>&2
6169
6195
    $echo "$generic_help" 1>&2
6170
 
    exit 1
 
6196
    exit $EXIT_FAILURE
6171
6197
  fi
6172
6198
fi # test -z "$show_help"
6173
6199
 
6174
6200
if test -n "$exec_cmd"; then
6175
6201
  eval exec $exec_cmd
6176
 
  exit 1
 
6202
  exit $EXIT_FAILURE
6177
6203
fi
6178
6204
 
6179
6205
# We need to display help for each of the modes.
6209
6235
a more detailed description of MODE.
6210
6236
 
6211
6237
Report bugs to <bug-libtool@gnu.org>."
6212
 
  exit 0
 
6238
  exit $EXIT_SUCCESS
6213
6239
  ;;
6214
6240
 
6215
6241
clean)
6364
6390
*)
6365
6391
  $echo "$modename: invalid operation mode \`$mode'" 1>&2
6366
6392
  $echo "$help" 1>&2
6367
 
  exit 1
 
6393
  exit $EXIT_FAILURE
6368
6394
  ;;
6369
6395
esac
6370
6396
 
6371
6397
$echo
6372
6398
$echo "Try \`$modename --help' for more information about other modes."
6373
6399
 
6374
 
exit 0
 
6400
exit $EXIT_SUCCESS
6375
6401
 
6376
6402
# The TAGs below are defined such that we never get into a situation
6377
6403
# in which we disable both kinds of libraries.  Given conflicting