~ubuntu-branches/ubuntu/trusty/cloog/trusty

« back to all changes in this revision

Viewing changes to autoconf/ltmain.sh

  • Committer: Package Import Robot
  • Author(s): Matthias Klose
  • Date: 2011-12-15 18:39:17 UTC
  • mfrom: (1.1.1)
  • Revision ID: package-import@ubuntu.com-20111215183917-uqggmujou8wna9js
Tags: 0.17.0-1
New upstream version.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
# Generated from ltmain.m4sh.
2
2
 
3
 
# libtool (GNU libtool) 2.2.8
 
3
# ltmain.sh (GNU libtool) 2.2.6b
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,
7
 
# 2007, 2008, 2009, 2010 Free Software Foundation, Inc.
 
6
# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005, 2006, 2007 2008 Free Software Foundation, Inc.
8
7
# This is free software; see the source for copying conditions.  There is NO
9
8
# warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
10
9
 
33
32
#
34
33
# Provide generalized library-building support services.
35
34
#
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
 
#       --preserve-dup-deps  don't remove duplicate dependency libraries
42
 
#       --quiet, --silent    don't print informational messages
43
 
#       --no-quiet, --no-silent
44
 
#                            print informational messages (default)
45
 
#       --tag=TAG            use configuration variables from tag TAG
46
 
#   -v, --verbose            print more informational messages than default
47
 
#       --no-verbose         don't print the extra informational messages
48
 
#       --version            print version information
49
 
#   -h, --help, --help-all   print short, long, or detailed help message
 
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
50
46
#
51
47
# MODE must be one of the following:
52
48
#
53
 
#         clean              remove files from the build directory
54
 
#         compile            compile a source file into a libtool object
55
 
#         execute            automatically set library path, then run a program
56
 
#         finish             complete the installation of libtool libraries
57
 
#         install            install libraries or executables
58
 
#         link               create a library or an executable
59
 
#         uninstall          remove libraries from an installed directory
 
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
60
56
#
61
 
# MODE-ARGS vary depending on the MODE.  When passed as first option,
62
 
# `--mode=MODE' may be abbreviated as `MODE' or a unique abbreviation of that.
 
57
# MODE-ARGS vary depending on the MODE.
63
58
# Try `$progname --help --mode=MODE' for a more detailed description of MODE.
64
59
#
65
60
# When reporting a bug, please describe a test case to reproduce it and
66
61
# include the following information:
67
62
#
68
 
#         host-triplet: $host
69
 
#         shell:                $SHELL
70
 
#         compiler:             $LTCC
71
 
#         compiler flags:               $LTCFLAGS
72
 
#         linker:               $LD (gnu? $with_gnu_ld)
73
 
#         $progname:    (GNU libtool) 2.2.8
74
 
#         automake:     $automake_version
75
 
#         autoconf:     $autoconf_version
 
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.6b Debian-2.2.6b-2ubuntu3
 
69
#       automake:               $automake_version
 
70
#       autoconf:               $autoconf_version
76
71
#
77
72
# Report bugs to <bug-libtool@gnu.org>.
78
73
 
79
 
PROGRAM=libtool
 
74
PROGRAM=ltmain.sh
80
75
PACKAGE=libtool
81
 
VERSION=2.2.8
 
76
VERSION="2.2.6b Debian-2.2.6b-2ubuntu3"
82
77
TIMESTAMP=""
83
 
package_revision=1.3169
 
78
package_revision=1.3017
84
79
 
85
80
# Be Bourne compatible
86
81
if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then
96
91
BIN_SH=xpg4; export BIN_SH # for Tru64
97
92
DUALCASE=1; export DUALCASE # for MKS sh
98
93
 
99
 
# A function that is used when there is no print builtin or printf.
100
 
func_fallback_echo ()
101
 
{
102
 
  eval 'cat <<_LTECHO_EOF
103
 
$1
104
 
_LTECHO_EOF'
105
 
}
106
 
 
107
94
# NLS nuisances: We save the old values to restore during execute mode.
 
95
# Only set LANG and LC_ALL to C if already set.
 
96
# These must not be set unconditionally because not all systems understand
 
97
# e.g. LANG=C (notably SCO).
108
98
lt_user_locale=
109
99
lt_safe_locale=
110
100
for lt_var in LANG LANGUAGE LC_ALL LC_CTYPE LC_COLLATE LC_MESSAGES
117
107
          lt_safe_locale=\"$lt_var=C; \$lt_safe_locale\"
118
108
        fi"
119
109
done
120
 
LC_ALL=C
121
 
LANGUAGE=C
122
 
export LANGUAGE LC_ALL
123
110
 
124
111
$lt_unset CDPATH
125
112
 
127
114
 
128
115
 
129
116
 
130
 
 
131
 
# Work around backward compatibility issue on IRIX 6.5. On IRIX 6.4+, sh
132
 
# is ksh but when the shell is invoked as "sh" and the current value of
133
 
# the _XPG environment variable is not equal to 1 (one), the special
134
 
# positional parameter $0, within a function call, is the name of the
135
 
# function.
136
 
progpath="$0"
137
 
 
138
 
 
139
 
 
140
117
: ${CP="cp -f"}
141
 
test "${ECHO+set}" = set || ECHO=${as_echo-'printf %s\n'}
142
 
: ${EGREP="grep -E"}
143
 
: ${FGREP="grep -F"}
144
 
: ${GREP="grep"}
 
118
: ${ECHO="echo"}
 
119
: ${EGREP="/bin/grep -E"}
 
120
: ${FGREP="/bin/grep -F"}
 
121
: ${GREP="/bin/grep"}
145
122
: ${LN_S="ln -s"}
146
123
: ${MAKE="make"}
147
124
: ${MKDIR="mkdir"}
148
125
: ${MV="mv -f"}
149
126
: ${RM="rm -f"}
150
 
: ${SED="sed"}
 
127
: ${SED="/bin/sed"}
151
128
: ${SHELL="${CONFIG_SHELL-/bin/sh}"}
152
129
: ${Xsed="$SED -e 1s/^X//"}
153
130
 
182
159
func_dirname_and_basename ()
183
160
{
184
161
  # Extract subdirectory from the argument.
185
 
  func_dirname_result=`$ECHO "${1}" | $SED -e "$dirname"`
 
162
  func_dirname_result=`$ECHO "X${1}" | $Xsed -e "$dirname"`
186
163
  if test "X$func_dirname_result" = "X${1}"; then
187
164
    func_dirname_result="${3}"
188
165
  else
189
166
    func_dirname_result="$func_dirname_result${2}"
190
167
  fi
191
 
  func_basename_result=`$ECHO "${1}" | $SED -e "$basename"`
 
168
  func_basename_result=`$ECHO "X${1}" | $Xsed -e "$basename"`
192
169
}
193
170
 
194
171
# Generated shell functions inserted here.
195
172
 
196
 
# These SED scripts presuppose an absolute path with a trailing slash.
197
 
pathcar='s,^/\([^/]*\).*$,\1,'
198
 
pathcdr='s,^/[^/]*,,'
199
 
removedotparts=':dotsl
200
 
                s@/\./@/@g
201
 
                t dotsl
202
 
                s,/\.$,/,'
203
 
collapseslashes='s@/\{1,\}@/@g'
204
 
finalslash='s,/*$,/,'
205
 
 
206
 
# func_normal_abspath PATH
207
 
# Remove doubled-up and trailing slashes, "." path components,
208
 
# and cancel out any ".." path components in PATH after making
209
 
# it an absolute path.
210
 
#             value returned in "$func_normal_abspath_result"
211
 
func_normal_abspath ()
212
 
{
213
 
  # Start from root dir and reassemble the path.
214
 
  func_normal_abspath_result=
215
 
  func_normal_abspath_tpath=$1
216
 
  func_normal_abspath_altnamespace=
217
 
  case $func_normal_abspath_tpath in
218
 
    "")
219
 
      # Empty path, that just means $cwd.
220
 
      func_stripname '' '/' "`pwd`"
221
 
      func_normal_abspath_result=$func_stripname_result
222
 
      return
223
 
    ;;
224
 
    # The next three entries are used to spot a run of precisely
225
 
    # two leading slashes without using negated character classes;
226
 
    # we take advantage of case's first-match behaviour.
227
 
    ///*)
228
 
      # Unusual form of absolute path, do nothing.
229
 
    ;;
230
 
    //*)
231
 
      # Not necessarily an ordinary path; POSIX reserves leading '//'
232
 
      # and for example Cygwin uses it to access remote file shares
233
 
      # over CIFS/SMB, so we conserve a leading double slash if found.
234
 
      func_normal_abspath_altnamespace=/
235
 
    ;;
236
 
    /*)
237
 
      # Absolute path, do nothing.
238
 
    ;;
239
 
    *)
240
 
      # Relative path, prepend $cwd.
241
 
      func_normal_abspath_tpath=`pwd`/$func_normal_abspath_tpath
242
 
    ;;
243
 
  esac
244
 
  # Cancel out all the simple stuff to save iterations.  We also want
245
 
  # the path to end with a slash for ease of parsing, so make sure
246
 
  # there is one (and only one) here.
247
 
  func_normal_abspath_tpath=`$ECHO "$func_normal_abspath_tpath" | $SED \
248
 
        -e "$removedotparts" -e "$collapseslashes" -e "$finalslash"`
249
 
  while :; do
250
 
    # Processed it all yet?
251
 
    if test "$func_normal_abspath_tpath" = / ; then
252
 
      # If we ascended to the root using ".." the result may be empty now.
253
 
      if test -z "$func_normal_abspath_result" ; then
254
 
        func_normal_abspath_result=/
255
 
      fi
256
 
      break
257
 
    fi
258
 
    func_normal_abspath_tcomponent=`$ECHO "$func_normal_abspath_tpath" | $SED \
259
 
        -e "$pathcar"`
260
 
    func_normal_abspath_tpath=`$ECHO "$func_normal_abspath_tpath" | $SED \
261
 
        -e "$pathcdr"`
262
 
    # Figure out what to do with it
263
 
    case $func_normal_abspath_tcomponent in
264
 
      "")
265
 
        # Trailing empty path component, ignore it.
266
 
      ;;
267
 
      ..)
268
 
        # Parent dir; strip last assembled component from result.
269
 
        func_dirname "$func_normal_abspath_result"
270
 
        func_normal_abspath_result=$func_dirname_result
271
 
      ;;
272
 
      *)
273
 
        # Actual path component, append it.
274
 
        func_normal_abspath_result=$func_normal_abspath_result/$func_normal_abspath_tcomponent
275
 
      ;;
276
 
    esac
277
 
  done
278
 
  # Restore leading double-slash if one was found on entry.
279
 
  func_normal_abspath_result=$func_normal_abspath_altnamespace$func_normal_abspath_result
280
 
}
281
 
 
282
 
# func_relative_path SRCDIR DSTDIR
283
 
# generates a relative path from SRCDIR to DSTDIR, with a trailing
284
 
# slash if non-empty, suitable for immediately appending a filename
285
 
# without needing to append a separator.
286
 
#             value returned in "$func_relative_path_result"
287
 
func_relative_path ()
288
 
{
289
 
  func_relative_path_result=
290
 
  func_normal_abspath "$1"
291
 
  func_relative_path_tlibdir=$func_normal_abspath_result
292
 
  func_normal_abspath "$2"
293
 
  func_relative_path_tbindir=$func_normal_abspath_result
294
 
 
295
 
  # Ascend the tree starting from libdir
296
 
  while :; do
297
 
    # check if we have found a prefix of bindir
298
 
    case $func_relative_path_tbindir in
299
 
      $func_relative_path_tlibdir)
300
 
        # found an exact match
301
 
        func_relative_path_tcancelled=
302
 
        break
303
 
        ;;
304
 
      $func_relative_path_tlibdir*)
305
 
        # found a matching prefix
306
 
        func_stripname "$func_relative_path_tlibdir" '' "$func_relative_path_tbindir"
307
 
        func_relative_path_tcancelled=$func_stripname_result
308
 
        if test -z "$func_relative_path_result"; then
309
 
          func_relative_path_result=.
310
 
        fi
311
 
        break
312
 
        ;;
313
 
      *)
314
 
        func_dirname $func_relative_path_tlibdir
315
 
        func_relative_path_tlibdir=${func_dirname_result}
316
 
        if test "x$func_relative_path_tlibdir" = x ; then
317
 
          # Have to descend all the way to the root!
318
 
          func_relative_path_result=../$func_relative_path_result
319
 
          func_relative_path_tcancelled=$func_relative_path_tbindir
320
 
          break
321
 
        fi
322
 
        func_relative_path_result=../$func_relative_path_result
323
 
        ;;
324
 
    esac
325
 
  done
326
 
 
327
 
  # Now calculate path; take care to avoid doubling-up slashes.
328
 
  func_stripname '' '/' "$func_relative_path_result"
329
 
  func_relative_path_result=$func_stripname_result
330
 
  func_stripname '/' '/' "$func_relative_path_tcancelled"
331
 
  if test "x$func_stripname_result" != x ; then
332
 
    func_relative_path_result=${func_relative_path_result}/${func_stripname_result}
333
 
  fi
334
 
 
335
 
  # Normalisation. If bindir is libdir, return empty string,
336
 
  # else relative path ending with a slash; either way, target
337
 
  # file name can be directly appended.
338
 
  if test ! -z "$func_relative_path_result"; then
339
 
    func_stripname './' '' "$func_relative_path_result/"
340
 
    func_relative_path_result=$func_stripname_result
341
 
  fi
342
 
}
 
173
# Work around backward compatibility issue on IRIX 6.5. On IRIX 6.4+, sh
 
174
# is ksh but when the shell is invoked as "sh" and the current value of
 
175
# the _XPG environment variable is not equal to 1 (one), the special
 
176
# positional parameter $0, within a function call, is the name of the
 
177
# function.
 
178
progpath="$0"
343
179
 
344
180
# The name of this program:
 
181
# In the unlikely event $progname began with a '-', it would play havoc with
 
182
# func_echo (imagine progname=-n), so we prepend ./ in that case:
345
183
func_dirname_and_basename "$progpath"
346
184
progname=$func_basename_result
 
185
case $progname in
 
186
  -*) progname=./$progname ;;
 
187
esac
347
188
 
348
189
# Make sure we have an absolute path for reexecution:
349
190
case $progpath in
417
258
    :
418
259
}
419
260
 
420
 
# func_echo_all arg...
421
 
# Invoke $ECHO with all args, space-separated.
422
 
func_echo_all ()
423
 
{
424
 
    $ECHO "$*"
425
 
}
426
 
 
427
261
# func_error arg...
428
262
# Echo program name prefixed message to standard error.
429
263
func_error ()
492
326
        case $my_directory_path in */*) ;; *) break ;; esac
493
327
 
494
328
        # ...otherwise throw away the child directory and loop
495
 
        my_directory_path=`$ECHO "$my_directory_path" | $SED -e "$dirname"`
 
329
        my_directory_path=`$ECHO "X$my_directory_path" | $Xsed -e "$dirname"`
496
330
      done
497
 
      my_dir_list=`$ECHO "$my_dir_list" | $SED 's,:*$,,'`
 
331
      my_dir_list=`$ECHO "X$my_dir_list" | $Xsed -e 's,:*$,,'`
498
332
 
499
333
      save_mkdir_p_IFS="$IFS"; IFS=':'
500
334
      for my_dir in $my_dir_list; do
544
378
        func_fatal_error "cannot create temporary directory \`$my_tmpdir'"
545
379
    fi
546
380
 
547
 
    $ECHO "$my_tmpdir"
 
381
    $ECHO "X$my_tmpdir" | $Xsed
548
382
}
549
383
 
550
384
 
558
392
{
559
393
    case $1 in
560
394
      *[\\\`\"\$]*)
561
 
        func_quote_for_eval_unquoted_result=`$ECHO "$1" | $SED "$sed_quote_subst"` ;;
 
395
        func_quote_for_eval_unquoted_result=`$ECHO "X$1" | $Xsed -e "$sed_quote_subst"` ;;
562
396
      *)
563
397
        func_quote_for_eval_unquoted_result="$1" ;;
564
398
    esac
585
419
{
586
420
    case $1 in
587
421
      *[\\\`\"]*)
588
 
        my_arg=`$ECHO "$1" | $SED \
 
422
        my_arg=`$ECHO "X$1" | $Xsed \
589
423
            -e "$double_quote_subst" -e "$sed_double_backslash"` ;;
590
424
      *)
591
425
        my_arg="$1" ;;
656
490
 
657
491
 
658
492
 
 
493
 
 
494
 
659
495
# func_version
660
496
# Echo version message to standard output and exit.
661
497
func_version ()
662
498
{
663
 
    $SED -n '/(C)/!b go
664
 
        :more
665
 
        /\./!{
666
 
          N
667
 
          s/\n# //
668
 
          b more
669
 
        }
670
 
        :go
671
 
        /^# '$PROGRAM' (GNU /,/# warranty; / {
 
499
    $SED -n '/^# '$PROGRAM' (GNU /,/# warranty; / {
672
500
        s/^# //
673
501
        s/^# *$//
674
502
        s/\((C)\)[ 0-9,-]*\( [1-9][0-9]*\)/\1\2/
681
509
# Echo short help message to standard output and exit.
682
510
func_usage ()
683
511
{
684
 
    $SED -n '/^# Usage:/,/^#  *.*--help/ {
 
512
    $SED -n '/^# Usage:/,/# -h/ {
685
513
        s/^# //
686
514
        s/^# *$//
687
515
        s/\$progname/'$progname'/
688
516
        p
689
517
    }' < "$progpath"
690
 
    echo
 
518
    $ECHO
691
519
    $ECHO "run \`$progname --help | more' for full usage"
692
520
    exit $?
693
521
}
694
522
 
695
 
# func_help [NOEXIT]
696
 
# Echo long help message to standard output and exit,
697
 
# unless 'noexit' is passed as argument.
 
523
# func_help
 
524
# Echo long help message to standard output and exit.
698
525
func_help ()
699
526
{
700
527
    $SED -n '/^# Usage:/,/# Report bugs to/ {
711
538
        s/\$autoconf_version/'"`(autoconf --version) 2>/dev/null |$SED 1q`"'/
712
539
        p
713
540
     }' < "$progpath"
714
 
    ret=$?
715
 
    if test -z "$1"; then
716
 
      exit $ret
717
 
    fi
 
541
    exit $?
718
542
}
719
543
 
720
544
# func_missing_arg argname
722
546
# exit_cmd.
723
547
func_missing_arg ()
724
548
{
725
 
    func_error "missing argument for $1."
 
549
    func_error "missing argument for $1"
726
550
    exit_cmd=exit
727
551
}
728
552
 
732
556
 
733
557
 
734
558
 
 
559
# Check that we have a working $ECHO.
 
560
if test "X$1" = X--no-reexec; then
 
561
  # Discard the --no-reexec flag, and continue.
 
562
  shift
 
563
elif test "X$1" = X--fallback-echo; then
 
564
  # Avoid inline document here, it may be left over
 
565
  :
 
566
elif test "X`{ $ECHO '\t'; } 2>/dev/null`" = 'X\t'; then
 
567
  # Yippee, $ECHO works!
 
568
  :
 
569
else
 
570
  # Restart under the correct shell, and then maybe $ECHO will work.
 
