mirror of
https://git.savannah.gnu.org/git/bison.git
synced 2026-03-19 09:13:04 +00:00
build: don't accept a broken standard lib for C++
On the CI, we had failures such as:
./c++.at:401: $PREPARSER ./list
stderr:
./list: error while loading shared libraries: libc++.so.1:
cannot open shared object file: No such file or directory
because we accepted `-std=c++ -stdlib=libc++` although libc++ is not
installed on the machine.
* m4/ax_check_compile_flag.m4 (AX_CHECK_COMPILE_FLAG): Rewrite as...
* m4/bison-check-compile-flag.m4 (BISON_CHECK_COMPILE_FLAG): this, so
that we use AC_LINK_IFELSE to check the compiler (and its std lib)
instead of AC_COMPILE_IFELSE.
This commit is contained in:
@@ -116,10 +116,10 @@ AC_DEFUN([BISON_CXX_COMPILE_STDCXX_11],
|
||||
AC_LANG_PUSH([C++])
|
||||
for f in '-std=c++11' '-std=c++11 -stdlib=libc++'
|
||||
do
|
||||
AX_CHECK_COMPILE_FLAG([$f],
|
||||
[AC_SUBST([CXX11_CXXFLAGS], [$f]) break],
|
||||
[], [],
|
||||
[_BISON_CXX_COMPILE_STDCXX_11_testbody])
|
||||
AX_CHECK_LINK_FLAG([$f],
|
||||
[AC_SUBST([CXX11_CXXFLAGS], [$f]) break],
|
||||
[], [],
|
||||
[_BISON_CXX_COMPILE_STDCXX_11_testbody])
|
||||
done
|
||||
AC_LANG_POP([C++])
|
||||
])
|
||||
@@ -130,10 +130,10 @@ AC_DEFUN([BISON_CXX_COMPILE_STDCXX_14],
|
||||
AC_LANG_PUSH([C++])
|
||||
for f in '-std=c++14' '-std=c++14 -stdlib=libc++'
|
||||
do
|
||||
AX_CHECK_COMPILE_FLAG([$f],
|
||||
[AC_SUBST([CXX14_CXXFLAGS], [$f]) break],
|
||||
[], [],
|
||||
[_BISON_CXX_COMPILE_STDCXX_14_testbody])
|
||||
AX_CHECK_LINK_FLAG([$f],
|
||||
[AC_SUBST([CXX14_CXXFLAGS], [$f]) break],
|
||||
[], [],
|
||||
[_BISON_CXX_COMPILE_STDCXX_14_testbody])
|
||||
done
|
||||
AC_LANG_POP([C++])
|
||||
])
|
||||
@@ -144,10 +144,10 @@ AC_DEFUN([BISON_CXX_COMPILE_STDCXX_17],
|
||||
AC_LANG_PUSH([C++])
|
||||
for f in '-std=c++17' '-std=c++17 -stdlib=libc++'
|
||||
do
|
||||
AX_CHECK_COMPILE_FLAG([$f],
|
||||
[AC_SUBST([CXX17_CXXFLAGS], [$f]) break],
|
||||
[], [],
|
||||
[_BISON_CXX_COMPILE_STDCXX_17_testbody])
|
||||
AX_CHECK_LINK_FLAG([$f],
|
||||
[AC_SUBST([CXX17_CXXFLAGS], [$f]) break],
|
||||
[], [],
|
||||
[_BISON_CXX_COMPILE_STDCXX_17_testbody])
|
||||
done
|
||||
AC_LANG_POP([C++])
|
||||
])
|
||||
@@ -158,10 +158,10 @@ AC_DEFUN([BISON_CXX_COMPILE_STDCXX_2A],
|
||||
AC_LANG_PUSH([C++])
|
||||
for f in '-std=c++2a' '-std=c++2a -stdlib=libc++'
|
||||
do
|
||||
AX_CHECK_COMPILE_FLAG([$f],
|
||||
[AC_SUBST([CXX2A_CXXFLAGS], [$f]) break],
|
||||
[], [],
|
||||
[_BISON_CXX_COMPILE_STDCXX_2A_testbody])
|
||||
AX_CHECK_LINK_FLAG([$f],
|
||||
[AC_SUBST([CXX2A_CXXFLAGS], [$f]) break],
|
||||
[], [],
|
||||
[_BISON_CXX_COMPILE_STDCXX_2A_testbody])
|
||||
done
|
||||
AC_LANG_POP([C++])
|
||||
])
|
||||
|
||||
Reference in New Issue
Block a user