$NetBSD: patch-source_mupen64plus-ui-console_projects_unix_Makefile,v 1.4 2013/07/06 23:00:14 othyro Exp $ Adding NetBSD support. Setting LDFLAGS. --- source/mupen64plus-ui-console/projects/unix/Makefile.orig 2013-07-04 00:28:00.000000000 +0000 +++ source/mupen64plus-ui-console/projects/unix/Makefile @@ -38,6 +38,10 @@ endif ifeq ("$(UNAME)","FreeBSD") OS = FREEBSD endif +ifeq ("$(UNAME)","NetBSD") + OS = NETBSD + $(warning OS type "$(UNAME)" not officially supported.') +endif ifeq ("$(UNAME)","OpenBSD") OS = FREEBSD $(warning OS type "$(UNAME)" not officially supported.') @@ -95,14 +99,8 @@ endif OPTFLAGS ?= -O3 -flto WARNFLAGS ?= -Wall -CFLAGS += $(OPTFLAGS) $(WARNFLAGS) -ffast-math -fno-strict-aliasing -I../../src -ifeq ($(OS), MINGW) - CFLAGS += -lpthread - LDLIBS += -lpthread -else - CFLAGS += -pthread - LDLIBS += -pthread -endif +CFLAGS += $(OPTFLAGS) $(WARNFLAGS) -ffast-math -fno-strict-aliasing -I../../src $(shell cpuflags) ${PTHREAD_CFLAGS} +LDLIBS += -Wl,-rpath,${LIBDIR} ${PTHREAD_LDFLAGS} ifeq ($(PIE), 1) CFLAGS += -fPIE @@ -113,7 +111,7 @@ endif # set special flags per-system ifeq ($(OS), LINUX) - LDLIBS += -ldl + LDLIBS += ${DL_LIBS} endif ifeq ($(OS), OSX) # Select the proper SDK