Update byacc to 20130304

This commit is contained in:
Baptiste Daroussin 2013-05-30 16:16:28 +00:00
commit 5b91e83f53
37 changed files with 1974 additions and 1930 deletions

View File

@ -1,3 +1,117 @@
2013-03-04 Thomas E. Dickey <tom@invisible-island.net>
* package/debian/changelog, VERSION, package/byacc.spec: bump
* aclocal.m4:
adapt tweak from Dave Becket to work around long-ago breakage in "new" autoconf.
* output.c:
fix bogus #include if "-i" is given but not "-d" (report by Richard Mitton).
also while testing that, found a case where the union_file is unused; added
a check for address that.
* test/ftp.output, test/ftp.tab.c, test/ftp.tab.h: regen
* test/ftp.y: fix most compiler warnings for "make check_make"
* test/calc1.tab.c: regen
* test/calc1.y: fix most compiler warnings for "make check_make"
* test/calc.tab.c, test/calc1.tab.c, test/calc2.tab.c, test/calc3.tab.c, test/code_calc.code.c, test/code_error.code.c, test/error.tab.c, test/ftp.tab.c, test/grammar.tab.c, test/pure_calc.tab.c, test/pure_error.tab.c, test/quote_calc-s.tab.c, test/quote_calc.tab.c, test/quote_calc2-s.tab.c, test/quote_calc2.tab.c, test/quote_calc3-s.tab.c, test/quote_calc3.tab.c, test/quote_calc4-s.tab.c, test/quote_calc4.tab.c:
regen
* skeleton.c: quiet a gcc conversion-warning in yygrowstack()
* configure: regen
* aclocal.m4:
another fix for CF_GCC_VERSION to handle Debian's modification of gcc message.
2013-02-10 Thomas E. Dickey <tom@invisible-island.net>
* config.sub, config.guess: 2013-02-04
2012-10-03 Thomas E. Dickey <tom@invisible-island.net>
* package/debian/changelog, package/byacc.spec, VERSION: bump
* configure: regen
* configure.in: moved AC_PROG_CC_STDC call into CF_PROG_CC
* aclocal.m4:
moved AC_PROG_CC_STDC call into CF_PROG_CC and (for other uses than byacc)
the CF_PROG_CC macro provides the CF_ANSI_CC_REQD for the 2.13 flavor.
* aclocal.m4, configure.in:
Arian's change dropped my check for misused $CC variable - restore that with
alternate macro CF_PROG_CC.
2012-10-03 Adrian.Bunk
* aclocal.m4:
suggested patch: drop CF_ANSI_CC_REQD, CF_ANSI_CC_CHECK, CF_PROG_EXT since
they are not needed.
2012-10-03 Thomas E. Dickey <tom@invisible-island.net>
* aclocal.m4:
split-out CF_CC_ENV_FLAGS from CF_ANSI_CC_CHECK to avoid losing it in
Adrian's suggested changes.
* aclocal.m4:
CF_CLANG_COMPILER - check if the given compiler is really clang.
* aclocal.m4:
add check for clang to CF_GCC_WARNINGS. modify CF_GCC_WARNINGS to work around
old gcc warning: ncurses change to (try to) use gnatgcc exposed gnatgcc 2.8.1
on my Sarge system (versus 3.3.5 for the normal gcc). The 2.8.1's
pointer-arithmetic checks fell afoul of gcc's misuse of void* in string.h; work
around by excluding that check for pre-3.x compilers.
* aclocal.m4:
modify CF_GCC_ATTRIBUTES so that autoheader is able to see the definitions
provided by this macro. use AC_DEFINE_UNQUOTED() in CF_GCC_ATTRIBUTES rather
than appending to confdefs.h, since long-ago concern about the ability to
pass-through parameterized macros appears to be not a problem, testing with
2.13 and 2.52
2012-10-03 Adrian.Bunk
* aclocal.m4:
add parameter to AC_DEFINE_UNQUOTED() to allow it to be recognized by
autoheader, updated macros:
CF_CHECK_CACHE
CF_DISABLE_LEAKS
CF_MKSTEMP
CF_MIXEDCASE_FILENAMES
CF_NO_LEAKS_OPTION
2012-10-03 Thomas E. Dickey <tom@invisible-island.net>
* aclocal.m4:
move existence-check for mkstemp out of the AC_TRY_RUN, to help with
cross-compiles
2012-10-02 Thomas E. Dickey <tom@invisible-island.net>
* config_h.in:
Adrian Bunk request - replace this with the output from autoheader
2012-09-29 Adrian.Bunk
* configure.in:
suggested change: replace CF_ANSI_CC_REQD by AC_PROG_CC_STDC (since no
check is needed anymore for standard C compilers), drop AC_CONST (same
reason), modify AC_OUTPUT to rely upon template generated by autoheader.
bump requirement to autoconf 2.52.20011201 and drop check for CF_PROG_EXT
as being obsolete with autoconf 2.52x
* configure.in, main.c: drop check for atexit, because it is standard C
* makefile.in: add assignment for datarootdir variable.
2012-05-26 Thomas E. Dickey <tom@invisible-island.net>
* package/debian/changelog, package/byacc.spec, VERSION: bump

View File

@ -1 +1 @@
20120526
20130304

View File

