build-scripts/ltmain.sh
author Sam Lantinga <slouken@libsdl.org>
Wed, 26 Jan 2011 12:26:27 -0800
branchSDL-1.2
changeset 5101 3500563bb2f8
parent 4277 803eeeeaa8a0
permissions -rw-r--r--
Ozkan Sezer to slouken The attached small patch updates SDL's libtoolized files for pe-x86_64 magic, ie win/x64.
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
4277
803eeeeaa8a0 Updated libtool to version 2.2.6a
Sam Lantinga <slouken@libsdl.org>
parents: 1761
diff changeset
     1
# Generated from ltmain.m4sh.
803eeeeaa8a0 Updated libtool to version 2.2.6a
Sam Lantinga <slouken@libsdl.org>
parents: 1761
diff changeset
     2
803eeeeaa8a0 Updated libtool to version 2.2.6a
Sam Lantinga <slouken@libsdl.org>
parents: 1761
diff changeset
     3
# ltmain.sh (GNU libtool) 2.2.6
803eeeeaa8a0 Updated libtool to version 2.2.6a
Sam Lantinga <slouken@libsdl.org>
parents: 1761
diff changeset
     4
# Written by Gordon Matzigkeit <gord@gnu.ai.mit.edu>, 1996
803eeeeaa8a0 Updated libtool to version 2.2.6a
Sam Lantinga <slouken@libsdl.org>
parents: 1761
diff changeset
     5
803eeeeaa8a0 Updated libtool to version 2.2.6a
Sam Lantinga <slouken@libsdl.org>
parents: 1761
diff changeset
     6
# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005, 2006, 2007 2008 Free Software Foundation, Inc.
803eeeeaa8a0 Updated libtool to version 2.2.6a
Sam Lantinga <slouken@libsdl.org>
parents: 1761
diff changeset
     7
# This is free software; see the source for copying conditions.  There is NO
803eeeeaa8a0 Updated libtool to version 2.2.6a
Sam Lantinga <slouken@libsdl.org>
parents: 1761
diff changeset
     8
# warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
803eeeeaa8a0 Updated libtool to version 2.2.6a
Sam Lantinga <slouken@libsdl.org>
parents: 1761
diff changeset
     9
803eeeeaa8a0 Updated libtool to version 2.2.6a
Sam Lantinga <slouken@libsdl.org>
parents: 1761
diff changeset
    10
# GNU Libtool is free software; you can redistribute it and/or modify
1361
19418e4422cb New configure-based build system. Still work in progress, but much improved
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
    11
# it under the terms of the GNU General Public License as published by
19418e4422cb New configure-based build system. Still work in progress, but much improved
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
    12
# the Free Software Foundation; either version 2 of the License, or
19418e4422cb New configure-based build system. Still work in progress, but much improved
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
    13
# (at your option) any later version.
19418e4422cb New configure-based build system. Still work in progress, but much improved
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
    14
#
4277
803eeeeaa8a0 Updated libtool to version 2.2.6a
Sam Lantinga <slouken@libsdl.org>
parents: 1761
diff changeset
    15
# As a special exception to the GNU General Public License,
803eeeeaa8a0 Updated libtool to version 2.2.6a
Sam Lantinga <slouken@libsdl.org>
parents: 1761
diff changeset
    16
# if you distribute this file as part of a program or library that
803eeeeaa8a0 Updated libtool to version 2.2.6a
Sam Lantinga <slouken@libsdl.org>
parents: 1761
diff changeset
    17
# is built using GNU Libtool, you may include this file under the
803eeeeaa8a0 Updated libtool to version 2.2.6a
Sam Lantinga <slouken@libsdl.org>
parents: 1761
diff changeset
    18
# same distribution terms that you use for the rest of that program.
803eeeeaa8a0 Updated libtool to version 2.2.6a
Sam Lantinga <slouken@libsdl.org>
parents: 1761
diff changeset
    19
#
803eeeeaa8a0 Updated libtool to version 2.2.6a
Sam Lantinga <slouken@libsdl.org>
parents: 1761
diff changeset
    20
# GNU Libtool is distributed in the hope that it will be useful, but
1361
19418e4422cb New configure-based build system. Still work in progress, but much improved
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
    21
# WITHOUT ANY WARRANTY; without even the implied warranty of
19418e4422cb New configure-based build system. Still work in progress, but much improved
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
    22
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
19418e4422cb New configure-based build system. Still work in progress, but much improved
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
    23
# General Public License for more details.
19418e4422cb New configure-based build system. Still work in progress, but much improved
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
    24
#
19418e4422cb New configure-based build system. Still work in progress, but much improved
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
    25
# You should have received a copy of the GNU General Public License
4277
803eeeeaa8a0 Updated libtool to version 2.2.6a
Sam Lantinga <slouken@libsdl.org>
parents: 1761
diff changeset
    26
# along with GNU Libtool; see the file COPYING.  If not, a copy
803eeeeaa8a0 Updated libtool to version 2.2.6a
Sam Lantinga <slouken@libsdl.org>
parents: 1761
diff changeset
    27
# can be downloaded from http://www.gnu.org/licenses/gpl.html,
803eeeeaa8a0 Updated libtool to version 2.2.6a
Sam Lantinga <slouken@libsdl.org>
parents: 1761
diff changeset
    28
# or obtained by writing to the Free Software Foundation, Inc.,
803eeeeaa8a0 Updated libtool to version 2.2.6a
Sam Lantinga <slouken@libsdl.org>
parents: 1761
diff changeset
    29
# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
803eeeeaa8a0 Updated libtool to version 2.2.6a
Sam Lantinga <slouken@libsdl.org>
parents: 1761
diff changeset
    30
803eeeeaa8a0 Updated libtool to version 2.2.6a
Sam Lantinga <slouken@libsdl.org>
parents: 1761
diff changeset
    31
# Usage: $progname [OPTION]... [MODE-ARG]...
803eeeeaa8a0 Updated libtool to version 2.2.6a
Sam Lantinga <slouken@libsdl.org>
parents: 1761
diff changeset
    32
#
803eeeeaa8a0 Updated libtool to version 2.2.6a
Sam Lantinga <slouken@libsdl.org>
parents: 1761
diff changeset
    33
# Provide generalized library-building support services.
803eeeeaa8a0 Updated libtool to version 2.2.6a
Sam Lantinga <slouken@libsdl.org>
parents: 1761
diff changeset
    34
#
803eeeeaa8a0 Updated libtool to version 2.2.6a
Sam Lantinga <slouken@libsdl.org>
parents: 1761
diff changeset
    35
#     --config             show all configuration variables
803eeeeaa8a0 Updated libtool to version 2.2.6a
Sam Lantinga <slouken@libsdl.org>
parents: 1761
diff changeset
    36
#     --debug              enable verbose shell tracing
803eeeeaa8a0 Updated libtool to version 2.2.6a
Sam Lantinga <slouken@libsdl.org>
parents: 1761
diff changeset
    37
# -n, --dry-run            display commands without modifying any files
803eeeeaa8a0 Updated libtool to version 2.2.6a
Sam Lantinga <slouken@libsdl.org>
parents: 1761
diff changeset
    38
#     --features           display basic configuration information and exit
803eeeeaa8a0 Updated libtool to version 2.2.6a
Sam Lantinga <slouken@libsdl.org>
parents: 1761
diff changeset
    39
#     --mode=MODE          use operation mode MODE
803eeeeaa8a0 Updated libtool to version 2.2.6a
Sam Lantinga <slouken@libsdl.org>
parents: 1761
diff changeset
    40
#     --preserve-dup-deps  don't remove duplicate dependency libraries
803eeeeaa8a0 Updated libtool to version 2.2.6a
Sam Lantinga <slouken@libsdl.org>
parents: 1761
diff changeset
    41
#     --quiet, --silent    don't print informational messages
803eeeeaa8a0 Updated libtool to version 2.2.6a
Sam Lantinga <slouken@libsdl.org>
parents: 1761
diff changeset
    42
#     --tag=TAG            use configuration variables from tag TAG
803eeeeaa8a0 Updated libtool to version 2.2.6a
Sam Lantinga <slouken@libsdl.org>
parents: 1761
diff changeset
    43
# -v, --verbose            print informational messages (default)
803eeeeaa8a0 Updated libtool to version 2.2.6a
Sam Lantinga <slouken@libsdl.org>
parents: 1761
diff changeset
    44
#     --version            print version information
803eeeeaa8a0 Updated libtool to version 2.2.6a
Sam Lantinga <slouken@libsdl.org>
parents: 1761
diff changeset
    45
# -h, --help               print short or long help message
803eeeeaa8a0 Updated libtool to version 2.2.6a
Sam Lantinga <slouken@libsdl.org>
parents: 1761
diff changeset
    46
#
803eeeeaa8a0 Updated libtool to version 2.2.6a
Sam Lantinga <slouken@libsdl.org>
parents: 1761
diff changeset
    47
# MODE must be one of the following:
803eeeeaa8a0 Updated libtool to version 2.2.6a
Sam Lantinga <slouken@libsdl.org>
parents: 1761
diff changeset
    48
#
803eeeeaa8a0 Updated libtool to version 2.2.6a
Sam Lantinga <slouken@libsdl.org>
parents: 1761
diff changeset
    49
#       clean              remove files from the build directory
803eeeeaa8a0 Updated libtool to version 2.2.6a
Sam Lantinga <slouken@libsdl.org>
parents: 1761
diff changeset
    50
#       compile            compile a source file into a libtool object
803eeeeaa8a0 Updated libtool to version 2.2.6a
Sam Lantinga <slouken@libsdl.org>
parents: 1761
diff changeset
    51
#       execute            automatically set library path, then run a program
803eeeeaa8a0 Updated libtool to version 2.2.6a
Sam Lantinga <slouken@libsdl.org>
parents: 1761
diff changeset
    52
#       finish             complete the installation of libtool libraries
803eeeeaa8a0 Updated libtool to version 2.2.6a
Sam Lantinga <slouken@libsdl.org>
parents: 1761
diff changeset
    53
#       install            install libraries or executables
803eeeeaa8a0 Updated libtool to version 2.2.6a
Sam Lantinga <slouken@libsdl.org>
parents: 1761
diff changeset
    54
#       link               create a library or an executable
803eeeeaa8a0 Updated libtool to version 2.2.6a
Sam Lantinga <slouken@libsdl.org>
parents: 1761
diff changeset
    55
#       uninstall          remove libraries from an installed directory
803eeeeaa8a0 Updated libtool to version 2.2.6a
Sam Lantinga <slouken@libsdl.org>
parents: 1761
diff changeset
    56
#
803eeeeaa8a0 Updated libtool to version 2.2.6a
Sam Lantinga <slouken@libsdl.org>
parents: 1761
diff changeset
    57
# MODE-ARGS vary depending on the MODE.
803eeeeaa8a0 Updated libtool to version 2.2.6a
Sam Lantinga <slouken@libsdl.org>
parents: 1761
diff changeset
    58
# Try `$progname --help --mode=MODE' for a more detailed description of MODE.
803eeeeaa8a0 Updated libtool to version 2.2.6a
Sam Lantinga <slouken@libsdl.org>
parents: 1761
diff changeset
    59
#
803eeeeaa8a0 Updated libtool to version 2.2.6a
Sam Lantinga <slouken@libsdl.org>
parents: 1761
diff changeset
    60
# When reporting a bug, please describe a test case to reproduce it and
803eeeeaa8a0 Updated libtool to version 2.2.6a
Sam Lantinga <slouken@libsdl.org>
parents: 1761
diff changeset
    61
# include the following information:
803eeeeaa8a0 Updated libtool to version 2.2.6a
Sam Lantinga <slouken@libsdl.org>
parents: 1761
diff changeset
    62
#
803eeeeaa8a0 Updated libtool to version 2.2.6a
Sam Lantinga <slouken@libsdl.org>
parents: 1761
diff changeset
    63
#       host-triplet:	$host
803eeeeaa8a0 Updated libtool to version 2.2.6a
Sam Lantinga <slouken@libsdl.org>
parents: 1761
diff changeset
    64
#       shell:		$SHELL
803eeeeaa8a0 Updated libtool to version 2.2.6a
Sam Lantinga <slouken@libsdl.org>
parents: 1761
diff changeset
    65
#       compiler:		$LTCC
803eeeeaa8a0 Updated libtool to version 2.2.6a
Sam Lantinga <slouken@libsdl.org>
parents: 1761
diff changeset
    66
#       compiler flags:		$LTCFLAGS
803eeeeaa8a0 Updated libtool to version 2.2.6a
Sam Lantinga <slouken@libsdl.org>
parents: 1761
diff changeset
    67
#       linker:		$LD (gnu? $with_gnu_ld)
803eeeeaa8a0 Updated libtool to version 2.2.6a
Sam Lantinga <slouken@libsdl.org>
parents: 1761
diff changeset
    68
#       $progname:		(GNU libtool) 2.2.6
803eeeeaa8a0 Updated libtool to version 2.2.6a
Sam Lantinga <slouken@libsdl.org>
parents: 1761
diff changeset
    69
#       automake:		$automake_version
803eeeeaa8a0 Updated libtool to version 2.2.6a
Sam Lantinga <slouken@libsdl.org>
parents: 1761
diff changeset
    70
#       autoconf:		$autoconf_version
1361
19418e4422cb New configure-based build system. Still work in progress, but much improved
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
    71
#
4277
803eeeeaa8a0 Updated libtool to version 2.2.6a
Sam Lantinga <slouken@libsdl.org>
parents: 1761
diff changeset
    72
# Report bugs to <bug-libtool@gnu.org>.
803eeeeaa8a0 Updated libtool to version 2.2.6a
Sam Lantinga <slouken@libsdl.org>
parents: 1761
diff changeset
    73
803eeeeaa8a0 Updated libtool to version 2.2.6a
Sam Lantinga <slouken@libsdl.org>
parents: 1761
diff changeset
    74
PROGRAM=ltmain.sh
803eeeeaa8a0 Updated libtool to version 2.2.6a
Sam Lantinga <slouken@libsdl.org>
parents: 1761
diff changeset
    75
PACKAGE=libtool
803eeeeaa8a0 Updated libtool to version 2.2.6a
Sam Lantinga <slouken@libsdl.org>
parents: 1761
diff changeset
    76
VERSION=2.2.6
803eeeeaa8a0 Updated libtool to version 2.2.6a
Sam Lantinga <slouken@libsdl.org>
parents: 1761
diff changeset
    77
TIMESTAMP=""
803eeeeaa8a0 Updated libtool to version 2.2.6a
Sam Lantinga <slouken@libsdl.org>
parents: 1761
diff changeset
    78
package_revision=1.3012
803eeeeaa8a0 Updated libtool to version 2.2.6a
Sam Lantinga <slouken@libsdl.org>
parents: 1761
diff changeset
    79
803eeeeaa8a0 Updated libtool to version 2.2.6a
Sam Lantinga <slouken@libsdl.org>
parents: 1761
diff changeset
    80
# Be Bourne compatible
803eeeeaa8a0 Updated libtool to version 2.2.6a
Sam Lantinga <slouken@libsdl.org>
parents: 1761
diff changeset
    81
if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then
803eeeeaa8a0 Updated libtool to version 2.2.6a
Sam Lantinga <slouken@libsdl.org>
parents: 1761
diff changeset
    82
  emulate sh
803eeeeaa8a0 Updated libtool to version 2.2.6a
Sam Lantinga <slouken@libsdl.org>
parents: 1761
diff changeset
    83
  NULLCMD=:
803eeeeaa8a0 Updated libtool to version 2.2.6a
Sam Lantinga <slouken@libsdl.org>
parents: 1761
diff changeset
    84
  # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which
803eeeeaa8a0 Updated libtool to version 2.2.6a
Sam Lantinga <slouken@libsdl.org>
parents: 1761
diff changeset
    85
  # is contrary to our usage.  Disable this feature.
803eeeeaa8a0 Updated libtool to version 2.2.6a
Sam Lantinga <slouken@libsdl.org>
parents: 1761
diff changeset
    86
  alias -g '${1+"$@"}'='"$@"'
803eeeeaa8a0 Updated libtool to version 2.2.6a
Sam Lantinga <slouken@libsdl.org>
parents: 1761
diff changeset
    87
  setopt NO_GLOB_SUBST
803eeeeaa8a0 Updated libtool to version 2.2.6a
Sam Lantinga <slouken@libsdl.org>
parents: 1761
diff changeset
    88
else
803eeeeaa8a0 Updated libtool to version 2.2.6a
Sam Lantinga <slouken@libsdl.org>
parents: 1761
diff changeset
    89
  case `(set -o) 2>/dev/null` in *posix*) set -o posix;; esac
803eeeeaa8a0 Updated libtool to version 2.2.6a
Sam Lantinga <slouken@libsdl.org>
parents: 1761
diff changeset
    90
fi
803eeeeaa8a0 Updated libtool to version 2.2.6a
Sam Lantinga <slouken@libsdl.org>
parents: 1761
diff changeset
    91
BIN_SH=xpg4; export BIN_SH # for Tru64
803eeeeaa8a0 Updated libtool to version 2.2.6a
Sam Lantinga <slouken@libsdl.org>
parents: 1761
diff changeset
    92
DUALCASE=1; export DUALCASE # for MKS sh
803eeeeaa8a0 Updated libtool to version 2.2.6a
Sam Lantinga <slouken@libsdl.org>
parents: 1761
diff changeset
    93
803eeeeaa8a0 Updated libtool to version 2.2.6a
Sam Lantinga <slouken@libsdl.org>
parents: 1761
diff changeset
    94
# NLS nuisances: We save the old values to restore during execute mode.
803eeeeaa8a0 Updated libtool to version 2.2.6a
Sam Lantinga <slouken@libsdl.org>
parents: 1761
diff changeset
    95
# Only set LANG and LC_ALL to C if already set.
803eeeeaa8a0 Updated libtool to version 2.2.6a
Sam Lantinga <slouken@libsdl.org>
parents: 1761
diff changeset
    96
# These must not be set unconditionally because not all systems understand
803eeeeaa8a0 Updated libtool to version 2.2.6a
Sam Lantinga <slouken@libsdl.org>
parents: 1761
diff changeset
    97
# e.g. LANG=C (notably SCO).
803eeeeaa8a0 Updated libtool to version 2.2.6a
Sam Lantinga <slouken@libsdl.org>
parents: 1761
diff changeset
    98
lt_user_locale=
803eeeeaa8a0 Updated libtool to version 2.2.6a
Sam Lantinga <slouken@libsdl.org>
parents: 1761
diff changeset
    99
lt_safe_locale=
803eeeeaa8a0 Updated libtool to version 2.2.6a
Sam Lantinga <slouken@libsdl.org>
parents: 1761
diff changeset
   100
for lt_var in LANG LANGUAGE LC_ALL LC_CTYPE LC_COLLATE LC_MESSAGES
803eeeeaa8a0 Updated libtool to version 2.2.6a
Sam Lantinga <slouken@libsdl.org>
parents: 1761
diff changeset
   101
do
803eeeeaa8a0 Updated libtool to version 2.2.6a
Sam Lantinga <slouken@libsdl.org>
parents: 1761
diff changeset
   102
  eval "if test \"\${$lt_var+set}\" = set; then
803eeeeaa8a0 Updated libtool to version 2.2.6a
Sam Lantinga <slouken@libsdl.org>
parents: 1761
diff changeset
   103
          save_$lt_var=\$$lt_var
803eeeeaa8a0 Updated libtool to version 2.2.6a
Sam Lantinga <slouken@libsdl.org>
parents: 1761
diff changeset
   104
          $lt_var=C
803eeeeaa8a0 Updated libtool to version 2.2.6a
Sam Lantinga <slouken@libsdl.org>
parents: 1761
diff changeset
   105
	  export $lt_var
803eeeeaa8a0 Updated libtool to version 2.2.6a
Sam Lantinga <slouken@libsdl.org>
parents: 1761
diff changeset
   106
	  lt_user_locale=\"$lt_var=\\\$save_\$lt_var; \$lt_user_locale\"
803eeeeaa8a0 Updated libtool to version 2.2.6a
Sam Lantinga <slouken@libsdl.org>
parents: 1761
diff changeset
   107
	  lt_safe_locale=\"$lt_var=C; \$lt_safe_locale\"
803eeeeaa8a0 Updated libtool to version 2.2.6a
Sam Lantinga <slouken@libsdl.org>
parents: 1761
diff changeset
   108
	fi"
803eeeeaa8a0 Updated libtool to version 2.2.6a
Sam Lantinga <slouken@libsdl.org>
parents: 1761
diff changeset
   109
done
803eeeeaa8a0 Updated libtool to version 2.2.6a
Sam Lantinga <slouken@libsdl.org>
parents: 1761
diff changeset
   110
803eeeeaa8a0 Updated libtool to version 2.2.6a
Sam Lantinga <slouken@libsdl.org>
parents: 1761
diff changeset
   111
$lt_unset CDPATH
803eeeeaa8a0 Updated libtool to version 2.2.6a
Sam Lantinga <slouken@libsdl.org>
parents: 1761
diff changeset
   112
803eeeeaa8a0 Updated libtool to version 2.2.6a
Sam Lantinga <slouken@libsdl.org>
parents: 1761
diff changeset
   113
803eeeeaa8a0 Updated libtool to version 2.2.6a
Sam Lantinga <slouken@libsdl.org>
parents: 1761
diff changeset
   114
803eeeeaa8a0 Updated libtool to version 2.2.6a
Sam Lantinga <slouken@libsdl.org>
parents: 1761
diff changeset
   115
803eeeeaa8a0 Updated libtool to version 2.2.6a
Sam Lantinga <slouken@libsdl.org>
parents: 1761
diff changeset
   116
803eeeeaa8a0 Updated libtool to version 2.2.6a
Sam Lantinga <slouken@libsdl.org>
parents: 1761
diff changeset
   117
: ${CP="cp -f"}
803eeeeaa8a0 Updated libtool to version 2.2.6a
Sam Lantinga <slouken@libsdl.org>
parents: 1761
diff changeset
   118
: ${ECHO="echo"}
803eeeeaa8a0 Updated libtool to version 2.2.6a
Sam Lantinga <slouken@libsdl.org>
parents: 1761
diff changeset
   119
: ${EGREP="/usr/bin/grep -E"}
803eeeeaa8a0 Updated libtool to version 2.2.6a
Sam Lantinga <slouken@libsdl.org>
parents: 1761
diff changeset
   120
: ${FGREP="/usr/bin/grep -F"}
803eeeeaa8a0 Updated libtool to version 2.2.6a
Sam Lantinga <slouken@libsdl.org>
parents: 1761
diff changeset
   121
: ${GREP="/usr/bin/grep"}
803eeeeaa8a0 Updated libtool to version 2.2.6a
Sam Lantinga <slouken@libsdl.org>
parents: 1761
diff changeset
   122
: ${LN_S="ln -s"}
803eeeeaa8a0 Updated libtool to version 2.2.6a
Sam Lantinga <slouken@libsdl.org>
parents: 1761
diff changeset
   123
: ${MAKE="make"}
803eeeeaa8a0 Updated libtool to version 2.2.6a
Sam Lantinga <slouken@libsdl.org>
parents: 1761
diff changeset
   124
: ${MKDIR="mkdir"}
803eeeeaa8a0 Updated libtool to version 2.2.6a
Sam Lantinga <slouken@libsdl.org>
parents: 1761
diff changeset
   125
: ${MV="mv -f"}
803eeeeaa8a0 Updated libtool to version 2.2.6a
Sam Lantinga <slouken@libsdl.org>
parents: 1761
diff changeset
   126
: ${RM="rm -f"}
803eeeeaa8a0 Updated libtool to version 2.2.6a
Sam Lantinga <slouken@libsdl.org>
parents: 1761
diff changeset
   127
: ${SED="/opt/local/bin/gsed"}
803eeeeaa8a0 Updated libtool to version 2.2.6a
Sam Lantinga <slouken@libsdl.org>
parents: 1761
diff changeset
   128
: ${SHELL="${CONFIG_SHELL-/bin/sh}"}
803eeeeaa8a0 Updated libtool to version 2.2.6a
Sam Lantinga <slouken@libsdl.org>
parents: 1761
diff changeset
   129
: ${Xsed="$SED -e 1s/^X//"}
803eeeeaa8a0 Updated libtool to version 2.2.6a
Sam Lantinga <slouken@libsdl.org>
parents: 1761
diff changeset
   130
803eeeeaa8a0 Updated libtool to version 2.2.6a
Sam Lantinga <slouken@libsdl.org>
parents: 1761
diff changeset
   131
# Global variables:
803eeeeaa8a0 Updated libtool to version 2.2.6a
Sam Lantinga <slouken@libsdl.org>
parents: 1761
diff changeset
   132
EXIT_SUCCESS=0
803eeeeaa8a0 Updated libtool to version 2.2.6a
Sam Lantinga <slouken@libsdl.org>
parents: 1761
diff changeset
   133
