Fix $(CC) override: use system compiler except on HP-UX and Solaris.
authorBruce Cran <bruce@cran.org.uk>
Tue, 18 Dec 2012 23:07:47 +0000 (23:07 +0000)
committerJens Axboe <axboe@kernel.dk>
Wed, 19 Dec 2012 09:45:48 +0000 (10:45 +0100)
$(CC) was being overridden, preventing the system compiler from
being used. This caused a problem on FreeBSD systems where gcc has
been removed.  Since fio requires gcc on HP-UX and Solaris, always
set $(CC) on those platforms.

Signed-off-by: Jens Axboe <axboe@kernel.dk>
Makefile

index 6a1440c105646ffed65a9b6fe84c822fdf49cb34..743350460dc23ac0c6ace443ddbaf43f84d271f8 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -1,6 +1,4 @@
-ifneq ($(origin CC), environment)
-CC     = $(CROSS_COMPILE)gcc
-endif
+CC ?= gcc
 DEBUGFLAGS = -D_FORTIFY_SOURCE=2 -DFIO_INC_DEBUG
 CPPFLAGS= -D_GNU_SOURCE -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 \
        $(DEBUGFLAGS)
@@ -37,6 +35,7 @@ ifeq ($(UNAME), Android)
   CPPFLAGS += -DFIO_NO_HAVE_SHM_H
 endif
 ifeq ($(UNAME), SunOS)
+  CC      = gcc
   SOURCE += fifo.c lib/strsep.c helpers.c engines/posixaio.c \
                engines/solarisaio.c
   LIBS  += -lpthread -ldl -laio -lrt -lnsl -lsocket
@@ -59,6 +58,7 @@ ifeq ($(UNAME), AIX)
   LDFLAGS += -L/opt/freeware/lib -Wl,-blibpath:/opt/freeware/lib:/usr/lib:/lib -Wl,-bmaxdata:0x80000000
 endif
 ifeq ($(UNAME), HP-UX)
+  CC      = gcc
   SOURCE += fifo.c helpers.c lib/getopt_long.c lib/strsep.c engines/posixaio.c
   LIBS   += -lpthread -ldl -lrt
   CFLAGS += -D_LARGEFILE64_SOURCE