From 58940e1d4b53cc3e029b94e2a2e00a5d3f9ff9e1 Mon Sep 17 00:00:00 2001 From: Alan Third Date: Sun, 5 Sep 2021 14:04:45 +0100 Subject: [PATCH] Don't add flags when MacPorts is installed but GCC isn't * configure.ac: Check whether there is any value in $PORT_PACKAGE before trying to use it. --- configure.ac | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/configure.ac b/configure.ac index 6d204b6103..fc4cf088ff 100644 --- a/configure.ac +++ b/configure.ac @@ -3840,12 +3840,14 @@ AC_DEFUN # instance). PORT_PACKAGE=$(port installed active | grep '^ *gcc@<:@0-9@:>@* ' | \ awk '{ print $1; }') - MACPORTS_LIBGCCJIT_INCLUDE=$(dirname $(port contents $PORT_PACKAGE | \ - grep libgccjit.h)) - MACPORTS_LIBGCCJIT_LIB=$(dirname $(port contents $PORT_PACKAGE | \ + if test -n $PORT_PACKAGE; then + MACPORTS_LIBGCCJIT_INCLUDE=$(dirname $(port contents $PORT_PACKAGE | \ + grep libgccjit.h)) + MACPORTS_LIBGCCJIT_LIB=$(dirname $(port contents $PORT_PACKAGE | \ grep libgccjit.dylib)) - CFLAGS="$CFLAGS -I${MACPORTS_LIBGCCJIT_INCLUDE}" - LDFLAGS="$LDFLAGS -L${MACPORTS_LIBGCCJIT_LIB}" + CFLAGS="$CFLAGS -I${MACPORTS_LIBGCCJIT_INCLUDE}" + LDFLAGS="$LDFLAGS -L${MACPORTS_LIBGCCJIT_LIB}" + fi fi # Check if libgccjit is available. -- 2.30.2