110
110
# '"///usr/include/foo.h"', or whatever other absolute file name is suitable.
111
111
# That way, a header file with the following line:
112
# #@INCLUDE_NEXT@ @NEXT_FOO_H@
112
# #@INCLUDE_NEXT@ @NEXT_FOO_H@
114
# #@INCLUDE_NEXT_AS_FIRST_DIRECTIVE@ @NEXT_AS_FIRST_DIRECTIVE_FOO_H@
114
# #@INCLUDE_NEXT_AS_FIRST_DIRECTIVE@ @NEXT_AS_FIRST_DIRECTIVE_FOO_H@
115
115
# behaves (after sed substitution) as if it contained
116
# #include_next <foo.h>
116
# #include_next <foo.h>
117
117
# even if the compiler does not support include_next.
118
118
# The three "///" are to pacify Sun C 5.8, which otherwise would say
119
119
# "warning: #include of /usr/include/... may be non-portable".
130
130
m4_foreach_w([gl_HEADER_NAME], [$1],
131
131
[AS_VAR_PUSHDEF([gl_next_header],
132
[gl_cv_next_]m4_defn([gl_HEADER_NAME]))
132
[gl_cv_next_]m4_defn([gl_HEADER_NAME]))
133
133
if test $gl_cv_have_include_next = yes; then
134
134
AS_VAR_SET([gl_next_header], ['<'gl_HEADER_NAME'>'])
137
[absolute name of <]m4_defn([gl_HEADER_NAME])[>],
138
m4_defn([gl_next_header]),
139
[AS_VAR_PUSHDEF([gl_header_exists],
140
[ac_cv_header_]m4_defn([gl_HEADER_NAME]))
141
if test AS_VAR_GET(gl_header_exists) = yes; then
144
[[#include <]]m4_dquote(m4_defn([gl_HEADER_NAME]))[[>]]
146
dnl AIX "xlc -E" and "cc -E" omit #line directives for header files
147
dnl that contain only a #include of other header files and no
148
dnl non-comment tokens of their own. This leads to a failure to
149
dnl detect the absolute name of <dirent.h>, <signal.h>, <poll.h>
150
dnl and others. The workaround is to force preservation of comments
151
dnl through option -C. This ensures all necessary #line directives
152
dnl are present. GCC supports option -C as well.
154
aix*) gl_absname_cpp="$ac_cpp -C" ;;
155
*) gl_absname_cpp="$ac_cpp" ;;
157
dnl eval is necessary to expand gl_absname_cpp.
158
dnl Ultrix and Pyramid sh refuse to redirect output of eval,
160
AS_VAR_SET([gl_next_header],
161
['"'`(eval "$gl_absname_cpp conftest.$ac_ext") 2>&AS_MESSAGE_LOG_FD |
162
sed -n '\#/]m4_defn([gl_HEADER_NAME])[#{
163
s#.*"\(.*/]m4_defn([gl_HEADER_NAME])[\)".*#\1#
169
AS_VAR_SET([gl_next_header], ['<'gl_HEADER_NAME'>'])
171
AS_VAR_POPDEF([gl_header_exists])])
137
[absolute name of <]m4_defn([gl_HEADER_NAME])[>],
138
m4_defn([gl_next_header]),
139
[AS_VAR_PUSHDEF([gl_header_exists],
140
[ac_cv_header_]m4_defn([gl_HEADER_NAME]))
141
if test AS_VAR_GET(gl_header_exists) = yes; then
144
[[#include <]]m4_dquote(m4_defn([gl_HEADER_NAME]))[[>]]
146
dnl AIX "xlc -E" and "cc -E" omit #line directives for header files
147
dnl that contain only a #include of other header files and no
148
dnl non-comment tokens of their own. This leads to a failure to
149
dnl detect the absolute name of <dirent.h>, <signal.h>, <poll.h>
150
dnl and others. The workaround is to force preservation of comments
151
dnl through option -C. This ensures all necessary #line directives
152
dnl are present. GCC supports option -C as well.
154
aix*) gl_absname_cpp="$ac_cpp -C" ;;
155
*) gl_absname_cpp="$ac_cpp" ;;
157
dnl eval is necessary to expand gl_absname_cpp.
158
dnl Ultrix and Pyramid sh refuse to redirect output of eval,
160
AS_VAR_SET([gl_next_header],
161
['"'`(eval "$gl_absname_cpp conftest.$ac_ext") 2>&AS_MESSAGE_LOG_FD |
162
sed -n '\#/]m4_defn([gl_HEADER_NAME])[#{
163
s#.*"\(.*/]m4_defn([gl_HEADER_NAME])[\)".*#\1#
169
AS_VAR_SET([gl_next_header], ['<'gl_HEADER_NAME'>'])
171
AS_VAR_POPDEF([gl_header_exists])])
174
174
AS_TR_CPP([NEXT_]m4_defn([gl_HEADER_NAME])),