1
# include_next.m4 serial 20
2
dnl Copyright (C) 2006-2011 Free Software Foundation, Inc.
1
# include_next.m4 serial 23
2
dnl Copyright (C) 2006-2012 Free Software Foundation, Inc.
3
3
dnl This file is free software; the Free Software Foundation
4
4
dnl gives unlimited permission to copy and/or distribute it,
5
5
dnl with or without modifications, as long as this notice is preserved.
143
143
# even if the compiler does not support include_next.
144
144
# The three "///" are to pacify Sun C 5.8, which otherwise would say
145
145
# "warning: #include of /usr/include/... may be non-portable".
146
# Use `""', not `<>', so that the /// cannot be confused with a C99 comment.
146
# Use '""', not '<>', so that the /// cannot be confused with a C99 comment.
147
147
# Note: This macro assumes that the header file is not empty after
148
148
# preprocessing, i.e. it does not only define preprocessor macros but also
149
149
# provides some type/enum definitions or function/variable declarations.
207
207
aix*) gl_absname_cpp="$ac_cpp -C" ;;
208
208
*) gl_absname_cpp="$ac_cpp" ;;
213
dnl For the sake of native Windows compilers (excluding gcc),
214
dnl treat backslash as a directory separator, like /.
215
dnl Actually, these compilers use a double-backslash as
216
dnl directory separator, inside the
217
dnl # line "filename"
219
gl_dirsep_regex='[/\\]'
225
dnl A sed expression that turns a string into a basic regular
226
dnl expression, for use within "/.../".
227
gl_make_literal_regex_sed='s,[]$^\\.*/[],\\&,g'
229
gl_header_literal_regex=`echo ']m4_defn([gl_HEADER_NAME])[' \
230
| sed -e "$gl_make_literal_regex_sed"`
231
gl_absolute_header_sed="/${gl_dirsep_regex}${gl_header_literal_regex}/"'{
232
s/.*"\(.*'"${gl_dirsep_regex}${gl_header_literal_regex}"'\)".*/\1/
210
239
dnl eval is necessary to expand gl_absname_cpp.
211
240
dnl Ultrix and Pyramid sh refuse to redirect output of eval,
212
241
dnl so use subshell.
213
242
AS_VAR_SET(gl_next_header,
214
243
['"'`(eval "$gl_absname_cpp conftest.$ac_ext") 2>&AS_MESSAGE_LOG_FD |
215
sed -n '\#/]m4_defn([gl_HEADER_NAME])[#{
216
s#.*"\(.*/]m4_defn([gl_HEADER_NAME])[\)".*#\1#
244
sed -n "$gl_absolute_header_sed"`'"'])
221
245
m4_if([$2], [check],
223
247
AS_VAR_SET(gl_next_header, ['<'gl_HEADER_NAME'>'])