@ -1,7 +1,7 @@
dnl $Id: aclocal.m4,v 1.19 2012/01/13 14:10:56 tom Exp $
dnl $Id: aclocal.m4,v 1.30 2013/03/05 01:13:39 tom Exp $
dnl Macros for byacc configure script (Thomas E. Dickey)
dnl ---------------------------------------------------------------------------
dnl Copyright 2004-2011,2012 Thomas E. Dickey
dnl Copyright 2004-2012,2013 Thomas E. Dickey
dnl
dnl Permission is hereby granted, free of charge, to any person obtaining a
dnl copy of this software and associated documentation files (the
@ -28,6 +28,32 @@ dnl sale, use or other dealings in this Software without prior written
dnl authorization.
dnl ---------------------------------------------------------------------------
dnl ---------------------------------------------------------------------------
dnl CF_ACVERSION_CHECK version: 4 updated: 2013/03/04 19:52:56
dnl ------------------
dnl Conditionally generate script according to whether we're using a given autoconf.
dnl
dnl $1 = version to compare against
dnl $2 = code to use if AC_ACVERSION is at least as high as $1.
dnl $3 = code to use if AC_ACVERSION is older than $1.
define([CF_ACVERSION_CHECK],
[
ifdef([AC_ACVERSION], ,[m4_copy([m4_PACKAGE_VERSION],[AC_ACVERSION])])dnl
ifdef([m4_version_compare],
[m4_if(m4_version_compare(m4_defn([AC_ACVERSION]), [$1]), -1, [$3], [$2])],
[CF_ACVERSION_COMPARE(
AC_PREREQ_CANON(AC_PREREQ_SPLIT([$1])),
AC_PREREQ_CANON(AC_PREREQ_SPLIT(AC_ACVERSION)), AC_ACVERSION, [$2], [$3])])])dnl
dnl ---------------------------------------------------------------------------
dnl CF_ACVERSION_COMPARE version: 3 updated: 2012/10/03 18:39:53
dnl --------------------
dnl CF_ACVERSION_COMPARE(MAJOR1, MINOR1, TERNARY1,
dnl MAJOR2, MINOR2, TERNARY2,
dnl PRINTABLE2, not FOUND, FOUND)
define([CF_ACVERSION_COMPARE],
[ifelse(builtin([eval], [$2 < $5]), 1,
[ifelse([$8], , ,[$8])],
[ifelse([$9], , ,[$9])])])dnl
dnl ---------------------------------------------------------------------------
dnl CF_ADD_CFLAGS version: 10 updated: 2010/05/26 05:38:42
dnl -------------
dnl Copy non-preprocessor flags to $CFLAGS, preprocessor flags to $CPPFLAGS
@ -114,97 +140,6 @@ fi
AC_SUBST(EXTRA_CPPFLAGS)
])dnl
dnl ---------------------------------------------------------------------------
dnl CF_ANSI_CC_CHECK version: 11 updated: 2011/07/01 19:47:45
dnl ----------------
dnl This was originally adapted from the macros 'fp_PROG_CC_STDC' and
dnl 'fp_C_PROTOTYPES' in the sharutils 4.2 distribution.
AC_DEFUN([CF_ANSI_CC_CHECK],
[
# This should have been defined by AC_PROG_CC
: ${CC:=cc}
# Check for user's environment-breakage by stuffing CFLAGS/CPPFLAGS content
# into CC. This will not help with broken scripts that wrap the compiler with
# options, but eliminates a more common category of user confusion.
AC_MSG_CHECKING(\$CC variable)
case "$CC" in #(vi
*[[\ \ ]]-[[IUD]]*)
AC_MSG_RESULT(broken)
AC_MSG_WARN(your environment misuses the CC variable to hold CFLAGS/CPPFLAGS options)
# humor him...
cf_flags=`echo "$CC" | sed -e 's/^[[^ ]]*[[ ]]//'`
CC=`echo "$CC" | sed -e 's/[[ ]].*//'`
CF_ADD_CFLAGS($cf_flags)
;;
*)
AC_MSG_RESULT(ok)
;;
esac
AC_CACHE_CHECK(for ${CC:-cc} option to accept ANSI C, cf_cv_ansi_cc,[
cf_cv_ansi_cc=no
cf_save_CFLAGS="$CFLAGS"
cf_save_CPPFLAGS="$CPPFLAGS"
# 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 -Aa -D_HPUX_SOURCE
# SVR4 -Xc
# UnixWare 1.2 (cannot use -Xc, since ANSI/POSIX clashes)
for cf_arg in "-DCC_HAS_PROTOS" \
"" \
-qlanglvl=ansi \
-std1 \
-Ae \
"-Aa -D_HPUX_SOURCE" \
-Xc
do
CF_ADD_CFLAGS($cf_arg)
AC_TRY_COMPILE(
[
#ifndef CC_HAS_PROTOS
#if !defined(__STDC__) || (__STDC__ != 1)
choke me
#endif
#endif
],[
int test (int i, double x);
struct s1 {int (*f) (int a);};
struct s2 {int (*f) (double a);};],
[cf_cv_ansi_cc="$cf_arg"; break])
done
CFLAGS="$cf_save_CFLAGS"
CPPFLAGS="$cf_save_CPPFLAGS"
])
if test "$cf_cv_ansi_cc" != "no"; then
if test ".$cf_cv_ansi_cc" != ".-DCC_HAS_PROTOS"; then
CF_ADD_CFLAGS($cf_cv_ansi_cc)
else
AC_DEFINE(CC_HAS_PROTOS)
fi
fi
])dnl
dnl ---------------------------------------------------------------------------
dnl CF_ANSI_CC_REQD version: 4 updated: 2008/03/23 14:48:54
dnl ---------------
dnl For programs that must use an ANSI compiler, obtain compiler options that
dnl will make it recognize prototypes. We'll do preprocessor checks in other
dnl macros, since tools such as unproto can fake prototypes, but only part of
dnl the preprocessor.
AC_DEFUN([CF_ANSI_CC_REQD],
[AC_REQUIRE([CF_ANSI_CC_CHECK])
if test "$cf_cv_ansi_cc" = "no"; then
AC_MSG_ERROR(
[Your compiler does not appear to recognize prototypes.
You have the following choices:
a. adjust your compiler options
b. get an up-to-date compiler
c. use a wrapper such as unproto])
fi
])dnl
dnl ---------------------------------------------------------------------------
dnl CF_ARG_DISABLE version: 3 updated: 1999/03/30 17:24:31
@ -236,7 +171,33 @@ ifelse([$3],,[ :]dnl
])dnl
])])dnl
dnl ---------------------------------------------------------------------------
dnl CF_CHECK_CACHE version: 11 updated: 2008/03/23 14:45:59
dnl CF_CC_ENV_FLAGS version: 1 updated: 2012/10/03 05:25:49
dnl ---------------
dnl Check for user's environment-breakage by stuffing CFLAGS/CPPFLAGS content
dnl into CC. This will not help with broken scripts that wrap the compiler with
dnl options, but eliminates a more common category of user confusion.
AC_DEFUN([CF_CC_ENV_FLAGS],
[
# This should have been defined by AC_PROG_CC
: ${CC:=cc}
AC_MSG_CHECKING(\$CC variable)
case "$CC" in #(vi
*[[\ \ ]]-[[IUD]]*)
AC_MSG_RESULT(broken)
AC_MSG_WARN(your environment misuses the CC variable to hold CFLAGS/CPPFLAGS options)
# humor him...
cf_flags=`echo "$CC" | sed -e 's/^[[^ ]]*[[ ]]//'`
CC=`echo "$CC" | sed -e 's/[[ ]].*//'`
CF_ADD_CFLAGS($cf_flags)
;;
*)
AC_MSG_RESULT(ok)
;;
esac
])dnl
dnl ---------------------------------------------------------------------------
dnl CF_CHECK_CACHE version: 12 updated: 2012/10/02 20:55:03
dnl --------------
dnl Check if we're accidentally using a cache from a different machine.
dnl Derive the system name, as a check for reusing the autoconf cache.
@ -259,7 +220,7 @@ else
system_name="`(hostname) 2>/dev/null`"
fi
fi
test -n "$system_name" && AC_DEFINE_UNQUOTED(SYSTEM_NAME,"$system_name")
test -n "$system_name" && AC_DEFINE_UNQUOTED(SYSTEM_NAME,"$system_name",[Define to the system name.])
AC_CACHE_VAL(cf_cv_system_name,[cf_cv_system_name="$system_name"])
test -z "$system_name" && system_name="$cf_cv_system_name"
@ -271,7 +232,40 @@ if test ".$system_name" != ".$cf_cv_system_name" ; then
fi
])dnl
dnl ---------------------------------------------------------------------------
dnl CF_DISABLE_ECHO version: 11 updated: 2009/12/13 13:16:57
dnl CF_CLANG_COMPILER version: 1 updated: 2012/06/16 14:55:39
dnl -----------------
dnl Check if the given compiler is really clang. clang's C driver defines
dnl __GNUC__ (fooling the configure script into setting $GCC to yes) but does
dnl not ignore some gcc options.
dnl
dnl This macro should be run "soon" after AC_PROG_CC or AC_PROG_CPLUSPLUS, to
dnl ensure that it is not mistaken for gcc/g++. It is normally invoked from
dnl the wrappers for gcc and g++ warnings.
dnl
dnl $1 = GCC (default) or GXX
dnl $2 = INTEL_COMPILER (default) or INTEL_CPLUSPLUS
dnl $3 = CFLAGS (default) or CXXFLAGS
AC_DEFUN([CF_CLANG_COMPILER],[
ifelse([$2],,CLANG_COMPILER,[$2])=no
if test "$ifelse([$1],,[$1],GCC)" = yes ; then
AC_MSG_CHECKING(if this is really Clang ifelse([$1],GXX,C++,C) compiler)
cf_save_CFLAGS="$ifelse([$3],,CFLAGS,[$3])"
ifelse([$3],,CFLAGS,[$3])="$ifelse([$3],,CFLAGS,[$3]) -Qunused-arguments"
AC_TRY_COMPILE([],[
#ifdef __clang__
#else
make an error
#endif
],[ifelse([$2],,CLANG_COMPILER,[$2])=yes
cf_save_CFLAGS="$cf_save_CFLAGS -Qunused-arguments"
],[])
ifelse([$3],,CFLAGS,[$3])="$cf_save_CFLAGS"
AC_MSG_RESULT($ifelse([$2],,CLANG_COMPILER,[$2]))
fi
])
dnl ---------------------------------------------------------------------------
dnl CF_DISABLE_ECHO version: 12 updated: 2012/10/06 16:30:28
dnl ---------------
dnl You can always use "make -n" to see the actual options, but it's hard to
dnl pick out/analyze warning messages when the compile-line is long.
@ -286,7 +280,7 @@ dnl
AC_DEFUN([CF_DISABLE_ECHO],[
AC_MSG_CHECKING(if you want to see long compiling messages)
CF_ARG_DISABLE(echo,
[ --disable-echo display "compiling" commands],
[ --disable-echo do not display "compiling" commands],
[
ECHO_LT='--silent'
ECHO_LD='@echo linking [$]@;'
@ -308,7 +302,7 @@ AC_SUBST(SHOW_CC)
AC_SUBST(ECHO_CC)
])dnl
dnl ---------------------------------------------------------------------------
dnl CF_DISABLE_LEAKS version: 6 updated: 2010/07/23 04:14:32
dnl CF_DISABLE_LEAKS version: 7 updated: 2012/10/02 20:55:03
dnl ----------------
dnl Combine no-leak checks with the libraries or tools that are used for the
dnl checks.
@ -326,12 +320,12 @@ AC_ARG_ENABLE(leaks,
AC_MSG_RESULT($with_no_leaks)
if test "$with_no_leaks" = yes ; then
AC_DEFINE(NO_LEAKS)
AC_DEFINE(YY_NO_LEAKS)
AC_DEFINE(NO_LEAKS,1,[Define to 1 if you want to perform memory-leak testing.])
AC_DEFINE(YY_NO_LEAKS,1,[Define to 1 if you want to perform memory-leak testing.])
fi
])dnl
dnl ---------------------------------------------------------------------------
dnl CF_GCC_ATTRIBUTES version: 14 updated: 2010/10/23 15:52:32
dnl CF_GCC_ATTRIBUTES version: 16 updated: 2012/10/02 20:55:03
dnl -----------------
dnl Test for availability of useful gcc __attribute__ directives to quiet
dnl compiler warnings. Though useful, not all are supported -- and contrary
@ -409,27 +403,27 @@ EOF
test -n "$verbose" && AC_MSG_RESULT(... $cf_attribute)
cat conftest.h >>confdefs.h
case $cf_attribute in #(vi
noreturn) #(vi
AC_DEFINE_UNQUOTED(GCC_NORETURN,$cf_directive,[Define to noreturn-attribute for gcc])
;;
printf) #(vi
if test "$cf_printf_attribute" = no ; then
cat >>confdefs.h <<EOF
#define GCC_PRINTFLIKE(fmt,var) /* nothing */
EOF
else
cat >>confdefs.h <<EOF
#define GCC_PRINTFLIKE(fmt,var) __attribute__((format(printf,fmt,var)))
EOF
cf_value='/* nothing */'
if test "$cf_printf_attribute" != no ; then
cf_value='__attribute__((format(printf,fmt,var)))'
AC_DEFINE(GCC_PRINTF,1,[Define to 1 if the compiler supports gcc-like printf attribute.])
fi
AC_DEFINE_UNQUOTED(GCC_PRINTFLIKE(fmt,var),$cf_value,[Define to printf-attribute for gcc])
;;
scanf) #(vi
if test "$cf_scanf_attribute" = no ; then
cat >>confdefs.h <<EOF
#define GCC_SCANFLIKE(fmt,var) /* nothing */
EOF
else
cat >>confdefs.h <<EOF
#define GCC_SCANFLIKE(fmt,var) __attribute__((format(scanf,fmt,var)))
EOF
cf_value='/* nothing */'
if test "$cf_scanf_attribute" != no ; then
cf_value='__attribute__((format(scanf,fmt,var)))'
AC_DEFINE(GCC_SCANF,1,[Define to 1 if the compiler supports gcc-like scanf attribute.])
fi
AC_DEFINE_UNQUOTED(GCC_SCANFLIKE(fmt,var),$cf_value,[Define to sscanf-attribute for gcc])
;;
unused) #(vi
AC_DEFINE_UNQUOTED(GCC_UNUSED,$cf_directive,[Define to unused-attribute for gcc])
;;
esac
fi
@ -441,7 +435,7 @@ rm -rf conftest*
fi
])dnl
dnl ---------------------------------------------------------------------------
dnl CF_GCC_VERSION version: 5 updated: 2010/04/24 11:02:31
dnl CF_GCC_VERSION version: 7 updated: 2012/10/18 06:46:33
dnl --------------
dnl Find version of gcc
AC_DEFUN([CF_GCC_VERSION],[
@ -449,13 +443,13 @@ AC_REQUIRE([AC_PROG_CC])
GCC_VERSION=none
if test "$GCC" = yes ; then
AC_MSG_CHECKING(version of $CC)
GCC_VERSION="`${CC} --version 2>/dev/null | sed -e '2,$d' -e 's/^.*(GCC) //' -e 's/^[[^0-9.]]*//' -e 's/[[^0-9.]].*//'`"
GCC_VERSION="`${CC} --version 2>/dev/null | sed -e '2,$d' -e 's/^.*(GCC[[^)]]*) //' -e 's/^.*(Debian[[^)]]*) //' -e 's/^[[^0-9.]]*//' -e 's/[[^0-9.]].*//'`"
test -z "$GCC_VERSION" && GCC_VERSION=unknown
AC_MSG_RESULT($GCC_VERSION)
fi
])dnl
dnl ---------------------------------------------------------------------------
dnl CF_GCC_WARNINGS version: 27 updated: 2010/10/23 15:52:32
dnl CF_GCC_WARNINGS version: 29 updated: 2012/06/16 14:55:39
dnl ---------------
dnl Check if the compiler supports useful warning options. There's a few that
dnl we don't use, simply because they're too noisy:
@ -478,6 +472,7 @@ AC_DEFUN([CF_GCC_WARNINGS],
[
AC_REQUIRE([CF_GCC_VERSION])
CF_INTEL_COMPILER(GCC,INTEL_COMPILER,CFLAGS)
CF_CLANG_COMPILER(GCC,CLANG_COMPILER,CFLAGS)
cat > conftest.$ac_ext <<EOF
#line __oline__ "${as_me:-configure}"
@ -553,6 +548,13 @@ then
continue;;
esac
;;
Wpointer-arith) #(vi
case $GCC_VERSION in
[[12]].*)
CF_VERBOSE(feature is broken in gcc $GCC_VERSION)
continue;;
esac
;;
esac
EXTRA_CFLAGS="$EXTRA_CFLAGS -$cf_opt"
fi
@ -594,7 +596,7 @@ make an error
test "$cf_cv_gnu_source" = yes && CPPFLAGS="$CPPFLAGS -D_GNU_SOURCE"
])dnl
dnl ---------------------------------------------------------------------------
dnl CF_INTEL_COMPILER version: 4 updated: 2010/05/26 05:38:42
dnl CF_INTEL_COMPILER version: 5 updated: 2013/02/10 10:41:05
dnl -----------------
dnl Check if the given compiler is really the Intel compiler for Linux. It
dnl tries to imitate gcc, but does not return an error when it finds a mismatch
@ -608,6 +610,7 @@ dnl $1 = GCC (default) or GXX
dnl $2 = INTEL_COMPILER (default) or INTEL_CPLUSPLUS
dnl $3 = CFLAGS (default) or CXXFLAGS
AC_DEFUN([CF_INTEL_COMPILER],[
AC_REQUIRE([AC_CANONICAL_HOST])
ifelse([$2],,INTEL_COMPILER,[$2])=no
if test "$ifelse([$1],,[$1],GCC)" = yes ; then
@ -668,7 +671,7 @@ AC_SUBST(MAKE_UPPER_TAGS)
AC_SUBST(MAKE_LOWER_TAGS)
])dnl
dnl ---------------------------------------------------------------------------
dnl CF_MIXEDCASE_FILENAMES version: 3 updated: 2003/09/20 17:07:55
dnl CF_MIXEDCASE_FILENAMES version: 4 updated: 2012/10/02 20:55:03
dnl ----------------------
dnl Check if the file-system supports mixed-case filenames. If we're able to
dnl create a lowercase name and see it as uppercase, it doesn't support that.
@ -695,10 +698,10 @@ else
rm -f conftest CONFTEST
fi
])
test "$cf_cv_mixedcase" = yes && AC_DEFINE(MIXEDCASE_FILENAMES)
test "$cf_cv_mixedcase" = yes && AC_DEFINE(MIXEDCASE_FILENAMES,1,[Define to 1 if filesystem supports mixed-case filenames.])
])dnl
dnl ---------------------------------------------------------------------------
dnl CF_MKSTEMP version: 7 updated: 2010/08/14 18:25:37
dnl CF_MKSTEMP version: 9 updated: 2012/10/03 04:34:49
dnl ----------
dnl Check for a working mkstemp. This creates two files, checks that they are
dnl successfully created and distinct (AmigaOS apparently fails on the last).
@ -740,11 +743,13 @@ int main()
}
],[cf_cv_func_mkstemp=yes
],[cf_cv_func_mkstemp=no
],[AC_CHECK_FUNC(mkstemp)
])
],[cf_cv_func_mkstemp=maybe])
])
if test "x$cf_cv_func_mkstemp" = xmaybe ; then
AC_CHECK_FUNC(mkstemp)
fi
if test "x$cf_cv_func_mkstemp" = xyes || test "x$ac_cv_func_mkstemp" = xyes ; then
AC_DEFINE(HAVE_MKSTEMP)
AC_DEFINE(HAVE_MKSTEMP,1,[Define to 1 if mkstemp() is available and working.])
fi
])dnl
dnl ---------------------------------------------------------------------------
@ -756,14 +761,14 @@ AC_DEFUN([CF_MSG_LOG],[
echo "${as_me:-configure}:__oline__: testing $* ..." 1>&AC_FD_CC
])dnl
dnl ---------------------------------------------------------------------------
dnl CF_NO_LEAKS_OPTION version: 4 updated: 2006/12/16 14:24:05
dnl CF_NO_LEAKS_OPTION version: 5 updated: 2012/10/02 20:55:03
dnl ------------------
dnl see CF_WITH_NO_LEAKS
AC_DEFUN([CF_NO_LEAKS_OPTION],[
AC_MSG_CHECKING(if you want to use $1 for testing)
AC_ARG_WITH($1,
[$2],
[AC_DEFINE($3)ifelse([$4],,[
[AC_DEFINE_UNQUOTED($3,1,"Define to 1 if you want to use $1 for testing.")ifelse([$4],,[
$4
])
: ${with_cflags:=-g}
@ -858,29 +863,17 @@ fi
])dnl
dnl ---------------------------------------------------------------------------
dnl CF_PROG_EXT version: 10 updated: 2004/01/03 19:28:18
dnl -----------
dnl Compute $PROG_EXT, used for non-Unix ports, such as OS/2 EMX.
AC_DEFUN([CF_PROG_EXT],
[
AC_REQUIRE([CF_CHECK_CACHE])
case $cf_cv_system_name in
os2*)
CFLAGS="$CFLAGS -Zmt"
CPPFLAGS="$CPPFLAGS -D__ST_MT_ERRNO__"
CXXFLAGS="$CXXFLAGS -Zmt"
# autoconf's macro sets -Zexe and suffix both, which conflict:w
LDFLAGS="$LDFLAGS -Zmt -Zcrtdll"
ac_cv_exeext=.exe
;;
esac
AC_EXEEXT
AC_OBJEXT
PROG_EXT="$EXEEXT"
AC_SUBST(PROG_EXT)
test -n "$PROG_EXT" && AC_DEFINE_UNQUOTED(PROG_EXT,"$PROG_EXT")
dnl CF_PROG_CC version: 3 updated: 2012/10/06 15:31:55
dnl ----------
dnl standard check for CC, plus followup sanity checks
dnl $1 = optional parameter to pass to AC_PROG_CC to specify compiler name
AC_DEFUN([CF_PROG_CC],[
ifelse($1,,[AC_PROG_CC],[AC_PROG_CC($1)])
CF_GCC_VERSION
CF_ACVERSION_CHECK(2.52,
[AC_PROG_CC_STDC],
[CF_ANSI_CC_REQD])
CF_CC_ENV_FLAGS
])dnl
dnl ---------------------------------------------------------------------------
dnl CF_PROG_LINT version: 2 updated: 2009/08/12 04:43:14
@ -1025,7 +1018,7 @@ fi
fi
])dnl
dnl ---------------------------------------------------------------------------
dnl CF_XOPEN_SOURCE version: 42 updated: 2012/01/07 08:26:49
dnl CF_XOPEN_SOURCE version: 43 updated: 2013/02/10 10:41:05
dnl ---------------
dnl Try to get _XOPEN_SOURCE defined properly that we can use POSIX functions,
dnl or adapt to the vendor's definitions to get equivalent functionality,
@ -1035,6 +1028,7 @@ dnl Parameters:
dnl $1 is the nominal value for _XOPEN_SOURCE
dnl $2 is the nominal value for _POSIX_C_SOURCE
AC_DEFUN([CF_XOPEN_SOURCE],[
AC_REQUIRE([AC_CANONICAL_HOST])
cf_XOPEN_SOURCE=ifelse([$1],,500,[$1])
cf_POSIX_C_SOURCE=ifelse([$2],,199506L,[$2])

View File

@ -1,14 +1,12 @@
#! /bin/sh
# Attempt to guess a canonical system name.
# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999,
# 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010,
# 2911 Free Software Foundation, Inc.
# Copyright 1992-2013 Free Software Foundation, Inc.
timestamp='2011-01-01'
timestamp='2013-02-04'
# 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 2 of the License, or
# 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
@ -17,26 +15,22 @@ timestamp='2011-01-01'
# 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., 51 Franklin Street - Fifth Floor, Boston, MA
# 02110-1301, USA.
# along with this program; if not, see <http://www.gnu.org/licenses/>.
#
# 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.
# Originally written by Per Bothner. Please send patches (context
# diff format) to <config-patches@gnu.org> and include a ChangeLog
# entry.
# 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").
#
# This script attempts to guess a canonical system name similar to
# config.sub. If it succeeds, it prints the system name on stdout, and
# exits with 0. Otherwise, it exits with 1.
# Originally written by Per Bothner.
#
# 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 with a ChangeLog entry to config-patches@gnu.org.
me=`echo "$0" | sed -e 's,.*/,,'`
@ -56,9 +50,7 @@ version="\
GNU config.guess ($timestamp)
Originally written by Per Bothner.
Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000,
2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011
Free Software Foundation, Inc.
Copyright 1992-2013 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."
@ -145,7 +137,7 @@ UNAME_VERSION=`(uname -v) 2>/dev/null` || UNAME_VERSION=unknown
case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in
*:NetBSD:*:*)
# NetBSD (nbsd) targets should (where applicable) match one or
# more of the tupples: *-*-netbsdelf*, *-*-netbsdaout*,
# 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
@ -202,6 +194,10 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in
# CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM is used.
echo "${machine}-${os}${release}"
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}
@ -220,10 +216,10 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in
exit ;;
alpha:OSF1:*:*)
case $UNAME_RELEASE in
*4.0)
*4.0)
UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $3}'`
;;
*5.*)
*5.*)
UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $4}'`
;;
esac
@ -304,7 +300,7 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in
arm:RISC*:1.[012]*:*|arm:riscix:1.[012]*:*)
echo arm-acorn-riscix${UNAME_RELEASE}
exit ;;
arm:riscos:*:*|arm:RISCOS:*:*)
arm*:riscos:*:*|arm*:RISCOS:*:*)
echo arm-unknown-riscos
exit ;;
SR2?01:HI-UX/MPP:*:* | SR8000:HI-UX/MPP:*:*)
@ -600,50 +596,50 @@ EOF
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" ;;
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
esac ;;
esac
fi
if [ "${HP_ARCH}" = "" ]; then
eval $set_cc_for_build
sed 's/^ //' << EOF >$dummy.c
sed 's/^ //' << EOF >$dummy.c
#define _HPUX_SOURCE
#include <stdlib.h>
#include <unistd.h>
#define _HPUX_SOURCE
#include <stdlib.h>
#include <unistd.h>
int main ()
{
#if defined(_SC_KERNEL_BITS)
long bits = sysconf(_SC_KERNEL_BITS);
#endif
long cpu = sysconf (_SC_CPU_VERSION);
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);
}
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
@ -792,21 +788,26 @@ EOF
echo ${UNAME_MACHINE}-unknown-bsdi${UNAME_RELEASE}
exit ;;
*:FreeBSD:*:*)
case ${UNAME_MACHINE} in
pc98)
echo i386-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;;
UNAME_PROCESSOR=`/usr/bin/uname -p`
case ${UNAME_PROCESSOR} in
amd64)
echo x86_64-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;;
*)
echo ${UNAME_MACHINE}-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 ;;
i*:MSYS*:*)
echo ${UNAME_MACHINE}-pc-msys
exit ;;
i*:windows32*:*)
# uname -m includes "-pc" on this system.
echo ${UNAME_MACHINE}-mingw32
@ -861,15 +862,22 @@ EOF
i*86:Minix:*:*)
echo ${UNAME_MACHINE}-pc-minix
exit ;;
aarch64:Linux:*:*)
echo ${UNAME_MACHINE}-unknown-linux-gnu
exit ;;
aarch64_be:Linux:*:*)
UNAME_MACHINE=aarch64_be
echo ${UNAME_MACHINE}-unknown-linux-gnu
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 ;;
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="libc1" ; else LIBC="" ; fi
@ -877,30 +885,39 @@ EOF
exit ;;
arm*:Linux:*:*)
eval $set_cc_for_build
if echo __ARM_EABI__ | $CC_FOR_BUILD -E - 2>/dev/null | \
grep -q __ARM_EABI__
if echo __ARM_EABI__ | $CC_FOR_BUILD -E - 2>/dev/null \
| grep -q __ARM_EABI__
then
echo ${UNAME_MACHINE}-unknown-linux-gnu
else
echo ${UNAME_MACHINE}-unknown-linux-gnueabi
if echo __ARM_PCS_VFP | $CC_FOR_BUILD -E - 2>/dev/null \
| grep -q __ARM_PCS_VFP
then
echo ${UNAME_MACHINE}-unknown-linux-gnueabi
else
echo ${UNAME_MACHINE}-unknown-linux-gnueabihf
fi
fi
exit ;;
avr32*:Linux:*:*)
echo ${UNAME_MACHINE}-unknown-linux-gnu
exit ;;
cris:Linux:*:*)
echo cris-axis-linux-gnu
echo ${UNAME_MACHINE}-axis-linux-gnu
exit ;;
crisv32:Linux:*:*)
echo crisv32-axis-linux-gnu
echo ${UNAME_MACHINE}-axis-linux-gnu
exit ;;
frv:Linux:*:*)
echo frv-unknown-linux-gnu
echo ${UNAME_MACHINE}-unknown-linux-gnu
exit ;;
hexagon:Linux:*:*)
echo ${UNAME_MACHINE}-unknown-linux-gnu
exit ;;
i*86:Linux:*:*)
LIBC=gnu
eval $set_cc_for_build
sed 's/^ //' << EOF >$dummy.c
sed 's/^ //' << EOF >$dummy.c
#ifdef __dietlibc__
LIBC=dietlibc
#endif
@ -937,7 +954,7 @@ EOF
test x"${CPU}" != x && { echo "${CPU}-unknown-linux-gnu"; exit; }
;;
or32:Linux:*:*)
echo or32-unknown-linux-gnu
echo ${UNAME_MACHINE}-unknown-linux-gnu
exit ;;
padre:Linux:*:*)
echo sparc-unknown-linux-gnu
@ -972,13 +989,13 @@ EOF
echo ${UNAME_MACHINE}-unknown-linux-gnu
exit ;;
tile*:Linux:*:*)
echo ${UNAME_MACHINE}-tilera-linux-gnu
echo ${UNAME_MACHINE}-unknown-linux-gnu
exit ;;
vax:Linux:*:*)
echo ${UNAME_MACHINE}-dec-linux-gnu
exit ;;
x86_64:Linux:*:*)
echo x86_64-unknown-linux-gnu
echo ${UNAME_MACHINE}-unknown-linux-gnu
exit ;;
xtensa*:Linux:*:*)
echo ${UNAME_MACHINE}-unknown-linux-gnu
@ -1096,7 +1113,7 @@ EOF
&& { 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; } ;;
&& { echo i486-ncr-sysv4; exit; } ;;
NCR*:*:4.2:* | MPRAS*:*:4.2:*)
OS_REL='.3'
test -r /etc/.relid \
@ -1139,8 +1156,8 @@ EOF
echo ns32k-sni-sysv
fi
exit ;;
PENTIUM:*:4.0*:*) # Unisys `ClearPath HMP IX 4000' SVR4/MP effort
# says <Richard.M.Bartel@ccMail.Census.GOV>
PENTIUM:*:4.0*:*) # Unisys `ClearPath HMP IX 4000' SVR4/MP effort
# says <Richard.M.Bartel@ccMail.Census.GOV>
echo i586-unisys-sysv4
exit ;;
*:UNIX_System_V:4*:FTX*)
@ -1168,9 +1185,9 @@ EOF
exit ;;
R[34]000:*System_V*:*:* | R4000:UNIX_SYSV:*:* | R*000:UNIX_SV:*:*)
if [ -d /usr/nec ]; then
echo mips-nec-sysv${UNAME_RELEASE}
echo mips-nec-sysv${UNAME_RELEASE}
else
echo mips-unknown-sysv${UNAME_RELEASE}
echo mips-unknown-sysv${UNAME_RELEASE}
fi
exit ;;
BeBox:BeOS:*:*) # BeOS running on hardware made by Be, PPC only.
@ -1185,6 +1202,9 @@ EOF
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 ;;
@ -1215,12 +1235,12 @@ EOF
i386)
eval $set_cc_for_build
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
UNAME_PROCESSOR="x86_64"
fi
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
UNAME_PROCESSOR="x86_64"
fi
fi ;;
unknown) UNAME_PROCESSOR=powerpc ;;
esac
@ -1229,8 +1249,8 @@ EOF
*:procnto*:*:* | *:QNX:[0123456789]*:*)
UNAME_PROCESSOR=`uname -p`
if test "$UNAME_PROCESSOR" = "x86"; then
UNAME_PROCESSOR=i386
UNAME_MACHINE=pc
UNAME_PROCESSOR=i386
UNAME_MACHINE=pc
fi
echo ${UNAME_PROCESSOR}-${UNAME_MACHINE}-nto-qnx${UNAME_RELEASE}
exit ;;
@ -1240,7 +1260,7 @@ EOF
NEO-?:NONSTOP_KERNEL:*:*)
echo neo-tandem-nsk${UNAME_RELEASE}
exit ;;
NSE-?:NONSTOP_KERNEL:*:*)
NSE-*:NONSTOP_KERNEL:*:*)
echo nse-tandem-nsk${UNAME_RELEASE}
exit ;;
NSR-?:NONSTOP_KERNEL:*:*)
@ -1309,11 +1329,11 @@ EOF
i*86:AROS:*:*)
echo ${UNAME_MACHINE}-pc-aros
exit ;;
x86_64:VMkernel:*:*)
echo ${UNAME_MACHINE}-unknown-esx
exit ;;
esac
#echo '(No uname command or uname output not recognized.)' 1>&2
#echo "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" 1>&2
eval $set_cc_for_build
cat >$dummy.c <<EOF
#ifdef _SEQUENT_
@ -1331,11 +1351,11 @@ main ()
#include <sys/param.h>
printf ("m68k-sony-newsos%s\n",
#ifdef NEWSOS4
"4"
"4"
#else
""
""
#endif
); exit (0);
); exit (0);
#endif
#endif

