mirror of
https://git.savannah.gnu.org/git/bison.git
synced 2026-03-22 02:33:03 +00:00
build: use our own version of ax_check_link_flag
The message on configure is misleading:
checking whether the linker accepts -std=c++11... yes
checking whether the linker accepts -std=c++14... yes
checking whether the linker accepts -std=c++17... no
It is the compiler that we check, not just the linker.
* m4/ax_check_link_flag.m4: Remove.
* m4/bison-check-compiler-flag.m4: New.
* m4/bison-cxx-std.m4: Use it.
This commit is contained in:
@@ -116,7 +116,7 @@ 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_LINK_FLAG([$f],
|
||||
BISON_CHECK_COMPILER_FLAG([$f],
|
||||
[AC_SUBST([CXX11_CXXFLAGS], [$f]) break],
|
||||
[], [],
|
||||
[_BISON_CXX_COMPILE_STDCXX_11_testbody])
|
||||
@@ -130,7 +130,7 @@ 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_LINK_FLAG([$f],
|
||||
BISON_CHECK_COMPILER_FLAG([$f],
|
||||
[AC_SUBST([CXX14_CXXFLAGS], [$f]) break],
|
||||
[], [],
|
||||
[_BISON_CXX_COMPILE_STDCXX_14_testbody])
|
||||
@@ -144,7 +144,7 @@ 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_LINK_FLAG([$f],
|
||||
BISON_CHECK_COMPILER_FLAG([$f],
|
||||
[AC_SUBST([CXX17_CXXFLAGS], [$f]) break],
|
||||
[], [],
|
||||
[_BISON_CXX_COMPILE_STDCXX_17_testbody])
|
||||
@@ -158,7 +158,7 @@ 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_LINK_FLAG([$f],
|
||||
BISON_CHECK_COMPILER_FLAG([$f],
|
||||
[AC_SUBST([CXX2A_CXXFLAGS], [$f]) break],
|
||||
[], [],
|
||||
[_BISON_CXX_COMPILE_STDCXX_2A_testbody])
|
||||
|
||||
Reference in New Issue
Block a user