571
  exec $SHELL "$progpath" --no-reexec ${1+"$@"}
 
572
fi
 
573
 
 
574
if test "X$1" = X--fallback-echo; then
 
575
  # used as fallback echo
 
576
  shift
 
577
  cat <<EOF
 
578
$*
 
579
EOF
 
580
  exit $EXIT_SUCCESS
 
581
fi
735
582
 
736
583
magic="%%%MAGIC variable%%%"
737
584
magic_exe="%%%MAGIC EXE variable%%%"
789
636
# Display the features supported by this script.
790
637
func_features ()
791
638
{
792
 
    echo "host: $host"
 
639
    $ECHO "host: $host"
793
640
    if test "$build_libtool_libs" = yes; then
794
 
      echo "enable shared libraries"
 
641
      $ECHO "enable shared libraries"
795
642
    else
796
 
      echo "disable shared libraries"
 
643
      $ECHO "disable shared libraries"
797
644
    fi
798
645
    if test "$build_old_libs" = yes; then
799
 
      echo "enable static libraries"
 
646
      $ECHO "enable static libraries"
800
647
    else
801
 
      echo "disable static libraries"
 
648
      $ECHO "disable static libraries"
802
649
    fi
803
650
 
804
651
    exit $?
925
772
 
926
773
      --quiet|--silent) preserve_args="$preserve_args $opt"
927
774
                        opt_silent=:
928
 
                        opt_verbose=false
929
 
                        ;;
930
 
 
931
 
      --no-quiet|--no-silent)
932
 
                        preserve_args="$preserve_args $opt"
933
 
                        opt_silent=false
934
775
                        ;;
935
776
 
936
777
      --verbose| -v)    preserve_args="$preserve_args $opt"
937
778
                        opt_silent=false
938
 
                        opt_verbose=:
939
 
                        ;;
940
 
 
941
 
      --no-verbose)     preserve_args="$preserve_args $opt"
942
 
                        opt_verbose=false
943
779
                        ;;
944
780
 
945
781
      --tag)            test "$#" -eq 0 && func_missing_arg "$opt" && break
957
793
 
958
794
      -\?|-h)           func_usage                                      ;;
959
795
      --help)           opt_help=:                                      ;;
960
 
      --help-all)       opt_help=': help-all'                           ;;
961
796
      --version)        func_version                                    ;;
962
797
 
963
798
      -*)               func_fatal_help "unrecognized option \`$opt'"   ;;
1181
1016
        func_quote_for_eval "$arg"
1182
1017
        CC_quoted="$CC_quoted $func_quote_for_eval_result"
1183
1018
      done
1184
 
      CC_expanded=`func_echo_all $CC`
1185
 
      CC_quoted_expanded=`func_echo_all $CC_quoted`
1186
1019
      case $@ in
1187
1020
      # Blanks in the command may have been stripped by the calling shell,
1188
1021
      # but not from the CC environment variable when configure was run.
1189
 
      " $CC "* | "$CC "* | " $CC_expanded "* | "$CC_expanded "* | \
1190
 
      " $CC_quoted"* | "$CC_quoted "* | " $CC_quoted_expanded "* | "$CC_quoted_expanded "*) ;;
 
1022
      " $CC "* | "$CC "* | " `$ECHO $CC` "* | "`$ECHO $CC` "* | " $CC_quoted"* | "$CC_quoted "* | " `$ECHO $CC_quoted` "* | "`$ECHO $CC_quoted` "*) ;;
1191
1023
      # Blanks at the start of $base_compile will cause this to fail
1192
1024
      # if we don't check for them as well.
1193
1025
      *)
1201
1033
              func_quote_for_eval "$arg"
1202
1034
              CC_quoted="$CC_quoted $func_quote_for_eval_result"
1203
1035
            done
1204
 
            CC_expanded=`func_echo_all $CC`
1205
 
            CC_quoted_expanded=`func_echo_all $CC_quoted`
1206
1036
            case "$@ " in
1207
 
            " $CC "* | "$CC "* | " $CC_expanded "* | "$CC_expanded "* | \
1208
 
            " $CC_quoted"* | "$CC_quoted "* | " $CC_quoted_expanded "* | "$CC_quoted_expanded "*)
 
1037
              " $CC "* | "$CC "* | " `$ECHO $CC` "* | "`$ECHO $CC` "* | " $CC_quoted"* | "$CC_quoted "* | " `$ECHO $CC_quoted` "* | "`$ECHO $CC_quoted` "*)
1209
1038
              # The compiler in the base compile command matches
1210
1039
              # the one in the tagged configuration.
1211
1040
              # Assume this is the tagged configuration we want.
1384
1213
    *.[cCFSifmso] | \
1385
1214
    *.ada | *.adb | *.ads | *.asm | \
1386
1215
    *.c++ | *.cc | *.ii | *.class | *.cpp | *.cxx | \
1387
 
    *.[fF][09]? | *.for | *.java | *.obj | *.sx | *.cu | *.cup)
 
1216
    *.[fF][09]? | *.for | *.java | *.obj | *.sx)
1388
1217
      func_xform "$libobj"
1389
1218
      libobj=$func_xform_result
1390
1219
      ;;
1459
1288
    # Calculate the filename of the output object if compiler does
1460
1289
    # not support -o with -c
1461
1290
    if test "$compiler_c_o" = no; then
1462
 
      output_obj=`$ECHO "$srcfile" | $SED 's%^.*/%%; s%\.[^.]*$%%'`.${objext}
 
1291
      output_obj=`$ECHO "X$srcfile" | $Xsed -e 's%^.*/%%' -e 's%\.[^.]*$%%'`.${objext}
1463
1292
      lockfile="$output_obj.lock"
1464
1293
    else
1465
1294
      output_obj=
1616
1445
}
1617
1446
 
1618
1447
$opt_help || {
1619
 
  test "$mode" = compile && func_mode_compile ${1+"$@"}
 
1448
test "$mode" = compile && func_mode_compile ${1+"$@"}
1620
1449
}
1621
1450
 
1622
1451
func_mode_help ()
1653
1482
 
1654
1483
  -o OUTPUT-FILE    set the output file name to OUTPUT-FILE
1655
1484
  -no-suppress      do not suppress compiler output for multiple passes
1656
 
  -prefer-pic       try to build PIC objects only
1657
 
  -prefer-non-pic   try to build non-PIC objects only
 
1485
  -prefer-pic       try to building PIC objects only
 
1486
  -prefer-non-pic   try to building non-PIC objects only
1658
1487
  -shared           do not build a \`.o' file suitable for static linking
1659
1488
  -static           only build a \`.o' file suitable for static linking
1660
 
  -Wc,FLAG          pass FLAG directly to the compiler
1661
1489
 
1662
1490
COMPILE-COMMAND is a command to be used in creating a \`standard' object file
1663
1491
from the given SOURCEFILE.
1710
1538
 
1711
1539
The following components of INSTALL-COMMAND are treated specially:
1712
1540
 
1713
 
  -inst-prefix-dir PREFIX-DIR  Use PREFIX-DIR as a staging area for installation
 
1541
  -inst-prefix PREFIX-DIR  Use PREFIX-DIR as a staging area for installation
1714
1542
 
1715
1543
The rest of the components are interpreted as arguments to that command (only
1716
1544
BSD-compatible install options are recognized)."
1730
1558
 
1731
1559
  -all-static       do not do any dynamic linking at all
1732
1560
  -avoid-version    do not add a version suffix if possible
1733
 
  -bindir BINDIR    specify path to binaries directory (for systems where
1734
 
                    libraries must be found in the PATH setting at runtime)
1735
1561
  -dlopen FILE      \`-dlpreopen' FILE if it cannot be dlopened at runtime
1736
1562
  -dlpreopen FILE   link in FILE and add its symbols to lt_preloaded_symbols
1737
1563
  -export-dynamic   allow symbols from OUTPUT-FILE to be resolved with dlsym(3)
1760
1586
  -version-info CURRENT[:REVISION[:AGE]]
1761
1587
                    specify library version info [each variable defaults to 0]
1762
1588
  -weak LIBNAME     declare that the target provides the LIBNAME interface
1763
 
  -Wc,FLAG
1764
 
  -Xcompiler FLAG   pass linker-specific FLAG directly to the compiler
1765
 
  -Wl,FLAG
1766
 
  -Xlinker FLAG     pass linker-specific FLAG directly to the linker
1767
 
  -XCClinker FLAG   pass link-specific FLAG to the compiler driver (CC)
1768
1589
 
1769
1590
All other options (arguments beginning with \`-') are ignored.
1770
1591
 
1802
1623
        ;;
1803
1624
    esac
1804
1625
 
1805
 
    echo
 
1626
    $ECHO
1806
1627
    $ECHO "Try \`$progname --help' for more information about other modes."
 
1628
 
 
1629
    exit $?
1807
1630
}
1808
1631
 
1809
 
# Now that we've collected a possible --mode arg, show help if necessary
1810
 
if $opt_help; then
1811
 
  if test "$opt_help" = :; then
1812
 
    func_mode_help
1813
 
  else
1814
 
    {
1815
 
      func_help noexit
1816
 
      for mode in compile link execute install finish uninstall clean; do
1817
 
        func_mode_help
1818
 
      done
1819
 
    } | sed -n '1p; 2,$s/^Usage:/  or: /p'
1820
 
    {
1821
 
      func_help noexit
1822
 
      for mode in compile link execute install finish uninstall clean; do
1823
 
        echo
1824
 
        func_mode_help
1825
 
      done
1826
 
    } |
1827
 
    sed '1d
1828
 
      /^When reporting/,/^Report/{
1829
 
        H
1830
 
        d
1831
 
      }
1832
 
      $x
1833
 
      /information about other modes/d
1834
 
      /more detailed .*MODE/d
1835
 
      s/^Usage:.*--mode=\([^ ]*\) .*/Description of \1 mode:/'
1836
 
  fi
1837
 
  exit $?
1838
 
fi
 
1632
  # Now that we've collected a possible --mode arg, show help if necessary
 
1633
  $opt_help && func_mode_help
1839
1634
 
1840
1635
 
1841
1636
# func_mode_execute arg...
1917
1712
    for file
1918
1713
    do
1919
1714
      case $file in
1920
 
      -* | *.la | *.lo ) ;;
 
1715
      -*) ;;
1921
1716
      *)
1922
1717
        # Do a test to see if this is really a libtool program.
1923
1718
        if func_ltwrapper_script_p "$file"; then
1959
1754
      # Display what would be done.
1960
1755
      if test -n "$shlibpath_var"; then
1961
1756
        eval "\$ECHO \"\$shlibpath_var=\$$shlibpath_var\""
1962
 
        echo "export $shlibpath_var"
 
1757
        $ECHO "export $shlibpath_var"
1963
1758
      fi
1964
1759
      $ECHO "$cmd$args"
1965
1760
      exit $EXIT_SUCCESS
2000
1795
    # Exit here if they wanted silent mode.
2001
1796
    $opt_silent && exit $EXIT_SUCCESS
2002
1797
 
2003
 
    echo "----------------------------------------------------------------------"
2004
 
    echo "Libraries have been installed in:"
 
1798
    $ECHO "X----------------------------------------------------------------------" | $Xsed
 
1799
    $ECHO "Libraries have been installed in:"
2005
1800
    for libdir in $libdirs; do
2006
1801
      $ECHO "   $libdir"
2007
1802
    done
2008
 
    echo
2009
 
    echo "If you ever happen to want to link against installed libraries"
2010
 
    echo "in a given directory, LIBDIR, you must either use libtool, and"
2011
 
    echo "specify the full pathname of the library, or use the \`-LLIBDIR'"
2012
 
    echo "flag during linking and do at least one of the following:"
 
1803
    $ECHO
 
1804
    $ECHO "If you ever happen to want to link against installed libraries"
 
1805
    $ECHO "in a given directory, LIBDIR, you must either use libtool, and"
 
1806
    $ECHO "specify the full pathname of the library, or use the \`-LLIBDIR'"
 
1807
    $ECHO "flag during linking and do at least one of the following:"
2013
1808
    if test -n "$shlibpath_var"; then
2014
 
      echo "   - add LIBDIR to the \`$shlibpath_var' environment variable"
2015
 
      echo "     during execution"
 
1809
      $ECHO "   - add LIBDIR to the \`$shlibpath_var' environment variable"
 
1810
      $ECHO "     during execution"
2016
1811
    fi
2017
1812
    if test -n "$runpath_var"; then
2018
 
      echo "   - add LIBDIR to the \`$runpath_var' environment variable"
2019
 
      echo "     during linking"
 
1813
      $ECHO "   - add LIBDIR to the \`$runpath_var' environment variable"
 
1814
      $ECHO "     during linking"
2020
1815
    fi
2021
1816
    if test -n "$hardcode_libdir_flag_spec"; then
2022
1817
      libdir=LIBDIR
2028
1823
      $ECHO "   - have your system administrator run these commands:$admincmds"
2029
1824
    fi
2030
1825
    if test -f /etc/ld.so.conf; then
2031
 
      echo "   - have your system administrator add LIBDIR to \`/etc/ld.so.conf'"
 
1826
      $ECHO "   - have your system administrator add LIBDIR to \`/etc/ld.so.conf'"
2032
1827
    fi
2033
 
    echo
 
1828
    $ECHO
2034
1829
 
2035
 
    echo "See any operating system documentation about shared libraries for"
 
1830
    $ECHO "See any operating system documentation about shared libraries for"
2036
1831
    case $host in
2037
1832
      solaris2.[6789]|solaris2.1[0-9])
2038
 
        echo "more information, such as the ld(1), crle(1) and ld.so(8) manual"
2039
 
        echo "pages."
 
1833
        $ECHO "more information, such as the ld(1), crle(1) and ld.so(8) manual"
 
1834
        $ECHO "pages."
2040
1835
        ;;
2041
1836
      *)
2042
 
        echo "more information, such as the ld(1) and ld.so(8) manual pages."
 
1837
        $ECHO "more information, such as the ld(1) and ld.so(8) manual pages."
2043
1838
        ;;
2044
1839
    esac
2045
 
    echo "----------------------------------------------------------------------"
 
1840
    $ECHO "X----------------------------------------------------------------------" | $Xsed
2046
1841
    exit $EXIT_SUCCESS
2047
1842
}
2048
1843
 
2057
1852
    # install_prog (especially on Windows NT).
2058
1853
    if test "$nonopt" = "$SHELL" || test "$nonopt" = /bin/sh ||
2059
1854
       # Allow the use of GNU shtool's install command.
2060
 
       case $nonopt in *shtool*) :;; *) false;; esac; then
 
1855
       $ECHO "X$nonopt" | $GREP shtool >/dev/null; then
2061
1856
      # Aesthetically quote it.
2062
1857
      func_quote_for_eval "$nonopt"
2063
1858
      install_prog="$func_quote_for_eval_result "
2072
1867
    # Aesthetically quote it.
2073
1868
    func_quote_for_eval "$arg"
2074
1869
    install_prog="$install_prog$func_quote_for_eval_result"
2075
 
    install_shared_prog=$install_prog
2076
 
    case " $install_prog " in
2077
 
      *[\\\ /]cp\ *) install_cp=: ;;
2078
 
      *) install_cp=false ;;
2079
 
    esac
2080
1870
 
2081
1871
    # We need to accept at least all the BSD install flags.
2082
1872
    dest=
2086
1876
    install_type=
2087
1877
    isdir=no
2088
1878
    stripme=
2089
 
    no_mode=:
2090
1879
    for arg
2091
1880
    do
2092
 
      arg2=
2093
1881
      if test -n "$dest"; then
2094
1882
        files="$files $dest"
2095
1883
        dest=$arg
2099
1887
      case $arg in
2100
1888
      -d) isdir=yes ;;
2101
1889
      -f)
2102
 
        if $install_cp; then :; else
2103
 
          prev=$arg
2104
 
        fi
 
1890
        case " $install_prog " in
 
1891
        *[\\\ /]cp\ *) ;;
 
1892
        *) prev=$arg ;;
 
1893
        esac
2105
1894
        ;;
2106
1895
      -g | -m | -o)
2107
1896
        prev=$arg
2115
1904
      *)
2116
1905
        # If the previous option needed an argument, then skip it.
2117
1906
        if test -n "$prev"; then
2118
 
          if test "x$prev" = x-m && test -n "$install_override_mode"; then
2119
 
            arg2=$install_override_mode
2120
 
            no_mode=false
2121
 
          fi
2122
1907
          prev=
2123
1908
        else
2124
1909
          dest=$arg
2130
1915
      # Aesthetically quote the argument.
2131
1916
      func_quote_for_eval "$arg"
2132
1917
      install_prog="$install_prog $func_quote_for_eval_result"
2133
 
      if test -n "$arg2"; then
2134
 
        func_quote_for_eval "$arg2"
2135
 
      fi
2136
 
      install_shared_prog="$install_shared_prog $func_quote_for_eval_result"
2137
1918
    done
2138
1919
 
2139
1920
    test -z "$install_prog" && \
2142
1923
    test -n "$prev" && \
2143
1924
      func_fatal_help "the \`$prev' option requires an argument"
2144
1925
 
2145
 
    if test -n "$install_override_mode" && $no_mode; then
2146
 
      if $install_cp; then :; else
2147
 
        func_quote_for_eval "$install_override_mode"
2148
 
        install_shared_prog="$install_shared_prog -m $func_quote_for_eval_result"
2149
 
      fi
2150
 
    fi
2151
 
 
2152
1926
    if test -z "$files"; then
2153
1927
      if test -z "$dest"; then
2154
1928
        func_fatal_help "no file or destination specified"
2236
2010
 
2237
2011
        if test -n "$relink_command"; then
2238
2012
          # Determine the prefix the user has applied to our future dir.
2239
 
          inst_prefix_dir=`$ECHO "$destdir" | $SED -e "s%$libdir\$%%"`
 
2013
          inst_prefix_dir=`$ECHO "X$destdir" | $Xsed -e "s%$libdir\$%%"`
2240
2014
 
2241
2015
          # Don't allow the user to place us outside of our expected
2242
2016
          # location b/c this prevents finding dependent libraries that
2249
2023
 
2250
2024
          if test -n "$inst_prefix_dir"; then
2251
2025
            # Stick the inst_prefix_dir data into the link command.
2252
 
            relink_command=`$ECHO "$relink_command" | $SED "s%@inst_prefix_dir@%-inst-prefix-dir $inst_prefix_dir%"`
 
2026
            relink_command=`$ECHO "X$relink_command" | $Xsed -e "s%@inst_prefix_dir@%-inst-prefix-dir $inst_prefix_dir%"`
2253
2027
          else
2254
 
            relink_command=`$ECHO "$relink_command" | $SED "s%@inst_prefix_dir@%%"`
 
2028
            relink_command=`$ECHO "X$relink_command" | $Xsed -e "s%@inst_prefix_dir@%%"`
2255
2029
          fi
2256
2030
 
2257
2031
          func_warning "relinking \`$file'"
2269
2043
          test -n "$relink_command" && srcname="$realname"T
2270
2044
 
2271
2045
          # Install the shared library and build the symlinks.
2272
 
          func_show_eval "$install_shared_prog $dir/$srcname $destdir/$realname" \
 
2046
          func_show_eval "$install_prog $dir/$srcname $destdir/$realname" \
2273
2047
              'exit $?'
2274
2048
          tstripme="$stripme"
2275
2049
          case $host_os in
2409
2183
            if test -f "$lib"; then
2410
2184
              func_source "$lib"
2411
2185
            fi
2412
 
            libfile="$libdir/"`$ECHO "$lib" | $SED 's%^.*/%%g'` ### testsuite: skip nested quoting test
 
2186
            libfile="$libdir/"`$ECHO "X$lib" | $Xsed -e 's%^.*/%%g'` ### testsuite: skip nested quoting test
2413
2187
            if test -n "$libdir" && test ! -f "$libfile"; then
2414
2188
              func_warning "\`$lib' has not been installed in \`$libdir'"
2415
2189
              finalize=no
2428
2202
                file="$func_basename_result"
2429
2203
                outputname="$tmpdir/$file"
2430
2204
                # Replace the output file specification.
2431
 
                relink_command=`$ECHO "$relink_command" | $SED 's%@OUTPUT@%'"$outputname"'%g'`
 
2205
                relink_command=`$ECHO "X$relink_command" | $Xsed -e 's%@OUTPUT@%'"$outputname"'%g'`
2432
2206
 
2433
2207
                $opt_silent || {
2434
2208
                  func_quote_for_expand "$relink_command"
2447
2221
            }
2448
2222
          else
2449
2223
            # Install the binary that we compiled earlier.
2450
 
            file=`$ECHO "$file$stripped_ext" | $SED "s%\([^/]*\)$%$objdir/\1%"`
 
2224
            file=`$ECHO "X$file$stripped_ext" | $Xsed -e "s%\([^/]*\)$%$objdir/\1%"`
2451
2225
          fi
2452
2226
        fi
2453
2227
 
2549
2323
extern \"C\" {
2550
2324
#endif
2551
2325
 
2552
 
#if defined(__GNUC__) && (((__GNUC__ == 4) && (__GNUC_MINOR__ >= 4)) || (__GNUC__ > 4))
2553
 
#pragma GCC diagnostic ignored \"-Wstrict-prototypes\"
2554
 
#endif
2555
 
 
2556
2326
/* External symbol declarations for the compiler. */\
2557
2327
"
2558
2328
 
2562
2332
          $opt_dry_run || echo ': @PROGRAM@ ' > "$nlist"
2563
2333
 
2564
2334
          # Add our own program objects to the symbol list.
2565
 
          progfiles=`$ECHO "$objs$old_deplibs" | $SP2NL | $SED "$lo2o" | $NL2SP`
 
2335
          progfiles=`$ECHO "X$objs$old_deplibs" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP`
2566
2336
          for progfile in $progfiles; do
2567
2337
            func_verbose "extracting global C symbols from \`$progfile'"
2568
2338
            $opt_dry_run || eval "$NM $progfile | $global_symbol_pipe >> '$nlist'"
2601
2371
              eval '$GREP -f "$output_objdir/$outputname.exp" < "$nlist" > "$nlist"T'
2602
2372
              eval '$MV "$nlist"T "$nlist"'
2603
2373
              case $host in
2604
 
                *cygwin* | *mingw* | *cegcc* )
 
2374
                *cygwin | *mingw* | *cegcc* )
2605
2375
                  eval "echo EXPORTS "'> "$output_objdir/$outputname.def"'
2606
2376
                  eval 'cat "$nlist" >> "$output_objdir/$outputname.def"'
2607
2377
                  ;;
2645
2415
          if test -f "$nlist"S; then
2646
2416
            eval "$global_symbol_to_cdecl"' < "$nlist"S >> "$output_objdir/$my_dlsyms"'
2647
2417
          else
2648
 
            echo '/* NONE */' >> "$output_objdir/$my_dlsyms"
 
2418
            $ECHO '/* NONE */' >> "$output_objdir/$my_dlsyms"
2649
2419
          fi
2650
2420
 
2651
 
          echo >> "$output_objdir/$my_dlsyms" "\
 
2421
          $ECHO >> "$output_objdir/$my_dlsyms" "\
2652
2422
 
2653
2423
/* The mapping between symbol names and symbols.  */
2654
2424
typedef struct {
2658
2428
"
2659
2429
          case $host in
2660
2430
          *cygwin* | *mingw* | *cegcc* )
2661
 
            echo >> "$output_objdir/$my_dlsyms" "\
 
2431
            $ECHO >> "$output_objdir/$my_dlsyms" "\
2662
2432
/* DATA imports from DLLs on WIN32 con't be const, because
2663
2433
   runtime relocations are performed -- see ld's documentation
2664
2434
   on pseudo-relocs.  */"
2671
2441
            lt_dlsym_const=const ;;
2672
2442
          esac
2673
2443
 
2674
 
          echo >> "$output_objdir/$my_dlsyms" "\
 
2444
          $ECHO >> "$output_objdir/$my_dlsyms" "\
2675
2445
extern $lt_dlsym_const lt_dlsymlist
2676
2446
lt_${my_prefix}_LTX_preloaded_symbols[];
2677
2447
$lt_dlsym_const lt_dlsymlist
2687
2457
            eval "$global_symbol_to_c_name_address_lib_prefix" < "$nlist" >> "$output_objdir/$my_dlsyms"
2688
2458
            ;;
2689
2459
          esac
2690
 
          echo >> "$output_objdir/$my_dlsyms" "\
 
2460
          $ECHO >> "$output_objdir/$my_dlsyms" "\
2691
2461
  {0, (void *) 0}
2692
2462
};
2693
2463
 
2745
2515
        case $host in
2746
2516
        *cygwin* | *mingw* | *cegcc* )
2747
2517
          if test -f "$output_objdir/$my_outputname.def"; then
2748
 
            compile_command=`$ECHO "$compile_command" | $SED "s%@SYMFILE@%$output_objdir/$my_outputname.def $symfileobj%"`
2749
 
            finalize_command=`$ECHO "$finalize_command" | $SED "s%@SYMFILE@%$output_objdir/$my_outputname.def $symfileobj%"`
 
2518
            compile_command=`$ECHO "X$compile_command" | $Xsed -e "s%@SYMFILE@%$output_objdir/$my_outputname.def $symfileobj%"`
 
2519
            finalize_command=`$ECHO "X$finalize_command" | $Xsed -e "s%@SYMFILE@%$output_objdir/$my_outputname.def $symfileobj%"`
2750
2520
          else
2751
 
            compile_command=`$ECHO "$compile_command" | $SED "s%@SYMFILE@%$symfileobj%"`
2752
 
            finalize_command=`$ECHO "$finalize_command" | $SED "s%@SYMFILE@%$symfileobj%"`
 
2521
            compile_command=`$ECHO "X$compile_command" | $Xsed -e "s%@SYMFILE@%$symfileobj%"`
 
2522
            finalize_command=`$ECHO "X$finalize_command" | $Xsed -e "s%@SYMFILE@%$symfileobj%"`
2753
2523
          fi
2754
2524
          ;;
2755
2525
        *)
2756
 
          compile_command=`$ECHO "$compile_command" | $SED "s%@SYMFILE@%$symfileobj%"`
2757
 
          finalize_command=`$ECHO "$finalize_command" | $SED "s%@SYMFILE@%$symfileobj%"`
 
2526
          compile_command=`$ECHO "X$compile_command" | $Xsed -e "s%@SYMFILE@%$symfileobj%"`
 
2527
          finalize_command=`$ECHO "X$finalize_command" | $Xsed -e "s%@SYMFILE@%$symfileobj%"`
2758
2528
          ;;
2759
2529
        esac
2760
2530
        ;;
2768
2538
      # really was required.
2769
2539
 
2770
2540
      # Nullify the symbol file.
2771
 
      compile_command=`$ECHO "$compile_command" | $SED "s% @SYMFILE@%%"`
2772
 
      finalize_command=`$ECHO "$finalize_command" | $SED "s% @SYMFILE@%%"`
 
2541
      compile_command=`$ECHO "X$compile_command" | $Xsed -e "s% @SYMFILE@%%"`
 
2542
      finalize_command=`$ECHO "X$finalize_command" | $Xsed -e "s% @SYMFILE@%%"`
2773
2543
    fi
2774
2544
}
2775
2545
 
2779
2549
# Need a lot of goo to handle *both* DLLs and import libs
2780
2550
# Has to be a shell function in order to 'eat' the argument
2781
2551
# that is supplied when $file_magic_command is called.
2782
 
# Despite the name, also deal with 64 bit binaries.
2783
2552
func_win32_libid ()
2784
2553
{
2785
2554
  $opt_debug
2790
2559
    win32_libid_type="x86 archive import"
2791
2560
    ;;
2792
2561
  *ar\ archive*) # could be an import, or static
2793
 
    # Keep the egrep pattern in sync with the one in _LT_CHECK_MAGIC_METHOD.
2794
2562
    if eval $OBJDUMP -f $1 | $SED -e '10q' 2>/dev/null |
2795
 
       $EGREP 'file format (pei*-i386(.*architecture: i386)?|pe-arm-wince|pe-x86-64)' >/dev/null; then
 
2563
       $EGREP 'file format pe-i386(.*architecture: i386)?' >/dev/null ; then
2796
2564
      win32_nmres=`eval $NM -f posix -A $1 |
