~ubuntu-branches/ubuntu/maverick/pdns/maverick-updates

« back to all changes in this revision

Viewing changes to ltmain.sh

  • Committer: Bazaar Package Importer
  • Author(s): Debian PowerDNS Maintainers
  • Date: 2005-07-29 20:24:33 UTC
  • mfrom: (1.1.1 upstream)
  • Revision ID: james.westby@ubuntu.com-20050729202433-cfrk71byx0mmmbk6
Tags: 2.9.18-1
* New upstream release (Closes: #318798)
* Drop patches: 64bit-compile-fix.dpatch, addfeatures-ldapbackend.dpatch,
  amd64-compilefix.dpatch, blankout-domain-fix.dpatch,
  consistent-sql.dpatch, dosfix-ldapbackend.dpatch, fix-exit-status.dpatch,
  gpgsql-compilefix.dpatch, gsqlite-compilefix.dpatch, gsqlite-slave.dpatch,
  recursor-slowdown.patch.dpatch, typoinitscript.dpatch, zone2ldap.dpatch
  They are applied upstream.
* The ldapbackend did not properly escape all queries, allowing it to fail
  and not answer questions. (CAN-2005-2301)
* Questions from clients denied recursion could blank out answers to clients
  who are allowed recursion services, temporarily. (CAN-2005-2302)

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