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