~ubuntu-branches/debian/jessie/gdb/jessie

« back to all changes in this revision

Viewing changes to ltmain.sh

  • Committer: Bazaar Package Importer
  • Author(s): Daniel Jacobowitz
  • Date: 2010-03-20 01:21:29 UTC
  • mfrom: (1.3.4 upstream)
  • Revision ID: james.westby@ubuntu.com-20100320012129-t7h25y8zgr8c2369
Tags: 7.1-1
* New upstream release, including:
  - PIE support (Closes: #346409).
  - C++ improvements, including static_cast<> et al, namespace imports,
    and bug fixes in printing virtual base classes.
  - Multi-program debugging.  One GDB can now debug multiple programs
    at the same time.
  - Python scripting improvements, including gdb.parse_and_eval.
  - Updated MIPS Linux signal frame layout (Closes: #570875).
  - No internal error stepping over _dl_debug_state (Closes: #569551).
* Update to Standards-Version: 3.8.4 (no changes required).
* Include more relevant (and smaller) docs in the gdbserver package
  (Closes: #571132).
* Do not duplicate documentation in gdb64, gdb-source, and libgdb-dev.
* Fix crash when switching into TUI mode (Closes: #568489).

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
# Generated from ltmain.m4sh.
2
2
 
3
 
# ltmain.sh (GNU libtool) 2.2.6
 
3
# libtool (GNU libtool 1.3134 2009-11-29) 2.2.7a
4
4
# Written by Gordon Matzigkeit <gord@gnu.ai.mit.edu>, 1996
5
5
 
6
 
# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005, 2006, 2007 2008 Free Software Foundation, Inc.
 
6
# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005, 2006,
 
7
# 2007, 2008, 2009 Free Software Foundation, Inc.
7
8
# This is free software; see the source for copying conditions.  There is NO
8
9
# warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
9
10
 
32
33
#
33
34
# Provide generalized library-building support services.
34
35
#
35
 
#     --config             show all configuration variables
36
 
#     --debug              enable verbose shell tracing
37
 
# -n, --dry-run            display commands without modifying any files
38
 
#     --features           display basic configuration information and exit
39
 
#     --mode=MODE          use operation mode MODE
40
 
#     --preserve-dup-deps  don't remove duplicate dependency libraries
41
 
#     --quiet, --silent    don't print informational messages
42
 
#     --tag=TAG            use configuration variables from tag TAG
43
 
# -v, --verbose            print informational messages (default)
44
 
#     --version            print version information
45
 
# -h, --help               print short or long help message
 
36
#       --config             show all configuration variables
 
37
#       --debug              enable verbose shell tracing
 
38
#   -n, --dry-run            display commands without modifying any files
 
39
#       --features           display basic configuration information and exit
 
40
#       --mode=MODE          use operation mode MODE
 
41
#       --no-finish          let install mode avoid finish commands
 
42
#       --preserve-dup-deps  don't remove duplicate dependency libraries
 
43
#       --quiet, --silent    don't print informational messages
 
44
#       --no-quiet, --no-silent
 
45
#                            print informational messages (default)
 
46
#       --tag=TAG            use configuration variables from tag TAG
 
47
#   -v, --verbose            print more informational messages than default
 
48
#       --no-verbose         don't print the extra informational messages
 
49
#       --version            print version information
 
50
#   -h, --help, --help-all   print short, long, or detailed help message
46
51
#
47
52
# MODE must be one of the following:
48
53
#
49
 
#       clean              remove files from the build directory
50
 
#       compile            compile a source file into a libtool object
51
 
#       execute            automatically set library path, then run a program
52
 
#       finish             complete the installation of libtool libraries
53
 
#       install            install libraries or executables
54
 
#       link               create a library or an executable
55
 
#       uninstall          remove libraries from an installed directory
 
54
#         clean              remove files from the build directory
 
55
#         compile            compile a source file into a libtool object
 
56
#         execute            automatically set library path, then run a program
 
57
#         finish             complete the installation of libtool libraries
 
58
#         install            install libraries or executables
 
59
#         link               create a library or an executable
 
60
#         uninstall          remove libraries from an installed directory
56
61
#
57
 
# MODE-ARGS vary depending on the MODE.
 
62
# MODE-ARGS vary depending on the MODE.  When passed as first option,
 
63
# `--mode=MODE' may be abbreviated as `MODE' or a unique abbreviation of that.
58
64
# Try `$progname --help --mode=MODE' for a more detailed description of MODE.
59
65
#
60
66
# When reporting a bug, please describe a test case to reproduce it and
61
67
# include the following information:
62
68
#
63
 
#       host-triplet:   $host
64
 
#       shell:          $SHELL
65
 
#       compiler:               $LTCC
66
 
#       compiler flags:         $LTCFLAGS
67
 
#       linker:         $LD (gnu? $with_gnu_ld)
68
 
#       $progname:              (GNU libtool) 2.2.6
69
 
#       automake:               $automake_version
70
 
#       autoconf:               $autoconf_version
 
69
#         host-triplet: $host
 
70
#         shell:                $SHELL
 
71
#         compiler:             $LTCC
 
72
#         compiler flags:               $LTCFLAGS
 
73
#         linker:               $LD (gnu? $with_gnu_ld)
 
74
#         $progname:    (GNU libtool 1.3134 2009-11-29) 2.2.7a
 
75
#         automake:     $automake_version
 
76
#         autoconf:     $autoconf_version
71
77
#
72
78
# Report bugs to <bug-libtool@gnu.org>.
73
79
 
74
 
PROGRAM=ltmain.sh
 
80
PROGRAM=libtool
75
81
PACKAGE=libtool
76
 
VERSION=2.2.6
77
 
TIMESTAMP=""
78
 
package_revision=1.3012
 
82
VERSION=2.2.7a
 
83
TIMESTAMP=" 1.3134 2009-11-29"
 
84
package_revision=1.3134
79
85
 
80
86
# Be Bourne compatible
81
87
if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then
91
97
BIN_SH=xpg4; export BIN_SH # for Tru64
92
98
DUALCASE=1; export DUALCASE # for MKS sh
93
99
 
 
100
# A function that is used when there is no print builtin or printf.
 
101
func_fallback_echo ()
 
102
{
 
103
  eval 'cat <<_LTECHO_EOF
 
104
$1
 
105
_LTECHO_EOF'
 
106
}
 
107
 
94
108
# NLS nuisances: We save the old values to restore during execute mode.
95
109
# Only set LANG and LC_ALL to C if already set.
96
110
# These must not be set unconditionally because not all systems understand
114
128
 
115
129
 
116
130
 
 
131
 
 
132
 
 
133
# Work around backward compatibility issue on IRIX 6.5. On IRIX 6.4+, sh
 
134
# is ksh but when the shell is invoked as "sh" and the current value of
 
135
# the _XPG environment variable is not equal to 1 (one), the special
 
136
# positional parameter $0, within a function call, is the name of the
 
137
# function.
 
138
progpath="$0"
 
139
 
 
140
 
 
141
 
117
142
: ${CP="cp -f"}
118
 
: ${ECHO="echo"}
119
 
: ${EGREP="/usr/bin/grep -E"}
120
 
: ${FGREP="/usr/bin/grep -F"}
121
 
: ${GREP="/usr/bin/grep"}
 
143
: ${ECHO=$as_echo}
 
144
: ${EGREP="/bin/grep -E"}
 
145
: ${FGREP="/bin/grep -F"}
 
146
: ${GREP="/bin/grep"}
122
147
: ${LN_S="ln -s"}
123
148
: ${MAKE="make"}
124
149
: ${MKDIR="mkdir"}
125
150
: ${MV="mv -f"}
126
151
: ${RM="rm -f"}
127
 
: ${SED="/opt/local/bin/gsed"}
 
152
: ${SED="/mount/endor/wildenhu/local-x86_64/bin/sed"}
128
153
: ${SHELL="${CONFIG_SHELL-/bin/sh}"}
129
154
: ${Xsed="$SED -e 1s/^X//"}
130
155
 
159
184
func_dirname_and_basename ()
160
185
{
161
186
  # Extract subdirectory from the argument.
162
 
  func_dirname_result=`$ECHO "X${1}" | $Xsed -e "$dirname"`
 
187
  func_dirname_result=`$ECHO "${1}" | $SED -e "$dirname"`
163
188
  if test "X$func_dirname_result" = "X${1}"; then
164
189
    func_dirname_result="${3}"
165
190
  else
166
191
    func_dirname_result="$func_dirname_result${2}"
167
192
  fi
168
 
  func_basename_result=`$ECHO "X${1}" | $Xsed -e "$basename"`
 
193
  func_basename_result=`$ECHO "${1}" | $SED -e "$basename"`
169
194
}
170
195
 
171
196
# Generated shell functions inserted here.
172
197
 
173
198
# These SED scripts presuppose an absolute path with a trailing slash.
174
 
pathcar="s,^/\([^/]*\).*$,\1,"
175
 
pathcdr="s,^/[^/]*,,"
176
 
removedotparts="s@/\(\./\)\{1,\}@/@g;s,/\.$,/,"
177
 
collapseslashes="s@/\{1,\}@/@g"
178
 
finalslash="s,/*$,/,"
 
199
pathcar='s,^/\([^/]*\).*$,\1,'
 
200
pathcdr='s,^/[^/]*,,'
 
201
removedotparts=':dotsl
 
202
                s@/\./@/@g
 
203
                t dotsl
 
204
                s,/\.$,/,'
 
205
collapseslashes='s@/\{1,\}@/@g'
 
206
finalslash='s,/*$,/,'
179
207
 
180
208
# func_normal_abspath PATH
181
209
# Remove doubled-up and trailing slashes, "." path components,
315
343
  fi
316
344
}
317
345
 
318
 
# Work around backward compatibility issue on IRIX 6.5. On IRIX 6.4+, sh
319
 
# is ksh but when the shell is invoked as "sh" and the current value of
320
 
# the _XPG environment variable is not equal to 1 (one), the special
321
 
# positional parameter $0, within a function call, is the name of the
322
 
# function.
323
 
progpath="$0"
324
 
 
325
346
# The name of this program:
326
 
# In the unlikely event $progname began with a '-', it would play havoc with
327
 
# func_echo (imagine progname=-n), so we prepend ./ in that case:
328
347
func_dirname_and_basename "$progpath"
329
348
progname=$func_basename_result
330
 
case $progname in
331
 
  -*) progname=./$progname ;;
332
 
esac
333
349
 
334
350
# Make sure we have an absolute path for reexecution:
335
351
case $progpath in
403
419
    :
404
420
}
405
421
 
 
422
# func_echo_all arg...
 
423
# Invoke $ECHO with all args, space-separated.
 
424
func_echo_all ()
 
425
{
 
426
    $ECHO "$*"
 
427
}
 
428
 
406
429
# func_error arg...
407
430
# Echo program name prefixed message to standard error.
408
431
func_error ()
471
494
        case $my_directory_path in */*) ;; *) break ;; esac
472
495
 
473
496
        # ...otherwise throw away the child directory and loop
474
 
        my_directory_path=`$ECHO "X$my_directory_path" | $Xsed -e "$dirname"`
 
497
        my_directory_path=`$ECHO "$my_directory_path" | $SED -e "$dirname"`
475
498
      done
476
 
      my_dir_list=`$ECHO "X$my_dir_list" | $Xsed -e 's,:*$,,'`
 
499
      my_dir_list=`$ECHO "$my_dir_list" | $SED 's,:*$,,'`
477
500
 
478
501
      save_mkdir_p_IFS="$IFS"; IFS=':'
479
502
      for my_dir in $my_dir_list; do
523
546
        func_fatal_error "cannot create temporary directory \`$my_tmpdir'"
524
547
    fi
525
548
 
526
 
    $ECHO "X$my_tmpdir" | $Xsed
 
549
    $ECHO "$my_tmpdir"
527
550
}
528
551
 
529
552
 
537
560
{
538
561
    case $1 in
539
562
      *[\\\`\"\$]*)
540
 
        func_quote_for_eval_unquoted_result=`$ECHO "X$1" | $Xsed -e "$sed_quote_subst"` ;;
 
563
        func_quote_for_eval_unquoted_result=`$ECHO "$1" | $SED "$sed_quote_subst"` ;;
541
564
      *)
542
565
        func_quote_for_eval_unquoted_result="$1" ;;
543
566
    esac
564
587
{
565
588
    case $1 in
566
589
      *[\\\`\"]*)
567
 
        my_arg=`$ECHO "X$1" | $Xsed \
 
590
        my_arg=`$ECHO "$1" | $SED \
568
591
            -e "$double_quote_subst" -e "$sed_double_backslash"` ;;
569
592
      *)
570
593
        my_arg="$1" ;;
641
664
# Echo version message to standard output and exit.
642
665
func_version ()
643
666
{
644
 
    $SED -n '/^# '$PROGRAM' (GNU /,/# warranty; / {
 
667
    $SED -n '/(C)/!b go
 
668
        :more
 
669
        /\./!{
 
670
          N
 
671
          s/\n# //
 
672
          b more
 
673
        }
 
674
        :go
 
675
        /^# '$PROGRAM' (GNU /,/# warranty; / {
645
676
        s/^# //
646
677
        s/^# *$//
647
678
        s/\((C)\)[ 0-9,-]*\( [1-9][0-9]*\)/\1\2/
654
685
# Echo short help message to standard output and exit.
655
686
func_usage ()
656
687
{
657
 
    $SED -n '/^# Usage:/,/# -h/ {
 
688
    $SED -n '/^# Usage:/,/^#  *-h/ {
658
689
        s/^# //
659
690
        s/^# *$//
660
691
        s/\$progname/'$progname'/
661
692
        p
662
693
    }' < "$progpath"
663
 
    $ECHO
 
694
    echo
664
695
    $ECHO "run \`$progname --help | more' for full usage"
665
696
    exit $?
666
697
}
667
698
 
668
 
# func_help
669
 
# Echo long help message to standard output and exit.
 
699
# func_help [NOEXIT]
 
700
# Echo long help message to standard output and exit,
 
701
# unless 'noexit' is passed as argument.
670
702
func_help ()
671
703
{
672
704
    $SED -n '/^# Usage:/,/# Report bugs to/ {
683
715
        s/\$autoconf_version/'"`(autoconf --version) 2>/dev/null |$SED 1q`"'/
684
716
        p
685
717
     }' < "$progpath"
686
 
    exit $?
 
718
    ret=$?
 
719
    if test -z "$1"; then
 
720
      exit $ret
 
721
    fi
687
722
}
688
723
 
689
724
# func_missing_arg argname
701
736
 
702
737
 
703
738
 
704
 
# Check that we have a working $ECHO.
705
 
if test "X$1" = X--no-reexec; then
706
 
  # Discard the --no-reexec flag, and continue.
707
 
  shift
708
 
elif test "X$1" = X--fallback-echo; then
709
 
  # Avoid inline document here, it may be left over
710
 
  :
711
 
elif test "X`{ $ECHO '\t'; } 2>/dev/null`" = 'X\t'; then
712
 
  # Yippee, $ECHO works!
713
 
  :
714
 
else
715
 
  # Restart under the correct shell, and then maybe $ECHO will work.
716
 
  exec $SHELL "$progpath" --no-reexec ${1+"$@"}
717
 
fi
718
 
 
719
 
if test "X$1" = X--fallback-echo; then
720
 
  # used as fallback echo
721
 
  shift
722
 
  cat <<EOF
723
 
$*
724
 
EOF
725
 
  exit $EXIT_SUCCESS
726
 
fi
727
739
 
728
740
magic="%%%MAGIC variable%%%"
729
741
magic_exe="%%%MAGIC EXE variable%%%"
739
751
extracted_serial=0
740
752
 
741
753
opt_dry_run=false
 
754
opt_finish=:
742
755
opt_duplicate_deps=false
743
756
opt_silent=false
744
757
opt_debug=:
781
794
# Display the features supported by this script.
782
795
func_features ()
783
796
{
784
 
    $ECHO "host: $host"
 
797
    echo "host: $host"
785
798
    if test "$build_libtool_libs" = yes; then
786
 
      $ECHO "enable shared libraries"
 
799
      echo "enable shared libraries"
787
800
    else
788
 
      $ECHO "disable shared libraries"
 
801
      echo "disable shared libraries"
789
802
    fi
790
803
    if test "$build_old_libs" = yes; then
791
 
      $ECHO "enable static libraries"
 
804
      echo "enable static libraries"
792
805
    else
793
 
      $ECHO "disable static libraries"
 
806
      echo "disable static libraries"
794
807
    fi
795
808
 
796
809
    exit $?
888
901
      --dry-run | -n)   opt_dry_run=:                                   ;;
889
902
      --features)       func_features                                   ;;
890
903
      --finish)         mode="finish"                                   ;;
 
904
      --no-finish)      opt_finish=false                                ;;
891
905
 
892
906
      --mode)           test "$#" -eq 0 && func_missing_arg "$opt" && break
893
907
                        case $1 in
917
931
 
918
932
      --quiet|--silent) preserve_args="$preserve_args $opt"
919
933
                        opt_silent=:
 
934
                        opt_verbose=false
 
935
                        ;;
 
936
 
 
937
      --no-quiet|--no-silent)
 
938
                        preserve_args="$preserve_args $opt"
 
939
                        opt_silent=false
920
940
                        ;;
921
941
 
922
942
      --verbose| -v)    preserve_args="$preserve_args $opt"
923
943
                        opt_silent=false
 
944
                        opt_verbose=:
 
945
                        ;;
 
946
 
 
947
      --no-verbose)     preserve_args="$preserve_args $opt"
 
948
                        opt_verbose=false
924
949
                        ;;
925
950
 
926
951
      --tag)            test "$#" -eq 0 && func_missing_arg "$opt" && break
938
963
 
939
964
      -\?|-h)           func_usage                                      ;;
940
965
      --help)           opt_help=:                                      ;;
 
966
      --help-all)       opt_help=': help-all'                           ;;
941
967
      --version)        func_version                                    ;;
942
968
 
943
969
      -*)               func_fatal_help "unrecognized option \`$opt'"   ;;
1016
1042
 
1017
1043
 
1018
1044
  # Darwin sucks
1019
 
  eval std_shrext=\"$shrext_cmds\"
 
1045
  eval "std_shrext=\"$shrext_cmds\""
1020
1046
 
1021
1047
 
1022
1048
  # Only execute mode is allowed to have -dlopen flags.
1123
1149
    save_ifs=$IFS; IFS='~'
1124
1150
    for cmd in $1; do
1125
1151
      IFS=$save_ifs
1126
 
      eval cmd=\"$cmd\"
 
1152
      eval "cmd=\"$cmd\""
1127
1153
      func_show_eval "$cmd" "${2-:}"
1128
1154
    done
1129
1155
    IFS=$save_ifs
1161
1187
        func_quote_for_eval "$arg"
1162
1188
        CC_quoted="$CC_quoted $func_quote_for_eval_result"
1163
1189
      done
 
1190
      CC_expanded=`func_echo_all $CC`
 
1191
      CC_quoted_expanded=`func_echo_all $CC_quoted`
1164
1192
      case $@ in
1165
1193
      # Blanks in the command may have been stripped by the calling shell,
1166
1194
      # but not from the CC environment variable when configure was run.
1167
 
      " $CC "* | "$CC "* | " `$ECHO $CC` "* | "`$ECHO $CC` "* | " $CC_quoted"* | "$CC_quoted "* | " `$ECHO $CC_quoted` "* | "`$ECHO $CC_quoted` "*) ;;
 
1195
      " $CC "* | "$CC "* | " $CC_expanded "* | "$CC_expanded "* | \
 
1196
      " $CC_quoted"* | "$CC_quoted "* | " $CC_quoted_expanded "* | "$CC_quoted_expanded "*) ;;
1168
1197
      # Blanks at the start of $base_compile will cause this to fail
1169
1198
      # if we don't check for them as well.
1170
1199
      *)
1178
1207
              func_quote_for_eval "$arg"
1179
1208
              CC_quoted="$CC_quoted $func_quote_for_eval_result"
1180
1209
            done
 
1210
            CC_expanded=`func_echo_all $CC`
 
1211
            CC_quoted_expanded=`func_echo_all $CC_quoted`
1181
1212
            case "$@ " in
1182
 
              " $CC "* | "$CC "* | " `$ECHO $CC` "* | "`$ECHO $CC` "* | " $CC_quoted"* | "$CC_quoted "* | " `$ECHO $CC_quoted` "* | "`$ECHO $CC_quoted` "*)
 
1213
            " $CC "* | "$CC "* | " $CC_expanded "* | "$CC_expanded "* | \
 
1214
            " $CC_quoted"* | "$CC_quoted "* | " $CC_quoted_expanded "* | "$CC_quoted_expanded "*)
1183
1215
              # The compiler in the base compile command matches
1184
1216
              # the one in the tagged configuration.
1185
1217
              # Assume this is the tagged configuration we want.
1358
1390
    *.[cCFSifmso] | \
1359
1391
    *.ada | *.adb | *.ads | *.asm | \
1360
1392
    *.c++ | *.cc | *.ii | *.class | *.cpp | *.cxx | \
1361
 
    *.[fF][09]? | *.for | *.java | *.obj | *.sx)
 
1393
    *.[fF][09]? | *.for | *.java | *.obj | *.sx | *.cu | *.cup)
1362
1394
      func_xform "$libobj"
1363
1395
      libobj=$func_xform_result
1364
1396
      ;;
1433
1465
    # Calculate the filename of the output object if compiler does
1434
1466
    # not support -o with -c
1435
1467
    if test "$compiler_c_o" = no; then
1436
 
      output_obj=`$ECHO "X$srcfile" | $Xsed -e 's%^.*/%%' -e 's%\.[^.]*$%%'`.${objext}
 
1468
      output_obj=`$ECHO "$srcfile" | $SED 's%^.*/%%; s%\.[^.]*$%%'`.${objext}
1437
1469
      lockfile="$output_obj.lock"
1438
1470
    else
1439
1471
      output_obj=
1473
1505
    trap '$opt_dry_run || $RM $removelist; exit $EXIT_FAILURE' 1 2 15
1474
1506
 
1475
1507
    if test -n "$fix_srcfile_path"; then
1476
 
      eval srcfile=\"$fix_srcfile_path\"
 
1508
      eval "srcfile=\"$fix_srcfile_path\""
1477
1509
    fi
1478
1510
    func_quote_for_eval "$srcfile"
1479
1511
    qsrcfile=$func_quote_for_eval_result
1590
1622
}
1591
1623
 
1592
1624
$opt_help || {
1593
 
test "$mode" = compile && func_mode_compile ${1+"$@"}
 
1625
  test "$mode" = compile && func_mode_compile ${1+"$@"}
1594
1626
}
1595
1627
 
1596
1628
func_mode_help ()
1631
1663
  -prefer-non-pic   try to building non-PIC objects only
1632
1664
  -shared           do not build a \`.o' file suitable for static linking
1633
1665
  -static           only build a \`.o' file suitable for static linking
 
1666
  -Wc,FLAG          pass FLAG directly to the compiler
1634
1667
 
1635
1668
COMPILE-COMMAND is a command to be used in creating a \`standard' object file
1636
1669
from the given SOURCEFILE.
1683
1716
 
1684
1717
The following components of INSTALL-COMMAND are treated specially:
1685
1718
 
1686
 
  -inst-prefix PREFIX-DIR  Use PREFIX-DIR as a staging area for installation
 
1719
  -inst-prefix-dir PREFIX-DIR  Use PREFIX-DIR as a staging area for installation
1687
1720
 
1688
1721
The rest of the components are interpreted as arguments to that command (only
1689
1722
BSD-compatible install options are recognized)."
1733
1766
  -version-info CURRENT[:REVISION[:AGE]]
1734
1767
                    specify library version info [each variable defaults to 0]
1735
1768
  -weak LIBNAME     declare that the target provides the LIBNAME interface
 
1769
  -Wc,FLAG
 
1770
  -Xcompiler FLAG   pass linker-specific FLAG directly to the compiler
 
1771
  -Wl,FLAG
 
1772
  -Xlinker FLAG     pass linker-specific FLAG directly to the linker
 
1773
  -XCClinker FLAG   pass link-specific FLAG to the compiler driver (CC)
1736
1774
 
1737
1775
All other options (arguments beginning with \`-') are ignored.
1738
1776
 
1770
1808
        ;;
1771
1809
    esac
1772
1810
 
1773
 
    $ECHO
 
1811
    echo
1774
1812
    $ECHO "Try \`$progname --help' for more information about other modes."
1775
 
 
1776
 
    exit $?
1777
1813
}
1778
1814
 
1779
 
  # Now that we've collected a possible --mode arg, show help if necessary
1780
 
  $opt_help && func_mode_help
 
1815
# Now that we've collected a possible --mode arg, show help if necessary
 
1816
if $opt_help; then
 
1817
  if test "$opt_help" = :; then
 
1818
    func_mode_help
 
1819
  else
 
1820
    {
 
1821
      func_help noexit
 
1822
      for mode in compile link execute install finish uninstall clean; do
 
1823
        func_mode_help
 
1824
      done
 
1825
    } | sed -n '1p; 2,$s/^Usage:/  or: /p'
 
1826
    {
 
1827
      func_help noexit
 
1828
      for mode in compile link execute install finish uninstall clean; do
 
1829
        echo
 
1830
        func_mode_help
 
1831
      done
 
1832
    } |
 
1833
    sed '1d
 
1834
      /^When reporting/,/^Report/{
 
1835
        H
 
1836
        d
 
1837
      }
 
1838
      $x
 
1839
      /information about other modes/d
 
1840
      /more detailed .*MODE/d
 
1841
      s/^Usage:.*--mode=\([^ ]*\) .*/Description of \1 mode:/'
 
1842
  fi
 
1843
  exit $?
 
1844
fi
1781
1845
 
1782
1846
 
1783
1847
# func_mode_execute arg...
1843
1907
      test -n "$absdir" && dir="$absdir"
1844
1908
 
1845
1909
      # Now add the directory to shlibpath_var.
1846
 
      if eval "test -z \"\$$shlibpath_var\""; then
1847
 
        eval "$shlibpath_var=\"\$dir\""
 
1910
      if eval test -z \"\$$shlibpath_var\"; then
 
1911
        eval $shlibpath_var=\$dir
1848
1912
      else
1849
 
        eval "$shlibpath_var=\"\$dir:\$$shlibpath_var\""
 
1913
        eval $shlibpath_var=\$dir:\$$shlibpath_var
1850
1914
      fi
1851
1915
    done
1852
1916
 
1859
1923
    for file
1860
1924
    do
1861
1925
      case $file in
1862
 
      -*) ;;
 
1926
      -* | *.la | *.lo ) ;;
1863
1927
      *)
1864
1928
        # Do a test to see if this is really a libtool program.
1865
1929
        if func_ltwrapper_script_p "$file"; then
1901
1965
      # Display what would be done.
1902
1966
      if test -n "$shlibpath_var"; then
1903
1967
        eval "\$ECHO \"\$shlibpath_var=\$$shlibpath_var\""
1904
 
        $ECHO "export $shlibpath_var"
 
1968
        echo "export $shlibpath_var"
1905
1969
      fi
1906
1970
      $ECHO "$cmd$args"
1907
1971
      exit $EXIT_SUCCESS
1942
2006
    # Exit here if they wanted silent mode.
1943
2007
    $opt_silent && exit $EXIT_SUCCESS
1944
2008
 
1945
 
    $ECHO "X----------------------------------------------------------------------" | $Xsed
1946
 
    $ECHO "Libraries have been installed in:"
 
2009
    echo "----------------------------------------------------------------------"
 
2010
    echo "Libraries have been installed in:"
1947
2011
    for libdir in $libdirs; do
1948
2012
      $ECHO "   $libdir"
1949
2013
    done
1950
 
    $ECHO
1951
 
    $ECHO "If you ever happen to want to link against installed libraries"
1952
 
    $ECHO "in a given directory, LIBDIR, you must either use libtool, and"
1953
 
    $ECHO "specify the full pathname of the library, or use the \`-LLIBDIR'"
1954
 
    $ECHO "flag during linking and do at least one of the following:"
 
2014
    echo
 
2015
    echo "If you ever happen to want to link against installed libraries"
 
2016
    echo "in a given directory, LIBDIR, you must either use libtool, and"
 
2017
    echo "specify the full pathname of the library, or use the \`-LLIBDIR'"
 
2018
    echo "flag during linking and do at least one of the following:"
1955
2019
    if test -n "$shlibpath_var"; then
1956
 
      $ECHO "   - add LIBDIR to the \`$shlibpath_var' environment variable"
1957
 
      $ECHO "     during execution"
 
2020
      echo "   - add LIBDIR to the \`$shlibpath_var' environment variable"
 
2021
      echo "     during execution"
1958
2022
    fi
1959
2023
    if test -n "$runpath_var"; then
1960
 
      $ECHO "   - add LIBDIR to the \`$runpath_var' environment variable"
1961
 
      $ECHO "     during linking"
 
2024
      echo "   - add LIBDIR to the \`$runpath_var' environment variable"
 
2025
      echo "     during linking"
1962
2026
    fi
1963
2027
    if test -n "$hardcode_libdir_flag_spec"; then
1964
2028
      libdir=LIBDIR
1965
 
      eval flag=\"$hardcode_libdir_flag_spec\"
 
2029
      eval "flag=\"$hardcode_libdir_flag_spec\""
1966
2030
 
1967
2031
      $ECHO "   - use the \`$flag' linker flag"
1968
2032
    fi
1970
2034
      $ECHO "   - have your system administrator run these commands:$admincmds"
1971
2035
    fi
1972
2036
    if test -f /etc/ld.so.conf; then
1973
 
      $ECHO "   - have your system administrator add LIBDIR to \`/etc/ld.so.conf'"
 
2037
      echo "   - have your system administrator add LIBDIR to \`/etc/ld.so.conf'"
1974
2038
    fi
1975
 
    $ECHO
 
2039
    echo
1976
2040
 
1977
 
    $ECHO "See any operating system documentation about shared libraries for"
 
2041
    echo "See any operating system documentation about shared libraries for"
1978
2042
    case $host in
1979
2043
      solaris2.[6789]|solaris2.1[0-9])
1980
 
        $ECHO "more information, such as the ld(1), crle(1) and ld.so(8) manual"
1981
 
        $ECHO "pages."
 
2044
        echo "more information, such as the ld(1), crle(1) and ld.so(8) manual"
 
2045
        echo "pages."
1982
2046
        ;;
1983
2047
      *)
1984
 
        $ECHO "more information, such as the ld(1) and ld.so(8) manual pages."
 
2048
        echo "more information, such as the ld(1) and ld.so(8) manual pages."
1985
2049
        ;;
1986
2050
    esac
1987
 
    $ECHO "X----------------------------------------------------------------------" | $Xsed
 
2051
    echo "----------------------------------------------------------------------"
1988
2052
    exit $EXIT_SUCCESS
1989
2053
}
1990
2054
 
1999
2063
    # install_prog (especially on Windows NT).
2000
2064
    if test "$nonopt" = "$SHELL" || test "$nonopt" = /bin/sh ||
2001
2065
       # Allow the use of GNU shtool's install command.
2002
 
       $ECHO "X$nonopt" | $GREP shtool >/dev/null; then
 
2066
       case $nonopt in *shtool*) :;; *) false;; esac; then
2003
2067
      # Aesthetically quote it.
2004
2068
      func_quote_for_eval "$nonopt"
2005
2069
      install_prog="$func_quote_for_eval_result "
2014
2078
    # Aesthetically quote it.
2015
2079
    func_quote_for_eval "$arg"
2016
2080
    install_prog="$install_prog$func_quote_for_eval_result"
 
2081
    install_shared_prog=$install_prog
 
2082
    case " $install_prog " in
 
2083
      *[\\\ /]cp\ *) install_cp=: ;;
 
2084
      *) install_cp=false ;;
 
2085
    esac
2017
2086
 
2018
2087
    # We need to accept at least all the BSD install flags.
2019
2088
    dest=
2023
2092
    install_type=
2024
2093
    isdir=no
2025
2094
    stripme=
 
2095
    no_mode=:
2026
2096
    for arg
2027
2097
    do
 
2098
      arg2=
2028
2099
      if test -n "$dest"; then
2029
2100
        files="$files $dest"
2030
2101
        dest=$arg
2034
2105
      case $arg in
2035
2106
      -d) isdir=yes ;;
2036
2107
      -f)
2037
 
        case " $install_prog " in
2038
 
        *[\\\ /]cp\ *) ;;
2039
 
        *) prev=$arg ;;
2040
 
        esac
 
2108
        if $install_cp; then :; else
 
2109
          prev=$arg
 
2110
        fi
2041
2111
        ;;
2042
2112
      -g | -m | -o)
2043
2113
        prev=$arg
2051
2121
      *)
2052
2122
        # If the previous option needed an argument, then skip it.
2053
2123
        if test -n "$prev"; then
 
2124
          if test "x$prev" = x-m && test -n "$install_override_mode"; then
 
2125
            arg2=$install_override_mode
 
2126
            no_mode=false
 
2127
          fi
2054
2128
          prev=
2055
2129
        else
2056
2130
          dest=$arg
2062
2136
      # Aesthetically quote the argument.
2063
2137
      func_quote_for_eval "$arg"
2064
2138
      install_prog="$install_prog $func_quote_for_eval_result"
 
2139
      if test -n "$arg2"; then
 
2140
        func_quote_for_eval "$arg2"
 
2141
      fi
 
2142
      install_shared_prog="$install_shared_prog $func_quote_for_eval_result"
2065
2143
    done
2066
2144
 
2067
2145
    test -z "$install_prog" && \
2070
2148
    test -n "$prev" && \
2071
2149
      func_fatal_help "the \`$prev' option requires an argument"
2072
2150
 
 
2151
    if test -n "$install_override_mode" && $no_mode; then
 
2152
      if $install_cp; then :; else
 
2153
        func_quote_for_eval "$install_override_mode"
 
2154
        install_shared_prog="$install_shared_prog -m $func_quote_for_eval_result"
 
2155
      fi
 
2156
    fi
 
2157
 
2073
2158
    if test -z "$files"; then
2074
2159
      if test -z "$dest"; then
2075
2160
        func_fatal_help "no file or destination specified"
2157
2242
 
2158
2243
        if test -n "$relink_command"; then
2159
2244
          # Determine the prefix the user has applied to our future dir.
2160
 
          inst_prefix_dir=`$ECHO "X$destdir" | $Xsed -e "s%$libdir\$%%"`
 
2245
          inst_prefix_dir=`$ECHO "$destdir" | $SED -e "s%$libdir\$%%"`
2161
2246
 
2162
2247
          # Don't allow the user to place us outside of our expected
2163
2248
          # location b/c this prevents finding dependent libraries that
2170
2255
 
2171
2256
          if test -n "$inst_prefix_dir"; then
2172
2257
            # Stick the inst_prefix_dir data into the link command.
2173
 
            relink_command=`$ECHO "X$relink_command" | $Xsed -e "s%@inst_prefix_dir@%-inst-prefix-dir $inst_prefix_dir%"`
 
2258
            relink_command=`$ECHO "$relink_command" | $SED "s%@inst_prefix_dir@%-inst-prefix-dir $inst_prefix_dir%"`
2174
2259
          else
2175
 
            relink_command=`$ECHO "X$relink_command" | $Xsed -e "s%@inst_prefix_dir@%%"`
 
2260
            relink_command=`$ECHO "$relink_command" | $SED "s%@inst_prefix_dir@%%"`
2176
2261
          fi
2177
2262
 
2178
2263
          func_warning "relinking \`$file'"
2190
2275
          test -n "$relink_command" && srcname="$realname"T
2191
2276
 
2192
2277
          # Install the shared library and build the symlinks.
2193
 
          func_show_eval "$install_prog $dir/$srcname $destdir/$realname" \
 
2278
          func_show_eval "$install_shared_prog $dir/$srcname $destdir/$realname" \
2194
2279
              'exit $?'
2195
2280
          tstripme="$stripme"
2196
2281
          case $host_os in
2330
2415
            if test -f "$lib"; then
2331
2416
              func_source "$lib"
2332
2417
            fi
2333
 
            libfile="$libdir/"`$ECHO "X$lib" | $Xsed -e 's%^.*/%%g'` ### testsuite: skip nested quoting test
 
2418
            libfile="$libdir/"`$ECHO "$lib" | $SED 's%^.*/%%g'` ### testsuite: skip nested quoting test
2334
2419
            if test -n "$libdir" && test ! -f "$libfile"; then
2335
2420
              func_warning "\`$lib' has not been installed in \`$libdir'"
2336
2421
              finalize=no
2349
2434
                file="$func_basename_result"
2350
2435
                outputname="$tmpdir/$file"
2351
2436
                # Replace the output file specification.
2352
 
                relink_command=`$ECHO "X$relink_command" | $Xsed -e 's%@OUTPUT@%'"$outputname"'%g'`
 
2437
                relink_command=`$ECHO "$relink_command" | $SED 's%@OUTPUT@%'"$outputname"'%g'`
2353
2438
 
2354
2439
                $opt_silent || {
2355
2440
                  func_quote_for_expand "$relink_command"
2368
2453
            }
2369
2454
          else
2370
2455
            # Install the binary that we compiled earlier.
2371
 
            file=`$ECHO "X$file$stripped_ext" | $Xsed -e "s%\([^/]*\)$%$objdir/\1%"`
 
2456
            file=`$ECHO "$file$stripped_ext" | $SED "s%\([^/]*\)$%$objdir/\1%"`
2372
2457
          fi
2373
2458
        fi
2374
2459
 
2418
2503
    test -n "$future_libdirs" && \
2419
2504
      func_warning "remember to run \`$progname --finish$future_libdirs'"
2420
2505
 
2421
 
    if test -n "$current_libdirs"; then
 
2506
    if test -n "$current_libdirs" && $opt_finish; then
2422
2507
      # Maybe just do a dry run.
2423
2508
      $opt_dry_run && current_libdirs=" -n$current_libdirs"
2424
2509
      exec_cmd='$SHELL $progpath $preserve_args --finish$current_libdirs'
2470
2555
extern \"C\" {
2471
2556
#endif
2472
2557
 
 
2558
#if defined(__GNUC__) && (((__GNUC__ == 4) && (__GNUC_MINOR__ >= 4)) || (__GNUC__ > 4))
 
2559
#pragma GCC diagnostic ignored \"-Wstrict-prototypes\"
 
2560
#endif
 
2561
 
2473
2562
/* External symbol declarations for the compiler. */\
2474
2563
"
2475
2564
 
2479
2568
          $opt_dry_run || echo ': @PROGRAM@ ' > "$nlist"
2480
2569
 
2481
2570
          # Add our own program objects to the symbol list.
2482
 
          progfiles=`$ECHO "X$objs$old_deplibs" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP`
 
2571
          progfiles=`$ECHO "$objs$old_deplibs" | $SP2NL | $SED "$lo2o" | $NL2SP`
2483
2572
          for progfile in $progfiles; do
2484
2573
            func_verbose "extracting global C symbols from \`$progfile'"
2485
2574
            $opt_dry_run || eval "$NM $progfile | $global_symbol_pipe >> '$nlist'"
2487
2576
 
2488
2577
          if test -n "$exclude_expsyms"; then
2489
2578
            $opt_dry_run || {
2490
 
              eval '$EGREP -v " ($exclude_expsyms)$" "$nlist" > "$nlist"T'
2491
 
              eval '$MV "$nlist"T "$nlist"'
 
2579
              $EGREP -v " ($exclude_expsyms)$" "$nlist" > "$nlist"T
 
2580
              $MV "$nlist"T "$nlist"
2492
2581
            }
2493
2582
          fi
2494
2583
 
2495
2584
          if test -n "$export_symbols_regex"; then
2496
2585
            $opt_dry_run || {
2497
 
              eval '$EGREP -e "$export_symbols_regex" "$nlist" > "$nlist"T'
2498
 
              eval '$MV "$nlist"T "$nlist"'
 
2586
              $EGREP -e "$export_symbols_regex" "$nlist" > "$nlist"T
 
2587
              $MV "$nlist"T "$nlist"
2499
2588
            }
2500
2589
          fi
2501
2590
 
2504
2593
            export_symbols="$output_objdir/$outputname.exp"
2505
2594
            $opt_dry_run || {
2506
2595
              $RM $export_symbols
2507
 
              eval "${SED} -n -e '/^: @PROGRAM@ $/d' -e 's/^.* \(.*\)$/\1/p' "'< "$nlist" > "$export_symbols"'
 
2596
              ${SED} -n -e '/^: @PROGRAM@ $/d' -e 's/^.* \(.*\)$/\1/p' < "$nlist" > "$export_symbols"
2508
2597
              case $host in
2509
2598
              *cygwin* | *mingw* | *cegcc* )
2510
 
                eval "echo EXPORTS "'> "$output_objdir/$outputname.def"'
2511
 
                eval 'cat "$export_symbols" >> "$output_objdir/$outputname.def"'
 
2599
                echo EXPORTS > "$output_objdir/$outputname.def"
 
2600
                cat "$export_symbols" >> "$output_objdir/$outputname.def"
2512
2601
                ;;
2513
2602
              esac
2514
2603
            }
2515
2604
          else
2516
2605
            $opt_dry_run || {
2517
 
              eval "${SED} -e 's/\([].[*^$]\)/\\\\\1/g' -e 's/^/ /' -e 's/$/$/'"' < "$export_symbols" > "$output_objdir/$outputname.exp"'
2518
 
              eval '$GREP -f "$output_objdir/$outputname.exp" < "$nlist" > "$nlist"T'
2519
 
              eval '$MV "$nlist"T "$nlist"'
 
2606
              ${SED} -e 's/\([].[*^$]\)/\\\1/g' -e 's/^/ /' -e 's/$/$/' < "$export_symbols" > "$output_objdir/$outputname.exp"
 
2607
              $GREP -f "$output_objdir/$outputname.exp" < "$nlist" > "$nlist"T
 
2608
              $MV "$nlist"T "$nlist"
2520
2609
              case $host in
2521
 
                *cygwin | *mingw* | *cegcc* )
2522
 
                  eval "echo EXPORTS "'> "$output_objdir/$outputname.def"'
2523
 
                  eval 'cat "$nlist" >> "$output_objdir/$outputname.def"'
 
2610
                *cygwin* | *mingw* | *cegcc* )
 
2611
                  echo EXPORTS > "$output_objdir/$outputname.def"
 
2612
                  cat "$nlist" >> "$output_objdir/$outputname.def"
2524
2613
                  ;;
2525
2614
              esac
2526
2615
            }
2532
2621
          func_basename "$dlprefile"
2533
2622
          name="$func_basename_result"
2534
2623
          $opt_dry_run || {
2535
 
            eval '$ECHO ": $name " >> "$nlist"'
 
2624
            $ECHO ": $name " >> "$nlist"
2536
2625
            eval "$NM $dlprefile 2>/dev/null | $global_symbol_pipe >> '$nlist'"
2537
2626
          }
2538
2627
        done
2562
2651
          if test -f "$nlist"S; then
2563
2652
            eval "$global_symbol_to_cdecl"' < "$nlist"S >> "$output_objdir/$my_dlsyms"'
2564
2653
          else
2565
 
            $ECHO '/* NONE */' >> "$output_objdir/$my_dlsyms"
 
2654
            echo '/* NONE */' >> "$output_objdir/$my_dlsyms"
2566
2655
          fi
2567
2656
 
2568
 
          $ECHO >> "$output_objdir/$my_dlsyms" "\
 
2657
          echo >> "$output_objdir/$my_dlsyms" "\
2569
2658
 
2570
2659
/* The mapping between symbol names and symbols.  */
2571
2660
typedef struct {
2575
2664
"
2576
2665
          case $host in
2577
2666
          *cygwin* | *mingw* | *cegcc* )
2578
 
            $ECHO >> "$output_objdir/$my_dlsyms" "\
 
2667
            echo >> "$output_objdir/$my_dlsyms" "\
2579
2668
/* DATA imports from DLLs on WIN32 con't be const, because
2580
2669
   runtime relocations are performed -- see ld's documentation
2581
2670
   on pseudo-relocs.  */"
2588
2677
            lt_dlsym_const=const ;;
2589
2678
          esac
2590
2679
 
2591
 
          $ECHO >> "$output_objdir/$my_dlsyms" "\
 
2680
          echo >> "$output_objdir/$my_dlsyms" "\
2592
2681
extern $lt_dlsym_const lt_dlsymlist
2593
2682
lt_${my_prefix}_LTX_preloaded_symbols[];
2594
2683
$lt_dlsym_const lt_dlsymlist
2604
2693
            eval "$global_symbol_to_c_name_address_lib_prefix" < "$nlist" >> "$output_objdir/$my_dlsyms"
2605
2694
            ;;
2606
2695
          esac
2607
 
          $ECHO >> "$output_objdir/$my_dlsyms" "\
 
2696
          echo >> "$output_objdir/$my_dlsyms" "\
2608
2697
  {0, (void *) 0}
2609
2698
};
2610
2699
 
2662
2751
        case $host in
2663
2752
        *cygwin* | *mingw* | *cegcc* )
2664
2753
          if test -f "$output_objdir/$my_outputname.def"; then
2665
 
            compile_command=`$ECHO "X$compile_command" | $Xsed -e "s%@SYMFILE@%$output_objdir/$my_outputname.def $symfileobj%"`
2666
 
            finalize_command=`$ECHO "X$finalize_command" | $Xsed -e "s%@SYMFILE@%$output_objdir/$my_outputname.def $symfileobj%"`
 
2754
            compile_command=`$ECHO "$compile_command" | $SED "s%@SYMFILE@%$output_objdir/$my_outputname.def $symfileobj%"`
 
2755
            finalize_command=`$ECHO "$finalize_command" | $SED "s%@SYMFILE@%$output_objdir/$my_outputname.def $symfileobj%"`
2667
2756
          else
2668
 
            compile_command=`$ECHO "X$compile_command" | $Xsed -e "s%@SYMFILE@%$symfileobj%"`
2669
 
            finalize_command=`$ECHO "X$finalize_command" | $Xsed -e "s%@SYMFILE@%$symfileobj%"`
 
2757
            compile_command=`$ECHO "$compile_command" | $SED "s%@SYMFILE@%$symfileobj%"`
 
2758
            finalize_command=`$ECHO "$finalize_command" | $SED "s%@SYMFILE@%$symfileobj%"`
2670
2759
          fi
2671
2760
          ;;
2672
2761
        *)
2673
 
          compile_command=`$ECHO "X$compile_command" | $Xsed -e "s%@SYMFILE@%$symfileobj%"`
2674
 
          finalize_command=`$ECHO "X$finalize_command" | $Xsed -e "s%@SYMFILE@%$symfileobj%"`
 
2762
          compile_command=`$ECHO "$compile_command" | $SED "s%@SYMFILE@%$symfileobj%"`
 
2763
          finalize_command=`$ECHO "$finalize_command" | $SED "s%@SYMFILE@%$symfileobj%"`
2675
2764
          ;;
2676
2765
        esac
2677
2766
        ;;
2685
2774
      # really was required.
2686
2775
 
2687
2776
      # Nullify the symbol file.
2688
 
      compile_command=`$ECHO "X$compile_command" | $Xsed -e "s% @SYMFILE@%%"`
2689
 
      finalize_command=`$ECHO "X$finalize_command" | $Xsed -e "s% @SYMFILE@%%"`
 
2777
      compile_command=`$ECHO "$compile_command" | $SED "s% @SYMFILE@%%"`
 
2778
      finalize_command=`$ECHO "$finalize_command" | $SED "s% @SYMFILE@%%"`
2690
2779
    fi
2691
2780
}
2692
2781
 
2696
2785
# Need a lot of goo to handle *both* DLLs and import libs
2697
2786
# Has to be a shell function in order to 'eat' the argument
2698
2787
# that is supplied when $file_magic_command is called.
 
2788
# Despite the name, also deal with 64 bit binaries.
2699
2789
func_win32_libid ()
2700
2790
{
2701
2791
  $opt_debug
2706
2796
    win32_libid_type="x86 archive import"
2707
2797
    ;;
2708
2798
  *ar\ archive*) # could be an import, or static
2709
 
    if eval $OBJDUMP -f $1 | $SED -e '10q' 2>/dev/null |
2710
 
       $EGREP 'file format pe-i386(.*architecture: i386)?' >/dev/null ; then
2711
 
      win32_nmres=`eval $NM -f posix -A $1 |
 
2799
    if $OBJDUMP -f "$1" | $SED -e '10q' 2>/dev/null |
 
2800
       $EGREP 'file format (pe-i386(.*architecture: i386)?|pe-arm-wince|pe-x86-64)' >/dev/null; then
 
2801
      win32_nmres=`$NM -f posix -A "$1" |
2712
2802
        $SED -n -e '
2713
2803
            1,100{
2714
2804
                / I /{
2745
2835
    $opt_debug
2746
2836
    f_ex_an_ar_dir="$1"; shift
2747
2837
    f_ex_an_ar_oldlib="$1"
2748
 
    func_show_eval "(cd \$f_ex_an_ar_dir && $AR x \"\$f_ex_an_ar_oldlib\")" 'exit $?'
 
2838
    if test "$lock_old_archive_extraction" = yes; then
 
2839
      lockfile=$f_ex_an_ar_oldlib.lock
 
2840
      until $opt_dry_run || ln "$progpath" "$lockfile" 2>/dev/null; do
 
2841
        func_echo "Waiting for $lockfile to be removed"
 
2842
        sleep 2
 
2843
      done
 
2844
    fi
 
2845
    func_show_eval "(cd \$f_ex_an_ar_dir && $AR x \"\$f_ex_an_ar_oldlib\")" \
 
2846
                   'stat=$?; rm -f "$lockfile"; exit $stat'
 
2847
    if test "$lock_old_archive_extraction" = yes; then
 
2848
      $opt_dry_run || rm -f "$lockfile"
 
2849
    fi
2749
2850
    if ($AR t "$f_ex_an_ar_oldlib" | sort | sort -uc >/dev/null 2>&1); then
2750
2851
     :
2751
2852
    else
2838
2939
}
2839
2940
 
2840
2941
 
2841
 
 
2842
 
# func_emit_wrapper_part1 [arg=no]
2843
 
#
2844
 
# Emit the first part of a libtool wrapper script on stdout.
2845
 
# For more information, see the description associated with
2846
 
# func_emit_wrapper(), below.
2847
 
func_emit_wrapper_part1 ()
 
2942
# func_emit_wrapper [arg=no]
 
2943
#
 
2944
# Emit a libtool wrapper script on stdout.
 
2945
# Don't directly open a file because we may want to
 
2946
# incorporate the script contents within a cygwin/mingw
 
2947
# wrapper executable.  Must ONLY be called from within
 
2948
# func_mode_link because it depends on a number of variables
 
2949
# set therein.
 
2950
#
 
2951
# ARG is the value that the WRAPPER_SCRIPT_BELONGS_IN_OBJDIR
 
2952
# variable will take.  If 'yes', then the emitted script
 
2953
# will assume that the directory in which it is stored is
 
2954
# the $objdir directory.  This is a cygwin/mingw-specific
 
2955
# behavior.
 
2956
func_emit_wrapper ()
2848
2957
{
2849
 
        func_emit_wrapper_part1_arg1=no
2850
 
        if test -n "$1" ; then
2851
 
          func_emit_wrapper_part1_arg1=$1
2852
 
        fi
 
2958
        func_emit_wrapper_arg1=${1-no}
2853
2959
 
2854
2960
        $ECHO "\
2855
2961
#! $SHELL
2865
2971
 
2866
2972
# Sed substitution that helps us do robust quoting.  It backslashifies
2867
2973
# metacharacters that are still active within double-quoted strings.
2868
 
Xsed='${SED} -e 1s/^X//'
2869
2974
sed_quote_subst='$sed_quote_subst'
2870
2975
 
2871
2976
# Be Bourne compatible
2896
3001
else
2897
3002
  # When we are sourced in execute mode, \$file and \$ECHO are already set.
2898
3003
  if test \"\$libtool_execute_magic\" != \"$magic\"; then
2899
 
    ECHO=\"$qecho\"
2900
 
    file=\"\$0\"
2901
 
    # Make sure echo works.
2902
 
    if test \"X\$1\" = X--no-reexec; then
2903
 
      # Discard the --no-reexec flag, and continue.
2904
 
      shift
2905
 
    elif test \"X\`{ \$ECHO '\t'; } 2>/dev/null\`\" = 'X\t'; then
2906
 
      # Yippee, \$ECHO works!
2907
 
      :
2908
 
    else
2909
 
      # Restart under the correct shell, and then maybe \$ECHO will work.
2910
 
      exec $SHELL \"\$0\" --no-reexec \${1+\"\$@\"}
2911
 
    fi
 
3004
    file=\"\$0\""
 
3005
 
 
3006
    qECHO=`$ECHO "$ECHO" | $SED "$sed_quote_subst"`
 
3007
    $ECHO "\
 
3008
 
 
3009
# A function that is used when there is no print builtin or printf.
 
3010
func_fallback_echo ()
 
3011
{
 
3012
  eval 'cat <<_LTECHO_EOF
 
3013
\$1
 
3014
_LTECHO_EOF'
 
3015
}
 
3016
    ECHO=\"$qECHO\"
2912
3017
  fi\
2913
 
"
2914
 
        $ECHO "\
2915
3018
 
2916
3019
  # Find the directory that this script lives in.
2917
 
  thisdir=\`\$ECHO \"X\$file\" | \$Xsed -e 's%/[^/]*$%%'\`
 
3020
  thisdir=\`\$ECHO \"\$file\" | $SED 's%/[^/]*$%%'\`
2918
3021
  test \"x\$thisdir\" = \"x\$file\" && thisdir=.
2919
3022
 
2920
3023
  # Follow symbolic links until we get to the real thisdir.
2921
 
  file=\`ls -ld \"\$file\" | ${SED} -n 's/.*-> //p'\`
 
3024
  file=\`ls -ld \"\$file\" | $SED -n 's/.*-> //p'\`
2922
3025
  while test -n \"\$file\"; do
2923
 
    destdir=\`\$ECHO \"X\$file\" | \$Xsed -e 's%/[^/]*\$%%'\`
 
3026
    destdir=\`\$ECHO \"\$file\" | $SED 's%/[^/]*\$%%'\`
2924
3027
 
2925
3028
    # If there was a directory component, then change thisdir.
2926
3029
    if test \"x\$destdir\" != \"x\$file\"; then
2930
3033
      esac
2931
3034
    fi
2932
3035
 
2933
 
    file=\`\$ECHO \"X\$file\" | \$Xsed -e 's%^.*/%%'\`
2934
 
    file=\`ls -ld \"\$thisdir/\$file\" | ${SED} -n 's/.*-> //p'\`
 
3036
    file=\`\$ECHO \"\$file\" | $SED 's%^.*/%%'\`
 
3037
    file=\`ls -ld \"\$thisdir/\$file\" | $SED -n 's/.*-> //p'\`
2935
3038
  done
2936
 
"
2937
 
}
2938
 
# end: func_emit_wrapper_part1
2939
 
 
2940
 
# func_emit_wrapper_part2 [arg=no]
2941
 
#
2942
 
# Emit the second part of a libtool wrapper script on stdout.
2943
 
# For more information, see the description associated with
2944
 
# func_emit_wrapper(), below.
2945
 
func_emit_wrapper_part2 ()
2946
 
{
2947
 
        func_emit_wrapper_part2_arg1=no
2948
 
        if test -n "$1" ; then
2949
 
          func_emit_wrapper_part2_arg1=$1
2950
 
        fi
2951
 
 
2952
 
        $ECHO "\
2953
3039
 
2954
3040
  # Usually 'no', except on cygwin/mingw when embedded into
2955
3041
  # the cwrapper.
2956
 
  WRAPPER_SCRIPT_BELONGS_IN_OBJDIR=$func_emit_wrapper_part2_arg1
 
3042
  WRAPPER_SCRIPT_BELONGS_IN_OBJDIR=$func_emit_wrapper_arg1
2957
3043
  if test \"\$WRAPPER_SCRIPT_BELONGS_IN_OBJDIR\" = \"yes\"; then
2958
3044
    # special case for '.'
2959
3045
    if test \"\$thisdir\" = \".\"; then
2961
3047
    fi
2962
3048
    # remove .libs from thisdir
2963
3049
    case \"\$thisdir\" in
2964
 
    *[\\\\/]$objdir ) thisdir=\`\$ECHO \"X\$thisdir\" | \$Xsed -e 's%[\\\\/][^\\\\/]*$%%'\` ;;
 
3050
    *[\\\\/]$objdir ) thisdir=\`\$ECHO \"\$thisdir\" | $SED 's%[\\\\/][^\\\\/]*$%%'\` ;;
2965
3051
    $objdir )   thisdir=. ;;
2966
3052
    esac
2967
3053
  fi
2992
3078
 
2993
3079
    # relink executable if necessary
2994
3080
    if test -n \"\$relink_command\"; then
2995
 
      if relink_command_output=\`eval \$relink_command 2>&1\`; then :
 
3081
      if relink_command_output=\`eval \"\$relink_command\" 2>&1\`; then :
2996
3082
      else
2997
3083
        $ECHO \"\$relink_command_output\" >&2
2998
3084
        $RM \"\$progdir/\$file\"
3024
3110
 
3025
3111
    # Some systems cannot cope with colon-terminated $shlibpath_var
3026
3112
    # The second colon is a workaround for a bug in BeOS R4 sed
3027
 
    $shlibpath_var=\`\$ECHO \"X\$$shlibpath_var\" | \$Xsed -e 's/::*\$//'\`
 
3113
    $shlibpath_var=\`\$ECHO \"\$$shlibpath_var\" | $SED 's/::*\$//'\`
3028
3114
 
3029
3115
    export $shlibpath_var
3030
3116
"
3064
3150
    # The program doesn't exist.
3065
3151
    \$ECHO \"\$0: error: \\\`\$progdir/\$program' does not exist\" 1>&2
3066
3152
    \$ECHO \"This script is just a wrapper for \$program.\" 1>&2
3067
 
    $ECHO \"See the $PACKAGE documentation for more information.\" 1>&2
 
3153
    \$ECHO \"See the $PACKAGE documentation for more information.\" 1>&2
3068
3154
    exit 1
3069
3155
  fi
3070
3156
fi\
3071
3157
"
3072
3158
}
3073
 
# end: func_emit_wrapper_part2
3074
 
 
3075
 
 
3076
 
# func_emit_wrapper [arg=no]
3077
 
#
3078
 
# Emit a libtool wrapper script on stdout.
3079
 
# Don't directly open a file because we may want to
3080
 
# incorporate the script contents within a cygwin/mingw
3081
 
# wrapper executable.  Must ONLY be called from within
3082
 
# func_mode_link because it depends on a number of variables
3083
 
# set therein.
3084
 
#
3085
 
# ARG is the value that the WRAPPER_SCRIPT_BELONGS_IN_OBJDIR
3086
 
# variable will take.  If 'yes', then the emitted script
3087
 
# will assume that the directory in which it is stored is
3088
 
# the $objdir directory.  This is a cygwin/mingw-specific
3089
 
# behavior.
3090
 
func_emit_wrapper ()
3091
 
{
3092
 
        func_emit_wrapper_arg1=no
3093
 
        if test -n "$1" ; then
3094
 
          func_emit_wrapper_arg1=$1
3095
 
        fi
3096
 
 
3097
 
        # split this up so that func_emit_cwrapperexe_src
3098
 
        # can call each part independently.
3099
 
        func_emit_wrapper_part1 "${func_emit_wrapper_arg1}"
3100
 
        func_emit_wrapper_part2 "${func_emit_wrapper_arg1}"
3101
 
}
3102
3159
 
3103
3160
 
3104
3161
# func_to_host_path arg
3125
3182
func_to_host_path ()
3126
3183
{
3127
3184
  func_to_host_path_result="$1"
3128
 
  if test -n "$1" ; then
 
3185
  if test -n "$1"; then
3129
3186
    case $host in
3130
3187
      *mingw* )
3131
3188
        lt_sed_naive_backslashify='s|\\\\*|\\|g;s|/|\\|g;s|\\|\\\\|g'
3132
3189
        case $build in
3133
3190
          *mingw* ) # actually, msys
3134
3191
            # awkward: cmd appends spaces to result
3135
 
            lt_sed_strip_trailing_spaces="s/[ ]*\$//"
3136
 
            func_to_host_path_tmp1=`( cmd //c echo "$1" |\
3137
 
              $SED -e "$lt_sed_strip_trailing_spaces" ) 2>/dev/null || echo ""`
3138
 
            func_to_host_path_result=`echo "$func_to_host_path_tmp1" |\
3139
 
              $SED -e "$lt_sed_naive_backslashify"`
 
3192
            func_to_host_path_result=`( cmd //c echo "$1" ) 2>/dev/null |
 
3193
              $SED -e 's/[ ]*$//' -e "$lt_sed_naive_backslashify"`
3140
3194
            ;;
3141
3195
          *cygwin* )
3142
 
            func_to_host_path_tmp1=`cygpath -w "$1"`
3143
 
            func_to_host_path_result=`echo "$func_to_host_path_tmp1" |\
3144
 
              $SED -e "$lt_sed_naive_backslashify"`
 
3196
            func_to_host_path_result=`cygpath -w "$1" |
 
3197
              $SED -e "$lt_sed_naive_backslashify"`
3145
3198
            ;;
3146
3199
          * )
3147
3200
            # Unfortunately, winepath does not exit with a non-zero
3153
3206
            # the odd construction:
3154
3207
            func_to_host_path_tmp1=`winepath -w "$1" 2>/dev/null`
3155
3208
            if test "$?" -eq 0 && test -n "${func_to_host_path_tmp1}"; then
3156
 
              func_to_host_path_result=`echo "$func_to_host_path_tmp1" |\
 
3209
              func_to_host_path_result=`$ECHO "$func_to_host_path_tmp1" |
3157
3210
                $SED -e "$lt_sed_naive_backslashify"`
3158
3211
            else
3159
3212
              # Allow warning below.
3160
 
              func_to_host_path_result=""
 
3213
              func_to_host_path_result=
3161
3214
            fi
3162
3215
            ;;
3163
3216
        esac
3164
3217
        if test -z "$func_to_host_path_result" ; then
3165
3218
          func_error "Could not determine host path corresponding to"
3166
 
          func_error "  '$1'"
 
3219
          func_error "  \`$1'"
3167
3220
          func_error "Continuing, but uninstalled executables may not work."
3168
3221
          # Fallback:
3169
3222
          func_to_host_path_result="$1"
3196
3249
func_to_host_pathlist ()
3197
3250
{
3198
3251
  func_to_host_pathlist_result="$1"
3199
 
  if test -n "$1" ; then
 
3252
  if test -n "$1"; then
3200
3253
    case $host in
3201
3254
      *mingw* )
3202
3255
        lt_sed_naive_backslashify='s|\\\\*|\\|g;s|/|\\|g;s|\\|\\\\|g'
3203
3256
        # Remove leading and trailing path separator characters from
3204
3257
        # ARG. msys behavior is inconsistent here, cygpath turns them
3205
3258
        # into '.;' and ';.', and winepath ignores them completely.
3206
 
        func_to_host_pathlist_tmp2="$1"
3207
 
        # Once set for this call, this variable should not be
3208
 
        # reassigned. It is used in tha fallback case.
3209
 
        func_to_host_pathlist_tmp1=`echo "$func_to_host_pathlist_tmp2" |\
3210
 
          $SED -e 's|^:*||' -e 's|:*$||'`
 
3259
        func_stripname : : "$1"
 
3260
        func_to_host_pathlist_tmp1=$func_stripname_result
3211
3261
        case $build in
3212
3262
          *mingw* ) # Actually, msys.
3213
3263
            # Awkward: cmd appends spaces to result.
3214
 
            lt_sed_strip_trailing_spaces="s/[ ]*\$//"
3215
 
            func_to_host_pathlist_tmp2=`( cmd //c echo "$func_to_host_pathlist_tmp1" |\
3216
 
              $SED -e "$lt_sed_strip_trailing_spaces" ) 2>/dev/null || echo ""`
3217
 
            func_to_host_pathlist_result=`echo "$func_to_host_pathlist_tmp2" |\
3218
 
              $SED -e "$lt_sed_naive_backslashify"`
 
3264
            func_to_host_pathlist_result=`
 
3265
              ( cmd //c echo "$func_to_host_pathlist_tmp1" ) 2>/dev/null |
 
3266
              $SED -e 's/[ ]*$//' -e "$lt_sed_naive_backslashify"`
3219
3267
            ;;
3220
3268
          *cygwin* )
