mirror of
https://sourceware.org/git/glibc.git
synced 2024-11-21 20:40:05 +00:00
Rewrite find_cxx_header config configure.ac
With clang if the main file is <stdin>, the first non-main-file
dependency is not listed in the -MP output. Although it was fixed
on clang-16 [1], this change adds portability for older version.
[1] ff9576f745
Reviewed-by: Fangrui Song <maskray@google.com>
This commit is contained in:
parent
d1d0162e50
commit
596183a1ee
4
configure
vendored
4
configure
vendored
@ -5669,8 +5669,8 @@ fi
|
||||
# copy of those headers in Makerules.
|
||||
if test -n "$CXX"; then
|
||||
find_cxx_header () {
|
||||
echo "#include <$1>" | $CXX -M -MP -x c++ - 2>/dev/null \
|
||||
| sed -n "\,$1:,{s/:\$//;p}"
|
||||
echo "#include <$1>" | $CXX -H -fsyntax-only -x c++ - 2>&1 \
|
||||
| $AWK '$1 == "."{print $2}'
|
||||
}
|
||||
CXX_CSTDLIB_HEADER="$(find_cxx_header cstdlib)"
|
||||
CXX_CMATH_HEADER="$(find_cxx_header cmath)"
|
||||
|
@ -1137,8 +1137,8 @@ AC_SUBST(CXX_SYSINCLUDES)
|
||||
# copy of those headers in Makerules.
|
||||
if test -n "$CXX"; then
|
||||
find_cxx_header () {
|
||||
echo "#include <$1>" | $CXX -M -MP -x c++ - 2>/dev/null \
|
||||
| sed -n "\,$1:,{s/:\$//;p}"
|
||||
echo "#include <$1>" | $CXX -H -fsyntax-only -x c++ - 2>&1 \
|
||||
| $AWK '$1 == "."{print $2}'
|
||||
}
|
||||
CXX_CSTDLIB_HEADER="$(find_cxx_header cstdlib)"
|
||||
CXX_CMATH_HEADER="$(find_cxx_header cmath)"
|
||||
|
Loading…
Reference in New Issue
Block a user