瀏覽代碼

HPCC-8882 Move commonext into thorhelper and thorutil

Signed-off-by: Gavin Halliday <gavin.halliday@lexisnexis.com>
Gavin Halliday 12 年之前
父節點
當前提交
b8111c8a48

+ 0 - 1
common/CMakeLists.txt

@@ -13,7 +13,6 @@
 #    See the License for the specific language governing permissions and
 #    limitations under the License.
 ################################################################################
-HPCC_ADD_SUBDIRECTORY (commonext)
 HPCC_ADD_SUBDIRECTORY (deftype)
 HPCC_ADD_SUBDIRECTORY (dllserver)
 HPCC_ADD_SUBDIRECTORY (environment)

+ 0 - 50
common/commonext/CMakeLists.txt

@@ -1,50 +0,0 @@
-################################################################################
-#    HPCC SYSTEMS software Copyright (C) 2012 HPCC Systems.
-#
-#    Licensed under the Apache License, Version 2.0 (the "License");
-#    you may not use this file except in compliance with the License.
-#    You may obtain a copy of the License at
-#
-#       http://www.apache.org/licenses/LICENSE-2.0
-#
-#    Unless required by applicable law or agreed to in writing, software
-#    distributed under the License is distributed on an "AS IS" BASIS,
-#    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-#    See the License for the specific language governing permissions and
-#    limitations under the License.
-################################################################################
-
-
-# Component: commonext 
-#####################################################
-# Description:
-# ------------
-#    Cmake Input File for commonext
-#####################################################
-
-project( commonext ) 
-
-set (    SRCS 
-         thorport.cpp 
-         commonext.cpp 
-         
-         commonext.hpp 
-    )
-
-include_directories ( 
-         ./../../rtl/include 
-         ./../../system/include 
-         ./../workunit 
-         ./../../system/jlib 
-    )
-
-ADD_DEFINITIONS( -D_USRDLL -DCOMMONEXT_EXPORTS )
-
-HPCC_ADD_LIBRARY( commonext SHARED ${SRCS} )
-add_dependencies (commonext espscm )
-install ( TARGETS commonext RUNTIME DESTINATION ${EXEC_DIR} LIBRARY DESTINATION ${LIB_DIR} )
-target_link_libraries ( commonext 
-         jlib 
-    )
-
-

+ 0 - 26
common/commonext/sourcedoc.xml

@@ -1,26 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!--
-################################################################################
-#    HPCC SYSTEMS software Copyright (C) 2012 HPCC Systems.
-#
-#    Licensed under the Apache License, Version 2.0 (the "License");
-#    you may not use this file except in compliance with the License.
-#    You may obtain a copy of the License at
-#
-#       http://www.apache.org/licenses/LICENSE-2.0
-#
-#    Unless required by applicable law or agreed to in writing, software
-#    distributed under the License is distributed on an "AS IS" BASIS,
-#    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-#    See the License for the specific language governing permissions and
-#    limitations under the License.
-################################################################################
--->
-<!DOCTYPE section PUBLIC "-//OASIS//DTD DocBook XML V4.3//EN" "http://www.oasis-open.org/docbook/xml/4.3/docbookx.dtd">
-<section>
-    <title>common/commonext</title>
-
-    <para>
-        The common/commonext directory contains the sources for the common/commonext library.
-    </para>
-</section>

+ 3 - 0
common/thorhelper/CMakeLists.txt