3221
 
            func_to_host_pathlist_tmp2=`cygpath -w -p "$func_to_host_pathlist_tmp1"`
3222
 
            func_to_host_pathlist_result=`echo "$func_to_host_pathlist_tmp2" |\
 
3269
            func_to_host_pathlist_result=`cygpath -w -p "$func_to_host_pathlist_tmp1" |
3223
3270
              $SED -e "$lt_sed_naive_backslashify"`
3224
3271
            ;;
3225
3272
          * )
3235
3282
                  if test -z "$func_to_host_pathlist_result" ; then
3236
3283
                    func_to_host_pathlist_result="$func_to_host_path_result"
3237
3284
                  else
3238
 
                    func_to_host_pathlist_result="$func_to_host_pathlist_result;$func_to_host_path_result"
 
3285
                    func_append func_to_host_pathlist_result ";$func_to_host_path_result"
3239
3286
                  fi
3240
3287
                fi
3241
3288
              fi
3242
 
              IFS=:
3243
3289
            done
3244
3290
            IFS=$func_to_host_pathlist_oldIFS
3245
3291
            ;;
3246
3292
        esac
3247
 
        if test -z "$func_to_host_pathlist_result" ; then
 
3293
        if test -z "$func_to_host_pathlist_result"; then
3248
3294
          func_error "Could not determine the host path(s) corresponding to"
3249
 
          func_error "  '$1'"
 
3295
          func_error "  \`$1'"
3250
3296
          func_error "Continuing, but uninstalled executables may not work."
3251
3297
          # Fallback. This may break if $1 contains DOS-style drive
3252
3298
          # specifications. The fix is not to complicate the expression
3263
3309
            ;;
3264
3310
        esac
3265
3311
        case "$1" in
3266
 
          *: ) func_to_host_pathlist_result="$func_to_host_pathlist_result;"
 
3312
          *: ) func_append func_to_host_pathlist_result ";"
3267
3313
            ;;
3268
3314
        esac
3269
3315
        ;;
3295
3341
*/
3296
3342
EOF
3297
3343
            cat <<"EOF"
 
3344
#ifdef _MSC_VER
 
3345
# define _CRT_SECURE_NO_DEPRECATE 1
 
3346
#endif
3298
3347
#include <stdio.h>
3299
3348
#include <stdlib.h>
3300
3349
#ifdef _MSC_VER
3301
3350
# include <direct.h>
3302
3351
# include <process.h>
3303
3352
# include <io.h>
3304
 
# define setmode _setmode
3305
3353
#else
3306
3354
# include <unistd.h>
3307
3355
# include <stdint.h>
3308
3356
# ifdef __CYGWIN__
3309
3357
#  include <io.h>
3310
 
#  define HAVE_SETENV
3311
 
#  ifdef __STRICT_ANSI__
3312
 
char *realpath (const char *, char *);
3313
 
int putenv (char *);
3314
 
int setenv (const char *, const char *, int);
3315
 
#  endif
3316
3358
# endif
3317
3359
#endif
3318
3360
#include <malloc.h>
3324
3366
#include <fcntl.h>
3325
3367
#include <sys/stat.h>
3326
3368
 
 
3369
/* declarations of non-ANSI functions */
 
3370
#if defined(__MINGW32__)
 
3371
# ifdef __STRICT_ANSI__
 
3372
int _putenv (const char *);
 
3373
# endif
 
3374
#elif defined(__CYGWIN__)
 
3375
# ifdef __STRICT_ANSI__
 
3376
char *realpath (const char *, char *);
 
3377
int putenv (char *);
 
3378
int setenv (const char *, const char *, int);
 
3379
# endif
 
3380
/* #elif defined (other platforms) ... */
 
3381
#endif
 
3382
 
 
3383
/* portability defines, excluding path handling macros */
 
3384
#if defined(_MSC_VER)
 
3385
# define setmode _setmode
 
3386
# define stat    _stat
 
3387
# define chmod   _chmod
 
3388
# define getcwd  _getcwd
 
3389
# define putenv  _putenv
 
3390
# define S_IXUSR _S_IEXEC
 
3391
# ifndef _INTPTR_T_DEFINED
 
3392
#  define _INTPTR_T_DEFINED
 
3393
#  define intptr_t int
 
3394
# endif
 
3395
#elif defined(__MINGW32__)
 
3396
# define setmode _setmode
 
3397
# define stat    _stat
 
3398
# define chmod   _chmod
 
3399
# define getcwd  _getcwd
 
3400
# define putenv  _putenv
 
3401
#elif defined(__CYGWIN__)
 
3402
# define HAVE_SETENV
 
3403
# define FOPEN_WB "wb"
 
3404
/* #elif defined (other platforms) ... */
 
3405
#endif
 
3406
 
3327
3407
#if defined(PATH_MAX)
3328
3408
# define LT_PATHMAX PATH_MAX
3329
3409
#elif defined(MAXPATHLEN)
3339
3419
# define S_IXGRP 0
3340
3420
#endif
3341
3421
 
3342
 
#ifdef _MSC_VER
3343
 
# define S_IXUSR _S_IEXEC
3344
 
# define stat _stat
3345
 
# ifndef _INTPTR_T_DEFINED
3346
 
#  define intptr_t int
3347
 
# endif
3348
 
#endif
3349
 
 
 
3422
/* path handling portability macros */
3350
3423
#ifndef DIR_SEPARATOR
3351
3424
# define DIR_SEPARATOR '/'
3352
3425
# define PATH_SEPARATOR ':'
3377
3450
# define IS_PATH_SEPARATOR(ch) ((ch) == PATH_SEPARATOR_2)
3378
3451
#endif /* PATH_SEPARATOR_2 */
3379
3452
 
3380
 
#ifdef __CYGWIN__
3381
 
# define FOPEN_WB "wb"
3382
 
#endif
3383
 
 
3384
3453
#ifndef FOPEN_WB
3385
3454
# define FOPEN_WB "w"
3386
3455
#endif
3394
3463
} while (0)
3395
3464
 
3396
3465
#undef LTWRAPPER_DEBUGPRINTF
3397
 
#if defined DEBUGWRAPPER
 
3466
#if defined LT_DEBUGWRAPPER
3398
3467
# define LTWRAPPER_DEBUGPRINTF(args) ltwrapper_debugprintf args
3399
3468
static void
3400
3469
ltwrapper_debugprintf (const char *fmt, ...)
3421
3490
void lt_fatal (const char *message, ...);
3422
3491
void lt_setenv (const char *name, const char *value);
3423
3492
char *lt_extend_str (const char *orig_value, const char *add, int to_end);
3424
 
void lt_opt_process_env_set (const char *arg);
3425
 
void lt_opt_process_env_prepend (const char *arg);
3426
 
void lt_opt_process_env_append (const char *arg);
3427
 
int lt_split_name_value (const char *arg, char** name, char** value);
3428
3493
void lt_update_exe_path (const char *name, const char *value);
3429
3494
void lt_update_lib_path (const char *name, const char *value);
3430
 
 
3431
 
static const char *script_text_part1 =
3432
 
EOF
3433
 
 
3434
 
            func_emit_wrapper_part1 yes |
3435
 
                $SED -e 's/\([\\"]\)/\\\1/g' \
3436
 
                     -e 's/^/  "/' -e 's/$/\\n"/'
3437
 
            echo ";"
3438
 
            cat <<EOF
3439
 
 
3440
 
static const char *script_text_part2 =
3441
 
EOF
3442
 
            func_emit_wrapper_part2 yes |
3443
 
                $SED -e 's/\([\\"]\)/\\\1/g' \
3444
 
                     -e 's/^/  "/' -e 's/$/\\n"/'
3445
 
            echo ";"
 
3495
char **prepare_spawn (char **argv);
 
3496
void lt_dump_script (FILE *f);
 
3497
EOF
3446
3498
 
3447
3499
            cat <<EOF
3448
3500
const char * MAGIC_EXE = "$magic_exe";
3494
3546
 
3495
3547
static const char *dumpscript_opt       = LTWRAPPER_OPTION_PREFIX "dump-script";
3496
3548
 
3497
 
static const size_t env_set_opt_len     = LTWRAPPER_OPTION_PREFIX_LENGTH + 7;
3498
 
static const char *env_set_opt          = LTWRAPPER_OPTION_PREFIX "env-set";
3499
 
  /* argument is putenv-style "foo=bar", value of foo is set to bar */
3500
 
 
3501
 
static const size_t env_prepend_opt_len = LTWRAPPER_OPTION_PREFIX_LENGTH + 11;
3502
 
static const char *env_prepend_opt      = LTWRAPPER_OPTION_PREFIX "env-prepend";
3503
 
  /* argument is putenv-style "foo=bar", new value of foo is bar${foo} */
3504
 
 
3505
 
static const size_t env_append_opt_len  = LTWRAPPER_OPTION_PREFIX_LENGTH + 10;
3506
 
static const char *env_append_opt       = LTWRAPPER_OPTION_PREFIX "env-append";
3507
 
  /* argument is putenv-style "foo=bar", new value of foo is ${foo}bar */
3508
 
 
3509
3549
int
3510
3550
main (int argc, char *argv[])
3511
3551
{
3538
3578
              esac
3539
3579
 
3540
3580
            cat <<"EOF"
3541
 
          printf ("%s", script_text_part1);
3542
 
          printf ("%s", script_text_part2);
 
3581
          lt_dump_script (stdout);
3543
3582
          return 0;
3544
3583
        }
3545
3584
    }
3631
3670
  newargc=0;
3632
3671
  for (i = 1; i < argc; i++)
3633
3672
    {
3634
 
      if (strncmp (argv[i], env_set_opt, env_set_opt_len) == 0)
3635
 
        {
3636
 
          if (argv[i][env_set_opt_len] == '=')
3637
 
            {
3638
 
              const char *p = argv[i] + env_set_opt_len + 1;
3639
 
              lt_opt_process_env_set (p);
3640
 
            }
3641
 
          else if (argv[i][env_set_opt_len] == '\0' && i + 1 < argc)
3642
 
            {
3643
 
              lt_opt_process_env_set (argv[++i]); /* don't copy */
3644
 
            }
3645
 
          else
3646
 
            lt_fatal ("%s missing required argument", env_set_opt);
3647
 
          continue;
3648
 
        }
3649
 
      if (strncmp (argv[i], env_prepend_opt, env_prepend_opt_len) == 0)
3650
 
        {
3651
 
          if (argv[i][env_prepend_opt_len] == '=')
3652
 
            {
3653
 
              const char *p = argv[i] + env_prepend_opt_len + 1;
3654
 
              lt_opt_process_env_prepend (p);
3655
 
            }
3656
 
          else if (argv[i][env_prepend_opt_len] == '\0' && i + 1 < argc)
3657
 
            {
3658
 
              lt_opt_process_env_prepend (argv[++i]); /* don't copy */
3659
 
            }
3660
 
          else
3661
 
            lt_fatal ("%s missing required argument", env_prepend_opt);
3662
 
          continue;
3663
 
        }
3664
 
      if (strncmp (argv[i], env_append_opt, env_append_opt_len) == 0)
3665
 
        {
3666
 
          if (argv[i][env_append_opt_len] == '=')
3667
 
            {
3668
 
              const char *p = argv[i] + env_append_opt_len + 1;
3669
 
              lt_opt_process_env_append (p);
3670
 
            }
3671
 
          else if (argv[i][env_append_opt_len] == '\0' && i + 1 < argc)
3672
 
            {
3673
 
              lt_opt_process_env_append (argv[++i]); /* don't copy */
3674
 
            }
3675
 
          else
3676
 
            lt_fatal ("%s missing required argument", env_append_opt);
3677
 
          continue;
3678
 
        }
3679
3673
      if (strncmp (argv[i], ltwrapper_option_prefix, opt_prefix_len) == 0)
3680
3674
        {
3681
3675
          /* however, if there is an option in the LTWRAPPER_OPTION_PREFIX
3707
3701
              mingw*)
3708
3702
                cat <<"EOF"
3709
3703
  /* execv doesn't actually work on mingw as expected on unix */
 
3704
  newargz = prepare_spawn (newargz);
3710
3705
  rval = _spawnv (_P_WAIT, lt_argv_zero, (const char * const *) newargz);
3711
3706
  if (rval == -1)
3712
3707
    {
4051
4046
  return new_value;
4052
4047
}
4053
4048
 
4054
 
int
4055
 
lt_split_name_value (const char *arg, char** name, char** value)
4056
 
{
4057
 
  const char *p;
4058
 
  int len;
4059
 
  if (!arg || !*arg)
4060
 
    return 1;
4061
 
 
4062
 
  p = strchr (arg, (int)'=');
4063
 
 
4064
 
  if (!p)
4065
 
    return 1;
4066
 
 
4067
 
  *value = xstrdup (++p);
4068
 
 
4069
 
  len = strlen (arg) - strlen (*value);
4070
 
  *name = XMALLOC (char, len);
4071
 
  strncpy (*name, arg, len-1);
4072
 
  (*name)[len - 1] = '\0';
4073
 
 
4074
 
  return 0;
4075
 
}
4076
 
 
4077
 
void
4078
 
lt_opt_process_env_set (const char *arg)
4079
 
{
4080
 
  char *name = NULL;
4081
 
  char *value = NULL;
4082
 
 
4083
 
  if (lt_split_name_value (arg, &name, &value) != 0)
4084
 
    {
4085
 
      XFREE (name);
4086
 
      XFREE (value);
4087
 
      lt_fatal ("bad argument for %s: '%s'", env_set_opt, arg);
4088
 
    }
4089
 
 
4090
 
  lt_setenv (name, value);
4091
 
  XFREE (name);
4092
 
  XFREE (value);
4093
 
}
4094
 
 
4095
 
void
4096
 
lt_opt_process_env_prepend (const char *arg)
4097
 
{
4098
 
  char *name = NULL;
4099
 
  char *value = NULL;
4100
 
  char *new_value = NULL;
4101
 
 
4102
 
  if (lt_split_name_value (arg, &name, &value) != 0)
4103
 
    {
4104
 
      XFREE (name);
4105
 
      XFREE (value);
4106
 
      lt_fatal ("bad argument for %s: '%s'", env_prepend_opt, arg);
4107
 
    }
4108
 
 
4109
 
  new_value = lt_extend_str (getenv (name), value, 0);
4110
 
  lt_setenv (name, new_value);
4111
 
  XFREE (new_value);
4112
 
  XFREE (name);
4113
 
  XFREE (value);
4114
 
}
4115
 
 
4116
 
void
4117
 
lt_opt_process_env_append (const char *arg)
4118
 
{
4119
 
  char *name = NULL;
4120
 
  char *value = NULL;
4121
 
  char *new_value = NULL;
4122
 
 
4123
 
  if (lt_split_name_value (arg, &name, &value) != 0)
4124
 
    {
4125
 
      XFREE (name);
4126
 
      XFREE (value);
4127
 
      lt_fatal ("bad argument for %s: '%s'", env_append_opt, arg);
4128
 
    }
4129
 
 
4130
 
  new_value = lt_extend_str (getenv (name), value, 1);
4131
 
  lt_setenv (name, new_value);
4132
 
  XFREE (new_value);
4133
 
  XFREE (name);
4134
 
  XFREE (value);
4135
 
}
4136
 
 
4137
4049
void
4138
4050
lt_update_exe_path (const char *name, const char *value)
4139
4051
{
4170
4082
    }
4171
4083
}
4172
4084
 
4173
 
 
 
4085
EOF
 
4086
            case $host_os in
 
4087
              mingw*)
 
4088
                cat <<"EOF"
 
4089
 
 
4090
/* Prepares an argument vector before calling spawn().
 
4091
   Note that spawn() does not by itself call the command interpreter
 
4092
     (getenv ("COMSPEC") != NULL ? getenv ("COMSPEC") :
 
4093
      ({ OSVERSIONINFO v; v.dwOSVersionInfoSize = sizeof(OSVERSIONINFO);
 
4094
         GetVersionEx(&v);
 
4095
         v.dwPlatformId == VER_PLATFORM_WIN32_NT;
 
4096
      }) ? "cmd.exe" : "command.com").
 
4097
   Instead it simply concatenates the arguments, separated by ' ', and calls
 
4098
   CreateProcess().  We must quote the arguments since Win32 CreateProcess()
 
4099
   interprets characters like ' ', '\t', '\\', '"' (but not '<' and '>') in a
 
4100
   special way:
 
4101
   - Space and tab are interpreted as delimiters. They are not treated as
 
4102
     delimiters if they are surrounded by double quotes: "...".
 
4103
   - Unescaped double quotes are removed from the input. Their only effect is
 
4104
     that within double quotes, space and tab are treated like normal
 
4105
     characters.
 
4106
   - Backslashes not followed by double quotes are not special.
 
4107
   - But 2*n+1 backslashes followed by a double quote become
 
4108
     n backslashes followed by a double quote (n >= 0):
 
4109
       \" -> "
 
4110
       \\\" -> \"
 
4111
       \\\\\" -> \\"
 
4112
 */
 
4113
#define SHELL_SPECIAL_CHARS "\"\\ \001\002\003\004\005\006\007\010\011\012\013\014\015\016\017\020\021\022\023\024\025\026\027\030\031\032\033\034\035\036\037"
 
4114
#define SHELL_SPACE_CHARS " \001\002\003\004\005\006\007\010\011\012\013\014\015\016\017\020\021\022\023\024\025\026\027\030\031\032\033\034\035\036\037"
 
4115
char **
 
4116
prepare_spawn (char **argv)
 
4117
{
 
4118
  size_t argc;
 
4119
  char **new_argv;
 
4120
  size_t i;
 
4121
 
 
4122
  /* Count number of arguments.  */
 
4123
  for (argc = 0; argv[argc] != NULL; argc++)
 
4124
    ;
 
4125
 
 
4126
  /* Allocate new argument vector.  */
 
4127
  new_argv = XMALLOC (char *, argc + 1);
 
4128
 
 
4129
  /* Put quoted arguments into the new argument vector.  */
 
4130
  for (i = 0; i < argc; i++)
 
4131
    {
 
4132
      const char *string = argv[i];
 
4133
 
 
4134
      if (string[0] == '\0')
 
4135
        new_argv[i] = xstrdup ("\"\"");
 
4136
      else if (strpbrk (string, SHELL_SPECIAL_CHARS) != NULL)
 
4137
        {
 
4138
          int quote_around = (strpbrk (string, SHELL_SPACE_CHARS) != NULL);
 
4139
          size_t length;
 
4140
          unsigned int backslashes;
 
4141
          const char *s;
 
4142
          char *quoted_string;
 
4143
          char *p;
 
4144
 
 
4145
          length = 0;
 
4146
          backslashes = 0;
 
4147
          if (quote_around)
 
4148
            length++;
 
4149
          for (s = string; *s != '\0'; s++)
 
4150
            {
 
4151
              char c = *s;
 
4152
              if (c == '"')
 
4153
                length += backslashes + 1;
 
4154
              length++;
 
4155
              if (c == '\\')
 
4156
                backslashes++;
 
4157
              else
 
4158
                backslashes = 0;
 
4159
            }
 
4160
          if (quote_around)
 
4161
            length += backslashes + 1;
 
4162
 
 
4163
          quoted_string = XMALLOC (char, length + 1);
 
4164
 
 
4165
          p = quoted_string;
 
4166
          backslashes = 0;
 
4167
          if (quote_around)
 
4168
            *p++ = '"';
 
4169
          for (s = string; *s != '\0'; s++)
 
4170
            {
 
4171
              char c = *s;
 
4172
              if (c == '"')
 
4173
                {
 
4174
                  unsigned int j;
 
4175
                  for (j = backslashes + 1; j > 0; j--)
 
4176
                    *p++ = '\\';
 
4177
                }
 
4178
              *p++ = c;
 
4179
              if (c == '\\')
 
4180
                backslashes++;
 
4181
              else
 
4182
                backslashes = 0;
 
4183
            }
 
4184
          if (quote_around)
 
4185
            {
 
4186
              unsigned int j;
 
4187
              for (j = backslashes; j > 0; j--)
 
4188
                *p++ = '\\';
 
4189
              *p++ = '"';
 
4190
            }
 
4191
          *p = '\0';
 
4192
 
 
4193
          new_argv[i] = quoted_string;
 
4194
        }
 
4195
      else
 
4196
        new_argv[i] = (char *) string;
 
4197
    }
 
4198
  new_argv[argc] = NULL;
 
4199
 
 
4200
  return new_argv;
 
4201
}
 
4202
EOF
 
4203
                ;;
 
4204
            esac
 
4205
 
 
4206
            cat <<"EOF"
 
4207
void lt_dump_script (FILE* f)
 
4208
{
 
4209
EOF
 
4210
            func_emit_wrapper yes |
 
4211
              $SED -e 's/\([\\"]\)/\\\1/g' \
 
4212
                   -e 's/^/  fputs ("/' -e 's/$/\\n", f);/'
 
4213
 
 
4214
            cat <<"EOF"
 
4215
}
4174
4216
EOF
4175
4217
}
4176
4218
# end: func_emit_cwrapperexe_src
4177
4219
 
 
4220
# func_win32_import_lib_p ARG
 
4221
# True if ARG is an import lib, as indicated by $file_magic_cmd
 
4222
func_win32_import_lib_p ()
 
4223
{
 
4224
    $opt_debug
 
4225
    case `eval "$file_magic_cmd \"\$1\" 2>/dev/null" | $SED -e 10q` in
 
4226
    *import*) : ;;
 
4227
    *) false ;;
 
4228
    esac
 
4229
}
 
4230
 
4178
4231
# func_mode_link arg...
4179
4232
func_mode_link ()
4180
4233
{
4661
4714
        esac
4662
4715
        case $host in
4663
4716
        *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-cegcc*)
4664
 
          testbindir=`$ECHO "X$dir" | $Xsed -e 's*/lib$*/bin*'`
 
4717
          testbindir=`$ECHO "$dir" | $SED 's*/lib$*/bin*'`
4665
4718
          case :$dllsearchpath: in
4666
4719
          *":$dir:"*) ;;
4667
4720
          ::) dllsearchpath=$dir;;
4680
4733
      -l*)
4681
4734
        if test "X$arg" = "X-lc" || test "X$arg" = "X-lm"; then
4682
4735
          case $host in
4683
 
          *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-beos* | *-cegcc*)
 
4736
          *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-beos* | *-cegcc* | *-*-haiku*)
4684
4737
            # These systems don't actually have a C or math library (as such)
4685
4738
            continue
4686
4739
            ;;
4705
4758
            # Compiler inserts libc in the correct place for threads to work
4706
4759
            test "X$arg" = "X-lc" && continue
4707
4760
            ;;
 
4761
          *-*-linux*)
 
4762
            test "X$arg" = "X-lc" && continue
 
4763
            ;;
4708
4764
          esac
4709
4765
        elif test "X$arg" = "X-lc_r"; then
4710
4766
         case $host in
4866
4922
        for flag in $args; do
4867
4923
          IFS="$save_ifs"
4868
4924
          func_quote_for_eval "$flag"
4869
 
          arg="$arg $wl$func_quote_for_eval_result"
 
4925
          arg="$arg $func_quote_for_eval_result"
4870
4926
          compiler_flags="$compiler_flags $func_quote_for_eval_result"
4871
4927
        done
4872
4928
        IFS="$save_ifs"
4922
4978
      # -F/path gives path to uninstalled frameworks, gcc on darwin
4923
4979
      # -p, -pg, --coverage, -fprofile-* pass through profiling flag for GCC
4924
4980
      # @file GCC response files
 
4981
      # -tp=* Portland pgcc target processor selection
4925
4982
      -64|-mips[0-9]|-r[0-9][0-9]*|-xarch=*|-xtarget=*|+DA*|+DD*|-q*|-m*| \
4926
 
      -t[45]*|-txscale*|-p|-pg|--coverage|-fprofile-*|-F*|@*)
 
4983
      -t[45]*|-txscale*|-p|-pg|--coverage|-fprofile-*|-F*|@*|-tp=*)
4927
4984
        func_quote_for_eval "$arg"
4928
4985
        arg="$func_quote_for_eval_result"
4929
4986
        func_append compile_command " $arg"
5070
5127
      func_fatal_help "the \`$prevarg' option requires an argument"
5071
5128
 
5072
5129
    if test "$export_dynamic" = yes && test -n "$export_dynamic_flag_spec"; then
5073
 
      eval arg=\"$export_dynamic_flag_spec\"
 
5130
      eval "arg=\"$export_dynamic_flag_spec\""
5074
5131
      func_append compile_command " $arg"
5075
5132
      func_append finalize_command " $arg"
5076
5133
    fi
5083
5140
 
5084
5141
    if test -n "$shlibpath_var"; then
5085
5142
      # get the directories listed in $shlibpath_var
5086
 
      eval shlib_search_path=\`\$ECHO \"X\${$shlibpath_var}\" \| \$Xsed -e \'s/:/ /g\'\`
 
5143
      eval shlib_search_path=\`\$ECHO \"\${$shlibpath_var}\" \| \$SED \'s/:/ /g\'\`
5087
5144
    else
5088
5145
      shlib_search_path=
5089
5146
    fi
5090
 
    eval sys_lib_search_path=\"$sys_lib_search_path_spec\"
5091
 
    eval sys_lib_dlsearch_path=\"$sys_lib_dlsearch_path_spec\"
 
5147
    eval "sys_lib_search_path=\"$sys_lib_search_path_spec\""
 
5148
    eval "sys_lib_dlsearch_path=\"$sys_lib_dlsearch_path_spec\""
5092
5149
 
5093
5150
    func_dirname "$output" "/" ""
5094
5151
    output_objdir="$func_dirname_result$objdir"
5206
5263
          # Collect preopened libtool deplibs, except any this library
5207
5264
          # has declared as weak libs
5208
5265
          for deplib in $dependency_libs; do
5209
 
            deplib_base=`$ECHO "X$deplib" | $Xsed -e "$basename"`
 
5266
            func_basename "$deplib"
 
5267
            deplib_base=$func_basename_result
5210
5268
            case " $weak_libs " in
5211
5269
            *" $deplib_base "*) ;;
5212
5270
            *) deplibs="$deplibs $deplib" ;;
5385
5443
                match_pattern*)
5386
5444
                  set dummy $deplibs_check_method; shift
5387
5445
                  match_pattern_regex=`expr "$deplibs_check_method" : "$1 \(.*\)"`
5388
 
                  if eval "\$ECHO \"X$deplib\"" 2>/dev/null | $Xsed -e 10q \
 
5446
                  if eval "\$ECHO \"$deplib\"" 2>/dev/null | $SED 10q \
5389
5447
                    | $EGREP "$match_pattern_regex" > /dev/null; then
5390
5448
                    valid_a_lib=yes
5391
5449
                  fi
5395
5453
                ;;
5396
5454
              esac
5397
5455
              if test "$valid_a_lib" != yes; then
5398
 
                $ECHO
 
5456
                echo
5399
5457
                $ECHO "*** Warning: Trying to link with static lib archive $deplib."
5400
 
                $ECHO "*** I have the capability to make that library automatically link in when"
5401
 
                $ECHO "*** you link to this library.  But I can only do this if you have a"
5402
 
                $ECHO "*** shared version of the library, which you do not appear to have"
5403
 
                $ECHO "*** because the file extensions .$libext of this argument makes me believe"
5404
 
                $ECHO "*** that it is just a static archive that I should not use here."
 
5458
                echo "*** I have the capability to make that library automatically link in when"
 
5459
                echo "*** you link to this library.  But I can only do this if you have a"
 
5460
                echo "*** shared version of the library, which you do not appear to have"
 
5461
                echo "*** because the file extensions .$libext of this argument makes me believe"
 
5462
                echo "*** that it is just a static archive that I should not use here."
5405
5463
              else
5406
 
                $ECHO
 
5464
                echo
5407
5465
                $ECHO "*** Warning: Linking the shared library $output against the"
5408
5466
                $ECHO "*** static library $deplib is not portable!"
5409
5467
                deplibs="$deplib $deplibs"
5476
5534
 
5477
5535
        # Convert "-framework foo" to "foo.ltframework"
5478
5536
        if test -n "$inherited_linker_flags"; then
5479
 
          tmp_inherited_linker_flags=`$ECHO "X$inherited_linker_flags" | $Xsed -e 's/-framework \([^ $]*\)/\1.ltframework/g'`
 
5537
          tmp_inherited_linker_flags=`$ECHO "$inherited_linker_flags" | $SED 's/-framework \([^ $]*\)/\1.ltframework/g'`
5480
5538
          for tmp_inherited_linker_flag in $tmp_inherited_linker_flags; do
5481
5539
            case " $new_inherited_linker_flags " in
5482
5540
              *" $tmp_inherited_linker_flag "*) ;;
5484
5542
            esac
5485
5543
          done
5486
5544
        fi
5487
 
        dependency_libs=`$ECHO "X $dependency_libs" | $Xsed -e 's% \([^ $]*\).ltframework% -framework \1%g'`
 
5545
        dependency_libs=`$ECHO " $dependency_libs" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'`
