$NetBSD: patch-tools_llvm-shlib_Makefile,v 1.2 2015/04/26 13:08:38 tnn Exp $

Add NetBSD support.
Use full paths to archive files instead of -lfoo to avoid wrapper reordering.

--- tools/llvm-shlib/Makefile.orig	2014-05-13 19:37:03.000000000 +0000
+++ tools/llvm-shlib/Makefile
@@ -53,18 +53,18 @@ ifeq ($(HOST_OS),Darwin)
     LLVMLibsOptions    := $(LLVMLibsOptions) -all_load
 endif
 
-ifeq ($(HOST_OS), $(filter $(HOST_OS), DragonFly Linux FreeBSD GNU/kFreeBSD OpenBSD GNU Bitrig))
+ifeq ($(HOST_OS), $(filter $(HOST_OS), DragonFly Linux FreeBSD GNU/kFreeBSD NetBSD OpenBSD GNU Bitrig))
     # Include everything from the .a's into the shared library.
-    LLVMLibsOptions := -Wl,--whole-archive $(LLVMLibsOptions) \
+    LLVMLibsOptions := -Wl,--whole-archive $(LLVMLibsPaths) \
                        -Wl,--no-whole-archive
 endif
 
-ifeq ($(HOST_OS), $(filter $(HOST_OS), DragonFly Linux FreeBSD GNU/kFreeBSD GNU))
+ifeq ($(HOST_OS), $(filter $(HOST_OS), DragonFly Linux FreeBSD GNU/kFreeBSD NetBSD GNU))
     # Add soname to the library.
     LLVMLibsOptions += -Wl,--soname,lib$(LIBRARYNAME)$(SHLIBEXT)
 endif
 
-ifeq ($(HOST_OS), $(filter $(HOST_OS), Linux GNU GNU/kFreeBSD))
+ifeq ($(HOST_OS), $(filter $(HOST_OS), Linux GNU GNU/kFreeBSD NetBSD))
     # Don't allow unresolved symbols.
     LLVMLibsOptions += -Wl,--no-undefined
 endif