2797
2565
        $SED -n -e '
2798
2566
            1,100{
2830
2598
    $opt_debug
2831
2599
    f_ex_an_ar_dir="$1"; shift
2832
2600
    f_ex_an_ar_oldlib="$1"
2833
 
    if test "$lock_old_archive_extraction" = yes; then
2834
 
      lockfile=$f_ex_an_ar_oldlib.lock
2835
 
      until $opt_dry_run || ln "$progpath" "$lockfile" 2>/dev/null; do
2836
 
        func_echo "Waiting for $lockfile to be removed"
2837
 
        sleep 2
2838
 
      done
2839
 
    fi
2840
 
    func_show_eval "(cd \$f_ex_an_ar_dir && $AR x \"\$f_ex_an_ar_oldlib\")" \
2841
 
                   'stat=$?; rm -f "$lockfile"; exit $stat'
2842
 
    if test "$lock_old_archive_extraction" = yes; then
2843
 
      $opt_dry_run || rm -f "$lockfile"
2844
 
    fi
 
2601
    func_show_eval "(cd \$f_ex_an_ar_dir && $AR x \"\$f_ex_an_ar_oldlib\")" 'exit $?'
2845
2602
    if ($AR t "$f_ex_an_ar_oldlib" | sort | sort -uc >/dev/null 2>&1); then
2846
2603
     :
2847
2604
    else
2912
2669
            darwin_file=
2913
2670
            darwin_files=
2914
2671
            for darwin_file in $darwin_filelist; do
2915
 
              darwin_files=`find unfat-$$ -name $darwin_file -print | sort | $NL2SP`
 
2672
              darwin_files=`find unfat-$$ -name $darwin_file -print | $NL2SP`
2916
2673
              $LIPO -create -output "$darwin_file" $darwin_files
2917
2674
            done # $darwin_filelist
2918
2675
            $RM -rf unfat-$$
2927
2684
        func_extract_an_archive "$my_xdir" "$my_xabs"
2928
2685
        ;;
2929
2686
      esac
2930
 
      my_oldobjs="$my_oldobjs "`find $my_xdir -name \*.$objext -print -o -name \*.lo -print | sort | $NL2SP`
 
2687
      my_oldobjs="$my_oldobjs "`find $my_xdir -name \*.$objext -print -o -name \*.lo -print | $NL2SP`
2931
2688
    done
2932
2689
 
2933
2690
    func_extract_archives_result="$my_oldobjs"
2934
2691
}
2935
2692
 
2936
2693
 
2937
 
# func_emit_wrapper [arg=no]
2938
 
#
2939
 
# Emit a libtool wrapper script on stdout.
2940
 
# Don't directly open a file because we may want to
2941
 
# incorporate the script contents within a cygwin/mingw
2942
 
# wrapper executable.  Must ONLY be called from within
2943
 
# func_mode_link because it depends on a number of variables
2944
 
# set therein.
2945
 
#
2946
 
# ARG is the value that the WRAPPER_SCRIPT_BELONGS_IN_OBJDIR
2947
 
# variable will take.  If 'yes', then the emitted script
2948
 
# will assume that the directory in which it is stored is
2949
 
# the $objdir directory.  This is a cygwin/mingw-specific
2950
 
# behavior.
2951
 
func_emit_wrapper ()
 
2694
 
 
2695
# func_emit_wrapper_part1 [arg=no]
 
2696
#
 
2697
# Emit the first part of a libtool wrapper script on stdout.
 
2698
# For more information, see the description associated with
 
2699
# func_emit_wrapper(), below.
 
2700
func_emit_wrapper_part1 ()
2952
2701
{
2953
 
        func_emit_wrapper_arg1=${1-no}
 
2702
        func_emit_wrapper_part1_arg1=no
 
2703
        if test -n "$1" ; then
 
2704
          func_emit_wrapper_part1_arg1=$1
 
2705
        fi
2954
2706
 
2955
2707
        $ECHO "\
2956
2708
#! $SHELL
2966
2718
 
2967
2719
# Sed substitution that helps us do robust quoting.  It backslashifies
2968
2720
# metacharacters that are still active within double-quoted strings.
 
2721
Xsed='${SED} -e 1s/^X//'
2969
2722
sed_quote_subst='$sed_quote_subst'
2970
2723
 
2971
2724
# Be Bourne compatible
2996
2749
else
2997
2750
  # When we are sourced in execute mode, \$file and \$ECHO are already set.
2998
2751
  if test \"\$libtool_execute_magic\" != \"$magic\"; then
2999
 
    file=\"\$0\""
3000
 
 
3001
 
    qECHO=`$ECHO "$ECHO" | $SED "$sed_quote_subst"`
3002
 
    $ECHO "\
3003
 
 
3004
 
# A function that is used when there is no print builtin or printf.
3005
 
func_fallback_echo ()
3006
 
{
3007
 
  eval 'cat <<_LTECHO_EOF
3008
 
\$1
3009
 
_LTECHO_EOF'
3010
 
}
3011
 
    ECHO=\"$qECHO\"
3012
 
  fi
3013
 
 
3014
 
# Very basic option parsing. These options are (a) specific to
3015
 
# the libtool wrapper, (b) are identical between the wrapper
3016
 
# /script/ and the wrapper /executable/ which is used only on
3017
 
# windows platforms, and (c) all begin with the string "--lt-"
3018
 
# (application programs are unlikely to have options which match
3019
 
# this pattern).
3020
 
#
3021
 
# There are only two supported options: --lt-debug and
3022
 
# --lt-dump-script. There is, deliberately, no --lt-help.
3023
 
#
3024
 
# The first argument to this parsing function should be the
3025
 
# script's $0 value, followed by "$@".
3026
 
lt_option_debug=
3027
 
func_parse_lt_options ()
3028
 
{
3029
 
  lt_script_arg0=\$0
3030
 
  shift
3031
 
  for lt_opt
3032
 
  do
3033
 
    case \"\$lt_opt\" in
3034
 
    --lt-debug) lt_option_debug=1 ;;
3035
 
    --lt-dump-script)