5488
5546
        if test "$linkmode,$pass" = "lib,link" ||
5489
5547
           test "$linkmode,$pass" = "prog,scan" ||
5490
5548
           { test "$linkmode" != prog && test "$linkmode" != lib; }; then
5738
5796
            fi
5739
5797
          done
5740
5798
          if test -z "$dlopenmodule" && test "$shouldnotlink" = yes && test "$pass" = link; then
5741
 
            $ECHO
 
5799
            echo
5742
5800
            if test "$linkmode" = prog; then
5743
5801
              $ECHO "*** Warning: Linking the executable $output against the loadable module"
5744
5802
            else
5777
5835
            shift
5778
5836
            realname="$1"
5779
5837
            shift
5780
 
            libname=`eval "\\$ECHO \"$libname_spec\""`
 
5838
            eval "libname=\"$libname_spec\""
5781
5839
            # use dlname if we got it. it's perfectly good, no?
5782
5840
            if test -n "$dlname"; then
5783
5841
              soname="$dlname"
5790
5848
                versuffix="-$major"
5791
5849
                ;;
5792
5850
              esac
5793
 
              eval soname=\"$soname_spec\"
 
5851
              eval "soname=\"$soname_spec\""
5794
5852
            else
5795
5853
              soname="$realname"
5796
5854
            fi