View File

@ -1,38 +1,31 @@
#! /bin/sh
# Configuration validation subroutine script.
# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999,
# 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010
# 2011 Free Software Foundation, Inc.
# Copyright 1992-2013 Free Software Foundation, Inc.
timestamp='2011-04-01'
timestamp='2013-02-04'
# This file is (in principle) common to ALL GNU software.
# The presence of a machine in this file suggests that SOME GNU software
# can handle that machine. It does not imply ALL GNU software can.
#
# 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 2 of the License, or
# 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.
# 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., 51 Franklin Street - Fifth Floor, Boston, MA
# 02110-1301, USA.
# along with this program; if not, see <http://www.gnu.org/licenses/>.
#
# 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.
# 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 <config-patches@gnu.org>. Submit a context
# diff and a properly formatted GNU ChangeLog entry.
# Please send patches with a ChangeLog entry to config-patches@gnu.org.
#
# Configuration subroutine to validate and canonicalize a configuration type.
# Supply the specified configuration type as an argument.
@ -75,9 +68,7 @@ Report bugs and patches to <config-patches@gnu.org>."
version="\
GNU config.sub ($timestamp)
Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000,
2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011
Free Software Foundation, Inc.
Copyright 1992-2013 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."
@ -125,13 +116,17 @@ esac
maybe_os=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\2/'`
case $maybe_os in
nto-qnx* | linux-gnu* | linux-android* | linux-dietlibc | linux-newlib* | \
linux-uclibc* | uclinux-uclibc* | uclinux-gnu* | kfreebsd*-gnu* | \
linux-musl* | linux-uclibc* | uclinux-uclibc* | uclinux-gnu* | kfreebsd*-gnu* | \
knetbsd*-gnu* | netbsd*-gnu* | \
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 ]
@ -154,7 +149,7 @@ case $os in
-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)
-apple | -axis | -knuth | -cray | -microblaze*)
os=
basic_machine=$1
;;
@ -223,6 +218,12 @@ case $os in
-isc*)
basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
;;
-lynx*178)
os=-lynxos178
;;
-lynx*5)
os=-lynxos5
;;
-lynx*)
os=-lynxos
;;
@ -247,20 +248,27 @@ case $basic_machine in
# 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 | arm | arm[bl]e | arme[lb] | armv[2345] | armv[345][lb] | avr | avr32 \
| arc \
| arm | arm[bl]e | arme[lb] | armv[2-8] | armv[3-8][lb] | armv7[arm] \
| avr | avr32 \
| be32 | be64 \
| bfin \
| c4x | clipper \
| d10v | d30v | dlx | dsp16xx \
| epiphany \
| fido | fr30 | frv \
| h8300 | h8500 | hppa | hppa1.[01] | hppa2.0 | hppa2.0[nw] | hppa64 \
| hexagon \
| i370 | i860 | i960 | ia64 \
| ip2k | iq2000 \
| le32 | le64 \
| lm32 \
| m32c | m32r | m32rle | m68000 | m68k | m88k \
| maxq | mb | microblaze | mcore | mep | metag \
| maxq | mb | microblaze | microblazeel | mcore | mep | metag \
| mips | mipsbe | mipseb | mipsel | mipsle \
| mips16 \
| mips64 | mips64el \
@ -278,20 +286,21 @@ case $basic_machine in
| mipsisa64r2 | mipsisa64r2el \
| mipsisa64sb1 | mipsisa64sb1el \
| mipsisa64sr71k | mipsisa64sr71kel \
| mipsr5900 | mipsr5900el \
| mipstx39 | mipstx39el \
| mn10200 | mn10300 \
| moxie \
| mt \
| msp430 \
| nds32 | nds32le | nds32be \
| nios | nios2 \
| nios | nios2 | nios2eb | nios2el \
| ns16k | ns32k \
| open8 \
| or32 \
| pdp10 | pdp11 | pj | pjl \
| powerpc | powerpc64 | powerpc64le | powerpcle \
| pyramid \
| rx \
| rl78 | rx \
| score \
| sh | sh[1234] | sh[24]a | sh[24]aeb | sh[23]e | sh[34]eb | sheb | shbe | shle | sh[1234]le | sh3ele \
| sh64 | sh64le \
@ -300,7 +309,7 @@ case $basic_machine in
| spu \
| tahoe | tic4x | tic54x | tic55x | tic6x | tic80 | tron \
| ubicom32 \
| v850 | v850e \
| v850 | v850e | v850e1 | v850e2 | v850es | v850e2v3 \
| we32k \
| x86 | xc16x | xstormy16 | xtensa \
| z8k | z80)
@ -315,8 +324,7 @@ case $basic_machine in
c6x)
basic_machine=tic6x-unknown
;;
m6811 | m68hc11 | m6812 | m68hc12 | picochip)
# Motorola 68HC11/12.
m6811 | m68hc11 | m6812 | m68hc12 | m68hcs12x | picochip)
basic_machine=$basic_machine-unknown
os=-none
;;
@ -325,21 +333,28 @@ case $basic_machine in
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
;;
basic_machine=$basic_machine-pc
;;
# Object if more than one company name word.
*-*-*)
echo Invalid configuration \`$1\': machine \`$basic_machine\' not recognized 1>&2
@ -348,11 +363,13 @@ case $basic_machine in
# 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-* \
| arm-* | armbe-* | armle-* | armeb-* | armv*-* \
| avr-* | avr32-* \
| be32-* | be64-* \
| bfin-* | bs2000-* \
| c[123]* | c30-* | [cjt]90-* | c4x-* \
| clipper-* | craynv-* | cydra-* \
@ -361,12 +378,15 @@ case $basic_machine in
| 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-* \
| le32-* | le64-* \
| lm32-* \
| m32c-* | m32r-* | m32rle-* \
| m68000-* | m680[012346]0-* | m68360-* | m683?2-* | m68k-* \
| m88110-* | m88k-* | maxq-* | mcore-* | metag-* | microblaze-* \
| m88110-* | m88k-* | maxq-* | mcore-* | metag-* \
| microblaze-* | microblazeel-* \
| mips-* | mipsbe-* | mipseb-* | mipsel-* | mipsle-* \
| mips16-* \
| mips64-* | mips64el-* \
@ -384,19 +404,20 @@ case $basic_machine in
| mipsisa64r2-* | mipsisa64r2el-* \
| mipsisa64sb1-* | mipsisa64sb1el-* \
| mipsisa64sr71k-* | mipsisa64sr71kel-* \
| mipsr5900-* | mipsr5900el-* \
| mipstx39-* | mipstx39el-* \
| mmix-* \
| mt-* \
| msp430-* \
| nds32-* | nds32le-* | nds32be-* \
| nios-* | nios2-* \
| nios-* | nios2-* | nios2eb-* | nios2el-* \
| none-* | np1-* | ns16k-* | ns32k-* \
| open8-* \
| orion-* \
| pdp10-* | pdp11-* | pj-* | pjl-* | pn-* | power-* \
| powerpc-* | powerpc64-* | powerpc64le-* | powerpcle-* \
| pyramid-* \
| romp-* | rs6000-* | rx-* \
| 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-* \
@ -404,10 +425,11 @@ case $basic_machine in
| sparcv8-* | sparcv9-* | sparcv9b-* | sparcv9v-* | sv1-* | sx?-* \
| tahoe-* \
| tic30-* | tic4x-* | tic54x-* | tic55x-* | tic6x-* | tic80-* \
| tile-* | tilegx-* \
| tile*-* \
| tron-* \
| ubicom32-* \
| v850-* | v850e-* | vax-* \
| v850-* | v850e-* | v850e1-* | v850es-* | v850e2-* | v850e2v3-* \
| vax-* \
| we32k-* \
| x86-* | x86_64-* | xc16x-* | xps100-* \
| xstormy16-* | xtensa*-* \
@ -707,7 +729,6 @@ case $basic_machine in
i370-ibm* | ibm*)
basic_machine=i370-ibm
;;
# I'm not sure what "Sysv32" means. Should this be sysv3.2?
i*86v32)
basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'`
os=-sysv32
@ -765,9 +786,13 @@ case $basic_machine in
basic_machine=ns32k-utek
os=-sysv
;;
microblaze)
microblaze*)
basic_machine=microblaze-xilinx
;;
mingw64)
basic_machine=x86_64-pc
os=-mingw64
;;
mingw32)
basic_machine=i386-pc
os=-mingw32
@ -804,10 +829,18 @@ case $basic_machine in
ms1-*)
basic_machine=`echo $basic_machine | sed -e 's/ms1-/mt-/'`
;;
msys)
basic_machine=i386-pc
os=-msys
;;
mvs)
basic_machine=i370-ibm
os=-mvs
;;
nacl)
basic_machine=le32-unknown
os=-nacl
;;
ncr3000)
basic_machine=i486-ncr
os=-sysv4
@ -836,10 +869,10 @@ case $basic_machine in
basic_machine=v70-nec
os=-sysv
;;
next | m*-next)
next | m*-next )
basic_machine=m68k-next
case $os in
-nextstep*)
-nextstep* )
;;
-ns2*)
os=-nextstep2
@ -958,11 +991,9 @@ case $basic_machine in
pn)
basic_machine=pn-gould
;;
power)
basic_machine=power-ibm
power) basic_machine=power-ibm
;;
ppc | ppcbe)
basic_machine=powerpc-unknown
ppc | ppcbe) basic_machine=powerpc-unknown
;;
ppc-* | ppcbe-*)
basic_machine=powerpc-`echo $basic_machine | sed 's/^[^-]*-//'`
@ -973,11 +1004,9 @@ case $basic_machine in
ppcle-* | powerpclittle-*)
basic_machine=powerpcle-`echo $basic_machine | sed 's/^[^-]*-//'`
;;
ppc64)
basic_machine=powerpc64-unknown
ppc64) basic_machine=powerpc64-unknown
;;
ppc64-*)
basic_machine=powerpc64-`echo $basic_machine | sed 's/^[^-]*-//'`
ppc64-*) basic_machine=powerpc64-`echo $basic_machine | sed 's/^[^-]*-//'`
;;
ppc64le | powerpc64little | ppc64-le | powerpc64-little)
basic_machine=powerpc64le-unknown
@ -992,7 +1021,11 @@ case $basic_machine in
basic_machine=i586-unknown
os=-pw32
;;
rdos)
rdos | rdos64)
basic_machine=x86_64-pc
os=-rdos
;;
rdos32)
basic_machine=i386-pc
os=-rdos
;;
@ -1120,13 +1153,8 @@ case $basic_machine in
basic_machine=t90-cray
os=-unicos
;;
# This must be matched before tile*.
tilegx*)
basic_machine=tilegx-unknown
os=-linux-gnu
;;
tile*)
basic_machine=tile-unknown
basic_machine=$basic_machine-unknown
os=-linux-gnu
;;
tx39)
@ -1324,21 +1352,21 @@ case $os in
-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* \
| -sym* | -kopensolaris* | -plan9* \
| -amigaos* | -amigados* | -msdos* | -newsos* | -unicos* | -aof* \
| -aos* | -aros* \
| -nindy* | -vxsim* | -vxworks* | -ebmon* | -hms* | -mvs* \
| -clix* | -riscos* | -uniplus* | -iris* | -rtu* | -xenix* \
| -hiux* | -386bsd* | -knetbsd* | -mirbsd* | -netbsd* \
| -openbsd* | -solidbsd* \
| -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* | -pe* | -psos* | -moss* | -proelf* | -rtems* \
| -mingw32* | -linux-gnu* | -linux-android* \
| -linux-newlib* | -linux-uclibc* \
| -cygwin* | -msys* | -pe* | -psos* | -moss* | -proelf* | -rtems* \
| -mingw32* | -mingw64* | -linux-gnu* | -linux-android* \
| -linux-newlib* | -linux-musl* | -linux-uclibc* \
| -uxpv* | -beos* | -mpeix* | -udk* \
| -interix* | -uwin* | -mks* | -rhapsody* | -darwin* | -opened* \
| -openstep* | -oskit* | -conix* | -pw32* | -nonstopux* \
@ -1421,7 +1449,7 @@ case $os in
-nova*)
os=-rtmk-nova
;;
-ns2)
-ns2 )
os=-nextstep2
;;
-nsk*)
@ -1470,9 +1498,6 @@ case $os in
-aros*)
os=-aros
;;
-kaos*)
os=-kaos
;;
-zvmoe)
os=-zvmoe
;;
@ -1521,6 +1546,9 @@ case $basic_machine in
c4x-* | tic4x-*)
os=-coff
;;
hexagon-*)
os=-elf
;;
tic54x-*)
os=-coff
;;
@ -1548,9 +1576,6 @@ case $basic_machine in
;;
m68000-sun)
os=-sunos3
# This also exists in the configure program, but was not the
# default.
# os=-sunos4
;;
m68*-cisco)
os=-aout
@ -1618,7 +1643,7 @@ case $basic_machine in
m88k-omron*)
os=-luna
;;
*-next)
*-next )
os=-nextstep
;;
*-sequent)