EXIT_FAILURE=1
803eeeeaa8a0 Updated libtool to version 2.2.6a
Sam Lantinga <slouken@libsdl.org>
parents: 1761
diff changeset
   134
EXIT_MISMATCH=63  # $? = 63 is used to indicate version mismatch to missing.
803eeeeaa8a0 Updated libtool to version 2.2.6a
Sam Lantinga <slouken@libsdl.org>
parents: 1761
diff changeset
   135
EXIT_SKIP=77	  # $? = 77 is used to indicate a skipped test to automake.
803eeeeaa8a0 Updated libtool to version 2.2.6a
Sam Lantinga <slouken@libsdl.org>
parents: 1761
diff changeset
   136
803eeeeaa8a0 Updated libtool to version 2.2.6a
Sam Lantinga <slouken@libsdl.org>
parents: 1761
diff changeset
   137
exit_status=$EXIT_SUCCESS
803eeeeaa8a0 Updated libtool to version 2.2.6a
Sam Lantinga <slouken@libsdl.org>
parents: 1761
diff changeset
   138
803eeeeaa8a0 Updated libtool to version 2.2.6a
Sam Lantinga <slouken@libsdl.org>
parents: 1761
diff changeset
   139
# Make sure IFS has a sensible default
803eeeeaa8a0 Updated libtool to version 2.2.6a
Sam Lantinga <slouken@libsdl.org>
parents: 1761
diff changeset
   140
lt_nl='
803eeeeaa8a0 Updated libtool to version 2.2.6a
Sam Lantinga <slouken@libsdl.org>
parents: 1761
diff changeset
   141
'
803eeeeaa8a0 Updated libtool to version 2.2.6a
Sam Lantinga <slouken@libsdl.org>
parents: 1761
diff changeset
   142
IFS=" 	$lt_nl"
803eeeeaa8a0 Updated libtool to version 2.2.6a
Sam Lantinga <slouken@libsdl.org>
parents: 1761
diff changeset
   143
803eeeeaa8a0 Updated libtool to version 2.2.6a
Sam Lantinga <slouken@libsdl.org>
parents: 1761
diff changeset
   144
dirname="s,/[^/]*$,,"
803eeeeaa8a0 Updated libtool to version 2.2.6a
Sam Lantinga <slouken@libsdl.org>
parents: 1761
diff changeset
   145
basename="s,^.*/,,"
803eeeeaa8a0 Updated libtool to version 2.2.6a
Sam Lantinga <slouken@libsdl.org>
parents: 1761
diff changeset
   146
803eeeeaa8a0 Updated libtool to version 2.2.6a
Sam Lantinga <slouken@libsdl.org>
parents: 1761
diff changeset
   147
# func_dirname_and_basename file append nondir_replacement
803eeeeaa8a0 Updated libtool to version 2.2.6a
Sam Lantinga <slouken@libsdl.org>
parents: 1761
diff changeset
   148
# perform func_basename and func_dirname in a single function
803eeeeaa8a0 Updated libtool to version 2.2.6a
Sam Lantinga <slouken@libsdl.org>
parents: 1761
diff changeset
   149
# call:
803eeeeaa8a0 Updated libtool to version 2.2.6a
Sam Lantinga <slouken@libsdl.org>
parents: 1761
diff changeset
   150
#   dirname:  Compute the dirname of FILE.  If nonempty,
803eeeeaa8a0 Updated libtool to version 2.2.6a
Sam Lantinga <slouken@libsdl.org>
parents: 1761
diff changeset
   151
#             add APPEND to the result, otherwise set result
803eeeeaa8a0 Updated libtool to version 2.2.6a
Sam Lantinga <slouken@libsdl.org>
parents: 1761
diff changeset
   152
#             to NONDIR_REPLACEMENT.
803eeeeaa8a0 Updated libtool to version 2.2.6a
Sam Lantinga <slouken@libsdl.org>
parents: 1761
diff changeset
   153
#             value returned in "$func_dirname_result"
803eeeeaa8a0 Updated libtool to version 2.2.6a
Sam Lantinga <slouken@libsdl.org>
parents: 1761
diff changeset
   154
#   basename: Compute filename of FILE.
803eeeeaa8a0 Updated libtool to version 2.2.6a
Sam Lantinga <slouken@libsdl.org>
parents: 1761
diff changeset
   155
#             value retuned in "$func_basename_result"
803eeeeaa8a0 Updated libtool to version 2.2.6a
Sam Lantinga <slouken@libsdl.org>
parents: 1761
diff changeset
   156
# Implementation must be kept synchronized with func_dirname
803eeeeaa8a0 Updated libtool to version 2.2.6a
Sam Lantinga <slouken@libsdl.org>
parents: 1761
diff changeset
   157
# and func_basename. For efficiency, we do not delegate to
803eeeeaa8a0 Updated libtool to version 2.2.6a
Sam Lantinga <slouken@libsdl.org>
parents: 1761
diff changeset
   158
# those functions but instead duplicate the functionality here.
803eeeeaa8a0 Updated libtool to version 2.2.6a
Sam Lantinga <slouken@libsdl.org>
parents: 1761
diff changeset
   159
func_dirname_and_basename ()
803eeeeaa8a0 Updated libtool to version 2.2.6a
Sam Lantinga <slouken@libsdl.org>
parents: 1761
diff changeset
   160
{
803eeeeaa8a0 Updated libtool to version 2.2.6a
Sam Lantinga <slouken@libsdl.org>
parents: 1761
diff changeset
   161
  # Extract subdirectory from the argument.
803eeeeaa8a0 Updated libtool to version 2.2.6a
Sam Lantinga <slouken@libsdl.org>
parents: 1761
diff changeset
   162
  func_dirname_result=`$ECHO "X${1}" | $Xsed -e "$dirname"`
803eeeeaa8a0 Updated libtool to version 2.2.6a
Sam Lantinga <slouken@libsdl.org>
parents: 1761
diff changeset
   163
  if test "X$func_dirname_result" = "X${1}"; then
803eeeeaa8a0 Updated libtool to version 2.2.6a
Sam Lantinga <slouken@libsdl.org>
parents: 1761
diff changeset
   164
    func_dirname_result="${3}"
803eeeeaa8a0 Updated libtool to version 2.2.6a
Sam Lantinga <slouken@libsdl.org>
parents: 1761
diff changeset
   165
  else
803eeeeaa8a0 Updated libtool to version 2.2.6a
Sam Lantinga <slouken@libsdl.org>
parents: 1761
diff changeset
   166
    func_dirname_result="$func_dirname_result${2}"
803eeeeaa8a0 Updated libtool to version 2.2.6a
Sam Lantinga <slouken@libsdl.org>
parents: 1761
diff changeset
   167
  fi
803eeeeaa8a0 Updated libtool to version 2.2.6a
Sam Lantinga <slouken@libsdl.org>
parents: 1761
diff changeset
   168
  func_basename_result=`$ECHO "X${1}" | $Xsed -e "$basename"`
803eeeeaa8a0 Updated libtool to version 2.2.6a
Sam Lantinga <slouken@libsdl.org>
parents: 1761
diff changeset
   169
}
803eeeeaa8a0 Updated libtool to version 2.2.6a
Sam Lantinga <slouken@libsdl.org>
parents: 1761
diff changeset
   170
803eeeeaa8a0 Updated libtool to version 2.2.6a
Sam Lantinga <slouken@libsdl.org>
parents: 1761
diff changeset
   171
# Generated shell functions inserted here.
1361
19418e4422cb New configure-based build system. Still work in progress, but much improved
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   172
19418e4422cb New configure-based build system. Still work in progress, but much improved
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   173
# Work around backward compatibility issue on IRIX 6.5. On IRIX 6.4+, sh
19418e4422cb New configure-based build system. Still work in progress, but much improved
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   174
# is ksh but when the shell is invoked as "sh" and the current value of
19418e4422cb New configure-based build system. Still work in progress, but much improved
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   175
# the _XPG environment variable is not equal to 1 (one), the special
19418e4422cb New configure-based build system. Still work in progress, but much improved
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   176
# positional parameter $0, within a function call, is the name of the
19418e4422cb New configure-based build system. Still work in progress, but much improved
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   177
# function.
19418e4422cb New configure-based build system. Still work in progress, but much improved
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   178
progpath="$0"
19418e4422cb New configure-based build system. Still work in progress, but much improved
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   179
19418e4422cb New configure-based build system. Still work in progress, but much improved
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   180
# The name of this program:
4277
803eeeeaa8a0 Updated libtool to version 2.2.6a
Sam Lantinga <slouken@libsdl.org>
parents: 1761
diff changeset
   181
# In the unlikely event $progname began with a '-', it would play havoc with
803eeeeaa8a0 Updated libtool to version 2.2.6a
Sam Lantinga <slouken@libsdl.org>
parents: 1761
diff changeset
   182
# func_echo (imagine progname=-n), so we prepend ./ in that case:
803eeeeaa8a0 Updated libtool to version 2.2.6a
Sam Lantinga <slouken@libsdl.org>
parents: 1761
diff changeset
   183
func_dirname_and_basename "$progpath"
803eeeeaa8a0 Updated libtool to version 2.2.6a
Sam Lantinga <slouken@libsdl.org>
parents: 1761
diff changeset
   184
progname=$func_basename_result
803eeeeaa8a0 Updated libtool to version 2.2.6a
Sam Lantinga <slouken@libsdl.org>
parents: 1761
diff changeset
   185
case $progname in
803eeeeaa8a0 Updated libtool to version 2.2.6a
Sam Lantinga <slouken@libsdl.org>
parents: 1761
diff changeset
   186
  -*) progname=./$progname ;;
803eeeeaa8a0 Updated libtool to version 2.2.6a
Sam Lantinga <slouken@libsdl.org>
parents: 1761
diff changeset
   187
esac
803eeeeaa8a0 Updated libtool to version 2.2.6a
Sam Lantinga <slouken@libsdl.org>
parents: 1761
diff changeset
   188
803eeeeaa8a0 Updated libtool to version 2.2.6a
Sam Lantinga <slouken@libsdl.org>
parents: 1761
diff changeset
   189
# Make sure we have an absolute path for reexecution:
803eeeeaa8a0 Updated libtool to version 2.2.6a
Sam Lantinga <slouken@libsdl.org>
parents: 1761
diff changeset
   190
case $progpath in
803eeeeaa8a0 Updated libtool to version 2.2.6a
Sam Lantinga <slouken@libsdl.org>
parents: 1761
diff changeset
   191
  [\\/]*|[A-Za-z]:\\*) ;;
803eeeeaa8a0 Updated libtool to version 2.2.6a
Sam Lantinga <slouken@libsdl.org>
parents: 1761
diff changeset
   192
  *[\\/]*)
803eeeeaa8a0 Updated libtool to version 2.2.6a
Sam Lantinga <slouken@libsdl.org>
parents: 1761
diff changeset
   193
     progdir=$func_dirname_result
803eeeeaa8a0 Updated libtool to version 2.2.6a
Sam Lantinga <slouken@libsdl.org>
parents: 1761
diff changeset
   194
     progdir=`cd "$progdir" && pwd`
803eeeeaa8a0 Updated libtool to version 2.2.6a
Sam Lantinga <slouken@libsdl.org>
parents: 1761
diff changeset
   195
     progpath="$progdir/$progname"
803eeeeaa8a0 Updated libtool to version 2.2.6a
Sam Lantinga <slouken@libsdl.org>
parents: 1761
diff changeset
   196
     ;;
803eeeeaa8a0 Updated libtool to version 2.2.6a
Sam Lantinga <slouken@libsdl.org>
parents: 1761
diff changeset
   197
  *)
803eeeeaa8a0 Updated libtool to version 2.2.6a
Sam Lantinga <slouken@libsdl.org>
parents: 1761
diff changeset
   198
     save_IFS="$IFS"
803eeeeaa8a0 Updated libtool to version 2.2.6a
Sam Lantinga <slouken@libsdl.org>
parents: 1761
diff changeset
   199
     IFS=:
803eeeeaa8a0 Updated libtool to version 2.2.6a
Sam Lantinga <slouken@libsdl.org>
parents: 1761
diff changeset
   200
     for progdir in $PATH; do
803eeeeaa8a0 Updated libtool to version 2.2.6a
Sam Lantinga <slouken@libsdl.org>
parents: 1761
diff changeset
   201
       IFS="$save_IFS"
803eeeeaa8a0 Updated libtool to version 2.2.6a
Sam Lantinga <slouken@libsdl.org>
parents: 1761
diff changeset
   202
       test -x "$progdir/$progname" && break
803eeeeaa8a0 Updated libtool to version 2.2.6a
Sam Lantinga <slouken@libsdl.org>
parents: 1761
diff changeset
   203
     done
803eeeeaa8a0 Updated libtool to version 2.2.6a
Sam Lantinga <slouken@libsdl.org>
parents: 1761
diff changeset
   204
     IFS="$save_IFS"
803eeeeaa8a0 Updated libtool to version 2.2.6a
Sam Lantinga <slouken@libsdl.org>
parents: 1761
diff changeset
   205
     test -n "$progdir" || progdir=`pwd`
803eeeeaa8a0 Updated libtool to version 2.2.6a
Sam Lantinga <slouken@libsdl.org>
parents: 1761
diff changeset
   206
     progpath="$progdir/$progname"
803eeeeaa8a0 Updated libtool to version 2.2.6a
Sam Lantinga <slouken@libsdl.org>
parents: 1761
diff changeset
   207
     ;;
803eeeeaa8a0 Updated libtool to version 2.2.6a
Sam Lantinga <slouken@libsdl.org>
parents: 1761
diff changeset
   208
esac
803eeeeaa8a0 Updated libtool to version 2.2.6a
Sam Lantinga <slouken@libsdl.org>
parents: 1761
diff changeset
   209
803eeeeaa8a0 Updated libtool to version 2.2.6a
Sam Lantinga <slouken@libsdl.org>
parents: 1761
diff changeset
   210
# Sed substitution that helps us do robust quoting.  It backslashifies
803eeeeaa8a0 Updated libtool to version 2.2.6a
Sam Lantinga <slouken@libsdl.org>
parents: 1761
diff changeset
   211
# metacharacters that are still active within double-quoted strings.
803eeeeaa8a0 Updated libtool to version 2.2.6a
Sam Lantinga <slouken@libsdl.org>
parents: 1761
diff changeset
   212
Xsed="${SED}"' -e 1s/^X//'
803eeeeaa8a0 Updated libtool to version 2.2.6a
Sam Lantinga <slouken@libsdl.org>
parents: 1761
diff changeset
   213
sed_quote_subst='s/\([`"$\\]\)/\\\1/g'
803eeeeaa8a0 Updated libtool to version 2.2.6a
Sam Lantinga <slouken@libsdl.org>
parents: 1761
diff changeset
   214
803eeeeaa8a0 Updated libtool to version 2.2.6a
Sam Lantinga <slouken@libsdl.org>
parents: 1761
diff changeset
   215
# Same as above, but do not quote variable references.
803eeeeaa8a0 Updated libtool to version 2.2.6a
Sam Lantinga <slouken@libsdl.org>
parents: 1761
diff changeset
   216
double_quote_subst='s/\(["`\\]\)/\\\1/g'
803eeeeaa8a0 Updated libtool to version 2.2.6a
Sam Lantinga <slouken@libsdl.org>
parents: 1761
diff changeset
   217
803eeeeaa8a0 Updated libtool to version 2.2.6a
Sam Lantinga <slouken@libsdl.org>
parents: 1761
diff changeset
   218
# Re-`\' parameter expansions in output of double_quote_subst that were
803eeeeaa8a0 Updated libtool to version 2.2.6a
Sam Lantinga <slouken@libsdl.org>
parents: 1761
diff changeset
   219
# `\'-ed in input to the same.  If an odd number of `\' preceded a '$'
803eeeeaa8a0 Updated libtool to version 2.2.6a
Sam Lantinga <slouken@libsdl.org>
parents: 1761
diff changeset
   220
# in input to double_quote_subst, that '$' was protected from expansion.
803eeeeaa8a0 Updated libtool to version 2.2.6a
Sam Lantinga <slouken@libsdl.org>
parents: 1761
diff changeset
   221
# Since each input `\' is now two `\'s, look for any number of runs of
803eeeeaa8a0 Updated libtool to version 2.2.6a
Sam Lantinga <slouken@libsdl.org>
parents: 1761
diff changeset
   222
# four `\'s followed by two `\'s and then a '$'.  `\' that '$'.
803eeeeaa8a0 Updated libtool to version 2.2.6a
Sam Lantinga <slouken@libsdl.org>
parents: 1761
diff changeset
   223
bs='\\'
803eeeeaa8a0 Updated libtool to version 2.2.6a
Sam Lantinga <slouken@libsdl.org>
parents: 1761
diff changeset
   224
bs2='\\\\'
803eeeeaa8a0 Updated libtool to version 2.2.6a
Sam Lantinga <slouken@libsdl.org>
parents: 1761
diff changeset
   225
bs4='\\\\\\\\'
803eeeeaa8a0 Updated libtool to version 2.2.6a
Sam Lantinga <slouken@libsdl.org>
parents: 1761
diff changeset
   226
dollar='\$'
803eeeeaa8a0 Updated libtool to version 2.2.6a
Sam Lantinga <slouken@libsdl.org>
parents: 1761
diff changeset
   227
sed_double_backslash="\
803eeeeaa8a0 Updated libtool to version 2.2.6a
Sam Lantinga <slouken@libsdl.org>
parents: 1761
diff changeset
   228
  s/$bs4/&\\
803eeeeaa8a0 Updated libtool to version 2.2.6a
Sam Lantinga <slouken@libsdl.org>
parents: 1761
diff changeset
   229
/g
803eeeeaa8a0 Updated libtool to version 2.2.6a
Sam Lantinga <slouken@libsdl.org>
parents: 1761
diff changeset
   230
  s/^$bs2$dollar/$bs&/
803eeeeaa8a0 Updated libtool to version 2.2.6a
Sam Lantinga <slouken@libsdl.org>
parents: 1761
diff changeset
   231
  s/\\([^$bs]\\)$bs2$dollar/\\1$bs2$bs$dollar/g
803eeeeaa8a0 Updated libtool to version 2.2.6a
Sam Lantinga <slouken@libsdl.org>
parents: 1761
diff changeset
   232
  s/\n//g"
803eeeeaa8a0 Updated libtool to version 2.2.6a
Sam Lantinga <slouken@libsdl.org>
parents: 1761
diff changeset
   233
803eeeeaa8a0 Updated libtool to version 2.2.6a
Sam Lantinga <slouken@libsdl.org>
parents: 1761
diff changeset
   234
# Standard options:
803eeeeaa8a0 Updated libtool to version 2.2.6a
Sam Lantinga <slouken@libsdl.org>
parents: 1761
diff changeset
   235
opt_dry_run=false
803eeeeaa8a0 Updated libtool to version 2.2.6a
Sam Lantinga <slouken@libsdl.org>
parents: 1761
diff changeset
   236
opt_help=false
803eeeeaa8a0 Updated libtool to version 2.2.6a
Sam Lantinga <slouken@libsdl.org>
parents: 1761
diff changeset
   237
opt_quiet=false
803eeeeaa8a0 Updated libtool to version 2.2.6a
Sam Lantinga <slouken@libsdl.org>
parents: 1761
diff changeset
   238
opt_verbose=false
803eeeeaa8a0 Updated libtool to version 2.2.6a
Sam Lantinga <slouken@libsdl.org>
parents: 1761
diff changeset
   239
opt_warning=:
803eeeeaa8a0 Updated libtool to version 2.2.6a
Sam Lantinga <slouken@libsdl.org>
parents: 1761
diff changeset
   240
803eeeeaa8a0 Updated libtool to version 2.2.6a
Sam Lantinga <slouken@libsdl.org>
parents: 1761
diff changeset
   241
# func_echo arg...
803eeeeaa8a0 Updated libtool to version 2.2.6a
Sam Lantinga <slouken@libsdl.org>
parents: 1761
diff changeset
   242
# Echo program name prefixed message, along with the current mode
803eeeeaa8a0 Updated libtool to version 2.2.6a
Sam Lantinga <slouken@libsdl.org>
parents: 1761
diff changeset
   243
# name if it has been set yet.
803eeeeaa8a0 Updated libtool to version 2.2.6a
Sam Lantinga <slouken@libsdl.org>
parents: 1761
diff changeset
   244
func_echo ()
803eeeeaa8a0 Updated libtool to version 2.2.6a
Sam Lantinga <slouken@libsdl.org>
parents: 1761
diff changeset
   245
{
803eeeeaa8a0 Updated libtool to version 2.2.6a
Sam Lantinga <slouken@libsdl.org>
parents: 1761
diff changeset
   246
    $ECHO "$progname${mode+: }$mode: $*"
803eeeeaa8a0 Updated libtool to version 2.2.6a
Sam Lantinga <slouken@libsdl.org>
parents: 1761
diff changeset
   247
}
803eeeeaa8a0 Updated libtool to version 2.2.6a
Sam Lantinga <slouken@libsdl.org>
parents: 1761
diff changeset
   248
803eeeeaa8a0 Updated libtool to version 2.2.6a
Sam Lantinga <slouken@libsdl.org>
parents: 1761
diff changeset
   249
# func_verbose arg...
803eeeeaa8a0 Updated libtool to version 2.2.6a
Sam Lantinga <slouken@libsdl.org>
parents: 1761
diff changeset
   250
# Echo program name prefixed message in verbose mode only.
803eeeeaa8a0 Updated libtool to version 2.2.6a
Sam Lantinga <slouken@libsdl.org>
parents: 1761
diff changeset
   251
func_verbose ()
803eeeeaa8a0 Updated libtool to version 2.2.6a
Sam Lantinga <slouken@libsdl.org>
parents: 1761
diff changeset
   252
{
803eeeeaa8a0 Updated libtool to version 2.2.6a
Sam Lantinga <slouken@libsdl.org>
parents: 1761
diff changeset
   253
    $opt_verbose && func_echo ${1+"$@"}
803eeeeaa8a0 Updated libtool to version 2.2.6a
Sam Lantinga <slouken@libsdl.org>
parents: 1761
diff changeset
   254
803eeeeaa8a0 Updated libtool to version 2.2.6a
Sam Lantinga <slouken@libsdl.org>
parents: 1761
diff changeset
   255
    # A bug in bash halts the script if the last line of a function
803eeeeaa8a0 Updated libtool to version 2.2.6a
Sam Lantinga <slouken@libsdl.org>
parents: 1761
diff changeset
   256
    # fails when set -e is in force, so we need another command to
803eeeeaa8a0 Updated libtool to version 2.2.6a
Sam Lantinga <slouken@libsdl.org>
parents: 1761
diff changeset
   257
    # work around that:
803eeeeaa8a0 Updated libtool to version 2.2.6a
Sam Lantinga <slouken@libsdl.org>
parents: 1761
diff changeset
   258
    :
803eeeeaa8a0 Updated libtool to version 2.2.6a
Sam Lantinga <slouken@libsdl.org>
parents: 1761
diff changeset
   259
}
803eeeeaa8a0 Updated libtool to version 2.2.6a
Sam Lantinga <slouken@libsdl.org>
parents: 1761
diff changeset
   260
803eeeeaa8a0 Updated libtool to version 2.2.6a
Sam Lantinga <slouken@libsdl.org>
parents: 1761
diff changeset
   261
# func_error arg...
803eeeeaa8a0 Updated libtool to version 2.2.6a
Sam Lantinga <slouken@libsdl.org>
parents: 1761
diff changeset
   262
# Echo program name prefixed message to standard error.
803eeeeaa8a0 Updated libtool to version 2.2.6a
Sam Lantinga <slouken@libsdl.org>
parents: 1761
diff changeset
   263
func_error ()
803eeeeaa8a0 Updated libtool to version 2.2.6a
Sam Lantinga <slouken@libsdl.org>
parents: 1761
diff changeset
   264
{
803eeeeaa8a0 Updated libtool to version 2.2.6a
Sam Lantinga <slouken@libsdl.org>
parents: 1761
diff changeset
   265
    $ECHO "$progname${mode+: }$mode: "${1+"$@"} 1>&2
803eeeeaa8a0 Updated libtool to version 2.2.6a
Sam Lantinga <slouken@libsdl.org>
parents: 1761
diff changeset
   266
}
803eeeeaa8a0 Updated libtool to version 2.2.6a
Sam Lantinga <slouken@libsdl.org>
parents: 1761
diff changeset
   267
803eeeeaa8a0 Updated libtool to version 2.2.6a
Sam Lantinga <slouken@libsdl.org>
parents: 1761
diff changeset
   268
# func_warning arg...
803eeeeaa8a0 Updated libtool to version 2.2.6a
Sam Lantinga <slouken@libsdl.org>
parents: 1761
diff changeset
   269