3036
 
        lt_dump_D=\`\$ECHO \"X\$lt_script_arg0\" | $SED -e 's/^X//' -e 's%/[^/]*$%%'\`
3037
 
        test \"X\$lt_dump_D\" = \"X\$lt_script_arg0\" && lt_dump_D=.
3038
 
        lt_dump_F=\`\$ECHO \"X\$lt_script_arg0\" | $SED -e 's/^X//' -e 's%^.*/%%'\`
3039
 
        cat \"\$lt_dump_D/\$lt_dump_F\"
3040
 
        exit 0
3041
 
      ;;
3042
 
    --lt-*)
3043
 
        \$ECHO \"Unrecognized --lt- option: '\$lt_opt'\" 1>&2
3044
 
        exit 1
3045
 
      ;;
3046
 
    esac
3047
 
  done
3048
 
 
3049
 
  # Print the debug banner immediately:
3050
 
  if test -n \"\$lt_option_debug\"; then
3051
 
    echo \"${outputname}:${output}:\${LINENO}: libtool wrapper (GNU $PACKAGE$TIMESTAMP) $VERSION\" 1>&2
3052
 
  fi
3053
 
}
3054
 
 
3055
 
# Used when --lt-debug. Prints its arguments to stdout
3056
 
# (redirection is the responsibility of the caller)
3057
 
func_lt_dump_args ()
3058
 
{
3059
 
  lt_dump_args_N=1;
3060
 
  for lt_arg
3061
 
  do
3062
 
    \$ECHO \"${outputname}:${output}:\${LINENO}: newargv[\$lt_dump_args_N]: \$lt_arg\"
3063
 
    lt_dump_args_N=\`expr \$lt_dump_args_N + 1\`
3064
 
  done
3065
 
}
3066
 
 
3067
 
# Core function for launching the target application
3068
 
func_exec_program_core ()
3069
 
{
3070
 
"
3071
 
  case $host in
3072
 
  # Backslashes separate directories on plain windows
3073
 
  *-*-mingw | *-*-os2* | *-cegcc*)
3074
 
    $ECHO "\
3075
 
      if test -n \"\$lt_option_debug\"; then
3076
 
        \$ECHO \"${outputname}:${output}:\${LINENO}: newargv[0]: \$progdir\\\\\$program\" 1>&2
3077
 
        func_lt_dump_args \${1+\"\$@\"} 1>&2
3078
 
      fi
3079
 
      exec \"\$progdir\\\\\$program\" \${1+\"\$@\"}
3080
 
"
3081
 
    ;;
3082
 
 
3083
 
  *)
3084
 
    $ECHO "\
3085
 
      if test -n \"\$lt_option_debug\"; then
3086
 
        \$ECHO \"${outputname}:${output}:\${LINENO}: newargv[0]: \$progdir/\$program\" 1>&2
3087
 
        func_lt_dump_args \${1+\"\$@\"} 1>&2
3088
 
      fi
3089
 
      exec \"\$progdir/\$program\" \${1+\"\$@\"}
3090
 
"
3091
 
    ;;
3092
 
  esac
3093
 
  $ECHO "\
3094
 
      \$ECHO \"\$0: cannot exec \$program \$*\" 1>&2
3095
 
      exit 1
3096
 
}
3097
 
 
3098
 
# A function to encapsulate launching the target application
3099
 
# Strips options in the --lt-* namespace from \$@ and
3100
 
# launches target application with the remaining arguments.
3101
 
func_exec_program ()
3102
 
{
3103
 
  for lt_wr_arg
3104
 
  do
3105
 
    case \$lt_wr_arg in
3106
 
    --lt-*) ;;
3107
 
    *) set x \"\$@\" \"\$lt_wr_arg\"; shift;;
3108
 
    esac
3109
 
    shift
3110
 
  done
3111
 
  func_exec_program_core \${1+\"\$@\"}
3112
 
}
3113
 
 
3114
 
  # Parse options
3115
 
  func_parse_lt_options \"\$0\" \${1+\"\$@\"}
 
2752
    ECHO=\"$qecho\"
 
2753
    file=\"\$0\"
 
2754
    # Make sure echo works.
 
2755
    if test \"X\$1\" = X--no-reexec; then
 
2756
      # Discard the --no-reexec flag, and continue.
 
2757
      shift
 
2758
    elif test \"X\`{ \$ECHO '\t'; } 2>/dev/null\`\" = 'X\t'; then
 
2759
      # Yippee, \$ECHO works!
 
2760
      :
 
2761
    else
 
2762
      # Restart under the correct shell, and then maybe \$ECHO will work.
 
2763
      exec $SHELL \"\$0\" --no-reexec \${1+\"\$@\"}
 
2764
    fi
 
2765
  fi\
 
2766
"
 
2767
        $ECHO "\
3116
2768
 
3117
2769
  # Find the directory that this script lives in.
3118
 
  thisdir=\`\$ECHO \"\$file\" | $SED 's%/[^/]*$%%'\`
 
2770
  thisdir=\`\$ECHO \"X\$file\" | \$Xsed -e 's%/[^/]*$%%'\`
3119
2771
  test \"x\$thisdir\" = \"x\$file\" && thisdir=.
3120
2772
 
3121
2773
  # Follow symbolic links until we get to the real thisdir.
3122
 
  file=\`ls -ld \"\$file\" | $SED -n 's/.*-> //p'\`
 
2774
  file=\`ls -ld \"\$file\" | ${SED} -n 's/.*-> //p'\`
3123
2775
  while test -n \"\$file\"; do
3124
 
    destdir=\`\$ECHO \"\$file\" | $SED 's%/[^/]*\$%%'\`
 
2776
    destdir=\`\$ECHO \"X\$file\" | \$Xsed -e 's%/[^/]*\$%%'\`
3125
2777
 
3126
2778
    # If there was a directory component, then change thisdir.
3127
2779
    if test \"x\$destdir\" != \"x\$file\"; then
3131
2783
      esac
3132
2784
    fi
3133
2785
 
3134
 
    file=\`\$ECHO \"\$file\" | $SED 's%^.*/%%'\`
3135
 
    file=\`ls -ld \"\$thisdir/\$file\" | $SED -n 's/.*-> //p'\`
 
2786
    file=\`\$ECHO \"X\$file\" | \$Xsed -e 's%^.*/%%'\`
 
2787
    file=\`ls -ld \"\$thisdir/\$file\" | ${SED} -n 's/.*-> //p'\`
3136
2788
  done
 
2789
"
 
2790
}
 
2791
# end: func_emit_wrapper_part1
 
2792
 
 
2793
# func_emit_wrapper_part2 [arg=no]
 
2794
#
 
2795
# Emit the second part of a libtool wrapper script on stdout.
 
2796
# For more information, see the description associated with
 
2797
# func_emit_wrapper(), below.
 
2798
func_emit_wrapper_part2 ()
 
2799
{
 
2800
        func_emit_wrapper_part2_arg1=no
 
2801
        if test -n "$1" ; then
 
2802
          func_emit_wrapper_part2_arg1=$1
 
2803
        fi
 
2804
 
 
2805
        $ECHO "\
3137
2806
 
3138
2807
  # Usually 'no', except on cygwin/mingw when embedded into
3139
2808
  # the cwrapper.
3140
 
  WRAPPER_SCRIPT_BELONGS_IN_OBJDIR=$func_emit_wrapper_arg1
 
2809
  WRAPPER_SCRIPT_BELONGS_IN_OBJDIR=$func_emit_wrapper_part2_arg1
3141
2810
  if test \"\$WRAPPER_SCRIPT_BELONGS_IN_OBJDIR\" = \"yes\"; then
3142
2811
    # special case for '.'
3143
2812
    if test \"\$thisdir\" = \".\"; then
3145
2814
    fi
3146
2815
    # remove .libs from thisdir
3147
2816
    case \"\$thisdir\" in
3148
 
    *[\\\\/]$objdir ) thisdir=\`\$ECHO \"\$thisdir\" | $SED 's%[\\\\/][^\\\\/]*$%%'\` ;;
 
2817
    *[\\\\/]$objdir ) thisdir=\`\$ECHO \"X\$thisdir\" | \$Xsed -e 's%[\\\\/][^\\\\/]*$%%'\` ;;
3149
2818
    $objdir )   thisdir=. ;;
3150
2819
    esac
3151
2820
  fi
3208
2877
 
3209
2878
    # Some systems cannot cope with colon-terminated $shlibpath_var
3210
2879
    # The second colon is a workaround for a bug in BeOS R4 sed
3211
 
    $shlibpath_var=\`\$ECHO \"\$$shlibpath_var\" | $SED 's/::*\$//'\`
 
2880
    $shlibpath_var=\`\$ECHO \"X\$$shlibpath_var\" | \$Xsed -e 's/::*\$//'\`
3212
2881
 
3213
2882
    export $shlibpath_var
3214
2883
"
3225
2894
        $ECHO "\
3226
2895
    if test \"\$libtool_execute_magic\" != \"$magic\"; then
3227
2896
      # Run the actual program with our arguments.
3228
 
      func_exec_program \${1+\"\$@\"}
 
2897
"
 
2898
        case $host in
 
2899
        # Backslashes separate directories on plain windows
 
2900
        *-*-mingw | *-*-os2* | *-cegcc*)
 
2901
          $ECHO "\
 
2902
      exec \"\$progdir\\\\\$program\" \${1+\"\$@\"}
 
2903
"
 
2904
          ;;
 
2905
 
 
2906
        *)
 
2907
          $ECHO "\
 
2908
      exec \"\$progdir/\$program\" \${1+\"\$@\"}
 
2909
"
 
2910
          ;;
 
2911
        esac
 
2912
        $ECHO "\
 
2913
      \$ECHO \"\$0: cannot exec \$program \$*\" 1>&2
 
2914
      exit 1
3229
2915
    fi
3230
2916
  else
3231
2917
    # The program doesn't exist.
3232
2918
    \$ECHO \"\$0: error: \\\`\$progdir/\$program' does not exist\" 1>&2
3233
2919
    \$ECHO \"This script is just a wrapper for \$program.\" 1>&2
3234
 
    \$ECHO \"See the $PACKAGE documentation for more information.\" 1>&2
 
2920
    $ECHO \"See the $PACKAGE documentation for more information.\" 1>&2
3235
2921
    exit 1
3236
2922
  fi
3237
2923
fi\
3238
2924
"
3239
2925
}
 
2926
# end: func_emit_wrapper_part2
 
2927
 
 
2928
 
 
2929
# func_emit_wrapper [arg=no]
 
2930
#
 
2931
# Emit a libtool wrapper script on stdout.
 
2932
# Don't directly open a file because we may want to
 
2933
# incorporate the script contents within a cygwin/mingw
 
2934
# wrapper executable.  Must ONLY be called from within
 
2935
# func_mode_link because it depends on a number of variables
 
2936
# set therein.
 
2937
#
 
2938
# ARG is the value that the WRAPPER_SCRIPT_BELONGS_IN_OBJDIR
 
2939
# variable will take.  If 'yes', then the emitted script
 
2940
# will assume that the directory in which it is stored is
 
2941
# the $objdir directory.  This is a cygwin/mingw-specific
 
2942
# behavior.
 
2943
func_emit_wrapper ()
 
2944
{
 
2945
        func_emit_wrapper_arg1=no
 
2946
        if test -n "$1" ; then
 
2947
          func_emit_wrapper_arg1=$1
 
2948
        fi
 
2949
 
 
2950
        # split this up so that func_emit_cwrapperexe_src
 
2951
        # can call each part independently.
 
2952
        func_emit_wrapper_part1 "${func_emit_wrapper_arg1}"
 
2953
        func_emit_wrapper_part2 "${func_emit_wrapper_arg1}"
 
2954
}
3240
2955
 
3241
2956
 
3242
2957
# func_to_host_path arg
3263
2978
func_to_host_path ()
3264
2979
{
3265
2980
  func_to_host_path_result="$1"
3266
 
  if test -n "$1"; then
 
2981
  if test -n "$1" ; then
3267
2982
    case $host in
3268
2983
      *mingw* )
3269
2984
        lt_sed_naive_backslashify='s|\\\\*|\\|g;s|/|\\|g;s|\\|\\\\|g'
3270
2985
        case $build in
3271
2986
          *mingw* ) # actually, msys
3272
2987
            # awkward: cmd appends spaces to result
3273
 
            func_to_host_path_result=`( cmd //c echo "$1" ) 2>/dev/null |
3274
 
              $SED -e 's/[ ]*$//' -e "$lt_sed_naive_backslashify"`
 
2988
            lt_sed_strip_trailing_spaces="s/[ ]*\$//"
 
2989
            func_to_host_path_tmp1=`( cmd //c echo "$1" |\
 
2990
              $SED -e "$lt_sed_strip_trailing_spaces" ) 2>/dev/null || echo ""`
 
2991
            func_to_host_path_result=`echo "$func_to_host_path_tmp1" |\
 
2992
              $SED -e "$lt_sed_naive_backslashify"`
3275
2993
            ;;
3276
2994
          *cygwin* )
3277
 
            func_to_host_path_result=`cygpath -w "$1" |
3278
 
              $SED -e "$lt_sed_naive_backslashify"`
 
2995
            func_to_host_path_tmp1=`cygpath -w "$1"`
 
2996
            func_to_host_path_result=`echo "$func_to_host_path_tmp1" |\
 
2997
              $SED -e "$lt_sed_naive_backslashify"`
3279
2998
            ;;
3280
2999
          * )
3281
3000
            # Unfortunately, winepath does not exit with a non-zero
3287
3006
            # the odd construction:
3288
3007
            func_to_host_path_tmp1=`winepath -w "$1" 2>/dev/null`
3289
3008
            if test "$?" -eq 0 && test -n "${func_to_host_path_tmp1}"; then
3290
 
              func_to_host_path_result=`$ECHO "$func_to_host_path_tmp1" |
 
3009
              func_to_host_path_result=`echo "$func_to_host_path_tmp1" |\
3291
3010
                $SED -e "$lt_sed_naive_backslashify"`
3292
3011
            else
3293
3012
              # Allow warning below.
3294
 
              func_to_host_path_result=
 
3013
              func_to_host_path_result=""
3295
3014
            fi
3296
3015
            ;;
3297
3016
        esac
3298
3017
        if test -z "$func_to_host_path_result" ; then
3299
3018
          func_error "Could not determine host path corresponding to"
3300
 
          func_error "  \`$1'"
 
3019
          func_error "  '$1'"
3301
3020
          func_error "Continuing, but uninstalled executables may not work."
3302
3021
          # Fallback:
3303
3022
          func_to_host_path_result="$1"
3330
3049
func_to_host_pathlist ()
3331
3050
{
3332
3051
  func_to_host_pathlist_result="$1"
3333
 
  if test -n "$1"; then
 
3052
  if test -n "$1" ; then
3334
3053
    case $host in
3335
3054
      *mingw* )
3336
3055
        lt_sed_naive_backslashify='s|\\\\*|\\|g;s|/|\\|g;s|\\|\\\\|g'
3337
3056
        # Remove leading and trailing path separator characters from
3338
3057
        # ARG. msys behavior is inconsistent here, cygpath turns them
3339
3058
        # into '.;' and ';.', and winepath ignores them completely.
3340
 
        func_stripname : : "$1"
3341
 
        func_to_host_pathlist_tmp1=$func_stripname_result
 
3059
        func_to_host_pathlist_tmp2="$1"
 
3060
        # Once set for this call, this variable should not be
 
3061
        # reassigned. It is used in tha fallback case.
 
3062
        func_to_host_pathlist_tmp1=`echo "$func_to_host_pathlist_tmp2" |\
 
3063
          $SED -e 's|^:*||' -e 's|:*$||'`
3342
3064
        case $build in
3343
3065
          *mingw* ) # Actually, msys.
3344
3066
            # Awkward: cmd appends spaces to result.
3345
 
            func_to_host_pathlist_result=`
3346
 
              ( cmd //c echo "$func_to_host_pathlist_tmp1" ) 2>/dev/null |
3347
 
              $SED -e 's/[ ]*$//' -e "$lt_sed_naive_backslashify"`
 
3067
            lt_sed_strip_trailing_spaces="s/[ ]*\$//"
 
3068
            func_to_host_pathlist_tmp2=`( cmd //c echo "$func_to_host_pathlist_tmp1" |\
 
3069
              $SED -e "$lt_sed_strip_trailing_spaces" ) 2>/dev/null || echo ""`
 
3070
            func_to_host_pathlist_result=`echo "$func_to_host_pathlist_tmp2" |\
 
3071
              $SED -e "$lt_sed_naive_backslashify"`
3348
3072
            ;;
3349
3073
          *cygwin* )
3350
 
            func_to_host_pathlist_result=`cygpath -w -p "$func_to_host_pathlist_tmp1" |
 
3074
            func_to_host_pathlist_tmp2=`cygpath -w -p "$func_to_host_pathlist_tmp1"`
 
3075
            func_to_host_pathlist_result=`echo "$func_to_host_pathlist_tmp2" |\
