$NetBSD: patch-source_mupen64plus-audio-sdl_projects_unix_Makefile,v 1.4 2013/07/06 23:00:14 othyro Exp $

Adding NetBSD support. Setting OS, SO_NAME, CFLAGS, LDFLAGS, LIBS, etc.

--- source/mupen64plus-audio-sdl/projects/unix/Makefile.orig	2013-07-04 00:28:02.000000000 +0000
+++ source/mupen64plus-audio-sdl/projects/unix/Makefile
@@ -55,6 +55,12 @@ ifeq ("$(UNAME)","OpenBSD")
   SO_EXTENSION = so
   $(warning OS type "$(UNAME)" not officially supported.')
 endif
+ifeq ("$(UNAME)","NetBSD")
+  OS = NETBSD
+  SHARED = -shared
+  SO_EXTENSION = so
+  $(warning OS type "$(UNAME)" not officially supported.')
+endif
 ifneq ("$(filter GNU/kFreeBSD kfreebsd,$(UNAME))","")
   OS = LINUX
   SHARED = -shared
@@ -119,7 +125,7 @@ endif
 # base CFLAGS, LDLIBS, and LDFLAGS
 OPTFLAGS ?= -O3 -flto
 WARNFLAGS ?= -Wall
-CFLAGS += $(OPTFLAGS) $(WARNFLAGS) -ffast-math -fno-strict-aliasing -fvisibility=hidden -I../../src
+CFLAGS += $(OPTFLAGS) $(WARNFLAGS) -ffast-math -fno-strict-aliasing -fvisibility=hidden -I../../src $(shell cpuflags)
 LDFLAGS += $(SHARED)
 
 # Since we are building a shared library, we must compile with -fPIC on some architectures
@@ -346,7 +352,7 @@ all: $(TARGET)
 
 install: $(TARGET)
 	$(INSTALL) -d "$(DESTDIR)$(PLUGINDIR)"
-	$(INSTALL) -m 0644 $(INSTALL_STRIP_FLAG) $(TARGET) "$(DESTDIR)$(PLUGINDIR)"
+	$(INSTALL) -m 0755 $(INSTALL_STRIP_FLAG) $(TARGET) "$(DESTDIR)$(PLUGINDIR)"
 
 uninstall:
 	$(RM) "$(DESTDIR)$(PLUGINDIR)/$(TARGET)"
