configure: Handle having no c++ compiler in FORTIFY_SOURCE check
PATCH 1/1 configure: Handle having no c++ compiler in FORTIFY_SOURCE check
Our FORTIFY_SOURCE check assumes that $cxx refers to a working C++ compiler, with the result that if you don't happen to have one then configure will spuriously print
configure: line 4685: c++: command not found
Fix this by adding a 'has $cxx' check.
Signed-off-by Peter Maydell <[email protected]>
--- configure | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
configure +1 -1
@@ -4681,7 +4681,7 @@ fi if test "$fortify_source" != "no"; then if echo | $cc -dM -E - | grep __clang__ > /dev/null 2>&1 ; then fortify_source="no"; - elif test -n "$cxx" && + elif test -n "$cxx" && has $cxx && echo | $cxx -dM -E - | grep __clang__ >/dev/null 2>&1 ; then fortify_source="no"; else
Signature · 1 line
2.7.4
Quoted 8 lines · Peter Maydell
Our
FORTIFY_SOURCEcheck assumes that $cxx refers to a working C++ compiler, with the result that if you don't happen to have one then configure will spuriously print
configure: line 4685: c++: command not foundFix this by adding a 'has $cxx' check.
Signed-off-by Peter Maydell <[email protected]>
Reviewed-by Philippe Mathieu-Daudé <[email protected]>
Quoted 18 lines
--- configure | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)configure +1
-1@@ -4681,7 +4681,7 @@ fi if test "$fortify_source" != "no"; then if echo | $cc -dM -E - | grep __clang__ > /dev/null 2>&1 ; then fortify_source="no"; - elif test -n "$cxx" && + elif test -n "$cxx" && has $cxx && echo | $cxx -dM -E - | grep __clang__ >/dev/null 2>&1 ; then fortify_source="no"; else
Michael Tokarev
AppliedApplied to trivial, thanks!
/mjt