root / ImageMagick / branches / ImageMagick-6.4.0 / libtool

Revision 10668, 239.9 kB (checked in by cristy, 4 months ago)
  • Property svn:executable set to *
Line 
1#! /bin/sh
2
3# libtool - Provide generalized library-building support services.
4# Generated automatically by config.status (ImageMagick) 6.4.0
5# Libtool was configured on host magick.imagemagick.org:
6# NOTE: Changes made to this file will be lost: look at ltmain.sh.
7#
8#   Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005,
9#                 2006, 2007, 2008 Free Software Foundation, Inc.
10#   Written by Gordon Matzigkeit, 1996
11#
12#   This file is part of GNU Libtool.
13#
14# GNU Libtool is free software; you can redistribute it and/or
15# modify it under the terms of the GNU General Public License as
16# published by the Free Software Foundation; either version 2 of
17# the License, or (at your option) any later version.
18#
19# As a special exception to the GNU General Public License,
20# if you distribute this file as part of a program or library that
21# is built using GNU Libtool, you may include this file under the
22# same distribution terms that you use for the rest of that program.
23#
24# GNU Libtool is distributed in the hope that it will be useful,
25# but WITHOUT ANY WARRANTY; without even the implied warranty of
26# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
27# GNU General Public License for more details.
28#
29# You should have received a copy of the GNU General Public License
30# along with GNU Libtool; see the file COPYING.  If not, a copy
31# can be downloaded from http://www.gnu.org/licenses/gpl.html, or
32# obtained by writing to the Free Software Foundation, Inc.,
33# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
34
35
36# The names of the tagged configurations supported by this script.
37available_tags="CXX "
38
39# ### BEGIN LIBTOOL CONFIG
40
41# A sed program that does not truncate output.
42SED="/bin/sed"
43
44# Sed that helps us avoid accidentally triggering echo(1) options like -n.
45Xsed="$SED -e 1s/^X//"
46
47# A grep program that handles long lines.
48GREP="/bin/grep"
49
50# An ERE matcher.
51EGREP="/bin/grep -E"
52
53# A literal string matcher.
54FGREP="/bin/grep -F"
55
56# Which release of libtool.m4 was used?
57macro_version=2.2.3a
58macro_revision=1.2970
59
60# Assembler program.
61AS=as
62
63# DLL creation program.
64DLLTOOL=dlltool
65
66# Object dumper program.
67OBJDUMP=objdump
68
69# Whether or not to build shared libraries.
70build_libtool_libs=yes
71
72# Whether or not to build static libraries.
73build_old_libs=yes
74
75# What type of objects to build.
76pic_mode=default
77
78# Whether or not to optimize for fast installation.
79fast_install=yes
80
81# The host system.
82host_alias=
83host=x86_64-unknown-linux-gnu
84host_os=linux-gnu
85
86# The build system.
87build_alias=
88build=x86_64-unknown-linux-gnu
89build_os=linux-gnu
90
91# A BSD- or MS-compatible name lister.
92NM="/usr/bin/nm -B"
93
94# Whether we need soft or hard links.
95LN_S="ln -s"
96
97# What is the maximum length of a command?
98max_cmd_len=1966080
99
100# Object file suffix (normally "o").
101objext=o
102
103# Executable file suffix (normally "").
104exeext=
105
106# whether the shell understands "unset".
107lt_unset=unset
108
109# turn spaces into newlines.
110SP2NL="tr \\040 \\012"
111
112# turn newlines into spaces.
113NL2SP="tr \\015\\012 \\040\\040"
114
115# How to create reloadable object files.
116reload_flag=" -r"
117reload_cmds="\$LD\$reload_flag -o \$output\$reload_objs"
118
119# Method to check whether dependent libraries are shared objects.
120deplibs_check_method="pass_all"
121
122# Command to use when deplibs_check_method == "file_magic".
123file_magic_cmd="\$MAGIC_CMD"
124
125# The archiver.
126AR="ar"
127AR_FLAGS="cru"
128
129# A symbol stripping program.
130STRIP="strip"
131
132# Commands used to install an old-style archive.
133RANLIB="ranlib"
134old_postinstall_cmds="chmod 644 \$oldlib~\$RANLIB \$oldlib"
135old_postuninstall_cmds=""
136
137# A C compiler.
138LTCC="gcc"
139
140# LTCC compiler flags.
141LTCFLAGS="-g -O2 -Wall -W -pthread"
142
143# Take the output of nm and produce a listing of raw symbols and C names.
144global_symbol_pipe="sed -n -e 's/^.*[    ]\\([ABCDGIRSTW][ABCDGIRSTW]*\\)[       ][      ]*\\([_A-Za-z][_A-Za-z0-9]*\\)\$/\\1 \\2 \\2/p'"
145
146# Transform the output of nm in a proper C declaration.
147global_symbol_to_cdecl="sed -n -e 's/^T .* \\(.*\\)\$/extern int \\1();/p' -e 's/^[ABCDGIRSTW]* .* \\(.*\\)\$/extern char \\1;/p'"
148
149# Transform the output of nm in a C name address pair.
150global_symbol_to_c_name_address="sed -n -e 's/^: \\([^ ]*\\) \$/  {\\\"\\1\\\", (void *) 0},/p' -e 's/^[ABCDGIRSTW]* \\([^ ]*\\) \\([^ ]*\\)\$/  {\"\\2\", (void *) \\&\\2},/p'"
151
152# Transform the output of nm in a C name address pair when lib prefix is needed.
153global_symbol_to_c_name_address_lib_prefix="sed -n -e 's/^: \\([^ ]*\\) \$/  {\\\"\\1\\\", (void *) 0},/p' -e 's/^[ABCDGIRSTW]* \\([^ ]*\\) \\(lib[^ ]*\\)\$/  {\"\\2\", (void *) \\&\\2},/p' -e 's/^[ABCDGIRSTW]* \\([^ ]*\\) \\([^ ]*\\)\$/  {\"lib\\2\", (void *) \\&\\2},/p'"
154
155# The name of the directory that contains temporary libtool files.
156objdir=.libs
157
158# Shell to use when invoking shell scripts.
159SHELL="/bin/sh"
160
161# An echo program that does not interpret backslashes.
162ECHO="echo"
163
164# Used to examine libraries when file_magic_cmd begins with "file".
165MAGIC_CMD=file
166
167# Must we lock files when doing compilation?
168need_locks="no"
169
170# Tool to manipulate archived DWARF debug symbol files on Mac OS X.
171DSYMUTIL=""
172
173# Tool to change global to local symbols on Mac OS X.
174NMEDIT=""
175
176# Tool to manipulate fat objects and archives on Mac OS X.
177LIPO=""
178
179# Old archive suffix (normally "a").
180libext=a
181
182# Shared library suffix (normally ".so").
183shrext_cmds=".so"
184
185# The commands to extract the exported symbol list from a shared archive.
186extract_expsyms_cmds=""
187
188# Variables whose values should be saved in libtool wrapper scripts and
189# restored at link time.
190variables_saved_for_relink="PATH LD_LIBRARY_PATH LD_RUN_PATH GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH"
191
192# Do we need the "lib" prefix for modules?
193need_lib_prefix=no
194
195# Do we need a version for libraries?
196need_version=no
197
198# Library versioning type.
199version_type=linux
200
201# Shared library runtime path variable.
202runpath_var=LD_RUN_PATH
203
204# Shared library path variable.
205shlibpath_var=LD_LIBRARY_PATH
206
207# Is shlibpath searched before the hard-coded library search path?
208shlibpath_overrides_runpath=no
209
210# Format of library name prefix.
211libname_spec="lib\$name"
212
213# List of archive names.  First name is the real one, the rest are links.
214# The last name is the one that the linker finds with -lNAME
215library_names_spec="\${libname}\${release}\${shared_ext}\$versuffix \${libname}\${release}\${shared_ext}\$major \$libname\${shared_ext}"
216
217# The coded name of the library, if different from the real name.
218soname_spec="\${libname}\${release}\${shared_ext}\$major"
219
220# Command to use after installation of a shared archive.
221postinstall_cmds=""
222
223# Command to use after uninstallation of a shared archive.
224postuninstall_cmds=""
225
226# Commands used to finish a libtool library installation in a directory.
227finish_cmds="PATH=\\\"\\\$PATH:/sbin\\\" ldconfig -n \$libdir"
228
229# As "finish_cmds", except a single script fragment to be evaled but
230# not shown.
231finish_eval=""
232
233# Whether we should hardcode library paths into libraries.
234hardcode_into_libs=yes
235
236# Compile-time system search path for libraries.
237sys_lib_search_path_spec="/usr/lib/gcc/x86_64-redhat-linux/4.3.0 /usr/lib64 /lib64"
238
239# Run-time system search path for libraries.
240sys_lib_dlsearch_path_spec="/lib /usr/lib /usr/lib/atlas /usr/lib64/atlas /usr/local/lib /usr/lib/mysql /usr/lib64/mysql /usr/lib64/octave-3.0.0 /usr/lib64/qt-3.3/lib /usr/lib64/tcl8.5 /usr/lib/xulrunner-1.9pre /usr/lib64/xulrunner-1.9pre "
241
242# Whether dlopen is supported.
243dlopen_support=yes
244
245# Whether dlopen of programs is supported.
246dlopen_self=yes
247
248# Whether dlopen of statically linked programs is supported.
249dlopen_self_static=no
250
251# Commands to strip libraries.
252old_striplib="strip --strip-debug"
253striplib="strip --strip-unneeded"
254
255
256# The linker used to build libraries.
257LD="/usr/bin/ld -m elf_x86_64"
258
259# Commands used to build an old-style archive.
260old_archive_cmds="\$AR \$AR_FLAGS \$oldlib\$oldobjs~\$RANLIB \$oldlib"
261
262# A language specific compiler.
263CC="gcc"
264
265# Is the compiler the GNU compiler?
266with_gcc=yes
267
268# Compiler flag to turn off builtin functions.
269no_builtin_flag=" -fno-builtin"
270
271# How to pass a linker flag through the compiler.
272wl="-Wl,"
273
274# Additional compiler flags for building library objects.
275pic_flag=" -fPIC -DPIC"
276
277# Compiler flag to prevent dynamic linking.
278link_static_flag="-static"
279
280# Does compiler simultaneously support -c and -o options?
281compiler_c_o="yes"
282
283# Whether or not to add -lc for building shared libraries.
284build_libtool_need_lc=no
285
286# Whether or not to disallow shared libs when runtime libs are static.
287allow_libtool_libs_with_static_runtimes=no
288
289# Compiler flag to allow reflexive dlopens.
290export_dynamic_flag_spec="\${wl}--export-dynamic"
291
292# Compiler flag to generate shared objects directly from archives.
293whole_archive_flag_spec="\${wl}--whole-archive\$convenience \${wl}--no-whole-archive"
294
295# Whether the compiler copes with passing no objects directly.
296compiler_needs_object="no"
297
298# Create an old-style archive from a shared archive.
299old_archive_from_new_cmds=""
300
301# Create a temporary old-style archive to link instead of a shared archive.
302old_archive_from_expsyms_cmds=""
303
304# Commands used to build a shared archive.
305archive_cmds="\$CC -shared \$libobjs \$deplibs \$compiler_flags \${wl}-soname \$wl\$soname -o \$lib"
306archive_expsym_cmds="echo \\\"{ global:\\\" > \$output_objdir/\$libname.ver~
307            cat \$export_symbols | sed -e \\\"s/\\\\(.*\\\\)/\\\\1;/\\\" >> \$output_objdir/\$libname.ver~
308            echo \\\"local: *; };\\\" >> \$output_objdir/\$libname.ver~
309            \$CC -shared \$libobjs \$deplibs \$compiler_flags \${wl}-soname \$wl\$soname \${wl}-version-script \${wl}\$output_objdir/\$libname.ver -o \$lib"
310
311# Commands used to build a loadable module if different from building
312# a shared archive.
313module_cmds=""
314module_expsym_cmds=""
315
316# Whether we are building with GNU ld or not.
317with_gnu_ld="yes"
318
319# Flag that allows shared libraries with undefined symbols to be built.
320allow_undefined_flag=""
321
322# Flag that enforces no undefined symbols.
323no_undefined_flag=""
324
325# Flag to hardcode $libdir into a binary during linking.
326# This must work even if $libdir does not exist
327hardcode_libdir_flag_spec="\${wl}-rpath \${wl}\$libdir"
328
329# If ld is used when linking, flag to hardcode $libdir into a binary
330# during linking.  This must work even if $libdir does not exist.
331hardcode_libdir_flag_spec_ld=""
332
333# Whether we need a single "-rpath" flag with a separated argument.
334hardcode_libdir_separator=""
335
336# Set to "yes" if using DIR/libNAME${shared_ext} during linking hardcodes
337# DIR into the resulting binary.
338hardcode_direct=no
339
340# Set to "yes" if using DIR/libNAME${shared_ext} during linking hardcodes
341# DIR into the resulting binary and the resulting library dependency is
342# "absolute",i.e impossible to change by setting ${shlibpath_var} if the
343# library is relocated.
344hardcode_direct_absolute=no
345
346# Set to "yes" if using the -LDIR flag during linking hardcodes DIR
347# into the resulting binary.
348hardcode_minus_L=no
349
350# Set to "yes" if using SHLIBPATH_VAR=DIR during linking hardcodes DIR
351# into the resulting binary.
352hardcode_shlibpath_var=unsupported
353
354# Set to "yes" if building a shared library automatically hardcodes DIR
355# into the library and all subsequent libraries and executables linked
356# against it.
357hardcode_automatic=no
358
359# Set to yes if linker adds runtime paths of dependent libraries
360# to runtime path list.
361inherit_rpath=no
362
363# Whether libtool must link a program against all its dependency libraries.
364link_all_deplibs=unknown
365
366# Fix the shell variable $srcfile for the compiler.
367fix_srcfile_path=""
368
369# Set to "yes" if exported symbols are required.
370always_export_symbols=no
371
372# The commands to list exported symbols.
373export_symbols_cmds="\$NM \$libobjs \$convenience | \$global_symbol_pipe | \$SED 's/.* //' | sort | uniq > \$export_symbols"
374
375# Symbols that should not be listed in the preloaded symbols.
376exclude_expsyms="_GLOBAL_OFFSET_TABLE_|_GLOBAL__F[ID]_.*"
377
378# Symbols that must always be exported.
379include_expsyms=""
380
381# Commands necessary for linking programs (against libraries) with templates.
382prelink_cmds=""
383
384# Specify filename containing input files.
385file_list_spec=""
386
387# How to hardcode a shared library path into an executable.
388hardcode_action=immediate
389
390# The directories searched by this compiler when creating a shared library.
391compiler_lib_search_dirs=""
392
393# Dependencies to place before and after the objects being linked to
394# create a shared library.
395predep_objects=""
396postdep_objects=""
397predeps=""
398postdeps=""
399
400# The library search path used internally by the compiler when linking
401# a shared library.
402compiler_lib_search_path=""
403
404# ### END LIBTOOL CONFIG
405
406# Generated from ltmain.m4sh.
407
408# ltmain.sh (GNU libtool 1.2970 2008-04-24) 2.2.3a
409# Written by Gordon Matzigkeit <gord@gnu.ai.mit.edu>, 1996
410
411# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005, 2006, 2007 2008 Free Software Foundation, Inc.
412# This is free software; see the source for copying conditions.  There is NO
413# warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
414
415# GNU Libtool is free software; you can redistribute it and/or modify
416# it under the terms of the GNU General Public License as published by
417# the Free Software Foundation; either version 2 of the License, or
418# (at your option) any later version.
419#
420# As a special exception to the GNU General Public License,
421# if you distribute this file as part of a program or library that
422# is built using GNU Libtool, you may include this file under the
423# same distribution terms that you use for the rest of that program.
424#
425# GNU Libtool is distributed in the hope that it will be useful, but
426# WITHOUT ANY WARRANTY; without even the implied warranty of
427# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
428# General Public License for more details.
429#
430# You should have received a copy of the GNU General Public License
431# along with GNU Libtool; see the file COPYING.  If not, a copy
432# can be downloaded from http://www.gnu.org/licenses/gpl.html,
433# or obtained by writing to the Free Software Foundation, Inc.,
434# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
435
436# Usage: $progname [OPTION]... [MODE-ARG]...
437#
438# Provide generalized library-building support services.
439#
440#     --config             show all configuration variables
441#     --debug              enable verbose shell tracing
442# -n, --dry-run            display commands without modifying any files
443#     --features           display basic configuration information and exit
444#     --mode=MODE          use operation mode MODE
445#     --preserve-dup-deps  don't remove duplicate dependency libraries
446#     --quiet, --silent    don't print informational messages
447#     --tag=TAG            use configuration variables from tag TAG
448# -v, --verbose            print informational messages (default)
449#     --version            print version information
450# -h, --help               print short or long help message
451#
452# MODE must be one of the following:
453#
454#       clean              remove files from the build directory
455#       compile            compile a source file into a libtool object
456#       execute            automatically set library path, then run a program
457#       finish             complete the installation of libtool libraries
458#       install            install libraries or executables
459#       link               create a library or an executable
460#       uninstall          remove libraries from an installed directory
461#
462# MODE-ARGS vary depending on the MODE.
463# Try `$progname --help --mode=MODE' for a more detailed description of MODE.
464#
465# When reporting a bug, please describe a test case to reproduce it and
466# include the following information:
467#
468#       host-triplet:   $host
469#       shell:          $SHELL
470#       compiler:               $LTCC
471#       compiler flags:         $LTCFLAGS
472#       linker:         $LD (gnu? $with_gnu_ld)
473#       $progname:              (GNU libtool 1.2970 2008-04-24) 2.2.3a
474#       automake:               $automake_version
475#       autoconf:               $autoconf_version
476#
477# Report bugs to <bug-libtool@gnu.org>.
478
479PROGRAM=ltmain.sh
480PACKAGE=libtool
481VERSION=2.2.3a
482TIMESTAMP=" 1.2970 2008-04-24"
483package_revision=1.2970
484
485# Be Bourne compatible
486if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then
487  emulate sh
488  NULLCMD=:
489  # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which
490  # is contrary to our usage.  Disable this feature.
491  alias -g '${1+"$@"}'='"$@"'
492  setopt NO_GLOB_SUBST
493else
494  case `(set -o) 2>/dev/null` in *posix*) set -o posix;; esac
495fi
496BIN_SH=xpg4; export BIN_SH # for Tru64
497DUALCASE=1; export DUALCASE # for MKS sh
498
499# NLS nuisances: We save the old values to restore during execute mode.
500# Only set LANG and LC_ALL to C if already set.
501# These must not be set unconditionally because not all systems understand
502# e.g. LANG=C (notably SCO).
503lt_user_locale=
504lt_safe_locale=
505for lt_var in LANG LANGUAGE LC_ALL LC_CTYPE LC_COLLATE LC_MESSAGES
506do
507  eval "if test \"\${$lt_var+set}\" = set; then
508          save_$lt_var=\$$lt_var
509          $lt_var=C
510          export $lt_var
511          lt_user_locale=\"$lt_var=\\\$save_\$lt_var; \$lt_user_locale\"
512          lt_safe_locale=\"$lt_var=C; \$lt_safe_locale\"
513        fi"
514done
515
516$lt_unset CDPATH
517
518
519
520
521
522: ${CP="cp -f"}
523: ${ECHO="echo"}
524: ${EGREP="/bin/grep -E"}
525: ${FGREP="/bin/grep -F"}
526: ${GREP="/bin/grep"}
527: ${LN_S="ln -s"}
528: ${MAKE="make"}
529: ${MKDIR="mkdir"}
530: ${MV="mv -f"}
531: ${RM="rm -f"}
532: ${SED="/bin/sed"}
533: ${SHELL="${CONFIG_SHELL-/bin/sh}"}
534: ${Xsed="$SED -e 1s/^X//"}
535
536# Global variables:
537EXIT_SUCCESS=0
538EXIT_FAILURE=1
539EXIT_MISMATCH=63  # $? = 63 is used to indicate version mismatch to missing.
540EXIT_SKIP=77      # $? = 77 is used to indicate a skipped test to automake.
541
542exit_status=$EXIT_SUCCESS
543
544# Make sure IFS has a sensible default
545lt_nl='
546'
547IFS="   $lt_nl"
548
549dirname="s,/[^/]*$,,"
550basename="s,^.*/,,"
551
552# func_dirname_and_basename file append nondir_replacement
553# perform func_basename and func_dirname in a single function
554# call:
555#   dirname:  Compute the dirname of FILE.  If nonempty,
556#             add APPEND to the result, otherwise set result
557#             to NONDIR_REPLACEMENT.
558#             value returned in "$func_dirname_result"
559#   basename: Compute filename of FILE.
560#             value retuned in "$func_basename_result"
561# Implementation must be kept synchronized with func_dirname
562# and func_basename. For efficiency, we do not delegate to
563# those functions but instead duplicate the functionality here.
564func_dirname_and_basename ()
565{
566  # Extract subdirectory from the argument.
567  func_dirname_result=`$ECHO "X${1}" | $Xsed -e "$dirname"`
568  if test "X$func_dirname_result" = "X${1}"; then
569    func_dirname_result="${3}"
570  else
571    func_dirname_result="$func_dirname_result${2}"
572  fi
573  func_basename_result=`$ECHO "X${1}" | $Xsed -e "$basename"`
574}
575
576# Generated shell functions inserted here.
577
578# func_dirname file append nondir_replacement
579# Compute the dirname of FILE.  If nonempty, add APPEND to the result,
580# otherwise set result to NONDIR_REPLACEMENT.
581func_dirname ()
582{
583  case ${1} in
584    */*) func_dirname_result="${1%/*}${2}" ;;
585    *  ) func_dirname_result="${3}" ;;
586  esac
587}
588
589# func_basename file
590func_basename ()
591{
592  func_basename_result="${1##*/}"
593}
594
595# func_dirname_and_basename file append nondir_replacement
596# perform func_basename and func_dirname in a single function
597# call:
598#   dirname:  Compute the dirname of FILE.  If nonempty,
599#             add APPEND to the result, otherwise set result
600#             to NONDIR_REPLACEMENT.
601#             value returned in "$func_dirname_result"
602#   basename: Compute filename of FILE.
603#             value retuned in "$func_basename_result"
604# Implementation must be kept synchronized with func_dirname
605# and func_basename. For efficiency, we do not delegate to
606# those functions but instead duplicate the functionality here.
607func_dirname_and_basename ()
608{
609  case ${1} in
610    */*) func_dirname_result="${1%/*}${2}" ;;
611    *  ) func_dirname_result="${3}" ;;
612  esac
613  func_basename_result="${1##*/}"
614}
615
616# func_stripname prefix suffix name
617# strip PREFIX and SUFFIX off of NAME.
618# PREFIX and SUFFIX must not contain globbing or regex special
619# characters, hashes, percent signs, but SUFFIX may contain a leading
620# dot (in which case that matches only a dot).
621func_stripname ()
622{
623  # pdksh 5.2.14 does not do ${X%$Y} correctly if both X and Y are
624  # positional parameters, so assign one to ordinary parameter first.
625  func_stripname_result=${3}
626  func_stripname_result=${func_stripname_result#"${1}"}
627  func_stripname_result=${func_stripname_result%"${2}"}
628}
629
630# func_opt_split
631func_opt_split ()
632{
633  func_opt_split_opt=${1%%=*}
634  func_opt_split_arg=${1#*=}
635}
636
637# func_lo2o object
638func_lo2o ()
639{
640  case ${1} in
641    *.lo) func_lo2o_result=${1%.lo}.${objext} ;;
642    *)    func_lo2o_result=${1} ;;
643  esac
644}
645
646# func_xform libobj-or-source
647func_xform ()
648{
649  func_xform_result=${1%.*}.lo
650}
651
652# func_arith arithmetic-term...
653func_arith ()
654{
655  func_arith_result=$(( $* ))
656}
657
658# func_len string
659# STRING may not start with a hyphen.
660func_len ()
661{
662  func_len_result=${#1}
663}
664
665
666# func_append var value
667# Append VALUE to the end of shell variable VAR.
668func_append ()
669{
670  eval "$1+=\$2"
671}
672# Generated shell functions inserted here.
673
674# Work around backward compatibility issue on IRIX 6.5. On IRIX 6.4+, sh
675# is ksh but when the shell is invoked as "sh" and the current value of
676# the _XPG environment variable is not equal to 1 (one), the special
677# positional parameter $0, within a function call, is the name of the
678# function.
679progpath="$0"
680
681# The name of this program:
682# In the unlikely event $progname began with a '-', it would play havoc with
683# func_echo (imagine progname=-n), so we prepend ./ in that case:
684func_dirname_and_basename "$progpath"
685progname=$func_basename_result
686case $progname in
687  -*) progname=./$progname ;;
688esac
689
690# Make sure we have an absolute path for reexecution:
691case $progpath in
692  [\\/]*|[A-Za-z]:\\*) ;;
693  *[\\/]*)
694     progdir=$func_dirname_result
695     progdir=`cd "$progdir" && pwd`
696     progpath="$progdir/$progname"
697     ;;
698  *)
699     save_IFS="$IFS"
700     IFS=:
701     for progdir in $PATH; do
702       IFS="$save_IFS"
703       test -x "$progdir/$progname" && break
704     done
705     IFS="$save_IFS"
706     test -n "$progdir" || progdir=`pwd`
707     progpath="$progdir/$progname"
708     ;;
709esac
710
711# Sed substitution that helps us do robust quoting.  It backslashifies
712# metacharacters that are still active within double-quoted strings.
713Xsed="${SED}"' -e 1s/^X//'
714sed_quote_subst='s/\([`"$\\]\)/\\\1/g'
715
716# Same as above, but do not quote variable references.
717double_quote_subst='s/\(["`\\]\)/\\\1/g'
718
719# Re-`\' parameter expansions in output of double_quote_subst that were
720# `\'-ed in input to the same.  If an odd number of `\' preceded a '$'
721# in input to double_quote_subst, that '$' was protected from expansion.
722# Since each input `\' is now two `\'s, look for any number of runs of
723# four `\'s followed by two `\'s and then a '$'.  `\' that '$'.
724bs='\\'
725bs2='\\\\'
726bs4='\\\\\\\\'
727dollar='\$'
728sed_double_backslash="\
729  s/$bs4/&\\
730/g
731  s/^$bs2$dollar/$bs&/
732  s/\\([^$bs]\\)$bs2$dollar/\\1$bs2$bs$dollar/g
733  s/\n//g"
734
735# Standard options:
736opt_dry_run=false
737opt_help=false
738opt_quiet=false
739opt_verbose=false
740
741# func_echo arg...
742# Echo program name prefixed message, along with the current mode
743# name if it has been set yet.
744func_echo ()
745{
746    $ECHO "$progname${mode+: }$mode: $*"
747}
748
749# func_verbose arg...
750# Echo program name prefixed message in verbose mode only.
751func_verbose ()
752{
753    $opt_verbose && func_echo ${1+"$@"}
754
755    # A bug in bash halts the script if the last line of a function
756    # fails when set -e is in force, so we need another command to
757    # work around that:
758    :
759}
760
761# func_error arg...
762# Echo program name prefixed message to standard error.
763func_error ()
764{
765    $ECHO "$progname${mode+: }$mode: "${1+"$@"} 1>&2
766}
767
768# func_warning arg...
769# Echo program name prefixed warning message to standard error.
770func_warning ()
771{
772    $ECHO "$progname${mode+: }$mode: warning: "${1+"$@"} 1>&2
773}
774
775# func_fatal_error arg...
776# Echo program name prefixed message to standard error, and exit.
777func_fatal_error ()
778{
779    func_error ${1+"$@"}
780    exit $EXIT_FAILURE
781}
782
783# func_fatal_help arg...
784# Echo program name prefixed message to standard error, followed by
785# a help hint, and exit.
786func_fatal_help ()
787{
788    func_error ${1+"$@"}
789    func_fatal_error "$help"
790}
791help="Try \`$progname --help' for more information."  ## default
792
793
794# func_grep expression filename
795# Check whether EXPRESSION matches any line of FILENAME, without output.
796func_grep ()
797{
798    $GREP "$1" "$2" >/dev/null 2>&1
799}
800
801
802# func_mkdir_p directory-path
803# Make sure the entire path to DIRECTORY-PATH is available.
804func_mkdir_p ()
805{
806    my_directory_path="$1"
807    my_dir_list=
808
809    if test -n "$my_directory_path" && test "$opt_dry_run" != ":"; then
810
811      # Protect directory names starting with `-'
812      case $my_directory_path in
813        -*) my_directory_path="./$my_directory_path" ;;
814      esac
815
816      # While some portion of DIR does not yet exist...
817      while test ! -d "$my_directory_path"; do
818        # ...make a list in topmost first order.  Use a colon delimited
819        # list incase some portion of path contains whitespace.
820        my_dir_list="$my_directory_path:$my_dir_list"
821
822        # If the last portion added has no slash in it, the list is done
823        case $my_directory_path in */*) ;; *) break ;; esac
824
825        # ...otherwise throw away the child directory and loop
826        my_directory_path=`$ECHO "X$my_directory_path" | $Xsed -e "$dirname"`
827      done
828      my_dir_list=`$ECHO "X$my_dir_list" | $Xsed -e 's,:*$,,'`
829
830      save_mkdir_p_IFS="$IFS"; IFS=':'
831      for my_dir in $my_dir_list; do
832        IFS="$save_mkdir_p_IFS"
833        # mkdir can fail with a `File exist' error if two processes
834        # try to create one of the directories concurrently.  Don't
835        # stop in that case!
836        $MKDIR "$my_dir" 2>/dev/null || :
837      done
838      IFS="$save_mkdir_p_IFS"
839
840      # Bail out if we (or some other process) failed to create a directory.
841      test -d "$my_directory_path" || \
842        func_fatal_error "Failed to create \`$1'"
843    fi
844}
845
846
847# func_mktempdir [string]
848# Make a temporary directory that won't clash with other running
849# libtool processes, and avoids race conditions if possible.  If
850# given, STRING is the basename for that directory.
851func_mktempdir ()
852{
853    my_template="${TMPDIR-/tmp}/${1-$progname}"
854
855    if test "$opt_dry_run" = ":"; then
856      # Return a directory name, but don't create it in dry-run mode
857      my_tmpdir="${my_template}-$$"
858    else
859
860      # If mktemp works, use that first and foremost
861      my_tmpdir=`mktemp -d "${my_template}-XXXXXXXX" 2>/dev/null`
862
863      if test ! -d "$my_tmpdir"; then
864        # Failing that, at least try and use $RANDOM to avoid a race
865        my_tmpdir="${my_template}-${RANDOM-0}$$"
866
867        save_mktempdir_umask=`umask`
868        umask 0077
869        $MKDIR "$my_tmpdir"
870        umask $save_mktempdir_umask
871      fi
872
873      # If we're not in dry-run mode, bomb out on failure
874      test -d "$my_tmpdir" || \
875        func_fatal_error "cannot create temporary directory \`$my_tmpdir'"
876    fi
877
878    $ECHO "X$my_tmpdir" | $Xsed
879}
880
881
882# func_quote_for_eval arg
883# Aesthetically quote ARG to be evaled later.
884# This function returns two values: FUNC_QUOTE_FOR_EVAL_RESULT
885# is double-quoted, suitable for a subsequent eval, whereas
886# FUNC_QUOTE_FOR_EVAL_UNQUOTED_RESULT has merely all characters
887# which are still active within double quotes backslashified.
888func_quote_for_eval ()
889{
890    case $1 in
891      *[\\\`\"\$]*)
892        func_quote_for_eval_unquoted_result=`$ECHO "X$1" | $Xsed -e "$sed_quote_subst"` ;;
893      *)
894        func_quote_for_eval_unquoted_result="$1" ;;
895    esac
896
897    case $func_quote_for_eval_unquoted_result in
898      # Double-quote args containing shell metacharacters to delay
899      # word splitting, command substitution and and variable
900      # expansion for a subsequent eval.
901      # Many Bourne shells cannot handle close brackets correctly
902      # in scan sets, so we specify it separately.
903      *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \     ]*|*]*|"")
904        func_quote_for_eval_result="\"$func_quote_for_eval_unquoted_result\""
905        ;;
906      *)
907        func_quote_for_eval_result="$func_quote_for_eval_unquoted_result"
908    esac
909}
910
911
912# func_quote_for_expand arg
913# Aesthetically quote ARG to be evaled later; same as above,
914# but do not quote variable references.
915func_quote_for_expand ()
916{
917    case $1 in
918      *[\\\`\"]*)
919        my_arg=`$ECHO "X$1" | $Xsed \
920            -e "$double_quote_subst" -e "$sed_double_backslash"` ;;
921      *)
922        my_arg="$1" ;;
923    esac
924
925    case $my_arg in
926      # Double-quote args containing shell metacharacters to delay
927      # word splitting and command substitution for a subsequent eval.
928      # Many Bourne shells cannot handle close brackets correctly
929      # in scan sets, so we specify it separately.
930      *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \     ]*|*]*|"")
931        my_arg="\"$my_arg\""
932        ;;
933    esac
934
935    func_quote_for_expand_result="$my_arg"
936}
937
938
939# func_show_eval cmd [fail_exp]
940# Unless opt_silent is true, then output CMD.  Then, if opt_dryrun is
941# not true, evaluate CMD.  If the evaluation of CMD fails, and FAIL_EXP
942# is given, then evaluate it.
943func_show_eval ()
944{
945    my_cmd="$1"
946    my_fail_exp="${2-:}"
947
948    ${opt_silent-false} || {
949      func_quote_for_expand "$my_cmd"
950      eval "func_echo $func_quote_for_expand_result"
951    }
952
953    if ${opt_dry_run-false}; then :; else
954      eval "$my_cmd"
955      my_status=$?
956      if test "$my_status" -eq 0; then :; else
957        eval "(exit $my_status); $my_fail_exp"
958      fi
959    fi
960}
961
962
963# func_show_eval_locale cmd [fail_exp]
964# Unless opt_silent is true, then output CMD.  Then, if opt_dryrun is
965# not true, evaluate CMD.  If the evaluation of CMD fails, and FAIL_EXP
966# is given, then evaluate it.  Use the saved locale for evaluation.
967func_show_eval_locale ()
968{
969    my_cmd="$1"
970    my_fail_exp="${2-:}"
971
972    ${opt_silent-false} || {
973      func_quote_for_expand "$my_cmd"
974      eval "func_echo $func_quote_for_expand_result"
975    }
976
977    if ${opt_dry_run-false}; then :; else
978      eval "$lt_user_locale
979            $my_cmd"
980      my_status=$?
981      eval "$lt_safe_locale"
982      if test "$my_status" -eq 0; then :; else
983        eval "(exit $my_status); $my_fail_exp"
984      fi
985    fi
986}
987
988
989
990
991
992# func_version
993# Echo version message to standard output and exit.
994func_version ()
995{
996    $SED -n '/^# '$PROGRAM' (GNU /,/# warranty; / {
997        s/^# //
998        s/^# *$//
999        s/\((C)\)[ 0-9,-]*\( [1-9][0-9]*\)/\1\2/
1000        p
1001     }' < "$progpath"
1002     exit $?
1003}
1004
1005# func_usage
1006# Echo short help message to standard output and exit.
1007func_usage ()
1008{
1009    $SED -n '/^# Usage:/,/# -h/ {
1010        s/^# //
1011        s/^# *$//
1012        s/\$progname/'$progname'/
1013        p
1014    }' < "$progpath"
1015    $ECHO
1016    $ECHO "run \`$progname --help | more' for full usage"
1017    exit $?
1018}
1019
1020# func_help
1021# Echo long help message to standard output and exit.
1022func_help ()
1023{
1024    $SED -n '/^# Usage:/,/# Report bugs to/ {
1025        s/^# //
1026        s/^# *$//
1027        s*\$progname*'$progname'*
1028        s*\$host*'"$host"'*
1029        s*\$SHELL*'"$SHELL"'*
1030        s*\$LTCC*'"$LTCC"'*
1031        s*\$LTCFLAGS*'"$LTCFLAGS"'*
1032        s*\$LD*'"$LD"'*
1033        s/\$with_gnu_ld/'"$with_gnu_ld"'/
1034        s/\$automake_version/'"`(automake --version) 2>/dev/null |$SED 1q`"'/
1035        s/\$autoconf_version/'"`(autoconf --version) 2>/dev/null |$SED 1q`"'/
1036        p
1037     }' < "$progpath"
1038    exit $?
1039}
1040
1041# func_missing_arg argname
1042# Echo program name prefixed message to standard error and set global
1043# exit_cmd.
1044func_missing_arg ()
1045{
1046    func_error "missing argument for $1"
1047    exit_cmd=exit
1048}
1049
1050exit_cmd=:
1051
1052
1053
1054
1055
1056# Check that we have a working $ECHO.
1057if test "X$1" = X--no-reexec; then
1058  # Discard the --no-reexec flag, and continue.
1059  shift
1060elif test "X$1" = X--fallback-echo; then
1061  # Avoid inline document here, it may be left over
1062  :
1063elif test "X`{ $ECHO '\t'; } 2>/dev/null`" = 'X\t'; then
1064  # Yippee, $ECHO works!
1065  :
1066else
1067  # Restart under the correct shell, and then maybe $ECHO will work.
1068  exec $SHELL "$progpath" --no-reexec ${1+"$@"}
1069fi
1070
1071if test "X$1" = X--fallback-echo; then
1072  # used as fallback echo
1073  shift
1074  cat <<EOF
1075$*
1076EOF
1077  exit $EXIT_SUCCESS
1078fi
1079
1080magic="%%%MAGIC variable%%%"
1081magic_exe="%%%MAGIC EXE variable%%%"
1082
1083# Global variables.
1084# $mode is unset
1085nonopt=
1086execute_dlfiles=
1087preserve_args=
1088lo2o="s/\\.lo\$/.${objext}/"
1089o2lo="s/\\.${objext}\$/.lo/"
1090extracted_archives=
1091extracted_serial=0
1092
1093opt_dry_run=false
1094opt_duplicate_deps=false
1095opt_silent=false
1096opt_debug=:
1097
1098# If this variable is set in any of the actions, the command in it
1099# will be execed at the end.  This prevents here-documents from being
1100# left over by shells.
1101exec_cmd=
1102
1103# func_fatal_configuration arg...
1104# Echo program name prefixed message to standard error, followed by
1105# a configuration failure hint, and exit.
1106func_fatal_configuration ()
1107{
1108    func_error ${1+"$@"}
1109    func_error "See the $PACKAGE documentation for more information."
1110    func_fatal_error "Fatal configuration error."
1111}
1112
1113
1114# func_config
1115# Display the configuration for all the tags in this script.
1116func_config ()
1117{
1118    re_begincf='^# ### BEGIN LIBTOOL'
1119    re_endcf='^# ### END LIBTOOL'
1120
1121    # Default configuration.
1122    $SED "1,/$re_begincf CONFIG/d;/$re_endcf CONFIG/,\$d" < "$progpath"
1123
1124    # Now print the configurations for the tags.
1125    for tagname in $taglist; do
1126      $SED -n "/$re_begincf TAG CONFIG: $tagname\$/,/$re_endcf TAG CONFIG: $tagname\$/p" < "$progpath"
1127    done
1128
1129    exit $?
1130}
1131
1132# func_features
1133# Display the features supported by this script.
1134func_features ()
1135{
1136    $ECHO "host: $host"
1137    if test "$build_libtool_libs" = yes; then
1138      $ECHO "enable shared libraries"
1139    else
1140      $ECHO "disable shared libraries"
1141    fi
1142    if test "$build_old_libs" = yes; then
1143      $ECHO "enable static libraries"
1144    else
1145      $ECHO "disable static libraries"
1146    fi
1147
1148    exit $?
1149}
1150
1151# func_enable_tag tagname
1152# Verify that TAGNAME is valid, and either flag an error and exit, or
1153# enable the TAGNAME tag.  We also add TAGNAME to the global $taglist
1154# variable here.
1155func_enable_tag ()
1156{
1157  # Global variable:
1158  tagname="$1"
1159
1160  re_begincf="^# ### BEGIN LIBTOOL TAG CONFIG: $tagname\$"
1161  re_endcf="^# ### END LIBTOOL TAG CONFIG: $tagname\$"
1162  sed_extractcf="/$re_begincf/,/$re_endcf/p"
1163
1164  # Validate tagname.
1165  case $tagname in
1166    *[!-_A-Za-z0-9,/]*)
1167      func_fatal_error "invalid tag name: $tagname"
1168      ;;
1169  esac
1170
1171  # Don't test for the "default" C tag, as we know it's
1172  # there but not specially marked.
1173  case $tagname in
1174    CC) ;;
1175    *)
1176      if $GREP "$re_begincf" "$progpath" >/dev/null 2>&1; then
1177        taglist="$taglist $tagname"
1178
1179        # Evaluate the configuration.  Be careful to quote the path
1180        # and the sed script, to avoid splitting on whitespace, but
1181        # also don't use non-portable quotes within backquotes within
1182        # quotes we have to do it in 2 steps:
1183        extractedcf=`$SED -n -e "$sed_extractcf" < "$progpath"`
1184        eval "$extractedcf"
1185      else
1186        func_error "ignoring unknown tag $tagname"
1187      fi
1188      ;;
1189  esac
1190}
1191
1192# Parse options once, thoroughly.  This comes as soon as possible in
1193# the script to make things like `libtool --version' happen quickly.
1194{
1195
1196  # Shorthand for --mode=foo, only valid as the first argument
1197  case $1 in
1198  clean|clea|cle|cl)
1199    shift; set dummy --mode clean ${1+"$@"}; shift
1200    ;;
1201  compile|compil|compi|comp|com|co|c)
1202    shift; set dummy --mode compile ${1+"$@"}; shift
1203    ;;
1204  execute|execut|execu|exec|exe|ex|e)
1205    shift; set dummy --mode execute ${1+"$@"}; shift
1206    ;;
1207  finish|finis|fini|fin|fi|f)
1208    shift; set dummy --mode finish ${1+"$@"}; shift
1209    ;;
1210  install|instal|insta|inst|ins|in|i)
1211    shift; set dummy --mode install ${1+"$@"}; shift
1212    ;;
1213  link|lin|li|l)
1214    shift; set dummy --mode link ${1+"$@"}; shift
1215    ;;
1216  uninstall|uninstal|uninsta|uninst|unins|unin|uni|un|u)
1217    shift; set dummy --mode uninstall ${1+"$@"}; shift
1218    ;;
1219  esac
1220
1221  # Parse non-mode specific arguments:
1222  while test "$#" -gt 0; do
1223    opt="$1"
1224    shift
1225
1226    case $opt in
1227      --config)         func_config                                     ;;
1228
1229      --debug)          preserve_args="$preserve_args $opt"
1230                        func_echo "enabling shell trace mode"
1231                        opt_debug='set -x'
1232                        $opt_debug
1233                        ;;
1234
1235      -dlopen)          test "$#" -eq 0 && func_missing_arg "$opt" && break
1236                        execute_dlfiles="$execute_dlfiles $1"
1237                        shift
1238                        ;;
1239
1240      --dry-run | -n)   opt_dry_run=:                                   ;;
1241      --features)       func_features                                   ;;
1242      --finish)         mode="finish"                                   ;;
1243
1244      --mode)           test "$#" -eq 0 && func_missing_arg "$opt" && break
1245                        case $1 in
1246                          # Valid mode arguments:
1247                          clean)        ;;
1248                          compile)      ;;
1249                          execute)      ;;
1250                          finish)       ;;
1251                          install)      ;;
1252                          link)         ;;
1253                          relink)       ;;
1254                          uninstall)    ;;
1255
1256                          # Catch anything else as an error
1257                          *) func_error "invalid argument for $opt"
1258                             exit_cmd=exit
1259                             break
1260                             ;;
1261                        esac
1262
1263                        mode="$1"
1264                        shift
1265                        ;;
1266
1267      --preserve-dup-deps)
1268                        opt_duplicate_deps=:                            ;;
1269
1270      --quiet|--silent) preserve_args="$preserve_args $opt"
1271                        opt_silent=:
1272                        ;;
1273
1274      --verbose| -v)    preserve_args="$preserve_args $opt"
1275                        opt_silent=false
1276                        ;;
1277
1278      --tag)            test "$#" -eq 0 && func_missing_arg "$opt" && break
1279                        preserve_args="$preserve_args $opt $1"
1280                        func_enable_tag "$1"    # tagname is set here
1281                        shift
1282                        ;;
1283
1284      # Separate optargs to long options:
1285      -dlopen=*|--mode=*|--tag=*)
1286                        func_opt_split "$opt"
1287                        set dummy "$func_opt_split_opt" "$func_opt_split_arg" ${1+"$@"}
1288                        shift
1289                        ;;
1290
1291      -\?|-h)           func_usage                                      ;;
1292      --help)           opt_help=:                                      ;;
1293      --version)        func_version                                    ;;
1294
1295      -*)               func_fatal_help "unrecognized option \`$opt'"   ;;
1296
1297      *)                nonopt="$opt"
1298                        break
1299                        ;;
1300    esac
1301  done
1302
1303
1304  case $host in
1305    *cygwin* | *mingw* | *pw32*)
1306      # don't eliminate duplications in $postdeps and $predeps
1307      opt_duplicate_compiler_generated_deps=:
1308      ;;
1309    *)
1310      opt_duplicate_compiler_generated_deps=$opt_duplicate_deps
1311      ;;
1312  esac
1313
1314  # Having warned about all mis-specified options, bail out if
1315  # anything was wrong.
1316  $exit_cmd $EXIT_FAILURE
1317}
1318
1319# func_check_version_match
1320# Ensure that we are using m4 macros, and libtool script from the same
1321# release of libtool.
1322func_check_version_match ()
1323{
1324  if test "$package_revision" != "$macro_revision"; then
1325    if test "$VERSION" != "$macro_version"; then
1326      if test -z "$macro_version"; then
1327        cat >&2 <<_LT_EOF
1328$progname: Version mismatch error.  This is $PACKAGE $VERSION, but the
1329$progname: definition of this LT_INIT comes from an older release.
1330$progname: You should recreate aclocal.m4 with macros from $PACKAGE $VERSION
1331$progname: and run autoconf again.
1332_LT_EOF
1333      else
1334        cat >&2 <<_LT_EOF
1335$progname: Version mismatch error.  This is $PACKAGE $VERSION, but the
1336$progname: definition of this LT_INIT comes from $PACKAGE $macro_version.
1337$progname: You should recreate aclocal.m4 with macros from $PACKAGE $VERSION
1338$progname: and run autoconf again.
1339_LT_EOF
1340      fi
1341    else
1342      cat >&2 <<_LT_EOF
1343$progname: Version mismatch error.  This is $PACKAGE $VERSION, revision $package_revision,
1344$progname: but the definition of this LT_INIT comes from revision $macro_revision.
1345$progname: You should recreate aclocal.m4 with macros from revision $package_revision
1346$progname: of $PACKAGE $VERSION and run autoconf again.
1347_LT_EOF
1348    fi
1349
1350    exit $EXIT_MISMATCH
1351  fi
1352}
1353
1354
1355## ----------- ##
1356##    Main.    ##
1357## ----------- ##
1358
1359$opt_help || {
1360  # Sanity checks first:
1361  func_check_version_match
1362
1363  if test "$build_libtool_libs" != yes && test "$build_old_libs" != yes; then
1364    func_fatal_configuration "not configured to build any kind of library"
1365  fi
1366
1367  test -z "$mode" && func_fatal_error "error: you must specify a MODE."
1368
1369
1370  # Darwin sucks
1371  eval std_shrext=\"$shrext_cmds\"
1372
1373