# Echo program name prefixed warning message to standard error.
803eeeeaa8a0 Updated libtool to version 2.2.6a
Sam Lantinga <slouken@libsdl.org>
parents: 1761
diff changeset
   270
func_warning ()
803eeeeaa8a0 Updated libtool to version 2.2.6a
Sam Lantinga <slouken@libsdl.org>
parents: 1761
diff changeset
   271
{
803eeeeaa8a0 Updated libtool to version 2.2.6a
Sam Lantinga <slouken@libsdl.org>
parents: 1761
diff changeset
   272
    $opt_warning && $ECHO "$progname${mode+: }$mode: warning: "${1+"$@"} 1>&2
803eeeeaa8a0 Updated libtool to version 2.2.6a
Sam Lantinga <slouken@libsdl.org>
parents: 1761
diff changeset
   273
803eeeeaa8a0 Updated libtool to version 2.2.6a
Sam Lantinga <slouken@libsdl.org>
parents: 1761
diff changeset
   274
    # bash bug again:
803eeeeaa8a0 Updated libtool to version 2.2.6a
Sam Lantinga <slouken@libsdl.org>
parents: 1761
diff changeset
   275
    :
803eeeeaa8a0 Updated libtool to version 2.2.6a
Sam Lantinga <slouken@libsdl.org>
parents: 1761
diff changeset
   276
}
803eeeeaa8a0 Updated libtool to version 2.2.6a
Sam Lantinga <slouken@libsdl.org>
parents: 1761
diff changeset
   277
803eeeeaa8a0 Updated libtool to version 2.2.6a
Sam Lantinga <slouken@libsdl.org>
parents: 1761
diff changeset
   278
# func_fatal_error arg...
803eeeeaa8a0 Updated libtool to version 2.2.6a
Sam Lantinga <slouken@libsdl.org>
parents: 1761
diff changeset
   279
# Echo program name prefixed message to standard error, and exit.
803eeeeaa8a0 Updated libtool to version 2.2.6a
Sam Lantinga <slouken@libsdl.org>
parents: 1761
diff changeset
   280
func_fatal_error ()
803eeeeaa8a0 Updated libtool to version 2.2.6a
Sam Lantinga <slouken@libsdl.org>
parents: 1761
diff changeset
   281
{
803eeeeaa8a0 Updated libtool to version 2.2.6a
Sam Lantinga <slouken@libsdl.org>
parents: 1761
diff changeset
   282
    func_error ${1+"$@"}
803eeeeaa8a0 Updated libtool to version 2.2.6a
Sam Lantinga <slouken@libsdl.org>
parents: 1761
diff changeset
   283
    exit $EXIT_FAILURE
803eeeeaa8a0 Updated libtool to version 2.2.6a
Sam Lantinga <slouken@libsdl.org>
parents: 1761
diff changeset
   284
}
803eeeeaa8a0 Updated libtool to version 2.2.6a
Sam Lantinga <slouken@libsdl.org>
parents: 1761
diff changeset
   285
803eeeeaa8a0 Updated libtool to version 2.2.6a
Sam Lantinga <slouken@libsdl.org>
parents: 1761
diff changeset
   286
# func_fatal_help arg...
803eeeeaa8a0 Updated libtool to version 2.2.6a
Sam Lantinga <slouken@libsdl.org>
parents: 1761
diff changeset
   287
# Echo program name prefixed message to standard error, followed by
803eeeeaa8a0 Updated libtool to version 2.2.6a
Sam Lantinga <slouken@libsdl.org>
parents: 1761
diff changeset
   288
# a help hint, and exit.
803eeeeaa8a0 Updated libtool to version 2.2.6a
Sam Lantinga <slouken@libsdl.org>
parents: 1761
diff changeset
   289
func_fatal_help ()
803eeeeaa8a0 Updated libtool to version 2.2.6a
Sam Lantinga <slouken@libsdl.org>
parents: 1761
diff changeset
   290
{
803eeeeaa8a0 Updated libtool to version 2.2.6a
Sam Lantinga <slouken@libsdl.org>
parents: 1761
diff changeset
   291
    func_error ${1+"$@"}
803eeeeaa8a0 Updated libtool to version 2.2.6a
Sam Lantinga <slouken@libsdl.org>
parents: 1761
diff changeset
   292
    func_fatal_error "$help"
803eeeeaa8a0 Updated libtool to version 2.2.6a
Sam Lantinga <slouken@libsdl.org>
parents: 1761
diff changeset
   293
}
803eeeeaa8a0 Updated libtool to version 2.2.6a
Sam Lantinga <slouken@libsdl.org>
parents: 1761
diff changeset
   294
help="Try \`$progname --help' for more information."  ## default
803eeeeaa8a0 Updated libtool to version 2.2.6a
Sam Lantinga <slouken@libsdl.org>
parents: 1761
diff changeset
   295
803eeeeaa8a0 Updated libtool to version 2.2.6a
Sam Lantinga <slouken@libsdl.org>
parents: 1761
diff changeset
   296
803eeeeaa8a0 Updated libtool to version 2.2.6a
Sam Lantinga <slouken@libsdl.org>
parents: 1761
diff changeset
   297
# func_grep expression filename
803eeeeaa8a0 Updated libtool to version 2.2.6a
Sam Lantinga <slouken@libsdl.org>
parents: 1761
diff changeset
   298
# Check whether EXPRESSION matches any line of FILENAME, without output.
803eeeeaa8a0 Updated libtool to version 2.2.6a
Sam Lantinga <slouken@libsdl.org>
parents: 1761
diff changeset
   299
func_grep ()
803eeeeaa8a0 Updated libtool to version 2.2.6a
Sam Lantinga <slouken@libsdl.org>
parents: 1761
diff changeset
   300
{
803eeeeaa8a0 Updated libtool to version 2.2.6a
Sam Lantinga <slouken@libsdl.org>
parents: 1761
diff changeset
   301
    $GREP "$1" "$2" >/dev/null 2>&1
803eeeeaa8a0 Updated libtool to version 2.2.6a
Sam Lantinga <slouken@libsdl.org>
parents: 1761
diff changeset
   302
}
803eeeeaa8a0 Updated libtool to version 2.2.6a
Sam Lantinga <slouken@libsdl.org>
parents: 1761
diff changeset
   303
803eeeeaa8a0 Updated libtool to version 2.2.6a
Sam Lantinga <slouken@libsdl.org>
parents: 1761
diff changeset
   304
803eeeeaa8a0 Updated libtool to version 2.2.6a
Sam Lantinga <slouken@libsdl.org>
parents: 1761
diff changeset
   305
# func_mkdir_p directory-path
803eeeeaa8a0 Updated libtool to version 2.2.6a
Sam Lantinga <slouken@libsdl.org>
parents: 1761
diff changeset
   306
# Make sure the entire path to DIRECTORY-PATH is available.
803eeeeaa8a0 Updated libtool to version 2.2.6a
Sam Lantinga <slouken@libsdl.org>
parents: 1761
diff changeset
   307
func_mkdir_p ()
803eeeeaa8a0 Updated libtool to version 2.2.6a
Sam Lantinga <slouken@libsdl.org>
parents: 1761
diff changeset
   308
{
803eeeeaa8a0 Updated libtool to version 2.2.6a
Sam Lantinga <slouken@libsdl.org>
parents: 1761
diff changeset
   309
    my_directory_path="$1"
803eeeeaa8a0 Updated libtool to version 2.2.6a
Sam Lantinga <slouken@libsdl.org>
parents: 1761
diff changeset
   310
    my_dir_list=
803eeeeaa8a0 Updated libtool to version 2.2.6a
Sam Lantinga <slouken@libsdl.org>
parents: 1761
diff changeset
   311
803eeeeaa8a0 Updated libtool to version 2.2.6a
Sam Lantinga <slouken@libsdl.org>
parents: 1761
diff changeset
   312
    if test -n "$my_directory_path" && test "$opt_dry_run" != ":"; then
803eeeeaa8a0 Updated libtool to version 2.2.6a
Sam Lantinga <slouken@libsdl.org>
parents: 1761
diff changeset
   313
803eeeeaa8a0 Updated libtool to version 2.2.6a
Sam Lantinga <slouken@libsdl.org>
parents: 1761
diff changeset
   314
      # Protect directory names starting with `-'
803eeeeaa8a0 Updated libtool to version 2.2.6a
Sam Lantinga <slouken@libsdl.org>
parents: 1761
diff changeset
   315
      case $my_directory_path in
803eeeeaa8a0 Updated libtool to version 2.2.6a
Sam Lantinga <slouken@libsdl.org>
parents: 1761
diff changeset
   316
        -*) my_directory_path="./$my_directory_path" ;;
803eeeeaa8a0 Updated libtool to version 2.2.6a
Sam Lantinga <slouken@libsdl.org>
parents: 1761
diff changeset
   317
      esac
803eeeeaa8a0 Updated libtool to version 2.2.6a
Sam Lantinga <slouken@libsdl.org>
parents: 1761
diff changeset
   318
803eeeeaa8a0 Updated libtool to version 2.2.6a
Sam Lantinga <slouken@libsdl.org>
parents: 1761
diff changeset
   319
      # While some portion of DIR does not yet exist...
803eeeeaa8a0 Updated libtool to version 2.2.6a
Sam Lantinga <slouken@libsdl.org>
parents: 1761
diff changeset
   320
      while test ! -d "$my_directory_path"; do
803eeeeaa8a0 Updated libtool to version 2.2.6a
Sam Lantinga <slouken@libsdl.org>
parents: 1761
diff changeset
   321
        # ...make a list in topmost first order.  Use a colon delimited
803eeeeaa8a0 Updated libtool to version 2.2.6a
Sam Lantinga <slouken@libsdl.org>
parents: 1761
diff changeset
   322
	# list incase some portion of path contains whitespace.
803eeeeaa8a0 Updated libtool to version 2.2.6a
Sam Lantinga <slouken@libsdl.org>
parents: 1761
diff changeset
   323
        my_dir_list="$my_directory_path:$my_dir_list"
803eeeeaa8a0 Updated libtool to version 2.2.6a
Sam Lantinga <slouken@libsdl.org>
parents: 1761
diff changeset
   324
803eeeeaa8a0 Updated libtool to version 2.2.6a
Sam Lantinga <slouken@libsdl.org>
parents: 1761
diff changeset
   325
        # If the last portion added has no slash in it, the list is done