View File

@ -1,3 +1,52 @@
/* @configure_input@ */
/* $Id: config_h.in,v 1.1 1995/01/01 19:34:59 tom Exp $ */
@DEFS@
/* config_h.in. Generated automatically from configure.in by autoheader. */
/* Define to noreturn-attribute for gcc */
#undef GCC_NORETURN
/* Define to 1 if the compiler supports gcc-like printf attribute. */
#undef GCC_PRINTF
/* Define to printf-attribute for gcc */
#undef GCC_PRINTFLIKE
/* Define to 1 if the compiler supports gcc-like scanf attribute. */
#undef GCC_SCANF
/* Define to sscanf-attribute for gcc */
#undef GCC_SCANFLIKE
/* Define to unused-attribute for gcc */
#undef GCC_UNUSED
/* Define if you have the <fcntl.h> header file. */
#undef HAVE_FCNTL_H
/* Define if you have the `dbmalloc' library (-ldbmalloc). */
#undef HAVE_LIBDBMALLOC
/* Define if you have the `dmalloc' library (-ldmalloc). */
#undef HAVE_LIBDMALLOC
/* Define to 1 if mkstemp() is available and working. */
#undef HAVE_MKSTEMP
/* Define to 1 if filesystem supports mixed-case filenames. */
#undef MIXEDCASE_FILENAMES
/* Define to 1 if you want to perform memory-leak testing. */
#undef NO_LEAKS
/* Define to the system name. */
#undef SYSTEM_NAME
/* "Define to 1 if you want to use dbmalloc for testing." */
#undef USE_DBMALLOC
/* "Define to 1 if you want to use dmalloc for testing." */
#undef USE_DMALLOC
/* "Define to 1 if you want to use valgrind for testing." */
#undef USE_VALGRIND
/* Define to 1 if you want to perform memory-leak testing. */
#undef YY_NO_LEAKS

