~holger-seelig/titania/4.1

« back to all changes in this revision

Viewing changes to libtool

  • Committer: Holger Seelig
  • Date: 2016-06-20 16:52:05 UTC
  • Revision ID: holger.seelig@yahoo.de-20160620165205-4lyxiypvj7ttn7s4
Updated Makefiles.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
#! /bin/bash
2
 
 
3
 
# libtool - Provide generalized library-building support services.
4
2
# Generated automatically by config.status (titania) 0.1
5
3
# Libtool was configured on host andromeda:
6
4
# NOTE: Changes made to this file will be lost: look at ltmain.sh.
7
 
#
8
 
#   Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005,
9
 
#                 2006, 2007, 2008, 2009, 2010, 2011 Free Software
10
 
#                 Foundation, Inc.
11
 
#   Written by Gordon Matzigkeit, 1996
12
 
#
13
 
#   This file is part of GNU Libtool.
14
 
#
15
 
# GNU Libtool is free software; you can redistribute it and/or
16
 
# modify it under the terms of the GNU General Public License as
17
 
# published by the Free Software Foundation; either version 2 of
18
 
# the License, or (at your option) any later version.
19
 
#
20
 
# As a special exception to the GNU General Public License,
21
 
# if you distribute this file as part of a program or library that
22
 
# is built using GNU Libtool, you may include this file under the
23
 
# same distribution terms that you use for the rest of that program.
24
 
#
25
 
# GNU Libtool is distributed in the hope that it will be useful,
26
 
# but WITHOUT ANY WARRANTY; without even the implied warranty of
 
5
 
 
6
# Provide generalized library-building support services.
 
7
# Written by Gordon Matzigkeit, 1996
 
8
 
 
9
# Copyright (C) 2014 Free Software Foundation, Inc.
 
10
# This is free software; see the source for copying conditions.  There is NO
 
11
# warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
 
12
 
 
13
# GNU Libtool is free software; you can redistribute it and/or modify
 
14
# it under the terms of the GNU General Public License as published by
 
15
# the Free Software Foundation; either version 2 of of the License, or
 
16
# (at your option) any later version.
 
17
#
 
18
# As a special exception to the GNU General Public License, if you
 
19
# distribute this file as part of a program or library that is built
 
20
# using GNU Libtool, you may include this file under the  same
 
21
# distribution terms that you use for the rest of that program.
 
22
#
 
23
# GNU Libtool is distributed in the hope that it will be useful, but
 
24
# WITHOUT ANY WARRANTY; without even the implied warranty of
27
25
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
28
26
# GNU General Public License for more details.
29
27
#
30
28
# You should have received a copy of the GNU General Public License
31
 
# along with GNU Libtool; see the file COPYING.  If not, a copy
32
 
# can be downloaded from http://www.gnu.org/licenses/gpl.html, or
33
 
# obtained by writing to the Free Software Foundation, Inc.,
34
 
# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
 
29
# along with this program.  If not, see <http://www.gnu.org/licenses/>.
35
30
 
36
31
 
37
32
# The names of the tagged configurations supported by this script.
38
 
available_tags="CXX "
 
33
available_tags='CXX '
 
34
 
 
35
# Configured defaults for sys_lib_dlsearch_path munging.
 
36
: ${LT_SYS_LIBRARY_PATH=""}
39
37
 
40
38
# ### BEGIN LIBTOOL CONFIG
41
39
 
42
40
# Which release of libtool.m4 was used?
43
 
macro_version=2.4.2
44
 
macro_revision=1.3337
 
41
macro_version=2.4.6
 
42
macro_revision=2.4.6
45
43
 
46
44
# Whether or not to build shared libraries.
47
45
build_libtool_libs=yes
55
53
# Whether or not to optimize for fast installation.
56
54
fast_install=yes
57
55
 
 
56
# Shared archive member basename,for filename based shared library versioning on AIX.
 
57
shared_archive_member_spec=
 
58
 
58
59
# Shell to use when invoking shell scripts.
59
60
SHELL="/bin/bash"
60
61
 
170
171
global_symbol_pipe="sed -n -e 's/^.*[    ]\\([ABCDGIRSTW][ABCDGIRSTW]*\\)[       ][      ]*\\([_A-Za-z][_A-Za-z0-9]*\\)\$/\\1 \\2 \\2/p' | sed '/ __gnu_lto/d'"
171
172
 
172
173
# Transform the output of nm in a proper C declaration.
173
 
global_symbol_to_cdecl="sed -n -e 's/^T .* \\(.*\\)\$/extern int \\1();/p' -e 's/^[ABCDGIRSTW]* .* \\(.*\\)\$/extern char \\1;/p'"
 
174
global_symbol_to_cdecl="sed -n -e 's/^T .* \\(.*\\)\$/extern int \\1();/p' -e 's/^[ABCDGIRSTW][ABCDGIRSTW]* .* \\(.*\\)\$/extern char \\1;/p'"
 
175
 
 
176
# Transform the output of nm into a list of symbols to manually relocate.
 
177
global_symbol_to_import=""
174
178
 
175
179
# Transform the output of nm in a C name address pair.
176
 
global_symbol_to_c_name_address="sed -n -e 's/^: \\([^ ]*\\)[ ]*\$/  {\\\"\\1\\\", (void *) 0},/p' -e 's/^[ABCDGIRSTW]* \\([^ ]*\\) \\([^ ]*\\)\$/  {\"\\2\", (void *) \\&\\2},/p'"
 
180
global_symbol_to_c_name_address="sed -n -e 's/^: \\(.*\\) .*\$/  {\"\\1\", (void *) 0},/p' -e 's/^[ABCDGIRSTW][ABCDGIRSTW]* .* \\(.*\\)\$/  {\"\\1\", (void *) \\&\\1},/p'"
177
181
 
178
182
# Transform the output of nm in a C name address pair when lib prefix is needed.
179
 
global_symbol_to_c_name_address_lib_prefix="sed -n -e 's/^: \\([^ ]*\\)[ ]*\$/  {\\\"\\1\\\", (void *) 0},/p' -e 's/^[ABCDGIRSTW]* \\([^ ]*\\) \\(lib[^ ]*\\)\$/  {\"\\2\", (void *) \\&\\2},/p' -e 's/^[ABCDGIRSTW]* \\([^ ]*\\) \\([^ ]*\\)\$/  {\"lib\\2\", (void *) \\&\\2},/p'"
 
183
global_symbol_to_c_name_address_lib_prefix="sed -n -e 's/^: \\(.*\\) .*\$/  {\"\\1\", (void *) 0},/p' -e 's/^[ABCDGIRSTW][ABCDGIRSTW]* .* \\(lib.*\\)\$/  {\"\\1\", (void *) \\&\\1},/p' -e 's/^[ABCDGIRSTW][ABCDGIRSTW]* .* \\(.*\\)\$/  {\"lib\\1\", (void *) \\&\\1},/p'"
 
184
 
 
185
# The name lister interface.
 
186
nm_interface="BSD nm"
180
187
 
181
188
# Specify filename containing input files for $NM.
182
189
nm_file_list_spec="@"
183
190
 
184
 
# The root where to search for dependent libraries,and in which our libraries should be installed.
 
191
# The root where to search for dependent libraries,and where our libraries should be installed.
185
192
lt_sysroot=
186
193
 
 
194
# Command to truncate a binary pipe.
 
195
lt_truncate_bin="/bin/dd bs=4096 count=1"
 
196
 
187
197
# The name of the directory that contains temporary libtool files.
188
198
objdir=.libs
189
199
 
247
257
 
248
258
# List of archive names.  First name is the real one, the rest are links.
249
259
# The last name is the one that the linker finds with -lNAME
250
 
library_names_spec="\${libname}\${release}\${shared_ext}\$versuffix \${libname}\${release}\${shared_ext}\$major \$libname\${shared_ext}"
 
260
library_names_spec="\$libname\$release\$shared_ext\$versuffix \$libname\$release\$shared_ext\$major \$libname\$shared_ext"
251
261
 
252
262
# The coded name of the library, if different from the real name.
253
 
soname_spec="\${libname}\${release}\${shared_ext}\$major"
 
263
soname_spec="\$libname\$release\$shared_ext\$major"
254
264
 
255
265
# Permission mode override for installation of shared libraries.
256
266
install_override_mode=""
274
284
# Compile-time system search path for libraries.
275
285
sys_lib_search_path_spec="/usr/lib/gcc/x86_64-linux-gnu/5 /usr/lib/x86_64-linux-gnu /usr/lib /lib/x86_64-linux-gnu /lib "
276
286
 
277
 
# Run-time system search path for libraries.
278
 
sys_lib_dlsearch_path_spec="/lib /usr/lib /usr/lib/x86_64-linux-gnu/libfakeroot /usr/local/lib /lib/x86_64-linux-gnu /usr/lib/x86_64-linux-gnu /usr/lib/x86_64-linux-gnu/mesa-egl /usr/lib/nvidia-352 /usr/lib32/nvidia-352 /lib32 /usr/lib32 "
 
287
# Detected run-time system search path for libraries.
 
288
sys_lib_dlsearch_path_spec="/lib /usr/lib /usr/lib/x86_64-linux-gnu/libfakeroot /usr/local/lib /lib/x86_64-linux-gnu /usr/lib/x86_64-linux-gnu /usr/lib/nvidia-361 /usr/lib32/nvidia-361 /usr/lib/nvidia-361 /usr/lib32/nvidia-361 /lib32 /usr/lib32 "
 
289
 
 
290
# Explicit LT_SYS_LIBRARY_PATH set during ./configure time.
 
291
configure_time_lt_sys_library_path=""
279
292
 
280
293
# Whether dlopen is supported.
281
294
dlopen_support=unknown
329
342
allow_libtool_libs_with_static_runtimes=no
330
343
 
331
344
# Compiler flag to allow reflexive dlopens.
332
 
export_dynamic_flag_spec="\${wl}--export-dynamic"
 
345
export_dynamic_flag_spec="\$wl--export-dynamic"
333
346
 
334
347
# Compiler flag to generate shared objects directly from archives.
335
 
whole_archive_flag_spec="\${wl}--whole-archive\$convenience \${wl}--no-whole-archive"
 
348
whole_archive_flag_spec="\$wl--whole-archive\$convenience \$wl--no-whole-archive"
336
349
 
337
350
# Whether the compiler copes with passing no objects directly.
338
351
compiler_needs_object="no"
344
357
old_archive_from_expsyms_cmds=""
345
358
 
346
359
# Commands used to build a shared archive.
347
 
archive_cmds="\$CC -shared \$pic_flag \$libobjs \$deplibs \$compiler_flags \${wl}-soname \$wl\$soname -o \$lib"
 
360
archive_cmds="\$CC -shared \$pic_flag \$libobjs \$deplibs \$compiler_flags \$wl-soname \$wl\$soname -o \$lib"
348
361
archive_expsym_cmds="echo \\\"{ global:\\\" > \$output_objdir/\$libname.ver~
349
 
            cat \$export_symbols | sed -e \\\"s/\\\\(.*\\\\)/\\\\1;/\\\" >> \$output_objdir/\$libname.ver~
350
 
            echo \\\"local: *; };\\\" >> \$output_objdir/\$libname.ver~
351
 
            \$CC -shared \$pic_flag \$libobjs \$deplibs \$compiler_flags \${wl}-soname \$wl\$soname \${wl}-version-script \${wl}\$output_objdir/\$libname.ver -o \$lib"
 
362
            cat \$export_symbols | sed -e \\\"s/\\\\(.*\\\\)/\\\\1;/\\\" >> \$output_objdir/\$libname.ver~
 
363
            echo \\\"local: *; };\\\" >> \$output_objdir/\$libname.ver~
 
364
            \$CC -shared \$pic_flag \$libobjs \$deplibs \$compiler_flags \$wl-soname \$wl\$soname \$wl-version-script \$wl\$output_objdir/\$libname.ver -o \$lib"
352
365
 
353
366
# Commands used to build a loadable module if different from building
354
367
# a shared archive.
366
379
 
367
380
# Flag to hardcode $libdir into a binary during linking.
368
381
# This must work even if $libdir does not exist
369
 
hardcode_libdir_flag_spec="\${wl}-rpath \${wl}\$libdir"
 
382
hardcode_libdir_flag_spec="\$wl-rpath \$wl\$libdir"
370
383
 
371
384
# Whether we need a single "-rpath" flag with a separated argument.
372
385
hardcode_libdir_separator=""
373
386
 
374
 
# Set to "yes" if using DIR/libNAME${shared_ext} during linking hardcodes
 
387
# Set to "yes" if using DIR/libNAME$shared_ext during linking hardcodes
375
388
# DIR into the resulting binary.
376
389
hardcode_direct=no
377
390
 
378
 
# Set to "yes" if using DIR/libNAME${shared_ext} during linking hardcodes
 
391
# Set to "yes" if using DIR/libNAME$shared_ext during linking hardcodes
379
392
# DIR into the resulting binary and the resulting library dependency is
380
 
# "absolute",i.e impossible to change by setting ${shlibpath_var} if the
 
393
# "absolute",i.e impossible to change by setting $shlibpath_var if the
381
394
# library is relocated.
382
395
hardcode_direct_absolute=no
383
396
 
442
455
# ### END LIBTOOL CONFIG
443
456
 
444
457
 
445
 
# libtool (GNU libtool) 2.4.2
 
458
# ### BEGIN FUNCTIONS SHARED WITH CONFIGURE
 
459
 
 
460
# func_munge_path_list VARIABLE PATH
 
461
# -----------------------------------
 
462
# VARIABLE is name of variable containing _space_ separated list of
 
463
# directories to be munged by the contents of PATH, which is string
 
464
# having a format:
 
465
# "DIR[:DIR]:"
 
466
#       string "DIR[ DIR]" will be prepended to VARIABLE
 
467
# ":DIR[:DIR]"
 
468
#       string "DIR[ DIR]" will be appended to VARIABLE
 
469
# "DIRP[:DIRP]::[DIRA:]DIRA"
 
470
#       string "DIRP[ DIRP]" will be prepended to VARIABLE and string
 
471
#       "DIRA[ DIRA]" will be appended to VARIABLE
 
472
# "DIR[:DIR]"
 
473
#       VARIABLE will be replaced by "DIR[ DIR]"
 
474
func_munge_path_list ()
 
475
{
 
476
    case x$2 in
 
477
    x)
 
478
        ;;
 
479
    *:)
 
480
        eval $1=\"`$ECHO $2 | $SED 's/:/ /g'` \$$1\"
 
481
        ;;
 
482
    x:*)
 
483
        eval $1=\"\$$1 `$ECHO $2 | $SED 's/:/ /g'`\"
 
484
        ;;
 
485
    *::*)
 
486
        eval $1=\"\$$1\ `$ECHO $2 | $SED -e 's/.*:://' -e 's/:/ /g'`\"
 
487
        eval $1=\"`$ECHO $2 | $SED -e 's/::.*//' -e 's/:/ /g'`\ \$$1\"
 
488
        ;;
 
489
    *)
 
490
        eval $1=\"`$ECHO $2 | $SED 's/:/ /g'`\"
 
491
        ;;
 
492
    esac
 
493
}
 
494
 
 
495
 
 
496
# Calculate cc_basename.  Skip known compiler wrappers and cross-prefix.
 
497
func_cc_basename ()
 
498
{
 
499
    for cc_temp in $*""; do
 
500
      case $cc_temp in
 
501
        compile | *[\\/]compile | ccache | *[\\/]ccache ) ;;
 
502
        distcc | *[\\/]distcc | purify | *[\\/]purify ) ;;
 
503
        \-*) ;;
 
504
        *) break;;
 
505
      esac
 
506
    done
 
507
    func_cc_basename_result=`$ECHO "$cc_temp" | $SED "s%.*/%%; s%^$host_alias-%%"`
 
508
}
 
509
 
 
510
 
 
511
# ### END FUNCTIONS SHARED WITH CONFIGURE
 
512
 
 
513
#! /bin/sh
 
514
## DO NOT EDIT - This file generated from ./build-aux/ltmain.in
 
515
##               by inline-source v2014-01-03.01
 
516
 
 
517
# libtool (GNU libtool) 2.4.6
 
518
# Provide generalized library-building support services.
446
519
# Written by Gordon Matzigkeit <gord@gnu.ai.mit.edu>, 1996
447
520
 
448
 
# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005, 2006,
449
 
# 2007, 2008, 2009, 2010, 2011 Free Software Foundation, Inc.
 
521
# Copyright (C) 1996-2015 Free Software Foundation, Inc.
450
522
# This is free software; see the source for copying conditions.  There is NO
451
523
# warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
452
524
 
466
538
# General Public License for more details.
467
539
#
468
540
# You should have received a copy of the GNU General Public License
469
 
# along with GNU Libtool; see the file COPYING.  If not, a copy
470
 
# can be downloaded from http://www.gnu.org/licenses/gpl.html,
471
 
# or obtained by writing to the Free Software Foundation, Inc.,
472
 
# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
 
541
# along with this program.  If not, see <http://www.gnu.org/licenses/>.
473
542
 
474
 
# Usage: $progname [OPTION]... [MODE-ARG]...
475
 
#
476
 
# Provide generalized library-building support services.
477
 
#
478
 
#       --config             show all configuration variables
479
 
#       --debug              enable verbose shell tracing
480
 
#   -n, --dry-run            display commands without modifying any files
481
 
#       --features           display basic configuration information and exit
482
 
#       --mode=MODE          use operation mode MODE
483
 
#       --preserve-dup-deps  don't remove duplicate dependency libraries
484
 
#       --quiet, --silent    don't print informational messages
485
 
#       --no-quiet, --no-silent
486
 
#                            print informational messages (default)
487
 
#       --no-warn            don't display warning messages
488
 
#       --tag=TAG            use configuration variables from tag TAG
489
 
#   -v, --verbose            print more informational messages than default
490
 
#       --no-verbose         don't print the extra informational messages
491
 
#       --version            print version information
492
 
#   -h, --help, --help-all   print short, long, or detailed help message
493
 
#
494
 
# MODE must be one of the following:
495
 
#
496
 
#         clean              remove files from the build directory
497
 
#         compile            compile a source file into a libtool object
498
 
#         execute            automatically set library path, then run a program
499
 
#         finish             complete the installation of libtool libraries
500
 
#         install            install libraries or executables
501
 
#         link               create a library or an executable
502
 
#         uninstall          remove libraries from an installed directory
503
 
#
504
 
# MODE-ARGS vary depending on the MODE.  When passed as first option,
505
 
# `--mode=MODE' may be abbreviated as `MODE' or a unique abbreviation of that.
506
 
# Try `$progname --help --mode=MODE' for a more detailed description of MODE.
507
 
#
508
 
# When reporting a bug, please describe a test case to reproduce it and
509
 
# include the following information:
510
 
#
511
 
#         host-triplet: $host
512
 
#         shell:                $SHELL
513
 
#         compiler:             $LTCC
514
 
#         compiler flags:               $LTCFLAGS
515
 
#         linker:               $LD (gnu? $with_gnu_ld)
516
 
#         $progname:    (GNU libtool) 2.4.2 Debian-2.4.2-1.11
517
 
#         automake:     $automake_version
518
 
#         autoconf:     $autoconf_version
519
 
#
520
 
# Report bugs to <bug-libtool@gnu.org>.
521
 
# GNU libtool home page: <http://www.gnu.org/software/libtool/>.
522
 
# General help using GNU software: <http://www.gnu.org/gethelp/>.
523
543
 
524
544
PROGRAM=libtool
525
545
PACKAGE=libtool
526
 
VERSION="2.4.2 Debian-2.4.2-1.11"
527
 
TIMESTAMP=""
528
 
package_revision=1.3337
529
 
 
530
 
# Be Bourne compatible
531
 
if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then
 
546
VERSION="2.4.6 Debian-2.4.6-0.1"
 
547
package_revision=2.4.6
 
548
 
 
549
 
 
550
## ------ ##
 
551
## Usage. ##
 
552
## ------ ##
 
553
 
 
554
# Run './libtool --help' for help with using this script from the
 
555
# command line.
 
556
 
 
557
 
 
558
## ------------------------------- ##
 
559
## User overridable command paths. ##
 
560
## ------------------------------- ##
 
561
 
 
562
# After configure completes, it has a better idea of some of the
 
563
# shell tools we need than the defaults used by the functions shared
 
564
# with bootstrap, so set those here where they can still be over-
 
565
# ridden by the user, but otherwise take precedence.
 
566
 
 
567
: ${AUTOCONF="autoconf"}
 
568
: ${AUTOMAKE="automake"}
 
569
 
 
570
 
 
571
## -------------------------- ##
 
572
## Source external libraries. ##
 
573
## -------------------------- ##
 
574
 
 
575
# Much of our low-level functionality needs to be sourced from external
 
576
# libraries, which are installed to $pkgauxdir.
 
577
 
 
578
# Set a version string for this script.
 
579
scriptversion=2015-01-20.17; # UTC
 
580
 
 
581
# General shell script boiler plate, and helper functions.
 
582
# Written by Gary V. Vaughan, 2004
 
583
 
 
584
# Copyright (C) 2004-2015 Free Software Foundation, Inc.
 
585
# This is free software; see the source for copying conditions.  There is NO
 
586
# warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
 
587
 
 
588
# This program is free software; you can redistribute it and/or modify
 
589
# it under the terms of the GNU General Public License as published by
 
590
# the Free Software Foundation; either version 3 of the License, or
 
591
# (at your option) any later version.
 
592
 
 
593
# As a special exception to the GNU General Public License, if you distribute
 
594
# this file as part of a program or library that is built using GNU Libtool,
 
595
# you may include this file under the same distribution terms that you use
 
596
# for the rest of that program.
 
597
 
 
598
# This program is distributed in the hope that it will be useful,
 
599
# but WITHOUT ANY WARRANTY; without even the implied warranty of
 
600
# MERCHANTABILITY or FITNES FOR A PARTICULAR PURPOSE. See the GNU
 
601
# General Public License for more details.
 
602
 
 
603
# You should have received a copy of the GNU General Public License
 
604
# along with this program. If not, see <http://www.gnu.org/licenses/>.
 
605
 
 
606
# Please report bugs or propose patches to gary@gnu.org.
 
607
 
 
608
 
 
609
## ------ ##
 
610
## Usage. ##
 
611
## ------ ##
 
612
 
 
613
# Evaluate this file near the top of your script to gain access to
 
614
# the functions and variables defined here:
 
615
#
 
616
#   . `echo "$0" | ${SED-sed} 's|[^/]*$||'`/build-aux/funclib.sh
 
617
#
 
618
# If you need to override any of the default environment variable
 
619
# settings, do that before evaluating this file.
 
620
 
 
621
 
 
622
## -------------------- ##
 
623
## Shell normalisation. ##
 
624
## -------------------- ##
 
625
 
 
626
# Some shells need a little help to be as Bourne compatible as possible.
 
627
# Before doing anything else, make sure all that help has been provided!
 
628
 
 
629
DUALCASE=1; export DUALCASE # for MKS sh
 
630
if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then :
532
631
  emulate sh
533
632
  NULLCMD=:
534
 
  # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which
 
633
  # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which
535
634
  # is contrary to our usage.  Disable this feature.
536
635
  alias -g '${1+"$@"}'='"$@"'
537
636
  setopt NO_GLOB_SUBST
538
637
else
539
 
  case `(set -o) 2>/dev/null` in *posix*) set -o posix;; esac
 
638
  case `(set -o) 2>/dev/null` in *posix*) set -o posix ;; esac
540
639
fi
541
 
BIN_SH=xpg4; export BIN_SH # for Tru64
542
 
DUALCASE=1; export DUALCASE # for MKS sh
543
 
 
544
 
# A function that is used when there is no print builtin or printf.
545
 
func_fallback_echo ()
546
 
{
547
 
  eval 'cat <<_LTECHO_EOF
548
 
$1
549
 
_LTECHO_EOF'
550
 
}
551
 
 
552
 
# NLS nuisances: We save the old values to restore during execute mode.
553
 
lt_user_locale=
554
 
lt_safe_locale=
555
 
for lt_var in LANG LANGUAGE LC_ALL LC_CTYPE LC_COLLATE LC_MESSAGES
 
640
 
 
641
# NLS nuisances: We save the old values in case they are required later.
 
642
_G_user_locale=
 
643
_G_safe_locale=
 
644
for _G_var in LANG LANGUAGE LC_ALL LC_CTYPE LC_COLLATE LC_MESSAGES
556
645
do
557
 
  eval "if test \"\${$lt_var+set}\" = set; then
558
 
          save_$lt_var=\$$lt_var
559
 
          $lt_var=C
560
 
          export $lt_var
561
 
          lt_user_locale=\"$lt_var=\\\$save_\$lt_var; \$lt_user_locale\"
562
 
          lt_safe_locale=\"$lt_var=C; \$lt_safe_locale\"
 
646
  eval "if test set = \"\${$_G_var+set}\"; then
 
647
          save_$_G_var=\$$_G_var
 
648
          $_G_var=C
 
649
          export $_G_var
 
650
          _G_user_locale=\"$_G_var=\\\$save_\$_G_var; \$_G_user_locale\"
 
651
          _G_safe_locale=\"$_G_var=C; \$_G_safe_locale\"
563
652
        fi"
564
653
done
565
 
LC_ALL=C
566
 
LANGUAGE=C
567
 
export LANGUAGE LC_ALL
568
 
 
569
 
$lt_unset CDPATH
570
 
 
571
 
 
572
 
# Work around backward compatibility issue on IRIX 6.5. On IRIX 6.4+, sh
573
 
# is ksh but when the shell is invoked as "sh" and the current value of
574
 
# the _XPG environment variable is not equal to 1 (one), the special
575
 
# positional parameter $0, within a function call, is the name of the
576
 
# function.
577
 
progpath="$0"
578
 
 
579
 
 
 
654
 
 
655
# CDPATH.
 
656
(unset CDPATH) >/dev/null 2>&1 && unset CDPATH
 
657
 
 
658
# Make sure IFS has a sensible default
 
659
sp=' '
 
660
nl='
 
661
'
 
662
IFS="$sp        $nl"
 
663
 
 
664
# There are apparently some retarded systems that use ';' as a PATH separator!
 
665
if test "${PATH_SEPARATOR+set}" != set; then
 
666
  PATH_SEPARATOR=:
 
667
  (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && {
 
668
    (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 ||
 
669
      PATH_SEPARATOR=';'
 
670
  }
 
671
fi
 
672
 
 
673
 
 
674
 
 
675
## ------------------------- ##
 
676
## Locate command utilities. ##
 
677
## ------------------------- ##
 
678
 
 
679
 
 
680
# func_executable_p FILE
 
681
# ----------------------
 
682
# Check that FILE is an executable regular file.
 
683
func_executable_p ()
 
684
{
 
685
    test -f "$1" && test -x "$1"
 
686
}
 
687
 
 
688
 
 
689
# func_path_progs PROGS_LIST CHECK_FUNC [PATH]
 
690
# --------------------------------------------
 
691
# Search for either a program that responds to --version with output
 
692
# containing "GNU", or else returned by CHECK_FUNC otherwise, by
 
693
# trying all the directories in PATH with each of the elements of
 
694
# PROGS_LIST.
 
695
#
 
696
# CHECK_FUNC should accept the path to a candidate program, and
 
697
# set $func_check_prog_result if it truncates its output less than
 
698
# $_G_path_prog_max characters.
 
699
func_path_progs ()
 
700
{
 
701
    _G_progs_list=$1
 
702
    _G_check_func=$2
 
703
    _G_PATH=${3-"$PATH"}
 
704
 
 
705
    _G_path_prog_max=0
 
706
    _G_path_prog_found=false
 
707
    _G_save_IFS=$IFS; IFS=${PATH_SEPARATOR-:}
 
708
    for _G_dir in $_G_PATH; do
 
709
      IFS=$_G_save_IFS
 
710
      test -z "$_G_dir" && _G_dir=.
 
711
      for _G_prog_name in $_G_progs_list; do
 
712
        for _exeext in '' .EXE; do
 
713
          _G_path_prog=$_G_dir/$_G_prog_name$_exeext
 
714
          func_executable_p "$_G_path_prog" || continue
 
715
          case `"$_G_path_prog" --version 2>&1` in
 
716
            *GNU*) func_path_progs_result=$_G_path_prog _G_path_prog_found=: ;;
 
717
            *)     $_G_check_func $_G_path_prog
 
718
                   func_path_progs_result=$func_check_prog_result
 
719
                   ;;
 
720
          esac
 
721
          $_G_path_prog_found && break 3
 
722
        done
 
723
      done
 
724
    done
 
725
    IFS=$_G_save_IFS
 
726
    test -z "$func_path_progs_result" && {
 
727
      echo "no acceptable sed could be found in \$PATH" >&2
 
728
      exit 1
 
729
    }
 
730
}
 
731
 
 
732
 
 
733
# We want to be able to use the functions in this file before configure
 
734
# has figured out where the best binaries are kept, which means we have
 
735
# to search for them ourselves - except when the results are already set
 
736
# where we skip the searches.
 
737
 
 
738
# Unless the user overrides by setting SED, search the path for either GNU
 
739
# sed, or the sed that truncates its output the least.
 
740
test -z "$SED" && {
 
741
  _G_sed_script=s/aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb/
 
742
  for _G_i in 1 2 3 4 5 6 7; do
 
743
    _G_sed_script=$_G_sed_script$nl$_G_sed_script
 
744
  done
 
745
  echo "$_G_sed_script" 2>/dev/null | sed 99q >conftest.sed
 
746
  _G_sed_script=
 
747
 
 
748
  func_check_prog_sed ()
 
749
  {
 
750
    _G_path_prog=$1
 
751
 
 
752
    _G_count=0
 
753
    printf 0123456789 >conftest.in
 
754
    while :
 
755
    do
 
756
      cat conftest.in conftest.in >conftest.tmp
 
757
      mv conftest.tmp conftest.in
 
758
      cp conftest.in conftest.nl
 
759
      echo '' >> conftest.nl
 
760
      "$_G_path_prog" -f conftest.sed <conftest.nl >conftest.out 2>/dev/null || break
 
761
      diff conftest.out conftest.nl >/dev/null 2>&1 || break
 
762
      _G_count=`expr $_G_count + 1`
 
763
      if test "$_G_count" -gt "$_G_path_prog_max"; then
 
764
        # Best one so far, save it but keep looking for a better one
 
765
        func_check_prog_result=$_G_path_prog
 
766
        _G_path_prog_max=$_G_count
 
767
      fi
 
768
      # 10*(2^10) chars as input seems more than enough
 
769
      test 10 -lt "$_G_count" && break
 
770
    done
 
771
    rm -f conftest.in conftest.tmp conftest.nl conftest.out
 
772
  }
 
773
 
 
774
  func_path_progs "sed gsed" func_check_prog_sed $PATH:/usr/xpg4/bin
 
775
  rm -f conftest.sed
 
776
  SED=$func_path_progs_result
 
777
}
 
778
 
 
779
 
 
780
# Unless the user overrides by setting GREP, search the path for either GNU
 
781
# grep, or the grep that truncates its output the least.
 
782
test -z "$GREP" && {
 
783
  func_check_prog_grep ()
 
784
  {
 
785
    _G_path_prog=$1
 
786
 
 
787
    _G_count=0
 
788
    _G_path_prog_max=0
 
789
    printf 0123456789 >conftest.in
 
790
    while :
 
791
    do
 
792
      cat conftest.in conftest.in >conftest.tmp
 
793
      mv conftest.tmp conftest.in
 
794
      cp conftest.in conftest.nl
 
795
      echo 'GREP' >> conftest.nl
 
796
      "$_G_path_prog" -e 'GREP$' -e '-(cannot match)-' <conftest.nl >conftest.out 2>/dev/null || break
 
797
      diff conftest.out conftest.nl >/dev/null 2>&1 || break
 
798
      _G_count=`expr $_G_count + 1`
 
799
      if test "$_G_count" -gt "$_G_path_prog_max"; then
 
800
        # Best one so far, save it but keep looking for a better one
 
801
        func_check_prog_result=$_G_path_prog
 
802
        _G_path_prog_max=$_G_count
 
803
      fi
 
804
      # 10*(2^10) chars as input seems more than enough
 
805
      test 10 -lt "$_G_count" && break
 
806
    done
 
807
    rm -f conftest.in conftest.tmp conftest.nl conftest.out
 
808
  }
 
809
 
 
810
  func_path_progs "grep ggrep" func_check_prog_grep $PATH:/usr/xpg4/bin
 
811
  GREP=$func_path_progs_result
 
812
}
 
813
 
 
814
 
 
815
## ------------------------------- ##
 
816
## User overridable command paths. ##
 
817
## ------------------------------- ##
 
818
 
 
819
# All uppercase variable names are used for environment variables.  These
 
820
# variables can be overridden by the user before calling a script that
 
821
# uses them if a suitable command of that name is not already available
 
822
# in the command search PATH.
580
823
 
581
824
: ${CP="cp -f"}
582
 
test "${ECHO+set}" = set || ECHO=${as_echo-'printf %s\n'}
 
825
: ${ECHO="printf %s\n"}
 
826
: ${EGREP="$GREP -E"}
 
827
: ${FGREP="$GREP -F"}
 
828
: ${LN_S="ln -s"}
583
829
: ${MAKE="make"}
584
830
: ${MKDIR="mkdir"}
585
831
: ${MV="mv -f"}
586
832
: ${RM="rm -f"}
587
833
: ${SHELL="${CONFIG_SHELL-/bin/sh}"}
588
 
: ${Xsed="$SED -e 1s/^X//"}
589
 
 
590
 
# Global variables:
 
834
 
 
835
 
 
836
## -------------------- ##
 
837
## Useful sed snippets. ##
 
838
## -------------------- ##
 
839
 
 
840
sed_dirname='s|/[^/]*$||'
 
841
sed_basename='s|^.*/||'
 
842
 
 
843
# Sed substitution that helps us do robust quoting.  It backslashifies
 
844
# metacharacters that are still active within double-quoted strings.
 
845
sed_quote_subst='s|\([`"$\\]\)|\\\1|g'
 
846
 
 
847
# Same as above, but do not quote variable references.
 
848
sed_double_quote_subst='s/\(["`\\]\)/\\\1/g'
 
849
 
 
850
# Sed substitution that turns a string into a regex matching for the
 
851
# string literally.
 
852
sed_make_literal_regex='s|[].[^$\\*\/]|\\&|g'
 
853
 
 
854
# Sed substitution that converts a w32 file name or path
 
855
# that contains forward slashes, into one that contains
 
856
# (escaped) backslashes.  A very naive implementation.
 
857
sed_naive_backslashify='s|\\\\*|\\|g;s|/|\\|g;s|\\|\\\\|g'
 
858
 
 
859
# Re-'\' parameter expansions in output of sed_double_quote_subst that
 
860
# were '\'-ed in input to the same.  If an odd number of '\' preceded a
 
861
# '$' in input to sed_double_quote_subst, that '$' was protected from
 
862
# expansion.  Since each input '\' is now two '\'s, look for any number
 
863
# of runs of four '\'s followed by two '\'s and then a '$'.  '\' that '$'.
 
864
_G_bs='\\'
 
865
_G_bs2='\\\\'
 
866
_G_bs4='\\\\\\\\'
 
867
_G_dollar='\$'
 
868
sed_double_backslash="\
 
869
  s/$_G_bs4/&\\
 
870
/g
 
871
  s/^$_G_bs2$_G_dollar/$_G_bs&/
 
872
  s/\\([^$_G_bs]\\)$_G_bs2$_G_dollar/\\1$_G_bs2$_G_bs$_G_dollar/g
 
873
  s/\n//g"
 
874
 
 
875
 
 
876
## ----------------- ##
 
877
## Global variables. ##
 
878
## ----------------- ##
 
879
 
 
880
# Except for the global variables explicitly listed below, the following
 
881
# functions in the '^func_' namespace, and the '^require_' namespace
 
882
# variables initialised in the 'Resource management' section, sourcing
 
883
# this file will not pollute your global namespace with anything
 
884
# else. There's no portable way to scope variables in Bourne shell
 
885
# though, so actually running these functions will sometimes place
 
886
# results into a variable named after the function, and often use
 
887
# temporary variables in the '^_G_' namespace. If you are careful to
 
888
# avoid using those namespaces casually in your sourcing script, things
 
889
# should continue to work as you expect. And, of course, you can freely
 
890
# overwrite any of the functions or variables defined here before
 
891
# calling anything to customize them.
 
892
 
591
893
EXIT_SUCCESS=0
592
894
EXIT_FAILURE=1
593
895
EXIT_MISMATCH=63  # $? = 63 is used to indicate version mismatch to missing.
594
896
EXIT_SKIP=77      # $? = 77 is used to indicate a skipped test to automake.
595
897
 
 
898
# Allow overriding, eg assuming that you follow the convention of
 
899
# putting '$debug_cmd' at the start of all your functions, you can get
 
900
# bash to show function call trace with:
 
901
#
 
902
#    debug_cmd='eval echo "${FUNCNAME[0]} $*" >&2' bash your-script-name
 
903
debug_cmd=${debug_cmd-":"}
 
904
exit_cmd=:
 
905
 
 
906
# By convention, finish your script with:
 
907
#
 
908
#    exit $exit_status
 
909
#
 
910
# so that you can set exit_status to non-zero if you want to indicate
 
911
# something went wrong during execution without actually bailing out at
 
912
# the point of failure.
596
913
exit_status=$EXIT_SUCCESS
597
914
 
598
 
# Make sure IFS has a sensible default
599
 
lt_nl='
600
 
'
601
 
IFS="   $lt_nl"
602
 
 
603
 
dirname="s,/[^/]*$,,"
604
 
basename="s,^.*/,,"
605
 
 
606
 
# func_dirname file append nondir_replacement
607
 
# Compute the dirname of FILE.  If nonempty, add APPEND to the result,
608
 
# otherwise set result to NONDIR_REPLACEMENT.
609
 
func_dirname ()
610
 
{
611
 
    case ${1} in
612
 
      */*) func_dirname_result="${1%/*}${2}" ;;
613
 
      *  ) func_dirname_result="${3}" ;;
614
 
    esac
615
 
} # Extended-shell func_dirname implementation
616
 
 
617
 
 
618
 
# func_basename file
619
 
func_basename ()
620
 
{
621
 
    func_basename_result="${1##*/}"
622
 
} # Extended-shell func_basename implementation
623
 
 
624
 
 
625
 
# func_dirname_and_basename file append nondir_replacement
626
 
# perform func_basename and func_dirname in a single function
627
 
# call:
628
 
#   dirname:  Compute the dirname of FILE.  If nonempty,
629
 
#             add APPEND to the result, otherwise set result
630
 
#             to NONDIR_REPLACEMENT.
631
 
#             value returned in "$func_dirname_result"
632
 
#   basename: Compute filename of FILE.
633
 
#             value retuned in "$func_basename_result"
634
 
# Implementation must be kept synchronized with func_dirname
635
 
# and func_basename. For efficiency, we do not delegate to
636
 
# those functions but instead duplicate the functionality here.
637
 
func_dirname_and_basename ()
638
 
{
639
 
    case ${1} in
640
 
      */*) func_dirname_result="${1%/*}${2}" ;;
641
 
      *  ) func_dirname_result="${3}" ;;
642
 
    esac
643
 
    func_basename_result="${1##*/}"
644
 
} # Extended-shell func_dirname_and_basename implementation
645
 
 
646
 
 
647
 
# func_stripname prefix suffix name
648
 
# strip PREFIX and SUFFIX off of NAME.
649
 
# PREFIX and SUFFIX must not contain globbing or regex special
650
 
# characters, hashes, percent signs, but SUFFIX may contain a leading
651
 
# dot (in which case that matches only a dot).
652
 
# func_strip_suffix prefix name
653
 
func_stripname ()
654
 
{
655
 
    # pdksh 5.2.14 does not do ${X%$Y} correctly if both X and Y are
656
 
    # positional parameters, so assign one to ordinary parameter first.
657
 
    func_stripname_result=${3}
658
 
    func_stripname_result=${func_stripname_result#"${1}"}
659
 
    func_stripname_result=${func_stripname_result%"${2}"}
660
 
} # Extended-shell func_stripname implementation
661
 
 
662
 
 
663
 
# These SED scripts presuppose an absolute path with a trailing slash.
664
 
pathcar='s,^/\([^/]*\).*$,\1,'
665
 
pathcdr='s,^/[^/]*,,'
666
 
removedotparts=':dotsl
667
 
                s@/\./@/@g
668
 
                t dotsl
669
 
                s,/\.$,/,'
670
 
collapseslashes='s@/\{1,\}@/@g'
671
 
finalslash='s,/*$,/,'
672
 
 
673
 
# func_normal_abspath PATH
674
 
# Remove doubled-up and trailing slashes, "." path components,
675
 
# and cancel out any ".." path components in PATH after making
676
 
# it an absolute path.
677
 
#             value returned in "$func_normal_abspath_result"
678
 
func_normal_abspath ()
679
 
{
680
 
  # Start from root dir and reassemble the path.
681
 
  func_normal_abspath_result=
682
 
  func_normal_abspath_tpath=$1
683
 
  func_normal_abspath_altnamespace=
684
 
  case $func_normal_abspath_tpath in
685
 
    "")
686
 
      # Empty path, that just means $cwd.
687
 
      func_stripname '' '/' "`pwd`"
688
 
      func_normal_abspath_result=$func_stripname_result
689
 
      return
690
 
    ;;
691
 
    # The next three entries are used to spot a run of precisely
692
 
    # two leading slashes without using negated character classes;
693
 
    # we take advantage of case's first-match behaviour.
694
 
    ///*)
695
 
      # Unusual form of absolute path, do nothing.
696
 
    ;;
697
 
    //*)
698
 
      # Not necessarily an ordinary path; POSIX reserves leading '//'
699
 
      # and for example Cygwin uses it to access remote file shares
700
 
      # over CIFS/SMB, so we conserve a leading double slash if found.
701
 
      func_normal_abspath_altnamespace=/
702
 
    ;;
703
 
    /*)
704
 
      # Absolute path, do nothing.
705
 
    ;;
706
 
    *)
707
 
      # Relative path, prepend $cwd.
708
 
      func_normal_abspath_tpath=`pwd`/$func_normal_abspath_tpath
709
 
    ;;
710
 
  esac
711
 
  # Cancel out all the simple stuff to save iterations.  We also want
712
 
  # the path to end with a slash for ease of parsing, so make sure
713
 
  # there is one (and only one) here.
714
 
  func_normal_abspath_tpath=`$ECHO "$func_normal_abspath_tpath" | $SED \
715
 
        -e "$removedotparts" -e "$collapseslashes" -e "$finalslash"`
716
 
  while :; do
717
 
    # Processed it all yet?
718
 
    if test "$func_normal_abspath_tpath" = / ; then
719
 
      # If we ascended to the root using ".." the result may be empty now.
720
 
      if test -z "$func_normal_abspath_result" ; then
721
 
        func_normal_abspath_result=/
722
 
      fi
723
 
      break
724
 
    fi
725
 
    func_normal_abspath_tcomponent=`$ECHO "$func_normal_abspath_tpath" | $SED \
726
 
        -e "$pathcar"`
727
 
    func_normal_abspath_tpath=`$ECHO "$func_normal_abspath_tpath" | $SED \
728
 
        -e "$pathcdr"`
729
 
    # Figure out what to do with it
730
 
    case $func_normal_abspath_tcomponent in
731
 
      "")
732
 
        # Trailing empty path component, ignore it.
733
 
      ;;
734
 
      ..)
735
 
        # Parent dir; strip last assembled component from result.
736
 
        func_dirname "$func_normal_abspath_result"
737
 
        func_normal_abspath_result=$func_dirname_result
738
 
      ;;
739
 
      *)
740
 
        # Actual path component, append it.
741
 
        func_normal_abspath_result=$func_normal_abspath_result/$func_normal_abspath_tcomponent
742
 
      ;;
743
 
    esac
744
 
  done
745
 
  # Restore leading double-slash if one was found on entry.
746
 
  func_normal_abspath_result=$func_normal_abspath_altnamespace$func_normal_abspath_result
747
 
}
748
 
 
749
 
# func_relative_path SRCDIR DSTDIR
750
 
# generates a relative path from SRCDIR to DSTDIR, with a trailing
751
 
# slash if non-empty, suitable for immediately appending a filename
752
 
# without needing to append a separator.
753
 
#             value returned in "$func_relative_path_result"
754
 
func_relative_path ()
755
 
{
756
 
  func_relative_path_result=
757
 
  func_normal_abspath "$1"
758
 
  func_relative_path_tlibdir=$func_normal_abspath_result
759
 
  func_normal_abspath "$2"
760
 
  func_relative_path_tbindir=$func_normal_abspath_result
761
 
 
762
 
  # Ascend the tree starting from libdir
763
 
  while :; do
764
 
    # check if we have found a prefix of bindir
765
 
    case $func_relative_path_tbindir in
766
 
      $func_relative_path_tlibdir)
767
 
        # found an exact match
768
 
        func_relative_path_tcancelled=
769
 
        break
770
 
        ;;
771
 
      $func_relative_path_tlibdir*)
772
 
        # found a matching prefix
773
 
        func_stripname "$func_relative_path_tlibdir" '' "$func_relative_path_tbindir"
774
 
        func_relative_path_tcancelled=$func_stripname_result
775
 
        if test -z "$func_relative_path_result"; then
776
 
          func_relative_path_result=.
777
 
        fi
778
 
        break
779
 
        ;;
780
 
      *)
781
 
        func_dirname $func_relative_path_tlibdir
782
 
        func_relative_path_tlibdir=${func_dirname_result}
783
 
        if test "x$func_relative_path_tlibdir" = x ; then
784
 
          # Have to descend all the way to the root!
785
 
          func_relative_path_result=../$func_relative_path_result
786
 
          func_relative_path_tcancelled=$func_relative_path_tbindir
787
 
          break
788
 
        fi
789
 
        func_relative_path_result=../$func_relative_path_result
790
 
        ;;
791
 
    esac
792
 
  done
793
 
 
794
 
  # Now calculate path; take care to avoid doubling-up slashes.
795
 
  func_stripname '' '/' "$func_relative_path_result"
796
 
  func_relative_path_result=$func_stripname_result
797
 
  func_stripname '/' '/' "$func_relative_path_tcancelled"
798
 
  if test "x$func_stripname_result" != x ; then
799
 
    func_relative_path_result=${func_relative_path_result}/${func_stripname_result}
800
 
  fi
801
 
 
802
 
  # Normalisation. If bindir is libdir, return empty string,
803
 
  # else relative path ending with a slash; either way, target
804
 
  # file name can be directly appended.
805
 
  if test ! -z "$func_relative_path_result"; then
806
 
    func_stripname './' '' "$func_relative_path_result/"
807
 
    func_relative_path_result=$func_stripname_result
808
 
  fi
809
 
}
810
 
 
811
 
# The name of this program:
812
 
func_dirname_and_basename "$progpath"
813
 
progname=$func_basename_result
814
 
 
815
 
# Make sure we have an absolute path for reexecution:
 
915
# Work around backward compatibility issue on IRIX 6.5. On IRIX 6.4+, sh
 
916
# is ksh but when the shell is invoked as "sh" and the current value of
 
917
# the _XPG environment variable is not equal to 1 (one), the special
 
918
# positional parameter $0, within a function call, is the name of the
 
919
# function.
 
920
progpath=$0
 
921
 
 
922
# The name of this program.
 
923
progname=`$ECHO "$progpath" |$SED "$sed_basename"`
 
924
 
 
925
# Make sure we have an absolute progpath for reexecution:
816
926
case $progpath in
817
927
  [\\/]*|[A-Za-z]:\\*) ;;
818
928
  *[\\/]*)
819
 
     progdir=$func_dirname_result
 
929
     progdir=`$ECHO "$progpath" |$SED "$sed_dirname"`
820
930
     progdir=`cd "$progdir" && pwd`
821
 
     progpath="$progdir/$progname"
 
931
     progpath=$progdir/$progname
822
932
     ;;
823
933
  *)
824
 
     save_IFS="$IFS"
 
934
     _G_IFS=$IFS
825
935
     IFS=${PATH_SEPARATOR-:}
826
936
     for progdir in $PATH; do
827
 
       IFS="$save_IFS"
 
937
       IFS=$_G_IFS
828
938
       test -x "$progdir/$progname" && break
829
939
     done
830
 
     IFS="$save_IFS"
 
940
     IFS=$_G_IFS
831
941
     test -n "$progdir" || progdir=`pwd`
832
 
     progpath="$progdir/$progname"
 
942
     progpath=$progdir/$progname
833
943
     ;;
834
944
esac
835
945
 
836
 
# Sed substitution that helps us do robust quoting.  It backslashifies
837
 
# metacharacters that are still active within double-quoted strings.
838
 
Xsed="${SED}"' -e 1s/^X//'
839
 
sed_quote_subst='s/\([`"$\\]\)/\\\1/g'
840
 
 
841
 
# Same as above, but do not quote variable references.
842
 
double_quote_subst='s/\(["`\\]\)/\\\1/g'
843
 
 
844
 
# Sed substitution that turns a string into a regex matching for the
845
 
# string literally.
846
 
sed_make_literal_regex='s,[].[^$\\*\/],\\&,g'
847
 
 
848
 
# Sed substitution that converts a w32 file name or path
849
 
# which contains forward slashes, into one that contains
850
 
# (escaped) backslashes.  A very naive implementation.
851
 
lt_sed_naive_backslashify='s|\\\\*|\\|g;s|/|\\|g;s|\\|\\\\|g'
852
 
 
853
 
# Re-`\' parameter expansions in output of double_quote_subst that were
854
 
# `\'-ed in input to the same.  If an odd number of `\' preceded a '$'
855
 
# in input to double_quote_subst, that '$' was protected from expansion.
856
 
# Since each input `\' is now two `\'s, look for any number of runs of
857
 
# four `\'s followed by two `\'s and then a '$'.  `\' that '$'.
858
 
bs='\\'
859
 
bs2='\\\\'
860
 
bs4='\\\\\\\\'
861
 
dollar='\$'
862
 
sed_double_backslash="\
863
 
  s/$bs4/&\\
864
 
/g
865
 
  s/^$bs2$dollar/$bs&/
866
 
  s/\\([^$bs]\\)$bs2$dollar/\\1$bs2$bs$dollar/g
867
 
  s/\n//g"
868
 
 
869
 
# Standard options:
 
946
 
 
947
## ----------------- ##
 
948
## Standard options. ##
 
949
## ----------------- ##
 
950
 
 
951
# The following options affect the operation of the functions defined
 
952
# below, and should be set appropriately depending on run-time para-
 
953
# meters passed on the command line.
 
954
 
870
955
opt_dry_run=false
871
 
opt_help=false
872
956
opt_quiet=false
873
957
opt_verbose=false
874
 
opt_warning=:
875
 
 
876
 
# func_echo arg...
877
 
# Echo program name prefixed message, along with the current mode
878
 
# name if it has been set yet.
 
958
 
 
959
# Categories 'all' and 'none' are always available.  Append any others
 
960
# you will pass as the first argument to func_warning from your own
 
961
# code.
 
962
warning_categories=
 
963
 
 
964
# By default, display warnings according to 'opt_warning_types'.  Set
 
965
# 'warning_func'  to ':' to elide all warnings, or func_fatal_error to
 
966
# treat the next displayed warning as a fatal error.
 
967
warning_func=func_warn_and_continue
 
968
 
 
969
# Set to 'all' to display all warnings, 'none' to suppress all
 
970
# warnings, or a space delimited list of some subset of
 
971
# 'warning_categories' to display only the listed warnings.
 
972
opt_warning_types=all
 
973
 
 
974
 
 
975
## -------------------- ##
 
976
## Resource management. ##
 
977
## -------------------- ##
 
978
 
 
979
# This section contains definitions for functions that each ensure a
 
980
# particular resource (a file, or a non-empty configuration variable for
 
981
# example) is available, and if appropriate to extract default values
 
982
# from pertinent package files. Call them using their associated
 
983
# 'require_*' variable to ensure that they are executed, at most, once.
 
984
#
 
985
# It's entirely deliberate that calling these functions can set
 
986
# variables that don't obey the namespace limitations obeyed by the rest
 
987
# of this file, in order that that they be as useful as possible to
 
988
# callers.
 
989
 
 
990
 
 
991
# require_term_colors
 
992
# -------------------
 
993
# Allow display of bold text on terminals that support it.
 
994
require_term_colors=func_require_term_colors
 
995
func_require_term_colors ()
 
996
{
 
997
    $debug_cmd
 
998
 
 
999
    test -t 1 && {
 
1000
      # COLORTERM and USE_ANSI_COLORS environment variables take
 
1001
      # precedence, because most terminfo databases neglect to describe
 
1002
      # whether color sequences are supported.
 
1003
      test -n "${COLORTERM+set}" && : ${USE_ANSI_COLORS="1"}
 
1004
 
 
1005
      if test 1 = "$USE_ANSI_COLORS"; then
 
1006
        # Standard ANSI escape sequences
 
1007
        tc_reset=''
 
1008
        tc_bold='';   tc_standout=''
 
1009
        tc_red='';   tc_green=''
 
1010
        tc_blue='';  tc_cyan=''
 
1011
      else
 
1012
        # Otherwise trust the terminfo database after all.
 
1013
        test -n "`tput sgr0 2>/dev/null`" && {
 
1014
          tc_reset=`tput sgr0`
 
1015
          test -n "`tput bold 2>/dev/null`" && tc_bold=`tput bold`
 
1016
          tc_standout=$tc_bold
 
1017
          test -n "`tput smso 2>/dev/null`" && tc_standout=`tput smso`
 
1018
          test -n "`tput setaf 1 2>/dev/null`" && tc_red=`tput setaf 1`
 
1019
          test -n "`tput setaf 2 2>/dev/null`" && tc_green=`tput setaf 2`
 
1020
          test -n "`tput setaf 4 2>/dev/null`" && tc_blue=`tput setaf 4`
 
1021
          test -n "`tput setaf 5 2>/dev/null`" && tc_cyan=`tput setaf 5`
 
1022
        }
 
1023
      fi
 
1024
    }
 
1025
 
 
1026
    require_term_colors=:
 
1027
}
 
1028
 
 
1029
 
 
1030
## ----------------- ##
 
1031
## Function library. ##
 
1032
## ----------------- ##
 
1033
 
 
1034
# This section contains a variety of useful functions to call in your
 
1035
# scripts. Take note of the portable wrappers for features provided by
 
1036
# some modern shells, which will fall back to slower equivalents on
 
1037
# less featureful shells.
 
1038
 
 
1039
 
 
1040
# func_append VAR VALUE
 
1041
# ---------------------
 
1042
# Append VALUE onto the existing contents of VAR.
 
1043
 
 
1044
  # We should try to minimise forks, especially on Windows where they are
 
1045
  # unreasonably slow, so skip the feature probes when bash or zsh are
 
1046
  # being used:
 
1047
  if test set = "${BASH_VERSION+set}${ZSH_VERSION+set}"; then
 
1048
    : ${_G_HAVE_ARITH_OP="yes"}
 
1049
    : ${_G_HAVE_XSI_OPS="yes"}
 
1050
    # The += operator was introduced in bash 3.1
 
1051
    case $BASH_VERSION in
 
1052
      [12].* | 3.0 | 3.0*) ;;
 
1053
      *)
 
1054
        : ${_G_HAVE_PLUSEQ_OP="yes"}
 
1055
        ;;
 
1056
    esac
 
1057
  fi
 
1058
 
 
1059
  # _G_HAVE_PLUSEQ_OP
 
1060
  # Can be empty, in which case the shell is probed, "yes" if += is
 
1061
  # useable or anything else if it does not work.
 
1062
  test -z "$_G_HAVE_PLUSEQ_OP" \
 
1063
    && (eval 'x=a; x+=" b"; test "a b" = "$x"') 2>/dev/null \
 
1064
    && _G_HAVE_PLUSEQ_OP=yes
 
1065
 
 
1066
if test yes = "$_G_HAVE_PLUSEQ_OP"
 
1067
then
 
1068
  # This is an XSI compatible shell, allowing a faster implementation...
 
1069
  eval 'func_append ()
 
1070
  {
 
1071
    $debug_cmd
 
1072
 
 
1073
    eval "$1+=\$2"
 
1074
  }'
 
1075
else
 
1076
  # ...otherwise fall back to using expr, which is often a shell builtin.
 
1077
  func_append ()
 
1078
  {
 
1079
    $debug_cmd
 
1080
 
 
1081
    eval "$1=\$$1\$2"
 
1082
  }
 
1083
fi
 
1084
 
 
1085
 
 
1086
# func_append_quoted VAR VALUE
 
1087
# ----------------------------
 
1088
# Quote VALUE and append to the end of shell variable VAR, separated
 
1089
# by a space.
 
1090
if test yes = "$_G_HAVE_PLUSEQ_OP"; then
 
1091
  eval 'func_append_quoted ()
 
1092
  {
 
1093
    $debug_cmd
 
1094
 
 
1095
    func_quote_for_eval "$2"
 
1096
    eval "$1+=\\ \$func_quote_for_eval_result"
 
1097
  }'
 
1098
else
 
1099
  func_append_quoted ()
 
1100
  {
 
1101
    $debug_cmd
 
1102
 
 
1103
    func_quote_for_eval "$2"
 
1104
    eval "$1=\$$1\\ \$func_quote_for_eval_result"
 
1105
  }
 
1106
fi
 
1107
 
 
1108
 
 
1109
# func_append_uniq VAR VALUE
 
1110
# --------------------------
 
1111
# Append unique VALUE onto the existing contents of VAR, assuming
 
1112
# entries are delimited by the first character of VALUE.  For example:
 
1113
#
 
1114
#   func_append_uniq options " --another-option option-argument"
 
1115
#
 
1116
# will only append to $options if " --another-option option-argument "
 
1117
# is not already present somewhere in $options already (note spaces at
 
1118
# each end implied by leading space in second argument).
 
1119
func_append_uniq ()
 
1120
{
 
1121
    $debug_cmd
 
1122
 
 
1123
    eval _G_current_value='`$ECHO $'$1'`'
 
1124
    _G_delim=`expr "$2" : '\(.\)'`
 
1125
 
 
1126
    case $_G_delim$_G_current_value$_G_delim in
 
1127
      *"$2$_G_delim"*) ;;
 
1128
      *) func_append "$@" ;;
 
1129
    esac
 
1130
}
 
1131
 
 
1132
 
 
1133
# func_arith TERM...
 
1134
# ------------------
 
1135
# Set func_arith_result to the result of evaluating TERMs.
 
1136
  test -z "$_G_HAVE_ARITH_OP" \
 
1137
    && (eval 'test 2 = $(( 1 + 1 ))') 2>/dev/null \
 
1138
    && _G_HAVE_ARITH_OP=yes
 
1139
 
 
1140
if test yes = "$_G_HAVE_ARITH_OP"; then
 
1141
  eval 'func_arith ()
 
1142
  {
 
1143
    $debug_cmd
 
1144
 
 
1145
    func_arith_result=$(( $* ))
 
1146
  }'
 
1147
else
 
1148
  func_arith ()
 
1149
  {
 
1150
    $debug_cmd
 
1151
 
 
1152
    func_arith_result=`expr "$@"`
 
1153
  }
 
1154
fi
 
1155
 
 
1156
 
 
1157
# func_basename FILE
 
1158
# ------------------
 
1159
# Set func_basename_result to FILE with everything up to and including
 
1160
# the last / stripped.
 
1161
if test yes = "$_G_HAVE_XSI_OPS"; then
 
1162
  # If this shell supports suffix pattern removal, then use it to avoid
 
1163
  # forking. Hide the definitions single quotes in case the shell chokes
 
1164
  # on unsupported syntax...
 
1165
  _b='func_basename_result=${1##*/}'
 
1166
  _d='case $1 in
 
1167
        */*) func_dirname_result=${1%/*}$2 ;;
 
1168
        *  ) func_dirname_result=$3        ;;
 
1169
      esac'
 
1170
 
 
1171
else
 
1172
  # ...otherwise fall back to using sed.
 
1173
  _b='func_basename_result=`$ECHO "$1" |$SED "$sed_basename"`'
 
1174
  _d='func_dirname_result=`$ECHO "$1"  |$SED "$sed_dirname"`
 
1175
      if test "X$func_dirname_result" = "X$1"; then
 
1176
        func_dirname_result=$3
 
1177
      else
 
1178
        func_append func_dirname_result "$2"
 
1179
      fi'
 
1180
fi
 
1181
 
 
1182
eval 'func_basename ()
 
1183
{
 
1184
    $debug_cmd
 
1185
 
 
1186
    '"$_b"'
 
1187
}'
 
1188
 
 
1189
 
 
1190
# func_dirname FILE APPEND NONDIR_REPLACEMENT
 
1191
# -------------------------------------------
 
1192
# Compute the dirname of FILE.  If nonempty, add APPEND to the result,
 
1193
# otherwise set result to NONDIR_REPLACEMENT.
 
1194
eval 'func_dirname ()
 
1195
{
 
1196
    $debug_cmd
 
1197
 
 
1198
    '"$_d"'
 
1199
}'
 
1200
 
 
1201
 
 
1202
# func_dirname_and_basename FILE APPEND NONDIR_REPLACEMENT
 
1203
# --------------------------------------------------------
 
1204
# Perform func_basename and func_dirname in a single function
 
1205
# call:
 
1206
#   dirname:  Compute the dirname of FILE.  If nonempty,
 
1207
#             add APPEND to the result, otherwise set result
 
1208
#             to NONDIR_REPLACEMENT.
 
1209
#             value returned in "$func_dirname_result"
 
1210
#   basename: Compute filename of FILE.
 
1211
#             value retuned in "$func_basename_result"
 
1212
# For efficiency, we do not delegate to the functions above but instead
 
1213
# duplicate the functionality here.
 
1214
eval 'func_dirname_and_basename ()
 
1215
{
 
1216
    $debug_cmd
 
1217
 
 
1218
    '"$_b"'
 
1219
    '"$_d"'
 
1220
}'
 
1221
 
 
1222
 
 
1223
# func_echo ARG...
 
1224
# ----------------
 
1225
# Echo program name prefixed message.
879
1226
func_echo ()
880
1227
{
881
 
    $ECHO "$progname: ${opt_mode+$opt_mode: }$*"
882
 
}
883
 
 
884
 
# func_verbose arg...
885
 
# Echo program name prefixed message in verbose mode only.
886
 
func_verbose ()
887
 
{
888
 
    $opt_verbose && func_echo ${1+"$@"}
889
 
 
890
 
    # A bug in bash halts the script if the last line of a function
891
 
    # fails when set -e is in force, so we need another command to
892
 
    # work around that:
893
 
    :
894
 
}
895
 
 
896
 
# func_echo_all arg...
 
1228
    $debug_cmd
 
1229
 
 
1230
    _G_message=$*
 
1231
 
 
1232
    func_echo_IFS=$IFS
 
1233
    IFS=$nl
 
1234
    for _G_line in $_G_message; do
 
1235
      IFS=$func_echo_IFS
 
1236
      $ECHO "$progname: $_G_line"
 
1237
    done
 
1238
    IFS=$func_echo_IFS
 
1239
}
 
1240
 
 
1241
 
 
1242
# func_echo_all ARG...
 
1243
# --------------------
897
1244
# Invoke $ECHO with all args, space-separated.
898
1245
func_echo_all ()
899
1246
{
900
1247
    $ECHO "$*"
901
1248
}
902
1249
 
903
 
# func_error arg...
 
1250
 
 
1251
# func_echo_infix_1 INFIX ARG...
 
1252
# ------------------------------
 
1253
# Echo program name, followed by INFIX on the first line, with any
 
1254
# additional lines not showing INFIX.
 
1255
func_echo_infix_1 ()
 
1256
{
 
1257
    $debug_cmd
 
1258
 
 
1259
    $require_term_colors
 
1260
 
 
1261
    _G_infix=$1; shift
 
1262
    _G_indent=$_G_infix
 
1263
    _G_prefix="$progname: $_G_infix: "
 
1264
    _G_message=$*
 
1265
 
 
1266
    # Strip color escape sequences before counting printable length
 
1267
    for _G_tc in "$tc_reset" "$tc_bold" "$tc_standout" "$tc_red" "$tc_green" "$tc_blue" "$tc_cyan"
 
1268
    do
 
1269
      test -n "$_G_tc" && {
 
1270
        _G_esc_tc=`$ECHO "$_G_tc" | $SED "$sed_make_literal_regex"`
 
1271
        _G_indent=`$ECHO "$_G_indent" | $SED "s|$_G_esc_tc||g"`
 
1272
      }
 
1273
    done
 
1274
    _G_indent="$progname: "`echo "$_G_indent" | $SED 's|.| |g'`"  " ## exclude from sc_prohibit_nested_quotes
 
1275
 
 
1276
    func_echo_infix_1_IFS=$IFS
 
1277
    IFS=$nl
 
1278
    for _G_line in $_G_message; do
 
1279
      IFS=$func_echo_infix_1_IFS
 
1280
      $ECHO "$_G_prefix$tc_bold$_G_line$tc_reset" >&2
 
1281
      _G_prefix=$_G_indent
 
1282
    done
 
1283
    IFS=$func_echo_infix_1_IFS
 
1284
}
 
1285
 
 
1286
 
 
1287
# func_error ARG...
 
1288
# -----------------
904
1289
# Echo program name prefixed message to standard error.
905
1290
func_error ()
906
1291
{
907
 
    $ECHO "$progname: ${opt_mode+$opt_mode: }"${1+"$@"} 1>&2
908
 
}
909
 
 
910
 
# func_warning arg...
911
 
# Echo program name prefixed warning message to standard error.
912
 
func_warning ()
913
 
{
914
 
    $opt_warning && $ECHO "$progname: ${opt_mode+$opt_mode: }warning: "${1+"$@"} 1>&2
915
 
 
916
 
    # bash bug again:
917
 
    :
918
 
}
919
 
 
920
 
# func_fatal_error arg...
 
1292
    $debug_cmd
 
1293
 
 
1294
    $require_term_colors
 
1295
 
 
1296
    func_echo_infix_1 "  $tc_standout${tc_red}error$tc_reset" "$*" >&2
 
1297
}
 
1298
 
 
1299
 
 
1300
# func_fatal_error ARG...
 
1301
# -----------------------
921
1302
# Echo program name prefixed message to standard error, and exit.
922
1303
func_fatal_error ()
923
1304
{
924
 
    func_error ${1+"$@"}
 
1305
    $debug_cmd
 
1306
 
 
1307
    func_error "$*"
925
1308
    exit $EXIT_FAILURE
926
1309
}
927
1310
 
928
 
# func_fatal_help arg...
929
 
# Echo program name prefixed message to standard error, followed by
930
 
# a help hint, and exit.
931
 
func_fatal_help ()
932
 
{
933
 
    func_error ${1+"$@"}
934
 
    func_fatal_error "$help"
935
 
}
936
 
help="Try \`$progname --help' for more information."  ## default
937
 
 
938
 
 
939
 
# func_grep expression filename
 
1311
 
 
1312
# func_grep EXPRESSION FILENAME
 
1313
# -----------------------------
940
1314
# Check whether EXPRESSION matches any line of FILENAME, without output.
941
1315
func_grep ()
942
1316
{
 
1317
    $debug_cmd
 
1318
 
943
1319
    $GREP "$1" "$2" >/dev/null 2>&1
944
1320
}
945
1321
 
946
1322
 
947
 
# func_mkdir_p directory-path
 
1323
# func_len STRING
 
1324
# ---------------
 
1325
# Set func_len_result to the length of STRING. STRING may not
 
1326
# start with a hyphen.
 
1327
  test -z "$_G_HAVE_XSI_OPS" \
 
1328
    && (eval 'x=a/b/c;
 
1329
      test 5aa/bb/cc = "${#x}${x%%/*}${x%/*}${x#*/}${x##*/}"') 2>/dev/null \
 
1330
    && _G_HAVE_XSI_OPS=yes
 
1331
 
 
1332
if test yes = "$_G_HAVE_XSI_OPS"; then
 
1333
  eval 'func_len ()
 
1334
  {
 
1335
    $debug_cmd
 
1336
 
 
1337
    func_len_result=${#1}
 
1338
  }'
 
1339
else
 
1340
  func_len ()
 
1341
  {
 
1342
    $debug_cmd
 
1343
 
 
1344
    func_len_result=`expr "$1" : ".*" 2>/dev/null || echo $max_cmd_len`
 
1345
  }
 
1346
fi
 
1347
 
 
1348
 
 
1349
# func_mkdir_p DIRECTORY-PATH
 
1350
# ---------------------------
948
1351
# Make sure the entire path to DIRECTORY-PATH is available.
949
1352
func_mkdir_p ()
950
1353
{
951
 
    my_directory_path="$1"
952
 
    my_dir_list=
953
 
 
954
 
    if test -n "$my_directory_path" && test "$opt_dry_run" != ":"; then
955
 
 
956
 
      # Protect directory names starting with `-'
957
 
      case $my_directory_path in
958
 
        -*) my_directory_path="./$my_directory_path" ;;
 
1354
    $debug_cmd
 
1355
 
 
1356
    _G_directory_path=$1
 
1357
    _G_dir_list=
 
1358
 
 
1359
    if test -n "$_G_directory_path" && test : != "$opt_dry_run"; then
 
1360
 
 
1361
      # Protect directory names starting with '-'
 
1362
      case $_G_directory_path in
 
1363
        -*) _G_directory_path=./$_G_directory_path ;;
959
1364
      esac
960
1365
 
961
1366
      # While some portion of DIR does not yet exist...
962
 
      while test ! -d "$my_directory_path"; do
 
1367
      while test ! -d "$_G_directory_path"; do
963
1368
        # ...make a list in topmost first order.  Use a colon delimited
964
1369
        # list incase some portion of path contains whitespace.
965
 
        my_dir_list="$my_directory_path:$my_dir_list"
 
1370
        _G_dir_list=$_G_directory_path:$_G_dir_list
966
1371
 
967
1372
        # If the last portion added has no slash in it, the list is done
968
 
        case $my_directory_path in */*) ;; *) break ;; esac
 
1373
        case $_G_directory_path in */*) ;; *) break ;; esac
969
1374
 
970
1375
        # ...otherwise throw away the child directory and loop
971
 
        my_directory_path=`$ECHO "$my_directory_path" | $SED -e "$dirname"`
 
1376
        _G_directory_path=`$ECHO "$_G_directory_path" | $SED -e "$sed_dirname"`
972
1377
      done
973
 
      my_dir_list=`$ECHO "$my_dir_list" | $SED 's,:*$,,'`
 
1378
      _G_dir_list=`$ECHO "$_G_dir_list" | $SED 's|:*$||'`
974
1379
 
975
 
      save_mkdir_p_IFS="$IFS"; IFS=':'
976
 
      for my_dir in $my_dir_list; do
977
 
        IFS="$save_mkdir_p_IFS"
978
 
        # mkdir can fail with a `File exist' error if two processes
 
1380
      func_mkdir_p_IFS=$IFS; IFS=:
 
1381
      for _G_dir in $_G_dir_list; do
 
1382
        IFS=$func_mkdir_p_IFS
 
1383
        # mkdir can fail with a 'File exist' error if two processes
979
1384
        # try to create one of the directories concurrently.  Don't
980
1385
        # stop in that case!
981
 
        $MKDIR "$my_dir" 2>/dev/null || :
 
1386
        $MKDIR "$_G_dir" 2>/dev/null || :
982
1387
      done
983
 
      IFS="$save_mkdir_p_IFS"
 
1388
      IFS=$func_mkdir_p_IFS
984
1389
 
985
1390
      # Bail out if we (or some other process) failed to create a directory.
986
 
      test -d "$my_directory_path" || \
987
 
        func_fatal_error "Failed to create \`$1'"
 
1391
      test -d "$_G_directory_path" || \
 
1392
        func_fatal_error "Failed to create '$1'"
988
1393
    fi
989
1394
}
990
1395
 
991
1396
 
992
 
# func_mktempdir [string]
 
1397
# func_mktempdir [BASENAME]
 
1398
# -------------------------
993
1399
# Make a temporary directory that won't clash with other running
994
1400
# libtool processes, and avoids race conditions if possible.  If
995
 
# given, STRING is the basename for that directory.
 
1401
# given, BASENAME is the basename for that directory.
996
1402
func_mktempdir ()
997
1403
{
998
 
    my_template="${TMPDIR-/tmp}/${1-$progname}"
999
 
 
1000
 
    if test "$opt_dry_run" = ":"; then
 
1404
    $debug_cmd
 
1405
 
 
1406
    _G_template=${TMPDIR-/tmp}/${1-$progname}
 
1407
 
 
1408
    if test : = "$opt_dry_run"; then
1001
1409
      # Return a directory name, but don't create it in dry-run mode
1002
 
      my_tmpdir="${my_template}-$$"
 
1410
      _G_tmpdir=$_G_template-$$
1003
1411
    else
1004
1412
 
1005
1413
      # If mktemp works, use that first and foremost
1006
 
      my_tmpdir=`mktemp -d "${my_template}-XXXXXXXX" 2>/dev/null`
 
1414
      _G_tmpdir=`mktemp -d "$_G_template-XXXXXXXX" 2>/dev/null`
1007
1415
 
1008
 
      if test ! -d "$my_tmpdir"; then
 
1416
      if test ! -d "$_G_tmpdir"; then
1009
1417
        # Failing that, at least try and use $RANDOM to avoid a race
1010
 
        my_tmpdir="${my_template}-${RANDOM-0}$$"
 
1418
        _G_tmpdir=$_G_template-${RANDOM-0}$$
1011
1419
 
1012
 
        save_mktempdir_umask=`umask`
 
1420
        func_mktempdir_umask=`umask`
1013
1421
        umask 0077
1014
 
        $MKDIR "$my_tmpdir"
1015
 
        umask $save_mktempdir_umask
 
1422
        $MKDIR "$_G_tmpdir"
 
1423
        umask $func_mktempdir_umask
1016
1424
      fi
1017
1425
 
1018
1426
      # If we're not in dry-run mode, bomb out on failure
1019
 
      test -d "$my_tmpdir" || \
1020
 
        func_fatal_error "cannot create temporary directory \`$my_tmpdir'"
1021
 
    fi
1022
 
 
1023
 
    $ECHO "$my_tmpdir"
1024
 
}
1025
 
 
1026
 
 
1027
 
# func_quote_for_eval arg
1028
 
# Aesthetically quote ARG to be evaled later.
1029
 
# This function returns two values: FUNC_QUOTE_FOR_EVAL_RESULT
1030
 
# is double-quoted, suitable for a subsequent eval, whereas
1031
 
# FUNC_QUOTE_FOR_EVAL_UNQUOTED_RESULT has merely all characters
1032
 
# which are still active within double quotes backslashified.
 
1427
      test -d "$_G_tmpdir" || \
 
1428
        func_fatal_error "cannot create temporary directory '$_G_tmpdir'"
 
1429
    fi
 
1430
 
 
1431
    $ECHO "$_G_tmpdir"
 
1432
}
 
1433
 
 
1434
 
 
1435
# func_normal_abspath PATH
 
1436
# ------------------------
 
1437
# Remove doubled-up and trailing slashes, "." path components,
 
1438
# and cancel out any ".." path components in PATH after making
 
1439
# it an absolute path.
 
1440
func_normal_abspath ()
 
1441
{
 
1442
    $debug_cmd
 
1443
 
 
1444
    # These SED scripts presuppose an absolute path with a trailing slash.
 
1445
    _G_pathcar='s|^/\([^/]*\).*$|\1|'
 
1446
    _G_pathcdr='s|^/[^/]*||'
 
1447
    _G_removedotparts=':dotsl
 
1448
                s|/\./|/|g
 
1449
                t dotsl
 
1450
                s|/\.$|/|'
 
1451
    _G_collapseslashes='s|/\{1,\}|/|g'
 
1452
    _G_finalslash='s|/*$|/|'
 
1453
 
 
1454
    # Start from root dir and reassemble the path.
 
1455
    func_normal_abspath_result=
 
1456
    func_normal_abspath_tpath=$1
 
1457
    func_normal_abspath_altnamespace=
 
1458
    case $func_normal_abspath_tpath in
 
1459
      "")
 
1460
        # Empty path, that just means $cwd.
 
1461
        func_stripname '' '/' "`pwd`"
 
1462
        func_normal_abspath_result=$func_stripname_result
 
1463
        return
 
1464
        ;;
 
1465
      # The next three entries are used to spot a run of precisely
 
1466
      # two leading slashes without using negated character classes;
 
1467
      # we take advantage of case's first-match behaviour.
 
1468
      ///*)
 
1469
        # Unusual form of absolute path, do nothing.
 
1470
        ;;
 
1471
      //*)
 
1472
        # Not necessarily an ordinary path; POSIX reserves leading '//'
 
1473
        # and for example Cygwin uses it to access remote file shares
 
1474
        # over CIFS/SMB, so we conserve a leading double slash if found.
 
1475
        func_normal_abspath_altnamespace=/
 
1476
        ;;
 
1477
      /*)
 
1478
        # Absolute path, do nothing.
 
1479
        ;;
 
1480
      *)
 
1481
        # Relative path, prepend $cwd.
 
1482
        func_normal_abspath_tpath=`pwd`/$func_normal_abspath_tpath
 
1483
        ;;
 
1484
    esac
 
1485
 
 
1486
    # Cancel out all the simple stuff to save iterations.  We also want
 
1487
    # the path to end with a slash for ease of parsing, so make sure
 
1488
    # there is one (and only one) here.
 
1489
    func_normal_abspath_tpath=`$ECHO "$func_normal_abspath_tpath" | $SED \
 
1490
          -e "$_G_removedotparts" -e "$_G_collapseslashes" -e "$_G_finalslash"`
 
1491
    while :; do
 
1492
      # Processed it all yet?
 
1493
      if test / = "$func_normal_abspath_tpath"; then
 
1494
        # If we ascended to the root using ".." the result may be empty now.
 
1495
        if test -z "$func_normal_abspath_result"; then
 
1496
          func_normal_abspath_result=/
 
1497
        fi
 
1498
        break
 
1499
      fi
 
1500
      func_normal_abspath_tcomponent=`$ECHO "$func_normal_abspath_tpath" | $SED \
 
1501
          -e "$_G_pathcar"`
 
1502
      func_normal_abspath_tpath=`$ECHO "$func_normal_abspath_tpath" | $SED \
 
1503
          -e "$_G_pathcdr"`
 
1504
      # Figure out what to do with it
 
1505
      case $func_normal_abspath_tcomponent in
 
1506
        "")
 
1507
          # Trailing empty path component, ignore it.
 
1508
          ;;
 
1509
        ..)
 
1510
          # Parent dir; strip last assembled component from result.
 
1511
          func_dirname "$func_normal_abspath_result"
 
1512
          func_normal_abspath_result=$func_dirname_result
 
1513
          ;;
 
1514
        *)
 
1515
          # Actual path component, append it.
 
1516
          func_append func_normal_abspath_result "/$func_normal_abspath_tcomponent"
 
1517
          ;;
 
1518
      esac
 
1519
    done
 
1520
    # Restore leading double-slash if one was found on entry.
 
1521
    func_normal_abspath_result=$func_normal_abspath_altnamespace$func_normal_abspath_result
 
1522
}
 
1523
 
 
1524
 
 
1525
# func_notquiet ARG...
 
1526
# --------------------
 
1527
# Echo program name prefixed message only when not in quiet mode.
 
1528
func_notquiet ()
 
1529
{
 
1530
    $debug_cmd
 
1531
 
 
1532
    $opt_quiet || func_echo ${1+"$@"}
 
1533
 
 
1534
    # A bug in bash halts the script if the last line of a function
 
1535
    # fails when set -e is in force, so we need another command to
 
1536
    # work around that:
 
1537
    :
 
1538
}
 
1539
 
 
1540
 
 
1541
# func_relative_path SRCDIR DSTDIR
 
1542
# --------------------------------
 
1543
# Set func_relative_path_result to the relative path from SRCDIR to DSTDIR.
 
1544
func_relative_path ()
 
1545
{
 
1546
    $debug_cmd
 
1547
 
 
1548
    func_relative_path_result=
 
1549
    func_normal_abspath "$1"
 
1550
    func_relative_path_tlibdir=$func_normal_abspath_result
 
1551
    func_normal_abspath "$2"
 
1552
    func_relative_path_tbindir=$func_normal_abspath_result
 
1553
 
 
1554
    # Ascend the tree starting from libdir
 
1555
    while :; do
 
1556
      # check if we have found a prefix of bindir
 
1557
      case $func_relative_path_tbindir in
 
1558
        $func_relative_path_tlibdir)
 
1559
          # found an exact match
 
1560
          func_relative_path_tcancelled=
 
1561
          break
 
1562
          ;;
 
1563
        $func_relative_path_tlibdir*)
 
1564
          # found a matching prefix
 
1565
          func_stripname "$func_relative_path_tlibdir" '' "$func_relative_path_tbindir"
 
1566
          func_relative_path_tcancelled=$func_stripname_result
 
1567
          if test -z "$func_relative_path_result"; then
 
1568
            func_relative_path_result=.
 
1569
          fi
 
1570
          break
 
1571
          ;;
 
1572
        *)
 
1573
          func_dirname $func_relative_path_tlibdir
 
1574
          func_relative_path_tlibdir=$func_dirname_result
 
1575
          if test -z "$func_relative_path_tlibdir"; then
 
1576
            # Have to descend all the way to the root!
 
1577
            func_relative_path_result=../$func_relative_path_result
 
1578
            func_relative_path_tcancelled=$func_relative_path_tbindir
 
1579
            break
 
1580
          fi
 
1581
          func_relative_path_result=../$func_relative_path_result
 
1582
          ;;
 
1583
      esac
 
1584
    done
 
1585
 
 
1586
    # Now calculate path; take care to avoid doubling-up slashes.
 
1587
    func_stripname '' '/' "$func_relative_path_result"
 
1588
    func_relative_path_result=$func_stripname_result
 
1589
    func_stripname '/' '/' "$func_relative_path_tcancelled"
 
1590
    if test -n "$func_stripname_result"; then
 
1591
      func_append func_relative_path_result "/$func_stripname_result"
 
1592
    fi
 
1593
 
 
1594
    # Normalisation. If bindir is libdir, return '.' else relative path.
 
1595
    if test -n "$func_relative_path_result"; then
 
1596
      func_stripname './' '' "$func_relative_path_result"
 
1597
      func_relative_path_result=$func_stripname_result
 
1598
    fi
 
1599
 
 
1600
    test -n "$func_relative_path_result" || func_relative_path_result=.
 
1601
 
 
1602
    :
 
1603
}
 
1604
 
 
1605
 
 
1606
# func_quote_for_eval ARG...
 
1607
# --------------------------
 
1608
# Aesthetically quote ARGs to be evaled later.
 
1609
# This function returns two values:
 
1610
#   i) func_quote_for_eval_result
 
1611
#      double-quoted, suitable for a subsequent eval
 
1612
#  ii) func_quote_for_eval_unquoted_result
 
1613
#      has all characters that are still active within double
 
1614
#      quotes backslashified.
1033
1615
func_quote_for_eval ()
1034
1616
{
1035
 
    case $1 in
1036
 
      *[\\\`\"\$]*)
1037
 
        func_quote_for_eval_unquoted_result=`$ECHO "$1" | $SED "$sed_quote_subst"` ;;
1038
 
      *)
1039
 
        func_quote_for_eval_unquoted_result="$1" ;;
1040
 
    esac
1041
 
 
1042
 
    case $func_quote_for_eval_unquoted_result in
1043
 
      # Double-quote args containing shell metacharacters to delay
1044
 
      # word splitting, command substitution and and variable
1045
 
      # expansion for a subsequent eval.
1046
 
      # Many Bourne shells cannot handle close brackets correctly
1047
 
      # in scan sets, so we specify it separately.
1048
 
      *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \     ]*|*]*|"")
1049
 
        func_quote_for_eval_result="\"$func_quote_for_eval_unquoted_result\""
1050
 
        ;;
1051
 
      *)
1052
 
        func_quote_for_eval_result="$func_quote_for_eval_unquoted_result"
1053
 
    esac
 
1617
    $debug_cmd
 
1618
 
 
1619
    func_quote_for_eval_unquoted_result=
 
1620
    func_quote_for_eval_result=
 
1621
    while test 0 -lt $#; do
 
1622
      case $1 in
 
1623
        *[\\\`\"\$]*)
 
1624
          _G_unquoted_arg=`printf '%s\n' "$1" |$SED "$sed_quote_subst"` ;;
 
1625
        *)
 
1626
          _G_unquoted_arg=$1 ;;
 
1627
      esac
 
1628
      if test -n "$func_quote_for_eval_unquoted_result"; then
 
1629
        func_append func_quote_for_eval_unquoted_result " $_G_unquoted_arg"
 
1630
      else
 
1631
        func_append func_quote_for_eval_unquoted_result "$_G_unquoted_arg"
 
1632
      fi
 
1633
 
 
1634
      case $_G_unquoted_arg in
 
1635
        # Double-quote args containing shell metacharacters to delay
 
1636
        # word splitting, command substitution and variable expansion
 
1637
        # for a subsequent eval.
 
1638
        # Many Bourne shells cannot handle close brackets correctly
 
1639
        # in scan sets, so we specify it separately.
 
1640
        *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \   ]*|*]*|"")
 
1641
          _G_quoted_arg=\"$_G_unquoted_arg\"
 
1642
          ;;
 
1643
        *)
 
1644
          _G_quoted_arg=$_G_unquoted_arg
 
1645
          ;;
 
1646
      esac
 
1647
 
 
1648
      if test -n "$func_quote_for_eval_result"; then
 
1649
        func_append func_quote_for_eval_result " $_G_quoted_arg"
 
1650
      else
 
1651
        func_append func_quote_for_eval_result "$_G_quoted_arg"
 
1652
      fi
 
1653
      shift
 
1654
    done
1054
1655
}
1055
1656
 
1056
1657
 
1057
 
# func_quote_for_expand arg
 
1658
# func_quote_for_expand ARG
 
1659
# -------------------------
1058
1660
# Aesthetically quote ARG to be evaled later; same as above,
1059
1661
# but do not quote variable references.
1060
1662
func_quote_for_expand ()
1061
1663
{
 
1664
    $debug_cmd
 
1665
 
1062
1666
    case $1 in
1063
1667
      *[\\\`\"]*)
1064
 
        my_arg=`$ECHO "$1" | $SED \
1065
 
            -e "$double_quote_subst" -e "$sed_double_backslash"` ;;
 
1668
        _G_arg=`$ECHO "$1" | $SED \
 
1669
            -e "$sed_double_quote_subst" -e "$sed_double_backslash"` ;;
1066
1670
      *)
1067
 
        my_arg="$1" ;;
 
1671
        _G_arg=$1 ;;
1068
1672
    esac
1069
1673
 
1070
 
    case $my_arg in
 
1674
    case $_G_arg in
1071
1675
      # Double-quote args containing shell metacharacters to delay
1072
1676
      # word splitting and command substitution for a subsequent eval.
1073
1677
      # Many Bourne shells cannot handle close brackets correctly
1074
1678
      # in scan sets, so we specify it separately.
1075
1679
      *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \     ]*|*]*|"")
1076
 
        my_arg="\"$my_arg\""
 
1680
        _G_arg=\"$_G_arg\"
1077
1681
        ;;
1078
1682
    esac
1079
1683
 
1080
 
    func_quote_for_expand_result="$my_arg"
 
1684
    func_quote_for_expand_result=$_G_arg
1081
1685
}
1082
1686
 
1083
1687
 
1084
 
# func_show_eval cmd [fail_exp]
1085
 
# Unless opt_silent is true, then output CMD.  Then, if opt_dryrun is
 
1688
# func_stripname PREFIX SUFFIX NAME
 
1689
# ---------------------------------
 
1690
# strip PREFIX and SUFFIX from NAME, and store in func_stripname_result.
 
1691
# PREFIX and SUFFIX must not contain globbing or regex special
 
1692
# characters, hashes, percent signs, but SUFFIX may contain a leading
 
1693
# dot (in which case that matches only a dot).
 
1694
if test yes = "$_G_HAVE_XSI_OPS"; then
 
1695
  eval 'func_stripname ()
 
1696
  {
 
1697
    $debug_cmd
 
1698
 
 
1699
    # pdksh 5.2.14 does not do ${X%$Y} correctly if both X and Y are
 
1700
    # positional parameters, so assign one to ordinary variable first.
 
1701
    func_stripname_result=$3
 
1702
    func_stripname_result=${func_stripname_result#"$1"}
 
1703
    func_stripname_result=${func_stripname_result%"$2"}
 
1704
  }'
 
1705
else
 
1706
  func_stripname ()
 
1707
  {
 
1708
    $debug_cmd
 
1709
 
 
1710
    case $2 in
 
1711
      .*) func_stripname_result=`$ECHO "$3" | $SED -e "s%^$1%%" -e "s%\\\\$2\$%%"`;;
 
1712
      *)  func_stripname_result=`$ECHO "$3" | $SED -e "s%^$1%%" -e "s%$2\$%%"`;;
 
1713
    esac
 
1714
  }
 
1715
fi
 
1716
 
 
1717
 
 
1718
# func_show_eval CMD [FAIL_EXP]
 
1719
# -----------------------------
 
1720
# Unless opt_quiet is true, then output CMD.  Then, if opt_dryrun is
1086
1721
# not true, evaluate CMD.  If the evaluation of CMD fails, and FAIL_EXP
1087
1722
# is given, then evaluate it.
1088
1723
func_show_eval ()
1089
1724
{
1090
 
    my_cmd="$1"
1091
 
    my_fail_exp="${2-:}"
1092
 
 
1093
 
    ${opt_silent-false} || {
1094
 
      func_quote_for_expand "$my_cmd"
1095
 
      eval "func_echo $func_quote_for_expand_result"
 
1725
    $debug_cmd
 
1726
 
 
1727
    _G_cmd=$1
 
1728
    _G_fail_exp=${2-':'}
 
1729
 
 
1730
    func_quote_for_expand "$_G_cmd"
 
1731
    eval "func_notquiet $func_quote_for_expand_result"
 
1732
 
 
1733
    $opt_dry_run || {
 
1734
      eval "$_G_cmd"
 
1735
      _G_status=$?
 
1736
      if test 0 -ne "$_G_status"; then
 
1737
        eval "(exit $_G_status); $_G_fail_exp"
 
1738
      fi
1096
1739
    }
1097
 
 
1098
 
    if ${opt_dry_run-false}; then :; else
1099
 
      eval "$my_cmd"
1100
 
      my_status=$?
1101
 
      if test "$my_status" -eq 0; then :; else
1102
 
        eval "(exit $my_status); $my_fail_exp"
1103
 
      fi
1104
 
    fi
1105
1740
}
1106
1741
 
1107
1742
 
1108
 
# func_show_eval_locale cmd [fail_exp]
1109
 
# Unless opt_silent is true, then output CMD.  Then, if opt_dryrun is
 
1743
# func_show_eval_locale CMD [FAIL_EXP]
 
1744
# ------------------------------------
 
1745
# Unless opt_quiet is true, then output CMD.  Then, if opt_dryrun is
1110
1746
# not true, evaluate CMD.  If the evaluation of CMD fails, and FAIL_EXP
1111
1747
# is given, then evaluate it.  Use the saved locale for evaluation.
1112
1748
func_show_eval_locale ()
1113
1749
{
1114
 
    my_cmd="$1"
1115
 
    my_fail_exp="${2-:}"
1116
 
 
1117
 
    ${opt_silent-false} || {
1118
 
      func_quote_for_expand "$my_cmd"
 
1750
    $debug_cmd
 
1751
 
 
1752
    _G_cmd=$1
 
1753
    _G_fail_exp=${2-':'}
 
1754
 
 
1755
    $opt_quiet || {
 
1756
      func_quote_for_expand "$_G_cmd"
1119
1757
      eval "func_echo $func_quote_for_expand_result"
1120
1758
    }
1121
1759
 
1122
 
    if ${opt_dry_run-false}; then :; else
1123
 
      eval "$lt_user_locale
1124
 
            $my_cmd"
1125
 
      my_status=$?
1126
 
      eval "$lt_safe_locale"
1127
 
      if test "$my_status" -eq 0; then :; else
1128
 
        eval "(exit $my_status); $my_fail_exp"
 
1760
    $opt_dry_run || {
 
1761
      eval "$_G_user_locale
 
1762
            $_G_cmd"
 
1763
      _G_status=$?
 
1764
      eval "$_G_safe_locale"
 
1765
      if test 0 -ne "$_G_status"; then
 
1766
        eval "(exit $_G_status); $_G_fail_exp"
1129
1767
      fi
1130
 
    fi
 
1768
    }
1131
1769
}
1132
1770
 
 
1771
 
1133
1772
# func_tr_sh
 
1773
# ----------
1134
1774
# Turn $1 into a string suitable for a shell variable name.
1135
1775
# Result is stored in $func_tr_sh_result.  All characters
1136
1776
# not in the set a-zA-Z0-9_ are replaced with '_'. Further,
1137
1777
# if $1 begins with a digit, a '_' is prepended as well.
1138
1778
func_tr_sh ()
1139
1779
{
1140
 
  case $1 in
1141
 
  [0-9]* | *[!a-zA-Z0-9_]*)
1142
 
    func_tr_sh_result=`$ECHO "$1" | $SED 's/^\([0-9]\)/_\1/; s/[^a-zA-Z0-9_]/_/g'`
1143
 
    ;;
1144
 
  * )
1145
 
    func_tr_sh_result=$1
1146
 
    ;;
1147
 
  esac
1148
 
}
1149
 
 
1150
 
 
1151
 
# func_version
1152
 
# Echo version message to standard output and exit.
1153
 
func_version ()
1154
 
{
1155
 
    $opt_debug
1156
 
 
1157
 
    $SED -n '/(C)/!b go
1158
 
        :more
1159
 
        /\./!{
1160
 
          N
1161
 
          s/\n# / /
1162
 
          b more
1163
 
        }
1164
 
        :go
1165
 
        /^# '$PROGRAM' (GNU /,/# warranty; / {
1166
 
        s/^# //
1167
 
        s/^# *$//
1168
 
        s/\((C)\)[ 0-9,-]*\( [1-9][0-9]*\)/\1\2/
1169
 
        p
1170
 
     }' < "$progpath"
1171
 
     exit $?
1172
 
}
1173
 
 
1174
 
# func_usage
1175
 
# Echo short help message to standard output and exit.
1176
 
func_usage ()
1177
 
{
1178
 
    $opt_debug
1179
 
 
1180
 
    $SED -n '/^# Usage:/,/^#  *.*--help/ {
1181
 
        s/^# //
1182
 
        s/^# *$//
1183
 
        s/\$progname/'$progname'/
1184
 
        p
1185
 
    }' < "$progpath"
1186
 
    echo
1187
 
    $ECHO "run \`$progname --help | more' for full usage"
1188
 
    exit $?
1189
 
}
1190
 
 
1191
 
# func_help [NOEXIT]
1192
 
# Echo long help message to standard output and exit,
1193
 
# unless 'noexit' is passed as argument.
 
1780
    $debug_cmd
 
1781
 
 
1782
    case $1 in
 
1783
    [0-9]* | *[!a-zA-Z0-9_]*)
 
1784
      func_tr_sh_result=`$ECHO "$1" | $SED -e 's/^\([0-9]\)/_\1/' -e 's/[^a-zA-Z0-9_]/_/g'`
 
1785
      ;;
 
1786
    * )
 
1787
      func_tr_sh_result=$1
 
1788
      ;;
 
1789
    esac
 
1790
}
 
1791
 
 
1792
 
 
1793
# func_verbose ARG...
 
1794
# -------------------
 
1795
# Echo program name prefixed message in verbose mode only.
 
1796
func_verbose ()
 
1797
{
 
1798
    $debug_cmd
 
1799
 
 
1800
    $opt_verbose && func_echo "$*"
 
1801
 
 
1802
    :
 
1803
}
 
1804
 
 
1805
 
 
1806
# func_warn_and_continue ARG...
 
1807
# -----------------------------
 
1808
# Echo program name prefixed warning message to standard error.
 
1809
func_warn_and_continue ()
 
1810
{
 
1811
    $debug_cmd
 
1812
 
 
1813
    $require_term_colors
 
1814
 
 
1815
    func_echo_infix_1 "${tc_red}warning$tc_reset" "$*" >&2
 
1816
}
 
1817
 
 
1818
 
 
1819
# func_warning CATEGORY ARG...
 
1820
# ----------------------------
 
1821
# Echo program name prefixed warning message to standard error. Warning
 
1822
# messages can be filtered according to CATEGORY, where this function
 
1823
# elides messages where CATEGORY is not listed in the global variable
 
1824
# 'opt_warning_types'.
 
1825
func_warning ()
 
1826
{
 
1827
    $debug_cmd
 
1828
 
 
1829
    # CATEGORY must be in the warning_categories list!
 
1830
    case " $warning_categories " in
 
1831
      *" $1 "*) ;;
 
1832
      *) func_internal_error "invalid warning category '$1'" ;;
 
1833
    esac
 
1834
 
 
1835
    _G_category=$1
 
1836
    shift
 
1837
 
 
1838
    case " $opt_warning_types " in
 
1839
      *" $_G_category "*) $warning_func ${1+"$@"} ;;
 
1840
    esac
 
1841
}
 
1842
 
 
1843
 
 
1844
# func_sort_ver VER1 VER2
 
1845
# -----------------------
 
1846
# 'sort -V' is not generally available.
 
1847
# Note this deviates from the version comparison in automake
 
1848
# in that it treats 1.5 < 1.5.0, and treats 1.4.4a < 1.4-p3a
 
1849
# but this should suffice as we won't be specifying old
 
1850
# version formats or redundant trailing .0 in bootstrap.conf.
 
1851
# If we did want full compatibility then we should probably
 
1852
# use m4_version_compare from autoconf.
 
1853
func_sort_ver ()
 
1854
{
 
1855
    $debug_cmd
 
1856
 
 
1857
    printf '%s\n%s\n' "$1" "$2" \
 
1858
      | sort -t. -k 1,1n -k 2,2n -k 3,3n -k 4,4n -k 5,5n -k 6,6n -k 7,7n -k 8,8n -k 9,9n
 
1859
}
 
1860
 
 
1861
# func_lt_ver PREV CURR
 
1862
# ---------------------
 
1863
# Return true if PREV and CURR are in the correct order according to
 
1864
# func_sort_ver, otherwise false.  Use it like this:
 
1865
#
 
1866
#  func_lt_ver "$prev_ver" "$proposed_ver" || func_fatal_error "..."
 
1867
func_lt_ver ()
 
1868
{
 
1869
    $debug_cmd
 
1870
 
 
1871
    test "x$1" = x`func_sort_ver "$1" "$2" | $SED 1q`
 
1872
}
 
1873
 
 
1874
 
 
1875
# Local variables:
 
1876
# mode: shell-script
 
1877
# sh-indentation: 2
 
1878
# eval: (add-hook 'before-save-hook 'time-stamp)
 
1879
# time-stamp-pattern: "10/scriptversion=%:y-%02m-%02d.%02H; # UTC"
 
1880
# time-stamp-time-zone: "UTC"
 
1881
# End:
 
1882
#! /bin/sh
 
1883
 
 
1884
# Set a version string for this script.
 
1885
scriptversion=2014-01-07.03; # UTC
 
1886
 
 
1887
# A portable, pluggable option parser for Bourne shell.
 
1888
# Written by Gary V. Vaughan, 2010
 
1889
 
 
1890
# Copyright (C) 2010-2015 Free Software Foundation, Inc.
 
1891
# This is free software; see the source for copying conditions.  There is NO
 
1892
# warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
 
1893
 
 
1894
# This program is free software: you can redistribute it and/or modify
 
1895
# it under the terms of the GNU General Public License as published by
 
1896
# the Free Software Foundation, either version 3 of the License, or
 
1897
# (at your option) any later version.
 
1898
 
 
1899
# This program is distributed in the hope that it will be useful,
 
1900
# but WITHOUT ANY WARRANTY; without even the implied warranty of
 
1901
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 
1902
# GNU General Public License for more details.
 
1903
 
 
1904
# You should have received a copy of the GNU General Public License
 
1905
# along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
1906
 
 
1907
# Please report bugs or propose patches to gary@gnu.org.
 
1908
 
 
1909
 
 
1910
## ------ ##
 
1911
## Usage. ##
 
1912
## ------ ##
 
1913
 
 
1914
# This file is a library for parsing options in your shell scripts along
 
1915
# with assorted other useful supporting features that you can make use
 
1916
# of too.
 
1917
#
 
1918
# For the simplest scripts you might need only:
 
1919
#
 
1920
#   #!/bin/sh
 
1921
#   . relative/path/to/funclib.sh
 
1922
#   . relative/path/to/options-parser
 
1923
#   scriptversion=1.0
 
1924
#   func_options ${1+"$@"}
 
1925
#   eval set dummy "$func_options_result"; shift
 
1926
#   ...rest of your script...
 
1927
#
 
1928
# In order for the '--version' option to work, you will need to have a
 
1929
# suitably formatted comment like the one at the top of this file
 
1930
# starting with '# Written by ' and ending with '# warranty; '.
 
1931
#
 
1932
# For '-h' and '--help' to work, you will also need a one line
 
1933
# description of your script's purpose in a comment directly above the
 
1934
# '# Written by ' line, like the one at the top of this file.
 
1935
#
 
1936
# The default options also support '--debug', which will turn on shell
 
1937
# execution tracing (see the comment above debug_cmd below for another
 
1938
# use), and '--verbose' and the func_verbose function to allow your script
 
1939
# to display verbose messages only when your user has specified
 
1940
# '--verbose'.
 
1941
#
 
1942
# After sourcing this file, you can plug processing for additional
 
1943
# options by amending the variables from the 'Configuration' section
 
1944
# below, and following the instructions in the 'Option parsing'
 
1945
# section further down.
 
1946
 
 
1947
## -------------- ##
 
1948
## Configuration. ##
 
1949
## -------------- ##
 
1950
 
 
1951
# You should override these variables in your script after sourcing this
 
1952
# file so that they reflect the customisations you have added to the
 
1953
# option parser.
 
1954
 
 
1955
# The usage line for option parsing errors and the start of '-h' and
 
1956
# '--help' output messages. You can embed shell variables for delayed
 
1957
# expansion at the time the message is displayed, but you will need to
 
1958
# quote other shell meta-characters carefully to prevent them being
 
1959
# expanded when the contents are evaled.
 
1960
usage='$progpath [OPTION]...'
 
1961
 
 
1962
# Short help message in response to '-h' and '--help'.  Add to this or
 
1963
# override it after sourcing this library to reflect the full set of
 
1964
# options your script accepts.
 
1965
usage_message="\
 
1966
       --debug        enable verbose shell tracing
 
1967
   -W, --warnings=CATEGORY
 
1968
                      report the warnings falling in CATEGORY [all]
 
1969
   -v, --verbose      verbosely report processing
 
1970
       --version      print version information and exit
 
1971
   -h, --help         print short or long help message and exit
 
1972
"
 
1973
 
 
1974
# Additional text appended to 'usage_message' in response to '--help'.
 
1975
long_help_message="
 
1976
Warning categories include:
 
1977
       'all'          show all warnings
 
1978
       'none'         turn off all the warnings
 
1979
       'error'        warnings are treated as fatal errors"
 
1980
 
 
1981
# Help message printed before fatal option parsing errors.
 
1982
fatal_help="Try '\$progname --help' for more information."
 
1983
 
 
1984
 
 
1985
 
 
1986
## ------------------------- ##
 
1987
## Hook function management. ##
 
1988
## ------------------------- ##
 
1989
 
 
1990
# This section contains functions for adding, removing, and running hooks
 
1991
# to the main code.  A hook is just a named list of of function, that can
 
1992
# be run in order later on.
 
1993
 
 
1994
# func_hookable FUNC_NAME
 
1995
# -----------------------
 
1996
# Declare that FUNC_NAME will run hooks added with
 
1997
# 'func_add_hook FUNC_NAME ...'.
 
1998
func_hookable ()
 
1999
{
 
2000
    $debug_cmd
 
2001
 
 
2002
    func_append hookable_fns " $1"
 
2003
}
 
2004
 
 
2005
 
 
2006
# func_add_hook FUNC_NAME HOOK_FUNC
 
2007
# ---------------------------------
 
2008
# Request that FUNC_NAME call HOOK_FUNC before it returns.  FUNC_NAME must
 
2009
# first have been declared "hookable" by a call to 'func_hookable'.
 
2010
func_add_hook ()
 
2011
{
 
2012
    $debug_cmd
 
2013
 
 
2014
    case " $hookable_fns " in
 
2015
      *" $1 "*) ;;
 
2016
      *) func_fatal_error "'$1' does not accept hook functions." ;;
 
2017
    esac
 
2018
 
 
2019
    eval func_append ${1}_hooks '" $2"'
 
2020
}
 
2021
 
 
2022
 
 
2023
# func_remove_hook FUNC_NAME HOOK_FUNC
 
2024
# ------------------------------------
 
2025
# Remove HOOK_FUNC from the list of functions called by FUNC_NAME.
 
2026
func_remove_hook ()
 
2027
{
 
2028
    $debug_cmd
 
2029
 
 
2030
    eval ${1}_hooks='`$ECHO "\$'$1'_hooks" |$SED "s| '$2'||"`'
 
2031
}
 
2032
 
 
2033
 
 
2034
# func_run_hooks FUNC_NAME [ARG]...
 
2035
# ---------------------------------
 
2036
# Run all hook functions registered to FUNC_NAME.
 
2037
# It is assumed that the list of hook functions contains nothing more
 
2038
# than a whitespace-delimited list of legal shell function names, and
 
2039
# no effort is wasted trying to catch shell meta-characters or preserve
 
2040
# whitespace.
 
2041
func_run_hooks ()
 
2042
{
 
2043
    $debug_cmd
 
2044
 
 
2045
    case " $hookable_fns " in
 
2046
      *" $1 "*) ;;
 
2047
      *) func_fatal_error "'$1' does not support hook funcions.n" ;;
 
2048
    esac
 
2049
 
 
2050
    eval _G_hook_fns=\$$1_hooks; shift
 
2051
 
 
2052
    for _G_hook in $_G_hook_fns; do
 
2053
      eval $_G_hook '"$@"'
 
2054
 
 
2055
      # store returned options list back into positional
 
2056
      # parameters for next 'cmd' execution.
 
2057
      eval _G_hook_result=\$${_G_hook}_result
 
2058
      eval set dummy "$_G_hook_result"; shift
 
2059
    done
 
2060
 
 
2061
    func_quote_for_eval ${1+"$@"}
 
2062
    func_run_hooks_result=$func_quote_for_eval_result
 
2063
}
 
2064
 
 
2065
 
 
2066
 
 
2067
## --------------- ##
 
2068
## Option parsing. ##
 
2069
## --------------- ##
 
2070
 
 
2071
# In order to add your own option parsing hooks, you must accept the
 
2072
# full positional parameter list in your hook function, remove any
 
2073
# options that you action, and then pass back the remaining unprocessed
 
2074
# options in '<hooked_function_name>_result', escaped suitably for
 
2075
# 'eval'.  Like this:
 
2076
#
 
2077
#    my_options_prep ()
 
2078
#    {
 
2079
#        $debug_cmd
 
2080
#
 
2081
#        # Extend the existing usage message.
 
2082
#        usage_message=$usage_message'
 
2083
#      -s, --silent       don'\''t print informational messages
 
2084
#    '
 
2085
#
 
2086
#        func_quote_for_eval ${1+"$@"}
 
2087
#        my_options_prep_result=$func_quote_for_eval_result
 
2088
#    }
 
2089
#    func_add_hook func_options_prep my_options_prep
 
2090
#
 
2091
#
 
2092
#    my_silent_option ()
 
2093
#    {
 
2094
#        $debug_cmd
 
2095
#
 
2096
#        # Note that for efficiency, we parse as many options as we can
 
2097
#        # recognise in a loop before passing the remainder back to the
 
2098
#        # caller on the first unrecognised argument we encounter.
 
2099
#        while test $# -gt 0; do
 
2100
#          opt=$1; shift
 
2101
#          case $opt in
 
2102
#            --silent|-s) opt_silent=: ;;
 
2103
#            # Separate non-argument short options:
 
2104
#            -s*)         func_split_short_opt "$_G_opt"
 
2105
#                         set dummy "$func_split_short_opt_name" \
 
2106
#                             "-$func_split_short_opt_arg" ${1+"$@"}
 
2107
#                         shift
 
2108
#                         ;;
 
2109
#            *)            set dummy "$_G_opt" "$*"; shift; break ;;
 
2110
#          esac
 
2111
#        done
 
2112
#
 
2113
#        func_quote_for_eval ${1+"$@"}
 
2114
#        my_silent_option_result=$func_quote_for_eval_result
 
2115
#    }
 
2116
#    func_add_hook func_parse_options my_silent_option
 
2117
#
 
2118
#
 
2119
#    my_option_validation ()
 
2120
#    {
 
2121
#        $debug_cmd
 
2122
#
 
2123
#        $opt_silent && $opt_verbose && func_fatal_help "\
 
2124
#    '--silent' and '--verbose' options are mutually exclusive."
 
2125
#
 
2126
#        func_quote_for_eval ${1+"$@"}
 
2127
#        my_option_validation_result=$func_quote_for_eval_result
 
2128
#    }
 
2129
#    func_add_hook func_validate_options my_option_validation
 
2130
#
 
2131
# You'll alse need to manually amend $usage_message to reflect the extra
 
2132
# options you parse.  It's preferable to append if you can, so that
 
2133
# multiple option parsing hooks can be added safely.
 
2134
 
 
2135
 
 
2136
# func_options [ARG]...
 
2137
# ---------------------
 
2138
# All the functions called inside func_options are hookable. See the
 
2139
# individual implementations for details.
 
2140
func_hookable func_options
 
2141
func_options ()
 
2142
{
 
2143
    $debug_cmd
 
2144
 
 
2145
    func_options_prep ${1+"$@"}
 
2146
    eval func_parse_options \
 
2147
        ${func_options_prep_result+"$func_options_prep_result"}
 
2148
    eval func_validate_options \
 
2149
        ${func_parse_options_result+"$func_parse_options_result"}
 
2150
 
 
2151
    eval func_run_hooks func_options \
 
2152
        ${func_validate_options_result+"$func_validate_options_result"}
 
2153
 
 
2154
    # save modified positional parameters for caller
 
2155
    func_options_result=$func_run_hooks_result
 
2156
}
 
2157
 
 
2158
 
 
2159
# func_options_prep [ARG]...
 
2160
# --------------------------
 
2161
# All initialisations required before starting the option parse loop.
 
2162
# Note that when calling hook functions, we pass through the list of
 
2163
# positional parameters.  If a hook function modifies that list, and
 
2164
# needs to propogate that back to rest of this script, then the complete
 
2165
# modified list must be put in 'func_run_hooks_result' before
 
2166
# returning.
 
2167
func_hookable func_options_prep
 
2168
func_options_prep ()
 
2169
{
 
2170
    $debug_cmd
 
2171
 
 
2172
    # Option defaults:
 
2173
    opt_verbose=false
 
2174
    opt_warning_types=
 
2175
 
 
2176
    func_run_hooks func_options_prep ${1+"$@"}
 
2177
 
 
2178
    # save modified positional parameters for caller
 
2179
    func_options_prep_result=$func_run_hooks_result
 
2180
}
 
2181
 
 
2182
 
 
2183
# func_parse_options [ARG]...
 
2184
# ---------------------------
 
2185
# The main option parsing loop.
 
2186
func_hookable func_parse_options
 
2187
func_parse_options ()
 
2188
{
 
2189
    $debug_cmd
 
2190
 
 
2191
    func_parse_options_result=
 
2192
 
 
2193
    # this just eases exit handling
 
2194
    while test $# -gt 0; do
 
2195
      # Defer to hook functions for initial option parsing, so they
 
2196
      # get priority in the event of reusing an option name.
 
2197
      func_run_hooks func_parse_options ${1+"$@"}
 
2198
 
 
2199
      # Adjust func_parse_options positional parameters to match
 
2200
      eval set dummy "$func_run_hooks_result"; shift
 
2201
 
 
2202
      # Break out of the loop if we already parsed every option.
 
2203
      test $# -gt 0 || break
 
2204
 
 
2205
      _G_opt=$1
 
2206
      shift
 
2207
      case $_G_opt in
 
2208
        --debug|-x)   debug_cmd='set -x'
 
2209
                      func_echo "enabling shell trace mode"
 
2210
                      $debug_cmd
 
2211
                      ;;
 
2212
 
 
2213
        --no-warnings|--no-warning|--no-warn)
 
2214
                      set dummy --warnings none ${1+"$@"}
 
2215
                      shift
 
2216
                      ;;
 
2217
 
 
2218
        --warnings|--warning|-W)
 
2219
                      test $# = 0 && func_missing_arg $_G_opt && break
 
2220
                      case " $warning_categories $1" in
 
2221
                        *" $1 "*)
 
2222
                          # trailing space prevents matching last $1 above
 
2223
                          func_append_uniq opt_warning_types " $1"
 
2224
                          ;;
 
2225
                        *all)
 
2226
                          opt_warning_types=$warning_categories
 
2227
                          ;;
 
2228
                        *none)
 
2229
                          opt_warning_types=none
 
2230
                          warning_func=:
 
2231
                          ;;
 
2232
                        *error)
 
2233
                          opt_warning_types=$warning_categories
 
2234
                          warning_func=func_fatal_error
 
2235
                          ;;
 
2236
                        *)
 
2237
                          func_fatal_error \
 
2238
                             "unsupported warning category: '$1'"
 
2239
                          ;;
 
2240
                      esac
 
2241
                      shift
 
2242
                      ;;
 
2243
 
 
2244
        --verbose|-v) opt_verbose=: ;;
 
2245
        --version)    func_version ;;
 
2246
        -\?|-h)       func_usage ;;
 
2247
        --help)       func_help ;;
 
2248
 
 
2249
        # Separate optargs to long options (plugins may need this):
 
2250
        --*=*)        func_split_equals "$_G_opt"
 
2251
                      set dummy "$func_split_equals_lhs" \
 
2252
                          "$func_split_equals_rhs" ${1+"$@"}
 
2253
                      shift
 
2254
                      ;;
 
2255
 
 
2256
       # Separate optargs to short options:
 
2257
        -W*)
 
2258
                      func_split_short_opt "$_G_opt"
 
2259
                      set dummy "$func_split_short_opt_name" \
 
2260
                          "$func_split_short_opt_arg" ${1+"$@"}
 
2261
                      shift
 
2262
                      ;;
 
2263
 
 
2264
        # Separate non-argument short options:
 
2265
        -\?*|-h*|-v*|-x*)
 
2266
                      func_split_short_opt "$_G_opt"
 
2267
                      set dummy "$func_split_short_opt_name" \
 
2268
                          "-$func_split_short_opt_arg" ${1+"$@"}
 
2269
                      shift
 
2270
                      ;;
 
2271
 
 
2272
        --)           break ;;
 
2273
        -*)           func_fatal_help "unrecognised option: '$_G_opt'" ;;
 
2274
        *)            set dummy "$_G_opt" ${1+"$@"}; shift; break ;;
 
2275
      esac
 
2276
    done
 
2277
 
 
2278
    # save modified positional parameters for caller
 
2279
    func_quote_for_eval ${1+"$@"}
 
2280
    func_parse_options_result=$func_quote_for_eval_result
 
2281
}
 
2282
 
 
2283
 
 
2284
# func_validate_options [ARG]...
 
2285
# ------------------------------
 
2286
# Perform any sanity checks on option settings and/or unconsumed
 
2287
# arguments.
 
2288
func_hookable func_validate_options
 
2289
func_validate_options ()
 
2290
{
 
2291
    $debug_cmd
 
2292
 
 
2293
    # Display all warnings if -W was not given.
 
2294
    test -n "$opt_warning_types" || opt_warning_types=" $warning_categories"
 
2295
 
 
2296
    func_run_hooks func_validate_options ${1+"$@"}
 
2297
 
 
2298
    # Bail if the options were screwed!
 
2299
    $exit_cmd $EXIT_FAILURE
 
2300
 
 
2301
    # save modified positional parameters for caller
 
2302
    func_validate_options_result=$func_run_hooks_result
 
2303
}
 
2304
 
 
2305
 
 
2306
 
 
2307
## ----------------- ##
 
2308
## Helper functions. ##
 
2309
## ----------------- ##
 
2310
 
 
2311
# This section contains the helper functions used by the rest of the
 
2312
# hookable option parser framework in ascii-betical order.
 
2313
 
 
2314
 
 
2315
# func_fatal_help ARG...
 
2316
# ----------------------
 
2317
# Echo program name prefixed message to standard error, followed by
 
2318
# a help hint, and exit.
 
2319
func_fatal_help ()
 
2320
{
 
2321
    $debug_cmd
 
2322
 
 
2323
    eval \$ECHO \""Usage: $usage"\"
 
2324
    eval \$ECHO \""$fatal_help"\"
 
2325
    func_error ${1+"$@"}
 
2326
    exit $EXIT_FAILURE
 
2327
}
 
2328
 
 
2329
 
 
2330
# func_help
 
2331
# ---------
 
2332
# Echo long help message to standard output and exit.
1194
2333
func_help ()
1195
2334
{
1196
 
    $opt_debug
 
2335
    $debug_cmd
1197
2336
 
1198
 
    $SED -n '/^# Usage:/,/# Report bugs to/ {
1199
 
        :print
1200
 
        s/^# //
1201
 
        s/^# *$//
1202
 
        s*\$progname*'$progname'*
1203
 
        s*\$host*'"$host"'*
1204
 
        s*\$SHELL*'"$SHELL"'*
1205
 
        s*\$LTCC*'"$LTCC"'*
1206
 
        s*\$LTCFLAGS*'"$LTCFLAGS"'*
1207
 
        s*\$LD*'"$LD"'*
1208
 
        s/\$with_gnu_ld/'"$with_gnu_ld"'/
1209
 
        s/\$automake_version/'"`(${AUTOMAKE-automake} --version) 2>/dev/null |$SED 1q`"'/
1210
 
        s/\$autoconf_version/'"`(${AUTOCONF-autoconf} --version) 2>/dev/null |$SED 1q`"'/
1211
 
        p
1212
 
        d
1213
 
     }
1214
 
     /^# .* home page:/b print
1215
 
     /^# General help using/b print
1216
 
     ' < "$progpath"
1217
 
    ret=$?
1218
 
    if test -z "$1"; then
1219
 
      exit $ret
1220
 
    fi
 
2337
    func_usage_message
 
2338
    $ECHO "$long_help_message"
 
2339
    exit 0
1221
2340
}
1222
2341
 
1223
 
# func_missing_arg argname
 
2342
 
 
2343
# func_missing_arg ARGNAME
 
2344
# ------------------------
1224
2345
# Echo program name prefixed message to standard error and set global
1225
2346
# exit_cmd.
1226
2347
func_missing_arg ()
1227
2348
{
1228
 
    $opt_debug
 
2349
    $debug_cmd
1229
2350
 
1230
 
    func_error "missing argument for $1."
 
2351
    func_error "Missing argument for '$1'."
1231
2352
    exit_cmd=exit
1232
2353
}
1233
2354
 
1234
2355
 
1235
 
# func_split_short_opt shortopt
 
2356
# func_split_equals STRING
 
2357
# ------------------------
 
2358
# Set func_split_equals_lhs and func_split_equals_rhs shell variables after
 
2359
# splitting STRING at the '=' sign.
 
2360
test -z "$_G_HAVE_XSI_OPS" \
 
2361
    && (eval 'x=a/b/c;
 
2362
      test 5aa/bb/cc = "${#x}${x%%/*}${x%/*}${x#*/}${x##*/}"') 2>/dev/null \
 
2363
    && _G_HAVE_XSI_OPS=yes
 
2364
 
 
2365
if test yes = "$_G_HAVE_XSI_OPS"
 
2366
then
 
2367
  # This is an XSI compatible shell, allowing a faster implementation...
 
2368
  eval 'func_split_equals ()
 
2369
  {
 
2370
      $debug_cmd
 
2371
 
 
2372
      func_split_equals_lhs=${1%%=*}
 
2373
      func_split_equals_rhs=${1#*=}
 
2374
      test "x$func_split_equals_lhs" = "x$1" \
 
2375
        && func_split_equals_rhs=
 
2376
  }'
 
2377
else
 
2378
  # ...otherwise fall back to using expr, which is often a shell builtin.
 
2379
  func_split_equals ()
 
2380
  {
 
2381
      $debug_cmd
 
2382
 
 
2383
      func_split_equals_lhs=`expr "x$1" : 'x\([^=]*\)'`
 
2384
      func_split_equals_rhs=
 
2385
      test "x$func_split_equals_lhs" = "x$1" \
 
2386
        || func_split_equals_rhs=`expr "x$1" : 'x[^=]*=\(.*\)$'`
 
2387
  }
 
2388
fi #func_split_equals
 
2389
 
 
2390
 
 
2391
# func_split_short_opt SHORTOPT
 
2392
# -----------------------------
1236
2393
# Set func_split_short_opt_name and func_split_short_opt_arg shell
1237
2394
# variables after splitting SHORTOPT after the 2nd character.
1238
 
func_split_short_opt ()
1239
 
{
1240
 
    func_split_short_opt_arg=${1#??}
1241
 
    func_split_short_opt_name=${1%"$func_split_short_opt_arg"}
1242
 
} # Extended-shell func_split_short_opt implementation
1243
 
 
1244
 
 
1245
 
# func_split_long_opt longopt
1246
 
# Set func_split_long_opt_name and func_split_long_opt_arg shell
1247
 
# variables after splitting LONGOPT at the `=' sign.
1248
 
func_split_long_opt ()
1249
 
{
1250
 
    func_split_long_opt_name=${1%%=*}
1251
 
    func_split_long_opt_arg=${1#*=}
1252
 
} # Extended-shell func_split_long_opt implementation
1253
 
 
1254
 
exit_cmd=:
1255
 
 
1256
 
 
1257
 
 
1258
 
 
1259
 
 
1260
 
magic="%%%MAGIC variable%%%"
1261
 
magic_exe="%%%MAGIC EXE variable%%%"
1262
 
 
1263
 
# Global variables.
1264
 
nonopt=
1265
 
preserve_args=
1266
 
lo2o="s/\\.lo\$/.${objext}/"
1267
 
o2lo="s/\\.${objext}\$/.lo/"
1268
 
extracted_archives=
1269
 
extracted_serial=0
1270
 
 
1271
 
# If this variable is set in any of the actions, the command in it
1272
 
# will be execed at the end.  This prevents here-documents from being
1273
 
# left over by shells.
1274
 
exec_cmd=
1275
 
 
1276
 
# func_append var value
1277
 
# Append VALUE to the end of shell variable VAR.
1278
 
func_append ()
1279
 
{
1280
 
    eval "${1}+=\${2}"
1281
 
} # Extended-shell func_append implementation
1282
 
 
1283
 
# func_append_quoted var value
1284
 
# Quote VALUE and append to the end of shell variable VAR, separated
1285
 
# by a space.
1286
 
func_append_quoted ()
1287
 
{
1288
 
    func_quote_for_eval "${2}"
1289
 
    eval "${1}+=\\ \$func_quote_for_eval_result"
1290
 
} # Extended-shell func_append_quoted implementation
1291
 
 
1292
 
 
1293
 
# func_arith arithmetic-term...
1294
 
func_arith ()
1295
 
{
1296
 
    func_arith_result=$(( $* ))
1297
 
} # Extended-shell func_arith implementation
1298
 
 
1299
 
 
1300
 
# func_len string
1301
 
# STRING may not start with a hyphen.
1302
 
func_len ()
1303
 
{
1304
 
    func_len_result=${#1}
1305
 
} # Extended-shell func_len implementation
1306
 
 
1307
 
 
1308
 
# func_lo2o object
1309
 
func_lo2o ()
1310
 
{
1311
 
    case ${1} in
1312
 
      *.lo) func_lo2o_result=${1%.lo}.${objext} ;;
1313
 
      *)    func_lo2o_result=${1} ;;
 
2395
if test yes = "$_G_HAVE_XSI_OPS"
 
2396
then
 
2397
  # This is an XSI compatible shell, allowing a faster implementation...
 
2398
  eval 'func_split_short_opt ()
 
2399
  {
 
2400
      $debug_cmd
 
2401
 
 
2402
      func_split_short_opt_arg=${1#??}
 
2403
      func_split_short_opt_name=${1%"$func_split_short_opt_arg"}
 
2404
  }'
 
2405
else
 
2406
  # ...otherwise fall back to using expr, which is often a shell builtin.
 
2407
  func_split_short_opt ()
 
2408
  {
 
2409
      $debug_cmd
 
2410
 
 
2411
      func_split_short_opt_name=`expr "x$1" : 'x-\(.\)'`
 
2412
      func_split_short_opt_arg=`expr "x$1" : 'x-.\(.*\)$'`
 
2413
  }
 
2414
fi #func_split_short_opt
 
2415
 
 
2416
 
 
2417
# func_usage
 
2418
# ----------
 
2419
# Echo short help message to standard output and exit.
 
2420
func_usage ()
 
2421
{
 
2422
    $debug_cmd
 
2423
 
 
2424
    func_usage_message
 
2425
    $ECHO "Run '$progname --help |${PAGER-more}' for full usage"
 
2426
    exit 0
 
2427
}
 
2428
 
 
2429
 
 
2430
# func_usage_message
 
2431
# ------------------
 
2432
# Echo short help message to standard output.
 
2433
func_usage_message ()
 
2434
{
 
2435
    $debug_cmd
 
2436
 
 
2437
    eval \$ECHO \""Usage: $usage"\"
 
2438
    echo
 
2439
    $SED -n 's|^# ||
 
2440
        /^Written by/{
 
2441
          x;p;x
 
2442
        }
 
2443
        h
 
2444
        /^Written by/q' < "$progpath"
 
2445
    echo
 
2446
    eval \$ECHO \""$usage_message"\"
 
2447
}
 
2448
 
 
2449
 
 
2450
# func_version
 
2451
# ------------
 
2452
# Echo version message to standard output and exit.
 
2453
func_version ()
 
2454
{
 
2455
    $debug_cmd
 
2456
 
 
2457
    printf '%s\n' "$progname $scriptversion"
 
2458
    $SED -n '
 
2459
        /(C)/!b go
 
2460
        :more
 
2461
        /\./!{
 
2462
          N
 
2463
          s|\n# | |
 
2464
          b more
 
2465
        }
 
2466
        :go
 
2467
        /^# Written by /,/# warranty; / {
 
2468
          s|^# ||
 
2469
          s|^# *$||
 
2470
          s|\((C)\)[ 0-9,-]*[ ,-]\([1-9][0-9]* \)|\1 \2|
 
2471
          p
 
2472
        }
 
2473
        /^# Written by / {
 
2474
          s|^# ||
 
2475
          p
 
2476
        }
 
2477
        /^warranty; /q' < "$progpath"
 
2478
 
 
2479
    exit $?
 
2480
}
 
2481
 
 
2482
 
 
2483
# Local variables:
 
2484
# mode: shell-script
 
2485
# sh-indentation: 2
 
2486
# eval: (add-hook 'before-save-hook 'time-stamp)
 
2487
# time-stamp-pattern: "10/scriptversion=%:y-%02m-%02d.%02H; # UTC"
 
2488
# time-stamp-time-zone: "UTC"
 
2489
# End:
 
2490
 
 
2491
# Set a version string.
 
2492
scriptversion='(GNU libtool) 2.4.6'
 
2493
 
 
2494
 
 
2495
# func_echo ARG...
 
2496
# ----------------
 
2497
# Libtool also displays the current mode in messages, so override
 
2498
# funclib.sh func_echo with this custom definition.
 
2499
func_echo ()
 
2500
{
 
2501
    $debug_cmd
 
2502
 
 
2503
    _G_message=$*
 
2504
 
 
2505
    func_echo_IFS=$IFS
 
2506
    IFS=$nl
 
2507
    for _G_line in $_G_message; do
 
2508
      IFS=$func_echo_IFS
 
2509
      $ECHO "$progname${opt_mode+: $opt_mode}: $_G_line"
 
2510
    done
 
2511
    IFS=$func_echo_IFS
 
2512
}
 
2513
 
 
2514
 
 
2515
# func_warning ARG...
 
2516
# -------------------
 
2517
# Libtool warnings are not categorized, so override funclib.sh
 
2518
# func_warning with this simpler definition.
 
2519
func_warning ()
 
2520
{
 
2521
    $debug_cmd
 
2522
 
 
2523
    $warning_func ${1+"$@"}
 
2524
}
 
2525
 
 
2526
 
 
2527
## ---------------- ##
 
2528
## Options parsing. ##
 
2529
## ---------------- ##
 
2530
 
 
2531
# Hook in the functions to make sure our own options are parsed during
 
2532
# the option parsing loop.
 
2533
 
 
2534
usage='$progpath [OPTION]... [MODE-ARG]...'
 
2535
 
 
2536
# Short help message in response to '-h'.
 
2537
usage_message="Options:
 
2538
       --config             show all configuration variables
 
2539
       --debug              enable verbose shell tracing
 
2540
   -n, --dry-run            display commands without modifying any files
 
2541
       --features           display basic configuration information and exit
 
2542
       --mode=MODE          use operation mode MODE
 
2543
       --no-warnings        equivalent to '-Wnone'
 
2544
       --preserve-dup-deps  don't remove duplicate dependency libraries
 
2545
       --quiet, --silent    don't print informational messages
 
2546
       --tag=TAG            use configuration variables from tag TAG
 
2547
   -v, --verbose            print more informational messages than default
 
2548
       --version            print version information
 
2549
   -W, --warnings=CATEGORY  report the warnings falling in CATEGORY [all]
 
2550
   -h, --help, --help-all   print short, long, or detailed help message
 
2551
"
 
2552
 
 
2553
# Additional text appended to 'usage_message' in response to '--help'.
 
2554
func_help ()
 
2555
{
 
2556
    $debug_cmd
 
2557
 
 
2558
    func_usage_message
 
2559
    $ECHO "$long_help_message
 
2560
 
 
2561
MODE must be one of the following:
 
2562
 
 
2563
       clean           remove files from the build directory
 
2564
       compile         compile a source file into a libtool object
 
2565
       execute         automatically set library path, then run a program
 
2566
       finish          complete the installation of libtool libraries
 
2567
       install         install libraries or executables
 
2568
       link            create a library or an executable
 
2569
       uninstall       remove libraries from an installed directory
 
2570
 
 
2571
MODE-ARGS vary depending on the MODE.  When passed as first option,
 
2572
'--mode=MODE' may be abbreviated as 'MODE' or a unique abbreviation of that.
 
2573
Try '$progname --help --mode=MODE' for a more detailed description of MODE.
 
2574
 
 
2575
When reporting a bug, please describe a test case to reproduce it and
 
2576
include the following information:
 
2577
 
 
2578
       host-triplet:   $host
 
2579
       shell:          $SHELL
 
2580
       compiler:       $LTCC
 
2581
       compiler flags: $LTCFLAGS
 
2582
       linker:         $LD (gnu? $with_gnu_ld)
 
2583
       version:        $progname (GNU libtool) 2.4.6
 
2584
       automake:       `($AUTOMAKE --version) 2>/dev/null |$SED 1q`
 
2585
       autoconf:       `($AUTOCONF --version) 2>/dev/null |$SED 1q`
 
2586
 
 
2587
Report bugs to <bug-libtool@gnu.org>.
 
2588
GNU libtool home page: <http://www.gnu.org/s/libtool/>.
 
2589
General help using GNU software: <http://www.gnu.org/gethelp/>."
 
2590
    exit 0
 
2591
}
 
2592
 
 
2593
 
 
2594
# func_lo2o OBJECT-NAME
 
2595
# ---------------------
 
2596
# Transform OBJECT-NAME from a '.lo' suffix to the platform specific
 
2597
# object suffix.
 
2598
 
 
2599
lo2o=s/\\.lo\$/.$objext/
 
2600
o2lo=s/\\.$objext\$/.lo/
 
2601
 
 
2602
if test yes = "$_G_HAVE_XSI_OPS"; then
 
2603
  eval 'func_lo2o ()
 
2604
  {
 
2605
    case $1 in
 
2606
      *.lo) func_lo2o_result=${1%.lo}.$objext ;;
 
2607
      *   ) func_lo2o_result=$1               ;;
1314
2608
    esac
1315
 
} # Extended-shell func_lo2o implementation
1316
 
 
1317
 
 
1318
 
# func_xform libobj-or-source
1319
 
func_xform ()
1320
 
{
 
2609
  }'
 
2610
 
 
2611
  # func_xform LIBOBJ-OR-SOURCE
 
2612
  # ---------------------------
 
2613
  # Transform LIBOBJ-OR-SOURCE from a '.o' or '.c' (or otherwise)
 
2614
  # suffix to a '.lo' libtool-object suffix.
 
2615
  eval 'func_xform ()
 
2616
  {
1321
2617
    func_xform_result=${1%.*}.lo
1322
 
} # Extended-shell func_xform implementation
1323
 
 
1324
 
 
1325
 
# func_fatal_configuration arg...
 
2618
  }'
 
2619
else
 
2620
  # ...otherwise fall back to using sed.
 
2621
  func_lo2o ()
 
2622
  {
 
2623
    func_lo2o_result=`$ECHO "$1" | $SED "$lo2o"`
 
2624
  }
 
2625
 
 
2626
  func_xform ()
 
2627
  {
 
2628
    func_xform_result=`$ECHO "$1" | $SED 's|\.[^.]*$|.lo|'`
 
2629
  }
 
2630
fi
 
2631
 
 
2632
 
 
2633
# func_fatal_configuration ARG...
 
2634
# -------------------------------
1326
2635
# Echo program name prefixed message to standard error, followed by
1327
2636
# a configuration failure hint, and exit.
1328
2637
func_fatal_configuration ()
1329
2638
{
1330
 
    func_error ${1+"$@"}
1331
 
    func_error "See the $PACKAGE documentation for more information."
1332
 
    func_fatal_error "Fatal configuration error."
 
2639
    func__fatal_error ${1+"$@"} \
 
2640
      "See the $PACKAGE documentation for more information." \
 
2641
      "Fatal configuration error."
1333
2642
}
1334
2643
 
1335
2644
 
1336
2645
# func_config
 
2646
# -----------
1337
2647
# Display the configuration for all the tags in this script.
1338
2648
func_config ()
1339
2649
{
1351
2661
    exit $?
1352
2662
}
1353
2663
 
 
2664
 
1354
2665
# func_features
 
2666
# -------------
1355
2667
# Display the features supported by this script.
1356
2668
func_features ()
1357
2669
{
1358
2670
    echo "host: $host"
1359
 
    if test "$build_libtool_libs" = yes; then
 
2671
    if test yes = "$build_libtool_libs"; then
1360
2672
      echo "enable shared libraries"
1361
2673
    else
1362
2674
      echo "disable shared libraries"
1363
2675
    fi
1364
 
    if test "$build_old_libs" = yes; then
 
2676
    if test yes = "$build_old_libs"; then
1365
2677
      echo "enable static libraries"
1366
2678
    else
1367
2679
      echo "disable static libraries"
1370
2682
    exit $?
1371
2683
}
1372
2684
 
1373
 
# func_enable_tag tagname
 
2685
 
 
2686
# func_enable_tag TAGNAME
 
2687
# -----------------------
1374
2688
# Verify that TAGNAME is valid, and either flag an error and exit, or
1375
2689
# enable the TAGNAME tag.  We also add TAGNAME to the global $taglist
1376
2690
# variable here.
1377
2691
func_enable_tag ()
1378
2692
{
1379
 
  # Global variable:
1380
 
  tagname="$1"
1381
 
 
1382
 
  re_begincf="^# ### BEGIN LIBTOOL TAG CONFIG: $tagname\$"
1383
 
  re_endcf="^# ### END LIBTOOL TAG CONFIG: $tagname\$"
1384
 
  sed_extractcf="/$re_begincf/,/$re_endcf/p"
1385
 
 
1386
 
  # Validate tagname.
1387
 
  case $tagname in
1388
 
    *[!-_A-Za-z0-9,/]*)
1389
 
      func_fatal_error "invalid tag name: $tagname"
1390
 
      ;;
1391
 
  esac
1392
 
 
1393
 
  # Don't test for the "default" C tag, as we know it's
1394
 
  # there but not specially marked.
1395
 
  case $tagname in
1396
 
    CC) ;;
 
2693
    # Global variable:
 
2694
    tagname=$1
 
2695
 
 
2696
    re_begincf="^# ### BEGIN LIBTOOL TAG CONFIG: $tagname\$"
 
2697
    re_endcf="^# ### END LIBTOOL TAG CONFIG: $tagname\$"
 
2698
    sed_extractcf=/$re_begincf/,/$re_endcf/p
 
2699
 
 
2700
    # Validate tagname.
 
2701
    case $tagname in
 
2702
      *[!-_A-Za-z0-9,/]*)
 
2703
        func_fatal_error "invalid tag name: $tagname"
 
2704
        ;;
 
2705
    esac
 
2706
 
 
2707
    # Don't test for the "default" C tag, as we know it's
 
2708
    # there but not specially marked.
 
2709
    case $tagname in
 
2710
        CC) ;;
1397
2711
    *)
1398
 
      if $GREP "$re_begincf" "$progpath" >/dev/null 2>&1; then
1399
 
        taglist="$taglist $tagname"
 
2712
        if $GREP "$re_begincf" "$progpath" >/dev/null 2>&1; then
 
2713
          taglist="$taglist $tagname"
1400
2714
 
1401
 
        # Evaluate the configuration.  Be careful to quote the path
1402
 
        # and the sed script, to avoid splitting on whitespace, but
1403
 
        # also don't use non-portable quotes within backquotes within
1404
 
        # quotes we have to do it in 2 steps:
1405
 
        extractedcf=`$SED -n -e "$sed_extractcf" < "$progpath"`
1406
 
        eval "$extractedcf"
1407
 
      else
1408
 
        func_error "ignoring unknown tag $tagname"
1409
 
      fi
1410
 
      ;;
1411
 
  esac
 
2715
          # Evaluate the configuration.  Be careful to quote the path
 
2716
          # and the sed script, to avoid splitting on whitespace, but
 
2717
          # also don't use non-portable quotes within backquotes within
 
2718
          # quotes we have to do it in 2 steps:
 
2719
          extractedcf=`$SED -n -e "$sed_extractcf" < "$progpath"`
 
2720
          eval "$extractedcf"
 
2721
        else
 
2722
          func_error "ignoring unknown tag $tagname"
 
2723
        fi
 
2724
        ;;
 
2725
    esac
1412
2726
}
1413
2727
 
 
2728
 
1414
2729
# func_check_version_match
 
2730
# ------------------------
1415
2731
# Ensure that we are using m4 macros, and libtool script from the same
1416
2732
# release of libtool.
1417
2733
func_check_version_match ()
1418
2734
{
1419
 
  if test "$package_revision" != "$macro_revision"; then
1420
 
    if test "$VERSION" != "$macro_version"; then
1421
 
      if test -z "$macro_version"; then
1422
 
        cat >&2 <<_LT_EOF
 
2735
    if test "$package_revision" != "$macro_revision"; then
 
2736
      if test "$VERSION" != "$macro_version"; then
 
2737
        if test -z "$macro_version"; then
 
2738
          cat >&2 <<_LT_EOF
1423
2739
$progname: Version mismatch error.  This is $PACKAGE $VERSION, but the
1424
2740
$progname: definition of this LT_INIT comes from an older release.
1425
2741
$progname: You should recreate aclocal.m4 with macros from $PACKAGE $VERSION
1426
2742
$progname: and run autoconf again.
1427
2743
_LT_EOF
1428
 
      else
1429
 
        cat >&2 <<_LT_EOF
 
2744
        else
 
2745
          cat >&2 <<_LT_EOF
1430
2746
$progname: Version mismatch error.  This is $PACKAGE $VERSION, but the
1431
2747
$progname: definition of this LT_INIT comes from $PACKAGE $macro_version.
1432
2748
$progname: You should recreate aclocal.m4 with macros from $PACKAGE $VERSION
1433
2749
$progname: and run autoconf again.
1434
2750
_LT_EOF
1435
 
      fi
1436
 
    else
1437
 
      cat >&2 <<_LT_EOF
 
2751
        fi
 
2752
      else
 
2753
        cat >&2 <<_LT_EOF
1438
2754
$progname: Version mismatch error.  This is $PACKAGE $VERSION, revision $package_revision,
1439
2755
$progname: but the definition of this LT_INIT comes from revision $macro_revision.
1440
2756
$progname: You should recreate aclocal.m4 with macros from revision $package_revision
1441
2757
$progname: of $PACKAGE $VERSION and run autoconf again.
1442
2758
_LT_EOF
1443
 
    fi
1444
 
 
1445
 
    exit $EXIT_MISMATCH
1446
 
  fi
1447
 
}
1448
 
 
1449
 
 
1450
 
# Shorthand for --mode=foo, only valid as the first argument
1451
 
case $1 in
1452
 
clean|clea|cle|cl)
1453
 
  shift; set dummy --mode clean ${1+"$@"}; shift
1454
 
  ;;
1455
 
compile|compil|compi|comp|com|co|c)
1456
 
  shift; set dummy --mode compile ${1+"$@"}; shift
1457
 
  ;;
1458
 
execute|execut|execu|exec|exe|ex|e)
1459
 
  shift; set dummy --mode execute ${1+"$@"}; shift
1460
 
  ;;
1461
 
finish|finis|fini|fin|fi|f)
1462
 
  shift; set dummy --mode finish ${1+"$@"}; shift
1463
 
  ;;
1464
 
install|instal|insta|inst|ins|in|i)
1465
 
  shift; set dummy --mode install ${1+"$@"}; shift
1466
 
  ;;
1467
 
link|lin|li|l)
1468
 
  shift; set dummy --mode link ${1+"$@"}; shift
1469
 
  ;;
1470
 
uninstall|uninstal|uninsta|uninst|unins|unin|uni|un|u)
1471
 
  shift; set dummy --mode uninstall ${1+"$@"}; shift
1472
 
  ;;
1473
 
esac
1474
 
 
1475
 
 
1476
 
 
1477
 
# Option defaults:
1478
 
opt_debug=:
1479
 
opt_dry_run=false
1480
 
opt_config=false
1481
 
opt_preserve_dup_deps=false
1482
 
opt_features=false
1483
 
opt_finish=false
1484
 
opt_help=false
1485
 
opt_help_all=false
1486
 
opt_silent=:
1487
 
opt_warning=:
1488
 
opt_verbose=:
1489
 
opt_silent=false
1490
 
opt_verbose=false
1491
 
 
1492
 
 
1493
 
# Parse options once, thoroughly.  This comes as soon as possible in the
1494
 
# script to make things like `--version' happen as quickly as we can.
1495
 
{
1496
 
  # this just eases exit handling
1497
 
  while test $# -gt 0; do
1498
 
    opt="$1"
1499
 
    shift
1500
 
    case $opt in
1501
 
      --debug|-x)       opt_debug='set -x'
1502
 
                        func_echo "enabling shell trace mode"
1503
 
                        $opt_debug
1504
 
                        ;;
1505
 
      --dry-run|--dryrun|-n)
1506
 
                        opt_dry_run=:
1507
 
                        ;;
1508
 
      --config)
1509
 
                        opt_config=:
1510
 
func_config
1511
 
                        ;;
1512
 
      --dlopen|-dlopen)
1513
 
                        optarg="$1"
1514
 
                        opt_dlopen="${opt_dlopen+$opt_dlopen
1515
 
}$optarg"
1516
 
                        shift
1517
 
                        ;;
1518
 
      --preserve-dup-deps)
1519
 
                        opt_preserve_dup_deps=:
1520
 
                        ;;
1521
 
      --features)
1522
 
                        opt_features=:
1523
 
func_features
1524
 
                        ;;
1525
 
      --finish)
1526
 
                        opt_finish=:
1527
 
set dummy --mode finish ${1+"$@"}; shift
1528
 
                        ;;
1529
 
      --help)
1530
 
                        opt_help=:
1531
 
                        ;;
1532
 
      --help-all)
1533
 
                        opt_help_all=:
1534
 
opt_help=': help-all'
1535
 
                        ;;
1536
 
      --mode)
1537
 
                        test $# = 0 && func_missing_arg $opt && break
1538
 
                        optarg="$1"
1539
 
                        opt_mode="$optarg"
1540
 
case $optarg in
1541
 
  # Valid mode arguments:
1542
 
  clean|compile|execute|finish|install|link|relink|uninstall) ;;
1543
 
 
1544
 
  # Catch anything else as an error
1545
 
  *) func_error "invalid argument for $opt"
1546
 
     exit_cmd=exit
1547
 
     break
1548
 
     ;;
1549
 
esac
1550
 
                        shift
1551
 
                        ;;
1552
 
      --no-silent|--no-quiet)
1553
 
                        opt_silent=false
1554
 
preserve_args+=" $opt"
1555
 
                        ;;
1556
 
      --no-warning|--no-warn)
1557
 
                        opt_warning=false
1558
 
preserve_args+=" $opt"
1559
 
                        ;;
1560
 
      --no-verbose)
1561
 
                        opt_verbose=false
1562
 
preserve_args+=" $opt"
1563
 
                        ;;
1564
 
      --silent|--quiet)
1565
 
                        opt_silent=:
1566
 
preserve_args+=" $opt"
1567
 
        opt_verbose=false
1568
 
                        ;;
1569
 
      --verbose|-v)
1570
 
                        opt_verbose=:
1571
 
preserve_args+=" $opt"
1572
 
opt_silent=false
1573
 
                        ;;
1574
 
      --tag)
1575
 
                        test $# = 0 && func_missing_arg $opt && break
1576
 
                        optarg="$1"
1577
 
                        opt_tag="$optarg"
1578
 
preserve_args+=" $opt $optarg"
1579
 
func_enable_tag "$optarg"
1580
 
                        shift
1581
 
                        ;;
1582
 
 
1583
 
      -\?|-h)           func_usage                              ;;
1584
 
      --help)           func_help                               ;;
1585
 
      --version)        func_version                            ;;
1586
 
 
1587
 
      # Separate optargs to long options:
1588
 
      --*=*)
1589
 
                        func_split_long_opt "$opt"
1590
 
                        set dummy "$func_split_long_opt_name" "$func_split_long_opt_arg" ${1+"$@"}
1591
 
                        shift
1592
 
                        ;;
1593
 
 
1594
 
      # Separate non-argument short options:
1595
 
      -\?*|-h*|-n*|-v*)
1596
 
                        func_split_short_opt "$opt"
1597
 
                        set dummy "$func_split_short_opt_name" "-$func_split_short_opt_arg" ${1+"$@"}
1598
 
                        shift
1599
 
                        ;;
1600
 
 
1601
 
      --)               break                                   ;;
1602
 
      -*)               func_fatal_help "unrecognized option \`$opt'" ;;
1603
 
      *)                set dummy "$opt" ${1+"$@"};     shift; break  ;;
1604
 
    esac
1605
 
  done
1606
 
 
1607
 
  # Validate options:
1608
 
 
1609
 
  # save first non-option argument
1610
 
  if test "$#" -gt 0; then
1611
 
    nonopt="$opt"
1612
 
    shift
1613
 
  fi
1614
 
 
1615
 
  # preserve --debug
1616
 
  test "$opt_debug" = : || preserve_args+=" --debug"
1617
 
 
1618
 
  case $host in
1619
 
    *cygwin* | *mingw* | *pw32* | *cegcc*)
1620
 
      # don't eliminate duplications in $postdeps and $predeps
1621
 
      opt_duplicate_compiler_generated_deps=:
1622
 
      ;;
1623
 
    *)
1624
 
      opt_duplicate_compiler_generated_deps=$opt_preserve_dup_deps
1625
 
      ;;
1626
 
  esac
1627
 
 
1628
 
  $opt_help || {
1629
 
    # Sanity checks first:
1630
 
    func_check_version_match
1631
 
 
1632
 
    if test "$build_libtool_libs" != yes && test "$build_old_libs" != yes; then
1633
 
      func_fatal_configuration "not configured to build any kind of library"
1634
 
    fi
1635
 
 
1636
 
    # Darwin sucks
1637
 
    eval std_shrext=\"$shrext_cmds\"
1638
 
 
1639
 
    # Only execute mode is allowed to have -dlopen flags.
1640
 
    if test -n "$opt_dlopen" && test "$opt_mode" != execute; then
1641
 
      func_error "unrecognized option \`-dlopen'"
1642
 
      $ECHO "$help" 1>&2
1643
 
      exit $EXIT_FAILURE
1644
 
    fi
1645
 
 
1646
 
    # Change the help message to a mode-specific one.
1647
 
    generic_help="$help"
1648
 
    help="Try \`$progname --help --mode=$opt_mode' for more information."
1649
 
  }
1650
 
 
1651
 
 
1652
 
  # Bail if the options were screwed
1653
 
  $exit_cmd $EXIT_FAILURE
1654
 
}
1655
 
 
 
2759
      fi
 
2760
 
 
2761
      exit $EXIT_MISMATCH
 
2762
    fi
 
2763
}
 
2764
 
 
2765
 
 
2766
# libtool_options_prep [ARG]...
 
2767
# -----------------------------
 
2768
# Preparation for options parsed by libtool.
 
2769
libtool_options_prep ()
 
2770
{
 
2771
    $debug_mode
 
2772
 
 
2773
    # Option defaults:
 
2774
    opt_config=false
 
2775
    opt_dlopen=
 
2776
    opt_dry_run=false
 
2777
    opt_help=false
 
2778
    opt_mode=
 
2779
    opt_preserve_dup_deps=false
 
2780
    opt_quiet=false
 
2781
 
 
2782
    nonopt=
 
2783
    preserve_args=
 
2784
 
 
2785
    # Shorthand for --mode=foo, only valid as the first argument
 
2786
    case $1 in
 
2787
    clean|clea|cle|cl)
 
2788
      shift; set dummy --mode clean ${1+"$@"}; shift
 
2789
      ;;
 
2790
    compile|compil|compi|comp|com|co|c)
 
2791
      shift; set dummy --mode compile ${1+"$@"}; shift
 
2792
      ;;
 
2793
    execute|execut|execu|exec|exe|ex|e)
 
2794
      shift; set dummy --mode execute ${1+"$@"}; shift
 
2795
      ;;
 
2796
    finish|finis|fini|fin|fi|f)
 
2797
      shift; set dummy --mode finish ${1+"$@"}; shift
 
2798
      ;;
 
2799
    install|instal|insta|inst|ins|in|i)
 
2800
      shift; set dummy --mode install ${1+"$@"}; shift
 
2801
      ;;
 
2802
    link|lin|li|l)
 
2803
      shift; set dummy --mode link ${1+"$@"}; shift
 
2804
      ;;
 
2805
    uninstall|uninstal|uninsta|uninst|unins|unin|uni|un|u)
 
2806
      shift; set dummy --mode uninstall ${1+"$@"}; shift
 
2807
      ;;
 
2808
    esac
 
2809
 
 
2810
    # Pass back the list of options.
 
2811
    func_quote_for_eval ${1+"$@"}
 
2812
    libtool_options_prep_result=$func_quote_for_eval_result
 
2813
}
 
2814
func_add_hook func_options_prep libtool_options_prep
 
2815
 
 
2816
 
 
2817
# libtool_parse_options [ARG]...
 
2818
# ---------------------------------
 
2819
# Provide handling for libtool specific options.
 
2820
libtool_parse_options ()
 
2821
{
 
2822
    $debug_cmd
 
2823
 
 
2824
    # Perform our own loop to consume as many options as possible in
 
2825
    # each iteration.
 
2826
    while test $# -gt 0; do
 
2827
      _G_opt=$1
 
2828
      shift
 
2829
      case $_G_opt in
 
2830
        --dry-run|--dryrun|-n)
 
2831
                        opt_dry_run=:
 
2832
                        ;;
 
2833
 
 
2834
        --config)       func_config ;;
 
2835
 
 
2836
        --dlopen|-dlopen)
 
2837
                        opt_dlopen="${opt_dlopen+$opt_dlopen
 
2838
}$1"
 
2839
                        shift
 
2840
                        ;;
 
2841
 
 
2842
        --preserve-dup-deps)
 
2843
                        opt_preserve_dup_deps=: ;;
 
2844
 
 
2845
        --features)     func_features ;;
 
2846
 
 
2847
        --finish)       set dummy --mode finish ${1+"$@"}; shift ;;
 
2848
 
 
2849
        --help)         opt_help=: ;;
 
2850
 
 
2851
        --help-all)     opt_help=': help-all' ;;
 
2852
 
 
2853
        --mode)         test $# = 0 && func_missing_arg $_G_opt && break
 
2854
                        opt_mode=$1
 
2855
                        case $1 in
 
2856
                          # Valid mode arguments:
 
2857
                          clean|compile|execute|finish|install|link|relink|uninstall) ;;
 
2858
 
 
2859
                          # Catch anything else as an error
 
2860
                          *) func_error "invalid argument for $_G_opt"
 
2861
                             exit_cmd=exit
 
2862
                             break
 
2863
                             ;;
 
2864
                        esac
 
2865
                        shift
 
2866
                        ;;
 
2867
 
 
2868
        --no-silent|--no-quiet)
 
2869
                        opt_quiet=false
 
2870
                        func_append preserve_args " $_G_opt"
 
2871
                        ;;
 
2872
 
 
2873
        --no-warnings|--no-warning|--no-warn)
 
2874
                        opt_warning=false
 
2875
                        func_append preserve_args " $_G_opt"
 
2876
                        ;;
 
2877
 
 
2878
        --no-verbose)
 
2879
                        opt_verbose=false
 
2880
                        func_append preserve_args " $_G_opt"
 
2881
                        ;;
 
2882
 
 
2883
        --silent|--quiet)
 
2884
                        opt_quiet=:
 
2885
                        opt_verbose=false
 
2886
                        func_append preserve_args " $_G_opt"
 
2887
                        ;;
 
2888
 
 
2889
        --tag)          test $# = 0 && func_missing_arg $_G_opt && break
 
2890
                        opt_tag=$1
 
2891
                        func_append preserve_args " $_G_opt $1"
 
2892
                        func_enable_tag "$1"
 
2893
                        shift
 
2894
                        ;;
 
2895
 
 
2896
        --verbose|-v)   opt_quiet=false
 
2897
                        opt_verbose=:
 
2898
                        func_append preserve_args " $_G_opt"
 
2899
                        ;;
 
2900
 
 
2901
        # An option not handled by this hook function:
 
2902
        *)              set dummy "$_G_opt" ${1+"$@"};  shift; break  ;;
 
2903
      esac
 
2904
    done
 
2905
 
 
2906
 
 
2907
    # save modified positional parameters for caller
 
2908
    func_quote_for_eval ${1+"$@"}
 
2909
    libtool_parse_options_result=$func_quote_for_eval_result
 
2910
}
 
2911
func_add_hook func_parse_options libtool_parse_options
 
2912
 
 
2913
 
 
2914
 
 
2915
# libtool_validate_options [ARG]...
 
2916
# ---------------------------------
 
2917
# Perform any sanity checks on option settings and/or unconsumed
 
2918
# arguments.
 
2919
libtool_validate_options ()
 
2920
{
 
2921
    # save first non-option argument
 
2922
    if test 0 -lt $#; then
 
2923
      nonopt=$1
 
2924
      shift
 
2925
    fi
 
2926
 
 
2927
    # preserve --debug
 
2928
    test : = "$debug_cmd" || func_append preserve_args " --debug"
 
2929
 
 
2930
    case $host in
 
2931
      # Solaris2 added to fix http://debbugs.gnu.org/cgi/bugreport.cgi?bug=16452
 
2932
      # see also: http://gcc.gnu.org/bugzilla/show_bug.cgi?id=59788
 
2933
      *cygwin* | *mingw* | *pw32* | *cegcc* | *solaris2* | *os2*)
 
2934
        # don't eliminate duplications in $postdeps and $predeps
 
2935
        opt_duplicate_compiler_generated_deps=:
 
2936
        ;;
 
2937
      *)
 
2938
        opt_duplicate_compiler_generated_deps=$opt_preserve_dup_deps
 
2939
        ;;
 
2940
    esac
 
2941
 
 
2942
    $opt_help || {
 
2943
      # Sanity checks first:
 
2944
      func_check_version_match
 
2945
 
 
2946
      test yes != "$build_libtool_libs" \
 
2947
        && test yes != "$build_old_libs" \
 
2948
        && func_fatal_configuration "not configured to build any kind of library"
 
2949
 
 
2950
      # Darwin sucks
 
2951
      eval std_shrext=\"$shrext_cmds\"
 
2952
 
 
2953
      # Only execute mode is allowed to have -dlopen flags.
 
2954
      if test -n "$opt_dlopen" && test execute != "$opt_mode"; then
 
2955
        func_error "unrecognized option '-dlopen'"
 
2956
        $ECHO "$help" 1>&2
 
2957
        exit $EXIT_FAILURE
 
2958
      fi
 
2959
 
 
2960
      # Change the help message to a mode-specific one.
 
2961
      generic_help=$help
 
2962
      help="Try '$progname --help --mode=$opt_mode' for more information."
 
2963
    }
 
2964
 
 
2965
    # Pass back the unparsed argument list
 
2966
    func_quote_for_eval ${1+"$@"}
 
2967
    libtool_validate_options_result=$func_quote_for_eval_result
 
2968
}
 
2969
func_add_hook func_validate_options libtool_validate_options
 
2970
 
 
2971
 
 
2972
# Process options as early as possible so that --help and --version
 
2973
# can return quickly.
 
2974
func_options ${1+"$@"}
 
2975
eval set dummy "$func_options_result"; shift
1656
2976
 
1657
2977
 
1658
2978
 
1660
2980
##    Main.    ##
1661
2981
## ----------- ##
1662
2982
 
 
2983
magic='%%%MAGIC variable%%%'
 
2984
magic_exe='%%%MAGIC EXE variable%%%'
 
2985
 
 
2986
# Global variables.
 
2987
extracted_archives=
 
2988
extracted_serial=0
 
2989
 
 
2990
# If this variable is set in any of the actions, the command in it
 
2991
# will be execed at the end.  This prevents here-documents from being
 
2992
# left over by shells.
 
2993
exec_cmd=
 
2994
 
 
2995
 
 
2996
# A function that is used when there is no print builtin or printf.
 
2997
func_fallback_echo ()
 
2998
{
 
2999
  eval 'cat <<_LTECHO_EOF
 
3000
$1
 
3001
_LTECHO_EOF'
 
3002
}
 
3003
 
 
3004
# func_generated_by_libtool
 
3005
# True iff stdin has been generated by Libtool. This function is only
 
3006
# a basic sanity check; it will hardly flush out determined imposters.
 
3007
func_generated_by_libtool_p ()
 
3008
{
 
3009
  $GREP "^# Generated by .*$PACKAGE" > /dev/null 2>&1
 
3010
}
 
3011
 
1663
3012
# func_lalib_p file
1664
 
# True iff FILE is a libtool `.la' library or `.lo' object file.
 
3013
# True iff FILE is a libtool '.la' library or '.lo' object file.
1665
3014
# This function is only a basic sanity check; it will hardly flush out
1666
3015
# determined imposters.
1667
3016
func_lalib_p ()
1668
3017
{
1669
3018
    test -f "$1" &&
1670
 
      $SED -e 4q "$1" 2>/dev/null \
1671
 
        | $GREP "^# Generated by .*$PACKAGE" > /dev/null 2>&1
 
3019
      $SED -e 4q "$1" 2>/dev/null | func_generated_by_libtool_p
1672
3020
}
1673
3021
 
1674
3022
# func_lalib_unsafe_p file
1675
 
# True iff FILE is a libtool `.la' library or `.lo' object file.
 
3023
# True iff FILE is a libtool '.la' library or '.lo' object file.
1676
3024
# This function implements the same check as func_lalib_p without
1677
3025
# resorting to external programs.  To this end, it redirects stdin and
1678
3026
# closes it afterwards, without saving the original file descriptor.
1679
3027
# As a safety measure, use it only where a negative result would be
1680
 
# fatal anyway.  Works if `file' does not exist.
 
3028
# fatal anyway.  Works if 'file' does not exist.
1681
3029
func_lalib_unsafe_p ()
1682
3030
{
1683
3031
    lalib_p=no
1685
3033
        for lalib_p_l in 1 2 3 4
1686
3034
        do
1687
3035
            read lalib_p_line
1688
 
            case "$lalib_p_line" in
 
3036
            case $lalib_p_line in
1689
3037
                \#\ Generated\ by\ *$PACKAGE* ) lalib_p=yes; break;;
1690
3038
            esac
1691
3039
        done
1692
3040
        exec 0<&5 5<&-
1693
3041
    fi
1694
 
    test "$lalib_p" = yes
 
3042
    test yes = "$lalib_p"
1695
3043
}
1696
3044
 
1697
3045
# func_ltwrapper_script_p file
1700
3048
# determined imposters.
1701
3049
func_ltwrapper_script_p ()
1702
3050
{
1703
 
    func_lalib_p "$1"
 
3051
    test -f "$1" &&
 
3052
      $lt_truncate_bin < "$1" 2>/dev/null | func_generated_by_libtool_p
1704
3053
}
1705
3054
 
1706
3055
# func_ltwrapper_executable_p file
1725
3074
{
1726
3075
    func_dirname_and_basename "$1" "" "."
1727
3076
    func_stripname '' '.exe' "$func_basename_result"
1728
 
    func_ltwrapper_scriptname_result="$func_dirname_result/$objdir/${func_stripname_result}_ltshwrapper"
 
3077
    func_ltwrapper_scriptname_result=$func_dirname_result/$objdir/${func_stripname_result}_ltshwrapper
1729
3078
}
1730
3079
 
1731
3080
# func_ltwrapper_p file
1744
3093
# FAIL_CMD may read-access the current command in variable CMD!
1745
3094
func_execute_cmds ()
1746
3095
{
1747
 
    $opt_debug
 
3096
    $debug_cmd
 
3097
 
1748
3098
    save_ifs=$IFS; IFS='~'
1749
3099
    for cmd in $1; do
 
3100
      IFS=$sp$nl
 
3101
      eval cmd=\"$cmd\"
1750
3102
      IFS=$save_ifs
1751
 
      eval cmd=\"$cmd\"
1752
3103
      func_show_eval "$cmd" "${2-:}"
1753
3104
    done
1754
3105
    IFS=$save_ifs
1760
3111
# Note that it is not necessary on cygwin/mingw to append a dot to
1761
3112
# FILE even if both FILE and FILE.exe exist: automatic-append-.exe
1762
3113
# behavior happens only for exec(3), not for open(2)!  Also, sourcing
1763
 
# `FILE.' does not work on cygwin managed mounts.
 
3114
# 'FILE.' does not work on cygwin managed mounts.
1764
3115
func_source ()
1765
3116
{
1766
 
    $opt_debug
 
3117
    $debug_cmd
 
3118
 
1767
3119
    case $1 in
1768
3120
    */* | *\\*) . "$1" ;;
1769
3121
    *)          . "./$1" ;;
1790
3142
# store the result into func_replace_sysroot_result.
1791
3143
func_replace_sysroot ()
1792
3144
{
1793
 
  case "$lt_sysroot:$1" in
 
3145
  case $lt_sysroot:$1 in
1794
3146
  ?*:"$lt_sysroot"*)
1795
3147
    func_stripname "$lt_sysroot" '' "$1"
1796
 
    func_replace_sysroot_result="=$func_stripname_result"
 
3148
    func_replace_sysroot_result='='$func_stripname_result
1797
3149
    ;;
1798
3150
  *)
1799
3151
    # Including no sysroot.
1810
3162
# arg is usually of the form 'gcc ...'
1811
3163
func_infer_tag ()
1812
3164
{
1813
 
    $opt_debug
 
3165
    $debug_cmd
 
3166
 
1814
3167
    if test -n "$available_tags" && test -z "$tagname"; then
1815
3168
      CC_quoted=
1816
3169
      for arg in $CC; do
1829
3182
        for z in $available_tags; do
1830
3183
          if $GREP "^# ### BEGIN LIBTOOL TAG CONFIG: $z$" < "$progpath" > /dev/null; then
1831
3184
            # Evaluate the configuration.
1832
 
            eval "`${SED} -n -e '/^# ### BEGIN LIBTOOL TAG CONFIG: '$z'$/,/^# ### END LIBTOOL TAG CONFIG: '$z'$/p' < $progpath`"
 
3185
            eval "`$SED -n -e '/^# ### BEGIN LIBTOOL TAG CONFIG: '$z'$/,/^# ### END LIBTOOL TAG CONFIG: '$z'$/p' < $progpath`"
1833
3186
            CC_quoted=
1834
3187
            for arg in $CC; do
1835
3188
              # Double-quote args containing other shell metacharacters.
1854
3207
        # line option must be used.
1855
3208
        if test -z "$tagname"; then
1856
3209
          func_echo "unable to infer tagged configuration"
1857
 
          func_fatal_error "specify a tag with \`--tag'"
 
3210
          func_fatal_error "specify a tag with '--tag'"
1858
3211
#       else
1859
3212
#         func_verbose "using $tagname tagged configuration"
1860
3213
        fi
1870
3223
# but don't create it if we're doing a dry run.
1871
3224
func_write_libtool_object ()
1872
3225
{
1873
 
    write_libobj=${1}
1874
 
    if test "$build_libtool_libs" = yes; then
1875
 
      write_lobj=\'${2}\'
 
3226
    write_libobj=$1
 
3227
    if test yes = "$build_libtool_libs"; then
 
3228
      write_lobj=\'$2\'
1876
3229
    else
1877
3230
      write_lobj=none
1878
3231
    fi
1879
3232
 
1880
 
    if test "$build_old_libs" = yes; then
1881
 
      write_oldobj=\'${3}\'
 
3233
    if test yes = "$build_old_libs"; then
 
3234
      write_oldobj=\'$3\'
1882
3235
    else
1883
3236
      write_oldobj=none
1884
3237
    fi
1886
3239
    $opt_dry_run || {
1887
3240
      cat >${write_libobj}T <<EOF
1888
3241
# $write_libobj - a libtool object file
1889
 
# Generated by $PROGRAM (GNU $PACKAGE$TIMESTAMP) $VERSION
 
3242
# Generated by $PROGRAM (GNU $PACKAGE) $VERSION
1890
3243
#
1891
3244
# Please DO NOT delete this file!
1892
3245
# It is necessary for linking the library.
1898
3251
non_pic_object=$write_oldobj
1899
3252
 
1900
3253
EOF
1901
 
      $MV "${write_libobj}T" "${write_libobj}"
 
3254
      $MV "${write_libobj}T" "$write_libobj"
1902
3255
    }
1903
3256
}
1904
3257
 
1918
3271
# be empty on error (or when ARG is empty)
1919
3272
func_convert_core_file_wine_to_w32 ()
1920
3273
{
1921
 
  $opt_debug
1922
 
  func_convert_core_file_wine_to_w32_result="$1"
 
3274
  $debug_cmd
 
3275
 
 
3276
  func_convert_core_file_wine_to_w32_result=$1
1923
3277
  if test -n "$1"; then
1924
3278
    # Unfortunately, winepath does not exit with a non-zero error code, so we
1925
3279
    # are forced to check the contents of stdout. On the other hand, if the
1927
3281
    # *an error message* to stdout. So we must check for both error code of
1928
3282
    # zero AND non-empty stdout, which explains the odd construction:
1929
3283
    func_convert_core_file_wine_to_w32_tmp=`winepath -w "$1" 2>/dev/null`
1930
 
    if test "$?" -eq 0 && test -n "${func_convert_core_file_wine_to_w32_tmp}"; then
 
3284
    if test "$?" -eq 0 && test -n "$func_convert_core_file_wine_to_w32_tmp"; then
1931
3285
      func_convert_core_file_wine_to_w32_result=`$ECHO "$func_convert_core_file_wine_to_w32_tmp" |
1932
 
        $SED -e "$lt_sed_naive_backslashify"`
 
3286
        $SED -e "$sed_naive_backslashify"`
1933
3287
    else
1934
3288
      func_convert_core_file_wine_to_w32_result=
1935
3289
    fi
1950
3304
# are convertible, then the result may be empty.
1951
3305
func_convert_core_path_wine_to_w32 ()
1952
3306
{
1953
 
  $opt_debug
 
3307
  $debug_cmd
 
3308
 
1954
3309
  # unfortunately, winepath doesn't convert paths, only file names
1955
 
  func_convert_core_path_wine_to_w32_result=""
 
3310
  func_convert_core_path_wine_to_w32_result=
1956
3311
  if test -n "$1"; then
1957
3312
    oldIFS=$IFS
1958
3313
    IFS=:
1959
3314
    for func_convert_core_path_wine_to_w32_f in $1; do
1960
3315
      IFS=$oldIFS
1961
3316
      func_convert_core_file_wine_to_w32 "$func_convert_core_path_wine_to_w32_f"
1962
 
      if test -n "$func_convert_core_file_wine_to_w32_result" ; then
 
3317
      if test -n "$func_convert_core_file_wine_to_w32_result"; then
1963
3318
        if test -z "$func_convert_core_path_wine_to_w32_result"; then
1964
 
          func_convert_core_path_wine_to_w32_result="$func_convert_core_file_wine_to_w32_result"
 
3319
          func_convert_core_path_wine_to_w32_result=$func_convert_core_file_wine_to_w32_result
1965
3320
        else
1966
3321
          func_append func_convert_core_path_wine_to_w32_result ";$func_convert_core_file_wine_to_w32_result"
1967
3322
        fi
1990
3345
# environment variable; do not put it in $PATH.
1991
3346
func_cygpath ()
1992
3347
{
1993
 
  $opt_debug
 
3348
  $debug_cmd
 
3349
 
1994
3350
  if test -n "$LT_CYGPATH" && test -f "$LT_CYGPATH"; then
1995
3351
    func_cygpath_result=`$LT_CYGPATH "$@" 2>/dev/null`
1996
3352
    if test "$?" -ne 0; then
1999
3355
    fi
2000
3356
  else
2001
3357
    func_cygpath_result=
2002
 
    func_error "LT_CYGPATH is empty or specifies non-existent file: \`$LT_CYGPATH'"
 
3358
    func_error "LT_CYGPATH is empty or specifies non-existent file: '$LT_CYGPATH'"
2003
3359
  fi
2004
3360
}
2005
3361
#end: func_cygpath
2010
3366
# result in func_convert_core_msys_to_w32_result.
2011
3367
func_convert_core_msys_to_w32 ()
2012
3368
{
2013
 
  $opt_debug
 
3369
  $debug_cmd
 
3370
 
2014
3371
  # awkward: cmd appends spaces to result
2015
3372
  func_convert_core_msys_to_w32_result=`( cmd //c echo "$1" ) 2>/dev/null |
2016
 
    $SED -e 's/[ ]*$//' -e "$lt_sed_naive_backslashify"`
 
3373
    $SED -e 's/[ ]*$//' -e "$sed_naive_backslashify"`
2017
3374
}
2018
3375
#end: func_convert_core_msys_to_w32
2019
3376
 
2024
3381
# func_to_host_file_result to ARG1).
2025
3382
func_convert_file_check ()
2026
3383
{
2027
 
  $opt_debug
2028
 
  if test -z "$2" && test -n "$1" ; then
 
3384
  $debug_cmd
 
3385
 
 
3386
  if test -z "$2" && test -n "$1"; then
2029
3387
    func_error "Could not determine host file name corresponding to"
2030
 
    func_error "  \`$1'"
 
3388
    func_error "  '$1'"
2031
3389
    func_error "Continuing, but uninstalled executables may not work."
2032
3390
    # Fallback:
2033
 
    func_to_host_file_result="$1"
 
3391
    func_to_host_file_result=$1
2034
3392
  fi
2035
3393
}
2036
3394
# end func_convert_file_check
2042
3400
# func_to_host_file_result to a simplistic fallback value (see below).
2043
3401
func_convert_path_check ()
2044
3402
{
2045
 
  $opt_debug
 
3403
  $debug_cmd
 
3404
 
2046
3405
  if test -z "$4" && test -n "$3"; then
2047
3406
    func_error "Could not determine the host path corresponding to"
2048
 
    func_error "  \`$3'"
 
3407
    func_error "  '$3'"
2049
3408
    func_error "Continuing, but uninstalled executables may not work."
2050
3409
    # Fallback.  This is a deliberately simplistic "conversion" and
2051
3410
    # should not be "improved".  See libtool.info.
2054
3413
      func_to_host_path_result=`echo "$3" |
2055
3414
        $SED -e "$lt_replace_pathsep_chars"`
2056
3415
    else
2057
 
      func_to_host_path_result="$3"
 
3416
      func_to_host_path_result=$3
2058
3417
    fi
2059
3418
  fi
2060
3419
}
2066
3425
# and appending REPL if ORIG matches BACKPAT.
2067
3426
func_convert_path_front_back_pathsep ()
2068
3427
{
2069
 
  $opt_debug
 
3428
  $debug_cmd
 
3429
 
2070
3430
  case $4 in
2071
 
  $1 ) func_to_host_path_result="$3$func_to_host_path_result"
 
3431
  $1 ) func_to_host_path_result=$3$func_to_host_path_result
2072
3432
    ;;
2073
3433
  esac
2074
3434
  case $4 in
2075
 
  $2 ) func_to_host_path_result+="$3"
 
3435
  $2 ) func_append func_to_host_path_result "$3"
2076
3436
    ;;
2077
3437
  esac
2078
3438
}
2082
3442
##################################################
2083
3443
# $build to $host FILE NAME CONVERSION FUNCTIONS #
2084
3444
##################################################
2085
 
# invoked via `$to_host_file_cmd ARG'
 
3445
# invoked via '$to_host_file_cmd ARG'
2086
3446
#
2087
3447
# In each case, ARG is the path to be converted from $build to $host format.
2088
3448
# Result will be available in $func_to_host_file_result.
2093
3453
# in func_to_host_file_result.
2094
3454
func_to_host_file ()
2095
3455
{
2096
 
  $opt_debug
 
3456
  $debug_cmd
 
3457
 
2097
3458
  $to_host_file_cmd "$1"
2098
3459
}
2099
3460
# end func_to_host_file
2105
3466
# in (the comma separated) LAZY, no conversion takes place.
2106
3467
func_to_tool_file ()
2107
3468
{
2108
 
  $opt_debug
 
3469
  $debug_cmd
 
3470
 
2109
3471
  case ,$2, in
2110
3472
    *,"$to_tool_file_cmd",*)
2111
3473
      func_to_tool_file_result=$1
2123
3485
# Copy ARG to func_to_host_file_result.
2124
3486
func_convert_file_noop ()
2125
3487
{
2126
 
  func_to_host_file_result="$1"
 
3488
  func_to_host_file_result=$1
2127
3489
}
2128
3490
# end func_convert_file_noop
2129
3491
 
2134
3496
# func_to_host_file_result.
2135
3497
func_convert_file_msys_to_w32 ()
2136
3498
{
2137
 
  $opt_debug
2138
 
  func_to_host_file_result="$1"
 
3499
  $debug_cmd
 
3500
 
 
3501
  func_to_host_file_result=$1
2139
3502
  if test -n "$1"; then
2140
3503
    func_convert_core_msys_to_w32 "$1"
2141
 
    func_to_host_file_result="$func_convert_core_msys_to_w32_result"
 
3504
    func_to_host_file_result=$func_convert_core_msys_to_w32_result
2142
3505
  fi
2143
3506
  func_convert_file_check "$1" "$func_to_host_file_result"
2144
3507
}
2150
3513
# func_to_host_file_result.
2151
3514
func_convert_file_cygwin_to_w32 ()
2152
3515
{
2153
 
  $opt_debug
2154
 
  func_to_host_file_result="$1"
 
3516
  $debug_cmd
 
3517
 
 
3518
  func_to_host_file_result=$1
2155
3519
  if test -n "$1"; then
2156
3520
    # because $build is cygwin, we call "the" cygpath in $PATH; no need to use
2157
3521
    # LT_CYGPATH in this case.
2167
3531
# and a working winepath. Returns result in func_to_host_file_result.
2168
3532
func_convert_file_nix_to_w32 ()
2169
3533
{
2170
 
  $opt_debug
2171
 
  func_to_host_file_result="$1"
 
3534
  $debug_cmd
 
3535
 
 
3536
  func_to_host_file_result=$1
2172
3537
  if test -n "$1"; then
2173
3538
    func_convert_core_file_wine_to_w32 "$1"
2174
 
    func_to_host_file_result="$func_convert_core_file_wine_to_w32_result"
 
3539
    func_to_host_file_result=$func_convert_core_file_wine_to_w32_result
2175
3540
  fi
2176
3541
  func_convert_file_check "$1" "$func_to_host_file_result"
2177
3542
}
2183
3548
# Returns result in func_to_host_file_result.
2184
3549
func_convert_file_msys_to_cygwin ()
2185
3550
{
2186
 
  $opt_debug
2187
 
  func_to_host_file_result="$1"
 
3551
  $debug_cmd
 
3552
 
 
3553
  func_to_host_file_result=$1
2188
3554
  if test -n "$1"; then
2189
3555
    func_convert_core_msys_to_w32 "$1"
2190
3556
    func_cygpath -u "$func_convert_core_msys_to_w32_result"
2191
 
    func_to_host_file_result="$func_cygpath_result"
 
3557
    func_to_host_file_result=$func_cygpath_result
2192
3558
  fi
2193
3559
  func_convert_file_check "$1" "$func_to_host_file_result"
2194
3560
}
2201
3567
# in func_to_host_file_result.
2202
3568
func_convert_file_nix_to_cygwin ()
2203
3569
{
2204
 
  $opt_debug
2205
 
  func_to_host_file_result="$1"
 
3570
  $debug_cmd
 
3571
 
 
3572
  func_to_host_file_result=$1
2206
3573
  if test -n "$1"; then
2207
3574
    # convert from *nix to w32, then use cygpath to convert from w32 to cygwin.
2208
3575
    func_convert_core_file_wine_to_w32 "$1"
2209
3576
    func_cygpath -u "$func_convert_core_file_wine_to_w32_result"
2210
 
    func_to_host_file_result="$func_cygpath_result"
 
3577
    func_to_host_file_result=$func_cygpath_result
2211
3578
  fi
2212
3579
  func_convert_file_check "$1" "$func_to_host_file_result"
2213
3580
}
2217
3584
#############################################
2218
3585
# $build to $host PATH CONVERSION FUNCTIONS #
2219
3586
#############################################
2220
 
# invoked via `$to_host_path_cmd ARG'
 
3587
# invoked via '$to_host_path_cmd ARG'
2221
3588
#
2222
3589
# In each case, ARG is the path to be converted from $build to $host format.
2223
3590
# The result will be available in $func_to_host_path_result.
2241
3608
to_host_path_cmd=
2242
3609
func_init_to_host_path_cmd ()
2243
3610
{
2244
 
  $opt_debug
 
3611
  $debug_cmd
 
3612
 
2245
3613
  if test -z "$to_host_path_cmd"; then
2246
3614
    func_stripname 'func_convert_file_' '' "$to_host_file_cmd"
2247
 
    to_host_path_cmd="func_convert_path_${func_stripname_result}"
 
3615
    to_host_path_cmd=func_convert_path_$func_stripname_result
2248
3616
  fi
2249
3617
}
2250
3618
 
2254
3622
# in func_to_host_path_result.
2255
3623
func_to_host_path ()
2256
3624
{
2257
 
  $opt_debug
 
3625
  $debug_cmd
 
3626
 
2258
3627
  func_init_to_host_path_cmd
2259
3628
  $to_host_path_cmd "$1"
2260
3629
}
2265
3634
# Copy ARG to func_to_host_path_result.
2266
3635
func_convert_path_noop ()
2267
3636
{
2268
 
  func_to_host_path_result="$1"
 
3637
  func_to_host_path_result=$1
2269
3638
}
2270
3639
# end func_convert_path_noop
2271
3640
 
2276
3645
# func_to_host_path_result.
2277
3646
func_convert_path_msys_to_w32 ()
2278
3647
{
2279
 
  $opt_debug
2280
 
  func_to_host_path_result="$1"
 
3648
  $debug_cmd
 
3649
 
 
3650
  func_to_host_path_result=$1
2281
3651
  if test -n "$1"; then
2282
3652
    # Remove leading and trailing path separator characters from ARG.  MSYS
2283
3653
    # behavior is inconsistent here; cygpath turns them into '.;' and ';.';
2285
3655
    func_stripname : : "$1"
2286
3656
    func_to_host_path_tmp1=$func_stripname_result
2287
3657
    func_convert_core_msys_to_w32 "$func_to_host_path_tmp1"
2288
 
    func_to_host_path_result="$func_convert_core_msys_to_w32_result"
 
3658
    func_to_host_path_result=$func_convert_core_msys_to_w32_result
2289
3659
    func_convert_path_check : ";" \
2290
3660
      "$func_to_host_path_tmp1" "$func_to_host_path_result"
2291
3661
    func_convert_path_front_back_pathsep ":*" "*:" ";" "$1"
2299
3669
# func_to_host_file_result.
2300
3670
func_convert_path_cygwin_to_w32 ()
2301
3671
{
2302
 
  $opt_debug
2303
 
  func_to_host_path_result="$1"
 
3672
  $debug_cmd
 
3673
 
 
3674
  func_to_host_path_result=$1
2304
3675
  if test -n "$1"; then
2305
3676
    # See func_convert_path_msys_to_w32:
2306
3677
    func_stripname : : "$1"
2319
3690
# a working winepath.  Returns result in func_to_host_file_result.
2320
3691
func_convert_path_nix_to_w32 ()
2321
3692
{
2322
 
  $opt_debug
2323
 
  func_to_host_path_result="$1"
 
3693
  $debug_cmd
 
3694
 
 
3695
  func_to_host_path_result=$1
2324
3696
  if test -n "$1"; then
2325
3697
    # See func_convert_path_msys_to_w32:
2326
3698
    func_stripname : : "$1"
2327
3699
    func_to_host_path_tmp1=$func_stripname_result
2328
3700
    func_convert_core_path_wine_to_w32 "$func_to_host_path_tmp1"
2329
 
    func_to_host_path_result="$func_convert_core_path_wine_to_w32_result"
 
3701
    func_to_host_path_result=$func_convert_core_path_wine_to_w32_result
2330
3702
    func_convert_path_check : ";" \
2331
3703
      "$func_to_host_path_tmp1" "$func_to_host_path_result"
2332
3704
    func_convert_path_front_back_pathsep ":*" "*:" ";" "$1"
2340
3712
# Returns result in func_to_host_file_result.
2341
3713
func_convert_path_msys_to_cygwin ()
2342
3714
{
2343
 
  $opt_debug
2344
 
  func_to_host_path_result="$1"
 
3715
  $debug_cmd
 
3716
 
 
3717
  func_to_host_path_result=$1
2345
3718
  if test -n "$1"; then
2346
3719
    # See func_convert_path_msys_to_w32:
2347
3720
    func_stripname : : "$1"
2348
3721
    func_to_host_path_tmp1=$func_stripname_result
2349
3722
    func_convert_core_msys_to_w32 "$func_to_host_path_tmp1"
2350
3723
    func_cygpath -u -p "$func_convert_core_msys_to_w32_result"
2351
 
    func_to_host_path_result="$func_cygpath_result"
 
3724
    func_to_host_path_result=$func_cygpath_result
2352
3725
    func_convert_path_check : : \
2353
3726
      "$func_to_host_path_tmp1" "$func_to_host_path_result"
2354
3727
    func_convert_path_front_back_pathsep ":*" "*:" : "$1"
2363
3736
# func_to_host_file_result.
2364
3737
func_convert_path_nix_to_cygwin ()
2365
3738
{
2366
 
  $opt_debug
2367
 
  func_to_host_path_result="$1"
 
3739
  $debug_cmd
 
3740
 
 
3741
  func_to_host_path_result=$1
2368
3742
  if test -n "$1"; then
2369
3743
    # Remove leading and trailing path separator characters from
2370
3744
    # ARG. msys behavior is inconsistent here, cygpath turns them
2373
3747
    func_to_host_path_tmp1=$func_stripname_result
2374
3748
    func_convert_core_path_wine_to_w32 "$func_to_host_path_tmp1"
2375
3749
    func_cygpath -u -p "$func_convert_core_path_wine_to_w32_result"
2376
 
    func_to_host_path_result="$func_cygpath_result"
 
3750
    func_to_host_path_result=$func_cygpath_result
2377
3751
    func_convert_path_check : : \
2378
3752
      "$func_to_host_path_tmp1" "$func_to_host_path_result"
2379
3753
    func_convert_path_front_back_pathsep ":*" "*:" : "$1"
2382
3756
# end func_convert_path_nix_to_cygwin
2383
3757
 
2384
3758
 
 
3759
# func_dll_def_p FILE
 
3760
# True iff FILE is a Windows DLL '.def' file.
 
3761
# Keep in sync with _LT_DLL_DEF_P in libtool.m4
 
3762
func_dll_def_p ()
 
3763
{
 
3764
  $debug_cmd
 
3765
 
 
3766
  func_dll_def_p_tmp=`$SED -n \
 
3767
    -e 's/^[     ]*//' \
 
3768
    -e '/^\(;.*\)*$/d' \
 
3769
    -e 's/^\(EXPORTS\|LIBRARY\)\([       ].*\)*$/DEF/p' \
 
3770
    -e q \
 
3771
    "$1"`
 
3772
  test DEF = "$func_dll_def_p_tmp"
 
3773
}
 
3774
 
 
3775
 
2385
3776
# func_mode_compile arg...
2386
3777
func_mode_compile ()
2387
3778
{
2388
 
    $opt_debug
 
3779
    $debug_cmd
 
3780
 
2389
3781
    # Get the compilation command and the source file.
2390
3782
    base_compile=
2391
 
    srcfile="$nonopt"  #  always keep a non-empty value in "srcfile"
 
3783
    srcfile=$nonopt  #  always keep a non-empty value in "srcfile"
2392
3784
    suppress_opt=yes
2393
3785
    suppress_output=
2394
3786
    arg_mode=normal
2401
3793
      case $arg_mode in
2402
3794
      arg  )
2403
3795
        # do not "continue".  Instead, add this to base_compile
2404
 
        lastarg="$arg"
 
3796
        lastarg=$arg
2405
3797
        arg_mode=normal
2406
3798
        ;;
2407
3799
 
2408
3800
      target )
2409
 
        libobj="$arg"
 
3801
        libobj=$arg
2410
3802
        arg_mode=normal
2411
3803
        continue
2412
3804
        ;;
2416
3808
        case $arg in
2417
3809
        -o)
2418
3810
          test -n "$libobj" && \
2419
 
            func_fatal_error "you cannot specify \`-o' more than once"
 
3811
            func_fatal_error "you cannot specify '-o' more than once"
2420
3812
          arg_mode=target
2421
3813
          continue
2422
3814
          ;;
2423
3815
 
2424
3816
        -pie | -fpie | -fPIE)
2425
 
          pie_flag+=" $arg"
 
3817
          func_append pie_flag " $arg"
2426
3818
          continue
2427
3819
          ;;
2428
3820
 
2429
3821
        -shared | -static | -prefer-pic | -prefer-non-pic)
2430
 
          later+=" $arg"
 
3822
          func_append later " $arg"
2431
3823
          continue
2432
3824
          ;;
2433
3825
 
2445
3837
          func_stripname '-Wc,' '' "$arg"
2446
3838
          args=$func_stripname_result
2447
3839
          lastarg=
2448
 
          save_ifs="$IFS"; IFS=','
 
3840
          save_ifs=$IFS; IFS=,
2449
3841
          for arg in $args; do
2450
 
            IFS="$save_ifs"
 
3842
            IFS=$save_ifs
2451
3843
            func_append_quoted lastarg "$arg"
2452
3844
          done
2453
 
          IFS="$save_ifs"
 
3845
          IFS=$save_ifs
2454
3846
          func_stripname ' ' '' "$lastarg"
2455
3847
          lastarg=$func_stripname_result
2456
3848
 
2457
3849
          # Add the arguments to base_compile.
2458
 
          base_compile+=" $lastarg"
 
3850
          func_append base_compile " $lastarg"
2459
3851
          continue
2460
3852
          ;;
2461
3853
 
2463
3855
          # Accept the current argument as the source file.
2464
3856
          # The previous "srcfile" becomes the current argument.
2465
3857
          #
2466
 
          lastarg="$srcfile"
2467
 
          srcfile="$arg"
 
3858
          lastarg=$srcfile
 
3859
          srcfile=$arg
2468
3860
          ;;
2469
3861
        esac  #  case $arg
2470
3862
        ;;
2479
3871
      func_fatal_error "you must specify an argument for -Xcompile"
2480
3872
      ;;
2481
3873
    target)
2482
 
      func_fatal_error "you must specify a target with \`-o'"
 
3874
      func_fatal_error "you must specify a target with '-o'"
2483
3875
      ;;
2484
3876
    *)
2485
3877
      # Get the name of the library object.
2486
3878
      test -z "$libobj" && {
2487
3879
        func_basename "$srcfile"
2488
 
        libobj="$func_basename_result"
 
3880
        libobj=$func_basename_result
2489
3881
      }
2490
3882
      ;;
2491
3883
    esac
2505
3897
    case $libobj in
2506
3898
    *.lo) func_lo2o "$libobj"; obj=$func_lo2o_result ;;
2507
3899
    *)
2508
 
      func_fatal_error "cannot determine name of library object from \`$libobj'"
 
3900
      func_fatal_error "cannot determine name of library object from '$libobj'"
2509
3901
      ;;
2510
3902
    esac
2511
3903
 
2514
3906
    for arg in $later; do
2515
3907
      case $arg in
2516
3908
      -shared)
2517
 
        test "$build_libtool_libs" != yes && \
2518
 
          func_fatal_configuration "can not build a shared library"
 
3909
        test yes = "$build_libtool_libs" \
 
3910
          || func_fatal_configuration "cannot build a shared library"
2519
3911
        build_old_libs=no
2520
3912
        continue
2521
3913
        ;;
2541
3933
    func_quote_for_eval "$libobj"
2542
3934
    test "X$libobj" != "X$func_quote_for_eval_result" \
2543
3935
      && $ECHO "X$libobj" | $GREP '[]~#^*{};<>?"'"'"'    &()|`$[]' \
2544
 
      && func_warning "libobj name \`$libobj' may not contain shell special characters."
 
3936
      && func_warning "libobj name '$libobj' may not contain shell special characters."
2545
3937
    func_dirname_and_basename "$obj" "/" ""
2546
 
    objname="$func_basename_result"
2547
 
    xdir="$func_dirname_result"
2548
 
    lobj=${xdir}$objdir/$objname
 
3938
    objname=$func_basename_result
 
3939
    xdir=$func_dirname_result
 
3940
    lobj=$xdir$objdir/$objname
2549
3941
 
2550
3942
    test -z "$base_compile" && \
2551
3943
      func_fatal_help "you must specify a compilation command"
2552
3944
 
2553
3945
    # Delete any leftover library objects.
2554
 
    if test "$build_old_libs" = yes; then
 
3946
    if test yes = "$build_old_libs"; then
2555
3947
      removelist="$obj $lobj $libobj ${libobj}T"
2556
3948
    else
2557
3949
      removelist="$lobj $libobj ${libobj}T"
2563
3955
      pic_mode=default
2564
3956
      ;;
2565
3957
    esac
2566
 
    if test "$pic_mode" = no && test "$deplibs_check_method" != pass_all; then
 
3958
    if test no = "$pic_mode" && test pass_all != "$deplibs_check_method"; then
2567
3959
      # non-PIC code in shared libraries is not supported
2568
3960
      pic_mode=default
2569
3961
    fi
2570
3962
 
2571
3963
    # Calculate the filename of the output object if compiler does
2572
3964
    # not support -o with -c
2573
 
    if test "$compiler_c_o" = no; then
2574
 
      output_obj=`$ECHO "$srcfile" | $SED 's%^.*/%%; s%\.[^.]*$%%'`.${objext}
2575
 
      lockfile="$output_obj.lock"
 
3965
    if test no = "$compiler_c_o"; then
 
3966
      output_obj=`$ECHO "$srcfile" | $SED 's%^.*/%%; s%\.[^.]*$%%'`.$objext
 
3967
      lockfile=$output_obj.lock
2576
3968
    else
2577
3969
      output_obj=
2578
3970
      need_locks=no
2581
3973
 
2582
3974
    # Lock this critical section if it is needed
2583
3975
    # We use this script file to make the link, it avoids creating a new file
2584
 
    if test "$need_locks" = yes; then
 
3976
    if test yes = "$need_locks"; then
2585
3977
      until $opt_dry_run || ln "$progpath" "$lockfile" 2>/dev/null; do
2586
3978
        func_echo "Waiting for $lockfile to be removed"
2587
3979
        sleep 2
2588
3980
      done
2589
 
    elif test "$need_locks" = warn; then
 
3981
    elif test warn = "$need_locks"; then
2590
3982
      if test -f "$lockfile"; then
2591
3983
        $ECHO "\
2592
3984
*** ERROR, $lockfile exists and contains:
2594
3986
 
2595
3987
This indicates that another process is trying to use the same
2596
3988
temporary object file, and libtool could not work around it because
2597
 
your compiler does not support \`-c' and \`-o' together.  If you
 
3989
your compiler does not support '-c' and '-o' together.  If you
2598
3990
repeat this compilation, it may succeed, by chance, but you had better
2599
3991
avoid parallel builds (make -j) in this platform, or get a better
2600
3992
compiler."
2602
3994
        $opt_dry_run || $RM $removelist
2603
3995
        exit $EXIT_FAILURE
2604
3996
      fi
2605
 
      removelist+=" $output_obj"
 
3997
      func_append removelist " $output_obj"
2606
3998
      $ECHO "$srcfile" > "$lockfile"
2607
3999
    fi
2608
4000
 
2609
4001
    $opt_dry_run || $RM $removelist
2610
 
    removelist+=" $lockfile"
 
4002
    func_append removelist " $lockfile"
2611
4003
    trap '$opt_dry_run || $RM $removelist; exit $EXIT_FAILURE' 1 2 15
2612
4004
 
2613
4005
    func_to_tool_file "$srcfile" func_convert_file_msys_to_w32
2616
4008
    qsrcfile=$func_quote_for_eval_result
2617
4009
 
2618
4010
    # Only build a PIC object if we are building libtool libraries.
2619
 
    if test "$build_libtool_libs" = yes; then
 
4011
    if test yes = "$build_libtool_libs"; then
2620
4012
      # Without this assignment, base_compile gets emptied.
2621
4013
      fbsd_hideous_sh_bug=$base_compile
2622
4014
 
2623
 
      if test "$pic_mode" != no; then
 
4015
      if test no != "$pic_mode"; then
2624
4016
        command="$base_compile $qsrcfile $pic_flag"
2625
4017
      else
2626
4018
        # Don't build PIC code
2631
4023
 
2632
4024
      if test -z "$output_obj"; then
2633
4025
        # Place PIC objects in $objdir
2634
 
        command+=" -o $lobj"
 
4026
        func_append command " -o $lobj"
2635
4027
      fi
2636
4028
 
2637
4029
      func_show_eval_locale "$command"  \
2638
4030
          'test -n "$output_obj" && $RM $removelist; exit $EXIT_FAILURE'
2639
4031
 
2640
 
      if test "$need_locks" = warn &&
 
4032
      if test warn = "$need_locks" &&
2641
4033
         test "X`cat $lockfile 2>/dev/null`" != "X$srcfile"; then
2642
4034
        $ECHO "\
2643
4035
*** ERROR, $lockfile contains:
2648
4040
 
2649
4041
This indicates that another process is trying to use the same
2650
4042
temporary object file, and libtool could not work around it because
2651
 
your compiler does not support \`-c' and \`-o' together.  If you
 
4043
your compiler does not support '-c' and '-o' together.  If you
2652
4044
repeat this compilation, it may succeed, by chance, but you had better
2653
4045
avoid parallel builds (make -j) in this platform, or get a better
2654
4046
compiler."
2664
4056
      fi
2665
4057
 
2666
4058
      # Allow error messages only from the first compilation.
2667
 
      if test "$suppress_opt" = yes; then
 
4059
      if test yes = "$suppress_opt"; then
2668
4060
        suppress_output=' >/dev/null 2>&1'
2669
4061
      fi
2670
4062
    fi
2671
4063
 
2672
4064
    # Only build a position-dependent object if we build old libraries.
2673
 
    if test "$build_old_libs" = yes; then
2674
 
      if test "$pic_mode" != yes; then
 
4065
    if test yes = "$build_old_libs"; then
 
4066
      if test yes != "$pic_mode"; then
2675
4067
        # Don't build PIC code
2676
4068
        command="$base_compile $qsrcfile$pie_flag"
2677
4069
      else
2678
4070
        command="$base_compile $qsrcfile $pic_flag"
2679
4071
      fi
2680
 
      if test "$compiler_c_o" = yes; then
2681
 
        command+=" -o $obj"
 
4072
      if test yes = "$compiler_c_o"; then
 
4073
        func_append command " -o $obj"
2682
4074
      fi
2683
4075
 
2684
4076
      # Suppress compiler output if we already did a PIC compilation.
2685
 
      command+="$suppress_output"
 
4077
      func_append command "$suppress_output"
2686
4078
      func_show_eval_locale "$command" \
2687
4079
        '$opt_dry_run || $RM $removelist; exit $EXIT_FAILURE'
2688
4080
 
2689
 
      if test "$need_locks" = warn &&
 
4081
      if test warn = "$need_locks" &&
2690
4082
         test "X`cat $lockfile 2>/dev/null`" != "X$srcfile"; then
2691
4083
        $ECHO "\
2692
4084
*** ERROR, $lockfile contains:
2697
4089
 
2698
4090
This indicates that another process is trying to use the same
2699
4091
temporary object file, and libtool could not work around it because
2700
 
your compiler does not support \`-c' and \`-o' together.  If you
 
4092
your compiler does not support '-c' and '-o' together.  If you
2701
4093
repeat this compilation, it may succeed, by chance, but you had better
2702
4094
avoid parallel builds (make -j) in this platform, or get a better
2703
4095
compiler."
2717
4109
      func_write_libtool_object "$libobj" "$objdir/$objname" "$objname"
2718
4110
 
2719
4111
      # Unlock the critical section if it was locked
2720
 
      if test "$need_locks" != no; then
 
4112
      if test no != "$need_locks"; then
2721
4113
        removelist=$lockfile
2722
4114
        $RM "$lockfile"
2723
4115
      fi
2727
4119
}
2728
4120
 
2729
4121
$opt_help || {
2730
 
  test "$opt_mode" = compile && func_mode_compile ${1+"$@"}
 
4122
  test compile = "$opt_mode" && func_mode_compile ${1+"$@"}
2731
4123
}
2732
4124
 
2733
4125
func_mode_help ()
2747
4139
Remove files from the build directory.
2748
4140
 
2749
4141
RM is the name of the program to use to delete files associated with each FILE
2750
 
(typically \`/bin/rm').  RM-OPTIONS are options (such as \`-f') to be passed
 
4142
(typically '/bin/rm').  RM-OPTIONS are options (such as '-f') to be passed
2751
4143
to RM.
2752
4144
 
2753
4145
If FILE is a libtool library, object or program, all the files associated
2766
4158
  -no-suppress      do not suppress compiler output for multiple passes
2767
4159
  -prefer-pic       try to build PIC objects only
2768
4160
  -prefer-non-pic   try to build non-PIC objects only
2769
 
  -shared           do not build a \`.o' file suitable for static linking
2770
 
  -static           only build a \`.o' file suitable for static linking
 
4161
  -shared           do not build a '.o' file suitable for static linking
 
4162
  -static           only build a '.o' file suitable for static linking
2771
4163
  -Wc,FLAG          pass FLAG directly to the compiler
2772
4164
 
2773
 
COMPILE-COMMAND is a command to be used in creating a \`standard' object file
 
4165
COMPILE-COMMAND is a command to be used in creating a 'standard' object file
2774
4166
from the given SOURCEFILE.
2775
4167
 
2776
4168
The output file name is determined by removing the directory component from
2777
 
SOURCEFILE, then substituting the C source code suffix \`.c' with the
2778
 
library object suffix, \`.lo'."
 
4169
SOURCEFILE, then substituting the C source code suffix '.c' with the
 
4170
library object suffix, '.lo'."
2779
4171
        ;;
2780
4172
 
2781
4173
      execute)
2788
4180
 
2789
4181
  -dlopen FILE      add the directory containing FILE to the library path
2790
4182
 
2791
 
This mode sets the library path environment variable according to \`-dlopen'
 
4183
This mode sets the library path environment variable according to '-dlopen'
2792
4184
flags.
2793
4185
 
2794
4186
If any of the ARGS are libtool executable wrappers, then they are translated
2807
4199
Each LIBDIR is a directory that contains libtool libraries.
2808
4200
 
2809
4201
The commands that this mode executes may require superuser privileges.  Use
2810
 
the \`--dry-run' option if you just want to see what would be executed."
 
4202
the '--dry-run' option if you just want to see what would be executed."
2811
4203
        ;;
2812
4204
 
2813
4205
      install)
2817
4209
Install executables or libraries.
2818
4210
 
2819
4211
INSTALL-COMMAND is the installation command.  The first component should be
2820
 
either the \`install' or \`cp' program.
 
4212
either the 'install' or 'cp' program.
2821
4213
 
2822
4214
The following components of INSTALL-COMMAND are treated specially:
2823
4215
 
2843
4235
  -avoid-version    do not add a version suffix if possible
2844
4236
  -bindir BINDIR    specify path to binaries directory (for systems where
2845
4237
                    libraries must be found in the PATH setting at runtime)
2846
 
  -dlopen FILE      \`-dlpreopen' FILE if it cannot be dlopened at runtime
 
4238
  -dlopen FILE      '-dlpreopen' FILE if it cannot be dlopened at runtime
2847
4239
  -dlpreopen FILE   link in FILE and add its symbols to lt_preloaded_symbols
2848
4240
  -export-dynamic   allow symbols from OUTPUT-FILE to be resolved with dlsym(3)
2849
4241
  -export-symbols SYMFILE
2857
4249
  -no-install       link a not-installable executable
2858
4250
  -no-undefined     declare that a library does not refer to external symbols
2859
4251
  -o OUTPUT-FILE    create OUTPUT-FILE from the specified objects
2860
 
  -objectlist FILE  Use a list of object files found in FILE to specify objects
 
4252
  -objectlist FILE  use a list of object files found in FILE to specify objects
 
4253
  -os2dllname NAME  force a short DLL name on OS/2 (no effect on other OSes)
2861
4254
  -precious-files-regex REGEX
2862
4255
                    don't remove output files matching REGEX
2863
4256
  -release RELEASE  specify package release information
2877
4270
  -Xlinker FLAG     pass linker-specific FLAG directly to the linker
2878
4271
  -XCClinker FLAG   pass link-specific FLAG to the compiler driver (CC)
2879
4272
 
2880
 
All other options (arguments beginning with \`-') are ignored.
 
4273
All other options (arguments beginning with '-') are ignored.
2881
4274
 
2882
 
Every other argument is treated as a filename.  Files ending in \`.la' are
 
4275
Every other argument is treated as a filename.  Files ending in '.la' are
2883
4276
treated as uninstalled libtool libraries, other files are standard or library
2884
4277
object files.
2885
4278
 
2886
 
If the OUTPUT-FILE ends in \`.la', then a libtool library is created,
2887
 
only library objects (\`.lo' files) may be specified, and \`-rpath' is
 
4279
If the OUTPUT-FILE ends in '.la', then a libtool library is created,
 
4280
only library objects ('.lo' files) may be specified, and '-rpath' is
2888
4281
required, except when creating a convenience library.
2889
4282
 
2890
 
If OUTPUT-FILE ends in \`.a' or \`.lib', then a standard library is created
2891
 
using \`ar' and \`ranlib', or on Windows using \`lib'.
 
4283
If OUTPUT-FILE ends in '.a' or '.lib', then a standard library is created
 
4284
using 'ar' and 'ranlib', or on Windows using 'lib'.
2892
4285
 
2893
 
If OUTPUT-FILE ends in \`.lo' or \`.${objext}', then a reloadable object file
 
4286
If OUTPUT-FILE ends in '.lo' or '.$objext', then a reloadable object file
2894
4287
is created, otherwise an executable program is created."
2895
4288
        ;;
2896
4289
 
2901
4294
Remove libraries from an installation directory.
2902
4295
 
2903
4296
RM is the name of the program to use to delete files associated with each FILE
2904
 
(typically \`/bin/rm').  RM-OPTIONS are options (such as \`-f') to be passed
 
4297
(typically '/bin/rm').  RM-OPTIONS are options (such as '-f') to be passed
2905
4298
to RM.
2906
4299
 
2907
4300
If FILE is a libtool library, all the files associated with it are deleted.
2909
4302
        ;;
2910
4303
 
2911
4304
      *)
2912
 
        func_fatal_help "invalid operation mode \`$opt_mode'"
 
4305
        func_fatal_help "invalid operation mode '$opt_mode'"
2913
4306
        ;;
2914
4307
    esac
2915
4308
 
2916
4309
    echo
2917
 
    $ECHO "Try \`$progname --help' for more information about other modes."
 
4310
    $ECHO "Try '$progname --help' for more information about other modes."
2918
4311
}
2919
4312
 
2920
4313
# Now that we've collected a possible --mode arg, show help if necessary
2921
4314
if $opt_help; then
2922
 
  if test "$opt_help" = :; then
 
4315
  if test : = "$opt_help"; then
2923
4316
    func_mode_help
2924
4317
  else
2925
4318
    {
2927
4320
      for opt_mode in compile link execute install finish uninstall clean; do
2928
4321
        func_mode_help
2929
4322
      done
2930
 
    } | sed -n '1p; 2,$s/^Usage:/  or: /p'
 
4323
    } | $SED -n '1p; 2,$s/^Usage:/  or: /p'
2931
4324
    {
2932
4325
      func_help noexit
2933
4326
      for opt_mode in compile link execute install finish uninstall clean; do
2935
4328
        func_mode_help
2936
4329
      done
2937
4330
    } |
2938
 
    sed '1d
 
4331
    $SED '1d
2939
4332
      /^When reporting/,/^Report/{
2940
4333
        H
2941
4334
        d
2952
4345
# func_mode_execute arg...
2953
4346
func_mode_execute ()
2954
4347
{
2955
 
    $opt_debug
 
4348
    $debug_cmd
 
4349
 
2956
4350
    # The first argument is the command name.
2957
 
    cmd="$nonopt"
 
4351
    cmd=$nonopt
2958
4352
    test -z "$cmd" && \
2959
4353
      func_fatal_help "you must specify a COMMAND"
2960
4354
 
2961
4355
    # Handle -dlopen flags immediately.
2962
4356
    for file in $opt_dlopen; do
2963
4357
      test -f "$file" \
2964
 
        || func_fatal_help "\`$file' is not a file"
 
4358
        || func_fatal_help "'$file' is not a file"
2965
4359
 
2966
4360
      dir=
2967
4361
      case $file in
2971
4365
 
2972
4366
        # Check to see that this really is a libtool archive.
2973
4367
        func_lalib_unsafe_p "$file" \
2974
 
          || func_fatal_help "\`$lib' is not a valid libtool archive"
 
4368
          || func_fatal_help "'$lib' is not a valid libtool archive"
2975
4369
 
2976
4370
        # Read the libtool library.
2977
4371
        dlname=
2982
4376
        if test -z "$dlname"; then
2983
4377
          # Warn if it was a shared library.
2984
4378
          test -n "$library_names" && \
2985
 
            func_warning "\`$file' was not linked with \`-export-dynamic'"
 
4379
            func_warning "'$file' was not linked with '-export-dynamic'"
2986
4380
          continue
2987
4381
        fi
2988
4382
 
2989
4383
        func_dirname "$file" "" "."
2990
 
        dir="$func_dirname_result"
 
4384
        dir=$func_dirname_result
2991
4385
 
2992
4386
        if test -f "$dir/$objdir/$dlname"; then
2993
 
          dir+="/$objdir"
 
4387
          func_append dir "/$objdir"
2994
4388
        else
2995
4389
          if test ! -f "$dir/$dlname"; then
2996
 
            func_fatal_error "cannot find \`$dlname' in \`$dir' or \`$dir/$objdir'"
 
4390
            func_fatal_error "cannot find '$dlname' in '$dir' or '$dir/$objdir'"
2997
4391
          fi
2998
4392
        fi
2999
4393
        ;;
3001
4395
      *.lo)
3002
4396
        # Just add the directory containing the .lo file.
3003
4397
        func_dirname "$file" "" "."
3004
 
        dir="$func_dirname_result"
 
4398
        dir=$func_dirname_result
3005
4399
        ;;
3006
4400
 
3007
4401
      *)
3008
 
        func_warning "\`-dlopen' is ignored for non-libtool libraries and objects"
 
4402
        func_warning "'-dlopen' is ignored for non-libtool libraries and objects"
3009
4403
        continue
3010
4404
        ;;
3011
4405
      esac
3012
4406
 
3013
4407
      # Get the absolute pathname.
3014
4408
      absdir=`cd "$dir" && pwd`
3015
 
      test -n "$absdir" && dir="$absdir"
 
4409
      test -n "$absdir" && dir=$absdir
3016
4410
 
3017
4411
      # Now add the directory to shlibpath_var.
3018
4412
      if eval "test -z \"\$$shlibpath_var\""; then
3024
4418
 
3025
4419
    # This variable tells wrapper scripts just to set shlibpath_var
3026
4420
    # rather than running their programs.
3027
 
    libtool_execute_magic="$magic"
 
4421
    libtool_execute_magic=$magic
3028
4422
 
3029
4423
    # Check if any of the arguments is a wrapper script.
3030
4424
    args=
3037
4431
        if func_ltwrapper_script_p "$file"; then
3038
4432
          func_source "$file"
3039
4433
          # Transform arg to wrapped name.
3040
 
          file="$progdir/$program"
 
4434
          file=$progdir/$program
3041
4435
        elif func_ltwrapper_executable_p "$file"; then
3042
4436
          func_ltwrapper_scriptname "$file"
3043
4437
          func_source "$func_ltwrapper_scriptname_result"
3044
4438
          # Transform arg to wrapped name.
3045
 
          file="$progdir/$program"
 
4439
          file=$progdir/$program
3046
4440
        fi
3047
4441
        ;;
3048
4442
      esac
3050
4444
      func_append_quoted args "$file"
3051
4445
    done
3052
4446
 
3053
 
    if test "X$opt_dry_run" = Xfalse; then
 
4447
    if $opt_dry_run; then
 
4448
      # Display what would be done.
 
4449
      if test -n "$shlibpath_var"; then
 
4450
        eval "\$ECHO \"\$shlibpath_var=\$$shlibpath_var\""
 
4451
        echo "export $shlibpath_var"
 
4452
      fi
 
4453
      $ECHO "$cmd$args"
 
4454
      exit $EXIT_SUCCESS
 
4455
    else
3054
4456
      if test -n "$shlibpath_var"; then
3055
4457
        # Export the shlibpath_var.
3056
4458
        eval "export $shlibpath_var"
3067
4469
      done
3068
4470
 
3069
4471
      # Now prepare to actually exec the command.
3070
 
      exec_cmd="\$cmd$args"
3071
 
    else
3072
 
      # Display what would be done.
3073
 
      if test -n "$shlibpath_var"; then
3074
 
        eval "\$ECHO \"\$shlibpath_var=\$$shlibpath_var\""
3075
 
        echo "export $shlibpath_var"
3076
 
      fi
3077
 
      $ECHO "$cmd$args"
3078
 
      exit $EXIT_SUCCESS
 
4472
      exec_cmd=\$cmd$args
3079
4473
    fi
3080
4474
}
3081
4475
 
3082
 
test "$opt_mode" = execute && func_mode_execute ${1+"$@"}
 
4476
test execute = "$opt_mode" && func_mode_execute ${1+"$@"}
3083
4477
 
3084
4478
 
3085
4479
# func_mode_finish arg...
3086
4480
func_mode_finish ()
3087
4481
{
3088
 
    $opt_debug
 
4482
    $debug_cmd
 
4483
 
3089
4484
    libs=
3090
4485
    libdirs=
3091
4486
    admincmds=
3093
4488
    for opt in "$nonopt" ${1+"$@"}
3094
4489
    do
3095
4490
      if test -d "$opt"; then
3096
 
        libdirs+=" $opt"
 
4491
        func_append libdirs " $opt"
3097
4492
 
3098
4493
      elif test -f "$opt"; then
3099
4494
        if func_lalib_unsafe_p "$opt"; then
3100
 
          libs+=" $opt"
 
4495
          func_append libs " $opt"
3101
4496
        else
3102
 
          func_warning "\`$opt' is not a valid libtool archive"
 
4497
          func_warning "'$opt' is not a valid libtool archive"
3103
4498
        fi
3104
4499
 
3105
4500
      else
3106
 
        func_fatal_error "invalid argument \`$opt'"
 
4501
        func_fatal_error "invalid argument '$opt'"
3107
4502
      fi
3108
4503
    done
3109
4504
 
3118
4513
      # Remove sysroot references
3119
4514
      if $opt_dry_run; then
3120
4515
        for lib in $libs; do
3121
 
          echo "removing references to $lt_sysroot and \`=' prefixes from $lib"
 
4516
          echo "removing references to $lt_sysroot and '=' prefixes from $lib"
3122
4517
        done
3123
4518
      else
3124
4519
        tmpdir=`func_mktempdir`
3125
4520
        for lib in $libs; do
3126
 
          sed -e "${sysroot_cmd} s/\([ ']-[LR]\)=/\1/g; s/\([ ']\)=/\1/g" $lib \
 
4521
          $SED -e "$sysroot_cmd s/\([ ']-[LR]\)=/\1/g; s/\([ ']\)=/\1/g" $lib \
3127
4522
            > $tmpdir/tmp-la
3128
4523
          mv -f $tmpdir/tmp-la $lib
3129
4524
        done
3141
4536
        if test -n "$finish_eval"; then
3142
4537
          # Do the single finish_eval.
3143
4538
          eval cmds=\"$finish_eval\"
3144
 
          $opt_dry_run || eval "$cmds" || admincmds+="
 
4539
          $opt_dry_run || eval "$cmds" || func_append admincmds "
3145
4540
       $cmds"
3146
4541
        fi
3147
4542
      done
3148
4543
    fi
3149
4544
 
3150
4545
    # Exit here if they wanted silent mode.
3151
 
    $opt_silent && exit $EXIT_SUCCESS
 
4546
    $opt_quiet && exit $EXIT_SUCCESS
3152
4547
 
3153
4548
    if test -n "$finish_cmds$finish_eval" && test -n "$libdirs"; then
3154
4549
      echo "----------------------------------------------------------------------"
3159
4554
      echo
3160
4555
      echo "If you ever happen to want to link against installed libraries"
3161
4556
      echo "in a given directory, LIBDIR, you must either use libtool, and"
3162
 
      echo "specify the full pathname of the library, or use the \`-LLIBDIR'"
 
4557
      echo "specify the full pathname of the library, or use the '-LLIBDIR'"
3163
4558
      echo "flag during linking and do at least one of the following:"
3164
4559
      if test -n "$shlibpath_var"; then
3165
 
        echo "   - add LIBDIR to the \`$shlibpath_var' environment variable"
 
4560
        echo "   - add LIBDIR to the '$shlibpath_var' environment variable"
3166
4561
        echo "     during execution"
3167
4562
      fi
3168
4563
      if test -n "$runpath_var"; then
3169
 
        echo "   - add LIBDIR to the \`$runpath_var' environment variable"
 
4564
        echo "   - add LIBDIR to the '$runpath_var' environment variable"
3170
4565
        echo "     during linking"
3171
4566
      fi
3172
4567
      if test -n "$hardcode_libdir_flag_spec"; then
3173
4568
        libdir=LIBDIR
3174
4569
        eval flag=\"$hardcode_libdir_flag_spec\"
3175
4570
 
3176
 
        $ECHO "   - use the \`$flag' linker flag"
 
4571
        $ECHO "   - use the '$flag' linker flag"
3177
4572
      fi
3178
4573
      if test -n "$admincmds"; then
3179
4574
        $ECHO "   - have your system administrator run these commands:$admincmds"
3180
4575
      fi
3181
4576
      if test -f /etc/ld.so.conf; then
3182
 
        echo "   - have your system administrator add LIBDIR to \`/etc/ld.so.conf'"
 
4577
        echo "   - have your system administrator add LIBDIR to '/etc/ld.so.conf'"
3183
4578
      fi
3184
4579
      echo
3185
4580
 
3198
4593
    exit $EXIT_SUCCESS
3199
4594
}
3200
4595
 
3201
 
test "$opt_mode" = finish && func_mode_finish ${1+"$@"}
 
4596
test finish = "$opt_mode" && func_mode_finish ${1+"$@"}
3202
4597
 
3203
4598
 
3204
4599
# func_mode_install arg...
3205
4600
func_mode_install ()
3206
4601
{
3207
 
    $opt_debug
 
4602
    $debug_cmd
 
4603
 
3208
4604
    # There may be an optional sh(1) argument at the beginning of
3209
4605
    # install_prog (especially on Windows NT).
3210
 
    if test "$nonopt" = "$SHELL" || test "$nonopt" = /bin/sh ||
 
4606
    if test "$SHELL" = "$nonopt" || test /bin/sh = "$nonopt" ||
3211
4607
       # Allow the use of GNU shtool's install command.
3212
 
       case $nonopt in *shtool*) :;; *) false;; esac; then
 
4608
       case $nonopt in *shtool*) :;; *) false;; esac
 
4609
    then
3213
4610
      # Aesthetically quote it.
3214
4611
      func_quote_for_eval "$nonopt"
3215
4612
      install_prog="$func_quote_for_eval_result "
3223
4620
    # The real first argument should be the name of the installation program.
3224
4621
    # Aesthetically quote it.
3225
4622
    func_quote_for_eval "$arg"
3226
 
    install_prog+="$func_quote_for_eval_result"
 
4623
    func_append install_prog "$func_quote_for_eval_result"
3227
4624
    install_shared_prog=$install_prog
3228
4625
    case " $install_prog " in
3229
4626
      *[\\\ /]cp\ *) install_cp=: ;;
3236
4633
    opts=
3237
4634
    prev=
3238
4635
    install_type=
3239
 
    isdir=no
 
4636
    isdir=false
3240
4637
    stripme=
3241
4638
    no_mode=:
3242
4639
    for arg
3243
4640
    do
3244
4641
      arg2=
3245
4642
      if test -n "$dest"; then
3246
 
        files+=" $dest"
 
4643
        func_append files " $dest"
3247
4644
        dest=$arg
3248
4645
        continue
3249
4646
      fi
3250
4647
 
3251
4648
      case $arg in
3252
 
      -d) isdir=yes ;;
 
4649
      -d) isdir=: ;;
3253
4650
      -f)
3254
4651
        if $install_cp; then :; else
3255
4652
          prev=$arg
3267
4664
      *)
3268
4665
        # If the previous option needed an argument, then skip it.
3269
4666
        if test -n "$prev"; then
3270
 
          if test "x$prev" = x-m && test -n "$install_override_mode"; then
 
4667
          if test X-m = "X$prev" && test -n "$install_override_mode"; then
3271
4668
            arg2=$install_override_mode
3272
4669
            no_mode=false
3273
4670
          fi
3281
4678
 
3282
4679
      # Aesthetically quote the argument.
3283
4680
      func_quote_for_eval "$arg"
3284
 
      install_prog+=" $func_quote_for_eval_result"
 
4681
      func_append install_prog " $func_quote_for_eval_result"
3285
4682
      if test -n "$arg2"; then
3286
4683
        func_quote_for_eval "$arg2"
3287
4684
      fi
3288
 
      install_shared_prog+=" $func_quote_for_eval_result"
 
4685
      func_append install_shared_prog " $func_quote_for_eval_result"
3289
4686
    done
3290
4687
 
3291
4688
    test -z "$install_prog" && \
3292
4689
      func_fatal_help "you must specify an install program"
3293
4690
 
3294
4691
    test -n "$prev" && \
3295
 
      func_fatal_help "the \`$prev' option requires an argument"
 
4692
      func_fatal_help "the '$prev' option requires an argument"
3296
4693
 
3297
4694
    if test -n "$install_override_mode" && $no_mode; then
3298
4695
      if $install_cp; then :; else
3299
4696
        func_quote_for_eval "$install_override_mode"
3300
 
        install_shared_prog+=" -m $func_quote_for_eval_result"
 
4697
        func_append install_shared_prog " -m $func_quote_for_eval_result"
3301
4698
      fi
3302
4699
    fi
3303
4700
 
3314
4711
    dest=$func_stripname_result
3315
4712
 
3316
4713
    # Check to see that the destination is a directory.
3317
 
    test -d "$dest" && isdir=yes
3318
 
    if test "$isdir" = yes; then
3319
 
      destdir="$dest"
 
4714
    test -d "$dest" && isdir=:
 
4715
    if $isdir; then
 
4716
      destdir=$dest
3320
4717
      destname=
3321
4718
    else
3322
4719
      func_dirname_and_basename "$dest" "" "."
3323
 
      destdir="$func_dirname_result"
3324
 
      destname="$func_basename_result"
 
4720
      destdir=$func_dirname_result
 
4721
      destname=$func_basename_result
3325
4722
 
3326
4723
      # Not a directory, so check to see that there is only one file specified.
3327
4724
      set dummy $files; shift
3328
4725
      test "$#" -gt 1 && \
3329
 
        func_fatal_help "\`$dest' is not a directory"
 
4726
        func_fatal_help "'$dest' is not a directory"
3330
4727
    fi
3331
4728
    case $destdir in
3332
4729
    [\\/]* | [A-Za-z]:[\\/]*) ;;
3335
4732
        case $file in
3336
4733
        *.lo) ;;
3337
4734
        *)
3338
 
          func_fatal_help "\`$destdir' must be an absolute directory name"
 
4735
          func_fatal_help "'$destdir' must be an absolute directory name"
3339
4736
          ;;
3340
4737
        esac
3341
4738
      done
3344
4741
 
3345
4742
    # This variable tells wrapper scripts just to set variables rather
3346
4743
    # than running their programs.
3347
 
    libtool_install_magic="$magic"
 
4744
    libtool_install_magic=$magic
3348
4745
 
3349
4746
    staticlibs=
3350
4747
    future_libdirs=
3355
4752
      case $file in
3356
4753
      *.$libext)
3357
4754
        # Do the static libraries later.
3358
 
        staticlibs+=" $file"
 
4755
        func_append staticlibs " $file"
3359
4756
        ;;
3360
4757
 
3361
4758
      *.la)
3364
4761
 
3365
4762
        # Check to see that this really is a libtool archive.
3366
4763
        func_lalib_unsafe_p "$file" \
3367
 
          || func_fatal_help "\`$file' is not a valid libtool archive"
 
4764
          || func_fatal_help "'$file' is not a valid libtool archive"
3368
4765
 
3369
4766
        library_names=
3370
4767
        old_library=
3375
4772
        if test "X$destdir" = "X$libdir"; then
3376
4773
          case "$current_libdirs " in
3377
4774
          *" $libdir "*) ;;
3378
 
          *) current_libdirs+=" $libdir" ;;
 
4775
          *) func_append current_libdirs " $libdir" ;;
3379
4776
          esac
3380
4777
        else
3381
4778
          # Note the libdir as a future libdir.
3382
4779
          case "$future_libdirs " in
3383
4780
          *" $libdir "*) ;;
3384
 
          *) future_libdirs+=" $libdir" ;;
 
4781
          *) func_append future_libdirs " $libdir" ;;
3385
4782
          esac
3386
4783
        fi
3387
4784
 
3388
4785
        func_dirname "$file" "/" ""
3389
 
        dir="$func_dirname_result"
3390
 
        dir+="$objdir"
 
4786
        dir=$func_dirname_result
 
4787
        func_append dir "$objdir"
3391
4788
 
3392
4789
        if test -n "$relink_command"; then
3393
4790
          # Determine the prefix the user has applied to our future dir.
3400
4797
          # are installed into $libdir/../bin (currently, that works fine)
3401
4798
          # but it's something to keep an eye on.
3402
4799
          test "$inst_prefix_dir" = "$destdir" && \
3403
 
            func_fatal_error "error: cannot install \`$file' to a directory not ending in $libdir"
 
4800
            func_fatal_error "error: cannot install '$file' to a directory not ending in $libdir"
3404
4801
 
3405
4802
          if test -n "$inst_prefix_dir"; then
3406
4803
            # Stick the inst_prefix_dir data into the link command.
3409
4806
            relink_command=`$ECHO "$relink_command" | $SED "s%@inst_prefix_dir@%%"`
3410
4807
          fi
3411
4808
 
3412
 
          func_warning "relinking \`$file'"
 
4809
          func_warning "relinking '$file'"
3413
4810
          func_show_eval "$relink_command" \
3414
 
            'func_fatal_error "error: relink \`$file'\'' with the above command before installing it"'
 
4811
            'func_fatal_error "error: relink '\''$file'\'' with the above command before installing it"'
3415
4812
        fi
3416
4813
 
3417
4814
        # See the names of the shared library.
3418
4815
        set dummy $library_names; shift
3419
4816
        if test -n "$1"; then
3420
 
          realname="$1"
 
4817
          realname=$1
3421
4818
          shift
3422
4819
 
3423
 
          srcname="$realname"
3424
 
          test -n "$relink_command" && srcname="$realname"T
 
4820
          srcname=$realname
 
4821
          test -n "$relink_command" && srcname=${realname}T
3425
4822
 
3426
4823
          # Install the shared library and build the symlinks.
3427
4824
          func_show_eval "$install_shared_prog $dir/$srcname $destdir/$realname" \
3428
4825
              'exit $?'
3429
 
          tstripme="$stripme"
 
4826
          tstripme=$stripme
3430
4827
          case $host_os in
3431
4828
          cygwin* | mingw* | pw32* | cegcc*)
3432
4829
            case $realname in
3433
4830
            *.dll.a)
3434
 
              tstripme=""
 
4831
              tstripme=
 
4832
              ;;
 
4833
            esac
 
4834
            ;;
 
4835
          os2*)
 
4836
            case $realname in
 
4837
            *_dll.a)
 
4838
              tstripme=
3435
4839
              ;;
3436
4840
            esac
3437
4841
            ;;
3442
4846
 
3443
4847
          if test "$#" -gt 0; then
3444
4848
            # Delete the old symlinks, and create new ones.
3445
 
            # Try `ln -sf' first, because the `ln' binary might depend on
 
4849
            # Try 'ln -sf' first, because the 'ln' binary might depend on
3446
4850
            # the symlink we replace!  Solaris /bin/ln does not understand -f,
3447
4851
            # so we also need to try rm && ln -s.
3448
4852
            for linkname
3453
4857
          fi
3454
4858
 
3455
4859
          # Do each command in the postinstall commands.
3456
 
          lib="$destdir/$realname"
 
4860
          lib=$destdir/$realname
3457
4861
          func_execute_cmds "$postinstall_cmds" 'exit $?'
3458
4862
        fi
3459
4863
 
3460
4864
        # Install the pseudo-library for information purposes.
3461
4865
        func_basename "$file"
3462
 
        name="$func_basename_result"
3463
 
        instname="$dir/$name"i
 
4866
        name=$func_basename_result
 
4867
        instname=$dir/${name}i
3464
4868
        func_show_eval "$install_prog $instname $destdir/$name" 'exit $?'
3465
4869
 
3466
4870
        # Maybe install the static library, too.
3467
 
        test -n "$old_library" && staticlibs+=" $dir/$old_library"
 
4871
        test -n "$old_library" && func_append staticlibs " $dir/$old_library"
3468
4872
        ;;
3469
4873
 
3470
4874
      *.lo)
3472
4876
 
3473
4877
        # Figure out destination file name, if it wasn't already specified.
3474
4878
        if test -n "$destname"; then
3475
 
          destfile="$destdir/$destname"
 
4879
          destfile=$destdir/$destname
3476
4880
        else
3477
4881
          func_basename "$file"
3478
 
          destfile="$func_basename_result"
3479
 
          destfile="$destdir/$destfile"
 
4882
          destfile=$func_basename_result
 
4883
          destfile=$destdir/$destfile
3480
4884
        fi
3481
4885
 
3482
4886
        # Deduce the name of the destination old-style object file.
3486
4890
          staticdest=$func_lo2o_result
3487
4891
          ;;
3488
4892
        *.$objext)
3489
 
          staticdest="$destfile"
 
4893
          staticdest=$destfile
3490
4894
          destfile=
3491
4895
          ;;
3492
4896
        *)
3493
 
          func_fatal_help "cannot copy a libtool object to \`$destfile'"
 
4897
          func_fatal_help "cannot copy a libtool object to '$destfile'"
3494
4898
          ;;
3495
4899
        esac
3496
4900
 
3499
4903
          func_show_eval "$install_prog $file $destfile" 'exit $?'
3500
4904
 
3501
4905
        # Install the old object if enabled.
3502
 
        if test "$build_old_libs" = yes; then
 
4906
        if test yes = "$build_old_libs"; then
3503
4907
          # Deduce the name of the old-style object file.
3504
4908
          func_lo2o "$file"
3505
4909
          staticobj=$func_lo2o_result
3511
4915
      *)
3512
4916
        # Figure out destination file name, if it wasn't already specified.
3513
4917
        if test -n "$destname"; then
3514
 
          destfile="$destdir/$destname"
 
4918
          destfile=$destdir/$destname
3515
4919
        else
3516
4920
          func_basename "$file"
3517
 
          destfile="$func_basename_result"
3518
 
          destfile="$destdir/$destfile"
 
4921
          destfile=$func_basename_result
 
4922
          destfile=$destdir/$destfile
3519
4923
        fi
3520
4924
 
3521
4925
        # If the file is missing, and there is a .exe on the end, strip it
3522
4926
        # because it is most likely a libtool script we actually want to
3523
4927
        # install
3524
 
        stripped_ext=""
 
4928
        stripped_ext=
3525
4929
        case $file in
3526
4930
          *.exe)
3527
4931
            if test ! -f "$file"; then
3528
4932
              func_stripname '' '.exe' "$file"
3529
4933
              file=$func_stripname_result
3530
 
              stripped_ext=".exe"
 
4934
              stripped_ext=.exe
3531
4935
            fi
3532
4936
            ;;
3533
4937
        esac
3555
4959
 
3556
4960
          # Check the variables that should have been set.
3557
4961
          test -z "$generated_by_libtool_version" && \
3558
 
            func_fatal_error "invalid libtool wrapper script \`$wrapper'"
 
4962
            func_fatal_error "invalid libtool wrapper script '$wrapper'"
3559
4963
 
3560
 
          finalize=yes
 
4964
          finalize=:
3561
4965
          for lib in $notinst_deplibs; do
3562
4966
            # Check to see that each library is installed.
3563
4967
            libdir=
3564
4968
            if test -f "$lib"; then
3565
4969
              func_source "$lib"
3566
4970
            fi
3567
 
            libfile="$libdir/"`$ECHO "$lib" | $SED 's%^.*/%%g'` ### testsuite: skip nested quoting test
 
4971
            libfile=$libdir/`$ECHO "$lib" | $SED 's%^.*/%%g'`
3568
4972
            if test -n "$libdir" && test ! -f "$libfile"; then
3569
 
              func_warning "\`$lib' has not been installed in \`$libdir'"
3570
 
              finalize=no
 
4973
              func_warning "'$lib' has not been installed in '$libdir'"
 
4974
              finalize=false
3571
4975
            fi
3572
4976
          done
3573
4977
 
3575
4979
          func_source "$wrapper"
3576
4980
 
3577
4981
          outputname=
3578
 
          if test "$fast_install" = no && test -n "$relink_command"; then
 
4982
          if test no = "$fast_install" && test -n "$relink_command"; then
3579
4983
            $opt_dry_run || {
3580
 
              if test "$finalize" = yes; then
 
4984
              if $finalize; then
3581
4985
                tmpdir=`func_mktempdir`
3582
4986
                func_basename "$file$stripped_ext"
3583
 
                file="$func_basename_result"
3584
 
                outputname="$tmpdir/$file"
 
4987
                file=$func_basename_result
 
4988
                outputname=$tmpdir/$file
3585
4989
                # Replace the output file specification.
3586
4990
                relink_command=`$ECHO "$relink_command" | $SED 's%@OUTPUT@%'"$outputname"'%g'`
3587
4991
 
3588
 
                $opt_silent || {
 
4992
                $opt_quiet || {
3589
4993
                  func_quote_for_expand "$relink_command"
3590
4994
                  eval "func_echo $func_quote_for_expand_result"
3591
4995
                }
3592
4996
                if eval "$relink_command"; then :
3593
4997
                  else
3594
 
                  func_error "error: relink \`$file' with the above command before installing it"
 
4998
                  func_error "error: relink '$file' with the above command before installing it"
3595
4999
                  $opt_dry_run || ${RM}r "$tmpdir"
3596
5000
                  continue
3597
5001
                fi
3598
 
                file="$outputname"
 
5002
                file=$outputname
3599
5003
              else
3600
 
                func_warning "cannot relink \`$file'"
 
5004
                func_warning "cannot relink '$file'"
3601
5005
              fi
3602
5006
            }
3603
5007
          else
3634
5038
 
3635
5039
    for file in $staticlibs; do
3636
5040
      func_basename "$file"
3637
 
      name="$func_basename_result"
 
5041
      name=$func_basename_result
3638
5042
 
3639
5043
      # Set up the ranlib parameters.
3640
 
      oldlib="$destdir/$name"
 
5044
      oldlib=$destdir/$name
3641
5045
      func_to_tool_file "$oldlib" func_convert_file_msys_to_w32
3642
5046
      tool_oldlib=$func_to_tool_file_result
3643
5047
 
3652
5056
    done
3653
5057
 
3654
5058
    test -n "$future_libdirs" && \
3655
 
      func_warning "remember to run \`$progname --finish$future_libdirs'"
 
5059
      func_warning "remember to run '$progname --finish$future_libdirs'"
3656
5060
 
3657
5061
    if test -n "$current_libdirs"; then
3658
5062
      # Maybe just do a dry run.
3659
5063
      $opt_dry_run && current_libdirs=" -n$current_libdirs"
3660
 
      exec_cmd='$SHELL $progpath $preserve_args --finish$current_libdirs'
 
5064
      exec_cmd='$SHELL "$progpath" $preserve_args --finish$current_libdirs'
3661
5065
    else
3662
5066
      exit $EXIT_SUCCESS
3663
5067
    fi
3664
5068
}
3665
5069
 
3666
 
test "$opt_mode" = install && func_mode_install ${1+"$@"}
 
5070
test install = "$opt_mode" && func_mode_install ${1+"$@"}
3667
5071
 
3668
5072
 
3669
5073
# func_generate_dlsyms outputname originator pic_p
3671
5075
# a dlpreopen symbol table.
3672
5076
func_generate_dlsyms ()
3673
5077
{
3674
 
    $opt_debug
3675
 
    my_outputname="$1"
3676
 
    my_originator="$2"
3677
 
    my_pic_p="${3-no}"
3678
 
    my_prefix=`$ECHO "$my_originator" | sed 's%[^a-zA-Z0-9]%_%g'`
 
5078
    $debug_cmd
 
5079
 
 
5080
    my_outputname=$1
 
5081
    my_originator=$2
 
5082
    my_pic_p=${3-false}
 
5083
    my_prefix=`$ECHO "$my_originator" | $SED 's%[^a-zA-Z0-9]%_%g'`
3679
5084
    my_dlsyms=
3680
5085
 
3681
 
    if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then
 
5086
    if test -n "$dlfiles$dlprefiles" || test no != "$dlself"; then
3682
5087
      if test -n "$NM" && test -n "$global_symbol_pipe"; then
3683
 
        my_dlsyms="${my_outputname}S.c"
 
5088
        my_dlsyms=${my_outputname}S.c
3684
5089
      else
3685
5090
        func_error "not configured to extract global symbols from dlpreopened files"
3686
5091
      fi
3691
5096
      "") ;;
3692
5097
      *.c)
3693
5098
        # Discover the nlist of each of the dlfiles.
3694
 
        nlist="$output_objdir/${my_outputname}.nm"
 
5099
        nlist=$output_objdir/$my_outputname.nm
3695
5100
 
3696
5101
        func_show_eval "$RM $nlist ${nlist}S ${nlist}T"
3697
5102
 
3699
5104
        func_verbose "creating $output_objdir/$my_dlsyms"
3700
5105
 
3701
5106
        $opt_dry_run || $ECHO > "$output_objdir/$my_dlsyms" "\
3702
 
/* $my_dlsyms - symbol resolution table for \`$my_outputname' dlsym emulation. */
3703
 
/* Generated by $PROGRAM (GNU $PACKAGE$TIMESTAMP) $VERSION */
 
5107
/* $my_dlsyms - symbol resolution table for '$my_outputname' dlsym emulation. */
 
5108
/* Generated by $PROGRAM (GNU $PACKAGE) $VERSION */
3704
5109
 
3705
5110
#ifdef __cplusplus
3706
5111
extern \"C\" {
3707
5112
#endif
3708
5113
 
3709
 
#if defined(__GNUC__) && (((__GNUC__ == 4) && (__GNUC_MINOR__ >= 4)) || (__GNUC__ > 4))
 
5114
#if defined __GNUC__ && (((__GNUC__ == 4) && (__GNUC_MINOR__ >= 4)) || (__GNUC__ > 4))
3710
5115
#pragma GCC diagnostic ignored \"-Wstrict-prototypes\"
3711
5116
#endif
3712
5117
 
3713
5118
/* Keep this code in sync between libtool.m4, ltmain, lt_system.h, and tests.  */
3714
 
#if defined(_WIN32) || defined(__CYGWIN__) || defined(_WIN32_WCE)
3715
 
/* DATA imports from DLLs on WIN32 con't be const, because runtime
 
5119
#if defined _WIN32 || defined __CYGWIN__ || defined _WIN32_WCE
 
5120
/* DATA imports from DLLs on WIN32 can't be const, because runtime
3716
5121
   relocations are performed -- see ld's documentation on pseudo-relocs.  */
3717
5122
# define LT_DLSYM_CONST
3718
 
#elif defined(__osf__)
 
5123
#elif defined __osf__
3719
5124
/* This system does not cope well with relocations in const data.  */
3720
5125
# define LT_DLSYM_CONST
3721
5126
#else
3722
5127
# define LT_DLSYM_CONST const
3723
5128
#endif
3724
5129
 
 
5130
#define STREQ(s1, s2) (strcmp ((s1), (s2)) == 0)
 
5131
 
3725
5132
/* External symbol declarations for the compiler. */\
3726
5133
"
3727
5134
 
3728
 
        if test "$dlself" = yes; then
3729
 
          func_verbose "generating symbol list for \`$output'"
 
5135
        if test yes = "$dlself"; then
 
5136
          func_verbose "generating symbol list for '$output'"
3730
5137
 
3731
5138
          $opt_dry_run || echo ': @PROGRAM@ ' > "$nlist"
3732
5139
 
3734
5141
          progfiles=`$ECHO "$objs$old_deplibs" | $SP2NL | $SED "$lo2o" | $NL2SP`
3735
5142
          for progfile in $progfiles; do
3736
5143
            func_to_tool_file "$progfile" func_convert_file_msys_to_w32
3737
 
            func_verbose "extracting global C symbols from \`$func_to_tool_file_result'"
 
5144
            func_verbose "extracting global C symbols from '$func_to_tool_file_result'"
3738
5145
            $opt_dry_run || eval "$NM $func_to_tool_file_result | $global_symbol_pipe >> '$nlist'"
3739
5146
          done
3740
5147
 
3754
5161
 
3755
5162
          # Prepare the list of exported symbols
3756
5163
          if test -z "$export_symbols"; then
3757
 
            export_symbols="$output_objdir/$outputname.exp"
 
5164
            export_symbols=$output_objdir/$outputname.exp
3758
5165
            $opt_dry_run || {
3759
5166
              $RM $export_symbols
3760
 
              eval "${SED} -n -e '/^: @PROGRAM@ $/d' -e 's/^.* \(.*\)$/\1/p' "'< "$nlist" > "$export_symbols"'
 
5167
              eval "$SED -n -e '/^: @PROGRAM@ $/d' -e 's/^.* \(.*\)$/\1/p' "'< "$nlist" > "$export_symbols"'
3761
5168
              case $host in
3762
5169
              *cygwin* | *mingw* | *cegcc* )
3763
5170
                eval "echo EXPORTS "'> "$output_objdir/$outputname.def"'
3767
5174
            }
3768
5175
          else
3769
5176
            $opt_dry_run || {
3770
 
              eval "${SED} -e 's/\([].[*^$]\)/\\\\\1/g' -e 's/^/ /' -e 's/$/$/'"' < "$export_symbols" > "$output_objdir/$outputname.exp"'
 
5177
              eval "$SED -e 's/\([].[*^$]\)/\\\\\1/g' -e 's/^/ /' -e 's/$/$/'"' < "$export_symbols" > "$output_objdir/$outputname.exp"'
3771
5178
              eval '$GREP -f "$output_objdir/$outputname.exp" < "$nlist" > "$nlist"T'
3772
5179
              eval '$MV "$nlist"T "$nlist"'
3773
5180
              case $host in
3781
5188
        fi
3782
5189
 
3783
5190
        for dlprefile in $dlprefiles; do
3784
 
          func_verbose "extracting global C symbols from \`$dlprefile'"
 
5191
          func_verbose "extracting global C symbols from '$dlprefile'"
3785
5192
          func_basename "$dlprefile"
3786
 
          name="$func_basename_result"
 
5193
          name=$func_basename_result
3787
5194
          case $host in
3788
5195
            *cygwin* | *mingw* | *cegcc* )
3789
5196
              # if an import library, we need to obtain dlname
3790
5197
              if func_win32_import_lib_p "$dlprefile"; then
3791
5198
                func_tr_sh "$dlprefile"
3792
5199
                eval "curr_lafile=\$libfile_$func_tr_sh_result"
3793
 
                dlprefile_dlbasename=""
 
5200
                dlprefile_dlbasename=
3794
5201
                if test -n "$curr_lafile" && func_lalib_p "$curr_lafile"; then
3795
5202
                  # Use subshell, to avoid clobbering current variable values
3796
5203
                  dlprefile_dlname=`source "$curr_lafile" && echo "$dlname"`
3797
 
                  if test -n "$dlprefile_dlname" ; then
 
5204
                  if test -n "$dlprefile_dlname"; then
3798
5205
                    func_basename "$dlprefile_dlname"
3799
 
                    dlprefile_dlbasename="$func_basename_result"
 
5206
                    dlprefile_dlbasename=$func_basename_result
3800
5207
                  else
3801
5208
                    # no lafile. user explicitly requested -dlpreopen <import library>.
3802
5209
                    $sharedlib_from_linklib_cmd "$dlprefile"
3804
5211
                  fi
3805
5212
                fi
3806
5213
                $opt_dry_run || {
3807
 
                  if test -n "$dlprefile_dlbasename" ; then
 
5214
                  if test -n "$dlprefile_dlbasename"; then
3808
5215
                    eval '$ECHO ": $dlprefile_dlbasename" >> "$nlist"'
3809
5216
                  else
3810
5217
                    func_warning "Could not compute DLL name from $name"
3860
5267
            echo '/* NONE */' >> "$output_objdir/$my_dlsyms"
3861
5268
          fi
3862
5269
 
 
5270
          func_show_eval '$RM "${nlist}I"'
 
5271
          if test -n "$global_symbol_to_import"; then
 
5272
            eval "$global_symbol_to_import"' < "$nlist"S > "$nlist"I'
 
5273
          fi
 
5274
 
3863
5275
          echo >> "$output_objdir/$my_dlsyms" "\
3864
5276
 
3865
5277
/* The mapping between symbol names and symbols.  */
3868
5280
  void *address;
3869
5281
} lt_dlsymlist;
3870
5282
extern LT_DLSYM_CONST lt_dlsymlist
3871
 
lt_${my_prefix}_LTX_preloaded_symbols[];
 
5283
lt_${my_prefix}_LTX_preloaded_symbols[];\
 
5284
"
 
5285
 
 
5286
          if test -s "$nlist"I; then
 
5287
            echo >> "$output_objdir/$my_dlsyms" "\
 
5288
static void lt_syminit(void)
 
5289
{
 
5290
  LT_DLSYM_CONST lt_dlsymlist *symbol = lt_${my_prefix}_LTX_preloaded_symbols;
 
5291
  for (; symbol->name; ++symbol)
 
5292
    {"
 
5293
            $SED 's/.*/      if (STREQ (symbol->name, \"&\")) symbol->address = (void *) \&&;/' < "$nlist"I >> "$output_objdir/$my_dlsyms"
 
5294
            echo >> "$output_objdir/$my_dlsyms" "\
 
5295
    }
 
5296
}"
 
5297
          fi
 
5298
          echo >> "$output_objdir/$my_dlsyms" "\
3872
5299
LT_DLSYM_CONST lt_dlsymlist
3873
5300
lt_${my_prefix}_LTX_preloaded_symbols[] =
3874
 
{\
3875
 
  { \"$my_originator\", (void *) 0 },"
 
5301
{ {\"$my_originator\", (void *) 0},"
 
5302
 
 
5303
          if test -s "$nlist"I; then
 
5304
            echo >> "$output_objdir/$my_dlsyms" "\
 
5305
  {\"@INIT@\", (void *) &lt_syminit},"
 
5306
          fi
3876
5307
 
3877
5308
          case $need_lib_prefix in
3878
5309
          no)
3914
5345
          *-*-hpux*)
3915
5346
            pic_flag_for_symtable=" $pic_flag"  ;;
3916
5347
          *)
3917
 
            if test "X$my_pic_p" != Xno; then
3918
 
              pic_flag_for_symtable=" $pic_flag"
3919
 
            fi
 
5348
            $my_pic_p && pic_flag_for_symtable=" $pic_flag"
3920
5349
            ;;
3921
5350
          esac
3922
5351
          ;;
3925
5354
        for arg in $LTCFLAGS; do
3926
5355
          case $arg in
3927
5356
          -pie | -fpie | -fPIE) ;;
3928
 
          *) symtab_cflags+=" $arg" ;;
 
5357
          *) func_append symtab_cflags " $arg" ;;
3929
5358
          esac
3930
5359
        done
3931
5360
 
3933
5362
        func_show_eval '(cd $output_objdir && $LTCC$symtab_cflags -c$no_builtin_flag$pic_flag_for_symtable "$my_dlsyms")' 'exit $?'
3934
5363
 
3935
5364
        # Clean up the generated files.
3936
 
        func_show_eval '$RM "$output_objdir/$my_dlsyms" "$nlist" "${nlist}S" "${nlist}T"'
 
5365
        func_show_eval '$RM "$output_objdir/$my_dlsyms" "$nlist" "${nlist}S" "${nlist}T" "${nlist}I"'
3937
5366
 
3938
5367
        # Transform the symbol file into the correct name.
3939
 
        symfileobj="$output_objdir/${my_outputname}S.$objext"
 
5368
        symfileobj=$output_objdir/${my_outputname}S.$objext
3940
5369
        case $host in
3941
5370
        *cygwin* | *mingw* | *cegcc* )
3942
5371
          if test -f "$output_objdir/$my_outputname.def"; then
3954
5383
        esac
3955
5384
        ;;
3956
5385
      *)
3957
 
        func_fatal_error "unknown suffix for \`$my_dlsyms'"
 
5386
        func_fatal_error "unknown suffix for '$my_dlsyms'"
3958
5387
        ;;
3959
5388
      esac
3960
5389
    else
3968
5397
    fi
3969
5398
}
3970
5399
 
 
5400
# func_cygming_gnu_implib_p ARG
 
5401
# This predicate returns with zero status (TRUE) if
 
5402
# ARG is a GNU/binutils-style import library. Returns
 
5403
# with nonzero status (FALSE) otherwise.
 
5404
func_cygming_gnu_implib_p ()
 
5405
{
 
5406
  $debug_cmd
 
5407
 
 
5408
  func_to_tool_file "$1" func_convert_file_msys_to_w32
 
5409
  func_cygming_gnu_implib_tmp=`$NM "$func_to_tool_file_result" | eval "$global_symbol_pipe" | $EGREP ' (_head_[A-Za-z0-9_]+_[ad]l*|[A-Za-z0-9_]+_[ad]l*_iname)$'`
 
5410
  test -n "$func_cygming_gnu_implib_tmp"
 
5411
}
 
5412
 
 
5413
# func_cygming_ms_implib_p ARG
 
5414
# This predicate returns with zero status (TRUE) if
 
5415
# ARG is an MS-style import library. Returns
 
5416
# with nonzero status (FALSE) otherwise.
 
5417
func_cygming_ms_implib_p ()
 
5418
{
 
5419
  $debug_cmd
 
5420
 
 
5421
  func_to_tool_file "$1" func_convert_file_msys_to_w32
 
5422
  func_cygming_ms_implib_tmp=`$NM "$func_to_tool_file_result" | eval "$global_symbol_pipe" | $GREP '_NULL_IMPORT_DESCRIPTOR'`
 
5423
  test -n "$func_cygming_ms_implib_tmp"
 
5424
}
 
5425
 
3971
5426
# func_win32_libid arg
3972
5427
# return the library type of file 'arg'
3973
5428
#
3977
5432
# Despite the name, also deal with 64 bit binaries.
3978
5433
func_win32_libid ()
3979
5434
{
3980
 
  $opt_debug
3981
 
  win32_libid_type="unknown"
 
5435
  $debug_cmd
 
5436
 
 
5437
  win32_libid_type=unknown
3982
5438
  win32_fileres=`file -L $1 2>/dev/null`
3983
5439
  case $win32_fileres in
3984
5440
  *ar\ archive\ import\ library*) # definitely import
3988
5444
    # Keep the egrep pattern in sync with the one in _LT_CHECK_MAGIC_METHOD.
3989
5445
    if eval $OBJDUMP -f $1 | $SED -e '10q' 2>/dev/null |
3990
5446
       $EGREP 'file format (pei*-i386(.*architecture: i386)?|pe-arm-wince|pe-x86-64)' >/dev/null; then
3991
 
      func_to_tool_file "$1" func_convert_file_msys_to_w32
3992
 
      win32_nmres=`eval $NM -f posix -A \"$func_to_tool_file_result\" |
3993
 
        $SED -n -e '
 
5447
      case $nm_interface in
 
5448
      "MS dumpbin")
 
5449
        if func_cygming_ms_implib_p "$1" ||
 
5450
           func_cygming_gnu_implib_p "$1"
 
5451
        then
 
5452
          win32_nmres=import
 
5453
        else
 
5454
          win32_nmres=
 
5455
        fi
 
5456
        ;;
 
5457
      *)
 
5458
        func_to_tool_file "$1" func_convert_file_msys_to_w32
 
5459
        win32_nmres=`eval $NM -f posix -A \"$func_to_tool_file_result\" |
 
5460
          $SED -n -e '
3994
5461
            1,100{
3995
5462
                / I /{
3996
 
                    s,.*,import,
 
5463
                    s|.*|import|
3997
5464
                    p
3998
5465
                    q
3999
5466
                }
4000
5467
            }'`
 
5468
        ;;
 
5469
      esac
4001
5470
      case $win32_nmres in
4002
5471
      import*)  win32_libid_type="x86 archive import";;
4003
5472
      *)        win32_libid_type="x86 archive static";;
4029
5498
#    $sharedlib_from_linklib_result
4030
5499
func_cygming_dll_for_implib ()
4031
5500
{
4032
 
  $opt_debug
 
5501
  $debug_cmd
 
5502
 
4033
5503
  sharedlib_from_linklib_result=`$DLLTOOL --identify-strict --identify "$1"`
4034
5504
}
4035
5505
 
4046
5516
# specified import library.
4047
5517
func_cygming_dll_for_implib_fallback_core ()
4048
5518
{
4049
 
  $opt_debug
 
5519
  $debug_cmd
 
5520
 
4050
5521
  match_literal=`$ECHO "$1" | $SED "$sed_make_literal_regex"`
4051
5522
  $OBJDUMP -s --section "$1" "$2" 2>/dev/null |
4052
5523
    $SED '/^Contents of section '"$match_literal"':/{
4082
5553
      /./p' |
4083
5554
    # we now have a list, one entry per line, of the stringified
4084
5555
    # contents of the appropriate section of all members of the
4085
 
    # archive which possess that section. Heuristic: eliminate
4086
 
    # all those which have a first or second character that is
 
5556
    # archive that possess that section. Heuristic: eliminate
 
5557
    # all those that have a first or second character that is
4087
5558
    # a '.' (that is, objdump's representation of an unprintable
4088
5559
    # character.) This should work for all archives with less than
4089
5560
    # 0x302f exports -- but will fail for DLLs whose name actually
4094
5565
    $SED -e '/^\./d;/^.\./d;q'
4095
5566
}
4096
5567
 
4097
 
# func_cygming_gnu_implib_p ARG
4098
 
# This predicate returns with zero status (TRUE) if
4099
 
# ARG is a GNU/binutils-style import library. Returns
4100
 
# with nonzero status (FALSE) otherwise.
4101
 
func_cygming_gnu_implib_p ()
4102
 
{
4103
 
  $opt_debug
4104
 
  func_to_tool_file "$1" func_convert_file_msys_to_w32
4105
 
  func_cygming_gnu_implib_tmp=`$NM "$func_to_tool_file_result" | eval "$global_symbol_pipe" | $EGREP ' (_head_[A-Za-z0-9_]+_[ad]l*|[A-Za-z0-9_]+_[ad]l*_iname)$'`
4106
 
  test -n "$func_cygming_gnu_implib_tmp"
4107
 
}
4108
 
 
4109
 
# func_cygming_ms_implib_p ARG
4110
 
# This predicate returns with zero status (TRUE) if
4111
 
# ARG is an MS-style import library. Returns
4112
 
# with nonzero status (FALSE) otherwise.
4113
 
func_cygming_ms_implib_p ()
4114
 
{
4115
 
  $opt_debug
4116
 
  func_to_tool_file "$1" func_convert_file_msys_to_w32
4117
 
  func_cygming_ms_implib_tmp=`$NM "$func_to_tool_file_result" | eval "$global_symbol_pipe" | $GREP '_NULL_IMPORT_DESCRIPTOR'`
4118
 
  test -n "$func_cygming_ms_implib_tmp"
4119
 
}
4120
 
 
4121
5568
# func_cygming_dll_for_implib_fallback ARG
4122
5569
# Platform-specific function to extract the
4123
5570
# name of the DLL associated with the specified
4131
5578
#    $sharedlib_from_linklib_result
4132
5579
func_cygming_dll_for_implib_fallback ()
4133
5580
{
4134
 
  $opt_debug
4135
 
  if func_cygming_gnu_implib_p "$1" ; then
 
5581
  $debug_cmd
 
5582
 
 
5583
  if func_cygming_gnu_implib_p "$1"; then
4136
5584
    # binutils import library
4137
5585
    sharedlib_from_linklib_result=`func_cygming_dll_for_implib_fallback_core '.idata$7' "$1"`
4138
 
  elif func_cygming_ms_implib_p "$1" ; then
 
5586
  elif func_cygming_ms_implib_p "$1"; then
4139
5587
    # ms-generated import library
4140
5588
    sharedlib_from_linklib_result=`func_cygming_dll_for_implib_fallback_core '.idata$6' "$1"`
4141
5589
  else
4142
5590
    # unknown
4143
 
    sharedlib_from_linklib_result=""
 
5591
    sharedlib_from_linklib_result=
4144
5592
  fi
4145
5593
}
4146
5594
 
4148
5596
# func_extract_an_archive dir oldlib
4149
5597
func_extract_an_archive ()
4150
5598
{
4151
 
    $opt_debug
4152
 
    f_ex_an_ar_dir="$1"; shift
4153
 
    f_ex_an_ar_oldlib="$1"
4154
 
    if test "$lock_old_archive_extraction" = yes; then
 
5599
    $debug_cmd
 
5600
 
 
5601
    f_ex_an_ar_dir=$1; shift
 
5602
    f_ex_an_ar_oldlib=$1
 
5603
    if test yes = "$lock_old_archive_extraction"; then
4155
5604
      lockfile=$f_ex_an_ar_oldlib.lock
4156
5605
      until $opt_dry_run || ln "$progpath" "$lockfile" 2>/dev/null; do
4157
5606
        func_echo "Waiting for $lockfile to be removed"
4160
5609
    fi
4161
5610
    func_show_eval "(cd \$f_ex_an_ar_dir && $AR x \"\$f_ex_an_ar_oldlib\")" \
4162
5611
                   'stat=$?; rm -f "$lockfile"; exit $stat'
4163
 
    if test "$lock_old_archive_extraction" = yes; then
 
5612
    if test yes = "$lock_old_archive_extraction"; then
4164
5613
      $opt_dry_run || rm -f "$lockfile"
4165
5614
    fi
4166
5615
    if ($AR t "$f_ex_an_ar_oldlib" | sort | sort -uc >/dev/null 2>&1); then
4174
5623
# func_extract_archives gentop oldlib ...
4175
5624
func_extract_archives ()
4176
5625
{
4177
 
    $opt_debug
4178
 
    my_gentop="$1"; shift
 
5626
    $debug_cmd
 
5627
 
 
5628
    my_gentop=$1; shift
4179
5629
    my_oldlibs=${1+"$@"}
4180
 
    my_oldobjs=""
4181
 
    my_xlib=""
4182
 
    my_xabs=""
4183
 
    my_xdir=""
 
5630
    my_oldobjs=
 
5631
    my_xlib=
 
5632
    my_xabs=
 
5633
    my_xdir=
4184
5634
 
4185
5635
    for my_xlib in $my_oldlibs; do
4186
5636
      # Extract the objects.
4187
5637
      case $my_xlib in
4188
 
        [\\/]* | [A-Za-z]:[\\/]*) my_xabs="$my_xlib" ;;
 
5638
        [\\/]* | [A-Za-z]:[\\/]*) my_xabs=$my_xlib ;;
4189
5639
        *) my_xabs=`pwd`"/$my_xlib" ;;
4190
5640
      esac
4191
5641
      func_basename "$my_xlib"
4192
 
      my_xlib="$func_basename_result"
 
5642
      my_xlib=$func_basename_result
4193
5643
      my_xlib_u=$my_xlib
4194
5644
      while :; do
4195
5645
        case " $extracted_archives " in
4201
5651
        esac
4202
5652
      done
4203
5653
      extracted_archives="$extracted_archives $my_xlib_u"
4204
 
      my_xdir="$my_gentop/$my_xlib_u"
 
5654
      my_xdir=$my_gentop/$my_xlib_u
4205
5655
 
4206
5656
      func_mkdir_p "$my_xdir"
4207
5657
 
4214
5664
          cd $my_xdir || exit $?
4215
5665
          darwin_archive=$my_xabs
4216
5666
          darwin_curdir=`pwd`
4217
 
          darwin_base_archive=`basename "$darwin_archive"`
 
5667
          func_basename "$darwin_archive"
 
5668
          darwin_base_archive=$func_basename_result
4218
5669
          darwin_arches=`$LIPO -info "$darwin_archive" 2>/dev/null | $GREP Architectures 2>/dev/null || true`
4219
5670
          if test -n "$darwin_arches"; then
4220
5671
            darwin_arches=`$ECHO "$darwin_arches" | $SED -e 's/.*are://'`
4221
5672
            darwin_arch=
4222
5673
            func_verbose "$darwin_base_archive has multiple architectures $darwin_arches"
4223
 
            for darwin_arch in  $darwin_arches ; do
4224
 
              func_mkdir_p "unfat-$$/${darwin_base_archive}-${darwin_arch}"
4225
 
              $LIPO -thin $darwin_arch -output "unfat-$$/${darwin_base_archive}-${darwin_arch}/${darwin_base_archive}" "${darwin_archive}"
4226
 
              cd "unfat-$$/${darwin_base_archive}-${darwin_arch}"
4227
 
              func_extract_an_archive "`pwd`" "${darwin_base_archive}"
 
5674
            for darwin_arch in  $darwin_arches; do
 
5675
              func_mkdir_p "unfat-$$/$darwin_base_archive-$darwin_arch"
 
5676
              $LIPO -thin $darwin_arch -output "unfat-$$/$darwin_base_archive-$darwin_arch/$darwin_base_archive" "$darwin_archive"
 
5677
              cd "unfat-$$/$darwin_base_archive-$darwin_arch"
 
5678
              func_extract_an_archive "`pwd`" "$darwin_base_archive"
4228
5679
              cd "$darwin_curdir"
4229
 
              $RM "unfat-$$/${darwin_base_archive}-${darwin_arch}/${darwin_base_archive}"
 
5680
              $RM "unfat-$$/$darwin_base_archive-$darwin_arch/$darwin_base_archive"
4230
5681
            done # $darwin_arches
4231
5682
            ## Okay now we've a bunch of thin objects, gotta fatten them up :)
4232
 
            darwin_filelist=`find unfat-$$ -type f -name \*.o -print -o -name \*.lo -print | $SED -e "$basename" | sort -u`
 
5683
            darwin_filelist=`find unfat-$$ -type f -name \*.o -print -o -name \*.lo -print | $SED -e "$sed_basename" | sort -u`
4233
5684
            darwin_file=
4234
5685
            darwin_files=
4235
5686
            for darwin_file in $darwin_filelist; do
4251
5702
      my_oldobjs="$my_oldobjs "`find $my_xdir -name \*.$objext -print -o -name \*.lo -print | sort | $NL2SP`
4252
5703
    done
4253
5704
 
4254
 
    func_extract_archives_result="$my_oldobjs"
 
5705
    func_extract_archives_result=$my_oldobjs
4255
5706
}
4256
5707
 
4257
5708
 
4266
5717
#
4267
5718
# ARG is the value that the WRAPPER_SCRIPT_BELONGS_IN_OBJDIR
4268
5719
# variable will take.  If 'yes', then the emitted script
4269
 
# will assume that the directory in which it is stored is
 
5720
# will assume that the directory where it is stored is
4270
5721
# the $objdir directory.  This is a cygwin/mingw-specific
4271
5722
# behavior.
4272
5723
func_emit_wrapper ()
4277
5728
#! $SHELL
4278
5729
 
4279
5730
# $output - temporary wrapper script for $objdir/$outputname
4280
 
# Generated by $PROGRAM (GNU $PACKAGE$TIMESTAMP) $VERSION
 
5731
# Generated by $PROGRAM (GNU $PACKAGE) $VERSION
4281
5732
#
4282
5733
# The $output program cannot be directly executed until all the libtool
4283
5734
# libraries that it depends on are installed.
4334
5785
 
4335
5786
# Very basic option parsing. These options are (a) specific to
4336
5787
# the libtool wrapper, (b) are identical between the wrapper
4337
 
# /script/ and the wrapper /executable/ which is used only on
 
5788
# /script/ and the wrapper /executable/ that is used only on
4338
5789
# windows platforms, and (c) all begin with the string "--lt-"
4339
 
# (application programs are unlikely to have options which match
 
5790
# (application programs are unlikely to have options that match
4340
5791
# this pattern).
4341
5792
#
4342
5793
# There are only two supported options: --lt-debug and
4369
5820
 
4370
5821
  # Print the debug banner immediately:
4371
5822
  if test -n \"\$lt_option_debug\"; then
4372
 
    echo \"${outputname}:${output}:\${LINENO}: libtool wrapper (GNU $PACKAGE$TIMESTAMP) $VERSION\" 1>&2
 
5823
    echo \"$outputname:$output:\$LINENO: libtool wrapper (GNU $PACKAGE) $VERSION\" 1>&2
4373
5824
  fi
4374
5825
}
4375
5826
 
4380
5831
  lt_dump_args_N=1;
4381
5832
  for lt_arg
4382
5833
  do
4383
 
    \$ECHO \"${outputname}:${output}:\${LINENO}: newargv[\$lt_dump_args_N]: \$lt_arg\"
 
5834
    \$ECHO \"$outputname:$output:\$LINENO: newargv[\$lt_dump_args_N]: \$lt_arg\"
4384
5835
    lt_dump_args_N=\`expr \$lt_dump_args_N + 1\`
4385
5836
  done
4386
5837
}
4394
5845
  *-*-mingw | *-*-os2* | *-cegcc*)
4395
5846
    $ECHO "\
4396
5847
      if test -n \"\$lt_option_debug\"; then
4397
 
        \$ECHO \"${outputname}:${output}:\${LINENO}: newargv[0]: \$progdir\\\\\$program\" 1>&2
 
5848
        \$ECHO \"$outputname:$output:\$LINENO: newargv[0]: \$progdir\\\\\$program\" 1>&2
4398
5849
        func_lt_dump_args \${1+\"\$@\"} 1>&2
4399
5850
      fi
4400
5851
      exec \"\$progdir\\\\\$program\" \${1+\"\$@\"}
4404
5855
  *)
4405
5856
    $ECHO "\
4406
5857
      if test -n \"\$lt_option_debug\"; then
4407
 
        \$ECHO \"${outputname}:${output}:\${LINENO}: newargv[0]: \$progdir/\$program\" 1>&2
 
5858
        \$ECHO \"$outputname:$output:\$LINENO: newargv[0]: \$progdir/\$program\" 1>&2
4408
5859
        func_lt_dump_args \${1+\"\$@\"} 1>&2
4409
5860
      fi
4410
5861
      exec \"\$progdir/\$program\" \${1+\"\$@\"}
4479
5930
  test -n \"\$absdir\" && thisdir=\"\$absdir\"
4480
5931
"
4481
5932
 
4482
 
        if test "$fast_install" = yes; then
 
5933
        if test yes = "$fast_install"; then
4483
5934
          $ECHO "\
4484
5935
  program=lt-'$outputname'$exeext
4485
5936
  progdir=\"\$thisdir/$objdir\"
4486
5937
 
4487
5938
  if test ! -f \"\$progdir/\$program\" ||
4488
 
     { file=\`ls -1dt \"\$progdir/\$program\" \"\$progdir/../\$program\" 2>/dev/null | ${SED} 1q\`; \\
 
5939
     { file=\`ls -1dt \"\$progdir/\$program\" \"\$progdir/../\$program\" 2>/dev/null | $SED 1q\`; \\
4489
5940
       test \"X\$file\" != \"X\$progdir/\$program\"; }; then
4490
5941
 
4491
5942
    file=\"\$\$-\$program\"
4502
5953
    if test -n \"\$relink_command\"; then
4503
5954
      if relink_command_output=\`eval \$relink_command 2>&1\`; then :
4504
5955
      else
4505
 
        $ECHO \"\$relink_command_output\" >&2
 
5956
        \$ECHO \"\$relink_command_output\" >&2
4506
5957
        $RM \"\$progdir/\$file\"
4507
5958
        exit 1
4508
5959
      fi
4537
5988
        fi
4538
5989
 
4539
5990
        # Export our shlibpath_var if we have one.
4540
 
        if test "$shlibpath_overrides_runpath" = yes && test -n "$shlibpath_var" && test -n "$temp_rpath"; then
 
5991
        if test yes = "$shlibpath_overrides_runpath" && test -n "$shlibpath_var" && test -n "$temp_rpath"; then
4541
5992
          $ECHO "\
4542
5993
    # Add our own library path to $shlibpath_var
4543
5994
    $shlibpath_var=\"$temp_rpath\$$shlibpath_var\"
4557
6008
    fi
4558
6009
  else
4559
6010
    # The program doesn't exist.
4560
 
    \$ECHO \"\$0: error: \\\`\$progdir/\$program' does not exist\" 1>&2
 
6011
    \$ECHO \"\$0: error: '\$progdir/\$program' does not exist\" 1>&2
4561
6012
    \$ECHO \"This script is just a wrapper for \$program.\" 1>&2
4562
6013
    \$ECHO \"See the $PACKAGE documentation for more information.\" 1>&2
4563
6014
    exit 1
4576
6027
        cat <<EOF
4577
6028
 
4578
6029
/* $cwrappersource - temporary wrapper executable for $objdir/$outputname
4579
 
   Generated by $PROGRAM (GNU $PACKAGE$TIMESTAMP) $VERSION
 
6030
   Generated by $PROGRAM (GNU $PACKAGE) $VERSION
4580
6031
 
4581
6032
   The $output program cannot be directly executed until all the libtool
4582
6033
   libraries that it depends on are installed.
4611
6062
#include <fcntl.h>
4612
6063
#include <sys/stat.h>
4613
6064
 
 
6065
#define STREQ(s1, s2) (strcmp ((s1), (s2)) == 0)
 
6066
 
4614
6067
/* declarations of non-ANSI functions */
4615
 
#if defined(__MINGW32__)
 
6068
#if defined __MINGW32__
4616
6069
# ifdef __STRICT_ANSI__
4617
6070
int _putenv (const char *);
4618
6071
# endif
4619
 
#elif defined(__CYGWIN__)
 
6072
#elif defined __CYGWIN__
4620
6073
# ifdef __STRICT_ANSI__
4621
6074
char *realpath (const char *, char *);
4622
6075
int putenv (char *);
4623
6076
int setenv (const char *, const char *, int);
4624
6077
# endif
4625
 
/* #elif defined (other platforms) ... */
 
6078
/* #elif defined other_platform || defined ... */
4626
6079
#endif
4627
6080
 
4628
6081
/* portability defines, excluding path handling macros */
4629
 
#if defined(_MSC_VER)
 
6082
#if defined _MSC_VER
4630
6083
# define setmode _setmode
4631
6084
# define stat    _stat
4632
6085
# define chmod   _chmod
4633
6086
# define getcwd  _getcwd
4634
6087
# define putenv  _putenv
4635
6088
# define S_IXUSR _S_IEXEC
4636
 
# ifndef _INTPTR_T_DEFINED
4637
 
#  define _INTPTR_T_DEFINED
4638
 
#  define intptr_t int
4639
 
# endif
4640
 
#elif defined(__MINGW32__)
 
6089
#elif defined __MINGW32__
4641
6090
# define setmode _setmode
4642
6091
# define stat    _stat
4643
6092
# define chmod   _chmod
4644
6093
# define getcwd  _getcwd
4645
6094
# define putenv  _putenv
4646
 
#elif defined(__CYGWIN__)
 
6095
#elif defined __CYGWIN__
4647
6096
# define HAVE_SETENV
4648
6097
# define FOPEN_WB "wb"
4649
 
/* #elif defined (other platforms) ... */
 
6098
/* #elif defined other platforms ... */
4650
6099
#endif
4651
6100
 
4652
 
#if defined(PATH_MAX)
 
6101
#if defined PATH_MAX
4653
6102
# define LT_PATHMAX PATH_MAX
4654
 
#elif defined(MAXPATHLEN)
 
6103
#elif defined MAXPATHLEN
4655
6104
# define LT_PATHMAX MAXPATHLEN
4656
6105
#else
4657
6106
# define LT_PATHMAX 1024
4670
6119
# define PATH_SEPARATOR ':'
4671
6120
#endif
4672
6121
 
4673
 
#if defined (_WIN32) || defined (__MSDOS__) || defined (__DJGPP__) || \
4674
 
  defined (__OS2__)
 
6122
#if defined _WIN32 || defined __MSDOS__ || defined __DJGPP__ || \
 
6123
  defined __OS2__
4675
6124
# define HAVE_DOS_BASED_FILE_SYSTEM
4676
6125
# define FOPEN_WB "wb"
4677
6126
# ifndef DIR_SEPARATOR_2
4704
6153
 
4705
6154
#define XMALLOC(type, num)      ((type *) xmalloc ((num) * sizeof(type)))
4706
6155
#define XFREE(stale) do { \
4707
 
  if (stale) { free ((void *) stale); stale = 0; } \
 
6156
  if (stale) { free (stale); stale = 0; } \
4708
6157
} while (0)
4709
6158
 
4710
 
#if defined(LT_DEBUGWRAPPER)
 
6159
#if defined LT_DEBUGWRAPPER
4711
6160
static int lt_debug = 1;
4712
6161
#else
4713
6162
static int lt_debug = 0;
4736
6185
EOF
4737
6186
 
4738
6187
            cat <<EOF
4739
 
volatile const char * MAGIC_EXE = "$magic_exe";
 
6188
#if __GNUC__ < 4 || (__GNUC__ == 4 && __GNUC_MINOR__ < 5)
 
6189
# define externally_visible volatile
 
6190
#else
 
6191
# define externally_visible __attribute__((externally_visible)) volatile
 
6192
#endif
 
6193
externally_visible const char * MAGIC_EXE = "$magic_exe";
4740
6194
const char * LIB_PATH_VARNAME = "$shlibpath_var";
4741
6195
EOF
4742
6196
 
4743
 
            if test "$shlibpath_overrides_runpath" = yes && test -n "$shlibpath_var" && test -n "$temp_rpath"; then
 
6197
            if test yes = "$shlibpath_overrides_runpath" && test -n "$shlibpath_var" && test -n "$temp_rpath"; then
4744
6198
              func_to_host_path "$temp_rpath"
4745
6199
              cat <<EOF
4746
6200
const char * LIB_PATH_VALUE   = "$func_to_host_path_result";
4764
6218
EOF
4765
6219
            fi
4766
6220
 
4767
 
            if test "$fast_install" = yes; then
 
6221
            if test yes = "$fast_install"; then
4768
6222
              cat <<EOF
4769
6223
const char * TARGET_PROGRAM_NAME = "lt-$outputname"; /* hopefully, no .exe */
4770
6224
EOF
4793
6247
  char *actual_cwrapper_name;
4794
6248
  char *target_name;
4795
6249
  char *lt_argv_zero;
4796
 
  intptr_t rval = 127;
 
6250
  int rval = 127;
4797
6251
 
4798
6252
  int i;
4799
6253
 
4800
6254
  program_name = (char *) xstrdup (base_name (argv[0]));
4801
 
  newargz = XMALLOC (char *, argc + 1);
 
6255
  newargz = XMALLOC (char *, (size_t) argc + 1);
4802
6256
 
4803
6257
  /* very simple arg parsing; don't want to rely on getopt
4804
6258
   * also, copy all non cwrapper options to newargz, except
4807
6261
  newargc=0;
4808
6262
  for (i = 1; i < argc; i++)
4809
6263
    {
4810
 
      if (strcmp (argv[i], dumpscript_opt) == 0)
 
6264
      if (STREQ (argv[i], dumpscript_opt))
4811
6265
        {
4812
6266
EOF
4813
 
            case "$host" in
 
6267
            case $host in
4814
6268
              *mingw* | *cygwin* )
4815
6269
                # make stdout use "unix" line endings
4816
6270
                echo "          setmode(1,_O_BINARY);"
4821
6275
          lt_dump_script (stdout);
4822
6276
          return 0;
4823
6277
        }
4824
 
      if (strcmp (argv[i], debug_opt) == 0)
 
6278
      if (STREQ (argv[i], debug_opt))
4825
6279
        {
4826
6280
          lt_debug = 1;
4827
6281
          continue;
4828
6282
        }
4829
 
      if (strcmp (argv[i], ltwrapper_option_prefix) == 0)
 
6283
      if (STREQ (argv[i], ltwrapper_option_prefix))
4830
6284
        {
4831
6285
          /* however, if there is an option in the LTWRAPPER_OPTION_PREFIX
4832
6286
             namespace, but it is not one of the ones we know about and
4849
6303
EOF
4850
6304
            cat <<EOF
4851
6305
  /* The GNU banner must be the first non-error debug message */
4852
 
  lt_debugprintf (__FILE__, __LINE__, "libtool wrapper (GNU $PACKAGE$TIMESTAMP) $VERSION\n");
 
6306
  lt_debugprintf (__FILE__, __LINE__, "libtool wrapper (GNU $PACKAGE) $VERSION\n");
4853
6307
EOF
4854
6308
            cat <<"EOF"
4855
6309
  lt_debugprintf (__FILE__, __LINE__, "(main) argv[0]: %s\n", argv[0]);
4960
6414
                cat <<"EOF"
4961
6415
  /* execv doesn't actually work on mingw as expected on unix */
4962
6416
  newargz = prepare_spawn (newargz);
4963
 
  rval = _spawnv (_P_WAIT, lt_argv_zero, (const char * const *) newargz);
 
6417
  rval = (int) _spawnv (_P_WAIT, lt_argv_zero, (const char * const *) newargz);
4964
6418
  if (rval == -1)
4965
6419
    {
4966
6420
      /* failed to start process */
5005
6459
{
5006
6460
  const char *base;
5007
6461
 
5008
 
#if defined (HAVE_DOS_BASED_FILE_SYSTEM)
 
6462
#if defined HAVE_DOS_BASED_FILE_SYSTEM
5009
6463
  /* Skip over the disk name in MSDOS pathnames. */
5010
6464
  if (isalpha ((unsigned char) name[0]) && name[1] == ':')
5011
6465
    name += 2;
5064
6518
  const char *p_next;
5065
6519
  /* static buffer for getcwd */
5066
6520
  char tmp[LT_PATHMAX + 1];
5067
 
  int tmp_len;
 
6521
  size_t tmp_len;
5068
6522
  char *concat_name;
5069
6523
 
5070
6524
  lt_debugprintf (__FILE__, __LINE__, "(find_executable): %s\n",
5074
6528
    return NULL;
5075
6529
 
5076
6530
  /* Absolute path? */
5077
 
#if defined (HAVE_DOS_BASED_FILE_SYSTEM)
 
6531
#if defined HAVE_DOS_BASED_FILE_SYSTEM
5078
6532
  if (isalpha ((unsigned char) wrapper[0]) && wrapper[1] == ':')
5079
6533
    {
5080
6534
      concat_name = xstrdup (wrapper);
5092
6546
            return concat_name;
5093
6547
          XFREE (concat_name);
5094
6548
        }
5095
 
#if defined (HAVE_DOS_BASED_FILE_SYSTEM)
 
6549
#if defined HAVE_DOS_BASED_FILE_SYSTEM
5096
6550
    }
5097
6551
#endif
5098
6552
 
5115
6569
              for (q = p; *q; q++)
5116
6570
                if (IS_PATH_SEPARATOR (*q))
5117
6571
                  break;
5118
 
              p_len = q - p;
 
6572
              p_len = (size_t) (q - p);
5119
6573
              p_next = (*q == '\0' ? q : q + 1);
5120
6574
              if (p_len == 0)
5121
6575
                {
5234
6688
  if (patlen <= len)
5235
6689
    {
5236
6690
      str += len - patlen;
5237
 
      if (strcmp (str, pat) == 0)
 
6691
      if (STREQ (str, pat))
5238
6692
        *str = '\0';
5239
6693
    }
5240
6694
  return str;
5299
6753
    char *str = xstrdup (value);
5300
6754
    setenv (name, str, 1);
5301
6755
#else
5302
 
    int len = strlen (name) + 1 + strlen (value) + 1;
 
6756
    size_t len = strlen (name) + 1 + strlen (value) + 1;
5303
6757
    char *str = XMALLOC (char, len);
5304
6758
    sprintf (str, "%s=%s", name, value);
5305
6759
    if (putenv (str) != EXIT_SUCCESS)
5316
6770
  char *new_value;
5317
6771
  if (orig_value && *orig_value)
5318
6772
    {
5319
 
      int orig_value_len = strlen (orig_value);
5320
 
      int add_len = strlen (add);
 
6773
      size_t orig_value_len = strlen (orig_value);
 
6774
      size_t add_len = strlen (add);
5321
6775
      new_value = XMALLOC (char, add_len + orig_value_len + 1);
5322
6776
      if (to_end)
5323
6777
        {
5348
6802
    {
5349
6803
      char *new_value = lt_extend_str (getenv (name), value, 0);
5350
6804
      /* some systems can't cope with a ':'-terminated path #' */
5351
 
      int len = strlen (new_value);
5352
 
      while (((len = strlen (new_value)) > 0) && IS_PATH_SEPARATOR (new_value[len-1]))
 
6805
      size_t len = strlen (new_value);
 
6806
      while ((len > 0) && IS_PATH_SEPARATOR (new_value[len-1]))
5353
6807
        {
5354
 
          new_value[len-1] = '\0';
 
6808
          new_value[--len] = '\0';
5355
6809
        }
5356
6810
      lt_setenv (name, new_value);
5357
6811
      XFREE (new_value);
5518
6972
# True if ARG is an import lib, as indicated by $file_magic_cmd
5519
6973
func_win32_import_lib_p ()
5520
6974
{
5521
 
    $opt_debug
 
6975
    $debug_cmd
 
6976
 
5522
6977
    case `eval $file_magic_cmd \"\$1\" 2>/dev/null | $SED -e 10q` in
5523
6978
    *import*) : ;;
5524
6979
    *) false ;;
5525
6980
    esac
5526
6981
}
5527
6982
 
 
6983
# func_suncc_cstd_abi
 
6984
# !!ONLY CALL THIS FOR SUN CC AFTER $compile_command IS FULLY EXPANDED!!
 
6985
# Several compiler flags select an ABI that is incompatible with the
 
6986
# Cstd library. Avoid specifying it if any are in CXXFLAGS.
 
6987
func_suncc_cstd_abi ()
 
6988
{
 
6989
    $debug_cmd
 
6990
 
 
6991
    case " $compile_command " in
 
6992
    *" -compat=g "*|*\ -std=c++[0-9][0-9]\ *|*" -library=stdcxx4 "*|*" -library=stlport4 "*)
 
6993
      suncc_use_cstd_abi=no
 
6994
      ;;
 
6995
    *)
 
6996
      suncc_use_cstd_abi=yes
 
6997
      ;;
 
6998
    esac
 
6999
}
 
7000
 
5528
7001
# func_mode_link arg...
5529
7002
func_mode_link ()
5530
7003
{
5531
 
    $opt_debug
 
7004
    $debug_cmd
 
7005
 
5532
7006
    case $host in
5533
7007
    *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-cegcc*)
5534
7008
      # It is impossible to link a dll without this setting, and
5535
7009
      # we shouldn't force the makefile maintainer to figure out
5536
 
      # which system we are compiling for in order to pass an extra
 
7010
      # what system we are compiling for in order to pass an extra
5537
7011
      # flag for every libtool invocation.
5538
7012
      # allow_undefined=no
5539
7013
 
5540
7014
      # FIXME: Unfortunately, there are problems with the above when trying
5541
 
      # to make a dll which has undefined symbols, in which case not
 
7015
      # to make a dll that has undefined symbols, in which case not
5542
7016
      # even a static library is built.  For now, we need to specify
5543
7017
      # -no-undefined on the libtool link line when we can be certain
5544
7018
      # that all symbols are satisfied, otherwise we get a static library.
5582
7056
    module=no
5583
7057
    no_install=no
5584
7058
    objs=
 
7059
    os2dllname=
5585
7060
    non_pic_objects=
5586
7061
    precious_files_regex=
5587
7062
    prefer_static_libs=no
5588
 
    preload=no
 
7063
    preload=false
5589
7064
    prev=
5590
7065
    prevarg=
5591
7066
    release=
5597
7072
    vinfo=
5598
7073
    vinfo_number=no
5599
7074
    weak_libs=
5600
 
    single_module="${wl}-single_module"
 
7075
    single_module=$wl-single_module
5601
7076
    func_infer_tag $base_compile
5602
7077
 
5603
7078
    # We need to know -static, to get the right output filenames.
5605
7080
    do
5606
7081
      case $arg in
5607
7082
      -shared)
5608
 
        test "$build_libtool_libs" != yes && \
5609
 
          func_fatal_configuration "can not build a shared library"
 
7083
        test yes != "$build_libtool_libs" \
 
7084
          && func_fatal_configuration "cannot build a shared library"
5610
7085
        build_old_libs=no
5611
7086
        break
5612
7087
        ;;
5613
7088
      -all-static | -static | -static-libtool-libs)
5614
7089
        case $arg in
5615
7090
        -all-static)
5616
 
          if test "$build_libtool_libs" = yes && test -z "$link_static_flag"; then
 
7091
          if test yes = "$build_libtool_libs" && test -z "$link_static_flag"; then
5617
7092
            func_warning "complete static linking is impossible in this configuration"
5618
7093
          fi
5619
7094
          if test -n "$link_static_flag"; then
5646
7121
 
5647
7122
    # Go through the arguments, transforming them on the way.
5648
7123
    while test "$#" -gt 0; do
5649
 
      arg="$1"
 
7124
      arg=$1
5650
7125
      shift
5651
7126
      func_quote_for_eval "$arg"
5652
7127
      qarg=$func_quote_for_eval_unquoted_result
5653
 
      libtool_args+=" $func_quote_for_eval_result"
 
7128
      func_append libtool_args " $func_quote_for_eval_result"
5654
7129
 
5655
7130
      # If the previous option needs an argument, assign it.
5656
7131
      if test -n "$prev"; then
5657
7132
        case $prev in
5658
7133
        output)
5659
 
          compile_command+=" @OUTPUT@"
5660
 
          finalize_command+=" @OUTPUT@"
 
7134
          func_append compile_command " @OUTPUT@"
 
7135
          func_append finalize_command " @OUTPUT@"
5661
7136
          ;;
5662
7137
        esac
5663
7138
 
5664
7139
        case $prev in
5665
7140
        bindir)
5666
 
          bindir="$arg"
 
7141
          bindir=$arg
5667
7142
          prev=
5668
7143
          continue
5669
7144
          ;;
5670
7145
        dlfiles|dlprefiles)
5671
 
          if test "$preload" = no; then
 
7146
          $preload || {
5672
7147
            # Add the symbol object into the linking commands.
5673
 
            compile_command+=" @SYMFILE@"
5674
 
            finalize_command+=" @SYMFILE@"
5675
 
            preload=yes
5676
 
          fi
 
7148
            func_append compile_command " @SYMFILE@"
 
7149
            func_append finalize_command " @SYMFILE@"
 
7150
            preload=:
 
7151
          }
5677
7152
          case $arg in
5678
7153
          *.la | *.lo) ;;  # We handle these cases below.
5679
7154
          force)
5680
 
            if test "$dlself" = no; then
 
7155
            if test no = "$dlself"; then
5681
7156
              dlself=needless
5682
7157
              export_dynamic=yes
5683
7158
            fi
5685
7160
            continue
5686
7161
            ;;
5687
7162
          self)
5688
 
            if test "$prev" = dlprefiles; then
 
7163
            if test dlprefiles = "$prev"; then
5689
7164
              dlself=yes
5690
 
            elif test "$prev" = dlfiles && test "$dlopen_self" != yes; then
 
7165
            elif test dlfiles = "$prev" && test yes != "$dlopen_self"; then
5691
7166
              dlself=yes
5692
7167
            else
5693
7168
              dlself=needless
5697
7172
            continue
5698
7173
            ;;
5699
7174
          *)
5700
 
            if test "$prev" = dlfiles; then
5701
 
              dlfiles+=" $arg"
 
7175
            if test dlfiles = "$prev"; then
 
7176
              func_append dlfiles " $arg"
5702
7177
            else
5703
 
              dlprefiles+=" $arg"
 
7178
              func_append dlprefiles " $arg"
5704
7179
            fi
5705
7180
            prev=
5706
7181
            continue
5708
7183
          esac
5709
7184
          ;;
5710
7185
        expsyms)
5711
 
          export_symbols="$arg"
 
7186
          export_symbols=$arg
5712
7187
          test -f "$arg" \
5713
 
            || func_fatal_error "symbol file \`$arg' does not exist"
 
7188
            || func_fatal_error "symbol file '$arg' does not exist"
5714
7189
          prev=
5715
7190
          continue
5716
7191
          ;;
5717
7192
        expsyms_regex)
5718
 
          export_symbols_regex="$arg"
 
7193
          export_symbols_regex=$arg
5719
7194
          prev=
5720
7195
          continue
5721
7196
          ;;
5724
7199
            *-*-darwin*)
5725
7200
              case "$deplibs " in
5726
7201
                *" $qarg.ltframework "*) ;;
5727
 
                *) deplibs+=" $qarg.ltframework" # this is fixed later
 
7202
                *) func_append deplibs " $qarg.ltframework" # this is fixed later
5728
7203
                   ;;
5729
7204
              esac
5730
7205
              ;;
5733
7208
          continue
5734
7209
          ;;
5735
7210
        inst_prefix)
5736
 
          inst_prefix_dir="$arg"
 
7211
          inst_prefix_dir=$arg
 
7212
          prev=
 
7213
          continue
 
7214
          ;;
 
7215
        mllvm)
 
7216
          # Clang does not use LLVM to link, so we can simply discard any
 
7217
          # '-mllvm $arg' options when doing the link step.
5737
7218
          prev=
5738
7219
          continue
5739
7220
          ;;
5743
7224
            moreargs=
5744
7225
            for fil in `cat "$save_arg"`
5745
7226
            do
5746
 
#             moreargs+=" $fil"
 
7227
#             func_append moreargs " $fil"
5747
7228
              arg=$fil
5748
7229
              # A libtool-controlled object.
5749
7230
 
5757
7238
 
5758
7239
                if test -z "$pic_object" ||
5759
7240
                   test -z "$non_pic_object" ||
5760
 
                   test "$pic_object" = none &&
5761
 
                   test "$non_pic_object" = none; then
5762
 
                  func_fatal_error "cannot find name of object for \`$arg'"
 
7241
                   test none = "$pic_object" &&
 
7242
                   test none = "$non_pic_object"; then
 
7243
                  func_fatal_error "cannot find name of object for '$arg'"
5763
7244
                fi
5764
7245
 
5765
7246
                # Extract subdirectory from the argument.
5766
7247
                func_dirname "$arg" "/" ""
5767
 
                xdir="$func_dirname_result"
 
7248
                xdir=$func_dirname_result
5768
7249
 
5769
 
                if test "$pic_object" != none; then
 
7250
                if test none != "$pic_object"; then
5770
7251
                  # Prepend the subdirectory the object is found in.
5771
 
                  pic_object="$xdir$pic_object"
 
7252
                  pic_object=$xdir$pic_object
5772
7253
 
5773
 
                  if test "$prev" = dlfiles; then
5774
 
                    if test "$build_libtool_libs" = yes && test "$dlopen_support" = yes; then
5775
 
                      dlfiles+=" $pic_object"
 
7254
                  if test dlfiles = "$prev"; then
 
7255
                    if test yes = "$build_libtool_libs" && test yes = "$dlopen_support"; then
 
7256
                      func_append dlfiles " $pic_object"
5776
7257
                      prev=
5777
7258
                      continue
5778
7259
                    else
5782
7263
                  fi
5783
7264
 
5784
7265
                  # CHECK ME:  I think I busted this.  -Ossama
5785
 
                  if test "$prev" = dlprefiles; then
 
7266
                  if test dlprefiles = "$prev"; then
5786
7267
                    # Preload the old-style object.
5787
 
                    dlprefiles+=" $pic_object"
 
7268
                    func_append dlprefiles " $pic_object"
5788
7269
                    prev=
5789
7270
                  fi
5790
7271
 
5791
7272
                  # A PIC object.
5792
 
                  libobjs+=" $pic_object"
5793
 
                  arg="$pic_object"
 
7273
                  func_append libobjs " $pic_object"
 
7274
                  arg=$pic_object
5794
7275
                fi
5795
7276
 
5796
7277
                # Non-PIC object.
5797
 
                if test "$non_pic_object" != none; then
 
7278
                if test none != "$non_pic_object"; then
5798
7279
                  # Prepend the subdirectory the object is found in.
5799
 
                  non_pic_object="$xdir$non_pic_object"
 
7280
                  non_pic_object=$xdir$non_pic_object
5800
7281
 
5801
7282
                  # A standard non-PIC object
5802
 
                  non_pic_objects+=" $non_pic_object"
5803
 
                  if test -z "$pic_object" || test "$pic_object" = none ; then
5804
 
                    arg="$non_pic_object"
 
7283
                  func_append non_pic_objects " $non_pic_object"
 
7284
                  if test -z "$pic_object" || test none = "$pic_object"; then
 
7285
                    arg=$non_pic_object
5805
7286
                  fi
5806
7287
                else
5807
7288
                  # If the PIC object exists, use it instead.
5808
7289
                  # $xdir was prepended to $pic_object above.
5809
 
                  non_pic_object="$pic_object"
5810
 
                  non_pic_objects+=" $non_pic_object"
 
7290
                  non_pic_object=$pic_object
 
7291
                  func_append non_pic_objects " $non_pic_object"
5811
7292
                fi
5812
7293
              else
5813
7294
                # Only an error if not doing a dry-run.
5814
7295
                if $opt_dry_run; then
5815
7296
                  # Extract subdirectory from the argument.
5816
7297
                  func_dirname "$arg" "/" ""
5817
 
                  xdir="$func_dirname_result"
 
7298
                  xdir=$func_dirname_result
5818
7299
 
5819
7300
                  func_lo2o "$arg"
5820
7301
                  pic_object=$xdir$objdir/$func_lo2o_result
5821
7302
                  non_pic_object=$xdir$func_lo2o_result
5822
 
                  libobjs+=" $pic_object"
5823
 
                  non_pic_objects+=" $non_pic_object"
 
7303
                  func_append libobjs " $pic_object"
 
7304
                  func_append non_pic_objects " $non_pic_object"
5824
7305
                else
5825
 
                  func_fatal_error "\`$arg' is not a valid libtool object"
 
7306
                  func_fatal_error "'$arg' is not a valid libtool object"
5826
7307
                fi
5827
7308
              fi
5828
7309
            done
5829
7310
          else
5830
 
            func_fatal_error "link input file \`$arg' does not exist"
 
7311
            func_fatal_error "link input file '$arg' does not exist"
5831
7312
          fi
5832
7313
          arg=$save_arg
5833
7314
          prev=
5834
7315
          continue
5835
7316
          ;;
 
7317
        os2dllname)
 
7318
          os2dllname=$arg
 
7319
          prev=
 
7320
          continue
 
7321
          ;;
5836
7322
        precious_regex)
5837
 
          precious_files_regex="$arg"
 
7323
          precious_files_regex=$arg
5838
7324
          prev=
5839
7325
          continue
5840
7326
          ;;
5841
7327
        release)
5842
 
          release="-$arg"
 
7328
          release=-$arg
5843
7329
          prev=
5844
7330
          continue
5845
7331
          ;;
5851
7337
            func_fatal_error "only absolute run-paths are allowed"
5852
7338
            ;;
5853
7339
          esac
5854
 
          if test "$prev" = rpath; then
 
7340
          if test rpath = "$prev"; then
5855
7341
            case "$rpath " in
5856
7342
            *" $arg "*) ;;
5857
 
            *) rpath+=" $arg" ;;
 
7343
            *) func_append rpath " $arg" ;;
5858
7344
            esac
5859
7345
          else
5860
7346
            case "$xrpath " in
5861
7347
            *" $arg "*) ;;
5862
 
            *) xrpath+=" $arg" ;;
 
7348
            *) func_append xrpath " $arg" ;;
5863
7349
            esac
5864
7350
          fi
5865
7351
          prev=
5866
7352
          continue
5867
7353
          ;;
5868
7354
        shrext)
5869
 
          shrext_cmds="$arg"
 
7355
          shrext_cmds=$arg
5870
7356
          prev=
5871
7357
          continue
5872
7358
          ;;
5873
7359
        weak)
5874
 
          weak_libs+=" $arg"
 
7360
          func_append weak_libs " $arg"
5875
7361
          prev=
5876
7362
          continue
5877
7363
          ;;
5878
7364
        xcclinker)
5879
 
          linker_flags+=" $qarg"
5880
 
          compiler_flags+=" $qarg"
 
7365
          func_append linker_flags " $qarg"
 
7366
          func_append compiler_flags " $qarg"
5881
7367
          prev=
5882
 
          compile_command+=" $qarg"
5883
 
          finalize_command+=" $qarg"
 
7368
          func_append compile_command " $qarg"
 
7369
          func_append finalize_command " $qarg"
5884
7370
          continue
5885
7371
          ;;
5886
7372
        xcompiler)
5887
 
          compiler_flags+=" $qarg"
 
7373
          func_append compiler_flags " $qarg"
5888
7374
          prev=
5889
 
          compile_command+=" $qarg"
5890
 
          finalize_command+=" $qarg"
 
7375
          func_append compile_command " $qarg"
 
7376
          func_append finalize_command " $qarg"
5891
7377
          continue
5892
7378
          ;;
5893
7379
        xlinker)
5894
 
          linker_flags+=" $qarg"
5895
 
          compiler_flags+=" $wl$qarg"
 
7380
          func_append linker_flags " $qarg"
 
7381
          func_append compiler_flags " $wl$qarg"
5896
7382
          prev=
5897
 
          compile_command+=" $wl$qarg"
5898
 
          finalize_command+=" $wl$qarg"
 
7383
          func_append compile_command " $wl$qarg"
 
7384
          func_append finalize_command " $wl$qarg"
5899
7385
          continue
5900
7386
          ;;
5901
7387
        *)
5906
7392
        esac
5907
7393
      fi # test -n "$prev"
5908
7394
 
5909
 
      prevarg="$arg"
 
7395
      prevarg=$arg
5910
7396
 
5911
7397
      case $arg in
5912
7398
      -all-static)
5913
7399
        if test -n "$link_static_flag"; then
5914
7400
          # See comment for -static flag below, for more details.
5915
 
          compile_command+=" $link_static_flag"
5916
 
          finalize_command+=" $link_static_flag"
 
7401
          func_append compile_command " $link_static_flag"
 
7402
          func_append finalize_command " $link_static_flag"
5917
7403
        fi
5918
7404
        continue
5919
7405
        ;;
5920
7406
 
5921
7407
      -allow-undefined)
5922
7408
        # FIXME: remove this flag sometime in the future.
5923
 
        func_fatal_error "\`-allow-undefined' must not be used because it is the default"
 
7409
        func_fatal_error "'-allow-undefined' must not be used because it is the default"
5924
7410
        ;;
5925
7411
 
5926
7412
      -avoid-version)
5952
7438
        if test -n "$export_symbols" || test -n "$export_symbols_regex"; then
5953
7439
          func_fatal_error "more than one -exported-symbols argument is not allowed"
5954
7440
        fi
5955
 
        if test "X$arg" = "X-export-symbols"; then
 
7441
        if test X-export-symbols = "X$arg"; then
5956
7442
          prev=expsyms
5957
7443
        else
5958
7444
          prev=expsyms_regex
5975
7461
      -L[A-Z][A-Z]*:*)
5976
7462
        case $with_gcc/$host in
5977
7463
        no/*-*-irix* | /*-*-irix*)
5978
 
          compile_command+=" $arg"
5979
 
          finalize_command+=" $arg"
 
7464
          func_append compile_command " $arg"
 
7465
          func_append finalize_command " $arg"
5980
7466
          ;;
5981
7467
        esac
5982
7468
        continue
5986
7472
        func_stripname "-L" '' "$arg"
5987
7473
        if test -z "$func_stripname_result"; then
5988
7474
          if test "$#" -gt 0; then
5989
 
            func_fatal_error "require no space between \`-L' and \`$1'"
 
7475
            func_fatal_error "require no space between '-L' and '$1'"
5990
7476
          else
5991
 
            func_fatal_error "need path for \`-L' option"
 
7477
            func_fatal_error "need path for '-L' option"
5992
7478
          fi
5993
7479
        fi
5994
7480
        func_resolve_sysroot "$func_stripname_result"
5999
7485
        *)
6000
7486
          absdir=`cd "$dir" && pwd`
6001
7487
          test -z "$absdir" && \
6002
 
            func_fatal_error "cannot determine absolute directory name of \`$dir'"
6003
 
          dir="$absdir"
 
7488
            func_fatal_error "cannot determine absolute directory name of '$dir'"
 
7489
          dir=$absdir
6004
7490
          ;;
6005
7491
        esac
6006
7492
        case "$deplibs " in
6010
7496
        *)
6011
7497
          # Preserve sysroot, but never include relative directories
6012
7498
          case $dir in
6013
 
            [\\/]* | [A-Za-z]:[\\/]* | =*) deplibs+=" $arg" ;;
6014
 
            *) deplibs+=" -L$dir" ;;
 
7499
            [\\/]* | [A-Za-z]:[\\/]* | =*) func_append deplibs " $arg" ;;
 
7500
            *) func_append deplibs " -L$dir" ;;
6015
7501
          esac
6016
 
          lib_search_path+=" $dir"
 
7502
          func_append lib_search_path " $dir"
6017
7503
          ;;
6018
7504
        esac
6019
7505
        case $host in
6022
7508
          case :$dllsearchpath: in
6023
7509
          *":$dir:"*) ;;
6024
7510
          ::) dllsearchpath=$dir;;
6025
 
          *) dllsearchpath+=":$dir";;
 
7511
          *) func_append dllsearchpath ":$dir";;
6026
7512
          esac
6027
7513
          case :$dllsearchpath: in
6028
7514
          *":$testbindir:"*) ;;
6029
7515
          ::) dllsearchpath=$testbindir;;
6030
 
          *) dllsearchpath+=":$testbindir";;
 
7516
          *) func_append dllsearchpath ":$testbindir";;
6031
7517
          esac
6032
7518
          ;;
6033
7519
        esac
6035
7521
        ;;
6036
7522
 
6037
7523
      -l*)
6038
 
        if test "X$arg" = "X-lc" || test "X$arg" = "X-lm"; then
 
7524
        if test X-lc = "X$arg" || test X-lm = "X$arg"; then
6039
7525
          case $host in
6040
7526
          *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-beos* | *-cegcc* | *-*-haiku*)
6041
7527
            # These systems don't actually have a C or math library (as such)
6043
7529
            ;;
6044
7530
          *-*-os2*)
6045
7531
            # These systems don't actually have a C library (as such)
6046
 
            test "X$arg" = "X-lc" && continue
 
7532
            test X-lc = "X$arg" && continue
6047
7533
            ;;
6048
 
          *-*-openbsd* | *-*-freebsd* | *-*-dragonfly*)
 
7534
          *-*-openbsd* | *-*-freebsd* | *-*-dragonfly* | *-*-bitrig*)
6049
7535
            # Do not include libc due to us having libc/libc_r.
6050
 
            test "X$arg" = "X-lc" && continue
 
7536
            test X-lc = "X$arg" && continue
6051
7537
            ;;
6052
7538
          *-*-rhapsody* | *-*-darwin1.[012])
6053
7539
            # Rhapsody C and math libraries are in the System framework
6054
 
            deplibs+=" System.ltframework"
 
7540
            func_append deplibs " System.ltframework"
6055
7541
            continue
6056
7542
            ;;
6057
7543
          *-*-sco3.2v5* | *-*-sco5v6*)
6058
7544
            # Causes problems with __ctype
6059
 
            test "X$arg" = "X-lc" && continue
 
7545
            test X-lc = "X$arg" && continue
6060
7546
            ;;
6061
7547
          *-*-sysv4.2uw2* | *-*-sysv5* | *-*-unixware* | *-*-OpenUNIX*)
6062
7548
            # Compiler inserts libc in the correct place for threads to work
6063
 
            test "X$arg" = "X-lc" && continue
 
7549
            test X-lc = "X$arg" && continue
6064
7550
            ;;
6065
7551
          esac
6066
 
        elif test "X$arg" = "X-lc_r"; then
 
7552
        elif test X-lc_r = "X$arg"; then
6067
7553
         case $host in
6068
 
         *-*-openbsd* | *-*-freebsd* | *-*-dragonfly*)
 
7554
         *-*-openbsd* | *-*-freebsd* | *-*-dragonfly* | *-*-bitrig*)
6069
7555
           # Do not include libc_r directly, use -pthread flag.
6070
7556
           continue
6071
7557
           ;;
6072
7558
         esac
6073
7559
        fi
6074
 
        deplibs+=" $arg"
 
7560
        func_append deplibs " $arg"
 
7561
        continue
 
7562
        ;;
 
7563
 
 
7564
      -mllvm)
 
7565
        prev=mllvm
6075
7566
        continue
6076
7567
        ;;
6077
7568
 
6084
7575
      # classes, name mangling, and exception handling.
6085
7576
      # Darwin uses the -arch flag to determine output architecture.
6086
7577
      -model|-arch|-isysroot|--sysroot)
6087
 
        compiler_flags+=" $arg"
6088
 
        compile_command+=" $arg"
6089
 
        finalize_command+=" $arg"
 
7578
        func_append compiler_flags " $arg"
 
7579
        func_append compile_command " $arg"
 
7580
        func_append finalize_command " $arg"
6090
7581
        prev=xcompiler
6091
7582
        continue
6092
7583
        ;;
6093
7584
 
6094
7585
      -mt|-mthreads|-kthread|-Kthread|-pthread|-pthreads|--thread-safe \
6095
7586
      |-threads|-fopenmp|-openmp|-mp|-xopenmp|-omp|-qsmp=*)
6096
 
        compiler_flags+=" $arg"
6097
 
        compile_command+=" $arg"
6098
 
        finalize_command+=" $arg"
 
7587
        func_append compiler_flags " $arg"
 
7588
        func_append compile_command " $arg"
 
7589
        func_append finalize_command " $arg"
6099
7590
        case "$new_inherited_linker_flags " in
6100
7591
            *" $arg "*) ;;
6101
 
            * ) new_inherited_linker_flags+=" $arg" ;;
 
7592
            * ) func_append new_inherited_linker_flags " $arg" ;;
6102
7593
        esac
6103
7594
        continue
6104
7595
        ;;
6105
7596
 
6106
7597
      -multi_module)
6107
 
        single_module="${wl}-multi_module"
 
7598
        single_module=$wl-multi_module
6108
7599
        continue
6109
7600
        ;;
6110
7601
 
6118
7609
        *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-*-darwin* | *-cegcc*)
6119
7610
          # The PATH hackery in wrapper scripts is required on Windows
6120
7611
          # and Darwin in order for the loader to find any dlls it needs.
6121
 
          func_warning "\`-no-install' is ignored for $host"
6122
 
          func_warning "assuming \`-no-fast-install' instead"
 
7612
          func_warning "'-no-install' is ignored for $host"
 
7613
          func_warning "assuming '-no-fast-install' instead"
6123
7614
          fast_install=no
6124
7615
          ;;
6125
7616
        *) no_install=yes ;;
6137
7628
        continue
6138
7629
        ;;
6139
7630
 
 
7631
      -os2dllname)
 
7632
        prev=os2dllname
 
7633
        continue
 
7634
        ;;
 
7635
 
6140
7636
      -o) prev=output ;;
6141
7637
 
6142
7638
      -precious-files-regex)
6175
7671
        esac
6176
7672
        case "$xrpath " in
6177
7673
        *" $dir "*) ;;
6178
 
        *) xrpath+=" $dir" ;;
 
7674
        *) func_append xrpath " $dir" ;;
6179
7675
        esac
6180
7676
        continue
6181
7677
        ;;
6224
7720
        func_stripname '-Wc,' '' "$arg"
6225
7721
        args=$func_stripname_result
6226
7722
        arg=
6227
 
        save_ifs="$IFS"; IFS=','
 
7723
        save_ifs=$IFS; IFS=,
6228
7724
        for flag in $args; do
6229
 
          IFS="$save_ifs"
 
7725
          IFS=$save_ifs
6230
7726
          func_quote_for_eval "$flag"
6231
 
          arg+=" $func_quote_for_eval_result"
6232
 
          compiler_flags+=" $func_quote_for_eval_result"
 
7727
          func_append arg " $func_quote_for_eval_result"
 
7728
          func_append compiler_flags " $func_quote_for_eval_result"
6233
7729
        done
6234
 
        IFS="$save_ifs"
 
7730
        IFS=$save_ifs
6235
7731
        func_stripname ' ' '' "$arg"
6236
7732
        arg=$func_stripname_result
6237
7733
        ;;
6240
7736
        func_stripname '-Wl,' '' "$arg"
6241
7737
        args=$func_stripname_result
6242
7738
        arg=
6243
 
        save_ifs="$IFS"; IFS=','
 
7739
        save_ifs=$IFS; IFS=,
6244
7740
        for flag in $args; do
6245
 
          IFS="$save_ifs"
 
7741
          IFS=$save_ifs
6246
7742
          func_quote_for_eval "$flag"
6247
 
          arg+=" $wl$func_quote_for_eval_result"
6248
 
          compiler_flags+=" $wl$func_quote_for_eval_result"
6249
 
          linker_flags+=" $func_quote_for_eval_result"
 
7743
          func_append arg " $wl$func_quote_for_eval_result"
 
7744
          func_append compiler_flags " $wl$func_quote_for_eval_result"
 
7745
          func_append linker_flags " $func_quote_for_eval_result"
6250
7746
        done
6251
 
        IFS="$save_ifs"
 
7747
        IFS=$save_ifs
6252
7748
        func_stripname ' ' '' "$arg"
6253
7749
        arg=$func_stripname_result
6254
7750
        ;;
6271
7767
      # -msg_* for osf cc
6272
7768
      -msg_*)
6273
7769
        func_quote_for_eval "$arg"
6274
 
        arg="$func_quote_for_eval_result"
 
7770
        arg=$func_quote_for_eval_result
6275
7771
        ;;
6276
7772
 
6277
7773
      # Flags to be passed through unchanged, with rationale:
6283
7779
      # -m*, -t[45]*, -txscale* architecture-specific flags for GCC
6284
7780
      # -F/path              path to uninstalled frameworks, gcc on darwin
6285
7781
      # -p, -pg, --coverage, -fprofile-*  profiling flags for GCC
 
7782
      # -fstack-protector*   stack protector flags for GCC
6286
7783
      # @file                GCC response files
6287
7784
      # -tp=*                Portland pgcc target processor selection
6288
7785
      # --sysroot=*          for sysroot support
6289
 
      # -O*, -flto*, -fwhopr*, -fuse-linker-plugin GCC link-time optimization
 
7786
      # -O*, -g*, -flto*, -fwhopr*, -fuse-linker-plugin GCC link-time optimization
 
7787
      # -specs=*             GCC specs files
 
7788
      # -stdlib=*            select c++ std lib with clang
 
7789
      # -fsanitize=*         Clang/GCC memory and address sanitizer
6290
7790
      -64|-mips[0-9]|-r[0-9][0-9]*|-xarch=*|-xtarget=*|+DA*|+DD*|-q*|-m*| \
6291
7791
      -t[45]*|-txscale*|-p|-pg|--coverage|-fprofile-*|-F*|@*|-tp=*|--sysroot=*| \
6292
 
      -O*|-flto*|-fwhopr*|-fuse-linker-plugin)
 
7792
      -O*|-g*|-flto*|-fwhopr*|-fuse-linker-plugin|-fstack-protector*|-stdlib=*| \
 
7793
      -specs=*|-fsanitize=*)
6293
7794
        func_quote_for_eval "$arg"
6294
 
        arg="$func_quote_for_eval_result"
6295
 
        compile_command+=" $arg"
6296
 
        finalize_command+=" $arg"
6297
 
        compiler_flags+=" $arg"
 
7795
        arg=$func_quote_for_eval_result
 
7796
        func_append compile_command " $arg"
 
7797
        func_append finalize_command " $arg"
 
7798
        func_append compiler_flags " $arg"
6298
7799
        continue
6299
7800
        ;;
6300
7801
 
 
7802
      -Z*)
 
7803
        if test os2 = "`expr $host : '.*\(os2\)'`"; then
 
7804
          # OS/2 uses -Zxxx to specify OS/2-specific options
 
7805
          compiler_flags="$compiler_flags $arg"
 
7806
          func_append compile_command " $arg"
 
7807
          func_append finalize_command " $arg"
 
7808
          case $arg in
 
7809
          -Zlinker | -Zstack)
 
7810
            prev=xcompiler
 
7811
            ;;
 
7812
          esac
 
7813
          continue
 
7814
        else
 
7815
          # Otherwise treat like 'Some other compiler flag' below
 
7816
          func_quote_for_eval "$arg"
 
7817
          arg=$func_quote_for_eval_result
 
7818
        fi
 
7819
        ;;
 
7820
 
6301
7821
      # Some other compiler flag.
6302
7822
      -* | +*)
6303
7823
        func_quote_for_eval "$arg"
6304
 
        arg="$func_quote_for_eval_result"
 
7824
        arg=$func_quote_for_eval_result
6305
7825
        ;;
6306
7826
 
6307
7827
      *.$objext)
6308
7828
        # A standard object.
6309
 
        objs+=" $arg"
 
7829
        func_append objs " $arg"
6310
7830
        ;;
6311
7831
 
6312
7832
      *.lo)
6322
7842
 
6323
7843
          if test -z "$pic_object" ||
6324
7844
             test -z "$non_pic_object" ||
6325
 
             test "$pic_object" = none &&
6326
 
             test "$non_pic_object" = none; then
6327
 
            func_fatal_error "cannot find name of object for \`$arg'"
 
7845
             test none = "$pic_object" &&
 
7846
             test none = "$non_pic_object"; then
 
7847
            func_fatal_error "cannot find name of object for '$arg'"
6328
7848
          fi
6329
7849
 
6330
7850
          # Extract subdirectory from the argument.
6331
7851
          func_dirname "$arg" "/" ""
6332
 
          xdir="$func_dirname_result"
 
7852
          xdir=$func_dirname_result
6333
7853
 
6334
 
          if test "$pic_object" != none; then
 
7854
          test none = "$pic_object" || {
6335
7855
            # Prepend the subdirectory the object is found in.
6336
 
            pic_object="$xdir$pic_object"
 
7856
            pic_object=$xdir$pic_object
6337
7857
 
6338
 
            if test "$prev" = dlfiles; then
6339
 
              if test "$build_libtool_libs" = yes && test "$dlopen_support" = yes; then
6340
 
                dlfiles+=" $pic_object"
 
7858
            if test dlfiles = "$prev"; then
 
7859
              if test yes = "$build_libtool_libs" && test yes = "$dlopen_support"; then
 
7860
                func_append dlfiles " $pic_object"
6341
7861
                prev=
6342
7862
                continue
6343
7863
              else
6347
7867
            fi
6348
7868
 
6349
7869
            # CHECK ME:  I think I busted this.  -Ossama
6350
 
            if test "$prev" = dlprefiles; then
 
7870
            if test dlprefiles = "$prev"; then
6351
7871
              # Preload the old-style object.
6352
 
              dlprefiles+=" $pic_object"
 
7872
              func_append dlprefiles " $pic_object"
6353
7873
              prev=
6354
7874
            fi
6355
7875
 
6356
7876
            # A PIC object.
6357
 
            libobjs+=" $pic_object"
6358
 
            arg="$pic_object"
6359
 
          fi
 
7877
            func_append libobjs " $pic_object"
 
7878
            arg=$pic_object
 
7879
          }
6360
7880
 
6361
7881
          # Non-PIC object.
6362
 
          if test "$non_pic_object" != none; then
 
7882
          if test none != "$non_pic_object"; then
6363
7883
            # Prepend the subdirectory the object is found in.
6364
 
            non_pic_object="$xdir$non_pic_object"
 
7884
            non_pic_object=$xdir$non_pic_object
6365
7885
 
6366
7886
            # A standard non-PIC object
6367
 
            non_pic_objects+=" $non_pic_object"
6368
 
            if test -z "$pic_object" || test "$pic_object" = none ; then
6369
 
              arg="$non_pic_object"
 
7887
            func_append non_pic_objects " $non_pic_object"
 
7888
            if test -z "$pic_object" || test none = "$pic_object"; then
 
7889
              arg=$non_pic_object
6370
7890
            fi
6371
7891
          else
6372
7892
            # If the PIC object exists, use it instead.
6373
7893
            # $xdir was prepended to $pic_object above.
6374
 
            non_pic_object="$pic_object"
6375
 
            non_pic_objects+=" $non_pic_object"
 
7894
            non_pic_object=$pic_object
 
7895
            func_append non_pic_objects " $non_pic_object"
6376
7896
          fi
6377
7897
        else
6378
7898
          # Only an error if not doing a dry-run.
6379
7899
          if $opt_dry_run; then
6380
7900
            # Extract subdirectory from the argument.
6381
7901
            func_dirname "$arg" "/" ""
6382
 
            xdir="$func_dirname_result"
 
7902
            xdir=$func_dirname_result
6383
7903
 
6384
7904
            func_lo2o "$arg"
6385
7905
            pic_object=$xdir$objdir/$func_lo2o_result
6386
7906
            non_pic_object=$xdir$func_lo2o_result
6387
 
            libobjs+=" $pic_object"
6388
 
            non_pic_objects+=" $non_pic_object"
 
7907
            func_append libobjs " $pic_object"
 
7908
            func_append non_pic_objects " $non_pic_object"
6389
7909
          else
6390
 
            func_fatal_error "\`$arg' is not a valid libtool object"
 
7910
            func_fatal_error "'$arg' is not a valid libtool object"
6391
7911
          fi
6392
7912
        fi
6393
7913
        ;;
6394
7914
 
6395
7915
      *.$libext)
6396
7916
        # An archive.
6397
 
        deplibs+=" $arg"
6398
 
        old_deplibs+=" $arg"
 
7917
        func_append deplibs " $arg"
 
7918
        func_append old_deplibs " $arg"
6399
7919
        continue
6400
7920
        ;;
6401
7921
 
6403
7923
        # A libtool-controlled library.
6404
7924
 
6405
7925
        func_resolve_sysroot "$arg"
6406
 
        if test "$prev" = dlfiles; then
 
7926
        if test dlfiles = "$prev"; then
6407
7927
          # This library was specified with -dlopen.
6408
 
          dlfiles+=" $func_resolve_sysroot_result"
 
7928
          func_append dlfiles " $func_resolve_sysroot_result"
6409
7929
          prev=
6410
 
        elif test "$prev" = dlprefiles; then
 
7930
        elif test dlprefiles = "$prev"; then
6411
7931
          # The library was specified with -dlpreopen.
6412
 
          dlprefiles+=" $func_resolve_sysroot_result"
 
7932
          func_append dlprefiles " $func_resolve_sysroot_result"
6413
7933
          prev=
6414
7934
        else
6415
 
          deplibs+=" $func_resolve_sysroot_result"
 
7935
          func_append deplibs " $func_resolve_sysroot_result"
6416
7936
        fi
6417
7937
        continue
6418
7938
        ;;
6422
7942
        # Unknown arguments in both finalize_command and compile_command need
6423
7943
        # to be aesthetically quoted because they are evaled later.
6424
7944
        func_quote_for_eval "$arg"
6425
 
        arg="$func_quote_for_eval_result"
 
7945
        arg=$func_quote_for_eval_result
6426
7946
        ;;
6427
7947
      esac # arg
6428
7948
 
6429
7949
      # Now actually substitute the argument into the commands.
6430
7950
      if test -n "$arg"; then
6431
 
        compile_command+=" $arg"
6432
 
        finalize_command+=" $arg"
 
7951
        func_append compile_command " $arg"
 
7952
        func_append finalize_command " $arg"
6433
7953
      fi
6434
7954
    done # argument parsing loop
6435
7955
 
6436
7956
    test -n "$prev" && \
6437
 
      func_fatal_help "the \`$prevarg' option requires an argument"
 
7957
      func_fatal_help "the '$prevarg' option requires an argument"
6438
7958
 
6439
 
    if test "$export_dynamic" = yes && test -n "$export_dynamic_flag_spec"; then
 
7959
    if test yes = "$export_dynamic" && test -n "$export_dynamic_flag_spec"; then
6440
7960
      eval arg=\"$export_dynamic_flag_spec\"
6441
 
      compile_command+=" $arg"
6442
 
      finalize_command+=" $arg"
 
7961
      func_append compile_command " $arg"
 
7962
      func_append finalize_command " $arg"
6443
7963
    fi
6444
7964
 
6445
7965
    oldlibs=
6446
7966
    # calculate the name of the file, without its directory
6447
7967
    func_basename "$output"
6448
 
    outputname="$func_basename_result"
6449
 
    libobjs_save="$libobjs"
 
7968
    outputname=$func_basename_result
 
7969
    libobjs_save=$libobjs
6450
7970
 
6451
7971
    if test -n "$shlibpath_var"; then
6452
7972
      # get the directories listed in $shlibpath_var
6453
 
      eval shlib_search_path=\`\$ECHO \"\${$shlibpath_var}\" \| \$SED \'s/:/ /g\'\`
 
7973
      eval shlib_search_path=\`\$ECHO \"\$$shlibpath_var\" \| \$SED \'s/:/ /g\'\`
6454
7974
    else
6455
7975
      shlib_search_path=
6456
7976
    fi
6457
7977
    eval sys_lib_search_path=\"$sys_lib_search_path_spec\"
6458
7978
    eval sys_lib_dlsearch_path=\"$sys_lib_dlsearch_path_spec\"
6459
7979
 
 
7980
    # Definition is injected by LT_CONFIG during libtool generation.
 
7981
    func_munge_path_list sys_lib_dlsearch_path "$LT_SYS_LIBRARY_PATH"
 
7982
 
6460
7983
    func_dirname "$output" "/" ""
6461
 
    output_objdir="$func_dirname_result$objdir"
 
7984
    output_objdir=$func_dirname_result$objdir
6462
7985
    func_to_tool_file "$output_objdir/"
6463
7986
    tool_output_objdir=$func_to_tool_file_result
6464
7987
    # Create the object directory.
6481
8004
    # Find all interdependent deplibs by searching for libraries
6482
8005
    # that are linked more than once (e.g. -la -lb -la)
6483
8006
    for deplib in $deplibs; do
6484
 
      if $opt_preserve_dup_deps ; then
 
8007
      if $opt_preserve_dup_deps; then
6485
8008
        case "$libs " in
6486
 
        *" $deplib "*) specialdeplibs+=" $deplib" ;;
 
8009
        *" $deplib "*) func_append specialdeplibs " $deplib" ;;
6487
8010
        esac
6488
8011
      fi
6489
 
      libs+=" $deplib"
 
8012
      func_append libs " $deplib"
6490
8013
    done
6491
8014
 
6492
 
    if test "$linkmode" = lib; then
 
8015
    if test lib = "$linkmode"; then
6493
8016
      libs="$predeps $libs $compiler_lib_search_path $postdeps"
6494
8017
 
6495
8018
      # Compute libraries that are listed more than once in $predeps
6499
8022
      if $opt_duplicate_compiler_generated_deps; then
6500
8023
        for pre_post_dep in $predeps $postdeps; do
6501
8024
          case "$pre_post_deps " in
6502
 
          *" $pre_post_dep "*) specialdeplibs+=" $pre_post_deps" ;;
 
8025
          *" $pre_post_dep "*) func_append specialdeplibs " $pre_post_deps" ;;
6503
8026
          esac
6504
 
          pre_post_deps+=" $pre_post_dep"
 
8027
          func_append pre_post_deps " $pre_post_dep"
6505
8028
        done
6506
8029
      fi
6507
8030
      pre_post_deps=
6521
8044
          case $file in
6522
8045
          *.la) ;;
6523
8046
          *)
6524
 
            func_fatal_help "libraries can \`-dlopen' only libtool libraries: $file"
 
8047
            func_fatal_help "libraries can '-dlopen' only libtool libraries: $file"
6525
8048
            ;;
6526
8049
          esac
6527
8050
        done
6529
8052
    prog)
6530
8053
        compile_deplibs=
6531
8054
        finalize_deplibs=
6532
 
        alldeplibs=no
 
8055
        alldeplibs=false
6533
8056
        newdlfiles=
6534
8057
        newdlprefiles=
6535
8058
        passes="conv scan dlopen dlpreopen link"
6541
8064
    for pass in $passes; do
6542
8065
      # The preopen pass in lib mode reverses $deplibs; put it back here
6543
8066
      # so that -L comes before libs that need it for instance...
6544
 
      if test "$linkmode,$pass" = "lib,link"; then
 
8067
      if test lib,link = "$linkmode,$pass"; then
6545
8068
        ## FIXME: Find the place where the list is rebuilt in the wrong
6546
8069
        ##        order, and fix it there properly
6547
8070
        tmp_deplibs=
6548
8071
        for deplib in $deplibs; do
6549
8072
          tmp_deplibs="$deplib $tmp_deplibs"
6550
8073
        done
6551
 
        deplibs="$tmp_deplibs"
 
8074
        deplibs=$tmp_deplibs
6552
8075
      fi
6553
8076
 
6554
 
      if test "$linkmode,$pass" = "lib,link" ||
6555
 
         test "$linkmode,$pass" = "prog,scan"; then
6556
 
        libs="$deplibs"
 
8077
      if test lib,link = "$linkmode,$pass" ||
 
8078
         test prog,scan = "$linkmode,$pass"; then
 
8079
        libs=$deplibs
6557
8080
        deplibs=
6558
8081
      fi
6559
 
      if test "$linkmode" = prog; then
 
8082
      if test prog = "$linkmode"; then
6560
8083
        case $pass in
6561
 
        dlopen) libs="$dlfiles" ;;
6562
 
        dlpreopen) libs="$dlprefiles" ;;
 
8084
        dlopen) libs=$dlfiles ;;
 
8085
        dlpreopen) libs=$dlprefiles ;;
6563
8086
        link)
6564
8087
          libs="$deplibs %DEPLIBS%"
6565
8088
          test "X$link_all_deplibs" != Xno && libs="$libs $dependency_libs"
6566
8089
          ;;
6567
8090
        esac
6568
8091
      fi
6569
 
      if test "$linkmode,$pass" = "lib,dlpreopen"; then
 
8092
      if test lib,dlpreopen = "$linkmode,$pass"; then
6570
8093
        # Collect and forward deplibs of preopened libtool libs
6571
8094
        for lib in $dlprefiles; do
6572
8095
          # Ignore non-libtool-libs
6583
8106
            deplib_base=$func_basename_result
6584
8107
            case " $weak_libs " in
6585
8108
            *" $deplib_base "*) ;;
6586
 
            *) deplibs+=" $deplib" ;;
 
8109
            *) func_append deplibs " $deplib" ;;
6587
8110
            esac
6588
8111
          done
6589
8112
        done
6590
 
        libs="$dlprefiles"
 
8113
        libs=$dlprefiles
6591
8114
      fi
6592
 
      if test "$pass" = dlopen; then
 
8115
      if test dlopen = "$pass"; then
6593
8116
        # Collect dlpreopened libraries
6594
 
        save_deplibs="$deplibs"
 
8117
        save_deplibs=$deplibs
6595
8118
        deplibs=
6596
8119
      fi
6597
8120
 
6598
8121
      for deplib in $libs; do
6599
8122
        lib=
6600
 
        found=no
 
8123
        found=false
6601
8124
        case $deplib in
6602
8125
        -mt|-mthreads|-kthread|-Kthread|-pthread|-pthreads|--thread-safe \
6603
8126
        |-threads|-fopenmp|-openmp|-mp|-xopenmp|-omp|-qsmp=*)
6604
 
          if test "$linkmode,$pass" = "prog,link"; then
 
8127
          if test prog,link = "$linkmode,$pass"; then
6605
8128
            compile_deplibs="$deplib $compile_deplibs"
6606
8129
            finalize_deplibs="$deplib $finalize_deplibs"
6607
8130
          else
6608
 
            compiler_flags+=" $deplib"
6609
 
            if test "$linkmode" = lib ; then
 
8131
            func_append compiler_flags " $deplib"
 
8132
            if test lib = "$linkmode"; then
6610
8133
                case "$new_inherited_linker_flags " in
6611
8134
                    *" $deplib "*) ;;
6612
 
                    * ) new_inherited_linker_flags+=" $deplib" ;;
 
8135
                    * ) func_append new_inherited_linker_flags " $deplib" ;;
6613
8136
                esac
6614
8137
            fi
6615
8138
          fi
6616
8139
          continue
6617
8140
          ;;
6618
8141
        -l*)
6619
 
          if test "$linkmode" != lib && test "$linkmode" != prog; then
6620
 
            func_warning "\`-l' is ignored for archives/objects"
 
8142
          if test lib != "$linkmode" && test prog != "$linkmode"; then
 
8143
            func_warning "'-l' is ignored for archives/objects"
6621
8144
            continue
6622
8145
          fi
6623
8146
          func_stripname '-l' '' "$deplib"
6624
8147
          name=$func_stripname_result
6625
 
          if test "$linkmode" = lib; then
 
8148
          if test lib = "$linkmode"; then
6626
8149
            searchdirs="$newlib_search_path $lib_search_path $compiler_lib_search_dirs $sys_lib_search_path $shlib_search_path"
6627
8150
          else
6628
8151
            searchdirs="$newlib_search_path $lib_search_path $sys_lib_search_path $shlib_search_path"
6630
8153
          for searchdir in $searchdirs; do
6631
8154
            for search_ext in .la $std_shrext .so .a; do
6632
8155
              # Search the libtool library
6633
 
              lib="$searchdir/lib${name}${search_ext}"
 
8156
              lib=$searchdir/lib$name$search_ext
6634
8157
              if test -f "$lib"; then
6635
 
                if test "$search_ext" = ".la"; then
6636
 
                  found=yes
 
8158
                if test .la = "$search_ext"; then
 
8159
                  found=:
6637
8160
                else
6638
 
                  found=no
 
8161
                  found=false
6639
8162
                fi
6640
8163
                break 2
6641
8164
              fi
6642
8165
            done
6643
8166
          done
6644
 
          if test "$found" != yes; then
6645
 
            # deplib doesn't seem to be a libtool library
6646
 
            if test "$linkmode,$pass" = "prog,link"; then
6647
 
              compile_deplibs="$deplib $compile_deplibs"
6648
 
              finalize_deplibs="$deplib $finalize_deplibs"
6649
 
            else
6650
 
              deplibs="$deplib $deplibs"
6651
 
              test "$linkmode" = lib && newdependency_libs="$deplib $newdependency_libs"
6652
 
            fi
6653
 
            continue
6654
 
          else # deplib is a libtool library
 
8167
          if $found; then
 
8168
            # deplib is a libtool library
6655
8169
            # If $allow_libtool_libs_with_static_runtimes && $deplib is a stdlib,
6656
8170
            # We need to do some special things here, and not later.
6657
 
            if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
 
8171
            if test yes = "$allow_libtool_libs_with_static_runtimes"; then
6658
8172
              case " $predeps $postdeps " in
6659
8173
              *" $deplib "*)
6660
8174
                if func_lalib_p "$lib"; then
6662
8176
                  old_library=
6663
8177
                  func_source "$lib"
6664
8178
                  for l in $old_library $library_names; do
6665
 
                    ll="$l"
 
8179
                    ll=$l
6666
8180
                  done
6667
 
                  if test "X$ll" = "X$old_library" ; then # only static version available
6668
 
                    found=no
 
8181
                  if test "X$ll" = "X$old_library"; then # only static version available
 
8182
                    found=false
6669
8183
                    func_dirname "$lib" "" "."
6670
 
                    ladir="$func_dirname_result"
 
8184
                    ladir=$func_dirname_result
6671
8185
                    lib=$ladir/$old_library
6672
 
                    if test "$linkmode,$pass" = "prog,link"; then
 
8186
                    if test prog,link = "$linkmode,$pass"; then
6673
8187
                      compile_deplibs="$deplib $compile_deplibs"
6674
8188
                      finalize_deplibs="$deplib $finalize_deplibs"
6675
8189
                    else
6676
8190
                      deplibs="$deplib $deplibs"
6677
 
                      test "$linkmode" = lib && newdependency_libs="$deplib $newdependency_libs"
 
8191
                      test lib = "$linkmode" && newdependency_libs="$deplib $newdependency_libs"
6678
8192
                    fi
6679
8193
                    continue
6680
8194
                  fi
6683
8197
              *) ;;
6684
8198
              esac
6685
8199
            fi
 
8200
          else
 
8201
            # deplib doesn't seem to be a libtool library
 
8202
            if test prog,link = "$linkmode,$pass"; then
 
8203
              compile_deplibs="$deplib $compile_deplibs"
 
8204
              finalize_deplibs="$deplib $finalize_deplibs"
 
8205
            else
 
8206
              deplibs="$deplib $deplibs"
 
8207
              test lib = "$linkmode" && newdependency_libs="$deplib $newdependency_libs"
 
8208
            fi
 
8209
            continue
6686
8210
          fi
6687
8211
          ;; # -l
6688
8212
        *.ltframework)
6689
 
          if test "$linkmode,$pass" = "prog,link"; then
 
8213
          if test prog,link = "$linkmode,$pass"; then
6690
8214
            compile_deplibs="$deplib $compile_deplibs"
6691
8215
            finalize_deplibs="$deplib $finalize_deplibs"
6692
8216
          else
6693
8217
            deplibs="$deplib $deplibs"
6694
 
            if test "$linkmode" = lib ; then
 
8218
            if test lib = "$linkmode"; then
6695
8219
                case "$new_inherited_linker_flags " in
6696
8220
                    *" $deplib "*) ;;
6697
 
                    * ) new_inherited_linker_flags+=" $deplib" ;;
 
8221
                    * ) func_append new_inherited_linker_flags " $deplib" ;;
6698
8222
                esac
6699
8223
            fi
6700
8224
          fi
6704
8228
          case $linkmode in
6705
8229
          lib)
6706
8230
            deplibs="$deplib $deplibs"
6707
 
            test "$pass" = conv && continue
 
8231
            test conv = "$pass" && continue
6708
8232
            newdependency_libs="$deplib $newdependency_libs"
6709
8233
            func_stripname '-L' '' "$deplib"
6710
8234
            func_resolve_sysroot "$func_stripname_result"
6711
 
            newlib_search_path+=" $func_resolve_sysroot_result"
 
8235
            func_append newlib_search_path " $func_resolve_sysroot_result"
6712
8236
            ;;
6713
8237
          prog)
6714
 
            if test "$pass" = conv; then
 
8238
            if test conv = "$pass"; then
6715
8239
              deplibs="$deplib $deplibs"
6716
8240
              continue
6717
8241
            fi
6718
 
            if test "$pass" = scan; then
 
8242
            if test scan = "$pass"; then
6719
8243
              deplibs="$deplib $deplibs"
6720
8244
            else
6721
8245
              compile_deplibs="$deplib $compile_deplibs"
6723
8247
            fi
6724
8248
            func_stripname '-L' '' "$deplib"
6725
8249
            func_resolve_sysroot "$func_stripname_result"
6726
 
            newlib_search_path+=" $func_resolve_sysroot_result"
 
8250
            func_append newlib_search_path " $func_resolve_sysroot_result"
6727
8251
            ;;
6728
8252
          *)
6729
 
            func_warning "\`-L' is ignored for archives/objects"
 
8253
            func_warning "'-L' is ignored for archives/objects"
6730
8254
            ;;
6731
8255
          esac # linkmode
6732
8256
          continue
6733
8257
          ;; # -L
6734
8258
        -R*)
6735
 
          if test "$pass" = link; then
 
8259
          if test link = "$pass"; then
6736
8260
            func_stripname '-R' '' "$deplib"
6737
8261
            func_resolve_sysroot "$func_stripname_result"
6738
8262
            dir=$func_resolve_sysroot_result
6739
8263
            # Make sure the xrpath contains only unique directories.
6740
8264
            case "$xrpath " in
6741
8265
            *" $dir "*) ;;
6742
 
            *) xrpath+=" $dir" ;;
 
8266
            *) func_append xrpath " $dir" ;;
6743
8267
            esac
6744
8268
          fi
6745
8269
          deplibs="$deplib $deplibs"
6750
8274
          lib=$func_resolve_sysroot_result
6751
8275
          ;;
6752
8276
        *.$libext)
6753
 
          if test "$pass" = conv; then
 
8277
          if test conv = "$pass"; then
6754
8278
            deplibs="$deplib $deplibs"
6755
8279
            continue
6756
8280
          fi
6761
8285
            case " $dlpreconveniencelibs " in
6762
8286
            *" $deplib "*) ;;
6763
8287
            *)
6764
 
              valid_a_lib=no
 
8288
              valid_a_lib=false
6765
8289
              case $deplibs_check_method in
6766
8290
                match_pattern*)
6767
8291
                  set dummy $deplibs_check_method; shift
6768
8292
                  match_pattern_regex=`expr "$deplibs_check_method" : "$1 \(.*\)"`
6769
8293
                  if eval "\$ECHO \"$deplib\"" 2>/dev/null | $SED 10q \
6770
8294
                    | $EGREP "$match_pattern_regex" > /dev/null; then
6771
 
                    valid_a_lib=yes
 
8295
                    valid_a_lib=:
6772
8296
                  fi
6773
8297
                ;;
6774
8298
                pass_all)
6775
 
                  valid_a_lib=yes
 
8299
                  valid_a_lib=:
6776
8300
                ;;
6777
8301
              esac
6778
 
              if test "$valid_a_lib" != yes; then
 
8302
              if $valid_a_lib; then
 
8303
                echo
 
8304
                $ECHO "*** Warning: Linking the shared library $output against the"
 
8305
                $ECHO "*** static library $deplib is not portable!"
 
8306
                deplibs="$deplib $deplibs"
 
8307
              else
6779
8308
                echo
6780
8309
                $ECHO "*** Warning: Trying to link with static lib archive $deplib."
6781
8310
                echo "*** I have the capability to make that library automatically link in when"
6783
8312
                echo "*** shared version of the library, which you do not appear to have"
6784
8313
                echo "*** because the file extensions .$libext of this argument makes me believe"
6785
8314
                echo "*** that it is just a static archive that I should not use here."
6786
 
              else
6787
 
                echo
6788
 
                $ECHO "*** Warning: Linking the shared library $output against the"
6789
 
                $ECHO "*** static library $deplib is not portable!"
6790
 
                deplibs="$deplib $deplibs"
6791
8315
              fi
6792
8316
              ;;
6793
8317
            esac
6794
8318
            continue
6795
8319
            ;;
6796
8320
          prog)
6797
 
            if test "$pass" != link; then
 
8321
            if test link != "$pass"; then
6798
8322
              deplibs="$deplib $deplibs"
6799
8323
            else
6800
8324
              compile_deplibs="$deplib $compile_deplibs"
6805
8329
          esac # linkmode
6806
8330
          ;; # *.$libext
6807
8331
        *.lo | *.$objext)
6808
 
          if test "$pass" = conv; then
 
8332
          if test conv = "$pass"; then
6809
8333
            deplibs="$deplib $deplibs"
6810
 
          elif test "$linkmode" = prog; then
6811
 
            if test "$pass" = dlpreopen || test "$dlopen_support" != yes || test "$build_libtool_libs" = no; then
 
8334
          elif test prog = "$linkmode"; then
 
8335
            if test dlpreopen = "$pass" || test yes != "$dlopen_support" || test no = "$build_libtool_libs"; then
6812
8336
              # If there is no dlopen support or we're linking statically,
6813
8337
              # we need to preload.
6814
 
              newdlprefiles+=" $deplib"
 
8338
              func_append newdlprefiles " $deplib"
6815
8339
              compile_deplibs="$deplib $compile_deplibs"
6816
8340
              finalize_deplibs="$deplib $finalize_deplibs"
6817
8341
            else
6818
 
              newdlfiles+=" $deplib"
 
8342
              func_append newdlfiles " $deplib"
6819
8343
            fi
6820
8344
          fi
6821
8345
          continue
6822
8346
          ;;
6823
8347
        %DEPLIBS%)
6824
 
          alldeplibs=yes
 
8348
          alldeplibs=:
6825
8349
          continue
6826
8350
          ;;
6827
8351
        esac # case $deplib
6828
8352
 
6829
 
        if test "$found" = yes || test -f "$lib"; then :
6830
 
        else
6831
 
          func_fatal_error "cannot find the library \`$lib' or unhandled argument \`$deplib'"
6832
 
        fi
 
8353
        $found || test -f "$lib" \
 
8354
          || func_fatal_error "cannot find the library '$lib' or unhandled argument '$deplib'"
6833
8355
 
6834
8356
        # Check to see that this really is a libtool archive.
6835
8357
        func_lalib_unsafe_p "$lib" \
6836
 
          || func_fatal_error "\`$lib' is not a valid libtool archive"
 
8358
          || func_fatal_error "'$lib' is not a valid libtool archive"
6837
8359
 
6838
8360
        func_dirname "$lib" "" "."
6839
 
        ladir="$func_dirname_result"
 
8361
        ladir=$func_dirname_result
6840
8362
 
6841
8363
        dlname=
6842
8364
        dlopen=
6861
8383
          for tmp_inherited_linker_flag in $tmp_inherited_linker_flags; do
6862
8384
            case " $new_inherited_linker_flags " in
6863
8385
              *" $tmp_inherited_linker_flag "*) ;;
6864
 
              *) new_inherited_linker_flags+=" $tmp_inherited_linker_flag";;
 
8386
              *) func_append new_inherited_linker_flags " $tmp_inherited_linker_flag";;
6865
8387
            esac
6866
8388
          done
6867
8389
        fi
6868
8390
        dependency_libs=`$ECHO " $dependency_libs" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'`
6869
 
        if test "$linkmode,$pass" = "lib,link" ||
6870
 
           test "$linkmode,$pass" = "prog,scan" ||
6871
 
           { test "$linkmode" != prog && test "$linkmode" != lib; }; then
6872
 
          test -n "$dlopen" && dlfiles+=" $dlopen"
6873
 
          test -n "$dlpreopen" && dlprefiles+=" $dlpreopen"
 
8391
        if test lib,link = "$linkmode,$pass" ||
 
8392
           test prog,scan = "$linkmode,$pass" ||
 
8393
           { test prog != "$linkmode" && test lib != "$linkmode"; }; then
 
8394
          test -n "$dlopen" && func_append dlfiles " $dlopen"
 
8395
          test -n "$dlpreopen" && func_append dlprefiles " $dlpreopen"
6874
8396
        fi
6875
8397
 
6876
 
        if test "$pass" = conv; then
 
8398
        if test conv = "$pass"; then
6877
8399
          # Only check for convenience libraries
6878
8400
          deplibs="$lib $deplibs"
6879
8401
          if test -z "$libdir"; then
6880
8402
            if test -z "$old_library"; then
6881
 
              func_fatal_error "cannot find name of link library for \`$lib'"
 
8403
              func_fatal_error "cannot find name of link library for '$lib'"
6882
8404
            fi
6883
8405
            # It is a libtool convenience library, so add in its objects.
6884
 
            convenience+=" $ladir/$objdir/$old_library"
6885
 
            old_convenience+=" $ladir/$objdir/$old_library"
 
8406
            func_append convenience " $ladir/$objdir/$old_library"
 
8407
            func_append old_convenience " $ladir/$objdir/$old_library"
6886
8408
            tmp_libs=
6887
8409
            for deplib in $dependency_libs; do
6888
8410
              deplibs="$deplib $deplibs"
6889
 
              if $opt_preserve_dup_deps ; then
 
8411
              if $opt_preserve_dup_deps; then
6890
8412
                case "$tmp_libs " in
6891
 
                *" $deplib "*) specialdeplibs+=" $deplib" ;;
 
8413
                *" $deplib "*) func_append specialdeplibs " $deplib" ;;
6892
8414
                esac
6893
8415
              fi
6894
 
              tmp_libs+=" $deplib"
 
8416
              func_append tmp_libs " $deplib"
6895
8417
            done
6896
 
          elif test "$linkmode" != prog && test "$linkmode" != lib; then
6897
 
            func_fatal_error "\`$lib' is not a convenience library"
 
8418
          elif test prog != "$linkmode" && test lib != "$linkmode"; then
 
8419
            func_fatal_error "'$lib' is not a convenience library"
6898
8420
          fi
6899
8421
          continue
6900
8422
        fi # $pass = conv
6903
8425
        # Get the name of the library we link against.
6904
8426
        linklib=
6905
8427
        if test -n "$old_library" &&
6906
 
           { test "$prefer_static_libs" = yes ||
6907
 
             test "$prefer_static_libs,$installed" = "built,no"; }; then
 
8428
           { test yes = "$prefer_static_libs" ||
 
8429
             test built,no = "$prefer_static_libs,$installed"; }; then
6908
8430
          linklib=$old_library
6909
8431
        else
6910
8432
          for l in $old_library $library_names; do
6911
 
            linklib="$l"
 
8433
            linklib=$l
6912
8434
          done
6913
8435
        fi
6914
8436
        if test -z "$linklib"; then
6915
 
          func_fatal_error "cannot find name of link library for \`$lib'"
 
8437
          func_fatal_error "cannot find name of link library for '$lib'"
6916
8438
        fi
6917
8439
 
6918
8440
        # This library was specified with -dlopen.
6919
 
        if test "$pass" = dlopen; then
6920
 
          if test -z "$libdir"; then
6921
 
            func_fatal_error "cannot -dlopen a convenience library: \`$lib'"
6922
 
          fi
 
8441
        if test dlopen = "$pass"; then
 
8442
          test -z "$libdir" \
 
8443
            && func_fatal_error "cannot -dlopen a convenience library: '$lib'"
6923
8444
          if test -z "$dlname" ||
6924
 
             test "$dlopen_support" != yes ||
6925
 
             test "$build_libtool_libs" = no; then
 
8445
             test yes != "$dlopen_support" ||
 
8446
             test no = "$build_libtool_libs"
 
8447
          then
6926
8448
            # If there is no dlname, no dlopen support or we're linking
6927
8449
            # statically, we need to preload.  We also need to preload any
6928
8450
            # dependent libraries so libltdl's deplib preloader doesn't
6929
8451
            # bomb out in the load deplibs phase.
6930
 
            dlprefiles+=" $lib $dependency_libs"
 
8452
            func_append dlprefiles " $lib $dependency_libs"
6931
8453
          else
6932
 
            newdlfiles+=" $lib"
 
8454
            func_append newdlfiles " $lib"
6933
8455
          fi
6934
8456
          continue
6935
8457
        fi # $pass = dlopen
6936
8458
 
6937
8459
        # We need an absolute path.
6938
8460
        case $ladir in
6939
 
        [\\/]* | [A-Za-z]:[\\/]*) abs_ladir="$ladir" ;;
 
8461
        [\\/]* | [A-Za-z]:[\\/]*) abs_ladir=$ladir ;;
6940
8462
        *)
6941
8463
          abs_ladir=`cd "$ladir" && pwd`
6942
8464
          if test -z "$abs_ladir"; then
6943
 
            func_warning "cannot determine absolute directory name of \`$ladir'"
 
8465
            func_warning "cannot determine absolute directory name of '$ladir'"
6944
8466
            func_warning "passing it literally to the linker, although it might fail"
6945
 
            abs_ladir="$ladir"
 
8467
            abs_ladir=$ladir
6946
8468
          fi
6947
8469
          ;;
6948
8470
        esac
6949
8471
        func_basename "$lib"
6950
 
        laname="$func_basename_result"
 
8472
        laname=$func_basename_result
6951
8473
 
6952
8474
        # Find the relevant object directory and library name.
6953
 
        if test "X$installed" = Xyes; then
 
8475
        if test yes = "$installed"; then
6954
8476
          if test ! -f "$lt_sysroot$libdir/$linklib" && test -f "$abs_ladir/$linklib"; then
6955
 
            func_warning "library \`$lib' was moved."
6956
 
            dir="$ladir"
6957
 
            absdir="$abs_ladir"
6958
 
            libdir="$abs_ladir"
 
8477
            func_warning "library '$lib' was moved."
 
8478
            dir=$ladir
 
8479
            absdir=$abs_ladir
 
8480
            libdir=$abs_ladir
6959
8481
          else
6960
 
            dir="$lt_sysroot$libdir"
6961
 
            absdir="$lt_sysroot$libdir"
 
8482
            dir=$lt_sysroot$libdir
 
8483
            absdir=$lt_sysroot$libdir
6962
8484
          fi
6963
 
          test "X$hardcode_automatic" = Xyes && avoidtemprpath=yes
 
8485
          test yes = "$hardcode_automatic" && avoidtemprpath=yes
6964
8486
        else
6965
8487
          if test ! -f "$ladir/$objdir/$linklib" && test -f "$abs_ladir/$linklib"; then
6966
 
            dir="$ladir"
6967
 
            absdir="$abs_ladir"
 
8488
            dir=$ladir
 
8489
            absdir=$abs_ladir
6968
8490
            # Remove this search path later
6969
 
            notinst_path+=" $abs_ladir"
 
8491
            func_append notinst_path " $abs_ladir"
6970
8492
          else
6971
 
            dir="$ladir/$objdir"
6972
 
            absdir="$abs_ladir/$objdir"
 
8493
            dir=$ladir/$objdir
 
8494
            absdir=$abs_ladir/$objdir
6973
8495
            # Remove this search path later
6974
 
            notinst_path+=" $abs_ladir"
 
8496
            func_append notinst_path " $abs_ladir"
6975
8497
          fi
6976
8498
        fi # $installed = yes
6977
8499
        func_stripname 'lib' '.la' "$laname"
6978
8500
        name=$func_stripname_result
6979
8501
 
6980
8502
        # This library was specified with -dlpreopen.
6981
 
        if test "$pass" = dlpreopen; then
6982
 
          if test -z "$libdir" && test "$linkmode" = prog; then
6983
 
            func_fatal_error "only libraries may -dlpreopen a convenience library: \`$lib'"
 
8503
        if test dlpreopen = "$pass"; then
 
8504
          if test -z "$libdir" && test prog = "$linkmode"; then
 
8505
            func_fatal_error "only libraries may -dlpreopen a convenience library: '$lib'"
6984
8506
          fi
6985
 
          case "$host" in
 
8507
          case $host in
6986
8508
            # special handling for platforms with PE-DLLs.
6987
8509
            *cygwin* | *mingw* | *cegcc* )
6988
8510
              # Linker will automatically link against shared library if both
6996
8518
              if test -n "$dlname"; then
6997
8519
                func_tr_sh "$dir/$linklib"
6998
8520
                eval "libfile_$func_tr_sh_result=\$abs_ladir/\$laname"
6999
 
                newdlprefiles+=" $dir/$linklib"
 
8521
                func_append newdlprefiles " $dir/$linklib"
7000
8522
              else
7001
 
                newdlprefiles+=" $dir/$old_library"
 
8523
                func_append newdlprefiles " $dir/$old_library"
7002
8524
                # Keep a list of preopened convenience libraries to check
7003
8525
                # that they are being used correctly in the link pass.
7004
8526
                test -z "$libdir" && \
7005
 
                  dlpreconveniencelibs+=" $dir/$old_library"
 
8527
                  func_append dlpreconveniencelibs " $dir/$old_library"
7006
8528
              fi
7007
8529
            ;;
7008
8530
            * )
7009
8531
              # Prefer using a static library (so that no silly _DYNAMIC symbols
7010
8532
              # are required to link).
7011
8533
              if test -n "$old_library"; then
7012
 
                newdlprefiles+=" $dir/$old_library"
 
8534
                func_append newdlprefiles " $dir/$old_library"
7013
8535
                # Keep a list of preopened convenience libraries to check
7014
8536
                # that they are being used correctly in the link pass.
7015
8537
                test -z "$libdir" && \
7016
 
                  dlpreconveniencelibs+=" $dir/$old_library"
 
8538
                  func_append dlpreconveniencelibs " $dir/$old_library"
7017
8539
              # Otherwise, use the dlname, so that lt_dlopen finds it.
7018
8540
              elif test -n "$dlname"; then
7019
 
                newdlprefiles+=" $dir/$dlname"
 
8541
                func_append newdlprefiles " $dir/$dlname"
7020
8542
              else
7021
 
                newdlprefiles+=" $dir/$linklib"
 
8543
                func_append newdlprefiles " $dir/$linklib"
7022
8544
              fi
7023
8545
            ;;
7024
8546
          esac
7026
8548
 
7027
8549
        if test -z "$libdir"; then
7028
8550
          # Link the convenience library
7029
 
          if test "$linkmode" = lib; then
 
8551
          if test lib = "$linkmode"; then
7030
8552
            deplibs="$dir/$old_library $deplibs"
7031
 
          elif test "$linkmode,$pass" = "prog,link"; then
 
8553
          elif test prog,link = "$linkmode,$pass"; then
7032
8554
            compile_deplibs="$dir/$old_library $compile_deplibs"
7033
8555
            finalize_deplibs="$dir/$old_library $finalize_deplibs"
7034
8556
          else
7038
8560
        fi
7039
8561
 
7040
8562
 
7041
 
        if test "$linkmode" = prog && test "$pass" != link; then
7042
 
          newlib_search_path+=" $ladir"
 
8563
        if test prog = "$linkmode" && test link != "$pass"; then
 
8564
          func_append newlib_search_path " $ladir"
7043
8565
          deplibs="$lib $deplibs"
7044
8566
 
7045
 
          linkalldeplibs=no
7046
 
          if test "$link_all_deplibs" != no || test -z "$library_names" ||
7047
 
             test "$build_libtool_libs" = no; then
7048
 
            linkalldeplibs=yes
 
8567
          linkalldeplibs=false
 
8568
          if test no != "$link_all_deplibs" || test -z "$library_names" ||
 
8569
             test no = "$build_libtool_libs"; then
 
8570
            linkalldeplibs=:
7049
8571
          fi
7050
8572
 
7051
8573
          tmp_libs=
7053
8575
            case $deplib in
7054
8576
            -L*) func_stripname '-L' '' "$deplib"
7055
8577
                 func_resolve_sysroot "$func_stripname_result"
7056
 
                 newlib_search_path+=" $func_resolve_sysroot_result"
 
8578
                 func_append newlib_search_path " $func_resolve_sysroot_result"
7057
8579
                 ;;
7058
8580
            esac
7059
8581
            # Need to link against all dependency_libs?
7060
 
            if test "$linkalldeplibs" = yes; then
 
8582
            if $linkalldeplibs; then
7061
8583
              deplibs="$deplib $deplibs"
7062
8584
            else
7063
8585
              # Need to hardcode shared library paths
7064
8586
              # or/and link against static libraries
7065
8587
              newdependency_libs="$deplib $newdependency_libs"
7066
8588
            fi
7067
 
            if $opt_preserve_dup_deps ; then
 
8589
            if $opt_preserve_dup_deps; then
7068
8590
              case "$tmp_libs " in
7069
 
              *" $deplib "*) specialdeplibs+=" $deplib" ;;
 
8591
              *" $deplib "*) func_append specialdeplibs " $deplib" ;;
7070
8592
              esac
7071
8593
            fi
7072
 
            tmp_libs+=" $deplib"
 
8594
            func_append tmp_libs " $deplib"
7073
8595
          done # for deplib
7074
8596
          continue
7075
8597
        fi # $linkmode = prog...
7076
8598
 
7077
 
        if test "$linkmode,$pass" = "prog,link"; then
 
8599
        if test prog,link = "$linkmode,$pass"; then
7078
8600
          if test -n "$library_names" &&
7079
 
             { { test "$prefer_static_libs" = no ||
7080
 
                 test "$prefer_static_libs,$installed" = "built,yes"; } ||
 
8601
             { { test no = "$prefer_static_libs" ||
 
8602
                 test built,yes = "$prefer_static_libs,$installed"; } ||
7081
8603
               test -z "$old_library"; }; then
7082
8604
            # We need to hardcode the library path
7083
 
            if test -n "$shlibpath_var" && test -z "$avoidtemprpath" ; then
 
8605
            if test -n "$shlibpath_var" && test -z "$avoidtemprpath"; then
7084
8606
              # Make sure the rpath contains only unique directories.
7085
 
              case "$temp_rpath:" in
 
8607
              case $temp_rpath: in
7086
8608
              *"$absdir:"*) ;;
7087
 
              *) temp_rpath+="$absdir:" ;;
 
8609
              *) func_append temp_rpath "$absdir:" ;;
7088
8610
              esac
7089
8611
            fi
7090
8612
 
7096
8618
            *)
7097
8619
              case "$compile_rpath " in
7098
8620
              *" $absdir "*) ;;
7099
 
              *) compile_rpath+=" $absdir" ;;
 
8621
              *) func_append compile_rpath " $absdir" ;;
7100
8622
              esac
7101
8623
              ;;
7102
8624
            esac
7105
8627
            *)
7106
8628
              case "$finalize_rpath " in
7107
8629
              *" $libdir "*) ;;
7108
 
              *) finalize_rpath+=" $libdir" ;;
 
8630
              *) func_append finalize_rpath " $libdir" ;;
7109
8631
              esac
7110
8632
              ;;
7111
8633
            esac
7112
8634
          fi # $linkmode,$pass = prog,link...
7113
8635
 
7114
 
          if test "$alldeplibs" = yes &&
7115
 
             { test "$deplibs_check_method" = pass_all ||
7116
 
               { test "$build_libtool_libs" = yes &&
 
8636
          if $alldeplibs &&
 
8637
             { test pass_all = "$deplibs_check_method" ||
 
8638
               { test yes = "$build_libtool_libs" &&
7117
8639
                 test -n "$library_names"; }; }; then
7118
8640
            # We only need to search for static libraries
7119
8641
            continue
7122
8644
 
7123
8645
        link_static=no # Whether the deplib will be linked statically
7124
8646
        use_static_libs=$prefer_static_libs
7125
 
        if test "$use_static_libs" = built && test "$installed" = yes; then
 
8647
        if test built = "$use_static_libs" && test yes = "$installed"; then
7126
8648
          use_static_libs=no
7127
8649
        fi
7128
8650
        if test -n "$library_names" &&
7129
 
           { test "$use_static_libs" = no || test -z "$old_library"; }; then
 
8651
           { test no = "$use_static_libs" || test -z "$old_library"; }; then
7130
8652
          case $host in
7131
 
          *cygwin* | *mingw* | *cegcc*)
 
8653
          *cygwin* | *mingw* | *cegcc* | *os2*)
7132
8654
              # No point in relinking DLLs because paths are not encoded
7133
 
              notinst_deplibs+=" $lib"
 
8655
              func_append notinst_deplibs " $lib"
7134
8656
              need_relink=no
7135
8657
            ;;
7136
8658
          *)
7137
 
            if test "$installed" = no; then
7138
 
              notinst_deplibs+=" $lib"
 
8659
            if test no = "$installed"; then
 
8660
              func_append notinst_deplibs " $lib"
7139
8661
              need_relink=yes
7140
8662
            fi
7141
8663
            ;;
7144
8666
 
7145
8667
          # Warn about portability, can't link against -module's on some
7146
8668
          # systems (darwin).  Don't bleat about dlopened modules though!
7147
 
          dlopenmodule=""
 
8669
          dlopenmodule=
7148
8670
          for dlpremoduletest in $dlprefiles; do
7149
8671
            if test "X$dlpremoduletest" = "X$lib"; then
7150
 
              dlopenmodule="$dlpremoduletest"
 
8672
              dlopenmodule=$dlpremoduletest
7151
8673
              break
7152
8674
            fi
7153
8675
          done
7154
 
          if test -z "$dlopenmodule" && test "$shouldnotlink" = yes && test "$pass" = link; then
 
8676
          if test -z "$dlopenmodule" && test yes = "$shouldnotlink" && test link = "$pass"; then
7155
8677
            echo
7156
 
            if test "$linkmode" = prog; then
 
8678
            if test prog = "$linkmode"; then
7157
8679
              $ECHO "*** Warning: Linking the executable $output against the loadable module"
7158
8680
            else
7159
8681
              $ECHO "*** Warning: Linking the shared library $output against the loadable module"
7160
8682
            fi
7161
8683
            $ECHO "*** $linklib is not portable!"
7162
8684
          fi
7163
 
          if test "$linkmode" = lib &&
7164
 
             test "$hardcode_into_libs" = yes; then
 
8685
          if test lib = "$linkmode" &&
 
8686
             test yes = "$hardcode_into_libs"; then
7165
8687
            # Hardcode the library path.
7166
8688
            # Skip directories that are in the system default run-time
7167
8689
            # search path.
7170
8692
            *)
7171
8693
              case "$compile_rpath " in
7172
8694
              *" $absdir "*) ;;
7173
 
              *) compile_rpath+=" $absdir" ;;
 
8695
              *) func_append compile_rpath " $absdir" ;;
7174
8696
              esac
7175
8697
              ;;
7176
8698
            esac
7179
8701
            *)
7180
8702
              case "$finalize_rpath " in
7181
8703
              *" $libdir "*) ;;
7182
 
              *) finalize_rpath+=" $libdir" ;;
 
8704
              *) func_append finalize_rpath " $libdir" ;;
7183
8705
              esac
7184
8706
              ;;
7185
8707
            esac
7189
8711
            # figure out the soname
7190
8712
            set dummy $library_names
7191
8713
            shift
7192
 
            realname="$1"
 
8714
            realname=$1
7193
8715
            shift
7194
8716
            libname=`eval "\\$ECHO \"$libname_spec\""`
7195
8717
            # use dlname if we got it. it's perfectly good, no?
7196
8718
            if test -n "$dlname"; then
7197
 
              soname="$dlname"
 
8719
              soname=$dlname
7198
8720
            elif test -n "$soname_spec"; then
7199
8721
              # bleh windows
7200
8722
              case $host in
7201
 
              *cygwin* | mingw* | *cegcc*)
 
8723
              *cygwin* | mingw* | *cegcc* | *os2*)
7202
8724
                func_arith $current - $age
7203
8725
                major=$func_arith_result
7204
 
                versuffix="-$major"
 
8726
                versuffix=-$major
7205
8727
                ;;
7206
8728
              esac
7207
8729
              eval soname=\"$soname_spec\"
7208
8730
            else
7209
 
              soname="$realname"
 
8731
              soname=$realname
7210
8732
            fi
7211
8733
 
7212
8734
            # Make a new name for the extract_expsyms_cmds to use
7213
 
            soroot="$soname"
 
8735
            soroot=$soname
7214
8736
            func_basename "$soroot"
7215
 
            soname="$func_basename_result"
 
8737
            soname=$func_basename_result
7216
8738
            func_stripname 'lib' '.dll' "$soname"
7217
8739
            newlib=libimp-$func_stripname_result.a
7218
8740
 
7219
8741
            # If the library has no export list, then create one now
7220
8742
            if test -f "$output_objdir/$soname-def"; then :
7221
8743
            else
7222
 
              func_verbose "extracting exported symbol list from \`$soname'"
 
8744
              func_verbose "extracting exported symbol list from '$soname'"
7223
8745
              func_execute_cmds "$extract_expsyms_cmds" 'exit $?'
7224
8746
            fi
7225
8747
 
7226
8748
            # Create $newlib
7227
8749
            if test -f "$output_objdir/$newlib"; then :; else
7228
 
              func_verbose "generating import library for \`$soname'"
 
8750
              func_verbose "generating import library for '$soname'"
7229
8751
              func_execute_cmds "$old_archive_from_expsyms_cmds" 'exit $?'
7230
8752
            fi
7231
8753
            # make sure the library variables are pointing to the new library
7233
8755
            linklib=$newlib
7234
8756
          fi # test -n "$old_archive_from_expsyms_cmds"
7235
8757
 
7236
 
          if test "$linkmode" = prog || test "$opt_mode" != relink; then
 
8758
          if test prog = "$linkmode" || test relink != "$opt_mode"; then
7237
8759
            add_shlibpath=
7238
8760
            add_dir=
7239
8761
            add=
7240
8762
            lib_linked=yes
7241
8763
            case $hardcode_action in
7242
8764
            immediate | unsupported)
7243
 
              if test "$hardcode_direct" = no; then
7244
 
                add="$dir/$linklib"
 
8765
              if test no = "$hardcode_direct"; then
 
8766
                add=$dir/$linklib
7245
8767
                case $host in
7246
 
                  *-*-sco3.2v5.0.[024]*) add_dir="-L$dir" ;;
7247
 
                  *-*-sysv4*uw2*) add_dir="-L$dir" ;;
 
8768
                  *-*-sco3.2v5.0.[024]*) add_dir=-L$dir ;;
 
8769
                  *-*-sysv4*uw2*) add_dir=-L$dir ;;
7248
8770
                  *-*-sysv5OpenUNIX* | *-*-sysv5UnixWare7.[01].[10]* | \
7249
 
                    *-*-unixware7*) add_dir="-L$dir" ;;
 
8771
                    *-*-unixware7*) add_dir=-L$dir ;;
7250
8772
                  *-*-darwin* )
7251
 
                    # if the lib is a (non-dlopened) module then we can not
 
8773
                    # if the lib is a (non-dlopened) module then we cannot
7252
8774
                    # link against it, someone is ignoring the earlier warnings
7253
8775
                    if /usr/bin/file -L $add 2> /dev/null |
7254
 
                         $GREP ": [^:]* bundle" >/dev/null ; then
 
8776
                         $GREP ": [^:]* bundle" >/dev/null; then
7255
8777
                      if test "X$dlopenmodule" != "X$lib"; then
7256
8778
                        $ECHO "*** Warning: lib $linklib is a module, not a shared library"
7257
 
                        if test -z "$old_library" ; then
 
8779
                        if test -z "$old_library"; then
7258
8780
                          echo
7259
8781
                          echo "*** And there doesn't seem to be a static archive available"
7260
8782
                          echo "*** The link will probably fail, sorry"
7261
8783
                        else
7262
 
                          add="$dir/$old_library"
 
8784
                          add=$dir/$old_library
7263
8785
                        fi
7264
8786
                      elif test -n "$old_library"; then
7265
 
                        add="$dir/$old_library"
 
8787
                        add=$dir/$old_library
7266
8788
                      fi
7267
8789
                    fi
7268
8790
                esac
7269
 
              elif test "$hardcode_minus_L" = no; then
 
8791
              elif test no = "$hardcode_minus_L"; then
7270
8792
                case $host in
7271
 
                *-*-sunos*) add_shlibpath="$dir" ;;
 
8793
                *-*-sunos*) add_shlibpath=$dir ;;
7272
8794
                esac
7273
 
                add_dir="-L$dir"
7274
 
                add="-l$name"
7275
 
              elif test "$hardcode_shlibpath_var" = no; then
7276
 
                add_shlibpath="$dir"
7277
 
                add="-l$name"
 
8795
                add_dir=-L$dir
 
8796
                add=-l$name
 
8797
              elif test no = "$hardcode_shlibpath_var"; then
 
8798
                add_shlibpath=$dir
 
8799
                add=-l$name
7278
8800
              else
7279
8801
                lib_linked=no
7280
8802
              fi
7281
8803
              ;;
7282
8804
            relink)
7283
 
              if test "$hardcode_direct" = yes &&
7284
 
                 test "$hardcode_direct_absolute" = no; then
7285
 
                add="$dir/$linklib"
7286
 
              elif test "$hardcode_minus_L" = yes; then
7287
 
                add_dir="-L$absdir"
 
8805
              if test yes = "$hardcode_direct" &&
 
8806
                 test no = "$hardcode_direct_absolute"; then
 
8807
                add=$dir/$linklib
 
8808
              elif test yes = "$hardcode_minus_L"; then
 
8809
                add_dir=-L$absdir
7288
8810
                # Try looking first in the location we're being installed to.
7289
8811
                if test -n "$inst_prefix_dir"; then
7290
8812
                  case $libdir in
7291
8813
                    [\\/]*)
7292
 
                      add_dir+=" -L$inst_prefix_dir$libdir"
 
8814
                      func_append add_dir " -L$inst_prefix_dir$libdir"
7293
8815
                      ;;
7294
8816
                  esac
7295
8817
                fi
7296
 
                add="-l$name"
7297
 
              elif test "$hardcode_shlibpath_var" = yes; then
7298
 
                add_shlibpath="$dir"
7299
 
                add="-l$name"
 
8818
                add=-l$name
 
8819
              elif test yes = "$hardcode_shlibpath_var"; then
 
8820
                add_shlibpath=$dir
 
8821
                add=-l$name
7300
8822
              else
7301
8823
                lib_linked=no
7302
8824
              fi
7304
8826
            *) lib_linked=no ;;
7305
8827
            esac
7306
8828
 
7307
 
            if test "$lib_linked" != yes; then
 
8829
            if test yes != "$lib_linked"; then
7308
8830
              func_fatal_configuration "unsupported hardcode properties"
7309
8831
            fi
7310
8832
 
7311
8833
            if test -n "$add_shlibpath"; then
7312
8834
              case :$compile_shlibpath: in
7313
8835
              *":$add_shlibpath:"*) ;;
7314
 
              *) compile_shlibpath+="$add_shlibpath:" ;;
 
8836
              *) func_append compile_shlibpath "$add_shlibpath:" ;;
7315
8837
              esac
7316
8838
            fi
7317
 
            if test "$linkmode" = prog; then
 
8839
            if test prog = "$linkmode"; then
7318
8840
              test -n "$add_dir" && compile_deplibs="$add_dir $compile_deplibs"
7319
8841
              test -n "$add" && compile_deplibs="$add $compile_deplibs"
7320
8842
            else
7321
8843
              test -n "$add_dir" && deplibs="$add_dir $deplibs"
7322
8844
              test -n "$add" && deplibs="$add $deplibs"
7323
 
              if test "$hardcode_direct" != yes &&
7324
 
                 test "$hardcode_minus_L" != yes &&
7325
 
                 test "$hardcode_shlibpath_var" = yes; then
 
8845
              if test yes != "$hardcode_direct" &&
 
8846
                 test yes != "$hardcode_minus_L" &&
 
8847
                 test yes = "$hardcode_shlibpath_var"; then
7326
8848
                case :$finalize_shlibpath: in
7327
8849
                *":$libdir:"*) ;;
7328
 
                *) finalize_shlibpath+="$libdir:" ;;
 
8850
                *) func_append finalize_shlibpath "$libdir:" ;;
7329
8851
                esac
7330
8852
              fi
7331
8853
            fi
7332
8854
          fi
7333
8855
 
7334
 
          if test "$linkmode" = prog || test "$opt_mode" = relink; then
 
8856
          if test prog = "$linkmode" || test relink = "$opt_mode"; then
7335
8857
            add_shlibpath=
7336
8858
            add_dir=
7337
8859
            add=
7338
8860
            # Finalize command for both is simple: just hardcode it.
7339
 
            if test "$hardcode_direct" = yes &&
7340
 
               test "$hardcode_direct_absolute" = no; then
7341
 
              add="$libdir/$linklib"
7342
 
            elif test "$hardcode_minus_L" = yes; then
7343
 
              add_dir="-L$libdir"
7344
 
              add="-l$name"
7345
 
            elif test "$hardcode_shlibpath_var" = yes; then
 
8861
            if test yes = "$hardcode_direct" &&
 
8862
               test no = "$hardcode_direct_absolute"; then
 
8863
              add=$libdir/$linklib
 
8864
            elif test yes = "$hardcode_minus_L"; then
 
8865
              add_dir=-L$libdir
 
8866
              add=-l$name
 
8867
            elif test yes = "$hardcode_shlibpath_var"; then
7346
8868
              case :$finalize_shlibpath: in
7347
8869
              *":$libdir:"*) ;;
7348
 
              *) finalize_shlibpath+="$libdir:" ;;
 
8870
              *) func_append finalize_shlibpath "$libdir:" ;;
7349
8871
              esac
7350
 
              add="-l$name"
7351
 
            elif test "$hardcode_automatic" = yes; then
 
8872
              add=-l$name
 
8873
            elif test yes = "$hardcode_automatic"; then
7352
8874
              if test -n "$inst_prefix_dir" &&
7353
 
                 test -f "$inst_prefix_dir$libdir/$linklib" ; then
7354
 
                add="$inst_prefix_dir$libdir/$linklib"
 
8875
                 test -f "$inst_prefix_dir$libdir/$linklib"; then
 
8876
                add=$inst_prefix_dir$libdir/$linklib
7355
8877
              else
7356
 
                add="$libdir/$linklib"
 
8878
                add=$libdir/$linklib
7357
8879
              fi
7358
8880
            else
7359
8881
              # We cannot seem to hardcode it, guess we'll fake it.
7360
 
              add_dir="-L$libdir"
 
8882
              add_dir=-L$libdir
7361
8883
              # Try looking first in the location we're being installed to.
7362
8884
              if test -n "$inst_prefix_dir"; then
7363
8885
                case $libdir in
7364
8886
                  [\\/]*)
7365
 
                    add_dir+=" -L$inst_prefix_dir$libdir"
 
8887
                    func_append add_dir " -L$inst_prefix_dir$libdir"
7366
8888
                    ;;
7367
8889
                esac
7368
8890
              fi
7369
 
              add="-l$name"
 
8891
              add=-l$name
7370
8892
            fi
7371
8893
 
7372
 
            if test "$linkmode" = prog; then
 
8894
            if test prog = "$linkmode"; then
7373
8895
              test -n "$add_dir" && finalize_deplibs="$add_dir $finalize_deplibs"
7374
8896
              test -n "$add" && finalize_deplibs="$add $finalize_deplibs"
7375
8897
            else
7377
8899
              test -n "$add" && deplibs="$add $deplibs"
7378
8900
            fi
7379
8901
          fi
7380
 
        elif test "$linkmode" = prog; then
 
8902
        elif test prog = "$linkmode"; then
7381
8903
          # Here we assume that one of hardcode_direct or hardcode_minus_L
7382
8904
          # is not unsupported.  This is valid on all known static and
7383
8905
          # shared platforms.
7384
 
          if test "$hardcode_direct" != unsupported; then
7385
 
            test -n "$old_library" && linklib="$old_library"
 
8906
          if test unsupported != "$hardcode_direct"; then
 
8907
            test -n "$old_library" && linklib=$old_library
7386
8908
            compile_deplibs="$dir/$linklib $compile_deplibs"
7387
8909
            finalize_deplibs="$dir/$linklib $finalize_deplibs"
7388
8910
          else
7389
8911
            compile_deplibs="-l$name -L$dir $compile_deplibs"
7390
8912
            finalize_deplibs="-l$name -L$dir $finalize_deplibs"
7391
8913
          fi
7392
 
        elif test "$build_libtool_libs" = yes; then
 
8914
        elif test yes = "$build_libtool_libs"; then
7393
8915
          # Not a shared library
7394
 
          if test "$deplibs_check_method" != pass_all; then
 
8916
          if test pass_all != "$deplibs_check_method"; then
7395
8917
            # We're trying link a shared library against a static one
7396
8918
            # but the system doesn't support it.
7397
8919
 
7398
8920
            # Just print a warning and add the library to dependency_libs so
7399
8921
            # that the program can be linked against the static library.
7400
8922
            echo
7401
 
            $ECHO "*** Warning: This system can not link to static lib archive $lib."
 
8923
            $ECHO "*** Warning: This system cannot link to static lib archive $lib."
7402
8924
            echo "*** I have the capability to make that library automatically link in when"
7403
8925
            echo "*** you link to this library.  But I can only do this if you have a"
7404
8926
            echo "*** shared version of the library, which you do not appear to have."
7405
 
            if test "$module" = yes; then
 
8927
            if test yes = "$module"; then
7406
8928
              echo "*** But as you try to build a module library, libtool will still create "
7407
8929
              echo "*** a static module, that should work as long as the dlopening application"
7408
8930
              echo "*** is linked with the -dlopen flag to resolve symbols at runtime."
7409
8931
              if test -z "$global_symbol_pipe"; then
7410
8932
                echo
7411
8933
                echo "*** However, this would only work if libtool was able to extract symbol"
7412
 
                echo "*** lists from a program, using \`nm' or equivalent, but libtool could"
 
8934
                echo "*** lists from a program, using 'nm' or equivalent, but libtool could"
7413
8935
                echo "*** not find such a program.  So, this module is probably useless."
7414
 
                echo "*** \`nm' from GNU binutils and a full rebuild may help."
 
8936
                echo "*** 'nm' from GNU binutils and a full rebuild may help."
7415
8937
              fi
7416
 
              if test "$build_old_libs" = no; then
 
8938
              if test no = "$build_old_libs"; then
7417
8939
                build_libtool_libs=module
7418
8940
                build_old_libs=yes
7419
8941
              else
7426
8948
          fi
7427
8949
        fi # link shared/static library?
7428
8950
 
7429
 
        if test "$linkmode" = lib; then
 
8951
        if test lib = "$linkmode"; then
7430
8952
          if test -n "$dependency_libs" &&
7431
 
             { test "$hardcode_into_libs" != yes ||
7432
 
               test "$build_old_libs" = yes ||
7433
 
               test "$link_static" = yes; }; then
 
8953
             { test yes != "$hardcode_into_libs" ||
 
8954
               test yes = "$build_old_libs" ||
 
8955
               test yes = "$link_static"; }; then
7434
8956
            # Extract -R from dependency_libs
7435
8957
            temp_deplibs=
7436
8958
            for libdir in $dependency_libs; do
7439
8961
                   temp_xrpath=$func_stripname_result
7440
8962
                   case " $xrpath " in
7441
8963
                   *" $temp_xrpath "*) ;;
7442
 
                   *) xrpath+=" $temp_xrpath";;
 
8964
                   *) func_append xrpath " $temp_xrpath";;
7443
8965
                   esac;;
7444
 
              *) temp_deplibs+=" $libdir";;
 
8966
              *) func_append temp_deplibs " $libdir";;
7445
8967
              esac
7446
8968
            done
7447
 
            dependency_libs="$temp_deplibs"
 
8969
            dependency_libs=$temp_deplibs
7448
8970
          fi
7449
8971
 
7450
 
          newlib_search_path+=" $absdir"
 
8972
          func_append newlib_search_path " $absdir"
7451
8973
          # Link against this library
7452
 
          test "$link_static" = no && newdependency_libs="$abs_ladir/$laname $newdependency_libs"
 
8974
          test no = "$link_static" && newdependency_libs="$abs_ladir/$laname $newdependency_libs"
7453
8975
          # ... and its dependency_libs
7454
8976
          tmp_libs=
7455
8977
          for deplib in $dependency_libs; do
7459
8981
                   func_resolve_sysroot "$func_stripname_result";;
7460
8982
              *) func_resolve_sysroot "$deplib" ;;
7461
8983
            esac
7462
 
            if $opt_preserve_dup_deps ; then
 
8984
            if $opt_preserve_dup_deps; then
7463
8985
              case "$tmp_libs " in
7464
8986
              *" $func_resolve_sysroot_result "*)
7465
 
                specialdeplibs+=" $func_resolve_sysroot_result" ;;
 
8987
                func_append specialdeplibs " $func_resolve_sysroot_result" ;;
7466
8988
              esac
7467
8989
            fi
7468
 
            tmp_libs+=" $func_resolve_sysroot_result"
 
8990
            func_append tmp_libs " $func_resolve_sysroot_result"
7469
8991
          done
7470
8992
 
7471
 
          if test "$link_all_deplibs" != no; then
 
8993
          if test no != "$link_all_deplibs"; then
7472
8994
            # Add the search paths of all dependency libraries
7473
8995
            for deplib in $dependency_libs; do
7474
8996
              path=
7475
8997
              case $deplib in
7476
 
              -L*) path="$deplib" ;;
 
8998
              -L*) path=$deplib ;;
7477
8999
              *.la)
7478
9000
                func_resolve_sysroot "$deplib"
7479
9001
                deplib=$func_resolve_sysroot_result
7481
9003
                dir=$func_dirname_result
7482
9004
                # We need an absolute path.
7483
9005
                case $dir in
7484
 
                [\\/]* | [A-Za-z]:[\\/]*) absdir="$dir" ;;
 
9006
                [\\/]* | [A-Za-z]:[\\/]*) absdir=$dir ;;
7485
9007
                *)
7486
9008
                  absdir=`cd "$dir" && pwd`
7487
9009
                  if test -z "$absdir"; then
7488
 
                    func_warning "cannot determine absolute directory name of \`$dir'"
7489
 
                    absdir="$dir"
 
9010
                    func_warning "cannot determine absolute directory name of '$dir'"
 
9011
                    absdir=$dir
7490
9012
                  fi
7491
9013
                  ;;
7492
9014
                esac
7494
9016
                case $host in
7495
9017
                *-*-darwin*)
7496
9018
                  depdepl=
7497
 
                  eval deplibrary_names=`${SED} -n -e 's/^library_names=\(.*\)$/\1/p' $deplib`
7498
 
                  if test -n "$deplibrary_names" ; then
7499
 
                    for tmp in $deplibrary_names ; do
 
9019
                  eval deplibrary_names=`$SED -n -e 's/^library_names=\(.*\)$/\1/p' $deplib`
 
9020
                  if test -n "$deplibrary_names"; then
 
9021
                    for tmp in $deplibrary_names; do
7500
9022
                      depdepl=$tmp
7501
9023
                    done
7502
 
                    if test -f "$absdir/$objdir/$depdepl" ; then
7503
 
                      depdepl="$absdir/$objdir/$depdepl"
7504
 
                      darwin_install_name=`${OTOOL} -L $depdepl | awk '{if (NR == 2) {print $1;exit}}'`
 
9024
                    if test -f "$absdir/$objdir/$depdepl"; then
 
9025
                      depdepl=$absdir/$objdir/$depdepl
 
9026
                      darwin_install_name=`$OTOOL -L $depdepl | awk '{if (NR == 2) {print $1;exit}}'`
7505
9027
                      if test -z "$darwin_install_name"; then
7506
 
                          darwin_install_name=`${OTOOL64} -L $depdepl  | awk '{if (NR == 2) {print $1;exit}}'`
 
9028
                          darwin_install_name=`$OTOOL64 -L $depdepl  | awk '{if (NR == 2) {print $1;exit}}'`
7507
9029
                      fi
7508
 
                      compiler_flags+=" ${wl}-dylib_file ${wl}${darwin_install_name}:${depdepl}"
7509
 
                      linker_flags+=" -dylib_file ${darwin_install_name}:${depdepl}"
 
9030
                      func_append compiler_flags " $wl-dylib_file $wl$darwin_install_name:$depdepl"
 
9031
                      func_append linker_flags " -dylib_file $darwin_install_name:$depdepl"
7510
9032
                      path=
7511
9033
                    fi
7512
9034
                  fi
7513
9035
                  ;;
7514
9036
                *)
7515
 
                  path="-L$absdir/$objdir"
 
9037
                  path=-L$absdir/$objdir
7516
9038
                  ;;
7517
9039
                esac
7518
9040
                else
7519
 
                  eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $deplib`
 
9041
                  eval libdir=`$SED -n -e 's/^libdir=\(.*\)$/\1/p' $deplib`
7520
9042
                  test -z "$libdir" && \
7521
 
                    func_fatal_error "\`$deplib' is not a valid libtool archive"
 
9043
                    func_fatal_error "'$deplib' is not a valid libtool archive"
7522
9044
                  test "$absdir" != "$libdir" && \
7523
 
                    func_warning "\`$deplib' seems to be moved"
 
9045
                    func_warning "'$deplib' seems to be moved"
7524
9046
 
7525
 
                  path="-L$absdir"
 
9047
                  path=-L$absdir
7526
9048
                fi
7527
9049
                ;;
7528
9050
              esac
7534
9056
          fi # link_all_deplibs != no
7535
9057
        fi # linkmode = lib
7536
9058
      done # for deplib in $libs
7537
 
      if test "$pass" = link; then
7538
 
        if test "$linkmode" = "prog"; then
 
9059
      if test link = "$pass"; then
 
9060
        if test prog = "$linkmode"; then
7539
9061
          compile_deplibs="$new_inherited_linker_flags $compile_deplibs"
7540
9062
          finalize_deplibs="$new_inherited_linker_flags $finalize_deplibs"
7541
9063
        else
7542
9064
          compiler_flags="$compiler_flags "`$ECHO " $new_inherited_linker_flags" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'`
7543
9065
        fi
7544
9066
      fi
7545
 
      dependency_libs="$newdependency_libs"
7546
 
      if test "$pass" = dlpreopen; then
 
9067
      dependency_libs=$newdependency_libs
 
9068
      if test dlpreopen = "$pass"; then
7547
9069
        # Link the dlpreopened libraries before other libraries
7548
9070
        for deplib in $save_deplibs; do
7549
9071
          deplibs="$deplib $deplibs"
7550
9072
        done
7551
9073
      fi
7552
 
      if test "$pass" != dlopen; then
7553
 
        if test "$pass" != conv; then
 
9074
      if test dlopen != "$pass"; then
 
9075
        test conv = "$pass" || {
7554
9076
          # Make sure lib_search_path contains only unique directories.
7555
9077
          lib_search_path=
7556
9078
          for dir in $newlib_search_path; do
7557
9079
            case "$lib_search_path " in
7558
9080
            *" $dir "*) ;;
7559
 
            *) lib_search_path+=" $dir" ;;
 
9081
            *) func_append lib_search_path " $dir" ;;
7560
9082
            esac
7561
9083
          done
7562
9084
          newlib_search_path=
7563
 
        fi
 
9085
        }
7564
9086
 
7565
 
        if test "$linkmode,$pass" != "prog,link"; then
7566
 
          vars="deplibs"
7567
 
        else
 
9087
        if test prog,link = "$linkmode,$pass"; then
7568
9088
          vars="compile_deplibs finalize_deplibs"
 
9089
        else
 
9090
          vars=deplibs
7569
9091
        fi
7570
9092
        for var in $vars dependency_libs; do
7571
9093
          # Add libraries to $var in reverse order
7614
9136
            -L*)
7615
9137
              case " $tmp_libs " in
7616
9138
              *" $deplib "*) ;;
7617
 
              *) tmp_libs+=" $deplib" ;;
 
9139
              *) func_append tmp_libs " $deplib" ;;
7618
9140
              esac
7619
9141
              ;;
7620
 
            *) tmp_libs+=" $deplib" ;;
 
9142
            *) func_append tmp_libs " $deplib" ;;
7621
9143
            esac
7622
9144
          done
7623
9145
          eval $var=\"$tmp_libs\"
7624
9146
        done # for var
7625
9147
      fi
 
9148
 
 
9149
      # Add Sun CC postdeps if required:
 
9150
      test CXX = "$tagname" && {
 
9151
        case $host_os in
 
9152
        linux*)
 
9153
          case `$CC -V 2>&1 | sed 5q` in
 
9154
          *Sun\ C*) # Sun C++ 5.9
 
9155
            func_suncc_cstd_abi
 
9156
 
 
9157
            if test no != "$suncc_use_cstd_abi"; then
 
9158
              func_append postdeps ' -library=Cstd -library=Crun'
 
9159
            fi
 
9160
            ;;
 
9161
          esac
 
9162
          ;;
 
9163
 
 
9164
        solaris*)
 
9165
          func_cc_basename "$CC"
 
9166
          case $func_cc_basename_result in
 
9167
          CC* | sunCC*)
 
9168
            func_suncc_cstd_abi
 
9169
 
 
9170
            if test no != "$suncc_use_cstd_abi"; then
 
9171
              func_append postdeps ' -library=Cstd -library=Crun'
 
9172
            fi
 
9173
            ;;
 
9174
          esac
 
9175
          ;;
 
9176
        esac
 
9177
      }
 
9178
 
7626
9179
      # Last step: remove runtime libs from dependency_libs
7627
9180
      # (they stay in deplibs)
7628
9181
      tmp_libs=
7629
 
      for i in $dependency_libs ; do
 
9182
      for i in $dependency_libs; do
7630
9183
        case " $predeps $postdeps $compiler_lib_search_path " in
7631
9184
        *" $i "*)
7632
 
          i=""
 
9185
          i=
7633
9186
          ;;
7634
9187
        esac
7635
 
        if test -n "$i" ; then
7636
 
          tmp_libs+=" $i"
 
9188
        if test -n "$i"; then
 
9189
          func_append tmp_libs " $i"
7637
9190
        fi
7638
9191
      done
7639
9192
      dependency_libs=$tmp_libs
7640
9193
    done # for pass
7641
 
    if test "$linkmode" = prog; then
7642
 
      dlfiles="$newdlfiles"
 
9194
    if test prog = "$linkmode"; then
 
9195
      dlfiles=$newdlfiles
7643
9196
    fi
7644
 
    if test "$linkmode" = prog || test "$linkmode" = lib; then
7645
 
      dlprefiles="$newdlprefiles"
 
9197
    if test prog = "$linkmode" || test lib = "$linkmode"; then
 
9198
      dlprefiles=$newdlprefiles
7646
9199
    fi
7647
9200
 
7648
9201
    case $linkmode in
7649
9202
    oldlib)
7650
 
      if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then
7651
 
        func_warning "\`-dlopen' is ignored for archives"
 
9203
      if test -n "$dlfiles$dlprefiles" || test no != "$dlself"; then
 
9204
        func_warning "'-dlopen' is ignored for archives"
7652
9205
      fi
7653
9206
 
7654
9207
      case " $deplibs" in
7655
9208
      *\ -l* | *\ -L*)
7656
 
        func_warning "\`-l' and \`-L' are ignored for archives" ;;
 
9209
        func_warning "'-l' and '-L' are ignored for archives" ;;
7657
9210
      esac
7658
9211
 
7659
9212
      test -n "$rpath" && \
7660
 
        func_warning "\`-rpath' is ignored for archives"
 
9213
        func_warning "'-rpath' is ignored for archives"
7661
9214
 
7662
9215
      test -n "$xrpath" && \
7663
 
        func_warning "\`-R' is ignored for archives"
 
9216
        func_warning "'-R' is ignored for archives"
7664
9217
 
7665
9218
      test -n "$vinfo" && \
7666
 
        func_warning "\`-version-info/-version-number' is ignored for archives"
 
9219
        func_warning "'-version-info/-version-number' is ignored for archives"
7667
9220
 
7668
9221
      test -n "$release" && \
7669
 
        func_warning "\`-release' is ignored for archives"
 
9222
        func_warning "'-release' is ignored for archives"
7670
9223
 
7671
9224
      test -n "$export_symbols$export_symbols_regex" && \
7672
 
        func_warning "\`-export-symbols' is ignored for archives"
 
9225
        func_warning "'-export-symbols' is ignored for archives"
7673
9226
 
7674
9227
      # Now set the variables for building old libraries.
7675
9228
      build_libtool_libs=no
7676
 
      oldlibs="$output"
7677
 
      objs+="$old_deplibs"
 
9229
      oldlibs=$output
 
9230
      func_append objs "$old_deplibs"
7678
9231
      ;;
7679
9232
 
7680
9233
    lib)
7681
 
      # Make sure we only generate libraries of the form `libNAME.la'.
 
9234
      # Make sure we only generate libraries of the form 'libNAME.la'.
7682
9235
      case $outputname in
7683
9236
      lib*)
7684
9237
        func_stripname 'lib' '.la' "$outputname"
7687
9240
        eval libname=\"$libname_spec\"
7688
9241
        ;;
7689
9242
      *)
7690
 
        test "$module" = no && \
7691
 
          func_fatal_help "libtool library \`$output' must begin with \`lib'"
 
9243
        test no = "$module" \
 
9244
          && func_fatal_help "libtool library '$output' must begin with 'lib'"
7692
9245
 
7693
 
        if test "$need_lib_prefix" != no; then
 
9246
        if test no != "$need_lib_prefix"; then
7694
9247
          # Add the "lib" prefix for modules if required
7695
9248
          func_stripname '' '.la' "$outputname"
7696
9249
          name=$func_stripname_result
7704
9257
      esac
7705
9258
 
7706
9259
      if test -n "$objs"; then
7707
 
        if test "$deplibs_check_method" != pass_all; then
7708
 
          func_fatal_error "cannot build libtool library \`$output' from non-libtool objects on this host:$objs"
 
9260
        if test pass_all != "$deplibs_check_method"; then
 
9261
          func_fatal_error "cannot build libtool library '$output' from non-libtool objects on this host:$objs"
7709
9262
        else
7710
9263
          echo
7711
9264
          $ECHO "*** Warning: Linking the shared library $output against the non-libtool"
7712
9265
          $ECHO "*** objects $objs is not portable!"
7713
 
          libobjs+=" $objs"
 
9266
          func_append libobjs " $objs"
7714
9267
        fi
7715
9268
      fi
7716
9269
 
7717
 
      test "$dlself" != no && \
7718
 
        func_warning "\`-dlopen self' is ignored for libtool libraries"
 
9270
      test no = "$dlself" \
 
9271
        || func_warning "'-dlopen self' is ignored for libtool libraries"
7719
9272
 
7720
9273
      set dummy $rpath
7721
9274
      shift
7722
 
      test "$#" -gt 1 && \
7723
 
        func_warning "ignoring multiple \`-rpath's for a libtool library"
 
9275
      test 1 -lt "$#" \
 
9276
        && func_warning "ignoring multiple '-rpath's for a libtool library"
7724
9277
 
7725
 
      install_libdir="$1"
 
9278
      install_libdir=$1
7726
9279
 
7727
9280
      oldlibs=
7728
9281
      if test -z "$rpath"; then
7729
 
        if test "$build_libtool_libs" = yes; then
 
9282
        if test yes = "$build_libtool_libs"; then
7730
9283
          # Building a libtool convenience library.
7731
 
          # Some compilers have problems with a `.al' extension so
 
9284
          # Some compilers have problems with a '.al' extension so
7732
9285
          # convenience libraries should have the same extension an
7733
9286
          # archive normally would.
7734
9287
          oldlibs="$output_objdir/$libname.$libext $oldlibs"
7737
9290
        fi
7738
9291
 
7739
9292
        test -n "$vinfo" && \
7740
 
          func_warning "\`-version-info/-version-number' is ignored for convenience libraries"
 
9293
          func_warning "'-version-info/-version-number' is ignored for convenience libraries"
7741
9294
 
7742
9295
        test -n "$release" && \
7743
 
          func_warning "\`-release' is ignored for convenience libraries"
 
9296
          func_warning "'-release' is ignored for convenience libraries"
7744
9297
      else
7745
9298
 
7746
9299
        # Parse the version information argument.
7747
 
        save_ifs="$IFS"; IFS=':'
 
9300
        save_ifs=$IFS; IFS=:
7748
9301
        set dummy $vinfo 0 0 0
7749
9302
        shift
7750
 
        IFS="$save_ifs"
 
9303
        IFS=$save_ifs
7751
9304
 
7752
9305
        test -n "$7" && \
7753
 
          func_fatal_help "too many parameters to \`-version-info'"
 
9306
          func_fatal_help "too many parameters to '-version-info'"
7754
9307
 
7755
9308
        # convert absolute version numbers to libtool ages
7756
9309
        # this retains compatibility with .la files and attempts
7758
9311
 
7759
9312
        case $vinfo_number in
7760
9313
        yes)
7761
 
          number_major="$1"
7762
 
          number_minor="$2"
7763
 
          number_revision="$3"
 
9314
          number_major=$1
 
9315
          number_minor=$2
 
9316
          number_revision=$3
7764
9317
          #
7765
9318
          # There are really only two kinds -- those that
7766
9319
          # use the current revision as the major version
7767
9320
          # and those that subtract age and use age as
7768
9321
          # a minor version.  But, then there is irix
7769
 
          # which has an extra 1 added just for fun
 
9322
          # that has an extra 1 added just for fun
7770
9323
          #
7771
9324
          case $version_type in
7772
9325
          # correct linux to gnu/linux during the next big refactor
7773
 
          darwin|linux|osf|windows|none)
 
9326
          darwin|freebsd-elf|linux|osf|windows|none)
7774
9327
            func_arith $number_major + $number_minor
7775
9328
            current=$func_arith_result
7776
 
            age="$number_minor"
7777
 
            revision="$number_revision"
 
9329
            age=$number_minor
 
9330
            revision=$number_revision
7778
9331
            ;;
7779
 
          freebsd-aout|freebsd-elf|qnx|sunos)
7780
 
            current="$number_major"
7781
 
            revision="$number_minor"
7782
 
            age="0"
 
9332
          freebsd-aout|qnx|sunos)
 
9333
            current=$number_major
 
9334
            revision=$number_minor
 
9335
            age=0
7783
9336
            ;;
7784
9337
          irix|nonstopux)
7785
9338
            func_arith $number_major + $number_minor
7786
9339
            current=$func_arith_result
7787
 
            age="$number_minor"
7788
 
            revision="$number_minor"
 
9340
            age=$number_minor
 
9341
            revision=$number_minor
7789
9342
            lt_irix_increment=no
7790
9343
            ;;
7791
9344
          *)
7792
 
            func_fatal_configuration "$modename: unknown library version type \`$version_type'"
 
9345
            func_fatal_configuration "$modename: unknown library version type '$version_type'"
7793
9346
            ;;
7794
9347
          esac
7795
9348
          ;;
7796
9349
        no)
7797
 
          current="$1"
7798
 
          revision="$2"
7799
 
          age="$3"
 
9350
          current=$1
 
9351
          revision=$2
 
9352
          age=$3
7800
9353
          ;;
7801
9354
        esac
7802
9355
 
7804
9357
        case $current in
7805
9358
        0|[1-9]|[1-9][0-9]|[1-9][0-9][0-9]|[1-9][0-9][0-9][0-9]|[1-9][0-9][0-9][0-9][0-9]) ;;
7806
9359
        *)
7807
 
          func_error "CURRENT \`$current' must be a nonnegative integer"
7808
 
          func_fatal_error "\`$vinfo' is not valid version information"
 
9360
          func_error "CURRENT '$current' must be a nonnegative integer"
 
9361
          func_fatal_error "'$vinfo' is not valid version information"
7809
9362
          ;;
7810
9363
        esac
7811
9364
 
7812
9365
        case $revision in
7813
9366
        0|[1-9]|[1-9][0-9]|[1-9][0-9][0-9]|[1-9][0-9][0-9][0-9]|[1-9][0-9][0-9][0-9][0-9]) ;;
7814
9367
        *)
7815
 
          func_error "REVISION \`$revision' must be a nonnegative integer"
7816
 
          func_fatal_error "\`$vinfo' is not valid version information"
 
9368
          func_error "REVISION '$revision' must be a nonnegative integer"
 
9369
          func_fatal_error "'$vinfo' is not valid version information"
7817
9370
          ;;
7818
9371
        esac
7819
9372
 
7820
9373
        case $age in
7821
9374
        0|[1-9]|[1-9][0-9]|[1-9][0-9][0-9]|[1-9][0-9][0-9][0-9]|[1-9][0-9][0-9][0-9][0-9]) ;;
7822
9375
        *)
7823
 
          func_error "AGE \`$age' must be a nonnegative integer"
7824
 
          func_fatal_error "\`$vinfo' is not valid version information"
 
9376
          func_error "AGE '$age' must be a nonnegative integer"
 
9377
          func_fatal_error "'$vinfo' is not valid version information"
7825
9378
          ;;
7826
9379
        esac
7827
9380
 
7828
9381
        if test "$age" -gt "$current"; then
7829
 
          func_error "AGE \`$age' is greater than the current interface number \`$current'"
7830
 
          func_fatal_error "\`$vinfo' is not valid version information"
 
9382
          func_error "AGE '$age' is greater than the current interface number '$current'"
 
9383
          func_fatal_error "'$vinfo' is not valid version information"
7831
9384
        fi
7832
9385
 
7833
9386
        # Calculate the version variables.
7842
9395
          # verstring for coding it into the library header
7843
9396
          func_arith $current - $age
7844
9397
          major=.$func_arith_result
7845
 
          versuffix="$major.$age.$revision"
 
9398
          versuffix=$major.$age.$revision
7846
9399
          # Darwin ld doesn't like 0 for these options...
7847
9400
          func_arith $current + 1
7848
9401
          minor_current=$func_arith_result
7849
 
          xlcverstring="${wl}-compatibility_version ${wl}$minor_current ${wl}-current_version ${wl}$minor_current.$revision"
 
9402
          xlcverstring="$wl-compatibility_version $wl$minor_current $wl-current_version $wl$minor_current.$revision"
7850
9403
          verstring="-compatibility_version $minor_current -current_version $minor_current.$revision"
 
9404
          # On Darwin other compilers
 
9405
          case $CC in
 
9406
              nagfor*)
 
9407
                  verstring="$wl-compatibility_version $wl$minor_current $wl-current_version $wl$minor_current.$revision"
 
9408
                  ;;
 
9409
              *)
 
9410
                  verstring="-compatibility_version $minor_current -current_version $minor_current.$revision"
 
9411
                  ;;
 
9412
          esac
7851
9413
          ;;
7852
9414
 
7853
9415
        freebsd-aout)
7854
 
          major=".$current"
7855
 
          versuffix=".$current.$revision";
 
9416
          major=.$current
 
9417
          versuffix=.$current.$revision
7856
9418
          ;;
7857
9419
 
7858
9420
        freebsd-elf)
7859
 
          major=".$current"
7860
 
          versuffix=".$current"
 
9421
          func_arith $current - $age
 
9422
          major=.$func_arith_result
 
9423
          versuffix=$major.$age.$revision
7861
9424
          ;;
7862
9425
 
7863
9426
        irix | nonstopux)
7864
 
          if test "X$lt_irix_increment" = "Xno"; then
 
9427
          if test no = "$lt_irix_increment"; then
7865
9428
            func_arith $current - $age
7866
9429
          else
7867
9430
            func_arith $current - $age + 1
7872
9435
            nonstopux) verstring_prefix=nonstopux ;;
7873
9436
            *)         verstring_prefix=sgi ;;
7874
9437
          esac
7875
 
          verstring="$verstring_prefix$major.$revision"
 
9438
          verstring=$verstring_prefix$major.$revision
7876
9439
 
7877
9440
          # Add in all the interfaces that we are compatible with.
7878
9441
          loop=$revision
7879
 
          while test "$loop" -ne 0; do
 
9442
          while test 0 -ne "$loop"; do
7880
9443
            func_arith $revision - $loop
7881
9444
            iface=$func_arith_result
7882
9445
            func_arith $loop - 1
7883
9446
            loop=$func_arith_result
7884
 
            verstring="$verstring_prefix$major.$iface:$verstring"
 
9447
            verstring=$verstring_prefix$major.$iface:$verstring
7885
9448
          done
7886
9449
 
7887
 
          # Before this point, $major must not contain `.'.
 
9450
          # Before this point, $major must not contain '.'.
7888
9451
          major=.$major
7889
 
          versuffix="$major.$revision"
 
9452
          versuffix=$major.$revision
7890
9453
          ;;
7891
9454
 
7892
9455
        linux) # correct to gnu/linux during the next big refactor
7893
9456
          func_arith $current - $age
7894
9457
          major=.$func_arith_result
7895
 
          versuffix="$major.$age.$revision"
 
9458
          versuffix=$major.$age.$revision
7896
9459
          ;;
7897
9460
 
7898
9461
        osf)
7899
9462
          func_arith $current - $age
7900
9463
          major=.$func_arith_result
7901
 
          versuffix=".$current.$age.$revision"
7902
 
          verstring="$current.$age.$revision"
 
9464
          versuffix=.$current.$age.$revision
 
9465
          verstring=$current.$age.$revision
7903
9466
 
7904
9467
          # Add in all the interfaces that we are compatible with.
7905
9468
          loop=$age
7906
 
          while test "$loop" -ne 0; do
 
9469
          while test 0 -ne "$loop"; do
7907
9470
            func_arith $current - $loop
7908
9471
            iface=$func_arith_result
7909
9472
            func_arith $loop - 1
7910
9473
            loop=$func_arith_result
7911
 
            verstring="$verstring:${iface}.0"
 
9474
            verstring=$verstring:$iface.0
7912
9475
          done
7913
9476
 
7914
9477
          # Make executables depend on our current version.
7915
 
          verstring+=":${current}.0"
 
9478
          func_append verstring ":$current.0"
7916
9479
          ;;
7917
9480
 
7918
9481
        qnx)
7919
 
          major=".$current"
7920
 
          versuffix=".$current"
 
9482
          major=.$current
 
9483
          versuffix=.$current
 
9484
          ;;
 
9485
 
 
9486
        sco)
 
9487
          major=.$current
 
9488
          versuffix=.$current
7921
9489
          ;;
7922
9490
 
7923
9491
        sunos)
7924
 
          major=".$current"
7925
 
          versuffix=".$current.$revision"
 
9492
          major=.$current
 
9493
          versuffix=.$current.$revision
7926
9494
          ;;
7927
9495
 
7928
9496
        windows)
7929
9497
          # Use '-' rather than '.', since we only want one
7930
 
          # extension on DOS 8.3 filesystems.
 
9498
          # extension on DOS 8.3 file systems.
7931
9499
          func_arith $current - $age
7932
9500
          major=$func_arith_result
7933
 
          versuffix="-$major"
 
9501
          versuffix=-$major
7934
9502
          ;;
7935
9503
 
7936
9504
        *)
7937
 
          func_fatal_configuration "unknown library version type \`$version_type'"
 
9505
          func_fatal_configuration "unknown library version type '$version_type'"
7938
9506
          ;;
7939
9507
        esac
7940
9508
 
7948
9516
            verstring=
7949
9517
            ;;
7950
9518
          *)
7951
 
            verstring="0.0"
 
9519
            verstring=0.0
7952
9520
            ;;
7953
9521
          esac
7954
 
          if test "$need_version" = no; then
 
9522
          if test no = "$need_version"; then
7955
9523
            versuffix=
7956
9524
          else
7957
 
            versuffix=".0.0"
 
9525
            versuffix=.0.0
7958
9526
          fi
7959
9527
        fi
7960
9528
 
7961
9529
        # Remove version info from name if versioning should be avoided
7962
 
        if test "$avoid_version" = yes && test "$need_version" = no; then
 
9530
        if test yes,no = "$avoid_version,$need_version"; then
7963
9531
          major=
7964
9532
          versuffix=
7965
 
          verstring=""
 
9533
          verstring=
7966
9534
        fi
7967
9535
 
7968
9536
        # Check to see if the archive will have undefined symbols.
7969
 
        if test "$allow_undefined" = yes; then
7970
 
          if test "$allow_undefined_flag" = unsupported; then
7971
 
            func_warning "undefined symbols not allowed in $host shared libraries"
7972
 
            build_libtool_libs=no
7973
 
            build_old_libs=yes
 
9537
        if test yes = "$allow_undefined"; then
 
9538
          if test unsupported = "$allow_undefined_flag"; then
 
9539
            if test yes = "$build_old_libs"; then
 
9540
              func_warning "undefined symbols not allowed in $host shared libraries; building static only"
 
9541
              build_libtool_libs=no
 
9542
            else
 
9543
              func_fatal_error "can't build $host shared library unless -no-undefined is specified"
 
9544
            fi
7974
9545
          fi
7975
9546
        else
7976
9547
          # Don't allow undefined symbols.
7977
 
          allow_undefined_flag="$no_undefined_flag"
 
9548
          allow_undefined_flag=$no_undefined_flag
7978
9549
        fi
7979
9550
 
7980
9551
      fi
7981
9552
 
7982
 
      func_generate_dlsyms "$libname" "$libname" "yes"
7983
 
      libobjs+=" $symfileobj"
7984
 
      test "X$libobjs" = "X " && libobjs=
 
9553
      func_generate_dlsyms "$libname" "$libname" :
 
9554
      func_append libobjs " $symfileobj"
 
9555
      test " " = "$libobjs" && libobjs=
7985
9556
 
7986
 
      if test "$opt_mode" != relink; then
 
9557
      if test relink != "$opt_mode"; then
7987
9558
        # Remove our outputs, but don't remove object files since they
7988
9559
        # may have been created when compiling PIC objects.
7989
9560
        removelist=
7992
9563
          case $p in
7993
9564
            *.$objext | *.gcno)
7994
9565
               ;;
7995
 
            $output_objdir/$outputname | $output_objdir/$libname.* | $output_objdir/${libname}${release}.*)
7996
 
               if test "X$precious_files_regex" != "X"; then
 
9566
            $output_objdir/$outputname | $output_objdir/$libname.* | $output_objdir/$libname$release.*)
 
9567
               if test -n "$precious_files_regex"; then
7997
9568
                 if $ECHO "$p" | $EGREP -e "$precious_files_regex" >/dev/null 2>&1
7998
9569
                 then
7999
9570
                   continue
8000
9571
                 fi
8001
9572
               fi
8002
 
               removelist+=" $p"
 
9573
               func_append removelist " $p"
8003
9574
               ;;
8004
9575
            *) ;;
8005
9576
          esac
8009
9580
      fi
8010
9581
 
8011
9582
      # Now set the variables for building old libraries.
8012
 
      if test "$build_old_libs" = yes && test "$build_libtool_libs" != convenience ; then
8013
 
        oldlibs+=" $output_objdir/$libname.$libext"
 
9583
      if test yes = "$build_old_libs" && test convenience != "$build_libtool_libs"; then
 
9584
        func_append oldlibs " $output_objdir/$libname.$libext"
8014
9585
 
8015
9586
        # Transform .lo files to .o files.
8016
 
        oldobjs="$objs "`$ECHO "$libobjs" | $SP2NL | $SED "/\.${libext}$/d; $lo2o" | $NL2SP`
 
9587
        oldobjs="$objs "`$ECHO "$libobjs" | $SP2NL | $SED "/\.$libext$/d; $lo2o" | $NL2SP`
8017
9588
      fi
8018
9589
 
8019
9590
      # Eliminate all temporary directories.
8028
9599
        temp_xrpath=
8029
9600
        for libdir in $xrpath; do
8030
9601
          func_replace_sysroot "$libdir"
8031
 
          temp_xrpath+=" -R$func_replace_sysroot_result"
 
9602
          func_append temp_xrpath " -R$func_replace_sysroot_result"
8032
9603
          case "$finalize_rpath " in
8033
9604
          *" $libdir "*) ;;
8034
 
          *) finalize_rpath+=" $libdir" ;;
 
9605
          *) func_append finalize_rpath " $libdir" ;;
8035
9606
          esac
8036
9607
        done
8037
 
        if test "$hardcode_into_libs" != yes || test "$build_old_libs" = yes; then
 
9608
        if test yes != "$hardcode_into_libs" || test yes = "$build_old_libs"; then
8038
9609
          dependency_libs="$temp_xrpath $dependency_libs"
8039
9610
        fi
8040
9611
      fi
8041
9612
 
8042
9613
      # Make sure dlfiles contains only unique files that won't be dlpreopened
8043
 
      old_dlfiles="$dlfiles"
 
9614
      old_dlfiles=$dlfiles
8044
9615
      dlfiles=
8045
9616
      for lib in $old_dlfiles; do
8046
9617
        case " $dlprefiles $dlfiles " in
8047
9618
        *" $lib "*) ;;
8048
 
        *) dlfiles+=" $lib" ;;
 
9619
        *) func_append dlfiles " $lib" ;;
8049
9620
        esac
8050
9621
      done
8051
9622
 
8052
9623
      # Make sure dlprefiles contains only unique files
8053
 
      old_dlprefiles="$dlprefiles"
 
9624
      old_dlprefiles=$dlprefiles
8054
9625
      dlprefiles=
8055
9626
      for lib in $old_dlprefiles; do
8056
9627
        case "$dlprefiles " in
8057
9628
        *" $lib "*) ;;
8058
 
        *) dlprefiles+=" $lib" ;;
 
9629
        *) func_append dlprefiles " $lib" ;;
8059
9630
        esac
8060
9631
      done
8061
9632
 
8062
 
      if test "$build_libtool_libs" = yes; then
 
9633
      if test yes = "$build_libtool_libs"; then
8063
9634
        if test -n "$rpath"; then
8064
9635
          case $host in
8065
9636
          *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-*-beos* | *-cegcc* | *-*-haiku*)
8067
9638
            ;;
8068
9639
          *-*-rhapsody* | *-*-darwin1.[012])
8069
9640
            # Rhapsody C library is in the System framework
8070
 
            deplibs+=" System.ltframework"
 
9641
            func_append deplibs " System.ltframework"
8071
9642
            ;;
8072
9643
          *-*-netbsd*)
8073
9644
            # Don't link with libc until the a.out ld.so is fixed.
8083
9654
            ;;
8084
9655
          *)
8085
9656
            # Add libc to deplibs on all other systems if necessary.
8086
 
            if test "$build_libtool_need_lc" = "yes"; then
8087
 
              deplibs+=" -lc"
 
9657
            if test yes = "$build_libtool_need_lc"; then
 
9658
              func_append deplibs " -lc"
8088
9659
            fi
8089
9660
            ;;
8090
9661
          esac
8099
9670
        # I'm not sure if I'm treating the release correctly.  I think
8100
9671
        # release should show up in the -l (ie -lgmp5) so we don't want to
8101
9672
        # add it in twice.  Is that correct?
8102
 
        release=""
8103
 
        versuffix=""
8104
 
        major=""
 
9673
        release=
 
9674
        versuffix=
 
9675
        major=
8105
9676
        newdeplibs=
8106
9677
        droppeddeps=no
8107
9678
        case $deplibs_check_method in
8130
9701
              -l*)
8131
9702
                func_stripname -l '' "$i"
8132
9703
                name=$func_stripname_result
8133
 
                if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
 
9704
                if test yes = "$allow_libtool_libs_with_static_runtimes"; then
8134
9705
                  case " $predeps $postdeps " in
8135
9706
                  *" $i "*)
8136
 
                    newdeplibs+=" $i"
8137
 
                    i=""
 
9707
                    func_append newdeplibs " $i"
 
9708
                    i=
8138
9709
                    ;;
8139
9710
                  esac
8140
9711
                fi
8141
 
                if test -n "$i" ; then
 
9712
                if test -n "$i"; then
8142
9713
                  libname=`eval "\\$ECHO \"$libname_spec\""`
8143
9714
                  deplib_matches=`eval "\\$ECHO \"$library_names_spec\""`
8144
9715
                  set dummy $deplib_matches; shift
8145
9716
                  deplib_match=$1
8146
 
                  if test `expr "$ldd_output" : ".*$deplib_match"` -ne 0 ; then
8147
 
                    newdeplibs+=" $i"
 
9717
                  if test `expr "$ldd_output" : ".*$deplib_match"` -ne 0; then
 
9718
                    func_append newdeplibs " $i"
8148
9719
                  else
8149
9720
                    droppeddeps=yes
8150
9721
                    echo
8158
9729
                fi
8159
9730
                ;;
8160
9731
              *)
8161
 
                newdeplibs+=" $i"
 
9732
                func_append newdeplibs " $i"
8162
9733
                ;;
8163
9734
              esac
8164
9735
            done
8173
9744
                $opt_dry_run || $RM conftest
8174
9745
                if $LTCC $LTCFLAGS -o conftest conftest.c $i; then
8175
9746
                  ldd_output=`ldd conftest`
8176
 
                  if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
 
9747
                  if test yes = "$allow_libtool_libs_with_static_runtimes"; then
8177
9748
                    case " $predeps $postdeps " in
8178
9749
                    *" $i "*)
8179
 
                      newdeplibs+=" $i"
8180
 
                      i=""
 
9750
                      func_append newdeplibs " $i"
 
9751
                      i=
8181
9752
                      ;;
8182
9753
                    esac
8183
9754
                  fi
8184
 
                  if test -n "$i" ; then
 
9755
                  if test -n "$i"; then
8185
9756
                    libname=`eval "\\$ECHO \"$libname_spec\""`
8186
9757
                    deplib_matches=`eval "\\$ECHO \"$library_names_spec\""`
8187
9758
                    set dummy $deplib_matches; shift
8188
9759
                    deplib_match=$1
8189
 
                    if test `expr "$ldd_output" : ".*$deplib_match"` -ne 0 ; then
8190
 
                      newdeplibs+=" $i"
 
9760
                    if test `expr "$ldd_output" : ".*$deplib_match"` -ne 0; then
 
9761
                      func_append newdeplibs " $i"
8191
9762
                    else
8192
9763
                      droppeddeps=yes
8193
9764
                      echo
8209
9780
                fi
8210
9781
                ;;
8211
9782
              *)
8212
 
                newdeplibs+=" $i"
 
9783
                func_append newdeplibs " $i"
8213
9784
                ;;
8214
9785
              esac
8215
9786
            done
8223
9794
            -l*)
8224
9795
              func_stripname -l '' "$a_deplib"
8225
9796
              name=$func_stripname_result
8226
 
              if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
 
9797
              if test yes = "$allow_libtool_libs_with_static_runtimes"; then
8227
9798
                case " $predeps $postdeps " in
8228
9799
                *" $a_deplib "*)
8229
 
                  newdeplibs+=" $a_deplib"
8230
 
                  a_deplib=""
 
9800
                  func_append newdeplibs " $a_deplib"
 
9801
                  a_deplib=
8231
9802
                  ;;
8232
9803
                esac
8233
9804
              fi
8234
 
              if test -n "$a_deplib" ; then
 
9805
              if test -n "$a_deplib"; then
8235
9806
                libname=`eval "\\$ECHO \"$libname_spec\""`
8236
9807
                if test -n "$file_magic_glob"; then
8237
9808
                  libnameglob=`func_echo_all "$libname" | $SED -e $file_magic_glob`
8238
9809
                else
8239
9810
                  libnameglob=$libname
8240
9811
                fi
8241
 
                test "$want_nocaseglob" = yes && nocaseglob=`shopt -p nocaseglob`
 
9812
                test yes = "$want_nocaseglob" && nocaseglob=`shopt -p nocaseglob`
8242
9813
                for i in $lib_search_path $sys_lib_search_path $shlib_search_path; do
8243
 
                  if test "$want_nocaseglob" = yes; then
 
9814
                  if test yes = "$want_nocaseglob"; then
8244
9815
                    shopt -s nocaseglob
8245
9816
                    potential_libs=`ls $i/$libnameglob[.-]* 2>/dev/null`
8246
9817
                    $nocaseglob
8258
9829
                      # We might still enter an endless loop, since a link
8259
9830
                      # loop can be closed while we follow links,
8260
9831
                      # but so what?
8261
 
                      potlib="$potent_lib"
 
9832
                      potlib=$potent_lib
8262
9833
                      while test -h "$potlib" 2>/dev/null; do
8263
 
                        potliblink=`ls -ld $potlib | ${SED} 's/.* -> //'`
 
9834
                        potliblink=`ls -ld $potlib | $SED 's/.* -> //'`
8264
9835
                        case $potliblink in
8265
 
                        [\\/]* | [A-Za-z]:[\\/]*) potlib="$potliblink";;
8266
 
                        *) potlib=`$ECHO "$potlib" | $SED 's,[^/]*$,,'`"$potliblink";;
 
9836
                        [\\/]* | [A-Za-z]:[\\/]*) potlib=$potliblink;;
 
9837
                        *) potlib=`$ECHO "$potlib" | $SED 's|[^/]*$||'`"$potliblink";;
8267
9838
                        esac
8268
9839
                      done
8269
9840
                      if eval $file_magic_cmd \"\$potlib\" 2>/dev/null |
8270
9841
                         $SED -e 10q |
8271
9842
                         $EGREP "$file_magic_regex" > /dev/null; then
8272
 
                        newdeplibs+=" $a_deplib"
8273
 
                        a_deplib=""
 
9843
                        func_append newdeplibs " $a_deplib"
 
9844
                        a_deplib=
8274
9845
                        break 2
8275
9846
                      fi
8276
9847
                  done
8277
9848
                done
8278
9849
              fi
8279
 
              if test -n "$a_deplib" ; then
 
9850
              if test -n "$a_deplib"; then
8280
9851
                droppeddeps=yes
8281
9852
                echo
8282
9853
                $ECHO "*** Warning: linker path does not have real file for library $a_deplib."
8284
9855
                echo "*** you link to this library.  But I can only do this if you have a"
8285
9856
                echo "*** shared version of the library, which you do not appear to have"
8286
9857
                echo "*** because I did check the linker path looking for a file starting"
8287
 
                if test -z "$potlib" ; then
 
9858
                if test -z "$potlib"; then
8288
9859
                  $ECHO "*** with $libname but no candidates were found. (...for file magic test)"
8289
9860
                else
8290
9861
                  $ECHO "*** with $libname and none of the candidates passed a file format test"
8294
9865
              ;;
8295
9866
            *)
8296
9867
              # Add a -L argument.
8297
 
              newdeplibs+=" $a_deplib"
 
9868
              func_append newdeplibs " $a_deplib"
8298
9869
              ;;
8299
9870
            esac
8300
9871
          done # Gone through all deplibs.
8307
9878
            -l*)
8308
9879
              func_stripname -l '' "$a_deplib"
8309
9880
              name=$func_stripname_result
8310
 
              if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
 
9881
              if test yes = "$allow_libtool_libs_with_static_runtimes"; then
8311
9882
                case " $predeps $postdeps " in
8312
9883
                *" $a_deplib "*)
8313
 
                  newdeplibs+=" $a_deplib"
8314
 
                  a_deplib=""
 
9884
                  func_append newdeplibs " $a_deplib"
 
9885
                  a_deplib=
8315
9886
                  ;;
8316
9887
                esac
8317
9888
              fi
8318
 
              if test -n "$a_deplib" ; then
 
9889
              if test -n "$a_deplib"; then
8319
9890
                libname=`eval "\\$ECHO \"$libname_spec\""`
8320
9891
                for i in $lib_search_path $sys_lib_search_path $shlib_search_path; do
8321
9892
                  potential_libs=`ls $i/$libname[.-]* 2>/dev/null`
8322
9893
                  for potent_lib in $potential_libs; do
8323
 
                    potlib="$potent_lib" # see symlink-check above in file_magic test
 
9894
                    potlib=$potent_lib # see symlink-check above in file_magic test
8324
9895
                    if eval "\$ECHO \"$potent_lib\"" 2>/dev/null | $SED 10q | \
8325
9896
                       $EGREP "$match_pattern_regex" > /dev/null; then
8326
 
                      newdeplibs+=" $a_deplib"
8327
 
                      a_deplib=""
 
9897
                      func_append newdeplibs " $a_deplib"
 
9898
                      a_deplib=
8328
9899
                      break 2
8329
9900
                    fi
8330
9901
                  done
8331
9902
                done
8332
9903
              fi
8333
 
              if test -n "$a_deplib" ; then
 
9904
              if test -n "$a_deplib"; then
8334
9905
                droppeddeps=yes
8335
9906
                echo
8336
9907
                $ECHO "*** Warning: linker path does not have real file for library $a_deplib."
8338
9909
                echo "*** you link to this library.  But I can only do this if you have a"
8339
9910
                echo "*** shared version of the library, which you do not appear to have"
8340
9911
                echo "*** because I did check the linker path looking for a file starting"
8341
 
                if test -z "$potlib" ; then
 
9912
                if test -z "$potlib"; then
8342
9913
                  $ECHO "*** with $libname but no candidates were found. (...for regex pattern test)"
8343
9914
                else
8344
9915
                  $ECHO "*** with $libname and none of the candidates passed a file format test"
8348
9919
              ;;
8349
9920
            *)
8350
9921
              # Add a -L argument.
8351
 
              newdeplibs+=" $a_deplib"
 
9922
              func_append newdeplibs " $a_deplib"
8352
9923
              ;;
8353
9924
            esac
8354
9925
          done # Gone through all deplibs.
8355
9926
          ;;
8356
9927
        none | unknown | *)
8357
 
          newdeplibs=""
 
9928
          newdeplibs=
8358
9929
          tmp_deplibs=`$ECHO " $deplibs" | $SED 's/ -lc$//; s/ -[LR][^ ]*//g'`
8359
 
          if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
8360
 
            for i in $predeps $postdeps ; do
 
9930
          if test yes = "$allow_libtool_libs_with_static_runtimes"; then
 
9931
            for i in $predeps $postdeps; do
8361
9932
              # can't use Xsed below, because $i might contain '/'
8362
 
              tmp_deplibs=`$ECHO " $tmp_deplibs" | $SED "s,$i,,"`
 
9933
              tmp_deplibs=`$ECHO " $tmp_deplibs" | $SED "s|$i||"`
8363
9934
            done
8364
9935
          fi
8365
9936
          case $tmp_deplibs in
8366
9937
          *[!\  \ ]*)
8367
9938
            echo
8368
 
            if test "X$deplibs_check_method" = "Xnone"; then
 
9939
            if test none = "$deplibs_check_method"; then
8369
9940
              echo "*** Warning: inter-library dependencies are not supported in this platform."
8370
9941
            else
8371
9942
              echo "*** Warning: inter-library dependencies are not known to be supported."
8389
9960
          ;;
8390
9961
        esac
8391
9962
 
8392
 
        if test "$droppeddeps" = yes; then
8393
 
          if test "$module" = yes; then
 
9963
        if test yes = "$droppeddeps"; then
 
9964
          if test yes = "$module"; then
8394
9965
            echo
8395
9966
            echo "*** Warning: libtool could not satisfy all declared inter-library"
8396
9967
            $ECHO "*** dependencies of module $libname.  Therefore, libtool will create"
8399
9970
            if test -z "$global_symbol_pipe"; then
8400
9971
              echo
8401
9972
              echo "*** However, this would only work if libtool was able to extract symbol"
8402
 
              echo "*** lists from a program, using \`nm' or equivalent, but libtool could"
 
9973
              echo "*** lists from a program, using 'nm' or equivalent, but libtool could"
8403
9974
              echo "*** not find such a program.  So, this module is probably useless."
8404
 
              echo "*** \`nm' from GNU binutils and a full rebuild may help."
 
9975
              echo "*** 'nm' from GNU binutils and a full rebuild may help."
8405
9976
            fi
8406
 
            if test "$build_old_libs" = no; then
8407
 
              oldlibs="$output_objdir/$libname.$libext"
 
9977
            if test no = "$build_old_libs"; then
 
9978
              oldlibs=$output_objdir/$libname.$libext
8408
9979
              build_libtool_libs=module
8409
9980
              build_old_libs=yes
8410
9981
            else
8415
9986
            echo "*** automatically added whenever a program is linked with this library"
8416
9987
            echo "*** or is declared to -dlopen it."
8417
9988
 
8418
 
            if test "$allow_undefined" = no; then
 
9989
            if test no = "$allow_undefined"; then
8419
9990
              echo
8420
9991
              echo "*** Since this library must not contain undefined symbols,"
8421
9992
              echo "*** because either the platform does not support them or"
8422
9993
              echo "*** it was explicitly requested with -no-undefined,"
8423
9994
              echo "*** libtool will only create a static version of it."
8424
 
              if test "$build_old_libs" = no; then
8425
 
                oldlibs="$output_objdir/$libname.$libext"
 
9995
              if test no = "$build_old_libs"; then
 
9996
                oldlibs=$output_objdir/$libname.$libext
8426
9997
                build_libtool_libs=module
8427
9998
                build_old_libs=yes
8428
9999
              else
8452
10023
        *)
8453
10024
          case " $deplibs " in
8454
10025
          *" -L$path/$objdir "*)
8455
 
            new_libs+=" -L$path/$objdir" ;;
 
10026
            func_append new_libs " -L$path/$objdir" ;;
8456
10027
          esac
8457
10028
          ;;
8458
10029
        esac
8462
10033
        -L*)
8463
10034
          case " $new_libs " in
8464
10035
          *" $deplib "*) ;;
8465
 
          *) new_libs+=" $deplib" ;;
 
10036
          *) func_append new_libs " $deplib" ;;
8466
10037
          esac
8467
10038
          ;;
8468
 
        *) new_libs+=" $deplib" ;;
 
10039
        *) func_append new_libs " $deplib" ;;
8469
10040
        esac
8470
10041
      done
8471
 
      deplibs="$new_libs"
 
10042
      deplibs=$new_libs
8472
10043
 
8473
10044
      # All the library-specific variables (install_libdir is set above).
8474
10045
      library_names=
8476
10047
      dlname=
8477
10048
 
8478
10049
      # Test again, we may have decided not to build it any more
8479
 
      if test "$build_libtool_libs" = yes; then
8480
 
        # Remove ${wl} instances when linking with ld.
 
10050
      if test yes = "$build_libtool_libs"; then
 
10051
        # Remove $wl instances when linking with ld.
8481
10052
        # FIXME: should test the right _cmds variable.
8482
10053
        case $archive_cmds in
8483
10054
          *\$LD\ *) wl= ;;
8484
10055
        esac
8485
 
        if test "$hardcode_into_libs" = yes; then
 
10056
        if test yes = "$hardcode_into_libs"; then
8486
10057
          # Hardcode the library paths
8487
10058
          hardcode_libdirs=
8488
10059
          dep_rpath=
8489
 
          rpath="$finalize_rpath"
8490
 
          test "$opt_mode" != relink && rpath="$compile_rpath$rpath"
 
10060
          rpath=$finalize_rpath
 
10061
          test relink = "$opt_mode" || rpath=$compile_rpath$rpath
8491
10062
          for libdir in $rpath; do
8492
10063
            if test -n "$hardcode_libdir_flag_spec"; then
8493
10064
              if test -n "$hardcode_libdir_separator"; then
8494
10065
                func_replace_sysroot "$libdir"
8495
10066
                libdir=$func_replace_sysroot_result
8496
10067
                if test -z "$hardcode_libdirs"; then
8497
 
                  hardcode_libdirs="$libdir"
 
10068
                  hardcode_libdirs=$libdir
8498
10069
                else
8499
10070
                  # Just accumulate the unique libdirs.
8500
10071
                  case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in
8501
10072
                  *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*)
8502
10073
                    ;;
8503
10074
                  *)
8504
 
                    hardcode_libdirs+="$hardcode_libdir_separator$libdir"
 
10075
                    func_append hardcode_libdirs "$hardcode_libdir_separator$libdir"
8505
10076
                    ;;
8506
10077
                  esac
8507
10078
                fi
8508
10079
              else
8509
10080
                eval flag=\"$hardcode_libdir_flag_spec\"
8510
 
                dep_rpath+=" $flag"
 
10081
                func_append dep_rpath " $flag"
8511
10082
              fi
8512
10083
            elif test -n "$runpath_var"; then
8513
10084
              case "$perm_rpath " in
8514
10085
              *" $libdir "*) ;;
8515
 
              *) perm_rpath+=" $libdir" ;;
 
10086
              *) func_append perm_rpath " $libdir" ;;
8516
10087
              esac
8517
10088
            fi
8518
10089
          done
8519
10090
          # Substitute the hardcoded libdirs into the rpath.
8520
10091
          if test -n "$hardcode_libdir_separator" &&
8521
10092
             test -n "$hardcode_libdirs"; then
8522
 
            libdir="$hardcode_libdirs"
 
10093
            libdir=$hardcode_libdirs
8523
10094
            eval "dep_rpath=\"$hardcode_libdir_flag_spec\""
8524
10095
          fi
8525
10096
          if test -n "$runpath_var" && test -n "$perm_rpath"; then
8526
10097
            # We should set the runpath_var.
8527
10098
            rpath=
8528
10099
            for dir in $perm_rpath; do
8529
 
              rpath+="$dir:"
 
10100
              func_append rpath "$dir:"
8530
10101
            done
8531
10102
            eval "$runpath_var='$rpath\$$runpath_var'; export $runpath_var"
8532
10103
          fi
8533
10104
          test -n "$dep_rpath" && deplibs="$dep_rpath $deplibs"
8534
10105
        fi
8535
10106
 
8536
 
        shlibpath="$finalize_shlibpath"
8537
 
        test "$opt_mode" != relink && shlibpath="$compile_shlibpath$shlibpath"
 
10107
        shlibpath=$finalize_shlibpath
 
10108
        test relink = "$opt_mode" || shlibpath=$compile_shlibpath$shlibpath
8538
10109
        if test -n "$shlibpath"; then
8539
10110
          eval "$shlibpath_var='$shlibpath\$$shlibpath_var'; export $shlibpath_var"
8540
10111
        fi
8544
10115
        eval library_names=\"$library_names_spec\"
8545
10116
        set dummy $library_names
8546
10117
        shift
8547
 
        realname="$1"
 
10118
        realname=$1
8548
10119
        shift
8549
10120
 
8550
10121
        if test -n "$soname_spec"; then
8551
10122
          eval soname=\"$soname_spec\"
8552
10123
        else
8553
 
          soname="$realname"
 
10124
          soname=$realname
8554
10125
        fi
8555
10126
        if test -z "$dlname"; then
8556
10127
          dlname=$soname
8557
10128
        fi
8558
10129
 
8559
 
        lib="$output_objdir/$realname"
 
10130
        lib=$output_objdir/$realname
8560
10131
        linknames=
8561
10132
        for link
8562
10133
        do
8563
 
          linknames+=" $link"
 
10134
          func_append linknames " $link"
8564
10135
        done
8565
10136
 
8566
10137
        # Use standard objects if they are pic
8570
10141
        delfiles=
8571
10142
        if test -n "$export_symbols" && test -n "$include_expsyms"; then
8572
10143
          $opt_dry_run || cp "$export_symbols" "$output_objdir/$libname.uexp"
8573
 
          export_symbols="$output_objdir/$libname.uexp"
8574
 
          delfiles+=" $export_symbols"
 
10144
          export_symbols=$output_objdir/$libname.uexp
 
10145
          func_append delfiles " $export_symbols"
8575
10146
        fi
8576
10147
 
8577
10148
        orig_export_symbols=
8579
10150
        cygwin* | mingw* | cegcc*)
8580
10151
          if test -n "$export_symbols" && test -z "$export_symbols_regex"; then
8581
10152
            # exporting using user supplied symfile
8582
 
            if test "x`$SED 1q $export_symbols`" != xEXPORTS; then
 
10153
            func_dll_def_p "$export_symbols" || {
8583
10154
              # and it's NOT already a .def file. Must figure out
8584
10155
              # which of the given symbols are data symbols and tag
8585
10156
              # them as such. So, trigger use of export_symbols_cmds.
8586
10157
              # export_symbols gets reassigned inside the "prepare
8587
10158
              # the list of exported symbols" if statement, so the
8588
10159
              # include_expsyms logic still works.
8589
 
              orig_export_symbols="$export_symbols"
 
10160
              orig_export_symbols=$export_symbols
8590
10161
              export_symbols=
8591
10162
              always_export_symbols=yes
8592
 
            fi
 
10163
            }
8593
10164
          fi
8594
10165
          ;;
8595
10166
        esac
8596
10167
 
8597
10168
        # Prepare the list of exported symbols
8598
10169
        if test -z "$export_symbols"; then
8599
 
          if test "$always_export_symbols" = yes || test -n "$export_symbols_regex"; then
8600
 
            func_verbose "generating symbol list for \`$libname.la'"
8601
 
            export_symbols="$output_objdir/$libname.exp"
 
10170
          if test yes = "$always_export_symbols" || test -n "$export_symbols_regex"; then
 
10171
            func_verbose "generating symbol list for '$libname.la'"
 
10172
            export_symbols=$output_objdir/$libname.exp
8602
10173
            $opt_dry_run || $RM $export_symbols
8603
10174
            cmds=$export_symbols_cmds
8604
 
            save_ifs="$IFS"; IFS='~'
 
10175
            save_ifs=$IFS; IFS='~'
8605
10176
            for cmd1 in $cmds; do
8606
 
              IFS="$save_ifs"
 
10177
              IFS=$save_ifs
8607
10178
              # Take the normal branch if the nm_file_list_spec branch
8608
10179
              # doesn't work or if tool conversion is not needed.
8609
10180
              case $nm_file_list_spec~$to_tool_file_cmd in
8617
10188
                  try_normal_branch=no
8618
10189
                  ;;
8619
10190
              esac
8620
 
              if test "$try_normal_branch" = yes \
 
10191
              if test yes = "$try_normal_branch" \
8621
10192
                 && { test "$len" -lt "$max_cmd_len" \
8622
10193
                      || test "$max_cmd_len" -le -1; }
8623
10194
              then
8628
10199
                output_la=$func_basename_result
8629
10200
                save_libobjs=$libobjs
8630
10201
                save_output=$output
8631
 
                output=${output_objdir}/${output_la}.nm
 
10202
                output=$output_objdir/$output_la.nm
8632
10203
                func_to_tool_file "$output"
8633
10204
                libobjs=$nm_file_list_spec$func_to_tool_file_result
8634
 
                delfiles+=" $output"
 
10205
                func_append delfiles " $output"
8635
10206
                func_verbose "creating $NM input file list: $output"
8636
10207
                for obj in $save_libobjs; do
8637
10208
                  func_to_tool_file "$obj"
8651
10222
                break
8652
10223
              fi
8653
10224
            done
8654
 
            IFS="$save_ifs"
8655
 
            if test -n "$export_symbols_regex" && test "X$skipped_export" != "X:"; then
 
10225
            IFS=$save_ifs
 
10226
            if test -n "$export_symbols_regex" && test : != "$skipped_export"; then
8656
10227
              func_show_eval '$EGREP -e "$export_symbols_regex" "$export_symbols" > "${export_symbols}T"'
8657
10228
              func_show_eval '$MV "${export_symbols}T" "$export_symbols"'
8658
10229
            fi
8660
10231
        fi
8661
10232
 
8662
10233
        if test -n "$export_symbols" && test -n "$include_expsyms"; then
8663
 
          tmp_export_symbols="$export_symbols"
8664
 
          test -n "$orig_export_symbols" && tmp_export_symbols="$orig_export_symbols"
 
10234
          tmp_export_symbols=$export_symbols
 
10235
          test -n "$orig_export_symbols" && tmp_export_symbols=$orig_export_symbols
8665
10236
          $opt_dry_run || eval '$ECHO "$include_expsyms" | $SP2NL >> "$tmp_export_symbols"'
8666
10237
        fi
8667
10238
 
8668
 
        if test "X$skipped_export" != "X:" && test -n "$orig_export_symbols"; then
 
10239
        if test : != "$skipped_export" && test -n "$orig_export_symbols"; then
8669
10240
          # The given exports_symbols file has to be filtered, so filter it.
8670
 
          func_verbose "filter symbol list for \`$libname.la' to tag DATA exports"
 
10241
          func_verbose "filter symbol list for '$libname.la' to tag DATA exports"
8671
10242
          # FIXME: $output_objdir/$libname.filter potentially contains lots of
8672
 
          # 's' commands which not all seds can handle. GNU sed should be fine
 
10243
          # 's' commands, which not all seds can handle. GNU sed should be fine
8673
10244
          # though. Also, the filter scales superlinearly with the number of
8674
10245
          # global variables. join(1) would be nice here, but unfortunately
8675
10246
          # isn't a blessed tool.
8676
10247
          $opt_dry_run || $SED -e '/[ ,]DATA/!d;s,\(.*\)\([ \,].*\),s|^\1$|\1\2|,' < $export_symbols > $output_objdir/$libname.filter
8677
 
          delfiles+=" $export_symbols $output_objdir/$libname.filter"
 
10248
          func_append delfiles " $export_symbols $output_objdir/$libname.filter"
8678
10249
          export_symbols=$output_objdir/$libname.def
8679
10250
          $opt_dry_run || $SED -f $output_objdir/$libname.filter < $orig_export_symbols > $export_symbols
8680
10251
        fi
8684
10255
          case " $convenience " in
8685
10256
          *" $test_deplib "*) ;;
8686
10257
          *)
8687
 
            tmp_deplibs+=" $test_deplib"
 
10258
            func_append tmp_deplibs " $test_deplib"
8688
10259
            ;;
8689
10260
          esac
8690
10261
        done
8691
 
        deplibs="$tmp_deplibs"
 
10262
        deplibs=$tmp_deplibs
8692
10263
 
8693
10264
        if test -n "$convenience"; then
8694
10265
          if test -n "$whole_archive_flag_spec" &&
8695
 
            test "$compiler_needs_object" = yes &&
 
10266
            test yes = "$compiler_needs_object" &&
8696
10267
            test -z "$libobjs"; then
8697
10268
            # extract the archives, so we have objects to list.
8698
10269
            # TODO: could optimize this to just extract one archive.
8703
10274
            eval libobjs=\"\$libobjs $whole_archive_flag_spec\"
8704
10275
            test "X$libobjs" = "X " && libobjs=
8705
10276
          else
8706
 
            gentop="$output_objdir/${outputname}x"
8707
 
            generated+=" $gentop"
 
10277
            gentop=$output_objdir/${outputname}x
 
10278
            func_append generated " $gentop"
8708
10279
 
8709
10280
            func_extract_archives $gentop $convenience
8710
 
            libobjs+=" $func_extract_archives_result"
 
10281
            func_append libobjs " $func_extract_archives_result"
8711
10282
            test "X$libobjs" = "X " && libobjs=
8712
10283
          fi
8713
10284
        fi
8714
10285
 
8715
 
        if test "$thread_safe" = yes && test -n "$thread_safe_flag_spec"; then
 
10286
        if test yes = "$thread_safe" && test -n "$thread_safe_flag_spec"; then
8716
10287
          eval flag=\"$thread_safe_flag_spec\"
8717
 
          linker_flags+=" $flag"
 
10288
          func_append linker_flags " $flag"
8718
10289
        fi
8719
10290
 
8720
10291
        # Make a backup of the uninstalled library when relinking
8721
 
        if test "$opt_mode" = relink; then
 
10292
        if test relink = "$opt_mode"; then
8722
10293
          $opt_dry_run || eval '(cd $output_objdir && $RM ${realname}U && $MV $realname ${realname}U)' || exit $?
8723
10294
        fi
8724
10295
 
8725
10296
        # Do each of the archive commands.
8726
 
        if test "$module" = yes && test -n "$module_cmds" ; then
 
10297
        if test yes = "$module" && test -n "$module_cmds"; then
8727
10298
          if test -n "$export_symbols" && test -n "$module_expsym_cmds"; then
8728
10299
            eval test_cmds=\"$module_expsym_cmds\"
8729
10300
            cmds=$module_expsym_cmds
8741
10312
          fi
8742
10313
        fi
8743
10314
 
8744
 
        if test "X$skipped_export" != "X:" &&
 
10315
        if test : != "$skipped_export" &&
8745
10316
           func_len " $test_cmds" &&
8746
10317
           len=$func_len_result &&
8747
10318
           test "$len" -lt "$max_cmd_len" || test "$max_cmd_len" -le -1; then
8774
10345
          last_robj=
8775
10346
          k=1
8776
10347
 
8777
 
          if test -n "$save_libobjs" && test "X$skipped_export" != "X:" && test "$with_gnu_ld" = yes; then
8778
 
            output=${output_objdir}/${output_la}.lnkscript
 
10348
          if test -n "$save_libobjs" && test : != "$skipped_export" && test yes = "$with_gnu_ld"; then
 
10349
            output=$output_objdir/$output_la.lnkscript
8779
10350
            func_verbose "creating GNU ld script: $output"
8780
10351
            echo 'INPUT (' > $output
8781
10352
            for obj in $save_libobjs
8784
10355
              $ECHO "$func_to_tool_file_result" >> $output
8785
10356
            done
8786
10357
            echo ')' >> $output
8787
 
            delfiles+=" $output"
 
10358
            func_append delfiles " $output"
8788
10359
            func_to_tool_file "$output"
8789
10360
            output=$func_to_tool_file_result
8790
 
          elif test -n "$save_libobjs" && test "X$skipped_export" != "X:" && test "X$file_list_spec" != X; then
8791
 
            output=${output_objdir}/${output_la}.lnk
 
10361
          elif test -n "$save_libobjs" && test : != "$skipped_export" && test -n "$file_list_spec"; then
 
10362
            output=$output_objdir/$output_la.lnk
8792
10363
            func_verbose "creating linker input file list: $output"
8793
10364
            : > $output
8794
10365
            set x $save_libobjs
8795
10366
            shift
8796
10367
            firstobj=
8797
 
            if test "$compiler_needs_object" = yes; then
 
10368
            if test yes = "$compiler_needs_object"; then
8798
10369
              firstobj="$1 "
8799
10370
              shift
8800
10371
            fi
8803
10374
              func_to_tool_file "$obj"
8804
10375
              $ECHO "$func_to_tool_file_result" >> $output
8805
10376
            done
8806
 
            delfiles+=" $output"
 
10377
            func_append delfiles " $output"
8807
10378
            func_to_tool_file "$output"
8808
10379
            output=$firstobj\"$file_list_spec$func_to_tool_file_result\"
8809
10380
          else
8810
10381
            if test -n "$save_libobjs"; then
8811
10382
              func_verbose "creating reloadable object files..."
8812
 
              output=$output_objdir/$output_la-${k}.$objext
 
10383
              output=$output_objdir/$output_la-$k.$objext
8813
10384
              eval test_cmds=\"$reload_cmds\"
8814
10385
              func_len " $test_cmds"
8815
10386
              len0=$func_len_result
8821
10392
                func_len " $obj"
8822
10393
                func_arith $len + $func_len_result
8823
10394
                len=$func_arith_result
8824
 
                if test "X$objlist" = X ||
 
10395
                if test -z "$objlist" ||
8825
10396
                   test "$len" -lt "$max_cmd_len"; then
8826
 
                  objlist+=" $obj"
 
10397
                  func_append objlist " $obj"
8827
10398
                else
8828
10399
                  # The command $test_cmds is almost too long, add a
8829
10400
                  # command to the queue.
8830
 
                  if test "$k" -eq 1 ; then
 
10401
                  if test 1 -eq "$k"; then
8831
10402
                    # The first file doesn't have a previous command to add.
8832
10403
                    reload_objs=$objlist
8833
10404
                    eval concat_cmds=\"$reload_cmds\"
8837
10408
                    reload_objs="$objlist $last_robj"
8838
10409
                    eval concat_cmds=\"\$concat_cmds~$reload_cmds~\$RM $last_robj\"
8839
10410
                  fi
8840
 
                  last_robj=$output_objdir/$output_la-${k}.$objext
 
10411
                  last_robj=$output_objdir/$output_la-$k.$objext
8841
10412
                  func_arith $k + 1
8842
10413
                  k=$func_arith_result
8843
 
                  output=$output_objdir/$output_la-${k}.$objext
 
10414
                  output=$output_objdir/$output_la-$k.$objext
8844
10415
                  objlist=" $obj"
8845
10416
                  func_len " $last_robj"
8846
10417
                  func_arith $len0 + $func_len_result
8852
10423
              # files will link in the last one created.
8853
10424
              test -z "$concat_cmds" || concat_cmds=$concat_cmds~
8854
10425
              reload_objs="$objlist $last_robj"
8855
 
              eval concat_cmds=\"\${concat_cmds}$reload_cmds\"
 
10426
              eval concat_cmds=\"\$concat_cmds$reload_cmds\"
8856
10427
              if test -n "$last_robj"; then
8857
 
                eval concat_cmds=\"\${concat_cmds}~\$RM $last_robj\"
 
10428
                eval concat_cmds=\"\$concat_cmds~\$RM $last_robj\"
8858
10429
              fi
8859
 
              delfiles+=" $output"
 
10430
              func_append delfiles " $output"
8860
10431
 
8861
10432
            else
8862
10433
              output=
8863
10434
            fi
8864
10435
 
8865
 
            if ${skipped_export-false}; then
8866
 
              func_verbose "generating symbol list for \`$libname.la'"
8867
 
              export_symbols="$output_objdir/$libname.exp"
 
10436
            ${skipped_export-false} && {
 
10437
              func_verbose "generating symbol list for '$libname.la'"
 
10438
              export_symbols=$output_objdir/$libname.exp
8868
10439
              $opt_dry_run || $RM $export_symbols
8869
10440
              libobjs=$output
8870
10441
              # Append the command to create the export file.
8873
10444
              if test -n "$last_robj"; then
8874
10445
                eval concat_cmds=\"\$concat_cmds~\$RM $last_robj\"
8875
10446
              fi
8876
 
            fi
 
10447
            }
8877
10448
 
8878
10449
            test -n "$save_libobjs" &&
8879
10450
              func_verbose "creating a temporary reloadable object file: $output"
8880
10451
 
8881
10452
            # Loop through the commands generated above and execute them.
8882
 
            save_ifs="$IFS"; IFS='~'
 
10453
            save_ifs=$IFS; IFS='~'
8883
10454
            for cmd in $concat_cmds; do
8884
 
              IFS="$save_ifs"
8885
 
              $opt_silent || {
 
10455
              IFS=$save_ifs
 
10456
              $opt_quiet || {
8886
10457
                  func_quote_for_expand "$cmd"
8887
10458
                  eval "func_echo $func_quote_for_expand_result"
8888
10459
              }
8890
10461
                lt_exit=$?
8891
10462
 
8892
10463
                # Restore the uninstalled library and exit
8893
 
                if test "$opt_mode" = relink; then
 
10464
                if test relink = "$opt_mode"; then
8894
10465
                  ( cd "$output_objdir" && \
8895
10466
                    $RM "${realname}T" && \
8896
10467
                    $MV "${realname}U" "$realname" )
8899
10470
                exit $lt_exit
8900
10471
              }
8901
10472
            done
8902
 
            IFS="$save_ifs"
 
10473
            IFS=$save_ifs
8903
10474
 
8904
10475
            if test -n "$export_symbols_regex" && ${skipped_export-false}; then
8905
10476
              func_show_eval '$EGREP -e "$export_symbols_regex" "$export_symbols" > "${export_symbols}T"'
8907
10478
            fi
8908
10479
          fi
8909
10480
 
8910
 
          if ${skipped_export-false}; then
 
10481
          ${skipped_export-false} && {
8911
10482
            if test -n "$export_symbols" && test -n "$include_expsyms"; then
8912
 
              tmp_export_symbols="$export_symbols"
8913
 
              test -n "$orig_export_symbols" && tmp_export_symbols="$orig_export_symbols"
 
10483
              tmp_export_symbols=$export_symbols
 
10484
              test -n "$orig_export_symbols" && tmp_export_symbols=$orig_export_symbols
8914
10485
              $opt_dry_run || eval '$ECHO "$include_expsyms" | $SP2NL >> "$tmp_export_symbols"'
8915
10486
            fi
8916
10487
 
8917
10488
            if test -n "$orig_export_symbols"; then
8918
10489
              # The given exports_symbols file has to be filtered, so filter it.
8919
 
              func_verbose "filter symbol list for \`$libname.la' to tag DATA exports"
 
10490
              func_verbose "filter symbol list for '$libname.la' to tag DATA exports"
8920
10491
              # FIXME: $output_objdir/$libname.filter potentially contains lots of
8921
 
              # 's' commands which not all seds can handle. GNU sed should be fine
 
10492
              # 's' commands, which not all seds can handle. GNU sed should be fine
8922
10493
              # though. Also, the filter scales superlinearly with the number of
8923
10494
              # global variables. join(1) would be nice here, but unfortunately
8924
10495
              # isn't a blessed tool.
8925
10496
              $opt_dry_run || $SED -e '/[ ,]DATA/!d;s,\(.*\)\([ \,].*\),s|^\1$|\1\2|,' < $export_symbols > $output_objdir/$libname.filter
8926
 
              delfiles+=" $export_symbols $output_objdir/$libname.filter"
 
10497
              func_append delfiles " $export_symbols $output_objdir/$libname.filter"
8927
10498
              export_symbols=$output_objdir/$libname.def
8928
10499
              $opt_dry_run || $SED -f $output_objdir/$libname.filter < $orig_export_symbols > $export_symbols
8929
10500
            fi
8930
 
          fi
 
10501
          }
8931
10502
 
8932
10503
          libobjs=$output
8933
10504
          # Restore the value of output.
8941
10512
          # value of $libobjs for piecewise linking.
8942
10513
 
8943
10514
          # Do each of the archive commands.
8944
 
          if test "$module" = yes && test -n "$module_cmds" ; then
 
10515
          if test yes = "$module" && test -n "$module_cmds"; then
8945
10516
            if test -n "$export_symbols" && test -n "$module_expsym_cmds"; then
8946
10517
              cmds=$module_expsym_cmds
8947
10518
            else
8963
10534
 
8964
10535
        # Add any objects from preloaded convenience libraries
8965
10536
        if test -n "$dlprefiles"; then
8966
 
          gentop="$output_objdir/${outputname}x"
8967
 
          generated+=" $gentop"
 
10537
          gentop=$output_objdir/${outputname}x
 
10538
          func_append generated " $gentop"
8968
10539
 
8969
10540
          func_extract_archives $gentop $dlprefiles
8970
 
          libobjs+=" $func_extract_archives_result"
 
10541
          func_append libobjs " $func_extract_archives_result"
8971
10542
          test "X$libobjs" = "X " && libobjs=
8972
10543
        fi
8973
10544
 
8974
 
        save_ifs="$IFS"; IFS='~'
 
10545
        save_ifs=$IFS; IFS='~'
8975
10546
        for cmd in $cmds; do
8976
 
          IFS="$save_ifs"
 
10547
          IFS=$sp$nl
8977
10548
          eval cmd=\"$cmd\"
8978
 
          $opt_silent || {
 
10549
          IFS=$save_ifs
 
10550
          $opt_quiet || {
8979
10551
            func_quote_for_expand "$cmd"
8980
10552
            eval "func_echo $func_quote_for_expand_result"
8981
10553
          }
8983
10555
            lt_exit=$?
8984
10556
 
8985
10557
            # Restore the uninstalled library and exit
8986
 
            if test "$opt_mode" = relink; then
 
10558
            if test relink = "$opt_mode"; then
8987
10559
              ( cd "$output_objdir" && \
8988
10560
                $RM "${realname}T" && \
8989
10561
                $MV "${realname}U" "$realname" )
8992
10564
            exit $lt_exit
8993
10565
          }
8994
10566
        done
8995
 
        IFS="$save_ifs"
 
10567
        IFS=$save_ifs
8996
10568
 
8997
10569
        # Restore the uninstalled library and exit
8998
 
        if test "$opt_mode" = relink; then
 
10570
        if test relink = "$opt_mode"; then
8999
10571
          $opt_dry_run || eval '(cd $output_objdir && $RM ${realname}T && $MV $realname ${realname}T && $MV ${realname}U $realname)' || exit $?
9000
10572
 
9001
10573
          if test -n "$convenience"; then
9015
10587
        done
9016
10588
 
9017
10589
        # If -module or -export-dynamic was specified, set the dlname.
9018
 
        if test "$module" = yes || test "$export_dynamic" = yes; then
 
10590
        if test yes = "$module" || test yes = "$export_dynamic"; then
9019
10591
          # On all known operating systems, these are identical.
9020
 
          dlname="$soname"
 
10592
          dlname=$soname
9021
10593
        fi
9022
10594
      fi
9023
10595
      ;;
9024
10596
 
9025
10597
    obj)
9026
 
      if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then
9027
 
        func_warning "\`-dlopen' is ignored for objects"
 
10598
      if test -n "$dlfiles$dlprefiles" || test no != "$dlself"; then
 
10599
        func_warning "'-dlopen' is ignored for objects"
9028
10600
      fi
9029
10601
 
9030
10602
      case " $deplibs" in
9031
10603
      *\ -l* | *\ -L*)
9032
 
        func_warning "\`-l' and \`-L' are ignored for objects" ;;
 
10604
        func_warning "'-l' and '-L' are ignored for objects" ;;
9033
10605
      esac
9034
10606
 
9035
10607
      test -n "$rpath" && \
9036
 
        func_warning "\`-rpath' is ignored for objects"
 
10608
        func_warning "'-rpath' is ignored for objects"
9037
10609
 
9038
10610
      test -n "$xrpath" && \
9039
 
        func_warning "\`-R' is ignored for objects"
 
10611
        func_warning "'-R' is ignored for objects"
9040
10612
 
9041
10613
      test -n "$vinfo" && \
9042
 
        func_warning "\`-version-info' is ignored for objects"
 
10614
        func_warning "'-version-info' is ignored for objects"
9043
10615
 
9044
10616
      test -n "$release" && \
9045
 
        func_warning "\`-release' is ignored for objects"
 
10617
        func_warning "'-release' is ignored for objects"
9046
10618
 
9047
10619
      case $output in
9048
10620
      *.lo)
9049
10621
        test -n "$objs$old_deplibs" && \
9050
 
          func_fatal_error "cannot build library object \`$output' from non-libtool objects"
 
10622
          func_fatal_error "cannot build library object '$output' from non-libtool objects"
9051
10623
 
9052
10624
        libobj=$output
9053
10625
        func_lo2o "$libobj"
9055
10627
        ;;
9056
10628
      *)
9057
10629
        libobj=
9058
 
        obj="$output"
 
10630
        obj=$output
9059
10631
        ;;
9060
10632
      esac
9061
10633
 
9068
10640
      # the extraction.
9069
10641
      reload_conv_objs=
9070
10642
      gentop=
9071
 
      # reload_cmds runs $LD directly, so let us get rid of
9072
 
      # -Wl from whole_archive_flag_spec and hope we can get by with
9073
 
      # turning comma into space..
9074
 
      wl=
9075
 
 
 
10643
      # if reload_cmds runs $LD directly, get rid of -Wl from
 
10644
      # whole_archive_flag_spec and hope we can get by with turning comma
 
10645
      # into space.
 
10646
      case $reload_cmds in
 
10647
        *\$LD[\ \$]*) wl= ;;
 
10648
      esac
9076
10649
      if test -n "$convenience"; then
9077
10650
        if test -n "$whole_archive_flag_spec"; then
9078
10651
          eval tmp_whole_archive_flags=\"$whole_archive_flag_spec\"
9079
 
          reload_conv_objs=$reload_objs\ `$ECHO "$tmp_whole_archive_flags" | $SED 's|,| |g'`
 
10652
          test -n "$wl" || tmp_whole_archive_flags=`$ECHO "$tmp_whole_archive_flags" | $SED 's|,| |g'`
 
10653
          reload_conv_objs=$reload_objs\ $tmp_whole_archive_flags
9080
10654
        else
9081
 
          gentop="$output_objdir/${obj}x"
9082
 
          generated+=" $gentop"
 
10655
          gentop=$output_objdir/${obj}x
 
10656
          func_append generated " $gentop"
9083
10657
 
9084
10658
          func_extract_archives $gentop $convenience
9085
10659
          reload_conv_objs="$reload_objs $func_extract_archives_result"
9087
10661
      fi
9088
10662
 
9089
10663
      # If we're not building shared, we need to use non_pic_objs
9090
 
      test "$build_libtool_libs" != yes && libobjs="$non_pic_objects"
 
10664
      test yes = "$build_libtool_libs" || libobjs=$non_pic_objects
9091
10665
 
9092
10666
      # Create the old-style object.
9093
 
      reload_objs="$objs$old_deplibs "`$ECHO "$libobjs" | $SP2NL | $SED "/\.${libext}$/d; /\.lib$/d; $lo2o" | $NL2SP`" $reload_conv_objs" ### testsuite: skip nested quoting test
 
10667
      reload_objs=$objs$old_deplibs' '`$ECHO "$libobjs" | $SP2NL | $SED "/\.$libext$/d; /\.lib$/d; $lo2o" | $NL2SP`' '$reload_conv_objs
9094
10668
 
9095
 
      output="$obj"
 
10669
      output=$obj
9096
10670
      func_execute_cmds "$reload_cmds" 'exit $?'
9097
10671
 
9098
10672
      # Exit if we aren't doing a library object file.
9104
10678
        exit $EXIT_SUCCESS
9105
10679
      fi
9106
10680
 
9107
 
      if test "$build_libtool_libs" != yes; then
 
10681
      test yes = "$build_libtool_libs" || {
9108
10682
        if test -n "$gentop"; then
9109
10683
          func_show_eval '${RM}r "$gentop"'
9110
10684
        fi
9114
10688
        # $show "echo timestamp > $libobj"
9115
10689
        # $opt_dry_run || eval "echo timestamp > $libobj" || exit $?
9116
10690
        exit $EXIT_SUCCESS
9117
 
      fi
 
10691
      }
9118
10692
 
9119
 
      if test -n "$pic_flag" || test "$pic_mode" != default; then
 
10693
      if test -n "$pic_flag" || test default != "$pic_mode"; then
9120
10694
        # Only do commands if we really have different PIC objects.
9121
10695
        reload_objs="$libobjs $reload_conv_objs"
9122
 
        output="$libobj"
 
10696
        output=$libobj
9123
10697
        func_execute_cmds "$reload_cmds" 'exit $?'
9124
10698
      fi
9125
10699
 
9136
10710
                  output=$func_stripname_result.exe;;
9137
10711
      esac
9138
10712
      test -n "$vinfo" && \
9139
 
        func_warning "\`-version-info' is ignored for programs"
 
10713
        func_warning "'-version-info' is ignored for programs"
9140
10714
 
9141
10715
      test -n "$release" && \
9142
 
        func_warning "\`-release' is ignored for programs"
 
10716
        func_warning "'-release' is ignored for programs"
9143
10717
 
9144
 
      test "$preload" = yes \
9145
 
        && test "$dlopen_support" = unknown \
9146
 
        && test "$dlopen_self" = unknown \
9147
 
        && test "$dlopen_self_static" = unknown && \
9148
 
          func_warning "\`LT_INIT([dlopen])' not used. Assuming no dlopen support."
 
10718
      $preload \
 
10719
        && test unknown,unknown,unknown = "$dlopen_support,$dlopen_self,$dlopen_self_static" \
 
10720
        && func_warning "'LT_INIT([dlopen])' not used. Assuming no dlopen support."
9149
10721
 
9150
10722
      case $host in
9151
10723
      *-*-rhapsody* | *-*-darwin1.[012])
9159
10731
      *-*-darwin*)
9160
10732
        # Don't allow lazy linking, it breaks C++ global constructors
9161
10733
        # But is supposedly fixed on 10.4 or later (yay!).
9162
 
        if test "$tagname" = CXX ; then
 
10734
        if test CXX = "$tagname"; then
9163
10735
          case ${MACOSX_DEPLOYMENT_TARGET-10.0} in
9164
10736
            10.[0123])
9165
 
              compile_command+=" ${wl}-bind_at_load"
9166
 
              finalize_command+=" ${wl}-bind_at_load"
 
10737
              func_append compile_command " $wl-bind_at_load"
 
10738
              func_append finalize_command " $wl-bind_at_load"
9167
10739
            ;;
9168
10740
          esac
9169
10741
        fi
9183
10755
        *)
9184
10756
          case " $compile_deplibs " in
9185
10757
          *" -L$path/$objdir "*)
9186
 
            new_libs+=" -L$path/$objdir" ;;
 
10758
            func_append new_libs " -L$path/$objdir" ;;
9187
10759
          esac
9188
10760
          ;;
9189
10761
        esac
9193
10765
        -L*)
9194
10766
          case " $new_libs " in
9195
10767
          *" $deplib "*) ;;
9196
 
          *) new_libs+=" $deplib" ;;
 
10768
          *) func_append new_libs " $deplib" ;;
9197
10769
          esac
9198
10770
          ;;
9199
 
        *) new_libs+=" $deplib" ;;
 
10771
        *) func_append new_libs " $deplib" ;;
9200
10772
        esac
9201
10773
      done
9202
 
      compile_deplibs="$new_libs"
9203
 
 
9204
 
 
9205
 
      compile_command+=" $compile_deplibs"
9206
 
      finalize_command+=" $finalize_deplibs"
 
10774
      compile_deplibs=$new_libs
 
10775
 
 
10776
 
 
10777
      func_append compile_command " $compile_deplibs"
 
10778
      func_append finalize_command " $finalize_deplibs"
9207
10779
 
9208
10780
      if test -n "$rpath$xrpath"; then
9209
10781
        # If the user specified any rpath flags, then add them.
9211
10783
          # This is the magic to use -rpath.
9212
10784
          case "$finalize_rpath " in
9213
10785
          *" $libdir "*) ;;
9214
 
          *) finalize_rpath+=" $libdir" ;;
 
10786
          *) func_append finalize_rpath " $libdir" ;;
9215
10787
          esac
9216
10788
        done
9217
10789
      fi
9223
10795
        if test -n "$hardcode_libdir_flag_spec"; then
9224
10796
          if test -n "$hardcode_libdir_separator"; then
9225
10797
            if test -z "$hardcode_libdirs"; then
9226
 
              hardcode_libdirs="$libdir"
 
10798
              hardcode_libdirs=$libdir
9227
10799
            else
9228
10800
              # Just accumulate the unique libdirs.
9229
10801
              case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in
9230
10802
              *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*)
9231
10803
                ;;
9232
10804
              *)
9233
 
                hardcode_libdirs+="$hardcode_libdir_separator$libdir"
 
10805
                func_append hardcode_libdirs "$hardcode_libdir_separator$libdir"
9234
10806
                ;;
9235
10807
              esac
9236
10808
            fi
9237
10809
          else
9238
10810
            eval flag=\"$hardcode_libdir_flag_spec\"
9239
 
            rpath+=" $flag"
 
10811
            func_append rpath " $flag"
9240
10812
          fi
9241
10813
        elif test -n "$runpath_var"; then
9242
10814
          case "$perm_rpath " in
9243
10815
          *" $libdir "*) ;;
9244
 
          *) perm_rpath+=" $libdir" ;;
 
10816
          *) func_append perm_rpath " $libdir" ;;
9245
10817
          esac
9246
10818
        fi
9247
10819
        case $host in
9248
10820
        *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-cegcc*)
9249
 
          testbindir=`${ECHO} "$libdir" | ${SED} -e 's*/lib$*/bin*'`
 
10821
          testbindir=`$ECHO "$libdir" | $SED -e 's*/lib$*/bin*'`
9250
10822
          case :$dllsearchpath: in
9251
10823
          *":$libdir:"*) ;;
9252
10824
          ::) dllsearchpath=$libdir;;
9253
 
          *) dllsearchpath+=":$libdir";;
 
10825
          *) func_append dllsearchpath ":$libdir";;
9254
10826
          esac
9255
10827
          case :$dllsearchpath: in
9256
10828
          *":$testbindir:"*) ;;
9257
10829
          ::) dllsearchpath=$testbindir;;
9258
 
          *) dllsearchpath+=":$testbindir";;
 
10830
          *) func_append dllsearchpath ":$testbindir";;
9259
10831
          esac
9260
10832
          ;;
9261
10833
        esac
9263
10835
      # Substitute the hardcoded libdirs into the rpath.
9264
10836
      if test -n "$hardcode_libdir_separator" &&
9265
10837
         test -n "$hardcode_libdirs"; then
9266
 
        libdir="$hardcode_libdirs"
 
10838
        libdir=$hardcode_libdirs
9267
10839
        eval rpath=\" $hardcode_libdir_flag_spec\"
9268
10840
      fi
9269
 
      compile_rpath="$rpath"
 
10841
      compile_rpath=$rpath
9270
10842
 
9271
10843
      rpath=
9272
10844
      hardcode_libdirs=
9274
10846
        if test -n "$hardcode_libdir_flag_spec"; then
9275
10847
          if test -n "$hardcode_libdir_separator"; then
9276
10848
            if test -z "$hardcode_libdirs"; then
9277
 
              hardcode_libdirs="$libdir"
 
10849
              hardcode_libdirs=$libdir
9278
10850
            else
9279
10851
              # Just accumulate the unique libdirs.
9280
10852
              case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in
9281
10853
              *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*)
9282
10854
                ;;
9283
10855
              *)
9284
 
                hardcode_libdirs+="$hardcode_libdir_separator$libdir"
 
10856
                func_append hardcode_libdirs "$hardcode_libdir_separator$libdir"
9285
10857
                ;;
9286
10858
              esac
9287
10859
            fi
9288
10860
          else
9289
10861
            eval flag=\"$hardcode_libdir_flag_spec\"
9290
 
            rpath+=" $flag"
 
10862
            func_append rpath " $flag"
9291
10863
          fi
9292
10864
        elif test -n "$runpath_var"; then
9293
10865
          case "$finalize_perm_rpath " in
9294
10866
          *" $libdir "*) ;;
9295
 
          *) finalize_perm_rpath+=" $libdir" ;;
 
10867
          *) func_append finalize_perm_rpath " $libdir" ;;
9296
10868
          esac
9297
10869
        fi
9298
10870
      done
9299
10871
      # Substitute the hardcoded libdirs into the rpath.
9300
10872
      if test -n "$hardcode_libdir_separator" &&
9301
10873
         test -n "$hardcode_libdirs"; then
9302
 
        libdir="$hardcode_libdirs"
 
10874
        libdir=$hardcode_libdirs
9303
10875
        eval rpath=\" $hardcode_libdir_flag_spec\"
9304
10876
      fi
9305
 
      finalize_rpath="$rpath"
 
10877
      finalize_rpath=$rpath
9306
10878
 
9307
 
      if test -n "$libobjs" && test "$build_old_libs" = yes; then
 
10879
      if test -n "$libobjs" && test yes = "$build_old_libs"; then
9308
10880
        # Transform all the library objects into standard objects.
9309
10881
        compile_command=`$ECHO "$compile_command" | $SP2NL | $SED "$lo2o" | $NL2SP`
9310
10882
        finalize_command=`$ECHO "$finalize_command" | $SP2NL | $SED "$lo2o" | $NL2SP`
9311
10883
      fi
9312
10884
 
9313
 
      func_generate_dlsyms "$outputname" "@PROGRAM@" "no"
 
10885
      func_generate_dlsyms "$outputname" "@PROGRAM@" false
9314
10886
 
9315
10887
      # template prelinking step
9316
10888
      if test -n "$prelink_cmds"; then
9317
10889
        func_execute_cmds "$prelink_cmds" 'exit $?'
9318
10890
      fi
9319
10891
 
9320
 
      wrappers_required=yes
 
10892
      wrappers_required=:
9321
10893
      case $host in
9322
10894
      *cegcc* | *mingw32ce*)
9323
10895
        # Disable wrappers for cegcc and mingw32ce hosts, we are cross compiling anyway.
9324
 
        wrappers_required=no
 
10896
        wrappers_required=false
9325
10897
        ;;
9326
10898
      *cygwin* | *mingw* )
9327
 
        if test "$build_libtool_libs" != yes; then
9328
 
          wrappers_required=no
9329
 
        fi
 
10899
        test yes = "$build_libtool_libs" || wrappers_required=false
9330
10900
        ;;
9331
10901
      *)
9332
 
        if test "$need_relink" = no || test "$build_libtool_libs" != yes; then
9333
 
          wrappers_required=no
 
10902
        if test no = "$need_relink" || test yes != "$build_libtool_libs"; then
 
10903
          wrappers_required=false
9334
10904
        fi
9335
10905
        ;;
9336
10906
      esac
9337
 
      if test "$wrappers_required" = no; then
 
10907
      $wrappers_required || {
9338
10908
        # Replace the output file specification.
9339
10909
        compile_command=`$ECHO "$compile_command" | $SED 's%@OUTPUT@%'"$output"'%g'`
9340
 
        link_command="$compile_command$compile_rpath"
 
10910
        link_command=$compile_command$compile_rpath
9341
10911
 
9342
10912
        # We have no uninstalled library dependencies, so finalize right now.
9343
10913
        exit_status=0
9350
10920
        fi
9351
10921
 
9352
10922
        # Delete the generated files.
9353
 
        if test -f "$output_objdir/${outputname}S.${objext}"; then
9354
 
          func_show_eval '$RM "$output_objdir/${outputname}S.${objext}"'
 
10923
        if test -f "$output_objdir/${outputname}S.$objext"; then
 
10924
          func_show_eval '$RM "$output_objdir/${outputname}S.$objext"'
9355
10925
        fi
9356
10926
 
9357
10927
        exit $exit_status
9358
 
      fi
 
10928
      }
9359
10929
 
9360
10930
      if test -n "$compile_shlibpath$finalize_shlibpath"; then
9361
10931
        compile_command="$shlibpath_var=\"$compile_shlibpath$finalize_shlibpath\$$shlibpath_var\" $compile_command"
9371
10941
          # We should set the runpath_var.
9372
10942
          rpath=
9373
10943
          for dir in $perm_rpath; do
9374
 
            rpath+="$dir:"
 
10944
            func_append rpath "$dir:"
9375
10945
          done
9376
10946
          compile_var="$runpath_var=\"$rpath\$$runpath_var\" "
9377
10947
        fi
9379
10949
          # We should set the runpath_var.
9380
10950
          rpath=
9381
10951
          for dir in $finalize_perm_rpath; do
9382
 
            rpath+="$dir:"
 
10952
            func_append rpath "$dir:"
9383
10953
          done
9384
10954
          finalize_var="$runpath_var=\"$rpath\$$runpath_var\" "
9385
10955
        fi
9386
10956
      fi
9387
10957
 
9388
 
      if test "$no_install" = yes; then
 
10958
      if test yes = "$no_install"; then
9389
10959
        # We don't need to create a wrapper script.
9390
 
        link_command="$compile_var$compile_command$compile_rpath"
 
10960
        link_command=$compile_var$compile_command$compile_rpath
9391
10961
        # Replace the output file specification.
9392
10962
        link_command=`$ECHO "$link_command" | $SED 's%@OUTPUT@%'"$output"'%g'`
9393
10963
        # Delete the old output file.
9404
10974
        exit $EXIT_SUCCESS
9405
10975
      fi
9406
10976
 
9407
 
      if test "$hardcode_action" = relink; then
9408
 
        # Fast installation is not supported
9409
 
        link_command="$compile_var$compile_command$compile_rpath"
9410
 
        relink_command="$finalize_var$finalize_command$finalize_rpath"
 
10977
      case $hardcode_action,$fast_install in
 
10978
        relink,*)
 
10979
          # Fast installation is not supported
 
10980
          link_command=$compile_var$compile_command$compile_rpath
 
10981
          relink_command=$finalize_var$finalize_command$finalize_rpath
9411
10982
 
9412
 
        func_warning "this platform does not like uninstalled shared libraries"
9413
 
        func_warning "\`$output' will be relinked during installation"
9414
 
      else
9415
 
        if test "$fast_install" != no; then
9416
 
          link_command="$finalize_var$compile_command$finalize_rpath"
9417
 
          if test "$fast_install" = yes; then
9418
 
            relink_command=`$ECHO "$compile_var$compile_command$compile_rpath" | $SED 's%@OUTPUT@%\$progdir/\$file%g'`
9419
 
          else
9420
 
            # fast_install is set to needless
9421
 
            relink_command=
9422
 
          fi
9423
 
        else
9424
 
          link_command="$compile_var$compile_command$compile_rpath"
9425
 
          relink_command="$finalize_var$finalize_command$finalize_rpath"
9426
 
        fi
9427
 
      fi
 
10983
          func_warning "this platform does not like uninstalled shared libraries"
 
10984
          func_warning "'$output' will be relinked during installation"
 
10985
          ;;
 
10986
        *,yes)
 
10987
          link_command=$finalize_var$compile_command$finalize_rpath
 
10988
          relink_command=`$ECHO "$compile_var$compile_command$compile_rpath" | $SED 's%@OUTPUT@%\$progdir/\$file%g'`
 
10989
          ;;
 
10990
        *,no)
 
10991
          link_command=$compile_var$compile_command$compile_rpath
 
10992
          relink_command=$finalize_var$finalize_command$finalize_rpath
 
10993
          ;;
 
10994
        *,needless)
 
10995
          link_command=$finalize_var$compile_command$finalize_rpath
 
10996
          relink_command=
 
10997
          ;;
 
10998
      esac
9428
10999
 
9429
11000
      # Replace the output file specification.
9430
11001
      link_command=`$ECHO "$link_command" | $SED 's%@OUTPUT@%'"$output_objdir/$outputname"'%g'`
9481
11052
            func_dirname_and_basename "$output" "" "."
9482
11053
            output_name=$func_basename_result
9483
11054
            output_path=$func_dirname_result
9484
 
            cwrappersource="$output_path/$objdir/lt-$output_name.c"
9485
 
            cwrapper="$output_path/$output_name.exe"
 
11055
            cwrappersource=$output_path/$objdir/lt-$output_name.c
 
11056
            cwrapper=$output_path/$output_name.exe
9486
11057
            $RM $cwrappersource $cwrapper
9487
11058
            trap "$RM $cwrappersource $cwrapper; exit $EXIT_FAILURE" 1 2 15
9488
11059
 
9503
11074
            trap "$RM $func_ltwrapper_scriptname_result; exit $EXIT_FAILURE" 1 2 15
9504
11075
            $opt_dry_run || {
9505
11076
              # note: this script will not be executed, so do not chmod.
9506
 
              if test "x$build" = "x$host" ; then
 
11077
              if test "x$build" = "x$host"; then
9507
11078
                $cwrapper --lt-dump-script > $func_ltwrapper_scriptname_result
9508
11079
              else
9509
11080
                func_emit_wrapper no > $func_ltwrapper_scriptname_result
9526
11097
    # See if we need to build an old-fashioned archive.
9527
11098
    for oldlib in $oldlibs; do
9528
11099
 
9529
 
      if test "$build_libtool_libs" = convenience; then
9530
 
        oldobjs="$libobjs_save $symfileobj"
9531
 
        addlibs="$convenience"
9532
 
        build_libtool_libs=no
9533
 
      else
9534
 
        if test "$build_libtool_libs" = module; then
9535
 
          oldobjs="$libobjs_save"
9536
 
          build_libtool_libs=no
9537
 
        else
 
11100
      case $build_libtool_libs in
 
11101
        convenience)
 
11102
          oldobjs="$libobjs_save $symfileobj"
 
11103
          addlibs=$convenience
 
11104
          build_libtool_libs=no
 
11105
          ;;
 
11106
        module)
 
11107
          oldobjs=$libobjs_save
 
11108
          addlibs=$old_convenience
 
11109
          build_libtool_libs=no
 
11110
          ;;
 
11111
        *)
9538
11112
          oldobjs="$old_deplibs $non_pic_objects"
9539
 
          if test "$preload" = yes && test -f "$symfileobj"; then
9540
 
            oldobjs+=" $symfileobj"
9541
 
          fi
9542
 
        fi
9543
 
        addlibs="$old_convenience"
9544
 
      fi
 
11113
          $preload && test -f "$symfileobj" \
 
11114
            && func_append oldobjs " $symfileobj"
 
11115
          addlibs=$old_convenience
 
11116
          ;;
 
11117
      esac
9545
11118
 
9546
11119
      if test -n "$addlibs"; then
9547
 
        gentop="$output_objdir/${outputname}x"
9548
 
        generated+=" $gentop"
 
11120
        gentop=$output_objdir/${outputname}x
 
11121
        func_append generated " $gentop"
9549
11122
 
9550
11123
        func_extract_archives $gentop $addlibs
9551
 
        oldobjs+=" $func_extract_archives_result"
 
11124
        func_append oldobjs " $func_extract_archives_result"
9552
11125
      fi
9553
11126
 
9554
11127
      # Do each command in the archive commands.
9555
 
      if test -n "$old_archive_from_new_cmds" && test "$build_libtool_libs" = yes; then
 
11128
      if test -n "$old_archive_from_new_cmds" && test yes = "$build_libtool_libs"; then
9556
11129
        cmds=$old_archive_from_new_cmds
9557
11130
      else
9558
11131
 
9559
11132
        # Add any objects from preloaded convenience libraries
9560
11133
        if test -n "$dlprefiles"; then
9561
 
          gentop="$output_objdir/${outputname}x"
9562
 
          generated+=" $gentop"
 
11134
          gentop=$output_objdir/${outputname}x
 
11135
          func_append generated " $gentop"
9563
11136
 
9564
11137
          func_extract_archives $gentop $dlprefiles
9565
 
          oldobjs+=" $func_extract_archives_result"
 
11138
          func_append oldobjs " $func_extract_archives_result"
9566
11139
        fi
9567
11140
 
9568
11141
        # POSIX demands no paths to be encoded in archives.  We have
9579
11152
          :
9580
11153
        else
9581
11154
          echo "copying selected object files to avoid basename conflicts..."
9582
 
          gentop="$output_objdir/${outputname}x"
9583
 
          generated+=" $gentop"
 
11155
          gentop=$output_objdir/${outputname}x
 
11156
          func_append generated " $gentop"
9584
11157
          func_mkdir_p "$gentop"
9585
11158
          save_oldobjs=$oldobjs
9586
11159
          oldobjs=
9588
11161
          for obj in $save_oldobjs
9589
11162
          do
9590
11163
            func_basename "$obj"
9591
 
            objbase="$func_basename_result"
 
11164
            objbase=$func_basename_result
9592
11165
            case " $oldobjs " in
9593
11166
            " ") oldobjs=$obj ;;
9594
11167
            *[\ /]"$objbase "*)
9604
11177
                esac
9605
11178
              done
9606
11179
              func_show_eval "ln $obj $gentop/$newobj || cp $obj $gentop/$newobj"
9607
 
              oldobjs+=" $gentop/$newobj"
 
11180
              func_append oldobjs " $gentop/$newobj"
9608
11181
              ;;
9609
 
            *) oldobjs+=" $obj" ;;
 
11182
            *) func_append oldobjs " $obj" ;;
9610
11183
            esac
9611
11184
          done
9612
11185
        fi
9651
11224
            func_len " $obj"
9652
11225
            func_arith $len + $func_len_result
9653
11226
            len=$func_arith_result
9654
 
            objlist+=" $obj"
 
11227
            func_append objlist " $obj"
9655
11228
            if test "$len" -lt "$max_cmd_len"; then
9656
11229
              :
9657
11230
            else
9658
11231
              # the above command should be used before it gets too long
9659
11232
              oldobjs=$objlist
9660
 
              if test "$obj" = "$last_oldobj" ; then
 
11233
              if test "$obj" = "$last_oldobj"; then
9661
11234
                RANLIB=$save_RANLIB
9662
11235
              fi
9663
11236
              test -z "$concat_cmds" || concat_cmds=$concat_cmds~
9664
 
              eval concat_cmds=\"\${concat_cmds}$old_archive_cmds\"
 
11237
              eval concat_cmds=\"\$concat_cmds$old_archive_cmds\"
9665
11238
              objlist=
9666
11239
              len=$len0
9667
11240
            fi
9668
11241
          done
9669
11242
          RANLIB=$save_RANLIB
9670
11243
          oldobjs=$objlist
9671
 
          if test "X$oldobjs" = "X" ; then
 
11244
          if test -z "$oldobjs"; then
9672
11245
            eval cmds=\"\$concat_cmds\"
9673
11246
          else
9674
11247
            eval cmds=\"\$concat_cmds~\$old_archive_cmds\"
9685
11258
    case $output in
9686
11259
    *.la)
9687
11260
      old_library=
9688
 
      test "$build_old_libs" = yes && old_library="$libname.$libext"
 
11261
      test yes = "$build_old_libs" && old_library=$libname.$libext
9689
11262
      func_verbose "creating $output"
9690
11263
 
9691
11264
      # Preserve any variables that may affect compiler behavior
9700
11273
        fi
9701
11274
      done
9702
11275
      # Quote the link command for shipping.
9703
 
      relink_command="(cd `pwd`; $SHELL $progpath $preserve_args --mode=relink $libtool_args @inst_prefix_dir@)"
 
11276
      relink_command="(cd `pwd`; $SHELL \"$progpath\" $preserve_args --mode=relink $libtool_args @inst_prefix_dir@)"
9704
11277
      relink_command=`$ECHO "$relink_command" | $SED "$sed_quote_subst"`
9705
 
      if test "$hardcode_automatic" = yes ; then
 
11278
      if test yes = "$hardcode_automatic"; then
9706
11279
        relink_command=
9707
11280
      fi
9708
11281
 
9709
11282
      # Only create the output if not a dry run.
9710
11283
      $opt_dry_run || {
9711
11284
        for installed in no yes; do
9712
 
          if test "$installed" = yes; then
 
11285
          if test yes = "$installed"; then
9713
11286
            if test -z "$install_libdir"; then
9714
11287
              break
9715
11288
            fi
9716
 
            output="$output_objdir/$outputname"i
 
11289
            output=$output_objdir/${outputname}i
9717
11290
            # Replace all uninstalled libtool libraries with the installed ones
9718
11291
            newdependency_libs=
9719
11292
            for deplib in $dependency_libs; do
9720
11293
              case $deplib in
9721
11294
              *.la)
9722
11295
                func_basename "$deplib"
9723
 
                name="$func_basename_result"
 
11296
                name=$func_basename_result
9724
11297
                func_resolve_sysroot "$deplib"
9725
 
                eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $func_resolve_sysroot_result`
 
11298
                eval libdir=`$SED -n -e 's/^libdir=\(.*\)$/\1/p' $func_resolve_sysroot_result`
9726
11299
                test -z "$libdir" && \
9727
 
                  func_fatal_error "\`$deplib' is not a valid libtool archive"
9728
 
                newdependency_libs+=" ${lt_sysroot:+=}$libdir/$name"
 
11300
                  func_fatal_error "'$deplib' is not a valid libtool archive"
 
11301
                func_append newdependency_libs " ${lt_sysroot:+=}$libdir/$name"
9729
11302
                ;;
9730
11303
              -L*)
9731
11304
                func_stripname -L '' "$deplib"
9732
11305
                func_replace_sysroot "$func_stripname_result"
9733
 
                newdependency_libs+=" -L$func_replace_sysroot_result"
 
11306
                func_append newdependency_libs " -L$func_replace_sysroot_result"
9734
11307
                ;;
9735
11308
              -R*)
9736
11309
                func_stripname -R '' "$deplib"
9737
11310
                func_replace_sysroot "$func_stripname_result"
9738
 
                newdependency_libs+=" -R$func_replace_sysroot_result"
 
11311
                func_append newdependency_libs " -R$func_replace_sysroot_result"
9739
11312
                ;;
9740
 
              *) newdependency_libs+=" $deplib" ;;
 
11313
              *) func_append newdependency_libs " $deplib" ;;
9741
11314
              esac
9742
11315
            done
9743
 
            dependency_libs="$newdependency_libs"
 
11316
            dependency_libs=$newdependency_libs
9744
11317
            newdlfiles=
9745
11318
 
9746
11319
            for lib in $dlfiles; do
9747
11320
              case $lib in
9748
11321
              *.la)
9749
11322
                func_basename "$lib"
9750
 
                name="$func_basename_result"
9751
 
                eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $lib`
 
11323
                name=$func_basename_result
 
11324
                eval libdir=`$SED -n -e 's/^libdir=\(.*\)$/\1/p' $lib`
9752
11325
                test -z "$libdir" && \
9753
 
                  func_fatal_error "\`$lib' is not a valid libtool archive"
9754
 
                newdlfiles+=" ${lt_sysroot:+=}$libdir/$name"
 
11326
                  func_fatal_error "'$lib' is not a valid libtool archive"
 
11327
                func_append newdlfiles " ${lt_sysroot:+=}$libdir/$name"
9755
11328
                ;;
9756
 
              *) newdlfiles+=" $lib" ;;
 
11329
              *) func_append newdlfiles " $lib" ;;
9757
11330
              esac
9758
11331
            done
9759
 
            dlfiles="$newdlfiles"
 
11332
            dlfiles=$newdlfiles
9760
11333
            newdlprefiles=
9761
11334
            for lib in $dlprefiles; do
9762
11335
              case $lib in
9766
11339
                # didn't already link the preopened objects directly into
9767
11340
                # the library:
9768
11341
                func_basename "$lib"
9769
 
                name="$func_basename_result"
9770
 
                eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $lib`
 
11342
                name=$func_basename_result
 
11343
                eval libdir=`$SED -n -e 's/^libdir=\(.*\)$/\1/p' $lib`
9771
11344
                test -z "$libdir" && \
9772
 
                  func_fatal_error "\`$lib' is not a valid libtool archive"
9773
 
                newdlprefiles+=" ${lt_sysroot:+=}$libdir/$name"
 
11345
                  func_fatal_error "'$lib' is not a valid libtool archive"
 
11346
                func_append newdlprefiles " ${lt_sysroot:+=}$libdir/$name"
9774
11347
                ;;
9775
11348
              esac
9776
11349
            done
9777
 
            dlprefiles="$newdlprefiles"
 
11350
            dlprefiles=$newdlprefiles
9778
11351
          else
9779
11352
            newdlfiles=
9780
11353
            for lib in $dlfiles; do
9781
11354
              case $lib in
9782
 
                [\\/]* | [A-Za-z]:[\\/]*) abs="$lib" ;;
 
11355
                [\\/]* | [A-Za-z]:[\\/]*) abs=$lib ;;
9783
11356
                *) abs=`pwd`"/$lib" ;;
9784
11357
              esac
9785
 
              newdlfiles+=" $abs"
 
11358
              func_append newdlfiles " $abs"
9786
11359
            done
9787
 
            dlfiles="$newdlfiles"
 
11360
            dlfiles=$newdlfiles
9788
11361
            newdlprefiles=
9789
11362
            for lib in $dlprefiles; do
9790
11363
              case $lib in
9791
 
                [\\/]* | [A-Za-z]:[\\/]*) abs="$lib" ;;
 
11364
                [\\/]* | [A-Za-z]:[\\/]*) abs=$lib ;;
9792
11365
                *) abs=`pwd`"/$lib" ;;
9793
11366
              esac
9794
 
              newdlprefiles+=" $abs"
 
11367
              func_append newdlprefiles " $abs"
9795
11368
            done
9796
 
            dlprefiles="$newdlprefiles"
 
11369
            dlprefiles=$newdlprefiles
9797
11370
          fi
9798
11371
          $RM $output
9799
11372
          # place dlname in correct position for cygwin
9809
11382
          case $host,$output,$installed,$module,$dlname in
9810
11383
            *cygwin*,*lai,yes,no,*.dll | *mingw*,*lai,yes,no,*.dll | *cegcc*,*lai,yes,no,*.dll)
9811
11384
              # If a -bindir argument was supplied, place the dll there.
9812
 
              if test "x$bindir" != x ;
9813
 
              then
 
11385
              if test -n "$bindir"; then
9814
11386
                func_relative_path "$install_libdir" "$bindir"
9815
 
                tdlname=$func_relative_path_result$dlname
 
11387
                tdlname=$func_relative_path_result/$dlname
9816
11388
              else
9817
11389
                # Otherwise fall back on heuristic.
9818
11390
                tdlname=../bin/$dlname
9821
11393
          esac
9822
11394
          $ECHO > $output "\
9823
11395
# $outputname - a libtool library file
9824
 
# Generated by $PROGRAM (GNU $PACKAGE$TIMESTAMP) $VERSION
 
11396
# Generated by $PROGRAM (GNU $PACKAGE) $VERSION
9825
11397
#
9826
11398
# Please DO NOT delete this file!
9827
11399
# It is necessary for linking the library.
9835
11407
# The name of the static archive.
9836
11408
old_library='$old_library'
9837
11409
 
9838
 
# Linker flags that can not go in dependency_libs.
 
11410
# Linker flags that cannot go in dependency_libs.
9839
11411
inherited_linker_flags='$new_inherited_linker_flags'
9840
11412
 
9841
11413
# Libraries that this one depends upon.
9861
11433
 
9862
11434
# Directory that this library needs to be installed in:
9863
11435
libdir='$install_libdir'"
9864
 
          if test "$installed" = no && test "$need_relink" = yes; then
 
11436
          if test no,yes = "$installed,$need_relink"; then
9865
11437
            $ECHO >> $output "\
9866
11438
relink_command=\"$relink_command\""
9867
11439
          fi
9876
11448
    exit $EXIT_SUCCESS
9877
11449
}
9878
11450
 
9879
 
{ test "$opt_mode" = link || test "$opt_mode" = relink; } &&
9880
 
    func_mode_link ${1+"$@"}
 
11451
if test link = "$opt_mode" || test relink = "$opt_mode"; then
 
11452
  func_mode_link ${1+"$@"}
 
11453
fi
9881
11454
 
9882
11455
 
9883
11456
# func_mode_uninstall arg...
9884
11457
func_mode_uninstall ()
9885
11458
{
9886
 
    $opt_debug
9887
 
    RM="$nonopt"
 
11459
    $debug_cmd
 
11460
 
 
11461
    RM=$nonopt
9888
11462
    files=
9889
 
    rmforce=
 
11463
    rmforce=false
9890
11464
    exit_status=0
9891
11465
 
9892
11466
    # This variable tells wrapper scripts just to set variables rather
9893
11467
    # than running their programs.
9894
 
    libtool_install_magic="$magic"
 
11468
    libtool_install_magic=$magic
9895
11469
 
9896
11470
    for arg
9897
11471
    do
9898
11472
      case $arg in
9899
 
      -f) RM+=" $arg"; rmforce=yes ;;
9900
 
      -*) RM+=" $arg" ;;
9901
 
      *) files+=" $arg" ;;
 
11473
      -f) func_append RM " $arg"; rmforce=: ;;
 
11474
      -*) func_append RM " $arg" ;;
 
11475
      *) func_append files " $arg" ;;
9902
11476
      esac
9903
11477
    done
9904
11478
 
9909
11483
 
9910
11484
    for file in $files; do
9911
11485
      func_dirname "$file" "" "."
9912
 
      dir="$func_dirname_result"
9913
 
      if test "X$dir" = X.; then
9914
 
        odir="$objdir"
 
11486
      dir=$func_dirname_result
 
11487
      if test . = "$dir"; then
 
11488
        odir=$objdir
9915
11489
      else
9916
 
        odir="$dir/$objdir"
 
11490
        odir=$dir/$objdir
9917
11491
      fi
9918
11492
      func_basename "$file"
9919
 
      name="$func_basename_result"
9920
 
      test "$opt_mode" = uninstall && odir="$dir"
 
11493
      name=$func_basename_result
 
11494
      test uninstall = "$opt_mode" && odir=$dir
9921
11495
 
9922
11496
      # Remember odir for removal later, being careful to avoid duplicates
9923
 
      if test "$opt_mode" = clean; then
 
11497
      if test clean = "$opt_mode"; then
9924
11498
        case " $rmdirs " in
9925
11499
          *" $odir "*) ;;
9926
 
          *) rmdirs+=" $odir" ;;
 
11500
          *) func_append rmdirs " $odir" ;;
9927
11501
        esac
9928
11502
      fi
9929
11503
 
9935
11509
      elif test -d "$file"; then
9936
11510
        exit_status=1
9937
11511
        continue
9938
 
      elif test "$rmforce" = yes; then
 
11512
      elif $rmforce; then
9939
11513
        continue
9940
11514
      fi
9941
11515
 
9942
 
      rmfiles="$file"
 
11516
      rmfiles=$file
9943
11517
 
9944
11518
      case $name in
9945
11519
      *.la)
9949
11523
 
9950
11524
          # Delete the libtool libraries and symlinks.
9951
11525
          for n in $library_names; do
9952
 
            rmfiles+=" $odir/$n"
 
11526
            func_append rmfiles " $odir/$n"
9953
11527
          done
9954
 
          test -n "$old_library" && rmfiles+=" $odir/$old_library"
 
11528
          test -n "$old_library" && func_append rmfiles " $odir/$old_library"
9955
11529
 
9956
 
          case "$opt_mode" in
 
11530
          case $opt_mode in
9957
11531
          clean)
9958
11532
            case " $library_names " in
9959
11533
            *" $dlname "*) ;;
9960
 
            *) test -n "$dlname" && rmfiles+=" $odir/$dlname" ;;
 
11534
            *) test -n "$dlname" && func_append rmfiles " $odir/$dlname" ;;
9961
11535
            esac
9962
 
            test -n "$libdir" && rmfiles+=" $odir/$name $odir/${name}i"
 
11536
            test -n "$libdir" && func_append rmfiles " $odir/$name $odir/${name}i"
9963
11537
            ;;
9964
11538
          uninstall)
9965
11539
            if test -n "$library_names"; then
9966
11540
              # Do each command in the postuninstall commands.
9967
 
              func_execute_cmds "$postuninstall_cmds" 'test "$rmforce" = yes || exit_status=1'
 
11541
              func_execute_cmds "$postuninstall_cmds" '$rmforce || exit_status=1'
9968
11542
            fi
9969
11543
 
9970
11544
            if test -n "$old_library"; then
9971
11545
              # Do each command in the old_postuninstall commands.
9972
 
              func_execute_cmds "$old_postuninstall_cmds" 'test "$rmforce" = yes || exit_status=1'
 
11546
              func_execute_cmds "$old_postuninstall_cmds" '$rmforce || exit_status=1'
9973
11547
            fi
9974
11548
            # FIXME: should reinstall the best remaining shared library.
9975
11549
            ;;
9985
11559
          func_source $dir/$name
9986
11560
 
9987
11561
          # Add PIC object to the list of files to remove.
9988
 
          if test -n "$pic_object" &&
9989
 
             test "$pic_object" != none; then
9990
 
            rmfiles+=" $dir/$pic_object"
 
11562
          if test -n "$pic_object" && test none != "$pic_object"; then
 
11563
            func_append rmfiles " $dir/$pic_object"
9991
11564
          fi
9992
11565
 
9993
11566
          # Add non-PIC object to the list of files to remove.
9994
 
          if test -n "$non_pic_object" &&
9995
 
             test "$non_pic_object" != none; then
9996
 
            rmfiles+=" $dir/$non_pic_object"
 
11567
          if test -n "$non_pic_object" && test none != "$non_pic_object"; then
 
11568
            func_append rmfiles " $dir/$non_pic_object"
9997
11569
          fi
9998
11570
        fi
9999
11571
        ;;
10000
11572
 
10001
11573
      *)
10002
 
        if test "$opt_mode" = clean ; then
 
11574
        if test clean = "$opt_mode"; then
10003
11575
          noexename=$name
10004
11576
          case $file in
10005
11577
          *.exe)
10009
11581
            noexename=$func_stripname_result
10010
11582
            # $file with .exe has already been added to rmfiles,
10011
11583
            # add $file without .exe
10012
 
            rmfiles+=" $file"
 
11584
            func_append rmfiles " $file"
10013
11585
            ;;
10014
11586
          esac
10015
11587
          # Do a test to see if this is a libtool program.
10018
11590
              func_ltwrapper_scriptname "$file"
10019
11591
              relink_command=
10020
11592
              func_source $func_ltwrapper_scriptname_result
10021
 
              rmfiles+=" $func_ltwrapper_scriptname_result"
 
11593
              func_append rmfiles " $func_ltwrapper_scriptname_result"
10022
11594
            else
10023
11595
              relink_command=
10024
11596
              func_source $dir/$noexename
10026
11598
 
10027
11599
            # note $name still contains .exe if it was in $file originally
10028
11600
            # as does the version of $file that was added into $rmfiles
10029
 
            rmfiles+=" $odir/$name $odir/${name}S.${objext}"
10030
 
            if test "$fast_install" = yes && test -n "$relink_command"; then
10031
 
              rmfiles+=" $odir/lt-$name"
 
11601
            func_append rmfiles " $odir/$name $odir/${name}S.$objext"
 
11602
            if test yes = "$fast_install" && test -n "$relink_command"; then
 
11603
              func_append rmfiles " $odir/lt-$name"
10032
11604
            fi
10033
 
            if test "X$noexename" != "X$name" ; then
10034
 
              rmfiles+=" $odir/lt-${noexename}.c"
 
11605
            if test "X$noexename" != "X$name"; then
 
11606
              func_append rmfiles " $odir/lt-$noexename.c"
10035
11607
            fi
10036
11608
          fi
10037
11609
        fi
10040
11612
      func_show_eval "$RM $rmfiles" 'exit_status=1'
10041
11613
    done
10042
11614
 
10043
 
    # Try to remove the ${objdir}s in the directories where we deleted files
 
11615
    # Try to remove the $objdir's in the directories where we deleted files
10044
11616
    for dir in $rmdirs; do
10045
11617
      if test -d "$dir"; then
10046
11618
        func_show_eval "rmdir $dir >/dev/null 2>&1"
10050
11622
    exit $exit_status
10051
11623
}
10052
11624
 
10053
 
{ test "$opt_mode" = uninstall || test "$opt_mode" = clean; } &&
10054
 
    func_mode_uninstall ${1+"$@"}
 
11625
if test uninstall = "$opt_mode" || test clean = "$opt_mode"; then
 
11626
  func_mode_uninstall ${1+"$@"}
 
11627
fi
10055
11628
 
10056
11629
test -z "$opt_mode" && {
10057
 
  help="$generic_help"
 
11630
  help=$generic_help
10058
11631
  func_fatal_help "you must specify a MODE"
10059
11632
}
10060
11633
 
10061
11634
test -z "$exec_cmd" && \
10062
 
  func_fatal_help "invalid operation mode \`$opt_mode'"
 
11635
  func_fatal_help "invalid operation mode '$opt_mode'"
10063
11636
 
10064
11637
if test -n "$exec_cmd"; then
10065
11638
  eval exec "$exec_cmd"
10070
11643
 
10071
11644
 
10072
11645
# The TAGs below are defined such that we never get into a situation
10073
 
# in which we disable both kinds of libraries.  Given conflicting
 
11646
# where we disable both kinds of libraries.  Given conflicting
10074
11647
# choices, we go for a static library, that is the most portable,
10075
11648
# since we can't tell whether shared libraries were disabled because
10076
11649
# the user asked for that or because the platform doesn't support
10093
11666
# mode:shell-script
10094
11667
# sh-indentation:2
10095
11668
# End:
10096
 
# vi:sw=2
10097
 
 
10098
11669
 
10099
11670
# ### BEGIN LIBTOOL TAG CONFIG: CXX
10100
11671
 
10136
11707
allow_libtool_libs_with_static_runtimes=no
10137
11708
 
10138
11709
# Compiler flag to allow reflexive dlopens.
10139
 
export_dynamic_flag_spec="\${wl}--export-dynamic"
 
11710
export_dynamic_flag_spec="\$wl--export-dynamic"
10140
11711
 
10141
11712
# Compiler flag to generate shared objects directly from archives.
10142
 
whole_archive_flag_spec="\${wl}--whole-archive\$convenience \${wl}--no-whole-archive"
 
11713
whole_archive_flag_spec="\$wl--whole-archive\$convenience \$wl--no-whole-archive"
10143
11714
 
10144
11715
# Whether the compiler copes with passing no objects directly.
10145
11716
compiler_needs_object="no"
10151
11722
old_archive_from_expsyms_cmds=""
10152
11723
 
10153
11724
# Commands used to build a shared archive.
10154
 
archive_cmds="\$CC \$pic_flag -shared -nostdlib \$predep_objects \$libobjs \$deplibs \$postdep_objects \$compiler_flags \${wl}-soname \$wl\$soname -o \$lib"
10155
 
archive_expsym_cmds="\$CC \$pic_flag -shared -nostdlib \$predep_objects \$libobjs \$deplibs \$postdep_objects \$compiler_flags \${wl}-soname \$wl\$soname \${wl}-retain-symbols-file \$wl\$export_symbols -o \$lib"
 
11725
archive_cmds="\$CC \$pic_flag -shared -nostdlib \$predep_objects \$libobjs \$deplibs \$postdep_objects \$compiler_flags \$wl-soname \$wl\$soname -o \$lib"
 
11726
archive_expsym_cmds="\$CC \$pic_flag -shared -nostdlib \$predep_objects \$libobjs \$deplibs \$postdep_objects \$compiler_flags \$wl-soname \$wl\$soname \$wl-retain-symbols-file \$wl\$export_symbols -o \$lib"
10156
11727
 
10157
11728
# Commands used to build a loadable module if different from building
10158
11729
# a shared archive.
10170
11741
 
10171
11742
# Flag to hardcode $libdir into a binary during linking.
10172
11743
# This must work even if $libdir does not exist
10173
 
hardcode_libdir_flag_spec="\${wl}-rpath \${wl}\$libdir"
 
11744
hardcode_libdir_flag_spec="\$wl-rpath \$wl\$libdir"
10174
11745
 
10175
11746
# Whether we need a single "-rpath" flag with a separated argument.
10176
11747
hardcode_libdir_separator=""
10177
11748
 
10178
 
# Set to "yes" if using DIR/libNAME${shared_ext} during linking hardcodes
 
11749
# Set to "yes" if using DIR/libNAME$shared_ext during linking hardcodes
10179
11750
# DIR into the resulting binary.
10180
11751
hardcode_direct=no
10181
11752
 
10182
 
# Set to "yes" if using DIR/libNAME${shared_ext} during linking hardcodes
 
11753
# Set to "yes" if using DIR/libNAME$shared_ext during linking hardcodes
10183
11754
# DIR into the resulting binary and the resulting library dependency is
10184
 
# "absolute",i.e impossible to change by setting ${shlibpath_var} if the
 
11755
# "absolute",i.e impossible to change by setting $shlibpath_var if the
10185
11756
# library is relocated.
10186
11757
hardcode_direct_absolute=no
10187
11758