3351
3076
              $SED -e "$lt_sed_naive_backslashify"`
3352
3077
            ;;
3353
3078
          * )
3363
3088
                  if test -z "$func_to_host_pathlist_result" ; then
3364
3089
                    func_to_host_pathlist_result="$func_to_host_path_result"
3365
3090
                  else
3366
 
                    func_append func_to_host_pathlist_result ";$func_to_host_path_result"
 
3091
                    func_to_host_pathlist_result="$func_to_host_pathlist_result;$func_to_host_path_result"
3367
3092
                  fi
3368
3093
                fi
3369
3094
              fi
 
3095
              IFS=:
3370
3096
            done
3371
3097
            IFS=$func_to_host_pathlist_oldIFS
3372
3098
            ;;
3373
3099
        esac
3374
 
        if test -z "$func_to_host_pathlist_result"; then
 
3100
        if test -z "$func_to_host_pathlist_result" ; then
3375
3101
          func_error "Could not determine the host path(s) corresponding to"
3376
 
          func_error "  \`$1'"
 
3102
          func_error "  '$1'"
3377
3103
          func_error "Continuing, but uninstalled executables may not work."
3378
3104
          # Fallback. This may break if $1 contains DOS-style drive
3379
3105
          # specifications. The fix is not to complicate the expression
3390
3116
            ;;
3391
3117
        esac
3392
3118
        case "$1" in
3393
 
          *: ) func_append func_to_host_pathlist_result ";"
 
3119
          *: ) func_to_host_pathlist_result="$func_to_host_pathlist_result;"
3394
3120
            ;;
3395
3121
        esac
3396
3122
        ;;
3415
3141
 
3416
3142
   This wrapper executable should never be moved out of the build directory.
3417
3143
   If it is, it will not operate correctly.
 
3144
 
 
3145
   Currently, it simply execs the wrapper *script* "$SHELL $output",
 
3146
   but could eventually absorb all of the scripts functionality and
 
3147
   exec $objdir/$outputname directly.
3418
3148
*/
3419
3149
EOF
3420
3150
            cat <<"EOF"
3421
 
#ifdef _MSC_VER
3422
 
# define _CRT_SECURE_NO_DEPRECATE 1
3423
 
#endif
3424
3151
#include <stdio.h>
3425
3152
#include <stdlib.h>
3426
3153
#ifdef _MSC_VER
3427
3154
# include <direct.h>
3428
3155
# include <process.h>
3429
3156
# include <io.h>
 
3157
# define setmode _setmode
3430
3158
#else
3431
3159
# include <unistd.h>
3432
3160
# include <stdint.h>
3433
3161
# ifdef __CYGWIN__
3434
3162
#  include <io.h>
 
3163
#  define HAVE_SETENV
 
3164
#  ifdef __STRICT_ANSI__
 
3165
char *realpath (const char *, char *);
 
3166
int putenv (char *);
 
3167
int setenv (const char *, const char *, int);
 
3168
#  endif
3435
3169
# endif
3436
3170
#endif
3437
3171
#include <malloc.h>
3443
3177
#include <fcntl.h>
3444
3178
#include <sys/stat.h>
3445
3179
 
3446
 
/* declarations of non-ANSI functions */
3447
 
#if defined(__MINGW32__)
3448
 
# ifdef __STRICT_ANSI__
3449
 
int _putenv (const char *);
3450
 
# endif
3451
 
#elif defined(__CYGWIN__)
3452
 
# ifdef __STRICT_ANSI__
3453
 
char *realpath (const char *, char *);
3454
 
int putenv (char *);
3455
 
int setenv (const char *, const char *, int);
3456
 
# endif
3457
 
/* #elif defined (other platforms) ... */
3458
 
#endif
3459
 
 
3460
 
/* portability defines, excluding path handling macros */
3461
 
#if defined(_MSC_VER)
3462
 
# define setmode _setmode
3463
 
# define stat    _stat
3464
 
# define chmod   _chmod
3465
 
# define getcwd  _getcwd
3466
 
# define putenv  _putenv
3467
 
# define S_IXUSR _S_IEXEC
3468
 
# ifndef _INTPTR_T_DEFINED
3469
 
#  define _INTPTR_T_DEFINED
3470
 
#  define intptr_t int
3471
 
# endif
3472
 
#elif defined(__MINGW32__)
3473
 
# define setmode _setmode
3474
 
# define stat    _stat
3475
 
# define chmod   _chmod
3476
 
# define getcwd  _getcwd
3477
 
# define putenv  _putenv
3478
 
#elif defined(__CYGWIN__)
3479
 
# define HAVE_SETENV
3480
 
# define FOPEN_WB "wb"
3481
 
/* #elif defined (other platforms) ... */
3482
 
#endif
3483
 
 
3484
3180
#if defined(PATH_MAX)
3485
3181
# define LT_PATHMAX PATH_MAX
3486
3182
#elif defined(MAXPATHLEN)
3496
3192
# define S_IXGRP 0
3497
3193
#endif
3498
3194
 
3499
 
/* path handling portability macros */
 
3195
#ifdef _MSC_VER
 
3196
# define S_IXUSR _S_IEXEC
 
3197
# define stat _stat
 
3198
# ifndef _INTPTR_T_DEFINED
 
3199
#  define intptr_t int
 
3200
# endif
 
3201
#endif
 
3202
 
3500
3203
#ifndef DIR_SEPARATOR
3501
3204
# define DIR_SEPARATOR '/'
3502
3205
# define PATH_SEPARATOR ':'
3527
3230
# define IS_PATH_SEPARATOR(ch) ((ch) == PATH_SEPARATOR_2)
3528
3231
#endif /* PATH_SEPARATOR_2 */
3529
3232
 
 
3233
#ifdef __CYGWIN__
 
3234
# define FOPEN_WB "wb"
 
3235
#endif
 
3236
 
3530
3237
#ifndef FOPEN_WB
3531
3238
# define FOPEN_WB "w"
3532
3239
#endif
3539
3246
  if (stale) { free ((void *) stale); stale = 0; } \
3540
3247
} while (0)
3541
3248
 
3542
 
#if defined(LT_DEBUGWRAPPER)
3543
 
static int lt_debug = 1;
 
3249
#undef LTWRAPPER_DEBUGPRINTF
 
3250
#if defined DEBUGWRAPPER
 
3251
# define LTWRAPPER_DEBUGPRINTF(args) ltwrapper_debugprintf args
 
3252
static void
 
3253
ltwrapper_debugprintf (const char *fmt, ...)
 
3254
{
 
3255
    va_list args;
 
3256
    va_start (args, fmt);
 
3257
    (void) vfprintf (stderr, fmt, args);
 
3258
    va_end (args);
 
3259
}
3544
3260
#else
3545
 
static int lt_debug = 0;
 
3261
# define LTWRAPPER_DEBUGPRINTF(args)
3546
3262
#endif
3547
3263
 
3548
 
const char *program_name = "libtool-wrapper"; /* in case xstrdup fails */
 
3264
const char *program_name = NULL;
3549
3265
 
3550
3266
void *xmalloc (size_t num);
3551
3267
char *xstrdup (const char *string);
3555
3271
int make_executable (const char *path);
3556
3272
int check_executable (const char *path);
3557
3273
char *strendzap (char *str, const char *pat);
3558
 
void lt_debugprintf (const char *file, int line, const char *fmt, ...);
3559
 
void lt_fatal (const char *file, int line, const char *message, ...);
3560
 
static const char *nonnull (const char *s);
3561
 
static const char *nonempty (const char *s);
 
3274
void lt_fatal (const char *message, ...);
3562
3275
void lt_setenv (const char *name, const char *value);
3563
3276
char *lt_extend_str (const char *orig_value, const char *add, int to_end);
 
3277
void lt_opt_process_env_set (const char *arg);
 
3278
void lt_opt_process_env_prepend (const char *arg);
 
3279
void lt_opt_process_env_append (const char *arg);
 
3280
int lt_split_name_value (const char *arg, char** name, char** value);
3564
3281
void lt_update_exe_path (const char *name, const char *value);
3565
3282
void lt_update_lib_path (const char *name, const char *value);
3566
 
char **prepare_spawn (char **argv);
3567
 
void lt_dump_script (FILE *f);
3568
 
EOF
 
3283
 
 
3284
static const char *script_text_part1 =
 
3285
EOF
 
3286
 
 
3287
            func_emit_wrapper_part1 yes |
 
3288
                $SED -e 's/\([\\"]\)/\\\1/g' \
 
3289
                     -e 's/^/  "/' -e 's/$/\\n"/'
 
3290
            echo ";"
 
3291
            cat <<EOF
 
3292
 
 
3293
static const char *script_text_part2 =
 
3294
EOF
 
3295
            func_emit_wrapper_part2 yes |
 
3296
                $SED -e 's/\([\\"]\)/\\\1/g' \
 
3297
                     -e 's/^/  "/' -e 's/$/\\n"/'
 
3298
            echo ";"
3569
3299
 
3570
3300
            cat <<EOF
3571
3301
const char * MAGIC_EXE = "$magic_exe";
3610
3340
            cat <<"EOF"
3611
3341
 
3612
3342
#define LTWRAPPER_OPTION_PREFIX         "--lt-"
 
3343
#define LTWRAPPER_OPTION_PREFIX_LENGTH  5
3613
3344
 
 
3345
static const size_t opt_prefix_len         = LTWRAPPER_OPTION_PREFIX_LENGTH;
3614
3346
static const char *ltwrapper_option_prefix = LTWRAPPER_OPTION_PREFIX;
 
3347
 
3615
3348
static const char *dumpscript_opt       = LTWRAPPER_OPTION_PREFIX "dump-script";
3616
 
static const char *debug_opt            = LTWRAPPER_OPTION_PREFIX "debug";
 
3349
 
 
3350
static const size_t env_set_opt_len     = LTWRAPPER_OPTION_PREFIX_LENGTH + 7;
 
3351
static const char *env_set_opt          = LTWRAPPER_OPTION_PREFIX "env-set";
 
3352
  /* argument is putenv-style "foo=bar", value of foo is set to bar */
 
3353
 
 
3354
static const size_t env_prepend_opt_len = LTWRAPPER_OPTION_PREFIX_LENGTH + 11;
 
3355
static const char *env_prepend_opt      = LTWRAPPER_OPTION_PREFIX "env-prepend";
 
3356
  /* argument is putenv-style "foo=bar", new value of foo is bar${foo} */
 
3357
 
 
3358
static const size_t env_append_opt_len  = LTWRAPPER_OPTION_PREFIX_LENGTH + 10;
 
3359
static const char *env_append_opt       = LTWRAPPER_OPTION_PREFIX "env-append";
 
3360
  /* argument is putenv-style "foo=bar", new value of foo is ${foo}bar */
3617
3361
 
3618
3362
int
3619
3363
main (int argc, char *argv[])
3630
3374
  int i;
3631
3375
 
3632
3376
  program_name = (char *) xstrdup (base_name (argv[0]));
3633
 
  newargz = XMALLOC (char *, argc + 1);
 
3377
  LTWRAPPER_DEBUGPRINTF (("(main) argv[0]      : %s\n", argv[0]));
 
3378
  LTWRAPPER_DEBUGPRINTF (("(main) program_name : %s\n", program_name));
3634
3379
 
3635
 
  /* very simple arg parsing; don't want to rely on getopt
3636
 
   * also, copy all non cwrapper options to newargz, except
3637
 
   * argz[0], which is handled differently
3638
 
   */
3639
 
  newargc=0;
 
3380
  /* very simple arg parsing; don't want to rely on getopt */
3640
3381
  for (i = 1; i < argc; i++)
3641
3382
    {
3642
3383
      if (strcmp (argv[i], dumpscript_opt) == 0)
3650
3391
              esac
3651
3392
 
3652
3393
            cat <<"EOF"
3653
 
          lt_dump_script (stdout);
 
3394
          printf ("%s", script_text_part1);
 
3395
          printf ("%s", script_text_part2);
3654
3396
          return 0;
3655
3397
        }
3656
 
      if (strcmp (argv[i], debug_opt) == 0)
3657
 
        {
3658
 
          lt_debug = 1;
3659
 
          continue;
3660
 
        }
3661
 
      if (strcmp (argv[i], ltwrapper_option_prefix) == 0)
3662
 
        {
3663
 
          /* however, if there is an option in the LTWRAPPER_OPTION_PREFIX
3664
 
             namespace, but it is not one of the ones we know about and
3665
 
             have already dealt with, above (inluding dump-script), then
3666
 
             report an error. Otherwise, targets might begin to believe
3667
 
             they are allowed to use options in the LTWRAPPER_OPTION_PREFIX
3668
 
             namespace. The first time any user complains about this, we'll
3669
 
             need to make LTWRAPPER_OPTION_PREFIX a configure-time option
3670
 
             or a configure.ac-settable value.
3671
 
           */
3672
 
          lt_fatal (__FILE__, __LINE__,
3673
 
                    "unrecognized %s option: '%s'",
3674
 
                    ltwrapper_option_prefix, argv[i]);
3675
 
        }
3676
 
      /* otherwise ... */
3677
 
      newargz[++newargc] = xstrdup (argv[i]);
3678
3398
    }
3679
 
  newargz[++newargc] = NULL;
3680
 
 
3681
 
EOF
3682
 
            cat <<EOF
3683
 
  /* The GNU banner must be the first non-error debug message */
3684
 
  lt_debugprintf (__FILE__, __LINE__, "libtool wrapper (GNU $PACKAGE$TIMESTAMP) $VERSION\n");
3685
 
EOF
3686
 
            cat <<"EOF"
3687
 
  lt_debugprintf (__FILE__, __LINE__, "(main) argv[0]: %s\n", argv[0]);
3688
 
  lt_debugprintf (__FILE__, __LINE__, "(main) program_name: %s\n", program_name);
3689
 
 
 
3399
 
 
3400
  newargz = XMALLOC (char *, argc + 1);
3690
3401
  tmp_pathspec = find_executable (argv[0]);
3691
3402
  if (tmp_pathspec == NULL)
3692
 
    lt_fatal (__FILE__, __LINE__, "couldn't find %s", argv[0]);
3693
 
  lt_debugprintf (__FILE__, __LINE__,
3694
 
                  "(main) found exe (before symlink chase) at: %s\n",
3695
 
                  tmp_pathspec);
 
3403
    lt_fatal ("Couldn't find %s", argv[0]);
 
3404
  LTWRAPPER_DEBUGPRINTF (("(main) found exe (before symlink chase) at : %s\n",
 
3405
                          tmp_pathspec));
3696
3406
 
3697
3407
  actual_cwrapper_path = chase_symlinks (tmp_pathspec);
3698
 
  lt_debugprintf (__FILE__, __LINE__,
3699
 
                  "(main) found exe (after symlink chase) at: %s\n",
3700
 
                  actual_cwrapper_path);
 
3408
  LTWRAPPER_DEBUGPRINTF (("(main) found exe (after symlink chase) at : %s\n",
 
3409
                          actual_cwrapper_path));
3701
3410
  XFREE (tmp_pathspec);
3702
3411
 
3703
 
  actual_cwrapper_name = xstrdup (base_name (actual_cwrapper_path));
 
3412
  actual_cwrapper_name = xstrdup( base_name (actual_cwrapper_path));
3704
3413
  strendzap (actual_cwrapper_path, actual_cwrapper_name);
3705
3414
 
3706
3415
  /* wrapper name transforms */
3718
3427
  target_name = tmp_pathspec;
3719
3428
  tmp_pathspec = 0;
3720
3429
 
3721
 
  lt_debugprintf (__FILE__, __LINE__,
3722
 
                  "(main) libtool target name: %s\n",
3723
 
                  target_name);
 
3430
  LTWRAPPER_DEBUGPRINTF (("(main) libtool target name: %s\n",
 
3431
                          target_name));
3724
3432
EOF
3725
3433
 
3726
3434
            cat <<EOF
3773
3481
  lt_update_lib_path (LIB_PATH_VARNAME, LIB_PATH_VALUE);
3774
3482
  lt_update_exe_path (EXE_PATH_VARNAME, EXE_PATH_VALUE);
3775
3483
 
3776
 
  lt_debugprintf (__FILE__, __LINE__, "(main) lt_argv_zero: %s\n",
3777
 
                  nonnull (lt_argv_zero));
 
3484
  newargc=0;
 
3485
  for (i = 1; i < argc; i++)
 
3486
    {
 
3487
      if (strncmp (argv[i], env_set_opt, env_set_opt_len) == 0)
 
3488
        {
 
3489
          if (argv[i][env_set_opt_len] == '=')
 
3490
            {
 
3491
              const char *p = argv[i] + env_set_opt_len + 1;
 
3492
              lt_opt_process_env_set (p);
 
3493
            }
 
3494
          else if (argv[i][env_set_opt_len] == '\0' && i + 1 < argc)
 
3495
            {
 
3496
              lt_opt_process_env_set (argv[++i]); /* don't copy */
 
3497
            }
 
3498
          else
 
3499
            lt_fatal ("%s missing required argument", env_set_opt);
 
3500
          continue;
 
3501
        }
 
3502
      if (strncmp (argv[i], env_prepend_opt, env_prepend_opt_len) == 0)
 
3503
        {
 
3504
          if (argv[i][env_prepend_opt_len] == '=')
 
3505
            {
 
3506
              const char *p = argv[i] + env_prepend_opt_len + 1;
 
3507
              lt_opt_process_env_prepend (p);
 
3508
            }
 
3509
          else if (argv[i][env_prepend_opt_len] == '\0' && i + 1 < argc)
 
3510
            {
 
3511
              lt_opt_process_env_prepend (argv[++i]); /* don't copy */
 
3512
            }
 
3513
          else
 
3514
            lt_fatal ("%s missing required argument", env_prepend_opt);
 
3515
          continue;
 
3516
        }
 
3517
      if (strncmp (argv[i], env_append_opt, env_append_opt_len) == 0)
 
3518
        {
 
3519
          if (argv[i][env_append_opt_len] == '=')
 
3520
            {
 
3521
              const char *p = argv[i] + env_append_opt_len + 1;
 
3522
              lt_opt_process_env_append (p);
 
3523
            }
 
3524
          else if (argv[i][env_append_opt_len] == '\0' && i + 1 < argc)
 
3525
            {
 
3526
              lt_opt_process_env_append (argv[++i]); /* don't copy */
 
3527
            }
 
3528
          else
 
3529
            lt_fatal ("%s missing required argument", env_append_opt);
 
3530
          continue;
 
3531
        }
 
3532
      if (strncmp (argv[i], ltwrapper_option_prefix, opt_prefix_len) == 0)
 
3533
        {
 
3534
          /* however, if there is an option in the LTWRAPPER_OPTION_PREFIX
 
3535
             namespace, but it is not one of the ones we know about and
 
3536
             have already dealt with, above (inluding dump-script), then
 
3537
             report an error. Otherwise, targets might begin to believe
 
3538
             they are allowed to use options in the LTWRAPPER_OPTION_PREFIX
 
3539
             namespace. The first time any user complains about this, we'll
 
3540
             need to make LTWRAPPER_OPTION_PREFIX a configure-time option
 
3541
             or a configure.ac-settable value.
 
3542
           */
 
3543
          lt_fatal ("Unrecognized option in %s namespace: '%s'",
 
3544
                    ltwrapper_option_prefix, argv[i]);
 
3545
        }
 
3546
      /* otherwise ... */
 
3547
      newargz[++newargc] = xstrdup (argv[i]);
 
3548
    }
 
3549
  newargz[++newargc] = NULL;
 
3550
 
 
3551
  LTWRAPPER_DEBUGPRINTF     (("(main) lt_argv_zero : %s\n", (lt_argv_zero ? lt_argv_zero : "<NULL>")));
3778
3552
  for (i = 0; i < newargc; i++)
3779
3553
    {
3780
 
      lt_debugprintf (__FILE__, __LINE__, "(main) newargz[%d]: %s\n",
3781
 
                      i, nonnull (newargz[i]));
 
3554
      LTWRAPPER_DEBUGPRINTF (("(main) newargz[%d]   : %s\n", i, (newargz[i] ? newargz[i] : "<NULL>")));
3782
3555
    }
3783
3556
 
3784
3557
EOF
3787
3560
              mingw*)
3788
3561
                cat <<"EOF"
3789
3562
  /* execv doesn't actually work on mingw as expected on unix */
3790
 
  newargz = prepare_spawn (newargz);
3791
3563
  rval = _spawnv (_P_WAIT, lt_argv_zero, (const char * const *) newargz);
3792
3564
  if (rval == -1)
3793
3565
    {
3794
3566
      /* failed to start process */
3795
 
      lt_debugprintf (__FILE__, __LINE__,
3796
 
                      "(main) failed to launch target \"%s\": %s\n",
3797
 
                      lt_argv_zero, nonnull (strerror (errno)));
 
3567
      LTWRAPPER_DEBUGPRINTF (("(main) failed to launch target \"%s\": errno = %d\n", lt_argv_zero, errno));
3798
3568
      return 127;
3799
3569
    }
3800
3570
  return rval;
3816
3586
{
3817
3587
  void *p = (void *) malloc (num);
3818
3588
  if (!p)
3819
 
    lt_fatal (__FILE__, __LINE__, "memory exhausted");
 
3589
    lt_fatal ("Memory exhausted");
3820
3590
 
3821
3591
  return p;
3822
3592
}
3850
3620
{
3851
3621
  struct stat st;
3852
3622
 
3853
 
  lt_debugprintf (__FILE__, __LINE__, "(check_executable): %s\n",
3854
 
                  nonempty (path));
 
3623
  LTWRAPPER_DEBUGPRINTF (("(check_executable)  : %s\n",
 
3624
                          path ? (*path ? path : "EMPTY!") : "NULL!"));
3855
3625
  if ((!path) || (!*path))
3856
3626
    return 0;
3857
3627
 
3868
3638
  int rval = 0;
3869
3639
  struct stat st;
3870
3640
 
3871
 
  lt_debugprintf (__FILE__, __LINE__, "(make_executable): %s\n",
3872
 
                  nonempty (path));
 
3641
  LTWRAPPER_DEBUGPRINTF (("(make_executable)   : %s\n",
 
3642
                          path ? (*path ? path : "EMPTY!") : "NULL!"));
3873
3643
  if ((!path) || (!*path))
3874
3644
    return 0;
3875
3645
 
3895
3665
  int tmp_len;
3896
3666
  char *concat_name;
3897
3667
 
3898
 
  lt_debugprintf (__FILE__, __LINE__, "(find_executable): %s\n",
3899
 
                  nonempty (wrapper));
 
3668
  LTWRAPPER_DEBUGPRINTF (("(find_executable)   : %s\n",
 
3669
                          wrapper ? (*wrapper ? wrapper : "EMPTY!") : "NULL!"));
3900
3670
 
3901
3671
  if ((wrapper == NULL) || (*wrapper == '\0'))
3902
3672
    return NULL;
3949
3719
                {
3950
3720
                  /* empty path: current directory */
3951
3721
                  if (getcwd (tmp, LT_PATHMAX) == NULL)
3952
 
                    lt_fatal (__FILE__, __LINE__, "getcwd failed: %s",
3953
 
                              nonnull (strerror (errno)));
 
3722
                    lt_fatal ("getcwd failed");
3954
3723
                  tmp_len = strlen (tmp);
3955
3724
                  concat_name =
3956
3725
                    XMALLOC (char, tmp_len + 1 + strlen (wrapper) + 1);
3975
3744
    }
3976
3745
  /* Relative path | not found in path: prepend cwd */
3977
3746
  if (getcwd (tmp, LT_PATHMAX) == NULL)
3978
 
    lt_fatal (__FILE__, __LINE__, "getcwd failed: %s",
3979
 
              nonnull (strerror (errno)));
 
3747
    lt_fatal ("getcwd failed");
3980
3748
  tmp_len = strlen (tmp);
3981
3749
  concat_name = XMALLOC (char, tmp_len + 1 + strlen (wrapper) + 1);
3982
3750
  memcpy (concat_name, tmp, tmp_len);
4002
3770
  int has_symlinks = 0;
4003
3771
  while (strlen (tmp_pathspec) && !has_symlinks)
4004
3772
    {
4005
 
      lt_debugprintf (__FILE__, __LINE__,
4006
 
                      "checking path component for symlinks: %s\n",
4007
 
                      tmp_pathspec);
 
3773
      LTWRAPPER_DEBUGPRINTF (("checking path component for symlinks: %s\n",
 
3774
                              tmp_pathspec));
4008
3775
      if (lstat (tmp_pathspec, &s) == 0)
4009
3776
        {
4010
3777
          if (S_ISLNK (s.st_mode) != 0)
4026
3793
        }
4027
3794
      else
4028
3795
        {
4029
 
          lt_fatal (__FILE__, __LINE__,
4030
 
                    "error accessing file \"%s\": %s",
4031
 
                    tmp_pathspec, nonnull (strerror (errno)));
 
3796
          char *errstr = strerror (errno);
 
3797
          lt_fatal ("Error accessing file %s (%s)", tmp_pathspec, errstr);
4032
3798
        }
4033
3799
    }
4034
3800
  XFREE (tmp_pathspec);
4041
3807
  tmp_pathspec = realpath (pathspec, buf);
4042
3808
  if (tmp_pathspec == 0)
4043
3809
    {
4044
 
      lt_fatal (__FILE__, __LINE__,
4045
 
                "could not follow symlinks for %s", pathspec);
 
3810
      lt_fatal ("Could not follow symlinks for %s", pathspec);
4046
3811
    }
4047
3812
  return xstrdup (tmp_pathspec);
4048
3813
#endif
4068
3833
  return str;
4069
3834
}
4070
3835
 
4071
 
void
4072
 
lt_debugprintf (const char *file, int line, const char *fmt, ...)
4073
 
{
4074
 
  va_list args;
4075
 
  if (lt_debug)
4076
 
    {
4077
 
      (void) fprintf (stderr, "%s:%s:%d: ", program_name, file, line);
4078
 
      va_start (args, fmt);
4079
 
      (void) vfprintf (stderr, fmt, args);
4080
 
      va_end (args);
4081
 
    }
4082
 
}
4083
 
 
4084
3836
static void
4085
 
lt_error_core (int exit_status, const char *file,
4086
 
               int line, const char *mode,
 
3837
lt_error_core (int exit_status, const char *mode,
4087
3838
               const char *message, va_list ap)
4088
3839
{
4089
 
  fprintf (stderr, "%s:%s:%d: %s: ", program_name, file, line, mode);
 
3840
  fprintf (stderr, "%s: %s: ", program_name, mode);
4090
3841
  vfprintf (stderr, message, ap);
4091
3842
  fprintf (stderr, ".\n");
4092
3843
 
4095
3846
}
4096
3847
 
4097
3848
void
4098
 
lt_fatal (const char *file, int line, const char *message, ...)
 
3849
lt_fatal (const char *message, ...)
4099
3850
{
4100
3851
  va_list ap;
4101
3852
  va_start (ap, message);
4102
 
  lt_error_core (EXIT_FAILURE, file, line, "FATAL", message, ap);
 
3853
  lt_error_core (EXIT_FAILURE, "FATAL", message, ap);
4103
3854
  va_end (ap);
4104
3855
}
4105
3856
 
4106
 
static const char *
4107
 
nonnull (const char *s)
4108
 
{
4109
 
  return s ? s : "(null)";
4110
 
}
4111
 
 
4112
 
static const char *
4113
 
nonempty (const char *s)
4114
 
{
4115
 
  return (s && !*s) ? "(empty)" : nonnull (s);
4116
 
}
4117
 
 
4118
3857
void
4119
3858
lt_setenv (const char *name, const char *value)
4120
3859
{
4121
 
  lt_debugprintf (__FILE__, __LINE__,
4122
 
                  "(lt_setenv) setting '%s' to '%s'\n",
4123
 
                  nonnull (name), nonnull (value));
 
3860
  LTWRAPPER_DEBUGPRINTF (("(lt_setenv) setting '%s' to '%s'\n",
 
3861
                          (name ? name : "<NULL>"),
 
3862
                          (value ? value : "<NULL>")));
4124
3863
  {
4125
3864
#ifdef HAVE_SETENV
4126
3865
    /* always make a copy, for consistency with !HAVE_SETENV */
4165
3904
  return new_value;
4166
3905
}
4167
3906
 
 
3907
int
 
3908
lt_split_name_value (const char *arg, char** name, char** value)
 
3909
{
 
3910
  const char *p;
 
3911
  int len;
 
3912
  if (!arg || !*arg)
 
3913
    return 1;
 
3914
 
 
3915
  p = strchr (arg, (int)'=');
 
3916
 
 
3917
  if (!p)
 
3918
    return 1;
 
3919
 
 
3920
  *value = xstrdup (++p);
 
3921
 
 
3922
  len = strlen (arg) - strlen (*value);
 
3923
  *name = XMALLOC (char, len);
 
3924
  strncpy (*name, arg, len-1);
 
3925
  (*name)[len - 1] = '\0';
 
3926
 
 
3927
  return 0;
 
3928
}
 
3929
 
 
3930
void
 
3931
lt_opt_process_env_set (const char *arg)
 
3932
{
 
3933
  char *name = NULL;
 
3934
  char *value = NULL;
 
3935
 
 
3936
  if (lt_split_name_value (arg, &name, &value) != 0)
 
3937
    {
 
3938
      XFREE (name);
 
3939
      XFREE (value);
 
3940
      lt_fatal ("bad argument for %s: '%s'", env_set_opt, arg);
 
3941
    }
 
3942
 
 
3943
  lt_setenv (name, value);
 
3944
  XFREE (name);
 
3945
  XFREE (value);
 
3946
}
 
3947
 
 
3948
void
 
3949
lt_opt_process_env_prepend (const char *arg)
 
3950
{
 
3951
  char *name = NULL;
 
3952
  char *value = NULL;
 
3953
  char *new_value = NULL;
 
3954
 
 
3955
  if (lt_split_name_value (arg, &name, &value) != 0)
 
3956
    {
 
3957
      XFREE (name);
 
3958
      XFREE (value);
 
3959
      lt_fatal ("bad argument for %s: '%s'", env_prepend_opt, arg);
 
3960
    }
 
3961
 
 
3962
  new_value = lt_extend_str (getenv (name), value, 0);
 
3963
  lt_setenv (name, new_value);
 
3964
  XFREE (new_value);
 
3965
  XFREE (name);
 
3966
  XFREE (value);
 
3967
}
 
3968
 
 
3969
void
 
3970
lt_opt_process_env_append (const char *arg)
 
3971
{
 
3972
  char *name = NULL;
 
3973
  char *value = NULL;
 
3974
  char *new_value = NULL;
 
3975
 
 
3976
  if (lt_split_name_value (arg, &name, &value) != 0)
 
3977
    {
 
3978
      XFREE (name);
 
3979
      XFREE (value);
 
3980
      lt_fatal ("bad argument for %s: '%s'", env_append_opt, arg);
 
3981
    }
 
3982
 
 
3983
  new_value = lt_extend_str (getenv (name), value, 1);
 
3984
  lt_setenv (name, new_value);
 
3985
  XFREE (new_value);
 
3986
  XFREE (name);
 
3987
  XFREE (value);
 
3988
}
 
3989
 
4168
3990
void
4169
3991
lt_update_exe_path (const char *name, const char *value)
4170
3992
{
4171
 
  lt_debugprintf (__FILE__, __LINE__,
4172
 
                  "(lt_update_exe_path) modifying '%s' by prepending '%s'\n",
4173
 
                  nonnull (name), nonnull (value));
 
3993
  LTWRAPPER_DEBUGPRINTF (("(lt_update_exe_path) modifying '%s' by prepending '%s'\n",
 
3994
                          (name ? name : "<NULL>"),
 
3995
                          (value ? value : "<NULL>")));
4174
3996
 
4175
3997
  if (name && *name && value && *value)
4176
3998
    {
4189
4011
void
4190
4012
lt_update_lib_path (const char *name, const char *value)
4191
4013
{
4192
 
  lt_debugprintf (__FILE__, __LINE__,
4193
 
                  "(lt_update_lib_path) modifying '%s' by prepending '%s'\n",
4194
 
                  nonnull (name), nonnull (value));
 
4014
  LTWRAPPER_DEBUGPRINTF (("(lt_update_lib_path) modifying '%s' by prepending '%s'\n",
 
4015
                          (name ? name : "<NULL>"),
 
4016
                          (value ? value : "<NULL>")));
4195
4017
 
4196
4018
  if (name && *name && value && *value)
4197
4019
    {
4201
4023
    }
4202
4024
}
4203
4025
 
4204
 
EOF
4205
 
            case $host_os in
4206
 
              mingw*)
4207
 
                cat <<"EOF"
4208
 
 
4209
 
/* Prepares an argument vector before calling spawn().
4210
 
   Note that spawn() does not by itself call the command interpreter
4211
 
     (getenv ("COMSPEC") != NULL ? getenv ("COMSPEC") :
4212
 
      ({ OSVERSIONINFO v; v.dwOSVersionInfoSize = sizeof(OSVERSIONINFO);
4213
 
         GetVersionEx(&v);
4214
 
         v.dwPlatformId == VER_PLATFORM_WIN32_NT;
4215
 
      }) ? "cmd.exe" : "command.com").
4216
 
   Instead it simply concatenates the arguments, separated by ' ', and calls
4217
 
   CreateProcess().  We must quote the arguments since Win32 CreateProcess()
4218
 
   interprets characters like ' ', '\t', '\\', '"' (but not '<' and '>') in a
4219
 
   special way:
4220
 
   - Space and tab are interpreted as delimiters. They are not treated as
4221
 
     delimiters if they are surrounded by double quotes: "...".
4222
 
   - Unescaped double quotes are removed from the input. Their only effect is
4223
 
     that within double quotes, space and tab are treated like normal
4224
 
     characters.
4225
 
   - Backslashes not followed by double quotes are not special.
4226
 
   - But 2*n+1 backslashes followed by a double quote become
4227
 
     n backslashes followed by a double quote (n >= 0):
4228
 
       \" -> "
4229
 
       \\\" -> \"
4230
 
       \\\\\" -> \\"
4231
 
 */
4232
 
#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"
4233
 
#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"
4234
 
char **
4235
 
prepare_spawn (char **argv)
4236
 
{
4237
 
  size_t argc;
4238
 
  char **new_argv;
4239
 
  size_t i;
4240
 
 
4241
 
  /* Count number of arguments.  */
4242
 
  for (argc = 0; argv[argc] != NULL; argc++)
4243
 
    ;
4244
 
 
4245
 
  /* Allocate new argument vector.  */
4246
 
  new_argv = XMALLOC (char *, argc + 1);
4247
 
 
4248
 
  /* Put quoted arguments into the new argument vector.  */
4249
 
  for (i = 0; i < argc; i++)
4250
 
    {
4251
 
      const char *string = argv[i];
4252
 
 
4253
 
      if (string[0] == '\0')
4254
 
        new_argv[i] = xstrdup ("\"\"");
4255
 
      else if (strpbrk (string, SHELL_SPECIAL_CHARS) != NULL)
4256
 
        {
4257
 
          int quote_around = (strpbrk (string, SHELL_SPACE_CHARS) != NULL);
4258
 
          size_t length;
4259
 
          unsigned int backslashes;
4260
 
          const char *s;
4261
 
          char *quoted_string;
4262
 
          char *p;
4263
 
 
4264
 
          length = 0;
4265
 
          backslashes = 0;
4266
 
          if (quote_around)
4267
 
            length++;
4268
 
          for (s = string; *s != '\0'; s++)
4269
 
            {
4270
 
              char c = *s;
4271
 
              if (c == '"')
4272
 
                length += backslashes + 1;
4273
 
              length++;
4274
 
              if (c == '\\')
4275
 
                backslashes++;
4276
 
              else
4277
 
                backslashes = 0;
4278
 
            }
4279
 
          if (quote_around)
4280
 
            length += backslashes + 1;
4281
 
 
4282
 
          quoted_string = XMALLOC (char, length + 1);
4283
 
 
4284
 
          p = quoted_string;
4285
 
          backslashes = 0;
4286
 
          if (quote_around)
4287
 
            *p++ = '"';
4288
 
          for (s = string; *s != '\0'; s++)
4289
 
            {
4290
 
              char c = *s;
4291
 
              if (c == '"')
4292
 
                {
4293
 
                  unsigned int j;
4294
 
                  for (j = backslashes + 1; j > 0; j--)
4295
 
                    *p++ = '\\';
4296
 
                }
4297
 
              *p++ = c;
4298
 
              if (c == '\\')
4299
 
                backslashes++;
4300
 
              else
4301
 
                backslashes = 0;
4302
 
            }
4303
 
          if (quote_around)
4304
 
            {
4305
 
              unsigned int j;
4306
 
              for (j = backslashes; j > 0; j--)
4307
 
                *p++ = '\\';
4308
 
              *p++ = '"';
4309
 
            }
4310
 
          *p = '\0';
4311
 
 
4312
 
          new_argv[i] = quoted_string;
4313
 
        }
4314
 
      else
4315
 
        new_argv[i] = (char *) string;
4316
 
    }
4317
 
  new_argv[argc] = NULL;
4318
 
 
4319
 
  return new_argv;
4320
 
}
4321
 
EOF
4322
 
                ;;
4323
 
            esac
4324
 
 
4325
 
            cat <<"EOF"
4326
 
void lt_dump_script (FILE* f)
4327
 
{
4328
 
EOF
4329
 
            func_emit_wrapper yes |
4330
 
              $SED -e 's/\([\\"]\)/\\\1/g' \
4331
 
                   -e 's/^/  fputs ("/' -e 's/$/\\n", f);/'
4332
 
 
4333
 
            cat <<"EOF"
4334
 
}
 
4026
 
4335
4027
EOF
4336
4028
}
4337
4029
# end: func_emit_cwrapperexe_src
4338
4030
 
4339
 
# func_win32_import_lib_p ARG
4340
 
# True if ARG is an import lib, as indicated by $file_magic_cmd
4341
 
func_win32_import_lib_p ()
4342
 
{
4343
 
    $opt_debug
4344
 
    case `eval $file_magic_cmd \"\$1\" 2>/dev/null | $SED -e 10q` in