5841
5899
                      if test "X$dlopenmodule" != "X$lib"; then
5842
5900
                        $ECHO "*** Warning: lib $linklib is a module, not a shared library"
5843
5901
                        if test -z "$old_library" ; then
5844
 
                          $ECHO
5845
 
                          $ECHO "*** And there doesn't seem to be a static archive available"
5846
 
                          $ECHO "*** The link will probably fail, sorry"
 
5902
                          echo
 
5903
                          echo "*** And there doesn't seem to be a static archive available"
 
5904
                          echo "*** The link will probably fail, sorry"
5847
5905
                        else
5848
5906
                          add="$dir/$old_library"
5849
5907
                        fi
5983
6041
 
5984
6042
            # Just print a warning and add the library to dependency_libs so
5985
6043
            # that the program can be linked against the static library.
5986
 
            $ECHO
 
6044
            echo
5987
6045
            $ECHO "*** Warning: This system can not link to static lib archive $lib."
5988
 
            $ECHO "*** I have the capability to make that library automatically link in when"
5989
 
            $ECHO "*** you link to this library.  But I can only do this if you have a"
5990
 
            $ECHO "*** shared version of the library, which you do not appear to have."
 
6046
            echo "*** I have the capability to make that library automatically link in when"
 
6047
            echo "*** you link to this library.  But I can only do this if you have a"
 
