~ubuntu-branches/ubuntu/oneiric/squid3/oneiric-security

« back to all changes in this revision

Viewing changes to libltdl/config/ltmain.sh

  • Committer: Bazaar Package Importer
  • Author(s): Mahyuddin Susanto
  • Date: 2011-02-15 18:46:13 UTC
  • mfrom: (21.2.4 sid)
  • Revision ID: james.westby@ubuntu.com-20110215184613-1u3dh5sz4i055flk
Tags: 3.1.10-1ubuntu1
* Merge from debian unstable. (LP: #719283)  Remaining changes:
  - debian/patches/18-fix-ftbfs-binutils-gold.dpatch: Add library linker into
    LIBS instead to LDFLAGS to fixing FTBFS binutils-gold.
* Drop Ubuntu configuration for ufw which landed in Debian and sync it: 
  - debian/squid3.ufw.profile.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
# Generated from ltmain.m4sh.
2
2
 
3
 
# ltmain.sh (GNU libtool) 2.2.6b
 
3
# libtool (GNU libtool) 2.2.10
4
4
# Written by Gordon Matzigkeit <gord@gnu.ai.mit.edu>, 1996
5
5
 
6
 
# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005, 2006, 2007 2008 Free Software Foundation, Inc.
 
6
# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005, 2006,
 
7
# 2007, 2008, 2009, 2010 Free Software Foundation, Inc.
7
8
# This is free software; see the source for copying conditions.  There is NO
8
9
# warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
9
10
 
32
33
#
33
34
# Provide generalized library-building support services.
34
35
#
35
 
#     --config             show all configuration variables
36
 
#     --debug              enable verbose shell tracing
37
 
# -n, --dry-run            display commands without modifying any files
38
 
#     --features           display basic configuration information and exit
39
 
#     --mode=MODE          use operation mode MODE
40
 
#     --preserve-dup-deps  don't remove duplicate dependency libraries
41
 
#     --quiet, --silent    don't print informational messages
42
 
#     --tag=TAG            use configuration variables from tag TAG
43
 
# -v, --verbose            print informational messages (default)
44
 
#     --version            print version information
45
 
# -h, --help               print short or long help message
 
36
#       --config             show all configuration variables
 
37
#       --debug              enable verbose shell tracing
 
38
#   -n, --dry-run            display commands without modifying any files
 
39
#       --features           display basic configuration information and exit
 
40
#       --mode=MODE          use operation mode MODE
 
41
#       --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
46
50
#
47
51
# MODE must be one of the following:
48
52
#
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
 
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
56
60
#
57
 
# MODE-ARGS vary depending on the MODE.
 
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.
58
63
# Try `$progname --help --mode=MODE' for a more detailed description of MODE.
59
64
#
60
65
# When reporting a bug, please describe a test case to reproduce it and
61
66
# include the following information:
62
67
#
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
69
 
#       automake:               $automake_version
70
 
#       autoconf:               $autoconf_version
 
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.10
 
74
#         automake:     $automake_version
 
75
#         autoconf:     $autoconf_version
71
76
#
72
77
# Report bugs to <bug-libtool@gnu.org>.
73
78
 
74
 
PROGRAM=ltmain.sh
 
79
PROGRAM=libtool
75
80
PACKAGE=libtool
76
 
VERSION=2.2.6b
 
81
VERSION=2.2.10
77
82
TIMESTAMP=""
78
 
package_revision=1.3017
 
83
package_revision=1.3175
79
84
 
80
85
# Be Bourne compatible
81
86
if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then
91
96
BIN_SH=xpg4; export BIN_SH # for Tru64
92
97
DUALCASE=1; export DUALCASE # for MKS sh
93
98
 
 
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
 
94
107
# 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).
98
108
lt_user_locale=
99
109
lt_safe_locale=
100
110
for lt_var in LANG LANGUAGE LC_ALL LC_CTYPE LC_COLLATE LC_MESSAGES
107
117
          lt_safe_locale=\"$lt_var=C; \$lt_safe_locale\"
108
118
        fi"
109
119
done
 
120
LC_ALL=C
 
121
LANGUAGE=C
 
122
export LANGUAGE LC_ALL
110
123
 
111
124
$lt_unset CDPATH
112
125
 
113
126
 
 
127
# Work around backward compatibility issue on IRIX 6.5. On IRIX 6.4+, sh
 
128
# is ksh but when the shell is invoked as "sh" and the current value of
 
129
# the _XPG environment variable is not equal to 1 (one), the special
 
130
# positional parameter $0, within a function call, is the name of the
 
131
# function.
 
132
progpath="$0"
114
133
 
115
134
 
116
135
 
117
136
: ${CP="cp -f"}
118
 
: ${ECHO="echo"}
119
 
: ${EGREP="/bin/grep -E"}
120
 
: ${FGREP="/bin/grep -F"}
121
 
: ${GREP="/bin/grep"}
 
137
test "${ECHO+set}" = set || ECHO=${as_echo-'printf %s\n'}
 
138
: ${EGREP="grep -E"}
 
139
: ${FGREP="grep -F"}
 
140
: ${GREP="grep"}
122
141
: ${LN_S="ln -s"}
123
142
: ${MAKE="make"}
124
143
: ${MKDIR="mkdir"}
125
144
: ${MV="mv -f"}
126
145
: ${RM="rm -f"}
127
 
: ${SED="/bin/sed"}
 
146
: ${SED="sed"}
128
147
: ${SHELL="${CONFIG_SHELL-/bin/sh}"}
129
148
: ${Xsed="$SED -e 1s/^X//"}
130
149
 
159
178
func_dirname_and_basename ()
160
179
{
161
180
  # Extract subdirectory from the argument.
162
 
  func_dirname_result=`$ECHO "X${1}" | $Xsed -e "$dirname"`
 
181
  func_dirname_result=`$ECHO "${1}" | $SED -e "$dirname"`
163
182
  if test "X$func_dirname_result" = "X${1}"; then
164
183
    func_dirname_result="${3}"
165
184
  else
166
185
    func_dirname_result="$func_dirname_result${2}"
167
186
  fi
168
 
  func_basename_result=`$ECHO "X${1}" | $Xsed -e "$basename"`
 
187
  func_basename_result=`$ECHO "${1}" | $SED -e "$basename"`
169
188
}
170
189
 
171
190
# Generated shell functions inserted here.
172
191
 
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"
 
192
# These SED scripts presuppose an absolute path with a trailing slash.
 
193
pathcar='s,^/\([^/]*\).*$,\1,'
 
194
pathcdr='s,^/[^/]*,,'
 
195
removedotparts=':dotsl
 
196
                s@/\./@/@g
 
197
                t dotsl
 
198
                s,/\.$,/,'
 
199
collapseslashes='s@/\{1,\}@/@g'
 
200
finalslash='s,/*$,/,'
 
201
 
 
202
# func_normal_abspath PATH
 
203
# Remove doubled-up and trailing slashes, "." path components,
 
204
# and cancel out any ".." path components in PATH after making
 
205
# it an absolute path.
 
206
#             value returned in "$func_normal_abspath_result"
 
207
func_normal_abspath ()
 
208
{
 
209
  # Start from root dir and reassemble the path.
 
210
  func_normal_abspath_result=
 
211
  func_normal_abspath_tpath=$1
 
212
  func_normal_abspath_altnamespace=
 
213
  case $func_normal_abspath_tpath in
 
214
    "")
 
215
      # Empty path, that just means $cwd.
 
216
      func_stripname '' '/' "`pwd`"
 
217
      func_normal_abspath_result=$func_stripname_result
 
218
      return
 
219
    ;;
 
220
    # The next three entries are used to spot a run of precisely
 
221
    # two leading slashes without using negated character classes;
 
222
    # we take advantage of case's first-match behaviour.
 
223
    ///*)
 
224
      # Unusual form of absolute path, do nothing.
 
225
    ;;
 
226
    //*)
 
227
      # Not necessarily an ordinary path; POSIX reserves leading '//'
 
228
      # and for example Cygwin uses it to access remote file shares
 
229
      # over CIFS/SMB, so we conserve a leading double slash if found.
 
230
      func_normal_abspath_altnamespace=/
 
231
    ;;
 
232
    /*)
 
233
      # Absolute path, do nothing.
 
234
    ;;
 
235
    *)
 
236
      # Relative path, prepend $cwd.
 
237
      func_normal_abspath_tpath=`pwd`/$func_normal_abspath_tpath
 
238
    ;;
 
239
  esac
 
240
  # Cancel out all the simple stuff to save iterations.  We also want
 
241
  # the path to end with a slash for ease of parsing, so make sure
 
242
  # there is one (and only one) here.
 
243
  func_normal_abspath_tpath=`$ECHO "$func_normal_abspath_tpath" | $SED \
 
244
        -e "$removedotparts" -e "$collapseslashes" -e "$finalslash"`
 
245
  while :; do
 
246
    # Processed it all yet?
 
247
    if test "$func_normal_abspath_tpath" = / ; then
 
248
      # If we ascended to the root using ".." the result may be empty now.
 
249
      if test -z "$func_normal_abspath_result" ; then
 
250
        func_normal_abspath_result=/
 
251
      fi
 
252
      break
 
253
    fi
 
254
    func_normal_abspath_tcomponent=`$ECHO "$func_normal_abspath_tpath" | $SED \
 
255
        -e "$pathcar"`
 
256
    func_normal_abspath_tpath=`$ECHO "$func_normal_abspath_tpath" | $SED \
 
257
        -e "$pathcdr"`
 
258
    # Figure out what to do with it
 
259
    case $func_normal_abspath_tcomponent in
 
260
      "")
 
261
        # Trailing empty path component, ignore it.
 
262
      ;;
 
263
      ..)
 
264
        # Parent dir; strip last assembled component from result.
 
265
        func_dirname "$func_normal_abspath_result"
 
266
        func_normal_abspath_result=$func_dirname_result
 
267
      ;;
 
268
      *)
 
269
        # Actual path component, append it.
 
270
        func_normal_abspath_result=$func_normal_abspath_result/$func_normal_abspath_tcomponent
 
271
      ;;
 
272
    esac
 
273
  done
 
274
  # Restore leading double-slash if one was found on entry.
 
275
  func_normal_abspath_result=$func_normal_abspath_altnamespace$func_normal_abspath_result
 
276
}
 
277
 
 
278
# func_relative_path SRCDIR DSTDIR
 
279
# generates a relative path from SRCDIR to DSTDIR, with a trailing
 
280
# slash if non-empty, suitable for immediately appending a filename
 
281
# without needing to append a separator.
 
282
#             value returned in "$func_relative_path_result"
 
283
func_relative_path ()
 
284
{
 
285
  func_relative_path_result=
 
286
  func_normal_abspath "$1"
 
287
  func_relative_path_tlibdir=$func_normal_abspath_result
 
288
  func_normal_abspath "$2"
 
289
  func_relative_path_tbindir=$func_normal_abspath_result
 
290
 
 
291
  # Ascend the tree starting from libdir
 
292
  while :; do
 
293
    # check if we have found a prefix of bindir
 
294
    case $func_relative_path_tbindir in
 
295
      $func_relative_path_tlibdir)
 
296
        # found an exact match
 
297
        func_relative_path_tcancelled=
 
298
        break
 
299
        ;;
 
300
      $func_relative_path_tlibdir*)
 
301
        # found a matching prefix
 
302
        func_stripname "$func_relative_path_tlibdir" '' "$func_relative_path_tbindir"
 
303
        func_relative_path_tcancelled=$func_stripname_result
 
304
        if test -z "$func_relative_path_result"; then
 
305
          func_relative_path_result=.
 
306
        fi
 
307
        break
 
308
        ;;
 
309
      *)
 
310
        func_dirname $func_relative_path_tlibdir
 
311
        func_relative_path_tlibdir=${func_dirname_result}
 
312
        if test "x$func_relative_path_tlibdir" = x ; then
 
313
          # Have to descend all the way to the root!
 
314
          func_relative_path_result=../$func_relative_path_result
 
315
          func_relative_path_tcancelled=$func_relative_path_tbindir
 
316
          break
 
317
        fi
 
318
        func_relative_path_result=../$func_relative_path_result
 
319
        ;;
 
320
    esac
 
321
  done
 
322
 
 
323
  # Now calculate path; take care to avoid doubling-up slashes.
 
324
  func_stripname '' '/' "$func_relative_path_result"
 
325
  func_relative_path_result=$func_stripname_result
 
326
  func_stripname '/' '/' "$func_relative_path_tcancelled"
 
327
  if test "x$func_stripname_result" != x ; then
 
328
    func_relative_path_result=${func_relative_path_result}/${func_stripname_result}
 
329
  fi
 
330
 
 
331
  # Normalisation. If bindir is libdir, return empty string,
 
332
  # else relative path ending with a slash; either way, target
 
333
  # file name can be directly appended.
 
334
  if test ! -z "$func_relative_path_result"; then
 
335
    func_stripname './' '' "$func_relative_path_result/"
 
336
    func_relative_path_result=$func_stripname_result
 
337
  fi
 
338
}
179
339
 
180
340
# 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:
183
341
func_dirname_and_basename "$progpath"
184
342
progname=$func_basename_result
185
 
case $progname in
186
 
  -*) progname=./$progname ;;
187
 
esac
188
343
 
189
344
# Make sure we have an absolute path for reexecution:
190
345
case $progpath in
258
413
    :
259
414
}
260
415
 
 
416
# func_echo_all arg...
 
417
# Invoke $ECHO with all args, space-separated.
 
418
func_echo_all ()
 
419
{
 
420
    $ECHO "$*"
 
421
}
 
422
 
261
423
# func_error arg...
262
424
# Echo program name prefixed message to standard error.
263
425
func_error ()
326
488
        case $my_directory_path in */*) ;; *) break ;; esac
327
489
 
328
490
        # ...otherwise throw away the child directory and loop
329
 
        my_directory_path=`$ECHO "X$my_directory_path" | $Xsed -e "$dirname"`
 
491
        my_directory_path=`$ECHO "$my_directory_path" | $SED -e "$dirname"`
330
492
      done
331
 
      my_dir_list=`$ECHO "X$my_dir_list" | $Xsed -e 's,:*$,,'`
 
493
      my_dir_list=`$ECHO "$my_dir_list" | $SED 's,:*$,,'`
332
494
 
333
495
      save_mkdir_p_IFS="$IFS"; IFS=':'
334
496
      for my_dir in $my_dir_list; do
378
540
        func_fatal_error "cannot create temporary directory \`$my_tmpdir'"
379
541
    fi
380
542
 
381
 
    $ECHO "X$my_tmpdir" | $Xsed
 
543
    $ECHO "$my_tmpdir"
382
544
}
383
545
 
384
546
 
392
554
{
393
555
    case $1 in
394
556
      *[\\\`\"\$]*)
395
 
        func_quote_for_eval_unquoted_result=`$ECHO "X$1" | $Xsed -e "$sed_quote_subst"` ;;
 
557
        func_quote_for_eval_unquoted_result=`$ECHO "$1" | $SED "$sed_quote_subst"` ;;
396
558
      *)
397
559
        func_quote_for_eval_unquoted_result="$1" ;;
398
560
    esac
419
581
{
420
582
    case $1 in
421
583
      *[\\\`\"]*)
422
 
        my_arg=`$ECHO "X$1" | $Xsed \
 
584
        my_arg=`$ECHO "$1" | $SED \
423
585
            -e "$double_quote_subst" -e "$sed_double_backslash"` ;;
424
586
      *)
425
587
        my_arg="$1" ;;
489
651
}
490
652
 
491
653
 
492
 
 
493
 
 
494
 
 
495
654
# func_version
496
655
# Echo version message to standard output and exit.
497
656
func_version ()
498
657
{
499
 
    $SED -n '/^# '$PROGRAM' (GNU /,/# warranty; / {
 
658
    $SED -n '/(C)/!b go
 
659
        :more
 
660
        /\./!{
 
661
          N
 
662
          s/\n# / /
 
663
          b more
 
664
        }
 
665
        :go
 
666
        /^# '$PROGRAM' (GNU /,/# warranty; / {
500
667
        s/^# //
501
668
        s/^# *$//
502
669
        s/\((C)\)[ 0-9,-]*\( [1-9][0-9]*\)/\1\2/
509
676
# Echo short help message to standard output and exit.
510
677
func_usage ()
511
678
{
512
 
    $SED -n '/^# Usage:/,/# -h/ {
 
679
    $SED -n '/^# Usage:/,/^#  *.*--help/ {
513
680
        s/^# //
514
681
        s/^# *$//
515
682
        s/\$progname/'$progname'/
516
683
        p
517
684
    }' < "$progpath"
518
 
    $ECHO
 
685
    echo
519
686
    $ECHO "run \`$progname --help | more' for full usage"
520
687
    exit $?
521
688
}
522
689
 
523
 
# func_help
524
 
# Echo long help message to standard output and exit.
 
690
# func_help [NOEXIT]
 
691
# Echo long help message to standard output and exit,
 
692
# unless 'noexit' is passed as argument.
525
693
func_help ()
526
694
{
527
695
    $SED -n '/^# Usage:/,/# Report bugs to/ {
538
706
        s/\$autoconf_version/'"`(autoconf --version) 2>/dev/null |$SED 1q`"'/
539
707
        p
540
708
     }' < "$progpath"
541
 
    exit $?
 
709
    ret=$?
 
710
    if test -z "$1"; then
 
711
      exit $ret
 
712
    fi
542
713
}
543
714
 
544
715
# func_missing_arg argname
546
717
# exit_cmd.
547
718
func_missing_arg ()
548
719
{
549
 
    func_error "missing argument for $1"
 
720
    func_error "missing argument for $1."
550
721
    exit_cmd=exit
551
722
}
552
723
 
556
727
 
557
728
 
558
729
 
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
582
730
 
583
731
magic="%%%MAGIC variable%%%"
584
732
magic_exe="%%%MAGIC EXE variable%%%"
636
784
# Display the features supported by this script.
637
785
func_features ()
638
786
{
639
 
    $ECHO "host: $host"
 
787
    echo "host: $host"
640
788
    if test "$build_libtool_libs" = yes; then
641
 
      $ECHO "enable shared libraries"
 
789
      echo "enable shared libraries"
642
790
    else
643
 
      $ECHO "disable shared libraries"
 
791
      echo "disable shared libraries"
644
792
    fi
645
793
    if test "$build_old_libs" = yes; then
646
 
      $ECHO "enable static libraries"
 
794
      echo "enable static libraries"
647
795
    else
648
 
      $ECHO "disable static libraries"
 
796
      echo "disable static libraries"
649
797
    fi
650
798
 
651
799
    exit $?
772
920
 
773
921
      --quiet|--silent) preserve_args="$preserve_args $opt"
774
922
                        opt_silent=:
 
923
                        opt_verbose=false
 
924
                        ;;
 
925
 
 
926
      --no-quiet|--no-silent)
 
927
                        preserve_args="$preserve_args $opt"
 
