Mercurial > gnulib
annotate m4/gnulib-common.m4 @ 18114:e212f9b1ce05
gnulib-common.m4: fix gl_PROG_AR_RANLIB/AM_PROG_AR clash
The gl_PROG_AR_RANLIB (it is always called by gl_EARLY) sets AR
and ARFLAGS variables. Doing this unconditionally could break
later Automake's AM_PROG_AR invocation (at least it's
AC_CHECK_TOOLS call to detect correct 'ar' binary).
Original purpose of the gl_PROG_AR_RANLIB was only to handle the
Amsterdam Compiler Kit, so make the previous code to have effects
only on ACK, and rather automatically call the Automake's
AM_PROG_AR as soon as possible to decide other cases.
References:
http://lists.gnu.org/archive/html/bug-gnulib/2015-07/msg00001.html
* m4/gnulib-common.m4 (gl_PROG_AR_RANLIB): AC_BEFORE AM_PROG_AR.
Set the AR/ARFLAGS to ACK defaults OR call AM_PROG_AR. If neither
is possible, keep setting AR/ARFLAGS to reasonable defaults.
* gnulib-tool (func_import): Put the gl_USE_SYSTEM_EXTENSIONS
right before gl_PROG_AR_RANLIB into gnulib-comp.m4 (if the
'extensions' module is used.
* modules/extensions (configure.ac-early): Remove as this snippet
is added to gnulib-comp.m4 earlier anyway.
author | Pavel Raiskup <praiskup@redhat.com> |
---|---|
date | Fri, 25 Sep 2015 11:25:03 -0700 |
parents | e6e2e554257c |
children | 31b2239ca59c |
rev | line source |
---|---|
17749
228d489fadb5
gnulib-common.m4: port to GCC 4.2.1 and Sun Studio 12 C++
Paul Eggert <eggert@cs.ucla.edu>
parents:
17692
diff
changeset
|
1 # gnulib-common.m4 serial 36 |
17848 | 2 dnl Copyright (C) 2007-2015 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], [ |
15391
af02f1770a6a
* m4/gnulib-common.m4 (gl_COMMON_BODY): Add _Noreturn.
Paul Eggert <eggert@cs.ucla.edu>
parents:
14894
diff
changeset
|
15 AH_VERBATIM([_Noreturn], |
16239
91f53c1e1787
doc: C11 and C++11 are now official
Paul Eggert <eggert@cs.ucla.edu>
parents:
16201
diff
changeset
|
16 [/* The _Noreturn keyword of C11. */ |
16845
1118b1dc4eab
_Noreturn: port config.h to gcc -Wundef
Paul Eggert <eggert@cs.ucla.edu>
parents:
16804
diff
changeset
|
17 #if ! (defined _Noreturn \ |
1118b1dc4eab
_Noreturn: port config.h to gcc -Wundef
Paul Eggert <eggert@cs.ucla.edu>
parents:
16804
diff
changeset
|
18 || (defined __STDC_VERSION__ && 201112 <= __STDC_VERSION__)) |
15411
7b889c2a4a01
_Noreturn: Ignore __STDC_VERSION__; observe _MSC_VER.
Paul Eggert <eggert@cs.ucla.edu>
parents:
15391
diff
changeset
|
19 # if (3 <= __GNUC__ || (__GNUC__ == 2 && 8 <= __GNUC_MINOR__) \ |
15391
af02f1770a6a
* m4/gnulib-common.m4 (gl_COMMON_BODY): Add _Noreturn.
Paul Eggert <eggert@cs.ucla.edu>
parents:
14894
diff
changeset
|
20 || 0x5110 <= __SUNPRO_C) |
af02f1770a6a
* m4/gnulib-common.m4 (gl_COMMON_BODY): Add _Noreturn.
Paul Eggert <eggert@cs.ucla.edu>
parents:
14894
diff
changeset
|
21 # define _Noreturn __attribute__ ((__noreturn__)) |
16115
15d46238c9b0
gnulib-common: Silence warnings against config.h code.
Simon Josefsson <simon@josefsson.org>
parents:
15800
diff
changeset
|
22 # elif defined _MSC_VER && 1200 <= _MSC_VER |
15411
7b889c2a4a01
_Noreturn: Ignore __STDC_VERSION__; observe _MSC_VER.
Paul Eggert <eggert@cs.ucla.edu>
parents:
15391
diff
changeset
|
23 # define _Noreturn __declspec (noreturn) |
15391
af02f1770a6a
* m4/gnulib-common.m4 (gl_COMMON_BODY): Add _Noreturn.
Paul Eggert <eggert@cs.ucla.edu>
parents:
14894
diff
changeset
|
24 # else |
af02f1770a6a
* m4/gnulib-common.m4 (gl_COMMON_BODY): Add _Noreturn.
Paul Eggert <eggert@cs.ucla.edu>
parents:
14894
diff
changeset
|
25 # define _Noreturn |
af02f1770a6a
* m4/gnulib-common.m4 (gl_COMMON_BODY): Add _Noreturn.
Paul Eggert <eggert@cs.ucla.edu>
parents:
14894
diff
changeset
|
26 # endif |
af02f1770a6a
* m4/gnulib-common.m4 (gl_COMMON_BODY): Add _Noreturn.
Paul Eggert <eggert@cs.ucla.edu>
parents:
14894
diff
changeset
|
27 #endif |
af02f1770a6a
* m4/gnulib-common.m4 (gl_COMMON_BODY): Add _Noreturn.
Paul Eggert <eggert@cs.ucla.edu>
parents:
14894
diff
changeset
|
28 ]) |
9887
f2408973947f
Fix __GNUC_STDC_INLINE__ predefine with Apple GCC on MacOS X 10.5.
Bruno Haible <bruno@clisp.org>
parents:
9411
diff
changeset
|
29 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
|
30 [/* 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
|
31 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
|
32 earlier versions), but does not display it by setting __GNUC_STDC_INLINE__. |
16935
498a2211d839
Write "Mac OS X" instead of "MacOS X".
Bruno Haible <bruno@clisp.org>
parents:
16845
diff
changeset
|
33 __APPLE__ && __MACH__ test for Mac OS X. |
9887
f2408973947f
Fix __GNUC_STDC_INLINE__ predefine with Apple GCC on MacOS X 10.5.
Bruno Haible <bruno@clisp.org>
parents:
9411
diff
changeset
|
34 __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
|
35 __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
|
36 #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
|
37 # 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
|
38 #endif]) |
10658
a6a1df49f669
Avoid -Wunused-parameter warnings in public gnulib header files.
Bruno Haible <bruno@clisp.org>
parents:
10066
diff
changeset
|
39 AH_VERBATIM([unused_parameter], |
12482
11bc92a9e2bc
gnulib-common: prefer _GL_UNUSED over _UNUSED_PARAMETER_
Eric Blake <ebb9@byu.net>
parents:
12421
diff
changeset
|
40 [/* 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
|
41 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
|
42 GCC -Wunused-parameter. */ |
10658
a6a1df49f669
Avoid -Wunused-parameter warnings in public gnulib header files.
Bruno Haible <bruno@clisp.org>
parents:
10066
diff
changeset
|
43 #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
|
44 # 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
|
45 #else |
12482
11bc92a9e2bc
gnulib-common: prefer _GL_UNUSED over _UNUSED_PARAMETER_
Eric Blake <ebb9@byu.net>
parents:
12421
diff
changeset
|
46 # define _GL_UNUSED |
10658
a6a1df49f669
Avoid -Wunused-parameter warnings in public gnulib header files.
Bruno Haible <bruno@clisp.org>
parents:
10066
diff
changeset
|
47 #endif |
12482
11bc92a9e2bc
gnulib-common: prefer _GL_UNUSED over _UNUSED_PARAMETER_
Eric Blake <ebb9@byu.net>
parents:
12421
diff
changeset
|
48 /* 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
|
49 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
|
50 #define _UNUSED_PARAMETER_ _GL_UNUSED |
14873
722fb7942bc8
gnulib-common.m4: add _GL_ATTRIBUTE_CONST and _GL_ATTRIBUTE_PURE
Jim Meyering <meyering@redhat.com>
parents:
14515
diff
changeset
|
51 |
17689
0fc09785fa2f
gnulib-common.m4: add _GL_UNUSED_LABEL
Pádraig Brady <P@draigBrady.com>
parents:
17615
diff
changeset
|
52 /* gcc supports the "unused" attribute on possibly unused labels, and |
17692
323b09d5b995
rename: mark a label as potentially unused
Ben Walton <bdwalton@gmail.com>
parents:
17691
diff
changeset
|
53 g++ has since version 4.5. Note to support C++ as well as C, |
323b09d5b995
rename: mark a label as potentially unused
Ben Walton <bdwalton@gmail.com>
parents:
17691
diff
changeset
|
54 _GL_UNUSED_LABEL should be used with a trailing ; */ |
17689
0fc09785fa2f
gnulib-common.m4: add _GL_UNUSED_LABEL
Pádraig Brady <P@draigBrady.com>
parents:
17615
diff
changeset
|
55 #if !defined __cplusplus || __GNUC__ > 4 \ |
0fc09785fa2f
gnulib-common.m4: add _GL_UNUSED_LABEL
Pádraig Brady <P@draigBrady.com>
parents:
17615
diff
changeset
|
56 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 5) |
17691
7d9357b7b5c6
gnulib-common.m4: Fix typo in _GL_UNUSED_LABEL.
Paul Eggert <eggert@cs.ucla.edu>
parents:
17689
diff
changeset
|
57 # define _GL_UNUSED_LABEL _GL_UNUSED |
17689
0fc09785fa2f
gnulib-common.m4: add _GL_UNUSED_LABEL
Pádraig Brady <P@draigBrady.com>
parents:
17615
diff
changeset
|
58 #else |
0fc09785fa2f
gnulib-common.m4: add _GL_UNUSED_LABEL
Pádraig Brady <P@draigBrady.com>
parents:
17615
diff
changeset
|
59 # define _GL_UNUSED_LABEL |
0fc09785fa2f
gnulib-common.m4: add _GL_UNUSED_LABEL
Pádraig Brady <P@draigBrady.com>
parents:
17615
diff
changeset
|
60 #endif |
0fc09785fa2f
gnulib-common.m4: add _GL_UNUSED_LABEL
Pádraig Brady <P@draigBrady.com>
parents:
17615
diff
changeset
|
61 |
14873
722fb7942bc8
gnulib-common.m4: add _GL_ATTRIBUTE_CONST and _GL_ATTRIBUTE_PURE
Jim Meyering <meyering@redhat.com>
parents:
14515
diff
changeset
|
62 /* The __pure__ attribute was added in gcc 2.96. */ |
722fb7942bc8
gnulib-common.m4: add _GL_ATTRIBUTE_CONST and _GL_ATTRIBUTE_PURE
Jim Meyering <meyering@redhat.com>
parents:
14515
diff
changeset
|
63 #if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 96) |
722fb7942bc8
gnulib-common.m4: add _GL_ATTRIBUTE_CONST and _GL_ATTRIBUTE_PURE
Jim Meyering <meyering@redhat.com>
parents:
14515
diff
changeset
|
64 # define _GL_ATTRIBUTE_PURE __attribute__ ((__pure__)) |
722fb7942bc8
gnulib-common.m4: add _GL_ATTRIBUTE_CONST and _GL_ATTRIBUTE_PURE
Jim Meyering <meyering@redhat.com>
parents:
14515
diff
changeset
|
65 #else |
722fb7942bc8
gnulib-common.m4: add _GL_ATTRIBUTE_CONST and _GL_ATTRIBUTE_PURE
Jim Meyering <meyering@redhat.com>
parents:
14515
diff
changeset
|
66 # define _GL_ATTRIBUTE_PURE /* empty */ |
722fb7942bc8
gnulib-common.m4: add _GL_ATTRIBUTE_CONST and _GL_ATTRIBUTE_PURE
Jim Meyering <meyering@redhat.com>
parents:
14515
diff
changeset
|
67 #endif |
722fb7942bc8
gnulib-common.m4: add _GL_ATTRIBUTE_CONST and _GL_ATTRIBUTE_PURE
Jim Meyering <meyering@redhat.com>
parents:
14515
diff
changeset
|
68 |
722fb7942bc8
gnulib-common.m4: add _GL_ATTRIBUTE_CONST and _GL_ATTRIBUTE_PURE
Jim Meyering <meyering@redhat.com>
parents:
14515
diff
changeset
|
69 /* The __const__ attribute was added in gcc 2.95. */ |
722fb7942bc8
gnulib-common.m4: add _GL_ATTRIBUTE_CONST and _GL_ATTRIBUTE_PURE
Jim Meyering <meyering@redhat.com>
parents:
14515
diff
changeset
|
70 #if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 95) |
722fb7942bc8
gnulib-common.m4: add _GL_ATTRIBUTE_CONST and _GL_ATTRIBUTE_PURE
Jim Meyering <meyering@redhat.com>
parents:
14515
diff
changeset
|
71 # define _GL_ATTRIBUTE_CONST __attribute__ ((__const__)) |
722fb7942bc8
gnulib-common.m4: add _GL_ATTRIBUTE_CONST and _GL_ATTRIBUTE_PURE
Jim Meyering <meyering@redhat.com>
parents:
14515
diff
changeset
|
72 #else |
722fb7942bc8
gnulib-common.m4: add _GL_ATTRIBUTE_CONST and _GL_ATTRIBUTE_PURE
Jim Meyering <meyering@redhat.com>
parents:
14515
diff
changeset
|
73 # define _GL_ATTRIBUTE_CONST /* empty */ |
722fb7942bc8
gnulib-common.m4: add _GL_ATTRIBUTE_CONST and _GL_ATTRIBUTE_PURE
Jim Meyering <meyering@redhat.com>
parents:
14515
diff
changeset
|
74 #endif |
10658
a6a1df49f669
Avoid -Wunused-parameter warnings in public gnulib header files.
Bruno Haible <bruno@clisp.org>
parents:
10066
diff
changeset
|
75 ]) |
13274
d87472cc6eec
gnulib-common.m4: make glibc write diagnostics to stderr, not /dev/tty
Jim Meyering <jim@meyering.net>
parents:
13204
diff
changeset
|
76 dnl Preparation for running test programs: |
d87472cc6eec
gnulib-common.m4: make glibc write diagnostics to stderr, not /dev/tty
Jim Meyering <jim@meyering.net>
parents:
13204
diff
changeset
|
77 dnl Tell glibc to write diagnostics from -D_FORTIFY_SOURCE=2 to stderr, not |
d87472cc6eec
gnulib-common.m4: make glibc write diagnostics to stderr, not /dev/tty
Jim Meyering <jim@meyering.net>
parents:
13204
diff
changeset
|
78 dnl to /dev/tty, so they can be redirected to log files. Such diagnostics |
d87472cc6eec
gnulib-common.m4: make glibc write diagnostics to stderr, not /dev/tty
Jim Meyering <jim@meyering.net>
parents:
13204
diff
changeset
|
79 dnl arise e.g., in the macros gl_PRINTF_DIRECTIVE_N, gl_SNPRINTF_DIRECTIVE_N. |
d87472cc6eec
gnulib-common.m4: make glibc write diagnostics to stderr, not /dev/tty
Jim Meyering <jim@meyering.net>
parents:
13204
diff
changeset
|
80 LIBC_FATAL_STDERR_=1 |
d87472cc6eec
gnulib-common.m4: make glibc write diagnostics to stderr, not /dev/tty
Jim Meyering <jim@meyering.net>
parents:
13204
diff
changeset
|
81 export LIBC_FATAL_STDERR_ |
9887
f2408973947f
Fix __GNUC_STDC_INLINE__ predefine with Apple GCC on MacOS X 10.5.
Bruno Haible <bruno@clisp.org>
parents:
9411
diff
changeset
|
82 ]) |
f2408973947f
Fix __GNUC_STDC_INLINE__ predefine with Apple GCC on MacOS X 10.5.
Bruno Haible <bruno@clisp.org>
parents:
9411
diff
changeset
|
83 |
13067
0e829091f9c0
Avoid side effects from tests-related modules on the compilation of lib.
Bruno Haible <bruno@clisp.org>
parents:
13066
diff
changeset
|
84 # gl_MODULE_INDICATOR_CONDITION |
0e829091f9c0
Avoid side effects from tests-related modules on the compilation of lib.
Bruno Haible <bruno@clisp.org>
parents:
13066
diff
changeset
|
85 # expands to a C preprocessor expression that evaluates to 1 or 0, depending |
0e829091f9c0
Avoid side effects from tests-related modules on the compilation of lib.
Bruno Haible <bruno@clisp.org>
parents:
13066
diff
changeset
|
86 # whether a gnulib module that has been requested shall be considered present |
0e829091f9c0
Avoid side effects from tests-related modules on the compilation of lib.
Bruno Haible <bruno@clisp.org>
parents:
13066
diff
changeset
|
87 # or not. |
14894
b22360ddefc4
gnulib-tool: Better isolation between different gnulib-tool invocations.
Bruno Haible <bruno@clisp.org>
parents:
14873
diff
changeset
|
88 m4_define([gl_MODULE_INDICATOR_CONDITION], [1]) |
13067
0e829091f9c0
Avoid side effects from tests-related modules on the compilation of lib.
Bruno Haible <bruno@clisp.org>
parents:
13066
diff
changeset
|
89 |
13066
fc8c984b0733
Factorize common .m4 code.
Bruno Haible <bruno@clisp.org>
parents:
12880
diff
changeset
|
90 # gl_MODULE_INDICATOR_SET_VARIABLE([modulename]) |
fc8c984b0733
Factorize common .m4 code.
Bruno Haible <bruno@clisp.org>
parents:
12880
diff
changeset
|
91 # 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
|
92 # a C preprocessor expression that will evaluate to 1. |
fc8c984b0733
Factorize common .m4 code.
Bruno Haible <bruno@clisp.org>
parents:
12880
diff
changeset
|
93 AC_DEFUN([gl_MODULE_INDICATOR_SET_VARIABLE], |
fc8c984b0733
Factorize common .m4 code.
Bruno Haible <bruno@clisp.org>
parents:
12880
diff
changeset
|
94 [ |
14894
b22360ddefc4
gnulib-tool: Better isolation between different gnulib-tool invocations.
Bruno Haible <bruno@clisp.org>
parents:
14873
diff
changeset
|
95 gl_MODULE_INDICATOR_SET_VARIABLE_AUX( |
b22360ddefc4
gnulib-tool: Better isolation between different gnulib-tool invocations.
Bruno Haible <bruno@clisp.org>
parents:
14873
diff
changeset
|
96 [GNULIB_[]m4_translit([[$1]], |
b22360ddefc4
gnulib-tool: Better isolation between different gnulib-tool invocations.
Bruno Haible <bruno@clisp.org>
parents:
14873
diff
changeset
|
97 [abcdefghijklmnopqrstuvwxyz./-], |
b22360ddefc4
gnulib-tool: Better isolation between different gnulib-tool invocations.
Bruno Haible <bruno@clisp.org>
parents:
14873
diff
changeset
|
98 [ABCDEFGHIJKLMNOPQRSTUVWXYZ___])], |
b22360ddefc4
gnulib-tool: Better isolation between different gnulib-tool invocations.
Bruno Haible <bruno@clisp.org>
parents:
14873
diff
changeset
|
99 [gl_MODULE_INDICATOR_CONDITION]) |
b22360ddefc4
gnulib-tool: Better isolation between different gnulib-tool invocations.
Bruno Haible <bruno@clisp.org>
parents:
14873
diff
changeset
|
100 ]) |
b22360ddefc4
gnulib-tool: Better isolation between different gnulib-tool invocations.
Bruno Haible <bruno@clisp.org>
parents:
14873
diff
changeset
|
101 |
b22360ddefc4
gnulib-tool: Better isolation between different gnulib-tool invocations.
Bruno Haible <bruno@clisp.org>
parents:
14873
diff
changeset
|
102 # gl_MODULE_INDICATOR_SET_VARIABLE_AUX([variable]) |
b22360ddefc4
gnulib-tool: Better isolation between different gnulib-tool invocations.
Bruno Haible <bruno@clisp.org>
parents:
14873
diff
changeset
|
103 # modifies the shell variable to include the gl_MODULE_INDICATOR_CONDITION. |
b22360ddefc4
gnulib-tool: Better isolation between different gnulib-tool invocations.
Bruno Haible <bruno@clisp.org>
parents:
14873
diff
changeset
|
104 # The shell variable's value is a C preprocessor expression that evaluates |
b22360ddefc4
gnulib-tool: Better isolation between different gnulib-tool invocations.
Bruno Haible <bruno@clisp.org>
parents:
14873
diff
changeset
|
105 # to 0 or 1. |
b22360ddefc4
gnulib-tool: Better isolation between different gnulib-tool invocations.
Bruno Haible <bruno@clisp.org>
parents:
14873
diff
changeset
|
106 AC_DEFUN([gl_MODULE_INDICATOR_SET_VARIABLE_AUX], |
b22360ddefc4
gnulib-tool: Better isolation between different gnulib-tool invocations.
Bruno Haible <bruno@clisp.org>
parents:
14873
diff
changeset
|
107 [ |
b22360ddefc4
gnulib-tool: Better isolation between different gnulib-tool invocations.
Bruno Haible <bruno@clisp.org>
parents:
14873
diff
changeset
|
108 m4_if(m4_defn([gl_MODULE_INDICATOR_CONDITION]), [1], |
b22360ddefc4
gnulib-tool: Better isolation between different gnulib-tool invocations.
Bruno Haible <bruno@clisp.org>
parents:
14873
diff
changeset
|
109 [ |
b22360ddefc4
gnulib-tool: Better isolation between different gnulib-tool invocations.
Bruno Haible <bruno@clisp.org>
parents:
14873
diff
changeset
|
110 dnl Simplify the expression VALUE || 1 to 1. |
b22360ddefc4
gnulib-tool: Better isolation between different gnulib-tool invocations.
Bruno Haible <bruno@clisp.org>
parents:
14873
diff
changeset
|
111 $1=1 |
b22360ddefc4
gnulib-tool: Better isolation between different gnulib-tool invocations.
Bruno Haible <bruno@clisp.org>
parents:
14873
diff
changeset
|
112 ], |
b22360ddefc4
gnulib-tool: Better isolation between different gnulib-tool invocations.
Bruno Haible <bruno@clisp.org>
parents:
14873
diff
changeset
|
113 [gl_MODULE_INDICATOR_SET_VARIABLE_AUX_OR([$1], |
b22360ddefc4
gnulib-tool: Better isolation between different gnulib-tool invocations.
Bruno Haible <bruno@clisp.org>
parents:
14873
diff
changeset
|
114 [gl_MODULE_INDICATOR_CONDITION])]) |
b22360ddefc4
gnulib-tool: Better isolation between different gnulib-tool invocations.
Bruno Haible <bruno@clisp.org>
parents:
14873
diff
changeset
|
115 ]) |
b22360ddefc4
gnulib-tool: Better isolation between different gnulib-tool invocations.
Bruno Haible <bruno@clisp.org>
parents:
14873
diff
changeset
|
116 |
b22360ddefc4
gnulib-tool: Better isolation between different gnulib-tool invocations.
Bruno Haible <bruno@clisp.org>
parents:
14873
diff
changeset
|
117 # gl_MODULE_INDICATOR_SET_VARIABLE_AUX_OR([variable], [condition]) |
b22360ddefc4
gnulib-tool: Better isolation between different gnulib-tool invocations.
Bruno Haible <bruno@clisp.org>
parents:
14873
diff
changeset
|
118 # modifies the shell variable to include the given condition. The shell |
b22360ddefc4
gnulib-tool: Better isolation between different gnulib-tool invocations.
Bruno Haible <bruno@clisp.org>
parents:
14873
diff
changeset
|
119 # variable's value is a C preprocessor expression that evaluates to 0 or 1. |
b22360ddefc4
gnulib-tool: Better isolation between different gnulib-tool invocations.
Bruno Haible <bruno@clisp.org>
parents:
14873
diff
changeset
|
120 AC_DEFUN([gl_MODULE_INDICATOR_SET_VARIABLE_AUX_OR], |
b22360ddefc4
gnulib-tool: Better isolation between different gnulib-tool invocations.
Bruno Haible <bruno@clisp.org>
parents:
14873
diff
changeset
|
121 [ |
b22360ddefc4
gnulib-tool: Better isolation between different gnulib-tool invocations.
Bruno Haible <bruno@clisp.org>
parents:
14873
diff
changeset
|
122 dnl Simplify the expression 1 || CONDITION to 1. |
b22360ddefc4
gnulib-tool: Better isolation between different gnulib-tool invocations.
Bruno Haible <bruno@clisp.org>
parents:
14873
diff
changeset
|
123 if test "$[]$1" != 1; then |
b22360ddefc4
gnulib-tool: Better isolation between different gnulib-tool invocations.
Bruno Haible <bruno@clisp.org>
parents:
14873
diff
changeset
|
124 dnl Simplify the expression 0 || CONDITION to CONDITION. |
b22360ddefc4
gnulib-tool: Better isolation between different gnulib-tool invocations.
Bruno Haible <bruno@clisp.org>
parents:
14873
diff
changeset
|
125 if test "$[]$1" = 0; then |
b22360ddefc4
gnulib-tool: Better isolation between different gnulib-tool invocations.
Bruno Haible <bruno@clisp.org>
parents:
14873
diff
changeset
|
126 $1=$2 |
b22360ddefc4
gnulib-tool: Better isolation between different gnulib-tool invocations.
Bruno Haible <bruno@clisp.org>
parents:
14873
diff
changeset
|
127 else |
b22360ddefc4
gnulib-tool: Better isolation between different gnulib-tool invocations.
Bruno Haible <bruno@clisp.org>
parents:
14873
diff
changeset
|
128 $1="($[]$1 || $2)" |
b22360ddefc4
gnulib-tool: Better isolation between different gnulib-tool invocations.
Bruno Haible <bruno@clisp.org>
parents:
14873
diff
changeset
|
129 fi |
b22360ddefc4
gnulib-tool: Better isolation between different gnulib-tool invocations.
Bruno Haible <bruno@clisp.org>
parents:
14873
diff
changeset
|
130 fi |
13066
fc8c984b0733
Factorize common .m4 code.
Bruno Haible <bruno@clisp.org>
parents:
12880
diff
changeset
|
131 ]) |
fc8c984b0733
Factorize common .m4 code.
Bruno Haible <bruno@clisp.org>
parents:
12880
diff
changeset
|
132 |
7788
e3424061171f
Back from an automatic module-indicator macro to a module-indicator macro
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
133 # gl_MODULE_INDICATOR([modulename]) |
13071
b2385e7b332e
Distinguish two kinds of module indicators.
Bruno Haible <bruno@clisp.org>
parents:
13067
diff
changeset
|
134 # defines a C macro indicating the presence of the given module |
b2385e7b332e
Distinguish two kinds of module indicators.
Bruno Haible <bruno@clisp.org>
parents:
13067
diff
changeset
|
135 # in a location where it can be used. |
b2385e7b332e
Distinguish two kinds of module indicators.
Bruno Haible <bruno@clisp.org>
parents:
13067
diff
changeset
|
136 # | Value | Value | |
b2385e7b332e
Distinguish two kinds of module indicators.
Bruno Haible <bruno@clisp.org>
parents:
13067
diff
changeset
|
137 # | in lib/ | in tests/ | |
b2385e7b332e
Distinguish two kinds of module indicators.
Bruno Haible <bruno@clisp.org>
parents:
13067
diff
changeset
|
138 # --------------------------------------------+---------+-----------+ |
b2385e7b332e
Distinguish two kinds of module indicators.
Bruno Haible <bruno@clisp.org>
parents:
13067
diff
changeset
|
139 # Module present among main modules: | 1 | 1 | |
b2385e7b332e
Distinguish two kinds of module indicators.
Bruno Haible <bruno@clisp.org>
parents:
13067
diff
changeset
|
140 # --------------------------------------------+---------+-----------+ |
b2385e7b332e
Distinguish two kinds of module indicators.
Bruno Haible <bruno@clisp.org>
parents:
13067
diff
changeset
|
141 # Module present among tests-related modules: | 0 | 1 | |
b2385e7b332e
Distinguish two kinds of module indicators.
Bruno Haible <bruno@clisp.org>
parents:
13067
diff
changeset
|
142 # --------------------------------------------+---------+-----------+ |
b2385e7b332e
Distinguish two kinds of module indicators.
Bruno Haible <bruno@clisp.org>
parents:
13067
diff
changeset
|
143 # Module not present at all: | 0 | 0 | |
b2385e7b332e
Distinguish two kinds of module indicators.
Bruno Haible <bruno@clisp.org>
parents:
13067
diff
changeset
|
144 # --------------------------------------------+---------+-----------+ |
7788
e3424061171f
Back from an automatic module-indicator macro to a module-indicator macro
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
145 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
|
146 [ |
13096
3e1ae5eb7f94
maint: improve module indicators
Eric Blake <eblake@redhat.com>
parents:
13073
diff
changeset
|
147 AC_DEFINE_UNQUOTED([GNULIB_]m4_translit([[$1]], |
3e1ae5eb7f94
maint: improve module indicators
Eric Blake <eblake@redhat.com>
parents:
13073
diff
changeset
|
148 [abcdefghijklmnopqrstuvwxyz./-], |
3e1ae5eb7f94
maint: improve module indicators
Eric Blake <eblake@redhat.com>
parents:
13073
diff
changeset
|
149 [ABCDEFGHIJKLMNOPQRSTUVWXYZ___]), |
13071
b2385e7b332e
Distinguish two kinds of module indicators.
Bruno Haible <bruno@clisp.org>
parents:
13067
diff
changeset
|
150 [gl_MODULE_INDICATOR_CONDITION], |
13096
3e1ae5eb7f94
maint: improve module indicators
Eric Blake <eblake@redhat.com>
parents:
13073
diff
changeset
|
151 [Define to a C preprocessor expression that evaluates to 1 or 0, |
3e1ae5eb7f94
maint: improve module indicators
Eric Blake <eblake@redhat.com>
parents:
13073
diff
changeset
|
152 depending whether the gnulib module $1 shall be considered present.]) |
13071
b2385e7b332e
Distinguish two kinds of module indicators.
Bruno Haible <bruno@clisp.org>
parents:
13067
diff
changeset
|
153 ]) |
b2385e7b332e
Distinguish two kinds of module indicators.
Bruno Haible <bruno@clisp.org>
parents:
13067
diff
changeset
|
154 |
b2385e7b332e
Distinguish two kinds of module indicators.
Bruno Haible <bruno@clisp.org>
parents:
13067
diff
changeset
|
155 # gl_MODULE_INDICATOR_FOR_TESTS([modulename]) |
b2385e7b332e
Distinguish two kinds of module indicators.
Bruno Haible <bruno@clisp.org>
parents:
13067
diff
changeset
|
156 # defines a C macro indicating the presence of the given module |
b2385e7b332e
Distinguish two kinds of module indicators.
Bruno Haible <bruno@clisp.org>
parents:
13067
diff
changeset
|
157 # in lib or tests. This is useful to determine whether the module |
b2385e7b332e
Distinguish two kinds of module indicators.
Bruno Haible <bruno@clisp.org>
parents:
13067
diff
changeset
|
158 # should be tested. |
b2385e7b332e
Distinguish two kinds of module indicators.
Bruno Haible <bruno@clisp.org>
parents:
13067
diff
changeset
|
159 # | Value | Value | |
b2385e7b332e
Distinguish two kinds of module indicators.
Bruno Haible <bruno@clisp.org>
parents:
13067
diff
changeset
|
160 # | in lib/ | in tests/ | |
b2385e7b332e
Distinguish two kinds of module indicators.
Bruno Haible <bruno@clisp.org>
parents:
13067
diff
changeset
|
161 # --------------------------------------------+---------+-----------+ |
b2385e7b332e
Distinguish two kinds of module indicators.
Bruno Haible <bruno@clisp.org>
parents:
13067
diff
changeset
|
162 # Module present among main modules: | 1 | 1 | |
b2385e7b332e
Distinguish two kinds of module indicators.
Bruno Haible <bruno@clisp.org>
parents:
13067
diff
changeset
|
163 # --------------------------------------------+---------+-----------+ |
b2385e7b332e
Distinguish two kinds of module indicators.
Bruno Haible <bruno@clisp.org>
parents:
13067
diff
changeset
|
164 # Module present among tests-related modules: | 1 | 1 | |
b2385e7b332e
Distinguish two kinds of module indicators.
Bruno Haible <bruno@clisp.org>
parents:
13067
diff
changeset
|
165 # --------------------------------------------+---------+-----------+ |
b2385e7b332e
Distinguish two kinds of module indicators.
Bruno Haible <bruno@clisp.org>
parents:
13067
diff
changeset
|
166 # Module not present at all: | 0 | 0 | |
b2385e7b332e
Distinguish two kinds of module indicators.
Bruno Haible <bruno@clisp.org>
parents:
13067
diff
changeset
|
167 # --------------------------------------------+---------+-----------+ |
b2385e7b332e
Distinguish two kinds of module indicators.
Bruno Haible <bruno@clisp.org>
parents:
13067
diff
changeset
|
168 AC_DEFUN([gl_MODULE_INDICATOR_FOR_TESTS], |
b2385e7b332e
Distinguish two kinds of module indicators.
Bruno Haible <bruno@clisp.org>
parents:
13067
diff
changeset
|
169 [ |
13096
3e1ae5eb7f94
maint: improve module indicators
Eric Blake <eblake@redhat.com>
parents:
13073
diff
changeset
|
170 AC_DEFINE([GNULIB_TEST_]m4_translit([[$1]], |
3e1ae5eb7f94
maint: improve module indicators
Eric Blake <eblake@redhat.com>
parents:
13073
diff
changeset
|
171 [abcdefghijklmnopqrstuvwxyz./-], |
3e1ae5eb7f94
maint: improve module indicators
Eric Blake <eblake@redhat.com>
parents:
13073
diff
changeset
|
172 [ABCDEFGHIJKLMNOPQRSTUVWXYZ___]), [1], |
3e1ae5eb7f94
maint: improve module indicators
Eric Blake <eblake@redhat.com>
parents:
13073
diff
changeset
|
173 [Define to 1 when the gnulib module $1 should be tested.]) |
7788
e3424061171f
Back from an automatic module-indicator macro to a module-indicator macro
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
174 ]) |
7920
53d558c7086d
Add an AC_PROG_MKDIR_P backport.
Bruno Haible <bruno@clisp.org>
parents:
7788
diff
changeset
|
175 |
14221
b2abfb114786
Allow the user to avoid the GNULIB_TEST_* macros.
Paul Eggert <eggert@cs.ucla.edu>
parents:
14188
diff
changeset
|
176 # gl_ASSERT_NO_GNULIB_POSIXCHECK |
b2abfb114786
Allow the user to avoid the GNULIB_TEST_* macros.
Paul Eggert <eggert@cs.ucla.edu>
parents:
14188
diff
changeset
|
177 # asserts that there will never be a need to #define GNULIB_POSIXCHECK. |
b2abfb114786
Allow the user to avoid the GNULIB_TEST_* macros.
Paul Eggert <eggert@cs.ucla.edu>
parents:
14188
diff
changeset
|
178 # and thereby enables an optimization of configure and config.h. |
b2abfb114786
Allow the user to avoid the GNULIB_TEST_* macros.
Paul Eggert <eggert@cs.ucla.edu>
parents:
14188
diff
changeset
|
179 # Used by Emacs. |
b2abfb114786
Allow the user to avoid the GNULIB_TEST_* macros.
Paul Eggert <eggert@cs.ucla.edu>
parents:
14188
diff
changeset
|
180 AC_DEFUN([gl_ASSERT_NO_GNULIB_POSIXCHECK], |
b2abfb114786
Allow the user to avoid the GNULIB_TEST_* macros.
Paul Eggert <eggert@cs.ucla.edu>
parents:
14188
diff
changeset
|
181 [ |
b2abfb114786
Allow the user to avoid the GNULIB_TEST_* macros.
Paul Eggert <eggert@cs.ucla.edu>
parents:
14188
diff
changeset
|
182 dnl Override gl_WARN_ON_USE_PREPARE. |
14515
b2069b8212d0
Fix bug with gl_WARN_ON_USE_PREPARE, introduced on 2011-01-23.
Bruno Haible <bruno@clisp.org>
parents:
14221
diff
changeset
|
183 dnl But hide this definition from 'aclocal'. |
b2069b8212d0
Fix bug with gl_WARN_ON_USE_PREPARE, introduced on 2011-01-23.
Bruno Haible <bruno@clisp.org>
parents:
14221
diff
changeset
|
184 AC_DEFUN([gl_W][ARN_ON_USE_PREPARE], []) |
14221
b2abfb114786
Allow the user to avoid the GNULIB_TEST_* macros.
Paul Eggert <eggert@cs.ucla.edu>
parents:
14188
diff
changeset
|
185 ]) |
b2abfb114786
Allow the user to avoid the GNULIB_TEST_* macros.
Paul Eggert <eggert@cs.ucla.edu>
parents:
14188
diff
changeset
|
186 |
14188
87bb0468d75c
Allow the user to avoid the GNULIB_TEST_* macros.
Bruno Haible <bruno@clisp.org>
parents:
14079
diff
changeset
|
187 # gl_ASSERT_NO_GNULIB_TESTS |
87bb0468d75c
Allow the user to avoid the GNULIB_TEST_* macros.
Bruno Haible <bruno@clisp.org>
parents:
14079
diff
changeset
|
188 # asserts that there will be no gnulib tests in the scope of the configure.ac |
87bb0468d75c
Allow the user to avoid the GNULIB_TEST_* macros.
Bruno Haible <bruno@clisp.org>
parents:
14079
diff
changeset
|
189 # and thereby enables an optimization of config.h. |
87bb0468d75c
Allow the user to avoid the GNULIB_TEST_* macros.
Bruno Haible <bruno@clisp.org>
parents:
14079
diff
changeset
|
190 # Used by Emacs. |
87bb0468d75c
Allow the user to avoid the GNULIB_TEST_* macros.
Bruno Haible <bruno@clisp.org>
parents:
14079
diff
changeset
|
191 AC_DEFUN([gl_ASSERT_NO_GNULIB_TESTS], |
87bb0468d75c
Allow the user to avoid the GNULIB_TEST_* macros.
Bruno Haible <bruno@clisp.org>
parents:
14079
diff
changeset
|
192 [ |
87bb0468d75c
Allow the user to avoid the GNULIB_TEST_* macros.
Bruno Haible <bruno@clisp.org>
parents:
14079
diff
changeset
|
193 dnl Override gl_MODULE_INDICATOR_FOR_TESTS. |
87bb0468d75c
Allow the user to avoid the GNULIB_TEST_* macros.
Bruno Haible <bruno@clisp.org>
parents:
14079
diff
changeset
|
194 AC_DEFUN([gl_MODULE_INDICATOR_FOR_TESTS], []) |
87bb0468d75c
Allow the user to avoid the GNULIB_TEST_* macros.
Bruno Haible <bruno@clisp.org>
parents:
14079
diff
changeset
|
195 ]) |
87bb0468d75c
Allow the user to avoid the GNULIB_TEST_* macros.
Bruno Haible <bruno@clisp.org>
parents:
14079
diff
changeset
|
196 |
13887
ff73aa93842c
Ensure that <features.h> is included before __GLIBC__ is tested.
Bruno Haible <bruno@clisp.org>
parents:
13274
diff
changeset
|
197 # Test whether <features.h> exists. |
ff73aa93842c
Ensure that <features.h> is included before __GLIBC__ is tested.
Bruno Haible <bruno@clisp.org>
parents:
13274
diff
changeset
|
198 # Set HAVE_FEATURES_H. |
ff73aa93842c
Ensure that <features.h> is included before __GLIBC__ is tested.
Bruno Haible <bruno@clisp.org>
parents:
13274
diff
changeset
|
199 AC_DEFUN([gl_FEATURES_H], |
ff73aa93842c
Ensure that <features.h> is included before __GLIBC__ is tested.
Bruno Haible <bruno@clisp.org>
parents:
13274
diff
changeset
|
200 [ |
ff73aa93842c
Ensure that <features.h> is included before __GLIBC__ is tested.
Bruno Haible <bruno@clisp.org>
parents:
13274
diff
changeset
|
201 AC_CHECK_HEADERS_ONCE([features.h]) |
ff73aa93842c
Ensure that <features.h> is included before __GLIBC__ is tested.
Bruno Haible <bruno@clisp.org>
parents:
13274
diff
changeset
|
202 if test $ac_cv_header_features_h = yes; then |
ff73aa93842c
Ensure that <features.h> is included before __GLIBC__ is tested.
Bruno Haible <bruno@clisp.org>
parents:
13274
diff
changeset
|
203 HAVE_FEATURES_H=1 |
ff73aa93842c
Ensure that <features.h> is included before __GLIBC__ is tested.
Bruno Haible <bruno@clisp.org>
parents:
13274
diff
changeset
|
204 else |
ff73aa93842c
Ensure that <features.h> is included before __GLIBC__ is tested.
Bruno Haible <bruno@clisp.org>
parents:
13274
diff
changeset
|
205 HAVE_FEATURES_H=0 |
ff73aa93842c
Ensure that <features.h> is included before __GLIBC__ is tested.
Bruno Haible <bruno@clisp.org>
parents:
13274
diff
changeset
|
206 fi |
ff73aa93842c
Ensure that <features.h> is included before __GLIBC__ is tested.
Bruno Haible <bruno@clisp.org>
parents:
13274
diff
changeset
|
207 AC_SUBST([HAVE_FEATURES_H]) |
ff73aa93842c
Ensure that <features.h> is included before __GLIBC__ is tested.
Bruno Haible <bruno@clisp.org>
parents:
13274
diff
changeset
|
208 ]) |
ff73aa93842c
Ensure that <features.h> is included before __GLIBC__ is tested.
Bruno Haible <bruno@clisp.org>
parents:
13274
diff
changeset
|
209 |
10066
9a2a9c43db65
Reduce number of forks required during autoconf.
Eric Blake <ebb9@byu.net>
parents:
9887
diff
changeset
|
210 # m4_foreach_w |
9a2a9c43db65
Reduce number of forks required during autoconf.
Eric Blake <ebb9@byu.net>
parents:
9887
diff
changeset
|
211 # 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
|
212 # 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
|
213 m4_ifndef([m4_foreach_w], |
9a2a9c43db65
Reduce number of forks required during autoconf.
Eric Blake <ebb9@byu.net>
parents:
9887
diff
changeset
|
214 [m4_define([m4_foreach_w], |
9a2a9c43db65
Reduce number of forks required during autoconf.
Eric Blake <ebb9@byu.net>
parents:
9887
diff
changeset
|
215 [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
|
216 |
12735
77cea116e541
build: guarantee AS_VAR_IF
Simon Josefsson <simon@josefsson.org>
parents:
12559
diff
changeset
|
217 # 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
|
218 # ---------------------------------------------------- |
77cea116e541
build: guarantee AS_VAR_IF
Simon Josefsson <simon@josefsson.org>
parents:
12559
diff
changeset
|
219 # Backport of autoconf-2.63b's macro. |
77cea116e541
build: guarantee AS_VAR_IF
Simon Josefsson <simon@josefsson.org>
parents:
12559
diff
changeset
|
220 # 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
|
221 m4_ifndef([AS_VAR_IF], |
77cea116e541
build: guarantee AS_VAR_IF
Simon Josefsson <simon@josefsson.org>
parents:
12559
diff
changeset
|
222 [m4_define([AS_VAR_IF], |
77cea116e541
build: guarantee AS_VAR_IF
Simon Josefsson <simon@josefsson.org>
parents:
12559
diff
changeset
|
223 [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
|
224 |
15800
d79b27b411b7
Centralize C99 requirement.
Bruno Haible <bruno@clisp.org>
parents:
15562
diff
changeset
|
225 # gl_PROG_CC_C99 |
d79b27b411b7
Centralize C99 requirement.
Bruno Haible <bruno@clisp.org>
parents:
15562
diff
changeset
|
226 # Modifies the value of the shell variable CC in an attempt to make $CC |
d79b27b411b7
Centralize C99 requirement.
Bruno Haible <bruno@clisp.org>
parents:
15562
diff
changeset
|
227 # understand ISO C99 source code. |
d79b27b411b7
Centralize C99 requirement.
Bruno Haible <bruno@clisp.org>
parents:
15562
diff
changeset
|
228 # This is like AC_PROG_CC_C99, except that |
d79b27b411b7
Centralize C99 requirement.
Bruno Haible <bruno@clisp.org>
parents:
15562
diff
changeset
|
229 # - AC_PROG_CC_C99 did not exist in Autoconf versions < 2.60, |
d79b27b411b7
Centralize C99 requirement.
Bruno Haible <bruno@clisp.org>
parents:
15562
diff
changeset
|
230 # - AC_PROG_CC_C99 does not mix well with AC_PROG_CC_STDC |
d79b27b411b7
Centralize C99 requirement.
Bruno Haible <bruno@clisp.org>
parents:
15562
diff
changeset
|
231 # <http://lists.gnu.org/archive/html/bug-gnulib/2011-09/msg00367.html>, |
d79b27b411b7
Centralize C99 requirement.
Bruno Haible <bruno@clisp.org>
parents:
15562
diff
changeset
|
232 # but many more packages use AC_PROG_CC_STDC than AC_PROG_CC_C99 |
d79b27b411b7
Centralize C99 requirement.
Bruno Haible <bruno@clisp.org>
parents:
15562
diff
changeset
|
233 # <http://lists.gnu.org/archive/html/bug-gnulib/2011-09/msg00441.html>. |
d79b27b411b7
Centralize C99 requirement.
Bruno Haible <bruno@clisp.org>
parents:
15562
diff
changeset
|
234 # Remaining problems: |
d79b27b411b7
Centralize C99 requirement.
Bruno Haible <bruno@clisp.org>
parents:
15562
diff
changeset
|
235 # - When AC_PROG_CC_STDC is invoked twice, it adds the C99 enabling options |
d79b27b411b7
Centralize C99 requirement.
Bruno Haible <bruno@clisp.org>
parents:
15562
diff
changeset
|
236 # to CC twice |
d79b27b411b7
Centralize C99 requirement.
Bruno Haible <bruno@clisp.org>
parents:
15562
diff
changeset
|
237 # <http://lists.gnu.org/archive/html/bug-gnulib/2011-09/msg00431.html>. |
16239
91f53c1e1787
doc: C11 and C++11 are now official
Paul Eggert <eggert@cs.ucla.edu>
parents:
16201
diff
changeset
|
238 # - AC_PROG_CC_STDC is likely to change now that C11 is an ISO standard. |
15800
d79b27b411b7
Centralize C99 requirement.
Bruno Haible <bruno@clisp.org>
parents:
15562
diff
changeset
|
239 AC_DEFUN([gl_PROG_CC_C99], |
d79b27b411b7
Centralize C99 requirement.
Bruno Haible <bruno@clisp.org>
parents:
15562
diff
changeset
|
240 [ |
d79b27b411b7
Centralize C99 requirement.
Bruno Haible <bruno@clisp.org>
parents:
15562
diff
changeset
|
241 dnl Change that version number to the minimum Autoconf version that supports |
d79b27b411b7
Centralize C99 requirement.
Bruno Haible <bruno@clisp.org>
parents:
15562
diff
changeset
|
242 dnl mixing AC_PROG_CC_C99 calls with AC_PROG_CC_STDC calls. |
d79b27b411b7
Centralize C99 requirement.
Bruno Haible <bruno@clisp.org>
parents:
15562
diff
changeset
|
243 m4_version_prereq([9.0], |
d79b27b411b7
Centralize C99 requirement.
Bruno Haible <bruno@clisp.org>
parents:
15562
diff
changeset
|
244 [AC_REQUIRE([AC_PROG_CC_C99])], |
d79b27b411b7
Centralize C99 requirement.
Bruno Haible <bruno@clisp.org>
parents:
15562
diff
changeset
|
245 [AC_REQUIRE([AC_PROG_CC_STDC])]) |
d79b27b411b7
Centralize C99 requirement.
Bruno Haible <bruno@clisp.org>
parents:
15562
diff
changeset
|
246 ]) |
d79b27b411b7
Centralize C99 requirement.
Bruno Haible <bruno@clisp.org>
parents:
15562
diff
changeset
|
247 |
15482
74bf515b04ad
Add support for Minix with ACK compiler.
Bruno Haible <bruno@clisp.org>
parents:
15411
diff
changeset
|
248 # gl_PROG_AR_RANLIB |
74bf515b04ad
Add support for Minix with ACK compiler.
Bruno Haible <bruno@clisp.org>
parents:
15411
diff
changeset
|
249 # Determines the values for AR, ARFLAGS, RANLIB that fit with the compiler. |
15562
c73d0845f357
Allow the user to override the choice of AR, ARFLAGS, RANLIB.
Bruno Haible <bruno@clisp.org>
parents:
15561
diff
changeset
|
250 # The user can set the variables AR, ARFLAGS, RANLIB if he wants to override |
c73d0845f357
Allow the user to override the choice of AR, ARFLAGS, RANLIB.
Bruno Haible <bruno@clisp.org>
parents:
15561
diff
changeset
|
251 # the values. |
15482
74bf515b04ad
Add support for Minix with ACK compiler.
Bruno Haible <bruno@clisp.org>
parents:
15411
diff
changeset
|
252 AC_DEFUN([gl_PROG_AR_RANLIB], |
74bf515b04ad
Add support for Minix with ACK compiler.
Bruno Haible <bruno@clisp.org>
parents:
15411
diff
changeset
|
253 [ |
74bf515b04ad
Add support for Minix with ACK compiler.
Bruno Haible <bruno@clisp.org>
parents:
15411
diff
changeset
|
254 dnl Minix 3 comes with two toolchains: The Amsterdam Compiler Kit compiler |
74bf515b04ad
Add support for Minix with ACK compiler.
Bruno Haible <bruno@clisp.org>
parents:
15411
diff
changeset
|
255 dnl as "cc", and GCC as "gcc". They have different object file formats and |
18114
e212f9b1ce05
gnulib-common.m4: fix gl_PROG_AR_RANLIB/AM_PROG_AR clash
Pavel Raiskup <praiskup@redhat.com>
parents:
18039
diff
changeset
|
256 dnl library formats. In particular, the GNU binutils programs ar and ranlib |
15482
74bf515b04ad
Add support for Minix with ACK compiler.
Bruno Haible <bruno@clisp.org>
parents:
15411
diff
changeset
|
257 dnl produce libraries that work only with gcc, not with cc. |
74bf515b04ad
Add support for Minix with ACK compiler.
Bruno Haible <bruno@clisp.org>
parents:
15411
diff
changeset
|
258 AC_REQUIRE([AC_PROG_CC]) |
18114
e212f9b1ce05
gnulib-common.m4: fix gl_PROG_AR_RANLIB/AM_PROG_AR clash
Pavel Raiskup <praiskup@redhat.com>
parents:
18039
diff
changeset
|
259 AC_BEFORE([$0], [AM_PROG_AR]) |
15562
c73d0845f357
Allow the user to override the choice of AR, ARFLAGS, RANLIB.
Bruno Haible <bruno@clisp.org>
parents:
15561
diff
changeset
|
260 AC_CACHE_CHECK([for Minix Amsterdam compiler], [gl_cv_c_amsterdam_compiler], |
15482
74bf515b04ad
Add support for Minix with ACK compiler.
Bruno Haible <bruno@clisp.org>
parents:
15411
diff
changeset
|
261 [ |
15562
c73d0845f357
Allow the user to override the choice of AR, ARFLAGS, RANLIB.
Bruno Haible <bruno@clisp.org>
parents:
15561
diff
changeset
|
262 AC_EGREP_CPP([Amsterdam], |
c73d0845f357
Allow the user to override the choice of AR, ARFLAGS, RANLIB.
Bruno Haible <bruno@clisp.org>
parents:
15561
diff
changeset
|
263 [ |
15482
74bf515b04ad
Add support for Minix with ACK compiler.
Bruno Haible <bruno@clisp.org>
parents:
15411
diff
changeset
|
264 #ifdef __ACK__ |
74bf515b04ad
Add support for Minix with ACK compiler.
Bruno Haible <bruno@clisp.org>
parents:
15411
diff
changeset
|
265 Amsterdam |
74bf515b04ad
Add support for Minix with ACK compiler.
Bruno Haible <bruno@clisp.org>
parents:
15411
diff
changeset
|
266 #endif |
15562
c73d0845f357
Allow the user to override the choice of AR, ARFLAGS, RANLIB.
Bruno Haible <bruno@clisp.org>
parents:
15561
diff
changeset
|
267 ], |
c73d0845f357
Allow the user to override the choice of AR, ARFLAGS, RANLIB.
Bruno Haible <bruno@clisp.org>
parents:
15561
diff
changeset
|
268 [gl_cv_c_amsterdam_compiler=yes], |
c73d0845f357
Allow the user to override the choice of AR, ARFLAGS, RANLIB.
Bruno Haible <bruno@clisp.org>
parents:
15561
diff
changeset
|
269 [gl_cv_c_amsterdam_compiler=no]) |
15482
74bf515b04ad
Add support for Minix with ACK compiler.
Bruno Haible <bruno@clisp.org>
parents:
15411
diff
changeset
|
270 ]) |
18114
e212f9b1ce05
gnulib-common.m4: fix gl_PROG_AR_RANLIB/AM_PROG_AR clash
Pavel Raiskup <praiskup@redhat.com>
parents:
18039
diff
changeset
|
271 |
e212f9b1ce05
gnulib-common.m4: fix gl_PROG_AR_RANLIB/AM_PROG_AR clash
Pavel Raiskup <praiskup@redhat.com>
parents:
18039
diff
changeset
|
272 dnl Don't compete with AM_PROG_AR's decision about AR/ARFLAGS if we are not |
e212f9b1ce05
gnulib-common.m4: fix gl_PROG_AR_RANLIB/AM_PROG_AR clash
Pavel Raiskup <praiskup@redhat.com>
parents:
18039
diff
changeset
|
273 dnl building with __ACK__. |
e212f9b1ce05
gnulib-common.m4: fix gl_PROG_AR_RANLIB/AM_PROG_AR clash
Pavel Raiskup <praiskup@redhat.com>
parents:
18039
diff
changeset
|
274 if test $gl_cv_c_amsterdam_compiler = yes; then |
e212f9b1ce05
gnulib-common.m4: fix gl_PROG_AR_RANLIB/AM_PROG_AR clash
Pavel Raiskup <praiskup@redhat.com>
parents:
18039
diff
changeset
|
275 if test -z "$AR"; then |
15562
c73d0845f357
Allow the user to override the choice of AR, ARFLAGS, RANLIB.
Bruno Haible <bruno@clisp.org>
parents:
15561
diff
changeset
|
276 AR='cc -c.a' |
18114
e212f9b1ce05
gnulib-common.m4: fix gl_PROG_AR_RANLIB/AM_PROG_AR clash
Pavel Raiskup <praiskup@redhat.com>
parents:
18039
diff
changeset
|
277 fi |
e212f9b1ce05
gnulib-common.m4: fix gl_PROG_AR_RANLIB/AM_PROG_AR clash
Pavel Raiskup <praiskup@redhat.com>
parents:
18039
diff
changeset
|
278 if test -z "$ARFLAGS"; then |
e212f9b1ce05
gnulib-common.m4: fix gl_PROG_AR_RANLIB/AM_PROG_AR clash
Pavel Raiskup <praiskup@redhat.com>
parents:
18039
diff
changeset
|
279 ARFLAGS='-o' |
15562
c73d0845f357
Allow the user to override the choice of AR, ARFLAGS, RANLIB.
Bruno Haible <bruno@clisp.org>
parents:
15561
diff
changeset
|
280 fi |
c73d0845f357
Allow the user to override the choice of AR, ARFLAGS, RANLIB.
Bruno Haible <bruno@clisp.org>
parents:
15561
diff
changeset
|
281 else |
18114
e212f9b1ce05
gnulib-common.m4: fix gl_PROG_AR_RANLIB/AM_PROG_AR clash
Pavel Raiskup <praiskup@redhat.com>
parents:
18039
diff
changeset
|
282 dnl AM_PROG_AR was added in automake v1.11.2. AM_PROG_AR does not AC_SUBST |
e212f9b1ce05
gnulib-common.m4: fix gl_PROG_AR_RANLIB/AM_PROG_AR clash
Pavel Raiskup <praiskup@redhat.com>
parents:
18039
diff
changeset
|
283 dnl ARFLAGS variable (it is filed into Makefile.in directly by automake |
e212f9b1ce05
gnulib-common.m4: fix gl_PROG_AR_RANLIB/AM_PROG_AR clash
Pavel Raiskup <praiskup@redhat.com>
parents:
18039
diff
changeset
|
284 dnl script on-demand, if not specified by ./configure of course). |
e212f9b1ce05
gnulib-common.m4: fix gl_PROG_AR_RANLIB/AM_PROG_AR clash
Pavel Raiskup <praiskup@redhat.com>
parents:
18039
diff
changeset
|
285 dnl Don't AC_REQUIRE the AM_PROG_AR otherwise the code for __ACK__ above |
e212f9b1ce05
gnulib-common.m4: fix gl_PROG_AR_RANLIB/AM_PROG_AR clash
Pavel Raiskup <praiskup@redhat.com>
parents:
18039
diff
changeset
|
286 dnl will be ignored. Also, pay attention to call AM_PROG_AR in else block |
e212f9b1ce05
gnulib-common.m4: fix gl_PROG_AR_RANLIB/AM_PROG_AR clash
Pavel Raiskup <praiskup@redhat.com>
parents:
18039
diff
changeset
|
287 dnl because AM_PROG_AR is written so it could re-set AR variable even for |
e212f9b1ce05
gnulib-common.m4: fix gl_PROG_AR_RANLIB/AM_PROG_AR clash
Pavel Raiskup <praiskup@redhat.com>
parents:
18039
diff
changeset
|
288 dnl __ACK__. It may seem like its easier to avoid calling the macro here, |
e212f9b1ce05
gnulib-common.m4: fix gl_PROG_AR_RANLIB/AM_PROG_AR clash
Pavel Raiskup <praiskup@redhat.com>
parents:
18039
diff
changeset
|
289 dnl but we need to AC_SUBST both AR/ARFLAGS (thus those must have some good |
e212f9b1ce05
gnulib-common.m4: fix gl_PROG_AR_RANLIB/AM_PROG_AR clash
Pavel Raiskup <praiskup@redhat.com>
parents:
18039
diff
changeset
|
290 dnl default value and automake should usually know them). |
e212f9b1ce05
gnulib-common.m4: fix gl_PROG_AR_RANLIB/AM_PROG_AR clash
Pavel Raiskup <praiskup@redhat.com>
parents:
18039
diff
changeset
|
291 m4_ifdef([AM_PROG_AR], [AM_PROG_AR], [:]) |
15562
c73d0845f357
Allow the user to override the choice of AR, ARFLAGS, RANLIB.
Bruno Haible <bruno@clisp.org>
parents:
15561
diff
changeset
|
292 fi |
18114
e212f9b1ce05
gnulib-common.m4: fix gl_PROG_AR_RANLIB/AM_PROG_AR clash
Pavel Raiskup <praiskup@redhat.com>
parents:
18039
diff
changeset
|
293 |
e212f9b1ce05
gnulib-common.m4: fix gl_PROG_AR_RANLIB/AM_PROG_AR clash
Pavel Raiskup <praiskup@redhat.com>
parents:
18039
diff
changeset
|
294 dnl In case the code above has not helped with setting AR/ARFLAGS, use |
e212f9b1ce05
gnulib-common.m4: fix gl_PROG_AR_RANLIB/AM_PROG_AR clash
Pavel Raiskup <praiskup@redhat.com>
parents:
18039
diff
changeset
|
295 dnl Automake-documented default values for AR and ARFLAGS, but prefer |
e212f9b1ce05
gnulib-common.m4: fix gl_PROG_AR_RANLIB/AM_PROG_AR clash
Pavel Raiskup <praiskup@redhat.com>
parents:
18039
diff
changeset
|
296 dnl ${host}-ar over ar (useful for cross-compiling). |
e212f9b1ce05
gnulib-common.m4: fix gl_PROG_AR_RANLIB/AM_PROG_AR clash
Pavel Raiskup <praiskup@redhat.com>
parents:
18039
diff
changeset
|
297 AC_CHECK_TOOL([AR], [ar], [ar]) |
e212f9b1ce05
gnulib-common.m4: fix gl_PROG_AR_RANLIB/AM_PROG_AR clash
Pavel Raiskup <praiskup@redhat.com>
parents:
18039
diff
changeset
|
298 if test -z "$ARFLAGS"; then |
e212f9b1ce05
gnulib-common.m4: fix gl_PROG_AR_RANLIB/AM_PROG_AR clash
Pavel Raiskup <praiskup@redhat.com>
parents:
18039
diff
changeset
|
299 ARFLAGS='cr' |
e212f9b1ce05
gnulib-common.m4: fix gl_PROG_AR_RANLIB/AM_PROG_AR clash
Pavel Raiskup <praiskup@redhat.com>
parents:
18039
diff
changeset
|
300 fi |
e212f9b1ce05
gnulib-common.m4: fix gl_PROG_AR_RANLIB/AM_PROG_AR clash
Pavel Raiskup <praiskup@redhat.com>
parents:
18039
diff
changeset
|
301 |
15482
74bf515b04ad
Add support for Minix with ACK compiler.
Bruno Haible <bruno@clisp.org>
parents:
15411
diff
changeset
|
302 AC_SUBST([AR]) |
74bf515b04ad
Add support for Minix with ACK compiler.
Bruno Haible <bruno@clisp.org>
parents:
15411
diff
changeset
|
303 AC_SUBST([ARFLAGS]) |
15562
c73d0845f357
Allow the user to override the choice of AR, ARFLAGS, RANLIB.
Bruno Haible <bruno@clisp.org>
parents:
15561
diff
changeset
|
304 if test -z "$RANLIB"; then |
c73d0845f357
Allow the user to override the choice of AR, ARFLAGS, RANLIB.
Bruno Haible <bruno@clisp.org>
parents:
15561
diff
changeset
|
305 if test $gl_cv_c_amsterdam_compiler = yes; then |
c73d0845f357
Allow the user to override the choice of AR, ARFLAGS, RANLIB.
Bruno Haible <bruno@clisp.org>
parents:
15561
diff
changeset
|
306 RANLIB=':' |
c73d0845f357
Allow the user to override the choice of AR, ARFLAGS, RANLIB.
Bruno Haible <bruno@clisp.org>
parents:
15561
diff
changeset
|
307 else |
c73d0845f357
Allow the user to override the choice of AR, ARFLAGS, RANLIB.
Bruno Haible <bruno@clisp.org>
parents:
15561
diff
changeset
|
308 dnl Use the ranlib program if it is available. |
c73d0845f357
Allow the user to override the choice of AR, ARFLAGS, RANLIB.
Bruno Haible <bruno@clisp.org>
parents:
15561
diff
changeset
|
309 AC_PROG_RANLIB |
c73d0845f357
Allow the user to override the choice of AR, ARFLAGS, RANLIB.
Bruno Haible <bruno@clisp.org>
parents:
15561
diff
changeset
|
310 fi |
c73d0845f357
Allow the user to override the choice of AR, ARFLAGS, RANLIB.
Bruno Haible <bruno@clisp.org>
parents:
15561
diff
changeset
|
311 fi |
c73d0845f357
Allow the user to override the choice of AR, ARFLAGS, RANLIB.
Bruno Haible <bruno@clisp.org>
parents:
15561
diff
changeset
|
312 AC_SUBST([RANLIB]) |
15482
74bf515b04ad
Add support for Minix with ACK compiler.
Bruno Haible <bruno@clisp.org>
parents:
15411
diff
changeset
|
313 ]) |
74bf515b04ad
Add support for Minix with ACK compiler.
Bruno Haible <bruno@clisp.org>
parents:
15411
diff
changeset
|
314 |
7920
53d558c7086d
Add an AC_PROG_MKDIR_P backport.
Bruno Haible <bruno@clisp.org>
parents:
7788
diff
changeset
|
315 # 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
|
316 # 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
|
317 # 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
|
318 # 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
|
319 # autoconf >= 2.60 && automake >= 1.10. |
17214
52edc13438e3
AC_PROG_MKDIR_P: port workaround to pre-2.62 Autoconf
Paul Eggert <eggert@cs.ucla.edu>
parents:
17213
diff
changeset
|
320 # AC_AUTOCONF_VERSION was introduced in 2.62, so use that as the witness. |
52edc13438e3
AC_PROG_MKDIR_P: port workaround to pre-2.62 Autoconf
Paul Eggert <eggert@cs.ucla.edu>
parents:
17213
diff
changeset
|
321 m4_ifndef([AC_AUTOCONF_VERSION],[ |
12880
0ca4a77ffffb
Restore support for automake 1.9.6 with autoconf 2.61.
Bruno Haible <bruno@clisp.org>
parents:
12735
diff
changeset
|
322 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
|
323 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
|
324 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
|
325 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
|
326 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
|
327 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
|
328 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
|
329 [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
|
330 MKDIR_P='$(mkdir_p)' |
53d558c7086d
Add an AC_PROG_MKDIR_P backport.
Bruno Haible <bruno@clisp.org>
parents:
7788
diff
changeset
|
331 AC_SUBST([MKDIR_P])])]) |
17213
642a4202d1e3
AC_PROG_MKDIR_P: don't workaround if not buggy
Paul Eggert <eggert@cs.ucla.edu>
parents:
16935
diff
changeset
|
332 ]) |
9411
5ea76912f0b5
Borrow an improved version of AC_C_RESTRICT from autoconf.
Bruno Haible <bruno@clisp.org>
parents:
7920
diff
changeset
|
333 |
5ea76912f0b5
Borrow an improved version of AC_C_RESTRICT from autoconf.
Bruno Haible <bruno@clisp.org>
parents:
7920
diff
changeset
|
334 # AC_C_RESTRICT |
17749
228d489fadb5
gnulib-common.m4: port to GCC 4.2.1 and Sun Studio 12 C++
Paul Eggert <eggert@cs.ucla.edu>
parents:
17692
diff
changeset
|
335 # This definition is copied from post-2.69 Autoconf and overrides the |
228d489fadb5
gnulib-common.m4: port to GCC 4.2.1 and Sun Studio 12 C++
Paul Eggert <eggert@cs.ucla.edu>
parents:
17692
diff
changeset
|
336 # AC_C_RESTRICT macro from autoconf 2.60..2.69. It can be removed |
228d489fadb5
gnulib-common.m4: port to GCC 4.2.1 and Sun Studio 12 C++
Paul Eggert <eggert@cs.ucla.edu>
parents:
17692
diff
changeset
|
337 # once autoconf >= 2.70 can be assumed. It's painful to check version |
228d489fadb5
gnulib-common.m4: port to GCC 4.2.1 and Sun Studio 12 C++
Paul Eggert <eggert@cs.ucla.edu>
parents:
17692
diff
changeset
|
338 # numbers, and in practice this macro is more up-to-date than Autoconf |
228d489fadb5
gnulib-common.m4: port to GCC 4.2.1 and Sun Studio 12 C++
Paul Eggert <eggert@cs.ucla.edu>
parents:
17692
diff
changeset
|
339 # is, so override Autoconf unconditionally. |
9411
5ea76912f0b5
Borrow an improved version of AC_C_RESTRICT from autoconf.
Bruno Haible <bruno@clisp.org>
parents:
7920
diff
changeset
|
340 AC_DEFUN([AC_C_RESTRICT], |
11007
f6cba5a556ce
many *.m4 files: improve m4 quoting
Jim Meyering <meyering@redhat.com>
parents:
10658
diff
changeset
|
341 [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
|
342 [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
|
343 # 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
|
344 for ac_kw in __restrict __restrict__ _Restrict restrict; do |
17749
228d489fadb5
gnulib-common.m4: port to GCC 4.2.1 and Sun Studio 12 C++
Paul Eggert <eggert@cs.ucla.edu>
parents:
17692
diff
changeset
|
345 AC_COMPILE_IFELSE( |
228d489fadb5
gnulib-common.m4: port to GCC 4.2.1 and Sun Studio 12 C++
Paul Eggert <eggert@cs.ucla.edu>
parents:
17692
diff
changeset
|
346 [AC_LANG_PROGRAM( |
228d489fadb5
gnulib-common.m4: port to GCC 4.2.1 and Sun Studio 12 C++
Paul Eggert <eggert@cs.ucla.edu>
parents:
17692
diff
changeset
|
347 [[typedef int *int_ptr; |
228d489fadb5
gnulib-common.m4: port to GCC 4.2.1 and Sun Studio 12 C++
Paul Eggert <eggert@cs.ucla.edu>
parents:
17692
diff
changeset
|
348 int foo (int_ptr $ac_kw ip) { return ip[0]; } |
228d489fadb5
gnulib-common.m4: port to GCC 4.2.1 and Sun Studio 12 C++
Paul Eggert <eggert@cs.ucla.edu>
parents:
17692
diff
changeset
|
349 int bar (int [$ac_kw]); /* Catch GCC bug 14050. */ |
228d489fadb5
gnulib-common.m4: port to GCC 4.2.1 and Sun Studio 12 C++
Paul Eggert <eggert@cs.ucla.edu>
parents:
17692
diff
changeset
|
350 int bar (int ip[$ac_kw]) { return ip[0]; } |
228d489fadb5
gnulib-common.m4: port to GCC 4.2.1 and Sun Studio 12 C++
Paul Eggert <eggert@cs.ucla.edu>
parents:
17692
diff
changeset
|
351 ]], |
228d489fadb5
gnulib-common.m4: port to GCC 4.2.1 and Sun Studio 12 C++
Paul Eggert <eggert@cs.ucla.edu>
parents:
17692
diff
changeset
|
352 [[int s[1]; |
228d489fadb5
gnulib-common.m4: port to GCC 4.2.1 and Sun Studio 12 C++
Paul Eggert <eggert@cs.ucla.edu>
parents:
17692
diff
changeset
|
353 int *$ac_kw t = s; |
228d489fadb5
gnulib-common.m4: port to GCC 4.2.1 and Sun Studio 12 C++
Paul Eggert <eggert@cs.ucla.edu>
parents:
17692
diff
changeset
|
354 t[0] = 0; |
228d489fadb5
gnulib-common.m4: port to GCC 4.2.1 and Sun Studio 12 C++
Paul Eggert <eggert@cs.ucla.edu>
parents:
17692
diff
changeset
|
355 return foo (t) + bar (t); |
228d489fadb5
gnulib-common.m4: port to GCC 4.2.1 and Sun Studio 12 C++
Paul Eggert <eggert@cs.ucla.edu>
parents:
17692
diff
changeset
|
356 ]])], |
9411
5ea76912f0b5
Borrow an improved version of AC_C_RESTRICT from autoconf.
Bruno Haible <bruno@clisp.org>
parents:
7920
diff
changeset
|
357 [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
|
358 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
|
359 done |
5ea76912f0b5
Borrow an improved version of AC_C_RESTRICT from autoconf.
Bruno Haible <bruno@clisp.org>
parents:
7920
diff
changeset
|
360 ]) |
5ea76912f0b5
Borrow an improved version of AC_C_RESTRICT from autoconf.
Bruno Haible <bruno@clisp.org>
parents:
7920
diff
changeset
|
361 AH_VERBATIM([restrict], |
5ea76912f0b5
Borrow an improved version of AC_C_RESTRICT from autoconf.
Bruno Haible <bruno@clisp.org>
parents:
7920
diff
changeset
|
362 [/* 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
|
363 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
|
364 supported directly. */ |
5ea76912f0b5
Borrow an improved version of AC_C_RESTRICT from autoconf.
Bruno Haible <bruno@clisp.org>
parents:
7920
diff
changeset
|
365 #undef restrict |
17749
228d489fadb5
gnulib-common.m4: port to GCC 4.2.1 and Sun Studio 12 C++
Paul Eggert <eggert@cs.ucla.edu>
parents:
17692
diff
changeset
|
366 /* Work around a bug in Sun C++: it does not support _Restrict or |
228d489fadb5
gnulib-common.m4: port to GCC 4.2.1 and Sun Studio 12 C++
Paul Eggert <eggert@cs.ucla.edu>
parents:
17692
diff
changeset
|
367 __restrict__, even though the corresponding Sun C compiler ends up with |
228d489fadb5
gnulib-common.m4: port to GCC 4.2.1 and Sun Studio 12 C++
Paul Eggert <eggert@cs.ucla.edu>
parents:
17692
diff
changeset
|
368 "#define restrict _Restrict" or "#define restrict __restrict__" in the |
228d489fadb5
gnulib-common.m4: port to GCC 4.2.1 and Sun Studio 12 C++
Paul Eggert <eggert@cs.ucla.edu>
parents:
17692
diff
changeset
|
369 previous line. Perhaps some future version of Sun C++ will work with |
228d489fadb5
gnulib-common.m4: port to GCC 4.2.1 and Sun Studio 12 C++
Paul Eggert <eggert@cs.ucla.edu>
parents:
17692
diff
changeset
|
370 restrict; if so, hopefully it defines __RESTRICT like Sun C does. */ |
9411
5ea76912f0b5
Borrow an improved version of AC_C_RESTRICT from autoconf.
Bruno Haible <bruno@clisp.org>
parents:
7920
diff
changeset
|
371 #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
|
372 # define _Restrict |
17749
228d489fadb5
gnulib-common.m4: port to GCC 4.2.1 and Sun Studio 12 C++
Paul Eggert <eggert@cs.ucla.edu>
parents:
17692
diff
changeset
|
373 # define __restrict__ |
9411
5ea76912f0b5
Borrow an improved version of AC_C_RESTRICT from autoconf.
Bruno Haible <bruno@clisp.org>
parents:
7920
diff
changeset
|
374 #endif]) |
5ea76912f0b5
Borrow an improved version of AC_C_RESTRICT from autoconf.
Bruno Haible <bruno@clisp.org>
parents:
7920
diff
changeset
|
375 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
|
376 restrict) ;; |
5ea76912f0b5
Borrow an improved version of AC_C_RESTRICT from autoconf.
Bruno Haible <bruno@clisp.org>
parents:
7920
diff
changeset
|
377 no) AC_DEFINE([restrict], []) ;; |
5ea76912f0b5
Borrow an improved version of AC_C_RESTRICT from autoconf.
Bruno Haible <bruno@clisp.org>
parents:
7920
diff
changeset
|
378 *) 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
|
379 esac |
17749
228d489fadb5
gnulib-common.m4: port to GCC 4.2.1 and Sun Studio 12 C++
Paul Eggert <eggert@cs.ucla.edu>
parents:
17692
diff
changeset
|
380 ])# AC_C_RESTRICT |
11053
90ea94356c75
Don't use AC_REQUIRE([AC_C_BIGENDIAN]).
Bruno Haible <bruno@clisp.org>
parents:
11007
diff
changeset
|
381 |
90ea94356c75
Don't use AC_REQUIRE([AC_C_BIGENDIAN]).
Bruno Haible <bruno@clisp.org>
parents:
11007
diff
changeset
|
382 # gl_BIGENDIAN |
90ea94356c75
Don't use AC_REQUIRE([AC_C_BIGENDIAN]).
Bruno Haible <bruno@clisp.org>
parents:
11007
diff
changeset
|
383 # 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
|
384 # 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
|
385 # 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
|
386 AC_DEFUN([gl_BIGENDIAN], |
90ea94356c75
Don't use AC_REQUIRE([AC_C_BIGENDIAN]).
Bruno Haible <bruno@clisp.org>
parents:
11007
diff
changeset
|
387 [ |
90ea94356c75
Don't use AC_REQUIRE([AC_C_BIGENDIAN]).
Bruno Haible <bruno@clisp.org>
parents:
11007
diff
changeset
|
388 AC_C_BIGENDIAN |
90ea94356c75
Don't use AC_REQUIRE([AC_C_BIGENDIAN]).
Bruno Haible <bruno@clisp.org>
parents:
11007
diff
changeset
|
389 ]) |
11229
6dad92faecd1
Avoid spurious "(cached)" in configure output.
Bruno Haible <bruno@clisp.org>
parents:
11105
diff
changeset
|
390 |
6dad92faecd1
Avoid spurious "(cached)" in configure output.
Bruno Haible <bruno@clisp.org>
parents:
11105
diff
changeset
|
391 # 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
|
392 # 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
|
393 # 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
|
394 # 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
|
395 # 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
|
396 AC_DEFUN([gl_CACHE_VAL_SILENT], |
6dad92faecd1
Avoid spurious "(cached)" in configure output.
Bruno Haible <bruno@clisp.org>
parents:
11105
diff
changeset
|
397 [ |
6dad92faecd1
Avoid spurious "(cached)" in configure output.
Bruno Haible <bruno@clisp.org>
parents:
11105
diff
changeset
|
398 saved_as_echo_n="$as_echo_n" |
6dad92faecd1
Avoid spurious "(cached)" in configure output.
Bruno Haible <bruno@clisp.org>
parents:
11105
diff
changeset
|
399 as_echo_n=':' |
6dad92faecd1
Avoid spurious "(cached)" in configure output.
Bruno Haible <bruno@clisp.org>
parents:
11105
diff
changeset
|
400 AC_CACHE_VAL([$1], [$2]) |
6dad92faecd1
Avoid spurious "(cached)" in configure output.
Bruno Haible <bruno@clisp.org>
parents:
11105
diff
changeset
|
401 as_echo_n="$saved_as_echo_n" |
6dad92faecd1
Avoid spurious "(cached)" in configure output.
Bruno Haible <bruno@clisp.org>
parents:
11105
diff
changeset
|
402 ]) |
17588
b1b3e9794cf9
include_next: port to autoconf 2.63
Eric Blake <eblake@redhat.com>
parents:
17576
diff
changeset
|
403 |
b1b3e9794cf9
include_next: port to autoconf 2.63
Eric Blake <eblake@redhat.com>
parents:
17576
diff
changeset
|
404 # AS_VAR_COPY was added in autoconf 2.63b |
b1b3e9794cf9
include_next: port to autoconf 2.63
Eric Blake <eblake@redhat.com>
parents:
17576
diff
changeset
|
405 m4_define_default([AS_VAR_COPY], |
b1b3e9794cf9
include_next: port to autoconf 2.63
Eric Blake <eblake@redhat.com>
parents:
17576
diff
changeset
|
406 [AS_LITERAL_IF([$1[]$2], [$1=$$2], [eval $1=\$$2])]) |
17615
621c25ada8d5
maintainer-makefiles: provide AC_PROG_SED for older autoconf
Eric Blake <eblake@redhat.com>
parents:
17588
diff
changeset
|
407 |
621c25ada8d5
maintainer-makefiles: provide AC_PROG_SED for older autoconf
Eric Blake <eblake@redhat.com>
parents:
17588
diff
changeset
|
408 # AC_PROG_SED was added in autoconf 2.59b |
621c25ada8d5
maintainer-makefiles: provide AC_PROG_SED for older autoconf
Eric Blake <eblake@redhat.com>
parents:
17588
diff
changeset
|
409 m4_ifndef([AC_PROG_SED], |
621c25ada8d5
maintainer-makefiles: provide AC_PROG_SED for older autoconf
Eric Blake <eblake@redhat.com>
parents:
17588
diff
changeset
|
410 [AC_DEFUN([AC_PROG_SED], |
621c25ada8d5
maintainer-makefiles: provide AC_PROG_SED for older autoconf
Eric Blake <eblake@redhat.com>
parents:
17588
diff
changeset
|
411 [AC_CACHE_CHECK([for a sed that does not truncate output], ac_cv_path_SED, |
621c25ada8d5
maintainer-makefiles: provide AC_PROG_SED for older autoconf
Eric Blake <eblake@redhat.com>
parents:
17588
diff
changeset
|
412 [dnl ac_script should not contain more than 99 commands (for HP-UX sed), |
621c25ada8d5
maintainer-makefiles: provide AC_PROG_SED for older autoconf
Eric Blake <eblake@redhat.com>
parents:
17588
diff
changeset
|
413 dnl but more than about 7000 bytes, to catch a limit in Solaris 8 /usr/ucb/sed. |
621c25ada8d5
maintainer-makefiles: provide AC_PROG_SED for older autoconf
Eric Blake <eblake@redhat.com>
parents:
17588
diff
changeset
|
414 ac_script=s/aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb/ |
621c25ada8d5
maintainer-makefiles: provide AC_PROG_SED for older autoconf
Eric Blake <eblake@redhat.com>
parents:
17588
diff
changeset
|
415 for ac_i in 1 2 3 4 5 6 7; do |
621c25ada8d5
maintainer-makefiles: provide AC_PROG_SED for older autoconf
Eric Blake <eblake@redhat.com>
parents:
17588
diff
changeset
|
416 ac_script="$ac_script$as_nl$ac_script" |
621c25ada8d5
maintainer-makefiles: provide AC_PROG_SED for older autoconf
Eric Blake <eblake@redhat.com>
parents:
17588
diff
changeset
|
417 done |
621c25ada8d5
maintainer-makefiles: provide AC_PROG_SED for older autoconf
Eric Blake <eblake@redhat.com>
parents:
17588
diff
changeset
|
418 echo "$ac_script" 2>/dev/null | sed 99q >conftest.sed |
621c25ada8d5
maintainer-makefiles: provide AC_PROG_SED for older autoconf
Eric Blake <eblake@redhat.com>
parents:
17588
diff
changeset
|
419 AS_UNSET([ac_script]) |
621c25ada8d5
maintainer-makefiles: provide AC_PROG_SED for older autoconf
Eric Blake <eblake@redhat.com>
parents:
17588
diff
changeset
|
420 if test -z "$SED"; then |
621c25ada8d5
maintainer-makefiles: provide AC_PROG_SED for older autoconf
Eric Blake <eblake@redhat.com>
parents:
17588
diff
changeset
|
421 ac_path_SED_found=false |
621c25ada8d5
maintainer-makefiles: provide AC_PROG_SED for older autoconf
Eric Blake <eblake@redhat.com>
parents:
17588
diff
changeset
|
422 _AS_PATH_WALK([], [ |
621c25ada8d5
maintainer-makefiles: provide AC_PROG_SED for older autoconf
Eric Blake <eblake@redhat.com>
parents:
17588
diff
changeset
|
423 for ac_prog in sed gsed; do |
621c25ada8d5
maintainer-makefiles: provide AC_PROG_SED for older autoconf
Eric Blake <eblake@redhat.com>
parents:
17588
diff
changeset
|
424 for ac_exec_ext in '' $ac_executable_extensions; do |
621c25ada8d5
maintainer-makefiles: provide AC_PROG_SED for older autoconf
Eric Blake <eblake@redhat.com>
parents:
17588
diff
changeset
|
425 ac_path_SED="$as_dir/$ac_prog$ac_exec_ext" |
621c25ada8d5
maintainer-makefiles: provide AC_PROG_SED for older autoconf
Eric Blake <eblake@redhat.com>
parents:
17588
diff
changeset
|
426 AS_EXECUTABLE_P(["$ac_path_SED"]) || continue |
621c25ada8d5
maintainer-makefiles: provide AC_PROG_SED for older autoconf
Eric Blake <eblake@redhat.com>
parents:
17588
diff
changeset
|
427 case `"$ac_path_SED" --version 2>&1` in |
621c25ada8d5
maintainer-makefiles: provide AC_PROG_SED for older autoconf
Eric Blake <eblake@redhat.com>
parents:
17588
diff
changeset
|
428 *GNU*) ac_cv_path_SED=$ac_path_SED ac_path_SED_found=:;; |
621c25ada8d5
maintainer-makefiles: provide AC_PROG_SED for older autoconf
Eric Blake <eblake@redhat.com>
parents:
17588
diff
changeset
|
429 *) |
621c25ada8d5
maintainer-makefiles: provide AC_PROG_SED for older autoconf
Eric Blake <eblake@redhat.com>
parents:
17588
diff
changeset
|
430 ac_count=0 |
621c25ada8d5
maintainer-makefiles: provide AC_PROG_SED for older autoconf
Eric Blake <eblake@redhat.com>
parents:
17588
diff
changeset
|
431 _AS_ECHO_N([0123456789]) >conftest.in |
621c25ada8d5
maintainer-makefiles: provide AC_PROG_SED for older autoconf
Eric Blake <eblake@redhat.com>
parents:
17588
diff
changeset
|
432 while : |
621c25ada8d5
maintainer-makefiles: provide AC_PROG_SED for older autoconf
Eric Blake <eblake@redhat.com>
parents:
17588
diff
changeset
|
433 do |
621c25ada8d5
maintainer-makefiles: provide AC_PROG_SED for older autoconf
Eric Blake <eblake@redhat.com>
parents:
17588
diff
changeset
|
434 cat conftest.in conftest.in >conftest.tmp |
621c25ada8d5
maintainer-makefiles: provide AC_PROG_SED for older autoconf
Eric Blake <eblake@redhat.com>
parents:
17588
diff
changeset
|
435 mv conftest.tmp conftest.in |
621c25ada8d5
maintainer-makefiles: provide AC_PROG_SED for older autoconf
Eric Blake <eblake@redhat.com>
parents:
17588
diff
changeset
|
436 cp conftest.in conftest.nl |
621c25ada8d5
maintainer-makefiles: provide AC_PROG_SED for older autoconf
Eric Blake <eblake@redhat.com>
parents:
17588
diff
changeset
|
437 echo >> conftest.nl |
621c25ada8d5
maintainer-makefiles: provide AC_PROG_SED for older autoconf
Eric Blake <eblake@redhat.com>
parents:
17588
diff
changeset
|
438 "$ac_path_SED" -f conftest.sed <conftest.nl >conftest.out 2>/dev/null || break |
621c25ada8d5
maintainer-makefiles: provide AC_PROG_SED for older autoconf
Eric Blake <eblake@redhat.com>
parents:
17588
diff
changeset
|
439 diff conftest.out conftest.nl >/dev/null 2>&1 || break |
621c25ada8d5
maintainer-makefiles: provide AC_PROG_SED for older autoconf
Eric Blake <eblake@redhat.com>
parents:
17588
diff
changeset
|
440 ac_count=`expr $ac_count + 1` |
621c25ada8d5
maintainer-makefiles: provide AC_PROG_SED for older autoconf
Eric Blake <eblake@redhat.com>
parents:
17588
diff
changeset
|
441 if test $ac_count -gt ${ac_path_SED_max-0}; then |
621c25ada8d5
maintainer-makefiles: provide AC_PROG_SED for older autoconf
Eric Blake <eblake@redhat.com>
parents:
17588
diff
changeset
|
442 # Best so far, but keep looking for better |
621c25ada8d5
maintainer-makefiles: provide AC_PROG_SED for older autoconf
Eric Blake <eblake@redhat.com>
parents:
17588
diff
changeset
|
443 ac_cv_path_SED=$ac_path_SED |
621c25ada8d5
maintainer-makefiles: provide AC_PROG_SED for older autoconf
Eric Blake <eblake@redhat.com>
parents:
17588
diff
changeset
|
444 ac_path_SED_max=$ac_count |
621c25ada8d5
maintainer-makefiles: provide AC_PROG_SED for older autoconf
Eric Blake <eblake@redhat.com>
parents:
17588
diff
changeset
|
445 fi |
621c25ada8d5
maintainer-makefiles: provide AC_PROG_SED for older autoconf
Eric Blake <eblake@redhat.com>
parents:
17588
diff
changeset
|
446 test $ac_count -gt 10 && break |
621c25ada8d5
maintainer-makefiles: provide AC_PROG_SED for older autoconf
Eric Blake <eblake@redhat.com>
parents:
17588
diff
changeset
|
447 done |
621c25ada8d5
maintainer-makefiles: provide AC_PROG_SED for older autoconf
Eric Blake <eblake@redhat.com>
parents:
17588
diff
changeset
|
448 rm -f conftest.in conftest.tmp conftest.nl conftest.out;; |
621c25ada8d5
maintainer-makefiles: provide AC_PROG_SED for older autoconf
Eric Blake <eblake@redhat.com>
parents:
17588
diff
changeset
|
449 esac |
621c25ada8d5
maintainer-makefiles: provide AC_PROG_SED for older autoconf
Eric Blake <eblake@redhat.com>
parents:
17588
diff
changeset
|
450 $ac_path_SED_found && break 3 |
621c25ada8d5
maintainer-makefiles: provide AC_PROG_SED for older autoconf
Eric Blake <eblake@redhat.com>
parents:
17588
diff
changeset
|
451 done |
621c25ada8d5
maintainer-makefiles: provide AC_PROG_SED for older autoconf
Eric Blake <eblake@redhat.com>
parents:
17588
diff
changeset
|
452 done]) |
621c25ada8d5
maintainer-makefiles: provide AC_PROG_SED for older autoconf
Eric Blake <eblake@redhat.com>
parents:
17588
diff
changeset
|
453 if test -z "$ac_cv_path_SED"; then |
621c25ada8d5
maintainer-makefiles: provide AC_PROG_SED for older autoconf
Eric Blake <eblake@redhat.com>
parents:
17588
diff
changeset
|
454 AC_ERROR([no acceptable sed could be found in \$PATH]) |
621c25ada8d5
maintainer-makefiles: provide AC_PROG_SED for older autoconf
Eric Blake <eblake@redhat.com>
parents:
17588
diff
changeset
|
455 fi |
621c25ada8d5
maintainer-makefiles: provide AC_PROG_SED for older autoconf
Eric Blake <eblake@redhat.com>
parents:
17588
diff
changeset
|
456 else |
621c25ada8d5
maintainer-makefiles: provide AC_PROG_SED for older autoconf
Eric Blake <eblake@redhat.com>
parents:
17588
diff
changeset
|
457 ac_cv_path_SED=$SED |
621c25ada8d5
maintainer-makefiles: provide AC_PROG_SED for older autoconf
Eric Blake <eblake@redhat.com>
parents:
17588
diff
changeset
|
458 fi |
621c25ada8d5
maintainer-makefiles: provide AC_PROG_SED for older autoconf
Eric Blake <eblake@redhat.com>
parents:
17588
diff
changeset
|
459 SED="$ac_cv_path_SED" |
621c25ada8d5
maintainer-makefiles: provide AC_PROG_SED for older autoconf
Eric Blake <eblake@redhat.com>
parents:
17588
diff
changeset
|
460 AC_SUBST([SED])dnl |
621c25ada8d5
maintainer-makefiles: provide AC_PROG_SED for older autoconf
Eric Blake <eblake@redhat.com>
parents:
17588
diff
changeset
|
461 rm -f conftest.sed |
621c25ada8d5
maintainer-makefiles: provide AC_PROG_SED for older autoconf
Eric Blake <eblake@redhat.com>
parents:
17588
diff
changeset
|
462 ])])]) |