$NetBSD: patch-mupen64plus-video-arachnoid_projects_unix_Makefile,v 1.1 2013/07/07 12:48:16 othyro Exp $

Add NetBSD support. Fix DL_LIBS and perms for INSTALL_LIB.

--- mupen64plus-video-arachnoid/projects/unix/Makefile.orig	2013-07-05 02:03:20.000000000 +0000
+++ mupen64plus-video-arachnoid/projects/unix/Makefile
@@ -48,6 +48,12 @@ ifeq ("$(UNAME)","FreeBSD")
   SO_EXTENSION = so
   SHARED = -shared
 endif
+ifeq ("$(UNAME)","NetBSD")
+  OS = NETBSD
+  SHARED = -shared
+  SO_EXTENSION = so
+  $(warning OS type "$(UNAME)" not officially supported.')
+endif
 ifeq ("$(UNAME)","OpenBSD")
   OS = FREEBSD
   SO_EXTENSION = so
@@ -114,7 +120,7 @@ WARNFLAGS ?= -Wall
 CFLAGS += $(OPTFLAGS) $(WARNFLAGS) -ffast-math -fno-strict-aliasing -fvisibility=hidden -I../../src \
 		 -I../../src/hash -I../../src/ucodes -I../../src/GBI -I../../src/RDP -I../../src/utils \
 		 -I../../src/log -I../../src/RSP -I../../src/framebuffer -I../../src/math -I../../src/renderer \
-		 -I../../src/Assembler -I../../src/texture -I../../src/config -I../../src/Combiner 
+		 -I../../src/Assembler -I../../src/texture -I../../src/config -I../../src/Combiner $(shell cpuflags)
 CXXFLAGS += -fvisibility-inlines-hidden
 LDFLAGS += $(SHARED)
 
@@ -171,7 +177,7 @@ else
   CFLAGS += -pthread
 endif
 ifeq ($(OS), LINUX)
-  LDLIBS += -ldl 
+  LDLIBS += ${DL_LIBS}
 endif
 ifeq ($(OS), FREEBSD)
   LDLIBS += -lc
@@ -371,7 +377,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)"