928
                        opt_silent=false
775
929
                        ;;
776
930
 
777
931
      --verbose| -v)    preserve_args="$preserve_args $opt"
778
932
                        opt_silent=false
 
933
                        opt_verbose=:
 
934
                        ;;
 
935
 
 
936
      --no-verbose)     preserve_args="$preserve_args $opt"
 
937
                        opt_verbose=false
779
938
                        ;;
780
939
 
781
940
      --tag)            test "$#" -eq 0 && func_missing_arg "$opt" && break
793
952
 
794
953
      -\?|-h)           func_usage                                      ;;
795
954
      --help)           opt_help=:                                      ;;
 
955
      --help-all)       opt_help=': help-all'                           ;;
796
956
      --version)        func_version                                    ;;
797
957
 
798
958
      -*)               func_fatal_help "unrecognized option \`$opt'"   ;;
1012
1172
    $opt_debug
1013
1173
 
1014
1174
    # FreeBSD-specific: where we install compilers with non-standard names
1015
 
    tag_compilers_CC="*cc cc* *gcc gcc*"
1016
 
    tag_compilers_CXX="*c++ c++* *g++ g++*"
 
1175
    tag_compilers_CC="*cc cc* *gcc gcc* clang"
 
1176
    tag_compilers_CXX="*c++ c++* *g++ g++* clang++"
1017
1177
    base_compiler=`set -- "$@"; echo $1`
1018
1178
 
1019
1179
    # If $tagname isn't set, then try to infer if the default "CC" tag applies
1031
1191
        func_quote_for_eval "$arg"
1032
1192
        CC_quoted="$CC_quoted $func_quote_for_eval_result"
1033
1193
      done
 
1194
      CC_expanded=`func_echo_all $CC`
 
1195
      CC_quoted_expanded=`func_echo_all $CC_quoted`
1034
1196
      case $@ in
1035
1197
      # Blanks in the command may have been stripped by the calling shell,
1036
1198
      # but not from the CC environment variable when configure was run.
1037
 
      " $CC "* | "$CC "* | " `$ECHO $CC` "* | "`$ECHO $CC` "* | " $CC_quoted"* | "$CC_quoted "* | " `$ECHO $CC_quoted` "* | "`$ECHO $CC_quoted` "*) ;;
 
1199
      " $CC "* | "$CC "* | " $CC_expanded "* | "$CC_expanded "* | \
 
1200
      " $CC_quoted"* | "$CC_quoted "* | " $CC_quoted_expanded "* | "$CC_quoted_expanded "*) ;;
1038
1201
      # Blanks at the start of $base_compile will cause this to fail
1039
1202
      # if we don't check for them as well.
1040
1203
      *)
1048
1211
              func_quote_for_eval "$arg"
1049
1212
              CC_quoted="$CC_quoted $func_quote_for_eval_result"
1050
1213
            done
 
1214
            CC_expanded=`func_echo_all $CC`
 
1215
            CC_quoted_expanded=`func_echo_all $CC_quoted`
1051
1216
            case "$@ " in
1052
 
              " $CC "* | "$CC "* | " `$ECHO $CC` "* | "`$ECHO $CC` "* | " $CC_quoted"* | "$CC_quoted "* | " `$ECHO $CC_quoted` "* | "`$ECHO $CC_quoted` "*)
 
1217
            " $CC "* | "$CC "* | " $CC_expanded "* | "$CC_expanded "* | \
 
1218
            " $CC_quoted"* | "$CC_quoted "* | " $CC_quoted_expanded "* | "$CC_quoted_expanded "*)
1053
1219
              # The compiler in the base compile command matches
1054
1220
              # the one in the tagged configuration.
1055
1221
              # Assume this is the tagged configuration we want.
1243
1409
    *.[cCFSifmso] | \
1244
1410
    *.ada | *.adb | *.ads | *.asm | \
1245
1411
    *.c++ | *.cc | *.ii | *.class | *.cpp | *.cxx | \
1246
 
    *.[fF][09]? | *.for | *.java | *.obj | *.sx)
 
1412
    *.[fF][09]? | *.for | *.java | *.obj | *.sx | *.cu | *.cup)
1247
1413
      func_xform "$libobj"
1248
1414
      libobj=$func_xform_result
1249
1415
      ;;
1318
1484
    # Calculate the filename of the output object if compiler does
1319
1485
    # not support -o with -c
1320
1486
    if test "$compiler_c_o" = no; then
1321
 
      output_obj=`$ECHO "X$srcfile" | $Xsed -e 's%^.*/%%' -e 's%\.[^.]*$%%'`.${objext}
 
1487
      output_obj=`$ECHO "$srcfile" | $SED 's%^.*/%%; s%\.[^.]*$%%'`.${objext}
1322
1488
      lockfile="$output_obj.lock"
1323
1489
    else
1324
1490
      output_obj=
1475
1641
}
1476
1642
 
1477
1643
$opt_help || {
1478
 
test "$mode" = compile && func_mode_compile ${1+"$@"}
 
1644
  test "$mode" = compile && func_mode_compile ${1+"$@"}
1479
1645
}
1480
1646
 
1481
1647
func_mode_help ()
1512
1678
 
1513
1679
  -o OUTPUT-FILE    set the output file name to OUTPUT-FILE
1514
1680
  -no-suppress      do not suppress compiler output for multiple passes
1515
 
  -prefer-pic       try to building PIC objects only
1516
 
  -prefer-non-pic   try to building non-PIC objects only
 
1681
  -prefer-pic       try to build PIC objects only
 
1682
  -prefer-non-pic   try to build non-PIC objects only
1517
1683
  -shared           do not build a \`.o' file suitable for static linking
1518
1684
  -static           only build a \`.o' file suitable for static linking
 
1685
  -Wc,FLAG          pass FLAG directly to the compiler
1519
1686
 
1520
1687
COMPILE-COMMAND is a command to be used in creating a \`standard' object file
1521
1688
from the given SOURCEFILE.
1568
1735
 
1569
1736
The following components of INSTALL-COMMAND are treated specially:
1570
1737
 
1571
 
  -inst-prefix PREFIX-DIR  Use PREFIX-DIR as a staging area for installation
 
1738
  -inst-prefix-dir PREFIX-DIR  Use PREFIX-DIR as a staging area for installation
1572
1739
 
1573
1740
The rest of the components are interpreted as arguments to that command (only
1574
1741
BSD-compatible install options are recognized)."
1588
1755
 
1589
1756
  -all-static       do not do any dynamic linking at all
1590
1757
  -avoid-version    do not add a version suffix if possible
 
1758
  -bindir BINDIR    specify path to binaries directory (for systems where
 
1759
                    libraries must be found in the PATH setting at runtime)
1591
1760
  -dlopen FILE      \`-dlpreopen' FILE if it cannot be dlopened at runtime
1592
1761
  -dlpreopen FILE   link in FILE and add its symbols to lt_preloaded_symbols
1593
1762
  -export-dynamic   allow symbols from OUTPUT-FILE to be resolved with dlsym(3)
1616
1785
  -version-info CURRENT[:REVISION[:AGE]]
1617
1786
                    specify library version info [each variable defaults to 0]
1618
1787
  -weak LIBNAME     declare that the target provides the LIBNAME interface
 
1788
  -Wc,FLAG
 
1789
  -Xcompiler FLAG   pass linker-specific FLAG directly to the compiler
 
1790
  -Wl,FLAG
 
1791
  -Xlinker FLAG     pass linker-specific FLAG directly to the linker
 
1792
  -XCClinker FLAG   pass link-specific FLAG to the compiler driver (CC)
1619
1793
 
1620
1794
All other options (arguments beginning with \`-') are ignored.
1621
1795
 
1653
1827
        ;;
1654
1828
    esac
1655
1829
 
1656
 
    $ECHO
 
1830
    echo
1657
1831
    $ECHO "Try \`$progname --help' for more information about other modes."
1658
 
 
1659
 
    exit $?
1660
1832
}
1661
1833
 
1662
 
  # Now that we've collected a possible --mode arg, show help if necessary
1663
 
  $opt_help && func_mode_help
 
1834
# Now that we've collected a possible --mode arg, show help if necessary
 
1835
if $opt_help; then
 
1836
  if test "$opt_help" = :; then
 
1837
    func_mode_help
 
1838
  else
 
1839
    {
 
1840
      func_help noexit
 
1841
      for mode in compile link execute install finish uninstall clean; do
 
1842
        func_mode_help
 
1843
      done
 
1844
    } | sed -n '1p; 2,$s/^Usage:/  or: /p'
 
1845
    {
 
1846
      func_help noexit
 
1847
      for mode in compile link execute install finish uninstall clean; do
 
1848
        echo
 
1849
        func_mode_help
 
1850
      done
 
1851
    } |
 
1852
    sed '1d
 
1853
      /^When reporting/,/^Report/{
 
1854
        H
 
1855
        d
 
1856
      }
 
1857
      $x
 
1858
      /information about other modes/d
 
1859
      /more detailed .*MODE/d
 
1860
      s/^Usage:.*--mode=\([^ ]*\) .*/Description of \1 mode:/'
 
1861
  fi
 
1862
  exit $?
 
1863
fi
1664
1864
 
1665
1865
 
1666
1866
# func_mode_execute arg...
1742
1942
    for file
1743
1943
    do
1744
1944
      case $file in
1745
 
      -*) ;;
 
1945
      -* | *.la | *.lo ) ;;
1746
1946
      *)
1747
1947
        # Do a test to see if this is really a libtool program.
1748
1948
        if func_ltwrapper_script_p "$file"; then
1784
1984
      # Display what would be done.
1785
1985
      if test -n "$shlibpath_var"; then
1786
1986
        eval "\$ECHO \"\$shlibpath_var=\$$shlibpath_var\""
1787
 
        $ECHO "export $shlibpath_var"
 
1987
        echo "export $shlibpath_var"
1788
1988
      fi
1789
1989
      $ECHO "$cmd$args"
1790
1990
      exit $EXIT_SUCCESS
1825
2025
    # Exit here if they wanted silent mode.
1826
2026
    $opt_silent && exit $EXIT_SUCCESS
1827
2027
 
1828
 
    $ECHO "X----------------------------------------------------------------------" | $Xsed
1829
 
    $ECHO "Libraries have been installed in:"
 
2028
    echo "----------------------------------------------------------------------"
 
2029
    echo "Libraries have been installed in:"
1830
2030
    for libdir in $libdirs; do
1831
2031
      $ECHO "   $libdir"
1832
2032
    done
1833
 
    $ECHO
1834
 
    $ECHO "If you ever happen to want to link against installed libraries"
1835
 
    $ECHO "in a given directory, LIBDIR, you must either use libtool, and"
1836
 
    $ECHO "specify the full pathname of the library, or use the \`-LLIBDIR'"
1837
 
    $ECHO "flag during linking and do at least one of the following:"
 
2033
    echo
 
2034
    echo "If you ever happen to want to link against installed libraries"
 
2035
    echo "in a given directory, LIBDIR, you must either use libtool, and"
 
2036
    echo "specify the full pathname of the library, or use the \`-LLIBDIR'"
 
2037
    echo "flag during linking and do at least one of the following:"
1838
2038
    if test -n "$shlibpath_var"; then
1839
 
      $ECHO "   - add LIBDIR to the \`$shlibpath_var' environment variable"
1840
 
      $ECHO "     during execution"
 
2039
      echo "   - add LIBDIR to the \`$shlibpath_var' environment variable"
 
2040
      echo "     during execution"
1841
2041
    fi
1842
2042
    if test -n "$runpath_var"; then
1843
 
      $ECHO "   - add LIBDIR to the \`$runpath_var' environment variable"
1844
 
      $ECHO "     during linking"
 
2043
      echo "   - add LIBDIR to the \`$runpath_var' environment variable"
 
2044
      echo "     during linking"
1845
2045
    fi
1846
2046
    if test -n "$hardcode_libdir_flag_spec"; then
1847
2047
      libdir=LIBDIR
1853
2053
      $ECHO "   - have your system administrator run these commands:$admincmds"
1854
2054
    fi
1855
2055
    if test -f /etc/ld.so.conf; then
1856
 
      $ECHO "   - have your system administrator add LIBDIR to \`/etc/ld.so.conf'"
 
2056
      echo "   - have your system administrator add LIBDIR to \`/etc/ld.so.conf'"
1857
2057
    fi
1858
 
    $ECHO
 
2058
    echo
1859
2059
 
1860
 
    $ECHO "See any operating system documentation about shared libraries for"
 
2060
    echo "See any operating system documentation about shared libraries for"
1861
2061
    case $host in
1862
2062
      solaris2.[6789]|solaris2.1[0-9])
1863
 
        $ECHO "more information, such as the ld(1), crle(1) and ld.so(8) manual"
1864
 
        $ECHO "pages."
 
2063
        echo "more information, such as the ld(1), crle(1) and ld.so(8) manual"
 
2064
        echo "pages."
1865
2065
        ;;
1866
2066
      *)
1867
 
        $ECHO "more information, such as the ld(1) and ld.so(8) manual pages."
 
2067
        echo "more information, such as the ld(1) and ld.so(8) manual pages."
1868
2068
        ;;
1869
2069
    esac
1870
 
    $ECHO "X----------------------------------------------------------------------" | $Xsed
 
2070
    echo "----------------------------------------------------------------------"
1871
2071
    exit $EXIT_SUCCESS
1872
2072
}
1873
2073
 
1882
2082
    # install_prog (especially on Windows NT).
1883
2083
    if test "$nonopt" = "$SHELL" || test "$nonopt" = /bin/sh ||
1884
2084
       # Allow the use of GNU shtool's install command.
1885
 
       $ECHO "X$nonopt" | $GREP shtool >/dev/null; then
 
2085
       case $nonopt in *shtool*) :;; *) false;; esac; then
1886
2086
      # Aesthetically quote it.
1887
2087
      func_quote_for_eval "$nonopt"
1888
2088
      install_prog="$func_quote_for_eval_result "
1897
2097
    # Aesthetically quote it.
1898
2098
    func_quote_for_eval "$arg"
1899
2099
    install_prog="$install_prog$func_quote_for_eval_result"
 
2100
    install_shared_prog=$install_prog
 
2101
    case " $install_prog " in
 
2102
      *[\\\ /]cp\ *) install_cp=: ;;
 
2103
      *) install_cp=false ;;
 
2104
    esac
1900
2105
 
1901
2106
    # We need to accept at least all the BSD install flags.
1902
2107
    dest=
1906
2111
    install_type=
1907
2112
    isdir=no
1908
2113
    stripme=
 
2114
    no_mode=:
1909
2115
    for arg
1910
2116
    do
 
2117
      arg2=
1911
2118
      if test -n "$dest"; then
1912
2119
        files="$files $dest"
1913
2120
        dest=$arg
1917
2124
      case $arg in
1918
2125
      -d) isdir=yes ;;
1919
2126
      -f)
1920
 
        case " $install_prog " in
1921
 
        *[\\\ /]cp\ *) ;;
1922
 
        *) prev=$arg ;;
1923
 
        esac
 
2127
        if $install_cp; then :; else
 
2128
          prev=$arg
 
2129
        fi
1924
2130
        ;;
1925
2131
      -g | -m | -o)
1926
2132
        prev=$arg
1934
2140
      *)
1935
2141
        # If the previous option needed an argument, then skip it.
1936
2142
        if test -n "$prev"; then
 
2143
          if test "x$prev" = x-m && test -n "$install_override_mode"; then
 
2144
            arg2=$install_override_mode
 
2145
            no_mode=false
 
2146
          fi
1937
2147
          prev=
1938
2148
        else
1939
2149
          dest=$arg
1945
2155
      # Aesthetically quote the argument.
1946
2156
      func_quote_for_eval "$arg"
1947
2157
      install_prog="$install_prog $func_quote_for_eval_result"
 
2158
      if test -n "$arg2"; then
 
2159
        func_quote_for_eval "$arg2"
 
2160
      fi
 
2161
      install_shared_prog="$install_shared_prog $func_quote_for_eval_result"
1948
2162
    done
1949
2163
 
1950
2164
    test -z "$install_prog" && \
1953
2167
    test -n "$prev" && \
1954
2168
      func_fatal_help "the \`$prev' option requires an argument"
1955
2169
 
 
2170
    if test -n "$install_override_mode" && $no_mode; then
 
2171
      if $install_cp; then :; else
 
2172
        func_quote_for_eval "$install_override_mode"
 
2173
        install_shared_prog="$install_shared_prog -m $func_quote_for_eval_result"
 
2174
      fi
 
2175
    fi
 
2176
 
1956
2177
    if test -z "$files"; then
1957
2178
      if test -z "$dest"; then
1958
2179
        func_fatal_help "no file or destination specified"
2040
2261
 
2041
2262
        if test -n "$relink_command"; then
2042
2263
          # Determine the prefix the user has applied to our future dir.
2043
 
          inst_prefix_dir=`$ECHO "X$destdir" | $Xsed -e "s%$libdir\$%%"`
 
2264
          inst_prefix_dir=`$ECHO "$destdir" | $SED -e "s%$libdir\$%%"`
2044
2265
 
2045
2266
          # Don't allow the user to place us outside of our expected
2046
2267
          # location b/c this prevents finding dependent libraries that
2053
2274
 
2054
2275
          if test -n "$inst_prefix_dir"; then
2055
2276
            # Stick the inst_prefix_dir data into the link command.
2056
 
            relink_command=`$ECHO "X$relink_command" | $Xsed -e "s%@inst_prefix_dir@%-inst-prefix-dir $inst_prefix_dir%"`
 
2277
            relink_command=`$ECHO "$relink_command" | $SED "s%@inst_prefix_dir@%-inst-prefix-dir $inst_prefix_dir%"`
2057
2278
          else
2058
 
            relink_command=`$ECHO "X$relink_command" | $Xsed -e "s%@inst_prefix_dir@%%"`
 
2279
            relink_command=`$ECHO "$relink_command" | $SED "s%@inst_prefix_dir@%%"`
2059
2280
          fi
2060
2281
 
2061
2282
          func_warning "relinking \`$file'"
2073
2294
          test -n "$relink_command" && srcname="$realname"T
2074
2295
 
2075
2296
          # Install the shared library and build the symlinks.
2076
 
          func_show_eval "$install_prog $dir/$srcname $destdir/$realname" \
 
2297
          func_show_eval "$install_shared_prog $dir/$srcname $destdir/$realname" \
2077
2298
              'exit $?'
2078
2299
          tstripme="$stripme"
2079
2300
          case $host_os in
2213
2434
            if test -f "$lib"; then
2214
2435
              func_source "$lib"
2215
2436
            fi
2216
 
            libfile="$libdir/"`$ECHO "X$lib" | $Xsed -e 's%^.*/%%g'` ### testsuite: skip nested quoting test
 
2437
            libfile="$libdir/"`$ECHO "$lib" | $SED 's%^.*/%%g'` ### testsuite: skip nested quoting test
2217
2438
            if test -n "$libdir" && test ! -f "$libfile"; then
2218
2439
              func_warning "\`$lib' has not been installed in \`$libdir'"
2219
2440
              finalize=no
2232
2453
                file="$func_basename_result"
2233
2454
                outputname="$tmpdir/$file"
2234
2455
                # Replace the output file specification.
2235
 
                relink_command=`$ECHO "X$relink_command" | $Xsed -e 's%@OUTPUT@%'"$outputname"'%g'`
 
2456
                relink_command=`$ECHO "$relink_command" | $SED 's%@OUTPUT@%'"$outputname"'%g'`
2236
2457
 
2237
2458
                $opt_silent || {
2238
2459
                  func_quote_for_expand "$relink_command"
2251
2472
            }
2252
2473
          else
2253
2474
            # Install the binary that we compiled earlier.
2254
 
            file=`$ECHO "X$file$stripped_ext" | $Xsed -e "s%\([^/]*\)$%$objdir/\1%"`
 
2475
            file=`$ECHO "$file$stripped_ext" | $SED "s%\([^/]*\)$%$objdir/\1%"`
2255
2476
          fi
2256
2477
        fi
2257
2478
 
2353
2574
extern \"C\" {
2354
2575
#endif
2355
2576
 
 
2577
#if defined(__GNUC__) && (((__GNUC__ == 4) && (__GNUC_MINOR__ >= 4)) || (__GNUC__ > 4))
 
2578
#pragma GCC diagnostic ignored \"-Wstrict-prototypes\"
 
2579
#endif
 
2580
 
2356
2581
/* External symbol declarations for the compiler. */\
2357
2582
"
2358
2583
 
2362
2587
          $opt_dry_run || echo ': @PROGRAM@ ' > "$nlist"
2363
2588
 
2364
2589
          # Add our own program objects to the symbol list.
2365
 
          progfiles=`$ECHO "X$objs$old_deplibs" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP`
 
2590
          progfiles=`$ECHO "$objs$old_deplibs" | $SP2NL | $SED "$lo2o" | $NL2SP`
2366
2591
          for progfile in $progfiles; do
2367
2592
            func_verbose "extracting global C symbols from \`$progfile'"
2368
2593
            $opt_dry_run || eval "$NM $progfile | $global_symbol_pipe >> '$nlist'"
2401
2626
              eval '$GREP -f "$output_objdir/$outputname.exp" < "$nlist" > "$nlist"T'
2402
2627
              eval '$MV "$nlist"T "$nlist"'
2403
2628
              case $host in
2404
 
                *cygwin | *mingw* | *cegcc* )
 
2629
                *cygwin* | *mingw* | *cegcc* )
2405
2630
                  eval "echo EXPORTS "'> "$output_objdir/$outputname.def"'
2406
2631
                  eval 'cat "$nlist" >> "$output_objdir/$outputname.def"'
2407
2632
                  ;;
2445
2670
          if test -f "$nlist"S; then
2446
2671
            eval "$global_symbol_to_cdecl"' < "$nlist"S >> "$output_objdir/$my_dlsyms"'
2447
2672
          else
2448
 
            $ECHO '/* NONE */' >> "$output_objdir/$my_dlsyms"
 
2673
            echo '/* NONE */' >> "$output_objdir/$my_dlsyms"
2449
2674
          fi
2450
2675
 
2451
 
          $ECHO >> "$output_objdir/$my_dlsyms" "\
 
2676
          echo >> "$output_objdir/$my_dlsyms" "\
2452
2677
 
2453
2678
/* The mapping between symbol names and symbols.  */
2454
2679
typedef struct {
2458
2683
"
2459
2684
          case $host in
2460
2685
          *cygwin* | *mingw* | *cegcc* )
2461
 
            $ECHO >> "$output_objdir/$my_dlsyms" "\
 
2686
            echo >> "$output_objdir/$my_dlsyms" "\
2462
2687
/* DATA imports from DLLs on WIN32 con't be const, because
2463
2688
   runtime relocations are performed -- see ld's documentation
2464
2689
   on pseudo-relocs.  */"
2471
2696
            lt_dlsym_const=const ;;
2472
2697
          esac
2473
2698
 
2474
 
          $ECHO >> "$output_objdir/$my_dlsyms" "\
 
2699
          echo >> "$output_objdir/$my_dlsyms" "\
2475
2700
extern $lt_dlsym_const lt_dlsymlist
2476
2701
lt_${my_prefix}_LTX_preloaded_symbols[];
2477
2702
$lt_dlsym_const lt_dlsymlist
2487
2712
            eval "$global_symbol_to_c_name_address_lib_prefix" < "$nlist" >> "$output_objdir/$my_dlsyms"
2488
2713
            ;;
2489
2714
          esac
2490
 
          $ECHO >> "$output_objdir/$my_dlsyms" "\
 
2715
          echo >> "$output_objdir/$my_dlsyms" "\
2491
2716
  {0, (void *) 0}
2492
2717
};
2493
2718
 
2545
2770
        case $host in
2546
2771
        *cygwin* | *mingw* | *cegcc* )
2547
2772
          if test -f "$output_objdir/$my_outputname.def"; then
2548
 
            compile_command=`$ECHO "X$compile_command" | $Xsed -e "s%@SYMFILE@%$output_objdir/$my_outputname.def $symfileobj%"`
2549
 
            finalize_command=`$ECHO "X$finalize_command" | $Xsed -e "s%@SYMFILE@%$output_objdir/$my_outputname.def $symfileobj%"`
 
2773
            compile_command=`$ECHO "$compile_command" | $SED "s%@SYMFILE@%$output_objdir/$my_outputname.def $symfileobj%"`
 
2774
            finalize_command=`$ECHO "$finalize_command" | $SED "s%@SYMFILE@%$output_objdir/$my_outputname.def $symfileobj%"`
2550
2775
          else
2551
 
            compile_command=`$ECHO "X$compile_command" | $Xsed -e "s%@SYMFILE@%$symfileobj%"`
2552
 
            finalize_command=`$ECHO "X$finalize_command" | $Xsed -e "s%@SYMFILE@%$symfileobj%"`
 
2776
            compile_command=`$ECHO "$compile_command" | $SED "s%@SYMFILE@%$symfileobj%"`
 
2777
            finalize_command=`$ECHO "$finalize_command" | $SED "s%@SYMFILE@%$symfileobj%"`
2553
2778
          fi
2554
2779
          ;;
2555
2780
        *)
2556
 
          compile_command=`$ECHO "X$compile_command" | $Xsed -e "s%@SYMFILE@%$symfileobj%"`
2557
 
          finalize_command=`$ECHO "X$finalize_command" | $Xsed -e "s%@SYMFILE@%$symfileobj%"`
 
2781
          compile_command=`$ECHO "$compile_command" | $SED "s%@SYMFILE@%$symfileobj%"`
 
2782
          finalize_command=`$ECHO "$finalize_command" | $SED "s%@SYMFILE@%$symfileobj%"`
2558
2783
          ;;
2559
2784
        esac
2560
2785
        ;;
2571
2796
      # really was required.
2572
2797
 
2573
2798
      # Nullify the symbol file.
2574
 
      compile_command=`$ECHO "X$compile_command" | $Xsed -e "s% @SYMFILE@%%"`
2575
 
      finalize_command=`$ECHO "X$finalize_command" | $Xsed -e "s% @SYMFILE@%%"`
 
2799
      compile_command=`$ECHO "$compile_command" | $SED "s% @SYMFILE@%%"`
 
2800
      finalize_command=`$ECHO "$finalize_command" | $SED "s% @SYMFILE@%%"`
2576
2801
    fi
2577
2802
}
2578
2803
 
2582
2807
# Need a lot of goo to handle *both* DLLs and import libs
2583
2808
# Has to be a shell function in order to 'eat' the argument
2584
2809
# that is supplied when $file_magic_command is called.
 
2810
# Despite the name, also deal with 64 bit binaries.
2585
2811
func_win32_libid ()
2586
2812
{
2587
2813
  $opt_debug
2592
2818
    win32_libid_type="x86 archive import"
2593
2819
    ;;
2594
2820
  *ar\ archive*) # could be an import, or static
 
2821
    # Keep the egrep pattern in sync with the one in _LT_CHECK_MAGIC_METHOD.
2595
2822
    if eval $OBJDUMP -f $1 | $SED -e '10q' 2>/dev/null |
2596
 
       $EGREP 'file format pe-i386(.*architecture: i386)?' >/dev/null ; then
 
2823
       $EGREP 'file format (pei*-i386(.*architecture: i386)?|pe-arm-wince|pe-x86-64)' >/dev/null; then
2597
2824
      win32_nmres=`eval $NM -f posix -A $1 |