803eeeeaa8a0 Updated libtool to version 2.2.6a
Sam Lantinga <slouken@libsdl.org>
parents: 1761
diff changeset
   326
        case $my_directory_path in */*) ;; *) break ;; esac
803eeeeaa8a0 Updated libtool to version 2.2.6a
Sam Lantinga <slouken@libsdl.org>
parents: 1761
diff changeset
   327
803eeeeaa8a0 Updated libtool to version 2.2.6a
Sam Lantinga <slouken@libsdl.org>
parents: 1761
diff changeset
   328
        # ...otherwise throw away the child directory and loop
803eeeeaa8a0 Updated libtool to version 2.2.6a
Sam Lantinga <slouken@libsdl.org>
parents: 1761
diff changeset
   329
        my_directory_path=`$ECHO "X$my_directory_path" | $Xsed -e "$dirname"`
803eeeeaa8a0 Updated libtool to version 2.2.6a
Sam Lantinga <slouken@libsdl.org>
parents: 1761
diff changeset
   330
      done
803eeeeaa8a0 Updated libtool to version 2.2.6a
Sam Lantinga <slouken@libsdl.org>
parents: 1761
diff changeset
   331
      my_dir_list=`$ECHO "X$my_dir_list" | $Xsed -e 's,:*$,,'`
803eeeeaa8a0 Updated libtool to version 2.2.6a
Sam Lantinga <slouken@libsdl.org>
parents: 1761
diff changeset
   332
803eeeeaa8a0 Updated libtool to version 2.2.6a
Sam Lantinga <slouken@libsdl.org>
parents: 1761
diff changeset
   333
      save_mkdir_p_IFS="$IFS"; IFS=':'
803eeeeaa8a0 Updated libtool to version 2.2.6a
Sam Lantinga <slouken@libsdl.org>
parents: 1761
diff changeset
   334
      for my_dir in $my_dir_list; do
803eeeeaa8a0 Updated libtool to version 2.2.6a
Sam Lantinga <slouken@libsdl.org>
parents: 1761
diff changeset
   335
	IFS="$save_mkdir_p_IFS"
803eeeeaa8a0 Updated libtool to version 2.2.6a
Sam Lantinga <slouken@libsdl.org>
parents: 1761
diff changeset
   336
        # mkdir can fail with a `File exist' error if two processes
803eeeeaa8a0 Updated libtool to version 2.2.6a
Sam Lantinga <slouken@libsdl.org>
parents: 1761
diff changeset
   337
        # try to create one of the directories concurrently.  Don't
803eeeeaa8a0 Updated libtool to version 2.2.6a
Sam Lantinga <slouken@libsdl.org>
parents: 1761
diff changeset
   338
        # stop in that case!
803eeeeaa8a0 Updated libtool to version 2.2.6a
Sam Lantinga <slouken@libsdl.org>
parents: 1761
diff changeset
   339
        $MKDIR "$my_dir" 2>/dev/null || :
803eeeeaa8a0 Updated libtool to version 2.2.6a
Sam Lantinga <slouken@libsdl.org>
parents: 1761
diff changeset
   340
      done
803eeeeaa8a0 Updated libtool to version 2.2.6a
Sam Lantinga <slouken@libsdl.org>
parents: 1761
diff changeset
   341
      IFS="$save_mkdir_p_IFS"
803eeeeaa8a0 Updated libtool to version 2.2.6a
Sam Lantinga <slouken@libsdl.org>
parents: 1761
diff changeset
   342
803eeeeaa8a0 Updated libtool to version 2.2.6a
Sam Lantinga <slouken@libsdl.org>
parents: 1761
diff changeset
   343
      # Bail out if we (or some other process) failed to create a directory.
803eeeeaa8a0 Updated libtool to version 2.2.6a
Sam Lantinga <slouken@libsdl.org>
parents: 1761
diff changeset
   344
      test -d "$my_directory_path" || \
803eeeeaa8a0 Updated libtool to version 2.2.6a
Sam Lantinga <slouken@libsdl.org>
parents: 1761
diff changeset
   345
        func_fatal_error "Failed to create \`$1'"
803eeeeaa8a0 Updated libtool to version 2.2.6a
Sam Lantinga <slouken@libsdl.org>
parents: 1761
diff changeset
   346
    fi
803eeeeaa8a0 Updated libtool to version 2.2.6a
Sam Lantinga <slouken@libsdl.org>
parents: 1761
diff changeset
   347
}
803eeeeaa8a0 Updated libtool to version 2.2.6a
Sam Lantinga <slouken@libsdl.org>
parents: 1761
diff changeset
   348
803eeeeaa8a0 Updated libtool to version 2.2.6a
Sam Lantinga <slouken@libsdl.org>
parents: 1761
diff changeset
   349
803eeeeaa8a0 Updated libtool to version 2.2.6a
Sam Lantinga <slouken@libsdl.org>
parents: 1761
diff changeset
   350
# func_mktempdir [string]
803eeeeaa8a0 Updated libtool to version 2.2.6a
Sam Lantinga <slouken@libsdl.org>
parents: 1761
diff changeset
   351
# Make a temporary directory that won't clash with other running
803eeeeaa8a0 Updated libtool to version 2.2.6a
Sam Lantinga <slouken@libsdl.org>
parents: 1761
diff changeset
   352
# libtool processes, and avoids race conditions if possible.  If
803eeeeaa8a0 Updated libtool to version 2.2.6a
Sam Lantinga <slouken@libsdl.org>
parents: 1761
diff changeset
   353
# given, STRING is the basename for that directory.
803eeeeaa8a0 Updated libtool to version 2.2.6a
Sam Lantinga <slouken@libsdl.org>
parents: 1761
diff changeset
   354
func_mktempdir ()
803eeeeaa8a0 Updated libtool to version 2.2.6a
Sam Lantinga <slouken@libsdl.org>
parents: 1761
diff changeset
   355
{
803eeeeaa8a0 Updated libtool to version 2.2.6a
Sam Lantinga <slouken@libsdl.org>
parents: 1761
diff changeset
   356
    my_template="${TMPDIR-/tmp}/${1-$progname}"
803eeeeaa8a0 Updated libtool to version 2.2.6a
Sam Lantinga <slouken@libsdl.org>
parents: 1761
diff changeset
   357
803eeeeaa8a0 Updated libtool to version 2.2.6a
Sam Lantinga <slouken@libsdl.org>
parents: 1761
diff changeset
   358
    if test "$opt_dry_run" = ":"; then
803eeeeaa8a0 Updated libtool to version 2.2.6a
Sam Lantinga <slouken@libsdl.org>
parents: 1761
diff changeset
   359
      # Return a directory name, but don't create it in dry-run mode
803eeeeaa8a0 Updated libtool to version 2.2.6a
Sam Lantinga <slouken@libsdl.org>
parents: 1761
diff changeset
   360
      my_tmpdir="${my_template}-$$"
803eeeeaa8a0 Updated libtool to version 2.2.6a
Sam Lantinga <slouken@libsdl.org>
parents: 1761
diff changeset
   361
    else
803eeeeaa8a0 Updated libtool to version 2.2.6a
Sam Lantinga <slouken@libsdl.org>
parents: 1761
diff changeset
   362
803eeeeaa8a0 Updated libtool to version 2.2.6a
Sam Lantinga <slouken@libsdl.org>
parents: 1761
diff changeset
   363
      # If mktemp works, use that first and foremost
803eeeeaa8a0 Updated libtool to version 2.2.6a
Sam Lantinga <slouken@libsdl.org>
parents: 1761
diff changeset
   364
      my_tmpdir=`mktemp -d "${my_template}-XXXXXXXX" 2>/dev/null`
803eeeeaa8a0 Updated libtool to version 2.2.6a
Sam Lantinga <slouken@libsdl.org>
parents: 1761
diff changeset
   365
803eeeeaa8a0 Updated libtool to version 2.2.6a
Sam Lantinga <slouken@libsdl.org>
parents: 1761
diff changeset
   366
      if test ! -d "$my_tmpdir"; then
803eeeeaa8a0 Updated libtool to version 2.2.6a
Sam Lantinga <slouken@libsdl.org>
parents: 1761
diff changeset
   367
        # Failing that, at least try and use $RANDOM to avoid a race
803eeeeaa8a0 Updated libtool to version 2.2.6a
Sam Lantinga <slouken@libsdl.org>
parents: 1761
diff changeset
   368
        my_tmpdir="${my_template}-${RANDOM-0}$$"
803eeeeaa8a0 Updated libtool to version 2.2.6a
Sam Lantinga <slouken@libsdl.org>
parents: 1761
diff changeset
   369
803eeeeaa8a0 Updated libtool to version 2.2.6a
Sam Lantinga <slouken@libsdl.org>
parents: 1761
diff changeset
   370
        save_mktempdir_umask=`umask`
803eeeeaa8a0 Updated libtool to version 2.2.6a
Sam Lantinga <slouken@libsdl.org>
parents: 1761
diff changeset
   371
        umask 0077
803eeeeaa8a0 Updated libtool to version 2.2.6a
Sam Lantinga <slouken@libsdl.org>
parents: 1761
diff changeset
   372
        $MKDIR "$my_tmpdir"
803eeeeaa8a0 Updated libtool to version 2.2.6a
Sam Lantinga <slouken@libsdl.org>
parents: 1761
diff changeset
   373
        umask $save_mktempdir_umask
803eeeeaa8a0 Updated libtool to version 2.2.6a
Sam Lantinga <slouken@libsdl.org>
parents: 1761
diff changeset
   374
      fi
803eeeeaa8a0 Updated libtool to version 2.2.6a
Sam Lantinga <slouken@libsdl.org>
parents: 1761
diff changeset
   375
803eeeeaa8a0 Updated libtool to version 2.2.6a
Sam Lantinga <slouken@libsdl.org>
parents: 1761
diff changeset
   376
      # If we're not in dry-run mode, bomb out on failure
803eeeeaa8a0 Updated libtool to version 2.2.6a
Sam Lantinga <slouken@libsdl.org>
parents: 1761
diff changeset
   377
      test -d "$my_tmpdir" || \
803eeeeaa8a0 Updated libtool to version 2.2.6a
Sam Lantinga <slouken@libsdl.org>
parents: 1761
diff changeset
   378
        func_fatal_error "cannot create temporary directory \`$my_tmpdir'"
803eeeeaa8a0 Updated libtool to version 2.2.6a
Sam Lantinga <slouken@libsdl.org>
parents: 1761
diff changeset
   379
    fi
803eeeeaa8a0 Updated libtool to version 2.2.6a
Sam Lantinga <slouken@libsdl.org>
parents: 1761
diff changeset
   380
803eeeeaa8a0 Updated libtool to version 2.2.6a
Sam Lantinga <slouken@libsdl.org>
parents: 1761
diff changeset
   381
    $ECHO "X$my_tmpdir" | $Xsed
803eeeeaa8a0 Updated libtool to version 2.2.6a
Sam Lantinga <slouken@libsdl.org>
parents: 1761
diff changeset
   382
}
803eeeeaa8a0 Updated libtool to version 2.2.6a
Sam Lantinga <slouken@libsdl.org>
parents: 1761
diff changeset
   383
803eeeeaa8a0 Updated libtool to version 2.2.6a
Sam Lantinga <slouken@libsdl.org>
parents: 1761
diff changeset
   384
803eeeeaa8a0 Updated libtool to version 2.2.6a
Sam Lantinga <slouken@libsdl.org>
parents: 1761
diff changeset
   385
# func_quote_for_eval arg
803eeeeaa8a0 Updated libtool to version 2.2.6a
Sam Lantinga <slouken@libsdl.org>
parents: 1761
diff changeset
   386
# Aesthetically quote ARG to be evaled later.
803eeeeaa8a0 Updated libtool to version 2.2.6a
Sam Lantinga <slouken@libsdl.org>
parents: 1761
diff changeset
   387
# This function returns two values: FUNC_QUOTE_FOR_EVAL_RESULT
803eeeeaa8a0 Updated libtool to version 2.2.6a
Sam Lantinga <slouken@libsdl.org>
parents: 1761
diff changeset
   388
# is double-quoted, suitable for a subsequent eval, whereas
803eeeeaa8a0 Updated libtool to version 2.2.6a
Sam Lantinga <slouken@libsdl.org>
parents: 1761
diff changeset
   389
# FUNC_QUOTE_FOR_EVAL_UNQUOTED_RESULT has merely all characters
803eeeeaa8a0 Updated libtool to version 2.2.6a
Sam Lantinga <slouken@libsdl.org>
parents: 1761
diff changeset
   390
# which are still active within double quotes backslashified.
803eeeeaa8a0 Updated libtool to version 2.2.6a
Sam Lantinga <slouken@libsdl.org>
parents: 1761
diff changeset
   391
func_quote_for_eval ()
803eeeeaa8a0 Updated libtool to version 2.2.6a
Sam Lantinga <slouken@libsdl.org>
parents: 1761
diff changeset
   392
{
803eeeeaa8a0 Updated libtool to version 2.2.6a
Sam Lantinga <slouken@libsdl.org>
parents: 1761
diff changeset
   393
    case $1 in
803eeeeaa8a0 Updated libtool to version 2.2.6a
Sam Lantinga <slouken@libsdl.org>
parents: 1761
diff changeset
   394
      *[\\\`\"\$]*)
803eeeeaa8a0 Updated libtool to version 2.2.6a
Sam Lantinga <slouken@libsdl.org>
parents: 1761
diff changeset
   395
	func_quote_for_eval_unquoted_result=`$ECHO "X$1" | $Xsed -e "$sed_quote_subst"` ;;
803eeeeaa8a0 Updated libtool to version 2.2.6a
Sam Lantinga <slouken@libsdl.org>
parents: 1761
diff changeset
   396
      *)
803eeeeaa8a0 Updated libtool to version 2.2.6a
Sam Lantinga <slouken@libsdl.org>
parents: 1761
diff changeset
   397
        func_quote_for_eval_unquoted_result="$1" ;;
803eeeeaa8a0 Updated libtool to version 2.2.6a
Sam Lantinga <slouken@libsdl.org>
parents: 1761
diff changeset
   398
    esac
803eeeeaa8a0 Updated libtool to version 2.2.6a
Sam Lantinga <slouken@libsdl.org>
parents: 1761
diff changeset
   399
803eeeeaa8a0 Updated libtool to version 2.2.6a
Sam Lantinga <slouken@libsdl.org>
parents: 1761
diff changeset
   400
    case $func_quote_for_eval_unquoted_result in
803eeeeaa8a0 Updated libtool to version 2.2.6a
Sam Lantinga <slouken@libsdl.org>
parents: 1761
diff changeset
   401
      # Double-quote args containing shell metacharacters to delay
803eeeeaa8a0 Updated libtool to version 2.2.6a
Sam Lantinga <slouken@libsdl.org>
parents: 1761
diff changeset
   402
      # word splitting, command substitution and and variable
803eeeeaa8a0 Updated libtool to version 2.2.6a
Sam Lantinga <slouken@libsdl.org>
parents: 1761
diff changeset
   403
      # expansion for a subsequent eval.
803eeeeaa8a0 Updated libtool to version 2.2.6a
Sam Lantinga <slouken@libsdl.org>
parents: 1761
diff changeset
   404
      # Many Bourne shells cannot handle close brackets correctly
803eeeeaa8a0 Updated libtool to version 2.2.6a
Sam Lantinga <slouken@libsdl.org>
parents: 1761
diff changeset
   405
      # in scan sets, so we specify it separately.
803eeeeaa8a0 Updated libtool to version 2.2.6a
Sam Lantinga <slouken@libsdl.org>
parents: 1761
diff changeset
   406
      *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \	]*|*]*|"")
803eeeeaa8a0 Updated libtool to version 2.2.6a
Sam Lantinga <slouken@libsdl.org>
parents: 1761
diff changeset
   407
        func_quote_for_eval_result="\"$func_quote_for_eval_unquoted_result\""
803eeeeaa8a0 Updated libtool to version 2.2.6a
Sam Lantinga <slouken@libsdl.org>
parents: 1761
diff changeset
   408
        ;;
803eeeeaa8a0 Updated libtool to version 2.2.6a
Sam Lantinga <slouken@libsdl.org>
parents: 1761
diff changeset
   409
      *)
803eeeeaa8a0 Updated libtool to version 2.2.6a
Sam Lantinga <slouken@libsdl.org>
parents: 1761
diff changeset
   410
        func_quote_for_eval_result="$func_quote_for_eval_unquoted_result"
803eeeeaa8a0 Updated libtool to version 2.2.6a
Sam Lantinga <slouken@libsdl.org>
parents: 1761
diff changeset
   411
    esac
803eeeeaa8a0 Updated libtool to version 2.2.6a
Sam Lantinga <slouken@libsdl.org>
parents: 1761
diff changeset
   412
}
803eeeeaa8a0 Updated libtool to version 2.2.6a
Sam Lantinga <slouken@libsdl.org>
parents: 1761
diff changeset
   413
803eeeeaa8a0 Updated libtool to version 2.2.6a
Sam Lantinga <slouken@libsdl.org>
parents: 1761
diff changeset
   414
803eeeeaa8a0 Updated libtool to version 2.2.6a
Sam Lantinga <slouken@libsdl.org>
parents: 1761
diff changeset
   415
# func_quote_for_expand arg
803eeeeaa8a0 Updated libtool to version 2.2.6a
Sam Lantinga <slouken@libsdl.org>
parents: 1761
diff changeset
   416
# Aesthetically quote ARG to be evaled later; same as above,
803eeeeaa8a0 Updated libtool to version 2.2.6a
Sam Lantinga <slouken@libsdl.org>
parents: 1761
diff changeset
   417
# but do not quote variable references.
803eeeeaa8a0 Updated libtool to version 2.2.6a
Sam Lantinga <slouken@libsdl.org>
parents: 1761
diff changeset
   418
func_quote_for_expand ()
803eeeeaa8a0 Updated libtool to version 2.2.6a
Sam Lantinga <slouken@libsdl.org>
parents: 1761
diff changeset
   419
{
803eeeeaa8a0 Updated libtool to version 2.2.6a
Sam Lantinga <slouken@libsdl.org>
parents: 1761
diff changeset
   420
    case $1 in
803eeeeaa8a0 Updated libtool to version 2.2.6a
Sam Lantinga <slouken@libsdl.org>
parents: 1761
diff changeset
   421
      *[\\\`\"]*)
803eeeeaa8a0 Updated libtool to version 2.2.6a
Sam Lantinga <slouken@libsdl.org>
parents: 1761
diff changeset
   422
	my_arg=`$ECHO "X$1" | $Xsed \
803eeeeaa8a0 Updated libtool to version 2.2.6a
Sam Lantinga <slouken@libsdl.org>
parents: 1761
diff changeset
   423
	    -e "$double_quote_subst" -e "$sed_double_backslash"` ;;
803eeeeaa8a0 Updated libtool to version 2.2.6a
Sam Lantinga <slouken@libsdl.org>
parents: 1761
diff changeset
   424
      *)
803eeeeaa8a0 Updated libtool to version 2.2.6a
Sam Lantinga <slouken@libsdl.org>
parents: 1761
diff changeset
   425
        my_arg="$1" ;;
803eeeeaa8a0 Updated libtool to version 2.2.6a
Sam Lantinga <slouken@libsdl.org>
parents: 1761
diff changeset
   426
    esac
803eeeeaa8a0 Updated libtool to version 2.2.6a
Sam Lantinga <slouken@libsdl.org>
parents: 1761
diff changeset
   427
803eeeeaa8a0 Updated libtool to version 2.2.6a
Sam Lantinga <slouken@libsdl.org>
parents: 1761
diff changeset
   428
    case $my_arg in
803eeeeaa8a0 Updated libtool to version 2.2.6a
Sam Lantinga <slouken@libsdl.org>
parents: 1761
diff changeset
   429
      # Double-quote args containing shell metacharacters to delay
803eeeeaa8a0 Updated libtool to version 2.2.6a
Sam Lantinga <slouken@libsdl.org>
parents: 1761
diff changeset
   430
      # word splitting and command substitution for a subsequent eval.
803eeeeaa8a0 Updated libtool to version 2.2.6a
Sam Lantinga <slouken@libsdl.org>
parents: 1761
diff changeset
   431
      # Many Bourne shells cannot handle close brackets correctly
803eeeeaa8a0 Updated libtool to version 2.2.6a
Sam Lantinga <slouken@libsdl.org>
parents: 1761
diff changeset
   432
      # in scan sets, so we specify it separately.
803eeeeaa8a0 Updated libtool to version 2.2.6a
Sam Lantinga <slouken@libsdl.org>
parents: 1761
diff changeset
   433
      *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \	]*|*]*|"")
803eeeeaa8a0 Updated libtool to version 2.2.6a
Sam Lantinga <slouken@libsdl.org>
parents: 1761
diff changeset
   434
        my_arg="\"$my_arg\""
803eeeeaa8a0 Updated libtool to version 2.2.6a
Sam Lantinga <slouken@libsdl.org>
parents: 1761
diff changeset
   435
        ;;
803eeeeaa8a0 Updated libtool to version 2.2.6a
Sam Lantinga <slouken@libsdl.org>
parents: 1761
diff changeset
   436
    esac
803eeeeaa8a0 Updated libtool to version 2.2.6a
Sam Lantinga <slouken@libsdl.org>
parents: 1761
diff changeset
   437
803eeeeaa8a0 Updated libtool to version 2.2.6a
Sam Lantinga <slouken@libsdl.org>
parents: 1761
diff changeset
   438
    func_quote_for_expand_result="$my_arg"
803eeeeaa8a0 Updated libtool to version 2.2.6a
Sam Lantinga <slouken@libsdl.org>
parents: 1761
diff changeset
   439
}
803eeeeaa8a0 Updated libtool to version 2.2.6a
Sam Lantinga <slouken@libsdl.org>
parents: 1761
diff changeset
   440
803eeeeaa8a0 Updated libtool to version 2.2.6a
Sam Lantinga <slouken@libsdl.org>
parents: 1761
diff changeset
   441
803eeeeaa8a0 Updated libtool to version 2.2.6a
Sam Lantinga <slouken@libsdl.org>
parents: 1761
diff changeset
   442
# func_show_eval cmd [fail_exp]
803eeeeaa8a0 Updated libtool to version 2.2.6a
Sam Lantinga <slouken@libsdl.org>
parents: 1761
diff changeset
   443
# Unless opt_silent is true, then output CMD.  Then, if opt_dryrun is
803eeeeaa8a0 Updated libtool to version 2.2.6a
Sam Lantinga <slouken@libsdl.org>
parents: 1761
diff changeset
   444
# not true, evaluate CMD.  If the evaluation of CMD fails, and FAIL_EXP
803eeeeaa8a0 Updated libtool to version 2.2.6a
Sam Lantinga <slouken@libsdl.org>
parents: 1761
diff changeset
   445
# is given, then evaluate it.
803eeeeaa8a0 Updated libtool to version 2.2.6a
Sam Lantinga <slouken@libsdl.org>
parents: 1761
diff changeset
   446
func_show_eval ()
803eeeeaa8a0 Updated libtool to version 2.2.6a
Sam Lantinga <slouken@libsdl.org>
parents: 1761
diff changeset
   447
{
803eeeeaa8a0 Updated libtool to version 2.2.6a
Sam Lantinga <slouken@libsdl.org>
parents: 1761
diff changeset
   448
    my_cmd="$1"
803eeeeaa8a0 Updated libtool to version 2.2.6a
Sam Lantinga <slouken@libsdl.org>
parents: 1761
diff changeset
   449
    my_fail_exp="${2-:}"
803eeeeaa8a0 Updated libtool to version 2.2.6a
Sam Lantinga <slouken@libsdl.org>
parents: 1761
diff changeset
   450
803eeeeaa8a0 Updated libtool to version 2.2.6a
Sam Lantinga <slouken@libsdl.org>
parents: 1761
diff changeset
   451
    ${opt_silent-false} || {
803eeeeaa8a0 Updated libtool to version 2.2.6a
Sam Lantinga <slouken@libsdl.org>
parents: 1761
diff changeset
   452
      func_quote_for_expand "$my_cmd"
803eeeeaa8a0 Updated libtool to version 2.2.6a
Sam Lantinga <slouken@libsdl.org>
parents: 1761
diff changeset
   453
      eval "func_echo $func_quote_for_expand_result"
803eeeeaa8a0 Updated libtool to version 2.2.6a
Sam Lantinga <slouken@libsdl.org>
parents: 1761
diff changeset
   454
    }
803eeeeaa8a0 Updated libtool to version 2.2.6a
Sam Lantinga <slouken@libsdl.org>
parents: 1761
diff changeset
   455
803eeeeaa8a0 Updated libtool to version 2.2.6a
Sam Lantinga <slouken@libsdl.org>
parents: 1761
diff changeset
   456
    if ${opt_dry_run-false}; then :; else
803eeeeaa8a0 Updated libtool to version 2.2.6a
Sam Lantinga <slouken@libsdl.org>
parents: 1761
diff changeset
   457
      eval "$my_cmd"
803eeeeaa8a0 Updated libtool to version 2.2.6a
Sam Lantinga <slouken@libsdl.org>
parents: 1761
diff changeset
   458
      my_status=$?
803eeeeaa8a0 Updated libtool to version 2.2.6a
Sam Lantinga <slouken@libsdl.org>
parents: 1761
diff changeset
   459
      if test "$my_status" -eq 0; then :; else
803eeeeaa8a0 Updated libtool to version 2.2.6a
Sam Lantinga <slouken@libsdl.org>
parents: 1761
diff changeset
   460
	eval "(exit $my_status); $my_fail_exp"
803eeeeaa8a0 Updated libtool to version 2.2.6a
Sam Lantinga <slouken@libsdl.org>
parents: 1761
diff changeset
   461
      fi
803eeeeaa8a0 Updated libtool to version 2.2.6a
Sam Lantinga <slouken@libsdl.org>
parents: 1761
diff changeset
   462
    fi
803eeeeaa8a0 Updated libtool to version 2.2.6a
Sam Lantinga <slouken@libsdl.org>
parents: 1761
diff changeset
   463
}
803eeeeaa8a0 Updated libtool to version 2.2.6a
Sam Lantinga <slouken@libsdl.org>
parents: 1761
diff changeset
   464
803eeeeaa8a0 Updated libtool to version 2.2.6a
Sam Lantinga <slouken@libsdl.org>
parents: 1761
diff changeset
   465
803eeeeaa8a0 Updated libtool to version 2.2.6a
Sam Lantinga <slouken@libsdl.org>
parents: 1761
diff changeset
   466
# func_show_eval_locale cmd [fail_exp]
803eeeeaa8a0 Updated libtool to version 2.2.6a
Sam Lantinga <slouken@libsdl.org>
parents: 1761
diff changeset
   467
# Unless opt_silent is true, then output CMD.  Then, if opt_dryrun is
803eeeeaa8a0 Updated libtool to version 2.2.6a
Sam Lantinga <slouken@libsdl.org>
parents: 1761
diff changeset
   468
# not true, evaluate CMD.  If the evaluation of CMD fails, and FAIL_EXP
803eeeeaa8a0 Updated libtool to version 2.2.6a
Sam Lantinga <slouken@libsdl.org>
parents: 1761
diff changeset
   469
# is given, then evaluate it.  Use the saved locale for evaluation.
803eeeeaa8a0 Updated libtool to version 2.2.6a
Sam Lantinga <slouken@libsdl.org>
parents: 1761
diff changeset
   470
func_show_eval_locale ()
803eeeeaa8a0 Updated libtool to version 2.2.6a
Sam Lantinga <slouken@libsdl.org>
parents: 1761
diff changeset
   471
{
803eeeeaa8a0 Updated libtool to version 2.2.6a
Sam Lantinga <slouken@libsdl.org>
parents: 1761
diff changeset
   472
    my_cmd="$1"
803eeeeaa8a0 Updated libtool to version 2.2.6a
Sam Lantinga <slouken@libsdl.org>
parents: 1761
diff changeset
   473
    my_fail_exp="${2-:}"
803eeeeaa8a0 Updated libtool to version 2.2.6a
Sam Lantinga <slouken@libsdl.org>
parents: 1761
diff changeset
   474
803eeeeaa8a0 Updated libtool to version 2.2.6a
Sam Lantinga <slouken@libsdl.org>
parents: 1761
diff changeset
   475
    ${opt_silent-false} || {
803eeeeaa8a0 Updated libtool to version 2.2.6a
Sam Lantinga <slouken@libsdl.org>
parents: 1761
diff changeset
   476
      func_quote_for_expand "$my_cmd"
803eeeeaa8a0 Updated libtool to version 2.2.6a
Sam Lantinga <slouken@libsdl.org>
parents: 1761
diff changeset
   477
      eval "func_echo $func_quote_for_expand_result"
803eeeeaa8a0 Updated libtool to version 2.2.6a
Sam Lantinga <slouken@libsdl.org>
parents: 1761
diff changeset
   478
    }
803eeeeaa8a0 Updated libtool to version 2.2.6a
Sam Lantinga <slouken@libsdl.org>
parents: 1761
diff changeset
   479
803eeeeaa8a0 Updated libtool to version 2.2.6a
Sam Lantinga <slouken@libsdl.org>
parents: 1761
diff changeset
   480
    if ${opt_dry_run-false}; then :; else
803eeeeaa8a0 Updated libtool to version 2.2.6a
Sam Lantinga <slouken@libsdl.org>
parents: 1761
diff changeset
   481
      eval "$lt_user_locale
803eeeeaa8a0 Updated libtool to version 2.2.6a
Sam Lantinga <slouken@libsdl.org>
parents: 1761
diff changeset
   482
	    $my_cmd"
803eeeeaa8a0 Updated libtool to version 2.2.6a
Sam Lantinga <slouken@libsdl.org>
parents: 1761
diff changeset
   483
      my_status=$?
803eeeeaa8a0 Updated libtool to version 2.2.6a
Sam Lantinga <slouken@libsdl.org>
parents: 1761
diff changeset
   484
      eval "$lt_safe_locale"
803eeeeaa8a0 Updated libtool to version 2.2.6a
Sam Lantinga <slouken@libsdl.org>
parents: 1761
diff changeset
   485
      if test "$my_status" -eq 0; then :; else
803eeeeaa8a0 Updated libtool to version 2.2.6a
Sam Lantinga <slouken@libsdl.org>
parents: 1761
diff changeset
   486
	eval "(exit $my_status); $my_fail_exp"
803eeeeaa8a0 Updated libtool to version 2.2.6a
Sam Lantinga <slouken@libsdl.org>
parents: 1761
diff changeset
   487
      fi
803eeeeaa8a0 Updated libtool to version 2.2.6a
Sam Lantinga <slouken@libsdl.org>
parents: 1761
diff changeset
   488
    fi
803eeeeaa8a0 Updated libtool to version 2.2.6a
Sam Lantinga <slouken@libsdl.org>
parents: 1761
diff changeset
   489
}
803eeeeaa8a0 Updated libtool to version 2.2.6a
Sam Lantinga <slouken@libsdl.org>
parents: 1761
diff changeset
   490
803eeeeaa8a0 Updated libtool to version 2.2.6a
Sam Lantinga <slouken@libsdl.org>
parents: 1761
diff changeset
   491
803eeeeaa8a0 Updated libtool to version 2.2.6a
Sam Lantinga <slouken@libsdl.org>
parents: 1761
diff changeset
   492
803eeeeaa8a0 Updated libtool to version 2.2.6a
Sam Lantinga <slouken@libsdl.org>
parents: 1761
diff changeset
   493
803eeeeaa8a0 Updated libtool to version 2.2.6a
Sam Lantinga <slouken@libsdl.org>
parents: 1761
diff changeset
   494
803eeeeaa8a0 Updated libtool to version 2.2.6a
Sam Lantinga <slouken@libsdl.org>
parents: 1761
diff changeset
   495
# func_version
803eeeeaa8a0 Updated libtool to version 2.2.6a
Sam Lantinga <slouken@libsdl.org>
parents: 1761
diff changeset
   496
# Echo version message to standard output and exit.
803eeeeaa8a0 Updated libtool to version 2.2.6a
Sam Lantinga <slouken@libsdl.org>
parents: 1761
diff changeset
   497
func_version ()
803eeeeaa8a0 Updated libtool to version 2.2.6a
Sam Lantinga <slouken@libsdl.org>
parents: 1761
diff changeset
   498
{
803eeeeaa8a0 Updated libtool to version 2.2.6a
Sam Lantinga <slouken@libsdl.org>
parents: 1761
diff changeset
   499
    $SED -n '/^# '$PROGRAM' (GNU /,/# warranty; / {
803eeeeaa8a0 Updated libtool to version 2.2.6a
Sam Lantinga <slouken@libsdl.org>
parents: 1761
diff changeset
   500
        s/^# //
803eeeeaa8a0 Updated libtool to version 2.2.6a
Sam Lantinga <slouken@libsdl.org>
parents: 1761
diff changeset
   501
	s/^# *$//
803eeeeaa8a0 Updated libtool to version 2.2.6a
Sam Lantinga <slouken@libsdl.org>
parents: 1761
diff changeset
   502
        s/\((C)\)[ 0-9,-]*\( [1-9][0-9]*\)/\1\2/
803eeeeaa8a0 Updated libtool to version 2.2.6a
Sam Lantinga <slouken@libsdl.org>
parents: 1761
diff changeset
   503
        p
803eeeeaa8a0 Updated libtool to version 2.2.6a
Sam Lantinga <slouken@libsdl.org>
parents: 1761
diff changeset
   504
     }' < "$progpath"
803eeeeaa8a0 Updated libtool to version 2.2.6a
Sam Lantinga <slouken@libsdl.org>
parents: 1761
diff changeset
   505
     exit $?
803eeeeaa8a0 Updated libtool to version 2.2.6a
Sam Lantinga <slouken@libsdl.org>
parents: 1761
diff changeset
   506
}
803eeeeaa8a0 Updated libtool to version 2.2.6a
Sam Lantinga <slouken@libsdl.org>
parents: 1761
diff changeset
   507
803eeeeaa8a0 Updated libtool to version 2.2.6a
Sam Lantinga <slouken@libsdl.org>
parents: 1761
diff changeset
   508
# func_usage
803eeeeaa8a0 Updated libtool to version 2.2.6a
Sam Lantinga <slouken@libsdl.org>
parents: 1761
diff changeset
   509
# Echo short help message to standard output and exit.
803eeeeaa8a0 Updated libtool to version 2.2.6a
Sam Lantinga <slouken@libsdl.org>
parents: 1761
diff changeset
   510
func_usage ()
803eeeeaa8a0 Updated libtool to version 2.2.6a
Sam Lantinga <slouken@libsdl.org>
parents: 1761
diff changeset
   511
{
803eeeeaa8a0 Updated libtool to version 2.2.6a
Sam Lantinga <slouken@libsdl.org>
parents: 1761
diff changeset
   512
    $SED -n '/^# Usage:/,/# -h/ {
803eeeeaa8a0 Updated libtool to version 2.2.6a
Sam Lantinga <slouken@libsdl.org>
parents: 1761
diff changeset
   513
        s/^# //
803eeeeaa8a0 Updated libtool to version 2.2.6a
Sam Lantinga <slouken@libsdl.org>
parents: 1761
diff changeset
   514
	s/^# *$//
803eeeeaa8a0 Updated libtool to version 2.2.6a
Sam Lantinga <slouken@libsdl.org>
parents: 1761
diff changeset
   515
	s/\$progname/'$progname'/
803eeeeaa8a0 Updated libtool to version 2.2.6a
Sam Lantinga <slouken@libsdl.org>
parents: 1761
diff changeset
   516
	p
803eeeeaa8a0 Updated libtool to version 2.2.6a
Sam Lantinga <slouken@libsdl.org>
parents: 1761
diff changeset
   517
    }' < "$progpath"
803eeeeaa8a0 Updated libtool to version 2.2.6a
Sam Lantinga <slouken@libsdl.org>
parents: 1761
diff changeset
   518
    $ECHO
803eeeeaa8a0 Updated libtool to version 2.2.6a
Sam Lantinga <slouken@libsdl.org>
parents: 1761
diff changeset
   519
    $ECHO "run \`$progname --help | more' for full usage"
803eeeeaa8a0 Updated libtool to version 2.2.6a
Sam Lantinga <slouken@libsdl.org>
parents: 1761
diff changeset
   520
    exit $?
803eeeeaa8a0 Updated libtool to version 2.2.6a
Sam Lantinga <slouken@libsdl.org>
parents: 1761
diff changeset
   521
}
803eeeeaa8a0 Updated libtool to version 2.2.6a
Sam Lantinga <slouken@libsdl.org>
parents: 1761
diff changeset
   522
803eeeeaa8a0 Updated libtool to version 2.2.6a
Sam Lantinga <slouken@libsdl.org>
parents: 1761
diff changeset
   523
# func_help
803eeeeaa8a0 Updated libtool to version 2.2.6a
Sam Lantinga <slouken@libsdl.org>
parents: 1761
diff changeset
   524
# Echo long help message to standard output and exit.
803eeeeaa8a0 Updated libtool to version 2.2.6a
Sam Lantinga <slouken@libsdl.org>
parents: 1761
diff changeset
   525
func_help ()
803eeeeaa8a0 Updated libtool to version 2.2.6a
Sam Lantinga <slouken@libsdl.org>
parents: 1761
diff changeset
   526
{
803eeeeaa8a0 Updated libtool to version 2.2.6a
Sam Lantinga <slouken@libsdl.org>
parents: 1761
diff changeset
   527
    $SED -n '/^# Usage:/,/# Report bugs to/ {
803eeeeaa8a0 Updated libtool to version 2.2.6a
Sam Lantinga <slouken@libsdl.org>
parents: 1761
diff changeset
   528
        s/^# //
803eeeeaa8a0 Updated libtool to version 2.2.6a
Sam Lantinga <slouken@libsdl.org>
parents: 1761
diff changeset
   529
	s/^# *$//
803eeeeaa8a0 Updated libtool to version 2.2.6a
Sam Lantinga <slouken@libsdl.org>
parents: 1761
diff changeset
   530
	s*\$progname*'$progname'*
803eeeeaa8a0 Updated libtool to version 2.2.6a
Sam Lantinga <slouken@libsdl.org>
parents: 1761
diff changeset
   531
	s*\$host*'"$host"'*
803eeeeaa8a0 Updated libtool to version 2.2.6a
Sam Lantinga <slouken@libsdl.org>
parents: 1761
diff changeset
   532
	s*\$SHELL*'"$SHELL"'*
803eeeeaa8a0 Updated libtool to version 2.2.6a
Sam Lantinga <slouken@libsdl.org>
parents: 1761
diff changeset
   533
	s*\$LTCC*'"$LTCC"'*
803eeeeaa8a0 Updated libtool to version 2.2.6a
Sam Lantinga <slouken@libsdl.org>
parents: 1761
diff changeset
   534
	s*\$LTCFLAGS*'"$LTCFLAGS"'*
803eeeeaa8a0 Updated libtool to version 2.2.6a
Sam Lantinga <slouken@libsdl.org>
parents: 1761
diff changeset
   535
	s*\$LD*'"$LD"'*
803eeeeaa8a0 Updated libtool to version 2.2.6a
Sam Lantinga <slouken@libsdl.org>
parents: 1761
diff changeset
   536
	s/\$with_gnu_ld/'"$with_gnu_ld"'/
803eeeeaa8a0 Updated libtool to version 2.2.6a
Sam Lantinga <slouken@libsdl.org>
parents: 1761
diff changeset
   537
	s/\$automake_version/'"`(automake --version) 2>/dev/null |$SED 1q`"'/
803eeeeaa8a0 Updated libtool to version 2.2.6a
Sam Lantinga <slouken@libsdl.org>
parents: 1761
diff changeset
   538
	s/\$autoconf_version/'"`(autoconf --version) 2>/dev/null |$SED 1q`"'/
803eeeeaa8a0 Updated libtool to version 2.2.6a
Sam Lantinga <slouken@libsdl.org>
parents: 1761
diff changeset
   539
	p
803eeeeaa8a0 Updated libtool to version 2.2.6a
Sam Lantinga <slouken@libsdl.org>
parents: 1761
diff changeset
   540
     }' < "$progpath"
803eeeeaa8a0 Updated libtool to version 2.2.6a
Sam Lantinga <slouken@libsdl.org>
parents: 1761
diff changeset
   541
    exit $?
803eeeeaa8a0 Updated libtool to version 2.2.6a
Sam Lantinga <slouken@libsdl.org>
parents: 1761
diff changeset
   542
}
803eeeeaa8a0 Updated libtool to version 2.2.6a
Sam Lantinga <slouken@libsdl.org>
parents: 1761
diff changeset
   543
803eeeeaa8a0 Updated libtool to version 2.2.6a
Sam Lantinga <slouken@libsdl.org>
parents: 1761
diff changeset
   544
# func_missing_arg argname
803eeeeaa8a0 Updated libtool to version 2.2.6a
Sam Lantinga <slouken@libsdl.org>
parents: 1761
diff changeset
   545
# Echo program name prefixed message to standard error and set global
803eeeeaa8a0 Updated libtool to version 2.2.6a
Sam Lantinga <slouken@libsdl.org>
parents: 1761
diff changeset
   546
# exit_cmd.
803eeeeaa8a0 Updated libtool to version 2.2.6a
Sam Lantinga <slouken@libsdl.org>
parents: 1761
diff changeset
   547
func_missing_arg ()
803eeeeaa8a0 Updated libtool to version 2.2.6a
Sam Lantinga <slouken@libsdl.org>
parents: 1761
diff changeset
   548
{
803eeeeaa8a0 Updated libtool to version 2.2.6a
Sam Lantinga <slouken@libsdl.org>
parents: 1761
diff changeset
   549
    func_error "missing argument for $1"
803eeeeaa8a0 Updated libtool to version 2.2.6a
Sam Lantinga <slouken@libsdl.org>
parents: 1761
diff changeset
   550
    exit_cmd=exit
803eeeeaa8a0 Updated libtool to version 2.2.6a
Sam Lantinga <slouken@libsdl.org>
parents: 1761
diff changeset
   551
}
803eeeeaa8a0 Updated libtool to version 2.2.6a
Sam Lantinga <slouken@libsdl.org>
parents: 1761
diff changeset
   552
803eeeeaa8a0 Updated libtool to version 2.2.6a
Sam Lantinga <slouken@libsdl.org>
parents: 1761
diff changeset
   553
exit_cmd=:
803eeeeaa8a0 Updated libtool to version 2.2.6a
Sam Lantinga <slouken@libsdl.org>
parents: 1761
diff changeset
   554
803eeeeaa8a0 Updated libtool to version 2.2.6a
Sam Lantinga <slouken@libsdl.org>
parents: 1761
diff changeset
   555
803eeeeaa8a0 Updated libtool to version 2.2.6a
Sam Lantinga <slouken@libsdl.org>
parents: 1761
diff changeset
   556
803eeeeaa8a0 Updated libtool to version 2.2.6a
Sam Lantinga <slouken@libsdl.org>
parents: 1761
diff changeset
   557
803eeeeaa8a0 Updated libtool to version 2.2.6a
Sam Lantinga <slouken@libsdl.org>
parents: 1761
diff changeset
   558
803eeeeaa8a0 Updated libtool to version 2.2.6a
Sam Lantinga <slouken@libsdl.org>
parents: 1761
diff changeset
   559
# Check that we have a working $ECHO.
1361
19418e4422cb New configure-based build system. Still work in progress, but much improved
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   560
if test "X$1" = X--no-reexec; then
19418e4422cb New configure-based build system. Still work in progress, but much improved
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   561
  # Discard the --no-reexec flag, and continue.
19418e4422cb New configure-based build system. Still work in progress, but much improved
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   562
  shift
19418e4422cb New configure-based build system. Still work in progress, but much improved
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   563
elif test "X$1" = X--fallback-echo; then
19418e4422cb New configure-based build system. Still work in progress, but much improved
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   564
  # Avoid inline document here, it may be left over
19418e4422cb New configure-based build system. Still work in progress, but much improved
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   565
  :
4277
803eeeeaa8a0 Updated libtool to version 2.2.6a
Sam Lantinga <slouken@libsdl.org>
parents: 1761
diff changeset
   566
elif test "X`{ $ECHO '\t'; } 2>/dev/null`" = 'X\t'; then
803eeeeaa8a0 Updated libtool to version 2.2.6a
Sam Lantinga <slouken@libsdl.org>
parents: 1761
diff changeset
   567
  # Yippee, $ECHO works!
1361
19418e4422cb New configure-based build system. Still work in progress, but much improved
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   568
  :
19418e4422cb New configure-based build system. Still work in progress, but much improved
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   569
else
4277
803eeeeaa8a0 Updated libtool to version 2.2.6a
Sam Lantinga <slouken@libsdl.org>
parents: 1761
diff changeset
   570
  # Restart under the correct shell, and then maybe $ECHO will work.
1361
19418e4422cb New configure-based build system. Still work in progress, but much improved
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   571
  exec $SHELL "$progpath" --no-reexec ${1+"$@"}
19418e4422cb New configure-based build system. Still work in progress, but much improved
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   572
fi
19418e4422cb New configure-based build system. Still work in progress, but much improved
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   573
19418e4422cb New configure-based build system. Still work in progress, but much improved
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   574
if test "X$1" = X--fallback-echo; then
19418e4422cb New configure-based build system. Still work in progress, but much improved
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   575
  # used as fallback echo
19418e4422cb New configure-based build system. Still work in progress, but much improved
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   576
  shift
19418e4422cb New configure-based build system. Still work in progress, but much improved
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   577
  cat <<EOF
19418e4422cb New configure-based build system. Still work in progress, but much improved
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   578
$*
19418e4422cb New configure-based build system. Still work in progress, but much improved
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   579
EOF
19418e4422cb New configure-based build system. Still work in progress, but much improved
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   580
  exit $EXIT_SUCCESS
19418e4422cb New configure-based build system. Still work in progress, but much improved
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   581
fi
19418e4422cb New configure-based build system. Still work in progress, but much improved
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   582
19418e4422cb New configure-based build system. Still work in progress, but much improved
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   583
magic="%%%MAGIC variable%%%"
4277
803eeeeaa8a0 Updated libtool to version 2.2.6a
Sam Lantinga <slouken@libsdl.org>
parents: 1761
diff changeset
   584
magic_exe="%%%MAGIC EXE variable%%%"
1361
19418e4422cb New configure-based build system. Still work in progress, but much improved
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   585
19418e4422cb New configure-based build system. Still work in progress, but much improved
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   586
# Global variables.
4277
803eeeeaa8a0 Updated libtool to version 2.2.6a
Sam Lantinga <slouken@libsdl.org>
parents: 1761
diff changeset
   587
# $mode is unset
1361
19418e4422cb New configure-based build system. Still work in progress, but much improved
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   588
nonopt=
19418e4422cb New configure-based build system. Still work in progress, but much improved
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   589
execute_dlfiles=
1570
a740bca2a1b1 Updated to libtool-1.5.22
Sam Lantinga <slouken@libsdl.org>
parents: 1361
diff changeset
   590
preserve_args=
1361
19418e4422cb New configure-based build system. Still work in progress, but much improved
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   591
lo2o="s/\\.lo\$/.${objext}/"
19418e4422cb New configure-based build system. Still work in progress, but much improved
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   592
o2lo="s/\\.${objext}\$/.lo/"
4277
803eeeeaa8a0 Updated libtool to version 2.2.6a
Sam Lantinga <slouken@libsdl.org>
parents: 1761
diff changeset
   593
extracted_archives=
803eeeeaa8a0 Updated libtool to version 2.2.6a
Sam Lantinga <slouken@libsdl.org>
parents: 1761
diff changeset
   594
extracted_serial=0
803eeeeaa8a0 Updated libtool to version 2.2.6a
Sam Lantinga <slouken@libsdl.org>
parents: 1761
diff changeset
   595
803eeeeaa8a0 Updated libtool to version 2.2.6a
Sam Lantinga <slouken@libsdl.org>
parents: 1761
diff changeset
   596
opt_dry_run=false
803eeeeaa8a0 Updated libtool to version 2.2.6a
Sam Lantinga <slouken@libsdl.org>
parents: 1761
diff changeset
   597
opt_duplicate_deps=false
803eeeeaa8a0 Updated libtool to version 2.2.6a
Sam Lantinga <slouken@libsdl.org>
parents: 1761
diff changeset
   598
opt_silent=false
803eeeeaa8a0 Updated libtool to version 2.2.6a
Sam Lantinga <slouken@libsdl.org>
parents: 1761
diff changeset
   599
opt_debug=:
803eeeeaa8a0 Updated libtool to version 2.2.6a
Sam Lantinga <slouken@libsdl.org>
parents: 1761
diff changeset
   600
803eeeeaa8a0 Updated libtool to version 2.2.6a
Sam Lantinga <slouken@libsdl.org>
parents: 1761
diff changeset
   601
# If this variable is set in any of the actions, the command in it
803eeeeaa8a0 Updated libtool to version 2.2.6a
Sam Lantinga <slouken@libsdl.org>
parents: 1761
diff changeset
   602
# will be execed at the end.  This prevents here-documents from being
803eeeeaa8a0 Updated libtool to version 2.2.6a
Sam Lantinga <slouken@libsdl.org>
parents: 1761
diff changeset
   603
# left over by shells.
803eeeeaa8a0 Updated libtool to version 2.2.6a
Sam Lantinga <slouken@libsdl.org>
parents: 1761
diff changeset
   604
exec_cmd=
803eeeeaa8a0 Updated libtool to version 2.2.6a
Sam Lantinga <slouken@libsdl.org>
parents: 1761
diff changeset
   605
803eeeeaa8a0 Updated libtool to version 2.2.6a
Sam Lantinga <slouken@libsdl.org>
parents: 1761
diff changeset
   606
# func_fatal_configuration arg...
803eeeeaa8a0 Updated libtool to version 2.2.6a
Sam Lantinga <slouken@libsdl.org>
parents: 1761
diff changeset
   607
# Echo program name prefixed message to standard error, followed by
803eeeeaa8a0 Updated libtool to version 2.2.6a
Sam Lantinga <slouken@libsdl.org>
parents: 1761
diff changeset
   608
# a configuration failure hint, and exit.
803eeeeaa8a0 Updated libtool to version 2.2.6a
Sam Lantinga <slouken@libsdl.org>
parents: 1761
diff changeset
   609
func_fatal_configuration ()
1570
a740bca2a1b1 Updated to libtool-1.5.22
Sam Lantinga <slouken@libsdl.org>
parents: 1361
diff changeset
   610
{
4277
803eeeeaa8a0 Updated libtool to version 2.2.6a
Sam Lantinga <slouken@libsdl.org>
parents: 1761
diff changeset
   611
    func_error ${1+"$@"}
803eeeeaa8a0 Updated libtool to version 2.2.6a
Sam Lantinga <slouken@libsdl.org>
parents: 1761
diff changeset
   612
    func_error "See the $PACKAGE documentation for more information."
803eeeeaa8a0 Updated libtool to version 2.2.6a
Sam Lantinga <slouken@libsdl.org>
parents: 1761
diff changeset
   613
    func_fatal_error "Fatal configuration error."
803eeeeaa8a0 Updated libtool to version 2.2.6a
Sam Lantinga <slouken@libsdl.org>
parents: 1761
diff changeset
   614
}
803eeeeaa8a0 Updated libtool to version 2.2.6a
Sam Lantinga <slouken@libsdl.org>
parents: 1761
diff changeset
   615
803eeeeaa8a0 Updated libtool to version 2.2.6a
Sam Lantinga <slouken@libsdl.org>
parents: 1761
diff changeset
   616
803eeeeaa8a0 Updated libtool to version 2.2.6a
Sam Lantinga <slouken@libsdl.org>
parents: 1761
diff changeset
   617
# func_config
803eeeeaa8a0 Updated libtool to version 2.2.6a
Sam Lantinga <slouken@libsdl.org>
parents: 1761
diff changeset
   618
# Display the configuration for all the tags in this script.
803eeeeaa8a0 Updated libtool to version 2.2.6a
Sam Lantinga <slouken@libsdl.org>
parents: 1761
diff changeset
   619
func_config ()
803eeeeaa8a0 Updated libtool to version 2.2.6a
Sam Lantinga <slouken@libsdl.org>
parents: 1761
diff changeset
   620
{
803eeeeaa8a0 Updated libtool to version 2.2.6a
Sam Lantinga <slouken@libsdl.org>
parents: 1761
diff changeset
   621
    re_begincf='^# ### BEGIN LIBTOOL'
803eeeeaa8a0 Updated libtool to version 2.2.6a
Sam Lantinga <slouken@libsdl.org>
parents: 1761
diff changeset
   622
    re_endcf='^# ### END LIBTOOL'
803eeeeaa8a0 Updated libtool to version 2.2.6a
Sam Lantinga <slouken@libsdl.org>
parents: 1761
diff changeset
   623
803eeeeaa8a0 Updated libtool to version 2.2.6a
Sam Lantinga <slouken@libsdl.org>
parents: 1761
diff changeset
   624
    # Default configuration.
803eeeeaa8a0 Updated libtool to version 2.2.6a
Sam Lantinga <slouken@libsdl.org>
parents: 1761
diff changeset
   625
    $SED "1,/$re_begincf CONFIG/d;/$re_endcf CONFIG/,\$d" < "$progpath"
803eeeeaa8a0 Updated libtool to version 2.2.6a
Sam Lantinga <slouken@libsdl.org>
parents: 1761
diff changeset
   626
803eeeeaa8a0 Updated libtool to version 2.2.6a
Sam Lantinga <slouken@libsdl.org>
parents: 1761
diff changeset
   627
    # Now print the configurations for the tags.
803eeeeaa8a0 Updated libtool to version 2.2.6a
Sam Lantinga <slouken@libsdl.org>
parents: 1761
diff changeset
   628
    for tagname in $taglist; do
803eeeeaa8a0 Updated libtool to version 2.2.6a
Sam Lantinga <slouken@libsdl.org>
parents: 1761
diff changeset
   629
      $SED -n "/$re_begincf TAG CONFIG: $tagname\$/,/$re_endcf TAG CONFIG: $tagname\$/p" < "$progpath"
803eeeeaa8a0 Updated libtool to version 2.2.6a
Sam Lantinga <slouken@libsdl.org>
parents: 1761
diff changeset
   630
    done
803eeeeaa8a0 Updated libtool to version 2.2.6a
Sam Lantinga <slouken@libsdl.org>
parents: 1761
diff changeset
   631
803eeeeaa8a0 Updated libtool to version 2.2.6a
Sam Lantinga <slouken@libsdl.org>
parents: 1761
diff changeset
   632
    exit $?
803eeeeaa8a0 Updated libtool to version 2.2.6a
Sam Lantinga <slouken@libsdl.org>
parents: 1761
diff changeset
   633
}
803eeeeaa8a0 Updated libtool to version 2.2.6a
Sam Lantinga <slouken@libsdl.org>
parents: 1761
diff changeset
   634
803eeeeaa8a0 Updated libtool to version 2.2.6a
Sam Lantinga <slouken@libsdl.org>
parents: 1761
diff changeset
   635
# func_features
803eeeeaa8a0 Updated libtool to version 2.2.6a
Sam Lantinga <slouken@libsdl.org>
parents: 1761
diff changeset
   636
# Display the features supported by this script.
803eeeeaa8a0 Updated libtool to version 2.2.6a
Sam Lantinga <slouken@libsdl.org>
parents: 1761
diff changeset
   637
func_features ()
803eeeeaa8a0 Updated libtool to version 2.2.6a
Sam Lantinga <slouken@libsdl.org>
parents: 1761
diff changeset
   638
{
803eeeeaa8a0 Updated libtool to version 2.2.6a
Sam Lantinga <slouken@libsdl.org>
parents: 1761
diff changeset
   639
    $ECHO "host: $host"
803eeeeaa8a0 Updated libtool to version 2.2.6a
Sam Lantinga <slouken@libsdl.org>
parents: 1761
diff changeset
   640
    if test "$build_libtool_libs" = yes; then
803eeeeaa8a0 Updated libtool to version 2.2.6a
Sam Lantinga <slouken@libsdl.org>
parents: 1761
diff changeset
   641
      $ECHO "enable shared libraries"
1570
a740bca2a1b1 Updated to libtool-1.5.22
Sam Lantinga <slouken@libsdl.org>
parents: 1361
diff changeset
   642
    else
4277
803eeeeaa8a0 Updated libtool to version 2.2.6a
Sam Lantinga <slouken@libsdl.org>
parents: 1761
diff changeset
   643
      $ECHO "disable shared libraries"
803eeeeaa8a0 Updated libtool to version 2.2.6a
Sam Lantinga <slouken@libsdl.org>
parents: 1761
diff changeset
   644
    fi
803eeeeaa8a0 Updated libtool to version 2.2.6a
Sam Lantinga <slouken@libsdl.org>
parents: 1761
diff changeset
   645
    if test "$build_old_libs" = yes; then
803eeeeaa8a0 Updated libtool to version 2.2.6a
Sam Lantinga <slouken@libsdl.org>
parents: 1761
diff changeset
   646
      $ECHO "enable static libraries"
803eeeeaa8a0 Updated libtool to version 2.2.6a
Sam Lantinga <slouken@libsdl.org>
parents: 1761
diff changeset
   647
    else
803eeeeaa8a0 Updated libtool to version 2.2.6a
Sam Lantinga <slouken@libsdl.org>
parents: 1761
diff changeset
   648
      $ECHO "disable static libraries"
1570
a740bca2a1b1 Updated to libtool-1.5.22
Sam Lantinga <slouken@libsdl.org>
parents: 1361
diff changeset
   649
    fi
a740bca2a1b1 Updated to libtool-1.5.22
Sam Lantinga <slouken@libsdl.org>
parents: 1361
diff changeset
   650
4277
803eeeeaa8a0 Updated libtool to version 2.2.6a
Sam Lantinga <slouken@libsdl.org>
parents: 1761
diff changeset
   651
    exit $?
1570
a740bca2a1b1 Updated to libtool-1.5.22
Sam Lantinga <slouken@libsdl.org>
parents: 1361
diff changeset
   652
}
a740bca2a1b1 Updated to libtool-1.5.22
Sam Lantinga <slouken@libsdl.org>
parents: 1361
diff changeset
   653
4277
803eeeeaa8a0 Updated libtool to version 2.2.6a
Sam Lantinga <slouken@libsdl.org>
parents: 1761
diff changeset
   654
# func_enable_tag tagname
803eeeeaa8a0 Updated libtool to version 2.2.6a
Sam Lantinga <slouken@libsdl.org>
parents: 1761
diff changeset
   655
# Verify that TAGNAME is valid, and either flag an error and exit, or
803eeeeaa8a0 Updated libtool to version 2.2.6a
Sam Lantinga <slouken@libsdl.org>
parents: 1761
diff changeset
   656
# enable the TAGNAME tag.  We also add TAGNAME to the global $taglist
803eeeeaa8a0 Updated libtool to version 2.2.6a
Sam Lantinga <slouken@libsdl.org>
parents: 1761
diff changeset
   657
# variable here.
803eeeeaa8a0 Updated libtool to version 2.2.6a
Sam Lantinga <slouken@libsdl.org>
parents: 1761
diff changeset
   658
func_enable_tag ()
1570
a740bca2a1b1 Updated to libtool-1.5.22
Sam Lantinga <slouken@libsdl.org>
parents: 1361
diff changeset
   659
{
4277
803eeeeaa8a0 Updated libtool to version 2.2.6a
Sam Lantinga <slouken@libsdl.org>
parents: 1761
diff changeset
   660
  # Global variable:
803eeeeaa8a0 Updated libtool to version 2.2.6a
Sam Lantinga <slouken@libsdl.org>
parents: 1761
diff changeset
   661
  tagname="$1"
803eeeeaa8a0 Updated libtool to version 2.2.6a
Sam Lantinga <slouken@libsdl.org>
parents: 1761
diff changeset
   662
803eeeeaa8a0 Updated libtool to version 2.2.6a
Sam Lantinga <slouken@libsdl.org>
parents: 1761
diff changeset
   663
  re_begincf="^# ### BEGIN LIBTOOL TAG CONFIG: $tagname\$"
803eeeeaa8a0 Updated libtool to version 2.2.6a
Sam Lantinga <slouken@libsdl.org>
parents: 1761
diff changeset
   664
  re_endcf="^# ### END LIBTOOL TAG CONFIG: $tagname\$"
803eeeeaa8a0 Updated libtool to version 2.2.6a
Sam Lantinga <slouken@libsdl.org>
parents: 1761
diff changeset
   665
  sed_extractcf="/$re_begincf/,/$re_endcf/p"
803eeeeaa8a0 Updated libtool to version 2.2.6a
Sam Lantinga <slouken@libsdl.org>
parents: 1761
diff changeset
   666
803eeeeaa8a0 Updated libtool to version 2.2.6a
Sam Lantinga <slouken@libsdl.org>
parents: 1761
diff changeset
   667
  # Validate tagname.
803eeeeaa8a0 Updated libtool to version 2.2.6a
Sam Lantinga <slouken@libsdl.org>
parents: 1761
diff changeset
   668
  case $tagname in
803eeeeaa8a0 Updated libtool to version 2.2.6a
Sam Lantinga <slouken@libsdl.org>
parents: 1761
diff changeset
   669
    *[!-_A-Za-z0-9,/]*)
803eeeeaa8a0 Updated libtool to version 2.2.6a
Sam Lantinga <slouken@libsdl.org>
parents: 1761
diff changeset
   670
      func_fatal_error "invalid tag name: $tagname"
803eeeeaa8a0 Updated libtool to version 2.2.6a
Sam Lantinga <slouken@libsdl.org>
parents: 1761
diff changeset
   671
      ;;
803eeeeaa8a0 Updated libtool to version 2.2.6a
Sam Lantinga <slouken@libsdl.org>
parents: 1761
diff changeset
   672
  esac
803eeeeaa8a0 Updated libtool to version 2.2.6a
Sam Lantinga <slouken@libsdl.org>
parents: 1761
diff changeset
   673
803eeeeaa8a0 Updated libtool to version 2.2.6a
Sam Lantinga <slouken@libsdl.org>
parents: 1761
diff changeset
   674
  # Don't test for the "default" C tag, as we know it's
803eeeeaa8a0 Updated libtool to version 2.2.6a
Sam Lantinga <slouken@libsdl.org>
parents: 1761
diff changeset
   675
  # there but not specially marked.
803eeeeaa8a0 Updated libtool to version 2.2.6a
Sam Lantinga <slouken@libsdl.org>
parents: 1761
diff changeset
   676
  case $tagname in
803eeeeaa8a0 Updated libtool to version 2.2.6a
Sam Lantinga <slouken@libsdl.org>
parents: 1761
diff changeset
   677
    CC) ;;
803eeeeaa8a0 Updated libtool to version 2.2.6a
Sam Lantinga <slouken@libsdl.org>
parents: 1761
diff changeset
   678
    *)
803eeeeaa8a0 Updated libtool to version 2.2.6a
Sam Lantinga <slouken@libsdl.org>
parents: 1761
diff changeset
   679
      if $GREP "$re_begincf" "$progpath" >/dev/null 2>&1; then
803eeeeaa8a0 Updated libtool to version 2.2.6a
Sam Lantinga <slouken@libsdl.org>
parents: 1761
diff changeset
   680
	taglist="$taglist $tagname"
803eeeeaa8a0 Updated libtool to version 2.2.6a
Sam Lantinga <slouken@libsdl.org>
parents: 1761
diff changeset
   681
803eeeeaa8a0 Updated libtool to version 2.2.6a
Sam Lantinga <slouken@libsdl.org>
parents: 1761
diff changeset
   682
	# Evaluate the configuration.  Be careful to quote the path
803eeeeaa8a0 Updated libtool to version 2.2.6a
Sam Lantinga <slouken@libsdl.org>
parents: 1761
diff changeset
   683
	# and the sed script, to avoid splitting on whitespace, but
803eeeeaa8a0 Updated libtool to version 2.2.6a
Sam Lantinga <slouken@libsdl.org>
parents: 1761
diff changeset
   684
	# also don't use non-portable quotes within backquotes within
803eeeeaa8a0 Updated libtool to version 2.2.6a
Sam Lantinga <slouken@libsdl.org>
parents: 1761
diff changeset
   685
	# quotes we have to do it in 2 steps:
803eeeeaa8a0 Updated libtool to version 2.2.6a
Sam Lantinga <slouken@libsdl.org>
parents: 1761
diff changeset
   686
	extractedcf=`$SED -n -e "$sed_extractcf" < "$progpath"`
803eeeeaa8a0 Updated libtool to version 2.2.6a
Sam Lantinga <slouken@libsdl.org>
parents: 1761
diff changeset
   687
	eval "$extractedcf"
803eeeeaa8a0 Updated libtool to version 2.2.6a
Sam Lantinga <slouken@libsdl.org>
parents: 1761
diff changeset
   688
      else
803eeeeaa8a0 Updated libtool to version 2.2.6a
Sam Lantinga <slouken@libsdl.org>
parents: 1761
diff changeset
   689
	func_error "ignoring unknown tag $tagname"
803eeeeaa8a0 Updated libtool to version 2.2.6a
Sam Lantinga <slouken@libsdl.org>
parents: 1761
diff changeset
   690
      fi
803eeeeaa8a0 Updated libtool to version 2.2.6a
Sam Lantinga <slouken@libsdl.org>
parents: 1761
diff changeset
   691
      ;;
803eeeeaa8a0 Updated libtool to version 2.2.6a
Sam Lantinga <slouken@libsdl.org>
parents: 1761
diff changeset
   692
  esac
803eeeeaa8a0 Updated libtool to version 2.2.6a
Sam Lantinga <slouken@libsdl.org>
parents: 1761
diff changeset
   693
}
803eeeeaa8a0 Updated libtool to version 2.2.6a
Sam Lantinga <slouken@libsdl.org>
parents: 1761
diff changeset
   694
803eeeeaa8a0 Updated libtool to version 2.2.6a
Sam Lantinga <slouken@libsdl.org>
parents: 1761
diff changeset
   695
# Parse options once, thoroughly.  This comes as soon as possible in
803eeeeaa8a0 Updated libtool to version 2.2.6a
Sam Lantinga <slouken@libsdl.org>
parents: 1761
diff changeset
   696
# the script to make things like `libtool --version' happen quickly.
803eeeeaa8a0 Updated libtool to version 2.2.6a
Sam Lantinga <slouken@libsdl.org>
parents: 1761
diff changeset
   697
{
803eeeeaa8a0 Updated libtool to version 2.2.6a
Sam Lantinga <slouken@libsdl.org>
parents: 1761
diff changeset
   698
803eeeeaa8a0 Updated libtool to version 2.2.6a
Sam Lantinga <slouken@libsdl.org>
parents: 1761
diff changeset
   699
  # Shorthand for --mode=foo, only valid as the first argument
803eeeeaa8a0 Updated libtool to version 2.2.6a
Sam Lantinga <slouken@libsdl.org>
parents: 1761
diff changeset
   700
  case $1 in
803eeeeaa8a0 Updated libtool to version 2.2.6a
Sam Lantinga <slouken@libsdl.org>
parents: 1761
diff changeset
   701
  clean|clea|cle|cl)
803eeeeaa8a0 Updated libtool to version 2.2.6a
Sam Lantinga <slouken@libsdl.org>
parents: 1761
diff changeset
   702
    shift; set dummy --mode clean ${1+"$@"}; shift
1361
19418e4422cb New configure-based build system. Still work in progress, but much improved
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   703
    ;;
4277
803eeeeaa8a0 Updated libtool to version 2.2.6a
Sam Lantinga <slouken@libsdl.org>
parents: 1761
diff changeset
   704
  compile|compil|compi|comp|com|co|c)
803eeeeaa8a0 Updated libtool to version 2.2.6a
Sam Lantinga <slouken@libsdl.org>
parents: 1761
diff changeset
   705
    shift; set dummy --mode compile ${1+"$@"}; shift
803eeeeaa8a0 Updated libtool to version 2.2.6a
Sam Lantinga <slouken@libsdl.org>
parents: 1761
diff changeset
   706
    ;;
803eeeeaa8a0 Updated libtool to version 2.2.6a
Sam Lantinga <slouken@libsdl.org>
parents: 1761
diff changeset
   707
  execute|execut|execu|exec|exe|ex|e)
803eeeeaa8a0 Updated libtool to version 2.2.6a
Sam Lantinga <slouken@libsdl.org>
parents: 1761
diff changeset
   708
    shift; set dummy --mode execute ${1+"$@"}; shift
803eeeeaa8a0 Updated libtool to version 2.2.6a
Sam Lantinga <slouken@libsdl.org>
parents: 1761
diff changeset
   709
    ;;
803eeeeaa8a0 Updated libtool to version 2.2.6a
Sam Lantinga <slouken@libsdl.org>
parents: 1761
diff changeset
   710
  finish|finis|fini|fin|fi|f)
803eeeeaa8a0 Updated libtool to version 2.2.6a
Sam Lantinga <slouken@libsdl.org>
parents: 1761
diff changeset
   711
    shift; set dummy --mode finish ${1+"$@"}; shift
1361
19418e4422cb New configure-based build system. Still work in progress, but much improved
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   712
    ;;
4277
803eeeeaa8a0 Updated libtool to version 2.2.6a
Sam Lantinga <slouken@libsdl.org>
parents: 1761
diff changeset
   713
  install|instal|insta|inst|ins|in|i)
803eeeeaa8a0 Updated libtool to version 2.2.6a
Sam Lantinga <slouken@libsdl.org>
parents: 1761
diff changeset
   714
    shift; set dummy --mode install ${1+"$@"}; shift
1361
19418e4422cb New configure-based build system. Still work in progress, but much improved
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   715
    ;;
4277
803eeeeaa8a0 Updated libtool to version 2.2.6a
Sam Lantinga <slouken@libsdl.org>
parents: 1761
diff changeset
   716
  link|lin|li|l)
803eeeeaa8a0 Updated libtool to version 2.2.6a
Sam Lantinga <slouken@libsdl.org>
parents: 1761
diff changeset
   717
    shift; set dummy --mode link ${1+"$@"}; shift
803eeeeaa8a0 Updated libtool to version 2.2.6a
Sam Lantinga <slouken@libsdl.org>
parents: 1761
diff changeset
   718
    ;;
803eeeeaa8a0 Updated libtool to version 2.2.6a
Sam Lantinga <slouken@libsdl.org>
parents: 1761
diff changeset
   719
  uninstall|uninstal|uninsta|uninst|unins|unin|uni|un|u)
803eeeeaa8a0 Updated libtool to version 2.2.6a
Sam Lantinga <slouken@libsdl.org>
parents: 1761
diff changeset
   720
    shift; set dummy --mode uninstall ${1+"$@"}; shift
1361
19418e4422cb New configure-based build system. Still work in progress, but much improved
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   721
    ;;
19418e4422cb New configure-based build system. Still work in progress, but much improved
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   722
  esac
4277
803eeeeaa8a0 Updated libtool to version 2.2.6a
Sam Lantinga <slouken@libsdl.org>
parents: 1761
diff changeset
   723
803eeeeaa8a0 Updated libtool to version 2.2.6a
Sam Lantinga <slouken@libsdl.org>
parents: 1761
diff changeset
   724
  # Parse non-mode specific arguments:
803eeeeaa8a0 Updated libtool to version 2.2.6a
Sam Lantinga <slouken@libsdl.org>
parents: 1761
diff changeset
   725
  while test "$#" -gt 0; do
803eeeeaa8a0 Updated libtool to version 2.2.6a
Sam Lantinga <slouken@libsdl.org>
parents: 1761
diff changeset
   726
    opt="$1"
803eeeeaa8a0 Updated libtool to version 2.2.6a
Sam Lantinga <slouken@libsdl.org>
parents: 1761
diff changeset
   727
    shift
803eeeeaa8a0 Updated libtool to version 2.2.6a
Sam Lantinga <slouken@libsdl.org>
parents: 1761
diff changeset
   728
803eeeeaa8a0 Updated libtool to version 2.2.6a
Sam Lantinga <slouken@libsdl.org>
parents: 1761
diff changeset
   729
    case $opt in
803eeeeaa8a0 Updated libtool to version 2.2.6a
Sam Lantinga <slouken@libsdl.org>
parents: 1761
diff changeset
   730
      --config)		func_config					;;
803eeeeaa8a0 Updated libtool to version 2.2.6a
Sam Lantinga <slouken@libsdl.org>
parents: 1761
diff changeset
   731
803eeeeaa8a0 Updated libtool to version 2.2.6a
Sam Lantinga <slouken@libsdl.org>
parents: 1761
diff changeset
   732
      --debug)		preserve_args="$preserve_args $opt"
803eeeeaa8a0 Updated libtool to version 2.2.6a
Sam Lantinga <slouken@libsdl.org>
parents: 1761
diff changeset
   733
			func_echo "enabling shell trace mode"
803eeeeaa8a0 Updated libtool to version 2.2.6a
Sam Lantinga <slouken@libsdl.org>
parents: 1761
diff changeset
   734
			opt_debug='set -x'
803eeeeaa8a0 Updated libtool to version 2.2.6a
Sam Lantinga <slouken@libsdl.org>
parents: 1761
diff changeset
   735
			$opt_debug
803eeeeaa8a0 Updated libtool to version 2.2.6a
Sam Lantinga <slouken@libsdl.org>
parents: 1761
diff changeset
   736
			;;
803eeeeaa8a0 Updated libtool to version 2.2.6a
Sam Lantinga <slouken@libsdl.org>
parents: 1761
diff changeset
   737
803eeeeaa8a0 Updated libtool to version 2.2.6a
Sam Lantinga <slouken@libsdl.org>
parents: 1761
diff changeset
   738
      -dlopen)		test "$#" -eq 0 && func_missing_arg "$opt" && break
803eeeeaa8a0 Updated libtool to version 2.2.6a
Sam Lantinga <slouken@libsdl.org>
parents: 1761
diff changeset
   739
			execute_dlfiles="$execute_dlfiles $1"
803eeeeaa8a0 Updated libtool to version 2.2.6a
Sam Lantinga <slouken@libsdl.org>
parents: 1761
diff changeset
   740
			shift
803eeeeaa8a0 Updated libtool to version 2.2.6a
Sam Lantinga <slouken@libsdl.org>
parents: 1761
diff changeset
   741
			;;
803eeeeaa8a0 Updated libtool to version 2.2.6a
Sam Lantinga <slouken@libsdl.org>
parents: 1761
diff changeset
   742
803eeeeaa8a0 Updated libtool to version 2.2.6a
Sam Lantinga <slouken@libsdl.org>
parents: 1761
diff changeset
   743
      --dry-run | -n)	opt_dry_run=:					;;
803eeeeaa8a0 Updated libtool to version 2.2.6a
Sam Lantinga <slouken@libsdl.org>
parents: 1761
diff changeset
   744
      --features)       func_features					;;
803eeeeaa8a0 Updated libtool to version 2.2.6a
Sam Lantinga <slouken@libsdl.org>
parents: 1761
diff changeset
   745
      --finish)		mode="finish"					;;
803eeeeaa8a0 Updated libtool to version 2.2.6a
Sam Lantinga <slouken@libsdl.org>
parents: 1761
diff changeset
   746
803eeeeaa8a0 Updated libtool to version 2.2.6a
Sam Lantinga <slouken@libsdl.org>
parents: 1761
diff changeset
   747
      --mode)		test "$#" -eq 0 && func_missing_arg "$opt" && break
803eeeeaa8a0 Updated libtool to version 2.2.6a
Sam Lantinga <slouken@libsdl.org>
parents: 1761
diff changeset
   748
			case $1 in
803eeeeaa8a0 Updated libtool to version 2.2.6a
Sam Lantinga <slouken@libsdl.org>
parents: 1761
diff changeset
   749
			  # Valid mode arguments:
803eeeeaa8a0 Updated libtool to version 2.2.6a
Sam Lantinga <slouken@libsdl.org>
parents: 1761
diff changeset
   750
			  clean)	;;
803eeeeaa8a0 Updated libtool to version 2.2.6a
Sam Lantinga <slouken@libsdl.org>
parents: 1761
diff changeset
   751
			  compile)	;;
803eeeeaa8a0 Updated libtool to version 2.2.6a
Sam Lantinga <slouken@libsdl.org>
parents: 1761
diff changeset
   752
			  execute)	;;
803eeeeaa8a0 Updated libtool to version 2.2.6a
Sam Lantinga <slouken@libsdl.org>
parents: 1761
diff changeset
   753
			  finish)	;;
803eeeeaa8a0 Updated libtool to version 2.2.6a
Sam Lantinga <slouken@libsdl.org>
parents: 1761
diff changeset
   754
			  install)	;;
803eeeeaa8a0 Updated libtool to version 2.2.6a
Sam Lantinga <slouken@libsdl.org>
parents: 1761
diff changeset
   755
			  link)		;;
803eeeeaa8a0 Updated libtool to version 2.2.6a
Sam Lantinga <slouken@libsdl.org>
parents: 1761
diff changeset
   756
			  relink)	;;
803eeeeaa8a0 Updated libtool to version 2.2.6a
Sam Lantinga <slouken@libsdl.org>
parents: 1761
diff changeset
   757
			  uninstall)	;;
803eeeeaa8a0 Updated libtool to version 2.2.6a
Sam Lantinga <slouken@libsdl.org>
parents: 1761
diff changeset
   758
803eeeeaa8a0 Updated libtool to version 2.2.6a
Sam Lantinga <slouken@libsdl.org>
parents: 1761
diff changeset
   759
			  # Catch anything else as an error
803eeeeaa8a0 Updated libtool to version 2.2.6a
Sam Lantinga <slouken@libsdl.org>
parents: 1761
diff changeset
   760
			  *) func_error "invalid argument for $opt"
803eeeeaa8a0 Updated libtool to version 2.2.6a
Sam Lantinga <slouken@libsdl.org>
parents: 1761
diff changeset
   761
			     exit_cmd=exit
803eeeeaa8a0 Updated libtool to version 2.2.6a
Sam Lantinga <slouken@libsdl.org>
parents: 1761
diff changeset
   762
			     break
803eeeeaa8a0 Updated libtool to version 2.2.6a
Sam Lantinga <slouken@libsdl.org>
parents: 1761
diff changeset
   763
			     ;;
803eeeeaa8a0 Updated libtool to version 2.2.6a
Sam Lantinga <slouken@libsdl.org>
parents: 1761
diff changeset
   764
		        esac
803eeeeaa8a0 Updated libtool to version 2.2.6a
Sam Lantinga <slouken@libsdl.org>
parents: 1761
diff changeset
   765
803eeeeaa8a0 Updated libtool to version 2.2.6a
Sam Lantinga <slouken@libsdl.org>
parents: 1761
diff changeset
   766
			mode="$1"
803eeeeaa8a0 Updated libtool to version 2.2.6a
Sam Lantinga <slouken@libsdl.org>
parents: 1761
diff changeset
   767
			shift
803eeeeaa8a0 Updated libtool to version 2.2.6a
Sam Lantinga <slouken@libsdl.org>
parents: 1761
diff changeset
   768
			;;
803eeeeaa8a0 Updated libtool to version 2.2.6a
Sam Lantinga <slouken@libsdl.org>
parents: 1761
diff changeset
   769
803eeeeaa8a0 Updated libtool to version 2.2.6a
Sam Lantinga <slouken@libsdl.org>
parents: 1761
diff changeset
   770
      --preserve-dup-deps)
803eeeeaa8a0 Updated libtool to version 2.2.6a
Sam Lantinga <slouken@libsdl.org>
parents: 1761
diff changeset
   771
			opt_duplicate_deps=:				;;
803eeeeaa8a0 Updated libtool to version 2.2.6a
Sam Lantinga <slouken@libsdl.org>
parents: 1761
diff changeset
   772
803eeeeaa8a0 Updated libtool to version 2.2.6a
Sam Lantinga <slouken@libsdl.org>
parents: 1761
diff changeset
   773
      --quiet|--silent)	preserve_args="$preserve_args $opt"
803eeeeaa8a0 Updated libtool to version 2.2.6a
Sam Lantinga <slouken@libsdl.org>
parents: 1761
diff changeset
   774
			opt_silent=:
803eeeeaa8a0 Updated libtool to version 2.2.6a
Sam Lantinga <slouken@libsdl.org>
parents: 1761
diff changeset
   775
			;;
803eeeeaa8a0 Updated libtool to version 2.2.6a
Sam Lantinga <slouken@libsdl.org>
parents: 1761
diff changeset
   776
803eeeeaa8a0 Updated libtool to version 2.2.6a
Sam Lantinga <slouken@libsdl.org>
parents: 1761
diff changeset
   777
      --verbose| -v)	preserve_args="$preserve_args $opt"
803eeeeaa8a0 Updated libtool to version 2.2.6a
Sam Lantinga <slouken@libsdl.org>
parents: 1761
diff changeset
   778
			opt_silent=false
803eeeeaa8a0 Updated libtool to version 2.2.6a
Sam Lantinga <slouken@libsdl.org>
parents: 1761
diff changeset
   779
			;;
803eeeeaa8a0 Updated libtool to version 2.2.6a
Sam Lantinga <slouken@libsdl.org>
parents: 1761
diff changeset
   780
803eeeeaa8a0 Updated libtool to version 2.2.6a
Sam Lantinga <slouken@libsdl.org>
parents: 1761
diff changeset
   781
      --tag)		test "$#" -eq 0 && func_missing_arg "$opt" && break
803eeeeaa8a0 Updated libtool to version 2.2.6a
Sam Lantinga <slouken@libsdl.org>
parents: 1761
diff changeset
   782
			preserve_args="$preserve_args $opt $1"
803eeeeaa8a0 Updated libtool to version 2.2.6a
Sam Lantinga <slouken@libsdl.org>
parents: 1761
diff changeset
   783
			func_enable_tag "$1"	# tagname is set here
803eeeeaa8a0 Updated libtool to version 2.2.6a
Sam Lantinga <slouken@libsdl.org>
parents: 1761
diff changeset
   784
			shift
803eeeeaa8a0 Updated libtool to version 2.2.6a
Sam Lantinga <slouken@libsdl.org>
parents: 1761
diff changeset
   785
			;;
803eeeeaa8a0 Updated libtool to version 2.2.6a
Sam Lantinga <slouken@libsdl.org>
parents: 1761
diff changeset
   786
803eeeeaa8a0 Updated libtool to version 2.2.6a
Sam Lantinga <slouken@libsdl.org>
parents: 1761
diff changeset
   787
      # Separate optargs to long options:
803eeeeaa8a0 Updated libtool to version 2.2.6a
Sam Lantinga <slouken@libsdl.org>
parents: 1761
diff changeset
   788
      -dlopen=*|--mode=*|--tag=*)
803eeeeaa8a0 Updated libtool to version 2.2.6a
Sam Lantinga <slouken@libsdl.org>
parents: 1761
diff changeset
   789
			func_opt_split "$opt"
803eeeeaa8a0 Updated libtool to version 2.2.6a
Sam Lantinga <slouken@libsdl.org>
parents: 1761
diff changeset
   790
			set dummy "$func_opt_split_opt" "$func_opt_split_arg" ${1+"$@"}
803eeeeaa8a0 Updated libtool to version 2.2.6a
Sam Lantinga <slouken@libsdl.org>
parents: 1761
diff changeset
   791
			shift
803eeeeaa8a0 Updated libtool to version 2.2.6a
Sam Lantinga <slouken@libsdl.org>
parents: 1761
diff changeset
   792
			;;
803eeeeaa8a0 Updated libtool to version 2.2.6a
Sam Lantinga <slouken@libsdl.org>
parents: 1761
diff changeset
   793
803eeeeaa8a0 Updated libtool to version 2.2.6a
Sam Lantinga <slouken@libsdl.org>
parents: 1761
diff changeset
   794
      -\?|-h)		func_usage					;;
803eeeeaa8a0 Updated libtool to version 2.2.6a
Sam Lantinga <slouken@libsdl.org>
parents: 1761
diff changeset
   795
      --help)		opt_help=:					;;
803eeeeaa8a0 Updated libtool to version 2.2.6a
Sam Lantinga <slouken@libsdl.org>
parents: 1761
diff changeset
   796
      --version)	func_version					;;
803eeeeaa8a0 Updated libtool to version 2.2.6a
Sam Lantinga <slouken@libsdl.org>
parents: 1761
diff changeset
   797
803eeeeaa8a0 Updated libtool to version 2.2.6a
Sam Lantinga <slouken@libsdl.org>
parents: 1761
diff changeset
   798
      -*)		func_fatal_help "unrecognized option \`$opt'"	;;
803eeeeaa8a0 Updated libtool to version 2.2.6a
Sam Lantinga <slouken@libsdl.org>
parents: 1761
diff changeset
   799
803eeeeaa8a0 Updated libtool to version 2.2.6a
Sam Lantinga <slouken@libsdl.org>
parents: 1761
diff changeset
   800
      *)		nonopt="$opt"
803eeeeaa8a0 Updated libtool to version 2.2.6a
Sam Lantinga <slouken@libsdl.org>
parents: 1761
diff changeset
   801
			break
803eeeeaa8a0 Updated libtool to version 2.2.6a
Sam Lantinga <slouken@libsdl.org>
parents: 1761
diff changeset
   802
			;;
803eeeeaa8a0 Updated libtool to version 2.2.6a
Sam Lantinga <slouken@libsdl.org>
parents: 1761
diff changeset
   803
    esac
803eeeeaa8a0 Updated libtool to version 2.2.6a
Sam Lantinga <slouken@libsdl.org>
parents: 1761
diff changeset
   804
  done
803eeeeaa8a0 Updated libtool to version 2.2.6a
Sam Lantinga <slouken@libsdl.org>
parents: 1761
diff changeset
   805
803eeeeaa8a0 Updated libtool to version 2.2.6a
Sam Lantinga <slouken@libsdl.org>
parents: 1761
diff changeset
   806
803eeeeaa8a0 Updated libtool to version 2.2.6a
Sam Lantinga <slouken@libsdl.org>
parents: 1761
diff changeset
   807
  case $host in
803eeeeaa8a0 Updated libtool to version 2.2.6a
Sam Lantinga <slouken@libsdl.org>
parents: 1761
diff changeset
   808
    *cygwin* | *mingw* | *pw32* | *cegcc*)
803eeeeaa8a0 Updated libtool to version 2.2.6a
Sam Lantinga <slouken@libsdl.org>
parents: 1761
diff changeset
   809
      # don't eliminate duplications in $postdeps and $predeps
803eeeeaa8a0 Updated libtool to version 2.2.6a
Sam Lantinga <slouken@libsdl.org>
parents: 1761
diff changeset
   810
      opt_duplicate_compiler_generated_deps=:
803eeeeaa8a0 Updated libtool to version 2.2.6a
Sam Lantinga <slouken@libsdl.org>
parents: 1761
diff changeset
   811
      ;;
803eeeeaa8a0 Updated libtool to version 2.2.6a
Sam Lantinga <slouken@libsdl.org>
parents: 1761
diff changeset
   812
    *)
803eeeeaa8a0 Updated libtool to version 2.2.6a
Sam Lantinga <slouken@libsdl.org>
parents: 1761
diff changeset
   813
      opt_duplicate_compiler_generated_deps=$opt_duplicate_deps
803eeeeaa8a0 Updated libtool to version 2.2.6a
Sam Lantinga <slouken@libsdl.org>
parents: 1761
diff changeset
   814
      ;;
803eeeeaa8a0 Updated libtool to version 2.2.6a
Sam Lantinga <slouken@libsdl.org>
parents: 1761
diff changeset
   815
  esac
803eeeeaa8a0 Updated libtool to version 2.2.6a
Sam Lantinga <slouken@libsdl.org>
parents: 1761
diff changeset
   816
803eeeeaa8a0 Updated libtool to version 2.2.6a
Sam Lantinga <slouken@libsdl.org>
parents: 1761
diff changeset
   817
  # Having warned about all mis-specified options, bail out if
803eeeeaa8a0 Updated libtool to version 2.2.6a
Sam Lantinga <slouken@libsdl.org>
parents: 1761
diff changeset
   818
  # anything was wrong.
803eeeeaa8a0 Updated libtool to version 2.2.6a
Sam Lantinga <slouken@libsdl.org>
parents: 1761
diff changeset
   819
  $exit_cmd $EXIT_FAILURE
803eeeeaa8a0 Updated libtool to version 2.2.6a
Sam Lantinga <slouken@libsdl.org>
parents: 1761
diff changeset
   820
}
803eeeeaa8a0 Updated libtool to version 2.2.6a
Sam Lantinga <slouken@libsdl.org>
parents: 1761
diff changeset
   821
803eeeeaa8a0 Updated libtool to version 2.2.6a
Sam Lantinga <slouken@libsdl.org>
parents: 1761
diff changeset
   822
# func_check_version_match
803eeeeaa8a0 Updated libtool to version 2.2.6a
Sam Lantinga <slouken@libsdl.org>
parents: 1761
diff changeset
   823
# Ensure that we are using m4 macros, and libtool script from the same
803eeeeaa8a0 Updated libtool to version 2.2.6a
Sam Lantinga <slouken@libsdl.org>
parents: 1761
diff changeset
   824
# release of libtool.
803eeeeaa8a0 Updated libtool to version 2.2.6a
Sam Lantinga <slouken@libsdl.org>
parents: 1761
diff changeset
   825
func_check_version_match ()
803eeeeaa8a0 Updated libtool to version 2.2.6a
Sam Lantinga <slouken@libsdl.org>
parents: 1761
diff changeset
   826
{
803eeeeaa8a0 Updated libtool to version 2.2.6a
Sam Lantinga <slouken@libsdl.org>
parents: 1761
diff changeset
   827
  if test "$package_revision" != "$macro_revision"; then
803eeeeaa8a0 Updated libtool to version 2.2.6a
Sam Lantinga <slouken@libsdl.org>
parents: 1761
diff changeset
   828
    if test "$VERSION" != "$macro_version"; then
803eeeeaa8a0 Updated libtool to version 2.2.6a
Sam Lantinga <slouken@libsdl.org>
parents: 1761
diff changeset
   829
      if test -z "$macro_version"; then
803eeeeaa8a0 Updated libtool to version 2.2.6a
Sam Lantinga <slouken@libsdl.org>
parents: 1761
diff changeset
   830
        cat >&2 <<_LT_EOF
803eeeeaa8a0 Updated libtool to version 2.2.6a
Sam Lantinga <slouken@libsdl.org>
parents: 1761
diff changeset
   831
$progname: Version mismatch error.  This is $PACKAGE $VERSION, but the
803eeeeaa8a0 Updated libtool to version 2.2.6a
Sam Lantinga <slouken@libsdl.org>
parents: 1761
diff changeset
   832
$progname: definition of this LT_INIT comes from an older release.
803eeeeaa8a0 Updated libtool to version 2.2.6a
Sam Lantinga <slouken@libsdl.org>
parents: 1761
diff changeset
   833
$progname: You should recreate aclocal.m4 with macros from $PACKAGE $VERSION
803eeeeaa8a0 Updated libtool to version 2.2.6a
Sam Lantinga <slouken@libsdl.org>
parents: 1761
diff changeset
   834
$progname: and run autoconf again.
803eeeeaa8a0 Updated libtool to version 2.2.6a
Sam Lantinga <slouken@libsdl.org>
parents: 1761
diff changeset
   835
_LT_EOF
803eeeeaa8a0 Updated libtool to version 2.2.6a
Sam Lantinga <slouken@libsdl.org>
parents: 1761
diff changeset
   836
      else
803eeeeaa8a0 Updated libtool to version 2.2.6a
Sam Lantinga <slouken@libsdl.org>
parents: 1761
diff changeset
   837
        cat >&2 <<_LT_EOF
803eeeeaa8a0 Updated libtool to version 2.2.6a
Sam Lantinga <slouken@libsdl.org>
parents: 1761
diff changeset
   838
$progname: Version mismatch error.  This is $PACKAGE $VERSION, but the
803eeeeaa8a0 Updated libtool to version 2.2.6a
Sam Lantinga <slouken@libsdl.org>
parents: 1761
diff changeset
   839
$progname: definition of this LT_INIT comes from $PACKAGE $macro_version.
803eeeeaa8a0 Updated libtool to version 2.2.6a
Sam Lantinga <slouken@libsdl.org>
parents: 1761
diff changeset
   840
$progname: You should recreate aclocal.m4 with macros from $PACKAGE $VERSION
803eeeeaa8a0 Updated libtool to version 2.2.6a
Sam Lantinga <slouken@libsdl.org>
parents: 1761
diff changeset
   841
$progname: and run autoconf again.
803eeeeaa8a0 Updated libtool to version 2.2.6a
Sam Lantinga <slouken@libsdl.org>
parents: 1761
diff changeset
   842
_LT_EOF
803eeeeaa8a0 Updated libtool to version 2.2.6a
Sam Lantinga <slouken@libsdl.org>
parents: 1761
diff changeset
   843
      fi
803eeeeaa8a0 Updated libtool to version 2.2.6a
Sam Lantinga <slouken@libsdl.org>
parents: 1761
diff changeset
   844
    else
803eeeeaa8a0 Updated libtool to version 2.2.6a
Sam Lantinga <slouken@libsdl.org>
parents: 1761
diff changeset
   845
      cat >&2 <<_LT_EOF
803eeeeaa8a0 Updated libtool to version 2.2.6a
Sam Lantinga <slouken@libsdl.org>
parents: 1761
diff changeset
   846
$progname: Version mismatch error.  This is $PACKAGE $VERSION, revision $package_revision,
803eeeeaa8a0 Updated libtool to version 2.2.6a
Sam Lantinga <slouken@libsdl.org>
parents: 1761
diff changeset
   847
$progname: but the definition of this LT_INIT comes from revision $macro_revision.
803eeeeaa8a0 Updated libtool to version 2.2.6a
Sam Lantinga <slouken@libsdl.org>
parents: 1761
diff changeset
   848
$progname: You should recreate aclocal.m4 with macros from revision $package_revision
803eeeeaa8a0 Updated libtool to version 2.2.6a
Sam Lantinga <slouken@libsdl.org>
parents: 1761
diff changeset
   849
$progname: of $PACKAGE $VERSION and run autoconf again.
803eeeeaa8a0 Updated libtool to version 2.2.6a
Sam Lantinga <slouken@libsdl.org>
parents: 1761
diff changeset
   850
_LT_EOF
803eeeeaa8a0 Updated libtool to version 2.2.6a
Sam Lantinga <slouken@libsdl.org>
parents: 1761
diff changeset
   851
    fi
803eeeeaa8a0 Updated libtool to version 2.2.6a
Sam Lantinga <slouken@libsdl.org>
parents: 1761
diff changeset
   852
803eeeeaa8a0 Updated libtool to version 2.2.6a
Sam Lantinga <slouken@libsdl.org>
parents: 1761
diff changeset
   853
    exit $EXIT_MISMATCH
803eeeeaa8a0 Updated libtool to version 2.2.6a
Sam Lantinga <slouken@libsdl.org>
parents: 1761
diff changeset
   854
  fi
803eeeeaa8a0 Updated libtool to version 2.2.6a
Sam Lantinga <slouken@libsdl.org>
parents: 1761
diff changeset
   855
}
803eeeeaa8a0 Updated libtool to version 2.2.6a
Sam Lantinga <slouken@libsdl.org>
parents: 1761
diff changeset
   856
803eeeeaa8a0 Updated libtool to version 2.2.6a
Sam Lantinga <slouken@libsdl.org>
parents: 1761
diff changeset
   857
803eeeeaa8a0 Updated libtool to version 2.2.6a
Sam Lantinga <slouken@libsdl.org>
parents: 1761
diff changeset
   858
## ----------- ##
803eeeeaa8a0 Updated libtool to version 2.2.6a
Sam Lantinga <slouken@libsdl.org>
parents: 1761
diff changeset
   859
##    Main.    ##
803eeeeaa8a0 Updated libtool to version 2.2.6a
Sam Lantinga <slouken@libsdl.org>
parents: 1761
diff changeset
   860
## ----------- ##
803eeeeaa8a0 Updated libtool to version 2.2.6a
Sam Lantinga <slouken@libsdl.org>
parents: 1761
diff changeset
   861
803eeeeaa8a0 Updated libtool to version 2.2.6a
Sam Lantinga <slouken@libsdl.org>
parents: 1761
diff changeset
   862
$opt_help || {
803eeeeaa8a0 Updated libtool to version 2.2.6a
Sam Lantinga <slouken@libsdl.org>
parents: 1761
diff changeset
   863
  # Sanity checks first:
803eeeeaa8a0 Updated libtool to version 2.2.6a
Sam Lantinga <slouken@libsdl.org>
parents: 1761
diff changeset
   864
  func_check_version_match
803eeeeaa8a0 Updated libtool to version 2.2.6a
Sam Lantinga <slouken@libsdl.org>
parents: 1761
diff changeset
   865
803eeeeaa8a0 Updated libtool to version 2.2.6a
Sam Lantinga <slouken@libsdl.org>
parents: 1761
diff changeset
   866
  if test "$build_libtool_libs" != yes && test "$build_old_libs" != yes; then
803eeeeaa8a0 Updated libtool to version 2.2.6a
Sam Lantinga <slouken@libsdl.org>
parents: 1761
diff changeset
   867
    func_fatal_configuration "not configured to build any kind of library"
803eeeeaa8a0 Updated libtool to version 2.2.6a
Sam Lantinga <slouken@libsdl.org>
parents: 1761
diff changeset
   868
  fi
803eeeeaa8a0 Updated libtool to version 2.2.6a
Sam Lantinga <slouken@libsdl.org>
parents: 1761
diff changeset
   869
803eeeeaa8a0 Updated libtool to version 2.2.6a
Sam Lantinga <slouken@libsdl.org>
parents: 1761
diff changeset
   870
  test -z "$mode" && func_fatal_error "error: you must specify a MODE."
803eeeeaa8a0 Updated libtool to version 2.2.6a
Sam Lantinga <slouken@libsdl.org>
parents: 1761
diff changeset
   871
803eeeeaa8a0 Updated libtool to version 2.2.6a
Sam Lantinga <slouken@libsdl.org>
parents: 1761
diff changeset
   872
803eeeeaa8a0 Updated libtool to version 2.2.6a
Sam Lantinga <slouken@libsdl.org>
parents: 1761
diff changeset
   873
  # Darwin sucks
803eeeeaa8a0 Updated libtool to version 2.2.6a
Sam Lantinga <slouken@libsdl.org>
parents: 1761
diff changeset
   874
  eval std_shrext=\"$shrext_cmds\"
803eeeeaa8a0 Updated libtool to version 2.2.6a
Sam Lantinga <slouken@libsdl.org>
parents: 1761
diff changeset
   875
803eeeeaa8a0 Updated libtool to version 2.2.6a
Sam Lantinga <slouken@libsdl.org>
parents: 1761
diff changeset
   876
803eeeeaa8a0 Updated libtool to version 2.2.6a
Sam Lantinga <slouken@libsdl.org>
parents: 1761
diff changeset
   877
  # Only execute mode is allowed to have -dlopen flags.
803eeeeaa8a0 Updated libtool to version 2.2.6a
Sam Lantinga <slouken@libsdl.org>
parents: 1761
diff changeset
   878
  if test -n "$execute_dlfiles" && test "$mode" != execute; then
803eeeeaa8a0 Updated libtool to version 2.2.6a
Sam Lantinga <slouken@libsdl.org>
parents: 1761
diff changeset
   879
    func_error "unrecognized option \`-dlopen'"
803eeeeaa8a0 Updated libtool to version 2.2.6a
Sam Lantinga <slouken@libsdl.org>
parents: 1761
diff changeset
   880
    $ECHO "$help" 1>&2
803eeeeaa8a0 Updated libtool to version 2.2.6a
Sam Lantinga <slouken@libsdl.org>
parents: 1761
diff changeset
   881
    exit $EXIT_FAILURE
803eeeeaa8a0 Updated libtool to version 2.2.6a
Sam Lantinga <slouken@libsdl.org>
parents: 1761
diff changeset
   882
  fi
803eeeeaa8a0 Updated libtool to version 2.2.6a
Sam Lantinga <slouken@libsdl.org>
parents: 1761
diff changeset
   883
803eeeeaa8a0 Updated libtool to version 2.2.6a
Sam Lantinga <slouken@libsdl.org>
parents: 1761
diff changeset
   884
  # Change the help message to a mode-specific one.
803eeeeaa8a0 Updated libtool to version 2.2.6a
Sam Lantinga <slouken@libsdl.org>
parents: 1761
diff changeset
   885
  generic_help="$help"
803eeeeaa8a0 Updated libtool to version 2.2.6a
Sam Lantinga <slouken@libsdl.org>
parents: 1761
diff changeset
   886
  help="Try \`$progname --help --mode=$mode' for more information."
803eeeeaa8a0 Updated libtool to version 2.2.6a
Sam Lantinga <slouken@libsdl.org>
parents: 1761
diff changeset
   887
}
803eeeeaa8a0 Updated libtool to version 2.2.6a
Sam Lantinga <slouken@libsdl.org>
parents: 1761
diff changeset
   888
803eeeeaa8a0 Updated libtool to version 2.2.6a
Sam Lantinga <slouken@libsdl.org>
parents: 1761
diff changeset
   889
803eeeeaa8a0 Updated libtool to version 2.2.6a
Sam Lantinga <slouken@libsdl.org>
parents: 1761
diff changeset
   890
# func_lalib_p file
803eeeeaa8a0 Updated libtool to version 2.2.6a
Sam Lantinga <slouken@libsdl.org>
parents: 1761
diff changeset
   891
# True iff FILE is a libtool `.la' library or `.lo' object file.
803eeeeaa8a0 Updated libtool to version 2.2.6a
Sam Lantinga <slouken@libsdl.org>
parents: 1761
diff changeset
   892
# This function is only a basic sanity check; it will hardly flush out
803eeeeaa8a0 Updated libtool to version 2.2.6a
Sam Lantinga <slouken@libsdl.org>
parents: 1761
diff changeset
   893
# determined imposters.
803eeeeaa8a0 Updated libtool to version 2.2.6a
Sam Lantinga <slouken@libsdl.org>
parents: 1761
diff changeset
   894
func_lalib_p ()
803eeeeaa8a0 Updated libtool to version 2.2.6a
Sam Lantinga <slouken@libsdl.org>
parents: 1761
diff changeset
   895
{
803eeeeaa8a0 Updated libtool to version 2.2.6a
Sam Lantinga <slouken@libsdl.org>
parents: 1761
diff changeset
   896
    test -f "$1" &&
803eeeeaa8a0 Updated libtool to version 2.2.6a
Sam Lantinga <slouken@libsdl.org>
parents: 1761
diff changeset
   897
      $SED -e 4q "$1" 2>/dev/null \
803eeeeaa8a0 Updated libtool to version 2.2.6a
Sam Lantinga <slouken@libsdl.org>
parents: 1761
diff changeset
   898
        | $GREP "^# Generated by .*$PACKAGE" > /dev/null 2>&1
803eeeeaa8a0 Updated libtool to version 2.2.6a
Sam Lantinga <slouken@libsdl.org>
parents: 1761
diff changeset
   899
}
803eeeeaa8a0 Updated libtool to version 2.2.6a
Sam Lantinga <slouken@libsdl.org>
parents: 1761
diff changeset
   900
803eeeeaa8a0 Updated libtool to version 2.2.6a
Sam Lantinga <slouken@libsdl.org>
parents: 1761
diff changeset
   901
# func_lalib_unsafe_p file
803eeeeaa8a0 Updated libtool to version 2.2.6a
Sam Lantinga <slouken@libsdl.org>
parents: 1761
diff changeset
   902
# True iff FILE is a libtool `.la' library or `.lo' object file.
803eeeeaa8a0 Updated libtool to version 2.2.6a
Sam Lantinga <slouken@libsdl.org>
parents: 1761
diff changeset
   903
# This function implements the same check as func_lalib_p without
803eeeeaa8a0 Updated libtool to version 2.2.6a
Sam Lantinga <slouken@libsdl.org>
parents: 1761
diff changeset
   904
# resorting to external programs.  To this end, it redirects stdin and
803eeeeaa8a0 Updated libtool to version 2.2.6a
Sam Lantinga <slouken@libsdl.org>
parents: 1761
diff changeset
   905
# closes it afterwards, without saving the original file descriptor.
803eeeeaa8a0 Updated libtool to version 2.2.6a
Sam Lantinga <slouken@libsdl.org>
parents: 1761
diff changeset
   906
# As a safety measure, use it only where a negative result would be
803eeeeaa8a0 Updated libtool to version 2.2.6a
Sam Lantinga <slouken@libsdl.org>
parents: 1761
diff changeset
   907
# fatal anyway.  Works if `file' does not exist.
803eeeeaa8a0 Updated libtool to version 2.2.6a
Sam Lantinga <slouken@libsdl.org>
parents: 1761
diff changeset
   908
func_lalib_unsafe_p ()
803eeeeaa8a0 Updated libtool to version 2.2.6a
Sam Lantinga <slouken@libsdl.org>
parents: 1761
diff changeset
   909
{
803eeeeaa8a0 Updated libtool to version 2.2.6a
Sam Lantinga <slouken@libsdl.org>
parents: 1761
diff changeset
   910
    lalib_p=no
803eeeeaa8a0 Updated libtool to version 2.2.6a
Sam Lantinga <slouken@libsdl.org>
parents: 1761
diff changeset
   911
    if test -f "$1" && test -r "$1" && exec 5<&0 <"$1"; then
803eeeeaa8a0 Updated libtool to version 2.2.6a
Sam Lantinga <slouken@libsdl.org>
parents: 1761
diff changeset
   912
	for lalib_p_l in 1 2 3 4
803eeeeaa8a0 Updated libtool to version 2.2.6a
Sam Lantinga <slouken@libsdl.org>
parents: 1761
diff changeset
   913
	do
803eeeeaa8a0 Updated libtool to version 2.2.6a
Sam Lantinga <slouken@libsdl.org>
parents: 1761
diff changeset
   914
	    read lalib_p_line
803eeeeaa8a0 Updated libtool to version 2.2.6a
Sam Lantinga <slouken@libsdl.org>
parents: 1761
diff changeset
   915
	    case "$lalib_p_line" in
803eeeeaa8a0 Updated libtool to version 2.2.6a
Sam Lantinga <slouken@libsdl.org>
parents: 1761
diff changeset
   916
		\#\ Generated\ by\ *$PACKAGE* ) lalib_p=yes; break;;
803eeeeaa8a0 Updated libtool to version 2.2.6a
Sam Lantinga <slouken@libsdl.org>
parents: 1761
diff changeset
   917
	    esac
803eeeeaa8a0 Updated libtool to version 2.2.6a
Sam Lantinga <slouken@libsdl.org>
parents: 1761
diff changeset
   918
	done
803eeeeaa8a0 Updated libtool to version 2.2.6a
Sam Lantinga <slouken@libsdl.org>
parents: 1761
diff changeset
   919
	exec 0<&5 5<&-
803eeeeaa8a0 Updated libtool to version 2.2.6a
Sam Lantinga <slouken@libsdl.org>
parents: 1761
diff changeset
   920
    fi
803eeeeaa8a0 Updated libtool to version 2.2.6a
Sam Lantinga <slouken@libsdl.org>
parents: 1761
diff changeset
   921
    test "$lalib_p" = yes
803eeeeaa8a0 Updated libtool to version 2.2.6a
Sam Lantinga <slouken@libsdl.org>
parents: 1761
diff changeset
   922
}
803eeeeaa8a0 Updated libtool to version 2.2.6a
Sam Lantinga <slouken@libsdl.org>
parents: 1761
diff changeset
   923
803eeeeaa8a0 Updated libtool to version 2.2.6a
Sam Lantinga <slouken@libsdl.org>
parents: 1761
diff changeset
   924
# func_ltwrapper_script_p file
803eeeeaa8a0 Updated libtool to version 2.2.6a
Sam Lantinga <slouken@libsdl.org>
parents: 1761
diff changeset
   925
# True iff FILE is a libtool wrapper script
803eeeeaa8a0 Updated libtool to version 2.2.6a
Sam Lantinga <slouken@libsdl.org>
parents: 1761
diff changeset
   926
# This function is only a basic sanity check; it will hardly flush out
803eeeeaa8a0 Updated libtool to version 2.2.6a
Sam Lantinga <slouken@libsdl.org>
parents: 1761
diff changeset
   927
# determined imposters.
803eeeeaa8a0 Updated libtool to version 2.2.6a
Sam Lantinga <slouken@libsdl.org>
parents: 1761
diff changeset
   928
func_ltwrapper_script_p ()
803eeeeaa8a0 Updated libtool to version 2.2.6a
Sam Lantinga <slouken@libsdl.org>
parents: 1761
diff changeset
   929
{
803eeeeaa8a0 Updated libtool to version 2.2.6a
Sam Lantinga <slouken@libsdl.org>
parents: 1761
diff changeset
   930
    func_lalib_p "$1"
803eeeeaa8a0 Updated libtool to version 2.2.6a
Sam Lantinga <slouken@libsdl.org>
parents: 1761
diff changeset
   931
}
803eeeeaa8a0 Updated libtool to version 2.2.6a
Sam Lantinga <slouken@libsdl.org>
parents: 1761
diff changeset
   932
803eeeeaa8a0 Updated libtool to version 2.2.6a
Sam Lantinga <slouken@libsdl.org>
parents: 1761
diff changeset
   933
# func_ltwrapper_executable_p file
803eeeeaa8a0 Updated libtool to version 2.2.6a
Sam Lantinga <slouken@libsdl.org>
parents: 1761
diff changeset
   934
# True iff FILE is a libtool wrapper executable
803eeeeaa8a0 Updated libtool to version 2.2.6a
Sam Lantinga <slouken@libsdl.org>
parents: 1761
diff changeset
   935
# This function is only a basic sanity check; it will hardly flush out
803eeeeaa8a0 Updated libtool to version 2.2.6a
Sam Lantinga <slouken@libsdl.org>
parents: 1761
diff changeset
   936
# determined imposters.
803eeeeaa8a0 Updated libtool to version 2.2.6a
Sam Lantinga <slouken@libsdl.org>
parents: 1761
diff changeset
   937
func_ltwrapper_executable_p ()
803eeeeaa8a0 Updated libtool to version 2.2.6a
Sam Lantinga <slouken@libsdl.org>
parents: 1761
diff changeset
   938
{
803eeeeaa8a0 Updated libtool to version 2.2.6a
Sam Lantinga <slouken@libsdl.org>
parents: 1761
diff changeset
   939
    func_ltwrapper_exec_suffix=
803eeeeaa8a0 Updated libtool to version 2.2.6a
Sam Lantinga <slouken@libsdl.org>
parents: 1761
diff changeset
   940
    case $1 in
803eeeeaa8a0 Updated libtool to version 2.2.6a
Sam Lantinga <slouken@libsdl.org>
parents: 1761
diff changeset
   941
    *.exe) ;;
803eeeeaa8a0 Updated libtool to version 2.2.6a
Sam Lantinga <slouken@libsdl.org>
parents: 1761
diff changeset
   942
    *) func_ltwrapper_exec_suffix=.exe ;;
803eeeeaa8a0 Updated libtool to version 2.2.6a
Sam Lantinga <slouken@libsdl.org>
parents: 1761
diff changeset
   943
    esac
803eeeeaa8a0 Updated libtool to version 2.2.6a
Sam Lantinga <slouken@libsdl.org>
parents: 1761
diff changeset
   944
    $GREP "$magic_exe" "$1$func_ltwrapper_exec_suffix" >/dev/null 2>&1
803eeeeaa8a0 Updated libtool to version 2.2.6a
Sam Lantinga <slouken@libsdl.org>
parents: 1761
diff changeset
   945
}
803eeeeaa8a0 Updated libtool to version 2.2.6a
Sam Lantinga <slouken@libsdl.org>
parents: 1761
diff changeset
   946
803eeeeaa8a0 Updated libtool to version 2.2.6a
Sam Lantinga <slouken@libsdl.org>
parents: 1761
diff changeset
   947
# func_ltwrapper_scriptname file
803eeeeaa8a0 Updated libtool to version 2.2.6a
Sam Lantinga <slouken@libsdl.org>
parents: 1761
diff changeset
   948
# Assumes file is an ltwrapper_executable
803eeeeaa8a0 Updated libtool to version 2.2.6a
Sam Lantinga <slouken@libsdl.org>
parents: 1761
diff changeset
   949
# uses $file to determine the appropriate filename for a
803eeeeaa8a0 Updated libtool to version 2.2.6a
Sam Lantinga <slouken@libsdl.org>
parents: 1761
diff changeset
   950
# temporary ltwrapper_script.
803eeeeaa8a0 Updated libtool to version 2.2.6a
Sam Lantinga <slouken@libsdl.org>
parents: 1761
diff changeset
   951
func_ltwrapper_scriptname ()
803eeeeaa8a0 Updated libtool to version 2.2.6a
Sam Lantinga <slouken@libsdl.org>
parents: 1761
diff changeset
   952
{
803eeeeaa8a0 Updated libtool to version 2.2.6a
Sam Lantinga <slouken@libsdl.org>
parents: 1761
diff changeset
   953
    func_ltwrapper_scriptname_result=""
803eeeeaa8a0 Updated libtool to version 2.2.6a
Sam Lantinga <slouken@libsdl.org>
parents: 1761
diff changeset
   954
    if func_ltwrapper_executable_p "$1"; then
803eeeeaa8a0 Updated libtool to version 2.2.6a
Sam Lantinga <slouken@libsdl.org>
parents: 1761
diff changeset
   955
	func_dirname_and_basename "$1" "" "."
803eeeeaa8a0 Updated libtool to version 2.2.6a
Sam Lantinga <slouken@libsdl.org>
parents: 1761
diff changeset
   956
	func_stripname '' '.exe' "$func_basename_result"
803eeeeaa8a0 Updated libtool to version 2.2.6a
Sam Lantinga <slouken@libsdl.org>
parents: 1761
diff changeset
   957
	func_ltwrapper_scriptname_result="$func_dirname_result/$objdir/${func_stripname_result}_ltshwrapper"
803eeeeaa8a0 Updated libtool to version 2.2.6a
Sam Lantinga <slouken@libsdl.org>
parents: 1761
diff changeset
   958
    fi
803eeeeaa8a0 Updated libtool to version 2.2.6a
Sam Lantinga <slouken@libsdl.org>
parents: 1761
diff changeset
   959
}
803eeeeaa8a0 Updated libtool to version 2.2.6a
Sam Lantinga <slouken@libsdl.org>
parents: 1761
diff changeset
   960
803eeeeaa8a0 Updated libtool to version 2.2.6a
Sam Lantinga <slouken@libsdl.org>
parents: 1761
diff changeset
   961
# func_ltwrapper_p file
803eeeeaa8a0 Updated libtool to version 2.2.6a
Sam Lantinga <slouken@libsdl.org>
parents: 1761
diff changeset
   962
# True iff FILE is a libtool wrapper script or wrapper executable
803eeeeaa8a0 Updated libtool to version 2.2.6a
Sam Lantinga <slouken@libsdl.org>
parents: 1761
diff changeset
   963
# This function is only a basic sanity check; it will hardly flush out
803eeeeaa8a0 Updated libtool to version 2.2.6a
Sam Lantinga <slouken@libsdl.org>
parents: 1761
diff changeset
   964
# determined imposters.
803eeeeaa8a0 Updated libtool to version 2.2.6a
Sam Lantinga <slouken@libsdl.org>
parents: 1761
diff changeset
   965
func_ltwrapper_p ()
803eeeeaa8a0 Updated libtool to version 2.2.6a
Sam Lantinga <slouken@libsdl.org>
parents: 1761
diff changeset
   966
{
803eeeeaa8a0 Updated libtool to version 2.2.6a
Sam Lantinga <slouken@libsdl.org>
parents: 1761
diff changeset
   967
    func_ltwrapper_script_p "$1" || func_ltwrapper_executable_p "$1"
803eeeeaa8a0 Updated libtool to version 2.2.6a
Sam Lantinga <slouken@libsdl.org>
parents: 1761
diff changeset
   968
}
803eeeeaa8a0 Updated libtool to version 2.2.6a
Sam Lantinga <slouken@libsdl.org>
parents: 1761
diff changeset
   969
803eeeeaa8a0 Updated libtool to version 2.2.6a
Sam Lantinga <slouken@libsdl.org>
parents: 1761
diff changeset
   970
803eeeeaa8a0 Updated libtool to version 2.2.6a
Sam Lantinga <slouken@libsdl.org>
parents: 1761
diff changeset
   971
# func_execute_cmds commands fail_cmd
803eeeeaa8a0 Updated libtool to version 2.2.6a
Sam Lantinga <slouken@libsdl.org>
parents: 1761
diff changeset
   972
# Execute tilde-delimited COMMANDS.
803eeeeaa8a0 Updated libtool to version 2.2.6a
Sam Lantinga <slouken@libsdl.org>
parents: 1761
diff changeset
   973
# If FAIL_CMD is given, eval that upon failure.
803eeeeaa8a0 Updated libtool to version 2.2.6a
Sam Lantinga <slouken@libsdl.org>
parents: 1761
diff changeset
   974
# FAIL_CMD may read-access the current command in variable CMD!
803eeeeaa8a0 Updated libtool to version 2.2.6a
Sam Lantinga <slouken@libsdl.org>
parents: 1761
diff changeset
   975
func_execute_cmds ()
803eeeeaa8a0 Updated libtool to version 2.2.6a
Sam Lantinga <slouken@libsdl.org>
parents: 1761
diff changeset
   976
{
803eeeeaa8a0 Updated libtool to version 2.2.6a
Sam Lantinga <slouken@libsdl.org>
parents: 1761
diff changeset
   977
    $opt_debug
803eeeeaa8a0 Updated libtool to version 2.2.6a
Sam Lantinga <slouken@libsdl.org>
parents: 1761
diff changeset
   978
    save_ifs=$IFS; IFS='~'
803eeeeaa8a0 Updated libtool to version 2.2.6a
Sam Lantinga <slouken@libsdl.org>
parents: 1761
diff changeset
   979
    for cmd in $1; do
803eeeeaa8a0 Updated libtool to version 2.2.6a
Sam Lantinga <slouken@libsdl.org>
parents: 1761
diff changeset
   980
      IFS=$save_ifs
803eeeeaa8a0 Updated libtool to version 2.2.6a
Sam Lantinga <slouken@libsdl.org>
parents: 1761
diff changeset
   981
      eval cmd=\"$cmd\"
803eeeeaa8a0 Updated libtool to version 2.2.6a
Sam Lantinga <slouken@libsdl.org>
parents: 1761
diff changeset
   982
      func_show_eval "$cmd" "${2-:}"
803eeeeaa8a0 Updated libtool to version 2.2.6a
Sam Lantinga <slouken@libsdl.org>
parents: 1761
diff changeset
   983
    done
803eeeeaa8a0 Updated libtool to version 2.2.6a
Sam Lantinga <slouken@libsdl.org>
parents: 1761
diff changeset
   984
    IFS=$save_ifs
803eeeeaa8a0 Updated libtool to version 2.2.6a
Sam Lantinga <slouken@libsdl.org>
parents: 1761
diff changeset
   985
}
803eeeeaa8a0 Updated libtool to version 2.2.6a
Sam Lantinga <slouken@libsdl.org>
parents: 1761
diff changeset
   986
803eeeeaa8a0 Updated libtool to version 2.2.6a
Sam Lantinga <slouken@libsdl.org>
parents: 1761
diff changeset
   987
803eeeeaa8a0 Updated libtool to version 2.2.6a
Sam Lantinga <slouken@libsdl.org>
parents: 1761
diff changeset
   988
# func_source file
803eeeeaa8a0 Updated libtool to version 2.2.6a
Sam Lantinga <slouken@libsdl.org>
parents: 1761
diff changeset
   989
# Source FILE, adding directory component if necessary.
803eeeeaa8a0 Updated libtool to version 2.2.6a
Sam Lantinga <slouken@libsdl.org>
parents: 1761
diff changeset
   990
# Note that it is not necessary on cygwin/mingw to append a dot to
803eeeeaa8a0 Updated libtool to version 2.2.6a
Sam Lantinga <slouken@libsdl.org>
parents: 1761
diff changeset
   991
# FILE even if both FILE and FILE.exe exist: automatic-append-.exe
803eeeeaa8a0 Updated libtool to version 2.2.6a
Sam Lantinga <slouken@libsdl.org>
parents: 1761
diff changeset
   992
# behavior happens only for exec(3), not for open(2)!  Also, sourcing
803eeeeaa8a0 Updated libtool to version 2.2.6a
Sam Lantinga <slouken@libsdl.org>
parents: 1761
diff changeset
   993
# `FILE.' does not work on cygwin managed mounts.
803eeeeaa8a0 Updated libtool to version 2.2.6a
Sam Lantinga <slouken@libsdl.org>
parents: 1761
diff changeset
   994
func_source ()
803eeeeaa8a0 Updated libtool to version 2.2.6a
Sam Lantinga <slouken@libsdl.org>
parents: 1761
diff changeset
   995
{
803eeeeaa8a0 Updated libtool to version 2.2.6a
Sam Lantinga <slouken@libsdl.org>
parents: 1761
diff changeset
   996
    $opt_debug
803eeeeaa8a0 Updated libtool to version 2.2.6a
Sam Lantinga <slouken@libsdl.org>
parents: 1761
diff changeset
   997
    case $1 in
803eeeeaa8a0 Updated libtool to version 2.2.6a
Sam Lantinga <slouken@libsdl.org>
parents: 1761
diff changeset
   998
    */* | *\\*)	. "$1" ;;