6048
            echo "*** shared version of the library, which you do not appear to have."
5991
6049
            if test "$module" = yes; then
5992
 
              $ECHO "*** But as you try to build a module library, libtool will still create "
5993
 
              $ECHO "*** a static module, that should work as long as the dlopening application"
5994
 
              $ECHO "*** is linked with the -dlopen flag to resolve symbols at runtime."
 
6050
              echo "*** But as you try to build a module library, libtool will still create "
 
6051
              echo "*** a static module, that should work as long as the dlopening application"
 
6052
              echo "*** is linked with the -dlopen flag to resolve symbols at runtime."
5995
6053
              if test -z "$global_symbol_pipe"; then
5996
 
                $ECHO
5997
 
                $ECHO "*** However, this would only work if libtool was able to extract symbol"
5998
 
                $ECHO "*** lists from a program, using \`nm' or equivalent, but libtool could"
5999
 
                $ECHO "*** not find such a program.  So, this module is probably useless."
6000
 
                $ECHO "*** \`nm' from GNU binutils and a full rebuild may help."
 
6054
                echo
 
6055
                echo "*** However, this would only work if libtool was able to extract symbol"
 
6056
                echo "*** lists from a program, using \`nm' or equivalent, but libtool could"
 
6057
                echo "*** not find such a program.  So, this module is probably useless."
 