2181
contrib/byacc/configure vendored

File diff suppressed because it is too large Load Diff

View File

@ -1,30 +1,26 @@
dnl Process this file with 'autoconf' to produce a 'configure' script
dnl $Id: configure.in,v 1.10 2010/12/26 19:10:21 tom Exp $
AC_PREREQ(2.13.20020210)
AC_REVISION($Revision: 1.10 $)
dnl $Id: configure.in,v 1.14 2012/10/03 23:41:36 tom Exp $
AC_PREREQ(2.52.20011201)
AC_REVISION($Revision: 1.14 $)
AC_INIT(main.c)
AC_CONFIG_HEADER(config.h:config_h.in)
CF_CHECK_CACHE([AC_CANONICAL_SYSTEM])
AC_ARG_PROGRAM
AC_PROG_CC
AC_CONST
CF_PROG_CC
AC_PROG_MAKE_SET
AC_PROG_INSTALL
CF_MAKE_TAGS
CF_PROG_LINT
CF_ANSI_CC_REQD
CF_XOPEN_SOURCE
AC_CHECK_HEADERS(fcntl.h)
AC_CHECK_FUNCS(atexit)
CF_MKSTEMP
CF_WITH_WARNINGS(Wwrite-strings)
CF_DISABLE_ECHO
CF_PROG_EXT
CF_DISABLE_LEAKS
### output makefile
AC_OUTPUT(makefile,,,cat)
AC_OUTPUT(makefile)

