Skip to contentSkip to conversation

configure: check for $cxx before use

PATCH In review John Snow 3 participants 3 messages Nov 12, 2015

lore
Share & tools
lore

John Snow

author
#0 lore raw

PATCH 1/1 configure: check for $cxx before use

I broke this when adding checks for clang++.

---
 configure | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
configure +2 -1
index 46fd8bd..f75df4b 100755
@@ -4435,7 +4435,8 @@ fi
 if test "$fortify_source" != "no"; then
   if echo | $cc -dM -E - | grep __clang__ > /dev/null 2>&1 ; then
     fortify_source="no";
-  elif echo | $cxx -dM -E - | grep __clang__ > /dev/null 2>&1 ; then
+  elif test -n "$cxx" &&
+       echo | $cxx -dM -E - | grep __clang__ >/dev/null 2>&1 ; then
     fortify_source="no";
   else
     fortify_source="yes"
Signature · 1 line
2.4.3
#1 lore raw
Quoted 15 lines · John Snow

I broke this when adding checks for clang++.

---
 configure | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
configure +0 -0
index 46fd8bd..f75df4b 100755

configure fi · line 4442

Quoted 9 lines
configure +2 -1
@@ -4435,7 +4435,8 @@ fi
 if test "$fortify_source" != "no"; then
   if echo | $cc -dM -E - | grep __clang__ > /dev/null 2>&1 ; then
     fortify_source="no";
-  elif echo | $cxx -dM -E - | grep __clang__ > /dev/null 2>&1 ; then
+  elif test -n "$cxx" &&
+       echo | $cxx -dM -E - | grep __clang__ >/dev/null 2>&1 ; then
     fortify_source="no";
   else
     fortify_source="yes"

This fixes the problem: no more error message.

Thanks,
Laurent

Reviewed-by on v1 1/1
#2 lore raw
In reply to John Snow
Quoted 14 lines · John Snow

I broke this when adding checks for clang++.

---
 configure | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
configure +0 -0
index 46fd8bd..f75df4b 100755

configure fi · line 4442

Quoted 9 lines
configure +2 -1
@@ -4435,7 +4435,8 @@ fi
 if test "$fortify_source" != "no"; then
   if echo | $cc -dM -E - | grep __clang__ > /dev/null 2>&1 ; then
     fortify_source="no";
-  elif echo | $cxx -dM -E - | grep __clang__ > /dev/null 2>&1 ; then
+  elif test -n "$cxx" &&
+       echo | $cxx -dM -E - | grep __clang__ >/dev/null 2>&1 ; then
     fortify_source="no";
   else
     fortify_source="yes"

I'll apply it directly to master as a buildfix.

thanks
-- PMM