Return-Path: X-Original-To: archive-asf-public-internal@cust-asf2.ponee.io Delivered-To: archive-asf-public-internal@cust-asf2.ponee.io Received: from cust-asf.ponee.io (cust-asf.ponee.io [163.172.22.183]) by cust-asf2.ponee.io (Postfix) with ESMTP id A5425200CBC for ; Tue, 20 Jun 2017 21:20:27 +0200 (CEST) Received: by cust-asf.ponee.io (Postfix) id A390F160BE1; Tue, 20 Jun 2017 19:20:27 +0000 (UTC) Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by cust-asf.ponee.io (Postfix) with SMTP id 9A77D160BCC for ; Tue, 20 Jun 2017 21:20:26 +0200 (CEST) Received: (qmail 87146 invoked by uid 500); 20 Jun 2017 19:20:25 -0000 Mailing-List: contact common-commits-help@hadoop.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Delivered-To: mailing list common-commits@hadoop.apache.org Received: (qmail 87137 invoked by uid 99); 20 Jun 2017 19:20:25 -0000 Received: from git1-us-west.apache.org (HELO git1-us-west.apache.org) (140.211.11.23) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 20 Jun 2017 19:20:25 +0000 Received: by git1-us-west.apache.org (ASF Mail Server at git1-us-west.apache.org, from userid 33) id 9D01ADFE5C; Tue, 20 Jun 2017 19:20:25 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: jhc@apache.org To: common-commits@hadoop.apache.org Message-Id: <18dcb2ba91f34e68baf1820080b3a838@git.apache.org> X-Mailer: ASF-Git Admin Mailer Subject: hadoop git commit: HDFS-11971: libhdfs++: [Fix] a few portability issues. Contributed by Anatoli Schein Date: Tue, 20 Jun 2017 19:20:25 +0000 (UTC) archived-at: Tue, 20 Jun 2017 19:20:27 -0000 Repository: hadoop Updated Branches: refs/heads/HDFS-8707 1b3fe2858 -> 0d2d073e2 HDFS-11971: libhdfs++: [Fix] a few portability issues. Contributed by Anatoli Schein Project: http://git-wip-us.apache.org/repos/asf/hadoop/repo Commit: http://git-wip-us.apache.org/repos/asf/hadoop/commit/0d2d073e Tree: http://git-wip-us.apache.org/repos/asf/hadoop/tree/0d2d073e Diff: http://git-wip-us.apache.org/repos/asf/hadoop/diff/0d2d073e Branch: refs/heads/HDFS-8707 Commit: 0d2d073e2b6837ef89791b90f7f815a3f9132bd1 Parents: 1b3fe28 Author: James Clampffer Authored: Tue Jun 20 15:17:58 2017 -0400 Committer: James Clampffer Committed: Tue Jun 20 15:17:58 2017 -0400 ---------------------------------------------------------------------- .../src/main/native/libhdfspp/CMakeLists.txt | 12 ++++-- .../libhdfspp/examples/c/cat/CMakeLists.txt | 10 +---- .../examples/c/connect_cancel/CMakeLists.txt | 10 +---- .../libhdfspp/examples/cc/cat/CMakeLists.txt | 12 +----- .../examples/cc/connect_cancel/CMakeLists.txt | 2 +- .../libhdfspp/examples/cc/find/CMakeLists.txt | 12 +----- .../examples/cc/gendirs/CMakeLists.txt | 12 +----- .../native/libhdfspp/lib/common/configuration.h | 2 +- .../main/native/libhdfspp/tools/CMakeLists.txt | 44 ++++++++++---------- 9 files changed, 40 insertions(+), 76 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/hadoop/blob/0d2d073e/hadoop-hdfs-project/hadoop-hdfs-native-client/src/main/native/libhdfspp/CMakeLists.txt ---------------------------------------------------------------------- diff --git a/hadoop-hdfs-project/hadoop-hdfs-native-client/src/main/native/libhdfspp/CMakeLists.txt b/hadoop-hdfs-project/hadoop-hdfs-native-client/src/main/native/libhdfspp/CMakeLists.txt index a5c77e0..dc7cd30 100644 --- a/hadoop-hdfs-project/hadoop-hdfs-native-client/src/main/native/libhdfspp/CMakeLists.txt +++ b/hadoop-hdfs-project/hadoop-hdfs-native-client/src/main/native/libhdfspp/CMakeLists.txt @@ -176,6 +176,7 @@ include_directories( SYSTEM third_party/uriparser2 ${OPENSSL_INCLUDE_DIR} ${SASL_INCLUDE_DIR} + ${PROTOBUF_INCLUDE_DIRS} ) @@ -206,6 +207,7 @@ if (HADOOP_BUILD) ${PROTOBUF_LIBRARY} ${OPENSSL_LIBRARIES} ${SASL_LIBRARIES} + ${CMAKE_THREAD_LIBS_INIT} ) else (HADOOP_BUILD) add_library(hdfspp_static STATIC ${EMPTY_FILE_CC} ${LIBHDFSPP_ALL_OBJECTS}) @@ -214,6 +216,7 @@ else (HADOOP_BUILD) ${PROTOBUF_LIBRARY} ${OPENSSL_LIBRARIES} ${SASL_LIBRARIES} + ${CMAKE_THREAD_LIBS_INIT} ) add_library(hdfspp SHARED ${EMPTY_FILE_CC} ${LIBHDFSPP_ALL_OBJECTS}) target_link_libraries(hdfspp_static @@ -221,6 +224,7 @@ else (HADOOP_BUILD) ${PROTOBUF_LIBRARY} ${OPENSSL_LIBRARIES} ${SASL_LIBRARIES} + ${CMAKE_THREAD_LIBS_INIT} ) endif (HADOOP_BUILD) set(LIBHDFSPP_VERSION "0.1.0") @@ -231,11 +235,11 @@ set_target_properties(hdfspp PROPERTIES # Can be installed to a particular location via "make DESTDIR=... install" file(GLOB_RECURSE LIBHDFSPP_HEADER_FILES "${CMAKE_CURRENT_LIST_DIR}/include/*.h*") file(GLOB_RECURSE LIBHDFS_HEADER_FILES "${HADOOP_IMPORT_DIR}/include/*.h*") -install(FILES ${LIBHDFSPP_HEADER_FILES} DESTINATION /include/hdfspp) -install(FILES ${LIBHDFS_HEADER_FILES} DESTINATION /include/hdfs) +install(FILES ${LIBHDFSPP_HEADER_FILES} DESTINATION include/hdfspp) +install(FILES ${LIBHDFS_HEADER_FILES} DESTINATION include/hdfs) -install(TARGETS hdfspp_static ARCHIVE DESTINATION /lib) -install(TARGETS hdfspp LIBRARY DESTINATION /lib) +install(TARGETS hdfspp_static ARCHIVE DESTINATION lib) +install(TARGETS hdfspp LIBRARY DESTINATION lib) add_custom_target( InstallToBuildDirectory http://git-wip-us.apache.org/repos/asf/hadoop/blob/0d2d073e/hadoop-hdfs-project/hadoop-hdfs-native-client/src/main/native/libhdfspp/examples/c/cat/CMakeLists.txt ---------------------------------------------------------------------- diff --git a/hadoop-hdfs-project/hadoop-hdfs-native-client/src/main/native/libhdfspp/examples/c/cat/CMakeLists.txt b/hadoop-hdfs-project/hadoop-hdfs-native-client/src/main/native/libhdfspp/examples/c/cat/CMakeLists.txt index 1319293..41a9ee8 100644 --- a/hadoop-hdfs-project/hadoop-hdfs-native-client/src/main/native/libhdfspp/examples/c/cat/CMakeLists.txt +++ b/hadoop-hdfs-project/hadoop-hdfs-native-client/src/main/native/libhdfspp/examples/c/cat/CMakeLists.txt @@ -24,12 +24,4 @@ include_directories( ${LIBHDFSPP_DIR}/include ) link_directories( ${LIBHDFSPP_DIR}/lib ) add_executable(cat_c cat.c) -target_link_libraries(cat_c hdfspp uriparser2) - -# Several examples in different languages need to produce executables with -# same names. To allow executables with same names we keep their CMake -# names different, but specify their executable names as follows: -set_target_properties( cat_c - PROPERTIES - OUTPUT_NAME "cat" -) +target_link_libraries(cat_c hdfspp_static uriparser2) \ No newline at end of file http://git-wip-us.apache.org/repos/asf/hadoop/blob/0d2d073e/hadoop-hdfs-project/hadoop-hdfs-native-client/src/main/native/libhdfspp/examples/c/connect_cancel/CMakeLists.txt ---------------------------------------------------------------------- diff --git a/hadoop-hdfs-project/hadoop-hdfs-native-client/src/main/native/libhdfspp/examples/c/connect_cancel/CMakeLists.txt b/hadoop-hdfs-project/hadoop-hdfs-native-client/src/main/native/libhdfspp/examples/c/connect_cancel/CMakeLists.txt index 56aeeea..6276467 100644 --- a/hadoop-hdfs-project/hadoop-hdfs-native-client/src/main/native/libhdfspp/examples/c/connect_cancel/CMakeLists.txt +++ b/hadoop-hdfs-project/hadoop-hdfs-native-client/src/main/native/libhdfspp/examples/c/connect_cancel/CMakeLists.txt @@ -24,12 +24,4 @@ include_directories( ${LIBHDFSPP_DIR}/include ) link_directories( ${LIBHDFSPP_DIR}/lib ) add_executable(connect_cancel_c connect_cancel.c) -target_link_libraries(connect_cancel_c hdfspp uriparser2) - -# Several examples in different languages need to produce executables with -# same names. To allow executables with same names we keep their CMake -# names different, but specify their executable names as follows: -set_target_properties( connect_cancel_c - PROPERTIES - OUTPUT_NAME "connect_cancel_c" -) +target_link_libraries(connect_cancel_c hdfspp_static uriparser2) \ No newline at end of file http://git-wip-us.apache.org/repos/asf/hadoop/blob/0d2d073e/hadoop-hdfs-project/hadoop-hdfs-native-client/src/main/native/libhdfspp/examples/cc/cat/CMakeLists.txt ---------------------------------------------------------------------- diff --git a/hadoop-hdfs-project/hadoop-hdfs-native-client/src/main/native/libhdfspp/examples/cc/cat/CMakeLists.txt b/hadoop-hdfs-project/hadoop-hdfs-native-client/src/main/native/libhdfspp/examples/cc/cat/CMakeLists.txt index 9ad919a..479ff86 100644 --- a/hadoop-hdfs-project/hadoop-hdfs-native-client/src/main/native/libhdfspp/examples/cc/cat/CMakeLists.txt +++ b/hadoop-hdfs-project/hadoop-hdfs-native-client/src/main/native/libhdfspp/examples/cc/cat/CMakeLists.txt @@ -23,13 +23,5 @@ set(LIBHDFSPP_DIR CACHE STRING ${CMAKE_INSTALL_PREFIX}) include_directories( ${LIBHDFSPP_DIR}/include ) link_directories( ${LIBHDFSPP_DIR}/lib ) -add_executable(cat_cc cat.cc) -target_link_libraries(cat_cc hdfspp) - -# Several examples in different languages need to produce executables with -# same names. To allow executables with same names we keep their CMake -# names different, but specify their executable names as follows: -set_target_properties( cat_cc - PROPERTIES - OUTPUT_NAME "cat" -) +add_executable(cat cat.cc) +target_link_libraries(cat hdfspp_static) \ No newline at end of file http://git-wip-us.apache.org/repos/asf/hadoop/blob/0d2d073e/hadoop-hdfs-project/hadoop-hdfs-native-client/src/main/native/libhdfspp/examples/cc/connect_cancel/CMakeLists.txt ---------------------------------------------------------------------- diff --git a/hadoop-hdfs-project/hadoop-hdfs-native-client/src/main/native/libhdfspp/examples/cc/connect_cancel/CMakeLists.txt b/hadoop-hdfs-project/hadoop-hdfs-native-client/src/main/native/libhdfspp/examples/cc/connect_cancel/CMakeLists.txt index 6ee44cc..e3cc0b5 100644 --- a/hadoop-hdfs-project/hadoop-hdfs-native-client/src/main/native/libhdfspp/examples/cc/connect_cancel/CMakeLists.txt +++ b/hadoop-hdfs-project/hadoop-hdfs-native-client/src/main/native/libhdfspp/examples/cc/connect_cancel/CMakeLists.txt @@ -24,4 +24,4 @@ include_directories( ${LIBHDFSPP_DIR}/include ) link_directories( ${LIBHDFSPP_DIR}/lib ) add_executable(connect_cancel connect_cancel.cc) -target_link_libraries(connect_cancel hdfspp) +target_link_libraries(connect_cancel hdfspp_static) http://git-wip-us.apache.org/repos/asf/hadoop/blob/0d2d073e/hadoop-hdfs-project/hadoop-hdfs-native-client/src/main/native/libhdfspp/examples/cc/find/CMakeLists.txt ---------------------------------------------------------------------- diff --git a/hadoop-hdfs-project/hadoop-hdfs-native-client/src/main/native/libhdfspp/examples/cc/find/CMakeLists.txt b/hadoop-hdfs-project/hadoop-hdfs-native-client/src/main/native/libhdfspp/examples/cc/find/CMakeLists.txt index e894e58..8210bb5 100644 --- a/hadoop-hdfs-project/hadoop-hdfs-native-client/src/main/native/libhdfspp/examples/cc/find/CMakeLists.txt +++ b/hadoop-hdfs-project/hadoop-hdfs-native-client/src/main/native/libhdfspp/examples/cc/find/CMakeLists.txt @@ -23,13 +23,5 @@ set(LIBHDFSPP_DIR CACHE STRING ${CMAKE_INSTALL_PREFIX}) include_directories( ${LIBHDFSPP_DIR}/include ) link_directories( ${LIBHDFSPP_DIR}/lib ) -add_executable(find_cc find.cc) -target_link_libraries(find_cc hdfspp) - -# Several examples in different languages need to produce executables with -# same names. To allow executables with same names we keep their CMake -# names different, but specify their executable names as follows: -set_target_properties( find_cc - PROPERTIES - OUTPUT_NAME "find" -) +add_executable(find find.cc) +target_link_libraries(find hdfspp_static) \ No newline at end of file http://git-wip-us.apache.org/repos/asf/hadoop/blob/0d2d073e/hadoop-hdfs-project/hadoop-hdfs-native-client/src/main/native/libhdfspp/examples/cc/gendirs/CMakeLists.txt ---------------------------------------------------------------------- diff --git a/hadoop-hdfs-project/hadoop-hdfs-native-client/src/main/native/libhdfspp/examples/cc/gendirs/CMakeLists.txt b/hadoop-hdfs-project/hadoop-hdfs-native-client/src/main/native/libhdfspp/examples/cc/gendirs/CMakeLists.txt index e25f425..7fdc1b2 100644 --- a/hadoop-hdfs-project/hadoop-hdfs-native-client/src/main/native/libhdfspp/examples/cc/gendirs/CMakeLists.txt +++ b/hadoop-hdfs-project/hadoop-hdfs-native-client/src/main/native/libhdfspp/examples/cc/gendirs/CMakeLists.txt @@ -23,13 +23,5 @@ set(LIBHDFSPP_DIR CACHE STRING ${CMAKE_INSTALL_PREFIX}) include_directories( ${LIBHDFSPP_DIR}/include ) link_directories( ${LIBHDFSPP_DIR}/lib ) -add_executable(gendirs_cc gendirs.cc) -target_link_libraries(gendirs_cc hdfspp) - -# Several examples in different languages need to produce executables with -# same names. To allow executables with same names we keep their CMake -# names different, but specify their executable names as follows: -set_target_properties( gendirs_cc - PROPERTIES - OUTPUT_NAME "gendirs" -) +add_executable(gendirs gendirs.cc) +target_link_libraries(gendirs hdfspp_static) \ No newline at end of file http://git-wip-us.apache.org/repos/asf/hadoop/blob/0d2d073e/hadoop-hdfs-project/hadoop-hdfs-native-client/src/main/native/libhdfspp/lib/common/configuration.h ---------------------------------------------------------------------- diff --git a/hadoop-hdfs-project/hadoop-hdfs-native-client/src/main/native/libhdfspp/lib/common/configuration.h b/hadoop-hdfs-project/hadoop-hdfs-native-client/src/main/native/libhdfspp/lib/common/configuration.h index b6b968e..ebfa909 100644 --- a/hadoop-hdfs-project/hadoop-hdfs-native-client/src/main/native/libhdfspp/lib/common/configuration.h +++ b/hadoop-hdfs-project/hadoop-hdfs-native-client/src/main/native/libhdfspp/lib/common/configuration.h @@ -98,7 +98,7 @@ protected: static std::string fixCase(const std::string &in) { std::string result(in); - for (auto & c: result) c = toupper(c); + for (auto & c: result) c = (char) toupper(c); return result; } }; http://git-wip-us.apache.org/repos/asf/hadoop/blob/0d2d073e/hadoop-hdfs-project/hadoop-hdfs-native-client/src/main/native/libhdfspp/tools/CMakeLists.txt ---------------------------------------------------------------------- diff --git a/hadoop-hdfs-project/hadoop-hdfs-native-client/src/main/native/libhdfspp/tools/CMakeLists.txt b/hadoop-hdfs-project/hadoop-hdfs-native-client/src/main/native/libhdfspp/tools/CMakeLists.txt index 4a46c7a..dbcb97f 100644 --- a/hadoop-hdfs-project/hadoop-hdfs-native-client/src/main/native/libhdfspp/tools/CMakeLists.txt +++ b/hadoop-hdfs-project/hadoop-hdfs-native-client/src/main/native/libhdfspp/tools/CMakeLists.txt @@ -27,67 +27,67 @@ add_library(tools_common_obj OBJECT tools_common.cc) add_library(tools_common $) add_executable(hdfs_cat hdfs_cat.cc) -target_link_libraries(hdfs_cat tools_common hdfspp) +target_link_libraries(hdfs_cat tools_common hdfspp_static) add_executable(hdfs_chgrp hdfs_chgrp.cc) -target_link_libraries(hdfs_chgrp tools_common hdfspp) +target_link_libraries(hdfs_chgrp tools_common hdfspp_static) add_executable(hdfs_chown hdfs_chown.cc) -target_link_libraries(hdfs_chown tools_common hdfspp) +target_link_libraries(hdfs_chown tools_common hdfspp_static) add_executable(hdfs_chmod hdfs_chmod.cc) -target_link_libraries(hdfs_chmod tools_common hdfspp) +target_link_libraries(hdfs_chmod tools_common hdfspp_static) add_executable(hdfs_find hdfs_find.cc) -target_link_libraries(hdfs_find tools_common hdfspp) +target_link_libraries(hdfs_find tools_common hdfspp_static) add_executable(hdfs_mkdir hdfs_mkdir.cc) -target_link_libraries(hdfs_mkdir tools_common hdfspp) +target_link_libraries(hdfs_mkdir tools_common hdfspp_static) add_executable(hdfs_rm hdfs_rm.cc) -target_link_libraries(hdfs_rm tools_common hdfspp) +target_link_libraries(hdfs_rm tools_common hdfspp_static) add_executable(hdfs_ls hdfs_ls.cc) -target_link_libraries(hdfs_ls tools_common hdfspp) +target_link_libraries(hdfs_ls tools_common hdfspp_static) add_executable(hdfs_stat hdfs_stat.cc) -target_link_libraries(hdfs_stat tools_common hdfspp) +target_link_libraries(hdfs_stat tools_common hdfspp_static) add_executable(hdfs_count hdfs_count.cc) -target_link_libraries(hdfs_count tools_common hdfspp) +target_link_libraries(hdfs_count tools_common hdfspp_static) add_executable(hdfs_df hdfs_df.cc) -target_link_libraries(hdfs_df tools_common hdfspp) +target_link_libraries(hdfs_df tools_common hdfspp_static) add_executable(hdfs_du hdfs_du.cc) -target_link_libraries(hdfs_du tools_common hdfspp) +target_link_libraries(hdfs_du tools_common hdfspp_static) add_executable(hdfs_get hdfs_get.cc) -target_link_libraries(hdfs_get tools_common hdfspp) +target_link_libraries(hdfs_get tools_common hdfspp_static) add_executable(hdfs_copyToLocal hdfs_copyToLocal.cc) -target_link_libraries(hdfs_copyToLocal tools_common hdfspp) +target_link_libraries(hdfs_copyToLocal tools_common hdfspp_static) add_executable(hdfs_moveToLocal hdfs_moveToLocal.cc) -target_link_libraries(hdfs_moveToLocal tools_common hdfspp) +target_link_libraries(hdfs_moveToLocal tools_common hdfspp_static) add_executable(hdfs_setrep hdfs_setrep.cc) -target_link_libraries(hdfs_setrep tools_common hdfspp) +target_link_libraries(hdfs_setrep tools_common hdfspp_static) add_executable(hdfs_allowSnapshot hdfs_allowSnapshot.cc) -target_link_libraries(hdfs_allowSnapshot tools_common hdfspp) +target_link_libraries(hdfs_allowSnapshot tools_common hdfspp_static) add_executable(hdfs_disallowSnapshot hdfs_disallowSnapshot.cc) -target_link_libraries(hdfs_disallowSnapshot tools_common hdfspp) +target_link_libraries(hdfs_disallowSnapshot tools_common hdfspp_static) add_executable(hdfs_createSnapshot hdfs_createSnapshot.cc) -target_link_libraries(hdfs_createSnapshot tools_common hdfspp) +target_link_libraries(hdfs_createSnapshot tools_common hdfspp_static) add_executable(hdfs_renameSnapshot hdfs_renameSnapshot.cc) -target_link_libraries(hdfs_renameSnapshot tools_common hdfspp) +target_link_libraries(hdfs_renameSnapshot tools_common hdfspp_static) add_executable(hdfs_deleteSnapshot hdfs_deleteSnapshot.cc) -target_link_libraries(hdfs_deleteSnapshot tools_common hdfspp) +target_link_libraries(hdfs_deleteSnapshot tools_common hdfspp_static) add_executable(hdfs_tail hdfs_tail.cc) -target_link_libraries(hdfs_tail tools_common hdfspp) \ No newline at end of file +target_link_libraries(hdfs_tail tools_common hdfspp_static) \ No newline at end of file --------------------------------------------------------------------- To unsubscribe, e-mail: common-commits-unsubscribe@hadoop.apache.org For additional commands, e-mail: common-commits-help@hadoop.apache.org