View File

@ -1,19 +1,15 @@
/* $Id: main.c,v 1.39 2012/05/26 00:50:20 tom Exp $ */
/* $Id: main.c,v 1.40 2012/09/29 13:11:00 Adrian.Bunk Exp $ */
#include <signal.h>
#include <unistd.h> /* for _exit() */
#include "defs.h"
#if defined(HAVE_ATEXIT)
# ifdef HAVE_MKSTEMP
# define USE_MKSTEMP 1
# elif defined(HAVE_FCNTL_H)
# define USE_MKSTEMP 1
# include <fcntl.h> /* for open(), O_EXCL, etc. */
# else
# define USE_MKSTEMP 0
# endif
#ifdef HAVE_MKSTEMP
# define USE_MKSTEMP 1
#elif defined(HAVE_FCNTL_H)
# define USE_MKSTEMP 1
# include <fcntl.h> /* for open(), O_EXCL, etc. */
#else
# define USE_MKSTEMP 0
#endif

View File

@ -1,4 +1,4 @@
# $Id: makefile.in,v 1.17 2012/01/15 19:11:21 tom Exp $
# $Id: makefile.in,v 1.18 2012/09/29 13:10:15 Adrian.Bunk Exp $
#
# UNIX template-makefile for Berkeley Yacc
@ -31,6 +31,7 @@ LINT = @LINT@
prefix = @prefix@
exec_prefix = @exec_prefix@
datarootdir = @datarootdir@
bindir = $(DESTDIR)@bindir@
mandir = $(DESTDIR)@mandir@/man1
manext = 1