6058
                echo "*** \`nm' from GNU binutils and a full rebuild may help."
6001
6059
              fi
6002
6060
              if test "$build_old_libs" = no; then
6003
6061
                build_libtool_libs=module
6051
6109
          if test "$link_all_deplibs" != no; then
6052
6110
            # Add the search paths of all dependency libraries
6053
6111
            for deplib in $dependency_libs; do
 
6112
              path=
6054
6113
              case $deplib in
6055
6114
              -L*) path="$deplib" ;;
6056
6115
              *.la)
6071
6130
                case $host in
6072
6131
                *-*-darwin*)
6073
6132
                  depdepl=
6074
 
                  eval deplibrary_names=`${SED} -n -e 's/^library_names=\(.*\)$/\1/p' $deplib`
 
6133
                  deplibrary_names=`${SED} -n -e 's/^library_names=\(.*\)$/\1/p' $deplib`
6075
6134
                  if test -n "$deplibrary_names" ; then
6076
6135
                    for tmp in $deplibrary_names ; do
6077
6136
                      depdepl=$tmp
6093
6152
                  ;;
6094
6153
                esac
6095
6154
                else
6096
 
                  eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $deplib`
 
6155
                  libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $deplib`
6097
6156
                  test -z "$libdir" && \
6098
6157
                    func_fatal_error "\`$deplib' is not a valid libtool archive"
6099
6158
                  test "$absdir" != "$libdir" && \
6116
6175
          compile_deplibs="$new_inherited_linker_flags $compile_deplibs"
6117
6176
          finalize_deplibs="$new_inherited_linker_flags $finalize_deplibs"
6118
6177
        else
6119
 
          compiler_flags="$compiler_flags "`$ECHO "X $new_inherited_linker_flags" | $Xsed -e 's% \([^ $]*\).ltframework% -framework \1%g'`
 
6178
          compiler_flags="$compiler_flags "`$ECHO " $new_inherited_linker_flags" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'`
6120
6179
        fi
6121
6180
      fi
6122
6181
      dependency_libs="$newdependency_libs"
6146
6205
        fi
6147
6206
        for var in $vars dependency_libs; do
6148
6207
          # Add libraries to $var in reverse order
6149
 
          eval tmp_libs=\"\$$var\"
 
6208
          eval tmp_libs=\$$var
6150
6209
          new_libs=
6151
6210
          for deplib in $tmp_libs; do
6152
6211
            # FIXME: Pedantically, this is the right thing to do, so
6197
6256
            *) tmp_libs="$tmp_libs $deplib" ;;
6198
6257
            esac
6199
6258
          done
6200
 
          eval $var=\"$tmp_libs\"
 
6259
          eval $var=\$tmp_libs
6201
6260
        done # for var
6202
6261
      fi
6203
6262
      # Last step: remove runtime libs from dependency_libs
6260
6319
      lib*)
6261
6320
        func_stripname 'lib' '.la' "$outputname"
6262
6321
        name=$func_stripname_result
6263
 
        eval shared_ext=\"$shrext_cmds\"
6264
 
        eval libname=\"$libname_spec\"
 
6322
        eval "shared_ext=\"$shrext_cmds\""
 
6323
        eval "libname=\"$libname_spec\""
6265
6324
        ;;
6266
6325
      *)
6267
6326
        test "$module" = no && \
6271
6330
          # Add the "lib" prefix for modules if required
6272
6331
          func_stripname '' '.la' "$outputname"
6273
6332
          name=$func_stripname_result
6274
 
          eval shared_ext=\"$shrext_cmds\"
6275
 
          eval libname=\"$libname_spec\"
 
6333
          eval "shared_ext=\"$shrext_cmds\""
 
6334
          eval "libname=\"$libname_spec\""
6276
6335
        else
6277
6336
          func_stripname '' '.la' "$outputname"
6278
6337
          libname=$func_stripname_result
6284
6343
        if test "$deplibs_check_method" != pass_all; then
6285
6344
          func_fatal_error "cannot build libtool library \`$output' from non-libtool objects on this host:$objs"
6286
6345
        else
6287
 
          $ECHO
 
6346
          echo
6288
6347
          $ECHO "*** Warning: Linking the shared library $output against the non-libtool"
6289
6348
          $ECHO "*** objects $objs is not portable!"
6290
6349
          libobjs="$libobjs $objs"
6352
6411
            age="$number_minor"
6353
6412
            revision="$number_revision"
6354
6413
            ;;
6355
 
          freebsd-aout|freebsd-elf|sunos)
 
6414
          freebsd-aout|freebsd-elf|qnx|sunos)
6356
6415
            current="$number_major"
6357
6416
            revision="$number_minor"
6358
6417
            age="0"
6586
6645
        oldlibs="$oldlibs $output_objdir/$libname.$libext"
6587
6646
 
6588
6647
        # Transform .lo files to .o files.
6589
 
        oldobjs="$objs "`$ECHO "X$libobjs" | $SP2NL | $Xsed -e '/\.'${libext}'$/d' -e "$lo2o" | $NL2SP`
 
6648
        oldobjs="$objs "`$ECHO "$libobjs" | $SP2NL | $SED "/\.${libext}$/d; $lo2o" | $NL2SP`
6590
6649
      fi
6591
6650
 
6592
6651
      # Eliminate all temporary directories.
6593
6652
      #for path in $notinst_path; do
6594
 
      # lib_search_path=`$ECHO "X$lib_search_path " | $Xsed -e "s% $path % %g"`
6595
 
      # deplibs=`$ECHO "X$deplibs " | $Xsed -e "s% -L$path % %g"`
6596
 
      # dependency_libs=`$ECHO "X$dependency_libs " | $Xsed -e "s% -L$path % %g"`
 
6653
      # lib_search_path=`$ECHO "$lib_search_path " | $SED "s% $path % %g"`
 
6654
      # deplibs=`$ECHO "$deplibs " | $SED "s% -L$path % %g"`
 
6655
      # dependency_libs=`$ECHO "$dependency_libs " | $SED "s% -L$path % %g"`
6597
6656
      #done
6598
6657
 
6599
6658
      if test -n "$xrpath"; then
6634
6693
      if test "$build_libtool_libs" = yes; then
6635
6694
        if test -n "$rpath"; then
6636
6695
          case $host in
6637
 
          *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-*-beos* | *-cegcc*)
 
6696
          *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-*-beos* | *-cegcc* | *-*-haiku*)
6638
6697
            # these systems don't actually have a c library (as such)!
6639
6698
            ;;
6640
6699
          *-*-rhapsody* | *-*-darwin1.[012])
6711
6770
                  esac
6712
6771
                fi
6713
6772
                if test -n "$i" ; then
6714
 
                  libname=`eval "\\$ECHO \"$libname_spec\""`
6715
 
                  deplib_matches=`eval "\\$ECHO \"$library_names_spec\""`
 
6773
                  eval "libname=\"$libname_spec\""
 
6774
                  eval "deplib_matches=\"$library_names_spec\""
6716
6775
                  set dummy $deplib_matches; shift
6717
6776
                  deplib_match=$1
6718
6777
                  if test `expr "$ldd_output" : ".*$deplib_match"` -ne 0 ; then
6719
6778
                    newdeplibs="$newdeplibs $i"
6720
6779
                  else
6721
6780
                    droppeddeps=yes
6722
 
                    $ECHO
 
6781
                    echo
6723
6782
                    $ECHO "*** Warning: dynamic linker does not accept needed library $i."
6724
 
                    $ECHO "*** I have the capability to make that library automatically link in when"
6725
 
                    $ECHO "*** you link to this library.  But I can only do this if you have a"
6726
 
                    $ECHO "*** shared version of the library, which I believe you do not have"
6727
 
                    $ECHO "*** because a test_compile did reveal that the linker did not use it for"
6728
 
                    $ECHO "*** its dynamic dependency list that programs get resolved with at runtime."
 
6783
                    echo "*** I have the capability to make that library automatically link in when"
 
6784
                    echo "*** you link to this library.  But I can only do this if you have a"
 
6785
                    echo "*** shared version of the library, which I believe you do not have"
 
6786
                    echo "*** because a test_compile did reveal that the linker did not use it for"
 
6787
                    echo "*** its dynamic dependency list that programs get resolved with at runtime."
6729
6788
                  fi
6730
6789
                fi
6731
6790
                ;;
6754
6813
                    esac
6755
6814
                  fi
6756
6815
                  if test -n "$i" ; then
6757
 
                    libname=`eval "\\$ECHO \"$libname_spec\""`
6758
 
                    deplib_matches=`eval "\\$ECHO \"$library_names_spec\""`
 
6816
                    eval "libname=\"$libname_spec\""
 
6817
                    eval "deplib_matches=\"$library_names_spec\""
6759
6818
                    set dummy $deplib_matches; shift
6760
6819
                    deplib_match=$1
6761
6820
                    if test `expr "$ldd_output" : ".*$deplib_match"` -ne 0 ; then
6762
6821
                      newdeplibs="$newdeplibs $i"
6763
6822
                    else
6764
6823
                      droppeddeps=yes
6765
 
                      $ECHO
 
6824
                      echo
6766
6825
                      $ECHO "*** Warning: dynamic linker does not accept needed library $i."
6767
 
                      $ECHO "*** I have the capability to make that library automatically link in when"
6768
 
                      $ECHO "*** you link to this library.  But I can only do this if you have a"
6769
 
                      $ECHO "*** shared version of the library, which you do not appear to have"
6770
 
                      $ECHO "*** because a test_compile did reveal that the linker did not use this one"
6771
 
                      $ECHO "*** as a dynamic dependency that programs can get resolved with at runtime."
 
6826
                      echo "*** I have the capability to make that library automatically link in when"
 
6827
                      echo "*** you link to this library.  But I can only do this if you have a"
 
6828
                      echo "*** shared version of the library, which you do not appear to have"
 
6829
                      echo "*** because a test_compile did reveal that the linker did not use this one"
 
6830
                      echo "*** as a dynamic dependency that programs can get resolved with at runtime."
6772
6831
                    fi
6773
6832
                  fi
6774
6833
                else
6775
6834
                  droppeddeps=yes
6776
 
                  $ECHO
 
6835
                  echo
6777
6836
                  $ECHO "*** Warning!  Library $i is needed by this library but I was not able to"
6778
 
                  $ECHO "*** make it link in!  You will probably need to install it or some"
6779
 
                  $ECHO "*** library that it depends on before this library will be fully"
6780
 
                  $ECHO "*** functional.  Installing it before continuing would be even better."
 
6837
                  echo "*** make it link in!  You will probably need to install it or some"
 
6838
                  echo "*** library that it depends on before this library will be fully"
 
6839
                  echo "*** functional.  Installing it before continuing would be even better."
6781
6840
                fi
6782
6841
                ;;
6783
6842
              *)
6804
6863
                esac
6805
6864
              fi
6806
6865
              if test -n "$a_deplib" ; then
6807
 
                libname=`eval "\\$ECHO \"$libname_spec\""`
 
6866
                eval "libname=\"$libname_spec\""
6808
6867
                for i in $lib_search_path $sys_lib_search_path $shlib_search_path; do
6809
6868
                  potential_libs=`ls $i/$libname[.-]* 2>/dev/null`
6810
6869
                  for potent_lib in $potential_libs; do
6823
6882
                        potliblink=`ls -ld $potlib | ${SED} 's/.* -> //'`
6824
6883
                        case $potliblink in
6825
6884
                        [\\/]* | [A-Za-z]:[\\/]*) potlib="$potliblink";;
6826
 
                        *) potlib=`$ECHO "X$potlib" | $Xsed -e 's,[^/]*$,,'`"$potliblink";;
 
6885
                        *) potlib=`$ECHO "$potlib" | $SED 's,[^/]*$,,'`"$potliblink";;
6827
6886
                        esac
6828
6887
                      done
6829
 
                      if eval $file_magic_cmd \"\$potlib\" 2>/dev/null |
 
6888
                      if eval "$file_magic_cmd \"\$potlib\"" 2>/dev/null |
6830
6889
                         $SED -e 10q |
6831
6890
                         $EGREP "$file_magic_regex" > /dev/null; then
6832
6891
                        newdeplibs="$newdeplibs $a_deplib"
6838
6897
              fi
6839
6898
              if test -n "$a_deplib" ; then
6840
6899
                droppeddeps=yes
6841
 
                $ECHO
 
6900
                echo