@@ -26,6 +26,8 @@
 project( thorhelper ) 
 
 set (    SRCS 
+
+         commonext.cpp
          csvsplitter.cpp 
          layouttrans.cpp 
          thorcommon.cpp 
@@ -45,6 +47,7 @@ set (    SRCS
          roxiehelper.cpp
          roxiedebug.cpp
          
+         commonext.hpp
          csvsplitter.hpp 
          layouttrans.hpp 
          thorcommon.hpp 

common/commonext/commonext.cpp → common/thorhelper/commonext.cpp


+ 2 - 11
common/commonext/commonext.hpp

@@ -18,19 +18,10 @@
 #ifndef _COMMONEXT_
 #define _COMMONEXT_
 
-#ifdef _WIN32
-    #ifdef COMMONEXT_EXPORTS
-        #define thcommonext_decl __declspec(dllexport)
-    #else
-        #define thcommonext_decl __declspec(dllimport)
-    #endif
-#else
-    #define thcommonext_decl
-#endif
-
+#include "thorhelper.hpp"
 #include "eclhelper.hpp"
 
-extern thcommonext_decl const char *activityKindStr(ThorActivityKind kind);
+extern THORHELPER_API const char *activityKindStr(ThorActivityKind kind);
 
 #endif
 

+ 0 - 1
ecl/eclcc/CMakeLists.txt

@@ -39,7 +39,6 @@ include_directories (
          ./../../ecl/hql 
          ./../../rtl/include 
          ./../../system/jlib 
-         ./../../common/commonext 
          ./../../common/remote
     )
 

+ 0 - 2
ecl/hthor/CMakeLists.txt

@@ -64,7 +64,6 @@ include_directories (
          ${HPCC_SOURCE_DIR}/common/dllserver
          ${HPCC_SOURCE_DIR}/common/environment
          ${HPCC_SOURCE_DIR}/ecl/schedulectrl
-         ${HPCC_SOURCE_DIR}/common/commonext
          ${CMAKE_BINARY_DIR}
          ${CMAKE_BINARY_DIR}/oss
     )
@@ -89,7 +88,6 @@ target_link_libraries ( hthor
          securesocket
          thorhelper
          roxiemem
-         commonext
          schedulectrl
     )
 

+ 0 - 2
thorlcr/activities/activitymasters_lcr.cmake

@@ -89,7 +89,6 @@ include_directories (
          ./../../system/jlib 
          ./../mfilemanager 
          ./../../common/thorhelper 
-         ./../../common/commonext 
          ./../activities 
          ./../../rtl/eclrtl 
     )
@@ -103,7 +102,6 @@ target_link_libraries ( activitymasters_lcr
          jlib
          remote 
          thorsort_lcr 
-         commonext 
          jhtree 
          nbcd 
          eclrtl 

+ 0 - 2
thorlcr/activities/activityslaves_lcr.cmake

@@ -103,7 +103,6 @@ include_directories (
          ./../thorcodectx 
          ./../mfilemanager 
          ./../../common/thorhelper 
-         ./../../common/commonext 
          ./../activities 
          ./../../rtl/eclrtl 
          ./../../roxie/roxiemem
@@ -117,7 +116,6 @@ install ( TARGETS activityslaves_lcr RUNTIME DESTINATION ${EXEC_DIR} LIBRARY DES
 target_link_libraries ( activityslaves_lcr 
          jlib
          thorsort_lcr 
-         commonext 
          nbcd 
          eclrtl 
          deftype 

+ 3 - 2
thorlcr/graph/graph_lcr.cmake

@@ -28,9 +28,12 @@ set (    SRCS
          ../thorutil/thbuf.cpp 
          ../thorutil/thcompressutil.cpp 
          ../thorutil/thmem.cpp 
+         ../thorutil/thorport.cpp
          ../thorutil/thalloc.cpp 
          ../thorutil/thormisc.cpp 
          thgraph.cpp 
+
+         ../thorutil/thorport.hpp
     )
 
 include_directories ( 
@@ -48,7 +51,6 @@ include_directories (
          ./../../system/jlib 
          ./../thorcodectx 
          ./../mfilemanager 
-         ./../../common/commonext 
          ./../../rtl/eclrtl 
          ./../../common/thorhelper 
          ./../../roxie/roxiemem
@@ -70,7 +72,6 @@ target_link_libraries ( graph_lcr
          eclrtl 
          deftype 
          workunit 
-         commonext 
          thorhelper
          roxiemem
     )

+ 0 - 2
thorlcr/graph/graphmaster_lcr.cmake

@@ -46,7 +46,6 @@ include_directories (
          ./../../system/jlib 
          ./../thorcodectx 
          ./../mfilemanager 
-         ./../../common/commonext 
          ./../activities 
          ./../../rtl/eclrtl 
          ./../../common/thorhelper 
@@ -59,7 +58,6 @@ set_target_properties(graphmaster_lcr PROPERTIES
 install ( TARGETS graphmaster_lcr RUNTIME DESTINATION ${EXEC_DIR} LIBRARY DESTINATION ${LIB_DIR} )
 target_link_libraries ( graphmaster_lcr
          jlib
-         commonext 
          jhtree 
          nbcd 
          eclrtl 

+ 0 - 2
thorlcr/graph/graphslave_lcr.cmake

@@ -42,7 +42,6 @@ include_directories (
          ./../slave 
          ./../../system/jlib 
          ./../mfilemanager 
-         ./../../common/commonext 
          ./../../rtl/eclrtl 
          ./../../common/thorhelper 
     )
@@ -54,7 +53,6 @@ set_target_properties(graphslave_lcr PROPERTIES
 install ( TARGETS graphslave_lcr RUNTIME DESTINATION ${EXEC_DIR} LIBRARY DESTINATION ${LIB_DIR} )
 target_link_libraries ( graphslave_lcr 
          jlib
-         commonext 
          nbcd 
          eclrtl 
          deftype 

+ 0 - 2
thorlcr/master/CMakeLists.txt

@@ -47,7 +47,6 @@ include_directories (
          ./../../system/jlib 
          ./../thorcodectx 
          ./../mfilemanager 
-         ./../../common/commonext 
          ./../activities 
          ./../../rtl/eclrtl 
          ./../master 
@@ -77,7 +76,6 @@ target_link_libraries (  thormaster_lcr
          eclrtl 
          deftype 
          workunit 
-         commonext 
          graph_lcr 
          thorsort_lcr 
          thorhelper 

+ 0 - 2
thorlcr/mfilemanager/CMakeLists.txt

@@ -47,7 +47,6 @@ include_directories (
          ./../../system/jlib 
          ./../thorcodectx 
          ./../mfilemanager 
-         ./../../common/commonext 
          ./../../common/thorhelper 
          ./../../roxie/roxiemem
     )
@@ -68,7 +67,6 @@ target_link_libraries ( mfilemanager_lcr
          deftype 
          workunit 
          jhtree 
-         commonext 
          graph_lcr 
     )
 

+ 0 - 2
thorlcr/msort/CMakeLists.txt

@@ -46,7 +46,6 @@ include_directories (
          ./../shared 
          ./../../system/jlib 
          ./../../common/workunit 
-         ./../../common/commonext 
          ./../thorutil 
          ./../../common/thorhelper 
          ./../../common/dllserver 
@@ -68,7 +67,6 @@ else ()
     target_link_libraries ( thorsort_lcr
          jlib
          eclrtl
-         commonext
          thorhelper
          mp
          dalibase

+ 0 - 2
thorlcr/slave/CMakeLists.txt

@@ -39,7 +39,6 @@ include_directories (
          ./../shared 
          .
          ./../../common/environment 
-         ./../../common/commonext
          ./../../common/deftype 
          ./../../system/include 
          ./../../dali/base 
@@ -67,7 +66,6 @@ install ( TARGETS thorslave_lcr RUNTIME DESTINATION ${EXEC_DIR} )
 target_link_libraries (  thorslave_lcr 
          jlib
          remote 
-         commonext 
          dalibase 
          environment 
          dllserver 

common/commonext/thorport.cpp → thorlcr/thorutil/thorport.cpp


+ 13 - 13
common/commonext/thorport.hpp

@@ -23,13 +23,13 @@
 #include "jsocket.hpp"
 
 #ifdef _WIN32
-    #ifdef COMMONEXT_EXPORTS
-        #define thcommonext_decl __declspec(dllexport)
+    #ifdef GRAPH_EXPORTS
+        #define graph_decl __declspec(dllexport)
     #else
-        #define thcommonext_decl __declspec(dllimport)
+        #define graph_decl __declspec(dllimport)
     #endif
 #else
-    #define thcommonext_decl
+    #define graph_decl
 #endif
 
 enum ThorPortKind
@@ -38,15 +38,15 @@ enum ThorPortKind
     TPORT_mp
 };
 
-thcommonext_decl unsigned short getFixedPort(ThorPortKind category);
-thcommonext_decl unsigned short getFixedPort(unsigned short base, ThorPortKind category);
-thcommonext_decl unsigned short getExternalFixedPort(unsigned short masterbase, unsigned short machinebase, ThorPortKind category);
-thcommonext_decl unsigned short allocPort(unsigned num=1);
-thcommonext_decl void           freePort(unsigned short,unsigned num=1);
-thcommonext_decl void           setMachinePortBase(unsigned short base);
-thcommonext_decl void           setMasterPortBase(unsigned short base);
-thcommonext_decl unsigned short         getMasterPortBase();
-thcommonext_decl unsigned short         getMachinePortBase();
+graph_decl unsigned short getFixedPort(ThorPortKind category);
+graph_decl unsigned short getFixedPort(unsigned short base, ThorPortKind category);
+graph_decl unsigned short getExternalFixedPort(unsigned short masterbase, unsigned short machinebase, ThorPortKind category);
+graph_decl unsigned short allocPort(unsigned num=1);
+graph_decl void           freePort(unsigned short,unsigned num=1);
+graph_decl void           setMachinePortBase(unsigned short base);
+graph_decl void           setMasterPortBase(unsigned short base);
+graph_decl unsigned short         getMasterPortBase();
+graph_decl unsigned short         getMachinePortBase();
 
 typedef UnsignedShortArray PortArray;