From 1eacf10370529972a7407bdbb368f5f69f87a1b8 Mon Sep 17 00:00:00 2001 From: "Gary V. Vaughan" Date: Sun, 22 Sep 2013 09:23:34 +0700 Subject: configury: move autoconf macros to build-aux subdirectory. * ltdl/m4: Move from here... * build-aux/m4: ...to here. * configure.ac (AC_CONFIG_MACRO_DIR): Adjust. * Makefile.am (config_macro_dir, ACLOCAL_AMFLAGS): Adjust. * build-aux/m4/gnulib-cache.m4: Regenerate. Signed-off-by: Gary V. Vaughan --- Makefile.am | 4 +- build-aux/m4/debug.m4 | 94 +++++++++++++++++++++++++++++++++ build-aux/m4/gmp.m4 | 77 +++++++++++++++++++++++++++ build-aux/m4/gnulib-cache.m4 | 120 +++++++++++++++++++++++++++++++++++++++++++ build-aux/m4/m4-error.m4 | 41 +++++++++++++++ build-aux/m4/m4-getopt.m4 | 35 +++++++++++++ build-aux/m4/m4-gettext.m4 | 35 +++++++++++++ build-aux/m4/m4-obstack.m4 | 50 ++++++++++++++++++ build-aux/m4/m4-regex.m4 | 39 ++++++++++++++ build-aux/m4/m4-rename.m4 | 45 ++++++++++++++++ build-aux/m4/m4-syscmd.m4 | 59 +++++++++++++++++++++ build-aux/m4/stackovf.m4 | 91 ++++++++++++++++++++++++++++++++ configure.ac | 2 +- ltdl/m4/debug.m4 | 94 --------------------------------- ltdl/m4/gmp.m4 | 77 --------------------------- ltdl/m4/gnulib-cache.m4 | 120 ------------------------------------------- ltdl/m4/m4-error.m4 | 41 --------------- ltdl/m4/m4-getopt.m4 | 35 ------------- ltdl/m4/m4-gettext.m4 | 35 ------------- ltdl/m4/m4-obstack.m4 | 50 ------------------ ltdl/m4/m4-regex.m4 | 39 -------------- ltdl/m4/m4-rename.m4 | 45 ---------------- ltdl/m4/m4-syscmd.m4 | 59 --------------------- ltdl/m4/stackovf.m4 | 91 -------------------------------- 24 files changed, 689 insertions(+), 689 deletions(-) create mode 100644 build-aux/m4/debug.m4 create mode 100644 build-aux/m4/gmp.m4 create mode 100644 build-aux/m4/gnulib-cache.m4 create mode 100644 build-aux/m4/m4-error.m4 create mode 100644 build-aux/m4/m4-getopt.m4 create mode 100644 build-aux/m4/m4-gettext.m4 create mode 100644 build-aux/m4/m4-obstack.m4 create mode 100644 build-aux/m4/m4-regex.m4 create mode 100644 build-aux/m4/m4-rename.m4 create mode 100644 build-aux/m4/m4-syscmd.m4 create mode 100644 build-aux/m4/stackovf.m4 delete mode 100644 ltdl/m4/debug.m4 delete mode 100644 ltdl/m4/gmp.m4 delete mode 100644 ltdl/m4/gnulib-cache.m4 delete mode 100644 ltdl/m4/m4-error.m4 delete mode 100644 ltdl/m4/m4-getopt.m4 delete mode 100644 ltdl/m4/m4-gettext.m4 delete mode 100644 ltdl/m4/m4-obstack.m4 delete mode 100644 ltdl/m4/m4-regex.m4 delete mode 100644 ltdl/m4/m4-rename.m4 delete mode 100644 ltdl/m4/m4-syscmd.m4 delete mode 100644 ltdl/m4/stackovf.m4 diff --git a/Makefile.am b/Makefile.am index cd1d234f..0cc3e838 100644 --- a/Makefile.am +++ b/Makefile.am @@ -21,11 +21,11 @@ ## Written by Gary V. Vaughan config_aux_dir = build-aux -config_macro_dir= ltdl/m4 +config_macro_dir= $(config_aux_dir)/m4 SUBDIRS = po gnu . doc tests/gnu -ACLOCAL_AMFLAGS = -I ltdl/m4 +ACLOCAL_AMFLAGS = -I build-aux/m4 AUTOMAKE_OPTIONS = nostdinc gitlog_to_changelog = $(srcdir)/$(config_aux_dir)/gitlog-to-changelog diff --git a/build-aux/m4/debug.m4 b/build-aux/m4/debug.m4 new file mode 100644 index 00000000..2bb5739d --- /dev/null +++ b/build-aux/m4/debug.m4 @@ -0,0 +1,94 @@ +## -*- Autoconf -*- +## debug.m4 -- massage compiler flags for debugging/optimisation +## +## Copyright (C) 2000-2001, 2003, 2005-2007, 2010, 2013 Free Software +## Foundation, Inc. +## Copyright (C) 1999-2000 Ralf S. Engelschall +## Written by +## Modified for M4 by Gary V. Vaughan +## +## This file is part of GNU M4. +## +## GNU M4 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. +## +## GNU M4 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 . + +# serial 9 + +# M4_CHECK_DEBUGGING +# ------------------ +# Debugging Support +AC_DEFUN([M4_CHECK_DEBUGGING], +[AC_REQUIRE([AC_PROG_CC]) +AC_ARG_ENABLE([debug], [AS_HELP_STRING([--enable-debug], + [build for debugging [default=no]])]) +AC_MSG_CHECKING([for compilation debug mode]) +AC_MSG_RESULT([${enable_debug-no}]) + +: ${rm=rm -f} +: ${RM=rm -f} + +set dummy $CC +compiler="${compiler-[$]2}" +test -n "$rm" || rm="rm -f" + +if test "X$enable_debug" = Xyes; then + AC_DISABLE_SHARED + AC_DEFINE([DEBUG], [1], + [Define this to enable additional runtime debugging]) + M4_default_preload="m4 traditional gnu load \ +import modtest mpeval shadow stdlib time" + if test "$GCC" = yes; then + case "$CFLAGS" in + *-O* ) CFLAGS=`echo $CFLAGS | $SED 's/-O[[^ ]]* / /;s/-O[[^ ]]*$//'` ;; + esac + case "$CFLAGS" in + *-g* ) ;; + * ) AC_LIBTOOL_COMPILER_OPTION([if $compiler accepts -ggdb3], + [M4_cv_prog_compiler_ggdb3], + [-ggdb3 -c conftest.$ac_ext], [], + [CFLAGS="$CFLAGS -ggdb3"], + [CFLAGS="$CFLAGS -g"]) + ;; + esac + CFLAGS="$CFLAGS -Wall" + 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], + [$WMORE -c conftest.$ac_ext], [], + [CFLAGS="$CFLAGS $WMORE"]) + + AC_LIBTOOL_COMPILER_OPTION([if $compiler accepts -Wno-long-long], + [M4_cv_prog_compiler_wnolonglong], + [-Wno-long-long -c conftest.$ac_ext], [], + [CFLAGS="$CFLAGS -Wno-long-long"]) + else + case "$CFLAGS" in + *-g* ) ;; + * ) CFLAGS="$CFLAGS -g" ;; + esac + fi +else + AC_ENABLE_SHARED + case "$CFLAGS" in + *-g* ) CFLAGS=`echo "$CFLAGS" |\ + $SED -e 's/ -g / /g;s/ -g$//;s/^-g //g;s/^-g$//'` + ;; + esac + case "$CXXFLAGS" in + *-g* ) CXXFLAGS=`echo "$CXXFLAGS" |\ + $SED -e 's/ -g / /g;s/ -g$//;s/^-g //g;s/^-g$//'` + ;; + esac +fi +])# M4_CHECK_DEBUGGING diff --git a/build-aux/m4/gmp.m4 b/build-aux/m4/gmp.m4 new file mode 100644 index 00000000..36e60516 --- /dev/null +++ b/build-aux/m4/gmp.m4 @@ -0,0 +1,77 @@ +## -*- Autoconf -*- +## Copyright (C) 2000-2001, 2003, 2006-2008, 2010, 2013 Free Software +## Foundation, Inc. +## +## This file is part of GNU M4. +## +## GNU M4 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. +## +## GNU M4 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 . + +# serial 10 + +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 + no:*) + M4_cv_using_lib_gmp=no + ;; + *::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 + ;; + *:-lgmp:no) + AC_MSG_WARN([gmp works but `gmp.h' is missing]) + M4_cv_using_lib_gmp=no + ;; + yes:*:yes) + M4_cv_using_lib_gmp=yes + ;; + *) + M4_cv_using_lib_gmp=no + AC_MSG_WARN([could not detect gmp library]) + ;; +esac +])# _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_CHECK_HEADERS([gmp.h], [], [], [AC_INCLUDES_DEFAULT]) +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" +LIBS="$LIBS -lgmp" +AC_LINK_IFELSE([AC_LANG_PROGRAM([[#if HAVE_GMP_H +# include +#endif]], + [[mpq_t n; mpq_init (n);]])], + [LIBADD_GMP=-lgmp]) +LIBS=$M4_gmp_save_LIBS +AC_SUBST([LIBADD_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], + [Define to 1 if using the GNU multiple precision library.]) +fi + +AC_SUBST([USE_GMP], [$M4_cv_using_lib_gmp]) +])# M4_LIB_GMP diff --git a/build-aux/m4/gnulib-cache.m4 b/build-aux/m4/gnulib-cache.m4 new file mode 100644 index 00000000..6ac73fb1 --- /dev/null +++ b/build-aux/m4/gnulib-cache.m4 @@ -0,0 +1,120 @@ +# Copyright (C) 2002-2013 Free Software Foundation, Inc. +# +# 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 file 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 file. If not, see . +# +# As a special exception to the GNU General Public License, +# this file may be distributed as part of a program that +# contains a configuration script generated by Autoconf, under +# the same distribution terms as the rest of that program. +# +# Generated by gnulib-tool. +# +# This file represents the specification of how gnulib-tool is used. +# It acts as a cache: It is written and read by gnulib-tool. +# In projects that use version control, this file is meant to be put under +# version control, like the configure.ac and various Makefile.am files. + + +# Specification in the form of a command-line invocation: +# gnulib-tool --import --dir=. --local-dir=build-aux/gl --lib=libgnu --source-base=gnu --m4-base=build-aux/m4 --doc-base=doc --tests-base=tests/gnu --aux-dir=build-aux --with-tests --with-c++-tests --no-conditional-dependencies --libtool --macro-prefix=M4 assert autobuild avltree-oset binary-io bitrotate clean-temp cloexec close-stream closein config-h configmake dirname error execute fclose fdl-1.3 fflush filenamecat flexmember fopen fopen-safer freadptr freadseek fseeko gendocs gettext git-version-gen gitlog-to-changelog gnumakefile gnupload gpl-3.0 intprops inttypes maintainer-makefile manywarnings memchr2 memcmp2 memmem mkstemp obstack obstack-printf-posix progname propername quote regex regexprops-generic rename setenv sigpipe snprintf-posix spawn-pipe sprintf-posix stdbool stdlib-safer strnlen strtod tempname unlocked-io unsetenv update-copyright vasnprintf-posix verify verror wait-process xalloc xalloc-die xmemdup0 xoset xprintf-posix xstrndup xvasprintf-posix + +# Specification in the form of a few gnulib-tool.m4 macro invocations: +gl_LOCAL_DIR([build-aux/gl]) +gl_MODULES([ + assert + autobuild + avltree-oset + binary-io + bitrotate + clean-temp + cloexec + close-stream + closein + config-h + configmake + dirname + error + execute + fclose + fdl-1.3 + fflush + filenamecat + flexmember + fopen + fopen-safer + freadptr + freadseek + fseeko + gendocs + gettext + git-version-gen + gitlog-to-changelog + gnumakefile + gnupload + gpl-3.0 + intprops + inttypes + maintainer-makefile + manywarnings + memchr2 + memcmp2 + memmem + mkstemp + obstack + obstack-printf-posix + progname + propername + quote + regex + regexprops-generic + rename + setenv + sigpipe + snprintf-posix + spawn-pipe + sprintf-posix + stdbool + stdlib-safer + strnlen + strtod + tempname + unlocked-io + unsetenv + update-copyright + vasnprintf-posix + verify + verror + wait-process + xalloc + xalloc-die + xmemdup0 + xoset + xprintf-posix + xstrndup + xvasprintf-posix +]) +gl_WITH_CXX_TESTS +gl_AVOID([]) +gl_SOURCE_BASE([gnu]) +gl_M4_BASE([build-aux/m4]) +gl_PO_BASE([]) +gl_DOC_BASE([doc]) +gl_TESTS_BASE([tests/gnu]) +gl_WITH_TESTS +gl_LIB([libgnu]) +gl_MAKEFILE_NAME([]) +gl_LIBTOOL +gl_MACRO_PREFIX([M4]) +gl_PO_DOMAIN([]) +gl_WITNESS_C_MACRO([]) diff --git a/build-aux/m4/m4-error.m4 b/build-aux/m4/m4-error.m4 new file mode 100644 index 00000000..27695cbb --- /dev/null +++ b/build-aux/m4/m4-error.m4 @@ -0,0 +1,41 @@ +# -*- Autoconf -*- +# m4-error.m4 -- Use the installed version of error.h if available. +# Written by Gary V. Vaughan +# +# Copyright (C) 2003-2004, 2006-2007, 2010, 2013 Free Software +# Foundation, Inc. +# +# This file is part of GNU M4. +# +# GNU M4 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. +# +# GNU M4 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 . + +# serial 4 + +# M4_ERROR +# -------- +# Use the installed version of error.h if available. +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]) + +if test $ac_cv_header_error_h = yes; then + INCLUDE_ERROR_H='#include ' +else + INCLUDE_ERROR_H='#include ' +fi +AC_SUBST([INCLUDE_ERROR_H]) +])# M4_ERROR diff --git a/build-aux/m4/m4-getopt.m4 b/build-aux/m4/m4-getopt.m4 new file mode 100644 index 00000000..a2d3a4e3 --- /dev/null +++ b/build-aux/m4/m4-getopt.m4 @@ -0,0 +1,35 @@ +# -*- Autoconf -*- +# m4-getopt.m4 -- Use the installed version of getopt.h if available. +# Written by Gary V. Vaughan +# +# Copyright (C) 2005-2007, 2009-2010, 2013 Free Software Foundation, +# Inc. +# +# This file is part of GNU M4. +# +# GNU M4 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. +# +# GNU M4 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 . + +# serial 3 + +# M4_GETOPT +# --------- +# Use the installed version of getopt.h if available. +AC_DEFUN([M4_GETOPT], +[ + m4_divert_text([INIT_PREPARE], [M4_replace_getopt=]) + m4_pushdef([AC_LIBOBJ], [M4_replace_getopt=:]) + AC_REQUIRE([gl_FUNC_GETOPT_GNU]) + m4_popdef([AC_LIBOBJ]) + AM_CONDITIONAL([GETOPT], [test -n "$M4_replace_getopt"]) +])# M4_GETOPT diff --git a/build-aux/m4/m4-gettext.m4 b/build-aux/m4/m4-gettext.m4 new file mode 100644 index 00000000..3c40d730 --- /dev/null +++ b/build-aux/m4/m4-gettext.m4 @@ -0,0 +1,35 @@ +# -*- Autoconf -*- +# m4-gettext.m4 -- Use the installed version of GNU gettext if available. +# Written by Gary V. Vaughan +# +# Copyright (C) 2003-2004, 2006-2007, 2010, 2013 Free Software +# Foundation, Inc. +# +# This file is part of GNU M4. +# +# GNU M4 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. +# +# GNU M4 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 . + +# serial 3 + +# 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_CHECK_HEADERS([gettext.h], + [GETTEXT_H=""], [GETTEXT_H="gettext.h"], [AC_INCLUDES_DEFAULT]) +AC_SUBST([GETTEXT_H]) + +AC_CONFIG_FILES([po/Makefile.in]) +])# M4_GNU_GETTEXT diff --git a/build-aux/m4/m4-obstack.m4 b/build-aux/m4/m4-obstack.m4 new file mode 100644 index 00000000..fab387ba --- /dev/null +++ b/build-aux/m4/m4-obstack.m4 @@ -0,0 +1,50 @@ +# -*- Autoconf -*- +# m4-obstack.m4 -- the libc supplied version of obstacks if available. +# +# Copyright (C) 2000-2001, 2003-2004, 2006-2007, 2010, 2013 Free +# Software Foundation, Inc. +# Written by Gary V. Vaughan +# +# This file is part of GNU M4. +# +# GNU M4 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. +# +# GNU M4 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 . + +# serial 10 + +# 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_ARG_WITH([included-obstack], + [AS_HELP_STRING([--with-included-obstack], + [use the obstack implementation included here])]) + +AC_CHECK_HEADERS([obstack.h], [], [], [AC_INCLUDES_DEFAULT]) + +if test "x${with_included_obstack-no}" != xno; then + ac_cv_func_obstack=no +fi + +OBSTACK_H= +if test $ac_cv_func_obstack = yes; then + INCLUDE_OBSTACK_H='#include ' +else + INCLUDE_OBSTACK_H='#include ' + OBSTACK_H=obstack.h +fi +AC_SUBST([OBSTACK_H]) +AC_SUBST([INCLUDE_OBSTACK_H]) +])# M4_FUNC_OBSTACK diff --git a/build-aux/m4/m4-regex.m4 b/build-aux/m4/m4-regex.m4 new file mode 100644 index 00000000..e7fa38af --- /dev/null +++ b/build-aux/m4/m4-regex.m4 @@ -0,0 +1,39 @@ +# -*- Autoconf -*- +# m4-regex.m4 -- Use the installed regex if it is good enough. +# Written by Gary V. Vaughan +# +# Copyright (C) 2003-2004, 2006-2007, 2010, 2013 Free Software +# Foundation, Inc. +# +# This file is part of GNU M4. +# +# GNU M4 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. +# +# GNU M4 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 . + +# serial 4 + +# 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]) +if test $ac_use_included_regex = no; then + INCLUDE_REGEX_H='#include ' + REGEX_H= +else + INCLUDE_REGEX_H='#include ' + REGEX_H=regex.h +fi +AC_SUBST([REGEX_H]) +AC_SUBST([INCLUDE_REGEX_H]) +])# M4_REGEX diff --git a/build-aux/m4/m4-rename.m4 b/build-aux/m4/m4-rename.m4 new file mode 100644 index 00000000..4062cdec --- /dev/null +++ b/build-aux/m4/m4-rename.m4 @@ -0,0 +1,45 @@ +# -*- Autoconf -*- +# m4-rename.m4 -- Test the abilities of rename. +# Written by Eric Blake +# +# Copyright (C) 2008, 2010, 2013 Free Software Foundation, Inc. +# +# This file is part of GNU M4. +# +# GNU M4 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. +# +# GNU M4 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 . + +# serial 1 + +# M4_RENAME +# --------- +# Detect platforms like mingw where rename can't move open files. +AC_DEFUN([M4_RENAME], +[AC_CACHE_CHECK([whether an open file can be renamed], + [M4_cv_func_rename_open_file_works], + [AC_RUN_IFELSE([AC_LANG_PROGRAM([AC_INCLUDES_DEFAULT], + [FILE *f = fopen ("conftest.1", "w+"); + int result = rename ("conftest.1", "conftest.2"); + fclose (f); remove ("conftest.1"); remove ("conftest.2"); + return result;])], + [M4_cv_func_rename_open_file_works=yes], + [M4_cv_func_rename_open_file_works=no], + [M4_cv_func_rename_open_file_works='guessing no'])]) +if test "$M4_cv_func_rename_open_file_works" = yes ; then + M4_rename_open_works=1 +else + M4_rename_open_works=0 +fi +AC_DEFINE_UNQUOTED([RENAME_OPEN_FILE_WORKS], [$M4_rename_open_works], + [Define to 1 if a file can be renamed while open, or to 0 if not.]) +]) diff --git a/build-aux/m4/m4-syscmd.m4 b/build-aux/m4/m4-syscmd.m4 new file mode 100644 index 00000000..514201fa --- /dev/null +++ b/build-aux/m4/m4-syscmd.m4 @@ -0,0 +1,59 @@ +# -*- Autoconf -*- +# m4-syscmd.m4 -- Allow choice of syscmd shell. +# Written by Eric Blake +# +# Copyright (C) 2009-2010, 2013 Free Software Foundation, Inc. +# +# This file is part of GNU M4. +# +# GNU M4 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. +# +# GNU M4 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 . + +# serial 1 + +# M4_SYSCMD +# --------- +# Allow user to choose different shell than /bin/sh for e?syscmd. +AC_DEFUN([M4_SYSCMD], +[AC_MSG_CHECKING([[which shell to use for syscmd]]) +AC_ARG_WITH([syscmd-shell], + [AS_HELP_STRING([--with-syscmd-shell], [shell used by syscmd [/bin/sh]])], + [case $withval in + yes[)] with_syscmd_shell=no;; + esac], [with_syscmd_shell=no]) +if test "$with_syscmd_shell" = no ; then + with_syscmd_shell=/bin/sh + if test "$cross_compiling" != yes ; then +dnl Give mingw a default that is more likely to be available. + AS_IF([AS_EXECUTABLE_P([/bin/sh])], [], + [if (cmd /c) 2>/dev/null; then with_syscmd_shell=cmd; fi]) +dnl Too bad _AS_PATH_WALK is not public. + M4_save_IFS=$IFS; IFS=$PATH_SEPARATOR + for M4_dir in `if (command -p getconf PATH) 2>/dev/null ; then + command -p getconf PATH + else + echo "/bin$PATH_SEPARATOR$PATH" + fi` + do + IFS=$M4_save_IFS + test -z "$M4_dir" && continue + AS_EXECUTABLE_P(["$M4_dir/sh"]) \ + && { with_syscmd_shell=$M4_dir/sh; break; } + done + IFS=$M4_save_IFS + fi +fi +AC_MSG_RESULT([$with_syscmd_shell]) +AC_DEFINE_UNQUOTED([M4_SYSCMD_SHELL], ["$with_syscmd_shell"], + [Shell used by syscmd and esyscmd, must accept -c argument.]) +]) diff --git a/build-aux/m4/stackovf.m4 b/build-aux/m4/stackovf.m4 new file mode 100644 index 00000000..d1812230 --- /dev/null +++ b/build-aux/m4/stackovf.m4 @@ -0,0 +1,91 @@ +# -*- Autoconf -*- +# stackovf.m4 -- how do we deal with stack overflow? +# +# Copyright (C) 2000, 2003, 2006-2007, 2010, 2013 Free Software +# Foundation, Inc. +# +# This file is part of GNU M4. +# +# GNU M4 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. +# +# GNU M4 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 . + +# serial 7 + +# M4_SYS_STACKOVF +# --------------- +AC_DEFUN([M4_SYS_STACKOVF], +[AC_PREREQ([2.60])dnl We use the _ONCE variants +AC_REQUIRE([AC_TYPE_SIGNAL])dnl + +AC_CHECK_HEADERS_ONCE([siginfo.h]) +AC_CHECK_FUNCS_ONCE([sigaction sigaltstack sigstack sigvec]) +AC_CHECK_MEMBERS([stack_t.ss_sp], [], [], +[[#include +#if HAVE_SIGINFO_H +# include +#endif +]]) + +# Code from Jim Avera . +# stackovf.c requires: +# 1. Either sigaction with SA_ONSTACK, or sigvec with SV_ONSTACK +# 2. Either sigaltstack or sigstack +# 3. getrlimit, including support for RLIMIT_STACK +AC_CACHE_CHECK([if stack overflow is detectable], [M4_cv_use_stackovf], +[M4_cv_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_LINK_IFELSE([AC_LANG_PROGRAM([[#include +#include +#include +]], [[struct rlimit r; 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 +]])], [M4_cv_use_stackovf=yes]) + fi +fi]) + +AM_CONDITIONAL([STACKOVF], [test "$M4_cv_use_stackovf" = yes]) +if test "$M4_cv_use_stackovf" = yes; then + AC_DEFINE([USE_STACKOVF], [1], + [Define to 1 if using stack overflow detection.]) + AC_CHECK_TYPES([rlim_t], [], + [AC_DEFINE([rlim_t], [int], + [Define to int if rlim_t is not defined in sys/resource.h])], + [[#include +]]) + AC_CHECK_TYPES([stack_t], [], + [AC_DEFINE([stack_t], [struct sigaltstack], + [Define to struct sigaltstack if stack_t is not in signal.h])], + [[#include +]]) + AC_CHECK_TYPES([sigcontext], [], [], [[#include +]]) + AC_CHECK_TYPES([siginfo_t], [], [], [[#include +#if HAVE_SIGINFO_H +# include +#endif +]]) + AC_CHECK_MEMBERS([struct sigaction.sa_sigaction], [], [], +[[#include +]]) + + AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include +]], + [[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 diff --git a/configure.ac b/configure.ac index bda7490e..36e0a7fd 100644 --- a/configure.ac +++ b/configure.ac @@ -31,7 +31,7 @@ AC_INIT([GNU M4], m4_defn([M4_VERSION]), [bug-m4@gnu.org]) AC_CONFIG_SRCDIR([src/m4.h]) AC_CONFIG_AUX_DIR([build-aux]) -AC_CONFIG_MACRO_DIR([ltdl/m4]) +AC_CONFIG_MACRO_DIR([build-aux/m4]) AC_CONFIG_LIBOBJ_DIR([gnu]) AC_CONFIG_TESTDIR([tests]) AC_CONFIG_HEADERS([gnu/config.h:gnu/config.hin]) diff --git a/ltdl/m4/debug.m4 b/ltdl/m4/debug.m4 deleted file mode 100644 index 2bb5739d..00000000 --- a/ltdl/m4/debug.m4 +++ /dev/null @@ -1,94 +0,0 @@ -## -*- Autoconf -*- -## debug.m4 -- massage compiler flags for debugging/optimisation -## -## Copyright (C) 2000-2001, 2003, 2005-2007, 2010, 2013 Free Software -## Foundation, Inc. -## Copyright (C) 1999-2000 Ralf S. Engelschall -## Written by -## Modified for M4 by Gary V. Vaughan -## -## This file is part of GNU M4. -## -## GNU M4 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. -## -## GNU M4 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 . - -# serial 9 - -# M4_CHECK_DEBUGGING -# ------------------ -# Debugging Support -AC_DEFUN([M4_CHECK_DEBUGGING], -[AC_REQUIRE([AC_PROG_CC]) -AC_ARG_ENABLE([debug], [AS_HELP_STRING([--enable-debug], - [build for debugging [default=no]])]) -AC_MSG_CHECKING([for compilation debug mode]) -AC_MSG_RESULT([${enable_debug-no}]) - -: ${rm=rm -f} -: ${RM=rm -f} - -set dummy $CC -compiler="${compiler-[$]2}" -test -n "$rm" || rm="rm -f" - -if test "X$enable_debug" = Xyes; then - AC_DISABLE_SHARED - AC_DEFINE([DEBUG], [1], - [Define this to enable additional runtime debugging]) - M4_default_preload="m4 traditional gnu load \ -import modtest mpeval shadow stdlib time" - if test "$GCC" = yes; then - case "$CFLAGS" in - *-O* ) CFLAGS=`echo $CFLAGS | $SED 's/-O[[^ ]]* / /;s/-O[[^ ]]*$//'` ;; - esac - case "$CFLAGS" in - *-g* ) ;; - * ) AC_LIBTOOL_COMPILER_OPTION([if $compiler accepts -ggdb3], - [M4_cv_prog_compiler_ggdb3], - [-ggdb3 -c conftest.$ac_ext], [], - [CFLAGS="$CFLAGS -ggdb3"], - [CFLAGS="$CFLAGS -g"]) - ;; - esac - CFLAGS="$CFLAGS -Wall" - 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], - [$WMORE -c conftest.$ac_ext], [], - [CFLAGS="$CFLAGS $WMORE"]) - - AC_LIBTOOL_COMPILER_OPTION([if $compiler accepts -Wno-long-long], - [M4_cv_prog_compiler_wnolonglong], - [-Wno-long-long -c conftest.$ac_ext], [], - [CFLAGS="$CFLAGS -Wno-long-long"]) - else - case "$CFLAGS" in - *-g* ) ;; - * ) CFLAGS="$CFLAGS -g" ;; - esac - fi -else - AC_ENABLE_SHARED - case "$CFLAGS" in - *-g* ) CFLAGS=`echo "$CFLAGS" |\ - $SED -e 's/ -g / /g;s/ -g$//;s/^-g //g;s/^-g$//'` - ;; - esac - case "$CXXFLAGS" in - *-g* ) CXXFLAGS=`echo "$CXXFLAGS" |\ - $SED -e 's/ -g / /g;s/ -g$//;s/^-g //g;s/^-g$//'` - ;; - esac -fi -])# M4_CHECK_DEBUGGING diff --git a/ltdl/m4/gmp.m4 b/ltdl/m4/gmp.m4 deleted file mode 100644 index 36e60516..00000000 --- a/ltdl/m4/gmp.m4 +++ /dev/null @@ -1,77 +0,0 @@ -## -*- Autoconf -*- -## Copyright (C) 2000-2001, 2003, 2006-2008, 2010, 2013 Free Software -## Foundation, Inc. -## -## This file is part of GNU M4. -## -## GNU M4 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. -## -## GNU M4 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 . - -# serial 10 - -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 - no:*) - M4_cv_using_lib_gmp=no - ;; - *::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 - ;; - *:-lgmp:no) - AC_MSG_WARN([gmp works but `gmp.h' is missing]) - M4_cv_using_lib_gmp=no - ;; - yes:*:yes) - M4_cv_using_lib_gmp=yes - ;; - *) - M4_cv_using_lib_gmp=no - AC_MSG_WARN([could not detect gmp library]) - ;; -esac -])# _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_CHECK_HEADERS([gmp.h], [], [], [AC_INCLUDES_DEFAULT]) -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" -LIBS="$LIBS -lgmp" -AC_LINK_IFELSE([AC_LANG_PROGRAM([[#if HAVE_GMP_H -# include -#endif]], - [[mpq_t n; mpq_init (n);]])], - [LIBADD_GMP=-lgmp]) -LIBS=$M4_gmp_save_LIBS -AC_SUBST([LIBADD_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], - [Define to 1 if using the GNU multiple precision library.]) -fi - -AC_SUBST([USE_GMP], [$M4_cv_using_lib_gmp]) -])# M4_LIB_GMP diff --git a/ltdl/m4/gnulib-cache.m4 b/ltdl/m4/gnulib-cache.m4 deleted file mode 100644 index cee2e9b5..00000000 --- a/ltdl/m4/gnulib-cache.m4 +++ /dev/null @@ -1,120 +0,0 @@ -# Copyright (C) 2002-2013 Free Software Foundation, Inc. -# -# 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 file 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 file. If not, see . -# -# As a special exception to the GNU General Public License, -# this file may be distributed as part of a program that -# contains a configuration script generated by Autoconf, under -# the same distribution terms as the rest of that program. -# -# Generated by gnulib-tool. -# -# This file represents the specification of how gnulib-tool is used. -# It acts as a cache: It is written and read by gnulib-tool. -# In projects that use version control, this file is meant to be put under -# version control, like the configure.ac and various Makefile.am files. - - -# Specification in the form of a command-line invocation: -# gnulib-tool --import --dir=. --local-dir=build-aux/gl --lib=libgnu --source-base=gnu --m4-base=ltdl/m4 --doc-base=doc --tests-base=tests/gnu --aux-dir=build-aux --with-tests --with-c++-tests --no-conditional-dependencies --libtool --macro-prefix=M4 assert autobuild avltree-oset binary-io bitrotate clean-temp cloexec close-stream closein config-h configmake dirname error execute fclose fdl-1.3 fflush filenamecat flexmember fopen fopen-safer freadptr freadseek fseeko gendocs gettext git-version-gen gitlog-to-changelog gnumakefile gnupload gpl-3.0 intprops inttypes maintainer-makefile manywarnings memchr2 memcmp2 memmem mkstemp obstack obstack-printf-posix progname propername quote regex regexprops-generic rename setenv sigpipe snprintf-posix spawn-pipe sprintf-posix stdbool stdlib-safer strnlen strtod tempname unlocked-io unsetenv update-copyright vasnprintf-posix verify verror wait-process xalloc xalloc-die xmemdup0 xoset xprintf-posix xstrndup xvasprintf-posix - -# Specification in the form of a few gnulib-tool.m4 macro invocations: -gl_LOCAL_DIR([build-aux/gl]) -gl_MODULES([ - assert - autobuild - avltree-oset - binary-io - bitrotate - clean-temp - cloexec - close-stream - closein - config-h - configmake - dirname - error - execute - fclose - fdl-1.3 - fflush - filenamecat - flexmember - fopen - fopen-safer - freadptr - freadseek - fseeko - gendocs - gettext - git-version-gen - gitlog-to-changelog - gnumakefile - gnupload - gpl-3.0 - intprops - inttypes - maintainer-makefile - manywarnings - memchr2 - memcmp2 - memmem - mkstemp - obstack - obstack-printf-posix - progname - propername - quote - regex - regexprops-generic - rename - setenv - sigpipe - snprintf-posix - spawn-pipe - sprintf-posix - stdbool - stdlib-safer - strnlen - strtod - tempname - unlocked-io - unsetenv - update-copyright - vasnprintf-posix - verify - verror - wait-process - xalloc - xalloc-die - xmemdup0 - xoset - xprintf-posix - xstrndup - xvasprintf-posix -]) -gl_WITH_CXX_TESTS -gl_AVOID([]) -gl_SOURCE_BASE([gnu]) -gl_M4_BASE([ltdl/m4]) -gl_PO_BASE([]) -gl_DOC_BASE([doc]) -gl_TESTS_BASE([tests/gnu]) -gl_WITH_TESTS -gl_LIB([libgnu]) -gl_MAKEFILE_NAME([]) -gl_LIBTOOL -gl_MACRO_PREFIX([M4]) -gl_PO_DOMAIN([]) -gl_WITNESS_C_MACRO([]) diff --git a/ltdl/m4/m4-error.m4 b/ltdl/m4/m4-error.m4 deleted file mode 100644 index 27695cbb..00000000 --- a/ltdl/m4/m4-error.m4 +++ /dev/null @@ -1,41 +0,0 @@ -# -*- Autoconf -*- -# m4-error.m4 -- Use the installed version of error.h if available. -# Written by Gary V. Vaughan -# -# Copyright (C) 2003-2004, 2006-2007, 2010, 2013 Free Software -# Foundation, Inc. -# -# This file is part of GNU M4. -# -# GNU M4 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. -# -# GNU M4 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 . - -# serial 4 - -# M4_ERROR -# -------- -# Use the installed version of error.h if available. -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]) - -if test $ac_cv_header_error_h = yes; then - INCLUDE_ERROR_H='#include ' -else - INCLUDE_ERROR_H='#include ' -fi -AC_SUBST([INCLUDE_ERROR_H]) -])# M4_ERROR diff --git a/ltdl/m4/m4-getopt.m4 b/ltdl/m4/m4-getopt.m4 deleted file mode 100644 index a2d3a4e3..00000000 --- a/ltdl/m4/m4-getopt.m4 +++ /dev/null @@ -1,35 +0,0 @@ -# -*- Autoconf -*- -# m4-getopt.m4 -- Use the installed version of getopt.h if available. -# Written by Gary V. Vaughan -# -# Copyright (C) 2005-2007, 2009-2010, 2013 Free Software Foundation, -# Inc. -# -# This file is part of GNU M4. -# -# GNU M4 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. -# -# GNU M4 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 . - -# serial 3 - -# M4_GETOPT -# --------- -# Use the installed version of getopt.h if available. -AC_DEFUN([M4_GETOPT], -[ - m4_divert_text([INIT_PREPARE], [M4_replace_getopt=]) - m4_pushdef([AC_LIBOBJ], [M4_replace_getopt=:]) - AC_REQUIRE([gl_FUNC_GETOPT_GNU]) - m4_popdef([AC_LIBOBJ]) - AM_CONDITIONAL([GETOPT], [test -n "$M4_replace_getopt"]) -])# M4_GETOPT diff --git a/ltdl/m4/m4-gettext.m4 b/ltdl/m4/m4-gettext.m4 deleted file mode 100644 index 3c40d730..00000000 --- a/ltdl/m4/m4-gettext.m4 +++ /dev/null @@ -1,35 +0,0 @@ -# -*- Autoconf -*- -# m4-gettext.m4 -- Use the installed version of GNU gettext if available. -# Written by Gary V. Vaughan -# -# Copyright (C) 2003-2004, 2006-2007, 2010, 2013 Free Software -# Foundation, Inc. -# -# This file is part of GNU M4. -# -# GNU M4 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. -# -# GNU M4 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 . - -# serial 3 - -# 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_CHECK_HEADERS([gettext.h], - [GETTEXT_H=""], [GETTEXT_H="gettext.h"], [AC_INCLUDES_DEFAULT]) -AC_SUBST([GETTEXT_H]) - -AC_CONFIG_FILES([po/Makefile.in]) -])# M4_GNU_GETTEXT diff --git a/ltdl/m4/m4-obstack.m4 b/ltdl/m4/m4-obstack.m4 deleted file mode 100644 index fab387ba..00000000 --- a/ltdl/m4/m4-obstack.m4 +++ /dev/null @@ -1,50 +0,0 @@ -# -*- Autoconf -*- -# m4-obstack.m4 -- the libc supplied version of obstacks if available. -# -# Copyright (C) 2000-2001, 2003-2004, 2006-2007, 2010, 2013 Free -# Software Foundation, Inc. -# Written by Gary V. Vaughan -# -# This file is part of GNU M4. -# -# GNU M4 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. -# -# GNU M4 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 . - -# serial 10 - -# 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_ARG_WITH([included-obstack], - [AS_HELP_STRING([--with-included-obstack], - [use the obstack implementation included here])]) - -AC_CHECK_HEADERS([obstack.h], [], [], [AC_INCLUDES_DEFAULT]) - -if test "x${with_included_obstack-no}" != xno; then - ac_cv_func_obstack=no -fi - -OBSTACK_H= -if test $ac_cv_func_obstack = yes; then - INCLUDE_OBSTACK_H='#include ' -else - INCLUDE_OBSTACK_H='#include ' - OBSTACK_H=obstack.h -fi -AC_SUBST([OBSTACK_H]) -AC_SUBST([INCLUDE_OBSTACK_H]) -])# M4_FUNC_OBSTACK diff --git a/ltdl/m4/m4-regex.m4 b/ltdl/m4/m4-regex.m4 deleted file mode 100644 index e7fa38af..00000000 --- a/ltdl/m4/m4-regex.m4 +++ /dev/null @@ -1,39 +0,0 @@ -# -*- Autoconf -*- -# m4-regex.m4 -- Use the installed regex if it is good enough. -# Written by Gary V. Vaughan -# -# Copyright (C) 2003-2004, 2006-2007, 2010, 2013 Free Software -# Foundation, Inc. -# -# This file is part of GNU M4. -# -# GNU M4 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. -# -# GNU M4 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 . - -# serial 4 - -# 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]) -if test $ac_use_included_regex = no; then - INCLUDE_REGEX_H='#include ' - REGEX_H= -else - INCLUDE_REGEX_H='#include ' - REGEX_H=regex.h -fi -AC_SUBST([REGEX_H]) -AC_SUBST([INCLUDE_REGEX_H]) -])# M4_REGEX diff --git a/ltdl/m4/m4-rename.m4 b/ltdl/m4/m4-rename.m4 deleted file mode 100644 index 4062cdec..00000000 --- a/ltdl/m4/m4-rename.m4 +++ /dev/null @@ -1,45 +0,0 @@ -# -*- Autoconf -*- -# m4-rename.m4 -- Test the abilities of rename. -# Written by Eric Blake -# -# Copyright (C) 2008, 2010, 2013 Free Software Foundation, Inc. -# -# This file is part of GNU M4. -# -# GNU M4 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. -# -# GNU M4 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 . - -# serial 1 - -# M4_RENAME -# --------- -# Detect platforms like mingw where rename can't move open files. -AC_DEFUN([M4_RENAME], -[AC_CACHE_CHECK([whether an open file can be renamed], - [M4_cv_func_rename_open_file_works], - [AC_RUN_IFELSE([AC_LANG_PROGRAM([AC_INCLUDES_DEFAULT], - [FILE *f = fopen ("conftest.1", "w+"); - int result = rename ("conftest.1", "conftest.2"); - fclose (f); remove ("conftest.1"); remove ("conftest.2"); - return result;])], - [M4_cv_func_rename_open_file_works=yes], - [M4_cv_func_rename_open_file_works=no], - [M4_cv_func_rename_open_file_works='guessing no'])]) -if test "$M4_cv_func_rename_open_file_works" = yes ; then - M4_rename_open_works=1 -else - M4_rename_open_works=0 -fi -AC_DEFINE_UNQUOTED([RENAME_OPEN_FILE_WORKS], [$M4_rename_open_works], - [Define to 1 if a file can be renamed while open, or to 0 if not.]) -]) diff --git a/ltdl/m4/m4-syscmd.m4 b/ltdl/m4/m4-syscmd.m4 deleted file mode 100644 index 514201fa..00000000 --- a/ltdl/m4/m4-syscmd.m4 +++ /dev/null @@ -1,59 +0,0 @@ -# -*- Autoconf -*- -# m4-syscmd.m4 -- Allow choice of syscmd shell. -# Written by Eric Blake -# -# Copyright (C) 2009-2010, 2013 Free Software Foundation, Inc. -# -# This file is part of GNU M4. -# -# GNU M4 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. -# -# GNU M4 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 . - -# serial 1 - -# M4_SYSCMD -# --------- -# Allow user to choose different shell than /bin/sh for e?syscmd. -AC_DEFUN([M4_SYSCMD], -[AC_MSG_CHECKING([[which shell to use for syscmd]]) -AC_ARG_WITH([syscmd-shell], - [AS_HELP_STRING([--with-syscmd-shell], [shell used by syscmd [/bin/sh]])], - [case $withval in - yes[)] with_syscmd_shell=no;; - esac], [with_syscmd_shell=no]) -if test "$with_syscmd_shell" = no ; then - with_syscmd_shell=/bin/sh - if test "$cross_compiling" != yes ; then -dnl Give mingw a default that is more likely to be available. - AS_IF([AS_EXECUTABLE_P([/bin/sh])], [], - [if (cmd /c) 2>/dev/null; then with_syscmd_shell=cmd; fi]) -dnl Too bad _AS_PATH_WALK is not public. - M4_save_IFS=$IFS; IFS=$PATH_SEPARATOR - for M4_dir in `if (command -p getconf PATH) 2>/dev/null ; then - command -p getconf PATH - else - echo "/bin$PATH_SEPARATOR$PATH" - fi` - do - IFS=$M4_save_IFS - test -z "$M4_dir" && continue - AS_EXECUTABLE_P(["$M4_dir/sh"]) \ - && { with_syscmd_shell=$M4_dir/sh; break; } - done - IFS=$M4_save_IFS - fi -fi -AC_MSG_RESULT([$with_syscmd_shell]) -AC_DEFINE_UNQUOTED([M4_SYSCMD_SHELL], ["$with_syscmd_shell"], - [Shell used by syscmd and esyscmd, must accept -c argument.]) -]) diff --git a/ltdl/m4/stackovf.m4 b/ltdl/m4/stackovf.m4 deleted file mode 100644 index d1812230..00000000 --- a/ltdl/m4/stackovf.m4 +++ /dev/null @@ -1,91 +0,0 @@ -# -*- Autoconf -*- -# stackovf.m4 -- how do we deal with stack overflow? -# -# Copyright (C) 2000, 2003, 2006-2007, 2010, 2013 Free Software -# Foundation, Inc. -# -# This file is part of GNU M4. -# -# GNU M4 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. -# -# GNU M4 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 . - -# serial 7 - -# M4_SYS_STACKOVF -# --------------- -AC_DEFUN([M4_SYS_STACKOVF], -[AC_PREREQ([2.60])dnl We use the _ONCE variants -AC_REQUIRE([AC_TYPE_SIGNAL])dnl - -AC_CHECK_HEADERS_ONCE([siginfo.h]) -AC_CHECK_FUNCS_ONCE([sigaction sigaltstack sigstack sigvec]) -AC_CHECK_MEMBERS([stack_t.ss_sp], [], [], -[[#include -#if HAVE_SIGINFO_H -# include -#endif -]]) - -# Code from Jim Avera . -# stackovf.c requires: -# 1. Either sigaction with SA_ONSTACK, or sigvec with SV_ONSTACK -# 2. Either sigaltstack or sigstack -# 3. getrlimit, including support for RLIMIT_STACK -AC_CACHE_CHECK([if stack overflow is detectable], [M4_cv_use_stackovf], -[M4_cv_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_LINK_IFELSE([AC_LANG_PROGRAM([[#include -#include -#include -]], [[struct rlimit r; 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 -]])], [M4_cv_use_stackovf=yes]) - fi -fi]) - -AM_CONDITIONAL([STACKOVF], [test "$M4_cv_use_stackovf" = yes]) -if test "$M4_cv_use_stackovf" = yes; then - AC_DEFINE([USE_STACKOVF], [1], - [Define to 1 if using stack overflow detection.]) - AC_CHECK_TYPES([rlim_t], [], - [AC_DEFINE([rlim_t], [int], - [Define to int if rlim_t is not defined in sys/resource.h])], - [[#include -]]) - AC_CHECK_TYPES([stack_t], [], - [AC_DEFINE([stack_t], [struct sigaltstack], - [Define to struct sigaltstack if stack_t is not in signal.h])], - [[#include -]]) - AC_CHECK_TYPES([sigcontext], [], [], [[#include -]]) - AC_CHECK_TYPES([siginfo_t], [], [], [[#include -#if HAVE_SIGINFO_H -# include -#endif -]]) - AC_CHECK_MEMBERS([struct sigaction.sa_sigaction], [], [], -[[#include -]]) - - AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include -]], - [[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 -- cgit v1.2.1