2598
2825
        $SED -n -e '
2599
2826
            1,100{
2631
2858
    $opt_debug
2632
2859
    f_ex_an_ar_dir="$1"; shift
2633
2860
    f_ex_an_ar_oldlib="$1"
2634
 
    func_show_eval "(cd \$f_ex_an_ar_dir && $AR x \"\$f_ex_an_ar_oldlib\")" 'exit $?'
 
2861
    if test "$lock_old_archive_extraction" = yes; then
 
2862
      lockfile=$f_ex_an_ar_oldlib.lock
 
2863
      until $opt_dry_run || ln "$progpath" "$lockfile" 2>/dev/null; do
 
2864
        func_echo "Waiting for $lockfile to be removed"
 
2865
        sleep 2
 
2866
      done
 
2867
    fi
 
2868
    func_show_eval "(cd \$f_ex_an_ar_dir && $AR x \"\$f_ex_an_ar_oldlib\")" \
 
2869
                   'stat=$?; rm -f "$lockfile"; exit $stat'
 
2870
    if test "$lock_old_archive_extraction" = yes; then
 
2871
      $opt_dry_run || rm -f "$lockfile"
 
2872
    fi
2635
2873
    if ($AR t "$f_ex_an_ar_oldlib" | sort | sort -uc >/dev/null 2>&1); then
2636
2874
     :
2637
2875
    else
2702
2940
            darwin_file=
2703
2941
            darwin_files=
2704
2942
            for darwin_file in $darwin_filelist; do
2705
 
              darwin_files=`find unfat-$$ -name $darwin_file -print | $NL2SP`
 
2943
              darwin_files=`find unfat-$$ -name $darwin_file -print | sort | $NL2SP`
2706
2944
              $LIPO -create -output "$darwin_file" $darwin_files
2707
2945
            done # $darwin_filelist
2708
2946
            $RM -rf unfat-$$
2717
2955
        func_extract_an_archive "$my_xdir" "$my_xabs"
2718
2956
        ;;
2719
2957
      esac
2720
 
      my_oldobjs="$my_oldobjs "`find $my_xdir -name \*.$objext -print -o -name \*.lo -print | $NL2SP`
 
2958
      my_oldobjs="$my_oldobjs "`find $my_xdir -name \*.$objext -print -o -name \*.lo -print | sort | $NL2SP`
2721
2959
    done
2722
2960
 
2723
2961
    func_extract_archives_result="$my_oldobjs"
2724
2962
}
2725
2963
 
2726
2964
 
2727
 
 
2728
 
# func_emit_wrapper_part1 [arg=no]
2729
 
#
2730
 
# Emit the first part of a libtool wrapper script on stdout.
2731
 
# For more information, see the description associated with
2732
 
# func_emit_wrapper(), below.
2733
 
func_emit_wrapper_part1 ()
 
2965
# func_emit_wrapper [arg=no]
 
2966
#
 
2967
# Emit a libtool wrapper script on stdout.
 
2968
# Don't directly open a file because we may want to
 
2969
# incorporate the script contents within a cygwin/mingw
 
2970
# wrapper executable.  Must ONLY be called from within
 
2971
# func_mode_link because it depends on a number of variables
 
2972
# set therein.
 
2973
#
 
2974
# ARG is the value that the WRAPPER_SCRIPT_BELONGS_IN_OBJDIR
 
2975
# variable will take.  If 'yes', then the emitted script
 
2976
# will assume that the directory in which it is stored is
 
2977
# the $objdir directory.  This is a cygwin/mingw-specific
 
2978
# behavior.
 
2979
func_emit_wrapper ()
2734
2980
{
2735
 
        func_emit_wrapper_part1_arg1=no
2736
 
        if test -n "$1" ; then
2737
 
          func_emit_wrapper_part1_arg1=$1
2738
 
        fi
 
2981
        func_emit_wrapper_arg1=${1-no}
2739
2982
 
2740
2983
        $ECHO "\
2741
2984
#! $SHELL
2751
2994
 
2752
2995
# Sed substitution that helps us do robust quoting.  It backslashifies
2753
2996
# metacharacters that are still active within double-quoted strings.
2754
 
Xsed='${SED} -e 1s/^X//'
2755
2997
sed_quote_subst='$sed_quote_subst'
2756
2998
 
2757
2999
# Be Bourne compatible
2782
3024
else
2783
3025
  # When we are sourced in execute mode, \$file and \$ECHO are already set.
2784
3026
  if test \"\$libtool_execute_magic\" != \"$magic\"; then
2785
 
    ECHO=\"$qecho\"
2786
 
    file=\"\$0\"
2787
 
    # Make sure echo works.
2788
 
    if test \"X\$1\" = X--no-reexec; then
2789
 
      # Discard the --no-reexec flag, and continue.
2790
 
      shift
2791
 
    elif test \"X\`{ \$ECHO '\t'; } 2>/dev/null\`\" = 'X\t'; then
2792
 
      # Yippee, \$ECHO works!
2793
 
      :
2794
 
    else
2795
 
      # Restart under the correct shell, and then maybe \$ECHO will work.
2796
 
      exec $SHELL \"\$0\" --no-reexec \${1+\"\$@\"}
2797
 
    fi
2798
 
  fi\
2799
 
"
2800
 
        $ECHO "\
 
3027
    file=\"\$0\""
 
3028
 
 
3029
    qECHO=`$ECHO "$ECHO" | $SED "$sed_quote_subst"`
 
3030
    $ECHO "\
 
3031
 
 
3032
# A function that is used when there is no print builtin or printf.
 
3033
func_fallback_echo ()
 
3034
{
 
3035
  eval 'cat <<_LTECHO_EOF
 
3036
\$1
 
3037
_LTECHO_EOF'
 
3038
}
 
3039
    ECHO=\"$qECHO\"
 
3040
  fi
 
3041
 
 
3042
# Very basic option parsing. These options are (a) specific to
 
3043
# the libtool wrapper, (b) are identical between the wrapper
 
3044
# /script/ and the wrapper /executable/ which is used only on
 
3045
# windows platforms, and (c) all begin with the string "--lt-"
 
3046
# (application programs are unlikely to have options which match
 
3047
# this pattern).
 
3048
#
 
3049
# There are only two supported options: --lt-debug and
 
3050
# --lt-dump-script. There is, deliberately, no --lt-help.
 
3051
#
 
3052
# The first argument to this parsing function should be the
 
3053
# script's $0 value, followed by "$@".
 
3054
lt_option_debug=
 
3055
func_parse_lt_options ()
 
3056
{
 
3057
  lt_script_arg0=\$0
 
3058
  shift
 
3059
  for lt_opt
 
3060
  do
 
3061
    case \"\$lt_opt\" in
 
3062
    --lt-debug) lt_option_debug=1 ;;
 
3063
    --lt-dump-script)
 
