浏览代码

Support disabling more functionality in build

To build eclcc in archive mode only (i.e. all that you need for a client)
a lot of components are not needed. By making it easier to disable these
in the cmake script, it's easier to build a mac client system.

While a full build will fail without some of these components, a partial
one such as make eclcc will succeed without most of them.

Signed-off-by: Richard Chapman <rchapman@hpccsystems.com>
Richard Chapman 13 年之前
父节点
当前提交
e21872f927
共有 3 个文件被更改,包括 20 次插入15 次删除
  1. 11 10
      cmake_modules/commonSetup.cmake
  2. 5 3
      common/dllserver/thorplugin.cpp
  3. 4 2
      ecl/hqlcpp/hqlres.cpp

+ 11 - 10
cmake_modules/commonSetup.cmake

@@ -40,16 +40,15 @@ IF ("${COMMONSETUP_DONE}" STREQUAL "")
 
   cmake_policy ( SET CMP0011 NEW )
 
-  # For options that we don't presently support setting to off, we have a SET() below rather than an option...
-
+  option(USE_BINUTILS "Enable use of binutils to embed workunit info into dhard objects" ON)
   option(USE_CPPUNIT "Enable unit tests (requires cppunit)" OFF)
-  set (USE_OPENLDAP 1)     # option(USE_OPENLDAP "Enable OpenLDAP support (requires OpenLDAP)" ON)
-  set (USE_ICU 1)          # option(USE_ICU "Enable unicode support (requires ICU)" ON)
-  set (USE_XALAN 1)        # option(USE_XALAN "Configure use of xalan" ON)
-  set (USE_XERCES 1)       # option(USE_XERCES "Configure use of xerces" ON)
+  option(USE_OPENLDAP "Enable OpenLDAP support (requires OpenLDAP)" ON)
+  option(USE_ICU "Enable unicode support (requires ICU)" ON)
+  option(USE_XALAN "Configure use of xalan" ON)
+  option(USE_XERCES "Configure use of xerces" ON)
   option(USE_BOOST_REGEX "Configure use of boost regex" ON)
   option(Boost_USE_STATIC_LIBS "Use boost_regex static library for RPM BUILD" OFF)
-  set (USE_OPENSSL 1)      # option(USE_OPENSSL "Configure use of OpenSSL" ON)
+  option(USE_OPENSSL "Configure use of OpenSSL" ON)
   option(USE_ZLIB "Configure use of zlib" ON)
   option(USE_NATIVE_LIBRARIES "Search standard OS locations for thirdparty libraries" ON)
   option(USE_GIT_DESCRIBE "Use git describe to generate build tag" ON)
@@ -222,10 +221,12 @@ IF ("${COMMONSETUP_DONE}" STREQUAL "")
 
   # External library setup - some can be optionally selected based on USE_xxx flags, some are required
 
-  IF (NOT WIN32)
+  IF (USE_BINUTILS AND NOT WIN32)
     find_package(BINUTILS)
-    IF (NOT BINUTILS_FOUND)
-      message(FATAL_ERROR "BINUTILS package not found")
+    IF (BINUTILS_FOUND)
+      add_definitions (-D_USE_BINUTILS)
+    ELSE()
+      message(FATAL_ERROR "BINUTILS requested but package not found")
     ENDIF()
   ENDIF()
 

+ 5 - 3
common/dllserver/thorplugin.cpp

@@ -24,7 +24,7 @@
 #include "jdebug.hpp"
 #include "jlzw.hpp"
 #include "eclrtl.hpp"
-#ifndef _WIN32
+#ifdef _USE_BINUTILS
 #include "bfd.h"
 #endif
 
@@ -203,7 +203,7 @@ bool HelperDll::getResource(size32_t & len, const void * & data, const char * ty
 #endif
 }
 
-#ifndef _WIN32
+#ifdef _USE_BINUTILS
 struct SecScanParam
 {
     MemoryBuffer &result;
@@ -245,7 +245,7 @@ extern bool getResourceFromFile(const char *filename, MemoryBuffer &data, const
     data.append(len, rdata);
     FreeLibrary(dllHandle);
     return true;
-#else
+#elif defined (_USE_BINUTILS)
     bfd_init ();
     bfd *file = bfd_openr(filename, NULL);
     if (file)
@@ -258,6 +258,8 @@ extern bool getResourceFromFile(const char *filename, MemoryBuffer &data, const
         bfd_close (file);
    }
    return data.length() != 0;
+#else
+   UNIMPLEMENTED;
 #endif
 }
 

+ 4 - 2
ecl/hqlcpp/hqlres.cpp

@@ -24,7 +24,7 @@
 #include "jexcept.hpp"
 #include "hqlcerrors.hpp"
 #include "thorplugin.hpp"
-#ifndef _WIN32
+#ifdef _USE_BINUTILS
 #include "bfd.h"
 #endif
 
@@ -371,7 +371,7 @@ void ResourceManager::flush(const char *filename, bool flushText, bool target64b
             putbytes(h, "\x00\x00\x00",4-(totalbytes & 3));
     }
     _close(h);
-#else
+#elif defined(_USE_BINUTILS)
     asymbol **syms = NULL;
     bfd *file = NULL;
     StringArray names;  // need to make sure that the strings we use in symbol table have appropriate lifetime 
@@ -438,6 +438,8 @@ void ResourceManager::flush(const char *filename, bool flushText, bool target64b
             bfd_close_all_done(file); // allow bfd to clean up memory
         throwError1(HQLERR_ResourceCreateFailed, msg.str());
     }
+#else
+    UNIMPLEMENTED;
 #endif
     if (flushText)
         flushAsText(filename);