pkgsrc/emulators/ucon64/patches/patch-Makefile
2018-03-07 12:34:55 +00:00

81 lines
2.6 KiB
Text

$NetBSD: patch-Makefile,v 1.2 2018/03/07 12:34:55 wiz Exp $
Patch from upstream to improve build on NetBSD.
--- Makefile.orig 2017-08-05 23:02:35.000000000 +0000
+++ Makefile
@@ -2,7 +2,7 @@
CC=gcc
CFLAGS0:=$(CFLAGS)
-CFLAGS+=-I. -Wall -W -O3
+CFLAGS+=-I. -Wall -W
LDFLAGS0:=$(LDFLAGS)
ifeq ($(findstring darwin,$(OSTYPE)),) # false if OSTYPE contains "darwin"
# On Mac OS X using -s gives the following warning:
@@ -54,9 +54,14 @@ endif
else # UNIX, BeOS or Mac OS X (Darwin)
+ifdef USE_PARALLEL
ifeq ($(findstring openbsd,$(OSTYPE)),openbsd) # for example "openbsd3.4"
-# i386_iopl() is located in libi386.a
-LDFLAGS+=$(LIBI386)
+# i386_iopl() is located in libi386.a. Use -lamd64 for amd64_iopl().
+LDFLAGS+=$(LIBIOPL_OPENBSD)
+endif
+ifeq ($(findstring netbsd,$(OSTYPE)),netbsd)
+LDFLAGS+=$(LIBIOPL_NETBSD)
+endif
endif
ifdef USE_DISCMAGE
@@ -72,10 +77,12 @@ ifdef DLOPEN
ifneq ($(OSTYPE),beos)
ifeq ($(findstring freebsd,$(OSTYPE)),) # false if OSTYPE contains "freebsd"
ifeq ($(findstring openbsd,$(OSTYPE)),) # false if OSTYPE contains "openbsd"
+ifeq ($(findstring netbsd,$(OSTYPE)),) # false if OSTYPE contains "netbsd"
LDFLAGS+=-ldl
endif
endif
endif
+endif
else # DLOPEN
ifdef USE_DISCMAGE # GNU specific: "simply expanded variable"
@@ -231,7 +238,7 @@ ifdef USE_DISCMAGE
.PHONY: libdiscmage/$(FULLLIBNAME_DM)
libdiscmage/$(FULLLIBNAME_DM):
ifeq ($(GCC_WIN),1)
- cd libdiscmage && CFLAGS=$(CFLAGS0) LDFLAGS=$(LDFLAGS0) $(MAKE)
+ cd libdiscmage && CFLAGS="$(CFLAGS0)" LDFLAGS="$(LDFLAGS0)" $(MAKE)
else
ifdef DJGPP
cd libdiscmage
@@ -240,7 +247,7 @@ ifdef DJGPP
$(MAKE)
cd ..
else
- cd libdiscmage && CFLAGS=$(CFLAGS0) LDFLAGS=$(LDFLAGS0) $(MAKE)
+ cd libdiscmage && CFLAGS="$(CFLAGS0)" LDFLAGS="$(LDFLAGS0)" $(MAKE)
endif # DJGPP
endif # GCC_WIN
endif # USE_DISCMAGE
@@ -250,7 +257,7 @@ ifdef USE_LIBCD64
#.PHONY: backup/libcd64/libcd64.a Do not force linking an executable.
backup/libcd64/libcd64.a:
ifeq ($(GCC_WIN),1)
- cd backup/libcd64 && CFLAGS=$(CFLAGS0) LDFLAGS=$(LDFLAGS0) $(MAKE)
+ cd backup/libcd64 && CFLAGS="$(CFLAGS0)" LDFLAGS="$(LDFLAGS0)" $(MAKE)
else
ifdef DJGPP
cd backup/libcd64
@@ -259,7 +266,7 @@ ifdef DJGPP
$(MAKE)
cd ../..
else
- cd backup/libcd64 && CFLAGS=$(CFLAGS0) LDFLAGS=$(LDFLAGS0) $(MAKE)
+ cd backup/libcd64 && CFLAGS="$(CFLAGS0)" LDFLAGS="$(LDFLAGS0)" $(MAKE)
endif # DJGPP
endif # GCC_WIN
endif # USE_LIBCD64