From b429a4eee4e09b1ba09e17ced5091d042955d84f Mon Sep 17 00:00:00 2001 From: Glenn Morris Date: Mon, 30 Jul 2012 17:20:43 -0400 Subject: [PATCH] Use an include file in configure.ac's AH_BOTTOM * configure.ac (AH_BOTTOM): Use an include file, so that the contents do not get processed by autoheader. Eg this prevents undefs being commented out, and is the recommended technique from the autoconf manual. * src/conf_post.h: New, split from configure.ac's AH_BOTTOM. * src/Makefile.in (config_h): Add conf_post.h. * src/makefile.w32-in (CONFIG_H): Add conf_post.h. --- ChangeLog | 5 ++ configure.ac | 103 +--------------------------------- src/ChangeLog | 6 ++ src/Makefile.in | 2 +- src/conf_post.h | 131 ++++++++++++++++++++++++++++++++++++++++++++ src/makefile.w32-in | 1 + 6 files changed, 145 insertions(+), 103 deletions(-) create mode 100644 src/conf_post.h diff --git a/ChangeLog b/ChangeLog index 14bf1f385cd..b0860362b1c 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2012-07-30 Glenn Morris + + * configure.ac (AH_BOTTOM): Use an include file, so that the + contents do not get processed by autoheader. + 2012-07-30 Paul Eggert Do not overwrite config.status while executing it (Bug#11214). diff --git a/configure.ac b/configure.ac index a68caca4072..402524f436d 100644 --- a/configure.ac +++ b/configure.ac @@ -4198,108 +4198,7 @@ along with GNU Emacs. If not, see . */ #define EMACS_CONFIG_H ])dnl -dnl FIXME undefs in here get commented out by autoconf. :( -AH_BOTTOM([ -/* On AIX 3 this must be included before any other include file. */ -#include -#if ! HAVE_ALLOCA -# error "alloca not available on this machine" -#endif - -#ifdef SIGNAL_H_AHB -#undef SIGNAL_H_AHB -#include -#endif - -/* This silences a few compilation warnings on FreeBSD. */ -#ifdef BSD_SYSTEM_AHB -#undef BSD_SYSTEM_AHB -#undef BSD_SYSTEM -#if __FreeBSD__ == 1 -#define BSD_SYSTEM 199103 -#elif __FreeBSD__ == 2 -#define BSD_SYSTEM 199306 -#elif __FreeBSD__ >= 3 -#define BSD_SYSTEM 199506 -#endif -#endif - -/* Define AMPERSAND_FULL_NAME if you use the convention - that & in the full name stands for the login id. */ -/* Turned on June 1996 supposing nobody will mind it. */ -#define AMPERSAND_FULL_NAME - -/* `subprocesses' should be defined if you want to - have code for asynchronous subprocesses - (as used in M-x compile and M-x shell). - Only MSDOS does not support this (it overrides - this in its config_opsysfile below). */ - -#define subprocesses - -/* Include the os dependent file. */ -#ifdef config_opsysfile -# include config_opsysfile -#endif - -/* Mac OS X / GNUstep need a bit more pure memory. Of the existing knobs, - SYSTEM_PURESIZE_EXTRA seems like the least likely to cause problems. */ -#ifdef HAVE_NS -#if defined NS_IMPL_GNUSTEP -# define SYSTEM_PURESIZE_EXTRA 30000 -#elif defined DARWIN_OS -# define SYSTEM_PURESIZE_EXTRA 200000 -#endif -#endif - -#ifdef emacs /* Don't do this for lib-src. */ -/* Tell regex.c to use a type compatible with Emacs. */ -#define RE_TRANSLATE_TYPE Lisp_Object -#define RE_TRANSLATE(TBL, C) CHAR_TABLE_TRANSLATE (TBL, C) -#ifdef make_number -/* If make_number is a macro, use it. */ -#define RE_TRANSLATE_P(TBL) (!EQ (TBL, make_number (0))) -#else -/* If make_number is a function, avoid it. */ -#define RE_TRANSLATE_P(TBL) (!(INTEGERP (TBL) && XINT (TBL) == 0)) -#endif -#endif - -#include -#include - -#if __GNUC__ >= 3 /* On GCC 3.0 we might get a warning. */ -#define NO_INLINE __attribute__((noinline)) -#else -#define NO_INLINE -#endif - -#if (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 1)) -#define EXTERNALLY_VISIBLE __attribute__((externally_visible)) -#else -#define EXTERNALLY_VISIBLE -#endif - -#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 7) -# define ATTRIBUTE_FORMAT(spec) __attribute__ ((__format__ spec)) -#else -# define ATTRIBUTE_FORMAT(spec) /* empty */ -#endif - -#if __GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 4) -# define ATTRIBUTE_FORMAT_PRINTF(formatstring_parameter, first_argument) \ - ATTRIBUTE_FORMAT ((__gnu_printf__, formatstring_parameter, first_argument)) -#else -# define ATTRIBUTE_FORMAT_PRINTF(formatstring_parameter, first_argument) \ - ATTRIBUTE_FORMAT ((__printf__, formatstring_parameter, first_argument)) -#endif - -#define ATTRIBUTE_CONST _GL_ATTRIBUTE_CONST - -/* Some versions of GNU/Linux define noinline in their headers. */ -#ifdef noinline -#undef noinline -#endif +AH_BOTTOM([#include #endif /* EMACS_CONFIG_H */ diff --git a/src/ChangeLog b/src/ChangeLog index a7e6cb52eae..f3e8b58e071 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,9 @@ +2012-07-30 Glenn Morris + + * conf_post.h: New, split from configure.ac's AH_BOTTOM. + * Makefile.in (config_h): Add conf_post.h. + * makefile.w32-in (CONFIG_H): Add conf_post.h. + 2012-07-30 Jan Djärv * nsterm.m (ns_do_open_file): New variable. diff --git a/src/Makefile.in b/src/Makefile.in index 2f96affeb56..1ea7d162b14 100644 --- a/src/Makefile.in +++ b/src/Makefile.in @@ -57,7 +57,7 @@ lispdir = ../lisp # Configuration files for .o files to depend on. S_FILE = @S_FILE@ -config_h = config.h $(S_FILE) +config_h = config.h conf_post.h $(S_FILE) bootstrap_exe = $(abs_builddir)/bootstrap-emacs$(EXEEXT) diff --git a/src/conf_post.h b/src/conf_post.h new file mode 100644 index 00000000000..5efecfb8c05 --- /dev/null +++ b/src/conf_post.h @@ -0,0 +1,131 @@ +/* conf_post.h --- configure.ac includes this via AH_BOTTOM + +Copyright (C) 1988, 1993-1994, 1999-2002, 2004-2012 + Free Software Foundation, Inc. + +This file is part of GNU Emacs. + +GNU Emacs 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 Emacs 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 GNU Emacs. If not, see . */ + +/* Commentary: + + Rather than writing this code directly in AH_BOTTOM, we include it + via this file. This is so that it does not get processed by + autoheader. Eg, any undefs here would otherwise be commented out. +*/ + +/* Code: */ + +/* On AIX 3 this must be included before any other include file. */ +#include +#if ! HAVE_ALLOCA +# error "alloca not available on this machine" +#endif + +#ifdef SIGNAL_H_AHB +#undef SIGNAL_H_AHB +#include +#endif + +/* This silences a few compilation warnings on FreeBSD. */ +#ifdef BSD_SYSTEM_AHB +#undef BSD_SYSTEM_AHB +#undef BSD_SYSTEM +#if __FreeBSD__ == 1 +#define BSD_SYSTEM 199103 +#elif __FreeBSD__ == 2 +#define BSD_SYSTEM 199306 +#elif __FreeBSD__ >= 3 +#define BSD_SYSTEM 199506 +#endif +#endif + +/* Define AMPERSAND_FULL_NAME if you use the convention + that & in the full name stands for the login id. */ +/* Turned on June 1996 supposing nobody will mind it. */ +#define AMPERSAND_FULL_NAME + +/* `subprocesses' should be defined if you want to + have code for asynchronous subprocesses + (as used in M-x compile and M-x shell). + Only MSDOS does not support this (it overrides + this in its config_opsysfile below). */ + +#define subprocesses + +/* Include the os dependent file. */ +#ifdef config_opsysfile +# include config_opsysfile +#endif + +/* Mac OS X / GNUstep need a bit more pure memory. Of the existing knobs, + SYSTEM_PURESIZE_EXTRA seems like the least likely to cause problems. */ +#ifdef HAVE_NS +#if defined NS_IMPL_GNUSTEP +# define SYSTEM_PURESIZE_EXTRA 30000 +#elif defined DARWIN_OS +# define SYSTEM_PURESIZE_EXTRA 200000 +#endif +#endif + +#ifdef emacs /* Don't do this for lib-src. */ +/* Tell regex.c to use a type compatible with Emacs. */ +#define RE_TRANSLATE_TYPE Lisp_Object +#define RE_TRANSLATE(TBL, C) CHAR_TABLE_TRANSLATE (TBL, C) +#ifdef make_number +/* If make_number is a macro, use it. */ +#define RE_TRANSLATE_P(TBL) (!EQ (TBL, make_number (0))) +#else +/* If make_number is a function, avoid it. */ +#define RE_TRANSLATE_P(TBL) (!(INTEGERP (TBL) && XINT (TBL) == 0)) +#endif +#endif + +#include +#include + +#if __GNUC__ >= 3 /* On GCC 3.0 we might get a warning. */ +#define NO_INLINE __attribute__((noinline)) +#else +#define NO_INLINE +#endif + +#if (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 1)) +#define EXTERNALLY_VISIBLE __attribute__((externally_visible)) +#else +#define EXTERNALLY_VISIBLE +#endif + +#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 7) +# define ATTRIBUTE_FORMAT(spec) __attribute__ ((__format__ spec)) +#else +# define ATTRIBUTE_FORMAT(spec) /* empty */ +#endif + +#if __GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 4) +# define ATTRIBUTE_FORMAT_PRINTF(formatstring_parameter, first_argument) \ + ATTRIBUTE_FORMAT ((__gnu_printf__, formatstring_parameter, first_argument)) +#else +# define ATTRIBUTE_FORMAT_PRINTF(formatstring_parameter, first_argument) \ + ATTRIBUTE_FORMAT ((__printf__, formatstring_parameter, first_argument)) +#endif + +#define ATTRIBUTE_CONST _GL_ATTRIBUTE_CONST + +/* Some versions of GNU/Linux define noinline in their headers. */ +#ifdef noinline +#undef noinline +#endif + +/* conf_post.h ends here */ diff --git a/src/makefile.w32-in b/src/makefile.w32-in index 45972db2cf4..10ab0619fb4 100644 --- a/src/makefile.w32-in +++ b/src/makefile.w32-in @@ -406,6 +406,7 @@ CODING_H = $(SRC)/coding.h \ MS_W32_H = $(SRC)/s/ms-w32.h \ $(NT_INC)/sys/stat.h CONFIG_H = $(SRC)/config.h \ + $(SRC)/conf_post.h \ $(MS_W32_H) DIR_H = $(NT_INC)/sys/dir.h \ $(SRC)/ndir.h -- 2.39.2