4345
 
    *import*) : ;;
4346
 
    *) false ;;
4347
 
    esac
4348
 
}
4349
 
 
4350
4031
# func_mode_link arg...
4351
4032
func_mode_link ()
4352
4033
{
4391
4072
    new_inherited_linker_flags=
4392
4073
 
4393
4074
    avoid_version=no
4394
 
    bindir=
4395
4075
    dlfiles=
4396
4076
    dlprefiles=
4397
4077
    dlself=no
4484
4164
        esac
4485
4165
 
4486
4166
        case $prev in
4487
 
        bindir)
4488
 
          bindir="$arg"
4489
 
          prev=
4490
 
          continue
4491
 
          ;;
4492
4167
        dlfiles|dlprefiles)
4493
4168
          if test "$preload" = no; then
4494
4169
            # Add the symbol object into the linking commands.
4750
4425
        continue
4751
4426
        ;;
4752
4427
 
4753
 
      -bindir)
4754
 
        prev=bindir
4755
 
        continue
4756
 
        ;;
4757
 
 
4758
4428
      -dlopen)
4759
4429
        prev=dlfiles
4760
4430
        continue
4833
4503
        esac
4834
4504
        case $host in
4835
4505
        *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-cegcc*)
4836
 
          testbindir=`$ECHO "$dir" | $SED 's*/lib$*/bin*'`
 
4506
          testbindir=`$ECHO "X$dir" | $Xsed -e 's*/lib$*/bin*'`
4837
4507
          case :$dllsearchpath: in
4838
4508
          *":$dir:"*) ;;
4839
4509
          ::) dllsearchpath=$dir;;
4852
4522
      -l*)
4853
4523
        if test "X$arg" = "X-lc" || test "X$arg" = "X-lm"; then
4854
4524
          case $host in
4855
 
          *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-beos* | *-cegcc* | *-*-haiku*)
 
4525
          *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-beos* | *-cegcc*)
4856
4526
            # These systems don't actually have a C or math library (as such)
4857
4527
            continue
4858
4528
            ;;
5038
4708
        for flag in $args; do
5039
4709
          IFS="$save_ifs"
5040
4710
          func_quote_for_eval "$flag"
5041
 
          arg="$arg $func_quote_for_eval_result"
 
4711
          arg="$arg $wl$func_quote_for_eval_result"
5042
4712
          compiler_flags="$compiler_flags $func_quote_for_eval_result"
5043
4713
        done
5044
4714
        IFS="$save_ifs"
5084
4754
        arg="$func_quote_for_eval_result"
5085
4755
        ;;
5086
4756
 
5087
 
      # Flags to be passed through unchanged, with rationale:
5088
 
      # -64, -mips[0-9]      enable 64-bit mode for the SGI compiler
5089
 
      # -r[0-9][0-9]*        specify processor for the SGI compiler
5090
 
      # -xarch=*, -xtarget=* enable 64-bit mode for the Sun compiler
5091
 
      # +DA*, +DD*           enable 64-bit mode for the HP compiler
5092
 
      # -q*                  compiler args for the IBM compiler
5093
 
      # -m*, -t[45]*, -txscale* architecture-specific flags for GCC
5094
 
      # -F/path              path to uninstalled frameworks, gcc on darwin
5095
 
      # -p, -pg, --coverage, -fprofile-*  profiling flags for GCC
5096
 
      # @file                GCC response files
5097
 
      # -tp=*                Portland pgcc target processor selection
 
4757
      # -64, -mips[0-9] enable 64-bit mode on the SGI compiler
 
4758
      # -r[0-9][0-9]* specifies the processor on the SGI compiler
 
4759
      # -xarch=*, -xtarget=* enable 64-bit mode on the Sun compiler
 
4760
      # +DA*, +DD* enable 64-bit mode on the HP compiler
 
4761
      # -q* pass through compiler args for the IBM compiler
 
4762
      # -m*, -t[45]*, -txscale* pass through architecture-specific
 
4763
      # compiler args for GCC
 
4764
      # -F/path gives path to uninstalled frameworks, gcc on darwin
 
4765
      # -p, -pg, --coverage, -fprofile-* pass through profiling flag for GCC
 
4766
      # @file GCC response files
5098
4767
      -64|-mips[0-9]|-r[0-9][0-9]*|-xarch=*|-xtarget=*|+DA*|+DD*|-q*|-m*| \
5099
 
      -t[45]*|-txscale*|-p|-pg|--coverage|-fprofile-*|-F*|@*|-tp=*)
 
4768
      -t[45]*|-txscale*|-p|-pg|--coverage|-fprofile-*|-F*|@*)
5100
4769
        func_quote_for_eval "$arg"
5101
4770
        arg="$func_quote_for_eval_result"
5102
4771
        func_append compile_command " $arg"
5256
4925
 
5257
4926
    if test -n "$shlibpath_var"; then
5258
4927
      # get the directories listed in $shlibpath_var