803eeeeaa8a0 Updated libtool to version 2.2.6a
Sam Lantinga <slouken@libsdl.org>
parents: 1761
diff changeset
   999
    *)		. "./$1" ;;
803eeeeaa8a0 Updated libtool to version 2.2.6a
Sam Lantinga <slouken@libsdl.org>
parents: 1761
diff changeset
  1000
    esac
1361
19418e4422cb New configure-based build system. Still work in progress, but much improved
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
  1001
}
19418e4422cb New configure-based build system. Still work in progress, but much improved
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
  1002
19418e4422cb New configure-based build system. Still work in progress, but much improved
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
  1003
19418e4422cb New configure-based build system. Still work in progress, but much improved
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
  1004
# func_infer_tag arg
19418e4422cb New configure-based build system. Still work in progress, but much improved
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
  1005
# Infer tagged configuration to use if any are available and
19418e4422cb New configure-based build system. Still work in progress, but much improved
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
  1006
# if one wasn't chosen via the "--tag" command line option.
19418e4422cb New configure-based build system. Still work in progress, but much improved
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
  1007
# Only attempt this if the compiler in the base compile
19418e4422cb New configure-based build system. Still work in progress, but much improved
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
  1008
# command doesn't match the default compiler.
19418e4422cb New configure-based build system. Still work in progress, but much improved
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
  1009
