| 1 | AS_INIT[]dnl -*- shell-script -*-
|
|---|
| 2 | # autoconf -- create `configure' using m4 macros
|
|---|
| 3 |
|
|---|
| 4 | # Copyright (C) 1992, 1993, 1994, 1996, 1999, 2000, 2001, 2002, 2003,
|
|---|
| 5 | # 2004, 2005, 2006 Free Software Foundation, Inc.
|
|---|
| 6 |
|
|---|
| 7 | # This program is free software; you can redistribute it and/or modify
|
|---|
| 8 | # it under the terms of the GNU General Public License as published by
|
|---|
| 9 | # the Free Software Foundation; either version 2, or (at your option)
|
|---|
| 10 | # any later version.
|
|---|
| 11 |
|
|---|
| 12 | # This program is distributed in the hope that it will be useful,
|
|---|
| 13 | # but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|---|
| 14 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|---|
| 15 | # GNU General Public License for more details.
|
|---|
| 16 |
|
|---|
| 17 | # You should have received a copy of the GNU General Public License
|
|---|
| 18 | # along with this program; if not, write to the Free Software
|
|---|
| 19 | # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
|
|---|
| 20 | # 02110-1301, USA.
|
|---|
| 21 |
|
|---|
| 22 | usage=["\
|
|---|
| 23 | Usage: $0 [OPTION] ... [TEMPLATE-FILE]
|
|---|
| 24 |
|
|---|
| 25 | Generate a configuration script from a TEMPLATE-FILE if given, or
|
|---|
| 26 | \`configure.ac' if present, or else \`configure.in'. Output is sent
|
|---|
| 27 | to the standard output if TEMPLATE-FILE is given, else into
|
|---|
| 28 | \`configure'.
|
|---|
| 29 |
|
|---|
| 30 | Operation modes:
|
|---|
| 31 | -h, --help print this help, then exit
|
|---|
| 32 | -V, --version print version number, then exit
|
|---|
| 33 | -v, --verbose verbosely report processing
|
|---|
| 34 | -d, --debug don't remove temporary files
|
|---|
| 35 | -f, --force consider all files obsolete
|
|---|
| 36 | -o, --output=FILE save output in FILE (stdout is the default)
|
|---|
| 37 | -W, --warnings=CATEGORY report the warnings falling in CATEGORY [syntax]
|
|---|
| 38 |
|
|---|
| 39 | Warning categories include:
|
|---|
| 40 | \`cross' cross compilation issues
|
|---|
| 41 | \`obsolete' obsolete constructs
|
|---|
| 42 | \`syntax' dubious syntactic constructs
|
|---|
| 43 | \`all' all the warnings
|
|---|
| 44 | \`no-CATEGORY' turn off the warnings on CATEGORY
|
|---|
| 45 | \`none' turn off all the warnings
|
|---|
| 46 | \`error' warnings are error
|
|---|
| 47 |
|
|---|
| 48 | The environment variables \`M4' and \`WARNINGS' are honored.
|
|---|
| 49 |
|
|---|
| 50 | Library directories:
|
|---|
| 51 | -B, --prepend-include=DIR prepend directory DIR to search path
|
|---|
| 52 | -I, --include=DIR append directory DIR to search path
|
|---|
| 53 |
|
|---|
| 54 | Tracing:
|
|---|
| 55 | -t, --trace=MACRO report the list of calls to MACRO
|
|---|
| 56 | -i, --initialization also trace Autoconf's initialization process
|
|---|
| 57 |
|
|---|
| 58 | In tracing mode, no configuration script is created.
|
|---|
| 59 |
|
|---|
| 60 | Report bugs to <[email protected]>."]
|
|---|
| 61 |
|
|---|
| 62 | version=["\
|
|---|
| 63 | autoconf (@PACKAGE_NAME@) @VERSION@
|
|---|
| 64 | Copyright (C) 2006 Free Software Foundation, Inc.
|
|---|
| 65 | This is free software. You may redistribute copies of it under the terms of
|
|---|
| 66 | the GNU General Public License <http://www.gnu.org/licenses/gpl.html>.
|
|---|
| 67 | There is NO WARRANTY, to the extent permitted by law.
|
|---|
| 68 |
|
|---|
| 69 | Written by David J. MacKenzie and Akim Demaille."]
|
|---|
| 70 |
|
|---|
| 71 | help="\
|
|---|
| 72 | Try \`$as_me --help' for more information."
|
|---|
| 73 |
|
|---|
| 74 | exit_missing_arg="\
|
|---|
| 75 | echo \"$as_me: option \\\`\$1' requires an argument\" >&2
|
|---|
| 76 | echo \"\$help\" >&2
|
|---|
| 77 | exit 1"
|
|---|
| 78 |
|
|---|
| 79 | # Variables.
|
|---|
| 80 | : ${AUTOM4TE=`echo '@bindir@/@autom4te-name@' | sed -e "s|\/@unixroot|$UNIXROOT|"`}
|
|---|
| 81 | autom4te_options=
|
|---|
| 82 | outfile=
|
|---|
| 83 | verbose=:
|
|---|
| 84 |
|
|---|
| 85 | # Parse command line.
|
|---|
| 86 | while test $# -gt 0 ; do
|
|---|
| 87 | option=[`expr "x$1" : 'x\(--[^=]*\)' \| \
|
|---|
| 88 | "x$1" : 'x\(-.\)'`]
|
|---|
| 89 | optarg=[`expr "x$1" : 'x--[^=]*=\(.*\)' \| \
|
|---|
| 90 | "x$1" : 'x-.\(.*\)'`]
|
|---|
| 91 | case $1 in
|
|---|
| 92 | --version | -V )
|
|---|
| 93 | echo "$version" ; exit ;;
|
|---|
| 94 | --help | -h )
|
|---|
| 95 | echo "$usage"; exit ;;
|
|---|
| 96 |
|
|---|
| 97 | --verbose | -v )
|
|---|
| 98 | verbose=echo
|
|---|
| 99 | autom4te_options="$autom4te_options $1"; shift ;;
|
|---|
| 100 |
|
|---|
| 101 | # Arguments passed as is to autom4te.
|
|---|
| 102 | --debug | -d | \
|
|---|
| 103 | --force | -f | \
|
|---|
| 104 | --include=* | -I?* | \
|
|---|
| 105 | --prepend-include=* | -B?* | \
|
|---|
| 106 | --warnings=* | -W?* )
|
|---|
| 107 | autom4te_options="$autom4te_options '$1'"; shift ;;
|
|---|
| 108 |
|
|---|
| 109 | # Options with separated arg passed as is to autom4te.
|
|---|
| 110 | --include | -I | \
|
|---|
| 111 | --prepend-include | -B | \
|
|---|
| 112 | --warnings | -W )
|
|---|
| 113 | test $# = 1 && eval "$exit_missing_arg"
|
|---|
| 114 | autom4te_options="$autom4te_options $option '$2'"
|
|---|
| 115 | shift; shift ;;
|
|---|
| 116 |
|
|---|
| 117 | --trace=* | -t?* )
|
|---|
| 118 | traces="$traces --trace='"`echo "$optarg" | sed "s/'/'\\\\\\\\''/g"`"'"
|
|---|
| 119 | shift ;;
|
|---|
| 120 | --trace | -t )
|
|---|
| 121 | test $# = 1 && eval "$exit_missing_arg"
|
|---|
| 122 | traces="$traces --trace='"`echo "$2" | sed "s/'/'\\\\\\\\''/g"`"'"
|
|---|
| 123 | shift; shift ;;
|
|---|
| 124 | --initialization | -i )
|
|---|
| 125 | autom4te_options="$autom4te_options --melt"
|
|---|
| 126 | shift;;
|
|---|
| 127 |
|
|---|
| 128 | --output=* | -o?* )
|
|---|
| 129 | outfile=$optarg
|
|---|
| 130 | shift ;;
|
|---|
| 131 | --output | -o )
|
|---|
| 132 | test $# = 1 && eval "$exit_missing_arg"
|
|---|
| 133 | outfile=$2
|
|---|
| 134 | shift; shift ;;
|
|---|
| 135 |
|
|---|
| 136 | -- ) # Stop option processing
|
|---|
| 137 | shift; break ;;
|
|---|
| 138 | - ) # Use stdin as input.
|
|---|
| 139 | break ;;
|
|---|
| 140 | -* )
|
|---|
| 141 | exec >&2
|
|---|
| 142 | echo "$as_me: invalid option $1"
|
|---|
| 143 | echo "$help"
|
|---|
| 144 | exit 1 ;;
|
|---|
| 145 | * )
|
|---|
| 146 | break ;;
|
|---|
| 147 | esac
|
|---|
| 148 | done
|
|---|
| 149 |
|
|---|
| 150 | # Find the input file.
|
|---|
| 151 | case $# in
|
|---|
| 152 | 0)
|
|---|
| 153 | if test -f configure.ac; then
|
|---|
| 154 | if test -f configure.in; then
|
|---|
| 155 | echo "$as_me: warning: both \`configure.ac' and \`configure.in' are present." >&2
|
|---|
| 156 | echo "$as_me: warning: proceeding with \`configure.ac'." >&2
|
|---|
| 157 | fi
|
|---|
| 158 | infile=configure.ac
|
|---|
| 159 | elif test -f configure.in; then
|
|---|
| 160 | infile=configure.in
|
|---|
| 161 | else
|
|---|
| 162 | echo "$as_me: no input file" >&2
|
|---|
| 163 | exit 1
|
|---|
| 164 | fi
|
|---|
| 165 | test -z "$traces" && test -z "$outfile" && outfile=configure;;
|
|---|
| 166 | 1) # autom4te doesn't like `-'.
|
|---|
| 167 | test "x$1" != "x-" && infile=$1 ;;
|
|---|
| 168 | *) exec >&2
|
|---|
| 169 | echo "$as_me: invalid number of arguments."
|
|---|
| 170 | echo "$help"
|
|---|
| 171 | (exit 1); exit 1 ;;
|
|---|
| 172 | esac
|
|---|
| 173 |
|
|---|
| 174 | # Unless specified, the output is stdout.
|
|---|
| 175 | test -z "$outfile" && outfile=-
|
|---|
| 176 |
|
|---|
| 177 | # Run autom4te with expansion.
|
|---|
| 178 | eval set x $autom4te_options \
|
|---|
| 179 | --language=autoconf --output=\$outfile "$traces" \$infile
|
|---|
| 180 | shift
|
|---|
| 181 | $verbose "$as_me: running $AUTOM4TE $*" >&2
|
|---|
| 182 | exec "$AUTOM4TE" "$@"
|
|---|