3064
        lt_dump_D=\`\$ECHO \"X\$lt_script_arg0\" | $SED -e 's/^X//' -e 's%/[^/]*$%%'\`
 
3065
        test \"X\$lt_dump_D\" = \"X\$lt_script_arg0\" && lt_dump_D=.
 
3066
        lt_dump_F=\`\$ECHO \"X\$lt_script_arg0\" | $SED -e 's/^X//' -e 's%^.*/%%'\`
 
3067
        cat \"\$lt_dump_D/\$lt_dump_F\"
 
3068
        exit 0
 
3069
      ;;
 
3070
    --lt-*)
 
3071
        \$ECHO \"Unrecognized --lt- option: '\$lt_opt'\" 1>&2
 
3072
        exit 1
 
3073
      ;;
 
3074
    esac
 
3075
  done
 
3076
 
 
3077
  # Print the debug banner immediately:
 
3078
  if test -n \"\$lt_option_debug\"; then
 
3079
    echo \"${outputname}:${output}:\${LINENO}: libtool wrapper (GNU $PACKAGE$TIMESTAMP) $VERSION\" 1>&2
 
3080
  fi
 
3081
}
 
3082
 
 
3083
# Used when --lt-debug. Prints its arguments to stdout
 
3084
# (redirection is the responsibility of the caller)
 
3085
func_lt_dump_args ()
 
3086
{
 
3087
  lt_dump_args_N=1;
 
3088
  for lt_arg
 
3089
  do
 
3090
    \$ECHO \"${outputname}:${output}:\${LINENO}: newargv[\$lt_dump_args_N]: \$lt_arg\"
 
3091
    lt_dump_args_N=\`expr \$lt_dump_args_N + 1\`
 
3092
  done
 
3093
}
 
3094
 
 
3095
# Core function for launching the target application
 
3096
func_exec_program_core ()
 
3097
{
 
3098
"
 
3099
  case $host in
 
3100
  # Backslashes separate directories on plain windows
 
3101
  *-*-mingw | *-*-os2* | *-cegcc*)
 
3102
    $ECHO "\
 
3103
      if test -n \"\$lt_option_debug\"; then
 
3104
        \$ECHO \"${outputname}:${output}:\${LINENO}: newargv[0]: \$progdir\\\\\$program\" 1>&2
 
3105
        func_lt_dump_args \${1+\"\$@\"} 1>&2
 
3106
      fi
 
3107
      exec \"\$progdir\\\\\$program\" \${1+\"\$@\"}
 
3108
"
 
3109
    ;;
 
3110
 
 
3111
  *)
 
3112
    $ECHO "\
 
3113
      if test -n \"\$lt_option_debug\"; then
 
3114
        \$ECHO \"${outputname}:${output}:\${LINENO}: newargv[0]: \$progdir/\$program\" 1>&2
 
3115
        func_lt_dump_args \${1+\"\$@\"} 1>&2
 
3116
      fi
 
3117
      exec \"\$progdir/\$program\" \${1+\"\$@\"}
 
3118
"
 
3119
    ;;
 
3120
  esac
 
3121
  $ECHO "\
 
3122
      \$ECHO \"\$0: cannot exec \$program \$*\" 1>&2
 
3123
      exit 1
 
3124
}
 
3125
 
 
3126
# A function to encapsulate launching the target application
 
3127
# Strips options in the --lt-* namespace from \$@ and
 
3128
# launches target application with the remaining arguments.
 
3129
func_exec_program ()
 
3130
{
 
3131
  for lt_wr_arg
 
3132
  do
 
3133
    case \$lt_wr_arg in
 
3134
    --lt-*) ;;
 
3135
    *) set x \"\$@\" \"\$lt_wr_arg\"; shift;;
 
3136
    esac
 
3137
    shift
 
3138
  done
 
3139
  func_exec_program_core \${1+\"\$@\"}
 
3140
}
 
3141
 
 
3142
  # Parse options
 
3143
  func_parse_lt_options \"\$0\" \${1+\"\$@\"}
2801
3144
 
2802
3145
  # Find the directory that this script lives in.
2803
 
  thisdir=\`\$ECHO \"X\$file\" | \$Xsed -e 's%/[^/]*$%%'\`
 
3146
  thisdir=\`\$ECHO \"\$file\" | $SED 's%/[^/]*$%%'\`
2804
3147
  test \"x\$thisdir\" = \"x\$file\" && thisdir=.
2805
3148
 
2806
3149
  # Follow symbolic links until we get to the real thisdir.
2807
 
  file=\`ls -ld \"\$file\" | ${SED} -n 's/.*-> //p'\`
 
3150
  file=\`ls -ld \"\$file\" | $SED -n 's/.*-> //p'\`
2808
3151
  while test -n \"\$file\"; do
2809
 
    destdir=\`\$ECHO \"X\$file\" | \$Xsed -e 's%/[^/]*\$%%'\`
 
3152
    destdir=\`\$ECHO \"\$file\" | $SED 's%/[^/]*\$%%'\`
2810
3153
 
2811
3154
    # If there was a directory component, then change thisdir.
2812
3155
    if test \"x\$destdir\" != \"x\$file\"; then
2816
3159
      esac
2817
3160
    fi
2818
3161
 
2819
 
    file=\`\$ECHO \"X\$file\" | \$Xsed -e 's%^.*/%%'\`
2820
 
    file=\`ls -ld \"\$thisdir/\$file\" | ${SED} -n 's/.*-> //p'\`
 
3162
    file=\`\$ECHO \"\$file\" | $SED 's%^.*/%%'\`
 
3163
    file=\`ls -ld \"\$thisdir/\$file\" | $SED -n 's/.*-> //p'\`
2821
3164
  done
2822
 
"
2823
 
}
2824
 
# end: func_emit_wrapper_part1
2825
 
 
2826
 
# func_emit_wrapper_part2 [arg=no]
2827
 
#
2828
 
# Emit the second part of a libtool wrapper script on stdout.
2829
 
# For more information, see the description associated with
2830
 
# func_emit_wrapper(), below.
2831
 
func_emit_wrapper_part2 ()
2832
 
{
2833
 
        func_emit_wrapper_part2_arg1=no
2834
 
        if test -n "$1" ; then
2835
 
          func_emit_wrapper_part2_arg1=$1
2836
 
        fi
2837
 
 
2838
 
        $ECHO "\
2839
3165
 
2840
3166
  # Usually 'no', except on cygwin/mingw when embedded into
2841
3167
  # the cwrapper.
2842
 
  WRAPPER_SCRIPT_BELONGS_IN_OBJDIR=$func_emit_wrapper_part2_arg1
 
3168
  WRAPPER_SCRIPT_BELONGS_IN_OBJDIR=$func_emit_wrapper_arg1
2843
3169
  if test \"\$WRAPPER_SCRIPT_BELONGS_IN_OBJDIR\" = \"yes\"; then
2844
3170
    # special case for '.'
2845
3171
    if test \"\$thisdir\" = \".\"; then
2847
3173
    fi
2848
3174
    # remove .libs from thisdir
2849
3175
    case \"\$thisdir\" in
2850
 
    *[\\\\/]$objdir ) thisdir=\`\$ECHO \"X\$thisdir\" | \$Xsed -e 's%[\\\\/][^\\\\/]*$%%'\` ;;
 
3176
    *[\\\\/]$objdir ) thisdir=\`\$ECHO \"\$thisdir\" | $SED 's%[\\\\/][^\\\\/]*$%%'\` ;;
2851
3177
    $objdir )   thisdir=. ;;
2852
3178
    esac
2853
3179
  fi
2910
3236
 
2911
3237
    # Some systems cannot cope with colon-terminated $shlibpath_var
2912
3238
    # The second colon is a workaround for a bug in BeOS R4 sed
2913
 
    $shlibpath_var=\`\$ECHO \"X\$$shlibpath_var\" | \$Xsed -e 's/::*\$//'\`
 
3239
    $shlibpath_var=\`\$ECHO \"\$$shlibpath_var\" | $SED 's/::*\$//'\`
2914
3240
 
2915
3241
    export $shlibpath_var
2916
3242
"
2927
3253
        $ECHO "\
2928
3254
    if test \"\$libtool_execute_magic\" != \"$magic\"; then
2929
3255
      # Run the actual program with our arguments.
2930
 
"
2931
 
        case $host in
2932
 
        # Backslashes separate directories on plain windows
2933
 
        *-*-mingw | *-*-os2* | *-cegcc*)
2934
 
          $ECHO "\
2935
 
      exec \"\$progdir\\\\\$program\" \${1+\"\$@\"}
2936
 
"
2937
 
          ;;
2938
 
 
2939
 
        *)
2940
 
          $ECHO "\
2941
 
      exec \"\$progdir/\$program\" \${1+\"\$@\"}
2942
 
"
2943
 
          ;;
2944
 
        esac
2945
 
        $ECHO "\
2946
 
      \$ECHO \"\$0: cannot exec \$program \$*\" 1>&2
2947
 
      exit 1
 
3256
      func_exec_program \${1+\"\$@\"}
2948
3257
    fi
2949
3258
  else
2950
3259
    # The program doesn't exist.
2951
3260
    \$ECHO \"\$0: error: \\\`\$progdir/\$program' does not exist\" 1>&2
2952
3261
    \$ECHO \"This script is just a wrapper for \$program.\" 1>&2
2953
 
    $ECHO \"See the $PACKAGE documentation for more information.\" 1>&2
 
3262
    \$ECHO \"See the $PACKAGE documentation for more information.\" 1>&2
2954
3263
    exit 1
2955
3264
  fi
2956
3265
fi\
2957
3266
"
2958
3267
}
2959
 
# end: func_emit_wrapper_part2
2960
 
 
2961
 
 
2962
 
# func_emit_wrapper [arg=no]
2963
 
#
2964
 
# Emit a libtool wrapper script on stdout.
2965
 
# Don't directly open a file because we may want to
2966
 
# incorporate the script contents within a cygwin/mingw
2967
 
# wrapper executable.  Must ONLY be called from within
2968
 
# func_mode_link because it depends on a number of variables
2969
 
# set therein.
2970
 
#
2971
 
# ARG is the value that the WRAPPER_SCRIPT_BELONGS_IN_OBJDIR
2972
 
# variable will take.  If 'yes', then the emitted script
2973
 
# will assume that the directory in which it is stored is
2974
 
# the $objdir directory.  This is a cygwin/mingw-specific
2975
 
# behavior.
2976
 
func_emit_wrapper ()
2977
 
{
2978
 
        func_emit_wrapper_arg1=no
2979
 
        if test -n "$1" ; then
2980
 
          func_emit_wrapper_arg1=$1
2981
 
        fi
2982
 
 
2983
 
        # split this up so that func_emit_cwrapperexe_src
2984
 
        # can call each part independently.
2985
 
        func_emit_wrapper_part1 "${func_emit_wrapper_arg1}"
2986
 
        func_emit_wrapper_part2 "${func_emit_wrapper_arg1}"
2987
 
}
2988
3268
 
2989
3269
 
2990
3270
# func_to_host_path arg
3011
3291
func_to_host_path ()
3012
3292
{
3013
3293
  func_to_host_path_result="$1"
3014
 
  if test -n "$1" ; then
 
3294
  if test -n "$1"; then
3015
3295
    case $host in
3016
3296
      *mingw* )
3017
3297
        lt_sed_naive_backslashify='s|\\\\*|\\|g;s|/|\\|g;s|\\|\\\\|g'
3018
3298
        case $build in
3019
3299
          *mingw* ) # actually, msys
3020
3300
            # awkward: cmd appends spaces to result
3021
 
            lt_sed_strip_trailing_spaces="s/[ ]*\$//"
3022
 
            func_to_host_path_tmp1=`( cmd //c echo "$1" |\
3023
 
              $SED -e "$lt_sed_strip_trailing_spaces" ) 2>/dev/null || echo ""`
3024
 
            func_to_host_path_result=`echo "$func_to_host_path_tmp1" |\
3025
 
              $SED -e "$lt_sed_naive_backslashify"`
 
3301
            func_to_host_path_result=`( cmd //c echo "$1" ) 2>/dev/null |
 
3302
              $SED -e 's/[ ]*$//' -e "$lt_sed_naive_backslashify"`
3026
3303
            ;;
3027
3304
          *cygwin* )
3028
 
            func_to_host_path_tmp1=`cygpath -w "$1"`
3029
 
            func_to_host_path_result=`echo "$func_to_host_path_tmp1" |\
3030
 
              $SED -e "$lt_sed_naive_backslashify"`
 
3305
            func_to_host_path_result=`cygpath -w "$1" |
 
3306
              $SED -e "$lt_sed_naive_backslashify"`
3031
3307
            ;;
3032
3308
          * )
3033
3309
            # Unfortunately, winepath does not exit with a non-zero
3039
3315
            # the odd construction:
3040
3316
            func_to_host_path_tmp1=`winepath -w "$1" 2>/dev/null`
3041
3317
            if test "$?" -eq 0 && test -n "${func_to_host_path_tmp1}"; then
3042
 
              func_to_host_path_result=`echo "$func_to_host_path_tmp1" |\
 
3318
              func_to_host_path_result=`$ECHO "$func_to_host_path_tmp1" |
3043
3319
                $SED -e "$lt_sed_naive_backslashify"`
3044
3320
            else
3045
3321
              # Allow warning below.
3046
 
              func_to_host_path_result=""
 
3322
              func_to_host_path_result=
3047
3323
            fi
3048
3324
            ;;
3049
3325
        esac
3050
3326
        if test -z "$func_to_host_path_result" ; then
3051
3327
          func_error "Could not determine host path corresponding to"
3052
 
          func_error "  '$1'"
 
3328
          func_error "  \`$1'"
3053
3329
          func_error "Continuing, but uninstalled executables may not work."
3054
3330
          # Fallback:
3055
3331
          func_to_host_path_result="$1"
3082
3358
func_to_host_pathlist ()
3083
3359
{
3084
3360
  func_to_host_pathlist_result="$1"
3085
 
  if test -n "$1" ; then
 
3361
  if test -n "$1"; then
3086
3362
    case $host in
3087
3363
      *mingw* )
3088
3364
        lt_sed_naive_backslashify='s|\\\\*|\\|g;s|/|\\|g;s|\\|\\\\|g'
3089
3365
        # Remove leading and trailing path separator characters from
3090
3366
        # ARG. msys behavior is inconsistent here, cygpath turns them
3091
3367
        # into '.;' and ';.', and winepath ignores them completely.
3092
 
        func_to_host_pathlist_tmp2="$1"
3093
 
        # Once set for this call, this variable should not be
3094
 
        # reassigned. It is used in tha fallback case.
3095
 
        func_to_host_pathlist_tmp1=`echo "$func_to_host_pathlist_tmp2" |\
3096
 
          $SED -e 's|^:*||' -e 's|:*$||'`
 
3368
        func_stripname : : "$1"
 
3369
        func_to_host_pathlist_tmp1=$func_stripname_result
3097
3370
        case $build in
3098
3371
          *mingw* ) # Actually, msys.
3099
3372
            # Awkward: cmd appends spaces to result.
3100
 
            lt_sed_strip_trailing_spaces="s/[ ]*\$//"
3101
 
            func_to_host_pathlist_tmp2=`( cmd //c echo "$func_to_host_pathlist_tmp1" |\
3102
 
              $SED -e "$lt_sed_strip_trailing_spaces" ) 2>/dev/null || echo ""`
3103
 
            func_to_host_pathlist_result=`echo "$func_to_host_pathlist_tmp2" |\
3104
 
              $SED -e "$lt_sed_naive_backslashify"`
 
3373
            func_to_host_pathlist_result=`
 
3374
              ( cmd //c echo "$func_to_host_pathlist_tmp1" ) 2>/dev/null |
 
3375
              $SED -e 's/[ ]*$//' -e "$lt_sed_naive_backslashify"`
3105
3376
            ;;
3106
3377
          *cygwin* )
3107
 
            func_to_host_pathlist_tmp2=`cygpath -w -p "$func_to_host_pathlist_tmp1"`
3108
 
            func_to_host_pathlist_result=`echo "$func_to_host_pathlist_tmp2" |\
 
3378
            func_to_host_pathlist_result=`cygpath -w -p "$func_to_host_pathlist_tmp1" |