# arg is usually of the form 'gcc ...'
1570
a740bca2a1b1 Updated to libtool-1.5.22
Sam Lantinga <slouken@libsdl.org>
parents: 1361
diff changeset
  1010
func_infer_tag ()
a740bca2a1b1 Updated to libtool-1.5.22
Sam Lantinga <slouken@libsdl.org>
parents: 1361
diff changeset
  1011
{
4277
803eeeeaa8a0 Updated libtool to version 2.2.6a
Sam Lantinga <slouken@libsdl.org>
parents: 1761
diff changeset
  1012
    $opt_debug
1361
19418e4422cb New configure-based build system. Still work in progress, but much improved
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
  1013
    if test -n "$available_tags" && test -z "$tagname"; then
19418e4422cb New configure-based build system. Still work in progress, but much improved
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
  1014
      CC_quoted=
19418e4422cb New configure-based build system. Still work in progress, but much improved
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
  1015
      for arg in $CC; do
4277
803eeeeaa8a0 Updated libtool to version 2.2.6a
Sam Lantinga <slouken@libsdl.org>
parents: 1761
diff changeset
  1016
        func_quote_for_eval "$arg"
803eeeeaa8a0 Updated libtool to version 2.2.6a
Sam Lantinga <slouken@libsdl.org>
parents: 1761
diff changeset
  1017
	CC_quoted="$CC_quoted $func_quote_for_eval_result"
1361
19418e4422cb New configure-based build system. Still work in progress, but much improved
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
  1018
      done
19418e4422cb New configure-based build system. Still work in progress, but much improved
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
  1019
      case $@ in
19418e4422cb New configure-based build system. Still work in progress, but much improved
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
  1020
      # Blanks in the command may have been stripped by the calling shell,
19418e4422cb New configure-based build system. Still work in progress, but much improved
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
  1021
      # but not from the CC environment variable when configure was run.
4277
803eeeeaa8a0 Updated libtool to version 2.2.6a
Sam Lantinga <slouken@libsdl.org>
parents: 1761
diff changeset
  1022
      " $CC "* | "$CC "* | " `$ECHO $CC` "* | "`$ECHO $CC` "* | " $CC_quoted"* | "$CC_quoted "* | " `$ECHO $CC_quoted` "* | "`$ECHO $CC_quoted` "*) ;;
