Skip to contentSkip to conversation

configure: Handle having no c++ compiler in FORTIFY_SOURCE check

PATCH Applied Peter Maydell 3 participants 3 messages Jun 26, 2017 – Jun 27, 2017

lore
Share & tools
lore
#0 lore raw

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.

---
 configure | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
configure +1 -1
index c571ad1..a435908 100755
@@ -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
Reviewed-by on v1 1/1
#1 lore raw
Quoted 8 lines · Peter Maydell

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.

Quoted 18 lines
---
  configure | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)
configure +1 -1
index c571ad1..a435908 100755
@@ -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