File tree Expand file tree Collapse file tree 3 files changed +13
-1
lines changed
hadoop-hdfs-project/hadoop-hdfs Expand file tree Collapse file tree 3 files changed +13
-1
lines changed Original file line number Diff line number Diff line change @@ -369,6 +369,8 @@ Release 2.3.0 - UNRELEASED
369369 HDFS-5336. DataNode should not output 'StartupProgress' metrics.
370370 (Akira Ajisaka via cnauroth)
371371
372+ HDFS-5365. Fix libhdfs compile error on FreeBSD9. (Radim Kolar via cnauroth)
373+
372374Release 2.2.1 - UNRELEASED
373375
374376 INCOMPATIBLE CHANGES
Original file line number Diff line number Diff line change @@ -62,6 +62,11 @@ endfunction()
6262INCLUDE (CheckCSourceCompiles)
6363CHECK_C_SOURCE_COMPILES("int main(void) { static __thread int i = 0; return 0; }" HAVE_BETTER_TLS)
6464
65+ # Check if we need to link dl library to get dlopen.
66+ # dlopen on Linux is in separate library but on FreeBSD its in libc
67+ INCLUDE (CheckLibraryExists)
68+ CHECK_LIBRARY_EXISTS(dl dlopen "" NEED_LINK_DL)
69+
6570find_package (JNI REQUIRED)
6671if (NOT GENERATED_JAVAH)
6772 # Must identify where the generated headers have been placed
@@ -89,9 +94,13 @@ add_dual_library(hdfs
8994 main/native/libhdfs/jni_helper.c
9095 main/native/libhdfs/hdfs.c
9196)
97+ if (NEED_LINK_DL)
98+ set (LIB_DL dl)
99+ endif (NEED_LINK_DL)
100+
92101target_link_dual_libraries(hdfs
93102 ${JAVA_JVM_LIBRARY}
94- dl
103+ ${LIB_DL}
95104 pthread
96105)
97106dual_output_directory(hdfs target /usr/local/lib)
Original file line number Diff line number Diff line change 2727#include <sys/stat.h>
2828#include <sys/types.h>
2929#include <unistd.h>
30+ #include <limits.h>
3031
3132static pthread_mutex_t gTempdirLock = PTHREAD_MUTEX_INITIALIZER ;
3233
You can’t perform that action at this time.
0 commit comments