aboutsummaryrefslogtreecommitdiffstats
path: root/win32/Makefile
diff options
context:
space:
mode:
authorH. Peter Anvin <hpa@zytor.com>2008-07-16 17:01:33 -0700
committerH. Peter Anvin <hpa@zytor.com>2008-07-16 17:01:33 -0700
commit963a38fc45a50d555d61f4a4640b02d7c398b4f4 (patch)
treea38961de7f3fc1753f3176654c3b18c0c35c254f /win32/Makefile
parentb852724c9d4b2fe91c327447666c51409fc263f8 (diff)
downloadsyslinux-963a38fc45a50d555d61f4a4640b02d7c398b4f4.tar.gz
syslinux-963a38fc45a50d555d61f4a4640b02d7c398b4f4.tar.xz
syslinux-963a38fc45a50d555d61f4a4640b02d7c398b4f4.zip
win32: search for a mingw compiler under several names
Search for the MinGW compiler under several names, since different distros like to install it under different names. What's wrong with a simple mingw- prefix?? Signed-off-by: H. Peter Anvin <hpa@zytor.com>
Diffstat (limited to 'win32/Makefile')
-rw-r--r--win32/Makefile31
1 files changed, 14 insertions, 17 deletions
diff --git a/win32/Makefile b/win32/Makefile
index fe94d1e4..9ea96435 100644
--- a/win32/Makefile
+++ b/win32/Makefile
@@ -19,30 +19,27 @@
OSTYPE = $(shell uname -msr)
ifeq ($(findstring CYGWIN,$(OSTYPE)),CYGWIN)
-WINCC = gcc
-WINAR = ar
-WINRANLIB = ranlib
-WINCFLAGS = -mno-cygwin -W -Wall -Os -fomit-frame-pointer -D_FILE_OFFSET_BITS=64
-WINPIC =
-WINLDFLAGS = -mno-cygwin -Os -s
+## Compiling on Cygwin
+WINPREFIX :=
+WINCFLAGS := -mno-cygwin -W -Wall -Os -fomit-frame-pointer -D_FILE_OFFSET_BITS=64
+WINLDFLAGS := -mno-cygwin -Os -s
else
+## Compiling on some variant of MinGW
ifeq ($(findstring MINGW32,$(OSTYPE)),MINGW32)
-WINCC = gcc
-WINAR = ar
-WINRANLIB = ranlib
+WINPREFIX :=
else
-WINCC = i386-mingw32-gcc
-WINAR = i386-mingw32-ar
-WINRANLIB = i386-mingw32-ranlib
+WINPREFIX := $(shell find-mingw.sh gcc)
endif
-
-WINCFLAGS = -W -Wall -Wno-sign-compare -Os -fomit-frame-pointer \
- -D_FILE_OFFSET_BITS=64
-WINPIC =
-WINLDFLAGS = -Os -s
+WINCFLAGS := -W -Wall -Wno-sign-compare -Os -fomit-frame-pointer \
+ -D_FILE_OFFSET_BITS=64
+WINLDFLAGS := -Os -s
endif
WINCFLAGS += -I. -I.. -I../libfat -I../libinstaller
+WINCC := $(WINPREFIX)gcc
+WINAR := $(WINPREFIX)ar
+WINRANLIB := $(WINPREFIX)ranlib
+
WINCC_IS_GOOD := $(shell $(WINCC) $(WINCFLAGS) $(WINLDFLAGS) -o hello.exe hello.c >/dev/null 2>&1 ; echo $$?)
.SUFFIXES: .c .o .i .s .S