3109
3379
              $SED -e "$lt_sed_naive_backslashify"`
3110
3380
            ;;
3111
3381
          * )
3121
3391
                  if test -z "$func_to_host_pathlist_result" ; then
3122
3392
                    func_to_host_pathlist_result="$func_to_host_path_result"
3123
3393
                  else
3124
 
                    func_to_host_pathlist_result="$func_to_host_pathlist_result;$func_to_host_path_result"
 
3394
                    func_append func_to_host_pathlist_result ";$func_to_host_path_result"
3125
3395
                  fi
3126
3396
                fi
3127
3397
              fi
3128
 
              IFS=:
3129
3398
            done
3130
3399
            IFS=$func_to_host_pathlist_oldIFS
3131
3400
            ;;
3132
3401
        esac
3133
 
        if test -z "$func_to_host_pathlist_result" ; then
 
3402
        if test -z "$func_to_host_pathlist_result"; then
3134
3403
          func_error "Could not determine the host path(s) corresponding to"
3135
 
          func_error "  '$1'"
 
3404
          func_error "  \`$1'"
3136
3405
          func_error "Continuing, but uninstalled executables may not work."
3137
3406
          # Fallback. This may break if $1 contains DOS-style drive
3138
3407
          # specifications. The fix is not to complicate the expression
3149
3418
            ;;
3150
3419
        esac
3151
3420
        case "$1" in
3152
 
          *: ) func_to_host_pathlist_result="$func_to_host_pathlist_result;"
 
3421
          *: ) func_append func_to_host_pathlist_result ";"
3153
3422
            ;;
3154
3423
        esac
3155
3424
        ;;
3174
3443
 
3175
3444
   This wrapper executable should never be moved out of the build directory.
3176
3445
   If it is, it will not operate correctly.
3177
 
 
3178
 
   Currently, it simply execs the wrapper *script* "$SHELL $output",
3179
 
   but could eventually absorb all of the scripts functionality and
3180
 
   exec $objdir/$outputname directly.
3181
3446
*/
3182
3447
EOF
3183
3448
            cat <<"EOF"
 
3449
#ifdef _MSC_VER
 
3450
# define _CRT_SECURE_NO_DEPRECATE 1
 
3451
#endif
3184
3452
#include <stdio.h>
3185
3453
#include <stdlib.h>
3186
3454
#ifdef _MSC_VER
3187
3455
# include <direct.h>
3188
3456
# include <process.h>
3189
3457
# include <io.h>
3190
 
# define setmode _setmode
3191
3458
#else
3192
3459
# include <unistd.h>
3193
3460
# include <stdint.h>
3194
3461
# ifdef __CYGWIN__
3195
3462
#  include <io.h>
3196
 
#  define HAVE_SETENV
3197
 
#  ifdef __STRICT_ANSI__
3198
 
char *realpath (const char *, char *);
3199
 
int putenv (char *);
3200
 
int setenv (const char *, const char *, int);
3201
 
#  endif
3202
3463
# endif
3203
3464
#endif
3204
3465
#include <malloc.h>
3210
3471
#include <fcntl.h>
3211
3472
#include <sys/stat.h>
3212
3473
 
 
3474
/* declarations of non-ANSI functions */
 
3475
#if defined(__MINGW32__)
 
3476
# ifdef __STRICT_ANSI__
 
3477
int _putenv (const char *);
 
3478
# endif
 
3479
#elif defined(__CYGWIN__)
 
3480
# ifdef __STRICT_ANSI__
 
3481
char *realpath (const char *, char *);
 
3482
int putenv (char *);
 
3483
int setenv (const char *, const char *, int);
 
3484
# endif
 
3485
/* #elif defined (other platforms) ... */
 
3486
#endif
 
3487
 
 
3488
/* portability defines, excluding path handling macros */
 
3489
#if defined(_MSC_VER)
 
3490
# define setmode _setmode
 
3491
# define stat    _stat
 
3492
# define chmod   _chmod
 
3493
# define getcwd  _getcwd
 
3494
# define putenv  _putenv
 
3495
# define S_IXUSR _S_IEXEC
 
3496
# ifndef _INTPTR_T_DEFINED
 
3497
#  define _INTPTR_T_DEFINED
 
3498
#  define intptr_t int
 
3499
# endif
 
3500
#elif defined(__MINGW32__)
 
3501
# define setmode _setmode
 
3502
# define stat    _stat
 
3503
# define chmod   _chmod
 
3504
# define getcwd  _getcwd
 
3505
# define putenv  _putenv
 
3506
#elif defined(__CYGWIN__)
 
3507
# define HAVE_SETENV
 
3508
# define FOPEN_WB "wb"
 
3509
/* #elif defined (other platforms) ... */
 
3510
#endif
 
3511
 
3213
3512
#if defined(PATH_MAX)
3214
3513
# define LT_PATHMAX PATH_MAX
3215
3514
#elif defined(MAXPATHLEN)
3225
3524
# define S_IXGRP 0
3226
3525
#endif
3227
3526
 
3228
 
#ifdef _MSC_VER
3229
 
# define S_IXUSR _S_IEXEC
3230
 
# define stat _stat
3231
 
# ifndef _INTPTR_T_DEFINED
3232
 
#  define intptr_t int
3233
 
# endif
3234
 
#endif
3235
 
 
 
3527
/* path handling portability macros */
3236
3528
#ifndef DIR_SEPARATOR
3237
3529
# define DIR_SEPARATOR '/'
3238
3530
# define PATH_SEPARATOR ':'
3263
3555
# define IS_PATH_SEPARATOR(ch) ((ch) == PATH_SEPARATOR_2)
3264
3556
#endif /* PATH_SEPARATOR_2 */
3265
3557
 
3266
 
#ifdef __CYGWIN__
3267
 
# define FOPEN_WB "wb"
3268
 
#endif
3269
 
 
3270
3558
#ifndef FOPEN_WB
3271
3559
# define FOPEN_WB "w"
3272
3560
#endif
3279
3567
  if (stale) { free ((void *) stale); stale = 0; } \
3280
3568
} while (0)
3281
3569
 
3282
 
#undef LTWRAPPER_DEBUGPRINTF
3283
 
#if defined DEBUGWRAPPER
3284
 
# define LTWRAPPER_DEBUGPRINTF(args) ltwrapper_debugprintf args
3285
 
static void
3286
 
ltwrapper_debugprintf (const char *fmt, ...)
3287
 
{
3288
 
    va_list args;
3289
 
    va_start (args, fmt);
3290
 
    (void) vfprintf (stderr, fmt, args);
3291
 
    va_end (args);
3292
 
}
 
3570
#if defined(LT_DEBUGWRAPPER)
 
3571
static int lt_debug = 1;
3293
3572
#else
3294
 
# define LTWRAPPER_DEBUGPRINTF(args)
 
3573
static int lt_debug = 0;
3295
3574
#endif
3296
3575
 
3297
 
const char *program_name = NULL;
 
3576
const char *program_name = "libtool-wrapper"; /* in case xstrdup fails */
3298
3577
 
3299
3578
void *xmalloc (size_t num);
3300
3579
char *xstrdup (const char *string);
3304
3583
int make_executable (const char *path);
3305
3584
int check_executable (const char *path);
3306
3585
char *strendzap (char *str, const char *pat);
3307
 
void lt_fatal (const char *message, ...);
 
3586
void lt_debugprintf (const char *file, int line, const char *fmt, ...);
 
3587
void lt_fatal (const char *file, int line, const char *message, ...);
 
3588
static const char *nonnull (const char *s);
 
3589
static const char *nonempty (const char *s);
3308
3590
void lt_setenv (const char *name, const char *value);
3309
3591
char *lt_extend_str (const char *orig_value, const char *add, int to_end);
3310
 
void lt_opt_process_env_set (const char *arg);
3311
 
void lt_opt_process_env_prepend (const char *arg);
3312
 
void lt_opt_process_env_append (const char *arg);
3313
 
int lt_split_name_value (const char *arg, char** name, char** value);
3314
3592
void lt_update_exe_path (const char *name, const char *value);
3315
3593
void lt_update_lib_path (const char *name, const char *value);
3316
 
 
3317
 
static const char *script_text_part1 =
3318
 
EOF
3319
 
 
3320
 
            func_emit_wrapper_part1 yes |
3321
 
                $SED -e 's/\([\\"]\)/\\\1/g' \
3322
 
                     -e 's/^/  "/' -e 's/$/\\n"/'
3323
 
            echo ";"
3324
 
            cat <<EOF
3325
 
 
3326
 
static const char *script_text_part2 =
3327
 
EOF
3328
 
            func_emit_wrapper_part2 yes |
3329
 
                $SED -e 's/\([\\"]\)/\\\1/g' \
3330
 
                     -e 's/^/  "/' -e 's/$/\\n"/'
3331
 
            echo ";"
 
3594
char **prepare_spawn (char **argv);
 
3595
void lt_dump_script (FILE *f);
 
3596
EOF
3332
3597
 
3333
3598
            cat <<EOF
3334
3599
const char * MAGIC_EXE = "$magic_exe";
3373
3638
            cat <<"EOF"
3374
3639
 
3375
3640
#define LTWRAPPER_OPTION_PREFIX         "--lt-"
3376
 
#define LTWRAPPER_OPTION_PREFIX_LENGTH  5
3377
3641
 
3378
 
static const size_t opt_prefix_len         = LTWRAPPER_OPTION_PREFIX_LENGTH;
3379
3642
static const char *ltwrapper_option_prefix = LTWRAPPER_OPTION_PREFIX;
3380
 
 
3381
3643
static const char *dumpscript_opt       = LTWRAPPER_OPTION_PREFIX "dump-script";
3382
 
 
3383
 
static const size_t env_set_opt_len     = LTWRAPPER_OPTION_PREFIX_LENGTH + 7;
3384
 
static const char *env_set_opt          = LTWRAPPER_OPTION_PREFIX "env-set";
3385
 
  /* argument is putenv-style "foo=bar", value of foo is set to bar */
3386
 
 
3387
 
static const size_t env_prepend_opt_len = LTWRAPPER_OPTION_PREFIX_LENGTH + 11;
3388
 
static const char *env_prepend_opt      = LTWRAPPER_OPTION_PREFIX "env-prepend";
3389
 
  /* argument is putenv-style "foo=bar", new value of foo is bar${foo} */
3390
 
 
3391
 
static const size_t env_append_opt_len  = LTWRAPPER_OPTION_PREFIX_LENGTH + 10;
3392
 
static const char *env_append_opt       = LTWRAPPER_OPTION_PREFIX "env-append";
3393
 
  /* argument is putenv-style "foo=bar", new value of foo is ${foo}bar */
 
3644
static const char *debug_opt            = LTWRAPPER_OPTION_PREFIX "debug";
3394
3645
 
3395
3646
int
3396
3647
main (int argc, char *argv[])
3407
3658
  int i;
3408
3659
 
3409
3660
  program_name = (char *) xstrdup (base_name (argv[0]));
3410
 
  LTWRAPPER_DEBUGPRINTF (("(main) argv[0]      : %s\n", argv[0]));
3411
 
  LTWRAPPER_DEBUGPRINTF (("(main) program_name : %s\n", program_name));
 
3661
  newargz = XMALLOC (char *, argc + 1);
3412
3662
 
3413
 
  /* very simple arg parsing; don't want to rely on getopt */
 
3663
  /* very simple arg parsing; don't want to rely on getopt
 
3664
   * also, copy all non cwrapper options to newargz, except
 
3665
   * argz[0], which is handled differently
 
3666
   */
 
3667
  newargc=0;
3414
3668
  for (i = 1; i < argc; i++)
3415
3669
    {
3416
3670
      if (strcmp (argv[i], dumpscript_opt) == 0)
3424
3678
              esac
3425
3679
 
3426
3680
            cat <<"EOF"
3427
 
          printf ("%s", script_text_part1);
3428
 
          printf ("%s", script_text_part2);
 
3681
          lt_dump_script (stdout);
3429
3682
          return 0;
3430
3683
        }
 
3684
      if (strcmp (argv[i], debug_opt) == 0)
 
3685
        {
 
3686
          lt_debug = 1;
 
3687
          continue;
 
3688
        }
 
3689
      if (strcmp (argv[i], ltwrapper_option_prefix) == 0)
 
3690
        {
 
3691
          /* however, if there is an option in the LTWRAPPER_OPTION_PREFIX
 
3692
             namespace, but it is not one of the ones we know about and
 
3693
             have already dealt with, above (inluding dump-script), then
 
3694
             report an error. Otherwise, targets might begin to believe
 
3695
             they are allowed to use options in the LTWRAPPER_OPTION_PREFIX
 
3696
             namespace. The first time any user complains about this, we'll
 
3697
             need to make LTWRAPPER_OPTION_PREFIX a configure-time option
 
3698
             or a configure.ac-settable value.
 
3699
           */
 
3700
          lt_fatal (__FILE__, __LINE__,
 
3701
                    "unrecognized %s option: '%s'",
 
3702
                    ltwrapper_option_prefix, argv[i]);
 
3703
        }
 
3704
      /* otherwise ... */
 
3705
      newargz[++newargc] = xstrdup (argv[i]);
3431
3706
    }
3432
 
 
3433
 
  newargz = XMALLOC (char *, argc + 1);
 
3707
  newargz[++newargc] = NULL;
 
3708
 
 
3709
EOF
 
3710
            cat <<EOF
 
3711
  /* The GNU banner must be the first non-error debug message */
 
3712
  lt_debugprintf (__FILE__, __LINE__, "libtool wrapper (GNU $PACKAGE$TIMESTAMP) $VERSION\n");
 
3713
EOF
 
3714
            cat <<"EOF"
 
3715
  lt_debugprintf (__FILE__, __LINE__, "(main) argv[0]: %s\n", argv[0]);
 
3716
  lt_debugprintf (__FILE__, __LINE__, "(main) program_name: %s\n", program_name);
 
3717
 
3434
3718
  tmp_pathspec = find_executable (argv[0]);
3435
3719
  if (tmp_pathspec == NULL)
3436
 
    lt_fatal ("Couldn't find %s", argv[0]);
3437
 
  LTWRAPPER_DEBUGPRINTF (("(main) found exe (before symlink chase) at : %s\n",
3438
 
                          tmp_pathspec));
 
3720
    lt_fatal (__FILE__, __LINE__, "couldn't find %s", argv[0]);
 
3721
  lt_debugprintf (__FILE__, __LINE__,
 
3722
                  "(main) found exe (before symlink chase) at: %s\n",
 
3723
                  tmp_pathspec);
3439
3724
 
3440
3725
  actual_cwrapper_path = chase_symlinks (tmp_pathspec);
3441
 
  LTWRAPPER_DEBUGPRINTF (("(main) found exe (after symlink chase) at : %s\n",
3442
 
                          actual_cwrapper_path));
 
3726
  lt_debugprintf (__FILE__, __LINE__,
 
3727
                  "(main) found exe (after symlink chase) at: %s\n",
 
3728
                  actual_cwrapper_path);
3443
3729
  XFREE (tmp_pathspec);
3444
3730
 
3445
 
  actual_cwrapper_name = xstrdup( base_name (actual_cwrapper_path));
 
3731
  actual_cwrapper_name = xstrdup (base_name (actual_cwrapper_path));
3446
3732
  strendzap (actual_cwrapper_path, actual_cwrapper_name);
3447
3733
 
3448
3734
  /* wrapper name transforms */
3460
3746
  target_name = tmp_pathspec;
3461
3747
  tmp_pathspec = 0;
3462
3748
 
3463
 
  LTWRAPPER_DEBUGPRINTF (("(main) libtool target name: %s\n",
3464
 
                          target_name));
 
3749
  lt_debugprintf (__FILE__, __LINE__,
 
3750
                  "(main) libtool target name: %s\n",
 
3751
                  target_name);
3465
3752
EOF
3466
3753
 
3467
3754
            cat <<EOF
3514
3801
  lt_update_lib_path (LIB_PATH_VARNAME, LIB_PATH_VALUE);
3515
3802
  lt_update_exe_path (EXE_PATH_VARNAME, EXE_PATH_VALUE);
3516
3803
 
3517
 
  newargc=0;
3518
 
  for (i = 1; i < argc; i++)
3519
 
    {
3520
 
      if (strncmp (argv[i], env_set_opt, env_set_opt_len) == 0)
3521
 
        {
3522
 
          if (argv[i][env_set_opt_len] == '=')
3523
 
            {
3524
 
              const char *p = argv[i] + env_set_opt_len + 1;
3525
 
              lt_opt_process_env_set (p);
3526
 
            }
3527
 
          else if (argv[i][env_set_opt_len] == '\0' && i + 1 < argc)
3528
 
            {
3529
 
              lt_opt_process_env_set (argv[++i]); /* don't copy */
3530
 
            }
3531
 
          else
3532
 
            lt_fatal ("%s missing required argument", env_set_opt);
3533
 
          continue;
3534
 
        }
3535
 
      if (strncmp (argv[i], env_prepend_opt, env_prepend_opt_len) == 0)
3536
 
        {
3537
 
          if (argv[i][env_prepend_opt_len] == '=')
3538
 
            {
3539
 
              const char *p = argv[i] + env_prepend_opt_len + 1;
3540
 
              lt_opt_process_env_prepend (p);
3541
 
            }
3542
 
          else if (argv[i][env_prepend_opt_len] == '\0' && i + 1 < argc)
3543
 
            {
3544
 
              lt_opt_process_env_prepend (argv[++i]); /* don't copy */
3545
 
            }
3546
 
          else
3547
 
            lt_fatal ("%s missing required argument", env_prepend_opt);
3548
 
          continue;
3549
 
        }
3550
 
      if (strncmp (argv[i], env_append_opt, env_append_opt_len) == 0)
3551
 
        {
3552
 
          if (argv[i][env_append_opt_len] == '=')
3553
 
            {
3554
 
              const char *p = argv[i] + env_append_opt_len + 1;
3555
 
              lt_opt_process_env_append (p);
3556
 
            }
3557
 
          else if (argv[i][env_append_opt_len] == '\0' && i + 1 < argc)
3558
 
            {
3559
 
              lt_opt_process_env_append (argv[++i]); /* don't copy */
3560
 
            }
3561
 
          else
3562
 
            lt_fatal ("%s missing required argument", env_append_opt);
3563
 
          continue;
3564
 
        }
3565
 
      if (strncmp (argv[i], ltwrapper_option_prefix, opt_prefix_len) == 0)
3566
 
        {
3567
 
          /* however, if there is an option in the LTWRAPPER_OPTION_PREFIX
3568
 
             namespace, but it is not one of the ones we know about and
3569
 
             have already dealt with, above (inluding dump-script), then
3570
 
             report an error. Otherwise, targets might begin to believe
3571
 
             they are allowed to use options in the LTWRAPPER_OPTION_PREFIX
3572
 
             namespace. The first time any user complains about this, we'll
3573
 
             need to make LTWRAPPER_OPTION_PREFIX a configure-time option
3574
 
             or a configure.ac-settable value.
3575
 
           */
3576
 
          lt_fatal ("Unrecognized option in %s namespace: '%s'",
3577
 
                    ltwrapper_option_prefix, argv[i]);
3578
 
        }
3579
 
      /* otherwise ... */
3580
 
      newargz[++newargc] = xstrdup (argv[i]);
3581
 
    }
3582
 
  newargz[++newargc] = NULL;
3583
 
 
3584
 
  LTWRAPPER_DEBUGPRINTF     (("(main) lt_argv_zero : %s\n", (lt_argv_zero ? lt_argv_zero : "<NULL>")));
 
3804
  lt_debugprintf (__FILE__, __LINE__, "(main) lt_argv_zero: %s\n",
 
3805
                  nonnull (lt_argv_zero));
3585
3806
  for (i = 0; i < newargc; i++)
3586
3807
    {
3587
 
      LTWRAPPER_DEBUGPRINTF (("(main) newargz[%d]   : %s\n", i, (newargz[i] ? newargz[i] : "<NULL>")));
 
3808
      lt_debugprintf (__FILE__, __LINE__, "(main) newargz[%d]: %s\n",
 
3809
                      i, nonnull (newargz[i]));
3588
3810
    }
3589
3811
 
3590
3812
EOF
3593
3815
              mingw*)
3594
3816
                cat <<"EOF"
3595
3817
  /* execv doesn't actually work on mingw as expected on unix */
 
3818
  newargz = prepare_spawn (newargz);
3596
3819
  rval = _spawnv (_P_WAIT, lt_argv_zero, (const char * const *) newargz);
3597
3820
  if (rval == -1)
3598
3821
    {
3599
3822
      /* failed to start process */
3600
 
      LTWRAPPER_DEBUGPRINTF (("(main) failed to launch target \"%s\": errno = %d\n", lt_argv_zero, errno));
 
3823
      lt_debugprintf (__FILE__, __LINE__,
 
3824
                      "(main) failed to launch target \"%s\": %s\n",
 
3825
                      lt_argv_zero, nonnull (strerror (errno)));
3601
3826
      return 127;
3602
3827
    }
3603
3828
  return rval;
3619
3844
{
3620
3845
  void *p = (void *) malloc (num);
3621
3846
  if (!p)
3622
 
    lt_fatal ("Memory exhausted");
 
3847
    lt_fatal (__FILE__, __LINE__, "memory exhausted");
3623
3848
 
3624
3849
  return p;
3625
3850
}
3653
3878
{
3654
3879
  struct stat st;
3655
3880
 
3656
 
  LTWRAPPER_DEBUGPRINTF (("(check_executable)  : %s\n",
3657
 
                          path ? (*path ? path : "EMPTY!") : "NULL!"));
 
3881
  lt_debugprintf (__FILE__, __LINE__, "(check_executable): %s\n",
 
3882
                  nonempty (path));
3658
3883
  if ((!path) || (!*path))
3659
3884
    return 0;
3660
3885
 
3671
3896
  int rval = 0;
3672
3897
  struct stat st;
3673
3898
 
3674
 
  LTWRAPPER_DEBUGPRINTF (("(make_executable)   : %s\n",
3675
 
                          path ? (*path ? path : "EMPTY!") : "NULL!"));
 
3899
  lt_debugprintf (__FILE__, __LINE__, "(make_executable): %s\n",
 
3900
                  nonempty (path));
3676
3901
  if ((!path) || (!*path))
3677
3902
    return 0;
3678
3903
 
3698
3923
  int tmp_len;
3699
3924
  char *concat_name;
3700
3925
 
3701
 
  LTWRAPPER_DEBUGPRINTF (("(find_executable)   : %s\n",
3702
 
                          wrapper ? (*wrapper ? wrapper : "EMPTY!") : "NULL!"));
 
3926
  lt_debugprintf (__FILE__, __LINE__, "(find_executable): %s\n",
 
3927
                  nonempty (wrapper));
3703
3928
 
3704
3929
  if ((wrapper == NULL) || (*wrapper == '\0'))
3705
3930
    return NULL;
3752
3977
                {
3753
3978
                  /* empty path: current directory */
3754
3979
                  if (getcwd (tmp, LT_PATHMAX) == NULL)
3755
 
                    lt_fatal ("getcwd failed");
 
3980
                    lt_fatal (__FILE__, __LINE__, "getcwd failed: %s",
 
3981
                              nonnull (strerror (errno)));
3756
3982
                  tmp_len = strlen (tmp);
3757
3983
                  concat_name =
3758
3984
                    XMALLOC (char, tmp_len + 1 + strlen (wrapper) + 1);
3777
4003
    }
3778
4004
  /* Relative path | not found in path: prepend cwd */
3779
4005
  if (getcwd (tmp, LT_PATHMAX) == NULL)
3780
 
    lt_fatal ("getcwd failed");
 
4006
    lt_fatal (__FILE__, __LINE__, "getcwd failed: %s",
 
4007
              nonnull (strerror (errno)));
3781
4008
  tmp_len = strlen (tmp);
3782
4009
  concat_name = XMALLOC (char, tmp_len + 1 + strlen (wrapper) + 1);
3783
4010
  memcpy (concat_name, tmp, tmp_len);
3803
4030
  int has_symlinks = 0;
3804
4031
  while (strlen (tmp_pathspec) && !has_symlinks)
3805
4032
    {
3806
 
      LTWRAPPER_DEBUGPRINTF (("checking path component for symlinks: %s\n",
3807
 
                              tmp_pathspec));
 
4033
      lt_debugprintf (__FILE__, __LINE__,
 
4034
                      "checking path component for symlinks: %s\n",
 
4035
                      tmp_pathspec);
3808
4036
      if (lstat (tmp_pathspec, &s) == 0)
3809
4037
        {
3810
4038
          if (S_ISLNK (s.st_mode) != 0)
3826
4054
        }
3827
4055
      else
3828
4056
        {
3829
 
          char *errstr = strerror (errno);
3830
 
          lt_fatal ("Error accessing file %s (%s)", tmp_pathspec, errstr);
 
4057
          lt_fatal (__FILE__, __LINE__,
 
4058
                    "error accessing file \"%s\": %s",
 
4059
                    tmp_pathspec, nonnull (strerror (errno)));
3831
4060
        }
3832
4061
    }
3833
4062
  XFREE (tmp_pathspec);
3840
4069
  tmp_pathspec = realpath (pathspec, buf);
3841
4070
  if (tmp_pathspec == 0)
3842
4071
    {
3843
 
      lt_fatal ("Could not follow symlinks for %s", pathspec);
 
4072
      lt_fatal (__FILE__, __LINE__,
 
4073
                "could not follow symlinks for %s", pathspec);
3844
4074
    }
3845
4075
  return xstrdup (tmp_pathspec);
3846
4076
#endif
3866
4096
  return str;
3867
4097
}
3868
4098
 
 
4099
void
 
4100
lt_debugprintf (const char *file, int line, const char *fmt, ...)
 
4101
{
 
4102
  va_list args;
 
4103
  if (lt_debug)
 
4104
    {
 
4105
      (void) fprintf (stderr, "%s:%s:%d: ", program_name, file, line);
 
4106
      va_start (args, fmt);
 
4107
      (void) vfprintf (stderr, fmt, args);
 
4108
      va_end (args);
 
4109
    }
 
4110
}
 
4111
 
3869
4112
static void
3870
 
lt_error_core (int exit_status, const char *mode,
 
4113
lt_error_core (int exit_status, const char *file,
 
4114
               int line, const char *mode,
3871
4115
               const char *message, va_list ap)
3872
4116
{
3873
 
  fprintf (stderr, "%s: %s: ", program_name, mode);
 
4117
  fprintf (stderr, "%s:%s:%d: %s: ", program_name, file, line, mode);
3874
4118
  vfprintf (stderr, message, ap);
3875
4119
  fprintf (stderr, ".\n");
3876
4120
 
3879
4123
}
3880
4124
 
3881
4125
void
3882
 
lt_fatal (const char *message, ...)
 
4126
lt_fatal (const char *file, int line, const char *message, ...)
3883
4127
{
3884
4128
  va_list ap;
3885
4129
  va_start (ap, message);
3886
 
  lt_error_core (EXIT_FAILURE, "FATAL", message, ap);
 
4130
  lt_error_core (EXIT_FAILURE, file, line, "FATAL", message, ap);
3887
4131
  va_end (ap);
3888
4132
}
3889
4133
 
 
4134
static const char *
 
4135
nonnull (const char *s)
 
4136
{
 
4137
  return s ? s : "(null)";
 
4138
}
 
4139
 
 
4140
static const char *
 
4141
nonempty (const char *s)
 
4142
{
 
4143
  return (s && !*s) ? "(empty)" : nonnull (s);
 
4144
}
 
4145
 
3890
4146
void
3891
4147
lt_setenv (const char *name, const char *value)
3892
4148
{
3893
 
  LTWRAPPER_DEBUGPRINTF (("(lt_setenv) setting '%s' to '%s'\n",
3894
 
                          (name ? name : "<NULL>"),
3895
 
                          (value ? value : "<NULL>")));
 
4149
  lt_debugprintf (__FILE__, __LINE__,
 
4150
                  "(lt_setenv) setting '%s' to '%s'\n",
 
4151
                  nonnull (name), nonnull (value));
3896
4152
  {
3897
4153
#ifdef HAVE_SETENV
3898
4154
    /* always make a copy, for consistency with !HAVE_SETENV */
3937
4193
  return new_value;
3938
4194
}
3939
4195
 
3940
 
int
3941
 
lt_split_name_value (const char *arg, char** name, char** value)
3942
 
{
3943
 
  const char *p;
3944
 
  int len;
3945
 
  if (!arg || !*arg)
3946
 
    return 1;
3947
 
 
3948
 
  p = strchr (arg, (int)'=');
3949
 
 
3950
 
  if (!p)
3951
 
    return 1;
3952
 
 
3953
 
  *value = xstrdup (++p);
3954
 
 
3955
 
  len = strlen (arg) - strlen (*value);
3956
 
  *name = XMALLOC (char, len);
3957
 
  strncpy (*name, arg, len-1);
3958
 
  (*name)[len - 1] = '\0';
3959
 
 
3960
 
  return 0;
3961
 
}
3962
 
 
3963
 
void
3964
 
lt_opt_process_env_set (const char *arg)
3965
 
{
3966
 
  char *name = NULL;
3967
 
  char *value = NULL;
3968
 
 
3969
 
  if (lt_split_name_value (arg, &name, &value) != 0)
3970
 
    {
3971
 
      XFREE (name);
3972
 
      XFREE (value);
3973
 
      lt_fatal ("bad argument for %s: '%s'", env_set_opt, arg);
3974
 
    }
3975
 
 
3976
 
  lt_setenv (name, value);
3977
 
  XFREE (name);
3978
 
  XFREE (value);
3979
 
}
3980
 
 
3981
 
void
3982
 
lt_opt_process_env_prepend (const char *arg)
3983
 
{
3984
 
  char *name = NULL;
3985
 
  char *value = NULL;
3986
 
  char *new_value = NULL;
3987
 
 
3988
 
  if (lt_split_name_value (arg, &name, &value) != 0)
3989
 
    {
3990
 
      XFREE (name);
3991
 
      XFREE (value);
3992
 
      lt_fatal ("bad argument for %s: '%s'", env_prepend_opt, arg);
3993
 
    }
3994
 
 
3995
 
  new_value = lt_extend_str (getenv (name), value, 0);
3996
 
  lt_setenv (name, new_value);
3997
 
  XFREE (new_value);
3998
 
  XFREE (name);
3999
 
  XFREE (value);
4000
 
}
4001
 
 
4002
 
void
4003
 
lt_opt_process_env_append (const char *arg)
4004
 
{
4005
 
  char *name = NULL;
4006
 
  char *value = NULL;
4007
 
  char *new_value = NULL;
4008
 
 
4009
 
  if (lt_split_name_value (arg, &name, &value) != 0)
4010
 
    {
4011
 
      XFREE (name);
4012
 
      XFREE (value);
4013
 
      lt_fatal ("bad argument for %s: '%s'", env_append_opt, arg);
4014
 
    }
4015
 
 
4016
 
  new_value = lt_extend_str (getenv (name), value, 1);
4017
 
  lt_setenv (name, new_value);
4018
 
  XFREE (new_value);
4019
 
  XFREE (name);
4020
 
  XFREE (value);
4021
 
}
4022
 
 
4023
4196
void
4024
4197
lt_update_exe_path (const char *name, const char *value)
4025
4198
{
4026
 
  LTWRAPPER_DEBUGPRINTF (("(lt_update_exe_path) modifying '%s' by prepending '%s'\n",
4027
 
                          (name ? name : "<NULL>"),
4028
 
                          (value ? value : "<NULL>")));
 
4199
  lt_debugprintf (__FILE__, __LINE__,
 
4200
                  "(lt_update_exe_path) modifying '%s' by prepending '%s'\n",
 
4201
                  nonnull (name), nonnull (value));
4029
4202
 
4030
4203
  if (name && *name && value && *value)
4031
4204
    {
4044
4217
void
4045
4218
lt_update_lib_path (const char *name, const char *value)
4046
4219
{
4047
 
  LTWRAPPER_DEBUGPRINTF (("(lt_update_lib_path) modifying '%s' by prepending '%s'\n",
4048
 
                          (name ? name : "<NULL>"),
4049
 
                          (value ? value : "<NULL>")));
 
4220
  lt_debugprintf (__FILE__, __LINE__,
 
4221
                  "(lt_update_lib_path) modifying '%s' by prepending '%s'\n",
 
4222
                  nonnull (name), nonnull (value));
4050
4223
 
4051
4224
  if (name && *name && value && *value)
4052
4225
    {
4056
4229
    }
4057
4230
}
4058
4231
 
4059
 
 
 
4232
EOF
 
4233
            case $host_os in
 
4234
              mingw*)
 
4235
                cat <<"EOF"
 
4236
 
 
4237
/* Prepares an argument vector before calling spawn().
 
4238
   Note that spawn() does not by itself call the command interpreter
 
4239
     (getenv ("COMSPEC") != NULL ? getenv ("COMSPEC") :
 
4240
      ({ OSVERSIONINFO v; v.dwOSVersionInfoSize = sizeof(OSVERSIONINFO);
 
4241
         GetVersionEx(&v);
 
4242
         v.dwPlatformId == VER_PLATFORM_WIN32_NT;
 
4243
      }) ? "cmd.exe" : "command.com").
 
4244
   Instead it simply concatenates the arguments, separated by ' ', and calls
 
4245
   CreateProcess().  We must quote the arguments since Win32 CreateProcess()
 
4246
   interprets characters like ' ', '\t', '\\', '"' (but not '<' and '>') in a
 
4247
   special way:
 
4248
   - Space and tab are interpreted as delimiters. They are not treated as
 
4249
     delimiters if they are surrounded by double quotes: "...".
 
4250
   - Unescaped double quotes are removed from the input. Their only effect is
 
4251
     that within double quotes, space and tab are treated like normal
 
4252
     characters.
 
4253
   - Backslashes not followed by double quotes are not special.
 
4254
   - But 2*n+1 backslashes followed by a double quote become
 
4255
     n backslashes followed by a double quote (n >= 0):
 
4256
       \" -> "
 
4257
       \\\" -> \"
 
4258
       \\\\\" -> \\"
 
4259
 */
 
4260
#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"
 
4261
#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"
 
4262
char **
 
4263
prepare_spawn (char **argv)
 
4264
{
 
4265
  size_t argc;
 
4266
  char **new_argv;
 
4267
  size_t i;
 
4268
 
 
4269
  /* Count number of arguments.  */
 
4270
  for (argc = 0; argv[argc] != NULL; argc++)
 
4271
    ;
 
4272
 
 
4273
  /* Allocate new argument vector.  */
 
4274
  new_argv = XMALLOC (char *, argc + 1);
 
4275
 
 
4276
  /* Put quoted arguments into the new argument vector.  */
 
4277
  for (i = 0; i < argc; i++)
 
4278
    {
 
4279
      const char *string = argv[i];
 
4280
 
 
4281
      if (string[0] == '\0')
 
4282
        new_argv[i] = xstrdup ("\"\"");
 
4283
      else if (strpbrk (string, SHELL_SPECIAL_CHARS) != NULL)
 
4284
        {
 
4285
          int quote_around = (strpbrk (string, SHELL_SPACE_CHARS) != NULL);
 
4286
          size_t length;
 
4287
          unsigned int backslashes;
 
4288
          const char *s;
 
4289
          char *quoted_string;
 
4290
          char *p;
 
4291
 
 
4292
          length = 0;
 
4293
          backslashes = 0;
 
4294
          if (quote_around)
 
4295
            length++;
 
4296
          for (s = string; *s != '\0'; s++)
 
4297
            {
 
4298
              char c = *s;
 
4299
              if (c == '"')
 
4300
                length += backslashes + 1;
 
4301
              length++;
 
4302
              if (c == '\\')
 
4303
                backslashes++;
 
4304
              else
 
4305
                backslashes = 0;
 
4306
            }
 
4307
          if (quote_around)
 
4308
            length += backslashes + 1;
 
4309
 
 
4310
          quoted_string = XMALLOC (char, length + 1);
 
4311
 
 
4312
          p = quoted_string;
 
4313
          backslashes = 0;
 
4314
          if (quote_around)
 
4315
            *p++ = '"';
 
4316
          for (s = string; *s != '\0'; s++)
 
4317
            {
 
4318
              char c = *s;
 
4319
              if (c == '"')
 
4320
                {
 
4321
                  unsigned int j;
 
4322
                  for (j = backslashes + 1; j > 0; j--)
 
4323
                    *p++ = '\\';
 
4324
                }
 
4325
              *p++ = c;
 
4326
              if (c == '\\')
 
4327
                backslashes++;
 
4328
              else
 
4329
                backslashes = 0;
 
4330
            }
 
4331
          if (quote_around)
 
4332
            {
 
4333
              unsigned int j;
 
4334
              for (j = backslashes; j > 0; j--)
 
4335
                *p++ = '\\';
 
4336
              *p++ = '"';
 
4337
            }
 
4338
          *p = '\0';
 
4339
 
 
4340
          new_argv[i] = quoted_string;
 
4341
        }
 
4342
      else
 
4343
        new_argv[i] = (char *) string;
 
4344
    }
 
4345
  new_argv[argc] = NULL;
 
4346
 
 
4347
  return new_argv;
 
4348
}
 
4349
EOF
 
4350
                ;;
 
4351
            esac
 
4352
 
 
4353
            cat <<"EOF"
 
4354
void lt_dump_script (FILE* f)
 
4355
{
 
4356
EOF
 
4357
            func_emit_wrapper yes |
 
4358
              $SED -e 's/\([\\"]\)/\\\1/g' \
 
4359
                   -e 's/^/  fputs ("/' -e 's/$/\\n", f);/'
 
4360
 
 
4361
            cat <<"EOF"
 
4362
}
4060
4363
EOF
4061
4364
}
4062
4365
# end: func_emit_cwrapperexe_src
4063
4366
 
 
4367
# func_win32_import_lib_p ARG
 
4368
# True if ARG is an import lib, as indicated by $file_magic_cmd
 
4369
func_win32_import_lib_p ()
 
4370
{
 
4371
    $opt_debug
 
4372
    case `eval $file_magic_cmd \"\$1\" 2>/dev/null | $SED -e 10q` in
 