6842
6901
                $ECHO "*** Warning: linker path does not have real file for library $a_deplib."
6843
 
                $ECHO "*** I have the capability to make that library automatically link in when"
6844
 
                $ECHO "*** you link to this library.  But I can only do this if you have a"
6845
 
                $ECHO "*** shared version of the library, which you do not appear to have"
6846
 
                $ECHO "*** because I did check the linker path looking for a file starting"
 
6902
                echo "*** I have the capability to make that library automatically link in when"
 
6903
                echo "*** you link to this library.  But I can only do this if you have a"
 
6904
                echo "*** shared version of the library, which you do not appear to have"
 
6905
                echo "*** because I did check the linker path looking for a file starting"
6847
6906
                if test -z "$potlib" ; then
6848
6907
                  $ECHO "*** with $libname but no candidates were found. (...for file magic test)"
6849
6908
                else
6876
6935
                esac
6877
6936
              fi
6878
6937
              if test -n "$a_deplib" ; then
6879
 
                libname=`eval "\\$ECHO \"$libname_spec\""`
 
6938
                eval "libname=\"$libname_spec\""
6880
6939
                for i in $lib_search_path $sys_lib_search_path $shlib_search_path; do
6881
6940
                  potential_libs=`ls $i/$libname[.-]* 2>/dev/null`
6882
6941
                  for potent_lib in $potential_libs; do
6883
6942
                    potlib="$potent_lib" # see symlink-check above in file_magic test
6884
 
                    if eval "\$ECHO \"X$potent_lib\"" 2>/dev/null | $Xsed -e 10q | \
 
6943
                    if eval "\$ECHO \"$potent_lib\"" 2>/dev/null | $SED 10q | \
6885
6944
                       $EGREP "$match_pattern_regex" > /dev/null; then
6886
6945
                      newdeplibs="$newdeplibs $a_deplib"
6887
6946
                      a_deplib=""
6892
6951
              fi
6893
6952
              if test -n "$a_deplib" ; then
6894
6953
                droppeddeps=yes
6895
 
                $ECHO
 
6954
                echo
6896
6955
                $ECHO "*** Warning: linker path does not have real file for library $a_deplib."
6897
 
                $ECHO "*** I have the capability to make that library automatically link in when"
6898
 
                $ECHO "*** you link to this library.  But I can only do this if you have a"
6899
 
                $ECHO "*** shared version of the library, which you do not appear to have"
6900
 
                $ECHO "*** because I did check the linker path looking for a file starting"
 
6956
                echo "*** I have the capability to make that library automatically link in when"
 
6957
                echo "*** you link to this library.  But I can only do this if you have a"
 
6958
                echo "*** shared version of the library, which you do not appear to have"
 
6959
                echo "*** because I did check the linker path looking for a file starting"
6901
6960
                if test -z "$potlib" ; then
6902
6961
                  $ECHO "*** with $libname but no candidates were found. (...for regex pattern test)"
6903
6962
                else
6915
6974
          ;;
6916
6975
        none | unknown | *)
6917
6976
          newdeplibs=""
6918
 
          tmp_deplibs=`$ECHO "X $deplibs" | $Xsed \
6919
 
              -e 's/ -lc$//' -e 's/ -[LR][^ ]*//g'`
 
6977
          tmp_deplibs=`$ECHO " $deplibs" | $SED 's/ -lc$//; s/ -[LR][^ ]*//g'`
6920
6978
          if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
6921
6979
            for i in $predeps $postdeps ; do
6922
6980
              # can't use Xsed below, because $i might contain '/'
6923
 
              tmp_deplibs=`$ECHO "X $tmp_deplibs" | $Xsed -e "s,$i,,"`
 
6981
              tmp_deplibs=`$ECHO " $tmp_deplibs" | $SED "s,$i,,"`
6924
6982
            done
6925
6983
          fi
6926
 
          if $ECHO "X $tmp_deplibs" | $Xsed -e 's/[      ]//g' |
6927
 
             $GREP . >/dev/null; then
6928
 
            $ECHO
 
6984
          case $tmp_deplibs in
 
6985
          *[!\  \ ]*)
 
6986
            echo
6929
6987
            if test "X$deplibs_check_method" = "Xnone"; then
6930
 
              $ECHO "*** Warning: inter-library dependencies are not supported in this platform."
 
6988
              echo "*** Warning: inter-library dependencies are not supported in this platform."
6931
6989
            else
6932
 
              $ECHO "*** Warning: inter-library dependencies are not known to be supported."
 
6990
              echo "*** Warning: inter-library dependencies are not known to be supported."
6933
6991
            fi
6934
 
            $ECHO "*** All declared inter-library dependencies are being dropped."
 
6992
            echo "*** All declared inter-library dependencies are being dropped."
6935
6993
            droppeddeps=yes
6936
 
          fi
 
6994
            ;;
 
6995
          esac
6937
6996
          ;;
6938
6997
        esac
6939
6998
        versuffix=$versuffix_save
6945
7004
        case $host in
6946
7005
        *-*-rhapsody* | *-*-darwin1.[012])
6947
7006
          # On Rhapsody replace the C library with the System framework
6948
 
          newdeplibs=`$ECHO "X $newdeplibs" | $Xsed -e 's/ -lc / System.ltframework /'`
 
7007
          newdeplibs=`$ECHO " $newdeplibs" | $SED 's/ -lc / System.ltframework /'`
6949
7008
          ;;
6950
7009
        esac
6951
7010
 
6952
7011
        if test "$droppeddeps" = yes; then
6953
7012
          if test "$module" = yes; then
6954
 
            $ECHO
6955
 
            $ECHO "*** Warning: libtool could not satisfy all declared inter-library"
 
7013
            echo
 
7014
            echo "*** Warning: libtool could not satisfy all declared inter-library"
6956
7015
            $ECHO "*** dependencies of module $libname.  Therefore, libtool will create"
6957
 
            $ECHO "*** a static module, that should work as long as the dlopening"
6958
 
            $ECHO "*** application is linked with the -dlopen flag."
 
7016
            echo "*** a static module, that should work as long as the dlopening"
 
7017
            echo "*** application is linked with the -dlopen flag."
6959
7018
            if test -z "$global_symbol_pipe"; then
6960
 
              $ECHO
6961
 
              $ECHO "*** However, this would only work if libtool was able to extract symbol"
6962
 
              $ECHO "*** lists from a program, using \`nm' or equivalent, but libtool could"
6963
 
              $ECHO "*** not find such a program.  So, this module is probably useless."
6964
 
              $ECHO "*** \`nm' from GNU binutils and a full rebuild may help."
 
7019
              echo
 
7020
              echo "*** However, this would only work if libtool was able to extract symbol"
 
7021
              echo "*** lists from a program, using \`nm' or equivalent, but libtool could"
 
7022
              echo "*** not find such a program.  So, this module is probably useless."
 
7023
              echo "*** \`nm' from GNU binutils and a full rebuild may help."
6965
7024
            fi
6966
7025
            if test "$build_old_libs" = no; then
6967
7026
              oldlibs="$output_objdir/$libname.$libext"
6971
7030
              build_libtool_libs=no
6972
7031
            fi
6973
7032
          else
6974
 
            $ECHO "*** The inter-library dependencies that have been dropped here will be"
6975
 
            $ECHO "*** automatically added whenever a program is linked with this library"
6976
 
            $ECHO "*** or is declared to -dlopen it."
 
7033
            echo "*** The inter-library dependencies that have been dropped here will be"
 
7034
            echo "*** automatically added whenever a program is linked with this library"
 
7035
            echo "*** or is declared to -dlopen it."
6977
7036
 
6978
7037
            if test "$allow_undefined" = no; then
6979
 
              $ECHO
6980
 
              $ECHO "*** Since this library must not contain undefined symbols,"
6981
 
              $ECHO "*** because either the platform does not support them or"
6982
 
              $ECHO "*** it was explicitly requested with -no-undefined,"
6983
 
              $ECHO "*** libtool will only create a static version of it."
 
7038
              echo
 
7039
              echo "*** Since this library must not contain undefined symbols,"
 
7040
              echo "*** because either the platform does not support them or"
 
7041
              echo "*** it was explicitly requested with -no-undefined,"
 
7042
              echo "*** libtool will only create a static version of it."
6984
7043
              if test "$build_old_libs" = no; then
6985
7044
                oldlibs="$output_objdir/$libname.$libext"
6986
7045
                build_libtool_libs=module
6997
7056
      # Time to change all our "foo.ltframework" stuff back to "-framework foo"
6998
7057
      case $host in
6999
7058
        *-*-darwin*)
7000
 
          newdeplibs=`$ECHO "X $newdeplibs" | $Xsed -e 's% \([^ $]*\).ltframework% -framework \1%g'`
7001
 
          new_inherited_linker_flags=`$ECHO "X $new_inherited_linker_flags" | $Xsed -e 's% \([^ $]*\).ltframework% -framework \1%g'`
7002
 
          deplibs=`$ECHO "X $deplibs" | $Xsed -e 's% \([^ $]*\).ltframework% -framework \1%g'`
 
7059
          newdeplibs=`$ECHO " $newdeplibs" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'`
 
7060
          new_inherited_linker_flags=`$ECHO " $new_inherited_linker_flags" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'`
 
7061
          deplibs=`$ECHO " $deplibs" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'`
7003
7062
          ;;
7004
7063
      esac
7005
7064
 
7059
7118
                  esac
7060
7119
                fi
7061
7120
              else
7062
 
                eval flag=\"$hardcode_libdir_flag_spec\"
 
7121
                eval "flag=\"$hardcode_libdir_flag_spec\""
7063
7122
                dep_rpath="$dep_rpath $flag"
7064
7123
              fi
7065
7124
            elif test -n "$runpath_var"; then
7074
7133
             test -n "$hardcode_libdirs"; then
7075
7134
            libdir="$hardcode_libdirs"
7076
7135
            if test -n "$hardcode_libdir_flag_spec_ld"; then
7077
 
              eval dep_rpath=\"$hardcode_libdir_flag_spec_ld\"
 
7136
              eval "dep_rpath=\"$hardcode_libdir_flag_spec_ld\""
7078
7137
            else
7079
 
              eval dep_rpath=\"$hardcode_libdir_flag_spec\"
 
7138
              eval "dep_rpath=\"$hardcode_libdir_flag_spec\""
7080
7139
            fi
7081
7140
          fi
7082
7141
          if test -n "$runpath_var" && test -n "$perm_rpath"; then
7085
7144
            for dir in $perm_rpath; do
7086
7145
              rpath="$rpath$dir:"
7087
7146
            done
7088
 
            eval "$runpath_var='$rpath\$$runpath_var'; export $runpath_var"
 
7147
            eval $runpath_var=\$rpath\$$runpath_var
 
7148
            export $runpath_var
7089
7149
          fi
7090
7150
          test -n "$dep_rpath" && deplibs="$dep_rpath $deplibs"
7091
7151
        fi
7093
7153
        shlibpath="$finalize_shlibpath"
7094
7154
        test "$mode" != relink && shlibpath="$compile_shlibpath$shlibpath"
7095
7155
        if test -n "$shlibpath"; then
7096
 
          eval "$shlibpath_var='$shlibpath\$$shlibpath_var'; export $shlibpath_var"
 
7156
          eval $shlibpath_var=\$shlibpath\$$shlibpath_var
 
7157
          export $shlibpath_var
7097
7158
        fi
7098
7159
 
7099
7160
        # Get the real and link names of the library.
7100
 
        eval shared_ext=\"$shrext_cmds\"
7101
 
        eval library_names=\"$library_names_spec\"
 
7161
        eval "shared_ext=\"$shrext_cmds\""
 
7162
        eval "library_names=\"$library_names_spec\""
7102
7163
        set dummy $library_names
7103
7164
        shift
7104
7165
        realname="$1"
7105
7166
        shift
7106
7167
 
7107
7168
        if test -n "$soname_spec"; then
7108
 
          eval soname=\"$soname_spec\"
 
7169
          eval "soname=\"$soname_spec\""
7109
7170
        else
7110
7171
          soname="$realname"
7111
7172
        fi
7121
7182
        done
7122
7183
 
7123
7184
        # Use standard objects if they are pic
7124
 
        test -z "$pic_flag" && libobjs=`$ECHO "X$libobjs" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP`
 
7185
        test -z "$pic_flag" && libobjs=`$ECHO "$libobjs" | $SP2NL | $SED "$lo2o" | $NL2SP`
7125
7186
        test "X$libobjs" = "X " && libobjs=
7126
7187
 
7127
7188
        delfiles=
7161
7222
            save_ifs="$IFS"; IFS='~'
7162
7223
            for cmd in $cmds; do
7163
7224
              IFS="$save_ifs"
7164
 
              eval cmd=\"$cmd\"
 
7225
              eval "cmd=\"$cmd\""
7165
7226
              func_len " $cmd"
7166
7227
              len=$func_len_result
7167
7228
              if test "$len" -lt "$max_cmd_len" || test "$max_cmd_len" -le -1; then
7187
7248
        if test -n "$export_symbols" && test -n "$include_expsyms"; then
7188
7249
          tmp_export_symbols="$export_symbols"
7189
7250
          test -n "$orig_export_symbols" && tmp_export_symbols="$orig_export_symbols"
7190
 
          $opt_dry_run || eval '$ECHO "X$include_expsyms" | $Xsed | $SP2NL >> "$tmp_export_symbols"'
 
7251
          $opt_dry_run || $ECHO "$include_expsyms" | $SP2NL >> "$tmp_export_symbols"
7191
7252
        fi
7192
7253
 
7193
7254
        if test "X$skipped_export" != "X:" && test -n "$orig_export_symbols"; then
7225
7286
          fi
7226
7287
          if test -n "$whole_archive_flag_spec"; then
7227
7288
            save_libobjs=$libobjs
7228
 
            eval libobjs=\"\$libobjs $whole_archive_flag_spec\"
 
7289
            eval "libobjs=\"\$libobjs $whole_archive_flag_spec\""
7229
7290
            test "X$libobjs" = "X " && libobjs=
7230
7291
          else
7231
7292
            gentop="$output_objdir/${outputname}x"
7238
7299
        fi
7239
7300
 
7240
7301
        if test "$thread_safe" = yes && test -n "$thread_safe_flag_spec"; then
7241
 
          eval flag=\"$thread_safe_flag_spec\"
 
7302
          eval "flag=\"$thread_safe_flag_spec\""
7242
7303
          linker_flags="$linker_flags $flag"
7243
7304
        fi
7244
7305
 
7245
7306
        # Make a backup of the uninstalled library when relinking
7246
7307
        if test "$mode" = relink; then
7247
 
          $opt_dry_run || eval '(cd $output_objdir && $RM ${realname}U && $MV $realname ${realname}U)' || exit $?
 
7308
          $opt_dry_run || (cd $output_objdir && $RM ${realname}U && $MV $realname ${realname}U) || exit $?
7248
7309
        fi
7249
7310
 
7250
7311
        # Do each of the archive commands.
7251
7312
        if test "$module" = yes && test -n "$module_cmds" ; then
7252
7313
          if test -n "$export_symbols" && test -n "$module_expsym_cmds"; then
7253
 
            eval test_cmds=\"$module_expsym_cmds\"
 
7314
            eval "test_cmds=\"$module_expsym_cmds\""
7254
7315
            cmds=$module_expsym_cmds
7255
7316
          else
7256
 
            eval test_cmds=\"$module_cmds\"
 
7317
            eval "test_cmds=\"$module_cmds\""
7257
7318
            cmds=$module_cmds
7258
7319
          fi
7259
7320
        else
7260
7321
          if test -n "$export_symbols" && test -n "$archive_expsym_cmds"; then
7261
 
            eval test_cmds=\"$archive_expsym_cmds\"
 
7322
            eval "test_cmds=\"$archive_expsym_cmds\""
7262
7323
            cmds=$archive_expsym_cmds
7263
7324
          else
7264
 
            eval test_cmds=\"$archive_cmds\"
 
7325
            eval "test_cmds=\"$archive_cmds\""
7265
7326
            cmds=$archive_cmds
7266
7327
          fi
7267
7328
        fi
7288
7349
            save_libobjs=$libobjs
7289
7350
          fi
7290
7351
          save_output=$output
7291
 
          output_la=`$ECHO "X$output" | $Xsed -e "$basename"`
 
7352
          func_basename "$output"
 
7353
          output_la=$func_basename_result
7292
7354
 
7293
7355
          # Clear the reloadable object creation command queue and
7294
7356
          # initialize k to one.
7301
7363
          if test -n "$save_libobjs" && test "X$skipped_export" != "X:" && test "$with_gnu_ld" = yes; then
7302
7364
            output=${output_objdir}/${output_la}.lnkscript
7303
7365
            func_verbose "creating GNU ld script: $output"
7304
 
            $ECHO 'INPUT (' > $output
 
7366
            echo 'INPUT (' > $output
7305
7367
            for obj in $save_libobjs
7306
7368
            do
7307
7369
              $ECHO "$obj" >> $output
7308
7370
            done
7309
 
            $ECHO ')' >> $output
 
7371
            echo ')' >> $output
7310
7372
            delfiles="$delfiles $output"
7311
7373
          elif test -n "$save_libobjs" && test "X$skipped_export" != "X:" && test "X$file_list_spec" != X; then
7312
7374
            output=${output_objdir}/${output_la}.lnk
7329
7391
            if test -n "$save_libobjs"; then
7330
7392
              func_verbose "creating reloadable object files..."
7331
7393
              output=$output_objdir/$output_la-${k}.$objext
7332
 
              eval test_cmds=\"$reload_cmds\"
 
7394
              eval "test_cmds=\"$reload_cmds\""
7333
7395
              func_len " $test_cmds"
7334
7396
              len0=$func_len_result
7335
7397
              len=$len0
7348
7410
                  # command to the queue.
7349
7411
                  if test "$k" -eq 1 ; then
7350
7412
                    # The first file doesn't have a previous command to add.
7351
 
                    eval concat_cmds=\"$reload_cmds $objlist $last_robj\"
 
7413
                    reload_objs=$objlist
 
7414
                    eval "concat_cmds=\"$reload_cmds\""
7352
7415
                  else
7353
7416
                    # All subsequent reloadable object files will link in
7354
7417
                    # the last one created.
7355
 
                    eval concat_cmds=\"\$concat_cmds~$reload_cmds $objlist $last_robj~\$RM $last_robj\"
 
7418
                    reload_objs="$objlist $last_robj"
 
