|
version 1.1.1.2, 2012/05/29 09:29:44
|
version 1.1.1.3, 2021/03/17 13:38:46
|
|
Line 1
|
Line 1
|
| # include_next.m4 serial 20 | # include_next.m4 serial 24 |
| dnl Copyright (C) 2006-2011 Free Software Foundation, Inc. | dnl Copyright (C) 2006-2019 Free Software Foundation, Inc. |
| dnl This file is free software; the Free Software Foundation |
dnl This file is free software; the Free Software Foundation |
| dnl gives unlimited permission to copy and/or distribute it, |
dnl gives unlimited permission to copy and/or distribute it, |
| dnl with or without modifications, as long as this notice is preserved. |
dnl with or without modifications, as long as this notice is preserved. |
| |
|
| dnl From Paul Eggert and Derek Price. |
dnl From Paul Eggert and Derek Price. |
| |
|
| dnl Sets INCLUDE_NEXT and PRAGMA_SYSTEM_HEADER. | dnl Sets INCLUDE_NEXT, INCLUDE_NEXT_AS_FIRST_DIRECTIVE, PRAGMA_SYSTEM_HEADER, |
| | dnl and PRAGMA_COLUMNS. |
| dnl |
dnl |
| dnl INCLUDE_NEXT expands to 'include_next' if the compiler supports it, or to |
dnl INCLUDE_NEXT expands to 'include_next' if the compiler supports it, or to |
| dnl 'include' otherwise. |
dnl 'include' otherwise. |
|
Line 143 choke me
|
Line 144 choke me
|
| # even if the compiler does not support include_next. |
# even if the compiler does not support include_next. |
| # The three "///" are to pacify Sun C 5.8, which otherwise would say |
# The three "///" are to pacify Sun C 5.8, which otherwise would say |
| # "warning: #include of /usr/include/... may be non-portable". |
# "warning: #include of /usr/include/... may be non-portable". |
| # Use `""', not `<>', so that the /// cannot be confused with a C99 comment. | # Use '""', not '<>', so that the /// cannot be confused with a C99 comment. |
| # Note: This macro assumes that the header file is not empty after |
# Note: This macro assumes that the header file is not empty after |
| # preprocessing, i.e. it does not only define preprocessor macros but also |
# preprocessing, i.e. it does not only define preprocessor macros but also |
| # provides some type/enum definitions or function/variable declarations. |
# provides some type/enum definitions or function/variable declarations. |
|
Line 192 dnl until we can assume autoconf 2.64 or newer.
|
Line 193 dnl until we can assume autoconf 2.64 or newer.
|
| if test AS_VAR_GET(gl_header_exists) = yes; then |
if test AS_VAR_GET(gl_header_exists) = yes; then |
| AS_VAR_POPDEF([gl_header_exists]) |
AS_VAR_POPDEF([gl_header_exists]) |
| ]) |
]) |
| AC_LANG_CONFTEST( | gl_ABSOLUTE_HEADER_ONE(gl_HEADER_NAME) |
| [AC_LANG_SOURCE( | AS_VAR_COPY([gl_header], [gl_cv_absolute_]AS_TR_SH(gl_HEADER_NAME)) |
| [[#include <]]m4_dquote(m4_defn([gl_HEADER_NAME]))[[>]] | AS_VAR_SET(gl_next_header, ['"'$gl_header'"']) |
| )]) | |
| dnl AIX "xlc -E" and "cc -E" omit #line directives for header | |
| dnl files that contain only a #include of other header files and | |
| dnl no non-comment tokens of their own. This leads to a failure | |
| dnl to detect the absolute name of <dirent.h>, <signal.h>, | |
| dnl <poll.h> and others. The workaround is to force preservation | |
| dnl of comments through option -C. This ensures all necessary | |
| dnl #line directives are present. GCC supports option -C as well. | |
| case "$host_os" in | |
| aix*) gl_absname_cpp="$ac_cpp -C" ;; | |
| *) gl_absname_cpp="$ac_cpp" ;; | |
| esac | |
| dnl eval is necessary to expand gl_absname_cpp. | |
| dnl Ultrix and Pyramid sh refuse to redirect output of eval, | |
| dnl so use subshell. | |
| AS_VAR_SET(gl_next_header, | |
| ['"'`(eval "$gl_absname_cpp conftest.$ac_ext") 2>&AS_MESSAGE_LOG_FD | | |
| sed -n '\#/]m4_defn([gl_HEADER_NAME])[#{ | |
| s#.*"\(.*/]m4_defn([gl_HEADER_NAME])[\)".*#\1# | |
| s#^/[^/]#//&# | |
| p | |
| q | |
| }'`'"']) | |
| m4_if([$2], [check], |
m4_if([$2], [check], |
| [else |
[else |
| AS_VAR_SET(gl_next_header, ['<'gl_HEADER_NAME'>']) |
AS_VAR_SET(gl_next_header, ['<'gl_HEADER_NAME'>']) |