4373
    *import*) : ;;
 
4374
    *) false ;;
 
4375
    esac
 
4376
}
 
4377
 
4064
4378
# func_mode_link arg...
4065
4379
func_mode_link ()
4066
4380
{
4105
4419
    new_inherited_linker_flags=
4106
4420
 
4107
4421
    avoid_version=no
 
4422
    bindir=
4108
4423
    dlfiles=
4109
4424
    dlprefiles=
4110
4425
    dlself=no
4197
4512
        esac
4198
4513
 
4199
4514
        case $prev in
 
4515
        bindir)
 
4516
          bindir="$arg"
 
4517
          prev=
 
4518
          continue
 
4519
          ;;
4200
4520
        dlfiles|dlprefiles)
4201
4521
          if test "$preload" = no; then
4202
4522
            # Add the symbol object into the linking commands.
4458
4778
        continue
4459
4779
        ;;
4460
4780
 
 
4781
      -bindir)
 
4782
        prev=bindir
 
4783
        continue
 
4784
        ;;
 
4785
 
4461
4786
      -dlopen)
4462
4787
        prev=dlfiles
4463
4788
        continue
4536
4861
        esac
4537
4862
        case $host in
4538
4863
        *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-cegcc*)
4539
 
          testbindir=`$ECHO "X$dir" | $Xsed -e 's*/lib$*/bin*'`
 
4864
          testbindir=`$ECHO "$dir" | $SED 's*/lib$*/bin*'`
4540
4865
          case :$dllsearchpath: in
4541
4866
          *":$dir:"*) ;;
4542
4867
          ::) dllsearchpath=$dir;;
4555
4880
      -l*)
4556
4881
        if test "X$arg" = "X-lc" || test "X$arg" = "X-lm"; then
4557
4882
          case $host in
4558
 
          *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-beos* | *-cegcc*)
 
4883
          *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-beos* | *-cegcc* | *-*-haiku*)
4559
4884
            # These systems don't actually have a C or math library (as such)
4560
4885
            continue
4561
4886
            ;;
4742
5067
        for flag in $args; do
4743
5068
          IFS="$save_ifs"
4744
5069
          func_quote_for_eval "$flag"
4745
 
          arg="$arg $wl$func_quote_for_eval_result"
 
5070
          arg="$arg $func_quote_for_eval_result"
4746
5071
          compiler_flags="$compiler_flags $func_quote_for_eval_result"
4747
5072
        done
4748
5073
        IFS="$save_ifs"
4788
5113
        arg="$func_quote_for_eval_result"
4789
5114
        ;;
4790
5115
 
4791
 
      # -64, -mips[0-9] enable 64-bit mode on the SGI compiler
4792
 
      # -r[0-9][0-9]* specifies the processor on the SGI compiler
4793
 
      # -xarch=*, -xtarget=* enable 64-bit mode on the Sun compiler
4794
 
      # +DA*, +DD* enable 64-bit mode on the HP compiler
4795
 
      # -q* pass through compiler args for the IBM compiler
4796
 
      # -m*, -t[45]*, -txscale* pass through architecture-specific
4797
 
      # compiler args for GCC
4798
 
      # -F/path gives path to uninstalled frameworks, gcc on darwin
4799
 
      # -p, -pg, --coverage, -fprofile-* pass through profiling flag for GCC
4800
 
      # @file GCC response files
 
5116
      # Flags to be passed through unchanged, with rationale:
 
5117
      # -64, -mips[0-9]      enable 64-bit mode for the SGI compiler
 
5118
      # -r[0-9][0-9]*        specify processor for the SGI compiler
 
5119
      # -xarch=*, -xtarget=* enable 64-bit mode for the Sun compiler
 
5120
      # +DA*, +DD*           enable 64-bit mode for the HP compiler
 
5121
      # -q*                  compiler args for the IBM compiler
 
5122
      # -m*, -t[45]*, -txscale* architecture-specific flags for GCC
 
5123
      # -F/path              path to uninstalled frameworks, gcc on darwin
 
5124
      # -p, -pg, --coverage, -fprofile-*  profiling flags for GCC
 
5125
      # @file                GCC response files
 
5126
      # -tp=*                Portland pgcc target processor selection
4801
5127
      -64|-mips[0-9]|-r[0-9][0-9]*|-xarch=*|-xtarget=*|+DA*|+DD*|-q*|-m*| \
4802
 
      -t[45]*|-txscale*|-p|-pg|--coverage|-fprofile-*|-F*|@*)
 
5128
      -t[45]*|-txscale*|-p|-pg|--coverage|-fprofile-*|-F*|@*|-tp=*)
4803
5129
        func_quote_for_eval "$arg"
4804
5130
        arg="$func_quote_for_eval_result"
4805
5131
        func_append compile_command " $arg"
4959
5285
 
4960
5286
    if test -n "$shlibpath_var"; then
4961
5287
      # get the directories listed in $shlibpath_var