View File

@ -1,4 +1,4 @@
/* $Id: output.c,v 1.44 2012/05/26 01:13:02 tom Exp $ */
/* $Id: output.c,v 1.45 2013/03/05 00:29:17 tom Exp $ */
#include "defs.h"
@ -861,9 +861,12 @@ output_defines(FILE * fp)
{
if (unionized)
{
rewind(union_file);
while ((c = getc(union_file)) != EOF)
putc(c, fp);
if (union_file != 0)
{
rewind(union_file);
while ((c = getc(union_file)) != EOF)
putc(c, fp);
}
fprintf(fp, "extern YYSTYPE %slval;\n", symbol_prefix);
}
}
@ -1446,9 +1449,12 @@ output(void)
if (iflag)
{
++outline;
fprintf(code_file, "#include \"%s\"\n", defines_file_name);
if (!dflag)
if (dflag)
{
++outline;
fprintf(code_file, "#include \"%s\"\n", defines_file_name);
}
else
output_defines(externs_file);
}
else

View File

@ -1,8 +1,8 @@
Summary: byacc - public domain Berkeley LALR Yacc parser generator
%define AppProgram byacc
%define AppVersion 20120526
%define AppVersion 20130304
%define UseProgram yacc
# $XTermId: byacc.spec,v 1.14 2012/05/26 16:13:45 tom Exp $
# $XTermId: byacc.spec,v 1.16 2013/03/05 01:17:35 tom Exp $
Name: %{AppProgram}
Version: %{AppVersion}
Release: 1

View File

@ -1,3 +1,15 @@
byacc (20130304) unstable; urgency=low
* changes prompted by Richard Mitton bug-report
-- Thomas E. Dickey <dickey@invisible-island.net> Mon, 04 Mar 2013 20:17:32 -0500
byacc (20121003) unstable; urgency=low
* changes from or prompted by Adrian Bunk.
-- Thomas E. Dickey <dickey@invisible-island.net> Sat, 29 Sep 2012 09:14:31 -0400
byacc (20120526) unstable; urgency=low
* minor code-cleanup.

View File

@ -1,4 +1,4 @@
/* $Id: skeleton.c,v 1.31 2011/09/07 09:37:59 tom Exp $ */
/* $Id: skeleton.c,v 1.32 2013/03/04 23:19:39 tom Exp $ */
#include "defs.h"
@ -152,7 +152,7 @@ const char *const body_1[] =
" else if ((newsize *= 2) > YYMAXDEPTH)",
" newsize = YYMAXDEPTH;",
"",
" i = data->s_mark - data->s_base;",
" i = (int) (data->s_mark - data->s_base);",
" newss = (short *)realloc(data->s_base, newsize * sizeof(*newss));",
" if (newss == 0)",
" return -1;",

View File

@ -367,7 +367,7 @@ static int yygrowstack(YYSTACKDATA *data)
else if ((newsize *= 2) > YYMAXDEPTH)
newsize = YYMAXDEPTH;
i = data->s_mark - data->s_base;
i = (int) (data->s_mark - data->s_base);
newss = (short *)realloc(data->s_base, newsize * sizeof(*newss));
if (newss == 0)
return -1;

View File

