According to Bruno Haible on 4/25/2007 1:56 AM: > Eric Blake wrote on 2007-04-17: >> we also need a module for >> ftell/ftello (until that is written, fflush fails to compile on mingw). > > With this, fflush at least compiles on mingw:
Thanks. The next problem is figuring out how to work around the fact that on mingw, fflush(stdin) returns 0 and moves the file offset to the end of the buffer, rather than failing with EBADF, unlike all the other platforms where fflush(stdin) is broken but at least leaves stdin alone. Meanwhile, I'm checking in this. 2007-04-25 Eric Blake <[EMAIL PROTECTED]> * lib/fpurge.c (includes): Use stdlib.h for free. * tests/test-fflush.c (main): Also test fflush-fseeko. -- Don't work too hard, make some time for fun as well! Eric Blake [EMAIL PROTECTED]
Index: Makefile.am =================================================================== RCS file: /sources/m4/m4/Makefile.am,v retrieving revision 1.29 diff -u -p -r1.29 Makefile.am --- Makefile.am 14 Jun 2006 13:19:46 -0000 1.29 +++ Makefile.am 16 Jun 2006 03:47:04 -0000 @@ -77,8 +77,10 @@ src_m4_SOURCES = \ src/version-etc.h \ src/main.c \ src/m4.h \ - src/freeze.c \ - src/stackovf.c + src/freeze.c +if STACKOVF +src_m4_SOURCES += src/stackovf.c +endif src_m4_CPPFLAGS = $(AM_CPPFLAGS) -Isrc -I$(srcdir)/src $(LTDLINCL) src_m4_LDFLAGS = $(AM_LDFLAGS) $(DLPREOPEN) src_m4_LDADD = m4/libm4.la Index: configure.ac =================================================================== RCS file: /sources/m4/m4/configure.ac,v retrieving revision 1.46 diff -u -p -r1.46 configure.ac --- configure.ac 13 Jun 2006 01:19:09 -0000 1.46 +++ configure.ac 16 Jun 2006 03:47:04 -0000 @@ -60,18 +60,17 @@ dnl the m4_ namespace provided by m4suga dnl package-specific prefix. FIXME - consistently use M4_ in the m4 macros dnl that feed the creation of configure. m4_pattern_forbid([^M4_]) -m4_pattern_allow([^m4_cv_]) +m4_pattern_allow([^M4_cv_]) +AC_DEFUN([M4_DEFAULT_PRELOAD], [m4 traditional gnu]) AC_MSG_CHECKING([for modules to preload]) - m4_pattern_allow([^m4_default_preload$]) - m4_default_preload="m4 traditional gnu" DLPREOPEN= AC_ARG_WITH([modules], [AS_HELP_STRING([--with-modules=MODULES], - [preload MODULES @<:@default: $m4_default_preload@:>@])], + [preload MODULES @<:@default: ]M4_DEFAULT_PRELOAD[@:>@])], [use_modules="$withval"], - [use_modules="$m4_default_preload"]) + [use_modules="$M4_DEFAULT_PRELOAD"]) PREOPEN_DEPENDENCIES= DLPREOPEN="-dlpreopen force" @@ -106,7 +105,7 @@ M4_EARLY AC_PROG_CPP AM_PROG_CC_C_O -m4_CHECK_DEBUGGING +M4_CHECK_DEBUGGING @@ -122,7 +121,7 @@ LT_WITH_LTDL([ltdl]) case "$CFLAGS" in *-pipe* ) ;; * ) _LT_COMPILER_OPTION([if $compiler supports -pipe], - [m4_cv_prog_compiler_pipe], + [M4_cv_prog_compiler_pipe], [-pipe -c conftest.$ac_ext], [], [CFLAGS="$CFLAGS -pipe"]) ;; @@ -135,7 +134,7 @@ esac ## ---------------- ## AM_GNU_GETTEXT([external], [need-ngettext]) AM_GNU_GETTEXT_VERSION([0.14.1]) -m4_GNU_GETTEXT +M4_GNU_GETTEXT @@ -145,10 +144,10 @@ m4_GNU_GETTEXT M4_INIT # Gnulib doesn't always do things quite the way M4 would like... -m4_ERROR -m4_GETOPT -m4_OBSTACK -m4_REGEX +M4_ERROR +M4_GETOPT +M4_OBSTACK +M4_REGEX ## ------------------------ ## @@ -188,7 +187,7 @@ AC_CHECK_FUNCS([calloc strerror tmpfile] AM_WITH_DMALLOC -m4_SYS_STACKOVF +M4_SYS_STACKOVF # This is for the modules AC_STRUCT_TM @@ -196,7 +195,7 @@ AC_FUNC_STRFTIME AC_CHECK_FUNCS([getcwd gethostname mktime uname \ setenv unsetenv putenv clearenv]) -m4_LIB_GMP +M4_LIB_GMP AM_CONDITIONAL([USE_GMP], [test "x$USE_GMP" = xyes]) Index: ltdl/m4/debug.m4 =================================================================== RCS file: /sources/m4/m4/ltdl/m4/debug.m4,v retrieving revision 1.2 diff -u -p -r1.2 debug.m4 --- ltdl/m4/debug.m4 7 Jul 2005 11:31:11 -0000 1.2 +++ ltdl/m4/debug.m4 16 Jun 2006 03:47:04 -0000 @@ -1,7 +1,7 @@ ## -*- Autoconf -*- ## debug.m4 -- massage compiler flags for debugging/optimisation ## -## Copyright (C) 1999-2000 Ralf S. Engelschall +## Copyright (C) 1999-2000, 2006 Ralf S. Engelschall ## Written by <[EMAIL PROTECTED]> ## Modified for M4 by Gary V. Vaughan <[EMAIL PROTECTED]> ## @@ -20,16 +20,16 @@ ## the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, ## Boston, MA 02110-1301, USA. -# serial 8 +# serial 9 -# m4_CHECK_DEBUGGING +# M4_CHECK_DEBUGGING # ------------------ # Debugging Support -AC_DEFUN([m4_CHECK_DEBUGGING], +AC_DEFUN([M4_CHECK_DEBUGGING], [AC_REQUIRE([AC_PROG_CC]) -AC_ARG_ENABLE([debug], [AC_HELP_STRING([--enable-debug], +AC_ARG_ENABLE([debug], [AS_HELP_STRING([--enable-debug], [build for debugging [default=no]])]) -AC_MSG_CHECKING(for compilation debug mode) +AC_MSG_CHECKING([for compilation debug mode]) AC_MSG_RESULT([${enable_debug-no}]) : ${rm=rm -f} @@ -41,7 +41,7 @@ test -n "$rm" || rm="rm -f" if test "X$enable_debug" = Xyes; then AC_DISABLE_SHARED - AC_DEFINE([DEBUG], 1, + AC_DEFINE([DEBUG], [1], [Define this to enable additional runtime debugging]) if test "$GCC" = yes; then case "$CFLAGS" in @@ -50,7 +50,7 @@ if test "X$enable_debug" = Xyes; then case "$CFLAGS" in *-g* ) ;; * ) AC_LIBTOOL_COMPILER_OPTION([if $compiler accepts -ggdb3], - [m4_cv_prog_compiler_ggdb3], + [M4_cv_prog_compiler_ggdb3], [-ggdb3 -c conftest.$ac_ext], [], [CFLAGS="$CFLAGS -ggdb3"], [CFLAGS="$CFLAGS -g"]) @@ -60,12 +60,12 @@ if test "X$enable_debug" = Xyes; then WMORE="-Wshadow -Wpointer-arith -Wcast-align -Wnested-externs" WMORE="$WMORE -Wmissing-prototypes -Wmissing-declarations -Winline" AC_LIBTOOL_COMPILER_OPTION([if $compiler accepts $WMORE], - [m4_cv_prog_compiler_warning_flags], + [M4_cv_prog_compiler_warning_flags], [$WMORE -c conftest.$ac_ext], [], [CFLAGS="$CFLAGS $WMORE"]) AC_LIBTOOL_COMPILER_OPTION([if $compiler accepts -Wno-long-long], - [m4_cv_prog_compiler_wnolonglong], + [M4_cv_prog_compiler_wnolonglong], [-Wno-long-long -c conftest.$ac_ext], [], [CFLAGS="$CFLAGS -Wno-long-long"]) else @@ -87,4 +87,4 @@ else ;; esac fi -])# m4_CHECK_DEBUGGING +])# M4_CHECK_DEBUGGING Index: ltdl/m4/gmp.m4 =================================================================== RCS file: /sources/m4/m4/ltdl/m4/gmp.m4,v retrieving revision 1.1 diff -u -p -r1.1 gmp.m4 --- ltdl/m4/gmp.m4 4 May 2005 15:45:44 -0000 1.1 +++ ltdl/m4/gmp.m4 16 Jun 2006 03:47:04 -0000 @@ -1,5 +1,5 @@ # -*- Autoconf -*- -# Copyright (C) 2000, 2001, 2003 Free Software Foundation, Inc. +# Copyright (C) 2000, 2001, 2003, 2006 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,59 +16,59 @@ # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA # 02110-1301 USA -# serial 7 +# serial 8 -m4_define([_m4_LIB_GMP], -[AC_ARG_WITH(gmp, -[ --without-gmp don't use GNU multiple precision arithmetic library], +m4_define([_M4_LIB_GMP], +[AC_ARG_WITH([gmp], + [AS_HELP_STRING([--without-gmp], + [don't use GNU multiple precision arithmetic library])], [use_gmp=$withval], [use_gmp=yes]) case $use_gmp:$LIBADD_GMP:$ac_cv_header_gmp_h in *::yes) AC_MSG_WARN([gmp library not found or does not appear to work but `gmp.h' is present]) - m4_cv_using_lib_gmp=no + M4_cv_using_lib_gmp=no ;; *:-lgmp:no) AC_MSG_WARN([gmp works but `gmp.h' is missing]) - m4_cv_using_lib_gmp=no + M4_cv_using_lib_gmp=no ;; yes:*:yes) - m4_cv_using_lib_gmp=yes + M4_cv_using_lib_gmp=yes ;; no:*) - m4_cv_using_lib_gmp=no + M4_cv_using_lib_gmp=no ;; esac -])# _m4_LIB_GMP +])# _M4_LIB_GMP -AC_DEFUN([m4_LIB_GMP], -[AC_PREREQ(2.56)dnl We use the new compiler based header checking in 2.56 +AC_DEFUN([M4_LIB_GMP], +[AC_PREREQ([2.56])dnl We use the new compiler based header checking in 2.56 AC_CHECK_HEADERS([gmp.h], [], [], [AC_INCLUDES_DEFAULT]) -m4_pattern_allow([^m4_gmp_save_LIBS$]) -m4_pattern_allow([^m4_cv_using_lib_gmp]) +m4_pattern_allow([^M4_gmp_save_LIBS$]) # Some versions of gmp provide mpq_init as a macro, so we need to # include the header file, otherwise the detection will fail. -m4_gmp_save_LIBS="$LIBS" +M4_gmp_save_LIBS="$LIBS" LIBS="$LIBS -lgmp" -AC_TRY_LINK([#if HAVE_GMP_H +AC_LINK_IFELSE([AC_LANG_PROGRAM([[#if HAVE_GMP_H # include <gmp.h> -#endif], - [mpq_t n; mpq_init (n);], +#endif]], + [[mpq_t n; mpq_init (n);]])], [LIBADD_GMP=-lgmp]) -LIBS=$m4_gmp_save_LIBS +LIBS=$M4_gmp_save_LIBS AC_SUBST([LIBADD_GMP]) AC_CACHE_CHECK([if using GNU multiple precision arithmetic library], - [m4_cv_using_lib_gmp], - [_m4_LIB_GMP]) + [M4_cv_using_lib_gmp], + [_M4_LIB_GMP]) # Don't try to link in libgmp if we are not using it after the last call -if test "$m4_cv_using_lib_gmp" = yes; then - AC_DEFINE(USE_GMP, 1, +if test "$M4_cv_using_lib_gmp" = yes; then + AC_DEFINE([USE_GMP], [1], [Define to 1 if using the GNU multiple precision library.]) fi -AC_SUBST([USE_GMP], [$m4_cv_using_lib_gmp]) -])# m4_LIB_GMP +AC_SUBST([USE_GMP], [$M4_cv_using_lib_gmp]) +])# M4_LIB_GMP Index: ltdl/m4/m4-error.m4 =================================================================== RCS file: /sources/m4/m4/ltdl/m4/m4-error.m4,v retrieving revision 1.1 diff -u -p -r1.1 m4-error.m4 --- ltdl/m4/m4-error.m4 4 May 2005 15:45:44 -0000 1.1 +++ ltdl/m4/m4-error.m4 16 Jun 2006 03:47:04 -0000 @@ -2,7 +2,7 @@ # m4-error.m4 -- Use the installed version of error.h if available. # Written by Gary V. Vaughan <[EMAIL PROTECTED]> # -# Copyright (C) 2003, 2004 Free Software Foundation, Inc +# Copyright (C) 2003, 2004, 2006 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 @@ -19,17 +19,17 @@ # the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, # Boston, MA 02110-1301, USA. -# serial 3 +# serial 4 -# m4_ERROR +# M4_ERROR # -------- # Use the installed version of error.h if available. -AC_DEFUN([m4_ERROR], -[AC_BEFORE([gl_ERROR], [m4_ERROR]) +AC_DEFUN([M4_ERROR], +[AC_BEFORE([gl_ERROR], [M4_ERROR]) AC_CHECK_HEADERS([error.h], [ERROR_H=""], [ERROR_H="error.h"], [AC_INCLUDES_DEFAULT]) -AC_SUBST(ERROR_H) +AC_SUBST([ERROR_H]) if test $ac_cv_header_error_h = yes; then INCLUDE_ERROR_H='#include <error.h>' @@ -37,4 +37,4 @@ else INCLUDE_ERROR_H='#include <gnu/error.h>' fi AC_SUBST([INCLUDE_ERROR_H]) -])# m4_ERROR +])# M4_ERROR Index: ltdl/m4/m4-getopt.m4 =================================================================== RCS file: /sources/m4/m4/ltdl/m4/m4-getopt.m4,v retrieving revision 1.2 diff -u -p -r1.2 m4-getopt.m4 --- ltdl/m4/m4-getopt.m4 6 May 2005 07:46:20 -0000 1.2 +++ ltdl/m4/m4-getopt.m4 16 Jun 2006 03:47:04 -0000 @@ -2,7 +2,7 @@ # m4-getopt.m4 -- Use the installed version of getopt.h if available. # Written by Gary V. Vaughan <[EMAIL PROTECTED]> # -# Copyright (C) 2005 Free Software Foundation, Inc +# Copyright (C) 2005, 2006 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 @@ -19,12 +19,12 @@ # the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, # Boston, MA 02110-1301, USA. -# serial 1 +# serial 2 -# m4_GETOPT +# M4_GETOPT # --------- # Use the installed version of getopt.h if available. -AC_DEFUN([m4_GETOPT], +AC_DEFUN([M4_GETOPT], [GETOPT_H= AC_SUBST([GETOPT_H]) @@ -50,4 +50,4 @@ if test -n "$GETOPT_H"; then AC_DEFINE([__GETOPT_PREFIX], [[rpl_]], [Define to rpl_ if the getopt replacement function should be used.]) fi -])# m4_GETOPT +])# M4_GETOPT Index: ltdl/m4/m4-gettext.m4 =================================================================== RCS file: /sources/m4/m4/ltdl/m4/m4-gettext.m4,v retrieving revision 1.1 diff -u -p -r1.1 m4-gettext.m4 --- ltdl/m4/m4-gettext.m4 4 May 2005 15:45:44 -0000 1.1 +++ ltdl/m4/m4-gettext.m4 16 Jun 2006 03:47:04 -0000 @@ -2,7 +2,7 @@ # m4-gettext.m4 -- Use the installed version of GNU gettext if available. # Written by Gary V. Vaughan <[EMAIL PROTECTED]> # -# Copyright (C) 2003, 2004 Free Software Foundation, Inc +# Copyright (C) 2003, 2004, 2006 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 @@ -19,16 +19,16 @@ # the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, # Boston, MA 02110-1301, USA. -# serial 2 +# serial 3 -# m4_GNU_GETTEXT +# M4_GNU_GETTEXT # -------------- # Use the installed version of GNU gettext if available. -AC_DEFUN([m4_GNU_GETTEXT], -[AC_BEFORE([AM_GNU_GETTEXT], [m4_GNU_GETTEXT]) +AC_DEFUN([M4_GNU_GETTEXT], +[AC_BEFORE([AM_GNU_GETTEXT], [M4_GNU_GETTEXT]) AC_CHECK_HEADERS([gettext.h], [GETTEXT_H=""], [GETTEXT_H="gettext.h"], [AC_INCLUDES_DEFAULT]) -AC_SUBST(GETTEXT_H) +AC_SUBST([GETTEXT_H]) -AC_CONFIG_FILES(po/Makefile.in) -])# m4_GNU_GETTEXT +AC_CONFIG_FILES([po/Makefile.in]) +])# M4_GNU_GETTEXT Index: ltdl/m4/m4-gnulib.m4 =================================================================== RCS file: ltdl/m4/m4-gnulib.m4 diff -N ltdl/m4/m4-gnulib.m4 --- ltdl/m4/m4-gnulib.m4 7 Jul 2005 16:27:54 -0000 1.2 +++ /dev/null 1 Jan 1970 00:00:00 -0000 @@ -1,27 +0,0 @@ -# -*- Autoconf -*- -# m4-gnulib.m4 -- List the gnulib modules required -# -# 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 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., 51 Franklin Street, Fifth Floor, Boston, MA -# 02110-1301 USA - -# Written by Gary V. Vaughan <[EMAIL PROTECTED]> - -# serial 1 - -# m4_GNULIB_MODULES -# ----------------- -AC_DEFUN([m4_GNULIB_MODULES], [:]) Index: ltdl/m4/m4-obstack.m4 =================================================================== RCS file: /sources/m4/m4/ltdl/m4/m4-obstack.m4,v retrieving revision 1.1 diff -u -p -r1.1 m4-obstack.m4 --- ltdl/m4/m4-obstack.m4 4 May 2005 15:45:44 -0000 1.1 +++ ltdl/m4/m4-obstack.m4 16 Jun 2006 03:47:04 -0000 @@ -1,7 +1,7 @@ # -*- Autoconf -*- # m4-obstack.m4 -- the libc supplied version of obstacks if available. # -# Copyright (C) 2000, 2001, 2003, 2004 Free Software Foundation, Inc +# Copyright (C) 2000, 2001, 2003, 2004, 2006 Free Software Foundation, Inc # Written by Gary V. Vaughan <[EMAIL PROTECTED]> # # This program is free software; you can redistribute it and/or modify @@ -19,19 +19,19 @@ # the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, # Boston, MA 02110-1301, USA. -# serial 9 +# serial 10 -# m4_OBSTACK +# M4_OBSTACK # ---------- # Use the libc supplied version of obstacks if available. -AC_DEFUN([m4_OBSTACK], -[AC_PREREQ(2.56)dnl We use the compiler based header checking in 2.56 -AC_BEFORE([gl_OBSTACK], [m4_OBSTACK]) +AC_DEFUN([M4_OBSTACK], +[AC_PREREQ([2.56])dnl We use the compiler based header checking in 2.56 +AC_BEFORE([gl_OBSTACK], [M4_OBSTACK]) AC_ARG_WITH([included-obstack], - [AC_HELP_STRING([--with-included-obstack], + [AS_HELP_STRING([--with-included-obstack], [use the obstack implementation included here])]) -AC_CHECK_HEADERS(obstack.h, [], [], [AC_INCLUDES_DEFAULT]) +AC_CHECK_HEADERS([obstack.h], [], [], [AC_INCLUDES_DEFAULT]) if test "x${with_included_obstack-no}" != xno; then ac_cv_func_obstack=no @@ -44,6 +44,6 @@ else INCLUDE_OBSTACK_H='#include <gnu/obstack.h>' OBSTACK_H=obstack.h fi -AC_SUBST(OBSTACK_H) -AC_SUBST(INCLUDE_OBSTACK_H) -])# m4_FUNC_OBSTACK +AC_SUBST([OBSTACK_H]) +AC_SUBST([INCLUDE_OBSTACK_H]) +])# M4_FUNC_OBSTACK Index: ltdl/m4/m4-regex.m4 =================================================================== RCS file: /sources/m4/m4/ltdl/m4/m4-regex.m4,v retrieving revision 1.1 diff -u -p -r1.1 m4-regex.m4 --- ltdl/m4/m4-regex.m4 4 May 2005 15:45:44 -0000 1.1 +++ ltdl/m4/m4-regex.m4 16 Jun 2006 03:47:04 -0000 @@ -2,7 +2,7 @@ # m4-regex.m4 -- Use the installed regex if it is good enough. # Written by Gary V. Vaughan <[EMAIL PROTECTED]> # -# Copyright (C) 2003, 2004 Free Software Foundation, Inc +# Copyright (C) 2003, 2004, 2006 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 @@ -19,13 +19,13 @@ # the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, # Boston, MA 02110-1301, USA. -# serial 3 +# serial 4 -# m4_REGEX([path/to/regex.c]) +# M4_REGEX([path/to/regex.c]) # --------------------------- # Use the installed regex if it is good enough. -AC_DEFUN([m4_REGEX], -[AC_BEFORE([gl_REGEX], [m4_REGEX]) +AC_DEFUN([M4_REGEX], +[AC_BEFORE([gl_REGEX], [M4_REGEX]) if test $ac_use_included_regex = no; then INCLUDE_REGEX_H='#include <regex.h>' REGEX_H= @@ -33,6 +33,6 @@ else INCLUDE_REGEX_H='#include <gnu/regex.h>' REGEX_H=regex.h fi -AC_SUBST(REGEX_H) -AC_SUBST(INCLUDE_REGEX_H) -])# m4_REGEX +AC_SUBST([REGEX_H]) +AC_SUBST([INCLUDE_REGEX_H]) +])# M4_REGEX Index: ltdl/m4/stackovf.m4 =================================================================== RCS file: /sources/m4/m4/ltdl/m4/stackovf.m4,v retrieving revision 1.1 diff -u -p -r1.1 stackovf.m4 --- ltdl/m4/stackovf.m4 4 May 2005 15:45:44 -0000 1.1 +++ ltdl/m4/stackovf.m4 16 Jun 2006 03:47:04 -0000 @@ -1,7 +1,7 @@ # -*- Autoconf -*- # stackovf.m4 -- how do we deal with stack overflow? # -# Copyright (C) 2000, 2003 Gary V. Vaughan <[EMAIL PROTECTED]> +# Copyright (C) 2000, 2003, 2006 Gary V. Vaughan <[EMAIL PROTECTED]> # # 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,17 +18,17 @@ # the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, # Boston, MA 02110-1301, USA. -# serial 2 +# serial 3 -# m4_SYS_STACKOVF +# M4_SYS_STACKOVF # --------------- -AC_DEFUN([m4_SYS_STACKOVF], -[AC_PREREQ(2.56)dnl We use the new compiler based header checking in 2.56 +AC_DEFUN([M4_SYS_STACKOVF], +[AC_PREREQ([2.56])dnl We use the new compiler based header checking in 2.56 AC_REQUIRE([AC_TYPE_SIGNAL])dnl -AC_CHECK_HEADERS(siginfo.h, [], [], [AC_INCLUDES_DEFAULT]) -AC_CHECK_FUNCS(sigaction sigaltstack sigstack sigvec) -AC_MSG_CHECKING(if stack overflow is detectable) +AC_CHECK_HEADERS([siginfo.h], [], [], [AC_INCLUDES_DEFAULT]) +AC_CHECK_FUNCS([sigaction sigaltstack sigstack sigvec]) +AC_MSG_CHECKING([if stack overflow is detectable]) # Code from Jim Avera <[EMAIL PROTECTED]>. # stackovf.c requires: # 1. Either sigaction with SA_ONSTACK, or sigvec with SV_ONSTACK @@ -37,39 +37,39 @@ AC_MSG_CHECKING(if stack overflow is det use_stackovf=no if test "$ac_cv_func_sigaction" = yes || test "$ac_cv_func_sigvec" = yes; then if test "$ac_cv_func_sigaltstack" = yes || test "$ac_cv_func_sigstack" = yes; then - AC_TRY_LINK([#include <sys/time.h> + AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include <sys/time.h> #include <sys/resource.h> -#include <signal.h>], - [struct rlimit r; int i; getrlimit (RLIMIT_STACK, &r) +#include <signal.h>]], + [[struct rlimit r; int i; getrlimit (RLIMIT_STACK, &r) #if (!defined(HAVE_SIGACTION) || !defined(SA_ONSTACK)) \ && (!defined(HAVE_SIGVEC) || !defined(SV_ONSTACK)) choke me /* SA_ONSTACK and/or SV_ONSTACK are not defined */ -#endif], - use_stackovf=yes) +#endif]])], + [use_stackovf=yes]) fi fi -AC_MSG_RESULT($use_stackovf) +AC_MSG_RESULT([$use_stackovf]) +AM_CONDITIONAL([STACKOVF], [test "$use_stackovf" = yes]) if test "$use_stackovf" = yes; then - AC_DEFINE(USE_STACKOVF, 1, [Define to 1 if using stack overflow detection.]) - STACKOVF=stackovf.${U}o - AC_SUBST(STACKOVF) - AC_EGREP_HEADER(rlim_t, sys/resource.h, , - AC_DEFINE(rlim_t, int, - [Define to int if rlim_t is not defined in <sys/resource.h>.])) - AC_EGREP_HEADER(stack_t, signal.h, , - AC_DEFINE(stack_t, struct sigaltstack, - [Define to struct sigaltstack if stack_t is not defined in <sys/signal.h>.])) - AC_EGREP_HEADER(sigcontext, signal.h, - AC_DEFINE(HAVE_SIGCONTEXT, 1, - [Define to 1 if <signal.h> declares sigcontext.])) - AC_EGREP_HEADER(siginfo_t, signal.h, - AC_DEFINE(HAVE_SIGINFO_T, 1, - [Define to 1 if <signal.h> declares siginfo_t.])) + AC_DEFINE([USE_STACKOVF], [1], + [Define to 1 if using stack overflow detection.]) + AC_EGREP_HEADER([rlim_t], [sys/resource.h], [], + [AC_DEFINE([rlim_t], [int], + [Define to int if rlim_t is not defined in <sys/resource.h>.])]) + AC_EGREP_HEADER([stack_t], [signal.h], [], + [AC_DEFINE([stack_t], [struct sigaltstack], + [Define to struct sigaltstack if stack_t is not defined in <sys/signal.h>.])]) + AC_EGREP_HEADER([sigcontext], [signal.h], + [AC_DEFINE([HAVE_SIGCONTEXT], [1], + [Define to 1 if <signal.h> declares sigcontext.])]) + AC_EGREP_HEADER([siginfo_t], [signal.h], + [AC_DEFINE([HAVE_SIGINFO_T], [1], + [Define to 1 if <signal.h> declares siginfo_t.])]) - AC_TRY_COMPILE([#include <signal.h>], - [struct sigaltstack x; x.ss_base = 0;], - AC_DEFINE(ss_sp, ss_base, - [Define to ss_base if stack_t has ss_base instead of ss_sp.])) + AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <signal.h>]], + [[struct sigaltstack x; x.ss_base = 0;]])], + [AC_DEFINE([ss_sp], [ss_base], + [Define to ss_base if stack_t has ss_base instead of ss_sp.])]) fi -])# m4_SYS_STACKOVF +])# M4_SYS_STACKOVF
signature.asc
Description: OpenPGP digital signature