From: Noah Friedman Date: Wed, 16 Jun 1993 20:15:11 +0000 (+0000) Subject: Initial revision X-Git-Tag: fsf-origin~891 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=f2ed531a76fa2824a0f2705274a43328daa34454;p=thirdparty%2Fautoconf.git Initial revision --- diff --git a/autoconf.in b/autoconf.in new file mode 100644 index 000000000..742a074cf --- /dev/null +++ b/autoconf.in @@ -0,0 +1,115 @@ +#!/bin/sh +# autoconf -- create `configure' using m4 macros +# Copyright (C) 1992, 1993 Free Software Foundation, Inc. + +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2, or (at your option) +# any later version. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. + +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + +# If given no args, create `configure' from template file `configure.in'. +# With one arg, create a configure script on standard output from +# the given template file. + +# NLS nuisances. +LANG=C; LC_ALL=C; export LANG; export LC_ALL; + +usage="Usage: autoconf [-h] [--help] [-m dir] [--macrodir=dir] + [-v] [--version] [template-file]" + +test -z "${AC_MACRODIR}" && AC_MACRODIR=@datadir@ +test -z "${M4}" && M4=@M4@ + +print_version= +while test $# -gt 0 ; do + case "z${1}" in + z-h | z--help | z--h* ) + echo "${usage}" 1>&2; exit 1 ;; + z--macrodir=* | z--m*=* ) + AC_MACRODIR="`echo \"${1}\" | sed -e 's/^[^=]*=//'`" + shift ;; + z-m | z--macrodir | z--m* ) + shift + test $# -eq 0 && { echo "${usage}" 1>&2; exit 1; } + AC_MACRODIR="${1}" + shift ;; + z-v | z--version | z--v* ) + print_version="-DAC_PRINT_VERSION" + shift ;; + z-- ) # Stop option processing + shift; break ;; + z- ) # Use stdin as input. + break ;; + z-* ) + echo "${usage}" 1>&2; exit 1 ;; + * ) + break ;; + esac +done + +case $# in + 0) infile=configure.in ;; + 1) infile="$1" ;; + *) echo "$usage" >&2; exit 1 ;; +esac + +version_only= +if test z$infile = z-; then + infile=/tmp/acin.$$ + trap 'rm -f $infile' 1 3 15 + cat > $infile +else + if test ! -s "${infile}"; then + if test $# -eq 0 -a z"$print_version" != z; then + # No error for `autoconf --version'. + infile=/dev/null + version_only=yes + else + echo "autoconf: ${infile}: No such file or directory" >&2 + exit 1 + fi + fi +fi + +tmpout=/tmp/acout.$$ +trap 'rm -f $tmpout; exit 1' 1 3 15 + +MACROFILES="${AC_MACRODIR}/acgeneral.m4 ${AC_MACRODIR}/acspecific.m4" +test -r ${AC_MACRODIR}/aclocal.m4 \ + && MACROFILES="${MACROFILES} ${AC_MACRODIR}/aclocal.m4" +test -r aclocal.m4 && MACROFILES="${MACROFILES} aclocal.m4" +MACROFILES="${print_version} ${MACROFILES}" + +$M4 $MACROFILES $infile > $tmpout + +# You could add your own prefixes to pattern if you wanted to check for +# them too, e.g. pattern="AC_\|ILT_", except that UNIX sed doesn't do +# alternation, and GNU sed is dreadfully slow. Sigh. +pattern="AC_" + +status=0 +if grep "${pattern}" $tmpout > /dev/null 2>&1; then + echo "autoconf: Undefined macros:" >&2 + grep "${pattern}" $tmpout | sed "s/.*\(${pattern}[_A-Z0-9]*\).*/\1/" | + while read name; do + grep -n $name $infile /dev/null + done | sort -u >&2 + status=1 +fi + +test z"$version_only" = z && case $# in + 0) cat $tmpout > configure; chmod +x configure ;; + 1) cat $tmpout ;; +esac + +rm -f $tmpout +exit $status diff --git a/autoconf.sh b/autoconf.sh new file mode 100644 index 000000000..742a074cf --- /dev/null +++ b/autoconf.sh @@ -0,0 +1,115 @@ +#!/bin/sh +# autoconf -- create `configure' using m4 macros +# Copyright (C) 1992, 1993 Free Software Foundation, Inc. + +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2, or (at your option) +# any later version. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. + +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + +# If given no args, create `configure' from template file `configure.in'. +# With one arg, create a configure script on standard output from +# the given template file. + +# NLS nuisances. +LANG=C; LC_ALL=C; export LANG; export LC_ALL; + +usage="Usage: autoconf [-h] [--help] [-m dir] [--macrodir=dir] + [-v] [--version] [template-file]" + +test -z "${AC_MACRODIR}" && AC_MACRODIR=@datadir@ +test -z "${M4}" && M4=@M4@ + +print_version= +while test $# -gt 0 ; do + case "z${1}" in + z-h | z--help | z--h* ) + echo "${usage}" 1>&2; exit 1 ;; + z--macrodir=* | z--m*=* ) + AC_MACRODIR="`echo \"${1}\" | sed -e 's/^[^=]*=//'`" + shift ;; + z-m | z--macrodir | z--m* ) + shift + test $# -eq 0 && { echo "${usage}" 1>&2; exit 1; } + AC_MACRODIR="${1}" + shift ;; + z-v | z--version | z--v* ) + print_version="-DAC_PRINT_VERSION" + shift ;; + z-- ) # Stop option processing + shift; break ;; + z- ) # Use stdin as input. + break ;; + z-* ) + echo "${usage}" 1>&2; exit 1 ;; + * ) + break ;; + esac +done + +case $# in + 0) infile=configure.in ;; + 1) infile="$1" ;; + *) echo "$usage" >&2; exit 1 ;; +esac + +version_only= +if test z$infile = z-; then + infile=/tmp/acin.$$ + trap 'rm -f $infile' 1 3 15 + cat > $infile +else + if test ! -s "${infile}"; then + if test $# -eq 0 -a z"$print_version" != z; then + # No error for `autoconf --version'. + infile=/dev/null + version_only=yes + else + echo "autoconf: ${infile}: No such file or directory" >&2 + exit 1 + fi + fi +fi + +tmpout=/tmp/acout.$$ +trap 'rm -f $tmpout; exit 1' 1 3 15 + +MACROFILES="${AC_MACRODIR}/acgeneral.m4 ${AC_MACRODIR}/acspecific.m4" +test -r ${AC_MACRODIR}/aclocal.m4 \ + && MACROFILES="${MACROFILES} ${AC_MACRODIR}/aclocal.m4" +test -r aclocal.m4 && MACROFILES="${MACROFILES} aclocal.m4" +MACROFILES="${print_version} ${MACROFILES}" + +$M4 $MACROFILES $infile > $tmpout + +# You could add your own prefixes to pattern if you wanted to check for +# them too, e.g. pattern="AC_\|ILT_", except that UNIX sed doesn't do +# alternation, and GNU sed is dreadfully slow. Sigh. +pattern="AC_" + +status=0 +if grep "${pattern}" $tmpout > /dev/null 2>&1; then + echo "autoconf: Undefined macros:" >&2 + grep "${pattern}" $tmpout | sed "s/.*\(${pattern}[_A-Z0-9]*\).*/\1/" | + while read name; do + grep -n $name $infile /dev/null + done | sort -u >&2 + status=1 +fi + +test z"$version_only" = z && case $# in + 0) cat $tmpout > configure; chmod +x configure ;; + 1) cat $tmpout ;; +esac + +rm -f $tmpout +exit $status diff --git a/bin/autoconf.in b/bin/autoconf.in new file mode 100644 index 000000000..742a074cf --- /dev/null +++ b/bin/autoconf.in @@ -0,0 +1,115 @@ +#!/bin/sh +# autoconf -- create `configure' using m4 macros +# Copyright (C) 1992, 1993 Free Software Foundation, Inc. + +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2, or (at your option) +# any later version. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. + +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + +# If given no args, create `configure' from template file `configure.in'. +# With one arg, create a configure script on standard output from +# the given template file. + +# NLS nuisances. +LANG=C; LC_ALL=C; export LANG; export LC_ALL; + +usage="Usage: autoconf [-h] [--help] [-m dir] [--macrodir=dir] + [-v] [--version] [template-file]" + +test -z "${AC_MACRODIR}" && AC_MACRODIR=@datadir@ +test -z "${M4}" && M4=@M4@ + +print_version= +while test $# -gt 0 ; do + case "z${1}" in + z-h | z--help | z--h* ) + echo "${usage}" 1>&2; exit 1 ;; + z--macrodir=* | z--m*=* ) + AC_MACRODIR="`echo \"${1}\" | sed -e 's/^[^=]*=//'`" + shift ;; + z-m | z--macrodir | z--m* ) + shift + test $# -eq 0 && { echo "${usage}" 1>&2; exit 1; } + AC_MACRODIR="${1}" + shift ;; + z-v | z--version | z--v* ) + print_version="-DAC_PRINT_VERSION" + shift ;; + z-- ) # Stop option processing + shift; break ;; + z- ) # Use stdin as input. + break ;; + z-* ) + echo "${usage}" 1>&2; exit 1 ;; + * ) + break ;; + esac +done + +case $# in + 0) infile=configure.in ;; + 1) infile="$1" ;; + *) echo "$usage" >&2; exit 1 ;; +esac + +version_only= +if test z$infile = z-; then + infile=/tmp/acin.$$ + trap 'rm -f $infile' 1 3 15 + cat > $infile +else + if test ! -s "${infile}"; then + if test $# -eq 0 -a z"$print_version" != z; then + # No error for `autoconf --version'. + infile=/dev/null + version_only=yes + else + echo "autoconf: ${infile}: No such file or directory" >&2 + exit 1 + fi + fi +fi + +tmpout=/tmp/acout.$$ +trap 'rm -f $tmpout; exit 1' 1 3 15 + +MACROFILES="${AC_MACRODIR}/acgeneral.m4 ${AC_MACRODIR}/acspecific.m4" +test -r ${AC_MACRODIR}/aclocal.m4 \ + && MACROFILES="${MACROFILES} ${AC_MACRODIR}/aclocal.m4" +test -r aclocal.m4 && MACROFILES="${MACROFILES} aclocal.m4" +MACROFILES="${print_version} ${MACROFILES}" + +$M4 $MACROFILES $infile > $tmpout + +# You could add your own prefixes to pattern if you wanted to check for +# them too, e.g. pattern="AC_\|ILT_", except that UNIX sed doesn't do +# alternation, and GNU sed is dreadfully slow. Sigh. +pattern="AC_" + +status=0 +if grep "${pattern}" $tmpout > /dev/null 2>&1; then + echo "autoconf: Undefined macros:" >&2 + grep "${pattern}" $tmpout | sed "s/.*\(${pattern}[_A-Z0-9]*\).*/\1/" | + while read name; do + grep -n $name $infile /dev/null + done | sort -u >&2 + status=1 +fi + +test z"$version_only" = z && case $# in + 0) cat $tmpout > configure; chmod +x configure ;; + 1) cat $tmpout ;; +esac + +rm -f $tmpout +exit $status