5259
 
      eval shlib_search_path=\`\$ECHO \"\${$shlibpath_var}\" \| \$SED \'s/:/ /g\'\`
 
4928
      eval shlib_search_path=\`\$ECHO \"X\${$shlibpath_var}\" \| \$Xsed -e \'s/:/ /g\'\`
5260
4929
    else
5261
4930
      shlib_search_path=
5262
4931
    fi
5364
5033
        case $pass in
5365
5034
        dlopen) libs="$dlfiles" ;;
5366
5035
        dlpreopen) libs="$dlprefiles" ;;
5367
 
        link) libs="$deplibs %DEPLIBS% $dependency_libs" ;;
 
5036
        link)
 
5037
          libs="$deplibs %DEPLIBS%"
 
5038
          test "X$link_all_deplibs" != Xno && libs="$libs $dependency_libs"
 
5039
          ;;
5368
5040
        esac
5369
5041
      fi
5370
5042
      if test "$linkmode,$pass" = "lib,dlpreopen"; then
5379
5051
          # Collect preopened libtool deplibs, except any this library
5380
5052
          # has declared as weak libs
5381
5053
          for deplib in $dependency_libs; do
5382
 
            func_basename "$deplib"
5383
 
            deplib_base=$func_basename_result
 
5054
            deplib_base=`$ECHO "X$deplib" | $Xsed -e "$basename"`
5384
5055
            case " $weak_libs " in
5385
5056
            *" $deplib_base "*) ;;
5386
5057
            *) deplibs="$deplibs $deplib" ;;
5559
5230
                match_pattern*)
5560
5231
                  set dummy $deplibs_check_method; shift
5561
5232
                  match_pattern_regex=`expr "$deplibs_check_method" : "$1 \(.*\)"`
5562
 
                  if eval "\$ECHO \"$deplib\"" 2>/dev/null | $SED 10q \
 
5233
                  if eval "\$ECHO \"X$deplib\"" 2>/dev/null | $Xsed -e 10q \
5563
5234
                    | $EGREP "$match_pattern_regex" > /dev/null; then
5564
5235
                    valid_a_lib=yes
5565
5236
                  fi
5569
5240
                ;;
5570
5241
              esac
5571
5242
              if test "$valid_a_lib" != yes; then
5572
 
                echo
 
5243
                $ECHO
5573
5244
                $ECHO "*** Warning: Trying to link with static lib archive $deplib."
5574
 
                echo "*** I have the capability to make that library automatically link in when"
5575
 
                echo "*** you link to this library.  But I can only do this if you have a"
5576
 
                echo "*** shared version of the library, which you do not appear to have"
5577
 
                echo "*** because the file extensions .$libext of this argument makes me believe"
5578
 
                echo "*** that it is just a static archive that I should not use here."
 
5245
                $ECHO "*** I have the capability to make that library automatically link in when"
 
5246
                $ECHO "*** you link to this library.  But I can only do this if you have a"
 
5247
                $ECHO "*** shared version of the library, which you do not appear to have"
 
5248
                $ECHO "*** because the file extensions .$libext of this argument makes me believe"
 
5249
                $ECHO "*** that it is just a static archive that I should not use here."
5579
5250
              else
5580
 
                echo
 
5251
                $ECHO
5581
5252
                $ECHO "*** Warning: Linking the shared library $output against the"
5582
5253
                $ECHO "*** static library $deplib is not portable!"
5583
5254
                deplibs="$deplib $deplibs"
5650
5321
 
5651
5322
        # Convert "-framework foo" to "foo.ltframework"
5652
5323
        if test -n "$inherited_linker_flags"; then
5653
 
          tmp_inherited_linker_flags=`$ECHO "$inherited_linker_flags" | $SED 's/-framework \([^ $]*\)/\1.ltframework/g'`
 
5324
          tmp_inherited_linker_flags=`$ECHO "X$inherited_linker_flags" | $Xsed -e 's/-framework \([^ $]*\)/\1.ltframework/g'`
5654
5325
          for tmp_inherited_linker_flag in $tmp_inherited_linker_flags; do
5655
5326
            case " $new_inherited_linker_flags " in
5656
5327
              *" $tmp_inherited_linker_flag "*) ;;
5658
5329
            esac
5659
5330
          done
5660
5331
        fi
5661
 
        dependency_libs=`$ECHO " $dependency_libs" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'`
 
5332
        dependency_libs=`$ECHO "X $dependency_libs" | $Xsed -e 's% \([^ $]*\).ltframework% -framework \1%g'`
5662
5333
        if test "$linkmode,$pass" = "lib,link" ||
5663
5334
           test "$linkmode,$pass" = "prog,scan" ||
5664
5335
           { test "$linkmode" != prog && test "$linkmode" != lib; }; then
5676
5347
            # It is a libtool convenience library, so add in its objects.
5677
5348
            convenience="$convenience $ladir/$objdir/$old_library"
5678
5349
            old_convenience="$old_convenience $ladir/$objdir/$old_library"
 
5350
            tmp_libs=
 
5351
            for deplib in $dependency_libs; do
 
5352
              deplibs="$deplib $deplibs"
 
5353
              if $opt_duplicate_deps ; then
 
5354
                case "$tmp_libs " in
 
5355
                *" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;;
 
5356
                esac
 
5357
              fi
 
5358
              tmp_libs="$tmp_libs $deplib"
 
5359
            done
5679
5360
          elif test "$linkmode" != prog && test "$linkmode" != lib; then
5680
5361
            func_fatal_error "\`$lib' is not a convenience library"
5681
5362
          fi
5682
 
          tmp_libs=
5683
 
          for deplib in $dependency_libs; do
5684
 
            deplibs="$deplib $deplibs"
5685
 
            if $opt_duplicate_deps ; then
5686
 
              case "$tmp_libs " in
5687
 
              *" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;;
5688
 
              esac
5689
 
            fi
5690
 
            tmp_libs="$tmp_libs $deplib"
5691
 
          done
5692
5363
          continue
5693
5364
        fi # $pass = conv
5694
5365
 
5912
5583
            fi
5913
5584
          done
5914
5585
          if test -z "$dlopenmodule" && test "$shouldnotlink" = yes && test "$pass" = link; then
5915
 
            echo
 
5586
            $ECHO
5916
5587
            if test "$linkmode" = prog; then
5917
5588
              $ECHO "*** Warning: Linking the executable $output against the loadable module"
5918
5589
            else
6015
5686
                      if test "X$dlopenmodule" != "X$lib"; then
6016
5687
                        $ECHO "*** Warning: lib $linklib is a module, not a shared library"
6017
5688
                        if test -z "$old_library" ; then
6018
 
                          echo
6019
 
                          echo "*** And there doesn't seem to be a static archive available"
6020
 
                          echo "*** The link will probably fail, sorry"
 
5689
                          $ECHO
 
5690
                          $ECHO "*** And there doesn't seem to be a static archive available"
 
5691
                          $ECHO "*** The link will probably fail, sorry"
6021
5692
                        else
6022
5693
                          add="$dir/$old_library"
6023
5694
                        fi
6157
5828
 
6158
5829
            # Just print a warning and add the library to dependency_libs so
6159
5830
            # that the program can be linked against the static library.
6160
 
            echo
 
5831
            $ECHO
6161
5832
            $ECHO "*** Warning: This system can not link to static lib archive $lib."
6162
 
            echo "*** I have the capability to make that library automatically link in when"
6163
 
            echo "*** you link to this library.  But I can only do this if you have a"
6164
 
            echo "*** shared version of the library, which you do not appear to have."
 
5833
            $ECHO "*** I have the capability to make that library automatically link in when"
 
5834
            $ECHO "*** you link to this library.  But I can only do this if you have a"
 
5835
            $ECHO "*** shared version of the library, which you do not appear to have."
6165
5836
            if test "$module" = yes; then
6166
 
              echo "*** But as you try to build a module library, libtool will still create "
6167
 
              echo "*** a static module, that should work as long as the dlopening application"
6168
 
              echo "*** is linked with the -dlopen flag to resolve symbols at runtime."
 
5837
              $ECHO "*** But as you try to build a module library, libtool will still create "
 
5838
              $ECHO "*** a static module, that should work as long as the dlopening application"
 
5839
              $ECHO "*** is linked with the -dlopen flag to resolve symbols at runtime."
6169
5840
              if test -z "$global_symbol_pipe"; then
6170
 
                echo
6171
 
                echo "*** However, this would only work if libtool was able to extract symbol"
6172
 
                echo "*** lists from a program, using \`nm' or equivalent, but libtool could"
6173
 
                echo "*** not find such a program.  So, this module is probably useless."
6174
 
                echo "*** \`nm' from GNU binutils and a full rebuild may help."
 
5841
                $ECHO
 
5842
                $ECHO "*** However, this would only work if libtool was able to extract symbol"
 
5843
                $ECHO "*** lists from a program, using \`nm' or equivalent, but libtool could"
 
5844
                $ECHO "*** not find such a program.  So, this module is probably useless."
 
5845
                $ECHO "*** \`nm' from GNU binutils and a full rebuild may help."
6175
5846
              fi
6176
5847
              if test "$build_old_libs" = no; then
6177
5848
                build_libtool_libs=module
6291
5962
          compile_deplibs="$new_inherited_linker_flags $compile_deplibs"
6292
5963
          finalize_deplibs="$new_inherited_linker_flags $finalize_deplibs"
6293
5964
        else
6294
 
          compiler_flags="$compiler_flags "`$ECHO " $new_inherited_linker_flags" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'`
 
5965
          compiler_flags="$compiler_flags "`$ECHO "X $new_inherited_linker_flags" | $Xsed -e 's% \([^ $]*\).ltframework% -framework \1%g'`
6295
5966
        fi
6296
5967
      fi
6297
5968
      dependency_libs="$newdependency_libs"
6459
6130
        if test "$deplibs_check_method" != pass_all; then
6460
6131
          func_fatal_error "cannot build libtool library \`$output' from non-libtool objects on this host:$objs"
6461
6132
        else
6462
 
          echo
 
6133
          $ECHO
6463
6134
          $ECHO "*** Warning: Linking the shared library $output against the non-libtool"
6464
6135
          $ECHO "*** objects $objs is not portable!"
6465
6136
          libobjs="$libobjs $objs"
6527
6198
            age="$number_minor"
6528
6199
            revision="$number_revision"
6529
6200
            ;;
6530
 
          freebsd-aout|freebsd-elf|qnx|sunos)
 
6201
          freebsd-aout|freebsd-elf|sunos)
6531
6202
            current="$number_major"
6532
6203
            revision="$number_minor"
6533
6204
            age="0"
6539
6210
            revision="$number_minor"
6540
6211
            lt_irix_increment=no
6541
6212
            ;;
 
6213
          *)
 
6214
            func_fatal_configuration "$modename: unknown library version type \`$version_type'"
 
6215
            ;;
6542
6216
          esac
6543
6217
          ;;
6544
6218
        no)
6761
6435
        oldlibs="$oldlibs $output_objdir/$libname.$libext"
6762
6436
 
6763
6437
        # Transform .lo files to .o files.
6764
 
        oldobjs="$objs "`$ECHO "$libobjs" | $SP2NL | $SED "/\.${libext}$/d; $lo2o" | $NL2SP`
 
6438
        oldobjs="$objs "`$ECHO "X$libobjs" | $SP2NL | $Xsed -e '/\.'${libext}'$/d' -e "$lo2o" | $NL2SP`
6765
6439
      fi
6766
6440
 
6767
6441
      # Eliminate all temporary directories.
6768
6442
      #for path in $notinst_path; do
6769
 
      # lib_search_path=`$ECHO "$lib_search_path " | $SED "s% $path % %g"`
6770
 
      # deplibs=`$ECHO "$deplibs " | $SED "s% -L$path % %g"`
6771
 
      # dependency_libs=`$ECHO "$dependency_libs " | $SED "s% -L$path % %g"`
 
6443
      # lib_search_path=`$ECHO "X$lib_search_path " | $Xsed -e "s% $path % %g"`
 
6444
      # deplibs=`$ECHO "X$deplibs " | $Xsed -e "s% -L$path % %g"`
 
6445
      # dependency_libs=`$ECHO "X$dependency_libs " | $Xsed -e "s% -L$path % %g"`
6772
6446
      #done
6773
6447
 
6774
6448
      if test -n "$xrpath"; then
6809
6483
      if test "$build_libtool_libs" = yes; then
6810
6484
        if test -n "$rpath"; then
6811
6485
          case $host in
6812
 
          *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-*-beos* | *-cegcc* | *-*-haiku*)
 
6486
          *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-*-beos* | *-cegcc*)
6813
6487
            # these systems don't actually have a c library (as such)!
6814
6488
            ;;
6815
6489
          *-*-rhapsody* | *-*-darwin1.[012])
6894
6568
                    newdeplibs="$newdeplibs $i"
6895
6569
                  else
6896
6570
                    droppeddeps=yes
6897
 
                    echo
 
6571
                    $ECHO
6898
6572
                    $ECHO "*** Warning: dynamic linker does not accept needed library $i."
6899
 
                    echo "*** I have the capability to make that library automatically link in when"
6900
 
                    echo "*** you link to this library.  But I can only do this if you have a"
6901
 
                    echo "*** shared version of the library, which I believe you do not have"
6902
 
                    echo "*** because a test_compile did reveal that the linker did not use it for"
6903
 
                    echo "*** its dynamic dependency list that programs get resolved with at runtime."
 
6573
                    $ECHO "*** I have the capability to make that library automatically link in when"
 
6574
                    $ECHO "*** you link to this library.  But I can only do this if you have a"
 
6575
                    $ECHO "*** shared version of the library, which I believe you do not have"
 
6576
                    $ECHO "*** because a test_compile did reveal that the linker did not use it for"
 
6577
                    $ECHO "*** its dynamic dependency list that programs get resolved with at runtime."
6904
6578
                  fi
6905
6579
                fi
6906
6580
                ;;
6937
6611
                      newdeplibs="$newdeplibs $i"
6938
6612
                    else
6939
6613
                      droppeddeps=yes
6940
 
                      echo
 
6614
                      $ECHO
6941
6615
                      $ECHO "*** Warning: dynamic linker does not accept needed library $i."
6942
 
                      echo "*** I have the capability to make that library automatically link in when"
6943
 
                      echo "*** you link to this library.  But I can only do this if you have a"
6944
 
                      echo "*** shared version of the library, which you do not appear to have"
6945
 
                      echo "*** because a test_compile did reveal that the linker did not use this one"
6946
 
                      echo "*** as a dynamic dependency that programs can get resolved with at runtime."
 
6616
                      $ECHO "*** I have the capability to make that library automatically link in when"
 
6617
                      $ECHO "*** you link to this library.  But I can only do this if you have a"
 
6618
                      $ECHO "*** shared version of the library, which you do not appear to have"
 
6619
                      $ECHO "*** because a test_compile did reveal that the linker did not use this one"
 
6620
                      $ECHO "*** as a dynamic dependency that programs can get resolved with at runtime."
6947
6621
                    fi
6948
6622
                  fi
6949
6623
                else
6950
6624
                  droppeddeps=yes
6951
 
                  echo
 
6625
                  $ECHO
6952
6626
                  $ECHO "*** Warning!  Library $i is needed by this library but I was not able to"
6953
 
                  echo "*** make it link in!  You will probably need to install it or some"
6954
 
                  echo "*** library that it depends on before this library will be fully"
6955
 
                  echo "*** functional.  Installing it before continuing would be even better."
 
6627
                  $ECHO "*** make it link in!  You will probably need to install it or some"
 
6628
                  $ECHO "*** library that it depends on before this library will be fully"
 
6629
                  $ECHO "*** functional.  Installing it before continuing would be even better."
6956
6630
                fi
6957
6631
                ;;
6958
6632
              *)
6998
6672
                        potliblink=`ls -ld $potlib | ${SED} 's/.* -> //'`
6999
6673
                        case $potliblink in
7000
6674
                        [\\/]* | [A-Za-z]:[\\/]*) potlib="$potliblink";;
7001
 
                        *) potlib=`$ECHO "$potlib" | $SED 's,[^/]*$,,'`"$potliblink";;
 
6675
                        *) potlib=`$ECHO "X$potlib" | $Xsed -e 's,[^/]*$,,'`"$potliblink";;
7002
6676
                        esac
7003
6677
                      done
7004
6678
                      if eval $file_magic_cmd \"\$potlib\" 2>/dev/null |
7013
6687
              fi
7014
6688
              if test -n "$a_deplib" ; then
7015
6689
                droppeddeps=yes
7016
 
                echo
 
6690
                $ECHO
7017
6691
                $ECHO "*** Warning: linker path does not have real file for library $a_deplib."
7018
 
                echo "*** I have the capability to make that library automatically link in when"
7019
 
                echo "*** you link to this library.  But I can only do this if you have a"
7020
 
                echo "*** shared version of the library, which you do not appear to have"
7021
 
                echo "*** because I did check the linker path looking for a file starting"
 
6692
                $ECHO "*** I have the capability to make that library automatically link in when"
 
6693
                $ECHO "*** you link to this library.  But I can only do this if you have a"
 
6694
                $ECHO "*** shared version of the library, which you do not appear to have"
 
6695
                $ECHO "*** because I did check the linker path looking for a file starting"
7022
6696
                if test -z "$potlib" ; then
7023
6697
                  $ECHO "*** with $libname but no candidates were found. (...for file magic test)"
7024
6698
                else
7056
6730
                  potential_libs=`ls $i/$libname[.-]* 2>/dev/null`
7057
6731
                  for potent_lib in $potential_libs; do
7058
6732
                    potlib="$potent_lib" # see symlink-check above in file_magic test
7059
 
                    if eval "\$ECHO \"$potent_lib\"" 2>/dev/null | $SED 10q | \
 
6733
                    if eval "\$ECHO \"X$potent_lib\"" 2>/dev/null | $Xsed -e 10q | \
7060
6734
                       $EGREP "$match_pattern_regex" > /dev/null; then
7061
6735
                      newdeplibs="$newdeplibs $a_deplib"
7062
6736
                      a_deplib=""
7067
6741
              fi
7068
6742
              if test -n "$a_deplib" ; then
7069
6743
                droppeddeps=yes
7070
 
                echo
 
6744
                $ECHO
7071
6745
                $ECHO "*** Warning: linker path does not have real file for library $a_deplib."
7072
 
                echo "*** I have the capability to make that library automatically link in when"
7073
 
                echo "*** you link to this library.  But I can only do this if you have a"
7074
 
                echo "*** shared version of the library, which you do not appear to have"
7075
 
                echo "*** because I did check the linker path looking for a file starting"
 
6746
                $ECHO "*** I have the capability to make that library automatically link in when"
 
6747
                $ECHO "*** you link to this library.  But I can only do this if you have a"
 
6748
                $ECHO "*** shared version of the library, which you do not appear to have"
 
6749
                $ECHO "*** because I did check the linker path looking for a file starting"
7076
6750
                if test -z "$potlib" ; then
7077
6751
                  $ECHO "*** with $libname but no candidates were found. (...for regex pattern test)"
7078
6752
                else
7090
6764
          ;;
7091
6765
        none | unknown | *)
7092
6766
          newdeplibs=""
7093
 
          tmp_deplibs=`$ECHO " $deplibs" | $SED 's/ -lc$//; s/ -[LR][^ ]*//g'`
 
6767
          tmp_deplibs=`$ECHO "X $deplibs" | $Xsed \
 
6768
              -e 's/ -lc$//' -e 's/ -[LR][^ ]*//g'`
7094
6769
          if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
7095
6770
            for i in $predeps $postdeps ; do
7096
6771
              # can't use Xsed below, because $i might contain '/'
7097
 
              tmp_deplibs=`$ECHO " $tmp_deplibs" | $SED "s,$i,,"`
 
6772
              tmp_deplibs=`$ECHO "X $tmp_deplibs" | $Xsed -e "s,$i,,"`
7098
6773
            done
7099
6774
          fi
7100
 
          case $tmp_deplibs in
7101
 
          *[!\  \ ]*)
7102
 
            echo
 
6775
          if $ECHO "X $tmp_deplibs" | $Xsed -e 's/[      ]//g' |
 
6776
             $GREP . >/dev/null; then
 
6777
            $ECHO
7103
6778
            if test "X$deplibs_check_method" = "Xnone"; then
7104
 
              echo "*** Warning: inter-library dependencies are not supported in this platform."
 
6779
              $ECHO "*** Warning: inter-library dependencies are not supported in this platform."
7105
6780
            else
7106
 
              echo "*** Warning: inter-library dependencies are not known to be supported."
 
6781
              $ECHO "*** Warning: inter-library dependencies are not known to be supported."
7107
6782
            fi
7108
 
            echo "*** All declared inter-library dependencies are being dropped."
 
6783
            $ECHO "*** All declared inter-library dependencies are being dropped."
7109
6784
            droppeddeps=yes
7110
 
            ;;
7111
 
          esac
 
6785
          fi
7112
6786
          ;;
7113
6787
        esac
7114
6788
        versuffix=$versuffix_save
7120
6794
        case $host in
7121
6795
        *-*-rhapsody* | *-*-darwin1.[012])
7122
6796
          # On Rhapsody replace the C library with the System framework
7123
 
          newdeplibs=`$ECHO " $newdeplibs" | $SED 's/ -lc / System.ltframework /'`
 