@ -393,7 +393,7 @@ yylex(void)
for (; (cp - buf) < BSZ; ++cp, c = getchar())
{
*cp = c;
*cp = (char) c;
if (isdigit(c))
continue;
if (c == '.')
@ -506,7 +506,7 @@ static int yygrowstack(YYSTACKDATA *data)
else if ((newsize *= 2) > YYMAXDEPTH)
newsize = YYMAXDEPTH;
i = data->s_mark - data->s_base;
i = (int) (data->s_mark - data->s_base);
newss = (short *)realloc(data->s_base, newsize * sizeof(*newss));
if (newss == 0)
return -1;

View File

@ -214,7 +214,7 @@ yylex(void)
for (; (cp - buf) < BSZ; ++cp, c = getchar())
{
*cp = c;
*cp = (char) c;
if (isdigit(c))
continue;
if (c == '.')

View File

@ -376,7 +376,7 @@ static int yygrowstack(YYSTACKDATA *data)
else if ((newsize *= 2) > YYMAXDEPTH)
newsize = YYMAXDEPTH;
i = data->s_mark - data->s_base;
i = (int) (data->s_mark - data->s_base);
newss = (short *)realloc(data->s_base, newsize * sizeof(*newss));
if (newss == 0)
return -1;

View File

@ -374,7 +374,7 @@ static int yygrowstack(YYSTACKDATA *data)
else if ((newsize *= 2) > YYMAXDEPTH)
newsize = YYMAXDEPTH;
i = data->s_mark - data->s_base;
i = (int) (data->s_mark - data->s_base);
newss = (short *)realloc(data->s_base, newsize * sizeof(*newss));
if (newss == 0)
return -1;

View File

@ -274,7 +274,7 @@ static int yygrowstack(YYSTACKDATA *data)
else if ((newsize *= 2) > YYMAXDEPTH)
newsize = YYMAXDEPTH;
i = data->s_mark - data->s_base;
i = (int) (data->s_mark - data->s_base);
newss = (short *)realloc(data->s_base, newsize * sizeof(*newss));
if (newss == 0)
return -1;

View File

@ -246,7 +246,7 @@ static int yygrowstack(YYSTACKDATA *data)
else if ((newsize *= 2) > YYMAXDEPTH)
newsize = YYMAXDEPTH;
i = data->s_mark - data->s_base;
i = (int) (data->s_mark - data->s_base);
newss = (short *)realloc(data->s_base, newsize * sizeof(*newss));
if (newss == 0)
return -1;

View File

@ -256,7 +256,7 @@ static int yygrowstack(YYSTACKDATA *data)
else if ((newsize *= 2) > YYMAXDEPTH)
newsize = YYMAXDEPTH;
i = data->s_mark - data->s_base;
i = (int) (data->s_mark - data->s_base);
newss = (short *)realloc(data->s_base, newsize * sizeof(*newss));
if (newss == 0)
return -1;

View File

@ -759,8 +759,8 @@ state 79
type_code : L . SP byte_size (62)
type_code : L . byte_size (63)
SP shift 123
NUMBER shift 124
NUMBER shift 123
SP shift 124
CRLF reduce 61
byte_size goto 125
@ -1110,20 +1110,20 @@ state 122
state 123
type_code : L SP . byte_size (62)
NUMBER shift 124
. error
byte_size goto 159
state 124
byte_size : NUMBER . (51)
. reduce 51
state 124
type_code : L SP . byte_size (62)
NUMBER shift 123
. error
byte_size goto 159
state 125
type_code : L byte_size . (63)

File diff suppressed because it is too large Load Diff

View File

@ -1,20 +1,20 @@
#define A 257
#define B 258
#define C 259
#define E 260
#define F 261
#define I 262
#define L 263
#define N 264
#define P 265
#define R 266
#define S 267
#define T 268
#define SP 269
#define CRLF 270
#define COMMA 271
#define STRING 272
#define NUMBER 273
#define NUMBER 257
#define STRING 258
#define A 259
#define B 260
#define C 261
#define E 262
#define F 263
#define I 264
#define L 265
#define N 266
#define P 267
#define R 268
#define S 269
#define T 270
#define SP 271
#define CRLF 272
#define COMMA 273
#define USER 274
#define PASS 275
#define ACCT 276
@ -61,3 +61,16 @@
#define IDLE 317
#define CHMOD 318
#define LEXERR 319
#ifdef YYSTYPE
#undef YYSTYPE_IS_DECLARED
#define YYSTYPE_IS_DECLARED 1
#endif
#ifndef YYSTYPE_IS_DECLARED
#define YYSTYPE_IS_DECLARED 1
typedef union
{
int ival;
char *sval;
} YYSTYPE;
#endif /* !YYSTYPE_IS_DECLARED */
extern YYSTYPE ftp_lval;

View File

@ -123,6 +123,28 @@ yyerror(const char *msg)
}
%}
%union
{
int ival;
char *sval;
}
%token <ival> NUMBER
%token <sval> STRING
%type <ival>
byte_size
check_login
form_code
mode_code
octal_number
struct_code
%type <sval>
password
pathname
pathstring
username
%token
A B C E F I
L N P R S T
@ -155,13 +177,13 @@ cmd_list: /* empty */
cmd: USER SP username CRLF
{
user((char *) $3);
free((char *) $3);
user($3);
free($3);
}
| PASS SP password CRLF
{
pass((char *) $3);
free((char *) $3);
pass($3);
free($3);
}
| PORT SP host_port CRLF
{
@ -246,23 +268,23 @@ cmd: USER SP username CRLF
| RETR check_login SP pathname CRLF
{
if ($2 && $4 != 0)
retrieve((char *) 0, (char *) $4);
retrieve((char *) 0, $4);
if ($4 != 0)
free((char *) $4);
free($4);
}
| STOR check_login SP pathname CRLF
{
if ($2 && $4 != 0)
store((char *) $4, "w", 0);
store($4, "w", 0);
if ($4 != 0)
free((char *) $4);
free($4);
}
| APPE check_login SP pathname CRLF
{
if ($2 && $4 != 0)
store((char *) $4, "a", 0);
store($4, "a", 0);
if ($4 != 0)
free((char *) $4);
free($4);
}
| NLST check_login CRLF
{
@ -284,16 +306,16 @@ cmd: USER SP username CRLF
| LIST check_login SP pathname CRLF
{
if ($2 && $4 != 0)
retrieve("/bin/ls -lgA %s", (char *) $4);
retrieve("/bin/ls -lgA %s", $4);
if ($4 != 0)
free((char *) $4);
free($4);
}
| STAT check_login SP pathname CRLF
{
if ($2 && $4 != 0)
statfilecmd((char *) $4);
statfilecmd($4);
if ($4 != 0)
free((char *) $4);
free($4);
}
| STAT CRLF
{
@ -554,9 +576,13 @@ host_port: NUMBER COMMA NUMBER COMMA NUMBER COMMA NUMBER COMMA
register char *a, *p;
a = (char *)&data_dest.sin_addr;
a[0] = $1; a[1] = $3; a[2] = $5; a[3] = $7;
a[0] = (char) $1;
a[1] = (char) $3;
a[2] = (char) $5;
a[3] = (char) $7;
p = (char *)&data_dest.sin_port;
p[0] = $9; p[1] = $11;
p[0] = (char) $9;
p[1] = (char) $11;
data_dest.sin_family = AF_INET;
}
;
@ -842,7 +868,7 @@ get_line(char *s, int n, FILE *iop)
}
}
}
*cs++ = c;
*cs++ = (char) c;
if (--n <= 0 || c == '\n')
break;
}
@ -900,7 +926,7 @@ yylex(void)
*cp = '\0';
}
if ((cp = strpbrk(cbuf, " \n")))
cpos = cp - cbuf;
cpos = (int) (cp - cbuf);
if (cpos == 0)
cpos = 4;
c = cbuf[cpos];
@ -927,7 +953,7 @@ yylex(void)
}
cp = &cbuf[cpos];
if ((cp2 = strpbrk(cp, " \n")))
cpos = cp2 - cbuf;
cpos = (int) (cp2 - cbuf);
c = cbuf[cpos];
cbuf[cpos] = '\0';
upper(cp);
@ -976,7 +1002,7 @@ yylex(void)
case STR2:
cp = &cbuf[cpos];
n = strlen(cp);
n = (int) strlen(cp);
cpos += n - 1;
/*
* Make sure the string is nonempty and \n terminated.
@ -1001,7 +1027,7 @@ yylex(void)
;
c = cbuf[cpos];
cbuf[cpos] = '\0';
yylval = atoi(cp);
yylval.ival = atoi(cp);
cbuf[cpos] = c;
state = STR1;
return (NUMBER);
@ -1016,7 +1042,7 @@ yylex(void)
;
c = cbuf[cpos];
cbuf[cpos] = '\0';
yylval = atoi(cp);
yylval.ival = atoi(cp);
cbuf[cpos] = c;
return (NUMBER);
}
@ -1128,7 +1154,7 @@ help(struct tab *ctab, char *s)
help_type = "";
width = 0, NCMDS = 0;
for (c = ctab; c->name != 0; c++) {
int len = strlen(c->name);
int len = (int) strlen(c->name);
if (len > width)
width = len;
@ -1154,7 +1180,7 @@ help(struct tab *ctab, char *s)
c->implemented ? ' ' : '*');
if (c + lines >= &ctab[NCMDS])
break;
w = strlen(c->name) + 1;
w = (int) strlen(c->name) + 1;
while (w < width) {
putchar(' ');
w++;

View File

@ -1105,7 +1105,7 @@ static int yygrowstack(YYSTACKDATA *data)
else if ((newsize *= 2) > YYMAXDEPTH)
newsize = YYMAXDEPTH;
i = data->s_mark - data->s_base;
i = (int) (data->s_mark - data->s_base);
newss = (short *)realloc(data->s_base, newsize * sizeof(*newss));
if (newss == 0)
return -1;

View File

@ -374,7 +374,7 @@ static int yygrowstack(YYSTACKDATA *data)
else if ((newsize *= 2) > YYMAXDEPTH)
newsize = YYMAXDEPTH;
i = data->s_mark - data->s_base;
i = (int) (data->s_mark - data->s_base);
newss = (short *)realloc(data->s_base, newsize * sizeof(*newss));
if (newss == 0)
return -1;

View File

@ -265,7 +265,7 @@ static int yygrowstack(YYSTACKDATA *data)
else if ((newsize *= 2) > YYMAXDEPTH)
newsize = YYMAXDEPTH;
i = data->s_mark - data->s_base;
i = (int) (data->s_mark - data->s_base);
newss = (short *)realloc(data->s_base, newsize * sizeof(*newss));
if (newss == 0)
return -1;

View File

@ -381,7 +381,7 @@ static int yygrowstack(YYSTACKDATA *data)
else if ((newsize *= 2) > YYMAXDEPTH)
newsize = YYMAXDEPTH;
i = data->s_mark - data->s_base;
i = (int) (data->s_mark - data->s_base);
newss = (short *)realloc(data->s_base, newsize * sizeof(*newss));
if (newss == 0)
return -1;

View File

@ -387,7 +387,7 @@ static int yygrowstack(YYSTACKDATA *data)
else if ((newsize *= 2) > YYMAXDEPTH)
newsize = YYMAXDEPTH;
i = data->s_mark - data->s_base;
i = (int) (data->s_mark - data->s_base);
newss = (short *)realloc(data->s_base, newsize * sizeof(*newss));
if (newss == 0)
return -1;

View File

@ -381,7 +381,7 @@ static int yygrowstack(YYSTACKDATA *data)
else if ((newsize *= 2) > YYMAXDEPTH)
newsize = YYMAXDEPTH;
i = data->s_mark - data->s_base;
i = (int) (data->s_mark - data->s_base);
newss = (short *)realloc(data->s_base, newsize * sizeof(*newss));
if (newss == 0)
return -1;

View File

@ -387,7 +387,7 @@ static int yygrowstack(YYSTACKDATA *data)
else if ((newsize *= 2) > YYMAXDEPTH)
newsize = YYMAXDEPTH;
i = data->s_mark - data->s_base;
i = (int) (data->s_mark - data->s_base);
newss = (short *)realloc(data->s_base, newsize * sizeof(*newss));
if (newss == 0)
return -1;

View File

@ -382,7 +382,7 @@ static int yygrowstack(YYSTACKDATA *data)
else if ((newsize *= 2) > YYMAXDEPTH)
newsize = YYMAXDEPTH;
i = data->s_mark - data->s_base;
i = (int) (data->s_mark - data->s_base);
newss = (short *)realloc(data->s_base, newsize * sizeof(*newss));
if (newss == 0)
return -1;

View File

@ -382,7 +382,7 @@ static int yygrowstack(YYSTACKDATA *data)
else if ((newsize *= 2) > YYMAXDEPTH)
newsize = YYMAXDEPTH;
i = data->s_mark - data->s_base;
i = (int) (data->s_mark - data->s_base);
newss = (short *)realloc(data->s_base, newsize * sizeof(*newss));
if (newss == 0)
return -1;

View File

@ -382,7 +382,7 @@ static int yygrowstack(YYSTACKDATA *data)
else if ((newsize *= 2) > YYMAXDEPTH)
newsize = YYMAXDEPTH;
i = data->s_mark - data->s_base;
i = (int) (data->s_mark - data->s_base);
newss = (short *)realloc(data->s_base, newsize * sizeof(*newss));
if (newss == 0)
return -1;

View File

@ -382,7 +382,7 @@ static int yygrowstack(YYSTACKDATA *data)
else if ((newsize *= 2) > YYMAXDEPTH)
newsize = YYMAXDEPTH;
i = data->s_mark - data->s_base;
i = (int) (data->s_mark - data->s_base);
newss = (short *)realloc(data->s_base, newsize * sizeof(*newss));
if (newss == 0)
return -1;