7419
                    eval "concat_cmds=\"\$concat_cmds~$reload_cmds~\$RM $last_robj\""
7356
7420
                  fi
7357
7421
                  last_robj=$output_objdir/$output_la-${k}.$objext
7358
7422
                  func_arith $k + 1
7359
7423
                  k=$func_arith_result
7360
7424
                  output=$output_objdir/$output_la-${k}.$objext
7361
 
                  objlist=$obj
 
7425
                  objlist=" $obj"
7362
7426
                  func_len " $last_robj"
7363
7427
                  func_arith $len0 + $func_len_result
7364
7428
                  len=$func_arith_result
7368
7432
              # reloadable object file.  All subsequent reloadable object
7369
7433
              # files will link in the last one created.
7370
7434
              test -z "$concat_cmds" || concat_cmds=$concat_cmds~
7371
 
              eval concat_cmds=\"\${concat_cmds}$reload_cmds $objlist $last_robj\"
 
7435
              reload_objs="$objlist $last_robj"
 
7436
              eval "concat_cmds=\"\${concat_cmds}$reload_cmds\""
7372
7437
              if test -n "$last_robj"; then
7373
 
                eval concat_cmds=\"\${concat_cmds}~\$RM $last_robj\"
 
7438
                eval "concat_cmds=\"\${concat_cmds}~\$RM $last_robj\""
7374
7439
              fi
7375
7440
              delfiles="$delfiles $output"
7376
7441
 
7385
7450
              libobjs=$output
7386
7451
              # Append the command to create the export file.
7387
7452
              test -z "$concat_cmds" || concat_cmds=$concat_cmds~
7388
 
              eval concat_cmds=\"\$concat_cmds$export_symbols_cmds\"
 
7453
              eval "concat_cmds=\"\$concat_cmds$export_symbols_cmds\""
7389
7454
              if test -n "$last_robj"; then
7390
 
                eval concat_cmds=\"\$concat_cmds~\$RM $last_robj\"
 
7455
                eval "concat_cmds=\"\$concat_cmds~\$RM $last_robj\""
7391
7456
              fi
7392
7457
            fi
7393
7458
 
7427
7492
            if test -n "$export_symbols" && test -n "$include_expsyms"; then
7428
7493
              tmp_export_symbols="$export_symbols"
7429
7494
              test -n "$orig_export_symbols" && tmp_export_symbols="$orig_export_symbols"
7430
 
              $opt_dry_run || eval '$ECHO "X$include_expsyms" | $Xsed | $SP2NL >> "$tmp_export_symbols"'
 
7495
              $opt_dry_run || $ECHO "$include_expsyms" | $SP2NL >> "$tmp_export_symbols"
7431
7496
            fi
7432
7497
 
7433
7498
            if test -n "$orig_export_symbols"; then
7450
7515
          output=$save_output
7451
7516
 
7452
7517
          if test -n "$convenience" && test -n "$whole_archive_flag_spec"; then
7453
 
            eval libobjs=\"\$libobjs $whole_archive_flag_spec\"
 
7518
            eval "libobjs=\"\$libobjs $whole_archive_flag_spec\""
7454
7519
            test "X$libobjs" = "X " && libobjs=
7455
7520
          fi
7456
7521
          # Expand the library linking commands again to reset the
7474
7539
 
7475
7540
        if test -n "$delfiles"; then
7476
7541
          # Append the command to remove temporary files to $cmds.
7477
 
          eval cmds=\"\$cmds~\$RM $delfiles\"
 
7542
          eval "cmds=\"\$cmds~\$RM $delfiles\""
7478
7543
        fi
7479
7544
 
7480
7545
        # Add any objects from preloaded convenience libraries
7490
7555
        save_ifs="$IFS"; IFS='~'
7491
7556
        for cmd in $cmds; do
7492
7557
          IFS="$save_ifs"
7493
 
          eval cmd=\"$cmd\"
 
7558
          eval "cmd=\"$cmd\""
7494
7559
          $opt_silent || {
7495
7560
            func_quote_for_expand "$cmd"
7496
7561
            eval "func_echo $func_quote_for_expand_result"
7512
7577
 
7513
7578
        # Restore the uninstalled library and exit
7514
7579
        if test "$mode" = relink; then
7515
 
          $opt_dry_run || eval '(cd $output_objdir && $RM ${realname}T && $MV $realname ${realname}T && $MV ${realname}U $realname)' || exit $?
 
7580
          $opt_dry_run || (cd $output_objdir && $RM ${realname}T && $MV $realname ${realname}T && $MV ${realname}U $realname) || exit $?
7516
7581
 
7517
7582
          if test -n "$convenience"; then
7518
7583
            if test -z "$whole_archive_flag_spec"; then
7591
7656
 
7592
7657
      if test -n "$convenience"; then
7593
7658
        if test -n "$whole_archive_flag_spec"; then
7594
 
          eval tmp_whole_archive_flags=\"$whole_archive_flag_spec\"
7595
 
          reload_conv_objs=$reload_objs\ `$ECHO "X$tmp_whole_archive_flags" | $Xsed -e 's|,| |g'`
 
7659
          eval "tmp_whole_archive_flags=\"$whole_archive_flag_spec\""
 
7660
          reload_conv_objs=$reload_objs\ `$ECHO "$tmp_whole_archive_flags" | $SED 's|,| |g'`
7596
7661
        else
7597
7662
          gentop="$output_objdir/${obj}x"
7598
7663
          generated="$generated $gentop"
7603
7668
      fi
7604
7669
 
7605
7670
      # Create the old-style object.
7606
 
      reload_objs="$objs$old_deplibs "`$ECHO "X$libobjs" | $SP2NL | $Xsed -e '/\.'${libext}$'/d' -e '/\.lib$/d' -e "$lo2o" | $NL2SP`" $reload_conv_objs" ### testsuite: skip nested quoting test
 
7671
      reload_objs="$objs$old_deplibs "`$ECHO "$libobjs" | $SP2NL | $SED "/\.${libext}$/d; /\.lib$/d; $lo2o" | $NL2SP`" $reload_conv_objs" ### testsuite: skip nested quoting test
7607
7672
 
7608
7673
      output="$obj"
7609
7674
      func_execute_cmds "$reload_cmds" 'exit $?'
7625
7690
        # Create an invalid libtool object if no PIC, so that we don't
7626
7691
        # accidentally link it into a program.
7627
7692
        # $show "echo timestamp > $libobj"
7628
 
        # $opt_dry_run || eval "echo timestamp > $libobj" || exit $?
 
7693
        # $opt_dry_run || echo timestamp > $libobj || exit $?
7629
7694
        exit $EXIT_SUCCESS
7630
7695
      fi
7631
7696
 
7663
7728
      case $host in
7664
7729
      *-*-rhapsody* | *-*-darwin1.[012])
7665
7730
        # On Rhapsody replace the C library is the System framework
7666
 
        compile_deplibs=`$ECHO "X $compile_deplibs" | $Xsed -e 's/ -lc / System.ltframework /'`
7667
 
        finalize_deplibs=`$ECHO "X $finalize_deplibs" | $Xsed -e 's/ -lc / System.ltframework /'`
 
7731
        compile_deplibs=`$ECHO " $compile_deplibs" | $SED 's/ -lc / System.ltframework /'`
 
7732
        finalize_deplibs=`$ECHO " $finalize_deplibs" | $SED 's/ -lc / System.ltframework /'`
7668
7733
        ;;
7669
7734
      esac
7670
7735
 
7681
7746
          esac
7682
7747
        fi
7683
7748
        # Time to change all our "foo.ltframework" stuff back to "-framework foo"
7684
 
        compile_deplibs=`$ECHO "X $compile_deplibs" | $Xsed -e 's% \([^ $]*\).ltframework% -framework \1%g'`
7685
 
        finalize_deplibs=`$ECHO "X $finalize_deplibs" | $Xsed -e 's% \([^ $]*\).ltframework% -framework \1%g'`
 
7749
        compile_deplibs=`$ECHO " $compile_deplibs" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'`
 
7750
        finalize_deplibs=`$ECHO " $finalize_deplibs" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'`
7686
7751
        ;;
7687
7752
      esac
7688
7753
 
7748
7813
              esac
7749
7814
            fi
7750
7815
          else
7751
 
            eval flag=\"$hardcode_libdir_flag_spec\"
 
7816
            eval "flag=\"$hardcode_libdir_flag_spec\""
7752
7817
            rpath="$rpath $flag"
7753
7818
          fi
7754
7819
        elif test -n "$runpath_var"; then
7777
7842
      if test -n "$hardcode_libdir_separator" &&
7778
7843
         test -n "$hardcode_libdirs"; then
7779
7844
        libdir="$hardcode_libdirs"
7780
 
        eval rpath=\" $hardcode_libdir_flag_spec\"
 
7845
        eval "rpath=\" $hardcode_libdir_flag_spec\""
7781
7846
      fi
7782
7847
      compile_rpath="$rpath"
7783
7848
 
7799
7864
              esac
7800
7865
            fi
7801
7866
          else
7802
 
            eval flag=\"$hardcode_libdir_flag_spec\"
 
7867
            eval "flag=\"$hardcode_libdir_flag_spec\""
7803
7868
            rpath="$rpath $flag"
7804
7869
          fi
7805
7870
        elif test -n "$runpath_var"; then
7813
7878
      if test -n "$hardcode_libdir_separator" &&
7814
7879
         test -n "$hardcode_libdirs"; then
7815
7880
        libdir="$hardcode_libdirs"
7816
 
        eval rpath=\" $hardcode_libdir_flag_spec\"
 
7881
        eval "rpath=\" $hardcode_libdir_flag_spec\""
7817
7882
      fi
7818
7883
      finalize_rpath="$rpath"
7819
7884
 
7820
7885
      if test -n "$libobjs" && test "$build_old_libs" = yes; then
7821
7886
        # Transform all the library objects into standard objects.
7822
 
        compile_command=`$ECHO "X$compile_command" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP`
7823
 
        finalize_command=`$ECHO "X$finalize_command" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP`
 
7887
        compile_command=`$ECHO "$compile_command" | $SP2NL | $SED "$lo2o" | $NL2SP`
 
7888
        finalize_command=`$ECHO "$finalize_command" | $SP2NL | $SED "$lo2o" | $NL2SP`
7824
7889
      fi
7825
7890
 
7826
7891
      func_generate_dlsyms "$outputname" "@PROGRAM@" "no"
7832
7897
 
7833
7898
      wrappers_required=yes
7834
7899
      case $host in
 
7900
      *cegcc* | *mingw32ce*)
 
7901
        # Disable wrappers for cegcc and mingw32ce hosts, we are cross compiling anyway.
 
7902
        wrappers_required=no
 
7903
        ;;
7835
7904
      *cygwin* | *mingw* )
7836
7905
        if test "$build_libtool_libs" != yes; then
7837
7906
          wrappers_required=no
7838
7907
        fi
7839
7908
        ;;
7840
 
      *cegcc)
7841
 
        # Disable wrappers for cegcc, we are cross compiling anyway.
7842
 
        wrappers_required=no
7843
 
        ;;
7844
7909
      *)
7845
7910
        if test "$need_relink" = no || test "$build_libtool_libs" != yes; then
7846
7911
          wrappers_required=no
7849
7914
      esac
7850
7915
      if test "$wrappers_required" = no; then
7851
7916
        # Replace the output file specification.
7852
 
        compile_command=`$ECHO "X$compile_command" | $Xsed -e 's%@OUTPUT@%'"$output"'%g'`
 
7917
        compile_command=`$ECHO "$compile_command" | $SED 's%@OUTPUT@%'"$output"'%g'`
7853
7918
        link_command="$compile_command$compile_rpath"
7854
7919
 
7855
7920
        # We have no uninstalled library dependencies, so finalize right now.
7896
7961
        # We don't need to create a wrapper script.
7897
7962
        link_command="$compile_var$compile_command$compile_rpath"
7898
7963
        # Replace the output file specification.
7899
 
        link_command=`$ECHO "X$link_command" | $Xsed -e 's%@OUTPUT@%'"$output"'%g'`
 
7964
        link_command=`$ECHO "$link_command" | $SED 's%@OUTPUT@%'"$output"'%g'`
7900
7965
        # Delete the old output file.
7901
7966
        $opt_dry_run || $RM $output
7902
7967
        # Link the executable and exit
7915
7980
        if test "$fast_install" != no; then
7916
7981
          link_command="$finalize_var$compile_command$finalize_rpath"
7917
7982
          if test "$fast_install" = yes; then
7918
 
            relink_command=`$ECHO "X$compile_var$compile_command$compile_rpath" | $Xsed -e 's%@OUTPUT@%\$progdir/\$file%g'`
 
7983
            relink_command=`$ECHO "$compile_var$compile_command$compile_rpath" | $SED 's%@OUTPUT@%\$progdir/\$file%g'`
7919
7984
          else
7920
7985
            # fast_install is set to needless
7921
7986
            relink_command=
7927
7992
      fi
7928
7993
 
7929
7994
      # Replace the output file specification.
7930
 
      link_command=`$ECHO "X$link_command" | $Xsed -e 's%@OUTPUT@%'"$output_objdir/$outputname"'%g'`
 
7995
      link_command=`$ECHO "$link_command" | $SED 's%@OUTPUT@%'"$output_objdir/$outputname"'%g'`
7931
7996
 
7932
7997
      # Delete the old output files.
7933
7998
      $opt_dry_run || $RM $output $output_objdir/$outputname $output_objdir/lt-$outputname
7951
8016
          fi
7952
8017
        done
7953
8018
        relink_command="(cd `pwd`; $relink_command)"
7954
 
        relink_command=`$ECHO "X$relink_command" | $Xsed -e "$sed_quote_subst"`
7955
 
      fi
7956
 
 
7957
 
      # Quote $ECHO for shipping.
7958
 
      if test "X$ECHO" = "X$SHELL $progpath --fallback-echo"; then
7959
 
        case $progpath in
7960
 
        [\\/]* | [A-Za-z]:[\\/]*) qecho="$SHELL $progpath --fallback-echo";;
7961
 
        *) qecho="$SHELL `pwd`/$progpath --fallback-echo";;
7962
 
        esac
7963
 
        qecho=`$ECHO "X$qecho" | $Xsed -e "$sed_quote_subst"`
7964
 
      else
7965
 
        qecho=`$ECHO "X$ECHO" | $Xsed -e "$sed_quote_subst"`
 
8019
        relink_command=`$ECHO "$relink_command" | $SED "$sed_quote_subst"`
7966
8020
      fi
7967
8021
 
7968
8022
      # Only actually do things if not in dry run mode.
8083
8137
            done | sort | sort -uc >/dev/null 2>&1); then
8084
8138
          :
8085
8139
        else
8086
 
          $ECHO "copying selected object files to avoid basename conflicts..."
 
8140
          echo "copying selected object files to avoid basename conflicts..."
8087
8141
          gentop="$output_objdir/${outputname}x"
8088
8142
          generated="$generated $gentop"
8089
8143
          func_mkdir_p "$gentop"
8115
8169
            esac
8116
8170
          done
8117
8171
        fi
8118
 
        eval cmds=\"$old_archive_cmds\"
 
8172
        eval "cmds=\"$old_archive_cmds\""
8119
8173
 
8120
8174
        func_len " $cmds"
8121
8175
        len=$func_len_result
8135
8189
          do
8136
8190
            last_oldobj=$obj
8137
8191
          done
8138
 
          eval test_cmds=\"$old_archive_cmds\"
 
8192
          eval "test_cmds=\"$old_archive_cmds\""
8139
8193
          func_len " $test_cmds"
8140
8194
          len0=$func_len_result
8141
8195
          len=$len0
8154
8208
                RANLIB=$save_RANLIB
8155
8209
              fi
8156
8210
              test -z "$concat_cmds" || concat_cmds=$concat_cmds~
8157
 
              eval concat_cmds=\"\${concat_cmds}$old_archive_cmds\"
 
8211
              eval "concat_cmds=\"\${concat_cmds}$old_archive_cmds\""
8158
8212
              objlist=
8159
8213
              len=$len0
8160
8214
            fi
8162
8216
          RANLIB=$save_RANLIB
8163
8217
          oldobjs=$objlist
8164
8218
          if test "X$oldobjs" = "X" ; then
8165
 
            eval cmds=\"\$concat_cmds\"
 
8219
            eval "cmds=\"\$concat_cmds\""
8166
8220
          else
8167
 
            eval cmds=\"\$concat_cmds~\$old_archive_cmds\"
 
8221
            eval "cmds=\"\$concat_cmds~\$old_archive_cmds\""
8168
8222
          fi
8169
8223
        fi
8170
8224
      fi
8194
8248
      done
8195
8249
      # Quote the link command for shipping.
8196
8250
      relink_command="(cd `pwd`; $SHELL $progpath $preserve_args --mode=relink $libtool_args @inst_prefix_dir@)"
8197
 
      relink_command=`$ECHO "X$relink_command" | $Xsed -e "$sed_quote_subst"`
 
8251
      relink_command=`$ECHO "$relink_command" | $SED "$sed_quote_subst"`
8198
8252
      if test "$hardcode_automatic" = yes ; then
8199
8253
        relink_command=
8200
8254
      fi
8214
8268
              *.la)
8215
8269
                func_basename "$deplib"
8216
8270
                name="$func_basename_result"
8217
 
                eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $deplib`
 
8271
                libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $deplib`
8218
8272
                test -z "$libdir" && \
8219
8273
                  func_fatal_error "\`$deplib' is not a valid libtool archive"
8220
8274
                newdependency_libs="$newdependency_libs $libdir/$name"
8230
8284
              *.la)
8231
8285
                func_basename "$lib"
8232
8286
                name="$func_basename_result"
8233
 
                eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $lib`
 
8287
                libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $lib`
8234
8288
                test -z "$libdir" && \
8235
8289
                  func_fatal_error "\`$lib' is not a valid libtool archive"
8236
8290
                newdlfiles="$newdlfiles $libdir/$name"
8249
8303
                # the library:
8250
8304
                func_basename "$lib"
8251
8305
                name="$func_basename_result"
8252
 
                eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $lib`
 
8306
                libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $lib`
8253
8307
                test -z "$libdir" && \
8254
8308
                  func_fatal_error "\`$lib' is not a valid libtool archive"
8255
8309
                newdlprefiles="$newdlprefiles $libdir/$name"
8579
8633
# sh-indentation:2
8580
8634
# End:
8581
8635
# vi:sw=2
 
8636