6797
          newdeplibs=`$ECHO "X $newdeplibs" | $Xsed -e 's/ -lc / System.ltframework /'`
7124
6798
          ;;
7125
6799
        esac
7126
6800
 
7127
6801
        if test "$droppeddeps" = yes; then
7128
6802
          if test "$module" = yes; then
7129
 
            echo
7130
 
            echo "*** Warning: libtool could not satisfy all declared inter-library"
 
6803
            $ECHO
 
6804
            $ECHO "*** Warning: libtool could not satisfy all declared inter-library"
7131
6805
            $ECHO "*** dependencies of module $libname.  Therefore, libtool will create"
7132
 
            echo "*** a static module, that should work as long as the dlopening"
7133
 
            echo "*** application is linked with the -dlopen flag."
 
6806
            $ECHO "*** a static module, that should work as long as the dlopening"
 
6807
            $ECHO "*** application is linked with the -dlopen flag."
7134
6808
            if test -z "$global_symbol_pipe"; then
7135
 
              echo
7136
 
              echo "*** However, this would only work if libtool was able to extract symbol"
7137
 
              echo "*** lists from a program, using \`nm' or equivalent, but libtool could"
7138
 
              echo "*** not find such a program.  So, this module is probably useless."
7139
 
              echo "*** \`nm' from GNU binutils and a full rebuild may help."
 
6809
              $ECHO
 
6810
              $ECHO "*** However, this would only work if libtool was able to extract symbol"
 
6811
              $ECHO "*** lists from a program, using \`nm' or equivalent, but libtool could"
 
6812
              $ECHO "*** not find such a program.  So, this module is probably useless."
 
6813
              $ECHO "*** \`nm' from GNU binutils and a full rebuild may help."
7140
6814
            fi
7141
6815
            if test "$build_old_libs" = no; then
7142
6816
              oldlibs="$output_objdir/$libname.$libext"
7146
6820
              build_libtool_libs=no
7147
6821
            fi
7148
6822
          else
7149
 
            echo "*** The inter-library dependencies that have been dropped here will be"
7150
 
            echo "*** automatically added whenever a program is linked with this library"
7151
 
            echo "*** or is declared to -dlopen it."
 
6823
            $ECHO "*** The inter-library dependencies that have been dropped here will be"
 
6824
            $ECHO "*** automatically added whenever a program is linked with this library"
 
6825
            $ECHO "*** or is declared to -dlopen it."
7152
6826
 
7153
6827
            if test "$allow_undefined" = no; then
7154
 
              echo
7155
 
              echo "*** Since this library must not contain undefined symbols,"
7156
 
              echo "*** because either the platform does not support them or"
7157
 
              echo "*** it was explicitly requested with -no-undefined,"
7158
 
              echo "*** libtool will only create a static version of it."
 
6828
              $ECHO
 
6829
              $ECHO "*** Since this library must not contain undefined symbols,"
 
6830
              $ECHO "*** because either the platform does not support them or"
 
6831
              $ECHO "*** it was explicitly requested with -no-undefined,"
 
6832
              $ECHO "*** libtool will only create a static version of it."
7159
6833
              if test "$build_old_libs" = no; then
7160
6834
                oldlibs="$output_objdir/$libname.$libext"
7161
6835
                build_libtool_libs=module
7172
6846
      # Time to change all our "foo.ltframework" stuff back to "-framework foo"
7173
6847
      case $host in
7174
6848
        *-*-darwin*)
7175
 
          newdeplibs=`$ECHO " $newdeplibs" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'`
7176
 
          new_inherited_linker_flags=`$ECHO " $new_inherited_linker_flags" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'`
7177
 
          deplibs=`$ECHO " $deplibs" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'`
 
6849
          newdeplibs=`$ECHO "X $newdeplibs" | $Xsed -e 's% \([^ $]*\).ltframework% -framework \1%g'`
 
6850
          new_inherited_linker_flags=`$ECHO "X $new_inherited_linker_flags" | $Xsed -e 's% \([^ $]*\).ltframework% -framework \1%g'`
 
6851
          deplibs=`$ECHO "X $deplibs" | $Xsed -e 's% \([^ $]*\).ltframework% -framework \1%g'`
7178
6852
          ;;
7179
6853
      esac
7180
6854
 
7296
6970
        done
7297
6971
 
7298
6972
        # Use standard objects if they are pic
7299
 
        test -z "$pic_flag" && libobjs=`$ECHO "$libobjs" | $SP2NL | $SED "$lo2o" | $NL2SP`
 
6973
        test -z "$pic_flag" && libobjs=`$ECHO "X$libobjs" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP`
7300
6974
        test "X$libobjs" = "X " && libobjs=
7301
6975
 
7302
6976
        delfiles=
7362
7036
        if test -n "$export_symbols" && test -n "$include_expsyms"; then
7363
7037
          tmp_export_symbols="$export_symbols"
7364
7038
          test -n "$orig_export_symbols" && tmp_export_symbols="$orig_export_symbols"
7365
 
          $opt_dry_run || eval '$ECHO "$include_expsyms" | $SP2NL >> "$tmp_export_symbols"'
 
7039
          $opt_dry_run || eval '$ECHO "X$include_expsyms" | $Xsed | $SP2NL >> "$tmp_export_symbols"'
7366
7040
        fi
7367
7041
 
7368
7042
        if test "X$skipped_export" != "X:" && test -n "$orig_export_symbols"; then
7463
7137
            save_libobjs=$libobjs
7464
7138
          fi
7465
7139
          save_output=$output
7466
 
          func_basename "$output"
7467
 
          output_la=$func_basename_result
 
7140
          output_la=`$ECHO "X$output" | $Xsed -e "$basename"`
7468
7141
 
7469
7142
          # Clear the reloadable object creation command queue and
7470
7143
          # initialize k to one.
7477
7150
          if test -n "$save_libobjs" && test "X$skipped_export" != "X:" && test "$with_gnu_ld" = yes; then
7478
7151
            output=${output_objdir}/${output_la}.lnkscript
7479
7152
            func_verbose "creating GNU ld script: $output"
7480
 
            echo 'INPUT (' > $output
 
7153
            $ECHO 'INPUT (' > $output
7481
7154
            for obj in $save_libobjs
7482
7155
            do
7483
7156
              $ECHO "$obj" >> $output
7484
7157
            done
7485
 
            echo ')' >> $output
 
7158
            $ECHO ')' >> $output
7486
7159
            delfiles="$delfiles $output"
7487
7160
          elif test -n "$save_libobjs" && test "X$skipped_export" != "X:" && test "X$file_list_spec" != X; then
7488
7161
            output=${output_objdir}/${output_la}.lnk
7524
7197
                  # command to the queue.
7525
7198
                  if test "$k" -eq 1 ; then
7526
7199
                    # The first file doesn't have a previous command to add.
7527
 
                    reload_objs=$objlist
7528
 
                    eval concat_cmds=\"$reload_cmds\"
 
7200
                    eval concat_cmds=\"$reload_cmds $objlist $last_robj\"
7529
7201
                  else
7530
7202
                    # All subsequent reloadable object files will link in
7531
7203
                    # the last one created.
7532
 
                    reload_objs="$objlist $last_robj"
7533
 
                    eval concat_cmds=\"\$concat_cmds~$reload_cmds~\$RM $last_robj\"
 
7204
                    eval concat_cmds=\"\$concat_cmds~$reload_cmds $objlist $last_robj~\$RM $last_robj\"
7534
7205
                  fi
7535
7206
                  last_robj=$output_objdir/$output_la-${k}.$objext
7536
7207
                  func_arith $k + 1
7537
7208
                  k=$func_arith_result
7538
7209
                  output=$output_objdir/$output_la-${k}.$objext
7539
 
                  objlist=" $obj"
 
7210
                  objlist=$obj
7540
7211
                  func_len " $last_robj"
7541
7212
                  func_arith $len0 + $func_len_result
7542
7213
                  len=$func_arith_result
7546
7217
              # reloadable object file.  All subsequent reloadable object
7547
7218
              # files will link in the last one created.
7548
7219
              test -z "$concat_cmds" || concat_cmds=$concat_cmds~
7549
 
              reload_objs="$objlist $last_robj"
7550
 
              eval concat_cmds=\"\${concat_cmds}$reload_cmds\"
 
7220
              eval concat_cmds=\"\${concat_cmds}$reload_cmds $objlist $last_robj\"
7551
7221
              if test -n "$last_robj"; then
7552
7222
                eval concat_cmds=\"\${concat_cmds}~\$RM $last_robj\"
7553
7223
              fi
7606
7276
            if test -n "$export_symbols" && test -n "$include_expsyms"; then
7607
7277
              tmp_export_symbols="$export_symbols"
7608
7278
              test -n "$orig_export_symbols" && tmp_export_symbols="$orig_export_symbols"
7609
 
              $opt_dry_run || eval '$ECHO "$include_expsyms" | $SP2NL >> "$tmp_export_symbols"'
 
7279
              $opt_dry_run || eval '$ECHO "X$include_expsyms" | $Xsed | $SP2NL >> "$tmp_export_symbols"'
7610
7280
            fi
7611
7281
 
7612
7282
            if test -n "$orig_export_symbols"; then
7771
7441
      if test -n "$convenience"; then
7772
7442
        if test -n "$whole_archive_flag_spec"; then
7773
7443
          eval tmp_whole_archive_flags=\"$whole_archive_flag_spec\"
7774
 
          reload_conv_objs=$reload_objs\ `$ECHO "$tmp_whole_archive_flags" | $SED 's|,| |g'`
 
7444
          reload_conv_objs=$reload_objs\ `$ECHO "X$tmp_whole_archive_flags" | $Xsed -e 's|,| |g'`
7775
7445
        else
7776
7446
          gentop="$output_objdir/${obj}x"
7777
7447
          generated="$generated $gentop"
7782
7452
      fi
7783
7453
 
7784
7454
      # Create the old-style object.
7785
 
      reload_objs="$objs$old_deplibs "`$ECHO "$libobjs" | $SP2NL | $SED "/\.${libext}$/d; /\.lib$/d; $lo2o" | $NL2SP`" $reload_conv_objs" ### testsuite: skip nested quoting test
 
7455
      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
7786
7456
 
7787
7457
      output="$obj"
7788
7458
      func_execute_cmds "$reload_cmds" 'exit $?'
7842
7512
      case $host in
7843
7513
      *-*-rhapsody* | *-*-darwin1.[012])
7844
7514
        # On Rhapsody replace the C library is the System framework
7845
 
        compile_deplibs=`$ECHO " $compile_deplibs" | $SED 's/ -lc / System.ltframework /'`
7846
 
        finalize_deplibs=`$ECHO " $finalize_deplibs" | $SED 's/ -lc / System.ltframework /'`
 
7515
        compile_deplibs=`$ECHO "X $compile_deplibs" | $Xsed -e 's/ -lc / System.ltframework /'`
 
7516
        finalize_deplibs=`$ECHO "X $finalize_deplibs" | $Xsed -e 's/ -lc / System.ltframework /'`
7847
7517
        ;;
7848
7518
      esac
7849
7519
 
7860
7530
          esac
7861
7531
        fi
7862
7532
        # Time to change all our "foo.ltframework" stuff back to "-framework foo"
7863
 
        compile_deplibs=`$ECHO " $compile_deplibs" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'`
7864
 
        finalize_deplibs=`$ECHO " $finalize_deplibs" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'`
 
7533
        compile_deplibs=`$ECHO "X $compile_deplibs" | $Xsed -e 's% \([^ $]*\).ltframework% -framework \1%g'`
 
7534
        finalize_deplibs=`$ECHO "X $finalize_deplibs" | $Xsed -e 's% \([^ $]*\).ltframework% -framework \1%g'`
7865
7535
        ;;
7866
7536
      esac
7867
7537
 
7998
7668
 
7999
7669
      if test -n "$libobjs" && test "$build_old_libs" = yes; then
8000
7670
        # Transform all the library objects into standard objects.
8001
 
        compile_command=`$ECHO "$compile_command" | $SP2NL | $SED "$lo2o" | $NL2SP`
8002
 
        finalize_command=`$ECHO "$finalize_command" | $SP2NL | $SED "$lo2o" | $NL2SP`
 
7671
        compile_command=`$ECHO "X$compile_command" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP`
 
7672
        finalize_command=`$ECHO "X$finalize_command" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP`
8003
7673
      fi
8004
7674
 
8005
7675
      func_generate_dlsyms "$outputname" "@PROGRAM@" "no"
8011
7681
 
8012
7682
      wrappers_required=yes
8013
7683
      case $host in
8014
 
      *cegcc* | *mingw32ce*)
8015
 
        # Disable wrappers for cegcc and mingw32ce hosts, we are cross compiling anyway.
8016
 
        wrappers_required=no
8017
 
        ;;
8018
7684
      *cygwin* | *mingw* )
8019
7685
        if test "$build_libtool_libs" != yes; then
8020
7686
          wrappers_required=no
8021
7687
        fi
8022
7688
        ;;
 
7689
      *cegcc)
 
7690
        # Disable wrappers for cegcc, we are cross compiling anyway.
 
7691
        wrappers_required=no
 
7692
        ;;
8023
7693
      *)
8024
7694
        if test "$need_relink" = no || test "$build_libtool_libs" != yes; then
8025
7695
          wrappers_required=no
8028
7698
      esac
8029
7699
      if test "$wrappers_required" = no; then
8030
7700
        # Replace the output file specification.
8031
 
        compile_command=`$ECHO "$compile_command" | $SED 's%@OUTPUT@%'"$output"'%g'`
 
7701
        compile_command=`$ECHO "X$compile_command" | $Xsed -e 's%@OUTPUT@%'"$output"'%g'`
8032
7702
        link_command="$compile_command$compile_rpath"
8033
7703
 
8034
7704
        # We have no uninstalled library dependencies, so finalize right now.
8075
7745
        # We don't need to create a wrapper script.
8076
7746
        link_command="$compile_var$compile_command$compile_rpath"
8077
7747
        # Replace the output file specification.
8078
 
        link_command=`$ECHO "$link_command" | $SED 's%@OUTPUT@%'"$output"'%g'`
 
7748
        link_command=`$ECHO "X$link_command" | $Xsed -e 's%@OUTPUT@%'"$output"'%g'`
8079
7749
        # Delete the old output file.
8080
7750
        $opt_dry_run || $RM $output
8081
7751
        # Link the executable and exit
8094
7764
        if test "$fast_install" != no; then
8095
7765
          link_command="$finalize_var$compile_command$finalize_rpath"
8096
7766
          if test "$fast_install" = yes; then
8097
 
            relink_command=`$ECHO "$compile_var$compile_command$compile_rpath" | $SED 's%@OUTPUT@%\$progdir/\$file%g'`
 
7767
            relink_command=`$ECHO "X$compile_var$compile_command$compile_rpath" | $Xsed -e 's%@OUTPUT@%\$progdir/\$file%g'`
8098
7768
          else
8099
7769
            # fast_install is set to needless
8100
7770
            relink_command=
8106
7776
      fi
8107
7777
 
8108
7778
      # Replace the output file specification.
8109
 
      link_command=`$ECHO "$link_command" | $SED 's%@OUTPUT@%'"$output_objdir/$outputname"'%g'`
 
7779
      link_command=`$ECHO "X$link_command" | $Xsed -e 's%@OUTPUT@%'"$output_objdir/$outputname"'%g'`
8110
7780
 
8111
7781
      # Delete the old output files.
8112
7782
      $opt_dry_run || $RM $output $output_objdir/$outputname $output_objdir/lt-$outputname
8130
7800
          fi
8131
7801
        done
8132
7802
        relink_command="(cd `pwd`; $relink_command)"
8133
 
        relink_command=`$ECHO "$relink_command" | $SED "$sed_quote_subst"`
 
7803
        relink_command=`$ECHO "X$relink_command" | $Xsed -e "$sed_quote_subst"`
 
7804
      fi
 
7805
 
 
7806
      # Quote $ECHO for shipping.
 
7807
      if test "X$ECHO" = "X$SHELL $progpath --fallback-echo"; then
 
7808
        case $progpath in
 
7809
        [\\/]* | [A-Za-z]:[\\/]*) qecho="$SHELL $progpath --fallback-echo";;
 
7810
        *) qecho="$SHELL `pwd`/$progpath --fallback-echo";;
 
7811
        esac
 
7812
        qecho=`$ECHO "X$qecho" | $Xsed -e "$sed_quote_subst"`
 
7813
      else
 
7814
        qecho=`$ECHO "X$ECHO" | $Xsed -e "$sed_quote_subst"`
8134
7815
      fi
8135
7816
 
8136
7817
      # Only actually do things if not in dry run mode.
8251
7932
            done | sort | sort -uc >/dev/null 2>&1); then
8252
7933
          :
8253
7934
        else
8254
 
          echo "copying selected object files to avoid basename conflicts..."
 
7935
          $ECHO "copying selected object files to avoid basename conflicts..."
8255
7936
          gentop="$output_objdir/${outputname}x"
8256
7937
          generated="$generated $gentop"
8257
7938
          func_mkdir_p "$gentop"
8362
8043
      done
8363
8044
      # Quote the link command for shipping.
8364
8045
      relink_command="(cd `pwd`; $SHELL $progpath $preserve_args --mode=relink $libtool_args @inst_prefix_dir@)"
8365
 
      relink_command=`$ECHO "$relink_command" | $SED "$sed_quote_subst"`
 
8046
      relink_command=`$ECHO "X$relink_command" | $Xsed -e "$sed_quote_subst"`
8366
8047
      if test "$hardcode_automatic" = yes ; then
8367
8048
        relink_command=
8368
8049
      fi
8447
8128
          fi
8448
8129
          $RM $output
8449
8130
          # place dlname in correct position for cygwin
8450
 
          # In fact, it would be nice if we could use this code for all target
8451
 
          # systems that can't hard-code library paths into their executables
8452
 
          # and that have no shared library path variable independent of PATH,
8453
 
          # but it turns out we can't easily determine that from inspecting
8454
 
          # libtool variables, so we have to hard-code the OSs to which it
8455
 
          # applies here; at the moment, that means platforms that use the PE
8456
 
          # object format with DLL files.  See the long comment at the top of
8457
 
          # tests/bindir.at for full details.
8458
8131
          tdlname=$dlname
8459
8132
          case $host,$output,$installed,$module,$dlname in
8460
 
            *cygwin*,*lai,yes,no,*.dll | *mingw*,*lai,yes,no,*.dll | *cegcc*,*lai,yes,no,*.dll)
8461
 
              # If a -bindir argument was supplied, place the dll there.
8462
 
              if test "x$bindir" != x ;
8463
 
              then
8464
 
                func_relative_path "$install_libdir" "$bindir"
8465
 
                tdlname=$func_relative_path_result$dlname
8466
 
              else
8467
 
                # Otherwise fall back on heuristic.
8468
 
                tdlname=../bin/$dlname
8469
 
              fi
8470
 
              ;;
 
8133
            *cygwin*,*lai,yes,no,*.dll | *mingw*,*lai,yes,no,*.dll | *cegcc*,*lai,yes,no,*.dll) tdlname=../bin/$dlname ;;
8471
8134
          esac
8472
8135
          $ECHO > $output "\
8473
8136
# $outputname - a libtool library file