diff -Nru filtergen-0.12.4/aclocal.m4 filtergen-0.12.7/aclocal.m4 --- filtergen-0.12.4/aclocal.m4 2004-08-18 03:50:33.000000000 +0000 +++ filtergen-0.12.7/aclocal.m4 2016-02-13 10:53:01.000000000 +0000 @@ -1,7 +1,7 @@ -# generated automatically by aclocal 1.8.5 -*- Autoconf -*- +# generated automatically by aclocal 1.15 -*- Autoconf -*- + +# Copyright (C) 1996-2014 Free Software Foundation, Inc. -# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004 -# Free Software Foundation, Inc. # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. @@ -11,59 +11,62 @@ # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. -# -*- Autoconf -*- -# Copyright (C) 2002, 2003 Free Software Foundation, Inc. -# Generated from amversion.in; do not edit by hand. - -# 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. +m4_ifndef([AC_CONFIG_MACRO_DIRS], [m4_defun([_AM_CONFIG_MACRO_DIRS], [])m4_defun([AC_CONFIG_MACRO_DIRS], [_AM_CONFIG_MACRO_DIRS($@)])]) +m4_ifndef([AC_AUTOCONF_VERSION], + [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl +m4_if(m4_defn([AC_AUTOCONF_VERSION]), [2.69],, +[m4_warning([this file was generated for autoconf 2.69. +You have another version of autoconf. It may work, but is not guaranteed to. +If you have problems, you may need to regenerate the build system entirely. +To do so, use the procedure documented by the package, typically 'autoreconf'.])]) -# 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., 59 Temple Place - Suite 330, Boston, MA +# Copyright (C) 2002-2014 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. # AM_AUTOMAKE_VERSION(VERSION) # ---------------------------- # Automake X.Y traces this macro to ensure aclocal.m4 has been # generated from the m4 files accompanying Automake X.Y. -AC_DEFUN([AM_AUTOMAKE_VERSION], [am__api_version="1.8"]) +# (This private macro should not be called outside this file.) +AC_DEFUN([AM_AUTOMAKE_VERSION], +[am__api_version='1.15' +dnl Some users find AM_AUTOMAKE_VERSION and mistake it for a way to +dnl require some minimum version. Point them to the right macro. +m4_if([$1], [1.15], [], + [AC_FATAL([Do not call $0, use AM_INIT_AUTOMAKE([$1]).])])dnl +]) + +# _AM_AUTOCONF_VERSION(VERSION) +# ----------------------------- +# aclocal traces this macro to find the Autoconf version. +# This is a private macro too. Using m4_define simplifies +# the logic in aclocal, which can simply ignore this definition. +m4_define([_AM_AUTOCONF_VERSION], []) # AM_SET_CURRENT_AUTOMAKE_VERSION # ------------------------------- -# Call AM_AUTOMAKE_VERSION so it can be traced. -# This function is AC_REQUIREd by AC_INIT_AUTOMAKE. +# Call AM_AUTOMAKE_VERSION and AM_AUTOMAKE_VERSION so they can be traced. +# This function is AC_REQUIREd by AM_INIT_AUTOMAKE. AC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION], - [AM_AUTOMAKE_VERSION([1.8.5])]) - -# AM_AUX_DIR_EXPAND +[AM_AUTOMAKE_VERSION([1.15])dnl +m4_ifndef([AC_AUTOCONF_VERSION], + [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl +_AM_AUTOCONF_VERSION(m4_defn([AC_AUTOCONF_VERSION]))]) -# Copyright (C) 2001, 2003 Free Software Foundation, Inc. +# AM_AUX_DIR_EXPAND -*- Autoconf -*- -# 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., 59 Temple Place - Suite 330, Boston, MA -# 02111-1307, USA. +# Copyright (C) 2001-2014 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. # For projects using AC_CONFIG_AUX_DIR([foo]), Autoconf sets -# $ac_aux_dir to `$srcdir/foo'. In other projects, it is set to -# `$srcdir', `$srcdir/..', or `$srcdir/../..'. +# $ac_aux_dir to '$srcdir/foo'. In other projects, it is set to +# '$srcdir', '$srcdir/..', or '$srcdir/../..'. # # Of course, Automake must honor this variable whenever it calls a # tool from the auxiliary directory. The problem is that $srcdir (and @@ -82,7 +85,7 @@ # # The reason of the latter failure is that $top_srcdir and $ac_aux_dir # are both prefixed by $srcdir. In an in-source build this is usually -# harmless because $srcdir is `.', but things will broke when you +# harmless because $srcdir is '.', but things will broke when you # start a VPATH build or use an absolute $srcdir. # # So we could use something similar to $top_srcdir/$ac_aux_dir/missing, @@ -100,42 +103,31 @@ # configured tree to be moved without reconfiguration. AC_DEFUN([AM_AUX_DIR_EXPAND], -[dnl Rely on autoconf to set up CDPATH properly. -AC_PREREQ([2.50])dnl -# expand $ac_aux_dir to an absolute path -am_aux_dir=`cd $ac_aux_dir && pwd` +[AC_REQUIRE([AC_CONFIG_AUX_DIR_DEFAULT])dnl +# Expand $ac_aux_dir to an absolute path. +am_aux_dir=`cd "$ac_aux_dir" && pwd` ]) -# AM_CONDITIONAL -*- Autoconf -*- +# AM_CONDITIONAL -*- Autoconf -*- -# Copyright (C) 1997, 2000, 2001, 2003 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., 59 Temple Place - Suite 330, Boston, MA -# 02111-1307, USA. - -# serial 6 +# Copyright (C) 1997-2014 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. # AM_CONDITIONAL(NAME, SHELL-CONDITION) # ------------------------------------- # Define a conditional. AC_DEFUN([AM_CONDITIONAL], -[AC_PREREQ(2.52)dnl - ifelse([$1], [TRUE], [AC_FATAL([$0: invalid condition: $1])], - [$1], [FALSE], [AC_FATAL([$0: invalid condition: $1])])dnl -AC_SUBST([$1_TRUE]) -AC_SUBST([$1_FALSE]) +[AC_PREREQ([2.52])dnl + m4_if([$1], [TRUE], [AC_FATAL([$0: invalid condition: $1])], + [$1], [FALSE], [AC_FATAL([$0: invalid condition: $1])])dnl +AC_SUBST([$1_TRUE])dnl +AC_SUBST([$1_FALSE])dnl +_AM_SUBST_NOTMAKE([$1_TRUE])dnl +_AM_SUBST_NOTMAKE([$1_FALSE])dnl +m4_define([_AM_COND_VALUE_$1], [$2])dnl if $2; then $1_TRUE= $1_FALSE='#' @@ -145,43 +137,28 @@ fi AC_CONFIG_COMMANDS_PRE( [if test -z "${$1_TRUE}" && test -z "${$1_FALSE}"; then - AC_MSG_ERROR([conditional "$1" was never defined. -Usually this means the macro was only invoked conditionally.]) + AC_MSG_ERROR([[conditional "$1" was never defined. +Usually this means the macro was only invoked conditionally.]]) fi])]) -# serial 7 -*- Autoconf -*- - -# Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004 -# 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., 59 Temple Place - Suite 330, Boston, MA -# 02111-1307, USA. +# Copyright (C) 1999-2014 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. -# There are a few dirty hacks below to avoid letting `AC_PROG_CC' be +# There are a few dirty hacks below to avoid letting 'AC_PROG_CC' be # written in clear, in which case automake, when reading aclocal.m4, # will think it sees a *use*, and therefore will trigger all it's # C support machinery. Also note that it means that autoscan, seeing # CC etc. in the Makefile, will ask for an AC_PROG_CC use... - # _AM_DEPENDENCIES(NAME) # ---------------------- # See how the compiler implements dependency checking. -# NAME is "CC", "CXX", "GCJ", or "OBJC". +# NAME is "CC", "CXX", "OBJC", "OBJCXX", "UPC", or "GJC". # We try a few techniques and use that to set a single cache variable. # # We don't AC_REQUIRE the corresponding AC_PROG_CC since the latter was @@ -194,11 +171,13 @@ AC_REQUIRE([AM_MAKE_INCLUDE])dnl AC_REQUIRE([AM_DEP_TRACK])dnl -ifelse([$1], CC, [depcc="$CC" am_compiler_list=], - [$1], CXX, [depcc="$CXX" am_compiler_list=], - [$1], OBJC, [depcc="$OBJC" am_compiler_list='gcc3 gcc'], - [$1], GCJ, [depcc="$GCJ" am_compiler_list='gcc3 gcc'], - [depcc="$$1" am_compiler_list=]) +m4_if([$1], [CC], [depcc="$CC" am_compiler_list=], + [$1], [CXX], [depcc="$CXX" am_compiler_list=], + [$1], [OBJC], [depcc="$OBJC" am_compiler_list='gcc3 gcc'], + [$1], [OBJCXX], [depcc="$OBJCXX" am_compiler_list='gcc3 gcc'], + [$1], [UPC], [depcc="$UPC" am_compiler_list=], + [$1], [GCJ], [depcc="$GCJ" am_compiler_list='gcc3 gcc'], + [depcc="$$1" am_compiler_list=]) AC_CACHE_CHECK([dependency style of $depcc], [am_cv_$1_dependencies_compiler_type], @@ -206,8 +185,9 @@ # We make a subdir and do the tests there. Otherwise we can end up # making bogus files that we don't know about and never remove. For # instance it was reported that on HP-UX the gcc test will end up - # making a dummy file named `D' -- because `-MD' means `put the output - # in D'. + # making a dummy file named 'D' -- because '-MD' means "put the output + # in D". + rm -rf conftest.dir mkdir conftest.dir # Copy depcomp to subdir because otherwise we won't find it if we're # using a relative directory. @@ -225,6 +205,16 @@ if test "$am_compiler_list" = ""; then am_compiler_list=`sed -n ['s/^#*\([a-zA-Z0-9]*\))$/\1/p'] < ./depcomp` fi + am__universal=false + m4_case([$1], [CC], + [case " $depcc " in #( + *\ -arch\ *\ -arch\ *) am__universal=true ;; + esac], + [CXX], + [case " $depcc " in #( + *\ -arch\ *\ -arch\ *) am__universal=true ;; + esac]) + for depmode in $am_compiler_list; do # Setup a source with many dependencies, because some compilers # like to wrap large dependency lists on column 80 (with \), and @@ -236,34 +226,49 @@ : > sub/conftest.c for i in 1 2 3 4 5 6; do echo '#include "conftst'$i'.h"' >> sub/conftest.c - # Using `: > sub/conftst$i.h' creates only sub/conftst1.h with - # Solaris 8's {/usr,}/bin/sh. - touch sub/conftst$i.h + # Using ": > sub/conftst$i.h" creates only sub/conftst1.h with + # Solaris 10 /bin/sh. + echo '/* dummy */' > sub/conftst$i.h done echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf + # We check with '-c' and '-o' for the sake of the "dashmstdout" + # mode. It turns out that the SunPro C++ compiler does not properly + # handle '-M -o', and we need to detect this. Also, some Intel + # versions had trouble with output in subdirs. + am__obj=sub/conftest.${OBJEXT-o} + am__minus_obj="-o $am__obj" case $depmode in + gcc) + # This depmode causes a compiler race in universal mode. + test "$am__universal" = false || continue + ;; nosideeffect) - # after this tag, mechanisms are not by side-effect, so they'll - # only be used when explicitly requested + # After this tag, mechanisms are not by side-effect, so they'll + # only be used when explicitly requested. if test "x$enable_dependency_tracking" = xyes; then continue else break fi ;; + msvc7 | msvc7msys | msvisualcpp | msvcmsys) + # This compiler won't grok '-c -o', but also, the minuso test has + # not run yet. These depmodes are late enough in the game, and + # so weak that their functioning should not be impacted. + am__obj=conftest.${OBJEXT-o} + am__minus_obj= + ;; none) break ;; esac - # We check with `-c' and `-o' for the sake of the "dashmstdout" - # mode. It turns out that the SunPro C++ compiler does not properly - # handle `-M -o', and we need to detect this. if depmode=$depmode \ - source=sub/conftest.c object=sub/conftest.${OBJEXT-o} \ + source=sub/conftest.c object=$am__obj \ depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \ - $SHELL ./depcomp $depcc -c -o sub/conftest.${OBJEXT-o} sub/conftest.c \ + $SHELL ./depcomp $depcc -c $am__minus_obj sub/conftest.c \ >/dev/null 2>conftest.err && + grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 && grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 && - grep sub/conftest.${OBJEXT-o} sub/conftest.Po > /dev/null 2>&1 && + grep $am__obj sub/conftest.Po > /dev/null 2>&1 && ${MAKE-make} -s -f confmf > /dev/null 2>&1; then # icc doesn't choke on unknown options, it will just issue warnings # or remarks (even with -Werror). So we grep stderr for any message @@ -296,7 +301,7 @@ # AM_SET_DEPDIR # ------------- # Choose a directory name for dependency files. -# This macro is AC_REQUIREd in _AM_DEPENDENCIES +# This macro is AC_REQUIREd in _AM_DEPENDENCIES. AC_DEFUN([AM_SET_DEPDIR], [AC_REQUIRE([AM_SET_LEADING_DOT])dnl AC_SUBST([DEPDIR], ["${am__leading_dot}deps"])dnl @@ -306,85 +311,85 @@ # AM_DEP_TRACK # ------------ AC_DEFUN([AM_DEP_TRACK], -[AC_ARG_ENABLE(dependency-tracking, -[ --disable-dependency-tracking speeds up one-time build - --enable-dependency-tracking do not reject slow dependency extractors]) +[AC_ARG_ENABLE([dependency-tracking], [dnl +AS_HELP_STRING( + [--enable-dependency-tracking], + [do not reject slow dependency extractors]) +AS_HELP_STRING( + [--disable-dependency-tracking], + [speeds up one-time build])]) if test "x$enable_dependency_tracking" != xno; then am_depcomp="$ac_aux_dir/depcomp" AMDEPBACKSLASH='\' + am__nodep='_no' fi AM_CONDITIONAL([AMDEP], [test "x$enable_dependency_tracking" != xno]) -AC_SUBST([AMDEPBACKSLASH]) +AC_SUBST([AMDEPBACKSLASH])dnl +_AM_SUBST_NOTMAKE([AMDEPBACKSLASH])dnl +AC_SUBST([am__nodep])dnl +_AM_SUBST_NOTMAKE([am__nodep])dnl ]) -# Generate code to set up dependency tracking. -*- Autoconf -*- - -# Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004 Free Software Foundation, Inc. +# Generate code to set up dependency tracking. -*- Autoconf -*- -# 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., 59 Temple Place - Suite 330, Boston, MA -# 02111-1307, USA. +# Copyright (C) 1999-2014 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. -#serial 2 # _AM_OUTPUT_DEPENDENCY_COMMANDS # ------------------------------ AC_DEFUN([_AM_OUTPUT_DEPENDENCY_COMMANDS], -[for mf in $CONFIG_FILES; do - # Strip MF so we end up with the name of the file. - mf=`echo "$mf" | sed -e 's/:.*$//'` - # Check whether this is an Automake generated Makefile or not. - # We used to match only the files named `Makefile.in', but - # some people rename them; so instead we look at the file content. - # Grep'ing the first line is not enough: some people post-process - # each Makefile.in and add a new line on top of each file to say so. - # So let's grep whole file. - if grep '^#.*generated by automake' $mf > /dev/null 2>&1; then - dirpart=`AS_DIRNAME("$mf")` - else - continue - fi - grep '^DEP_FILES *= *[[^ @%:@]]' < "$mf" > /dev/null || continue - # Extract the definition of DEP_FILES from the Makefile without - # running `make'. - DEPDIR=`sed -n 's/^DEPDIR = //p' < "$mf"` - test -z "$DEPDIR" && continue - # When using ansi2knr, U may be empty or an underscore; expand it - U=`sed -n 's/^U = //p' < "$mf"` - test -d "$dirpart/$DEPDIR" || mkdir "$dirpart/$DEPDIR" - # We invoke sed twice because it is the simplest approach to - # changing $(DEPDIR) to its actual value in the expansion. - for file in `sed -n ' - /^DEP_FILES = .*\\\\$/ { - s/^DEP_FILES = // - :loop - s/\\\\$// - p - n - /\\\\$/ b loop - p - } - /^DEP_FILES = / s/^DEP_FILES = //p' < "$mf" | \ - sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g' -e 's/\$U/'"$U"'/g'`; do - # Make sure the directory exists. - test -f "$dirpart/$file" && continue - fdir=`AS_DIRNAME(["$file"])` - AS_MKDIR_P([$dirpart/$fdir]) - # echo "creating $dirpart/$file" - echo '# dummy' > "$dirpart/$file" +[{ + # Older Autoconf quotes --file arguments for eval, but not when files + # are listed without --file. Let's play safe and only enable the eval + # if we detect the quoting. + case $CONFIG_FILES in + *\'*) eval set x "$CONFIG_FILES" ;; + *) set x $CONFIG_FILES ;; + esac + shift + for mf + do + # Strip MF so we end up with the name of the file. + mf=`echo "$mf" | sed -e 's/:.*$//'` + # Check whether this is an Automake generated Makefile or not. + # We used to match only the files named 'Makefile.in', but + # some people rename them; so instead we look at the file content. + # Grep'ing the first line is not enough: some people post-process + # each Makefile.in and add a new line on top of each file to say so. + # Grep'ing the whole file is not good either: AIX grep has a line + # limit of 2048, but all sed's we know have understand at least 4000. + if sed -n 's,^#.*generated by automake.*,X,p' "$mf" | grep X >/dev/null 2>&1; then + dirpart=`AS_DIRNAME("$mf")` + else + continue + fi + # Extract the definition of DEPDIR, am__include, and am__quote + # from the Makefile without running 'make'. + DEPDIR=`sed -n 's/^DEPDIR = //p' < "$mf"` + test -z "$DEPDIR" && continue + am__include=`sed -n 's/^am__include = //p' < "$mf"` + test -z "$am__include" && continue + am__quote=`sed -n 's/^am__quote = //p' < "$mf"` + # Find all dependency output files, they are included files with + # $(DEPDIR) in their names. We invoke sed twice because it is the + # simplest approach to changing $(DEPDIR) to its actual value in the + # expansion. + for file in `sed -n " + s/^$am__include $am__quote\(.*(DEPDIR).*\)$am__quote"'$/\1/p' <"$mf" | \ + sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g'`; do + # Make sure the directory exists. + test -f "$dirpart/$file" && continue + fdir=`AS_DIRNAME(["$file"])` + AS_MKDIR_P([$dirpart/$fdir]) + # echo "creating $dirpart/$file" + echo '# dummy' > "$dirpart/$file" + done done -done +} ])# _AM_OUTPUT_DEPENDENCY_COMMANDS @@ -393,7 +398,7 @@ # This macro should only be invoked once -- use via AC_REQUIRE. # # This code is only required when automatic dependency tracking -# is enabled. FIXME. This creates each `.P' file that we will +# is enabled. FIXME. This creates each '.P' file that we will # need in order to bootstrap the dependency handling code. AC_DEFUN([AM_OUTPUT_DEPENDENCY_COMMANDS], [AC_CONFIG_COMMANDS([depfiles], @@ -401,54 +406,22 @@ [AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir"]) ]) -# Like AC_CONFIG_HEADER, but automatically create stamp file. -*- Autoconf -*- - -# Copyright (C) 1996, 1997, 2000, 2001, 2003 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., 59 Temple Place - Suite 330, Boston, MA -# 02111-1307, USA. - -# serial 7 - -# AM_CONFIG_HEADER is obsolete. It has been replaced by AC_CONFIG_HEADERS. -AU_DEFUN([AM_CONFIG_HEADER], [AC_CONFIG_HEADERS($@)]) +# Do all the work for Automake. -*- Autoconf -*- -# Do all the work for Automake. -*- Autoconf -*- +# Copyright (C) 1996-2014 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. -# This macro actually does too much some checks are only needed if +# This macro actually does too much. Some checks are only needed if # your package does certain things. But this isn't really a big deal. -# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003 -# 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., 59 Temple Place - Suite 330, Boston, MA -# 02111-1307, USA. - -# serial 11 +dnl Redefine AC_PROG_CC to automatically invoke _AM_PROG_CC_C_O. +m4_define([AC_PROG_CC], +m4_defn([AC_PROG_CC]) +[_AM_PROG_CC_C_O +]) # AM_INIT_AUTOMAKE(PACKAGE, VERSION, [NO-DEFINE]) # AM_INIT_AUTOMAKE([OPTIONS]) @@ -462,16 +435,20 @@ # arguments mandatory, and then we can depend on a new Autoconf # release and drop the old call support. AC_DEFUN([AM_INIT_AUTOMAKE], -[AC_PREREQ([2.58])dnl +[AC_PREREQ([2.65])dnl dnl Autoconf wants to disallow AM_ names. We explicitly allow dnl the ones we care about. m4_pattern_allow([^AM_[A-Z]+FLAGS$])dnl AC_REQUIRE([AM_SET_CURRENT_AUTOMAKE_VERSION])dnl AC_REQUIRE([AC_PROG_INSTALL])dnl -# test to see if srcdir already configured -if test "`cd $srcdir && pwd`" != "`pwd`" && - test -f $srcdir/config.status; then - AC_MSG_ERROR([source directory already configured; run "make distclean" there first]) +if test "`cd $srcdir && pwd`" != "`pwd`"; then + # Use -I$(srcdir) only when $(srcdir) != ., so that make's output + # is not polluted with repeated "-I." + AC_SUBST([am__isrc], [' -I$(srcdir)'])_AM_SUBST_NOTMAKE([am__isrc])dnl + # test to see if srcdir already configured + if test -f $srcdir/config.status; then + AC_MSG_ERROR([source directory already configured; run "make distclean" there first]) + fi fi # test whether we have cygpath @@ -487,47 +464,125 @@ # Define the identity of the package. dnl Distinguish between old-style and new-style calls. m4_ifval([$2], -[m4_ifval([$3], [_AM_SET_OPTION([no-define])])dnl +[AC_DIAGNOSE([obsolete], + [$0: two- and three-arguments forms are deprecated.]) +m4_ifval([$3], [_AM_SET_OPTION([no-define])])dnl AC_SUBST([PACKAGE], [$1])dnl AC_SUBST([VERSION], [$2])], [_AM_SET_OPTIONS([$1])dnl +dnl Diagnose old-style AC_INIT with new-style AM_AUTOMAKE_INIT. +m4_if( + m4_ifdef([AC_PACKAGE_NAME], [ok]):m4_ifdef([AC_PACKAGE_VERSION], [ok]), + [ok:ok],, + [m4_fatal([AC_INIT should be called with package and version arguments])])dnl AC_SUBST([PACKAGE], ['AC_PACKAGE_TARNAME'])dnl AC_SUBST([VERSION], ['AC_PACKAGE_VERSION'])])dnl _AM_IF_OPTION([no-define],, -[AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE", [Name of package]) - AC_DEFINE_UNQUOTED(VERSION, "$VERSION", [Version number of package])])dnl +[AC_DEFINE_UNQUOTED([PACKAGE], ["$PACKAGE"], [Name of package]) + AC_DEFINE_UNQUOTED([VERSION], ["$VERSION"], [Version number of package])])dnl # Some tools Automake needs. AC_REQUIRE([AM_SANITY_CHECK])dnl AC_REQUIRE([AC_ARG_PROGRAM])dnl -AM_MISSING_PROG(ACLOCAL, aclocal-${am__api_version}) -AM_MISSING_PROG(AUTOCONF, autoconf) -AM_MISSING_PROG(AUTOMAKE, automake-${am__api_version}) -AM_MISSING_PROG(AUTOHEADER, autoheader) -AM_MISSING_PROG(MAKEINFO, makeinfo) -AM_MISSING_PROG(AMTAR, tar) -AM_PROG_INSTALL_SH -AM_PROG_INSTALL_STRIP -AC_REQUIRE([AM_PROG_MKDIR_P])dnl -# We need awk for the "check" target. The system "awk" is bad on -# some platforms. +AM_MISSING_PROG([ACLOCAL], [aclocal-${am__api_version}]) +AM_MISSING_PROG([AUTOCONF], [autoconf]) +AM_MISSING_PROG([AUTOMAKE], [automake-${am__api_version}]) +AM_MISSING_PROG([AUTOHEADER], [autoheader]) +AM_MISSING_PROG([MAKEINFO], [makeinfo]) +AC_REQUIRE([AM_PROG_INSTALL_SH])dnl +AC_REQUIRE([AM_PROG_INSTALL_STRIP])dnl +AC_REQUIRE([AC_PROG_MKDIR_P])dnl +# For better backward compatibility. To be removed once Automake 1.9.x +# dies out for good. For more background, see: +# +# +AC_SUBST([mkdir_p], ['$(MKDIR_P)']) +# We need awk for the "check" target (and possibly the TAP driver). The +# system "awk" is bad on some platforms. AC_REQUIRE([AC_PROG_AWK])dnl AC_REQUIRE([AC_PROG_MAKE_SET])dnl AC_REQUIRE([AM_SET_LEADING_DOT])dnl - +_AM_IF_OPTION([tar-ustar], [_AM_PROG_TAR([ustar])], + [_AM_IF_OPTION([tar-pax], [_AM_PROG_TAR([pax])], + [_AM_PROG_TAR([v7])])]) _AM_IF_OPTION([no-dependencies],, [AC_PROVIDE_IFELSE([AC_PROG_CC], - [_AM_DEPENDENCIES(CC)], - [define([AC_PROG_CC], - defn([AC_PROG_CC])[_AM_DEPENDENCIES(CC)])])dnl + [_AM_DEPENDENCIES([CC])], + [m4_define([AC_PROG_CC], + m4_defn([AC_PROG_CC])[_AM_DEPENDENCIES([CC])])])dnl AC_PROVIDE_IFELSE([AC_PROG_CXX], - [_AM_DEPENDENCIES(CXX)], - [define([AC_PROG_CXX], - defn([AC_PROG_CXX])[_AM_DEPENDENCIES(CXX)])])dnl + [_AM_DEPENDENCIES([CXX])], + [m4_define([AC_PROG_CXX], + m4_defn([AC_PROG_CXX])[_AM_DEPENDENCIES([CXX])])])dnl +AC_PROVIDE_IFELSE([AC_PROG_OBJC], + [_AM_DEPENDENCIES([OBJC])], + [m4_define([AC_PROG_OBJC], + m4_defn([AC_PROG_OBJC])[_AM_DEPENDENCIES([OBJC])])])dnl +AC_PROVIDE_IFELSE([AC_PROG_OBJCXX], + [_AM_DEPENDENCIES([OBJCXX])], + [m4_define([AC_PROG_OBJCXX], + m4_defn([AC_PROG_OBJCXX])[_AM_DEPENDENCIES([OBJCXX])])])dnl ]) +AC_REQUIRE([AM_SILENT_RULES])dnl +dnl The testsuite driver may need to know about EXEEXT, so add the +dnl 'am__EXEEXT' conditional if _AM_COMPILER_EXEEXT was seen. This +dnl macro is hooked onto _AC_COMPILER_EXEEXT early, see below. +AC_CONFIG_COMMANDS_PRE(dnl +[m4_provide_if([_AM_COMPILER_EXEEXT], + [AM_CONDITIONAL([am__EXEEXT], [test -n "$EXEEXT"])])])dnl + +# POSIX will say in a future version that running "rm -f" with no argument +# is OK; and we want to be able to make that assumption in our Makefile +# recipes. So use an aggressive probe to check that the usage we want is +# actually supported "in the wild" to an acceptable degree. +# See automake bug#10828. +# To make any issue more visible, cause the running configure to be aborted +# by default if the 'rm' program in use doesn't match our expectations; the +# user can still override this though. +if rm -f && rm -fr && rm -rf; then : OK; else + cat >&2 <<'END' +Oops! + +Your 'rm' program seems unable to run without file operands specified +on the command line, even when the '-f' option is present. This is contrary +to the behaviour of most rm programs out there, and not conforming with +the upcoming POSIX standard: + +Please tell bug-automake@gnu.org about your system, including the value +of your $PATH and any error possibly output before this message. This +can help us improve future automake versions. + +END + if test x"$ACCEPT_INFERIOR_RM_PROGRAM" = x"yes"; then + echo 'Configuration will proceed anyway, since you have set the' >&2 + echo 'ACCEPT_INFERIOR_RM_PROGRAM variable to "yes"' >&2 + echo >&2 + else + cat >&2 <<'END' +Aborting the configuration process, to ensure you take notice of the issue. + +You can download and install GNU coreutils to get an 'rm' implementation +that behaves properly: . + +If you want to complete the configuration process using your problematic +'rm' anyway, export the environment variable ACCEPT_INFERIOR_RM_PROGRAM +to "yes", and re-run configure. + +END + AC_MSG_ERROR([Your 'rm' program is bad, sorry.]) + fi +fi +dnl The trailing newline in this macro's definition is deliberate, for +dnl backward compatibility and to allow trailing 'dnl'-style comments +dnl after the AM_INIT_AUTOMAKE invocation. See automake bug#16841. ]) +dnl Hook into '_AC_COMPILER_EXEEXT' early to learn its expansion. Do not +dnl add the conditional right here, as _AC_COMPILER_EXEEXT may be further +dnl mangled by Autoconf and run in a shell conditional statement. +m4_define([_AC_COMPILER_EXEEXT], +m4_defn([_AC_COMPILER_EXEEXT])[m4_provide([_AM_COMPILER_EXEEXT])]) # When config.status generates a header, we must update the stamp-h file. # This file resides in the same directory as the config header @@ -538,62 +593,44 @@ # our stamp files there. AC_DEFUN([_AC_AM_CONFIG_HEADER_HOOK], [# Compute $1's index in $config_headers. +_am_arg=$1 _am_stamp_count=1 for _am_header in $config_headers :; do case $_am_header in - $1 | $1:* ) + $_am_arg | $_am_arg:* ) break ;; * ) _am_stamp_count=`expr $_am_stamp_count + 1` ;; esac done -echo "timestamp for $1" >`AS_DIRNAME([$1])`/stamp-h[]$_am_stamp_count]) +echo "timestamp for $_am_arg" >`AS_DIRNAME(["$_am_arg"])`/stamp-h[]$_am_stamp_count]) + +# Copyright (C) 2001-2014 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. # AM_PROG_INSTALL_SH # ------------------ # Define $install_sh. - -# Copyright (C) 2001, 2003 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., 59 Temple Place - Suite 330, Boston, MA -# 02111-1307, USA. - AC_DEFUN([AM_PROG_INSTALL_SH], [AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl -install_sh=${install_sh-"$am_aux_dir/install-sh"} -AC_SUBST(install_sh)]) - -# -*- Autoconf -*- -# Copyright (C) 2003 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., 59 Temple Place - Suite 330, Boston, MA -# 02111-1307, USA. +if test x"${install_sh+set}" != xset; then + case $am_aux_dir in + *\ * | *\ *) + install_sh="\${SHELL} '$am_aux_dir/install-sh'" ;; + *) + install_sh="\${SHELL} $am_aux_dir/install-sh" + esac +fi +AC_SUBST([install_sh])]) -# serial 1 +# Copyright (C) 2003-2014 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. # Check whether the underlying file-system supports filenames # with a leading dot. For instance MS-DOS doesn't. @@ -608,66 +645,67 @@ rmdir .tst 2>/dev/null AC_SUBST([am__leading_dot])]) -# Add --enable-maintainer-mode option to configure. -# From Jim Meyering - -# Copyright (C) 1996, 1998, 2000, 2001, 2002, 2003, 2004 -# Free Software Foundation, Inc. +# Copyright (C) 1998-2014 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. -# 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. +# AM_PROG_LEX +# ----------- +# Autoconf leaves LEX=: if lex or flex can't be found. Change that to a +# "missing" invocation, for better error output. +AC_DEFUN([AM_PROG_LEX], +[AC_PREREQ([2.50])dnl +AC_REQUIRE([AM_MISSING_HAS_RUN])dnl +AC_REQUIRE([AC_PROG_LEX])dnl +if test "$LEX" = :; then + LEX=${am_missing_run}flex +fi]) -# 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., 59 Temple Place - Suite 330, Boston, MA -# 02111-1307, USA. +# Add --enable-maintainer-mode option to configure. -*- Autoconf -*- +# From Jim Meyering -# serial 3 +# Copyright (C) 1996-2014 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. +# AM_MAINTAINER_MODE([DEFAULT-MODE]) +# ---------------------------------- +# Control maintainer-specific portions of Makefiles. +# Default is to disable them, unless 'enable' is passed literally. +# For symmetry, 'disable' may be passed as well. Anyway, the user +# can override the default with the --enable/--disable switch. AC_DEFUN([AM_MAINTAINER_MODE], -[AC_MSG_CHECKING([whether to enable maintainer-specific portions of Makefiles]) - dnl maintainer-mode is disabled by default - AC_ARG_ENABLE(maintainer-mode, -[ --enable-maintainer-mode enable make rules and dependencies not useful - (and sometimes confusing) to the casual installer], - USE_MAINTAINER_MODE=$enableval, - USE_MAINTAINER_MODE=no) +[m4_case(m4_default([$1], [disable]), + [enable], [m4_define([am_maintainer_other], [disable])], + [disable], [m4_define([am_maintainer_other], [enable])], + [m4_define([am_maintainer_other], [enable]) + m4_warn([syntax], [unexpected argument to AM@&t@_MAINTAINER_MODE: $1])]) +AC_MSG_CHECKING([whether to enable maintainer-specific portions of Makefiles]) + dnl maintainer-mode's default is 'disable' unless 'enable' is passed + AC_ARG_ENABLE([maintainer-mode], + [AS_HELP_STRING([--]am_maintainer_other[-maintainer-mode], + am_maintainer_other[ make rules and dependencies not useful + (and sometimes confusing) to the casual installer])], + [USE_MAINTAINER_MODE=$enableval], + [USE_MAINTAINER_MODE=]m4_if(am_maintainer_other, [enable], [no], [yes])) AC_MSG_RESULT([$USE_MAINTAINER_MODE]) - AM_CONDITIONAL(MAINTAINER_MODE, [test $USE_MAINTAINER_MODE = yes]) + AM_CONDITIONAL([MAINTAINER_MODE], [test $USE_MAINTAINER_MODE = yes]) MAINT=$MAINTAINER_MODE_TRUE - AC_SUBST(MAINT)dnl + AC_SUBST([MAINT])dnl ] ) -AU_DEFUN([jm_MAINTAINER_MODE], [AM_MAINTAINER_MODE]) +# Check to see how 'make' treats includes. -*- Autoconf -*- -# Check to see how 'make' treats includes. -*- Autoconf -*- - -# Copyright (C) 2001, 2002, 2003 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., 59 Temple Place - Suite 330, Boston, MA -# 02111-1307, USA. - -# serial 2 +# Copyright (C) 2001-2014 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. # AM_MAKE_INCLUDE() # ----------------- @@ -676,7 +714,7 @@ [am_make=${MAKE-make} cat > confinc << 'END' am__doit: - @echo done + @echo this is the am__doit target .PHONY: am__doit END # If we don't find an include directive, just comment out the code. @@ -686,24 +724,24 @@ _am_result=none # First try GNU make style include. echo "include confinc" > confmf -# We grep out `Entering directory' and `Leaving directory' -# messages which can occur if `w' ends up in MAKEFLAGS. -# In particular we don't look at `^make:' because GNU make might -# be invoked under some other name (usually "gmake"), in which -# case it prints its new name instead of `make'. -if test "`$am_make -s -f confmf 2> /dev/null | grep -v 'ing directory'`" = "done"; then - am__include=include - am__quote= - _am_result=GNU -fi +# Ignore all kinds of additional output from 'make'. +case `$am_make -s -f confmf 2> /dev/null` in #( +*the\ am__doit\ target*) + am__include=include + am__quote= + _am_result=GNU + ;; +esac # Now try BSD make style include. if test "$am__include" = "#"; then echo '.include "confinc"' > confmf - if test "`$am_make -s -f confmf 2> /dev/null`" = "done"; then - am__include=.include - am__quote="\"" - _am_result=BSD - fi + case `$am_make -s -f confmf 2> /dev/null` in #( + *the\ am__doit\ target*) + am__include=.include + am__quote="\"" + _am_result=BSD + ;; + esac fi AC_SUBST([am__include]) AC_SUBST([am__quote]) @@ -711,27 +749,13 @@ rm -f confinc confmf ]) -# -*- Autoconf -*- - - -# Copyright (C) 1997, 1999, 2000, 2001, 2003 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. +# Fake the existence of programs that GNU maintainers use. -*- Autoconf -*- -# 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., 59 Temple Place - Suite 330, Boston, MA -# 02111-1307, USA. - -# serial 3 +# Copyright (C) 1997-2014 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. # AM_MISSING_PROG(NAME, PROGRAM) # ------------------------------ @@ -740,109 +764,66 @@ $1=${$1-"${am_missing_run}$2"} AC_SUBST($1)]) - # AM_MISSING_HAS_RUN # ------------------ -# Define MISSING if not defined so far and test if it supports --run. -# If it does, set am_missing_run to use it, otherwise, to nothing. +# Define MISSING if not defined so far and test if it is modern enough. +# If it is, set am_missing_run to use it, otherwise, to nothing. AC_DEFUN([AM_MISSING_HAS_RUN], [AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl -test x"${MISSING+set}" = xset || MISSING="\${SHELL} $am_aux_dir/missing" +AC_REQUIRE_AUX_FILE([missing])dnl +if test x"${MISSING+set}" != xset; then + case $am_aux_dir in + *\ * | *\ *) + MISSING="\${SHELL} \"$am_aux_dir/missing\"" ;; + *) + MISSING="\${SHELL} $am_aux_dir/missing" ;; + esac +fi # Use eval to expand $SHELL -if eval "$MISSING --run true"; then - am_missing_run="$MISSING --run " +if eval "$MISSING --is-lightweight"; then + am_missing_run="$MISSING " else am_missing_run= - AC_MSG_WARN([`missing' script is too old or missing]) + AC_MSG_WARN(['missing' script is too old or missing]) fi ]) -# AM_PROG_MKDIR_P -# --------------- -# Check whether `mkdir -p' is supported, fallback to mkinstalldirs otherwise. - -# Copyright (C) 2003, 2004 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., 59 Temple Place - Suite 330, Boston, MA -# 02111-1307, USA. - -# Automake 1.8 used `mkdir -m 0755 -p --' to ensure that directories -# created by `make install' are always world readable, even if the -# installer happens to have an overly restrictive umask (e.g. 077). -# This was a mistake. There are at least two reasons why we must not -# use `-m 0755': -# - it causes special bits like SGID to be ignored, -# - it may be too restrictive (some setups expect 775 directories). -# -# Do not use -m 0755 and let people choose whatever they expect by -# setting umask. -# -# We cannot accept any implementation of `mkdir' that recognizes `-p'. -# Some implementations (such as Solaris 8's) are not thread-safe: if a -# parallel make tries to run `mkdir -p a/b' and `mkdir -p a/c' -# concurrently, both version can detect that a/ is missing, but only -# one can create it and the other will error out. Consequently we -# restrict ourselves to GNU make (using the --version option ensures -# this.) -AC_DEFUN([AM_PROG_MKDIR_P], -[if mkdir -p --version . >/dev/null 2>&1 && test ! -d ./--version; then - # Keeping the `.' argument allows $(mkdir_p) to be used without - # argument. Indeed, we sometimes output rules like - # $(mkdir_p) $(somedir) - # where $(somedir) is conditionally defined. - # (`test -n '$(somedir)' && $(mkdir_p) $(somedir)' is a more - # expensive solution, as it forces Make to start a sub-shell.) - mkdir_p='mkdir -p -- .' -else - # On NextStep and OpenStep, the `mkdir' command does not - # recognize any option. It will interpret all options as - # directories to create, and then abort because `.' already - # exists. - for d in ./-p ./--version; - do - test -d $d && rmdir $d - done - # $(mkinstalldirs) is defined by Automake if mkinstalldirs exists. - if test -f "$ac_aux_dir/mkinstalldirs"; then - mkdir_p='$(mkinstalldirs)' - else - mkdir_p='$(install_sh) -d' - fi -fi -AC_SUBST([mkdir_p])]) - -# Helper functions for option handling. -*- Autoconf -*- - -# Copyright (C) 2001, 2002, 2003 Free Software Foundation, Inc. +# -*- Autoconf -*- +# Obsolete and "removed" macros, that must however still report explicit +# error messages when used, to smooth transition. +# +# Copyright (C) 1996-2014 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. -# 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. +AC_DEFUN([AM_CONFIG_HEADER], +[AC_DIAGNOSE([obsolete], +['$0': this macro is obsolete. +You should use the 'AC][_CONFIG_HEADERS' macro instead.])dnl +AC_CONFIG_HEADERS($@)]) + +AC_DEFUN([AM_PROG_CC_STDC], +[AC_PROG_CC +am_cv_prog_cc_stdc=$ac_cv_prog_cc_stdc +AC_DIAGNOSE([obsolete], +['$0': this macro is obsolete. +You should simply use the 'AC][_PROG_CC' macro instead. +Also, your code should no longer depend upon 'am_cv_prog_cc_stdc', +but upon 'ac_cv_prog_cc_stdc'.])]) + +AC_DEFUN([AM_C_PROTOTYPES], + [AC_FATAL([automatic de-ANSI-fication support has been removed])]) +AU_DEFUN([fp_C_PROTOTYPES], [AM_C_PROTOTYPES]) -# 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., 59 Temple Place - Suite 330, Boston, MA -# 02111-1307, USA. +# Helper functions for option handling. -*- Autoconf -*- -# serial 2 +# Copyright (C) 2001-2014 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. # _AM_MANGLE_OPTION(NAME) # ----------------------- @@ -850,16 +831,16 @@ [[_AM_OPTION_]m4_bpatsubst($1, [[^a-zA-Z0-9_]], [_])]) # _AM_SET_OPTION(NAME) -# ------------------------------ +# -------------------- # Set option NAME. Presently that only means defining a flag for this option. AC_DEFUN([_AM_SET_OPTION], -[m4_define(_AM_MANGLE_OPTION([$1]), 1)]) +[m4_define(_AM_MANGLE_OPTION([$1]), [1])]) # _AM_SET_OPTIONS(OPTIONS) -# ---------------------------------- +# ------------------------ # OPTIONS is a space-separated list of Automake options. AC_DEFUN([_AM_SET_OPTIONS], -[AC_FOREACH([_AM_Option], [$1], [_AM_SET_OPTION(_AM_Option)])]) +[m4_foreach_w([_AM_Option], [$1], [_AM_SET_OPTION(_AM_Option)])]) # _AM_IF_OPTION(OPTION, IF-SET, [IF-NOT-SET]) # ------------------------------------------- @@ -867,59 +848,126 @@ AC_DEFUN([_AM_IF_OPTION], [m4_ifset(_AM_MANGLE_OPTION([$1]), [$2], [$3])]) +# Copyright (C) 1999-2014 Free Software Foundation, Inc. # -# Check to make sure that the build environment is sane. -# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. -# Copyright (C) 1996, 1997, 2000, 2001, 2003 Free Software Foundation, Inc. +# _AM_PROG_CC_C_O +# --------------- +# Like AC_PROG_CC_C_O, but changed for automake. We rewrite AC_PROG_CC +# to automatically call this. +AC_DEFUN([_AM_PROG_CC_C_O], +[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl +AC_REQUIRE_AUX_FILE([compile])dnl +AC_LANG_PUSH([C])dnl +AC_CACHE_CHECK( + [whether $CC understands -c and -o together], + [am_cv_prog_cc_c_o], + [AC_LANG_CONFTEST([AC_LANG_PROGRAM([])]) + # Make sure it works both with $CC and with simple cc. + # Following AC_PROG_CC_C_O, we do the test twice because some + # compilers refuse to overwrite an existing .o file with -o, + # though they will create one. + am_cv_prog_cc_c_o=yes + for am_i in 1 2; do + if AM_RUN_LOG([$CC -c conftest.$ac_ext -o conftest2.$ac_objext]) \ + && test -f conftest2.$ac_objext; then + : OK + else + am_cv_prog_cc_c_o=no + break + fi + done + rm -f core conftest* + unset am_i]) +if test "$am_cv_prog_cc_c_o" != yes; then + # Losing compiler, so override with the script. + # FIXME: It is wrong to rewrite CC. + # But if we don't then we get into trouble of one sort or another. + # A longer-term fix would be to have automake use am__CC in this case, + # and then we could set am__CC="\$(top_srcdir)/compile \$(CC)" + CC="$am_aux_dir/compile $CC" +fi +AC_LANG_POP([C])]) -# 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. +# For backward compatibility. +AC_DEFUN_ONCE([AM_PROG_CC_C_O], [AC_REQUIRE([AC_PROG_CC])]) -# 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., 59 Temple Place - Suite 330, Boston, MA -# 02111-1307, USA. +# Copyright (C) 2001-2014 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. -# serial 3 +# AM_RUN_LOG(COMMAND) +# ------------------- +# Run COMMAND, save the exit status in ac_status, and log it. +# (This has been adapted from Autoconf's _AC_RUN_LOG macro.) +AC_DEFUN([AM_RUN_LOG], +[{ echo "$as_me:$LINENO: $1" >&AS_MESSAGE_LOG_FD + ($1) >&AS_MESSAGE_LOG_FD 2>&AS_MESSAGE_LOG_FD + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&AS_MESSAGE_LOG_FD + (exit $ac_status); }]) + +# Check to make sure that the build environment is sane. -*- Autoconf -*- + +# Copyright (C) 1996-2014 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. # AM_SANITY_CHECK # --------------- AC_DEFUN([AM_SANITY_CHECK], [AC_MSG_CHECKING([whether build environment is sane]) -# Just in case -sleep 1 -echo timestamp > conftest.file -# Do `set' in a subshell so we don't clobber the current shell's +# Reject unsafe characters in $srcdir or the absolute working directory +# name. Accept space and tab only in the latter. +am_lf=' +' +case `pwd` in + *[[\\\"\#\$\&\'\`$am_lf]]*) + AC_MSG_ERROR([unsafe absolute working directory name]);; +esac +case $srcdir in + *[[\\\"\#\$\&\'\`$am_lf\ \ ]]*) + AC_MSG_ERROR([unsafe srcdir value: '$srcdir']);; +esac + +# Do 'set' in a subshell so we don't clobber the current shell's # arguments. Must try -L first in case configure is actually a # symlink; some systems play weird games with the mod time of symlinks # (eg FreeBSD returns the mod time of the symlink's containing # directory). if ( - set X `ls -Lt $srcdir/configure conftest.file 2> /dev/null` - if test "$[*]" = "X"; then - # -L didn't work. - set X `ls -t $srcdir/configure conftest.file` - fi - rm -f conftest.file - if test "$[*]" != "X $srcdir/configure conftest.file" \ - && test "$[*]" != "X conftest.file $srcdir/configure"; then - - # If neither matched, then we have a broken ls. This can happen - # if, for instance, CONFIG_SHELL is bash and it inherits a - # broken ls alias from the environment. This has actually - # happened. Such a system could not be considered "sane". - AC_MSG_ERROR([ls -t appears to fail. Make sure there is not a broken -alias in your environment]) - fi - + am_has_slept=no + for am_try in 1 2; do + echo "timestamp, slept: $am_has_slept" > conftest.file + set X `ls -Lt "$srcdir/configure" conftest.file 2> /dev/null` + if test "$[*]" = "X"; then + # -L didn't work. + set X `ls -t "$srcdir/configure" conftest.file` + fi + if test "$[*]" != "X $srcdir/configure conftest.file" \ + && test "$[*]" != "X conftest.file $srcdir/configure"; then + + # If neither matched, then we have a broken ls. This can happen + # if, for instance, CONFIG_SHELL is bash and it inherits a + # broken ls alias from the environment. This has actually + # happened. Such a system could not be considered "sane". + AC_MSG_ERROR([ls -t appears to fail. Make sure there is not a broken + alias in your environment]) + fi + if test "$[2]" = conftest.file || test $am_try -eq 2; then + break + fi + # Just in case. + sleep 1 + am_has_slept=yes + done test "$[2]" = conftest.file ) then @@ -929,44 +977,259 @@ AC_MSG_ERROR([newly created file is older than distributed files! Check your system clock]) fi -AC_MSG_RESULT(yes)]) - -# AM_PROG_INSTALL_STRIP +AC_MSG_RESULT([yes]) +# If we didn't sleep, we still need to ensure time stamps of config.status and +# generated files are strictly newer. +am_sleep_pid= +if grep 'slept: no' conftest.file >/dev/null 2>&1; then + ( sleep 1 ) & + am_sleep_pid=$! +fi +AC_CONFIG_COMMANDS_PRE( + [AC_MSG_CHECKING([that generated files are newer than configure]) + if test -n "$am_sleep_pid"; then + # Hide warnings about reused PIDs. + wait $am_sleep_pid 2>/dev/null + fi + AC_MSG_RESULT([done])]) +rm -f conftest.file +]) -# Copyright (C) 2001, 2003 Free Software Foundation, Inc. +# Copyright (C) 2009-2014 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. -# 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. +# AM_SILENT_RULES([DEFAULT]) +# -------------------------- +# Enable less verbose build rules; with the default set to DEFAULT +# ("yes" being less verbose, "no" or empty being verbose). +AC_DEFUN([AM_SILENT_RULES], +[AC_ARG_ENABLE([silent-rules], [dnl +AS_HELP_STRING( + [--enable-silent-rules], + [less verbose build output (undo: "make V=1")]) +AS_HELP_STRING( + [--disable-silent-rules], + [verbose build output (undo: "make V=0")])dnl +]) +case $enable_silent_rules in @%:@ ((( + yes) AM_DEFAULT_VERBOSITY=0;; + no) AM_DEFAULT_VERBOSITY=1;; + *) AM_DEFAULT_VERBOSITY=m4_if([$1], [yes], [0], [1]);; +esac +dnl +dnl A few 'make' implementations (e.g., NonStop OS and NextStep) +dnl do not support nested variable expansions. +dnl See automake bug#9928 and bug#10237. +am_make=${MAKE-make} +AC_CACHE_CHECK([whether $am_make supports nested variables], + [am_cv_make_support_nested_variables], + [if AS_ECHO([['TRUE=$(BAR$(V)) +BAR0=false +BAR1=true +V=1 +am__doit: + @$(TRUE) +.PHONY: am__doit']]) | $am_make -f - >/dev/null 2>&1; then + am_cv_make_support_nested_variables=yes +else + am_cv_make_support_nested_variables=no +fi]) +if test $am_cv_make_support_nested_variables = yes; then + dnl Using '$V' instead of '$(V)' breaks IRIX make. + AM_V='$(V)' + AM_DEFAULT_V='$(AM_DEFAULT_VERBOSITY)' +else + AM_V=$AM_DEFAULT_VERBOSITY + AM_DEFAULT_V=$AM_DEFAULT_VERBOSITY +fi +AC_SUBST([AM_V])dnl +AM_SUBST_NOTMAKE([AM_V])dnl +AC_SUBST([AM_DEFAULT_V])dnl +AM_SUBST_NOTMAKE([AM_DEFAULT_V])dnl +AC_SUBST([AM_DEFAULT_VERBOSITY])dnl +AM_BACKSLASH='\' +AC_SUBST([AM_BACKSLASH])dnl +_AM_SUBST_NOTMAKE([AM_BACKSLASH])dnl +]) -# 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., 59 Temple Place - Suite 330, Boston, MA -# 02111-1307, USA. +# Copyright (C) 2001-2014 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. -# One issue with vendor `install' (even GNU) is that you can't +# AM_PROG_INSTALL_STRIP +# --------------------- +# One issue with vendor 'install' (even GNU) is that you can't # specify the program used to strip binaries. This is especially # annoying in cross-compiling environments, where the build's strip # is unlikely to handle the host's binaries. # Fortunately install-sh will honor a STRIPPROG variable, so we -# always use install-sh in `make install-strip', and initialize +# always use install-sh in "make install-strip", and initialize # STRIPPROG with the value of the STRIP variable (set by the user). AC_DEFUN([AM_PROG_INSTALL_STRIP], [AC_REQUIRE([AM_PROG_INSTALL_SH])dnl -# Installed binaries are usually stripped using `strip' when the user -# run `make install-strip'. However `strip' might not be the right +# Installed binaries are usually stripped using 'strip' when the user +# run "make install-strip". However 'strip' might not be the right # tool to use in cross-compilation environments, therefore Automake -# will honor the `STRIP' environment variable to overrule this program. -dnl Don't test for $cross_compiling = yes, because it might be `maybe'. +# will honor the 'STRIP' environment variable to overrule this program. +dnl Don't test for $cross_compiling = yes, because it might be 'maybe'. if test "$cross_compiling" != no; then AC_CHECK_TOOL([STRIP], [strip], :) fi -INSTALL_STRIP_PROGRAM="\${SHELL} \$(install_sh) -c -s" +INSTALL_STRIP_PROGRAM="\$(install_sh) -c -s" AC_SUBST([INSTALL_STRIP_PROGRAM])]) +# Copyright (C) 2006-2014 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# _AM_SUBST_NOTMAKE(VARIABLE) +# --------------------------- +# Prevent Automake from outputting VARIABLE = @VARIABLE@ in Makefile.in. +# This macro is traced by Automake. +AC_DEFUN([_AM_SUBST_NOTMAKE]) + +# AM_SUBST_NOTMAKE(VARIABLE) +# -------------------------- +# Public sister of _AM_SUBST_NOTMAKE. +AC_DEFUN([AM_SUBST_NOTMAKE], [_AM_SUBST_NOTMAKE($@)]) + +# Check how to create a tarball. -*- Autoconf -*- + +# Copyright (C) 2004-2014 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# _AM_PROG_TAR(FORMAT) +# -------------------- +# Check how to create a tarball in format FORMAT. +# FORMAT should be one of 'v7', 'ustar', or 'pax'. +# +# Substitute a variable $(am__tar) that is a command +# writing to stdout a FORMAT-tarball containing the directory +# $tardir. +# tardir=directory && $(am__tar) > result.tar +# +# Substitute a variable $(am__untar) that extract such +# a tarball read from stdin. +# $(am__untar) < result.tar +# +AC_DEFUN([_AM_PROG_TAR], +[# Always define AMTAR for backward compatibility. Yes, it's still used +# in the wild :-( We should find a proper way to deprecate it ... +AC_SUBST([AMTAR], ['$${TAR-tar}']) + +# We'll loop over all known methods to create a tar archive until one works. +_am_tools='gnutar m4_if([$1], [ustar], [plaintar]) pax cpio none' + +m4_if([$1], [v7], + [am__tar='$${TAR-tar} chof - "$$tardir"' am__untar='$${TAR-tar} xf -'], + + [m4_case([$1], + [ustar], + [# The POSIX 1988 'ustar' format is defined with fixed-size fields. + # There is notably a 21 bits limit for the UID and the GID. In fact, + # the 'pax' utility can hang on bigger UID/GID (see automake bug#8343 + # and bug#13588). + am_max_uid=2097151 # 2^21 - 1 + am_max_gid=$am_max_uid + # The $UID and $GID variables are not portable, so we need to resort + # to the POSIX-mandated id(1) utility. Errors in the 'id' calls + # below are definitely unexpected, so allow the users to see them + # (that is, avoid stderr redirection). + am_uid=`id -u || echo unknown` + am_gid=`id -g || echo unknown` + AC_MSG_CHECKING([whether UID '$am_uid' is supported by ustar format]) + if test $am_uid -le $am_max_uid; then + AC_MSG_RESULT([yes]) + else + AC_MSG_RESULT([no]) + _am_tools=none + fi + AC_MSG_CHECKING([whether GID '$am_gid' is supported by ustar format]) + if test $am_gid -le $am_max_gid; then + AC_MSG_RESULT([yes]) + else + AC_MSG_RESULT([no]) + _am_tools=none + fi], + + [pax], + [], + + [m4_fatal([Unknown tar format])]) + + AC_MSG_CHECKING([how to create a $1 tar archive]) + + # Go ahead even if we have the value already cached. We do so because we + # need to set the values for the 'am__tar' and 'am__untar' variables. + _am_tools=${am_cv_prog_tar_$1-$_am_tools} + + for _am_tool in $_am_tools; do + case $_am_tool in + gnutar) + for _am_tar in tar gnutar gtar; do + AM_RUN_LOG([$_am_tar --version]) && break + done + am__tar="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$$tardir"' + am__tar_="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$tardir"' + am__untar="$_am_tar -xf -" + ;; + plaintar) + # Must skip GNU tar: if it does not support --format= it doesn't create + # ustar tarball either. + (tar --version) >/dev/null 2>&1 && continue + am__tar='tar chf - "$$tardir"' + am__tar_='tar chf - "$tardir"' + am__untar='tar xf -' + ;; + pax) + am__tar='pax -L -x $1 -w "$$tardir"' + am__tar_='pax -L -x $1 -w "$tardir"' + am__untar='pax -r' + ;; + cpio) + am__tar='find "$$tardir" -print | cpio -o -H $1 -L' + am__tar_='find "$tardir" -print | cpio -o -H $1 -L' + am__untar='cpio -i -H $1 -d' + ;; + none) + am__tar=false + am__tar_=false + am__untar=false + ;; + esac + + # If the value was cached, stop now. We just wanted to have am__tar + # and am__untar set. + test -n "${am_cv_prog_tar_$1}" && break + + # tar/untar a dummy directory, and stop if the command works. + rm -rf conftest.dir + mkdir conftest.dir + echo GrepMe > conftest.dir/file + AM_RUN_LOG([tardir=conftest.dir && eval $am__tar_ >conftest.tar]) + rm -rf conftest.dir + if test -s conftest.tar; then + AM_RUN_LOG([$am__untar /dev/null 2>&1 && break + fi + done + rm -rf conftest.dir + + AC_CACHE_VAL([am_cv_prog_tar_$1], [am_cv_prog_tar_$1=$_am_tool]) + AC_MSG_RESULT([$am_cv_prog_tar_$1])]) + +AC_SUBST([am__tar]) +AC_SUBST([am__untar]) +]) # _AM_PROG_TAR + diff -Nru filtergen-0.12.4/ast.h filtergen-0.12.7/ast.h --- filtergen-0.12.4/ast.h 2004-05-15 03:26:42.000000000 +0000 +++ filtergen-0.12.7/ast.h 2016-02-13 10:52:59.000000000 +0000 @@ -23,131 +23,131 @@ struct specifier_list_s; struct subrule_list_s { - struct subrule_list_s * subrule_list; - struct specifier_list_s * specifier_list; + struct subrule_list_s *subrule_list; + struct specifier_list_s *specifier_list; }; struct chaingroup_specifier_s { - char * name; - struct subrule_list_s * list; + char *name; + struct subrule_list_s *list; }; struct compound_specifier_s { - struct subrule_list_s * list; + struct subrule_list_s *list; }; struct option_specifier_s { - int type; - char * logmsg; + int type; + char *logmsg; }; struct icmptype_argument_s { - char * icmptype; + char *icmptype; }; struct icmptype_argument_list_s { - struct icmptype_argument_list_s * list; - struct icmptype_argument_s * arg; + struct icmptype_argument_list_s *list; + struct icmptype_argument_s *arg; }; struct icmptype_specifier_s { - struct icmptype_argument_list_s * list; + struct icmptype_argument_list_s *list; }; struct protocol_argument_s { - char * proto; + char *proto; }; struct protocol_argument_list_s { - struct protocol_argument_list_s * list; - struct protocol_argument_s * arg; + struct protocol_argument_list_s *list; + struct protocol_argument_s *arg; }; struct protocol_specifier_s { - struct protocol_argument_list_s * list; + struct protocol_argument_list_s *list; }; struct port_argument_s { - char * port_min; - char * port_max; + char *port_min; + char *port_max; }; struct port_argument_list_s { - struct port_argument_list_s * list; - struct port_argument_s * arg; + struct port_argument_list_s *list; + struct port_argument_s *arg; }; struct port_specifier_s { - int type; - struct port_argument_list_s * list; + int type; + struct port_argument_list_s *list; }; struct host_argument_s { - char * host; - char * mask; + char *host; + char *mask; }; struct host_argument_list_s { - struct host_argument_list_s * list; - struct host_argument_s * arg; + struct host_argument_list_s *list; + struct host_argument_s *arg; }; struct host_specifier_s { - int type; - struct host_argument_list_s * list; + int type; + struct host_argument_list_s *list; }; struct target_specifier_s { - int type; + int type; }; struct direction_argument_s { - char * direction; + char *direction; }; struct direction_argument_list_s { - struct direction_argument_list_s * list; - struct direction_argument_s * arg; + struct direction_argument_list_s *list; + struct direction_argument_s *arg; }; struct direction_specifier_s { - int type; - struct direction_argument_list_s * list; + int type; + struct direction_argument_list_s *list; }; struct specifier_s { - struct compound_specifier_s * compound; - struct direction_specifier_s * direction; - struct target_specifier_s * target; - struct host_specifier_s * host; - struct port_specifier_s * port; - struct protocol_specifier_s * protocol; - struct icmptype_specifier_s * icmptype; - struct option_specifier_s * option; - struct chaingroup_specifier_s * chaingroup; + struct compound_specifier_s *compound; + struct direction_specifier_s *direction; + struct target_specifier_s *target; + struct host_specifier_s *host; + struct port_specifier_s *port; + struct protocol_specifier_s *protocol; + struct icmptype_specifier_s *icmptype; + struct option_specifier_s *option; + struct chaingroup_specifier_s *chaingroup; }; struct negated_specifier_s { - int negated; - struct specifier_s * spec; + int negated; + struct specifier_s *spec; }; struct specifier_list_s { - struct specifier_list_s * list; - struct negated_specifier_s * spec; + struct specifier_list_s *list; + struct negated_specifier_s *spec; }; struct rule_s { - struct specifier_list_s * list; + struct specifier_list_s *list; }; struct rule_list_s { - struct rule_list_s * list; - struct rule_s * rule; + struct rule_list_s *list; + struct rule_s *rule; }; struct ast_s { - struct rule_list_s * list; + struct rule_list_s *list; }; #endif /* __AST_H__ */ diff -Nru filtergen-0.12.4/compile filtergen-0.12.7/compile --- filtergen-0.12.4/compile 1970-01-01 00:00:00.000000000 +0000 +++ filtergen-0.12.7/compile 2016-02-13 08:06:27.000000000 +0000 @@ -0,0 +1,347 @@ +#! /bin/sh +# Wrapper for compilers which do not understand '-c -o'. + +scriptversion=2012-10-14.11; # UTC + +# Copyright (C) 1999-2014 Free Software Foundation, Inc. +# Written by Tom Tromey . +# +# 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, see . + +# As a special exception to the GNU General Public License, if you +# distribute this file as part of a program that contains a +# configuration script generated by Autoconf, you may include it under +# the same distribution terms that you use for the rest of that program. + +# This file is maintained in Automake, please report +# bugs to or send patches to +# . + +nl=' +' + +# We need space, tab and new line, in precisely that order. Quoting is +# there to prevent tools from complaining about whitespace usage. +IFS=" "" $nl" + +file_conv= + +# func_file_conv build_file lazy +# Convert a $build file to $host form and store it in $file +# Currently only supports Windows hosts. If the determined conversion +# type is listed in (the comma separated) LAZY, no conversion will +# take place. +func_file_conv () +{ + file=$1 + case $file in + / | /[!/]*) # absolute file, and not a UNC file + if test -z "$file_conv"; then + # lazily determine how to convert abs files + case `uname -s` in + MINGW*) + file_conv=mingw + ;; + CYGWIN*) + file_conv=cygwin + ;; + *) + file_conv=wine + ;; + esac + fi + case $file_conv/,$2, in + *,$file_conv,*) + ;; + mingw/*) + file=`cmd //C echo "$file " | sed -e 's/"\(.*\) " *$/\1/'` + ;; + cygwin/*) + file=`cygpath -m "$file" || echo "$file"` + ;; + wine/*) + file=`winepath -w "$file" || echo "$file"` + ;; + esac + ;; + esac +} + +# func_cl_dashL linkdir +# Make cl look for libraries in LINKDIR +func_cl_dashL () +{ + func_file_conv "$1" + if test -z "$lib_path"; then + lib_path=$file + else + lib_path="$lib_path;$file" + fi + linker_opts="$linker_opts -LIBPATH:$file" +} + +# func_cl_dashl library +# Do a library search-path lookup for cl +func_cl_dashl () +{ + lib=$1 + found=no + save_IFS=$IFS + IFS=';' + for dir in $lib_path $LIB + do + IFS=$save_IFS + if $shared && test -f "$dir/$lib.dll.lib"; then + found=yes + lib=$dir/$lib.dll.lib + break + fi + if test -f "$dir/$lib.lib"; then + found=yes + lib=$dir/$lib.lib + break + fi + if test -f "$dir/lib$lib.a"; then + found=yes + lib=$dir/lib$lib.a + break + fi + done + IFS=$save_IFS + + if test "$found" != yes; then + lib=$lib.lib + fi +} + +# func_cl_wrapper cl arg... +# Adjust compile command to suit cl +func_cl_wrapper () +{ + # Assume a capable shell + lib_path= + shared=: + linker_opts= + for arg + do + if test -n "$eat"; then + eat= + else + case $1 in + -o) + # configure might choose to run compile as 'compile cc -o foo foo.c'. + eat=1 + case $2 in + *.o | *.[oO][bB][jJ]) + func_file_conv "$2" + set x "$@" -Fo"$file" + shift + ;; + *) + func_file_conv "$2" + set x "$@" -Fe"$file" + shift + ;; + esac + ;; + -I) + eat=1 + func_file_conv "$2" mingw + set x "$@" -I"$file" + shift + ;; + -I*) + func_file_conv "${1#-I}" mingw + set x "$@" -I"$file" + shift + ;; + -l) + eat=1 + func_cl_dashl "$2" + set x "$@" "$lib" + shift + ;; + -l*) + func_cl_dashl "${1#-l}" + set x "$@" "$lib" + shift + ;; + -L) + eat=1 + func_cl_dashL "$2" + ;; + -L*) + func_cl_dashL "${1#-L}" + ;; + -static) + shared=false + ;; + -Wl,*) + arg=${1#-Wl,} + save_ifs="$IFS"; IFS=',' + for flag in $arg; do + IFS="$save_ifs" + linker_opts="$linker_opts $flag" + done + IFS="$save_ifs" + ;; + -Xlinker) + eat=1 + linker_opts="$linker_opts $2" + ;; + -*) + set x "$@" "$1" + shift + ;; + *.cc | *.CC | *.cxx | *.CXX | *.[cC]++) + func_file_conv "$1" + set x "$@" -Tp"$file" + shift + ;; + *.c | *.cpp | *.CPP | *.lib | *.LIB | *.Lib | *.OBJ | *.obj | *.[oO]) + func_file_conv "$1" mingw + set x "$@" "$file" + shift + ;; + *) + set x "$@" "$1" + shift + ;; + esac + fi + shift + done + if test -n "$linker_opts"; then + linker_opts="-link$linker_opts" + fi + exec "$@" $linker_opts + exit 1 +} + +eat= + +case $1 in + '') + echo "$0: No command. Try '$0 --help' for more information." 1>&2 + exit 1; + ;; + -h | --h*) + cat <<\EOF +Usage: compile [--help] [--version] PROGRAM [ARGS] + +Wrapper for compilers which do not understand '-c -o'. +Remove '-o dest.o' from ARGS, run PROGRAM with the remaining +arguments, and rename the output as expected. + +If you are trying to build a whole package this is not the +right script to run: please start by reading the file 'INSTALL'. + +Report bugs to . +EOF + exit $? + ;; + -v | --v*) + echo "compile $scriptversion" + exit $? + ;; + cl | *[/\\]cl | cl.exe | *[/\\]cl.exe ) + func_cl_wrapper "$@" # Doesn't return... + ;; +esac + +ofile= +cfile= + +for arg +do + if test -n "$eat"; then + eat= + else + case $1 in + -o) + # configure might choose to run compile as 'compile cc -o foo foo.c'. + # So we strip '-o arg' only if arg is an object. + eat=1 + case $2 in + *.o | *.obj) + ofile=$2 + ;; + *) + set x "$@" -o "$2" + shift + ;; + esac + ;; + *.c) + cfile=$1 + set x "$@" "$1" + shift + ;; + *) + set x "$@" "$1" + shift + ;; + esac + fi + shift +done + +if test -z "$ofile" || test -z "$cfile"; then + # If no '-o' option was seen then we might have been invoked from a + # pattern rule where we don't need one. That is ok -- this is a + # normal compilation that the losing compiler can handle. If no + # '.c' file was seen then we are probably linking. That is also + # ok. + exec "$@" +fi + +# Name of file we expect compiler to create. +cofile=`echo "$cfile" | sed 's|^.*[\\/]||; s|^[a-zA-Z]:||; s/\.c$/.o/'` + +# Create the lock directory. +# Note: use '[/\\:.-]' here to ensure that we don't use the same name +# that we are using for the .o file. Also, base the name on the expected +# object file name, since that is what matters with a parallel build. +lockdir=`echo "$cofile" | sed -e 's|[/\\:.-]|_|g'`.d +while true; do + if mkdir "$lockdir" >/dev/null 2>&1; then + break + fi + sleep 1 +done +# FIXME: race condition here if user kills between mkdir and trap. +trap "rmdir '$lockdir'; exit 1" 1 2 15 + +# Run the compile. +"$@" +ret=$? + +if test -f "$cofile"; then + test "$cofile" = "$ofile" || mv "$cofile" "$ofile" +elif test -f "${cofile}bj"; then + test "${cofile}bj" = "$ofile" || mv "${cofile}bj" "$ofile" +fi + +rmdir "$lockdir" +exit $ret + +# Local Variables: +# mode: shell-script +# sh-indentation: 2 +# eval: (add-hook 'write-file-hooks 'time-stamp) +# time-stamp-start: "scriptversion=" +# time-stamp-format: "%:y-%02m-%02d.%02H" +# time-stamp-time-zone: "UTC" +# time-stamp-end: "; # UTC" +# End: diff -Nru filtergen-0.12.4/config.guess filtergen-0.12.7/config.guess --- filtergen-0.12.4/config.guess 1970-01-01 00:00:00.000000000 +0000 +++ filtergen-0.12.7/config.guess 2016-02-12 17:12:57.000000000 +0000 @@ -0,0 +1,1441 @@ +#! /bin/sh +# Attempt to guess a canonical system name. +# Copyright 1992-2015 Free Software Foundation, Inc. + +timestamp='2015-08-20' + +# This file 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 3 of the License, 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, see . +# +# As a special exception to the GNU General Public License, if you +# distribute this file as part of a program that contains a +# configuration script generated by Autoconf, you may include it under +# the same distribution terms that you use for the rest of that +# program. This Exception is an additional permission under section 7 +# of the GNU General Public License, version 3 ("GPLv3"). +# +# Originally written by Per Bothner; maintained since 2000 by Ben Elliston. +# +# You can get the latest version of this script from: +# http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.guess;hb=HEAD +# +# Please send patches to . + + +me=`echo "$0" | sed -e 's,.*/,,'` + +usage="\ +Usage: $0 [OPTION] + +Output the configuration name of the system \`$me' is run on. + +Operation modes: + -h, --help print this help, then exit + -t, --time-stamp print date of last modification, then exit + -v, --version print version number, then exit + +Report bugs and patches to ." + +version="\ +GNU config.guess ($timestamp) + +Originally written by Per Bothner. +Copyright 1992-2015 Free Software Foundation, Inc. + +This is free software; see the source for copying conditions. There is NO +warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE." + +help=" +Try \`$me --help' for more information." + +# Parse command line +while test $# -gt 0 ; do + case $1 in + --time-stamp | --time* | -t ) + echo "$timestamp" ; exit ;; + --version | -v ) + echo "$version" ; exit ;; + --help | --h* | -h ) + echo "$usage"; exit ;; + -- ) # Stop option processing + shift; break ;; + - ) # Use stdin as input. + break ;; + -* ) + echo "$me: invalid option $1$help" >&2 + exit 1 ;; + * ) + break ;; + esac +done + +if test $# != 0; then + echo "$me: too many arguments$help" >&2 + exit 1 +fi + +trap 'exit 1' 1 2 15 + +# CC_FOR_BUILD -- compiler used by this script. Note that the use of a +# compiler to aid in system detection is discouraged as it requires +# temporary files to be created and, as you can see below, it is a +# headache to deal with in a portable fashion. + +# Historically, `CC_FOR_BUILD' used to be named `HOST_CC'. We still +# use `HOST_CC' if defined, but it is deprecated. + +# Portable tmp directory creation inspired by the Autoconf team. + +set_cc_for_build=' +trap "exitcode=\$?; (rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null) && exit \$exitcode" 0 ; +trap "rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null; exit 1" 1 2 13 15 ; +: ${TMPDIR=/tmp} ; + { tmp=`(umask 077 && mktemp -d "$TMPDIR/cgXXXXXX") 2>/dev/null` && test -n "$tmp" && test -d "$tmp" ; } || + { test -n "$RANDOM" && tmp=$TMPDIR/cg$$-$RANDOM && (umask 077 && mkdir $tmp) ; } || + { tmp=$TMPDIR/cg-$$ && (umask 077 && mkdir $tmp) && echo "Warning: creating insecure temp directory" >&2 ; } || + { echo "$me: cannot create a temporary directory in $TMPDIR" >&2 ; exit 1 ; } ; +dummy=$tmp/dummy ; +tmpfiles="$dummy.c $dummy.o $dummy.rel $dummy" ; +case $CC_FOR_BUILD,$HOST_CC,$CC in + ,,) echo "int x;" > $dummy.c ; + for c in cc gcc c89 c99 ; do + if ($c -c -o $dummy.o $dummy.c) >/dev/null 2>&1 ; then + CC_FOR_BUILD="$c"; break ; + fi ; + done ; + if test x"$CC_FOR_BUILD" = x ; then + CC_FOR_BUILD=no_compiler_found ; + fi + ;; + ,,*) CC_FOR_BUILD=$CC ;; + ,*,*) CC_FOR_BUILD=$HOST_CC ;; +esac ; set_cc_for_build= ;' + +# This is needed to find uname on a Pyramid OSx when run in the BSD universe. +# (ghazi@noc.rutgers.edu 1994-08-24) +if (test -f /.attbin/uname) >/dev/null 2>&1 ; then + PATH=$PATH:/.attbin ; export PATH +fi + +UNAME_MACHINE=`(uname -m) 2>/dev/null` || UNAME_MACHINE=unknown +UNAME_RELEASE=`(uname -r) 2>/dev/null` || UNAME_RELEASE=unknown +UNAME_SYSTEM=`(uname -s) 2>/dev/null` || UNAME_SYSTEM=unknown +UNAME_VERSION=`(uname -v) 2>/dev/null` || UNAME_VERSION=unknown + +case "${UNAME_SYSTEM}" in +Linux|GNU|GNU/*) + # If the system lacks a compiler, then just pick glibc. + # We could probably try harder. + LIBC=gnu + + eval $set_cc_for_build + cat <<-EOF > $dummy.c + #include + #if defined(__UCLIBC__) + LIBC=uclibc + #elif defined(__dietlibc__) + LIBC=dietlibc + #else + LIBC=gnu + #endif + EOF + eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep '^LIBC' | sed 's, ,,g'` + ;; +esac + +# Note: order is significant - the case branches are not exclusive. + +case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in + *:NetBSD:*:*) + # NetBSD (nbsd) targets should (where applicable) match one or + # more of the tuples: *-*-netbsdelf*, *-*-netbsdaout*, + # *-*-netbsdecoff* and *-*-netbsd*. For targets that recently + # switched to ELF, *-*-netbsd* would select the old + # object file format. This provides both forward + # compatibility and a consistent mechanism for selecting the + # object file format. + # + # Note: NetBSD doesn't particularly care about the vendor + # portion of the name. We always set it to "unknown". + sysctl="sysctl -n hw.machine_arch" + UNAME_MACHINE_ARCH=`(uname -p 2>/dev/null || \ + /sbin/$sysctl 2>/dev/null || \ + /usr/sbin/$sysctl 2>/dev/null || \ + echo unknown)` + case "${UNAME_MACHINE_ARCH}" in + armeb) machine=armeb-unknown ;; + arm*) machine=arm-unknown ;; + sh3el) machine=shl-unknown ;; + sh3eb) machine=sh-unknown ;; + sh5el) machine=sh5le-unknown ;; + earmv*) + arch=`echo ${UNAME_MACHINE_ARCH} | sed -e 's,^e\(armv[0-9]\).*$,\1,'` + endian=`echo ${UNAME_MACHINE_ARCH} | sed -ne 's,^.*\(eb\)$,\1,p'` + machine=${arch}${endian}-unknown + ;; + *) machine=${UNAME_MACHINE_ARCH}-unknown ;; + esac + # The Operating System including object format, if it has switched + # to ELF recently, or will in the future. + case "${UNAME_MACHINE_ARCH}" in + arm*|earm*|i386|m68k|ns32k|sh3*|sparc|vax) + eval $set_cc_for_build + if echo __ELF__ | $CC_FOR_BUILD -E - 2>/dev/null \ + | grep -q __ELF__ + then + # Once all utilities can be ECOFF (netbsdecoff) or a.out (netbsdaout). + # Return netbsd for either. FIX? + os=netbsd + else + os=netbsdelf + fi + ;; + *) + os=netbsd + ;; + esac + # Determine ABI tags. + case "${UNAME_MACHINE_ARCH}" in + earm*) + expr='s/^earmv[0-9]/-eabi/;s/eb$//' + abi=`echo ${UNAME_MACHINE_ARCH} | sed -e "$expr"` + ;; + esac + # The OS release + # Debian GNU/NetBSD machines have a different userland, and + # thus, need a distinct triplet. However, they do not need + # kernel version information, so it can be replaced with a + # suitable tag, in the style of linux-gnu. + case "${UNAME_VERSION}" in + Debian*) + release='-gnu' + ;; + *) + release=`echo ${UNAME_RELEASE} | sed -e 's/[-_].*//' | cut -d. -f1,2` + ;; + esac + # Since CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM: + # contains redundant information, the shorter form: + # CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM is used. + echo "${machine}-${os}${release}${abi}" + exit ;; + *:Bitrig:*:*) + UNAME_MACHINE_ARCH=`arch | sed 's/Bitrig.//'` + echo ${UNAME_MACHINE_ARCH}-unknown-bitrig${UNAME_RELEASE} + exit ;; + *:OpenBSD:*:*) + UNAME_MACHINE_ARCH=`arch | sed 's/OpenBSD.//'` + echo ${UNAME_MACHINE_ARCH}-unknown-openbsd${UNAME_RELEASE} + exit ;; + *:ekkoBSD:*:*) + echo ${UNAME_MACHINE}-unknown-ekkobsd${UNAME_RELEASE} + exit ;; + *:SolidBSD:*:*) + echo ${UNAME_MACHINE}-unknown-solidbsd${UNAME_RELEASE} + exit ;; + macppc:MirBSD:*:*) + echo powerpc-unknown-mirbsd${UNAME_RELEASE} + exit ;; + *:MirBSD:*:*) + echo ${UNAME_MACHINE}-unknown-mirbsd${UNAME_RELEASE} + exit ;; + *:Sortix:*:*) + echo ${UNAME_MACHINE}-unknown-sortix + exit ;; + alpha:OSF1:*:*) + case $UNAME_RELEASE in + *4.0) + UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $3}'` + ;; + *5.*) + UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $4}'` + ;; + esac + # According to Compaq, /usr/sbin/psrinfo has been available on + # OSF/1 and Tru64 systems produced since 1995. I hope that + # covers most systems running today. This code pipes the CPU + # types through head -n 1, so we only detect the type of CPU 0. + ALPHA_CPU_TYPE=`/usr/sbin/psrinfo -v | sed -n -e 's/^ The alpha \(.*\) processor.*$/\1/p' | head -n 1` + case "$ALPHA_CPU_TYPE" in + "EV4 (21064)") + UNAME_MACHINE="alpha" ;; + "EV4.5 (21064)") + UNAME_MACHINE="alpha" ;; + "LCA4 (21066/21068)") + UNAME_MACHINE="alpha" ;; + "EV5 (21164)") + UNAME_MACHINE="alphaev5" ;; + "EV5.6 (21164A)") + UNAME_MACHINE="alphaev56" ;; + "EV5.6 (21164PC)") + UNAME_MACHINE="alphapca56" ;; + "EV5.7 (21164PC)") + UNAME_MACHINE="alphapca57" ;; + "EV6 (21264)") + UNAME_MACHINE="alphaev6" ;; + "EV6.7 (21264A)") + UNAME_MACHINE="alphaev67" ;; + "EV6.8CB (21264C)") + UNAME_MACHINE="alphaev68" ;; + "EV6.8AL (21264B)") + UNAME_MACHINE="alphaev68" ;; + "EV6.8CX (21264D)") + UNAME_MACHINE="alphaev68" ;; + "EV6.9A (21264/EV69A)") + UNAME_MACHINE="alphaev69" ;; + "EV7 (21364)") + UNAME_MACHINE="alphaev7" ;; + "EV7.9 (21364A)") + UNAME_MACHINE="alphaev79" ;; + esac + # A Pn.n version is a patched version. + # A Vn.n version is a released version. + # A Tn.n version is a released field test version. + # A Xn.n version is an unreleased experimental baselevel. + # 1.2 uses "1.2" for uname -r. + echo ${UNAME_MACHINE}-dec-osf`echo ${UNAME_RELEASE} | sed -e 's/^[PVTX]//' | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` + # Reset EXIT trap before exiting to avoid spurious non-zero exit code. + exitcode=$? + trap '' 0 + exit $exitcode ;; + Alpha\ *:Windows_NT*:*) + # How do we know it's Interix rather than the generic POSIX subsystem? + # Should we change UNAME_MACHINE based on the output of uname instead + # of the specific Alpha model? + echo alpha-pc-interix + exit ;; + 21064:Windows_NT:50:3) + echo alpha-dec-winnt3.5 + exit ;; + Amiga*:UNIX_System_V:4.0:*) + echo m68k-unknown-sysv4 + exit ;; + *:[Aa]miga[Oo][Ss]:*:*) + echo ${UNAME_MACHINE}-unknown-amigaos + exit ;; + *:[Mm]orph[Oo][Ss]:*:*) + echo ${UNAME_MACHINE}-unknown-morphos + exit ;; + *:OS/390:*:*) + echo i370-ibm-openedition + exit ;; + *:z/VM:*:*) + echo s390-ibm-zvmoe + exit ;; + *:OS400:*:*) + echo powerpc-ibm-os400 + exit ;; + arm:RISC*:1.[012]*:*|arm:riscix:1.[012]*:*) + echo arm-acorn-riscix${UNAME_RELEASE} + exit ;; + arm*:riscos:*:*|arm*:RISCOS:*:*) + echo arm-unknown-riscos + exit ;; + SR2?01:HI-UX/MPP:*:* | SR8000:HI-UX/MPP:*:*) + echo hppa1.1-hitachi-hiuxmpp + exit ;; + Pyramid*:OSx*:*:* | MIS*:OSx*:*:* | MIS*:SMP_DC-OSx*:*:*) + # akee@wpdis03.wpafb.af.mil (Earle F. Ake) contributed MIS and NILE. + if test "`(/bin/universe) 2>/dev/null`" = att ; then + echo pyramid-pyramid-sysv3 + else + echo pyramid-pyramid-bsd + fi + exit ;; + NILE*:*:*:dcosx) + echo pyramid-pyramid-svr4 + exit ;; + DRS?6000:unix:4.0:6*) + echo sparc-icl-nx6 + exit ;; + DRS?6000:UNIX_SV:4.2*:7* | DRS?6000:isis:4.2*:7*) + case `/usr/bin/uname -p` in + sparc) echo sparc-icl-nx7; exit ;; + esac ;; + s390x:SunOS:*:*) + echo ${UNAME_MACHINE}-ibm-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` + exit ;; + sun4H:SunOS:5.*:*) + echo sparc-hal-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` + exit ;; + sun4*:SunOS:5.*:* | tadpole*:SunOS:5.*:*) + echo sparc-sun-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` + exit ;; + i86pc:AuroraUX:5.*:* | i86xen:AuroraUX:5.*:*) + echo i386-pc-auroraux${UNAME_RELEASE} + exit ;; + i86pc:SunOS:5.*:* | i86xen:SunOS:5.*:*) + eval $set_cc_for_build + SUN_ARCH="i386" + # If there is a compiler, see if it is configured for 64-bit objects. + # Note that the Sun cc does not turn __LP64__ into 1 like gcc does. + # This test works for both compilers. + if [ "$CC_FOR_BUILD" != 'no_compiler_found' ]; then + if (echo '#ifdef __amd64'; echo IS_64BIT_ARCH; echo '#endif') | \ + (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) | \ + grep IS_64BIT_ARCH >/dev/null + then + SUN_ARCH="x86_64" + fi + fi + echo ${SUN_ARCH}-pc-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` + exit ;; + sun4*:SunOS:6*:*) + # According to config.sub, this is the proper way to canonicalize + # SunOS6. Hard to guess exactly what SunOS6 will be like, but + # it's likely to be more like Solaris than SunOS4. + echo sparc-sun-solaris3`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` + exit ;; + sun4*:SunOS:*:*) + case "`/usr/bin/arch -k`" in + Series*|S4*) + UNAME_RELEASE=`uname -v` + ;; + esac + # Japanese Language versions have a version number like `4.1.3-JL'. + echo sparc-sun-sunos`echo ${UNAME_RELEASE}|sed -e 's/-/_/'` + exit ;; + sun3*:SunOS:*:*) + echo m68k-sun-sunos${UNAME_RELEASE} + exit ;; + sun*:*:4.2BSD:*) + UNAME_RELEASE=`(sed 1q /etc/motd | awk '{print substr($5,1,3)}') 2>/dev/null` + test "x${UNAME_RELEASE}" = "x" && UNAME_RELEASE=3 + case "`/bin/arch`" in + sun3) + echo m68k-sun-sunos${UNAME_RELEASE} + ;; + sun4) + echo sparc-sun-sunos${UNAME_RELEASE} + ;; + esac + exit ;; + aushp:SunOS:*:*) + echo sparc-auspex-sunos${UNAME_RELEASE} + exit ;; + # The situation for MiNT is a little confusing. The machine name + # can be virtually everything (everything which is not + # "atarist" or "atariste" at least should have a processor + # > m68000). The system name ranges from "MiNT" over "FreeMiNT" + # to the lowercase version "mint" (or "freemint"). Finally + # the system name "TOS" denotes a system which is actually not + # MiNT. But MiNT is downward compatible to TOS, so this should + # be no problem. + atarist[e]:*MiNT:*:* | atarist[e]:*mint:*:* | atarist[e]:*TOS:*:*) + echo m68k-atari-mint${UNAME_RELEASE} + exit ;; + atari*:*MiNT:*:* | atari*:*mint:*:* | atarist[e]:*TOS:*:*) + echo m68k-atari-mint${UNAME_RELEASE} + exit ;; + *falcon*:*MiNT:*:* | *falcon*:*mint:*:* | *falcon*:*TOS:*:*) + echo m68k-atari-mint${UNAME_RELEASE} + exit ;; + milan*:*MiNT:*:* | milan*:*mint:*:* | *milan*:*TOS:*:*) + echo m68k-milan-mint${UNAME_RELEASE} + exit ;; + hades*:*MiNT:*:* | hades*:*mint:*:* | *hades*:*TOS:*:*) + echo m68k-hades-mint${UNAME_RELEASE} + exit ;; + *:*MiNT:*:* | *:*mint:*:* | *:*TOS:*:*) + echo m68k-unknown-mint${UNAME_RELEASE} + exit ;; + m68k:machten:*:*) + echo m68k-apple-machten${UNAME_RELEASE} + exit ;; + powerpc:machten:*:*) + echo powerpc-apple-machten${UNAME_RELEASE} + exit ;; + RISC*:Mach:*:*) + echo mips-dec-mach_bsd4.3 + exit ;; + RISC*:ULTRIX:*:*) + echo mips-dec-ultrix${UNAME_RELEASE} + exit ;; + VAX*:ULTRIX*:*:*) + echo vax-dec-ultrix${UNAME_RELEASE} + exit ;; + 2020:CLIX:*:* | 2430:CLIX:*:*) + echo clipper-intergraph-clix${UNAME_RELEASE} + exit ;; + mips:*:*:UMIPS | mips:*:*:RISCos) + eval $set_cc_for_build + sed 's/^ //' << EOF >$dummy.c +#ifdef __cplusplus +#include /* for printf() prototype */ + int main (int argc, char *argv[]) { +#else + int main (argc, argv) int argc; char *argv[]; { +#endif + #if defined (host_mips) && defined (MIPSEB) + #if defined (SYSTYPE_SYSV) + printf ("mips-mips-riscos%ssysv\n", argv[1]); exit (0); + #endif + #if defined (SYSTYPE_SVR4) + printf ("mips-mips-riscos%ssvr4\n", argv[1]); exit (0); + #endif + #if defined (SYSTYPE_BSD43) || defined(SYSTYPE_BSD) + printf ("mips-mips-riscos%sbsd\n", argv[1]); exit (0); + #endif + #endif + exit (-1); + } +EOF + $CC_FOR_BUILD -o $dummy $dummy.c && + dummyarg=`echo "${UNAME_RELEASE}" | sed -n 's/\([0-9]*\).*/\1/p'` && + SYSTEM_NAME=`$dummy $dummyarg` && + { echo "$SYSTEM_NAME"; exit; } + echo mips-mips-riscos${UNAME_RELEASE} + exit ;; + Motorola:PowerMAX_OS:*:*) + echo powerpc-motorola-powermax + exit ;; + Motorola:*:4.3:PL8-*) + echo powerpc-harris-powermax + exit ;; + Night_Hawk:*:*:PowerMAX_OS | Synergy:PowerMAX_OS:*:*) + echo powerpc-harris-powermax + exit ;; + Night_Hawk:Power_UNIX:*:*) + echo powerpc-harris-powerunix + exit ;; + m88k:CX/UX:7*:*) + echo m88k-harris-cxux7 + exit ;; + m88k:*:4*:R4*) + echo m88k-motorola-sysv4 + exit ;; + m88k:*:3*:R3*) + echo m88k-motorola-sysv3 + exit ;; + AViiON:dgux:*:*) + # DG/UX returns AViiON for all architectures + UNAME_PROCESSOR=`/usr/bin/uname -p` + if [ $UNAME_PROCESSOR = mc88100 ] || [ $UNAME_PROCESSOR = mc88110 ] + then + if [ ${TARGET_BINARY_INTERFACE}x = m88kdguxelfx ] || \ + [ ${TARGET_BINARY_INTERFACE}x = x ] + then + echo m88k-dg-dgux${UNAME_RELEASE} + else + echo m88k-dg-dguxbcs${UNAME_RELEASE} + fi + else + echo i586-dg-dgux${UNAME_RELEASE} + fi + exit ;; + M88*:DolphinOS:*:*) # DolphinOS (SVR3) + echo m88k-dolphin-sysv3 + exit ;; + M88*:*:R3*:*) + # Delta 88k system running SVR3 + echo m88k-motorola-sysv3 + exit ;; + XD88*:*:*:*) # Tektronix XD88 system running UTekV (SVR3) + echo m88k-tektronix-sysv3 + exit ;; + Tek43[0-9][0-9]:UTek:*:*) # Tektronix 4300 system running UTek (BSD) + echo m68k-tektronix-bsd + exit ;; + *:IRIX*:*:*) + echo mips-sgi-irix`echo ${UNAME_RELEASE}|sed -e 's/-/_/g'` + exit ;; + ????????:AIX?:[12].1:2) # AIX 2.2.1 or AIX 2.1.1 is RT/PC AIX. + echo romp-ibm-aix # uname -m gives an 8 hex-code CPU id + exit ;; # Note that: echo "'`uname -s`'" gives 'AIX ' + i*86:AIX:*:*) + echo i386-ibm-aix + exit ;; + ia64:AIX:*:*) + if [ -x /usr/bin/oslevel ] ; then + IBM_REV=`/usr/bin/oslevel` + else + IBM_REV=${UNAME_VERSION}.${UNAME_RELEASE} + fi + echo ${UNAME_MACHINE}-ibm-aix${IBM_REV} + exit ;; + *:AIX:2:3) + if grep bos325 /usr/include/stdio.h >/dev/null 2>&1; then + eval $set_cc_for_build + sed 's/^ //' << EOF >$dummy.c + #include + + main() + { + if (!__power_pc()) + exit(1); + puts("powerpc-ibm-aix3.2.5"); + exit(0); + } +EOF + if $CC_FOR_BUILD -o $dummy $dummy.c && SYSTEM_NAME=`$dummy` + then + echo "$SYSTEM_NAME" + else + echo rs6000-ibm-aix3.2.5 + fi + elif grep bos324 /usr/include/stdio.h >/dev/null 2>&1; then + echo rs6000-ibm-aix3.2.4 + else + echo rs6000-ibm-aix3.2 + fi + exit ;; + *:AIX:*:[4567]) + IBM_CPU_ID=`/usr/sbin/lsdev -C -c processor -S available | sed 1q | awk '{ print $1 }'` + if /usr/sbin/lsattr -El ${IBM_CPU_ID} | grep ' POWER' >/dev/null 2>&1; then + IBM_ARCH=rs6000 + else + IBM_ARCH=powerpc + fi + if [ -x /usr/bin/lslpp ] ; then + IBM_REV=`/usr/bin/lslpp -Lqc bos.rte.libc | + awk -F: '{ print $3 }' | sed s/[0-9]*$/0/` + else + IBM_REV=${UNAME_VERSION}.${UNAME_RELEASE} + fi + echo ${IBM_ARCH}-ibm-aix${IBM_REV} + exit ;; + *:AIX:*:*) + echo rs6000-ibm-aix + exit ;; + ibmrt:4.4BSD:*|romp-ibm:BSD:*) + echo romp-ibm-bsd4.4 + exit ;; + ibmrt:*BSD:*|romp-ibm:BSD:*) # covers RT/PC BSD and + echo romp-ibm-bsd${UNAME_RELEASE} # 4.3 with uname added to + exit ;; # report: romp-ibm BSD 4.3 + *:BOSX:*:*) + echo rs6000-bull-bosx + exit ;; + DPX/2?00:B.O.S.:*:*) + echo m68k-bull-sysv3 + exit ;; + 9000/[34]??:4.3bsd:1.*:*) + echo m68k-hp-bsd + exit ;; + hp300:4.4BSD:*:* | 9000/[34]??:4.3bsd:2.*:*) + echo m68k-hp-bsd4.4 + exit ;; + 9000/[34678]??:HP-UX:*:*) + HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'` + case "${UNAME_MACHINE}" in + 9000/31? ) HP_ARCH=m68000 ;; + 9000/[34]?? ) HP_ARCH=m68k ;; + 9000/[678][0-9][0-9]) + if [ -x /usr/bin/getconf ]; then + sc_cpu_version=`/usr/bin/getconf SC_CPU_VERSION 2>/dev/null` + sc_kernel_bits=`/usr/bin/getconf SC_KERNEL_BITS 2>/dev/null` + case "${sc_cpu_version}" in + 523) HP_ARCH="hppa1.0" ;; # CPU_PA_RISC1_0 + 528) HP_ARCH="hppa1.1" ;; # CPU_PA_RISC1_1 + 532) # CPU_PA_RISC2_0 + case "${sc_kernel_bits}" in + 32) HP_ARCH="hppa2.0n" ;; + 64) HP_ARCH="hppa2.0w" ;; + '') HP_ARCH="hppa2.0" ;; # HP-UX 10.20 + esac ;; + esac + fi + if [ "${HP_ARCH}" = "" ]; then + eval $set_cc_for_build + sed 's/^ //' << EOF >$dummy.c + + #define _HPUX_SOURCE + #include + #include + + int main () + { + #if defined(_SC_KERNEL_BITS) + long bits = sysconf(_SC_KERNEL_BITS); + #endif + long cpu = sysconf (_SC_CPU_VERSION); + + switch (cpu) + { + case CPU_PA_RISC1_0: puts ("hppa1.0"); break; + case CPU_PA_RISC1_1: puts ("hppa1.1"); break; + case CPU_PA_RISC2_0: + #if defined(_SC_KERNEL_BITS) + switch (bits) + { + case 64: puts ("hppa2.0w"); break; + case 32: puts ("hppa2.0n"); break; + default: puts ("hppa2.0"); break; + } break; + #else /* !defined(_SC_KERNEL_BITS) */ + puts ("hppa2.0"); break; + #endif + default: puts ("hppa1.0"); break; + } + exit (0); + } +EOF + (CCOPTS= $CC_FOR_BUILD -o $dummy $dummy.c 2>/dev/null) && HP_ARCH=`$dummy` + test -z "$HP_ARCH" && HP_ARCH=hppa + fi ;; + esac + if [ ${HP_ARCH} = "hppa2.0w" ] + then + eval $set_cc_for_build + + # hppa2.0w-hp-hpux* has a 64-bit kernel and a compiler generating + # 32-bit code. hppa64-hp-hpux* has the same kernel and a compiler + # generating 64-bit code. GNU and HP use different nomenclature: + # + # $ CC_FOR_BUILD=cc ./config.guess + # => hppa2.0w-hp-hpux11.23 + # $ CC_FOR_BUILD="cc +DA2.0w" ./config.guess + # => hppa64-hp-hpux11.23 + + if echo __LP64__ | (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) | + grep -q __LP64__ + then + HP_ARCH="hppa2.0w" + else + HP_ARCH="hppa64" + fi + fi + echo ${HP_ARCH}-hp-hpux${HPUX_REV} + exit ;; + ia64:HP-UX:*:*) + HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'` + echo ia64-hp-hpux${HPUX_REV} + exit ;; + 3050*:HI-UX:*:*) + eval $set_cc_for_build + sed 's/^ //' << EOF >$dummy.c + #include + int + main () + { + long cpu = sysconf (_SC_CPU_VERSION); + /* The order matters, because CPU_IS_HP_MC68K erroneously returns + true for CPU_PA_RISC1_0. CPU_IS_PA_RISC returns correct + results, however. */ + if (CPU_IS_PA_RISC (cpu)) + { + switch (cpu) + { + case CPU_PA_RISC1_0: puts ("hppa1.0-hitachi-hiuxwe2"); break; + case CPU_PA_RISC1_1: puts ("hppa1.1-hitachi-hiuxwe2"); break; + case CPU_PA_RISC2_0: puts ("hppa2.0-hitachi-hiuxwe2"); break; + default: puts ("hppa-hitachi-hiuxwe2"); break; + } + } + else if (CPU_IS_HP_MC68K (cpu)) + puts ("m68k-hitachi-hiuxwe2"); + else puts ("unknown-hitachi-hiuxwe2"); + exit (0); + } +EOF + $CC_FOR_BUILD -o $dummy $dummy.c && SYSTEM_NAME=`$dummy` && + { echo "$SYSTEM_NAME"; exit; } + echo unknown-hitachi-hiuxwe2 + exit ;; + 9000/7??:4.3bsd:*:* | 9000/8?[79]:4.3bsd:*:* ) + echo hppa1.1-hp-bsd + exit ;; + 9000/8??:4.3bsd:*:*) + echo hppa1.0-hp-bsd + exit ;; + *9??*:MPE/iX:*:* | *3000*:MPE/iX:*:*) + echo hppa1.0-hp-mpeix + exit ;; + hp7??:OSF1:*:* | hp8?[79]:OSF1:*:* ) + echo hppa1.1-hp-osf + exit ;; + hp8??:OSF1:*:*) + echo hppa1.0-hp-osf + exit ;; + i*86:OSF1:*:*) + if [ -x /usr/sbin/sysversion ] ; then + echo ${UNAME_MACHINE}-unknown-osf1mk + else + echo ${UNAME_MACHINE}-unknown-osf1 + fi + exit ;; + parisc*:Lites*:*:*) + echo hppa1.1-hp-lites + exit ;; + C1*:ConvexOS:*:* | convex:ConvexOS:C1*:*) + echo c1-convex-bsd + exit ;; + C2*:ConvexOS:*:* | convex:ConvexOS:C2*:*) + if getsysinfo -f scalar_acc + then echo c32-convex-bsd + else echo c2-convex-bsd + fi + exit ;; + C34*:ConvexOS:*:* | convex:ConvexOS:C34*:*) + echo c34-convex-bsd + exit ;; + C38*:ConvexOS:*:* | convex:ConvexOS:C38*:*) + echo c38-convex-bsd + exit ;; + C4*:ConvexOS:*:* | convex:ConvexOS:C4*:*) + echo c4-convex-bsd + exit ;; + CRAY*Y-MP:*:*:*) + echo ymp-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' + exit ;; + CRAY*[A-Z]90:*:*:*) + echo ${UNAME_MACHINE}-cray-unicos${UNAME_RELEASE} \ + | sed -e 's/CRAY.*\([A-Z]90\)/\1/' \ + -e y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/ \ + -e 's/\.[^.]*$/.X/' + exit ;; + CRAY*TS:*:*:*) + echo t90-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' + exit ;; + CRAY*T3E:*:*:*) + echo alphaev5-cray-unicosmk${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' + exit ;; + CRAY*SV1:*:*:*) + echo sv1-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' + exit ;; + *:UNICOS/mp:*:*) + echo craynv-cray-unicosmp${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' + exit ;; + F30[01]:UNIX_System_V:*:* | F700:UNIX_System_V:*:*) + FUJITSU_PROC=`uname -m | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` + FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'` + FUJITSU_REL=`echo ${UNAME_RELEASE} | sed -e 's/ /_/'` + echo "${FUJITSU_PROC}-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}" + exit ;; + 5000:UNIX_System_V:4.*:*) + FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'` + FUJITSU_REL=`echo ${UNAME_RELEASE} | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/ /_/'` + echo "sparc-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}" + exit ;; + i*86:BSD/386:*:* | i*86:BSD/OS:*:* | *:Ascend\ Embedded/OS:*:*) + echo ${UNAME_MACHINE}-pc-bsdi${UNAME_RELEASE} + exit ;; + sparc*:BSD/OS:*:*) + echo sparc-unknown-bsdi${UNAME_RELEASE} + exit ;; + *:BSD/OS:*:*) + echo ${UNAME_MACHINE}-unknown-bsdi${UNAME_RELEASE} + exit ;; + *:FreeBSD:*:*) + UNAME_PROCESSOR=`/usr/bin/uname -p` + case ${UNAME_PROCESSOR} in + amd64) + echo x86_64-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;; + *) + echo ${UNAME_PROCESSOR}-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;; + esac + exit ;; + i*:CYGWIN*:*) + echo ${UNAME_MACHINE}-pc-cygwin + exit ;; + *:MINGW64*:*) + echo ${UNAME_MACHINE}-pc-mingw64 + exit ;; + *:MINGW*:*) + echo ${UNAME_MACHINE}-pc-mingw32 + exit ;; + *:MSYS*:*) + echo ${UNAME_MACHINE}-pc-msys + exit ;; + i*:windows32*:*) + # uname -m includes "-pc" on this system. + echo ${UNAME_MACHINE}-mingw32 + exit ;; + i*:PW*:*) + echo ${UNAME_MACHINE}-pc-pw32 + exit ;; + *:Interix*:*) + case ${UNAME_MACHINE} in + x86) + echo i586-pc-interix${UNAME_RELEASE} + exit ;; + authenticamd | genuineintel | EM64T) + echo x86_64-unknown-interix${UNAME_RELEASE} + exit ;; + IA64) + echo ia64-unknown-interix${UNAME_RELEASE} + exit ;; + esac ;; + [345]86:Windows_95:* | [345]86:Windows_98:* | [345]86:Windows_NT:*) + echo i${UNAME_MACHINE}-pc-mks + exit ;; + 8664:Windows_NT:*) + echo x86_64-pc-mks + exit ;; + i*:Windows_NT*:* | Pentium*:Windows_NT*:*) + # How do we know it's Interix rather than the generic POSIX subsystem? + # It also conflicts with pre-2.0 versions of AT&T UWIN. Should we + # UNAME_MACHINE based on the output of uname instead of i386? + echo i586-pc-interix + exit ;; + i*:UWIN*:*) + echo ${UNAME_MACHINE}-pc-uwin + exit ;; + amd64:CYGWIN*:*:* | x86_64:CYGWIN*:*:*) + echo x86_64-unknown-cygwin + exit ;; + p*:CYGWIN*:*) + echo powerpcle-unknown-cygwin + exit ;; + prep*:SunOS:5.*:*) + echo powerpcle-unknown-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` + exit ;; + *:GNU:*:*) + # the GNU system + echo `echo ${UNAME_MACHINE}|sed -e 's,[-/].*$,,'`-unknown-${LIBC}`echo ${UNAME_RELEASE}|sed -e 's,/.*$,,'` + exit ;; + *:GNU/*:*:*) + # other systems with GNU libc and userland + echo ${UNAME_MACHINE}-unknown-`echo ${UNAME_SYSTEM} | sed 's,^[^/]*/,,' | tr '[A-Z]' '[a-z]'``echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`-${LIBC} + exit ;; + i*86:Minix:*:*) + echo ${UNAME_MACHINE}-pc-minix + exit ;; + aarch64:Linux:*:*) + echo ${UNAME_MACHINE}-unknown-linux-${LIBC} + exit ;; + aarch64_be:Linux:*:*) + UNAME_MACHINE=aarch64_be + echo ${UNAME_MACHINE}-unknown-linux-${LIBC} + exit ;; + alpha:Linux:*:*) + case `sed -n '/^cpu model/s/^.*: \(.*\)/\1/p' < /proc/cpuinfo` in + EV5) UNAME_MACHINE=alphaev5 ;; + EV56) UNAME_MACHINE=alphaev56 ;; + PCA56) UNAME_MACHINE=alphapca56 ;; + PCA57) UNAME_MACHINE=alphapca56 ;; + EV6) UNAME_MACHINE=alphaev6 ;; + EV67) UNAME_MACHINE=alphaev67 ;; + EV68*) UNAME_MACHINE=alphaev68 ;; + esac + objdump --private-headers /bin/sh | grep -q ld.so.1 + if test "$?" = 0 ; then LIBC="gnulibc1" ; fi + echo ${UNAME_MACHINE}-unknown-linux-${LIBC} + exit ;; + arc:Linux:*:* | arceb:Linux:*:*) + echo ${UNAME_MACHINE}-unknown-linux-${LIBC} + exit ;; + arm*:Linux:*:*) + eval $set_cc_for_build + if echo __ARM_EABI__ | $CC_FOR_BUILD -E - 2>/dev/null \ + | grep -q __ARM_EABI__ + then + echo ${UNAME_MACHINE}-unknown-linux-${LIBC} + else + if echo __ARM_PCS_VFP | $CC_FOR_BUILD -E - 2>/dev/null \ + | grep -q __ARM_PCS_VFP + then + echo ${UNAME_MACHINE}-unknown-linux-${LIBC}eabi + else + echo ${UNAME_MACHINE}-unknown-linux-${LIBC}eabihf + fi + fi + exit ;; + avr32*:Linux:*:*) + echo ${UNAME_MACHINE}-unknown-linux-${LIBC} + exit ;; + cris:Linux:*:*) + echo ${UNAME_MACHINE}-axis-linux-${LIBC} + exit ;; + crisv32:Linux:*:*) + echo ${UNAME_MACHINE}-axis-linux-${LIBC} + exit ;; + e2k:Linux:*:*) + echo ${UNAME_MACHINE}-unknown-linux-${LIBC} + exit ;; + frv:Linux:*:*) + echo ${UNAME_MACHINE}-unknown-linux-${LIBC} + exit ;; + hexagon:Linux:*:*) + echo ${UNAME_MACHINE}-unknown-linux-${LIBC} + exit ;; + i*86:Linux:*:*) + echo ${UNAME_MACHINE}-pc-linux-${LIBC} + exit ;; + ia64:Linux:*:*) + echo ${UNAME_MACHINE}-unknown-linux-${LIBC} + exit ;; + m32r*:Linux:*:*) + echo ${UNAME_MACHINE}-unknown-linux-${LIBC} + exit ;; + m68*:Linux:*:*) + echo ${UNAME_MACHINE}-unknown-linux-${LIBC} + exit ;; + mips:Linux:*:* | mips64:Linux:*:*) + eval $set_cc_for_build + sed 's/^ //' << EOF >$dummy.c + #undef CPU + #undef ${UNAME_MACHINE} + #undef ${UNAME_MACHINE}el + #if defined(__MIPSEL__) || defined(__MIPSEL) || defined(_MIPSEL) || defined(MIPSEL) + CPU=${UNAME_MACHINE}el + #else + #if defined(__MIPSEB__) || defined(__MIPSEB) || defined(_MIPSEB) || defined(MIPSEB) + CPU=${UNAME_MACHINE} + #else + CPU= + #endif + #endif +EOF + eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep '^CPU'` + test x"${CPU}" != x && { echo "${CPU}-unknown-linux-${LIBC}"; exit; } + ;; + openrisc*:Linux:*:*) + echo or1k-unknown-linux-${LIBC} + exit ;; + or32:Linux:*:* | or1k*:Linux:*:*) + echo ${UNAME_MACHINE}-unknown-linux-${LIBC} + exit ;; + padre:Linux:*:*) + echo sparc-unknown-linux-${LIBC} + exit ;; + parisc64:Linux:*:* | hppa64:Linux:*:*) + echo hppa64-unknown-linux-${LIBC} + exit ;; + parisc:Linux:*:* | hppa:Linux:*:*) + # Look for CPU level + case `grep '^cpu[^a-z]*:' /proc/cpuinfo 2>/dev/null | cut -d' ' -f2` in + PA7*) echo hppa1.1-unknown-linux-${LIBC} ;; + PA8*) echo hppa2.0-unknown-linux-${LIBC} ;; + *) echo hppa-unknown-linux-${LIBC} ;; + esac + exit ;; + ppc64:Linux:*:*) + echo powerpc64-unknown-linux-${LIBC} + exit ;; + ppc:Linux:*:*) + echo powerpc-unknown-linux-${LIBC} + exit ;; + ppc64le:Linux:*:*) + echo powerpc64le-unknown-linux-${LIBC} + exit ;; + ppcle:Linux:*:*) + echo powerpcle-unknown-linux-${LIBC} + exit ;; + s390:Linux:*:* | s390x:Linux:*:*) + echo ${UNAME_MACHINE}-ibm-linux-${LIBC} + exit ;; + sh64*:Linux:*:*) + echo ${UNAME_MACHINE}-unknown-linux-${LIBC} + exit ;; + sh*:Linux:*:*) + echo ${UNAME_MACHINE}-unknown-linux-${LIBC} + exit ;; + sparc:Linux:*:* | sparc64:Linux:*:*) + echo ${UNAME_MACHINE}-unknown-linux-${LIBC} + exit ;; + tile*:Linux:*:*) + echo ${UNAME_MACHINE}-unknown-linux-${LIBC} + exit ;; + vax:Linux:*:*) + echo ${UNAME_MACHINE}-dec-linux-${LIBC} + exit ;; + x86_64:Linux:*:*) + echo ${UNAME_MACHINE}-pc-linux-${LIBC} + exit ;; + xtensa*:Linux:*:*) + echo ${UNAME_MACHINE}-unknown-linux-${LIBC} + exit ;; + i*86:DYNIX/ptx:4*:*) + # ptx 4.0 does uname -s correctly, with DYNIX/ptx in there. + # earlier versions are messed up and put the nodename in both + # sysname and nodename. + echo i386-sequent-sysv4 + exit ;; + i*86:UNIX_SV:4.2MP:2.*) + # Unixware is an offshoot of SVR4, but it has its own version + # number series starting with 2... + # I am not positive that other SVR4 systems won't match this, + # I just have to hope. -- rms. + # Use sysv4.2uw... so that sysv4* matches it. + echo ${UNAME_MACHINE}-pc-sysv4.2uw${UNAME_VERSION} + exit ;; + i*86:OS/2:*:*) + # If we were able to find `uname', then EMX Unix compatibility + # is probably installed. + echo ${UNAME_MACHINE}-pc-os2-emx + exit ;; + i*86:XTS-300:*:STOP) + echo ${UNAME_MACHINE}-unknown-stop + exit ;; + i*86:atheos:*:*) + echo ${UNAME_MACHINE}-unknown-atheos + exit ;; + i*86:syllable:*:*) + echo ${UNAME_MACHINE}-pc-syllable + exit ;; + i*86:LynxOS:2.*:* | i*86:LynxOS:3.[01]*:* | i*86:LynxOS:4.[02]*:*) + echo i386-unknown-lynxos${UNAME_RELEASE} + exit ;; + i*86:*DOS:*:*) + echo ${UNAME_MACHINE}-pc-msdosdjgpp + exit ;; + i*86:*:4.*:* | i*86:SYSTEM_V:4.*:*) + UNAME_REL=`echo ${UNAME_RELEASE} | sed 's/\/MP$//'` + if grep Novell /usr/include/link.h >/dev/null 2>/dev/null; then + echo ${UNAME_MACHINE}-univel-sysv${UNAME_REL} + else + echo ${UNAME_MACHINE}-pc-sysv${UNAME_REL} + fi + exit ;; + i*86:*:5:[678]*) + # UnixWare 7.x, OpenUNIX and OpenServer 6. + case `/bin/uname -X | grep "^Machine"` in + *486*) UNAME_MACHINE=i486 ;; + *Pentium) UNAME_MACHINE=i586 ;; + *Pent*|*Celeron) UNAME_MACHINE=i686 ;; + esac + echo ${UNAME_MACHINE}-unknown-sysv${UNAME_RELEASE}${UNAME_SYSTEM}${UNAME_VERSION} + exit ;; + i*86:*:3.2:*) + if test -f /usr/options/cb.name; then + UNAME_REL=`sed -n 's/.*Version //p' /dev/null >/dev/null ; then + UNAME_REL=`(/bin/uname -X|grep Release|sed -e 's/.*= //')` + (/bin/uname -X|grep i80486 >/dev/null) && UNAME_MACHINE=i486 + (/bin/uname -X|grep '^Machine.*Pentium' >/dev/null) \ + && UNAME_MACHINE=i586 + (/bin/uname -X|grep '^Machine.*Pent *II' >/dev/null) \ + && UNAME_MACHINE=i686 + (/bin/uname -X|grep '^Machine.*Pentium Pro' >/dev/null) \ + && UNAME_MACHINE=i686 + echo ${UNAME_MACHINE}-pc-sco$UNAME_REL + else + echo ${UNAME_MACHINE}-pc-sysv32 + fi + exit ;; + pc:*:*:*) + # Left here for compatibility: + # uname -m prints for DJGPP always 'pc', but it prints nothing about + # the processor, so we play safe by assuming i586. + # Note: whatever this is, it MUST be the same as what config.sub + # prints for the "djgpp" host, or else GDB configury will decide that + # this is a cross-build. + echo i586-pc-msdosdjgpp + exit ;; + Intel:Mach:3*:*) + echo i386-pc-mach3 + exit ;; + paragon:*:*:*) + echo i860-intel-osf1 + exit ;; + i860:*:4.*:*) # i860-SVR4 + if grep Stardent /usr/include/sys/uadmin.h >/dev/null 2>&1 ; then + echo i860-stardent-sysv${UNAME_RELEASE} # Stardent Vistra i860-SVR4 + else # Add other i860-SVR4 vendors below as they are discovered. + echo i860-unknown-sysv${UNAME_RELEASE} # Unknown i860-SVR4 + fi + exit ;; + mini*:CTIX:SYS*5:*) + # "miniframe" + echo m68010-convergent-sysv + exit ;; + mc68k:UNIX:SYSTEM5:3.51m) + echo m68k-convergent-sysv + exit ;; + M680?0:D-NIX:5.3:*) + echo m68k-diab-dnix + exit ;; + M68*:*:R3V[5678]*:*) + test -r /sysV68 && { echo 'm68k-motorola-sysv'; exit; } ;; + 3[345]??:*:4.0:3.0 | 3[34]??A:*:4.0:3.0 | 3[34]??,*:*:4.0:3.0 | 3[34]??/*:*:4.0:3.0 | 4400:*:4.0:3.0 | 4850:*:4.0:3.0 | SKA40:*:4.0:3.0 | SDS2:*:4.0:3.0 | SHG2:*:4.0:3.0 | S7501*:*:4.0:3.0) + OS_REL='' + test -r /etc/.relid \ + && OS_REL=.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid` + /bin/uname -p 2>/dev/null | grep 86 >/dev/null \ + && { echo i486-ncr-sysv4.3${OS_REL}; exit; } + /bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \ + && { echo i586-ncr-sysv4.3${OS_REL}; exit; } ;; + 3[34]??:*:4.0:* | 3[34]??,*:*:4.0:*) + /bin/uname -p 2>/dev/null | grep 86 >/dev/null \ + && { echo i486-ncr-sysv4; exit; } ;; + NCR*:*:4.2:* | MPRAS*:*:4.2:*) + OS_REL='.3' + test -r /etc/.relid \ + && OS_REL=.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid` + /bin/uname -p 2>/dev/null | grep 86 >/dev/null \ + && { echo i486-ncr-sysv4.3${OS_REL}; exit; } + /bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \ + && { echo i586-ncr-sysv4.3${OS_REL}; exit; } + /bin/uname -p 2>/dev/null | /bin/grep pteron >/dev/null \ + && { echo i586-ncr-sysv4.3${OS_REL}; exit; } ;; + m68*:LynxOS:2.*:* | m68*:LynxOS:3.0*:*) + echo m68k-unknown-lynxos${UNAME_RELEASE} + exit ;; + mc68030:UNIX_System_V:4.*:*) + echo m68k-atari-sysv4 + exit ;; + TSUNAMI:LynxOS:2.*:*) + echo sparc-unknown-lynxos${UNAME_RELEASE} + exit ;; + rs6000:LynxOS:2.*:*) + echo rs6000-unknown-lynxos${UNAME_RELEASE} + exit ;; + PowerPC:LynxOS:2.*:* | PowerPC:LynxOS:3.[01]*:* | PowerPC:LynxOS:4.[02]*:*) + echo powerpc-unknown-lynxos${UNAME_RELEASE} + exit ;; + SM[BE]S:UNIX_SV:*:*) + echo mips-dde-sysv${UNAME_RELEASE} + exit ;; + RM*:ReliantUNIX-*:*:*) + echo mips-sni-sysv4 + exit ;; + RM*:SINIX-*:*:*) + echo mips-sni-sysv4 + exit ;; + *:SINIX-*:*:*) + if uname -p 2>/dev/null >/dev/null ; then + UNAME_MACHINE=`(uname -p) 2>/dev/null` + echo ${UNAME_MACHINE}-sni-sysv4 + else + echo ns32k-sni-sysv + fi + exit ;; + PENTIUM:*:4.0*:*) # Unisys `ClearPath HMP IX 4000' SVR4/MP effort + # says + echo i586-unisys-sysv4 + exit ;; + *:UNIX_System_V:4*:FTX*) + # From Gerald Hewes . + # How about differentiating between stratus architectures? -djm + echo hppa1.1-stratus-sysv4 + exit ;; + *:*:*:FTX*) + # From seanf@swdc.stratus.com. + echo i860-stratus-sysv4 + exit ;; + i*86:VOS:*:*) + # From Paul.Green@stratus.com. + echo ${UNAME_MACHINE}-stratus-vos + exit ;; + *:VOS:*:*) + # From Paul.Green@stratus.com. + echo hppa1.1-stratus-vos + exit ;; + mc68*:A/UX:*:*) + echo m68k-apple-aux${UNAME_RELEASE} + exit ;; + news*:NEWS-OS:6*:*) + echo mips-sony-newsos6 + exit ;; + R[34]000:*System_V*:*:* | R4000:UNIX_SYSV:*:* | R*000:UNIX_SV:*:*) + if [ -d /usr/nec ]; then + echo mips-nec-sysv${UNAME_RELEASE} + else + echo mips-unknown-sysv${UNAME_RELEASE} + fi + exit ;; + BeBox:BeOS:*:*) # BeOS running on hardware made by Be, PPC only. + echo powerpc-be-beos + exit ;; + BeMac:BeOS:*:*) # BeOS running on Mac or Mac clone, PPC only. + echo powerpc-apple-beos + exit ;; + BePC:BeOS:*:*) # BeOS running on Intel PC compatible. + echo i586-pc-beos + exit ;; + BePC:Haiku:*:*) # Haiku running on Intel PC compatible. + echo i586-pc-haiku + exit ;; + x86_64:Haiku:*:*) + echo x86_64-unknown-haiku + exit ;; + SX-4:SUPER-UX:*:*) + echo sx4-nec-superux${UNAME_RELEASE} + exit ;; + SX-5:SUPER-UX:*:*) + echo sx5-nec-superux${UNAME_RELEASE} + exit ;; + SX-6:SUPER-UX:*:*) + echo sx6-nec-superux${UNAME_RELEASE} + exit ;; + SX-7:SUPER-UX:*:*) + echo sx7-nec-superux${UNAME_RELEASE} + exit ;; + SX-8:SUPER-UX:*:*) + echo sx8-nec-superux${UNAME_RELEASE} + exit ;; + SX-8R:SUPER-UX:*:*) + echo sx8r-nec-superux${UNAME_RELEASE} + exit ;; + Power*:Rhapsody:*:*) + echo powerpc-apple-rhapsody${UNAME_RELEASE} + exit ;; + *:Rhapsody:*:*) + echo ${UNAME_MACHINE}-apple-rhapsody${UNAME_RELEASE} + exit ;; + *:Darwin:*:*) + UNAME_PROCESSOR=`uname -p` || UNAME_PROCESSOR=unknown + eval $set_cc_for_build + if test "$UNAME_PROCESSOR" = unknown ; then + UNAME_PROCESSOR=powerpc + fi + if test `echo "$UNAME_RELEASE" | sed -e 's/\..*//'` -le 10 ; then + if [ "$CC_FOR_BUILD" != 'no_compiler_found' ]; then + if (echo '#ifdef __LP64__'; echo IS_64BIT_ARCH; echo '#endif') | \ + (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) | \ + grep IS_64BIT_ARCH >/dev/null + then + case $UNAME_PROCESSOR in + i386) UNAME_PROCESSOR=x86_64 ;; + powerpc) UNAME_PROCESSOR=powerpc64 ;; + esac + fi + fi + elif test "$UNAME_PROCESSOR" = i386 ; then + # Avoid executing cc on OS X 10.9, as it ships with a stub + # that puts up a graphical alert prompting to install + # developer tools. Any system running Mac OS X 10.7 or + # later (Darwin 11 and later) is required to have a 64-bit + # processor. This is not true of the ARM version of Darwin + # that Apple uses in portable devices. + UNAME_PROCESSOR=x86_64 + fi + echo ${UNAME_PROCESSOR}-apple-darwin${UNAME_RELEASE} + exit ;; + *:procnto*:*:* | *:QNX:[0123456789]*:*) + UNAME_PROCESSOR=`uname -p` + if test "$UNAME_PROCESSOR" = "x86"; then + UNAME_PROCESSOR=i386 + UNAME_MACHINE=pc + fi + echo ${UNAME_PROCESSOR}-${UNAME_MACHINE}-nto-qnx${UNAME_RELEASE} + exit ;; + *:QNX:*:4*) + echo i386-pc-qnx + exit ;; + NEO-?:NONSTOP_KERNEL:*:*) + echo neo-tandem-nsk${UNAME_RELEASE} + exit ;; + NSE-*:NONSTOP_KERNEL:*:*) + echo nse-tandem-nsk${UNAME_RELEASE} + exit ;; + NSR-?:NONSTOP_KERNEL:*:*) + echo nsr-tandem-nsk${UNAME_RELEASE} + exit ;; + *:NonStop-UX:*:*) + echo mips-compaq-nonstopux + exit ;; + BS2000:POSIX*:*:*) + echo bs2000-siemens-sysv + exit ;; + DS/*:UNIX_System_V:*:*) + echo ${UNAME_MACHINE}-${UNAME_SYSTEM}-${UNAME_RELEASE} + exit ;; + *:Plan9:*:*) + # "uname -m" is not consistent, so use $cputype instead. 386 + # is converted to i386 for consistency with other x86 + # operating systems. + if test "$cputype" = "386"; then + UNAME_MACHINE=i386 + else + UNAME_MACHINE="$cputype" + fi + echo ${UNAME_MACHINE}-unknown-plan9 + exit ;; + *:TOPS-10:*:*) + echo pdp10-unknown-tops10 + exit ;; + *:TENEX:*:*) + echo pdp10-unknown-tenex + exit ;; + KS10:TOPS-20:*:* | KL10:TOPS-20:*:* | TYPE4:TOPS-20:*:*) + echo pdp10-dec-tops20 + exit ;; + XKL-1:TOPS-20:*:* | TYPE5:TOPS-20:*:*) + echo pdp10-xkl-tops20 + exit ;; + *:TOPS-20:*:*) + echo pdp10-unknown-tops20 + exit ;; + *:ITS:*:*) + echo pdp10-unknown-its + exit ;; + SEI:*:*:SEIUX) + echo mips-sei-seiux${UNAME_RELEASE} + exit ;; + *:DragonFly:*:*) + echo ${UNAME_MACHINE}-unknown-dragonfly`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` + exit ;; + *:*VMS:*:*) + UNAME_MACHINE=`(uname -p) 2>/dev/null` + case "${UNAME_MACHINE}" in + A*) echo alpha-dec-vms ; exit ;; + I*) echo ia64-dec-vms ; exit ;; + V*) echo vax-dec-vms ; exit ;; + esac ;; + *:XENIX:*:SysV) + echo i386-pc-xenix + exit ;; + i*86:skyos:*:*) + echo ${UNAME_MACHINE}-pc-skyos`echo ${UNAME_RELEASE}` | sed -e 's/ .*$//' + exit ;; + i*86:rdos:*:*) + echo ${UNAME_MACHINE}-pc-rdos + exit ;; + i*86:AROS:*:*) + echo ${UNAME_MACHINE}-pc-aros + exit ;; + x86_64:VMkernel:*:*) + echo ${UNAME_MACHINE}-unknown-esx + exit ;; +esac + +cat >&2 < in order to provide the needed +information to handle your system. + +config.guess timestamp = $timestamp + +uname -m = `(uname -m) 2>/dev/null || echo unknown` +uname -r = `(uname -r) 2>/dev/null || echo unknown` +uname -s = `(uname -s) 2>/dev/null || echo unknown` +uname -v = `(uname -v) 2>/dev/null || echo unknown` + +/usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null` +/bin/uname -X = `(/bin/uname -X) 2>/dev/null` + +hostinfo = `(hostinfo) 2>/dev/null` +/bin/universe = `(/bin/universe) 2>/dev/null` +/usr/bin/arch -k = `(/usr/bin/arch -k) 2>/dev/null` +/bin/arch = `(/bin/arch) 2>/dev/null` +/usr/bin/oslevel = `(/usr/bin/oslevel) 2>/dev/null` +/usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null` + +UNAME_MACHINE = ${UNAME_MACHINE} +UNAME_RELEASE = ${UNAME_RELEASE} +UNAME_SYSTEM = ${UNAME_SYSTEM} +UNAME_VERSION = ${UNAME_VERSION} +EOF + +exit 1 + +# Local variables: +# eval: (add-hook 'write-file-hooks 'time-stamp) +# time-stamp-start: "timestamp='" +# time-stamp-format: "%:y-%02m-%02d" +# time-stamp-end: "'" +# End: diff -Nru filtergen-0.12.4/config.h.in filtergen-0.12.7/config.h.in --- filtergen-0.12.4/config.h.in 2004-08-18 03:50:50.000000000 +0000 +++ filtergen-0.12.7/config.h.in 2016-02-13 10:53:08.000000000 +0000 @@ -1,4 +1,4 @@ -/* config.h.in. Generated from configure.in by autoheader. */ +/* config.h.in. Generated from configure.ac by autoheader. */ /* Define to 1 if you have the header file. */ #undef HAVE_GETOPT_H @@ -45,6 +45,9 @@ /* Define to the one symbol short name of this package. */ #undef PACKAGE_TARNAME +/* Define to the home page for this package. */ +#undef PACKAGE_URL + /* Define to the version of this package. */ #undef PACKAGE_VERSION diff -Nru filtergen-0.12.4/config.sub filtergen-0.12.7/config.sub --- filtergen-0.12.4/config.sub 1970-01-01 00:00:00.000000000 +0000 +++ filtergen-0.12.7/config.sub 2016-02-12 17:12:57.000000000 +0000 @@ -0,0 +1,1813 @@ +#! /bin/sh +# Configuration validation subroutine script. +# Copyright 1992-2015 Free Software Foundation, Inc. + +timestamp='2015-08-20' + +# This file 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 3 of the License, 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, see . +# +# As a special exception to the GNU General Public License, if you +# distribute this file as part of a program that contains a +# configuration script generated by Autoconf, you may include it under +# the same distribution terms that you use for the rest of that +# program. This Exception is an additional permission under section 7 +# of the GNU General Public License, version 3 ("GPLv3"). + + +# Please send patches to . +# +# Configuration subroutine to validate and canonicalize a configuration type. +# Supply the specified configuration type as an argument. +# If it is invalid, we print an error message on stderr and exit with code 1. +# Otherwise, we print the canonical config type on stdout and succeed. + +# You can get the latest version of this script from: +# http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.sub;hb=HEAD + +# This file is supposed to be the same for all GNU packages +# and recognize all the CPU types, system types and aliases +# that are meaningful with *any* GNU software. +# Each package is responsible for reporting which valid configurations +# it does not support. The user should be able to distinguish +# a failure to support a valid configuration from a meaningless +# configuration. + +# The goal of this file is to map all the various variations of a given +# machine specification into a single specification in the form: +# CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM +# or in some cases, the newer four-part form: +# CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM +# It is wrong to echo any other type of specification. + +me=`echo "$0" | sed -e 's,.*/,,'` + +usage="\ +Usage: $0 [OPTION] CPU-MFR-OPSYS + $0 [OPTION] ALIAS + +Canonicalize a configuration name. + +Operation modes: + -h, --help print this help, then exit + -t, --time-stamp print date of last modification, then exit + -v, --version print version number, then exit + +Report bugs and patches to ." + +version="\ +GNU config.sub ($timestamp) + +Copyright 1992-2015 Free Software Foundation, Inc. + +This is free software; see the source for copying conditions. There is NO +warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE." + +help=" +Try \`$me --help' for more information." + +# Parse command line +while test $# -gt 0 ; do + case $1 in + --time-stamp | --time* | -t ) + echo "$timestamp" ; exit ;; + --version | -v ) + echo "$version" ; exit ;; + --help | --h* | -h ) + echo "$usage"; exit ;; + -- ) # Stop option processing + shift; break ;; + - ) # Use stdin as input. + break ;; + -* ) + echo "$me: invalid option $1$help" + exit 1 ;; + + *local*) + # First pass through any local machine types. + echo $1 + exit ;; + + * ) + break ;; + esac +done + +case $# in + 0) echo "$me: missing argument$help" >&2 + exit 1;; + 1) ;; + *) echo "$me: too many arguments$help" >&2 + exit 1;; +esac + +# Separate what the user gave into CPU-COMPANY and OS or KERNEL-OS (if any). +# Here we must recognize all the valid KERNEL-OS combinations. +maybe_os=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\2/'` +case $maybe_os in + nto-qnx* | linux-gnu* | linux-android* | linux-dietlibc | linux-newlib* | \ + linux-musl* | linux-uclibc* | uclinux-uclibc* | uclinux-gnu* | kfreebsd*-gnu* | \ + knetbsd*-gnu* | netbsd*-gnu* | netbsd*-eabi* | \ + kopensolaris*-gnu* | \ + storm-chaos* | os2-emx* | rtmk-nova*) + os=-$maybe_os + basic_machine=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'` + ;; + android-linux) + os=-linux-android + basic_machine=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'`-unknown + ;; + *) + basic_machine=`echo $1 | sed 's/-[^-]*$//'` + if [ $basic_machine != $1 ] + then os=`echo $1 | sed 's/.*-/-/'` + else os=; fi + ;; +esac + +### Let's recognize common machines as not being operating systems so +### that things like config.sub decstation-3100 work. We also +### recognize some manufacturers as not being operating systems, so we +### can provide default operating systems below. +case $os in + -sun*os*) + # Prevent following clause from handling this invalid input. + ;; + -dec* | -mips* | -sequent* | -encore* | -pc532* | -sgi* | -sony* | \ + -att* | -7300* | -3300* | -delta* | -motorola* | -sun[234]* | \ + -unicom* | -ibm* | -next | -hp | -isi* | -apollo | -altos* | \ + -convergent* | -ncr* | -news | -32* | -3600* | -3100* | -hitachi* |\ + -c[123]* | -convex* | -sun | -crds | -omron* | -dg | -ultra | -tti* | \ + -harris | -dolphin | -highlevel | -gould | -cbm | -ns | -masscomp | \ + -apple | -axis | -knuth | -cray | -microblaze*) + os= + basic_machine=$1 + ;; + -bluegene*) + os=-cnk + ;; + -sim | -cisco | -oki | -wec | -winbond) + os= + basic_machine=$1 + ;; + -scout) + ;; + -wrs) + os=-vxworks + basic_machine=$1 + ;; + -chorusos*) + os=-chorusos + basic_machine=$1 + ;; + -chorusrdb) + os=-chorusrdb + basic_machine=$1 + ;; + -hiux*) + os=-hiuxwe2 + ;; + -sco6) + os=-sco5v6 + basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` + ;; + -sco5) + os=-sco3.2v5 + basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` + ;; + -sco4) + os=-sco3.2v4 + basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` + ;; + -sco3.2.[4-9]*) + os=`echo $os | sed -e 's/sco3.2./sco3.2v/'` + basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` + ;; + -sco3.2v[4-9]*) + # Don't forget version if it is 3.2v4 or newer. + basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` + ;; + -sco5v6*) + # Don't forget version if it is 3.2v4 or newer. + basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` + ;; + -sco*) + os=-sco3.2v2 + basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` + ;; + -udk*) + basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` + ;; + -isc) + os=-isc2.2 + basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` + ;; + -clix*) + basic_machine=clipper-intergraph + ;; + -isc*) + basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` + ;; + -lynx*178) + os=-lynxos178 + ;; + -lynx*5) + os=-lynxos5 + ;; + -lynx*) + os=-lynxos + ;; + -ptx*) + basic_machine=`echo $1 | sed -e 's/86-.*/86-sequent/'` + ;; + -windowsnt*) + os=`echo $os | sed -e 's/windowsnt/winnt/'` + ;; + -psos*) + os=-psos + ;; + -mint | -mint[0-9]*) + basic_machine=m68k-atari + os=-mint + ;; +esac + +# Decode aliases for certain CPU-COMPANY combinations. +case $basic_machine in + # Recognize the basic CPU types without company name. + # Some are omitted here because they have special meanings below. + 1750a | 580 \ + | a29k \ + | aarch64 | aarch64_be \ + | alpha | alphaev[4-8] | alphaev56 | alphaev6[78] | alphapca5[67] \ + | alpha64 | alpha64ev[4-8] | alpha64ev56 | alpha64ev6[78] | alpha64pca5[67] \ + | am33_2.0 \ + | arc | arceb \ + | arm | arm[bl]e | arme[lb] | armv[2-8] | armv[3-8][lb] | armv7[arm] \ + | avr | avr32 \ + | ba \ + | be32 | be64 \ + | bfin \ + | c4x | c8051 | clipper \ + | d10v | d30v | dlx | dsp16xx \ + | e2k | epiphany \ + | fido | fr30 | frv | ft32 \ + | h8300 | h8500 | hppa | hppa1.[01] | hppa2.0 | hppa2.0[nw] | hppa64 \ + | hexagon \ + | i370 | i860 | i960 | ia64 \ + | ip2k | iq2000 \ + | k1om \ + | le32 | le64 \ + | lm32 \ + | m32c | m32r | m32rle | m68000 | m68k | m88k \ + | maxq | mb | microblaze | microblazeel | mcore | mep | metag \ + | mips | mipsbe | mipseb | mipsel | mipsle \ + | mips16 \ + | mips64 | mips64el \ + | mips64octeon | mips64octeonel \ + | mips64orion | mips64orionel \ + | mips64r5900 | mips64r5900el \ + | mips64vr | mips64vrel \ + | mips64vr4100 | mips64vr4100el \ + | mips64vr4300 | mips64vr4300el \ + | mips64vr5000 | mips64vr5000el \ + | mips64vr5900 | mips64vr5900el \ + | mipsisa32 | mipsisa32el \ + | mipsisa32r2 | mipsisa32r2el \ + | mipsisa32r6 | mipsisa32r6el \ + | mipsisa64 | mipsisa64el \ + | mipsisa64r2 | mipsisa64r2el \ + | mipsisa64r6 | mipsisa64r6el \ + | mipsisa64sb1 | mipsisa64sb1el \ + | mipsisa64sr71k | mipsisa64sr71kel \ + | mipsr5900 | mipsr5900el \ + | mipstx39 | mipstx39el \ + | mn10200 | mn10300 \ + | moxie \ + | mt \ + | msp430 \ + | nds32 | nds32le | nds32be \ + | nios | nios2 | nios2eb | nios2el \ + | ns16k | ns32k \ + | open8 | or1k | or1knd | or32 \ + | pdp10 | pdp11 | pj | pjl \ + | powerpc | powerpc64 | powerpc64le | powerpcle \ + | pyramid \ + | riscv32 | riscv64 \ + | rl78 | rx \ + | score \ + | sh | sh[1234] | sh[24]a | sh[24]aeb | sh[23]e | sh[234]eb | sheb | shbe | shle | sh[1234]le | sh3ele \ + | sh64 | sh64le \ + | sparc | sparc64 | sparc64b | sparc64v | sparc86x | sparclet | sparclite \ + | sparcv8 | sparcv9 | sparcv9b | sparcv9v \ + | spu \ + | tahoe | tic4x | tic54x | tic55x | tic6x | tic80 | tron \ + | ubicom32 \ + | v850 | v850e | v850e1 | v850e2 | v850es | v850e2v3 \ + | visium \ + | we32k \ + | x86 | xc16x | xstormy16 | xtensa \ + | z8k | z80) + basic_machine=$basic_machine-unknown + ;; + c54x) + basic_machine=tic54x-unknown + ;; + c55x) + basic_machine=tic55x-unknown + ;; + c6x) + basic_machine=tic6x-unknown + ;; + leon|leon[3-9]) + basic_machine=sparc-$basic_machine + ;; + m6811 | m68hc11 | m6812 | m68hc12 | m68hcs12x | nvptx | picochip) + basic_machine=$basic_machine-unknown + os=-none + ;; + m88110 | m680[12346]0 | m683?2 | m68360 | m5200 | v70 | w65 | z8k) + ;; + ms1) + basic_machine=mt-unknown + ;; + + strongarm | thumb | xscale) + basic_machine=arm-unknown + ;; + xgate) + basic_machine=$basic_machine-unknown + os=-none + ;; + xscaleeb) + basic_machine=armeb-unknown + ;; + + xscaleel) + basic_machine=armel-unknown + ;; + + # We use `pc' rather than `unknown' + # because (1) that's what they normally are, and + # (2) the word "unknown" tends to confuse beginning users. + i*86 | x86_64) + basic_machine=$basic_machine-pc + ;; + # Object if more than one company name word. + *-*-*) + echo Invalid configuration \`$1\': machine \`$basic_machine\' not recognized 1>&2 + exit 1 + ;; + # Recognize the basic CPU types with company name. + 580-* \ + | a29k-* \ + | aarch64-* | aarch64_be-* \ + | alpha-* | alphaev[4-8]-* | alphaev56-* | alphaev6[78]-* \ + | alpha64-* | alpha64ev[4-8]-* | alpha64ev56-* | alpha64ev6[78]-* \ + | alphapca5[67]-* | alpha64pca5[67]-* | arc-* | arceb-* \ + | arm-* | armbe-* | armle-* | armeb-* | armv*-* \ + | avr-* | avr32-* \ + | ba-* \ + | be32-* | be64-* \ + | bfin-* | bs2000-* \ + | c[123]* | c30-* | [cjt]90-* | c4x-* \ + | c8051-* | clipper-* | craynv-* | cydra-* \ + | d10v-* | d30v-* | dlx-* \ + | e2k-* | elxsi-* \ + | f30[01]-* | f700-* | fido-* | fr30-* | frv-* | fx80-* \ + | h8300-* | h8500-* \ + | hppa-* | hppa1.[01]-* | hppa2.0-* | hppa2.0[nw]-* | hppa64-* \ + | hexagon-* \ + | i*86-* | i860-* | i960-* | ia64-* \ + | ip2k-* | iq2000-* \ + | k1om-* \ + | le32-* | le64-* \ + | lm32-* \ + | m32c-* | m32r-* | m32rle-* \ + | m68000-* | m680[012346]0-* | m68360-* | m683?2-* | m68k-* \ + | m88110-* | m88k-* | maxq-* | mcore-* | metag-* \ + | microblaze-* | microblazeel-* \ + | mips-* | mipsbe-* | mipseb-* | mipsel-* | mipsle-* \ + | mips16-* \ + | mips64-* | mips64el-* \ + | mips64octeon-* | mips64octeonel-* \ + | mips64orion-* | mips64orionel-* \ + | mips64r5900-* | mips64r5900el-* \ + | mips64vr-* | mips64vrel-* \ + | mips64vr4100-* | mips64vr4100el-* \ + | mips64vr4300-* | mips64vr4300el-* \ + | mips64vr5000-* | mips64vr5000el-* \ + | mips64vr5900-* | mips64vr5900el-* \ + | mipsisa32-* | mipsisa32el-* \ + | mipsisa32r2-* | mipsisa32r2el-* \ + | mipsisa32r6-* | mipsisa32r6el-* \ + | mipsisa64-* | mipsisa64el-* \ + | mipsisa64r2-* | mipsisa64r2el-* \ + | mipsisa64r6-* | mipsisa64r6el-* \ + | mipsisa64sb1-* | mipsisa64sb1el-* \ + | mipsisa64sr71k-* | mipsisa64sr71kel-* \ + | mipsr5900-* | mipsr5900el-* \ + | mipstx39-* | mipstx39el-* \ + | mmix-* \ + | mt-* \ + | msp430-* \ + | nds32-* | nds32le-* | nds32be-* \ + | nios-* | nios2-* | nios2eb-* | nios2el-* \ + | none-* | np1-* | ns16k-* | ns32k-* \ + | open8-* \ + | or1k*-* \ + | orion-* \ + | pdp10-* | pdp11-* | pj-* | pjl-* | pn-* | power-* \ + | powerpc-* | powerpc64-* | powerpc64le-* | powerpcle-* \ + | pyramid-* \ + | riscv32-* | riscv64-* \ + | rl78-* | romp-* | rs6000-* | rx-* \ + | sh-* | sh[1234]-* | sh[24]a-* | sh[24]aeb-* | sh[23]e-* | sh[34]eb-* | sheb-* | shbe-* \ + | shle-* | sh[1234]le-* | sh3ele-* | sh64-* | sh64le-* \ + | sparc-* | sparc64-* | sparc64b-* | sparc64v-* | sparc86x-* | sparclet-* \ + | sparclite-* \ + | sparcv8-* | sparcv9-* | sparcv9b-* | sparcv9v-* | sv1-* | sx*-* \ + | tahoe-* \ + | tic30-* | tic4x-* | tic54x-* | tic55x-* | tic6x-* | tic80-* \ + | tile*-* \ + | tron-* \ + | ubicom32-* \ + | v850-* | v850e-* | v850e1-* | v850es-* | v850e2-* | v850e2v3-* \ + | vax-* \ + | visium-* \ + | we32k-* \ + | x86-* | x86_64-* | xc16x-* | xps100-* \ + | xstormy16-* | xtensa*-* \ + | ymp-* \ + | z8k-* | z80-*) + ;; + # Recognize the basic CPU types without company name, with glob match. + xtensa*) + basic_machine=$basic_machine-unknown + ;; + # Recognize the various machine names and aliases which stand + # for a CPU type and a company and sometimes even an OS. + 386bsd) + basic_machine=i386-unknown + os=-bsd + ;; + 3b1 | 7300 | 7300-att | att-7300 | pc7300 | safari | unixpc) + basic_machine=m68000-att + ;; + 3b*) + basic_machine=we32k-att + ;; + a29khif) + basic_machine=a29k-amd + os=-udi + ;; + abacus) + basic_machine=abacus-unknown + ;; + adobe68k) + basic_machine=m68010-adobe + os=-scout + ;; + alliant | fx80) + basic_machine=fx80-alliant + ;; + altos | altos3068) + basic_machine=m68k-altos + ;; + am29k) + basic_machine=a29k-none + os=-bsd + ;; + amd64) + basic_machine=x86_64-pc + ;; + amd64-*) + basic_machine=x86_64-`echo $basic_machine | sed 's/^[^-]*-//'` + ;; + amdahl) + basic_machine=580-amdahl + os=-sysv + ;; + amiga | amiga-*) + basic_machine=m68k-unknown + ;; + amigaos | amigados) + basic_machine=m68k-unknown + os=-amigaos + ;; + amigaunix | amix) + basic_machine=m68k-unknown + os=-sysv4 + ;; + apollo68) + basic_machine=m68k-apollo + os=-sysv + ;; + apollo68bsd) + basic_machine=m68k-apollo + os=-bsd + ;; + aros) + basic_machine=i386-pc + os=-aros + ;; + asmjs) + basic_machine=asmjs-unknown + ;; + aux) + basic_machine=m68k-apple + os=-aux + ;; + balance) + basic_machine=ns32k-sequent + os=-dynix + ;; + blackfin) + basic_machine=bfin-unknown + os=-linux + ;; + blackfin-*) + basic_machine=bfin-`echo $basic_machine | sed 's/^[^-]*-//'` + os=-linux + ;; + bluegene*) + basic_machine=powerpc-ibm + os=-cnk + ;; + c54x-*) + basic_machine=tic54x-`echo $basic_machine | sed 's/^[^-]*-//'` + ;; + c55x-*) + basic_machine=tic55x-`echo $basic_machine | sed 's/^[^-]*-//'` + ;; + c6x-*) + basic_machine=tic6x-`echo $basic_machine | sed 's/^[^-]*-//'` + ;; + c90) + basic_machine=c90-cray + os=-unicos + ;; + cegcc) + basic_machine=arm-unknown + os=-cegcc + ;; + convex-c1) + basic_machine=c1-convex + os=-bsd + ;; + convex-c2) + basic_machine=c2-convex + os=-bsd + ;; + convex-c32) + basic_machine=c32-convex + os=-bsd + ;; + convex-c34) + basic_machine=c34-convex + os=-bsd + ;; + convex-c38) + basic_machine=c38-convex + os=-bsd + ;; + cray | j90) + basic_machine=j90-cray + os=-unicos + ;; + craynv) + basic_machine=craynv-cray + os=-unicosmp + ;; + cr16 | cr16-*) + basic_machine=cr16-unknown + os=-elf + ;; + crds | unos) + basic_machine=m68k-crds + ;; + crisv32 | crisv32-* | etraxfs*) + basic_machine=crisv32-axis + ;; + cris | cris-* | etrax*) + basic_machine=cris-axis + ;; + crx) + basic_machine=crx-unknown + os=-elf + ;; + da30 | da30-*) + basic_machine=m68k-da30 + ;; + decstation | decstation-3100 | pmax | pmax-* | pmin | dec3100 | decstatn) + basic_machine=mips-dec + ;; + decsystem10* | dec10*) + basic_machine=pdp10-dec + os=-tops10 + ;; + decsystem20* | dec20*) + basic_machine=pdp10-dec + os=-tops20 + ;; + delta | 3300 | motorola-3300 | motorola-delta \ + | 3300-motorola | delta-motorola) + basic_machine=m68k-motorola + ;; + delta88) + basic_machine=m88k-motorola + os=-sysv3 + ;; + dicos) + basic_machine=i686-pc + os=-dicos + ;; + djgpp) + basic_machine=i586-pc + os=-msdosdjgpp + ;; + dpx20 | dpx20-*) + basic_machine=rs6000-bull + os=-bosx + ;; + dpx2* | dpx2*-bull) + basic_machine=m68k-bull + os=-sysv3 + ;; + ebmon29k) + basic_machine=a29k-amd + os=-ebmon + ;; + elxsi) + basic_machine=elxsi-elxsi + os=-bsd + ;; + encore | umax | mmax) + basic_machine=ns32k-encore + ;; + es1800 | OSE68k | ose68k | ose | OSE) + basic_machine=m68k-ericsson + os=-ose + ;; + fx2800) + basic_machine=i860-alliant + ;; + genix) + basic_machine=ns32k-ns + ;; + gmicro) + basic_machine=tron-gmicro + os=-sysv + ;; + go32) + basic_machine=i386-pc + os=-go32 + ;; + h3050r* | hiux*) + basic_machine=hppa1.1-hitachi + os=-hiuxwe2 + ;; + h8300hms) + basic_machine=h8300-hitachi + os=-hms + ;; + h8300xray) + basic_machine=h8300-hitachi + os=-xray + ;; + h8500hms) + basic_machine=h8500-hitachi + os=-hms + ;; + harris) + basic_machine=m88k-harris + os=-sysv3 + ;; + hp300-*) + basic_machine=m68k-hp + ;; + hp300bsd) + basic_machine=m68k-hp + os=-bsd + ;; + hp300hpux) + basic_machine=m68k-hp + os=-hpux + ;; + hp3k9[0-9][0-9] | hp9[0-9][0-9]) + basic_machine=hppa1.0-hp + ;; + hp9k2[0-9][0-9] | hp9k31[0-9]) + basic_machine=m68000-hp + ;; + hp9k3[2-9][0-9]) + basic_machine=m68k-hp + ;; + hp9k6[0-9][0-9] | hp6[0-9][0-9]) + basic_machine=hppa1.0-hp + ;; + hp9k7[0-79][0-9] | hp7[0-79][0-9]) + basic_machine=hppa1.1-hp + ;; + hp9k78[0-9] | hp78[0-9]) + # FIXME: really hppa2.0-hp + basic_machine=hppa1.1-hp + ;; + hp9k8[67]1 | hp8[67]1 | hp9k80[24] | hp80[24] | hp9k8[78]9 | hp8[78]9 | hp9k893 | hp893) + # FIXME: really hppa2.0-hp + basic_machine=hppa1.1-hp + ;; + hp9k8[0-9][13679] | hp8[0-9][13679]) + basic_machine=hppa1.1-hp + ;; + hp9k8[0-9][0-9] | hp8[0-9][0-9]) + basic_machine=hppa1.0-hp + ;; + hppa-next) + os=-nextstep3 + ;; + hppaosf) + basic_machine=hppa1.1-hp + os=-osf + ;; + hppro) + basic_machine=hppa1.1-hp + os=-proelf + ;; + i370-ibm* | ibm*) + basic_machine=i370-ibm + ;; + i*86v32) + basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` + os=-sysv32 + ;; + i*86v4*) + basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` + os=-sysv4 + ;; + i*86v) + basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` + os=-sysv + ;; + i*86sol2) + basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` + os=-solaris2 + ;; + i386mach) + basic_machine=i386-mach + os=-mach + ;; + i386-vsta | vsta) + basic_machine=i386-unknown + os=-vsta + ;; + iris | iris4d) + basic_machine=mips-sgi + case $os in + -irix*) + ;; + *) + os=-irix4 + ;; + esac + ;; + isi68 | isi) + basic_machine=m68k-isi + os=-sysv + ;; + leon-*|leon[3-9]-*) + basic_machine=sparc-`echo $basic_machine | sed 's/-.*//'` + ;; + m68knommu) + basic_machine=m68k-unknown + os=-linux + ;; + m68knommu-*) + basic_machine=m68k-`echo $basic_machine | sed 's/^[^-]*-//'` + os=-linux + ;; + m88k-omron*) + basic_machine=m88k-omron + ;; + magnum | m3230) + basic_machine=mips-mips + os=-sysv + ;; + merlin) + basic_machine=ns32k-utek + os=-sysv + ;; + microblaze*) + basic_machine=microblaze-xilinx + ;; + mingw64) + basic_machine=x86_64-pc + os=-mingw64 + ;; + mingw32) + basic_machine=i686-pc + os=-mingw32 + ;; + mingw32ce) + basic_machine=arm-unknown + os=-mingw32ce + ;; + miniframe) + basic_machine=m68000-convergent + ;; + *mint | -mint[0-9]* | *MiNT | *MiNT[0-9]*) + basic_machine=m68k-atari + os=-mint + ;; + mips3*-*) + basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'` + ;; + mips3*) + basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'`-unknown + ;; + monitor) + basic_machine=m68k-rom68k + os=-coff + ;; + morphos) + basic_machine=powerpc-unknown + os=-morphos + ;; + moxiebox) + basic_machine=moxie-unknown + os=-moxiebox + ;; + msdos) + basic_machine=i386-pc + os=-msdos + ;; + ms1-*) + basic_machine=`echo $basic_machine | sed -e 's/ms1-/mt-/'` + ;; + msys) + basic_machine=i686-pc + os=-msys + ;; + mvs) + basic_machine=i370-ibm + os=-mvs + ;; + nacl) + basic_machine=le32-unknown + os=-nacl + ;; + ncr3000) + basic_machine=i486-ncr + os=-sysv4 + ;; + netbsd386) + basic_machine=i386-unknown + os=-netbsd + ;; + netwinder) + basic_machine=armv4l-rebel + os=-linux + ;; + news | news700 | news800 | news900) + basic_machine=m68k-sony + os=-newsos + ;; + news1000) + basic_machine=m68030-sony + os=-newsos + ;; + news-3600 | risc-news) + basic_machine=mips-sony + os=-newsos + ;; + necv70) + basic_machine=v70-nec + os=-sysv + ;; + next | m*-next ) + basic_machine=m68k-next + case $os in + -nextstep* ) + ;; + -ns2*) + os=-nextstep2 + ;; + *) + os=-nextstep3 + ;; + esac + ;; + nh3000) + basic_machine=m68k-harris + os=-cxux + ;; + nh[45]000) + basic_machine=m88k-harris + os=-cxux + ;; + nindy960) + basic_machine=i960-intel + os=-nindy + ;; + mon960) + basic_machine=i960-intel + os=-mon960 + ;; + nonstopux) + basic_machine=mips-compaq + os=-nonstopux + ;; + np1) + basic_machine=np1-gould + ;; + neo-tandem) + basic_machine=neo-tandem + ;; + nse-tandem) + basic_machine=nse-tandem + ;; + nsr-tandem) + basic_machine=nsr-tandem + ;; + op50n-* | op60c-*) + basic_machine=hppa1.1-oki + os=-proelf + ;; + openrisc | openrisc-*) + basic_machine=or32-unknown + ;; + os400) + basic_machine=powerpc-ibm + os=-os400 + ;; + OSE68000 | ose68000) + basic_machine=m68000-ericsson + os=-ose + ;; + os68k) + basic_machine=m68k-none + os=-os68k + ;; + pa-hitachi) + basic_machine=hppa1.1-hitachi + os=-hiuxwe2 + ;; + paragon) + basic_machine=i860-intel + os=-osf + ;; + parisc) + basic_machine=hppa-unknown + os=-linux + ;; + parisc-*) + basic_machine=hppa-`echo $basic_machine | sed 's/^[^-]*-//'` + os=-linux + ;; + pbd) + basic_machine=sparc-tti + ;; + pbb) + basic_machine=m68k-tti + ;; + pc532 | pc532-*) + basic_machine=ns32k-pc532 + ;; + pc98) + basic_machine=i386-pc + ;; + pc98-*) + basic_machine=i386-`echo $basic_machine | sed 's/^[^-]*-//'` + ;; + pentium | p5 | k5 | k6 | nexgen | viac3) + basic_machine=i586-pc + ;; + pentiumpro | p6 | 6x86 | athlon | athlon_*) + basic_machine=i686-pc + ;; + pentiumii | pentium2 | pentiumiii | pentium3) + basic_machine=i686-pc + ;; + pentium4) + basic_machine=i786-pc + ;; + pentium-* | p5-* | k5-* | k6-* | nexgen-* | viac3-*) + basic_machine=i586-`echo $basic_machine | sed 's/^[^-]*-//'` + ;; + pentiumpro-* | p6-* | 6x86-* | athlon-*) + basic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'` + ;; + pentiumii-* | pentium2-* | pentiumiii-* | pentium3-*) + basic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'` + ;; + pentium4-*) + basic_machine=i786-`echo $basic_machine | sed 's/^[^-]*-//'` + ;; + pn) + basic_machine=pn-gould + ;; + power) basic_machine=power-ibm + ;; + ppc | ppcbe) basic_machine=powerpc-unknown + ;; + ppc-* | ppcbe-*) + basic_machine=powerpc-`echo $basic_machine | sed 's/^[^-]*-//'` + ;; + ppcle | powerpclittle | ppc-le | powerpc-little) + basic_machine=powerpcle-unknown + ;; + ppcle-* | powerpclittle-*) + basic_machine=powerpcle-`echo $basic_machine | sed 's/^[^-]*-//'` + ;; + ppc64) basic_machine=powerpc64-unknown + ;; + ppc64-*) basic_machine=powerpc64-`echo $basic_machine | sed 's/^[^-]*-//'` + ;; + ppc64le | powerpc64little | ppc64-le | powerpc64-little) + basic_machine=powerpc64le-unknown + ;; + ppc64le-* | powerpc64little-*) + basic_machine=powerpc64le-`echo $basic_machine | sed 's/^[^-]*-//'` + ;; + ps2) + basic_machine=i386-ibm + ;; + pw32) + basic_machine=i586-unknown + os=-pw32 + ;; + rdos | rdos64) + basic_machine=x86_64-pc + os=-rdos + ;; + rdos32) + basic_machine=i386-pc + os=-rdos + ;; + rom68k) + basic_machine=m68k-rom68k + os=-coff + ;; + rm[46]00) + basic_machine=mips-siemens + ;; + rtpc | rtpc-*) + basic_machine=romp-ibm + ;; + s390 | s390-*) + basic_machine=s390-ibm + ;; + s390x | s390x-*) + basic_machine=s390x-ibm + ;; + sa29200) + basic_machine=a29k-amd + os=-udi + ;; + sb1) + basic_machine=mipsisa64sb1-unknown + ;; + sb1el) + basic_machine=mipsisa64sb1el-unknown + ;; + sde) + basic_machine=mipsisa32-sde + os=-elf + ;; + sei) + basic_machine=mips-sei + os=-seiux + ;; + sequent) + basic_machine=i386-sequent + ;; + sh) + basic_machine=sh-hitachi + os=-hms + ;; + sh5el) + basic_machine=sh5le-unknown + ;; + sh64) + basic_machine=sh64-unknown + ;; + sparclite-wrs | simso-wrs) + basic_machine=sparclite-wrs + os=-vxworks + ;; + sps7) + basic_machine=m68k-bull + os=-sysv2 + ;; + spur) + basic_machine=spur-unknown + ;; + st2000) + basic_machine=m68k-tandem + ;; + stratus) + basic_machine=i860-stratus + os=-sysv4 + ;; + strongarm-* | thumb-*) + basic_machine=arm-`echo $basic_machine | sed 's/^[^-]*-//'` + ;; + sun2) + basic_machine=m68000-sun + ;; + sun2os3) + basic_machine=m68000-sun + os=-sunos3 + ;; + sun2os4) + basic_machine=m68000-sun + os=-sunos4 + ;; + sun3os3) + basic_machine=m68k-sun + os=-sunos3 + ;; + sun3os4) + basic_machine=m68k-sun + os=-sunos4 + ;; + sun4os3) + basic_machine=sparc-sun + os=-sunos3 + ;; + sun4os4) + basic_machine=sparc-sun + os=-sunos4 + ;; + sun4sol2) + basic_machine=sparc-sun + os=-solaris2 + ;; + sun3 | sun3-*) + basic_machine=m68k-sun + ;; + sun4) + basic_machine=sparc-sun + ;; + sun386 | sun386i | roadrunner) + basic_machine=i386-sun + ;; + sv1) + basic_machine=sv1-cray + os=-unicos + ;; + symmetry) + basic_machine=i386-sequent + os=-dynix + ;; + t3e) + basic_machine=alphaev5-cray + os=-unicos + ;; + t90) + basic_machine=t90-cray + os=-unicos + ;; + tile*) + basic_machine=$basic_machine-unknown + os=-linux-gnu + ;; + tx39) + basic_machine=mipstx39-unknown + ;; + tx39el) + basic_machine=mipstx39el-unknown + ;; + toad1) + basic_machine=pdp10-xkl + os=-tops20 + ;; + tower | tower-32) + basic_machine=m68k-ncr + ;; + tpf) + basic_machine=s390x-ibm + os=-tpf + ;; + udi29k) + basic_machine=a29k-amd + os=-udi + ;; + ultra3) + basic_machine=a29k-nyu + os=-sym1 + ;; + v810 | necv810) + basic_machine=v810-nec + os=-none + ;; + vaxv) + basic_machine=vax-dec + os=-sysv + ;; + vms) + basic_machine=vax-dec + os=-vms + ;; + vpp*|vx|vx-*) + basic_machine=f301-fujitsu + ;; + vxworks960) + basic_machine=i960-wrs + os=-vxworks + ;; + vxworks68) + basic_machine=m68k-wrs + os=-vxworks + ;; + vxworks29k) + basic_machine=a29k-wrs + os=-vxworks + ;; + w65*) + basic_machine=w65-wdc + os=-none + ;; + w89k-*) + basic_machine=hppa1.1-winbond + os=-proelf + ;; + xbox) + basic_machine=i686-pc + os=-mingw32 + ;; + xps | xps100) + basic_machine=xps100-honeywell + ;; + xscale-* | xscalee[bl]-*) + basic_machine=`echo $basic_machine | sed 's/^xscale/arm/'` + ;; + ymp) + basic_machine=ymp-cray + os=-unicos + ;; + z8k-*-coff) + basic_machine=z8k-unknown + os=-sim + ;; + z80-*-coff) + basic_machine=z80-unknown + os=-sim + ;; + none) + basic_machine=none-none + os=-none + ;; + +# Here we handle the default manufacturer of certain CPU types. It is in +# some cases the only manufacturer, in others, it is the most popular. + w89k) + basic_machine=hppa1.1-winbond + ;; + op50n) + basic_machine=hppa1.1-oki + ;; + op60c) + basic_machine=hppa1.1-oki + ;; + romp) + basic_machine=romp-ibm + ;; + mmix) + basic_machine=mmix-knuth + ;; + rs6000) + basic_machine=rs6000-ibm + ;; + vax) + basic_machine=vax-dec + ;; + pdp10) + # there are many clones, so DEC is not a safe bet + basic_machine=pdp10-unknown + ;; + pdp11) + basic_machine=pdp11-dec + ;; + we32k) + basic_machine=we32k-att + ;; + sh[1234] | sh[24]a | sh[24]aeb | sh[34]eb | sh[1234]le | sh[23]ele) + basic_machine=sh-unknown + ;; + sparc | sparcv8 | sparcv9 | sparcv9b | sparcv9v) + basic_machine=sparc-sun + ;; + cydra) + basic_machine=cydra-cydrome + ;; + orion) + basic_machine=orion-highlevel + ;; + orion105) + basic_machine=clipper-highlevel + ;; + mac | mpw | mac-mpw) + basic_machine=m68k-apple + ;; + pmac | pmac-mpw) + basic_machine=powerpc-apple + ;; + *-unknown) + # Make sure to match an already-canonicalized machine name. + ;; + *) + echo Invalid configuration \`$1\': machine \`$basic_machine\' not recognized 1>&2 + exit 1 + ;; +esac + +# Here we canonicalize certain aliases for manufacturers. +case $basic_machine in + *-digital*) + basic_machine=`echo $basic_machine | sed 's/digital.*/dec/'` + ;; + *-commodore*) + basic_machine=`echo $basic_machine | sed 's/commodore.*/cbm/'` + ;; + *) + ;; +esac + +# Decode manufacturer-specific aliases for certain operating systems. + +if [ x"$os" != x"" ] +then +case $os in + # First match some system type aliases + # that might get confused with valid system types. + # -solaris* is a basic system type, with this one exception. + -auroraux) + os=-auroraux + ;; + -solaris1 | -solaris1.*) + os=`echo $os | sed -e 's|solaris1|sunos4|'` + ;; + -solaris) + os=-solaris2 + ;; + -svr4*) + os=-sysv4 + ;; + -unixware*) + os=-sysv4.2uw + ;; + -gnu/linux*) + os=`echo $os | sed -e 's|gnu/linux|linux-gnu|'` + ;; + # First accept the basic system types. + # The portable systems comes first. + # Each alternative MUST END IN A *, to match a version number. + # -sysv* is not here because it comes later, after sysvr4. + -gnu* | -bsd* | -mach* | -minix* | -genix* | -ultrix* | -irix* \ + | -*vms* | -sco* | -esix* | -isc* | -aix* | -cnk* | -sunos | -sunos[34]*\ + | -hpux* | -unos* | -osf* | -luna* | -dgux* | -auroraux* | -solaris* \ + | -sym* | -kopensolaris* | -plan9* \ + | -amigaos* | -amigados* | -msdos* | -newsos* | -unicos* | -aof* \ + | -aos* | -aros* | -cloudabi* | -sortix* \ + | -nindy* | -vxsim* | -vxworks* | -ebmon* | -hms* | -mvs* \ + | -clix* | -riscos* | -uniplus* | -iris* | -rtu* | -xenix* \ + | -hiux* | -386bsd* | -knetbsd* | -mirbsd* | -netbsd* \ + | -bitrig* | -openbsd* | -solidbsd* \ + | -ekkobsd* | -kfreebsd* | -freebsd* | -riscix* | -lynxos* \ + | -bosx* | -nextstep* | -cxux* | -aout* | -elf* | -oabi* \ + | -ptx* | -coff* | -ecoff* | -winnt* | -domain* | -vsta* \ + | -udi* | -eabi* | -lites* | -ieee* | -go32* | -aux* \ + | -chorusos* | -chorusrdb* | -cegcc* \ + | -cygwin* | -msys* | -pe* | -psos* | -moss* | -proelf* | -rtems* \ + | -mingw32* | -mingw64* | -linux-gnu* | -linux-android* \ + | -linux-newlib* | -linux-musl* | -linux-uclibc* \ + | -uxpv* | -beos* | -mpeix* | -udk* | -moxiebox* \ + | -interix* | -uwin* | -mks* | -rhapsody* | -darwin* | -opened* \ + | -openstep* | -oskit* | -conix* | -pw32* | -nonstopux* \ + | -storm-chaos* | -tops10* | -tenex* | -tops20* | -its* \ + | -os2* | -vos* | -palmos* | -uclinux* | -nucleus* \ + | -morphos* | -superux* | -rtmk* | -rtmk-nova* | -windiss* \ + | -powermax* | -dnix* | -nx6 | -nx7 | -sei* | -dragonfly* \ + | -skyos* | -haiku* | -rdos* | -toppers* | -drops* | -es* | -tirtos*) + # Remember, each alternative MUST END IN *, to match a version number. + ;; + -qnx*) + case $basic_machine in + x86-* | i*86-*) + ;; + *) + os=-nto$os + ;; + esac + ;; + -nto-qnx*) + ;; + -nto*) + os=`echo $os | sed -e 's|nto|nto-qnx|'` + ;; + -sim | -es1800* | -hms* | -xray | -os68k* | -none* | -v88r* \ + | -windows* | -osx | -abug | -netware* | -os9* | -beos* | -haiku* \ + | -macos* | -mpw* | -magic* | -mmixware* | -mon960* | -lnews*) + ;; + -mac*) + os=`echo $os | sed -e 's|mac|macos|'` + ;; + -linux-dietlibc) + os=-linux-dietlibc + ;; + -linux*) + os=`echo $os | sed -e 's|linux|linux-gnu|'` + ;; + -sunos5*) + os=`echo $os | sed -e 's|sunos5|solaris2|'` + ;; + -sunos6*) + os=`echo $os | sed -e 's|sunos6|solaris3|'` + ;; + -opened*) + os=-openedition + ;; + -os400*) + os=-os400 + ;; + -wince*) + os=-wince + ;; + -osfrose*) + os=-osfrose + ;; + -osf*) + os=-osf + ;; + -utek*) + os=-bsd + ;; + -dynix*) + os=-bsd + ;; + -acis*) + os=-aos + ;; + -atheos*) + os=-atheos + ;; + -syllable*) + os=-syllable + ;; + -386bsd) + os=-bsd + ;; + -ctix* | -uts*) + os=-sysv + ;; + -nova*) + os=-rtmk-nova + ;; + -ns2 ) + os=-nextstep2 + ;; + -nsk*) + os=-nsk + ;; + # Preserve the version number of sinix5. + -sinix5.*) + os=`echo $os | sed -e 's|sinix|sysv|'` + ;; + -sinix*) + os=-sysv4 + ;; + -tpf*) + os=-tpf + ;; + -triton*) + os=-sysv3 + ;; + -oss*) + os=-sysv3 + ;; + -svr4) + os=-sysv4 + ;; + -svr3) + os=-sysv3 + ;; + -sysvr4) + os=-sysv4 + ;; + # This must come after -sysvr4. + -sysv*) + ;; + -ose*) + os=-ose + ;; + -es1800*) + os=-ose + ;; + -xenix) + os=-xenix + ;; + -*mint | -mint[0-9]* | -*MiNT | -MiNT[0-9]*) + os=-mint + ;; + -aros*) + os=-aros + ;; + -zvmoe) + os=-zvmoe + ;; + -dicos*) + os=-dicos + ;; + -nacl*) + ;; + -none) + ;; + *) + # Get rid of the `-' at the beginning of $os. + os=`echo $os | sed 's/[^-]*-//'` + echo Invalid configuration \`$1\': system \`$os\' not recognized 1>&2 + exit 1 + ;; +esac +else + +# Here we handle the default operating systems that come with various machines. +# The value should be what the vendor currently ships out the door with their +# machine or put another way, the most popular os provided with the machine. + +# Note that if you're going to try to match "-MANUFACTURER" here (say, +# "-sun"), then you have to tell the case statement up towards the top +# that MANUFACTURER isn't an operating system. Otherwise, code above +# will signal an error saying that MANUFACTURER isn't an operating +# system, and we'll never get to this point. + +case $basic_machine in + score-*) + os=-elf + ;; + spu-*) + os=-elf + ;; + *-acorn) + os=-riscix1.2 + ;; + arm*-rebel) + os=-linux + ;; + arm*-semi) + os=-aout + ;; + c4x-* | tic4x-*) + os=-coff + ;; + c8051-*) + os=-elf + ;; + hexagon-*) + os=-elf + ;; + tic54x-*) + os=-coff + ;; + tic55x-*) + os=-coff + ;; + tic6x-*) + os=-coff + ;; + # This must come before the *-dec entry. + pdp10-*) + os=-tops20 + ;; + pdp11-*) + os=-none + ;; + *-dec | vax-*) + os=-ultrix4.2 + ;; + m68*-apollo) + os=-domain + ;; + i386-sun) + os=-sunos4.0.2 + ;; + m68000-sun) + os=-sunos3 + ;; + m68*-cisco) + os=-aout + ;; + mep-*) + os=-elf + ;; + mips*-cisco) + os=-elf + ;; + mips*-*) + os=-elf + ;; + or32-*) + os=-coff + ;; + *-tti) # must be before sparc entry or we get the wrong os. + os=-sysv3 + ;; + sparc-* | *-sun) + os=-sunos4.1.1 + ;; + *-be) + os=-beos + ;; + *-haiku) + os=-haiku + ;; + *-ibm) + os=-aix + ;; + *-knuth) + os=-mmixware + ;; + *-wec) + os=-proelf + ;; + *-winbond) + os=-proelf + ;; + *-oki) + os=-proelf + ;; + *-hp) + os=-hpux + ;; + *-hitachi) + os=-hiux + ;; + i860-* | *-att | *-ncr | *-altos | *-motorola | *-convergent) + os=-sysv + ;; + *-cbm) + os=-amigaos + ;; + *-dg) + os=-dgux + ;; + *-dolphin) + os=-sysv3 + ;; + m68k-ccur) + os=-rtu + ;; + m88k-omron*) + os=-luna + ;; + *-next ) + os=-nextstep + ;; + *-sequent) + os=-ptx + ;; + *-crds) + os=-unos + ;; + *-ns) + os=-genix + ;; + i370-*) + os=-mvs + ;; + *-next) + os=-nextstep3 + ;; + *-gould) + os=-sysv + ;; + *-highlevel) + os=-bsd + ;; + *-encore) + os=-bsd + ;; + *-sgi) + os=-irix + ;; + *-siemens) + os=-sysv4 + ;; + *-masscomp) + os=-rtu + ;; + f30[01]-fujitsu | f700-fujitsu) + os=-uxpv + ;; + *-rom68k) + os=-coff + ;; + *-*bug) + os=-coff + ;; + *-apple) + os=-macos + ;; + *-atari*) + os=-mint + ;; + *) + os=-none + ;; +esac +fi + +# Here we handle the case where we know the os, and the CPU type, but not the +# manufacturer. We pick the logical manufacturer. +vendor=unknown +case $basic_machine in + *-unknown) + case $os in + -riscix*) + vendor=acorn + ;; + -sunos*) + vendor=sun + ;; + -cnk*|-aix*) + vendor=ibm + ;; + -beos*) + vendor=be + ;; + -hpux*) + vendor=hp + ;; + -mpeix*) + vendor=hp + ;; + -hiux*) + vendor=hitachi + ;; + -unos*) + vendor=crds + ;; + -dgux*) + vendor=dg + ;; + -luna*) + vendor=omron + ;; + -genix*) + vendor=ns + ;; + -mvs* | -opened*) + vendor=ibm + ;; + -os400*) + vendor=ibm + ;; + -ptx*) + vendor=sequent + ;; + -tpf*) + vendor=ibm + ;; + -vxsim* | -vxworks* | -windiss*) + vendor=wrs + ;; + -aux*) + vendor=apple + ;; + -hms*) + vendor=hitachi + ;; + -mpw* | -macos*) + vendor=apple + ;; + -*mint | -mint[0-9]* | -*MiNT | -MiNT[0-9]*) + vendor=atari + ;; + -vos*) + vendor=stratus + ;; + esac + basic_machine=`echo $basic_machine | sed "s/unknown/$vendor/"` + ;; +esac + +echo $basic_machine$os +exit + +# Local variables: +# eval: (add-hook 'write-file-hooks 'time-stamp) +# time-stamp-start: "timestamp='" +# time-stamp-format: "%:y-%02m-%02d" +# time-stamp-end: "'" +# End: diff -Nru filtergen-0.12.4/configure filtergen-0.12.7/configure --- filtergen-0.12.4/configure 2016-02-18 07:59:36.000000000 +0000 +++ filtergen-0.12.7/configure 2016-02-13 10:53:03.000000000 +0000 @@ -1,83 +1,462 @@ #! /bin/sh # Guess values for system-dependent variables and create Makefiles. -# Generated by GNU Autoconf 2.59 for filtergen 0.12.4. +# Generated by GNU Autoconf 2.69 for filtergen 0.12.7. # # Report bugs to . # -# Copyright (C) 2003 Free Software Foundation, Inc. +# +# Copyright (C) 1992-1996, 1998-2012 Free Software Foundation, Inc. +# +# # This configure script is free software; the Free Software Foundation # gives unlimited permission to copy, distribute and modify it. -## --------------------- ## -## M4sh Initialization. ## -## --------------------- ## +## -------------------- ## +## M4sh Initialization. ## +## -------------------- ## -# Be Bourne compatible -if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then +# Be more Bourne compatible +DUALCASE=1; export DUALCASE # for MKS sh +if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then : emulate sh NULLCMD=: - # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which + # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which # is contrary to our usage. Disable this feature. alias -g '${1+"$@"}'='"$@"' -elif test -n "${BASH_VERSION+set}" && (set -o posix) >/dev/null 2>&1; then - set -o posix + setopt NO_GLOB_SUBST +else + case `(set -o) 2>/dev/null` in #( + *posix*) : + set -o posix ;; #( + *) : + ;; +esac fi -DUALCASE=1; export DUALCASE # for MKS sh -# Support unset when possible. -if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then - as_unset=unset -else - as_unset=false + +as_nl=' +' +export as_nl +# Printing a long string crashes Solaris 7 /usr/bin/printf. +as_echo='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' +as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo +as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo$as_echo +# Prefer a ksh shell builtin over an external printf program on Solaris, +# but without wasting forks for bash or zsh. +if test -z "$BASH_VERSION$ZSH_VERSION" \ + && (test "X`print -r -- $as_echo`" = "X$as_echo") 2>/dev/null; then + as_echo='print -r --' + as_echo_n='print -rn --' +elif (test "X`printf %s $as_echo`" = "X$as_echo") 2>/dev/null; then + as_echo='printf %s\n' + as_echo_n='printf %s' +else + if test "X`(/usr/ucb/echo -n -n $as_echo) 2>/dev/null`" = "X-n $as_echo"; then + as_echo_body='eval /usr/ucb/echo -n "$1$as_nl"' + as_echo_n='/usr/ucb/echo -n' + else + as_echo_body='eval expr "X$1" : "X\\(.*\\)"' + as_echo_n_body='eval + arg=$1; + case $arg in #( + *"$as_nl"*) + expr "X$arg" : "X\\(.*\\)$as_nl"; + arg=`expr "X$arg" : ".*$as_nl\\(.*\\)"`;; + esac; + expr "X$arg" : "X\\(.*\\)" | tr -d "$as_nl" + ' + export as_echo_n_body + as_echo_n='sh -c $as_echo_n_body as_echo' + fi + export as_echo_body + as_echo='sh -c $as_echo_body as_echo' +fi + +# The user is always right. +if test "${PATH_SEPARATOR+set}" != set; then + PATH_SEPARATOR=: + (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && { + (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 || + PATH_SEPARATOR=';' + } fi -# Work around bugs in pre-3.0 UWIN ksh. -$as_unset ENV MAIL MAILPATH +# IFS +# We need space, tab and new line, in precisely that order. Quoting is +# there to prevent editors from complaining about space-tab. +# (If _AS_PATH_WALK were called with IFS unset, it would disable word +# splitting by setting IFS to empty value.) +IFS=" "" $as_nl" + +# Find who we are. Look in the path if we contain no directory separator. +as_myself= +case $0 in #(( + *[\\/]* ) as_myself=$0 ;; + *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break + done +IFS=$as_save_IFS + + ;; +esac +# We did not find ourselves, most probably we were run as `sh COMMAND' +# in which case we are not to be found in the path. +if test "x$as_myself" = x; then + as_myself=$0 +fi +if test ! -f "$as_myself"; then + $as_echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2 + exit 1 +fi + +# Unset variables that we do not need and which cause bugs (e.g. in +# pre-3.0 UWIN ksh). But do not cause bugs in bash 2.01; the "|| exit 1" +# suppresses any "Segmentation fault" message there. '((' could +# trigger a bug in pdksh 5.2.14. +for as_var in BASH_ENV ENV MAIL MAILPATH +do eval test x\${$as_var+set} = xset \ + && ( (unset $as_var) || exit 1) >/dev/null 2>&1 && unset $as_var || : +done PS1='$ ' PS2='> ' PS4='+ ' # NLS nuisances. -for as_var in \ - LANG LANGUAGE LC_ADDRESS LC_ALL LC_COLLATE LC_CTYPE LC_IDENTIFICATION \ - LC_MEASUREMENT LC_MESSAGES LC_MONETARY LC_NAME LC_NUMERIC LC_PAPER \ - LC_TELEPHONE LC_TIME +LC_ALL=C +export LC_ALL +LANGUAGE=C +export LANGUAGE + +# CDPATH. +(unset CDPATH) >/dev/null 2>&1 && unset CDPATH + +# Use a proper internal environment variable to ensure we don't fall + # into an infinite loop, continuously re-executing ourselves. + if test x"${_as_can_reexec}" != xno && test "x$CONFIG_SHELL" != x; then + _as_can_reexec=no; export _as_can_reexec; + # We cannot yet assume a decent shell, so we have to provide a +# neutralization value for shells without unset; and this also +# works around shells that cannot unset nonexistent variables. +# Preserve -v and -x to the replacement shell. +BASH_ENV=/dev/null +ENV=/dev/null +(unset BASH_ENV) >/dev/null 2>&1 && unset BASH_ENV ENV +case $- in # (((( + *v*x* | *x*v* ) as_opts=-vx ;; + *v* ) as_opts=-v ;; + *x* ) as_opts=-x ;; + * ) as_opts= ;; +esac +exec $CONFIG_SHELL $as_opts "$as_myself" ${1+"$@"} +# Admittedly, this is quite paranoid, since all the known shells bail +# out after a failed `exec'. +$as_echo "$0: could not re-execute with $CONFIG_SHELL" >&2 +as_fn_exit 255 + fi + # We don't want this to propagate to other subprocesses. + { _as_can_reexec=; unset _as_can_reexec;} +if test "x$CONFIG_SHELL" = x; then + as_bourne_compatible="if test -n \"\${ZSH_VERSION+set}\" && (emulate sh) >/dev/null 2>&1; then : + emulate sh + NULLCMD=: + # Pre-4.2 versions of Zsh do word splitting on \${1+\"\$@\"}, which + # is contrary to our usage. Disable this feature. + alias -g '\${1+\"\$@\"}'='\"\$@\"' + setopt NO_GLOB_SUBST +else + case \`(set -o) 2>/dev/null\` in #( + *posix*) : + set -o posix ;; #( + *) : + ;; +esac +fi +" + as_required="as_fn_return () { (exit \$1); } +as_fn_success () { as_fn_return 0; } +as_fn_failure () { as_fn_return 1; } +as_fn_ret_success () { return 0; } +as_fn_ret_failure () { return 1; } + +exitcode=0 +as_fn_success || { exitcode=1; echo as_fn_success failed.; } +as_fn_failure && { exitcode=1; echo as_fn_failure succeeded.; } +as_fn_ret_success || { exitcode=1; echo as_fn_ret_success failed.; } +as_fn_ret_failure && { exitcode=1; echo as_fn_ret_failure succeeded.; } +if ( set x; as_fn_ret_success y && test x = \"\$1\" ); then : + +else + exitcode=1; echo positional parameters were not saved. +fi +test x\$exitcode = x0 || exit 1 +test -x / || exit 1" + as_suggested=" as_lineno_1=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_1a=\$LINENO + as_lineno_2=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_2a=\$LINENO + eval 'test \"x\$as_lineno_1'\$as_run'\" != \"x\$as_lineno_2'\$as_run'\" && + test \"x\`expr \$as_lineno_1'\$as_run' + 1\`\" = \"x\$as_lineno_2'\$as_run'\"' || exit 1 +test \$(( 1 + 1 )) = 2 || exit 1" + if (eval "$as_required") 2>/dev/null; then : + as_have_required=yes +else + as_have_required=no +fi + if test x$as_have_required = xyes && (eval "$as_suggested") 2>/dev/null; then : + +else + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +as_found=false +for as_dir in /bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH do - if (set +x; test -z "`(eval $as_var=C; export $as_var) 2>&1`"); then - eval $as_var=C; export $as_var + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + as_found=: + case $as_dir in #( + /*) + for as_base in sh bash ksh sh5; do + # Try only shells that exist, to save several forks. + as_shell=$as_dir/$as_base + if { test -f "$as_shell" || test -f "$as_shell.exe"; } && + { $as_echo "$as_bourne_compatible""$as_required" | as_run=a "$as_shell"; } 2>/dev/null; then : + CONFIG_SHELL=$as_shell as_have_required=yes + if { $as_echo "$as_bourne_compatible""$as_suggested" | as_run=a "$as_shell"; } 2>/dev/null; then : + break 2 +fi +fi + done;; + esac + as_found=false +done +$as_found || { if { test -f "$SHELL" || test -f "$SHELL.exe"; } && + { $as_echo "$as_bourne_compatible""$as_required" | as_run=a "$SHELL"; } 2>/dev/null; then : + CONFIG_SHELL=$SHELL as_have_required=yes +fi; } +IFS=$as_save_IFS + + + if test "x$CONFIG_SHELL" != x; then : + export CONFIG_SHELL + # We cannot yet assume a decent shell, so we have to provide a +# neutralization value for shells without unset; and this also +# works around shells that cannot unset nonexistent variables. +# Preserve -v and -x to the replacement shell. +BASH_ENV=/dev/null +ENV=/dev/null +(unset BASH_ENV) >/dev/null 2>&1 && unset BASH_ENV ENV +case $- in # (((( + *v*x* | *x*v* ) as_opts=-vx ;; + *v* ) as_opts=-v ;; + *x* ) as_opts=-x ;; + * ) as_opts= ;; +esac +exec $CONFIG_SHELL $as_opts "$as_myself" ${1+"$@"} +# Admittedly, this is quite paranoid, since all the known shells bail +# out after a failed `exec'. +$as_echo "$0: could not re-execute with $CONFIG_SHELL" >&2 +exit 255 +fi + + if test x$as_have_required = xno; then : + $as_echo "$0: This script requires a shell more modern than all" + $as_echo "$0: the shells that I found on your system." + if test x${ZSH_VERSION+set} = xset ; then + $as_echo "$0: In particular, zsh $ZSH_VERSION has bugs and should" + $as_echo "$0: be upgraded to zsh 4.3.4 or later." else - $as_unset $as_var + $as_echo "$0: Please tell bug-autoconf@gnu.org and jaq@spacepants.org +$0: about your system, including any error possibly output +$0: before this message. Then install a modern shell, or +$0: manually run the script under such a shell if you do +$0: have one." fi -done + exit 1 +fi +fi +fi +SHELL=${CONFIG_SHELL-/bin/sh} +export SHELL +# Unset more variables known to interfere with behavior of common tools. +CLICOLOR_FORCE= GREP_OPTIONS= +unset CLICOLOR_FORCE GREP_OPTIONS + +## --------------------- ## +## M4sh Shell Functions. ## +## --------------------- ## +# as_fn_unset VAR +# --------------- +# Portably unset VAR. +as_fn_unset () +{ + { eval $1=; unset $1;} +} +as_unset=as_fn_unset + +# as_fn_set_status STATUS +# ----------------------- +# Set $? to STATUS, without forking. +as_fn_set_status () +{ + return $1 +} # as_fn_set_status + +# as_fn_exit STATUS +# ----------------- +# Exit the shell with STATUS, even in a "trap 0" or "set -e" context. +as_fn_exit () +{ + set +e + as_fn_set_status $1 + exit $1 +} # as_fn_exit + +# as_fn_mkdir_p +# ------------- +# Create "$as_dir" as a directory, including parents if necessary. +as_fn_mkdir_p () +{ + + case $as_dir in #( + -*) as_dir=./$as_dir;; + esac + test -d "$as_dir" || eval $as_mkdir_p || { + as_dirs= + while :; do + case $as_dir in #( + *\'*) as_qdir=`$as_echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'( + *) as_qdir=$as_dir;; + esac + as_dirs="'$as_qdir' $as_dirs" + as_dir=`$as_dirname -- "$as_dir" || +$as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$as_dir" : 'X\(//\)[^/]' \| \ + X"$as_dir" : 'X\(//\)$' \| \ + X"$as_dir" : 'X\(/\)' \| . 2>/dev/null || +$as_echo X"$as_dir" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ + s//\1/ + q + } + /^X\(\/\/\)[^/].*/{ + s//\1/ + q + } + /^X\(\/\/\)$/{ + s//\1/ + q + } + /^X\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q'` + test -d "$as_dir" && break + done + test -z "$as_dirs" || eval "mkdir $as_dirs" + } || test -d "$as_dir" || as_fn_error $? "cannot create directory $as_dir" + + +} # as_fn_mkdir_p + +# as_fn_executable_p FILE +# ----------------------- +# Test if FILE is an executable regular file. +as_fn_executable_p () +{ + test -f "$1" && test -x "$1" +} # as_fn_executable_p +# as_fn_append VAR VALUE +# ---------------------- +# Append the text in VALUE to the end of the definition contained in VAR. Take +# advantage of any shell optimizations that allow amortized linear growth over +# repeated appends, instead of the typical quadratic growth present in naive +# implementations. +if (eval "as_var=1; as_var+=2; test x\$as_var = x12") 2>/dev/null; then : + eval 'as_fn_append () + { + eval $1+=\$2 + }' +else + as_fn_append () + { + eval $1=\$$1\$2 + } +fi # as_fn_append + +# as_fn_arith ARG... +# ------------------ +# Perform arithmetic evaluation on the ARGs, and store the result in the +# global $as_val. Take advantage of shells that can avoid forks. The arguments +# must be portable across $(()) and expr. +if (eval "test \$(( 1 + 1 )) = 2") 2>/dev/null; then : + eval 'as_fn_arith () + { + as_val=$(( $* )) + }' +else + as_fn_arith () + { + as_val=`expr "$@" || test $? -eq 1` + } +fi # as_fn_arith + -# Required to use basename. -if expr a : '\(a\)' >/dev/null 2>&1; then +# as_fn_error STATUS ERROR [LINENO LOG_FD] +# ---------------------------------------- +# Output "`basename $0`: error: ERROR" to stderr. If LINENO and LOG_FD are +# provided, also output the error to LOG_FD, referencing LINENO. Then exit the +# script with STATUS, using 1 if that was 0. +as_fn_error () +{ + as_status=$1; test $as_status -eq 0 && as_status=1 + if test "$4"; then + as_lineno=${as_lineno-"$3"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + $as_echo "$as_me:${as_lineno-$LINENO}: error: $2" >&$4 + fi + $as_echo "$as_me: error: $2" >&2 + as_fn_exit $as_status +} # as_fn_error + +if expr a : '\(a\)' >/dev/null 2>&1 && + test "X`expr 00001 : '.*\(...\)'`" = X001; then as_expr=expr else as_expr=false fi -if (basename /) >/dev/null 2>&1 && test "X`basename / 2>&1`" = "X/"; then +if (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; then as_basename=basename else as_basename=false fi +if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then + as_dirname=dirname +else + as_dirname=false +fi -# Name of the executable. -as_me=`$as_basename "$0" || +as_me=`$as_basename -- "$0" || $as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ X"$0" : 'X\(//\)$' \| \ - X"$0" : 'X\(/\)$' \| \ - . : '\(.\)' 2>/dev/null || -echo X/"$0" | - sed '/^.*\/\([^/][^/]*\)\/*$/{ s//\1/; q; } - /^X\/\(\/\/\)$/{ s//\1/; q; } - /^X\/\(\/\).*/{ s//\1/; q; } - s/.*/./; q'` + X"$0" : 'X\(/\)' \| . 2>/dev/null || +$as_echo X/"$0" | + sed '/^.*\/\([^/][^/]*\)\/*$/{ + s//\1/ + q + } + /^X\/\(\/\/\)$/{ + s//\1/ + q + } + /^X\/\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q'` - -# PATH needs CR, and LINENO needs CR and PATH. # Avoid depending upon Character Ranges. as_cr_letters='abcdefghijklmnopqrstuvwxyz' as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ' @@ -85,146 +464,91 @@ as_cr_digits='0123456789' as_cr_alnum=$as_cr_Letters$as_cr_digits -# The user is always right. -if test "${PATH_SEPARATOR+set}" != set; then - echo "#! /bin/sh" >conf$$.sh - echo "exit 0" >>conf$$.sh - chmod +x conf$$.sh - if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then - PATH_SEPARATOR=';' - else - PATH_SEPARATOR=: - fi - rm -f conf$$.sh -fi - - - as_lineno_1=$LINENO - as_lineno_2=$LINENO - as_lineno_3=`(expr $as_lineno_1 + 1) 2>/dev/null` - test "x$as_lineno_1" != "x$as_lineno_2" && - test "x$as_lineno_3" = "x$as_lineno_2" || { - # Find who we are. Look in the path if we contain no path at all - # relative or not. - case $0 in - *[\\/]* ) as_myself=$0 ;; - *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break -done - - ;; - esac - # We did not find ourselves, most probably we were run as `sh COMMAND' - # in which case we are not to be found in the path. - if test "x$as_myself" = x; then - as_myself=$0 - fi - if test ! -f "$as_myself"; then - { echo "$as_me: error: cannot find myself; rerun with an absolute path" >&2 - { (exit 1); exit 1; }; } - fi - case $CONFIG_SHELL in - '') - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in /bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for as_base in sh bash ksh sh5; do - case $as_dir in - /*) - if ("$as_dir/$as_base" -c ' - as_lineno_1=$LINENO - as_lineno_2=$LINENO - as_lineno_3=`(expr $as_lineno_1 + 1) 2>/dev/null` - test "x$as_lineno_1" != "x$as_lineno_2" && - test "x$as_lineno_3" = "x$as_lineno_2" ') 2>/dev/null; then - $as_unset BASH_ENV || test "${BASH_ENV+set}" != set || { BASH_ENV=; export BASH_ENV; } - $as_unset ENV || test "${ENV+set}" != set || { ENV=; export ENV; } - CONFIG_SHELL=$as_dir/$as_base - export CONFIG_SHELL - exec "$CONFIG_SHELL" "$0" ${1+"$@"} - fi;; - esac - done -done -;; - esac - # Create $as_me.lineno as a copy of $as_myself, but with $LINENO - # uniformly replaced by the line number. The first 'sed' inserts a - # line-number line before each line; the second 'sed' does the real - # work. The second script uses 'N' to pair each line-number line - # with the numbered line, and appends trailing '-' during - # substitution so that $LINENO is not a special case at line end. - # (Raja R Harinath suggested sed '=', and Paul Eggert wrote the - # second 'sed' script. Blame Lee E. McMahon for sed's syntax. :-) - sed '=' <$as_myself | + as_lineno_1=$LINENO as_lineno_1a=$LINENO + as_lineno_2=$LINENO as_lineno_2a=$LINENO + eval 'test "x$as_lineno_1'$as_run'" != "x$as_lineno_2'$as_run'" && + test "x`expr $as_lineno_1'$as_run' + 1`" = "x$as_lineno_2'$as_run'"' || { + # Blame Lee E. McMahon (1931-1989) for sed's syntax. :-) + sed -n ' + p + /[$]LINENO/= + ' <$as_myself | sed ' + s/[$]LINENO.*/&-/ + t lineno + b + :lineno N - s,$,-, - : loop - s,^\(['$as_cr_digits']*\)\(.*\)[$]LINENO\([^'$as_cr_alnum'_]\),\1\2\1\3, + :loop + s/[$]LINENO\([^'$as_cr_alnum'_].*\n\)\(.*\)/\2\1\2/ t loop - s,-$,, - s,^['$as_cr_digits']*\n,, + s/-\n.*// ' >$as_me.lineno && - chmod +x $as_me.lineno || - { echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2 - { (exit 1); exit 1; }; } + chmod +x "$as_me.lineno" || + { $as_echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2; as_fn_exit 1; } + # If we had to re-execute with $CONFIG_SHELL, we're ensured to have + # already done that, so ensure we don't try to do so again and fall + # in an infinite loop. This has already happened in practice. + _as_can_reexec=no; export _as_can_reexec # Don't try to exec as it changes $[0], causing all sort of problems # (the dirname of $[0] is not the place where we might find the - # original and so on. Autoconf is especially sensible to this). - . ./$as_me.lineno + # original and so on. Autoconf is especially sensitive to this). + . "./$as_me.lineno" # Exit status is that of the last command. exit } - -case `echo "testing\c"; echo 1,2,3`,`echo -n testing; echo 1,2,3` in - *c*,-n*) ECHO_N= ECHO_C=' -' ECHO_T=' ' ;; - *c*,* ) ECHO_N=-n ECHO_C= ECHO_T= ;; - *) ECHO_N= ECHO_C='\c' ECHO_T= ;; +ECHO_C= ECHO_N= ECHO_T= +case `echo -n x` in #((((( +-n*) + case `echo 'xy\c'` in + *c*) ECHO_T=' ';; # ECHO_T is single tab character. + xy) ECHO_C='\c';; + *) echo `echo ksh88 bug on AIX 6.1` > /dev/null + ECHO_T=' ';; + esac;; +*) + ECHO_N='-n';; esac -if expr a : '\(a\)' >/dev/null 2>&1; then - as_expr=expr +rm -f conf$$ conf$$.exe conf$$.file +if test -d conf$$.dir; then + rm -f conf$$.dir/conf$$.file else - as_expr=false + rm -f conf$$.dir + mkdir conf$$.dir 2>/dev/null fi - -rm -f conf$$ conf$$.exe conf$$.file -echo >conf$$.file -if ln -s conf$$.file conf$$ 2>/dev/null; then - # We could just check for DJGPP; but this test a) works b) is more generic - # and c) will remain valid once DJGPP supports symlinks (DJGPP 2.04). - if test -f conf$$.exe; then - # Don't use ln at all; we don't have any links - as_ln_s='cp -p' - else +if (echo >conf$$.file) 2>/dev/null; then + if ln -s conf$$.file conf$$ 2>/dev/null; then as_ln_s='ln -s' + # ... but there are two gotchas: + # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail. + # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable. + # In both cases, we have to default to `cp -pR'. + ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe || + as_ln_s='cp -pR' + elif ln conf$$.file conf$$ 2>/dev/null; then + as_ln_s=ln + else + as_ln_s='cp -pR' fi -elif ln conf$$.file conf$$ 2>/dev/null; then - as_ln_s=ln else - as_ln_s='cp -p' + as_ln_s='cp -pR' fi -rm -f conf$$ conf$$.exe conf$$.file +rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file +rmdir conf$$.dir 2>/dev/null if mkdir -p . 2>/dev/null; then - as_mkdir_p=: + as_mkdir_p='mkdir -p "$as_dir"' else test -d ./-p && rmdir ./-p as_mkdir_p=false fi -as_executable_p="test -f" +as_test_x='test -x' +as_executable_p=as_fn_executable_p # Sed expression to map a string onto a valid CPP name. as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'" @@ -233,90 +557,202 @@ as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'" -# IFS -# We need space, tab and new line, in precisely that order. -as_nl=' -' -IFS=" $as_nl" - -# CDPATH. -$as_unset CDPATH - +test -n "$DJDIR" || exec 7<&0 &1 # Name of the host. -# hostname on some systems (SVR3.2, Linux) returns a bogus exit status, +# hostname on some systems (SVR3.2, old GNU/Linux) returns a bogus exit status, # so uname gets run too. ac_hostname=`(hostname || uname -n) 2>/dev/null | sed 1q` -exec 6>&1 - # # Initializations. # ac_default_prefix=/usr/local +ac_clean_files= ac_config_libobj_dir=. +LIBOBJS= cross_compiling=no subdirs= MFLAGS= MAKEFLAGS= -SHELL=${CONFIG_SHELL-/bin/sh} - -# Maximum number of lines to put in a shell here document. -# This variable seems obsolete. It should probably be removed, and -# only ac_max_sed_lines should be used. -: ${ac_max_here_lines=38} # Identity of this package. PACKAGE_NAME='filtergen' PACKAGE_TARNAME='filtergen' -PACKAGE_VERSION='0.12.4' -PACKAGE_STRING='filtergen 0.12.4' +PACKAGE_VERSION='0.12.7' +PACKAGE_STRING='filtergen 0.12.7' PACKAGE_BUGREPORT='jaq@spacepants.org' +PACKAGE_URL='' ac_unique_file="filtergen.c" # Factoring default headers for most tests. ac_includes_default="\ #include -#if HAVE_SYS_TYPES_H +#ifdef HAVE_SYS_TYPES_H # include #endif -#if HAVE_SYS_STAT_H +#ifdef HAVE_SYS_STAT_H # include #endif -#if STDC_HEADERS +#ifdef STDC_HEADERS # include # include #else -# if HAVE_STDLIB_H +# ifdef HAVE_STDLIB_H # include # endif #endif -#if HAVE_STRING_H -# if !STDC_HEADERS && HAVE_MEMORY_H +#ifdef HAVE_STRING_H +# if !defined STDC_HEADERS && defined HAVE_MEMORY_H # include # endif # include #endif -#if HAVE_STRINGS_H +#ifdef HAVE_STRINGS_H # include #endif -#if HAVE_INTTYPES_H +#ifdef HAVE_INTTYPES_H # include -#else -# if HAVE_STDINT_H -# include -# endif #endif -#if HAVE_UNISTD_H +#ifdef HAVE_STDINT_H +# include +#endif +#ifdef HAVE_UNISTD_H # include #endif" -ac_subst_vars='SHELL PATH_SEPARATOR PACKAGE_NAME PACKAGE_TARNAME PACKAGE_VERSION PACKAGE_STRING PACKAGE_BUGREPORT exec_prefix prefix program_transform_name bindir sbindir libexecdir datadir sysconfdir sharedstatedir localstatedir libdir includedir oldincludedir infodir mandir build_alias host_alias target_alias DEFS ECHO_C ECHO_N ECHO_T LIBS INSTALL_PROGRAM INSTALL_SCRIPT INSTALL_DATA CYGPATH_W PACKAGE VERSION ACLOCAL AUTOCONF AUTOMAKE AUTOHEADER MAKEINFO AMTAR install_sh STRIP ac_ct_STRIP INSTALL_STRIP_PROGRAM mkdir_p AWK SET_MAKE am__leading_dot MAINTAINER_MODE_TRUE MAINTAINER_MODE_FALSE MAINT PROGRAM CC CFLAGS LDFLAGS CPPFLAGS ac_ct_CC EXEEXT OBJEXT DEPDIR am__include am__quote AMDEP_TRUE AMDEP_FALSE AMDEPBACKSLASH CCDEPMODE am__fastdepCC_TRUE am__fastdepCC_FALSE LEX LEXLIB LEX_OUTPUT_ROOT YACC CPP EGREP GETOPT_LIBS BINDIR SBINDIR SYSCONFDIR pkgdocdir pkgexdir LIBOBJS LTLIBOBJS' +ac_subst_vars='am__EXEEXT_FALSE +am__EXEEXT_TRUE +LTLIBOBJS +LIBOBJS +pkgexdir +pkgdocdir +SYSCONFDIR +SBINDIR +BINDIR +GETOPT_LIBS +EGREP +GREP +CPP +YFLAGS +YACC +LEXLIB +LEX_OUTPUT_ROOT +LEX +am__fastdepCC_FALSE +am__fastdepCC_TRUE +CCDEPMODE +am__nodep +AMDEPBACKSLASH +AMDEP_FALSE +AMDEP_TRUE +am__quote +am__include +DEPDIR +OBJEXT +EXEEXT +ac_ct_CC +CPPFLAGS +LDFLAGS +CFLAGS +CC +PROGRAM +MAINT +MAINTAINER_MODE_FALSE +MAINTAINER_MODE_TRUE +AM_BACKSLASH +AM_DEFAULT_VERBOSITY +AM_DEFAULT_V +AM_V +am__untar +am__tar +AMTAR +am__leading_dot +SET_MAKE +AWK +mkdir_p +MKDIR_P +INSTALL_STRIP_PROGRAM +STRIP +install_sh +MAKEINFO +AUTOHEADER +AUTOMAKE +AUTOCONF +ACLOCAL +VERSION +PACKAGE +CYGPATH_W +am__isrc +INSTALL_DATA +INSTALL_SCRIPT +INSTALL_PROGRAM +target_alias +host_alias +build_alias +LIBS +ECHO_T +ECHO_N +ECHO_C +DEFS +mandir +localedir +libdir +psdir +pdfdir +dvidir +htmldir +infodir +docdir +oldincludedir +includedir +runstatedir +localstatedir +sharedstatedir +sysconfdir +datadir +datarootdir +libexecdir +sbindir +bindir +program_transform_name +prefix +exec_prefix +PACKAGE_URL +PACKAGE_BUGREPORT +PACKAGE_STRING +PACKAGE_VERSION +PACKAGE_TARNAME +PACKAGE_NAME +PATH_SEPARATOR +SHELL' ac_subst_files='' +ac_user_opts=' +enable_option_checking +enable_silent_rules +enable_maintainer_mode +enable_dependency_tracking +enable_debug +' + ac_precious_vars='build_alias +host_alias +target_alias +CC +CFLAGS +LDFLAGS +LIBS +CPPFLAGS +YACC +YFLAGS +CPP' + # Initialize some variables set by options. ac_init_help= ac_init_version=false +ac_unrecognized_opts= +ac_unrecognized_sep= # The variables have the same names as the options, with # dashes changed to underlines. cache_file=/dev/null @@ -339,34 +775,50 @@ # and all the variables that are supposed to be based on exec_prefix # by default will actually change. # Use braces instead of parens because sh, perl, etc. also accept them. +# (The list follows the same order as the GNU Coding Standards.) bindir='${exec_prefix}/bin' sbindir='${exec_prefix}/sbin' libexecdir='${exec_prefix}/libexec' -datadir='${prefix}/share' +datarootdir='${prefix}/share' +datadir='${datarootdir}' sysconfdir='${prefix}/etc' sharedstatedir='${prefix}/com' localstatedir='${prefix}/var' -libdir='${exec_prefix}/lib' +runstatedir='${localstatedir}/run' includedir='${prefix}/include' oldincludedir='/usr/include' -infodir='${prefix}/info' -mandir='${prefix}/man' +docdir='${datarootdir}/doc/${PACKAGE_TARNAME}' +infodir='${datarootdir}/info' +htmldir='${docdir}' +dvidir='${docdir}' +pdfdir='${docdir}' +psdir='${docdir}' +libdir='${exec_prefix}/lib' +localedir='${datarootdir}/locale' +mandir='${datarootdir}/man' ac_prev= +ac_dashdash= for ac_option do # If the previous option needs an argument, assign it. if test -n "$ac_prev"; then - eval "$ac_prev=\$ac_option" + eval $ac_prev=\$ac_option ac_prev= continue fi - ac_optarg=`expr "x$ac_option" : 'x[^=]*=\(.*\)'` + case $ac_option in + *=?*) ac_optarg=`expr "X$ac_option" : '[^=]*=\(.*\)'` ;; + *=) ac_optarg= ;; + *) ac_optarg=yes ;; + esac # Accept the important Cygnus configure options, so we can diagnose typos. - case $ac_option in + case $ac_dashdash$ac_option in + --) + ac_dashdash=yes ;; -bindir | --bindir | --bindi | --bind | --bin | --bi) ac_prev=bindir ;; @@ -388,33 +840,59 @@ --config-cache | -C) cache_file=config.cache ;; - -datadir | --datadir | --datadi | --datad | --data | --dat | --da) + -datadir | --datadir | --datadi | --datad) ac_prev=datadir ;; - -datadir=* | --datadir=* | --datadi=* | --datad=* | --data=* | --dat=* \ - | --da=*) + -datadir=* | --datadir=* | --datadi=* | --datad=*) datadir=$ac_optarg ;; + -datarootdir | --datarootdir | --datarootdi | --datarootd | --dataroot \ + | --dataroo | --dataro | --datar) + ac_prev=datarootdir ;; + -datarootdir=* | --datarootdir=* | --datarootdi=* | --datarootd=* \ + | --dataroot=* | --dataroo=* | --dataro=* | --datar=*) + datarootdir=$ac_optarg ;; + -disable-* | --disable-*) - ac_feature=`expr "x$ac_option" : 'x-*disable-\(.*\)'` + ac_useropt=`expr "x$ac_option" : 'x-*disable-\(.*\)'` # Reject names that are not valid shell variable names. - expr "x$ac_feature" : ".*[^-_$as_cr_alnum]" >/dev/null && - { echo "$as_me: error: invalid feature name: $ac_feature" >&2 - { (exit 1); exit 1; }; } - ac_feature=`echo $ac_feature | sed 's/-/_/g'` - eval "enable_$ac_feature=no" ;; + expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && + as_fn_error $? "invalid feature name: $ac_useropt" + ac_useropt_orig=$ac_useropt + ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` + case $ac_user_opts in + *" +"enable_$ac_useropt" +"*) ;; + *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--disable-$ac_useropt_orig" + ac_unrecognized_sep=', ';; + esac + eval enable_$ac_useropt=no ;; + + -docdir | --docdir | --docdi | --doc | --do) + ac_prev=docdir ;; + -docdir=* | --docdir=* | --docdi=* | --doc=* | --do=*) + docdir=$ac_optarg ;; + + -dvidir | --dvidir | --dvidi | --dvid | --dvi | --dv) + ac_prev=dvidir ;; + -dvidir=* | --dvidir=* | --dvidi=* | --dvid=* | --dvi=* | --dv=*) + dvidir=$ac_optarg ;; -enable-* | --enable-*) - ac_feature=`expr "x$ac_option" : 'x-*enable-\([^=]*\)'` + ac_useropt=`expr "x$ac_option" : 'x-*enable-\([^=]*\)'` # Reject names that are not valid shell variable names. - expr "x$ac_feature" : ".*[^-_$as_cr_alnum]" >/dev/null && - { echo "$as_me: error: invalid feature name: $ac_feature" >&2 - { (exit 1); exit 1; }; } - ac_feature=`echo $ac_feature | sed 's/-/_/g'` - case $ac_option in - *=*) ac_optarg=`echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"`;; - *) ac_optarg=yes ;; + expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && + as_fn_error $? "invalid feature name: $ac_useropt" + ac_useropt_orig=$ac_useropt + ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` + case $ac_user_opts in + *" +"enable_$ac_useropt" +"*) ;; + *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--enable-$ac_useropt_orig" + ac_unrecognized_sep=', ';; esac - eval "enable_$ac_feature='$ac_optarg'" ;; + eval enable_$ac_useropt=\$ac_optarg ;; -exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi \ | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- \ @@ -441,6 +919,12 @@ -host=* | --host=* | --hos=* | --ho=*) host_alias=$ac_optarg ;; + -htmldir | --htmldir | --htmldi | --htmld | --html | --htm | --ht) + ac_prev=htmldir ;; + -htmldir=* | --htmldir=* | --htmldi=* | --htmld=* | --html=* | --htm=* \ + | --ht=*) + htmldir=$ac_optarg ;; + -includedir | --includedir | --includedi | --included | --include \ | --includ | --inclu | --incl | --inc) ac_prev=includedir ;; @@ -465,13 +949,16 @@ | --libexe=* | --libex=* | --libe=*) libexecdir=$ac_optarg ;; + -localedir | --localedir | --localedi | --localed | --locale) + ac_prev=localedir ;; + -localedir=* | --localedir=* | --localedi=* | --localed=* | --locale=*) + localedir=$ac_optarg ;; + -localstatedir | --localstatedir | --localstatedi | --localstated \ - | --localstate | --localstat | --localsta | --localst \ - | --locals | --local | --loca | --loc | --lo) + | --localstate | --localstat | --localsta | --localst | --locals) ac_prev=localstatedir ;; -localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \ - | --localstate=* | --localstat=* | --localsta=* | --localst=* \ - | --locals=* | --local=* | --loca=* | --loc=* | --lo=*) + | --localstate=* | --localstat=* | --localsta=* | --localst=* | --locals=*) localstatedir=$ac_optarg ;; -mandir | --mandir | --mandi | --mand | --man | --ma | --m) @@ -536,10 +1023,29 @@ | --progr-tra=* | --program-tr=* | --program-t=*) program_transform_name=$ac_optarg ;; + -pdfdir | --pdfdir | --pdfdi | --pdfd | --pdf | --pd) + ac_prev=pdfdir ;; + -pdfdir=* | --pdfdir=* | --pdfdi=* | --pdfd=* | --pdf=* | --pd=*) + pdfdir=$ac_optarg ;; + + -psdir | --psdir | --psdi | --psd | --ps) + ac_prev=psdir ;; + -psdir=* | --psdir=* | --psdi=* | --psd=* | --ps=*) + psdir=$ac_optarg ;; + -q | -quiet | --quiet | --quie | --qui | --qu | --q \ | -silent | --silent | --silen | --sile | --sil) silent=yes ;; + -runstatedir | --runstatedir | --runstatedi | --runstated \ + | --runstate | --runstat | --runsta | --runst | --runs \ + | --run | --ru | --r) + ac_prev=runstatedir ;; + -runstatedir=* | --runstatedir=* | --runstatedi=* | --runstated=* \ + | --runstate=* | --runstat=* | --runsta=* | --runst=* | --runs=* \ + | --run=* | --ru=* | --r=*) + runstatedir=$ac_optarg ;; + -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb) ac_prev=sbindir ;; -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \ @@ -586,26 +1092,36 @@ ac_init_version=: ;; -with-* | --with-*) - ac_package=`expr "x$ac_option" : 'x-*with-\([^=]*\)'` + ac_useropt=`expr "x$ac_option" : 'x-*with-\([^=]*\)'` # Reject names that are not valid shell variable names. - expr "x$ac_package" : ".*[^-_$as_cr_alnum]" >/dev/null && - { echo "$as_me: error: invalid package name: $ac_package" >&2 - { (exit 1); exit 1; }; } - ac_package=`echo $ac_package| sed 's/-/_/g'` - case $ac_option in - *=*) ac_optarg=`echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"`;; - *) ac_optarg=yes ;; + expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && + as_fn_error $? "invalid package name: $ac_useropt" + ac_useropt_orig=$ac_useropt + ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` + case $ac_user_opts in + *" +"with_$ac_useropt" +"*) ;; + *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--with-$ac_useropt_orig" + ac_unrecognized_sep=', ';; esac - eval "with_$ac_package='$ac_optarg'" ;; + eval with_$ac_useropt=\$ac_optarg ;; -without-* | --without-*) - ac_package=`expr "x$ac_option" : 'x-*without-\(.*\)'` + ac_useropt=`expr "x$ac_option" : 'x-*without-\(.*\)'` # Reject names that are not valid shell variable names. - expr "x$ac_package" : ".*[^-_$as_cr_alnum]" >/dev/null && - { echo "$as_me: error: invalid package name: $ac_package" >&2 - { (exit 1); exit 1; }; } - ac_package=`echo $ac_package | sed 's/-/_/g'` - eval "with_$ac_package=no" ;; + expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && + as_fn_error $? "invalid package name: $ac_useropt" + ac_useropt_orig=$ac_useropt + ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` + case $ac_user_opts in + *" +"with_$ac_useropt" +"*) ;; + *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--without-$ac_useropt_orig" + ac_unrecognized_sep=', ';; + esac + eval with_$ac_useropt=no ;; --x) # Obsolete; use --with-x. @@ -625,27 +1141,26 @@ | --x-librar=* | --x-libra=* | --x-libr=* | --x-lib=* | --x-li=* | --x-l=*) x_libraries=$ac_optarg ;; - -*) { echo "$as_me: error: unrecognized option: $ac_option -Try \`$0 --help' for more information." >&2 - { (exit 1); exit 1; }; } + -*) as_fn_error $? "unrecognized option: \`$ac_option' +Try \`$0 --help' for more information" ;; *=*) ac_envvar=`expr "x$ac_option" : 'x\([^=]*\)='` # Reject names that are not valid shell variable names. - expr "x$ac_envvar" : ".*[^_$as_cr_alnum]" >/dev/null && - { echo "$as_me: error: invalid variable name: $ac_envvar" >&2 - { (exit 1); exit 1; }; } - ac_optarg=`echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` - eval "$ac_envvar='$ac_optarg'" + case $ac_envvar in #( + '' | [0-9]* | *[!_$as_cr_alnum]* ) + as_fn_error $? "invalid variable name: \`$ac_envvar'" ;; + esac + eval $ac_envvar=\$ac_optarg export $ac_envvar ;; *) # FIXME: should be removed in autoconf 3.0. - echo "$as_me: WARNING: you should use --build, --host, --target" >&2 + $as_echo "$as_me: WARNING: you should use --build, --host, --target" >&2 expr "x$ac_option" : ".*[^-._$as_cr_alnum]" >/dev/null && - echo "$as_me: WARNING: invalid host type: $ac_option" >&2 - : ${build_alias=$ac_option} ${host_alias=$ac_option} ${target_alias=$ac_option} + $as_echo "$as_me: WARNING: invalid host type: $ac_option" >&2 + : "${build_alias=$ac_option} ${host_alias=$ac_option} ${target_alias=$ac_option}" ;; esac @@ -653,31 +1168,36 @@ if test -n "$ac_prev"; then ac_option=--`echo $ac_prev | sed 's/_/-/g'` - { echo "$as_me: error: missing argument to $ac_option" >&2 - { (exit 1); exit 1; }; } + as_fn_error $? "missing argument to $ac_option" fi -# Be sure to have absolute paths. -for ac_var in exec_prefix prefix -do - eval ac_val=$`echo $ac_var` - case $ac_val in - [\\/$]* | ?:[\\/]* | NONE | '' ) ;; - *) { echo "$as_me: error: expected an absolute directory name for --$ac_var: $ac_val" >&2 - { (exit 1); exit 1; }; };; +if test -n "$ac_unrecognized_opts"; then + case $enable_option_checking in + no) ;; + fatal) as_fn_error $? "unrecognized options: $ac_unrecognized_opts" ;; + *) $as_echo "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2 ;; esac -done +fi -# Be sure to have absolute paths. -for ac_var in bindir sbindir libexecdir datadir sysconfdir sharedstatedir \ - localstatedir libdir includedir oldincludedir infodir mandir +# Check all directory arguments for consistency. +for ac_var in exec_prefix prefix bindir sbindir libexecdir datarootdir \ + datadir sysconfdir sharedstatedir localstatedir includedir \ + oldincludedir docdir infodir htmldir dvidir pdfdir psdir \ + libdir localedir mandir runstatedir do - eval ac_val=$`echo $ac_var` + eval ac_val=\$$ac_var + # Remove trailing slashes. + case $ac_val in + */ ) + ac_val=`expr "X$ac_val" : 'X\(.*[^/]\)' \| "X$ac_val" : 'X\(.*\)'` + eval $ac_var=\$ac_val;; + esac + # Be sure to have absolute directory names. case $ac_val in - [\\/$]* | ?:[\\/]* ) ;; - *) { echo "$as_me: error: expected an absolute directory name for --$ac_var: $ac_val" >&2 - { (exit 1); exit 1; }; };; + [\\/$]* | ?:[\\/]* ) continue;; + NONE | '' ) case $ac_var in *prefix ) continue;; esac;; esac + as_fn_error $? "expected an absolute directory name for --$ac_var: $ac_val" done # There might be people who depend on the old broken behavior: `$host' @@ -691,8 +1211,6 @@ if test "x$host_alias" != x; then if test "x$build_alias" = x; then cross_compiling=maybe - echo "$as_me: WARNING: If you wanted to set the --build type, don't use --host. - If a cross compiler is detected then cross compile mode will be used." >&2 elif test "x$build_alias" != "x$host_alias"; then cross_compiling=yes fi @@ -704,74 +1222,72 @@ test "$silent" = yes && exec 6>/dev/null +ac_pwd=`pwd` && test -n "$ac_pwd" && +ac_ls_di=`ls -di .` && +ac_pwd_ls_di=`cd "$ac_pwd" && ls -di .` || + as_fn_error $? "working directory cannot be determined" +test "X$ac_ls_di" = "X$ac_pwd_ls_di" || + as_fn_error $? "pwd does not report name of working directory" + + # Find the source files, if location was not specified. if test -z "$srcdir"; then ac_srcdir_defaulted=yes - # Try the directory containing this script, then its parent. - ac_confdir=`(dirname "$0") 2>/dev/null || -$as_expr X"$0" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ - X"$0" : 'X\(//\)[^/]' \| \ - X"$0" : 'X\(//\)$' \| \ - X"$0" : 'X\(/\)' \| \ - . : '\(.\)' 2>/dev/null || -echo X"$0" | - sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; } - /^X\(\/\/\)[^/].*/{ s//\1/; q; } - /^X\(\/\/\)$/{ s//\1/; q; } - /^X\(\/\).*/{ s//\1/; q; } - s/.*/./; q'` + # Try the directory containing this script, then the parent directory. + ac_confdir=`$as_dirname -- "$as_myself" || +$as_expr X"$as_myself" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$as_myself" : 'X\(//\)[^/]' \| \ + X"$as_myself" : 'X\(//\)$' \| \ + X"$as_myself" : 'X\(/\)' \| . 2>/dev/null || +$as_echo X"$as_myself" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ + s//\1/ + q + } + /^X\(\/\/\)[^/].*/{ + s//\1/ + q + } + /^X\(\/\/\)$/{ + s//\1/ + q + } + /^X\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q'` srcdir=$ac_confdir - if test ! -r $srcdir/$ac_unique_file; then + if test ! -r "$srcdir/$ac_unique_file"; then srcdir=.. fi else ac_srcdir_defaulted=no fi -if test ! -r $srcdir/$ac_unique_file; then - if test "$ac_srcdir_defaulted" = yes; then - { echo "$as_me: error: cannot find sources ($ac_unique_file) in $ac_confdir or .." >&2 - { (exit 1); exit 1; }; } - else - { echo "$as_me: error: cannot find sources ($ac_unique_file) in $srcdir" >&2 - { (exit 1); exit 1; }; } - fi -fi -(cd $srcdir && test -r ./$ac_unique_file) 2>/dev/null || - { echo "$as_me: error: sources are in $srcdir, but \`cd $srcdir' does not work" >&2 - { (exit 1); exit 1; }; } -srcdir=`echo "$srcdir" | sed 's%\([^\\/]\)[\\/]*$%\1%'` -ac_env_build_alias_set=${build_alias+set} -ac_env_build_alias_value=$build_alias -ac_cv_env_build_alias_set=${build_alias+set} -ac_cv_env_build_alias_value=$build_alias -ac_env_host_alias_set=${host_alias+set} -ac_env_host_alias_value=$host_alias -ac_cv_env_host_alias_set=${host_alias+set} -ac_cv_env_host_alias_value=$host_alias -ac_env_target_alias_set=${target_alias+set} -ac_env_target_alias_value=$target_alias -ac_cv_env_target_alias_set=${target_alias+set} -ac_cv_env_target_alias_value=$target_alias -ac_env_CC_set=${CC+set} -ac_env_CC_value=$CC -ac_cv_env_CC_set=${CC+set} -ac_cv_env_CC_value=$CC -ac_env_CFLAGS_set=${CFLAGS+set} -ac_env_CFLAGS_value=$CFLAGS -ac_cv_env_CFLAGS_set=${CFLAGS+set} -ac_cv_env_CFLAGS_value=$CFLAGS -ac_env_LDFLAGS_set=${LDFLAGS+set} -ac_env_LDFLAGS_value=$LDFLAGS -ac_cv_env_LDFLAGS_set=${LDFLAGS+set} -ac_cv_env_LDFLAGS_value=$LDFLAGS -ac_env_CPPFLAGS_set=${CPPFLAGS+set} -ac_env_CPPFLAGS_value=$CPPFLAGS -ac_cv_env_CPPFLAGS_set=${CPPFLAGS+set} -ac_cv_env_CPPFLAGS_value=$CPPFLAGS -ac_env_CPP_set=${CPP+set} -ac_env_CPP_value=$CPP -ac_cv_env_CPP_set=${CPP+set} -ac_cv_env_CPP_value=$CPP +if test ! -r "$srcdir/$ac_unique_file"; then + test "$ac_srcdir_defaulted" = yes && srcdir="$ac_confdir or .." + as_fn_error $? "cannot find sources ($ac_unique_file) in $srcdir" +fi +ac_msg="sources are in $srcdir, but \`cd $srcdir' does not work" +ac_abs_confdir=`( + cd "$srcdir" && test -r "./$ac_unique_file" || as_fn_error $? "$ac_msg" + pwd)` +# When building in place, set srcdir=. +if test "$ac_abs_confdir" = "$ac_pwd"; then + srcdir=. +fi +# Remove unnecessary trailing slashes from srcdir. +# Double slashes in file names in object file debugging info +# mess up M-x gdb in Emacs. +case $srcdir in +*/) srcdir=`expr "X$srcdir" : 'X\(.*[^/]\)' \| "X$srcdir" : 'X\(.*\)'`;; +esac +for ac_var in $ac_precious_vars; do + eval ac_env_${ac_var}_set=\${${ac_var}+set} + eval ac_env_${ac_var}_value=\$${ac_var} + eval ac_cv_env_${ac_var}_set=\${${ac_var}+set} + eval ac_cv_env_${ac_var}_value=\$${ac_var} +done # # Report the --help message. @@ -780,7 +1296,7 @@ # Omit some internal or obsolete options to make the list less imposing. # This message is too long to be a string in the A/UX 3.1 sh. cat <<_ACEOF -\`configure' configures filtergen 0.12.4 to adapt to many kinds of systems. +\`configure' configures filtergen 0.12.7 to adapt to many kinds of systems. Usage: $0 [OPTION]... [VAR=VALUE]... @@ -794,20 +1310,17 @@ --help=short display options specific to this package --help=recursive display the short help of all the included packages -V, --version display version information and exit - -q, --quiet, --silent do not print \`checking...' messages + -q, --quiet, --silent do not print \`checking ...' messages --cache-file=FILE cache test results in FILE [disabled] -C, --config-cache alias for \`--cache-file=config.cache' -n, --no-create do not create output files --srcdir=DIR find the sources in DIR [configure dir or \`..'] -_ACEOF - - cat <<_ACEOF Installation directories: --prefix=PREFIX install architecture-independent files in PREFIX - [$ac_default_prefix] + [$ac_default_prefix] --exec-prefix=EPREFIX install architecture-dependent files in EPREFIX - [PREFIX] + [PREFIX] By default, \`make install' will install all the files in \`$ac_default_prefix/bin', \`$ac_default_prefix/lib' etc. You can specify @@ -817,18 +1330,26 @@ For better control, use the options below. Fine tuning of the installation directories: - --bindir=DIR user executables [EPREFIX/bin] - --sbindir=DIR system admin executables [EPREFIX/sbin] - --libexecdir=DIR program executables [EPREFIX/libexec] - --datadir=DIR read-only architecture-independent data [PREFIX/share] - --sysconfdir=DIR read-only single-machine data [PREFIX/etc] - --sharedstatedir=DIR modifiable architecture-independent data [PREFIX/com] - --localstatedir=DIR modifiable single-machine data [PREFIX/var] - --libdir=DIR object code libraries [EPREFIX/lib] - --includedir=DIR C header files [PREFIX/include] - --oldincludedir=DIR C header files for non-gcc [/usr/include] - --infodir=DIR info documentation [PREFIX/info] - --mandir=DIR man documentation [PREFIX/man] + --bindir=DIR user executables [EPREFIX/bin] + --sbindir=DIR system admin executables [EPREFIX/sbin] + --libexecdir=DIR program executables [EPREFIX/libexec] + --sysconfdir=DIR read-only single-machine data [PREFIX/etc] + --sharedstatedir=DIR modifiable architecture-independent data [PREFIX/com] + --localstatedir=DIR modifiable single-machine data [PREFIX/var] + --runstatedir=DIR modifiable per-process data [LOCALSTATEDIR/run] + --libdir=DIR object code libraries [EPREFIX/lib] + --includedir=DIR C header files [PREFIX/include] + --oldincludedir=DIR C header files for non-gcc [/usr/include] + --datarootdir=DIR read-only arch.-independent data root [PREFIX/share] + --datadir=DIR read-only architecture-independent data [DATAROOTDIR] + --infodir=DIR info documentation [DATAROOTDIR/info] + --localedir=DIR locale-dependent data [DATAROOTDIR/locale] + --mandir=DIR man documentation [DATAROOTDIR/man] + --docdir=DIR documentation root [DATAROOTDIR/doc/filtergen] + --htmldir=DIR html documentation [DOCDIR] + --dvidir=DIR dvi documentation [DOCDIR] + --pdfdir=DIR pdf documentation [DOCDIR] + --psdir=DIR ps documentation [DOCDIR] _ACEOF cat <<\_ACEOF @@ -842,17 +1363,23 @@ if test -n "$ac_init_help"; then case $ac_init_help in - short | recursive ) echo "Configuration of filtergen 0.12.4:";; + short | recursive ) echo "Configuration of filtergen 0.12.7:";; esac cat <<\_ACEOF Optional Features: + --disable-option-checking ignore unrecognized --enable/--with options --disable-FEATURE do not include FEATURE (same as --enable-FEATURE=no) --enable-FEATURE[=ARG] include FEATURE [ARG=yes] - --enable-maintainer-mode enable make rules and dependencies not useful - (and sometimes confusing) to the casual installer - --disable-dependency-tracking speeds up one-time build - --enable-dependency-tracking do not reject slow dependency extractors + --enable-silent-rules less verbose build output (undo: "make V=1") + --disable-silent-rules verbose build output (undo: "make V=0") + --enable-maintainer-mode + enable make rules and dependencies not useful (and + sometimes confusing) to the casual installer + --enable-dependency-tracking + do not reject slow dependency extractors + --disable-dependency-tracking + speeds up one-time build --enable-debug enable debugging compiler options Some influential environment variables: @@ -860,8 +1387,15 @@ CFLAGS C compiler flags LDFLAGS linker flags, e.g. -L if you have libraries in a nonstandard directory - CPPFLAGS C/C++ preprocessor flags, e.g. -I if you have - headers in a nonstandard directory + LIBS libraries to pass to the linker, e.g. -l + CPPFLAGS (Objective) C/C++ preprocessor flags, e.g. -I if + you have headers in a nonstandard directory + YACC The `Yet Another Compiler Compiler' implementation to use. + Defaults to the first program found out of: `bison -y', `byacc', + `yacc'. + YFLAGS The list of arguments that will be passed by default to $YACC. + This script will default YFLAGS to the empty string to avoid a + default value of `-d' given by some make applications. CPP C preprocessor Use these variables to override the choices made by `configure' or to help @@ -869,163 +1403,420 @@ Report bugs to . _ACEOF +ac_status=$? fi if test "$ac_init_help" = "recursive"; then # If there are subdirs, report their specific --help. - ac_popdir=`pwd` for ac_dir in : $ac_subdirs_all; do test "x$ac_dir" = x: && continue - test -d $ac_dir || continue + test -d "$ac_dir" || + { cd "$srcdir" && ac_pwd=`pwd` && srcdir=. && test -d "$ac_dir"; } || + continue ac_builddir=. -if test "$ac_dir" != .; then - ac_dir_suffix=/`echo "$ac_dir" | sed 's,^\.[\\/],,'` - # A "../" for each directory in $ac_dir_suffix. - ac_top_builddir=`echo "$ac_dir_suffix" | sed 's,/[^\\/]*,../,g'` -else - ac_dir_suffix= ac_top_builddir= -fi +case "$ac_dir" in +.) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;; +*) + ac_dir_suffix=/`$as_echo "$ac_dir" | sed 's|^\.[\\/]||'` + # A ".." for each directory in $ac_dir_suffix. + ac_top_builddir_sub=`$as_echo "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'` + case $ac_top_builddir_sub in + "") ac_top_builddir_sub=. ac_top_build_prefix= ;; + *) ac_top_build_prefix=$ac_top_builddir_sub/ ;; + esac ;; +esac +ac_abs_top_builddir=$ac_pwd +ac_abs_builddir=$ac_pwd$ac_dir_suffix +# for backward compatibility: +ac_top_builddir=$ac_top_build_prefix case $srcdir in - .) # No --srcdir option. We are building in place. + .) # We are building in place. ac_srcdir=. - if test -z "$ac_top_builddir"; then - ac_top_srcdir=. - else - ac_top_srcdir=`echo $ac_top_builddir | sed 's,/$,,'` - fi ;; - [\\/]* | ?:[\\/]* ) # Absolute path. + ac_top_srcdir=$ac_top_builddir_sub + ac_abs_top_srcdir=$ac_pwd ;; + [\\/]* | ?:[\\/]* ) # Absolute name. ac_srcdir=$srcdir$ac_dir_suffix; - ac_top_srcdir=$srcdir ;; - *) # Relative path. - ac_srcdir=$ac_top_builddir$srcdir$ac_dir_suffix - ac_top_srcdir=$ac_top_builddir$srcdir ;; + ac_top_srcdir=$srcdir + ac_abs_top_srcdir=$srcdir ;; + *) # Relative name. + ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix + ac_top_srcdir=$ac_top_build_prefix$srcdir + ac_abs_top_srcdir=$ac_pwd/$srcdir ;; esac +ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix -# Do not use `cd foo && pwd` to compute absolute paths, because -# the directories may not exist. -case `pwd` in -.) ac_abs_builddir="$ac_dir";; -*) - case "$ac_dir" in - .) ac_abs_builddir=`pwd`;; - [\\/]* | ?:[\\/]* ) ac_abs_builddir="$ac_dir";; - *) ac_abs_builddir=`pwd`/"$ac_dir";; - esac;; -esac -case $ac_abs_builddir in -.) ac_abs_top_builddir=${ac_top_builddir}.;; -*) - case ${ac_top_builddir}. in - .) ac_abs_top_builddir=$ac_abs_builddir;; - [\\/]* | ?:[\\/]* ) ac_abs_top_builddir=${ac_top_builddir}.;; - *) ac_abs_top_builddir=$ac_abs_builddir/${ac_top_builddir}.;; - esac;; -esac -case $ac_abs_builddir in -.) ac_abs_srcdir=$ac_srcdir;; -*) - case $ac_srcdir in - .) ac_abs_srcdir=$ac_abs_builddir;; - [\\/]* | ?:[\\/]* ) ac_abs_srcdir=$ac_srcdir;; - *) ac_abs_srcdir=$ac_abs_builddir/$ac_srcdir;; - esac;; -esac -case $ac_abs_builddir in -.) ac_abs_top_srcdir=$ac_top_srcdir;; -*) - case $ac_top_srcdir in - .) ac_abs_top_srcdir=$ac_abs_builddir;; - [\\/]* | ?:[\\/]* ) ac_abs_top_srcdir=$ac_top_srcdir;; - *) ac_abs_top_srcdir=$ac_abs_builddir/$ac_top_srcdir;; - esac;; -esac - - cd $ac_dir - # Check for guested configure; otherwise get Cygnus style configure. - if test -f $ac_srcdir/configure.gnu; then - echo - $SHELL $ac_srcdir/configure.gnu --help=recursive - elif test -f $ac_srcdir/configure; then - echo - $SHELL $ac_srcdir/configure --help=recursive - elif test -f $ac_srcdir/configure.ac || - test -f $ac_srcdir/configure.in; then - echo - $ac_configure --help + cd "$ac_dir" || { ac_status=$?; continue; } + # Check for guested configure. + if test -f "$ac_srcdir/configure.gnu"; then + echo && + $SHELL "$ac_srcdir/configure.gnu" --help=recursive + elif test -f "$ac_srcdir/configure"; then + echo && + $SHELL "$ac_srcdir/configure" --help=recursive else - echo "$as_me: WARNING: no configuration information is in $ac_dir" >&2 - fi - cd "$ac_popdir" + $as_echo "$as_me: WARNING: no configuration information is in $ac_dir" >&2 + fi || ac_status=$? + cd "$ac_pwd" || { ac_status=$?; break; } done fi -test -n "$ac_init_help" && exit 0 +test -n "$ac_init_help" && exit $ac_status if $ac_init_version; then cat <<\_ACEOF -filtergen configure 0.12.4 -generated by GNU Autoconf 2.59 +filtergen configure 0.12.7 +generated by GNU Autoconf 2.69 -Copyright (C) 2003 Free Software Foundation, Inc. +Copyright (C) 2012 Free Software Foundation, Inc. This configure script is free software; the Free Software Foundation gives unlimited permission to copy, distribute and modify it. _ACEOF - exit 0 + exit fi -exec 5>config.log -cat >&5 <<_ACEOF -This file contains any messages produced by compilers while -running configure, to aid debugging if configure makes a mistake. - -It was created by filtergen $as_me 0.12.4, which was -generated by GNU Autoconf 2.59. Invocation command line was - - $ $0 $@ -_ACEOF +## ------------------------ ## +## Autoconf initialization. ## +## ------------------------ ## + +# ac_fn_c_try_compile LINENO +# -------------------------- +# Try to compile conftest.$ac_ext, and return whether this succeeded. +ac_fn_c_try_compile () { -cat <<_ASUNAME -## --------- ## -## Platform. ## -## --------- ## - -hostname = `(hostname || uname -n) 2>/dev/null | sed 1q` -uname -m = `(uname -m) 2>/dev/null || echo unknown` -uname -r = `(uname -r) 2>/dev/null || echo unknown` -uname -s = `(uname -s) 2>/dev/null || echo unknown` -uname -v = `(uname -v) 2>/dev/null || echo unknown` - -/usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null || echo unknown` -/bin/uname -X = `(/bin/uname -X) 2>/dev/null || echo unknown` - -/bin/arch = `(/bin/arch) 2>/dev/null || echo unknown` -/usr/bin/arch -k = `(/usr/bin/arch -k) 2>/dev/null || echo unknown` -/usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null || echo unknown` -hostinfo = `(hostinfo) 2>/dev/null || echo unknown` -/bin/machine = `(/bin/machine) 2>/dev/null || echo unknown` -/usr/bin/oslevel = `(/usr/bin/oslevel) 2>/dev/null || echo unknown` -/bin/universe = `(/bin/universe) 2>/dev/null || echo unknown` + as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + rm -f conftest.$ac_objext + if { { ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_compile") 2>conftest.err + ac_status=$? + if test -s conftest.err; then + grep -v '^ *+' conftest.err >conftest.er1 + cat conftest.er1 >&5 + mv -f conftest.er1 conftest.err + fi + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then : + ac_retval=0 +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 -_ASUNAME + ac_retval=1 +fi + eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno + as_fn_set_status $ac_retval -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - echo "PATH: $as_dir" -done +} # ac_fn_c_try_compile -} >&5 +# ac_fn_c_try_link LINENO +# ----------------------- +# Try to link conftest.$ac_ext, and return whether this succeeded. +ac_fn_c_try_link () +{ + as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + rm -f conftest.$ac_objext conftest$ac_exeext + if { { ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_link") 2>conftest.err + ac_status=$? + if test -s conftest.err; then + grep -v '^ *+' conftest.err >conftest.er1 + cat conftest.er1 >&5 + mv -f conftest.er1 conftest.err + fi + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest$ac_exeext && { + test "$cross_compiling" = yes || + test -x conftest$ac_exeext + }; then : + ac_retval=0 +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 -cat >&5 <<_ACEOF + ac_retval=1 +fi + # Delete the IPA/IPO (Inter Procedural Analysis/Optimization) information + # created by the PGI compiler (conftest_ipa8_conftest.oo), as it would + # interfere with the next link command; also delete a directory that is + # left behind by Apple's compiler. We do this before executing the actions. + rm -rf conftest.dSYM conftest_ipa8_conftest.oo + eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno + as_fn_set_status $ac_retval + +} # ac_fn_c_try_link + +# ac_fn_c_try_cpp LINENO +# ---------------------- +# Try to preprocess conftest.$ac_ext, and return whether this succeeded. +ac_fn_c_try_cpp () +{ + as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + if { { ac_try="$ac_cpp conftest.$ac_ext" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_cpp conftest.$ac_ext") 2>conftest.err + ac_status=$? + if test -s conftest.err; then + grep -v '^ *+' conftest.err >conftest.er1 + cat conftest.er1 >&5 + mv -f conftest.er1 conftest.err + fi + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } > conftest.i && { + test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || + test ! -s conftest.err + }; then : + ac_retval=0 +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + ac_retval=1 +fi + eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno + as_fn_set_status $ac_retval -## ----------- ## -## Core tests. ## -## ----------- ## +} # ac_fn_c_try_cpp -_ACEOF +# ac_fn_c_check_header_mongrel LINENO HEADER VAR INCLUDES +# ------------------------------------------------------- +# Tests whether HEADER exists, giving a warning if it cannot be compiled using +# the include files in INCLUDES and setting the cache variable VAR +# accordingly. +ac_fn_c_check_header_mongrel () +{ + as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + if eval \${$3+:} false; then : + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 +$as_echo_n "checking for $2... " >&6; } +if eval \${$3+:} false; then : + $as_echo_n "(cached) " >&6 +fi +eval ac_res=\$$3 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 +$as_echo "$ac_res" >&6; } +else + # Is the header compilable? +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking $2 usability" >&5 +$as_echo_n "checking $2 usability... " >&6; } +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +$4 +#include <$2> +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + ac_header_compiler=yes +else + ac_header_compiler=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_header_compiler" >&5 +$as_echo "$ac_header_compiler" >&6; } + +# Is the header present? +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking $2 presence" >&5 +$as_echo_n "checking $2 presence... " >&6; } +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include <$2> +_ACEOF +if ac_fn_c_try_cpp "$LINENO"; then : + ac_header_preproc=yes +else + ac_header_preproc=no +fi +rm -f conftest.err conftest.i conftest.$ac_ext +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_header_preproc" >&5 +$as_echo "$ac_header_preproc" >&6; } + +# So? What about this header? +case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in #(( + yes:no: ) + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: accepted by the compiler, rejected by the preprocessor!" >&5 +$as_echo "$as_me: WARNING: $2: accepted by the compiler, rejected by the preprocessor!" >&2;} + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: proceeding with the compiler's result" >&5 +$as_echo "$as_me: WARNING: $2: proceeding with the compiler's result" >&2;} + ;; + no:yes:* ) + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: present but cannot be compiled" >&5 +$as_echo "$as_me: WARNING: $2: present but cannot be compiled" >&2;} + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: check for missing prerequisite headers?" >&5 +$as_echo "$as_me: WARNING: $2: check for missing prerequisite headers?" >&2;} + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: see the Autoconf documentation" >&5 +$as_echo "$as_me: WARNING: $2: see the Autoconf documentation" >&2;} + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: section \"Present But Cannot Be Compiled\"" >&5 +$as_echo "$as_me: WARNING: $2: section \"Present But Cannot Be Compiled\"" >&2;} + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: proceeding with the compiler's result" >&5 +$as_echo "$as_me: WARNING: $2: proceeding with the compiler's result" >&2;} +( $as_echo "## --------------------------------- ## +## Report this to jaq@spacepants.org ## +## --------------------------------- ##" + ) | sed "s/^/$as_me: WARNING: /" >&2 + ;; +esac + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 +$as_echo_n "checking for $2... " >&6; } +if eval \${$3+:} false; then : + $as_echo_n "(cached) " >&6 +else + eval "$3=\$ac_header_compiler" +fi +eval ac_res=\$$3 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 +$as_echo "$ac_res" >&6; } +fi + eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno + +} # ac_fn_c_check_header_mongrel + +# ac_fn_c_try_run LINENO +# ---------------------- +# Try to link conftest.$ac_ext, and return whether this succeeded. Assumes +# that executables *can* be run. +ac_fn_c_try_run () +{ + as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + if { { ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_link") 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } && { ac_try='./conftest$ac_exeext' + { { case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; }; then : + ac_retval=0 +else + $as_echo "$as_me: program exited with status $ac_status" >&5 + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_retval=$ac_status +fi + rm -rf conftest.dSYM conftest_ipa8_conftest.oo + eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno + as_fn_set_status $ac_retval + +} # ac_fn_c_try_run + +# ac_fn_c_check_header_compile LINENO HEADER VAR INCLUDES +# ------------------------------------------------------- +# Tests whether HEADER exists and can be compiled using the include files in +# INCLUDES, setting the cache variable VAR accordingly. +ac_fn_c_check_header_compile () +{ + as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 +$as_echo_n "checking for $2... " >&6; } +if eval \${$3+:} false; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +$4 +#include <$2> +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + eval "$3=yes" +else + eval "$3=no" +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +eval ac_res=\$$3 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 +$as_echo "$ac_res" >&6; } + eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno + +} # ac_fn_c_check_header_compile +cat >config.log <<_ACEOF +This file contains any messages produced by compilers while +running configure, to aid debugging if configure makes a mistake. + +It was created by filtergen $as_me 0.12.7, which was +generated by GNU Autoconf 2.69. Invocation command line was + + $ $0 $@ + +_ACEOF +exec 5>>config.log +{ +cat <<_ASUNAME +## --------- ## +## Platform. ## +## --------- ## + +hostname = `(hostname || uname -n) 2>/dev/null | sed 1q` +uname -m = `(uname -m) 2>/dev/null || echo unknown` +uname -r = `(uname -r) 2>/dev/null || echo unknown` +uname -s = `(uname -s) 2>/dev/null || echo unknown` +uname -v = `(uname -v) 2>/dev/null || echo unknown` + +/usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null || echo unknown` +/bin/uname -X = `(/bin/uname -X) 2>/dev/null || echo unknown` + +/bin/arch = `(/bin/arch) 2>/dev/null || echo unknown` +/usr/bin/arch -k = `(/usr/bin/arch -k) 2>/dev/null || echo unknown` +/usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null || echo unknown` +/usr/bin/hostinfo = `(/usr/bin/hostinfo) 2>/dev/null || echo unknown` +/bin/machine = `(/bin/machine) 2>/dev/null || echo unknown` +/usr/bin/oslevel = `(/usr/bin/oslevel) 2>/dev/null || echo unknown` +/bin/universe = `(/bin/universe) 2>/dev/null || echo unknown` + +_ASUNAME + +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + $as_echo "PATH: $as_dir" + done +IFS=$as_save_IFS + +} >&5 + +cat >&5 <<_ACEOF + + +## ----------- ## +## Core tests. ## +## ----------- ## + +_ACEOF # Keep a trace of the command line. @@ -1036,7 +1827,6 @@ ac_configure_args= ac_configure_args0= ac_configure_args1= -ac_sep= ac_must_keep_next=false for ac_pass in 1 2 do @@ -1047,13 +1837,13 @@ -q | -quiet | --quiet | --quie | --qui | --qu | --q \ | -silent | --silent | --silen | --sile | --sil) continue ;; - *" "*|*" "*|*[\[\]\~\#\$\^\&\*\(\)\{\}\\\|\;\<\>\?\"\']*) - ac_arg=`echo "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;; + *\'*) + ac_arg=`$as_echo "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;; esac case $ac_pass in - 1) ac_configure_args0="$ac_configure_args0 '$ac_arg'" ;; + 1) as_fn_append ac_configure_args0 " '$ac_arg'" ;; 2) - ac_configure_args1="$ac_configure_args1 '$ac_arg'" + as_fn_append ac_configure_args1 " '$ac_arg'" if test $ac_must_keep_next = true; then ac_must_keep_next=false # Got value, back to normal. else @@ -1069,104 +1859,115 @@ -* ) ac_must_keep_next=true ;; esac fi - ac_configure_args="$ac_configure_args$ac_sep'$ac_arg'" - # Get rid of the leading space. - ac_sep=" " + as_fn_append ac_configure_args " '$ac_arg'" ;; esac done done -$as_unset ac_configure_args0 || test "${ac_configure_args0+set}" != set || { ac_configure_args0=; export ac_configure_args0; } -$as_unset ac_configure_args1 || test "${ac_configure_args1+set}" != set || { ac_configure_args1=; export ac_configure_args1; } +{ ac_configure_args0=; unset ac_configure_args0;} +{ ac_configure_args1=; unset ac_configure_args1;} # When interrupted or exit'd, cleanup temporary files, and complete # config.log. We remove comments because anyway the quotes in there # would cause problems or look ugly. -# WARNING: Be sure not to use single quotes in there, as some shells, -# such as our DU 5.0 friend, will then `close' the trap. +# WARNING: Use '\'' to represent an apostrophe within the trap. +# WARNING: Do not start the trap code with a newline, due to a FreeBSD 4.0 bug. trap 'exit_status=$? # Save into config.log some information that might help in debugging. { echo - cat <<\_ASBOX -## ---------------- ## + $as_echo "## ---------------- ## ## Cache variables. ## -## ---------------- ## -_ASBOX +## ---------------- ##" echo # The following way of writing the cache mishandles newlines in values, -{ +( + for ac_var in `(set) 2>&1 | sed -n '\''s/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'\''`; do + eval ac_val=\$$ac_var + case $ac_val in #( + *${as_nl}*) + case $ac_var in #( + *_cv_*) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: cache variable $ac_var contains a newline" >&5 +$as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;; + esac + case $ac_var in #( + _ | IFS | as_nl) ;; #( + BASH_ARGV | BASH_SOURCE) eval $ac_var= ;; #( + *) { eval $ac_var=; unset $ac_var;} ;; + esac ;; + esac + done (set) 2>&1 | - case `(ac_space='"'"' '"'"'; set | grep ac_space) 2>&1` in - *ac_space=\ *) + case $as_nl`(ac_space='\'' '\''; set) 2>&1` in #( + *${as_nl}ac_space=\ *) sed -n \ - "s/'"'"'/'"'"'\\\\'"'"''"'"'/g; - s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='"'"'\\2'"'"'/p" - ;; + "s/'\''/'\''\\\\'\'''\''/g; + s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\''\\2'\''/p" + ;; #( *) - sed -n \ - "s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1=\\2/p" + sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p" ;; - esac; -} + esac | + sort +) echo - cat <<\_ASBOX -## ----------------- ## + $as_echo "## ----------------- ## ## Output variables. ## -## ----------------- ## -_ASBOX +## ----------------- ##" echo for ac_var in $ac_subst_vars do - eval ac_val=$`echo $ac_var` - echo "$ac_var='"'"'$ac_val'"'"'" + eval ac_val=\$$ac_var + case $ac_val in + *\'\''*) ac_val=`$as_echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;; + esac + $as_echo "$ac_var='\''$ac_val'\''" done | sort echo if test -n "$ac_subst_files"; then - cat <<\_ASBOX -## ------------- ## -## Output files. ## -## ------------- ## -_ASBOX + $as_echo "## ------------------- ## +## File substitutions. ## +## ------------------- ##" echo for ac_var in $ac_subst_files do - eval ac_val=$`echo $ac_var` - echo "$ac_var='"'"'$ac_val'"'"'" + eval ac_val=\$$ac_var + case $ac_val in + *\'\''*) ac_val=`$as_echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;; + esac + $as_echo "$ac_var='\''$ac_val'\''" done | sort echo fi if test -s confdefs.h; then - cat <<\_ASBOX -## ----------- ## + $as_echo "## ----------- ## ## confdefs.h. ## -## ----------- ## -_ASBOX +## ----------- ##" echo - sed "/^$/d" confdefs.h | sort + cat confdefs.h echo fi test "$ac_signal" != 0 && - echo "$as_me: caught signal $ac_signal" - echo "$as_me: exit $exit_status" + $as_echo "$as_me: caught signal $ac_signal" + $as_echo "$as_me: exit $exit_status" } >&5 - rm -f core *.core && - rm -rf conftest* confdefs* conf$$* $ac_clean_files && + rm -f core *.core core.conftest.* && + rm -f -r conftest* confdefs* conf$$* $ac_clean_files && exit $exit_status - ' 0 +' 0 for ac_signal in 1 2 13 15; do - trap 'ac_signal='$ac_signal'; { (exit 1); exit 1; }' $ac_signal + trap 'ac_signal='$ac_signal'; as_fn_exit 1' $ac_signal done ac_signal=0 # confdefs.h avoids OS command line length limits that DEFS can exceed. -rm -rf conftest* confdefs.h -# AIX cpp loses on an empty file, so make sure it contains at least a newline. -echo >confdefs.h +rm -f -r conftest* confdefs.h + +$as_echo "/* confdefs.h */" > confdefs.h # Predefined preprocessor variables. @@ -1174,112 +1975,137 @@ #define PACKAGE_NAME "$PACKAGE_NAME" _ACEOF - cat >>confdefs.h <<_ACEOF #define PACKAGE_TARNAME "$PACKAGE_TARNAME" _ACEOF - cat >>confdefs.h <<_ACEOF #define PACKAGE_VERSION "$PACKAGE_VERSION" _ACEOF - cat >>confdefs.h <<_ACEOF #define PACKAGE_STRING "$PACKAGE_STRING" _ACEOF - cat >>confdefs.h <<_ACEOF #define PACKAGE_BUGREPORT "$PACKAGE_BUGREPORT" _ACEOF +cat >>confdefs.h <<_ACEOF +#define PACKAGE_URL "$PACKAGE_URL" +_ACEOF + # Let the site file select an alternate cache file if it wants to. -# Prefer explicitly selected file to automatically selected ones. -if test -z "$CONFIG_SITE"; then - if test "x$prefix" != xNONE; then - CONFIG_SITE="$prefix/share/config.site $prefix/etc/config.site" - else - CONFIG_SITE="$ac_default_prefix/share/config.site $ac_default_prefix/etc/config.site" - fi +# Prefer an explicitly selected file to automatically selected ones. +ac_site_file1=NONE +ac_site_file2=NONE +if test -n "$CONFIG_SITE"; then + # We do not want a PATH search for config.site. + case $CONFIG_SITE in #(( + -*) ac_site_file1=./$CONFIG_SITE;; + */*) ac_site_file1=$CONFIG_SITE;; + *) ac_site_file1=./$CONFIG_SITE;; + esac +elif test "x$prefix" != xNONE; then + ac_site_file1=$prefix/share/config.site + ac_site_file2=$prefix/etc/config.site +else + ac_site_file1=$ac_default_prefix/share/config.site + ac_site_file2=$ac_default_prefix/etc/config.site fi -for ac_site_file in $CONFIG_SITE; do - if test -r "$ac_site_file"; then - { echo "$as_me:$LINENO: loading site script $ac_site_file" >&5 -echo "$as_me: loading site script $ac_site_file" >&6;} +for ac_site_file in "$ac_site_file1" "$ac_site_file2" +do + test "x$ac_site_file" = xNONE && continue + if test /dev/null != "$ac_site_file" && test -r "$ac_site_file"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: loading site script $ac_site_file" >&5 +$as_echo "$as_me: loading site script $ac_site_file" >&6;} sed 's/^/| /' "$ac_site_file" >&5 - . "$ac_site_file" + . "$ac_site_file" \ + || { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error $? "failed to load site script $ac_site_file +See \`config.log' for more details" "$LINENO" 5; } fi done if test -r "$cache_file"; then - # Some versions of bash will fail to source /dev/null (special - # files actually), so we avoid doing that. - if test -f "$cache_file"; then - { echo "$as_me:$LINENO: loading cache $cache_file" >&5 -echo "$as_me: loading cache $cache_file" >&6;} + # Some versions of bash will fail to source /dev/null (special files + # actually), so we avoid doing that. DJGPP emulates it as a regular file. + if test /dev/null != "$cache_file" && test -f "$cache_file"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: loading cache $cache_file" >&5 +$as_echo "$as_me: loading cache $cache_file" >&6;} case $cache_file in - [\\/]* | ?:[\\/]* ) . $cache_file;; - *) . ./$cache_file;; + [\\/]* | ?:[\\/]* ) . "$cache_file";; + *) . "./$cache_file";; esac fi else - { echo "$as_me:$LINENO: creating cache $cache_file" >&5 -echo "$as_me: creating cache $cache_file" >&6;} + { $as_echo "$as_me:${as_lineno-$LINENO}: creating cache $cache_file" >&5 +$as_echo "$as_me: creating cache $cache_file" >&6;} >$cache_file fi # Check that the precious variables saved in the cache have kept the same # value. ac_cache_corrupted=false -for ac_var in `(set) 2>&1 | - sed -n 's/^ac_env_\([a-zA-Z_0-9]*\)_set=.*/\1/p'`; do +for ac_var in $ac_precious_vars; do eval ac_old_set=\$ac_cv_env_${ac_var}_set eval ac_new_set=\$ac_env_${ac_var}_set - eval ac_old_val="\$ac_cv_env_${ac_var}_value" - eval ac_new_val="\$ac_env_${ac_var}_value" + eval ac_old_val=\$ac_cv_env_${ac_var}_value + eval ac_new_val=\$ac_env_${ac_var}_value case $ac_old_set,$ac_new_set in set,) - { echo "$as_me:$LINENO: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&5 -echo "$as_me: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&2;} + { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&5 +$as_echo "$as_me: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&2;} ac_cache_corrupted=: ;; ,set) - { echo "$as_me:$LINENO: error: \`$ac_var' was not set in the previous run" >&5 -echo "$as_me: error: \`$ac_var' was not set in the previous run" >&2;} + { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' was not set in the previous run" >&5 +$as_echo "$as_me: error: \`$ac_var' was not set in the previous run" >&2;} ac_cache_corrupted=: ;; ,);; *) if test "x$ac_old_val" != "x$ac_new_val"; then - { echo "$as_me:$LINENO: error: \`$ac_var' has changed since the previous run:" >&5 -echo "$as_me: error: \`$ac_var' has changed since the previous run:" >&2;} - { echo "$as_me:$LINENO: former value: $ac_old_val" >&5 -echo "$as_me: former value: $ac_old_val" >&2;} - { echo "$as_me:$LINENO: current value: $ac_new_val" >&5 -echo "$as_me: current value: $ac_new_val" >&2;} - ac_cache_corrupted=: + # differences in whitespace do not lead to failure. + ac_old_val_w=`echo x $ac_old_val` + ac_new_val_w=`echo x $ac_new_val` + if test "$ac_old_val_w" != "$ac_new_val_w"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' has changed since the previous run:" >&5 +$as_echo "$as_me: error: \`$ac_var' has changed since the previous run:" >&2;} + ac_cache_corrupted=: + else + { $as_echo "$as_me:${as_lineno-$LINENO}: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&5 +$as_echo "$as_me: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&2;} + eval $ac_var=\$ac_old_val + fi + { $as_echo "$as_me:${as_lineno-$LINENO}: former value: \`$ac_old_val'" >&5 +$as_echo "$as_me: former value: \`$ac_old_val'" >&2;} + { $as_echo "$as_me:${as_lineno-$LINENO}: current value: \`$ac_new_val'" >&5 +$as_echo "$as_me: current value: \`$ac_new_val'" >&2;} fi;; esac # Pass precious variables to config.status. if test "$ac_new_set" = set; then case $ac_new_val in - *" "*|*" "*|*[\[\]\~\#\$\^\&\*\(\)\{\}\\\|\;\<\>\?\"\']*) - ac_arg=$ac_var=`echo "$ac_new_val" | sed "s/'/'\\\\\\\\''/g"` ;; + *\'*) ac_arg=$ac_var=`$as_echo "$ac_new_val" | sed "s/'/'\\\\\\\\''/g"` ;; *) ac_arg=$ac_var=$ac_new_val ;; esac case " $ac_configure_args " in *" '$ac_arg' "*) ;; # Avoid dups. Use of quotes ensures accuracy. - *) ac_configure_args="$ac_configure_args '$ac_arg'" ;; + *) as_fn_append ac_configure_args " '$ac_arg'" ;; esac fi done if $ac_cache_corrupted; then - { echo "$as_me:$LINENO: error: changes in the environment can compromise the build" >&5 -echo "$as_me: error: changes in the environment can compromise the build" >&2;} - { { echo "$as_me:$LINENO: error: run \`make distclean' and/or \`rm $cache_file' and start over" >&5 -echo "$as_me: error: run \`make distclean' and/or \`rm $cache_file' and start over" >&2;} - { (exit 1); exit 1; }; } -fi + { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} + { $as_echo "$as_me:${as_lineno-$LINENO}: error: changes in the environment can compromise the build" >&5 +$as_echo "$as_me: error: changes in the environment can compromise the build" >&2;} + as_fn_error $? "run \`make distclean' and/or \`rm $cache_file' and start over" "$LINENO" 5 +fi +## -------------------- ## +## Main body of script. ## +## -------------------- ## ac_ext=c ac_cpp='$CPP $CPPFLAGS' @@ -1289,55 +2115,40 @@ - - - - - - - - - - - - - - - - - - - - - - - - -am__api_version="1.8" ac_aux_dir= -for ac_dir in $srcdir $srcdir/.. $srcdir/../..; do - if test -f $ac_dir/install-sh; then +for ac_dir in . "$srcdir"/.; do + if test -f "$ac_dir/install-sh"; then ac_aux_dir=$ac_dir ac_install_sh="$ac_aux_dir/install-sh -c" break - elif test -f $ac_dir/install.sh; then + elif test -f "$ac_dir/install.sh"; then ac_aux_dir=$ac_dir ac_install_sh="$ac_aux_dir/install.sh -c" break - elif test -f $ac_dir/shtool; then + elif test -f "$ac_dir/shtool"; then ac_aux_dir=$ac_dir ac_install_sh="$ac_aux_dir/shtool install -c" break fi done if test -z "$ac_aux_dir"; then - { { echo "$as_me:$LINENO: error: cannot find install-sh or install.sh in $srcdir $srcdir/.. $srcdir/../.." >&5 -echo "$as_me: error: cannot find install-sh or install.sh in $srcdir $srcdir/.. $srcdir/../.." >&2;} - { (exit 1); exit 1; }; } -fi -ac_config_guess="$SHELL $ac_aux_dir/config.guess" -ac_config_sub="$SHELL $ac_aux_dir/config.sub" -ac_configure="$SHELL $ac_aux_dir/configure" # This should be Cygnus configure. + as_fn_error $? "cannot find install-sh, install.sh, or shtool in . \"$srcdir\"/." "$LINENO" 5 +fi + +# These three variables are undocumented and unsupported, +# and are intended to be withdrawn in a future Autoconf release. +# They can cause serious problems if a builder's source tree is in a directory +# whose full name contains unusual characters. +ac_config_guess="$SHELL $ac_aux_dir/config.guess" # Please don't use this var. +ac_config_sub="$SHELL $ac_aux_dir/config.sub" # Please don't use this var. +ac_configure="$SHELL $ac_aux_dir/configure" # Please don't use this var. + + + +ac_config_headers="$ac_config_headers config.h" + + +am__api_version='1.15' # Find a good install program. We prefer a C program (faster), # so one script is as good as another. But avoid the broken or @@ -1352,22 +2163,23 @@ # SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff" # OS/2's system install, which has a completely different semantic # ./install, which can be erroneously created by make from ./install.sh. -echo "$as_me:$LINENO: checking for a BSD-compatible install" >&5 -echo $ECHO_N "checking for a BSD-compatible install... $ECHO_C" >&6 +# Reject install programs that cannot install multiple files. +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for a BSD-compatible install" >&5 +$as_echo_n "checking for a BSD-compatible install... " >&6; } if test -z "$INSTALL"; then -if test "${ac_cv_path_install+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 +if ${ac_cv_path_install+:} false; then : + $as_echo_n "(cached) " >&6 else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. - # Account for people who put trailing slashes in PATH elements. -case $as_dir/ in - ./ | .// | /cC/* | \ + # Account for people who put trailing slashes in PATH elements. +case $as_dir/ in #(( + ./ | .// | /[cC]/* | \ /etc/* | /usr/sbin/* | /usr/etc/* | /sbin/* | /usr/afsws/bin/* | \ - ?:\\/os2\\/install\\/* | ?:\\/OS2\\/INSTALL\\/* | \ + ?:[\\/]os2[\\/]install[\\/]* | ?:[\\/]OS2[\\/]INSTALL[\\/]* | \ /usr/ucb/* ) ;; *) # OSF1 and SCO ODT 3.0 have their own names for install. @@ -1375,7 +2187,7 @@ # by default. for ac_prog in ginstall scoinst install; do for ac_exec_ext in '' $ac_executable_extensions; do - if $as_executable_p "$as_dir/$ac_prog$ac_exec_ext"; then + if as_fn_executable_p "$as_dir/$ac_prog$ac_exec_ext"; then if test $ac_prog = install && grep dspmsg "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then # AIX install. It has an incompatible calling convention. @@ -1385,30 +2197,43 @@ # program-specific install script used by HP pwplus--don't use. : else - ac_cv_path_install="$as_dir/$ac_prog$ac_exec_ext -c" - break 3 + rm -rf conftest.one conftest.two conftest.dir + echo one > conftest.one + echo two > conftest.two + mkdir conftest.dir + if "$as_dir/$ac_prog$ac_exec_ext" -c conftest.one conftest.two "`pwd`/conftest.dir" && + test -s conftest.one && test -s conftest.two && + test -s conftest.dir/conftest.one && + test -s conftest.dir/conftest.two + then + ac_cv_path_install="$as_dir/$ac_prog$ac_exec_ext -c" + break 3 + fi fi fi done done ;; esac -done + done +IFS=$as_save_IFS + +rm -rf conftest.one conftest.two conftest.dir fi if test "${ac_cv_path_install+set}" = set; then INSTALL=$ac_cv_path_install else - # As a last resort, use the slow shell script. We don't cache a - # path for INSTALL within a source directory, because that will + # As a last resort, use the slow shell script. Don't cache a + # value for INSTALL within a source directory, because that will # break other packages using the cache if that directory is - # removed, or if the path is relative. + # removed, or if the value is a relative name. INSTALL=$ac_install_sh fi fi -echo "$as_me:$LINENO: result: $INSTALL" >&5 -echo "${ECHO_T}$INSTALL" >&6 +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $INSTALL" >&5 +$as_echo "$INSTALL" >&6; } # Use test -z because SunOS4 sh mishandles braces in ${var-val}. # It thinks the first close brace ends the variable substitution. @@ -1418,110 +2243,262 @@ test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644' -echo "$as_me:$LINENO: checking whether build environment is sane" >&5 -echo $ECHO_N "checking whether build environment is sane... $ECHO_C" >&6 -# Just in case -sleep 1 -echo timestamp > conftest.file -# Do `set' in a subshell so we don't clobber the current shell's +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether build environment is sane" >&5 +$as_echo_n "checking whether build environment is sane... " >&6; } +# Reject unsafe characters in $srcdir or the absolute working directory +# name. Accept space and tab only in the latter. +am_lf=' +' +case `pwd` in + *[\\\"\#\$\&\'\`$am_lf]*) + as_fn_error $? "unsafe absolute working directory name" "$LINENO" 5;; +esac +case $srcdir in + *[\\\"\#\$\&\'\`$am_lf\ \ ]*) + as_fn_error $? "unsafe srcdir value: '$srcdir'" "$LINENO" 5;; +esac + +# Do 'set' in a subshell so we don't clobber the current shell's # arguments. Must try -L first in case configure is actually a # symlink; some systems play weird games with the mod time of symlinks # (eg FreeBSD returns the mod time of the symlink's containing # directory). if ( - set X `ls -Lt $srcdir/configure conftest.file 2> /dev/null` - if test "$*" = "X"; then - # -L didn't work. - set X `ls -t $srcdir/configure conftest.file` - fi - rm -f conftest.file - if test "$*" != "X $srcdir/configure conftest.file" \ - && test "$*" != "X conftest.file $srcdir/configure"; then - - # If neither matched, then we have a broken ls. This can happen - # if, for instance, CONFIG_SHELL is bash and it inherits a - # broken ls alias from the environment. This has actually - # happened. Such a system could not be considered "sane". - { { echo "$as_me:$LINENO: error: ls -t appears to fail. Make sure there is not a broken -alias in your environment" >&5 -echo "$as_me: error: ls -t appears to fail. Make sure there is not a broken -alias in your environment" >&2;} - { (exit 1); exit 1; }; } - fi + am_has_slept=no + for am_try in 1 2; do + echo "timestamp, slept: $am_has_slept" > conftest.file + set X `ls -Lt "$srcdir/configure" conftest.file 2> /dev/null` + if test "$*" = "X"; then + # -L didn't work. + set X `ls -t "$srcdir/configure" conftest.file` + fi + if test "$*" != "X $srcdir/configure conftest.file" \ + && test "$*" != "X conftest.file $srcdir/configure"; then + # If neither matched, then we have a broken ls. This can happen + # if, for instance, CONFIG_SHELL is bash and it inherits a + # broken ls alias from the environment. This has actually + # happened. Such a system could not be considered "sane". + as_fn_error $? "ls -t appears to fail. Make sure there is not a broken + alias in your environment" "$LINENO" 5 + fi + if test "$2" = conftest.file || test $am_try -eq 2; then + break + fi + # Just in case. + sleep 1 + am_has_slept=yes + done test "$2" = conftest.file ) then # Ok. : else - { { echo "$as_me:$LINENO: error: newly created file is older than distributed files! -Check your system clock" >&5 -echo "$as_me: error: newly created file is older than distributed files! -Check your system clock" >&2;} - { (exit 1); exit 1; }; } + as_fn_error $? "newly created file is older than distributed files! +Check your system clock" "$LINENO" 5 +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } +# If we didn't sleep, we still need to ensure time stamps of config.status and +# generated files are strictly newer. +am_sleep_pid= +if grep 'slept: no' conftest.file >/dev/null 2>&1; then + ( sleep 1 ) & + am_sleep_pid=$! fi -echo "$as_me:$LINENO: result: yes" >&5 -echo "${ECHO_T}yes" >&6 + +rm -f conftest.file + test "$program_prefix" != NONE && - program_transform_name="s,^,$program_prefix,;$program_transform_name" + program_transform_name="s&^&$program_prefix&;$program_transform_name" # Use a double $ so make ignores it. test "$program_suffix" != NONE && - program_transform_name="s,\$,$program_suffix,;$program_transform_name" -# Double any \ or $. echo might interpret backslashes. + program_transform_name="s&\$&$program_suffix&;$program_transform_name" +# Double any \ or $. # By default was `s,x,x', remove it if useless. -cat <<\_ACEOF >conftest.sed -s/[\\$]/&&/g;s/;s,x,x,$// -_ACEOF -program_transform_name=`echo $program_transform_name | sed -f conftest.sed` -rm conftest.sed +ac_script='s/[\\$]/&&/g;s/;s,x,x,$//' +program_transform_name=`$as_echo "$program_transform_name" | sed "$ac_script"` -# expand $ac_aux_dir to an absolute path -am_aux_dir=`cd $ac_aux_dir && pwd` +# Expand $ac_aux_dir to an absolute path. +am_aux_dir=`cd "$ac_aux_dir" && pwd` -test x"${MISSING+set}" = xset || MISSING="\${SHELL} $am_aux_dir/missing" +if test x"${MISSING+set}" != xset; then + case $am_aux_dir in + *\ * | *\ *) + MISSING="\${SHELL} \"$am_aux_dir/missing\"" ;; + *) + MISSING="\${SHELL} $am_aux_dir/missing" ;; + esac +fi # Use eval to expand $SHELL -if eval "$MISSING --run true"; then - am_missing_run="$MISSING --run " +if eval "$MISSING --is-lightweight"; then + am_missing_run="$MISSING " else am_missing_run= - { echo "$as_me:$LINENO: WARNING: \`missing' script is too old or missing" >&5 -echo "$as_me: WARNING: \`missing' script is too old or missing" >&2;} + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: 'missing' script is too old or missing" >&5 +$as_echo "$as_me: WARNING: 'missing' script is too old or missing" >&2;} fi -if mkdir -p --version . >/dev/null 2>&1 && test ! -d ./--version; then - # Keeping the `.' argument allows $(mkdir_p) to be used without - # argument. Indeed, we sometimes output rules like - # $(mkdir_p) $(somedir) - # where $(somedir) is conditionally defined. - # (`test -n '$(somedir)' && $(mkdir_p) $(somedir)' is a more - # expensive solution, as it forces Make to start a sub-shell.) - mkdir_p='mkdir -p -- .' -else - # On NextStep and OpenStep, the `mkdir' command does not - # recognize any option. It will interpret all options as - # directories to create, and then abort because `.' already - # exists. - for d in ./-p ./--version; - do - test -d $d && rmdir $d +if test x"${install_sh+set}" != xset; then + case $am_aux_dir in + *\ * | *\ *) + install_sh="\${SHELL} '$am_aux_dir/install-sh'" ;; + *) + install_sh="\${SHELL} $am_aux_dir/install-sh" + esac +fi + +# Installed binaries are usually stripped using 'strip' when the user +# run "make install-strip". However 'strip' might not be the right +# tool to use in cross-compilation environments, therefore Automake +# will honor the 'STRIP' environment variable to overrule this program. +if test "$cross_compiling" != no; then + if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}strip", so it can be a program name with args. +set dummy ${ac_tool_prefix}strip; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_STRIP+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$STRIP"; then + ac_cv_prog_STRIP="$STRIP" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_STRIP="${ac_tool_prefix}strip" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +STRIP=$ac_cv_prog_STRIP +if test -n "$STRIP"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $STRIP" >&5 +$as_echo "$STRIP" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + +fi +if test -z "$ac_cv_prog_STRIP"; then + ac_ct_STRIP=$STRIP + # Extract the first word of "strip", so it can be a program name with args. +set dummy strip; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_ac_ct_STRIP+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$ac_ct_STRIP"; then + ac_cv_prog_ac_ct_STRIP="$ac_ct_STRIP" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_ac_ct_STRIP="strip" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +ac_ct_STRIP=$ac_cv_prog_ac_ct_STRIP +if test -n "$ac_ct_STRIP"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_STRIP" >&5 +$as_echo "$ac_ct_STRIP" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + if test "x$ac_ct_STRIP" = x; then + STRIP=":" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + STRIP=$ac_ct_STRIP + fi +else + STRIP="$ac_cv_prog_STRIP" +fi + +fi +INSTALL_STRIP_PROGRAM="\$(install_sh) -c -s" + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for a thread-safe mkdir -p" >&5 +$as_echo_n "checking for a thread-safe mkdir -p... " >&6; } +if test -z "$MKDIR_P"; then + if ${ac_cv_path_mkdir+:} false; then : + $as_echo_n "(cached) " >&6 +else + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH$PATH_SEPARATOR/opt/sfw/bin +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_prog in mkdir gmkdir; do + for ac_exec_ext in '' $ac_executable_extensions; do + as_fn_executable_p "$as_dir/$ac_prog$ac_exec_ext" || continue + case `"$as_dir/$ac_prog$ac_exec_ext" --version 2>&1` in #( + 'mkdir (GNU coreutils) '* | \ + 'mkdir (coreutils) '* | \ + 'mkdir (fileutils) '4.1*) + ac_cv_path_mkdir=$as_dir/$ac_prog$ac_exec_ext + break 3;; + esac + done + done done - # $(mkinstalldirs) is defined by Automake if mkinstalldirs exists. - if test -f "$ac_aux_dir/mkinstalldirs"; then - mkdir_p='$(mkinstalldirs)' +IFS=$as_save_IFS + +fi + + test -d ./--version && rmdir ./--version + if test "${ac_cv_path_mkdir+set}" = set; then + MKDIR_P="$ac_cv_path_mkdir -p" else - mkdir_p='$(install_sh) -d' + # As a last resort, use the slow shell script. Don't cache a + # value for MKDIR_P within a source directory, because that will + # break other packages using the cache if that directory is + # removed, or if the value is a relative name. + MKDIR_P="$ac_install_sh -d" fi fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $MKDIR_P" >&5 +$as_echo "$MKDIR_P" >&6; } for ac_prog in gawk mawk nawk awk do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 -echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 -if test "${ac_cv_prog_AWK+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_AWK+:} false; then : + $as_echo_n "(cached) " >&6 else if test -n "$AWK"; then ac_cv_prog_AWK="$AWK" # Let the user override the test. @@ -1531,55 +2508,59 @@ do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_AWK="$ac_prog" - echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done -done + done +IFS=$as_save_IFS fi fi AWK=$ac_cv_prog_AWK if test -n "$AWK"; then - echo "$as_me:$LINENO: result: $AWK" >&5 -echo "${ECHO_T}$AWK" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $AWK" >&5 +$as_echo "$AWK" >&6; } else - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } fi + test -n "$AWK" && break done -echo "$as_me:$LINENO: checking whether ${MAKE-make} sets \$(MAKE)" >&5 -echo $ECHO_N "checking whether ${MAKE-make} sets \$(MAKE)... $ECHO_C" >&6 -set dummy ${MAKE-make}; ac_make=`echo "$2" | sed 'y,:./+-,___p_,'` -if eval "test \"\${ac_cv_prog_make_${ac_make}_set+set}\" = set"; then - echo $ECHO_N "(cached) $ECHO_C" >&6 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether ${MAKE-make} sets \$(MAKE)" >&5 +$as_echo_n "checking whether ${MAKE-make} sets \$(MAKE)... " >&6; } +set x ${MAKE-make} +ac_make=`$as_echo "$2" | sed 's/+/p/g; s/[^a-zA-Z0-9_]/_/g'` +if eval \${ac_cv_prog_make_${ac_make}_set+:} false; then : + $as_echo_n "(cached) " >&6 else cat >conftest.make <<\_ACEOF +SHELL = /bin/sh all: - @echo 'ac_maketemp="$(MAKE)"' + @echo '@@@%%%=$(MAKE)=@@@%%%' _ACEOF -# GNU make sometimes prints "make[1]: Entering...", which would confuse us. -eval `${MAKE-make} -f conftest.make 2>/dev/null | grep temp=` -if test -n "$ac_maketemp"; then - eval ac_cv_prog_make_${ac_make}_set=yes -else - eval ac_cv_prog_make_${ac_make}_set=no -fi +# GNU make sometimes prints "make[1]: Entering ...", which would confuse us. +case `${MAKE-make} -f conftest.make 2>/dev/null` in + *@@@%%%=?*=@@@%%%*) + eval ac_cv_prog_make_${ac_make}_set=yes;; + *) + eval ac_cv_prog_make_${ac_make}_set=no;; +esac rm -f conftest.make fi -if eval "test \"`echo '$ac_cv_prog_make_'${ac_make}_set`\" = yes"; then - echo "$as_me:$LINENO: result: yes" >&5 -echo "${ECHO_T}yes" >&6 +if eval test \$ac_cv_prog_make_${ac_make}_set = yes; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } SET_MAKE= else - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } SET_MAKE="MAKE=${MAKE-make}" fi @@ -1592,12 +2573,53 @@ fi rmdir .tst 2>/dev/null -# test to see if srcdir already configured -if test "`cd $srcdir && pwd`" != "`pwd`" && - test -f $srcdir/config.status; then - { { echo "$as_me:$LINENO: error: source directory already configured; run \"make distclean\" there first" >&5 -echo "$as_me: error: source directory already configured; run \"make distclean\" there first" >&2;} - { (exit 1); exit 1; }; } +# Check whether --enable-silent-rules was given. +if test "${enable_silent_rules+set}" = set; then : + enableval=$enable_silent_rules; +fi + +case $enable_silent_rules in # ((( + yes) AM_DEFAULT_VERBOSITY=0;; + no) AM_DEFAULT_VERBOSITY=1;; + *) AM_DEFAULT_VERBOSITY=1;; +esac +am_make=${MAKE-make} +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $am_make supports nested variables" >&5 +$as_echo_n "checking whether $am_make supports nested variables... " >&6; } +if ${am_cv_make_support_nested_variables+:} false; then : + $as_echo_n "(cached) " >&6 +else + if $as_echo 'TRUE=$(BAR$(V)) +BAR0=false +BAR1=true +V=1 +am__doit: + @$(TRUE) +.PHONY: am__doit' | $am_make -f - >/dev/null 2>&1; then + am_cv_make_support_nested_variables=yes +else + am_cv_make_support_nested_variables=no +fi +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_make_support_nested_variables" >&5 +$as_echo "$am_cv_make_support_nested_variables" >&6; } +if test $am_cv_make_support_nested_variables = yes; then + AM_V='$(V)' + AM_DEFAULT_V='$(AM_DEFAULT_VERBOSITY)' +else + AM_V=$AM_DEFAULT_VERBOSITY + AM_DEFAULT_V=$AM_DEFAULT_VERBOSITY +fi +AM_BACKSLASH='\' + +if test "`cd $srcdir && pwd`" != "`pwd`"; then + # Use -I$(srcdir) only when $(srcdir) != ., so that make's output + # is not polluted with repeated "-I." + am__isrc=' -I$(srcdir)' + # test to see if srcdir already configured + if test -f $srcdir/config.status; then + as_fn_error $? "source directory already configured; run \"make distclean\" there first" "$LINENO" 5 + fi fi # test whether we have cygpath @@ -1612,7 +2634,7 @@ # Define the identity of the package. PACKAGE='filtergen' - VERSION='0.12.4' + VERSION='0.12.7' cat >>confdefs.h <<_ACEOF @@ -1640,148 +2662,85 @@ MAKEINFO=${MAKEINFO-"${am_missing_run}makeinfo"} +# For better backward compatibility. To be removed once Automake 1.9.x +# dies out for good. For more background, see: +# +# +mkdir_p='$(MKDIR_P)' -AMTAR=${AMTAR-"${am_missing_run}tar"} +# We need awk for the "check" target (and possibly the TAP driver). The +# system "awk" is bad on some platforms. +# Always define AMTAR for backward compatibility. Yes, it's still used +# in the wild :-( We should find a proper way to deprecate it ... +AMTAR='$${TAR-tar}' -install_sh=${install_sh-"$am_aux_dir/install-sh"} -# Installed binaries are usually stripped using `strip' when the user -# run `make install-strip'. However `strip' might not be the right -# tool to use in cross-compilation environments, therefore Automake -# will honor the `STRIP' environment variable to overrule this program. -if test "$cross_compiling" != no; then - if test -n "$ac_tool_prefix"; then - # Extract the first word of "${ac_tool_prefix}strip", so it can be a program name with args. -set dummy ${ac_tool_prefix}strip; ac_word=$2 -echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 -if test "${ac_cv_prog_STRIP+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - if test -n "$STRIP"; then - ac_cv_prog_STRIP="$STRIP" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_prog_STRIP="${ac_tool_prefix}strip" - echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done -done +# We'll loop over all known methods to create a tar archive until one works. +_am_tools='gnutar pax cpio none' -fi -fi -STRIP=$ac_cv_prog_STRIP -if test -n "$STRIP"; then - echo "$as_me:$LINENO: result: $STRIP" >&5 -echo "${ECHO_T}$STRIP" >&6 -else - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 -fi +am__tar='$${TAR-tar} chof - "$$tardir"' am__untar='$${TAR-tar} xf -' -fi -if test -z "$ac_cv_prog_STRIP"; then - ac_ct_STRIP=$STRIP - # Extract the first word of "strip", so it can be a program name with args. -set dummy strip; ac_word=$2 -echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 -if test "${ac_cv_prog_ac_ct_STRIP+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - if test -n "$ac_ct_STRIP"; then - ac_cv_prog_ac_ct_STRIP="$ac_ct_STRIP" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_prog_ac_ct_STRIP="strip" - echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done -done - test -z "$ac_cv_prog_ac_ct_STRIP" && ac_cv_prog_ac_ct_STRIP=":" -fi -fi -ac_ct_STRIP=$ac_cv_prog_ac_ct_STRIP -if test -n "$ac_ct_STRIP"; then - echo "$as_me:$LINENO: result: $ac_ct_STRIP" >&5 -echo "${ECHO_T}$ac_ct_STRIP" >&6 -else - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 -fi - STRIP=$ac_ct_STRIP -else - STRIP="$ac_cv_prog_STRIP" -fi -fi -INSTALL_STRIP_PROGRAM="\${SHELL} \$(install_sh) -c -s" -# We need awk for the "check" target. The system "awk" is bad on -# some platforms. +# POSIX will say in a future version that running "rm -f" with no argument +# is OK; and we want to be able to make that assumption in our Makefile +# recipes. So use an aggressive probe to check that the usage we want is +# actually supported "in the wild" to an acceptable degree. +# See automake bug#10828. +# To make any issue more visible, cause the running configure to be aborted +# by default if the 'rm' program in use doesn't match our expectations; the +# user can still override this though. +if rm -f && rm -fr && rm -rf; then : OK; else + cat >&2 <<'END' +Oops! +Your 'rm' program seems unable to run without file operands specified +on the command line, even when the '-f' option is present. This is contrary +to the behaviour of most rm programs out there, and not conforming with +the upcoming POSIX standard: +Please tell bug-automake@gnu.org about your system, including the value +of your $PATH and any error possibly output before this message. This +can help us improve future automake versions. -ac_aux_dir= -for ac_dir in . $srcdir/.; do - if test -f $ac_dir/install-sh; then - ac_aux_dir=$ac_dir - ac_install_sh="$ac_aux_dir/install-sh -c" - break - elif test -f $ac_dir/install.sh; then - ac_aux_dir=$ac_dir - ac_install_sh="$ac_aux_dir/install.sh -c" - break - elif test -f $ac_dir/shtool; then - ac_aux_dir=$ac_dir - ac_install_sh="$ac_aux_dir/shtool install -c" - break +END + if test x"$ACCEPT_INFERIOR_RM_PROGRAM" = x"yes"; then + echo 'Configuration will proceed anyway, since you have set the' >&2 + echo 'ACCEPT_INFERIOR_RM_PROGRAM variable to "yes"' >&2 + echo >&2 + else + cat >&2 <<'END' +Aborting the configuration process, to ensure you take notice of the issue. + +You can download and install GNU coreutils to get an 'rm' implementation +that behaves properly: . + +If you want to complete the configuration process using your problematic +'rm' anyway, export the environment variable ACCEPT_INFERIOR_RM_PROGRAM +to "yes", and re-run configure. + +END + as_fn_error $? "Your 'rm' program is bad, sorry." "$LINENO" 5 fi -done -if test -z "$ac_aux_dir"; then - { { echo "$as_me:$LINENO: error: cannot find install-sh or install.sh in . $srcdir/." >&5 -echo "$as_me: error: cannot find install-sh or install.sh in . $srcdir/." >&2;} - { (exit 1); exit 1; }; } fi -ac_config_guess="$SHELL $ac_aux_dir/config.guess" -ac_config_sub="$SHELL $ac_aux_dir/config.sub" -ac_configure="$SHELL $ac_aux_dir/configure" # This should be Cygnus configure. - ac_config_headers="$ac_config_headers config.h" - -echo "$as_me:$LINENO: checking whether to enable maintainer-specific portions of Makefiles" >&5 -echo $ECHO_N "checking whether to enable maintainer-specific portions of Makefiles... $ECHO_C" >&6 - # Check whether --enable-maintainer-mode or --disable-maintainer-mode was given. -if test "${enable_maintainer_mode+set}" = set; then - enableval="$enable_maintainer_mode" - USE_MAINTAINER_MODE=$enableval +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to enable maintainer-specific portions of Makefiles" >&5 +$as_echo_n "checking whether to enable maintainer-specific portions of Makefiles... " >&6; } + # Check whether --enable-maintainer-mode was given. +if test "${enable_maintainer_mode+set}" = set; then : + enableval=$enable_maintainer_mode; USE_MAINTAINER_MODE=$enableval else USE_MAINTAINER_MODE=no -fi; - echo "$as_me:$LINENO: result: $USE_MAINTAINER_MODE" >&5 -echo "${ECHO_T}$USE_MAINTAINER_MODE" >&6 - +fi -if test $USE_MAINTAINER_MODE = yes; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $USE_MAINTAINER_MODE" >&5 +$as_echo "$USE_MAINTAINER_MODE" >&6; } + if test $USE_MAINTAINER_MODE = yes; then MAINTAINER_MODE_TRUE= MAINTAINER_MODE_FALSE='#' else @@ -1808,10 +2767,10 @@ if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}gcc", so it can be a program name with args. set dummy ${ac_tool_prefix}gcc; ac_word=$2 -echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 -if test "${ac_cv_prog_CC+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_CC+:} false; then : + $as_echo_n "(cached) " >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. @@ -1821,35 +2780,37 @@ do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_CC="${ac_tool_prefix}gcc" - echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done -done + done +IFS=$as_save_IFS fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then - echo "$as_me:$LINENO: result: $CC" >&5 -echo "${ECHO_T}$CC" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 +$as_echo "$CC" >&6; } else - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } fi + fi if test -z "$ac_cv_prog_CC"; then ac_ct_CC=$CC # Extract the first word of "gcc", so it can be a program name with args. set dummy gcc; ac_word=$2 -echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 -if test "${ac_cv_prog_ac_ct_CC+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_ac_ct_CC+:} false; then : + $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_CC"; then ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. @@ -1859,39 +2820,50 @@ do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_CC="gcc" - echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done -done + done +IFS=$as_save_IFS fi fi ac_ct_CC=$ac_cv_prog_ac_ct_CC if test -n "$ac_ct_CC"; then - echo "$as_me:$LINENO: result: $ac_ct_CC" >&5 -echo "${ECHO_T}$ac_ct_CC" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5 +$as_echo "$ac_ct_CC" >&6; } else - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } fi - CC=$ac_ct_CC + if test "x$ac_ct_CC" = x; then + CC="" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + CC=$ac_ct_CC + fi else CC="$ac_cv_prog_CC" fi if test -z "$CC"; then - if test -n "$ac_tool_prefix"; then - # Extract the first word of "${ac_tool_prefix}cc", so it can be a program name with args. + if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}cc", so it can be a program name with args. set dummy ${ac_tool_prefix}cc; ac_word=$2 -echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 -if test "${ac_cv_prog_CC+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_CC+:} false; then : + $as_echo_n "(cached) " >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. @@ -1901,77 +2873,37 @@ do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_CC="${ac_tool_prefix}cc" - echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done -done + done +IFS=$as_save_IFS fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then - echo "$as_me:$LINENO: result: $CC" >&5 -echo "${ECHO_T}$CC" >&6 -else - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 -fi - -fi -if test -z "$ac_cv_prog_CC"; then - ac_ct_CC=$CC - # Extract the first word of "cc", so it can be a program name with args. -set dummy cc; ac_word=$2 -echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 -if test "${ac_cv_prog_ac_ct_CC+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - if test -n "$ac_ct_CC"; then - ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_prog_ac_ct_CC="cc" - echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done -done - -fi -fi -ac_ct_CC=$ac_cv_prog_ac_ct_CC -if test -n "$ac_ct_CC"; then - echo "$as_me:$LINENO: result: $ac_ct_CC" >&5 -echo "${ECHO_T}$ac_ct_CC" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 +$as_echo "$CC" >&6; } else - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } fi - CC=$ac_ct_CC -else - CC="$ac_cv_prog_CC" -fi + fi fi if test -z "$CC"; then # Extract the first word of "cc", so it can be a program name with args. set dummy cc; ac_word=$2 -echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 -if test "${ac_cv_prog_CC+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_CC+:} false; then : + $as_echo_n "(cached) " >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. @@ -1982,18 +2914,19 @@ do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then if test "$as_dir/$ac_word$ac_exec_ext" = "/usr/ucb/cc"; then ac_prog_rejected=yes continue fi ac_cv_prog_CC="cc" - echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done -done + done +IFS=$as_save_IFS if test $ac_prog_rejected = yes; then # We found a bogon in the path, so make sure we never use it. @@ -2011,24 +2944,25 @@ fi CC=$ac_cv_prog_CC if test -n "$CC"; then - echo "$as_me:$LINENO: result: $CC" >&5 -echo "${ECHO_T}$CC" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 +$as_echo "$CC" >&6; } else - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } fi + fi if test -z "$CC"; then if test -n "$ac_tool_prefix"; then - for ac_prog in cl + for ac_prog in cl.exe do # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. set dummy $ac_tool_prefix$ac_prog; ac_word=$2 -echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 -if test "${ac_cv_prog_CC+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_CC+:} false; then : + $as_echo_n "(cached) " >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. @@ -2038,39 +2972,41 @@ do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_CC="$ac_tool_prefix$ac_prog" - echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done -done + done +IFS=$as_save_IFS fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then - echo "$as_me:$LINENO: result: $CC" >&5 -echo "${ECHO_T}$CC" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 +$as_echo "$CC" >&6; } else - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } fi + test -n "$CC" && break done fi if test -z "$CC"; then ac_ct_CC=$CC - for ac_prog in cl + for ac_prog in cl.exe do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 -echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 -if test "${ac_cv_prog_ac_ct_CC+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_ac_ct_CC+:} false; then : + $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_CC"; then ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. @@ -2080,66 +3016,78 @@ do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_CC="$ac_prog" - echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done -done + done +IFS=$as_save_IFS fi fi ac_ct_CC=$ac_cv_prog_ac_ct_CC if test -n "$ac_ct_CC"; then - echo "$as_me:$LINENO: result: $ac_ct_CC" >&5 -echo "${ECHO_T}$ac_ct_CC" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5 +$as_echo "$ac_ct_CC" >&6; } else - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } fi + test -n "$ac_ct_CC" && break done - CC=$ac_ct_CC + if test "x$ac_ct_CC" = x; then + CC="" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + CC=$ac_ct_CC + fi fi fi -test -z "$CC" && { { echo "$as_me:$LINENO: error: no acceptable C compiler found in \$PATH -See \`config.log' for more details." >&5 -echo "$as_me: error: no acceptable C compiler found in \$PATH -See \`config.log' for more details." >&2;} - { (exit 1); exit 1; }; } +test -z "$CC" && { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error $? "no acceptable C compiler found in \$PATH +See \`config.log' for more details" "$LINENO" 5; } # Provide some information about the compiler. -echo "$as_me:$LINENO:" \ - "checking for C compiler version" >&5 -ac_compiler=`set X $ac_compile; echo $2` -{ (eval echo "$as_me:$LINENO: \"$ac_compiler --version &5\"") >&5 - (eval $ac_compiler --version &5) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } -{ (eval echo "$as_me:$LINENO: \"$ac_compiler -v &5\"") >&5 - (eval $ac_compiler -v &5) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } -{ (eval echo "$as_me:$LINENO: \"$ac_compiler -V &5\"") >&5 - (eval $ac_compiler -V &5) 2>&5 +$as_echo "$as_me:${as_lineno-$LINENO}: checking for C compiler version" >&5 +set X $ac_compile +ac_compiler=$2 +for ac_option in --version -v -V -qversion; do + { { ac_try="$ac_compiler $ac_option >&5" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_compiler $ac_option >&5") 2>conftest.err ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } + if test -s conftest.err; then + sed '10a\ +... rest of stderr output deleted ... + 10q' conftest.err >conftest.er1 + cat conftest.er1 >&5 + fi + rm -f conftest.er1 conftest.err + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } +done -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF +cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int @@ -2151,112 +3099,108 @@ } _ACEOF ac_clean_files_save=$ac_clean_files -ac_clean_files="$ac_clean_files a.out a.exe b.out" +ac_clean_files="$ac_clean_files a.out a.out.dSYM a.exe b.out" # Try to create an executable without -o first, disregard a.out. # It will help us diagnose broken compilers, and finding out an intuition # of exeext. -echo "$as_me:$LINENO: checking for C compiler default output file name" >&5 -echo $ECHO_N "checking for C compiler default output file name... $ECHO_C" >&6 -ac_link_default=`echo "$ac_link" | sed 's/ -o *conftest[^ ]*//'` -if { (eval echo "$as_me:$LINENO: \"$ac_link_default\"") >&5 - (eval $ac_link_default) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; then - # Find the output, starting from the most likely. This scheme is -# not robust to junk in `.', hence go to wildcards (a.*) only as a last -# resort. - -# Be careful to initialize this variable, since it used to be cached. -# Otherwise an old cache value of `no' led to `EXEEXT = no' in a Makefile. -ac_cv_exeext= -# b.out is created by i960 compilers. -for ac_file in a_out.exe a.exe conftest.exe a.out conftest a.* conftest.* b.out +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the C compiler works" >&5 +$as_echo_n "checking whether the C compiler works... " >&6; } +ac_link_default=`$as_echo "$ac_link" | sed 's/ -o *conftest[^ ]*//'` + +# The possible output files: +ac_files="a.out conftest.exe conftest a.exe a_out.exe b.out conftest.*" + +ac_rmfiles= +for ac_file in $ac_files +do + case $ac_file in + *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) ;; + * ) ac_rmfiles="$ac_rmfiles $ac_file";; + esac +done +rm -f $ac_rmfiles + +if { { ac_try="$ac_link_default" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_link_default") 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; then : + # Autoconf-2.13 could set the ac_cv_exeext variable to `no'. +# So ignore a value of `no', otherwise this would lead to `EXEEXT = no' +# in a Makefile. We should not override ac_cv_exeext if it was cached, +# so that the user can short-circuit this test for compilers unknown to +# Autoconf. +for ac_file in $ac_files '' do test -f "$ac_file" || continue case $ac_file in - *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.o | *.obj ) - ;; - conftest.$ac_ext ) - # This is the source file. + *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) ;; [ab].out ) # We found the default executable, but exeext='' is most # certainly right. break;; *.* ) - ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` - # FIXME: I believe we export ac_cv_exeext for Libtool, - # but it would be cool to find out if it's true. Does anybody - # maintain Libtool? --akim. - export ac_cv_exeext + if test "${ac_cv_exeext+set}" = set && test "$ac_cv_exeext" != no; + then :; else + ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` + fi + # We set ac_cv_exeext here because the later test for it is not + # safe: cross compilers may not add the suffix if given an `-o' + # argument, so we may need to know it at that point already. + # Even if this section looks crufty: it has the advantage of + # actually working. break;; * ) break;; esac done -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 +test "$ac_cv_exeext" = no && ac_cv_exeext= -{ { echo "$as_me:$LINENO: error: C compiler cannot create executables -See \`config.log' for more details." >&5 -echo "$as_me: error: C compiler cannot create executables -See \`config.log' for more details." >&2;} - { (exit 77); exit 77; }; } +else + ac_file='' fi +if test -z "$ac_file"; then : + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +$as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 +{ { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error 77 "C compiler cannot create executables +See \`config.log' for more details" "$LINENO" 5; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for C compiler default output file name" >&5 +$as_echo_n "checking for C compiler default output file name... " >&6; } +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_file" >&5 +$as_echo "$ac_file" >&6; } ac_exeext=$ac_cv_exeext -echo "$as_me:$LINENO: result: $ac_file" >&5 -echo "${ECHO_T}$ac_file" >&6 - -# Check the compiler produces executables we can run. If not, either -# the compiler is broken, or we cross compile. -echo "$as_me:$LINENO: checking whether the C compiler works" >&5 -echo $ECHO_N "checking whether the C compiler works... $ECHO_C" >&6 -# FIXME: These cross compiler hacks should be removed for Autoconf 3.0 -# If not cross compiling, check that we can run a simple program. -if test "$cross_compiling" != yes; then - if { ac_try='./$ac_file' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - cross_compiling=no - else - if test "$cross_compiling" = maybe; then - cross_compiling=yes - else - { { echo "$as_me:$LINENO: error: cannot run C compiled programs. -If you meant to cross compile, use \`--host'. -See \`config.log' for more details." >&5 -echo "$as_me: error: cannot run C compiled programs. -If you meant to cross compile, use \`--host'. -See \`config.log' for more details." >&2;} - { (exit 1); exit 1; }; } - fi - fi -fi -echo "$as_me:$LINENO: result: yes" >&5 -echo "${ECHO_T}yes" >&6 -rm -f a.out a.exe conftest$ac_cv_exeext b.out +rm -f -r a.out a.out.dSYM a.exe conftest$ac_cv_exeext b.out ac_clean_files=$ac_clean_files_save -# Check the compiler produces executables we can run. If not, either -# the compiler is broken, or we cross compile. -echo "$as_me:$LINENO: checking whether we are cross compiling" >&5 -echo $ECHO_N "checking whether we are cross compiling... $ECHO_C" >&6 -echo "$as_me:$LINENO: result: $cross_compiling" >&5 -echo "${ECHO_T}$cross_compiling" >&6 - -echo "$as_me:$LINENO: checking for suffix of executables" >&5 -echo $ECHO_N "checking for suffix of executables... $ECHO_C" >&6 -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>&5 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for suffix of executables" >&5 +$as_echo_n "checking for suffix of executables... " >&6; } +if { { ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_link") 2>&5 ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; then + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; then : # If both `conftest.exe' and `conftest' are `present' (well, observable) # catch `conftest.exe'. For instance with Cygwin, `ls conftest' will # work properly (i.e., refer to `conftest.exe'), while it won't with @@ -2264,38 +3208,90 @@ for ac_file in conftest.exe conftest conftest.*; do test -f "$ac_file" || continue case $ac_file in - *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.o | *.obj ) ;; + *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) ;; *.* ) ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` - export ac_cv_exeext break;; * ) break;; esac done else - { { echo "$as_me:$LINENO: error: cannot compute suffix of executables: cannot compile and link -See \`config.log' for more details." >&5 -echo "$as_me: error: cannot compute suffix of executables: cannot compile and link -See \`config.log' for more details." >&2;} - { (exit 1); exit 1; }; } -fi - -rm -f conftest$ac_cv_exeext -echo "$as_me:$LINENO: result: $ac_cv_exeext" >&5 -echo "${ECHO_T}$ac_cv_exeext" >&6 + { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error $? "cannot compute suffix of executables: cannot compile and link +See \`config.log' for more details" "$LINENO" 5; } +fi +rm -f conftest conftest$ac_cv_exeext +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_exeext" >&5 +$as_echo "$ac_cv_exeext" >&6; } rm -f conftest.$ac_ext EXEEXT=$ac_cv_exeext ac_exeext=$EXEEXT -echo "$as_me:$LINENO: checking for suffix of object files" >&5 -echo $ECHO_N "checking for suffix of object files... $ECHO_C" >&6 -if test "${ac_cv_objext+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +int +main () +{ +FILE *f = fopen ("conftest.out", "w"); + return ferror (f) || fclose (f) != 0; + + ; + return 0; +} _ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF +ac_clean_files="$ac_clean_files conftest.out" +# Check that the compiler produces executables we can run. If not, either +# the compiler is broken, or we cross compile. +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are cross compiling" >&5 +$as_echo_n "checking whether we are cross compiling... " >&6; } +if test "$cross_compiling" != yes; then + { { ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_link") 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } + if { ac_try='./conftest$ac_cv_exeext' + { { case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; }; then + cross_compiling=no + else + if test "$cross_compiling" = maybe; then + cross_compiling=yes + else + { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error $? "cannot run C compiled programs. +If you meant to cross compile, use \`--host'. +See \`config.log' for more details" "$LINENO" 5; } + fi + fi +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $cross_compiling" >&5 +$as_echo "$cross_compiling" >&6; } + +rm -f conftest.$ac_ext conftest$ac_cv_exeext conftest.out +ac_clean_files=$ac_clean_files_save +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for suffix of object files" >&5 +$as_echo_n "checking for suffix of object files... " >&6; } +if ${ac_cv_objext+:} false; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int @@ -2307,45 +3303,46 @@ } _ACEOF rm -f conftest.o conftest.obj -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; then - for ac_file in `(ls conftest.o conftest.obj; ls conftest.*) 2>/dev/null`; do +if { { ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_compile") 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; then : + for ac_file in conftest.o conftest.obj conftest.*; do + test -f "$ac_file" || continue; case $ac_file in - *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg ) ;; + *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM ) ;; *) ac_cv_objext=`expr "$ac_file" : '.*\.\(.*\)'` break;; esac done else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -{ { echo "$as_me:$LINENO: error: cannot compute suffix of object files: cannot compile -See \`config.log' for more details." >&5 -echo "$as_me: error: cannot compute suffix of object files: cannot compile -See \`config.log' for more details." >&2;} - { (exit 1); exit 1; }; } +{ { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error $? "cannot compute suffix of object files: cannot compile +See \`config.log' for more details" "$LINENO" 5; } fi - rm -f conftest.$ac_cv_objext conftest.$ac_ext fi -echo "$as_me:$LINENO: result: $ac_cv_objext" >&5 -echo "${ECHO_T}$ac_cv_objext" >&6 +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_objext" >&5 +$as_echo "$ac_cv_objext" >&6; } OBJEXT=$ac_cv_objext ac_objext=$OBJEXT -echo "$as_me:$LINENO: checking whether we are using the GNU C compiler" >&5 -echo $ECHO_N "checking whether we are using the GNU C compiler... $ECHO_C" >&6 -if test "${ac_cv_c_compiler_gnu+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are using the GNU C compiler" >&5 +$as_echo_n "checking whether we are using the GNU C compiler... " >&6; } +if ${ac_cv_c_compiler_gnu+:} false; then : + $as_echo_n "(cached) " >&6 else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int @@ -2359,54 +3356,34 @@ return 0; } _ACEOF -rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then +if ac_fn_c_try_compile "$LINENO"; then : ac_compiler_gnu=yes else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -ac_compiler_gnu=no + ac_compiler_gnu=no fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext ac_cv_c_compiler_gnu=$ac_compiler_gnu fi -echo "$as_me:$LINENO: result: $ac_cv_c_compiler_gnu" >&5 -echo "${ECHO_T}$ac_cv_c_compiler_gnu" >&6 -GCC=`test $ac_compiler_gnu = yes && echo yes` +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_compiler_gnu" >&5 +$as_echo "$ac_cv_c_compiler_gnu" >&6; } +if test $ac_compiler_gnu = yes; then + GCC=yes +else + GCC= +fi ac_test_CFLAGS=${CFLAGS+set} ac_save_CFLAGS=$CFLAGS -CFLAGS="-g" -echo "$as_me:$LINENO: checking whether $CC accepts -g" >&5 -echo $ECHO_N "checking whether $CC accepts -g... $ECHO_C" >&6 -if test "${ac_cv_prog_cc_g+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC accepts -g" >&5 +$as_echo_n "checking whether $CC accepts -g... " >&6; } +if ${ac_cv_prog_cc_g+:} false; then : + $as_echo_n "(cached) " >&6 +else + ac_save_c_werror_flag=$ac_c_werror_flag + ac_c_werror_flag=yes + ac_cv_prog_cc_g=no + CFLAGS="-g" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int @@ -2417,38 +3394,49 @@ return 0; } _ACEOF -rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then +if ac_fn_c_try_compile "$LINENO"; then : ac_cv_prog_cc_g=yes else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 + CFLAGS="" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + +else + ac_c_werror_flag=$ac_save_c_werror_flag + CFLAGS="-g" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ -ac_cv_prog_cc_g=no + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + ac_cv_prog_cc_g=yes fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi -echo "$as_me:$LINENO: result: $ac_cv_prog_cc_g" >&5 -echo "${ECHO_T}$ac_cv_prog_cc_g" >&6 +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + ac_c_werror_flag=$ac_save_c_werror_flag +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_g" >&5 +$as_echo "$ac_cv_prog_cc_g" >&6; } if test "$ac_test_CFLAGS" = set; then CFLAGS=$ac_save_CFLAGS elif test $ac_cv_prog_cc_g = yes; then @@ -2464,23 +3452,18 @@ CFLAGS= fi fi -echo "$as_me:$LINENO: checking for $CC option to accept ANSI C" >&5 -echo $ECHO_N "checking for $CC option to accept ANSI C... $ECHO_C" >&6 -if test "${ac_cv_prog_cc_stdc+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $CC option to accept ISO C89" >&5 +$as_echo_n "checking for $CC option to accept ISO C89... " >&6; } +if ${ac_cv_prog_cc_c89+:} false; then : + $as_echo_n "(cached) " >&6 else - ac_cv_prog_cc_stdc=no + ac_cv_prog_cc_c89=no ac_save_CC=$CC -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF +cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #include -#include -#include +struct stat; /* Most of the following tests are stolen from RCS 5.7's src/conf.sh. */ struct buf { int x; }; FILE * (*rcsopen) (struct buf *, struct stat *, int); @@ -2503,12 +3486,17 @@ /* OSF 4.0 Compaq cc is some sort of almost-ANSI by default. It has function prototypes and stuff, but not '\xHH' hex character constants. These don't provoke an error unfortunately, instead are silently treated - as 'x'. The following induces an error, until -std1 is added to get + as 'x'. The following induces an error, until -std is added to get proper ANSI mode. Curiously '\x00'!='x' always comes out true, for an array size at least. It's necessary to write '\x00'==0 to get something - that's true only with -std1. */ + that's true only with -std. */ int osf4_cc_array ['\x00' == 0 ? 1 : -1]; +/* IBM C 6 for AIX is almost-ANSI by default, but it replaces macro parameters + inside strings and character constants. */ +#define FOO(x) 'x' +int xlc6_cc_array[FOO(a) == 'x' ? 1 : -1]; + int test (int i, double x); struct s1 {int (*f) (int a);}; struct s2 {int (*f) (double a);}; @@ -2523,262 +3511,156 @@ return 0; } _ACEOF -# Don't try gcc -ansi; that turns off useful extensions and -# breaks some systems' header files. -# AIX -qlanglvl=ansi -# Ultrix and OSF/1 -std1 -# HP-UX 10.20 and later -Ae -# HP-UX older versions -Aa -D_HPUX_SOURCE -# SVR4 -Xc -D__EXTENSIONS__ -for ac_arg in "" -qlanglvl=ansi -std1 -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__" +for ac_arg in '' -qlanglvl=extc89 -qlanglvl=ansi -std \ + -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__" do CC="$ac_save_CC $ac_arg" - rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - ac_cv_prog_cc_stdc=$ac_arg -break -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - + if ac_fn_c_try_compile "$LINENO"; then : + ac_cv_prog_cc_c89=$ac_arg fi -rm -f conftest.err conftest.$ac_objext +rm -f core conftest.err conftest.$ac_objext + test "x$ac_cv_prog_cc_c89" != "xno" && break done -rm -f conftest.$ac_ext conftest.$ac_objext +rm -f conftest.$ac_ext CC=$ac_save_CC fi - -case "x$ac_cv_prog_cc_stdc" in - x|xno) - echo "$as_me:$LINENO: result: none needed" >&5 -echo "${ECHO_T}none needed" >&6 ;; +# AC_CACHE_VAL +case "x$ac_cv_prog_cc_c89" in + x) + { $as_echo "$as_me:${as_lineno-$LINENO}: result: none needed" >&5 +$as_echo "none needed" >&6; } ;; + xno) + { $as_echo "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5 +$as_echo "unsupported" >&6; } ;; *) - echo "$as_me:$LINENO: result: $ac_cv_prog_cc_stdc" >&5 -echo "${ECHO_T}$ac_cv_prog_cc_stdc" >&6 - CC="$CC $ac_cv_prog_cc_stdc" ;; + CC="$CC $ac_cv_prog_cc_c89" + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_c89" >&5 +$as_echo "$ac_cv_prog_cc_c89" >&6; } ;; esac +if test "x$ac_cv_prog_cc_c89" != xno; then : -# Some people use a C++ compiler to compile C. Since we use `exit', -# in C++ we need to declare it. In case someone uses the same compiler -# for both compiling C and C++ we need to have the C++ compiler decide -# the declaration of exit, since it's the most demanding environment. -cat >conftest.$ac_ext <<_ACEOF -#ifndef __cplusplus - choke me -#endif -_ACEOF -rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - for ac_declaration in \ - '' \ - 'extern "C" void std::exit (int) throw (); using std::exit;' \ - 'extern "C" void std::exit (int); using std::exit;' \ - 'extern "C" void exit (int) throw ();' \ - 'extern "C" void exit (int);' \ - 'void exit (int);' -do - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -$ac_declaration -#include -int -main () -{ -exit (42); - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - : -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -continue fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF + +ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu + +ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC understands -c and -o together" >&5 +$as_echo_n "checking whether $CC understands -c and -o together... " >&6; } +if ${am_cv_prog_cc_c_o+:} false; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ -$ac_declaration + int main () { -exit (42); + ; return 0; } _ACEOF -rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - break -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext -done -rm -f conftest* -if test -n "$ac_declaration"; then - echo '#ifdef __cplusplus' >>confdefs.h - echo $ac_declaration >>confdefs.h - echo '#endif' >>confdefs.h + # Make sure it works both with $CC and with simple cc. + # Following AC_PROG_CC_C_O, we do the test twice because some + # compilers refuse to overwrite an existing .o file with -o, + # though they will create one. + am_cv_prog_cc_c_o=yes + for am_i in 1 2; do + if { echo "$as_me:$LINENO: $CC -c conftest.$ac_ext -o conftest2.$ac_objext" >&5 + ($CC -c conftest.$ac_ext -o conftest2.$ac_objext) >&5 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } \ + && test -f conftest2.$ac_objext; then + : OK + else + am_cv_prog_cc_c_o=no + break + fi + done + rm -f core conftest* + unset am_i fi - -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_prog_cc_c_o" >&5 +$as_echo "$am_cv_prog_cc_c_o" >&6; } +if test "$am_cv_prog_cc_c_o" != yes; then + # Losing compiler, so override with the script. + # FIXME: It is wrong to rewrite CC. + # But if we don't then we get into trouble of one sort or another. + # A longer-term fix would be to have automake use am__CC in this case, + # and then we could set am__CC="\$(top_srcdir)/compile \$(CC)" + CC="$am_aux_dir/compile $CC" fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu + DEPDIR="${am__leading_dot}deps" - ac_config_commands="$ac_config_commands depfiles" +ac_config_commands="$ac_config_commands depfiles" am_make=${MAKE-make} cat > confinc << 'END' am__doit: - @echo done + @echo this is the am__doit target .PHONY: am__doit END # If we don't find an include directive, just comment out the code. -echo "$as_me:$LINENO: checking for style of include used by $am_make" >&5 -echo $ECHO_N "checking for style of include used by $am_make... $ECHO_C" >&6 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for style of include used by $am_make" >&5 +$as_echo_n "checking for style of include used by $am_make... " >&6; } am__include="#" am__quote= _am_result=none # First try GNU make style include. echo "include confinc" > confmf -# We grep out `Entering directory' and `Leaving directory' -# messages which can occur if `w' ends up in MAKEFLAGS. -# In particular we don't look at `^make:' because GNU make might -# be invoked under some other name (usually "gmake"), in which -# case it prints its new name instead of `make'. -if test "`$am_make -s -f confmf 2> /dev/null | grep -v 'ing directory'`" = "done"; then - am__include=include - am__quote= - _am_result=GNU -fi +# Ignore all kinds of additional output from 'make'. +case `$am_make -s -f confmf 2> /dev/null` in #( +*the\ am__doit\ target*) + am__include=include + am__quote= + _am_result=GNU + ;; +esac # Now try BSD make style include. if test "$am__include" = "#"; then echo '.include "confinc"' > confmf - if test "`$am_make -s -f confmf 2> /dev/null`" = "done"; then - am__include=.include - am__quote="\"" - _am_result=BSD - fi + case `$am_make -s -f confmf 2> /dev/null` in #( + *the\ am__doit\ target*) + am__include=.include + am__quote="\"" + _am_result=BSD + ;; + esac fi -echo "$as_me:$LINENO: result: $_am_result" >&5 -echo "${ECHO_T}$_am_result" >&6 +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $_am_result" >&5 +$as_echo "$_am_result" >&6; } rm -f confinc confmf -# Check whether --enable-dependency-tracking or --disable-dependency-tracking was given. -if test "${enable_dependency_tracking+set}" = set; then - enableval="$enable_dependency_tracking" +# Check whether --enable-dependency-tracking was given. +if test "${enable_dependency_tracking+set}" = set; then : + enableval=$enable_dependency_tracking; +fi -fi; if test "x$enable_dependency_tracking" != xno; then am_depcomp="$ac_aux_dir/depcomp" AMDEPBACKSLASH='\' + am__nodep='_no' fi - - -if test "x$enable_dependency_tracking" != xno; then + if test "x$enable_dependency_tracking" != xno; then AMDEP_TRUE= AMDEP_FALSE='#' else @@ -2788,20 +3670,20 @@ - depcc="$CC" am_compiler_list= -echo "$as_me:$LINENO: checking dependency style of $depcc" >&5 -echo $ECHO_N "checking dependency style of $depcc... $ECHO_C" >&6 -if test "${am_cv_CC_dependencies_compiler_type+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking dependency style of $depcc" >&5 +$as_echo_n "checking dependency style of $depcc... " >&6; } +if ${am_cv_CC_dependencies_compiler_type+:} false; then : + $as_echo_n "(cached) " >&6 else if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then # We make a subdir and do the tests there. Otherwise we can end up # making bogus files that we don't know about and never remove. For # instance it was reported that on HP-UX the gcc test will end up - # making a dummy file named `D' -- because `-MD' means `put the output - # in D'. + # making a dummy file named 'D' -- because '-MD' means "put the output + # in D". + rm -rf conftest.dir mkdir conftest.dir # Copy depcomp to subdir because otherwise we won't find it if we're # using a relative directory. @@ -2819,6 +3701,11 @@ if test "$am_compiler_list" = ""; then am_compiler_list=`sed -n 's/^#*\([a-zA-Z0-9]*\))$/\1/p' < ./depcomp` fi + am__universal=false + case " $depcc " in #( + *\ -arch\ *\ -arch\ *) am__universal=true ;; + esac + for depmode in $am_compiler_list; do # Setup a source with many dependencies, because some compilers # like to wrap large dependency lists on column 80 (with \), and @@ -2830,34 +3717,49 @@ : > sub/conftest.c for i in 1 2 3 4 5 6; do echo '#include "conftst'$i'.h"' >> sub/conftest.c - # Using `: > sub/conftst$i.h' creates only sub/conftst1.h with - # Solaris 8's {/usr,}/bin/sh. - touch sub/conftst$i.h + # Using ": > sub/conftst$i.h" creates only sub/conftst1.h with + # Solaris 10 /bin/sh. + echo '/* dummy */' > sub/conftst$i.h done echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf + # We check with '-c' and '-o' for the sake of the "dashmstdout" + # mode. It turns out that the SunPro C++ compiler does not properly + # handle '-M -o', and we need to detect this. Also, some Intel + # versions had trouble with output in subdirs. + am__obj=sub/conftest.${OBJEXT-o} + am__minus_obj="-o $am__obj" case $depmode in + gcc) + # This depmode causes a compiler race in universal mode. + test "$am__universal" = false || continue + ;; nosideeffect) - # after this tag, mechanisms are not by side-effect, so they'll - # only be used when explicitly requested + # After this tag, mechanisms are not by side-effect, so they'll + # only be used when explicitly requested. if test "x$enable_dependency_tracking" = xyes; then continue else break fi ;; + msvc7 | msvc7msys | msvisualcpp | msvcmsys) + # This compiler won't grok '-c -o', but also, the minuso test has + # not run yet. These depmodes are late enough in the game, and + # so weak that their functioning should not be impacted. + am__obj=conftest.${OBJEXT-o} + am__minus_obj= + ;; none) break ;; esac - # We check with `-c' and `-o' for the sake of the "dashmstdout" - # mode. It turns out that the SunPro C++ compiler does not properly - # handle `-M -o', and we need to detect this. if depmode=$depmode \ - source=sub/conftest.c object=sub/conftest.${OBJEXT-o} \ + source=sub/conftest.c object=$am__obj \ depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \ - $SHELL ./depcomp $depcc -c -o sub/conftest.${OBJEXT-o} sub/conftest.c \ + $SHELL ./depcomp $depcc -c $am__minus_obj sub/conftest.c \ >/dev/null 2>conftest.err && + grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 && grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 && - grep sub/conftest.${OBJEXT-o} sub/conftest.Po > /dev/null 2>&1 && + grep $am__obj sub/conftest.Po > /dev/null 2>&1 && ${MAKE-make} -s -f confmf > /dev/null 2>&1; then # icc doesn't choke on unknown options, it will just issue warnings # or remarks (even with -Werror). So we grep stderr for any message @@ -2881,13 +3783,11 @@ fi fi -echo "$as_me:$LINENO: result: $am_cv_CC_dependencies_compiler_type" >&5 -echo "${ECHO_T}$am_cv_CC_dependencies_compiler_type" >&6 +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_CC_dependencies_compiler_type" >&5 +$as_echo "$am_cv_CC_dependencies_compiler_type" >&6; } CCDEPMODE=depmode=$am_cv_CC_dependencies_compiler_type - - -if + if test "x$enable_dependency_tracking" != xno \ && test "$am_cv_CC_dependencies_compiler_type" = gcc3; then am__fastdepCC_TRUE= @@ -2903,10 +3803,10 @@ do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 -echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 -if test "${ac_cv_prog_LEX+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_LEX+:} false; then : + $as_echo_n "(cached) " >&6 else if test -n "$LEX"; then ac_cv_prog_LEX="$LEX" # Let the user override the test. @@ -2916,268 +3816,159 @@ do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_LEX="$ac_prog" - echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done -done + done +IFS=$as_save_IFS fi fi LEX=$ac_cv_prog_LEX if test -n "$LEX"; then - echo "$as_me:$LINENO: result: $LEX" >&5 -echo "${ECHO_T}$LEX" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $LEX" >&5 +$as_echo "$LEX" >&6; } else - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } fi + test -n "$LEX" && break done test -n "$LEX" || LEX=":" -if test -z "$LEXLIB" -then - echo "$as_me:$LINENO: checking for yywrap in -lfl" >&5 -echo $ECHO_N "checking for yywrap in -lfl... $ECHO_C" >&6 -if test "${ac_cv_lib_fl_yywrap+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - ac_check_lib_save_LIBS=$LIBS -LIBS="-lfl $LIBS" -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ - -/* Override any gcc2 internal prototype to avoid an error. */ -#ifdef __cplusplus -extern "C" +if test "x$LEX" != "x:"; then + cat >conftest.l <<_ACEOF +%% +a { ECHO; } +b { REJECT; } +c { yymore (); } +d { yyless (1); } +e { /* IRIX 6.5 flex 2.5.4 underquotes its yyless argument. */ + yyless ((input () != 0)); } +f { unput (yytext[0]); } +. { BEGIN INITIAL; } +%% +#ifdef YYTEXT_POINTER +extern char *yytext; #endif -/* We use char because int might match the return type of a gcc2 - builtin and then its argument prototype would still apply. */ -char yywrap (); int -main () +main (void) { -yywrap (); - ; - return 0; + return ! yylex () + ! yywrap (); } _ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - ac_cv_lib_fl_yywrap=yes +{ { ac_try="$LEX conftest.l" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$LEX conftest.l") 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking lex output file root" >&5 +$as_echo_n "checking lex output file root... " >&6; } +if ${ac_cv_prog_lex_root+:} false; then : + $as_echo_n "(cached) " >&6 else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 -ac_cv_lib_fl_yywrap=no +if test -f lex.yy.c; then + ac_cv_prog_lex_root=lex.yy +elif test -f lexyy.c; then + ac_cv_prog_lex_root=lexyy +else + as_fn_error $? "cannot find output from $LEX; giving up" "$LINENO" 5 fi -rm -f conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext -LIBS=$ac_check_lib_save_LIBS fi -echo "$as_me:$LINENO: result: $ac_cv_lib_fl_yywrap" >&5 -echo "${ECHO_T}$ac_cv_lib_fl_yywrap" >&6 -if test $ac_cv_lib_fl_yywrap = yes; then - LEXLIB="-lfl" -else - echo "$as_me:$LINENO: checking for yywrap in -ll" >&5 -echo $ECHO_N "checking for yywrap in -ll... $ECHO_C" >&6 -if test "${ac_cv_lib_l_yywrap+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - ac_check_lib_save_LIBS=$LIBS -LIBS="-ll $LIBS" -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_lex_root" >&5 +$as_echo "$ac_cv_prog_lex_root" >&6; } +LEX_OUTPUT_ROOT=$ac_cv_prog_lex_root -/* Override any gcc2 internal prototype to avoid an error. */ -#ifdef __cplusplus -extern "C" -#endif -/* We use char because int might match the return type of a gcc2 - builtin and then its argument prototype would still apply. */ -char yywrap (); -int -main () -{ -yywrap (); - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - ac_cv_lib_l_yywrap=yes +if test -z "${LEXLIB+set}"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: checking lex library" >&5 +$as_echo_n "checking lex library... " >&6; } +if ${ac_cv_lib_lex+:} false; then : + $as_echo_n "(cached) " >&6 else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 -ac_cv_lib_l_yywrap=no -fi -rm -f conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext -LIBS=$ac_check_lib_save_LIBS -fi -echo "$as_me:$LINENO: result: $ac_cv_lib_l_yywrap" >&5 -echo "${ECHO_T}$ac_cv_lib_l_yywrap" >&6 -if test $ac_cv_lib_l_yywrap = yes; then - LEXLIB="-ll" + ac_save_LIBS=$LIBS + ac_cv_lib_lex='none needed' + for ac_lib in '' -lfl -ll; do + LIBS="$ac_lib $ac_save_LIBS" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +`cat $LEX_OUTPUT_ROOT.c` +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + ac_cv_lib_lex=$ac_lib fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext + test "$ac_cv_lib_lex" != 'none needed' && break + done + LIBS=$ac_save_LIBS fi - +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_lex" >&5 +$as_echo "$ac_cv_lib_lex" >&6; } + test "$ac_cv_lib_lex" != 'none needed' && LEXLIB=$ac_cv_lib_lex fi -if test "x$LEX" != "x:"; then - echo "$as_me:$LINENO: checking lex output file root" >&5 -echo $ECHO_N "checking lex output file root... $ECHO_C" >&6 -if test "${ac_cv_prog_lex_root+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - # The minimal lex program is just a single line: %%. But some broken lexes -# (Solaris, I think it was) want two %% lines, so accommodate them. -cat >conftest.l <<_ACEOF -%% -%% -_ACEOF -{ (eval echo "$as_me:$LINENO: \"$LEX conftest.l\"") >&5 - (eval $LEX conftest.l) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } -if test -f lex.yy.c; then - ac_cv_prog_lex_root=lex.yy -elif test -f lexyy.c; then - ac_cv_prog_lex_root=lexyy -else - { { echo "$as_me:$LINENO: error: cannot find output from $LEX; giving up" >&5 -echo "$as_me: error: cannot find output from $LEX; giving up" >&2;} - { (exit 1); exit 1; }; } -fi -fi -echo "$as_me:$LINENO: result: $ac_cv_prog_lex_root" >&5 -echo "${ECHO_T}$ac_cv_prog_lex_root" >&6 -rm -f conftest.l -LEX_OUTPUT_ROOT=$ac_cv_prog_lex_root -echo "$as_me:$LINENO: checking whether yytext is a pointer" >&5 -echo $ECHO_N "checking whether yytext is a pointer... $ECHO_C" >&6 -if test "${ac_cv_prog_lex_yytext_pointer+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether yytext is a pointer" >&5 +$as_echo_n "checking whether yytext is a pointer... " >&6; } +if ${ac_cv_prog_lex_yytext_pointer+:} false; then : + $as_echo_n "(cached) " >&6 else # POSIX says lex can declare yytext either as a pointer or an array; the -# default is implementation-dependent. Figure out which it is, since +# default is implementation-dependent. Figure out which it is, since # not all implementations provide the %pointer and %array declarations. ac_cv_prog_lex_yytext_pointer=no -echo 'extern char *yytext;' >>$LEX_OUTPUT_ROOT.c ac_save_LIBS=$LIBS -LIBS="$LIBS $LEXLIB" -cat >conftest.$ac_ext <<_ACEOF +LIBS="$LEXLIB $ac_save_LIBS" +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + + #define YYTEXT_POINTER 1 `cat $LEX_OUTPUT_ROOT.c` _ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then +if ac_fn_c_try_link "$LINENO"; then : ac_cv_prog_lex_yytext_pointer=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - fi -rm -f conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext LIBS=$ac_save_LIBS -rm -f "${LEX_OUTPUT_ROOT}.c" fi -echo "$as_me:$LINENO: result: $ac_cv_prog_lex_yytext_pointer" >&5 -echo "${ECHO_T}$ac_cv_prog_lex_yytext_pointer" >&6 +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_lex_yytext_pointer" >&5 +$as_echo "$ac_cv_prog_lex_yytext_pointer" >&6; } if test $ac_cv_prog_lex_yytext_pointer = yes; then -cat >>confdefs.h <<\_ACEOF -#define YYTEXT_POINTER 1 -_ACEOF +$as_echo "#define YYTEXT_POINTER 1" >>confdefs.h fi +rm -f conftest.l $LEX_OUTPUT_ROOT.c fi +if test "$LEX" = :; then + LEX=${am_missing_run}flex +fi for ac_prog in 'bison -y' byacc do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 -echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 -if test "${ac_cv_prog_YACC+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_YACC+:} false; then : + $as_echo_n "(cached) " >&6 else if test -n "$YACC"; then ac_cv_prog_YACC="$YACC" # Let the user override the test. @@ -3187,26 +3978,28 @@ do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_YACC="$ac_prog" - echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done -done + done +IFS=$as_save_IFS fi fi YACC=$ac_cv_prog_YACC if test -n "$YACC"; then - echo "$as_me:$LINENO: result: $YACC" >&5 -echo "${ECHO_T}$YACC" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $YACC" >&5 +$as_echo "$YACC" >&6; } else - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } fi + test -n "$YACC" && break done test -n "$YACC" || YACC="yacc" @@ -3218,15 +4011,15 @@ ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu -echo "$as_me:$LINENO: checking how to run the C preprocessor" >&5 -echo $ECHO_N "checking how to run the C preprocessor... $ECHO_C" >&6 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking how to run the C preprocessor" >&5 +$as_echo_n "checking how to run the C preprocessor... " >&6; } # On Suns, sometimes $CPP names a directory. if test -n "$CPP" && test -d "$CPP"; then CPP= fi if test -z "$CPP"; then - if test "${ac_cv_prog_CPP+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + if ${ac_cv_prog_CPP+:} false; then : + $as_echo_n "(cached) " >&6 else # Double quotes because CPP needs to be expanded for CPP in "$CC -E" "$CC -E -traditional-cpp" "/lib/cpp" @@ -3240,11 +4033,7 @@ # exists even on freestanding compilers. # On the NeXT, cc -E runs the code through the compiler's parser, # not just through cpp. "Syntax error" is here to catch this case. - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #ifdef __STDC__ # include @@ -3253,78 +4042,34 @@ #endif Syntax error _ACEOF -if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 - (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } >/dev/null; then - if test -s conftest.err; then - ac_cpp_err=$ac_c_preproc_warn_flag - ac_cpp_err=$ac_cpp_err$ac_c_werror_flag - else - ac_cpp_err= - fi -else - ac_cpp_err=yes -fi -if test -z "$ac_cpp_err"; then - : -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 +if ac_fn_c_try_cpp "$LINENO"; then : +else # Broken: fails on valid input. continue fi -rm -f conftest.err conftest.$ac_ext +rm -f conftest.err conftest.i conftest.$ac_ext - # OK, works on sane cases. Now check whether non-existent headers + # OK, works on sane cases. Now check whether nonexistent headers # can be detected and how. - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include _ACEOF -if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 - (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } >/dev/null; then - if test -s conftest.err; then - ac_cpp_err=$ac_c_preproc_warn_flag - ac_cpp_err=$ac_cpp_err$ac_c_werror_flag - else - ac_cpp_err= - fi -else - ac_cpp_err=yes -fi -if test -z "$ac_cpp_err"; then +if ac_fn_c_try_cpp "$LINENO"; then : # Broken: success on invalid input. continue else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - # Passes both tests. ac_preproc_ok=: break fi -rm -f conftest.err conftest.$ac_ext +rm -f conftest.err conftest.i conftest.$ac_ext done # Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. -rm -f conftest.err conftest.$ac_ext -if $ac_preproc_ok; then +rm -f conftest.i conftest.err conftest.$ac_ext +if $ac_preproc_ok; then : break fi @@ -3336,8 +4081,8 @@ else ac_cv_prog_CPP=$CPP fi -echo "$as_me:$LINENO: result: $CPP" >&5 -echo "${ECHO_T}$CPP" >&6 +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $CPP" >&5 +$as_echo "$CPP" >&6; } ac_preproc_ok=false for ac_c_preproc_warn_flag in '' yes do @@ -3347,11 +4092,7 @@ # exists even on freestanding compilers. # On the NeXT, cc -E runs the code through the compiler's parser, # not just through cpp. "Syntax error" is here to catch this case. - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #ifdef __STDC__ # include @@ -3360,85 +4101,40 @@ #endif Syntax error _ACEOF -if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 - (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } >/dev/null; then - if test -s conftest.err; then - ac_cpp_err=$ac_c_preproc_warn_flag - ac_cpp_err=$ac_cpp_err$ac_c_werror_flag - else - ac_cpp_err= - fi -else - ac_cpp_err=yes -fi -if test -z "$ac_cpp_err"; then - : -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 +if ac_fn_c_try_cpp "$LINENO"; then : +else # Broken: fails on valid input. continue fi -rm -f conftest.err conftest.$ac_ext +rm -f conftest.err conftest.i conftest.$ac_ext - # OK, works on sane cases. Now check whether non-existent headers + # OK, works on sane cases. Now check whether nonexistent headers # can be detected and how. - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include _ACEOF -if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 - (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } >/dev/null; then - if test -s conftest.err; then - ac_cpp_err=$ac_c_preproc_warn_flag - ac_cpp_err=$ac_cpp_err$ac_c_werror_flag - else - ac_cpp_err= - fi -else - ac_cpp_err=yes -fi -if test -z "$ac_cpp_err"; then +if ac_fn_c_try_cpp "$LINENO"; then : # Broken: success on invalid input. continue else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - # Passes both tests. ac_preproc_ok=: break fi -rm -f conftest.err conftest.$ac_ext +rm -f conftest.err conftest.i conftest.$ac_ext done # Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. -rm -f conftest.err conftest.$ac_ext -if $ac_preproc_ok; then - : +rm -f conftest.i conftest.err conftest.$ac_ext +if $ac_preproc_ok; then : + else - { { echo "$as_me:$LINENO: error: C preprocessor \"$CPP\" fails sanity check -See \`config.log' for more details." >&5 -echo "$as_me: error: C preprocessor \"$CPP\" fails sanity check -See \`config.log' for more details." >&2;} - { (exit 1); exit 1; }; } + { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error $? "C preprocessor \"$CPP\" fails sanity check +See \`config.log' for more details" "$LINENO" 5; } fi ac_ext=c @@ -3448,31 +4144,142 @@ ac_compiler_gnu=$ac_cv_c_compiler_gnu -echo "$as_me:$LINENO: checking for egrep" >&5 -echo $ECHO_N "checking for egrep... $ECHO_C" >&6 -if test "${ac_cv_prog_egrep+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - if echo a | (grep -E '(a|b)') >/dev/null 2>&1 - then ac_cv_prog_egrep='grep -E' - else ac_cv_prog_egrep='egrep' +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for grep that handles long lines and -e" >&5 +$as_echo_n "checking for grep that handles long lines and -e... " >&6; } +if ${ac_cv_path_GREP+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -z "$GREP"; then + ac_path_GREP_found=false + # Loop through the user's path and test for each of PROGNAME-LIST + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_prog in grep ggrep; do + for ac_exec_ext in '' $ac_executable_extensions; do + ac_path_GREP="$as_dir/$ac_prog$ac_exec_ext" + as_fn_executable_p "$ac_path_GREP" || continue +# Check for GNU ac_path_GREP and select it if it is found. + # Check for GNU $ac_path_GREP +case `"$ac_path_GREP" --version 2>&1` in +*GNU*) + ac_cv_path_GREP="$ac_path_GREP" ac_path_GREP_found=:;; +*) + ac_count=0 + $as_echo_n 0123456789 >"conftest.in" + while : + do + cat "conftest.in" "conftest.in" >"conftest.tmp" + mv "conftest.tmp" "conftest.in" + cp "conftest.in" "conftest.nl" + $as_echo 'GREP' >> "conftest.nl" + "$ac_path_GREP" -e 'GREP$' -e '-(cannot match)-' < "conftest.nl" >"conftest.out" 2>/dev/null || break + diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break + as_fn_arith $ac_count + 1 && ac_count=$as_val + if test $ac_count -gt ${ac_path_GREP_max-0}; then + # Best one so far, save it but keep looking for a better one + ac_cv_path_GREP="$ac_path_GREP" + ac_path_GREP_max=$ac_count fi + # 10*(2^10) chars as input seems more than enough + test $ac_count -gt 10 && break + done + rm -f conftest.in conftest.tmp conftest.nl conftest.out;; +esac + + $ac_path_GREP_found && break 3 + done + done + done +IFS=$as_save_IFS + if test -z "$ac_cv_path_GREP"; then + as_fn_error $? "no acceptable grep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5 + fi +else + ac_cv_path_GREP=$GREP fi -echo "$as_me:$LINENO: result: $ac_cv_prog_egrep" >&5 -echo "${ECHO_T}$ac_cv_prog_egrep" >&6 - EGREP=$ac_cv_prog_egrep + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_GREP" >&5 +$as_echo "$ac_cv_path_GREP" >&6; } + GREP="$ac_cv_path_GREP" -echo "$as_me:$LINENO: checking for ANSI C header files" >&5 -echo $ECHO_N "checking for ANSI C header files... $ECHO_C" >&6 -if test "${ac_cv_header_stdc+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for egrep" >&5 +$as_echo_n "checking for egrep... " >&6; } +if ${ac_cv_path_EGREP+:} false; then : + $as_echo_n "(cached) " >&6 else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF + if echo a | $GREP -E '(a|b)' >/dev/null 2>&1 + then ac_cv_path_EGREP="$GREP -E" + else + if test -z "$EGREP"; then + ac_path_EGREP_found=false + # Loop through the user's path and test for each of PROGNAME-LIST + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_prog in egrep; do + for ac_exec_ext in '' $ac_executable_extensions; do + ac_path_EGREP="$as_dir/$ac_prog$ac_exec_ext" + as_fn_executable_p "$ac_path_EGREP" || continue +# Check for GNU ac_path_EGREP and select it if it is found. + # Check for GNU $ac_path_EGREP +case `"$ac_path_EGREP" --version 2>&1` in +*GNU*) + ac_cv_path_EGREP="$ac_path_EGREP" ac_path_EGREP_found=:;; +*) + ac_count=0 + $as_echo_n 0123456789 >"conftest.in" + while : + do + cat "conftest.in" "conftest.in" >"conftest.tmp" + mv "conftest.tmp" "conftest.in" + cp "conftest.in" "conftest.nl" + $as_echo 'EGREP' >> "conftest.nl" + "$ac_path_EGREP" 'EGREP$' < "conftest.nl" >"conftest.out" 2>/dev/null || break + diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break + as_fn_arith $ac_count + 1 && ac_count=$as_val + if test $ac_count -gt ${ac_path_EGREP_max-0}; then + # Best one so far, save it but keep looking for a better one + ac_cv_path_EGREP="$ac_path_EGREP" + ac_path_EGREP_max=$ac_count + fi + # 10*(2^10) chars as input seems more than enough + test $ac_count -gt 10 && break + done + rm -f conftest.in conftest.tmp conftest.nl conftest.out;; +esac + + $ac_path_EGREP_found && break 3 + done + done + done +IFS=$as_save_IFS + if test -z "$ac_cv_path_EGREP"; then + as_fn_error $? "no acceptable egrep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5 + fi +else + ac_cv_path_EGREP=$EGREP +fi + + fi +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_EGREP" >&5 +$as_echo "$ac_cv_path_EGREP" >&6; } + EGREP="$ac_cv_path_EGREP" + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for ANSI C header files" >&5 +$as_echo_n "checking for ANSI C header files... " >&6; } +if ${ac_cv_header_stdc+:} false; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #include @@ -3487,50 +4294,23 @@ return 0; } _ACEOF -rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then +if ac_fn_c_try_compile "$LINENO"; then : ac_cv_header_stdc=yes else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -ac_cv_header_stdc=no + ac_cv_header_stdc=no fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext if test $ac_cv_header_stdc = yes; then # SunOS 4.x string.h does not declare mem*, contrary to ANSI. - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | - $EGREP "memchr" >/dev/null 2>&1; then - : + $EGREP "memchr" >/dev/null 2>&1; then : + else ac_cv_header_stdc=no fi @@ -3540,18 +4320,14 @@ if test $ac_cv_header_stdc = yes; then # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI. - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | - $EGREP "free" >/dev/null 2>&1; then - : + $EGREP "free" >/dev/null 2>&1; then : + else ac_cv_header_stdc=no fi @@ -3561,16 +4337,13 @@ if test $ac_cv_header_stdc = yes; then # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi. - if test "$cross_compiling" = yes; then + if test "$cross_compiling" = yes; then : : else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include +#include #if ((' ' & 0x0FF) == 0x020) # define ISLOWER(c) ('a' <= (c) && (c) <= 'z') # define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c)) @@ -3590,108 +4363,39 @@ for (i = 0; i < 256; i++) if (XOR (islower (i), ISLOWER (i)) || toupper (i) != TOUPPER (i)) - exit(2); - exit (0); + return 2; + return 0; } _ACEOF -rm -f conftest$ac_exeext -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { ac_try='./conftest$ac_exeext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - : +if ac_fn_c_try_run "$LINENO"; then : + else - echo "$as_me: program exited with status $ac_status" >&5 -echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -( exit $ac_status ) -ac_cv_header_stdc=no + ac_cv_header_stdc=no fi -rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest.beam conftest.$ac_ext fi + fi fi -echo "$as_me:$LINENO: result: $ac_cv_header_stdc" >&5 -echo "${ECHO_T}$ac_cv_header_stdc" >&6 +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_header_stdc" >&5 +$as_echo "$ac_cv_header_stdc" >&6; } if test $ac_cv_header_stdc = yes; then -cat >>confdefs.h <<\_ACEOF -#define STDC_HEADERS 1 -_ACEOF +$as_echo "#define STDC_HEADERS 1" >>confdefs.h fi # On IRIX 5.3, sys/types and inttypes.h are conflicting. - - - - - - - - - for ac_header in sys/types.h sys/stat.h stdlib.h string.h memory.h strings.h \ inttypes.h stdint.h unistd.h -do -as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` -echo "$as_me:$LINENO: checking for $ac_header" >&5 -echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6 -if eval "test \"\${$as_ac_Header+set}\" = set"; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -$ac_includes_default - -#include <$ac_header> -_ACEOF -rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - eval "$as_ac_Header=yes" -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -eval "$as_ac_Header=no" -fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext -fi -echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5 -echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 -if test `eval echo '${'$as_ac_Header'}'` = yes; then +do : + as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` +ac_fn_c_check_header_compile "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default +" +if eval test \"x\$"$as_ac_Header"\" = x"yes"; then : cat >>confdefs.h <<_ACEOF -#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1 +#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 _ACEOF fi @@ -3699,149 +4403,12 @@ done - for ac_header in getopt.h -do -as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` -if eval "test \"\${$as_ac_Header+set}\" = set"; then - echo "$as_me:$LINENO: checking for $ac_header" >&5 -echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6 -if eval "test \"\${$as_ac_Header+set}\" = set"; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -fi -echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5 -echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 -else - # Is the header compilable? -echo "$as_me:$LINENO: checking $ac_header usability" >&5 -echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6 -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -$ac_includes_default -#include <$ac_header> -_ACEOF -rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - ac_header_compiler=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -ac_header_compiler=no -fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext -echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 -echo "${ECHO_T}$ac_header_compiler" >&6 - -# Is the header present? -echo "$as_me:$LINENO: checking $ac_header presence" >&5 -echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6 -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#include <$ac_header> -_ACEOF -if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 - (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } >/dev/null; then - if test -s conftest.err; then - ac_cpp_err=$ac_c_preproc_warn_flag - ac_cpp_err=$ac_cpp_err$ac_c_werror_flag - else - ac_cpp_err= - fi -else - ac_cpp_err=yes -fi -if test -z "$ac_cpp_err"; then - ac_header_preproc=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_header_preproc=no -fi -rm -f conftest.err conftest.$ac_ext -echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 -echo "${ECHO_T}$ac_header_preproc" >&6 - -# So? What about this header? -case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in - yes:no: ) - { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5 -echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;} - { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5 -echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;} - ac_header_preproc=yes - ;; - no:yes:* ) - { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5 -echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;} - { echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5 -echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;} - { echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5 -echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;} - { echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5 -echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;} - { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5 -echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;} - { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5 -echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;} - ( - cat <<\_ASBOX -## --------------------------------- ## -## Report this to jaq@spacepants.org ## -## --------------------------------- ## -_ASBOX - ) | - sed "s/^/$as_me: WARNING: /" >&2 - ;; -esac -echo "$as_me:$LINENO: checking for $ac_header" >&5 -echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6 -if eval "test \"\${$as_ac_Header+set}\" = set"; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - eval "$as_ac_Header=\$ac_header_preproc" -fi -echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5 -echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 - -fi -if test `eval echo '${'$as_ac_Header'}'` = yes; then +do : + ac_fn_c_check_header_mongrel "$LINENO" "getopt.h" "ac_cv_header_getopt_h" "$ac_includes_default" +if test "x$ac_cv_header_getopt_h" = xyes; then : cat >>confdefs.h <<_ACEOF -#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1 +#define HAVE_GETOPT_H 1 _ACEOF fi @@ -3850,70 +4417,43 @@ HAVE_GETOPT=no -echo "$as_me:$LINENO: checking for getopt in -lgetopt" >&5 -echo $ECHO_N "checking for getopt in -lgetopt... $ECHO_C" >&6 -if test "${ac_cv_lib_getopt_getopt+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for getopt in -lgetopt" >&5 +$as_echo_n "checking for getopt in -lgetopt... " >&6; } +if ${ac_cv_lib_getopt_getopt+:} false; then : + $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lgetopt $LIBS" -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF +cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ -/* Override any gcc2 internal prototype to avoid an error. */ +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif -/* We use char because int might match the return type of a gcc2 - builtin and then its argument prototype would still apply. */ char getopt (); int main () { -getopt (); +return getopt (); ; return 0; } _ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then +if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_getopt_getopt=yes else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -ac_cv_lib_getopt_getopt=no + ac_cv_lib_getopt_getopt=no fi -rm -f conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -echo "$as_me:$LINENO: result: $ac_cv_lib_getopt_getopt" >&5 -echo "${ECHO_T}$ac_cv_lib_getopt_getopt" >&6 -if test $ac_cv_lib_getopt_getopt = yes; then +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_getopt_getopt" >&5 +$as_echo "$ac_cv_lib_getopt_getopt" >&6; } +if test "x$ac_cv_lib_getopt_getopt" = xyes; then : HAVE_GETOPT=yes HAVE_GETOPT=no @@ -3926,26 +4466,29 @@ if test "x$ac_cv_c_compiler_gnu" = xyes ; then - CFLAGS="$CFLAGS -W -Wall -Waggregate-return" + CFLAGS="$CFLAGS -W -Wall -Werror -Waggregate-return" CFLAGS="$CFLAGS -Wcast-align -Wcast-qual -Wnested-externs" CFLAGS="$CFLAGS -Wshadow -Wbad-function-cast -Wwrite-strings" + CFLAGS="$CFLAGS -Winit-self -Wformat=2 -Wuninitialized" + CFLAGS="$CFLAGS -Wpointer-arith" + CFLAGS="$CFLAGS -Wstrict-aliasing -fstrict-aliasing" fi -echo "$as_me:$LINENO: checking whether to enable debugging compiler options" >&5 -echo $ECHO_N "checking whether to enable debugging compiler options... $ECHO_C" >&6 -# Check whether --enable-debug or --disable-debug was given. -if test "${enable_debug+set}" = set; then - enableval="$enable_debug" - echo "$as_me:$LINENO: result: yes" >&5 -echo "${ECHO_T}yes" >&6 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to enable debugging compiler options" >&5 +$as_echo_n "checking whether to enable debugging compiler options... " >&6; } +# Check whether --enable-debug was given. +if test "${enable_debug+set}" = set; then : + enableval=$enable_debug; { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } tmp_CFLAGS=`echo $CFLAGS | sed 's/O2/O0/g'` CFLAGS="$tmp_CFLAGS" else - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } + +fi -fi; @@ -3971,7 +4514,7 @@ echo "nothing yet" else - ac_config_files="$ac_config_files Makefile t/Makefile filtergen.spec fgadm fgadm.conf rules.filter" +ac_config_files="$ac_config_files Makefile t/Makefile filtergen.spec fgadm fgadm.conf rules.filter" cat >confcache <<\_ACEOF # This file is a shell script that caches the results of configure @@ -3991,39 +4534,70 @@ # The following way of writing the cache mishandles newlines in values, # but we know of no workaround that is simple, portable, and efficient. -# So, don't put newlines in cache variables' values. +# So, we kill variables containing newlines. # Ultrix sh set writes to stderr and can't be redirected directly, # and sets the high bit in the cache file unless we assign to the vars. -{ +( + for ac_var in `(set) 2>&1 | sed -n 's/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'`; do + eval ac_val=\$$ac_var + case $ac_val in #( + *${as_nl}*) + case $ac_var in #( + *_cv_*) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: cache variable $ac_var contains a newline" >&5 +$as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;; + esac + case $ac_var in #( + _ | IFS | as_nl) ;; #( + BASH_ARGV | BASH_SOURCE) eval $ac_var= ;; #( + *) { eval $ac_var=; unset $ac_var;} ;; + esac ;; + esac + done + (set) 2>&1 | - case `(ac_space=' '; set | grep ac_space) 2>&1` in - *ac_space=\ *) - # `set' does not quote correctly, so add quotes (double-quote - # substitution turns \\\\ into \\, and sed turns \\ into \). + case $as_nl`(ac_space=' '; set) 2>&1` in #( + *${as_nl}ac_space=\ *) + # `set' does not quote correctly, so add quotes: double-quote + # substitution turns \\\\ into \\, and sed turns \\ into \. sed -n \ "s/'/'\\\\''/g; s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\\2'/p" - ;; + ;; #( *) # `set' quotes correctly as required by POSIX, so do not add quotes. - sed -n \ - "s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1=\\2/p" + sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p" ;; - esac; -} | + esac | + sort +) | sed ' + /^ac_cv_env_/b end t clear - : clear + :clear s/^\([^=]*\)=\(.*[{}].*\)$/test "${\1+set}" = set || &/ t end - /^ac_cv_env/!s/^\([^=]*\)=\(.*\)$/\1=${\1=\2}/ - : end' >>confcache -if diff $cache_file confcache >/dev/null 2>&1; then :; else - if test -w $cache_file; then - test "x$cache_file" != "x/dev/null" && echo "updating cache $cache_file" - cat confcache >$cache_file + s/^\([^=]*\)=\(.*\)$/\1=${\1=\2}/ + :end' >>confcache +if diff "$cache_file" confcache >/dev/null 2>&1; then :; else + if test -w "$cache_file"; then + if test "x$cache_file" != "x/dev/null"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: updating cache $cache_file" >&5 +$as_echo "$as_me: updating cache $cache_file" >&6;} + if test ! -f "$cache_file" || test -h "$cache_file"; then + cat confcache >"$cache_file" + else + case $cache_file in #( + */* | ?:*) + mv -f confcache "$cache_file"$$ && + mv -f "$cache_file"$$ "$cache_file" ;; #( + *) + mv -f confcache "$cache_file" ;; + esac + fi + fi else - echo "not updating unwritable cache $cache_file" + { $as_echo "$as_me:${as_lineno-$LINENO}: not updating unwritable cache $cache_file" >&5 +$as_echo "$as_me: not updating unwritable cache $cache_file" >&6;} fi fi rm -f confcache @@ -4032,66 +4606,61 @@ # Let make expand exec_prefix. test "x$exec_prefix" = xNONE && exec_prefix='${prefix}' -# VPATH may cause trouble with some makes, so we remove $(srcdir), -# ${srcdir} and @srcdir@ from VPATH if srcdir is ".", strip leading and -# trailing colons and then remove the whole line if VPATH becomes empty -# (actually we leave an empty line to preserve line numbers). -if test "x$srcdir" = x.; then - ac_vpsub='/^[ ]*VPATH[ ]*=/{ -s/:*\$(srcdir):*/:/; -s/:*\${srcdir}:*/:/; -s/:*@srcdir@:*/:/; -s/^\([^=]*=[ ]*\):*/\1/; -s/:*$//; -s/^[^=]*=[ ]*$//; -}' -fi - DEFS=-DHAVE_CONFIG_H ac_libobjs= ac_ltlibobjs= for ac_i in : $LIBOBJS; do test "x$ac_i" = x: && continue # 1. Remove the extension, and $U if already installed. - ac_i=`echo "$ac_i" | - sed 's/\$U\././;s/\.o$//;s/\.obj$//'` - # 2. Add them. - ac_libobjs="$ac_libobjs $ac_i\$U.$ac_objext" - ac_ltlibobjs="$ac_ltlibobjs $ac_i"'$U.lo' + ac_script='s/\$U\././;s/\.o$//;s/\.obj$//' + ac_i=`$as_echo "$ac_i" | sed "$ac_script"` + # 2. Prepend LIBOBJDIR. When used with automake>=1.10 LIBOBJDIR + # will be set to the directory where LIBOBJS objects are built. + as_fn_append ac_libobjs " \${LIBOBJDIR}$ac_i\$U.$ac_objext" + as_fn_append ac_ltlibobjs " \${LIBOBJDIR}$ac_i"'$U.lo' done LIBOBJS=$ac_libobjs LTLIBOBJS=$ac_ltlibobjs +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking that generated files are newer than configure" >&5 +$as_echo_n "checking that generated files are newer than configure... " >&6; } + if test -n "$am_sleep_pid"; then + # Hide warnings about reused PIDs. + wait $am_sleep_pid 2>/dev/null + fi + { $as_echo "$as_me:${as_lineno-$LINENO}: result: done" >&5 +$as_echo "done" >&6; } + if test -n "$EXEEXT"; then + am__EXEEXT_TRUE= + am__EXEEXT_FALSE='#' +else + am__EXEEXT_TRUE='#' + am__EXEEXT_FALSE= +fi + if test -z "${MAINTAINER_MODE_TRUE}" && test -z "${MAINTAINER_MODE_FALSE}"; then - { { echo "$as_me:$LINENO: error: conditional \"MAINTAINER_MODE\" was never defined. -Usually this means the macro was only invoked conditionally." >&5 -echo "$as_me: error: conditional \"MAINTAINER_MODE\" was never defined. -Usually this means the macro was only invoked conditionally." >&2;} - { (exit 1); exit 1; }; } + as_fn_error $? "conditional \"MAINTAINER_MODE\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${AMDEP_TRUE}" && test -z "${AMDEP_FALSE}"; then - { { echo "$as_me:$LINENO: error: conditional \"AMDEP\" was never defined. -Usually this means the macro was only invoked conditionally." >&5 -echo "$as_me: error: conditional \"AMDEP\" was never defined. -Usually this means the macro was only invoked conditionally." >&2;} - { (exit 1); exit 1; }; } + as_fn_error $? "conditional \"AMDEP\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${am__fastdepCC_TRUE}" && test -z "${am__fastdepCC_FALSE}"; then - { { echo "$as_me:$LINENO: error: conditional \"am__fastdepCC\" was never defined. -Usually this means the macro was only invoked conditionally." >&5 -echo "$as_me: error: conditional \"am__fastdepCC\" was never defined. -Usually this means the macro was only invoked conditionally." >&2;} - { (exit 1); exit 1; }; } + as_fn_error $? "conditional \"am__fastdepCC\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi -: ${CONFIG_STATUS=./config.status} +: "${CONFIG_STATUS=./config.status}" +ac_write_fail=0 ac_clean_files_save=$ac_clean_files ac_clean_files="$ac_clean_files $CONFIG_STATUS" -{ echo "$as_me:$LINENO: creating $CONFIG_STATUS" >&5 -echo "$as_me: creating $CONFIG_STATUS" >&6;} -cat >$CONFIG_STATUS <<_ACEOF +{ $as_echo "$as_me:${as_lineno-$LINENO}: creating $CONFIG_STATUS" >&5 +$as_echo "$as_me: creating $CONFIG_STATUS" >&6;} +as_write_fail=0 +cat >$CONFIG_STATUS <<_ASEOF || as_write_fail=1 #! $SHELL # Generated by $as_me. # Run this file to recreate the current configuration. @@ -4101,81 +4670,253 @@ debug=false ac_cs_recheck=false ac_cs_silent=false -SHELL=\${CONFIG_SHELL-$SHELL} -_ACEOF -cat >>$CONFIG_STATUS <<\_ACEOF -## --------------------- ## -## M4sh Initialization. ## -## --------------------- ## +SHELL=\${CONFIG_SHELL-$SHELL} +export SHELL +_ASEOF +cat >>$CONFIG_STATUS <<\_ASEOF || as_write_fail=1 +## -------------------- ## +## M4sh Initialization. ## +## -------------------- ## -# Be Bourne compatible -if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then +# Be more Bourne compatible +DUALCASE=1; export DUALCASE # for MKS sh +if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then : emulate sh NULLCMD=: - # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which + # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which # is contrary to our usage. Disable this feature. alias -g '${1+"$@"}'='"$@"' -elif test -n "${BASH_VERSION+set}" && (set -o posix) >/dev/null 2>&1; then - set -o posix + setopt NO_GLOB_SUBST +else + case `(set -o) 2>/dev/null` in #( + *posix*) : + set -o posix ;; #( + *) : + ;; +esac fi -DUALCASE=1; export DUALCASE # for MKS sh -# Support unset when possible. -if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then - as_unset=unset -else - as_unset=false + +as_nl=' +' +export as_nl +# Printing a long string crashes Solaris 7 /usr/bin/printf. +as_echo='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' +as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo +as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo$as_echo +# Prefer a ksh shell builtin over an external printf program on Solaris, +# but without wasting forks for bash or zsh. +if test -z "$BASH_VERSION$ZSH_VERSION" \ + && (test "X`print -r -- $as_echo`" = "X$as_echo") 2>/dev/null; then + as_echo='print -r --' + as_echo_n='print -rn --' +elif (test "X`printf %s $as_echo`" = "X$as_echo") 2>/dev/null; then + as_echo='printf %s\n' + as_echo_n='printf %s' +else + if test "X`(/usr/ucb/echo -n -n $as_echo) 2>/dev/null`" = "X-n $as_echo"; then + as_echo_body='eval /usr/ucb/echo -n "$1$as_nl"' + as_echo_n='/usr/ucb/echo -n' + else + as_echo_body='eval expr "X$1" : "X\\(.*\\)"' + as_echo_n_body='eval + arg=$1; + case $arg in #( + *"$as_nl"*) + expr "X$arg" : "X\\(.*\\)$as_nl"; + arg=`expr "X$arg" : ".*$as_nl\\(.*\\)"`;; + esac; + expr "X$arg" : "X\\(.*\\)" | tr -d "$as_nl" + ' + export as_echo_n_body + as_echo_n='sh -c $as_echo_n_body as_echo' + fi + export as_echo_body + as_echo='sh -c $as_echo_body as_echo' +fi + +# The user is always right. +if test "${PATH_SEPARATOR+set}" != set; then + PATH_SEPARATOR=: + (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && { + (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 || + PATH_SEPARATOR=';' + } fi -# Work around bugs in pre-3.0 UWIN ksh. -$as_unset ENV MAIL MAILPATH +# IFS +# We need space, tab and new line, in precisely that order. Quoting is +# there to prevent editors from complaining about space-tab. +# (If _AS_PATH_WALK were called with IFS unset, it would disable word +# splitting by setting IFS to empty value.) +IFS=" "" $as_nl" + +# Find who we are. Look in the path if we contain no directory separator. +as_myself= +case $0 in #(( + *[\\/]* ) as_myself=$0 ;; + *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break + done +IFS=$as_save_IFS + + ;; +esac +# We did not find ourselves, most probably we were run as `sh COMMAND' +# in which case we are not to be found in the path. +if test "x$as_myself" = x; then + as_myself=$0 +fi +if test ! -f "$as_myself"; then + $as_echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2 + exit 1 +fi + +# Unset variables that we do not need and which cause bugs (e.g. in +# pre-3.0 UWIN ksh). But do not cause bugs in bash 2.01; the "|| exit 1" +# suppresses any "Segmentation fault" message there. '((' could +# trigger a bug in pdksh 5.2.14. +for as_var in BASH_ENV ENV MAIL MAILPATH +do eval test x\${$as_var+set} = xset \ + && ( (unset $as_var) || exit 1) >/dev/null 2>&1 && unset $as_var || : +done PS1='$ ' PS2='> ' PS4='+ ' # NLS nuisances. -for as_var in \ - LANG LANGUAGE LC_ADDRESS LC_ALL LC_COLLATE LC_CTYPE LC_IDENTIFICATION \ - LC_MEASUREMENT LC_MESSAGES LC_MONETARY LC_NAME LC_NUMERIC LC_PAPER \ - LC_TELEPHONE LC_TIME -do - if (set +x; test -z "`(eval $as_var=C; export $as_var) 2>&1`"); then - eval $as_var=C; export $as_var - else - $as_unset $as_var - fi -done +LC_ALL=C +export LC_ALL +LANGUAGE=C +export LANGUAGE -# Required to use basename. -if expr a : '\(a\)' >/dev/null 2>&1; then +# CDPATH. +(unset CDPATH) >/dev/null 2>&1 && unset CDPATH + + +# as_fn_error STATUS ERROR [LINENO LOG_FD] +# ---------------------------------------- +# Output "`basename $0`: error: ERROR" to stderr. If LINENO and LOG_FD are +# provided, also output the error to LOG_FD, referencing LINENO. Then exit the +# script with STATUS, using 1 if that was 0. +as_fn_error () +{ + as_status=$1; test $as_status -eq 0 && as_status=1 + if test "$4"; then + as_lineno=${as_lineno-"$3"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + $as_echo "$as_me:${as_lineno-$LINENO}: error: $2" >&$4 + fi + $as_echo "$as_me: error: $2" >&2 + as_fn_exit $as_status +} # as_fn_error + + +# as_fn_set_status STATUS +# ----------------------- +# Set $? to STATUS, without forking. +as_fn_set_status () +{ + return $1 +} # as_fn_set_status + +# as_fn_exit STATUS +# ----------------- +# Exit the shell with STATUS, even in a "trap 0" or "set -e" context. +as_fn_exit () +{ + set +e + as_fn_set_status $1 + exit $1 +} # as_fn_exit + +# as_fn_unset VAR +# --------------- +# Portably unset VAR. +as_fn_unset () +{ + { eval $1=; unset $1;} +} +as_unset=as_fn_unset +# as_fn_append VAR VALUE +# ---------------------- +# Append the text in VALUE to the end of the definition contained in VAR. Take +# advantage of any shell optimizations that allow amortized linear growth over +# repeated appends, instead of the typical quadratic growth present in naive +# implementations. +if (eval "as_var=1; as_var+=2; test x\$as_var = x12") 2>/dev/null; then : + eval 'as_fn_append () + { + eval $1+=\$2 + }' +else + as_fn_append () + { + eval $1=\$$1\$2 + } +fi # as_fn_append + +# as_fn_arith ARG... +# ------------------ +# Perform arithmetic evaluation on the ARGs, and store the result in the +# global $as_val. Take advantage of shells that can avoid forks. The arguments +# must be portable across $(()) and expr. +if (eval "test \$(( 1 + 1 )) = 2") 2>/dev/null; then : + eval 'as_fn_arith () + { + as_val=$(( $* )) + }' +else + as_fn_arith () + { + as_val=`expr "$@" || test $? -eq 1` + } +fi # as_fn_arith + + +if expr a : '\(a\)' >/dev/null 2>&1 && + test "X`expr 00001 : '.*\(...\)'`" = X001; then as_expr=expr else as_expr=false fi -if (basename /) >/dev/null 2>&1 && test "X`basename / 2>&1`" = "X/"; then +if (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; then as_basename=basename else as_basename=false fi +if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then + as_dirname=dirname +else + as_dirname=false +fi -# Name of the executable. -as_me=`$as_basename "$0" || +as_me=`$as_basename -- "$0" || $as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ X"$0" : 'X\(//\)$' \| \ - X"$0" : 'X\(/\)$' \| \ - . : '\(.\)' 2>/dev/null || -echo X/"$0" | - sed '/^.*\/\([^/][^/]*\)\/*$/{ s//\1/; q; } - /^X\/\(\/\/\)$/{ s//\1/; q; } - /^X\/\(\/\).*/{ s//\1/; q; } - s/.*/./; q'` + X"$0" : 'X\(/\)' \| . 2>/dev/null || +$as_echo X/"$0" | + sed '/^.*\/\([^/][^/]*\)\/*$/{ + s//\1/ + q + } + /^X\/\(\/\/\)$/{ + s//\1/ + q + } + /^X\/\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q'` - -# PATH needs CR, and LINENO needs CR and PATH. # Avoid depending upon Character Ranges. as_cr_letters='abcdefghijklmnopqrstuvwxyz' as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ' @@ -4183,148 +4924,111 @@ as_cr_digits='0123456789' as_cr_alnum=$as_cr_Letters$as_cr_digits -# The user is always right. -if test "${PATH_SEPARATOR+set}" != set; then - echo "#! /bin/sh" >conf$$.sh - echo "exit 0" >>conf$$.sh - chmod +x conf$$.sh - if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then - PATH_SEPARATOR=';' - else - PATH_SEPARATOR=: - fi - rm -f conf$$.sh -fi - - - as_lineno_1=$LINENO - as_lineno_2=$LINENO - as_lineno_3=`(expr $as_lineno_1 + 1) 2>/dev/null` - test "x$as_lineno_1" != "x$as_lineno_2" && - test "x$as_lineno_3" = "x$as_lineno_2" || { - # Find who we are. Look in the path if we contain no path at all - # relative or not. - case $0 in - *[\\/]* ) as_myself=$0 ;; - *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break -done - - ;; - esac - # We did not find ourselves, most probably we were run as `sh COMMAND' - # in which case we are not to be found in the path. - if test "x$as_myself" = x; then - as_myself=$0 - fi - if test ! -f "$as_myself"; then - { { echo "$as_me:$LINENO: error: cannot find myself; rerun with an absolute path" >&5 -echo "$as_me: error: cannot find myself; rerun with an absolute path" >&2;} - { (exit 1); exit 1; }; } - fi - case $CONFIG_SHELL in - '') - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in /bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for as_base in sh bash ksh sh5; do - case $as_dir in - /*) - if ("$as_dir/$as_base" -c ' - as_lineno_1=$LINENO - as_lineno_2=$LINENO - as_lineno_3=`(expr $as_lineno_1 + 1) 2>/dev/null` - test "x$as_lineno_1" != "x$as_lineno_2" && - test "x$as_lineno_3" = "x$as_lineno_2" ') 2>/dev/null; then - $as_unset BASH_ENV || test "${BASH_ENV+set}" != set || { BASH_ENV=; export BASH_ENV; } - $as_unset ENV || test "${ENV+set}" != set || { ENV=; export ENV; } - CONFIG_SHELL=$as_dir/$as_base - export CONFIG_SHELL - exec "$CONFIG_SHELL" "$0" ${1+"$@"} - fi;; - esac - done -done -;; - esac - - # Create $as_me.lineno as a copy of $as_myself, but with $LINENO - # uniformly replaced by the line number. The first 'sed' inserts a - # line-number line before each line; the second 'sed' does the real - # work. The second script uses 'N' to pair each line-number line - # with the numbered line, and appends trailing '-' during - # substitution so that $LINENO is not a special case at line end. - # (Raja R Harinath suggested sed '=', and Paul Eggert wrote the - # second 'sed' script. Blame Lee E. McMahon for sed's syntax. :-) - sed '=' <$as_myself | - sed ' - N - s,$,-, - : loop - s,^\(['$as_cr_digits']*\)\(.*\)[$]LINENO\([^'$as_cr_alnum'_]\),\1\2\1\3, - t loop - s,-$,, - s,^['$as_cr_digits']*\n,, - ' >$as_me.lineno && - chmod +x $as_me.lineno || - { { echo "$as_me:$LINENO: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&5 -echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2;} - { (exit 1); exit 1; }; } - - # Don't try to exec as it changes $[0], causing all sort of problems - # (the dirname of $[0] is not the place where we might find the - # original and so on. Autoconf is especially sensible to this). - . ./$as_me.lineno - # Exit status is that of the last command. - exit -} - - -case `echo "testing\c"; echo 1,2,3`,`echo -n testing; echo 1,2,3` in - *c*,-n*) ECHO_N= ECHO_C=' -' ECHO_T=' ' ;; - *c*,* ) ECHO_N=-n ECHO_C= ECHO_T= ;; - *) ECHO_N= ECHO_C='\c' ECHO_T= ;; +ECHO_C= ECHO_N= ECHO_T= +case `echo -n x` in #((((( +-n*) + case `echo 'xy\c'` in + *c*) ECHO_T=' ';; # ECHO_T is single tab character. + xy) ECHO_C='\c';; + *) echo `echo ksh88 bug on AIX 6.1` > /dev/null + ECHO_T=' ';; + esac;; +*) + ECHO_N='-n';; esac -if expr a : '\(a\)' >/dev/null 2>&1; then - as_expr=expr +rm -f conf$$ conf$$.exe conf$$.file +if test -d conf$$.dir; then + rm -f conf$$.dir/conf$$.file else - as_expr=false + rm -f conf$$.dir + mkdir conf$$.dir 2>/dev/null fi - -rm -f conf$$ conf$$.exe conf$$.file -echo >conf$$.file -if ln -s conf$$.file conf$$ 2>/dev/null; then - # We could just check for DJGPP; but this test a) works b) is more generic - # and c) will remain valid once DJGPP supports symlinks (DJGPP 2.04). - if test -f conf$$.exe; then - # Don't use ln at all; we don't have any links - as_ln_s='cp -p' - else +if (echo >conf$$.file) 2>/dev/null; then + if ln -s conf$$.file conf$$ 2>/dev/null; then as_ln_s='ln -s' + # ... but there are two gotchas: + # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail. + # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable. + # In both cases, we have to default to `cp -pR'. + ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe || + as_ln_s='cp -pR' + elif ln conf$$.file conf$$ 2>/dev/null; then + as_ln_s=ln + else + as_ln_s='cp -pR' fi -elif ln conf$$.file conf$$ 2>/dev/null; then - as_ln_s=ln else - as_ln_s='cp -p' + as_ln_s='cp -pR' fi -rm -f conf$$ conf$$.exe conf$$.file +rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file +rmdir conf$$.dir 2>/dev/null + + +# as_fn_mkdir_p +# ------------- +# Create "$as_dir" as a directory, including parents if necessary. +as_fn_mkdir_p () +{ + case $as_dir in #( + -*) as_dir=./$as_dir;; + esac + test -d "$as_dir" || eval $as_mkdir_p || { + as_dirs= + while :; do + case $as_dir in #( + *\'*) as_qdir=`$as_echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'( + *) as_qdir=$as_dir;; + esac + as_dirs="'$as_qdir' $as_dirs" + as_dir=`$as_dirname -- "$as_dir" || +$as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$as_dir" : 'X\(//\)[^/]' \| \ + X"$as_dir" : 'X\(//\)$' \| \ + X"$as_dir" : 'X\(/\)' \| . 2>/dev/null || +$as_echo X"$as_dir" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ + s//\1/ + q + } + /^X\(\/\/\)[^/].*/{ + s//\1/ + q + } + /^X\(\/\/\)$/{ + s//\1/ + q + } + /^X\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q'` + test -d "$as_dir" && break + done + test -z "$as_dirs" || eval "mkdir $as_dirs" + } || test -d "$as_dir" || as_fn_error $? "cannot create directory $as_dir" + + +} # as_fn_mkdir_p if mkdir -p . 2>/dev/null; then - as_mkdir_p=: + as_mkdir_p='mkdir -p "$as_dir"' else test -d ./-p && rmdir ./-p as_mkdir_p=false fi -as_executable_p="test -f" + +# as_fn_executable_p FILE +# ----------------------- +# Test if FILE is an executable regular file. +as_fn_executable_p () +{ + test -f "$1" && test -x "$1" +} # as_fn_executable_p +as_test_x='test -x' +as_executable_p=as_fn_executable_p # Sed expression to map a string onto a valid CPP name. as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'" @@ -4333,31 +5037,20 @@ as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'" -# IFS -# We need space, tab and new line, in precisely that order. -as_nl=' -' -IFS=" $as_nl" - -# CDPATH. -$as_unset CDPATH - exec 6>&1 +## ----------------------------------- ## +## Main body of $CONFIG_STATUS script. ## +## ----------------------------------- ## +_ASEOF +test $as_write_fail = 0 && chmod +x $CONFIG_STATUS || ac_write_fail=1 -# Open the log real soon, to keep \$[0] and so on meaningful, and to +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 +# Save the log message, to keep $0 and so on meaningful, and to # report actual input values of CONFIG_FILES etc. instead of their -# values after options handling. Logging --version etc. is OK. -exec 5>>config.log -{ - echo - sed 'h;s/./-/g;s/^.../## /;s/...$/ ##/;p;x;p;x' <<_ASBOX -## Running $as_me. ## -_ASBOX -} >&5 -cat >&5 <<_CSEOF - -This file was extended by filtergen $as_me 0.12.4, which was -generated by GNU Autoconf 2.59. Invocation command line was +# values after options handling. +ac_log=" +This file was extended by filtergen $as_me 0.12.7, which was +generated by GNU Autoconf 2.69. Invocation command line was CONFIG_FILES = $CONFIG_FILES CONFIG_HEADERS = $CONFIG_HEADERS @@ -4365,45 +5058,47 @@ CONFIG_COMMANDS = $CONFIG_COMMANDS $ $0 $@ -_CSEOF -echo "on `(hostname || uname -n) 2>/dev/null | sed 1q`" >&5 -echo >&5 +on `(hostname || uname -n) 2>/dev/null | sed 1q` +" + _ACEOF -# Files that config.status was made for. -if test -n "$ac_config_files"; then - echo "config_files=\"$ac_config_files\"" >>$CONFIG_STATUS -fi +case $ac_config_files in *" +"*) set x $ac_config_files; shift; ac_config_files=$*;; +esac -if test -n "$ac_config_headers"; then - echo "config_headers=\"$ac_config_headers\"" >>$CONFIG_STATUS -fi +case $ac_config_headers in *" +"*) set x $ac_config_headers; shift; ac_config_headers=$*;; +esac -if test -n "$ac_config_links"; then - echo "config_links=\"$ac_config_links\"" >>$CONFIG_STATUS -fi -if test -n "$ac_config_commands"; then - echo "config_commands=\"$ac_config_commands\"" >>$CONFIG_STATUS -fi +cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 +# Files that config.status was made for. +config_files="$ac_config_files" +config_headers="$ac_config_headers" +config_commands="$ac_config_commands" -cat >>$CONFIG_STATUS <<\_ACEOF +_ACEOF +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 ac_cs_usage="\ -\`$as_me' instantiates files from templates according to the -current configuration. +\`$as_me' instantiates files and other configuration actions +from templates according to the current configuration. Unless the files +and actions are specified as TAGs, all are instantiated by default. -Usage: $0 [OPTIONS] [FILE]... +Usage: $0 [OPTION]... [TAG]... -h, --help print this help, then exit - -V, --version print version number, then exit - -q, --quiet do not print progress messages + -V, --version print version number and configuration settings, then exit + --config print configuration, then exit + -q, --quiet, --silent + do not print progress messages -d, --debug don't remove temporary files --recheck update $as_me by reconfiguring in the same conditions - --file=FILE[:TEMPLATE] - instantiate the configuration file FILE - --header=FILE[:TEMPLATE] - instantiate the configuration header FILE + --file=FILE[:TEMPLATE] + instantiate the configuration file FILE + --header=FILE[:TEMPLATE] + instantiate the configuration header FILE Configuration files: $config_files @@ -4414,84 +5109,92 @@ Configuration commands: $config_commands -Report bugs to ." -_ACEOF +Report bugs to ." -cat >>$CONFIG_STATUS <<_ACEOF +_ACEOF +cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 +ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`" ac_cs_version="\\ -filtergen config.status 0.12.4 -configured by $0, generated by GNU Autoconf 2.59, - with options \\"`echo "$ac_configure_args" | sed 's/[\\""\`\$]/\\\\&/g'`\\" +filtergen config.status 0.12.7 +configured by $0, generated by GNU Autoconf 2.69, + with options \\"\$ac_cs_config\\" -Copyright (C) 2003 Free Software Foundation, Inc. +Copyright (C) 2012 Free Software Foundation, Inc. This config.status script is free software; the Free Software Foundation gives unlimited permission to copy, distribute and modify it." -srcdir=$srcdir -INSTALL="$INSTALL" + +ac_pwd='$ac_pwd' +srcdir='$srcdir' +INSTALL='$INSTALL' +MKDIR_P='$MKDIR_P' +AWK='$AWK' +test -n "\$AWK" || AWK=awk _ACEOF -cat >>$CONFIG_STATUS <<\_ACEOF -# If no file are specified by the user, then we need to provide default -# value. By we need to know if files were specified by the user. +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 +# The default lists apply if the user does not specify any file. ac_need_defaults=: while test $# != 0 do case $1 in - --*=*) - ac_option=`expr "x$1" : 'x\([^=]*\)='` - ac_optarg=`expr "x$1" : 'x[^=]*=\(.*\)'` + --*=?*) + ac_option=`expr "X$1" : 'X\([^=]*\)='` + ac_optarg=`expr "X$1" : 'X[^=]*=\(.*\)'` + ac_shift=: + ;; + --*=) + ac_option=`expr "X$1" : 'X\([^=]*\)='` + ac_optarg= ac_shift=: ;; - -*) + *) ac_option=$1 ac_optarg=$2 ac_shift=shift ;; - *) # This is not an option, so the user has probably given explicit - # arguments. - ac_option=$1 - ac_need_defaults=false;; esac case $ac_option in # Handling of the options. -_ACEOF -cat >>$CONFIG_STATUS <<\_ACEOF -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r) ac_cs_recheck=: ;; - --version | --vers* | -V ) - echo "$ac_cs_version"; exit 0 ;; - --he | --h) - # Conflict between --help and --header - { { echo "$as_me:$LINENO: error: ambiguous option: $1 -Try \`$0 --help' for more information." >&5 -echo "$as_me: error: ambiguous option: $1 -Try \`$0 --help' for more information." >&2;} - { (exit 1); exit 1; }; };; - --help | --hel | -h ) - echo "$ac_cs_usage"; exit 0 ;; - --debug | --d* | -d ) + --version | --versio | --versi | --vers | --ver | --ve | --v | -V ) + $as_echo "$ac_cs_version"; exit ;; + --config | --confi | --conf | --con | --co | --c ) + $as_echo "$ac_cs_config"; exit ;; + --debug | --debu | --deb | --de | --d | -d ) debug=: ;; --file | --fil | --fi | --f ) $ac_shift - CONFIG_FILES="$CONFIG_FILES $ac_optarg" + case $ac_optarg in + *\'*) ac_optarg=`$as_echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` ;; + '') as_fn_error $? "missing file argument" ;; + esac + as_fn_append CONFIG_FILES " '$ac_optarg'" ac_need_defaults=false;; --header | --heade | --head | --hea ) $ac_shift - CONFIG_HEADERS="$CONFIG_HEADERS $ac_optarg" + case $ac_optarg in + *\'*) ac_optarg=`$as_echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` ;; + esac + as_fn_append CONFIG_HEADERS " '$ac_optarg'" ac_need_defaults=false;; + --he | --h) + # Conflict between --help and --header + as_fn_error $? "ambiguous option: \`$1' +Try \`$0 --help' for more information.";; + --help | --hel | -h ) + $as_echo "$ac_cs_usage"; exit ;; -q | -quiet | --quiet | --quie | --qui | --qu | --q \ | -silent | --silent | --silen | --sile | --sil | --si | --s) ac_cs_silent=: ;; # This is an error. - -*) { { echo "$as_me:$LINENO: error: unrecognized option: $1 -Try \`$0 --help' for more information." >&5 -echo "$as_me: error: unrecognized option: $1 -Try \`$0 --help' for more information." >&2;} - { (exit 1); exit 1; }; } ;; + -*) as_fn_error $? "unrecognized option: \`$1' +Try \`$0 --help' for more information." ;; - *) ac_config_targets="$ac_config_targets $1" ;; + *) as_fn_append ac_config_targets " $1" + ac_need_defaults=false ;; esac shift @@ -4505,44 +5208,56 @@ fi _ACEOF -cat >>$CONFIG_STATUS <<_ACEOF +cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 if \$ac_cs_recheck; then - echo "running $SHELL $0 " $ac_configure_args \$ac_configure_extra_args " --no-create --no-recursion" >&6 - exec $SHELL $0 $ac_configure_args \$ac_configure_extra_args --no-create --no-recursion + set X $SHELL '$0' $ac_configure_args \$ac_configure_extra_args --no-create --no-recursion + shift + \$as_echo "running CONFIG_SHELL=$SHELL \$*" >&6 + CONFIG_SHELL='$SHELL' + export CONFIG_SHELL + exec "\$@" fi _ACEOF +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 +exec 5>>config.log +{ + echo + sed 'h;s/./-/g;s/^.../## /;s/...$/ ##/;p;x;p;x' <<_ASBOX +## Running $as_me. ## +_ASBOX + $as_echo "$ac_log" +} >&5 -cat >>$CONFIG_STATUS <<_ACEOF +_ACEOF +cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 # -# INIT-COMMANDS section. +# INIT-COMMANDS # - AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir" _ACEOF +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 - -cat >>$CONFIG_STATUS <<\_ACEOF +# Handling of arguments. for ac_config_target in $ac_config_targets do - case "$ac_config_target" in - # Handling of arguments. - "Makefile" ) CONFIG_FILES="$CONFIG_FILES Makefile" ;; - "t/Makefile" ) CONFIG_FILES="$CONFIG_FILES t/Makefile" ;; - "filtergen.spec" ) CONFIG_FILES="$CONFIG_FILES filtergen.spec" ;; - "fgadm" ) CONFIG_FILES="$CONFIG_FILES fgadm" ;; - "fgadm.conf" ) CONFIG_FILES="$CONFIG_FILES fgadm.conf" ;; - "rules.filter" ) CONFIG_FILES="$CONFIG_FILES rules.filter" ;; - "depfiles" ) CONFIG_COMMANDS="$CONFIG_COMMANDS depfiles" ;; - "config.h" ) CONFIG_HEADERS="$CONFIG_HEADERS config.h" ;; - *) { { echo "$as_me:$LINENO: error: invalid argument: $ac_config_target" >&5 -echo "$as_me: error: invalid argument: $ac_config_target" >&2;} - { (exit 1); exit 1; }; };; + case $ac_config_target in + "config.h") CONFIG_HEADERS="$CONFIG_HEADERS config.h" ;; + "depfiles") CONFIG_COMMANDS="$CONFIG_COMMANDS depfiles" ;; + "Makefile") CONFIG_FILES="$CONFIG_FILES Makefile" ;; + "t/Makefile") CONFIG_FILES="$CONFIG_FILES t/Makefile" ;; + "filtergen.spec") CONFIG_FILES="$CONFIG_FILES filtergen.spec" ;; + "fgadm") CONFIG_FILES="$CONFIG_FILES fgadm" ;; + "fgadm.conf") CONFIG_FILES="$CONFIG_FILES fgadm.conf" ;; + "rules.filter") CONFIG_FILES="$CONFIG_FILES rules.filter" ;; + + *) as_fn_error $? "invalid argument: \`$ac_config_target'" "$LINENO" 5;; esac done + # If the user did not use the arguments to specify the items to instantiate, # then the envvar interface is used. Set only those that are not. # We use the long form for the default assignment because of an extremely @@ -4554,828 +5269,689 @@ fi # Have a temporary directory for convenience. Make it in the build tree -# simply because there is no reason to put it here, and in addition, +# simply because there is no reason against having it here, and in addition, # creating and moving files from /tmp can sometimes cause problems. -# Create a temporary directory, and hook for its removal unless debugging. +# Hook for its removal unless debugging. +# Note that there is a small window in which the directory will not be cleaned: +# after its creation but before its name has been assigned to `$tmp'. $debug || { - trap 'exit_status=$?; rm -rf $tmp && exit $exit_status' 0 - trap '{ (exit 1); exit 1; }' 1 2 13 15 + tmp= ac_tmp= + trap 'exit_status=$? + : "${ac_tmp:=$tmp}" + { test ! -d "$ac_tmp" || rm -fr "$ac_tmp"; } && exit $exit_status +' 0 + trap 'as_fn_exit 1' 1 2 13 15 } - # Create a (secure) tmp directory for tmp files. { - tmp=`(umask 077 && mktemp -d -q "./confstatXXXXXX") 2>/dev/null` && - test -n "$tmp" && test -d "$tmp" + tmp=`(umask 077 && mktemp -d "./confXXXXXX") 2>/dev/null` && + test -d "$tmp" } || { - tmp=./confstat$$-$RANDOM - (umask 077 && mkdir $tmp) -} || + tmp=./conf$$-$RANDOM + (umask 077 && mkdir "$tmp") +} || as_fn_error $? "cannot create a temporary directory in ." "$LINENO" 5 +ac_tmp=$tmp + +# Set up the scripts for CONFIG_FILES section. +# No need to generate them if there are no CONFIG_FILES. +# This happens for instance with `./config.status config.h'. +if test -n "$CONFIG_FILES"; then + + +ac_cr=`echo X | tr X '\015'` +# On cygwin, bash can eat \r inside `` if the user requested igncr. +# But we know of no other shell where ac_cr would be empty at this +# point, so we can use a bashism as a fallback. +if test "x$ac_cr" = x; then + eval ac_cr=\$\'\\r\' +fi +ac_cs_awk_cr=`$AWK 'BEGIN { print "a\rb" }' /dev/null` +if test "$ac_cs_awk_cr" = "a${ac_cr}b"; then + ac_cs_awk_cr='\\r' +else + ac_cs_awk_cr=$ac_cr +fi + +echo 'BEGIN {' >"$ac_tmp/subs1.awk" && +_ACEOF + + +{ + echo "cat >conf$$subs.awk <<_ACEOF" && + echo "$ac_subst_vars" | sed 's/.*/&!$&$ac_delim/' && + echo "_ACEOF" +} >conf$$subs.sh || + as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5 +ac_delim_num=`echo "$ac_subst_vars" | grep -c '^'` +ac_delim='%!_!# ' +for ac_last_try in false false false false false :; do + . ./conf$$subs.sh || + as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5 + + ac_delim_n=`sed -n "s/.*$ac_delim\$/X/p" conf$$subs.awk | grep -c X` + if test $ac_delim_n = $ac_delim_num; then + break + elif $ac_last_try; then + as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5 + else + ac_delim="$ac_delim!$ac_delim _$ac_delim!! " + fi +done +rm -f conf$$subs.sh + +cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 +cat >>"\$ac_tmp/subs1.awk" <<\\_ACAWK && +_ACEOF +sed -n ' +h +s/^/S["/; s/!.*/"]=/ +p +g +s/^[^!]*!// +:repl +t repl +s/'"$ac_delim"'$// +t delim +:nl +h +s/\(.\{148\}\)..*/\1/ +t more1 +s/["\\]/\\&/g; s/^/"/; s/$/\\n"\\/ +p +n +b repl +:more1 +s/["\\]/\\&/g; s/^/"/; s/$/"\\/ +p +g +s/.\{148\}// +t nl +:delim +h +s/\(.\{148\}\)..*/\1/ +t more2 +s/["\\]/\\&/g; s/^/"/; s/$/"/ +p +b +:more2 +s/["\\]/\\&/g; s/^/"/; s/$/"\\/ +p +g +s/.\{148\}// +t delim +' >$CONFIG_STATUS || ac_write_fail=1 +rm -f conf$$subs.awk +cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 +_ACAWK +cat >>"\$ac_tmp/subs1.awk" <<_ACAWK && + for (key in S) S_is_set[key] = 1 + FS = "" + +} { - echo "$me: cannot create a temporary directory in ." >&2 - { (exit 1); exit 1; } + line = $ 0 + nfields = split(line, field, "@") + substed = 0 + len = length(field[1]) + for (i = 2; i < nfields; i++) { + key = field[i] + keylen = length(key) + if (S_is_set[key]) { + value = S[key] + line = substr(line, 1, len) "" value "" substr(line, len + keylen + 3) + len += length(value) + length(field[++i]) + substed = 1 + } else + len += 1 + keylen + } + + print line } +_ACAWK +_ACEOF +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 +if sed "s/$ac_cr//" < /dev/null > /dev/null 2>&1; then + sed "s/$ac_cr\$//; s/$ac_cr/$ac_cs_awk_cr/g" +else + cat +fi < "$ac_tmp/subs1.awk" > "$ac_tmp/subs.awk" \ + || as_fn_error $? "could not setup config files machinery" "$LINENO" 5 _ACEOF -cat >>$CONFIG_STATUS <<_ACEOF +# VPATH may cause trouble with some makes, so we remove sole $(srcdir), +# ${srcdir} and @srcdir@ entries from VPATH if srcdir is ".", strip leading and +# trailing colons and then remove the whole line if VPATH becomes empty +# (actually we leave an empty line to preserve line numbers). +if test "x$srcdir" = x.; then + ac_vpsub='/^[ ]*VPATH[ ]*=[ ]*/{ +h +s/// +s/^/:/ +s/[ ]*$/:/ +s/:\$(srcdir):/:/g +s/:\${srcdir}:/:/g +s/:@srcdir@:/:/g +s/^:*// +s/:*$// +x +s/\(=[ ]*\).*/\1/ +G +s/\n// +s/^[^=]*=[ ]*$// +}' +fi -# -# CONFIG_FILES section. -# +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 +fi # test -n "$CONFIG_FILES" -# No need to generate the scripts if there are no CONFIG_FILES. -# This happens for instance when ./config.status config.h -if test -n "\$CONFIG_FILES"; then - # Protect against being on the right side of a sed subst in config.status. - sed 's/,@/@@/; s/@,/@@/; s/,;t t\$/@;t t/; /@;t t\$/s/[\\\\&,]/\\\\&/g; - s/@@/,@/; s/@@/@,/; s/@;t t\$/,;t t/' >\$tmp/subs.sed <<\\CEOF -s,@SHELL@,$SHELL,;t t -s,@PATH_SEPARATOR@,$PATH_SEPARATOR,;t t -s,@PACKAGE_NAME@,$PACKAGE_NAME,;t t -s,@PACKAGE_TARNAME@,$PACKAGE_TARNAME,;t t -s,@PACKAGE_VERSION@,$PACKAGE_VERSION,;t t -s,@PACKAGE_STRING@,$PACKAGE_STRING,;t t -s,@PACKAGE_BUGREPORT@,$PACKAGE_BUGREPORT,;t t -s,@exec_prefix@,$exec_prefix,;t t -s,@prefix@,$prefix,;t t -s,@program_transform_name@,$program_transform_name,;t t -s,@bindir@,$bindir,;t t -s,@sbindir@,$sbindir,;t t -s,@libexecdir@,$libexecdir,;t t -s,@datadir@,$datadir,;t t -s,@sysconfdir@,$sysconfdir,;t t -s,@sharedstatedir@,$sharedstatedir,;t t -s,@localstatedir@,$localstatedir,;t t -s,@libdir@,$libdir,;t t -s,@includedir@,$includedir,;t t -s,@oldincludedir@,$oldincludedir,;t t -s,@infodir@,$infodir,;t t -s,@mandir@,$mandir,;t t -s,@build_alias@,$build_alias,;t t -s,@host_alias@,$host_alias,;t t -s,@target_alias@,$target_alias,;t t -s,@DEFS@,$DEFS,;t t -s,@ECHO_C@,$ECHO_C,;t t -s,@ECHO_N@,$ECHO_N,;t t -s,@ECHO_T@,$ECHO_T,;t t -s,@LIBS@,$LIBS,;t t -s,@INSTALL_PROGRAM@,$INSTALL_PROGRAM,;t t -s,@INSTALL_SCRIPT@,$INSTALL_SCRIPT,;t t -s,@INSTALL_DATA@,$INSTALL_DATA,;t t -s,@CYGPATH_W@,$CYGPATH_W,;t t -s,@PACKAGE@,$PACKAGE,;t t -s,@VERSION@,$VERSION,;t t -s,@ACLOCAL@,$ACLOCAL,;t t -s,@AUTOCONF@,$AUTOCONF,;t t -s,@AUTOMAKE@,$AUTOMAKE,;t t -s,@AUTOHEADER@,$AUTOHEADER,;t t -s,@MAKEINFO@,$MAKEINFO,;t t -s,@AMTAR@,$AMTAR,;t t -s,@install_sh@,$install_sh,;t t -s,@STRIP@,$STRIP,;t t -s,@ac_ct_STRIP@,$ac_ct_STRIP,;t t -s,@INSTALL_STRIP_PROGRAM@,$INSTALL_STRIP_PROGRAM,;t t -s,@mkdir_p@,$mkdir_p,;t t -s,@AWK@,$AWK,;t t -s,@SET_MAKE@,$SET_MAKE,;t t -s,@am__leading_dot@,$am__leading_dot,;t t -s,@MAINTAINER_MODE_TRUE@,$MAINTAINER_MODE_TRUE,;t t -s,@MAINTAINER_MODE_FALSE@,$MAINTAINER_MODE_FALSE,;t t -s,@MAINT@,$MAINT,;t t -s,@PROGRAM@,$PROGRAM,;t t -s,@CC@,$CC,;t t -s,@CFLAGS@,$CFLAGS,;t t -s,@LDFLAGS@,$LDFLAGS,;t t -s,@CPPFLAGS@,$CPPFLAGS,;t t -s,@ac_ct_CC@,$ac_ct_CC,;t t -s,@EXEEXT@,$EXEEXT,;t t -s,@OBJEXT@,$OBJEXT,;t t -s,@DEPDIR@,$DEPDIR,;t t -s,@am__include@,$am__include,;t t -s,@am__quote@,$am__quote,;t t -s,@AMDEP_TRUE@,$AMDEP_TRUE,;t t -s,@AMDEP_FALSE@,$AMDEP_FALSE,;t t -s,@AMDEPBACKSLASH@,$AMDEPBACKSLASH,;t t -s,@CCDEPMODE@,$CCDEPMODE,;t t -s,@am__fastdepCC_TRUE@,$am__fastdepCC_TRUE,;t t -s,@am__fastdepCC_FALSE@,$am__fastdepCC_FALSE,;t t -s,@LEX@,$LEX,;t t -s,@LEXLIB@,$LEXLIB,;t t -s,@LEX_OUTPUT_ROOT@,$LEX_OUTPUT_ROOT,;t t -s,@YACC@,$YACC,;t t -s,@CPP@,$CPP,;t t -s,@EGREP@,$EGREP,;t t -s,@GETOPT_LIBS@,$GETOPT_LIBS,;t t -s,@BINDIR@,$BINDIR,;t t -s,@SBINDIR@,$SBINDIR,;t t -s,@SYSCONFDIR@,$SYSCONFDIR,;t t -s,@pkgdocdir@,$pkgdocdir,;t t -s,@pkgexdir@,$pkgexdir,;t t -s,@LIBOBJS@,$LIBOBJS,;t t -s,@LTLIBOBJS@,$LTLIBOBJS,;t t -CEOF - -_ACEOF - - cat >>$CONFIG_STATUS <<\_ACEOF - # Split the substitutions into bite-sized pieces for seds with - # small command number limits, like on Digital OSF/1 and HP-UX. - ac_max_sed_lines=48 - ac_sed_frag=1 # Number of current file. - ac_beg=1 # First line for current file. - ac_end=$ac_max_sed_lines # Line after last line for current file. - ac_more_lines=: - ac_sed_cmds= - while $ac_more_lines; do - if test $ac_beg -gt 1; then - sed "1,${ac_beg}d; ${ac_end}q" $tmp/subs.sed >$tmp/subs.frag - else - sed "${ac_end}q" $tmp/subs.sed >$tmp/subs.frag - fi - if test ! -s $tmp/subs.frag; then - ac_more_lines=false - else - # The purpose of the label and of the branching condition is to - # speed up the sed processing (if there are no `@' at all, there - # is no need to browse any of the substitutions). - # These are the two extra sed commands mentioned above. - (echo ':t - /@[a-zA-Z_][a-zA-Z_0-9]*@/!b' && cat $tmp/subs.frag) >$tmp/subs-$ac_sed_frag.sed - if test -z "$ac_sed_cmds"; then - ac_sed_cmds="sed -f $tmp/subs-$ac_sed_frag.sed" - else - ac_sed_cmds="$ac_sed_cmds | sed -f $tmp/subs-$ac_sed_frag.sed" - fi - ac_sed_frag=`expr $ac_sed_frag + 1` - ac_beg=$ac_end - ac_end=`expr $ac_end + $ac_max_sed_lines` - fi - done - if test -z "$ac_sed_cmds"; then - ac_sed_cmds=cat +# Set up the scripts for CONFIG_HEADERS section. +# No need to generate them if there are no CONFIG_HEADERS. +# This happens for instance with `./config.status Makefile'. +if test -n "$CONFIG_HEADERS"; then +cat >"$ac_tmp/defines.awk" <<\_ACAWK || +BEGIN { +_ACEOF + +# Transform confdefs.h into an awk script `defines.awk', embedded as +# here-document in config.status, that substitutes the proper values into +# config.h.in to produce config.h. + +# Create a delimiter string that does not exist in confdefs.h, to ease +# handling of long lines. +ac_delim='%!_!# ' +for ac_last_try in false false :; do + ac_tt=`sed -n "/$ac_delim/p" confdefs.h` + if test -z "$ac_tt"; then + break + elif $ac_last_try; then + as_fn_error $? "could not make $CONFIG_HEADERS" "$LINENO" 5 + else + ac_delim="$ac_delim!$ac_delim _$ac_delim!! " fi -fi # test -n "$CONFIG_FILES" +done +# For the awk script, D is an array of macro values keyed by name, +# likewise P contains macro parameters if any. Preserve backslash +# newline sequences. + +ac_word_re=[_$as_cr_Letters][_$as_cr_alnum]* +sed -n ' +s/.\{148\}/&'"$ac_delim"'/g +t rset +:rset +s/^[ ]*#[ ]*define[ ][ ]*/ / +t def +d +:def +s/\\$// +t bsnl +s/["\\]/\\&/g +s/^ \('"$ac_word_re"'\)\(([^()]*)\)[ ]*\(.*\)/P["\1"]="\2"\ +D["\1"]=" \3"/p +s/^ \('"$ac_word_re"'\)[ ]*\(.*\)/D["\1"]=" \2"/p +d +:bsnl +s/["\\]/\\&/g +s/^ \('"$ac_word_re"'\)\(([^()]*)\)[ ]*\(.*\)/P["\1"]="\2"\ +D["\1"]=" \3\\\\\\n"\\/p +t cont +s/^ \('"$ac_word_re"'\)[ ]*\(.*\)/D["\1"]=" \2\\\\\\n"\\/p +t cont +d +:cont +n +s/.\{148\}/&'"$ac_delim"'/g +t clear +:clear +s/\\$// +t bsnlc +s/["\\]/\\&/g; s/^/"/; s/$/"/p +d +:bsnlc +s/["\\]/\\&/g; s/^/"/; s/$/\\\\\\n"\\/p +b cont +' >$CONFIG_STATUS || ac_write_fail=1 + +cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 + for (key in D) D_is_set[key] = 1 + FS = "" +} +/^[\t ]*#[\t ]*(define|undef)[\t ]+$ac_word_re([\t (]|\$)/ { + line = \$ 0 + split(line, arg, " ") + if (arg[1] == "#") { + defundef = arg[2] + mac1 = arg[3] + } else { + defundef = substr(arg[1], 2) + mac1 = arg[2] + } + split(mac1, mac2, "(") #) + macro = mac2[1] + prefix = substr(line, 1, index(line, defundef) - 1) + if (D_is_set[macro]) { + # Preserve the white space surrounding the "#". + print prefix "define", macro P[macro] D[macro] + next + } else { + # Replace #undef with comments. This is necessary, for example, + # in the case of _POSIX_SOURCE, which is predefined and required + # on some systems where configure will not decide to define it. + if (defundef == "undef") { + print "/*", prefix defundef, macro, "*/" + next + } + } +} +{ print } +_ACAWK _ACEOF -cat >>$CONFIG_STATUS <<\_ACEOF -for ac_file in : $CONFIG_FILES; do test "x$ac_file" = x: && continue - # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in". - case $ac_file in - - | *:- | *:-:* ) # input from stdin - cat >$tmp/stdin - ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'` - ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;; - *:* ) ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'` - ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;; - * ) ac_file_in=$ac_file.in ;; +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 + as_fn_error $? "could not setup config headers machinery" "$LINENO" 5 +fi # test -n "$CONFIG_HEADERS" + + +eval set X " :F $CONFIG_FILES :H $CONFIG_HEADERS :C $CONFIG_COMMANDS" +shift +for ac_tag +do + case $ac_tag in + :[FHLC]) ac_mode=$ac_tag; continue;; + esac + case $ac_mode$ac_tag in + :[FHL]*:*);; + :L* | :C*:*) as_fn_error $? "invalid tag \`$ac_tag'" "$LINENO" 5;; + :[FH]-) ac_tag=-:-;; + :[FH]*) ac_tag=$ac_tag:$ac_tag.in;; esac + ac_save_IFS=$IFS + IFS=: + set x $ac_tag + IFS=$ac_save_IFS + shift + ac_file=$1 + shift + + case $ac_mode in + :L) ac_source=$1;; + :[FH]) + ac_file_inputs= + for ac_f + do + case $ac_f in + -) ac_f="$ac_tmp/stdin";; + *) # Look for the file first in the build tree, then in the source tree + # (if the path is not absolute). The absolute path cannot be DOS-style, + # because $ac_f cannot contain `:'. + test -f "$ac_f" || + case $ac_f in + [\\/$]*) false;; + *) test -f "$srcdir/$ac_f" && ac_f="$srcdir/$ac_f";; + esac || + as_fn_error 1 "cannot find input file: \`$ac_f'" "$LINENO" 5;; + esac + case $ac_f in *\'*) ac_f=`$as_echo "$ac_f" | sed "s/'/'\\\\\\\\''/g"`;; esac + as_fn_append ac_file_inputs " '$ac_f'" + done - # Compute @srcdir@, @top_srcdir@, and @INSTALL@ for subdirectories. - ac_dir=`(dirname "$ac_file") 2>/dev/null || + # Let's still pretend it is `configure' which instantiates (i.e., don't + # use $as_me), people would be surprised to read: + # /* config.h. Generated by config.status. */ + configure_input='Generated from '` + $as_echo "$*" | sed 's|^[^:]*/||;s|:[^:]*/|, |g' + `' by configure.' + if test x"$ac_file" != x-; then + configure_input="$ac_file. $configure_input" + { $as_echo "$as_me:${as_lineno-$LINENO}: creating $ac_file" >&5 +$as_echo "$as_me: creating $ac_file" >&6;} + fi + # Neutralize special characters interpreted by sed in replacement strings. + case $configure_input in #( + *\&* | *\|* | *\\* ) + ac_sed_conf_input=`$as_echo "$configure_input" | + sed 's/[\\\\&|]/\\\\&/g'`;; #( + *) ac_sed_conf_input=$configure_input;; + esac + + case $ac_tag in + *:-:* | *:-) cat >"$ac_tmp/stdin" \ + || as_fn_error $? "could not create $ac_file" "$LINENO" 5 ;; + esac + ;; + esac + + ac_dir=`$as_dirname -- "$ac_file" || $as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$ac_file" : 'X\(//\)[^/]' \| \ X"$ac_file" : 'X\(//\)$' \| \ - X"$ac_file" : 'X\(/\)' \| \ - . : '\(.\)' 2>/dev/null || -echo X"$ac_file" | - sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; } - /^X\(\/\/\)[^/].*/{ s//\1/; q; } - /^X\(\/\/\)$/{ s//\1/; q; } - /^X\(\/\).*/{ s//\1/; q; } - s/.*/./; q'` - { if $as_mkdir_p; then - mkdir -p "$ac_dir" - else - as_dir="$ac_dir" - as_dirs= - while test ! -d "$as_dir"; do - as_dirs="$as_dir $as_dirs" - as_dir=`(dirname "$as_dir") 2>/dev/null || -$as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ - X"$as_dir" : 'X\(//\)[^/]' \| \ - X"$as_dir" : 'X\(//\)$' \| \ - X"$as_dir" : 'X\(/\)' \| \ - . : '\(.\)' 2>/dev/null || -echo X"$as_dir" | - sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; } - /^X\(\/\/\)[^/].*/{ s//\1/; q; } - /^X\(\/\/\)$/{ s//\1/; q; } - /^X\(\/\).*/{ s//\1/; q; } - s/.*/./; q'` - done - test ! -n "$as_dirs" || mkdir $as_dirs - fi || { { echo "$as_me:$LINENO: error: cannot create directory \"$ac_dir\"" >&5 -echo "$as_me: error: cannot create directory \"$ac_dir\"" >&2;} - { (exit 1); exit 1; }; }; } - + X"$ac_file" : 'X\(/\)' \| . 2>/dev/null || +$as_echo X"$ac_file" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ + s//\1/ + q + } + /^X\(\/\/\)[^/].*/{ + s//\1/ + q + } + /^X\(\/\/\)$/{ + s//\1/ + q + } + /^X\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q'` + as_dir="$ac_dir"; as_fn_mkdir_p ac_builddir=. -if test "$ac_dir" != .; then - ac_dir_suffix=/`echo "$ac_dir" | sed 's,^\.[\\/],,'` - # A "../" for each directory in $ac_dir_suffix. - ac_top_builddir=`echo "$ac_dir_suffix" | sed 's,/[^\\/]*,../,g'` -else - ac_dir_suffix= ac_top_builddir= -fi +case "$ac_dir" in +.) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;; +*) + ac_dir_suffix=/`$as_echo "$ac_dir" | sed 's|^\.[\\/]||'` + # A ".." for each directory in $ac_dir_suffix. + ac_top_builddir_sub=`$as_echo "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'` + case $ac_top_builddir_sub in + "") ac_top_builddir_sub=. ac_top_build_prefix= ;; + *) ac_top_build_prefix=$ac_top_builddir_sub/ ;; + esac ;; +esac +ac_abs_top_builddir=$ac_pwd +ac_abs_builddir=$ac_pwd$ac_dir_suffix +# for backward compatibility: +ac_top_builddir=$ac_top_build_prefix case $srcdir in - .) # No --srcdir option. We are building in place. + .) # We are building in place. ac_srcdir=. - if test -z "$ac_top_builddir"; then - ac_top_srcdir=. - else - ac_top_srcdir=`echo $ac_top_builddir | sed 's,/$,,'` - fi ;; - [\\/]* | ?:[\\/]* ) # Absolute path. + ac_top_srcdir=$ac_top_builddir_sub + ac_abs_top_srcdir=$ac_pwd ;; + [\\/]* | ?:[\\/]* ) # Absolute name. ac_srcdir=$srcdir$ac_dir_suffix; - ac_top_srcdir=$srcdir ;; - *) # Relative path. - ac_srcdir=$ac_top_builddir$srcdir$ac_dir_suffix - ac_top_srcdir=$ac_top_builddir$srcdir ;; + ac_top_srcdir=$srcdir + ac_abs_top_srcdir=$srcdir ;; + *) # Relative name. + ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix + ac_top_srcdir=$ac_top_build_prefix$srcdir + ac_abs_top_srcdir=$ac_pwd/$srcdir ;; esac +ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix -# Do not use `cd foo && pwd` to compute absolute paths, because -# the directories may not exist. -case `pwd` in -.) ac_abs_builddir="$ac_dir";; -*) - case "$ac_dir" in - .) ac_abs_builddir=`pwd`;; - [\\/]* | ?:[\\/]* ) ac_abs_builddir="$ac_dir";; - *) ac_abs_builddir=`pwd`/"$ac_dir";; - esac;; -esac -case $ac_abs_builddir in -.) ac_abs_top_builddir=${ac_top_builddir}.;; -*) - case ${ac_top_builddir}. in - .) ac_abs_top_builddir=$ac_abs_builddir;; - [\\/]* | ?:[\\/]* ) ac_abs_top_builddir=${ac_top_builddir}.;; - *) ac_abs_top_builddir=$ac_abs_builddir/${ac_top_builddir}.;; - esac;; -esac -case $ac_abs_builddir in -.) ac_abs_srcdir=$ac_srcdir;; -*) - case $ac_srcdir in - .) ac_abs_srcdir=$ac_abs_builddir;; - [\\/]* | ?:[\\/]* ) ac_abs_srcdir=$ac_srcdir;; - *) ac_abs_srcdir=$ac_abs_builddir/$ac_srcdir;; - esac;; -esac -case $ac_abs_builddir in -.) ac_abs_top_srcdir=$ac_top_srcdir;; -*) - case $ac_top_srcdir in - .) ac_abs_top_srcdir=$ac_abs_builddir;; - [\\/]* | ?:[\\/]* ) ac_abs_top_srcdir=$ac_top_srcdir;; - *) ac_abs_top_srcdir=$ac_abs_builddir/$ac_top_srcdir;; - esac;; -esac + case $ac_mode in + :F) + # + # CONFIG_FILE + # case $INSTALL in [\\/$]* | ?:[\\/]* ) ac_INSTALL=$INSTALL ;; - *) ac_INSTALL=$ac_top_builddir$INSTALL ;; + *) ac_INSTALL=$ac_top_build_prefix$INSTALL ;; esac + ac_MKDIR_P=$MKDIR_P + case $MKDIR_P in + [\\/$]* | ?:[\\/]* ) ;; + */*) ac_MKDIR_P=$ac_top_build_prefix$MKDIR_P ;; + esac +_ACEOF - # Let's still pretend it is `configure' which instantiates (i.e., don't - # use $as_me), people would be surprised to read: - # /* config.h. Generated by config.status. */ - if test x"$ac_file" = x-; then - configure_input= - else - configure_input="$ac_file. " - fi - configure_input=$configure_input"Generated from `echo $ac_file_in | - sed 's,.*/,,'` by configure." - - # First look for the input files in the build tree, otherwise in the - # src tree. - ac_file_inputs=`IFS=: - for f in $ac_file_in; do - case $f in - -) echo $tmp/stdin ;; - [\\/$]*) - # Absolute (can't be DOS-style, as IFS=:) - test -f "$f" || { { echo "$as_me:$LINENO: error: cannot find input file: $f" >&5 -echo "$as_me: error: cannot find input file: $f" >&2;} - { (exit 1); exit 1; }; } - echo "$f";; - *) # Relative - if test -f "$f"; then - # Build tree - echo "$f" - elif test -f "$srcdir/$f"; then - # Source tree - echo "$srcdir/$f" - else - # /dev/null tree - { { echo "$as_me:$LINENO: error: cannot find input file: $f" >&5 -echo "$as_me: error: cannot find input file: $f" >&2;} - { (exit 1); exit 1; }; } - fi;; - esac - done` || { (exit 1); exit 1; } - - if test x"$ac_file" != x-; then - { echo "$as_me:$LINENO: creating $ac_file" >&5 -echo "$as_me: creating $ac_file" >&6;} - rm -f "$ac_file" - fi +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 +# If the template does not know about datarootdir, expand it. +# FIXME: This hack should be removed a few years after 2.60. +ac_datarootdir_hack=; ac_datarootdir_seen= +ac_sed_dataroot=' +/datarootdir/ { + p + q +} +/@datadir@/p +/@docdir@/p +/@infodir@/p +/@localedir@/p +/@mandir@/p' +case `eval "sed -n \"\$ac_sed_dataroot\" $ac_file_inputs"` in +*datarootdir*) ac_datarootdir_seen=yes;; +*@datadir@*|*@docdir@*|*@infodir@*|*@localedir@*|*@mandir@*) + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&5 +$as_echo "$as_me: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&2;} +_ACEOF +cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 + ac_datarootdir_hack=' + s&@datadir@&$datadir&g + s&@docdir@&$docdir&g + s&@infodir@&$infodir&g + s&@localedir@&$localedir&g + s&@mandir@&$mandir&g + s&\\\${datarootdir}&$datarootdir&g' ;; +esac _ACEOF -cat >>$CONFIG_STATUS <<_ACEOF - sed "$ac_vpsub + +# Neutralize VPATH when `$srcdir' = `.'. +# Shell code in configure.ac might set extrasub. +# FIXME: do we really want to maintain this feature? +cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 +ac_sed_extra="$ac_vpsub $extrasub _ACEOF -cat >>$CONFIG_STATUS <<\_ACEOF +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 :t /@[a-zA-Z_][a-zA-Z_0-9]*@/!b -s,@configure_input@,$configure_input,;t t -s,@srcdir@,$ac_srcdir,;t t -s,@abs_srcdir@,$ac_abs_srcdir,;t t -s,@top_srcdir@,$ac_top_srcdir,;t t -s,@abs_top_srcdir@,$ac_abs_top_srcdir,;t t -s,@builddir@,$ac_builddir,;t t -s,@abs_builddir@,$ac_abs_builddir,;t t -s,@top_builddir@,$ac_top_builddir,;t t -s,@abs_top_builddir@,$ac_abs_top_builddir,;t t -s,@INSTALL@,$ac_INSTALL,;t t -" $ac_file_inputs | (eval "$ac_sed_cmds") >$tmp/out - rm -f $tmp/stdin - if test x"$ac_file" != x-; then - mv $tmp/out $ac_file - else - cat $tmp/out - rm -f $tmp/out - fi - -done -_ACEOF -cat >>$CONFIG_STATUS <<\_ACEOF - -# -# CONFIG_HEADER section. -# +s|@configure_input@|$ac_sed_conf_input|;t t +s&@top_builddir@&$ac_top_builddir_sub&;t t +s&@top_build_prefix@&$ac_top_build_prefix&;t t +s&@srcdir@&$ac_srcdir&;t t +s&@abs_srcdir@&$ac_abs_srcdir&;t t +s&@top_srcdir@&$ac_top_srcdir&;t t +s&@abs_top_srcdir@&$ac_abs_top_srcdir&;t t +s&@builddir@&$ac_builddir&;t t +s&@abs_builddir@&$ac_abs_builddir&;t t +s&@abs_top_builddir@&$ac_abs_top_builddir&;t t +s&@INSTALL@&$ac_INSTALL&;t t +s&@MKDIR_P@&$ac_MKDIR_P&;t t +$ac_datarootdir_hack +" +eval sed \"\$ac_sed_extra\" "$ac_file_inputs" | $AWK -f "$ac_tmp/subs.awk" \ + >$ac_tmp/out || as_fn_error $? "could not create $ac_file" "$LINENO" 5 + +test -z "$ac_datarootdir_hack$ac_datarootdir_seen" && + { ac_out=`sed -n '/\${datarootdir}/p' "$ac_tmp/out"`; test -n "$ac_out"; } && + { ac_out=`sed -n '/^[ ]*datarootdir[ ]*:*=/p' \ + "$ac_tmp/out"`; test -z "$ac_out"; } && + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $ac_file contains a reference to the variable \`datarootdir' +which seems to be undefined. Please make sure it is defined" >&5 +$as_echo "$as_me: WARNING: $ac_file contains a reference to the variable \`datarootdir' +which seems to be undefined. Please make sure it is defined" >&2;} -# These sed commands are passed to sed as "A NAME B NAME C VALUE D", where -# NAME is the cpp macro being defined and VALUE is the value it is being given. -# -# ac_d sets the value in "#define NAME VALUE" lines. -ac_dA='s,^\([ ]*\)#\([ ]*define[ ][ ]*\)' -ac_dB='[ ].*$,\1#\2' -ac_dC=' ' -ac_dD=',;t' -# ac_u turns "#undef NAME" without trailing blanks into "#define NAME VALUE". -ac_uA='s,^\([ ]*\)#\([ ]*\)undef\([ ][ ]*\)' -ac_uB='$,\1#\2define\3' -ac_uC=' ' -ac_uD=',;t' - -for ac_file in : $CONFIG_HEADERS; do test "x$ac_file" = x: && continue - # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in". + rm -f "$ac_tmp/stdin" case $ac_file in - - | *:- | *:-:* ) # input from stdin - cat >$tmp/stdin - ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'` - ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;; - *:* ) ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'` - ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;; - * ) ac_file_in=$ac_file.in ;; - esac - - test x"$ac_file" != x- && { echo "$as_me:$LINENO: creating $ac_file" >&5 -echo "$as_me: creating $ac_file" >&6;} - - # First look for the input files in the build tree, otherwise in the - # src tree. - ac_file_inputs=`IFS=: - for f in $ac_file_in; do - case $f in - -) echo $tmp/stdin ;; - [\\/$]*) - # Absolute (can't be DOS-style, as IFS=:) - test -f "$f" || { { echo "$as_me:$LINENO: error: cannot find input file: $f" >&5 -echo "$as_me: error: cannot find input file: $f" >&2;} - { (exit 1); exit 1; }; } - # Do quote $f, to prevent DOS paths from being IFS'd. - echo "$f";; - *) # Relative - if test -f "$f"; then - # Build tree - echo "$f" - elif test -f "$srcdir/$f"; then - # Source tree - echo "$srcdir/$f" - else - # /dev/null tree - { { echo "$as_me:$LINENO: error: cannot find input file: $f" >&5 -echo "$as_me: error: cannot find input file: $f" >&2;} - { (exit 1); exit 1; }; } - fi;; - esac - done` || { (exit 1); exit 1; } - # Remove the trailing spaces. - sed 's/[ ]*$//' $ac_file_inputs >$tmp/in - -_ACEOF - -# Transform confdefs.h into two sed scripts, `conftest.defines' and -# `conftest.undefs', that substitutes the proper values into -# config.h.in to produce config.h. The first handles `#define' -# templates, and the second `#undef' templates. -# And first: Protect against being on the right side of a sed subst in -# config.status. Protect against being in an unquoted here document -# in config.status. -rm -f conftest.defines conftest.undefs -# Using a here document instead of a string reduces the quoting nightmare. -# Putting comments in sed scripts is not portable. -# -# `end' is used to avoid that the second main sed command (meant for -# 0-ary CPP macros) applies to n-ary macro definitions. -# See the Autoconf documentation for `clear'. -cat >confdef2sed.sed <<\_ACEOF -s/[\\&,]/\\&/g -s,[\\$`],\\&,g -t clear -: clear -s,^[ ]*#[ ]*define[ ][ ]*\([^ (][^ (]*\)\(([^)]*)\)[ ]*\(.*\)$,${ac_dA}\1${ac_dB}\1\2${ac_dC}\3${ac_dD},gp -t end -s,^[ ]*#[ ]*define[ ][ ]*\([^ ][^ ]*\)[ ]*\(.*\)$,${ac_dA}\1${ac_dB}\1${ac_dC}\2${ac_dD},gp -: end -_ACEOF -# If some macros were called several times there might be several times -# the same #defines, which is useless. Nevertheless, we may not want to -# sort them, since we want the *last* AC-DEFINE to be honored. -uniq confdefs.h | sed -n -f confdef2sed.sed >conftest.defines -sed 's/ac_d/ac_u/g' conftest.defines >conftest.undefs -rm -f confdef2sed.sed - -# This sed command replaces #undef with comments. This is necessary, for -# example, in the case of _POSIX_SOURCE, which is predefined and required -# on some systems where configure will not decide to define it. -cat >>conftest.undefs <<\_ACEOF -s,^[ ]*#[ ]*undef[ ][ ]*[a-zA-Z_][a-zA-Z_0-9]*,/* & */, -_ACEOF - -# Break up conftest.defines because some shells have a limit on the size -# of here documents, and old seds have small limits too (100 cmds). -echo ' # Handle all the #define templates only if necessary.' >>$CONFIG_STATUS -echo ' if grep "^[ ]*#[ ]*define" $tmp/in >/dev/null; then' >>$CONFIG_STATUS -echo ' # If there are no defines, we may have an empty if/fi' >>$CONFIG_STATUS -echo ' :' >>$CONFIG_STATUS -rm -f conftest.tail -while grep . conftest.defines >/dev/null -do - # Write a limited-size here document to $tmp/defines.sed. - echo ' cat >$tmp/defines.sed <>$CONFIG_STATUS - # Speed up: don't consider the non `#define' lines. - echo '/^[ ]*#[ ]*define/!b' >>$CONFIG_STATUS - # Work around the forget-to-reset-the-flag bug. - echo 't clr' >>$CONFIG_STATUS - echo ': clr' >>$CONFIG_STATUS - sed ${ac_max_here_lines}q conftest.defines >>$CONFIG_STATUS - echo 'CEOF - sed -f $tmp/defines.sed $tmp/in >$tmp/out - rm -f $tmp/in - mv $tmp/out $tmp/in -' >>$CONFIG_STATUS - sed 1,${ac_max_here_lines}d conftest.defines >conftest.tail - rm -f conftest.defines - mv conftest.tail conftest.defines -done -rm -f conftest.defines -echo ' fi # grep' >>$CONFIG_STATUS -echo >>$CONFIG_STATUS - -# Break up conftest.undefs because some shells have a limit on the size -# of here documents, and old seds have small limits too (100 cmds). -echo ' # Handle all the #undef templates' >>$CONFIG_STATUS -rm -f conftest.tail -while grep . conftest.undefs >/dev/null -do - # Write a limited-size here document to $tmp/undefs.sed. - echo ' cat >$tmp/undefs.sed <>$CONFIG_STATUS - # Speed up: don't consider the non `#undef' - echo '/^[ ]*#[ ]*undef/!b' >>$CONFIG_STATUS - # Work around the forget-to-reset-the-flag bug. - echo 't clr' >>$CONFIG_STATUS - echo ': clr' >>$CONFIG_STATUS - sed ${ac_max_here_lines}q conftest.undefs >>$CONFIG_STATUS - echo 'CEOF - sed -f $tmp/undefs.sed $tmp/in >$tmp/out - rm -f $tmp/in - mv $tmp/out $tmp/in -' >>$CONFIG_STATUS - sed 1,${ac_max_here_lines}d conftest.undefs >conftest.tail - rm -f conftest.undefs - mv conftest.tail conftest.undefs -done -rm -f conftest.undefs - -cat >>$CONFIG_STATUS <<\_ACEOF - # Let's still pretend it is `configure' which instantiates (i.e., don't - # use $as_me), people would be surprised to read: - # /* config.h. Generated by config.status. */ - if test x"$ac_file" = x-; then - echo "/* Generated by configure. */" >$tmp/config.h - else - echo "/* $ac_file. Generated by configure. */" >$tmp/config.h - fi - cat $tmp/in >>$tmp/config.h - rm -f $tmp/in + -) cat "$ac_tmp/out" && rm -f "$ac_tmp/out";; + *) rm -f "$ac_file" && mv "$ac_tmp/out" "$ac_file";; + esac \ + || as_fn_error $? "could not create $ac_file" "$LINENO" 5 + ;; + :H) + # + # CONFIG_HEADER + # if test x"$ac_file" != x-; then - if diff $ac_file $tmp/config.h >/dev/null 2>&1; then - { echo "$as_me:$LINENO: $ac_file is unchanged" >&5 -echo "$as_me: $ac_file is unchanged" >&6;} + { + $as_echo "/* $configure_input */" \ + && eval '$AWK -f "$ac_tmp/defines.awk"' "$ac_file_inputs" + } >"$ac_tmp/config.h" \ + || as_fn_error $? "could not create $ac_file" "$LINENO" 5 + if diff "$ac_file" "$ac_tmp/config.h" >/dev/null 2>&1; then + { $as_echo "$as_me:${as_lineno-$LINENO}: $ac_file is unchanged" >&5 +$as_echo "$as_me: $ac_file is unchanged" >&6;} else - ac_dir=`(dirname "$ac_file") 2>/dev/null || -$as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ - X"$ac_file" : 'X\(//\)[^/]' \| \ - X"$ac_file" : 'X\(//\)$' \| \ - X"$ac_file" : 'X\(/\)' \| \ - . : '\(.\)' 2>/dev/null || -echo X"$ac_file" | - sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; } - /^X\(\/\/\)[^/].*/{ s//\1/; q; } - /^X\(\/\/\)$/{ s//\1/; q; } - /^X\(\/\).*/{ s//\1/; q; } - s/.*/./; q'` - { if $as_mkdir_p; then - mkdir -p "$ac_dir" - else - as_dir="$ac_dir" - as_dirs= - while test ! -d "$as_dir"; do - as_dirs="$as_dir $as_dirs" - as_dir=`(dirname "$as_dir") 2>/dev/null || -$as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ - X"$as_dir" : 'X\(//\)[^/]' \| \ - X"$as_dir" : 'X\(//\)$' \| \ - X"$as_dir" : 'X\(/\)' \| \ - . : '\(.\)' 2>/dev/null || -echo X"$as_dir" | - sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; } - /^X\(\/\/\)[^/].*/{ s//\1/; q; } - /^X\(\/\/\)$/{ s//\1/; q; } - /^X\(\/\).*/{ s//\1/; q; } - s/.*/./; q'` - done - test ! -n "$as_dirs" || mkdir $as_dirs - fi || { { echo "$as_me:$LINENO: error: cannot create directory \"$ac_dir\"" >&5 -echo "$as_me: error: cannot create directory \"$ac_dir\"" >&2;} - { (exit 1); exit 1; }; }; } - - rm -f $ac_file - mv $tmp/config.h $ac_file + rm -f "$ac_file" + mv "$ac_tmp/config.h" "$ac_file" \ + || as_fn_error $? "could not create $ac_file" "$LINENO" 5 fi else - cat $tmp/config.h - rm -f $tmp/config.h + $as_echo "/* $configure_input */" \ + && eval '$AWK -f "$ac_tmp/defines.awk"' "$ac_file_inputs" \ + || as_fn_error $? "could not create -" "$LINENO" 5 fi -# Compute $ac_file's index in $config_headers. +# Compute "$ac_file"'s index in $config_headers. +_am_arg="$ac_file" _am_stamp_count=1 for _am_header in $config_headers :; do case $_am_header in - $ac_file | $ac_file:* ) + $_am_arg | $_am_arg:* ) break ;; * ) _am_stamp_count=`expr $_am_stamp_count + 1` ;; esac done -echo "timestamp for $ac_file" >`(dirname $ac_file) 2>/dev/null || -$as_expr X$ac_file : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ - X$ac_file : 'X\(//\)[^/]' \| \ - X$ac_file : 'X\(//\)$' \| \ - X$ac_file : 'X\(/\)' \| \ - . : '\(.\)' 2>/dev/null || -echo X$ac_file | - sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; } - /^X\(\/\/\)[^/].*/{ s//\1/; q; } - /^X\(\/\/\)$/{ s//\1/; q; } - /^X\(\/\).*/{ s//\1/; q; } - s/.*/./; q'`/stamp-h$_am_stamp_count -done -_ACEOF -cat >>$CONFIG_STATUS <<\_ACEOF - -# -# CONFIG_COMMANDS section. -# -for ac_file in : $CONFIG_COMMANDS; do test "x$ac_file" = x: && continue - ac_dest=`echo "$ac_file" | sed 's,:.*,,'` - ac_source=`echo "$ac_file" | sed 's,[^:]*:,,'` - ac_dir=`(dirname "$ac_dest") 2>/dev/null || -$as_expr X"$ac_dest" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ - X"$ac_dest" : 'X\(//\)[^/]' \| \ - X"$ac_dest" : 'X\(//\)$' \| \ - X"$ac_dest" : 'X\(/\)' \| \ - . : '\(.\)' 2>/dev/null || -echo X"$ac_dest" | - sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; } - /^X\(\/\/\)[^/].*/{ s//\1/; q; } - /^X\(\/\/\)$/{ s//\1/; q; } - /^X\(\/\).*/{ s//\1/; q; } - s/.*/./; q'` - { if $as_mkdir_p; then - mkdir -p "$ac_dir" - else - as_dir="$ac_dir" - as_dirs= - while test ! -d "$as_dir"; do - as_dirs="$as_dir $as_dirs" - as_dir=`(dirname "$as_dir") 2>/dev/null || -$as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ - X"$as_dir" : 'X\(//\)[^/]' \| \ - X"$as_dir" : 'X\(//\)$' \| \ - X"$as_dir" : 'X\(/\)' \| \ - . : '\(.\)' 2>/dev/null || -echo X"$as_dir" | - sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; } - /^X\(\/\/\)[^/].*/{ s//\1/; q; } - /^X\(\/\/\)$/{ s//\1/; q; } - /^X\(\/\).*/{ s//\1/; q; } - s/.*/./; q'` - done - test ! -n "$as_dirs" || mkdir $as_dirs - fi || { { echo "$as_me:$LINENO: error: cannot create directory \"$ac_dir\"" >&5 -echo "$as_me: error: cannot create directory \"$ac_dir\"" >&2;} - { (exit 1); exit 1; }; }; } - - ac_builddir=. - -if test "$ac_dir" != .; then - ac_dir_suffix=/`echo "$ac_dir" | sed 's,^\.[\\/],,'` - # A "../" for each directory in $ac_dir_suffix. - ac_top_builddir=`echo "$ac_dir_suffix" | sed 's,/[^\\/]*,../,g'` -else - ac_dir_suffix= ac_top_builddir= -fi - -case $srcdir in - .) # No --srcdir option. We are building in place. - ac_srcdir=. - if test -z "$ac_top_builddir"; then - ac_top_srcdir=. - else - ac_top_srcdir=`echo $ac_top_builddir | sed 's,/$,,'` - fi ;; - [\\/]* | ?:[\\/]* ) # Absolute path. - ac_srcdir=$srcdir$ac_dir_suffix; - ac_top_srcdir=$srcdir ;; - *) # Relative path. - ac_srcdir=$ac_top_builddir$srcdir$ac_dir_suffix - ac_top_srcdir=$ac_top_builddir$srcdir ;; -esac +echo "timestamp for $_am_arg" >`$as_dirname -- "$_am_arg" || +$as_expr X"$_am_arg" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$_am_arg" : 'X\(//\)[^/]' \| \ + X"$_am_arg" : 'X\(//\)$' \| \ + X"$_am_arg" : 'X\(/\)' \| . 2>/dev/null || +$as_echo X"$_am_arg" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ + s//\1/ + q + } + /^X\(\/\/\)[^/].*/{ + s//\1/ + q + } + /^X\(\/\/\)$/{ + s//\1/ + q + } + /^X\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q'`/stamp-h$_am_stamp_count + ;; -# Do not use `cd foo && pwd` to compute absolute paths, because -# the directories may not exist. -case `pwd` in -.) ac_abs_builddir="$ac_dir";; -*) - case "$ac_dir" in - .) ac_abs_builddir=`pwd`;; - [\\/]* | ?:[\\/]* ) ac_abs_builddir="$ac_dir";; - *) ac_abs_builddir=`pwd`/"$ac_dir";; - esac;; -esac -case $ac_abs_builddir in -.) ac_abs_top_builddir=${ac_top_builddir}.;; -*) - case ${ac_top_builddir}. in - .) ac_abs_top_builddir=$ac_abs_builddir;; - [\\/]* | ?:[\\/]* ) ac_abs_top_builddir=${ac_top_builddir}.;; - *) ac_abs_top_builddir=$ac_abs_builddir/${ac_top_builddir}.;; - esac;; -esac -case $ac_abs_builddir in -.) ac_abs_srcdir=$ac_srcdir;; -*) - case $ac_srcdir in - .) ac_abs_srcdir=$ac_abs_builddir;; - [\\/]* | ?:[\\/]* ) ac_abs_srcdir=$ac_srcdir;; - *) ac_abs_srcdir=$ac_abs_builddir/$ac_srcdir;; - esac;; -esac -case $ac_abs_builddir in -.) ac_abs_top_srcdir=$ac_top_srcdir;; -*) - case $ac_top_srcdir in - .) ac_abs_top_srcdir=$ac_abs_builddir;; - [\\/]* | ?:[\\/]* ) ac_abs_top_srcdir=$ac_top_srcdir;; - *) ac_abs_top_srcdir=$ac_abs_builddir/$ac_top_srcdir;; - esac;; -esac + :C) { $as_echo "$as_me:${as_lineno-$LINENO}: executing $ac_file commands" >&5 +$as_echo "$as_me: executing $ac_file commands" >&6;} + ;; + esac - { echo "$as_me:$LINENO: executing $ac_dest commands" >&5 -echo "$as_me: executing $ac_dest commands" >&6;} - case $ac_dest in - depfiles ) test x"$AMDEP_TRUE" != x"" || for mf in $CONFIG_FILES; do - # Strip MF so we end up with the name of the file. - mf=`echo "$mf" | sed -e 's/:.*$//'` - # Check whether this is an Automake generated Makefile or not. - # We used to match only the files named `Makefile.in', but - # some people rename them; so instead we look at the file content. - # Grep'ing the first line is not enough: some people post-process - # each Makefile.in and add a new line on top of each file to say so. - # So let's grep whole file. - if grep '^#.*generated by automake' $mf > /dev/null 2>&1; then - dirpart=`(dirname "$mf") 2>/dev/null || + case $ac_file$ac_mode in + "depfiles":C) test x"$AMDEP_TRUE" != x"" || { + # Older Autoconf quotes --file arguments for eval, but not when files + # are listed without --file. Let's play safe and only enable the eval + # if we detect the quoting. + case $CONFIG_FILES in + *\'*) eval set x "$CONFIG_FILES" ;; + *) set x $CONFIG_FILES ;; + esac + shift + for mf + do + # Strip MF so we end up with the name of the file. + mf=`echo "$mf" | sed -e 's/:.*$//'` + # Check whether this is an Automake generated Makefile or not. + # We used to match only the files named 'Makefile.in', but + # some people rename them; so instead we look at the file content. + # Grep'ing the first line is not enough: some people post-process + # each Makefile.in and add a new line on top of each file to say so. + # Grep'ing the whole file is not good either: AIX grep has a line + # limit of 2048, but all sed's we know have understand at least 4000. + if sed -n 's,^#.*generated by automake.*,X,p' "$mf" | grep X >/dev/null 2>&1; then + dirpart=`$as_dirname -- "$mf" || $as_expr X"$mf" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$mf" : 'X\(//\)[^/]' \| \ X"$mf" : 'X\(//\)$' \| \ - X"$mf" : 'X\(/\)' \| \ - . : '\(.\)' 2>/dev/null || -echo X"$mf" | - sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; } - /^X\(\/\/\)[^/].*/{ s//\1/; q; } - /^X\(\/\/\)$/{ s//\1/; q; } - /^X\(\/\).*/{ s//\1/; q; } - s/.*/./; q'` - else - continue - fi - grep '^DEP_FILES *= *[^ #]' < "$mf" > /dev/null || continue - # Extract the definition of DEP_FILES from the Makefile without - # running `make'. - DEPDIR=`sed -n 's/^DEPDIR = //p' < "$mf"` - test -z "$DEPDIR" && continue - # When using ansi2knr, U may be empty or an underscore; expand it - U=`sed -n 's/^U = //p' < "$mf"` - test -d "$dirpart/$DEPDIR" || mkdir "$dirpart/$DEPDIR" - # We invoke sed twice because it is the simplest approach to - # changing $(DEPDIR) to its actual value in the expansion. - for file in `sed -n ' - /^DEP_FILES = .*\\\\$/ { - s/^DEP_FILES = // - :loop - s/\\\\$// - p - n - /\\\\$/ b loop - p - } - /^DEP_FILES = / s/^DEP_FILES = //p' < "$mf" | \ - sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g' -e 's/\$U/'"$U"'/g'`; do - # Make sure the directory exists. - test -f "$dirpart/$file" && continue - fdir=`(dirname "$file") 2>/dev/null || + X"$mf" : 'X\(/\)' \| . 2>/dev/null || +$as_echo X"$mf" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ + s//\1/ + q + } + /^X\(\/\/\)[^/].*/{ + s//\1/ + q + } + /^X\(\/\/\)$/{ + s//\1/ + q + } + /^X\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q'` + else + continue + fi + # Extract the definition of DEPDIR, am__include, and am__quote + # from the Makefile without running 'make'. + DEPDIR=`sed -n 's/^DEPDIR = //p' < "$mf"` + test -z "$DEPDIR" && continue + am__include=`sed -n 's/^am__include = //p' < "$mf"` + test -z "$am__include" && continue + am__quote=`sed -n 's/^am__quote = //p' < "$mf"` + # Find all dependency output files, they are included files with + # $(DEPDIR) in their names. We invoke sed twice because it is the + # simplest approach to changing $(DEPDIR) to its actual value in the + # expansion. + for file in `sed -n " + s/^$am__include $am__quote\(.*(DEPDIR).*\)$am__quote"'$/\1/p' <"$mf" | \ + sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g'`; do + # Make sure the directory exists. + test -f "$dirpart/$file" && continue + fdir=`$as_dirname -- "$file" || $as_expr X"$file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$file" : 'X\(//\)[^/]' \| \ X"$file" : 'X\(//\)$' \| \ - X"$file" : 'X\(/\)' \| \ - . : '\(.\)' 2>/dev/null || -echo X"$file" | - sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; } - /^X\(\/\/\)[^/].*/{ s//\1/; q; } - /^X\(\/\/\)$/{ s//\1/; q; } - /^X\(\/\).*/{ s//\1/; q; } - s/.*/./; q'` - { if $as_mkdir_p; then - mkdir -p $dirpart/$fdir - else - as_dir=$dirpart/$fdir - as_dirs= - while test ! -d "$as_dir"; do - as_dirs="$as_dir $as_dirs" - as_dir=`(dirname "$as_dir") 2>/dev/null || -$as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ - X"$as_dir" : 'X\(//\)[^/]' \| \ - X"$as_dir" : 'X\(//\)$' \| \ - X"$as_dir" : 'X\(/\)' \| \ - . : '\(.\)' 2>/dev/null || -echo X"$as_dir" | - sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; } - /^X\(\/\/\)[^/].*/{ s//\1/; q; } - /^X\(\/\/\)$/{ s//\1/; q; } - /^X\(\/\).*/{ s//\1/; q; } - s/.*/./; q'` + X"$file" : 'X\(/\)' \| . 2>/dev/null || +$as_echo X"$file" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ + s//\1/ + q + } + /^X\(\/\/\)[^/].*/{ + s//\1/ + q + } + /^X\(\/\/\)$/{ + s//\1/ + q + } + /^X\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q'` + as_dir=$dirpart/$fdir; as_fn_mkdir_p + # echo "creating $dirpart/$file" + echo '# dummy' > "$dirpart/$file" done - test ! -n "$as_dirs" || mkdir $as_dirs - fi || { { echo "$as_me:$LINENO: error: cannot create directory $dirpart/$fdir" >&5 -echo "$as_me: error: cannot create directory $dirpart/$fdir" >&2;} - { (exit 1); exit 1; }; }; } - - # echo "creating $dirpart/$file" - echo '# dummy' > "$dirpart/$file" done -done +} ;; + esac -done -_ACEOF +done # for ac_tag -cat >>$CONFIG_STATUS <<\_ACEOF -{ (exit 0); exit 0; } +as_fn_exit 0 _ACEOF -chmod +x $CONFIG_STATUS ac_clean_files=$ac_clean_files_save +test $ac_write_fail = 0 || + as_fn_error $? "write failure creating $CONFIG_STATUS" "$LINENO" 5 + # configure is writing to config.log, and then calls config.status. # config.status does its own redirection, appending to config.log. @@ -5395,23 +5971,27 @@ exec 5>>config.log # Use ||, not &&, to avoid exiting from the if with $? = 1, which # would make configure fail if this is the last instruction. - $ac_cs_success || { (exit 1); exit 1; } + $ac_cs_success || as_fn_exit 1 +fi +if test -n "$ac_unrecognized_opts" && test "$enable_option_checking" != no; then + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: unrecognized options: $ac_unrecognized_opts" >&5 +$as_echo "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2;} fi -echo "$as_me:$LINENO: result: +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: filtergen $VERSION: automatic configuration OK. Type 'make' to compile filtergen. Type 'make install' to install filtergen. " >&5 -echo "${ECHO_T} +$as_echo " filtergen $VERSION: automatic configuration OK. Type 'make' to compile filtergen. Type 'make install' to install filtergen. -" >&6 +" >&6; } fi diff -Nru filtergen-0.12.4/configure.ac filtergen-0.12.7/configure.ac --- filtergen-0.12.4/configure.ac 1970-01-01 00:00:00.000000000 +0000 +++ filtergen-0.12.7/configure.ac 2016-02-13 10:52:59.000000000 +0000 @@ -0,0 +1,129 @@ +AC_PREREQ(2.50) + +AC_INIT(filtergen, 0.12.7, jaq@spacepants.org) + +AC_CONFIG_AUX_DIR(.) +AC_CONFIG_SRCDIR(filtergen.c) +AM_CONFIG_HEADER(config.h) + +AM_INIT_AUTOMAKE([foreign dist-bzip2 parallel-tests color-tests]) + +AM_MAINTAINER_MODE + +AC_SUBST(PROGRAM) +AC_SUBST(VERSION) + +dnl -------------------------- +dnl configuration success flag +dnl -------------------------- + +filtergen_config_ok=yes + +dnl ------------------- +dnl checks for programs +dnl ------------------- + +AC_PROG_CC +AM_PROG_LEX +AC_PROG_YACC + +dnl ------------------- +dnl check for libraries +dnl ------------------- + +AC_CHECK_HEADERS([getopt.h]) + +HAVE_GETOPT=no +AC_CHECK_LIB(getopt, getopt, + HAVE_GETOPT=yes + HAVE_GETOPT=no +) +if test "x$HAVE_GETOPT" = xyes ; then + GETOPT_LIBS="-lgetopt" + AC_SUBST(GETOPT_LIBS) +fi + +dnl ----------------- +dnl set warning level +dnl ----------------- + +if test "x$ac_cv_c_compiler_gnu" = xyes ; then + CFLAGS="$CFLAGS -W -Wall -Werror -Waggregate-return" + CFLAGS="$CFLAGS -Wcast-align -Wcast-qual -Wnested-externs" + CFLAGS="$CFLAGS -Wshadow -Wbad-function-cast -Wwrite-strings" + CFLAGS="$CFLAGS -Winit-self -Wformat=2 -Wuninitialized" + CFLAGS="$CFLAGS -Wpointer-arith" + CFLAGS="$CFLAGS -Wstrict-aliasing -fstrict-aliasing" +fi + +dnl --------------- +dnl set debug level +dnl --------------- + +AC_MSG_CHECKING([whether to enable debugging compiler options]) +AC_ARG_ENABLE(debug, + [ --enable-debug enable debugging compiler options], + AC_MSG_RESULT(yes) + tmp_CFLAGS=`echo $CFLAGS | sed 's/O2/O0/g'` + CFLAGS="$tmp_CFLAGS", + AC_MSG_RESULT(no) +) + +dnl ------------------------------ +dnl fill in path variable expandos +dnl ------------------------------ + +dnl $libdir usually gets set to ${exec_prefix}/lib, +dnl $prefix and $exec_prefix is likely to be "NONE" +dnl Autoconf usually sets pkglibdir correctly in the Makefile, but not in +dnl the configure script :( + +test "$prefix" = "NONE" && prefix=/usr/local +test "$exec_prefix" = "NONE" && exec_prefix=$prefix + +dnl Executable files +eval BINDIR="$bindir" +AC_SUBST(BINDIR) +eval SBINDIR="$sbindir" +AC_SUBST(SBINDIR) + +dnl Configuration files +eval SYSCONFDIR="$sysconfdir" +AC_SUBST(SYSCONFDIR) + +dnl Documentation +eval pkgdocdir="$datadir/doc/$PACKAGE" +AC_SUBST(pkgdocdir) + +dnl Example scripts +eval pkgexdir="$pkgdocdir/examples" +AC_SUBST(pkgexdir) + +dnl ---------------------------------------------------------- +dnl configuration tests complete, provide a summary of results +dnl ---------------------------------------------------------- + +if test "x$filtergen_config_ok" = xno ; then + echo "nothing yet" +else + +dnl Dump it out +AC_CONFIG_FILES([ + Makefile + t/Makefile + filtergen.spec + fgadm + fgadm.conf + rules.filter +]) +AC_OUTPUT + +AC_MSG_RESULT([ +filtergen $VERSION: automatic configuration OK. + +Type 'make' to compile filtergen. + +Type 'make install' to install filtergen. +]) + +fi diff -Nru filtergen-0.12.4/configure.in filtergen-0.12.7/configure.in --- filtergen-0.12.4/configure.in 2016-02-18 07:59:36.000000000 +0000 +++ filtergen-0.12.7/configure.in 1970-01-01 00:00:00.000000000 +0000 @@ -1,125 +0,0 @@ -AC_PREREQ(2.50) - -AC_INIT(filtergen, 0.12.4, jaq@spacepants.org) -AM_INIT_AUTOMAKE([foreign dist-bzip2]) - -AC_CONFIG_AUX_DIR(.) -AC_CONFIG_SRCDIR(filtergen.c) -AM_CONFIG_HEADER(config.h) - -AM_MAINTAINER_MODE - -AC_SUBST(PROGRAM) -AC_SUBST(VERSION) - -dnl -------------------------- -dnl configuration success flag -dnl -------------------------- - -filtergen_config_ok=yes - -dnl ------------------- -dnl checks for programs -dnl ------------------- - -AC_PROG_CC -AC_PROG_LEX -AC_PROG_YACC - -dnl ------------------- -dnl check for libraries -dnl ------------------- - -AC_CHECK_HEADERS([getopt.h]) - -HAVE_GETOPT=no -AC_CHECK_LIB(getopt, getopt, - HAVE_GETOPT=yes - HAVE_GETOPT=no -) -if test "x$HAVE_GETOPT" = xyes ; then - GETOPT_LIBS="-lgetopt" - AC_SUBST(GETOPT_LIBS) -fi - -dnl ----------------- -dnl set warning level -dnl ----------------- - -if test "x$ac_cv_c_compiler_gnu" = xyes ; then - CFLAGS="$CFLAGS -W -Wall -Waggregate-return" - CFLAGS="$CFLAGS -Wcast-align -Wcast-qual -Wnested-externs" - CFLAGS="$CFLAGS -Wshadow -Wbad-function-cast -Wwrite-strings" -fi - -dnl --------------- -dnl set debug level -dnl --------------- - -AC_MSG_CHECKING([whether to enable debugging compiler options]) -AC_ARG_ENABLE(debug, - [ --enable-debug enable debugging compiler options], - AC_MSG_RESULT(yes) - tmp_CFLAGS=`echo $CFLAGS | sed 's/O2/O0/g'` - CFLAGS="$tmp_CFLAGS", - AC_MSG_RESULT(no) -) - -dnl ------------------------------ -dnl fill in path variable expandos -dnl ------------------------------ - -dnl $libdir usually gets set to ${exec_prefix}/lib, -dnl $prefix and $exec_prefix is likely to be "NONE" -dnl Autoconf usually sets pkglibdir correctly in the Makefile, but not in -dnl the configure script :( - -test "$prefix" = "NONE" && prefix=/usr/local -test "$exec_prefix" = "NONE" && exec_prefix=$prefix - -dnl Executable files -eval BINDIR="$bindir" -AC_SUBST(BINDIR) -eval SBINDIR="$sbindir" -AC_SUBST(SBINDIR) - -dnl Configuration files -eval SYSCONFDIR="$sysconfdir" -AC_SUBST(SYSCONFDIR) - -dnl Documentation -eval pkgdocdir="$datadir/doc/$PACKAGE" -AC_SUBST(pkgdocdir) - -dnl Example scripts -eval pkgexdir="$pkgdocdir/examples" -AC_SUBST(pkgexdir) - -dnl ---------------------------------------------------------- -dnl configuration tests complete, provide a summary of results -dnl ---------------------------------------------------------- - -if test "x$filtergen_config_ok" = xno ; then - echo "nothing yet" -else - -dnl Dump it out -AC_CONFIG_FILES([ - Makefile - t/Makefile - filtergen.spec - fgadm - fgadm.conf - rules.filter -]) -AC_OUTPUT - -AC_MSG_RESULT([ -filtergen $VERSION: automatic configuration OK. - -Type 'make' to compile filtergen. - -Type 'make install' to install filtergen. -]) - -fi diff -Nru filtergen-0.12.4/debian/.arch-inventory filtergen-0.12.7/debian/.arch-inventory --- filtergen-0.12.4/debian/.arch-inventory 2016-02-18 07:59:36.000000000 +0000 +++ filtergen-0.12.7/debian/.arch-inventory 1970-01-01 00:00:00.000000000 +0000 @@ -1,3 +0,0 @@ -precious ^files$ -precious ^filtergen$ -precious ^.*\.substvars$ diff -Nru filtergen-0.12.4/debian/changelog filtergen-0.12.7/debian/changelog --- filtergen-0.12.4/debian/changelog 2016-02-18 07:59:36.000000000 +0000 +++ filtergen-0.12.7/debian/changelog 2016-02-13 11:04:47.000000000 +0000 @@ -1,14 +1,58 @@ -filtergen (0.12.4-5.1ubuntu1) quantal; urgency=low +filtergen (0.12.7-1) unstable; urgency=medium - * Merge from Debian testing. Remaining changes: - - configure.in, configure: Disable -Werror to avoid Ubuntu's - warn_unused_result warnings (a number of false positives there). - - t/scan.c: if chdir fails, print an error message and bail out. - (Werror is still enabled for this subdirectory). - - Dropped patches: - + scanner.c: refresh from scanner.l to fix ftbfs. Wasn't needed anymore. + * New upstream release. + - IPv6 support in the rules files, and in output formats. + - ip{,6}tables-restore support. + + -- Jamie Wilkinson Sat, 13 Feb 2016 22:04:47 +1100 + +filtergen (0.12.6-3) unstable; urgency=medium + + * Fix the way the test suite log is printed after test failure. + * Run the tests in parallel so their output is captured. + * Run all tests in verbose (sh -x) mode. + + -- Jamie Wilkinson Sat, 13 Feb 2016 19:05:56 +1100 + +filtergen (0.12.6-2) unstable; urgency=medium + + * Cat the test suite log after running the tests. + + -- Jamie Wilkinson Sat, 13 Feb 2016 10:51:16 +1100 + +filtergen (0.12.6-1) unstable; urgency=medium + + * New upstream release. + - Fixes return type in external declaration of yyrestart (Closes: #749636). + * Use dh-autoreconf to fix up the autotools blah at build time. + + -- Jamie Wilkinson Sat, 13 Feb 2016 04:26:16 +1100 - -- Bilal Akhtar Mon, 06 Aug 2012 17:53:00 -0400 +filtergen (0.12.5-1) unstable; urgency=low + + * New upstream release. + * New Maintainer, per private mail to mpalmer@. + * Updated standards version to 3.8.3. + * Updated to use debhelper 7. + - Specify misc:Depends. + - Update debian/compat. + - Update build dependency. + * Updated watch file for googlecode.com upstream location change. + * Bug fix: "Allow '*' as an interface name", thanks to Matthew + Palmer (Closes: #549891). + * Fix build failues when using clang instead of GCC (Closes: #751443). + * Support globbing in include directives (Closes: #549892). + * Update parser.y use of the parse-param directive to support modern bison. + * Update debhelper and debian/compat. + * Update watch file to new location. + * Add VCS headers to control file. + * Use debian/source options to build from git, add gbp.conf to debian dir. + * Convert debian/rules to dh style. + * Fix compiler warnings as errors to build with modern compiler. + * Update address of FSF. + * Add more example filters to examples. + + -- Jamie Wilkinson Sat, 13 Feb 2016 03:04:52 +1100 filtergen (0.12.4-5.1) unstable; urgency=low @@ -19,18 +63,6 @@ -- gregor herrmann Mon, 12 Dec 2011 17:06:03 +0100 -filtergen (0.12.4-5ubuntu1) natty; urgency=low - - * Merge from debian unstable. Remaining changes: - - configure.in, configure: Disable -Werror to avoid Ubuntu's - warn_unused_result warnings (a number of false positives there). - - scanner.c: refresh from scanner.l (to make a few warn_unused_result - warnings go away). - - t/scan.c: if chdir fails, print an error message and bail out. - (Werror is still enabled for this subdirectory). - - -- Bilal Akhtar Thu, 21 Oct 2010 18:01:15 +0300 - filtergen (0.12.4-5) unstable; urgency=low * New maintainer. Closes: #543434. @@ -39,17 +71,6 @@ -- Matt Palmer Tue, 02 Feb 2010 16:51:39 +1100 -filtergen (0.12.4-4.1ubuntu1) karmic; urgency=low - - * configure.in, configure: Disable -Werror to avoid Ubuntu's - warn_unused_result warnings (a number of false positives there). - * scanner.c: refresh from scanner.l (to make a few warn_unused_result - warnings go away). - * t/scan.c: if chdir fails, print an error message and bail out. - (Werror is still enabled for this subdirectory). - - -- Stefan Potyra Sun, 27 Sep 2009 13:59:03 +0200 - filtergen (0.12.4-4.1) unstable; urgency=medium * Non-maintainer upload. @@ -66,7 +87,7 @@ (Closes: #285935) * Added flex and bison to the build dependencies. * Updated standards version, no other changes required. - + -- Jamie Wilkinson Tue, 23 Aug 2005 14:09:04 +1000 filtergen (0.12.4-3) unstable; urgency=high @@ -164,7 +185,7 @@ -- Jamie Wilkinson Wed, 9 Jun 2004 11:44:48 +1000 filtergen (0.11-4) unstable; urgency=low - + * Added "%option nounput" to the flex scanner to fix a build failure with the new flex, thanks to Bastian Kleineidam. (Closes: #191188) * Bumped standards version to 3.5.9. @@ -195,7 +216,7 @@ - Adds flush option (patch removed). - Fixes compilation on 64 bit archs (patch removed). * Bathed by the lint siblings. - * Bumped standards version to 3.5.7.0. + * Bumped standards version to 3.5.7.0. -- Jamie Wilkinson Wed, 20 Nov 2002 14:12:35 +1100 @@ -252,4 +273,3 @@ filtergen will do to your firewall. -- Jamie Wilkinson Sat, 26 Oct 2002 11:15:16 +1000 - diff -Nru filtergen-0.12.4/debian/changelog.dch filtergen-0.12.7/debian/changelog.dch --- filtergen-0.12.4/debian/changelog.dch 2016-02-18 07:59:36.000000000 +0000 +++ filtergen-0.12.7/debian/changelog.dch 1970-01-01 00:00:00.000000000 +0000 @@ -1,217 +0,0 @@ -filtergen (0.12.4-5) unstable; urgency=low - - * New maintainer. Closes: #543434. - * Bump standards version: - - Added Homepage field. - * Fix up a bunch of lintian warnings: - - Remove now-useless .arch-inventory file - - Add a ${misc:Depends} for debhelper's benefit - - Point to versioned GPL licence file - - Add copyright notices to debian/copyright - - Fix a formatting niggle in the filter_backends manpage - - Bump to dh compat 5 - - -- Matt Palmer Tue, 02 Feb 2010 21:25:57 +1100 - -filtergen (0.12.4-4.1) unstable; urgency=medium - - * Non-maintainer upload. - * scanner.l: Fix buffer overflow with nested include files. - Closes: #324908. - * debian/rules: Make sure clean doesn't accidentally run makefile - (and consequently autoconf). - - -- Matej Vela Wed, 5 Jul 2006 08:40:35 +0200 - -filtergen (0.12.4-4) unstable; urgency=low - - * Apply patch from Andreas Jochens to fix build failure on amd64. - (Closes: #285935) - * Added flex and bison to the build dependencies. - * Updated standards version, no other changes required. - - -- Jamie Wilkinson Tue, 23 Aug 2005 14:09:04 +1000 - -filtergen (0.12.4-3) unstable; urgency=high - - * Call the distclean target instead of clean, in our debian/rules clean - target, so that created files are cleaned up. Yes this is dumb, I - blame autogoats. (Closes: #273371) - - -- Jamie Wilkinson Wed, 13 Oct 2004 14:10:26 +1000 - -filtergen (0.12.4-2) unstable; urgency=low - - * Updated copyright to reflect new upstream location and author. - - -- Jamie Wilkinson Tue, 24 Aug 2004 12:34:16 +1000 - -filtergen (0.12.4-1) unstable; urgency=low - - * New upstream release. - - Fixes behavioural bugs in fgadm script. - - -- Jamie Wilkinson Tue, 24 Aug 2004 11:49:16 +1000 - -filtergen (0.12.3-2) unstable; urgency=low - - * Added watch file. - - -- Jamie Wilkinson Fri, 13 Aug 2004 16:47:45 +1000 - -filtergen (0.12.3-1) unstable; urgency=low - - * New upstream release. - - fixes critical port number resolver bug. - - -- Jamie Wilkinson Thu, 24 Jun 2004 11:35:03 +1000 - -filtergen (0.12.1-6) unstable; urgency=low - - * The Sixth Time Lucky release. - * Re-add netbase to the build dependencies. (Closes: #253631) - - -- Jamie Wilkinson Fri, 11 Jun 2004 10:05:34 +1000 - -filtergen (0.12.1-5) unstable; urgency=low - - * Removed unnecessary build dependency on flex. - * Fix path to filtergen in fgadm script. - * Alter test scripts to print diff output. - - -- Jamie Wilkinson Thu, 10 Jun 2004 20:04:17 +1000 - -filtergen (0.12.1-4) unstable; urgency=low - - * Applied a patch from upstream that fixes the test suite so it's not using - protocols that have more than one name in /etc/protocols. This really fixes - the build daemon errors (fingers crossed) so also remove netbase from the - build dependencies. - - -- Jamie Wilkinson Thu, 10 Jun 2004 18:54:42 +1000 - -filtergen (0.12.1-3) unstable; urgency=low - - * Add netbase to the build dependencies for /etc/protocols and /etc/services. - - -- Jamie Wilkinson Thu, 10 Jun 2004 18:14:38 +1000 - -filtergen (0.12.1-2) unstable; urgency=low - - * Regenerate the makefile so that -Wcast-align is gone. (Closes: #253432) - - -- Jamie Wilkinson Thu, 10 Jun 2004 09:09:56 +1000 - -filtergen (0.12.1-1) unstable; urgency=low - - * New upstream release. - + Fixes compiler errors on 64 bit platforms. - - -- Jamie Wilkinson Wed, 9 Jun 2004 23:52:22 +1000 - -filtergen (0.12-2) unstable; urgency=low - - * Remove an ugly and incorrect cast around gethosybyname and inet_ntoa - to fix builds on 64 bit systems. - * Added make check to the build target of rules. - - -- Jamie Wilkinson Wed, 9 Jun 2004 19:28:30 +1000 - -filtergen (0.12-1) unstable; urgency=low - - * New upstream release. - * Bumped standards version to 3.6.1. - * Moved DH_COMPAT to debian/compat. - * Upstream now uses configure, modified configure target. - - -- Jamie Wilkinson Wed, 9 Jun 2004 11:44:48 +1000 - -filtergen (0.11-4) unstable; urgency=low - - * Added "%option nounput" to the flex scanner to fix a build failure - with the new flex, thanks to Bastian Kleineidam. (Closes: #191188) - * Bumped standards version to 3.5.9. - - -- Jamie Wilkinson Mon, 12 May 2003 20:10:14 +1000 - -filtergen (0.11-3) unstable; urgency=low - - * Removed initscript, README.Debian, postinst, and debconf stuff. - Reverted to just the basic program, not trying to provide a - super-firewall-tool, just a filter generator. (Closes: #171951) - - -- Jamie Wilkinson Wed, 12 Feb 2003 18:38:43 +1100 - -filtergen (0.11-2) unstable; urgency=low - - * Bumped standards version to 3.5.8.0. - * Set DH_COMPAT to 4. - * Set versioned depends on debconf 1.2.9 for dpkg-reconfigure, - making lintian happy. - - -- Jamie Wilkinson Sat, 30 Nov 2002 12:14:22 +1100 - -filtergen (0.11-1) unstable; urgency=low - - * New upstream release. (Closes: #168985) - - Fixes documentation error (patch removed). - - Adds flush option (patch removed). - - Fixes compilation on 64 bit archs (patch removed). - * Bathed by the lint siblings. - * Bumped standards version to 3.5.7.0. - - -- Jamie Wilkinson Wed, 20 Nov 2002 14:12:35 +1100 - -filtergen (0.10-7) unstable; urgency=low - - * Fix builds on alpha and ia64. (Closes: #168352) - - -- Jamie Wilkinson Sat, 9 Nov 2002 10:14:02 +1100 - -filtergen (0.10-6) unstable; urgency=low - - * Mention the lack of a firewall on upgrade from a pre-0.10-5 version. - (Closes: #167561) - * Initscript cosmetic change, hack around stderr from filtergen. - - -- Jamie Wilkinson Sun, 3 Nov 2002 01:14:29 +1100 - -filtergen (0.10-5) unstable; urgency=low - - * Only `stop' the filter if GENERATE is true. (Closes: #167232) - - -- Jamie Wilkinson Sat, 2 Nov 2002 18:18:32 +1100 - -filtergen (0.10-4) unstable; urgency=low - - * Reworded an error message to be nicer. (s/permitted/supported) - * Removed debhelper templates from source. - - -- Jamie Wilkinson Wed, 30 Oct 2002 21:53:07 +1100 - -filtergen (0.10-3) unstable; urgency=low - - * Patched filtergen to add a command to generate flush rules, thus cleaning - the initscript a little. - - -- Jamie Wilkinson Wed, 30 Oct 2002 20:39:37 +1100 - -filtergen (0.10-2) unstable; urgency=low - - * Added a `check' argument to /etc/init.d/filtergen. - * Removed `ipfilter' from the backends that get piped into a shell. - Instead it should get piped into ipfilter somehow. I will worry about - that when ipfilter gets packaged. - - -- Jamie Wilkinson Wed, 30 Oct 2002 00:39:17 +1100 - -filtergen (0.10-1) unstable; urgency=low - - * Initial Release. (Closes: #166170) - * Applied patch from upstream fixing documentation error. - * Added NAME section to filter_backends.7, lintian clean. - * Depends on iptables or ipchains. - * Created initsctipt and filtergen.conf config file to control what - filtergen will do to your firewall. - - -- Jamie Wilkinson Sat, 26 Oct 2002 11:15:16 +1000 diff -Nru filtergen-0.12.4/debian/compat filtergen-0.12.7/debian/compat --- filtergen-0.12.4/debian/compat 2016-02-18 07:59:36.000000000 +0000 +++ filtergen-0.12.7/debian/compat 2016-02-13 09:44:55.000000000 +0000 @@ -1 +1 @@ -5 +9 diff -Nru filtergen-0.12.4/debian/control filtergen-0.12.7/debian/control --- filtergen-0.12.4/debian/control 2016-02-18 07:59:36.000000000 +0000 +++ filtergen-0.12.7/debian/control 2016-02-13 09:44:55.000000000 +0000 @@ -1,11 +1,12 @@ Source: filtergen Section: net Priority: optional -Maintainer: Ubuntu Developers -XSBC-Original-Maintainer: Matt Palmer -Build-Depends: debhelper (>= 5), netbase, flex, bison -Standards-Version: 3.8.3 +Maintainer: Jamie Wilkinson +Build-Depends: debhelper (>= 9), netbase, flex, bison, dh-autoreconf +Standards-Version: 3.9.6 Homepage: http://spacepants.org/src/filtergen/ +VCS-Browser: https://github.com/jaqx0r/filtergen/tree/debian +VCS-Git: https://github.com/jaqx0r/filtergen.git -b debian Package: filtergen Architecture: any diff -Nru filtergen-0.12.4/debian/copyright filtergen-0.12.7/debian/copyright --- filtergen-0.12.4/debian/copyright 2016-02-18 07:59:36.000000000 +0000 +++ filtergen-0.12.7/debian/copyright 2016-02-13 09:44:55.000000000 +0000 @@ -8,7 +8,9 @@ Copyright: Copyright (c) 2001,2002,2003 Matthew Kirkwood -Copyright (c) 2003,2004 Jamie Wilkinson +Copyright (c) 2003-2016 Jamie Wilkinson + +License: This package is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -21,8 +23,9 @@ You should have received a copy of the GNU General Public License along with this package; if not, write to the Free Software - Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA - 02111-1307, USA. + Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, + MA 02110-1301, USA. + On Debian GNU/Linux systems, the complete text of the GNU General Public License can be found in `/usr/share/common-licenses/GPL-2'. diff -Nru filtergen-0.12.4/debian/examples filtergen-0.12.7/debian/examples --- filtergen-0.12.4/debian/examples 2016-02-18 07:59:36.000000000 +0000 +++ filtergen-0.12.7/debian/examples 2016-02-13 09:44:55.000000000 +0000 @@ -1 +1,2 @@ -tests/* +t/*.filter +examples/* diff -Nru filtergen-0.12.4/debian/gbp.conf filtergen-0.12.7/debian/gbp.conf --- filtergen-0.12.4/debian/gbp.conf 1970-01-01 00:00:00.000000000 +0000 +++ filtergen-0.12.7/debian/gbp.conf 2016-02-13 09:44:55.000000000 +0000 @@ -0,0 +1,4 @@ +[DEFAULT] +debian-branch = debian +upstream-tag = version/%(version)s +upstream-branch = 0.12 diff -Nru filtergen-0.12.4/debian/patches/debian-changes filtergen-0.12.7/debian/patches/debian-changes --- filtergen-0.12.4/debian/patches/debian-changes 1970-01-01 00:00:00.000000000 +0000 +++ filtergen-0.12.7/debian/patches/debian-changes 2016-02-13 11:05:09.000000000 +0000 @@ -0,0 +1,4226 @@ +Description: + TODO: Put a short summary on the line above and replace this paragraph + with a longer explanation of this change. Complete the meta-information + with other relevant fields (see below for details). To make it easier, the + information below has been extracted from the changelog. Adjust it or drop + it. + . + filtergen (0.12.5-1) unstable; urgency=low + . + * New Maintainer, per private mail to mpalmer@. + * Updated standards version to 3.8.3. + * Updated to use debhelper 7. + - Specify misc:Depends. + - Update debian/compat. + - Update build dependency. + * Updated watch file for googlecode.com upstream location change. + * Bug fix: "Allow '*' as an interface name", thanks to Matthew + Palmer (Closes: #549891). + * Fix build failues when using clang instead of GCC (Closes: #751443). + * Support globbing in include directives (Closes: #549892). + * Update parser.y use of the parse-param directive to support modern bison. + * Update debhelper and debian/compat. + * Update watch file to new location. + * Add VCS headers to control file. + * Use debian/source options to build from git, add gbp.conf to debian dir. +Author: Jamie Wilkinson +Bug-Debian: https://bugs.debian.org/549891 +Bug-Debian: https://bugs.debian.org/549892 +Bug-Debian: https://bugs.debian.org/751443 + +--- +The information above should follow the Patch Tagging Guidelines, please +checkout http://dep.debian.net/deps/dep3/ to learn about the format. Here +are templates for supplementary fields that you might want to add: + +Origin: , +Bug: +Bug-Debian: https://bugs.debian.org/ +Bug-Ubuntu: https://launchpad.net/bugs/ +Forwarded: +Reviewed-By: +Last-Update: + +--- /dev/null ++++ filtergen-0.12.7/expr.h +@@ -0,0 +1,28 @@ ++#ifndef __EXPR_H__ ++#define __EXPR_H__ ++ ++enum expression = { ++ EXP_AND, EXP_OR, EXP_NOT, EXP_PRED, ++}; ++ ++struct expr_s * { ++ enum expression type; ++}; ++ ++enum action = { ++ ACT_NONE, ACT_ACCEPT, ACT_REJECT, ACT_DROP, ++}; ++ ++/* rule is a boolean expression of filtering predicates -> action */ ++struct rule_s { ++ struct expr_s *expr; ++ enum action act; ++ struct rule_s *next; ++}; ++ ++struct group_s { ++ char *name; ++ struct rule_s *rule_list; ++}; ++ ++#endif /* __EXPR_H__ */ +--- /dev/null ++++ filtergen-0.12.7/input/iptables/Makefile.am +@@ -0,0 +1,11 @@ ++bin_PROGRAMS = scan parse emit ++ ++scan_SOURCES = parser.y scanner.l scan.c ++ ++parse_SOURCES = parser.y scanner.l parse.c ++ ++emit_SOURCES = parser.y scanner.l emit.c ++ ++AM_CFLAGS = -D_GNU_SOURCE ++AM_LDFLAGS = -g ++AM_YFLAGS = -d +--- /dev/null ++++ filtergen-0.12.7/input/iptables/ast.h +@@ -0,0 +1,69 @@ ++/* iptables-save syntax tree data structure definitions ++ * ++ * Copyright (c) 2003,2004 Jamie Wilkinson ++ * ++ * 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 of the License, 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA ++ */ ++ ++#ifndef __IPTABLES_AST_H__ ++#define __IPTABLES_AST_H__ ++ ++struct pkt_count_s { ++ char *in; ++ char *out; ++}; ++ ++struct identifier_s { ++ char *id; ++}; ++ ++struct not_identifier_s { ++ int neg; ++ struct identifier_s *identifier; ++}; ++ ++struct option_s { ++ char *option; ++ struct not_identifier_s *not_identifier; ++}; ++ ++struct not_option_s { ++ int neg; ++ struct option_s *option; ++}; ++ ++struct option_list_s { ++ struct option_list_s *option_list; ++ struct not_option_s *not_option; ++}; ++ ++struct rule_s { ++ char *table; ++ char *chain; ++ char *policy; ++ struct pkt_count_s *pkt_count; ++ struct option_list_s *option_list; ++}; ++ ++struct rule_list_s { ++ struct rule_list_s *list; ++ struct rule_s *rule; ++}; ++ ++struct ast_s { ++ struct rule_list_s *list; ++}; ++ ++#endif /* __IPTABLES_AST_H__ */ +--- /dev/null ++++ filtergen-0.12.7/input/iptables/emit.c +@@ -0,0 +1,149 @@ ++/* ast emitter ++ * output should be identical (syntactically) to the input ++ */ ++ ++#include ++#include ++#include ++#include "ast.h" ++#include "parser.h" ++ ++int yyparse(void *); ++int emittrace = 0; ++ ++#define EMIT(x) void emit_##x(struct x##_s *n) ++ ++#define eprint(x) \ ++ if (emittrace) \ ++ fprintf(stderr, x) ++ ++EMIT(pkt_count) { ++ printf("["); ++ if (n->in) { ++ printf("%s", n->in); ++ } ++ printf(":"); ++ if (n->out) { ++ printf("%s", n->out); ++ } ++ printf("]"); ++} ++ ++EMIT(identifier) { ++ if (n->id) { ++ char *spaces = strstr(n->id, " "); ++ if (spaces) ++ printf("\""); ++ printf("%s", n->id); ++ if (spaces) ++ printf("\""); ++ } ++} ++ ++EMIT(not_identifier) { ++ if (n->neg) { ++ printf("! "); ++ } ++ if (n->identifier) { ++ eprint("emitting identifier\n"); ++ emit_identifier(n->identifier); ++ } ++} ++ ++EMIT(option) { ++ if (n->option) { ++ printf(" -%s ", n->option); ++ } ++ if (n->not_identifier) { ++ emit_not_identifier(n->not_identifier); ++ } ++} ++ ++EMIT(not_option) { ++ if (n->neg) { ++ printf("!"); ++ } ++ if (n->option) { ++ eprint("emitting option\n"); ++ emit_option(n->option); ++ } ++} ++ ++EMIT(option_list) { ++ if (n->option_list) { ++ eprint("emitting option_list\n"); ++ emit_option_list(n->option_list); ++ } ++ if (n->not_option) { ++ eprint("emitting not_option\n"); ++ emit_not_option(n->not_option); ++ } ++} ++ ++EMIT(rule) { ++ if (n->table) { ++ printf("*%s", n->table); ++ } else if (n->chain) { ++ printf(":%s", n->chain); ++ if (n->policy) { ++ printf(" %s", n->policy); ++ } ++ if (n->pkt_count) { ++ printf(" "); ++ eprint("emitting pkt_count\n"); ++ emit_pkt_count(n->pkt_count); ++ } ++ } else if (n->option_list) { ++ if (n->pkt_count) { ++ eprint("emitting pkt_count\n"); ++ emit_pkt_count(n->pkt_count); ++ } ++ eprint("emitting option_list\n"); ++ emit_option_list(n->option_list); ++ } ++ /* rules end in a newline */ ++ printf("\n"); ++} ++ ++EMIT(rule_list) { ++ if (n->list) { ++ eprint("emitting rule_list\n"); ++ emit_rule_list(n->list); ++ } ++ if (n->rule) { ++ eprint("emitting rule\n"); ++ emit_rule(n->rule); ++ } else { ++ /* NULL rules only for COMMIT */ ++ printf("COMMIT\n"); ++ } ++} ++ ++EMIT(ast) { ++ if (n->list) { ++ eprint("emitting rule_list\n"); ++ emit_rule_list(n->list); ++ } ++} ++ ++int main(int argc __attribute__((unused)), ++ char **argv __attribute__((unused))) { ++ char *EMITTRACE; ++ struct ast_s ast; ++ int res; ++ ++ EMITTRACE = getenv("EMITTRACE"); ++ emittrace = EMITTRACE ? atoi(EMITTRACE) : 0; ++ ++ res = yyparse((void *)&ast); ++ ++ if (res != 0) { ++ printf("yyparse returned %d\n", res); ++ return 1; ++ } ++ ++ eprint("emitting ast\n"); ++ emit_ast(&ast); ++ ++ return 0; ++} +--- /dev/null ++++ filtergen-0.12.7/input/iptables/parse.c +@@ -0,0 +1,19 @@ ++#include ++#include "ast.h" ++ ++extern char *yytext; ++int yyparse(void *); ++extern int yydebug; ++ ++int main(int argc __attribute__((unused)), ++ char **argv __attribute__((unused))) { ++ char *YYDEBUGTRACE; ++ struct ast_s ast; ++ ++ YYDEBUGTRACE = getenv("YYDEBUGTRACE"); ++ yydebug = YYDEBUGTRACE ? atoi(YYDEBUGTRACE) : 0; ++ ++ yyparse(&ast); ++ ++ return 0; ++} +--- /dev/null ++++ filtergen-0.12.7/input/iptables/parser.y +@@ -0,0 +1,217 @@ ++/* parser for iptables-save format ++ * ++ * Copyright (c) 2003 Jamie Wilkinson ++ * ++ * 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 of the License, 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA ++ */ ++ ++%{ ++#include ++#include ++#include "ast.h" ++ ++#define YYPARSE_PARAM parm ++ ++void yyerror(const char *); ++extern int yylex(void); ++ ++#define YYPRINT(f, t, v) yyprint(f, t, v) ++%} ++%debug ++ ++%union { ++ struct rule_list_s * u_rule_list; ++ struct rule_s * u_rule; ++ struct option_list_s * u_option_list; ++ struct not_option_s * u_not_option; ++ struct option_s * u_option; ++ struct not_identifier_s * u_not_identifier; ++ struct identifier_s * u_identifier; ++ struct pkt_count_s * u_pkt_count; ++ char * u_str; ++} ++%type rule_list ++%type rule ++%type option_list ++%type not_option ++%type option ++%type not_identifier ++%type identifier ++%type pkt_count ++ ++%defines ++%token TOK_TABLE ++%token TOK_CHAIN ++%token TOK_OPTION ++%token TOK_IDENTIFIER ++%token TOK_LSQUARE ++%token TOK_RSQUARE ++%token TOK_COLON ++%token TOK_BANG ++%token TOK_QUOTE ++%token TOK_COMMIT ++%token TOK_NEWLINE ++ ++%{ ++int yyprint(FILE * f, int t, YYSTYPE v); ++%} ++ ++%start ast ++ ++%% ++ast: rule_list ++{ ++ /* we expect parm to be already allocated, and that ++ * it is of type (struct ast_s *) */ ++ ((struct ast_s *) parm)->list = $1; ++} ++ ++rule_list: /* empty */ ++{ ++ $$ = NULL; ++} ++| rule_list rule TOK_NEWLINE ++{ ++ $$ = malloc(sizeof(struct rule_list_s)); ++ $$->list = $1; ++ $$->rule = $2; ++} ++ ++rule: TOK_TABLE TOK_IDENTIFIER ++{ ++ $$ = malloc(sizeof(struct rule_s)); ++ $$->table = $2; ++ $$->chain = NULL; ++ $$->policy = NULL; ++ $$->pkt_count = NULL; ++ $$->option_list = NULL; ++} ++| TOK_CHAIN TOK_IDENTIFIER TOK_IDENTIFIER pkt_count ++{ ++ $$ = malloc(sizeof(struct rule_s)); ++ $$->table = NULL; ++ $$->chain = $2; ++ $$->policy = $3; ++ $$->pkt_count = $4; ++ $$->option_list = NULL; ++} ++| TOK_COMMIT ++{ ++ $$ = NULL; ++} ++| pkt_count option_list ++{ ++ $$ = malloc(sizeof(struct rule_s)); ++ $$->table = NULL; ++ $$->chain = NULL; ++ $$->policy = NULL; ++ $$->pkt_count = $1; ++ $$->option_list = $2; ++} ++| option_list ++{ ++ $$ = malloc(sizeof(struct rule_s)); ++ $$->table = NULL; ++ $$->chain = NULL; ++ $$->policy = NULL; ++ $$->pkt_count = NULL; ++ $$->option_list = $1; ++} ++ ++option_list: /* empty */ ++{ ++ $$ = NULL; ++} ++| option_list not_option ++{ ++ $$ = malloc(sizeof(struct option_list_s)); ++ $$->option_list = $1; ++ $$->not_option = $2; ++} ++ ++not_option: TOK_BANG option ++{ ++ $$ = malloc(sizeof(struct not_option_s)); ++ $$->neg = 1; ++ $$->option = $2; ++} ++| option ++{ ++ $$ = malloc(sizeof(struct not_option_s)); ++ $$->neg = 0; ++ $$->option = $1; ++} ++ ++option: TOK_OPTION not_identifier ++{ ++ $$ = malloc(sizeof(struct option_s)); ++ $$->option = $1; ++ $$->not_identifier = $2; ++} ++ ++not_identifier: TOK_BANG identifier ++{ ++ $$ = malloc(sizeof(struct not_identifier_s)); ++ $$->neg = 1; ++ $$->identifier = $2; ++} ++| identifier ++{ ++ $$ = malloc(sizeof(struct not_identifier_s)); ++ $$->neg = 0; ++ $$->identifier = $1; ++} ++ ++identifier: TOK_IDENTIFIER TOK_IDENTIFIER ++{ ++ $$ = malloc(sizeof(struct identifier_s)); ++ $$->id = $1; ++} ++| TOK_IDENTIFIER TOK_COLON TOK_IDENTIFIER ++{ ++ $$ = malloc(sizeof(struct identifier_s)); ++ asprintf(&($$->id), "%s:%s", $1, $3); ++} ++| TOK_QUOTE TOK_IDENTIFIER TOK_QUOTE ++{ ++ $$ = malloc(sizeof(struct identifier_s)); ++ $$->id = $2; ++} ++| TOK_IDENTIFIER ++{ ++ $$ = malloc(sizeof(struct identifier_s)); ++ $$->id = $1; ++} ++ ++pkt_count: TOK_LSQUARE TOK_IDENTIFIER TOK_COLON TOK_IDENTIFIER TOK_RSQUARE ++{ ++ $$ = malloc(sizeof(struct pkt_count_s)); ++ $$->in = $2; ++ $$->out = $4; ++} ++ ++%% ++char * filename(); ++long int lineno(); ++extern char * yytext; ++ ++void yyerror(const char * s) { ++ fprintf(stderr, "%s:%ld: %s\n", filename(), lineno(), s); ++} ++ ++int yyprint(FILE * f, int type, YYSTYPE v) { ++ fprintf(f, "type=%d,spelling=\"%s\",loc=%p", type, yytext, &v); ++ return 0; ++} +--- /dev/null ++++ filtergen-0.12.7/input/iptables/scan.c +@@ -0,0 +1,70 @@ ++#include ++#include ++#include ++#include ++ ++#include "parser.h" ++ ++extern char *yytext; ++int yylex(); ++long int lineno(); ++char *filename(); ++ ++char *tok_map(int c) { ++ char *r; ++ switch (c) { ++ case TOK_TABLE: ++ r = strdup("table"); ++ break; ++ case TOK_CHAIN: ++ r = strdup("chain"); ++ break; ++ case TOK_OPTION: ++ r = strdup("option"); ++ break; ++ case TOK_IDENTIFIER: ++ r = strdup("identifier"); ++ break; ++ case TOK_LSQUARE: ++ r = strdup("lsquare"); ++ break; ++ case TOK_RSQUARE: ++ r = strdup("rsquare"); ++ break; ++ case TOK_COLON: ++ r = strdup("colon"); ++ break; ++ case TOK_BANG: ++ r = strdup("bang"); ++ break; ++ case TOK_QUOTE: ++ r = strdup("quote"); ++ break; ++ case TOK_COMMIT: ++ r = strdup("commit"); ++ break; ++ case TOK_NEWLINE: ++ r = strdup("newline"); ++ break; ++ default: ++ r = strdup("UNRECOGNISED"); ++ break; ++ } ++ return r; ++} ++ ++int main(int argc __attribute__((unused)), ++ char **argv __attribute__((unused))) { ++ int c; ++ ++ /* if running in make distcheck the cwd isn't the same as the srcdir */ ++ if (getenv("srcdir")) { ++ chdir(getenv("srcdir")); ++ } ++ ++ while ((c = yylex())) { ++ printf("kind = %s, spelling = \"%s\", file = \"%s\", line = %ld\n", ++ tok_map(c), yytext, filename(), lineno()); ++ } ++ return 0; ++} +--- /dev/null ++++ filtergen-0.12.7/input/iptables/scanner.l +@@ -0,0 +1,90 @@ ++%option noyywrap ++%option nounput ++ ++%{ ++/* input scanner for iptables-save format ++ * ++ * Copyright (c) 2004 Jamie Wilkinson ++ * ++ * 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 of the License, 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA ++ */ ++ ++#include ++#include "parser.h" ++ ++long int ln = 1; ++ ++long int lineno(void); ++char * filename(void); ++%} ++ ++string \"[^\n]+\" ++space [ \t]+ ++id [[:alnum:]_+-\.\/]+ ++ ++%% ++ ++#[^\n]* /* strip shell-style comments */ ++ ++^[*] return TOK_TABLE; ++ ++^: return TOK_CHAIN; ++ ++{space} /* ignore */ ++ ++\n { ++ ln++; ++ return TOK_NEWLINE; ++ } ++ ++^COMMIT return TOK_COMMIT; ++ ++{string} { ++ /* we do not store the " characters in the string, so lop ++ * them off. We can "safely" assume that the first and last ++ * characters in this regex are ", otherwise there's a bug ++ * in flex... The result is somethign that is syntactically ++ * identical to an identifier for our purposes. */ ++ yylval.u_str = strndup(yytext + 1, yyleng - 2); ++ return TOK_IDENTIFIER; ++ } ++ ++-{id} { ++ /* ignore the first character */ ++ yylval.u_str = strndup(yytext + 1, yyleng - 1); ++ return TOK_OPTION; ++ } ++ ++{id} { ++ yylval.u_str = strndup(yytext, yyleng); ++ return TOK_IDENTIFIER; ++ } ++ ++"[" return TOK_LSQUARE; ++"]" return TOK_RSQUARE; ++":" return TOK_COLON; ++"!" return TOK_BANG; ++ ++\" return TOK_QUOTE; ++ ++%% ++ ++long int lineno(void) { ++ return ln; ++} ++ ++char * filename(void) { ++ return NULL; ++} +--- /dev/null ++++ filtergen-0.12.7/makefile +@@ -0,0 +1,25 @@ ++include Makefile ++ ++ifeq ($(ACLOCAL),) ++ ++all: Makefile ++ $(MAKE) -f Makefile $(MAKECMDGOALS) ++ ++.FORCED: all ++ ++Makefile: configure ++ ./configure --enable-maintainer-mode ++ ++configure: Makefile.in configure.ac config.h.in ++ autoconf ++ ++Makefile.in: configure.ac Makefile.am config.h.in ++ automake --foreign --add-missing --copy ++ ++config.h.in: configure.ac aclocal.m4 ++ autoheader ++ ++aclocal.m4: configure.ac ++ aclocal ++ ++endif +--- /dev/null ++++ filtergen-0.12.7/t/mask.filter +@@ -0,0 +1,8 @@ ++input eth0 { ++ source foo accept; ++ source bar/24 accept; ++ source baz/255.255.255.248 accept; ++ dest quux/0 accept; ++ dest flirble/32 accept; ++ source meep/255.0 drop; ++}; +--- /dev/null ++++ filtergen-0.12.7/t/name.filter +@@ -0,0 +1,4 @@ ++input eth0 local { ++ dest localhost/8 accept; ++ dest tim/255.0.255.0 drop; ++}; +--- /dev/null ++++ filtergen-0.12.7/t/oneway.filter +@@ -0,0 +1,5 @@ ++# test "oneway" option ++# $Id: oneway.filter,v 1.1 2003/04/02 11:07:35 matthew Exp $ ++ ++input eth0 proto tcp accept; ++input eth0 proto tcp oneway accept; +--- /dev/null ++++ filtergen-0.12.7/t/regress0.filter +@@ -0,0 +1,13 @@ ++# ++# this used to break filter_unroll by making loops ++# in the tree ++# ++# $Id: regress0.filter,v 1.1 2002/09/02 11:10:42 matthew Exp $ ++ ++output eth0 { ++ { proto tcp; proto udp } dport domain; ++} accept; ++ ++output eth0 { ++ { proto tcp; proto udp } dport domain; ++} accept source bar; +--- /dev/null ++++ filtergen-0.12.7/t/tfail.filter +@@ -0,0 +1,11 @@ ++# test negations of conjunctions -- some must fail ++# $Id: tfail.filter,v 1.1 2002/01/25 17:04:55 matthew Exp $ ++ ++# this is fine ++input eth0 source { a b } drop; ++ ++## this fails ++#input eth0 ! source { a b } drop; ++ ++# this is the same as the first one ++input eth0 ! { ! source { a b } } drop; +--- /dev/null ++++ filtergen-0.12.7/t/tgroup.filter +@@ -0,0 +1,5 @@ ++input eth0 source wwwserv dest dbserv ++[ "web_to_dbserv" ++ proto tcp sport 137:139 reject; ++ accept; ++]; +--- /dev/null ++++ filtergen-0.12.7/t/tgroup2.filter +@@ -0,0 +1,8 @@ ++input eth0 source wwwserv dest dbserv ++[ "web_to_dbserv" ++ proto tcp dport 1521 accept; ++ proto tcp dport appserv1 accept; ++ proto tcp dport appserv2 accept; ++ proto tcp dport appserv3 accept; ++ drop; ++]; +--- /dev/null ++++ filtergen-0.12.7/t/tgroup3.filter +@@ -0,0 +1,5 @@ ++input eth0 source wwwserv dest dbserv ++[ "web_to_dbserv" ++ proto tcp dport { 1521 appserv1 appserv2 appserv3 } accept; ++ drop; ++]; +--- /dev/null ++++ filtergen-0.12.7/t/ticmp.filter +@@ -0,0 +1,2 @@ ++output eth0 proto icmp icmptype ping accept; ++input eth0 proto icmp icmptype pong accept; +--- /dev/null ++++ filtergen-0.12.7/t/tlog.filter +@@ -0,0 +1,7 @@ ++# test logging ++# $Id: tlog.filter,v 1.2 2002/08/26 22:10:38 matthew Exp $ ++ ++input eth0 log drop; ++output eth1 proto tcp log accept; ++input ppp2 proto tcp log text foo reject; ++output ppp4 proto tcp log text "foo bar baz" drop; +--- /dev/null ++++ filtergen-0.12.7/t/tnat.filter +@@ -0,0 +1,10 @@ ++# test port ranges ++# $Id: tnat.filter,v 1.1 2001/10/06 17:44:04 matthew Exp $ ++ ++input eth0 { ++ proto tcp { ++ dport 80 redirect; ++ dport 22 masq; ++ }; ++ reject; ++}; +--- /dev/null ++++ filtergen-0.12.7/t/tneg.filter +@@ -0,0 +1,18 @@ ++# test negations ++# $Id: tneg.filter,v 1.2 2001/10/03 19:01:54 matthew Exp $ ++ ++#input eth0 source foo dest bar reject; ++#input eth0 { source foo dest bar } reject; ++#input eth0 ! source foo dest bar reject; ++#input eth0 ! source foo ! dest bar reject; ++#input eth0 source foo ! dest bar reject; ++#input eth0 ! { source foo dest bar } reject; ++#input eth0 ! { source foo ! dest bar } reject; ++ ++input eth0 source foo dest bar drop; ++input eth0 { source foo dest bar } drop; ++input eth0 ! source foo dest bar drop; ++input eth0 ! source foo ! dest bar drop; ++input eth0 source foo ! dest bar drop; ++input eth0 ! { source foo dest bar } drop; ++input eth0 ! { source foo ! dest bar } drop; +--- /dev/null ++++ filtergen-0.12.7/t/tport.filter +@@ -0,0 +1,11 @@ ++# test port ranges ++# $Id: tport.filter,v 1.2 2002/08/20 22:54:38 matthew Exp $ ++ ++input eth0 { ++ proto tcp dport www accept; ++ proto udp dport bootps reject; ++ proto tcp dport 57 drop; ++ proto tcp sport http:https accept; ++ proto tcp source foo dest bar dport 40000:40050 accept; ++ reject; ++}; +--- /dev/null ++++ filtergen-0.12.7/factoriser.c +@@ -0,0 +1,24 @@ ++/* factorise the syntax tree for optimisation ++ * ++ * Copyright (c) 2004 Jamie Wilkinson ++ * ++ * 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 of the License, 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA ++ */ ++ ++#ifdef HAVE_CONFIG_H ++#include "config.h" ++#endif ++ ++#include "factoriser.h" +--- /dev/null ++++ filtergen-0.12.7/factoriser.h +@@ -0,0 +1,23 @@ ++/* factorise the ast for optimisation ++ * ++ * Copyright (c) 2004 Jamie Wilkinson . ++# ++# As a special exception to the GNU General Public License, if you ++# distribute this file as part of a program that contains a ++# configuration script generated by Autoconf, you may include it under ++# the same distribution terms that you use for the rest of that ++# program. This Exception is an additional permission under section 7 ++# of the GNU General Public License, version 3 ("GPLv3"). ++# ++# Originally written by Per Bothner; maintained since 2000 by Ben Elliston. ++# ++# You can get the latest version of this script from: ++# http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.guess;hb=HEAD ++# ++# Please send patches to . ++ ++ ++me=`echo "$0" | sed -e 's,.*/,,'` ++ ++usage="\ ++Usage: $0 [OPTION] ++ ++Output the configuration name of the system \`$me' is run on. ++ ++Operation modes: ++ -h, --help print this help, then exit ++ -t, --time-stamp print date of last modification, then exit ++ -v, --version print version number, then exit ++ ++Report bugs and patches to ." ++ ++version="\ ++GNU config.guess ($timestamp) ++ ++Originally written by Per Bothner. ++Copyright 1992-2015 Free Software Foundation, Inc. ++ ++This is free software; see the source for copying conditions. There is NO ++warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE." ++ ++help=" ++Try \`$me --help' for more information." ++ ++# Parse command line ++while test $# -gt 0 ; do ++ case $1 in ++ --time-stamp | --time* | -t ) ++ echo "$timestamp" ; exit ;; ++ --version | -v ) ++ echo "$version" ; exit ;; ++ --help | --h* | -h ) ++ echo "$usage"; exit ;; ++ -- ) # Stop option processing ++ shift; break ;; ++ - ) # Use stdin as input. ++ break ;; ++ -* ) ++ echo "$me: invalid option $1$help" >&2 ++ exit 1 ;; ++ * ) ++ break ;; ++ esac ++done ++ ++if test $# != 0; then ++ echo "$me: too many arguments$help" >&2 ++ exit 1 ++fi ++ ++trap 'exit 1' 1 2 15 ++ ++# CC_FOR_BUILD -- compiler used by this script. Note that the use of a ++# compiler to aid in system detection is discouraged as it requires ++# temporary files to be created and, as you can see below, it is a ++# headache to deal with in a portable fashion. ++ ++# Historically, `CC_FOR_BUILD' used to be named `HOST_CC'. We still ++# use `HOST_CC' if defined, but it is deprecated. ++ ++# Portable tmp directory creation inspired by the Autoconf team. ++ ++set_cc_for_build=' ++trap "exitcode=\$?; (rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null) && exit \$exitcode" 0 ; ++trap "rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null; exit 1" 1 2 13 15 ; ++: ${TMPDIR=/tmp} ; ++ { tmp=`(umask 077 && mktemp -d "$TMPDIR/cgXXXXXX") 2>/dev/null` && test -n "$tmp" && test -d "$tmp" ; } || ++ { test -n "$RANDOM" && tmp=$TMPDIR/cg$$-$RANDOM && (umask 077 && mkdir $tmp) ; } || ++ { tmp=$TMPDIR/cg-$$ && (umask 077 && mkdir $tmp) && echo "Warning: creating insecure temp directory" >&2 ; } || ++ { echo "$me: cannot create a temporary directory in $TMPDIR" >&2 ; exit 1 ; } ; ++dummy=$tmp/dummy ; ++tmpfiles="$dummy.c $dummy.o $dummy.rel $dummy" ; ++case $CC_FOR_BUILD,$HOST_CC,$CC in ++ ,,) echo "int x;" > $dummy.c ; ++ for c in cc gcc c89 c99 ; do ++ if ($c -c -o $dummy.o $dummy.c) >/dev/null 2>&1 ; then ++ CC_FOR_BUILD="$c"; break ; ++ fi ; ++ done ; ++ if test x"$CC_FOR_BUILD" = x ; then ++ CC_FOR_BUILD=no_compiler_found ; ++ fi ++ ;; ++ ,,*) CC_FOR_BUILD=$CC ;; ++ ,*,*) CC_FOR_BUILD=$HOST_CC ;; ++esac ; set_cc_for_build= ;' ++ ++# This is needed to find uname on a Pyramid OSx when run in the BSD universe. ++# (ghazi@noc.rutgers.edu 1994-08-24) ++if (test -f /.attbin/uname) >/dev/null 2>&1 ; then ++ PATH=$PATH:/.attbin ; export PATH ++fi ++ ++UNAME_MACHINE=`(uname -m) 2>/dev/null` || UNAME_MACHINE=unknown ++UNAME_RELEASE=`(uname -r) 2>/dev/null` || UNAME_RELEASE=unknown ++UNAME_SYSTEM=`(uname -s) 2>/dev/null` || UNAME_SYSTEM=unknown ++UNAME_VERSION=`(uname -v) 2>/dev/null` || UNAME_VERSION=unknown ++ ++case "${UNAME_SYSTEM}" in ++Linux|GNU|GNU/*) ++ # If the system lacks a compiler, then just pick glibc. ++ # We could probably try harder. ++ LIBC=gnu ++ ++ eval $set_cc_for_build ++ cat <<-EOF > $dummy.c ++ #include ++ #if defined(__UCLIBC__) ++ LIBC=uclibc ++ #elif defined(__dietlibc__) ++ LIBC=dietlibc ++ #else ++ LIBC=gnu ++ #endif ++ EOF ++ eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep '^LIBC' | sed 's, ,,g'` ++ ;; ++esac ++ ++# Note: order is significant - the case branches are not exclusive. ++ ++case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in ++ *:NetBSD:*:*) ++ # NetBSD (nbsd) targets should (where applicable) match one or ++ # more of the tuples: *-*-netbsdelf*, *-*-netbsdaout*, ++ # *-*-netbsdecoff* and *-*-netbsd*. For targets that recently ++ # switched to ELF, *-*-netbsd* would select the old ++ # object file format. This provides both forward ++ # compatibility and a consistent mechanism for selecting the ++ # object file format. ++ # ++ # Note: NetBSD doesn't particularly care about the vendor ++ # portion of the name. We always set it to "unknown". ++ sysctl="sysctl -n hw.machine_arch" ++ UNAME_MACHINE_ARCH=`(uname -p 2>/dev/null || \ ++ /sbin/$sysctl 2>/dev/null || \ ++ /usr/sbin/$sysctl 2>/dev/null || \ ++ echo unknown)` ++ case "${UNAME_MACHINE_ARCH}" in ++ armeb) machine=armeb-unknown ;; ++ arm*) machine=arm-unknown ;; ++ sh3el) machine=shl-unknown ;; ++ sh3eb) machine=sh-unknown ;; ++ sh5el) machine=sh5le-unknown ;; ++ earmv*) ++ arch=`echo ${UNAME_MACHINE_ARCH} | sed -e 's,^e\(armv[0-9]\).*$,\1,'` ++ endian=`echo ${UNAME_MACHINE_ARCH} | sed -ne 's,^.*\(eb\)$,\1,p'` ++ machine=${arch}${endian}-unknown ++ ;; ++ *) machine=${UNAME_MACHINE_ARCH}-unknown ;; ++ esac ++ # The Operating System including object format, if it has switched ++ # to ELF recently, or will in the future. ++ case "${UNAME_MACHINE_ARCH}" in ++ arm*|earm*|i386|m68k|ns32k|sh3*|sparc|vax) ++ eval $set_cc_for_build ++ if echo __ELF__ | $CC_FOR_BUILD -E - 2>/dev/null \ ++ | grep -q __ELF__ ++ then ++ # Once all utilities can be ECOFF (netbsdecoff) or a.out (netbsdaout). ++ # Return netbsd for either. FIX? ++ os=netbsd ++ else ++ os=netbsdelf ++ fi ++ ;; ++ *) ++ os=netbsd ++ ;; ++ esac ++ # Determine ABI tags. ++ case "${UNAME_MACHINE_ARCH}" in ++ earm*) ++ expr='s/^earmv[0-9]/-eabi/;s/eb$//' ++ abi=`echo ${UNAME_MACHINE_ARCH} | sed -e "$expr"` ++ ;; ++ esac ++ # The OS release ++ # Debian GNU/NetBSD machines have a different userland, and ++ # thus, need a distinct triplet. However, they do not need ++ # kernel version information, so it can be replaced with a ++ # suitable tag, in the style of linux-gnu. ++ case "${UNAME_VERSION}" in ++ Debian*) ++ release='-gnu' ++ ;; ++ *) ++ release=`echo ${UNAME_RELEASE} | sed -e 's/[-_].*//' | cut -d. -f1,2` ++ ;; ++ esac ++ # Since CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM: ++ # contains redundant information, the shorter form: ++ # CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM is used. ++ echo "${machine}-${os}${release}${abi}" ++ exit ;; ++ *:Bitrig:*:*) ++ UNAME_MACHINE_ARCH=`arch | sed 's/Bitrig.//'` ++ echo ${UNAME_MACHINE_ARCH}-unknown-bitrig${UNAME_RELEASE} ++ exit ;; ++ *:OpenBSD:*:*) ++ UNAME_MACHINE_ARCH=`arch | sed 's/OpenBSD.//'` ++ echo ${UNAME_MACHINE_ARCH}-unknown-openbsd${UNAME_RELEASE} ++ exit ;; ++ *:ekkoBSD:*:*) ++ echo ${UNAME_MACHINE}-unknown-ekkobsd${UNAME_RELEASE} ++ exit ;; ++ *:SolidBSD:*:*) ++ echo ${UNAME_MACHINE}-unknown-solidbsd${UNAME_RELEASE} ++ exit ;; ++ macppc:MirBSD:*:*) ++ echo powerpc-unknown-mirbsd${UNAME_RELEASE} ++ exit ;; ++ *:MirBSD:*:*) ++ echo ${UNAME_MACHINE}-unknown-mirbsd${UNAME_RELEASE} ++ exit ;; ++ *:Sortix:*:*) ++ echo ${UNAME_MACHINE}-unknown-sortix ++ exit ;; ++ alpha:OSF1:*:*) ++ case $UNAME_RELEASE in ++ *4.0) ++ UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $3}'` ++ ;; ++ *5.*) ++ UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $4}'` ++ ;; ++ esac ++ # According to Compaq, /usr/sbin/psrinfo has been available on ++ # OSF/1 and Tru64 systems produced since 1995. I hope that ++ # covers most systems running today. This code pipes the CPU ++ # types through head -n 1, so we only detect the type of CPU 0. ++ ALPHA_CPU_TYPE=`/usr/sbin/psrinfo -v | sed -n -e 's/^ The alpha \(.*\) processor.*$/\1/p' | head -n 1` ++ case "$ALPHA_CPU_TYPE" in ++ "EV4 (21064)") ++ UNAME_MACHINE="alpha" ;; ++ "EV4.5 (21064)") ++ UNAME_MACHINE="alpha" ;; ++ "LCA4 (21066/21068)") ++ UNAME_MACHINE="alpha" ;; ++ "EV5 (21164)") ++ UNAME_MACHINE="alphaev5" ;; ++ "EV5.6 (21164A)") ++ UNAME_MACHINE="alphaev56" ;; ++ "EV5.6 (21164PC)") ++ UNAME_MACHINE="alphapca56" ;; ++ "EV5.7 (21164PC)") ++ UNAME_MACHINE="alphapca57" ;; ++ "EV6 (21264)") ++ UNAME_MACHINE="alphaev6" ;; ++ "EV6.7 (21264A)") ++ UNAME_MACHINE="alphaev67" ;; ++ "EV6.8CB (21264C)") ++ UNAME_MACHINE="alphaev68" ;; ++ "EV6.8AL (21264B)") ++ UNAME_MACHINE="alphaev68" ;; ++ "EV6.8CX (21264D)") ++ UNAME_MACHINE="alphaev68" ;; ++ "EV6.9A (21264/EV69A)") ++ UNAME_MACHINE="alphaev69" ;; ++ "EV7 (21364)") ++ UNAME_MACHINE="alphaev7" ;; ++ "EV7.9 (21364A)") ++ UNAME_MACHINE="alphaev79" ;; ++ esac ++ # A Pn.n version is a patched version. ++ # A Vn.n version is a released version. ++ # A Tn.n version is a released field test version. ++ # A Xn.n version is an unreleased experimental baselevel. ++ # 1.2 uses "1.2" for uname -r. ++ echo ${UNAME_MACHINE}-dec-osf`echo ${UNAME_RELEASE} | sed -e 's/^[PVTX]//' | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` ++ # Reset EXIT trap before exiting to avoid spurious non-zero exit code. ++ exitcode=$? ++ trap '' 0 ++ exit $exitcode ;; ++ Alpha\ *:Windows_NT*:*) ++ # How do we know it's Interix rather than the generic POSIX subsystem? ++ # Should we change UNAME_MACHINE based on the output of uname instead ++ # of the specific Alpha model? ++ echo alpha-pc-interix ++ exit ;; ++ 21064:Windows_NT:50:3) ++ echo alpha-dec-winnt3.5 ++ exit ;; ++ Amiga*:UNIX_System_V:4.0:*) ++ echo m68k-unknown-sysv4 ++ exit ;; ++ *:[Aa]miga[Oo][Ss]:*:*) ++ echo ${UNAME_MACHINE}-unknown-amigaos ++ exit ;; ++ *:[Mm]orph[Oo][Ss]:*:*) ++ echo ${UNAME_MACHINE}-unknown-morphos ++ exit ;; ++ *:OS/390:*:*) ++ echo i370-ibm-openedition ++ exit ;; ++ *:z/VM:*:*) ++ echo s390-ibm-zvmoe ++ exit ;; ++ *:OS400:*:*) ++ echo powerpc-ibm-os400 ++ exit ;; ++ arm:RISC*:1.[012]*:*|arm:riscix:1.[012]*:*) ++ echo arm-acorn-riscix${UNAME_RELEASE} ++ exit ;; ++ arm*:riscos:*:*|arm*:RISCOS:*:*) ++ echo arm-unknown-riscos ++ exit ;; ++ SR2?01:HI-UX/MPP:*:* | SR8000:HI-UX/MPP:*:*) ++ echo hppa1.1-hitachi-hiuxmpp ++ exit ;; ++ Pyramid*:OSx*:*:* | MIS*:OSx*:*:* | MIS*:SMP_DC-OSx*:*:*) ++ # akee@wpdis03.wpafb.af.mil (Earle F. Ake) contributed MIS and NILE. ++ if test "`(/bin/universe) 2>/dev/null`" = att ; then ++ echo pyramid-pyramid-sysv3 ++ else ++ echo pyramid-pyramid-bsd ++ fi ++ exit ;; ++ NILE*:*:*:dcosx) ++ echo pyramid-pyramid-svr4 ++ exit ;; ++ DRS?6000:unix:4.0:6*) ++ echo sparc-icl-nx6 ++ exit ;; ++ DRS?6000:UNIX_SV:4.2*:7* | DRS?6000:isis:4.2*:7*) ++ case `/usr/bin/uname -p` in ++ sparc) echo sparc-icl-nx7; exit ;; ++ esac ;; ++ s390x:SunOS:*:*) ++ echo ${UNAME_MACHINE}-ibm-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` ++ exit ;; ++ sun4H:SunOS:5.*:*) ++ echo sparc-hal-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` ++ exit ;; ++ sun4*:SunOS:5.*:* | tadpole*:SunOS:5.*:*) ++ echo sparc-sun-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` ++ exit ;; ++ i86pc:AuroraUX:5.*:* | i86xen:AuroraUX:5.*:*) ++ echo i386-pc-auroraux${UNAME_RELEASE} ++ exit ;; ++ i86pc:SunOS:5.*:* | i86xen:SunOS:5.*:*) ++ eval $set_cc_for_build ++ SUN_ARCH="i386" ++ # If there is a compiler, see if it is configured for 64-bit objects. ++ # Note that the Sun cc does not turn __LP64__ into 1 like gcc does. ++ # This test works for both compilers. ++ if [ "$CC_FOR_BUILD" != 'no_compiler_found' ]; then ++ if (echo '#ifdef __amd64'; echo IS_64BIT_ARCH; echo '#endif') | \ ++ (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) | \ ++ grep IS_64BIT_ARCH >/dev/null ++ then ++ SUN_ARCH="x86_64" ++ fi ++ fi ++ echo ${SUN_ARCH}-pc-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` ++ exit ;; ++ sun4*:SunOS:6*:*) ++ # According to config.sub, this is the proper way to canonicalize ++ # SunOS6. Hard to guess exactly what SunOS6 will be like, but ++ # it's likely to be more like Solaris than SunOS4. ++ echo sparc-sun-solaris3`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` ++ exit ;; ++ sun4*:SunOS:*:*) ++ case "`/usr/bin/arch -k`" in ++ Series*|S4*) ++ UNAME_RELEASE=`uname -v` ++ ;; ++ esac ++ # Japanese Language versions have a version number like `4.1.3-JL'. ++ echo sparc-sun-sunos`echo ${UNAME_RELEASE}|sed -e 's/-/_/'` ++ exit ;; ++ sun3*:SunOS:*:*) ++ echo m68k-sun-sunos${UNAME_RELEASE} ++ exit ;; ++ sun*:*:4.2BSD:*) ++ UNAME_RELEASE=`(sed 1q /etc/motd | awk '{print substr($5,1,3)}') 2>/dev/null` ++ test "x${UNAME_RELEASE}" = "x" && UNAME_RELEASE=3 ++ case "`/bin/arch`" in ++ sun3) ++ echo m68k-sun-sunos${UNAME_RELEASE} ++ ;; ++ sun4) ++ echo sparc-sun-sunos${UNAME_RELEASE} ++ ;; ++ esac ++ exit ;; ++ aushp:SunOS:*:*) ++ echo sparc-auspex-sunos${UNAME_RELEASE} ++ exit ;; ++ # The situation for MiNT is a little confusing. The machine name ++ # can be virtually everything (everything which is not ++ # "atarist" or "atariste" at least should have a processor ++ # > m68000). The system name ranges from "MiNT" over "FreeMiNT" ++ # to the lowercase version "mint" (or "freemint"). Finally ++ # the system name "TOS" denotes a system which is actually not ++ # MiNT. But MiNT is downward compatible to TOS, so this should ++ # be no problem. ++ atarist[e]:*MiNT:*:* | atarist[e]:*mint:*:* | atarist[e]:*TOS:*:*) ++ echo m68k-atari-mint${UNAME_RELEASE} ++ exit ;; ++ atari*:*MiNT:*:* | atari*:*mint:*:* | atarist[e]:*TOS:*:*) ++ echo m68k-atari-mint${UNAME_RELEASE} ++ exit ;; ++ *falcon*:*MiNT:*:* | *falcon*:*mint:*:* | *falcon*:*TOS:*:*) ++ echo m68k-atari-mint${UNAME_RELEASE} ++ exit ;; ++ milan*:*MiNT:*:* | milan*:*mint:*:* | *milan*:*TOS:*:*) ++ echo m68k-milan-mint${UNAME_RELEASE} ++ exit ;; ++ hades*:*MiNT:*:* | hades*:*mint:*:* | *hades*:*TOS:*:*) ++ echo m68k-hades-mint${UNAME_RELEASE} ++ exit ;; ++ *:*MiNT:*:* | *:*mint:*:* | *:*TOS:*:*) ++ echo m68k-unknown-mint${UNAME_RELEASE} ++ exit ;; ++ m68k:machten:*:*) ++ echo m68k-apple-machten${UNAME_RELEASE} ++ exit ;; ++ powerpc:machten:*:*) ++ echo powerpc-apple-machten${UNAME_RELEASE} ++ exit ;; ++ RISC*:Mach:*:*) ++ echo mips-dec-mach_bsd4.3 ++ exit ;; ++ RISC*:ULTRIX:*:*) ++ echo mips-dec-ultrix${UNAME_RELEASE} ++ exit ;; ++ VAX*:ULTRIX*:*:*) ++ echo vax-dec-ultrix${UNAME_RELEASE} ++ exit ;; ++ 2020:CLIX:*:* | 2430:CLIX:*:*) ++ echo clipper-intergraph-clix${UNAME_RELEASE} ++ exit ;; ++ mips:*:*:UMIPS | mips:*:*:RISCos) ++ eval $set_cc_for_build ++ sed 's/^ //' << EOF >$dummy.c ++#ifdef __cplusplus ++#include /* for printf() prototype */ ++ int main (int argc, char *argv[]) { ++#else ++ int main (argc, argv) int argc; char *argv[]; { ++#endif ++ #if defined (host_mips) && defined (MIPSEB) ++ #if defined (SYSTYPE_SYSV) ++ printf ("mips-mips-riscos%ssysv\n", argv[1]); exit (0); ++ #endif ++ #if defined (SYSTYPE_SVR4) ++ printf ("mips-mips-riscos%ssvr4\n", argv[1]); exit (0); ++ #endif ++ #if defined (SYSTYPE_BSD43) || defined(SYSTYPE_BSD) ++ printf ("mips-mips-riscos%sbsd\n", argv[1]); exit (0); ++ #endif ++ #endif ++ exit (-1); ++ } ++EOF ++ $CC_FOR_BUILD -o $dummy $dummy.c && ++ dummyarg=`echo "${UNAME_RELEASE}" | sed -n 's/\([0-9]*\).*/\1/p'` && ++ SYSTEM_NAME=`$dummy $dummyarg` && ++ { echo "$SYSTEM_NAME"; exit; } ++ echo mips-mips-riscos${UNAME_RELEASE} ++ exit ;; ++ Motorola:PowerMAX_OS:*:*) ++ echo powerpc-motorola-powermax ++ exit ;; ++ Motorola:*:4.3:PL8-*) ++ echo powerpc-harris-powermax ++ exit ;; ++ Night_Hawk:*:*:PowerMAX_OS | Synergy:PowerMAX_OS:*:*) ++ echo powerpc-harris-powermax ++ exit ;; ++ Night_Hawk:Power_UNIX:*:*) ++ echo powerpc-harris-powerunix ++ exit ;; ++ m88k:CX/UX:7*:*) ++ echo m88k-harris-cxux7 ++ exit ;; ++ m88k:*:4*:R4*) ++ echo m88k-motorola-sysv4 ++ exit ;; ++ m88k:*:3*:R3*) ++ echo m88k-motorola-sysv3 ++ exit ;; ++ AViiON:dgux:*:*) ++ # DG/UX returns AViiON for all architectures ++ UNAME_PROCESSOR=`/usr/bin/uname -p` ++ if [ $UNAME_PROCESSOR = mc88100 ] || [ $UNAME_PROCESSOR = mc88110 ] ++ then ++ if [ ${TARGET_BINARY_INTERFACE}x = m88kdguxelfx ] || \ ++ [ ${TARGET_BINARY_INTERFACE}x = x ] ++ then ++ echo m88k-dg-dgux${UNAME_RELEASE} ++ else ++ echo m88k-dg-dguxbcs${UNAME_RELEASE} ++ fi ++ else ++ echo i586-dg-dgux${UNAME_RELEASE} ++ fi ++ exit ;; ++ M88*:DolphinOS:*:*) # DolphinOS (SVR3) ++ echo m88k-dolphin-sysv3 ++ exit ;; ++ M88*:*:R3*:*) ++ # Delta 88k system running SVR3 ++ echo m88k-motorola-sysv3 ++ exit ;; ++ XD88*:*:*:*) # Tektronix XD88 system running UTekV (SVR3) ++ echo m88k-tektronix-sysv3 ++ exit ;; ++ Tek43[0-9][0-9]:UTek:*:*) # Tektronix 4300 system running UTek (BSD) ++ echo m68k-tektronix-bsd ++ exit ;; ++ *:IRIX*:*:*) ++ echo mips-sgi-irix`echo ${UNAME_RELEASE}|sed -e 's/-/_/g'` ++ exit ;; ++ ????????:AIX?:[12].1:2) # AIX 2.2.1 or AIX 2.1.1 is RT/PC AIX. ++ echo romp-ibm-aix # uname -m gives an 8 hex-code CPU id ++ exit ;; # Note that: echo "'`uname -s`'" gives 'AIX ' ++ i*86:AIX:*:*) ++ echo i386-ibm-aix ++ exit ;; ++ ia64:AIX:*:*) ++ if [ -x /usr/bin/oslevel ] ; then ++ IBM_REV=`/usr/bin/oslevel` ++ else ++ IBM_REV=${UNAME_VERSION}.${UNAME_RELEASE} ++ fi ++ echo ${UNAME_MACHINE}-ibm-aix${IBM_REV} ++ exit ;; ++ *:AIX:2:3) ++ if grep bos325 /usr/include/stdio.h >/dev/null 2>&1; then ++ eval $set_cc_for_build ++ sed 's/^ //' << EOF >$dummy.c ++ #include ++ ++ main() ++ { ++ if (!__power_pc()) ++ exit(1); ++ puts("powerpc-ibm-aix3.2.5"); ++ exit(0); ++ } ++EOF ++ if $CC_FOR_BUILD -o $dummy $dummy.c && SYSTEM_NAME=`$dummy` ++ then ++ echo "$SYSTEM_NAME" ++ else ++ echo rs6000-ibm-aix3.2.5 ++ fi ++ elif grep bos324 /usr/include/stdio.h >/dev/null 2>&1; then ++ echo rs6000-ibm-aix3.2.4 ++ else ++ echo rs6000-ibm-aix3.2 ++ fi ++ exit ;; ++ *:AIX:*:[4567]) ++ IBM_CPU_ID=`/usr/sbin/lsdev -C -c processor -S available | sed 1q | awk '{ print $1 }'` ++ if /usr/sbin/lsattr -El ${IBM_CPU_ID} | grep ' POWER' >/dev/null 2>&1; then ++ IBM_ARCH=rs6000 ++ else ++ IBM_ARCH=powerpc ++ fi ++ if [ -x /usr/bin/lslpp ] ; then ++ IBM_REV=`/usr/bin/lslpp -Lqc bos.rte.libc | ++ awk -F: '{ print $3 }' | sed s/[0-9]*$/0/` ++ else ++ IBM_REV=${UNAME_VERSION}.${UNAME_RELEASE} ++ fi ++ echo ${IBM_ARCH}-ibm-aix${IBM_REV} ++ exit ;; ++ *:AIX:*:*) ++ echo rs6000-ibm-aix ++ exit ;; ++ ibmrt:4.4BSD:*|romp-ibm:BSD:*) ++ echo romp-ibm-bsd4.4 ++ exit ;; ++ ibmrt:*BSD:*|romp-ibm:BSD:*) # covers RT/PC BSD and ++ echo romp-ibm-bsd${UNAME_RELEASE} # 4.3 with uname added to ++ exit ;; # report: romp-ibm BSD 4.3 ++ *:BOSX:*:*) ++ echo rs6000-bull-bosx ++ exit ;; ++ DPX/2?00:B.O.S.:*:*) ++ echo m68k-bull-sysv3 ++ exit ;; ++ 9000/[34]??:4.3bsd:1.*:*) ++ echo m68k-hp-bsd ++ exit ;; ++ hp300:4.4BSD:*:* | 9000/[34]??:4.3bsd:2.*:*) ++ echo m68k-hp-bsd4.4 ++ exit ;; ++ 9000/[34678]??:HP-UX:*:*) ++ HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'` ++ case "${UNAME_MACHINE}" in ++ 9000/31? ) HP_ARCH=m68000 ;; ++ 9000/[34]?? ) HP_ARCH=m68k ;; ++ 9000/[678][0-9][0-9]) ++ if [ -x /usr/bin/getconf ]; then ++ sc_cpu_version=`/usr/bin/getconf SC_CPU_VERSION 2>/dev/null` ++ sc_kernel_bits=`/usr/bin/getconf SC_KERNEL_BITS 2>/dev/null` ++ case "${sc_cpu_version}" in ++ 523) HP_ARCH="hppa1.0" ;; # CPU_PA_RISC1_0 ++ 528) HP_ARCH="hppa1.1" ;; # CPU_PA_RISC1_1 ++ 532) # CPU_PA_RISC2_0 ++ case "${sc_kernel_bits}" in ++ 32) HP_ARCH="hppa2.0n" ;; ++ 64) HP_ARCH="hppa2.0w" ;; ++ '') HP_ARCH="hppa2.0" ;; # HP-UX 10.20 ++ esac ;; ++ esac ++ fi ++ if [ "${HP_ARCH}" = "" ]; then ++ eval $set_cc_for_build ++ sed 's/^ //' << EOF >$dummy.c ++ ++ #define _HPUX_SOURCE ++ #include ++ #include ++ ++ int main () ++ { ++ #if defined(_SC_KERNEL_BITS) ++ long bits = sysconf(_SC_KERNEL_BITS); ++ #endif ++ long cpu = sysconf (_SC_CPU_VERSION); ++ ++ switch (cpu) ++ { ++ case CPU_PA_RISC1_0: puts ("hppa1.0"); break; ++ case CPU_PA_RISC1_1: puts ("hppa1.1"); break; ++ case CPU_PA_RISC2_0: ++ #if defined(_SC_KERNEL_BITS) ++ switch (bits) ++ { ++ case 64: puts ("hppa2.0w"); break; ++ case 32: puts ("hppa2.0n"); break; ++ default: puts ("hppa2.0"); break; ++ } break; ++ #else /* !defined(_SC_KERNEL_BITS) */ ++ puts ("hppa2.0"); break; ++ #endif ++ default: puts ("hppa1.0"); break; ++ } ++ exit (0); ++ } ++EOF ++ (CCOPTS= $CC_FOR_BUILD -o $dummy $dummy.c 2>/dev/null) && HP_ARCH=`$dummy` ++ test -z "$HP_ARCH" && HP_ARCH=hppa ++ fi ;; ++ esac ++ if [ ${HP_ARCH} = "hppa2.0w" ] ++ then ++ eval $set_cc_for_build ++ ++ # hppa2.0w-hp-hpux* has a 64-bit kernel and a compiler generating ++ # 32-bit code. hppa64-hp-hpux* has the same kernel and a compiler ++ # generating 64-bit code. GNU and HP use different nomenclature: ++ # ++ # $ CC_FOR_BUILD=cc ./config.guess ++ # => hppa2.0w-hp-hpux11.23 ++ # $ CC_FOR_BUILD="cc +DA2.0w" ./config.guess ++ # => hppa64-hp-hpux11.23 ++ ++ if echo __LP64__ | (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) | ++ grep -q __LP64__ ++ then ++ HP_ARCH="hppa2.0w" ++ else ++ HP_ARCH="hppa64" ++ fi ++ fi ++ echo ${HP_ARCH}-hp-hpux${HPUX_REV} ++ exit ;; ++ ia64:HP-UX:*:*) ++ HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'` ++ echo ia64-hp-hpux${HPUX_REV} ++ exit ;; ++ 3050*:HI-UX:*:*) ++ eval $set_cc_for_build ++ sed 's/^ //' << EOF >$dummy.c ++ #include ++ int ++ main () ++ { ++ long cpu = sysconf (_SC_CPU_VERSION); ++ /* The order matters, because CPU_IS_HP_MC68K erroneously returns ++ true for CPU_PA_RISC1_0. CPU_IS_PA_RISC returns correct ++ results, however. */ ++ if (CPU_IS_PA_RISC (cpu)) ++ { ++ switch (cpu) ++ { ++ case CPU_PA_RISC1_0: puts ("hppa1.0-hitachi-hiuxwe2"); break; ++ case CPU_PA_RISC1_1: puts ("hppa1.1-hitachi-hiuxwe2"); break; ++ case CPU_PA_RISC2_0: puts ("hppa2.0-hitachi-hiuxwe2"); break; ++ default: puts ("hppa-hitachi-hiuxwe2"); break; ++ } ++ } ++ else if (CPU_IS_HP_MC68K (cpu)) ++ puts ("m68k-hitachi-hiuxwe2"); ++ else puts ("unknown-hitachi-hiuxwe2"); ++ exit (0); ++ } ++EOF ++ $CC_FOR_BUILD -o $dummy $dummy.c && SYSTEM_NAME=`$dummy` && ++ { echo "$SYSTEM_NAME"; exit; } ++ echo unknown-hitachi-hiuxwe2 ++ exit ;; ++ 9000/7??:4.3bsd:*:* | 9000/8?[79]:4.3bsd:*:* ) ++ echo hppa1.1-hp-bsd ++ exit ;; ++ 9000/8??:4.3bsd:*:*) ++ echo hppa1.0-hp-bsd ++ exit ;; ++ *9??*:MPE/iX:*:* | *3000*:MPE/iX:*:*) ++ echo hppa1.0-hp-mpeix ++ exit ;; ++ hp7??:OSF1:*:* | hp8?[79]:OSF1:*:* ) ++ echo hppa1.1-hp-osf ++ exit ;; ++ hp8??:OSF1:*:*) ++ echo hppa1.0-hp-osf ++ exit ;; ++ i*86:OSF1:*:*) ++ if [ -x /usr/sbin/sysversion ] ; then ++ echo ${UNAME_MACHINE}-unknown-osf1mk ++ else ++ echo ${UNAME_MACHINE}-unknown-osf1 ++ fi ++ exit ;; ++ parisc*:Lites*:*:*) ++ echo hppa1.1-hp-lites ++ exit ;; ++ C1*:ConvexOS:*:* | convex:ConvexOS:C1*:*) ++ echo c1-convex-bsd ++ exit ;; ++ C2*:ConvexOS:*:* | convex:ConvexOS:C2*:*) ++ if getsysinfo -f scalar_acc ++ then echo c32-convex-bsd ++ else echo c2-convex-bsd ++ fi ++ exit ;; ++ C34*:ConvexOS:*:* | convex:ConvexOS:C34*:*) ++ echo c34-convex-bsd ++ exit ;; ++ C38*:ConvexOS:*:* | convex:ConvexOS:C38*:*) ++ echo c38-convex-bsd ++ exit ;; ++ C4*:ConvexOS:*:* | convex:ConvexOS:C4*:*) ++ echo c4-convex-bsd ++ exit ;; ++ CRAY*Y-MP:*:*:*) ++ echo ymp-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' ++ exit ;; ++ CRAY*[A-Z]90:*:*:*) ++ echo ${UNAME_MACHINE}-cray-unicos${UNAME_RELEASE} \ ++ | sed -e 's/CRAY.*\([A-Z]90\)/\1/' \ ++ -e y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/ \ ++ -e 's/\.[^.]*$/.X/' ++ exit ;; ++ CRAY*TS:*:*:*) ++ echo t90-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' ++ exit ;; ++ CRAY*T3E:*:*:*) ++ echo alphaev5-cray-unicosmk${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' ++ exit ;; ++ CRAY*SV1:*:*:*) ++ echo sv1-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' ++ exit ;; ++ *:UNICOS/mp:*:*) ++ echo craynv-cray-unicosmp${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' ++ exit ;; ++ F30[01]:UNIX_System_V:*:* | F700:UNIX_System_V:*:*) ++ FUJITSU_PROC=`uname -m | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` ++ FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'` ++ FUJITSU_REL=`echo ${UNAME_RELEASE} | sed -e 's/ /_/'` ++ echo "${FUJITSU_PROC}-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}" ++ exit ;; ++ 5000:UNIX_System_V:4.*:*) ++ FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'` ++ FUJITSU_REL=`echo ${UNAME_RELEASE} | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/ /_/'` ++ echo "sparc-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}" ++ exit ;; ++ i*86:BSD/386:*:* | i*86:BSD/OS:*:* | *:Ascend\ Embedded/OS:*:*) ++ echo ${UNAME_MACHINE}-pc-bsdi${UNAME_RELEASE} ++ exit ;; ++ sparc*:BSD/OS:*:*) ++ echo sparc-unknown-bsdi${UNAME_RELEASE} ++ exit ;; ++ *:BSD/OS:*:*) ++ echo ${UNAME_MACHINE}-unknown-bsdi${UNAME_RELEASE} ++ exit ;; ++ *:FreeBSD:*:*) ++ UNAME_PROCESSOR=`/usr/bin/uname -p` ++ case ${UNAME_PROCESSOR} in ++ amd64) ++ echo x86_64-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;; ++ *) ++ echo ${UNAME_PROCESSOR}-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;; ++ esac ++ exit ;; ++ i*:CYGWIN*:*) ++ echo ${UNAME_MACHINE}-pc-cygwin ++ exit ;; ++ *:MINGW64*:*) ++ echo ${UNAME_MACHINE}-pc-mingw64 ++ exit ;; ++ *:MINGW*:*) ++ echo ${UNAME_MACHINE}-pc-mingw32 ++ exit ;; ++ *:MSYS*:*) ++ echo ${UNAME_MACHINE}-pc-msys ++ exit ;; ++ i*:windows32*:*) ++ # uname -m includes "-pc" on this system. ++ echo ${UNAME_MACHINE}-mingw32 ++ exit ;; ++ i*:PW*:*) ++ echo ${UNAME_MACHINE}-pc-pw32 ++ exit ;; ++ *:Interix*:*) ++ case ${UNAME_MACHINE} in ++ x86) ++ echo i586-pc-interix${UNAME_RELEASE} ++ exit ;; ++ authenticamd | genuineintel | EM64T) ++ echo x86_64-unknown-interix${UNAME_RELEASE} ++ exit ;; ++ IA64) ++ echo ia64-unknown-interix${UNAME_RELEASE} ++ exit ;; ++ esac ;; ++ [345]86:Windows_95:* | [345]86:Windows_98:* | [345]86:Windows_NT:*) ++ echo i${UNAME_MACHINE}-pc-mks ++ exit ;; ++ 8664:Windows_NT:*) ++ echo x86_64-pc-mks ++ exit ;; ++ i*:Windows_NT*:* | Pentium*:Windows_NT*:*) ++ # How do we know it's Interix rather than the generic POSIX subsystem? ++ # It also conflicts with pre-2.0 versions of AT&T UWIN. Should we ++ # UNAME_MACHINE based on the output of uname instead of i386? ++ echo i586-pc-interix ++ exit ;; ++ i*:UWIN*:*) ++ echo ${UNAME_MACHINE}-pc-uwin ++ exit ;; ++ amd64:CYGWIN*:*:* | x86_64:CYGWIN*:*:*) ++ echo x86_64-unknown-cygwin ++ exit ;; ++ p*:CYGWIN*:*) ++ echo powerpcle-unknown-cygwin ++ exit ;; ++ prep*:SunOS:5.*:*) ++ echo powerpcle-unknown-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` ++ exit ;; ++ *:GNU:*:*) ++ # the GNU system ++ echo `echo ${UNAME_MACHINE}|sed -e 's,[-/].*$,,'`-unknown-${LIBC}`echo ${UNAME_RELEASE}|sed -e 's,/.*$,,'` ++ exit ;; ++ *:GNU/*:*:*) ++ # other systems with GNU libc and userland ++ echo ${UNAME_MACHINE}-unknown-`echo ${UNAME_SYSTEM} | sed 's,^[^/]*/,,' | tr '[A-Z]' '[a-z]'``echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`-${LIBC} ++ exit ;; ++ i*86:Minix:*:*) ++ echo ${UNAME_MACHINE}-pc-minix ++ exit ;; ++ aarch64:Linux:*:*) ++ echo ${UNAME_MACHINE}-unknown-linux-${LIBC} ++ exit ;; ++ aarch64_be:Linux:*:*) ++ UNAME_MACHINE=aarch64_be ++ echo ${UNAME_MACHINE}-unknown-linux-${LIBC} ++ exit ;; ++ alpha:Linux:*:*) ++ case `sed -n '/^cpu model/s/^.*: \(.*\)/\1/p' < /proc/cpuinfo` in ++ EV5) UNAME_MACHINE=alphaev5 ;; ++ EV56) UNAME_MACHINE=alphaev56 ;; ++ PCA56) UNAME_MACHINE=alphapca56 ;; ++ PCA57) UNAME_MACHINE=alphapca56 ;; ++ EV6) UNAME_MACHINE=alphaev6 ;; ++ EV67) UNAME_MACHINE=alphaev67 ;; ++ EV68*) UNAME_MACHINE=alphaev68 ;; ++ esac ++ objdump --private-headers /bin/sh | grep -q ld.so.1 ++ if test "$?" = 0 ; then LIBC="gnulibc1" ; fi ++ echo ${UNAME_MACHINE}-unknown-linux-${LIBC} ++ exit ;; ++ arc:Linux:*:* | arceb:Linux:*:*) ++ echo ${UNAME_MACHINE}-unknown-linux-${LIBC} ++ exit ;; ++ arm*:Linux:*:*) ++ eval $set_cc_for_build ++ if echo __ARM_EABI__ | $CC_FOR_BUILD -E - 2>/dev/null \ ++ | grep -q __ARM_EABI__ ++ then ++ echo ${UNAME_MACHINE}-unknown-linux-${LIBC} ++ else ++ if echo __ARM_PCS_VFP | $CC_FOR_BUILD -E - 2>/dev/null \ ++ | grep -q __ARM_PCS_VFP ++ then ++ echo ${UNAME_MACHINE}-unknown-linux-${LIBC}eabi ++ else ++ echo ${UNAME_MACHINE}-unknown-linux-${LIBC}eabihf ++ fi ++ fi ++ exit ;; ++ avr32*:Linux:*:*) ++ echo ${UNAME_MACHINE}-unknown-linux-${LIBC} ++ exit ;; ++ cris:Linux:*:*) ++ echo ${UNAME_MACHINE}-axis-linux-${LIBC} ++ exit ;; ++ crisv32:Linux:*:*) ++ echo ${UNAME_MACHINE}-axis-linux-${LIBC} ++ exit ;; ++ e2k:Linux:*:*) ++ echo ${UNAME_MACHINE}-unknown-linux-${LIBC} ++ exit ;; ++ frv:Linux:*:*) ++ echo ${UNAME_MACHINE}-unknown-linux-${LIBC} ++ exit ;; ++ hexagon:Linux:*:*) ++ echo ${UNAME_MACHINE}-unknown-linux-${LIBC} ++ exit ;; ++ i*86:Linux:*:*) ++ echo ${UNAME_MACHINE}-pc-linux-${LIBC} ++ exit ;; ++ ia64:Linux:*:*) ++ echo ${UNAME_MACHINE}-unknown-linux-${LIBC} ++ exit ;; ++ m32r*:Linux:*:*) ++ echo ${UNAME_MACHINE}-unknown-linux-${LIBC} ++ exit ;; ++ m68*:Linux:*:*) ++ echo ${UNAME_MACHINE}-unknown-linux-${LIBC} ++ exit ;; ++ mips:Linux:*:* | mips64:Linux:*:*) ++ eval $set_cc_for_build ++ sed 's/^ //' << EOF >$dummy.c ++ #undef CPU ++ #undef ${UNAME_MACHINE} ++ #undef ${UNAME_MACHINE}el ++ #if defined(__MIPSEL__) || defined(__MIPSEL) || defined(_MIPSEL) || defined(MIPSEL) ++ CPU=${UNAME_MACHINE}el ++ #else ++ #if defined(__MIPSEB__) || defined(__MIPSEB) || defined(_MIPSEB) || defined(MIPSEB) ++ CPU=${UNAME_MACHINE} ++ #else ++ CPU= ++ #endif ++ #endif ++EOF ++ eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep '^CPU'` ++ test x"${CPU}" != x && { echo "${CPU}-unknown-linux-${LIBC}"; exit; } ++ ;; ++ openrisc*:Linux:*:*) ++ echo or1k-unknown-linux-${LIBC} ++ exit ;; ++ or32:Linux:*:* | or1k*:Linux:*:*) ++ echo ${UNAME_MACHINE}-unknown-linux-${LIBC} ++ exit ;; ++ padre:Linux:*:*) ++ echo sparc-unknown-linux-${LIBC} ++ exit ;; ++ parisc64:Linux:*:* | hppa64:Linux:*:*) ++ echo hppa64-unknown-linux-${LIBC} ++ exit ;; ++ parisc:Linux:*:* | hppa:Linux:*:*) ++ # Look for CPU level ++ case `grep '^cpu[^a-z]*:' /proc/cpuinfo 2>/dev/null | cut -d' ' -f2` in ++ PA7*) echo hppa1.1-unknown-linux-${LIBC} ;; ++ PA8*) echo hppa2.0-unknown-linux-${LIBC} ;; ++ *) echo hppa-unknown-linux-${LIBC} ;; ++ esac ++ exit ;; ++ ppc64:Linux:*:*) ++ echo powerpc64-unknown-linux-${LIBC} ++ exit ;; ++ ppc:Linux:*:*) ++ echo powerpc-unknown-linux-${LIBC} ++ exit ;; ++ ppc64le:Linux:*:*) ++ echo powerpc64le-unknown-linux-${LIBC} ++ exit ;; ++ ppcle:Linux:*:*) ++ echo powerpcle-unknown-linux-${LIBC} ++ exit ;; ++ s390:Linux:*:* | s390x:Linux:*:*) ++ echo ${UNAME_MACHINE}-ibm-linux-${LIBC} ++ exit ;; ++ sh64*:Linux:*:*) ++ echo ${UNAME_MACHINE}-unknown-linux-${LIBC} ++ exit ;; ++ sh*:Linux:*:*) ++ echo ${UNAME_MACHINE}-unknown-linux-${LIBC} ++ exit ;; ++ sparc:Linux:*:* | sparc64:Linux:*:*) ++ echo ${UNAME_MACHINE}-unknown-linux-${LIBC} ++ exit ;; ++ tile*:Linux:*:*) ++ echo ${UNAME_MACHINE}-unknown-linux-${LIBC} ++ exit ;; ++ vax:Linux:*:*) ++ echo ${UNAME_MACHINE}-dec-linux-${LIBC} ++ exit ;; ++ x86_64:Linux:*:*) ++ echo ${UNAME_MACHINE}-pc-linux-${LIBC} ++ exit ;; ++ xtensa*:Linux:*:*) ++ echo ${UNAME_MACHINE}-unknown-linux-${LIBC} ++ exit ;; ++ i*86:DYNIX/ptx:4*:*) ++ # ptx 4.0 does uname -s correctly, with DYNIX/ptx in there. ++ # earlier versions are messed up and put the nodename in both ++ # sysname and nodename. ++ echo i386-sequent-sysv4 ++ exit ;; ++ i*86:UNIX_SV:4.2MP:2.*) ++ # Unixware is an offshoot of SVR4, but it has its own version ++ # number series starting with 2... ++ # I am not positive that other SVR4 systems won't match this, ++ # I just have to hope. -- rms. ++ # Use sysv4.2uw... so that sysv4* matches it. ++ echo ${UNAME_MACHINE}-pc-sysv4.2uw${UNAME_VERSION} ++ exit ;; ++ i*86:OS/2:*:*) ++ # If we were able to find `uname', then EMX Unix compatibility ++ # is probably installed. ++ echo ${UNAME_MACHINE}-pc-os2-emx ++ exit ;; ++ i*86:XTS-300:*:STOP) ++ echo ${UNAME_MACHINE}-unknown-stop ++ exit ;; ++ i*86:atheos:*:*) ++ echo ${UNAME_MACHINE}-unknown-atheos ++ exit ;; ++ i*86:syllable:*:*) ++ echo ${UNAME_MACHINE}-pc-syllable ++ exit ;; ++ i*86:LynxOS:2.*:* | i*86:LynxOS:3.[01]*:* | i*86:LynxOS:4.[02]*:*) ++ echo i386-unknown-lynxos${UNAME_RELEASE} ++ exit ;; ++ i*86:*DOS:*:*) ++ echo ${UNAME_MACHINE}-pc-msdosdjgpp ++ exit ;; ++ i*86:*:4.*:* | i*86:SYSTEM_V:4.*:*) ++ UNAME_REL=`echo ${UNAME_RELEASE} | sed 's/\/MP$//'` ++ if grep Novell /usr/include/link.h >/dev/null 2>/dev/null; then ++ echo ${UNAME_MACHINE}-univel-sysv${UNAME_REL} ++ else ++ echo ${UNAME_MACHINE}-pc-sysv${UNAME_REL} ++ fi ++ exit ;; ++ i*86:*:5:[678]*) ++ # UnixWare 7.x, OpenUNIX and OpenServer 6. ++ case `/bin/uname -X | grep "^Machine"` in ++ *486*) UNAME_MACHINE=i486 ;; ++ *Pentium) UNAME_MACHINE=i586 ;; ++ *Pent*|*Celeron) UNAME_MACHINE=i686 ;; ++ esac ++ echo ${UNAME_MACHINE}-unknown-sysv${UNAME_RELEASE}${UNAME_SYSTEM}${UNAME_VERSION} ++ exit ;; ++ i*86:*:3.2:*) ++ if test -f /usr/options/cb.name; then ++ UNAME_REL=`sed -n 's/.*Version //p' /dev/null >/dev/null ; then ++ UNAME_REL=`(/bin/uname -X|grep Release|sed -e 's/.*= //')` ++ (/bin/uname -X|grep i80486 >/dev/null) && UNAME_MACHINE=i486 ++ (/bin/uname -X|grep '^Machine.*Pentium' >/dev/null) \ ++ && UNAME_MACHINE=i586 ++ (/bin/uname -X|grep '^Machine.*Pent *II' >/dev/null) \ ++ && UNAME_MACHINE=i686 ++ (/bin/uname -X|grep '^Machine.*Pentium Pro' >/dev/null) \ ++ && UNAME_MACHINE=i686 ++ echo ${UNAME_MACHINE}-pc-sco$UNAME_REL ++ else ++ echo ${UNAME_MACHINE}-pc-sysv32 ++ fi ++ exit ;; ++ pc:*:*:*) ++ # Left here for compatibility: ++ # uname -m prints for DJGPP always 'pc', but it prints nothing about ++ # the processor, so we play safe by assuming i586. ++ # Note: whatever this is, it MUST be the same as what config.sub ++ # prints for the "djgpp" host, or else GDB configury will decide that ++ # this is a cross-build. ++ echo i586-pc-msdosdjgpp ++ exit ;; ++ Intel:Mach:3*:*) ++ echo i386-pc-mach3 ++ exit ;; ++ paragon:*:*:*) ++ echo i860-intel-osf1 ++ exit ;; ++ i860:*:4.*:*) # i860-SVR4 ++ if grep Stardent /usr/include/sys/uadmin.h >/dev/null 2>&1 ; then ++ echo i860-stardent-sysv${UNAME_RELEASE} # Stardent Vistra i860-SVR4 ++ else # Add other i860-SVR4 vendors below as they are discovered. ++ echo i860-unknown-sysv${UNAME_RELEASE} # Unknown i860-SVR4 ++ fi ++ exit ;; ++ mini*:CTIX:SYS*5:*) ++ # "miniframe" ++ echo m68010-convergent-sysv ++ exit ;; ++ mc68k:UNIX:SYSTEM5:3.51m) ++ echo m68k-convergent-sysv ++ exit ;; ++ M680?0:D-NIX:5.3:*) ++ echo m68k-diab-dnix ++ exit ;; ++ M68*:*:R3V[5678]*:*) ++ test -r /sysV68 && { echo 'm68k-motorola-sysv'; exit; } ;; ++ 3[345]??:*:4.0:3.0 | 3[34]??A:*:4.0:3.0 | 3[34]??,*:*:4.0:3.0 | 3[34]??/*:*:4.0:3.0 | 4400:*:4.0:3.0 | 4850:*:4.0:3.0 | SKA40:*:4.0:3.0 | SDS2:*:4.0:3.0 | SHG2:*:4.0:3.0 | S7501*:*:4.0:3.0) ++ OS_REL='' ++ test -r /etc/.relid \ ++ && OS_REL=.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid` ++ /bin/uname -p 2>/dev/null | grep 86 >/dev/null \ ++ && { echo i486-ncr-sysv4.3${OS_REL}; exit; } ++ /bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \ ++ && { echo i586-ncr-sysv4.3${OS_REL}; exit; } ;; ++ 3[34]??:*:4.0:* | 3[34]??,*:*:4.0:*) ++ /bin/uname -p 2>/dev/null | grep 86 >/dev/null \ ++ && { echo i486-ncr-sysv4; exit; } ;; ++ NCR*:*:4.2:* | MPRAS*:*:4.2:*) ++ OS_REL='.3' ++ test -r /etc/.relid \ ++ && OS_REL=.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid` ++ /bin/uname -p 2>/dev/null | grep 86 >/dev/null \ ++ && { echo i486-ncr-sysv4.3${OS_REL}; exit; } ++ /bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \ ++ && { echo i586-ncr-sysv4.3${OS_REL}; exit; } ++ /bin/uname -p 2>/dev/null | /bin/grep pteron >/dev/null \ ++ && { echo i586-ncr-sysv4.3${OS_REL}; exit; } ;; ++ m68*:LynxOS:2.*:* | m68*:LynxOS:3.0*:*) ++ echo m68k-unknown-lynxos${UNAME_RELEASE} ++ exit ;; ++ mc68030:UNIX_System_V:4.*:*) ++ echo m68k-atari-sysv4 ++ exit ;; ++ TSUNAMI:LynxOS:2.*:*) ++ echo sparc-unknown-lynxos${UNAME_RELEASE} ++ exit ;; ++ rs6000:LynxOS:2.*:*) ++ echo rs6000-unknown-lynxos${UNAME_RELEASE} ++ exit ;; ++ PowerPC:LynxOS:2.*:* | PowerPC:LynxOS:3.[01]*:* | PowerPC:LynxOS:4.[02]*:*) ++ echo powerpc-unknown-lynxos${UNAME_RELEASE} ++ exit ;; ++ SM[BE]S:UNIX_SV:*:*) ++ echo mips-dde-sysv${UNAME_RELEASE} ++ exit ;; ++ RM*:ReliantUNIX-*:*:*) ++ echo mips-sni-sysv4 ++ exit ;; ++ RM*:SINIX-*:*:*) ++ echo mips-sni-sysv4 ++ exit ;; ++ *:SINIX-*:*:*) ++ if uname -p 2>/dev/null >/dev/null ; then ++ UNAME_MACHINE=`(uname -p) 2>/dev/null` ++ echo ${UNAME_MACHINE}-sni-sysv4 ++ else ++ echo ns32k-sni-sysv ++ fi ++ exit ;; ++ PENTIUM:*:4.0*:*) # Unisys `ClearPath HMP IX 4000' SVR4/MP effort ++ # says ++ echo i586-unisys-sysv4 ++ exit ;; ++ *:UNIX_System_V:4*:FTX*) ++ # From Gerald Hewes . ++ # How about differentiating between stratus architectures? -djm ++ echo hppa1.1-stratus-sysv4 ++ exit ;; ++ *:*:*:FTX*) ++ # From seanf@swdc.stratus.com. ++ echo i860-stratus-sysv4 ++ exit ;; ++ i*86:VOS:*:*) ++ # From Paul.Green@stratus.com. ++ echo ${UNAME_MACHINE}-stratus-vos ++ exit ;; ++ *:VOS:*:*) ++ # From Paul.Green@stratus.com. ++ echo hppa1.1-stratus-vos ++ exit ;; ++ mc68*:A/UX:*:*) ++ echo m68k-apple-aux${UNAME_RELEASE} ++ exit ;; ++ news*:NEWS-OS:6*:*) ++ echo mips-sony-newsos6 ++ exit ;; ++ R[34]000:*System_V*:*:* | R4000:UNIX_SYSV:*:* | R*000:UNIX_SV:*:*) ++ if [ -d /usr/nec ]; then ++ echo mips-nec-sysv${UNAME_RELEASE} ++ else ++ echo mips-unknown-sysv${UNAME_RELEASE} ++ fi ++ exit ;; ++ BeBox:BeOS:*:*) # BeOS running on hardware made by Be, PPC only. ++ echo powerpc-be-beos ++ exit ;; ++ BeMac:BeOS:*:*) # BeOS running on Mac or Mac clone, PPC only. ++ echo powerpc-apple-beos ++ exit ;; ++ BePC:BeOS:*:*) # BeOS running on Intel PC compatible. ++ echo i586-pc-beos ++ exit ;; ++ BePC:Haiku:*:*) # Haiku running on Intel PC compatible. ++ echo i586-pc-haiku ++ exit ;; ++ x86_64:Haiku:*:*) ++ echo x86_64-unknown-haiku ++ exit ;; ++ SX-4:SUPER-UX:*:*) ++ echo sx4-nec-superux${UNAME_RELEASE} ++ exit ;; ++ SX-5:SUPER-UX:*:*) ++ echo sx5-nec-superux${UNAME_RELEASE} ++ exit ;; ++ SX-6:SUPER-UX:*:*) ++ echo sx6-nec-superux${UNAME_RELEASE} ++ exit ;; ++ SX-7:SUPER-UX:*:*) ++ echo sx7-nec-superux${UNAME_RELEASE} ++ exit ;; ++ SX-8:SUPER-UX:*:*) ++ echo sx8-nec-superux${UNAME_RELEASE} ++ exit ;; ++ SX-8R:SUPER-UX:*:*) ++ echo sx8r-nec-superux${UNAME_RELEASE} ++ exit ;; ++ Power*:Rhapsody:*:*) ++ echo powerpc-apple-rhapsody${UNAME_RELEASE} ++ exit ;; ++ *:Rhapsody:*:*) ++ echo ${UNAME_MACHINE}-apple-rhapsody${UNAME_RELEASE} ++ exit ;; ++ *:Darwin:*:*) ++ UNAME_PROCESSOR=`uname -p` || UNAME_PROCESSOR=unknown ++ eval $set_cc_for_build ++ if test "$UNAME_PROCESSOR" = unknown ; then ++ UNAME_PROCESSOR=powerpc ++ fi ++ if test `echo "$UNAME_RELEASE" | sed -e 's/\..*//'` -le 10 ; then ++ if [ "$CC_FOR_BUILD" != 'no_compiler_found' ]; then ++ if (echo '#ifdef __LP64__'; echo IS_64BIT_ARCH; echo '#endif') | \ ++ (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) | \ ++ grep IS_64BIT_ARCH >/dev/null ++ then ++ case $UNAME_PROCESSOR in ++ i386) UNAME_PROCESSOR=x86_64 ;; ++ powerpc) UNAME_PROCESSOR=powerpc64 ;; ++ esac ++ fi ++ fi ++ elif test "$UNAME_PROCESSOR" = i386 ; then ++ # Avoid executing cc on OS X 10.9, as it ships with a stub ++ # that puts up a graphical alert prompting to install ++ # developer tools. Any system running Mac OS X 10.7 or ++ # later (Darwin 11 and later) is required to have a 64-bit ++ # processor. This is not true of the ARM version of Darwin ++ # that Apple uses in portable devices. ++ UNAME_PROCESSOR=x86_64 ++ fi ++ echo ${UNAME_PROCESSOR}-apple-darwin${UNAME_RELEASE} ++ exit ;; ++ *:procnto*:*:* | *:QNX:[0123456789]*:*) ++ UNAME_PROCESSOR=`uname -p` ++ if test "$UNAME_PROCESSOR" = "x86"; then ++ UNAME_PROCESSOR=i386 ++ UNAME_MACHINE=pc ++ fi ++ echo ${UNAME_PROCESSOR}-${UNAME_MACHINE}-nto-qnx${UNAME_RELEASE} ++ exit ;; ++ *:QNX:*:4*) ++ echo i386-pc-qnx ++ exit ;; ++ NEO-?:NONSTOP_KERNEL:*:*) ++ echo neo-tandem-nsk${UNAME_RELEASE} ++ exit ;; ++ NSE-*:NONSTOP_KERNEL:*:*) ++ echo nse-tandem-nsk${UNAME_RELEASE} ++ exit ;; ++ NSR-?:NONSTOP_KERNEL:*:*) ++ echo nsr-tandem-nsk${UNAME_RELEASE} ++ exit ;; ++ *:NonStop-UX:*:*) ++ echo mips-compaq-nonstopux ++ exit ;; ++ BS2000:POSIX*:*:*) ++ echo bs2000-siemens-sysv ++ exit ;; ++ DS/*:UNIX_System_V:*:*) ++ echo ${UNAME_MACHINE}-${UNAME_SYSTEM}-${UNAME_RELEASE} ++ exit ;; ++ *:Plan9:*:*) ++ # "uname -m" is not consistent, so use $cputype instead. 386 ++ # is converted to i386 for consistency with other x86 ++ # operating systems. ++ if test "$cputype" = "386"; then ++ UNAME_MACHINE=i386 ++ else ++ UNAME_MACHINE="$cputype" ++ fi ++ echo ${UNAME_MACHINE}-unknown-plan9 ++ exit ;; ++ *:TOPS-10:*:*) ++ echo pdp10-unknown-tops10 ++ exit ;; ++ *:TENEX:*:*) ++ echo pdp10-unknown-tenex ++ exit ;; ++ KS10:TOPS-20:*:* | KL10:TOPS-20:*:* | TYPE4:TOPS-20:*:*) ++ echo pdp10-dec-tops20 ++ exit ;; ++ XKL-1:TOPS-20:*:* | TYPE5:TOPS-20:*:*) ++ echo pdp10-xkl-tops20 ++ exit ;; ++ *:TOPS-20:*:*) ++ echo pdp10-unknown-tops20 ++ exit ;; ++ *:ITS:*:*) ++ echo pdp10-unknown-its ++ exit ;; ++ SEI:*:*:SEIUX) ++ echo mips-sei-seiux${UNAME_RELEASE} ++ exit ;; ++ *:DragonFly:*:*) ++ echo ${UNAME_MACHINE}-unknown-dragonfly`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ++ exit ;; ++ *:*VMS:*:*) ++ UNAME_MACHINE=`(uname -p) 2>/dev/null` ++ case "${UNAME_MACHINE}" in ++ A*) echo alpha-dec-vms ; exit ;; ++ I*) echo ia64-dec-vms ; exit ;; ++ V*) echo vax-dec-vms ; exit ;; ++ esac ;; ++ *:XENIX:*:SysV) ++ echo i386-pc-xenix ++ exit ;; ++ i*86:skyos:*:*) ++ echo ${UNAME_MACHINE}-pc-skyos`echo ${UNAME_RELEASE}` | sed -e 's/ .*$//' ++ exit ;; ++ i*86:rdos:*:*) ++ echo ${UNAME_MACHINE}-pc-rdos ++ exit ;; ++ i*86:AROS:*:*) ++ echo ${UNAME_MACHINE}-pc-aros ++ exit ;; ++ x86_64:VMkernel:*:*) ++ echo ${UNAME_MACHINE}-unknown-esx ++ exit ;; ++esac ++ ++cat >&2 < in order to provide the needed ++information to handle your system. ++ ++config.guess timestamp = $timestamp ++ ++uname -m = `(uname -m) 2>/dev/null || echo unknown` ++uname -r = `(uname -r) 2>/dev/null || echo unknown` ++uname -s = `(uname -s) 2>/dev/null || echo unknown` ++uname -v = `(uname -v) 2>/dev/null || echo unknown` ++ ++/usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null` ++/bin/uname -X = `(/bin/uname -X) 2>/dev/null` ++ ++hostinfo = `(hostinfo) 2>/dev/null` ++/bin/universe = `(/bin/universe) 2>/dev/null` ++/usr/bin/arch -k = `(/usr/bin/arch -k) 2>/dev/null` ++/bin/arch = `(/bin/arch) 2>/dev/null` ++/usr/bin/oslevel = `(/usr/bin/oslevel) 2>/dev/null` ++/usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null` ++ ++UNAME_MACHINE = ${UNAME_MACHINE} ++UNAME_RELEASE = ${UNAME_RELEASE} ++UNAME_SYSTEM = ${UNAME_SYSTEM} ++UNAME_VERSION = ${UNAME_VERSION} ++EOF ++ ++exit 1 ++ ++# Local variables: ++# eval: (add-hook 'write-file-hooks 'time-stamp) ++# time-stamp-start: "timestamp='" ++# time-stamp-format: "%:y-%02m-%02d" ++# time-stamp-end: "'" ++# End: +--- /dev/null ++++ filtergen-0.12.7/config.sub.dh-orig +@@ -0,0 +1,1813 @@ ++#! /bin/sh ++# Configuration validation subroutine script. ++# Copyright 1992-2015 Free Software Foundation, Inc. ++ ++timestamp='2015-08-20' ++ ++# This file 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 3 of the License, 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, see . ++# ++# As a special exception to the GNU General Public License, if you ++# distribute this file as part of a program that contains a ++# configuration script generated by Autoconf, you may include it under ++# the same distribution terms that you use for the rest of that ++# program. This Exception is an additional permission under section 7 ++# of the GNU General Public License, version 3 ("GPLv3"). ++ ++ ++# Please send patches to . ++# ++# Configuration subroutine to validate and canonicalize a configuration type. ++# Supply the specified configuration type as an argument. ++# If it is invalid, we print an error message on stderr and exit with code 1. ++# Otherwise, we print the canonical config type on stdout and succeed. ++ ++# You can get the latest version of this script from: ++# http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.sub;hb=HEAD ++ ++# This file is supposed to be the same for all GNU packages ++# and recognize all the CPU types, system types and aliases ++# that are meaningful with *any* GNU software. ++# Each package is responsible for reporting which valid configurations ++# it does not support. The user should be able to distinguish ++# a failure to support a valid configuration from a meaningless ++# configuration. ++ ++# The goal of this file is to map all the various variations of a given ++# machine specification into a single specification in the form: ++# CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM ++# or in some cases, the newer four-part form: ++# CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM ++# It is wrong to echo any other type of specification. ++ ++me=`echo "$0" | sed -e 's,.*/,,'` ++ ++usage="\ ++Usage: $0 [OPTION] CPU-MFR-OPSYS ++ $0 [OPTION] ALIAS ++ ++Canonicalize a configuration name. ++ ++Operation modes: ++ -h, --help print this help, then exit ++ -t, --time-stamp print date of last modification, then exit ++ -v, --version print version number, then exit ++ ++Report bugs and patches to ." ++ ++version="\ ++GNU config.sub ($timestamp) ++ ++Copyright 1992-2015 Free Software Foundation, Inc. ++ ++This is free software; see the source for copying conditions. There is NO ++warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE." ++ ++help=" ++Try \`$me --help' for more information." ++ ++# Parse command line ++while test $# -gt 0 ; do ++ case $1 in ++ --time-stamp | --time* | -t ) ++ echo "$timestamp" ; exit ;; ++ --version | -v ) ++ echo "$version" ; exit ;; ++ --help | --h* | -h ) ++ echo "$usage"; exit ;; ++ -- ) # Stop option processing ++ shift; break ;; ++ - ) # Use stdin as input. ++ break ;; ++ -* ) ++ echo "$me: invalid option $1$help" ++ exit 1 ;; ++ ++ *local*) ++ # First pass through any local machine types. ++ echo $1 ++ exit ;; ++ ++ * ) ++ break ;; ++ esac ++done ++ ++case $# in ++ 0) echo "$me: missing argument$help" >&2 ++ exit 1;; ++ 1) ;; ++ *) echo "$me: too many arguments$help" >&2 ++ exit 1;; ++esac ++ ++# Separate what the user gave into CPU-COMPANY and OS or KERNEL-OS (if any). ++# Here we must recognize all the valid KERNEL-OS combinations. ++maybe_os=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\2/'` ++case $maybe_os in ++ nto-qnx* | linux-gnu* | linux-android* | linux-dietlibc | linux-newlib* | \ ++ linux-musl* | linux-uclibc* | uclinux-uclibc* | uclinux-gnu* | kfreebsd*-gnu* | \ ++ knetbsd*-gnu* | netbsd*-gnu* | netbsd*-eabi* | \ ++ kopensolaris*-gnu* | \ ++ storm-chaos* | os2-emx* | rtmk-nova*) ++ os=-$maybe_os ++ basic_machine=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'` ++ ;; ++ android-linux) ++ os=-linux-android ++ basic_machine=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'`-unknown ++ ;; ++ *) ++ basic_machine=`echo $1 | sed 's/-[^-]*$//'` ++ if [ $basic_machine != $1 ] ++ then os=`echo $1 | sed 's/.*-/-/'` ++ else os=; fi ++ ;; ++esac ++ ++### Let's recognize common machines as not being operating systems so ++### that things like config.sub decstation-3100 work. We also ++### recognize some manufacturers as not being operating systems, so we ++### can provide default operating systems below. ++case $os in ++ -sun*os*) ++ # Prevent following clause from handling this invalid input. ++ ;; ++ -dec* | -mips* | -sequent* | -encore* | -pc532* | -sgi* | -sony* | \ ++ -att* | -7300* | -3300* | -delta* | -motorola* | -sun[234]* | \ ++ -unicom* | -ibm* | -next | -hp | -isi* | -apollo | -altos* | \ ++ -convergent* | -ncr* | -news | -32* | -3600* | -3100* | -hitachi* |\ ++ -c[123]* | -convex* | -sun | -crds | -omron* | -dg | -ultra | -tti* | \ ++ -harris | -dolphin | -highlevel | -gould | -cbm | -ns | -masscomp | \ ++ -apple | -axis | -knuth | -cray | -microblaze*) ++ os= ++ basic_machine=$1 ++ ;; ++ -bluegene*) ++ os=-cnk ++ ;; ++ -sim | -cisco | -oki | -wec | -winbond) ++ os= ++ basic_machine=$1 ++ ;; ++ -scout) ++ ;; ++ -wrs) ++ os=-vxworks ++ basic_machine=$1 ++ ;; ++ -chorusos*) ++ os=-chorusos ++ basic_machine=$1 ++ ;; ++ -chorusrdb) ++ os=-chorusrdb ++ basic_machine=$1 ++ ;; ++ -hiux*) ++ os=-hiuxwe2 ++ ;; ++ -sco6) ++ os=-sco5v6 ++ basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ++ ;; ++ -sco5) ++ os=-sco3.2v5 ++ basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ++ ;; ++ -sco4) ++ os=-sco3.2v4 ++ basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ++ ;; ++ -sco3.2.[4-9]*) ++ os=`echo $os | sed -e 's/sco3.2./sco3.2v/'` ++ basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ++ ;; ++ -sco3.2v[4-9]*) ++ # Don't forget version if it is 3.2v4 or newer. ++ basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ++ ;; ++ -sco5v6*) ++ # Don't forget version if it is 3.2v4 or newer. ++ basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ++ ;; ++ -sco*) ++ os=-sco3.2v2 ++ basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ++ ;; ++ -udk*) ++ basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ++ ;; ++ -isc) ++ os=-isc2.2 ++ basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ++ ;; ++ -clix*) ++ basic_machine=clipper-intergraph ++ ;; ++ -isc*) ++ basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ++ ;; ++ -lynx*178) ++ os=-lynxos178 ++ ;; ++ -lynx*5) ++ os=-lynxos5 ++ ;; ++ -lynx*) ++ os=-lynxos ++ ;; ++ -ptx*) ++ basic_machine=`echo $1 | sed -e 's/86-.*/86-sequent/'` ++ ;; ++ -windowsnt*) ++ os=`echo $os | sed -e 's/windowsnt/winnt/'` ++ ;; ++ -psos*) ++ os=-psos ++ ;; ++ -mint | -mint[0-9]*) ++ basic_machine=m68k-atari ++ os=-mint ++ ;; ++esac ++ ++# Decode aliases for certain CPU-COMPANY combinations. ++case $basic_machine in ++ # Recognize the basic CPU types without company name. ++ # Some are omitted here because they have special meanings below. ++ 1750a | 580 \ ++ | a29k \ ++ | aarch64 | aarch64_be \ ++ | alpha | alphaev[4-8] | alphaev56 | alphaev6[78] | alphapca5[67] \ ++ | alpha64 | alpha64ev[4-8] | alpha64ev56 | alpha64ev6[78] | alpha64pca5[67] \ ++ | am33_2.0 \ ++ | arc | arceb \ ++ | arm | arm[bl]e | arme[lb] | armv[2-8] | armv[3-8][lb] | armv7[arm] \ ++ | avr | avr32 \ ++ | ba \ ++ | be32 | be64 \ ++ | bfin \ ++ | c4x | c8051 | clipper \ ++ | d10v | d30v | dlx | dsp16xx \ ++ | e2k | epiphany \ ++ | fido | fr30 | frv | ft32 \ ++ | h8300 | h8500 | hppa | hppa1.[01] | hppa2.0 | hppa2.0[nw] | hppa64 \ ++ | hexagon \ ++ | i370 | i860 | i960 | ia64 \ ++ | ip2k | iq2000 \ ++ | k1om \ ++ | le32 | le64 \ ++ | lm32 \ ++ | m32c | m32r | m32rle | m68000 | m68k | m88k \ ++ | maxq | mb | microblaze | microblazeel | mcore | mep | metag \ ++ | mips | mipsbe | mipseb | mipsel | mipsle \ ++ | mips16 \ ++ | mips64 | mips64el \ ++ | mips64octeon | mips64octeonel \ ++ | mips64orion | mips64orionel \ ++ | mips64r5900 | mips64r5900el \ ++ | mips64vr | mips64vrel \ ++ | mips64vr4100 | mips64vr4100el \ ++ | mips64vr4300 | mips64vr4300el \ ++ | mips64vr5000 | mips64vr5000el \ ++ | mips64vr5900 | mips64vr5900el \ ++ | mipsisa32 | mipsisa32el \ ++ | mipsisa32r2 | mipsisa32r2el \ ++ | mipsisa32r6 | mipsisa32r6el \ ++ | mipsisa64 | mipsisa64el \ ++ | mipsisa64r2 | mipsisa64r2el \ ++ | mipsisa64r6 | mipsisa64r6el \ ++ | mipsisa64sb1 | mipsisa64sb1el \ ++ | mipsisa64sr71k | mipsisa64sr71kel \ ++ | mipsr5900 | mipsr5900el \ ++ | mipstx39 | mipstx39el \ ++ | mn10200 | mn10300 \ ++ | moxie \ ++ | mt \ ++ | msp430 \ ++ | nds32 | nds32le | nds32be \ ++ | nios | nios2 | nios2eb | nios2el \ ++ | ns16k | ns32k \ ++ | open8 | or1k | or1knd | or32 \ ++ | pdp10 | pdp11 | pj | pjl \ ++ | powerpc | powerpc64 | powerpc64le | powerpcle \ ++ | pyramid \ ++ | riscv32 | riscv64 \ ++ | rl78 | rx \ ++ | score \ ++ | sh | sh[1234] | sh[24]a | sh[24]aeb | sh[23]e | sh[234]eb | sheb | shbe | shle | sh[1234]le | sh3ele \ ++ | sh64 | sh64le \ ++ | sparc | sparc64 | sparc64b | sparc64v | sparc86x | sparclet | sparclite \ ++ | sparcv8 | sparcv9 | sparcv9b | sparcv9v \ ++ | spu \ ++ | tahoe | tic4x | tic54x | tic55x | tic6x | tic80 | tron \ ++ | ubicom32 \ ++ | v850 | v850e | v850e1 | v850e2 | v850es | v850e2v3 \ ++ | visium \ ++ | we32k \ ++ | x86 | xc16x | xstormy16 | xtensa \ ++ | z8k | z80) ++ basic_machine=$basic_machine-unknown ++ ;; ++ c54x) ++ basic_machine=tic54x-unknown ++ ;; ++ c55x) ++ basic_machine=tic55x-unknown ++ ;; ++ c6x) ++ basic_machine=tic6x-unknown ++ ;; ++ leon|leon[3-9]) ++ basic_machine=sparc-$basic_machine ++ ;; ++ m6811 | m68hc11 | m6812 | m68hc12 | m68hcs12x | nvptx | picochip) ++ basic_machine=$basic_machine-unknown ++ os=-none ++ ;; ++ m88110 | m680[12346]0 | m683?2 | m68360 | m5200 | v70 | w65 | z8k) ++ ;; ++ ms1) ++ basic_machine=mt-unknown ++ ;; ++ ++ strongarm | thumb | xscale) ++ basic_machine=arm-unknown ++ ;; ++ xgate) ++ basic_machine=$basic_machine-unknown ++ os=-none ++ ;; ++ xscaleeb) ++ basic_machine=armeb-unknown ++ ;; ++ ++ xscaleel) ++ basic_machine=armel-unknown ++ ;; ++ ++ # We use `pc' rather than `unknown' ++ # because (1) that's what they normally are, and ++ # (2) the word "unknown" tends to confuse beginning users. ++ i*86 | x86_64) ++ basic_machine=$basic_machine-pc ++ ;; ++ # Object if more than one company name word. ++ *-*-*) ++ echo Invalid configuration \`$1\': machine \`$basic_machine\' not recognized 1>&2 ++ exit 1 ++ ;; ++ # Recognize the basic CPU types with company name. ++ 580-* \ ++ | a29k-* \ ++ | aarch64-* | aarch64_be-* \ ++ | alpha-* | alphaev[4-8]-* | alphaev56-* | alphaev6[78]-* \ ++ | alpha64-* | alpha64ev[4-8]-* | alpha64ev56-* | alpha64ev6[78]-* \ ++ | alphapca5[67]-* | alpha64pca5[67]-* | arc-* | arceb-* \ ++ | arm-* | armbe-* | armle-* | armeb-* | armv*-* \ ++ | avr-* | avr32-* \ ++ | ba-* \ ++ | be32-* | be64-* \ ++ | bfin-* | bs2000-* \ ++ | c[123]* | c30-* | [cjt]90-* | c4x-* \ ++ | c8051-* | clipper-* | craynv-* | cydra-* \ ++ | d10v-* | d30v-* | dlx-* \ ++ | e2k-* | elxsi-* \ ++ | f30[01]-* | f700-* | fido-* | fr30-* | frv-* | fx80-* \ ++ | h8300-* | h8500-* \ ++ | hppa-* | hppa1.[01]-* | hppa2.0-* | hppa2.0[nw]-* | hppa64-* \ ++ | hexagon-* \ ++ | i*86-* | i860-* | i960-* | ia64-* \ ++ | ip2k-* | iq2000-* \ ++ | k1om-* \ ++ | le32-* | le64-* \ ++ | lm32-* \ ++ | m32c-* | m32r-* | m32rle-* \ ++ | m68000-* | m680[012346]0-* | m68360-* | m683?2-* | m68k-* \ ++ | m88110-* | m88k-* | maxq-* | mcore-* | metag-* \ ++ | microblaze-* | microblazeel-* \ ++ | mips-* | mipsbe-* | mipseb-* | mipsel-* | mipsle-* \ ++ | mips16-* \ ++ | mips64-* | mips64el-* \ ++ | mips64octeon-* | mips64octeonel-* \ ++ | mips64orion-* | mips64orionel-* \ ++ | mips64r5900-* | mips64r5900el-* \ ++ | mips64vr-* | mips64vrel-* \ ++ | mips64vr4100-* | mips64vr4100el-* \ ++ | mips64vr4300-* | mips64vr4300el-* \ ++ | mips64vr5000-* | mips64vr5000el-* \ ++ | mips64vr5900-* | mips64vr5900el-* \ ++ | mipsisa32-* | mipsisa32el-* \ ++ | mipsisa32r2-* | mipsisa32r2el-* \ ++ | mipsisa32r6-* | mipsisa32r6el-* \ ++ | mipsisa64-* | mipsisa64el-* \ ++ | mipsisa64r2-* | mipsisa64r2el-* \ ++ | mipsisa64r6-* | mipsisa64r6el-* \ ++ | mipsisa64sb1-* | mipsisa64sb1el-* \ ++ | mipsisa64sr71k-* | mipsisa64sr71kel-* \ ++ | mipsr5900-* | mipsr5900el-* \ ++ | mipstx39-* | mipstx39el-* \ ++ | mmix-* \ ++ | mt-* \ ++ | msp430-* \ ++ | nds32-* | nds32le-* | nds32be-* \ ++ | nios-* | nios2-* | nios2eb-* | nios2el-* \ ++ | none-* | np1-* | ns16k-* | ns32k-* \ ++ | open8-* \ ++ | or1k*-* \ ++ | orion-* \ ++ | pdp10-* | pdp11-* | pj-* | pjl-* | pn-* | power-* \ ++ | powerpc-* | powerpc64-* | powerpc64le-* | powerpcle-* \ ++ | pyramid-* \ ++ | riscv32-* | riscv64-* \ ++ | rl78-* | romp-* | rs6000-* | rx-* \ ++ | sh-* | sh[1234]-* | sh[24]a-* | sh[24]aeb-* | sh[23]e-* | sh[34]eb-* | sheb-* | shbe-* \ ++ | shle-* | sh[1234]le-* | sh3ele-* | sh64-* | sh64le-* \ ++ | sparc-* | sparc64-* | sparc64b-* | sparc64v-* | sparc86x-* | sparclet-* \ ++ | sparclite-* \ ++ | sparcv8-* | sparcv9-* | sparcv9b-* | sparcv9v-* | sv1-* | sx*-* \ ++ | tahoe-* \ ++ | tic30-* | tic4x-* | tic54x-* | tic55x-* | tic6x-* | tic80-* \ ++ | tile*-* \ ++ | tron-* \ ++ | ubicom32-* \ ++ | v850-* | v850e-* | v850e1-* | v850es-* | v850e2-* | v850e2v3-* \ ++ | vax-* \ ++ | visium-* \ ++ | we32k-* \ ++ | x86-* | x86_64-* | xc16x-* | xps100-* \ ++ | xstormy16-* | xtensa*-* \ ++ | ymp-* \ ++ | z8k-* | z80-*) ++ ;; ++ # Recognize the basic CPU types without company name, with glob match. ++ xtensa*) ++ basic_machine=$basic_machine-unknown ++ ;; ++ # Recognize the various machine names and aliases which stand ++ # for a CPU type and a company and sometimes even an OS. ++ 386bsd) ++ basic_machine=i386-unknown ++ os=-bsd ++ ;; ++ 3b1 | 7300 | 7300-att | att-7300 | pc7300 | safari | unixpc) ++ basic_machine=m68000-att ++ ;; ++ 3b*) ++ basic_machine=we32k-att ++ ;; ++ a29khif) ++ basic_machine=a29k-amd ++ os=-udi ++ ;; ++ abacus) ++ basic_machine=abacus-unknown ++ ;; ++ adobe68k) ++ basic_machine=m68010-adobe ++ os=-scout ++ ;; ++ alliant | fx80) ++ basic_machine=fx80-alliant ++ ;; ++ altos | altos3068) ++ basic_machine=m68k-altos ++ ;; ++ am29k) ++ basic_machine=a29k-none ++ os=-bsd ++ ;; ++ amd64) ++ basic_machine=x86_64-pc ++ ;; ++ amd64-*) ++ basic_machine=x86_64-`echo $basic_machine | sed 's/^[^-]*-//'` ++ ;; ++ amdahl) ++ basic_machine=580-amdahl ++ os=-sysv ++ ;; ++ amiga | amiga-*) ++ basic_machine=m68k-unknown ++ ;; ++ amigaos | amigados) ++ basic_machine=m68k-unknown ++ os=-amigaos ++ ;; ++ amigaunix | amix) ++ basic_machine=m68k-unknown ++ os=-sysv4 ++ ;; ++ apollo68) ++ basic_machine=m68k-apollo ++ os=-sysv ++ ;; ++ apollo68bsd) ++ basic_machine=m68k-apollo ++ os=-bsd ++ ;; ++ aros) ++ basic_machine=i386-pc ++ os=-aros ++ ;; ++ asmjs) ++ basic_machine=asmjs-unknown ++ ;; ++ aux) ++ basic_machine=m68k-apple ++ os=-aux ++ ;; ++ balance) ++ basic_machine=ns32k-sequent ++ os=-dynix ++ ;; ++ blackfin) ++ basic_machine=bfin-unknown ++ os=-linux ++ ;; ++ blackfin-*) ++ basic_machine=bfin-`echo $basic_machine | sed 's/^[^-]*-//'` ++ os=-linux ++ ;; ++ bluegene*) ++ basic_machine=powerpc-ibm ++ os=-cnk ++ ;; ++ c54x-*) ++ basic_machine=tic54x-`echo $basic_machine | sed 's/^[^-]*-//'` ++ ;; ++ c55x-*) ++ basic_machine=tic55x-`echo $basic_machine | sed 's/^[^-]*-//'` ++ ;; ++ c6x-*) ++ basic_machine=tic6x-`echo $basic_machine | sed 's/^[^-]*-//'` ++ ;; ++ c90) ++ basic_machine=c90-cray ++ os=-unicos ++ ;; ++ cegcc) ++ basic_machine=arm-unknown ++ os=-cegcc ++ ;; ++ convex-c1) ++ basic_machine=c1-convex ++ os=-bsd ++ ;; ++ convex-c2) ++ basic_machine=c2-convex ++ os=-bsd ++ ;; ++ convex-c32) ++ basic_machine=c32-convex ++ os=-bsd ++ ;; ++ convex-c34) ++ basic_machine=c34-convex ++ os=-bsd ++ ;; ++ convex-c38) ++ basic_machine=c38-convex ++ os=-bsd ++ ;; ++ cray | j90) ++ basic_machine=j90-cray ++ os=-unicos ++ ;; ++ craynv) ++ basic_machine=craynv-cray ++ os=-unicosmp ++ ;; ++ cr16 | cr16-*) ++ basic_machine=cr16-unknown ++ os=-elf ++ ;; ++ crds | unos) ++ basic_machine=m68k-crds ++ ;; ++ crisv32 | crisv32-* | etraxfs*) ++ basic_machine=crisv32-axis ++ ;; ++ cris | cris-* | etrax*) ++ basic_machine=cris-axis ++ ;; ++ crx) ++ basic_machine=crx-unknown ++ os=-elf ++ ;; ++ da30 | da30-*) ++ basic_machine=m68k-da30 ++ ;; ++ decstation | decstation-3100 | pmax | pmax-* | pmin | dec3100 | decstatn) ++ basic_machine=mips-dec ++ ;; ++ decsystem10* | dec10*) ++ basic_machine=pdp10-dec ++ os=-tops10 ++ ;; ++ decsystem20* | dec20*) ++ basic_machine=pdp10-dec ++ os=-tops20 ++ ;; ++ delta | 3300 | motorola-3300 | motorola-delta \ ++ | 3300-motorola | delta-motorola) ++ basic_machine=m68k-motorola ++ ;; ++ delta88) ++ basic_machine=m88k-motorola ++ os=-sysv3 ++ ;; ++ dicos) ++ basic_machine=i686-pc ++ os=-dicos ++ ;; ++ djgpp) ++ basic_machine=i586-pc ++ os=-msdosdjgpp ++ ;; ++ dpx20 | dpx20-*) ++ basic_machine=rs6000-bull ++ os=-bosx ++ ;; ++ dpx2* | dpx2*-bull) ++ basic_machine=m68k-bull ++ os=-sysv3 ++ ;; ++ ebmon29k) ++ basic_machine=a29k-amd ++ os=-ebmon ++ ;; ++ elxsi) ++ basic_machine=elxsi-elxsi ++ os=-bsd ++ ;; ++ encore | umax | mmax) ++ basic_machine=ns32k-encore ++ ;; ++ es1800 | OSE68k | ose68k | ose | OSE) ++ basic_machine=m68k-ericsson ++ os=-ose ++ ;; ++ fx2800) ++ basic_machine=i860-alliant ++ ;; ++ genix) ++ basic_machine=ns32k-ns ++ ;; ++ gmicro) ++ basic_machine=tron-gmicro ++ os=-sysv ++ ;; ++ go32) ++ basic_machine=i386-pc ++ os=-go32 ++ ;; ++ h3050r* | hiux*) ++ basic_machine=hppa1.1-hitachi ++ os=-hiuxwe2 ++ ;; ++ h8300hms) ++ basic_machine=h8300-hitachi ++ os=-hms ++ ;; ++ h8300xray) ++ basic_machine=h8300-hitachi ++ os=-xray ++ ;; ++ h8500hms) ++ basic_machine=h8500-hitachi ++ os=-hms ++ ;; ++ harris) ++ basic_machine=m88k-harris ++ os=-sysv3 ++ ;; ++ hp300-*) ++ basic_machine=m68k-hp ++ ;; ++ hp300bsd) ++ basic_machine=m68k-hp ++ os=-bsd ++ ;; ++ hp300hpux) ++ basic_machine=m68k-hp ++ os=-hpux ++ ;; ++ hp3k9[0-9][0-9] | hp9[0-9][0-9]) ++ basic_machine=hppa1.0-hp ++ ;; ++ hp9k2[0-9][0-9] | hp9k31[0-9]) ++ basic_machine=m68000-hp ++ ;; ++ hp9k3[2-9][0-9]) ++ basic_machine=m68k-hp ++ ;; ++ hp9k6[0-9][0-9] | hp6[0-9][0-9]) ++ basic_machine=hppa1.0-hp ++ ;; ++ hp9k7[0-79][0-9] | hp7[0-79][0-9]) ++ basic_machine=hppa1.1-hp ++ ;; ++ hp9k78[0-9] | hp78[0-9]) ++ # FIXME: really hppa2.0-hp ++ basic_machine=hppa1.1-hp ++ ;; ++ hp9k8[67]1 | hp8[67]1 | hp9k80[24] | hp80[24] | hp9k8[78]9 | hp8[78]9 | hp9k893 | hp893) ++ # FIXME: really hppa2.0-hp ++ basic_machine=hppa1.1-hp ++ ;; ++ hp9k8[0-9][13679] | hp8[0-9][13679]) ++ basic_machine=hppa1.1-hp ++ ;; ++ hp9k8[0-9][0-9] | hp8[0-9][0-9]) ++ basic_machine=hppa1.0-hp ++ ;; ++ hppa-next) ++ os=-nextstep3 ++ ;; ++ hppaosf) ++ basic_machine=hppa1.1-hp ++ os=-osf ++ ;; ++ hppro) ++ basic_machine=hppa1.1-hp ++ os=-proelf ++ ;; ++ i370-ibm* | ibm*) ++ basic_machine=i370-ibm ++ ;; ++ i*86v32) ++ basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` ++ os=-sysv32 ++ ;; ++ i*86v4*) ++ basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` ++ os=-sysv4 ++ ;; ++ i*86v) ++ basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` ++ os=-sysv ++ ;; ++ i*86sol2) ++ basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` ++ os=-solaris2 ++ ;; ++ i386mach) ++ basic_machine=i386-mach ++ os=-mach ++ ;; ++ i386-vsta | vsta) ++ basic_machine=i386-unknown ++ os=-vsta ++ ;; ++ iris | iris4d) ++ basic_machine=mips-sgi ++ case $os in ++ -irix*) ++ ;; ++ *) ++ os=-irix4 ++ ;; ++ esac ++ ;; ++ isi68 | isi) ++ basic_machine=m68k-isi ++ os=-sysv ++ ;; ++ leon-*|leon[3-9]-*) ++ basic_machine=sparc-`echo $basic_machine | sed 's/-.*//'` ++ ;; ++ m68knommu) ++ basic_machine=m68k-unknown ++ os=-linux ++ ;; ++ m68knommu-*) ++ basic_machine=m68k-`echo $basic_machine | sed 's/^[^-]*-//'` ++ os=-linux ++ ;; ++ m88k-omron*) ++ basic_machine=m88k-omron ++ ;; ++ magnum | m3230) ++ basic_machine=mips-mips ++ os=-sysv ++ ;; ++ merlin) ++ basic_machine=ns32k-utek ++ os=-sysv ++ ;; ++ microblaze*) ++ basic_machine=microblaze-xilinx ++ ;; ++ mingw64) ++ basic_machine=x86_64-pc ++ os=-mingw64 ++ ;; ++ mingw32) ++ basic_machine=i686-pc ++ os=-mingw32 ++ ;; ++ mingw32ce) ++ basic_machine=arm-unknown ++ os=-mingw32ce ++ ;; ++ miniframe) ++ basic_machine=m68000-convergent ++ ;; ++ *mint | -mint[0-9]* | *MiNT | *MiNT[0-9]*) ++ basic_machine=m68k-atari ++ os=-mint ++ ;; ++ mips3*-*) ++ basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'` ++ ;; ++ mips3*) ++ basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'`-unknown ++ ;; ++ monitor) ++ basic_machine=m68k-rom68k ++ os=-coff ++ ;; ++ morphos) ++ basic_machine=powerpc-unknown ++ os=-morphos ++ ;; ++ moxiebox) ++ basic_machine=moxie-unknown ++ os=-moxiebox ++ ;; ++ msdos) ++ basic_machine=i386-pc ++ os=-msdos ++ ;; ++ ms1-*) ++ basic_machine=`echo $basic_machine | sed -e 's/ms1-/mt-/'` ++ ;; ++ msys) ++ basic_machine=i686-pc ++ os=-msys ++ ;; ++ mvs) ++ basic_machine=i370-ibm ++ os=-mvs ++ ;; ++ nacl) ++ basic_machine=le32-unknown ++ os=-nacl ++ ;; ++ ncr3000) ++ basic_machine=i486-ncr ++ os=-sysv4 ++ ;; ++ netbsd386) ++ basic_machine=i386-unknown ++ os=-netbsd ++ ;; ++ netwinder) ++ basic_machine=armv4l-rebel ++ os=-linux ++ ;; ++ news | news700 | news800 | news900) ++ basic_machine=m68k-sony ++ os=-newsos ++ ;; ++ news1000) ++ basic_machine=m68030-sony ++ os=-newsos ++ ;; ++ news-3600 | risc-news) ++ basic_machine=mips-sony ++ os=-newsos ++ ;; ++ necv70) ++ basic_machine=v70-nec ++ os=-sysv ++ ;; ++ next | m*-next ) ++ basic_machine=m68k-next ++ case $os in ++ -nextstep* ) ++ ;; ++ -ns2*) ++ os=-nextstep2 ++ ;; ++ *) ++ os=-nextstep3 ++ ;; ++ esac ++ ;; ++ nh3000) ++ basic_machine=m68k-harris ++ os=-cxux ++ ;; ++ nh[45]000) ++ basic_machine=m88k-harris ++ os=-cxux ++ ;; ++ nindy960) ++ basic_machine=i960-intel ++ os=-nindy ++ ;; ++ mon960) ++ basic_machine=i960-intel ++ os=-mon960 ++ ;; ++ nonstopux) ++ basic_machine=mips-compaq ++ os=-nonstopux ++ ;; ++ np1) ++ basic_machine=np1-gould ++ ;; ++ neo-tandem) ++ basic_machine=neo-tandem ++ ;; ++ nse-tandem) ++ basic_machine=nse-tandem ++ ;; ++ nsr-tandem) ++ basic_machine=nsr-tandem ++ ;; ++ op50n-* | op60c-*) ++ basic_machine=hppa1.1-oki ++ os=-proelf ++ ;; ++ openrisc | openrisc-*) ++ basic_machine=or32-unknown ++ ;; ++ os400) ++ basic_machine=powerpc-ibm ++ os=-os400 ++ ;; ++ OSE68000 | ose68000) ++ basic_machine=m68000-ericsson ++ os=-ose ++ ;; ++ os68k) ++ basic_machine=m68k-none ++ os=-os68k ++ ;; ++ pa-hitachi) ++ basic_machine=hppa1.1-hitachi ++ os=-hiuxwe2 ++ ;; ++ paragon) ++ basic_machine=i860-intel ++ os=-osf ++ ;; ++ parisc) ++ basic_machine=hppa-unknown ++ os=-linux ++ ;; ++ parisc-*) ++ basic_machine=hppa-`echo $basic_machine | sed 's/^[^-]*-//'` ++ os=-linux ++ ;; ++ pbd) ++ basic_machine=sparc-tti ++ ;; ++ pbb) ++ basic_machine=m68k-tti ++ ;; ++ pc532 | pc532-*) ++ basic_machine=ns32k-pc532 ++ ;; ++ pc98) ++ basic_machine=i386-pc ++ ;; ++ pc98-*) ++ basic_machine=i386-`echo $basic_machine | sed 's/^[^-]*-//'` ++ ;; ++ pentium | p5 | k5 | k6 | nexgen | viac3) ++ basic_machine=i586-pc ++ ;; ++ pentiumpro | p6 | 6x86 | athlon | athlon_*) ++ basic_machine=i686-pc ++ ;; ++ pentiumii | pentium2 | pentiumiii | pentium3) ++ basic_machine=i686-pc ++ ;; ++ pentium4) ++ basic_machine=i786-pc ++ ;; ++ pentium-* | p5-* | k5-* | k6-* | nexgen-* | viac3-*) ++ basic_machine=i586-`echo $basic_machine | sed 's/^[^-]*-//'` ++ ;; ++ pentiumpro-* | p6-* | 6x86-* | athlon-*) ++ basic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'` ++ ;; ++ pentiumii-* | pentium2-* | pentiumiii-* | pentium3-*) ++ basic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'` ++ ;; ++ pentium4-*) ++ basic_machine=i786-`echo $basic_machine | sed 's/^[^-]*-//'` ++ ;; ++ pn) ++ basic_machine=pn-gould ++ ;; ++ power) basic_machine=power-ibm ++ ;; ++ ppc | ppcbe) basic_machine=powerpc-unknown ++ ;; ++ ppc-* | ppcbe-*) ++ basic_machine=powerpc-`echo $basic_machine | sed 's/^[^-]*-//'` ++ ;; ++ ppcle | powerpclittle | ppc-le | powerpc-little) ++ basic_machine=powerpcle-unknown ++ ;; ++ ppcle-* | powerpclittle-*) ++ basic_machine=powerpcle-`echo $basic_machine | sed 's/^[^-]*-//'` ++ ;; ++ ppc64) basic_machine=powerpc64-unknown ++ ;; ++ ppc64-*) basic_machine=powerpc64-`echo $basic_machine | sed 's/^[^-]*-//'` ++ ;; ++ ppc64le | powerpc64little | ppc64-le | powerpc64-little) ++ basic_machine=powerpc64le-unknown ++ ;; ++ ppc64le-* | powerpc64little-*) ++ basic_machine=powerpc64le-`echo $basic_machine | sed 's/^[^-]*-//'` ++ ;; ++ ps2) ++ basic_machine=i386-ibm ++ ;; ++ pw32) ++ basic_machine=i586-unknown ++ os=-pw32 ++ ;; ++ rdos | rdos64) ++ basic_machine=x86_64-pc ++ os=-rdos ++ ;; ++ rdos32) ++ basic_machine=i386-pc ++ os=-rdos ++ ;; ++ rom68k) ++ basic_machine=m68k-rom68k ++ os=-coff ++ ;; ++ rm[46]00) ++ basic_machine=mips-siemens ++ ;; ++ rtpc | rtpc-*) ++ basic_machine=romp-ibm ++ ;; ++ s390 | s390-*) ++ basic_machine=s390-ibm ++ ;; ++ s390x | s390x-*) ++ basic_machine=s390x-ibm ++ ;; ++ sa29200) ++ basic_machine=a29k-amd ++ os=-udi ++ ;; ++ sb1) ++ basic_machine=mipsisa64sb1-unknown ++ ;; ++ sb1el) ++ basic_machine=mipsisa64sb1el-unknown ++ ;; ++ sde) ++ basic_machine=mipsisa32-sde ++ os=-elf ++ ;; ++ sei) ++ basic_machine=mips-sei ++ os=-seiux ++ ;; ++ sequent) ++ basic_machine=i386-sequent ++ ;; ++ sh) ++ basic_machine=sh-hitachi ++ os=-hms ++ ;; ++ sh5el) ++ basic_machine=sh5le-unknown ++ ;; ++ sh64) ++ basic_machine=sh64-unknown ++ ;; ++ sparclite-wrs | simso-wrs) ++ basic_machine=sparclite-wrs ++ os=-vxworks ++ ;; ++ sps7) ++ basic_machine=m68k-bull ++ os=-sysv2 ++ ;; ++ spur) ++ basic_machine=spur-unknown ++ ;; ++ st2000) ++ basic_machine=m68k-tandem ++ ;; ++ stratus) ++ basic_machine=i860-stratus ++ os=-sysv4 ++ ;; ++ strongarm-* | thumb-*) ++ basic_machine=arm-`echo $basic_machine | sed 's/^[^-]*-//'` ++ ;; ++ sun2) ++ basic_machine=m68000-sun ++ ;; ++ sun2os3) ++ basic_machine=m68000-sun ++ os=-sunos3 ++ ;; ++ sun2os4) ++ basic_machine=m68000-sun ++ os=-sunos4 ++ ;; ++ sun3os3) ++ basic_machine=m68k-sun ++ os=-sunos3 ++ ;; ++ sun3os4) ++ basic_machine=m68k-sun ++ os=-sunos4 ++ ;; ++ sun4os3) ++ basic_machine=sparc-sun ++ os=-sunos3 ++ ;; ++ sun4os4) ++ basic_machine=sparc-sun ++ os=-sunos4 ++ ;; ++ sun4sol2) ++ basic_machine=sparc-sun ++ os=-solaris2 ++ ;; ++ sun3 | sun3-*) ++ basic_machine=m68k-sun ++ ;; ++ sun4) ++ basic_machine=sparc-sun ++ ;; ++ sun386 | sun386i | roadrunner) ++ basic_machine=i386-sun ++ ;; ++ sv1) ++ basic_machine=sv1-cray ++ os=-unicos ++ ;; ++ symmetry) ++ basic_machine=i386-sequent ++ os=-dynix ++ ;; ++ t3e) ++ basic_machine=alphaev5-cray ++ os=-unicos ++ ;; ++ t90) ++ basic_machine=t90-cray ++ os=-unicos ++ ;; ++ tile*) ++ basic_machine=$basic_machine-unknown ++ os=-linux-gnu ++ ;; ++ tx39) ++ basic_machine=mipstx39-unknown ++ ;; ++ tx39el) ++ basic_machine=mipstx39el-unknown ++ ;; ++ toad1) ++ basic_machine=pdp10-xkl ++ os=-tops20 ++ ;; ++ tower | tower-32) ++ basic_machine=m68k-ncr ++ ;; ++ tpf) ++ basic_machine=s390x-ibm ++ os=-tpf ++ ;; ++ udi29k) ++ basic_machine=a29k-amd ++ os=-udi ++ ;; ++ ultra3) ++ basic_machine=a29k-nyu ++ os=-sym1 ++ ;; ++ v810 | necv810) ++ basic_machine=v810-nec ++ os=-none ++ ;; ++ vaxv) ++ basic_machine=vax-dec ++ os=-sysv ++ ;; ++ vms) ++ basic_machine=vax-dec ++ os=-vms ++ ;; ++ vpp*|vx|vx-*) ++ basic_machine=f301-fujitsu ++ ;; ++ vxworks960) ++ basic_machine=i960-wrs ++ os=-vxworks ++ ;; ++ vxworks68) ++ basic_machine=m68k-wrs ++ os=-vxworks ++ ;; ++ vxworks29k) ++ basic_machine=a29k-wrs ++ os=-vxworks ++ ;; ++ w65*) ++ basic_machine=w65-wdc ++ os=-none ++ ;; ++ w89k-*) ++ basic_machine=hppa1.1-winbond ++ os=-proelf ++ ;; ++ xbox) ++ basic_machine=i686-pc ++ os=-mingw32 ++ ;; ++ xps | xps100) ++ basic_machine=xps100-honeywell ++ ;; ++ xscale-* | xscalee[bl]-*) ++ basic_machine=`echo $basic_machine | sed 's/^xscale/arm/'` ++ ;; ++ ymp) ++ basic_machine=ymp-cray ++ os=-unicos ++ ;; ++ z8k-*-coff) ++ basic_machine=z8k-unknown ++ os=-sim ++ ;; ++ z80-*-coff) ++ basic_machine=z80-unknown ++ os=-sim ++ ;; ++ none) ++ basic_machine=none-none ++ os=-none ++ ;; ++ ++# Here we handle the default manufacturer of certain CPU types. It is in ++# some cases the only manufacturer, in others, it is the most popular. ++ w89k) ++ basic_machine=hppa1.1-winbond ++ ;; ++ op50n) ++ basic_machine=hppa1.1-oki ++ ;; ++ op60c) ++ basic_machine=hppa1.1-oki ++ ;; ++ romp) ++ basic_machine=romp-ibm ++ ;; ++ mmix) ++ basic_machine=mmix-knuth ++ ;; ++ rs6000) ++ basic_machine=rs6000-ibm ++ ;; ++ vax) ++ basic_machine=vax-dec ++ ;; ++ pdp10) ++ # there are many clones, so DEC is not a safe bet ++ basic_machine=pdp10-unknown ++ ;; ++ pdp11) ++ basic_machine=pdp11-dec ++ ;; ++ we32k) ++ basic_machine=we32k-att ++ ;; ++ sh[1234] | sh[24]a | sh[24]aeb | sh[34]eb | sh[1234]le | sh[23]ele) ++ basic_machine=sh-unknown ++ ;; ++ sparc | sparcv8 | sparcv9 | sparcv9b | sparcv9v) ++ basic_machine=sparc-sun ++ ;; ++ cydra) ++ basic_machine=cydra-cydrome ++ ;; ++ orion) ++ basic_machine=orion-highlevel ++ ;; ++ orion105) ++ basic_machine=clipper-highlevel ++ ;; ++ mac | mpw | mac-mpw) ++ basic_machine=m68k-apple ++ ;; ++ pmac | pmac-mpw) ++ basic_machine=powerpc-apple ++ ;; ++ *-unknown) ++ # Make sure to match an already-canonicalized machine name. ++ ;; ++ *) ++ echo Invalid configuration \`$1\': machine \`$basic_machine\' not recognized 1>&2 ++ exit 1 ++ ;; ++esac ++ ++# Here we canonicalize certain aliases for manufacturers. ++case $basic_machine in ++ *-digital*) ++ basic_machine=`echo $basic_machine | sed 's/digital.*/dec/'` ++ ;; ++ *-commodore*) ++ basic_machine=`echo $basic_machine | sed 's/commodore.*/cbm/'` ++ ;; ++ *) ++ ;; ++esac ++ ++# Decode manufacturer-specific aliases for certain operating systems. ++ ++if [ x"$os" != x"" ] ++then ++case $os in ++ # First match some system type aliases ++ # that might get confused with valid system types. ++ # -solaris* is a basic system type, with this one exception. ++ -auroraux) ++ os=-auroraux ++ ;; ++ -solaris1 | -solaris1.*) ++ os=`echo $os | sed -e 's|solaris1|sunos4|'` ++ ;; ++ -solaris) ++ os=-solaris2 ++ ;; ++ -svr4*) ++ os=-sysv4 ++ ;; ++ -unixware*) ++ os=-sysv4.2uw ++ ;; ++ -gnu/linux*) ++ os=`echo $os | sed -e 's|gnu/linux|linux-gnu|'` ++ ;; ++ # First accept the basic system types. ++ # The portable systems comes first. ++ # Each alternative MUST END IN A *, to match a version number. ++ # -sysv* is not here because it comes later, after sysvr4. ++ -gnu* | -bsd* | -mach* | -minix* | -genix* | -ultrix* | -irix* \ ++ | -*vms* | -sco* | -esix* | -isc* | -aix* | -cnk* | -sunos | -sunos[34]*\ ++ | -hpux* | -unos* | -osf* | -luna* | -dgux* | -auroraux* | -solaris* \ ++ | -sym* | -kopensolaris* | -plan9* \ ++ | -amigaos* | -amigados* | -msdos* | -newsos* | -unicos* | -aof* \ ++ | -aos* | -aros* | -cloudabi* | -sortix* \ ++ | -nindy* | -vxsim* | -vxworks* | -ebmon* | -hms* | -mvs* \ ++ | -clix* | -riscos* | -uniplus* | -iris* | -rtu* | -xenix* \ ++ | -hiux* | -386bsd* | -knetbsd* | -mirbsd* | -netbsd* \ ++ | -bitrig* | -openbsd* | -solidbsd* \ ++ | -ekkobsd* | -kfreebsd* | -freebsd* | -riscix* | -lynxos* \ ++ | -bosx* | -nextstep* | -cxux* | -aout* | -elf* | -oabi* \ ++ | -ptx* | -coff* | -ecoff* | -winnt* | -domain* | -vsta* \ ++ | -udi* | -eabi* | -lites* | -ieee* | -go32* | -aux* \ ++ | -chorusos* | -chorusrdb* | -cegcc* \ ++ | -cygwin* | -msys* | -pe* | -psos* | -moss* | -proelf* | -rtems* \ ++ | -mingw32* | -mingw64* | -linux-gnu* | -linux-android* \ ++ | -linux-newlib* | -linux-musl* | -linux-uclibc* \ ++ | -uxpv* | -beos* | -mpeix* | -udk* | -moxiebox* \ ++ | -interix* | -uwin* | -mks* | -rhapsody* | -darwin* | -opened* \ ++ | -openstep* | -oskit* | -conix* | -pw32* | -nonstopux* \ ++ | -storm-chaos* | -tops10* | -tenex* | -tops20* | -its* \ ++ | -os2* | -vos* | -palmos* | -uclinux* | -nucleus* \ ++ | -morphos* | -superux* | -rtmk* | -rtmk-nova* | -windiss* \ ++ | -powermax* | -dnix* | -nx6 | -nx7 | -sei* | -dragonfly* \ ++ | -skyos* | -haiku* | -rdos* | -toppers* | -drops* | -es* | -tirtos*) ++ # Remember, each alternative MUST END IN *, to match a version number. ++ ;; ++ -qnx*) ++ case $basic_machine in ++ x86-* | i*86-*) ++ ;; ++ *) ++ os=-nto$os ++ ;; ++ esac ++ ;; ++ -nto-qnx*) ++ ;; ++ -nto*) ++ os=`echo $os | sed -e 's|nto|nto-qnx|'` ++ ;; ++ -sim | -es1800* | -hms* | -xray | -os68k* | -none* | -v88r* \ ++ | -windows* | -osx | -abug | -netware* | -os9* | -beos* | -haiku* \ ++ | -macos* | -mpw* | -magic* | -mmixware* | -mon960* | -lnews*) ++ ;; ++ -mac*) ++ os=`echo $os | sed -e 's|mac|macos|'` ++ ;; ++ -linux-dietlibc) ++ os=-linux-dietlibc ++ ;; ++ -linux*) ++ os=`echo $os | sed -e 's|linux|linux-gnu|'` ++ ;; ++ -sunos5*) ++ os=`echo $os | sed -e 's|sunos5|solaris2|'` ++ ;; ++ -sunos6*) ++ os=`echo $os | sed -e 's|sunos6|solaris3|'` ++ ;; ++ -opened*) ++ os=-openedition ++ ;; ++ -os400*) ++ os=-os400 ++ ;; ++ -wince*) ++ os=-wince ++ ;; ++ -osfrose*) ++ os=-osfrose ++ ;; ++ -osf*) ++ os=-osf ++ ;; ++ -utek*) ++ os=-bsd ++ ;; ++ -dynix*) ++ os=-bsd ++ ;; ++ -acis*) ++ os=-aos ++ ;; ++ -atheos*) ++ os=-atheos ++ ;; ++ -syllable*) ++ os=-syllable ++ ;; ++ -386bsd) ++ os=-bsd ++ ;; ++ -ctix* | -uts*) ++ os=-sysv ++ ;; ++ -nova*) ++ os=-rtmk-nova ++ ;; ++ -ns2 ) ++ os=-nextstep2 ++ ;; ++ -nsk*) ++ os=-nsk ++ ;; ++ # Preserve the version number of sinix5. ++ -sinix5.*) ++ os=`echo $os | sed -e 's|sinix|sysv|'` ++ ;; ++ -sinix*) ++ os=-sysv4 ++ ;; ++ -tpf*) ++ os=-tpf ++ ;; ++ -triton*) ++ os=-sysv3 ++ ;; ++ -oss*) ++ os=-sysv3 ++ ;; ++ -svr4) ++ os=-sysv4 ++ ;; ++ -svr3) ++ os=-sysv3 ++ ;; ++ -sysvr4) ++ os=-sysv4 ++ ;; ++ # This must come after -sysvr4. ++ -sysv*) ++ ;; ++ -ose*) ++ os=-ose ++ ;; ++ -es1800*) ++ os=-ose ++ ;; ++ -xenix) ++ os=-xenix ++ ;; ++ -*mint | -mint[0-9]* | -*MiNT | -MiNT[0-9]*) ++ os=-mint ++ ;; ++ -aros*) ++ os=-aros ++ ;; ++ -zvmoe) ++ os=-zvmoe ++ ;; ++ -dicos*) ++ os=-dicos ++ ;; ++ -nacl*) ++ ;; ++ -none) ++ ;; ++ *) ++ # Get rid of the `-' at the beginning of $os. ++ os=`echo $os | sed 's/[^-]*-//'` ++ echo Invalid configuration \`$1\': system \`$os\' not recognized 1>&2 ++ exit 1 ++ ;; ++esac ++else ++ ++# Here we handle the default operating systems that come with various machines. ++# The value should be what the vendor currently ships out the door with their ++# machine or put another way, the most popular os provided with the machine. ++ ++# Note that if you're going to try to match "-MANUFACTURER" here (say, ++# "-sun"), then you have to tell the case statement up towards the top ++# that MANUFACTURER isn't an operating system. Otherwise, code above ++# will signal an error saying that MANUFACTURER isn't an operating ++# system, and we'll never get to this point. ++ ++case $basic_machine in ++ score-*) ++ os=-elf ++ ;; ++ spu-*) ++ os=-elf ++ ;; ++ *-acorn) ++ os=-riscix1.2 ++ ;; ++ arm*-rebel) ++ os=-linux ++ ;; ++ arm*-semi) ++ os=-aout ++ ;; ++ c4x-* | tic4x-*) ++ os=-coff ++ ;; ++ c8051-*) ++ os=-elf ++ ;; ++ hexagon-*) ++ os=-elf ++ ;; ++ tic54x-*) ++ os=-coff ++ ;; ++ tic55x-*) ++ os=-coff ++ ;; ++ tic6x-*) ++ os=-coff ++ ;; ++ # This must come before the *-dec entry. ++ pdp10-*) ++ os=-tops20 ++ ;; ++ pdp11-*) ++ os=-none ++ ;; ++ *-dec | vax-*) ++ os=-ultrix4.2 ++ ;; ++ m68*-apollo) ++ os=-domain ++ ;; ++ i386-sun) ++ os=-sunos4.0.2 ++ ;; ++ m68000-sun) ++ os=-sunos3 ++ ;; ++ m68*-cisco) ++ os=-aout ++ ;; ++ mep-*) ++ os=-elf ++ ;; ++ mips*-cisco) ++ os=-elf ++ ;; ++ mips*-*) ++ os=-elf ++ ;; ++ or32-*) ++ os=-coff ++ ;; ++ *-tti) # must be before sparc entry or we get the wrong os. ++ os=-sysv3 ++ ;; ++ sparc-* | *-sun) ++ os=-sunos4.1.1 ++ ;; ++ *-be) ++ os=-beos ++ ;; ++ *-haiku) ++ os=-haiku ++ ;; ++ *-ibm) ++ os=-aix ++ ;; ++ *-knuth) ++ os=-mmixware ++ ;; ++ *-wec) ++ os=-proelf ++ ;; ++ *-winbond) ++ os=-proelf ++ ;; ++ *-oki) ++ os=-proelf ++ ;; ++ *-hp) ++ os=-hpux ++ ;; ++ *-hitachi) ++ os=-hiux ++ ;; ++ i860-* | *-att | *-ncr | *-altos | *-motorola | *-convergent) ++ os=-sysv ++ ;; ++ *-cbm) ++ os=-amigaos ++ ;; ++ *-dg) ++ os=-dgux ++ ;; ++ *-dolphin) ++ os=-sysv3 ++ ;; ++ m68k-ccur) ++ os=-rtu ++ ;; ++ m88k-omron*) ++ os=-luna ++ ;; ++ *-next ) ++ os=-nextstep ++ ;; ++ *-sequent) ++ os=-ptx ++ ;; ++ *-crds) ++ os=-unos ++ ;; ++ *-ns) ++ os=-genix ++ ;; ++ i370-*) ++ os=-mvs ++ ;; ++ *-next) ++ os=-nextstep3 ++ ;; ++ *-gould) ++ os=-sysv ++ ;; ++ *-highlevel) ++ os=-bsd ++ ;; ++ *-encore) ++ os=-bsd ++ ;; ++ *-sgi) ++ os=-irix ++ ;; ++ *-siemens) ++ os=-sysv4 ++ ;; ++ *-masscomp) ++ os=-rtu ++ ;; ++ f30[01]-fujitsu | f700-fujitsu) ++ os=-uxpv ++ ;; ++ *-rom68k) ++ os=-coff ++ ;; ++ *-*bug) ++ os=-coff ++ ;; ++ *-apple) ++ os=-macos ++ ;; ++ *-atari*) ++ os=-mint ++ ;; ++ *) ++ os=-none ++ ;; ++esac ++fi ++ ++# Here we handle the case where we know the os, and the CPU type, but not the ++# manufacturer. We pick the logical manufacturer. ++vendor=unknown ++case $basic_machine in ++ *-unknown) ++ case $os in ++ -riscix*) ++ vendor=acorn ++ ;; ++ -sunos*) ++ vendor=sun ++ ;; ++ -cnk*|-aix*) ++ vendor=ibm ++ ;; ++ -beos*) ++ vendor=be ++ ;; ++ -hpux*) ++ vendor=hp ++ ;; ++ -mpeix*) ++ vendor=hp ++ ;; ++ -hiux*) ++ vendor=hitachi ++ ;; ++ -unos*) ++ vendor=crds ++ ;; ++ -dgux*) ++ vendor=dg ++ ;; ++ -luna*) ++ vendor=omron ++ ;; ++ -genix*) ++ vendor=ns ++ ;; ++ -mvs* | -opened*) ++ vendor=ibm ++ ;; ++ -os400*) ++ vendor=ibm ++ ;; ++ -ptx*) ++ vendor=sequent ++ ;; ++ -tpf*) ++ vendor=ibm ++ ;; ++ -vxsim* | -vxworks* | -windiss*) ++ vendor=wrs ++ ;; ++ -aux*) ++ vendor=apple ++ ;; ++ -hms*) ++ vendor=hitachi ++ ;; ++ -mpw* | -macos*) ++ vendor=apple ++ ;; ++ -*mint | -mint[0-9]* | -*MiNT | -MiNT[0-9]*) ++ vendor=atari ++ ;; ++ -vos*) ++ vendor=stratus ++ ;; ++ esac ++ basic_machine=`echo $basic_machine | sed "s/unknown/$vendor/"` ++ ;; ++esac ++ ++echo $basic_machine$os ++exit ++ ++# Local variables: ++# eval: (add-hook 'write-file-hooks 'time-stamp) ++# time-stamp-start: "timestamp='" ++# time-stamp-format: "%:y-%02m-%02d" ++# time-stamp-end: "'" ++# End: +--- /dev/null ++++ filtergen-0.12.7/.clang-format +@@ -0,0 +1 @@ ++BasedOnStyle: LLVM +--- /dev/null ++++ filtergen-0.12.7/.travis.yml +@@ -0,0 +1,12 @@ ++language: c ++sudo: false ++addons: ++ apt: ++ packages: ++ - bison ++ - flex ++script: make -f makefile check ++compiler: ++ - clang ++ - gcc ++after_failure: cat t/test-suite.log diff -Nru filtergen-0.12.4/debian/patches/series filtergen-0.12.7/debian/patches/series --- filtergen-0.12.4/debian/patches/series 1970-01-01 00:00:00.000000000 +0000 +++ filtergen-0.12.7/debian/patches/series 2016-02-10 22:40:24.000000000 +0000 @@ -0,0 +1 @@ +debian-changes diff -Nru filtergen-0.12.4/debian/rules filtergen-0.12.7/debian/rules --- filtergen-0.12.4/debian/rules 2016-02-18 07:59:36.000000000 +0000 +++ filtergen-0.12.7/debian/rules 2016-02-13 09:44:55.000000000 +0000 @@ -1,74 +1,19 @@ #!/usr/bin/make -f -# Sample debian/rules that uses debhelper. -# GNU copyright 1997 to 1999 by Joey Hess. # Uncomment this to turn on verbose mode. #export DH_VERBOSE=1 +export DEB_BUILD_MAINT_OPTIONS = hardening=+all +export DEB_CFLAGS_MAINT_APPEND = -Wall -pedantic +export DEB_LDFLAGS_MAINT_APPEND = -Wl,--as-needed -ifneq (,$(findstring noopt,$(DEB_BUILD_OPTIONS))) - CFLAGS += -O0 -else - CFLAGS += -O2 -endif -ifneq (,$(findstring debug,$(DEB_BUILD_OPTIONS))) - CFLAGS += -g -endif +%: + dh $@ --with autoreconf -configure: configure-stamp -configure-stamp: - dh_testdir - CFLAGS="$(CFLAGS)" ./configure \ - --host=$(DEB_HOST_GNU_TYPE) \ - --build=$(DEB_BUILD_GNU_TYPE) \ - --prefix=/usr \ - --mandir=\$${prefix}/share/man \ - --infodir=\$${prefix}/share/info \ - --sysconfdir=/etc/filtergen - touch configure-stamp +override_dh_auto_configure: + dh_auto_configure -- --sysconfdir=/etc/filtergen -build: build-stamp - -build-stamp: configure-stamp - dh_testdir - $(MAKE) - $(MAKE) check - touch build-stamp - -clean: - dh_testdir - dh_testroot - [ ! -f Makefile ] || $(MAKE) distclean - rm -f build-stamp configure-stamp - dh_clean - -install: build - dh_testdir - dh_testroot - dh_clean -k - dh_installdirs - $(MAKE) install DESTDIR=$(CURDIR)/debian/filtergen - -# Build architecture-independent files here. -binary-indep: build install -# We have nothing to do by default. - -# Build architecture-dependent files here. -binary-arch: build install - dh_testdir - dh_testroot - dh_installdebconf - dh_installdocs - dh_installexamples +override_dh_installchangelogs: dh_installchangelogs HISTORY - dh_link - dh_strip - dh_compress - dh_fixperms - dh_installdeb - dh_shlibdeps - dh_gencontrol - dh_md5sums - dh_builddeb -binary: binary-indep binary-arch -.PHONY: build clean binary-indep binary-arch binary install configure +override_dh_auto_test: + dh_auto_test -a || (cat t/test-suite.log; /bin/false) diff -Nru filtergen-0.12.4/debian/source/format filtergen-0.12.7/debian/source/format --- filtergen-0.12.4/debian/source/format 1970-01-01 00:00:00.000000000 +0000 +++ filtergen-0.12.7/debian/source/format 2016-02-13 09:44:55.000000000 +0000 @@ -0,0 +1 @@ +3.0 (quilt) diff -Nru filtergen-0.12.4/debian/source/options filtergen-0.12.7/debian/source/options --- filtergen-0.12.4/debian/source/options 1970-01-01 00:00:00.000000000 +0000 +++ filtergen-0.12.7/debian/source/options 2016-02-13 09:44:55.000000000 +0000 @@ -0,0 +1 @@ +single-debian-patch diff -Nru filtergen-0.12.4/debian/watch filtergen-0.12.7/debian/watch --- filtergen-0.12.4/debian/watch 2016-02-18 07:59:36.000000000 +0000 +++ filtergen-0.12.7/debian/watch 2016-02-13 09:44:55.000000000 +0000 @@ -1,2 +1,2 @@ -version=2 -http://spacepants.org/src/filtergen/download/ (?:.*/)?filtergen-?_?([\w+\d+\.]+|\d+)(\.tar|\.tgz)(\.gz|\.bz2|) debian uupdate +version=3 +https://github.com/jaqx0r/filtergen/tags .*/(\d[\d\.]*)\.tar\.gz diff -Nru filtergen-0.12.4/depcomp filtergen-0.12.7/depcomp --- filtergen-0.12.4/depcomp 2004-05-15 03:37:33.000000000 +0000 +++ filtergen-0.12.7/depcomp 2016-02-13 08:06:27.000000000 +0000 @@ -1,9 +1,9 @@ #! /bin/sh # depcomp - compile a program generating dependencies as side-effects -scriptversion=2004-04-25.13 +scriptversion=2013-05-30.07; # UTC -# Copyright (C) 1999, 2000, 2003, 2004 Free Software Foundation, Inc. +# Copyright (C) 1999-2014 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 @@ -16,9 +16,7 @@ # 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., 59 Temple Place - Suite 330, Boston, MA -# 02111-1307, USA. +# along with this program. If not, see . # As a special exception to the GNU General Public License, if you # distribute this file as part of a program that contains a @@ -29,9 +27,9 @@ case $1 in '') - echo "$0: No command. Try \`$0 --help' for more information." 1>&2 - exit 1; - ;; + echo "$0: No command. Try '$0 --help' for more information." 1>&2 + exit 1; + ;; -h | --h*) cat <<\EOF Usage: depcomp [--help] [--version] PROGRAM [ARGS] @@ -41,42 +39,98 @@ Environment variables: depmode Dependency tracking mode. - source Source file read by `PROGRAMS ARGS'. - object Object file output by `PROGRAMS ARGS'. + source Source file read by 'PROGRAMS ARGS'. + object Object file output by 'PROGRAMS ARGS'. + DEPDIR directory where to store dependencies. depfile Dependency file to output. - tmpdepfile Temporary file to use when outputing dependencies. + tmpdepfile Temporary file to use when outputting dependencies. libtool Whether libtool is used (yes/no). Report bugs to . EOF - exit 0 + exit $? ;; -v | --v*) echo "depcomp $scriptversion" - exit 0 + exit $? ;; esac +# Get the directory component of the given path, and save it in the +# global variables '$dir'. Note that this directory component will +# be either empty or ending with a '/' character. This is deliberate. +set_dir_from () +{ + case $1 in + */*) dir=`echo "$1" | sed -e 's|/[^/]*$|/|'`;; + *) dir=;; + esac +} + +# Get the suffix-stripped basename of the given path, and save it the +# global variable '$base'. +set_base_from () +{ + base=`echo "$1" | sed -e 's|^.*/||' -e 's/\.[^.]*$//'` +} + +# If no dependency file was actually created by the compiler invocation, +# we still have to create a dummy depfile, to avoid errors with the +# Makefile "include basename.Plo" scheme. +make_dummy_depfile () +{ + echo "#dummy" > "$depfile" +} + +# Factor out some common post-processing of the generated depfile. +# Requires the auxiliary global variable '$tmpdepfile' to be set. +aix_post_process_depfile () +{ + # If the compiler actually managed to produce a dependency file, + # post-process it. + if test -f "$tmpdepfile"; then + # Each line is of the form 'foo.o: dependency.h'. + # Do two passes, one to just change these to + # $object: dependency.h + # and one to simply output + # dependency.h: + # which is needed to avoid the deleted-header problem. + { sed -e "s,^.*\.[$lower]*:,$object:," < "$tmpdepfile" + sed -e "s,^.*\.[$lower]*:[$tab ]*,," -e 's,$,:,' < "$tmpdepfile" + } > "$depfile" + rm -f "$tmpdepfile" + else + make_dummy_depfile + fi +} + +# A tabulation character. +tab=' ' +# A newline character. +nl=' +' +# Character ranges might be problematic outside the C locale. +# These definitions help. +upper=ABCDEFGHIJKLMNOPQRSTUVWXYZ +lower=abcdefghijklmnopqrstuvwxyz +digits=0123456789 +alpha=${upper}${lower} + if test -z "$depmode" || test -z "$source" || test -z "$object"; then echo "depcomp: Variables source, object and depmode must be set" 1>&2 exit 1 fi -# `libtool' can also be set to `yes' or `no'. - -if test -z "$depfile"; then - base=`echo "$object" | sed -e 's,^.*/,,' -e 's,\.\([^.]*\)$,.P\1,'` - dir=`echo "$object" | sed 's,/.*$,/,'` - if test "$dir" = "$object"; then - dir= - fi - # FIXME: should be _deps on DOS. - depfile="$dir.deps/$base" -fi +# Dependencies for sub/bar.o or sub/bar.obj go into sub/.deps/bar.Po. +depfile=${depfile-`echo "$object" | + sed 's|[^\\/]*$|'${DEPDIR-.deps}'/&|;s|\.\([^.]*\)$|.P\1|;s|Pobj$|Po|'`} tmpdepfile=${tmpdepfile-`echo "$depfile" | sed 's/\.\([^.]*\)$/.T\1/'`} rm -f "$tmpdepfile" +# Avoid interferences from the environment. +gccflag= dashmflag= + # Some modes work just like other modes, but use different flags. We # parameterize here, but still list the modes in the big case below, # to make depend.m4 easier to write. Note that we *cannot* use a case @@ -88,9 +142,32 @@ fi if test "$depmode" = dashXmstdout; then - # This is just like dashmstdout with a different argument. - dashmflag=-xM - depmode=dashmstdout + # This is just like dashmstdout with a different argument. + dashmflag=-xM + depmode=dashmstdout +fi + +cygpath_u="cygpath -u -f -" +if test "$depmode" = msvcmsys; then + # This is just like msvisualcpp but w/o cygpath translation. + # Just convert the backslash-escaped backslashes to single forward + # slashes to satisfy depend.m4 + cygpath_u='sed s,\\\\,/,g' + depmode=msvisualcpp +fi + +if test "$depmode" = msvc7msys; then + # This is just like msvc7 but w/o cygpath translation. + # Just convert the backslash-escaped backslashes to single forward + # slashes to satisfy depend.m4 + cygpath_u='sed s,\\\\,/,g' + depmode=msvc7 +fi + +if test "$depmode" = xlc; then + # IBM C/C++ Compilers xlc/xlC can output gcc-like dependency information. + gccflag=-qmakedep=gcc,-MF + depmode=gcc fi case "$depmode" in @@ -98,10 +175,22 @@ ## gcc 3 implements dependency tracking that does exactly what ## we want. Yay! Note: for some reason libtool 1.4 doesn't like ## it if -MD -MP comes after the -MF stuff. Hmm. - "$@" -MT "$object" -MD -MP -MF "$tmpdepfile" +## Unfortunately, FreeBSD c89 acceptance of flags depends upon +## the command line argument order; so add the flags where they +## appear in depend2.am. Note that the slowdown incurred here +## affects only configure: in makefiles, %FASTDEP% shortcuts this. + for arg + do + case $arg in + -c) set fnord "$@" -MT "$object" -MD -MP -MF "$tmpdepfile" "$arg" ;; + *) set fnord "$@" "$arg" ;; + esac + shift # fnord + shift # $arg + done + "$@" stat=$? - if test $stat -eq 0; then : - else + if test $stat -ne 0; then rm -f "$tmpdepfile" exit $stat fi @@ -109,13 +198,17 @@ ;; gcc) +## Note that this doesn't just cater to obsosete pre-3.x GCC compilers. +## but also to in-use compilers like IMB xlc/xlC and the HP C compiler. +## (see the conditional assignment to $gccflag above). ## There are various ways to get dependency output from gcc. Here's ## why we pick this rather obscure method: ## - Don't want to use -MD because we'd like the dependencies to end ## up in a subdir. Having to rename by hand is ugly. ## (We might end up doing this anyway to support other compilers.) ## - The DEPENDENCIES_OUTPUT environment variable makes gcc act like -## -MM, not -M (despite what the docs say). +## -MM, not -M (despite what the docs say). Also, it might not be +## supported by the other compilers which use the 'gcc' depmode. ## - Using -M directly means running the compiler twice (even worse ## than renaming). if test -z "$gccflag"; then @@ -123,31 +216,31 @@ fi "$@" -Wp,"$gccflag$tmpdepfile" stat=$? - if test $stat -eq 0; then : - else + if test $stat -ne 0; then rm -f "$tmpdepfile" exit $stat fi rm -f "$depfile" echo "$object : \\" > "$depfile" - alpha=ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz -## The second -e expression handles DOS-style file names with drive letters. + # The second -e expression handles DOS-style file names with drive + # letters. sed -e 's/^[^:]*: / /' \ -e 's/^['$alpha']:\/[^:]*: / /' < "$tmpdepfile" >> "$depfile" -## This next piece of magic avoids the `deleted header file' problem. +## This next piece of magic avoids the "deleted header file" problem. ## The problem is that when a header file which appears in a .P file ## is deleted, the dependency causes make to die (because there is ## typically no way to rebuild the header). We avoid this by adding ## dummy dependencies for each header file. Too bad gcc doesn't do ## this for us directly. - tr ' ' ' -' < "$tmpdepfile" | -## Some versions of gcc put a space before the `:'. On the theory +## Some versions of gcc put a space before the ':'. On the theory ## that the space means something, we add a space to the output as -## well. +## well. hp depmode also adds that space, but also prefixes the VPATH +## to the object. Take care to not repeat it in the output. ## Some versions of the HPUX 10.20 sed can't process this invocation ## correctly. Breaking it into two sed invocations is a workaround. - sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' | sed -e 's/$/ :/' >> "$depfile" + tr ' ' "$nl" < "$tmpdepfile" \ + | sed -e 's/^\\$//' -e '/^$/d' -e "s|.*$object$||" -e '/:$/d' \ + | sed -e 's/$/ :/' >> "$depfile" rm -f "$tmpdepfile" ;; @@ -165,8 +258,7 @@ "$@" -MDupdate "$tmpdepfile" fi stat=$? - if test $stat -eq 0; then : - else + if test $stat -ne 0; then rm -f "$tmpdepfile" exit $stat fi @@ -174,99 +266,156 @@ if test -f "$tmpdepfile"; then # yes, the sourcefile depend on other files echo "$object : \\" > "$depfile" - # Clip off the initial element (the dependent). Don't try to be # clever and replace this with sed code, as IRIX sed won't handle # lines with more than a fixed number of characters (4096 in # IRIX 6.2 sed, 8192 in IRIX 6.5). We also remove comment lines; - # the IRIX cc adds comments like `#:fec' to the end of the + # the IRIX cc adds comments like '#:fec' to the end of the # dependency line. - tr ' ' ' -' < "$tmpdepfile" \ - | sed -e 's/^.*\.o://' -e 's/#.*$//' -e '/^$/ d' | \ - tr ' -' ' ' >> $depfile - echo >> $depfile - + tr ' ' "$nl" < "$tmpdepfile" \ + | sed -e 's/^.*\.o://' -e 's/#.*$//' -e '/^$/ d' \ + | tr "$nl" ' ' >> "$depfile" + echo >> "$depfile" # The second pass generates a dummy entry for each header file. - tr ' ' ' -' < "$tmpdepfile" \ - | sed -e 's/^.*\.o://' -e 's/#.*$//' -e '/^$/ d' -e 's/$/:/' \ - >> $depfile + tr ' ' "$nl" < "$tmpdepfile" \ + | sed -e 's/^.*\.o://' -e 's/#.*$//' -e '/^$/ d' -e 's/$/:/' \ + >> "$depfile" else - # The sourcefile does not contain any dependencies, so just - # store a dummy comment line, to avoid errors with the Makefile - # "include basename.Plo" scheme. - echo "#dummy" > "$depfile" + make_dummy_depfile fi rm -f "$tmpdepfile" ;; +xlc) + # This case exists only to let depend.m4 do its work. It works by + # looking at the text of this script. This case will never be run, + # since it is checked for above. + exit 1 + ;; + aix) # The C for AIX Compiler uses -M and outputs the dependencies # in a .u file. In older versions, this file always lives in the - # current directory. Also, the AIX compiler puts `$object:' at the + # current directory. Also, the AIX compiler puts '$object:' at the # start of each line; $object doesn't have directory information. # Version 6 uses the directory in both cases. - stripped=`echo "$object" | sed 's/\(.*\)\..*$/\1/'` - tmpdepfile="$stripped.u" + set_dir_from "$object" + set_base_from "$object" if test "$libtool" = yes; then + tmpdepfile1=$dir$base.u + tmpdepfile2=$base.u + tmpdepfile3=$dir.libs/$base.u "$@" -Wc,-M else + tmpdepfile1=$dir$base.u + tmpdepfile2=$dir$base.u + tmpdepfile3=$dir$base.u "$@" -M fi stat=$? - - if test -f "$tmpdepfile"; then : - else - stripped=`echo "$stripped" | sed 's,^.*/,,'` - tmpdepfile="$stripped.u" + if test $stat -ne 0; then + rm -f "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" + exit $stat fi - if test $stat -eq 0; then : - else + for tmpdepfile in "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" + do + test -f "$tmpdepfile" && break + done + aix_post_process_depfile + ;; + +tcc) + # tcc (Tiny C Compiler) understand '-MD -MF file' since version 0.9.26 + # FIXME: That version still under development at the moment of writing. + # Make that this statement remains true also for stable, released + # versions. + # It will wrap lines (doesn't matter whether long or short) with a + # trailing '\', as in: + # + # foo.o : \ + # foo.c \ + # foo.h \ + # + # It will put a trailing '\' even on the last line, and will use leading + # spaces rather than leading tabs (at least since its commit 0394caf7 + # "Emit spaces for -MD"). + "$@" -MD -MF "$tmpdepfile" + stat=$? + if test $stat -ne 0; then rm -f "$tmpdepfile" exit $stat fi - - if test -f "$tmpdepfile"; then - outname="$stripped.o" - # Each line is of the form `foo.o: dependent.h'. - # Do two passes, one to just change these to - # `$object: dependent.h' and one to simply `dependent.h:'. - sed -e "s,^$outname:,$object :," < "$tmpdepfile" > "$depfile" - sed -e "s,^$outname: \(.*\)$,\1:," < "$tmpdepfile" >> "$depfile" - else - # The sourcefile does not contain any dependencies, so just - # store a dummy comment line, to avoid errors with the Makefile - # "include basename.Plo" scheme. - echo "#dummy" > "$depfile" - fi + rm -f "$depfile" + # Each non-empty line is of the form 'foo.o : \' or ' dep.h \'. + # We have to change lines of the first kind to '$object: \'. + sed -e "s|.*:|$object :|" < "$tmpdepfile" > "$depfile" + # And for each line of the second kind, we have to emit a 'dep.h:' + # dummy dependency, to avoid the deleted-header problem. + sed -n -e 's|^ *\(.*\) *\\$|\1:|p' < "$tmpdepfile" >> "$depfile" rm -f "$tmpdepfile" ;; -icc) - # Intel's C compiler understands `-MD -MF file'. However on - # icc -MD -MF foo.d -c -o sub/foo.o sub/foo.c - # ICC 7.0 will fill foo.d with something like - # foo.o: sub/foo.c - # foo.o: sub/foo.h - # which is wrong. We want: - # sub/foo.o: sub/foo.c - # sub/foo.o: sub/foo.h - # sub/foo.c: - # sub/foo.h: - # ICC 7.1 will output +## The order of this option in the case statement is important, since the +## shell code in configure will try each of these formats in the order +## listed in this file. A plain '-MD' option would be understood by many +## compilers, so we must ensure this comes after the gcc and icc options. +pgcc) + # Portland's C compiler understands '-MD'. + # Will always output deps to 'file.d' where file is the root name of the + # source file under compilation, even if file resides in a subdirectory. + # The object file name does not affect the name of the '.d' file. + # pgcc 10.2 will output # foo.o: sub/foo.c sub/foo.h - # and will wrap long lines using \ : + # and will wrap long lines using '\' : # foo.o: sub/foo.c ... \ # sub/foo.h ... \ # ... + set_dir_from "$object" + # Use the source, not the object, to determine the base name, since + # that's sadly what pgcc will do too. + set_base_from "$source" + tmpdepfile=$base.d + + # For projects that build the same source file twice into different object + # files, the pgcc approach of using the *source* file root name can cause + # problems in parallel builds. Use a locking strategy to avoid stomping on + # the same $tmpdepfile. + lockdir=$base.d-lock + trap " + echo '$0: caught signal, cleaning up...' >&2 + rmdir '$lockdir' + exit 1 + " 1 2 13 15 + numtries=100 + i=$numtries + while test $i -gt 0; do + # mkdir is a portable test-and-set. + if mkdir "$lockdir" 2>/dev/null; then + # This process acquired the lock. + "$@" -MD + stat=$? + # Release the lock. + rmdir "$lockdir" + break + else + # If the lock is being held by a different process, wait + # until the winning process is done or we timeout. + while test -d "$lockdir" && test $i -gt 0; do + sleep 1 + i=`expr $i - 1` + done + fi + i=`expr $i - 1` + done + trap - 1 2 13 15 + if test $i -le 0; then + echo "$0: failed to acquire lock after $numtries attempts" >&2 + echo "$0: check lockdir '$lockdir'" >&2 + exit 1 + fi - "$@" -MD -MF "$tmpdepfile" - stat=$? - if test $stat -eq 0; then : - else + if test $stat -ne 0; then rm -f "$tmpdepfile" exit $stat fi @@ -278,58 +427,141 @@ sed "s,^[^:]*:,$object :," < "$tmpdepfile" > "$depfile" # Some versions of the HPUX 10.20 sed can't process this invocation # correctly. Breaking it into two sed invocations is a workaround. - sed 's,^[^:]*: \(.*\)$,\1,;s/^\\$//;/^$/d;/:$/d' < "$tmpdepfile" | - sed -e 's/$/ :/' >> "$depfile" + sed 's,^[^:]*: \(.*\)$,\1,;s/^\\$//;/^$/d;/:$/d' < "$tmpdepfile" \ + | sed -e 's/$/ :/' >> "$depfile" rm -f "$tmpdepfile" ;; +hp2) + # The "hp" stanza above does not work with aCC (C++) and HP's ia64 + # compilers, which have integrated preprocessors. The correct option + # to use with these is +Maked; it writes dependencies to a file named + # 'foo.d', which lands next to the object file, wherever that + # happens to be. + # Much of this is similar to the tru64 case; see comments there. + set_dir_from "$object" + set_base_from "$object" + if test "$libtool" = yes; then + tmpdepfile1=$dir$base.d + tmpdepfile2=$dir.libs/$base.d + "$@" -Wc,+Maked + else + tmpdepfile1=$dir$base.d + tmpdepfile2=$dir$base.d + "$@" +Maked + fi + stat=$? + if test $stat -ne 0; then + rm -f "$tmpdepfile1" "$tmpdepfile2" + exit $stat + fi + + for tmpdepfile in "$tmpdepfile1" "$tmpdepfile2" + do + test -f "$tmpdepfile" && break + done + if test -f "$tmpdepfile"; then + sed -e "s,^.*\.[$lower]*:,$object:," "$tmpdepfile" > "$depfile" + # Add 'dependent.h:' lines. + sed -ne '2,${ + s/^ *// + s/ \\*$// + s/$/:/ + p + }' "$tmpdepfile" >> "$depfile" + else + make_dummy_depfile + fi + rm -f "$tmpdepfile" "$tmpdepfile2" + ;; + tru64) - # The Tru64 compiler uses -MD to generate dependencies as a side - # effect. `cc -MD -o foo.o ...' puts the dependencies into `foo.o.d'. - # At least on Alpha/Redhat 6.1, Compaq CCC V6.2-504 seems to put - # dependencies in `foo.d' instead, so we check for that too. - # Subdirectories are respected. - dir=`echo "$object" | sed -e 's|/[^/]*$|/|'` - test "x$dir" = "x$object" && dir= - base=`echo "$object" | sed -e 's|^.*/||' -e 's/\.o$//' -e 's/\.lo$//'` - - if test "$libtool" = yes; then - # Dependencies are output in .lo.d with libtool 1.4. - # They are output in .o.d with libtool 1.5. - tmpdepfile1="$dir.libs/$base.lo.d" - tmpdepfile2="$dir.libs/$base.o.d" - tmpdepfile3="$dir.libs/$base.d" - "$@" -Wc,-MD - else - tmpdepfile1="$dir$base.o.d" - tmpdepfile2="$dir$base.d" - tmpdepfile3="$dir$base.d" - "$@" -MD - fi + # The Tru64 compiler uses -MD to generate dependencies as a side + # effect. 'cc -MD -o foo.o ...' puts the dependencies into 'foo.o.d'. + # At least on Alpha/Redhat 6.1, Compaq CCC V6.2-504 seems to put + # dependencies in 'foo.d' instead, so we check for that too. + # Subdirectories are respected. + set_dir_from "$object" + set_base_from "$object" + + if test "$libtool" = yes; then + # Libtool generates 2 separate objects for the 2 libraries. These + # two compilations output dependencies in $dir.libs/$base.o.d and + # in $dir$base.o.d. We have to check for both files, because + # one of the two compilations can be disabled. We should prefer + # $dir$base.o.d over $dir.libs/$base.o.d because the latter is + # automatically cleaned when .libs/ is deleted, while ignoring + # the former would cause a distcleancheck panic. + tmpdepfile1=$dir$base.o.d # libtool 1.5 + tmpdepfile2=$dir.libs/$base.o.d # Likewise. + tmpdepfile3=$dir.libs/$base.d # Compaq CCC V6.2-504 + "$@" -Wc,-MD + else + tmpdepfile1=$dir$base.d + tmpdepfile2=$dir$base.d + tmpdepfile3=$dir$base.d + "$@" -MD + fi + + stat=$? + if test $stat -ne 0; then + rm -f "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" + exit $stat + fi + + for tmpdepfile in "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" + do + test -f "$tmpdepfile" && break + done + # Same post-processing that is required for AIX mode. + aix_post_process_depfile + ;; + +msvc7) + if test "$libtool" = yes; then + showIncludes=-Wc,-showIncludes + else + showIncludes=-showIncludes + fi + "$@" $showIncludes > "$tmpdepfile" + stat=$? + grep -v '^Note: including file: ' "$tmpdepfile" + if test $stat -ne 0; then + rm -f "$tmpdepfile" + exit $stat + fi + rm -f "$depfile" + echo "$object : \\" > "$depfile" + # The first sed program below extracts the file names and escapes + # backslashes for cygpath. The second sed program outputs the file + # name when reading, but also accumulates all include files in the + # hold buffer in order to output them again at the end. This only + # works with sed implementations that can handle large buffers. + sed < "$tmpdepfile" -n ' +/^Note: including file: *\(.*\)/ { + s//\1/ + s/\\/\\\\/g + p +}' | $cygpath_u | sort -u | sed -n ' +s/ /\\ /g +s/\(.*\)/'"$tab"'\1 \\/p +s/.\(.*\) \\/\1:/ +H +$ { + s/.*/'"$tab"'/ + G + p +}' >> "$depfile" + echo >> "$depfile" # make sure the fragment doesn't end with a backslash + rm -f "$tmpdepfile" + ;; - stat=$? - if test $stat -eq 0; then : - else - rm -f "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" - exit $stat - fi - - if test -f "$tmpdepfile1"; then - tmpdepfile="$tmpdepfile1" - elif test -f "$tmpdepfile2"; then - tmpdepfile="$tmpdepfile2" - else - tmpdepfile="$tmpdepfile3" - fi - if test -f "$tmpdepfile"; then - sed -e "s,^.*\.[a-z]*:,$object:," < "$tmpdepfile" > "$depfile" - # That's a tab and a space in the []. - sed -e 's,^.*\.[a-z]*:[ ]*,,' -e 's,$,:,' < "$tmpdepfile" >> "$depfile" - else - echo "#dummy" > "$depfile" - fi - rm -f "$tmpdepfile" - ;; +msvc7msys) + # This case exists only to let depend.m4 do its work. It works by + # looking at the text of this script. This case will never be run, + # since it is checked for above. + exit 1 + ;; #nosideeffect) # This comment above is used by automake to tell side-effect @@ -342,13 +574,13 @@ # Remove the call to Libtool. if test "$libtool" = yes; then - while test $1 != '--mode=compile'; do + while test "X$1" != 'X--mode=compile'; do shift done shift fi - # Remove `-o $object'. + # Remove '-o $object'. IFS=" " for arg do @@ -368,18 +600,18 @@ done test -z "$dashmflag" && dashmflag=-M - # Require at least two characters before searching for `:' + # Require at least two characters before searching for ':' # in the target name. This is to cope with DOS-style filenames: - # a dependency such as `c:/foo/bar' could be seen as target `c' otherwise. + # a dependency such as 'c:/foo/bar' could be seen as target 'c' otherwise. "$@" $dashmflag | - sed 's:^[ ]*[^: ][^:][^:]*\:[ ]*:'"$object"'\: :' > "$tmpdepfile" + sed "s|^[$tab ]*[^:$tab ][^:][^:]*:[$tab ]*|$object: |" > "$tmpdepfile" rm -f "$depfile" cat < "$tmpdepfile" > "$depfile" - tr ' ' ' -' < "$tmpdepfile" | \ -## Some versions of the HPUX 10.20 sed can't process this invocation -## correctly. Breaking it into two sed invocations is a workaround. - sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' | sed -e 's/$/ :/' >> "$depfile" + # Some versions of the HPUX 10.20 sed can't process this sed invocation + # correctly. Breaking it into two sed invocations is a workaround. + tr ' ' "$nl" < "$tmpdepfile" \ + | sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' \ + | sed -e 's/$/ :/' >> "$depfile" rm -f "$tmpdepfile" ;; @@ -393,41 +625,51 @@ "$@" || exit $? # Remove any Libtool call if test "$libtool" = yes; then - while test $1 != '--mode=compile'; do + while test "X$1" != 'X--mode=compile'; do shift done shift fi # X makedepend shift - cleared=no - for arg in "$@"; do + cleared=no eat=no + for arg + do case $cleared in no) set ""; shift cleared=yes ;; esac + if test $eat = yes; then + eat=no + continue + fi case "$arg" in -D*|-I*) set fnord "$@" "$arg"; shift ;; # Strip any option that makedepend may not understand. Remove # the object too, otherwise makedepend will parse it as a source file. + -arch) + eat=yes ;; -*|$object) ;; *) set fnord "$@" "$arg"; shift ;; esac done - obj_suffix="`echo $object | sed 's/^.*\././'`" + obj_suffix=`echo "$object" | sed 's/^.*\././'` touch "$tmpdepfile" ${MAKEDEPEND-makedepend} -o"$obj_suffix" -f"$tmpdepfile" "$@" rm -f "$depfile" - cat < "$tmpdepfile" > "$depfile" - sed '1,2d' "$tmpdepfile" | tr ' ' ' -' | \ -## Some versions of the HPUX 10.20 sed can't process this invocation -## correctly. Breaking it into two sed invocations is a workaround. - sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' | sed -e 's/$/ :/' >> "$depfile" + # makedepend may prepend the VPATH from the source file name to the object. + # No need to regex-escape $object, excess matching of '.' is harmless. + sed "s|^.*\($object *:\)|\1|" "$tmpdepfile" > "$depfile" + # Some versions of the HPUX 10.20 sed can't process the last invocation + # correctly. Breaking it into two sed invocations is a workaround. + sed '1,2d' "$tmpdepfile" \ + | tr ' ' "$nl" \ + | sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' \ + | sed -e 's/$/ :/' >> "$depfile" rm -f "$tmpdepfile" "$tmpdepfile".bak ;; @@ -438,13 +680,13 @@ # Remove the call to Libtool. if test "$libtool" = yes; then - while test $1 != '--mode=compile'; do + while test "X$1" != 'X--mode=compile'; do shift done shift fi - # Remove `-o $object'. + # Remove '-o $object'. IFS=" " for arg do @@ -463,9 +705,10 @@ esac done - "$@" -E | - sed -n '/^# [0-9][0-9]* "\([^"]*\)".*/ s:: \1 \\:p' | - sed '$ s: \\$::' > "$tmpdepfile" + "$@" -E \ + | sed -n -e '/^# [0-9][0-9]* "\([^"]*\)".*/ s:: \1 \\:p' \ + -e '/^#line [0-9][0-9]* "\([^"]*\)".*/ s:: \1 \\:p' \ + | sed '$ s: \\$::' > "$tmpdepfile" rm -f "$depfile" echo "$object : \\" > "$depfile" cat < "$tmpdepfile" >> "$depfile" @@ -475,35 +718,56 @@ msvisualcpp) # Important note: in order to support this mode, a compiler *must* - # always write the preprocessed file to stdout, regardless of -o, - # because we must use -o when running libtool. + # always write the preprocessed file to stdout. "$@" || exit $? + + # Remove the call to Libtool. + if test "$libtool" = yes; then + while test "X$1" != 'X--mode=compile'; do + shift + done + shift + fi + IFS=" " for arg do case "$arg" in + -o) + shift + ;; + $object) + shift + ;; "-Gm"|"/Gm"|"-Gi"|"/Gi"|"-ZI"|"/ZI") - set fnord "$@" - shift - shift - ;; + set fnord "$@" + shift + shift + ;; *) - set fnord "$@" "$arg" - shift - shift - ;; + set fnord "$@" "$arg" + shift + shift + ;; esac done - "$@" -E | - sed -n '/^#line [0-9][0-9]* "\([^"]*\)"/ s::echo "`cygpath -u \\"\1\\"`":p' | sort | uniq > "$tmpdepfile" + "$@" -E 2>/dev/null | + sed -n '/^#line [0-9][0-9]* "\([^"]*\)"/ s::\1:p' | $cygpath_u | sort -u > "$tmpdepfile" rm -f "$depfile" echo "$object : \\" > "$depfile" - . "$tmpdepfile" | sed 's% %\\ %g' | sed -n '/^\(.*\)$/ s:: \1 \\:p' >> "$depfile" - echo " " >> "$depfile" - . "$tmpdepfile" | sed 's% %\\ %g' | sed -n '/^\(.*\)$/ s::\1\::p' >> "$depfile" + sed < "$tmpdepfile" -n -e 's% %\\ %g' -e '/^\(.*\)$/ s::'"$tab"'\1 \\:p' >> "$depfile" + echo "$tab" >> "$depfile" + sed < "$tmpdepfile" -n -e 's% %\\ %g' -e '/^\(.*\)$/ s::\1\::p' >> "$depfile" rm -f "$tmpdepfile" ;; +msvcmsys) + # This case exists only to let depend.m4 do its work. It works by + # looking at the text of this script. This case will never be run, + # since it is checked for above. + exit 1 + ;; + none) exec "$@" ;; @@ -522,5 +786,6 @@ # eval: (add-hook 'write-file-hooks 'time-stamp) # time-stamp-start: "scriptversion=" # time-stamp-format: "%:y-%02m-%02d.%02H" -# time-stamp-end: "$" +# time-stamp-time-zone: "UTC" +# time-stamp-end: "; # UTC" # End: diff -Nru filtergen-0.12.4/expr.h filtergen-0.12.7/expr.h --- filtergen-0.12.4/expr.h 2016-02-18 07:59:36.000000000 +0000 +++ filtergen-0.12.7/expr.h 1970-01-01 00:00:00.000000000 +0000 @@ -1,35 +0,0 @@ -#ifndef __EXPR_H__ -#define __EXPR_H__ - -enum expression = { - EXP_AND, - EXP_OR, - EXP_NOT, - EXP_PRED, -}; - -struct expr_s * { - enum expression type; -}; - -enum action = { - ACT_NONE, - ACT_ACCEPT, - ACT_REJECT, - ACT_DROP, -}; - -/* rule is a boolean expression of filtering predicates -> action */ -struct rule_s { - struct expr_s * expr; - enum action act; - struct rule_s * next; -}; - -struct group_s { - char * name; - struct rule_s * rule_list; -}; - - -#endif /* __EXPR_H__ */ diff -Nru filtergen-0.12.4/factoriser.c filtergen-0.12.7/factoriser.c --- filtergen-0.12.4/factoriser.c 2004-05-15 03:26:52.000000000 +0000 +++ filtergen-0.12.7/factoriser.c 1970-01-01 00:00:00.000000000 +0000 @@ -1,25 +0,0 @@ -/* factorise the syntax tree for optimisation - * - * Copyright (c) 2004 Jamie Wilkinson - * - * 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 of the License, 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - -#ifdef HAVE_CONFIG_H -#include "config.h" -#endif - -#include "factoriser.h" - diff -Nru filtergen-0.12.4/factoriser.h filtergen-0.12.7/factoriser.h --- filtergen-0.12.4/factoriser.h 2004-05-15 03:26:45.000000000 +0000 +++ filtergen-0.12.7/factoriser.h 1970-01-01 00:00:00.000000000 +0000 @@ -1,23 +0,0 @@ -/* factorise the ast for optimisation - * - * Copyright (c) 2004 Jamie Wilkinson /dev/null ; then $FILTERGEN $FGOPTS -t $BACKEND $FILTER | /bin/sh diff -Nru filtergen-0.12.4/fg-cisco.c filtergen-0.12.7/fg-cisco.c --- filtergen-0.12.4/fg-cisco.c 2004-06-09 13:11:07.000000000 +0000 +++ filtergen-0.12.7/fg-cisco.c 2016-02-13 10:52:59.000000000 +0000 @@ -26,106 +26,127 @@ #include "filter.h" #include "util.h" -static char *appip(char *r, const struct addr_spec *h) -{ - if(!h->addrstr) return APPS(r, "any"); - if(!h->maskstr) return APPS2(r, "host ", h->addrstr); - return APPSS2(r, h->addrstr, h->maskstr); +static char *appip(char *r, const struct addr_spec *h) { + if (!h->addrstr) + return APPS(r, "any"); + if (!h->maskstr) + return APPS2(r, "host ", h->addrstr); + return APPSS2(r, h->addrstr, h->maskstr); } -static char *appport(char *r, const struct port_spec *p, int neg) -{ - if(!p->minstr) return APPS(r, "any"); - - if(!p->maxstr) - return APPS2(r, neg ? "ne " : "eq ", p->minstr); - - if(neg) abort(); - APPS(r, "range"); - APPSS2(r, p->minstr, p->maxstr); - return r; +static char *appport(char *r, const struct port_spec *p, int neg) { + if (!p->minstr) + return APPS(r, "any"); + + if (!p->maxstr) + return APPS2(r, neg ? "ne " : "eq ", p->minstr); + + if (neg) + abort(); + APPS(r, "range"); + APPSS2(r, p->minstr, p->maxstr); + return r; } -static int cb_cisco_rule(const struct filterent *ent, struct fg_misc *misc __attribute__((unused))) -{ - char *rule = NULL, *rule_r = NULL; - int needret = 0, needports = 1; - - APP(rule, "access-list "); - APP(rule_r, "access-list "); - - /* access list name */ - if(ent->iface) { - APP2(rule, ent->iface, "-"); - APP2(rule_r, ent->iface, "-"); +static int cb_cisco_rule(const struct filterent *ent, + struct fg_misc *misc __attribute__((unused))) { + char *rule = NULL, *rule_r = NULL; + int needret = 0, needports = 1; + + APP(rule, "access-list "); + APP(rule_r, "access-list "); + + /* access list name */ + if (ent->iface) { + APP2(rule, ent->iface, "-"); + APP2(rule_r, ent->iface, "-"); + } + switch (ent->direction) { + case INPUT: + APP(rule, "IN"); + APP(rule_r, "OUT"); + break; + case OUTPUT: + APP(rule, "OUT"); + APP(rule_r, "IN"); + break; + default: + fprintf(stderr, "unknown direction\n"); + abort(); + } + + /* target */ + switch (ent->target) { + case T_ACCEPT: + APPS(rule, "permit"); + APPS(rule_r, "permit"); + break; + case DROP: + APPS(rule, "deny"); + APPS(rule_r, "deny"); + break; + case T_REJECT: + fprintf(stderr, "warning: Cisco IOS does not support REJECT\n"); + APPS(rule, "deny"); + APPS(rule_r, "deny"); + break; + default: + abort(); + } + + /* protocol */ + if (ent->proto.name) { + APPS(rule, ent->proto.name); + APPS(rule_r, ent->proto.name); + switch (ent->proto.num) { + case IPPROTO_TCP: + case IPPROTO_UDP: + needret++; + break; + default: + needports = 0; } - switch(ent->direction) { - case INPUT: APP(rule, "IN"); APP(rule_r, "OUT"); break; - case OUTPUT: APP(rule, "OUT"); APP(rule_r, "IN"); break; - default: fprintf(stderr, "unknown direction\n"); abort(); - } - - /* target */ - switch(ent->target) { - case T_ACCEPT: APPS(rule, "permit"); APPS(rule_r, "permit"); break; - case DROP: APPS(rule, "deny"); APPS(rule_r, "deny"); break; - case T_REJECT: - fprintf(stderr, "warning: Cisco IOS does not support REJECT\n"); - APPS(rule, "deny"); - APPS(rule_r, "deny"); - break; - default: abort(); - } - - /* protocol */ - if(ent->proto.name) { - APPS(rule, ent->proto.name); - APPS(rule_r, ent->proto.name); - switch(ent->proto.num) { - case IPPROTO_TCP: case IPPROTO_UDP: - needret++; - break; - default: - needports = 0; - } - } else { - APPS(rule, "ip"); APPS(rule_r, "ip"); - } - - rule = appip(rule, &ent->srcaddr); - rule = appip(rule, &ent->dstaddr); - rule_r = appip(rule_r, &ent->dstaddr); - rule_r = appip(rule_r, &ent->srcaddr); - - if(needports) { - rule = appport(rule, &ent->u.ports.src, NEG(SPORT)); - rule = appport(rule, &ent->u.ports.dst, NEG(DPORT)); - rule_r = appport(rule_r, &ent->u.ports.dst, NEG(DPORT)); - rule_r = appport(rule_r, &ent->u.ports.src, NEG(SPORT)); - } - - if(ent->proto.num == IPPROTO_TCP) APPS(rule_r, "established"); - if(ESET(ent,LOG)) APPS(rule, "log"); - - if(ent->oneway) needret = 0; - - oputs(rule); - if(needret) oputs(rule_r); - - free(rule); free(rule_r); - return 1 + !!needret; + } else { + APPS(rule, "ip"); + APPS(rule_r, "ip"); + } + + rule = appip(rule, &ent->srcaddr); + rule = appip(rule, &ent->dstaddr); + rule_r = appip(rule_r, &ent->dstaddr); + rule_r = appip(rule_r, &ent->srcaddr); + + if (needports) { + rule = appport(rule, &ent->u.ports.src, NEG(SPORT)); + rule = appport(rule, &ent->u.ports.dst, NEG(DPORT)); + rule_r = appport(rule_r, &ent->u.ports.dst, NEG(DPORT)); + rule_r = appport(rule_r, &ent->u.ports.src, NEG(SPORT)); + } + + if (ent->proto.num == IPPROTO_TCP) + APPS(rule_r, "established"); + if (ESET(ent, LOG)) + APPS(rule, "log"); + + if (ent->oneway) + needret = 0; + + oputs(rule); + if (needret) + oputs(rule_r); + + free(rule); + free(rule_r); + return 1 + !!needret; } -int fg_cisco(struct filter *filter, int flags) -{ - struct fg_misc misc = { flags, NULL }; - fg_callback cb_cisco = { - rule: cb_cisco_rule, NULL - }; - oputs("# Warning: This backend is not complete and " - "can generate broken rulesets."); - filter_nogroup(filter); - filter_unroll(&filter); - filter_apply_flags(filter, flags); - return filtergen_cprod(filter, &cb_cisco, &misc); +int fg_cisco(struct filter *filter, int flags) { + struct fg_misc misc = {flags, NULL}; + fg_callback cb_cisco = {.rule = cb_cisco_rule, NULL}; + oputs("# Warning: This backend is not complete and " + "can generate broken rulesets."); + filter_nogroup(filter); + filter_unroll(&filter); + filter_apply_flags(filter, flags); + return filtergen_cprod(filter, &cb_cisco, &misc); } diff -Nru filtergen-0.12.4/fg-ipchains.c filtergen-0.12.7/fg-ipchains.c --- filtergen-0.12.4/fg-ipchains.c 2004-05-15 03:26:49.000000000 +0000 +++ filtergen-0.12.7/fg-ipchains.c 2016-02-13 10:52:59.000000000 +0000 @@ -31,269 +31,280 @@ /* full path to ipchains executable */ #define IPCHAINS "/sbin/ipchains" - -static char *appip(char *r, const struct addr_spec *h) -{ - APPS(r, h->addrstr); - if(h->maskstr) APP2(r, "/", h->maskstr); - return r; +static char *appip(char *r, const struct addr_spec *h) { + APPS(r, h->addrstr); + if (h->maskstr) + APP2(r, "/", h->maskstr); + return r; } -#define APPIP(r, h) (r = appip(r, h)) -#define APPIP2(f, r, h) (APPS(r, f), APPIP(r, h)) - +#define APPIP(r, h) (r = appip(r, h)) +#define APPIP2(f, r, h) (APPS(r, f), APPIP(r, h)) -static char *appport(char *r, const struct port_spec *h) -{ - APPS(r, h->minstr); - if(h->maxstr) APP2(r, ":", h->maxstr); - return r; +static char *appport(char *r, const struct port_spec *h) { + APPS(r, h->minstr); + if (h->maxstr) + APP2(r, ":", h->maxstr); + return r; } -#define APPPORT(r, h) (r = appport(r, h)) -#define APPPORT2(f, r, h) (APPS(r, f), APPPORT(r, h)) - - -static int cb_ipchains_rule(const struct filterent *ent, struct fg_misc *misc __attribute__((unused))) -{ - char *rule = NULL, *rule_r = NULL; - char *rulechain = NULL, *revchain = NULL; - char *ruletarget = NULL, *revtarget = NULL; - char *forchain = NULL, *forrevchain = NULL; - char *fortarget = NULL, *forrevtarget = NULL; - char *subchain = NULL, *subtarget = NULL; - int needret = 0; - int isforward = (ent->rtype != LOCALONLY); - int orules = 0; - - /* nat rule */ - if((ent->target == MASQ) || (ent->target == REDIRECT)) { - if((ent->target == MASQ) && (ent->direction == INPUT)) { - fprintf(stderr, "can't masquerade on input\n"); - return -1; - } else if((ent->target == REDIRECT) && (ent->direction == OUTPUT)) { - fprintf(stderr, "can't redirect on output\n"); - return -1; - } - } - - /* sub-stuff? */ - if(ent->target == F_SUBGROUP) { - subtarget = strapp(strdup(ent->subgroup), "-"); - needret = 1; - } else - subtarget = strdup(""); - - if(ent->groupname) subchain = strapp(strdup(ent->groupname), "-"); - else subchain = strdup(""); - - if(ent->rtype == ROUTEDONLY) { - fprintf(stderr, "ipchains can't do forward-only rules\n"); - return -1; - } - - switch(ent->direction) { - case INPUT: - rulechain = strdup("input"); - revchain = strdup("output"); - forchain = strdup("forward"); - forrevchain = strdup("forw_out"); - break; - case OUTPUT: - rulechain = (ent->target == MASQ) ? strdup("forw_out") : strdup("output") ; - revchain = strdup("input"); - forchain = strdup("forw_out"); - forrevchain = strdup("forward"); - break; - default: - fprintf(stderr, "unknown direction\n"); - abort(); - } - - if(ent->iface) { - if(NEG(DIRECTION)) { - APPS(rule, "!"); - APPS(rule_r, "!"); - } - APPSS2(rule, "-i", ent->iface); - APPSS2(rule_r, "-i", ent->iface); - } - - /* state and reverse rules here */ - if(ent->proto.name) { - APPSS2(rule, "-p", ent->proto.name); - APPSS2(rule_r, "-p", ent->proto.name); - switch(ent->proto.num) { - case IPPROTO_TCP: - APPS(rule_r, "! --syn"); - /* fall through */ - case IPPROTO_UDP: - needret++; - } - } - - if(ent->srcaddr.addrstr) { - NEGA(rule, SOURCE); NEGA(rule_r, SOURCE); - APPIP2("-s", rule, &ent->srcaddr); - APPIP2("-d", rule_r, &ent->srcaddr); - } - if(ent->dstaddr.addrstr) { - NEGA(rule, DEST); NEGA(rule_r, DEST); - APPIP2("-d", rule, &ent->dstaddr); - APPIP2("-s", rule_r, &ent->dstaddr); - } - - switch(ent->proto.num) { - case 0: break; - case IPPROTO_UDP: case IPPROTO_TCP: - if(ent->u.ports.src.minstr) { - NEGA(rule, SPORT); - NEGA(rule_r, SPORT); - APPPORT2("--sport", rule, &ent->u.ports.src); - APPPORT2("--dport", rule_r, &ent->u.ports.src); - } - if(ent->u.ports.dst.minstr) { - NEGA(rule, DPORT); - NEGA(rule_r, DPORT); - APPPORT2("--dport", rule, &ent->u.ports.dst); - APPPORT2("--sport", rule_r, &ent->u.ports.dst); - } - break; - case IPPROTO_ICMP: - if(ent->u.icmp) { - NEGA(rule, ICMPTYPE); - APPSS2(rule, "--icmp-type", ent->u.icmp); - } - break; - default:; - } - - if(ESET(ent,LOG)) APPS(rule, "-l"); - - APPS(rule, "-j"); APPS(rule_r, "-j"); +#define APPPORT(r, h) (r = appport(r, h)) +#define APPPORT2(f, r, h) (APPS(r, f), APPPORT(r, h)) - switch(ent->target) { - case T_ACCEPT: - ruletarget = revtarget = - fortarget = forrevtarget = strdup("ACCEPT"); - switch(ent->direction) { - case INPUT: - fortarget = strdup("forw_out"); - break; - case OUTPUT: - forrevtarget = strdup("forw_out"); - break; - default: - abort(); - } - break; - case DROP: - ruletarget = fortarget = strdup("DENY"); - needret = 0; - break; - case T_REJECT: - ruletarget = fortarget = strdup("REJECT"); - needret = 0; - break; - case MASQ: - ruletarget = strdup("MASQ"); - revtarget = strdup("ACCEPT"); - break; - case REDIRECT: - ruletarget = strdup("REDIRECT"); - revtarget = strdup("ACCEPT"); - break; - case F_SUBGROUP: - switch(ent->direction) { - case INPUT: - ruletarget = strdup("input"); - revtarget = strdup("output"); - fortarget = strdup("forward"); - forrevtarget = strdup("forw_out"); - break; - case OUTPUT: - ruletarget = strdup("output"); - revtarget = strdup("input"); - fortarget = strdup("forw_out"); - forrevtarget = strdup("forward"); - break; - default: - abort(); - } - break; - default: - abort(); - } - - if(ent->oneway) needret = 0; - - orules++, oprintf(IPCHAINS" -A %s%s %s %s%s\n", subchain, rulechain, rule+1, subtarget, ruletarget); - if(needret) orules++, oprintf(IPCHAINS" -I %s%s %s %s%s\n", subchain, revchain, rule_r+1, subtarget, revtarget); - if(isforward) { - orules++, oprintf(IPCHAINS" -A %s%s %s %s%s\n", subchain, forchain, rule+1, subtarget, fortarget); - if(needret) orules++, oprintf(IPCHAINS" -I %s%s %s %s%s\n", subchain, forrevchain, rule_r+1, subtarget, forrevtarget); - } - - free(rule); free(rule_r); - free(subchain); free(subtarget); - return orules; +static int cb_ipchains_rule(const struct filterent *ent, + struct fg_misc *misc __attribute__((unused))) { + char *rule = NULL, *rule_r = NULL; + char *rulechain = NULL, *revchain = NULL; + char *ruletarget = NULL, *revtarget = NULL; + char *forchain = NULL, *forrevchain = NULL; + char *fortarget = NULL, *forrevtarget = NULL; + char *subchain = NULL, *subtarget = NULL; + int needret = 0; + int isforward = (ent->rtype != LOCALONLY); + int orules = 0; + + /* nat rule */ + if ((ent->target == MASQ) || (ent->target == REDIRECT)) { + if ((ent->target == MASQ) && (ent->direction == INPUT)) { + fprintf(stderr, "can't masquerade on input\n"); + return -1; + } else if ((ent->target == REDIRECT) && (ent->direction == OUTPUT)) { + fprintf(stderr, "can't redirect on output\n"); + return -1; + } + } + + /* sub-stuff? */ + if (ent->target == F_SUBGROUP) { + subtarget = strapp(strdup(ent->subgroup), "-"); + needret = 1; + } else + subtarget = strdup(""); + + if (ent->groupname) + subchain = strapp(strdup(ent->groupname), "-"); + else + subchain = strdup(""); + + if (ent->rtype == ROUTEDONLY) { + fprintf(stderr, "ipchains can't do forward-only rules\n"); + return -1; + } + + switch (ent->direction) { + case INPUT: + rulechain = strdup("input"); + revchain = strdup("output"); + forchain = strdup("forward"); + forrevchain = strdup("forw_out"); + break; + case OUTPUT: + rulechain = (ent->target == MASQ) ? strdup("forw_out") : strdup("output"); + revchain = strdup("input"); + forchain = strdup("forw_out"); + forrevchain = strdup("forward"); + break; + default: + fprintf(stderr, "unknown direction\n"); + abort(); + } + + if (ent->iface && strcmp(ent->iface, "*")) { + if (NEG(DIRECTION)) { + APPS(rule, "!"); + APPS(rule_r, "!"); + } + APPSS2(rule, "-i", ent->iface); + APPSS2(rule_r, "-i", ent->iface); + } + + /* state and reverse rules here */ + if (ent->proto.name) { + APPSS2(rule, "-p", ent->proto.name); + APPSS2(rule_r, "-p", ent->proto.name); + switch (ent->proto.num) { + case IPPROTO_TCP: + APPS(rule_r, "! --syn"); + /* fall through */ + case IPPROTO_UDP: + needret++; + } + } + + if (ent->srcaddr.addrstr) { + NEGA(rule, SOURCE); + NEGA(rule_r, SOURCE); + APPIP2("-s", rule, &ent->srcaddr); + APPIP2("-d", rule_r, &ent->srcaddr); + } + if (ent->dstaddr.addrstr) { + NEGA(rule, DEST); + NEGA(rule_r, DEST); + APPIP2("-d", rule, &ent->dstaddr); + APPIP2("-s", rule_r, &ent->dstaddr); + } + + switch (ent->proto.num) { + case 0: + break; + case IPPROTO_UDP: + case IPPROTO_TCP: + if (ent->u.ports.src.minstr) { + NEGA(rule, SPORT); + NEGA(rule_r, SPORT); + APPPORT2("--sport", rule, &ent->u.ports.src); + APPPORT2("--dport", rule_r, &ent->u.ports.src); + } + if (ent->u.ports.dst.minstr) { + NEGA(rule, DPORT); + NEGA(rule_r, DPORT); + APPPORT2("--dport", rule, &ent->u.ports.dst); + APPPORT2("--sport", rule_r, &ent->u.ports.dst); + } + break; + case IPPROTO_ICMP: + if (ent->u.icmp) { + NEGA(rule, ICMPTYPE); + APPSS2(rule, "--icmp-type", ent->u.icmp); + } + break; + default: + ; + } + + if (ESET(ent, LOG)) + APPS(rule, "-l"); + + APPS(rule, "-j"); + APPS(rule_r, "-j"); + + switch (ent->target) { + case T_ACCEPT: + ruletarget = revtarget = fortarget = forrevtarget = strdup("ACCEPT"); + switch (ent->direction) { + case INPUT: + fortarget = strdup("forw_out"); + break; + case OUTPUT: + forrevtarget = strdup("forw_out"); + break; + default: + abort(); + } + break; + case DROP: + ruletarget = fortarget = strdup("DENY"); + needret = 0; + break; + case T_REJECT: + ruletarget = fortarget = strdup("REJECT"); + needret = 0; + break; + case MASQ: + ruletarget = strdup("MASQ"); + revtarget = strdup("ACCEPT"); + break; + case REDIRECT: + ruletarget = strdup("REDIRECT"); + revtarget = strdup("ACCEPT"); + break; + case F_SUBGROUP: + switch (ent->direction) { + case INPUT: + ruletarget = strdup("input"); + revtarget = strdup("output"); + fortarget = strdup("forward"); + forrevtarget = strdup("forw_out"); + break; + case OUTPUT: + ruletarget = strdup("output"); + revtarget = strdup("input"); + fortarget = strdup("forw_out"); + forrevtarget = strdup("forward"); + break; + default: + abort(); + } + break; + default: + abort(); + } + + if (ent->oneway) + needret = 0; + + orules++, oprintf(IPCHAINS " -A %s%s %s %s%s\n", subchain, rulechain, + rule + 1, subtarget, ruletarget); + if (needret) + orules++, oprintf(IPCHAINS " -I %s%s %s %s%s\n", subchain, revchain, + rule_r + 1, subtarget, revtarget); + if (isforward) { + orules++, oprintf(IPCHAINS " -A %s%s %s %s%s\n", subchain, forchain, + rule + 1, subtarget, fortarget); + if (needret) + orules++, oprintf(IPCHAINS " -I %s%s %s %s%s\n", subchain, forrevchain, + rule_r + 1, subtarget, forrevtarget); + } + + free(rule); + free(rule_r); + free(subchain); + free(subtarget); + return orules; } -static int cb_ipchains_group(const char *name) -{ - oprintf("for f in input output forward forw_out; do "IPCHAINS" -N %s-${f}; done\n", name); - return 1; +static int cb_ipchains_group(const char *name) { + oprintf("for f in input output forward forw_out; do " IPCHAINS + " -N %s-${f}; done\n", + name); + return 1; } -int fg_ipchains(struct filter *filter, int flags) -{ - int r; - struct fg_misc misc = { flags, NULL }; - fg_callback cb_ipchains = { - rule: cb_ipchains_rule, - group: cb_ipchains_group, - }; - - filter_unroll(&filter); - filter_apply_flags(filter, flags); - if(!(flags & FF_NOSKEL)) { - oputs("for f in INPUT OUTPUT FORWARD; do "IPCHAINS" -P $f DENY; done"); - oputs(IPCHAINS" -F; "IPCHAINS" -X"); - oputs(IPCHAINS" -N forw_out"); - } - if((r = filtergen_cprod(filter, &cb_ipchains, &misc)) < 0) - return r; +int fg_ipchains(struct filter *filter, int flags) { + int r; + struct fg_misc misc = {flags, NULL}; + fg_callback cb_ipchains = { + .rule = cb_ipchains_rule, .group = cb_ipchains_group, + }; + + filter_unroll(&filter); + filter_apply_flags(filter, flags); + if (!(flags & FF_NOSKEL)) { + oputs("for f in INPUT OUTPUT FORWARD; do " IPCHAINS " -P $f DENY; done"); + oputs(IPCHAINS " -F; " IPCHAINS " -X"); + oputs(IPCHAINS " -N forw_out"); + } + if ((r = filtergen_cprod(filter, &cb_ipchains, &misc)) < 0) + return r; #if 0 if(!(flags & FF_NOSKEL)) { oputs("for f in INPUT OUTPUT FORWARD forw_out; do "IPCHAINS" -A $f -l -j DENY; done"); r += 3; } #endif - return r; + return r; } - /* Rules which just flush the packet filter */ -int flush_ipchains(enum filtertype policy) -{ - char *ostr; - oputs("CHAINS=\"INPUT OUTPUT FORWARD\""); - oputs(""); - - switch(policy) { - case T_ACCEPT: - ostr = strdup("ACCEPT"); - break; - case DROP: - ostr = strdup("DENY"); - break; - case T_REJECT: - ostr = strdup("REJECT"); - break; - default: - fprintf(stderr, "invalid filtertype %d\n", policy); - abort(); - } - oprintf("for f in $CHAINS; do "IPCHAINS" -P $f %s; done\n", ostr); - oputs(IPCHAINS" -F; "IPCHAINS" -X"); +int flush_ipchains(enum filtertype policy) { + char *ostr; + oputs("CHAINS=\"INPUT OUTPUT FORWARD\""); + oputs(""); + + switch (policy) { + case T_ACCEPT: + ostr = strdup("ACCEPT"); + break; + case DROP: + ostr = strdup("DENY"); + break; + case T_REJECT: + ostr = strdup("REJECT"); + break; + default: + fprintf(stderr, "invalid filtertype %d\n", policy); + abort(); + } + oprintf("for f in $CHAINS; do " IPCHAINS " -P $f %s; done\n", ostr); + oputs(IPCHAINS " -F; " IPCHAINS " -X"); - return 0; + return 0; } diff -Nru filtergen-0.12.4/fg-ipfilter.c filtergen-0.12.7/fg-ipfilter.c --- filtergen-0.12.4/fg-ipfilter.c 2004-06-09 13:10:45.000000000 +0000 +++ filtergen-0.12.7/fg-ipfilter.c 2016-02-13 10:52:59.000000000 +0000 @@ -29,101 +29,113 @@ #include "filter.h" #include "util.h" -static char *appip(char *r, const struct addr_spec *h) -{ - if(!h->addrstr) return APPS(r, "any"); - APPS(r, h->addrstr); - if(h->maskstr) APP2(r, "/", h->maskstr); - return r; +static char *appip(char *r, const struct addr_spec *h) { + if (!h->addrstr) + return APPS(r, "any"); + APPS(r, h->addrstr); + if (h->maskstr) + APP2(r, "/", h->maskstr); + return r; } -static char *appport(char *r, const struct port_spec *p, int neg) -{ - if(!p->minstr) return r; - - APPS(r, "port"); - if(!p->maxstr) - return APPSS2(r, neg ? "!=" : "=", p->minstr); - - APPS(r, p->minstr); - APPSS2(r, neg ? "><" : "<>", p->maxstr); +static char *appport(char *r, const struct port_spec *p, int neg) { + if (!p->minstr) return r; + + APPS(r, "port"); + if (!p->maxstr) + return APPSS2(r, neg ? "!=" : "=", p->minstr); + + APPS(r, p->minstr); + APPSS2(r, neg ? "><" : "<>", p->maxstr); + return r; } -static char *appicmp(char *r, const char *h, int neg) -{ - if(!h) return r; - if(neg) APPS(r, "!"); - return APPSS2(r, "icmp-type", h); +static char *appicmp(char *r, const char *h, int neg) { + if (!h) + return r; + if (neg) + APPS(r, "!"); + return APPSS2(r, "icmp-type", h); } -static int cb_ipfilter_rule(const struct filterent *ent, struct fg_misc *misc __attribute__((unused))) -{ - char *rule = NULL; - - /* target first */ - switch(ent->target) { - case T_ACCEPT: APP(rule, "pass"); break; - case DROP: APP(rule, "block"); break; - case T_REJECT: - /* XXX - can this violate the rule about icmp errors - * about icmp errors? */ - if (ent->proto.num == IPPROTO_TCP) - APP(rule, "block return-rst"); - else - APP(rule, "block return-icmp-as-dest(port-unr)"); - break; - default: abort(); - } - - /* in or out? */ - switch(ent->direction) { - case INPUT: APPS(rule, "in"); break; - case OUTPUT: APPS(rule, "out"); break; - default: fprintf(stderr, "unknown direction\n"); abort(); - } - - if(ESET(ent,LOG)) APPS(rule, "log"); - - /* XXX - All our rules have to be "quick", but ipfilter - * people seem to prefer having defaults at the top. - * It would be nice to improve the output readability. - */ - APPS(rule, "quick"); - - /* access list name */ - if(ent->iface) APPSS2(rule, "on", ent->iface); - - /* protocol */ - if(ent->proto.name) - APPSS2(rule, "proto", ent->proto.name); - - APPS(rule, "from"); - rule = appip(rule, &ent->srcaddr); - rule = appport(rule, &ent->u.ports.src, NEG(SPORT)); - APPS(rule, "to"); - rule = appip(rule, &ent->dstaddr); - rule = appport(rule, &ent->u.ports.dst, NEG(DPORT)); - - rule = appicmp(rule, ent->u.icmp, NEG(ICMPTYPE)); - - if(ent->proto.name && (ent->target == T_ACCEPT) && !ent->oneway) - APPS(rule, "keep state"); - - oputs(rule); - free(rule); - return 1; +static int cb_ipfilter_rule(const struct filterent *ent, + struct fg_misc *misc __attribute__((unused))) { + char *rule = NULL; + + /* target first */ + switch (ent->target) { + case T_ACCEPT: + APP(rule, "pass"); + break; + case DROP: + APP(rule, "block"); + break; + case T_REJECT: + /* XXX - can this violate the rule about icmp errors + * about icmp errors? */ + if (ent->proto.num == IPPROTO_TCP) + APP(rule, "block return-rst"); + else + APP(rule, "block return-icmp-as-dest(port-unr)"); + break; + default: + abort(); + } + + /* in or out? */ + switch (ent->direction) { + case INPUT: + APPS(rule, "in"); + break; + case OUTPUT: + APPS(rule, "out"); + break; + default: + fprintf(stderr, "unknown direction\n"); + abort(); + } + + if (ESET(ent, LOG)) + APPS(rule, "log"); + + /* XXX - All our rules have to be "quick", but ipfilter + * people seem to prefer having defaults at the top. + * It would be nice to improve the output readability. + */ + APPS(rule, "quick"); + + /* access list name */ + if (ent->iface) + APPSS2(rule, "on", ent->iface); + + /* protocol */ + if (ent->proto.name) + APPSS2(rule, "proto", ent->proto.name); + + APPS(rule, "from"); + rule = appip(rule, &ent->srcaddr); + rule = appport(rule, &ent->u.ports.src, NEG(SPORT)); + APPS(rule, "to"); + rule = appip(rule, &ent->dstaddr); + rule = appport(rule, &ent->u.ports.dst, NEG(DPORT)); + + rule = appicmp(rule, ent->u.icmp, NEG(ICMPTYPE)); + + if (ent->proto.name && (ent->target == T_ACCEPT) && !ent->oneway) + APPS(rule, "keep state"); + + oputs(rule); + free(rule); + return 1; } -int fg_ipfilter(struct filter *filter, int flags) -{ - struct fg_misc misc = { flags, NULL }; - fg_callback cb_ipfilter = { - rule: cb_ipfilter_rule, NULL - }; - - filter_nogroup(filter); - filter_unroll(&filter); - filter_apply_flags(filter, flags); - return filtergen_cprod(filter, &cb_ipfilter, &misc); +int fg_ipfilter(struct filter *filter, int flags) { + struct fg_misc misc = {flags, NULL}; + fg_callback cb_ipfilter = {.rule = cb_ipfilter_rule, NULL}; + + filter_nogroup(filter); + filter_unroll(&filter); + filter_apply_flags(filter, flags); + return filtergen_cprod(filter, &cb_ipfilter, &misc); } diff -Nru filtergen-0.12.4/fg-iptables.c filtergen-0.12.7/fg-iptables.c --- filtergen-0.12.4/fg-iptables.c 2016-02-18 07:59:36.000000000 +0000 +++ filtergen-0.12.7/fg-iptables.c 2016-02-13 10:52:59.000000000 +0000 @@ -47,376 +47,454 @@ #include "util.h" /* bitfields for features used */ -#define REJECT 0x01 -#define A_TCP 0x10 -#define A_UDP 0x20 +#define REJECT 0x01 +#define A_TCP 0x10 +#define A_UDP 0x20 -/* full path to iptables executable */ +/* full path to ip{,6}tables executables */ #define IPTABLES "/sbin/iptables" +#define IP6TABLES "/sbin/ip6tables" -static char *appip(char *r, const struct addr_spec *h) -{ - APPS(r, h->addrstr); - if(h->maskstr) APP2(r, "/", h->maskstr); - return r; +static char *appip(char *r, const struct addr_spec *h) { + APPS(r, h->addrstr); + if (h->maskstr) + APP2(r, "/", h->maskstr); + return r; } -#define APPIP(r, h) (r = appip(r, h)) -#define APPIP2(f, r, h) (APPS(r, f), APPIP(r, h)) +#define APPIP(r, h) (r = appip(r, h)) +#define APPIP2(f, r, h) (APPS(r, f), APPIP(r, h)) +static char *appport(char *r, const struct port_spec *h) { + APPS(r, h->minstr); + if (h->maxstr) + APP2(r, ":", h->maxstr); + return r; +} +#define APPPORT(r, h) (r = appport(r, h)) +#define APPPORT2(f, r, h) (APPS(r, f), APPPORT(r, h)) -static char *appport(char *r, const struct port_spec *h) -{ - APPS(r, h->minstr); - if(h->maxstr) APP2(r, ":", h->maxstr); - return r; +static int cb_iptables_rule_common(const struct filterent *ent, + struct fg_misc *misc, sa_family_t family, + const char *iptables) { + char *rulechain = NULL, *revchain = NULL, *natchain = NULL; + char *ruletarget = NULL, *revtarget = NULL, *nattarget = NULL; + char *natrule = NULL, *rule = NULL, *rule_r = NULL; + char *forchain = NULL, *forrevchain = NULL; + char *fortarget = NULL, *forrevtarget = NULL; + char *subchain = NULL, *subtarget = NULL; + int neednat = 0, needret = 0; + int islocal = (ent->rtype != ROUTEDONLY); + int isforward = (ent->rtype != LOCALONLY); + long *feat = (long *)misc->misc; + enum filtertype target = ent->target; + int orules = 0; + + /* nat rule? */ + if ((target == MASQ) || (target == REDIRECT)) { + neednat = 1; + if (family == AF_INET6) { + fprintf(stderr, "can't NAT with IPv6\n"); + return -1; + } + if ((target == MASQ) && (ent->direction == INPUT)) { + fprintf(stderr, "can't masquerade on input\n"); + return -1; + } else if ((target == REDIRECT) && (ent->direction == OUTPUT)) { + fprintf(stderr, "can't redirect on output\n"); + return -1; + } + } + + /* sub-stuff? */ + if (target == F_SUBGROUP) { + subtarget = strapp(strdup(ent->subgroup), "-"); + needret = 1; + } else + subtarget = strdup(""); + + if (ent->groupname) + subchain = strapp(strdup(ent->groupname), "-"); + else + subchain = strdup(""); + + switch (ent->direction) { + case INPUT: + natchain = strdup("PREROUTING"); + rulechain = strdup("INPUT"); + revchain = strdup("OUTPUT"); + forchain = strdup("FORWARD"); + forrevchain = strdup("FORW_OUT"); + if (ent->iface && strcmp(ent->iface, "*")) { + if (NEG(DIRECTION)) { + APPS(natrule, "!"); + APPS(rule, "!"); + APPS(rule_r, "!"); + } + if (strcmp(ent->iface, "*")) { + APPSS2(natrule, "-i", ent->iface); + APPSS2(rule, "-i", ent->iface); + APPSS2(rule_r, "-o", ent->iface); + } + } + break; + case OUTPUT: + natchain = strdup("POSTROUTING"); + rulechain = strdup("OUTPUT"); + revchain = strdup("INPUT"); + forchain = strdup("FORW_OUT"); + forrevchain = strdup("FORWARD"); + if (ent->iface && strcmp(ent->iface, "*")) { + if (NEG(DIRECTION)) { + APPS(natrule, "!"); + APPS(rule, "!"); + APPS(rule_r, "!"); + } + if (strcmp(ent->iface, "*")) { + APPSS2(natrule, "-o", ent->iface); + APPSS2(rule, "-o", ent->iface); + APPSS2(rule_r, "-i", ent->iface); + } + } + break; + default: + fprintf(stderr, "unknown direction\n"); + abort(); + } + + /* state and reverse rules here */ + /* FIXME: state established on reverse for every rule, not just + * specifically udp and tcp */ + if (ent->proto.name) { + int needstate = 0; + + APPSS2(natrule, "-p", ent->proto.name); + APPSS2(rule, "-p", ent->proto.name); + APPSS2(rule_r, "-p", ent->proto.name); + switch (ent->proto.num) { + case IPPROTO_TCP: + needret++; + needstate++; + *feat |= A_TCP; + APPS(rule_r, "! --syn"); + break; + case IPPROTO_UDP: + needret++; + needstate++; + *feat |= A_UDP; + break; + } + if (needstate) { + APPS(rule, "-m state --state NEW,ESTABLISHED"); + APPS(rule_r, "-m state --state ESTABLISHED"); + } + } + + if (ent->srcaddr.addrstr) { + NEGA(natrule, SOURCE); + NEGA(rule, SOURCE); + NEGA(rule_r, SOURCE); + APPIP2("-s", natrule, &ent->srcaddr); + APPIP2("-s", rule, &ent->srcaddr); + APPIP2("-d", rule_r, &ent->srcaddr); + } + if (ent->dstaddr.addrstr) { + NEGA(natrule, DEST); + NEGA(rule, DEST); + NEGA(rule_r, DEST); + APPIP2("-d", natrule, &ent->dstaddr); + APPIP2("-d", rule, &ent->dstaddr); + APPIP2("-s", rule_r, &ent->dstaddr); + } + + switch (ent->proto.num) { + case 0: + break; + case IPPROTO_UDP: + case IPPROTO_TCP: + if (ent->u.ports.src.minstr) { + NEGA(natrule, SPORT); + NEGA(rule, SPORT); + NEGA(rule_r, SPORT); + APPPORT2("--sport", natrule, &ent->u.ports.src); + APPPORT2("--sport", rule, &ent->u.ports.src); + APPPORT2("--dport", rule_r, &ent->u.ports.src); + } + if (ent->u.ports.dst.minstr) { + NEGA(natrule, DPORT); + NEGA(rule, DPORT); + NEGA(rule_r, DPORT); + APPPORT2("--dport", natrule, &ent->u.ports.dst); + APPPORT2("--dport", rule, &ent->u.ports.dst); + APPPORT2("--sport", rule_r, &ent->u.ports.dst); + } + break; + case IPPROTO_ICMP: + if (ent->u.icmp) { + NEGA(natrule, ICMPTYPE); + APPSS2(natrule, "--icmp-type", ent->u.icmp); + NEGA(rule, ICMPTYPE); + APPSS2(rule, "--icmp-type", ent->u.icmp); + } + break; + default: + ; + } + + APPS(natrule, "-j"); + APPS(rule, "-j"); + APPS(rule_r, "-j"); + + /* The "rule+1" in the printfs below are an ugly hack to + * prevent a double-space in the output rule */ + + /* Yuck, separate rules for logging packets. Be still my + * beating lunch. + * + * Logging and target rules have to be the last bits + * before output, or this doesn't work. This will also + * fail if any mangling has been done above. + */ + if (ESET(ent, LOG)) { + char *lc, *la, *ls; + if (ent->logmsg) { + lc = strdup(" --log-prefix="); + la = ent->logmsg; + ls = strdup("\" \""); + } else + lc = la = ls = strdup(""); + if (islocal) + orules++, oprintf("%s -A %s %s LOG%s%s%s\n", iptables, rulechain, + rule + 1, lc, la, ls); + if (isforward) + orules++, oprintf("%s -A %s %s LOG%s%s%s\n", iptables, forchain, rule + 1, + lc, la, ls); + } + + /* Do this twice, once for NAT, once for filter */ + if (neednat) { + switch (target) { + case MASQ: + nattarget = strdup("MASQUERADE"); + break; + case REDIRECT: + nattarget = strdup("REDIRECT"); + break; + default: + abort(); + } + } + + switch (target) { + case MASQ: + case REDIRECT: + case T_ACCEPT: + ruletarget = revtarget = fortarget = forrevtarget = strdup("ACCEPT"); + switch (ent->direction) { + case INPUT: + fortarget = strdup("FORW_OUT"); + break; + case OUTPUT: + forrevtarget = strdup("FORW_OUT"); + break; + default: + abort(); + } + break; + case DROP: + ruletarget = fortarget = strdup("DROP"); + needret = 0; + break; + case T_REJECT: + ruletarget = fortarget = strdup("REJECT"); + needret = 0; + *feat |= T_REJECT; + break; + case F_SUBGROUP: + switch (ent->direction) { + case INPUT: + ruletarget = strdup("INPUT"); + revtarget = strdup("OUTPUT"); + fortarget = strdup("FORWARD"); + forrevtarget = strdup("FORW_OUT"); + break; + case OUTPUT: + ruletarget = strdup("OUTPUT"); + revtarget = strdup("INPUT"); + fortarget = strdup("FORW_OUT"); + forrevtarget = strdup("FORWARD"); + break; + default: + abort(); + } + break; + default: + abort(); + } + + if ((misc->flags & FF_LSTATE) && (target != T_REJECT)) + needret = 0; + + if (ent->oneway) + needret = 0; + + if (neednat) + orules++, oprintf("%s -t nat -A %s%s %s %s%s\n", iptables, subchain, + natchain, natrule + 1, subtarget, nattarget); + if (islocal) + orules++, oprintf("%s -A %s%s %s %s%s\n", iptables, subchain, rulechain, + rule + 1, subtarget, ruletarget); + if (needret) + orules++, oprintf("%s -I %s%s %s %s%s\n", iptables, subchain, revchain, + rule_r + 1, subtarget, revtarget); + if (isforward) { + orules++, oprintf("%s -A %s%s %s %s%s\n", iptables, subchain, forchain, + rule + 1, subtarget, fortarget); + if (needret) + orules++, oprintf("%s -I %s%s %s %s%s\n", iptables, subchain, forrevchain, + rule_r + 1, subtarget, forrevtarget); + } + + free(natrule); + free(rule); + free(rule_r); + free(subchain); + free(subtarget); + return orules; +} + +static int cb_iptables_rule(const struct filterent *ent, struct fg_misc *misc) { + return cb_iptables_rule_common(ent, misc, AF_INET, IPTABLES); +} + +static int cb_ip6tables_rule(const struct filterent *ent, + struct fg_misc *misc) { + return cb_iptables_rule_common(ent, misc, AF_INET6, IP6TABLES); +} + +static int cb_iptables_group_common(const char *name, const char *iptables) { + oprintf("for f in INPUT OUTPUT FORWARD FORW_OUT; do %s -N %s-$f; done\n", + iptables, name); + return 4; } -#define APPPORT(r, h) (r = appport(r, h)) -#define APPPORT2(f, r, h) (APPS(r, f), APPPORT(r, h)) +static int cb_iptables_group(const char *name) { + return cb_iptables_group_common(name, IPTABLES); +} + +static int cb_ip6tables_group(const char *name) { + return cb_iptables_group_common(name, IP6TABLES); +} + +static int fg_iptables_common(struct filter *filter, int flags, + sa_family_t family, const char *iptables) { + long feat = 0; + int r = 0; + struct fg_misc misc = {flags, &feat}; + fg_callback cb_iptables = { + .rule = family == AF_INET ? cb_iptables_rule : cb_ip6tables_rule, + .group = family == AF_INET ? cb_iptables_group : cb_ip6tables_group, + }; + const int nchains = 3; + + filter_unroll(&filter); + filter_apply_flags(filter, flags); + + if (!(flags & FF_NOSKEL)) { + oputs("CHAINS=\"INPUT OUTPUT FORWARD\""); + oputs(""); + + oputs("# Flush/remove rules, set policy"); + oprintf("for f in $CHAINS; do %s -P $f DROP; done\n", iptables); + oprintf("%s -F; %s -X\n", iptables, iptables); + if (family == AF_INET) + oprintf("%s -t nat -F; %s -t nat -X\n", iptables, iptables); + oputs(""); -static int cb_iptables_rule(const struct filterent *ent, struct fg_misc *misc) -{ - char *rulechain = NULL, *revchain = NULL, *natchain = NULL; - char *ruletarget = NULL, *revtarget = NULL, *nattarget = NULL; - char *natrule = NULL, *rule = NULL, *rule_r = NULL; - char *forchain = NULL, *forrevchain = NULL; - char *fortarget = NULL, *forrevtarget = NULL; - char *subchain = NULL, *subtarget = NULL; - int neednat = 0, needret = 0; - int islocal = (ent->rtype != ROUTEDONLY); - int isforward = (ent->rtype != LOCALONLY); - long *feat = (long*)misc->misc; - enum filtertype target = ent->target; - int orules = 0; - - /* nat rule? */ - if((target == MASQ) || (target == REDIRECT)) { - neednat = 1; - if((target == MASQ) && (ent->direction == INPUT)) { - fprintf(stderr, "can't masquerade on input\n"); - return -1; - } else if((target == REDIRECT) && (ent->direction == OUTPUT)) { - fprintf(stderr, "can't redirect on output\n"); - return -1; - } - } - - /* sub-stuff? */ - if(target == F_SUBGROUP) { - subtarget = strapp(strdup(ent->subgroup), "-"); - needret = 1; - } else subtarget = strdup(""); - - if(ent->groupname) subchain = strapp(strdup(ent->groupname), "-"); - else subchain = strdup(""); - - switch(ent->direction) { - case INPUT: - natchain = strdup("PREROUTING"); - rulechain = strdup("INPUT"); - revchain = strdup("OUTPUT"); - forchain = strdup("FORWARD"); - forrevchain = strdup("FORW_OUT"); - if(ent->iface) { - if(NEG(DIRECTION)) { - APPS(natrule, "!"); - APPS(rule, "!"); - APPS(rule_r, "!"); - } - APPSS2(natrule, "-i", ent->iface); - APPSS2(rule, "-i", ent->iface); - APPSS2(rule_r, "-o", ent->iface); - } - break; - case OUTPUT: - natchain = strdup("POSTROUTING"); - rulechain = strdup("OUTPUT"); - revchain = strdup("INPUT"); - forchain = strdup("FORW_OUT"); - forrevchain = strdup("FORWARD"); - if(ent->iface) { - if(NEG(DIRECTION)) { - APPS(natrule, "!"); - APPS(rule, "!"); - APPS(rule_r, "!"); - } - APPSS2(natrule, "-o", ent->iface); - APPSS2(rule, "-o", ent->iface); - APPSS2(rule_r, "-i", ent->iface); - } - break; - default: fprintf(stderr, "unknown direction\n"); abort(); - } - - /* state and reverse rules here */ - /* FIXME: state established on reverse for every rule, not just - * specifically udp and tcp */ - if(ent->proto.name) { - int needstate = 0; - - APPSS2(natrule, "-p", ent->proto.name); - APPSS2(rule, "-p", ent->proto.name); - APPSS2(rule_r, "-p", ent->proto.name); - switch(ent->proto.num) { - case IPPROTO_TCP: - needret++; - needstate++; - *feat |= A_TCP; - APPS(rule_r, "! --syn"); - break; - case IPPROTO_UDP: - needret++; - needstate++; - *feat |= A_UDP; - break; - } - if(needstate) { - APPS(rule, "-m state --state NEW,ESTABLISHED"); - APPS(rule_r, "-m state --state ESTABLISHED"); - } - } - - if(ent->srcaddr.addrstr) { - NEGA(natrule, SOURCE); NEGA(rule, SOURCE); NEGA(rule_r, SOURCE); - APPIP2("-s", natrule, &ent->srcaddr); - APPIP2("-s", rule, &ent->srcaddr); - APPIP2("-d", rule_r, &ent->srcaddr); - } - if(ent->dstaddr.addrstr) { - NEGA(natrule, DEST); NEGA(rule, DEST); NEGA(rule_r, DEST); - APPIP2("-d", natrule, &ent->dstaddr); - APPIP2("-d", rule, &ent->dstaddr); - APPIP2("-s", rule_r, &ent->dstaddr); - } - - switch(ent->proto.num) { - case 0: break; - case IPPROTO_UDP: case IPPROTO_TCP: - if(ent->u.ports.src.minstr) { - NEGA(natrule, SPORT); - NEGA(rule, SPORT); - NEGA(rule_r, SPORT); - APPPORT2("--sport", natrule, &ent->u.ports.src); - APPPORT2("--sport", rule, &ent->u.ports.src); - APPPORT2("--dport", rule_r, &ent->u.ports.src); - } - if(ent->u.ports.dst.minstr) { - NEGA(natrule, DPORT); - NEGA(rule, DPORT); - NEGA(rule_r, DPORT); - APPPORT2("--dport", natrule, &ent->u.ports.dst); - APPPORT2("--dport", rule, &ent->u.ports.dst); - APPPORT2("--sport", rule_r, &ent->u.ports.dst); - } - break; - case IPPROTO_ICMP: - if(ent->u.icmp) { - NEGA(natrule, ICMPTYPE); - APPSS2(natrule, "--icmp-type", ent->u.icmp); - NEGA(rule, ICMPTYPE); - APPSS2(rule, "--icmp-type", ent->u.icmp); - } - break; - default:; - } - - APPS(natrule, "-j"); APPS(rule, "-j"); APPS(rule_r, "-j"); - - /* The "rule+1" in the printfs below are an ugly hack to - * prevent a double-space in the output rule */ - - /* Yuck, separate rules for logging packets. Be still my - * beating lunch. - * - * Logging and target rules have to be the last bits - * before output, or this doesn't work. This will also - * fail if any mangling has been done above. - */ - if(ESET(ent, LOG)) { - char *lc, *la, *ls; - if(ent->logmsg) { - lc = strdup(" --log-prefix="); - la = ent->logmsg; - ls = strdup("\" \""); - } else - lc = la = ls = strdup(""); - if(islocal) orules++,oprintf(IPTABLES" -A %s %s LOG%s%s%s\n", rulechain, rule+1, lc, la, ls); - if(isforward) orules++,oprintf(IPTABLES" -A %s %s LOG%s%s%s\n", forchain, rule+1, lc, la, ls); - } - - /* Do this twice, once for NAT, once for filter */ - if(neednat) { - switch(target) { - case MASQ: - nattarget = strdup("MASQUERADE"); - break; - case REDIRECT: - nattarget = strdup("REDIRECT"); - break; - default: - abort(); - } - } - - switch(target) { - case MASQ: - case REDIRECT: - case T_ACCEPT: - ruletarget = revtarget = - fortarget = forrevtarget = strdup("ACCEPT"); - switch(ent->direction) { - case INPUT: - fortarget = strdup("FORW_OUT"); - break; - case OUTPUT: - forrevtarget = strdup("FORW_OUT"); - break; - default: - abort(); - } - break; - case DROP: - ruletarget = fortarget = strdup("DROP"); - needret = 0; - break; - case T_REJECT: - ruletarget = fortarget = strdup("REJECT"); - needret = 0; - *feat |= T_REJECT; - break; - case F_SUBGROUP: - switch(ent->direction) { - case INPUT: - ruletarget = strdup("INPUT"); - revtarget = strdup("OUTPUT"); - fortarget = strdup("FORWARD"); - forrevtarget = strdup("FORW_OUT"); - break; - case OUTPUT: - ruletarget = strdup("OUTPUT"); - revtarget = strdup("INPUT"); - fortarget = strdup("FORW_OUT"); - forrevtarget = strdup("FORWARD"); - break; - default: - abort(); - } - break; - default: - abort(); - } - - if((misc->flags & FF_LSTATE) && (target != T_REJECT)) needret = 0; - - if(ent->oneway) needret = 0; - - if(neednat) orules++,oprintf(IPTABLES" -t nat -A %s%s %s %s%s\n", subchain, natchain, natrule+1, subtarget, nattarget); - if(islocal) orules++,oprintf(IPTABLES" -A %s%s %s %s%s\n", subchain, rulechain, rule+1, subtarget, ruletarget); - if(needret) orules++,oprintf(IPTABLES" -I %s%s %s %s%s\n", subchain, revchain, rule_r+1, subtarget, revtarget); - if(isforward) { - orules++,oprintf(IPTABLES" -A %s%s %s %s%s\n", subchain, forchain, rule+1, subtarget, fortarget); - if(needret) orules++,oprintf(IPTABLES" -I %s%s %s %s%s\n", subchain, forrevchain, rule_r+1, subtarget, forrevtarget); - } - - free(natrule); free(rule); free(rule_r); - free(subchain); free(subtarget); - return orules; -} - -static int cb_iptables_group(const char *name) -{ - oprintf("for f in INPUT OUTPUT FORWARD FORW_OUT; do "IPTABLES" -N %s-$f; done\n", name); - return 4; -} - -int fg_iptables(struct filter *filter, int flags) -{ - long feat = 0; - int r = 0; - struct fg_misc misc = { flags, &feat }; - fg_callback cb_iptables = { - rule: cb_iptables_rule, - group: cb_iptables_group, - }; - const int nchains = 3; - - filter_unroll(&filter); - filter_apply_flags(filter, flags); - - if(!(flags & FF_NOSKEL)) { - oputs("CHAINS=\"INPUT OUTPUT FORWARD\""); - oputs(""); - - oputs("# Flush/remove rules, set policy"); - oputs("for f in $CHAINS; do "IPTABLES" -P $f DROP; done"); - oputs(IPTABLES" -F; "IPTABLES" -X"); - oputs(IPTABLES" -t nat -F; "IPTABLES" -t nat -X"); - oputs(""); - - oputs("# Create FORW_OUT chain"); - oputs(IPTABLES" -N FORW_OUT"); - oputs(""); + oputs("# Create FORW_OUT chain"); + oprintf("%s -N FORW_OUT\n", iptables); + oputs(""); - oputs("# Setup INVALID chain"); - oputs(IPTABLES" -N INVALID"); + oputs("# Setup INVALID chain"); + oprintf("%s -N INVALID\n", iptables); #if 0 - oputs(IPTABLES" -A INVALID -j LOG --log-prefix \"invalid \""); + oprintf("%s -A INVALID -j LOG --log-prefix \"invalid \"\n", iptables); #endif - oputs(IPTABLES" -A INVALID -j DROP"); - oputs("for f in $CHAINS; do\n" - "\t"IPTABLES" -I $f -m state --state INVALID -j INVALID;\n" - "done"); - oputs(""); - r += nchains; + oprintf("%s -A INVALID -j DROP\n", iptables); + oprintf("for f in $CHAINS; do\n" + "\t%s -I $f -m state --state INVALID -j INVALID;\n" + "done\n", + iptables); + oputs(""); + r += nchains; + } + if ((r = filtergen_cprod(filter, &cb_iptables, &misc)) < 0) + return r; + if (!(flags & FF_NOSKEL)) { + if ((flags & FF_LSTATE) && (feat & (A_TCP | A_UDP))) { + oputs("for f in $CHAINS; do"); + if (feat & A_TCP) { + r += nchains; + oprintf("\t%s -I $f -p tcp ! --syn -m state --state ESTABLISHED -j " + "ACCEPT;\n", + iptables); + } + if (feat & A_UDP) { + r += nchains; + oprintf("\t%s -I $f -p udp -m state --state ESTABLISHED -j ACCEPT;\n", + iptables); + } + oputs("done"); } - if((r = filtergen_cprod(filter, &cb_iptables, &misc)) < 0) - return r; - if(!(flags & FF_NOSKEL)) { - if((flags & FF_LSTATE) && (feat & (A_TCP|A_UDP))) { - oputs("for f in $CHAINS; do"); - if(feat & A_TCP) { - r += nchains; - oputs("\t"IPTABLES" -I $f -p tcp ! --syn -m state --state ESTABLISHED -j ACCEPT;"); - } - if(feat & A_UDP) { - r += nchains; - oputs("\t"IPTABLES" -I $f -p udp -m state --state ESTABLISHED -j ACCEPT;"); - } - oputs("done"); - } #if 0 - oputs("for f in $CHAINS; do "IPTABLES" -A $f -j LOG; done"); + oprintf("for f in $CHAINS; do %s -A $f -j LOG; done\n", iptables); r += nchains; #endif - } - return r; + } + return r; } +int fg_iptables(struct filter *filter, int flags) { + return fg_iptables_common(filter, flags, AF_INET, IPTABLES); +} + +int fg_ip6tables(struct filter *filter, int flags) { + return fg_iptables_common(filter, flags, AF_INET6, IP6TABLES); +} /* Rules which just flush the packet filter */ -int flush_iptables(enum filtertype policy) { - char * ostr; +static int flush_iptables_common(enum filtertype policy, sa_family_t family, + const char *iptables) { + char *ostr; + + oputs("CHAINS=\"INPUT OUTPUT FORWARD\""); + oputs(""); + + switch (policy) { + case T_ACCEPT: + ostr = strdup("ACCEPT"); + break; + case DROP: + ostr = strdup("DROP"); + break; + case T_REJECT: + ostr = strdup("REJECT"); + break; + default: + fprintf(stderr, "invalid filtertype %d\n", policy); + abort(); + } + oprintf("for f in $CHAINS; do %s -P $f %s; done\n", iptables, ostr); + oprintf("%s -F; %s -X\n", iptables, iptables); + if (family == AF_INET) + oprintf("%s -t nat -F; %s -t nat -X\n", iptables, iptables); - oputs("CHAINS=\"INPUT OUTPUT FORWARD\""); - oputs(""); + return 0; +} - switch (policy) { - case T_ACCEPT: - ostr = strdup("ACCEPT"); - break; - case DROP: - ostr = strdup("DROP"); - break; - case T_REJECT: - ostr = strdup("REJECT"); - break; - default: - fprintf(stderr, "invalid filtertype %d\n", policy); - abort(); - } - oprintf("for f in $CHAINS; do "IPTABLES" -P $f %s; done\n", ostr); - oputs(IPTABLES" -F; "IPTABLES" -X"); - oputs(IPTABLES" -t nat -F; "IPTABLES" -t nat -X"); +int flush_iptables(enum filtertype policy) { + return flush_iptables_common(policy, AF_INET, IPTABLES); +} - return 0; +int flush_ip6tables(enum filtertype policy) { + return flush_iptables_common(policy, AF_INET, IP6TABLES); } diff -Nru filtergen-0.12.4/fg-iptrestore.c filtergen-0.12.7/fg-iptrestore.c --- filtergen-0.12.4/fg-iptrestore.c 1970-01-01 00:00:00.000000000 +0000 +++ filtergen-0.12.7/fg-iptrestore.c 2016-02-13 10:52:59.000000000 +0000 @@ -0,0 +1,495 @@ +/* filter generator, iptables-restore driver + * + * Copyright (c) 2002 Matthew Kirkwood + * Copyright (c) 2009 Anchor Systems (written by Matt Palmer + *) + * + * 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 of the License, 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +/* + * Description of generated filter + * + * 1. Policy: + * + "filter" chains DROP. + * + "nat" chains ACCEPT. + * 2. State: + * + Non-TCP/UDP rules don't include state. + * + Allow rules include state. + * + Deny rules don't. + * 3. NAT is done in PRE- and POSTROUTING, as required. + * However, we also must add rules to INPUT (for + * transproxy) and OUTPUT (for masquerading). + * 4. Reject rules need to go into FORWARD as well as + * INPUT or OUTPUT. + * 5. INPUT rules also get added to FORWARD. + * 6. If LOCALONLY is set, no FORWARD rules are output. + * + * The above means that each rulechain can generate up to + * three rules -- nat, in and out. + */ + +#include +#include +#include + +#include "filter.h" +#include "util.h" + +/* bitfields for features used */ +#define REJECT 0x01 +#define A_TCP 0x10 +#define A_UDP 0x20 + +/* full path to ip{,6}tables-restore executables */ +#define IPTABLES_RESTORE "/sbin/iptables-restore" +#define IP6TABLES_RESTORE "/sbin/ip6tables-restore" + +static char *appip(char *r, const struct addr_spec *h) { + APPS(r, h->addrstr); + if (h->maskstr) + APP2(r, "/", h->maskstr); + return r; +} +#define APPIP(r, h) (r = appip(r, h)) +#define APPIP2(f, r, h) (APPS(r, f), APPIP(r, h)) + +static char *appport(char *r, const struct port_spec *h) { + APPS(r, h->minstr); + if (h->maxstr) + APP2(r, ":", h->maxstr); + return r; +} +#define APPPORT(r, h) (r = appport(r, h)) +#define APPPORT2(f, r, h) (APPS(r, f), APPPORT(r, h)) + +static int cb_iptrestore_rule_common(const struct filterent *ent, + struct fg_misc *misc, sa_family_t family) { + char *rulechain = NULL, *revchain = NULL, *natchain = NULL; + char *ruletarget = NULL, *revtarget = NULL, *nattarget = NULL; + char *natrule = NULL, *rule = NULL, *rule_r = NULL; + char *forchain = NULL, *forrevchain = NULL; + char *fortarget = NULL, *forrevtarget = NULL; + char *subchain = NULL, *subtarget = NULL; + int neednat = 0, needret = 0; + int islocal = (ent->rtype != ROUTEDONLY); + int isforward = (ent->rtype != LOCALONLY); + long *feat = (long *)misc->misc; + enum filtertype target = ent->target; + int orules = 0; + + /* nat rule? */ + if ((target == MASQ) || (target == REDIRECT)) { + neednat = 1; + if (family == AF_INET6) { + fprintf(stderr, "can't NAT with IPv6\n"); + return -1; + } + if ((target == MASQ) && (ent->direction == INPUT)) { + fprintf(stderr, "can't masquerade on input\n"); + return -1; + } else if ((target == REDIRECT) && (ent->direction == OUTPUT)) { + fprintf(stderr, "can't redirect on output\n"); + return -1; + } + } + + /* sub-stuff? */ + if (target == F_SUBGROUP) { + subtarget = strapp(strdup(ent->subgroup), "-"); + needret = 1; + } else + subtarget = strdup(""); + + if (ent->groupname) + subchain = strapp(strdup(ent->groupname), "-"); + else + subchain = strdup(""); + + switch (ent->direction) { + case INPUT: + natchain = strdup("PREROUTING"); + rulechain = strdup("INPUT"); + revchain = strdup("OUTPUT"); + forchain = strdup("FORWARD"); + forrevchain = strdup("FORW_OUT"); + if (ent->iface && strcmp(ent->iface, "*")) { + if (NEG(DIRECTION)) { + APPS(natrule, "!"); + APPS(rule, "!"); + APPS(rule_r, "!"); + } + APPSS2(natrule, "-i", ent->iface); + APPSS2(rule, "-i", ent->iface); + APPSS2(rule_r, "-o", ent->iface); + } + break; + case OUTPUT: + natchain = strdup("POSTROUTING"); + rulechain = strdup("OUTPUT"); + revchain = strdup("INPUT"); + forchain = strdup("FORW_OUT"); + forrevchain = strdup("FORWARD"); + if (ent->iface && strcmp(ent->iface, "*")) { + if (NEG(DIRECTION)) { + APPS(natrule, "!"); + APPS(rule, "!"); + APPS(rule_r, "!"); + } + APPSS2(natrule, "-o", ent->iface); + APPSS2(rule, "-o", ent->iface); + APPSS2(rule_r, "-i", ent->iface); + } + break; + default: + fprintf(stderr, "unknown direction\n"); + abort(); + } + + /* state and reverse rules here */ + /* FIXME: state established on reverse for every rule, not just + * specifically udp and tcp */ + if (ent->proto.name) { + int needstate = 0; + + APPSS2(natrule, "-p", ent->proto.name); + APPSS2(rule, "-p", ent->proto.name); + APPSS2(rule_r, "-p", ent->proto.name); + switch (ent->proto.num) { + case IPPROTO_TCP: + needret++; + needstate++; + *feat |= A_TCP; + APPS(rule_r, "! --syn"); + break; + case IPPROTO_UDP: + needret++; + needstate++; + *feat |= A_UDP; + break; + } + if (needstate) { + APPS(rule, "-m state --state NEW,ESTABLISHED"); + APPS(rule_r, "-m state --state ESTABLISHED"); + } + } + + if (ent->srcaddr.addrstr) { + NEGA(natrule, SOURCE); + NEGA(rule, SOURCE); + NEGA(rule_r, SOURCE); + APPIP2("-s", natrule, &ent->srcaddr); + APPIP2("-s", rule, &ent->srcaddr); + APPIP2("-d", rule_r, &ent->srcaddr); + } + if (ent->dstaddr.addrstr) { + NEGA(natrule, DEST); + NEGA(rule, DEST); + NEGA(rule_r, DEST); + APPIP2("-d", natrule, &ent->dstaddr); + APPIP2("-d", rule, &ent->dstaddr); + APPIP2("-s", rule_r, &ent->dstaddr); + } + + switch (ent->proto.num) { + case 0: + break; + case IPPROTO_UDP: + case IPPROTO_TCP: + if (ent->u.ports.src.minstr) { + NEGA(natrule, SPORT); + NEGA(rule, SPORT); + NEGA(rule_r, SPORT); + APPPORT2("--sport", natrule, &ent->u.ports.src); + APPPORT2("--sport", rule, &ent->u.ports.src); + APPPORT2("--dport", rule_r, &ent->u.ports.src); + } + if (ent->u.ports.dst.minstr) { + NEGA(natrule, DPORT); + NEGA(rule, DPORT); + NEGA(rule_r, DPORT); + APPPORT2("--dport", natrule, &ent->u.ports.dst); + APPPORT2("--dport", rule, &ent->u.ports.dst); + APPPORT2("--sport", rule_r, &ent->u.ports.dst); + } + break; + case IPPROTO_ICMP: + if (ent->u.icmp) { + NEGA(natrule, ICMPTYPE); + APPSS2(natrule, "--icmp-type", ent->u.icmp); + NEGA(rule, ICMPTYPE); + APPSS2(rule, "--icmp-type", ent->u.icmp); + } + break; + default: + ; + } + + APPS(natrule, "-j"); + APPS(rule, "-j"); + APPS(rule_r, "-j"); + + /* The "rule+1" in the printfs below are an ugly hack to + * prevent a double-space in the output rule */ + + /* Yuck, separate rules for logging packets. Be still my + * beating lunch. + * + * Logging and target rules have to be the last bits + * before output, or this doesn't work. This will also + * fail if any mangling has been done above. + */ + if (ESET(ent, LOG)) { + char *lc, *la, *ls; + if (ent->logmsg) { + lc = strdup(" --log-prefix \""); + la = ent->logmsg; + ls = strdup(" \""); + } else + lc = la = ls = strdup(""); + if (islocal) + orules++, + oprintf("-A %s %s LOG%s%s%s\n", rulechain, rule + 1, lc, la, ls); + if (isforward) + orules++, oprintf("-A %s %s LOG%s%s%s\n", forchain, rule + 1, lc, la, ls); + } + + /* Do this twice, once for NAT, once for filter */ + if (neednat) { + switch (target) { + case MASQ: + nattarget = strdup("MASQUERADE"); + break; + case REDIRECT: + nattarget = strdup("REDIRECT"); + break; + default: + abort(); + } + } + + switch (target) { + case MASQ: + case REDIRECT: + case T_ACCEPT: + ruletarget = revtarget = fortarget = forrevtarget = strdup("ACCEPT"); + switch (ent->direction) { + case INPUT: + fortarget = strdup("FORW_OUT"); + break; + case OUTPUT: + forrevtarget = strdup("FORW_OUT"); + break; + default: + abort(); + } + break; + case DROP: + ruletarget = fortarget = strdup("DROP"); + needret = 0; + break; + case T_REJECT: + ruletarget = fortarget = strdup("REJECT"); + needret = 0; + *feat |= T_REJECT; + break; + case F_SUBGROUP: + switch (ent->direction) { + case INPUT: + ruletarget = strdup("INPUT"); + revtarget = strdup("OUTPUT"); + fortarget = strdup("FORWARD"); + forrevtarget = strdup("FORW_OUT"); + break; + case OUTPUT: + ruletarget = strdup("OUTPUT"); + revtarget = strdup("INPUT"); + fortarget = strdup("FORW_OUT"); + forrevtarget = strdup("FORWARD"); + break; + default: + abort(); + } + break; + default: + abort(); + } + + if ((misc->flags & FF_LSTATE) && (target != T_REJECT)) + needret = 0; + + if (ent->oneway) + needret = 0; + + if (neednat) { + orules++; + oputs("COMMIT\n"); + oprintf("*nat\n"); + oprintf("-A %s%s %s %s%s\n", subchain, natchain, natrule + 1, subtarget, + nattarget); + oputs("COMMIT\n"); + oprintf("*filter\n"); + } + if (islocal) + orules++, oprintf("-A %s%s %s %s%s\n", subchain, rulechain, rule + 1, + subtarget, ruletarget); + if (needret) + orules++, oprintf("-I %s%s %s %s%s\n", subchain, revchain, rule_r + 1, + subtarget, revtarget); + if (isforward) { + orules++, oprintf("-A %s%s %s %s%s\n", subchain, forchain, rule + 1, + subtarget, fortarget); + if (needret) + orules++, oprintf("-I %s%s %s %s%s\n", subchain, forrevchain, rule_r + 1, + subtarget, forrevtarget); + } + + free(natrule); + free(rule); + free(rule_r); + free(subchain); + free(subtarget); + return orules; +} + +static int cb_iptrestore_rule(const struct filterent *ent, + struct fg_misc *misc) { + return cb_iptrestore_rule_common(ent, misc, AF_INET); +} + +static int cb_ip6trestore_rule(const struct filterent *ent, + struct fg_misc *misc) { + return cb_iptrestore_rule_common(ent, misc, AF_INET6); +} + +static int cb_iptrestore_group_common(const char *name) { + oprintf("-N %s-INPUT\n", name); + oprintf("-N %s-OUTPUT\n", name); + oprintf("-N %s-FORWARD\n", name); + oprintf("-N %s-FORW_OUT\n", name); + return 4; +} + +static int cb_iptrestore_group(const char *name) { + return cb_iptrestore_group_common(name); +} + +static int cb_ip6trestore_group(const char *name) { + return cb_iptrestore_group_common(name); +} + +static int fg_iptrestore_common(struct filter *filter, int flags, + sa_family_t family, + const char *iptables_restore) { + long feat = 0; + int r = 0; + struct fg_misc misc = {flags, &feat}; + fg_callback cb_iptrestore = { + .rule = family == AF_INET ? cb_iptrestore_rule : cb_ip6trestore_rule, + .group = family == AF_INET ? cb_iptrestore_group : cb_ip6trestore_group, + }; + const int nchains = 3; + + filter_unroll(&filter); + filter_apply_flags(filter, flags); + + if (!(flags & FF_NOSKEL)) { + oprintf("%s < #include -char *strapp(char *s, const char *n) -{ - size_t l; - if(!n) return s; - if(!s) return strdup(n); - l = strlen(s) + strlen(n) + 1; - s = realloc(s, l); - return strcat(s, n); +char *strapp(char *s, const char *n) { + size_t l; + if (!n) + return s; + if (!s) + return strdup(n); + l = strlen(s) + strlen(n) + 1; + s = realloc(s, l); + return strcat(s, n); } -int str_to_int(const char *s, int *i) -{ - long m; - char *e; +int str_to_int(const char *s, int *i) { + long m; + char *e; - m = strtol(s, &e, 10); - if(*e) return -1; - *i = m; - return 0; + m = strtol(s, &e, 10); + if (*e) + return -1; + *i = m; + return 0; } -char *int_to_str_dup(int i) -{ - char buf[100]; - snprintf(buf, sizeof(buf)-1, "%d", i); - buf[sizeof(buf)-1] = 0; - return strdup(buf); +char *int_to_str_dup(int i) { + char buf[100]; + snprintf(buf, sizeof(buf) - 1, "%d", i); + buf[sizeof(buf) - 1] = 0; + return strdup(buf); } diff -Nru filtergen-0.12.4/filter_backends.7 filtergen-0.12.7/filter_backends.7 --- filtergen-0.12.4/filter_backends.7 2016-02-18 07:59:36.000000000 +0000 +++ filtergen-0.12.7/filter_backends.7 2016-02-13 10:52:59.000000000 +0000 @@ -8,12 +8,22 @@ This document describes the status and feature-set of the currently available \fBfiltergen\fR backends. -.SH IPTABLES +.SH IPTABLES, IP6TABLES Most development is done first against the iptables driver. It supports reject, masquerading, transparent proxying, logging (with text) and sub-groups, all of which should work fine (though the latter has only recently been fixed). +The ip6tables driver is the IPv6 equivalent of the iptables driver. + +.SH IPTABLES-RESTORE, IP6TABLES-RESTORE +The iptables-restore driver supports all of the features of the iptables +driver. It emits a ruleset that is loaded atomically into Netfilter +using iptables-restore. + +The ip6tables-restore driver is the IPv6 equivalent of the iptables-restore +driver. + .SH IPCHAINS The ipchains driver supports all of the above features, too. Its state model is much weaker though, of course. The forwarding support should diff -Nru filtergen-0.12.4/filter.c filtergen-0.12.7/filter.c --- filtergen-0.12.4/filter.c 2004-06-09 12:49:11.000000000 +0000 +++ filtergen-0.12.7/filter.c 2016-02-13 10:52:59.000000000 +0000 @@ -21,239 +21,263 @@ #include +#include #include #include #include #include - -static struct filter *__new_filter(enum filtertype type) -{ - struct filter *f; - if ((f = calloc(1, sizeof(*f)))) { - f->type = type; - } - return f; -} - - -struct filter *new_filter_oneway(void) -{ - return __new_filter(F_ONEWAY); -} - -struct filter *new_filter_target(enum filtertype target) -{ - struct filter *f; - if ((f = __new_filter(F_TARGET))) { - f->u.target = target; - } - return f; -} - - -struct filter *new_filter_log(enum filtertype type, const char *text) -{ - struct filter *f; - if ((f = __new_filter(type))) { - f->u.logmsg = text ? strdup(text) : NULL; - } - return f; -} - - -struct filter *new_filter_rtype(enum filtertype rtype) -{ - struct filter *f; - if ((f = __new_filter(F_RTYPE))) { - f->u.rtype = rtype; - } - return f; -} - - -struct filter *new_filter_neg(struct filter *sub) -{ - struct filter *f; - if ((f = __new_filter(F_NEG))) { - f->u.neg = sub; - } - return f; -} - -struct filter *new_filter_sibs(struct filter *list) -{ - struct filter *f; - if ((f = __new_filter(F_SIBLIST))) { - f->u.sib = list; - } - return f; -} - -struct filter *new_filter_subgroup(char *name, struct filter *list) -{ - struct filter *f; - if ((f = __new_filter(F_SUBGROUP))) { - f->u.sub.name = name; - f->u.sub.list = list; - } - return f; -} - - - -struct filter *new_filter_proto(enum filtertype type, const char *name) -{ - struct filter *f; - struct protoent *e; - int pn; - - if(!str_to_int(name, &pn)) - e = getprotobynumber(pn); - else - e = getprotobyname(name); - - if(!e) { - fprintf(stderr, "don't know protocol \"%s\"\n", name); - return NULL; - } - - if ((f = __new_filter(type))) { - f->u.proto.num = e->p_proto; - f->u.proto.name = strdup(e->p_name); - } - return f; -} - -struct filter *new_filter_device(enum filtertype type, const char *iface) -{ - struct filter *f; - if ((f = __new_filter(F_DIRECTION))) { - f->u.ifinfo.direction = type; - f->u.ifinfo.iface = strdup(iface); - } - return f; -} - - -struct filter *new_filter_host(enum filtertype type, const char *matchstr) -{ - struct filter *f; - char *mask; - int i; - - if (!(f = __new_filter(type))) return f; - - f->u.addrs.addrstr = strdup(matchstr); - if((mask = strchr(f->u.addrs.addrstr, '/'))) { - *mask++ = 0; - if(!str_to_int(mask, &i)) { - /* Netmask like foo/24 */ - uint32_t l = 0xffffffff; - if(i < 0 || i > 32) { - fprintf(stderr, "can't parse netmask \"%s\"\n", - mask); - return NULL; - } - if(!i) - l = 0; - else { - i = 32 - i; - l >>= i; l <<= i; - } - f->u.addrs.mask.s_addr = htonl(l); - } else { - /* Better be a /255.255.255.0 mask */ - if(!inet_aton(mask, &f->u.addrs.mask)) { - fprintf(stderr, "can't parse netmask \"%s\"\n", - mask); - return NULL; - } - } - f->u.addrs.maskstr = strdup(inet_ntoa(f->u.addrs.mask)); - } - - return f; -} - - -struct filter *new_filter_ports(enum filtertype type, const char *matchstr) -{ - struct filter *f; - struct servent *s; - char *min, *max; - int imin, imax; - - min = strdup(matchstr); - if((max = strchr(min, ':'))) { - *max++ = 0; - max = strdup(max); - } - - if(str_to_int(min, &imin)) { - if(!(s = getservbyname(min, NULL))) - imin = -1; - else { - free(min); min = strdup(s->s_name); - imin = ntohs(s->s_port); - } - } - if(max) { - if(str_to_int(max, &imax)) { - if(!(s = getservbyname(max, NULL))) - imax = -1; - else { - free(max); max = strdup(s->s_name); - imax = ntohs(s->s_port); - } - } - } else - imax = imin; - - if ((f = __new_filter(type))) { - f->u.ports.min = imin; - f->u.ports.max = imax; - f->u.ports.minstr = min; - f->u.ports.maxstr = max; +static struct filter *__new_filter(enum filtertype type) { + struct filter *f; + if ((f = calloc(1, sizeof(*f)))) { + f->type = type; + } + return f; +} + +struct filter *new_filter_oneway(void) { + return __new_filter(F_ONEWAY); +} + +struct filter *new_filter_target(enum filtertype target) { + struct filter *f; + if ((f = __new_filter(F_TARGET))) { + f->u.target = target; + } + return f; +} + +struct filter *new_filter_log(enum filtertype type, const char *text) { + struct filter *f; + if ((f = __new_filter(type))) { + f->u.logmsg = text ? strdup(text) : NULL; + } + return f; +} + +struct filter *new_filter_rtype(enum filtertype rtype) { + struct filter *f; + if ((f = __new_filter(F_RTYPE))) { + f->u.rtype = rtype; + } + return f; +} + +struct filter *new_filter_neg(struct filter *sub) { + struct filter *f; + if ((f = __new_filter(F_NEG))) { + f->u.neg = sub; + } + return f; +} + +struct filter *new_filter_sibs(struct filter *list) { + struct filter *f; + if ((f = __new_filter(F_SIBLIST))) { + f->u.sib = list; + } + return f; +} + +struct filter *new_filter_subgroup(char *name, struct filter *list) { + struct filter *f; + if ((f = __new_filter(F_SUBGROUP))) { + f->u.sub.name = name; + f->u.sub.list = list; + } + return f; +} + +struct filter *new_filter_proto(enum filtertype type, const char *name) { + struct filter *f; + struct protoent *e; + int pn; + + if (!str_to_int(name, &pn)) + e = getprotobynumber(pn); + else + e = getprotobyname(name); + + if (!e) { + fprintf(stderr, "don't know protocol \"%s\"\n", name); + return NULL; + } + + if ((f = __new_filter(type))) { + f->u.proto.num = e->p_proto; + f->u.proto.name = strdup(e->p_name); + } + return f; +} + +struct filter *new_filter_device(enum filtertype type, const char *iface) { + struct filter *f; + if ((f = __new_filter(F_DIRECTION))) { + f->u.ifinfo.direction = type; + f->u.ifinfo.iface = strdup(iface); + } + return f; +} + +struct filter *new_filter_host(enum filtertype type, const char *matchstr, + sa_family_t family) { + struct filter *f; + char *mask; + int i; + + if (!(f = __new_filter(type))) + return f; + + f->u.addrs.family = family; + f->u.addrs.addrstr = strdup(matchstr); + if ((mask = strchr(f->u.addrs.addrstr, '/'))) { + *mask++ = 0; + switch (family) { + case AF_INET: + if (!str_to_int(mask, &i)) { + /* Netmask like foo/24 */ + uint32_t l = 0xffffffff; + if (i < 0 || i > 32) { + fprintf(stderr, "can't parse netmask \"%s\"\n", mask); + return NULL; + } + if (!i) + l = 0; + else { + i = 32 - i; + l >>= i; + l <<= i; + } + f->u.addrs.u.inet.mask.s_addr = htonl(l); + } else { + /* Better be a /255.255.255.0 mask */ + if (!inet_aton(mask, &f->u.addrs.u.inet.mask)) { + fprintf(stderr, "can't parse netmask \"%s\"\n", mask); + return NULL; + } + } + f->u.addrs.maskstr = strdup(inet_ntoa(f->u.addrs.u.inet.mask)); + break; + case AF_INET6: + if (!str_to_int(mask, &i)) { + /* Netmask like foo/128 */ + unsigned char l[16] = {0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff}; + unsigned char *p = l + 15; + int o; + if (i < 0 || i > 128) { + fprintf(stderr, "can't parse netmask \"%s\"\n", mask); + return NULL; + } + if (i != 0) { + o = 128 - i; + while (o > 8) { + *p = 0x00; + o -= 8; + } + if (!i) + *p = 0x00; + else { + *p >>= o; + *p <<= o; + } + } + memcpy(f->u.addrs.u.inet6.mask.s6_addr, l, sizeof l); + f->u.addrs.maskstr = int_to_str_dup(i); + } else { + fprintf(stderr, "can't parse netmask \"%s\"\n", mask); + return NULL; + } + break; + default: + fprintf(stderr, "can't parse netmask \"%s\" for unknown address family\n", + mask); + return NULL; + } + } + + return f; +} + +struct filter *new_filter_ports(enum filtertype type, const char *matchstr) { + struct filter *f; + struct servent *s; + char *min, *max; + int imin, imax; + + min = strdup(matchstr); + if ((max = strchr(min, ':'))) { + *max++ = 0; + max = strdup(max); + } + + if (str_to_int(min, &imin)) { + if (!(s = getservbyname(min, NULL))) + imin = -1; + else { + free(min); + min = strdup(s->s_name); + imin = ntohs(s->s_port); + } + } + if (max) { + if (str_to_int(max, &imax)) { + if (!(s = getservbyname(max, NULL))) + imax = -1; + else { + free(max); + max = strdup(s->s_name); + imax = ntohs(s->s_port); + } } - return f; -} + } else + imax = imin; - -struct filter *new_filter_icmp(enum filtertype type, const char *matchstr) -{ - struct filter *f; - if ((f = __new_filter(type))) { - f->u.icmp = strdup(matchstr); - } - return f; + if ((f = __new_filter(type))) { + f->u.ports.min = imin; + f->u.ports.max = imax; + f->u.ports.minstr = min; + f->u.ports.maxstr = max; + } + return f; +} + +struct filter *new_filter_icmp(enum filtertype type, const char *matchstr) { + struct filter *f; + if ((f = __new_filter(type))) { + f->u.icmp = strdup(matchstr); + } + return f; } - /* * These functions DAGify the parsed filter structure. * This means that we can walk all paths down the DAG * merely by following ->child and ->next. */ -static void filter_append(struct filter *f, struct filter *x) -{ - if(!f) abort(); - if(!x) return; - - /* We have to be paranoid about making loops here */ - while((f->type != F_SIBLIST) && f->child) { - if(f == x) return; - f = f->child; - } - if(f == x) return; +static void filter_append(struct filter *f, struct filter *x) { + if (!f) + abort(); + if (!x) + return; - if(f->type == F_SIBLIST) { - if(f->child) abort(); - for(f=f->u.sib;f;f=f->next) - filter_append(f,x); - } else - f->child = x; + /* We have to be paranoid about making loops here */ + while ((f->type != F_SIBLIST) && f->child) { + if (f == x) + return; + f = f->child; + } + if (f == x) + return; + + if (f->type == F_SIBLIST) { + if (f->child) + abort(); + for (f = f->u.sib; f; f = f->next) + filter_append(f, x); + } else + f->child = x; } /* @@ -264,187 +288,193 @@ * 2. Ensure that negated entries have only a single component * hanging off them. */ -void __filter_unroll(struct filter *f) -{ - struct filter *c, *s; - - if(!f) return; - - /* depth first */ - __filter_unroll(c = f->child); - - /* check this node */ - switch(f->type) { - case F_SIBLIST: - for(s = f->u.sib; s; s = s->next) { - __filter_unroll(s); - filter_append(s, c); - } - f->child = NULL; - break; - case F_SUBGROUP: - __filter_unroll(f->u.sub.list); - break; - case F_NEG: abort(); - default: break; - } +void __filter_unroll(struct filter *f) { + struct filter *c, *s; - /* lastly, go sideways */ - __filter_unroll(f->next); -} + if (!f) + return; + /* depth first */ + __filter_unroll(c = f->child); -void __filter_neg_expand(struct filter **f, int neg) -{ - if(!*f) return; - __filter_neg_expand(&(*f)->child, neg); - __filter_neg_expand(&(*f)->next, neg); - - switch((*f)->type) { - case F_SIBLIST: - if(neg && (*f)->u.sib && (*f)->u.sib->next) { - fprintf(stderr, "error: can't negate conjunctions\n"); - exit(1); - } - __filter_neg_expand(&(*f)->u.sib, neg); - break; - case F_SUBGROUP: - if(neg) { - fprintf(stderr, "error: can't negate subgroups\n"); - exit(1); - } - __filter_neg_expand(&(*f)->u.sub.list, neg); - break; - case F_NEG: { - struct filter *c = (*f)->child, *n = (*f)->next; - *f = (*f)->u.neg; - neg = !neg; - __filter_neg_expand(f, neg); - if(c) filter_append(*f, c); - (*f)->next = n; - break; - } - default: break; - } - (*f)->negate = neg; + /* check this node */ + switch (f->type) { + case F_SIBLIST: + for (s = f->u.sib; s; s = s->next) { + __filter_unroll(s); + filter_append(s, c); + } + f->child = NULL; + break; + case F_SUBGROUP: + __filter_unroll(f->u.sub.list); + break; + case F_NEG: + abort(); + default: + break; + } + + /* lastly, go sideways */ + __filter_unroll(f->next); } +void __filter_neg_expand(struct filter **f, int neg) { + if (!*f) + return; + __filter_neg_expand(&(*f)->child, neg); + __filter_neg_expand(&(*f)->next, neg); -/* Move targets to end of each list */ -void __filter_targets_to_end(struct filter **f) -{ - if(!*f) return; - if(((*f)->type == F_TARGET) && (*f)->child) { - struct filter *c = (*f)->child; - - /* Unlink this one */ - (*f)->child = NULL; - - /* Append ourselves */ - filter_append(c, (*f)); - - /* Tell them upstairs */ - *f = c; - } else { - __filter_targets_to_end(&(*f)->child); - __filter_targets_to_end(&(*f)->next); - } + switch ((*f)->type) { + case F_SIBLIST: + if (neg && (*f)->u.sib && (*f)->u.sib->next) { + fprintf(stderr, "error: can't negate conjunctions\n"); + exit(1); + } + __filter_neg_expand(&(*f)->u.sib, neg); + break; + case F_SUBGROUP: + if (neg) { + fprintf(stderr, "error: can't negate subgroups\n"); + exit(1); + } + __filter_neg_expand(&(*f)->u.sub.list, neg); + break; + case F_NEG: { + struct filter *c = (*f)->child, *n = (*f)->next; + *f = (*f)->u.neg; + neg = !neg; + __filter_neg_expand(f, neg); + if (c) + filter_append(*f, c); + (*f)->next = n; + break; + } + default: + break; + } + (*f)->negate = neg; } -void filter_unroll(struct filter **f) -{ - __filter_neg_expand(f, 0); - __filter_targets_to_end(f); - __filter_unroll(*f); -} +/* Move targets to end of each list */ +void __filter_targets_to_end(struct filter **f) { + if (!*f) + return; + if (((*f)->type == F_TARGET) && (*f)->child) { + struct filter *c = (*f)->child; + /* Unlink this one */ + (*f)->child = NULL; -void filter_nogroup(struct filter *f) -{ - if(!f) return; - switch(f->type) { - case F_SUBGROUP: - f->u.sib = f->u.sub.list; - f->type = F_SIBLIST; - /* fall through */ - case F_SIBLIST: - filter_nogroup(f->u.sib); - break; - default:; - } - filter_nogroup(f->child); - filter_nogroup(f->next); + /* Append ourselves */ + filter_append(c, (*f)); + + /* Tell them upstairs */ + *f = c; + } else { + __filter_targets_to_end(&(*f)->child); + __filter_targets_to_end(&(*f)->next); + } +} + +void filter_unroll(struct filter **f) { + __filter_neg_expand(f, 0); + __filter_targets_to_end(f); + __filter_unroll(*f); } +void filter_nogroup(struct filter *f) { + if (!f) + return; + switch (f->type) { + case F_SUBGROUP: + f->u.sib = f->u.sub.list; + f->type = F_SIBLIST; + /* fall through */ + case F_SIBLIST: + filter_nogroup(f->u.sib); + break; + default: + ; + } + filter_nogroup(f->child); + filter_nogroup(f->next); +} /* Remove negations by reordering tree: * NEG(ent)->child,next * becomes * ent->next,child,next */ -void filter_noneg(struct filter **f) -{ - if (f) {}; - return; - +void filter_noneg(struct filter **f) { if (f) { }; + return; } /* * Apply flags to the tree */ -void filter_apply_flags(struct filter *f, long flags) -{ - struct filter *s; - if(!f) return; - switch(f->type) { - /* Structural things */ - case F_SIBLIST: - for(s = f->u.sib; s; s = s->next) - filter_apply_flags(s, flags); - break; - case F_SUBGROUP: - filter_apply_flags(f->u.sub.list, flags); - break; - case F_NEG: - filter_apply_flags(f->u.neg, flags); - break; - /* Real things */ - case F_SPORT: case F_DPORT: - if(flags & FF_LOOKUP) { - struct port_spec *p = &f->u.ports; - if(p->min == -1) { - fprintf(stderr, "warning: couldn't lookup service \"%s\"\n", p->minstr); - break; - } - free(p->minstr); - p->minstr = int_to_str_dup(p->min); - if(p->maxstr) { - if(p->max == -1) { - fprintf(stderr, "warning: couldn't lookup service \"%s\"\n", p->minstr); - break; - } - free(p->maxstr); - p->maxstr = int_to_str_dup(p->max); - } - } - break; - case F_SOURCE: case F_DEST: - if(flags & FF_LOOKUP) { - struct addr_spec *a = &f->u.addrs; - struct hostent *h; - if(!(inet_aton(a->addrstr, &f->u.addrs.addr))) { - /* Not already in IP format */ - if(!(h = gethostbyname(a->addrstr))) { - fprintf(stderr, "warning: can't lookup name \"%s\"\n", a->addrstr); - } else { - free(a->addrstr); - a->addrstr = strdup(h->h_addr_list[0]); - } - } - } - break; - default: break; +void filter_apply_flags(struct filter *f, long flags) { + struct filter *s; + if (!f) + return; + switch (f->type) { + /* Structural things */ + case F_SIBLIST: + for (s = f->u.sib; s; s = s->next) + filter_apply_flags(s, flags); + break; + case F_SUBGROUP: + filter_apply_flags(f->u.sub.list, flags); + break; + case F_NEG: + filter_apply_flags(f->u.neg, flags); + break; + /* Real things */ + case F_SPORT: + case F_DPORT: + if (flags & FF_LOOKUP) { + struct port_spec *p = &f->u.ports; + if (p->min == -1) { + fprintf(stderr, "warning: couldn't lookup service \"%s\"\n", p->minstr); + break; + } + free(p->minstr); + p->minstr = int_to_str_dup(p->min); + if (p->maxstr) { + if (p->max == -1) { + fprintf(stderr, "warning: couldn't lookup service \"%s\"\n", + p->minstr); + break; + } + free(p->maxstr); + p->maxstr = int_to_str_dup(p->max); + } + } + break; + case F_SOURCE: + case F_DEST: + if (flags & FF_LOOKUP) { + struct addr_spec *a = &f->u.addrs; + struct addrinfo hints; + struct addrinfo *info = NULL; + memset(&hints, 0, sizeof(struct addrinfo)); + hints.ai_family = a->family; + if (getaddrinfo(a->addrstr, NULL, &hints, &info) == 0) { + free(a->addrstr); + a->addrstr = malloc(NI_MAXHOST + 1); + if (getnameinfo(info->ai_addr, info->ai_addrlen, a->addrstr, NI_MAXHOST, + NULL, 0, NI_NUMERICHOST)) { + fprintf(stderr, "warning: can't stringify IP: %s\n", strerror(errno)); + } + freeaddrinfo(info); + } else { + fprintf(stderr, "warning: can't lookup name \"%s\"\n", a->addrstr); + } } - filter_apply_flags(f->child, flags); - filter_apply_flags(f->next, flags); + break; + default: + break; + } + filter_apply_flags(f->child, flags); + filter_apply_flags(f->next, flags); } diff -Nru filtergen-0.12.4/filtergen.8 filtergen-0.12.7/filtergen.8 --- filtergen-0.12.4/filtergen.8 2004-06-11 01:03:35.000000000 +0000 +++ filtergen-0.12.7/filtergen.8 2016-02-13 10:52:59.000000000 +0000 @@ -31,8 +31,8 @@ \fB-t \fItarget-filter\fB, --target=\fItarget-filter\fB\fR If specified, \fItarget-filter\fR will be used to select an output filter type, otherwise the default of \fBiptables\fR will be used. Supported backends -are \fBiptables\fR, \fBipchains\fR, \fBipfilter\fR and \fBcisco\fR (for -Cisco IOS access-lists). +are \fBiptables\fR, \fBip6tables\fR, \fBiptables-restore\fR, \fBip6tables-restore\fR, +\fBipchains\fR, \fBipfilter\fR and \fBcisco\fR (for Cisco IOS access-lists). .TP \fB-F \fIpolicy\fB, --flush=\fIpolicy\fB\fR diff -Nru filtergen-0.12.4/filtergen.c filtergen-0.12.7/filtergen.c --- filtergen-0.12.4/filtergen.c 2004-06-09 01:34:55.000000000 +0000 +++ filtergen-0.12.7/filtergen.c 2016-02-13 10:52:59.000000000 +0000 @@ -39,222 +39,245 @@ int yyparse(void *); void yyrestart(FILE *); -extern struct filter * convert(struct ast_s * n); +extern struct filter *convert(struct ast_s *n, struct filtergen_opts *o); static FILE *outfile; -void usage(char * prog) { - fprintf(stderr, "Usage: %s [-chV] [-t backend] [-o output] input\n", prog); - fprintf(stderr, " %s [-chV] [-t backend] [-o output] -F policy\n\n", prog); - fprintf(stderr, "Options:\n"); +void usage(char *prog) { + fprintf(stderr, "Usage: %s [-chV] [-t backend] [-o output] input\n", prog); + fprintf(stderr, " %s [-chV] [-t backend] [-o output] -F policy\n\n", + prog); + fprintf(stderr, "Options:\n"); #ifdef HAVE_GETOPT_H - fprintf(stderr, " --compile/-c compile only, no generate\n"); + fprintf(stderr, " --compile/-c compile only, no generate\n"); #else - fprintf(stderr, " -c compile only, no generate\n"); + fprintf(stderr, " -c compile only, no generate\n"); #endif #ifdef HAVE_GETOPT_H - fprintf(stderr, " --target/-t target generate for target (default: iptables)\n"); + fprintf( + stderr, + " --target/-t target generate for target (default: iptables)\n"); #else - fprintf(stderr, " -t target generate for target (default: iptables)\n"); + fprintf( + stderr, + " -t target generate for target (default: iptables)\n"); #endif #ifdef HAVE_GETOPT_H - fprintf(stderr, " --flush/-F policy don't process input, generate flush rules\n"); + fprintf( + stderr, + " --flush/-F policy don't process input, generate flush rules\n"); #else - fprintf(stderr, " -F policy don't process input, generate flush rules\n"); + fprintf( + stderr, + " -F policy don't process input, generate flush rules\n"); #endif #ifdef HAVE_GETOPT_H - fprintf(stderr, " --output/-o filename write the generated packet filter to filename\n"); + fprintf(stderr, " --output/-o filename write the generated packet " + "filter to filename\n"); #else - fprintf(stderr, " -o filename write the generated packet filter to filename\n"); + fprintf(stderr, " -o filename write the generated packet " + "filter to filename\n"); #endif #ifdef HAVE_GETOPT_H - fprintf(stderr, " --help/-h show this help\n"); + fprintf(stderr, " --help/-h show this help\n"); #else - fprintf(stderr, " -h show this help\n"); + fprintf(stderr, " -h show this help\n"); #endif #ifdef HAVE_GETOPT_H - fprintf(stderr, " --version/-V show program version\n"); + fprintf(stderr, " --version/-V show program version\n"); #else - fprintf(stderr, " -V show program version\n"); + fprintf(stderr, " -V show program version\n"); #endif } -int oputs(const char *s) -{ - int r = 0; - if(s) { - r = fputs(s, outfile); - if(r > 0) { - fputc('\n', outfile); - r++; - } +int oputs(const char *s) { + int r = 0; + if (s) { + r = fputs(s, outfile); + if (r > 0) { + fputc('\n', outfile); + r++; } - return r; + } + return r; } -int oprintf(const char *fmt, ...) -{ - va_list args; - va_start(args, fmt); - return vfprintf(outfile, fmt, args); +int oprintf(const char *fmt, ...) { + va_list args; + va_start(args, fmt); + return vfprintf(outfile, fmt, args); } struct filtyp { - const char * name; - filtergen * compiler; - filter_flush * flusher; + const char *name; + sa_family_t family; + filtergen *compiler; + filter_flush *flusher; } filter_types[] = { - { "iptables", fg_iptables, flush_iptables, }, - { "ipchains", fg_ipchains, flush_ipchains, }, - { "ipfilter", fg_ipfilter, NULL }, - { "cisco", fg_cisco, NULL }, - { NULL, NULL, NULL }, + {"iptables", AF_INET, fg_iptables, flush_iptables}, + {"ip6tables", AF_INET6, fg_ip6tables, flush_ip6tables}, + {"iptables-restore", AF_INET, fg_iptrestore, flush_iptrestore}, + {"ip6tables-restore", AF_INET6, fg_ip6trestore, flush_ip6trestore}, + {"ipchains", AF_INET, fg_ipchains, flush_ipchains}, + {"ipfilter", AF_INET, fg_ipfilter, NULL}, + {"cisco", AF_INET, fg_cisco, NULL}, + {NULL, 0, NULL, NULL}, }; #ifdef HAVE_GETOPT_H -static struct option long_options[] = { - {"help", no_argument, 0, 'h'}, - {"compile", no_argument, 0, 'c'}, - {"target", required_argument, 0, 't'}, - {"output", required_argument, 0, 'o'}, - {"flush", required_argument, 0, 'F'}, - {"version", no_argument, 0, 'V'}, - {0, 0, 0, 0} -}; -# define GETOPT(x, y, z) getopt_long(x, y, z, long_options, NULL) +static struct option long_options[] = {{"help", no_argument, 0, 'h'}, + {"compile", no_argument, 0, 'c'}, + {"target", required_argument, 0, 't'}, + {"output", required_argument, 0, 'o'}, + {"flush", required_argument, 0, 'F'}, + {"version", no_argument, 0, 'V'}, + {0, 0, 0, 0}}; +#define GETOPT(x, y, z) getopt_long(x, y, z, long_options, NULL) #else -# define GETOPT(x, y, z) getopt(x, y, z) +#define GETOPT(x, y, z) getopt(x, y, z) #endif int main(int argc, char **argv) { - struct filter *f; - int l; - time_t t; - char buf[100]; - char *filename = NULL, *ftn = NULL, *ofn = NULL; - struct filtyp *ft = NULL; - int flags = 0; - char *progname; - int arg; - enum filtertype flushpol = T_ACCEPT; - - progname = argv[0]; - - while ((arg = GETOPT(argc, argv, "hco:t:F:V")) > 0) { - switch (arg) { - case ':': - usage(progname); - exit(1); - break; - case 'h': - usage(progname); - exit(0); - break; - case 'c': - flags |= FF_NOSKEL; - break; - case 'o': - ofn = strdup(optarg); - break; - case 't': - ftn = strdup(optarg); - break; - case 'F': - flags |= FF_FLUSH; - if (!strcasecmp(optarg, "accept")) { - flushpol = T_ACCEPT; - } else if (!strcasecmp(optarg, "drop")) { - flushpol = DROP; - } else if (!strcasecmp(optarg, "reject")) { - flushpol = T_REJECT; - } else { - fprintf(stderr, "%s: flush policy unrecofgnised: %s\n", progname, optarg); - usage(progname); - exit(1); - } - break; - case 'V': - printf(PACKAGE " " VERSION "\n"); - exit(0); - break; - default: - break; - } - } - if (!(flags & FF_FLUSH)) { - if (optind >= argc) { - usage(progname); - exit(1); - } else - filename = argv[optind++]; - } - - if (ofn) { - /* XXX - open a different tempfile, and rename on success */ - outfile = fopen(ofn, "w"); - if(!outfile) { - fprintf(stderr, "%s: can't open output file \"%s\"\n", progname, ofn); - return 1; - } + struct filter *f; + int l; + time_t t; + char buf[100]; + char *filename = NULL, *ftn = NULL, *ofn = NULL; + struct filtyp *ft = NULL; + int flags = 0; + char *progname; + int arg; + enum filtertype flushpol = T_ACCEPT; + + progname = argv[0]; + + while ((arg = GETOPT(argc, argv, "hco:t:F:V")) > 0) { + switch (arg) { + case ':': + usage(progname); + exit(1); + break; + case 'h': + usage(progname); + exit(0); + break; + case 'c': + flags |= FF_NOSKEL; + break; + case 'o': + ofn = strdup(optarg); + break; + case 't': + ftn = strdup(optarg); + break; + case 'F': + flags |= FF_FLUSH; + if (!strcasecmp(optarg, "accept")) { + flushpol = T_ACCEPT; + } else if (!strcasecmp(optarg, "drop")) { + flushpol = DROP; + } else if (!strcasecmp(optarg, "reject")) { + flushpol = T_REJECT; + } else { + fprintf(stderr, "%s: flush policy unrecofgnised: %s\n", progname, + optarg); + usage(progname); + exit(1); + } + break; + case 'V': + printf(PACKAGE " " VERSION "\n"); + exit(0); + break; + default: + break; + } + } + if (!(flags & FF_FLUSH)) { + if (optind >= argc) { + usage(progname); + exit(1); } else - outfile = stdout; - - if(!ftn || !*ftn) ftn = strdup("iptables"); - for (ft = filter_types; ft->name; ft++) - if (!strcmp(ftn, ft->name)) - break; - if (!ft->name) { - fprintf(stderr, "%s: target filter unrecognised: %s\n", progname, ftn); - usage(progname); - exit(1); - } - - /* What to do, then? */ - if(flags & FF_FLUSH) { - /* Just flush it */ - l = ft->flusher(flushpol); - } else { - /* Compile from a file */ - if(filename && !strcmp(filename, "-")) filename = NULL; - - if(filter_fopen(filename)) return 1; - - { - struct ast_s ast; - - if (yyparse((void *) &ast) == 0) { - resolve(&ast); - f = convert(&ast); - if (!f) { - fprintf(stderr, "couldn't convert file\n"); - return 1; - } - } else { - fprintf(stderr, "couldn't parse file\n"); - return 1; - } - } - - strftime(buf, sizeof(buf)-1, "%a %b %e %H:%M:%S %Z %Y", - localtime((time(&t),&t))); - oprintf("# filter generated from %s via %s backend at %s\n", - filename ?: "standard input", ft->name, buf); - l = ft->compiler(f, flags); - } + filename = argv[optind++]; + } - if(ofn) fclose(outfile); - - if(l < 0) { - fprintf(stderr, "an error occurred: most likely the filters defined make no sense\n"); - if(ofn) unlink(ofn); - return 1; - } - fprintf(stderr, "generated %d rules\n", l); - return 0; + if (ofn) { + /* XXX - open a different tempfile, and rename on success */ + outfile = fopen(ofn, "w"); + if (!outfile) { + fprintf(stderr, "%s: can't open output file \"%s\"\n", progname, ofn); + return 1; + } + } else + outfile = stdout; + + if (!ftn || !*ftn) + ftn = strdup("iptables"); + for (ft = filter_types; ft->name; ft++) + if (!strcmp(ftn, ft->name)) + break; + if (!ft->name) { + fprintf(stderr, "%s: target filter unrecognised: %s\n", progname, ftn); + usage(progname); + exit(1); + } + + /* What to do, then? */ + if (flags & FF_FLUSH) { + /* Just flush it */ + l = ft->flusher(flushpol); + } else { + /* Compile from a file */ + if (filename && !strcmp(filename, "-")) + filename = NULL; + + if (filter_fopen(filename)) + return 1; + + { + struct ast_s ast; + + if (yyparse(&ast) == 0) { + struct filtergen_opts o; + memset(&o, 0, sizeof o); + o.family = ft->family; + + resolve(&ast, &o); + f = convert(&ast, &o); + if (!f) { + fprintf(stderr, "couldn't convert file\n"); + return 1; + } + } else { + fprintf(stderr, "couldn't parse file\n"); + return 1; + } + } + + strftime(buf, sizeof(buf) - 1, "%a %b %e %H:%M:%S %Z %Y", + localtime((time(&t), &t))); + oprintf("# filter generated from %s via %s backend at %s\n", + filename ? filename : "standard input", ft->name, buf); + l = ft->compiler(f, flags); + } + + if (ofn) + fclose(outfile); + + if (l < 0) { + fprintf( + stderr, + "an error occurred: most likely the filters defined make no sense\n"); + if (ofn) + unlink(ofn); + return 1; + } + fprintf(stderr, "generated %d rules\n", l); + return 0; } diff -Nru filtergen-0.12.4/filtergen.spec filtergen-0.12.7/filtergen.spec --- filtergen-0.12.4/filtergen.spec 2004-08-18 03:50:48.000000000 +0000 +++ filtergen-0.12.7/filtergen.spec 2016-02-13 10:53:07.000000000 +0000 @@ -1,6 +1,6 @@ Summary: packet filter generator for various firewall systems Name: filtergen -Version: 0.12.4 +Version: 0.12.7 Release: 1 License: GPL Group: Applications/System @@ -50,6 +50,15 @@ %doc HISTORY HONESTY README TODO tests/*.filter %changelog +* Wed Aug 18 2004 Jamie Wilkinsin - 0.12.4-1 +- New upstream release. + +* Tue Jun 22 2004 Jamie Wilkinson - 0.12.3-1 +- New upstream release. + +* Thu Jun 10 2004 Jamie Wilkinson - 0.12.2-1 +- New upstream release. + * Wed Mar 10 2004 Jamie Wilkinson - 0.12-1 - New upstream release. diff -Nru filtergen-0.12.4/filtergen.spec.in filtergen-0.12.7/filtergen.spec.in --- filtergen-0.12.4/filtergen.spec.in 2004-06-09 01:34:54.000000000 +0000 +++ filtergen-0.12.7/filtergen.spec.in 2016-02-13 09:44:55.000000000 +0000 @@ -50,6 +50,15 @@ %doc HISTORY HONESTY README TODO tests/*.filter %changelog +* Wed Aug 18 2004 Jamie Wilkinsin - 0.12.4-1 +- New upstream release. + +* Tue Jun 22 2004 Jamie Wilkinson - 0.12.3-1 +- New upstream release. + +* Thu Jun 10 2004 Jamie Wilkinson - 0.12.2-1 +- New upstream release. + * Wed Mar 10 2004 Jamie Wilkinson - 0.12-1 - New upstream release. diff -Nru filtergen-0.12.4/filter.h filtergen-0.12.7/filter.h --- filtergen-0.12.4/filter.h 2004-05-15 03:36:17.000000000 +0000 +++ filtergen-0.12.7/filter.h 2016-02-13 10:52:59.000000000 +0000 @@ -24,87 +24,110 @@ #include #include - -#ifdef __GNUC__ -#define _PRINTF_ATTR(s,e) __attribute__ ((__format__(__printf__, (s), (e)))) +#ifdef __GNUC__ +#define _PRINTF_ATTR(s, e) __attribute__((__format__(__printf__, (s), (e)))) #else -#define _PRINTF_ATTR(s,e) +#define _PRINTF_ATTR(s, e) #endif - /* * If it doesn't begin with "F_", it's a simple token, not an * filter type */ enum filtertype { - YYEOF = 0, - F_DIRECTION, F_TARGET, - F_SOURCE, F_DEST, F_SPORT, F_DPORT, - F_ICMPTYPE, - F_PROTO, - F_NEG, F_SIBLIST, F_SUBGROUP, - F_LOG, - F_RTYPE, - F_ONEWAY, - /* this must be the last real filter type */ - F_FILTER_MAX, - /* parser use only */ - INPUT, OUTPUT, - /* lex uses "ACCEPT" and "REJECT" */ - T_ACCEPT, DROP, T_REJECT, - MASQ, REDIRECT, - OPENBRACE, CLOSEBRACE, - OPENBRACKET, CLOSEBRACKET, - SEMICOLON, STRING, - INCLUDE, - LOCALONLY, ROUTEDONLY, /* for F_RTYPE */ - TEXT, /* for F_LOG */ + YYEOF = 0, + F_DIRECTION, + F_TARGET, + F_SOURCE, + F_DEST, + F_SPORT, + F_DPORT, + F_ICMPTYPE, + F_PROTO, + F_NEG, + F_SIBLIST, + F_SUBGROUP, + F_LOG, + F_RTYPE, + F_ONEWAY, + /* this must be the last real filter type */ + F_FILTER_MAX, + /* parser use only */ + INPUT, + OUTPUT, + /* lex uses "ACCEPT" and "REJECT" */ + T_ACCEPT, + DROP, + T_REJECT, + MASQ, + REDIRECT, + OPENBRACE, + CLOSEBRACE, + OPENBRACKET, + CLOSEBRACKET, + SEMICOLON, + STRING, + INCLUDE, + LOCALONLY, + ROUTEDONLY, /* for F_RTYPE */ + TEXT, /* for F_LOG */ }; /* Structures which appear in both the parse tree and the output rule */ struct proto_spec { - int num; - char *name; + int num; + char *name; }; struct addr_spec { - struct in_addr addr, mask; - char *addrstr, *maskstr; + sa_family_t family; + union { + struct { + struct in_addr addr, mask; + } inet; + struct { + struct in6_addr addr, mask; + } inet6; + } u; + char *addrstr, *maskstr; }; struct port_spec { - int min, max; - char *minstr, *maxstr; + int min, max; + char *minstr, *maxstr; }; /* This is basically just a parse tree */ struct filter { - enum filtertype type; - union { - struct { - enum filtertype direction; - char *iface; - } ifinfo; - enum filtertype target; - char *logmsg; - enum filtertype rtype; - struct addr_spec addrs; - struct port_spec ports; - char *icmp; - struct proto_spec proto; - struct filter *neg; - struct filter *sib; - struct { - char *name; - struct filter *list; - } sub; - } u; - struct filter *child, *next; + enum filtertype type; + union { + struct { + enum filtertype direction; + char *iface; + } ifinfo; + enum filtertype target; + char *logmsg; + enum filtertype rtype; + struct addr_spec addrs; + struct port_spec ports; + char *icmp; + struct proto_spec proto; + struct filter *neg; + struct filter *sib; + struct { + char *name; + struct filter *list; + } sub; + } u; + struct filter *child, *next; - /* infernal use only */ - int negate; + /* infernal use only */ + int negate; }; +struct filtergen_opts { + sa_family_t family; +}; /* from filter.c */ typedef struct filter *filter_tctor(enum filtertype); @@ -112,8 +135,10 @@ struct filter *new_filter_neg(struct filter *sub); struct filter *new_filter_sibs(struct filter *list); struct filter *new_filter_subgroup(char *name, struct filter *list); -typedef struct filter *filter_ctor(enum filtertype, const char*); -filter_ctor new_filter_device, new_filter_host, new_filter_ports, new_filter_icmp, new_filter_proto, new_filter_log; +typedef struct filter *filter_ctor(enum filtertype, const char *); +filter_ctor new_filter_device, new_filter_ports, new_filter_icmp, + new_filter_proto, new_filter_log; +struct filter *new_filter_host(enum filtertype, const char *, sa_family_t); struct filter *new_filter_oneway(void); /* filter manipulations */ @@ -122,77 +147,80 @@ void filter_noneg(struct filter **f); void filter_apply_flags(struct filter *f, long flags); - /* from generated lexer and parer in filterlex.l */ int filter_fopen(const char *filename); -struct filter *filter_parse_list(void); +struct filter *filter_parse_list(struct filtergen_opts *o); /* from gen.c */ -#define ESET(e,f) (e->whats_set & (1 << F_ ##f)) +#define ESET(e, f) (e->whats_set & (1 << F_##f)) struct filterent { - /* Either direction+iface or groupname must be set */ - enum filtertype direction; - char *iface; - char *groupname; - - /* One of these must be set */ - enum filtertype target; - char *subgroup; - - /* These may or may not be set */ - int whats_set:F_FILTER_MAX; - int whats_negated:F_FILTER_MAX; - struct addr_spec srcaddr, dstaddr; - - enum filtertype rtype; - struct proto_spec proto; - char *logmsg; - int oneway; + /* Either direction+iface or groupname must be set */ + enum filtertype direction; + char *iface; + char *groupname; + + /* One of these must be set */ + enum filtertype target; + char *subgroup; + + /* These may or may not be set */ + int whats_set : F_FILTER_MAX; + int whats_negated : F_FILTER_MAX; + struct addr_spec srcaddr, dstaddr; + + enum filtertype rtype; + struct proto_spec proto; + char *logmsg; + int oneway; - /* We need this not to be a union, for error-checking reasons */ + /* We need this not to be a union, for error-checking reasons */ + struct { struct { - struct { - struct port_spec src, dst; - } ports; - char *icmp; - } u; + struct port_spec src, dst; + } ports; + char *icmp; + } u; }; struct fg_misc { - int flags; - void *misc; + int flags; + void *misc; }; typedef int fg_cb_rule(const struct filterent *ent, struct fg_misc *misc); typedef int fg_cb_group(const char *name); typedef struct { - fg_cb_rule *rule; - fg_cb_group *group; + fg_cb_rule *rule; + fg_cb_group *group; } fg_callback; -int filtergen_cprod(struct filter *filter, fg_callback *cb, struct fg_misc *misc); +int filtergen_cprod(struct filter *filter, fg_callback *cb, + struct fg_misc *misc); /* fg-util.c */ char *strapp(char *s, const char *n); -#define strapp2(s,n1,n2) strapp(strapp(s,n1),n2) +#define strapp2(s, n1, n2) strapp(strapp(s, n1), n2) int str_to_int(const char *s, int *i); char *int_to_str_dup(int i); /* various drivers */ typedef int filtergen(struct filter *filter, int flags); -filtergen fg_iptables, fg_ipchains, fg_ipfilter, fg_cisco; +filtergen fg_iptables, fg_ip6tables, fg_iptrestore, fg_ip6trestore, fg_ipchains, + fg_ipfilter, fg_cisco; typedef int filter_flush(enum filtertype policy); -filter_flush flush_iptables, flush_ipchains; +filter_flush flush_iptables, flush_ip6tables, flush_iptrestore, + flush_ip6trestore, flush_ipchains; /* ("flags" arguments) */ -#define FF_NOSKEL (1 << 0) /* omit any "skeleton" rules */ -#define FF_LSTATE (1 << 1) /* lightweight state matching */ -#define FF_LOCAL (1 << 2) /* assume packets are local only */ -#define FF_ROUTE (1 << 3) /* assume packets are forwarded */ -#define FF_LOOKUP (1 << 4) /* translate host and service names into - * IP addresses and port numbers */ -#define FF_FLUSH (1 << 5) /* just flush the ruleset instead */ +#define FF_NOSKEL (1 << 0) /* omit any "skeleton" rules */ +#define FF_LSTATE (1 << 1) /* lightweight state matching */ +#define FF_LOCAL (1 << 2) /* assume packets are local only */ +#define FF_ROUTE (1 << 3) /* assume packets are forwarded */ +#define FF_LOOKUP \ + (1 << 4) /* translate host and service names into \ + * IP addresses and port numbers */ +#define FF_FLUSH (1 << 5) /* just flush the ruleset instead */ /* filtergen.c */ int oputs(const char *s); -int oprintf(const char *fmt, ...) _PRINTF_ATTR(1,2); +int oprintf(const char *fmt, ...) _PRINTF_ATTR(1, 2); #endif /* _FK_FILTER_H */ diff -Nru filtergen-0.12.4/filter_syntax.5 filtergen-0.12.7/filter_syntax.5 --- filtergen-0.12.4/filter_syntax.5 2004-06-09 12:48:41.000000000 +0000 +++ filtergen-0.12.7/filter_syntax.5 2016-02-13 09:44:55.000000000 +0000 @@ -45,6 +45,9 @@ Linux are "eth0", "eth1", ..., "ppp0", etc. Other systems will have different naming rules. +If you want to match all interfaces, you can specify "*" (without the +quotes). + .SS TARGET A \fItarget\fR notes what we do with a matching packet. Universal options are \fIaccept\fR and \fIdrop\fR which, respectively, state @@ -175,6 +178,71 @@ and "sport 12345" need to be either both in the group, or both out of it. +.SH INCLUDING OTHER FILES + +You can, if necessary, include other files containing filtergen statements +in your filter files, with the \fIinclude\fR directive. This is legal +anywhere in the file, and acts as if you literally read the included file +into the position where the \fIinclude\fR is placed. This allows you to, +for example, specify a common set of addresses (say, your monitoring system) +and reference them in multiple locations: + +.nf + input eth0 { + proto tcp dport ssh source { + include monitoring-hosts.acl + } accept; + + ... + + # NRPE + proto tcp dport 5666 source { + include monitoring-hosts.acl + } accept; + } + + output eth0 { + proto tcp sport ssh dest { + include monitoring-hosts.acl + } accept; + + ... + + # NRPE + proto tcp sport 5666 source { + include monitoring-hosts.acl + } accept; + } +.fi + +Whilst you could improve this particular example without an \fIinclude\fR by +grouping your ssh and NRPE ports together, you'd still have two places to +edit when you changed your set of monitoring hosts. Using include, you can +have a single place to change when you change your monitoring hosts. + +You can also include a glob of files, rather than a single file, by using +one of the shell globbing metacharacters '\fI*\fR', '\fI?\fR', or '\fI[\fR'. +This will cause filtergen to expand that glob and parse the files as if you +had included them one-by-one, in your locale's sorted order. This is very +handy if you configure your systems with an automated system, because you +can dump a series of files into a directory depending on what classes are +defined, and filtergen will pick them all up. The sorting is to ensure that +your rules appear in the order you want them, rather than some +higgledy-piggledy mess. Note that any directories that match your glob will +not be recursively included in this mode. + +Finally, you can just provide a directory name, and filtergen will include +all the files and directories under there, recursively (excluding hidden +files, starting with a '.'). \fBThis method of including files is strongly +deprecated\fR. There is no defined sort order, and if your editor leaves +backup or temporary files around, or your configuration management system +puts it's backups in the same directory as the original file (cfengine, I'm +looking at \fIyou\fR), you can find yourself including files you really +didn't intend -- hence why it is a bad idea. Instead, use a glob (above) +with an explicit extension (we like \fI*.fg\fR) to perform your directory +inclusions with minimal chance of accidents. + + .SH EXAMPLE Here's a fairly complete example, for a single-interface machine: diff -Nru filtergen-0.12.4/gen.c filtergen-0.12.7/gen.c --- filtergen-0.12.4/gen.c 2004-05-15 03:26:46.000000000 +0000 +++ filtergen-0.12.7/gen.c 2016-02-13 10:52:59.000000000 +0000 @@ -24,165 +24,179 @@ #include "filter.h" void applydefaults(struct filterent *e, long flags) { - if(!e->rtype) { - if(flags & FF_LOCAL) e->rtype = LOCALONLY; - else if(flags & FF_ROUTE) e->rtype = ROUTEDONLY; - } + if (!e->rtype) { + if (flags & FF_LOCAL) + e->rtype = LOCALONLY; + else if (flags & FF_ROUTE) + e->rtype = ROUTEDONLY; + } } int checkmatch(const struct filterent *e) { - int r = 0; -#define MUST(t) \ - do if(!(e->t)) { \ - fprintf(stderr, "%s missing from filter\n", #t); \ - r++; \ - } while(0) - if(!e->subgroup) - MUST(target); - if(!e->groupname) { - MUST(direction); - MUST(iface); - } + int r = 0; +#define MUST(t) \ + do \ + if (!(e->t)) { \ + fprintf(stderr, "%s missing from filter\n", #t); \ + r++; \ + } \ + while (0) + if (!e->subgroup) + MUST(target); + if (!e->groupname) { + MUST(direction); + MUST(iface); + } #undef MUST - if((e->u.ports.src.minstr || e->u.ports.dst.minstr) - && (e->proto.num != IPPROTO_TCP) && (e->proto.num != IPPROTO_UDP)) { - fprintf(stderr, "can only use ports with tcp or udp\n"); - r++; - } - - if(e->u.icmp && (e->proto.num != IPPROTO_ICMP)) { - fprintf(stderr, "icmptype can only be used with icmp\n"); - r++; - } - - if((e->rtype == LOCALONLY) && (e->target == MASQ)) { - fprintf(stderr, "\"local\" and masquerading are incompatible\n"); - r++; - } - - return r; -} - -int __fg_apply(struct filterent *e, const struct filter *f, - fg_callback *cb, struct fg_misc *misc); - -int __fg_applylist(struct filterent *e, const struct filter *f, - fg_callback *cb, struct fg_misc *misc) { - /* This is the interesting one. The filters are - * unrolled by now, so there's only one way to - * follow it */ - int c = 0; - for(; f; f = f->next) { - int _c = __fg_apply(e, f, cb, misc); - if (_c < 0) return _c; - c += _c; - } - return c; -} - -int __fg_applyone(struct filterent *e, const struct filter *f, - fg_callback *cb, struct fg_misc *misc) { -#define _NA(t,f) \ - if(f) { \ - fprintf(stderr, "filter has already defined a %s\n", t); \ - return -1; \ - } -#define NA(t) _NA(#t,e->t) - -#define NC(type, str) case F_ ## type: _NA(str, ESET(e, type)); e->whats_set |= (1 << F_ ## type); - - switch(f->type) { - NC(TARGET, "target") - e->target = f->u.target; - break; - - NC(SUBGROUP, "subgroup") { - struct filterent fe; - int r; - - if(e->subgroup) { - fprintf(stderr, "cannot compose subgroups\n"); - return -1; - } - if(!cb->group) { - fprintf(stderr, "backend doesn't support grouping, but hasn't removed groups\n"); - abort(); - } - e->target = f->type; - e->subgroup = f->u.sub.name; - - memset(&fe, 0, sizeof(fe)); - fe.groupname = f->u.sub.name; - /* direction is special -- we need to save it */ - fe.direction = e->direction; - cb->group(fe.groupname); - if((r = __fg_applylist(&fe, f->u.sub.list, cb, misc)) < 0) - return r; - - break; - } - - NC(DIRECTION, "direction and interface") - NA(iface); - e->direction = f->u.ifinfo.direction; - e->iface = f->u.ifinfo.iface; - break; - - case F_LOG: - e->whats_set |= (1 << F_LOG); - e->logmsg = f->u.logmsg; - break; - -#define _DV(tag, str, test, targ, source) \ - case F_ ## tag: _NA(str, e->test); e->targ = f->u.source; break -#define DV(tag, targ, source) _DV(tag, #targ, targ, targ, source) - - _DV(PROTO, "protocol", proto.name, proto, proto); - _DV(SOURCE, "source address", srcaddr.addrstr, srcaddr, addrs); - _DV(DEST, "destination address", dstaddr.addrstr, dstaddr, addrs); - _DV(SPORT, "source port", u.ports.src.minstr, u.ports.src, ports); - _DV(DPORT, "destination port", u.ports.src.maxstr, u.ports.dst, ports); - DV(ICMPTYPE, u.icmp, icmp); - DV(RTYPE, rtype, rtype); - - case F_ONEWAY: - e->oneway = 1; - break; - - case F_SIBLIST: - return __fg_applylist(e, f->u.sib, cb, misc); - - default: abort(); - } - - if(f->negate) - e->whats_negated |= (1 << f->type); - - return 0; -} - -int __fg_apply(struct filterent *_e, const struct filter *f, - fg_callback *cb, struct fg_misc *misc) { - struct filterent e = *_e; - - /* Looks like we're all done */ - if(!f) { - applydefaults(&e, misc->flags); - if (checkmatch(&e)) { - fprintf(stderr, "filter definition incomplete\n"); - return -1; - } - return cb->rule(&e, misc); - } - - return __fg_applyone(&e, f, cb, misc) - ?: __fg_apply(&e, f->child, cb, misc); -} - - -int filtergen_cprod(struct filter *filter, fg_callback *cb, struct fg_misc *misc) { - struct filterent e; - memset(&e, 0, sizeof(e)); - return __fg_applylist(&e, filter, cb, misc); + if ((e->u.ports.src.minstr || e->u.ports.dst.minstr) && + (e->proto.num != IPPROTO_TCP) && (e->proto.num != IPPROTO_UDP)) { + fprintf(stderr, "can only use ports with tcp or udp\n"); + r++; + } + + if (e->u.icmp && (e->proto.num != IPPROTO_ICMP)) { + fprintf(stderr, "icmptype can only be used with icmp\n"); + r++; + } + + if ((e->rtype == LOCALONLY) && (e->target == MASQ)) { + fprintf(stderr, "\"local\" and masquerading are incompatible\n"); + r++; + } + + return r; +} + +int __fg_apply(struct filterent *e, const struct filter *f, fg_callback *cb, + struct fg_misc *misc); + +int __fg_applylist(struct filterent *e, const struct filter *f, fg_callback *cb, + struct fg_misc *misc) { + /* This is the interesting one. The filters are + * unrolled by now, so there's only one way to + * follow it */ + int c = 0; + for (; f; f = f->next) { + int _c = __fg_apply(e, f, cb, misc); + if (_c < 0) + return _c; + c += _c; + } + return c; +} + +int __fg_applyone(struct filterent *e, const struct filter *f, fg_callback *cb, + struct fg_misc *misc) { +#define _NA(t, f) \ + if (f) { \ + fprintf(stderr, "filter has already defined a %s\n", t); \ + return -1; \ + } +#define NA(t) _NA(#t, e->t) + +#define NC(type, str) \ + case F_##type: \ + _NA(str, ESET(e, type)); \ + e->whats_set |= (1 << F_##type); + + switch (f->type) { + NC(TARGET, "target") + e->target = f->u.target; + break; + + NC(SUBGROUP, "subgroup") { + struct filterent fe; + int r; + + if (e->subgroup) { + fprintf(stderr, "cannot compose subgroups\n"); + return -1; + } + if (!cb->group) { + fprintf( + stderr, + "backend doesn't support grouping, but hasn't removed groups\n"); + abort(); + } + e->target = f->type; + e->subgroup = f->u.sub.name; + + memset(&fe, 0, sizeof(fe)); + fe.groupname = f->u.sub.name; + /* direction is special -- we need to save it */ + fe.direction = e->direction; + cb->group(fe.groupname); + if ((r = __fg_applylist(&fe, f->u.sub.list, cb, misc)) < 0) + return r; + + break; + } + + NC(DIRECTION, "direction and interface") + NA(iface); + e->direction = f->u.ifinfo.direction; + e->iface = f->u.ifinfo.iface; + break; + + case F_LOG: + e->whats_set |= (1 << F_LOG); + e->logmsg = f->u.logmsg; + break; + +#define _DV(tag, str, test, targ, source) \ + case F_##tag: \ + _NA(str, e->test); \ + e->targ = f->u.source; \ + break +#define DV(tag, targ, source) _DV(tag, #targ, targ, targ, source) + + _DV(PROTO, "protocol", proto.name, proto, proto); + _DV(SOURCE, "source address", srcaddr.addrstr, srcaddr, addrs); + _DV(DEST, "destination address", dstaddr.addrstr, dstaddr, addrs); + _DV(SPORT, "source port", u.ports.src.minstr, u.ports.src, ports); + _DV(DPORT, "destination port", u.ports.src.maxstr, u.ports.dst, ports); + DV(ICMPTYPE, u.icmp, icmp); + DV(RTYPE, rtype, rtype); + + case F_ONEWAY: + e->oneway = 1; + break; + + case F_SIBLIST: + return __fg_applylist(e, f->u.sib, cb, misc); + + default: + abort(); + } + + if (f->negate) + e->whats_negated |= (1 << f->type); + + return 0; +} + +int __fg_apply(struct filterent *_e, const struct filter *f, fg_callback *cb, + struct fg_misc *misc) { + struct filterent e = *_e; + + /* Looks like we're all done */ + if (!f) { + applydefaults(&e, misc->flags); + if (checkmatch(&e)) { + fprintf(stderr, "filter definition incomplete\n"); + return -1; + } + return cb->rule(&e, misc); + } + + return __fg_applyone(&e, f, cb, misc) ? __fg_applyone(&e, f, cb, misc) + : __fg_apply(&e, f->child, cb, misc); +} + +int filtergen_cprod(struct filter *filter, fg_callback *cb, + struct fg_misc *misc) { + struct filterent e; + memset(&e, 0, sizeof(e)); + return __fg_applylist(&e, filter, cb, misc); } diff -Nru filtergen-0.12.4/glue.c filtergen-0.12.7/glue.c --- filtergen-0.12.4/glue.c 2004-05-15 03:26:49.000000000 +0000 +++ filtergen-0.12.7/glue.c 2016-02-13 10:52:59.000000000 +0000 @@ -23,588 +23,619 @@ #include "parser.h" int yyparse(void *); -int yyrestart(FILE *); +void yyrestart(FILE *); int convtrace = 0; -int filter_fopen(const char * filename) { - FILE * file; +int filter_fopen(const char *filename) { + FILE *file; - if (filename) { - /* XXX - make more effort to find file */ - if (!(file = fopen(filename, "r"))) { - printf("can't open file \"%s\"", filename); - return -1; - } - } else { - file = stdin; + if (filename) { + /* XXX - make more effort to find file */ + if (!(file = fopen(filename, "r"))) { + printf("can't open file \"%s\"", filename); + return -1; } - yyrestart(file); - return 0; + } else { + file = stdin; + } + yyrestart(file); + return 0; } -#define eprint(x) if (convtrace) fprintf(stderr, x) +#define eprint(x) \ + if (convtrace) \ + fprintf(stderr, x) + +struct filter *convert_specifier_list(struct specifier_list_s *n, + struct filtergen_opts *o); + +struct filter *convert_subrule_list(struct subrule_list_s *n, + struct filtergen_opts *o) { + struct filter *res = NULL, *end = NULL; + + eprint("converting subrule_list\n"); -struct filter * convert_specifier_list(struct specifier_list_s * n); - -struct filter * convert_subrule_list(struct subrule_list_s * n) { - struct filter * res = NULL, * end = NULL; - - eprint("converting subrule_list\n"); - - if (n->subrule_list) { - res = convert_subrule_list(n->subrule_list); - if (res) { - end = res; - while (end->next) { - end = end->next; - } - if (n->specifier_list) { - end->next = convert_specifier_list(n->specifier_list); - } - } else { - printf("warning: convert_subrule_list returned NULL\n"); - } - } else if (n->specifier_list) { - res = convert_specifier_list(n->specifier_list); + if (n->subrule_list) { + res = convert_subrule_list(n->subrule_list, o); + if (res) { + end = res; + while (end->next) { + end = end->next; + } + if (n->specifier_list) { + end->next = convert_specifier_list(n->specifier_list, o); + } } else { - printf("error: no content in subrule_list\n"); + printf("warning: convert_subrule_list returned NULL\n"); } + } else if (n->specifier_list) { + res = convert_specifier_list(n->specifier_list, o); + } else { + printf("error: no content in subrule_list\n"); + } - return res; + return res; } -struct filter * convert_compound_specifier(struct compound_specifier_s * r) { - struct filter * res = NULL; +struct filter *convert_compound_specifier(struct compound_specifier_s *r, + struct filtergen_opts *o) { + struct filter *res = NULL; - eprint("converting compound_specifier\n"); + eprint("converting compound_specifier\n"); - if (r->list) { - res = new_filter_sibs(convert_subrule_list(r->list)); - } - return res; + if (r->list) { + res = new_filter_sibs(convert_subrule_list(r->list, o)); + } + return res; } -struct filter * convert_direction_argument(struct direction_argument_s * n, int type) { - struct filter * res = NULL; +struct filter *convert_direction_argument(struct direction_argument_s *n, + int type) { + struct filter *res = NULL; - if (n->direction) { - res = new_filter_device(type, n->direction); - } else { - printf("error: no direction argument contents\n"); - } + if (n->direction) { + res = new_filter_device(type, n->direction); + } else { + printf("error: no direction argument contents\n"); + } - return res; + return res; } -struct filter * convert_direction_argument_list(struct direction_argument_list_s * n, int type) { - struct filter * res = NULL, * end = NULL; +struct filter * +convert_direction_argument_list(struct direction_argument_list_s *n, int type) { + struct filter *res = NULL, *end = NULL; - eprint("converting direction argument list\n"); - - if (n->list) { - res = convert_direction_argument_list(n->list, type); - if (res) { - end = res; - while (end->next) { - end = end->next; - } - if (n->arg) { - end->next = convert_direction_argument(n->arg, type); - } - } else { - printf("warning: convert_direction_argument_list returned NULL\n"); - } - } else { - res = convert_direction_argument(n->arg, type); - } + eprint("converting direction argument list\n"); - return res; -} - -struct filter * convert_direction(struct direction_specifier_s * n) { - struct filter * res = NULL; - int type; - - eprint("converting direction specifier\n"); - - switch (n->type) { - case TOK_INPUT: - type = INPUT; - break; - case TOK_OUTPUT: - type = OUTPUT; - break; - default: - printf("error: incorrect direction type encountered\n"); - type = YYEOF; - break; - } - if (n->list) { - res = new_filter_sibs(convert_direction_argument_list(n->list, type)); + if (n->list) { + res = convert_direction_argument_list(n->list, type); + if (res) { + end = res; + while (end->next) { + end = end->next; + } + if (n->arg) { + end->next = convert_direction_argument(n->arg, type); + } } else { - printf("error: no direction argument list\n"); + printf("warning: convert_direction_argument_list returned NULL\n"); } + } else { + res = convert_direction_argument(n->arg, type); + } - return res; + return res; } -struct filter * convert_host_argument(struct host_argument_s * n, int type) { - struct filter * res = NULL; - char * h; +struct filter *convert_direction(struct direction_specifier_s *n) { + struct filter *res = NULL; + int type; - eprint("converting host_argument\n"); + eprint("converting direction specifier\n"); - if (n->host) { - if (n->mask) { - asprintf(&h, "%s/%s", n->host, n->mask); - res = new_filter_host(type, h); - } else { - res = new_filter_host(type, n->host); - } - } else { - printf("error: no host part\n"); - } + switch (n->type) { + case TOK_INPUT: + type = INPUT; + break; + case TOK_OUTPUT: + type = OUTPUT; + break; + default: + printf("error: incorrect direction type encountered\n"); + type = YYEOF; + break; + } + if (n->list) { + res = new_filter_sibs(convert_direction_argument_list(n->list, type)); + } else { + printf("error: no direction argument list\n"); + } - return res; + return res; } -struct filter * convert_host_argument_list(struct host_argument_list_s * n, int type) { - struct filter * res = NULL, * end = NULL; - - eprint("converting host argument list\n"); - - if (n->list) { - res = convert_host_argument_list(n->list, type); - if (res) { - end = res; - while (end->next) { - end = end->next; - } - if (n->arg) { - end->next = convert_host_argument(n->arg, type); - } - } else { - printf("warning: convert_host_argument_list returned NULL\n"); - } - } else { - res = convert_host_argument(n->arg, type); - } +struct filter *convert_host_argument(struct host_argument_s *n, int type, + struct filtergen_opts *o) { + struct filter *res = NULL; + char *h; - return res; -} + eprint("converting host_argument\n"); -struct filter * convert_host_specifier(struct host_specifier_s * n) { - struct filter * res = NULL; - enum filtertype type; - - eprint("converting host specifier\n"); - - switch (n->type) { - case TOK_SOURCE: - type = F_SOURCE; - break; - case TOK_DEST: - type = F_DEST; - break; - default: - printf("error: incorrect host type encountered\n"); - type = YYEOF; - break; - } - if (n->list) { - res = new_filter_sibs(convert_host_argument_list(n->list, type)); + if (n->host) { + if (n->mask) { + if (asprintf(&h, "%s/%s", n->host, n->mask) < 0) { + printf("error: asprintf allocation failed when converting host " + "argument %s/%s", + n->host, n->mask); + } } else { - printf("error: no host argument list\n"); + h = n->host; } + res = new_filter_host(type, h, o->family); + } else { + printf("error: no host part\n"); + } - return res; + return res; } -struct filter * convert_protocol_argument(struct protocol_argument_s * n) { - struct filter * res = NULL; +struct filter *convert_host_argument_list(struct host_argument_list_s *n, + int type, struct filtergen_opts *o) { + struct filter *res = NULL, *end = NULL; - eprint("converting protocol argument\n"); + eprint("converting host argument list\n"); - if (n->proto) { - res = new_filter_proto(F_PROTO, n->proto); + if (n->list) { + res = convert_host_argument_list(n->list, type, o); + if (res) { + end = res; + while (end->next) { + end = end->next; + } + if (n->arg) { + end->next = convert_host_argument(n->arg, type, o); + } } else { - printf("error: no protocol argument contents\n"); + printf("warning: convert_host_argument_list returned NULL\n"); } + } else { + res = convert_host_argument(n->arg, type, o); + } - return res; + return res; } -struct filter * convert_protocol_argument_list(struct protocol_argument_list_s * n) { - struct filter * res = NULL, * end = NULL; - - eprint("converting protocol argument list\n"); - - if (n->list) { - res = convert_protocol_argument_list(n->list); - if (res) { - end = res; - while (end->next) { - end = end->next; - } - if (n->arg) { - end->next = convert_protocol_argument(n->arg); - } - } else { - printf("warning: convert_protocol_argument_list returned NULL\n"); - } - } else { - res = convert_protocol_argument(n->arg); - } +struct filter *convert_host_specifier(struct host_specifier_s *n, + struct filtergen_opts *o) { + struct filter *res = NULL; + enum filtertype type; - return res; -} + eprint("converting host specifier\n"); -struct filter * convert_protocol_specifier(struct protocol_specifier_s * n) { - struct filter * res = NULL; - - eprint("converting protocol specifier\n"); + switch (n->type) { + case TOK_SOURCE: + type = F_SOURCE; + break; + case TOK_DEST: + type = F_DEST; + break; + default: + printf("error: incorrect host type encountered\n"); + type = YYEOF; + break; + } + if (n->list) { + res = new_filter_sibs(convert_host_argument_list(n->list, type, o)); + } else { + printf("error: no host argument list\n"); + } - if (n->list) { - res = new_filter_sibs(convert_protocol_argument_list(n->list)); - } else { - printf("error: no protocol argument list\n"); - } - - return res; + return res; } -struct filter * convert_port_argument(struct port_argument_s * n, int type) { - struct filter * res = NULL; - char * p; +struct filter *convert_protocol_argument(struct protocol_argument_s *n) { + struct filter *res = NULL; - eprint("converting port argument\n"); + eprint("converting protocol argument\n"); - if (n->port_min) { - if (n->port_max) { - asprintf(&p, "%s:%s", n->port_min, n->port_max); - res = new_filter_ports(type, p); - } else { - res = new_filter_ports(type, n->port_min); - } - } else { - printf("error: no port argument contents\n"); - } + if (n->proto) { + res = new_filter_proto(F_PROTO, n->proto); + } else { + printf("error: no protocol argument contents\n"); + } - return res; + return res; } -struct filter * convert_port_argument_list(struct port_argument_list_s * n, int type) { - struct filter * res = NULL, * end = NULL; +struct filter * +convert_protocol_argument_list(struct protocol_argument_list_s *n) { + struct filter *res = NULL, *end = NULL; + + eprint("converting protocol argument list\n"); - eprint("converting port argument list\n"); - - if (n->list) { - res = convert_port_argument_list(n->list, type); - if (res) { - end = res; - while (end->next) { - end = end->next; - } - if (n->arg) { - end->next = convert_port_argument(n->arg, type); - } - } else { - printf("warning: convert_port_argument_list returned NULL\n"); - } + if (n->list) { + res = convert_protocol_argument_list(n->list); + if (res) { + end = res; + while (end->next) { + end = end->next; + } + if (n->arg) { + end->next = convert_protocol_argument(n->arg); + } } else { - res = convert_port_argument(n->arg, type); + printf("warning: convert_protocol_argument_list returned NULL\n"); } + } else { + res = convert_protocol_argument(n->arg); + } - return res; + return res; } -struct filter * convert_port_specifier(struct port_specifier_s * n) { - struct filter * res = NULL; - enum filtertype type; - - eprint("converting port specifier\n"); +struct filter *convert_protocol_specifier(struct protocol_specifier_s *n) { + struct filter *res = NULL; - switch (n->type) { - case TOK_SPORT: - type = F_SPORT; - break; - case TOK_DPORT: - type = F_DPORT; - break; - default: - printf("error: incorrect port type encountered\n"); - type = YYEOF; - break; - } - if (n->list) { - res = new_filter_sibs(convert_port_argument_list(n->list, type)); - } else { - printf("error: no port argument list\n"); - } + eprint("converting protocol specifier\n"); + + if (n->list) { + res = new_filter_sibs(convert_protocol_argument_list(n->list)); + } else { + printf("error: no protocol argument list\n"); + } - return res; + return res; } -struct filter * convert_icmptype_argument(struct icmptype_argument_s * n) { - struct filter * res = NULL; +struct filter *convert_port_argument(struct port_argument_s *n, int type) { + struct filter *res = NULL; + char *p; - eprint("converting icmptype_argument\n"); + eprint("converting port argument\n"); - if (n->icmptype) { - res = new_filter_icmp(F_ICMPTYPE, n->icmptype); + if (n->port_min) { + if (n->port_max) { + if (asprintf(&p, "%s:%s", n->port_min, n->port_max) < 0) { + printf("error: asprintf allocation failed when emitting port range " + "%s:%s\n", + n->port_min, n->port_max); + } else { + res = new_filter_ports(type, p); + } } else { - printf("error: no icmptype argument contents\n"); + res = new_filter_ports(type, n->port_min); } + } else { + printf("error: no port argument contents\n"); + } - return res; + return res; } -struct filter * convert_icmptype_argument_list(struct icmptype_argument_list_s * n) { - struct filter * res = NULL, * end = NULL; +struct filter *convert_port_argument_list(struct port_argument_list_s *n, + int type) { + struct filter *res = NULL, *end = NULL; - eprint("converting icmptype argument list\n"); - - if (n->list) { - res = convert_icmptype_argument_list(n->list); - if (res) { - end = res; - while (end->next) { - end = end->next; - } - if (n->arg) { - end->next = convert_icmptype_argument(n->arg); - } - } else { - printf("warning: convert_icmptype_argument_list returned NULL\n"); - } + eprint("converting port argument list\n"); + + if (n->list) { + res = convert_port_argument_list(n->list, type); + if (res) { + end = res; + while (end->next) { + end = end->next; + } + if (n->arg) { + end->next = convert_port_argument(n->arg, type); + } } else { - res = convert_icmptype_argument(n->arg); + printf("warning: convert_port_argument_list returned NULL\n"); } + } else { + res = convert_port_argument(n->arg, type); + } - return res; + return res; } -struct filter * convert_icmptype_specifier(struct icmptype_specifier_s * n) { - struct filter * res = NULL; - - eprint("converting icmptype specifier\n"); +struct filter *convert_port_specifier(struct port_specifier_s *n) { + struct filter *res = NULL; + enum filtertype type; - if (n->list) { - res = new_filter_sibs(convert_icmptype_argument_list(n->list)); - } else { - printf("error: no icmptype argument list\n"); - } + eprint("converting port specifier\n"); + + switch (n->type) { + case TOK_SPORT: + type = F_SPORT; + break; + case TOK_DPORT: + type = F_DPORT; + break; + default: + printf("error: incorrect port type encountered\n"); + type = YYEOF; + break; + } + if (n->list) { + res = new_filter_sibs(convert_port_argument_list(n->list, type)); + } else { + printf("error: no port argument list\n"); + } - return res; + return res; } -struct filter * convert_option_specifier(struct option_specifier_s * n) { - struct filter * res = NULL; - - eprint("converting option specifier\n"); +struct filter *convert_icmptype_argument(struct icmptype_argument_s *n) { + struct filter *res = NULL; - switch (n->type) { - case TOK_LOCAL: - res = new_filter_rtype(LOCALONLY); - break; - case TOK_FORWARD: - res = new_filter_rtype(ROUTEDONLY); - break; - case TOK_ONEWAY: - res = new_filter_rtype(F_ONEWAY); - break; - case TOK_LOG: - res = new_filter_log(F_LOG, n->logmsg); - break; - default: - printf("error: incorrect option type encountered\n"); - break; - } + eprint("converting icmptype_argument\n"); + + if (n->icmptype) { + res = new_filter_icmp(F_ICMPTYPE, n->icmptype); + } else { + printf("error: no icmptype argument contents\n"); + } - return res; + return res; } -struct filter * convert_chaingroup_specifier(struct chaingroup_specifier_s * n) { - struct filter * res = NULL, * sub = NULL; - char * name = NULL; +struct filter * +convert_icmptype_argument_list(struct icmptype_argument_list_s *n) { + struct filter *res = NULL, *end = NULL; - if (n->name) { - name = n->name; - } else { - /* Allocate a filter name */ - static int ccount = 0; + eprint("converting icmptype argument list\n"); - asprintf(&name, "chain_%d", ccount++); - } - - if (n->list) { - sub = convert_subrule_list(n->list); - - res = new_filter_subgroup(name, sub); + if (n->list) { + res = convert_icmptype_argument_list(n->list); + if (res) { + end = res; + while (end->next) { + end = end->next; + } + if (n->arg) { + end->next = convert_icmptype_argument(n->arg); + } } else { - printf("error: no list in chaingroup\n"); + printf("warning: convert_icmptype_argument_list returned NULL\n"); } + } else { + res = convert_icmptype_argument(n->arg); + } - return res; + return res; } -struct filter * convert_specifier(struct specifier_s * r) { - struct filter * res = NULL; - eprint("converting specifier\n"); - - if (r->compound) { - eprint("converting compound specifier\n"); - res = convert_compound_specifier(r->compound); - } else if (r->direction) { - res = convert_direction(r->direction); - } else if (r->target) { - enum filtertype type; - - eprint("converting target specifier\n"); - - switch (r->target->type) { - case TOK_ACCEPT: - type = T_ACCEPT; - break; - case TOK_REJECT: - type = T_REJECT; - break; - case TOK_DROP: - type = DROP; - break; - case TOK_MASQ: - type = MASQ; - break; - case TOK_PROXY: - type = REDIRECT; - break; - case TOK_REDIRECT: - type = REDIRECT; - break; - default: - printf("error: incorrect target type encountered\n"); - type = YYEOF; - break; - } - res = new_filter_target(type); - } else if (r->host) { - res = convert_host_specifier(r->host); - } else if (r->protocol) { - res = convert_protocol_specifier(r->protocol); - } else if (r->port) { - res = convert_port_specifier(r->port); - } else if (r->icmptype) { - res = convert_icmptype_specifier(r->icmptype); - } else if (r->option) { - res = convert_option_specifier(r->option); - } else if (r->chaingroup) { - res = convert_chaingroup_specifier(r->chaingroup); - } else - printf("error: no specifiers\n"); - - return res; -} - -struct filter * convert_negated_specifier(struct negated_specifier_s * r) { - struct filter * spec = NULL; - struct filter * res = NULL; - - eprint("converting negated specifier\n"); - - if (r->spec) { - spec = convert_specifier(r->spec); - if (spec && r->negated) { - eprint("negating\n"); - res = new_filter_neg(spec); - } else { - res = spec; - } - } - return res; -} - -struct filter * convert_specifier_list(struct specifier_list_s * n) { - struct filter * res = NULL, * end = NULL; - - eprint("converting specifier_list\n"); - - if (n->list) { - res = convert_specifier_list(n->list); - if (res) { - end = res; - while (end->child) { - end = end->child; - } - if (n->spec) { - end->child = convert_negated_specifier(n->spec); - } - } else { - printf("warning: convert_specifier_list returned NULL\n"); - } - } else { - res = convert_negated_specifier(n->spec); - } +struct filter *convert_icmptype_specifier(struct icmptype_specifier_s *n) { + struct filter *res = NULL; - return res; + eprint("converting icmptype specifier\n"); + + if (n->list) { + res = new_filter_sibs(convert_icmptype_argument_list(n->list)); + } else { + printf("error: no icmptype argument list\n"); + } + + return res; } -struct filter * convert_rule(struct rule_s * r) { - struct filter * res = NULL; +struct filter *convert_option_specifier(struct option_specifier_s *n) { + struct filter *res = NULL; + + eprint("converting option specifier\n"); - eprint("converting rule\n"); + switch (n->type) { + case TOK_LOCAL: + res = new_filter_rtype(LOCALONLY); + break; + case TOK_FORWARD: + res = new_filter_rtype(ROUTEDONLY); + break; + case TOK_ONEWAY: + res = new_filter_rtype(F_ONEWAY); + break; + case TOK_LOG: + res = new_filter_log(F_LOG, n->logmsg); + break; + default: + printf("error: incorrect option type encountered\n"); + break; + } - if (r->list) - res = convert_specifier_list(r->list); - return res; + return res; } -struct filter * convert_rule_list(struct rule_list_s * n) { - struct filter * res = NULL, * end = NULL; +struct filter *convert_chaingroup_specifier(struct chaingroup_specifier_s *n, + struct filtergen_opts *o) { + struct filter *res = NULL, *sub = NULL; + char *name = NULL; - eprint("converting rule_list\n"); + if (n->name) { + name = n->name; + } else { + /* Allocate a filter name */ + static int ccount = 0; - if (n->list) { - res = convert_rule_list(n->list); - end = res; - while (end->next) { - end = end->next; - } - if (n->rule) { - end->next = convert_rule(n->rule); - } - } else { - res = convert_rule(n->rule); + if (asprintf(&name, "chain_%d", ccount++) < 0) { + printf("error: asprintf allocation failed when creating a filter name " + "for chain %d\n", + ccount); } + } - return res; -} + if (n->list) { + sub = convert_subrule_list(n->list, o); -struct filter * convert(struct ast_s * ast) { - struct filter * res = NULL; - - eprint("converting ast\n"); + res = new_filter_subgroup(name, sub); + } else { + printf("error: no list in chaingroup\n"); + } - if (ast->list) - res = convert_rule_list(ast->list); - return res; + return res; } -struct filter * filter_parse_list(void) { - struct filter * f = NULL; - struct ast_s ast; - int r; +struct filter *convert_specifier(struct specifier_s *r, + struct filtergen_opts *o) { + struct filter *res = NULL; + eprint("converting specifier\n"); - /* parse the input */ - r = yyparse((void *) &ast); - if (r != 0) { - printf("parser failed: %d\n", r); - } + if (r->compound) { + eprint("converting compound specifier\n"); + res = convert_compound_specifier(r->compound, o); + } else if (r->direction) { + res = convert_direction(r->direction); + } else if (r->target) { + enum filtertype type; - /* convert our new style AST into the old style struct */ - if (!(f = convert(&ast))) { - printf("conversion failed!\n"); - } + eprint("converting target specifier\n"); + + switch (r->target->type) { + case TOK_ACCEPT: + type = T_ACCEPT; + break; + case TOK_REJECT: + type = T_REJECT; + break; + case TOK_DROP: + type = DROP; + break; + case TOK_MASQ: + type = MASQ; + break; + case TOK_PROXY: + type = REDIRECT; + break; + case TOK_REDIRECT: + type = REDIRECT; + break; + default: + printf("error: incorrect target type encountered\n"); + type = YYEOF; + break; + } + res = new_filter_target(type); + } else if (r->host) { + res = convert_host_specifier(r->host, o); + } else if (r->protocol) { + res = convert_protocol_specifier(r->protocol); + } else if (r->port) { + res = convert_port_specifier(r->port); + } else if (r->icmptype) { + res = convert_icmptype_specifier(r->icmptype); + } else if (r->option) { + res = convert_option_specifier(r->option); + } else if (r->chaingroup) { + res = convert_chaingroup_specifier(r->chaingroup, o); + } else + printf("error: no specifiers\n"); + + return res; +} + +struct filter *convert_negated_specifier(struct negated_specifier_s *r, + struct filtergen_opts *o) { + struct filter *spec = NULL; + struct filter *res = NULL; + + eprint("converting negated specifier\n"); + + if (r->spec) { + spec = convert_specifier(r->spec, o); + if (spec && r->negated) { + eprint("negating\n"); + res = new_filter_neg(spec); + } else { + res = spec; + } + } + return res; +} + +struct filter *convert_specifier_list(struct specifier_list_s *n, + struct filtergen_opts *o) { + struct filter *res = NULL, *end = NULL; + + eprint("converting specifier_list\n"); + + if (n->list) { + res = convert_specifier_list(n->list, o); + if (res) { + end = res; + while (end->child) { + end = end->child; + } + if (n->spec) { + end->child = convert_negated_specifier(n->spec, o); + } + } else { + printf("warning: convert_specifier_list returned NULL\n"); + } + } else { + res = convert_negated_specifier(n->spec, o); + } + + return res; +} + +struct filter *convert_rule(struct rule_s *r, struct filtergen_opts *o) { + struct filter *res = NULL; + + eprint("converting rule\n"); + + if (r->list) + res = convert_specifier_list(r->list, o); + return res; +} + +struct filter *convert_rule_list(struct rule_list_s *n, + struct filtergen_opts *o) { + struct filter *res = NULL, *end = NULL; + + eprint("converting rule_list\n"); + + if (n->list) { + res = convert_rule_list(n->list, o); + end = res; + while (end->next) { + end = end->next; + } + if (n->rule) { + end->next = convert_rule(n->rule, o); + } + } else { + res = convert_rule(n->rule, o); + } + + return res; +} + +struct filter *convert(struct ast_s *ast, struct filtergen_opts *o) { + struct filter *res = NULL; + + eprint("converting ast\n"); + + if (ast->list) + res = convert_rule_list(ast->list, o); + return res; +} + +struct filter *filter_parse_list(struct filtergen_opts *o) { + struct filter *f = NULL; + struct ast_s ast; + int r; + + /* parse the input */ + r = yyparse((void *)&ast); + if (r != 0) { + printf("parser failed: %d\n", r); + } + + /* convert our new style AST into the old style struct */ + if (!(f = convert(&ast, o))) { + printf("conversion failed!\n"); + } - return f; + return f; } diff -Nru filtergen-0.12.4/HISTORY filtergen-0.12.7/HISTORY --- filtergen-0.12.4/HISTORY 2004-08-18 02:49:52.000000000 +0000 +++ filtergen-0.12.7/HISTORY 2016-02-13 10:59:21.000000000 +0000 @@ -1,3 +1,26 @@ +0.12.7: + Supports iptables-restore output format. + Supports IPv6 names. + Supports ip6tables and ip6tables-restore output format. + Better warnings when services don't resolve. + Increases include file recursion depth to 512 from 16. + Directory includes now have stable ordering of the files within. + + Runs tests in parallel so their output is captured, and generate more output. + Adds more compiler warnings. + Compiles clean under clang. + +0.12.6: + Support shell globbing in include directives. + Allow '*' as a network interface name. + + Modernise build environment: + Fix many compiler warnings. + Finish migration to Git as upstream host. + +0.12.5: + Small fixes to test correctness. + 0.12.4: Added directory include support. Fixed relative-path include error in fgadm. diff -Nru filtergen-0.12.4/icmpent.c filtergen-0.12.7/icmpent.c --- filtergen-0.12.4/icmpent.c 2004-05-15 03:26:49.000000000 +0000 +++ filtergen-0.12.7/icmpent.c 2016-02-13 10:52:59.000000000 +0000 @@ -22,87 +22,85 @@ #include "icmpent.h" /* icmp codes from RFC1700 */ -struct icmpent_s icmpcodes[] = { - { "0", "echo-reply" }, - /* 1-2 unassigned */ - { "3", "destination-unreachable" }, - { "3/0", "network-unreachable" }, - { "3/1", "host-unreachable" }, - { "3/2", "protocol-unreachable" }, - { "3/3", "port-unreachable" }, - { "3/4", "fragmentation-needed" }, - { "3/5", "source-route-failed" }, - { "3/6", "network-unknown" }, - { "3/7", "host-unknown" }, - { "3/8", "source-host-isolated" }, - { "3/9", "network-prohibited" }, - { "3/10", "host-prohibited" }, - { "3/11", "tos-network-unreachable" }, - { "3/12", "tos-host-unreachable" }, - /* RFC1812 defines the next three */ - { "3/13", "communication-prohibited" }, - { "3/14", "host-precedence-violation" }, - { "3/15", "precedence-cutoff" }, - { "4", "source-quench" }, - { "5", "redirect" }, - { "5/0", "redirect-network" }, - { "5/1", "redirect-host" }, - { "5/2", "redirect-tos-network" }, - { "5/3", "redirect-tos-host" }, - { "6", "alternate-host-address" }, - /* 7 unassigned */ - { "8", "echo-request" }, - { "9", "router-advertisement" }, - { "9/0", "router-advertisement-normal" }, - /* RFC2002 */ - { "9/16", "router-advertisement-uncommon" }, - { "10", "router-selection" }, - { "11", "time-exceeded" }, - { "11/0", "time-exceeded-in-transmit" }, - { "11/1", "time-exceeded-fragment-reassembly" }, - { "12", "parameter-problem" }, - { "12/0", "parameter-problem-pointer" }, - /* RFC1108 */ - { "12/1", "parameter-problem-missing-option" }, - { "12/2", "parameter-problem-bad-length" }, - { "13", "timestamp-request" }, - { "14", "timestamp-reply" }, - { "15", "information-request" }, - { "16", "information-reply" }, - { "17", "address-mask-request" }, - { "18", "address-mask-reply" }, - /* 19-29 reserved */ - { "30", "traceroute" }, - { "31", "datagram-conversion-error" }, - { "32", "mobile-host-redirect" }, - { "33", "ipv6-where-are-you" }, - { "34", "ipv6-i-am-here" }, - { "35", "mobile-registration-request" }, - { "36", "mobile-registration-reply" }, - { "37", "domain-name-request" }, - { "38", "domain-name-reply" }, - { "39", "skip" }, - { "40", "photuris"}, - { "40/0", "photuris-bad-spi" }, - { "40/1", "photuris-authn-failed" }, - { "40/2", "photuris-decompression-failed" }, - { "40/3", "photuris-decryption-failed" }, - { "40/4", "photuris-need-authn" }, - { "40/5", "photuris-need-authz" }, - /* 41-255 reserved */ - { NULL, NULL } -}; +struct icmpent_s icmpcodes[] = {{"0", "echo-reply"}, + /* 1-2 unassigned */ + {"3", "destination-unreachable"}, + {"3/0", "network-unreachable"}, + {"3/1", "host-unreachable"}, + {"3/2", "protocol-unreachable"}, + {"3/3", "port-unreachable"}, + {"3/4", "fragmentation-needed"}, + {"3/5", "source-route-failed"}, + {"3/6", "network-unknown"}, + {"3/7", "host-unknown"}, + {"3/8", "source-host-isolated"}, + {"3/9", "network-prohibited"}, + {"3/10", "host-prohibited"}, + {"3/11", "tos-network-unreachable"}, + {"3/12", "tos-host-unreachable"}, + /* RFC1812 defines the next three */ + {"3/13", "communication-prohibited"}, + {"3/14", "host-precedence-violation"}, + {"3/15", "precedence-cutoff"}, + {"4", "source-quench"}, + {"5", "redirect"}, + {"5/0", "redirect-network"}, + {"5/1", "redirect-host"}, + {"5/2", "redirect-tos-network"}, + {"5/3", "redirect-tos-host"}, + {"6", "alternate-host-address"}, + /* 7 unassigned */ + {"8", "echo-request"}, + {"9", "router-advertisement"}, + {"9/0", "router-advertisement-normal"}, + /* RFC2002 */ + {"9/16", "router-advertisement-uncommon"}, + {"10", "router-selection"}, + {"11", "time-exceeded"}, + {"11/0", "time-exceeded-in-transmit"}, + {"11/1", "time-exceeded-fragment-reassembly"}, + {"12", "parameter-problem"}, + {"12/0", "parameter-problem-pointer"}, + /* RFC1108 */ + {"12/1", "parameter-problem-missing-option"}, + {"12/2", "parameter-problem-bad-length"}, + {"13", "timestamp-request"}, + {"14", "timestamp-reply"}, + {"15", "information-request"}, + {"16", "information-reply"}, + {"17", "address-mask-request"}, + {"18", "address-mask-reply"}, + /* 19-29 reserved */ + {"30", "traceroute"}, + {"31", "datagram-conversion-error"}, + {"32", "mobile-host-redirect"}, + {"33", "ipv6-where-are-you"}, + {"34", "ipv6-i-am-here"}, + {"35", "mobile-registration-request"}, + {"36", "mobile-registration-reply"}, + {"37", "domain-name-request"}, + {"38", "domain-name-reply"}, + {"39", "skip"}, + {"40", "photuris"}, + {"40/0", "photuris-bad-spi"}, + {"40/1", "photuris-authn-failed"}, + {"40/2", "photuris-decompression-failed"}, + {"40/3", "photuris-decryption-failed"}, + {"40/4", "photuris-need-authn"}, + {"40/5", "photuris-need-authz"}, + /* 41-255 reserved */ + {NULL, NULL}}; /* fake netdb-like function for icmp types */ -struct icmpent_s * geticmpbyname(char * name) { - struct icmpent_s * icmpent; +struct icmpent_s *geticmpbyname(char *name) { + struct icmpent_s *icmpent; - for (icmpent = icmpcodes; icmpent->i_type != NULL; icmpent++) { - if (!strcmp(name, icmpent->name)) - break; - } - if (icmpent->i_type == NULL) - icmpent = NULL; + for (icmpent = icmpcodes; icmpent->i_type != NULL; icmpent++) { + if (!strcmp(name, icmpent->name)) + break; + } + if (icmpent->i_type == NULL) + icmpent = NULL; - return icmpent; + return icmpent; } diff -Nru filtergen-0.12.4/icmpent.h filtergen-0.12.7/icmpent.h --- filtergen-0.12.4/icmpent.h 2004-05-15 03:26:48.000000000 +0000 +++ filtergen-0.12.7/icmpent.h 2016-02-13 10:52:59.000000000 +0000 @@ -2,10 +2,10 @@ #define __ICMPENT_H__ struct icmpent_s { - const char * i_type; - const char * name; + const char *i_type; + const char *name; }; -struct icmpent_s * geticmpbyname(char * name); +struct icmpent_s *geticmpbyname(char *name); #endif /* __ICMPENT_H__ */ diff -Nru filtergen-0.12.4/input/iptables/.arch-inventory filtergen-0.12.7/input/iptables/.arch-inventory --- filtergen-0.12.4/input/iptables/.arch-inventory 2016-02-18 07:59:36.000000000 +0000 +++ filtergen-0.12.7/input/iptables/.arch-inventory 1970-01-01 00:00:00.000000000 +0000 @@ -1,5 +0,0 @@ -precious ^parse$ -precious ^parser\.(c|h)$ -precious ^scan$ -precious ^scanner\.c$ -precious ^emit$ diff -Nru filtergen-0.12.4/input/iptables/ast.h filtergen-0.12.7/input/iptables/ast.h --- filtergen-0.12.4/input/iptables/ast.h 2016-02-18 07:59:36.000000000 +0000 +++ filtergen-0.12.7/input/iptables/ast.h 1970-01-01 00:00:00.000000000 +0000 @@ -1,69 +0,0 @@ -/* iptables-save syntax tree data structure definitions - * - * Copyright (c) 2003,2004 Jamie Wilkinson - * - * 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 of the License, 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - -#ifndef __IPTABLES_AST_H__ -#define __IPTABLES_AST_H__ - -struct pkt_count_s { - char * in; - char * out; -}; - -struct identifier_s { - char * id; -}; - -struct not_identifier_s { - int neg; - struct identifier_s * identifier; -}; - -struct option_s { - char * option; - struct not_identifier_s * not_identifier; -}; - -struct not_option_s { - int neg; - struct option_s * option; -}; - -struct option_list_s { - struct option_list_s * option_list; - struct not_option_s * not_option; -}; - -struct rule_s { - char * table; - char * chain; - char * policy; - struct pkt_count_s * pkt_count; - struct option_list_s * option_list; -}; - -struct rule_list_s { - struct rule_list_s * list; - struct rule_s * rule; -}; - -struct ast_s { - struct rule_list_s * list; -}; - -#endif /* __IPTABLES_AST_H__ */ diff -Nru filtergen-0.12.4/input/iptables/emit.c filtergen-0.12.7/input/iptables/emit.c --- filtergen-0.12.4/input/iptables/emit.c 2016-02-18 07:59:36.000000000 +0000 +++ filtergen-0.12.7/input/iptables/emit.c 1970-01-01 00:00:00.000000000 +0000 @@ -1,146 +0,0 @@ -/* ast emitter - * output should be identical (syntactically) to the input - */ - -#include -#include -#include -#include "ast.h" -#include "parser.h" - -int yyparse(void *); -int emittrace = 0; - -#define EMIT(x) void emit_##x(struct x##_s * n) - -#define eprint(x) if (emittrace) fprintf(stderr, x) - -EMIT(pkt_count) { - printf("["); - if (n->in) { - printf("%s", n->in); - } - printf(":"); - if (n->out) { - printf("%s", n->out); - } - printf("]"); -} - -EMIT(identifier) { - if (n->id) { - char * spaces = strstr(n->id, " "); - if (spaces) - printf("\""); - printf("%s", n->id); - if (spaces) - printf("\""); - } -} - -EMIT(not_identifier) { - if (n->neg) { - printf("! "); - } - if (n->identifier) { - eprint("emitting identifier\n"); - emit_identifier(n->identifier); - } -} - -EMIT(option) { - if (n->option) { - printf(" -%s ", n->option); - } - if (n->not_identifier) { - emit_not_identifier(n->not_identifier); - } -} - -EMIT(not_option) { - if (n->neg) { - printf("!"); - } - if (n->option) { - eprint("emitting option\n"); - emit_option(n->option); - } -} - -EMIT(option_list) { - if (n->option_list) { - eprint("emitting option_list\n"); - emit_option_list(n->option_list); - } - if (n->not_option) { - eprint("emitting not_option\n"); - emit_not_option(n->not_option); - } -} - -EMIT(rule) { - if (n->table) { - printf("*%s", n->table); - } else if (n->chain) { - printf(":%s", n->chain); - if (n->policy) { - printf(" %s", n->policy); - } - if (n->pkt_count) { - printf(" "); - eprint("emitting pkt_count\n"); - emit_pkt_count(n->pkt_count); - } - } else if (n->option_list) { - if (n->pkt_count) { - eprint("emitting pkt_count\n"); - emit_pkt_count(n->pkt_count); - } - eprint("emitting option_list\n"); - emit_option_list(n->option_list); - } - /* rules end in a newline */ - printf("\n"); -} - -EMIT(rule_list) { - if (n->list) { - eprint("emitting rule_list\n"); - emit_rule_list(n->list); - } - if (n->rule) { - eprint("emitting rule\n"); - emit_rule(n->rule); - } else { - /* NULL rules only for COMMIT */ - printf("COMMIT\n"); - } -} - -EMIT(ast) { - if (n->list) { - eprint("emitting rule_list\n"); - emit_rule_list(n->list); - } -} - -int main(int argc __attribute__((unused)), char ** argv __attribute__((unused))) { - char * EMITTRACE; - struct ast_s ast; - int res; - - EMITTRACE = getenv("EMITTRACE"); - emittrace = EMITTRACE ? atoi(EMITTRACE) : 0; - - res = yyparse((void *)&ast); - - if (res != 0) { - printf("yyparse returned %d\n", res); - return 1; - } - - eprint("emitting ast\n"); - emit_ast(&ast); - - return 0; -} diff -Nru filtergen-0.12.4/input/iptables/Makefile.am filtergen-0.12.7/input/iptables/Makefile.am --- filtergen-0.12.4/input/iptables/Makefile.am 2016-02-18 07:59:36.000000000 +0000 +++ filtergen-0.12.7/input/iptables/Makefile.am 1970-01-01 00:00:00.000000000 +0000 @@ -1,11 +0,0 @@ -bin_PROGRAMS = scan parse emit - -scan_SOURCES = parser.y scanner.l scan.c - -parse_SOURCES = parser.y scanner.l parse.c - -emit_SOURCES = parser.y scanner.l emit.c - -AM_CFLAGS = -D_GNU_SOURCE -AM_LDFLAGS = -g -AM_YFLAGS = -d diff -Nru filtergen-0.12.4/input/iptables/parse.c filtergen-0.12.7/input/iptables/parse.c --- filtergen-0.12.4/input/iptables/parse.c 2016-02-18 07:59:36.000000000 +0000 +++ filtergen-0.12.7/input/iptables/parse.c 1970-01-01 00:00:00.000000000 +0000 @@ -1,19 +0,0 @@ -#include -#include "ast.h" - -extern char * yytext; -int yyparse(void *); -extern int yydebug; - -int main(int argc __attribute__((unused)), char ** argv __attribute__((unused))) { - char * YYDEBUGTRACE; - struct ast_s ast; - - YYDEBUGTRACE = getenv("YYDEBUGTRACE"); - yydebug = YYDEBUGTRACE ? atoi(YYDEBUGTRACE) : 0; - - yyparse(&ast); - - return 0; -} - diff -Nru filtergen-0.12.4/input/iptables/parser.y filtergen-0.12.7/input/iptables/parser.y --- filtergen-0.12.4/input/iptables/parser.y 2016-02-18 07:59:36.000000000 +0000 +++ filtergen-0.12.7/input/iptables/parser.y 1970-01-01 00:00:00.000000000 +0000 @@ -1,217 +0,0 @@ -/* parser for iptables-save format - * - * Copyright (c) 2003 Jamie Wilkinson - * - * 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 of the License, 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - -%{ -#include -#include -#include "ast.h" - -#define YYPARSE_PARAM parm - -void yyerror(const char *); -extern int yylex(void); - -#define YYPRINT(f, t, v) yyprint(f, t, v) -%} -%debug - -%union { - struct rule_list_s * u_rule_list; - struct rule_s * u_rule; - struct option_list_s * u_option_list; - struct not_option_s * u_not_option; - struct option_s * u_option; - struct not_identifier_s * u_not_identifier; - struct identifier_s * u_identifier; - struct pkt_count_s * u_pkt_count; - char * u_str; -} -%type rule_list -%type rule -%type option_list -%type not_option -%type option -%type not_identifier -%type identifier -%type pkt_count - -%defines -%token TOK_TABLE -%token TOK_CHAIN -%token TOK_OPTION -%token TOK_IDENTIFIER -%token TOK_LSQUARE -%token TOK_RSQUARE -%token TOK_COLON -%token TOK_BANG -%token TOK_QUOTE -%token TOK_COMMIT -%token TOK_NEWLINE - -%{ -int yyprint(FILE * f, int t, YYSTYPE v); -%} - -%start ast - -%% -ast: rule_list -{ - /* we expect parm to be already allocated, and that - * it is of type (struct ast_s *) */ - ((struct ast_s *) parm)->list = $1; -} - -rule_list: /* empty */ -{ - $$ = NULL; -} -| rule_list rule TOK_NEWLINE -{ - $$ = malloc(sizeof(struct rule_list_s)); - $$->list = $1; - $$->rule = $2; -} - -rule: TOK_TABLE TOK_IDENTIFIER -{ - $$ = malloc(sizeof(struct rule_s)); - $$->table = $2; - $$->chain = NULL; - $$->policy = NULL; - $$->pkt_count = NULL; - $$->option_list = NULL; -} -| TOK_CHAIN TOK_IDENTIFIER TOK_IDENTIFIER pkt_count -{ - $$ = malloc(sizeof(struct rule_s)); - $$->table = NULL; - $$->chain = $2; - $$->policy = $3; - $$->pkt_count = $4; - $$->option_list = NULL; -} -| TOK_COMMIT -{ - $$ = NULL; -} -| pkt_count option_list -{ - $$ = malloc(sizeof(struct rule_s)); - $$->table = NULL; - $$->chain = NULL; - $$->policy = NULL; - $$->pkt_count = $1; - $$->option_list = $2; -} -| option_list -{ - $$ = malloc(sizeof(struct rule_s)); - $$->table = NULL; - $$->chain = NULL; - $$->policy = NULL; - $$->pkt_count = NULL; - $$->option_list = $1; -} - -option_list: /* empty */ -{ - $$ = NULL; -} -| option_list not_option -{ - $$ = malloc(sizeof(struct option_list_s)); - $$->option_list = $1; - $$->not_option = $2; -} - -not_option: TOK_BANG option -{ - $$ = malloc(sizeof(struct not_option_s)); - $$->neg = 1; - $$->option = $2; -} -| option -{ - $$ = malloc(sizeof(struct not_option_s)); - $$->neg = 0; - $$->option = $1; -} - -option: TOK_OPTION not_identifier -{ - $$ = malloc(sizeof(struct option_s)); - $$->option = $1; - $$->not_identifier = $2; -} - -not_identifier: TOK_BANG identifier -{ - $$ = malloc(sizeof(struct not_identifier_s)); - $$->neg = 1; - $$->identifier = $2; -} -| identifier -{ - $$ = malloc(sizeof(struct not_identifier_s)); - $$->neg = 0; - $$->identifier = $1; -} - -identifier: TOK_IDENTIFIER TOK_IDENTIFIER -{ - $$ = malloc(sizeof(struct identifier_s)); - $$->id = $1; -} -| TOK_IDENTIFIER TOK_COLON TOK_IDENTIFIER -{ - $$ = malloc(sizeof(struct identifier_s)); - asprintf(&($$->id), "%s:%s", $1, $3); -} -| TOK_QUOTE TOK_IDENTIFIER TOK_QUOTE -{ - $$ = malloc(sizeof(struct identifier_s)); - $$->id = $2; -} -| TOK_IDENTIFIER -{ - $$ = malloc(sizeof(struct identifier_s)); - $$->id = $1; -} - -pkt_count: TOK_LSQUARE TOK_IDENTIFIER TOK_COLON TOK_IDENTIFIER TOK_RSQUARE -{ - $$ = malloc(sizeof(struct pkt_count_s)); - $$->in = $2; - $$->out = $4; -} - -%% -char * filename(); -long int lineno(); -extern char * yytext; - -void yyerror(const char * s) { - fprintf(stderr, "%s:%ld: %s\n", filename(), lineno(), s); -} - -int yyprint(FILE * f, int type, YYSTYPE v) { - fprintf(f, "type=%d,spelling=\"%s\",loc=%p", type, yytext, &v); - return 0; -} diff -Nru filtergen-0.12.4/input/iptables/scan.c filtergen-0.12.7/input/iptables/scan.c --- filtergen-0.12.4/input/iptables/scan.c 2016-02-18 07:59:36.000000000 +0000 +++ filtergen-0.12.7/input/iptables/scan.c 1970-01-01 00:00:00.000000000 +0000 @@ -1,57 +0,0 @@ -#include -#include -#include -#include - -#include "parser.h" - -extern char * yytext; -int yylex(); -long int lineno(); -char * filename(); - -char * tok_map(int c) { - char * r; - switch (c) { - case TOK_TABLE: - r = strdup("table"); break; - case TOK_CHAIN: - r = strdup("chain"); break; - case TOK_OPTION: - r = strdup("option"); break; - case TOK_IDENTIFIER: - r = strdup("identifier"); break; - case TOK_LSQUARE: - r = strdup("lsquare"); break; - case TOK_RSQUARE: - r = strdup("rsquare"); break; - case TOK_COLON: - r = strdup("colon"); break; - case TOK_BANG: - r = strdup("bang"); break; - case TOK_QUOTE: - r = strdup("quote"); break; - case TOK_COMMIT: - r = strdup("commit"); break; - case TOK_NEWLINE: - r = strdup("newline"); break; - default: - r = strdup("UNRECOGNISED"); break; - } - return r; -} - -int main(int argc __attribute__((unused)), char ** argv __attribute__((unused))) { - int c; - - /* if running in make distcheck the cwd isn't the same as the srcdir */ - if (getenv("srcdir")) { - chdir(getenv("srcdir")); - } - - while ((c = yylex())) { - printf("kind = %s, spelling = \"%s\", file = \"%s\", line = %ld\n", tok_map(c), yytext, filename(), lineno()); - } - return 0; -} - diff -Nru filtergen-0.12.4/input/iptables/scanner.l filtergen-0.12.7/input/iptables/scanner.l --- filtergen-0.12.4/input/iptables/scanner.l 2016-02-18 07:59:36.000000000 +0000 +++ filtergen-0.12.7/input/iptables/scanner.l 1970-01-01 00:00:00.000000000 +0000 @@ -1,90 +0,0 @@ -%option noyywrap -%option nounput - -%{ -/* input scanner for iptables-save format - * - * Copyright (c) 2004 Jamie Wilkinson - * - * 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 of the License, 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - -#include -#include "parser.h" - -long int ln = 1; - -long int lineno(void); -char * filename(void); -%} - -string \"[^\n]+\" -space [ \t]+ -id [[:alnum:]_+-\.\/]+ - -%% - -#[^\n]* /* strip shell-style comments */ - -^[*] return TOK_TABLE; - -^: return TOK_CHAIN; - -{space} /* ignore */ - -\n { - ln++; - return TOK_NEWLINE; - } - -^COMMIT return TOK_COMMIT; - -{string} { - /* we do not store the " characters in the string, so lop - * them off. We can "safely" assume that the first and last - * characters in this regex are ", otherwise there's a bug - * in flex... The result is somethign that is syntactically - * identical to an identifier for our purposes. */ - yylval.u_str = strndup(yytext + 1, yyleng - 2); - return TOK_IDENTIFIER; - } - --{id} { - /* ignore the first character */ - yylval.u_str = strndup(yytext + 1, yyleng - 1); - return TOK_OPTION; - } - -{id} { - yylval.u_str = strndup(yytext, yyleng); - return TOK_IDENTIFIER; - } - -"[" return TOK_LSQUARE; -"]" return TOK_RSQUARE; -":" return TOK_COLON; -"!" return TOK_BANG; - -\" return TOK_QUOTE; - -%% - -long int lineno(void) { - return ln; -} - -char * filename(void) { - return NULL; -} diff -Nru filtergen-0.12.4/install-sh filtergen-0.12.7/install-sh --- filtergen-0.12.4/install-sh 2004-06-23 00:28:09.000000000 +0000 +++ filtergen-0.12.7/install-sh 2016-02-13 08:06:27.000000000 +0000 @@ -1,7 +1,7 @@ #!/bin/sh # install - install a program, script, or datafile -scriptversion=2004-04-01.17 +scriptversion=2014-09-12.12; # UTC # This originates from X11R5 (mit/util/scripts/install.sh), which was # later released in X11R6 (xc/config/util/install.sh) with the @@ -35,152 +35,229 @@ # FSF changes to this file are in the public domain. # # Calling this script install-sh is preferred over install.sh, to prevent -# `make' implicit rules from creating a file called install from it +# 'make' implicit rules from creating a file called install from it # when there is no Makefile. # # This script is compatible with the BSD install script, but was written -# from scratch. It can only install one file at a time, a restriction -# shared with many OS's install programs. +# from scratch. -# set DOITPROG to echo to test this script +tab=' ' +nl=' +' +IFS=" $tab$nl" + +# Set DOITPROG to "echo" to test this script. + +doit=${DOITPROG-} +doit_exec=${doit:-exec} + +# Put in absolute file names if you don't have them in your path; +# or use environment vars. + +chgrpprog=${CHGRPPROG-chgrp} +chmodprog=${CHMODPROG-chmod} +chownprog=${CHOWNPROG-chown} +cmpprog=${CMPPROG-cmp} +cpprog=${CPPROG-cp} +mkdirprog=${MKDIRPROG-mkdir} +mvprog=${MVPROG-mv} +rmprog=${RMPROG-rm} +stripprog=${STRIPPROG-strip} -# Don't use :- since 4.3BSD and earlier shells don't like it. -doit="${DOITPROG-}" +posix_mkdir= + +# Desired mode of installed file. +mode=0755 -# put in absolute paths if you don't have them in your path; or use env. vars. - -mvprog="${MVPROG-mv}" -cpprog="${CPPROG-cp}" -chmodprog="${CHMODPROG-chmod}" -chownprog="${CHOWNPROG-chown}" -chgrpprog="${CHGRPPROG-chgrp}" -stripprog="${STRIPPROG-strip}" -rmprog="${RMPROG-rm}" -mkdirprog="${MKDIRPROG-mkdir}" - -transformbasename= -transform_arg= -instcmd="$mvprog" -chmodcmd="$chmodprog 0755" -chowncmd= chgrpcmd= -stripcmd= +chmodcmd=$chmodprog +chowncmd= +mvcmd=$mvprog rmcmd="$rmprog -f" -mvcmd="$mvprog" +stripcmd= + src= dst= dir_arg= +dst_arg= -usage="Usage: $0 [OPTION]... SRCFILE DSTFILE +copy_on_change=false +is_target_a_directory=possibly + +usage="\ +Usage: $0 [OPTION]... [-T] SRCFILE DSTFILE or: $0 [OPTION]... SRCFILES... DIRECTORY - or: $0 -d DIRECTORIES... + or: $0 [OPTION]... -t DIRECTORY SRCFILES... + or: $0 [OPTION]... -d DIRECTORIES... -In the first form, install SRCFILE to DSTFILE, removing SRCFILE by default. -In the second, create the directory path DIR. +In the 1st form, copy SRCFILE to DSTFILE. +In the 2nd and 3rd, copy all SRCFILES to DIRECTORY. +In the 4th, create DIRECTORIES. Options: --b=TRANSFORMBASENAME --c copy source (using $cpprog) instead of moving (using $mvprog). --d create directories instead of installing files. --g GROUP $chgrp installed files to GROUP. --m MODE $chmod installed files to MODE. --o USER $chown installed files to USER. --s strip installed files (using $stripprog). --t=TRANSFORM ---help display this help and exit. ---version display version info and exit. + --help display this help and exit. + --version display version info and exit. + + -c (ignored) + -C install only if different (preserve the last data modification time) + -d create directories instead of installing files. + -g GROUP $chgrpprog installed files to GROUP. + -m MODE $chmodprog installed files to MODE. + -o USER $chownprog installed files to USER. + -s $stripprog installed files. + -t DIRECTORY install into DIRECTORY. + -T report an error if DSTFILE is a directory. Environment variables override the default commands: - CHGRPPROG CHMODPROG CHOWNPROG CPPROG MKDIRPROG MVPROG RMPROG STRIPPROG + CHGRPPROG CHMODPROG CHOWNPROG CMPPROG CPPROG MKDIRPROG MVPROG + RMPROG STRIPPROG " -while test -n "$1"; do +while test $# -ne 0; do case $1 in - -b=*) transformbasename=`echo $1 | sed 's/-b=//'` - shift - continue;; - - -c) instcmd=$cpprog - shift - continue;; - - -d) dir_arg=true - shift - continue;; + -c) ;; + + -C) copy_on_change=true;; + + -d) dir_arg=true;; -g) chgrpcmd="$chgrpprog $2" - shift - shift - continue;; - - --help) echo "$usage"; exit 0;; - - -m) chmodcmd="$chmodprog $2" - shift - shift - continue;; + shift;; + + --help) echo "$usage"; exit $?;; + + -m) mode=$2 + case $mode in + *' '* | *"$tab"* | *"$nl"* | *'*'* | *'?'* | *'['*) + echo "$0: invalid mode: $mode" >&2 + exit 1;; + esac + shift;; -o) chowncmd="$chownprog $2" - shift - shift - continue;; - - -s) stripcmd=$stripprog - shift - continue;; - - -t=*) transformarg=`echo $1 | sed 's/-t=//'` - shift - continue;; - - --version) echo "$0 $scriptversion"; exit 0;; - - *) # When -d is used, all remaining arguments are directories to create. - test -n "$dir_arg" && break - # Otherwise, the last argument is the destination. Remove it from $@. - for arg - do - if test -n "$dstarg"; then - # $@ is not empty: it contains at least $arg. - set fnord "$@" "$dstarg" - shift # fnord - fi - shift # arg - dstarg=$arg - done - break;; + shift;; + + -s) stripcmd=$stripprog;; + + -t) + is_target_a_directory=always + dst_arg=$2 + # Protect names problematic for 'test' and other utilities. + case $dst_arg in + -* | [=\(\)!]) dst_arg=./$dst_arg;; + esac + shift;; + + -T) is_target_a_directory=never;; + + --version) echo "$0 $scriptversion"; exit $?;; + + --) shift + break;; + + -*) echo "$0: invalid option: $1" >&2 + exit 1;; + + *) break;; esac + shift done -if test -z "$1"; then +# We allow the use of options -d and -T together, by making -d +# take the precedence; this is for compatibility with GNU install. + +if test -n "$dir_arg"; then + if test -n "$dst_arg"; then + echo "$0: target directory not allowed when installing a directory." >&2 + exit 1 + fi +fi + +if test $# -ne 0 && test -z "$dir_arg$dst_arg"; then + # When -d is used, all remaining arguments are directories to create. + # When -t is used, the destination is already specified. + # Otherwise, the last argument is the destination. Remove it from $@. + for arg + do + if test -n "$dst_arg"; then + # $@ is not empty: it contains at least $arg. + set fnord "$@" "$dst_arg" + shift # fnord + fi + shift # arg + dst_arg=$arg + # Protect names problematic for 'test' and other utilities. + case $dst_arg in + -* | [=\(\)!]) dst_arg=./$dst_arg;; + esac + done +fi + +if test $# -eq 0; then if test -z "$dir_arg"; then echo "$0: no input file specified." >&2 exit 1 fi - # It's OK to call `install-sh -d' without argument. + # It's OK to call 'install-sh -d' without argument. # This can happen when creating conditional directories. exit 0 fi +if test -z "$dir_arg"; then + if test $# -gt 1 || test "$is_target_a_directory" = always; then + if test ! -d "$dst_arg"; then + echo "$0: $dst_arg: Is not a directory." >&2 + exit 1 + fi + fi +fi + +if test -z "$dir_arg"; then + do_exit='(exit $ret); exit $ret' + trap "ret=129; $do_exit" 1 + trap "ret=130; $do_exit" 2 + trap "ret=141; $do_exit" 13 + trap "ret=143; $do_exit" 15 + + # Set umask so as not to create temps with too-generous modes. + # However, 'strip' requires both read and write access to temps. + case $mode in + # Optimize common cases. + *644) cp_umask=133;; + *755) cp_umask=22;; + + *[0-7]) + if test -z "$stripcmd"; then + u_plus_rw= + else + u_plus_rw='% 200' + fi + cp_umask=`expr '(' 777 - $mode % 1000 ')' $u_plus_rw`;; + *) + if test -z "$stripcmd"; then + u_plus_rw= + else + u_plus_rw=,u+rw + fi + cp_umask=$mode$u_plus_rw;; + esac +fi + for src do - # Protect names starting with `-'. + # Protect names problematic for 'test' and other utilities. case $src in - -*) src=./$src ;; + -* | [=\(\)!]) src=./$src;; esac if test -n "$dir_arg"; then dst=$src - src= - - if test -d "$dst"; then - instcmd=: - chmodcmd= - else - instcmd=$mkdirprog - fi + dstdir=$dst + test -d "$dstdir" + dstdir_status=$? else - # Waiting for this to be detected by the "$instcmd $src $dsttmp" command + + # Waiting for this to be detected by the "$cpprog $src $dsttmp" command # might cause directories to be created, which would be especially bad # if $src (and thus $dsttmp) contains '*'. if test ! -f "$src" && test ! -d "$src"; then @@ -188,138 +265,244 @@ exit 1 fi - if test -z "$dstarg"; then + if test -z "$dst_arg"; then echo "$0: no destination specified." >&2 exit 1 fi - - dst=$dstarg - # Protect names starting with `-'. - case $dst in - -*) dst=./$dst ;; - esac + dst=$dst_arg # If destination is a directory, append the input filename; won't work # if double slashes aren't ignored. if test -d "$dst"; then - dst=$dst/`basename "$src"` + if test "$is_target_a_directory" = never; then + echo "$0: $dst_arg: Is a directory" >&2 + exit 1 + fi + dstdir=$dst + dst=$dstdir/`basename "$src"` + dstdir_status=0 + else + dstdir=`dirname "$dst"` + test -d "$dstdir" + dstdir_status=$? fi fi - # This sed command emulates the dirname command. - dstdir=`echo "$dst" | sed -e 's,[^/]*$,,;s,/$,,;s,^$,.,'` + obsolete_mkdir_used=false - # Make sure that the destination directory exists. - - # Skip lots of stat calls in the usual case. - if test ! -d "$dstdir"; then - defaultIFS=' - ' - IFS="${IFS-$defaultIFS}" - - oIFS=$IFS - # Some sh's can't handle IFS=/ for some reason. - IFS='%' - set - `echo "$dstdir" | sed -e 's@/@%@g' -e 's@^%@/@'` - IFS=$oIFS + if test $dstdir_status != 0; then + case $posix_mkdir in + '') + # Create intermediate dirs using mode 755 as modified by the umask. + # This is like FreeBSD 'install' as of 1997-10-28. + umask=`umask` + case $stripcmd.$umask in + # Optimize common cases. + *[2367][2367]) mkdir_umask=$umask;; + .*0[02][02] | .[02][02] | .[02]) mkdir_umask=22;; + + *[0-7]) + mkdir_umask=`expr $umask + 22 \ + - $umask % 100 % 40 + $umask % 20 \ + - $umask % 10 % 4 + $umask % 2 + `;; + *) mkdir_umask=$umask,go-w;; + esac + + # With -d, create the new directory with the user-specified mode. + # Otherwise, rely on $mkdir_umask. + if test -n "$dir_arg"; then + mkdir_mode=-m$mode + else + mkdir_mode= + fi + + posix_mkdir=false + case $umask in + *[123567][0-7][0-7]) + # POSIX mkdir -p sets u+wx bits regardless of umask, which + # is incompatible with FreeBSD 'install' when (umask & 300) != 0. + ;; + *) + # $RANDOM is not portable (e.g. dash); use it when possible to + # lower collision chance + tmpdir=${TMPDIR-/tmp}/ins$RANDOM-$$ + trap 'ret=$?; rmdir "$tmpdir/a/b" "$tmpdir/a" "$tmpdir" 2>/dev/null; exit $ret' 0 + + # As "mkdir -p" follows symlinks and we work in /tmp possibly; so + # create the $tmpdir first (and fail if unsuccessful) to make sure + # that nobody tries to guess the $tmpdir name. + if (umask $mkdir_umask && + $mkdirprog $mkdir_mode "$tmpdir" && + exec $mkdirprog $mkdir_mode -p -- "$tmpdir/a/b") >/dev/null 2>&1 + then + if test -z "$dir_arg" || { + # Check for POSIX incompatibilities with -m. + # HP-UX 11.23 and IRIX 6.5 mkdir -m -p sets group- or + # other-writable bit of parent directory when it shouldn't. + # FreeBSD 6.1 mkdir -m -p sets mode of existing directory. + test_tmpdir="$tmpdir/a" + ls_ld_tmpdir=`ls -ld "$test_tmpdir"` + case $ls_ld_tmpdir in + d????-?r-*) different_mode=700;; + d????-?--*) different_mode=755;; + *) false;; + esac && + $mkdirprog -m$different_mode -p -- "$test_tmpdir" && { + ls_ld_tmpdir_1=`ls -ld "$test_tmpdir"` + test "$ls_ld_tmpdir" = "$ls_ld_tmpdir_1" + } + } + then posix_mkdir=: + fi + rmdir "$tmpdir/a/b" "$tmpdir/a" "$tmpdir" + else + # Remove any dirs left behind by ancient mkdir implementations. + rmdir ./$mkdir_mode ./-p ./-- "$tmpdir" 2>/dev/null + fi + trap '' 0;; + esac;; + esac - pathcomp= + if + $posix_mkdir && ( + umask $mkdir_umask && + $doit_exec $mkdirprog $mkdir_mode -p -- "$dstdir" + ) + then : + else - while test $# -ne 0 ; do - pathcomp=$pathcomp$1 + # The umask is ridiculous, or mkdir does not conform to POSIX, + # or it failed possibly due to a race condition. Create the + # directory the slow way, step by step, checking for races as we go. + + case $dstdir in + /*) prefix='/';; + [-=\(\)!]*) prefix='./';; + *) prefix='';; + esac + + oIFS=$IFS + IFS=/ + set -f + set fnord $dstdir shift - if test ! -d "$pathcomp"; then - $mkdirprog "$pathcomp" || lasterr=$? - # mkdir can fail with a `File exist' error in case several - # install-sh are creating the directory concurrently. This - # is OK. - test ! -d "$pathcomp" && { (exit ${lasterr-1}); exit; } + set +f + IFS=$oIFS + + prefixes= + + for d + do + test X"$d" = X && continue + + prefix=$prefix$d + if test -d "$prefix"; then + prefixes= + else + if $posix_mkdir; then + (umask=$mkdir_umask && + $doit_exec $mkdirprog $mkdir_mode -p -- "$dstdir") && break + # Don't fail if two instances are running concurrently. + test -d "$prefix" || exit 1 + else + case $prefix in + *\'*) qprefix=`echo "$prefix" | sed "s/'/'\\\\\\\\''/g"`;; + *) qprefix=$prefix;; + esac + prefixes="$prefixes '$qprefix'" + fi + fi + prefix=$prefix/ + done + + if test -n "$prefixes"; then + # Don't fail if two instances are running concurrently. + (umask $mkdir_umask && + eval "\$doit_exec \$mkdirprog $prefixes") || + test -d "$dstdir" || exit 1 + obsolete_mkdir_used=true fi - pathcomp=$pathcomp/ - done + fi fi if test -n "$dir_arg"; then - $doit $instcmd "$dst" \ - && { test -z "$chowncmd" || $doit $chowncmd "$dst"; } \ - && { test -z "$chgrpcmd" || $doit $chgrpcmd "$dst"; } \ - && { test -z "$stripcmd" || $doit $stripcmd "$dst"; } \ - && { test -z "$chmodcmd" || $doit $chmodcmd "$dst"; } - + { test -z "$chowncmd" || $doit $chowncmd "$dst"; } && + { test -z "$chgrpcmd" || $doit $chgrpcmd "$dst"; } && + { test "$obsolete_mkdir_used$chowncmd$chgrpcmd" = false || + test -z "$chmodcmd" || $doit $chmodcmd $mode "$dst"; } || exit 1 else - # If we're going to rename the final executable, determine the name now. - if test -z "$transformarg"; then - dstfile=`basename "$dst"` - else - dstfile=`basename "$dst" $transformbasename \ - | sed $transformarg`$transformbasename - fi - - # don't allow the sed command to completely eliminate the filename. - test -z "$dstfile" && dstfile=`basename "$dst"` # Make a couple of temp file names in the proper directory. dsttmp=$dstdir/_inst.$$_ rmtmp=$dstdir/_rm.$$_ # Trap to clean up those temp files at exit. - trap 'status=$?; rm -f "$dsttmp" "$rmtmp" && exit $status' 0 - trap '(exit $?); exit' 1 2 13 15 + trap 'ret=$?; rm -f "$dsttmp" "$rmtmp" && exit $ret' 0 - # Move or copy the file name to the temp name - $doit $instcmd "$src" "$dsttmp" && + # Copy the file name to the temp name. + (umask $cp_umask && $doit_exec $cpprog "$src" "$dsttmp") && # and set any options; do chmod last to preserve setuid bits. # # If any of these fail, we abort the whole thing. If we want to # ignore errors from any of these, just make sure not to ignore - # errors from the above "$doit $instcmd $src $dsttmp" command. + # errors from the above "$doit $cpprog $src $dsttmp" command. # - { test -z "$chowncmd" || $doit $chowncmd "$dsttmp"; } \ - && { test -z "$chgrpcmd" || $doit $chgrpcmd "$dsttmp"; } \ - && { test -z "$stripcmd" || $doit $stripcmd "$dsttmp"; } \ - && { test -z "$chmodcmd" || $doit $chmodcmd "$dsttmp"; } && - - # Now rename the file to the real destination. - { $doit $mvcmd -f "$dsttmp" "$dstdir/$dstfile" 2>/dev/null \ - || { - # The rename failed, perhaps because mv can't rename something else - # to itself, or perhaps because mv is so ancient that it does not - # support -f. - - # Now remove or move aside any old file at destination location. - # We try this two ways since rm can't unlink itself on some - # systems and the destination file might be busy for other - # reasons. In this case, the final cleanup might fail but the new - # file should still install successfully. - { - if test -f "$dstdir/$dstfile"; then - $doit $rmcmd -f "$dstdir/$dstfile" 2>/dev/null \ - || $doit $mvcmd -f "$dstdir/$dstfile" "$rmtmp" 2>/dev/null \ - || { - echo "$0: cannot unlink or rename $dstdir/$dstfile" >&2 - (exit 1); exit - } - else - : - fi - } && - - # Now rename the file to the real destination. - $doit $mvcmd "$dsttmp" "$dstdir/$dstfile" - } - } - fi || { (exit 1); exit; } -done + { test -z "$chowncmd" || $doit $chowncmd "$dsttmp"; } && + { test -z "$chgrpcmd" || $doit $chgrpcmd "$dsttmp"; } && + { test -z "$stripcmd" || $doit $stripcmd "$dsttmp"; } && + { test -z "$chmodcmd" || $doit $chmodcmd $mode "$dsttmp"; } && + + # If -C, don't bother to copy if it wouldn't change the file. + if $copy_on_change && + old=`LC_ALL=C ls -dlL "$dst" 2>/dev/null` && + new=`LC_ALL=C ls -dlL "$dsttmp" 2>/dev/null` && + set -f && + set X $old && old=:$2:$4:$5:$6 && + set X $new && new=:$2:$4:$5:$6 && + set +f && + test "$old" = "$new" && + $cmpprog "$dst" "$dsttmp" >/dev/null 2>&1 + then + rm -f "$dsttmp" + else + # Rename the file to the real destination. + $doit $mvcmd -f "$dsttmp" "$dst" 2>/dev/null || -# The final little trick to "correctly" pass the exit status to the exit trap. -{ - (exit 0); exit -} + # The rename failed, perhaps because mv can't rename something else + # to itself, or perhaps because mv is so ancient that it does not + # support -f. + { + # Now remove or move aside any old file at destination location. + # We try this two ways since rm can't unlink itself on some + # systems and the destination file might be busy for other + # reasons. In this case, the final cleanup might fail but the new + # file should still install successfully. + { + test ! -f "$dst" || + $doit $rmcmd -f "$dst" 2>/dev/null || + { $doit $mvcmd -f "$dst" "$rmtmp" 2>/dev/null && + { $doit $rmcmd -f "$rmtmp" 2>/dev/null; :; } + } || + { echo "$0: cannot unlink or rename $dst" >&2 + (exit 1); exit 1 + } + } && + + # Now rename the file to the real destination. + $doit $mvcmd "$dsttmp" "$dst" + } + fi || exit 1 + + trap '' 0 + fi +done # Local variables: # eval: (add-hook 'write-file-hooks 'time-stamp) # time-stamp-start: "scriptversion=" # time-stamp-format: "%:y-%02m-%02d.%02H" -# time-stamp-end: "$" +# time-stamp-time-zone: "UTC" +# time-stamp-end: "; # UTC" # End: diff -Nru filtergen-0.12.4/makefile filtergen-0.12.7/makefile --- filtergen-0.12.4/makefile 2016-02-18 07:59:36.000000000 +0000 +++ filtergen-0.12.7/makefile 1970-01-01 00:00:00.000000000 +0000 @@ -1,25 +0,0 @@ -include Makefile - -ifeq ($(ACLOCAL),) - -all: Makefile - $(MAKE) -f Makefile $(MAKECMDGOALS) - -.FORCED: all - -Makefile: configure - ./configure --enable-maintainer-mode - -configure: Makefile.in configure.in config.h.in - autoconf - -Makefile.in: configure.in Makefile.am config.h.in - automake --foreign --add-missing --copy - -config.h.in: configure.in aclocal.m4 - autoheader - -aclocal.m4: configure.in - aclocal - -endif diff -Nru filtergen-0.12.4/Makefile.am filtergen-0.12.7/Makefile.am --- filtergen-0.12.4/Makefile.am 2004-06-09 12:49:05.000000000 +0000 +++ filtergen-0.12.7/Makefile.am 2016-02-13 10:52:59.000000000 +0000 @@ -9,6 +9,7 @@ filter.c \ fg-util.c \ fg-iptables.c \ + fg-iptrestore.c \ fg-ipchains.c \ fg-ipfilter.c \ fg-cisco.c \ @@ -16,12 +17,11 @@ scanner.l \ glue.c \ resolver.c \ - icmpent.c \ - factoriser.c + icmpent.c filtergen_LDADD = @GETOPT_LIBS@ -headers = filter.h util.h ast.h resolver.h icmpent.h factoriser.h +headers = filter.h util.h ast.h resolver.h icmpent.h mans = filter_backends.7 filter_syntax.5 filtergen.8 fgadm.8 @@ -33,7 +33,7 @@ dist_pkgdoc_DATA = $(top_srcdir)/doc/* -EXTRA_DIST = HISTORY HONESTY README TODO $(headers) $(mans) filtergen.spec +EXTRA_DIST = HISTORY HONESTY README TODO $(headers) $(mans) filtergen.spec extras/* AM_CFLAGS = -D_GNU_SOURCE AM_LDFLAGS = -g diff -Nru filtergen-0.12.4/Makefile.in filtergen-0.12.7/Makefile.in --- filtergen-0.12.4/Makefile.in 2016-02-18 07:59:36.000000000 +0000 +++ filtergen-0.12.7/Makefile.in 2016-02-13 10:53:02.000000000 +0000 @@ -1,8 +1,8 @@ -# Makefile.in generated by automake 1.8.5 from Makefile.am. +# Makefile.in generated by automake 1.15 from Makefile.am. # @configure_input@ -# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, -# 2003, 2004 Free Software Foundation, Inc. +# Copyright (C) 1994-2014 Free Software Foundation, Inc. + # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. @@ -16,17 +16,67 @@ -SOURCES = $(filtergen_SOURCES) - -srcdir = @srcdir@ -top_srcdir = @top_srcdir@ VPATH = @srcdir@ +am__is_gnu_make = { \ + if test -z '$(MAKELEVEL)'; then \ + false; \ + elif test -n '$(MAKE_HOST)'; then \ + true; \ + elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \ + true; \ + else \ + false; \ + fi; \ +} +am__make_running_with_option = \ + case $${target_option-} in \ + ?) ;; \ + *) echo "am__make_running_with_option: internal error: invalid" \ + "target option '$${target_option-}' specified" >&2; \ + exit 1;; \ + esac; \ + has_opt=no; \ + sane_makeflags=$$MAKEFLAGS; \ + if $(am__is_gnu_make); then \ + sane_makeflags=$$MFLAGS; \ + else \ + case $$MAKEFLAGS in \ + *\\[\ \ ]*) \ + bs=\\; \ + sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ + | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ + esac; \ + fi; \ + skip_next=no; \ + strip_trailopt () \ + { \ + flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ + }; \ + for flg in $$sane_makeflags; do \ + test $$skip_next = yes && { skip_next=no; continue; }; \ + case $$flg in \ + *=*|--*) continue;; \ + -*I) strip_trailopt 'I'; skip_next=yes;; \ + -*I?*) strip_trailopt 'I';; \ + -*O) strip_trailopt 'O'; skip_next=yes;; \ + -*O?*) strip_trailopt 'O';; \ + -*l) strip_trailopt 'l'; skip_next=yes;; \ + -*l?*) strip_trailopt 'l';; \ + -[dEDm]) skip_next=yes;; \ + -[JT]) skip_next=yes;; \ + esac; \ + case $$flg in \ + *$$target_option*) has_opt=yes; break;; \ + esac; \ + done; \ + test $$has_opt = yes +am__make_dryrun = (target_option=n; $(am__make_running_with_option)) +am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) pkgdatadir = $(datadir)/@PACKAGE@ -pkglibdir = $(libdir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ -top_builddir = . +pkglibdir = $(libdir)/@PACKAGE@ +pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd -INSTALL = @INSTALL@ install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c @@ -40,86 +90,204 @@ POST_UNINSTALL = : sbin_PROGRAMS = filtergen$(EXEEXT) subdir = . -DIST_COMMON = README $(am__configure_deps) $(dist_pkgdoc_DATA) \ - $(dist_pkgex_DATA) $(dist_sysconf_DATA) $(srcdir)/Makefile.am \ - $(srcdir)/Makefile.in $(srcdir)/config.h.in \ - $(srcdir)/fgadm.conf.in $(srcdir)/fgadm.in \ - $(srcdir)/filtergen.spec.in $(srcdir)/rules.filter.in \ - $(top_srcdir)/configure AUTHORS INSTALL THANKS TODO depcomp \ - install-sh missing parser.c parser.h scanner.c ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 -am__aclocal_m4_deps = $(top_srcdir)/configure.in +am__aclocal_m4_deps = $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) +DIST_COMMON = $(srcdir)/Makefile.am $(top_srcdir)/configure \ + $(am__configure_deps) $(dist_pkgdoc_DATA) $(dist_pkgex_DATA) \ + $(dist_sysconf_DATA) $(am__DIST_COMMON) am__CONFIG_DISTCLEAN_FILES = config.status config.cache config.log \ - configure.lineno configure.status.lineno -mkinstalldirs = $(mkdir_p) + configure.lineno config.status.lineno +mkinstalldirs = $(install_sh) -d CONFIG_HEADER = config.h CONFIG_CLEAN_FILES = filtergen.spec fgadm fgadm.conf rules.filter -am__installdirs = "$(DESTDIR)$(sbindir)" "$(DESTDIR)$(sbindir)" "$(DESTDIR)$(man5dir)" "$(DESTDIR)$(man7dir)" "$(DESTDIR)$(man8dir)" "$(DESTDIR)$(pkgdocdir)" "$(DESTDIR)$(pkgexdir)" "$(DESTDIR)$(sysconfdir)" -sbinPROGRAMS_INSTALL = $(INSTALL_PROGRAM) +CONFIG_CLEAN_VPATH_FILES = +am__installdirs = "$(DESTDIR)$(sbindir)" "$(DESTDIR)$(sbindir)" \ + "$(DESTDIR)$(man5dir)" "$(DESTDIR)$(man7dir)" \ + "$(DESTDIR)$(man8dir)" "$(DESTDIR)$(pkgdocdir)" \ + "$(DESTDIR)$(pkgexdir)" "$(DESTDIR)$(sysconfdir)" PROGRAMS = $(sbin_PROGRAMS) am_filtergen_OBJECTS = filtergen.$(OBJEXT) gen.$(OBJEXT) \ filter.$(OBJEXT) fg-util.$(OBJEXT) fg-iptables.$(OBJEXT) \ - fg-ipchains.$(OBJEXT) fg-ipfilter.$(OBJEXT) fg-cisco.$(OBJEXT) \ - parser.$(OBJEXT) scanner.$(OBJEXT) glue.$(OBJEXT) \ - resolver.$(OBJEXT) icmpent.$(OBJEXT) factoriser.$(OBJEXT) + fg-iptrestore.$(OBJEXT) fg-ipchains.$(OBJEXT) \ + fg-ipfilter.$(OBJEXT) fg-cisco.$(OBJEXT) parser.$(OBJEXT) \ + scanner.$(OBJEXT) glue.$(OBJEXT) resolver.$(OBJEXT) \ + icmpent.$(OBJEXT) filtergen_OBJECTS = $(am_filtergen_OBJECTS) filtergen_DEPENDENCIES = -sbinSCRIPT_INSTALL = $(INSTALL_SCRIPT) +am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; +am__vpath_adj = case $$p in \ + $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ + *) f=$$p;; \ + esac; +am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`; +am__install_max = 40 +am__nobase_strip_setup = \ + srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'` +am__nobase_strip = \ + for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||" +am__nobase_list = $(am__nobase_strip_setup); \ + for p in $$list; do echo "$$p $$p"; done | \ + sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \ + $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \ + if (++n[$$2] == $(am__install_max)) \ + { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \ + END { for (dir in files) print dir, files[dir] }' +am__base_list = \ + sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \ + sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g' +am__uninstall_files_from_dir = { \ + test -z "$$files" \ + || { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \ + || { echo " ( cd '$$dir' && rm -f" $$files ")"; \ + $(am__cd) "$$dir" && rm -f $$files; }; \ + } SCRIPTS = $(sbin_SCRIPTS) -DEFAULT_INCLUDES = -I. -I$(srcdir) -I. +AM_V_P = $(am__v_P_@AM_V@) +am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) +am__v_P_0 = false +am__v_P_1 = : +AM_V_GEN = $(am__v_GEN_@AM_V@) +am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) +am__v_GEN_0 = @echo " GEN " $@; +am__v_GEN_1 = +AM_V_at = $(am__v_at_@AM_V@) +am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) +am__v_at_0 = @ +am__v_at_1 = +DEFAULT_INCLUDES = -I.@am__isrc@ depcomp = $(SHELL) $(top_srcdir)/depcomp am__depfiles_maybe = depfiles -@AMDEP_TRUE@DEP_FILES = ./$(DEPDIR)/factoriser.Po \ -@AMDEP_TRUE@ ./$(DEPDIR)/fg-cisco.Po ./$(DEPDIR)/fg-ipchains.Po \ -@AMDEP_TRUE@ ./$(DEPDIR)/fg-ipfilter.Po \ -@AMDEP_TRUE@ ./$(DEPDIR)/fg-iptables.Po ./$(DEPDIR)/fg-util.Po \ -@AMDEP_TRUE@ ./$(DEPDIR)/filter.Po ./$(DEPDIR)/filtergen.Po \ -@AMDEP_TRUE@ ./$(DEPDIR)/gen.Po ./$(DEPDIR)/glue.Po \ -@AMDEP_TRUE@ ./$(DEPDIR)/icmpent.Po ./$(DEPDIR)/parser.Po \ -@AMDEP_TRUE@ ./$(DEPDIR)/resolver.Po ./$(DEPDIR)/scanner.Po +am__mv = mv -f COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) +AM_V_CC = $(am__v_CC_@AM_V@) +am__v_CC_ = $(am__v_CC_@AM_DEFAULT_V@) +am__v_CC_0 = @echo " CC " $@; +am__v_CC_1 = CCLD = $(CC) LINK = $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@ -LEXCOMPILE = $(LEX) $(LFLAGS) $(AM_LFLAGS) -YACCCOMPILE = $(YACC) $(YFLAGS) $(AM_YFLAGS) +AM_V_CCLD = $(am__v_CCLD_@AM_V@) +am__v_CCLD_ = $(am__v_CCLD_@AM_DEFAULT_V@) +am__v_CCLD_0 = @echo " CCLD " $@; +am__v_CCLD_1 = +@MAINTAINER_MODE_FALSE@am__skiplex = test -f $@ || +LEXCOMPILE = $(LEX) $(AM_LFLAGS) $(LFLAGS) +AM_V_LEX = $(am__v_LEX_@AM_V@) +am__v_LEX_ = $(am__v_LEX_@AM_DEFAULT_V@) +am__v_LEX_0 = @echo " LEX " $@; +am__v_LEX_1 = +YLWRAP = $(top_srcdir)/ylwrap +@MAINTAINER_MODE_FALSE@am__skipyacc = test -f $@ || +am__yacc_c2h = sed -e s/cc$$/hh/ -e s/cpp$$/hpp/ -e s/cxx$$/hxx/ \ + -e s/c++$$/h++/ -e s/c$$/h/ +YACCCOMPILE = $(YACC) $(AM_YFLAGS) $(YFLAGS) +AM_V_YACC = $(am__v_YACC_@AM_V@) +am__v_YACC_ = $(am__v_YACC_@AM_DEFAULT_V@) +am__v_YACC_0 = @echo " YACC " $@; +am__v_YACC_1 = SOURCES = $(filtergen_SOURCES) DIST_SOURCES = $(filtergen_SOURCES) -RECURSIVE_TARGETS = all-recursive check-recursive dvi-recursive \ - html-recursive info-recursive install-data-recursive \ - install-exec-recursive install-info-recursive \ - install-recursive installcheck-recursive installdirs-recursive \ - pdf-recursive ps-recursive uninstall-info-recursive \ - uninstall-recursive +RECURSIVE_TARGETS = all-recursive check-recursive cscopelist-recursive \ + ctags-recursive dvi-recursive html-recursive info-recursive \ + install-data-recursive install-dvi-recursive \ + install-exec-recursive install-html-recursive \ + install-info-recursive install-pdf-recursive \ + install-ps-recursive install-recursive installcheck-recursive \ + installdirs-recursive pdf-recursive ps-recursive \ + tags-recursive uninstall-recursive +am__can_run_installinfo = \ + case $$AM_UPDATE_INFO_DIR in \ + n|no|NO) false;; \ + *) (install-info --version) >/dev/null 2>&1;; \ + esac man5dir = $(mandir)/man5 man7dir = $(mandir)/man7 man8dir = $(mandir)/man8 NROFF = nroff MANS = $(man_MANS) -dist_pkgdocDATA_INSTALL = $(INSTALL_DATA) -dist_pkgexDATA_INSTALL = $(INSTALL_DATA) -dist_sysconfDATA_INSTALL = $(INSTALL_DATA) DATA = $(dist_pkgdoc_DATA) $(dist_pkgex_DATA) $(dist_sysconf_DATA) +RECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive \ + distclean-recursive maintainer-clean-recursive +am__recursive_targets = \ + $(RECURSIVE_TARGETS) \ + $(RECURSIVE_CLEAN_TARGETS) \ + $(am__extra_recursive_targets) +AM_RECURSIVE_TARGETS = $(am__recursive_targets:-recursive=) TAGS CTAGS \ + cscope distdir dist dist-all distcheck +am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) \ + $(LISP)config.h.in +# Read a list of newline-separated strings from the standard input, +# and print each of them once, without duplicates. Input order is +# *not* preserved. +am__uniquify_input = $(AWK) '\ + BEGIN { nonempty = 0; } \ + { items[$$0] = 1; nonempty = 1; } \ + END { if (nonempty) { for (i in items) print i; }; } \ +' +# Make sure the list of sources is unique. This is necessary because, +# e.g., the same source file might be shared among _SOURCES variables +# for different programs/libraries. +am__define_uniq_tagged_files = \ + list='$(am__tagged_files)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | $(am__uniquify_input)` ETAGS = etags CTAGS = ctags +CSCOPE = cscope DIST_SUBDIRS = $(SUBDIRS) +am__DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/config.h.in \ + $(srcdir)/fgadm.conf.in $(srcdir)/fgadm.in \ + $(srcdir)/filtergen.spec.in $(srcdir)/rules.filter.in AUTHORS \ + INSTALL README THANKS TODO compile config.guess config.sub \ + depcomp install-sh missing parser.c parser.h scanner.c ylwrap DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) distdir = $(PACKAGE)-$(VERSION) top_distdir = $(distdir) am__remove_distdir = \ - { test ! -d $(distdir) \ - || { find $(distdir) -type d ! -perm -200 -exec chmod u+w {} ';' \ - && rm -fr $(distdir); }; } + if test -d "$(distdir)"; then \ + find "$(distdir)" -type d ! -perm -200 -exec chmod u+w {} ';' \ + && rm -rf "$(distdir)" \ + || { sleep 5 && rm -rf "$(distdir)"; }; \ + else :; fi +am__post_remove_distdir = $(am__remove_distdir) +am__relativize = \ + dir0=`pwd`; \ + sed_first='s,^\([^/]*\)/.*$$,\1,'; \ + sed_rest='s,^[^/]*/*,,'; \ + sed_last='s,^.*/\([^/]*\)$$,\1,'; \ + sed_butlast='s,/*[^/]*$$,,'; \ + while test -n "$$dir1"; do \ + first=`echo "$$dir1" | sed -e "$$sed_first"`; \ + if test "$$first" != "."; then \ + if test "$$first" = ".."; then \ + dir2=`echo "$$dir0" | sed -e "$$sed_last"`/"$$dir2"; \ + dir0=`echo "$$dir0" | sed -e "$$sed_butlast"`; \ + else \ + first2=`echo "$$dir2" | sed -e "$$sed_first"`; \ + if test "$$first2" = "$$first"; then \ + dir2=`echo "$$dir2" | sed -e "$$sed_rest"`; \ + else \ + dir2="../$$dir2"; \ + fi; \ + dir0="$$dir0"/"$$first"; \ + fi; \ + fi; \ + dir1=`echo "$$dir1" | sed -e "$$sed_rest"`; \ + done; \ + reldir="$$dir2" DIST_ARCHIVES = $(distdir).tar.gz $(distdir).tar.bz2 GZIP_ENV = --best +DIST_TARGETS = dist-bzip2 dist-gzip distuninstallcheck_listfiles = find . -type f -print +am__distuninstallcheck_listfiles = $(distuninstallcheck_listfiles) \ + | sed 's|^\./|$(prefix)/|' | grep -v '$(infodir)/dir$$' distcleancheck_listfiles = find . -type f -print ACLOCAL = @ACLOCAL@ -AMDEP_FALSE = @AMDEP_FALSE@ -AMDEP_TRUE = @AMDEP_TRUE@ AMTAR = @AMTAR@ +AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ @@ -139,6 +307,8 @@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ GETOPT_LIBS = @GETOPT_LIBS@ +GREP = @GREP@ +INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ @@ -151,15 +321,15 @@ LIBS = @LIBS@ LTLIBOBJS = @LTLIBOBJS@ MAINT = @MAINT@ -MAINTAINER_MODE_FALSE = @MAINTAINER_MODE_FALSE@ -MAINTAINER_MODE_TRUE = @MAINTAINER_MODE_TRUE@ MAKEINFO = @MAKEINFO@ +MKDIR_P = @MKDIR_P@ OBJEXT = @OBJEXT@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ +PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PROGRAM = @PROGRAM@ @@ -170,35 +340,52 @@ SYSCONFDIR = @SYSCONFDIR@ VERSION = @VERSION@ YACC = @YACC@ +YFLAGS = @YFLAGS@ +abs_builddir = @abs_builddir@ +abs_srcdir = @abs_srcdir@ +abs_top_builddir = @abs_top_builddir@ +abs_top_srcdir = @abs_top_srcdir@ ac_ct_CC = @ac_ct_CC@ -ac_ct_STRIP = @ac_ct_STRIP@ -am__fastdepCC_FALSE = @am__fastdepCC_FALSE@ -am__fastdepCC_TRUE = @am__fastdepCC_TRUE@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ +am__tar = @am__tar@ +am__untar = @am__untar@ bindir = @bindir@ build_alias = @build_alias@ +builddir = @builddir@ datadir = @datadir@ +datarootdir = @datarootdir@ +docdir = @docdir@ +dvidir = @dvidir@ exec_prefix = @exec_prefix@ host_alias = @host_alias@ +htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ +localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ +pdfdir = @pdfdir@ pkgdocdir = @pkgdocdir@ pkgexdir = @pkgexdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ +psdir = @psdir@ +runstatedir = @runstatedir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ +srcdir = @srcdir@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ +top_build_prefix = @top_build_prefix@ +top_builddir = @top_builddir@ +top_srcdir = @top_srcdir@ SUBDIRS = . t sbin_SCRIPTS = fgadm filtergen_SOURCES = \ @@ -207,6 +394,7 @@ filter.c \ fg-util.c \ fg-iptables.c \ + fg-iptrestore.c \ fg-ipchains.c \ fg-ipfilter.c \ fg-cisco.c \ @@ -214,17 +402,16 @@ scanner.l \ glue.c \ resolver.c \ - icmpent.c \ - factoriser.c + icmpent.c filtergen_LDADD = @GETOPT_LIBS@ -headers = filter.h util.h ast.h resolver.h icmpent.h factoriser.h +headers = filter.h util.h ast.h resolver.h icmpent.h mans = filter_backends.7 filter_syntax.5 filtergen.8 fgadm.8 man_MANS = $(mans) dist_sysconf_DATA = fgadm.conf rules.filter dist_pkgex_DATA = $(top_srcdir)/examples/*.filter dist_pkgdoc_DATA = $(top_srcdir)/doc/* -EXTRA_DIST = HISTORY HONESTY README TODO $(headers) $(mans) filtergen.spec +EXTRA_DIST = HISTORY HONESTY README TODO $(headers) $(mans) filtergen.spec extras/* AM_CFLAGS = -D_GNU_SOURCE AM_LDFLAGS = -g AM_YFLAGS = -d @@ -233,22 +420,21 @@ .SUFFIXES: .SUFFIXES: .c .l .o .obj .y -am--refresh: +am--refresh: Makefile @: $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ - echo ' cd $(srcdir) && $(AUTOMAKE) --foreign '; \ - cd $(srcdir) && $(AUTOMAKE) --foreign \ + echo ' cd $(srcdir) && $(AUTOMAKE) --foreign'; \ + $(am__cd) $(srcdir) && $(AUTOMAKE) --foreign \ && exit 0; \ exit 1;; \ esac; \ done; \ - echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign Makefile'; \ - cd $(top_srcdir) && \ - $(AUTOMAKE) --foreign Makefile -.PRECIOUS: Makefile + echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign Makefile'; \ + $(am__cd) $(top_srcdir) && \ + $(AUTOMAKE) --foreign Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ @@ -263,21 +449,20 @@ $(SHELL) ./config.status --recheck $(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) - cd $(srcdir) && $(AUTOCONF) + $(am__cd) $(srcdir) && $(AUTOCONF) $(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) - cd $(srcdir) && $(ACLOCAL) $(ACLOCAL_AMFLAGS) + $(am__cd) $(srcdir) && $(ACLOCAL) $(ACLOCAL_AMFLAGS) +$(am__aclocal_m4_deps): config.h: stamp-h1 - @if test ! -f $@; then \ - rm -f stamp-h1; \ - $(MAKE) stamp-h1; \ - else :; fi + @test -f $@ || rm -f stamp-h1 + @test -f $@ || $(MAKE) $(AM_MAKEFLAGS) stamp-h1 stamp-h1: $(srcdir)/config.h.in $(top_builddir)/config.status @rm -f stamp-h1 cd $(top_builddir) && $(SHELL) ./config.status config.h $(srcdir)/config.h.in: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) - cd $(top_srcdir) && $(AUTOHEADER) + ($(am__cd) $(top_srcdir) && $(AUTOHEADER)) rm -f stamp-h1 touch $@ @@ -293,54 +478,88 @@ cd $(top_builddir) && $(SHELL) ./config.status $@ install-sbinPROGRAMS: $(sbin_PROGRAMS) @$(NORMAL_INSTALL) - test -z "$(sbindir)" || $(mkdir_p) "$(DESTDIR)$(sbindir)" - @list='$(sbin_PROGRAMS)'; for p in $$list; do \ - p1=`echo $$p|sed 's/$(EXEEXT)$$//'`; \ - if test -f $$p \ - ; then \ - f=`echo "$$p1" | sed 's,^.*/,,;$(transform);s/$$/$(EXEEXT)/'`; \ - echo " $(INSTALL_PROGRAM_ENV) $(sbinPROGRAMS_INSTALL) '$$p' '$(DESTDIR)$(sbindir)/$$f'"; \ - $(INSTALL_PROGRAM_ENV) $(sbinPROGRAMS_INSTALL) "$$p" "$(DESTDIR)$(sbindir)/$$f" || exit 1; \ - else :; fi; \ - done + @list='$(sbin_PROGRAMS)'; test -n "$(sbindir)" || list=; \ + if test -n "$$list"; then \ + echo " $(MKDIR_P) '$(DESTDIR)$(sbindir)'"; \ + $(MKDIR_P) "$(DESTDIR)$(sbindir)" || exit 1; \ + fi; \ + for p in $$list; do echo "$$p $$p"; done | \ + sed 's/$(EXEEXT)$$//' | \ + while read p p1; do if test -f $$p \ + ; then echo "$$p"; echo "$$p"; else :; fi; \ + done | \ + sed -e 'p;s,.*/,,;n;h' \ + -e 's|.*|.|' \ + -e 'p;x;s,.*/,,;s/$(EXEEXT)$$//;$(transform);s/$$/$(EXEEXT)/' | \ + sed 'N;N;N;s,\n, ,g' | \ + $(AWK) 'BEGIN { files["."] = ""; dirs["."] = 1 } \ + { d=$$3; if (dirs[d] != 1) { print "d", d; dirs[d] = 1 } \ + if ($$2 == $$4) files[d] = files[d] " " $$1; \ + else { print "f", $$3 "/" $$4, $$1; } } \ + END { for (d in files) print "f", d, files[d] }' | \ + while read type dir files; do \ + if test "$$dir" = .; then dir=; else dir=/$$dir; fi; \ + test -z "$$files" || { \ + echo " $(INSTALL_PROGRAM_ENV) $(INSTALL_PROGRAM) $$files '$(DESTDIR)$(sbindir)$$dir'"; \ + $(INSTALL_PROGRAM_ENV) $(INSTALL_PROGRAM) $$files "$(DESTDIR)$(sbindir)$$dir" || exit $$?; \ + } \ + ; done uninstall-sbinPROGRAMS: @$(NORMAL_UNINSTALL) - @list='$(sbin_PROGRAMS)'; for p in $$list; do \ - f=`echo "$$p" | sed 's,^.*/,,;s/$(EXEEXT)$$//;$(transform);s/$$/$(EXEEXT)/'`; \ - echo " rm -f '$(DESTDIR)$(sbindir)/$$f'"; \ - rm -f "$(DESTDIR)$(sbindir)/$$f"; \ - done + @list='$(sbin_PROGRAMS)'; test -n "$(sbindir)" || list=; \ + files=`for p in $$list; do echo "$$p"; done | \ + sed -e 'h;s,^.*/,,;s/$(EXEEXT)$$//;$(transform)' \ + -e 's/$$/$(EXEEXT)/' \ + `; \ + test -n "$$list" || exit 0; \ + echo " ( cd '$(DESTDIR)$(sbindir)' && rm -f" $$files ")"; \ + cd "$(DESTDIR)$(sbindir)" && rm -f $$files clean-sbinPROGRAMS: -test -z "$(sbin_PROGRAMS)" || rm -f $(sbin_PROGRAMS) parser.h: parser.c - @if test ! -f $@; then \ - rm -f parser.c; \ - $(MAKE) parser.c; \ - else :; fi -filtergen$(EXEEXT): $(filtergen_OBJECTS) $(filtergen_DEPENDENCIES) + @if test ! -f $@; then rm -f parser.c; else :; fi + @if test ! -f $@; then $(MAKE) $(AM_MAKEFLAGS) parser.c; else :; fi + +filtergen$(EXEEXT): $(filtergen_OBJECTS) $(filtergen_DEPENDENCIES) $(EXTRA_filtergen_DEPENDENCIES) @rm -f filtergen$(EXEEXT) - $(LINK) $(filtergen_LDFLAGS) $(filtergen_OBJECTS) $(filtergen_LDADD) $(LIBS) + $(AM_V_CCLD)$(LINK) $(filtergen_OBJECTS) $(filtergen_LDADD) $(LIBS) install-sbinSCRIPTS: $(sbin_SCRIPTS) @$(NORMAL_INSTALL) - test -z "$(sbindir)" || $(mkdir_p) "$(DESTDIR)$(sbindir)" - @list='$(sbin_SCRIPTS)'; for p in $$list; do \ + @list='$(sbin_SCRIPTS)'; test -n "$(sbindir)" || list=; \ + if test -n "$$list"; then \ + echo " $(MKDIR_P) '$(DESTDIR)$(sbindir)'"; \ + $(MKDIR_P) "$(DESTDIR)$(sbindir)" || exit 1; \ + fi; \ + for p in $$list; do \ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ - if test -f $$d$$p; then \ - f=`echo "$$p" | sed 's|^.*/||;$(transform)'`; \ - echo " $(sbinSCRIPT_INSTALL) '$$d$$p' '$(DESTDIR)$(sbindir)/$$f'"; \ - $(sbinSCRIPT_INSTALL) "$$d$$p" "$(DESTDIR)$(sbindir)/$$f"; \ - else :; fi; \ - done + if test -f "$$d$$p"; then echo "$$d$$p"; echo "$$p"; else :; fi; \ + done | \ + sed -e 'p;s,.*/,,;n' \ + -e 'h;s|.*|.|' \ + -e 'p;x;s,.*/,,;$(transform)' | sed 'N;N;N;s,\n, ,g' | \ + $(AWK) 'BEGIN { files["."] = ""; dirs["."] = 1; } \ + { d=$$3; if (dirs[d] != 1) { print "d", d; dirs[d] = 1 } \ + if ($$2 == $$4) { files[d] = files[d] " " $$1; \ + if (++n[d] == $(am__install_max)) { \ + print "f", d, files[d]; n[d] = 0; files[d] = "" } } \ + else { print "f", d "/" $$4, $$1 } } \ + END { for (d in files) print "f", d, files[d] }' | \ + while read type dir files; do \ + if test "$$dir" = .; then dir=; else dir=/$$dir; fi; \ + test -z "$$files" || { \ + echo " $(INSTALL_SCRIPT) $$files '$(DESTDIR)$(sbindir)$$dir'"; \ + $(INSTALL_SCRIPT) $$files "$(DESTDIR)$(sbindir)$$dir" || exit $$?; \ + } \ + ; done uninstall-sbinSCRIPTS: @$(NORMAL_UNINSTALL) - @list='$(sbin_SCRIPTS)'; for p in $$list; do \ - f=`echo "$$p" | sed 's|^.*/||;$(transform)'`; \ - echo " rm -f '$(DESTDIR)$(sbindir)/$$f'"; \ - rm -f "$(DESTDIR)$(sbindir)/$$f"; \ - done + @list='$(sbin_SCRIPTS)'; test -n "$(sbindir)" || exit 0; \ + files=`for p in $$list; do echo "$$p"; done | \ + sed -e 's,.*/,,;$(transform)'`; \ + dir='$(DESTDIR)$(sbindir)'; $(am__uninstall_files_from_dir) mostlyclean-compile: -rm -f *.$(OBJEXT) @@ -348,11 +567,11 @@ distclean-compile: -rm -f *.tab.c -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/factoriser.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/fg-cisco.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/fg-ipchains.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/fg-ipfilter.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/fg-iptables.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/fg-iptrestore.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/fg-util.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/filter.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/filtergen.Po@am__quote@ @@ -364,244 +583,237 @@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/scanner.Po@am__quote@ .c.o: -@am__fastdepCC_TRUE@ if $(COMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ $<; \ -@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi -@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ depfile='$(DEPDIR)/$*.Po' tmpdepfile='$(DEPDIR)/$*.TPo' @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(COMPILE) -c $< +@am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ $< .c.obj: -@am__fastdepCC_TRUE@ if $(COMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ `$(CYGPATH_W) '$<'`; \ -@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi -@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ depfile='$(DEPDIR)/$*.Po' tmpdepfile='$(DEPDIR)/$*.TPo' @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(COMPILE) -c `$(CYGPATH_W) '$<'` +@am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ `$(CYGPATH_W) '$<'` .l.c: - $(LEXCOMPILE) $< - sed '/^#/ s|$(LEX_OUTPUT_ROOT)\.c|$@|' $(LEX_OUTPUT_ROOT).c >$@ - rm -f $(LEX_OUTPUT_ROOT).c + $(AM_V_LEX)$(am__skiplex) $(SHELL) $(YLWRAP) $< $(LEX_OUTPUT_ROOT).c $@ -- $(LEXCOMPILE) .y.c: - $(YACCCOMPILE) $< - if test -f y.tab.h; then \ - to=`echo "$*_H" | sed \ - -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/' \ - -e 's/[^ABCDEFGHIJKLMNOPQRSTUVWXYZ]/_/g'`; \ - sed "/^#/ s/Y_TAB_H/$$to/g" y.tab.h >$*.ht; \ - rm -f y.tab.h; \ - if cmp -s $*.ht $*.h; then \ - rm -f $*.ht ;\ - else \ - mv $*.ht $*.h; \ - fi; \ - fi - if test -f y.output; then \ - mv y.output $*.output; \ - fi - sed '/^#/ s|y\.tab\.c|$@|' y.tab.c >$@t && mv $@t $@ - rm -f y.tab.c -uninstall-info-am: -install-man5: $(man5_MANS) $(man_MANS) + $(AM_V_YACC)$(am__skipyacc) $(SHELL) $(YLWRAP) $< y.tab.c $@ y.tab.h `echo $@ | $(am__yacc_c2h)` y.output $*.output -- $(YACCCOMPILE) +install-man5: $(man_MANS) @$(NORMAL_INSTALL) - test -z "$(man5dir)" || $(mkdir_p) "$(DESTDIR)$(man5dir)" - @list='$(man5_MANS) $(dist_man5_MANS) $(nodist_man5_MANS)'; \ - l2='$(man_MANS) $(dist_man_MANS) $(nodist_man_MANS)'; \ - for i in $$l2; do \ - case "$$i" in \ - *.5*) list="$$list $$i" ;; \ - esac; \ + @list1=''; \ + list2='$(man_MANS)'; \ + test -n "$(man5dir)" \ + && test -n "`echo $$list1$$list2`" \ + || exit 0; \ + echo " $(MKDIR_P) '$(DESTDIR)$(man5dir)'"; \ + $(MKDIR_P) "$(DESTDIR)$(man5dir)" || exit 1; \ + { for i in $$list1; do echo "$$i"; done; \ + if test -n "$$list2"; then \ + for i in $$list2; do echo "$$i"; done \ + | sed -n '/\.5[a-z]*$$/p'; \ + fi; \ + } | while read p; do \ + if test -f $$p; then d=; else d="$(srcdir)/"; fi; \ + echo "$$d$$p"; echo "$$p"; \ + done | \ + sed -e 'n;s,.*/,,;p;h;s,.*\.,,;s,^[^5][0-9a-z]*$$,5,;x' \ + -e 's,\.[0-9a-z]*$$,,;$(transform);G;s,\n,.,' | \ + sed 'N;N;s,\n, ,g' | { \ + list=; while read file base inst; do \ + if test "$$base" = "$$inst"; then list="$$list $$file"; else \ + echo " $(INSTALL_DATA) '$$file' '$(DESTDIR)$(man5dir)/$$inst'"; \ + $(INSTALL_DATA) "$$file" "$(DESTDIR)$(man5dir)/$$inst" || exit $$?; \ + fi; \ done; \ - for i in $$list; do \ - if test -f $(srcdir)/$$i; then file=$(srcdir)/$$i; \ - else file=$$i; fi; \ - ext=`echo $$i | sed -e 's/^.*\\.//'`; \ - case "$$ext" in \ - 5*) ;; \ - *) ext='5' ;; \ - esac; \ - inst=`echo $$i | sed -e 's/\\.[0-9a-z]*$$//'`; \ - inst=`echo $$inst | sed -e 's/^.*\///'`; \ - inst=`echo $$inst | sed '$(transform)'`.$$ext; \ - echo " $(INSTALL_DATA) '$$file' '$(DESTDIR)$(man5dir)/$$inst'"; \ - $(INSTALL_DATA) "$$file" "$(DESTDIR)$(man5dir)/$$inst"; \ - done + for i in $$list; do echo "$$i"; done | $(am__base_list) | \ + while read files; do \ + test -z "$$files" || { \ + echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(man5dir)'"; \ + $(INSTALL_DATA) $$files "$(DESTDIR)$(man5dir)" || exit $$?; }; \ + done; } + uninstall-man5: @$(NORMAL_UNINSTALL) - @list='$(man5_MANS) $(dist_man5_MANS) $(nodist_man5_MANS)'; \ - l2='$(man_MANS) $(dist_man_MANS) $(nodist_man_MANS)'; \ - for i in $$l2; do \ - case "$$i" in \ - *.5*) list="$$list $$i" ;; \ - esac; \ - done; \ - for i in $$list; do \ - ext=`echo $$i | sed -e 's/^.*\\.//'`; \ - case "$$ext" in \ - 5*) ;; \ - *) ext='5' ;; \ - esac; \ - inst=`echo $$i | sed -e 's/\\.[0-9a-z]*$$//'`; \ - inst=`echo $$inst | sed -e 's/^.*\///'`; \ - inst=`echo $$inst | sed '$(transform)'`.$$ext; \ - echo " rm -f '$(DESTDIR)$(man5dir)/$$inst'"; \ - rm -f "$(DESTDIR)$(man5dir)/$$inst"; \ - done -install-man7: $(man7_MANS) $(man_MANS) + @list=''; test -n "$(man5dir)" || exit 0; \ + files=`{ for i in $$list; do echo "$$i"; done; \ + l2='$(man_MANS)'; for i in $$l2; do echo "$$i"; done | \ + sed -n '/\.5[a-z]*$$/p'; \ + } | sed -e 's,.*/,,;h;s,.*\.,,;s,^[^5][0-9a-z]*$$,5,;x' \ + -e 's,\.[0-9a-z]*$$,,;$(transform);G;s,\n,.,'`; \ + dir='$(DESTDIR)$(man5dir)'; $(am__uninstall_files_from_dir) +install-man7: $(man_MANS) @$(NORMAL_INSTALL) - test -z "$(man7dir)" || $(mkdir_p) "$(DESTDIR)$(man7dir)" - @list='$(man7_MANS) $(dist_man7_MANS) $(nodist_man7_MANS)'; \ - l2='$(man_MANS) $(dist_man_MANS) $(nodist_man_MANS)'; \ - for i in $$l2; do \ - case "$$i" in \ - *.7*) list="$$list $$i" ;; \ - esac; \ + @list1=''; \ + list2='$(man_MANS)'; \ + test -n "$(man7dir)" \ + && test -n "`echo $$list1$$list2`" \ + || exit 0; \ + echo " $(MKDIR_P) '$(DESTDIR)$(man7dir)'"; \ + $(MKDIR_P) "$(DESTDIR)$(man7dir)" || exit 1; \ + { for i in $$list1; do echo "$$i"; done; \ + if test -n "$$list2"; then \ + for i in $$list2; do echo "$$i"; done \ + | sed -n '/\.7[a-z]*$$/p'; \ + fi; \ + } | while read p; do \ + if test -f $$p; then d=; else d="$(srcdir)/"; fi; \ + echo "$$d$$p"; echo "$$p"; \ + done | \ + sed -e 'n;s,.*/,,;p;h;s,.*\.,,;s,^[^7][0-9a-z]*$$,7,;x' \ + -e 's,\.[0-9a-z]*$$,,;$(transform);G;s,\n,.,' | \ + sed 'N;N;s,\n, ,g' | { \ + list=; while read file base inst; do \ + if test "$$base" = "$$inst"; then list="$$list $$file"; else \ + echo " $(INSTALL_DATA) '$$file' '$(DESTDIR)$(man7dir)/$$inst'"; \ + $(INSTALL_DATA) "$$file" "$(DESTDIR)$(man7dir)/$$inst" || exit $$?; \ + fi; \ done; \ - for i in $$list; do \ - if test -f $(srcdir)/$$i; then file=$(srcdir)/$$i; \ - else file=$$i; fi; \ - ext=`echo $$i | sed -e 's/^.*\\.//'`; \ - case "$$ext" in \ - 7*) ;; \ - *) ext='7' ;; \ - esac; \ - inst=`echo $$i | sed -e 's/\\.[0-9a-z]*$$//'`; \ - inst=`echo $$inst | sed -e 's/^.*\///'`; \ - inst=`echo $$inst | sed '$(transform)'`.$$ext; \ - echo " $(INSTALL_DATA) '$$file' '$(DESTDIR)$(man7dir)/$$inst'"; \ - $(INSTALL_DATA) "$$file" "$(DESTDIR)$(man7dir)/$$inst"; \ - done + for i in $$list; do echo "$$i"; done | $(am__base_list) | \ + while read files; do \ + test -z "$$files" || { \ + echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(man7dir)'"; \ + $(INSTALL_DATA) $$files "$(DESTDIR)$(man7dir)" || exit $$?; }; \ + done; } + uninstall-man7: @$(NORMAL_UNINSTALL) - @list='$(man7_MANS) $(dist_man7_MANS) $(nodist_man7_MANS)'; \ - l2='$(man_MANS) $(dist_man_MANS) $(nodist_man_MANS)'; \ - for i in $$l2; do \ - case "$$i" in \ - *.7*) list="$$list $$i" ;; \ - esac; \ - done; \ - for i in $$list; do \ - ext=`echo $$i | sed -e 's/^.*\\.//'`; \ - case "$$ext" in \ - 7*) ;; \ - *) ext='7' ;; \ - esac; \ - inst=`echo $$i | sed -e 's/\\.[0-9a-z]*$$//'`; \ - inst=`echo $$inst | sed -e 's/^.*\///'`; \ - inst=`echo $$inst | sed '$(transform)'`.$$ext; \ - echo " rm -f '$(DESTDIR)$(man7dir)/$$inst'"; \ - rm -f "$(DESTDIR)$(man7dir)/$$inst"; \ - done -install-man8: $(man8_MANS) $(man_MANS) + @list=''; test -n "$(man7dir)" || exit 0; \ + files=`{ for i in $$list; do echo "$$i"; done; \ + l2='$(man_MANS)'; for i in $$l2; do echo "$$i"; done | \ + sed -n '/\.7[a-z]*$$/p'; \ + } | sed -e 's,.*/,,;h;s,.*\.,,;s,^[^7][0-9a-z]*$$,7,;x' \ + -e 's,\.[0-9a-z]*$$,,;$(transform);G;s,\n,.,'`; \ + dir='$(DESTDIR)$(man7dir)'; $(am__uninstall_files_from_dir) +install-man8: $(man_MANS) @$(NORMAL_INSTALL) - test -z "$(man8dir)" || $(mkdir_p) "$(DESTDIR)$(man8dir)" - @list='$(man8_MANS) $(dist_man8_MANS) $(nodist_man8_MANS)'; \ - l2='$(man_MANS) $(dist_man_MANS) $(nodist_man_MANS)'; \ - for i in $$l2; do \ - case "$$i" in \ - *.8*) list="$$list $$i" ;; \ - esac; \ + @list1=''; \ + list2='$(man_MANS)'; \ + test -n "$(man8dir)" \ + && test -n "`echo $$list1$$list2`" \ + || exit 0; \ + echo " $(MKDIR_P) '$(DESTDIR)$(man8dir)'"; \ + $(MKDIR_P) "$(DESTDIR)$(man8dir)" || exit 1; \ + { for i in $$list1; do echo "$$i"; done; \ + if test -n "$$list2"; then \ + for i in $$list2; do echo "$$i"; done \ + | sed -n '/\.8[a-z]*$$/p'; \ + fi; \ + } | while read p; do \ + if test -f $$p; then d=; else d="$(srcdir)/"; fi; \ + echo "$$d$$p"; echo "$$p"; \ + done | \ + sed -e 'n;s,.*/,,;p;h;s,.*\.,,;s,^[^8][0-9a-z]*$$,8,;x' \ + -e 's,\.[0-9a-z]*$$,,;$(transform);G;s,\n,.,' | \ + sed 'N;N;s,\n, ,g' | { \ + list=; while read file base inst; do \ + if test "$$base" = "$$inst"; then list="$$list $$file"; else \ + echo " $(INSTALL_DATA) '$$file' '$(DESTDIR)$(man8dir)/$$inst'"; \ + $(INSTALL_DATA) "$$file" "$(DESTDIR)$(man8dir)/$$inst" || exit $$?; \ + fi; \ done; \ - for i in $$list; do \ - if test -f $(srcdir)/$$i; then file=$(srcdir)/$$i; \ - else file=$$i; fi; \ - ext=`echo $$i | sed -e 's/^.*\\.//'`; \ - case "$$ext" in \ - 8*) ;; \ - *) ext='8' ;; \ - esac; \ - inst=`echo $$i | sed -e 's/\\.[0-9a-z]*$$//'`; \ - inst=`echo $$inst | sed -e 's/^.*\///'`; \ - inst=`echo $$inst | sed '$(transform)'`.$$ext; \ - echo " $(INSTALL_DATA) '$$file' '$(DESTDIR)$(man8dir)/$$inst'"; \ - $(INSTALL_DATA) "$$file" "$(DESTDIR)$(man8dir)/$$inst"; \ - done + for i in $$list; do echo "$$i"; done | $(am__base_list) | \ + while read files; do \ + test -z "$$files" || { \ + echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(man8dir)'"; \ + $(INSTALL_DATA) $$files "$(DESTDIR)$(man8dir)" || exit $$?; }; \ + done; } + uninstall-man8: @$(NORMAL_UNINSTALL) - @list='$(man8_MANS) $(dist_man8_MANS) $(nodist_man8_MANS)'; \ - l2='$(man_MANS) $(dist_man_MANS) $(nodist_man_MANS)'; \ - for i in $$l2; do \ - case "$$i" in \ - *.8*) list="$$list $$i" ;; \ - esac; \ - done; \ - for i in $$list; do \ - ext=`echo $$i | sed -e 's/^.*\\.//'`; \ - case "$$ext" in \ - 8*) ;; \ - *) ext='8' ;; \ - esac; \ - inst=`echo $$i | sed -e 's/\\.[0-9a-z]*$$//'`; \ - inst=`echo $$inst | sed -e 's/^.*\///'`; \ - inst=`echo $$inst | sed '$(transform)'`.$$ext; \ - echo " rm -f '$(DESTDIR)$(man8dir)/$$inst'"; \ - rm -f "$(DESTDIR)$(man8dir)/$$inst"; \ - done + @list=''; test -n "$(man8dir)" || exit 0; \ + files=`{ for i in $$list; do echo "$$i"; done; \ + l2='$(man_MANS)'; for i in $$l2; do echo "$$i"; done | \ + sed -n '/\.8[a-z]*$$/p'; \ + } | sed -e 's,.*/,,;h;s,.*\.,,;s,^[^8][0-9a-z]*$$,8,;x' \ + -e 's,\.[0-9a-z]*$$,,;$(transform);G;s,\n,.,'`; \ + dir='$(DESTDIR)$(man8dir)'; $(am__uninstall_files_from_dir) install-dist_pkgdocDATA: $(dist_pkgdoc_DATA) @$(NORMAL_INSTALL) - test -z "$(pkgdocdir)" || $(mkdir_p) "$(DESTDIR)$(pkgdocdir)" - @list='$(dist_pkgdoc_DATA)'; for p in $$list; do \ + @list='$(dist_pkgdoc_DATA)'; test -n "$(pkgdocdir)" || list=; \ + if test -n "$$list"; then \ + echo " $(MKDIR_P) '$(DESTDIR)$(pkgdocdir)'"; \ + $(MKDIR_P) "$(DESTDIR)$(pkgdocdir)" || exit 1; \ + fi; \ + for p in $$list; do \ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ - f="`echo $$p | sed -e 's|^.*/||'`"; \ - echo " $(dist_pkgdocDATA_INSTALL) '$$d$$p' '$(DESTDIR)$(pkgdocdir)/$$f'"; \ - $(dist_pkgdocDATA_INSTALL) "$$d$$p" "$(DESTDIR)$(pkgdocdir)/$$f"; \ + echo "$$d$$p"; \ + done | $(am__base_list) | \ + while read files; do \ + echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(pkgdocdir)'"; \ + $(INSTALL_DATA) $$files "$(DESTDIR)$(pkgdocdir)" || exit $$?; \ done uninstall-dist_pkgdocDATA: @$(NORMAL_UNINSTALL) - @list='$(dist_pkgdoc_DATA)'; for p in $$list; do \ - f="`echo $$p | sed -e 's|^.*/||'`"; \ - echo " rm -f '$(DESTDIR)$(pkgdocdir)/$$f'"; \ - rm -f "$(DESTDIR)$(pkgdocdir)/$$f"; \ - done + @list='$(dist_pkgdoc_DATA)'; test -n "$(pkgdocdir)" || list=; \ + files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ + dir='$(DESTDIR)$(pkgdocdir)'; $(am__uninstall_files_from_dir) install-dist_pkgexDATA: $(dist_pkgex_DATA) @$(NORMAL_INSTALL) - test -z "$(pkgexdir)" || $(mkdir_p) "$(DESTDIR)$(pkgexdir)" - @list='$(dist_pkgex_DATA)'; for p in $$list; do \ + @list='$(dist_pkgex_DATA)'; test -n "$(pkgexdir)" || list=; \ + if test -n "$$list"; then \ + echo " $(MKDIR_P) '$(DESTDIR)$(pkgexdir)'"; \ + $(MKDIR_P) "$(DESTDIR)$(pkgexdir)" || exit 1; \ + fi; \ + for p in $$list; do \ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ - f="`echo $$p | sed -e 's|^.*/||'`"; \ - echo " $(dist_pkgexDATA_INSTALL) '$$d$$p' '$(DESTDIR)$(pkgexdir)/$$f'"; \ - $(dist_pkgexDATA_INSTALL) "$$d$$p" "$(DESTDIR)$(pkgexdir)/$$f"; \ + echo "$$d$$p"; \ + done | $(am__base_list) | \ + while read files; do \ + echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(pkgexdir)'"; \ + $(INSTALL_DATA) $$files "$(DESTDIR)$(pkgexdir)" || exit $$?; \ done uninstall-dist_pkgexDATA: @$(NORMAL_UNINSTALL) - @list='$(dist_pkgex_DATA)'; for p in $$list; do \ - f="`echo $$p | sed -e 's|^.*/||'`"; \ - echo " rm -f '$(DESTDIR)$(pkgexdir)/$$f'"; \ - rm -f "$(DESTDIR)$(pkgexdir)/$$f"; \ - done + @list='$(dist_pkgex_DATA)'; test -n "$(pkgexdir)" || list=; \ + files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ + dir='$(DESTDIR)$(pkgexdir)'; $(am__uninstall_files_from_dir) install-dist_sysconfDATA: $(dist_sysconf_DATA) @$(NORMAL_INSTALL) - test -z "$(sysconfdir)" || $(mkdir_p) "$(DESTDIR)$(sysconfdir)" - @list='$(dist_sysconf_DATA)'; for p in $$list; do \ + @list='$(dist_sysconf_DATA)'; test -n "$(sysconfdir)" || list=; \ + if test -n "$$list"; then \ + echo " $(MKDIR_P) '$(DESTDIR)$(sysconfdir)'"; \ + $(MKDIR_P) "$(DESTDIR)$(sysconfdir)" || exit 1; \ + fi; \ + for p in $$list; do \ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ - f="`echo $$p | sed -e 's|^.*/||'`"; \ - echo " $(dist_sysconfDATA_INSTALL) '$$d$$p' '$(DESTDIR)$(sysconfdir)/$$f'"; \ - $(dist_sysconfDATA_INSTALL) "$$d$$p" "$(DESTDIR)$(sysconfdir)/$$f"; \ + echo "$$d$$p"; \ + done | $(am__base_list) | \ + while read files; do \ + echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(sysconfdir)'"; \ + $(INSTALL_DATA) $$files "$(DESTDIR)$(sysconfdir)" || exit $$?; \ done uninstall-dist_sysconfDATA: @$(NORMAL_UNINSTALL) - @list='$(dist_sysconf_DATA)'; for p in $$list; do \ - f="`echo $$p | sed -e 's|^.*/||'`"; \ - echo " rm -f '$(DESTDIR)$(sysconfdir)/$$f'"; \ - rm -f "$(DESTDIR)$(sysconfdir)/$$f"; \ - done + @list='$(dist_sysconf_DATA)'; test -n "$(sysconfdir)" || list=; \ + files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ + dir='$(DESTDIR)$(sysconfdir)'; $(am__uninstall_files_from_dir) # This directory's subdirectories are mostly independent; you can cd -# into them and run `make' without going through this Makefile. -# To change the values of `make' variables: instead of editing Makefiles, -# (1) if the variable is set in `config.status', edit `config.status' -# (which will cause the Makefiles to be regenerated when you run `make'); -# (2) otherwise, pass the desired values on the `make' command line. -$(RECURSIVE_TARGETS): - @set fnord $$MAKEFLAGS; amf=$$2; \ +# into them and run 'make' without going through this Makefile. +# To change the values of 'make' variables: instead of editing Makefiles, +# (1) if the variable is set in 'config.status', edit 'config.status' +# (which will cause the Makefiles to be regenerated when you run 'make'); +# (2) otherwise, pass the desired values on the 'make' command line. +$(am__recursive_targets): + @fail=; \ + if $(am__make_keepgoing); then \ + failcom='fail=yes'; \ + else \ + failcom='exit 1'; \ + fi; \ dot_seen=no; \ target=`echo $@ | sed s/-recursive//`; \ - list='$(SUBDIRS)'; for subdir in $$list; do \ + case "$@" in \ + distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \ + *) list='$(SUBDIRS)' ;; \ + esac; \ + for subdir in $$list; do \ echo "Making $$target in $$subdir"; \ if test "$$subdir" = "."; then \ dot_seen=yes; \ @@ -609,60 +821,20 @@ else \ local_target="$$target"; \ fi; \ - (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ - || case "$$amf" in *=*) exit 1;; *k*) fail=yes;; *) exit 1;; esac; \ + ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ + || eval $$failcom; \ done; \ if test "$$dot_seen" = "no"; then \ $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \ fi; test -z "$$fail" -mostlyclean-recursive clean-recursive distclean-recursive \ -maintainer-clean-recursive: - @set fnord $$MAKEFLAGS; amf=$$2; \ - dot_seen=no; \ - case "$@" in \ - distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \ - *) list='$(SUBDIRS)' ;; \ - esac; \ - rev=''; for subdir in $$list; do \ - if test "$$subdir" = "."; then :; else \ - rev="$$subdir $$rev"; \ - fi; \ - done; \ - rev="$$rev ."; \ - target=`echo $@ | sed s/-recursive//`; \ - for subdir in $$rev; do \ - echo "Making $$target in $$subdir"; \ - if test "$$subdir" = "."; then \ - local_target="$$target-am"; \ - else \ - local_target="$$target"; \ - fi; \ - (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ - || case "$$amf" in *=*) exit 1;; *k*) fail=yes;; *) exit 1;; esac; \ - done && test -z "$$fail" -tags-recursive: - list='$(SUBDIRS)'; for subdir in $$list; do \ - test "$$subdir" = . || (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) tags); \ - done -ctags-recursive: - list='$(SUBDIRS)'; for subdir in $$list; do \ - test "$$subdir" = . || (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) ctags); \ - done +ID: $(am__tagged_files) + $(am__define_uniq_tagged_files); mkid -fID $$unique +tags: tags-recursive +TAGS: tags -ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) - list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ - unique=`for i in $$list; do \ - if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ - done | \ - $(AWK) ' { files[$$0] = 1; } \ - END { for (i in files) print i; }'`; \ - mkid -fID $$unique -tags: TAGS - -TAGS: tags-recursive $(HEADERS) $(SOURCES) config.h.in $(TAGS_DEPENDENCIES) \ - $(TAGS_FILES) $(LISP) - tags=; \ +tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) + set x; \ here=`pwd`; \ if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \ include_option=--etags-include; \ @@ -674,115 +846,161 @@ list='$(SUBDIRS)'; for subdir in $$list; do \ if test "$$subdir" = .; then :; else \ test ! -f $$subdir/TAGS || \ - tags="$$tags $$include_option=$$here/$$subdir/TAGS"; \ + set "$$@" "$$include_option=$$here/$$subdir/TAGS"; \ fi; \ done; \ - list='$(SOURCES) $(HEADERS) config.h.in $(LISP) $(TAGS_FILES)'; \ - unique=`for i in $$list; do \ - if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ - done | \ - $(AWK) ' { files[$$0] = 1; } \ - END { for (i in files) print i; }'`; \ - if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \ + $(am__define_uniq_tagged_files); \ + shift; \ + if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ - $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ - $$tags $$unique; \ + if test $$# -gt 0; then \ + $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ + "$$@" $$unique; \ + else \ + $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ + $$unique; \ + fi; \ fi -ctags: CTAGS -CTAGS: ctags-recursive $(HEADERS) $(SOURCES) config.h.in $(TAGS_DEPENDENCIES) \ - $(TAGS_FILES) $(LISP) - tags=; \ - here=`pwd`; \ - list='$(SOURCES) $(HEADERS) config.h.in $(LISP) $(TAGS_FILES)'; \ - unique=`for i in $$list; do \ - if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ - done | \ - $(AWK) ' { files[$$0] = 1; } \ - END { for (i in files) print i; }'`; \ - test -z "$(CTAGS_ARGS)$$tags$$unique" \ +ctags: ctags-recursive + +CTAGS: ctags +ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) + $(am__define_uniq_tagged_files); \ + test -z "$(CTAGS_ARGS)$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ - $$tags $$unique + $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ - && cd $(top_srcdir) \ - && gtags -i $(GTAGS_ARGS) $$here + && $(am__cd) $(top_srcdir) \ + && gtags -i $(GTAGS_ARGS) "$$here" +cscope: cscope.files + test ! -s cscope.files \ + || $(CSCOPE) -b -q $(AM_CSCOPEFLAGS) $(CSCOPEFLAGS) -i cscope.files $(CSCOPE_ARGS) +clean-cscope: + -rm -f cscope.files +cscope.files: clean-cscope cscopelist +cscopelist: cscopelist-recursive + +cscopelist-am: $(am__tagged_files) + list='$(am__tagged_files)'; \ + case "$(srcdir)" in \ + [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \ + *) sdir=$(subdir)/$(srcdir) ;; \ + esac; \ + for i in $$list; do \ + if test -f "$$i"; then \ + echo "$(subdir)/$$i"; \ + else \ + echo "$$sdir/$$i"; \ + fi; \ + done >> $(top_builddir)/cscope.files distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags + -rm -f cscope.out cscope.in.out cscope.po.out cscope.files distdir: $(DISTFILES) $(am__remove_distdir) - mkdir $(distdir) - $(mkdir_p) $(distdir)/. $(distdir)/doc $(distdir)/examples - @srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \ - topsrcdirstrip=`echo "$(top_srcdir)" | sed 's|.|.|g'`; \ - list='$(DISTFILES)'; for file in $$list; do \ - case $$file in \ - $(srcdir)/*) file=`echo "$$file" | sed "s|^$$srcdirstrip/||"`;; \ - $(top_srcdir)/*) file=`echo "$$file" | sed "s|^$$topsrcdirstrip/|$(top_builddir)/|"`;; \ - esac; \ + test -d "$(distdir)" || mkdir "$(distdir)" + @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + list='$(DISTFILES)'; \ + dist_files=`for file in $$list; do echo $$file; done | \ + sed -e "s|^$$srcdirstrip/||;t" \ + -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ + case $$dist_files in \ + */*) $(MKDIR_P) `echo "$$dist_files" | \ + sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ + sort -u` ;; \ + esac; \ + for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ - dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \ - if test "$$dir" != "$$file" && test "$$dir" != "."; then \ - dir="/$$dir"; \ - $(mkdir_p) "$(distdir)$$dir"; \ - else \ - dir=''; \ - fi; \ if test -d $$d/$$file; then \ + dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ + if test -d "$(distdir)/$$file"; then \ + find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ + fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ - cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \ + cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ + find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ - cp -pR $$d/$$file $(distdir)$$dir || exit 1; \ + cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ - test -f $(distdir)/$$file \ - || cp -p $$d/$$file $(distdir)/$$file \ + test -f "$(distdir)/$$file" \ + || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done - list='$(SUBDIRS)'; for subdir in $$list; do \ + @list='$(DIST_SUBDIRS)'; for subdir in $$list; do \ if test "$$subdir" = .; then :; else \ - test -d "$(distdir)/$$subdir" \ - || mkdir "$(distdir)/$$subdir" \ - || exit 1; \ - (cd $$subdir && \ + $(am__make_dryrun) \ + || test -d "$(distdir)/$$subdir" \ + || $(MKDIR_P) "$(distdir)/$$subdir" \ + || exit 1; \ + dir1=$$subdir; dir2="$(distdir)/$$subdir"; \ + $(am__relativize); \ + new_distdir=$$reldir; \ + dir1=$$subdir; dir2="$(top_distdir)"; \ + $(am__relativize); \ + new_top_distdir=$$reldir; \ + echo " (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) top_distdir="$$new_top_distdir" distdir="$$new_distdir" \\"; \ + echo " am__remove_distdir=: am__skip_length_check=: am__skip_mode_fix=: distdir)"; \ + ($(am__cd) $$subdir && \ $(MAKE) $(AM_MAKEFLAGS) \ - top_distdir="../$(top_distdir)" \ - distdir="../$(distdir)/$$subdir" \ + top_distdir="$$new_top_distdir" \ + distdir="$$new_distdir" \ + am__remove_distdir=: \ + am__skip_length_check=: \ + am__skip_mode_fix=: \ distdir) \ || exit 1; \ fi; \ done - -find $(distdir) -type d ! -perm -777 -exec chmod a+rwx {} \; -o \ + -test -n "$(am__skip_mode_fix)" \ + || find "$(distdir)" -type d ! -perm -755 \ + -exec chmod u+rwx,go+rx {} \; -o \ ! -type d ! -perm -444 -links 1 -exec chmod a+r {} \; -o \ ! -type d ! -perm -400 -exec chmod a+r {} \; -o \ - ! -type d ! -perm -444 -exec $(SHELL) $(install_sh) -c -m a+r {} {} \; \ - || chmod -R a+r $(distdir) + ! -type d ! -perm -444 -exec $(install_sh) -c -m a+r {} {} \; \ + || chmod -R a+r "$(distdir)" dist-gzip: distdir - $(AMTAR) chof - $(distdir) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).tar.gz - $(am__remove_distdir) + tardir=$(distdir) && $(am__tar) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).tar.gz + $(am__post_remove_distdir) dist-bzip2: distdir - $(AMTAR) chof - $(distdir) | bzip2 -9 -c >$(distdir).tar.bz2 - $(am__remove_distdir) + tardir=$(distdir) && $(am__tar) | BZIP2=$${BZIP2--9} bzip2 -c >$(distdir).tar.bz2 + $(am__post_remove_distdir) + +dist-lzip: distdir + tardir=$(distdir) && $(am__tar) | lzip -c $${LZIP_OPT--9} >$(distdir).tar.lz + $(am__post_remove_distdir) + +dist-xz: distdir + tardir=$(distdir) && $(am__tar) | XZ_OPT=$${XZ_OPT--e} xz -c >$(distdir).tar.xz + $(am__post_remove_distdir) dist-tarZ: distdir - $(AMTAR) chof - $(distdir) | compress -c >$(distdir).tar.Z - $(am__remove_distdir) + @echo WARNING: "Support for distribution archives compressed with" \ + "legacy program 'compress' is deprecated." >&2 + @echo WARNING: "It will be removed altogether in Automake 2.0" >&2 + tardir=$(distdir) && $(am__tar) | compress -c >$(distdir).tar.Z + $(am__post_remove_distdir) dist-shar: distdir + @echo WARNING: "Support for shar distribution archives is" \ + "deprecated." >&2 + @echo WARNING: "It will be removed altogether in Automake 2.0" >&2 shar $(distdir) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).shar.gz - $(am__remove_distdir) + $(am__post_remove_distdir) dist-zip: distdir -rm -f $(distdir).zip zip -rq $(distdir).zip $(distdir) - $(am__remove_distdir) + $(am__post_remove_distdir) -dist dist-all: distdir - $(AMTAR) chof - $(distdir) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).tar.gz - $(AMTAR) chof - $(distdir) | bzip2 -9 -c >$(distdir).tar.bz2 - $(am__remove_distdir) +dist dist-all: + $(MAKE) $(AM_MAKEFLAGS) $(DIST_TARGETS) am__post_remove_distdir='@:' + $(am__post_remove_distdir) # This target untars the dist file and tries a VPATH configuration. Then # it guarantees that the distribution is self-contained by making another @@ -790,25 +1008,33 @@ distcheck: dist case '$(DIST_ARCHIVES)' in \ *.tar.gz*) \ - GZIP=$(GZIP_ENV) gunzip -c $(distdir).tar.gz | $(AMTAR) xf - ;;\ + GZIP=$(GZIP_ENV) gzip -dc $(distdir).tar.gz | $(am__untar) ;;\ *.tar.bz2*) \ - bunzip2 -c $(distdir).tar.bz2 | $(AMTAR) xf - ;;\ + bzip2 -dc $(distdir).tar.bz2 | $(am__untar) ;;\ + *.tar.lz*) \ + lzip -dc $(distdir).tar.lz | $(am__untar) ;;\ + *.tar.xz*) \ + xz -dc $(distdir).tar.xz | $(am__untar) ;;\ *.tar.Z*) \ - uncompress -c $(distdir).tar.Z | $(AMTAR) xf - ;;\ + uncompress -c $(distdir).tar.Z | $(am__untar) ;;\ *.shar.gz*) \ - GZIP=$(GZIP_ENV) gunzip -c $(distdir).shar.gz | unshar ;;\ + GZIP=$(GZIP_ENV) gzip -dc $(distdir).shar.gz | unshar ;;\ *.zip*) \ unzip $(distdir).zip ;;\ esac - chmod -R a-w $(distdir); chmod a+w $(distdir) - mkdir $(distdir)/_build - mkdir $(distdir)/_inst + chmod -R a-w $(distdir) + chmod u+w $(distdir) + mkdir $(distdir)/_build $(distdir)/_build/sub $(distdir)/_inst chmod a-w $(distdir) + test -d $(distdir)/_build || exit 0; \ dc_install_base=`$(am__cd) $(distdir)/_inst && pwd | sed -e 's,^[^:\\/]:[\\/],/,'` \ && dc_destdir="$${TMPDIR-/tmp}/am-dc-$$$$/" \ - && cd $(distdir)/_build \ - && ../configure --srcdir=.. --prefix="$$dc_install_base" \ + && am__cwd=`pwd` \ + && $(am__cd) $(distdir)/_build/sub \ + && ../../configure \ + $(AM_DISTCHECK_CONFIGURE_FLAGS) \ $(DISTCHECK_CONFIGURE_FLAGS) \ + --srcdir=../.. --prefix="$$dc_install_base" \ && $(MAKE) $(AM_MAKEFLAGS) \ && $(MAKE) $(AM_MAKEFLAGS) dvi \ && $(MAKE) $(AM_MAKEFLAGS) check \ @@ -828,14 +1054,24 @@ && rm -rf "$$dc_destdir" \ && $(MAKE) $(AM_MAKEFLAGS) dist \ && rm -rf $(DIST_ARCHIVES) \ - && $(MAKE) $(AM_MAKEFLAGS) distcleancheck - $(am__remove_distdir) + && $(MAKE) $(AM_MAKEFLAGS) distcleancheck \ + && cd "$$am__cwd" \ + || exit 1 + $(am__post_remove_distdir) @(echo "$(distdir) archives ready for distribution: "; \ list='$(DIST_ARCHIVES)'; for i in $$list; do echo $$i; done) | \ - sed -e '1{h;s/./=/g;p;x;}' -e '$${p;x;}' + sed -e 1h -e 1s/./=/g -e 1p -e 1x -e '$$p' -e '$$x' distuninstallcheck: - @cd $(distuninstallcheck_dir) \ - && test `$(distuninstallcheck_listfiles) | wc -l` -le 1 \ + @test -n '$(distuninstallcheck_dir)' || { \ + echo 'ERROR: trying to run $@ with an empty' \ + '$$(distuninstallcheck_dir)' >&2; \ + exit 1; \ + }; \ + $(am__cd) '$(distuninstallcheck_dir)' || { \ + echo 'ERROR: cannot chdir into $(distuninstallcheck_dir)' >&2; \ + exit 1; \ + }; \ + test `$(am__distuninstallcheck_listfiles) | wc -l` -eq 0 \ || { echo "ERROR: files left after uninstall:" ; \ if test -n "$(DESTDIR)"; then \ echo " (check DESTDIR support)"; \ @@ -857,7 +1093,7 @@ installdirs: installdirs-recursive installdirs-am: for dir in "$(DESTDIR)$(sbindir)" "$(DESTDIR)$(sbindir)" "$(DESTDIR)$(man5dir)" "$(DESTDIR)$(man7dir)" "$(DESTDIR)$(man8dir)" "$(DESTDIR)$(pkgdocdir)" "$(DESTDIR)$(pkgexdir)" "$(DESTDIR)$(sysconfdir)"; do \ - test -z "$$dir" || $(mkdir_p) "$$dir"; \ + test -z "$$dir" || $(MKDIR_P) "$$dir"; \ done install: install-recursive install-exec: install-exec-recursive @@ -869,23 +1105,29 @@ installcheck: installcheck-recursive install-strip: - $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ - install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ - `test -z '$(STRIP)' || \ - echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install + if test -z '$(STRIP)'; then \ + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + install; \ + else \ + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ + fi mostlyclean-generic: clean-generic: distclean-generic: - -rm -f $(CONFIG_CLEAN_FILES) + -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) + -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." - -rm -f scanner.c - -rm -f parser.h -rm -f parser.c + -rm -f parser.h + -rm -f scanner.c clean: clean-recursive clean-am: clean-generic clean-sbinPROGRAMS mostlyclean-am @@ -903,6 +1145,8 @@ html: html-recursive +html-am: + info: info-recursive info-am: @@ -910,13 +1154,31 @@ install-data-am: install-dist_pkgdocDATA install-dist_pkgexDATA \ install-man +install-dvi: install-dvi-recursive + +install-dvi-am: + install-exec-am: install-dist_sysconfDATA install-sbinPROGRAMS \ install-sbinSCRIPTS +install-html: install-html-recursive + +install-html-am: + install-info: install-info-recursive +install-info-am: + install-man: install-man5 install-man7 install-man8 +install-pdf: install-pdf-recursive + +install-pdf-am: + +install-ps: install-ps-recursive + +install-ps-am: + installcheck-am: maintainer-clean: maintainer-clean-recursive @@ -939,34 +1201,38 @@ ps-am: uninstall-am: uninstall-dist_pkgdocDATA uninstall-dist_pkgexDATA \ - uninstall-dist_sysconfDATA uninstall-info-am uninstall-man \ + uninstall-dist_sysconfDATA uninstall-man \ uninstall-sbinPROGRAMS uninstall-sbinSCRIPTS -uninstall-info: uninstall-info-recursive - uninstall-man: uninstall-man5 uninstall-man7 uninstall-man8 -.PHONY: $(RECURSIVE_TARGETS) CTAGS GTAGS all all-am am--refresh check \ - check-am clean clean-generic clean-recursive \ - clean-sbinPROGRAMS ctags ctags-recursive dist dist-all \ - dist-bzip2 dist-gzip dist-shar dist-tarZ dist-zip distcheck \ - distclean distclean-compile distclean-generic distclean-hdr \ - distclean-recursive distclean-tags distcleancheck distdir \ - distuninstallcheck dvi dvi-am html html-am info info-am \ - install install-am install-data install-data-am \ +.MAKE: $(am__recursive_targets) all install-am install-strip + +.PHONY: $(am__recursive_targets) CTAGS GTAGS TAGS all all-am \ + am--refresh check check-am clean clean-cscope clean-generic \ + clean-sbinPROGRAMS cscope cscopelist-am ctags ctags-am dist \ + dist-all dist-bzip2 dist-gzip dist-lzip dist-shar dist-tarZ \ + dist-xz dist-zip distcheck distclean distclean-compile \ + distclean-generic distclean-hdr distclean-tags distcleancheck \ + distdir distuninstallcheck dvi dvi-am html html-am info \ + info-am install install-am install-data install-data-am \ install-dist_pkgdocDATA install-dist_pkgexDATA \ - install-dist_sysconfDATA install-exec install-exec-am \ + install-dist_sysconfDATA install-dvi install-dvi-am \ + install-exec install-exec-am install-html install-html-am \ install-info install-info-am install-man install-man5 \ - install-man7 install-man8 install-sbinPROGRAMS \ + install-man7 install-man8 install-pdf install-pdf-am \ + install-ps install-ps-am install-sbinPROGRAMS \ install-sbinSCRIPTS install-strip installcheck installcheck-am \ installdirs installdirs-am maintainer-clean \ - maintainer-clean-generic maintainer-clean-recursive \ - mostlyclean mostlyclean-compile mostlyclean-generic \ - mostlyclean-recursive pdf pdf-am ps ps-am tags tags-recursive \ - uninstall uninstall-am uninstall-dist_pkgdocDATA \ + maintainer-clean-generic mostlyclean mostlyclean-compile \ + mostlyclean-generic pdf pdf-am ps ps-am tags tags-am uninstall \ + uninstall-am uninstall-dist_pkgdocDATA \ uninstall-dist_pkgexDATA uninstall-dist_sysconfDATA \ - uninstall-info-am uninstall-man uninstall-man5 uninstall-man7 \ - uninstall-man8 uninstall-sbinPROGRAMS uninstall-sbinSCRIPTS + uninstall-man uninstall-man5 uninstall-man7 uninstall-man8 \ + uninstall-sbinPROGRAMS uninstall-sbinSCRIPTS + +.PRECIOUS: Makefile + # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. diff -Nru filtergen-0.12.4/missing filtergen-0.12.7/missing --- filtergen-0.12.4/missing 2004-06-23 00:28:09.000000000 +0000 +++ filtergen-0.12.7/missing 2016-02-13 08:06:27.000000000 +0000 @@ -1,11 +1,10 @@ #! /bin/sh -# Common stub for a few missing GNU programs while installing. +# Common wrapper for a few potentially missing GNU programs. -scriptversion=2003-09-02.23 +scriptversion=2013-10-28.13; # UTC -# Copyright (C) 1996, 1997, 1999, 2000, 2002, 2003 -# Free Software Foundation, Inc. -# Originally by Fran,cois Pinard , 1996. +# Copyright (C) 1996-2014 Free Software Foundation, Inc. +# Originally written by Fran,cois Pinard , 1996. # 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 @@ -18,9 +17,7 @@ # 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., 59 Temple Place - Suite 330, Boston, MA -# 02111-1307, USA. +# along with this program. If not, see . # As a special exception to the GNU General Public License, if you # distribute this file as part of a program that contains a @@ -28,333 +25,191 @@ # the same distribution terms that you use for the rest of that program. if test $# -eq 0; then - echo 1>&2 "Try \`$0 --help' for more information" + echo 1>&2 "Try '$0 --help' for more information" exit 1 fi -run=: +case $1 in -# In the cases where this matters, `missing' is being run in the -# srcdir already. -if test -f configure.ac; then - configure_ac=configure.ac -else - configure_ac=configure.in -fi - -msg="missing on your system" - -case "$1" in ---run) - # Try to run requested program, and just exit if it succeeds. - run= - shift - "$@" && exit 0 - # Exit code 63 means version mismatch. This often happens - # when the user try to use an ancient version of a tool on - # a file that requires a minimum version. In this case we - # we should proceed has if the program had been absent, or - # if --run hadn't been passed. - if test $? = 63; then - run=: - msg="probably too old" - fi - ;; -esac + --is-lightweight) + # Used by our autoconf macros to check whether the available missing + # script is modern enough. + exit 0 + ;; -# If it does not exist, or fails to run (possibly an outdated version), -# try to emulate it. -case "$1" in + --run) + # Back-compat with the calling convention used by older automake. + shift + ;; -h|--h|--he|--hel|--help) echo "\ $0 [OPTION]... PROGRAM [ARGUMENT]... -Handle \`PROGRAM [ARGUMENT]...' for when PROGRAM is missing, or return an -error status if there is no known handling for PROGRAM. +Run 'PROGRAM [ARGUMENT]...', returning a proper advice when this fails due +to PROGRAM being missing or too old. Options: -h, --help display this help and exit -v, --version output version information and exit - --run try to run the given command, and emulate it if it fails Supported PROGRAM values: - aclocal touch file \`aclocal.m4' - autoconf touch file \`configure' - autoheader touch file \`config.h.in' - automake touch all \`Makefile.in' files - bison create \`y.tab.[ch]', if possible, from existing .[ch] - flex create \`lex.yy.c', if possible, from existing .c - help2man touch the output file - lex create \`lex.yy.c', if possible, from existing .c - makeinfo touch the output file - tar try tar, gnutar, gtar, then tar without non-portable flags - yacc create \`y.tab.[ch]', if possible, from existing .[ch] + aclocal autoconf autoheader autom4te automake makeinfo + bison yacc flex lex help2man + +Version suffixes to PROGRAM as well as the prefixes 'gnu-', 'gnu', and +'g' are ignored when checking the name. Send bug reports to ." + exit $? ;; -v|--v|--ve|--ver|--vers|--versi|--versio|--version) echo "missing $scriptversion (GNU Automake)" + exit $? ;; -*) - echo 1>&2 "$0: Unknown \`$1' option" - echo 1>&2 "Try \`$0 --help' for more information" + echo 1>&2 "$0: unknown '$1' option" + echo 1>&2 "Try '$0 --help' for more information" exit 1 ;; - aclocal*) - if test -z "$run" && ($1 --version) > /dev/null 2>&1; then - # We have it, but it failed. - exit 1 - fi - - echo 1>&2 "\ -WARNING: \`$1' is $msg. You should only need it if - you modified \`acinclude.m4' or \`${configure_ac}'. You might want - to install the \`Automake' and \`Perl' packages. Grab them from - any GNU archive site." - touch aclocal.m4 - ;; - - autoconf) - if test -z "$run" && ($1 --version) > /dev/null 2>&1; then - # We have it, but it failed. - exit 1 - fi - - echo 1>&2 "\ -WARNING: \`$1' is $msg. You should only need it if - you modified \`${configure_ac}'. You might want to install the - \`Autoconf' and \`GNU m4' packages. Grab them from any GNU - archive site." - touch configure - ;; - - autoheader) - if test -z "$run" && ($1 --version) > /dev/null 2>&1; then - # We have it, but it failed. - exit 1 - fi - - echo 1>&2 "\ -WARNING: \`$1' is $msg. You should only need it if - you modified \`acconfig.h' or \`${configure_ac}'. You might want - to install the \`Autoconf' and \`GNU m4' packages. Grab them - from any GNU archive site." - files=`sed -n 's/^[ ]*A[CM]_CONFIG_HEADER(\([^)]*\)).*/\1/p' ${configure_ac}` - test -z "$files" && files="config.h" - touch_files= - for f in $files; do - case "$f" in - *:*) touch_files="$touch_files "`echo "$f" | - sed -e 's/^[^:]*://' -e 's/:.*//'`;; - *) touch_files="$touch_files $f.in";; - esac - done - touch $touch_files - ;; - - automake*) - if test -z "$run" && ($1 --version) > /dev/null 2>&1; then - # We have it, but it failed. - exit 1 - fi - - echo 1>&2 "\ -WARNING: \`$1' is $msg. You should only need it if - you modified \`Makefile.am', \`acinclude.m4' or \`${configure_ac}'. - You might want to install the \`Automake' and \`Perl' packages. - Grab them from any GNU archive site." - find . -type f -name Makefile.am -print | - sed 's/\.am$/.in/' | - while read f; do touch "$f"; done - ;; - - autom4te) - if test -z "$run" && ($1 --version) > /dev/null 2>&1; then - # We have it, but it failed. - exit 1 - fi - - echo 1>&2 "\ -WARNING: \`$1' is needed, but is $msg. - You might have modified some files without having the - proper tools for further handling them. - You can get \`$1' as part of \`Autoconf' from any GNU - archive site." - - file=`echo "$*" | sed -n 's/.*--output[ =]*\([^ ]*\).*/\1/p'` - test -z "$file" && file=`echo "$*" | sed -n 's/.*-o[ ]*\([^ ]*\).*/\1/p'` - if test -f "$file"; then - touch $file - else - test -z "$file" || exec >$file - echo "#! /bin/sh" - echo "# Created by GNU Automake missing as a replacement of" - echo "# $ $@" - echo "exit 0" - chmod +x $file - exit 1 - fi - ;; - - bison|yacc) - echo 1>&2 "\ -WARNING: \`$1' $msg. You should only need it if - you modified a \`.y' file. You may need the \`Bison' package - in order for those modifications to take effect. You can get - \`Bison' from any GNU archive site." - rm -f y.tab.c y.tab.h - if [ $# -ne 1 ]; then - eval LASTARG="\${$#}" - case "$LASTARG" in - *.y) - SRCFILE=`echo "$LASTARG" | sed 's/y$/c/'` - if [ -f "$SRCFILE" ]; then - cp "$SRCFILE" y.tab.c - fi - SRCFILE=`echo "$LASTARG" | sed 's/y$/h/'` - if [ -f "$SRCFILE" ]; then - cp "$SRCFILE" y.tab.h - fi - ;; - esac - fi - if [ ! -f y.tab.h ]; then - echo >y.tab.h - fi - if [ ! -f y.tab.c ]; then - echo 'main() { return 0; }' >y.tab.c - fi - ;; - - lex|flex) - echo 1>&2 "\ -WARNING: \`$1' is $msg. You should only need it if - you modified a \`.l' file. You may need the \`Flex' package - in order for those modifications to take effect. You can get - \`Flex' from any GNU archive site." - rm -f lex.yy.c - if [ $# -ne 1 ]; then - eval LASTARG="\${$#}" - case "$LASTARG" in - *.l) - SRCFILE=`echo "$LASTARG" | sed 's/l$/c/'` - if [ -f "$SRCFILE" ]; then - cp "$SRCFILE" lex.yy.c - fi - ;; - esac - fi - if [ ! -f lex.yy.c ]; then - echo 'main() { return 0; }' >lex.yy.c - fi - ;; +esac - help2man) - if test -z "$run" && ($1 --version) > /dev/null 2>&1; then - # We have it, but it failed. - exit 1 - fi - - echo 1>&2 "\ -WARNING: \`$1' is $msg. You should only need it if - you modified a dependency of a manual page. You may need the - \`Help2man' package in order for those modifications to take - effect. You can get \`Help2man' from any GNU archive site." - - file=`echo "$*" | sed -n 's/.*-o \([^ ]*\).*/\1/p'` - if test -z "$file"; then - file=`echo "$*" | sed -n 's/.*--output=\([^ ]*\).*/\1/p'` - fi - if [ -f "$file" ]; then - touch $file - else - test -z "$file" || exec >$file - echo ".ab help2man is required to generate this page" - exit 1 - fi - ;; +# Run the given program, remember its exit status. +"$@"; st=$? - makeinfo) - if test -z "$run" && (makeinfo --version) > /dev/null 2>&1; then - # We have makeinfo, but it failed. - exit 1 - fi - - echo 1>&2 "\ -WARNING: \`$1' is $msg. You should only need it if - you modified a \`.texi' or \`.texinfo' file, or any other file - indirectly affecting the aspect of the manual. The spurious - call might also be the consequence of using a buggy \`make' (AIX, - DU, IRIX). You might want to install the \`Texinfo' package or - the \`GNU make' package. Grab either from any GNU archive site." - file=`echo "$*" | sed -n 's/.*-o \([^ ]*\).*/\1/p'` - if test -z "$file"; then - file=`echo "$*" | sed 's/.* \([^ ]*\) *$/\1/'` - file=`sed -n '/^@setfilename/ { s/.* \([^ ]*\) *$/\1/; p; q; }' $file` - fi - touch $file - ;; +# If it succeeded, we are done. +test $st -eq 0 && exit 0 - tar) - shift - if test -n "$run"; then - echo 1>&2 "ERROR: \`tar' requires --run" - exit 1 - fi - - # We have already tried tar in the generic part. - # Look for gnutar/gtar before invocation to avoid ugly error - # messages. - if (gnutar --version > /dev/null 2>&1); then - gnutar "$@" && exit 0 - fi - if (gtar --version > /dev/null 2>&1); then - gtar "$@" && exit 0 - fi - firstarg="$1" - if shift; then - case "$firstarg" in - *o*) - firstarg=`echo "$firstarg" | sed s/o//` - tar "$firstarg" "$@" && exit 0 - ;; - esac - case "$firstarg" in - *h*) - firstarg=`echo "$firstarg" | sed s/h//` - tar "$firstarg" "$@" && exit 0 - ;; - esac - fi - - echo 1>&2 "\ -WARNING: I can't seem to be able to run \`tar' with the given arguments. - You may want to install GNU tar or Free paxutils, or check the - command line arguments." - exit 1 - ;; - - *) - echo 1>&2 "\ -WARNING: \`$1' is needed, and is $msg. - You might have modified some files without having the - proper tools for further handling them. Check the \`README' file, - it often tells you about the needed prerequisites for installing - this package. You may also peek at any GNU archive site, in case - some other package would contain this missing \`$1' program." - exit 1 - ;; -esac +# Also exit now if we it failed (or wasn't found), and '--version' was +# passed; such an option is passed most likely to detect whether the +# program is present and works. +case $2 in --version|--help) exit $st;; esac + +# Exit code 63 means version mismatch. This often happens when the user +# tries to use an ancient version of a tool on a file that requires a +# minimum version. +if test $st -eq 63; then + msg="probably too old" +elif test $st -eq 127; then + # Program was missing. + msg="missing on your system" +else + # Program was found and executed, but failed. Give up. + exit $st +fi -exit 0 +perl_URL=http://www.perl.org/ +flex_URL=http://flex.sourceforge.net/ +gnu_software_URL=http://www.gnu.org/software + +program_details () +{ + case $1 in + aclocal|automake) + echo "The '$1' program is part of the GNU Automake package:" + echo "<$gnu_software_URL/automake>" + echo "It also requires GNU Autoconf, GNU m4 and Perl in order to run:" + echo "<$gnu_software_URL/autoconf>" + echo "<$gnu_software_URL/m4/>" + echo "<$perl_URL>" + ;; + autoconf|autom4te|autoheader) + echo "The '$1' program is part of the GNU Autoconf package:" + echo "<$gnu_software_URL/autoconf/>" + echo "It also requires GNU m4 and Perl in order to run:" + echo "<$gnu_software_URL/m4/>" + echo "<$perl_URL>" + ;; + esac +} + +give_advice () +{ + # Normalize program name to check for. + normalized_program=`echo "$1" | sed ' + s/^gnu-//; t + s/^gnu//; t + s/^g//; t'` + + printf '%s\n' "'$1' is $msg." + + configure_deps="'configure.ac' or m4 files included by 'configure.ac'" + case $normalized_program in + autoconf*) + echo "You should only need it if you modified 'configure.ac'," + echo "or m4 files included by it." + program_details 'autoconf' + ;; + autoheader*) + echo "You should only need it if you modified 'acconfig.h' or" + echo "$configure_deps." + program_details 'autoheader' + ;; + automake*) + echo "You should only need it if you modified 'Makefile.am' or" + echo "$configure_deps." + program_details 'automake' + ;; + aclocal*) + echo "You should only need it if you modified 'acinclude.m4' or" + echo "$configure_deps." + program_details 'aclocal' + ;; + autom4te*) + echo "You might have modified some maintainer files that require" + echo "the 'autom4te' program to be rebuilt." + program_details 'autom4te' + ;; + bison*|yacc*) + echo "You should only need it if you modified a '.y' file." + echo "You may want to install the GNU Bison package:" + echo "<$gnu_software_URL/bison/>" + ;; + lex*|flex*) + echo "You should only need it if you modified a '.l' file." + echo "You may want to install the Fast Lexical Analyzer package:" + echo "<$flex_URL>" + ;; + help2man*) + echo "You should only need it if you modified a dependency" \ + "of a man page." + echo "You may want to install the GNU Help2man package:" + echo "<$gnu_software_URL/help2man/>" + ;; + makeinfo*) + echo "You should only need it if you modified a '.texi' file, or" + echo "any other file indirectly affecting the aspect of the manual." + echo "You might want to install the Texinfo package:" + echo "<$gnu_software_URL/texinfo/>" + echo "The spurious makeinfo call might also be the consequence of" + echo "using a buggy 'make' (AIX, DU, IRIX), in which case you might" + echo "want to install GNU make:" + echo "<$gnu_software_URL/make/>" + ;; + *) + echo "You might have modified some files without having the proper" + echo "tools for further handling them. Check the 'README' file, it" + echo "often tells you about the needed prerequisites for installing" + echo "this package. You may also peek at any GNU archive site, in" + echo "case some other package contains this missing '$1' program." + ;; + esac +} + +give_advice "$1" | sed -e '1s/^/WARNING: /' \ + -e '2,$s/^/ /' >&2 + +# Propagate the correct exit status (expected to be 127 for a program +# not found, 63 for a program that failed due to version mismatch). +exit $st # Local variables: # eval: (add-hook 'write-file-hooks 'time-stamp) # time-stamp-start: "scriptversion=" # time-stamp-format: "%:y-%02m-%02d.%02H" -# time-stamp-end: "$" +# time-stamp-time-zone: "UTC" +# time-stamp-end: "; # UTC" # End: diff -Nru filtergen-0.12.4/parser.c filtergen-0.12.7/parser.c --- filtergen-0.12.4/parser.c 2016-02-18 07:59:36.000000000 +0000 +++ filtergen-0.12.7/parser.c 2016-02-13 09:49:42.000000000 +0000 @@ -1,12 +1,13 @@ -/* A Bison parser, made by GNU Bison 2.0. */ +/* A Bison parser, made by GNU Bison 3.0.4. */ -/* Skeleton parser for Yacc-like parsing with Bison, - Copyright (C) 1984, 1989, 1990, 2000, 2001, 2002, 2003, 2004 Free Software Foundation, Inc. +/* Bison implementation for Yacc-like parsers in C - This program is free software; you can redistribute it and/or modify + Copyright (C) 1984, 1989-1990, 2000-2015 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. + the Free Software Foundation, either version 3 of the License, 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 @@ -14,17 +15,23 @@ 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., 59 Temple Place - Suite 330, - Boston, MA 02111-1307, USA. */ - -/* As a special exception, when this file is copied by Bison into a - Bison output file, you may use that output file without restriction. - This special exception was added by the Free Software Foundation - in version 1.24 of Bison. */ + along with this program. If not, see . */ + +/* As a special exception, you may create a larger work that contains + part or all of the Bison parser skeleton and distribute that work + under terms of your choice, so long as that work isn't itself a + parser generator using the skeleton or a modified version thereof + as a parser skeleton. Alternatively, if you modify or redistribute + the parser skeleton itself, you may (at your option) remove this + special exception, which will cause the skeleton and the resulting + Bison output files to be licensed under the GNU General Public + License without this special exception. + + This special exception was added by the Free Software Foundation in + version 2.2 of Bison. */ -/* Written by Richard Stallman by simplifying the original so called - ``semantic'' parser. */ +/* C LALR(1) parser skeleton written by Richard Stallman, by + simplifying the original so-called "semantic" parser. */ /* All symbols defined below should begin with yy or YY, to avoid infringing on user name space. This should be done even for local @@ -36,55 +43,102 @@ /* Identify Bison output. */ #define YYBISON 1 +/* Bison version. */ +#define YYBISON_VERSION "3.0.4" + /* Skeleton name. */ #define YYSKELETON_NAME "yacc.c" /* Pure parsers. */ #define YYPURE 0 -/* Using locations. */ -#define YYLSP_NEEDED 0 +/* Push parsers. */ +#define YYPUSH 0 +/* Pull parsers. */ +#define YYPULL 1 +/* Copy the first part of user declarations. */ +#line 20 "parser.y" /* yacc.c:339 */ -/* Tokens. */ +#include +#include +#include +#include "ast.h" + +void yyerror(void *parse_arg, const char *s); +extern int yylex(void); + +#define YYPRINT(f, t, v) yyprint(f, t, v) + +#line 78 "parser.c" /* yacc.c:339 */ + +#ifndef YY_NULLPTR +#if defined __cplusplus && 201103L <= __cplusplus +#define YY_NULLPTR nullptr +#else +#define YY_NULLPTR 0 +#endif +#endif + +/* Enabling verbose error messages. */ +#ifdef YYERROR_VERBOSE +#undef YYERROR_VERBOSE +#define YYERROR_VERBOSE 1 +#else +#define YYERROR_VERBOSE 0 +#endif + +/* In a future release of Bison, this section will be replaced + by #include "y.tab.h". */ +#ifndef YY_YY_PARSER_H_INCLUDED +#define YY_YY_PARSER_H_INCLUDED +/* Debug traces. */ +#ifndef YYDEBUG +#define YYDEBUG 1 +#endif +#if YYDEBUG +extern int yydebug; +#endif + +/* Token type. */ #ifndef YYTOKENTYPE -# define YYTOKENTYPE - /* Put the tokens into the symbol table, so that GDB and other debuggers - know about them. */ - enum yytokentype { - TOK_ACCEPT = 258, - TOK_DEST = 259, - TOK_DPORT = 260, - TOK_DROP = 261, - TOK_FORWARD = 262, - TOK_ICMPTYPE = 263, - TOK_INPUT = 264, - TOK_LCURLY = 265, - TOK_LOCAL = 266, - TOK_LOG = 267, - TOK_LSQUARE = 268, - TOK_MASQ = 269, - TOK_ONEWAY = 270, - TOK_OUTPUT = 271, - TOK_PROTO = 272, - TOK_PROXY = 273, - TOK_RCURLY = 274, - TOK_REDIRECT = 275, - TOK_REJECT = 276, - TOK_RSQUARE = 277, - TOK_SEMICOLON = 278, - TOK_SOURCE = 279, - TOK_SPORT = 280, - TOK_TEXT = 281, - TOK_IDENTIFIER = 282, - TOK_DOT = 283, - TOK_SLASH = 284, - TOK_ERR = 285, - TOK_BANG = 286, - TOK_COLON = 287 - }; +#define YYTOKENTYPE +enum yytokentype { + TOK_ACCEPT = 258, + TOK_DEST = 259, + TOK_DPORT = 260, + TOK_DROP = 261, + TOK_FORWARD = 262, + TOK_ICMPTYPE = 263, + TOK_INPUT = 264, + TOK_LCURLY = 265, + TOK_LOCAL = 266, + TOK_LOG = 267, + TOK_LSQUARE = 268, + TOK_MASQ = 269, + TOK_ONEWAY = 270, + TOK_OUTPUT = 271, + TOK_PROTO = 272, + TOK_PROXY = 273, + TOK_RCURLY = 274, + TOK_REDIRECT = 275, + TOK_REJECT = 276, + TOK_RSQUARE = 277, + TOK_SEMICOLON = 278, + TOK_SOURCE = 279, + TOK_SPORT = 280, + TOK_TEXT = 281, + TOK_IDENTIFIER = 282, + TOK_DOT = 283, + TOK_SLASH = 284, + TOK_ERR = 285, + TOK_BANG = 286, + TOK_COLON = 287, + TOK_STAR = 288 +}; #endif +/* Tokens. */ #define TOK_ACCEPT 258 #define TOK_DEST 259 #define TOK_DPORT 260 @@ -115,1904 +169,1968 @@ #define TOK_ERR 285 #define TOK_BANG 286 #define TOK_COLON 287 +#define TOK_STAR 288 +/* Value type. */ +#if !defined YYSTYPE && !defined YYSTYPE_IS_DECLARED +union YYSTYPE { +#line 34 "parser.y" /* yacc.c:355 */ + struct rule_list_s *u_rule_list; + struct rule_s *u_rule; + struct specifier_list_s *u_specifier_list; + struct negated_specifier_s *u_negated_specifier; + struct specifier_s *u_specifier; + struct direction_specifier_s *u_direction_specifier; + struct direction_argument_list_s *u_direction_argument_list; + struct direction_argument_s *u_direction_argument; + struct target_specifier_s *u_target_specifier; + struct log_target_specifier_s *u_log_target_specifier; + struct host_specifier_s *u_host_specifier; + struct host_argument_list_s *u_host_argument_list; + struct host_argument_s *u_host_argument; + struct port_specifier_s *u_port_specifier; + struct port_argument_list_s *u_port_argument_list; + struct port_argument_s *u_port_argument; + struct protocol_specifier_s *u_protocol_specifier; + struct protocol_argument_list_s *u_protocol_argument_list; + struct protocol_argument_s *u_protocol_argument; + struct icmptype_specifier_s *u_icmptype_specifier; + struct icmptype_argument_list_s *u_icmptype_argument_list; + struct icmptype_argument_s *u_icmptype_argument; + struct option_specifier_s *u_option_specifier; + struct compound_specifier_s *u_compound_specifier; + struct chaingroup_specifier_s *u_chaingroup_specifier; + struct subrule_list_s *u_subrule_list; + char *u_str; -/* Copy the first part of user declarations. */ -#line 20 "parser.y" +#line 214 "parser.c" /* yacc.c:355 */ +}; -#include -#include -#include -#include "ast.h" +typedef union YYSTYPE YYSTYPE; +#define YYSTYPE_IS_TRIVIAL 1 +#define YYSTYPE_IS_DECLARED 1 +#endif -#define YYPARSE_PARAM parm +extern YYSTYPE yylval; -void yyerror(const char * s); -extern int yylex(void); +int yyparse(void *parse_arg); -#define YYPRINT(f, t, v) yyprint(f, t, v) +#endif /* !YY_YY_PARSER_H_INCLUDED */ +/* Copy the second part of user declarations. */ +#line 126 "parser.y" /* yacc.c:358 */ -/* Enabling traces. */ -#ifndef YYDEBUG -# define YYDEBUG 1 +int yyprint(FILE *f, int t, YYSTYPE v); + +#line 234 "parser.c" /* yacc.c:358 */ + +#ifdef short +#undef short #endif -/* Enabling verbose error messages. */ -#ifdef YYERROR_VERBOSE -# undef YYERROR_VERBOSE -# define YYERROR_VERBOSE 1 +#ifdef YYTYPE_UINT8 +typedef YYTYPE_UINT8 yytype_uint8; #else -# define YYERROR_VERBOSE 0 +typedef unsigned char yytype_uint8; #endif -#if ! defined (YYSTYPE) && ! defined (YYSTYPE_IS_DECLARED) -#line 35 "parser.y" -typedef union YYSTYPE { - struct rule_list_s * u_rule_list; - struct rule_s * u_rule; - struct specifier_list_s * u_specifier_list; - struct negated_specifier_s * u_negated_specifier; - struct specifier_s * u_specifier; - struct direction_specifier_s * u_direction_specifier; - struct direction_argument_list_s * u_direction_argument_list; - struct direction_argument_s * u_direction_argument; - struct target_specifier_s * u_target_specifier; - struct log_target_specifier_s * u_log_target_specifier; - struct host_specifier_s * u_host_specifier; - struct host_argument_list_s * u_host_argument_list; - struct host_argument_s * u_host_argument; - struct port_specifier_s * u_port_specifier; - struct port_argument_list_s * u_port_argument_list; - struct port_argument_s * u_port_argument; - struct protocol_specifier_s * u_protocol_specifier; - struct protocol_argument_list_s * u_protocol_argument_list; - struct protocol_argument_s * u_protocol_argument; - struct icmptype_specifier_s * u_icmptype_specifier; - struct icmptype_argument_list_s * u_icmptype_argument_list; - struct icmptype_argument_s * u_icmptype_argument; - struct option_specifier_s * u_option_specifier; - struct compound_specifier_s * u_compound_specifier; - struct chaingroup_specifier_s * u_chaingroup_specifier; - struct subrule_list_s * u_subrule_list; - char * u_str; -} YYSTYPE; -/* Line 190 of yacc.c. */ -#line 184 "parser.c" -# define yystype YYSTYPE /* obsolescent; will be withdrawn */ -# define YYSTYPE_IS_DECLARED 1 -# define YYSTYPE_IS_TRIVIAL 1 +#ifdef YYTYPE_INT8 +typedef YYTYPE_INT8 yytype_int8; +#else +typedef signed char yytype_int8; #endif +#ifdef YYTYPE_UINT16 +typedef YYTYPE_UINT16 yytype_uint16; +#else +typedef unsigned short int yytype_uint16; +#endif +#ifdef YYTYPE_INT16 +typedef YYTYPE_INT16 yytype_int16; +#else +typedef short int yytype_int16; +#endif -/* Copy the second part of user declarations. */ -#line 126 "parser.y" +#ifndef YYSIZE_T +#ifdef __SIZE_TYPE__ +#define YYSIZE_T __SIZE_TYPE__ +#elif defined size_t +#define YYSIZE_T size_t +#elif !defined YYSIZE_T +#include /* INFRINGES ON USER NAME SPACE */ +#define YYSIZE_T size_t +#else +#define YYSIZE_T unsigned int +#endif +#endif -int yyprint(FILE * f, int t, YYSTYPE v); +#define YYSIZE_MAXIMUM ((YYSIZE_T)-1) +#ifndef YY_ +#if defined YYENABLE_NLS && YYENABLE_NLS +#if ENABLE_NLS +#include /* INFRINGES ON USER NAME SPACE */ +#define YY_(Msgid) dgettext("bison-runtime", Msgid) +#endif +#endif +#ifndef YY_ +#define YY_(Msgid) Msgid +#endif +#endif -/* Line 213 of yacc.c. */ -#line 199 "parser.c" +#ifndef YY_ATTRIBUTE +#if (defined __GNUC__ && \ + (2 < __GNUC__ || (__GNUC__ == 2 && 96 <= __GNUC_MINOR__))) || \ + defined __SUNPRO_C && 0x5110 <= __SUNPRO_C +#define YY_ATTRIBUTE(Spec) __attribute__(Spec) +#else +#define YY_ATTRIBUTE(Spec) /* empty */ +#endif +#endif -#if ! defined (yyoverflow) || YYERROR_VERBOSE +#ifndef YY_ATTRIBUTE_PURE +#define YY_ATTRIBUTE_PURE YY_ATTRIBUTE((__pure__)) +#endif -# ifndef YYFREE -# define YYFREE free -# endif -# ifndef YYMALLOC -# define YYMALLOC malloc -# endif +#ifndef YY_ATTRIBUTE_UNUSED +#define YY_ATTRIBUTE_UNUSED YY_ATTRIBUTE((__unused__)) +#endif + +#if !defined _Noreturn && \ + (!defined __STDC_VERSION__ || __STDC_VERSION__ < 201112) +#if defined _MSC_VER && 1200 <= _MSC_VER +#define _Noreturn __declspec(noreturn) +#else +#define _Noreturn YY_ATTRIBUTE((__noreturn__)) +#endif +#endif + +/* Suppress unused-variable warnings by "using" E. */ +#if !defined lint || defined __GNUC__ +#define YYUSE(E) ((void)(E)) +#else +#define YYUSE(E) /* empty */ +#endif + +#if defined __GNUC__ && 407 <= __GNUC__ * 100 + __GNUC_MINOR__ +/* Suppress an incorrect diagnostic about yylval being uninitialized. */ +#define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN \ + _Pragma("GCC diagnostic push") \ + _Pragma("GCC diagnostic ignored \"-Wuninitialized\"") \ + _Pragma("GCC diagnostic ignored \"-Wmaybe-uninitialized\"") +#define YY_IGNORE_MAYBE_UNINITIALIZED_END _Pragma("GCC diagnostic pop") +#else +#define YY_INITIAL_VALUE(Value) Value +#endif +#ifndef YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN +#define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN +#define YY_IGNORE_MAYBE_UNINITIALIZED_END +#endif +#ifndef YY_INITIAL_VALUE +#define YY_INITIAL_VALUE(Value) /* Nothing. */ +#endif + +#if !defined yyoverflow || YYERROR_VERBOSE /* The parser invokes alloca or malloc; define the necessary symbols. */ -# ifdef YYSTACK_USE_ALLOCA -# if YYSTACK_USE_ALLOCA -# ifdef __GNUC__ -# define YYSTACK_ALLOC __builtin_alloca -# else -# define YYSTACK_ALLOC alloca -# endif -# endif -# endif - -# ifdef YYSTACK_ALLOC - /* Pacify GCC's `empty if-body' warning. */ -# define YYSTACK_FREE(Ptr) do { /* empty */; } while (0) -# else -# if defined (__STDC__) || defined (__cplusplus) -# include /* INFRINGES ON USER NAME SPACE */ -# define YYSIZE_T size_t -# endif -# define YYSTACK_ALLOC YYMALLOC -# define YYSTACK_FREE YYFREE -# endif -#endif /* ! defined (yyoverflow) || YYERROR_VERBOSE */ - - -#if (! defined (yyoverflow) \ - && (! defined (__cplusplus) \ - || (defined (YYSTYPE_IS_TRIVIAL) && YYSTYPE_IS_TRIVIAL))) +#ifdef YYSTACK_USE_ALLOCA +#if YYSTACK_USE_ALLOCA +#ifdef __GNUC__ +#define YYSTACK_ALLOC __builtin_alloca +#elif defined __BUILTIN_VA_ARG_INCR +#include /* INFRINGES ON USER NAME SPACE */ +#elif defined _AIX +#define YYSTACK_ALLOC __alloca +#elif defined _MSC_VER +#include /* INFRINGES ON USER NAME SPACE */ +#define alloca _alloca +#else +#define YYSTACK_ALLOC alloca +#if !defined _ALLOCA_H && !defined EXIT_SUCCESS +#include /* INFRINGES ON USER NAME SPACE */ +/* Use EXIT_SUCCESS as a witness for stdlib.h. */ +#ifndef EXIT_SUCCESS +#define EXIT_SUCCESS 0 +#endif +#endif +#endif +#endif +#endif + +#ifdef YYSTACK_ALLOC +/* Pacify GCC's 'empty if-body' warning. */ +#define YYSTACK_FREE(Ptr) \ + do {/* empty */ \ + ; \ + } while (0) +#ifndef YYSTACK_ALLOC_MAXIMUM +/* The OS might guarantee only one guard page at the bottom of the stack, + and a page size can be as small as 4096 bytes. So we cannot safely + invoke alloca (N) if N exceeds 4096. Use a slightly smaller number + to allow for a few compiler-allocated temporary stack slots. */ +#define YYSTACK_ALLOC_MAXIMUM 4032 /* reasonable circa 2006 */ +#endif +#else +#define YYSTACK_ALLOC YYMALLOC +#define YYSTACK_FREE YYFREE +#ifndef YYSTACK_ALLOC_MAXIMUM +#define YYSTACK_ALLOC_MAXIMUM YYSIZE_MAXIMUM +#endif +#if (defined __cplusplus && !defined EXIT_SUCCESS && \ + !((defined YYMALLOC || defined malloc) && \ + (defined YYFREE || defined free))) +#include /* INFRINGES ON USER NAME SPACE */ +#ifndef EXIT_SUCCESS +#define EXIT_SUCCESS 0 +#endif +#endif +#ifndef YYMALLOC +#define YYMALLOC malloc +#if !defined malloc && !defined EXIT_SUCCESS +void *malloc(YYSIZE_T); /* INFRINGES ON USER NAME SPACE */ +#endif +#endif +#ifndef YYFREE +#define YYFREE free +#if !defined free && !defined EXIT_SUCCESS +void free(void *); /* INFRINGES ON USER NAME SPACE */ +#endif +#endif +#endif +#endif /* ! defined yyoverflow || YYERROR_VERBOSE */ + +#if (!defined yyoverflow && \ + (!defined __cplusplus || \ + (defined YYSTYPE_IS_TRIVIAL && YYSTYPE_IS_TRIVIAL))) /* A type that is properly aligned for any stack member. */ -union yyalloc -{ - short int yyss; - YYSTYPE yyvs; - }; +union yyalloc { + yytype_int16 yyss_alloc; + YYSTYPE yyvs_alloc; +}; /* The size of the maximum gap between one aligned stack and the next. */ -# define YYSTACK_GAP_MAXIMUM (sizeof (union yyalloc) - 1) +#define YYSTACK_GAP_MAXIMUM (sizeof(union yyalloc) - 1) /* The size of an array large to enough to hold all stacks, each with N elements. */ -# define YYSTACK_BYTES(N) \ - ((N) * (sizeof (short int) + sizeof (YYSTYPE)) \ - + YYSTACK_GAP_MAXIMUM) +#define YYSTACK_BYTES(N) \ + ((N) * (sizeof(yytype_int16) + sizeof(YYSTYPE)) + YYSTACK_GAP_MAXIMUM) -/* Copy COUNT objects from FROM to TO. The source and destination do - not overlap. */ -# ifndef YYCOPY -# if defined (__GNUC__) && 1 < __GNUC__ -# define YYCOPY(To, From, Count) \ - __builtin_memcpy (To, From, (Count) * sizeof (*(From))) -# else -# define YYCOPY(To, From, Count) \ - do \ - { \ - register YYSIZE_T yyi; \ - for (yyi = 0; yyi < (Count); yyi++) \ - (To)[yyi] = (From)[yyi]; \ - } \ - while (0) -# endif -# endif +#define YYCOPY_NEEDED 1 /* Relocate STACK from its old location to the new one. The local variables YYSIZE and YYSTACKSIZE give the old and new number of elements in the stack, and YYPTR gives the new location of the stack. Advance YYPTR to a properly aligned location for the next stack. */ -# define YYSTACK_RELOCATE(Stack) \ - do \ - { \ - YYSIZE_T yynewbytes; \ - YYCOPY (&yyptr->Stack, Stack, yysize); \ - Stack = &yyptr->Stack; \ - yynewbytes = yystacksize * sizeof (*Stack) + YYSTACK_GAP_MAXIMUM; \ - yyptr += yynewbytes / sizeof (*yyptr); \ - } \ - while (0) +#define YYSTACK_RELOCATE(Stack_alloc, Stack) \ + do { \ + YYSIZE_T yynewbytes; \ + YYCOPY(&yyptr->Stack_alloc, Stack, yysize); \ + Stack = &yyptr->Stack_alloc; \ + yynewbytes = yystacksize * sizeof(*Stack) + YYSTACK_GAP_MAXIMUM; \ + yyptr += yynewbytes / sizeof(*yyptr); \ + } while (0) #endif -#if defined (__STDC__) || defined (__cplusplus) - typedef signed char yysigned_char; +#if defined YYCOPY_NEEDED && YYCOPY_NEEDED +/* Copy COUNT objects from SRC to DST. The source and destination do + not overlap. */ +#ifndef YYCOPY +#if defined __GNUC__ && 1 < __GNUC__ +#define YYCOPY(Dst, Src, Count) \ + __builtin_memcpy(Dst, Src, (Count) * sizeof(*(Src))) #else - typedef short int yysigned_char; +#define YYCOPY(Dst, Src, Count) \ + do { \ + YYSIZE_T yyi; \ + for (yyi = 0; yyi < (Count); yyi++) \ + (Dst)[yyi] = (Src)[yyi]; \ + } while (0) +#endif #endif +#endif /* !YYCOPY_NEEDED */ -/* YYFINAL -- State number of the termination state. */ -#define YYFINAL 3 +/* YYFINAL -- State number of the termination state. */ +#define YYFINAL 3 /* YYLAST -- Last index in YYTABLE. */ -#define YYLAST 112 +#define YYLAST 113 -/* YYNTOKENS -- Number of terminals. */ -#define YYNTOKENS 33 -/* YYNNTS -- Number of nonterminals. */ -#define YYNNTS 32 -/* YYNRULES -- Number of rules. */ -#define YYNRULES 69 -/* YYNRULES -- Number of states. */ -#define YYNSTATES 95 - -/* YYTRANSLATE(YYLEX) -- Bison symbol number corresponding to YYLEX. */ -#define YYUNDEFTOK 2 -#define YYMAXUTOK 287 - -#define YYTRANSLATE(YYX) \ - ((unsigned int) (YYX) <= YYMAXUTOK ? yytranslate[YYX] : YYUNDEFTOK) - -/* YYTRANSLATE[YYLEX] -- Bison symbol number corresponding to YYLEX. */ -static const unsigned char yytranslate[] = -{ - 0, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 1, 2, 3, 4, - 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, - 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, - 25, 26, 27, 28, 29, 30, 31, 32 -}; +/* YYNTOKENS -- Number of terminals. */ +#define YYNTOKENS 34 +/* YYNNTS -- Number of nonterminals. */ +#define YYNNTS 32 +/* YYNRULES -- Number of rules. */ +#define YYNRULES 70 +/* YYNSTATES -- Number of states. */ +#define YYNSTATES 96 + +/* YYTRANSLATE[YYX] -- Symbol number corresponding to YYX as returned + by yylex, with out-of-bounds checking. */ +#define YYUNDEFTOK 2 +#define YYMAXUTOK 288 + +#define YYTRANSLATE(YYX) \ + ((unsigned int)(YYX) <= YYMAXUTOK ? yytranslate[YYX] : YYUNDEFTOK) + +/* YYTRANSLATE[TOKEN-NUM] -- Symbol number corresponding to TOKEN-NUM + as returned by yylex, without out-of-bounds checking. */ +static const yytype_uint8 yytranslate[] = { + 0, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, + 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, + 30, 31, 32, 33}; #if YYDEBUG -/* YYPRHS[YYN] -- Index of the first RHS symbol of rule number YYN in - YYRHS. */ -static const unsigned char yyprhs[] = -{ - 0, 0, 3, 5, 6, 9, 12, 13, 16, 18, - 21, 23, 25, 27, 29, 31, 33, 35, 37, 39, - 42, 45, 47, 51, 52, 55, 57, 59, 61, 63, - 65, 67, 69, 72, 75, 77, 81, 82, 85, 89, - 91, 94, 97, 99, 103, 105, 108, 112, 114, 117, - 119, 123, 124, 127, 129, 132, 134, 138, 139, 142, - 144, 146, 148, 150, 154, 156, 160, 162, 166, 171 -}; - -/* YYRHS -- A `-1'-separated list of the rules' RHS. */ -static const yysigned_char yyrhs[] = -{ - 34, 0, -1, 35, -1, -1, 35, 36, -1, 37, - 23, -1, -1, 37, 38, -1, 39, -1, 31, 39, - -1, 62, -1, 40, -1, 44, -1, 45, -1, 49, - -1, 53, -1, 57, -1, 61, -1, 64, -1, 9, - 41, -1, 16, 41, -1, 42, -1, 10, 42, 19, - -1, -1, 42, 43, -1, 27, -1, 3, -1, 21, - -1, 6, -1, 14, -1, 18, -1, 20, -1, 24, - 46, -1, 4, 46, -1, 47, -1, 10, 47, 19, - -1, -1, 47, 48, -1, 27, 29, 27, -1, 27, - -1, 25, 50, -1, 5, 50, -1, 51, -1, 10, - 50, 19, -1, 52, -1, 51, 52, -1, 27, 32, - 27, -1, 27, -1, 17, 54, -1, 55, -1, 10, - 55, 19, -1, -1, 55, 56, -1, 27, -1, 8, - 58, -1, 59, -1, 10, 59, 19, -1, -1, 59, - 60, -1, 27, -1, 11, -1, 7, -1, 15, -1, - 12, 26, 27, -1, 12, -1, 10, 63, 19, -1, - 37, -1, 63, 23, 37, -1, 13, 27, 63, 22, - -1, 13, 63, 22, -1 -}; - -/* YYRLINE[YYN] -- source line where rule number YYN was defined. */ -static const unsigned short int yyrline[] = -{ - 0, 131, 131, 139, 142, 150, 158, 161, 169, 175, - 183, 189, 195, 201, 207, 213, 219, 225, 231, 239, - 245, 253, 257, 264, 267, 275, 282, 287, 292, 297, - 302, 307, 314, 320, 328, 332, 339, 342, 350, 356, - 364, 370, 378, 382, 387, 393, 401, 407, 415, 422, - 426, 433, 436, 444, 451, 458, 462, 469, 472, 480, - 487, 493, 499, 505, 511, 519, 526, 532, 540, 546 -}; +/* YYRLINE[YYN] -- Source line where rule number YYN was defined. */ +static const yytype_uint16 yyrline[] = { + 0, 131, 131, 139, 142, 150, 158, 161, 169, 175, 183, 189, 195, 201, 207, + 213, 219, 225, 231, 239, 245, 253, 257, 261, 271, 274, 282, 289, 294, 299, + 304, 309, 314, 321, 327, 335, 339, 346, 349, 357, 363, 371, 377, 385, 389, + 394, 400, 408, 414, 422, 429, 433, 440, 443, 451, 458, 465, 469, 476, 479, + 487, 494, 500, 506, 512, 518, 526, 533, 539, 547, 553}; +#endif + +#if YYDEBUG || YYERROR_VERBOSE || 0 +/* YYTNAME[SYMBOL-NUM] -- String name of the symbol SYMBOL-NUM. + First, the terminals, then, starting at YYNTOKENS, nonterminals. */ +static const char *const yytname[] = { + "$end", "error", "$undefined", "TOK_ACCEPT", "TOK_DEST", "TOK_DPORT", + "TOK_DROP", "TOK_FORWARD", "TOK_ICMPTYPE", "TOK_INPUT", "TOK_LCURLY", + "TOK_LOCAL", "TOK_LOG", "TOK_LSQUARE", "TOK_MASQ", "TOK_ONEWAY", + "TOK_OUTPUT", "TOK_PROTO", "TOK_PROXY", "TOK_RCURLY", "TOK_REDIRECT", + "TOK_REJECT", "TOK_RSQUARE", "TOK_SEMICOLON", "TOK_SOURCE", "TOK_SPORT", + "TOK_TEXT", "TOK_IDENTIFIER", "TOK_DOT", "TOK_SLASH", "TOK_ERR", "TOK_BANG", + "TOK_COLON", "TOK_STAR", "$accept", "ast", "rule_list", "rule", + "specifier_list", "negated_specifier", "specifier", "direction_specifier", + "direction_argument_list", "direction_argument_list_", "direction_argument", + "target_specifier", "host_specifier", "host_argument_list", + "host_argument_list_", "host_argument", "port_specifier", + "port_argument_list", "port_argument_list_", "port_argument", + "protocol_specifier", "protocol_argument_list", "protocol_argument_list_", + "protocol_argument", "icmptype_specifier", "icmptype_argument_list", + "icmptype_argument_list_", "icmptype_argument", "option_specifier", + "compound_specifier", "subrule_list", "chaingroup_specifier", YY_NULLPTR}; +#endif + +#ifdef YYPRINT +/* YYTOKNUM[NUM] -- (External) token number corresponding to the + (internal) symbol number NUM (which must be that of a token). */ +static const yytype_uint16 yytoknum[] = { + 0, 256, 257, 258, 259, 260, 261, 262, 263, 264, 265, 266, + 267, 268, 269, 270, 271, 272, 273, 274, 275, 276, 277, 278, + 279, 280, 281, 282, 283, 284, 285, 286, 287, 288}; #endif -#if YYDEBUG || YYERROR_VERBOSE -/* YYTNME[SYMBOL-NUM] -- String name of the symbol SYMBOL-NUM. - First, the terminals, then, starting at YYNTOKENS, nonterminals. */ -static const char *const yytname[] = -{ - "$end", "error", "$undefined", "TOK_ACCEPT", "TOK_DEST", "TOK_DPORT", - "TOK_DROP", "TOK_FORWARD", "TOK_ICMPTYPE", "TOK_INPUT", "TOK_LCURLY", - "TOK_LOCAL", "TOK_LOG", "TOK_LSQUARE", "TOK_MASQ", "TOK_ONEWAY", - "TOK_OUTPUT", "TOK_PROTO", "TOK_PROXY", "TOK_RCURLY", "TOK_REDIRECT", - "TOK_REJECT", "TOK_RSQUARE", "TOK_SEMICOLON", "TOK_SOURCE", "TOK_SPORT", - "TOK_TEXT", "TOK_IDENTIFIER", "TOK_DOT", "TOK_SLASH", "TOK_ERR", - "TOK_BANG", "TOK_COLON", "$accept", "ast", "rule_list", "rule", - "specifier_list", "negated_specifier", "specifier", - "direction_specifier", "direction_argument_list", - "direction_argument_list_", "direction_argument", "target_specifier", - "host_specifier", "host_argument_list", "host_argument_list_", - "host_argument", "port_specifier", "port_argument_list", - "port_argument_list_", "port_argument", "protocol_specifier", - "protocol_argument_list", "protocol_argument_list_", "protocol_argument", - "icmptype_specifier", "icmptype_argument_list", - "icmptype_argument_list_", "icmptype_argument", "option_specifier", - "compound_specifier", "subrule_list", "chaingroup_specifier", 0 -}; -#endif - -# ifdef YYPRINT -/* YYTOKNUM[YYLEX-NUM] -- Internal token number corresponding to - token YYLEX-NUM. */ -static const unsigned short int yytoknum[] = -{ - 0, 256, 257, 258, 259, 260, 261, 262, 263, 264, - 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, - 275, 276, 277, 278, 279, 280, 281, 282, 283, 284, - 285, 286, 287 -}; -# endif - -/* YYR1[YYN] -- Symbol number of symbol that rule YYN derives. */ -static const unsigned char yyr1[] = -{ - 0, 33, 34, 35, 35, 36, 37, 37, 38, 38, - 39, 39, 39, 39, 39, 39, 39, 39, 39, 40, - 40, 41, 41, 42, 42, 43, 44, 44, 44, 44, - 44, 44, 45, 45, 46, 46, 47, 47, 48, 48, - 49, 49, 50, 50, 51, 51, 52, 52, 53, 54, - 54, 55, 55, 56, 57, 58, 58, 59, 59, 60, - 61, 61, 61, 61, 61, 62, 63, 63, 64, 64 -}; +#define YYPACT_NINF -16 -/* YYR2[YYN] -- Number of symbols composing right hand side of rule YYN. */ -static const unsigned char yyr2[] = -{ - 0, 2, 1, 0, 2, 2, 0, 2, 1, 2, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, - 2, 1, 3, 0, 2, 1, 1, 1, 1, 1, - 1, 1, 2, 2, 1, 3, 0, 2, 3, 1, - 2, 2, 1, 3, 1, 2, 3, 1, 2, 1, - 3, 0, 2, 1, 2, 1, 3, 0, 2, 1, - 1, 1, 1, 3, 1, 3, 1, 3, 4, 3 -}; +#define yypact_value_is_default(Yystate) (!!((Yystate) == (-16))) -/* YYDEFACT[STATE-NAME] -- Default rule to reduce with in state - STATE-NUM when YYTABLE doesn't specify something else to do. Zero - means the default is an error. */ -static const unsigned char yydefact[] = -{ - 3, 0, 6, 1, 4, 0, 26, 36, 0, 28, - 61, 57, 23, 6, 60, 64, 6, 29, 62, 23, - 51, 30, 31, 27, 5, 36, 0, 0, 7, 8, - 11, 12, 13, 14, 15, 16, 17, 10, 18, 36, - 33, 34, 0, 47, 41, 42, 44, 57, 54, 55, - 23, 19, 21, 66, 0, 0, 6, 0, 20, 51, - 48, 49, 32, 40, 9, 0, 39, 37, 0, 0, - 45, 0, 59, 58, 0, 25, 24, 65, 6, 63, - 0, 69, 0, 53, 52, 35, 0, 43, 46, 56, - 22, 67, 68, 50, 38 -}; +#define YYTABLE_NINF -3 -/* YYDEFGOTO[NTERM-NUM]. */ -static const yysigned_char yydefgoto[] = -{ - -1, 1, 2, 4, 53, 28, 29, 30, 51, 52, - 76, 31, 32, 40, 41, 67, 33, 44, 45, 46, - 34, 60, 61, 84, 35, 48, 49, 73, 36, 37, - 54, 38 -}; +#define yytable_value_is_error(Yytable_value) 0 /* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing STATE-NUM. */ -#define YYPACT_NINF -16 -static const yysigned_char yypact[] = -{ - -16, 27, 29, -16, -16, -1, -16, 22, 8, -16, - -16, 28, 30, -16, -16, 32, 35, -16, -16, 30, - 61, -16, -16, -16, -16, 22, 8, 74, -16, -16, - -16, -16, -16, -16, -16, -16, -16, -16, -16, -16, - -16, 45, 8, 41, -16, 47, -16, -16, -16, 48, - -16, -16, 66, 39, 42, 69, -16, 44, -16, -16, - -16, 70, -16, -16, -16, 6, 71, -16, 82, 75, - -16, 7, -16, -16, 9, -16, -16, -16, -16, -16, - 46, -16, 12, -16, -16, -16, 76, -16, -16, -16, - -16, 39, -16, -16, -16 -}; - -/* YYPGOTO[NTERM-NUM]. */ -static const yysigned_char yypgoto[] = -{ - -16, -16, -16, -16, -2, -16, 77, -16, 86, 56, - -16, -16, -16, 83, 68, -16, -16, -5, -16, 64, - -16, -16, 51, -16, -16, -16, 65, -16, -16, -16, - -15, -16 -}; +static const yytype_int8 yypact[] = { + -16, 27, 32, -16, -16, -1, -16, 52, 11, -16, -16, 53, 8, -16, + -16, 42, 43, -16, -16, 8, 59, -16, -16, -16, -16, 52, 11, 75, + -16, -16, -16, -16, -16, -16, -16, -16, -16, -16, -16, -16, -16, 45, + 11, 41, -16, 47, -16, -16, -16, 49, -16, -16, -16, 67, 40, 12, + 70, -16, 17, -16, -16, -16, 71, -16, -16, -16, 6, 72, -16, 83, + 76, -16, 7, -16, -16, 9, -16, -16, -16, -16, -16, 44, -16, 10, + -16, -16, -16, 77, -16, -16, -16, -16, 40, -16, -16, -16}; -/* YYTABLE[YYPACT[STATE-NUM]]. What to do in state STATE-NUM. If - positive, shift that token. If negative, reduce the rule which - number is the opposite. If zero, do what YYDEFACT says. - If YYTABLE_NINF, syntax error. */ -#define YYTABLE_NINF -3 -static const yysigned_char yytable[] = -{ - 5, 57, 6, 7, 8, 9, 10, 11, 12, 13, - 14, 15, 16, 17, 18, 19, 20, 21, 42, 22, - 23, 63, 24, 25, 26, 85, 89, 3, 90, -2, - 27, 93, 39, 66, 72, 43, 75, 68, 47, 83, - 50, 80, 6, 7, 8, 9, 10, 11, 12, 13, - 14, 15, 16, 17, 18, 19, 20, 21, 55, 22, - 23, 77, 56, 25, 26, 78, 81, 78, 92, 78, - 27, 59, 66, 69, 43, 72, 91, 6, 7, 8, - 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, - 19, 20, 21, 75, 22, 23, 79, 83, 25, 26, - 86, 87, 88, 94, 64, 58, 74, 65, 62, 70, - 82, 0, 71 -}; +/* YYDEFACT[STATE-NUM] -- Default reduction number in state STATE-NUM. + Performed when YYTABLE does not specify something else to do. Zero + means the default is an error. */ +static const yytype_uint8 yydefact[] = { + 3, 0, 6, 1, 4, 0, 27, 37, 0, 29, 62, 58, 24, 6, 61, 65, + 6, 30, 63, 24, 52, 31, 32, 28, 5, 37, 0, 0, 7, 8, 11, 12, + 13, 14, 15, 16, 17, 10, 18, 37, 34, 35, 0, 48, 42, 43, 45, 58, + 55, 56, 24, 23, 19, 21, 67, 0, 0, 6, 0, 20, 52, 49, 50, 33, + 41, 9, 0, 40, 38, 0, 0, 46, 0, 60, 59, 0, 26, 25, 66, 6, + 64, 0, 70, 0, 54, 53, 36, 0, 44, 47, 57, 22, 68, 69, 51, 39}; -static const yysigned_char yycheck[] = -{ - 2, 16, 3, 4, 5, 6, 7, 8, 9, 10, - 11, 12, 13, 14, 15, 16, 17, 18, 10, 20, - 21, 26, 23, 24, 25, 19, 19, 0, 19, 0, - 31, 19, 10, 27, 27, 27, 27, 42, 10, 27, - 10, 56, 3, 4, 5, 6, 7, 8, 9, 10, - 11, 12, 13, 14, 15, 16, 17, 18, 26, 20, - 21, 19, 27, 24, 25, 23, 22, 23, 22, 23, - 31, 10, 27, 32, 27, 27, 78, 3, 4, 5, - 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, - 16, 17, 18, 27, 20, 21, 27, 27, 24, 25, - 29, 19, 27, 27, 27, 19, 50, 39, 25, 45, - 59, -1, 47 -}; +/* YYPGOTO[NTERM-NUM]. */ +static const yytype_int8 yypgoto[] = {-16, -16, -16, -16, -2, -16, 78, -16, + 87, 57, -16, -16, -16, 84, 69, -16, + -16, 33, -16, 65, -16, -16, 51, -16, + -16, -16, 66, -16, -16, -16, -15, -16}; + +/* YYDEFGOTO[NTERM-NUM]. */ +static const yytype_int8 yydefgoto[] = { + -1, 1, 2, 4, 54, 28, 29, 30, 52, 53, 77, 31, 32, 40, 41, 68, + 33, 44, 45, 46, 34, 61, 62, 85, 35, 48, 49, 74, 36, 37, 55, 38}; + +/* YYTABLE[YYPACT[STATE-NUM]] -- What to do in state STATE-NUM. If + positive, shift that token. If negative, reduce the rule whose + number is the opposite. If YYTABLE_NINF, syntax error. */ +static const yytype_int8 yytable[] = { + 5, 58, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 50, + 22, 23, 42, 24, 25, 26, 86, 90, 3, 91, 94, 27, 78, -2, 67, 73, 79, 76, 84, + 43, 82, 79, 51, 81, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, + 20, 21, 64, 22, 23, 39, 47, 25, 26, 93, 79, 56, 60, 57, 27, 67, 70, 43, 69, + 73, 92, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 76, + 22, 23, 80, 84, 25, 26, 87, 88, 89, 95, 65, 59, 75, 66, 63, 71, 83, 0, 72}; + +static const yytype_int8 yycheck[] = { + 2, 16, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 10, + 20, 21, 10, 23, 24, 25, 19, 19, 0, 19, 19, 31, 19, 0, 27, 27, 23, 27, 27, + 27, 22, 23, 33, 57, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, + 17, 18, 26, 20, 21, 10, 10, 24, 25, 22, 23, 26, 10, 27, 31, 27, 32, 27, 42, + 27, 79, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 27, + 20, 21, 27, 27, 24, 25, 29, 19, 27, 27, 27, 19, 50, 39, 25, 45, 60, -1, 47}; /* YYSTOS[STATE-NUM] -- The (internal number of the) accessing symbol of state STATE-NUM. */ -static const unsigned char yystos[] = -{ - 0, 34, 35, 0, 36, 37, 3, 4, 5, 6, - 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, - 17, 18, 20, 21, 23, 24, 25, 31, 38, 39, - 40, 44, 45, 49, 53, 57, 61, 62, 64, 10, - 46, 47, 10, 27, 50, 51, 52, 10, 58, 59, - 10, 41, 42, 37, 63, 26, 27, 63, 41, 10, - 54, 55, 46, 50, 39, 47, 27, 48, 50, 32, - 52, 59, 27, 60, 42, 27, 43, 19, 23, 27, - 63, 22, 55, 27, 56, 19, 29, 19, 27, 19, - 19, 37, 22, 19, 27 -}; +static const yytype_uint8 yystos[] = { + 0, 35, 36, 0, 37, 38, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, + 13, 14, 15, 16, 17, 18, 20, 21, 23, 24, 25, 31, 39, 40, 41, 45, + 46, 50, 54, 58, 62, 63, 65, 10, 47, 48, 10, 27, 51, 52, 53, 10, + 59, 60, 10, 33, 42, 43, 38, 64, 26, 27, 64, 42, 10, 55, 56, 47, + 51, 40, 48, 27, 49, 51, 32, 53, 60, 27, 61, 43, 27, 44, 19, 23, + 27, 64, 22, 56, 27, 57, 19, 29, 19, 27, 19, 19, 38, 22, 19, 27}; -#if ! defined (YYSIZE_T) && defined (__SIZE_TYPE__) -# define YYSIZE_T __SIZE_TYPE__ -#endif -#if ! defined (YYSIZE_T) && defined (size_t) -# define YYSIZE_T size_t -#endif -#if ! defined (YYSIZE_T) -# if defined (__STDC__) || defined (__cplusplus) -# include /* INFRINGES ON USER NAME SPACE */ -# define YYSIZE_T size_t -# endif -#endif -#if ! defined (YYSIZE_T) -# define YYSIZE_T unsigned int -#endif - -#define yyerrok (yyerrstatus = 0) -#define yyclearin (yychar = YYEMPTY) -#define YYEMPTY (-2) -#define YYEOF 0 - -#define YYACCEPT goto yyacceptlab -#define YYABORT goto yyabortlab -#define YYERROR goto yyerrorlab - - -/* Like YYERROR except do call yyerror. This remains here temporarily - to ease the transition to the new meaning of YYERROR, for GCC. - Once GCC version 2 has supplanted version 1, this can go. */ - -#define YYFAIL goto yyerrlab - -#define YYRECOVERING() (!!yyerrstatus) - -#define YYBACKUP(Token, Value) \ -do \ - if (yychar == YYEMPTY && yylen == 1) \ - { \ - yychar = (Token); \ - yylval = (Value); \ - yytoken = YYTRANSLATE (yychar); \ - YYPOPSTACK; \ - goto yybackup; \ - } \ - else \ - { \ - yyerror ("syntax error: cannot back up");\ - YYERROR; \ - } \ -while (0) - - -#define YYTERROR 1 -#define YYERRCODE 256 - - -/* YYLLOC_DEFAULT -- Set CURRENT to span from RHS[1] to RHS[N]. - If N is 0, then set CURRENT to the empty location which ends - the previous symbol: RHS[0] (always defined). */ - -#define YYRHSLOC(Rhs, K) ((Rhs)[K]) -#ifndef YYLLOC_DEFAULT -# define YYLLOC_DEFAULT(Current, Rhs, N) \ - do \ - if (N) \ - { \ - (Current).first_line = YYRHSLOC (Rhs, 1).first_line; \ - (Current).first_column = YYRHSLOC (Rhs, 1).first_column; \ - (Current).last_line = YYRHSLOC (Rhs, N).last_line; \ - (Current).last_column = YYRHSLOC (Rhs, N).last_column; \ - } \ - else \ - { \ - (Current).first_line = (Current).last_line = \ - YYRHSLOC (Rhs, 0).last_line; \ - (Current).first_column = (Current).last_column = \ - YYRHSLOC (Rhs, 0).last_column; \ - } \ +/* YYR1[YYN] -- Symbol number of symbol that rule YYN derives. */ +static const yytype_uint8 yyr1[] = { + 0, 34, 35, 36, 36, 37, 38, 38, 39, 39, 40, 40, 40, 40, 40, 40, 40, 40, + 40, 41, 41, 42, 42, 42, 43, 43, 44, 45, 45, 45, 45, 45, 45, 46, 46, 47, + 47, 48, 48, 49, 49, 50, 50, 51, 51, 52, 52, 53, 53, 54, 55, 55, 56, 56, + 57, 58, 59, 59, 60, 60, 61, 62, 62, 62, 62, 62, 63, 64, 64, 65, 65}; + +/* YYR2[YYN] -- Number of symbols on the right hand side of rule YYN. */ +static const yytype_uint8 yyr2[] = { + 0, 2, 1, 0, 2, 2, 0, 2, 1, 2, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 2, 1, 3, 1, + 0, 2, 1, 1, 1, 1, 1, 1, 1, 2, 2, 1, 3, 0, 2, 3, 1, 2, 2, 1, 3, 1, 2, 3, + 1, 2, 1, 3, 0, 2, 1, 2, 1, 3, 0, 2, 1, 1, 1, 1, 3, 1, 3, 1, 3, 4, 3}; + +#define yyerrok (yyerrstatus = 0) +#define yyclearin (yychar = YYEMPTY) +#define YYEMPTY (-2) +#define YYEOF 0 + +#define YYACCEPT goto yyacceptlab +#define YYABORT goto yyabortlab +#define YYERROR goto yyerrorlab + +#define YYRECOVERING() (!!yyerrstatus) + +#define YYBACKUP(Token, Value) \ + do \ + if (yychar == YYEMPTY) { \ + yychar = (Token); \ + yylval = (Value); \ + YYPOPSTACK(yylen); \ + yystate = *yyssp; \ + goto yybackup; \ + } else { \ + yyerror(parse_arg, YY_("syntax error: cannot back up")); \ + YYERROR; \ + } \ while (0) -#endif +/* Error token number */ +#define YYTERROR 1 +#define YYERRCODE 256 -/* YY_LOCATION_PRINT -- Print the location on the stream. - This macro was not mandated originally: define only if we know - we won't break user code: when these are the locations we know. */ +/* Enable debugging if requested. */ +#if YYDEBUG -#ifndef YY_LOCATION_PRINT -# if YYLTYPE_IS_TRIVIAL -# define YY_LOCATION_PRINT(File, Loc) \ - fprintf (File, "%d.%d-%d.%d", \ - (Loc).first_line, (Loc).first_column, \ - (Loc).last_line, (Loc).last_column) -# else -# define YY_LOCATION_PRINT(File, Loc) ((void) 0) -# endif +#ifndef YYFPRINTF +#include /* INFRINGES ON USER NAME SPACE */ +#define YYFPRINTF fprintf #endif +#define YYDPRINTF(Args) \ + do { \ + if (yydebug) \ + YYFPRINTF Args; \ + } while (0) -/* YYLEX -- calling `yylex' with the right arguments. */ +/* This macro is provided for backward compatibility. */ +#ifndef YY_LOCATION_PRINT +#define YY_LOCATION_PRINT(File, Loc) ((void)0) +#endif -#ifdef YYLEX_PARAM -# define YYLEX yylex (YYLEX_PARAM) -#else -# define YYLEX yylex () +#define YY_SYMBOL_PRINT(Title, Type, Value, Location) \ + do { \ + if (yydebug) { \ + YYFPRINTF(stderr, "%s ", Title); \ + yy_symbol_print(stderr, Type, Value, parse_arg); \ + YYFPRINTF(stderr, "\n"); \ + } \ + } while (0) + +/*----------------------------------------. +| Print this symbol's value on YYOUTPUT. | +`----------------------------------------*/ + +static void yy_symbol_value_print(FILE *yyoutput, int yytype, + YYSTYPE const *const yyvaluep, + void *parse_arg) { + FILE *yyo = yyoutput; + YYUSE(yyo); + YYUSE(parse_arg); + if (!yyvaluep) + return; +#ifdef YYPRINT + if (yytype < YYNTOKENS) + YYPRINT(yyoutput, yytoknum[yytype], *yyvaluep); #endif + YYUSE(yytype); +} -/* Enable debugging if requested. */ -#if YYDEBUG +/*--------------------------------. +| Print this symbol on YYOUTPUT. | +`--------------------------------*/ + +static void yy_symbol_print(FILE *yyoutput, int yytype, + YYSTYPE const *const yyvaluep, void *parse_arg) { + YYFPRINTF(yyoutput, "%s %s (", yytype < YYNTOKENS ? "token" : "nterm", + yytname[yytype]); -# ifndef YYFPRINTF -# include /* INFRINGES ON USER NAME SPACE */ -# define YYFPRINTF fprintf -# endif - -# define YYDPRINTF(Args) \ -do { \ - if (yydebug) \ - YYFPRINTF Args; \ -} while (0) - -# define YY_SYMBOL_PRINT(Title, Type, Value, Location) \ -do { \ - if (yydebug) \ - { \ - YYFPRINTF (stderr, "%s ", Title); \ - yysymprint (stderr, \ - Type, Value); \ - YYFPRINTF (stderr, "\n"); \ - } \ -} while (0) + yy_symbol_value_print(yyoutput, yytype, yyvaluep, parse_arg); + YYFPRINTF(yyoutput, ")"); +} /*------------------------------------------------------------------. | yy_stack_print -- Print the state stack from its BOTTOM up to its | | TOP (included). | `------------------------------------------------------------------*/ -#if defined (__STDC__) || defined (__cplusplus) -static void -yy_stack_print (short int *bottom, short int *top) -#else -static void -yy_stack_print (bottom, top) - short int *bottom; - short int *top; -#endif -{ - YYFPRINTF (stderr, "Stack now"); - for (/* Nothing. */; bottom <= top; ++bottom) - YYFPRINTF (stderr, " %d", *bottom); - YYFPRINTF (stderr, "\n"); +static void yy_stack_print(yytype_int16 *yybottom, yytype_int16 *yytop) { + YYFPRINTF(stderr, "Stack now"); + for (; yybottom <= yytop; yybottom++) { + int yybot = *yybottom; + YYFPRINTF(stderr, " %d", yybot); + } + YYFPRINTF(stderr, "\n"); } -# define YY_STACK_PRINT(Bottom, Top) \ -do { \ - if (yydebug) \ - yy_stack_print ((Bottom), (Top)); \ -} while (0) - +#define YY_STACK_PRINT(Bottom, Top) \ + do { \ + if (yydebug) \ + yy_stack_print((Bottom), (Top)); \ + } while (0) /*------------------------------------------------. | Report that the YYRULE is going to be reduced. | `------------------------------------------------*/ -#if defined (__STDC__) || defined (__cplusplus) -static void -yy_reduce_print (int yyrule) -#else -static void -yy_reduce_print (yyrule) - int yyrule; -#endif -{ - int yyi; - unsigned int yylno = yyrline[yyrule]; - YYFPRINTF (stderr, "Reducing stack by rule %d (line %u), ", - yyrule - 1, yylno); - /* Print the symbols being reduced, and their result. */ - for (yyi = yyprhs[yyrule]; 0 <= yyrhs[yyi]; yyi++) - YYFPRINTF (stderr, "%s ", yytname [yyrhs[yyi]]); - YYFPRINTF (stderr, "-> %s\n", yytname [yyr1[yyrule]]); +static void yy_reduce_print(yytype_int16 *yyssp, YYSTYPE *yyvsp, int yyrule, + void *parse_arg) { + unsigned long int yylno = yyrline[yyrule]; + int yynrhs = yyr2[yyrule]; + int yyi; + YYFPRINTF(stderr, "Reducing stack by rule %d (line %lu):\n", yyrule - 1, + yylno); + /* The symbols being reduced. */ + for (yyi = 0; yyi < yynrhs; yyi++) { + YYFPRINTF(stderr, " $%d = ", yyi + 1); + yy_symbol_print(stderr, yystos[yyssp[yyi + 1 - yynrhs]], + &(yyvsp[(yyi + 1) - (yynrhs)]), parse_arg); + YYFPRINTF(stderr, "\n"); + } } -# define YY_REDUCE_PRINT(Rule) \ -do { \ - if (yydebug) \ - yy_reduce_print (Rule); \ -} while (0) +#define YY_REDUCE_PRINT(Rule) \ + do { \ + if (yydebug) \ + yy_reduce_print(yyssp, yyvsp, Rule, parse_arg); \ + } while (0) /* Nonzero means print parse trace. It is left uninitialized so that multiple parsers can coexist. */ int yydebug; #else /* !YYDEBUG */ -# define YYDPRINTF(Args) -# define YY_SYMBOL_PRINT(Title, Type, Value, Location) -# define YY_STACK_PRINT(Bottom, Top) -# define YY_REDUCE_PRINT(Rule) +#define YYDPRINTF(Args) +#define YY_SYMBOL_PRINT(Title, Type, Value, Location) +#define YY_STACK_PRINT(Bottom, Top) +#define YY_REDUCE_PRINT(Rule) #endif /* !YYDEBUG */ - /* YYINITDEPTH -- initial size of the parser's stacks. */ -#ifndef YYINITDEPTH -# define YYINITDEPTH 200 +#ifndef YYINITDEPTH +#define YYINITDEPTH 200 #endif /* YYMAXDEPTH -- maximum size the stacks can grow to (effective only if the built-in stack extension method is used). Do not make this value too large; the results are undefined if - SIZE_MAX < YYSTACK_BYTES (YYMAXDEPTH) + YYSTACK_ALLOC_MAXIMUM < YYSTACK_BYTES (YYMAXDEPTH) evaluated with infinite-precision integer arithmetic. */ #ifndef YYMAXDEPTH -# define YYMAXDEPTH 10000 +#define YYMAXDEPTH 10000 #endif - - #if YYERROR_VERBOSE -# ifndef yystrlen -# if defined (__GLIBC__) && defined (_STRING_H) -# define yystrlen strlen -# else +#ifndef yystrlen +#if defined __GLIBC__ && defined _STRING_H +#define yystrlen strlen +#else /* Return the length of YYSTR. */ -static YYSIZE_T -# if defined (__STDC__) || defined (__cplusplus) -yystrlen (const char *yystr) -# else -yystrlen (yystr) - const char *yystr; -# endif -{ - register const char *yys = yystr; - - while (*yys++ != '\0') - continue; - - return yys - yystr - 1; +static YYSIZE_T yystrlen(const char *yystr) { + YYSIZE_T yylen; + for (yylen = 0; yystr[yylen]; yylen++) + continue; + return yylen; } -# endif -# endif +#endif +#endif -# ifndef yystpcpy -# if defined (__GLIBC__) && defined (_STRING_H) && defined (_GNU_SOURCE) -# define yystpcpy stpcpy -# else +#ifndef yystpcpy +#if defined __GLIBC__ && defined _STRING_H && defined _GNU_SOURCE +#define yystpcpy stpcpy +#else /* Copy YYSRC to YYDEST, returning the address of the terminating '\0' in YYDEST. */ -static char * -# if defined (__STDC__) || defined (__cplusplus) -yystpcpy (char *yydest, const char *yysrc) -# else -yystpcpy (yydest, yysrc) - char *yydest; - const char *yysrc; -# endif -{ - register char *yyd = yydest; - register const char *yys = yysrc; +static char *yystpcpy(char *yydest, const char *yysrc) { + char *yyd = yydest; + const char *yys = yysrc; - while ((*yyd++ = *yys++) != '\0') - continue; + while ((*yyd++ = *yys++) != '\0') + continue; - return yyd - 1; + return yyd - 1; } -# endif -# endif - -#endif /* !YYERROR_VERBOSE */ - - - -#if YYDEBUG -/*--------------------------------. -| Print this symbol on YYOUTPUT. | -`--------------------------------*/ +#endif +#endif -#if defined (__STDC__) || defined (__cplusplus) -static void -yysymprint (FILE *yyoutput, int yytype, YYSTYPE *yyvaluep) -#else -static void -yysymprint (yyoutput, yytype, yyvaluep) - FILE *yyoutput; - int yytype; - YYSTYPE *yyvaluep; -#endif -{ - /* Pacify ``unused variable'' warnings. */ - (void) yyvaluep; - - if (yytype < YYNTOKENS) - YYFPRINTF (yyoutput, "token %s (", yytname[yytype]); - else - YYFPRINTF (yyoutput, "nterm %s (", yytname[yytype]); - - -# ifdef YYPRINT - if (yytype < YYNTOKENS) - YYPRINT (yyoutput, yytoknum[yytype], *yyvaluep); -# endif - switch (yytype) - { - default: - break; +#ifndef yytnamerr +/* Copy to YYRES the contents of YYSTR after stripping away unnecessary + quotes and backslashes, so that it's suitable for yyerror. The + heuristic is that double-quoting is unnecessary unless the string + contains an apostrophe, a comma, or backslash (other than + backslash-backslash). YYSTR is taken from yytname. If YYRES is + null, do not copy; instead, return the length of what the result + would have been. */ +static YYSIZE_T yytnamerr(char *yyres, const char *yystr) { + if (*yystr == '"') { + YYSIZE_T yyn = 0; + char const *yyp = yystr; + + for (;;) + switch (*++yyp) { + case '\'': + case ',': + goto do_not_strip_quotes; + + case '\\': + if (*++yyp != '\\') + goto do_not_strip_quotes; + /* Fall through. */ + default: + if (yyres) + yyres[yyn] = *yyp; + yyn++; + break; + + case '"': + if (yyres) + yyres[yyn] = '\0'; + return yyn; + } + do_not_strip_quotes: + ; } - YYFPRINTF (yyoutput, ")"); -} -#endif /* ! YYDEBUG */ -/*-----------------------------------------------. -| Release the memory associated to this symbol. | -`-----------------------------------------------*/ + if (!yyres) + return yystrlen(yystr); -#if defined (__STDC__) || defined (__cplusplus) -static void -yydestruct (const char *yymsg, int yytype, YYSTYPE *yyvaluep) -#else -static void -yydestruct (yymsg, yytype, yyvaluep) - const char *yymsg; - int yytype; - YYSTYPE *yyvaluep; + return yystpcpy(yyres, yystr) - yyres; +} #endif -{ - /* Pacify ``unused variable'' warnings. */ - (void) yyvaluep; - if (!yymsg) - yymsg = "Deleting"; - YY_SYMBOL_PRINT (yymsg, yytype, yyvaluep, yylocationp); +/* Copy into *YYMSG, which is of size *YYMSG_ALLOC, an error message + about the unexpected token YYTOKEN for the state stack whose top is + YYSSP. + + Return 0 if *YYMSG was successfully written. Return 1 if *YYMSG is + not large enough to hold the message. In that case, also set + *YYMSG_ALLOC to the required number of bytes. Return 2 if the + required number of bytes is too large to store. */ +static int yysyntax_error(YYSIZE_T *yymsg_alloc, char **yymsg, + yytype_int16 *yyssp, int yytoken) { + YYSIZE_T yysize0 = yytnamerr(YY_NULLPTR, yytname[yytoken]); + YYSIZE_T yysize = yysize0; + enum { YYERROR_VERBOSE_ARGS_MAXIMUM = 5 }; + /* Internationalized format string. */ + const char *yyformat = YY_NULLPTR; + /* Arguments of yyformat. */ + char const *yyarg[YYERROR_VERBOSE_ARGS_MAXIMUM]; + /* Number of reported tokens (one for the "unexpected", one per + "expected"). */ + int yycount = 0; + + /* There are many possibilities here to consider: + - If this state is a consistent state with a default action, then + the only way this function was invoked is if the default action + is an error action. In that case, don't check for expected + tokens because there are none. + - The only way there can be no lookahead present (in yychar) is if + this state is a consistent state with a default action. Thus, + detecting the absence of a lookahead is sufficient to determine + that there is no unexpected or expected token to report. In that + case, just report a simple "syntax error". + - Don't assume there isn't a lookahead just because this state is a + consistent state with a default action. There might have been a + previous inconsistent state, consistent state with a non-default + action, or user semantic action that manipulated yychar. + - Of course, the expected token list depends on states to have + correct lookahead information, and it depends on the parser not + to perform extra reductions after fetching a lookahead from the + scanner and before detecting a syntax error. Thus, state merging + (from LALR or IELR) and default reductions corrupt the expected + token list. However, the list is correct for canonical LR with + one exception: it will still contain any token that will not be + accepted due to an error action in a later state. + */ + if (yytoken != YYEMPTY) { + int yyn = yypact[*yyssp]; + yyarg[yycount++] = yytname[yytoken]; + if (!yypact_value_is_default(yyn)) { + /* Start YYX at -YYN if negative to avoid negative indexes in + YYCHECK. In other words, skip the first -YYN actions for + this state because they are default actions. */ + int yyxbegin = yyn < 0 ? -yyn : 0; + /* Stay within bounds of both yycheck and yytname. */ + int yychecklim = YYLAST - yyn + 1; + int yyxend = yychecklim < YYNTOKENS ? yychecklim : YYNTOKENS; + int yyx; + + for (yyx = yyxbegin; yyx < yyxend; ++yyx) + if (yycheck[yyx + yyn] == yyx && yyx != YYTERROR && + !yytable_value_is_error(yytable[yyx + yyn])) { + if (yycount == YYERROR_VERBOSE_ARGS_MAXIMUM) { + yycount = 1; + yysize = yysize0; + break; + } + yyarg[yycount++] = yytname[yyx]; + { + YYSIZE_T yysize1 = + yysize + yytnamerr(YY_NULLPTR, yytname[yyx]); + if (!(yysize <= yysize1 && + yysize1 <= YYSTACK_ALLOC_MAXIMUM)) + return 2; + yysize = yysize1; + } + } + } + } - switch (yytype) - { + switch (yycount) { +#define YYCASE_(N, S) \ + case N: \ + yyformat = S; \ + break + YYCASE_(0, YY_("syntax error")); + YYCASE_(1, YY_("syntax error, unexpected %s")); + YYCASE_(2, YY_("syntax error, unexpected %s, expecting %s")); + YYCASE_(3, YY_("syntax error, unexpected %s, expecting %s or %s")); + YYCASE_(4, + YY_("syntax error, unexpected %s, expecting %s or %s or %s")); + YYCASE_( + 5, + YY_("syntax error, unexpected %s, expecting %s or %s or %s or %s")); +#undef YYCASE_ + } - default: - break; + { + YYSIZE_T yysize1 = yysize + yystrlen(yyformat); + if (!(yysize <= yysize1 && yysize1 <= YYSTACK_ALLOC_MAXIMUM)) + return 2; + yysize = yysize1; } -} - -/* Prevent warnings from -Wmissing-prototypes. */ + if (*yymsg_alloc < yysize) { + *yymsg_alloc = 2 * yysize; + if (!(yysize <= *yymsg_alloc && *yymsg_alloc <= YYSTACK_ALLOC_MAXIMUM)) + *yymsg_alloc = YYSTACK_ALLOC_MAXIMUM; + return 1; + } -#ifdef YYPARSE_PARAM -# if defined (__STDC__) || defined (__cplusplus) -int yyparse (void *YYPARSE_PARAM); -# else -int yyparse (); -# endif -#else /* ! YYPARSE_PARAM */ -#if defined (__STDC__) || defined (__cplusplus) -int yyparse (void); -#else -int yyparse (); -#endif -#endif /* ! YYPARSE_PARAM */ + /* Avoid sprintf, as that infringes on the user's name space. + Don't have undefined behavior even if the translation + produced a string with the wrong number of "%s"s. */ + { + char *yyp = *yymsg; + int yyi = 0; + while ((*yyp = *yyformat) != '\0') + if (*yyp == '%' && yyformat[1] == 's' && yyi < yycount) { + yyp += yytnamerr(yyp, yyarg[yyi++]); + yyformat += 2; + } else { + yyp++; + yyformat++; + } + } + return 0; +} +#endif /* YYERROR_VERBOSE */ +/*-----------------------------------------------. +| Release the memory associated to this symbol. | +`-----------------------------------------------*/ +static void yydestruct(const char *yymsg, int yytype, YYSTYPE *yyvaluep, + void *parse_arg) { + YYUSE(yyvaluep); + YYUSE(parse_arg); + if (!yymsg) + yymsg = "Deleting"; + YY_SYMBOL_PRINT(yymsg, yytype, yyvaluep, yylocationp); + + YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN + YYUSE(yytype); + YY_IGNORE_MAYBE_UNINITIALIZED_END +} -/* The look-ahead symbol. */ +/* The lookahead symbol. */ int yychar; -/* The semantic value of the look-ahead symbol. */ +/* The semantic value of the lookahead symbol. */ YYSTYPE yylval; - /* Number of syntax errors so far. */ int yynerrs; - - /*----------. | yyparse. | `----------*/ -#ifdef YYPARSE_PARAM -# if defined (__STDC__) || defined (__cplusplus) -int yyparse (void *YYPARSE_PARAM) -# else -int yyparse (YYPARSE_PARAM) - void *YYPARSE_PARAM; -# endif -#else /* ! YYPARSE_PARAM */ -#if defined (__STDC__) || defined (__cplusplus) -int -yyparse (void) -#else -int -yyparse () +int yyparse(void *parse_arg) { + int yystate; + /* Number of tokens to shift before error messages enabled. */ + int yyerrstatus; + + /* The stacks and their tools: + 'yyss': related to states. + 'yyvs': related to semantic values. + + Refer to the stacks through separate pointers, to allow yyoverflow + to reallocate them elsewhere. */ + + /* The state stack. */ + yytype_int16 yyssa[YYINITDEPTH]; + yytype_int16 *yyss; + yytype_int16 *yyssp; + + /* The semantic value stack. */ + YYSTYPE yyvsa[YYINITDEPTH]; + YYSTYPE *yyvs; + YYSTYPE *yyvsp; + + YYSIZE_T yystacksize; + + int yyn; + int yyresult; + /* Lookahead token as an internal (translated) token number. */ + int yytoken = 0; + /* The variables used to return semantic value and location from the + action routines. */ + YYSTYPE yyval; +#if YYERROR_VERBOSE + /* Buffer for error messages, and its allocated size. */ + char yymsgbuf[128]; + char *yymsg = yymsgbuf; + YYSIZE_T yymsg_alloc = sizeof yymsgbuf; #endif -#endif -{ - - register int yystate; - register int yyn; - int yyresult; - /* Number of tokens to shift before error messages enabled. */ - int yyerrstatus; - /* Look-ahead token as an internal (translated) token number. */ - int yytoken = 0; - - /* Three stacks and their tools: - `yyss': related to states, - `yyvs': related to semantic values, - `yyls': related to locations. - - Refer to the stacks thru separate pointers, to allow yyoverflow - to reallocate them elsewhere. */ - - /* The state stack. */ - short int yyssa[YYINITDEPTH]; - short int *yyss = yyssa; - register short int *yyssp; - - /* The semantic value stack. */ - YYSTYPE yyvsa[YYINITDEPTH]; - YYSTYPE *yyvs = yyvsa; - register YYSTYPE *yyvsp; - - - -#define YYPOPSTACK (yyvsp--, yyssp--) - - YYSIZE_T yystacksize = YYINITDEPTH; - - /* The variables used to return semantic value and location from the - action routines. */ - YYSTYPE yyval; - - /* When reducing, the number of symbols on the RHS of the reduced - rule. */ - int yylen; +#define YYPOPSTACK(N) (yyvsp -= (N), yyssp -= (N)) - YYDPRINTF ((stderr, "Starting parse\n")); + /* The number of symbols on the RHS of the reduced rule. + Keep to zero when no symbol should be popped. */ + int yylen = 0; - yystate = 0; - yyerrstatus = 0; - yynerrs = 0; - yychar = YYEMPTY; /* Cause a token to be read. */ + yyssp = yyss = yyssa; + yyvsp = yyvs = yyvsa; + yystacksize = YYINITDEPTH; - /* Initialize stack pointers. - Waste one element of value and location stack - so that they stay on the same level as the state stack. - The wasted elements are never initialized. */ + YYDPRINTF((stderr, "Starting parse\n")); - yyssp = yyss; - yyvsp = yyvs; - - - yyvsp[0] = yylval; - - goto yysetstate; + yystate = 0; + yyerrstatus = 0; + yynerrs = 0; + yychar = YYEMPTY; /* Cause a token to be read. */ + goto yysetstate; /*------------------------------------------------------------. | yynewstate -- Push a new state, which is found in yystate. | `------------------------------------------------------------*/ - yynewstate: - /* In all cases, when you get here, the value and location stacks - have just been pushed. so pushing a state here evens the stacks. - */ - yyssp++; - - yysetstate: - *yyssp = yystate; - - if (yyss + yystacksize - 1 <= yyssp) - { - /* Get the current used size of the three stacks, in elements. */ - YYSIZE_T yysize = yyssp - yyss + 1; +yynewstate: + /* In all cases, when you get here, the value and location stacks + have just been pushed. So pushing a state here evens the stacks. */ + yyssp++; + +yysetstate: + *yyssp = yystate; + + if (yyss + yystacksize - 1 <= yyssp) { + /* Get the current used size of the three stacks, in elements. */ + YYSIZE_T yysize = yyssp - yyss + 1; #ifdef yyoverflow - { - /* Give user a chance to reallocate the stack. Use copies of - these so that the &'s don't force the real ones into - memory. */ - YYSTYPE *yyvs1 = yyvs; - short int *yyss1 = yyss; - - - /* Each stack pointer address is followed by the size of the - data in use in that stack, in bytes. This used to be a - conditional around just the two extra args, but that might - be undefined if yyoverflow is a macro. */ - yyoverflow ("parser stack overflow", - &yyss1, yysize * sizeof (*yyssp), - &yyvs1, yysize * sizeof (*yyvsp), - - &yystacksize); - - yyss = yyss1; - yyvs = yyvs1; - } + { + /* Give user a chance to reallocate the stack. Use copies of + these so that the &'s don't force the real ones into + memory. */ + YYSTYPE *yyvs1 = yyvs; + yytype_int16 *yyss1 = yyss; + + /* Each stack pointer address is followed by the size of the + data in use in that stack, in bytes. This used to be a + conditional around just the two extra args, but that might + be undefined if yyoverflow is a macro. */ + yyoverflow(YY_("memory exhausted"), &yyss1, yysize * sizeof(*yyssp), + &yyvs1, yysize * sizeof(*yyvsp), &yystacksize); + + yyss = yyss1; + yyvs = yyvs1; + } #else /* no yyoverflow */ -# ifndef YYSTACK_RELOCATE - goto yyoverflowlab; -# else - /* Extend the stack our own way. */ - if (YYMAXDEPTH <= yystacksize) - goto yyoverflowlab; - yystacksize *= 2; - if (YYMAXDEPTH < yystacksize) - yystacksize = YYMAXDEPTH; - - { - short int *yyss1 = yyss; - union yyalloc *yyptr = - (union yyalloc *) YYSTACK_ALLOC (YYSTACK_BYTES (yystacksize)); - if (! yyptr) - goto yyoverflowlab; - YYSTACK_RELOCATE (yyss); - YYSTACK_RELOCATE (yyvs); - -# undef YYSTACK_RELOCATE - if (yyss1 != yyssa) - YYSTACK_FREE (yyss1); - } -# endif -#endif /* no yyoverflow */ +#ifndef YYSTACK_RELOCATE + goto yyexhaustedlab; +#else + /* Extend the stack our own way. */ + if (YYMAXDEPTH <= yystacksize) + goto yyexhaustedlab; + yystacksize *= 2; + if (YYMAXDEPTH < yystacksize) + yystacksize = YYMAXDEPTH; - yyssp = yyss + yysize - 1; - yyvsp = yyvs + yysize - 1; + { + yytype_int16 *yyss1 = yyss; + union yyalloc *yyptr = + (union yyalloc *)YYSTACK_ALLOC(YYSTACK_BYTES(yystacksize)); + if (!yyptr) + goto yyexhaustedlab; + YYSTACK_RELOCATE(yyss_alloc, yyss); + YYSTACK_RELOCATE(yyvs_alloc, yyvs); +#undef YYSTACK_RELOCATE + if (yyss1 != yyssa) + YYSTACK_FREE(yyss1); + } +#endif +#endif /* no yyoverflow */ + yyssp = yyss + yysize - 1; + yyvsp = yyvs + yysize - 1; - YYDPRINTF ((stderr, "Stack size increased to %lu\n", - (unsigned long int) yystacksize)); + YYDPRINTF((stderr, "Stack size increased to %lu\n", + (unsigned long int)yystacksize)); - if (yyss + yystacksize - 1 <= yyssp) - YYABORT; + if (yyss + yystacksize - 1 <= yyssp) + YYABORT; } - YYDPRINTF ((stderr, "Entering state %d\n", yystate)); + YYDPRINTF((stderr, "Entering state %d\n", yystate)); + + if (yystate == YYFINAL) + YYACCEPT; - goto yybackup; + goto yybackup; /*-----------. | yybackup. | `-----------*/ yybackup: -/* Do appropriate processing given the current state. */ -/* Read a look-ahead token if we need one and don't already have one. */ -/* yyresume: */ - - /* First try to decide what to do without reference to look-ahead token. */ + /* Do appropriate processing given the current state. Read a + lookahead token if we need one and don't already have one. */ - yyn = yypact[yystate]; - if (yyn == YYPACT_NINF) - goto yydefault; - - /* Not known => get a look-ahead token if don't already have one. */ - - /* YYCHAR is either YYEMPTY or YYEOF or a valid look-ahead symbol. */ - if (yychar == YYEMPTY) - { - YYDPRINTF ((stderr, "Reading a token: ")); - yychar = YYLEX; + /* First try to decide what to do without reference to lookahead token. */ + yyn = yypact[yystate]; + if (yypact_value_is_default(yyn)) + goto yydefault; + + /* Not known => get a lookahead token if don't already have one. */ + + /* YYCHAR is either YYEMPTY or YYEOF or a valid lookahead symbol. */ + if (yychar == YYEMPTY) { + YYDPRINTF((stderr, "Reading a token: ")); + yychar = yylex(); } - if (yychar <= YYEOF) - { - yychar = yytoken = YYEOF; - YYDPRINTF ((stderr, "Now at end of input.\n")); - } - else - { - yytoken = YYTRANSLATE (yychar); - YY_SYMBOL_PRINT ("Next token is", yytoken, &yylval, &yylloc); + if (yychar <= YYEOF) { + yychar = yytoken = YYEOF; + YYDPRINTF((stderr, "Now at end of input.\n")); + } else { + yytoken = YYTRANSLATE(yychar); + YY_SYMBOL_PRINT("Next token is", yytoken, &yylval, &yylloc); } - /* If the proper action on seeing token YYTOKEN is to reduce or to - detect an error, take that action. */ - yyn += yytoken; - if (yyn < 0 || YYLAST < yyn || yycheck[yyn] != yytoken) - goto yydefault; - yyn = yytable[yyn]; - if (yyn <= 0) - { - if (yyn == 0 || yyn == YYTABLE_NINF) - goto yyerrlab; - yyn = -yyn; - goto yyreduce; + /* If the proper action on seeing token YYTOKEN is to reduce or to + detect an error, take that action. */ + yyn += yytoken; + if (yyn < 0 || YYLAST < yyn || yycheck[yyn] != yytoken) + goto yydefault; + yyn = yytable[yyn]; + if (yyn <= 0) { + if (yytable_value_is_error(yyn)) + goto yyerrlab; + yyn = -yyn; + goto yyreduce; } - if (yyn == YYFINAL) - YYACCEPT; + /* Count tokens shifted since error; after three, turn off error + status. */ + if (yyerrstatus) + yyerrstatus--; - /* Shift the look-ahead token. */ - YY_SYMBOL_PRINT ("Shifting", yytoken, &yylval, &yylloc); + /* Shift the lookahead token. */ + YY_SYMBOL_PRINT("Shifting", yytoken, &yylval, &yylloc); - /* Discard the token being shifted unless it is eof. */ - if (yychar != YYEOF) + /* Discard the shifted token. */ yychar = YYEMPTY; - *++yyvsp = yylval; - - - /* Count tokens shifted since error; after three, turn off error - status. */ - if (yyerrstatus) - yyerrstatus--; - - yystate = yyn; - goto yynewstate; + yystate = yyn; + YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN + *++yyvsp = yylval; + YY_IGNORE_MAYBE_UNINITIALIZED_END + goto yynewstate; /*-----------------------------------------------------------. | yydefault -- do the default action for the current state. | `-----------------------------------------------------------*/ yydefault: - yyn = yydefact[yystate]; - if (yyn == 0) - goto yyerrlab; - goto yyreduce; - + yyn = yydefact[yystate]; + if (yyn == 0) + goto yyerrlab; + goto yyreduce; /*-----------------------------. | yyreduce -- Do a reduction. | `-----------------------------*/ yyreduce: - /* yyn is the number of a rule to reduce with. */ - yylen = yyr2[yyn]; - - /* If YYLEN is nonzero, implement the default value of the action: - `$$ = $1'. + /* yyn is the number of a rule to reduce with. */ + yylen = yyr2[yyn]; - Otherwise, the following line sets YYVAL to garbage. - This behavior is undocumented and Bison - users should not rely upon it. Assigning to YYVAL - unconditionally makes the parser a bit smaller, and it avoids a - GCC warning that YYVAL may be used uninitialized. */ - yyval = yyvsp[1-yylen]; + /* If YYLEN is nonzero, implement the default value of the action: + '$$ = $1'. + Otherwise, the following line sets YYVAL to garbage. + This behavior is undocumented and Bison + users should not rely upon it. Assigning to YYVAL + unconditionally makes the parser a bit smaller, and it avoids a + GCC warning that YYVAL may be used uninitialized. */ + yyval = yyvsp[1 - yylen]; + + YY_REDUCE_PRINT(yyn); + switch (yyn) { + case 2: +#line 132 "parser.y" /* yacc.c:1646 */ + { + /* we expect parse_arg to be already allocated, and that + * it is of type (struct ast_s *) */ + ((struct ast_s *)parse_arg)->list = (yyvsp[0].u_rule_list); + } +#line 1402 "parser.c" /* yacc.c:1646 */ + break; - YY_REDUCE_PRINT (yyn); - switch (yyn) - { - case 2: -#line 132 "parser.y" + case 3: +#line 139 "parser.y" /* yacc.c:1646 */ { - /* we expect parm to be already allocated, and that - * it is of type (struct ast_s *) */ - ((struct ast_s *) parm)->list = (yyvsp[0].u_rule_list); - } + (yyval.u_rule_list) = NULL; + } +#line 1410 "parser.c" /* yacc.c:1646 */ break; - case 3: -#line 139 "parser.y" + case 4: +#line 143 "parser.y" /* yacc.c:1646 */ { - (yyval.u_rule_list) = NULL; - } + (yyval.u_rule_list) = malloc(sizeof(struct rule_list_s)); + (yyval.u_rule_list)->list = (yyvsp[-1].u_rule_list); + (yyval.u_rule_list)->rule = (yyvsp[0].u_rule); + } +#line 1420 "parser.c" /* yacc.c:1646 */ break; - case 4: -#line 143 "parser.y" + case 5: +#line 151 "parser.y" /* yacc.c:1646 */ { - (yyval.u_rule_list) = malloc(sizeof(struct rule_list_s)); - (yyval.u_rule_list)->list = (yyvsp[-1].u_rule_list); - (yyval.u_rule_list)->rule = (yyvsp[0].u_rule); - } + (yyval.u_rule) = malloc(sizeof(struct rule_s)); + (yyval.u_rule)->list = (yyvsp[-1].u_specifier_list); + } +#line 1429 "parser.c" /* yacc.c:1646 */ break; - case 5: -#line 151 "parser.y" + case 6: +#line 158 "parser.y" /* yacc.c:1646 */ { - (yyval.u_rule) = malloc(sizeof(struct rule_s)); - (yyval.u_rule)->list = (yyvsp[-1].u_specifier_list); - } + (yyval.u_specifier_list) = NULL; + } +#line 1437 "parser.c" /* yacc.c:1646 */ break; - case 6: -#line 158 "parser.y" + case 7: +#line 162 "parser.y" /* yacc.c:1646 */ { - (yyval.u_specifier_list) = NULL; - } + (yyval.u_specifier_list) = malloc(sizeof(struct specifier_list_s)); + (yyval.u_specifier_list)->list = (yyvsp[-1].u_specifier_list); + (yyval.u_specifier_list)->spec = (yyvsp[0].u_negated_specifier); + } +#line 1447 "parser.c" /* yacc.c:1646 */ break; - case 7: -#line 162 "parser.y" + case 8: +#line 170 "parser.y" /* yacc.c:1646 */ { - (yyval.u_specifier_list) = malloc(sizeof(struct specifier_list_s)); - (yyval.u_specifier_list)->list = (yyvsp[-1].u_specifier_list); - (yyval.u_specifier_list)->spec = (yyvsp[0].u_negated_specifier); - } + (yyval.u_negated_specifier) = + malloc(sizeof(struct negated_specifier_s)); + (yyval.u_negated_specifier)->negated = 0; + (yyval.u_negated_specifier)->spec = (yyvsp[0].u_specifier); + } +#line 1457 "parser.c" /* yacc.c:1646 */ break; - case 8: -#line 170 "parser.y" + case 9: +#line 176 "parser.y" /* yacc.c:1646 */ { - (yyval.u_negated_specifier) = malloc(sizeof(struct negated_specifier_s)); - (yyval.u_negated_specifier)->negated = 0; - (yyval.u_negated_specifier)->spec = (yyvsp[0].u_specifier); - } + (yyval.u_negated_specifier) = + malloc(sizeof(struct negated_specifier_s)); + (yyval.u_negated_specifier)->negated = 1; + (yyval.u_negated_specifier)->spec = (yyvsp[0].u_specifier); + } +#line 1467 "parser.c" /* yacc.c:1646 */ break; - case 9: -#line 176 "parser.y" + case 10: +#line 184 "parser.y" /* yacc.c:1646 */ { - (yyval.u_negated_specifier) = malloc(sizeof(struct negated_specifier_s)); - (yyval.u_negated_specifier)->negated = 1; - (yyval.u_negated_specifier)->spec = (yyvsp[0].u_specifier); - } + (yyval.u_specifier) = malloc(sizeof(struct specifier_s)); + memset((yyval.u_specifier), 0, sizeof(struct specifier_s)); + (yyval.u_specifier)->compound = (yyvsp[0].u_compound_specifier); + } +#line 1477 "parser.c" /* yacc.c:1646 */ break; - case 10: -#line 184 "parser.y" + case 11: +#line 190 "parser.y" /* yacc.c:1646 */ { - (yyval.u_specifier) = malloc(sizeof(struct specifier_s)); - memset((yyval.u_specifier), 0, sizeof(struct specifier_s)); - (yyval.u_specifier)->compound = (yyvsp[0].u_compound_specifier); - } + (yyval.u_specifier) = malloc(sizeof(struct specifier_s)); + memset((yyval.u_specifier), 0, sizeof(struct specifier_s)); + (yyval.u_specifier)->direction = (yyvsp[0].u_direction_specifier); + } +#line 1487 "parser.c" /* yacc.c:1646 */ break; - case 11: -#line 190 "parser.y" + case 12: +#line 196 "parser.y" /* yacc.c:1646 */ { - (yyval.u_specifier) = malloc(sizeof(struct specifier_s)); - memset((yyval.u_specifier), 0, sizeof(struct specifier_s)); - (yyval.u_specifier)->direction = (yyvsp[0].u_direction_specifier); - } + (yyval.u_specifier) = malloc(sizeof(struct specifier_s)); + memset((yyval.u_specifier), 0, sizeof(struct specifier_s)); + (yyval.u_specifier)->target = (yyvsp[0].u_target_specifier); + } +#line 1497 "parser.c" /* yacc.c:1646 */ break; - case 12: -#line 196 "parser.y" + case 13: +#line 202 "parser.y" /* yacc.c:1646 */ { - (yyval.u_specifier) = malloc(sizeof(struct specifier_s)); - memset((yyval.u_specifier), 0, sizeof(struct specifier_s)); - (yyval.u_specifier)->target = (yyvsp[0].u_target_specifier); - } + (yyval.u_specifier) = malloc(sizeof(struct specifier_s)); + memset((yyval.u_specifier), 0, sizeof(struct specifier_s)); + (yyval.u_specifier)->host = (yyvsp[0].u_host_specifier); + } +#line 1507 "parser.c" /* yacc.c:1646 */ break; - case 13: -#line 202 "parser.y" + case 14: +#line 208 "parser.y" /* yacc.c:1646 */ { - (yyval.u_specifier) = malloc(sizeof(struct specifier_s)); - memset((yyval.u_specifier), 0, sizeof(struct specifier_s)); - (yyval.u_specifier)->host = (yyvsp[0].u_host_specifier); - } + (yyval.u_specifier) = malloc(sizeof(struct specifier_s)); + memset((yyval.u_specifier), 0, sizeof(struct specifier_s)); + (yyval.u_specifier)->port = (yyvsp[0].u_port_specifier); + } +#line 1517 "parser.c" /* yacc.c:1646 */ break; - case 14: -#line 208 "parser.y" + case 15: +#line 214 "parser.y" /* yacc.c:1646 */ { - (yyval.u_specifier) = malloc(sizeof(struct specifier_s)); - memset((yyval.u_specifier), 0, sizeof(struct specifier_s)); - (yyval.u_specifier)->port = (yyvsp[0].u_port_specifier); - } + (yyval.u_specifier) = malloc(sizeof(struct specifier_s)); + memset((yyval.u_specifier), 0, sizeof(struct specifier_s)); + (yyval.u_specifier)->protocol = (yyvsp[0].u_protocol_specifier); + } +#line 1527 "parser.c" /* yacc.c:1646 */ break; - case 15: -#line 214 "parser.y" + case 16: +#line 220 "parser.y" /* yacc.c:1646 */ { - (yyval.u_specifier) = malloc(sizeof(struct specifier_s)); - memset((yyval.u_specifier), 0, sizeof(struct specifier_s)); - (yyval.u_specifier)->protocol = (yyvsp[0].u_protocol_specifier); - } + (yyval.u_specifier) = malloc(sizeof(struct specifier_s)); + memset((yyval.u_specifier), 0, sizeof(struct specifier_s)); + (yyval.u_specifier)->icmptype = (yyvsp[0].u_icmptype_specifier); + } +#line 1537 "parser.c" /* yacc.c:1646 */ break; - case 16: -#line 220 "parser.y" + case 17: +#line 226 "parser.y" /* yacc.c:1646 */ { - (yyval.u_specifier) = malloc(sizeof(struct specifier_s)); - memset((yyval.u_specifier), 0, sizeof(struct specifier_s)); - (yyval.u_specifier)->icmptype = (yyvsp[0].u_icmptype_specifier); - } + (yyval.u_specifier) = malloc(sizeof(struct specifier_s)); + memset((yyval.u_specifier), 0, sizeof(struct specifier_s)); + (yyval.u_specifier)->option = (yyvsp[0].u_option_specifier); + } +#line 1547 "parser.c" /* yacc.c:1646 */ break; - case 17: -#line 226 "parser.y" + case 18: +#line 232 "parser.y" /* yacc.c:1646 */ { - (yyval.u_specifier) = malloc(sizeof(struct specifier_s)); - memset((yyval.u_specifier), 0, sizeof(struct specifier_s)); - (yyval.u_specifier)->option = (yyvsp[0].u_option_specifier); - } + (yyval.u_specifier) = malloc(sizeof(struct specifier_s)); + memset((yyval.u_specifier), 0, sizeof(struct specifier_s)); + (yyval.u_specifier)->chaingroup = (yyvsp[0].u_chaingroup_specifier); + } +#line 1557 "parser.c" /* yacc.c:1646 */ break; - case 18: -#line 232 "parser.y" + case 19: +#line 240 "parser.y" /* yacc.c:1646 */ { - (yyval.u_specifier) = malloc(sizeof(struct specifier_s)); - memset((yyval.u_specifier), 0, sizeof(struct specifier_s)); - (yyval.u_specifier)->chaingroup = (yyvsp[0].u_chaingroup_specifier); - } + (yyval.u_direction_specifier) = + malloc(sizeof(struct direction_specifier_s)); + (yyval.u_direction_specifier)->type = TOK_INPUT; + (yyval.u_direction_specifier)->list = + (yyvsp[0].u_direction_argument_list); + } +#line 1567 "parser.c" /* yacc.c:1646 */ break; - case 19: -#line 240 "parser.y" + case 20: +#line 246 "parser.y" /* yacc.c:1646 */ { - (yyval.u_direction_specifier) = malloc(sizeof(struct direction_specifier_s)); - (yyval.u_direction_specifier)->type = TOK_INPUT; - (yyval.u_direction_specifier)->list = (yyvsp[0].u_direction_argument_list); - } + (yyval.u_direction_specifier) = + malloc(sizeof(struct direction_specifier_s)); + (yyval.u_direction_specifier)->type = TOK_OUTPUT; + (yyval.u_direction_specifier)->list = + (yyvsp[0].u_direction_argument_list); + } +#line 1577 "parser.c" /* yacc.c:1646 */ break; - case 20: -#line 246 "parser.y" + case 21: +#line 254 "parser.y" /* yacc.c:1646 */ { - (yyval.u_direction_specifier) = malloc(sizeof(struct direction_specifier_s)); - (yyval.u_direction_specifier)->type = TOK_OUTPUT; - (yyval.u_direction_specifier)->list = (yyvsp[0].u_direction_argument_list); - } + (yyval.u_direction_argument_list) = + (yyvsp[0].u_direction_argument_list); + } +#line 1585 "parser.c" /* yacc.c:1646 */ break; - case 21: -#line 254 "parser.y" + case 22: +#line 258 "parser.y" /* yacc.c:1646 */ { - (yyval.u_direction_argument_list) = (yyvsp[0].u_direction_argument_list); - } + (yyval.u_direction_argument_list) = + (yyvsp[-1].u_direction_argument_list); + } +#line 1593 "parser.c" /* yacc.c:1646 */ break; - case 22: -#line 258 "parser.y" + case 23: +#line 262 "parser.y" /* yacc.c:1646 */ { - (yyval.u_direction_argument_list) = (yyvsp[-1].u_direction_argument_list); - } + (yyval.u_direction_argument_list) = + malloc(sizeof(struct direction_argument_list_s)); + (yyval.u_direction_argument_list)->list = NULL; + (yyval.u_direction_argument_list)->arg = + malloc(sizeof(struct direction_argument_s)); + (yyval.u_direction_argument_list)->arg->direction = strdup("*"); + } +#line 1604 "parser.c" /* yacc.c:1646 */ break; - case 23: -#line 264 "parser.y" + case 24: +#line 271 "parser.y" /* yacc.c:1646 */ { - (yyval.u_direction_argument_list) = NULL; - } + (yyval.u_direction_argument_list) = NULL; + } +#line 1612 "parser.c" /* yacc.c:1646 */ break; - case 24: -#line 268 "parser.y" + case 25: +#line 275 "parser.y" /* yacc.c:1646 */ { - (yyval.u_direction_argument_list) = malloc(sizeof(struct direction_argument_list_s)); - (yyval.u_direction_argument_list)->list = (yyvsp[-1].u_direction_argument_list); - (yyval.u_direction_argument_list)->arg = (yyvsp[0].u_direction_argument); - } + (yyval.u_direction_argument_list) = + malloc(sizeof(struct direction_argument_list_s)); + (yyval.u_direction_argument_list)->list = + (yyvsp[-1].u_direction_argument_list); + (yyval.u_direction_argument_list)->arg = + (yyvsp[0].u_direction_argument); + } +#line 1622 "parser.c" /* yacc.c:1646 */ break; - case 25: -#line 276 "parser.y" + case 26: +#line 283 "parser.y" /* yacc.c:1646 */ { - (yyval.u_direction_argument) = malloc(sizeof(struct direction_argument_s)); - (yyval.u_direction_argument)->direction = (yyvsp[0].u_str); - } + (yyval.u_direction_argument) = + malloc(sizeof(struct direction_argument_s)); + (yyval.u_direction_argument)->direction = (yyvsp[0].u_str); + } +#line 1631 "parser.c" /* yacc.c:1646 */ break; - case 26: -#line 283 "parser.y" + case 27: +#line 290 "parser.y" /* yacc.c:1646 */ { - (yyval.u_target_specifier) = malloc(sizeof(struct target_specifier_s)); - (yyval.u_target_specifier)->type = TOK_ACCEPT; - } + (yyval.u_target_specifier) = malloc(sizeof(struct target_specifier_s)); + (yyval.u_target_specifier)->type = TOK_ACCEPT; + } +#line 1640 "parser.c" /* yacc.c:1646 */ break; - case 27: -#line 288 "parser.y" + case 28: +#line 295 "parser.y" /* yacc.c:1646 */ { - (yyval.u_target_specifier) = malloc(sizeof(struct target_specifier_s)); - (yyval.u_target_specifier)->type = TOK_REJECT; - } + (yyval.u_target_specifier) = malloc(sizeof(struct target_specifier_s)); + (yyval.u_target_specifier)->type = TOK_REJECT; + } +#line 1649 "parser.c" /* yacc.c:1646 */ break; - case 28: -#line 293 "parser.y" + case 29: +#line 300 "parser.y" /* yacc.c:1646 */ { - (yyval.u_target_specifier) = malloc(sizeof(struct target_specifier_s)); - (yyval.u_target_specifier)->type = TOK_DROP; - } + (yyval.u_target_specifier) = malloc(sizeof(struct target_specifier_s)); + (yyval.u_target_specifier)->type = TOK_DROP; + } +#line 1658 "parser.c" /* yacc.c:1646 */ break; - case 29: -#line 298 "parser.y" + case 30: +#line 305 "parser.y" /* yacc.c:1646 */ { - (yyval.u_target_specifier) = malloc(sizeof(struct target_specifier_s)); - (yyval.u_target_specifier)->type = TOK_MASQ; - } + (yyval.u_target_specifier) = malloc(sizeof(struct target_specifier_s)); + (yyval.u_target_specifier)->type = TOK_MASQ; + } +#line 1667 "parser.c" /* yacc.c:1646 */ break; - case 30: -#line 303 "parser.y" + case 31: +#line 310 "parser.y" /* yacc.c:1646 */ { - (yyval.u_target_specifier) = malloc(sizeof(struct target_specifier_s)); - (yyval.u_target_specifier)->type = TOK_PROXY; - } + (yyval.u_target_specifier) = malloc(sizeof(struct target_specifier_s)); + (yyval.u_target_specifier)->type = TOK_PROXY; + } +#line 1676 "parser.c" /* yacc.c:1646 */ break; - case 31: -#line 308 "parser.y" + case 32: +#line 315 "parser.y" /* yacc.c:1646 */ { - (yyval.u_target_specifier) = malloc(sizeof(struct target_specifier_s)); - (yyval.u_target_specifier)->type = TOK_REDIRECT; - } + (yyval.u_target_specifier) = malloc(sizeof(struct target_specifier_s)); + (yyval.u_target_specifier)->type = TOK_REDIRECT; + } +#line 1685 "parser.c" /* yacc.c:1646 */ break; - case 32: -#line 315 "parser.y" + case 33: +#line 322 "parser.y" /* yacc.c:1646 */ { - (yyval.u_host_specifier) = malloc(sizeof(struct host_specifier_s)); - (yyval.u_host_specifier)->type = TOK_SOURCE; - (yyval.u_host_specifier)->list = (yyvsp[0].u_host_argument_list); - } + (yyval.u_host_specifier) = malloc(sizeof(struct host_specifier_s)); + (yyval.u_host_specifier)->type = TOK_SOURCE; + (yyval.u_host_specifier)->list = (yyvsp[0].u_host_argument_list); + } +#line 1695 "parser.c" /* yacc.c:1646 */ break; - case 33: -#line 321 "parser.y" + case 34: +#line 328 "parser.y" /* yacc.c:1646 */ { - (yyval.u_host_specifier) = malloc(sizeof(struct host_specifier_s)); - (yyval.u_host_specifier)->type = TOK_DEST; - (yyval.u_host_specifier)->list = (yyvsp[0].u_host_argument_list); - } + (yyval.u_host_specifier) = malloc(sizeof(struct host_specifier_s)); + (yyval.u_host_specifier)->type = TOK_DEST; + (yyval.u_host_specifier)->list = (yyvsp[0].u_host_argument_list); + } +#line 1705 "parser.c" /* yacc.c:1646 */ break; - case 34: -#line 329 "parser.y" + case 35: +#line 336 "parser.y" /* yacc.c:1646 */ { - (yyval.u_host_argument_list) = (yyvsp[0].u_host_argument_list); - } + (yyval.u_host_argument_list) = (yyvsp[0].u_host_argument_list); + } +#line 1713 "parser.c" /* yacc.c:1646 */ break; - case 35: -#line 333 "parser.y" + case 36: +#line 340 "parser.y" /* yacc.c:1646 */ { - (yyval.u_host_argument_list) = (yyvsp[-1].u_host_argument_list); - } + (yyval.u_host_argument_list) = (yyvsp[-1].u_host_argument_list); + } +#line 1721 "parser.c" /* yacc.c:1646 */ break; - case 36: -#line 339 "parser.y" + case 37: +#line 346 "parser.y" /* yacc.c:1646 */ { - (yyval.u_host_argument_list) = NULL; - } + (yyval.u_host_argument_list) = NULL; + } +#line 1729 "parser.c" /* yacc.c:1646 */ break; - case 37: -#line 343 "parser.y" + case 38: +#line 350 "parser.y" /* yacc.c:1646 */ { - (yyval.u_host_argument_list) = malloc(sizeof(struct host_argument_list_s)); - (yyval.u_host_argument_list)->list = (yyvsp[-1].u_host_argument_list); - (yyval.u_host_argument_list)->arg = (yyvsp[0].u_host_argument); - } + (yyval.u_host_argument_list) = + malloc(sizeof(struct host_argument_list_s)); + (yyval.u_host_argument_list)->list = (yyvsp[-1].u_host_argument_list); + (yyval.u_host_argument_list)->arg = (yyvsp[0].u_host_argument); + } +#line 1739 "parser.c" /* yacc.c:1646 */ break; - case 38: -#line 351 "parser.y" + case 39: +#line 358 "parser.y" /* yacc.c:1646 */ { - (yyval.u_host_argument) = malloc(sizeof(struct host_argument_s)); - (yyval.u_host_argument)->host = (yyvsp[-2].u_str); - (yyval.u_host_argument)->mask = (yyvsp[0].u_str); - } + (yyval.u_host_argument) = malloc(sizeof(struct host_argument_s)); + (yyval.u_host_argument)->host = (yyvsp[-2].u_str); + (yyval.u_host_argument)->mask = (yyvsp[0].u_str); + } +#line 1749 "parser.c" /* yacc.c:1646 */ break; - case 39: -#line 357 "parser.y" + case 40: +#line 364 "parser.y" /* yacc.c:1646 */ { - (yyval.u_host_argument) = malloc(sizeof(struct host_argument_s)); - (yyval.u_host_argument)->host = (yyvsp[0].u_str); - (yyval.u_host_argument)->mask = 0; - } + (yyval.u_host_argument) = malloc(sizeof(struct host_argument_s)); + (yyval.u_host_argument)->host = (yyvsp[0].u_str); + (yyval.u_host_argument)->mask = 0; + } +#line 1759 "parser.c" /* yacc.c:1646 */ break; - case 40: -#line 365 "parser.y" + case 41: +#line 372 "parser.y" /* yacc.c:1646 */ { - (yyval.u_port_specifier) = malloc(sizeof(struct port_specifier_s)); - (yyval.u_port_specifier)->type = TOK_SPORT; - (yyval.u_port_specifier)->list = (yyvsp[0].u_port_argument_list); - } + (yyval.u_port_specifier) = malloc(sizeof(struct port_specifier_s)); + (yyval.u_port_specifier)->type = TOK_SPORT; + (yyval.u_port_specifier)->list = (yyvsp[0].u_port_argument_list); + } +#line 1769 "parser.c" /* yacc.c:1646 */ break; - case 41: -#line 371 "parser.y" + case 42: +#line 378 "parser.y" /* yacc.c:1646 */ { - (yyval.u_port_specifier) = malloc(sizeof(struct port_specifier_s)); - (yyval.u_port_specifier)->type = TOK_DPORT; - (yyval.u_port_specifier)->list = (yyvsp[0].u_port_argument_list); - } + (yyval.u_port_specifier) = malloc(sizeof(struct port_specifier_s)); + (yyval.u_port_specifier)->type = TOK_DPORT; + (yyval.u_port_specifier)->list = (yyvsp[0].u_port_argument_list); + } +#line 1779 "parser.c" /* yacc.c:1646 */ break; - case 42: -#line 379 "parser.y" + case 43: +#line 386 "parser.y" /* yacc.c:1646 */ { - (yyval.u_port_argument_list) = (yyvsp[0].u_port_argument_list); - } + (yyval.u_port_argument_list) = (yyvsp[0].u_port_argument_list); + } +#line 1787 "parser.c" /* yacc.c:1646 */ break; - case 43: -#line 383 "parser.y" + case 44: +#line 390 "parser.y" /* yacc.c:1646 */ { - (yyval.u_port_argument_list) = (yyvsp[-1].u_port_argument_list); - } + (yyval.u_port_argument_list) = (yyvsp[-1].u_port_argument_list); + } +#line 1795 "parser.c" /* yacc.c:1646 */ break; - case 44: -#line 388 "parser.y" + case 45: +#line 395 "parser.y" /* yacc.c:1646 */ { - (yyval.u_port_argument_list) = malloc(sizeof(struct port_argument_list_s)); - (yyval.u_port_argument_list)->list = NULL; - (yyval.u_port_argument_list)->arg = (yyvsp[0].u_port_argument); - } + (yyval.u_port_argument_list) = + malloc(sizeof(struct port_argument_list_s)); + (yyval.u_port_argument_list)->list = NULL; + (yyval.u_port_argument_list)->arg = (yyvsp[0].u_port_argument); + } +#line 1805 "parser.c" /* yacc.c:1646 */ break; - case 45: -#line 394 "parser.y" + case 46: +#line 401 "parser.y" /* yacc.c:1646 */ { - (yyval.u_port_argument_list) = malloc(sizeof(struct port_argument_list_s)); - (yyval.u_port_argument_list)->list = (yyvsp[-1].u_port_argument_list); - (yyval.u_port_argument_list)->arg = (yyvsp[0].u_port_argument); - } + (yyval.u_port_argument_list) = + malloc(sizeof(struct port_argument_list_s)); + (yyval.u_port_argument_list)->list = (yyvsp[-1].u_port_argument_list); + (yyval.u_port_argument_list)->arg = (yyvsp[0].u_port_argument); + } +#line 1815 "parser.c" /* yacc.c:1646 */ break; - case 46: -#line 402 "parser.y" + case 47: +#line 409 "parser.y" /* yacc.c:1646 */ { - (yyval.u_port_argument) = malloc(sizeof(struct port_argument_s)); - (yyval.u_port_argument)->port_min = (yyvsp[-2].u_str); - (yyval.u_port_argument)->port_max = (yyvsp[0].u_str); - } + (yyval.u_port_argument) = malloc(sizeof(struct port_argument_s)); + (yyval.u_port_argument)->port_min = (yyvsp[-2].u_str); + (yyval.u_port_argument)->port_max = (yyvsp[0].u_str); + } +#line 1825 "parser.c" /* yacc.c:1646 */ break; - case 47: -#line 408 "parser.y" + case 48: +#line 415 "parser.y" /* yacc.c:1646 */ { - (yyval.u_port_argument) = malloc(sizeof(struct port_argument_s)); - (yyval.u_port_argument)->port_min = (yyvsp[0].u_str); - (yyval.u_port_argument)->port_max = NULL; - } + (yyval.u_port_argument) = malloc(sizeof(struct port_argument_s)); + (yyval.u_port_argument)->port_min = (yyvsp[0].u_str); + (yyval.u_port_argument)->port_max = NULL; + } +#line 1835 "parser.c" /* yacc.c:1646 */ break; - case 48: -#line 416 "parser.y" + case 49: +#line 423 "parser.y" /* yacc.c:1646 */ { - (yyval.u_protocol_specifier) = malloc(sizeof(struct protocol_specifier_s)); - (yyval.u_protocol_specifier)->list = (yyvsp[0].u_protocol_argument_list); - } + (yyval.u_protocol_specifier) = + malloc(sizeof(struct protocol_specifier_s)); + (yyval.u_protocol_specifier)->list = + (yyvsp[0].u_protocol_argument_list); + } +#line 1844 "parser.c" /* yacc.c:1646 */ break; - case 49: -#line 423 "parser.y" + case 50: +#line 430 "parser.y" /* yacc.c:1646 */ { - (yyval.u_protocol_argument_list) = (yyvsp[0].u_protocol_argument_list); - } + (yyval.u_protocol_argument_list) = (yyvsp[0].u_protocol_argument_list); + } +#line 1852 "parser.c" /* yacc.c:1646 */ break; - case 50: -#line 427 "parser.y" + case 51: +#line 434 "parser.y" /* yacc.c:1646 */ { - (yyval.u_protocol_argument_list) = (yyvsp[-1].u_protocol_argument_list); - } + (yyval.u_protocol_argument_list) = (yyvsp[-1].u_protocol_argument_list); + } +#line 1860 "parser.c" /* yacc.c:1646 */ break; - case 51: -#line 433 "parser.y" + case 52: +#line 440 "parser.y" /* yacc.c:1646 */ { - (yyval.u_protocol_argument_list) = NULL; - } + (yyval.u_protocol_argument_list) = NULL; + } +#line 1868 "parser.c" /* yacc.c:1646 */ break; - case 52: -#line 437 "parser.y" + case 53: +#line 444 "parser.y" /* yacc.c:1646 */ { - (yyval.u_protocol_argument_list) = malloc(sizeof(struct protocol_argument_list_s)); - (yyval.u_protocol_argument_list)->list = (yyvsp[-1].u_protocol_argument_list); - (yyval.u_protocol_argument_list)->arg = (yyvsp[0].u_protocol_argument); - } + (yyval.u_protocol_argument_list) = + malloc(sizeof(struct protocol_argument_list_s)); + (yyval.u_protocol_argument_list)->list = + (yyvsp[-1].u_protocol_argument_list); + (yyval.u_protocol_argument_list)->arg = (yyvsp[0].u_protocol_argument); + } +#line 1878 "parser.c" /* yacc.c:1646 */ break; - case 53: -#line 445 "parser.y" + case 54: +#line 452 "parser.y" /* yacc.c:1646 */ { - (yyval.u_protocol_argument) = malloc(sizeof(struct protocol_argument_s)); - (yyval.u_protocol_argument)->proto = strdup((yyvsp[0].u_str)); - } + (yyval.u_protocol_argument) = + malloc(sizeof(struct protocol_argument_s)); + (yyval.u_protocol_argument)->proto = strdup((yyvsp[0].u_str)); + } +#line 1887 "parser.c" /* yacc.c:1646 */ break; - case 54: -#line 452 "parser.y" + case 55: +#line 459 "parser.y" /* yacc.c:1646 */ { - (yyval.u_icmptype_specifier) = malloc(sizeof(struct icmptype_specifier_s)); - (yyval.u_icmptype_specifier)->list = (yyvsp[0].u_icmptype_argument_list); - } + (yyval.u_icmptype_specifier) = + malloc(sizeof(struct icmptype_specifier_s)); + (yyval.u_icmptype_specifier)->list = + (yyvsp[0].u_icmptype_argument_list); + } +#line 1896 "parser.c" /* yacc.c:1646 */ break; - case 55: -#line 459 "parser.y" + case 56: +#line 466 "parser.y" /* yacc.c:1646 */ { - (yyval.u_icmptype_argument_list) = (yyvsp[0].u_icmptype_argument_list); - } + (yyval.u_icmptype_argument_list) = (yyvsp[0].u_icmptype_argument_list); + } +#line 1904 "parser.c" /* yacc.c:1646 */ break; - case 56: -#line 463 "parser.y" + case 57: +#line 470 "parser.y" /* yacc.c:1646 */ { - (yyval.u_icmptype_argument_list) = (yyvsp[-1].u_icmptype_argument_list); - } + (yyval.u_icmptype_argument_list) = (yyvsp[-1].u_icmptype_argument_list); + } +#line 1912 "parser.c" /* yacc.c:1646 */ break; - case 57: -#line 469 "parser.y" + case 58: +#line 476 "parser.y" /* yacc.c:1646 */ { - (yyval.u_icmptype_argument_list) = NULL; - } + (yyval.u_icmptype_argument_list) = NULL; + } +#line 1920 "parser.c" /* yacc.c:1646 */ break; - case 58: -#line 473 "parser.y" + case 59: +#line 480 "parser.y" /* yacc.c:1646 */ { - (yyval.u_icmptype_argument_list) = malloc(sizeof(struct icmptype_argument_list_s)); - (yyval.u_icmptype_argument_list)->list = (yyvsp[-1].u_icmptype_argument_list); - (yyval.u_icmptype_argument_list)->arg = (yyvsp[0].u_icmptype_argument); - } + (yyval.u_icmptype_argument_list) = + malloc(sizeof(struct icmptype_argument_list_s)); + (yyval.u_icmptype_argument_list)->list = + (yyvsp[-1].u_icmptype_argument_list); + (yyval.u_icmptype_argument_list)->arg = (yyvsp[0].u_icmptype_argument); + } +#line 1930 "parser.c" /* yacc.c:1646 */ break; - case 59: -#line 481 "parser.y" + case 60: +#line 488 "parser.y" /* yacc.c:1646 */ { - (yyval.u_icmptype_argument) = malloc(sizeof(struct icmptype_argument_s)); - (yyval.u_icmptype_argument)->icmptype = (yyvsp[0].u_str); - } + (yyval.u_icmptype_argument) = + malloc(sizeof(struct icmptype_argument_s)); + (yyval.u_icmptype_argument)->icmptype = (yyvsp[0].u_str); + } +#line 1939 "parser.c" /* yacc.c:1646 */ break; - case 60: -#line 488 "parser.y" + case 61: +#line 495 "parser.y" /* yacc.c:1646 */ { - (yyval.u_option_specifier) = malloc(sizeof(struct option_specifier_s)); - (yyval.u_option_specifier)->type = TOK_LOCAL; - (yyval.u_option_specifier)->logmsg = 0; - } + (yyval.u_option_specifier) = malloc(sizeof(struct option_specifier_s)); + (yyval.u_option_specifier)->type = TOK_LOCAL; + (yyval.u_option_specifier)->logmsg = 0; + } +#line 1949 "parser.c" /* yacc.c:1646 */ break; - case 61: -#line 494 "parser.y" + case 62: +#line 501 "parser.y" /* yacc.c:1646 */ { - (yyval.u_option_specifier) = malloc(sizeof(struct option_specifier_s)); - (yyval.u_option_specifier)->type = TOK_FORWARD; - (yyval.u_option_specifier)->logmsg = 0; - } + (yyval.u_option_specifier) = malloc(sizeof(struct option_specifier_s)); + (yyval.u_option_specifier)->type = TOK_FORWARD; + (yyval.u_option_specifier)->logmsg = 0; + } +#line 1959 "parser.c" /* yacc.c:1646 */ break; - case 62: -#line 500 "parser.y" + case 63: +#line 507 "parser.y" /* yacc.c:1646 */ { - (yyval.u_option_specifier) = malloc(sizeof(struct option_specifier_s)); - (yyval.u_option_specifier)->type = TOK_ONEWAY; - (yyval.u_option_specifier)->logmsg = 0; - } + (yyval.u_option_specifier) = malloc(sizeof(struct option_specifier_s)); + (yyval.u_option_specifier)->type = TOK_ONEWAY; + (yyval.u_option_specifier)->logmsg = 0; + } +#line 1969 "parser.c" /* yacc.c:1646 */ break; - case 63: -#line 506 "parser.y" + case 64: +#line 513 "parser.y" /* yacc.c:1646 */ { - (yyval.u_option_specifier) = malloc(sizeof(struct option_specifier_s)); - (yyval.u_option_specifier)->type = TOK_LOG; - (yyval.u_option_specifier)->logmsg = (yyvsp[0].u_str); - } + (yyval.u_option_specifier) = malloc(sizeof(struct option_specifier_s)); + (yyval.u_option_specifier)->type = TOK_LOG; + (yyval.u_option_specifier)->logmsg = (yyvsp[0].u_str); + } +#line 1979 "parser.c" /* yacc.c:1646 */ break; - case 64: -#line 512 "parser.y" + case 65: +#line 519 "parser.y" /* yacc.c:1646 */ { - (yyval.u_option_specifier) = malloc(sizeof(struct option_specifier_s)); - (yyval.u_option_specifier)->type = TOK_LOG; - (yyval.u_option_specifier)->logmsg = 0; - } + (yyval.u_option_specifier) = malloc(sizeof(struct option_specifier_s)); + (yyval.u_option_specifier)->type = TOK_LOG; + (yyval.u_option_specifier)->logmsg = 0; + } +#line 1989 "parser.c" /* yacc.c:1646 */ break; - case 65: -#line 520 "parser.y" + case 66: +#line 527 "parser.y" /* yacc.c:1646 */ { - (yyval.u_compound_specifier) = malloc(sizeof(struct compound_specifier_s)); - (yyval.u_compound_specifier)->list = (yyvsp[-1].u_subrule_list); - } + (yyval.u_compound_specifier) = + malloc(sizeof(struct compound_specifier_s)); + (yyval.u_compound_specifier)->list = (yyvsp[-1].u_subrule_list); + } +#line 1998 "parser.c" /* yacc.c:1646 */ break; - case 66: -#line 527 "parser.y" + case 67: +#line 534 "parser.y" /* yacc.c:1646 */ { - (yyval.u_subrule_list) = malloc(sizeof(struct subrule_list_s)); - (yyval.u_subrule_list)->subrule_list = NULL; - (yyval.u_subrule_list)->specifier_list = (yyvsp[0].u_specifier_list); - } + (yyval.u_subrule_list) = malloc(sizeof(struct subrule_list_s)); + (yyval.u_subrule_list)->subrule_list = NULL; + (yyval.u_subrule_list)->specifier_list = (yyvsp[0].u_specifier_list); + } +#line 2008 "parser.c" /* yacc.c:1646 */ break; - case 67: -#line 533 "parser.y" + case 68: +#line 540 "parser.y" /* yacc.c:1646 */ { - (yyval.u_subrule_list) = malloc(sizeof(struct subrule_list_s)); - (yyval.u_subrule_list)->subrule_list = (yyvsp[-2].u_subrule_list); - (yyval.u_subrule_list)->specifier_list = (yyvsp[0].u_specifier_list); - } + (yyval.u_subrule_list) = malloc(sizeof(struct subrule_list_s)); + (yyval.u_subrule_list)->subrule_list = (yyvsp[-2].u_subrule_list); + (yyval.u_subrule_list)->specifier_list = (yyvsp[0].u_specifier_list); + } +#line 2018 "parser.c" /* yacc.c:1646 */ break; - case 68: -#line 541 "parser.y" + case 69: +#line 548 "parser.y" /* yacc.c:1646 */ { - (yyval.u_chaingroup_specifier) = malloc(sizeof(struct chaingroup_specifier_s)); - (yyval.u_chaingroup_specifier)->name = (yyvsp[-2].u_str); - (yyval.u_chaingroup_specifier)->list = (yyvsp[-1].u_subrule_list); - } + (yyval.u_chaingroup_specifier) = + malloc(sizeof(struct chaingroup_specifier_s)); + (yyval.u_chaingroup_specifier)->name = (yyvsp[-2].u_str); + (yyval.u_chaingroup_specifier)->list = (yyvsp[-1].u_subrule_list); + } +#line 2028 "parser.c" /* yacc.c:1646 */ break; - case 69: -#line 547 "parser.y" + case 70: +#line 554 "parser.y" /* yacc.c:1646 */ { - (yyval.u_chaingroup_specifier) = malloc(sizeof(struct chaingroup_specifier_s)); - (yyval.u_chaingroup_specifier)->name = NULL; - (yyval.u_chaingroup_specifier)->list = (yyvsp[-1].u_subrule_list); - } + (yyval.u_chaingroup_specifier) = + malloc(sizeof(struct chaingroup_specifier_s)); + (yyval.u_chaingroup_specifier)->name = NULL; + (yyval.u_chaingroup_specifier)->list = (yyvsp[-1].u_subrule_list); + } +#line 2038 "parser.c" /* yacc.c:1646 */ break; - +#line 2042 "parser.c" /* yacc.c:1646 */ + default: + break; } - -/* Line 1037 of yacc.c. */ -#line 1777 "parser.c" - - yyvsp -= yylen; - yyssp -= yylen; - - - YY_STACK_PRINT (yyss, yyssp); - - *++yyvsp = yyval; - - - /* Now `shift' the result of the reduction. Determine what state - that goes to, based on the state we popped back to and the rule - number reduced by. */ - - yyn = yyr1[yyn]; - - yystate = yypgoto[yyn - YYNTOKENS] + *yyssp; - if (0 <= yystate && yystate <= YYLAST && yycheck[yystate] == *yyssp) - yystate = yytable[yystate]; - else - yystate = yydefgoto[yyn - YYNTOKENS]; - - goto yynewstate; - - -/*------------------------------------. -| yyerrlab -- here on detecting error | -`------------------------------------*/ + /* User semantic actions sometimes alter yychar, and that requires + that yytoken be updated with the new translation. We take the + approach of translating immediately before every use of yytoken. + One alternative is translating here after every semantic action, + but that translation would be missed if the semantic action invokes + YYABORT, YYACCEPT, or YYERROR immediately after altering yychar or + if it invokes YYBACKUP. In the case of YYABORT or YYACCEPT, an + incorrect destructor might then be invoked immediately. In the + case of YYERROR or YYBACKUP, subsequent parser actions might lead + to an incorrect destructor call or verbose syntax error message + before the lookahead is translated. */ + YY_SYMBOL_PRINT("-> $$ =", yyr1[yyn], &yyval, &yyloc); + + YYPOPSTACK(yylen); + yylen = 0; + YY_STACK_PRINT(yyss, yyssp); + + *++yyvsp = yyval; + + /* Now 'shift' the result of the reduction. Determine what state + that goes to, based on the state we popped back to and the rule + number reduced by. */ + + yyn = yyr1[yyn]; + + yystate = yypgoto[yyn - YYNTOKENS] + *yyssp; + if (0 <= yystate && yystate <= YYLAST && yycheck[yystate] == *yyssp) + yystate = yytable[yystate]; + else + yystate = yydefgoto[yyn - YYNTOKENS]; + + goto yynewstate; + +/*--------------------------------------. +| yyerrlab -- here on detecting error. | +`--------------------------------------*/ yyerrlab: - /* If not already recovering from an error, report this error. */ - if (!yyerrstatus) - { - ++yynerrs; -#if YYERROR_VERBOSE - yyn = yypact[yystate]; - - if (YYPACT_NINF < yyn && yyn < YYLAST) - { - YYSIZE_T yysize = 0; - int yytype = YYTRANSLATE (yychar); - const char* yyprefix; - char *yymsg; - int yyx; - - /* Start YYX at -YYN if negative to avoid negative indexes in - YYCHECK. */ - int yyxbegin = yyn < 0 ? -yyn : 0; - - /* Stay within bounds of both yycheck and yytname. */ - int yychecklim = YYLAST - yyn; - int yyxend = yychecklim < YYNTOKENS ? yychecklim : YYNTOKENS; - int yycount = 0; - - yyprefix = ", expecting "; - for (yyx = yyxbegin; yyx < yyxend; ++yyx) - if (yycheck[yyx + yyn] == yyx && yyx != YYTERROR) - { - yysize += yystrlen (yyprefix) + yystrlen (yytname [yyx]); - yycount += 1; - if (yycount == 5) - { - yysize = 0; - break; - } - } - yysize += (sizeof ("syntax error, unexpected ") - + yystrlen (yytname[yytype])); - yymsg = (char *) YYSTACK_ALLOC (yysize); - if (yymsg != 0) - { - char *yyp = yystpcpy (yymsg, "syntax error, unexpected "); - yyp = yystpcpy (yyp, yytname[yytype]); - - if (yycount < 5) - { - yyprefix = ", expecting "; - for (yyx = yyxbegin; yyx < yyxend; ++yyx) - if (yycheck[yyx + yyn] == yyx && yyx != YYTERROR) - { - yyp = yystpcpy (yyp, yyprefix); - yyp = yystpcpy (yyp, yytname[yyx]); - yyprefix = " or "; - } - } - yyerror (yymsg); - YYSTACK_FREE (yymsg); - } - else - yyerror ("syntax error; also virtual memory exhausted"); - } - else -#endif /* YYERROR_VERBOSE */ - yyerror ("syntax error"); - } - - - - if (yyerrstatus == 3) - { - /* If just tried and failed to reuse look-ahead token after an - error, discard it. */ - - if (yychar <= YYEOF) + /* Make sure we have latest lookahead translation. See comments at + user semantic actions for why this is necessary. */ + yytoken = yychar == YYEMPTY ? YYEMPTY : YYTRANSLATE(yychar); + + /* If not already recovering from an error, report this error. */ + if (!yyerrstatus) { + ++yynerrs; +#if !YYERROR_VERBOSE + yyerror(parse_arg, YY_("syntax error")); +#else +#define YYSYNTAX_ERROR yysyntax_error(&yymsg_alloc, &yymsg, yyssp, yytoken) { - /* If at end of input, pop the error token, - then the rest of the stack, then return failure. */ - if (yychar == YYEOF) - for (;;) - { - - YYPOPSTACK; - if (yyssp == yyss) - YYABORT; - yydestruct ("Error: popping", - yystos[*yyssp], yyvsp); - } + char const *yymsgp = YY_("syntax error"); + int yysyntax_error_status; + yysyntax_error_status = YYSYNTAX_ERROR; + if (yysyntax_error_status == 0) + yymsgp = yymsg; + else if (yysyntax_error_status == 1) { + if (yymsg != yymsgbuf) + YYSTACK_FREE(yymsg); + yymsg = (char *)YYSTACK_ALLOC(yymsg_alloc); + if (!yymsg) { + yymsg = yymsgbuf; + yymsg_alloc = sizeof yymsgbuf; + yysyntax_error_status = 2; + } else { + yysyntax_error_status = YYSYNTAX_ERROR; + yymsgp = yymsg; + } + } + yyerror(parse_arg, yymsgp); + if (yysyntax_error_status == 2) + goto yyexhaustedlab; } - else - { - yydestruct ("Error: discarding", yytoken, &yylval); - yychar = YYEMPTY; - } +#undef YYSYNTAX_ERROR +#endif } - /* Else will try to reuse look-ahead token after shifting the error - token. */ - goto yyerrlab1; + if (yyerrstatus == 3) { + /* If just tried and failed to reuse lookahead token after an + error, discard it. */ + + if (yychar <= YYEOF) { + /* Return failure if at end of input. */ + if (yychar == YYEOF) + YYABORT; + } else { + yydestruct("Error: discarding", yytoken, &yylval, parse_arg); + yychar = YYEMPTY; + } + } + /* Else will try to reuse lookahead token after shifting the error + token. */ + goto yyerrlab1; /*---------------------------------------------------. | yyerrorlab -- error raised explicitly by YYERROR. | `---------------------------------------------------*/ yyerrorlab: -#ifdef __GNUC__ - /* Pacify GCC when the user code never invokes YYERROR and the label - yyerrorlab therefore never appears in user code. */ - if (0) - goto yyerrorlab; -#endif - -yyvsp -= yylen; - yyssp -= yylen; - yystate = *yyssp; - goto yyerrlab1; - + /* Pacify compilers like GCC when the user code never invokes + YYERROR and the label yyerrorlab therefore never appears in user + code. */ + if (/*CONSTCOND*/ 0) + goto yyerrorlab; + + /* Do not reclaim the symbols of the rule whose action triggered + this YYERROR. */ + YYPOPSTACK(yylen); + yylen = 0; + YY_STACK_PRINT(yyss, yyssp); + yystate = *yyssp; + goto yyerrlab1; /*-------------------------------------------------------------. | yyerrlab1 -- common code for both syntax error and YYERROR. | `-------------------------------------------------------------*/ yyerrlab1: - yyerrstatus = 3; /* Each real token shifted decrements this. */ - - for (;;) - { - yyn = yypact[yystate]; - if (yyn != YYPACT_NINF) - { - yyn += YYTERROR; - if (0 <= yyn && yyn <= YYLAST && yycheck[yyn] == YYTERROR) - { - yyn = yytable[yyn]; - if (0 < yyn) - break; - } - } - - /* Pop the current state because it cannot handle the error token. */ - if (yyssp == yyss) - YYABORT; + yyerrstatus = 3; /* Each real token shifted decrements this. */ + for (;;) { + yyn = yypact[yystate]; + if (!yypact_value_is_default(yyn)) { + yyn += YYTERROR; + if (0 <= yyn && yyn <= YYLAST && yycheck[yyn] == YYTERROR) { + yyn = yytable[yyn]; + if (0 < yyn) + break; + } + } - yydestruct ("Error: popping", yystos[yystate], yyvsp); - YYPOPSTACK; - yystate = *yyssp; - YY_STACK_PRINT (yyss, yyssp); + /* Pop the current state because it cannot handle the error token. */ + if (yyssp == yyss) + YYABORT; + + yydestruct("Error: popping", yystos[yystate], yyvsp, parse_arg); + YYPOPSTACK(1); + yystate = *yyssp; + YY_STACK_PRINT(yyss, yyssp); } - if (yyn == YYFINAL) - YYACCEPT; + YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN + *++yyvsp = yylval; + YY_IGNORE_MAYBE_UNINITIALIZED_END - *++yyvsp = yylval; - - - /* Shift the error token. */ - YY_SYMBOL_PRINT ("Shifting", yystos[yyn], yyvsp, yylsp); - - yystate = yyn; - goto yynewstate; + /* Shift the error token. */ + YY_SYMBOL_PRINT("Shifting", yystos[yyn], yyvsp, yylsp); + yystate = yyn; + goto yynewstate; /*-------------------------------------. | yyacceptlab -- YYACCEPT comes here. | `-------------------------------------*/ yyacceptlab: - yyresult = 0; - goto yyreturn; + yyresult = 0; + goto yyreturn; /*-----------------------------------. | yyabortlab -- YYABORT comes here. | `-----------------------------------*/ yyabortlab: - yydestruct ("Error: discarding lookahead", - yytoken, &yylval); - yychar = YYEMPTY; - yyresult = 1; - goto yyreturn; + yyresult = 1; + goto yyreturn; -#ifndef yyoverflow -/*----------------------------------------------. -| yyoverflowlab -- parser overflow comes here. | -`----------------------------------------------*/ -yyoverflowlab: - yyerror ("parser stack overflow"); - yyresult = 2; - /* Fall through. */ +#if !defined yyoverflow || YYERROR_VERBOSE +/*-------------------------------------------------. +| yyexhaustedlab -- memory exhaustion comes here. | +`-------------------------------------------------*/ +yyexhaustedlab: + yyerror(parse_arg, YY_("memory exhausted")); + yyresult = 2; +/* Fall through. */ #endif yyreturn: + if (yychar != YYEMPTY) { + /* Make sure we have latest lookahead translation. See comments at + user semantic actions for why this is necessary. */ + yytoken = YYTRANSLATE(yychar); + yydestruct("Cleanup: discarding lookahead", yytoken, &yylval, + parse_arg); + } + /* Do not reclaim the symbols of the rule whose action triggered + this YYABORT or YYACCEPT. */ + YYPOPSTACK(yylen); + YY_STACK_PRINT(yyss, yyssp); + while (yyssp != yyss) { + yydestruct("Cleanup: popping", yystos[*yyssp], yyvsp, parse_arg); + YYPOPSTACK(1); + } #ifndef yyoverflow - if (yyss != yyssa) - YYSTACK_FREE (yyss); + if (yyss != yyssa) + YYSTACK_FREE(yyss); #endif - return yyresult; +#if YYERROR_VERBOSE + if (yymsg != yymsgbuf) + YYSTACK_FREE(yymsg); +#endif + return yyresult; } +#line 561 "parser.y" /* yacc.c:1906 */ - -#line 554 "parser.y" - -char * filename(); +char *filename(); long int lineno(); -extern char * yytext; +extern char *yytext; -void yyerror(const char * s) { - fprintf(stderr, "%s:%ld: %s\n", filename(), lineno(), s); +void yyerror(void *parse_arg __attribute__((unused)), const char *s) { + fprintf(stderr, "%s:%ld: %s\n", filename(), lineno(), s); } -int yyprint(FILE * f, int type, YYSTYPE v) { - fprintf(f, "%d:\"%s\":%p", type, yytext, &v); - return 0; +int yyprint(FILE *f, int type, YYSTYPE v) { + fprintf(f, "%d:\"%s\":%p", type, yytext, (void *)&v); + return 0; } - diff -Nru filtergen-0.12.4/parser.h filtergen-0.12.7/parser.h --- filtergen-0.12.4/parser.h 2016-02-18 07:59:36.000000000 +0000 +++ filtergen-0.12.7/parser.h 2016-02-13 09:49:29.000000000 +0000 @@ -1,12 +1,13 @@ -/* A Bison parser, made by GNU Bison 2.0. */ +/* A Bison parser, made by GNU Bison 3.0.4. */ -/* Skeleton parser for Yacc-like parsing with Bison, - Copyright (C) 1984, 1989, 1990, 2000, 2001, 2002, 2003, 2004 Free Software Foundation, Inc. +/* Bison interface for Yacc-like parsers in C - This program is free software; you can redistribute it and/or modify + Copyright (C) 1984, 1989-1990, 2000-2015 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. + the Free Software Foundation, either version 3 of the License, 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 @@ -14,53 +15,69 @@ 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., 59 Temple Place - Suite 330, - Boston, MA 02111-1307, USA. */ - -/* As a special exception, when this file is copied by Bison into a - Bison output file, you may use that output file without restriction. - This special exception was added by the Free Software Foundation - in version 1.24 of Bison. */ + along with this program. If not, see . */ -/* Tokens. */ +/* As a special exception, you may create a larger work that contains + part or all of the Bison parser skeleton and distribute that work + under terms of your choice, so long as that work isn't itself a + parser generator using the skeleton or a modified version thereof + as a parser skeleton. Alternatively, if you modify or redistribute + the parser skeleton itself, you may (at your option) remove this + special exception, which will cause the skeleton and the resulting + Bison output files to be licensed under the GNU General Public + License without this special exception. + + This special exception was added by the Free Software Foundation in + version 2.2 of Bison. */ + +#ifndef YY_YY_PARSER_H_INCLUDED +#define YY_YY_PARSER_H_INCLUDED +/* Debug traces. */ +#ifndef YYDEBUG +#define YYDEBUG 1 +#endif +#if YYDEBUG +extern int yydebug; +#endif + +/* Token type. */ #ifndef YYTOKENTYPE -# define YYTOKENTYPE - /* Put the tokens into the symbol table, so that GDB and other debuggers - know about them. */ - enum yytokentype { - TOK_ACCEPT = 258, - TOK_DEST = 259, - TOK_DPORT = 260, - TOK_DROP = 261, - TOK_FORWARD = 262, - TOK_ICMPTYPE = 263, - TOK_INPUT = 264, - TOK_LCURLY = 265, - TOK_LOCAL = 266, - TOK_LOG = 267, - TOK_LSQUARE = 268, - TOK_MASQ = 269, - TOK_ONEWAY = 270, - TOK_OUTPUT = 271, - TOK_PROTO = 272, - TOK_PROXY = 273, - TOK_RCURLY = 274, - TOK_REDIRECT = 275, - TOK_REJECT = 276, - TOK_RSQUARE = 277, - TOK_SEMICOLON = 278, - TOK_SOURCE = 279, - TOK_SPORT = 280, - TOK_TEXT = 281, - TOK_IDENTIFIER = 282, - TOK_DOT = 283, - TOK_SLASH = 284, - TOK_ERR = 285, - TOK_BANG = 286, - TOK_COLON = 287 - }; +#define YYTOKENTYPE +enum yytokentype { + TOK_ACCEPT = 258, + TOK_DEST = 259, + TOK_DPORT = 260, + TOK_DROP = 261, + TOK_FORWARD = 262, + TOK_ICMPTYPE = 263, + TOK_INPUT = 264, + TOK_LCURLY = 265, + TOK_LOCAL = 266, + TOK_LOG = 267, + TOK_LSQUARE = 268, + TOK_MASQ = 269, + TOK_ONEWAY = 270, + TOK_OUTPUT = 271, + TOK_PROTO = 272, + TOK_PROXY = 273, + TOK_RCURLY = 274, + TOK_REDIRECT = 275, + TOK_REJECT = 276, + TOK_RSQUARE = 277, + TOK_SEMICOLON = 278, + TOK_SOURCE = 279, + TOK_SPORT = 280, + TOK_TEXT = 281, + TOK_IDENTIFIER = 282, + TOK_DOT = 283, + TOK_SLASH = 284, + TOK_ERR = 285, + TOK_BANG = 286, + TOK_COLON = 287, + TOK_STAR = 288 +}; #endif +/* Tokens. */ #define TOK_ACCEPT 258 #define TOK_DEST 259 #define TOK_DPORT 260 @@ -91,49 +108,52 @@ #define TOK_ERR 285 #define TOK_BANG 286 #define TOK_COLON 287 +#define TOK_STAR 288 +/* Value type. */ +#if !defined YYSTYPE && !defined YYSTYPE_IS_DECLARED +union YYSTYPE { +#line 34 "parser.y" /* yacc.c:1909 */ - -#if ! defined (YYSTYPE) && ! defined (YYSTYPE_IS_DECLARED) -#line 35 "parser.y" -typedef union YYSTYPE { - struct rule_list_s * u_rule_list; - struct rule_s * u_rule; - struct specifier_list_s * u_specifier_list; - struct negated_specifier_s * u_negated_specifier; - struct specifier_s * u_specifier; - struct direction_specifier_s * u_direction_specifier; - struct direction_argument_list_s * u_direction_argument_list; - struct direction_argument_s * u_direction_argument; - struct target_specifier_s * u_target_specifier; - struct log_target_specifier_s * u_log_target_specifier; - struct host_specifier_s * u_host_specifier; - struct host_argument_list_s * u_host_argument_list; - struct host_argument_s * u_host_argument; - struct port_specifier_s * u_port_specifier; - struct port_argument_list_s * u_port_argument_list; - struct port_argument_s * u_port_argument; - struct protocol_specifier_s * u_protocol_specifier; - struct protocol_argument_list_s * u_protocol_argument_list; - struct protocol_argument_s * u_protocol_argument; - struct icmptype_specifier_s * u_icmptype_specifier; - struct icmptype_argument_list_s * u_icmptype_argument_list; - struct icmptype_argument_s * u_icmptype_argument; - struct option_specifier_s * u_option_specifier; - struct compound_specifier_s * u_compound_specifier; - struct chaingroup_specifier_s * u_chaingroup_specifier; - struct subrule_list_s * u_subrule_list; - char * u_str; -} YYSTYPE; -/* Line 1318 of yacc.c. */ -#line 131 "y.tab.h" -# define yystype YYSTYPE /* obsolescent; will be withdrawn */ -# define YYSTYPE_IS_DECLARED 1 -# define YYSTYPE_IS_TRIVIAL 1 + struct rule_list_s *u_rule_list; + struct rule_s *u_rule; + struct specifier_list_s *u_specifier_list; + struct negated_specifier_s *u_negated_specifier; + struct specifier_s *u_specifier; + struct direction_specifier_s *u_direction_specifier; + struct direction_argument_list_s *u_direction_argument_list; + struct direction_argument_s *u_direction_argument; + struct target_specifier_s *u_target_specifier; + struct log_target_specifier_s *u_log_target_specifier; + struct host_specifier_s *u_host_specifier; + struct host_argument_list_s *u_host_argument_list; + struct host_argument_s *u_host_argument; + struct port_specifier_s *u_port_specifier; + struct port_argument_list_s *u_port_argument_list; + struct port_argument_s *u_port_argument; + struct protocol_specifier_s *u_protocol_specifier; + struct protocol_argument_list_s *u_protocol_argument_list; + struct protocol_argument_s *u_protocol_argument; + struct icmptype_specifier_s *u_icmptype_specifier; + struct icmptype_argument_list_s *u_icmptype_argument_list; + struct icmptype_argument_s *u_icmptype_argument; + struct option_specifier_s *u_option_specifier; + struct compound_specifier_s *u_compound_specifier; + struct chaingroup_specifier_s *u_chaingroup_specifier; + struct subrule_list_s *u_subrule_list; + char *u_str; + +#line 150 "parser.h" /* yacc.c:1909 */ +}; + +typedef union YYSTYPE YYSTYPE; +#define YYSTYPE_IS_TRIVIAL 1 +#define YYSTYPE_IS_DECLARED 1 #endif extern YYSTYPE yylval; +int yyparse(void *parse_arg); - +#endif /* !YY_YY_PARSER_H_INCLUDED */ diff -Nru filtergen-0.12.4/parser.y filtergen-0.12.7/parser.y --- filtergen-0.12.4/parser.y 2004-05-15 03:26:48.000000000 +0000 +++ filtergen-0.12.7/parser.y 2016-02-13 09:44:55.000000000 +0000 @@ -23,14 +23,13 @@ #include #include "ast.h" -#define YYPARSE_PARAM parm - -void yyerror(const char * s); +void yyerror(void *parse_arg, const char * s); extern int yylex(void); #define YYPRINT(f, t, v) yyprint(f, t, v) %} %debug +%parse-param {void *parse_arg} %union { struct rule_list_s * u_rule_list; @@ -123,6 +122,7 @@ %token TOK_ERR %token TOK_BANG %token TOK_COLON +%token TOK_STAR %{ int yyprint(FILE * f, int t, YYSTYPE v); %} @@ -130,9 +130,9 @@ %% ast: rule_list { - /* we expect parm to be already allocated, and that + /* we expect parse_arg to be already allocated, and that * it is of type (struct ast_s *) */ - ((struct ast_s *) parm)->list = $1; + ((struct ast_s *) parse_arg)->list = $1; } rule_list: /* empty */ @@ -258,6 +258,13 @@ { $$ = $2; } + | TOK_STAR + { + $$ = malloc(sizeof(struct direction_argument_list_s)); + $$->list = NULL; + $$->arg = malloc(sizeof(struct direction_argument_s)); + $$->arg->direction = strdup("*"); + } ; direction_argument_list_: /* empty */ @@ -556,11 +563,11 @@ long int lineno(); extern char * yytext; -void yyerror(const char * s) { +void yyerror(void * parse_arg __attribute__((unused)), const char * s) { fprintf(stderr, "%s:%ld: %s\n", filename(), lineno(), s); } int yyprint(FILE * f, int type, YYSTYPE v) { - fprintf(f, "%d:\"%s\":%p", type, yytext, &v); + fprintf(f, "%d:\"%s\":%p", type, yytext, (void *) &v); return 0; } diff -Nru filtergen-0.12.4/resolver.c filtergen-0.12.7/resolver.c --- filtergen-0.12.4/resolver.c 2016-02-18 07:59:36.000000000 +0000 +++ filtergen-0.12.7/resolver.c 2016-02-13 10:52:59.000000000 +0000 @@ -18,7 +18,7 @@ */ #include - +#include #include #include #include @@ -31,304 +31,338 @@ #include "ast.h" #include "icmpent.h" -void resolve_option_specifier(struct option_specifier_s * n __attribute__((unused))) { -} - -void resolve_icmptype_argument(struct icmptype_argument_s * n) { - struct icmpent_s * i; - - if (n->icmptype) { - if ((i = geticmpbyname(n->icmptype))) { - free(n->icmptype); - asprintf(&n->icmptype, "%s", i->i_type); - } else { - /* check that the icmptype is a number if we can't resolve it */ - //long m; - char * e; - - strtol(n->icmptype, &e, 10); - if (*e) { - fprintf(stderr, "warning: suspicious icmp type encountered: %s\n", n->icmptype); - } - } - } -} - -void resolve_icmptype_argument_list(struct icmptype_argument_list_s * n) { - if (n->list) { - resolve_icmptype_argument_list(n->list); - } - if (n->arg) { - resolve_icmptype_argument(n->arg); - } -} - -void resolve_icmptype_specifier(struct icmptype_specifier_s * n) { - if (n->list) { - resolve_icmptype_argument_list(n->list); - } -} - -void resolve_port_argument(struct port_argument_s * n) { - struct servent * s; - - if (n->port_min) { - /* try to resolve the port name */ - if ((s = getservbyname(n->port_min, NULL))) { - free(n->port_min); - asprintf(&n->port_min, "%d", ntohs(s->s_port)); - } else { - /* check that the port is a number if we can't resolve it */ - //long m; - char * e; - - strtol(n->port_min, &e, 10); - if (*e) { - fprintf(stderr, "warning: suspicious port name encountered: %s\n", n->port_min); - } - } - } - if (n->port_max) { - /* try to resolve the port name */ - if ((s = getservbyname(n->port_max, NULL))) { - free(n->port_max); - asprintf(&n->port_max, "%d", ntohs(s->s_port)); - } else { - /* check that the port is a number if we can't resolve it */ - //long m; - char * e; - - strtol(n->port_max, &e, 10); - if (*e) { - fprintf(stderr, "warning: suspicious port name encountered: %s\n", n->port_max); - } - } - } -} - -void resolve_port_argument_list(struct port_argument_list_s * n) { - if (n->list) { - resolve_port_argument_list(n->list); - } - if (n->arg) { - resolve_port_argument(n->arg); - } -} - -void resolve_port_specifier(struct port_specifier_s * n) { - if (n->list) { - resolve_port_argument_list(n->list); - } -} - -void resolve_protocol_argument(struct protocol_argument_s * n) { - struct protoent * p; - - if (n->proto) { - if ((p = getprotobyname(n->proto))) { - free(n->proto); - asprintf(&n->proto, "%d", p->p_proto); - } else { - /* check that the proto is a number if we can't resolve it */ - //long m; - char * e; - - strtol(n->proto, &e, 10); - if (*e) { - fprintf(stderr, "warning: suspicious protocol name encountered: %s\n", n->proto); - } - } - } -} +void resolve_option_specifier(struct option_specifier_s *n + __attribute__((unused))) {} -void resolve_protocol_argument_list(struct protocol_argument_list_s * n) { - if (n->list) { - resolve_protocol_argument_list(n->list); - } - if (n->arg) { - resolve_protocol_argument(n->arg); - } -} +void resolve_icmptype_argument(struct icmptype_argument_s *n) { + struct icmpent_s *i; -void resolve_protocol_specifier(struct protocol_specifier_s * n) { - if (n->list) { - resolve_protocol_argument_list(n->list); - } -} - -void resolve_host_argument(struct host_argument_s * n __attribute__((unused))) { -} - -void resolve_host_argument_list(struct host_argument_list_s * n) { - struct addrinfo * a = NULL, * i; - struct addrinfo hints; - int r; - struct host_argument_list_s * list = NULL; - struct host_argument_s * host = NULL; - - if (n->list) { - resolve_host_argument_list(n->list); - } - - if (n->arg) { - memset(&hints, 0, sizeof(struct addrinfo)); - /* any address family is good */ - hints.ai_family = PF_UNSPEC; - /* return hostname, though we don't use it, for debugging */ - hints.ai_flags = AI_CANONNAME; - /* limit so duplicate hosts aren't returned for each socktype */ - hints.ai_socktype = SOCK_STREAM; - - if (n->arg->host) { - r = getaddrinfo(n->arg->host, NULL, &hints, &a); - switch (r) { - case 0: - /* replace the hostname with the IP */ - free(n->arg->host); - /* getnameinfo does no allocation. */ - n->arg->host = malloc(NI_MAXHOST + 1); - if (getnameinfo(a->ai_addr, a->ai_addrlen, n->arg->host, NI_MAXHOST, NULL, 0, NI_NUMERICHOST) == 0) { - /* if there's more, create some more hosts */ - for (i = a->ai_next; i; i = i->ai_next) { - list = malloc(sizeof(struct host_argument_list_s)); - host = malloc(sizeof(struct host_argument_s)); - host->host = malloc(NI_MAXHOST + 1); - if (getnameinfo(i->ai_addr, i->ai_addrlen, host->host, NI_MAXHOST, NULL, 0, NI_NUMERICHOST) == 0) { - if (n->arg->mask) { - host->mask = strdup(n->arg->mask); - } - - /* insert the new node */ - list->arg = host; - list->list = n->list; - n->list = list; - } else { - fprintf(stderr, "warning: %s\n", strerror(errno)); - } - } - } else { - fprintf(stderr, "warning: %s\n", strerror(errno)); - } - freeaddrinfo(a); - break; - default: - fprintf(stderr, "warning: %s: %s\n", gai_strerror(r), n->arg->host); - break; + if (n->icmptype) { + if ((i = geticmpbyname(n->icmptype))) { + free(n->icmptype); + if (asprintf(&n->icmptype, "%s", i->i_type) < 0) { + n->icmptype = NULL; + fprintf( + stderr, + "error: asprintf allocation failed when converting icmptype %s\n", + i->i_type); + } + } else { + /* check that the icmptype is a number if we can't resolve it */ + long m; + char *e; + + m = strtol(n->icmptype, &e, 10); + if (*e || m == LONG_MIN || m == LONG_MAX) { + fprintf(stderr, "warning: suspicious icmp type encountered: %s\n", + n->icmptype); + } + } + } +} + +void resolve_icmptype_argument_list(struct icmptype_argument_list_s *n) { + if (n->list) { + resolve_icmptype_argument_list(n->list); + } + if (n->arg) { + resolve_icmptype_argument(n->arg); + } +} + +void resolve_icmptype_specifier(struct icmptype_specifier_s *n) { + if (n->list) { + resolve_icmptype_argument_list(n->list); + } +} + +void resolve_port_argument(struct port_argument_s *n) { + struct servent *s; + + if (n->port_min) { + /* try to resolve the port name */ + if ((s = getservbyname(n->port_min, NULL))) { + free(n->port_min); + if (asprintf(&n->port_min, "%d", ntohs(s->s_port)) < 0) { + n->port_min = NULL; + fprintf(stderr, + "error: asprintf allocation failed when resolving port %d\n", + ntohs(s->s_port)); + } + } else { + /* check that the port is a number if we can't resolve it */ + long m; + char *e; + + m = strtol(n->port_min, &e, 10); + if (*e || m == LONG_MIN || m == LONG_MAX) { + fprintf(stderr, "warning: suspicious port name encountered: %s\n", + n->port_min); + } + } + } + if (n->port_max) { + /* try to resolve the port name */ + if ((s = getservbyname(n->port_max, NULL))) { + free(n->port_max); + if (asprintf(&n->port_max, "%d", ntohs(s->s_port)) < 0) { + n->port_max = NULL; + fprintf(stderr, + "error: asprintf allocation failed when resolving port %d\n", + ntohs(s->s_port)); + } + } else { + /* check that the port is a number if we can't resolve it */ + long m; + char *e; + + m = strtol(n->port_max, &e, 10); + if (*e || m == LONG_MIN || m == LONG_MAX) { + fprintf(stderr, "warning: suspicious port name encountered: %s\n", + n->port_max); + } + } + } +} + +void resolve_port_argument_list(struct port_argument_list_s *n) { + if (n->list) { + resolve_port_argument_list(n->list); + } + if (n->arg) { + resolve_port_argument(n->arg); + } +} + +void resolve_port_specifier(struct port_specifier_s *n) { + if (n->list) { + resolve_port_argument_list(n->list); + } +} + +void resolve_protocol_argument(struct protocol_argument_s *n) { + struct protoent *p; + + if (n->proto) { + if ((p = getprotobyname(n->proto))) { + free(n->proto); + if (asprintf(&n->proto, "%d", p->p_proto) < 0) { + n->proto = NULL; + fprintf( + stderr, + "error: asprintf allocation failed when converting protocol %d\n", + p->p_proto); + } + } else { + /* check that the proto is a number if we can't resolve it */ + long m; + char *e; + + m = strtol(n->proto, &e, 10); + if (*e || m == LONG_MIN || m == LONG_MAX) { + fprintf(stderr, "warning: suspicious protocol name encountered: %s\n", + n->proto); + } + } + } +} + +void resolve_protocol_argument_list(struct protocol_argument_list_s *n) { + if (n->list) { + resolve_protocol_argument_list(n->list); + } + if (n->arg) { + resolve_protocol_argument(n->arg); + } +} + +void resolve_protocol_specifier(struct protocol_specifier_s *n) { + if (n->list) { + resolve_protocol_argument_list(n->list); + } +} + +void resolve_host_argument(struct host_argument_s *n __attribute__((unused))) {} + +void resolve_host_argument_list(struct host_argument_list_s *n, + struct filtergen_opts *o) { + struct addrinfo *a = NULL, *i; + struct addrinfo hints; + int r; + struct host_argument_list_s *list = NULL; + struct host_argument_s *host = NULL; + + if (n->list) { + resolve_host_argument_list(n->list, o); + } + + if (n->arg) { + memset(&hints, 0, sizeof(struct addrinfo)); + /* use our chosen address family */ + hints.ai_family = o->family; + /* return hostname, though we don't use it, for debugging */ + hints.ai_flags = AI_CANONNAME; + /* limit so duplicate hosts aren't returned for each socktype */ + hints.ai_socktype = SOCK_STREAM; + + if (n->arg->host) { + r = getaddrinfo(n->arg->host, NULL, &hints, &a); + switch (r) { + case 0: + /* replace the hostname with the IP */ + free(n->arg->host); + /* getnameinfo does no allocation. */ + n->arg->host = malloc(NI_MAXHOST + 1); + if (getnameinfo(a->ai_addr, a->ai_addrlen, n->arg->host, NI_MAXHOST, + NULL, 0, NI_NUMERICHOST) == 0) { + /* if there's more, create some more hosts */ + for (i = a->ai_next; i; i = i->ai_next) { + list = malloc(sizeof(struct host_argument_list_s)); + host = malloc(sizeof(struct host_argument_s)); + host->host = malloc(NI_MAXHOST + 1); + if (getnameinfo(i->ai_addr, i->ai_addrlen, host->host, NI_MAXHOST, + NULL, 0, NI_NUMERICHOST) == 0) { + if (n->arg->mask) { + host->mask = strdup(n->arg->mask); + } + + /* insert the new node */ + list->arg = host; + list->list = n->list; + n->list = list; + } else { + fprintf(stderr, "warning: %s\n", strerror(errno)); } + } + } else { + fprintf(stderr, "warning: %s\n", strerror(errno)); } - } -} - -void resolve_host_specifier(struct host_specifier_s * n) { - if (n->list) { - resolve_host_argument_list(n->list); - } -} - -void resolve_target_specifier(struct target_specifier_s * n __attribute__((unused))) { -} - -void resolve_direction_argument(struct direction_argument_s * n __attribute__((unused))) { -} - -void resolve_direction_argument_list(struct direction_argument_list_s * n) { - if (n->list) { - resolve_direction_argument_list(n->list); - } - if (n->arg) { - resolve_direction_argument(n->arg); - } -} - -void resolve_direction_specifier(struct direction_specifier_s * n) { - if (n->list) { - resolve_direction_argument_list(n->list); - } -} - -void resolve_specifier_list(struct specifier_list_s * n); - -void resolve_subrule_list(struct subrule_list_s * n) { - if (n->subrule_list) { - resolve_subrule_list(n->subrule_list); - } - if (n->specifier_list) { - resolve_specifier_list(n->specifier_list); - } -} - -void resolve_chaingroup_specifier(struct chaingroup_specifier_s * n) { - if (n->list) { - resolve_subrule_list(n->list); - } -} - -void resolve_compound_specifier(struct compound_specifier_s * n) { - if (n->list) { - resolve_subrule_list(n->list); - } -} - -void resolve_specifier(struct specifier_s * n) { - if (n->compound) { - resolve_compound_specifier(n->compound); - } else if (n->direction) { - resolve_direction_specifier(n->direction); - } else if (n->target) { - resolve_target_specifier(n->target); - } else if (n->host) { - resolve_host_specifier(n->host); - } else if (n->port) { - resolve_port_specifier(n->port); - } else if (n->protocol) { - resolve_protocol_specifier(n->protocol); - } else if (n->icmptype) { - resolve_icmptype_specifier(n->icmptype); - } else if (n->option) { - resolve_option_specifier(n->option); - } else if (n->chaingroup) { - resolve_chaingroup_specifier(n->chaingroup); - } -} - -void resolve_negated_specifier(struct negated_specifier_s * n) { - if (n->spec) { - resolve_specifier(n->spec); - } -} - -void resolve_specifier_list(struct specifier_list_s * n) { - if (n->list) { - resolve_specifier_list(n->list); - } - if (n->spec) { - resolve_negated_specifier(n->spec); - } -} - -void resolve_rule(struct rule_s * n) { - if (n->list) { - resolve_specifier_list(n->list); - } -} - -void resolve_rule_list(struct rule_list_s * n) { - if (n->list) { - resolve_rule_list(n->list); - } - if (n->rule) { - resolve_rule(n->rule); - } -} - -void resolve_ast(struct ast_s * n) { - if (n->list) { - resolve_rule_list(n->list); - } -} - -void resolve(struct ast_s * n) { - if (n) { - resolve_ast(n); - } + freeaddrinfo(a); + break; + default: + fprintf(stderr, "warning: %s: %s\n", gai_strerror(r), n->arg->host); + break; + } + } + } +} + +void resolve_host_specifier(struct host_specifier_s *n, + struct filtergen_opts *o) { + if (n->list) { + resolve_host_argument_list(n->list, o); + } +} + +void resolve_target_specifier(struct target_specifier_s *n + __attribute__((unused))) {} + +void resolve_direction_argument(struct direction_argument_s *n + __attribute__((unused))) {} + +void resolve_direction_argument_list(struct direction_argument_list_s *n) { + if (n->list) { + resolve_direction_argument_list(n->list); + } + if (n->arg) { + resolve_direction_argument(n->arg); + } +} + +void resolve_direction_specifier(struct direction_specifier_s *n) { + if (n->list) { + resolve_direction_argument_list(n->list); + } +} + +void resolve_specifier_list(struct specifier_list_s *n, + struct filtergen_opts *o); + +void resolve_subrule_list(struct subrule_list_s *n, struct filtergen_opts *o) { + if (n->subrule_list) { + resolve_subrule_list(n->subrule_list, o); + } + if (n->specifier_list) { + resolve_specifier_list(n->specifier_list, o); + } +} + +void resolve_chaingroup_specifier(struct chaingroup_specifier_s *n, + struct filtergen_opts *o) { + if (n->list) { + resolve_subrule_list(n->list, o); + } +} + +void resolve_compound_specifier(struct compound_specifier_s *n, + struct filtergen_opts *o) { + if (n->list) { + resolve_subrule_list(n->list, o); + } +} + +void resolve_specifier(struct specifier_s *n, struct filtergen_opts *o) { + if (n->compound) { + resolve_compound_specifier(n->compound, o); + } else if (n->direction) { + resolve_direction_specifier(n->direction); + } else if (n->target) { + resolve_target_specifier(n->target); + } else if (n->host) { + resolve_host_specifier(n->host, o); + } else if (n->port) { + resolve_port_specifier(n->port); + } else if (n->protocol) { + resolve_protocol_specifier(n->protocol); + } else if (n->icmptype) { + resolve_icmptype_specifier(n->icmptype); + } else if (n->option) { + resolve_option_specifier(n->option); + } else if (n->chaingroup) { + resolve_chaingroup_specifier(n->chaingroup, o); + } +} + +void resolve_negated_specifier(struct negated_specifier_s *n, + struct filtergen_opts *o) { + if (n->spec) { + resolve_specifier(n->spec, o); + } +} + +void resolve_specifier_list(struct specifier_list_s *n, + struct filtergen_opts *o) { + if (n->list) { + resolve_specifier_list(n->list, o); + } + if (n->spec) { + resolve_negated_specifier(n->spec, o); + } +} + +void resolve_rule(struct rule_s *n, struct filtergen_opts *o) { + if (n->list) { + resolve_specifier_list(n->list, o); + } +} + +void resolve_rule_list(struct rule_list_s *n, struct filtergen_opts *o) { + if (n->list) { + resolve_rule_list(n->list, o); + } + if (n->rule) { + resolve_rule(n->rule, o); + } +} + +void resolve_ast(struct ast_s *n, struct filtergen_opts *o) { + if (n->list) { + resolve_rule_list(n->list, o); + } +} + +void resolve(struct ast_s *n, struct filtergen_opts *o) { + if (n) { + resolve_ast(n, o); + } } diff -Nru filtergen-0.12.4/resolver.h filtergen-0.12.7/resolver.h --- filtergen-0.12.4/resolver.h 2004-05-15 03:26:40.000000000 +0000 +++ filtergen-0.12.7/resolver.h 2016-02-13 10:52:59.000000000 +0000 @@ -21,7 +21,8 @@ #define __RESOLVER_H__ #include "ast.h" +#include "filter.h" -void resolve(struct ast_s * n); +void resolve(struct ast_s *n, struct filtergen_opts *o); #endif /* __RESOLVER_H__ */ diff -Nru filtergen-0.12.4/scanner.c filtergen-0.12.7/scanner.c --- filtergen-0.12.4/scanner.c 2016-02-18 07:59:36.000000000 +0000 +++ filtergen-0.12.7/scanner.c 2016-02-13 10:53:12.000000000 +0000 @@ -8,7 +8,7 @@ #define FLEX_SCANNER #define YY_FLEX_MAJOR_VERSION 2 #define YY_FLEX_MINOR_VERSION 5 -#define YY_FLEX_SUBMINOR_VERSION 31 +#define YY_FLEX_SUBMINOR_VERSION 39 #if YY_FLEX_SUBMINOR_VERSION > 0 #define FLEX_BETA #endif @@ -30,7 +30,15 @@ /* C99 systems have . Non-C99 systems may or may not. */ -#if defined __STDC_VERSION__ && __STDC_VERSION__ >= 199901L +#if defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L + +/* C99 says to define __STDC_LIMIT_MACROS before including stdint.h, + * if you want the limit (max/min) macros for int types. + */ +#ifndef __STDC_LIMIT_MACROS +#define __STDC_LIMIT_MACROS 1 +#endif + #include typedef int8_t flex_int8_t; typedef uint8_t flex_uint8_t; @@ -45,7 +53,6 @@ typedef unsigned char flex_uint8_t; typedef unsigned short int flex_uint16_t; typedef unsigned int flex_uint32_t; -#endif /* ! C99 */ /* Limits of integral types. */ #ifndef INT8_MIN @@ -76,6 +83,8 @@ #define UINT32_MAX (4294967295U) #endif +#endif /* ! C99 */ + #endif /* ! FLEXINT_H */ #ifdef __cplusplus @@ -85,11 +94,12 @@ #else /* ! __cplusplus */ -#if __STDC__ +/* C99 requires __STDC__ to be defined as 1. */ +#if defined (__STDC__) #define YY_USE_CONST -#endif /* __STDC__ */ +#endif /* defined (__STDC__) */ #endif /* ! __cplusplus */ #ifdef YY_USE_CONST @@ -131,15 +141,32 @@ /* Size of default input buffer. */ #ifndef YY_BUF_SIZE +#ifdef __ia64__ +/* On IA-64, the buffer size is 16k, not 8k. + * Moreover, YY_BUF_SIZE is 2*YY_READ_BUF_SIZE in the general case. + * Ditto for the __ia64__ case accordingly. + */ +#define YY_BUF_SIZE 32768 +#else #define YY_BUF_SIZE 16384 +#endif /* __ia64__ */ #endif +/* The state buf must be large enough to hold one state per character in the main buffer. + */ +#define YY_STATE_BUF_SIZE ((YY_BUF_SIZE + 2) * sizeof(yy_state_type)) + #ifndef YY_TYPEDEF_YY_BUFFER_STATE #define YY_TYPEDEF_YY_BUFFER_STATE typedef struct yy_buffer_state *YY_BUFFER_STATE; #endif -extern int yyleng; +#ifndef YY_TYPEDEF_YY_SIZE_T +#define YY_TYPEDEF_YY_SIZE_T +typedef size_t yy_size_t; +#endif + +extern yy_size_t yyleng; extern FILE *yyin, *yyout; @@ -148,6 +175,7 @@ #define EOB_ACT_LAST_MATCH 2 #define YY_LESS_LINENO(n) + #define YY_LINENO_REWIND_TO(ptr) /* Return all but the first "n" matched characters back to the input stream. */ #define yyless(n) \ @@ -165,16 +193,6 @@ #define unput(c) yyunput( c, (yytext_ptr) ) -/* The following is because we cannot portably get our hands on size_t - * (without autoconf's help, which isn't available because we want - * flex-generated scanners to compile on their own). - */ - -#ifndef YY_TYPEDEF_YY_SIZE_T -#define YY_TYPEDEF_YY_SIZE_T -typedef unsigned int yy_size_t; -#endif - #ifndef YY_STRUCT_YY_BUFFER_STATE #define YY_STRUCT_YY_BUFFER_STATE struct yy_buffer_state @@ -192,7 +210,7 @@ /* Number of characters read into yy_ch_buf, not including EOB * characters. */ - int yy_n_chars; + yy_size_t yy_n_chars; /* Whether we "own" the buffer - i.e., we know we created it, * and can realloc() it to grow it, and should free() it to @@ -262,12 +280,12 @@ /* yy_hold_char holds the character lost when yytext is formed. */ static char yy_hold_char; -static int yy_n_chars; /* number of characters read into yy_ch_buf */ -int yyleng; +static yy_size_t yy_n_chars; /* number of characters read into yy_ch_buf */ +yy_size_t yyleng; /* Points to current character in buffer. */ static char *yy_c_buf_p = (char *) 0; -static int yy_init = 1; /* whether we need to initialize */ +static int yy_init = 0; /* whether we need to initialize */ static int yy_start = 0; /* start state number */ /* Flag which is used to allow yywrap()'s to do buffer switches @@ -291,7 +309,7 @@ YY_BUFFER_STATE yy_scan_buffer (char *base,yy_size_t size ); YY_BUFFER_STATE yy_scan_string (yyconst char *yy_str ); -YY_BUFFER_STATE yy_scan_bytes (yyconst char *bytes,int len ); +YY_BUFFER_STATE yy_scan_bytes (yyconst char *bytes,yy_size_t len ); void *yyalloc (yy_size_t ); void *yyrealloc (void *,yy_size_t ); @@ -323,7 +341,7 @@ /* Begin user sect3 */ -#define yywrap(n) 1 +#define yywrap() 1 #define YY_SKIP_YYWRAP typedef unsigned char YY_CHAR; @@ -354,8 +372,8 @@ *yy_cp = '\0'; \ (yy_c_buf_p) = yy_cp; -#define YY_NUM_RULES 38 -#define YY_END_OF_BUFFER 39 +#define YY_NUM_RULES 39 +#define YY_END_OF_BUFFER 40 /* This struct is not used in this scanner, but its presence is necessary. */ struct yy_trans_info @@ -363,22 +381,23 @@ flex_int32_t yy_verify; flex_int32_t yy_nxt; }; -static yyconst flex_int16_t yy_accept[130] = +static yyconst flex_int16_t yy_accept[132] = { 0, - 0, 0, 36, 36, 39, 35, 4, 5, 32, 35, - 2, 34, 33, 31, 30, 28, 29, 33, 33, 33, - 33, 33, 33, 33, 33, 33, 33, 33, 26, 27, - 37, 36, 38, 4, 0, 2, 1, 33, 0, 33, - 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, - 33, 33, 33, 33, 33, 37, 36, 3, 33, 33, - 33, 33, 33, 33, 33, 33, 33, 33, 15, 33, - 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, - 8, 33, 10, 33, 33, 33, 33, 33, 16, 33, - 33, 33, 33, 33, 33, 33, 33, 25, 33, 9, - - 33, 33, 33, 13, 14, 33, 33, 19, 20, 33, - 33, 33, 24, 7, 33, 33, 33, 17, 18, 33, - 22, 23, 11, 33, 6, 33, 12, 21, 0 + 0, 0, 37, 37, 40, 36, 4, 5, 32, 36, + 2, 33, 34, 35, 31, 30, 28, 29, 34, 34, + 34, 34, 34, 34, 34, 34, 34, 34, 34, 26, + 27, 38, 37, 39, 4, 0, 2, 34, 0, 1, + 0, 34, 34, 34, 34, 34, 34, 34, 34, 34, + 34, 34, 34, 34, 34, 34, 34, 34, 38, 37, + 3, 34, 34, 34, 34, 34, 34, 34, 34, 34, + 34, 15, 34, 34, 34, 34, 34, 34, 34, 34, + 34, 34, 8, 34, 10, 34, 34, 34, 34, 34, + 16, 34, 34, 34, 34, 34, 34, 34, 34, 25, + + 34, 9, 34, 34, 34, 13, 14, 34, 34, 19, + 20, 34, 34, 34, 24, 7, 34, 34, 34, 17, + 18, 34, 22, 23, 11, 34, 6, 34, 12, 21, + 0 } ; static yyconst flex_int32_t yy_ec[256] = @@ -387,16 +406,16 @@ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 4, 5, 6, 1, 1, 1, 1, 1, - 1, 7, 8, 1, 8, 9, 10, 11, 11, 11, - 11, 11, 11, 11, 11, 11, 11, 12, 13, 1, - 1, 1, 1, 1, 11, 11, 11, 11, 11, 11, - 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, - 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, - 14, 1, 15, 1, 11, 1, 16, 11, 17, 18, - - 19, 20, 21, 11, 22, 23, 11, 24, 25, 26, - 27, 28, 29, 30, 31, 32, 33, 11, 34, 35, - 36, 11, 37, 1, 38, 1, 1, 1, 1, 1, + 1, 7, 8, 1, 8, 8, 9, 8, 8, 8, + 8, 8, 8, 8, 8, 8, 8, 10, 11, 1, + 1, 1, 1, 1, 8, 8, 8, 8, 8, 8, + 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, + 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, + 12, 1, 13, 1, 8, 1, 14, 8, 15, 16, + + 17, 18, 19, 8, 20, 21, 8, 22, 23, 24, + 25, 26, 27, 28, 29, 30, 31, 8, 32, 33, + 34, 8, 35, 1, 36, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, @@ -413,124 +432,120 @@ 1, 1, 1, 1, 1 } ; -static yyconst flex_int32_t yy_meta[39] = +static yyconst flex_int32_t yy_meta[37] = { 0, - 1, 2, 3, 1, 1, 1, 1, 4, 4, 1, - 5, 1, 2, 1, 1, 5, 5, 5, 5, 5, - 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, - 5, 5, 5, 5, 5, 5, 1, 1 + 1, 2, 3, 1, 1, 1, 1, 4, 1, 4, + 2, 1, 1, 4, 4, 4, 4, 4, 4, 4, + 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, + 4, 4, 4, 4, 1, 1 } ; -static yyconst flex_int16_t yy_base[137] = +static yyconst flex_int16_t yy_base[139] = { 0, - 0, 0, 37, 39, 256, 257, 253, 257, 257, 0, - 0, 247, 244, 257, 257, 257, 257, 34, 35, 37, - 36, 39, 40, 46, 38, 48, 49, 50, 257, 257, - 0, 250, 257, 249, 245, 0, 257, 240, 0, 61, - 51, 62, 64, 65, 71, 66, 76, 72, 79, 52, - 77, 83, 78, 81, 90, 0, 246, 242, 237, 91, - 96, 93, 98, 100, 103, 105, 104, 106, 236, 107, - 108, 110, 109, 111, 121, 115, 118, 123, 235, 126, - 230, 130, 229, 134, 137, 138, 140, 142, 223, 143, - 144, 147, 148, 149, 151, 156, 154, 218, 155, 209, - - 152, 158, 167, 208, 207, 161, 166, 206, 205, 169, - 171, 172, 204, 203, 174, 180, 181, 202, 201, 184, - 200, 198, 197, 186, 195, 187, 193, 190, 257, 219, - 224, 229, 231, 236, 116, 238 + 0, 0, 35, 37, 251, 252, 248, 252, 252, 0, + 0, 252, 239, 241, 237, 252, 252, 252, 32, 33, + 31, 34, 35, 41, 42, 43, 47, 44, 55, 252, + 252, 0, 244, 252, 243, 239, 0, 233, 232, 252, + 231, 230, 52, 53, 58, 64, 65, 67, 66, 69, + 68, 70, 75, 76, 86, 81, 84, 85, 0, 237, + 233, 227, 89, 90, 88, 93, 94, 98, 100, 101, + 103, 226, 104, 105, 113, 111, 115, 117, 118, 119, + 120, 123, 225, 126, 224, 128, 130, 133, 135, 141, + 223, 138, 143, 144, 145, 147, 151, 152, 148, 222, + + 158, 221, 149, 160, 166, 220, 219, 161, 162, 218, + 217, 163, 171, 173, 216, 215, 175, 174, 176, 214, + 212, 187, 211, 208, 204, 179, 196, 177, 195, 194, + 252, 207, 211, 215, 199, 195, 219, 194 } ; -static yyconst flex_int16_t yy_def[137] = +static yyconst flex_int16_t yy_def[139] = { 0, - 129, 1, 130, 130, 129, 129, 129, 129, 129, 131, - 132, 129, 133, 129, 129, 129, 129, 133, 133, 133, - 133, 133, 133, 133, 133, 133, 133, 133, 129, 129, - 134, 129, 129, 129, 131, 132, 129, 133, 135, 133, - 133, 133, 133, 133, 133, 133, 133, 133, 133, 133, - 133, 133, 133, 133, 133, 134, 129, 131, 136, 133, - 133, 133, 133, 133, 133, 133, 133, 133, 133, 133, - 133, 133, 133, 133, 133, 133, 133, 133, 136, 133, - 133, 133, 133, 133, 133, 133, 133, 133, 133, 133, - 133, 133, 133, 133, 133, 133, 133, 133, 133, 133, - - 133, 133, 133, 133, 133, 133, 133, 133, 133, 133, - 133, 133, 133, 133, 133, 133, 133, 133, 133, 133, - 133, 133, 133, 133, 133, 133, 133, 133, 0, 129, - 129, 129, 129, 129, 129, 129 + 131, 1, 132, 132, 131, 131, 131, 131, 131, 133, + 134, 131, 135, 131, 136, 131, 131, 131, 135, 135, + 135, 135, 135, 135, 135, 135, 135, 135, 135, 131, + 131, 137, 131, 131, 131, 133, 134, 135, 136, 131, + 136, 138, 135, 135, 135, 135, 135, 135, 135, 135, + 135, 135, 135, 135, 135, 135, 135, 135, 137, 131, + 133, 138, 135, 135, 135, 135, 135, 135, 135, 135, + 135, 135, 135, 135, 135, 135, 135, 135, 135, 135, + 135, 135, 135, 135, 135, 135, 135, 135, 135, 135, + 135, 135, 135, 135, 135, 135, 135, 135, 135, 135, + + 135, 135, 135, 135, 135, 135, 135, 135, 135, 135, + 135, 135, 135, 135, 135, 135, 135, 135, 135, 135, + 135, 135, 135, 135, 135, 135, 135, 135, 135, 135, + 0, 131, 131, 131, 131, 131, 131, 131 } ; -static yyconst flex_int16_t yy_nxt[296] = +static yyconst flex_int16_t yy_nxt[289] = { 0, - 6, 7, 8, 9, 10, 11, 6, 6, 6, 12, - 13, 14, 15, 16, 17, 18, 13, 19, 13, 20, - 13, 21, 13, 22, 23, 13, 24, 25, 13, 26, - 27, 28, 13, 13, 13, 13, 29, 30, 32, 33, - 32, 33, 39, 39, 39, 39, 39, 39, 39, 33, - 40, 33, 45, 41, 39, 48, 39, 39, 39, 39, - 39, 46, 42, 44, 43, 47, 52, 51, 55, 39, - 39, 49, 39, 39, 39, 53, 54, 60, 50, 39, - 39, 61, 66, 72, 39, 39, 39, 39, 62, 39, - 63, 39, 68, 67, 64, 65, 69, 71, 39, 39, - - 74, 39, 70, 73, 39, 75, 39, 77, 39, 80, - 76, 39, 39, 39, 39, 39, 39, 39, 39, 39, - 59, 88, 82, 39, 78, 83, 39, 81, 86, 39, - 85, 39, 94, 84, 39, 89, 87, 91, 39, 95, - 92, 90, 39, 93, 96, 39, 39, 97, 39, 101, - 39, 39, 39, 99, 98, 39, 39, 39, 106, 39, - 39, 100, 39, 39, 39, 105, 39, 111, 102, 39, - 103, 104, 112, 108, 39, 39, 107, 39, 110, 39, - 39, 115, 39, 109, 117, 113, 114, 120, 39, 39, - 122, 123, 39, 116, 39, 39, 118, 119, 39, 125, - - 126, 39, 121, 39, 127, 39, 39, 124, 39, 39, - 39, 39, 39, 39, 39, 39, 39, 39, 128, 31, - 31, 31, 31, 31, 35, 35, 39, 35, 35, 36, - 36, 39, 36, 36, 38, 38, 56, 39, 39, 56, - 56, 79, 79, 39, 39, 39, 58, 57, 39, 58, - 34, 57, 39, 37, 34, 129, 5, 129, 129, 129, - 129, 129, 129, 129, 129, 129, 129, 129, 129, 129, - 129, 129, 129, 129, 129, 129, 129, 129, 129, 129, - 129, 129, 129, 129, 129, 129, 129, 129, 129, 129, - 129, 129, 129, 129, 129 - + 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, + 16, 17, 18, 19, 13, 20, 13, 21, 13, 22, + 13, 23, 24, 13, 25, 26, 13, 27, 28, 29, + 13, 13, 13, 13, 30, 31, 33, 34, 33, 34, + 39, 39, 39, 39, 39, 34, 43, 34, 48, 44, + 39, 39, 39, 39, 51, 47, 39, 49, 45, 50, + 46, 39, 39, 55, 39, 52, 63, 39, 56, 57, + 54, 58, 53, 39, 39, 39, 39, 39, 39, 39, + 69, 64, 65, 71, 39, 39, 74, 72, 66, 68, + 39, 70, 67, 39, 39, 39, 73, 39, 39, 39, + + 76, 77, 39, 39, 75, 82, 78, 39, 80, 39, + 39, 79, 39, 39, 39, 84, 90, 81, 85, 83, + 39, 88, 39, 87, 39, 86, 39, 39, 39, 39, + 91, 89, 39, 97, 96, 39, 92, 39, 93, 39, + 94, 103, 39, 95, 39, 98, 99, 39, 101, 100, + 39, 108, 39, 39, 39, 102, 39, 39, 39, 104, + 39, 39, 107, 105, 106, 113, 114, 39, 110, 39, + 39, 39, 39, 109, 112, 39, 117, 115, 111, 122, + 39, 119, 39, 39, 39, 39, 39, 116, 39, 124, + 125, 121, 127, 118, 120, 129, 39, 62, 41, 126, + + 123, 128, 38, 39, 39, 39, 130, 32, 32, 32, + 32, 36, 36, 39, 36, 37, 37, 39, 37, 59, + 39, 39, 59, 39, 39, 39, 39, 39, 39, 39, + 39, 39, 39, 39, 39, 39, 42, 61, 60, 42, + 42, 42, 39, 61, 35, 60, 42, 40, 39, 35, + 131, 5, 131, 131, 131, 131, 131, 131, 131, 131, + 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, + 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, + 131, 131, 131, 131, 131, 131, 131, 131 } ; -static yyconst flex_int16_t yy_chk[296] = +static yyconst flex_int16_t yy_chk[289] = { 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 3, 3, - 4, 4, 18, 19, 21, 20, 25, 22, 23, 3, - 18, 4, 21, 19, 24, 23, 26, 27, 28, 41, - 50, 21, 19, 20, 19, 22, 26, 25, 28, 40, - 42, 24, 43, 44, 46, 27, 27, 40, 24, 45, - 48, 41, 46, 50, 47, 51, 53, 49, 42, 54, - 43, 52, 47, 46, 44, 45, 47, 49, 55, 60, - - 52, 62, 48, 51, 61, 52, 63, 54, 64, 60, - 53, 65, 67, 66, 68, 70, 71, 73, 72, 74, - 135, 68, 62, 76, 55, 63, 77, 61, 66, 75, - 65, 78, 74, 64, 80, 70, 67, 72, 82, 75, - 73, 71, 84, 73, 76, 85, 86, 77, 87, 84, - 88, 90, 91, 80, 78, 92, 93, 94, 90, 95, - 101, 82, 97, 99, 96, 88, 102, 95, 85, 106, - 86, 87, 96, 92, 107, 103, 91, 110, 94, 111, - 112, 101, 115, 93, 103, 97, 99, 110, 116, 117, - 112, 115, 120, 102, 124, 126, 106, 107, 128, 117, - - 120, 127, 111, 125, 124, 123, 122, 116, 121, 119, - 118, 114, 113, 109, 108, 105, 104, 100, 126, 130, - 130, 130, 130, 130, 131, 131, 98, 131, 131, 132, - 132, 89, 132, 132, 133, 133, 134, 83, 81, 134, - 134, 136, 136, 79, 69, 59, 58, 57, 38, 35, - 34, 32, 13, 12, 7, 5, 129, 129, 129, 129, - 129, 129, 129, 129, 129, 129, 129, 129, 129, 129, - 129, 129, 129, 129, 129, 129, 129, 129, 129, 129, - 129, 129, 129, 129, 129, 129, 129, 129, 129, 129, - 129, 129, 129, 129, 129 - + 1, 1, 1, 1, 1, 1, 3, 3, 4, 4, + 21, 19, 20, 22, 23, 3, 19, 4, 22, 20, + 24, 25, 26, 28, 24, 21, 27, 22, 20, 23, + 20, 43, 44, 27, 29, 25, 43, 45, 28, 28, + 26, 29, 25, 46, 47, 49, 48, 51, 50, 52, + 49, 44, 45, 50, 53, 54, 52, 50, 46, 48, + 56, 49, 47, 57, 58, 55, 51, 65, 63, 64, + + 54, 55, 66, 67, 53, 63, 55, 68, 57, 69, + 70, 56, 71, 73, 74, 65, 71, 58, 66, 64, + 76, 69, 75, 68, 77, 67, 78, 79, 80, 81, + 73, 70, 82, 78, 77, 84, 74, 86, 75, 87, + 76, 86, 88, 76, 89, 79, 80, 92, 82, 81, + 90, 92, 93, 94, 95, 84, 96, 99, 103, 87, + 97, 98, 90, 88, 89, 97, 98, 101, 94, 104, + 108, 109, 112, 93, 96, 105, 103, 99, 95, 112, + 113, 105, 114, 118, 117, 119, 128, 101, 126, 114, + 117, 109, 119, 104, 108, 126, 122, 138, 136, 118, + + 113, 122, 135, 130, 129, 127, 128, 132, 132, 132, + 132, 133, 133, 125, 133, 134, 134, 124, 134, 137, + 123, 121, 137, 120, 116, 115, 111, 110, 107, 106, + 102, 100, 91, 85, 83, 72, 62, 61, 60, 42, + 41, 39, 38, 36, 35, 33, 15, 14, 13, 7, + 5, 131, 131, 131, 131, 131, 131, 131, 131, 131, + 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, + 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, + 131, 131, 131, 131, 131, 131, 131, 131 } ; static yy_state_type yy_last_accepting_state; @@ -575,24 +590,25 @@ #include #include #include +#include #include "parser.h" /* include file stack */ -#define MAXINCLUDES 16 +#define MAXINCLUDES 512 struct inc_stack_s { YY_BUFFER_STATE state; char * filename; long int lineno; }; -struct inc_stack_s inc_stack[MAXINCLUDES] = { { state: 0, filename: NULL, lineno: 1 } }; +struct inc_stack_s inc_stack[MAXINCLUDES] = { { .state = 0, .filename = NULL, .lineno = 1 } }; int inc_stackptr = 0; long int lineno(); char * filename(); -static void scan_err(const char * fmt, ...); +static void scan_err(const char * fmt, ...) __attribute__((format(printf, 1, 2))); void include_file(const char *); -#line 596 "scanner.c" +#line 612 "scanner.c" #define INITIAL 0 #define include 1 @@ -609,6 +625,37 @@ #define YY_EXTRA_TYPE void * #endif +static int yy_init_globals (void ); + +/* Accessor methods to globals. + These are made visible to non-reentrant scanners for convenience. */ + +int yylex_destroy (void ); + +int yyget_debug (void ); + +void yyset_debug (int debug_flag ); + +YY_EXTRA_TYPE yyget_extra (void ); + +void yyset_extra (YY_EXTRA_TYPE user_defined ); + +FILE *yyget_in (void ); + +void yyset_in (FILE * in_str ); + +FILE *yyget_out (void ); + +void yyset_out (FILE * out_str ); + +yy_size_t yyget_leng (void ); + +char *yyget_text (void ); + +int yyget_lineno (void ); + +void yyset_lineno (int line_number ); + /* Macros after this point can all be overridden by user definitions in * section 1. */ @@ -641,7 +688,12 @@ /* Amount of stuff to slurp up with each read. */ #ifndef YY_READ_BUF_SIZE +#ifdef __ia64__ +/* On IA-64, the buffer size is 16k, not 8k */ +#define YY_READ_BUF_SIZE 16384 +#else #define YY_READ_BUF_SIZE 8192 +#endif /* __ia64__ */ #endif /* Copy whatever the last rule matched to the standard output. */ @@ -649,7 +701,7 @@ /* This used to be an fputs(), but since the string might contain NUL's, * we now use fwrite(). */ -#define ECHO (void) fwrite( yytext, yyleng, 1, yyout ) +#define ECHO do { if (fwrite( yytext, yyleng, 1, yyout )) {} } while (0) #endif /* Gets input and stuffs it into "buf". number of characters read, or YY_NULL, @@ -742,14 +794,9 @@ register char *yy_cp, *yy_bp; register int yy_act; -#line 53 "scanner.l" - - -#line 749 "scanner.c" - - if ( (yy_init) ) + if ( !(yy_init) ) { - (yy_init) = 0; + (yy_init) = 1; #ifdef YY_USER_INIT YY_USER_INIT; @@ -773,6 +820,12 @@ yy_load_buffer_state( ); } + { +#line 55 "scanner.l" + + +#line 828 "scanner.c" + while ( 1 ) /* loops until end-of-file is reached */ { yy_cp = (yy_c_buf_p); @@ -789,7 +842,7 @@ yy_match: do { - register YY_CHAR yy_c = yy_ec[YY_SC_TO_UI(*yy_cp)]; + register YY_CHAR yy_c = yy_ec[YY_SC_TO_UI(*yy_cp)] ; if ( yy_accept[yy_current_state] ) { (yy_last_accepting_state) = yy_current_state; @@ -798,13 +851,13 @@ while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state ) { yy_current_state = (int) yy_def[yy_current_state]; - if ( yy_current_state >= 130 ) + if ( yy_current_state >= 132 ) yy_c = yy_meta[(unsigned int) yy_c]; } yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c]; ++yy_cp; } - while ( yy_base[yy_current_state] != 257 ); + while ( yy_base[yy_current_state] != 252 ); yy_find_action: yy_act = yy_accept[yy_current_state]; @@ -830,7 +883,7 @@ case 1: YY_RULE_SETUP -#line 55 "scanner.l" +#line 57 "scanner.l" { /* strip c-style comments */ int c; do { @@ -847,12 +900,12 @@ YY_BREAK case 2: YY_RULE_SETUP -#line 69 "scanner.l" +#line 71 "scanner.l" /* strip shell style comments */ YY_BREAK case 3: YY_RULE_SETUP -#line 71 "scanner.l" +#line 73 "scanner.l" { /* we do not store the " characters in the string, so lop * them off. We can "safely" assume that the first and last @@ -865,214 +918,211 @@ YY_BREAK case 4: YY_RULE_SETUP -#line 81 "scanner.l" +#line 83 "scanner.l" /* ignore */ YY_BREAK case 5: /* rule 5 can match eol */ YY_RULE_SETUP -#line 83 "scanner.l" +#line 85 "scanner.l" inc_stack[inc_stackptr].lineno++; YY_BREAK case 6: YY_RULE_SETUP -#line 85 "scanner.l" +#line 87 "scanner.l" BEGIN(include); YY_BREAK case 7: YY_RULE_SETUP -#line 87 "scanner.l" +#line 89 "scanner.l" return TOK_ACCEPT; YY_BREAK case 8: YY_RULE_SETUP -#line 88 "scanner.l" +#line 90 "scanner.l" return TOK_DEST; YY_BREAK case 9: YY_RULE_SETUP -#line 89 "scanner.l" +#line 91 "scanner.l" return TOK_DPORT; YY_BREAK case 10: YY_RULE_SETUP -#line 90 "scanner.l" +#line 92 "scanner.l" return TOK_DROP; YY_BREAK case 11: YY_RULE_SETUP -#line 91 "scanner.l" +#line 93 "scanner.l" return TOK_FORWARD; YY_BREAK case 12: YY_RULE_SETUP -#line 92 "scanner.l" +#line 94 "scanner.l" return TOK_ICMPTYPE; YY_BREAK case 13: YY_RULE_SETUP -#line 93 "scanner.l" +#line 95 "scanner.l" return TOK_INPUT; YY_BREAK case 14: YY_RULE_SETUP -#line 94 "scanner.l" +#line 96 "scanner.l" return TOK_LOCAL; YY_BREAK case 15: YY_RULE_SETUP -#line 95 "scanner.l" +#line 97 "scanner.l" return TOK_LOG; YY_BREAK case 16: YY_RULE_SETUP -#line 96 "scanner.l" +#line 98 "scanner.l" return TOK_MASQ; YY_BREAK case 17: YY_RULE_SETUP -#line 97 "scanner.l" +#line 99 "scanner.l" return TOK_ONEWAY; YY_BREAK case 18: YY_RULE_SETUP -#line 98 "scanner.l" +#line 100 "scanner.l" return TOK_OUTPUT; YY_BREAK case 19: YY_RULE_SETUP -#line 99 "scanner.l" +#line 101 "scanner.l" return TOK_PROTO; YY_BREAK case 20: YY_RULE_SETUP -#line 100 "scanner.l" +#line 102 "scanner.l" return TOK_PROXY; YY_BREAK case 21: YY_RULE_SETUP -#line 101 "scanner.l" +#line 103 "scanner.l" return TOK_REDIRECT; YY_BREAK case 22: YY_RULE_SETUP -#line 102 "scanner.l" +#line 104 "scanner.l" return TOK_REJECT; YY_BREAK case 23: YY_RULE_SETUP -#line 103 "scanner.l" +#line 105 "scanner.l" return TOK_SOURCE; YY_BREAK case 24: YY_RULE_SETUP -#line 104 "scanner.l" +#line 106 "scanner.l" return TOK_SPORT; YY_BREAK case 25: YY_RULE_SETUP -#line 105 "scanner.l" +#line 107 "scanner.l" return TOK_TEXT; YY_BREAK case 26: YY_RULE_SETUP -#line 107 "scanner.l" +#line 109 "scanner.l" return TOK_LCURLY; YY_BREAK case 27: YY_RULE_SETUP -#line 108 "scanner.l" +#line 110 "scanner.l" return TOK_RCURLY; YY_BREAK case 28: YY_RULE_SETUP -#line 109 "scanner.l" +#line 111 "scanner.l" return TOK_LSQUARE; YY_BREAK case 29: YY_RULE_SETUP -#line 110 "scanner.l" +#line 112 "scanner.l" return TOK_RSQUARE; YY_BREAK case 30: YY_RULE_SETUP -#line 111 "scanner.l" +#line 113 "scanner.l" return TOK_SEMICOLON; YY_BREAK case 31: YY_RULE_SETUP -#line 112 "scanner.l" +#line 114 "scanner.l" return TOK_COLON; YY_BREAK case 32: YY_RULE_SETUP -#line 113 "scanner.l" +#line 115 "scanner.l" return TOK_BANG; YY_BREAK case 33: YY_RULE_SETUP -#line 115 "scanner.l" +#line 116 "scanner.l" +return TOK_STAR; + YY_BREAK +case 34: +YY_RULE_SETUP +#line 118 "scanner.l" { yylval.u_str = strndup(yytext, yyleng); return TOK_IDENTIFIER; } YY_BREAK -case 34: +case 35: YY_RULE_SETUP -#line 120 "scanner.l" +#line 123 "scanner.l" return TOK_SLASH; YY_BREAK -case 35: +case 36: YY_RULE_SETUP -#line 122 "scanner.l" +#line 125 "scanner.l" return TOK_ERR; YY_BREAK -case 36: +case 37: YY_RULE_SETUP -#line 124 "scanner.l" +#line 127 "scanner.l" /* eat whitespace after include */ YY_BREAK -case 37: +case 38: YY_RULE_SETUP -#line 125 "scanner.l" +#line 128 "scanner.l" { /* include file name */ - if (inc_stackptr >= MAXINCLUDES - 1) { - scan_err("warning: too many nested includes"); - scan_err("warning: skipping include of file %s", yytext); - - } else { - char * name; - - name = strdup(yytext); - include_file(name); - free(name); - } + char * name = strdup(yytext); + include_file(name); + free(name); BEGIN(INITIAL); } YY_BREAK case YY_STATE_EOF(INITIAL): case YY_STATE_EOF(include): -#line 140 "scanner.l" +#line 135 "scanner.l" { if (!inc_stackptr) { yyterminate(); } else { - if (inc_stack[inc_stackptr].filename) { - free(inc_stack[inc_stackptr].filename); - inc_stack[inc_stackptr].filename = NULL; - } - inc_stackptr--; - yy_delete_buffer(YY_CURRENT_BUFFER); - yy_switch_to_buffer(inc_stack[inc_stackptr].state); + if (inc_stack[inc_stackptr].filename) { + free(inc_stack[inc_stackptr].filename); + inc_stack[inc_stackptr].filename = NULL; + } + inc_stackptr--; + yy_delete_buffer(YY_CURRENT_BUFFER); + yy_switch_to_buffer(inc_stack[inc_stackptr].state); } - } + } YY_BREAK -case 38: +case 39: YY_RULE_SETUP -#line 153 "scanner.l" +#line 148 "scanner.l" ECHO; YY_BREAK -#line 1076 "scanner.c" +#line 1126 "scanner.c" case YY_END_OF_BUFFER: { @@ -1201,6 +1251,7 @@ "fatal flex scanner internal error--no action found" ); } /* end of action switch */ } /* end of scanning one token */ + } /* end of user's declarations */ } /* end of yylex */ /* yy_get_next_buffer - try to read in a new buffer @@ -1256,21 +1307,21 @@ else { - size_t num_to_read = + yy_size_t num_to_read = YY_CURRENT_BUFFER_LVALUE->yy_buf_size - number_to_move - 1; while ( num_to_read <= 0 ) { /* Not enough room in the buffer - grow it. */ /* just a shorter name for the current buffer */ - YY_BUFFER_STATE b = YY_CURRENT_BUFFER; + YY_BUFFER_STATE b = YY_CURRENT_BUFFER_LVALUE; int yy_c_buf_p_offset = (int) ((yy_c_buf_p) - b->yy_ch_buf); if ( b->yy_is_our_buffer ) { - int new_size = b->yy_buf_size * 2; + yy_size_t new_size = b->yy_buf_size * 2; if ( new_size <= 0 ) b->yy_buf_size += b->yy_buf_size / 8; @@ -1325,6 +1376,14 @@ else ret_val = EOB_ACT_CONTINUE_SCAN; + if ((yy_size_t) ((yy_n_chars) + number_to_move) > YY_CURRENT_BUFFER_LVALUE->yy_buf_size) { + /* Extend the array by 50%, plus the number we really need. */ + yy_size_t new_size = (yy_n_chars) + number_to_move + ((yy_n_chars) >> 1); + YY_CURRENT_BUFFER_LVALUE->yy_ch_buf = (char *) yyrealloc((void *) YY_CURRENT_BUFFER_LVALUE->yy_ch_buf,new_size ); + if ( ! YY_CURRENT_BUFFER_LVALUE->yy_ch_buf ) + YY_FATAL_ERROR( "out of dynamic memory in yy_get_next_buffer()" ); + } + (yy_n_chars) += number_to_move; YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)] = YY_END_OF_BUFFER_CHAR; YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars) + 1] = YY_END_OF_BUFFER_CHAR; @@ -1354,7 +1413,7 @@ while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state ) { yy_current_state = (int) yy_def[yy_current_state]; - if ( yy_current_state >= 130 ) + if ( yy_current_state >= 132 ) yy_c = yy_meta[(unsigned int) yy_c]; } yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c]; @@ -1382,13 +1441,13 @@ while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state ) { yy_current_state = (int) yy_def[yy_current_state]; - if ( yy_current_state >= 130 ) + if ( yy_current_state >= 132 ) yy_c = yy_meta[(unsigned int) yy_c]; } yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c]; - yy_is_jam = (yy_current_state == 129); + yy_is_jam = (yy_current_state == 131); - return yy_is_jam ? 0 : yy_current_state; + return yy_is_jam ? 0 : yy_current_state; } #ifndef YY_NO_INPUT @@ -1415,7 +1474,7 @@ else { /* need more input */ - int offset = (yy_c_buf_p) - (yytext_ptr); + yy_size_t offset = (yy_c_buf_p) - (yytext_ptr); ++(yy_c_buf_p); switch ( yy_get_next_buffer( ) ) @@ -1575,10 +1634,6 @@ yyfree((void *) b ); } -#ifndef __cplusplus -extern int isatty (int ); -#endif /* __cplusplus */ - /* Initializes or reinitializes a buffer. * This function is sometimes called more than once on the same buffer, * such as during a yyrestart() or at EOF. @@ -1691,7 +1746,7 @@ */ static void yyensure_buffer_stack (void) { - int num_to_alloc; + yy_size_t num_to_alloc; if (!(yy_buffer_stack)) { @@ -1703,7 +1758,9 @@ (yy_buffer_stack) = (struct yy_buffer_state**)yyalloc (num_to_alloc * sizeof(struct yy_buffer_state*) ); - + if ( ! (yy_buffer_stack) ) + YY_FATAL_ERROR( "out of dynamic memory in yyensure_buffer_stack()" ); + memset((yy_buffer_stack), 0, num_to_alloc * sizeof(struct yy_buffer_state*)); (yy_buffer_stack_max) = num_to_alloc; @@ -1721,6 +1778,8 @@ ((yy_buffer_stack), num_to_alloc * sizeof(struct yy_buffer_state*) ); + if ( ! (yy_buffer_stack) ) + YY_FATAL_ERROR( "out of dynamic memory in yyensure_buffer_stack()" ); /* zero only the new slots.*/ memset((yy_buffer_stack) + (yy_buffer_stack_max), 0, grow_size * sizeof(struct yy_buffer_state*)); @@ -1765,43 +1824,42 @@ /** Setup the input buffer state to scan a string. The next call to yylex() will * scan from a @e copy of @a str. - * @param str a NUL-terminated string to scan - * @param yy_str a NUL-terminated string to scan + * @param yystr a NUL-terminated string to scan * * @return the newly allocated buffer state object. * @note If you want to scan bytes that may contain NUL values, then use * yy_scan_bytes() instead. */ -YY_BUFFER_STATE yy_scan_string (yyconst char * yy_str ) +YY_BUFFER_STATE yy_scan_string (yyconst char * yystr ) { - return yy_scan_bytes(yy_str,strlen(yy_str) ); + return yy_scan_bytes(yystr,strlen(yystr) ); } /** Setup the input buffer state to scan the given bytes. The next call to yylex() will * scan from a @e copy of @a bytes. - * @param bytes the byte buffer to scan - * @param len the number of bytes in the buffer pointed to by @a bytes. + * @param yybytes the byte buffer to scan + * @param _yybytes_len the number of bytes in the buffer pointed to by @a bytes. * * @return the newly allocated buffer state object. */ -YY_BUFFER_STATE yy_scan_bytes (yyconst char * bytes, int len ) +YY_BUFFER_STATE yy_scan_bytes (yyconst char * yybytes, yy_size_t _yybytes_len ) { YY_BUFFER_STATE b; char *buf; yy_size_t n; - int i; + yy_size_t i; /* Get memory for full buffer, including space for trailing EOB's. */ - n = len + 2; + n = _yybytes_len + 2; buf = (char *) yyalloc(n ); if ( ! buf ) YY_FATAL_ERROR( "out of dynamic memory in yy_scan_bytes()" ); - for ( i = 0; i < len; ++i ) - buf[i] = bytes[i]; + for ( i = 0; i < _yybytes_len; ++i ) + buf[i] = yybytes[i]; - buf[len] = buf[len+1] = YY_END_OF_BUFFER_CHAR; + buf[_yybytes_len] = buf[_yybytes_len+1] = YY_END_OF_BUFFER_CHAR; b = yy_scan_buffer(buf,n ); if ( ! b ) @@ -1872,7 +1930,7 @@ /** Get the length of the current token. * */ -int yyget_leng (void) +yy_size_t yyget_leng (void) { return yyleng; } @@ -1922,6 +1980,34 @@ yy_flex_debug = bdebug ; } +static int yy_init_globals (void) +{ + /* Initialization is the same as for the non-reentrant scanner. + * This function is called from yylex_destroy(), so don't allocate here. + */ + + (yy_buffer_stack) = 0; + (yy_buffer_stack_top) = 0; + (yy_buffer_stack_max) = 0; + (yy_c_buf_p) = (char *) 0; + (yy_init) = 0; + (yy_start) = 0; + +/* Defined in main.c */ +#ifdef YY_STDINIT + yyin = stdin; + yyout = stdout; +#else + yyin = (FILE *) 0; + yyout = (FILE *) 0; +#endif + + /* For future reference: Set errno on error, since we are called by + * yylex_init() + */ + return 0; +} + /* yylex_destroy is for both reentrant and non-reentrant scanners. */ int yylex_destroy (void) { @@ -1937,6 +2023,10 @@ yyfree((yy_buffer_stack) ); (yy_buffer_stack) = NULL; + /* Reset the globals. This is important in a non-reentrant scanner so the next time + * yylex() is called, initialization will occur. */ + yy_init_globals( ); + return 0; } @@ -1948,7 +2038,7 @@ static void yy_flex_strncpy (char* s1, yyconst char * s2, int n ) { register int i; - for ( i = 0; i < n; ++i ) + for ( i = 0; i < n; ++i ) s1[i] = s2[i]; } #endif @@ -1957,7 +2047,7 @@ static int yy_flex_strlen (yyconst char * s ) { register int n; - for ( n = 0; s[n]; ++n ) + for ( n = 0; s[n]; ++n ) ; return n; @@ -1988,82 +2078,115 @@ #define YYTABLES_NAME "yytables" -#undef YY_NEW_FILE -#undef YY_FLUSH_BUFFER -#undef yy_set_bol -#undef yy_new_buffer -#undef yy_set_interactive -#undef yytext_ptr -#undef YY_DO_BEFORE_ACTION - -#ifdef YY_DECL_IS_OURS -#undef YY_DECL_IS_OURS -#undef YY_DECL -#endif -#line 153 "scanner.l" +#line 147 "scanner.l" long int lineno(void) { - return inc_stack[inc_stackptr].lineno; + return inc_stack[inc_stackptr].lineno; } /* FIXME: make this return an immutable string */ -char * filename(void) { - return inc_stack[inc_stackptr].filename ?: strdup("(standard input)"); -} - -static void scan_err(const char * fmt, ...) { - va_list args; - - va_start(args, fmt); - if (inc_stackptr >= 0) - fprintf(stderr, "%s:%ld: ", filename(), lineno()); - vfprintf(stderr, fmt, args); - fprintf(stderr, "\n"); -} - - -void step_into_include_file(const char * fn) { - FILE * f; - - if (!(f = fopen(fn, "r"))) { - scan_err("warning: can't open file \"%s\"", fn); - } else { - inc_stack[inc_stackptr++].state = YY_CURRENT_BUFFER; - inc_stack[inc_stackptr].lineno = 1; - inc_stack[inc_stackptr].filename = strdup(fn); - yyin = f; - yy_switch_to_buffer(yy_create_buffer(yyin,YY_BUF_SIZE)); - } +char *filename(void) { + return inc_stack[inc_stackptr].filename ? inc_stack[inc_stackptr].filename + : strdup("(standard input)"); +} + +static void scan_err(const char *fmt, ...) { + va_list args; + + va_start(args, fmt); + if (inc_stackptr >= 0) + fprintf(stderr, "%s:%ld: ", filename(), lineno()); + vfprintf(stderr, fmt, args); + fprintf(stderr, "\n"); +} + +void step_into_include_file(const char *fn) { + FILE *f; + + if (inc_stackptr >= MAXINCLUDES - 1) { + scan_err("warning: too many nested includes"); + scan_err("warning: skipping include of file \"%s\"", fn); + return; + } + + if (!(f = fopen(fn, "r"))) { + scan_err("warning: can't open file \"%s\"", fn); + } else { + inc_stack[inc_stackptr++].state = YY_CURRENT_BUFFER; + inc_stack[inc_stackptr].lineno = 1; + inc_stack[inc_stackptr].filename = strdup(fn); + yyin = f; + yy_switch_to_buffer(yy_create_buffer(yyin,YY_BUF_SIZE)); + } } /* include a file or directory */ -void include_file(const char * name) { - struct stat st; - DIR * d; - struct dirent * r; - char * fn; - - if (stat(name, &st)) { - scan_err("warning: stat failed on %s: %s", name, strerror(errno)); - } else { - if (S_ISDIR(st.st_mode)) { - if ((d = opendir(name)) == NULL) { - scan_err("warning: opendir failed on %s: %s", name, strerror(errno)); - } else { - while ((r = readdir(d)) != NULL) { - /* FIXME: assumes d_name */ - if (r->d_name[0] == '.') - continue; - asprintf(&fn, "%s/%s", name, r->d_name); - include_file(fn); - free(fn); - } - closedir(d); - } - } else - step_into_include_file(name); - } +void include_file(const char *name) { + struct stat st; + struct dirent **namelist; + char *fn; + int n; + + if (stat(name, &st)) { + if (errno == ENOENT && + (index(name, '*') != NULL || index(name, '?') != NULL || + index(name, '[') != NULL)) { + /* Globbing fiesta! */ + glob_t glob_buf; + if (glob(name, 0, NULL, &glob_buf) != 0) { + scan_err("warning: failed to glob %s: %s", name, strerror(errno)); + } else { + /* We go through the list of files backwards, because + * step_into_include_file() creates a stack of all the + * files processed and then works on them in a LIFO + * fashion -- which would make all of our rules files + * go backwards. Since I can't wrap my head around + * why that is, exactly, I'm hacking it up with + * this instead. Fixination appreciated. + */ + for (n = glob_buf.gl_pathc - 1; n >= 0; n--) { + if (stat(glob_buf.gl_pathv[n], &st)) { + scan_err("warning: stat failed on globbed %s: %s", + glob_buf.gl_pathv[n], strerror(errno)); + } else if (S_ISREG(st.st_mode) || S_ISLNK(st.st_mode)) { + step_into_include_file(glob_buf.gl_pathv[n]); + } + } + } + + globfree(&glob_buf); + } else { + scan_err("warning: stat failed on %s: %s", name, strerror(errno)); + } + } else { + if (S_ISDIR(st.st_mode)) { + if ((n = scandir(name, &namelist, NULL, alphasort)) < 0) { + scan_err("warning: scandir failed on %s: %s", name, strerror(errno)); + } else { + while (n--) { + /* FIXME: assumes d_name */ + if (namelist[n]->d_name[0] == '.') { + free(namelist[n]); + continue; + } + if (asprintf(&fn, "%s/%s", name, namelist[n]->d_name) < 0) { + scan_err("internal error: asprintf failed constructing pathname " + "for included file %s", + namelist[n]->d_name); + free(fn); + } else { + include_file(fn); + free(fn); + } + free(namelist[n]); + } + free(namelist); + } + } else { + step_into_include_file(name); + } + } } diff -Nru filtergen-0.12.4/scanner.l filtergen-0.12.7/scanner.l --- filtergen-0.12.4/scanner.l 2016-02-18 07:59:36.000000000 +0000 +++ filtergen-0.12.7/scanner.l 2016-02-13 10:52:59.000000000 +0000 @@ -27,28 +27,30 @@ #include #include #include +#include #include "parser.h" /* include file stack */ -#define MAXINCLUDES 16 +#define MAXINCLUDES 512 struct inc_stack_s { YY_BUFFER_STATE state; char * filename; long int lineno; }; -struct inc_stack_s inc_stack[MAXINCLUDES] = { { state: 0, filename: NULL, lineno: 1 } }; +struct inc_stack_s inc_stack[MAXINCLUDES] = { { .state = 0, .filename = NULL, .lineno = 1 } }; int inc_stackptr = 0; long int lineno(); char * filename(); -static void scan_err(const char * fmt, ...); +static void scan_err(const char * fmt, ...) __attribute__((format(printf, 1, 2))); void include_file(const char *); %} string \"[^\n]+\" space [ \t]+ -id [[:alnum:]_][[:alnum:]_+-]* +word [[:alnum:]._+-]+ +id {word}|({word})?:(({word})?:)+({word})? %% @@ -111,8 +113,9 @@ ";" return TOK_SEMICOLON; ":" return TOK_COLON; "!" return TOK_BANG; +"*" return TOK_STAR; -{id}(\.{id})* { +{id} { yylval.u_str = strndup(yytext, yyleng); return TOK_IDENTIFIER; } @@ -123,17 +126,9 @@ [ \t]* /* eat whitespace after include */ [^ \t\n;]+ { /* include file name */ - if (inc_stackptr >= MAXINCLUDES - 1) { - scan_err("warning: too many nested includes"); - scan_err("warning: skipping include of file %s", yytext); - - } else { - char * name; - - name = strdup(yytext); - include_file(name); - free(name); - } + char * name = strdup(yytext); + include_file(name); + free(name); BEGIN(INITIAL); } @@ -141,76 +136,121 @@ if (!inc_stackptr) { yyterminate(); } else { - if (inc_stack[inc_stackptr].filename) { - free(inc_stack[inc_stackptr].filename); - inc_stack[inc_stackptr].filename = NULL; - } - inc_stackptr--; - yy_delete_buffer(YY_CURRENT_BUFFER); - yy_switch_to_buffer(inc_stack[inc_stackptr].state); + if (inc_stack[inc_stackptr].filename) { + free(inc_stack[inc_stackptr].filename); + inc_stack[inc_stackptr].filename = NULL; + } + inc_stackptr--; + yy_delete_buffer(YY_CURRENT_BUFFER); + yy_switch_to_buffer(inc_stack[inc_stackptr].state); } - } + } %% long int lineno(void) { - return inc_stack[inc_stackptr].lineno; + return inc_stack[inc_stackptr].lineno; } /* FIXME: make this return an immutable string */ -char * filename(void) { - return inc_stack[inc_stackptr].filename ?: strdup("(standard input)"); +char *filename(void) { + return inc_stack[inc_stackptr].filename ? inc_stack[inc_stackptr].filename + : strdup("(standard input)"); } -static void scan_err(const char * fmt, ...) { - va_list args; +static void scan_err(const char *fmt, ...) { + va_list args; - va_start(args, fmt); - if (inc_stackptr >= 0) - fprintf(stderr, "%s:%ld: ", filename(), lineno()); - vfprintf(stderr, fmt, args); - fprintf(stderr, "\n"); + va_start(args, fmt); + if (inc_stackptr >= 0) + fprintf(stderr, "%s:%ld: ", filename(), lineno()); + vfprintf(stderr, fmt, args); + fprintf(stderr, "\n"); } +void step_into_include_file(const char *fn) { + FILE *f; -void step_into_include_file(const char * fn) { - FILE * f; - - if (!(f = fopen(fn, "r"))) { - scan_err("warning: can't open file \"%s\"", fn); - } else { - inc_stack[inc_stackptr++].state = YY_CURRENT_BUFFER; - inc_stack[inc_stackptr].lineno = 1; - inc_stack[inc_stackptr].filename = strdup(fn); - yyin = f; - yy_switch_to_buffer(yy_create_buffer(yyin, YY_BUF_SIZE)); - } + if (inc_stackptr >= MAXINCLUDES - 1) { + scan_err("warning: too many nested includes"); + scan_err("warning: skipping include of file \"%s\"", fn); + return; + } + + if (!(f = fopen(fn, "r"))) { + scan_err("warning: can't open file \"%s\"", fn); + } else { + inc_stack[inc_stackptr++].state = YY_CURRENT_BUFFER; + inc_stack[inc_stackptr].lineno = 1; + inc_stack[inc_stackptr].filename = strdup(fn); + yyin = f; + yy_switch_to_buffer(yy_create_buffer(yyin, YY_BUF_SIZE)); + } } /* include a file or directory */ -void include_file(const char * name) { - struct stat st; - DIR * d; - struct dirent * r; - char * fn; - - if (stat(name, &st)) { - scan_err("warning: stat failed on %s: %s", name, strerror(errno)); - } else { - if (S_ISDIR(st.st_mode)) { - if ((d = opendir(name)) == NULL) { - scan_err("warning: opendir failed on %s: %s", name, strerror(errno)); - } else { - while ((r = readdir(d)) != NULL) { - /* FIXME: assumes d_name */ - if (r->d_name[0] == '.') - continue; - asprintf(&fn, "%s/%s", name, r->d_name); - include_file(fn); - free(fn); - } - closedir(d); - } - } else - step_into_include_file(name); - } +void include_file(const char *name) { + struct stat st; + struct dirent **namelist; + char *fn; + int n; + + if (stat(name, &st)) { + if (errno == ENOENT && + (index(name, '*') != NULL || index(name, '?') != NULL || + index(name, '[') != NULL)) { + /* Globbing fiesta! */ + glob_t glob_buf; + if (glob(name, 0, NULL, &glob_buf) != 0) { + scan_err("warning: failed to glob %s: %s", name, strerror(errno)); + } else { + /* We go through the list of files backwards, because + * step_into_include_file() creates a stack of all the + * files processed and then works on them in a LIFO + * fashion -- which would make all of our rules files + * go backwards. Since I can't wrap my head around + * why that is, exactly, I'm hacking it up with + * this instead. Fixination appreciated. + */ + for (n = glob_buf.gl_pathc - 1; n >= 0; n--) { + if (stat(glob_buf.gl_pathv[n], &st)) { + scan_err("warning: stat failed on globbed %s: %s", + glob_buf.gl_pathv[n], strerror(errno)); + } else if (S_ISREG(st.st_mode) || S_ISLNK(st.st_mode)) { + step_into_include_file(glob_buf.gl_pathv[n]); + } + } + } + + globfree(&glob_buf); + } else { + scan_err("warning: stat failed on %s: %s", name, strerror(errno)); + } + } else { + if (S_ISDIR(st.st_mode)) { + if ((n = scandir(name, &namelist, NULL, alphasort)) < 0) { + scan_err("warning: scandir failed on %s: %s", name, strerror(errno)); + } else { + while (n--) { + /* FIXME: assumes d_name */ + if (namelist[n]->d_name[0] == '.') { + free(namelist[n]); + continue; + } + if (asprintf(&fn, "%s/%s", name, namelist[n]->d_name) < 0) { + scan_err("internal error: asprintf failed constructing pathname " + "for included file %s", + namelist[n]->d_name); + free(fn); + } else { + include_file(fn); + free(fn); + } + free(namelist[n]); + } + free(namelist); + } + } else { + step_into_include_file(name); + } + } } diff -Nru filtergen-0.12.4/t/.arch-inventory filtergen-0.12.7/t/.arch-inventory --- filtergen-0.12.4/t/.arch-inventory 2016-02-18 07:59:36.000000000 +0000 +++ filtergen-0.12.7/t/.arch-inventory 1970-01-01 00:00:00.000000000 +0000 @@ -1,5 +0,0 @@ -precious ^convert$ -precious ^emit$ -precious ^factorise$ -precious ^parse$ -precious ^scan$ diff -Nru filtergen-0.12.4/t/convert.c filtergen-0.12.7/t/convert.c --- filtergen-0.12.4/t/convert.c 2004-05-15 03:26:48.000000000 +0000 +++ filtergen-0.12.7/t/convert.c 2016-02-13 10:52:59.000000000 +0000 @@ -9,180 +9,182 @@ extern int convtrace; int yyparse(void *); -struct filter * convert(struct ast_s *); +struct filter *convert(struct ast_s *, struct filtergen_opts *); #endif -void emit_filter(struct filter * f) { - int i; +void emit_filter(struct filter *f) { + int i; - indent+=2; - for (i = 0; i < indent; i++) { - printf(" "); - }; - printf("( "); - if (!f) { - printf("error: emit_filter called with NULL\n"); - return; - } - switch (f->type) { - case F_DIRECTION: - switch (f->u.ifinfo.direction) { - case INPUT: - printf("input"); - break; - case OUTPUT: - printf("output"); - break; - default: - printf("error: encountered a direction %d\n", (int) f->u.ifinfo.direction); - break; - } - printf(" %s\n", f->u.ifinfo.iface); - break; - case F_TARGET: - switch(f->u.target) { - case T_ACCEPT: - printf("accept\n"); - break; - case DROP: - printf("drop\n"); - break; - case T_REJECT: - printf("reject\n"); - break; - case MASQ: - printf("masq\n"); - break; - case REDIRECT: - printf("redirect\n"); - break; - default: - printf("error: encountered a target %d\n", (int) f->u.target); - break; - } - break; - case F_SOURCE: - printf("source %s", f->u.addrs.addrstr); - if (f->u.addrs.maskstr) - printf("/%s", f->u.addrs.maskstr); - printf("\n"); - break; - case F_DEST: - printf("dest %s", f->u.addrs.addrstr); - if (f->u.addrs.maskstr) - printf("/%s", f->u.addrs.maskstr); - printf("\n"); - break; - case F_SPORT: - printf("sport %s", f->u.ports.minstr); - if (f->u.ports.maxstr) - printf(":%s", f->u.ports.maxstr); - printf("\n"); - break; - case F_DPORT: - printf("dport %s", f->u.ports.minstr); - if (f->u.ports.maxstr) - printf(":%s", f->u.ports.maxstr); - printf("\n"); - break; - case F_ICMPTYPE: - printf("icmptype %s\n", f->u.icmp); - break; - case F_PROTO: - printf("proto %s\n", f->u.proto.name); - break; - case F_NEG: - printf("neg\n"); - emit_filter(f->u.neg); - break; - case F_SIBLIST: - printf("siblist\n"); - emit_filter(f->u.sib); - break; - case F_SUBGROUP: - printf("subgroup \"%s\"\n", f->u.sub.name); - emit_filter(f->u.sub.list); - break; - case F_LOG: - if (f->u.logmsg) { - printf("log \"%s\"\n", f->u.logmsg); - } else { - printf("log \"\"\n"); - } - break; - case F_RTYPE: - switch (f->u.rtype) { - case ROUTEDONLY: - printf("forward\n"); - break; - case LOCALONLY: - printf("local\n"); - break; - case F_ONEWAY: - printf("oneway\n"); - break; - default: - printf("error: encountered a rtype %d\n", (int) f->u.rtype); - break; - } - break; - default: - printf("error: encountered a token %d\n", (int) f->type); - break; - } + indent += 2; + for (i = 0; i < indent; i++) { + printf(" "); + }; + printf("( "); + if (!f) { + printf("error: emit_filter called with NULL\n"); + return; + } + switch (f->type) { + case F_DIRECTION: + switch (f->u.ifinfo.direction) { + case INPUT: + printf("input"); + break; + case OUTPUT: + printf("output"); + break; + default: + printf("error: encountered a direction %d\n", (int)f->u.ifinfo.direction); + break; + } + printf(" %s\n", f->u.ifinfo.iface); + break; + case F_TARGET: + switch (f->u.target) { + case T_ACCEPT: + printf("accept\n"); + break; + case DROP: + printf("drop\n"); + break; + case T_REJECT: + printf("reject\n"); + break; + case MASQ: + printf("masq\n"); + break; + case REDIRECT: + printf("redirect\n"); + break; + default: + printf("error: encountered a target %d\n", (int)f->u.target); + break; + } + break; + case F_SOURCE: + printf("source %s", f->u.addrs.addrstr); + if (f->u.addrs.maskstr) + printf("/%s", f->u.addrs.maskstr); + printf("\n"); + break; + case F_DEST: + printf("dest %s", f->u.addrs.addrstr); + if (f->u.addrs.maskstr) + printf("/%s", f->u.addrs.maskstr); + printf("\n"); + break; + case F_SPORT: + printf("sport %s", f->u.ports.minstr); + if (f->u.ports.maxstr) + printf(":%s", f->u.ports.maxstr); + printf("\n"); + break; + case F_DPORT: + printf("dport %s", f->u.ports.minstr); + if (f->u.ports.maxstr) + printf(":%s", f->u.ports.maxstr); + printf("\n"); + break; + case F_ICMPTYPE: + printf("icmptype %s\n", f->u.icmp); + break; + case F_PROTO: + printf("proto %s\n", f->u.proto.name); + break; + case F_NEG: + printf("neg\n"); + emit_filter(f->u.neg); + break; + case F_SIBLIST: + printf("siblist\n"); + emit_filter(f->u.sib); + break; + case F_SUBGROUP: + printf("subgroup \"%s\"\n", f->u.sub.name); + emit_filter(f->u.sub.list); + break; + case F_LOG: + if (f->u.logmsg) { + printf("log \"%s\"\n", f->u.logmsg); + } else { + printf("log \"\"\n"); + } + break; + case F_RTYPE: + switch (f->u.rtype) { + case ROUTEDONLY: + printf("forward\n"); + break; + case LOCALONLY: + printf("local\n"); + break; + case F_ONEWAY: + printf("oneway\n"); + break; + default: + printf("error: encountered a rtype %d\n", (int)f->u.rtype); + break; + } + break; + default: + printf("error: encountered a token %d\n", (int)f->type); + break; + } - if (f->child) { - for (i = 0; i < indent; i++) - printf(" "); - printf(" child\n"); - emit_filter(f->child); - } - if (f->next) { - for (i = 0; i < indent; i++) - printf(" "); - printf(" next\n"); - emit_filter(f->next); - } - /* + if (f->child) { for (i = 0; i < indent; i++) - printf(" "); - printf(" negate: %d\n", f->negate); - */ + printf(" "); + printf(" child\n"); + emit_filter(f->child); + } + if (f->next) { for (i = 0; i < indent; i++) - printf(" "); - printf(" )\n"); - indent -= 2; + printf(" "); + printf(" next\n"); + emit_filter(f->next); + } + /* + for (i = 0; i < indent; i++) + printf(" "); + printf(" negate: %d\n", f->negate); + */ + for (i = 0; i < indent; i++) + printf(" "); + printf(" )\n"); + indent -= 2; } -int main(int argc __attribute__((unused)), char ** argv __attribute__((unused))) { - struct filter * f = NULL; +int main(int argc __attribute__((unused)), + char **argv __attribute__((unused))) { + struct filter *f = NULL; + struct filtergen_opts o = {AF_INET}; #ifndef FILTER_EMIT - char * CONVTRACE; - struct ast_s ast; - int r; - - CONVTRACE = getenv("CONVTRACE"); - convtrace = CONVTRACE ? atoi(CONVTRACE) : 0; - - r = yyparse((void *) &ast); - - if (r != 0) { - printf("yyparse returned %d\n", r); - return 1; - } + char *CONVTRACE; + struct ast_s ast; + int r; - f = convert(&ast); + CONVTRACE = getenv("CONVTRACE"); + convtrace = CONVTRACE ? atoi(CONVTRACE) : 0; + + r = yyparse((void *)&ast); + + if (r != 0) { + printf("yyparse returned %d\n", r); + return 1; + } + + f = convert(&ast, &o); #else - filter_fopen(NULL); + filter_fopen(NULL); - f = filter_parse_list(); + f = filter_parse_list(); #endif - if (!f) { - printf("convert returned NULL\n"); - return 1; - } + if (!f) { + printf("convert returned NULL\n"); + return 1; + } - emit_filter(f); - return 0; + emit_filter(f); + return 0; } diff -Nru filtergen-0.12.4/t/data/emitter9.in filtergen-0.12.7/t/data/emitter9.in --- filtergen-0.12.4/t/data/emitter9.in 2004-05-15 03:26:29.000000000 +0000 +++ filtergen-0.12.7/t/data/emitter9.in 2016-02-13 10:52:59.000000000 +0000 @@ -9,6 +9,8 @@ source 127.0.0.1/255.255; source 127.0.0.1/255.255.0; source 127.0.0.1/255.255.255.255; +source ::1/64; +source ::127.0.0.1/64; dest foo; dest foo/32; dest foo/255.0; @@ -19,6 +21,8 @@ dest 127.0.0.1/255.255; dest 127.0.0.1/255.255.0; dest 127.0.0.1/255.255.255.255; +dest ::1/64; +dest ::127.0.0.1/64; dest { foo foo/32 @@ -27,6 +31,8 @@ 127.0.0.1 127.0.0.1/24 127.0.0.1/255.255.255.0 + ::1/64 + ::127.0.0.1/64 }; source { foo @@ -36,4 +42,6 @@ 127.0.0.1 127.0.0.1/24 127.0.0.1/255.255.255.0 -}; \ No newline at end of file + ::1/64 + ::127.0.0.1/64 +}; diff -Nru filtergen-0.12.4/t/data/emitter9.out filtergen-0.12.7/t/data/emitter9.out --- filtergen-0.12.4/t/data/emitter9.out 2004-05-15 03:26:42.000000000 +0000 +++ filtergen-0.12.7/t/data/emitter9.out 2016-02-13 10:52:59.000000000 +0000 @@ -8,6 +8,8 @@ source { 127.0.0.1/255.255 }; source { 127.0.0.1/255.255.0 }; source { 127.0.0.1/255.255.255.255 }; +source { ::1/64 }; +source { ::127.0.0.1/64 }; dest { foo }; dest { foo/32 }; dest { foo/255.0 }; @@ -18,5 +20,7 @@ dest { 127.0.0.1/255.255 }; dest { 127.0.0.1/255.255.0 }; dest { 127.0.0.1/255.255.255.255 }; -dest { foo foo/32 foo/255.0 foo/255.255.255.0 127.0.0.1 127.0.0.1/24 127.0.0.1/255.255.255.0 }; -source { foo foo/32 foo/255.0 foo/255.255.255.0 127.0.0.1 127.0.0.1/24 127.0.0.1/255.255.255.0 }; +dest { ::1/64 }; +dest { ::127.0.0.1/64 }; +dest { foo foo/32 foo/255.0 foo/255.255.255.0 127.0.0.1 127.0.0.1/24 127.0.0.1/255.255.255.0 ::1/64 ::127.0.0.1/64 }; +source { foo foo/32 foo/255.0 foo/255.255.255.0 127.0.0.1 127.0.0.1/24 127.0.0.1/255.255.255.0 ::1/64 ::127.0.0.1/64 }; diff -Nru filtergen-0.12.4/t/data/parser7.in filtergen-0.12.7/t/data/parser7.in --- filtergen-0.12.4/t/data/parser7.in 2004-05-15 03:26:22.000000000 +0000 +++ filtergen-0.12.7/t/data/parser7.in 2016-02-13 10:52:59.000000000 +0000 @@ -7,4 +7,7 @@ source 127.0.0.1/32; source 127.0.0.1/255.255.255.255; source mail.example.com; -source mail.example.com/24; \ No newline at end of file +source mail.example.com/24; +source ::/128; +source 0123:4567:89ab:cdef:0123:4567:89AB:CDEF; +source 1:2:3:4::/32; diff -Nru filtergen-0.12.4/t/data/scanner12.out filtergen-0.12.7/t/data/scanner12.out --- filtergen-0.12.4/t/data/scanner12.out 2004-05-15 03:26:20.000000000 +0000 +++ filtergen-0.12.7/t/data/scanner12.out 2016-02-13 10:52:59.000000000 +0000 @@ -1,2 +1,2 @@ data/scanner12.in:1: warning: too many nested includes -data/scanner12.in:1: warning: skipping include of file data/scanner12.in +data/scanner12.in:1: warning: skipping include of file "data/scanner12.in" diff -Nru filtergen-0.12.4/t/data/scanner5.in filtergen-0.12.7/t/data/scanner5.in --- filtergen-0.12.4/t/data/scanner5.in 2004-05-15 03:26:34.000000000 +0000 +++ filtergen-0.12.7/t/data/scanner5.in 2016-02-13 09:44:55.000000000 +0000 @@ -6,3 +6,4 @@ / : ! +* diff -Nru filtergen-0.12.4/t/data/scanner5.out filtergen-0.12.7/t/data/scanner5.out --- filtergen-0.12.4/t/data/scanner5.out 2004-05-15 03:26:34.000000000 +0000 +++ filtergen-0.12.7/t/data/scanner5.out 2016-02-13 09:44:55.000000000 +0000 @@ -6,3 +6,4 @@ kind = slash, spelling = "/", file = "(standard input)", line = 6 kind = colon, spelling = ":", file = "(standard input)", line = 7 kind = bang, spelling = "!", file = "(standard input)", line = 8 +kind = star, spelling = "*", file = "(standard input)", line = 9 diff -Nru filtergen-0.12.4/t/data/scanner8.in filtergen-0.12.7/t/data/scanner8.in --- filtergen-0.12.4/t/data/scanner8.in 2004-05-15 03:26:18.000000000 +0000 +++ filtergen-0.12.7/t/data/scanner8.in 2016-02-13 10:52:59.000000000 +0000 @@ -4,3 +4,9 @@ http bar/29 bar/255.255.255.248 +0123:4567:89ab:cdef:0123:4567:89AB:CDEF +1:2:3:4:: +::5:6:7:8 +1:2:3:4::5:6:7:8 +::ffff:127.0.0.1 +:: diff -Nru filtergen-0.12.4/t/data/scanner8.out filtergen-0.12.7/t/data/scanner8.out --- filtergen-0.12.4/t/data/scanner8.out 2004-05-15 03:26:34.000000000 +0000 +++ filtergen-0.12.7/t/data/scanner8.out 2016-02-13 10:52:59.000000000 +0000 @@ -9,3 +9,9 @@ kind = identifier, spelling = "bar", file = "(standard input)", line = 6 kind = slash, spelling = "/", file = "(standard input)", line = 6 kind = identifier, spelling = "255.255.255.248", file = "(standard input)", line = 6 +kind = identifier, spelling = "0123:4567:89ab:cdef:0123:4567:89AB:CDEF", file = "(standard input)", line = 7 +kind = identifier, spelling = "1:2:3:4::", file = "(standard input)", line = 8 +kind = identifier, spelling = "::5:6:7:8", file = "(standard input)", line = 9 +kind = identifier, spelling = "1:2:3:4::5:6:7:8", file = "(standard input)", line = 10 +kind = identifier, spelling = "::ffff:127.0.0.1", file = "(standard input)", line = 11 +kind = identifier, spelling = "::", file = "(standard input)", line = 12 diff -Nru filtergen-0.12.4/t/data/scanner9.out filtergen-0.12.7/t/data/scanner9.out --- filtergen-0.12.4/t/data/scanner9.out 2004-05-15 03:26:21.000000000 +0000 +++ filtergen-0.12.7/t/data/scanner9.out 2016-02-13 09:44:55.000000000 +0000 @@ -1,4 +1,4 @@ -kind = UNRECOGNISED, spelling = "*", file = "(standard input)", line = 1 -kind = UNRECOGNISED, spelling = "*", file = "(standard input)", line = 1 -kind = UNRECOGNISED, spelling = "*", file = "(standard input)", line = 1 +kind = star, spelling = "*", file = "(standard input)", line = 1 +kind = star, spelling = "*", file = "(standard input)", line = 1 +kind = star, spelling = "*", file = "(standard input)", line = 1 kind = slash, spelling = "/", file = "(standard input)", line = 1 diff -Nru filtergen-0.12.4/t/emit.c filtergen-0.12.7/t/emit.c --- filtergen-0.12.4/t/emit.c 2004-05-15 03:26:48.000000000 +0000 +++ filtergen-0.12.7/t/emit.c 2016-02-13 10:52:59.000000000 +0000 @@ -10,312 +10,321 @@ int yyparse(void *); int emittrace = 0; -#define EMIT(x) void emit_##x(struct x##_s * n) +#define EMIT(x) void emit_##x(struct x##_s *n) -#define eprint(x) if (emittrace) fprintf(stderr, x) +#define eprint(x) \ + if (emittrace) \ + fprintf(stderr, x) EMIT(specifier_list); EMIT(subrule_list) { - if (n->subrule_list) { - eprint("emitting subrule_list\n"); - emit_subrule_list(n->subrule_list); - printf(";\n"); - } - if (n->specifier_list) { - eprint("emitting specifier_list\n"); - emit_specifier_list(n->specifier_list); - } + if (n->subrule_list) { + eprint("emitting subrule_list\n"); + emit_subrule_list(n->subrule_list); + printf(";\n"); + } + if (n->specifier_list) { + eprint("emitting specifier_list\n"); + emit_specifier_list(n->specifier_list); + } } EMIT(chaingroup_specifier) { - printf("["); - if (n->name) { - printf(" \"%s\"", n->name); - } - printf("\n"); - eprint("emitting subrule_list\n"); - emit_subrule_list(n->list); - printf("]"); + printf("["); + if (n->name) { + printf(" \"%s\"", n->name); + } + printf("\n"); + eprint("emitting subrule_list\n"); + emit_subrule_list(n->list); + printf("]"); } EMIT(compound_specifier) { - printf("{"); - if (n->list) { - eprint("emitting subrule_list\n"); - emit_subrule_list(n->list); - } - printf("}"); + printf("{"); + if (n->list) { + eprint("emitting subrule_list\n"); + emit_subrule_list(n->list); + } + printf("}"); } EMIT(option_specifier) { - switch (n->type) { - case TOK_LOCAL: - printf("local"); break; - case TOK_FORWARD: - printf("forward"); break; - case TOK_ONEWAY: - printf("oneway"); break; - case TOK_LOG: - if (n->logmsg) { - printf("log text \"%s\"", n->logmsg); - } else { - printf("log"); - } - break; - default: - printf("error"); break; + switch (n->type) { + case TOK_LOCAL: + printf("local"); + break; + case TOK_FORWARD: + printf("forward"); + break; + case TOK_ONEWAY: + printf("oneway"); + break; + case TOK_LOG: + if (n->logmsg) { + printf("log text \"%s\"", n->logmsg); + } else { + printf("log"); } + break; + default: + printf("error"); + break; + } } -EMIT(icmptype_argument) { - printf("%s", n->icmptype); -} +EMIT(icmptype_argument) { printf("%s", n->icmptype); } EMIT(icmptype_argument_list) { - if (n->list) { - emit_icmptype_argument_list(n->list); - printf(" "); - } - emit_icmptype_argument(n->arg); + if (n->list) { + emit_icmptype_argument_list(n->list); + printf(" "); + } + emit_icmptype_argument(n->arg); } EMIT(icmptype_specifier) { - printf("icmptype { "); - if (n->list) - emit_icmptype_argument_list(n->list); - printf(" }"); + printf("icmptype { "); + if (n->list) + emit_icmptype_argument_list(n->list); + printf(" }"); } -EMIT(protocol_argument) { - printf("%s", n->proto); -} +EMIT(protocol_argument) { printf("%s", n->proto); } EMIT(protocol_argument_list) { - if (n->list) { - eprint("emitting protocol_argument_list\n"); - emit_protocol_argument_list(n->list); - printf(" "); - } - eprint("emitting protocol_argument\n"); - emit_protocol_argument(n->arg); + if (n->list) { + eprint("emitting protocol_argument_list\n"); + emit_protocol_argument_list(n->list); + printf(" "); + } + eprint("emitting protocol_argument\n"); + emit_protocol_argument(n->arg); } EMIT(protocol_specifier) { - printf("proto { "); - if (n->list) { - eprint("emitting protocol_argument\n"); - emit_protocol_argument_list(n->list); - } - printf(" }"); + printf("proto { "); + if (n->list) { + eprint("emitting protocol_argument\n"); + emit_protocol_argument_list(n->list); + } + printf(" }"); } EMIT(port_argument) { - if (n->port_min) { - printf("%s", n->port_min); - } - if (n->port_max) { - printf(":%s", n->port_max); - } + if (n->port_min) { + printf("%s", n->port_min); + } + if (n->port_max) { + printf(":%s", n->port_max); + } } EMIT(port_argument_list) { - if (n->list) { - eprint("emitting port_argument_list\n"); - emit_port_argument_list(n->list); - printf(" "); - } - eprint("emitting port_argument\n"); - emit_port_argument(n->arg); + if (n->list) { + eprint("emitting port_argument_list\n"); + emit_port_argument_list(n->list); + printf(" "); + } + eprint("emitting port_argument\n"); + emit_port_argument(n->arg); } EMIT(port_specifier) { - if (n->type == TOK_DPORT) { - printf("dport "); - } else if (n->type == TOK_SPORT) { - printf("sport "); - } - printf("{ "); - if (n->list) - emit_port_argument_list(n->list); - printf(" }"); + if (n->type == TOK_DPORT) { + printf("dport "); + } else if (n->type == TOK_SPORT) { + printf("sport "); + } + printf("{ "); + if (n->list) + emit_port_argument_list(n->list); + printf(" }"); } EMIT(host_argument) { - if (n->host) { - printf("%s", n->host); - } - if (n->mask) { - printf("/%s", n->mask); - } + if (n->host) { + printf("%s", n->host); + } + if (n->mask) { + printf("/%s", n->mask); + } } EMIT(host_argument_list) { - if (n->list) { - emit_host_argument_list(n->list); - printf(" "); - } - emit_host_argument(n->arg); + if (n->list) { + emit_host_argument_list(n->list); + printf(" "); + } + emit_host_argument(n->arg); } EMIT(host_specifier) { - if (n->type == TOK_SOURCE) { - printf("source "); - } else if (n->type == TOK_DEST) { - printf("dest "); - } - printf("{ "); - if (n->list) - emit_host_argument_list(n->list); - printf(" }"); + if (n->type == TOK_SOURCE) { + printf("source "); + } else if (n->type == TOK_DEST) { + printf("dest "); + } + printf("{ "); + if (n->list) + emit_host_argument_list(n->list); + printf(" }"); } EMIT(target_specifier) { - switch (n->type) { - case TOK_ACCEPT: - printf("accept"); break; - case TOK_REJECT: - printf("reject"); break; - case TOK_DROP: - printf("drop"); break; - case TOK_REDIRECT: - printf("redirect"); break; - case TOK_MASQ: - printf("masq"); break; - break; - default: - printf("error"); break; - } + switch (n->type) { + case TOK_ACCEPT: + printf("accept"); + break; + case TOK_REJECT: + printf("reject"); + break; + case TOK_DROP: + printf("drop"); + break; + case TOK_REDIRECT: + printf("redirect"); + break; + case TOK_MASQ: + printf("masq"); + break; + break; + default: + printf("error"); + break; + } } EMIT(direction_argument) { - eprint("emitting direction\n"); - if (n->direction) - printf("%s", n->direction); - else - printf("error: n->direction is NULL\n"); + eprint("emitting direction\n"); + if (n->direction) + printf("%s", n->direction); + else + printf("error: n->direction is NULL\n"); } EMIT(direction_argument_list) { - if (n->list) { - eprint("emitting direction_argument_list\n"); - emit_direction_argument_list(n->list); - printf(" "); - } - if (n->arg) { - eprint("emitting direction_argument\n"); - emit_direction_argument(n->arg); - } + if (n->list) { + eprint("emitting direction_argument_list\n"); + emit_direction_argument_list(n->list); + printf(" "); + } + if (n->arg) { + eprint("emitting direction_argument\n"); + emit_direction_argument(n->arg); + } } EMIT(direction_specifier) { - if (n->type == TOK_INPUT) { - printf("input "); - } else { - printf("output "); - } - printf("{ "); - if (n->list) { - eprint("emitting direction_argument\n"); - emit_direction_argument_list(n->list); - } - printf(" }"); + if (n->type == TOK_INPUT) { + printf("input "); + } else { + printf("output "); + } + printf("{ "); + if (n->list) { + eprint("emitting direction_argument\n"); + emit_direction_argument_list(n->list); + } + printf(" }"); } EMIT(specifier) { - if (n->compound) { - eprint("emitting compound_specifier\n"); - emit_compound_specifier(n->compound); - } else if (n->direction) { - eprint("emitting direction_specifier\n"); - emit_direction_specifier(n->direction); - } else if (n->target) { - eprint("emitting target_specifier\n"); - emit_target_specifier(n->target); - } else if (n->host) { - eprint("emitting host_specifier\n"); - emit_host_specifier(n->host); - } else if (n->port) { - eprint("emitting port_specifier\n"); - emit_port_specifier(n->port); - } else if (n->protocol) { - eprint("emitting protocol_specifier\n"); - emit_protocol_specifier(n->protocol); - } else if (n->icmptype) { - eprint("emitting icmptype_specifier\n"); - emit_icmptype_specifier(n->icmptype); - } else if (n->option) { - eprint("emitting routing_specifier\n"); - emit_option_specifier(n->option); - } else { - eprint("emitting chaingroup_specifier\n"); - emit_chaingroup_specifier(n->chaingroup); - } + if (n->compound) { + eprint("emitting compound_specifier\n"); + emit_compound_specifier(n->compound); + } else if (n->direction) { + eprint("emitting direction_specifier\n"); + emit_direction_specifier(n->direction); + } else if (n->target) { + eprint("emitting target_specifier\n"); + emit_target_specifier(n->target); + } else if (n->host) { + eprint("emitting host_specifier\n"); + emit_host_specifier(n->host); + } else if (n->port) { + eprint("emitting port_specifier\n"); + emit_port_specifier(n->port); + } else if (n->protocol) { + eprint("emitting protocol_specifier\n"); + emit_protocol_specifier(n->protocol); + } else if (n->icmptype) { + eprint("emitting icmptype_specifier\n"); + emit_icmptype_specifier(n->icmptype); + } else if (n->option) { + eprint("emitting routing_specifier\n"); + emit_option_specifier(n->option); + } else { + eprint("emitting chaingroup_specifier\n"); + emit_chaingroup_specifier(n->chaingroup); + } } EMIT(negated_specifier) { - if (n->negated) { - printf("! "); - } - eprint("emitting specifier\n"); - emit_specifier(n->spec); + if (n->negated) { + printf("! "); + } + eprint("emitting specifier\n"); + emit_specifier(n->spec); } EMIT(specifier_list) { - if (n->list) { - eprint("emitting specifier_list\n"); - emit_specifier_list(n->list); - /* specifiers are separated by spaces */ - printf(" "); - } - eprint("emitting negated_specifier\n"); - emit_negated_specifier(n->spec); + if (n->list) { + eprint("emitting specifier_list\n"); + emit_specifier_list(n->list); + /* specifiers are separated by spaces */ + printf(" "); + } + eprint("emitting negated_specifier\n"); + emit_negated_specifier(n->spec); } EMIT(rule) { - if (n->list) { - eprint("emitting specifier_list\n"); - emit_specifier_list(n->list); - } - /* rules end in a semicolon and newline */ - printf(";\n"); + if (n->list) { + eprint("emitting specifier_list\n"); + emit_specifier_list(n->list); + } + /* rules end in a semicolon and newline */ + printf(";\n"); } EMIT(rule_list) { - if (n->list) { - eprint("emitting rule_list\n"); - emit_rule_list(n->list); - } - if (n->rule) { - eprint("emitting rule\n"); - emit_rule(n->rule); - } + if (n->list) { + eprint("emitting rule_list\n"); + emit_rule_list(n->list); + } + if (n->rule) { + eprint("emitting rule\n"); + emit_rule(n->rule); + } } EMIT(ast) { - if (n->list) { - eprint("emitting rule_list\n"); - emit_rule_list(n->list); - } + if (n->list) { + eprint("emitting rule_list\n"); + emit_rule_list(n->list); + } } -int main(int argc __attribute__((unused)), char ** argv __attribute__((unused))) { - char * EMITTRACE; - struct ast_s ast; - int res; - - EMITTRACE = getenv("EMITTRACE"); - emittrace = EMITTRACE ? atoi(EMITTRACE) : 0; - - res = yyparse((void *)&ast); - - if (res != 0) { - printf("yyparse returned %d\n", res); - return 1; - } +int main(int argc __attribute__((unused)), + char **argv __attribute__((unused))) { + char *EMITTRACE; + struct ast_s ast; + int res; + + EMITTRACE = getenv("EMITTRACE"); + emittrace = EMITTRACE ? atoi(EMITTRACE) : 0; + + res = yyparse((void *)&ast); + + if (res != 0) { + printf("yyparse returned %d\n", res); + return 1; + } - eprint("emitting ast\n"); - emit_ast(&ast); + eprint("emitting ast\n"); + emit_ast(&ast); - return 0; + return 0; } diff -Nru filtergen-0.12.4/t/factorise.c filtergen-0.12.7/t/factorise.c --- filtergen-0.12.4/t/factorise.c 2004-05-15 03:26:48.000000000 +0000 +++ filtergen-0.12.7/t/factorise.c 2016-02-13 10:52:59.000000000 +0000 @@ -11,208 +11,210 @@ int nesting = 0; void nest() { - int i; + int i; - for (i = 0; i < nesting; i++) - printf(" "); - printf("("); - nesting++; + for (i = 0; i < nesting; i++) + printf(" "); + printf("("); + nesting++; } void unnest() { - int i; + int i; - for (i = 0; i < nesting; i++) printf(" "); - printf(")\n"); - nesting--; -} - -void emit_negated_specifier(struct negated_specifier_s * n); - -void emit_compound_specifier(struct compound_specifier_s * n) { - struct subrule_list_s * s; - struct specifier_list_s * t; - - if (n->list) { - int count = 0; - - for (s = n->list; s; s = s->subrule_list) - count++; - if (count > 1) { - nest(); - printf("or\n"); - } - for (s = n->list; s; s = s->subrule_list) { - if (s->specifier_list) { - int count0 = 0; - - for (t = s->specifier_list; t; t = t->list) - count0++; - if (count0 > 1) { - nest(); - printf("and\n"); - } - for (t = s->specifier_list; t; t = t->list) { - if (t->spec) - emit_negated_specifier(t->spec); - } - if (count0 > 1) - unnest(); - } - } - if (count > 1) - unnest(); - } -} - -void emit_specifier(struct specifier_s * n) { - if (n->direction) { - if (n->direction->list) { - struct direction_argument_list_s * l; - int count = 0; - - for (l = n->direction->list; l; l = l->list) - count++; - if (count > 1) { - nest(); - printf("or\n"); - } - for (l = n->direction->list; l; l = l->list) { - if (l->arg) { - nest(); - printf("direction %s\n", l->arg->direction); - unnest(); - } - } - if (count > 1) - unnest(); - } - } else if (n->target) { - nest(); - printf("target\n"); - unnest(); - } else if (n->host) { - if (n->host->list) { - struct host_argument_list_s * l; - int count = 0; - - for (l = n->host->list; l; l = l->list) - count++; - if (count > 1) { - nest(); - printf("or\n"); - } - for (l = n->host->list; l; l = l->list) { - if (l->arg) { - nest(); - printf("host %s\n", l->arg->host); - unnest(); - } - } - if (count > 1) - unnest(); - } - } else if (n->port) { - nest(); - printf("port\n"); - unnest(); - } else if (n->protocol) { - nest(); - printf("protocol\n"); - unnest(); - } else if (n->icmptype) { - nest(); - printf("icmptype\n"); - unnest(); - } else if (n->option) { - nest(); - printf("option\n"); - unnest(); - } else if (n->chaingroup) { - nest(); - printf("chaingroup FIXME\n"); - unnest(); - } else if (n->compound) { - emit_compound_specifier(n->compound); - } -} - -void emit_negated_specifier(struct negated_specifier_s * n) { - if (n->spec) { - if (n->negated) { - nest(); - printf("not\n"); - } - emit_specifier(n->spec); - if (n->negated) { - unnest(); - } - } -} - -void emit_rule(struct rule_s * n) { - struct specifier_list_s * s; - - if (n->list) { - int count = 0; - - for (s = n->list; s; s = s->list) - count++; - if (count > 1) { - nest(); - /* specifiers have implicit AND */ - printf("and\n"); - } - - for (s = n->list; s; s = s->list) { - if (s->spec) { - emit_negated_specifier(s->spec); - } - } - if (count > 1) - unnest(); - } -} - -void emit_ast(struct ast_s * n) { - struct rule_list_s * r; - if (n->list) { - int count = 0; - - for (r = n->list; r; r = r->list) - count++; - if (count > 1) { - nest(); - /* semicolons are OR */ - printf("or\n"); - } - for (r = n->list; r; r = r->list) { - if (r->rule) { - emit_rule(r->rule); - } - } - if (count > 1) - unnest(); - } -} - -int main(int argc __attribute__((unused)), char ** argv __attribute__((unused))) { - char * FACTTRACE; - struct ast_s ast; - int r; - - FACTTRACE = getenv("FACTTRACE"); - facttrace = FACTTRACE ? atoi(FACTTRACE) : 0; - - r = yyparse((void *) &ast); - if (r != 0) { - printf("yyparse returned %d\n", r); - return 1; - } - - /* do magic */ - /* factorise(&ast); */ + for (i = 0; i < nesting; i++) + printf(" "); + printf(")\n"); + nesting--; +} + +void emit_negated_specifier(struct negated_specifier_s *n); + +void emit_compound_specifier(struct compound_specifier_s *n) { + struct subrule_list_s *s; + struct specifier_list_s *t; + + if (n->list) { + int count = 0; + + for (s = n->list; s; s = s->subrule_list) + count++; + if (count > 1) { + nest(); + printf("or\n"); + } + for (s = n->list; s; s = s->subrule_list) { + if (s->specifier_list) { + int count0 = 0; + + for (t = s->specifier_list; t; t = t->list) + count0++; + if (count0 > 1) { + nest(); + printf("and\n"); + } + for (t = s->specifier_list; t; t = t->list) { + if (t->spec) + emit_negated_specifier(t->spec); + } + if (count0 > 1) + unnest(); + } + } + if (count > 1) + unnest(); + } +} + +void emit_specifier(struct specifier_s *n) { + if (n->direction) { + if (n->direction->list) { + struct direction_argument_list_s *l; + int count = 0; + + for (l = n->direction->list; l; l = l->list) + count++; + if (count > 1) { + nest(); + printf("or\n"); + } + for (l = n->direction->list; l; l = l->list) { + if (l->arg) { + nest(); + printf("direction %s\n", l->arg->direction); + unnest(); + } + } + if (count > 1) + unnest(); + } + } else if (n->target) { + nest(); + printf("target\n"); + unnest(); + } else if (n->host) { + if (n->host->list) { + struct host_argument_list_s *l; + int count = 0; + + for (l = n->host->list; l; l = l->list) + count++; + if (count > 1) { + nest(); + printf("or\n"); + } + for (l = n->host->list; l; l = l->list) { + if (l->arg) { + nest(); + printf("host %s\n", l->arg->host); + unnest(); + } + } + if (count > 1) + unnest(); + } + } else if (n->port) { + nest(); + printf("port\n"); + unnest(); + } else if (n->protocol) { + nest(); + printf("protocol\n"); + unnest(); + } else if (n->icmptype) { + nest(); + printf("icmptype\n"); + unnest(); + } else if (n->option) { + nest(); + printf("option\n"); + unnest(); + } else if (n->chaingroup) { + nest(); + printf("chaingroup FIXME\n"); + unnest(); + } else if (n->compound) { + emit_compound_specifier(n->compound); + } +} + +void emit_negated_specifier(struct negated_specifier_s *n) { + if (n->spec) { + if (n->negated) { + nest(); + printf("not\n"); + } + emit_specifier(n->spec); + if (n->negated) { + unnest(); + } + } +} + +void emit_rule(struct rule_s *n) { + struct specifier_list_s *s; + + if (n->list) { + int count = 0; + + for (s = n->list; s; s = s->list) + count++; + if (count > 1) { + nest(); + /* specifiers have implicit AND */ + printf("and\n"); + } + + for (s = n->list; s; s = s->list) { + if (s->spec) { + emit_negated_specifier(s->spec); + } + } + if (count > 1) + unnest(); + } +} + +void emit_ast(struct ast_s *n) { + struct rule_list_s *r; + if (n->list) { + int count = 0; + + for (r = n->list; r; r = r->list) + count++; + if (count > 1) { + nest(); + /* semicolons are OR */ + printf("or\n"); + } + for (r = n->list; r; r = r->list) { + if (r->rule) { + emit_rule(r->rule); + } + } + if (count > 1) + unnest(); + } +} + +int main(int argc __attribute__((unused)), + char **argv __attribute__((unused))) { + char *FACTTRACE; + struct ast_s ast; + int r; + + FACTTRACE = getenv("FACTTRACE"); + facttrace = FACTTRACE ? atoi(FACTTRACE) : 0; + + r = yyparse((void *)&ast); + if (r != 0) { + printf("yyparse returned %d\n", r); + return 1; + } - emit_ast(&ast); - return 0; + /* do magic */ + /* factorise(&ast); */ + + emit_ast(&ast); + return 0; } diff -Nru filtergen-0.12.4/t/Makefile.am filtergen-0.12.7/t/Makefile.am --- filtergen-0.12.4/t/Makefile.am 2004-08-18 02:49:52.000000000 +0000 +++ filtergen-0.12.7/t/Makefile.am 2016-02-13 09:44:55.000000000 +0000 @@ -67,7 +67,8 @@ t_67_includeemptyfile \ t_68_noop \ t_69_includeemptynoop \ - t_70_includesemicolon + t_70_includesemicolon \ + t_71_includeglob check_PROGRAMS = scan parse emit convert factorise diff -Nru filtergen-0.12.4/t/Makefile.in filtergen-0.12.7/t/Makefile.in --- filtergen-0.12.4/t/Makefile.in 2004-08-18 03:50:39.000000000 +0000 +++ filtergen-0.12.7/t/Makefile.in 2016-02-13 10:53:03.000000000 +0000 @@ -1,8 +1,8 @@ -# Makefile.in generated by automake 1.8.5 from Makefile.am. +# Makefile.in generated by automake 1.15 from Makefile.am. # @configure_input@ -# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, -# 2003, 2004 Free Software Foundation, Inc. +# Copyright (C) 1994-2014 Free Software Foundation, Inc. + # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. @@ -13,17 +13,67 @@ # PARTICULAR PURPOSE. @SET_MAKE@ -SOURCES = $(convert_SOURCES) $(emit_SOURCES) $(factorise_SOURCES) $(parse_SOURCES) $(scan_SOURCES) - -srcdir = @srcdir@ -top_srcdir = @top_srcdir@ VPATH = @srcdir@ +am__is_gnu_make = { \ + if test -z '$(MAKELEVEL)'; then \ + false; \ + elif test -n '$(MAKE_HOST)'; then \ + true; \ + elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \ + true; \ + else \ + false; \ + fi; \ +} +am__make_running_with_option = \ + case $${target_option-} in \ + ?) ;; \ + *) echo "am__make_running_with_option: internal error: invalid" \ + "target option '$${target_option-}' specified" >&2; \ + exit 1;; \ + esac; \ + has_opt=no; \ + sane_makeflags=$$MAKEFLAGS; \ + if $(am__is_gnu_make); then \ + sane_makeflags=$$MFLAGS; \ + else \ + case $$MAKEFLAGS in \ + *\\[\ \ ]*) \ + bs=\\; \ + sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ + | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ + esac; \ + fi; \ + skip_next=no; \ + strip_trailopt () \ + { \ + flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ + }; \ + for flg in $$sane_makeflags; do \ + test $$skip_next = yes && { skip_next=no; continue; }; \ + case $$flg in \ + *=*|--*) continue;; \ + -*I) strip_trailopt 'I'; skip_next=yes;; \ + -*I?*) strip_trailopt 'I';; \ + -*O) strip_trailopt 'O'; skip_next=yes;; \ + -*O?*) strip_trailopt 'O';; \ + -*l) strip_trailopt 'l'; skip_next=yes;; \ + -*l?*) strip_trailopt 'l';; \ + -[dEDm]) skip_next=yes;; \ + -[JT]) skip_next=yes;; \ + esac; \ + case $$flg in \ + *$$target_option*) has_opt=yes; break;; \ + esac; \ + done; \ + test $$has_opt = yes +am__make_dryrun = (target_option=n; $(am__make_running_with_option)) +am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) pkgdatadir = $(datadir)/@PACKAGE@ -pkglibdir = $(libdir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ -top_builddir = .. +pkglibdir = $(libdir)/@PACKAGE@ +pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd -INSTALL = @INSTALL@ install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c @@ -38,14 +88,15 @@ check_PROGRAMS = scan$(EXEEXT) parse$(EXEEXT) emit$(EXEEXT) \ convert$(EXEEXT) factorise$(EXEEXT) subdir = t -DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 -am__aclocal_m4_deps = $(top_srcdir)/configure.in +am__aclocal_m4_deps = $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) -mkinstalldirs = $(mkdir_p) +DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON) +mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/config.h CONFIG_CLEAN_FILES = +CONFIG_CLEAN_VPATH_FILES = am_convert_OBJECTS = convert.$(OBJEXT) convert_OBJECTS = $(am_convert_OBJECTS) convert_DEPENDENCIES = ../scanner.o ../parser.o ../glue.o ../filter.o \ @@ -62,27 +113,272 @@ am_scan_OBJECTS = scan.$(OBJEXT) scan_OBJECTS = $(am_scan_OBJECTS) scan_DEPENDENCIES = ../scanner.o ../parser.o -DEFAULT_INCLUDES = -I. -I$(srcdir) -I$(top_builddir) +AM_V_P = $(am__v_P_@AM_V@) +am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) +am__v_P_0 = false +am__v_P_1 = : +AM_V_GEN = $(am__v_GEN_@AM_V@) +am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) +am__v_GEN_0 = @echo " GEN " $@; +am__v_GEN_1 = +AM_V_at = $(am__v_at_@AM_V@) +am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) +am__v_at_0 = @ +am__v_at_1 = +DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir) depcomp = $(SHELL) $(top_srcdir)/depcomp am__depfiles_maybe = depfiles -@AMDEP_TRUE@DEP_FILES = ./$(DEPDIR)/convert.Po ./$(DEPDIR)/emit.Po \ -@AMDEP_TRUE@ ./$(DEPDIR)/factorise.Po ./$(DEPDIR)/parse.Po \ -@AMDEP_TRUE@ ./$(DEPDIR)/scan.Po +am__mv = mv -f COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) +AM_V_CC = $(am__v_CC_@AM_V@) +am__v_CC_ = $(am__v_CC_@AM_DEFAULT_V@) +am__v_CC_0 = @echo " CC " $@; +am__v_CC_1 = CCLD = $(CC) LINK = $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@ +AM_V_CCLD = $(am__v_CCLD_@AM_V@) +am__v_CCLD_ = $(am__v_CCLD_@AM_DEFAULT_V@) +am__v_CCLD_0 = @echo " CCLD " $@; +am__v_CCLD_1 = SOURCES = $(convert_SOURCES) $(emit_SOURCES) $(factorise_SOURCES) \ $(parse_SOURCES) $(scan_SOURCES) DIST_SOURCES = $(convert_SOURCES) $(emit_SOURCES) $(factorise_SOURCES) \ $(parse_SOURCES) $(scan_SOURCES) +am__can_run_installinfo = \ + case $$AM_UPDATE_INFO_DIR in \ + n|no|NO) false;; \ + *) (install-info --version) >/dev/null 2>&1;; \ + esac +am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) +# Read a list of newline-separated strings from the standard input, +# and print each of them once, without duplicates. Input order is +# *not* preserved. +am__uniquify_input = $(AWK) '\ + BEGIN { nonempty = 0; } \ + { items[$$0] = 1; nonempty = 1; } \ + END { if (nonempty) { for (i in items) print i; }; } \ +' +# Make sure the list of sources is unique. This is necessary because, +# e.g., the same source file might be shared among _SOURCES variables +# for different programs/libraries. +am__define_uniq_tagged_files = \ + list='$(am__tagged_files)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | $(am__uniquify_input)` ETAGS = etags CTAGS = ctags +am__tty_colors_dummy = \ + mgn= red= grn= lgn= blu= brg= std=; \ + am__color_tests=no +am__tty_colors = { \ + $(am__tty_colors_dummy); \ + if test "X$(AM_COLOR_TESTS)" = Xno; then \ + am__color_tests=no; \ + elif test "X$(AM_COLOR_TESTS)" = Xalways; then \ + am__color_tests=yes; \ + elif test "X$$TERM" != Xdumb && { test -t 1; } 2>/dev/null; then \ + am__color_tests=yes; \ + fi; \ + if test $$am__color_tests = yes; then \ + red=''; \ + grn=''; \ + lgn=''; \ + blu=''; \ + mgn=''; \ + brg=''; \ + std=''; \ + fi; \ +} +am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; +am__vpath_adj = case $$p in \ + $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ + *) f=$$p;; \ + esac; +am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`; +am__install_max = 40 +am__nobase_strip_setup = \ + srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'` +am__nobase_strip = \ + for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||" +am__nobase_list = $(am__nobase_strip_setup); \ + for p in $$list; do echo "$$p $$p"; done | \ + sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \ + $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \ + if (++n[$$2] == $(am__install_max)) \ + { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \ + END { for (dir in files) print dir, files[dir] }' +am__base_list = \ + sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \ + sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g' +am__uninstall_files_from_dir = { \ + test -z "$$files" \ + || { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \ + || { echo " ( cd '$$dir' && rm -f" $$files ")"; \ + $(am__cd) "$$dir" && rm -f $$files; }; \ + } +am__recheck_rx = ^[ ]*:recheck:[ ]* +am__global_test_result_rx = ^[ ]*:global-test-result:[ ]* +am__copy_in_global_log_rx = ^[ ]*:copy-in-global-log:[ ]* +# A command that, given a newline-separated list of test names on the +# standard input, print the name of the tests that are to be re-run +# upon "make recheck". +am__list_recheck_tests = $(AWK) '{ \ + recheck = 1; \ + while ((rc = (getline line < ($$0 ".trs"))) != 0) \ + { \ + if (rc < 0) \ + { \ + if ((getline line2 < ($$0 ".log")) < 0) \ + recheck = 0; \ + break; \ + } \ + else if (line ~ /$(am__recheck_rx)[nN][Oo]/) \ + { \ + recheck = 0; \ + break; \ + } \ + else if (line ~ /$(am__recheck_rx)[yY][eE][sS]/) \ + { \ + break; \ + } \ + }; \ + if (recheck) \ + print $$0; \ + close ($$0 ".trs"); \ + close ($$0 ".log"); \ +}' +# A command that, given a newline-separated list of test names on the +# standard input, create the global log from their .trs and .log files. +am__create_global_log = $(AWK) ' \ +function fatal(msg) \ +{ \ + print "fatal: making $@: " msg | "cat >&2"; \ + exit 1; \ +} \ +function rst_section(header) \ +{ \ + print header; \ + len = length(header); \ + for (i = 1; i <= len; i = i + 1) \ + printf "="; \ + printf "\n\n"; \ +} \ +{ \ + copy_in_global_log = 1; \ + global_test_result = "RUN"; \ + while ((rc = (getline line < ($$0 ".trs"))) != 0) \ + { \ + if (rc < 0) \ + fatal("failed to read from " $$0 ".trs"); \ + if (line ~ /$(am__global_test_result_rx)/) \ + { \ + sub("$(am__global_test_result_rx)", "", line); \ + sub("[ ]*$$", "", line); \ + global_test_result = line; \ + } \ + else if (line ~ /$(am__copy_in_global_log_rx)[nN][oO]/) \ + copy_in_global_log = 0; \ + }; \ + if (copy_in_global_log) \ + { \ + rst_section(global_test_result ": " $$0); \ + while ((rc = (getline line < ($$0 ".log"))) != 0) \ + { \ + if (rc < 0) \ + fatal("failed to read from " $$0 ".log"); \ + print line; \ + }; \ + printf "\n"; \ + }; \ + close ($$0 ".trs"); \ + close ($$0 ".log"); \ +}' +# Restructured Text title. +am__rst_title = { sed 's/.*/ & /;h;s/./=/g;p;x;s/ *$$//;p;g' && echo; } +# Solaris 10 'make', and several other traditional 'make' implementations, +# pass "-e" to $(SHELL), and POSIX 2008 even requires this. Work around it +# by disabling -e (using the XSI extension "set +e") if it's set. +am__sh_e_setup = case $$- in *e*) set +e;; esac +# Default flags passed to test drivers. +am__common_driver_flags = \ + --color-tests "$$am__color_tests" \ + --enable-hard-errors "$$am__enable_hard_errors" \ + --expect-failure "$$am__expect_failure" +# To be inserted before the command running the test. Creates the +# directory for the log if needed. Stores in $dir the directory +# containing $f, in $tst the test, in $log the log. Executes the +# developer- defined test setup AM_TESTS_ENVIRONMENT (if any), and +# passes TESTS_ENVIRONMENT. Set up options for the wrapper that +# will run the test scripts (or their associated LOG_COMPILER, if +# thy have one). +am__check_pre = \ +$(am__sh_e_setup); \ +$(am__vpath_adj_setup) $(am__vpath_adj) \ +$(am__tty_colors); \ +srcdir=$(srcdir); export srcdir; \ +case "$@" in \ + */*) am__odir=`echo "./$@" | sed 's|/[^/]*$$||'`;; \ + *) am__odir=.;; \ +esac; \ +test "x$$am__odir" = x"." || test -d "$$am__odir" \ + || $(MKDIR_P) "$$am__odir" || exit $$?; \ +if test -f "./$$f"; then dir=./; \ +elif test -f "$$f"; then dir=; \ +else dir="$(srcdir)/"; fi; \ +tst=$$dir$$f; log='$@'; \ +if test -n '$(DISABLE_HARD_ERRORS)'; then \ + am__enable_hard_errors=no; \ +else \ + am__enable_hard_errors=yes; \ +fi; \ +case " $(XFAIL_TESTS) " in \ + *[\ \ ]$$f[\ \ ]* | *[\ \ ]$$dir$$f[\ \ ]*) \ + am__expect_failure=yes;; \ + *) \ + am__expect_failure=no;; \ +esac; \ +$(AM_TESTS_ENVIRONMENT) $(TESTS_ENVIRONMENT) +# A shell command to get the names of the tests scripts with any registered +# extension removed (i.e., equivalently, the names of the test logs, with +# the '.log' extension removed). The result is saved in the shell variable +# '$bases'. This honors runtime overriding of TESTS and TEST_LOGS. Sadly, +# we cannot use something simpler, involving e.g., "$(TEST_LOGS:.log=)", +# since that might cause problem with VPATH rewrites for suffix-less tests. +# See also 'test-harness-vpath-rewrite.sh' and 'test-trs-basic.sh'. +am__set_TESTS_bases = \ + bases='$(TEST_LOGS)'; \ + bases=`for i in $$bases; do echo $$i; done | sed 's/\.log$$//'`; \ + bases=`echo $$bases` +RECHECK_LOGS = $(TEST_LOGS) +AM_RECURSIVE_TARGETS = check recheck +TEST_SUITE_LOG = test-suite.log +TEST_EXTENSIONS = @EXEEXT@ .test +LOG_DRIVER = $(SHELL) $(top_srcdir)/test-driver +LOG_COMPILE = $(LOG_COMPILER) $(AM_LOG_FLAGS) $(LOG_FLAGS) +am__set_b = \ + case '$@' in \ + */*) \ + case '$*' in \ + */*) b='$*';; \ + *) b=`echo '$@' | sed 's/\.log$$//'`; \ + esac;; \ + *) \ + b='$*';; \ + esac +am__test_logs1 = $(TESTS:=.log) +am__test_logs2 = $(am__test_logs1:@EXEEXT@.log=.log) +TEST_LOGS = $(am__test_logs2:.test.log=.log) +TEST_LOG_DRIVER = $(SHELL) $(top_srcdir)/test-driver +TEST_LOG_COMPILE = $(TEST_LOG_COMPILER) $(AM_TEST_LOG_FLAGS) \ + $(TEST_LOG_FLAGS) +am__DIST_COMMON = $(srcdir)/Makefile.in $(top_srcdir)/depcomp \ + $(top_srcdir)/test-driver DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ -AMDEP_FALSE = @AMDEP_FALSE@ -AMDEP_TRUE = @AMDEP_TRUE@ AMTAR = @AMTAR@ +AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ @@ -102,6 +398,8 @@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ GETOPT_LIBS = @GETOPT_LIBS@ +GREP = @GREP@ +INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ @@ -114,15 +412,15 @@ LIBS = @LIBS@ LTLIBOBJS = @LTLIBOBJS@ MAINT = @MAINT@ -MAINTAINER_MODE_FALSE = @MAINTAINER_MODE_FALSE@ -MAINTAINER_MODE_TRUE = @MAINTAINER_MODE_TRUE@ MAKEINFO = @MAKEINFO@ +MKDIR_P = @MKDIR_P@ OBJEXT = @OBJEXT@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ +PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PROGRAM = @PROGRAM@ @@ -133,35 +431,52 @@ SYSCONFDIR = @SYSCONFDIR@ VERSION = @VERSION@ YACC = @YACC@ +YFLAGS = @YFLAGS@ +abs_builddir = @abs_builddir@ +abs_srcdir = @abs_srcdir@ +abs_top_builddir = @abs_top_builddir@ +abs_top_srcdir = @abs_top_srcdir@ ac_ct_CC = @ac_ct_CC@ -ac_ct_STRIP = @ac_ct_STRIP@ -am__fastdepCC_FALSE = @am__fastdepCC_FALSE@ -am__fastdepCC_TRUE = @am__fastdepCC_TRUE@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ +am__tar = @am__tar@ +am__untar = @am__untar@ bindir = @bindir@ build_alias = @build_alias@ +builddir = @builddir@ datadir = @datadir@ +datarootdir = @datarootdir@ +docdir = @docdir@ +dvidir = @dvidir@ exec_prefix = @exec_prefix@ host_alias = @host_alias@ +htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ +localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ +pdfdir = @pdfdir@ pkgdocdir = @pkgdocdir@ pkgexdir = @pkgexdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ +psdir = @psdir@ +runstatedir = @runstatedir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ +srcdir = @srcdir@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ +top_build_prefix = @top_build_prefix@ +top_builddir = @top_builddir@ +top_srcdir = @top_srcdir@ TESTS = t_01_ccomment \ t_02_hashcomment \ t_03_hashnonewline \ @@ -231,7 +546,8 @@ t_67_includeemptyfile \ t_68_noop \ t_69_includeemptynoop \ - t_70_includesemicolon + t_70_includesemicolon \ + t_71_includeglob scan_SOURCES = scan.c scan_LDADD = ../scanner.o ../parser.o @@ -250,20 +566,19 @@ all: all-am .SUFFIXES: -.SUFFIXES: .c .o .obj +.SUFFIXES: .c .log .o .obj .test .test$(EXEEXT) .trs $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ - cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \ - && exit 0; \ + ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ + && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ - echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign t/Makefile'; \ - cd $(top_srcdir) && \ - $(AUTOMAKE) --foreign t/Makefile -.PRECIOUS: Makefile + echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign t/Makefile'; \ + $(am__cd) $(top_srcdir) && \ + $(AUTOMAKE) --foreign t/Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ @@ -280,24 +595,30 @@ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +$(am__aclocal_m4_deps): clean-checkPROGRAMS: -test -z "$(check_PROGRAMS)" || rm -f $(check_PROGRAMS) -convert$(EXEEXT): $(convert_OBJECTS) $(convert_DEPENDENCIES) + +convert$(EXEEXT): $(convert_OBJECTS) $(convert_DEPENDENCIES) $(EXTRA_convert_DEPENDENCIES) @rm -f convert$(EXEEXT) - $(LINK) $(convert_LDFLAGS) $(convert_OBJECTS) $(convert_LDADD) $(LIBS) -emit$(EXEEXT): $(emit_OBJECTS) $(emit_DEPENDENCIES) + $(AM_V_CCLD)$(LINK) $(convert_OBJECTS) $(convert_LDADD) $(LIBS) + +emit$(EXEEXT): $(emit_OBJECTS) $(emit_DEPENDENCIES) $(EXTRA_emit_DEPENDENCIES) @rm -f emit$(EXEEXT) - $(LINK) $(emit_LDFLAGS) $(emit_OBJECTS) $(emit_LDADD) $(LIBS) -factorise$(EXEEXT): $(factorise_OBJECTS) $(factorise_DEPENDENCIES) + $(AM_V_CCLD)$(LINK) $(emit_OBJECTS) $(emit_LDADD) $(LIBS) + +factorise$(EXEEXT): $(factorise_OBJECTS) $(factorise_DEPENDENCIES) $(EXTRA_factorise_DEPENDENCIES) @rm -f factorise$(EXEEXT) - $(LINK) $(factorise_LDFLAGS) $(factorise_OBJECTS) $(factorise_LDADD) $(LIBS) -parse$(EXEEXT): $(parse_OBJECTS) $(parse_DEPENDENCIES) + $(AM_V_CCLD)$(LINK) $(factorise_OBJECTS) $(factorise_LDADD) $(LIBS) + +parse$(EXEEXT): $(parse_OBJECTS) $(parse_DEPENDENCIES) $(EXTRA_parse_DEPENDENCIES) @rm -f parse$(EXEEXT) - $(LINK) $(parse_LDFLAGS) $(parse_OBJECTS) $(parse_LDADD) $(LIBS) -scan$(EXEEXT): $(scan_OBJECTS) $(scan_DEPENDENCIES) + $(AM_V_CCLD)$(LINK) $(parse_OBJECTS) $(parse_LDADD) $(LIBS) + +scan$(EXEEXT): $(scan_OBJECTS) $(scan_DEPENDENCIES) $(EXTRA_scan_DEPENDENCIES) @rm -f scan$(EXEEXT) - $(LINK) $(scan_LDFLAGS) $(scan_OBJECTS) $(scan_LDADD) $(LIBS) + $(AM_V_CCLD)$(LINK) $(scan_OBJECTS) $(scan_LDADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) @@ -312,168 +633,751 @@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/scan.Po@am__quote@ .c.o: -@am__fastdepCC_TRUE@ if $(COMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ $<; \ -@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi -@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ depfile='$(DEPDIR)/$*.Po' tmpdepfile='$(DEPDIR)/$*.TPo' @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(COMPILE) -c $< +@am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ $< .c.obj: -@am__fastdepCC_TRUE@ if $(COMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ `$(CYGPATH_W) '$<'`; \ -@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi -@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ depfile='$(DEPDIR)/$*.Po' tmpdepfile='$(DEPDIR)/$*.TPo' @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(COMPILE) -c `$(CYGPATH_W) '$<'` -uninstall-info-am: - -ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) - list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ - unique=`for i in $$list; do \ - if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ - done | \ - $(AWK) ' { files[$$0] = 1; } \ - END { for (i in files) print i; }'`; \ - mkid -fID $$unique -tags: TAGS - -TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ - $(TAGS_FILES) $(LISP) - tags=; \ +@am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ `$(CYGPATH_W) '$<'` + +ID: $(am__tagged_files) + $(am__define_uniq_tagged_files); mkid -fID $$unique +tags: tags-am +TAGS: tags + +tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) + set x; \ here=`pwd`; \ - list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ - unique=`for i in $$list; do \ - if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ - done | \ - $(AWK) ' { files[$$0] = 1; } \ - END { for (i in files) print i; }'`; \ - if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \ + $(am__define_uniq_tagged_files); \ + shift; \ + if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ - $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ - $$tags $$unique; \ + if test $$# -gt 0; then \ + $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ + "$$@" $$unique; \ + else \ + $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ + $$unique; \ + fi; \ fi -ctags: CTAGS -CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ - $(TAGS_FILES) $(LISP) - tags=; \ - here=`pwd`; \ - list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ - unique=`for i in $$list; do \ - if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ - done | \ - $(AWK) ' { files[$$0] = 1; } \ - END { for (i in files) print i; }'`; \ - test -z "$(CTAGS_ARGS)$$tags$$unique" \ +ctags: ctags-am + +CTAGS: ctags +ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) + $(am__define_uniq_tagged_files); \ + test -z "$(CTAGS_ARGS)$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ - $$tags $$unique + $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ - && cd $(top_srcdir) \ - && gtags -i $(GTAGS_ARGS) $$here + && $(am__cd) $(top_srcdir) \ + && gtags -i $(GTAGS_ARGS) "$$here" +cscopelist: cscopelist-am + +cscopelist-am: $(am__tagged_files) + list='$(am__tagged_files)'; \ + case "$(srcdir)" in \ + [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \ + *) sdir=$(subdir)/$(srcdir) ;; \ + esac; \ + for i in $$list; do \ + if test -f "$$i"; then \ + echo "$(subdir)/$$i"; \ + else \ + echo "$$sdir/$$i"; \ + fi; \ + done >> $(top_builddir)/cscope.files distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags -check-TESTS: $(TESTS) - @failed=0; all=0; xfail=0; xpass=0; skip=0; \ - srcdir=$(srcdir); export srcdir; \ - list='$(TESTS)'; \ - if test -n "$$list"; then \ - for tst in $$list; do \ - if test -f ./$$tst; then dir=./; \ - elif test -f $$tst; then dir=; \ - else dir="$(srcdir)/"; fi; \ - if $(TESTS_ENVIRONMENT) $${dir}$$tst; then \ - all=`expr $$all + 1`; \ - case " $(XFAIL_TESTS) " in \ - *" $$tst "*) \ - xpass=`expr $$xpass + 1`; \ - failed=`expr $$failed + 1`; \ - echo "XPASS: $$tst"; \ - ;; \ - *) \ - echo "PASS: $$tst"; \ - ;; \ - esac; \ - elif test $$? -ne 77; then \ - all=`expr $$all + 1`; \ - case " $(XFAIL_TESTS) " in \ - *" $$tst "*) \ - xfail=`expr $$xfail + 1`; \ - echo "XFAIL: $$tst"; \ - ;; \ - *) \ - failed=`expr $$failed + 1`; \ - echo "FAIL: $$tst"; \ - ;; \ - esac; \ - else \ - skip=`expr $$skip + 1`; \ - echo "SKIP: $$tst"; \ - fi; \ +# Recover from deleted '.trs' file; this should ensure that +# "rm -f foo.log; make foo.trs" re-run 'foo.test', and re-create +# both 'foo.log' and 'foo.trs'. Break the recipe in two subshells +# to avoid problems with "make -n". +.log.trs: + rm -f $< $@ + $(MAKE) $(AM_MAKEFLAGS) $< + +# Leading 'am--fnord' is there to ensure the list of targets does not +# expand to empty, as could happen e.g. with make check TESTS=''. +am--fnord $(TEST_LOGS) $(TEST_LOGS:.log=.trs): $(am__force_recheck) +am--force-recheck: + @: + +$(TEST_SUITE_LOG): $(TEST_LOGS) + @$(am__set_TESTS_bases); \ + am__f_ok () { test -f "$$1" && test -r "$$1"; }; \ + redo_bases=`for i in $$bases; do \ + am__f_ok $$i.trs && am__f_ok $$i.log || echo $$i; \ + done`; \ + if test -n "$$redo_bases"; then \ + redo_logs=`for i in $$redo_bases; do echo $$i.log; done`; \ + redo_results=`for i in $$redo_bases; do echo $$i.trs; done`; \ + if $(am__make_dryrun); then :; else \ + rm -f $$redo_logs && rm -f $$redo_results || exit 1; \ + fi; \ + fi; \ + if test -n "$$am__remaking_logs"; then \ + echo "fatal: making $(TEST_SUITE_LOG): possible infinite" \ + "recursion detected" >&2; \ + elif test -n "$$redo_logs"; then \ + am__remaking_logs=yes $(MAKE) $(AM_MAKEFLAGS) $$redo_logs; \ + fi; \ + if $(am__make_dryrun); then :; else \ + st=0; \ + errmsg="fatal: making $(TEST_SUITE_LOG): failed to create"; \ + for i in $$redo_bases; do \ + test -f $$i.trs && test -r $$i.trs \ + || { echo "$$errmsg $$i.trs" >&2; st=1; }; \ + test -f $$i.log && test -r $$i.log \ + || { echo "$$errmsg $$i.log" >&2; st=1; }; \ done; \ - if test "$$failed" -eq 0; then \ - if test "$$xfail" -eq 0; then \ - banner="All $$all tests passed"; \ + test $$st -eq 0 || exit 1; \ + fi + @$(am__sh_e_setup); $(am__tty_colors); $(am__set_TESTS_bases); \ + ws='[ ]'; \ + results=`for b in $$bases; do echo $$b.trs; done`; \ + test -n "$$results" || results=/dev/null; \ + all=` grep "^$$ws*:test-result:" $$results | wc -l`; \ + pass=` grep "^$$ws*:test-result:$$ws*PASS" $$results | wc -l`; \ + fail=` grep "^$$ws*:test-result:$$ws*FAIL" $$results | wc -l`; \ + skip=` grep "^$$ws*:test-result:$$ws*SKIP" $$results | wc -l`; \ + xfail=`grep "^$$ws*:test-result:$$ws*XFAIL" $$results | wc -l`; \ + xpass=`grep "^$$ws*:test-result:$$ws*XPASS" $$results | wc -l`; \ + error=`grep "^$$ws*:test-result:$$ws*ERROR" $$results | wc -l`; \ + if test `expr $$fail + $$xpass + $$error` -eq 0; then \ + success=true; \ + else \ + success=false; \ + fi; \ + br='==================='; br=$$br$$br$$br$$br; \ + result_count () \ + { \ + if test x"$$1" = x"--maybe-color"; then \ + maybe_colorize=yes; \ + elif test x"$$1" = x"--no-color"; then \ + maybe_colorize=no; \ else \ - banner="All $$all tests behaved as expected ($$xfail expected failures)"; \ + echo "$@: invalid 'result_count' usage" >&2; exit 4; \ fi; \ - else \ - if test "$$xpass" -eq 0; then \ - banner="$$failed of $$all tests failed"; \ + shift; \ + desc=$$1 count=$$2; \ + if test $$maybe_colorize = yes && test $$count -gt 0; then \ + color_start=$$3 color_end=$$std; \ else \ - banner="$$failed of $$all tests did not behave as expected ($$xpass unexpected passes)"; \ + color_start= color_end=; \ fi; \ - fi; \ - dashes="$$banner"; \ - skipped=""; \ - if test "$$skip" -ne 0; then \ - skipped="($$skip tests were not run)"; \ - test `echo "$$skipped" | wc -c` -le `echo "$$banner" | wc -c` || \ - dashes="$$skipped"; \ - fi; \ - report=""; \ - if test "$$failed" -ne 0 && test -n "$(PACKAGE_BUGREPORT)"; then \ - report="Please report to $(PACKAGE_BUGREPORT)"; \ - test `echo "$$report" | wc -c` -le `echo "$$banner" | wc -c` || \ - dashes="$$report"; \ - fi; \ - dashes=`echo "$$dashes" | sed s/./=/g`; \ - echo "$$dashes"; \ - echo "$$banner"; \ - test -z "$$skipped" || echo "$$skipped"; \ - test -z "$$report" || echo "$$report"; \ - echo "$$dashes"; \ - test "$$failed" -eq 0; \ - else :; fi + echo "$${color_start}# $$desc $$count$${color_end}"; \ + }; \ + create_testsuite_report () \ + { \ + result_count $$1 "TOTAL:" $$all "$$brg"; \ + result_count $$1 "PASS: " $$pass "$$grn"; \ + result_count $$1 "SKIP: " $$skip "$$blu"; \ + result_count $$1 "XFAIL:" $$xfail "$$lgn"; \ + result_count $$1 "FAIL: " $$fail "$$red"; \ + result_count $$1 "XPASS:" $$xpass "$$red"; \ + result_count $$1 "ERROR:" $$error "$$mgn"; \ + }; \ + { \ + echo "$(PACKAGE_STRING): $(subdir)/$(TEST_SUITE_LOG)" | \ + $(am__rst_title); \ + create_testsuite_report --no-color; \ + echo; \ + echo ".. contents:: :depth: 2"; \ + echo; \ + for b in $$bases; do echo $$b; done \ + | $(am__create_global_log); \ + } >$(TEST_SUITE_LOG).tmp || exit 1; \ + mv $(TEST_SUITE_LOG).tmp $(TEST_SUITE_LOG); \ + if $$success; then \ + col="$$grn"; \ + else \ + col="$$red"; \ + test x"$$VERBOSE" = x || cat $(TEST_SUITE_LOG); \ + fi; \ + echo "$${col}$$br$${std}"; \ + echo "$${col}Testsuite summary for $(PACKAGE_STRING)$${std}"; \ + echo "$${col}$$br$${std}"; \ + create_testsuite_report --maybe-color; \ + echo "$$col$$br$$std"; \ + if $$success; then :; else \ + echo "$${col}See $(subdir)/$(TEST_SUITE_LOG)$${std}"; \ + if test -n "$(PACKAGE_BUGREPORT)"; then \ + echo "$${col}Please report to $(PACKAGE_BUGREPORT)$${std}"; \ + fi; \ + echo "$$col$$br$$std"; \ + fi; \ + $$success || exit 1 + +check-TESTS: + @list='$(RECHECK_LOGS)'; test -z "$$list" || rm -f $$list + @list='$(RECHECK_LOGS:.log=.trs)'; test -z "$$list" || rm -f $$list + @test -z "$(TEST_SUITE_LOG)" || rm -f $(TEST_SUITE_LOG) + @set +e; $(am__set_TESTS_bases); \ + log_list=`for i in $$bases; do echo $$i.log; done`; \ + trs_list=`for i in $$bases; do echo $$i.trs; done`; \ + log_list=`echo $$log_list`; trs_list=`echo $$trs_list`; \ + $(MAKE) $(AM_MAKEFLAGS) $(TEST_SUITE_LOG) TEST_LOGS="$$log_list"; \ + exit $$?; +recheck: all $(check_PROGRAMS) + @test -z "$(TEST_SUITE_LOG)" || rm -f $(TEST_SUITE_LOG) + @set +e; $(am__set_TESTS_bases); \ + bases=`for i in $$bases; do echo $$i; done \ + | $(am__list_recheck_tests)` || exit 1; \ + log_list=`for i in $$bases; do echo $$i.log; done`; \ + log_list=`echo $$log_list`; \ + $(MAKE) $(AM_MAKEFLAGS) $(TEST_SUITE_LOG) \ + am__force_recheck=am--force-recheck \ + TEST_LOGS="$$log_list"; \ + exit $$? +t_01_ccomment.log: t_01_ccomment + @p='t_01_ccomment'; \ + b='t_01_ccomment'; \ + $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ + --log-file $$b.log --trs-file $$b.trs \ + $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ + "$$tst" $(AM_TESTS_FD_REDIRECT) +t_02_hashcomment.log: t_02_hashcomment + @p='t_02_hashcomment'; \ + b='t_02_hashcomment'; \ + $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ + --log-file $$b.log --trs-file $$b.trs \ + $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ + "$$tst" $(AM_TESTS_FD_REDIRECT) +t_03_hashnonewline.log: t_03_hashnonewline + @p='t_03_hashnonewline'; \ + b='t_03_hashnonewline'; \ + $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ + --log-file $$b.log --trs-file $$b.trs \ + $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ + "$$tst" $(AM_TESTS_FD_REDIRECT) +t_04_keywords.log: t_04_keywords + @p='t_04_keywords'; \ + b='t_04_keywords'; \ + $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ + --log-file $$b.log --trs-file $$b.trs \ + $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ + "$$tst" $(AM_TESTS_FD_REDIRECT) +t_05_punct.log: t_05_punct + @p='t_05_punct'; \ + b='t_05_punct'; \ + $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ + --log-file $$b.log --trs-file $$b.trs \ + $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ + "$$tst" $(AM_TESTS_FD_REDIRECT) +t_06_numbers.log: t_06_numbers + @p='t_06_numbers'; \ + b='t_06_numbers'; \ + $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ + --log-file $$b.log --trs-file $$b.trs \ + $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ + "$$tst" $(AM_TESTS_FD_REDIRECT) +t_07_names.log: t_07_names + @p='t_07_names'; \ + b='t_07_names'; \ + $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ + --log-file $$b.log --trs-file $$b.trs \ + $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ + "$$tst" $(AM_TESTS_FD_REDIRECT) +t_08_networknames.log: t_08_networknames + @p='t_08_networknames'; \ + b='t_08_networknames'; \ + $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ + --log-file $$b.log --trs-file $$b.trs \ + $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ + "$$tst" $(AM_TESTS_FD_REDIRECT) +t_09_badcomment.log: t_09_badcomment + @p='t_09_badcomment'; \ + b='t_09_badcomment'; \ + $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ + --log-file $$b.log --trs-file $$b.trs \ + $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ + "$$tst" $(AM_TESTS_FD_REDIRECT) +t_10_goodcomment.log: t_10_goodcomment + @p='t_10_goodcomment'; \ + b='t_10_goodcomment'; \ + $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ + --log-file $$b.log --trs-file $$b.trs \ + $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ + "$$tst" $(AM_TESTS_FD_REDIRECT) +t_11_includeone.log: t_11_includeone + @p='t_11_includeone'; \ + b='t_11_includeone'; \ + $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ + --log-file $$b.log --trs-file $$b.trs \ + $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ + "$$tst" $(AM_TESTS_FD_REDIRECT) +t_12_includeloop.log: t_12_includeloop + @p='t_12_includeloop'; \ + b='t_12_includeloop'; \ + $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ + --log-file $$b.log --trs-file $$b.trs \ + $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ + "$$tst" $(AM_TESTS_FD_REDIRECT) +t_13_includetwo.log: t_13_includetwo + @p='t_13_includetwo'; \ + b='t_13_includetwo'; \ + $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ + --log-file $$b.log --trs-file $$b.trs \ + $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ + "$$tst" $(AM_TESTS_FD_REDIRECT) +t_14_includeinline.log: t_14_includeinline + @p='t_14_includeinline'; \ + b='t_14_includeinline'; \ + $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ + --log-file $$b.log --trs-file $$b.trs \ + $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ + "$$tst" $(AM_TESTS_FD_REDIRECT) +t_15_includenotfound.log: t_15_includenotfound + @p='t_15_includenotfound'; \ + b='t_15_includenotfound'; \ + $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ + --log-file $$b.log --trs-file $$b.trs \ + $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ + "$$tst" $(AM_TESTS_FD_REDIRECT) +t_16_emptyfilter.log: t_16_emptyfilter + @p='t_16_emptyfilter'; \ + b='t_16_emptyfilter'; \ + $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ + --log-file $$b.log --trs-file $$b.trs \ + $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ + "$$tst" $(AM_TESTS_FD_REDIRECT) +t_17_oneemptyrule.log: t_17_oneemptyrule + @p='t_17_oneemptyrule'; \ + b='t_17_oneemptyrule'; \ + $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ + --log-file $$b.log --trs-file $$b.trs \ + $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ + "$$tst" $(AM_TESTS_FD_REDIRECT) +t_18_manyemptyrules.log: t_18_manyemptyrules + @p='t_18_manyemptyrules'; \ + b='t_18_manyemptyrules'; \ + $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ + --log-file $$b.log --trs-file $$b.trs \ + $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ + "$$tst" $(AM_TESTS_FD_REDIRECT) +t_19_simplerule.log: t_19_simplerule + @p='t_19_simplerule'; \ + b='t_19_simplerule'; \ + $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ + --log-file $$b.log --trs-file $$b.trs \ + $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ + "$$tst" $(AM_TESTS_FD_REDIRECT) +t_20_fullrule.log: t_20_fullrule + @p='t_20_fullrule'; \ + b='t_20_fullrule'; \ + $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ + --log-file $$b.log --trs-file $$b.trs \ + $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ + "$$tst" $(AM_TESTS_FD_REDIRECT) +t_21_compoundarg.log: t_21_compoundarg + @p='t_21_compoundarg'; \ + b='t_21_compoundarg'; \ + $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ + --log-file $$b.log --trs-file $$b.trs \ + $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ + "$$tst" $(AM_TESTS_FD_REDIRECT) +t_22_hostnames.log: t_22_hostnames + @p='t_22_hostnames'; \ + b='t_22_hostnames'; \ + $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ + --log-file $$b.log --trs-file $$b.trs \ + $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ + "$$tst" $(AM_TESTS_FD_REDIRECT) +t_23_ports.log: t_23_ports + @p='t_23_ports'; \ + b='t_23_ports'; \ + $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ + --log-file $$b.log --trs-file $$b.trs \ + $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ + "$$tst" $(AM_TESTS_FD_REDIRECT) +t_24_log.log: t_24_log + @p='t_24_log'; \ + b='t_24_log'; \ + $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ + --log-file $$b.log --trs-file $$b.trs \ + $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ + "$$tst" $(AM_TESTS_FD_REDIRECT) +t_25_target.log: t_25_target + @p='t_25_target'; \ + b='t_25_target'; \ + $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ + --log-file $$b.log --trs-file $$b.trs \ + $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ + "$$tst" $(AM_TESTS_FD_REDIRECT) +t_26_negation.log: t_26_negation + @p='t_26_negation'; \ + b='t_26_negation'; \ + $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ + --log-file $$b.log --trs-file $$b.trs \ + $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ + "$$tst" $(AM_TESTS_FD_REDIRECT) +t_27_compoundspecifier.log: t_27_compoundspecifier + @p='t_27_compoundspecifier'; \ + b='t_27_compoundspecifier'; \ + $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ + --log-file $$b.log --trs-file $$b.trs \ + $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ + "$$tst" $(AM_TESTS_FD_REDIRECT) +t_28_routing.log: t_28_routing + @p='t_28_routing'; \ + b='t_28_routing'; \ + $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ + --log-file $$b.log --trs-file $$b.trs \ + $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ + "$$tst" $(AM_TESTS_FD_REDIRECT) +t_29_nocommentend.log: t_29_nocommentend + @p='t_29_nocommentend'; \ + b='t_29_nocommentend'; \ + $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ + --log-file $$b.log --trs-file $$b.trs \ + $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ + "$$tst" $(AM_TESTS_FD_REDIRECT) +t_30_chaingroup.log: t_30_chaingroup + @p='t_30_chaingroup'; \ + b='t_30_chaingroup'; \ + $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ + --log-file $$b.log --trs-file $$b.trs \ + $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ + "$$tst" $(AM_TESTS_FD_REDIRECT) +t_31_chaingroupbad.log: t_31_chaingroupbad + @p='t_31_chaingroupbad'; \ + b='t_31_chaingroupbad'; \ + $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ + --log-file $$b.log --trs-file $$b.trs \ + $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ + "$$tst" $(AM_TESTS_FD_REDIRECT) +t_32_syntaxexamples.log: t_32_syntaxexamples + @p='t_32_syntaxexamples'; \ + b='t_32_syntaxexamples'; \ + $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ + --log-file $$b.log --trs-file $$b.trs \ + $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ + "$$tst" $(AM_TESTS_FD_REDIRECT) +t_33_nestedparse.log: t_33_nestedparse + @p='t_33_nestedparse'; \ + b='t_33_nestedparse'; \ + $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ + --log-file $$b.log --trs-file $$b.trs \ + $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ + "$$tst" $(AM_TESTS_FD_REDIRECT) +t_34_ast.log: t_34_ast + @p='t_34_ast'; \ + b='t_34_ast'; \ + $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ + --log-file $$b.log --trs-file $$b.trs \ + $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ + "$$tst" $(AM_TESTS_FD_REDIRECT) +t_35_rule_list.log: t_35_rule_list + @p='t_35_rule_list'; \ + b='t_35_rule_list'; \ + $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ + --log-file $$b.log --trs-file $$b.trs \ + $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ + "$$tst" $(AM_TESTS_FD_REDIRECT) +t_36_rule.log: t_36_rule + @p='t_36_rule'; \ + b='t_36_rule'; \ + $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ + --log-file $$b.log --trs-file $$b.trs \ + $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ + "$$tst" $(AM_TESTS_FD_REDIRECT) +t_37_specifier_list.log: t_37_specifier_list + @p='t_37_specifier_list'; \ + b='t_37_specifier_list'; \ + $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ + --log-file $$b.log --trs-file $$b.trs \ + $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ + "$$tst" $(AM_TESTS_FD_REDIRECT) +t_38_specifier.log: t_38_specifier + @p='t_38_specifier'; \ + b='t_38_specifier'; \ + $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ + --log-file $$b.log --trs-file $$b.trs \ + $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ + "$$tst" $(AM_TESTS_FD_REDIRECT) +t_39_negated_specifier.log: t_39_negated_specifier + @p='t_39_negated_specifier'; \ + b='t_39_negated_specifier'; \ + $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ + --log-file $$b.log --trs-file $$b.trs \ + $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ + "$$tst" $(AM_TESTS_FD_REDIRECT) +t_40_direction.log: t_40_direction + @p='t_40_direction'; \ + b='t_40_direction'; \ + $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ + --log-file $$b.log --trs-file $$b.trs \ + $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ + "$$tst" $(AM_TESTS_FD_REDIRECT) +t_41_target.log: t_41_target + @p='t_41_target'; \ + b='t_41_target'; \ + $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ + --log-file $$b.log --trs-file $$b.trs \ + $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ + "$$tst" $(AM_TESTS_FD_REDIRECT) +t_42_host.log: t_42_host + @p='t_42_host'; \ + b='t_42_host'; \ + $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ + --log-file $$b.log --trs-file $$b.trs \ + $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ + "$$tst" $(AM_TESTS_FD_REDIRECT) +t_43_port.log: t_43_port + @p='t_43_port'; \ + b='t_43_port'; \ + $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ + --log-file $$b.log --trs-file $$b.trs \ + $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ + "$$tst" $(AM_TESTS_FD_REDIRECT) +t_44_protocol.log: t_44_protocol + @p='t_44_protocol'; \ + b='t_44_protocol'; \ + $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ + --log-file $$b.log --trs-file $$b.trs \ + $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ + "$$tst" $(AM_TESTS_FD_REDIRECT) +t_45_icmptype.log: t_45_icmptype + @p='t_45_icmptype'; \ + b='t_45_icmptype'; \ + $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ + --log-file $$b.log --trs-file $$b.trs \ + $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ + "$$tst" $(AM_TESTS_FD_REDIRECT) +t_46_routing.log: t_46_routing + @p='t_46_routing'; \ + b='t_46_routing'; \ + $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ + --log-file $$b.log --trs-file $$b.trs \ + $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ + "$$tst" $(AM_TESTS_FD_REDIRECT) +t_47_subrule_list.log: t_47_subrule_list + @p='t_47_subrule_list'; \ + b='t_47_subrule_list'; \ + $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ + --log-file $$b.log --trs-file $$b.trs \ + $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ + "$$tst" $(AM_TESTS_FD_REDIRECT) +t_48_chaingroup.log: t_48_chaingroup + @p='t_48_chaingroup'; \ + b='t_48_chaingroup'; \ + $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ + --log-file $$b.log --trs-file $$b.trs \ + $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ + "$$tst" $(AM_TESTS_FD_REDIRECT) +t_49_convertspeclist.log: t_49_convertspeclist + @p='t_49_convertspeclist'; \ + b='t_49_convertspeclist'; \ + $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ + --log-file $$b.log --trs-file $$b.trs \ + $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ + "$$tst" $(AM_TESTS_FD_REDIRECT) +t_50_convertrulelist.log: t_50_convertrulelist + @p='t_50_convertrulelist'; \ + b='t_50_convertrulelist'; \ + $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ + --log-file $$b.log --trs-file $$b.trs \ + $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ + "$$tst" $(AM_TESTS_FD_REDIRECT) +t_51_convertdirection.log: t_51_convertdirection + @p='t_51_convertdirection'; \ + b='t_51_convertdirection'; \ + $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ + --log-file $$b.log --trs-file $$b.trs \ + $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ + "$$tst" $(AM_TESTS_FD_REDIRECT) +t_52_converthost.log: t_52_converthost + @p='t_52_converthost'; \ + b='t_52_converthost'; \ + $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ + --log-file $$b.log --trs-file $$b.trs \ + $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ + "$$tst" $(AM_TESTS_FD_REDIRECT) +t_53_convertproto.log: t_53_convertproto + @p='t_53_convertproto'; \ + b='t_53_convertproto'; \ + $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ + --log-file $$b.log --trs-file $$b.trs \ + $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ + "$$tst" $(AM_TESTS_FD_REDIRECT) +t_54_convertport.log: t_54_convertport + @p='t_54_convertport'; \ + b='t_54_convertport'; \ + $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ + --log-file $$b.log --trs-file $$b.trs \ + $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ + "$$tst" $(AM_TESTS_FD_REDIRECT) +t_55_converticmptype.log: t_55_converticmptype + @p='t_55_converticmptype'; \ + b='t_55_converticmptype'; \ + $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ + --log-file $$b.log --trs-file $$b.trs \ + $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ + "$$tst" $(AM_TESTS_FD_REDIRECT) +t_56_convertrouting.log: t_56_convertrouting + @p='t_56_convertrouting'; \ + b='t_56_convertrouting'; \ + $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ + --log-file $$b.log --trs-file $$b.trs \ + $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ + "$$tst" $(AM_TESTS_FD_REDIRECT) +t_57_convertchains.log: t_57_convertchains + @p='t_57_convertchains'; \ + b='t_57_convertchains'; \ + $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ + --log-file $$b.log --trs-file $$b.trs \ + $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ + "$$tst" $(AM_TESTS_FD_REDIRECT) +t_58_convertcompound.log: t_58_convertcompound + @p='t_58_convertcompound'; \ + b='t_58_convertcompound'; \ + $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ + --log-file $$b.log --trs-file $$b.trs \ + $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ + "$$tst" $(AM_TESTS_FD_REDIRECT) +t_59_convertnested.log: t_59_convertnested + @p='t_59_convertnested'; \ + b='t_59_convertnested'; \ + $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ + --log-file $$b.log --trs-file $$b.trs \ + $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ + "$$tst" $(AM_TESTS_FD_REDIRECT) +t_60_bigugly.log: t_60_bigugly + @p='t_60_bigugly'; \ + b='t_60_bigugly'; \ + $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ + --log-file $$b.log --trs-file $$b.trs \ + $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ + "$$tst" $(AM_TESTS_FD_REDIRECT) +t_61_convertlog.log: t_61_convertlog + @p='t_61_convertlog'; \ + b='t_61_convertlog'; \ + $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ + --log-file $$b.log --trs-file $$b.trs \ + $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ + "$$tst" $(AM_TESTS_FD_REDIRECT) +t_62_convertoptions.log: t_62_convertoptions + @p='t_62_convertoptions'; \ + b='t_62_convertoptions'; \ + $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ + --log-file $$b.log --trs-file $$b.trs \ + $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ + "$$tst" $(AM_TESTS_FD_REDIRECT) +t_63_includedir.log: t_63_includedir + @p='t_63_includedir'; \ + b='t_63_includedir'; \ + $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ + --log-file $$b.log --trs-file $$b.trs \ + $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ + "$$tst" $(AM_TESTS_FD_REDIRECT) +t_64_includedirwfile.log: t_64_includedirwfile + @p='t_64_includedirwfile'; \ + b='t_64_includedirwfile'; \ + $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ + --log-file $$b.log --trs-file $$b.trs \ + $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ + "$$tst" $(AM_TESTS_FD_REDIRECT) +t_65_includedirwdir.log: t_65_includedirwdir + @p='t_65_includedirwdir'; \ + b='t_65_includedirwdir'; \ + $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ + --log-file $$b.log --trs-file $$b.trs \ + $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ + "$$tst" $(AM_TESTS_FD_REDIRECT) +t_66_includedirtwofiles.log: t_66_includedirtwofiles + @p='t_66_includedirtwofiles'; \ + b='t_66_includedirtwofiles'; \ + $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ + --log-file $$b.log --trs-file $$b.trs \ + $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ + "$$tst" $(AM_TESTS_FD_REDIRECT) +t_67_includeemptyfile.log: t_67_includeemptyfile + @p='t_67_includeemptyfile'; \ + b='t_67_includeemptyfile'; \ + $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ + --log-file $$b.log --trs-file $$b.trs \ + $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ + "$$tst" $(AM_TESTS_FD_REDIRECT) +t_68_noop.log: t_68_noop + @p='t_68_noop'; \ + b='t_68_noop'; \ + $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ + --log-file $$b.log --trs-file $$b.trs \ + $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ + "$$tst" $(AM_TESTS_FD_REDIRECT) +t_69_includeemptynoop.log: t_69_includeemptynoop + @p='t_69_includeemptynoop'; \ + b='t_69_includeemptynoop'; \ + $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ + --log-file $$b.log --trs-file $$b.trs \ + $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ + "$$tst" $(AM_TESTS_FD_REDIRECT) +t_70_includesemicolon.log: t_70_includesemicolon + @p='t_70_includesemicolon'; \ + b='t_70_includesemicolon'; \ + $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ + --log-file $$b.log --trs-file $$b.trs \ + $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ + "$$tst" $(AM_TESTS_FD_REDIRECT) +t_71_includeglob.log: t_71_includeglob + @p='t_71_includeglob'; \ + b='t_71_includeglob'; \ + $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ + --log-file $$b.log --trs-file $$b.trs \ + $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ + "$$tst" $(AM_TESTS_FD_REDIRECT) +.test.log: + @p='$<'; \ + $(am__set_b); \ + $(am__check_pre) $(TEST_LOG_DRIVER) --test-name "$$f" \ + --log-file $$b.log --trs-file $$b.trs \ + $(am__common_driver_flags) $(AM_TEST_LOG_DRIVER_FLAGS) $(TEST_LOG_DRIVER_FLAGS) -- $(TEST_LOG_COMPILE) \ + "$$tst" $(AM_TESTS_FD_REDIRECT) +@am__EXEEXT_TRUE@.test$(EXEEXT).log: +@am__EXEEXT_TRUE@ @p='$<'; \ +@am__EXEEXT_TRUE@ $(am__set_b); \ +@am__EXEEXT_TRUE@ $(am__check_pre) $(TEST_LOG_DRIVER) --test-name "$$f" \ +@am__EXEEXT_TRUE@ --log-file $$b.log --trs-file $$b.trs \ +@am__EXEEXT_TRUE@ $(am__common_driver_flags) $(AM_TEST_LOG_DRIVER_FLAGS) $(TEST_LOG_DRIVER_FLAGS) -- $(TEST_LOG_COMPILE) \ +@am__EXEEXT_TRUE@ "$$tst" $(AM_TESTS_FD_REDIRECT) distdir: $(DISTFILES) - $(mkdir_p) $(distdir)/$(top_srcdir)/t/data - @srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \ - topsrcdirstrip=`echo "$(top_srcdir)" | sed 's|.|.|g'`; \ - list='$(DISTFILES)'; for file in $$list; do \ - case $$file in \ - $(srcdir)/*) file=`echo "$$file" | sed "s|^$$srcdirstrip/||"`;; \ - $(top_srcdir)/*) file=`echo "$$file" | sed "s|^$$topsrcdirstrip/|$(top_builddir)/|"`;; \ - esac; \ + @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + list='$(DISTFILES)'; \ + dist_files=`for file in $$list; do echo $$file; done | \ + sed -e "s|^$$srcdirstrip/||;t" \ + -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ + case $$dist_files in \ + */*) $(MKDIR_P) `echo "$$dist_files" | \ + sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ + sort -u` ;; \ + esac; \ + for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ - dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \ - if test "$$dir" != "$$file" && test "$$dir" != "."; then \ - dir="/$$dir"; \ - $(mkdir_p) "$(distdir)$$dir"; \ - else \ - dir=''; \ - fi; \ if test -d $$d/$$file; then \ + dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ + if test -d "$(distdir)/$$file"; then \ + find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ + fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ - cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \ + cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ + find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ - cp -pR $$d/$$file $(distdir)$$dir || exit 1; \ + cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ - test -f $(distdir)/$$file \ - || cp -p $$d/$$file $(distdir)/$$file \ + test -f "$(distdir)/$$file" \ + || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done @@ -493,16 +1397,25 @@ installcheck: installcheck-am install-strip: - $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ - install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ - `test -z '$(STRIP)' || \ - echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install + if test -z '$(STRIP)'; then \ + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + install; \ + else \ + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ + fi mostlyclean-generic: + -test -z "$(TEST_LOGS)" || rm -f $(TEST_LOGS) + -test -z "$(TEST_LOGS:.log=.trs)" || rm -f $(TEST_LOGS:.log=.trs) + -test -z "$(TEST_SUITE_LOG)" || rm -f $(TEST_SUITE_LOG) clean-generic: distclean-generic: - -rm -f $(CONFIG_CLEAN_FILES) + -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) + -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @@ -523,18 +1436,38 @@ html: html-am +html-am: + info: info-am info-am: install-data-am: +install-dvi: install-dvi-am + +install-dvi-am: + install-exec-am: +install-html: install-html-am + +install-html-am: + install-info: install-info-am +install-info-am: + install-man: +install-pdf: install-pdf-am + +install-pdf-am: + +install-ps: install-ps-am + +install-ps-am: + installcheck-am: maintainer-clean: maintainer-clean-am @@ -554,18 +1487,25 @@ ps-am: -uninstall-am: uninstall-info-am +uninstall-am: + +.MAKE: check-am install-am install-strip + +.PHONY: CTAGS GTAGS TAGS all all-am check check-TESTS check-am clean \ + clean-checkPROGRAMS clean-generic cscopelist-am ctags ctags-am \ + distclean distclean-compile distclean-generic distclean-tags \ + distdir dvi dvi-am html html-am info info-am install \ + install-am install-data install-data-am install-dvi \ + install-dvi-am install-exec install-exec-am install-html \ + install-html-am install-info install-info-am install-man \ + install-pdf install-pdf-am install-ps install-ps-am \ + install-strip installcheck installcheck-am installdirs \ + maintainer-clean maintainer-clean-generic mostlyclean \ + mostlyclean-compile mostlyclean-generic pdf pdf-am ps ps-am \ + recheck tags tags-am uninstall uninstall-am + +.PRECIOUS: Makefile -.PHONY: CTAGS GTAGS all all-am check check-TESTS check-am clean \ - clean-checkPROGRAMS clean-generic ctags distclean \ - distclean-compile distclean-generic distclean-tags distdir dvi \ - dvi-am html html-am info info-am install install-am \ - install-data install-data-am install-exec install-exec-am \ - install-info install-info-am install-man install-strip \ - installcheck installcheck-am installdirs maintainer-clean \ - maintainer-clean-generic mostlyclean mostlyclean-compile \ - mostlyclean-generic pdf pdf-am ps ps-am tags uninstall \ - uninstall-am uninstall-info-am # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. diff -Nru filtergen-0.12.4/t/mask.filter filtergen-0.12.7/t/mask.filter --- filtergen-0.12.4/t/mask.filter 2016-02-18 07:59:36.000000000 +0000 +++ filtergen-0.12.7/t/mask.filter 1970-01-01 00:00:00.000000000 +0000 @@ -1,8 +0,0 @@ -input eth0 { - source foo accept; - source bar/24 accept; - source baz/255.255.255.248 accept; - dest quux/0 accept; - dest flirble/32 accept; - source meep/255.0 drop; -}; diff -Nru filtergen-0.12.4/t/name.filter filtergen-0.12.7/t/name.filter --- filtergen-0.12.4/t/name.filter 2016-02-18 07:59:36.000000000 +0000 +++ filtergen-0.12.7/t/name.filter 1970-01-01 00:00:00.000000000 +0000 @@ -1,4 +0,0 @@ -input eth0 local { - dest localhost/8 accept; - dest tim/255.0.255.0 drop; -}; diff -Nru filtergen-0.12.4/t/oneway.filter filtergen-0.12.7/t/oneway.filter --- filtergen-0.12.4/t/oneway.filter 2016-02-18 07:59:36.000000000 +0000 +++ filtergen-0.12.7/t/oneway.filter 1970-01-01 00:00:00.000000000 +0000 @@ -1,5 +0,0 @@ -# test "oneway" option -# $Id: oneway.filter,v 1.1 2003/04/02 11:07:35 matthew Exp $ - -input eth0 proto tcp accept; -input eth0 proto tcp oneway accept; diff -Nru filtergen-0.12.4/t/parse.c filtergen-0.12.7/t/parse.c --- filtergen-0.12.4/t/parse.c 2004-05-15 03:26:48.000000000 +0000 +++ filtergen-0.12.7/t/parse.c 2016-02-13 10:52:59.000000000 +0000 @@ -1,19 +1,19 @@ #include #include "../ast.h" -extern char * yytext; +extern char *yytext; int yyparse(void *); extern int yydebug; -int main(int argc __attribute__((unused)), char ** argv __attribute__((unused))) { - char * YYDEBUGTRACE; - struct ast_s ast; +int main(int argc __attribute__((unused)), + char **argv __attribute__((unused))) { + char *YYDEBUGTRACE; + struct ast_s ast; - YYDEBUGTRACE = getenv("YYDEBUGTRACE"); - yydebug = YYDEBUGTRACE ? atoi(YYDEBUGTRACE) : 0; + YYDEBUGTRACE = getenv("YYDEBUGTRACE"); + yydebug = YYDEBUGTRACE ? atoi(YYDEBUGTRACE) : 0; - yyparse(&ast); + yyparse(&ast); - return 0; + return 0; } - diff -Nru filtergen-0.12.4/t/regress0.filter filtergen-0.12.7/t/regress0.filter --- filtergen-0.12.4/t/regress0.filter 2016-02-18 07:59:36.000000000 +0000 +++ filtergen-0.12.7/t/regress0.filter 1970-01-01 00:00:00.000000000 +0000 @@ -1,13 +0,0 @@ -# -# this used to break filter_unroll by making loops -# in the tree -# -# $Id: regress0.filter,v 1.1 2002/09/02 11:10:42 matthew Exp $ - -output eth0 { - { proto tcp; proto udp } dport domain; -} accept; - -output eth0 { - { proto tcp; proto udp } dport domain; -} accept source bar; diff -Nru filtergen-0.12.4/t/scan.c filtergen-0.12.7/t/scan.c --- filtergen-0.12.4/t/scan.c 2016-02-18 07:59:36.000000000 +0000 +++ filtergen-0.12.7/t/scan.c 2016-02-13 10:52:59.000000000 +0000 @@ -1,100 +1,132 @@ +#include #include #include #include #include -#include #include "../parser.h" -extern char * yytext; +extern char *yytext; int yylex(); long int lineno(); -char * filename(); +char *filename(); -char * tok_map(int c) { - char * r; - switch (c) { - case TOK_ACCEPT: - r = strdup("accept"); break; - case TOK_DEST: - r = strdup("dest"); break; - case TOK_DPORT: - r = strdup("dport"); break; - case TOK_DROP: - r = strdup("drop"); break; - case TOK_FORWARD: - r = strdup("forward"); break; - case TOK_ICMPTYPE: - r = strdup("icmptype"); break; - case TOK_INPUT: - r = strdup("input"); break; - case TOK_LCURLY: - r = strdup("lcurly"); break; - case TOK_LOCAL: - r = strdup("local"); break; - case TOK_LOG: - r = strdup("log"); break; - case TOK_LSQUARE: - r = strdup("lsquare"); break; - case TOK_MASQ: - r = strdup("masq"); break; - case TOK_ONEWAY: - r = strdup("oneway"); break; - case TOK_OUTPUT: - r = strdup("output"); break; - case TOK_PROTO: - r = strdup("proto"); break; - case TOK_PROXY: - r = strdup("proxy"); break; - case TOK_RCURLY: - r = strdup("rcurly"); break; - case TOK_REDIRECT: - r = strdup("redirect"); break; - case TOK_REJECT: - r = strdup("reject"); break; - case TOK_RSQUARE: - r = strdup("rsquare"); break; - case TOK_SEMICOLON: - r = strdup("semicolon"); break; - case TOK_SOURCE: - r = strdup("source"); break; - case TOK_SPORT: - r = strdup("sport"); break; - case TOK_TEXT: - r = strdup("text"); break; - case TOK_IDENTIFIER: - r = strdup("identifier"); break; - case TOK_DOT: - r = strdup("dot"); break; - case TOK_SLASH: - r = strdup("slash"); break; - case TOK_BANG: - r = strdup("bang"); break; - case TOK_COLON: - r = strdup("colon"); break; - default: - r = strdup("UNRECOGNISED"); break; - } - return r; -} +char *tok_map(int c) { + char *r; + switch (c) { + case TOK_ACCEPT: + r = strdup("accept"); + break; + case TOK_DEST: + r = strdup("dest"); + break; + case TOK_DPORT: + r = strdup("dport"); + break; + case TOK_DROP: + r = strdup("drop"); + break; + case TOK_FORWARD: + r = strdup("forward"); + break; + case TOK_ICMPTYPE: + r = strdup("icmptype"); + break; + case TOK_INPUT: + r = strdup("input"); + break; + case TOK_LCURLY: + r = strdup("lcurly"); + break; + case TOK_LOCAL: + r = strdup("local"); + break; + case TOK_LOG: + r = strdup("log"); + break; + case TOK_LSQUARE: + r = strdup("lsquare"); + break; + case TOK_MASQ: + r = strdup("masq"); + break; + case TOK_ONEWAY: + r = strdup("oneway"); + break; + case TOK_OUTPUT: + r = strdup("output"); + break; + case TOK_PROTO: + r = strdup("proto"); + break; + case TOK_PROXY: + r = strdup("proxy"); + break; + case TOK_RCURLY: + r = strdup("rcurly"); + break; + case TOK_REDIRECT: + r = strdup("redirect"); + break; + case TOK_REJECT: + r = strdup("reject"); + break; + case TOK_RSQUARE: + r = strdup("rsquare"); + break; + case TOK_SEMICOLON: + r = strdup("semicolon"); + break; + case TOK_SOURCE: + r = strdup("source"); + break; + case TOK_SPORT: + r = strdup("sport"); + break; + case TOK_TEXT: + r = strdup("text"); + break; + case TOK_IDENTIFIER: + r = strdup("identifier"); + break; + case TOK_DOT: + r = strdup("dot"); + break; + case TOK_SLASH: + r = strdup("slash"); + break; + case TOK_BANG: + r = strdup("bang"); + break; + case TOK_COLON: + r = strdup("colon"); + break; + case TOK_STAR: + r = strdup("star"); + break; + default: + r = strdup("UNRECOGNISED"); + break; + } + return r; +} -int main(int argc __attribute__((unused)), char ** argv __attribute__((unused))) { - int c; - int ret; - - /* if running in make distcheck the cwd isn't the same as the srcdir */ - if (getenv("srcdir")) { - ret = chdir(getenv("srcdir")); - if (ret != 0) { - fprintf(stderr, "failed to change directory to %s (%s)\n", - getenv("srcdir"), strerror(errno)); - return 1; - } +int main(int argc __attribute__((unused)), + char **argv __attribute__((unused))) { + int c; + + /* if running in make distcheck the cwd isn't the same as the srcdir */ + if (getenv("srcdir")) { + if (chdir(getenv("srcdir")) < 0) { + fprintf(stderr, "error changing to path %s: %s\n", getenv("srcdir"), + strerror(errno)); + return EXIT_FAILURE; } + } - while ((c = yylex())) { - printf("kind = %s, spelling = \"%s\", file = \"%s\", line = %ld\n", tok_map(c), yytext, filename(), lineno()); - } - return 0; + while ((c = yylex())) { + printf("kind = %s, spelling = \"%s\", file = \"%s\", line = %ld\n", + tok_map(c), yytext, filename(), lineno()); + } + return 0; } - diff -Nru filtergen-0.12.4/t/t_01_ccomment filtergen-0.12.7/t/t_01_ccomment --- filtergen-0.12.4/t/t_01_ccomment 2004-05-15 03:26:21.000000000 +0000 +++ filtergen-0.12.7/t/t_01_ccomment 2016-02-13 09:44:55.000000000 +0000 @@ -1,4 +1,4 @@ -#!/bin/sh +#!/bin/sh -x TEST="that c style comments are scanned and ignored" diff -Nru filtergen-0.12.4/t/t_02_hashcomment filtergen-0.12.7/t/t_02_hashcomment --- filtergen-0.12.4/t/t_02_hashcomment 2004-05-15 03:26:21.000000000 +0000 +++ filtergen-0.12.7/t/t_02_hashcomment 2016-02-13 09:44:55.000000000 +0000 @@ -1,4 +1,4 @@ -#!/bin/sh +#!/bin/sh -x TEST="that hash style comments are scanned and ignored" diff -Nru filtergen-0.12.4/t/t_03_hashnonewline filtergen-0.12.7/t/t_03_hashnonewline --- filtergen-0.12.4/t/t_03_hashnonewline 2004-05-15 03:26:21.000000000 +0000 +++ filtergen-0.12.7/t/t_03_hashnonewline 2016-02-13 09:44:55.000000000 +0000 @@ -1,4 +1,4 @@ -#!/bin/sh +#!/bin/sh -x TEST="that hash style comments with no newline are scanned and ignored" diff -Nru filtergen-0.12.4/t/t_04_keywords filtergen-0.12.7/t/t_04_keywords --- filtergen-0.12.4/t/t_04_keywords 2004-05-15 03:26:21.000000000 +0000 +++ filtergen-0.12.7/t/t_04_keywords 2016-02-13 09:44:55.000000000 +0000 @@ -1,4 +1,4 @@ -#!/bin/sh +#!/bin/sh -x TEST="that filtergen keywords are scanned correctly" diff -Nru filtergen-0.12.4/t/t_05_punct filtergen-0.12.7/t/t_05_punct --- filtergen-0.12.4/t/t_05_punct 2004-05-15 03:26:21.000000000 +0000 +++ filtergen-0.12.7/t/t_05_punct 2016-02-13 09:44:55.000000000 +0000 @@ -1,4 +1,4 @@ -#!/bin/sh +#!/bin/sh -x TEST="that filtergen punctuation scanned correctly" diff -Nru filtergen-0.12.4/t/t_06_numbers filtergen-0.12.7/t/t_06_numbers --- filtergen-0.12.4/t/t_06_numbers 2004-05-15 03:26:21.000000000 +0000 +++ filtergen-0.12.7/t/t_06_numbers 2016-02-13 09:44:55.000000000 +0000 @@ -1,4 +1,4 @@ -#!/bin/sh +#!/bin/sh -x TEST="that numbers are scanned correctly" diff -Nru filtergen-0.12.4/t/t_07_names filtergen-0.12.7/t/t_07_names --- filtergen-0.12.4/t/t_07_names 2004-05-15 03:26:21.000000000 +0000 +++ filtergen-0.12.7/t/t_07_names 2016-02-13 09:44:55.000000000 +0000 @@ -1,4 +1,4 @@ -#!/bin/sh +#!/bin/sh -x TEST="that non-keyword identifiers are scanned correctly" diff -Nru filtergen-0.12.4/t/t_08_networknames filtergen-0.12.7/t/t_08_networknames --- filtergen-0.12.4/t/t_08_networknames 2004-05-15 03:26:21.000000000 +0000 +++ filtergen-0.12.7/t/t_08_networknames 2016-02-13 09:44:55.000000000 +0000 @@ -1,4 +1,4 @@ -#!/bin/sh +#!/bin/sh -x TEST="that network addresses and services are scanned correctly" diff -Nru filtergen-0.12.4/t/t_09_badcomment filtergen-0.12.7/t/t_09_badcomment --- filtergen-0.12.4/t/t_09_badcomment 2004-05-15 03:26:21.000000000 +0000 +++ filtergen-0.12.7/t/t_09_badcomment 2016-02-13 09:44:55.000000000 +0000 @@ -1,4 +1,4 @@ -#!/bin/sh +#!/bin/sh -x TEST="that bad comments are scanned and flag errors" diff -Nru filtergen-0.12.4/t/t_10_goodcomment filtergen-0.12.7/t/t_10_goodcomment --- filtergen-0.12.4/t/t_10_goodcomment 2004-05-15 03:26:21.000000000 +0000 +++ filtergen-0.12.7/t/t_10_goodcomment 2016-02-13 09:44:55.000000000 +0000 @@ -1,4 +1,4 @@ -#!/bin/sh +#!/bin/sh -x TEST="that c style comments with nested /* are scanned correctly" diff -Nru filtergen-0.12.4/t/t_11_includeone filtergen-0.12.7/t/t_11_includeone --- filtergen-0.12.4/t/t_11_includeone 2004-05-15 03:26:21.000000000 +0000 +++ filtergen-0.12.7/t/t_11_includeone 2016-02-13 09:44:55.000000000 +0000 @@ -1,4 +1,4 @@ -#!/bin/sh +#!/bin/sh -x TEST="that c style comments are scanned and ignored" diff -Nru filtergen-0.12.4/t/t_12_includeloop filtergen-0.12.7/t/t_12_includeloop --- filtergen-0.12.4/t/t_12_includeloop 2004-05-15 03:26:21.000000000 +0000 +++ filtergen-0.12.7/t/t_12_includeloop 2016-02-13 10:52:59.000000000 +0000 @@ -1,12 +1,13 @@ -#!/bin/sh +#!/bin/sh -x -TEST="that c style comments are scanned and ignored" +TEST="that exceeding the stack depth for includes prints an error" testdir=`dirname $0` . $testdir/testlib ./scan < $testdir/data/scanner12.in > $work/out 2>&1 if test $? -ne 0 ; then no_result ; fi +cat $work/out compare $testdir/data/scanner12.out $work/out diff -Nru filtergen-0.12.4/t/t_13_includetwo filtergen-0.12.7/t/t_13_includetwo --- filtergen-0.12.4/t/t_13_includetwo 2004-05-15 03:26:21.000000000 +0000 +++ filtergen-0.12.7/t/t_13_includetwo 2016-02-13 09:44:55.000000000 +0000 @@ -1,4 +1,4 @@ -#!/bin/sh +#!/bin/sh -x TEST="that including more than one file works" diff -Nru filtergen-0.12.4/t/t_14_includeinline filtergen-0.12.7/t/t_14_includeinline --- filtergen-0.12.4/t/t_14_includeinline 2004-05-15 03:26:21.000000000 +0000 +++ filtergen-0.12.7/t/t_14_includeinline 2016-02-13 09:44:55.000000000 +0000 @@ -1,4 +1,4 @@ -#!/bin/sh +#!/bin/sh -x TEST="that including more than one file works" diff -Nru filtergen-0.12.4/t/t_15_includenotfound filtergen-0.12.7/t/t_15_includenotfound --- filtergen-0.12.4/t/t_15_includenotfound 2004-08-18 03:50:26.000000000 +0000 +++ filtergen-0.12.7/t/t_15_includenotfound 2016-02-13 09:44:55.000000000 +0000 @@ -1,4 +1,4 @@ -#!/bin/sh +#!/bin/sh -x TEST="that including a non-existent file is handled correctly" diff -Nru filtergen-0.12.4/t/t_16_emptyfilter filtergen-0.12.7/t/t_16_emptyfilter --- filtergen-0.12.4/t/t_16_emptyfilter 2004-05-15 03:26:26.000000000 +0000 +++ filtergen-0.12.7/t/t_16_emptyfilter 2016-02-13 09:44:55.000000000 +0000 @@ -1,4 +1,4 @@ -#!/bin/sh +#!/bin/sh -x TEST="that parsing the empty program works" diff -Nru filtergen-0.12.4/t/t_17_oneemptyrule filtergen-0.12.7/t/t_17_oneemptyrule --- filtergen-0.12.4/t/t_17_oneemptyrule 2004-05-15 03:26:26.000000000 +0000 +++ filtergen-0.12.7/t/t_17_oneemptyrule 2016-02-13 09:44:55.000000000 +0000 @@ -1,4 +1,4 @@ -#!/bin/sh +#!/bin/sh -x TEST="that parsing a single empty rule works" DATA=parser2 diff -Nru filtergen-0.12.4/t/t_18_manyemptyrules filtergen-0.12.7/t/t_18_manyemptyrules --- filtergen-0.12.4/t/t_18_manyemptyrules 2004-05-15 03:26:26.000000000 +0000 +++ filtergen-0.12.7/t/t_18_manyemptyrules 2016-02-13 09:44:55.000000000 +0000 @@ -1,4 +1,4 @@ -#!/bin/sh +#!/bin/sh -x TEST="that parsing a list of empty rules works" DATA=parser3 diff -Nru filtergen-0.12.4/t/t_19_simplerule filtergen-0.12.7/t/t_19_simplerule --- filtergen-0.12.4/t/t_19_simplerule 2004-05-15 03:26:26.000000000 +0000 +++ filtergen-0.12.7/t/t_19_simplerule 2016-02-13 09:44:55.000000000 +0000 @@ -1,4 +1,4 @@ -#!/bin/sh +#!/bin/sh -x TEST="that parsing a simple rule works" DATA=parser4 diff -Nru filtergen-0.12.4/t/t_20_fullrule filtergen-0.12.7/t/t_20_fullrule --- filtergen-0.12.4/t/t_20_fullrule 2004-05-15 03:26:26.000000000 +0000 +++ filtergen-0.12.7/t/t_20_fullrule 2016-02-13 09:44:55.000000000 +0000 @@ -1,4 +1,4 @@ -#!/bin/sh +#!/bin/sh -x TEST="that parsing a full rule with specifiers works" DATA=parser5 diff -Nru filtergen-0.12.4/t/t_21_compoundarg filtergen-0.12.7/t/t_21_compoundarg --- filtergen-0.12.4/t/t_21_compoundarg 2004-05-15 03:26:26.000000000 +0000 +++ filtergen-0.12.7/t/t_21_compoundarg 2016-02-13 09:44:55.000000000 +0000 @@ -1,4 +1,4 @@ -#!/bin/sh +#!/bin/sh -x TEST="that parsing a rule with a compound port argument works" DATA=parser6 diff -Nru filtergen-0.12.4/t/t_22_hostnames filtergen-0.12.7/t/t_22_hostnames --- filtergen-0.12.4/t/t_22_hostnames 2004-05-15 03:26:26.000000000 +0000 +++ filtergen-0.12.7/t/t_22_hostnames 2016-02-13 09:44:55.000000000 +0000 @@ -1,4 +1,4 @@ -#!/bin/sh +#!/bin/sh -x TEST="that parsing hostname and netmask variations works" DATA=parser7 diff -Nru filtergen-0.12.4/t/t_23_ports filtergen-0.12.7/t/t_23_ports --- filtergen-0.12.4/t/t_23_ports 2004-05-15 03:26:26.000000000 +0000 +++ filtergen-0.12.7/t/t_23_ports 2016-02-13 09:44:55.000000000 +0000 @@ -1,4 +1,4 @@ -#!/bin/sh +#!/bin/sh -x TEST="that parsing ports and port ranges works" DATA=parser8 diff -Nru filtergen-0.12.4/t/t_24_log filtergen-0.12.7/t/t_24_log --- filtergen-0.12.4/t/t_24_log 2004-05-15 03:26:26.000000000 +0000 +++ filtergen-0.12.7/t/t_24_log 2016-02-13 09:44:55.000000000 +0000 @@ -1,4 +1,4 @@ -#!/bin/sh +#!/bin/sh -x TEST="that parsing the log directive works" DATA=parser9 diff -Nru filtergen-0.12.4/t/t_25_target filtergen-0.12.7/t/t_25_target --- filtergen-0.12.4/t/t_25_target 2004-05-15 03:26:26.000000000 +0000 +++ filtergen-0.12.7/t/t_25_target 2016-02-13 09:44:55.000000000 +0000 @@ -1,4 +1,4 @@ -#!/bin/sh +#!/bin/sh -x TEST="that parsing the filter targets works" DATA=parser10 diff -Nru filtergen-0.12.4/t/t_26_negation filtergen-0.12.7/t/t_26_negation --- filtergen-0.12.4/t/t_26_negation 2004-05-15 03:26:26.000000000 +0000 +++ filtergen-0.12.7/t/t_26_negation 2016-02-13 09:44:55.000000000 +0000 @@ -1,4 +1,4 @@ -#!/bin/sh +#!/bin/sh -x TEST="that parsing negated specfiers works" DATA=parser11 diff -Nru filtergen-0.12.4/t/t_27_compoundspecifier filtergen-0.12.7/t/t_27_compoundspecifier --- filtergen-0.12.4/t/t_27_compoundspecifier 2004-05-15 03:26:26.000000000 +0000 +++ filtergen-0.12.7/t/t_27_compoundspecifier 2016-02-13 09:44:55.000000000 +0000 @@ -1,4 +1,4 @@ -#!/bin/sh +#!/bin/sh -x TEST="that parsing compound specfiers works" DATA=parser12 diff -Nru filtergen-0.12.4/t/t_28_routing filtergen-0.12.7/t/t_28_routing --- filtergen-0.12.4/t/t_28_routing 2004-05-15 03:26:26.000000000 +0000 +++ filtergen-0.12.7/t/t_28_routing 2016-02-13 09:44:55.000000000 +0000 @@ -1,4 +1,4 @@ -#!/bin/sh +#!/bin/sh -x TEST="that parsing routing specfiers works" DATA=parser13 diff -Nru filtergen-0.12.4/t/t_29_nocommentend filtergen-0.12.7/t/t_29_nocommentend --- filtergen-0.12.4/t/t_29_nocommentend 2004-05-15 03:26:25.000000000 +0000 +++ filtergen-0.12.7/t/t_29_nocommentend 2016-02-13 09:44:55.000000000 +0000 @@ -1,4 +1,4 @@ -#!/bin/sh +#!/bin/sh -x TEST="that open ended comments are handled" DATA=scanner16 diff -Nru filtergen-0.12.4/t/t_30_chaingroup filtergen-0.12.7/t/t_30_chaingroup --- filtergen-0.12.4/t/t_30_chaingroup 2004-05-15 03:26:26.000000000 +0000 +++ filtergen-0.12.7/t/t_30_chaingroup 2016-02-13 09:44:55.000000000 +0000 @@ -1,4 +1,4 @@ -#!/bin/sh +#!/bin/sh -x TEST="that chained subgroups are parsed correctly" DATA=parser14 diff -Nru filtergen-0.12.4/t/t_31_chaingroupbad filtergen-0.12.7/t/t_31_chaingroupbad --- filtergen-0.12.4/t/t_31_chaingroupbad 2004-05-15 03:26:25.000000000 +0000 +++ filtergen-0.12.7/t/t_31_chaingroupbad 2016-02-13 09:44:55.000000000 +0000 @@ -1,4 +1,4 @@ -#!/bin/sh +#!/bin/sh -x TEST="that parsing bad chain groups fails" DATA=parser15 diff -Nru filtergen-0.12.4/t/t_32_syntaxexamples filtergen-0.12.7/t/t_32_syntaxexamples --- filtergen-0.12.4/t/t_32_syntaxexamples 2004-05-15 03:26:26.000000000 +0000 +++ filtergen-0.12.7/t/t_32_syntaxexamples 2016-02-13 09:44:55.000000000 +0000 @@ -1,4 +1,4 @@ -#!/bin/sh +#!/bin/sh -x TEST="that the examples from the filter_syntax(7) page work" DATA=example1 diff -Nru filtergen-0.12.4/t/t_33_nestedparse filtergen-0.12.7/t/t_33_nestedparse --- filtergen-0.12.4/t/t_33_nestedparse 2004-05-15 03:26:26.000000000 +0000 +++ filtergen-0.12.7/t/t_33_nestedparse 2016-02-13 09:44:55.000000000 +0000 @@ -1,4 +1,4 @@ -#!/bin/sh +#!/bin/sh -x TEST="that the parser can cope with included files" DATA=parser16 diff -Nru filtergen-0.12.4/t/t_34_ast filtergen-0.12.7/t/t_34_ast --- filtergen-0.12.4/t/t_34_ast 2004-05-15 03:26:27.000000000 +0000 +++ filtergen-0.12.7/t/t_34_ast 2016-02-13 09:44:55.000000000 +0000 @@ -1,4 +1,4 @@ -#!/bin/sh +#!/bin/sh -x TEST="that the parser reads an ast correctly" DATA=emitter1 diff -Nru filtergen-0.12.4/t/t_35_rule_list filtergen-0.12.7/t/t_35_rule_list --- filtergen-0.12.4/t/t_35_rule_list 2004-05-15 03:26:27.000000000 +0000 +++ filtergen-0.12.7/t/t_35_rule_list 2016-02-13 09:44:55.000000000 +0000 @@ -1,4 +1,4 @@ -#!/bin/sh +#!/bin/sh -x TEST="that the parser reads a rule list correctly" DATA=emitter2 diff -Nru filtergen-0.12.4/t/t_36_rule filtergen-0.12.7/t/t_36_rule --- filtergen-0.12.4/t/t_36_rule 2004-05-15 03:26:27.000000000 +0000 +++ filtergen-0.12.7/t/t_36_rule 2016-02-13 09:44:55.000000000 +0000 @@ -1,4 +1,4 @@ -#!/bin/sh +#!/bin/sh -x TEST="that the parser reads a rule correctly" DATA=emitter3 diff -Nru filtergen-0.12.4/t/t_37_specifier_list filtergen-0.12.7/t/t_37_specifier_list --- filtergen-0.12.4/t/t_37_specifier_list 2004-05-15 03:26:27.000000000 +0000 +++ filtergen-0.12.7/t/t_37_specifier_list 2016-02-13 09:44:55.000000000 +0000 @@ -1,4 +1,4 @@ -#!/bin/sh +#!/bin/sh -x TEST="that the parser reads a specifier_list correctly" DATA=emitter4 diff -Nru filtergen-0.12.4/t/t_38_specifier filtergen-0.12.7/t/t_38_specifier --- filtergen-0.12.4/t/t_38_specifier 2004-05-15 03:26:28.000000000 +0000 +++ filtergen-0.12.7/t/t_38_specifier 2016-02-13 09:44:55.000000000 +0000 @@ -1,4 +1,4 @@ -#!/bin/sh +#!/bin/sh -x TEST="that the parser reads all the specifiers" DATA=emitter5 diff -Nru filtergen-0.12.4/t/t_39_negated_specifier filtergen-0.12.7/t/t_39_negated_specifier --- filtergen-0.12.4/t/t_39_negated_specifier 2004-05-15 03:26:28.000000000 +0000 +++ filtergen-0.12.7/t/t_39_negated_specifier 2016-02-13 09:44:55.000000000 +0000 @@ -1,4 +1,4 @@ -#!/bin/sh +#!/bin/sh -x TEST="that the parser reads negated specifiers" DATA=emitter6 diff -Nru filtergen-0.12.4/t/t_40_direction filtergen-0.12.7/t/t_40_direction --- filtergen-0.12.4/t/t_40_direction 2004-05-15 03:26:29.000000000 +0000 +++ filtergen-0.12.7/t/t_40_direction 2016-02-13 09:44:55.000000000 +0000 @@ -1,4 +1,4 @@ -#!/bin/sh +#!/bin/sh -x TEST="that the parser reads directions and arguments" DATA=emitter7 diff -Nru filtergen-0.12.4/t/t_41_target filtergen-0.12.7/t/t_41_target --- filtergen-0.12.4/t/t_41_target 2004-05-15 03:26:29.000000000 +0000 +++ filtergen-0.12.7/t/t_41_target 2016-02-13 09:44:55.000000000 +0000 @@ -1,4 +1,4 @@ -#!/bin/sh +#!/bin/sh -x TEST="that the parser reads targets and arguments" DATA=emitter8 diff -Nru filtergen-0.12.4/t/t_42_host filtergen-0.12.7/t/t_42_host --- filtergen-0.12.4/t/t_42_host 2004-05-15 03:26:29.000000000 +0000 +++ filtergen-0.12.7/t/t_42_host 2016-02-13 09:44:55.000000000 +0000 @@ -1,4 +1,4 @@ -#!/bin/sh +#!/bin/sh -x TEST="that the parser reads ghosts and arguments" DATA=emitter9 diff -Nru filtergen-0.12.4/t/t_43_port filtergen-0.12.7/t/t_43_port --- filtergen-0.12.4/t/t_43_port 2004-05-15 03:26:29.000000000 +0000 +++ filtergen-0.12.7/t/t_43_port 2016-02-13 09:44:55.000000000 +0000 @@ -1,4 +1,4 @@ -#!/bin/sh +#!/bin/sh -x TEST="that the parser reads ports and port arguments" DATA=emitter10 diff -Nru filtergen-0.12.4/t/t_44_protocol filtergen-0.12.7/t/t_44_protocol --- filtergen-0.12.4/t/t_44_protocol 2004-05-15 03:26:29.000000000 +0000 +++ filtergen-0.12.7/t/t_44_protocol 2016-02-13 09:44:55.000000000 +0000 @@ -1,4 +1,4 @@ -#!/bin/sh +#!/bin/sh -x TEST="that the parser reads protocol specifier and protocol arguments" DATA=emitter11 diff -Nru filtergen-0.12.4/t/t_45_icmptype filtergen-0.12.7/t/t_45_icmptype --- filtergen-0.12.4/t/t_45_icmptype 2004-05-15 03:26:30.000000000 +0000 +++ filtergen-0.12.7/t/t_45_icmptype 2016-02-13 09:44:55.000000000 +0000 @@ -1,4 +1,4 @@ -#!/bin/sh +#!/bin/sh -x TEST="that the parser reads icmptypes and arguments" DATA=emitter12 diff -Nru filtergen-0.12.4/t/t_46_routing filtergen-0.12.7/t/t_46_routing --- filtergen-0.12.4/t/t_46_routing 2004-05-15 03:26:30.000000000 +0000 +++ filtergen-0.12.7/t/t_46_routing 2016-02-13 09:44:55.000000000 +0000 @@ -1,4 +1,4 @@ -#!/bin/sh +#!/bin/sh -x TEST="that the parser reads routing specifiers" DATA=emitter13 diff -Nru filtergen-0.12.4/t/t_47_subrule_list filtergen-0.12.7/t/t_47_subrule_list --- filtergen-0.12.4/t/t_47_subrule_list 2004-05-15 03:26:30.000000000 +0000 +++ filtergen-0.12.7/t/t_47_subrule_list 2016-02-13 09:44:55.000000000 +0000 @@ -1,4 +1,4 @@ -#!/bin/sh +#!/bin/sh -x TEST="that the parser reads subrule lists correctly" DATA=emitter14 diff -Nru filtergen-0.12.4/t/t_48_chaingroup filtergen-0.12.7/t/t_48_chaingroup --- filtergen-0.12.4/t/t_48_chaingroup 2004-05-15 03:26:30.000000000 +0000 +++ filtergen-0.12.7/t/t_48_chaingroup 2016-02-13 09:44:55.000000000 +0000 @@ -1,4 +1,4 @@ -#!/bin/sh +#!/bin/sh -x TEST="that the parser reads chain groups correctly" DATA=emitter15 diff -Nru filtergen-0.12.4/t/t_49_convertspeclist filtergen-0.12.7/t/t_49_convertspeclist --- filtergen-0.12.4/t/t_49_convertspeclist 2004-05-15 03:26:32.000000000 +0000 +++ filtergen-0.12.7/t/t_49_convertspeclist 2016-02-13 09:44:55.000000000 +0000 @@ -1,4 +1,4 @@ -#!/bin/sh +#!/bin/sh -x TEST="that the converter works" DATA=converter1 diff -Nru filtergen-0.12.4/t/t_50_convertrulelist filtergen-0.12.7/t/t_50_convertrulelist --- filtergen-0.12.4/t/t_50_convertrulelist 2004-05-15 03:26:32.000000000 +0000 +++ filtergen-0.12.7/t/t_50_convertrulelist 2016-02-13 09:44:55.000000000 +0000 @@ -1,4 +1,4 @@ -#!/bin/sh +#!/bin/sh -x TEST="that the converter can convert rule lists to next chains" DATA=converter2 diff -Nru filtergen-0.12.4/t/t_51_convertdirection filtergen-0.12.7/t/t_51_convertdirection --- filtergen-0.12.4/t/t_51_convertdirection 2004-05-15 03:26:33.000000000 +0000 +++ filtergen-0.12.7/t/t_51_convertdirection 2016-02-13 09:44:55.000000000 +0000 @@ -1,4 +1,4 @@ -#!/bin/sh +#!/bin/sh -x TEST="that the converter can convert directions" DATA=converter3 diff -Nru filtergen-0.12.4/t/t_52_converthost filtergen-0.12.7/t/t_52_converthost --- filtergen-0.12.4/t/t_52_converthost 2004-05-15 03:26:33.000000000 +0000 +++ filtergen-0.12.7/t/t_52_converthost 2016-02-13 09:44:55.000000000 +0000 @@ -1,4 +1,4 @@ -#!/bin/sh +#!/bin/sh -x TEST="that the converter can convert hosts" DATA=converter4 diff -Nru filtergen-0.12.4/t/t_53_convertproto filtergen-0.12.7/t/t_53_convertproto --- filtergen-0.12.4/t/t_53_convertproto 2004-05-15 03:26:34.000000000 +0000 +++ filtergen-0.12.7/t/t_53_convertproto 2016-02-13 09:44:55.000000000 +0000 @@ -1,4 +1,4 @@ -#!/bin/sh +#!/bin/sh -x TEST="that the converter can convert protocols" DATA=converter5 diff -Nru filtergen-0.12.4/t/t_54_convertport filtergen-0.12.7/t/t_54_convertport --- filtergen-0.12.4/t/t_54_convertport 2004-05-15 03:26:35.000000000 +0000 +++ filtergen-0.12.7/t/t_54_convertport 2016-02-13 09:44:55.000000000 +0000 @@ -1,4 +1,4 @@ -#!/bin/sh +#!/bin/sh -x TEST="that the converter can convert ports" DATA=converter6 diff -Nru filtergen-0.12.4/t/t_55_converticmptype filtergen-0.12.7/t/t_55_converticmptype --- filtergen-0.12.4/t/t_55_converticmptype 2004-05-15 03:26:35.000000000 +0000 +++ filtergen-0.12.7/t/t_55_converticmptype 2016-02-13 09:44:55.000000000 +0000 @@ -1,4 +1,4 @@ -#!/bin/sh +#!/bin/sh -x TEST="that the converter can convert icmp types" DATA=converter7 diff -Nru filtergen-0.12.4/t/t_56_convertrouting filtergen-0.12.7/t/t_56_convertrouting --- filtergen-0.12.4/t/t_56_convertrouting 2004-05-15 03:26:35.000000000 +0000 +++ filtergen-0.12.7/t/t_56_convertrouting 2016-02-13 09:44:55.000000000 +0000 @@ -1,4 +1,4 @@ -#!/bin/sh +#!/bin/sh -x TEST="that the converter can convert routing types" DATA=converter8 diff -Nru filtergen-0.12.4/t/t_57_convertchains filtergen-0.12.7/t/t_57_convertchains --- filtergen-0.12.4/t/t_57_convertchains 2004-05-15 03:26:35.000000000 +0000 +++ filtergen-0.12.7/t/t_57_convertchains 2016-02-13 09:44:55.000000000 +0000 @@ -1,4 +1,4 @@ -#!/bin/sh +#!/bin/sh -x TEST="that the converter can convert chain groups" DATA=converter9 diff -Nru filtergen-0.12.4/t/t_58_convertcompound filtergen-0.12.7/t/t_58_convertcompound --- filtergen-0.12.4/t/t_58_convertcompound 2004-05-15 03:26:36.000000000 +0000 +++ filtergen-0.12.7/t/t_58_convertcompound 2016-02-13 09:44:55.000000000 +0000 @@ -1,4 +1,4 @@ -#!/bin/sh +#!/bin/sh -x TEST="that the converter can convert compound specifiers" DATA=converter10 diff -Nru filtergen-0.12.4/t/t_59_convertnested filtergen-0.12.7/t/t_59_convertnested --- filtergen-0.12.4/t/t_59_convertnested 2004-05-15 03:26:36.000000000 +0000 +++ filtergen-0.12.7/t/t_59_convertnested 2016-02-13 09:44:55.000000000 +0000 @@ -1,4 +1,4 @@ -#!/bin/sh +#!/bin/sh -x TEST="that the converter can convert nested specifiers" DATA=converter11 diff -Nru filtergen-0.12.4/t/t_60_bigugly filtergen-0.12.7/t/t_60_bigugly --- filtergen-0.12.4/t/t_60_bigugly 2004-05-15 03:26:36.000000000 +0000 +++ filtergen-0.12.7/t/t_60_bigugly 2016-02-13 09:44:55.000000000 +0000 @@ -1,4 +1,4 @@ -#!/bin/sh +#!/bin/sh -x TEST="that the converter can convert a mess of filters" DATA=converter12 diff -Nru filtergen-0.12.4/t/t_61_convertlog filtergen-0.12.7/t/t_61_convertlog --- filtergen-0.12.4/t/t_61_convertlog 2004-05-15 03:26:36.000000000 +0000 +++ filtergen-0.12.7/t/t_61_convertlog 2016-02-13 09:44:55.000000000 +0000 @@ -1,4 +1,4 @@ -#!/bin/sh +#!/bin/sh -x TEST="that the converter can convert log options" DATA=converter13 diff -Nru filtergen-0.12.4/t/t_62_convertoptions filtergen-0.12.7/t/t_62_convertoptions --- filtergen-0.12.4/t/t_62_convertoptions 2004-05-15 03:26:37.000000000 +0000 +++ filtergen-0.12.7/t/t_62_convertoptions 2016-02-13 09:44:55.000000000 +0000 @@ -1,4 +1,4 @@ -#!/bin/sh +#!/bin/sh -x TEST="that the converter can convert multiple options" DATA=converter14 diff -Nru filtergen-0.12.4/t/t_63_includedir filtergen-0.12.7/t/t_63_includedir --- filtergen-0.12.4/t/t_63_includedir 2004-08-18 03:50:26.000000000 +0000 +++ filtergen-0.12.7/t/t_63_includedir 2016-02-13 09:44:55.000000000 +0000 @@ -1,4 +1,4 @@ -#!/bin/sh +#!/bin/sh -x TEST="that directory inclusion works" diff -Nru filtergen-0.12.4/t/t_64_includedirwfile filtergen-0.12.7/t/t_64_includedirwfile --- filtergen-0.12.4/t/t_64_includedirwfile 2004-08-18 03:50:26.000000000 +0000 +++ filtergen-0.12.7/t/t_64_includedirwfile 2016-02-13 09:44:55.000000000 +0000 @@ -1,4 +1,4 @@ -#!/bin/sh +#!/bin/sh -x TEST="that directory inclusion works with files" diff -Nru filtergen-0.12.4/t/t_65_includedirwdir filtergen-0.12.7/t/t_65_includedirwdir --- filtergen-0.12.4/t/t_65_includedirwdir 2004-08-19 03:57:51.000000000 +0000 +++ filtergen-0.12.7/t/t_65_includedirwdir 2016-02-13 10:52:59.000000000 +0000 @@ -1,4 +1,4 @@ -#!/bin/sh +#!/bin/sh -x TEST="that directory inclusion works with files" @@ -31,14 +31,14 @@ test "x$srcdir" = "x" && cat $work/out -# can't compare this against a known good output because ordering -# on the disk, and the way opendir()/readdir() iterates over dirents -# isn't guaranteed -# so grep for each file and make sure they got included -grep -q 'include.d/foo' $work/out && \ - grep -q 'include.d/quux.d/bar' $work/out && \ - pass +cat >$work/good < $work/out 2>&1 if test $? -ne 0 ; then fail ; fi -# can't compare this against a known good output because ordering -# on the disk, and the way opendir()/readdir() iterates over dirents -# isn't guaranteed -# so grep for each file and make sure they got included -grep -q 'include.d/bar' $work/out && \ - grep -q 'include.d/foo' $work/out && \ - pass +cat >$work/good < $work/rules < $work/d/$i < $work/out +if test $? -ne 0 ; then fail ; fi + +cat > $work/good <. + +# As a special exception to the GNU General Public License, if you +# distribute this file as part of a program that contains a +# configuration script generated by Autoconf, you may include it under +# the same distribution terms that you use for the rest of that program. + +# This file is maintained in Automake, please report +# bugs to or send patches to +# . + +# Make unconditional expansion of undefined variables an error. This +# helps a lot in preventing typo-related bugs. +set -u + +usage_error () +{ + echo "$0: $*" >&2 + print_usage >&2 + exit 2 +} + +print_usage () +{ + cat <$log_file 2>&1 +estatus=$? + +if test $enable_hard_errors = no && test $estatus -eq 99; then + tweaked_estatus=1 +else + tweaked_estatus=$estatus +fi + +case $tweaked_estatus:$expect_failure in + 0:yes) col=$red res=XPASS recheck=yes gcopy=yes;; + 0:*) col=$grn res=PASS recheck=no gcopy=no;; + 77:*) col=$blu res=SKIP recheck=no gcopy=yes;; + 99:*) col=$mgn res=ERROR recheck=yes gcopy=yes;; + *:yes) col=$lgn res=XFAIL recheck=no gcopy=yes;; + *:*) col=$red res=FAIL recheck=yes gcopy=yes;; +esac + +# Report the test outcome and exit status in the logs, so that one can +# know whether the test passed or failed simply by looking at the '.log' +# file, without the need of also peaking into the corresponding '.trs' +# file (automake bug#11814). +echo "$res $test_name (exit status: $estatus)" >>$log_file + +# Report outcome to console. +echo "${col}${res}${std}: $test_name" + +# Register the test result, and other relevant metadata. +echo ":test-result: $res" > $trs_file +echo ":global-test-result: $res" >> $trs_file +echo ":recheck: $recheck" >> $trs_file +echo ":copy-in-global-log: $gcopy" >> $trs_file + +# Local Variables: +# mode: shell-script +# sh-indentation: 2 +# eval: (add-hook 'write-file-hooks 'time-stamp) +# time-stamp-start: "scriptversion=" +# time-stamp-format: "%:y-%02m-%02d.%02H" +# time-stamp-time-zone: "UTC" +# time-stamp-end: "; # UTC" +# End: diff -Nru filtergen-0.12.4/THANKS filtergen-0.12.7/THANKS --- filtergen-0.12.4/THANKS 2004-05-15 03:34:41.000000000 +0000 +++ filtergen-0.12.7/THANKS 2016-02-13 10:52:59.000000000 +0000 @@ -6,4 +6,6 @@ people, alphabetically by surname. Help me keep it complete and exempt of errors. -Glen Turner +Michael Chapman +Matt Palmer +Glen Turner diff -Nru filtergen-0.12.4/util.h filtergen-0.12.7/util.h --- filtergen-0.12.4/util.h 2004-05-15 03:26:39.000000000 +0000 +++ filtergen-0.12.7/util.h 2016-02-13 10:52:59.000000000 +0000 @@ -17,16 +17,16 @@ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -#ifndef _FILTER_UTIL_H -#define _FILTER_UTIL_H 1 +#ifndef _FILTER_UTIL_H +#define _FILTER_UTIL_H 1 -#define APP(l,s) (l = strapp(l,s)) -#define APP2(l,s1,s2) (l = strapp2(l,s1,s2)) -#define APPS(l,s) APP2(l, " ", s) -#define APPS2(l,s1,s2) (APPS(l,s1), APP(l,s2)) -#define APPSS2(l,s1,s2) (APPS(l,s1), APPS(l,s2)) +#define APP(l, s) (l = strapp(l, s)) +#define APP2(l, s1, s2) (l = strapp2(l, s1, s2)) +#define APPS(l, s) APP2(l, " ", s) +#define APPS2(l, s1, s2) (APPS(l, s1), APP(l, s2)) +#define APPSS2(l, s1, s2) (APPS(l, s1), APPS(l, s2)) -#define NEG(t) (ent->whats_negated & (1<whats_negated & (1 << F_##t)) +#define NEGA(l, t) (NEG(t) ? APPS(l, "!") : l) #endif /* _FILTER_UTIL_H */ diff -Nru filtergen-0.12.4/ylwrap filtergen-0.12.7/ylwrap --- filtergen-0.12.4/ylwrap 2004-06-23 00:28:10.000000000 +0000 +++ filtergen-0.12.7/ylwrap 2016-02-13 08:06:27.000000000 +0000 @@ -1,10 +1,9 @@ #! /bin/sh # ylwrap - wrapper for lex/yacc invocations. -scriptversion=2003-11-18.20 +scriptversion=2013-01-12.17; # UTC -# Copyright (C) 1996, 1997, 1998, 1999, 2001, 2002, 2003 -# Free Software Foundation, Inc. +# Copyright (C) 1996-2014 Free Software Foundation, Inc. # # Written by Tom Tromey . # @@ -19,8 +18,7 @@ # 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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +# along with this program. If not, see . # As a special exception to the GNU General Public License, if you # distribute this file as part of a program that contains a @@ -31,9 +29,41 @@ # bugs to or send patches to # . +get_dirname () +{ + case $1 in + */*|*\\*) printf '%s\n' "$1" | sed -e 's|\([\\/]\)[^\\/]*$|\1|';; + # Otherwise, we want the empty string (not "."). + esac +} + +# guard FILE +# ---------- +# The CPP macro used to guard inclusion of FILE. +guard () +{ + printf '%s\n' "$1" \ + | sed \ + -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/' \ + -e 's/[^ABCDEFGHIJKLMNOPQRSTUVWXYZ]/_/g' \ + -e 's/__*/_/g' +} + +# quote_for_sed [STRING] +# ---------------------- +# Return STRING (or stdin) quoted to be used as a sed pattern. +quote_for_sed () +{ + case $# in + 0) cat;; + 1) printf '%s\n' "$1";; + esac \ + | sed -e 's|[][\\.*]|\\&|g' +} + case "$1" in '') - echo "$0: No files given. Try \`$0 --help' for more information." 1>&2 + echo "$0: No files given. Try '$0 --help' for more information." 1>&2 exit 1 ;; --basedir) @@ -56,161 +86,155 @@ Report bugs to . EOF - exit 0 + exit $? ;; -v|--v*) echo "ylwrap $scriptversion" - exit 0 + exit $? ;; esac # The input. -input="$1" +input=$1 shift -case "$input" in +# We'll later need for a correct munging of "#line" directives. +input_sub_rx=`get_dirname "$input" | quote_for_sed` +case $input in [\\/]* | ?:[\\/]*) # Absolute path; do nothing. ;; *) # Relative path. Make it absolute. - input="`pwd`/$input" + input=`pwd`/$input ;; esac +input_rx=`get_dirname "$input" | quote_for_sed` + +# Since DOS filename conventions don't allow two dots, +# the DOS version of Bison writes out y_tab.c instead of y.tab.c +# and y_tab.h instead of y.tab.h. Test to see if this is the case. +y_tab_nodot=false +if test -f y_tab.c || test -f y_tab.h; then + y_tab_nodot=true +fi + +# The parser itself, the first file, is the destination of the .y.c +# rule in the Makefile. +parser=$1 + +# A sed program to s/FROM/TO/g for all the FROM/TO so that, for +# instance, we rename #include "y.tab.h" into #include "parse.h" +# during the conversion from y.tab.c to parse.c. +sed_fix_filenames= + +# Also rename header guards, as Bison 2.7 for instance uses its header +# guard in its implementation file. +sed_fix_header_guards= -pairlist= -while test "$#" -ne 0; do - if test "$1" = "--"; then +while test $# -ne 0; do + if test x"$1" = x"--"; then shift break fi - pairlist="$pairlist $1" + from=$1 + # Handle y_tab.c and y_tab.h output by DOS + if $y_tab_nodot; then + case $from in + "y.tab.c") from=y_tab.c;; + "y.tab.h") from=y_tab.h;; + esac + fi + shift + to=$1 shift + sed_fix_filenames="${sed_fix_filenames}s|"`quote_for_sed "$from"`"|$to|g;" + sed_fix_header_guards="${sed_fix_header_guards}s|"`guard "$from"`"|"`guard "$to"`"|g;" done # The program to run. -prog="$1" +prog=$1 shift # Make any relative path in $prog absolute. -case "$prog" in +case $prog in [\\/]* | ?:[\\/]*) ;; - *[\\/]*) prog="`pwd`/$prog" ;; + *[\\/]*) prog=`pwd`/$prog ;; esac -# FIXME: add hostname here for parallel makes that run commands on -# other machines. But that might take us over the 14-char limit. dirname=ylwrap$$ -trap "cd `pwd`; rm -rf $dirname > /dev/null 2>&1" 1 2 3 15 +do_exit="cd '`pwd`' && rm -rf $dirname > /dev/null 2>&1;"' (exit $ret); exit $ret' +trap "ret=129; $do_exit" 1 +trap "ret=130; $do_exit" 2 +trap "ret=141; $do_exit" 13 +trap "ret=143; $do_exit" 15 mkdir $dirname || exit 1 cd $dirname case $# in - 0) $prog "$input" ;; - *) $prog "$@" "$input" ;; + 0) "$prog" "$input" ;; + *) "$prog" "$@" "$input" ;; esac -status=$? - -if test $status -eq 0; then - set X $pairlist - shift - first=yes - # Since DOS filename conventions don't allow two dots, - # the DOS version of Bison writes out y_tab.c instead of y.tab.c - # and y_tab.h instead of y.tab.h. Test to see if this is the case. - y_tab_nodot="no" - if test -f y_tab.c || test -f y_tab.h; then - y_tab_nodot="yes" - fi +ret=$? - # The directory holding the input. - input_dir=`echo "$input" | sed -e 's,\([\\/]\)[^\\/]*$,\1,'` - # Quote $INPUT_DIR so we can use it in a regexp. - # FIXME: really we should care about more than `.' and `\'. - input_rx=`echo "$input_dir" | sed 's,\\\\,\\\\\\\\,g;s,\\.,\\\\.,g'` - - while test "$#" -ne 0; do - from="$1" - # Handle y_tab.c and y_tab.h output by DOS - if test $y_tab_nodot = "yes"; then - if test $from = "y.tab.c"; then - from="y_tab.c" - else - if test $from = "y.tab.h"; then - from="y_tab.h" - fi - fi - fi +if test $ret -eq 0; then + for from in * + do + to=`printf '%s\n' "$from" | sed "$sed_fix_filenames"` if test -f "$from"; then # If $2 is an absolute path name, then just use that, - # otherwise prepend `../'. - case "$2" in - [\\/]* | ?:[\\/]*) target="$2";; - *) target="../$2";; + # otherwise prepend '../'. + case $to in + [\\/]* | ?:[\\/]*) target=$to;; + *) target=../$to;; esac - # We do not want to overwrite a header file if it hasn't - # changed. This avoid useless recompilations. However the - # parser itself (the first file) should always be updated, - # because it is the destination of the .y.c rule in the - # Makefile. Divert the output of all other files to a temporary - # file so we can compare them to existing versions. - if test $first = no; then - realtarget="$target" - target="tmp-`echo $target | sed s/.*[\\/]//g`" + # Do not overwrite unchanged header files to avoid useless + # recompilations. Always update the parser itself: it is the + # destination of the .y.c rule in the Makefile. Divert the + # output of all other files to a temporary file so we can + # compare them to existing versions. + if test $from != $parser; then + realtarget=$target + target=tmp-`printf '%s\n' "$target" | sed 's|.*[\\/]||g'` fi - # Edit out `#line' or `#' directives. - # - # We don't want the resulting debug information to point at - # an absolute srcdir; it is better for it to just mention the - # .y file with no path. - # - # We want to use the real output file name, not yy.lex.c for - # instance. - # - # We want the include guards to be adjusted too. - FROM=`echo "$from" | sed \ - -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'\ - -e 's/[^ABCDEFGHIJKLMNOPQRSTUVWXYZ]/_/g'` - TARGET=`echo "$2" | sed \ - -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'\ - -e 's/[^ABCDEFGHIJKLMNOPQRSTUVWXYZ]/_/g'` - - sed -e "/^#/!b" -e "s,$input_rx,," -e "s,$from,$2," \ - -e "s,$FROM,$TARGET," "$from" >"$target" || status=$? - - # Check whether header files must be updated. - if test $first = no; then - if test -f "$realtarget" && cmp -s "$realtarget" "$target"; then - echo "$2" is unchanged - rm -f "$target" - else - echo updating "$2" + + # Munge "#line" or "#" directives. Don't let the resulting + # debug information point at an absolute srcdir. Use the real + # output file name, not yy.lex.c for instance. Adjust the + # include guards too. + sed -e "/^#/!b" \ + -e "s|$input_rx|$input_sub_rx|" \ + -e "$sed_fix_filenames" \ + -e "$sed_fix_header_guards" \ + "$from" >"$target" || ret=$? + + # Check whether files must be updated. + if test "$from" != "$parser"; then + if test -f "$realtarget" && cmp -s "$realtarget" "$target"; then + echo "$to is unchanged" + rm -f "$target" + else + echo "updating $to" mv -f "$target" "$realtarget" fi fi else - # A missing file is only an error for the first file. This - # is a blatant hack to let us support using "yacc -d". If -d - # is not specified, we don't want an error when the header - # file is "missing". - if test $first = yes; then - status=1 + # A missing file is only an error for the parser. This is a + # blatant hack to let us support using "yacc -d". If -d is not + # specified, don't fail when the header file is "missing". + if test "$from" = "$parser"; then + ret=1 fi fi - shift - shift - first=no done -else - status=$? fi # Remove the directory. cd .. rm -rf $dirname -exit $status +exit $ret # Local Variables: # mode: shell-script @@ -218,5 +242,6 @@ # eval: (add-hook 'write-file-hooks 'time-stamp) # time-stamp-start: "scriptversion=" # time-stamp-format: "%:y-%02m-%02d.%02H" -# time-stamp-end: "$" +# time-stamp-time-zone: "UTC" +# time-stamp-end: "; # UTC" # End: