Mercurial > gnulib
annotate m4/gnulib-common.m4 @ 13066:fc8c984b0733
Factorize common .m4 code.
author | Bruno Haible <bruno@clisp.org> |
---|---|
date | Sat, 27 Mar 2010 18:38:53 +0100 |
parents | 0ca4a77ffffb |
children | 0e829091f9c0 |
rev | line source |
---|---|
13066
fc8c984b0733
Factorize common .m4 code.
Bruno Haible <bruno@clisp.org>
parents:
12880
diff
changeset
|
1 # gnulib-common.m4 serial 14 |
12559
c2cbabec01dd
update nearly all FSF copyright year lists to include 2010
Jim Meyering <meyering@redhat.com>
parents:
12482
diff
changeset
|
2 dnl Copyright (C) 2007-2010 Free Software Foundation, Inc. |
7788
e3424061171f
Back from an automatic module-indicator macro to a module-indicator macro
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
3 dnl This file is free software; the Free Software Foundation |
e3424061171f
Back from an automatic module-indicator macro to a module-indicator macro
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
4 dnl gives unlimited permission to copy and/or distribute it, |
e3424061171f
Back from an automatic module-indicator macro to a module-indicator macro
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
5 dnl with or without modifications, as long as this notice is preserved. |
e3424061171f
Back from an automatic module-indicator macro to a module-indicator macro
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
6 |
9887
f2408973947f
Fix __GNUC_STDC_INLINE__ predefine with Apple GCC on MacOS X 10.5.
Bruno Haible <bruno@clisp.org>
parents:
9411
diff
changeset
|
7 # gl_COMMON |
f2408973947f
Fix __GNUC_STDC_INLINE__ predefine with Apple GCC on MacOS X 10.5.
Bruno Haible <bruno@clisp.org>
parents:
9411
diff
changeset
|
8 # is expanded unconditionally through gnulib-tool magic. |
f2408973947f
Fix __GNUC_STDC_INLINE__ predefine with Apple GCC on MacOS X 10.5.
Bruno Haible <bruno@clisp.org>
parents:
9411
diff
changeset
|
9 AC_DEFUN([gl_COMMON], [ |
f2408973947f
Fix __GNUC_STDC_INLINE__ predefine with Apple GCC on MacOS X 10.5.
Bruno Haible <bruno@clisp.org>
parents:
9411
diff
changeset
|
10 dnl Use AC_REQUIRE here, so that the code is expanded once only. |
11094
5e937a2f5647
Backport improved autoconf semantics of AC_DEFUN_ONCE.
Eric Blake <ebb9@byu.net>
parents:
11053
diff
changeset
|
11 AC_REQUIRE([gl_00GNULIB]) |
9887
f2408973947f
Fix __GNUC_STDC_INLINE__ predefine with Apple GCC on MacOS X 10.5.
Bruno Haible <bruno@clisp.org>
parents:
9411
diff
changeset
|
12 AC_REQUIRE([gl_COMMON_BODY]) |
f2408973947f
Fix __GNUC_STDC_INLINE__ predefine with Apple GCC on MacOS X 10.5.
Bruno Haible <bruno@clisp.org>
parents:
9411
diff
changeset
|
13 ]) |
f2408973947f
Fix __GNUC_STDC_INLINE__ predefine with Apple GCC on MacOS X 10.5.
Bruno Haible <bruno@clisp.org>
parents:
9411
diff
changeset
|
14 AC_DEFUN([gl_COMMON_BODY], [ |
f2408973947f
Fix __GNUC_STDC_INLINE__ predefine with Apple GCC on MacOS X 10.5.
Bruno Haible <bruno@clisp.org>
parents:
9411
diff
changeset
|
15 AH_VERBATIM([isoc99_inline], |
f2408973947f
Fix __GNUC_STDC_INLINE__ predefine with Apple GCC on MacOS X 10.5.
Bruno Haible <bruno@clisp.org>
parents:
9411
diff
changeset
|
16 [/* Work around a bug in Apple GCC 4.0.1 build 5465: In C99 mode, it supports |
f2408973947f
Fix __GNUC_STDC_INLINE__ predefine with Apple GCC on MacOS X 10.5.
Bruno Haible <bruno@clisp.org>
parents:
9411
diff
changeset
|
17 the ISO C 99 semantics of 'extern inline' (unlike the GNU C semantics of |
f2408973947f
Fix __GNUC_STDC_INLINE__ predefine with Apple GCC on MacOS X 10.5.
Bruno Haible <bruno@clisp.org>
parents:
9411
diff
changeset
|
18 earlier versions), but does not display it by setting __GNUC_STDC_INLINE__. |
f2408973947f
Fix __GNUC_STDC_INLINE__ predefine with Apple GCC on MacOS X 10.5.
Bruno Haible <bruno@clisp.org>
parents:
9411
diff
changeset
|
19 __APPLE__ && __MACH__ test for MacOS X. |
f2408973947f
Fix __GNUC_STDC_INLINE__ predefine with Apple GCC on MacOS X 10.5.
Bruno Haible <bruno@clisp.org>
parents:
9411
diff
changeset
|
20 __APPLE_CC__ tests for the Apple compiler and its version. |
f2408973947f
Fix __GNUC_STDC_INLINE__ predefine with Apple GCC on MacOS X 10.5.
Bruno Haible <bruno@clisp.org>
parents:
9411
diff
changeset
|
21 __STDC_VERSION__ tests for the C99 mode. */ |
f2408973947f
Fix __GNUC_STDC_INLINE__ predefine with Apple GCC on MacOS X 10.5.
Bruno Haible <bruno@clisp.org>
parents:
9411
diff
changeset
|
22 #if defined __APPLE__ && defined __MACH__ && __APPLE_CC__ >= 5465 && !defined __cplusplus && __STDC_VERSION__ >= 199901L && !defined __GNUC_STDC_INLINE__ |
f2408973947f
Fix __GNUC_STDC_INLINE__ predefine with Apple GCC on MacOS X 10.5.
Bruno Haible <bruno@clisp.org>
parents:
9411
diff
changeset
|
23 # define __GNUC_STDC_INLINE__ 1 |
f2408973947f
Fix __GNUC_STDC_INLINE__ predefine with Apple GCC on MacOS X 10.5.
Bruno Haible <bruno@clisp.org>
parents:
9411
diff
changeset
|
24 #endif]) |
10658
a6a1df49f669
Avoid -Wunused-parameter warnings in public gnulib header files.
Bruno Haible <bruno@clisp.org>
parents:
10066
diff
changeset
|
25 AH_VERBATIM([unused_parameter], |
12482
11bc92a9e2bc
gnulib-common: prefer _GL_UNUSED over _UNUSED_PARAMETER_
Eric Blake <ebb9@byu.net>
parents:
12421
diff
changeset
|
26 [/* Define as a marker that can be attached to declarations that might not |
11bc92a9e2bc
gnulib-common: prefer _GL_UNUSED over _UNUSED_PARAMETER_
Eric Blake <ebb9@byu.net>
parents:
12421
diff
changeset
|
27 be used. This helps to reduce warnings, such as from |
11bc92a9e2bc
gnulib-common: prefer _GL_UNUSED over _UNUSED_PARAMETER_
Eric Blake <ebb9@byu.net>
parents:
12421
diff
changeset
|
28 GCC -Wunused-parameter. */ |
10658
a6a1df49f669
Avoid -Wunused-parameter warnings in public gnulib header files.
Bruno Haible <bruno@clisp.org>
parents:
10066
diff
changeset
|
29 #if __GNUC__ >= 3 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 7) |
12482
11bc92a9e2bc
gnulib-common: prefer _GL_UNUSED over _UNUSED_PARAMETER_
Eric Blake <ebb9@byu.net>
parents:
12421
diff
changeset
|
30 # define _GL_UNUSED __attribute__ ((__unused__)) |
10658
a6a1df49f669
Avoid -Wunused-parameter warnings in public gnulib header files.
Bruno Haible <bruno@clisp.org>
parents:
10066
diff
changeset
|
31 #else |
12482
11bc92a9e2bc
gnulib-common: prefer _GL_UNUSED over _UNUSED_PARAMETER_
Eric Blake <ebb9@byu.net>
parents:
12421
diff
changeset
|
32 # define _GL_UNUSED |
10658
a6a1df49f669
Avoid -Wunused-parameter warnings in public gnulib header files.
Bruno Haible <bruno@clisp.org>
parents:
10066
diff
changeset
|
33 #endif |
12482
11bc92a9e2bc
gnulib-common: prefer _GL_UNUSED over _UNUSED_PARAMETER_
Eric Blake <ebb9@byu.net>
parents:
12421
diff
changeset
|
34 /* The name _UNUSED_PARAMETER_ is an earlier spelling, although the name |
11bc92a9e2bc
gnulib-common: prefer _GL_UNUSED over _UNUSED_PARAMETER_
Eric Blake <ebb9@byu.net>
parents:
12421
diff
changeset
|
35 is a misnomer outside of parameter lists. */ |
11bc92a9e2bc
gnulib-common: prefer _GL_UNUSED over _UNUSED_PARAMETER_
Eric Blake <ebb9@byu.net>
parents:
12421
diff
changeset
|
36 #define _UNUSED_PARAMETER_ _GL_UNUSED |
10658
a6a1df49f669
Avoid -Wunused-parameter warnings in public gnulib header files.
Bruno Haible <bruno@clisp.org>
parents:
10066
diff
changeset
|
37 ]) |
9887
f2408973947f
Fix __GNUC_STDC_INLINE__ predefine with Apple GCC on MacOS X 10.5.
Bruno Haible <bruno@clisp.org>
parents:
9411
diff
changeset
|
38 ]) |
f2408973947f
Fix __GNUC_STDC_INLINE__ predefine with Apple GCC on MacOS X 10.5.
Bruno Haible <bruno@clisp.org>
parents:
9411
diff
changeset
|
39 |
13066
fc8c984b0733
Factorize common .m4 code.
Bruno Haible <bruno@clisp.org>
parents:
12880
diff
changeset
|
40 # gl_MODULE_INDICATOR_SET_VARIABLE([modulename]) |
fc8c984b0733
Factorize common .m4 code.
Bruno Haible <bruno@clisp.org>
parents:
12880
diff
changeset
|
41 # sets the shell variable that indicates the presence of the given module to |
fc8c984b0733
Factorize common .m4 code.
Bruno Haible <bruno@clisp.org>
parents:
12880
diff
changeset
|
42 # a C preprocessor expression that will evaluate to 1. |
fc8c984b0733
Factorize common .m4 code.
Bruno Haible <bruno@clisp.org>
parents:
12880
diff
changeset
|
43 AC_DEFUN([gl_MODULE_INDICATOR_SET_VARIABLE], |
fc8c984b0733
Factorize common .m4 code.
Bruno Haible <bruno@clisp.org>
parents:
12880
diff
changeset
|
44 [ |
fc8c984b0733
Factorize common .m4 code.
Bruno Haible <bruno@clisp.org>
parents:
12880
diff
changeset
|
45 GNULIB_[]m4_translit([$1],[abcdefghijklmnopqrstuvwxyz./-],[ABCDEFGHIJKLMNOPQRSTUVWXYZ___])=1 |
fc8c984b0733
Factorize common .m4 code.
Bruno Haible <bruno@clisp.org>
parents:
12880
diff
changeset
|
46 ]) |
fc8c984b0733
Factorize common .m4 code.
Bruno Haible <bruno@clisp.org>
parents:
12880
diff
changeset
|
47 |
7788
e3424061171f
Back from an automatic module-indicator macro to a module-indicator macro
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
48 # gl_MODULE_INDICATOR([modulename]) |
e3424061171f
Back from an automatic module-indicator macro to a module-indicator macro
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
49 # defines a C macro indicating the presence of the given module. |
e3424061171f
Back from an automatic module-indicator macro to a module-indicator macro
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
50 AC_DEFUN([gl_MODULE_INDICATOR], |
e3424061171f
Back from an automatic module-indicator macro to a module-indicator macro
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
51 [ |
e3424061171f
Back from an automatic module-indicator macro to a module-indicator macro
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
52 AC_DEFINE([GNULIB_]translit([$1],[abcdefghijklmnopqrstuvwxyz./-],[ABCDEFGHIJKLMNOPQRSTUVWXYZ___]), [1], |
e3424061171f
Back from an automatic module-indicator macro to a module-indicator macro
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
53 [Define to 1 when using the gnulib module ]$1[.]) |
e3424061171f
Back from an automatic module-indicator macro to a module-indicator macro
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
54 ]) |
7920
53d558c7086d
Add an AC_PROG_MKDIR_P backport.
Bruno Haible <bruno@clisp.org>
parents:
7788
diff
changeset
|
55 |
10066
9a2a9c43db65
Reduce number of forks required during autoconf.
Eric Blake <ebb9@byu.net>
parents:
9887
diff
changeset
|
56 # m4_foreach_w |
9a2a9c43db65
Reduce number of forks required during autoconf.
Eric Blake <ebb9@byu.net>
parents:
9887
diff
changeset
|
57 # is a backport of autoconf-2.59c's m4_foreach_w. |
9a2a9c43db65
Reduce number of forks required during autoconf.
Eric Blake <ebb9@byu.net>
parents:
9887
diff
changeset
|
58 # Remove this macro when we can assume autoconf >= 2.60. |
9a2a9c43db65
Reduce number of forks required during autoconf.
Eric Blake <ebb9@byu.net>
parents:
9887
diff
changeset
|
59 m4_ifndef([m4_foreach_w], |
9a2a9c43db65
Reduce number of forks required during autoconf.
Eric Blake <ebb9@byu.net>
parents:
9887
diff
changeset
|
60 [m4_define([m4_foreach_w], |
9a2a9c43db65
Reduce number of forks required during autoconf.
Eric Blake <ebb9@byu.net>
parents:
9887
diff
changeset
|
61 [m4_foreach([$1], m4_split(m4_normalize([$2]), [ ]), [$3])])]) |
9a2a9c43db65
Reduce number of forks required during autoconf.
Eric Blake <ebb9@byu.net>
parents:
9887
diff
changeset
|
62 |
12735
77cea116e541
build: guarantee AS_VAR_IF
Simon Josefsson <simon@josefsson.org>
parents:
12559
diff
changeset
|
63 # AS_VAR_IF(VAR, VALUE, [IF-MATCH], [IF-NOT-MATCH]) |
77cea116e541
build: guarantee AS_VAR_IF
Simon Josefsson <simon@josefsson.org>
parents:
12559
diff
changeset
|
64 # ---------------------------------------------------- |
77cea116e541
build: guarantee AS_VAR_IF
Simon Josefsson <simon@josefsson.org>
parents:
12559
diff
changeset
|
65 # Backport of autoconf-2.63b's macro. |
77cea116e541
build: guarantee AS_VAR_IF
Simon Josefsson <simon@josefsson.org>
parents:
12559
diff
changeset
|
66 # Remove this macro when we can assume autoconf >= 2.64. |
77cea116e541
build: guarantee AS_VAR_IF
Simon Josefsson <simon@josefsson.org>
parents:
12559
diff
changeset
|
67 m4_ifndef([AS_VAR_IF], |
77cea116e541
build: guarantee AS_VAR_IF
Simon Josefsson <simon@josefsson.org>
parents:
12559
diff
changeset
|
68 [m4_define([AS_VAR_IF], |
77cea116e541
build: guarantee AS_VAR_IF
Simon Josefsson <simon@josefsson.org>
parents:
12559
diff
changeset
|
69 [AS_IF([test x"AS_VAR_GET([$1])" = x""$2], [$3], [$4])])]) |
77cea116e541
build: guarantee AS_VAR_IF
Simon Josefsson <simon@josefsson.org>
parents:
12559
diff
changeset
|
70 |
7920
53d558c7086d
Add an AC_PROG_MKDIR_P backport.
Bruno Haible <bruno@clisp.org>
parents:
7788
diff
changeset
|
71 # AC_PROG_MKDIR_P |
12880
0ca4a77ffffb
Restore support for automake 1.9.6 with autoconf 2.61.
Bruno Haible <bruno@clisp.org>
parents:
12735
diff
changeset
|
72 # is a backport of autoconf-2.60's AC_PROG_MKDIR_P, with a fix |
0ca4a77ffffb
Restore support for automake 1.9.6 with autoconf 2.61.
Bruno Haible <bruno@clisp.org>
parents:
12735
diff
changeset
|
73 # for interoperability with automake-1.9.6 from autoconf-2.62. |
0ca4a77ffffb
Restore support for automake 1.9.6 with autoconf 2.61.
Bruno Haible <bruno@clisp.org>
parents:
12735
diff
changeset
|
74 # Remove this macro when we can assume autoconf >= 2.62 or |
0ca4a77ffffb
Restore support for automake 1.9.6 with autoconf 2.61.
Bruno Haible <bruno@clisp.org>
parents:
12735
diff
changeset
|
75 # autoconf >= 2.60 && automake >= 1.10. |
0ca4a77ffffb
Restore support for automake 1.9.6 with autoconf 2.61.
Bruno Haible <bruno@clisp.org>
parents:
12735
diff
changeset
|
76 m4_ifdef([AC_PROG_MKDIR_P], [ |
0ca4a77ffffb
Restore support for automake 1.9.6 with autoconf 2.61.
Bruno Haible <bruno@clisp.org>
parents:
12735
diff
changeset
|
77 dnl For automake-1.9.6 && autoconf < 2.62: Ensure MKDIR_P is AC_SUBSTed. |
0ca4a77ffffb
Restore support for automake 1.9.6 with autoconf 2.61.
Bruno Haible <bruno@clisp.org>
parents:
12735
diff
changeset
|
78 m4_define([AC_PROG_MKDIR_P], |
0ca4a77ffffb
Restore support for automake 1.9.6 with autoconf 2.61.
Bruno Haible <bruno@clisp.org>
parents:
12735
diff
changeset
|
79 m4_defn([AC_PROG_MKDIR_P])[ |
0ca4a77ffffb
Restore support for automake 1.9.6 with autoconf 2.61.
Bruno Haible <bruno@clisp.org>
parents:
12735
diff
changeset
|
80 AC_SUBST([MKDIR_P])])], [ |
0ca4a77ffffb
Restore support for automake 1.9.6 with autoconf 2.61.
Bruno Haible <bruno@clisp.org>
parents:
12735
diff
changeset
|
81 dnl For autoconf < 2.60: Backport of AC_PROG_MKDIR_P. |
11105
231dfa4dc2c1
fix more require-before-expand issues
Eric Blake <ebb9@byu.net>
parents:
11094
diff
changeset
|
82 AC_DEFUN_ONCE([AC_PROG_MKDIR_P], |
7920
53d558c7086d
Add an AC_PROG_MKDIR_P backport.
Bruno Haible <bruno@clisp.org>
parents:
7788
diff
changeset
|
83 [AC_REQUIRE([AM_PROG_MKDIR_P])dnl defined by automake |
53d558c7086d
Add an AC_PROG_MKDIR_P backport.
Bruno Haible <bruno@clisp.org>
parents:
7788
diff
changeset
|
84 MKDIR_P='$(mkdir_p)' |
53d558c7086d
Add an AC_PROG_MKDIR_P backport.
Bruno Haible <bruno@clisp.org>
parents:
7788
diff
changeset
|
85 AC_SUBST([MKDIR_P])])]) |
9411
5ea76912f0b5
Borrow an improved version of AC_C_RESTRICT from autoconf.
Bruno Haible <bruno@clisp.org>
parents:
7920
diff
changeset
|
86 |
5ea76912f0b5
Borrow an improved version of AC_C_RESTRICT from autoconf.
Bruno Haible <bruno@clisp.org>
parents:
7920
diff
changeset
|
87 # AC_C_RESTRICT |
5ea76912f0b5
Borrow an improved version of AC_C_RESTRICT from autoconf.
Bruno Haible <bruno@clisp.org>
parents:
7920
diff
changeset
|
88 # This definition overrides the AC_C_RESTRICT macro from autoconf 2.60..2.61, |
5ea76912f0b5
Borrow an improved version of AC_C_RESTRICT from autoconf.
Bruno Haible <bruno@clisp.org>
parents:
7920
diff
changeset
|
89 # so that mixed use of GNU C and GNU C++ and mixed use of Sun C and Sun C++ |
5ea76912f0b5
Borrow an improved version of AC_C_RESTRICT from autoconf.
Bruno Haible <bruno@clisp.org>
parents:
7920
diff
changeset
|
90 # works. |
5ea76912f0b5
Borrow an improved version of AC_C_RESTRICT from autoconf.
Bruno Haible <bruno@clisp.org>
parents:
7920
diff
changeset
|
91 # This definition can be removed once autoconf >= 2.62 can be assumed. |
5ea76912f0b5
Borrow an improved version of AC_C_RESTRICT from autoconf.
Bruno Haible <bruno@clisp.org>
parents:
7920
diff
changeset
|
92 AC_DEFUN([AC_C_RESTRICT], |
11007
f6cba5a556ce
many *.m4 files: improve m4 quoting
Jim Meyering <meyering@redhat.com>
parents:
10658
diff
changeset
|
93 [AC_CACHE_CHECK([for C/C++ restrict keyword], [ac_cv_c_restrict], |
9411
5ea76912f0b5
Borrow an improved version of AC_C_RESTRICT from autoconf.
Bruno Haible <bruno@clisp.org>
parents:
7920
diff
changeset
|
94 [ac_cv_c_restrict=no |
5ea76912f0b5
Borrow an improved version of AC_C_RESTRICT from autoconf.
Bruno Haible <bruno@clisp.org>
parents:
7920
diff
changeset
|
95 # The order here caters to the fact that C++ does not require restrict. |
5ea76912f0b5
Borrow an improved version of AC_C_RESTRICT from autoconf.
Bruno Haible <bruno@clisp.org>
parents:
7920
diff
changeset
|
96 for ac_kw in __restrict __restrict__ _Restrict restrict; do |
5ea76912f0b5
Borrow an improved version of AC_C_RESTRICT from autoconf.
Bruno Haible <bruno@clisp.org>
parents:
7920
diff
changeset
|
97 AC_COMPILE_IFELSE([AC_LANG_PROGRAM( |
5ea76912f0b5
Borrow an improved version of AC_C_RESTRICT from autoconf.
Bruno Haible <bruno@clisp.org>
parents:
7920
diff
changeset
|
98 [[typedef int * int_ptr; |
12421
e8d2c6fc33ad
Use spaces for indentation, not tabs.
Bruno Haible <bruno@clisp.org>
parents:
11229
diff
changeset
|
99 int foo (int_ptr $ac_kw ip) { |
e8d2c6fc33ad
Use spaces for indentation, not tabs.
Bruno Haible <bruno@clisp.org>
parents:
11229
diff
changeset
|
100 return ip[0]; |
9411
5ea76912f0b5
Borrow an improved version of AC_C_RESTRICT from autoconf.
Bruno Haible <bruno@clisp.org>
parents:
7920
diff
changeset
|
101 }]], |
5ea76912f0b5
Borrow an improved version of AC_C_RESTRICT from autoconf.
Bruno Haible <bruno@clisp.org>
parents:
7920
diff
changeset
|
102 [[int s[1]; |
12421
e8d2c6fc33ad
Use spaces for indentation, not tabs.
Bruno Haible <bruno@clisp.org>
parents:
11229
diff
changeset
|
103 int * $ac_kw t = s; |
e8d2c6fc33ad
Use spaces for indentation, not tabs.
Bruno Haible <bruno@clisp.org>
parents:
11229
diff
changeset
|
104 t[0] = 0; |
e8d2c6fc33ad
Use spaces for indentation, not tabs.
Bruno Haible <bruno@clisp.org>
parents:
11229
diff
changeset
|
105 return foo(t)]])], |
9411
5ea76912f0b5
Borrow an improved version of AC_C_RESTRICT from autoconf.
Bruno Haible <bruno@clisp.org>
parents:
7920
diff
changeset
|
106 [ac_cv_c_restrict=$ac_kw]) |
5ea76912f0b5
Borrow an improved version of AC_C_RESTRICT from autoconf.
Bruno Haible <bruno@clisp.org>
parents:
7920
diff
changeset
|
107 test "$ac_cv_c_restrict" != no && break |
5ea76912f0b5
Borrow an improved version of AC_C_RESTRICT from autoconf.
Bruno Haible <bruno@clisp.org>
parents:
7920
diff
changeset
|
108 done |
5ea76912f0b5
Borrow an improved version of AC_C_RESTRICT from autoconf.
Bruno Haible <bruno@clisp.org>
parents:
7920
diff
changeset
|
109 ]) |
5ea76912f0b5
Borrow an improved version of AC_C_RESTRICT from autoconf.
Bruno Haible <bruno@clisp.org>
parents:
7920
diff
changeset
|
110 AH_VERBATIM([restrict], |
5ea76912f0b5
Borrow an improved version of AC_C_RESTRICT from autoconf.
Bruno Haible <bruno@clisp.org>
parents:
7920
diff
changeset
|
111 [/* Define to the equivalent of the C99 'restrict' keyword, or to |
5ea76912f0b5
Borrow an improved version of AC_C_RESTRICT from autoconf.
Bruno Haible <bruno@clisp.org>
parents:
7920
diff
changeset
|
112 nothing if this is not supported. Do not define if restrict is |
5ea76912f0b5
Borrow an improved version of AC_C_RESTRICT from autoconf.
Bruno Haible <bruno@clisp.org>
parents:
7920
diff
changeset
|
113 supported directly. */ |
5ea76912f0b5
Borrow an improved version of AC_C_RESTRICT from autoconf.
Bruno Haible <bruno@clisp.org>
parents:
7920
diff
changeset
|
114 #undef restrict |
5ea76912f0b5
Borrow an improved version of AC_C_RESTRICT from autoconf.
Bruno Haible <bruno@clisp.org>
parents:
7920
diff
changeset
|
115 /* Work around a bug in Sun C++: it does not support _Restrict, even |
5ea76912f0b5
Borrow an improved version of AC_C_RESTRICT from autoconf.
Bruno Haible <bruno@clisp.org>
parents:
7920
diff
changeset
|
116 though the corresponding Sun C compiler does, which causes |
5ea76912f0b5
Borrow an improved version of AC_C_RESTRICT from autoconf.
Bruno Haible <bruno@clisp.org>
parents:
7920
diff
changeset
|
117 "#define restrict _Restrict" in the previous line. Perhaps some future |
5ea76912f0b5
Borrow an improved version of AC_C_RESTRICT from autoconf.
Bruno Haible <bruno@clisp.org>
parents:
7920
diff
changeset
|
118 version of Sun C++ will work with _Restrict; if so, it'll probably |
5ea76912f0b5
Borrow an improved version of AC_C_RESTRICT from autoconf.
Bruno Haible <bruno@clisp.org>
parents:
7920
diff
changeset
|
119 define __RESTRICT, just as Sun C does. */ |
5ea76912f0b5
Borrow an improved version of AC_C_RESTRICT from autoconf.
Bruno Haible <bruno@clisp.org>
parents:
7920
diff
changeset
|
120 #if defined __SUNPRO_CC && !defined __RESTRICT |
5ea76912f0b5
Borrow an improved version of AC_C_RESTRICT from autoconf.
Bruno Haible <bruno@clisp.org>
parents:
7920
diff
changeset
|
121 # define _Restrict |
5ea76912f0b5
Borrow an improved version of AC_C_RESTRICT from autoconf.
Bruno Haible <bruno@clisp.org>
parents:
7920
diff
changeset
|
122 #endif]) |
5ea76912f0b5
Borrow an improved version of AC_C_RESTRICT from autoconf.
Bruno Haible <bruno@clisp.org>
parents:
7920
diff
changeset
|
123 case $ac_cv_c_restrict in |
5ea76912f0b5
Borrow an improved version of AC_C_RESTRICT from autoconf.
Bruno Haible <bruno@clisp.org>
parents:
7920
diff
changeset
|
124 restrict) ;; |
5ea76912f0b5
Borrow an improved version of AC_C_RESTRICT from autoconf.
Bruno Haible <bruno@clisp.org>
parents:
7920
diff
changeset
|
125 no) AC_DEFINE([restrict], []) ;; |
5ea76912f0b5
Borrow an improved version of AC_C_RESTRICT from autoconf.
Bruno Haible <bruno@clisp.org>
parents:
7920
diff
changeset
|
126 *) AC_DEFINE_UNQUOTED([restrict], [$ac_cv_c_restrict]) ;; |
5ea76912f0b5
Borrow an improved version of AC_C_RESTRICT from autoconf.
Bruno Haible <bruno@clisp.org>
parents:
7920
diff
changeset
|
127 esac |
5ea76912f0b5
Borrow an improved version of AC_C_RESTRICT from autoconf.
Bruno Haible <bruno@clisp.org>
parents:
7920
diff
changeset
|
128 ]) |
11053
90ea94356c75
Don't use AC_REQUIRE([AC_C_BIGENDIAN]).
Bruno Haible <bruno@clisp.org>
parents:
11007
diff
changeset
|
129 |
90ea94356c75
Don't use AC_REQUIRE([AC_C_BIGENDIAN]).
Bruno Haible <bruno@clisp.org>
parents:
11007
diff
changeset
|
130 # gl_BIGENDIAN |
90ea94356c75
Don't use AC_REQUIRE([AC_C_BIGENDIAN]).
Bruno Haible <bruno@clisp.org>
parents:
11007
diff
changeset
|
131 # is like AC_C_BIGENDIAN, except that it can be AC_REQUIREd. |
90ea94356c75
Don't use AC_REQUIRE([AC_C_BIGENDIAN]).
Bruno Haible <bruno@clisp.org>
parents:
11007
diff
changeset
|
132 # Note that AC_REQUIRE([AC_C_BIGENDIAN]) does not work reliably because some |
90ea94356c75
Don't use AC_REQUIRE([AC_C_BIGENDIAN]).
Bruno Haible <bruno@clisp.org>
parents:
11007
diff
changeset
|
133 # macros invoke AC_C_BIGENDIAN with arguments. |
90ea94356c75
Don't use AC_REQUIRE([AC_C_BIGENDIAN]).
Bruno Haible <bruno@clisp.org>
parents:
11007
diff
changeset
|
134 AC_DEFUN([gl_BIGENDIAN], |
90ea94356c75
Don't use AC_REQUIRE([AC_C_BIGENDIAN]).
Bruno Haible <bruno@clisp.org>
parents:
11007
diff
changeset
|
135 [ |
90ea94356c75
Don't use AC_REQUIRE([AC_C_BIGENDIAN]).
Bruno Haible <bruno@clisp.org>
parents:
11007
diff
changeset
|
136 AC_C_BIGENDIAN |
90ea94356c75
Don't use AC_REQUIRE([AC_C_BIGENDIAN]).
Bruno Haible <bruno@clisp.org>
parents:
11007
diff
changeset
|
137 ]) |
11229
6dad92faecd1
Avoid spurious "(cached)" in configure output.
Bruno Haible <bruno@clisp.org>
parents:
11105
diff
changeset
|
138 |
6dad92faecd1
Avoid spurious "(cached)" in configure output.
Bruno Haible <bruno@clisp.org>
parents:
11105
diff
changeset
|
139 # gl_CACHE_VAL_SILENT(cache-id, command-to-set-it) |
6dad92faecd1
Avoid spurious "(cached)" in configure output.
Bruno Haible <bruno@clisp.org>
parents:
11105
diff
changeset
|
140 # is like AC_CACHE_VAL(cache-id, command-to-set-it), except that it does not |
6dad92faecd1
Avoid spurious "(cached)" in configure output.
Bruno Haible <bruno@clisp.org>
parents:
11105
diff
changeset
|
141 # output a spurious "(cached)" mark in the midst of other configure output. |
6dad92faecd1
Avoid spurious "(cached)" in configure output.
Bruno Haible <bruno@clisp.org>
parents:
11105
diff
changeset
|
142 # This macro should be used instead of AC_CACHE_VAL when it is not surrounded |
6dad92faecd1
Avoid spurious "(cached)" in configure output.
Bruno Haible <bruno@clisp.org>
parents:
11105
diff
changeset
|
143 # by an AC_MSG_CHECKING/AC_MSG_RESULT pair. |
6dad92faecd1
Avoid spurious "(cached)" in configure output.
Bruno Haible <bruno@clisp.org>
parents:
11105
diff
changeset
|
144 AC_DEFUN([gl_CACHE_VAL_SILENT], |
6dad92faecd1
Avoid spurious "(cached)" in configure output.
Bruno Haible <bruno@clisp.org>
parents:
11105
diff
changeset
|
145 [ |
6dad92faecd1
Avoid spurious "(cached)" in configure output.
Bruno Haible <bruno@clisp.org>
parents:
11105
diff
changeset
|
146 saved_as_echo_n="$as_echo_n" |
6dad92faecd1
Avoid spurious "(cached)" in configure output.
Bruno Haible <bruno@clisp.org>
parents:
11105
diff
changeset
|
147 as_echo_n=':' |
6dad92faecd1
Avoid spurious "(cached)" in configure output.
Bruno Haible <bruno@clisp.org>
parents:
11105
diff
changeset
|
148 AC_CACHE_VAL([$1], [$2]) |
6dad92faecd1
Avoid spurious "(cached)" in configure output.
Bruno Haible <bruno@clisp.org>
parents:
11105
diff
changeset
|
149 as_echo_n="$saved_as_echo_n" |
6dad92faecd1
Avoid spurious "(cached)" in configure output.
Bruno Haible <bruno@clisp.org>
parents:
11105
diff
changeset
|
150 ]) |