NetBSD: Don't link with -ldl for dlopen(3) on NetBSD
authorKamil Rytarowski <n54@gmx.com>
Fri, 22 Jan 2016 15:16:21 +0000 (16:16 +0100)
committerKamil Rytarowski <n54@gmx.com>
Fri, 22 Jan 2016 16:01:51 +0000 (17:01 +0100)
NAME
     dlopen, dlclose, dlsym, dlvsym, dladdr, dlctl, dlerror - dynamic link
     interface

LIBRARY
     (These functions are not in a library.  They are included in every
     dynamically linked program automatically.)

SYNOPSIS
     #include <dlfcn.h>

     void *
     dlopen(const char *path, int mode);

src/coreclr/hosts/unixcoreconsole/CMakeLists.txt
src/coreclr/hosts/unixcorerun/CMakeLists.txt
src/ilasm/CMakeLists.txt
src/ildasm/exe/CMakeLists.txt

index ec5f0e7..f4840ed 100644 (file)
@@ -12,12 +12,12 @@ add_executable(coreconsole
     ${CORECONSOLE_SOURCES}
 )
 
-# FreeBSD implements dlopen in libc
-if(NOT CMAKE_SYSTEM_NAME STREQUAL FreeBSD)
+# FreeBSD and NetBSD implement dlopen(3) in libc
+if(NOT CMAKE_SYSTEM_NAME STREQUAL FreeBSD AND NOT CMAKE_SYSTEM_NAME STREQUAL NetBSD)
     target_link_libraries(coreconsole 
         dl
     )
-endif(NOT CMAKE_SYSTEM_NAME STREQUAL FreeBSD)
+endif(NOT CMAKE_SYSTEM_NAME STREQUAL FreeBSD AND NOT CMAKE_SYSTEM_NAME STREQUAL NetBSD)
 
 # Libc turns locks into no-ops if pthread was not loaded into process yet. Loading
 # pthread by the process executable ensures that all locks are initialized properly.
index 48da17c..4563ba9 100644 (file)
@@ -12,12 +12,12 @@ add_executable(corerun
     ${CORERUN_SOURCES}
 )
 
-# FreeBSD implements dlopen in libc
-if(NOT CMAKE_SYSTEM_NAME STREQUAL FreeBSD)
+# FreeBSD and NetBSD implement dlopen(3) in libc
+if(NOT CMAKE_SYSTEM_NAME STREQUAL FreeBSD AND NOT CMAKE_SYSTEM_NAME STREQUAL NetBSD)
     target_link_libraries(corerun 
         dl
     )
-endif(NOT CMAKE_SYSTEM_NAME STREQUAL FreeBSD)
+endif(NOT CMAKE_SYSTEM_NAME STREQUAL FreeBSD AND NOT CMAKE_SYSTEM_NAME STREQUAL NetBSD)
 
 # Libc turns locks into no-ops if pthread was not loaded into process yet. Loading
 # pthread by the process executable ensures that all locks are initialized properly.
index 5e82cd2..4c5a7f6 100644 (file)
@@ -60,12 +60,12 @@ if(CLR_CMAKE_PLATFORM_UNIX)
     palrt
   )
 
-  # FreeBSD implements dlopen in libc
-  if(NOT CMAKE_SYSTEM_NAME STREQUAL FreeBSD)
+  # FreeBSD and NetBSD implement dlopen(3) in libc
+  if(NOT CMAKE_SYSTEM_NAME STREQUAL FreeBSD AND NOT CMAKE_SYSTEM_NAME STREQUAL NetBSD)
     target_link_libraries(ilasm
       dl
     )
-  endif(NOT CMAKE_SYSTEM_NAME STREQUAL FreeBSD)
+  endif(NOT CMAKE_SYSTEM_NAME STREQUAL FreeBSD AND NOT CMAKE_SYSTEM_NAME STREQUAL NetBSD)
 
 else()
   target_link_libraries(ilasm
index 7d86bf4..8a57044 100644 (file)
@@ -54,12 +54,12 @@ if(CLR_CMAKE_PLATFORM_UNIX)
         palrt
     )
 
-    # FreeBSD implements dlopen in libc
-    if(NOT CMAKE_SYSTEM_NAME STREQUAL FreeBSD)
+    # FreeBSD and NetBSD implement dlopen(3) in libc
+    if(NOT CMAKE_SYSTEM_NAME STREQUAL FreeBSD AND NOT CMAKE_SYSTEM_NAME STREQUAL NetBSD)
         target_link_libraries(ildasm
             dl
         )
-    endif(NOT CMAKE_SYSTEM_NAME STREQUAL FreeBSD)
+    endif(NOT CMAKE_SYSTEM_NAME STREQUAL FreeBSD AND NOT CMAKE_SYSTEM_NAME STREQUAL NetBSD)
 else()
     target_link_libraries(ildasm
         ${ILDASM_LINK_LIBRARIES}