4962
 
      eval shlib_search_path=\`\$ECHO \"X\${$shlibpath_var}\" \| \$Xsed -e \'s/:/ /g\'\`
 
5288
      eval shlib_search_path=\`\$ECHO \"\${$shlibpath_var}\" \| \$SED \'s/:/ /g\'\`
4963
5289
    else
4964
5290
      shlib_search_path=
4965
5291
    fi
5082
5408
          # Collect preopened libtool deplibs, except any this library
5083
5409
          # has declared as weak libs
5084
5410
          for deplib in $dependency_libs; do
5085
 
            deplib_base=`$ECHO "X$deplib" | $Xsed -e "$basename"`
 
5411
            func_basename "$deplib"
 
5412
            deplib_base=$func_basename_result
5086
5413
            case " $weak_libs " in
5087
5414
            *" $deplib_base "*) ;;
5088
5415
            *) deplibs="$deplibs $deplib" ;;
5278
5605
                match_pattern*)
5279
5606
                  set dummy $deplibs_check_method; shift
5280
5607
                  match_pattern_regex=`expr "$deplibs_check_method" : "$1 \(.*\)"`
5281
 
                  if eval "\$ECHO \"X$deplib\"" 2>/dev/null | $Xsed -e 10q \
 
5608
                  if eval "\$ECHO \"$deplib\"" 2>/dev/null | $SED 10q \
5282
5609
                    | $EGREP "$match_pattern_regex" > /dev/null; then
5283
5610
                    valid_a_lib=yes
5284
5611
                  fi
5288
5615
                ;;
5289
5616
              esac
5290
5617
              if test "$valid_a_lib" != yes; then
5291
 
                $ECHO
 
5618
                echo
5292
5619
                $ECHO "*** Warning: Trying to link with static lib archive $deplib."
5293
 
                $ECHO "*** I have the capability to make that library automatically link in when"
5294
 
                $ECHO "*** you link to this library.  But I can only do this if you have a"
5295
 
                $ECHO "*** shared version of the library, which you do not appear to have"
5296
 
                $ECHO "*** because the file extensions .$libext of this argument makes me believe"
5297
 
                $ECHO "*** that it is just a static archive that I should not use here."
 
5620
                echo "*** I have the capability to make that library automatically link in when"
 
5621
                echo "*** you link to this library.  But I can only do this if you have a"
 
5622
                echo "*** shared version of the library, which you do not appear to have"
 
5623
                echo "*** because the file extensions .$libext of this argument makes me believe"
 
5624
                echo "*** that it is just a static archive that I should not use here."
5298
5625
              else
5299
 
                $ECHO
 
5626
                echo
5300
5627
                $ECHO "*** Warning: Linking the shared library $output against the"
5301
5628
                $ECHO "*** static library $deplib is not portable!"
5302
5629
                deplibs="$deplib $deplibs"
5369
5696
 
5370
5697
        # Convert "-framework foo" to "foo.ltframework"
5371
5698
        if test -n "$inherited_linker_flags"; then
5372
 
          tmp_inherited_linker_flags=`$ECHO "X$inherited_linker_flags" | $Xsed -e 's/-framework \([^ $]*\)/\1.ltframework/g'`
 
5699
          tmp_inherited_linker_flags=`$ECHO "$inherited_linker_flags" | $SED 's/-framework \([^ $]*\)/\1.ltframework/g'`
5373
5700
          for tmp_inherited_linker_flag in $tmp_inherited_linker_flags; do
5374
5701
            case " $new_inherited_linker_flags " in
5375
5702
              *" $tmp_inherited_linker_flag "*) ;;
5377
5704
            esac
5378
5705
          done
5379
5706
        fi
5380
 
        dependency_libs=`$ECHO "X $dependency_libs" | $Xsed -e 's% \([^ $]*\).ltframework% -framework \1%g'`
 
5707
        dependency_libs=`$ECHO " $dependency_libs" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'`
5381
5708
        if test "$linkmode,$pass" = "lib,link" ||
5382
5709
           test "$linkmode,$pass" = "prog,scan" ||
5383
5710
           { test "$linkmode" != prog && test "$linkmode" != lib; }; then
5631
5958
            fi
5632
5959
          done
5633
5960
          if test -z "$dlopenmodule" && test "$shouldnotlink" = yes && test "$pass" = link; then
5634
 
            $ECHO
 
5961
            echo
5635
5962
            if test "$linkmode" = prog; then
5636
5963
              $ECHO "*** Warning: Linking the executable $output against the loadable module"
5637
5964
            else
5734
6061
                      if test "X$dlopenmodule" != "X$lib"; then
5735
6062
                        $ECHO "*** Warning: lib $linklib is a module, not a shared library"
5736
6063
                        if test -z "$old_library" ; then
5737
 
                          $ECHO
5738
 
                          $ECHO "*** And there doesn't seem to be a static archive available"
5739
 
                          $ECHO "*** The link will probably fail, sorry"
 
6064
                          echo
 
6065
                          echo "*** And there doesn't seem to be a static archive available"
 
6066
                          echo "*** The link will probably fail, sorry"
5740
6067
                        else
5741
6068
                          add="$dir/$old_library"
5742
6069
                        fi
5876
6203
 
5877
6204
            # Just print a warning and add the library to dependency_libs so
5878
6205
            # that the program can be linked against the static library.
5879
 
            $ECHO
 
6206
            echo
5880
6207
            $ECHO "*** Warning: This system can not link to static lib archive $lib."
5881
 
            $ECHO "*** I have the capability to make that library automatically link in when"
5882
 
            $ECHO "*** you link to this library.  But I can only do this if you have a"
5883
 
            $ECHO "*** shared version of the library, which you do not appear to have."
 
6208
            echo "*** I have the capability to make that library automatically link in when"
 
6209
            echo "*** you link to this library.  But I can only do this if you have a"
 
6210
            echo "*** shared version of the library, which you do not appear to have."
5884
6211
            if test "$module" = yes; then
5885
 
              $ECHO "*** But as you try to build a module library, libtool will still create "
5886
 
              $ECHO "*** a static module, that should work as long as the dlopening application"
5887
 
              $ECHO "*** is linked with the -dlopen flag to resolve symbols at runtime."
 
6212
              echo "*** But as you try to build a module library, libtool will still create "
 
6213
              echo "*** a static module, that should work as long as the dlopening application"
 
6214
              echo "*** is linked with the -dlopen flag to resolve symbols at runtime."
5888
6215
              if test -z "$global_symbol_pipe"; then
5889
 
                $ECHO
5890
 
                $ECHO "*** However, this would only work if libtool was able to extract symbol"
5891
 
                $ECHO "*** lists from a program, using \`nm' or equivalent, but libtool could"
5892
 
                $ECHO "*** not find such a program.  So, this module is probably useless."
5893
 
                $ECHO "*** \`nm' from GNU binutils and a full rebuild may help."
 
6216
                echo
 
6217
                echo "*** However, this would only work if libtool was able to extract symbol"
 
6218
                echo "*** lists from a program, using \`nm' or equivalent, but libtool could"
 
6219
                echo "*** not find such a program.  So, this module is probably useless."
 
6220
                echo "*** \`nm' from GNU binutils and a full rebuild may help."
5894
6221
              fi
5895
6222
              if test "$build_old_libs" = no; then
5896
6223
                build_libtool_libs=module
5944
6271
          if test "$link_all_deplibs" != no; then
5945
6272
            # Add the search paths of all dependency libraries
5946
6273
            for deplib in $dependency_libs; do
 
6274
              path=
5947
6275
              case $deplib in
5948
6276
              -L*) path="$deplib" ;;
5949
6277
              *.la)
6009
6337
          compile_deplibs="$new_inherited_linker_flags $compile_deplibs"
6010
6338
          finalize_deplibs="$new_inherited_linker_flags $finalize_deplibs"
6011
6339
        else
6012
 
          compiler_flags="$compiler_flags "`$ECHO "X $new_inherited_linker_flags" | $Xsed -e 's% \([^ $]*\).ltframework% -framework \1%g'`
 
6340
          compiler_flags="$compiler_flags "`$ECHO " $new_inherited_linker_flags" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'`
6013
6341
        fi
6014
6342
      fi
6015
6343
      dependency_libs="$newdependency_libs"
6177
6505
        if test "$deplibs_check_method" != pass_all; then
6178
6506
          func_fatal_error "cannot build libtool library \`$output' from non-libtool objects on this host:$objs"
6179
6507
        else
6180
 
          $ECHO
 
6508
          echo
6181
6509
          $ECHO "*** Warning: Linking the shared library $output against the non-libtool"
6182
6510
          $ECHO "*** objects $objs is not portable!"
6183
6511
          libobjs="$libobjs $objs"
6245
6573
            age="$number_minor"
6246
6574
            revision="$number_revision"
6247
6575
            ;;
6248
 
          freebsd-aout|freebsd-elf|sunos)
 
6576
          freebsd-aout|freebsd-elf|qnx|sunos)
6249
6577
            current="$number_major"
6250
6578
            revision="$number_minor"
6251
6579
            age="0"
6479
6807
        oldlibs="$oldlibs $output_objdir/$libname.$libext"
6480
6808
 
6481
6809
        # Transform .lo files to .o files.
6482
 
        oldobjs="$objs "`$ECHO "X$libobjs" | $SP2NL | $Xsed -e '/\.'${libext}'$/d' -e "$lo2o" | $NL2SP`
 
6810
        oldobjs="$objs "`$ECHO "$libobjs" | $SP2NL | $SED "/\.${libext}$/d; $lo2o" | $NL2SP`
6483
6811
      fi
6484
6812
 
6485
6813
      # Eliminate all temporary directories.
6486
6814
      #for path in $notinst_path; do
6487
 
      # lib_search_path=`$ECHO "X$lib_search_path " | $Xsed -e "s% $path % %g"`
6488
 
      # deplibs=`$ECHO "X$deplibs " | $Xsed -e "s% -L$path % %g"`
6489
 
      # dependency_libs=`$ECHO "X$dependency_libs " | $Xsed -e "s% -L$path % %g"`
 
6815
      # lib_search_path=`$ECHO "$lib_search_path " | $SED "s% $path % %g"`
 
6816
      # deplibs=`$ECHO "$deplibs " | $SED "s% -L$path % %g"`
 
6817
      # dependency_libs=`$ECHO "$dependency_libs " | $SED "s% -L$path % %g"`
6490
6818
      #done
6491
6819
 
6492
6820
      if test -n "$xrpath"; then
6527
6855
      if test "$build_libtool_libs" = yes; then
6528
6856
        if test -n "$rpath"; then
6529
6857
          case $host in
6530
 
          *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-*-beos* | *-cegcc*)
 
6858
          *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-*-beos* | *-cegcc* | *-*-haiku*)
6531
6859
            # these systems don't actually have a c library (as such)!
6532
6860
            ;;
6533
6861
          *-*-rhapsody* | *-*-darwin1.[012])
6612
6940
                    newdeplibs="$newdeplibs $i"
6613
6941
                  else
6614
6942
                    droppeddeps=yes
6615
 
                    $ECHO
 
6943
                    echo
6616
6944
                    $ECHO "*** Warning: dynamic linker does not accept needed library $i."
6617
 
                    $ECHO "*** I have the capability to make that library automatically link in when"
6618
 
                    $ECHO "*** you link to this library.  But I can only do this if you have a"
6619
 
                    $ECHO "*** shared version of the library, which I believe you do not have"
6620
 
                    $ECHO "*** because a test_compile did reveal that the linker did not use it for"
6621
 
                    $ECHO "*** its dynamic dependency list that programs get resolved with at runtime."
 
6945
                    echo "*** I have the capability to make that library automatically link in when"
 
6946
                    echo "*** you link to this library.  But I can only do this if you have a"
 
6947
                    echo "*** shared version of the library, which I believe you do not have"
 
6948
                    echo "*** because a test_compile did reveal that the linker did not use it for"
 
6949
                    echo "*** its dynamic dependency list that programs get resolved with at runtime."
6622
6950
                  fi
6623
6951
                fi
6624
6952
                ;;
6655
6983
                      newdeplibs="$newdeplibs $i"
6656
6984
                    else
6657
6985
                      droppeddeps=yes
6658
 
                      $ECHO
 
6986
                      echo
6659
6987
                      $ECHO "*** Warning: dynamic linker does not accept needed library $i."
6660
 
                      $ECHO "*** I have the capability to make that library automatically link in when"
6661
 
                      $ECHO "*** you link to this library.  But I can only do this if you have a"
6662
 
                      $ECHO "*** shared version of the library, which you do not appear to have"
6663
 
                      $ECHO "*** because a test_compile did reveal that the linker did not use this one"
6664
 
                      $ECHO "*** as a dynamic dependency that programs can get resolved with at runtime."
 
6988
                      echo "*** I have the capability to make that library automatically link in when"
 
6989
                      echo "*** you link to this library.  But I can only do this if you have a"
 
6990
                      echo "*** shared version of the library, which you do not appear to have"
 
6991
                      echo "*** because a test_compile did reveal that the linker did not use this one"
 
6992
                      echo "*** as a dynamic dependency that programs can get resolved with at runtime."
6665
6993
                    fi
6666
6994
                  fi
6667
6995
                else
6668
6996
                  droppeddeps=yes
6669
 
                  $ECHO
 
6997
                  echo
6670
6998
                  $ECHO "*** Warning!  Library $i is needed by this library but I was not able to"
6671
 
                  $ECHO "*** make it link in!  You will probably need to install it or some"
6672
 
                  $ECHO "*** library that it depends on before this library will be fully"
6673
 
                  $ECHO "*** functional.  Installing it before continuing would be even better."
 
6999
                  echo "*** make it link in!  You will probably need to install it or some"
 
7000
                  echo "*** library that it depends on before this library will be fully"
 
7001
                  echo "*** functional.  Installing it before continuing would be even better."
6674
7002
                fi
6675
7003
                ;;
6676
7004
              *)
6716
7044
                        potliblink=`ls -ld $potlib | ${SED} 's/.* -> //'`
6717
7045
                        case $potliblink in
6718
7046
                        [\\/]* | [A-Za-z]:[\\/]*) potlib="$potliblink";;
6719
 
                        *) potlib=`$ECHO "X$potlib" | $Xsed -e 's,[^/]*$,,'`"$potliblink";;
 
7047
                        *) potlib=`$ECHO "$potlib" | $SED 's,[^/]*$,,'`"$potliblink";;
6720
7048
                        esac
6721
7049
                      done
6722
7050
                      if eval $file_magic_cmd \"\$potlib\" 2>/dev/null |
6731
7059
              fi
6732
7060
              if test -n "$a_deplib" ; then
6733
7061
                droppeddeps=yes
6734
 
                $ECHO
 
7062
                echo
6735
7063
                $ECHO "*** Warning: linker path does not have real file for library $a_deplib."
6736
 
                $ECHO "*** I have the capability to make that library automatically link in when"
6737
 
                $ECHO "*** you link to this library.  But I can only do this if you have a"
6738
 
                $ECHO "*** shared version of the library, which you do not appear to have"
6739
 
                $ECHO "*** because I did check the linker path looking for a file starting"
 
7064
                echo "*** I have the capability to make that library automatically link in when"
 
7065
                echo "*** you link to this library.  But I can only do this if you have a"
 
7066
                echo "*** shared version of the library, which you do not appear to have"
 
7067
                echo "*** because I did check the linker path looking for a file starting"
6740
7068
                if test -z "$potlib" ; then
6741
7069
                  $ECHO "*** with $libname but no candidates were found. (...for file magic test)"
6742
7070
                else
6774
7102
                  potential_libs=`ls $i/$libname[.-]* 2>/dev/null`
6775
7103
                  for potent_lib in $potential_libs; do
6776
7104
                    potlib="$potent_lib" # see symlink-check above in file_magic test
6777
 
                    if eval "\$ECHO \"X$potent_lib\"" 2>/dev/null | $Xsed -e 10q | \
 
7105
                    if eval "\$ECHO \"$potent_lib\"" 2>/dev/null | $SED 10q | \
6778
7106
                       $EGREP "$match_pattern_regex" > /dev/null; then
6779
7107
                      newdeplibs="$newdeplibs $a_deplib"
6780
7108
                      a_deplib=""
6785
7113
              fi
6786
7114
              if test -n "$a_deplib" ; then
6787
7115
                droppeddeps=yes
6788
 
                $ECHO
 
7116
                echo
6789
7117
                $ECHO "*** Warning: linker path does not have real file for library $a_deplib."
6790
 
                $ECHO "*** I have the capability to make that library automatically link in when"
6791
 
                $ECHO "*** you link to this library.  But I can only do this if you have a"
6792
 
                $ECHO "*** shared version of the library, which you do not appear to have"
6793
 
                $ECHO "*** because I did check the linker path looking for a file starting"
 
7118
                echo "*** I have the capability to make that library automatically link in when"
 
7119
                echo "*** you link to this library.  But I can only do this if you have a"
 
7120
                echo "*** shared version of the library, which you do not appear to have"
 
7121
                echo "*** because I did check the linker path looking for a file starting"
6794
7122
                if test -z "$potlib" ; then
6795
7123
                  $ECHO "*** with $libname but no candidates were found. (...for regex pattern test)"
6796
7124
                else
6808
7136
          ;;
6809
7137
        none | unknown | *)
6810
7138
          newdeplibs=""
6811
 
          tmp_deplibs=`$ECHO "X $deplibs" | $Xsed \
6812
 
              -e 's/ -lc$//' -e 's/ -[LR][^ ]*//g'`
 
7139
          tmp_deplibs=`$ECHO " $deplibs" | $SED 's/ -lc$//; s/ -[LR][^ ]*//g'`
6813
7140
          if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
6814
7141
            for i in $predeps $postdeps ; do
6815
7142
              # can't use Xsed below, because $i might contain '/'
6816
 
              tmp_deplibs=`$ECHO "X $tmp_deplibs" | $Xsed -e "s,$i,,"`
 
7143
              tmp_deplibs=`$ECHO " $tmp_deplibs" | $SED "s,$i,,"`
6817
7144
            done
6818
7145
          fi
6819
 
          if $ECHO "X $tmp_deplibs" | $Xsed -e 's/[      ]//g' |
6820
 
             $GREP . >/dev/null; then
6821
 
            $ECHO
 
7146
          case $tmp_deplibs in
 
7147
          *[!\  \ ]*)
 
7148
            echo
6822
7149
            if test "X$deplibs_check_method" = "Xnone"; then
6823
 
              $ECHO "*** Warning: inter-library dependencies are not supported in this platform."
 
7150
              echo "*** Warning: inter-library dependencies are not supported in this platform."
6824
7151
            else
6825
 
              $ECHO "*** Warning: inter-library dependencies are not known to be supported."
 
7152
              echo "*** Warning: inter-library dependencies are not known to be supported."
6826
7153
            fi
6827
 
            $ECHO "*** All declared inter-library dependencies are being dropped."
 
7154
            echo "*** All declared inter-library dependencies are being dropped."
6828
7155
            droppeddeps=yes
6829
 
          fi
 
7156
            ;;
 
7157
          esac
6830
7158
          ;;
6831
7159
        esac
6832
7160
        versuffix=$versuffix_save
6838
7166
        case $host in
6839
7167
        *-*-rhapsody* | *-*-darwin1.[012])
6840
7168
          # On Rhapsody replace the C library with the System framework
6841
 
          newdeplibs=`$ECHO "X $newdeplibs" | $Xsed -e 's/ -lc / System.ltframework /'`
 
7169
          newdeplibs=`$ECHO " $newdeplibs" | $SED 's/ -lc / System.ltframework /'`
6842
7170
          ;;
6843
7171
        esac
6844
7172
 
6845
7173
        if test "$droppeddeps" = yes; then
6846
7174
          if test "$module" = yes; then
6847
 
            $ECHO
