diff mbox

configure: check for $cxx before use

Message ID 1447345789-840-1-git-send-email-jsnow@redhat.com
State New
Headers show

Commit Message

John Snow Nov. 12, 2015, 4:29 p.m. UTC
I broke this when adding checks for clang++.

Reported-by: Laurent Vivier <lvivier@redhat.com>
Signed-off-by: John Snow <jsnow@redhat.com>

---
 configure | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

Comments

Laurent Vivier Nov. 12, 2015, 4:47 p.m. UTC | #1
On 12/11/2015 17:29, John Snow wrote:
> I broke this when adding checks for clang++.
> 
> Reported-by: Laurent Vivier <lvivier@redhat.com>
> Signed-off-by: John Snow <jsnow@redhat.com>
> 
> ---
>  configure | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
> 
> diff --git a/configure b/configure
> index 46fd8bd..f75df4b 100755
> --- a/configure
> +++ b/configure
> @@ -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
Peter Maydell Nov. 12, 2015, 4:54 p.m. UTC | #2
On 12 November 2015 at 16:29, John Snow <jsnow@redhat.com> wrote:
> I broke this when adding checks for clang++.
>
> Reported-by: Laurent Vivier <lvivier@redhat.com>
> Signed-off-by: John Snow <jsnow@redhat.com>
>
> ---
>  configure | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/configure b/configure
> index 46fd8bd..f75df4b 100755
> --- a/configure
> +++ b/configure
> @@ -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"

Reviewed-by: Peter Maydell <peter.maydell@linaro.org>

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

thanks
-- PMM
diff mbox

Patch

diff --git a/configure b/configure
index 46fd8bd..f75df4b 100755
--- a/configure
+++ b/configure
@@ -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"