1361
19418e4422cb New configure-based build system. Still work in progress, but much improved
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
  1023
      # Blanks at the start of $base_compile will cause this to fail
19418e4422cb New configure-based build system. Still work in progress, but much improved
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
  1024
      # if we don't check for them as well.
19418e4422cb New configure-based build system. Still work in progress, but much improved
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
  1025
      *)
19418e4422cb New configure-based build system. Still work in progress, but much improved
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
  1026
	for z in $available_tags; do
4277
803eeeeaa8a0 Updated libtool to version 2.2.6a
Sam Lantinga <slouken@libsdl.org>
parents: 1761
diff changeset
  1027
	  if $GREP "^# ### BEGIN LIBTOOL TAG CONFIG: $z$" < "$progpath" > /dev/null; then
1361
19418e4422cb New configure-based build system. Still work in progress, but much improved
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
  1028
	    # Evaluate the configuration.
19418e4422cb New configure-based build system. Still work in progress, but much improved
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
  1029
	    eval "`${SED} -n -e '/^# ### BEGIN LIBTOOL TAG CONFIG: '$z'$/,/^# ### END LIBTOOL TAG CONFIG: '$z'$/p' < $progpath`"
19418e4422cb New configure-based build system. Still work in progress, but much improved
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
  1030
	    CC_quoted=