6848
 
            $ECHO "*** Warning: libtool could not satisfy all declared inter-library"
 
7175
            echo
 
7176
            echo "*** Warning: libtool could not satisfy all declared inter-library"
6849
7177
            $ECHO "*** dependencies of module $libname.  Therefore, libtool will create"
6850
 
            $ECHO "*** a static module, that should work as long as the dlopening"
6851
 
            $ECHO "*** application is linked with the -dlopen flag."
 
7178
            echo "*** a static module, that should work as long as the dlopening"
 
7179
            echo "*** application is linked with the -dlopen flag."
6852
7180
            if test -z "$global_symbol_pipe"; then
6853
 
              $ECHO
6854
 
              $ECHO "*** However, this would only work if libtool was able to extract symbol"
6855
 
              $ECHO "*** lists from a program, using \`nm' or equivalent, but libtool could"
6856
 
              $ECHO "*** not find such a program.  So, this module is probably useless."
6857
 
              $ECHO "*** \`nm' from GNU binutils and a full rebuild may help."
 
7181
              echo
 
7182
              echo "*** However, this would only work if libtool was able to extract symbol"
 
7183
              echo "*** lists from a program, using \`nm' or equivalent, but libtool could"
 
7184
              echo "*** not find such a program.  So, this module is probably useless."
 
7185
              echo "*** \`nm' from GNU binutils and a full rebuild may help."
6858
7186
            fi
6859
7187
            if test "$build_old_libs" = no; then
6860
7188
              oldlibs="$output_objdir/$libname.$libext"
6864
7192
              build_libtool_libs=no
6865
7193
            fi
6866
7194
          else
6867
 
            $ECHO "*** The inter-library dependencies that have been dropped here will be"
6868
 
            $ECHO "*** automatically added whenever a program is linked with this library"
6869
 
            $ECHO "*** or is declared to -dlopen it."
 
7195
            echo "*** The inter-library dependencies that have been dropped here will be"
 
7196
            echo "*** automatically added whenever a program is linked with this library"
 
7197
            echo "*** or is declared to -dlopen it."
6870
7198
 
6871
7199
            if test "$allow_undefined" = no; then
6872
 
              $ECHO
6873
 
              $ECHO "*** Since this library must not contain undefined symbols,"
6874
 
              $ECHO "*** because either the platform does not support them or"
6875
 
              $ECHO "*** it was explicitly requested with -no-undefined,"
6876
 
              $ECHO "*** libtool will only create a static version of it."
 
7200
              echo
 
7201
              echo "*** Since this library must not contain undefined symbols,"
 
7202
              echo "*** because either the platform does not support them or"
 
7203
              echo "*** it was explicitly requested with -no-undefined,"
 
7204
              echo "*** libtool will only create a static version of it."
6877
7205
              if test "$build_old_libs" = no; then
6878
7206
                oldlibs="$output_objdir/$libname.$libext"
6879
7207
                build_libtool_libs=module
6890
7218
      # Time to change all our "foo.ltframework" stuff back to "-framework foo"
6891
7219
      case $host in
6892
7220
        *-*-darwin*)
6893
 
          newdeplibs=`$ECHO "X $newdeplibs" | $Xsed -e 's% \([^ $]*\).ltframework% -framework \1%g'`
6894
 
          new_inherited_linker_flags=`$ECHO "X $new_inherited_linker_flags" | $Xsed -e 's% \([^ $]*\).ltframework% -framework \1%g'`
6895
 
          deplibs=`$ECHO "X $deplibs" | $Xsed -e 's% \([^ $]*\).ltframework% -framework \1%g'`
 
7221
          newdeplibs=`$ECHO " $newdeplibs" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'`
 
7222
          new_inherited_linker_flags=`$ECHO " $new_inherited_linker_flags" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'`
 
7223
          deplibs=`$ECHO " $deplibs" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'`
6896
7224
          ;;
6897
7225
      esac
6898
7226
 
7014
7342
        done
7015
7343
 
7016
7344
        # Use standard objects if they are pic
7017
 
        test -z "$pic_flag" && libobjs=`$ECHO "X$libobjs" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP`
 
7345
        test -z "$pic_flag" && libobjs=`$ECHO "$libobjs" | $SP2NL | $SED "$lo2o" | $NL2SP`
7018
7346
        test "X$libobjs" = "X " && libobjs=
7019
7347
 
7020
7348
        delfiles=
7080
7408
        if test -n "$export_symbols" && test -n "$include_expsyms"; then
7081
7409
          tmp_export_symbols="$export_symbols"
7082
7410
          test -n "$orig_export_symbols" && tmp_export_symbols="$orig_export_symbols"
7083
 
          $opt_dry_run || eval '$ECHO "X$include_expsyms" | $Xsed | $SP2NL >> "$tmp_export_symbols"'
 
7411
          $opt_dry_run || eval '$ECHO "$include_expsyms" | $SP2NL >> "$tmp_export_symbols"'
7084
7412
        fi
7085
7413
 
7086
7414
        if test "X$skipped_export" != "X:" && test -n "$orig_export_symbols"; then
7181
7509
            save_libobjs=$libobjs
7182
7510
          fi
7183
7511
          save_output=$output
7184
 
          output_la=`$ECHO "X$output" | $Xsed -e "$basename"`
 
7512
          func_basename "$output"
 
7513
          output_la=$func_basename_result
7185
7514
 
7186
7515
          # Clear the reloadable object creation command queue and
7187
7516
          # initialize k to one.
7194
7523
          if test -n "$save_libobjs" && test "X$skipped_export" != "X:" && test "$with_gnu_ld" = yes; then
7195
7524
            output=${output_objdir}/${output_la}.lnkscript
7196
7525
            func_verbose "creating GNU ld script: $output"
7197
 
            $ECHO 'INPUT (' > $output
 
7526
            echo 'INPUT (' > $output
7198
7527
            for obj in $save_libobjs
7199
7528
            do
7200
7529
              $ECHO "$obj" >> $output
7201
7530
            done
7202
 
            $ECHO ')' >> $output
 
7531
            echo ')' >> $output
7203
7532
            delfiles="$delfiles $output"
7204
7533
          elif test -n "$save_libobjs" && test "X$skipped_export" != "X:" && test "X$file_list_spec" != X; then
7205
7534
            output=${output_objdir}/${output_la}.lnk
7241
7570
                  # command to the queue.
7242
7571
                  if test "$k" -eq 1 ; then
7243
7572
                    # The first file doesn't have a previous command to add.
7244
 
                    eval concat_cmds=\"$reload_cmds $objlist $last_robj\"
 
7573
                    reload_objs=$objlist
 
7574
                    eval concat_cmds=\"$reload_cmds\"
7245
7575
                  else
7246
7576
                    # All subsequent reloadable object files will link in
7247
7577
                    # the last one created.
7248
 
                    eval concat_cmds=\"\$concat_cmds~$reload_cmds $objlist $last_robj~\$RM $last_robj\"
 
7578
                    reload_objs="$objlist $last_robj"
 
7579
                    eval concat_cmds=\"\$concat_cmds~$reload_cmds~\$RM $last_robj\"
7249
7580
                  fi
7250
7581
                  last_robj=$output_objdir/$output_la-${k}.$objext
7251
7582
                  func_arith $k + 1
7252
7583
                  k=$func_arith_result
7253
7584
                  output=$output_objdir/$output_la-${k}.$objext
7254
 
                  objlist=$obj
 
7585
                  objlist=" $obj"
7255
7586
                  func_len " $last_robj"
7256
7587
                  func_arith $len0 + $func_len_result
7257
7588
                  len=$func_arith_result
7261
7592
              # reloadable object file.  All subsequent reloadable object
7262
7593
              # files will link in the last one created.
7263
7594
              test -z "$concat_cmds" || concat_cmds=$concat_cmds~
7264
 
              eval concat_cmds=\"\${concat_cmds}$reload_cmds $objlist $last_robj\"
 
7595
              reload_objs="$objlist $last_robj"
 
7596
              eval concat_cmds=\"\${concat_cmds}$reload_cmds\"
7265
7597
              if test -n "$last_robj"; then
7266
7598
                eval concat_cmds=\"\${concat_cmds}~\$RM $last_robj\"
7267
7599
              fi
7320
7652
            if test -n "$export_symbols" && test -n "$include_expsyms"; then
7321
7653
              tmp_export_symbols="$export_symbols"
7322
7654
              test -n "$orig_export_symbols" && tmp_export_symbols="$orig_export_symbols"
7323
 
              $opt_dry_run || eval '$ECHO "X$include_expsyms" | $Xsed | $SP2NL >> "$tmp_export_symbols"'
 
7655
              $opt_dry_run || eval '$ECHO "$include_expsyms" | $SP2NL >> "$tmp_export_symbols"'
7324
7656
            fi
7325
7657
 
7326
7658
            if test -n "$orig_export_symbols"; then
7485
7817
      if test -n "$convenience"; then
7486
7818
        if test -n "$whole_archive_flag_spec"; then
7487
7819
          eval tmp_whole_archive_flags=\"$whole_archive_flag_spec\"
7488
 
          reload_conv_objs=$reload_objs\ `$ECHO "X$tmp_whole_archive_flags" | $Xsed -e 's|,| |g'`
 
7820
          reload_conv_objs=$reload_objs\ `$ECHO "$tmp_whole_archive_flags" | $SED 's|,| |g'`
7489
7821
        else
7490
7822
          gentop="$output_objdir/${obj}x"
7491
7823
          generated="$generated $gentop"
7496
7828
      fi
7497
7829
 
7498
7830
      # Create the old-style object.
7499
 
      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
 
7831
      reload_objs="$objs$old_deplibs "`$ECHO "$libobjs" | $SP2NL | $SED "/\.${libext}$/d; /\.lib$/d; $lo2o" | $NL2SP`" $reload_conv_objs" ### testsuite: skip nested quoting test
7500
7832
 
7501
7833
      output="$obj"
7502
7834
      func_execute_cmds "$reload_cmds" 'exit $?'
7556
7888
      case $host in
7557
7889
      *-*-rhapsody* | *-*-darwin1.[012])
7558
7890
        # On Rhapsody replace the C library is the System framework
7559
 
        compile_deplibs=`$ECHO "X $compile_deplibs" | $Xsed -e 's/ -lc / System.ltframework /'`
7560
 
        finalize_deplibs=`$ECHO "X $finalize_deplibs" | $Xsed -e 's/ -lc / System.ltframework /'`
 
7891
        compile_deplibs=`$ECHO " $compile_deplibs" | $SED 's/ -lc / System.ltframework /'`
 
7892
        finalize_deplibs=`$ECHO " $finalize_deplibs" | $SED 's/ -lc / System.ltframework /'`
7561
7893
        ;;
7562
7894
      esac
7563
7895
 
7574
7906
          esac
7575
7907
        fi
7576
7908
        # Time to change all our "foo.ltframework" stuff back to "-framework foo"
7577
 
        compile_deplibs=`$ECHO "X $compile_deplibs" | $Xsed -e 's% \([^ $]*\).ltframework% -framework \1%g'`
7578
 
        finalize_deplibs=`$ECHO "X $finalize_deplibs" | $Xsed -e 's% \([^ $]*\).ltframework% -framework \1%g'`
 
7909
        compile_deplibs=`$ECHO " $compile_deplibs" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'`
 
7910
        finalize_deplibs=`$ECHO " $finalize_deplibs" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'`
7579
7911
        ;;
7580
7912
      esac
7581
7913
 
7712
8044
 
7713
8045
      if test -n "$libobjs" && test "$build_old_libs" = yes; then
7714
8046
        # Transform all the library objects into standard objects.
7715
 
        compile_command=`$ECHO "X$compile_command" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP`
7716
 
        finalize_command=`$ECHO "X$finalize_command" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP`
 
8047
        compile_command=`$ECHO "$compile_command" | $SP2NL | $SED "$lo2o" | $NL2SP`
 
8048
        finalize_command=`$ECHO "$finalize_command" | $SP2NL | $SED "$lo2o" | $NL2SP`
7717
8049
      fi
7718
8050
 
7719
8051
      func_generate_dlsyms "$outputname" "@PROGRAM@" "no"
7725
8057
 
7726
8058
      wrappers_required=yes
7727
8059
      case $host in
 
8060
      *cegcc* | *mingw32ce*)
 
8061
        # Disable wrappers for cegcc and mingw32ce hosts, we are cross compiling anyway.
 
8062
        wrappers_required=no
 
8063
        ;;
7728
8064
      *cygwin* | *mingw* )
7729
8065
        if test "$build_libtool_libs" != yes; then
7730
8066
          wrappers_required=no
7731
8067
        fi
7732
8068
        ;;
7733
 
      *cegcc)
7734
 
        # Disable wrappers for cegcc, we are cross compiling anyway.
7735
 
        wrappers_required=no
7736
 
        ;;
7737
8069
      *)
7738
8070
        if test "$need_relink" = no || test "$build_libtool_libs" != yes; then
7739
8071
          wrappers_required=no
7742
8074
      esac
7743
8075
      if test "$wrappers_required" = no; then
7744
8076
        # Replace the output file specification.
7745
 
        compile_command=`$ECHO "X$compile_command" | $Xsed -e 's%@OUTPUT@%'"$output"'%g'`
 
8077
        compile_command=`$ECHO "$compile_command" | $SED 's%@OUTPUT@%'"$output"'%g'`
7746
8078
        link_command="$compile_command$compile_rpath"
7747
8079
 
7748
8080
        # We have no uninstalled library dependencies, so finalize right now.
7789
8121
        # We don't need to create a wrapper script.
7790
8122
        link_command="$compile_var$compile_command$compile_rpath"
7791
8123
        # Replace the output file specification.
7792
 
        link_command=`$ECHO "X$link_command" | $Xsed -e 's%@OUTPUT@%'"$output"'%g'`
 
8124
        link_command=`$ECHO "$link_command" | $SED 's%@OUTPUT@%'"$output"'%g'`
7793
8125
        # Delete the old output file.
7794
8126
        $opt_dry_run || $RM $output
7795
8127
        # Link the executable and exit
7808
8140
        if test "$fast_install" != no; then
7809
8141
          link_command="$finalize_var$compile_command$finalize_rpath"
7810
8142
          if test "$fast_install" = yes; then
7811
 
            relink_command=`$ECHO "X$compile_var$compile_command$compile_rpath" | $Xsed -e 's%@OUTPUT@%\$progdir/\$file%g'`
 
8143
            relink_command=`$ECHO "$compile_var$compile_command$compile_rpath" | $SED 's%@OUTPUT@%\$progdir/\$file%g'`
7812
8144
          else
7813
8145
            # fast_install is set to needless
7814
8146
            relink_command=
7820
8152
      fi
7821
8153
 
7822
8154
      # Replace the output file specification.
7823
 
      link_command=`$ECHO "X$link_command" | $Xsed -e 's%@OUTPUT@%'"$output_objdir/$outputname"'%g'`
 
8155
      link_command=`$ECHO "$link_command" | $SED 's%@OUTPUT@%'"$output_objdir/$outputname"'%g'`
7824
8156
 
7825
8157
      # Delete the old output files.
7826
8158
      $opt_dry_run || $RM $output $output_objdir/$outputname $output_objdir/lt-$outputname
7844
8176
          fi
7845
8177
        done
7846
8178
        relink_command="(cd `pwd`; $relink_command)"
7847
 
        relink_command=`$ECHO "X$relink_command" | $Xsed -e "$sed_quote_subst"`
7848
 
      fi
7849
 
 
7850
 
      # Quote $ECHO for shipping.
7851
 
      if test "X$ECHO" = "X$SHELL $progpath --fallback-echo"; then
7852
 
        case $progpath in
7853
 
        [\\/]* | [A-Za-z]:[\\/]*) qecho="$SHELL $progpath --fallback-echo";;
7854
 
        *) qecho="$SHELL `pwd`/$progpath --fallback-echo";;
7855
 
        esac
7856
 
        qecho=`$ECHO "X$qecho" | $Xsed -e "$sed_quote_subst"`
7857
 
      else
7858
 
        qecho=`$ECHO "X$ECHO" | $Xsed -e "$sed_quote_subst"`
 
8179
        relink_command=`$ECHO "$relink_command" | $SED "$sed_quote_subst"`
7859
8180
      fi
7860
8181
 
7861
8182
      # Only actually do things if not in dry run mode.
7976
8297
            done | sort | sort -uc >/dev/null 2>&1); then
7977
8298
          :
7978
8299
        else
7979
 
          $ECHO "copying selected object files to avoid basename conflicts..."
 
8300
          echo "copying selected object files to avoid basename conflicts..."
7980
8301
          gentop="$output_objdir/${outputname}x"
7981
8302
          generated="$generated $gentop"
7982
8303
          func_mkdir_p "$gentop"
8087
8408
      done
8088
8409
      # Quote the link command for shipping.
8089
8410
      relink_command="(cd `pwd`; $SHELL $progpath $preserve_args --mode=relink $libtool_args @inst_prefix_dir@)"
8090
 
      relink_command=`$ECHO "X$relink_command" | $Xsed -e "$sed_quote_subst"`
 
8411
      relink_command=`$ECHO "$relink_command" | $SED "$sed_quote_subst"`
8091
8412
      if test "$hardcode_automatic" = yes ; then
8092
8413
        relink_command=
8093
8414
      fi
8172
8493
          fi
8173
8494
          $RM $output
8174
8495
          # place dlname in correct position for cygwin
 
8496
          # In fact, it would be nice if we could use this code for all target
 
8497
          # systems that can't hard-code library paths into their executables
 
8498
          # and that have no shared library path variable independent of PATH,
 
8499
          # but it turns out we can't easily determine that from inspecting
 
8500
          # libtool variables, so we have to hard-code the OSs to which it
 
8501
          # applies here; at the moment, that means platforms that use the PE
 
8502
          # object format with DLL files.  See the long comment at the top of
 
8503
          # tests/bindir.at for full details.
8175
8504
          tdlname=$dlname
8176
8505
          case $host,$output,$installed,$module,$dlname in
8177
 
            *cygwin*,*lai,yes,no,*.dll | *mingw*,*lai,yes,no,*.dll | *cegcc*,*lai,yes,no,*.dll) tdlname=../bin/$dlname ;;
 
8506
            *cygwin*,*lai,yes,no,*.dll | *mingw*,*lai,yes,no,*.dll | *cegcc*,*lai,yes,no,*.dll)
 
8507
              # If a -bindir argument was supplied, place the dll there.
 
8508
              if test "x$bindir" != x ;
 
8509
              then
 
8510
                func_relative_path "$install_libdir" "$bindir"
 
8511
                tdlname=$func_relative_path_result$dlname
 
8512
              else
 
8513
                # Otherwise fall back on heuristic.
 
8514
                tdlname=../bin/$dlname
 
8515
              fi
 
8516
              ;;
8178
8517
          esac
8179
8518
          $ECHO > $output "\
8180
8519
# $outputname - a libtool library file