[Openswan dev] [PATCH] Makefile: use CC for version test instead of gcc

Gustavo Zacarias gustavo at zacarias.com.ar
Sun Mar 30 07:56:08 EDT 2014


Use $(CC) for the version test since that's different from gcc when
cross-compiling.

Signed-off-by: Gustavo Zacarias <gustavo at zacarias.com.ar>
---
 lib/libopenswan/Makefile | 2 +-
 programs/pluto/Makefile  | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/lib/libopenswan/Makefile b/lib/libopenswan/Makefile
index 3649fe7..06f5317 100644
--- a/lib/libopenswan/Makefile
+++ b/lib/libopenswan/Makefile
@@ -90,7 +90,7 @@ CFLAGS+= -Wpointer-arith
 CFLAGS+= -Wno-error=cast-qual
 
 # Check if GCC's version is recent enough
-GCC_VERSION_GE_46:=$(shell test `gcc -dumpversion | sed 's/^\([0-9]\)\.\([0-9]\).*/\1\2/'` -ge 46 && echo true || echo false)
+GCC_VERSION_GE_46:=$(shell test `$(CC) -dumpversion | sed 's/^\([0-9]\)\.\([0-9]\).*/\1\2/'` -ge 46 && echo true || echo false)
 ifeq ($(GCC_VERSION_GE_46),true)
 # some junk left in alg_info.c
 CFLAGS+= -Wno-error=cpp
diff --git a/programs/pluto/Makefile b/programs/pluto/Makefile
index 8e4bc89..ed5e9dc 100644
--- a/programs/pluto/Makefile
+++ b/programs/pluto/Makefile
@@ -48,7 +48,7 @@ CPPFLAGS = $(HDRDIRS) $(DEFINES) \
 # must turn this off due to myid.c
 CFLAGS+= -Wno-error=cast-qual
 # Check if GCC's version is recent enough
-GCC_VERSION_GE_46:=$(shell test `gcc -dumpversion | sed 's/^\([0-9]\)\.\([0-9]\).*/\1\2/'` -ge 46 && echo true || echo false)
+GCC_VERSION_GE_46:=$(shell test `$(CC) -dumpversion | sed 's/^\([0-9]\)\.\([0-9]\).*/\1\2/'` -ge 46 && echo true || echo false)
 ifeq ($(GCC_VERSION_GE_46),true)
 CFLAGS+= -Wno-error=cpp
 endif
-- 
1.8.3.2



More information about the Dev mailing list