19418e4422cb New configure-based build system. Still work in progress, but much improved
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
  1031
	    for arg in $CC; do
4277
803eeeeaa8a0 Updated libtool to version 2.2.6a
Sam Lantinga <slouken@libsdl.org>
parents: 1761
diff changeset
  1032
	      # Double-quote args containing other shell metacharacters.
803eeeeaa8a0 Updated libtool to version 2.2.6a
Sam Lantinga <slouken@libsdl.org>
parents: 1761
diff changeset
  1033
	      func_quote_for_eval "$arg"
803eeeeaa8a0 Updated libtool to version 2.2.6a
Sam Lantinga <slouken@libsdl.org>
parents: 1761
diff changeset
  1034
	      CC_quoted="$CC_quoted $func_quote_for_eval_result"
803eeeeaa8a0 Updated libtool to version 2.2.6a
Sam Lantinga <slouken@libsdl.org>
parents: 1761
diff changeset
  1035
	    done
1361
19418e4422cb New configure-based build system. Still work in progress, but much improved
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
  1036
	    case "$@ " in
4277
803eeeeaa8a0 Updated libtool to version 2.2.6a
Sam Lantinga <slouken@libsdl.org>
parents: 1761
diff changeset
  1037
	      " $CC "* | "$CC "* | " `$ECHO $CC` "* | "`$ECHO $CC` "* | " $CC_quoted"* | "$CC_quoted "* | " `$ECHO $CC_quoted` "* | "`$ECHO $CC_quoted` "*)
1361
19418e4422cb New configure-based build system. Still work in progress, but much improved
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
  1038
	      # The compiler in the base compile command matches
19418e4422cb New configure-based build system. Still work in progress, but much improved
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
  1039
	      # the one in the tagged configuration.
19418e4422cb New configure-based build system. Still work in progress, but much improved
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
  1040
	      # Assume this is the tagged configuration we want.
19418e4422cb New configure-based build system. Still work in progress, but much improved
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
  1041
	      tagname=$z
19418e4422cb New configure-based build system. Still work in progress, but much improved
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
  1042
	      break
19418e4422cb New configure-based build system. Still work in progress, but much improved
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
  1043
	      ;;
19418e4422cb New configure-based build system. Still work in progress, but much improved
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
  1044
	    esac
19418e4422cb New configure-based build system. Still work in progress, but much improved
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
  1045
	  fi
19418e4422cb New configure-based build system. Still work in progress, but much improved
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
  1046
	done
19418e4422cb New configure-based build system. Still work in progress, but much improved
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
  1047
	# If $tagname still isn't set, then no tagged configuration
19418e4422cb New configure-based build system. Still work in progress, but much improved
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
  1048
	# was found and let the user know that the "--tag" command
19418e4422cb New configure-based build system. Still work in progress, but much improved
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
  1049
	# line option must be used.
19418e4422cb New configure-based build system. Still work in progress, but much improved
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
  1050
	if test -z "$tagname"; then
4277
803eeeeaa8a0 Updated libtool to version 2.2.6a
Sam Lantinga <slouken@libsdl.org>
parents: 1761
diff changeset
  1051
	  func_echo "unable to infer tagged configuration"
803eeeeaa8a0 Updated libtool to version 2.2.6a
Sam Lantinga <slouken@libsdl.org>
parents: 1761
diff changeset
  1052
	  func_fatal_error "specify a tag with \`--tag'"
803eeeeaa8a0 Updated libtool to version 2.2.6a
Sam Lantinga <slouken@libsdl.org>
parents: 1761
diff changeset
  1053
#	else
803eeeeaa8a0 Updated libtool to version 2.2.6a
Sam Lantinga <slouken@libsdl.org>
parents: 1761
diff changeset
  1054
#	  func_verbose "using $tagname tagged configuration"
1361
19418e4422cb New configure-based build system. Still work in progress, but much improved
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
  1055
	fi
19418e4422cb New configure-based build system. Still work in progress, but much improved
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
  1056
	;;
19418e4422cb New configure-based build system. Still work in progress, but much improved
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
  1057
      esac
19418e4422cb New configure-based build system. Still work in progress, but much improved
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
  1058
    fi
19418e4422cb New configure-based build system. Still work in progress, but much improved
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
  1059
}
19418e4422cb New configure-based build system. Still work in progress, but much improved
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
  1060
19418e4422cb New configure-based build system. Still work in progress, but much improved
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
  1061
4277
803eeeeaa8a0 Updated libtool to version 2.2.6a
Sam Lantinga <slouken@libsdl.org>
parents: 1761
diff changeset
  1062
803eeeeaa8a0 Updated libtool to version 2.2.6a
Sam Lantinga <slouken@libsdl.org>
parents: 1761
diff changeset
  1063
# func_write_libtool_object output_name pic_name nonpic_name
803eeeeaa8a0 Updated libtool to version 2.2.6a
Sam Lantinga <slouken@libsdl.org>
parents: 1761
diff changeset
  1064
# Create a libtool object file (analogous to a ".la" file),
803eeeeaa8a0 Updated libtool to version 2.2.6a
Sam Lantinga <slouken@libsdl.org>
parents: 1761
diff changeset
  1065
# but don't create it if we're doing a dry run.
803eeeeaa8a0 Updated libtool to version 2.2.6a
Sam Lantinga <slouken@libsdl.org>
parents: 1761
diff changeset
  1066
func_write_libtool_object ()
1570
a740bca2a1b1 Updated to libtool-1.5.22
Sam Lantinga <slouken@libsdl.org>
parents: 1361
diff changeset
  1067
{
4277
803eeeeaa8a0 Updated libtool to version 2.2.6a
Sam Lantinga <slouken@libsdl.org>
parents: 1761
diff changeset
  1068
    write_libobj=${1}
803eeeeaa8a0 Updated libtool to version 2.2.6a
Sam Lantinga <slouken@libsdl.org>
parents: 1761
diff changeset
  1069
    if test "$build_libtool_libs" = yes; then
803eeeeaa8a0 Updated libtool to version 2.2.6a
Sam Lantinga <slouken@libsdl.org>
parents: 1761
diff changeset
  1070
      write_lobj=\'${2}\'
1570
a740bca2a1b1 Updated to libtool-1.5.22
Sam Lantinga <slouken@libsdl.org>
parents: 1361
diff changeset
  1071
    else
4277
803eeeeaa8a0 Updated libtool to version 2.2.6a
Sam Lantinga <slouken@libsdl.org>
parents: 1761
diff changeset
  1072
      write_lobj=none
1570
a740bca2a1b1 Updated to libtool-1.5.22
Sam Lantinga <slouken@libsdl.org>
parents: 1361
diff changeset
  1073
    fi
4277
803eeeeaa8a0 Updated libtool to version 2.2.6a
Sam Lantinga <slouken@libsdl.org>
parents: 1761
diff changeset
  1074
803eeeeaa8a0 Updated libtool to version 2.2.6a
Sam Lantinga <slouken@libsdl.org>
parents: 1761
diff changeset
  1075
    if test "$build_old_libs" = yes; then
803eeeeaa8a0 Updated libtool to version 2.2.6a
Sam Lantinga <slouken@libsdl.org>
parents: 1761
diff changeset
  1076
      write_oldobj=\'${3}\'
803eeeeaa8a0 Updated libtool to version 2.2.6a
Sam Lantinga <slouken@libsdl.org>
parents: 1761
diff changeset
  1077
    else
803eeeeaa8a0 Updated libtool to version 2.2.6a
Sam Lantinga <slouken@libsdl.org>
parents: 1761
diff changeset
  1078
      write_oldobj=none
1361
19418e4422cb New configure-based build system. Still work in progress, but much improved
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
  1079
    fi
19418e4422cb New configure-based build system. Still work in progress, but much improved
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
  1080
4277
803eeeeaa8a0 Updated libtool to version 2.2.6a
Sam Lantinga <slouken@libsdl.org>
parents: 1761
diff changeset
  1081
    $opt_dry_run || {
803eeeeaa8a0 Updated libtool to version 2.2.6a
Sam Lantinga <slouken@libsdl.org>
parents: 1761
diff changeset
  1082
      cat >${write_libobj}T <<EOF
803eeeeaa8a0 Updated libtool to version 2.2.6a
Sam Lantinga <slouken@libsdl.org>
parents: 1761
diff changeset
  1083
# $write_libobj - a libtool object file
803eeeeaa8a0 Updated libtool to version 2.2.6a
Sam Lantinga <slouken@libsdl.org>
parents: 1761
diff changeset
  1084
# Generated by $PROGRAM (GNU $PACKAGE$TIMESTAMP) $VERSION
803eeeeaa8a0 Updated libtool to version 2.2.6a
Sam Lantinga <slouken@libsdl.org>
parents: 1761
diff changeset
  1085
#
803eeeeaa8a0 Updated libtool to version 2.2.6a
Sam Lantinga <slouken@libsdl.org>
parents: 1761
diff changeset
  1086
# Please DO NOT delete this file!
803eeeeaa8a0 Updated libtool to version 2.2.6a
Sam Lantinga <slouken@libsdl.org>
parents: 1761
diff changeset
  1087
# It is necessary for linking the library.
803eeeeaa8a0 Updated libtool to version 2.2.6a
Sam Lantinga <slouken@libsdl.org>
parents: 1761
diff changeset
  1088
803eeeeaa8a0 Updated libtool to version 2.2.6a
Sam Lantinga <slouken@libsdl.org>
parents: 1761
diff changeset
  1089
# Name of the PIC object.
803eeeeaa8a0 Updated libtool to version 2.2.6a
Sam Lantinga <slouken@libsdl.org>
parents: 1761
diff changeset
  1090
pic_object=$write_lobj
803eeeeaa8a0 Updated libtool to version 2.2.6a
Sam Lantinga <slouken@libsdl.org>
parents: 1761
diff changeset
  1091
803eeeeaa8a0 Updated libtool to version 2.2.6a
Sam Lantinga <slouken@libsdl.org>
parents: 1761
diff changeset
  1092
# Name of the non-PIC object
803eeeeaa8a0 Updated libtool to version 2.2.6a
Sam Lantinga <slouken@libsdl.org>
parents: 1761
diff changeset
  1093
non_pic_object=$write_oldobj
803eeeeaa8a0 Updated libtool to version 2.2.6a
Sam Lantinga <slouken@libsdl.org>
parents: 1761
diff changeset
  1094
803eeeeaa8a0 Updated libtool to version 2.2.6a
Sam Lantinga <slouken@libsdl.org>
parents: 1761
diff changeset
  1095
EOF
803eeeeaa8a0 Updated libtool to version 2.2.6a
Sam Lantinga <slouken@libsdl.org>
parents: 1761
diff changeset
  1096
      $MV "${write_libobj}T" "${write_libobj}"
803eeeeaa8a0 Updated libtool to version 2.2.6a
Sam Lantinga <slouken@libsdl.org>
parents: 1761
diff changeset
  1097
    }
1361
19418e4422cb New configure-based build system. Still work in progress, but much improved
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
  1098
}
4277
803eeeeaa8a0 Updated libtool to version 2.2.6a
Sam Lantinga <slouken@libsdl.org>
parents: 1761
diff changeset
  1099
803eeeeaa8a0 Updated libtool to version 2.2.6a
Sam Lantinga <slouken@libsdl.org>
parents: 1761
diff changeset
  1100
# func_mode_compile arg...
803eeeeaa8a0 Updated libtool to version 2.2.6a
Sam Lantinga <slouken@libsdl.org>
parents: