• R/O
  • HTTP
  • SSH
  • HTTPS

libtetrabz: Commit

テトラへドロン法ライブラリ


Commit MetaInfo

Revision0d3848fa2d3b6a4edf3876029af3d5bb3e0def19 (tree)
Zeit2020-05-01 17:43:42
AutorMitsuaki Kawamura <kawamitsuaki@gmai...>
CommiterMitsuaki Kawamura

Log Message

Update Web page, autoconf

Ändern Zusammenfassung

Diff

--- a/Makefile.am
+++ b/Makefile.am
@@ -4,12 +4,12 @@ MAINTAINERCLEANFILES = Makefile.in aclocal.m4 configure
44 EXTRA_DIST = doc
55
66 docs:
7- cd doc/ja/;make latexpdfja; make html
8- cd doc/en/;make latexpdfja; make html
7+ cd doc/ja/;make latexpdf; make html
8+ cd doc/en/;make latexpdf; make html
99
1010 pngdocs:
11- cd doc/ja/;sed -i -e "s/mathjax/pngmath/g" conf.py; make latexpdfja; make html
12- cd doc/en/;sed -i -e "s/mathjax/pngmath/g" conf.py; make latexpdfja; make html
11+ cd doc/ja/;sed -i -e "s/mathjax/pngmath/g" conf.py; make latexpdf; make html
12+ cd doc/en/;sed -i -e "s/mathjax/pngmath/g" conf.py; make latexpdf; make html
1313
1414 docs-clean:
1515 cd doc/ja/; make clean; sed -i -e "s/pngmath/mathjax/g" conf.py
--- a/Makefile.in
+++ b/Makefile.in
@@ -1,7 +1,7 @@
1-# Makefile.in generated by automake 1.14.1 from Makefile.am.
1+# Makefile.in generated by automake 1.15.1 from Makefile.am.
22 # @configure_input@
33
4-# Copyright (C) 1994-2013 Free Software Foundation, Inc.
4+# Copyright (C) 1994-2017 Free Software Foundation, Inc.
55
66 # This Makefile.in is free software; the Free Software Foundation
77 # gives unlimited permission to copy and/or distribute it,
@@ -14,7 +14,17 @@
1414
1515 @SET_MAKE@
1616 VPATH = @srcdir@
17-am__is_gnu_make = test -n '$(MAKEFILE_LIST)' && test -n '$(MAKELEVEL)'
17+am__is_gnu_make = { \
18+ if test -z '$(MAKELEVEL)'; then \
19+ false; \
20+ elif test -n '$(MAKE_HOST)'; then \
21+ true; \
22+ elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \
23+ true; \
24+ else \
25+ false; \
26+ fi; \
27+}
1828 am__make_running_with_option = \
1929 case $${target_option-} in \
2030 ?) ;; \
@@ -78,16 +88,6 @@ POST_UNINSTALL = :
7888 build_triplet = @build@
7989 host_triplet = @host@
8090 subdir = .
81-DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/Makefile.am \
82- $(top_srcdir)/configure $(am__configure_deps) \
83- $(srcdir)/config.h.in config/ar-lib config/compile \
84- config/config.guess config/config.sub config/depcomp \
85- config/install-sh config/missing config/ltmain.sh \
86- $(top_srcdir)/config/ar-lib $(top_srcdir)/config/compile \
87- $(top_srcdir)/config/config.guess \
88- $(top_srcdir)/config/config.sub \
89- $(top_srcdir)/config/install-sh $(top_srcdir)/config/ltmain.sh \
90- $(top_srcdir)/config/missing
9191 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
9292 am__aclocal_m4_deps = $(top_srcdir)/config/m4/libtool.m4 \
9393 $(top_srcdir)/config/m4/ltoptions.m4 \
@@ -97,6 +97,8 @@ am__aclocal_m4_deps = $(top_srcdir)/config/m4/libtool.m4 \
9797 $(top_srcdir)/configure.ac
9898 am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
9999 $(ACLOCAL_M4)
100+DIST_COMMON = $(srcdir)/Makefile.am $(top_srcdir)/configure \
101+ $(am__configure_deps) $(am__DIST_COMMON)
100102 am__CONFIG_DISTCLEAN_FILES = config.status config.cache config.log \
101103 configure.lineno config.status.lineno
102104 mkinstalldirs = $(install_sh) -d
@@ -160,6 +162,14 @@ ETAGS = etags
160162 CTAGS = ctags
161163 CSCOPE = cscope
162164 DIST_SUBDIRS = $(SUBDIRS)
165+am__DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/config.h.in \
166+ $(top_srcdir)/config/ar-lib $(top_srcdir)/config/compile \
167+ $(top_srcdir)/config/config.guess \
168+ $(top_srcdir)/config/config.sub \
169+ $(top_srcdir)/config/install-sh $(top_srcdir)/config/ltmain.sh \
170+ $(top_srcdir)/config/missing config/ar-lib config/compile \
171+ config/config.guess config/config.sub config/depcomp \
172+ config/install-sh config/ltmain.sh config/missing
163173 DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
164174 distdir = $(PACKAGE)-$(VERSION)
165175 top_distdir = $(distdir)
@@ -247,6 +257,7 @@ LIBTOOL = @LIBTOOL@
247257 LIPO = @LIPO@
248258 LN_S = @LN_S@
249259 LTLIBOBJS = @LTLIBOBJS@
260+LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@
250261 MAKEINFO = @MAKEINFO@
251262 MANIFEST_TOOL = @MANIFEST_TOOL@
252263 MKDIR_P = @MKDIR_P@
@@ -318,6 +329,7 @@ pdfdir = @pdfdir@
318329 prefix = @prefix@
319330 program_transform_name = @program_transform_name@
320331 psdir = @psdir@
332+runstatedir = @runstatedir@
321333 sbindir = @sbindir@
322334 sharedstatedir = @sharedstatedir@
323335 srcdir = @srcdir@
@@ -349,7 +361,6 @@ $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps)
349361 echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign Makefile'; \
350362 $(am__cd) $(top_srcdir) && \
351363 $(AUTOMAKE) --foreign Makefile
352-.PRECIOUS: Makefile
353364 Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
354365 @case '$?' in \
355366 *config.status*) \
@@ -564,7 +575,7 @@ distdir: $(DISTFILES)
564575 ! -type d ! -perm -444 -exec $(install_sh) -c -m a+r {} {} \; \
565576 || chmod -R a+r "$(distdir)"
566577 dist-gzip: distdir
567- tardir=$(distdir) && $(am__tar) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).tar.gz
578+ tardir=$(distdir) && $(am__tar) | eval GZIP= gzip $(GZIP_ENV) -c >$(distdir).tar.gz
568579 $(am__post_remove_distdir)
569580
570581 dist-bzip2: distdir
@@ -580,17 +591,17 @@ dist-xz: distdir
580591 $(am__post_remove_distdir)
581592
582593 dist-tarZ: distdir
583- @echo WARNING: "Support for shar distribution archives is" \
584- "deprecated." >&2
594+ @echo WARNING: "Support for distribution archives compressed with" \
595+ "legacy program 'compress' is deprecated." >&2
585596 @echo WARNING: "It will be removed altogether in Automake 2.0" >&2
586597 tardir=$(distdir) && $(am__tar) | compress -c >$(distdir).tar.Z
587598 $(am__post_remove_distdir)
588599
589600 dist-shar: distdir
590- @echo WARNING: "Support for distribution archives compressed with" \
591- "legacy program 'compress' is deprecated." >&2
601+ @echo WARNING: "Support for shar distribution archives is" \
602+ "deprecated." >&2
592603 @echo WARNING: "It will be removed altogether in Automake 2.0" >&2
593- shar $(distdir) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).shar.gz
604+ shar $(distdir) | eval GZIP= gzip $(GZIP_ENV) -c >$(distdir).shar.gz
594605 $(am__post_remove_distdir)
595606
596607 dist-zip: distdir
@@ -608,7 +619,7 @@ dist dist-all:
608619 distcheck: dist
609620 case '$(DIST_ARCHIVES)' in \
610621 *.tar.gz*) \
611- GZIP=$(GZIP_ENV) gzip -dc $(distdir).tar.gz | $(am__untar) ;;\
622+ eval GZIP= gzip $(GZIP_ENV) -dc $(distdir).tar.gz | $(am__untar) ;;\
612623 *.tar.bz2*) \
613624 bzip2 -dc $(distdir).tar.bz2 | $(am__untar) ;;\
614625 *.tar.lz*) \
@@ -618,23 +629,23 @@ distcheck: dist
618629 *.tar.Z*) \
619630 uncompress -c $(distdir).tar.Z | $(am__untar) ;;\
620631 *.shar.gz*) \
621- GZIP=$(GZIP_ENV) gzip -dc $(distdir).shar.gz | unshar ;;\
632+ eval GZIP= gzip $(GZIP_ENV) -dc $(distdir).shar.gz | unshar ;;\
622633 *.zip*) \
623634 unzip $(distdir).zip ;;\
624635 esac
625636 chmod -R a-w $(distdir)
626637 chmod u+w $(distdir)
627- mkdir $(distdir)/_build $(distdir)/_inst
638+ mkdir $(distdir)/_build $(distdir)/_build/sub $(distdir)/_inst
628639 chmod a-w $(distdir)
629640 test -d $(distdir)/_build || exit 0; \
630641 dc_install_base=`$(am__cd) $(distdir)/_inst && pwd | sed -e 's,^[^:\\/]:[\\/],/,'` \
631642 && dc_destdir="$${TMPDIR-/tmp}/am-dc-$$$$/" \
632643 && am__cwd=`pwd` \
633- && $(am__cd) $(distdir)/_build \
634- && ../configure \
644+ && $(am__cd) $(distdir)/_build/sub \
645+ && ../../configure \
635646 $(AM_DISTCHECK_CONFIGURE_FLAGS) \
636647 $(DISTCHECK_CONFIGURE_FLAGS) \
637- --srcdir=.. --prefix="$$dc_install_base" \
648+ --srcdir=../.. --prefix="$$dc_install_base" \
638649 && $(MAKE) $(AM_MAKEFLAGS) \
639650 && $(MAKE) $(AM_MAKEFLAGS) dvi \
640651 && $(MAKE) $(AM_MAKEFLAGS) check \
@@ -812,14 +823,16 @@ uninstall-am:
812823 mostlyclean-libtool pdf pdf-am ps ps-am tags tags-am uninstall \
813824 uninstall-am
814825
826+.PRECIOUS: Makefile
827+
815828
816829 docs:
817- cd doc/ja/;make latexpdfja; make html
818- cd doc/en/;make latexpdfja; make html
830+ cd doc/ja/;make latexpdf; make html
831+ cd doc/en/;make latexpdf; make html
819832
820833 pngdocs:
821- cd doc/ja/;sed -i -e "s/mathjax/pngmath/g" conf.py; make latexpdfja; make html
822- cd doc/en/;sed -i -e "s/mathjax/pngmath/g" conf.py; make latexpdfja; make html
834+ cd doc/ja/;sed -i -e "s/mathjax/pngmath/g" conf.py; make latexpdf; make html
835+ cd doc/en/;sed -i -e "s/mathjax/pngmath/g" conf.py; make latexpdf; make html
823836
824837 docs-clean:
825838 cd doc/ja/; make clean; sed -i -e "s/pngmath/mathjax/g" conf.py
--- a/aclocal.m4
+++ b/aclocal.m4
@@ -1,6 +1,6 @@
1-# generated automatically by aclocal 1.14.1 -*- Autoconf -*-
1+# generated automatically by aclocal 1.15.1 -*- Autoconf -*-
22
3-# Copyright (C) 1996-2013 Free Software Foundation, Inc.
3+# Copyright (C) 1996-2017 Free Software Foundation, Inc.
44
55 # This file is free software; the Free Software Foundation
66 # gives unlimited permission to copy and/or distribute it,
@@ -20,9 +20,9 @@ You have another version of autoconf. It may work, but is not guaranteed to.
2020 If you have problems, you may need to regenerate the build system entirely.
2121 To do so, use the procedure documented by the package, typically 'autoreconf'.])])
2222
23-# ===========================================================================
24-# http://www.gnu.org/software/autoconf-archive/ax_f90_module_extension.html
25-# ===========================================================================
23+# ============================================================================
24+# https://www.gnu.org/software/autoconf-archive/ax_f90_module_extension.html
25+# ============================================================================
2626 #
2727 # SYNOPSIS
2828 #
@@ -44,7 +44,7 @@ To do so, use the procedure documented by the package, typically 'autoreconf'.])
4444 # and this notice are preserved. This file is offered as-is, without any
4545 # warranty.
4646
47-#serial 11
47+#serial 12
4848
4949 AC_DEFUN([AX_F90_MODULE_EXTENSION],[
5050 AC_CACHE_CHECK([fortran 90 modules extension],
@@ -81,7 +81,7 @@ AC_LANG_POP(Fortran)
8181 ])])
8282
8383 # ===========================================================================
84-# http://www.gnu.org/software/autoconf-archive/ax_f90_module_flag.html
84+# https://www.gnu.org/software/autoconf-archive/ax_f90_module_flag.html
8585 # ===========================================================================
8686 #
8787 # SYNOPSIS
@@ -106,7 +106,7 @@ AC_LANG_POP(Fortran)
106106 # and this notice are preserved. This file is offered as-is, without any
107107 # warranty.
108108
109-#serial 13
109+#serial 14
110110
111111 AC_DEFUN([AX_F90_MODULE_FLAG],[
112112 AC_CACHE_CHECK([fortran 90 modules inclusion flag],
@@ -151,7 +151,7 @@ AC_LANG_POP(Fortran)
151151 ])])
152152
153153 # ===========================================================================
154-# http://www.gnu.org/software/autoconf-archive/ax_openmp.html
154+# https://www.gnu.org/software/autoconf-archive/ax_openmp.html
155155 # ===========================================================================
156156 #
157157 # SYNOPSIS
@@ -190,6 +190,8 @@ AC_LANG_POP(Fortran)
190190 # LICENSE
191191 #
192192 # Copyright (c) 2008 Steven G. Johnson <stevenj@alum.mit.edu>
193+# Copyright (c) 2015 John W. Peterson <jwpeterson@gmail.com>
194+# Copyright (c) 2016 Nick R. Papior <nickpapior@gmail.com>
193195 #
194196 # This program is free software: you can redistribute it and/or modify it
195197 # under the terms of the GNU General Public License as published by the
@@ -202,7 +204,7 @@ AC_LANG_POP(Fortran)
202204 # Public License for more details.
203205 #
204206 # You should have received a copy of the GNU General Public License along
205-# with this program. If not, see <http://www.gnu.org/licenses/>.
207+# with this program. If not, see <https://www.gnu.org/licenses/>.
206208 #
207209 # As a special exception, the respective Autoconf Macro's copyright owner
208210 # gives unlimited permission to copy, distribute and modify the configure
@@ -217,16 +219,19 @@ AC_LANG_POP(Fortran)
217219 # modified version of the Autoconf Macro, you may extend this special
218220 # exception to the GPL to apply to your modified version as well.
219221
220-#serial 9
222+#serial 13
221223
222224 AC_DEFUN([AX_OPENMP], [
223-AC_PREREQ(2.59) dnl for _AC_LANG_PREFIX
225+AC_PREREQ([2.69]) dnl for _AC_LANG_PREFIX
224226
225227 AC_CACHE_CHECK([for OpenMP flag of _AC_LANG compiler], ax_cv_[]_AC_LANG_ABBREV[]_openmp, [save[]_AC_LANG_PREFIX[]FLAGS=$[]_AC_LANG_PREFIX[]FLAGS
226228 ax_cv_[]_AC_LANG_ABBREV[]_openmp=unknown
227-# Flags to try: -fopenmp (gcc), -openmp (icc), -mp (SGI & PGI),
228-# -xopenmp (Sun), -omp (Tru64), -qsmp=omp (AIX), none
229-ax_openmp_flags="-fopenmp -openmp -mp -xopenmp -omp -qsmp=omp none"
229+# Flags to try: -fopenmp (gcc), -mp (SGI & PGI),
230+# -qopenmp (icc>=15), -openmp (icc),
231+# -xopenmp (Sun), -omp (Tru64),
232+# -qsmp=omp (AIX),
233+# none
234+ax_openmp_flags="-fopenmp -openmp -qopenmp -mp -xopenmp -omp -qsmp=omp none"
230235 if test "x$OPENMP_[]_AC_LANG_PREFIX[]FLAGS" != x; then
231236 ax_openmp_flags="$OPENMP_[]_AC_LANG_PREFIX[]FLAGS $ax_openmp_flags"
232237 fi
@@ -235,18 +240,27 @@ for ax_openmp_flag in $ax_openmp_flags; do
235240 none) []_AC_LANG_PREFIX[]FLAGS=$save[]_AC_LANG_PREFIX[] ;;
236241 *) []_AC_LANG_PREFIX[]FLAGS="$save[]_AC_LANG_PREFIX[]FLAGS $ax_openmp_flag" ;;
237242 esac
238- AC_TRY_LINK([#ifdef __cplusplus
239-extern "C"
240-#endif
241-void omp_set_num_threads(int);], [const int N = 100000;
242- int i, arr[N];
243+ AC_LINK_IFELSE([AC_LANG_SOURCE([[
244+@%:@include <omp.h>
245+
246+static void
247+parallel_fill(int * data, int n)
248+{
249+ int i;
250+@%:@pragma omp parallel for
251+ for (i = 0; i < n; ++i)
252+ data[i] = i;
253+}
243254
255+int
256+main()
257+{
258+ int arr[100000];
244259 omp_set_num_threads(2);
245-
246- #pragma omp parallel for
247- for (i = 0; i < N; i++) {
248- arr[i] = i;
249- }], [ax_cv_[]_AC_LANG_ABBREV[]_openmp=$ax_openmp_flag; break])
260+ parallel_fill(arr, 100000);
261+ return 0;
262+}
263+]])],[ax_cv_[]_AC_LANG_ABBREV[]_openmp=$ax_openmp_flag; break],[])
250264 done
251265 []_AC_LANG_PREFIX[]FLAGS=$save[]_AC_LANG_PREFIX[]FLAGS
252266 ])
@@ -261,7 +275,7 @@ fi
261275 ])dnl AX_OPENMP
262276
263277 # ===========================================================================
264-# http://www.gnu.org/software/autoconf-archive/ax_prog_fc_mpi.html
278+# https://www.gnu.org/software/autoconf-archive/ax_prog_fc_mpi.html
265279 # ===========================================================================
266280 #
267281 # SYNOPSIS
@@ -319,7 +333,7 @@ fi
319333 # Public License for more details.
320334 #
321335 # You should have received a copy of the GNU General Public License along
322-# with this program. If not, see <http://www.gnu.org/licenses/>.
336+# with this program. If not, see <https://www.gnu.org/licenses/>.
323337 #
324338 # As a special exception, the respective Autoconf Macro's copyright owner
325339 # gives unlimited permission to copy, distribute and modify the configure
@@ -334,7 +348,7 @@ fi
334348 # modified version of the Autoconf Macro, you may extend this special
335349 # exception to the GPL to apply to your modified version as well.
336350
337-#serial 2
351+#serial 3
338352
339353 AC_DEFUN([AX_PROG_FC_MPI], [
340354 AC_PREREQ(2.50)
@@ -423,7 +437,7 @@ AC_DEFUN([_AX_PROG_FC_MPI], [
423437 AC_PROG_FC
424438 ])dnl _AX_PROG_FC_MPI
425439
426-# Copyright (C) 2002-2013 Free Software Foundation, Inc.
440+# Copyright (C) 2002-2017 Free Software Foundation, Inc.
427441 #
428442 # This file is free software; the Free Software Foundation
429443 # gives unlimited permission to copy and/or distribute it,
@@ -435,10 +449,10 @@ AC_DEFUN([_AX_PROG_FC_MPI], [
435449 # generated from the m4 files accompanying Automake X.Y.
436450 # (This private macro should not be called outside this file.)
437451 AC_DEFUN([AM_AUTOMAKE_VERSION],
438-[am__api_version='1.14'
452+[am__api_version='1.15'
439453 dnl Some users find AM_AUTOMAKE_VERSION and mistake it for a way to
440454 dnl require some minimum version. Point them to the right macro.
441-m4_if([$1], [1.14.1], [],
455+m4_if([$1], [1.15.1], [],
442456 [AC_FATAL([Do not call $0, use AM_INIT_AUTOMAKE([$1]).])])dnl
443457 ])
444458
@@ -454,12 +468,12 @@ m4_define([_AM_AUTOCONF_VERSION], [])
454468 # Call AM_AUTOMAKE_VERSION and AM_AUTOMAKE_VERSION so they can be traced.
455469 # This function is AC_REQUIREd by AM_INIT_AUTOMAKE.
456470 AC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION],
457-[AM_AUTOMAKE_VERSION([1.14.1])dnl
471+[AM_AUTOMAKE_VERSION([1.15.1])dnl
458472 m4_ifndef([AC_AUTOCONF_VERSION],
459473 [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl
460474 _AM_AUTOCONF_VERSION(m4_defn([AC_AUTOCONF_VERSION]))])
461475
462-# Copyright (C) 2011-2013 Free Software Foundation, Inc.
476+# Copyright (C) 2011-2017 Free Software Foundation, Inc.
463477 #
464478 # This file is free software; the Free Software Foundation
465479 # gives unlimited permission to copy and/or distribute it,
@@ -521,7 +535,7 @@ AC_SUBST([AR])dnl
521535
522536 # AM_AUX_DIR_EXPAND -*- Autoconf -*-
523537
524-# Copyright (C) 2001-2013 Free Software Foundation, Inc.
538+# Copyright (C) 2001-2017 Free Software Foundation, Inc.
525539 #
526540 # This file is free software; the Free Software Foundation
527541 # gives unlimited permission to copy and/or distribute it,
@@ -566,15 +580,14 @@ AC_SUBST([AR])dnl
566580 # configured tree to be moved without reconfiguration.
567581
568582 AC_DEFUN([AM_AUX_DIR_EXPAND],
569-[dnl Rely on autoconf to set up CDPATH properly.
570-AC_PREREQ([2.50])dnl
571-# expand $ac_aux_dir to an absolute path
572-am_aux_dir=`cd $ac_aux_dir && pwd`
583+[AC_REQUIRE([AC_CONFIG_AUX_DIR_DEFAULT])dnl
584+# Expand $ac_aux_dir to an absolute path.
585+am_aux_dir=`cd "$ac_aux_dir" && pwd`
573586 ])
574587
575588 # AM_CONDITIONAL -*- Autoconf -*-
576589
577-# Copyright (C) 1997-2013 Free Software Foundation, Inc.
590+# Copyright (C) 1997-2017 Free Software Foundation, Inc.
578591 #
579592 # This file is free software; the Free Software Foundation
580593 # gives unlimited permission to copy and/or distribute it,
@@ -605,7 +618,7 @@ AC_CONFIG_COMMANDS_PRE(
605618 Usually this means the macro was only invoked conditionally.]])
606619 fi])])
607620
608-# Copyright (C) 1999-2013 Free Software Foundation, Inc.
621+# Copyright (C) 1999-2017 Free Software Foundation, Inc.
609622 #
610623 # This file is free software; the Free Software Foundation
611624 # gives unlimited permission to copy and/or distribute it,
@@ -796,7 +809,7 @@ _AM_SUBST_NOTMAKE([am__nodep])dnl
796809
797810 # Generate code to set up dependency tracking. -*- Autoconf -*-
798811
799-# Copyright (C) 1999-2013 Free Software Foundation, Inc.
812+# Copyright (C) 1999-2017 Free Software Foundation, Inc.
800813 #
801814 # This file is free software; the Free Software Foundation
802815 # gives unlimited permission to copy and/or distribute it,
@@ -872,7 +885,7 @@ AC_DEFUN([AM_OUTPUT_DEPENDENCY_COMMANDS],
872885
873886 # Do all the work for Automake. -*- Autoconf -*-
874887
875-# Copyright (C) 1996-2013 Free Software Foundation, Inc.
888+# Copyright (C) 1996-2017 Free Software Foundation, Inc.
876889 #
877890 # This file is free software; the Free Software Foundation
878891 # gives unlimited permission to copy and/or distribute it,
@@ -962,8 +975,8 @@ AC_REQUIRE([AC_PROG_MKDIR_P])dnl
962975 # <http://lists.gnu.org/archive/html/automake/2012-07/msg00001.html>
963976 # <http://lists.gnu.org/archive/html/automake/2012-07/msg00014.html>
964977 AC_SUBST([mkdir_p], ['$(MKDIR_P)'])
965-# We need awk for the "check" target. The system "awk" is bad on
966-# some platforms.
978+# We need awk for the "check" target (and possibly the TAP driver). The
979+# system "awk" is bad on some platforms.
967980 AC_REQUIRE([AC_PROG_AWK])dnl
968981 AC_REQUIRE([AC_PROG_MAKE_SET])dnl
969982 AC_REQUIRE([AM_SET_LEADING_DOT])dnl
@@ -1036,7 +1049,11 @@ to "yes", and re-run configure.
10361049 END
10371050 AC_MSG_ERROR([Your 'rm' program is bad, sorry.])
10381051 fi
1039-fi])
1052+fi
1053+dnl The trailing newline in this macro's definition is deliberate, for
1054+dnl backward compatibility and to allow trailing 'dnl'-style comments
1055+dnl after the AM_INIT_AUTOMAKE invocation. See automake bug#16841.
1056+])
10401057
10411058 dnl Hook into '_AC_COMPILER_EXEEXT' early to learn its expansion. Do not
10421059 dnl add the conditional right here, as _AC_COMPILER_EXEEXT may be further
@@ -1065,7 +1082,7 @@ for _am_header in $config_headers :; do
10651082 done
10661083 echo "timestamp for $_am_arg" >`AS_DIRNAME(["$_am_arg"])`/stamp-h[]$_am_stamp_count])
10671084
1068-# Copyright (C) 2001-2013 Free Software Foundation, Inc.
1085+# Copyright (C) 2001-2017 Free Software Foundation, Inc.
10691086 #
10701087 # This file is free software; the Free Software Foundation
10711088 # gives unlimited permission to copy and/or distribute it,
@@ -1076,7 +1093,7 @@ echo "timestamp for $_am_arg" >`AS_DIRNAME(["$_am_arg"])`/stamp-h[]$_am_stamp_co
10761093 # Define $install_sh.
10771094 AC_DEFUN([AM_PROG_INSTALL_SH],
10781095 [AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl
1079-if test x"${install_sh}" != xset; then
1096+if test x"${install_sh+set}" != xset; then
10801097 case $am_aux_dir in
10811098 *\ * | *\ *)
10821099 install_sh="\${SHELL} '$am_aux_dir/install-sh'" ;;
@@ -1086,7 +1103,7 @@ if test x"${install_sh}" != xset; then
10861103 fi
10871104 AC_SUBST([install_sh])])
10881105
1089-# Copyright (C) 2003-2013 Free Software Foundation, Inc.
1106+# Copyright (C) 2003-2017 Free Software Foundation, Inc.
10901107 #
10911108 # This file is free software; the Free Software Foundation
10921109 # gives unlimited permission to copy and/or distribute it,
@@ -1107,7 +1124,7 @@ AC_SUBST([am__leading_dot])])
11071124
11081125 # Check to see how 'make' treats includes. -*- Autoconf -*-
11091126
1110-# Copyright (C) 2001-2013 Free Software Foundation, Inc.
1127+# Copyright (C) 2001-2017 Free Software Foundation, Inc.
11111128 #
11121129 # This file is free software; the Free Software Foundation
11131130 # gives unlimited permission to copy and/or distribute it,
@@ -1157,7 +1174,7 @@ rm -f confinc confmf
11571174
11581175 # Fake the existence of programs that GNU maintainers use. -*- Autoconf -*-
11591176
1160-# Copyright (C) 1997-2013 Free Software Foundation, Inc.
1177+# Copyright (C) 1997-2017 Free Software Foundation, Inc.
11611178 #
11621179 # This file is free software; the Free Software Foundation
11631180 # gives unlimited permission to copy and/or distribute it,
@@ -1196,7 +1213,7 @@ fi
11961213
11971214 # Helper functions for option handling. -*- Autoconf -*-
11981215
1199-# Copyright (C) 2001-2013 Free Software Foundation, Inc.
1216+# Copyright (C) 2001-2017 Free Software Foundation, Inc.
12001217 #
12011218 # This file is free software; the Free Software Foundation
12021219 # gives unlimited permission to copy and/or distribute it,
@@ -1225,7 +1242,7 @@ AC_DEFUN([_AM_SET_OPTIONS],
12251242 AC_DEFUN([_AM_IF_OPTION],
12261243 [m4_ifset(_AM_MANGLE_OPTION([$1]), [$2], [$3])])
12271244
1228-# Copyright (C) 1999-2013 Free Software Foundation, Inc.
1245+# Copyright (C) 1999-2017 Free Software Foundation, Inc.
12291246 #
12301247 # This file is free software; the Free Software Foundation
12311248 # gives unlimited permission to copy and/or distribute it,
@@ -1272,7 +1289,7 @@ AC_LANG_POP([C])])
12721289 # For backward compatibility.
12731290 AC_DEFUN_ONCE([AM_PROG_CC_C_O], [AC_REQUIRE([AC_PROG_CC])])
12741291
1275-# Copyright (C) 2001-2013 Free Software Foundation, Inc.
1292+# Copyright (C) 2001-2017 Free Software Foundation, Inc.
12761293 #
12771294 # This file is free software; the Free Software Foundation
12781295 # gives unlimited permission to copy and/or distribute it,
@@ -1291,7 +1308,7 @@ AC_DEFUN([AM_RUN_LOG],
12911308
12921309 # Check to make sure that the build environment is sane. -*- Autoconf -*-
12931310
1294-# Copyright (C) 1996-2013 Free Software Foundation, Inc.
1311+# Copyright (C) 1996-2017 Free Software Foundation, Inc.
12951312 #
12961313 # This file is free software; the Free Software Foundation
12971314 # gives unlimited permission to copy and/or distribute it,
@@ -1372,7 +1389,7 @@ AC_CONFIG_COMMANDS_PRE(
13721389 rm -f conftest.file
13731390 ])
13741391
1375-# Copyright (C) 2009-2013 Free Software Foundation, Inc.
1392+# Copyright (C) 2009-2017 Free Software Foundation, Inc.
13761393 #
13771394 # This file is free software; the Free Software Foundation
13781395 # gives unlimited permission to copy and/or distribute it,
@@ -1432,7 +1449,7 @@ AC_SUBST([AM_BACKSLASH])dnl
14321449 _AM_SUBST_NOTMAKE([AM_BACKSLASH])dnl
14331450 ])
14341451
1435-# Copyright (C) 2001-2013 Free Software Foundation, Inc.
1452+# Copyright (C) 2001-2017 Free Software Foundation, Inc.
14361453 #
14371454 # This file is free software; the Free Software Foundation
14381455 # gives unlimited permission to copy and/or distribute it,
@@ -1460,7 +1477,7 @@ fi
14601477 INSTALL_STRIP_PROGRAM="\$(install_sh) -c -s"
14611478 AC_SUBST([INSTALL_STRIP_PROGRAM])])
14621479
1463-# Copyright (C) 2006-2013 Free Software Foundation, Inc.
1480+# Copyright (C) 2006-2017 Free Software Foundation, Inc.
14641481 #
14651482 # This file is free software; the Free Software Foundation
14661483 # gives unlimited permission to copy and/or distribute it,
@@ -1479,7 +1496,7 @@ AC_DEFUN([AM_SUBST_NOTMAKE], [_AM_SUBST_NOTMAKE($@)])
14791496
14801497 # Check how to create a tarball. -*- Autoconf -*-
14811498
1482-# Copyright (C) 2004-2013 Free Software Foundation, Inc.
1499+# Copyright (C) 2004-2017 Free Software Foundation, Inc.
14831500 #
14841501 # This file is free software; the Free Software Foundation
14851502 # gives unlimited permission to copy and/or distribute it,
--- a/config.h.in
+++ b/config.h.in
@@ -30,8 +30,7 @@
3030 /* Define to 1 if you have the <unistd.h> header file. */
3131 #undef HAVE_UNISTD_H
3232
33-/* Define to the sub-directory in which libtool stores uninstalled libraries.
34- */
33+/* Define to the sub-directory where libtool stores uninstalled libraries. */
3534 #undef LT_OBJDIR
3635
3736 /* Name of package */
--- a/config/ltmain.sh
+++ b/config/ltmain.sh
@@ -1,9 +1,12 @@
1+#! /bin/sh
2+## DO NOT EDIT - This file generated from ./build-aux/ltmain.in
3+## by inline-source v2014-01-03.01
14
2-# libtool (GNU libtool) 2.4.2
5+# libtool (GNU libtool) 2.4.6
6+# Provide generalized library-building support services.
37 # Written by Gordon Matzigkeit <gord@gnu.ai.mit.edu>, 1996
48
5-# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005, 2006,
6-# 2007, 2008, 2009, 2010, 2011 Free Software Foundation, Inc.
9+# Copyright (C) 1996-2015 Free Software Foundation, Inc.
710 # This is free software; see the source for copying conditions. There is NO
811 # warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
912
@@ -23,881 +26,2112 @@
2326 # General Public License for more details.
2427 #
2528 # You should have received a copy of the GNU General Public License
26-# along with GNU Libtool; see the file COPYING. If not, a copy
27-# can be downloaded from http://www.gnu.org/licenses/gpl.html,
28-# or obtained by writing to the Free Software Foundation, Inc.,
29-# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
29+# along with this program. If not, see <http://www.gnu.org/licenses/>.
3030
31-# Usage: $progname [OPTION]... [MODE-ARG]...
32-#
33-# Provide generalized library-building support services.
34-#
35-# --config show all configuration variables
36-# --debug enable verbose shell tracing
37-# -n, --dry-run display commands without modifying any files
38-# --features display basic configuration information and exit
39-# --mode=MODE use operation mode MODE
40-# --preserve-dup-deps don't remove duplicate dependency libraries
41-# --quiet, --silent don't print informational messages
42-# --no-quiet, --no-silent
43-# print informational messages (default)
44-# --no-warn don't display warning messages
45-# --tag=TAG use configuration variables from tag TAG
46-# -v, --verbose print more informational messages than default
47-# --no-verbose don't print the extra informational messages
48-# --version print version information
49-# -h, --help, --help-all print short, long, or detailed help message
50-#
51-# MODE must be one of the following:
52-#
53-# clean remove files from the build directory
54-# compile compile a source file into a libtool object
55-# execute automatically set library path, then run a program
56-# finish complete the installation of libtool libraries
57-# install install libraries or executables
58-# link create a library or an executable
59-# uninstall remove libraries from an installed directory
60-#
61-# MODE-ARGS vary depending on the MODE. When passed as first option,
62-# `--mode=MODE' may be abbreviated as `MODE' or a unique abbreviation of that.
63-# Try `$progname --help --mode=MODE' for a more detailed description of MODE.
64-#
65-# When reporting a bug, please describe a test case to reproduce it and
66-# include the following information:
67-#
68-# host-triplet: $host
69-# shell: $SHELL
70-# compiler: $LTCC
71-# compiler flags: $LTCFLAGS
72-# linker: $LD (gnu? $with_gnu_ld)
73-# $progname: (GNU libtool) 2.4.2 Debian-2.4.2-1.7ubuntu1
74-# automake: $automake_version
75-# autoconf: $autoconf_version
76-#
77-# Report bugs to <bug-libtool@gnu.org>.
78-# GNU libtool home page: <http://www.gnu.org/software/libtool/>.
79-# General help using GNU software: <http://www.gnu.org/gethelp/>.
8031
8132 PROGRAM=libtool
8233 PACKAGE=libtool
83-VERSION="2.4.2 Debian-2.4.2-1.7ubuntu1"
84-TIMESTAMP=""
85-package_revision=1.3337
34+VERSION="2.4.6 Debian-2.4.6-2"
35+package_revision=2.4.6
8636
87-# Be Bourne compatible
88-if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then
37+
38+## ------ ##
39+## Usage. ##
40+## ------ ##
41+
42+# Run './libtool --help' for help with using this script from the
43+# command line.
44+
45+
46+## ------------------------------- ##
47+## User overridable command paths. ##
48+## ------------------------------- ##
49+
50+# After configure completes, it has a better idea of some of the
51+# shell tools we need than the defaults used by the functions shared
52+# with bootstrap, so set those here where they can still be over-
53+# ridden by the user, but otherwise take precedence.
54+
55+: ${AUTOCONF="autoconf"}
56+: ${AUTOMAKE="automake"}
57+
58+
59+## -------------------------- ##
60+## Source external libraries. ##
61+## -------------------------- ##
62+
63+# Much of our low-level functionality needs to be sourced from external
64+# libraries, which are installed to $pkgauxdir.
65+
66+# Set a version string for this script.
67+scriptversion=2015-01-20.17; # UTC
68+
69+# General shell script boiler plate, and helper functions.
70+# Written by Gary V. Vaughan, 2004
71+
72+# Copyright (C) 2004-2015 Free Software Foundation, Inc.
73+# This is free software; see the source for copying conditions. There is NO
74+# warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
75+
76+# This program is free software; you can redistribute it and/or modify
77+# it under the terms of the GNU General Public License as published by
78+# the Free Software Foundation; either version 3 of the License, or
79+# (at your option) any later version.
80+
81+# As a special exception to the GNU General Public License, if you distribute
82+# this file as part of a program or library that is built using GNU Libtool,
83+# you may include this file under the same distribution terms that you use
84+# for the rest of that program.
85+
86+# This program is distributed in the hope that it will be useful,
87+# but WITHOUT ANY WARRANTY; without even the implied warranty of
88+# MERCHANTABILITY or FITNES FOR A PARTICULAR PURPOSE. See the GNU
89+# General Public License for more details.
90+
91+# You should have received a copy of the GNU General Public License
92+# along with this program. If not, see <http://www.gnu.org/licenses/>.
93+
94+# Please report bugs or propose patches to gary@gnu.org.
95+
96+
97+## ------ ##
98+## Usage. ##
99+## ------ ##
100+
101+# Evaluate this file near the top of your script to gain access to
102+# the functions and variables defined here:
103+#
104+# . `echo "$0" | ${SED-sed} 's|[^/]*$||'`/build-aux/funclib.sh
105+#
106+# If you need to override any of the default environment variable
107+# settings, do that before evaluating this file.
108+
109+
110+## -------------------- ##
111+## Shell normalisation. ##
112+## -------------------- ##
113+
114+# Some shells need a little help to be as Bourne compatible as possible.
115+# Before doing anything else, make sure all that help has been provided!
116+
117+DUALCASE=1; export DUALCASE # for MKS sh
118+if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then :
89119 emulate sh
90120 NULLCMD=:
91- # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which
121+ # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which
92122 # is contrary to our usage. Disable this feature.
93123 alias -g '${1+"$@"}'='"$@"'
94124 setopt NO_GLOB_SUBST
95125 else
96- case `(set -o) 2>/dev/null` in *posix*) set -o posix;; esac
126+ case `(set -o) 2>/dev/null` in *posix*) set -o posix ;; esac
97127 fi
98-BIN_SH=xpg4; export BIN_SH # for Tru64
99-DUALCASE=1; export DUALCASE # for MKS sh
100-
101-# A function that is used when there is no print builtin or printf.
102-func_fallback_echo ()
103-{
104- eval 'cat <<_LTECHO_EOF
105-$1
106-_LTECHO_EOF'
107-}
108128
109-# NLS nuisances: We save the old values to restore during execute mode.
110-lt_user_locale=
111-lt_safe_locale=
112-for lt_var in LANG LANGUAGE LC_ALL LC_CTYPE LC_COLLATE LC_MESSAGES
129+# NLS nuisances: We save the old values in case they are required later.
130+_G_user_locale=
131+_G_safe_locale=
132+for _G_var in LANG LANGUAGE LC_ALL LC_CTYPE LC_COLLATE LC_MESSAGES
113133 do
114- eval "if test \"\${$lt_var+set}\" = set; then
115- save_$lt_var=\$$lt_var
116- $lt_var=C
117- export $lt_var
118- lt_user_locale=\"$lt_var=\\\$save_\$lt_var; \$lt_user_locale\"
119- lt_safe_locale=\"$lt_var=C; \$lt_safe_locale\"
134+ eval "if test set = \"\${$_G_var+set}\"; then
135+ save_$_G_var=\$$_G_var
136+ $_G_var=C
137+ export $_G_var
138+ _G_user_locale=\"$_G_var=\\\$save_\$_G_var; \$_G_user_locale\"
139+ _G_safe_locale=\"$_G_var=C; \$_G_safe_locale\"
120140 fi"
121141 done
122-LC_ALL=C
123-LANGUAGE=C
124-export LANGUAGE LC_ALL
125142
126-$lt_unset CDPATH
143+# CDPATH.
144+(unset CDPATH) >/dev/null 2>&1 && unset CDPATH
127145
146+# Make sure IFS has a sensible default
147+sp=' '
148+nl='
149+'
150+IFS="$sp $nl"
151+
152+# There are apparently some retarded systems that use ';' as a PATH separator!
153+if test "${PATH_SEPARATOR+set}" != set; then
154+ PATH_SEPARATOR=:
155+ (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && {
156+ (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 ||
157+ PATH_SEPARATOR=';'
158+ }
159+fi
128160
129-# Work around backward compatibility issue on IRIX 6.5. On IRIX 6.4+, sh
130-# is ksh but when the shell is invoked as "sh" and the current value of
131-# the _XPG environment variable is not equal to 1 (one), the special
132-# positional parameter $0, within a function call, is the name of the
133-# function.
134-progpath="$0"
135161
136162
163+## ------------------------- ##
164+## Locate command utilities. ##
165+## ------------------------- ##
166+
167+
168+# func_executable_p FILE
169+# ----------------------
170+# Check that FILE is an executable regular file.
171+func_executable_p ()
172+{
173+ test -f "$1" && test -x "$1"
174+}
175+
176+
177+# func_path_progs PROGS_LIST CHECK_FUNC [PATH]
178+# --------------------------------------------
179+# Search for either a program that responds to --version with output
180+# containing "GNU", or else returned by CHECK_FUNC otherwise, by
181+# trying all the directories in PATH with each of the elements of
182+# PROGS_LIST.
183+#
184+# CHECK_FUNC should accept the path to a candidate program, and
185+# set $func_check_prog_result if it truncates its output less than
186+# $_G_path_prog_max characters.
187+func_path_progs ()
188+{
189+ _G_progs_list=$1
190+ _G_check_func=$2
191+ _G_PATH=${3-"$PATH"}
192+
193+ _G_path_prog_max=0
194+ _G_path_prog_found=false
195+ _G_save_IFS=$IFS; IFS=${PATH_SEPARATOR-:}
196+ for _G_dir in $_G_PATH; do
197+ IFS=$_G_save_IFS
198+ test -z "$_G_dir" && _G_dir=.
199+ for _G_prog_name in $_G_progs_list; do
200+ for _exeext in '' .EXE; do
201+ _G_path_prog=$_G_dir/$_G_prog_name$_exeext
202+ func_executable_p "$_G_path_prog" || continue
203+ case `"$_G_path_prog" --version 2>&1` in
204+ *GNU*) func_path_progs_result=$_G_path_prog _G_path_prog_found=: ;;
205+ *) $_G_check_func $_G_path_prog
206+ func_path_progs_result=$func_check_prog_result
207+ ;;
208+ esac
209+ $_G_path_prog_found && break 3
210+ done
211+ done
212+ done
213+ IFS=$_G_save_IFS
214+ test -z "$func_path_progs_result" && {
215+ echo "no acceptable sed could be found in \$PATH" >&2
216+ exit 1
217+ }
218+}
219+
220+
221+# We want to be able to use the functions in this file before configure
222+# has figured out where the best binaries are kept, which means we have
223+# to search for them ourselves - except when the results are already set
224+# where we skip the searches.
225+
226+# Unless the user overrides by setting SED, search the path for either GNU
227+# sed, or the sed that truncates its output the least.
228+test -z "$SED" && {
229+ _G_sed_script=s/aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb/
230+ for _G_i in 1 2 3 4 5 6 7; do
231+ _G_sed_script=$_G_sed_script$nl$_G_sed_script
232+ done
233+ echo "$_G_sed_script" 2>/dev/null | sed 99q >conftest.sed
234+ _G_sed_script=
235+
236+ func_check_prog_sed ()
237+ {
238+ _G_path_prog=$1
239+
240+ _G_count=0
241+ printf 0123456789 >conftest.in
242+ while :
243+ do
244+ cat conftest.in conftest.in >conftest.tmp
245+ mv conftest.tmp conftest.in
246+ cp conftest.in conftest.nl
247+ echo '' >> conftest.nl
248+ "$_G_path_prog" -f conftest.sed <conftest.nl >conftest.out 2>/dev/null || break
249+ diff conftest.out conftest.nl >/dev/null 2>&1 || break
250+ _G_count=`expr $_G_count + 1`
251+ if test "$_G_count" -gt "$_G_path_prog_max"; then
252+ # Best one so far, save it but keep looking for a better one
253+ func_check_prog_result=$_G_path_prog
254+ _G_path_prog_max=$_G_count
255+ fi
256+ # 10*(2^10) chars as input seems more than enough
257+ test 10 -lt "$_G_count" && break
258+ done
259+ rm -f conftest.in conftest.tmp conftest.nl conftest.out
260+ }
261+
262+ func_path_progs "sed gsed" func_check_prog_sed $PATH:/usr/xpg4/bin
263+ rm -f conftest.sed
264+ SED=$func_path_progs_result
265+}
266+
267+
268+# Unless the user overrides by setting GREP, search the path for either GNU
269+# grep, or the grep that truncates its output the least.
270+test -z "$GREP" && {
271+ func_check_prog_grep ()
272+ {
273+ _G_path_prog=$1
274+
275+ _G_count=0
276+ _G_path_prog_max=0
277+ printf 0123456789 >conftest.in
278+ while :
279+ do
280+ cat conftest.in conftest.in >conftest.tmp
281+ mv conftest.tmp conftest.in
282+ cp conftest.in conftest.nl
283+ echo 'GREP' >> conftest.nl
284+ "$_G_path_prog" -e 'GREP$' -e '-(cannot match)-' <conftest.nl >conftest.out 2>/dev/null || break
285+ diff conftest.out conftest.nl >/dev/null 2>&1 || break
286+ _G_count=`expr $_G_count + 1`
287+ if test "$_G_count" -gt "$_G_path_prog_max"; then
288+ # Best one so far, save it but keep looking for a better one
289+ func_check_prog_result=$_G_path_prog
290+ _G_path_prog_max=$_G_count
291+ fi
292+ # 10*(2^10) chars as input seems more than enough
293+ test 10 -lt "$_G_count" && break
294+ done
295+ rm -f conftest.in conftest.tmp conftest.nl conftest.out
296+ }
297+
298+ func_path_progs "grep ggrep" func_check_prog_grep $PATH:/usr/xpg4/bin
299+ GREP=$func_path_progs_result
300+}
301+
302+
303+## ------------------------------- ##
304+## User overridable command paths. ##
305+## ------------------------------- ##
306+
307+# All uppercase variable names are used for environment variables. These
308+# variables can be overridden by the user before calling a script that
309+# uses them if a suitable command of that name is not already available
310+# in the command search PATH.
137311
138312 : ${CP="cp -f"}
139-test "${ECHO+set}" = set || ECHO=${as_echo-'printf %s\n'}
313+: ${ECHO="printf %s\n"}
314+: ${EGREP="$GREP -E"}
315+: ${FGREP="$GREP -F"}
316+: ${LN_S="ln -s"}
140317 : ${MAKE="make"}
141318 : ${MKDIR="mkdir"}
142319 : ${MV="mv -f"}
143320 : ${RM="rm -f"}
144321 : ${SHELL="${CONFIG_SHELL-/bin/sh}"}
145-: ${Xsed="$SED -e 1s/^X//"}
146-
147-# Global variables:
148-EXIT_SUCCESS=0
149-EXIT_FAILURE=1
150-EXIT_MISMATCH=63 # $? = 63 is used to indicate version mismatch to missing.
151-EXIT_SKIP=77 # $? = 77 is used to indicate a skipped test to automake.
152-
153-exit_status=$EXIT_SUCCESS
154-
155-# Make sure IFS has a sensible default
156-lt_nl='
157-'
158-IFS=" $lt_nl"
159322
160-dirname="s,/[^/]*$,,"
161-basename="s,^.*/,,"
162323
163-# func_dirname file append nondir_replacement
164-# Compute the dirname of FILE. If nonempty, add APPEND to the result,
165-# otherwise set result to NONDIR_REPLACEMENT.
166-func_dirname ()
167-{
168- func_dirname_result=`$ECHO "${1}" | $SED "$dirname"`
169- if test "X$func_dirname_result" = "X${1}"; then
170- func_dirname_result="${3}"
171- else
172- func_dirname_result="$func_dirname_result${2}"
173- fi
174-} # func_dirname may be replaced by extended shell implementation
324+## -------------------- ##
325+## Useful sed snippets. ##
326+## -------------------- ##
175327
328+sed_dirname='s|/[^/]*$||'
329+sed_basename='s|^.*/||'
176330
177-# func_basename file
178-func_basename ()
179-{
180- func_basename_result=`$ECHO "${1}" | $SED "$basename"`
181-} # func_basename may be replaced by extended shell implementation
331+# Sed substitution that helps us do robust quoting. It backslashifies
332+# metacharacters that are still active within double-quoted strings.
333+sed_quote_subst='s|\([`"$\\]\)|\\\1|g'
182334
335+# Same as above, but do not quote variable references.
336+sed_double_quote_subst='s/\(["`\\]\)/\\\1/g'
183337
184-# func_dirname_and_basename file append nondir_replacement
185-# perform func_basename and func_dirname in a single function
186-# call:
187-# dirname: Compute the dirname of FILE. If nonempty,
188-# add APPEND to the result, otherwise set result
189-# to NONDIR_REPLACEMENT.
190-# value returned in "$func_dirname_result"
191-# basename: Compute filename of FILE.
192-# value retuned in "$func_basename_result"
193-# Implementation must be kept synchronized with func_dirname
194-# and func_basename. For efficiency, we do not delegate to
195-# those functions but instead duplicate the functionality here.
196-func_dirname_and_basename ()
197-{
198- # Extract subdirectory from the argument.
199- func_dirname_result=`$ECHO "${1}" | $SED -e "$dirname"`
200- if test "X$func_dirname_result" = "X${1}"; then
201- func_dirname_result="${3}"
202- else
203- func_dirname_result="$func_dirname_result${2}"
204- fi
205- func_basename_result=`$ECHO "${1}" | $SED -e "$basename"`
206-} # func_dirname_and_basename may be replaced by extended shell implementation
338+# Sed substitution that turns a string into a regex matching for the
339+# string literally.
340+sed_make_literal_regex='s|[].[^$\\*\/]|\\&|g'
207341
342+# Sed substitution that converts a w32 file name or path
343+# that contains forward slashes, into one that contains
344+# (escaped) backslashes. A very naive implementation.
345+sed_naive_backslashify='s|\\\\*|\\|g;s|/|\\|g;s|\\|\\\\|g'
346+
347+# Re-'\' parameter expansions in output of sed_double_quote_subst that
348+# were '\'-ed in input to the same. If an odd number of '\' preceded a
349+# '$' in input to sed_double_quote_subst, that '$' was protected from
350+# expansion. Since each input '\' is now two '\'s, look for any number
351+# of runs of four '\'s followed by two '\'s and then a '$'. '\' that '$'.
352+_G_bs='\\'
353+_G_bs2='\\\\'
354+_G_bs4='\\\\\\\\'
355+_G_dollar='\$'
356+sed_double_backslash="\
357+ s/$_G_bs4/&\\
358+/g
359+ s/^$_G_bs2$_G_dollar/$_G_bs&/
360+ s/\\([^$_G_bs]\\)$_G_bs2$_G_dollar/\\1$_G_bs2$_G_bs$_G_dollar/g
361+ s/\n//g"
208362
209-# func_stripname prefix suffix name
210-# strip PREFIX and SUFFIX off of NAME.
211-# PREFIX and SUFFIX must not contain globbing or regex special
212-# characters, hashes, percent signs, but SUFFIX may contain a leading
213-# dot (in which case that matches only a dot).
214-# func_strip_suffix prefix name
215-func_stripname ()
216-{
217- case ${2} in
218- .*) func_stripname_result=`$ECHO "${3}" | $SED "s%^${1}%%; s%\\\\${2}\$%%"`;;
219- *) func_stripname_result=`$ECHO "${3}" | $SED "s%^${1}%%; s%${2}\$%%"`;;
220- esac
221-} # func_stripname may be replaced by extended shell implementation
222363
364+## ----------------- ##
365+## Global variables. ##
366+## ----------------- ##
223367
224-# These SED scripts presuppose an absolute path with a trailing slash.
225-pathcar='s,^/\([^/]*\).*$,\1,'
226-pathcdr='s,^/[^/]*,,'
227-removedotparts=':dotsl
228- s@/\./@/@g
229- t dotsl
230- s,/\.$,/,'
231-collapseslashes='s@/\{1,\}@/@g'
232-finalslash='s,/*$,/,'
368+# Except for the global variables explicitly listed below, the following
369+# functions in the '^func_' namespace, and the '^require_' namespace
370+# variables initialised in the 'Resource management' section, sourcing
371+# this file will not pollute your global namespace with anything
372+# else. There's no portable way to scope variables in Bourne shell
373+# though, so actually running these functions will sometimes place
374+# results into a variable named after the function, and often use
375+# temporary variables in the '^_G_' namespace. If you are careful to
376+# avoid using those namespaces casually in your sourcing script, things
377+# should continue to work as you expect. And, of course, you can freely
378+# overwrite any of the functions or variables defined here before
379+# calling anything to customize them.
233380
234-# func_normal_abspath PATH
235-# Remove doubled-up and trailing slashes, "." path components,
236-# and cancel out any ".." path components in PATH after making
237-# it an absolute path.
238-# value returned in "$func_normal_abspath_result"
239-func_normal_abspath ()
240-{
241- # Start from root dir and reassemble the path.
242- func_normal_abspath_result=
243- func_normal_abspath_tpath=$1
244- func_normal_abspath_altnamespace=
245- case $func_normal_abspath_tpath in
246- "")
247- # Empty path, that just means $cwd.
248- func_stripname '' '/' "`pwd`"
249- func_normal_abspath_result=$func_stripname_result
250- return
251- ;;
252- # The next three entries are used to spot a run of precisely
253- # two leading slashes without using negated character classes;
254- # we take advantage of case's first-match behaviour.
255- ///*)
256- # Unusual form of absolute path, do nothing.
257- ;;
258- //*)
259- # Not necessarily an ordinary path; POSIX reserves leading '//'
260- # and for example Cygwin uses it to access remote file shares
261- # over CIFS/SMB, so we conserve a leading double slash if found.
262- func_normal_abspath_altnamespace=/
263- ;;
264- /*)
265- # Absolute path, do nothing.
266- ;;
267- *)
268- # Relative path, prepend $cwd.
269- func_normal_abspath_tpath=`pwd`/$func_normal_abspath_tpath
270- ;;
271- esac
272- # Cancel out all the simple stuff to save iterations. We also want
273- # the path to end with a slash for ease of parsing, so make sure
274- # there is one (and only one) here.
275- func_normal_abspath_tpath=`$ECHO "$func_normal_abspath_tpath" | $SED \
276- -e "$removedotparts" -e "$collapseslashes" -e "$finalslash"`
277- while :; do
278- # Processed it all yet?
279- if test "$func_normal_abspath_tpath" = / ; then
280- # If we ascended to the root using ".." the result may be empty now.
281- if test -z "$func_normal_abspath_result" ; then
282- func_normal_abspath_result=/
283- fi
284- break
285- fi
286- func_normal_abspath_tcomponent=`$ECHO "$func_normal_abspath_tpath" | $SED \
287- -e "$pathcar"`
288- func_normal_abspath_tpath=`$ECHO "$func_normal_abspath_tpath" | $SED \
289- -e "$pathcdr"`
290- # Figure out what to do with it
291- case $func_normal_abspath_tcomponent in
292- "")
293- # Trailing empty path component, ignore it.
294- ;;
295- ..)
296- # Parent dir; strip last assembled component from result.
297- func_dirname "$func_normal_abspath_result"
298- func_normal_abspath_result=$func_dirname_result
299- ;;
300- *)
301- # Actual path component, append it.
302- func_normal_abspath_result=$func_normal_abspath_result/$func_normal_abspath_tcomponent
303- ;;
304- esac
305- done
306- # Restore leading double-slash if one was found on entry.
307- func_normal_abspath_result=$func_normal_abspath_altnamespace$func_normal_abspath_result
308-}
381+EXIT_SUCCESS=0
382+EXIT_FAILURE=1
383+EXIT_MISMATCH=63 # $? = 63 is used to indicate version mismatch to missing.
384+EXIT_SKIP=77 # $? = 77 is used to indicate a skipped test to automake.
309385
310-# func_relative_path SRCDIR DSTDIR
311-# generates a relative path from SRCDIR to DSTDIR, with a trailing
312-# slash if non-empty, suitable for immediately appending a filename
313-# without needing to append a separator.
314-# value returned in "$func_relative_path_result"
315-func_relative_path ()
316-{
317- func_relative_path_result=
318- func_normal_abspath "$1"
319- func_relative_path_tlibdir=$func_normal_abspath_result
320- func_normal_abspath "$2"
321- func_relative_path_tbindir=$func_normal_abspath_result
322-
323- # Ascend the tree starting from libdir
324- while :; do
325- # check if we have found a prefix of bindir
326- case $func_relative_path_tbindir in
327- $func_relative_path_tlibdir)
328- # found an exact match
329- func_relative_path_tcancelled=
330- break
331- ;;
332- $func_relative_path_tlibdir*)
333- # found a matching prefix
334- func_stripname "$func_relative_path_tlibdir" '' "$func_relative_path_tbindir"
335- func_relative_path_tcancelled=$func_stripname_result
336- if test -z "$func_relative_path_result"; then
337- func_relative_path_result=.
338- fi
339- break
340- ;;
341- *)
342- func_dirname $func_relative_path_tlibdir
343- func_relative_path_tlibdir=${func_dirname_result}
344- if test "x$func_relative_path_tlibdir" = x ; then
345- # Have to descend all the way to the root!
346- func_relative_path_result=../$func_relative_path_result
347- func_relative_path_tcancelled=$func_relative_path_tbindir
348- break
349- fi
350- func_relative_path_result=../$func_relative_path_result
351- ;;
352- esac
353- done
386+# Allow overriding, eg assuming that you follow the convention of
387+# putting '$debug_cmd' at the start of all your functions, you can get
388+# bash to show function call trace with:
389+#
390+# debug_cmd='eval echo "${FUNCNAME[0]} $*" >&2' bash your-script-name
391+debug_cmd=${debug_cmd-":"}
392+exit_cmd=:
354393
355- # Now calculate path; take care to avoid doubling-up slashes.
356- func_stripname '' '/' "$func_relative_path_result"
357- func_relative_path_result=$func_stripname_result
358- func_stripname '/' '/' "$func_relative_path_tcancelled"
359- if test "x$func_stripname_result" != x ; then
360- func_relative_path_result=${func_relative_path_result}/${func_stripname_result}
361- fi
394+# By convention, finish your script with:
395+#
396+# exit $exit_status
397+#
398+# so that you can set exit_status to non-zero if you want to indicate
399+# something went wrong during execution without actually bailing out at
400+# the point of failure.
401+exit_status=$EXIT_SUCCESS
362402
363- # Normalisation. If bindir is libdir, return empty string,
364- # else relative path ending with a slash; either way, target
365- # file name can be directly appended.
366- if test ! -z "$func_relative_path_result"; then
367- func_stripname './' '' "$func_relative_path_result/"
368- func_relative_path_result=$func_stripname_result
369- fi
370-}
403+# Work around backward compatibility issue on IRIX 6.5. On IRIX 6.4+, sh
404+# is ksh but when the shell is invoked as "sh" and the current value of
405+# the _XPG environment variable is not equal to 1 (one), the special
406+# positional parameter $0, within a function call, is the name of the
407+# function.
408+progpath=$0
371409
372-# The name of this program:
373-func_dirname_and_basename "$progpath"
374-progname=$func_basename_result
410+# The name of this program.
411+progname=`$ECHO "$progpath" |$SED "$sed_basename"`
375412
376-# Make sure we have an absolute path for reexecution:
413+# Make sure we have an absolute progpath for reexecution:
377414 case $progpath in
378415 [\\/]*|[A-Za-z]:\\*) ;;
379416 *[\\/]*)
380- progdir=$func_dirname_result
417+ progdir=`$ECHO "$progpath" |$SED "$sed_dirname"`
381418 progdir=`cd "$progdir" && pwd`
382- progpath="$progdir/$progname"
419+ progpath=$progdir/$progname
383420 ;;
384421 *)
385- save_IFS="$IFS"
422+ _G_IFS=$IFS
386423 IFS=${PATH_SEPARATOR-:}
387424 for progdir in $PATH; do
388- IFS="$save_IFS"
425+ IFS=$_G_IFS
389426 test -x "$progdir/$progname" && break
390427 done
391- IFS="$save_IFS"
428+ IFS=$_G_IFS
392429 test -n "$progdir" || progdir=`pwd`
393- progpath="$progdir/$progname"
430+ progpath=$progdir/$progname
394431 ;;
395432 esac
396433
397-# Sed substitution that helps us do robust quoting. It backslashifies
398-# metacharacters that are still active within double-quoted strings.
399-Xsed="${SED}"' -e 1s/^X//'
400-sed_quote_subst='s/\([`"$\\]\)/\\\1/g'
401-
402-# Same as above, but do not quote variable references.
403-double_quote_subst='s/\(["`\\]\)/\\\1/g'
404434
405-# Sed substitution that turns a string into a regex matching for the
406-# string literally.
407-sed_make_literal_regex='s,[].[^$\\*\/],\\&,g'
435+## ----------------- ##
436+## Standard options. ##
437+## ----------------- ##
408438
409-# Sed substitution that converts a w32 file name or path
410-# which contains forward slashes, into one that contains
411-# (escaped) backslashes. A very naive implementation.
412-lt_sed_naive_backslashify='s|\\\\*|\\|g;s|/|\\|g;s|\\|\\\\|g'
413-
414-# Re-`\' parameter expansions in output of double_quote_subst that were
415-# `\'-ed in input to the same. If an odd number of `\' preceded a '$'
416-# in input to double_quote_subst, that '$' was protected from expansion.
417-# Since each input `\' is now two `\'s, look for any number of runs of
418-# four `\'s followed by two `\'s and then a '$'. `\' that '$'.
419-bs='\\'
420-bs2='\\\\'
421-bs4='\\\\\\\\'
422-dollar='\$'
423-sed_double_backslash="\
424- s/$bs4/&\\
425-/g
426- s/^$bs2$dollar/$bs&/
427- s/\\([^$bs]\\)$bs2$dollar/\\1$bs2$bs$dollar/g
428- s/\n//g"
439+# The following options affect the operation of the functions defined
440+# below, and should be set appropriately depending on run-time para-
441+# meters passed on the command line.
429442
430-# Standard options:
431443 opt_dry_run=false
432-opt_help=false
433444 opt_quiet=false
434445 opt_verbose=false
435-opt_warning=:
436446
437-# func_echo arg...
438-# Echo program name prefixed message, along with the current mode
439-# name if it has been set yet.
440-func_echo ()
441-{
442- $ECHO "$progname: ${opt_mode+$opt_mode: }$*"
443-}
447+# Categories 'all' and 'none' are always available. Append any others
448+# you will pass as the first argument to func_warning from your own
449+# code.
450+warning_categories=
444451
445-# func_verbose arg...
446-# Echo program name prefixed message in verbose mode only.
447-func_verbose ()
448-{
449- $opt_verbose && func_echo ${1+"$@"}
452+# By default, display warnings according to 'opt_warning_types'. Set
453+# 'warning_func' to ':' to elide all warnings, or func_fatal_error to
454+# treat the next displayed warning as a fatal error.
455+warning_func=func_warn_and_continue
450456
451- # A bug in bash halts the script if the last line of a function
452- # fails when set -e is in force, so we need another command to
453- # work around that:
454- :
455-}
457+# Set to 'all' to display all warnings, 'none' to suppress all
458+# warnings, or a space delimited list of some subset of
459+# 'warning_categories' to display only the listed warnings.
460+opt_warning_types=all
456461
457-# func_echo_all arg...
458-# Invoke $ECHO with all args, space-separated.
459-func_echo_all ()
460-{
461- $ECHO "$*"
462-}
463462
464-# func_error arg...
465-# Echo program name prefixed message to standard error.
466-func_error ()
467-{
468- $ECHO "$progname: ${opt_mode+$opt_mode: }"${1+"$@"} 1>&2
469-}
463+## -------------------- ##
464+## Resource management. ##
465+## -------------------- ##
470466
471-# func_warning arg...
472-# Echo program name prefixed warning message to standard error.
473-func_warning ()
474-{
475- $opt_warning && $ECHO "$progname: ${opt_mode+$opt_mode: }warning: "${1+"$@"} 1>&2
467+# This section contains definitions for functions that each ensure a
468+# particular resource (a file, or a non-empty configuration variable for
469+# example) is available, and if appropriate to extract default values
470+# from pertinent package files. Call them using their associated
471+# 'require_*' variable to ensure that they are executed, at most, once.
472+#
473+# It's entirely deliberate that calling these functions can set
474+# variables that don't obey the namespace limitations obeyed by the rest
475+# of this file, in order that that they be as useful as possible to
476+# callers.
476477
477- # bash bug again:
478- :
479-}
480478
481-# func_fatal_error arg...
482-# Echo program name prefixed message to standard error, and exit.
483-func_fatal_error ()
479+# require_term_colors
480+# -------------------
481+# Allow display of bold text on terminals that support it.
482+require_term_colors=func_require_term_colors
483+func_require_term_colors ()
484484 {
485- func_error ${1+"$@"}
486- exit $EXIT_FAILURE
487-}
485+ $debug_cmd
486+
487+ test -t 1 && {
488+ # COLORTERM and USE_ANSI_COLORS environment variables take
489+ # precedence, because most terminfo databases neglect to describe
490+ # whether color sequences are supported.
491+ test -n "${COLORTERM+set}" && : ${USE_ANSI_COLORS="1"}
492+
493+ if test 1 = "$USE_ANSI_COLORS"; then
494+ # Standard ANSI escape sequences
495+ tc_reset=''
496+ tc_bold=''; tc_standout=''
497+ tc_red=''; tc_green=''
498+ tc_blue=''; tc_cyan=''
499+ else
500+ # Otherwise trust the terminfo database after all.
501+ test -n "`tput sgr0 2>/dev/null`" && {
502+ tc_reset=`tput sgr0`
503+ test -n "`tput bold 2>/dev/null`" && tc_bold=`tput bold`
504+ tc_standout=$tc_bold
505+ test -n "`tput smso 2>/dev/null`" && tc_standout=`tput smso`
506+ test -n "`tput setaf 1 2>/dev/null`" && tc_red=`tput setaf 1`
507+ test -n "`tput setaf 2 2>/dev/null`" && tc_green=`tput setaf 2`
508+ test -n "`tput setaf 4 2>/dev/null`" && tc_blue=`tput setaf 4`
509+ test -n "`tput setaf 5 2>/dev/null`" && tc_cyan=`tput setaf 5`
510+ }
511+ fi
512+ }
488513
489-# func_fatal_help arg...
490-# Echo program name prefixed message to standard error, followed by
491-# a help hint, and exit.
492-func_fatal_help ()
493-{
494- func_error ${1+"$@"}
495- func_fatal_error "$help"
514+ require_term_colors=:
496515 }
497-help="Try \`$progname --help' for more information." ## default
498516
499517
500-# func_grep expression filename
518+## ----------------- ##
519+## Function library. ##
520+## ----------------- ##
521+
522+# This section contains a variety of useful functions to call in your
523+# scripts. Take note of the portable wrappers for features provided by
524+# some modern shells, which will fall back to slower equivalents on
525+# less featureful shells.
526+
527+
528+# func_append VAR VALUE
529+# ---------------------
530+# Append VALUE onto the existing contents of VAR.
531+
532+ # We should try to minimise forks, especially on Windows where they are
533+ # unreasonably slow, so skip the feature probes when bash or zsh are
534+ # being used:
535+ if test set = "${BASH_VERSION+set}${ZSH_VERSION+set}"; then
536+ : ${_G_HAVE_ARITH_OP="yes"}
537+ : ${_G_HAVE_XSI_OPS="yes"}
538+ # The += operator was introduced in bash 3.1
539+ case $BASH_VERSION in
540+ [12].* | 3.0 | 3.0*) ;;
541+ *)
542+ : ${_G_HAVE_PLUSEQ_OP="yes"}
543+ ;;
544+ esac
545+ fi
546+
547+ # _G_HAVE_PLUSEQ_OP
548+ # Can be empty, in which case the shell is probed, "yes" if += is
549+ # useable or anything else if it does not work.
550+ test -z "$_G_HAVE_PLUSEQ_OP" \
551+ && (eval 'x=a; x+=" b"; test "a b" = "$x"') 2>/dev/null \
552+ && _G_HAVE_PLUSEQ_OP=yes
553+
554+if test yes = "$_G_HAVE_PLUSEQ_OP"
555+then
556+ # This is an XSI compatible shell, allowing a faster implementation...
557+ eval 'func_append ()
558+ {
559+ $debug_cmd
560+
561+ eval "$1+=\$2"
562+ }'
563+else
564+ # ...otherwise fall back to using expr, which is often a shell builtin.
565+ func_append ()
566+ {
567+ $debug_cmd
568+
569+ eval "$1=\$$1\$2"
570+ }
571+fi
572+
573+
574+# func_append_quoted VAR VALUE
575+# ----------------------------
576+# Quote VALUE and append to the end of shell variable VAR, separated
577+# by a space.
578+if test yes = "$_G_HAVE_PLUSEQ_OP"; then
579+ eval 'func_append_quoted ()
580+ {
581+ $debug_cmd
582+
583+ func_quote_for_eval "$2"
584+ eval "$1+=\\ \$func_quote_for_eval_result"
585+ }'
586+else
587+ func_append_quoted ()
588+ {
589+ $debug_cmd
590+
591+ func_quote_for_eval "$2"
592+ eval "$1=\$$1\\ \$func_quote_for_eval_result"
593+ }
594+fi
595+
596+
597+# func_append_uniq VAR VALUE
598+# --------------------------
599+# Append unique VALUE onto the existing contents of VAR, assuming
600+# entries are delimited by the first character of VALUE. For example:
601+#
602+# func_append_uniq options " --another-option option-argument"
603+#
604+# will only append to $options if " --another-option option-argument "
605+# is not already present somewhere in $options already (note spaces at
606+# each end implied by leading space in second argument).
607+func_append_uniq ()
608+{
609+ $debug_cmd
610+
611+ eval _G_current_value='`$ECHO $'$1'`'
612+ _G_delim=`expr "$2" : '\(.\)'`
613+
614+ case $_G_delim$_G_current_value$_G_delim in
615+ *"$2$_G_delim"*) ;;
616+ *) func_append "$@" ;;
617+ esac
618+}
619+
620+
621+# func_arith TERM...
622+# ------------------
623+# Set func_arith_result to the result of evaluating TERMs.
624+ test -z "$_G_HAVE_ARITH_OP" \
625+ && (eval 'test 2 = $(( 1 + 1 ))') 2>/dev/null \
626+ && _G_HAVE_ARITH_OP=yes
627+
628+if test yes = "$_G_HAVE_ARITH_OP"; then
629+ eval 'func_arith ()
630+ {
631+ $debug_cmd
632+
633+ func_arith_result=$(( $* ))
634+ }'
635+else
636+ func_arith ()
637+ {
638+ $debug_cmd
639+
640+ func_arith_result=`expr "$@"`
641+ }
642+fi
643+
644+
645+# func_basename FILE
646+# ------------------
647+# Set func_basename_result to FILE with everything up to and including
648+# the last / stripped.
649+if test yes = "$_G_HAVE_XSI_OPS"; then
650+ # If this shell supports suffix pattern removal, then use it to avoid
651+ # forking. Hide the definitions single quotes in case the shell chokes
652+ # on unsupported syntax...
653+ _b='func_basename_result=${1##*/}'
654+ _d='case $1 in
655+ */*) func_dirname_result=${1%/*}$2 ;;
656+ * ) func_dirname_result=$3 ;;
657+ esac'
658+
659+else
660+ # ...otherwise fall back to using sed.
661+ _b='func_basename_result=`$ECHO "$1" |$SED "$sed_basename"`'
662+ _d='func_dirname_result=`$ECHO "$1" |$SED "$sed_dirname"`
663+ if test "X$func_dirname_result" = "X$1"; then
664+ func_dirname_result=$3
665+ else
666+ func_append func_dirname_result "$2"
667+ fi'
668+fi
669+
670+eval 'func_basename ()
671+{
672+ $debug_cmd
673+
674+ '"$_b"'
675+}'
676+
677+
678+# func_dirname FILE APPEND NONDIR_REPLACEMENT
679+# -------------------------------------------
680+# Compute the dirname of FILE. If nonempty, add APPEND to the result,
681+# otherwise set result to NONDIR_REPLACEMENT.
682+eval 'func_dirname ()
683+{
684+ $debug_cmd
685+
686+ '"$_d"'
687+}'
688+
689+
690+# func_dirname_and_basename FILE APPEND NONDIR_REPLACEMENT
691+# --------------------------------------------------------
692+# Perform func_basename and func_dirname in a single function
693+# call:
694+# dirname: Compute the dirname of FILE. If nonempty,
695+# add APPEND to the result, otherwise set result
696+# to NONDIR_REPLACEMENT.
697+# value returned in "$func_dirname_result"
698+# basename: Compute filename of FILE.
699+# value retuned in "$func_basename_result"
700+# For efficiency, we do not delegate to the functions above but instead
701+# duplicate the functionality here.
702+eval 'func_dirname_and_basename ()
703+{
704+ $debug_cmd
705+
706+ '"$_b"'
707+ '"$_d"'
708+}'
709+
710+
711+# func_echo ARG...
712+# ----------------
713+# Echo program name prefixed message.
714+func_echo ()
715+{
716+ $debug_cmd
717+
718+ _G_message=$*
719+
720+ func_echo_IFS=$IFS
721+ IFS=$nl
722+ for _G_line in $_G_message; do
723+ IFS=$func_echo_IFS
724+ $ECHO "$progname: $_G_line"
725+ done
726+ IFS=$func_echo_IFS
727+}
728+
729+
730+# func_echo_all ARG...
731+# --------------------
732+# Invoke $ECHO with all args, space-separated.
733+func_echo_all ()
734+{
735+ $ECHO "$*"
736+}
737+
738+
739+# func_echo_infix_1 INFIX ARG...
740+# ------------------------------
741+# Echo program name, followed by INFIX on the first line, with any
742+# additional lines not showing INFIX.
743+func_echo_infix_1 ()
744+{
745+ $debug_cmd
746+
747+ $require_term_colors
748+
749+ _G_infix=$1; shift
750+ _G_indent=$_G_infix
751+ _G_prefix="$progname: $_G_infix: "
752+ _G_message=$*
753+
754+ # Strip color escape sequences before counting printable length
755+ for _G_tc in "$tc_reset" "$tc_bold" "$tc_standout" "$tc_red" "$tc_green" "$tc_blue" "$tc_cyan"
756+ do
757+ test -n "$_G_tc" && {
758+ _G_esc_tc=`$ECHO "$_G_tc" | $SED "$sed_make_literal_regex"`
759+ _G_indent=`$ECHO "$_G_indent" | $SED "s|$_G_esc_tc||g"`
760+ }
761+ done
762+ _G_indent="$progname: "`echo "$_G_indent" | $SED 's|.| |g'`" " ## exclude from sc_prohibit_nested_quotes
763+
764+ func_echo_infix_1_IFS=$IFS
765+ IFS=$nl
766+ for _G_line in $_G_message; do
767+ IFS=$func_echo_infix_1_IFS
768+ $ECHO "$_G_prefix$tc_bold$_G_line$tc_reset" >&2
769+ _G_prefix=$_G_indent
770+ done
771+ IFS=$func_echo_infix_1_IFS
772+}
773+
774+
775+# func_error ARG...
776+# -----------------
777+# Echo program name prefixed message to standard error.
778+func_error ()
779+{
780+ $debug_cmd
781+
782+ $require_term_colors
783+
784+ func_echo_infix_1 " $tc_standout${tc_red}error$tc_reset" "$*" >&2
785+}
786+
787+
788+# func_fatal_error ARG...
789+# -----------------------
790+# Echo program name prefixed message to standard error, and exit.
791+func_fatal_error ()
792+{
793+ $debug_cmd
794+
795+ func_error "$*"
796+ exit $EXIT_FAILURE
797+}
798+
799+
800+# func_grep EXPRESSION FILENAME
801+# -----------------------------
501802 # Check whether EXPRESSION matches any line of FILENAME, without output.
502803 func_grep ()
503804 {
805+ $debug_cmd
806+
504807 $GREP "$1" "$2" >/dev/null 2>&1
505808 }
506809
507810
508-# func_mkdir_p directory-path
811+# func_len STRING
812+# ---------------
813+# Set func_len_result to the length of STRING. STRING may not
814+# start with a hyphen.
815+ test -z "$_G_HAVE_XSI_OPS" \
816+ && (eval 'x=a/b/c;
817+ test 5aa/bb/cc = "${#x}${x%%/*}${x%/*}${x#*/}${x##*/}"') 2>/dev/null \
818+ && _G_HAVE_XSI_OPS=yes
819+
820+if test yes = "$_G_HAVE_XSI_OPS"; then
821+ eval 'func_len ()
822+ {
823+ $debug_cmd
824+
825+ func_len_result=${#1}
826+ }'
827+else
828+ func_len ()
829+ {
830+ $debug_cmd
831+
832+ func_len_result=`expr "$1" : ".*" 2>/dev/null || echo $max_cmd_len`
833+ }
834+fi
835+
836+
837+# func_mkdir_p DIRECTORY-PATH
838+# ---------------------------
509839 # Make sure the entire path to DIRECTORY-PATH is available.
510840 func_mkdir_p ()
511841 {
512- my_directory_path="$1"
513- my_dir_list=
842+ $debug_cmd
514843
515- if test -n "$my_directory_path" && test "$opt_dry_run" != ":"; then
844+ _G_directory_path=$1
845+ _G_dir_list=
516846
517- # Protect directory names starting with `-'
518- case $my_directory_path in
519- -*) my_directory_path="./$my_directory_path" ;;
847+ if test -n "$_G_directory_path" && test : != "$opt_dry_run"; then
848+
849+ # Protect directory names starting with '-'
850+ case $_G_directory_path in
851+ -*) _G_directory_path=./$_G_directory_path ;;
520852 esac
521853
522854 # While some portion of DIR does not yet exist...
523- while test ! -d "$my_directory_path"; do
855+ while test ! -d "$_G_directory_path"; do
524856 # ...make a list in topmost first order. Use a colon delimited
525857 # list incase some portion of path contains whitespace.
526- my_dir_list="$my_directory_path:$my_dir_list"
858+ _G_dir_list=$_G_directory_path:$_G_dir_list
527859
528860 # If the last portion added has no slash in it, the list is done
529- case $my_directory_path in */*) ;; *) break ;; esac
861+ case $_G_directory_path in */*) ;; *) break ;; esac
530862
531863 # ...otherwise throw away the child directory and loop
532- my_directory_path=`$ECHO "$my_directory_path" | $SED -e "$dirname"`
864+ _G_directory_path=`$ECHO "$_G_directory_path" | $SED -e "$sed_dirname"`
533865 done
534- my_dir_list=`$ECHO "$my_dir_list" | $SED 's,:*$,,'`
866+ _G_dir_list=`$ECHO "$_G_dir_list" | $SED 's|:*$||'`
535867
536- save_mkdir_p_IFS="$IFS"; IFS=':'
537- for my_dir in $my_dir_list; do
538- IFS="$save_mkdir_p_IFS"
539- # mkdir can fail with a `File exist' error if two processes
868+ func_mkdir_p_IFS=$IFS; IFS=:
869+ for _G_dir in $_G_dir_list; do
870+ IFS=$func_mkdir_p_IFS
871+ # mkdir can fail with a 'File exist' error if two processes
540872 # try to create one of the directories concurrently. Don't
541873 # stop in that case!
542- $MKDIR "$my_dir" 2>/dev/null || :
874+ $MKDIR "$_G_dir" 2>/dev/null || :
543875 done
544- IFS="$save_mkdir_p_IFS"
876+ IFS=$func_mkdir_p_IFS
545877
546878 # Bail out if we (or some other process) failed to create a directory.
547- test -d "$my_directory_path" || \
548- func_fatal_error "Failed to create \`$1'"
879+ test -d "$_G_directory_path" || \
880+ func_fatal_error "Failed to create '$1'"
549881 fi
550882 }
551883
552884
553-# func_mktempdir [string]
885+# func_mktempdir [BASENAME]
886+# -------------------------
554887 # Make a temporary directory that won't clash with other running
555888 # libtool processes, and avoids race conditions if possible. If
556-# given, STRING is the basename for that directory.
889+# given, BASENAME is the basename for that directory.
557890 func_mktempdir ()
558891 {
559- my_template="${TMPDIR-/tmp}/${1-$progname}"
892+ $debug_cmd
893+
894+ _G_template=${TMPDIR-/tmp}/${1-$progname}
560895
561- if test "$opt_dry_run" = ":"; then
896+ if test : = "$opt_dry_run"; then
562897 # Return a directory name, but don't create it in dry-run mode
563- my_tmpdir="${my_template}-$$"
898+ _G_tmpdir=$_G_template-$$
564899 else
565900
566901 # If mktemp works, use that first and foremost
567- my_tmpdir=`mktemp -d "${my_template}-XXXXXXXX" 2>/dev/null`
902+ _G_tmpdir=`mktemp -d "$_G_template-XXXXXXXX" 2>/dev/null`
568903
569- if test ! -d "$my_tmpdir"; then
904+ if test ! -d "$_G_tmpdir"; then
570905 # Failing that, at least try and use $RANDOM to avoid a race
571- my_tmpdir="${my_template}-${RANDOM-0}$$"
906+ _G_tmpdir=$_G_template-${RANDOM-0}$$
572907
573- save_mktempdir_umask=`umask`
908+ func_mktempdir_umask=`umask`
574909 umask 0077
575- $MKDIR "$my_tmpdir"
576- umask $save_mktempdir_umask
910+ $MKDIR "$_G_tmpdir"
911+ umask $func_mktempdir_umask
577912 fi
578913
579914 # If we're not in dry-run mode, bomb out on failure
580- test -d "$my_tmpdir" || \
581- func_fatal_error "cannot create temporary directory \`$my_tmpdir'"
915+ test -d "$_G_tmpdir" || \
916+ func_fatal_error "cannot create temporary directory '$_G_tmpdir'"
917+ fi
918+
919+ $ECHO "$_G_tmpdir"
920+}
921+
922+
923+# func_normal_abspath PATH
924+# ------------------------
925+# Remove doubled-up and trailing slashes, "." path components,
926+# and cancel out any ".." path components in PATH after making
927+# it an absolute path.
928+func_normal_abspath ()
929+{
930+ $debug_cmd
931+
932+ # These SED scripts presuppose an absolute path with a trailing slash.
933+ _G_pathcar='s|^/\([^/]*\).*$|\1|'
934+ _G_pathcdr='s|^/[^/]*||'
935+ _G_removedotparts=':dotsl
936+ s|/\./|/|g
937+ t dotsl
938+ s|/\.$|/|'
939+ _G_collapseslashes='s|/\{1,\}|/|g'
940+ _G_finalslash='s|/*$|/|'
941+
942+ # Start from root dir and reassemble the path.
943+ func_normal_abspath_result=
944+ func_normal_abspath_tpath=$1
945+ func_normal_abspath_altnamespace=
946+ case $func_normal_abspath_tpath in
947+ "")
948+ # Empty path, that just means $cwd.
949+ func_stripname '' '/' "`pwd`"
950+ func_normal_abspath_result=$func_stripname_result
951+ return
952+ ;;
953+ # The next three entries are used to spot a run of precisely
954+ # two leading slashes without using negated character classes;
955+ # we take advantage of case's first-match behaviour.
956+ ///*)
957+ # Unusual form of absolute path, do nothing.
958+ ;;
959+ //*)
960+ # Not necessarily an ordinary path; POSIX reserves leading '//'
961+ # and for example Cygwin uses it to access remote file shares
962+ # over CIFS/SMB, so we conserve a leading double slash if found.
963+ func_normal_abspath_altnamespace=/
964+ ;;
965+ /*)
966+ # Absolute path, do nothing.
967+ ;;
968+ *)
969+ # Relative path, prepend $cwd.
970+ func_normal_abspath_tpath=`pwd`/$func_normal_abspath_tpath
971+ ;;
972+ esac
973+
974+ # Cancel out all the simple stuff to save iterations. We also want
975+ # the path to end with a slash for ease of parsing, so make sure
976+ # there is one (and only one) here.
977+ func_normal_abspath_tpath=`$ECHO "$func_normal_abspath_tpath" | $SED \
978+ -e "$_G_removedotparts" -e "$_G_collapseslashes" -e "$_G_finalslash"`
979+ while :; do
980+ # Processed it all yet?
981+ if test / = "$func_normal_abspath_tpath"; then
982+ # If we ascended to the root using ".." the result may be empty now.
983+ if test -z "$func_normal_abspath_result"; then
984+ func_normal_abspath_result=/
985+ fi
986+ break
987+ fi
988+ func_normal_abspath_tcomponent=`$ECHO "$func_normal_abspath_tpath" | $SED \
989+ -e "$_G_pathcar"`
990+ func_normal_abspath_tpath=`$ECHO "$func_normal_abspath_tpath" | $SED \
991+ -e "$_G_pathcdr"`
992+ # Figure out what to do with it
993+ case $func_normal_abspath_tcomponent in
994+ "")
995+ # Trailing empty path component, ignore it.
996+ ;;
997+ ..)
998+ # Parent dir; strip last assembled component from result.
999+ func_dirname "$func_normal_abspath_result"
1000+ func_normal_abspath_result=$func_dirname_result
1001+ ;;
1002+ *)
1003+ # Actual path component, append it.
1004+ func_append func_normal_abspath_result "/$func_normal_abspath_tcomponent"
1005+ ;;
1006+ esac
1007+ done
1008+ # Restore leading double-slash if one was found on entry.
1009+ func_normal_abspath_result=$func_normal_abspath_altnamespace$func_normal_abspath_result
1010+}
1011+
1012+
1013+# func_notquiet ARG...
1014+# --------------------
1015+# Echo program name prefixed message only when not in quiet mode.
1016+func_notquiet ()
1017+{
1018+ $debug_cmd
1019+
1020+ $opt_quiet || func_echo ${1+"$@"}
1021+
1022+ # A bug in bash halts the script if the last line of a function
1023+ # fails when set -e is in force, so we need another command to
1024+ # work around that:
1025+ :
1026+}
1027+
1028+
1029+# func_relative_path SRCDIR DSTDIR
1030+# --------------------------------
1031+# Set func_relative_path_result to the relative path from SRCDIR to DSTDIR.
1032+func_relative_path ()
1033+{
1034+ $debug_cmd
1035+
1036+ func_relative_path_result=
1037+ func_normal_abspath "$1"
1038+ func_relative_path_tlibdir=$func_normal_abspath_result
1039+ func_normal_abspath "$2"
1040+ func_relative_path_tbindir=$func_normal_abspath_result
1041+
1042+ # Ascend the tree starting from libdir
1043+ while :; do
1044+ # check if we have found a prefix of bindir
1045+ case $func_relative_path_tbindir in
1046+ $func_relative_path_tlibdir)
1047+ # found an exact match
1048+ func_relative_path_tcancelled=
1049+ break
1050+ ;;
1051+ $func_relative_path_tlibdir*)
1052+ # found a matching prefix
1053+ func_stripname "$func_relative_path_tlibdir" '' "$func_relative_path_tbindir"
1054+ func_relative_path_tcancelled=$func_stripname_result
1055+ if test -z "$func_relative_path_result"; then
1056+ func_relative_path_result=.
1057+ fi
1058+ break
1059+ ;;
1060+ *)
1061+ func_dirname $func_relative_path_tlibdir
1062+ func_relative_path_tlibdir=$func_dirname_result
1063+ if test -z "$func_relative_path_tlibdir"; then
1064+ # Have to descend all the way to the root!
1065+ func_relative_path_result=../$func_relative_path_result
1066+ func_relative_path_tcancelled=$func_relative_path_tbindir
1067+ break
1068+ fi
1069+ func_relative_path_result=../$func_relative_path_result
1070+ ;;
1071+ esac
1072+ done
1073+
1074+ # Now calculate path; take care to avoid doubling-up slashes.
1075+ func_stripname '' '/' "$func_relative_path_result"
1076+ func_relative_path_result=$func_stripname_result
1077+ func_stripname '/' '/' "$func_relative_path_tcancelled"
1078+ if test -n "$func_stripname_result"; then
1079+ func_append func_relative_path_result "/$func_stripname_result"
1080+ fi
1081+
1082+ # Normalisation. If bindir is libdir, return '.' else relative path.
1083+ if test -n "$func_relative_path_result"; then
1084+ func_stripname './' '' "$func_relative_path_result"
1085+ func_relative_path_result=$func_stripname_result
5821086 fi
5831087
584- $ECHO "$my_tmpdir"
1088+ test -n "$func_relative_path_result" || func_relative_path_result=.
1089+
1090+ :
1091+}
1092+
1093+
1094+# func_quote_for_eval ARG...
1095+# --------------------------
1096+# Aesthetically quote ARGs to be evaled later.
1097+# This function returns two values:
1098+# i) func_quote_for_eval_result
1099+# double-quoted, suitable for a subsequent eval
1100+# ii) func_quote_for_eval_unquoted_result
1101+# has all characters that are still active within double
1102+# quotes backslashified.
1103+func_quote_for_eval ()
1104+{
1105+ $debug_cmd
1106+
1107+ func_quote_for_eval_unquoted_result=
1108+ func_quote_for_eval_result=
1109+ while test 0 -lt $#; do
1110+ case $1 in
1111+ *[\\\`\"\$]*)
1112+ _G_unquoted_arg=`printf '%s\n' "$1" |$SED "$sed_quote_subst"` ;;
1113+ *)
1114+ _G_unquoted_arg=$1 ;;
1115+ esac
1116+ if test -n "$func_quote_for_eval_unquoted_result"; then
1117+ func_append func_quote_for_eval_unquoted_result " $_G_unquoted_arg"
1118+ else
1119+ func_append func_quote_for_eval_unquoted_result "$_G_unquoted_arg"
1120+ fi
1121+
1122+ case $_G_unquoted_arg in
1123+ # Double-quote args containing shell metacharacters to delay
1124+ # word splitting, command substitution and variable expansion
1125+ # for a subsequent eval.
1126+ # Many Bourne shells cannot handle close brackets correctly
1127+ # in scan sets, so we specify it separately.
1128+ *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
1129+ _G_quoted_arg=\"$_G_unquoted_arg\"
1130+ ;;
1131+ *)
1132+ _G_quoted_arg=$_G_unquoted_arg
1133+ ;;
1134+ esac
1135+
1136+ if test -n "$func_quote_for_eval_result"; then
1137+ func_append func_quote_for_eval_result " $_G_quoted_arg"
1138+ else
1139+ func_append func_quote_for_eval_result "$_G_quoted_arg"
1140+ fi
1141+ shift
1142+ done
1143+}
1144+
1145+
1146+# func_quote_for_expand ARG
1147+# -------------------------
1148+# Aesthetically quote ARG to be evaled later; same as above,
1149+# but do not quote variable references.
1150+func_quote_for_expand ()
1151+{
1152+ $debug_cmd
1153+
1154+ case $1 in
1155+ *[\\\`\"]*)
1156+ _G_arg=`$ECHO "$1" | $SED \
1157+ -e "$sed_double_quote_subst" -e "$sed_double_backslash"` ;;
1158+ *)
1159+ _G_arg=$1 ;;
1160+ esac
1161+
1162+ case $_G_arg in
1163+ # Double-quote args containing shell metacharacters to delay
1164+ # word splitting and command substitution for a subsequent eval.
1165+ # Many Bourne shells cannot handle close brackets correctly
1166+ # in scan sets, so we specify it separately.
1167+ *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
1168+ _G_arg=\"$_G_arg\"
1169+ ;;
1170+ esac
1171+
1172+ func_quote_for_expand_result=$_G_arg
1173+}
1174+
1175+
1176+# func_stripname PREFIX SUFFIX NAME
1177+# ---------------------------------
1178+# strip PREFIX and SUFFIX from NAME, and store in func_stripname_result.
1179+# PREFIX and SUFFIX must not contain globbing or regex special
1180+# characters, hashes, percent signs, but SUFFIX may contain a leading
1181+# dot (in which case that matches only a dot).
1182+if test yes = "$_G_HAVE_XSI_OPS"; then
1183+ eval 'func_stripname ()
1184+ {
1185+ $debug_cmd
1186+
1187+ # pdksh 5.2.14 does not do ${X%$Y} correctly if both X and Y are
1188+ # positional parameters, so assign one to ordinary variable first.
1189+ func_stripname_result=$3
1190+ func_stripname_result=${func_stripname_result#"$1"}
1191+ func_stripname_result=${func_stripname_result%"$2"}
1192+ }'
1193+else
1194+ func_stripname ()
1195+ {
1196+ $debug_cmd
1197+
1198+ case $2 in
1199+ .*) func_stripname_result=`$ECHO "$3" | $SED -e "s%^$1%%" -e "s%\\\\$2\$%%"`;;
1200+ *) func_stripname_result=`$ECHO "$3" | $SED -e "s%^$1%%" -e "s%$2\$%%"`;;
1201+ esac
1202+ }
1203+fi
1204+
1205+
1206+# func_show_eval CMD [FAIL_EXP]
1207+# -----------------------------
1208+# Unless opt_quiet is true, then output CMD. Then, if opt_dryrun is
1209+# not true, evaluate CMD. If the evaluation of CMD fails, and FAIL_EXP
1210+# is given, then evaluate it.
1211+func_show_eval ()
1212+{
1213+ $debug_cmd
1214+
1215+ _G_cmd=$1
1216+ _G_fail_exp=${2-':'}
1217+
1218+ func_quote_for_expand "$_G_cmd"
1219+ eval "func_notquiet $func_quote_for_expand_result"
1220+
1221+ $opt_dry_run || {
1222+ eval "$_G_cmd"
1223+ _G_status=$?
1224+ if test 0 -ne "$_G_status"; then
1225+ eval "(exit $_G_status); $_G_fail_exp"
1226+ fi
1227+ }
1228+}
1229+
1230+
1231+# func_show_eval_locale CMD [FAIL_EXP]
1232+# ------------------------------------
1233+# Unless opt_quiet is true, then output CMD. Then, if opt_dryrun is
1234+# not true, evaluate CMD. If the evaluation of CMD fails, and FAIL_EXP
1235+# is given, then evaluate it. Use the saved locale for evaluation.
1236+func_show_eval_locale ()
1237+{
1238+ $debug_cmd
1239+
1240+ _G_cmd=$1
1241+ _G_fail_exp=${2-':'}
1242+
1243+ $opt_quiet || {
1244+ func_quote_for_expand "$_G_cmd"
1245+ eval "func_echo $func_quote_for_expand_result"
1246+ }
1247+
1248+ $opt_dry_run || {
1249+ eval "$_G_user_locale
1250+ $_G_cmd"
1251+ _G_status=$?
1252+ eval "$_G_safe_locale"
1253+ if test 0 -ne "$_G_status"; then
1254+ eval "(exit $_G_status); $_G_fail_exp"
1255+ fi
1256+ }
1257+}
1258+
1259+
1260+# func_tr_sh
1261+# ----------
1262+# Turn $1 into a string suitable for a shell variable name.
1263+# Result is stored in $func_tr_sh_result. All characters
1264+# not in the set a-zA-Z0-9_ are replaced with '_'. Further,
1265+# if $1 begins with a digit, a '_' is prepended as well.
1266+func_tr_sh ()
1267+{
1268+ $debug_cmd
1269+
1270+ case $1 in
1271+ [0-9]* | *[!a-zA-Z0-9_]*)
1272+ func_tr_sh_result=`$ECHO "$1" | $SED -e 's/^\([0-9]\)/_\1/' -e 's/[^a-zA-Z0-9_]/_/g'`
1273+ ;;
1274+ * )
1275+ func_tr_sh_result=$1
1276+ ;;
1277+ esac
1278+}
1279+
1280+
1281+# func_verbose ARG...
1282+# -------------------
1283+# Echo program name prefixed message in verbose mode only.
1284+func_verbose ()
1285+{
1286+ $debug_cmd
1287+
1288+ $opt_verbose && func_echo "$*"
1289+
1290+ :
1291+}
1292+
1293+
1294+# func_warn_and_continue ARG...
1295+# -----------------------------
1296+# Echo program name prefixed warning message to standard error.
1297+func_warn_and_continue ()
1298+{
1299+ $debug_cmd
1300+
1301+ $require_term_colors
1302+
1303+ func_echo_infix_1 "${tc_red}warning$tc_reset" "$*" >&2
1304+}
1305+
1306+
1307+# func_warning CATEGORY ARG...
1308+# ----------------------------
1309+# Echo program name prefixed warning message to standard error. Warning
1310+# messages can be filtered according to CATEGORY, where this function
1311+# elides messages where CATEGORY is not listed in the global variable
1312+# 'opt_warning_types'.
1313+func_warning ()
1314+{
1315+ $debug_cmd
1316+
1317+ # CATEGORY must be in the warning_categories list!
1318+ case " $warning_categories " in
1319+ *" $1 "*) ;;
1320+ *) func_internal_error "invalid warning category '$1'" ;;
1321+ esac
1322+
1323+ _G_category=$1
1324+ shift
1325+
1326+ case " $opt_warning_types " in
1327+ *" $_G_category "*) $warning_func ${1+"$@"} ;;
1328+ esac
1329+}
1330+
1331+
1332+# func_sort_ver VER1 VER2
1333+# -----------------------
1334+# 'sort -V' is not generally available.
1335+# Note this deviates from the version comparison in automake
1336+# in that it treats 1.5 < 1.5.0, and treats 1.4.4a < 1.4-p3a
1337+# but this should suffice as we won't be specifying old
1338+# version formats or redundant trailing .0 in bootstrap.conf.
1339+# If we did want full compatibility then we should probably
1340+# use m4_version_compare from autoconf.
1341+func_sort_ver ()
1342+{
1343+ $debug_cmd
1344+
1345+ printf '%s\n%s\n' "$1" "$2" \
1346+ | 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
1347+}
1348+
1349+# func_lt_ver PREV CURR
1350+# ---------------------
1351+# Return true if PREV and CURR are in the correct order according to
1352+# func_sort_ver, otherwise false. Use it like this:
1353+#
1354+# func_lt_ver "$prev_ver" "$proposed_ver" || func_fatal_error "..."
1355+func_lt_ver ()
1356+{
1357+ $debug_cmd
1358+
1359+ test "x$1" = x`func_sort_ver "$1" "$2" | $SED 1q`
1360+}
1361+
1362+
1363+# Local variables:
1364+# mode: shell-script
1365+# sh-indentation: 2
1366+# eval: (add-hook 'before-save-hook 'time-stamp)
1367+# time-stamp-pattern: "10/scriptversion=%:y-%02m-%02d.%02H; # UTC"
1368+# time-stamp-time-zone: "UTC"
1369+# End:
1370+#! /bin/sh
1371+
1372+# Set a version string for this script.
1373+scriptversion=2014-01-07.03; # UTC
1374+
1375+# A portable, pluggable option parser for Bourne shell.
1376+# Written by Gary V. Vaughan, 2010
1377+
1378+# Copyright (C) 2010-2015 Free Software Foundation, Inc.
1379+# This is free software; see the source for copying conditions. There is NO
1380+# warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
1381+
1382+# This program is free software: you can redistribute it and/or modify
1383+# it under the terms of the GNU General Public License as published by
1384+# the Free Software Foundation, either version 3 of the License, or
1385+# (at your option) any later version.
1386+
1387+# This program is distributed in the hope that it will be useful,
1388+# but WITHOUT ANY WARRANTY; without even the implied warranty of
1389+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
1390+# GNU General Public License for more details.
1391+
1392+# You should have received a copy of the GNU General Public License
1393+# along with this program. If not, see <http://www.gnu.org/licenses/>.
1394+
1395+# Please report bugs or propose patches to gary@gnu.org.
1396+
1397+
1398+## ------ ##
1399+## Usage. ##
1400+## ------ ##
1401+
1402+# This file is a library for parsing options in your shell scripts along
1403+# with assorted other useful supporting features that you can make use
1404+# of too.
1405+#
1406+# For the simplest scripts you might need only:
1407+#
1408+# #!/bin/sh
1409+# . relative/path/to/funclib.sh
1410+# . relative/path/to/options-parser
1411+# scriptversion=1.0
1412+# func_options ${1+"$@"}
1413+# eval set dummy "$func_options_result"; shift
1414+# ...rest of your script...
1415+#
1416+# In order for the '--version' option to work, you will need to have a
1417+# suitably formatted comment like the one at the top of this file
1418+# starting with '# Written by ' and ending with '# warranty; '.
1419+#
1420+# For '-h' and '--help' to work, you will also need a one line
1421+# description of your script's purpose in a comment directly above the
1422+# '# Written by ' line, like the one at the top of this file.
1423+#
1424+# The default options also support '--debug', which will turn on shell
1425+# execution tracing (see the comment above debug_cmd below for another
1426+# use), and '--verbose' and the func_verbose function to allow your script
1427+# to display verbose messages only when your user has specified
1428+# '--verbose'.
1429+#
1430+# After sourcing this file, you can plug processing for additional
1431+# options by amending the variables from the 'Configuration' section
1432+# below, and following the instructions in the 'Option parsing'
1433+# section further down.
1434+
1435+## -------------- ##
1436+## Configuration. ##
1437+## -------------- ##
1438+
1439+# You should override these variables in your script after sourcing this
1440+# file so that they reflect the customisations you have added to the
1441+# option parser.
1442+
1443+# The usage line for option parsing errors and the start of '-h' and
1444+# '--help' output messages. You can embed shell variables for delayed
1445+# expansion at the time the message is displayed, but you will need to
1446+# quote other shell meta-characters carefully to prevent them being
1447+# expanded when the contents are evaled.
1448+usage='$progpath [OPTION]...'
1449+
1450+# Short help message in response to '-h' and '--help'. Add to this or
1451+# override it after sourcing this library to reflect the full set of
1452+# options your script accepts.
1453+usage_message="\
1454+ --debug enable verbose shell tracing
1455+ -W, --warnings=CATEGORY
1456+ report the warnings falling in CATEGORY [all]
1457+ -v, --verbose verbosely report processing
1458+ --version print version information and exit
1459+ -h, --help print short or long help message and exit
1460+"
1461+
1462+# Additional text appended to 'usage_message' in response to '--help'.
1463+long_help_message="
1464+Warning categories include:
1465+ 'all' show all warnings
1466+ 'none' turn off all the warnings
1467+ 'error' warnings are treated as fatal errors"
1468+
1469+# Help message printed before fatal option parsing errors.
1470+fatal_help="Try '\$progname --help' for more information."
1471+
1472+
1473+
1474+## ------------------------- ##
1475+## Hook function management. ##
1476+## ------------------------- ##
1477+
1478+# This section contains functions for adding, removing, and running hooks
1479+# to the main code. A hook is just a named list of of function, that can
1480+# be run in order later on.
1481+
1482+# func_hookable FUNC_NAME
1483+# -----------------------
1484+# Declare that FUNC_NAME will run hooks added with
1485+# 'func_add_hook FUNC_NAME ...'.
1486+func_hookable ()
1487+{
1488+ $debug_cmd
1489+
1490+ func_append hookable_fns " $1"
1491+}
1492+
1493+
1494+# func_add_hook FUNC_NAME HOOK_FUNC
1495+# ---------------------------------
1496+# Request that FUNC_NAME call HOOK_FUNC before it returns. FUNC_NAME must
1497+# first have been declared "hookable" by a call to 'func_hookable'.
1498+func_add_hook ()
1499+{
1500+ $debug_cmd
1501+
1502+ case " $hookable_fns " in
1503+ *" $1 "*) ;;
1504+ *) func_fatal_error "'$1' does not accept hook functions." ;;
1505+ esac
1506+
1507+ eval func_append ${1}_hooks '" $2"'
1508+}
1509+
1510+
1511+# func_remove_hook FUNC_NAME HOOK_FUNC
1512+# ------------------------------------
1513+# Remove HOOK_FUNC from the list of functions called by FUNC_NAME.
1514+func_remove_hook ()
1515+{
1516+ $debug_cmd
1517+
1518+ eval ${1}_hooks='`$ECHO "\$'$1'_hooks" |$SED "s| '$2'||"`'
1519+}
1520+
1521+
1522+# func_run_hooks FUNC_NAME [ARG]...
1523+# ---------------------------------
1524+# Run all hook functions registered to FUNC_NAME.
1525+# It is assumed that the list of hook functions contains nothing more
1526+# than a whitespace-delimited list of legal shell function names, and
1527+# no effort is wasted trying to catch shell meta-characters or preserve
1528+# whitespace.
1529+func_run_hooks ()
1530+{
1531+ $debug_cmd
1532+
1533+ case " $hookable_fns " in
1534+ *" $1 "*) ;;
1535+ *) func_fatal_error "'$1' does not support hook funcions.n" ;;
1536+ esac
1537+
1538+ eval _G_hook_fns=\$$1_hooks; shift
1539+
1540+ for _G_hook in $_G_hook_fns; do
1541+ eval $_G_hook '"$@"'
1542+
1543+ # store returned options list back into positional
1544+ # parameters for next 'cmd' execution.
1545+ eval _G_hook_result=\$${_G_hook}_result
1546+ eval set dummy "$_G_hook_result"; shift
1547+ done
1548+
1549+ func_quote_for_eval ${1+"$@"}
1550+ func_run_hooks_result=$func_quote_for_eval_result
1551+}
1552+
1553+
1554+
1555+## --------------- ##
1556+## Option parsing. ##
1557+## --------------- ##
1558+
1559+# In order to add your own option parsing hooks, you must accept the
1560+# full positional parameter list in your hook function, remove any
1561+# options that you action, and then pass back the remaining unprocessed
1562+# options in '<hooked_function_name>_result', escaped suitably for
1563+# 'eval'. Like this:
1564+#
1565+# my_options_prep ()
1566+# {
1567+# $debug_cmd
1568+#
1569+# # Extend the existing usage message.
1570+# usage_message=$usage_message'
1571+# -s, --silent don'\''t print informational messages
1572+# '
1573+#
1574+# func_quote_for_eval ${1+"$@"}
1575+# my_options_prep_result=$func_quote_for_eval_result
1576+# }
1577+# func_add_hook func_options_prep my_options_prep
1578+#
1579+#
1580+# my_silent_option ()
1581+# {
1582+# $debug_cmd
1583+#
1584+# # Note that for efficiency, we parse as many options as we can
1585+# # recognise in a loop before passing the remainder back to the
1586+# # caller on the first unrecognised argument we encounter.
1587+# while test $# -gt 0; do
1588+# opt=$1; shift
1589+# case $opt in
1590+# --silent|-s) opt_silent=: ;;
1591+# # Separate non-argument short options:
1592+# -s*) func_split_short_opt "$_G_opt"
1593+# set dummy "$func_split_short_opt_name" \
1594+# "-$func_split_short_opt_arg" ${1+"$@"}
1595+# shift
1596+# ;;
1597+# *) set dummy "$_G_opt" "$*"; shift; break ;;
1598+# esac
1599+# done
1600+#
1601+# func_quote_for_eval ${1+"$@"}
1602+# my_silent_option_result=$func_quote_for_eval_result
1603+# }
1604+# func_add_hook func_parse_options my_silent_option
1605+#
1606+#
1607+# my_option_validation ()
1608+# {
1609+# $debug_cmd
1610+#
1611+# $opt_silent && $opt_verbose && func_fatal_help "\
1612+# '--silent' and '--verbose' options are mutually exclusive."
1613+#
1614+# func_quote_for_eval ${1+"$@"}
1615+# my_option_validation_result=$func_quote_for_eval_result
1616+# }
1617+# func_add_hook func_validate_options my_option_validation
1618+#
1619+# You'll alse need to manually amend $usage_message to reflect the extra
1620+# options you parse. It's preferable to append if you can, so that
1621+# multiple option parsing hooks can be added safely.
1622+
1623+
1624+# func_options [ARG]...
1625+# ---------------------
1626+# All the functions called inside func_options are hookable. See the
1627+# individual implementations for details.
1628+func_hookable func_options
1629+func_options ()
1630+{
1631+ $debug_cmd
1632+
1633+ func_options_prep ${1+"$@"}
1634+ eval func_parse_options \
1635+ ${func_options_prep_result+"$func_options_prep_result"}
1636+ eval func_validate_options \
1637+ ${func_parse_options_result+"$func_parse_options_result"}
1638+
1639+ eval func_run_hooks func_options \
1640+ ${func_validate_options_result+"$func_validate_options_result"}
1641+
1642+ # save modified positional parameters for caller
1643+ func_options_result=$func_run_hooks_result
5851644 }
5861645
5871646
588-# func_quote_for_eval arg
589-# Aesthetically quote ARG to be evaled later.
590-# This function returns two values: FUNC_QUOTE_FOR_EVAL_RESULT
591-# is double-quoted, suitable for a subsequent eval, whereas
592-# FUNC_QUOTE_FOR_EVAL_UNQUOTED_RESULT has merely all characters
593-# which are still active within double quotes backslashified.
594-func_quote_for_eval ()
1647+# func_options_prep [ARG]...
1648+# --------------------------
1649+# All initialisations required before starting the option parse loop.
1650+# Note that when calling hook functions, we pass through the list of
1651+# positional parameters. If a hook function modifies that list, and
1652+# needs to propogate that back to rest of this script, then the complete
1653+# modified list must be put in 'func_run_hooks_result' before
1654+# returning.
1655+func_hookable func_options_prep
1656+func_options_prep ()
5951657 {
596- case $1 in
597- *[\\\`\"\$]*)
598- func_quote_for_eval_unquoted_result=`$ECHO "$1" | $SED "$sed_quote_subst"` ;;
599- *)
600- func_quote_for_eval_unquoted_result="$1" ;;
601- esac
1658+ $debug_cmd
6021659
603- case $func_quote_for_eval_unquoted_result in
604- # Double-quote args containing shell metacharacters to delay
605- # word splitting, command substitution and and variable
606- # expansion for a subsequent eval.
607- # Many Bourne shells cannot handle close brackets correctly
608- # in scan sets, so we specify it separately.
609- *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
610- func_quote_for_eval_result="\"$func_quote_for_eval_unquoted_result\""
611- ;;
612- *)
613- func_quote_for_eval_result="$func_quote_for_eval_unquoted_result"
614- esac
1660+ # Option defaults:
1661+ opt_verbose=false
1662+ opt_warning_types=
1663+
1664+ func_run_hooks func_options_prep ${1+"$@"}
1665+
1666+ # save modified positional parameters for caller
1667+ func_options_prep_result=$func_run_hooks_result
6151668 }
6161669
6171670
618-# func_quote_for_expand arg
619-# Aesthetically quote ARG to be evaled later; same as above,
620-# but do not quote variable references.
621-func_quote_for_expand ()
1671+# func_parse_options [ARG]...
1672+# ---------------------------
1673+# The main option parsing loop.
1674+func_hookable func_parse_options
1675+func_parse_options ()
6221676 {
623- case $1 in
624- *[\\\`\"]*)
625- my_arg=`$ECHO "$1" | $SED \
626- -e "$double_quote_subst" -e "$sed_double_backslash"` ;;
627- *)
628- my_arg="$1" ;;
629- esac
1677+ $debug_cmd
6301678
631- case $my_arg in
632- # Double-quote args containing shell metacharacters to delay
633- # word splitting and command substitution for a subsequent eval.
634- # Many Bourne shells cannot handle close brackets correctly
635- # in scan sets, so we specify it separately.
636- *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
637- my_arg="\"$my_arg\""
638- ;;
639- esac
1679+ func_parse_options_result=
6401680
641- func_quote_for_expand_result="$my_arg"
642-}
1681+ # this just eases exit handling
1682+ while test $# -gt 0; do
1683+ # Defer to hook functions for initial option parsing, so they
1684+ # get priority in the event of reusing an option name.
1685+ func_run_hooks func_parse_options ${1+"$@"}
6431686
1687+ # Adjust func_parse_options positional parameters to match
1688+ eval set dummy "$func_run_hooks_result"; shift
6441689
645-# func_show_eval cmd [fail_exp]
646-# Unless opt_silent is true, then output CMD. Then, if opt_dryrun is
647-# not true, evaluate CMD. If the evaluation of CMD fails, and FAIL_EXP
648-# is given, then evaluate it.
649-func_show_eval ()
650-{
651- my_cmd="$1"
652- my_fail_exp="${2-:}"
1690+ # Break out of the loop if we already parsed every option.
1691+ test $# -gt 0 || break
6531692
654- ${opt_silent-false} || {
655- func_quote_for_expand "$my_cmd"
656- eval "func_echo $func_quote_for_expand_result"
657- }
1693+ _G_opt=$1
1694+ shift
1695+ case $_G_opt in
1696+ --debug|-x) debug_cmd='set -x'
1697+ func_echo "enabling shell trace mode"
1698+ $debug_cmd
1699+ ;;
1700+
1701+ --no-warnings|--no-warning|--no-warn)
1702+ set dummy --warnings none ${1+"$@"}
1703+ shift
1704+ ;;
6581705
659- if ${opt_dry_run-false}; then :; else
660- eval "$my_cmd"
661- my_status=$?
662- if test "$my_status" -eq 0; then :; else
663- eval "(exit $my_status); $my_fail_exp"
664- fi
665- fi
1706+ --warnings|--warning|-W)
1707+ test $# = 0 && func_missing_arg $_G_opt && break
1708+ case " $warning_categories $1" in
1709+ *" $1 "*)
1710+ # trailing space prevents matching last $1 above
1711+ func_append_uniq opt_warning_types " $1"
1712+ ;;
1713+ *all)
1714+ opt_warning_types=$warning_categories
1715+ ;;
1716+ *none)
1717+ opt_warning_types=none
1718+ warning_func=:
1719+ ;;
1720+ *error)
1721+ opt_warning_types=$warning_categories
1722+ warning_func=func_fatal_error
1723+ ;;
1724+ *)
1725+ func_fatal_error \
1726+ "unsupported warning category: '$1'"
1727+ ;;
1728+ esac
1729+ shift
1730+ ;;
1731+
1732+ --verbose|-v) opt_verbose=: ;;
1733+ --version) func_version ;;
1734+ -\?|-h) func_usage ;;
1735+ --help) func_help ;;
1736+
1737+ # Separate optargs to long options (plugins may need this):
1738+ --*=*) func_split_equals "$_G_opt"
1739+ set dummy "$func_split_equals_lhs" \
1740+ "$func_split_equals_rhs" ${1+"$@"}
1741+ shift
1742+ ;;
1743+
1744+ # Separate optargs to short options:
1745+ -W*)
1746+ func_split_short_opt "$_G_opt"
1747+ set dummy "$func_split_short_opt_name" \
1748+ "$func_split_short_opt_arg" ${1+"$@"}
1749+ shift
1750+ ;;
1751+
1752+ # Separate non-argument short options:
1753+ -\?*|-h*|-v*|-x*)
1754+ func_split_short_opt "$_G_opt"
1755+ set dummy "$func_split_short_opt_name" \
1756+ "-$func_split_short_opt_arg" ${1+"$@"}
1757+ shift
1758+ ;;
1759+
1760+ --) break ;;
1761+ -*) func_fatal_help "unrecognised option: '$_G_opt'" ;;
1762+ *) set dummy "$_G_opt" ${1+"$@"}; shift; break ;;
1763+ esac
1764+ done
1765+
1766+ # save modified positional parameters for caller
1767+ func_quote_for_eval ${1+"$@"}
1768+ func_parse_options_result=$func_quote_for_eval_result
6661769 }
6671770
6681771
669-# func_show_eval_locale cmd [fail_exp]
670-# Unless opt_silent is true, then output CMD. Then, if opt_dryrun is
671-# not true, evaluate CMD. If the evaluation of CMD fails, and FAIL_EXP
672-# is given, then evaluate it. Use the saved locale for evaluation.
673-func_show_eval_locale ()
1772+# func_validate_options [ARG]...
1773+# ------------------------------
1774+# Perform any sanity checks on option settings and/or unconsumed
1775+# arguments.
1776+func_hookable func_validate_options
1777+func_validate_options ()
6741778 {
675- my_cmd="$1"
676- my_fail_exp="${2-:}"
1779+ $debug_cmd
6771780
678- ${opt_silent-false} || {
679- func_quote_for_expand "$my_cmd"
680- eval "func_echo $func_quote_for_expand_result"
681- }
1781+ # Display all warnings if -W was not given.
1782+ test -n "$opt_warning_types" || opt_warning_types=" $warning_categories"
6821783
683- if ${opt_dry_run-false}; then :; else
684- eval "$lt_user_locale
685- $my_cmd"
686- my_status=$?
687- eval "$lt_safe_locale"
688- if test "$my_status" -eq 0; then :; else
689- eval "(exit $my_status); $my_fail_exp"
690- fi
691- fi
692-}
1784+ func_run_hooks func_validate_options ${1+"$@"}
6931785
694-# func_tr_sh
695-# Turn $1 into a string suitable for a shell variable name.
696-# Result is stored in $func_tr_sh_result. All characters
697-# not in the set a-zA-Z0-9_ are replaced with '_'. Further,
698-# if $1 begins with a digit, a '_' is prepended as well.
699-func_tr_sh ()
700-{
701- case $1 in
702- [0-9]* | *[!a-zA-Z0-9_]*)
703- func_tr_sh_result=`$ECHO "$1" | $SED 's/^\([0-9]\)/_\1/; s/[^a-zA-Z0-9_]/_/g'`
704- ;;
705- * )
706- func_tr_sh_result=$1
707- ;;
708- esac
1786+ # Bail if the options were screwed!
1787+ $exit_cmd $EXIT_FAILURE
1788+
1789+ # save modified positional parameters for caller
1790+ func_validate_options_result=$func_run_hooks_result
7091791 }
7101792
7111793
712-# func_version
713-# Echo version message to standard output and exit.
714-func_version ()
715-{
716- $opt_debug
7171794
718- $SED -n '/(C)/!b go
719- :more
720- /\./!{
721- N
722- s/\n# / /
723- b more
724- }
725- :go
726- /^# '$PROGRAM' (GNU /,/# warranty; / {
727- s/^# //
728- s/^# *$//
729- s/\((C)\)[ 0-9,-]*\( [1-9][0-9]*\)/\1\2/
730- p
731- }' < "$progpath"
732- exit $?
733-}
1795+## ----------------- ##
1796+## Helper functions. ##
1797+## ----------------- ##
7341798
735-# func_usage
736-# Echo short help message to standard output and exit.
737-func_usage ()
1799+# This section contains the helper functions used by the rest of the
1800+# hookable option parser framework in ascii-betical order.
1801+
1802+
1803+# func_fatal_help ARG...
1804+# ----------------------
1805+# Echo program name prefixed message to standard error, followed by
1806+# a help hint, and exit.
1807+func_fatal_help ()
7381808 {
739- $opt_debug
1809+ $debug_cmd
7401810
741- $SED -n '/^# Usage:/,/^# *.*--help/ {
742- s/^# //
743- s/^# *$//
744- s/\$progname/'$progname'/
745- p
746- }' < "$progpath"
747- echo
748- $ECHO "run \`$progname --help | more' for full usage"
749- exit $?
1811+ eval \$ECHO \""Usage: $usage"\"
1812+ eval \$ECHO \""$fatal_help"\"
1813+ func_error ${1+"$@"}
1814+ exit $EXIT_FAILURE
7501815 }
7511816
752-# func_help [NOEXIT]
753-# Echo long help message to standard output and exit,
754-# unless 'noexit' is passed as argument.
1817+
1818+# func_help
1819+# ---------
1820+# Echo long help message to standard output and exit.
7551821 func_help ()
7561822 {
757- $opt_debug
758-
759- $SED -n '/^# Usage:/,/# Report bugs to/ {
760- :print
761- s/^# //
762- s/^# *$//
763- s*\$progname*'$progname'*
764- s*\$host*'"$host"'*
765- s*\$SHELL*'"$SHELL"'*
766- s*\$LTCC*'"$LTCC"'*
767- s*\$LTCFLAGS*'"$LTCFLAGS"'*
768- s*\$LD*'"$LD"'*
769- s/\$with_gnu_ld/'"$with_gnu_ld"'/
770- s/\$automake_version/'"`(${AUTOMAKE-automake} --version) 2>/dev/null |$SED 1q`"'/
771- s/\$autoconf_version/'"`(${AUTOCONF-autoconf} --version) 2>/dev/null |$SED 1q`"'/
772- p
773- d
774- }
775- /^# .* home page:/b print
776- /^# General help using/b print
777- ' < "$progpath"
778- ret=$?
779- if test -z "$1"; then
780- exit $ret
781- fi
1823+ $debug_cmd
1824+
1825+ func_usage_message
1826+ $ECHO "$long_help_message"
1827+ exit 0
7821828 }
7831829
784-# func_missing_arg argname
1830+
1831+# func_missing_arg ARGNAME
1832+# ------------------------
7851833 # Echo program name prefixed message to standard error and set global
7861834 # exit_cmd.
7871835 func_missing_arg ()
7881836 {
789- $opt_debug
1837+ $debug_cmd
7901838
791- func_error "missing argument for $1."
1839+ func_error "Missing argument for '$1'."
7921840 exit_cmd=exit
7931841 }
7941842
7951843
796-# func_split_short_opt shortopt
1844+# func_split_equals STRING
1845+# ------------------------
1846+# Set func_split_equals_lhs and func_split_equals_rhs shell variables after
1847+# splitting STRING at the '=' sign.
1848+test -z "$_G_HAVE_XSI_OPS" \
1849+ && (eval 'x=a/b/c;
1850+ test 5aa/bb/cc = "${#x}${x%%/*}${x%/*}${x#*/}${x##*/}"') 2>/dev/null \
1851+ && _G_HAVE_XSI_OPS=yes
1852+
1853+if test yes = "$_G_HAVE_XSI_OPS"
1854+then
1855+ # This is an XSI compatible shell, allowing a faster implementation...
1856+ eval 'func_split_equals ()
1857+ {
1858+ $debug_cmd
1859+
1860+ func_split_equals_lhs=${1%%=*}
1861+ func_split_equals_rhs=${1#*=}
1862+ test "x$func_split_equals_lhs" = "x$1" \
1863+ && func_split_equals_rhs=
1864+ }'
1865+else
1866+ # ...otherwise fall back to using expr, which is often a shell builtin.
1867+ func_split_equals ()
1868+ {
1869+ $debug_cmd
1870+
1871+ func_split_equals_lhs=`expr "x$1" : 'x\([^=]*\)'`
1872+ func_split_equals_rhs=
1873+ test "x$func_split_equals_lhs" = "x$1" \
1874+ || func_split_equals_rhs=`expr "x$1" : 'x[^=]*=\(.*\)$'`
1875+ }
1876+fi #func_split_equals
1877+
1878+
1879+# func_split_short_opt SHORTOPT
1880+# -----------------------------
7971881 # Set func_split_short_opt_name and func_split_short_opt_arg shell
7981882 # variables after splitting SHORTOPT after the 2nd character.
799-func_split_short_opt ()
1883+if test yes = "$_G_HAVE_XSI_OPS"
1884+then
1885+ # This is an XSI compatible shell, allowing a faster implementation...
1886+ eval 'func_split_short_opt ()
1887+ {
1888+ $debug_cmd
1889+
1890+ func_split_short_opt_arg=${1#??}
1891+ func_split_short_opt_name=${1%"$func_split_short_opt_arg"}
1892+ }'
1893+else
1894+ # ...otherwise fall back to using expr, which is often a shell builtin.
1895+ func_split_short_opt ()
1896+ {
1897+ $debug_cmd
1898+
1899+ func_split_short_opt_name=`expr "x$1" : 'x-\(.\)'`
1900+ func_split_short_opt_arg=`expr "x$1" : 'x-.\(.*\)$'`
1901+ }
1902+fi #func_split_short_opt
1903+
1904+
1905+# func_usage
1906+# ----------
1907+# Echo short help message to standard output and exit.
1908+func_usage ()
8001909 {
801- my_sed_short_opt='1s/^\(..\).*$/\1/;q'
802- my_sed_short_rest='1s/^..\(.*\)$/\1/;q'
1910+ $debug_cmd
8031911
804- func_split_short_opt_name=`$ECHO "$1" | $SED "$my_sed_short_opt"`
805- func_split_short_opt_arg=`$ECHO "$1" | $SED "$my_sed_short_rest"`
806-} # func_split_short_opt may be replaced by extended shell implementation
1912+ func_usage_message
1913+ $ECHO "Run '$progname --help |${PAGER-more}' for full usage"
1914+ exit 0
1915+}
8071916
8081917
809-# func_split_long_opt longopt
810-# Set func_split_long_opt_name and func_split_long_opt_arg shell
811-# variables after splitting LONGOPT at the `=' sign.
812-func_split_long_opt ()
1918+# func_usage_message
1919+# ------------------
1920+# Echo short help message to standard output.
1921+func_usage_message ()
8131922 {
814- my_sed_long_opt='1s/^\(--[^=]*\)=.*/\1/;q'
815- my_sed_long_arg='1s/^--[^=]*=//'
1923+ $debug_cmd
8161924
817- func_split_long_opt_name=`$ECHO "$1" | $SED "$my_sed_long_opt"`
818- func_split_long_opt_arg=`$ECHO "$1" | $SED "$my_sed_long_arg"`
819-} # func_split_long_opt may be replaced by extended shell implementation
1925+ eval \$ECHO \""Usage: $usage"\"
1926+ echo
1927+ $SED -n 's|^# ||
1928+ /^Written by/{
1929+ x;p;x
1930+ }
1931+ h
1932+ /^Written by/q' < "$progpath"
1933+ echo
1934+ eval \$ECHO \""$usage_message"\"
1935+}
8201936
821-exit_cmd=:
8221937
1938+# func_version
1939+# ------------
1940+# Echo version message to standard output and exit.
1941+func_version ()
1942+{
1943+ $debug_cmd
8231944
1945+ printf '%s\n' "$progname $scriptversion"
1946+ $SED -n '
1947+ /(C)/!b go
1948+ :more
1949+ /\./!{
1950+ N
1951+ s|\n# | |
1952+ b more
1953+ }
1954+ :go
1955+ /^# Written by /,/# warranty; / {
1956+ s|^# ||
1957+ s|^# *$||
1958+ s|\((C)\)[ 0-9,-]*[ ,-]\([1-9][0-9]* \)|\1 \2|
1959+ p
1960+ }
1961+ /^# Written by / {
1962+ s|^# ||
1963+ p
1964+ }
1965+ /^warranty; /q' < "$progpath"
8241966
1967+ exit $?
1968+}
8251969
8261970
827-magic="%%%MAGIC variable%%%"
828-magic_exe="%%%MAGIC EXE variable%%%"
1971+# Local variables:
1972+# mode: shell-script
1973+# sh-indentation: 2
1974+# eval: (add-hook 'before-save-hook 'time-stamp)
1975+# time-stamp-pattern: "10/scriptversion=%:y-%02m-%02d.%02H; # UTC"
1976+# time-stamp-time-zone: "UTC"
1977+# End:
8291978
830-# Global variables.
831-nonopt=
832-preserve_args=
833-lo2o="s/\\.lo\$/.${objext}/"
834-o2lo="s/\\.${objext}\$/.lo/"
835-extracted_archives=
836-extracted_serial=0
1979+# Set a version string.
1980+scriptversion='(GNU libtool) 2.4.6'
8371981
838-# If this variable is set in any of the actions, the command in it
839-# will be execed at the end. This prevents here-documents from being
840-# left over by shells.
841-exec_cmd=
8421982
843-# func_append var value
844-# Append VALUE to the end of shell variable VAR.
845-func_append ()
1983+# func_echo ARG...
1984+# ----------------
1985+# Libtool also displays the current mode in messages, so override
1986+# funclib.sh func_echo with this custom definition.
1987+func_echo ()
8461988 {
847- eval "${1}=\$${1}\${2}"
848-} # func_append may be replaced by extended shell implementation
1989+ $debug_cmd
8491990
850-# func_append_quoted var value
851-# Quote VALUE and append to the end of shell variable VAR, separated
852-# by a space.
853-func_append_quoted ()
854-{
855- func_quote_for_eval "${2}"
856- eval "${1}=\$${1}\\ \$func_quote_for_eval_result"
857-} # func_append_quoted may be replaced by extended shell implementation
1991+ _G_message=$*
8581992
1993+ func_echo_IFS=$IFS
1994+ IFS=$nl
1995+ for _G_line in $_G_message; do
1996+ IFS=$func_echo_IFS
1997+ $ECHO "$progname${opt_mode+: $opt_mode}: $_G_line"
1998+ done
1999+ IFS=$func_echo_IFS
2000+}
8592001
860-# func_arith arithmetic-term...
861-func_arith ()
2002+
2003+# func_warning ARG...
2004+# -------------------
2005+# Libtool warnings are not categorized, so override funclib.sh
2006+# func_warning with this simpler definition.
2007+func_warning ()
8622008 {
863- func_arith_result=`expr "${@}"`
864-} # func_arith may be replaced by extended shell implementation
2009+ $debug_cmd
8652010
2011+ $warning_func ${1+"$@"}
2012+}
8662013
867-# func_len string
868-# STRING may not start with a hyphen.
869-func_len ()
870-{
871- func_len_result=`expr "${1}" : ".*" 2>/dev/null || echo $max_cmd_len`
872-} # func_len may be replaced by extended shell implementation
8732014
2015+## ---------------- ##
2016+## Options parsing. ##
2017+## ---------------- ##
2018+
2019+# Hook in the functions to make sure our own options are parsed during
2020+# the option parsing loop.
2021+
2022+usage='$progpath [OPTION]... [MODE-ARG]...'
2023+
2024+# Short help message in response to '-h'.
2025+usage_message="Options:
2026+ --config show all configuration variables
2027+ --debug enable verbose shell tracing
2028+ -n, --dry-run display commands without modifying any files
2029+ --features display basic configuration information and exit
2030+ --mode=MODE use operation mode MODE
2031+ --no-warnings equivalent to '-Wnone'
2032+ --preserve-dup-deps don't remove duplicate dependency libraries
2033+ --quiet, --silent don't print informational messages
2034+ --tag=TAG use configuration variables from tag TAG
2035+ -v, --verbose print more informational messages than default
2036+ --version print version information
2037+ -W, --warnings=CATEGORY report the warnings falling in CATEGORY [all]
2038+ -h, --help, --help-all print short, long, or detailed help message
2039+"
8742040
875-# func_lo2o object
876-func_lo2o ()
2041+# Additional text appended to 'usage_message' in response to '--help'.
2042+func_help ()
8772043 {
878- func_lo2o_result=`$ECHO "${1}" | $SED "$lo2o"`
879-} # func_lo2o may be replaced by extended shell implementation
2044+ $debug_cmd
2045+
2046+ func_usage_message
2047+ $ECHO "$long_help_message
2048+
2049+MODE must be one of the following:
2050+
2051+ clean remove files from the build directory
2052+ compile compile a source file into a libtool object
2053+ execute automatically set library path, then run a program
2054+ finish complete the installation of libtool libraries
2055+ install install libraries or executables
2056+ link create a library or an executable
2057+ uninstall remove libraries from an installed directory
2058+
2059+MODE-ARGS vary depending on the MODE. When passed as first option,
2060+'--mode=MODE' may be abbreviated as 'MODE' or a unique abbreviation of that.
2061+Try '$progname --help --mode=MODE' for a more detailed description of MODE.
2062+
2063+When reporting a bug, please describe a test case to reproduce it and
2064+include the following information:
2065+
2066+ host-triplet: $host
2067+ shell: $SHELL
2068+ compiler: $LTCC
2069+ compiler flags: $LTCFLAGS
2070+ linker: $LD (gnu? $with_gnu_ld)
2071+ version: $progname $scriptversion Debian-2.4.6-2
2072+ automake: `($AUTOMAKE --version) 2>/dev/null |$SED 1q`
2073+ autoconf: `($AUTOCONF --version) 2>/dev/null |$SED 1q`
2074+
2075+Report bugs to <bug-libtool@gnu.org>.
2076+GNU libtool home page: <http://www.gnu.org/s/libtool/>.
2077+General help using GNU software: <http://www.gnu.org/gethelp/>."
2078+ exit 0
2079+}
8802080
8812081
882-# func_xform libobj-or-source
883-func_xform ()
884-{
885- func_xform_result=`$ECHO "${1}" | $SED 's/\.[^.]*$/.lo/'`
886-} # func_xform may be replaced by extended shell implementation
2082+# func_lo2o OBJECT-NAME
2083+# ---------------------
2084+# Transform OBJECT-NAME from a '.lo' suffix to the platform specific
2085+# object suffix.
2086+
2087+lo2o=s/\\.lo\$/.$objext/
2088+o2lo=s/\\.$objext\$/.lo/
2089+
2090+if test yes = "$_G_HAVE_XSI_OPS"; then
2091+ eval 'func_lo2o ()
2092+ {
2093+ case $1 in
2094+ *.lo) func_lo2o_result=${1%.lo}.$objext ;;
2095+ * ) func_lo2o_result=$1 ;;
2096+ esac
2097+ }'
2098+
2099+ # func_xform LIBOBJ-OR-SOURCE
2100+ # ---------------------------
2101+ # Transform LIBOBJ-OR-SOURCE from a '.o' or '.c' (or otherwise)
2102+ # suffix to a '.lo' libtool-object suffix.
2103+ eval 'func_xform ()
2104+ {
2105+ func_xform_result=${1%.*}.lo
2106+ }'
2107+else
2108+ # ...otherwise fall back to using sed.
2109+ func_lo2o ()
2110+ {
2111+ func_lo2o_result=`$ECHO "$1" | $SED "$lo2o"`
2112+ }
2113+
2114+ func_xform ()
2115+ {
2116+ func_xform_result=`$ECHO "$1" | $SED 's|\.[^.]*$|.lo|'`
2117+ }
2118+fi
8872119
8882120
889-# func_fatal_configuration arg...
2121+# func_fatal_configuration ARG...
2122+# -------------------------------
8902123 # Echo program name prefixed message to standard error, followed by
8912124 # a configuration failure hint, and exit.
8922125 func_fatal_configuration ()
8932126 {
894- func_error ${1+"$@"}
895- func_error "See the $PACKAGE documentation for more information."
896- func_fatal_error "Fatal configuration error."
2127+ func__fatal_error ${1+"$@"} \
2128+ "See the $PACKAGE documentation for more information." \
2129+ "Fatal configuration error."
8972130 }
8982131
8992132
9002133 # func_config
2134+# -----------
9012135 # Display the configuration for all the tags in this script.
9022136 func_config ()
9032137 {
@@ -915,17 +2149,19 @@ func_config ()
9152149 exit $?
9162150 }
9172151
2152+
9182153 # func_features
2154+# -------------
9192155 # Display the features supported by this script.
9202156 func_features ()
9212157 {
9222158 echo "host: $host"
923- if test "$build_libtool_libs" = yes; then
2159+ if test yes = "$build_libtool_libs"; then
9242160 echo "enable shared libraries"
9252161 else
9262162 echo "disable shared libraries"
9272163 fi
928- if test "$build_old_libs" = yes; then
2164+ if test yes = "$build_old_libs"; then
9292165 echo "enable static libraries"
9302166 else
9312167 echo "disable static libraries"
@@ -934,314 +2170,350 @@ func_features ()
9342170 exit $?
9352171 }
9362172
937-# func_enable_tag tagname
2173+
2174+# func_enable_tag TAGNAME
2175+# -----------------------
9382176 # Verify that TAGNAME is valid, and either flag an error and exit, or
9392177 # enable the TAGNAME tag. We also add TAGNAME to the global $taglist
9402178 # variable here.
9412179 func_enable_tag ()
9422180 {
943- # Global variable:
944- tagname="$1"
2181+ # Global variable:
2182+ tagname=$1
9452183
946- re_begincf="^# ### BEGIN LIBTOOL TAG CONFIG: $tagname\$"
947- re_endcf="^# ### END LIBTOOL TAG CONFIG: $tagname\$"
948- sed_extractcf="/$re_begincf/,/$re_endcf/p"
2184+ re_begincf="^# ### BEGIN LIBTOOL TAG CONFIG: $tagname\$"
2185+ re_endcf="^# ### END LIBTOOL TAG CONFIG: $tagname\$"
2186+ sed_extractcf=/$re_begincf/,/$re_endcf/p
9492187
950- # Validate tagname.
951- case $tagname in
952- *[!-_A-Za-z0-9,/]*)
953- func_fatal_error "invalid tag name: $tagname"
954- ;;
955- esac
2188+ # Validate tagname.
2189+ case $tagname in
2190+ *[!-_A-Za-z0-9,/]*)
2191+ func_fatal_error "invalid tag name: $tagname"
2192+ ;;
2193+ esac
9562194
957- # Don't test for the "default" C tag, as we know it's
958- # there but not specially marked.
959- case $tagname in
960- CC) ;;
2195+ # Don't test for the "default" C tag, as we know it's
2196+ # there but not specially marked.
2197+ case $tagname in
2198+ CC) ;;
9612199 *)
962- if $GREP "$re_begincf" "$progpath" >/dev/null 2>&1; then
963- taglist="$taglist $tagname"
964-
965- # Evaluate the configuration. Be careful to quote the path
966- # and the sed script, to avoid splitting on whitespace, but
967- # also don't use non-portable quotes within backquotes within
968- # quotes we have to do it in 2 steps:
969- extractedcf=`$SED -n -e "$sed_extractcf" < "$progpath"`
970- eval "$extractedcf"
971- else
972- func_error "ignoring unknown tag $tagname"
973- fi
974- ;;
975- esac
2200+ if $GREP "$re_begincf" "$progpath" >/dev/null 2>&1; then
2201+ taglist="$taglist $tagname"
2202+
2203+ # Evaluate the configuration. Be careful to quote the path
2204+ # and the sed script, to avoid splitting on whitespace, but
2205+ # also don't use non-portable quotes within backquotes within
2206+ # quotes we have to do it in 2 steps:
2207+ extractedcf=`$SED -n -e "$sed_extractcf" < "$progpath"`
2208+ eval "$extractedcf"
2209+ else
2210+ func_error "ignoring unknown tag $tagname"
2211+ fi
2212+ ;;
2213+ esac
9762214 }
9772215
2216+
9782217 # func_check_version_match
2218+# ------------------------
9792219 # Ensure that we are using m4 macros, and libtool script from the same
9802220 # release of libtool.
9812221 func_check_version_match ()
9822222 {
983- if test "$package_revision" != "$macro_revision"; then
984- if test "$VERSION" != "$macro_version"; then
985- if test -z "$macro_version"; then
986- cat >&2 <<_LT_EOF
2223+ if test "$package_revision" != "$macro_revision"; then
2224+ if test "$VERSION" != "$macro_version"; then
2225+ if test -z "$macro_version"; then
2226+ cat >&2 <<_LT_EOF
9872227 $progname: Version mismatch error. This is $PACKAGE $VERSION, but the
9882228 $progname: definition of this LT_INIT comes from an older release.
9892229 $progname: You should recreate aclocal.m4 with macros from $PACKAGE $VERSION
9902230 $progname: and run autoconf again.
9912231 _LT_EOF
992- else
993- cat >&2 <<_LT_EOF
2232+ else
2233+ cat >&2 <<_LT_EOF
9942234 $progname: Version mismatch error. This is $PACKAGE $VERSION, but the
9952235 $progname: definition of this LT_INIT comes from $PACKAGE $macro_version.
9962236 $progname: You should recreate aclocal.m4 with macros from $PACKAGE $VERSION
9972237 $progname: and run autoconf again.
9982238 _LT_EOF
999- fi
1000- else
1001- cat >&2 <<_LT_EOF
2239+ fi
2240+ else
2241+ cat >&2 <<_LT_EOF
10022242 $progname: Version mismatch error. This is $PACKAGE $VERSION, revision $package_revision,
10032243 $progname: but the definition of this LT_INIT comes from revision $macro_revision.
10042244 $progname: You should recreate aclocal.m4 with macros from revision $package_revision
10052245 $progname: of $PACKAGE $VERSION and run autoconf again.
10062246 _LT_EOF
1007- fi
2247+ fi
10082248
1009- exit $EXIT_MISMATCH
1010- fi
2249+ exit $EXIT_MISMATCH
2250+ fi
10112251 }
10122252
10132253
1014-# Shorthand for --mode=foo, only valid as the first argument
1015-case $1 in
1016-clean|clea|cle|cl)
1017- shift; set dummy --mode clean ${1+"$@"}; shift
1018- ;;
1019-compile|compil|compi|comp|com|co|c)
1020- shift; set dummy --mode compile ${1+"$@"}; shift
1021- ;;
1022-execute|execut|execu|exec|exe|ex|e)
1023- shift; set dummy --mode execute ${1+"$@"}; shift
1024- ;;
1025-finish|finis|fini|fin|fi|f)
1026- shift; set dummy --mode finish ${1+"$@"}; shift
1027- ;;
1028-install|instal|insta|inst|ins|in|i)
1029- shift; set dummy --mode install ${1+"$@"}; shift
1030- ;;
1031-link|lin|li|l)
1032- shift; set dummy --mode link ${1+"$@"}; shift
1033- ;;
1034-uninstall|uninstal|uninsta|uninst|unins|unin|uni|un|u)
1035- shift; set dummy --mode uninstall ${1+"$@"}; shift
1036- ;;
1037-esac
2254+# libtool_options_prep [ARG]...
2255+# -----------------------------
2256+# Preparation for options parsed by libtool.
2257+libtool_options_prep ()
2258+{
2259+ $debug_mode
10382260
2261+ # Option defaults:
2262+ opt_config=false
2263+ opt_dlopen=
2264+ opt_dry_run=false
2265+ opt_help=false
2266+ opt_mode=
2267+ opt_preserve_dup_deps=false
2268+ opt_quiet=false
10392269
2270+ nonopt=
2271+ preserve_args=
10402272
1041-# Option defaults:
1042-opt_debug=:
1043-opt_dry_run=false
1044-opt_config=false
1045-opt_preserve_dup_deps=false
1046-opt_features=false
1047-opt_finish=false
1048-opt_help=false
1049-opt_help_all=false
1050-opt_silent=:
1051-opt_warning=:
1052-opt_verbose=:
1053-opt_silent=false
1054-opt_verbose=false
2273+ # Shorthand for --mode=foo, only valid as the first argument
2274+ case $1 in
2275+ clean|clea|cle|cl)
2276+ shift; set dummy --mode clean ${1+"$@"}; shift
2277+ ;;
2278+ compile|compil|compi|comp|com|co|c)
2279+ shift; set dummy --mode compile ${1+"$@"}; shift
2280+ ;;
2281+ execute|execut|execu|exec|exe|ex|e)
2282+ shift; set dummy --mode execute ${1+"$@"}; shift
2283+ ;;
2284+ finish|finis|fini|fin|fi|f)
2285+ shift; set dummy --mode finish ${1+"$@"}; shift
2286+ ;;
2287+ install|instal|insta|inst|ins|in|i)
2288+ shift; set dummy --mode install ${1+"$@"}; shift
2289+ ;;
2290+ link|lin|li|l)
2291+ shift; set dummy --mode link ${1+"$@"}; shift
2292+ ;;
2293+ uninstall|uninstal|uninsta|uninst|unins|unin|uni|un|u)
2294+ shift; set dummy --mode uninstall ${1+"$@"}; shift
2295+ ;;
2296+ esac
2297+
2298+ # Pass back the list of options.
2299+ func_quote_for_eval ${1+"$@"}
2300+ libtool_options_prep_result=$func_quote_for_eval_result
2301+}
2302+func_add_hook func_options_prep libtool_options_prep
10552303
10562304
1057-# Parse options once, thoroughly. This comes as soon as possible in the
1058-# script to make things like `--version' happen as quickly as we can.
2305+# libtool_parse_options [ARG]...
2306+# ---------------------------------
2307+# Provide handling for libtool specific options.
2308+libtool_parse_options ()
10592309 {
1060- # this just eases exit handling
1061- while test $# -gt 0; do
1062- opt="$1"
1063- shift
1064- case $opt in
1065- --debug|-x) opt_debug='set -x'
1066- func_echo "enabling shell trace mode"
1067- $opt_debug
1068- ;;
1069- --dry-run|--dryrun|-n)
1070- opt_dry_run=:
1071- ;;
1072- --config)
1073- opt_config=:
1074-func_config
1075- ;;
1076- --dlopen|-dlopen)
1077- optarg="$1"
1078- opt_dlopen="${opt_dlopen+$opt_dlopen
1079-}$optarg"
1080- shift
1081- ;;
1082- --preserve-dup-deps)
1083- opt_preserve_dup_deps=:
1084- ;;
1085- --features)
1086- opt_features=:
1087-func_features
1088- ;;
1089- --finish)
1090- opt_finish=:
1091-set dummy --mode finish ${1+"$@"}; shift
1092- ;;
1093- --help)
1094- opt_help=:
1095- ;;
1096- --help-all)
1097- opt_help_all=:
1098-opt_help=': help-all'
1099- ;;
1100- --mode)
1101- test $# = 0 && func_missing_arg $opt && break
1102- optarg="$1"
1103- opt_mode="$optarg"
1104-case $optarg in
1105- # Valid mode arguments:
1106- clean|compile|execute|finish|install|link|relink|uninstall) ;;
1107-
1108- # Catch anything else as an error
1109- *) func_error "invalid argument for $opt"
1110- exit_cmd=exit
1111- break
1112- ;;
1113-esac
1114- shift
1115- ;;
1116- --no-silent|--no-quiet)
1117- opt_silent=false
1118-func_append preserve_args " $opt"
1119- ;;
1120- --no-warning|--no-warn)
1121- opt_warning=false
1122-func_append preserve_args " $opt"
1123- ;;
1124- --no-verbose)
1125- opt_verbose=false
1126-func_append preserve_args " $opt"
1127- ;;
1128- --silent|--quiet)
1129- opt_silent=:
1130-func_append preserve_args " $opt"
1131- opt_verbose=false
1132- ;;
1133- --verbose|-v)
1134- opt_verbose=:
1135-func_append preserve_args " $opt"
1136-opt_silent=false
1137- ;;
1138- --tag)
1139- test $# = 0 && func_missing_arg $opt && break
1140- optarg="$1"
1141- opt_tag="$optarg"
1142-func_append preserve_args " $opt $optarg"
1143-func_enable_tag "$optarg"
1144- shift
1145- ;;
1146-
1147- -\?|-h) func_usage ;;
1148- --help) func_help ;;
1149- --version) func_version ;;
1150-
1151- # Separate optargs to long options:
1152- --*=*)
1153- func_split_long_opt "$opt"
1154- set dummy "$func_split_long_opt_name" "$func_split_long_opt_arg" ${1+"$@"}
1155- shift
1156- ;;
1157-
1158- # Separate non-argument short options:
1159- -\?*|-h*|-n*|-v*)
1160- func_split_short_opt "$opt"
1161- set dummy "$func_split_short_opt_name" "-$func_split_short_opt_arg" ${1+"$@"}
1162- shift
1163- ;;
1164-
1165- --) break ;;
1166- -*) func_fatal_help "unrecognized option \`$opt'" ;;
1167- *) set dummy "$opt" ${1+"$@"}; shift; break ;;
1168- esac
1169- done
2310+ $debug_cmd
11702311
1171- # Validate options:
2312+ # Perform our own loop to consume as many options as possible in
2313+ # each iteration.
2314+ while test $# -gt 0; do
2315+ _G_opt=$1
2316+ shift
2317+ case $_G_opt in
2318+ --dry-run|--dryrun|-n)
2319+ opt_dry_run=:
2320+ ;;
2321+
2322+ --config) func_config ;;
2323+
2324+ --dlopen|-dlopen)
2325+ opt_dlopen="${opt_dlopen+$opt_dlopen
2326+}$1"
2327+ shift
2328+ ;;
2329+
2330+ --preserve-dup-deps)
2331+ opt_preserve_dup_deps=: ;;
2332+
2333+ --features) func_features ;;
2334+
2335+ --finish) set dummy --mode finish ${1+"$@"}; shift ;;
2336+
2337+ --help) opt_help=: ;;
2338+
2339+ --help-all) opt_help=': help-all' ;;
2340+
2341+ --mode) test $# = 0 && func_missing_arg $_G_opt && break
2342+ opt_mode=$1
2343+ case $1 in
2344+ # Valid mode arguments:
2345+ clean|compile|execute|finish|install|link|relink|uninstall) ;;
2346+
2347+ # Catch anything else as an error
2348+ *) func_error "invalid argument for $_G_opt"
2349+ exit_cmd=exit
2350+ break
2351+ ;;
2352+ esac
2353+ shift
2354+ ;;
2355+
2356+ --no-silent|--no-quiet)
2357+ opt_quiet=false
2358+ func_append preserve_args " $_G_opt"
2359+ ;;
2360+
2361+ --no-warnings|--no-warning|--no-warn)
2362+ opt_warning=false
2363+ func_append preserve_args " $_G_opt"
2364+ ;;
2365+
2366+ --no-verbose)
2367+ opt_verbose=false
2368+ func_append preserve_args " $_G_opt"
2369+ ;;
2370+
2371+ --silent|--quiet)
2372+ opt_quiet=:
2373+ opt_verbose=false
2374+ func_append preserve_args " $_G_opt"
2375+ ;;
2376+
2377+ --tag) test $# = 0 && func_missing_arg $_G_opt && break
2378+ opt_tag=$1
2379+ func_append preserve_args " $_G_opt $1"
2380+ func_enable_tag "$1"
2381+ shift
2382+ ;;
2383+
2384+ --verbose|-v) opt_quiet=false
2385+ opt_verbose=:
2386+ func_append preserve_args " $_G_opt"
2387+ ;;
2388+
2389+ # An option not handled by this hook function:
2390+ *) set dummy "$_G_opt" ${1+"$@"}; shift; break ;;
2391+ esac
2392+ done
11722393
1173- # save first non-option argument
1174- if test "$#" -gt 0; then
1175- nonopt="$opt"
1176- shift
1177- fi
11782394
1179- # preserve --debug
1180- test "$opt_debug" = : || func_append preserve_args " --debug"
2395+ # save modified positional parameters for caller
2396+ func_quote_for_eval ${1+"$@"}
2397+ libtool_parse_options_result=$func_quote_for_eval_result
2398+}
2399+func_add_hook func_parse_options libtool_parse_options
11812400
1182- case $host in
1183- *cygwin* | *mingw* | *pw32* | *cegcc*)
1184- # don't eliminate duplications in $postdeps and $predeps
1185- opt_duplicate_compiler_generated_deps=:
1186- ;;
1187- *)
1188- opt_duplicate_compiler_generated_deps=$opt_preserve_dup_deps
1189- ;;
1190- esac
11912401
1192- $opt_help || {
1193- # Sanity checks first:
1194- func_check_version_match
11952402
1196- if test "$build_libtool_libs" != yes && test "$build_old_libs" != yes; then
1197- func_fatal_configuration "not configured to build any kind of library"
2403+# libtool_validate_options [ARG]...
2404+# ---------------------------------
2405+# Perform any sanity checks on option settings and/or unconsumed
2406+# arguments.
2407+libtool_validate_options ()
2408+{
2409+ # save first non-option argument
2410+ if test 0 -lt $#; then
2411+ nonopt=$1
2412+ shift
11982413 fi
11992414
1200- # Darwin sucks
1201- eval std_shrext=\"$shrext_cmds\"
2415+ # preserve --debug
2416+ test : = "$debug_cmd" || func_append preserve_args " --debug"
12022417
1203- # Only execute mode is allowed to have -dlopen flags.
1204- if test -n "$opt_dlopen" && test "$opt_mode" != execute; then
1205- func_error "unrecognized option \`-dlopen'"
1206- $ECHO "$help" 1>&2
1207- exit $EXIT_FAILURE
1208- fi
2418+ case $host in
2419+ # Solaris2 added to fix http://debbugs.gnu.org/cgi/bugreport.cgi?bug=16452
2420+ # see also: http://gcc.gnu.org/bugzilla/show_bug.cgi?id=59788
2421+ *cygwin* | *mingw* | *pw32* | *cegcc* | *solaris2* | *os2*)
2422+ # don't eliminate duplications in $postdeps and $predeps
2423+ opt_duplicate_compiler_generated_deps=:
2424+ ;;
2425+ *)
2426+ opt_duplicate_compiler_generated_deps=$opt_preserve_dup_deps
2427+ ;;
2428+ esac
12092429
1210- # Change the help message to a mode-specific one.
1211- generic_help="$help"
1212- help="Try \`$progname --help --mode=$opt_mode' for more information."
1213- }
2430+ $opt_help || {
2431+ # Sanity checks first:
2432+ func_check_version_match
2433+
2434+ test yes != "$build_libtool_libs" \
2435+ && test yes != "$build_old_libs" \
2436+ && func_fatal_configuration "not configured to build any kind of library"
2437+
2438+ # Darwin sucks
2439+ eval std_shrext=\"$shrext_cmds\"
2440+
2441+ # Only execute mode is allowed to have -dlopen flags.
2442+ if test -n "$opt_dlopen" && test execute != "$opt_mode"; then
2443+ func_error "unrecognized option '-dlopen'"
2444+ $ECHO "$help" 1>&2
2445+ exit $EXIT_FAILURE
2446+ fi
12142447
2448+ # Change the help message to a mode-specific one.
2449+ generic_help=$help
2450+ help="Try '$progname --help --mode=$opt_mode' for more information."
2451+ }
12152452
1216- # Bail if the options were screwed
1217- $exit_cmd $EXIT_FAILURE
2453+ # Pass back the unparsed argument list
2454+ func_quote_for_eval ${1+"$@"}
2455+ libtool_validate_options_result=$func_quote_for_eval_result
12182456 }
2457+func_add_hook func_validate_options libtool_validate_options
12192458
12202459
2460+# Process options as early as possible so that --help and --version
2461+# can return quickly.
2462+func_options ${1+"$@"}
2463+eval set dummy "$func_options_result"; shift
2464+
12212465
12222466
12232467 ## ----------- ##
12242468 ## Main. ##
12252469 ## ----------- ##
12262470
2471+magic='%%%MAGIC variable%%%'
2472+magic_exe='%%%MAGIC EXE variable%%%'
2473+
2474+# Global variables.
2475+extracted_archives=
2476+extracted_serial=0
2477+
2478+# If this variable is set in any of the actions, the command in it
2479+# will be execed at the end. This prevents here-documents from being
2480+# left over by shells.
2481+exec_cmd=
2482+
2483+
2484+# A function that is used when there is no print builtin or printf.
2485+func_fallback_echo ()
2486+{
2487+ eval 'cat <<_LTECHO_EOF
2488+$1
2489+_LTECHO_EOF'
2490+}
2491+
2492+# func_generated_by_libtool
2493+# True iff stdin has been generated by Libtool. This function is only
2494+# a basic sanity check; it will hardly flush out determined imposters.
2495+func_generated_by_libtool_p ()
2496+{
2497+ $GREP "^# Generated by .*$PACKAGE" > /dev/null 2>&1
2498+}
2499+
12272500 # func_lalib_p file
1228-# True iff FILE is a libtool `.la' library or `.lo' object file.
2501+# True iff FILE is a libtool '.la' library or '.lo' object file.
12292502 # This function is only a basic sanity check; it will hardly flush out
12302503 # determined imposters.
12312504 func_lalib_p ()
12322505 {
12332506 test -f "$1" &&
1234- $SED -e 4q "$1" 2>/dev/null \
1235- | $GREP "^# Generated by .*$PACKAGE" > /dev/null 2>&1
2507+ $SED -e 4q "$1" 2>/dev/null | func_generated_by_libtool_p
12362508 }
12372509
12382510 # func_lalib_unsafe_p file
1239-# True iff FILE is a libtool `.la' library or `.lo' object file.
2511+# True iff FILE is a libtool '.la' library or '.lo' object file.
12402512 # This function implements the same check as func_lalib_p without
12412513 # resorting to external programs. To this end, it redirects stdin and
12422514 # closes it afterwards, without saving the original file descriptor.
12432515 # As a safety measure, use it only where a negative result would be
1244-# fatal anyway. Works if `file' does not exist.
2516+# fatal anyway. Works if 'file' does not exist.
12452517 func_lalib_unsafe_p ()
12462518 {
12472519 lalib_p=no
@@ -1249,13 +2521,13 @@ func_lalib_unsafe_p ()
12492521 for lalib_p_l in 1 2 3 4
12502522 do
12512523 read lalib_p_line
1252- case "$lalib_p_line" in
2524+ case $lalib_p_line in
12532525 \#\ Generated\ by\ *$PACKAGE* ) lalib_p=yes; break;;
12542526 esac
12552527 done
12562528 exec 0<&5 5<&-
12572529 fi
1258- test "$lalib_p" = yes
2530+ test yes = "$lalib_p"
12592531 }
12602532
12612533 # func_ltwrapper_script_p file
@@ -1264,7 +2536,8 @@ func_lalib_unsafe_p ()
12642536 # determined imposters.
12652537 func_ltwrapper_script_p ()
12662538 {
1267- func_lalib_p "$1"
2539+ test -f "$1" &&
2540+ $lt_truncate_bin < "$1" 2>/dev/null | func_generated_by_libtool_p
12682541 }
12692542
12702543 # func_ltwrapper_executable_p file
@@ -1289,7 +2562,7 @@ func_ltwrapper_scriptname ()
12892562 {
12902563 func_dirname_and_basename "$1" "" "."
12912564 func_stripname '' '.exe' "$func_basename_result"
1292- func_ltwrapper_scriptname_result="$func_dirname_result/$objdir/${func_stripname_result}_ltshwrapper"
2565+ func_ltwrapper_scriptname_result=$func_dirname_result/$objdir/${func_stripname_result}_ltshwrapper
12932566 }
12942567
12952568 # func_ltwrapper_p file
@@ -1308,11 +2581,13 @@ func_ltwrapper_p ()
13082581 # FAIL_CMD may read-access the current command in variable CMD!
13092582 func_execute_cmds ()
13102583 {
1311- $opt_debug
2584+ $debug_cmd
2585+
13122586 save_ifs=$IFS; IFS='~'
13132587 for cmd in $1; do
1314- IFS=$save_ifs
2588+ IFS=$sp$nl
13152589 eval cmd=\"$cmd\"
2590+ IFS=$save_ifs
13162591 func_show_eval "$cmd" "${2-:}"
13172592 done
13182593 IFS=$save_ifs
@@ -1324,10 +2599,11 @@ func_execute_cmds ()
13242599 # Note that it is not necessary on cygwin/mingw to append a dot to
13252600 # FILE even if both FILE and FILE.exe exist: automatic-append-.exe
13262601 # behavior happens only for exec(3), not for open(2)! Also, sourcing
1327-# `FILE.' does not work on cygwin managed mounts.
2602+# 'FILE.' does not work on cygwin managed mounts.
13282603 func_source ()
13292604 {
1330- $opt_debug
2605+ $debug_cmd
2606+
13312607 case $1 in
13322608 */* | *\\*) . "$1" ;;
13332609 *) . "./$1" ;;
@@ -1354,10 +2630,10 @@ func_resolve_sysroot ()
13542630 # store the result into func_replace_sysroot_result.
13552631 func_replace_sysroot ()
13562632 {
1357- case "$lt_sysroot:$1" in
2633+ case $lt_sysroot:$1 in
13582634 ?*:"$lt_sysroot"*)
13592635 func_stripname "$lt_sysroot" '' "$1"
1360- func_replace_sysroot_result="=$func_stripname_result"
2636+ func_replace_sysroot_result='='$func_stripname_result
13612637 ;;
13622638 *)
13632639 # Including no sysroot.
@@ -1374,7 +2650,8 @@ func_replace_sysroot ()
13742650 # arg is usually of the form 'gcc ...'
13752651 func_infer_tag ()
13762652 {
1377- $opt_debug
2653+ $debug_cmd
2654+
13782655 if test -n "$available_tags" && test -z "$tagname"; then
13792656 CC_quoted=
13802657 for arg in $CC; do
@@ -1393,7 +2670,7 @@ func_infer_tag ()
13932670 for z in $available_tags; do
13942671 if $GREP "^# ### BEGIN LIBTOOL TAG CONFIG: $z$" < "$progpath" > /dev/null; then
13952672 # Evaluate the configuration.
1396- eval "`${SED} -n -e '/^# ### BEGIN LIBTOOL TAG CONFIG: '$z'$/,/^# ### END LIBTOOL TAG CONFIG: '$z'$/p' < $progpath`"
2673+ eval "`$SED -n -e '/^# ### BEGIN LIBTOOL TAG CONFIG: '$z'$/,/^# ### END LIBTOOL TAG CONFIG: '$z'$/p' < $progpath`"
13972674 CC_quoted=
13982675 for arg in $CC; do
13992676 # Double-quote args containing other shell metacharacters.
@@ -1418,7 +2695,7 @@ func_infer_tag ()
14182695 # line option must be used.
14192696 if test -z "$tagname"; then
14202697 func_echo "unable to infer tagged configuration"
1421- func_fatal_error "specify a tag with \`--tag'"
2698+ func_fatal_error "specify a tag with '--tag'"
14222699 # else
14232700 # func_verbose "using $tagname tagged configuration"
14242701 fi
@@ -1434,15 +2711,15 @@ func_infer_tag ()
14342711 # but don't create it if we're doing a dry run.
14352712 func_write_libtool_object ()
14362713 {
1437- write_libobj=${1}
1438- if test "$build_libtool_libs" = yes; then
1439- write_lobj=\'${2}\'
2714+ write_libobj=$1
2715+ if test yes = "$build_libtool_libs"; then
2716+ write_lobj=\'$2\'
14402717 else
14412718 write_lobj=none
14422719 fi
14432720
1444- if test "$build_old_libs" = yes; then
1445- write_oldobj=\'${3}\'
2721+ if test yes = "$build_old_libs"; then
2722+ write_oldobj=\'$3\'
14462723 else
14472724 write_oldobj=none
14482725 fi
@@ -1450,7 +2727,7 @@ func_write_libtool_object ()
14502727 $opt_dry_run || {
14512728 cat >${write_libobj}T <<EOF
14522729 # $write_libobj - a libtool object file
1453-# Generated by $PROGRAM (GNU $PACKAGE$TIMESTAMP) $VERSION
2730+# Generated by $PROGRAM (GNU $PACKAGE) $VERSION
14542731 #
14552732 # Please DO NOT delete this file!
14562733 # It is necessary for linking the library.
@@ -1462,7 +2739,7 @@ pic_object=$write_lobj
14622739 non_pic_object=$write_oldobj
14632740
14642741 EOF
1465- $MV "${write_libobj}T" "${write_libobj}"
2742+ $MV "${write_libobj}T" "$write_libobj"
14662743 }
14672744 }
14682745
@@ -1482,8 +2759,9 @@ EOF
14822759 # be empty on error (or when ARG is empty)
14832760 func_convert_core_file_wine_to_w32 ()
14842761 {
1485- $opt_debug
1486- func_convert_core_file_wine_to_w32_result="$1"
2762+ $debug_cmd
2763+
2764+ func_convert_core_file_wine_to_w32_result=$1
14872765 if test -n "$1"; then
14882766 # Unfortunately, winepath does not exit with a non-zero error code, so we
14892767 # are forced to check the contents of stdout. On the other hand, if the
@@ -1491,9 +2769,9 @@ func_convert_core_file_wine_to_w32 ()
14912769 # *an error message* to stdout. So we must check for both error code of
14922770 # zero AND non-empty stdout, which explains the odd construction:
14932771 func_convert_core_file_wine_to_w32_tmp=`winepath -w "$1" 2>/dev/null`
1494- if test "$?" -eq 0 && test -n "${func_convert_core_file_wine_to_w32_tmp}"; then
2772+ if test "$?" -eq 0 && test -n "$func_convert_core_file_wine_to_w32_tmp"; then
14952773 func_convert_core_file_wine_to_w32_result=`$ECHO "$func_convert_core_file_wine_to_w32_tmp" |
1496- $SED -e "$lt_sed_naive_backslashify"`
2774+ $SED -e "$sed_naive_backslashify"`
14972775 else
14982776 func_convert_core_file_wine_to_w32_result=
14992777 fi
@@ -1514,18 +2792,19 @@ func_convert_core_file_wine_to_w32 ()
15142792 # are convertible, then the result may be empty.
15152793 func_convert_core_path_wine_to_w32 ()
15162794 {
1517- $opt_debug
2795+ $debug_cmd
2796+
15182797 # unfortunately, winepath doesn't convert paths, only file names
1519- func_convert_core_path_wine_to_w32_result=""
2798+ func_convert_core_path_wine_to_w32_result=
15202799 if test -n "$1"; then
15212800 oldIFS=$IFS
15222801 IFS=:
15232802 for func_convert_core_path_wine_to_w32_f in $1; do
15242803 IFS=$oldIFS
15252804 func_convert_core_file_wine_to_w32 "$func_convert_core_path_wine_to_w32_f"
1526- if test -n "$func_convert_core_file_wine_to_w32_result" ; then
2805+ if test -n "$func_convert_core_file_wine_to_w32_result"; then
15272806 if test -z "$func_convert_core_path_wine_to_w32_result"; then
1528- func_convert_core_path_wine_to_w32_result="$func_convert_core_file_wine_to_w32_result"
2807+ func_convert_core_path_wine_to_w32_result=$func_convert_core_file_wine_to_w32_result
15292808 else
15302809 func_append func_convert_core_path_wine_to_w32_result ";$func_convert_core_file_wine_to_w32_result"
15312810 fi
@@ -1554,7 +2833,8 @@ func_convert_core_path_wine_to_w32 ()
15542833 # environment variable; do not put it in $PATH.
15552834 func_cygpath ()
15562835 {
1557- $opt_debug
2836+ $debug_cmd
2837+
15582838 if test -n "$LT_CYGPATH" && test -f "$LT_CYGPATH"; then
15592839 func_cygpath_result=`$LT_CYGPATH "$@" 2>/dev/null`
15602840 if test "$?" -ne 0; then
@@ -1563,7 +2843,7 @@ func_cygpath ()
15632843 fi
15642844 else
15652845 func_cygpath_result=
1566- func_error "LT_CYGPATH is empty or specifies non-existent file: \`$LT_CYGPATH'"
2846+ func_error "LT_CYGPATH is empty or specifies non-existent file: '$LT_CYGPATH'"
15672847 fi
15682848 }
15692849 #end: func_cygpath
@@ -1574,10 +2854,11 @@ func_cygpath ()
15742854 # result in func_convert_core_msys_to_w32_result.
15752855 func_convert_core_msys_to_w32 ()
15762856 {
1577- $opt_debug
2857+ $debug_cmd
2858+
15782859 # awkward: cmd appends spaces to result
15792860 func_convert_core_msys_to_w32_result=`( cmd //c echo "$1" ) 2>/dev/null |
1580- $SED -e 's/[ ]*$//' -e "$lt_sed_naive_backslashify"`
2861+ $SED -e 's/[ ]*$//' -e "$sed_naive_backslashify"`
15812862 }
15822863 #end: func_convert_core_msys_to_w32
15832864
@@ -1588,13 +2869,14 @@ func_convert_core_msys_to_w32 ()
15882869 # func_to_host_file_result to ARG1).
15892870 func_convert_file_check ()
15902871 {
1591- $opt_debug
1592- if test -z "$2" && test -n "$1" ; then
2872+ $debug_cmd
2873+
2874+ if test -z "$2" && test -n "$1"; then
15932875 func_error "Could not determine host file name corresponding to"
1594- func_error " \`$1'"
2876+ func_error " '$1'"
15952877 func_error "Continuing, but uninstalled executables may not work."
15962878 # Fallback:
1597- func_to_host_file_result="$1"
2879+ func_to_host_file_result=$1
15982880 fi
15992881 }
16002882 # end func_convert_file_check
@@ -1606,10 +2888,11 @@ func_convert_file_check ()
16062888 # func_to_host_file_result to a simplistic fallback value (see below).
16072889 func_convert_path_check ()
16082890 {
1609- $opt_debug
2891+ $debug_cmd
2892+
16102893 if test -z "$4" && test -n "$3"; then
16112894 func_error "Could not determine the host path corresponding to"
1612- func_error " \`$3'"
2895+ func_error " '$3'"
16132896 func_error "Continuing, but uninstalled executables may not work."
16142897 # Fallback. This is a deliberately simplistic "conversion" and
16152898 # should not be "improved". See libtool.info.
@@ -1618,7 +2901,7 @@ func_convert_path_check ()
16182901 func_to_host_path_result=`echo "$3" |
16192902 $SED -e "$lt_replace_pathsep_chars"`
16202903 else
1621- func_to_host_path_result="$3"
2904+ func_to_host_path_result=$3
16222905 fi
16232906 fi
16242907 }
@@ -1630,9 +2913,10 @@ func_convert_path_check ()
16302913 # and appending REPL if ORIG matches BACKPAT.
16312914 func_convert_path_front_back_pathsep ()
16322915 {
1633- $opt_debug
2916+ $debug_cmd
2917+
16342918 case $4 in
1635- $1 ) func_to_host_path_result="$3$func_to_host_path_result"
2919+ $1 ) func_to_host_path_result=$3$func_to_host_path_result
16362920 ;;
16372921 esac
16382922 case $4 in
@@ -1646,7 +2930,7 @@ func_convert_path_front_back_pathsep ()
16462930 ##################################################
16472931 # $build to $host FILE NAME CONVERSION FUNCTIONS #
16482932 ##################################################
1649-# invoked via `$to_host_file_cmd ARG'
2933+# invoked via '$to_host_file_cmd ARG'
16502934 #
16512935 # In each case, ARG is the path to be converted from $build to $host format.
16522936 # Result will be available in $func_to_host_file_result.
@@ -1657,7 +2941,8 @@ func_convert_path_front_back_pathsep ()
16572941 # in func_to_host_file_result.
16582942 func_to_host_file ()
16592943 {
1660- $opt_debug
2944+ $debug_cmd
2945+
16612946 $to_host_file_cmd "$1"
16622947 }
16632948 # end func_to_host_file
@@ -1669,7 +2954,8 @@ func_to_host_file ()
16692954 # in (the comma separated) LAZY, no conversion takes place.
16702955 func_to_tool_file ()
16712956 {
1672- $opt_debug
2957+ $debug_cmd
2958+
16732959 case ,$2, in
16742960 *,"$to_tool_file_cmd",*)
16752961 func_to_tool_file_result=$1
@@ -1687,7 +2973,7 @@ func_to_tool_file ()
16872973 # Copy ARG to func_to_host_file_result.
16882974 func_convert_file_noop ()
16892975 {
1690- func_to_host_file_result="$1"
2976+ func_to_host_file_result=$1
16912977 }
16922978 # end func_convert_file_noop
16932979
@@ -1698,11 +2984,12 @@ func_convert_file_noop ()
16982984 # func_to_host_file_result.
16992985 func_convert_file_msys_to_w32 ()
17002986 {
1701- $opt_debug
1702- func_to_host_file_result="$1"
2987+ $debug_cmd
2988+
2989+ func_to_host_file_result=$1
17032990 if test -n "$1"; then
17042991 func_convert_core_msys_to_w32 "$1"
1705- func_to_host_file_result="$func_convert_core_msys_to_w32_result"
2992+ func_to_host_file_result=$func_convert_core_msys_to_w32_result
17062993 fi
17072994 func_convert_file_check "$1" "$func_to_host_file_result"
17082995 }
@@ -1714,8 +3001,9 @@ func_convert_file_msys_to_w32 ()
17143001 # func_to_host_file_result.
17153002 func_convert_file_cygwin_to_w32 ()
17163003 {
1717- $opt_debug
1718- func_to_host_file_result="$1"
3004+ $debug_cmd
3005+
3006+ func_to_host_file_result=$1
17193007 if test -n "$1"; then
17203008 # because $build is cygwin, we call "the" cygpath in $PATH; no need to use
17213009 # LT_CYGPATH in this case.
@@ -1731,11 +3019,12 @@ func_convert_file_cygwin_to_w32 ()
17313019 # and a working winepath. Returns result in func_to_host_file_result.
17323020 func_convert_file_nix_to_w32 ()
17333021 {
1734- $opt_debug
1735- func_to_host_file_result="$1"
3022+ $debug_cmd
3023+
3024+ func_to_host_file_result=$1
17363025 if test -n "$1"; then
17373026 func_convert_core_file_wine_to_w32 "$1"
1738- func_to_host_file_result="$func_convert_core_file_wine_to_w32_result"
3027+ func_to_host_file_result=$func_convert_core_file_wine_to_w32_result
17393028 fi
17403029 func_convert_file_check "$1" "$func_to_host_file_result"
17413030 }
@@ -1747,12 +3036,13 @@ func_convert_file_nix_to_w32 ()
17473036 # Returns result in func_to_host_file_result.
17483037 func_convert_file_msys_to_cygwin ()
17493038 {
1750- $opt_debug
1751- func_to_host_file_result="$1"
3039+ $debug_cmd
3040+
3041+ func_to_host_file_result=$1
17523042 if test -n "$1"; then
17533043 func_convert_core_msys_to_w32 "$1"
17543044 func_cygpath -u "$func_convert_core_msys_to_w32_result"
1755- func_to_host_file_result="$func_cygpath_result"
3045+ func_to_host_file_result=$func_cygpath_result
17563046 fi
17573047 func_convert_file_check "$1" "$func_to_host_file_result"
17583048 }
@@ -1765,13 +3055,14 @@ func_convert_file_msys_to_cygwin ()
17653055 # in func_to_host_file_result.
17663056 func_convert_file_nix_to_cygwin ()
17673057 {
1768- $opt_debug
1769- func_to_host_file_result="$1"
3058+ $debug_cmd
3059+
3060+ func_to_host_file_result=$1
17703061 if test -n "$1"; then
17713062 # convert from *nix to w32, then use cygpath to convert from w32 to cygwin.
17723063 func_convert_core_file_wine_to_w32 "$1"
17733064 func_cygpath -u "$func_convert_core_file_wine_to_w32_result"
1774- func_to_host_file_result="$func_cygpath_result"
3065+ func_to_host_file_result=$func_cygpath_result
17753066 fi
17763067 func_convert_file_check "$1" "$func_to_host_file_result"
17773068 }
@@ -1781,7 +3072,7 @@ func_convert_file_nix_to_cygwin ()
17813072 #############################################
17823073 # $build to $host PATH CONVERSION FUNCTIONS #
17833074 #############################################
1784-# invoked via `$to_host_path_cmd ARG'
3075+# invoked via '$to_host_path_cmd ARG'
17853076 #
17863077 # In each case, ARG is the path to be converted from $build to $host format.
17873078 # The result will be available in $func_to_host_path_result.
@@ -1805,10 +3096,11 @@ func_convert_file_nix_to_cygwin ()
18053096 to_host_path_cmd=
18063097 func_init_to_host_path_cmd ()
18073098 {
1808- $opt_debug
3099+ $debug_cmd
3100+
18093101 if test -z "$to_host_path_cmd"; then
18103102 func_stripname 'func_convert_file_' '' "$to_host_file_cmd"
1811- to_host_path_cmd="func_convert_path_${func_stripname_result}"
3103+ to_host_path_cmd=func_convert_path_$func_stripname_result
18123104 fi
18133105 }
18143106
@@ -1818,7 +3110,8 @@ func_init_to_host_path_cmd ()
18183110 # in func_to_host_path_result.
18193111 func_to_host_path ()
18203112 {
1821- $opt_debug
3113+ $debug_cmd
3114+
18223115 func_init_to_host_path_cmd
18233116 $to_host_path_cmd "$1"
18243117 }
@@ -1829,7 +3122,7 @@ func_to_host_path ()
18293122 # Copy ARG to func_to_host_path_result.
18303123 func_convert_path_noop ()
18313124 {
1832- func_to_host_path_result="$1"
3125+ func_to_host_path_result=$1
18333126 }
18343127 # end func_convert_path_noop
18353128
@@ -1840,8 +3133,9 @@ func_convert_path_noop ()
18403133 # func_to_host_path_result.
18413134 func_convert_path_msys_to_w32 ()
18423135 {
1843- $opt_debug
1844- func_to_host_path_result="$1"
3136+ $debug_cmd
3137+
3138+ func_to_host_path_result=$1
18453139 if test -n "$1"; then
18463140 # Remove leading and trailing path separator characters from ARG. MSYS
18473141 # behavior is inconsistent here; cygpath turns them into '.;' and ';.';
@@ -1849,7 +3143,7 @@ func_convert_path_msys_to_w32 ()
18493143 func_stripname : : "$1"
18503144 func_to_host_path_tmp1=$func_stripname_result
18513145 func_convert_core_msys_to_w32 "$func_to_host_path_tmp1"
1852- func_to_host_path_result="$func_convert_core_msys_to_w32_result"
3146+ func_to_host_path_result=$func_convert_core_msys_to_w32_result
18533147 func_convert_path_check : ";" \
18543148 "$func_to_host_path_tmp1" "$func_to_host_path_result"
18553149 func_convert_path_front_back_pathsep ":*" "*:" ";" "$1"
@@ -1863,8 +3157,9 @@ func_convert_path_msys_to_w32 ()
18633157 # func_to_host_file_result.
18643158 func_convert_path_cygwin_to_w32 ()
18653159 {
1866- $opt_debug
1867- func_to_host_path_result="$1"
3160+ $debug_cmd
3161+
3162+ func_to_host_path_result=$1
18683163 if test -n "$1"; then
18693164 # See func_convert_path_msys_to_w32:
18703165 func_stripname : : "$1"
@@ -1883,14 +3178,15 @@ func_convert_path_cygwin_to_w32 ()
18833178 # a working winepath. Returns result in func_to_host_file_result.
18843179 func_convert_path_nix_to_w32 ()
18853180 {
1886- $opt_debug
1887- func_to_host_path_result="$1"
3181+ $debug_cmd
3182+
3183+ func_to_host_path_result=$1
18883184 if test -n "$1"; then
18893185 # See func_convert_path_msys_to_w32:
18903186 func_stripname : : "$1"
18913187 func_to_host_path_tmp1=$func_stripname_result
18923188 func_convert_core_path_wine_to_w32 "$func_to_host_path_tmp1"
1893- func_to_host_path_result="$func_convert_core_path_wine_to_w32_result"
3189+ func_to_host_path_result=$func_convert_core_path_wine_to_w32_result
18943190 func_convert_path_check : ";" \
18953191 "$func_to_host_path_tmp1" "$func_to_host_path_result"
18963192 func_convert_path_front_back_pathsep ":*" "*:" ";" "$1"
@@ -1904,15 +3200,16 @@ func_convert_path_nix_to_w32 ()
19043200 # Returns result in func_to_host_file_result.
19053201 func_convert_path_msys_to_cygwin ()
19063202 {
1907- $opt_debug
1908- func_to_host_path_result="$1"
3203+ $debug_cmd
3204+
3205+ func_to_host_path_result=$1
19093206 if test -n "$1"; then
19103207 # See func_convert_path_msys_to_w32:
19113208 func_stripname : : "$1"
19123209 func_to_host_path_tmp1=$func_stripname_result
19133210 func_convert_core_msys_to_w32 "$func_to_host_path_tmp1"
19143211 func_cygpath -u -p "$func_convert_core_msys_to_w32_result"
1915- func_to_host_path_result="$func_cygpath_result"
3212+ func_to_host_path_result=$func_cygpath_result
19163213 func_convert_path_check : : \
19173214 "$func_to_host_path_tmp1" "$func_to_host_path_result"
19183215 func_convert_path_front_back_pathsep ":*" "*:" : "$1"
@@ -1927,8 +3224,9 @@ func_convert_path_msys_to_cygwin ()
19273224 # func_to_host_file_result.
19283225 func_convert_path_nix_to_cygwin ()
19293226 {
1930- $opt_debug
1931- func_to_host_path_result="$1"
3227+ $debug_cmd
3228+
3229+ func_to_host_path_result=$1
19323230 if test -n "$1"; then
19333231 # Remove leading and trailing path separator characters from
19343232 # ARG. msys behavior is inconsistent here, cygpath turns them
@@ -1937,7 +3235,7 @@ func_convert_path_nix_to_cygwin ()
19373235 func_to_host_path_tmp1=$func_stripname_result
19383236 func_convert_core_path_wine_to_w32 "$func_to_host_path_tmp1"
19393237 func_cygpath -u -p "$func_convert_core_path_wine_to_w32_result"
1940- func_to_host_path_result="$func_cygpath_result"
3238+ func_to_host_path_result=$func_cygpath_result
19413239 func_convert_path_check : : \
19423240 "$func_to_host_path_tmp1" "$func_to_host_path_result"
19433241 func_convert_path_front_back_pathsep ":*" "*:" : "$1"
@@ -1946,13 +3244,31 @@ func_convert_path_nix_to_cygwin ()
19463244 # end func_convert_path_nix_to_cygwin
19473245
19483246
3247+# func_dll_def_p FILE
3248+# True iff FILE is a Windows DLL '.def' file.
3249+# Keep in sync with _LT_DLL_DEF_P in libtool.m4
3250+func_dll_def_p ()
3251+{
3252+ $debug_cmd
3253+
3254+ func_dll_def_p_tmp=`$SED -n \
3255+ -e 's/^[ ]*//' \
3256+ -e '/^\(;.*\)*$/d' \
3257+ -e 's/^\(EXPORTS\|LIBRARY\)\([ ].*\)*$/DEF/p' \
3258+ -e q \
3259+ "$1"`
3260+ test DEF = "$func_dll_def_p_tmp"
3261+}
3262+
3263+
19493264 # func_mode_compile arg...
19503265 func_mode_compile ()
19513266 {
1952- $opt_debug
3267+ $debug_cmd
3268+
19533269 # Get the compilation command and the source file.
19543270 base_compile=
1955- srcfile="$nonopt" # always keep a non-empty value in "srcfile"
3271+ srcfile=$nonopt # always keep a non-empty value in "srcfile"
19563272 suppress_opt=yes
19573273 suppress_output=
19583274 arg_mode=normal
@@ -1965,12 +3281,12 @@ func_mode_compile ()
19653281 case $arg_mode in
19663282 arg )
19673283 # do not "continue". Instead, add this to base_compile
1968- lastarg="$arg"
3284+ lastarg=$arg
19693285 arg_mode=normal
19703286 ;;
19713287
19723288 target )
1973- libobj="$arg"
3289+ libobj=$arg
19743290 arg_mode=normal
19753291 continue
19763292 ;;
@@ -1980,7 +3296,7 @@ func_mode_compile ()
19803296 case $arg in
19813297 -o)
19823298 test -n "$libobj" && \
1983- func_fatal_error "you cannot specify \`-o' more than once"
3299+ func_fatal_error "you cannot specify '-o' more than once"
19843300 arg_mode=target
19853301 continue
19863302 ;;
@@ -2009,12 +3325,12 @@ func_mode_compile ()
20093325 func_stripname '-Wc,' '' "$arg"
20103326 args=$func_stripname_result
20113327 lastarg=
2012- save_ifs="$IFS"; IFS=','
3328+ save_ifs=$IFS; IFS=,
20133329 for arg in $args; do
2014- IFS="$save_ifs"
3330+ IFS=$save_ifs
20153331 func_append_quoted lastarg "$arg"
20163332 done
2017- IFS="$save_ifs"
3333+ IFS=$save_ifs
20183334 func_stripname ' ' '' "$lastarg"
20193335 lastarg=$func_stripname_result
20203336
@@ -2027,8 +3343,8 @@ func_mode_compile ()
20273343 # Accept the current argument as the source file.
20283344 # The previous "srcfile" becomes the current argument.
20293345 #
2030- lastarg="$srcfile"
2031- srcfile="$arg"
3346+ lastarg=$srcfile
3347+ srcfile=$arg
20323348 ;;
20333349 esac # case $arg
20343350 ;;
@@ -2043,13 +3359,13 @@ func_mode_compile ()
20433359 func_fatal_error "you must specify an argument for -Xcompile"
20443360 ;;
20453361 target)
2046- func_fatal_error "you must specify a target with \`-o'"
3362+ func_fatal_error "you must specify a target with '-o'"
20473363 ;;
20483364 *)
20493365 # Get the name of the library object.
20503366 test -z "$libobj" && {
20513367 func_basename "$srcfile"
2052- libobj="$func_basename_result"
3368+ libobj=$func_basename_result
20533369 }
20543370 ;;
20553371 esac
@@ -2069,7 +3385,7 @@ func_mode_compile ()
20693385 case $libobj in
20703386 *.lo) func_lo2o "$libobj"; obj=$func_lo2o_result ;;
20713387 *)
2072- func_fatal_error "cannot determine name of library object from \`$libobj'"
3388+ func_fatal_error "cannot determine name of library object from '$libobj'"
20733389 ;;
20743390 esac
20753391
@@ -2078,8 +3394,8 @@ func_mode_compile ()
20783394 for arg in $later; do
20793395 case $arg in
20803396 -shared)
2081- test "$build_libtool_libs" != yes && \
2082- func_fatal_configuration "can not build a shared library"
3397+ test yes = "$build_libtool_libs" \
3398+ || func_fatal_configuration "cannot build a shared library"
20833399 build_old_libs=no
20843400 continue
20853401 ;;
@@ -2105,17 +3421,17 @@ func_mode_compile ()
21053421 func_quote_for_eval "$libobj"
21063422 test "X$libobj" != "X$func_quote_for_eval_result" \
21073423 && $ECHO "X$libobj" | $GREP '[]~#^*{};<>?"'"'"' &()|`$[]' \
2108- && func_warning "libobj name \`$libobj' may not contain shell special characters."
3424+ && func_warning "libobj name '$libobj' may not contain shell special characters."
21093425 func_dirname_and_basename "$obj" "/" ""
2110- objname="$func_basename_result"
2111- xdir="$func_dirname_result"
2112- lobj=${xdir}$objdir/$objname
3426+ objname=$func_basename_result
3427+ xdir=$func_dirname_result
3428+ lobj=$xdir$objdir/$objname
21133429
21143430 test -z "$base_compile" && \
21153431 func_fatal_help "you must specify a compilation command"
21163432
21173433 # Delete any leftover library objects.
2118- if test "$build_old_libs" = yes; then
3434+ if test yes = "$build_old_libs"; then
21193435 removelist="$obj $lobj $libobj ${libobj}T"
21203436 else
21213437 removelist="$lobj $libobj ${libobj}T"
@@ -2127,16 +3443,16 @@ func_mode_compile ()
21273443 pic_mode=default
21283444 ;;
21293445 esac
2130- if test "$pic_mode" = no && test "$deplibs_check_method" != pass_all; then
3446+ if test no = "$pic_mode" && test pass_all != "$deplibs_check_method"; then
21313447 # non-PIC code in shared libraries is not supported
21323448 pic_mode=default
21333449 fi
21343450
21353451 # Calculate the filename of the output object if compiler does
21363452 # not support -o with -c
2137- if test "$compiler_c_o" = no; then
2138- output_obj=`$ECHO "$srcfile" | $SED 's%^.*/%%; s%\.[^.]*$%%'`.${objext}
2139- lockfile="$output_obj.lock"
3453+ if test no = "$compiler_c_o"; then
3454+ output_obj=`$ECHO "$srcfile" | $SED 's%^.*/%%; s%\.[^.]*$%%'`.$objext
3455+ lockfile=$output_obj.lock
21403456 else
21413457 output_obj=
21423458 need_locks=no
@@ -2145,12 +3461,12 @@ func_mode_compile ()
21453461
21463462 # Lock this critical section if it is needed
21473463 # We use this script file to make the link, it avoids creating a new file
2148- if test "$need_locks" = yes; then
3464+ if test yes = "$need_locks"; then
21493465 until $opt_dry_run || ln "$progpath" "$lockfile" 2>/dev/null; do
21503466 func_echo "Waiting for $lockfile to be removed"
21513467 sleep 2
21523468 done
2153- elif test "$need_locks" = warn; then
3469+ elif test warn = "$need_locks"; then
21543470 if test -f "$lockfile"; then
21553471 $ECHO "\
21563472 *** ERROR, $lockfile exists and contains:
@@ -2158,7 +3474,7 @@ func_mode_compile ()
21583474
21593475 This indicates that another process is trying to use the same
21603476 temporary object file, and libtool could not work around it because
2161-your compiler does not support \`-c' and \`-o' together. If you
3477+your compiler does not support '-c' and '-o' together. If you
21623478 repeat this compilation, it may succeed, by chance, but you had better
21633479 avoid parallel builds (make -j) in this platform, or get a better
21643480 compiler."
@@ -2180,11 +3496,11 @@ compiler."
21803496 qsrcfile=$func_quote_for_eval_result
21813497
21823498 # Only build a PIC object if we are building libtool libraries.
2183- if test "$build_libtool_libs" = yes; then
3499+ if test yes = "$build_libtool_libs"; then
21843500 # Without this assignment, base_compile gets emptied.
21853501 fbsd_hideous_sh_bug=$base_compile
21863502
2187- if test "$pic_mode" != no; then
3503+ if test no != "$pic_mode"; then
21883504 command="$base_compile $qsrcfile $pic_flag"
21893505 else
21903506 # Don't build PIC code
@@ -2201,7 +3517,7 @@ compiler."
22013517 func_show_eval_locale "$command" \
22023518 'test -n "$output_obj" && $RM $removelist; exit $EXIT_FAILURE'
22033519
2204- if test "$need_locks" = warn &&
3520+ if test warn = "$need_locks" &&
22053521 test "X`cat $lockfile 2>/dev/null`" != "X$srcfile"; then
22063522 $ECHO "\
22073523 *** ERROR, $lockfile contains:
@@ -2212,7 +3528,7 @@ $srcfile
22123528
22133529 This indicates that another process is trying to use the same
22143530 temporary object file, and libtool could not work around it because
2215-your compiler does not support \`-c' and \`-o' together. If you
3531+your compiler does not support '-c' and '-o' together. If you
22163532 repeat this compilation, it may succeed, by chance, but you had better
22173533 avoid parallel builds (make -j) in this platform, or get a better
22183534 compiler."
@@ -2228,20 +3544,20 @@ compiler."
22283544 fi
22293545
22303546 # Allow error messages only from the first compilation.
2231- if test "$suppress_opt" = yes; then
3547+ if test yes = "$suppress_opt"; then
22323548 suppress_output=' >/dev/null 2>&1'
22333549 fi
22343550 fi
22353551
22363552 # Only build a position-dependent object if we build old libraries.
2237- if test "$build_old_libs" = yes; then
2238- if test "$pic_mode" != yes; then
3553+ if test yes = "$build_old_libs"; then
3554+ if test yes != "$pic_mode"; then
22393555 # Don't build PIC code
22403556 command="$base_compile $qsrcfile$pie_flag"
22413557 else
22423558 command="$base_compile $qsrcfile $pic_flag"
22433559 fi
2244- if test "$compiler_c_o" = yes; then
3560+ if test yes = "$compiler_c_o"; then
22453561 func_append command " -o $obj"
22463562 fi
22473563
@@ -2250,7 +3566,7 @@ compiler."
22503566 func_show_eval_locale "$command" \
22513567 '$opt_dry_run || $RM $removelist; exit $EXIT_FAILURE'
22523568
2253- if test "$need_locks" = warn &&
3569+ if test warn = "$need_locks" &&
22543570 test "X`cat $lockfile 2>/dev/null`" != "X$srcfile"; then
22553571 $ECHO "\
22563572 *** ERROR, $lockfile contains:
@@ -2261,7 +3577,7 @@ $srcfile
22613577
22623578 This indicates that another process is trying to use the same
22633579 temporary object file, and libtool could not work around it because
2264-your compiler does not support \`-c' and \`-o' together. If you
3580+your compiler does not support '-c' and '-o' together. If you
22653581 repeat this compilation, it may succeed, by chance, but you had better
22663582 avoid parallel builds (make -j) in this platform, or get a better
22673583 compiler."
@@ -2281,7 +3597,7 @@ compiler."
22813597 func_write_libtool_object "$libobj" "$objdir/$objname" "$objname"
22823598
22833599 # Unlock the critical section if it was locked
2284- if test "$need_locks" != no; then
3600+ if test no != "$need_locks"; then
22853601 removelist=$lockfile
22863602 $RM "$lockfile"
22873603 fi
@@ -2291,7 +3607,7 @@ compiler."
22913607 }
22923608
22933609 $opt_help || {
2294- test "$opt_mode" = compile && func_mode_compile ${1+"$@"}
3610+ test compile = "$opt_mode" && func_mode_compile ${1+"$@"}
22953611 }
22963612
22973613 func_mode_help ()
@@ -2311,7 +3627,7 @@ func_mode_help ()
23113627 Remove files from the build directory.
23123628
23133629 RM is the name of the program to use to delete files associated with each FILE
2314-(typically \`/bin/rm'). RM-OPTIONS are options (such as \`-f') to be passed
3630+(typically '/bin/rm'). RM-OPTIONS are options (such as '-f') to be passed
23153631 to RM.
23163632
23173633 If FILE is a libtool library, object or program, all the files associated
@@ -2330,16 +3646,16 @@ This mode accepts the following additional options:
23303646 -no-suppress do not suppress compiler output for multiple passes
23313647 -prefer-pic try to build PIC objects only
23323648 -prefer-non-pic try to build non-PIC objects only
2333- -shared do not build a \`.o' file suitable for static linking
2334- -static only build a \`.o' file suitable for static linking
3649+ -shared do not build a '.o' file suitable for static linking
3650+ -static only build a '.o' file suitable for static linking
23353651 -Wc,FLAG pass FLAG directly to the compiler
23363652
2337-COMPILE-COMMAND is a command to be used in creating a \`standard' object file
3653+COMPILE-COMMAND is a command to be used in creating a 'standard' object file
23383654 from the given SOURCEFILE.
23393655
23403656 The output file name is determined by removing the directory component from
2341-SOURCEFILE, then substituting the C source code suffix \`.c' with the
2342-library object suffix, \`.lo'."
3657+SOURCEFILE, then substituting the C source code suffix '.c' with the
3658+library object suffix, '.lo'."
23433659 ;;
23443660
23453661 execute)
@@ -2352,7 +3668,7 @@ This mode accepts the following additional options:
23523668
23533669 -dlopen FILE add the directory containing FILE to the library path
23543670
2355-This mode sets the library path environment variable according to \`-dlopen'
3671+This mode sets the library path environment variable according to '-dlopen'
23563672 flags.
23573673
23583674 If any of the ARGS are libtool executable wrappers, then they are translated
@@ -2371,7 +3687,7 @@ Complete the installation of libtool libraries.
23713687 Each LIBDIR is a directory that contains libtool libraries.
23723688
23733689 The commands that this mode executes may require superuser privileges. Use
2374-the \`--dry-run' option if you just want to see what would be executed."
3690+the '--dry-run' option if you just want to see what would be executed."
23753691 ;;
23763692
23773693 install)
@@ -2381,7 +3697,7 @@ the \`--dry-run' option if you just want to see what would be executed."
23813697 Install executables or libraries.
23823698
23833699 INSTALL-COMMAND is the installation command. The first component should be
2384-either the \`install' or \`cp' program.
3700+either the 'install' or 'cp' program.
23853701
23863702 The following components of INSTALL-COMMAND are treated specially:
23873703
@@ -2407,7 +3723,7 @@ The following components of LINK-COMMAND are treated specially:
24073723 -avoid-version do not add a version suffix if possible
24083724 -bindir BINDIR specify path to binaries directory (for systems where
24093725 libraries must be found in the PATH setting at runtime)
2410- -dlopen FILE \`-dlpreopen' FILE if it cannot be dlopened at runtime
3726+ -dlopen FILE '-dlpreopen' FILE if it cannot be dlopened at runtime
24113727 -dlpreopen FILE link in FILE and add its symbols to lt_preloaded_symbols
24123728 -export-dynamic allow symbols from OUTPUT-FILE to be resolved with dlsym(3)
24133729 -export-symbols SYMFILE
@@ -2421,7 +3737,8 @@ The following components of LINK-COMMAND are treated specially:
24213737 -no-install link a not-installable executable
24223738 -no-undefined declare that a library does not refer to external symbols
24233739 -o OUTPUT-FILE create OUTPUT-FILE from the specified objects
2424- -objectlist FILE Use a list of object files found in FILE to specify objects
3740+ -objectlist FILE use a list of object files found in FILE to specify objects
3741+ -os2dllname NAME force a short DLL name on OS/2 (no effect on other OSes)
24253742 -precious-files-regex REGEX
24263743 don't remove output files matching REGEX
24273744 -release RELEASE specify package release information
@@ -2441,20 +3758,20 @@ The following components of LINK-COMMAND are treated specially:
24413758 -Xlinker FLAG pass linker-specific FLAG directly to the linker
24423759 -XCClinker FLAG pass link-specific FLAG to the compiler driver (CC)
24433760
2444-All other options (arguments beginning with \`-') are ignored.
3761+All other options (arguments beginning with '-') are ignored.
24453762
2446-Every other argument is treated as a filename. Files ending in \`.la' are
3763+Every other argument is treated as a filename. Files ending in '.la' are
24473764 treated as uninstalled libtool libraries, other files are standard or library
24483765 object files.
24493766
2450-If the OUTPUT-FILE ends in \`.la', then a libtool library is created,
2451-only library objects (\`.lo' files) may be specified, and \`-rpath' is
3767+If the OUTPUT-FILE ends in '.la', then a libtool library is created,
3768+only library objects ('.lo' files) may be specified, and '-rpath' is
24523769 required, except when creating a convenience library.
24533770
2454-If OUTPUT-FILE ends in \`.a' or \`.lib', then a standard library is created
2455-using \`ar' and \`ranlib', or on Windows using \`lib'.
3771+If OUTPUT-FILE ends in '.a' or '.lib', then a standard library is created
3772+using 'ar' and 'ranlib', or on Windows using 'lib'.
24563773
2457-If OUTPUT-FILE ends in \`.lo' or \`.${objext}', then a reloadable object file
3774+If OUTPUT-FILE ends in '.lo' or '.$objext', then a reloadable object file
24583775 is created, otherwise an executable program is created."
24593776 ;;
24603777
@@ -2465,7 +3782,7 @@ is created, otherwise an executable program is created."
24653782 Remove libraries from an installation directory.
24663783
24673784 RM is the name of the program to use to delete files associated with each FILE
2468-(typically \`/bin/rm'). RM-OPTIONS are options (such as \`-f') to be passed
3785+(typically '/bin/rm'). RM-OPTIONS are options (such as '-f') to be passed
24693786 to RM.
24703787
24713788 If FILE is a libtool library, all the files associated with it are deleted.
@@ -2473,17 +3790,17 @@ Otherwise, only FILE itself is deleted using RM."
24733790 ;;
24743791
24753792 *)
2476- func_fatal_help "invalid operation mode \`$opt_mode'"
3793+ func_fatal_help "invalid operation mode '$opt_mode'"
24773794 ;;
24783795 esac
24793796
24803797 echo
2481- $ECHO "Try \`$progname --help' for more information about other modes."
3798+ $ECHO "Try '$progname --help' for more information about other modes."
24823799 }
24833800
24843801 # Now that we've collected a possible --mode arg, show help if necessary
24853802 if $opt_help; then
2486- if test "$opt_help" = :; then
3803+ if test : = "$opt_help"; then
24873804 func_mode_help
24883805 else
24893806 {
@@ -2491,7 +3808,7 @@ if $opt_help; then
24913808 for opt_mode in compile link execute install finish uninstall clean; do
24923809 func_mode_help
24933810 done
2494- } | sed -n '1p; 2,$s/^Usage:/ or: /p'
3811+ } | $SED -n '1p; 2,$s/^Usage:/ or: /p'
24953812 {
24963813 func_help noexit
24973814 for opt_mode in compile link execute install finish uninstall clean; do
@@ -2499,7 +3816,7 @@ if $opt_help; then
24993816 func_mode_help
25003817 done
25013818 } |
2502- sed '1d
3819+ $SED '1d
25033820 /^When reporting/,/^Report/{
25043821 H
25053822 d
@@ -2516,16 +3833,17 @@ fi
25163833 # func_mode_execute arg...
25173834 func_mode_execute ()
25183835 {
2519- $opt_debug
3836+ $debug_cmd
3837+
25203838 # The first argument is the command name.
2521- cmd="$nonopt"
3839+ cmd=$nonopt
25223840 test -z "$cmd" && \
25233841 func_fatal_help "you must specify a COMMAND"
25243842
25253843 # Handle -dlopen flags immediately.
25263844 for file in $opt_dlopen; do
25273845 test -f "$file" \
2528- || func_fatal_help "\`$file' is not a file"
3846+ || func_fatal_help "'$file' is not a file"
25293847
25303848 dir=
25313849 case $file in
@@ -2535,7 +3853,7 @@ func_mode_execute ()
25353853
25363854 # Check to see that this really is a libtool archive.
25373855 func_lalib_unsafe_p "$file" \
2538- || func_fatal_help "\`$lib' is not a valid libtool archive"
3856+ || func_fatal_help "'$lib' is not a valid libtool archive"
25393857
25403858 # Read the libtool library.
25413859 dlname=
@@ -2546,18 +3864,18 @@ func_mode_execute ()
25463864 if test -z "$dlname"; then
25473865 # Warn if it was a shared library.
25483866 test -n "$library_names" && \
2549- func_warning "\`$file' was not linked with \`-export-dynamic'"
3867+ func_warning "'$file' was not linked with '-export-dynamic'"
25503868 continue
25513869 fi
25523870
25533871 func_dirname "$file" "" "."
2554- dir="$func_dirname_result"
3872+ dir=$func_dirname_result
25553873
25563874 if test -f "$dir/$objdir/$dlname"; then
25573875 func_append dir "/$objdir"
25583876 else
25593877 if test ! -f "$dir/$dlname"; then
2560- func_fatal_error "cannot find \`$dlname' in \`$dir' or \`$dir/$objdir'"
3878+ func_fatal_error "cannot find '$dlname' in '$dir' or '$dir/$objdir'"
25613879 fi
25623880 fi
25633881 ;;
@@ -2565,18 +3883,18 @@ func_mode_execute ()
25653883 *.lo)
25663884 # Just add the directory containing the .lo file.
25673885 func_dirname "$file" "" "."
2568- dir="$func_dirname_result"
3886+ dir=$func_dirname_result
25693887 ;;
25703888
25713889 *)
2572- func_warning "\`-dlopen' is ignored for non-libtool libraries and objects"
3890+ func_warning "'-dlopen' is ignored for non-libtool libraries and objects"
25733891 continue
25743892 ;;
25753893 esac
25763894
25773895 # Get the absolute pathname.
25783896 absdir=`cd "$dir" && pwd`
2579- test -n "$absdir" && dir="$absdir"
3897+ test -n "$absdir" && dir=$absdir
25803898
25813899 # Now add the directory to shlibpath_var.
25823900 if eval "test -z \"\$$shlibpath_var\""; then
@@ -2588,7 +3906,7 @@ func_mode_execute ()
25883906
25893907 # This variable tells wrapper scripts just to set shlibpath_var
25903908 # rather than running their programs.
2591- libtool_execute_magic="$magic"
3909+ libtool_execute_magic=$magic
25923910
25933911 # Check if any of the arguments is a wrapper script.
25943912 args=
@@ -2601,12 +3919,12 @@ func_mode_execute ()
26013919 if func_ltwrapper_script_p "$file"; then
26023920 func_source "$file"
26033921 # Transform arg to wrapped name.
2604- file="$progdir/$program"
3922+ file=$progdir/$program
26053923 elif func_ltwrapper_executable_p "$file"; then
26063924 func_ltwrapper_scriptname "$file"
26073925 func_source "$func_ltwrapper_scriptname_result"
26083926 # Transform arg to wrapped name.
2609- file="$progdir/$program"
3927+ file=$progdir/$program
26103928 fi
26113929 ;;
26123930 esac
@@ -2614,7 +3932,15 @@ func_mode_execute ()
26143932 func_append_quoted args "$file"
26153933 done
26163934
2617- if test "X$opt_dry_run" = Xfalse; then
3935+ if $opt_dry_run; then
3936+ # Display what would be done.
3937+ if test -n "$shlibpath_var"; then
3938+ eval "\$ECHO \"\$shlibpath_var=\$$shlibpath_var\""
3939+ echo "export $shlibpath_var"
3940+ fi
3941+ $ECHO "$cmd$args"
3942+ exit $EXIT_SUCCESS
3943+ else
26183944 if test -n "$shlibpath_var"; then
26193945 # Export the shlibpath_var.
26203946 eval "export $shlibpath_var"
@@ -2631,25 +3957,18 @@ func_mode_execute ()
26313957 done
26323958
26333959 # Now prepare to actually exec the command.
2634- exec_cmd="\$cmd$args"
2635- else
2636- # Display what would be done.
2637- if test -n "$shlibpath_var"; then
2638- eval "\$ECHO \"\$shlibpath_var=\$$shlibpath_var\""
2639- echo "export $shlibpath_var"
2640- fi
2641- $ECHO "$cmd$args"
2642- exit $EXIT_SUCCESS
3960+ exec_cmd=\$cmd$args
26433961 fi
26443962 }
26453963
2646-test "$opt_mode" = execute && func_mode_execute ${1+"$@"}
3964+test execute = "$opt_mode" && func_mode_execute ${1+"$@"}
26473965
26483966
26493967 # func_mode_finish arg...
26503968 func_mode_finish ()
26513969 {
2652- $opt_debug
3970+ $debug_cmd
3971+
26533972 libs=
26543973 libdirs=
26553974 admincmds=
@@ -2663,11 +3982,11 @@ func_mode_finish ()
26633982 if func_lalib_unsafe_p "$opt"; then
26643983 func_append libs " $opt"
26653984 else
2666- func_warning "\`$opt' is not a valid libtool archive"
3985+ func_warning "'$opt' is not a valid libtool archive"
26673986 fi
26683987
26693988 else
2670- func_fatal_error "invalid argument \`$opt'"
3989+ func_fatal_error "invalid argument '$opt'"
26713990 fi
26723991 done
26733992
@@ -2682,12 +4001,12 @@ func_mode_finish ()
26824001 # Remove sysroot references
26834002 if $opt_dry_run; then
26844003 for lib in $libs; do
2685- echo "removing references to $lt_sysroot and \`=' prefixes from $lib"
4004+ echo "removing references to $lt_sysroot and '=' prefixes from $lib"
26864005 done
26874006 else
26884007 tmpdir=`func_mktempdir`
26894008 for lib in $libs; do
2690- sed -e "${sysroot_cmd} s/\([ ']-[LR]\)=/\1/g; s/\([ ']\)=/\1/g" $lib \
4009+ $SED -e "$sysroot_cmd s/\([ ']-[LR]\)=/\1/g; s/\([ ']\)=/\1/g" $lib \
26914010 > $tmpdir/tmp-la
26924011 mv -f $tmpdir/tmp-la $lib
26934012 done
@@ -2712,7 +4031,7 @@ func_mode_finish ()
27124031 fi
27134032
27144033 # Exit here if they wanted silent mode.
2715- $opt_silent && exit $EXIT_SUCCESS
4034+ $opt_quiet && exit $EXIT_SUCCESS
27164035
27174036 if test -n "$finish_cmds$finish_eval" && test -n "$libdirs"; then
27184037 echo "----------------------------------------------------------------------"
@@ -2723,27 +4042,27 @@ func_mode_finish ()
27234042 echo
27244043 echo "If you ever happen to want to link against installed libraries"
27254044 echo "in a given directory, LIBDIR, you must either use libtool, and"
2726- echo "specify the full pathname of the library, or use the \`-LLIBDIR'"
4045+ echo "specify the full pathname of the library, or use the '-LLIBDIR'"
27274046 echo "flag during linking and do at least one of the following:"
27284047 if test -n "$shlibpath_var"; then
2729- echo " - add LIBDIR to the \`$shlibpath_var' environment variable"
4048+ echo " - add LIBDIR to the '$shlibpath_var' environment variable"
27304049 echo " during execution"
27314050 fi
27324051 if test -n "$runpath_var"; then
2733- echo " - add LIBDIR to the \`$runpath_var' environment variable"
4052+ echo " - add LIBDIR to the '$runpath_var' environment variable"
27344053 echo " during linking"
27354054 fi
27364055 if test -n "$hardcode_libdir_flag_spec"; then
27374056 libdir=LIBDIR
27384057 eval flag=\"$hardcode_libdir_flag_spec\"
27394058
2740- $ECHO " - use the \`$flag' linker flag"
4059+ $ECHO " - use the '$flag' linker flag"
27414060 fi
27424061 if test -n "$admincmds"; then
27434062 $ECHO " - have your system administrator run these commands:$admincmds"
27444063 fi
27454064 if test -f /etc/ld.so.conf; then
2746- echo " - have your system administrator add LIBDIR to \`/etc/ld.so.conf'"
4065+ echo " - have your system administrator add LIBDIR to '/etc/ld.so.conf'"
27474066 fi
27484067 echo
27494068
@@ -2762,18 +4081,20 @@ func_mode_finish ()
27624081 exit $EXIT_SUCCESS
27634082 }
27644083
2765-test "$opt_mode" = finish && func_mode_finish ${1+"$@"}
4084+test finish = "$opt_mode" && func_mode_finish ${1+"$@"}
27664085
27674086
27684087 # func_mode_install arg...
27694088 func_mode_install ()
27704089 {
2771- $opt_debug
4090+ $debug_cmd
4091+
27724092 # There may be an optional sh(1) argument at the beginning of
27734093 # install_prog (especially on Windows NT).
2774- if test "$nonopt" = "$SHELL" || test "$nonopt" = /bin/sh ||
4094+ if test "$SHELL" = "$nonopt" || test /bin/sh = "$nonopt" ||
27754095 # Allow the use of GNU shtool's install command.
2776- case $nonopt in *shtool*) :;; *) false;; esac; then
4096+ case $nonopt in *shtool*) :;; *) false;; esac
4097+ then
27774098 # Aesthetically quote it.
27784099 func_quote_for_eval "$nonopt"
27794100 install_prog="$func_quote_for_eval_result "
@@ -2800,7 +4121,7 @@ func_mode_install ()
28004121 opts=
28014122 prev=
28024123 install_type=
2803- isdir=no
4124+ isdir=false
28044125 stripme=
28054126 no_mode=:
28064127 for arg
@@ -2813,7 +4134,7 @@ func_mode_install ()
28134134 fi
28144135
28154136 case $arg in
2816- -d) isdir=yes ;;
4137+ -d) isdir=: ;;
28174138 -f)
28184139 if $install_cp; then :; else
28194140 prev=$arg
@@ -2831,7 +4152,7 @@ func_mode_install ()
28314152 *)
28324153 # If the previous option needed an argument, then skip it.
28334154 if test -n "$prev"; then
2834- if test "x$prev" = x-m && test -n "$install_override_mode"; then
4155+ if test X-m = "X$prev" && test -n "$install_override_mode"; then
28354156 arg2=$install_override_mode
28364157 no_mode=false
28374158 fi
@@ -2856,7 +4177,7 @@ func_mode_install ()
28564177 func_fatal_help "you must specify an install program"
28574178
28584179 test -n "$prev" && \
2859- func_fatal_help "the \`$prev' option requires an argument"
4180+ func_fatal_help "the '$prev' option requires an argument"
28604181
28614182 if test -n "$install_override_mode" && $no_mode; then
28624183 if $install_cp; then :; else
@@ -2878,19 +4199,19 @@ func_mode_install ()
28784199 dest=$func_stripname_result
28794200
28804201 # Check to see that the destination is a directory.
2881- test -d "$dest" && isdir=yes
2882- if test "$isdir" = yes; then
2883- destdir="$dest"
4202+ test -d "$dest" && isdir=:
4203+ if $isdir; then
4204+ destdir=$dest
28844205 destname=
28854206 else
28864207 func_dirname_and_basename "$dest" "" "."
2887- destdir="$func_dirname_result"
2888- destname="$func_basename_result"
4208+ destdir=$func_dirname_result
4209+ destname=$func_basename_result
28894210
28904211 # Not a directory, so check to see that there is only one file specified.
28914212 set dummy $files; shift
28924213 test "$#" -gt 1 && \
2893- func_fatal_help "\`$dest' is not a directory"
4214+ func_fatal_help "'$dest' is not a directory"
28944215 fi
28954216 case $destdir in
28964217 [\\/]* | [A-Za-z]:[\\/]*) ;;
@@ -2899,7 +4220,7 @@ func_mode_install ()
28994220 case $file in
29004221 *.lo) ;;
29014222 *)
2902- func_fatal_help "\`$destdir' must be an absolute directory name"
4223+ func_fatal_help "'$destdir' must be an absolute directory name"
29034224 ;;
29044225 esac
29054226 done
@@ -2908,7 +4229,7 @@ func_mode_install ()
29084229
29094230 # This variable tells wrapper scripts just to set variables rather
29104231 # than running their programs.
2911- libtool_install_magic="$magic"
4232+ libtool_install_magic=$magic
29124233
29134234 staticlibs=
29144235 future_libdirs=
@@ -2928,7 +4249,7 @@ func_mode_install ()
29284249
29294250 # Check to see that this really is a libtool archive.
29304251 func_lalib_unsafe_p "$file" \
2931- || func_fatal_help "\`$file' is not a valid libtool archive"
4252+ || func_fatal_help "'$file' is not a valid libtool archive"
29324253
29334254 library_names=
29344255 old_library=
@@ -2950,7 +4271,7 @@ func_mode_install ()
29504271 fi
29514272
29524273 func_dirname "$file" "/" ""
2953- dir="$func_dirname_result"
4274+ dir=$func_dirname_result
29544275 func_append dir "$objdir"
29554276
29564277 if test -n "$relink_command"; then
@@ -2964,7 +4285,7 @@ func_mode_install ()
29644285 # are installed into $libdir/../bin (currently, that works fine)
29654286 # but it's something to keep an eye on.
29664287 test "$inst_prefix_dir" = "$destdir" && \
2967- func_fatal_error "error: cannot install \`$file' to a directory not ending in $libdir"
4288+ func_fatal_error "error: cannot install '$file' to a directory not ending in $libdir"
29684289
29694290 if test -n "$inst_prefix_dir"; then
29704291 # Stick the inst_prefix_dir data into the link command.
@@ -2973,29 +4294,36 @@ func_mode_install ()
29734294 relink_command=`$ECHO "$relink_command" | $SED "s%@inst_prefix_dir@%%"`
29744295 fi
29754296
2976- func_warning "relinking \`$file'"
4297+ func_warning "relinking '$file'"
29774298 func_show_eval "$relink_command" \
2978- 'func_fatal_error "error: relink \`$file'\'' with the above command before installing it"'
4299+ 'func_fatal_error "error: relink '\''$file'\'' with the above command before installing it"'
29794300 fi
29804301
29814302 # See the names of the shared library.
29824303 set dummy $library_names; shift
29834304 if test -n "$1"; then
2984- realname="$1"
4305+ realname=$1
29854306 shift
29864307
2987- srcname="$realname"
2988- test -n "$relink_command" && srcname="$realname"T
4308+ srcname=$realname
4309+ test -n "$relink_command" && srcname=${realname}T
29894310
29904311 # Install the shared library and build the symlinks.
29914312 func_show_eval "$install_shared_prog $dir/$srcname $destdir/$realname" \
29924313 'exit $?'
2993- tstripme="$stripme"
4314+ tstripme=$stripme
29944315 case $host_os in
29954316 cygwin* | mingw* | pw32* | cegcc*)
29964317 case $realname in
29974318 *.dll.a)
2998- tstripme=""
4319+ tstripme=
4320+ ;;
4321+ esac
4322+ ;;
4323+ os2*)
4324+ case $realname in
4325+ *_dll.a)
4326+ tstripme=
29994327 ;;
30004328 esac
30014329 ;;
@@ -3006,7 +4334,7 @@ func_mode_install ()
30064334
30074335 if test "$#" -gt 0; then
30084336 # Delete the old symlinks, and create new ones.
3009- # Try `ln -sf' first, because the `ln' binary might depend on
4337+ # Try 'ln -sf' first, because the 'ln' binary might depend on
30104338 # the symlink we replace! Solaris /bin/ln does not understand -f,
30114339 # so we also need to try rm && ln -s.
30124340 for linkname
@@ -3017,14 +4345,14 @@ func_mode_install ()
30174345 fi
30184346
30194347 # Do each command in the postinstall commands.
3020- lib="$destdir/$realname"
4348+ lib=$destdir/$realname
30214349 func_execute_cmds "$postinstall_cmds" 'exit $?'
30224350 fi
30234351
30244352 # Install the pseudo-library for information purposes.
30254353 func_basename "$file"
3026- name="$func_basename_result"
3027- instname="$dir/$name"i
4354+ name=$func_basename_result
4355+ instname=$dir/${name}i
30284356 func_show_eval "$install_prog $instname $destdir/$name" 'exit $?'
30294357
30304358 # Maybe install the static library, too.
@@ -3036,11 +4364,11 @@ func_mode_install ()
30364364
30374365 # Figure out destination file name, if it wasn't already specified.
30384366 if test -n "$destname"; then
3039- destfile="$destdir/$destname"
4367+ destfile=$destdir/$destname
30404368 else
30414369 func_basename "$file"
3042- destfile="$func_basename_result"
3043- destfile="$destdir/$destfile"
4370+ destfile=$func_basename_result
4371+ destfile=$destdir/$destfile
30444372 fi
30454373
30464374 # Deduce the name of the destination old-style object file.
@@ -3050,11 +4378,11 @@ func_mode_install ()
30504378 staticdest=$func_lo2o_result
30514379 ;;
30524380 *.$objext)
3053- staticdest="$destfile"
4381+ staticdest=$destfile
30544382 destfile=
30554383 ;;
30564384 *)
3057- func_fatal_help "cannot copy a libtool object to \`$destfile'"
4385+ func_fatal_help "cannot copy a libtool object to '$destfile'"
30584386 ;;
30594387 esac
30604388
@@ -3063,7 +4391,7 @@ func_mode_install ()
30634391 func_show_eval "$install_prog $file $destfile" 'exit $?'
30644392
30654393 # Install the old object if enabled.
3066- if test "$build_old_libs" = yes; then
4394+ if test yes = "$build_old_libs"; then
30674395 # Deduce the name of the old-style object file.
30684396 func_lo2o "$file"
30694397 staticobj=$func_lo2o_result
@@ -3075,23 +4403,23 @@ func_mode_install ()
30754403 *)
30764404 # Figure out destination file name, if it wasn't already specified.
30774405 if test -n "$destname"; then
3078- destfile="$destdir/$destname"
4406+ destfile=$destdir/$destname
30794407 else
30804408 func_basename "$file"
3081- destfile="$func_basename_result"
3082- destfile="$destdir/$destfile"
4409+ destfile=$func_basename_result
4410+ destfile=$destdir/$destfile
30834411 fi
30844412
30854413 # If the file is missing, and there is a .exe on the end, strip it
30864414 # because it is most likely a libtool script we actually want to
30874415 # install
3088- stripped_ext=""
4416+ stripped_ext=
30894417 case $file in
30904418 *.exe)
30914419 if test ! -f "$file"; then
30924420 func_stripname '' '.exe' "$file"
30934421 file=$func_stripname_result
3094- stripped_ext=".exe"
4422+ stripped_ext=.exe
30954423 fi
30964424 ;;
30974425 esac
@@ -3119,19 +4447,19 @@ func_mode_install ()
31194447
31204448 # Check the variables that should have been set.
31214449 test -z "$generated_by_libtool_version" && \
3122- func_fatal_error "invalid libtool wrapper script \`$wrapper'"
4450+ func_fatal_error "invalid libtool wrapper script '$wrapper'"
31234451
3124- finalize=yes
4452+ finalize=:
31254453 for lib in $notinst_deplibs; do
31264454 # Check to see that each library is installed.
31274455 libdir=
31284456 if test -f "$lib"; then
31294457 func_source "$lib"
31304458 fi
3131- libfile="$libdir/"`$ECHO "$lib" | $SED 's%^.*/%%g'` ### testsuite: skip nested quoting test
4459+ libfile=$libdir/`$ECHO "$lib" | $SED 's%^.*/%%g'`
31324460 if test -n "$libdir" && test ! -f "$libfile"; then
3133- func_warning "\`$lib' has not been installed in \`$libdir'"
3134- finalize=no
4461+ func_warning "'$lib' has not been installed in '$libdir'"
4462+ finalize=false
31354463 fi
31364464 done
31374465
@@ -3139,29 +4467,29 @@ func_mode_install ()
31394467 func_source "$wrapper"
31404468
31414469 outputname=
3142- if test "$fast_install" = no && test -n "$relink_command"; then
4470+ if test no = "$fast_install" && test -n "$relink_command"; then
31434471 $opt_dry_run || {
3144- if test "$finalize" = yes; then
4472+ if $finalize; then
31454473 tmpdir=`func_mktempdir`
31464474 func_basename "$file$stripped_ext"
3147- file="$func_basename_result"
3148- outputname="$tmpdir/$file"
4475+ file=$func_basename_result
4476+ outputname=$tmpdir/$file
31494477 # Replace the output file specification.
31504478 relink_command=`$ECHO "$relink_command" | $SED 's%@OUTPUT@%'"$outputname"'%g'`
31514479
3152- $opt_silent || {
4480+ $opt_quiet || {
31534481 func_quote_for_expand "$relink_command"
31544482 eval "func_echo $func_quote_for_expand_result"
31554483 }
31564484 if eval "$relink_command"; then :
31574485 else
3158- func_error "error: relink \`$file' with the above command before installing it"
4486+ func_error "error: relink '$file' with the above command before installing it"
31594487 $opt_dry_run || ${RM}r "$tmpdir"
31604488 continue
31614489 fi
3162- file="$outputname"
4490+ file=$outputname
31634491 else
3164- func_warning "cannot relink \`$file'"
4492+ func_warning "cannot relink '$file'"
31654493 fi
31664494 }
31674495 else
@@ -3198,10 +4526,10 @@ func_mode_install ()
31984526
31994527 for file in $staticlibs; do
32004528 func_basename "$file"
3201- name="$func_basename_result"
4529+ name=$func_basename_result
32024530
32034531 # Set up the ranlib parameters.
3204- oldlib="$destdir/$name"
4532+ oldlib=$destdir/$name
32054533 func_to_tool_file "$oldlib" func_convert_file_msys_to_w32
32064534 tool_oldlib=$func_to_tool_file_result
32074535
@@ -3216,18 +4544,18 @@ func_mode_install ()
32164544 done
32174545
32184546 test -n "$future_libdirs" && \
3219- func_warning "remember to run \`$progname --finish$future_libdirs'"
4547+ func_warning "remember to run '$progname --finish$future_libdirs'"
32204548
32214549 if test -n "$current_libdirs"; then
32224550 # Maybe just do a dry run.
32234551 $opt_dry_run && current_libdirs=" -n$current_libdirs"
3224- exec_cmd='$SHELL $progpath $preserve_args --finish$current_libdirs'
4552+ exec_cmd='$SHELL "$progpath" $preserve_args --finish$current_libdirs'
32254553 else
32264554 exit $EXIT_SUCCESS
32274555 fi
32284556 }
32294557
3230-test "$opt_mode" = install && func_mode_install ${1+"$@"}
4558+test install = "$opt_mode" && func_mode_install ${1+"$@"}
32314559
32324560
32334561 # func_generate_dlsyms outputname originator pic_p
@@ -3235,16 +4563,17 @@ test "$opt_mode" = install && func_mode_install ${1+"$@"}
32354563 # a dlpreopen symbol table.
32364564 func_generate_dlsyms ()
32374565 {
3238- $opt_debug
3239- my_outputname="$1"
3240- my_originator="$2"
3241- my_pic_p="${3-no}"
3242- my_prefix=`$ECHO "$my_originator" | sed 's%[^a-zA-Z0-9]%_%g'`
4566+ $debug_cmd
4567+
4568+ my_outputname=$1
4569+ my_originator=$2
4570+ my_pic_p=${3-false}
4571+ my_prefix=`$ECHO "$my_originator" | $SED 's%[^a-zA-Z0-9]%_%g'`
32434572 my_dlsyms=
32444573
3245- if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then
4574+ if test -n "$dlfiles$dlprefiles" || test no != "$dlself"; then
32464575 if test -n "$NM" && test -n "$global_symbol_pipe"; then
3247- my_dlsyms="${my_outputname}S.c"
4576+ my_dlsyms=${my_outputname}S.c
32484577 else
32494578 func_error "not configured to extract global symbols from dlpreopened files"
32504579 fi
@@ -3255,7 +4584,7 @@ func_generate_dlsyms ()
32554584 "") ;;
32564585 *.c)
32574586 # Discover the nlist of each of the dlfiles.
3258- nlist="$output_objdir/${my_outputname}.nm"
4587+ nlist=$output_objdir/$my_outputname.nm
32594588
32604589 func_show_eval "$RM $nlist ${nlist}S ${nlist}T"
32614590
@@ -3263,34 +4592,36 @@ func_generate_dlsyms ()
32634592 func_verbose "creating $output_objdir/$my_dlsyms"
32644593
32654594 $opt_dry_run || $ECHO > "$output_objdir/$my_dlsyms" "\
3266-/* $my_dlsyms - symbol resolution table for \`$my_outputname' dlsym emulation. */
3267-/* Generated by $PROGRAM (GNU $PACKAGE$TIMESTAMP) $VERSION */
4595+/* $my_dlsyms - symbol resolution table for '$my_outputname' dlsym emulation. */
4596+/* Generated by $PROGRAM (GNU $PACKAGE) $VERSION */
32684597
32694598 #ifdef __cplusplus
32704599 extern \"C\" {
32714600 #endif
32724601
3273-#if defined(__GNUC__) && (((__GNUC__ == 4) && (__GNUC_MINOR__ >= 4)) || (__GNUC__ > 4))
4602+#if defined __GNUC__ && (((__GNUC__ == 4) && (__GNUC_MINOR__ >= 4)) || (__GNUC__ > 4))
32744603 #pragma GCC diagnostic ignored \"-Wstrict-prototypes\"
32754604 #endif
32764605
32774606 /* Keep this code in sync between libtool.m4, ltmain, lt_system.h, and tests. */
3278-#if defined(_WIN32) || defined(__CYGWIN__) || defined(_WIN32_WCE)
3279-/* DATA imports from DLLs on WIN32 con't be const, because runtime
4607+#if defined _WIN32 || defined __CYGWIN__ || defined _WIN32_WCE
4608+/* DATA imports from DLLs on WIN32 can't be const, because runtime
32804609 relocations are performed -- see ld's documentation on pseudo-relocs. */
32814610 # define LT_DLSYM_CONST
3282-#elif defined(__osf__)
4611+#elif defined __osf__
32834612 /* This system does not cope well with relocations in const data. */
32844613 # define LT_DLSYM_CONST
32854614 #else
32864615 # define LT_DLSYM_CONST const
32874616 #endif
32884617
4618+#define STREQ(s1, s2) (strcmp ((s1), (s2)) == 0)
4619+
32894620 /* External symbol declarations for the compiler. */\
32904621 "
32914622
3292- if test "$dlself" = yes; then
3293- func_verbose "generating symbol list for \`$output'"
4623+ if test yes = "$dlself"; then
4624+ func_verbose "generating symbol list for '$output'"
32944625
32954626 $opt_dry_run || echo ': @PROGRAM@ ' > "$nlist"
32964627
@@ -3298,7 +4629,7 @@ extern \"C\" {
32984629 progfiles=`$ECHO "$objs$old_deplibs" | $SP2NL | $SED "$lo2o" | $NL2SP`
32994630 for progfile in $progfiles; do
33004631 func_to_tool_file "$progfile" func_convert_file_msys_to_w32
3301- func_verbose "extracting global C symbols from \`$func_to_tool_file_result'"
4632+ func_verbose "extracting global C symbols from '$func_to_tool_file_result'"
33024633 $opt_dry_run || eval "$NM $func_to_tool_file_result | $global_symbol_pipe >> '$nlist'"
33034634 done
33044635
@@ -3318,10 +4649,10 @@ extern \"C\" {
33184649
33194650 # Prepare the list of exported symbols
33204651 if test -z "$export_symbols"; then
3321- export_symbols="$output_objdir/$outputname.exp"
4652+ export_symbols=$output_objdir/$outputname.exp
33224653 $opt_dry_run || {
33234654 $RM $export_symbols
3324- eval "${SED} -n -e '/^: @PROGRAM@ $/d' -e 's/^.* \(.*\)$/\1/p' "'< "$nlist" > "$export_symbols"'
4655+ eval "$SED -n -e '/^: @PROGRAM@ $/d' -e 's/^.* \(.*\)$/\1/p' "'< "$nlist" > "$export_symbols"'
33254656 case $host in
33264657 *cygwin* | *mingw* | *cegcc* )
33274658 eval "echo EXPORTS "'> "$output_objdir/$outputname.def"'
@@ -3331,7 +4662,7 @@ extern \"C\" {
33314662 }
33324663 else
33334664 $opt_dry_run || {
3334- eval "${SED} -e 's/\([].[*^$]\)/\\\\\1/g' -e 's/^/ /' -e 's/$/$/'"' < "$export_symbols" > "$output_objdir/$outputname.exp"'
4665+ eval "$SED -e 's/\([].[*^$]\)/\\\\\1/g' -e 's/^/ /' -e 's/$/$/'"' < "$export_symbols" > "$output_objdir/$outputname.exp"'
33354666 eval '$GREP -f "$output_objdir/$outputname.exp" < "$nlist" > "$nlist"T'
33364667 eval '$MV "$nlist"T "$nlist"'
33374668 case $host in
@@ -3345,22 +4676,22 @@ extern \"C\" {
33454676 fi
33464677
33474678 for dlprefile in $dlprefiles; do
3348- func_verbose "extracting global C symbols from \`$dlprefile'"
4679+ func_verbose "extracting global C symbols from '$dlprefile'"
33494680 func_basename "$dlprefile"
3350- name="$func_basename_result"
4681+ name=$func_basename_result
33514682 case $host in
33524683 *cygwin* | *mingw* | *cegcc* )
33534684 # if an import library, we need to obtain dlname
33544685 if func_win32_import_lib_p "$dlprefile"; then
33554686 func_tr_sh "$dlprefile"
33564687 eval "curr_lafile=\$libfile_$func_tr_sh_result"
3357- dlprefile_dlbasename=""
4688+ dlprefile_dlbasename=
33584689 if test -n "$curr_lafile" && func_lalib_p "$curr_lafile"; then
33594690 # Use subshell, to avoid clobbering current variable values
33604691 dlprefile_dlname=`source "$curr_lafile" && echo "$dlname"`
3361- if test -n "$dlprefile_dlname" ; then
4692+ if test -n "$dlprefile_dlname"; then
33624693 func_basename "$dlprefile_dlname"
3363- dlprefile_dlbasename="$func_basename_result"
4694+ dlprefile_dlbasename=$func_basename_result
33644695 else
33654696 # no lafile. user explicitly requested -dlpreopen <import library>.
33664697 $sharedlib_from_linklib_cmd "$dlprefile"
@@ -3368,7 +4699,7 @@ extern \"C\" {
33684699 fi
33694700 fi
33704701 $opt_dry_run || {
3371- if test -n "$dlprefile_dlbasename" ; then
4702+ if test -n "$dlprefile_dlbasename"; then
33724703 eval '$ECHO ": $dlprefile_dlbasename" >> "$nlist"'
33734704 else
33744705 func_warning "Could not compute DLL name from $name"
@@ -3424,6 +4755,11 @@ extern \"C\" {
34244755 echo '/* NONE */' >> "$output_objdir/$my_dlsyms"
34254756 fi
34264757
4758+ func_show_eval '$RM "${nlist}I"'
4759+ if test -n "$global_symbol_to_import"; then
4760+ eval "$global_symbol_to_import"' < "$nlist"S > "$nlist"I'
4761+ fi
4762+
34274763 echo >> "$output_objdir/$my_dlsyms" "\
34284764
34294765 /* The mapping between symbol names and symbols. */
@@ -3432,11 +4768,30 @@ typedef struct {
34324768 void *address;
34334769 } lt_dlsymlist;
34344770 extern LT_DLSYM_CONST lt_dlsymlist
3435-lt_${my_prefix}_LTX_preloaded_symbols[];
4771+lt_${my_prefix}_LTX_preloaded_symbols[];\
4772+"
4773+
4774+ if test -s "$nlist"I; then
4775+ echo >> "$output_objdir/$my_dlsyms" "\
4776+static void lt_syminit(void)
4777+{
4778+ LT_DLSYM_CONST lt_dlsymlist *symbol = lt_${my_prefix}_LTX_preloaded_symbols;
4779+ for (; symbol->name; ++symbol)
4780+ {"
4781+ $SED 's/.*/ if (STREQ (symbol->name, \"&\")) symbol->address = (void *) \&&;/' < "$nlist"I >> "$output_objdir/$my_dlsyms"
4782+ echo >> "$output_objdir/$my_dlsyms" "\
4783+ }
4784+}"
4785+ fi
4786+ echo >> "$output_objdir/$my_dlsyms" "\
34364787 LT_DLSYM_CONST lt_dlsymlist
34374788 lt_${my_prefix}_LTX_preloaded_symbols[] =
3438-{\
3439- { \"$my_originator\", (void *) 0 },"
4789+{ {\"$my_originator\", (void *) 0},"
4790+
4791+ if test -s "$nlist"I; then
4792+ echo >> "$output_objdir/$my_dlsyms" "\
4793+ {\"@INIT@\", (void *) &lt_syminit},"
4794+ fi
34404795
34414796 case $need_lib_prefix in
34424797 no)
@@ -3478,9 +4833,7 @@ static const void *lt_preloaded_setup() {
34784833 *-*-hpux*)
34794834 pic_flag_for_symtable=" $pic_flag" ;;
34804835 *)
3481- if test "X$my_pic_p" != Xno; then
3482- pic_flag_for_symtable=" $pic_flag"
3483- fi
4836+ $my_pic_p && pic_flag_for_symtable=" $pic_flag"
34844837 ;;
34854838 esac
34864839 ;;
@@ -3497,10 +4850,10 @@ static const void *lt_preloaded_setup() {
34974850 func_show_eval '(cd $output_objdir && $LTCC$symtab_cflags -c$no_builtin_flag$pic_flag_for_symtable "$my_dlsyms")' 'exit $?'
34984851
34994852 # Clean up the generated files.
3500- func_show_eval '$RM "$output_objdir/$my_dlsyms" "$nlist" "${nlist}S" "${nlist}T"'
4853+ func_show_eval '$RM "$output_objdir/$my_dlsyms" "$nlist" "${nlist}S" "${nlist}T" "${nlist}I"'
35014854
35024855 # Transform the symbol file into the correct name.
3503- symfileobj="$output_objdir/${my_outputname}S.$objext"
4856+ symfileobj=$output_objdir/${my_outputname}S.$objext
35044857 case $host in
35054858 *cygwin* | *mingw* | *cegcc* )
35064859 if test -f "$output_objdir/$my_outputname.def"; then
@@ -3518,7 +4871,7 @@ static const void *lt_preloaded_setup() {
35184871 esac
35194872 ;;
35204873 *)
3521- func_fatal_error "unknown suffix for \`$my_dlsyms'"
4874+ func_fatal_error "unknown suffix for '$my_dlsyms'"
35224875 ;;
35234876 esac
35244877 else
@@ -3532,6 +4885,32 @@ static const void *lt_preloaded_setup() {
35324885 fi
35334886 }
35344887
4888+# func_cygming_gnu_implib_p ARG
4889+# This predicate returns with zero status (TRUE) if
4890+# ARG is a GNU/binutils-style import library. Returns
4891+# with nonzero status (FALSE) otherwise.
4892+func_cygming_gnu_implib_p ()
4893+{
4894+ $debug_cmd
4895+
4896+ func_to_tool_file "$1" func_convert_file_msys_to_w32
4897+ 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)$'`
4898+ test -n "$func_cygming_gnu_implib_tmp"
4899+}
4900+
4901+# func_cygming_ms_implib_p ARG
4902+# This predicate returns with zero status (TRUE) if
4903+# ARG is an MS-style import library. Returns
4904+# with nonzero status (FALSE) otherwise.
4905+func_cygming_ms_implib_p ()
4906+{
4907+ $debug_cmd
4908+
4909+ func_to_tool_file "$1" func_convert_file_msys_to_w32
4910+ func_cygming_ms_implib_tmp=`$NM "$func_to_tool_file_result" | eval "$global_symbol_pipe" | $GREP '_NULL_IMPORT_DESCRIPTOR'`
4911+ test -n "$func_cygming_ms_implib_tmp"
4912+}
4913+
35354914 # func_win32_libid arg
35364915 # return the library type of file 'arg'
35374916 #
@@ -3541,8 +4920,9 @@ static const void *lt_preloaded_setup() {
35414920 # Despite the name, also deal with 64 bit binaries.
35424921 func_win32_libid ()
35434922 {
3544- $opt_debug
3545- win32_libid_type="unknown"
4923+ $debug_cmd
4924+
4925+ win32_libid_type=unknown
35464926 win32_fileres=`file -L $1 2>/dev/null`
35474927 case $win32_fileres in
35484928 *ar\ archive\ import\ library*) # definitely import
@@ -3552,16 +4932,29 @@ func_win32_libid ()
35524932 # Keep the egrep pattern in sync with the one in _LT_CHECK_MAGIC_METHOD.
35534933 if eval $OBJDUMP -f $1 | $SED -e '10q' 2>/dev/null |
35544934 $EGREP 'file format (pei*-i386(.*architecture: i386)?|pe-arm-wince|pe-x86-64)' >/dev/null; then
3555- func_to_tool_file "$1" func_convert_file_msys_to_w32
3556- win32_nmres=`eval $NM -f posix -A \"$func_to_tool_file_result\" |
3557- $SED -n -e '
4935+ case $nm_interface in
4936+ "MS dumpbin")
4937+ if func_cygming_ms_implib_p "$1" ||
4938+ func_cygming_gnu_implib_p "$1"
4939+ then
4940+ win32_nmres=import
4941+ else
4942+ win32_nmres=
4943+ fi
4944+ ;;
4945+ *)
4946+ func_to_tool_file "$1" func_convert_file_msys_to_w32
4947+ win32_nmres=`eval $NM -f posix -A \"$func_to_tool_file_result\" |
4948+ $SED -n -e '
35584949 1,100{
35594950 / I /{
3560- s,.*,import,
4951+ s|.*|import|
35614952 p
35624953 q
35634954 }
35644955 }'`
4956+ ;;
4957+ esac
35654958 case $win32_nmres in
35664959 import*) win32_libid_type="x86 archive import";;
35674960 *) win32_libid_type="x86 archive static";;
@@ -3593,7 +4986,8 @@ func_win32_libid ()
35934986 # $sharedlib_from_linklib_result
35944987 func_cygming_dll_for_implib ()
35954988 {
3596- $opt_debug
4989+ $debug_cmd
4990+
35974991 sharedlib_from_linklib_result=`$DLLTOOL --identify-strict --identify "$1"`
35984992 }
35994993
@@ -3610,7 +5004,8 @@ func_cygming_dll_for_implib ()
36105004 # specified import library.
36115005 func_cygming_dll_for_implib_fallback_core ()
36125006 {
3613- $opt_debug
5007+ $debug_cmd
5008+
36145009 match_literal=`$ECHO "$1" | $SED "$sed_make_literal_regex"`
36155010 $OBJDUMP -s --section "$1" "$2" 2>/dev/null |
36165011 $SED '/^Contents of section '"$match_literal"':/{
@@ -3646,8 +5041,8 @@ func_cygming_dll_for_implib_fallback_core ()
36465041 /./p' |
36475042 # we now have a list, one entry per line, of the stringified
36485043 # contents of the appropriate section of all members of the
3649- # archive which possess that section. Heuristic: eliminate
3650- # all those which have a first or second character that is
5044+ # archive that possess that section. Heuristic: eliminate
5045+ # all those that have a first or second character that is
36515046 # a '.' (that is, objdump's representation of an unprintable
36525047 # character.) This should work for all archives with less than
36535048 # 0x302f exports -- but will fail for DLLs whose name actually
@@ -3658,30 +5053,6 @@ func_cygming_dll_for_implib_fallback_core ()
36585053 $SED -e '/^\./d;/^.\./d;q'
36595054 }
36605055
3661-# func_cygming_gnu_implib_p ARG
3662-# This predicate returns with zero status (TRUE) if
3663-# ARG is a GNU/binutils-style import library. Returns
3664-# with nonzero status (FALSE) otherwise.
3665-func_cygming_gnu_implib_p ()
3666-{
3667- $opt_debug
3668- func_to_tool_file "$1" func_convert_file_msys_to_w32
3669- 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)$'`
3670- test -n "$func_cygming_gnu_implib_tmp"
3671-}
3672-
3673-# func_cygming_ms_implib_p ARG
3674-# This predicate returns with zero status (TRUE) if
3675-# ARG is an MS-style import library. Returns
3676-# with nonzero status (FALSE) otherwise.
3677-func_cygming_ms_implib_p ()
3678-{
3679- $opt_debug
3680- func_to_tool_file "$1" func_convert_file_msys_to_w32
3681- func_cygming_ms_implib_tmp=`$NM "$func_to_tool_file_result" | eval "$global_symbol_pipe" | $GREP '_NULL_IMPORT_DESCRIPTOR'`
3682- test -n "$func_cygming_ms_implib_tmp"
3683-}
3684-
36855056 # func_cygming_dll_for_implib_fallback ARG
36865057 # Platform-specific function to extract the
36875058 # name of the DLL associated with the specified
@@ -3695,16 +5066,17 @@ func_cygming_ms_implib_p ()
36955066 # $sharedlib_from_linklib_result
36965067 func_cygming_dll_for_implib_fallback ()
36975068 {
3698- $opt_debug
3699- if func_cygming_gnu_implib_p "$1" ; then
5069+ $debug_cmd
5070+
5071+ if func_cygming_gnu_implib_p "$1"; then
37005072 # binutils import library
37015073 sharedlib_from_linklib_result=`func_cygming_dll_for_implib_fallback_core '.idata$7' "$1"`
3702- elif func_cygming_ms_implib_p "$1" ; then
5074+ elif func_cygming_ms_implib_p "$1"; then
37035075 # ms-generated import library
37045076 sharedlib_from_linklib_result=`func_cygming_dll_for_implib_fallback_core '.idata$6' "$1"`
37055077 else
37065078 # unknown
3707- sharedlib_from_linklib_result=""
5079+ sharedlib_from_linklib_result=
37085080 fi
37095081 }
37105082
@@ -3712,10 +5084,11 @@ func_cygming_dll_for_implib_fallback ()
37125084 # func_extract_an_archive dir oldlib
37135085 func_extract_an_archive ()
37145086 {
3715- $opt_debug
3716- f_ex_an_ar_dir="$1"; shift
3717- f_ex_an_ar_oldlib="$1"
3718- if test "$lock_old_archive_extraction" = yes; then
5087+ $debug_cmd
5088+
5089+ f_ex_an_ar_dir=$1; shift
5090+ f_ex_an_ar_oldlib=$1
5091+ if test yes = "$lock_old_archive_extraction"; then
37195092 lockfile=$f_ex_an_ar_oldlib.lock
37205093 until $opt_dry_run || ln "$progpath" "$lockfile" 2>/dev/null; do
37215094 func_echo "Waiting for $lockfile to be removed"
@@ -3724,7 +5097,7 @@ func_extract_an_archive ()
37245097 fi
37255098 func_show_eval "(cd \$f_ex_an_ar_dir && $AR x \"\$f_ex_an_ar_oldlib\")" \
37265099 'stat=$?; rm -f "$lockfile"; exit $stat'
3727- if test "$lock_old_archive_extraction" = yes; then
5100+ if test yes = "$lock_old_archive_extraction"; then
37285101 $opt_dry_run || rm -f "$lockfile"
37295102 fi
37305103 if ($AR t "$f_ex_an_ar_oldlib" | sort | sort -uc >/dev/null 2>&1); then
@@ -3738,22 +5111,23 @@ func_extract_an_archive ()
37385111 # func_extract_archives gentop oldlib ...
37395112 func_extract_archives ()
37405113 {
3741- $opt_debug
3742- my_gentop="$1"; shift
5114+ $debug_cmd
5115+
5116+ my_gentop=$1; shift
37435117 my_oldlibs=${1+"$@"}
3744- my_oldobjs=""
3745- my_xlib=""
3746- my_xabs=""
3747- my_xdir=""
5118+ my_oldobjs=
5119+ my_xlib=
5120+ my_xabs=
5121+ my_xdir=
37485122
37495123 for my_xlib in $my_oldlibs; do
37505124 # Extract the objects.
37515125 case $my_xlib in
3752- [\\/]* | [A-Za-z]:[\\/]*) my_xabs="$my_xlib" ;;
5126+ [\\/]* | [A-Za-z]:[\\/]*) my_xabs=$my_xlib ;;
37535127 *) my_xabs=`pwd`"/$my_xlib" ;;
37545128 esac
37555129 func_basename "$my_xlib"
3756- my_xlib="$func_basename_result"
5130+ my_xlib=$func_basename_result
37575131 my_xlib_u=$my_xlib
37585132 while :; do
37595133 case " $extracted_archives " in
@@ -3765,7 +5139,7 @@ func_extract_archives ()
37655139 esac
37665140 done
37675141 extracted_archives="$extracted_archives $my_xlib_u"
3768- my_xdir="$my_gentop/$my_xlib_u"
5142+ my_xdir=$my_gentop/$my_xlib_u
37695143
37705144 func_mkdir_p "$my_xdir"
37715145
@@ -3778,22 +5152,23 @@ func_extract_archives ()
37785152 cd $my_xdir || exit $?
37795153 darwin_archive=$my_xabs
37805154 darwin_curdir=`pwd`
3781- darwin_base_archive=`basename "$darwin_archive"`
5155+ func_basename "$darwin_archive"
5156+ darwin_base_archive=$func_basename_result
37825157 darwin_arches=`$LIPO -info "$darwin_archive" 2>/dev/null | $GREP Architectures 2>/dev/null || true`
37835158 if test -n "$darwin_arches"; then
37845159 darwin_arches=`$ECHO "$darwin_arches" | $SED -e 's/.*are://'`
37855160 darwin_arch=
37865161 func_verbose "$darwin_base_archive has multiple architectures $darwin_arches"
3787- for darwin_arch in $darwin_arches ; do
3788- func_mkdir_p "unfat-$$/${darwin_base_archive}-${darwin_arch}"
3789- $LIPO -thin $darwin_arch -output "unfat-$$/${darwin_base_archive}-${darwin_arch}/${darwin_base_archive}" "${darwin_archive}"
3790- cd "unfat-$$/${darwin_base_archive}-${darwin_arch}"
3791- func_extract_an_archive "`pwd`" "${darwin_base_archive}"
5162+ for darwin_arch in $darwin_arches; do
5163+ func_mkdir_p "unfat-$$/$darwin_base_archive-$darwin_arch"
5164+ $LIPO -thin $darwin_arch -output "unfat-$$/$darwin_base_archive-$darwin_arch/$darwin_base_archive" "$darwin_archive"
5165+ cd "unfat-$$/$darwin_base_archive-$darwin_arch"
5166+ func_extract_an_archive "`pwd`" "$darwin_base_archive"
37925167 cd "$darwin_curdir"
3793- $RM "unfat-$$/${darwin_base_archive}-${darwin_arch}/${darwin_base_archive}"
5168+ $RM "unfat-$$/$darwin_base_archive-$darwin_arch/$darwin_base_archive"
37945169 done # $darwin_arches
37955170 ## Okay now we've a bunch of thin objects, gotta fatten them up :)
3796- darwin_filelist=`find unfat-$$ -type f -name \*.o -print -o -name \*.lo -print | $SED -e "$basename" | sort -u`
5171+ darwin_filelist=`find unfat-$$ -type f -name \*.o -print -o -name \*.lo -print | $SED -e "$sed_basename" | sort -u`
37975172 darwin_file=
37985173 darwin_files=
37995174 for darwin_file in $darwin_filelist; do
@@ -3815,7 +5190,7 @@ func_extract_archives ()
38155190 my_oldobjs="$my_oldobjs "`find $my_xdir -name \*.$objext -print -o -name \*.lo -print | sort | $NL2SP`
38165191 done
38175192
3818- func_extract_archives_result="$my_oldobjs"
5193+ func_extract_archives_result=$my_oldobjs
38195194 }
38205195
38215196
@@ -3830,7 +5205,7 @@ func_extract_archives ()
38305205 #
38315206 # ARG is the value that the WRAPPER_SCRIPT_BELONGS_IN_OBJDIR
38325207 # variable will take. If 'yes', then the emitted script
3833-# will assume that the directory in which it is stored is
5208+# will assume that the directory where it is stored is
38345209 # the $objdir directory. This is a cygwin/mingw-specific
38355210 # behavior.
38365211 func_emit_wrapper ()
@@ -3841,7 +5216,7 @@ func_emit_wrapper ()
38415216 #! $SHELL
38425217
38435218 # $output - temporary wrapper script for $objdir/$outputname
3844-# Generated by $PROGRAM (GNU $PACKAGE$TIMESTAMP) $VERSION
5219+# Generated by $PROGRAM (GNU $PACKAGE) $VERSION
38455220 #
38465221 # The $output program cannot be directly executed until all the libtool
38475222 # libraries that it depends on are installed.
@@ -3898,9 +5273,9 @@ _LTECHO_EOF'
38985273
38995274 # Very basic option parsing. These options are (a) specific to
39005275 # the libtool wrapper, (b) are identical between the wrapper
3901-# /script/ and the wrapper /executable/ which is used only on
5276+# /script/ and the wrapper /executable/ that is used only on
39025277 # windows platforms, and (c) all begin with the string "--lt-"
3903-# (application programs are unlikely to have options which match
5278+# (application programs are unlikely to have options that match
39045279 # this pattern).
39055280 #
39065281 # There are only two supported options: --lt-debug and
@@ -3933,7 +5308,7 @@ func_parse_lt_options ()
39335308
39345309 # Print the debug banner immediately:
39355310 if test -n \"\$lt_option_debug\"; then
3936- echo \"${outputname}:${output}:\${LINENO}: libtool wrapper (GNU $PACKAGE$TIMESTAMP) $VERSION\" 1>&2
5311+ echo \"$outputname:$output:\$LINENO: libtool wrapper (GNU $PACKAGE) $VERSION\" 1>&2
39375312 fi
39385313 }
39395314
@@ -3944,7 +5319,7 @@ func_lt_dump_args ()
39445319 lt_dump_args_N=1;
39455320 for lt_arg
39465321 do
3947- \$ECHO \"${outputname}:${output}:\${LINENO}: newargv[\$lt_dump_args_N]: \$lt_arg\"
5322+ \$ECHO \"$outputname:$output:\$LINENO: newargv[\$lt_dump_args_N]: \$lt_arg\"
39485323 lt_dump_args_N=\`expr \$lt_dump_args_N + 1\`
39495324 done
39505325 }
@@ -3958,7 +5333,7 @@ func_exec_program_core ()
39585333 *-*-mingw | *-*-os2* | *-cegcc*)
39595334 $ECHO "\
39605335 if test -n \"\$lt_option_debug\"; then
3961- \$ECHO \"${outputname}:${output}:\${LINENO}: newargv[0]: \$progdir\\\\\$program\" 1>&2
5336+ \$ECHO \"$outputname:$output:\$LINENO: newargv[0]: \$progdir\\\\\$program\" 1>&2
39625337 func_lt_dump_args \${1+\"\$@\"} 1>&2
39635338 fi
39645339 exec \"\$progdir\\\\\$program\" \${1+\"\$@\"}
@@ -3968,7 +5343,7 @@ func_exec_program_core ()
39685343 *)
39695344 $ECHO "\
39705345 if test -n \"\$lt_option_debug\"; then
3971- \$ECHO \"${outputname}:${output}:\${LINENO}: newargv[0]: \$progdir/\$program\" 1>&2
5346+ \$ECHO \"$outputname:$output:\$LINENO: newargv[0]: \$progdir/\$program\" 1>&2
39725347 func_lt_dump_args \${1+\"\$@\"} 1>&2
39735348 fi
39745349 exec \"\$progdir/\$program\" \${1+\"\$@\"}
@@ -4043,13 +5418,13 @@ func_exec_program ()
40435418 test -n \"\$absdir\" && thisdir=\"\$absdir\"
40445419 "
40455420
4046- if test "$fast_install" = yes; then
5421+ if test yes = "$fast_install"; then
40475422 $ECHO "\
40485423 program=lt-'$outputname'$exeext
40495424 progdir=\"\$thisdir/$objdir\"
40505425
40515426 if test ! -f \"\$progdir/\$program\" ||
4052- { file=\`ls -1dt \"\$progdir/\$program\" \"\$progdir/../\$program\" 2>/dev/null | ${SED} 1q\`; \\
5427+ { file=\`ls -1dt \"\$progdir/\$program\" \"\$progdir/../\$program\" 2>/dev/null | $SED 1q\`; \\
40535428 test \"X\$file\" != \"X\$progdir/\$program\"; }; then
40545429
40555430 file=\"\$\$-\$program\"
@@ -4066,7 +5441,7 @@ func_exec_program ()
40665441 if test -n \"\$relink_command\"; then
40675442 if relink_command_output=\`eval \$relink_command 2>&1\`; then :
40685443 else
4069- $ECHO \"\$relink_command_output\" >&2
5444+ \$ECHO \"\$relink_command_output\" >&2
40705445 $RM \"\$progdir/\$file\"
40715446 exit 1
40725447 fi
@@ -4101,7 +5476,7 @@ func_exec_program ()
41015476 fi
41025477
41035478 # Export our shlibpath_var if we have one.
4104- if test "$shlibpath_overrides_runpath" = yes && test -n "$shlibpath_var" && test -n "$temp_rpath"; then
5479+ if test yes = "$shlibpath_overrides_runpath" && test -n "$shlibpath_var" && test -n "$temp_rpath"; then
41055480 $ECHO "\
41065481 # Add our own library path to $shlibpath_var
41075482 $shlibpath_var=\"$temp_rpath\$$shlibpath_var\"
@@ -4121,7 +5496,7 @@ func_exec_program ()
41215496 fi
41225497 else
41235498 # The program doesn't exist.
4124- \$ECHO \"\$0: error: \\\`\$progdir/\$program' does not exist\" 1>&2
5499+ \$ECHO \"\$0: error: '\$progdir/\$program' does not exist\" 1>&2
41255500 \$ECHO \"This script is just a wrapper for \$program.\" 1>&2
41265501 \$ECHO \"See the $PACKAGE documentation for more information.\" 1>&2
41275502 exit 1
@@ -4140,7 +5515,7 @@ func_emit_cwrapperexe_src ()
41405515 cat <<EOF
41415516
41425517 /* $cwrappersource - temporary wrapper executable for $objdir/$outputname
4143- Generated by $PROGRAM (GNU $PACKAGE$TIMESTAMP) $VERSION
5518+ Generated by $PROGRAM (GNU $PACKAGE) $VERSION
41445519
41455520 The $output program cannot be directly executed until all the libtool
41465521 libraries that it depends on are installed.
@@ -4175,47 +5550,45 @@ EOF
41755550 #include <fcntl.h>
41765551 #include <sys/stat.h>
41775552
5553+#define STREQ(s1, s2) (strcmp ((s1), (s2)) == 0)
5554+
41785555 /* declarations of non-ANSI functions */
4179-#if defined(__MINGW32__)
5556+#if defined __MINGW32__
41805557 # ifdef __STRICT_ANSI__
41815558 int _putenv (const char *);
41825559 # endif
4183-#elif defined(__CYGWIN__)
5560+#elif defined __CYGWIN__
41845561 # ifdef __STRICT_ANSI__
41855562 char *realpath (const char *, char *);
41865563 int putenv (char *);
41875564 int setenv (const char *, const char *, int);
41885565 # endif
4189-/* #elif defined (other platforms) ... */
5566+/* #elif defined other_platform || defined ... */
41905567 #endif
41915568
41925569 /* portability defines, excluding path handling macros */
4193-#if defined(_MSC_VER)
5570+#if defined _MSC_VER
41945571 # define setmode _setmode
41955572 # define stat _stat
41965573 # define chmod _chmod
41975574 # define getcwd _getcwd
41985575 # define putenv _putenv
41995576 # define S_IXUSR _S_IEXEC
4200-# ifndef _INTPTR_T_DEFINED
4201-# define _INTPTR_T_DEFINED
4202-# define intptr_t int
4203-# endif
4204-#elif defined(__MINGW32__)
5577+#elif defined __MINGW32__
42055578 # define setmode _setmode
42065579 # define stat _stat
42075580 # define chmod _chmod
42085581 # define getcwd _getcwd
42095582 # define putenv _putenv
4210-#elif defined(__CYGWIN__)
5583+#elif defined __CYGWIN__
42115584 # define HAVE_SETENV
42125585 # define FOPEN_WB "wb"
4213-/* #elif defined (other platforms) ... */
5586+/* #elif defined other platforms ... */
42145587 #endif
42155588
4216-#if defined(PATH_MAX)
5589+#if defined PATH_MAX
42175590 # define LT_PATHMAX PATH_MAX
4218-#elif defined(MAXPATHLEN)
5591+#elif defined MAXPATHLEN
42195592 # define LT_PATHMAX MAXPATHLEN
42205593 #else
42215594 # define LT_PATHMAX 1024
@@ -4234,8 +5607,8 @@ int setenv (const char *, const char *, int);
42345607 # define PATH_SEPARATOR ':'
42355608 #endif
42365609
4237-#if defined (_WIN32) || defined (__MSDOS__) || defined (__DJGPP__) || \
4238- defined (__OS2__)
5610+#if defined _WIN32 || defined __MSDOS__ || defined __DJGPP__ || \
5611+ defined __OS2__
42395612 # define HAVE_DOS_BASED_FILE_SYSTEM
42405613 # define FOPEN_WB "wb"
42415614 # ifndef DIR_SEPARATOR_2
@@ -4268,10 +5641,10 @@ int setenv (const char *, const char *, int);
42685641
42695642 #define XMALLOC(type, num) ((type *) xmalloc ((num) * sizeof(type)))
42705643 #define XFREE(stale) do { \
4271- if (stale) { free ((void *) stale); stale = 0; } \
5644+ if (stale) { free (stale); stale = 0; } \
42725645 } while (0)
42735646
4274-#if defined(LT_DEBUGWRAPPER)
5647+#if defined LT_DEBUGWRAPPER
42755648 static int lt_debug = 1;
42765649 #else
42775650 static int lt_debug = 0;
@@ -4300,11 +5673,16 @@ void lt_dump_script (FILE *f);
43005673 EOF
43015674
43025675 cat <<EOF
4303-volatile const char * MAGIC_EXE = "$magic_exe";
5676+#if __GNUC__ < 4 || (__GNUC__ == 4 && __GNUC_MINOR__ < 5)
5677+# define externally_visible volatile
5678+#else
5679+# define externally_visible __attribute__((externally_visible)) volatile
5680+#endif
5681+externally_visible const char * MAGIC_EXE = "$magic_exe";
43045682 const char * LIB_PATH_VARNAME = "$shlibpath_var";
43055683 EOF
43065684
4307- if test "$shlibpath_overrides_runpath" = yes && test -n "$shlibpath_var" && test -n "$temp_rpath"; then
5685+ if test yes = "$shlibpath_overrides_runpath" && test -n "$shlibpath_var" && test -n "$temp_rpath"; then
43085686 func_to_host_path "$temp_rpath"
43095687 cat <<EOF
43105688 const char * LIB_PATH_VALUE = "$func_to_host_path_result";
@@ -4328,7 +5706,7 @@ const char * EXE_PATH_VALUE = "";
43285706 EOF
43295707 fi
43305708
4331- if test "$fast_install" = yes; then
5709+ if test yes = "$fast_install"; then
43325710 cat <<EOF
43335711 const char * TARGET_PROGRAM_NAME = "lt-$outputname"; /* hopefully, no .exe */
43345712 EOF
@@ -4357,12 +5735,12 @@ main (int argc, char *argv[])
43575735 char *actual_cwrapper_name;
43585736 char *target_name;
43595737 char *lt_argv_zero;
4360- intptr_t rval = 127;
5738+ int rval = 127;
43615739
43625740 int i;
43635741
43645742 program_name = (char *) xstrdup (base_name (argv[0]));
4365- newargz = XMALLOC (char *, argc + 1);
5743+ newargz = XMALLOC (char *, (size_t) argc + 1);
43665744
43675745 /* very simple arg parsing; don't want to rely on getopt
43685746 * also, copy all non cwrapper options to newargz, except
@@ -4371,10 +5749,10 @@ main (int argc, char *argv[])
43715749 newargc=0;
43725750 for (i = 1; i < argc; i++)
43735751 {
4374- if (strcmp (argv[i], dumpscript_opt) == 0)
5752+ if (STREQ (argv[i], dumpscript_opt))
43755753 {
43765754 EOF
4377- case "$host" in
5755+ case $host in
43785756 *mingw* | *cygwin* )
43795757 # make stdout use "unix" line endings
43805758 echo " setmode(1,_O_BINARY);"
@@ -4385,12 +5763,12 @@ EOF
43855763 lt_dump_script (stdout);
43865764 return 0;
43875765 }
4388- if (strcmp (argv[i], debug_opt) == 0)
5766+ if (STREQ (argv[i], debug_opt))
43895767 {
43905768 lt_debug = 1;
43915769 continue;
43925770 }
4393- if (strcmp (argv[i], ltwrapper_option_prefix) == 0)
5771+ if (STREQ (argv[i], ltwrapper_option_prefix))
43945772 {
43955773 /* however, if there is an option in the LTWRAPPER_OPTION_PREFIX
43965774 namespace, but it is not one of the ones we know about and
@@ -4413,7 +5791,7 @@ EOF
44135791 EOF
44145792 cat <<EOF
44155793 /* The GNU banner must be the first non-error debug message */
4416- lt_debugprintf (__FILE__, __LINE__, "libtool wrapper (GNU $PACKAGE$TIMESTAMP) $VERSION\n");
5794+ lt_debugprintf (__FILE__, __LINE__, "libtool wrapper (GNU $PACKAGE) $VERSION\n");
44175795 EOF
44185796 cat <<"EOF"
44195797 lt_debugprintf (__FILE__, __LINE__, "(main) argv[0]: %s\n", argv[0]);
@@ -4524,7 +5902,7 @@ EOF
45245902 cat <<"EOF"
45255903 /* execv doesn't actually work on mingw as expected on unix */
45265904 newargz = prepare_spawn (newargz);
4527- rval = _spawnv (_P_WAIT, lt_argv_zero, (const char * const *) newargz);
5905+ rval = (int) _spawnv (_P_WAIT, lt_argv_zero, (const char * const *) newargz);
45285906 if (rval == -1)
45295907 {
45305908 /* failed to start process */
@@ -4569,7 +5947,7 @@ base_name (const char *name)
45695947 {
45705948 const char *base;
45715949
4572-#if defined (HAVE_DOS_BASED_FILE_SYSTEM)
5950+#if defined HAVE_DOS_BASED_FILE_SYSTEM
45735951 /* Skip over the disk name in MSDOS pathnames. */
45745952 if (isalpha ((unsigned char) name[0]) && name[1] == ':')
45755953 name += 2;
@@ -4628,7 +6006,7 @@ find_executable (const char *wrapper)
46286006 const char *p_next;
46296007 /* static buffer for getcwd */
46306008 char tmp[LT_PATHMAX + 1];
4631- int tmp_len;
6009+ size_t tmp_len;
46326010 char *concat_name;
46336011
46346012 lt_debugprintf (__FILE__, __LINE__, "(find_executable): %s\n",
@@ -4638,7 +6016,7 @@ find_executable (const char *wrapper)
46386016 return NULL;
46396017
46406018 /* Absolute path? */
4641-#if defined (HAVE_DOS_BASED_FILE_SYSTEM)
6019+#if defined HAVE_DOS_BASED_FILE_SYSTEM
46426020 if (isalpha ((unsigned char) wrapper[0]) && wrapper[1] == ':')
46436021 {
46446022 concat_name = xstrdup (wrapper);
@@ -4656,7 +6034,7 @@ find_executable (const char *wrapper)
46566034 return concat_name;
46576035 XFREE (concat_name);
46586036 }
4659-#if defined (HAVE_DOS_BASED_FILE_SYSTEM)
6037+#if defined HAVE_DOS_BASED_FILE_SYSTEM
46606038 }
46616039 #endif
46626040
@@ -4679,7 +6057,7 @@ find_executable (const char *wrapper)
46796057 for (q = p; *q; q++)
46806058 if (IS_PATH_SEPARATOR (*q))
46816059 break;
4682- p_len = q - p;
6060+ p_len = (size_t) (q - p);
46836061 p_next = (*q == '\0' ? q : q + 1);
46846062 if (p_len == 0)
46856063 {
@@ -4798,7 +6176,7 @@ strendzap (char *str, const char *pat)
47986176 if (patlen <= len)
47996177 {
48006178 str += len - patlen;
4801- if (strcmp (str, pat) == 0)
6179+ if (STREQ (str, pat))
48026180 *str = '\0';
48036181 }
48046182 return str;
@@ -4863,7 +6241,7 @@ lt_setenv (const char *name, const char *value)
48636241 char *str = xstrdup (value);
48646242 setenv (name, str, 1);
48656243 #else
4866- int len = strlen (name) + 1 + strlen (value) + 1;
6244+ size_t len = strlen (name) + 1 + strlen (value) + 1;
48676245 char *str = XMALLOC (char, len);
48686246 sprintf (str, "%s=%s", name, value);
48696247 if (putenv (str) != EXIT_SUCCESS)
@@ -4880,8 +6258,8 @@ lt_extend_str (const char *orig_value, const char *add, int to_end)
48806258 char *new_value;
48816259 if (orig_value && *orig_value)
48826260 {
4883- int orig_value_len = strlen (orig_value);
4884- int add_len = strlen (add);
6261+ size_t orig_value_len = strlen (orig_value);
6262+ size_t add_len = strlen (add);
48856263 new_value = XMALLOC (char, add_len + orig_value_len + 1);
48866264 if (to_end)
48876265 {
@@ -4912,10 +6290,10 @@ lt_update_exe_path (const char *name, const char *value)
49126290 {
49136291 char *new_value = lt_extend_str (getenv (name), value, 0);
49146292 /* some systems can't cope with a ':'-terminated path #' */
4915- int len = strlen (new_value);
4916- while (((len = strlen (new_value)) > 0) && IS_PATH_SEPARATOR (new_value[len-1]))
6293+ size_t len = strlen (new_value);
6294+ while ((len > 0) && IS_PATH_SEPARATOR (new_value[len-1]))
49176295 {
4918- new_value[len-1] = '\0';
6296+ new_value[--len] = '\0';
49196297 }
49206298 lt_setenv (name, new_value);
49216299 XFREE (new_value);
@@ -5082,27 +6460,47 @@ EOF
50826460 # True if ARG is an import lib, as indicated by $file_magic_cmd
50836461 func_win32_import_lib_p ()
50846462 {
5085- $opt_debug
6463+ $debug_cmd
6464+
50866465 case `eval $file_magic_cmd \"\$1\" 2>/dev/null | $SED -e 10q` in
50876466 *import*) : ;;
50886467 *) false ;;
50896468 esac
50906469 }
50916470
6471+# func_suncc_cstd_abi
6472+# !!ONLY CALL THIS FOR SUN CC AFTER $compile_command IS FULLY EXPANDED!!
6473+# Several compiler flags select an ABI that is incompatible with the
6474+# Cstd library. Avoid specifying it if any are in CXXFLAGS.
6475+func_suncc_cstd_abi ()
6476+{
6477+ $debug_cmd
6478+
6479+ case " $compile_command " in
6480+ *" -compat=g "*|*\ -std=c++[0-9][0-9]\ *|*" -library=stdcxx4 "*|*" -library=stlport4 "*)
6481+ suncc_use_cstd_abi=no
6482+ ;;
6483+ *)
6484+ suncc_use_cstd_abi=yes
6485+ ;;
6486+ esac
6487+}
6488+
50926489 # func_mode_link arg...
50936490 func_mode_link ()
50946491 {
5095- $opt_debug
6492+ $debug_cmd
6493+
50966494 case $host in
50976495 *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-cegcc*)
50986496 # It is impossible to link a dll without this setting, and
50996497 # we shouldn't force the makefile maintainer to figure out
5100- # which system we are compiling for in order to pass an extra
6498+ # what system we are compiling for in order to pass an extra
51016499 # flag for every libtool invocation.
51026500 # allow_undefined=no
51036501
51046502 # FIXME: Unfortunately, there are problems with the above when trying
5105- # to make a dll which has undefined symbols, in which case not
6503+ # to make a dll that has undefined symbols, in which case not
51066504 # even a static library is built. For now, we need to specify
51076505 # -no-undefined on the libtool link line when we can be certain
51086506 # that all symbols are satisfied, otherwise we get a static library.
@@ -5146,10 +6544,11 @@ func_mode_link ()
51466544 module=no
51476545 no_install=no
51486546 objs=
6547+ os2dllname=
51496548 non_pic_objects=
51506549 precious_files_regex=
51516550 prefer_static_libs=no
5152- preload=no
6551+ preload=false
51536552 prev=
51546553 prevarg=
51556554 release=
@@ -5161,7 +6560,7 @@ func_mode_link ()
51616560 vinfo=
51626561 vinfo_number=no
51636562 weak_libs=
5164- single_module="${wl}-single_module"
6563+ single_module=$wl-single_module
51656564 func_infer_tag $base_compile
51666565
51676566 # We need to know -static, to get the right output filenames.
@@ -5169,15 +6568,15 @@ func_mode_link ()
51696568 do
51706569 case $arg in
51716570 -shared)
5172- test "$build_libtool_libs" != yes && \
5173- func_fatal_configuration "can not build a shared library"
6571+ test yes != "$build_libtool_libs" \
6572+ && func_fatal_configuration "cannot build a shared library"
51746573 build_old_libs=no
51756574 break
51766575 ;;
51776576 -all-static | -static | -static-libtool-libs)
51786577 case $arg in
51796578 -all-static)
5180- if test "$build_libtool_libs" = yes && test -z "$link_static_flag"; then
6579+ if test yes = "$build_libtool_libs" && test -z "$link_static_flag"; then
51816580 func_warning "complete static linking is impossible in this configuration"
51826581 fi
51836582 if test -n "$link_static_flag"; then
@@ -5210,7 +6609,7 @@ func_mode_link ()
52106609
52116610 # Go through the arguments, transforming them on the way.
52126611 while test "$#" -gt 0; do
5213- arg="$1"
6612+ arg=$1
52146613 shift
52156614 func_quote_for_eval "$arg"
52166615 qarg=$func_quote_for_eval_unquoted_result
@@ -5227,21 +6626,21 @@ func_mode_link ()
52276626
52286627 case $prev in
52296628 bindir)
5230- bindir="$arg"
6629+ bindir=$arg
52316630 prev=
52326631 continue
52336632 ;;
52346633 dlfiles|dlprefiles)
5235- if test "$preload" = no; then
6634+ $preload || {
52366635 # Add the symbol object into the linking commands.
52376636 func_append compile_command " @SYMFILE@"
52386637 func_append finalize_command " @SYMFILE@"
5239- preload=yes
5240- fi
6638+ preload=:
6639+ }
52416640 case $arg in
52426641 *.la | *.lo) ;; # We handle these cases below.
52436642 force)
5244- if test "$dlself" = no; then
6643+ if test no = "$dlself"; then
52456644 dlself=needless
52466645 export_dynamic=yes
52476646 fi
@@ -5249,9 +6648,9 @@ func_mode_link ()
52496648 continue
52506649 ;;
52516650 self)
5252- if test "$prev" = dlprefiles; then
6651+ if test dlprefiles = "$prev"; then
52536652 dlself=yes
5254- elif test "$prev" = dlfiles && test "$dlopen_self" != yes; then
6653+ elif test dlfiles = "$prev" && test yes != "$dlopen_self"; then
52556654 dlself=yes
52566655 else
52576656 dlself=needless
@@ -5261,7 +6660,7 @@ func_mode_link ()
52616660 continue
52626661 ;;
52636662 *)
5264- if test "$prev" = dlfiles; then
6663+ if test dlfiles = "$prev"; then
52656664 func_append dlfiles " $arg"
52666665 else
52676666 func_append dlprefiles " $arg"
@@ -5272,14 +6671,14 @@ func_mode_link ()
52726671 esac
52736672 ;;
52746673 expsyms)
5275- export_symbols="$arg"
6674+ export_symbols=$arg
52766675 test -f "$arg" \
5277- || func_fatal_error "symbol file \`$arg' does not exist"
6676+ || func_fatal_error "symbol file '$arg' does not exist"
52786677 prev=
52796678 continue
52806679 ;;
52816680 expsyms_regex)
5282- export_symbols_regex="$arg"
6681+ export_symbols_regex=$arg
52836682 prev=
52846683 continue
52856684 ;;
@@ -5297,7 +6696,13 @@ func_mode_link ()
52976696 continue
52986697 ;;
52996698 inst_prefix)
5300- inst_prefix_dir="$arg"
6699+ inst_prefix_dir=$arg
6700+ prev=
6701+ continue
6702+ ;;
6703+ mllvm)
6704+ # Clang does not use LLVM to link, so we can simply discard any
6705+ # '-mllvm $arg' options when doing the link step.
53016706 prev=
53026707 continue
53036708 ;;
@@ -5321,21 +6726,21 @@ func_mode_link ()
53216726
53226727 if test -z "$pic_object" ||
53236728 test -z "$non_pic_object" ||
5324- test "$pic_object" = none &&
5325- test "$non_pic_object" = none; then
5326- func_fatal_error "cannot find name of object for \`$arg'"
6729+ test none = "$pic_object" &&
6730+ test none = "$non_pic_object"; then
6731+ func_fatal_error "cannot find name of object for '$arg'"
53276732 fi
53286733
53296734 # Extract subdirectory from the argument.
53306735 func_dirname "$arg" "/" ""
5331- xdir="$func_dirname_result"
6736+ xdir=$func_dirname_result
53326737
5333- if test "$pic_object" != none; then
6738+ if test none != "$pic_object"; then
53346739 # Prepend the subdirectory the object is found in.
5335- pic_object="$xdir$pic_object"
6740+ pic_object=$xdir$pic_object
53366741
5337- if test "$prev" = dlfiles; then
5338- if test "$build_libtool_libs" = yes && test "$dlopen_support" = yes; then
6742+ if test dlfiles = "$prev"; then
6743+ if test yes = "$build_libtool_libs" && test yes = "$dlopen_support"; then
53396744 func_append dlfiles " $pic_object"
53406745 prev=
53416746 continue
@@ -5346,7 +6751,7 @@ func_mode_link ()
53466751 fi
53476752
53486753 # CHECK ME: I think I busted this. -Ossama
5349- if test "$prev" = dlprefiles; then
6754+ if test dlprefiles = "$prev"; then
53506755 # Preload the old-style object.
53516756 func_append dlprefiles " $pic_object"
53526757 prev=
@@ -5354,23 +6759,23 @@ func_mode_link ()
53546759
53556760 # A PIC object.
53566761 func_append libobjs " $pic_object"
5357- arg="$pic_object"
6762+ arg=$pic_object
53586763 fi
53596764
53606765 # Non-PIC object.
5361- if test "$non_pic_object" != none; then
6766+ if test none != "$non_pic_object"; then
53626767 # Prepend the subdirectory the object is found in.
5363- non_pic_object="$xdir$non_pic_object"
6768+ non_pic_object=$xdir$non_pic_object
53646769
53656770 # A standard non-PIC object
53666771 func_append non_pic_objects " $non_pic_object"
5367- if test -z "$pic_object" || test "$pic_object" = none ; then
5368- arg="$non_pic_object"
6772+ if test -z "$pic_object" || test none = "$pic_object"; then
6773+ arg=$non_pic_object
53696774 fi
53706775 else
53716776 # If the PIC object exists, use it instead.
53726777 # $xdir was prepended to $pic_object above.
5373- non_pic_object="$pic_object"
6778+ non_pic_object=$pic_object
53746779 func_append non_pic_objects " $non_pic_object"
53756780 fi
53766781 else
@@ -5378,7 +6783,7 @@ func_mode_link ()
53786783 if $opt_dry_run; then
53796784 # Extract subdirectory from the argument.
53806785 func_dirname "$arg" "/" ""
5381- xdir="$func_dirname_result"
6786+ xdir=$func_dirname_result
53826787
53836788 func_lo2o "$arg"
53846789 pic_object=$xdir$objdir/$func_lo2o_result
@@ -5386,24 +6791,29 @@ func_mode_link ()
53866791 func_append libobjs " $pic_object"
53876792 func_append non_pic_objects " $non_pic_object"
53886793 else
5389- func_fatal_error "\`$arg' is not a valid libtool object"
6794+ func_fatal_error "'$arg' is not a valid libtool object"
53906795 fi
53916796 fi
53926797 done
53936798 else
5394- func_fatal_error "link input file \`$arg' does not exist"
6799+ func_fatal_error "link input file '$arg' does not exist"
53956800 fi
53966801 arg=$save_arg
53976802 prev=
53986803 continue
53996804 ;;
6805+ os2dllname)
6806+ os2dllname=$arg
6807+ prev=
6808+ continue
6809+ ;;
54006810 precious_regex)
5401- precious_files_regex="$arg"
6811+ precious_files_regex=$arg
54026812 prev=
54036813 continue
54046814 ;;
54056815 release)
5406- release="-$arg"
6816+ release=-$arg
54076817 prev=
54086818 continue
54096819 ;;
@@ -5415,7 +6825,7 @@ func_mode_link ()
54156825 func_fatal_error "only absolute run-paths are allowed"
54166826 ;;
54176827 esac
5418- if test "$prev" = rpath; then
6828+ if test rpath = "$prev"; then
54196829 case "$rpath " in
54206830 *" $arg "*) ;;
54216831 *) func_append rpath " $arg" ;;
@@ -5430,7 +6840,7 @@ func_mode_link ()
54306840 continue
54316841 ;;
54326842 shrext)
5433- shrext_cmds="$arg"
6843+ shrext_cmds=$arg
54346844 prev=
54356845 continue
54366846 ;;
@@ -5470,7 +6880,7 @@ func_mode_link ()
54706880 esac
54716881 fi # test -n "$prev"
54726882
5473- prevarg="$arg"
6883+ prevarg=$arg
54746884
54756885 case $arg in
54766886 -all-static)
@@ -5484,7 +6894,7 @@ func_mode_link ()
54846894
54856895 -allow-undefined)
54866896 # FIXME: remove this flag sometime in the future.
5487- func_fatal_error "\`-allow-undefined' must not be used because it is the default"
6897+ func_fatal_error "'-allow-undefined' must not be used because it is the default"
54886898 ;;
54896899
54906900 -avoid-version)
@@ -5516,7 +6926,7 @@ func_mode_link ()
55166926 if test -n "$export_symbols" || test -n "$export_symbols_regex"; then
55176927 func_fatal_error "more than one -exported-symbols argument is not allowed"
55186928 fi
5519- if test "X$arg" = "X-export-symbols"; then
6929+ if test X-export-symbols = "X$arg"; then
55206930 prev=expsyms
55216931 else
55226932 prev=expsyms_regex
@@ -5550,9 +6960,9 @@ func_mode_link ()
55506960 func_stripname "-L" '' "$arg"
55516961 if test -z "$func_stripname_result"; then
55526962 if test "$#" -gt 0; then
5553- func_fatal_error "require no space between \`-L' and \`$1'"
6963+ func_fatal_error "require no space between '-L' and '$1'"
55546964 else
5555- func_fatal_error "need path for \`-L' option"
6965+ func_fatal_error "need path for '-L' option"
55566966 fi
55576967 fi
55586968 func_resolve_sysroot "$func_stripname_result"
@@ -5563,8 +6973,8 @@ func_mode_link ()
55636973 *)
55646974 absdir=`cd "$dir" && pwd`
55656975 test -z "$absdir" && \
5566- func_fatal_error "cannot determine absolute directory name of \`$dir'"
5567- dir="$absdir"
6976+ func_fatal_error "cannot determine absolute directory name of '$dir'"
6977+ dir=$absdir
55686978 ;;
55696979 esac
55706980 case "$deplibs " in
@@ -5599,7 +7009,7 @@ func_mode_link ()
55997009 ;;
56007010
56017011 -l*)
5602- if test "X$arg" = "X-lc" || test "X$arg" = "X-lm"; then
7012+ if test X-lc = "X$arg" || test X-lm = "X$arg"; then
56037013 case $host in
56047014 *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-beos* | *-cegcc* | *-*-haiku*)
56057015 # These systems don't actually have a C or math library (as such)
@@ -5607,11 +7017,11 @@ func_mode_link ()
56077017 ;;
56087018 *-*-os2*)
56097019 # These systems don't actually have a C library (as such)
5610- test "X$arg" = "X-lc" && continue
7020+ test X-lc = "X$arg" && continue
56117021 ;;
5612- *-*-openbsd* | *-*-freebsd* | *-*-dragonfly*)
7022+ *-*-openbsd* | *-*-freebsd* | *-*-dragonfly* | *-*-bitrig*)
56137023 # Do not include libc due to us having libc/libc_r.
5614- test "X$arg" = "X-lc" && continue
7024+ test X-lc = "X$arg" && continue
56157025 ;;
56167026 *-*-rhapsody* | *-*-darwin1.[012])
56177027 # Rhapsody C and math libraries are in the System framework
@@ -5620,16 +7030,16 @@ func_mode_link ()
56207030 ;;
56217031 *-*-sco3.2v5* | *-*-sco5v6*)
56227032 # Causes problems with __ctype
5623- test "X$arg" = "X-lc" && continue
7033+ test X-lc = "X$arg" && continue
56247034 ;;
56257035 *-*-sysv4.2uw2* | *-*-sysv5* | *-*-unixware* | *-*-OpenUNIX*)
56267036 # Compiler inserts libc in the correct place for threads to work
5627- test "X$arg" = "X-lc" && continue
7037+ test X-lc = "X$arg" && continue
56287038 ;;
56297039 esac
5630- elif test "X$arg" = "X-lc_r"; then
7040+ elif test X-lc_r = "X$arg"; then
56317041 case $host in
5632- *-*-openbsd* | *-*-freebsd* | *-*-dragonfly*)
7042+ *-*-openbsd* | *-*-freebsd* | *-*-dragonfly* | *-*-bitrig*)
56337043 # Do not include libc_r directly, use -pthread flag.
56347044 continue
56357045 ;;
@@ -5639,6 +7049,11 @@ func_mode_link ()
56397049 continue
56407050 ;;
56417051
7052+ -mllvm)
7053+ prev=mllvm
7054+ continue
7055+ ;;
7056+
56427057 -module)
56437058 module=yes
56447059 continue
@@ -5668,7 +7083,7 @@ func_mode_link ()
56687083 ;;
56697084
56707085 -multi_module)
5671- single_module="${wl}-multi_module"
7086+ single_module=$wl-multi_module
56727087 continue
56737088 ;;
56747089
@@ -5682,8 +7097,8 @@ func_mode_link ()
56827097 *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-*-darwin* | *-cegcc*)
56837098 # The PATH hackery in wrapper scripts is required on Windows
56847099 # and Darwin in order for the loader to find any dlls it needs.
5685- func_warning "\`-no-install' is ignored for $host"
5686- func_warning "assuming \`-no-fast-install' instead"
7100+ func_warning "'-no-install' is ignored for $host"
7101+ func_warning "assuming '-no-fast-install' instead"
56877102 fast_install=no
56887103 ;;
56897104 *) no_install=yes ;;
@@ -5701,6 +7116,11 @@ func_mode_link ()
57017116 continue
57027117 ;;
57037118
7119+ -os2dllname)
7120+ prev=os2dllname
7121+ continue
7122+ ;;
7123+
57047124 -o) prev=output ;;
57057125
57067126 -precious-files-regex)
@@ -5788,14 +7208,14 @@ func_mode_link ()
57887208 func_stripname '-Wc,' '' "$arg"
57897209 args=$func_stripname_result
57907210 arg=
5791- save_ifs="$IFS"; IFS=','
7211+ save_ifs=$IFS; IFS=,
57927212 for flag in $args; do
5793- IFS="$save_ifs"
7213+ IFS=$save_ifs
57947214 func_quote_for_eval "$flag"
57957215 func_append arg " $func_quote_for_eval_result"
57967216 func_append compiler_flags " $func_quote_for_eval_result"
57977217 done
5798- IFS="$save_ifs"
7218+ IFS=$save_ifs
57997219 func_stripname ' ' '' "$arg"
58007220 arg=$func_stripname_result
58017221 ;;
@@ -5804,15 +7224,15 @@ func_mode_link ()
58047224 func_stripname '-Wl,' '' "$arg"
58057225 args=$func_stripname_result
58067226 arg=
5807- save_ifs="$IFS"; IFS=','
7227+ save_ifs=$IFS; IFS=,
58087228 for flag in $args; do
5809- IFS="$save_ifs"
7229+ IFS=$save_ifs
58107230 func_quote_for_eval "$flag"
58117231 func_append arg " $wl$func_quote_for_eval_result"
58127232 func_append compiler_flags " $wl$func_quote_for_eval_result"
58137233 func_append linker_flags " $func_quote_for_eval_result"
58147234 done
5815- IFS="$save_ifs"
7235+ IFS=$save_ifs
58167236 func_stripname ' ' '' "$arg"
58177237 arg=$func_stripname_result
58187238 ;;
@@ -5835,7 +7255,7 @@ func_mode_link ()
58357255 # -msg_* for osf cc
58367256 -msg_*)
58377257 func_quote_for_eval "$arg"
5838- arg="$func_quote_for_eval_result"
7258+ arg=$func_quote_for_eval_result
58397259 ;;
58407260
58417261 # Flags to be passed through unchanged, with rationale:
@@ -5847,25 +7267,49 @@ func_mode_link ()
58477267 # -m*, -t[45]*, -txscale* architecture-specific flags for GCC
58487268 # -F/path path to uninstalled frameworks, gcc on darwin
58497269 # -p, -pg, --coverage, -fprofile-* profiling flags for GCC
7270+ # -fstack-protector* stack protector flags for GCC
58507271 # @file GCC response files
58517272 # -tp=* Portland pgcc target processor selection
58527273 # --sysroot=* for sysroot support
5853- # -O*, -flto*, -fwhopr*, -fuse-linker-plugin GCC link-time optimization
7274+ # -O*, -g*, -flto*, -fwhopr*, -fuse-linker-plugin GCC link-time optimization
7275+ # -specs=* GCC specs files
7276+ # -stdlib=* select c++ std lib with clang
7277+ # -fsanitize=* Clang/GCC memory and address sanitizer
58547278 -64|-mips[0-9]|-r[0-9][0-9]*|-xarch=*|-xtarget=*|+DA*|+DD*|-q*|-m*| \
58557279 -t[45]*|-txscale*|-p|-pg|--coverage|-fprofile-*|-F*|@*|-tp=*|--sysroot=*| \
5856- -O*|-flto*|-fwhopr*|-fuse-linker-plugin)
7280+ -O*|-g*|-flto*|-fwhopr*|-fuse-linker-plugin|-fstack-protector*|-stdlib=*| \
7281+ -specs=*|-fsanitize=*)
58577282 func_quote_for_eval "$arg"
5858- arg="$func_quote_for_eval_result"
7283+ arg=$func_quote_for_eval_result
58597284 func_append compile_command " $arg"
58607285 func_append finalize_command " $arg"
58617286 func_append compiler_flags " $arg"
58627287 continue
58637288 ;;
58647289
7290+ -Z*)
7291+ if test os2 = "`expr $host : '.*\(os2\)'`"; then
7292+ # OS/2 uses -Zxxx to specify OS/2-specific options
7293+ compiler_flags="$compiler_flags $arg"
7294+ func_append compile_command " $arg"
7295+ func_append finalize_command " $arg"
7296+ case $arg in
7297+ -Zlinker | -Zstack)
7298+ prev=xcompiler
7299+ ;;
7300+ esac
7301+ continue
7302+ else
7303+ # Otherwise treat like 'Some other compiler flag' below
7304+ func_quote_for_eval "$arg"
7305+ arg=$func_quote_for_eval_result
7306+ fi
7307+ ;;
7308+
58657309 # Some other compiler flag.
58667310 -* | +*)
58677311 func_quote_for_eval "$arg"
5868- arg="$func_quote_for_eval_result"
7312+ arg=$func_quote_for_eval_result
58697313 ;;
58707314
58717315 *.$objext)
@@ -5886,21 +7330,21 @@ func_mode_link ()
58867330
58877331 if test -z "$pic_object" ||
58887332 test -z "$non_pic_object" ||
5889- test "$pic_object" = none &&
5890- test "$non_pic_object" = none; then
5891- func_fatal_error "cannot find name of object for \`$arg'"
7333+ test none = "$pic_object" &&
7334+ test none = "$non_pic_object"; then
7335+ func_fatal_error "cannot find name of object for '$arg'"
58927336 fi
58937337
58947338 # Extract subdirectory from the argument.
58957339 func_dirname "$arg" "/" ""
5896- xdir="$func_dirname_result"
7340+ xdir=$func_dirname_result
58977341
5898- if test "$pic_object" != none; then
7342+ test none = "$pic_object" || {
58997343 # Prepend the subdirectory the object is found in.
5900- pic_object="$xdir$pic_object"
7344+ pic_object=$xdir$pic_object
59017345
5902- if test "$prev" = dlfiles; then
5903- if test "$build_libtool_libs" = yes && test "$dlopen_support" = yes; then
7346+ if test dlfiles = "$prev"; then
7347+ if test yes = "$build_libtool_libs" && test yes = "$dlopen_support"; then
59047348 func_append dlfiles " $pic_object"
59057349 prev=
59067350 continue
@@ -5911,7 +7355,7 @@ func_mode_link ()
59117355 fi
59127356
59137357 # CHECK ME: I think I busted this. -Ossama
5914- if test "$prev" = dlprefiles; then
7358+ if test dlprefiles = "$prev"; then
59157359 # Preload the old-style object.
59167360 func_append dlprefiles " $pic_object"
59177361 prev=
@@ -5919,23 +7363,23 @@ func_mode_link ()
59197363
59207364 # A PIC object.
59217365 func_append libobjs " $pic_object"
5922- arg="$pic_object"
5923- fi
7366+ arg=$pic_object
7367+ }
59247368
59257369 # Non-PIC object.
5926- if test "$non_pic_object" != none; then
7370+ if test none != "$non_pic_object"; then
59277371 # Prepend the subdirectory the object is found in.
5928- non_pic_object="$xdir$non_pic_object"
7372+ non_pic_object=$xdir$non_pic_object
59297373
59307374 # A standard non-PIC object
59317375 func_append non_pic_objects " $non_pic_object"
5932- if test -z "$pic_object" || test "$pic_object" = none ; then
5933- arg="$non_pic_object"
7376+ if test -z "$pic_object" || test none = "$pic_object"; then
7377+ arg=$non_pic_object
59347378 fi
59357379 else
59367380 # If the PIC object exists, use it instead.
59377381 # $xdir was prepended to $pic_object above.
5938- non_pic_object="$pic_object"
7382+ non_pic_object=$pic_object
59397383 func_append non_pic_objects " $non_pic_object"
59407384 fi
59417385 else
@@ -5943,7 +7387,7 @@ func_mode_link ()
59437387 if $opt_dry_run; then
59447388 # Extract subdirectory from the argument.
59457389 func_dirname "$arg" "/" ""
5946- xdir="$func_dirname_result"
7390+ xdir=$func_dirname_result
59477391
59487392 func_lo2o "$arg"
59497393 pic_object=$xdir$objdir/$func_lo2o_result
@@ -5951,7 +7395,7 @@ func_mode_link ()
59517395 func_append libobjs " $pic_object"
59527396 func_append non_pic_objects " $non_pic_object"
59537397 else
5954- func_fatal_error "\`$arg' is not a valid libtool object"
7398+ func_fatal_error "'$arg' is not a valid libtool object"
59557399 fi
59567400 fi
59577401 ;;
@@ -5967,11 +7411,11 @@ func_mode_link ()
59677411 # A libtool-controlled library.
59687412
59697413 func_resolve_sysroot "$arg"
5970- if test "$prev" = dlfiles; then
7414+ if test dlfiles = "$prev"; then
59717415 # This library was specified with -dlopen.
59727416 func_append dlfiles " $func_resolve_sysroot_result"
59737417 prev=
5974- elif test "$prev" = dlprefiles; then
7418+ elif test dlprefiles = "$prev"; then
59757419 # The library was specified with -dlpreopen.
59767420 func_append dlprefiles " $func_resolve_sysroot_result"
59777421 prev=
@@ -5986,7 +7430,7 @@ func_mode_link ()
59867430 # Unknown arguments in both finalize_command and compile_command need
59877431 # to be aesthetically quoted because they are evaled later.
59887432 func_quote_for_eval "$arg"
5989- arg="$func_quote_for_eval_result"
7433+ arg=$func_quote_for_eval_result
59907434 ;;
59917435 esac # arg
59927436
@@ -5998,9 +7442,9 @@ func_mode_link ()
59987442 done # argument parsing loop
59997443
60007444 test -n "$prev" && \
6001- func_fatal_help "the \`$prevarg' option requires an argument"
7445+ func_fatal_help "the '$prevarg' option requires an argument"
60027446
6003- if test "$export_dynamic" = yes && test -n "$export_dynamic_flag_spec"; then
7447+ if test yes = "$export_dynamic" && test -n "$export_dynamic_flag_spec"; then
60047448 eval arg=\"$export_dynamic_flag_spec\"
60057449 func_append compile_command " $arg"
60067450 func_append finalize_command " $arg"
@@ -6009,20 +7453,23 @@ func_mode_link ()
60097453 oldlibs=
60107454 # calculate the name of the file, without its directory
60117455 func_basename "$output"
6012- outputname="$func_basename_result"
6013- libobjs_save="$libobjs"
7456+ outputname=$func_basename_result
7457+ libobjs_save=$libobjs
60147458
60157459 if test -n "$shlibpath_var"; then
60167460 # get the directories listed in $shlibpath_var
6017- eval shlib_search_path=\`\$ECHO \"\${$shlibpath_var}\" \| \$SED \'s/:/ /g\'\`
7461+ eval shlib_search_path=\`\$ECHO \"\$$shlibpath_var\" \| \$SED \'s/:/ /g\'\`
60187462 else
60197463 shlib_search_path=
60207464 fi
60217465 eval sys_lib_search_path=\"$sys_lib_search_path_spec\"
60227466 eval sys_lib_dlsearch_path=\"$sys_lib_dlsearch_path_spec\"
60237467
7468+ # Definition is injected by LT_CONFIG during libtool generation.
7469+ func_munge_path_list sys_lib_dlsearch_path "$LT_SYS_LIBRARY_PATH"
7470+
60247471 func_dirname "$output" "/" ""
6025- output_objdir="$func_dirname_result$objdir"
7472+ output_objdir=$func_dirname_result$objdir
60267473 func_to_tool_file "$output_objdir/"
60277474 tool_output_objdir=$func_to_tool_file_result
60287475 # Create the object directory.
@@ -6045,7 +7492,7 @@ func_mode_link ()
60457492 # Find all interdependent deplibs by searching for libraries
60467493 # that are linked more than once (e.g. -la -lb -la)
60477494 for deplib in $deplibs; do
6048- if $opt_preserve_dup_deps ; then
7495+ if $opt_preserve_dup_deps; then
60497496 case "$libs " in
60507497 *" $deplib "*) func_append specialdeplibs " $deplib" ;;
60517498 esac
@@ -6053,7 +7500,7 @@ func_mode_link ()
60537500 func_append libs " $deplib"
60547501 done
60557502
6056- if test "$linkmode" = lib; then
7503+ if test lib = "$linkmode"; then
60577504 libs="$predeps $libs $compiler_lib_search_path $postdeps"
60587505
60597506 # Compute libraries that are listed more than once in $predeps
@@ -6085,7 +7532,7 @@ func_mode_link ()
60857532 case $file in
60867533 *.la) ;;
60877534 *)
6088- func_fatal_help "libraries can \`-dlopen' only libtool libraries: $file"
7535+ func_fatal_help "libraries can '-dlopen' only libtool libraries: $file"
60897536 ;;
60907537 esac
60917538 done
@@ -6093,7 +7540,7 @@ func_mode_link ()
60937540 prog)
60947541 compile_deplibs=
60957542 finalize_deplibs=
6096- alldeplibs=no
7543+ alldeplibs=false
60977544 newdlfiles=
60987545 newdlprefiles=
60997546 passes="conv scan dlopen dlpreopen link"
@@ -6105,32 +7552,32 @@ func_mode_link ()
61057552 for pass in $passes; do
61067553 # The preopen pass in lib mode reverses $deplibs; put it back here
61077554 # so that -L comes before libs that need it for instance...
6108- if test "$linkmode,$pass" = "lib,link"; then
7555+ if test lib,link = "$linkmode,$pass"; then
61097556 ## FIXME: Find the place where the list is rebuilt in the wrong
61107557 ## order, and fix it there properly
61117558 tmp_deplibs=
61127559 for deplib in $deplibs; do
61137560 tmp_deplibs="$deplib $tmp_deplibs"
61147561 done
6115- deplibs="$tmp_deplibs"
7562+ deplibs=$tmp_deplibs
61167563 fi
61177564
6118- if test "$linkmode,$pass" = "lib,link" ||
6119- test "$linkmode,$pass" = "prog,scan"; then
6120- libs="$deplibs"
7565+ if test lib,link = "$linkmode,$pass" ||
7566+ test prog,scan = "$linkmode,$pass"; then
7567+ libs=$deplibs
61217568 deplibs=
61227569 fi
6123- if test "$linkmode" = prog; then
7570+ if test prog = "$linkmode"; then
61247571 case $pass in
6125- dlopen) libs="$dlfiles" ;;
6126- dlpreopen) libs="$dlprefiles" ;;
7572+ dlopen) libs=$dlfiles ;;
7573+ dlpreopen) libs=$dlprefiles ;;
61277574 link)
61287575 libs="$deplibs %DEPLIBS%"
61297576 test "X$link_all_deplibs" != Xno && libs="$libs $dependency_libs"
61307577 ;;
61317578 esac
61327579 fi
6133- if test "$linkmode,$pass" = "lib,dlpreopen"; then
7580+ if test lib,dlpreopen = "$linkmode,$pass"; then
61347581 # Collect and forward deplibs of preopened libtool libs
61357582 for lib in $dlprefiles; do
61367583 # Ignore non-libtool-libs
@@ -6151,26 +7598,26 @@ func_mode_link ()
61517598 esac
61527599 done
61537600 done
6154- libs="$dlprefiles"
7601+ libs=$dlprefiles
61557602 fi
6156- if test "$pass" = dlopen; then
7603+ if test dlopen = "$pass"; then
61577604 # Collect dlpreopened libraries
6158- save_deplibs="$deplibs"
7605+ save_deplibs=$deplibs
61597606 deplibs=
61607607 fi
61617608
61627609 for deplib in $libs; do
61637610 lib=
6164- found=no
7611+ found=false
61657612 case $deplib in
61667613 -mt|-mthreads|-kthread|-Kthread|-pthread|-pthreads|--thread-safe \
61677614 |-threads|-fopenmp|-openmp|-mp|-xopenmp|-omp|-qsmp=*)
6168- if test "$linkmode,$pass" = "prog,link"; then
7615+ if test prog,link = "$linkmode,$pass"; then
61697616 compile_deplibs="$deplib $compile_deplibs"
61707617 finalize_deplibs="$deplib $finalize_deplibs"
61717618 else
61727619 func_append compiler_flags " $deplib"
6173- if test "$linkmode" = lib ; then
7620+ if test lib = "$linkmode"; then
61747621 case "$new_inherited_linker_flags " in
61757622 *" $deplib "*) ;;
61767623 * ) func_append new_inherited_linker_flags " $deplib" ;;
@@ -6180,13 +7627,13 @@ func_mode_link ()
61807627 continue
61817628 ;;
61827629 -l*)
6183- if test "$linkmode" != lib && test "$linkmode" != prog; then
6184- func_warning "\`-l' is ignored for archives/objects"
7630+ if test lib != "$linkmode" && test prog != "$linkmode"; then
7631+ func_warning "'-l' is ignored for archives/objects"
61857632 continue
61867633 fi
61877634 func_stripname '-l' '' "$deplib"
61887635 name=$func_stripname_result
6189- if test "$linkmode" = lib; then
7636+ if test lib = "$linkmode"; then
61907637 searchdirs="$newlib_search_path $lib_search_path $compiler_lib_search_dirs $sys_lib_search_path $shlib_search_path"
61917638 else
61927639 searchdirs="$newlib_search_path $lib_search_path $sys_lib_search_path $shlib_search_path"
@@ -6194,31 +7641,22 @@ func_mode_link ()
61947641 for searchdir in $searchdirs; do
61957642 for search_ext in .la $std_shrext .so .a; do
61967643 # Search the libtool library
6197- lib="$searchdir/lib${name}${search_ext}"
7644+ lib=$searchdir/lib$name$search_ext
61987645 if test -f "$lib"; then
6199- if test "$search_ext" = ".la"; then
6200- found=yes
7646+ if test .la = "$search_ext"; then
7647+ found=:
62017648 else
6202- found=no
7649+ found=false
62037650 fi
62047651 break 2
62057652 fi
62067653 done
62077654 done
6208- if test "$found" != yes; then
6209- # deplib doesn't seem to be a libtool library
6210- if test "$linkmode,$pass" = "prog,link"; then
6211- compile_deplibs="$deplib $compile_deplibs"
6212- finalize_deplibs="$deplib $finalize_deplibs"
6213- else
6214- deplibs="$deplib $deplibs"
6215- test "$linkmode" = lib && newdependency_libs="$deplib $newdependency_libs"
6216- fi
6217- continue
6218- else # deplib is a libtool library
7655+ if $found; then
7656+ # deplib is a libtool library
62197657 # If $allow_libtool_libs_with_static_runtimes && $deplib is a stdlib,
62207658 # We need to do some special things here, and not later.
6221- if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
7659+ if test yes = "$allow_libtool_libs_with_static_runtimes"; then
62227660 case " $predeps $postdeps " in
62237661 *" $deplib "*)
62247662 if func_lalib_p "$lib"; then
@@ -6226,19 +7664,19 @@ func_mode_link ()
62267664 old_library=
62277665 func_source "$lib"
62287666 for l in $old_library $library_names; do
6229- ll="$l"
7667+ ll=$l
62307668 done
6231- if test "X$ll" = "X$old_library" ; then # only static version available
6232- found=no
7669+ if test "X$ll" = "X$old_library"; then # only static version available
7670+ found=false
62337671 func_dirname "$lib" "" "."
6234- ladir="$func_dirname_result"
7672+ ladir=$func_dirname_result
62357673 lib=$ladir/$old_library
6236- if test "$linkmode,$pass" = "prog,link"; then
7674+ if test prog,link = "$linkmode,$pass"; then
62377675 compile_deplibs="$deplib $compile_deplibs"
62387676 finalize_deplibs="$deplib $finalize_deplibs"
62397677 else
62407678 deplibs="$deplib $deplibs"
6241- test "$linkmode" = lib && newdependency_libs="$deplib $newdependency_libs"
7679+ test lib = "$linkmode" && newdependency_libs="$deplib $newdependency_libs"
62427680 fi
62437681 continue
62447682 fi
@@ -6247,15 +7685,25 @@ func_mode_link ()
62477685 *) ;;
62487686 esac
62497687 fi
7688+ else
7689+ # deplib doesn't seem to be a libtool library
7690+ if test prog,link = "$linkmode,$pass"; then
7691+ compile_deplibs="$deplib $compile_deplibs"
7692+ finalize_deplibs="$deplib $finalize_deplibs"
7693+ else
7694+ deplibs="$deplib $deplibs"
7695+ test lib = "$linkmode" && newdependency_libs="$deplib $newdependency_libs"
7696+ fi
7697+ continue
62507698 fi
62517699 ;; # -l
62527700 *.ltframework)
6253- if test "$linkmode,$pass" = "prog,link"; then
7701+ if test prog,link = "$linkmode,$pass"; then
62547702 compile_deplibs="$deplib $compile_deplibs"
62557703 finalize_deplibs="$deplib $finalize_deplibs"
62567704 else
62577705 deplibs="$deplib $deplibs"
6258- if test "$linkmode" = lib ; then
7706+ if test lib = "$linkmode"; then
62597707 case "$new_inherited_linker_flags " in
62607708 *" $deplib "*) ;;
62617709 * ) func_append new_inherited_linker_flags " $deplib" ;;
@@ -6268,18 +7716,18 @@ func_mode_link ()
62687716 case $linkmode in
62697717 lib)
62707718 deplibs="$deplib $deplibs"
6271- test "$pass" = conv && continue
7719+ test conv = "$pass" && continue
62727720 newdependency_libs="$deplib $newdependency_libs"
62737721 func_stripname '-L' '' "$deplib"
62747722 func_resolve_sysroot "$func_stripname_result"
62757723 func_append newlib_search_path " $func_resolve_sysroot_result"
62767724 ;;
62777725 prog)
6278- if test "$pass" = conv; then
7726+ if test conv = "$pass"; then
62797727 deplibs="$deplib $deplibs"
62807728 continue
62817729 fi
6282- if test "$pass" = scan; then
7730+ if test scan = "$pass"; then
62837731 deplibs="$deplib $deplibs"
62847732 else
62857733 compile_deplibs="$deplib $compile_deplibs"
@@ -6290,13 +7738,13 @@ func_mode_link ()
62907738 func_append newlib_search_path " $func_resolve_sysroot_result"
62917739 ;;
62927740 *)
6293- func_warning "\`-L' is ignored for archives/objects"
7741+ func_warning "'-L' is ignored for archives/objects"
62947742 ;;
62957743 esac # linkmode
62967744 continue
62977745 ;; # -L
62987746 -R*)
6299- if test "$pass" = link; then
7747+ if test link = "$pass"; then
63007748 func_stripname '-R' '' "$deplib"
63017749 func_resolve_sysroot "$func_stripname_result"
63027750 dir=$func_resolve_sysroot_result
@@ -6314,7 +7762,7 @@ func_mode_link ()
63147762 lib=$func_resolve_sysroot_result
63157763 ;;
63167764 *.$libext)
6317- if test "$pass" = conv; then
7765+ if test conv = "$pass"; then
63187766 deplibs="$deplib $deplibs"
63197767 continue
63207768 fi
@@ -6325,21 +7773,26 @@ func_mode_link ()
63257773 case " $dlpreconveniencelibs " in
63267774 *" $deplib "*) ;;
63277775 *)
6328- valid_a_lib=no
7776+ valid_a_lib=false
63297777 case $deplibs_check_method in
63307778 match_pattern*)
63317779 set dummy $deplibs_check_method; shift
63327780 match_pattern_regex=`expr "$deplibs_check_method" : "$1 \(.*\)"`
63337781 if eval "\$ECHO \"$deplib\"" 2>/dev/null | $SED 10q \
63347782 | $EGREP "$match_pattern_regex" > /dev/null; then
6335- valid_a_lib=yes
7783+ valid_a_lib=:
63367784 fi
63377785 ;;
63387786 pass_all)
6339- valid_a_lib=yes
7787+ valid_a_lib=:
63407788 ;;
63417789 esac
6342- if test "$valid_a_lib" != yes; then
7790+ if $valid_a_lib; then
7791+ echo
7792+ $ECHO "*** Warning: Linking the shared library $output against the"
7793+ $ECHO "*** static library $deplib is not portable!"
7794+ deplibs="$deplib $deplibs"
7795+ else
63437796 echo
63447797 $ECHO "*** Warning: Trying to link with static lib archive $deplib."
63457798 echo "*** I have the capability to make that library automatically link in when"
@@ -6347,18 +7800,13 @@ func_mode_link ()
63477800 echo "*** shared version of the library, which you do not appear to have"
63487801 echo "*** because the file extensions .$libext of this argument makes me believe"
63497802 echo "*** that it is just a static archive that I should not use here."
6350- else
6351- echo
6352- $ECHO "*** Warning: Linking the shared library $output against the"
6353- $ECHO "*** static library $deplib is not portable!"
6354- deplibs="$deplib $deplibs"
63557803 fi
63567804 ;;
63577805 esac
63587806 continue
63597807 ;;
63607808 prog)
6361- if test "$pass" != link; then
7809+ if test link != "$pass"; then
63627810 deplibs="$deplib $deplibs"
63637811 else
63647812 compile_deplibs="$deplib $compile_deplibs"
@@ -6369,10 +7817,10 @@ func_mode_link ()
63697817 esac # linkmode
63707818 ;; # *.$libext
63717819 *.lo | *.$objext)
6372- if test "$pass" = conv; then
7820+ if test conv = "$pass"; then
63737821 deplibs="$deplib $deplibs"
6374- elif test "$linkmode" = prog; then
6375- if test "$pass" = dlpreopen || test "$dlopen_support" != yes || test "$build_libtool_libs" = no; then
7822+ elif test prog = "$linkmode"; then
7823+ if test dlpreopen = "$pass" || test yes != "$dlopen_support" || test no = "$build_libtool_libs"; then
63767824 # If there is no dlopen support or we're linking statically,
63777825 # we need to preload.
63787826 func_append newdlprefiles " $deplib"
@@ -6385,22 +7833,20 @@ func_mode_link ()
63857833 continue
63867834 ;;
63877835 %DEPLIBS%)
6388- alldeplibs=yes
7836+ alldeplibs=:
63897837 continue
63907838 ;;
63917839 esac # case $deplib
63927840
6393- if test "$found" = yes || test -f "$lib"; then :
6394- else
6395- func_fatal_error "cannot find the library \`$lib' or unhandled argument \`$deplib'"
6396- fi
7841+ $found || test -f "$lib" \
7842+ || func_fatal_error "cannot find the library '$lib' or unhandled argument '$deplib'"
63977843
63987844 # Check to see that this really is a libtool archive.
63997845 func_lalib_unsafe_p "$lib" \
6400- || func_fatal_error "\`$lib' is not a valid libtool archive"
7846+ || func_fatal_error "'$lib' is not a valid libtool archive"
64017847
64027848 func_dirname "$lib" "" "."
6403- ladir="$func_dirname_result"
7849+ ladir=$func_dirname_result
64047850
64057851 dlname=
64067852 dlopen=
@@ -6430,19 +7876,19 @@ func_mode_link ()
64307876 done
64317877 fi
64327878 dependency_libs=`$ECHO " $dependency_libs" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'`
6433- if test "$linkmode,$pass" = "lib,link" ||
6434- test "$linkmode,$pass" = "prog,scan" ||
6435- { test "$linkmode" != prog && test "$linkmode" != lib; }; then
7879+ if test lib,link = "$linkmode,$pass" ||
7880+ test prog,scan = "$linkmode,$pass" ||
7881+ { test prog != "$linkmode" && test lib != "$linkmode"; }; then
64367882 test -n "$dlopen" && func_append dlfiles " $dlopen"
64377883 test -n "$dlpreopen" && func_append dlprefiles " $dlpreopen"
64387884 fi
64397885
6440- if test "$pass" = conv; then
7886+ if test conv = "$pass"; then
64417887 # Only check for convenience libraries
64427888 deplibs="$lib $deplibs"
64437889 if test -z "$libdir"; then
64447890 if test -z "$old_library"; then
6445- func_fatal_error "cannot find name of link library for \`$lib'"
7891+ func_fatal_error "cannot find name of link library for '$lib'"
64467892 fi
64477893 # It is a libtool convenience library, so add in its objects.
64487894 func_append convenience " $ladir/$objdir/$old_library"
@@ -6450,15 +7896,15 @@ func_mode_link ()
64507896 tmp_libs=
64517897 for deplib in $dependency_libs; do
64527898 deplibs="$deplib $deplibs"
6453- if $opt_preserve_dup_deps ; then
7899+ if $opt_preserve_dup_deps; then
64547900 case "$tmp_libs " in
64557901 *" $deplib "*) func_append specialdeplibs " $deplib" ;;
64567902 esac
64577903 fi
64587904 func_append tmp_libs " $deplib"
64597905 done
6460- elif test "$linkmode" != prog && test "$linkmode" != lib; then
6461- func_fatal_error "\`$lib' is not a convenience library"
7906+ elif test prog != "$linkmode" && test lib != "$linkmode"; then
7907+ func_fatal_error "'$lib' is not a convenience library"
64627908 fi
64637909 continue
64647910 fi # $pass = conv
@@ -6467,26 +7913,26 @@ func_mode_link ()
64677913 # Get the name of the library we link against.
64687914 linklib=
64697915 if test -n "$old_library" &&
6470- { test "$prefer_static_libs" = yes ||
6471- test "$prefer_static_libs,$installed" = "built,no"; }; then
7916+ { test yes = "$prefer_static_libs" ||
7917+ test built,no = "$prefer_static_libs,$installed"; }; then
64727918 linklib=$old_library
64737919 else
64747920 for l in $old_library $library_names; do
6475- linklib="$l"
7921+ linklib=$l
64767922 done
64777923 fi
64787924 if test -z "$linklib"; then
6479- func_fatal_error "cannot find name of link library for \`$lib'"
7925+ func_fatal_error "cannot find name of link library for '$lib'"
64807926 fi
64817927
64827928 # This library was specified with -dlopen.
6483- if test "$pass" = dlopen; then
6484- if test -z "$libdir"; then
6485- func_fatal_error "cannot -dlopen a convenience library: \`$lib'"
6486- fi
7929+ if test dlopen = "$pass"; then
7930+ test -z "$libdir" \
7931+ && func_fatal_error "cannot -dlopen a convenience library: '$lib'"
64877932 if test -z "$dlname" ||
6488- test "$dlopen_support" != yes ||
6489- test "$build_libtool_libs" = no; then
7933+ test yes != "$dlopen_support" ||
7934+ test no = "$build_libtool_libs"
7935+ then
64907936 # If there is no dlname, no dlopen support or we're linking
64917937 # statically, we need to preload. We also need to preload any
64927938 # dependent libraries so libltdl's deplib preloader doesn't
@@ -6500,40 +7946,40 @@ func_mode_link ()
65007946
65017947 # We need an absolute path.
65027948 case $ladir in
6503- [\\/]* | [A-Za-z]:[\\/]*) abs_ladir="$ladir" ;;
7949+ [\\/]* | [A-Za-z]:[\\/]*) abs_ladir=$ladir ;;
65047950 *)
65057951 abs_ladir=`cd "$ladir" && pwd`
65067952 if test -z "$abs_ladir"; then
6507- func_warning "cannot determine absolute directory name of \`$ladir'"
7953+ func_warning "cannot determine absolute directory name of '$ladir'"
65087954 func_warning "passing it literally to the linker, although it might fail"
6509- abs_ladir="$ladir"
7955+ abs_ladir=$ladir
65107956 fi
65117957 ;;
65127958 esac
65137959 func_basename "$lib"
6514- laname="$func_basename_result"
7960+ laname=$func_basename_result
65157961
65167962 # Find the relevant object directory and library name.
6517- if test "X$installed" = Xyes; then
7963+ if test yes = "$installed"; then
65187964 if test ! -f "$lt_sysroot$libdir/$linklib" && test -f "$abs_ladir/$linklib"; then
6519- func_warning "library \`$lib' was moved."
6520- dir="$ladir"
6521- absdir="$abs_ladir"
6522- libdir="$abs_ladir"
7965+ func_warning "library '$lib' was moved."
7966+ dir=$ladir
7967+ absdir=$abs_ladir
7968+ libdir=$abs_ladir
65237969 else
6524- dir="$lt_sysroot$libdir"
6525- absdir="$lt_sysroot$libdir"
7970+ dir=$lt_sysroot$libdir
7971+ absdir=$lt_sysroot$libdir
65267972 fi
6527- test "X$hardcode_automatic" = Xyes && avoidtemprpath=yes
7973+ test yes = "$hardcode_automatic" && avoidtemprpath=yes
65287974 else
65297975 if test ! -f "$ladir/$objdir/$linklib" && test -f "$abs_ladir/$linklib"; then
6530- dir="$ladir"
6531- absdir="$abs_ladir"
7976+ dir=$ladir
7977+ absdir=$abs_ladir
65327978 # Remove this search path later
65337979 func_append notinst_path " $abs_ladir"
65347980 else
6535- dir="$ladir/$objdir"
6536- absdir="$abs_ladir/$objdir"
7981+ dir=$ladir/$objdir
7982+ absdir=$abs_ladir/$objdir
65377983 # Remove this search path later
65387984 func_append notinst_path " $abs_ladir"
65397985 fi
@@ -6542,11 +7988,11 @@ func_mode_link ()
65427988 name=$func_stripname_result
65437989
65447990 # This library was specified with -dlpreopen.
6545- if test "$pass" = dlpreopen; then
6546- if test -z "$libdir" && test "$linkmode" = prog; then
6547- func_fatal_error "only libraries may -dlpreopen a convenience library: \`$lib'"
7991+ if test dlpreopen = "$pass"; then
7992+ if test -z "$libdir" && test prog = "$linkmode"; then
7993+ func_fatal_error "only libraries may -dlpreopen a convenience library: '$lib'"
65487994 fi
6549- case "$host" in
7995+ case $host in
65507996 # special handling for platforms with PE-DLLs.
65517997 *cygwin* | *mingw* | *cegcc* )
65527998 # Linker will automatically link against shared library if both
@@ -6590,9 +8036,9 @@ func_mode_link ()
65908036
65918037 if test -z "$libdir"; then
65928038 # Link the convenience library
6593- if test "$linkmode" = lib; then
8039+ if test lib = "$linkmode"; then
65948040 deplibs="$dir/$old_library $deplibs"
6595- elif test "$linkmode,$pass" = "prog,link"; then
8041+ elif test prog,link = "$linkmode,$pass"; then
65968042 compile_deplibs="$dir/$old_library $compile_deplibs"
65978043 finalize_deplibs="$dir/$old_library $finalize_deplibs"
65988044 else
@@ -6602,14 +8048,14 @@ func_mode_link ()
66028048 fi
66038049
66048050
6605- if test "$linkmode" = prog && test "$pass" != link; then
8051+ if test prog = "$linkmode" && test link != "$pass"; then
66068052 func_append newlib_search_path " $ladir"
66078053 deplibs="$lib $deplibs"
66088054
6609- linkalldeplibs=no
6610- if test "$link_all_deplibs" != no || test -z "$library_names" ||
6611- test "$build_libtool_libs" = no; then
6612- linkalldeplibs=yes
8055+ linkalldeplibs=false
8056+ if test no != "$link_all_deplibs" || test -z "$library_names" ||
8057+ test no = "$build_libtool_libs"; then
8058+ linkalldeplibs=:
66138059 fi
66148060
66158061 tmp_libs=
@@ -6621,14 +8067,14 @@ func_mode_link ()
66218067 ;;
66228068 esac
66238069 # Need to link against all dependency_libs?
6624- if test "$linkalldeplibs" = yes; then
8070+ if $linkalldeplibs; then
66258071 deplibs="$deplib $deplibs"
66268072 else
66278073 # Need to hardcode shared library paths
66288074 # or/and link against static libraries
66298075 newdependency_libs="$deplib $newdependency_libs"
66308076 fi
6631- if $opt_preserve_dup_deps ; then
8077+ if $opt_preserve_dup_deps; then
66328078 case "$tmp_libs " in
66338079 *" $deplib "*) func_append specialdeplibs " $deplib" ;;
66348080 esac
@@ -6638,15 +8084,15 @@ func_mode_link ()
66388084 continue
66398085 fi # $linkmode = prog...
66408086
6641- if test "$linkmode,$pass" = "prog,link"; then
8087+ if test prog,link = "$linkmode,$pass"; then
66428088 if test -n "$library_names" &&
6643- { { test "$prefer_static_libs" = no ||
6644- test "$prefer_static_libs,$installed" = "built,yes"; } ||
8089+ { { test no = "$prefer_static_libs" ||
8090+ test built,yes = "$prefer_static_libs,$installed"; } ||
66458091 test -z "$old_library"; }; then
66468092 # We need to hardcode the library path
6647- if test -n "$shlibpath_var" && test -z "$avoidtemprpath" ; then
8093+ if test -n "$shlibpath_var" && test -z "$avoidtemprpath"; then
66488094 # Make sure the rpath contains only unique directories.
6649- case "$temp_rpath:" in
8095+ case $temp_rpath: in
66508096 *"$absdir:"*) ;;
66518097 *) func_append temp_rpath "$absdir:" ;;
66528098 esac
@@ -6675,9 +8121,9 @@ func_mode_link ()
66758121 esac
66768122 fi # $linkmode,$pass = prog,link...
66778123
6678- if test "$alldeplibs" = yes &&
6679- { test "$deplibs_check_method" = pass_all ||
6680- { test "$build_libtool_libs" = yes &&
8124+ if $alldeplibs &&
8125+ { test pass_all = "$deplibs_check_method" ||
8126+ { test yes = "$build_libtool_libs" &&
66818127 test -n "$library_names"; }; }; then
66828128 # We only need to search for static libraries
66838129 continue
@@ -6686,19 +8132,19 @@ func_mode_link ()
66868132
66878133 link_static=no # Whether the deplib will be linked statically
66888134 use_static_libs=$prefer_static_libs
6689- if test "$use_static_libs" = built && test "$installed" = yes; then
8135+ if test built = "$use_static_libs" && test yes = "$installed"; then
66908136 use_static_libs=no
66918137 fi
66928138 if test -n "$library_names" &&
6693- { test "$use_static_libs" = no || test -z "$old_library"; }; then
8139+ { test no = "$use_static_libs" || test -z "$old_library"; }; then
66948140 case $host in
6695- *cygwin* | *mingw* | *cegcc*)
8141+ *cygwin* | *mingw* | *cegcc* | *os2*)
66968142 # No point in relinking DLLs because paths are not encoded
66978143 func_append notinst_deplibs " $lib"
66988144 need_relink=no
66998145 ;;
67008146 *)
6701- if test "$installed" = no; then
8147+ if test no = "$installed"; then
67028148 func_append notinst_deplibs " $lib"
67038149 need_relink=yes
67048150 fi
@@ -6708,24 +8154,24 @@ func_mode_link ()
67088154
67098155 # Warn about portability, can't link against -module's on some
67108156 # systems (darwin). Don't bleat about dlopened modules though!
6711- dlopenmodule=""
8157+ dlopenmodule=
67128158 for dlpremoduletest in $dlprefiles; do
67138159 if test "X$dlpremoduletest" = "X$lib"; then
6714- dlopenmodule="$dlpremoduletest"
8160+ dlopenmodule=$dlpremoduletest
67158161 break
67168162 fi
67178163 done
6718- if test -z "$dlopenmodule" && test "$shouldnotlink" = yes && test "$pass" = link; then
8164+ if test -z "$dlopenmodule" && test yes = "$shouldnotlink" && test link = "$pass"; then
67198165 echo
6720- if test "$linkmode" = prog; then
8166+ if test prog = "$linkmode"; then
67218167 $ECHO "*** Warning: Linking the executable $output against the loadable module"
67228168 else
67238169 $ECHO "*** Warning: Linking the shared library $output against the loadable module"
67248170 fi
67258171 $ECHO "*** $linklib is not portable!"
67268172 fi
6727- if test "$linkmode" = lib &&
6728- test "$hardcode_into_libs" = yes; then
8173+ if test lib = "$linkmode" &&
8174+ test yes = "$hardcode_into_libs"; then
67298175 # Hardcode the library path.
67308176 # Skip directories that are in the system default run-time
67318177 # search path.
@@ -6753,43 +8199,43 @@ func_mode_link ()
67538199 # figure out the soname
67548200 set dummy $library_names
67558201 shift
6756- realname="$1"
8202+ realname=$1
67578203 shift
67588204 libname=`eval "\\$ECHO \"$libname_spec\""`
67598205 # use dlname if we got it. it's perfectly good, no?
67608206 if test -n "$dlname"; then
6761- soname="$dlname"
8207+ soname=$dlname
67628208 elif test -n "$soname_spec"; then
67638209 # bleh windows
67648210 case $host in
6765- *cygwin* | mingw* | *cegcc*)
8211+ *cygwin* | mingw* | *cegcc* | *os2*)
67668212 func_arith $current - $age
67678213 major=$func_arith_result
6768- versuffix="-$major"
8214+ versuffix=-$major
67698215 ;;
67708216 esac
67718217 eval soname=\"$soname_spec\"
67728218 else
6773- soname="$realname"
8219+ soname=$realname
67748220 fi
67758221
67768222 # Make a new name for the extract_expsyms_cmds to use
6777- soroot="$soname"
8223+ soroot=$soname
67788224 func_basename "$soroot"
6779- soname="$func_basename_result"
8225+ soname=$func_basename_result
67808226 func_stripname 'lib' '.dll' "$soname"
67818227 newlib=libimp-$func_stripname_result.a
67828228
67838229 # If the library has no export list, then create one now
67848230 if test -f "$output_objdir/$soname-def"; then :
67858231 else
6786- func_verbose "extracting exported symbol list from \`$soname'"
8232+ func_verbose "extracting exported symbol list from '$soname'"
67878233 func_execute_cmds "$extract_expsyms_cmds" 'exit $?'
67888234 fi
67898235
67908236 # Create $newlib
67918237 if test -f "$output_objdir/$newlib"; then :; else
6792- func_verbose "generating import library for \`$soname'"
8238+ func_verbose "generating import library for '$soname'"
67938239 func_execute_cmds "$old_archive_from_expsyms_cmds" 'exit $?'
67948240 fi
67958241 # make sure the library variables are pointing to the new library
@@ -6797,58 +8243,58 @@ func_mode_link ()
67978243 linklib=$newlib
67988244 fi # test -n "$old_archive_from_expsyms_cmds"
67998245
6800- if test "$linkmode" = prog || test "$opt_mode" != relink; then
8246+ if test prog = "$linkmode" || test relink != "$opt_mode"; then
68018247 add_shlibpath=
68028248 add_dir=
68038249 add=
68048250 lib_linked=yes
68058251 case $hardcode_action in
68068252 immediate | unsupported)
6807- if test "$hardcode_direct" = no; then
6808- add="$dir/$linklib"
8253+ if test no = "$hardcode_direct"; then
8254+ add=$dir/$linklib
68098255 case $host in
6810- *-*-sco3.2v5.0.[024]*) add_dir="-L$dir" ;;
6811- *-*-sysv4*uw2*) add_dir="-L$dir" ;;
8256+ *-*-sco3.2v5.0.[024]*) add_dir=-L$dir ;;
8257+ *-*-sysv4*uw2*) add_dir=-L$dir ;;
68128258 *-*-sysv5OpenUNIX* | *-*-sysv5UnixWare7.[01].[10]* | \
6813- *-*-unixware7*) add_dir="-L$dir" ;;
8259+ *-*-unixware7*) add_dir=-L$dir ;;
68148260 *-*-darwin* )
6815- # if the lib is a (non-dlopened) module then we can not
8261+ # if the lib is a (non-dlopened) module then we cannot
68168262 # link against it, someone is ignoring the earlier warnings
68178263 if /usr/bin/file -L $add 2> /dev/null |
6818- $GREP ": [^:]* bundle" >/dev/null ; then
8264+ $GREP ": [^:]* bundle" >/dev/null; then
68198265 if test "X$dlopenmodule" != "X$lib"; then
68208266 $ECHO "*** Warning: lib $linklib is a module, not a shared library"
6821- if test -z "$old_library" ; then
8267+ if test -z "$old_library"; then
68228268 echo
68238269 echo "*** And there doesn't seem to be a static archive available"
68248270 echo "*** The link will probably fail, sorry"
68258271 else
6826- add="$dir/$old_library"
8272+ add=$dir/$old_library
68278273 fi
68288274 elif test -n "$old_library"; then
6829- add="$dir/$old_library"
8275+ add=$dir/$old_library
68308276 fi
68318277 fi
68328278 esac
6833- elif test "$hardcode_minus_L" = no; then
8279+ elif test no = "$hardcode_minus_L"; then
68348280 case $host in
6835- *-*-sunos*) add_shlibpath="$dir" ;;
8281+ *-*-sunos*) add_shlibpath=$dir ;;
68368282 esac
6837- add_dir="-L$dir"
6838- add="-l$name"
6839- elif test "$hardcode_shlibpath_var" = no; then
6840- add_shlibpath="$dir"
6841- add="-l$name"
8283+ add_dir=-L$dir
8284+ add=-l$name
8285+ elif test no = "$hardcode_shlibpath_var"; then
8286+ add_shlibpath=$dir
8287+ add=-l$name
68428288 else
68438289 lib_linked=no
68448290 fi
68458291 ;;
68468292 relink)
6847- if test "$hardcode_direct" = yes &&
6848- test "$hardcode_direct_absolute" = no; then
6849- add="$dir/$linklib"
6850- elif test "$hardcode_minus_L" = yes; then
6851- add_dir="-L$absdir"
8293+ if test yes = "$hardcode_direct" &&
8294+ test no = "$hardcode_direct_absolute"; then
8295+ add=$dir/$linklib
8296+ elif test yes = "$hardcode_minus_L"; then
8297+ add_dir=-L$absdir
68528298 # Try looking first in the location we're being installed to.
68538299 if test -n "$inst_prefix_dir"; then
68548300 case $libdir in
@@ -6857,10 +8303,10 @@ func_mode_link ()
68578303 ;;
68588304 esac
68598305 fi
6860- add="-l$name"
6861- elif test "$hardcode_shlibpath_var" = yes; then
6862- add_shlibpath="$dir"
6863- add="-l$name"
8306+ add=-l$name
8307+ elif test yes = "$hardcode_shlibpath_var"; then
8308+ add_shlibpath=$dir
8309+ add=-l$name
68648310 else
68658311 lib_linked=no
68668312 fi
@@ -6868,7 +8314,7 @@ func_mode_link ()
68688314 *) lib_linked=no ;;
68698315 esac
68708316
6871- if test "$lib_linked" != yes; then
8317+ if test yes != "$lib_linked"; then
68728318 func_fatal_configuration "unsupported hardcode properties"
68738319 fi
68748320
@@ -6878,15 +8324,15 @@ func_mode_link ()
68788324 *) func_append compile_shlibpath "$add_shlibpath:" ;;
68798325 esac
68808326 fi
6881- if test "$linkmode" = prog; then
8327+ if test prog = "$linkmode"; then
68828328 test -n "$add_dir" && compile_deplibs="$add_dir $compile_deplibs"
68838329 test -n "$add" && compile_deplibs="$add $compile_deplibs"
68848330 else
68858331 test -n "$add_dir" && deplibs="$add_dir $deplibs"
68868332 test -n "$add" && deplibs="$add $deplibs"
6887- if test "$hardcode_direct" != yes &&
6888- test "$hardcode_minus_L" != yes &&
6889- test "$hardcode_shlibpath_var" = yes; then
8333+ if test yes != "$hardcode_direct" &&
8334+ test yes != "$hardcode_minus_L" &&
8335+ test yes = "$hardcode_shlibpath_var"; then
68908336 case :$finalize_shlibpath: in
68918337 *":$libdir:"*) ;;
68928338 *) func_append finalize_shlibpath "$libdir:" ;;
@@ -6895,33 +8341,33 @@ func_mode_link ()
68958341 fi
68968342 fi
68978343
6898- if test "$linkmode" = prog || test "$opt_mode" = relink; then
8344+ if test prog = "$linkmode" || test relink = "$opt_mode"; then
68998345 add_shlibpath=
69008346 add_dir=
69018347 add=
69028348 # Finalize command for both is simple: just hardcode it.
6903- if test "$hardcode_direct" = yes &&
6904- test "$hardcode_direct_absolute" = no; then
6905- add="$libdir/$linklib"
6906- elif test "$hardcode_minus_L" = yes; then
6907- add_dir="-L$libdir"
6908- add="-l$name"
6909- elif test "$hardcode_shlibpath_var" = yes; then
8349+ if test yes = "$hardcode_direct" &&
8350+ test no = "$hardcode_direct_absolute"; then
8351+ add=$libdir/$linklib
8352+ elif test yes = "$hardcode_minus_L"; then
8353+ add_dir=-L$libdir
8354+ add=-l$name
8355+ elif test yes = "$hardcode_shlibpath_var"; then
69108356 case :$finalize_shlibpath: in
69118357 *":$libdir:"*) ;;
69128358 *) func_append finalize_shlibpath "$libdir:" ;;
69138359 esac
6914- add="-l$name"
6915- elif test "$hardcode_automatic" = yes; then
8360+ add=-l$name
8361+ elif test yes = "$hardcode_automatic"; then
69168362 if test -n "$inst_prefix_dir" &&
6917- test -f "$inst_prefix_dir$libdir/$linklib" ; then
6918- add="$inst_prefix_dir$libdir/$linklib"
8363+ test -f "$inst_prefix_dir$libdir/$linklib"; then
8364+ add=$inst_prefix_dir$libdir/$linklib
69198365 else
6920- add="$libdir/$linklib"
8366+ add=$libdir/$linklib
69218367 fi
69228368 else
69238369 # We cannot seem to hardcode it, guess we'll fake it.
6924- add_dir="-L$libdir"
8370+ add_dir=-L$libdir
69258371 # Try looking first in the location we're being installed to.
69268372 if test -n "$inst_prefix_dir"; then
69278373 case $libdir in
@@ -6930,10 +8376,10 @@ func_mode_link ()
69308376 ;;
69318377 esac
69328378 fi
6933- add="-l$name"
8379+ add=-l$name
69348380 fi
69358381
6936- if test "$linkmode" = prog; then
8382+ if test prog = "$linkmode"; then
69378383 test -n "$add_dir" && finalize_deplibs="$add_dir $finalize_deplibs"
69388384 test -n "$add" && finalize_deplibs="$add $finalize_deplibs"
69398385 else
@@ -6941,43 +8387,43 @@ func_mode_link ()
69418387 test -n "$add" && deplibs="$add $deplibs"
69428388 fi
69438389 fi
6944- elif test "$linkmode" = prog; then
8390+ elif test prog = "$linkmode"; then
69458391 # Here we assume that one of hardcode_direct or hardcode_minus_L
69468392 # is not unsupported. This is valid on all known static and
69478393 # shared platforms.
6948- if test "$hardcode_direct" != unsupported; then
6949- test -n "$old_library" && linklib="$old_library"
8394+ if test unsupported != "$hardcode_direct"; then
8395+ test -n "$old_library" && linklib=$old_library
69508396 compile_deplibs="$dir/$linklib $compile_deplibs"
69518397 finalize_deplibs="$dir/$linklib $finalize_deplibs"
69528398 else
69538399 compile_deplibs="-l$name -L$dir $compile_deplibs"
69548400 finalize_deplibs="-l$name -L$dir $finalize_deplibs"
69558401 fi
6956- elif test "$build_libtool_libs" = yes; then
8402+ elif test yes = "$build_libtool_libs"; then
69578403 # Not a shared library
6958- if test "$deplibs_check_method" != pass_all; then
8404+ if test pass_all != "$deplibs_check_method"; then
69598405 # We're trying link a shared library against a static one
69608406 # but the system doesn't support it.
69618407
69628408 # Just print a warning and add the library to dependency_libs so
69638409 # that the program can be linked against the static library.
69648410 echo
6965- $ECHO "*** Warning: This system can not link to static lib archive $lib."
8411+ $ECHO "*** Warning: This system cannot link to static lib archive $lib."
69668412 echo "*** I have the capability to make that library automatically link in when"
69678413 echo "*** you link to this library. But I can only do this if you have a"
69688414 echo "*** shared version of the library, which you do not appear to have."
6969- if test "$module" = yes; then
8415+ if test yes = "$module"; then
69708416 echo "*** But as you try to build a module library, libtool will still create "
69718417 echo "*** a static module, that should work as long as the dlopening application"
69728418 echo "*** is linked with the -dlopen flag to resolve symbols at runtime."
69738419 if test -z "$global_symbol_pipe"; then
69748420 echo
69758421 echo "*** However, this would only work if libtool was able to extract symbol"
6976- echo "*** lists from a program, using \`nm' or equivalent, but libtool could"
8422+ echo "*** lists from a program, using 'nm' or equivalent, but libtool could"
69778423 echo "*** not find such a program. So, this module is probably useless."
6978- echo "*** \`nm' from GNU binutils and a full rebuild may help."
8424+ echo "*** 'nm' from GNU binutils and a full rebuild may help."
69798425 fi
6980- if test "$build_old_libs" = no; then
8426+ if test no = "$build_old_libs"; then
69818427 build_libtool_libs=module
69828428 build_old_libs=yes
69838429 else
@@ -6990,11 +8436,11 @@ func_mode_link ()
69908436 fi
69918437 fi # link shared/static library?
69928438
6993- if test "$linkmode" = lib; then
8439+ if test lib = "$linkmode"; then
69948440 if test -n "$dependency_libs" &&
6995- { test "$hardcode_into_libs" != yes ||
6996- test "$build_old_libs" = yes ||
6997- test "$link_static" = yes; }; then
8441+ { test yes != "$hardcode_into_libs" ||
8442+ test yes = "$build_old_libs" ||
8443+ test yes = "$link_static"; }; then
69988444 # Extract -R from dependency_libs
69998445 temp_deplibs=
70008446 for libdir in $dependency_libs; do
@@ -7008,12 +8454,12 @@ func_mode_link ()
70088454 *) func_append temp_deplibs " $libdir";;
70098455 esac
70108456 done
7011- dependency_libs="$temp_deplibs"
8457+ dependency_libs=$temp_deplibs
70128458 fi
70138459
70148460 func_append newlib_search_path " $absdir"
70158461 # Link against this library
7016- test "$link_static" = no && newdependency_libs="$abs_ladir/$laname $newdependency_libs"
8462+ test no = "$link_static" && newdependency_libs="$abs_ladir/$laname $newdependency_libs"
70178463 # ... and its dependency_libs
70188464 tmp_libs=
70198465 for deplib in $dependency_libs; do
@@ -7023,7 +8469,7 @@ func_mode_link ()
70238469 func_resolve_sysroot "$func_stripname_result";;
70248470 *) func_resolve_sysroot "$deplib" ;;
70258471 esac
7026- if $opt_preserve_dup_deps ; then
8472+ if $opt_preserve_dup_deps; then
70278473 case "$tmp_libs " in
70288474 *" $func_resolve_sysroot_result "*)
70298475 func_append specialdeplibs " $func_resolve_sysroot_result" ;;
@@ -7032,12 +8478,12 @@ func_mode_link ()
70328478 func_append tmp_libs " $func_resolve_sysroot_result"
70338479 done
70348480
7035- if test "$link_all_deplibs" != no; then
8481+ if test no != "$link_all_deplibs"; then
70368482 # Add the search paths of all dependency libraries
70378483 for deplib in $dependency_libs; do
70388484 path=
70398485 case $deplib in
7040- -L*) path="$deplib" ;;
8486+ -L*) path=$deplib ;;
70418487 *.la)
70428488 func_resolve_sysroot "$deplib"
70438489 deplib=$func_resolve_sysroot_result
@@ -7045,12 +8491,12 @@ func_mode_link ()
70458491 dir=$func_dirname_result
70468492 # We need an absolute path.
70478493 case $dir in
7048- [\\/]* | [A-Za-z]:[\\/]*) absdir="$dir" ;;
8494+ [\\/]* | [A-Za-z]:[\\/]*) absdir=$dir ;;
70498495 *)
70508496 absdir=`cd "$dir" && pwd`
70518497 if test -z "$absdir"; then
7052- func_warning "cannot determine absolute directory name of \`$dir'"
7053- absdir="$dir"
8498+ func_warning "cannot determine absolute directory name of '$dir'"
8499+ absdir=$dir
70548500 fi
70558501 ;;
70568502 esac
@@ -7058,35 +8504,35 @@ func_mode_link ()
70588504 case $host in
70598505 *-*-darwin*)
70608506 depdepl=
7061- eval deplibrary_names=`${SED} -n -e 's/^library_names=\(.*\)$/\1/p' $deplib`
7062- if test -n "$deplibrary_names" ; then
7063- for tmp in $deplibrary_names ; do
8507+ eval deplibrary_names=`$SED -n -e 's/^library_names=\(.*\)$/\1/p' $deplib`
8508+ if test -n "$deplibrary_names"; then
8509+ for tmp in $deplibrary_names; do
70648510 depdepl=$tmp
70658511 done
7066- if test -f "$absdir/$objdir/$depdepl" ; then
7067- depdepl="$absdir/$objdir/$depdepl"
7068- darwin_install_name=`${OTOOL} -L $depdepl | awk '{if (NR == 2) {print $1;exit}}'`
8512+ if test -f "$absdir/$objdir/$depdepl"; then
8513+ depdepl=$absdir/$objdir/$depdepl
8514+ darwin_install_name=`$OTOOL -L $depdepl | awk '{if (NR == 2) {print $1;exit}}'`
70698515 if test -z "$darwin_install_name"; then
7070- darwin_install_name=`${OTOOL64} -L $depdepl | awk '{if (NR == 2) {print $1;exit}}'`
8516+ darwin_install_name=`$OTOOL64 -L $depdepl | awk '{if (NR == 2) {print $1;exit}}'`
70718517 fi
7072- func_append compiler_flags " ${wl}-dylib_file ${wl}${darwin_install_name}:${depdepl}"
7073- func_append linker_flags " -dylib_file ${darwin_install_name}:${depdepl}"
8518+ func_append compiler_flags " $wl-dylib_file $wl$darwin_install_name:$depdepl"
8519+ func_append linker_flags " -dylib_file $darwin_install_name:$depdepl"
70748520 path=
70758521 fi
70768522 fi
70778523 ;;
70788524 *)
7079- path="-L$absdir/$objdir"
8525+ path=-L$absdir/$objdir
70808526 ;;
70818527 esac
70828528 else
7083- eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $deplib`
8529+ eval libdir=`$SED -n -e 's/^libdir=\(.*\)$/\1/p' $deplib`
70848530 test -z "$libdir" && \
7085- func_fatal_error "\`$deplib' is not a valid libtool archive"
8531+ func_fatal_error "'$deplib' is not a valid libtool archive"
70868532 test "$absdir" != "$libdir" && \
7087- func_warning "\`$deplib' seems to be moved"
8533+ func_warning "'$deplib' seems to be moved"
70888534
7089- path="-L$absdir"
8535+ path=-L$absdir
70908536 fi
70918537 ;;
70928538 esac
@@ -7098,23 +8544,23 @@ func_mode_link ()
70988544 fi # link_all_deplibs != no
70998545 fi # linkmode = lib
71008546 done # for deplib in $libs
7101- if test "$pass" = link; then
7102- if test "$linkmode" = "prog"; then
8547+ if test link = "$pass"; then
8548+ if test prog = "$linkmode"; then
71038549 compile_deplibs="$new_inherited_linker_flags $compile_deplibs"
71048550 finalize_deplibs="$new_inherited_linker_flags $finalize_deplibs"
71058551 else
71068552 compiler_flags="$compiler_flags "`$ECHO " $new_inherited_linker_flags" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'`
71078553 fi
71088554 fi
7109- dependency_libs="$newdependency_libs"
7110- if test "$pass" = dlpreopen; then
8555+ dependency_libs=$newdependency_libs
8556+ if test dlpreopen = "$pass"; then
71118557 # Link the dlpreopened libraries before other libraries
71128558 for deplib in $save_deplibs; do
71138559 deplibs="$deplib $deplibs"
71148560 done
71158561 fi
7116- if test "$pass" != dlopen; then
7117- if test "$pass" != conv; then
8562+ if test dlopen != "$pass"; then
8563+ test conv = "$pass" || {
71188564 # Make sure lib_search_path contains only unique directories.
71198565 lib_search_path=
71208566 for dir in $newlib_search_path; do
@@ -7124,12 +8570,12 @@ func_mode_link ()
71248570 esac
71258571 done
71268572 newlib_search_path=
7127- fi
8573+ }
71288574
7129- if test "$linkmode,$pass" != "prog,link"; then
7130- vars="deplibs"
7131- else
8575+ if test prog,link = "$linkmode,$pass"; then
71328576 vars="compile_deplibs finalize_deplibs"
8577+ else
8578+ vars=deplibs
71338579 fi
71348580 for var in $vars dependency_libs; do
71358581 # Add libraries to $var in reverse order
@@ -7187,62 +8633,93 @@ func_mode_link ()
71878633 eval $var=\"$tmp_libs\"
71888634 done # for var
71898635 fi
8636+
8637+ # Add Sun CC postdeps if required:
8638+ test CXX = "$tagname" && {
8639+ case $host_os in
8640+ linux*)
8641+ case `$CC -V 2>&1 | sed 5q` in
8642+ *Sun\ C*) # Sun C++ 5.9
8643+ func_suncc_cstd_abi
8644+