| 1 | #! /bin/sh
|
|---|
| 2 |
|
|---|
| 3 | # ltconfig - Create a system-specific libtool.
|
|---|
| 4 | # Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001
|
|---|
| 5 | # Free Software Foundation, Inc.
|
|---|
| 6 | # Originally by Gordon Matzigkeit <[email protected]>, 1996
|
|---|
| 7 | #
|
|---|
| 8 | # This file is free software; you can redistribute it and/or modify it
|
|---|
| 9 | # under the terms of the GNU General Public License as published by
|
|---|
| 10 | # the Free Software Foundation; either version 2 of the License, or
|
|---|
| 11 | # (at your option) any later version.
|
|---|
| 12 | #
|
|---|
| 13 | # This program is distributed in the hope that it will be useful, but
|
|---|
| 14 | # WITHOUT ANY WARRANTY; without even the implied warranty of
|
|---|
| 15 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|---|
| 16 | # General Public License for more details.
|
|---|
| 17 | #
|
|---|
| 18 | # You should have received a copy of the GNU General Public License
|
|---|
| 19 | # along with this program; if not, write to the Free Software
|
|---|
| 20 | # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
|---|
| 21 | #
|
|---|
| 22 | # As a special exception to the GNU General Public License, if you
|
|---|
| 23 | # distribute this file as part of a program that contains a
|
|---|
| 24 | # configuration script generated by Autoconf, you may include it under
|
|---|
| 25 | # the same distribution terms that you use for the rest of that program.
|
|---|
| 26 |
|
|---|
| 27 | # A lot of this script is taken from autoconf-2.10.
|
|---|
| 28 |
|
|---|
| 29 | # Check that we are running under the correct shell.
|
|---|
| 30 | SHELL=${CONFIG_SHELL-/bin/sh}
|
|---|
| 31 | echo=echo
|
|---|
| 32 | if test "X$1" = X--no-reexec; then
|
|---|
| 33 | # Discard the --no-reexec flag, and continue.
|
|---|
| 34 | shift
|
|---|
| 35 | elif test "X$1" = X--fallback-echo; then
|
|---|
| 36 | # Avoid inline document here, it may be left over
|
|---|
| 37 | :
|
|---|
| 38 | elif test "X`($echo '\t') 2>/dev/null`" = 'X\t'; then
|
|---|
| 39 | # Yippee, $echo works!
|
|---|
| 40 | :
|
|---|
| 41 | else
|
|---|
| 42 | # Restart under the correct shell.
|
|---|
| 43 | exec "$SHELL" "$0" --no-reexec ${1+"$@"}
|
|---|
| 44 | fi
|
|---|
| 45 |
|
|---|
| 46 | if test "X$1" = X--fallback-echo; then
|
|---|
| 47 | # used as fallback echo
|
|---|
| 48 | shift
|
|---|
| 49 | cat <<EOF
|
|---|
| 50 | $*
|
|---|
| 51 | EOF
|
|---|
| 52 | exit 0
|
|---|
| 53 | fi
|
|---|
| 54 |
|
|---|
| 55 | # Find the correct PATH separator. Usually this is `:', but
|
|---|
| 56 | # DJGPP uses `;' like DOS.
|
|---|
| 57 | if test "X${PATH_SEPARATOR+set}" != Xset; then
|
|---|
| 58 | UNAME=${UNAME-`uname 2>/dev/null`}
|
|---|
| 59 | case X$UNAME in
|
|---|
| 60 | *-DOS) PATH_SEPARATOR=';' ;;
|
|---|
| 61 | *) PATH_SEPARATOR=':' ;;
|
|---|
| 62 | esac
|
|---|
| 63 | fi
|
|---|
| 64 |
|
|---|
| 65 | # The HP-UX ksh and POSIX shell print the target directory to stdout
|
|---|
| 66 | # if CDPATH is set.
|
|---|
| 67 | if test "X${CDPATH+set}" = Xset; then CDPATH=:; export CDPATH; fi
|
|---|
| 68 |
|
|---|
| 69 | if test "X${echo_test_string+set}" != Xset; then
|
|---|
| 70 | # find a string as large as possible, as long as the shell can cope with it
|
|---|
| 71 | for cmd in 'sed 50q "$0"' 'sed 20q "$0"' 'sed 10q "$0"' 'sed 2q "$0"' 'echo test'; do
|
|---|
| 72 | # expected sizes: less than 2Kb, 1Kb, 512 bytes, 16 bytes, ...
|
|---|
| 73 | if (echo_test_string="`eval $cmd`") 2>/dev/null &&
|
|---|
| 74 | echo_test_string="`eval $cmd`" &&
|
|---|
| 75 | (test "X$echo_test_string" = "X$echo_test_string") 2>/dev/null; then
|
|---|
| 76 | break
|
|---|
| 77 | fi
|
|---|
| 78 | done
|
|---|
| 79 | fi
|
|---|
| 80 |
|
|---|
| 81 | if test "X`($echo '\t') 2>/dev/null`" = 'X\t' &&
|
|---|
| 82 | echo_testing_string=`($echo "$echo_test_string") 2>/dev/null` &&
|
|---|
| 83 | test "X$echo_testing_string" = "X$echo_test_string"; then
|
|---|
| 84 | :
|
|---|
| 85 | else
|
|---|
| 86 | # The Solaris, AIX, and Digital Unix default echo programs unquote
|
|---|
| 87 | # backslashes. This makes it impossible to quote backslashes using
|
|---|
| 88 | # echo "$something" | sed 's/\\/\\\\/g'
|
|---|
| 89 | #
|
|---|
| 90 | # So, first we look for a working echo in the user's PATH.
|
|---|
| 91 |
|
|---|
| 92 | IFS="${IFS= }"; save_ifs="$IFS"; IFS="${IFS}${PATH_SEPARATOR}"
|
|---|
| 93 | for dir in $PATH /usr/ucb; do
|
|---|
| 94 | if (test -f $dir/echo || test -f $dir/echo$ac_exeext) &&
|
|---|
| 95 | test "X`($dir/echo '\t') 2>/dev/null`" = 'X\t' &&
|
|---|
| 96 | echo_testing_string=`($dir/echo "$echo_test_string") 2>/dev/null` &&
|
|---|
| 97 | test "X$echo_testing_string" = "X$echo_test_string"; then
|
|---|
| 98 | echo="$dir/echo"
|
|---|
| 99 | break
|
|---|
| 100 | fi
|
|---|
| 101 | done
|
|---|
| 102 | IFS="$save_ifs"
|
|---|
| 103 |
|
|---|
| 104 | if test "X$echo" = Xecho; then
|
|---|
| 105 | # We didn't find a better echo, so look for alternatives.
|
|---|
| 106 | if test "X`(print -r '\t') 2>/dev/null`" = 'X\t' &&
|
|---|
| 107 | echo_testing_string=`(print -r "$echo_test_string") 2>/dev/null` &&
|
|---|
| 108 | test "X$echo_testing_string" = "X$echo_test_string"; then
|
|---|
| 109 | # This shell has a builtin print -r that does the trick.
|
|---|
| 110 | echo='print -r'
|
|---|
| 111 | elif (test -f /bin/ksh || test -f /bin/ksh$ac_exeext) &&
|
|---|
| 112 | test "X$CONFIG_SHELL" != X/bin/ksh; then
|
|---|
| 113 | # If we have ksh, try running ltconfig again with it.
|
|---|
| 114 | ORIGINAL_CONFIG_SHELL="${CONFIG_SHELL-/bin/sh}"
|
|---|
| 115 | export ORIGINAL_CONFIG_SHELL
|
|---|
| 116 | CONFIG_SHELL=/bin/ksh
|
|---|
| 117 | export CONFIG_SHELL
|
|---|
| 118 | exec "$CONFIG_SHELL" "$0" --no-reexec ${1+"$@"}
|
|---|
| 119 | else
|
|---|
| 120 | # Try using printf.
|
|---|
| 121 | echo='printf %s\n'
|
|---|
| 122 | if test "X`($echo '\t') 2>/dev/null`" = 'X\t' &&
|
|---|
| 123 | echo_testing_string=`($echo "$echo_test_string") 2>/dev/null` &&
|
|---|
| 124 | test "X$echo_testing_string" = "X$echo_test_string"; then
|
|---|
| 125 | # Cool, printf works
|
|---|
| 126 | :
|
|---|
| 127 | elif echo_testing_string=`("$ORIGINAL_CONFIG_SHELL" "$0" --fallback-echo '\t') 2>/dev/null` &&
|
|---|
| 128 | test "X$echo_testing_string" = 'X\t' &&
|
|---|
| 129 | echo_testing_string=`("$ORIGINAL_CONFIG_SHELL" "$0" --fallback-echo "$echo_test_string") 2>/dev/null` &&
|
|---|
| 130 | test "X$echo_testing_string" = "X$echo_test_string"; then
|
|---|
| 131 | CONFIG_SHELL="$ORIGINAL_CONFIG_SHELL"
|
|---|
| 132 | export CONFIG_SHELL
|
|---|
| 133 | SHELL="$CONFIG_SHELL"
|
|---|
| 134 | export SHELL
|
|---|
| 135 | echo="$CONFIG_SHELL $0 --fallback-echo"
|
|---|
| 136 | elif echo_testing_string=`("$CONFIG_SHELL" "$0" --fallback-echo '\t') 2>/dev/null` &&
|
|---|
| 137 | test "X$echo_testing_string" = 'X\t' &&
|
|---|
| 138 | echo_testing_string=`("$CONFIG_SHELL" "$0" --fallback-echo "$echo_test_string") 2>/dev/null` &&
|
|---|
| 139 | test "X$echo_testing_string" = "X$echo_test_string"; then
|
|---|
| 140 | echo="$CONFIG_SHELL $0 --fallback-echo"
|
|---|
| 141 | else
|
|---|
| 142 | # maybe with a smaller string...
|
|---|
| 143 | prev=:
|
|---|
| 144 |
|
|---|
| 145 | for cmd in 'echo test' 'sed 2q "$0"' 'sed 10q "$0"' 'sed 20q "$0"' 'sed 50q "$0"'; do
|
|---|
| 146 | if (test "X$echo_test_string" = "X`eval $cmd`") 2>/dev/null; then
|
|---|
| 147 | break
|
|---|
| 148 | fi
|
|---|
| 149 | prev="$cmd"
|
|---|
| 150 | done
|
|---|
| 151 |
|
|---|
| 152 | if test "$prev" != 'sed 50q "$0"'; then
|
|---|
| 153 | echo_test_string=`eval $prev`
|
|---|
| 154 |
|
|---|
| 155 | export echo_test_string
|
|---|
| 156 | exec "${ORIGINAL_CONFIG_SHELL-${CONFIG_SHELL-/bin/sh}}" "$0" ${1+"$@"}
|
|---|
| 157 | else
|
|---|
| 158 | # Oops. We lost completely, so just stick with echo.
|
|---|
| 159 | echo=echo
|
|---|
| 160 | fi
|
|---|
| 161 | fi
|
|---|
| 162 | fi
|
|---|
| 163 | fi
|
|---|
| 164 | fi
|
|---|
| 165 |
|
|---|
| 166 | # Sed substitution that helps us do robust quoting. It backslashifies
|
|---|
| 167 | # metacharacters that are still active within double-quoted strings.
|
|---|
| 168 | Xsed='sed -e s/^X//'
|
|---|
| 169 | sed_quote_subst='s/\([\\"\\`$\\\\]\)/\\\1/g'
|
|---|
| 170 |
|
|---|
| 171 | # Same as above, but do not quote variable references.
|
|---|
| 172 | double_quote_subst='s/\([\\"\\`\\\\]\)/\\\1/g'
|
|---|
| 173 |
|
|---|
| 174 | # Sed substitution to delay expansion of an escaped shell variable in a
|
|---|
| 175 | # double_quote_subst'ed string.
|
|---|
| 176 | delay_variable_subst='s/\\\\\\\\\\\$/\\\\\\$/g'
|
|---|
| 177 |
|
|---|
| 178 | # The name of this program.
|
|---|
| 179 | progname=`$echo "X$0" | $Xsed -e 's%^.*/%%'`
|
|---|
| 180 |
|
|---|
| 181 | # Constants:
|
|---|
| 182 | PROGRAM=ltconfig
|
|---|
| 183 | PACKAGE=libtool
|
|---|
| 184 | VERSION=1.4a-GCC3.0
|
|---|
| 185 | TIMESTAMP=" (1.641.2.256 2001/05/28 20:09:07 with GCC-local changes)"
|
|---|
| 186 | ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
|
|---|
| 187 | ac_link='${CC-cc} -o conftest $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
|
|---|
| 188 | rm="rm -f"
|
|---|
| 189 |
|
|---|
| 190 | help="Try \`$progname --help' for more information."
|
|---|
| 191 |
|
|---|
| 192 | # Global variables:
|
|---|
| 193 | default_ofile=libtool
|
|---|
| 194 | can_build_shared=yes
|
|---|
| 195 | enable_shared=yes
|
|---|
| 196 | # All known linkers require a `.a' archive for static linking (except M$VC,
|
|---|
| 197 | # which needs '.lib').
|
|---|
| 198 | enable_static=yes
|
|---|
| 199 | enable_fast_install=yes
|
|---|
| 200 | enable_dlopen=unknown
|
|---|
| 201 | enable_win32_dll=no
|
|---|
|
|---|