aboutsummaryrefslogtreecommitdiffstats
path: root/m4
diff options
context:
space:
mode:
authorPaul Eggert2011-01-23 20:53:39 -0800
committerPaul Eggert2011-01-23 20:53:39 -0800
commitd6974efa708eff7adf1768aa6a792a12d7dfbb7b (patch)
treea39eba95a3448eb567453c24c84ed90461040d42 /m4
parent8ab7032073626f5153c4a42f6ecb4697efc80b8b (diff)
downloademacs-d6974efa708eff7adf1768aa6a792a12d7dfbb7b.tar.gz
emacs-d6974efa708eff7adf1768aa6a792a12d7dfbb7b.zip
Remove HAVE_RAW_DECL_CHOWN etc. from config.h
Diffstat (limited to 'm4')
-rw-r--r--m4/getopt.m445
-rw-r--r--m4/gnulib-common.m412
-rw-r--r--m4/warn-on-use.m445
3 files changed, 35 insertions, 67 deletions
diff --git a/m4/getopt.m4 b/m4/getopt.m4
index d351b842be3..035a530df2d 100644
--- a/m4/getopt.m4
+++ b/m4/getopt.m4
@@ -1,4 +1,4 @@
1# getopt.m4 serial 33 1# getopt.m4 serial 34
2dnl Copyright (C) 2002-2006, 2008-2011 Free Software Foundation, Inc. 2dnl Copyright (C) 2002-2006, 2008-2011 Free Software Foundation, Inc.
3dnl This file is free software; the Free Software Foundation 3dnl This file is free software; the Free Software Foundation
4dnl gives unlimited permission to copy and/or distribute it, 4dnl gives unlimited permission to copy and/or distribute it,
@@ -75,20 +75,6 @@ AC_DEFUN([gl_GETOPT_CHECK_HEADERS],
75 AC_CHECK_FUNCS([getopt_long_only], [], [gl_replace_getopt=yes]) 75 AC_CHECK_FUNCS([getopt_long_only], [], [gl_replace_getopt=yes])
76 fi 76 fi
77 77
78 dnl BSD getopt_long uses an incompatible method to reset option processing.
79 dnl Existence of the variable, in and of itself, is not a reason to replace
80 dnl getopt, but knowledge of the variable is needed to determine how to
81 dnl reset and whether a reset reparses the environment.
82 dnl Solaris supports neither optreset nor optind=0, but keeps no state that
83 dnl needs a reset beyond setting optind=1; detect Solaris by getopt_clip.
84 if test -z "$gl_replace_getopt"; then
85 AC_CHECK_DECLS([optreset], [],
86 [AC_CHECK_DECLS([getopt_clip], [], [],
87 [[#include <getopt.h>]])
88 ],
89 [[#include <getopt.h>]])
90 fi
91
92 dnl mingw's getopt (in libmingwex.a) does weird things when the options 78 dnl mingw's getopt (in libmingwex.a) does weird things when the options
93 dnl strings starts with '+' and it's not the first call. Some internal state 79 dnl strings starts with '+' and it's not the first call. Some internal state
94 dnl is left over from earlier calls, and neither setting optind = 0 nor 80 dnl is left over from earlier calls, and neither setting optind = 0 nor
@@ -102,18 +88,34 @@ AC_DEFUN([gl_GETOPT_CHECK_HEADERS],
102 AC_CACHE_CHECK([whether getopt is POSIX compatible], 88 AC_CACHE_CHECK([whether getopt is POSIX compatible],
103 [gl_cv_func_getopt_posix], 89 [gl_cv_func_getopt_posix],
104 [ 90 [
91 dnl BSD getopt_long uses an incompatible method to reset
92 dnl option processing. Existence of the variable, in and of
93 dnl itself, is not a reason to replace getopt, but knowledge
94 dnl of the variable is needed to determine how to reset and
95 dnl whether a reset reparses the environment. Solaris
96 dnl supports neither optreset nor optind=0, but keeps no state
97 dnl that needs a reset beyond setting optind=1; detect Solaris
98 dnl by getopt_clip.
99 AC_COMPILE_IFELSE(
100 [AC_LANG_PROGRAM(
101 [[#include <unistd.h>]],
102 [[int *p = &optreset; return optreset;]])],
103 [gl_optind_min=1],
104 [AC_COMPILE_IFELSE(
105 [AC_LANG_PROGRAM(
106 [[#include <getopt.h>]],
107 [[return !getopt_clip;]])],
108 [gl_optind_min=1],
109 [gl_optind_min=0])])
110
105 dnl This test fails on mingw and succeeds on many other platforms. 111 dnl This test fails on mingw and succeeds on many other platforms.
112 gl_save_CPPFLAGS=$CPPFLAGS
113 CPPFLAGS="$CPPFLAGS -DOPTIND_MIN=$gl_optind_min"
106 AC_RUN_IFELSE([AC_LANG_SOURCE([[ 114 AC_RUN_IFELSE([AC_LANG_SOURCE([[
107#include <unistd.h> 115#include <unistd.h>
108#include <stdlib.h> 116#include <stdlib.h>
109#include <string.h> 117#include <string.h>
110 118
111#if !HAVE_DECL_OPTRESET && !HAVE_DECL_GETOPT_CLIP
112# define OPTIND_MIN 0
113#else
114# define OPTIND_MIN 1
115#endif
116
117int 119int
118main () 120main ()
119{ 121{
@@ -201,6 +203,7 @@ main ()
201 *) gl_cv_func_getopt_posix="guessing yes";; 203 *) gl_cv_func_getopt_posix="guessing yes";;
202 esac 204 esac
203 ]) 205 ])
206 CPPFLAGS=$gl_save_CPPFLAGS
204 ]) 207 ])
205 case "$gl_cv_func_getopt_posix" in 208 case "$gl_cv_func_getopt_posix" in
206 *no) gl_replace_getopt=yes ;; 209 *no) gl_replace_getopt=yes ;;
diff --git a/m4/gnulib-common.m4 b/m4/gnulib-common.m4
index c4f41f180ba..ecbf33694e2 100644
--- a/m4/gnulib-common.m4
+++ b/m4/gnulib-common.m4
@@ -1,4 +1,4 @@
1# gnulib-common.m4 serial 22 1# gnulib-common.m4 serial 23
2dnl Copyright (C) 2007-2011 Free Software Foundation, Inc. 2dnl Copyright (C) 2007-2011 Free Software Foundation, Inc.
3dnl This file is free software; the Free Software Foundation 3dnl This file is free software; the Free Software Foundation
4dnl gives unlimited permission to copy and/or distribute it, 4dnl gives unlimited permission to copy and/or distribute it,
@@ -102,6 +102,16 @@ AC_DEFUN([gl_MODULE_INDICATOR_FOR_TESTS],
102 [Define to 1 when the gnulib module $1 should be tested.]) 102 [Define to 1 when the gnulib module $1 should be tested.])
103]) 103])
104 104
105# gl_ASSERT_NO_GNULIB_POSIXCHECK
106# asserts that there will never be a need to #define GNULIB_POSIXCHECK.
107# and thereby enables an optimization of configure and config.h.
108# Used by Emacs.
109AC_DEFUN([gl_ASSERT_NO_GNULIB_POSIXCHECK],
110[
111 dnl Override gl_WARN_ON_USE_PREPARE.
112 AC_DEFUN([gl_WARN_ON_USE_PREPARE], [])
113])
114
105# gl_ASSERT_NO_GNULIB_TESTS 115# gl_ASSERT_NO_GNULIB_TESTS
106# asserts that there will be no gnulib tests in the scope of the configure.ac 116# asserts that there will be no gnulib tests in the scope of the configure.ac
107# and thereby enables an optimization of config.h. 117# and thereby enables an optimization of config.h.
diff --git a/m4/warn-on-use.m4 b/m4/warn-on-use.m4
deleted file mode 100644
index e0d0f276403..00000000000
--- a/m4/warn-on-use.m4
+++ /dev/null
@@ -1,45 +0,0 @@
1# warn-on-use.m4 serial 2
2dnl Copyright (C) 2010-2011 Free Software Foundation, Inc.
3dnl This file is free software; the Free Software Foundation
4dnl gives unlimited permission to copy and/or distribute it,
5dnl with or without modifications, as long as this notice is preserved.
6
7# gl_WARN_ON_USE_PREPARE(INCLUDES, NAMES)
8# ---------------------------------------
9# For each whitespace-separated element in the list of NAMES, define
10# HAVE_RAW_DECL_name if the function has a declaration among INCLUDES
11# even after being undefined as a macro.
12#
13# See warn-on-use.h for some hints on how to poison function names, as
14# well as ideas on poisoning global variables and macros. NAMES may
15# include global variables, but remember that only functions work with
16# _GL_WARN_ON_USE. Typically, INCLUDES only needs to list a single
17# header, but if the replacement header pulls in other headers because
18# some systems declare functions in the wrong header, then INCLUDES
19# should do likewise.
20#
21# If you assume C89, then it is generally safe to assume declarations
22# for functions declared in that standard (such as gets) without
23# needing gl_WARN_ON_USE_PREPARE.
24AC_DEFUN([gl_WARN_ON_USE_PREPARE],
25[
26 m4_foreach_w([gl_decl], [$2],
27 [AH_TEMPLATE([HAVE_RAW_DECL_]AS_TR_CPP(m4_defn([gl_decl])),
28 [Define to 1 if ]m4_defn([gl_decl])[ is declared even after
29 undefining macros.])])dnl
30 for gl_func in m4_flatten([$2]); do
31 AS_VAR_PUSHDEF([gl_Symbol], [gl_cv_have_raw_decl_$gl_func])dnl
32 AC_CACHE_CHECK([whether $gl_func is declared without a macro],
33 gl_Symbol,
34 [AC_COMPILE_IFELSE([AC_LANG_PROGRAM([$1],
35[@%:@undef $gl_func
36 (void) $gl_func;])],
37 [AS_VAR_SET(gl_Symbol, [yes])], [AS_VAR_SET(gl_Symbol, [no])])])
38 AS_VAR_IF(gl_Symbol, [yes],
39 [AC_DEFINE_UNQUOTED(AS_TR_CPP([HAVE_RAW_DECL_$gl_func]), [1])
40 dnl shortcut - if the raw declaration exists, then set a cache
41 dnl variable to allow skipping any later AC_CHECK_DECL efforts
42 eval ac_cv_have_decl_$gl_func=yes])
43 AS_VAR_POPDEF([gl_Symbol])dnl
44 done
45])