aboutsummaryrefslogtreecommitdiffstats
path: root/m4
diff options
context:
space:
mode:
authorKenichi Handa2012-08-16 21:25:17 +0900
committerKenichi Handa2012-08-16 21:25:17 +0900
commitd75ffb4ed0b2e72a9361a07d16a5c884a9459728 (patch)
tree8ac5a6a8ae033fef7fbc7fb7b09a703ef4b0ed5b /m4
parent69c41c4070c86baac11a627e9c3d366420aeb7cc (diff)
parent250c8ab9b8f6322959fa3122db83944c30c3894b (diff)
downloademacs-d75ffb4ed0b2e72a9361a07d16a5c884a9459728.tar.gz
emacs-d75ffb4ed0b2e72a9361a07d16a5c884a9459728.zip
merge trunk
Diffstat (limited to 'm4')
-rw-r--r--m4/environ.m447
-rw-r--r--m4/extern-inline.m441
-rw-r--r--m4/gnulib-comp.m411
3 files changed, 98 insertions, 1 deletions
diff --git a/m4/environ.m4 b/m4/environ.m4
new file mode 100644
index 00000000000..8eb57c9d999
--- /dev/null
+++ b/m4/environ.m4
@@ -0,0 +1,47 @@
1# environ.m4 serial 6
2dnl Copyright (C) 2001-2004, 2006-2012 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
7AC_DEFUN_ONCE([gl_ENVIRON],
8[
9 AC_REQUIRE([gl_UNISTD_H_DEFAULTS])
10 dnl Persuade glibc <unistd.h> to declare environ.
11 AC_REQUIRE([gl_USE_SYSTEM_EXTENSIONS])
12
13 AC_CHECK_HEADERS_ONCE([unistd.h])
14 gt_CHECK_VAR_DECL(
15 [#if HAVE_UNISTD_H
16 #include <unistd.h>
17 #endif
18 /* mingw, BeOS, Haiku declare environ in <stdlib.h>, not in <unistd.h>. */
19 #include <stdlib.h>
20 ],
21 [environ])
22 if test $gt_cv_var_environ_declaration != yes; then
23 HAVE_DECL_ENVIRON=0
24 fi
25])
26
27# Check if a variable is properly declared.
28# gt_CHECK_VAR_DECL(includes,variable)
29AC_DEFUN([gt_CHECK_VAR_DECL],
30[
31 define([gt_cv_var], [gt_cv_var_]$2[_declaration])
32 AC_MSG_CHECKING([if $2 is properly declared])
33 AC_CACHE_VAL([gt_cv_var], [
34 AC_COMPILE_IFELSE(
35 [AC_LANG_PROGRAM(
36 [[$1
37 extern struct { int foo; } $2;]],
38 [[$2.foo = 1;]])],
39 [gt_cv_var=no],
40 [gt_cv_var=yes])])
41 AC_MSG_RESULT([$gt_cv_var])
42 if test $gt_cv_var = yes; then
43 AC_DEFINE([HAVE_]m4_translit($2, [a-z], [A-Z])[_DECL], 1,
44 [Define if you have the declaration of $2.])
45 fi
46 undefine([gt_cv_var])
47])
diff --git a/m4/extern-inline.m4 b/m4/extern-inline.m4
new file mode 100644
index 00000000000..187a33599a3
--- /dev/null
+++ b/m4/extern-inline.m4
@@ -0,0 +1,41 @@
1dnl 'extern inline' a la ISO C99.
2
3dnl Copyright 2012 Free Software Foundation, Inc.
4dnl This file is free software; the Free Software Foundation
5dnl gives unlimited permission to copy and/or distribute it,
6dnl with or without modifications, as long as this notice is preserved.
7
8AC_DEFUN([gl_EXTERN_INLINE],
9[
10 AC_REQUIRE([AC_C_INLINE])
11 AH_VERBATIM([extern_inline],
12[/* _GL_INLINE is a portable alternative to ISO C99 plain 'inline'.
13 _GL_EXTERN_INLINE is a portable alternative to 'extern inline'.
14 _GL_INLINE_HEADER_BEGIN contains useful stuff to put
15 in an include file, before uses of _GL_INLINE.
16 It suppresses GCC's bogus "no previous prototype for 'FOO'" diagnostic,
17 when FOO is an inline function in the header; see
18 <http://gcc.gnu.org/bugzilla/show_bug.cgi?id=54113>.
19 _GL_INLINE_HEADER_END contains useful stuff to put
20 in the same include file, after uses of _GL_INLINE. */
21#if __GNUC__ ? __GNUC_STDC_INLINE__ : 199901L <= __STDC_VERSION__
22# define _GL_INLINE inline
23# define _GL_EXTERN_INLINE extern inline
24# if (__GNUC__ == 4 && 6 <= __GNUC_MINOR__) || 4 < __GNUC__
25# define _GL_INLINE_HEADER_BEGIN \
26 _Pragma ("GCC diagnostic push") \
27 _Pragma ("GCC diagnostic ignored \"-Wmissing-prototypes\"") \
28 _Pragma ("GCC diagnostic ignored \"-Wmissing-declarations\"")
29# define _GL_INLINE_HEADER_END \
30 _Pragma ("GCC diagnostic pop")
31# endif
32#else
33# define _GL_INLINE static inline
34# define _GL_EXTERN_INLINE static inline
35#endif
36
37#ifndef _GL_INLINE_HEADER_BEGIN
38# define _GL_INLINE_HEADER_BEGIN
39# define _GL_INLINE_HEADER_END
40#endif])
41])
diff --git a/m4/gnulib-comp.m4 b/m4/gnulib-comp.m4
index 754086ec2e7..c4deb8d42fb 100644
--- a/m4/gnulib-comp.m4
+++ b/m4/gnulib-comp.m4
@@ -52,8 +52,10 @@ AC_DEFUN([gl_EARLY],
52 # Code from module dtoastr: 52 # Code from module dtoastr:
53 # Code from module dtotimespec: 53 # Code from module dtotimespec:
54 # Code from module dup2: 54 # Code from module dup2:
55 # Code from module environ:
55 # Code from module extensions: 56 # Code from module extensions:
56 AC_REQUIRE([gl_USE_SYSTEM_EXTENSIONS]) 57 AC_REQUIRE([gl_USE_SYSTEM_EXTENSIONS])
58 # Code from module extern-inline:
57 # Code from module filemode: 59 # Code from module filemode:
58 # Code from module getloadavg: 60 # Code from module getloadavg:
59 # Code from module getopt-gnu: 61 # Code from module getopt-gnu:
@@ -148,6 +150,9 @@ if test $HAVE_DUP2 = 0 || test $REPLACE_DUP2 = 1; then
148 gl_PREREQ_DUP2 150 gl_PREREQ_DUP2
149fi 151fi
150gl_UNISTD_MODULE_INDICATOR([dup2]) 152gl_UNISTD_MODULE_INDICATOR([dup2])
153gl_ENVIRON
154gl_UNISTD_MODULE_INDICATOR([environ])
155AC_REQUIRE([gl_EXTERN_INLINE])
151gl_FILEMODE 156gl_FILEMODE
152gl_GETLOADAVG 157gl_GETLOADAVG
153if test $HAVE_GETLOADAVG = 0; then 158if test $HAVE_GETLOADAVG = 0; then
@@ -258,7 +263,6 @@ if test $HAVE_LOCALTIME_R = 0 || test $REPLACE_LOCALTIME_R = 1; then
258fi 263fi
259gl_TIME_MODULE_INDICATOR([time_r]) 264gl_TIME_MODULE_INDICATOR([time_r])
260gl_TIMESPEC 265gl_TIMESPEC
261AC_REQUIRE([AC_C_INLINE])
262gl_UNISTD_H 266gl_UNISTD_H
263gl_UTIMENS 267gl_UTIMENS
264 gl_gnulib_enabled_dosname=false 268 gl_gnulib_enabled_dosname=false
@@ -562,6 +566,7 @@ AC_DEFUN([gl_FILE_LIST], [
562 lib/sha512.c 566 lib/sha512.c
563 lib/sha512.h 567 lib/sha512.h
564 lib/signal.in.h 568 lib/signal.in.h
569 lib/stat-time.c
565 lib/stat-time.h 570 lib/stat-time.h
566 lib/stat.c 571 lib/stat.c
567 lib/stdalign.in.h 572 lib/stdalign.in.h
@@ -587,7 +592,9 @@ AC_DEFUN([gl_FILE_LIST], [
587 lib/time_r.c 592 lib/time_r.c
588 lib/timespec-add.c 593 lib/timespec-add.c
589 lib/timespec-sub.c 594 lib/timespec-sub.c
595 lib/timespec.c
590 lib/timespec.h 596 lib/timespec.h
597 lib/u64.c
591 lib/u64.h 598 lib/u64.h
592 lib/unistd.in.h 599 lib/unistd.in.h
593 lib/utimens.c 600 lib/utimens.c
@@ -598,7 +605,9 @@ AC_DEFUN([gl_FILE_LIST], [
598 m4/c-strtod.m4 605 m4/c-strtod.m4
599 m4/clock_time.m4 606 m4/clock_time.m4
600 m4/dup2.m4 607 m4/dup2.m4
608 m4/environ.m4
601 m4/extensions.m4 609 m4/extensions.m4
610 m4/extern-inline.m4
602 m4/filemode.m4 611 m4/filemode.m4
603 m4/getloadavg.m4 612 m4/getloadavg.m4
604 m4/getopt.m4 613 m4/getopt.m4