Changeset: a1d427d5cce9 for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=a1d427d5cce9
Modified Files:
        clients/mapilib/monetdb-mapi.pc.in
        common/stream/CMakeLists.txt
        common/stream/monetdb-stream.pc.in
        gdk/CMakeLists.txt
        gdk/monetdb-gdk.pc.in
        monetdb5/mal/CMakeLists.txt
        monetdb5/mal/mal.c
        monetdb5/modules/CMakeLists.txt
        monetdb5/modules/atoms/CMakeLists.txt
        monetdb5/modules/kernel/CMakeLists.txt
        monetdb5/modules/mal/CMakeLists.txt
        monetdb5/optimizer/CMakeLists.txt
        monetdb5/scheduler/CMakeLists.txt
        monetdb5/tools/CMakeLists.txt
        monetdb5/tools/monetdb5.pc.in
Branch: cmake-fun
Log Message:

Found a more defensive way to compile libmonetdb5 library without using cmake's 
file glob tool which can be dangerous.

Starting to cleanup pkg-config files.


diffs (truncated from 401 to 300 lines):

diff --git a/clients/mapilib/monetdb-mapi.pc.in 
b/clients/mapilib/monetdb-mapi.pc.in
--- a/clients/mapilib/monetdb-mapi.pc.in
+++ b/clients/mapilib/monetdb-mapi.pc.in
@@ -14,5 +14,5 @@ Description: MonetDB MAPI C-client libar
 Version: @PACKAGE_VERSION@
 Requires: monetdb-stream openssl
 
-Libs: -L${libdir} -lmapi @PKG_SOCKET_LIBS@
+Libs: -L${libdir} -lmapi
 Cflags: -I${includedir}/monetdb
diff --git a/common/stream/CMakeLists.txt b/common/stream/CMakeLists.txt
--- a/common/stream/CMakeLists.txt
+++ b/common/stream/CMakeLists.txt
@@ -45,7 +45,7 @@ else()
                set(PKG_SNAPPY "-lsnappy")
        endif()
        if(Iconv_FOUND AND NOT Iconv_IS_BUILT_IN)
-               set(PKG_LIBICONV "-l${ICONV_LIBRARIES}")
+               set(PKG_LIBICONV "-l${ICONV_LIBRARIES}") # TODO this one is 
broken in some platforms
        endif()
        configure_file(monetdb-stream.pc.in 
${CMAKE_CURRENT_BINARY_DIR}/monetdb-stream.pc @ONLY)
        install(FILES ${CMAKE_CURRENT_BINARY_DIR}/monetdb-stream.pc DESTINATION 
${PKGCONFIGDIR})
diff --git a/common/stream/monetdb-stream.pc.in 
b/common/stream/monetdb-stream.pc.in
--- a/common/stream/monetdb-stream.pc.in
+++ b/common/stream/monetdb-stream.pc.in
@@ -14,5 +14,5 @@ Description: MonetDB streams libary
 Version: @PACKAGE_VERSION@
 Requires: @PKG_CURL@ @PKG_ZLIB@ @PKG_LIBLZMA@ @PKG_LZ4@ @PKG_BZIP2@ 
@PKG_SNAPPY@
 
-Libs: -L${libdir} -lstream @PKG_SOCKET_LIBS@ @PKG_LIBICONV@
+Libs: -L${libdir} -lstream @PKG_LIBICONV@
 Cflags: -I${includedir}/monetdb
diff --git a/gdk/CMakeLists.txt b/gdk/CMakeLists.txt
--- a/gdk/CMakeLists.txt
+++ b/gdk/CMakeLists.txt
@@ -60,14 +60,17 @@ install(FILES
 if(WIN32)
        install(FILES $<TARGET_PDB_FILE:gdk> DESTINATION ${LIBDIR} OPTIONAL)
 else()
-       if(NOT MATH_LIBRARIES STREQUAL "")
-               set(PKG_MATH_LIBRARIES "-l${MATH_LIBRARIES}")
+       if(NOT "${MATH_LIBRARIES}" STREQUAL "")
+               set(PKG_MATH "-l${MATH_LIBRARIES}")
+       endif()
+       if(NOT "${THREAD_LIBRARIES}" STREQUAL "")
+               set(PKG_THREAD "${THREAD_LIBRARIES}") # TODO this one is broken 
on some platforms
        endif()
-       if(NOT THREAD_LIBRARIES STREQUAL "")
-               set(PKG_PTHREAD_LIBRARIES "-${THREAD_LIBRARIES}")
+       if(NOT "${DL_LIBRARIES}" STREQUAL "")
+               set(PKG_DL "-l${DL_LIBRARIES}")
        endif()
-       if(NOT DL_LIBRARIES STREQUAL "")
-               set(PKG_DL_LIBS "-l${DL_LIBRARIES}")
+       if(NOT "${KVM_LIBRARIES}" STREQUAL "")
+               set(PKG_KVM "-l${KVM_LIBRARIES}")
        endif()
        configure_file(monetdb-gdk.pc.in 
${CMAKE_CURRENT_BINARY_DIR}/monetdb-gdk.pc @ONLY)
        install(FILES ${CMAKE_CURRENT_BINARY_DIR}/monetdb-gdk.pc DESTINATION 
${PKGCONFIGDIR})
diff --git a/gdk/monetdb-gdk.pc.in b/gdk/monetdb-gdk.pc.in
--- a/gdk/monetdb-gdk.pc.in
+++ b/gdk/monetdb-gdk.pc.in
@@ -14,5 +14,5 @@ Description: MonetDB GDK libary
 Version: @PACKAGE_VERSION@
 Requires: monetdb-stream
 
-Libs: -L${libdir} -lbat @PKG_MATH_LIBS@ @PKG_MALLOC_LIBS@ 
@PKG_PTHREAD_LIBRARIES@ @PKG_DL_LIBS@
+Libs: -L${libdir} -lbat @PKG_MATH@ @PKG_THREAD@ @PKG_DL@  @PKG_KVM@
 Cflags: -I${includedir}/monetdb
diff --git a/monetdb5/mal/CMakeLists.txt b/monetdb5/mal/CMakeLists.txt
--- a/monetdb5/mal/CMakeLists.txt
+++ b/monetdb5/mal/CMakeLists.txt
@@ -6,6 +6,45 @@
 # Copyright 1997 - July 2008 CWI, August 2008 - 2019 MonetDB B.V.
 #]]
 
+include_directories(../../common/stream ../../common/utils 
../../clients/mapilib ../../gdk ../optimizer ../modules/mal
+                                       ${CRYPTO_INCLUDE_DIR})
+
+add_library(mal OBJECT
+                       mal.c mal.h
+                       mal_atom.c mal_atom.h
+                       mal_authorize.c mal_authorize.h
+                       mal_builder.c mal_builder.h
+                       mal_client.c mal_client.h
+                       mal_debugger.c mal_debugger.h
+                       mal_errors.h
+                       mal_exception.c mal_exception.h
+                       mal_factory.c mal_factory.h
+                       mal_function.c mal_function.h
+                       mal_import.c mal_import.h
+                       mal_runtime.c mal_runtime.h
+                       mal_instruction.c mal_instruction.h
+                       mal_resource.c mal_resource.h
+                       mal_interpreter.c mal_interpreter.h
+                       mal_dataflow.c mal_dataflow.h
+                       mal_linker.c mal_linker.h
+                       mal_listing.c mal_listing.h
+                       mal_module.c mal_module.h
+                       mal_namespace.c mal_namespace.h
+                       mal_parser.c mal_parser.h
+                       mal_profiler.c mal_profiler.h
+                       mal_readline.c mal_readline.h
+                       mal_resolve.c mal_resolve.h
+                       mal_sabaoth.c mal_sabaoth.h
+                       mal_scenario.c mal_scenario.h
+                       mal_session.c mal_session.h
+                       mal_stack.c mal_stack.h
+                       mal_type.c mal_type.h
+                       mal_utils.c mal_utils.h
+                       mal_private.h)
+target_compile_definitions(mal PRIVATE LIBMAL LIBATOMS LIBKERNEL LIBOPTIMIZER 
LIBSCHEDULER LIBMONETDB5)
+set_target_properties(mal PROPERTIES POSITION_INDEPENDENT_CODE ON)
+set(MONETDB5_OBJECTS ${MONETDB5_OBJECTS} $<TARGET_OBJECTS:mal> PARENT_SCOPE)
+
 install(FILES
                mal.h
                mal_client.h
diff --git a/monetdb5/mal/mal.c b/monetdb5/mal/mal.c
--- a/monetdb5/mal/mal.c
+++ b/monetdb5/mal/mal.c
@@ -35,10 +35,7 @@ int have_hge;
 #include "mal_private.h"
 #include "mal_runtime.h"
 #include "mal_resource.h"
-#include "wlc.h"
 #include "mal_atom.h"
-#include "opt_pipes.h"
-#include "tablet.h"
 
 MT_Lock     mal_contextLock = MT_LOCK_INITIALIZER("mal_contextLock");
 MT_Lock     mal_namespaceLock = MT_LOCK_INITIALIZER("mal_namespaceLk");
@@ -82,6 +79,9 @@ int mal_init(void){
        return 0;
 }
 
+extern void WLCreset(void); // Don't include wlc.h or opt_support.h, it 
creates a circular dependency
+extern void opt_pipes_reset(void);
+
 /*
  * Upon exit we should attempt to remove all allocated memory explicitly.
  * This seemingly superflous action is necessary to simplify analyis of
@@ -92,7 +92,6 @@ int mal_init(void){
  * activity first.
  * This function should be called after you have issued sql_reset();
  */
-void cleanOptimizerPipe(void);
 
 void mserver_reset(void)
 {
diff --git a/monetdb5/modules/CMakeLists.txt b/monetdb5/modules/CMakeLists.txt
--- a/monetdb5/modules/CMakeLists.txt
+++ b/monetdb5/modules/CMakeLists.txt
@@ -9,3 +9,5 @@
 add_subdirectory(atoms)
 add_subdirectory(kernel)
 add_subdirectory(mal)
+
+set(MONETDB5_OBJECTS ${MONETDB5_OBJECTS} PARENT_SCOPE)
diff --git a/monetdb5/modules/atoms/CMakeLists.txt 
b/monetdb5/modules/atoms/CMakeLists.txt
--- a/monetdb5/modules/atoms/CMakeLists.txt
+++ b/monetdb5/modules/atoms/CMakeLists.txt
@@ -6,6 +6,27 @@
 # Copyright 1997 - July 2008 CWI, August 2008 - 2019 MonetDB B.V.
 #]]
 
+include_directories(../../mal ../../../common/stream ../../../common/utils 
../../../gdk ${LIBXML2_INCLUDE_DIR}
+                                       ${CRYPTO_INCLUDE_DIR} 
${UUID_INCLUDE_DIR})
+
+add_library(atoms OBJECT
+                       batxml.c
+                       blob.c blob.h
+                       color.c color.h
+                       identifier.c
+                       inet.c
+                       json.c json.h
+                       mtime.c mtime_analytic.c mtime.h mtime_private.h
+                       str.c str.h
+                       streams.c streams.h
+                       strptime.c
+                       url.c url.h
+                       uuid.c
+                       xml.c xml.h)
+target_compile_definitions(atoms PRIVATE LIBMAL LIBATOMS LIBKERNEL 
LIBOPTIMIZER LIBSCHEDULER LIBMONETDB5)
+set_target_properties(atoms PROPERTIES POSITION_INDEPENDENT_CODE ON)
+set(MONETDB5_OBJECTS ${MONETDB5_OBJECTS} $<TARGET_OBJECTS:atoms> PARENT_SCOPE)
+
 install(FILES
                batxml.mal
                blob.mal
diff --git a/monetdb5/modules/kernel/CMakeLists.txt 
b/monetdb5/modules/kernel/CMakeLists.txt
--- a/monetdb5/modules/kernel/CMakeLists.txt
+++ b/monetdb5/modules/kernel/CMakeLists.txt
@@ -6,6 +6,25 @@
 # Copyright 1997 - July 2008 CWI, August 2008 - 2019 MonetDB B.V.
 #]]
 
+include_directories(../../mal ../atoms ../../../common/stream 
../../../common/utils ../../../gdk)
+
+add_library(kernel OBJECT
+                       aggr.c
+                       alarm.c
+                       algebra.c algebra.h
+                       bat5.c bat5.h
+                       batcolor.c batcolor.h
+                       batmmath.c batmmath.h
+                       batstr.c
+                       group.c group.h
+                       logger.c
+                       microbenchmark.c microbenchmark.h
+                       mmath.c mmath.h mmath_private.h
+                       status.c status.h)
+target_compile_definitions(kernel PRIVATE LIBMAL LIBATOMS LIBKERNEL 
LIBOPTIMIZER LIBSCHEDULER LIBMONETDB5)
+set_target_properties(kernel PROPERTIES POSITION_INDEPENDENT_CODE ON)
+set(MONETDB5_OBJECTS ${MONETDB5_OBJECTS} $<TARGET_OBJECTS:kernel> PARENT_SCOPE)
+
 install(FILES
                bat5.mal algebra.mal status.mal
                mmath.mal alarm.mal batstr.mal
diff --git a/monetdb5/modules/mal/CMakeLists.txt 
b/monetdb5/modules/mal/CMakeLists.txt
--- a/monetdb5/modules/mal/CMakeLists.txt
+++ b/monetdb5/modules/mal/CMakeLists.txt
@@ -6,6 +6,46 @@
 # Copyright 1997 - July 2008 CWI, August 2008 - 2019 MonetDB B.V.
 #]]
 
+include_directories(../../mal ../atoms ../kernel ../../../clients/mapilib 
../../../common/stream ../../../common/utils
+                                       ../../../gdk ${PCRE_INCLUDE_DIR} 
${CRYPTO_INCLUDE_DIR})
+
+add_library(malmodules OBJECT
+                       batExtensions.c batExtensions.h
+                       bbp.c bbp.h
+                       clients.c clients.h
+                       factories.c factories.h
+                       groupby.c groupby.h
+                       inspect.c inspect.h
+                       orderidx.c orderidx.h
+                       iterator.c  iterator.h
+                       projectionpath.c  projectionpath.h
+                       language.c language.h
+                       mal_io.c mal_io.h
+                       mal_mapi.c mal_mapi.h
+                       manual.c manual.h
+                       mat.c mat.h
+                       mdb.c mdb.h
+                       mkey.c mkey.h
+                       manifold.c manifold.h
+                       oltp.c oltp.h
+                       wlc.c wlc.h
+                       pcre.c
+                       profiler.c profiler.h
+                       querylog.c querylog.h
+                       remote.c remote.h
+                       sabaoth.c sabaoth.h
+                       sysmon.c sysmon.h
+                       tablet.c tablet.h
+                       tokenizer.c tokenizer.h
+                       transaction.c
+                       txtsim.c txtsim.h
+                       sample.c sample.h
+                       json_util.c json_util.h
+                       calc.c batcalc.c)
+target_compile_definitions(malmodules PRIVATE LIBMAL LIBATOMS LIBKERNEL 
LIBOPTIMIZER LIBSCHEDULER LIBMONETDB5)
+set_target_properties(malmodules PROPERTIES POSITION_INDEPENDENT_CODE ON)
+set(MONETDB5_OBJECTS ${MONETDB5_OBJECTS} $<TARGET_OBJECTS:malmodules> 
PARENT_SCOPE)
+
 install(FILES
                language.mal mal_init.mal bbp.mal
                profiler.mal batExtensions.mal orderidx.mal
diff --git a/monetdb5/optimizer/CMakeLists.txt 
b/monetdb5/optimizer/CMakeLists.txt
--- a/monetdb5/optimizer/CMakeLists.txt
+++ b/monetdb5/optimizer/CMakeLists.txt
@@ -6,4 +6,49 @@
 # Copyright 1997 - July 2008 CWI, August 2008 - 2019 MonetDB B.V.
 #]]
 
+include_directories(../mal ../modules/atoms ../modules/mal ../modules/kernel 
../../clients/mapilib ../../common/stream
+                                       ../../common/utils ../../gdk)
+
+add_library(optimizer OBJECT
+                       optimizer.c optimizer.h optimizer_private.h
+                       opt_aliases.c opt_aliases.h
+                       opt_coercion.c opt_coercion.h
+                       opt_commonTerms.c opt_commonTerms.h
+                       opt_candidates.c opt_candidates.h
+                       opt_constants.c opt_constants.h
+                       opt_costModel.c opt_costModel.h
+                       opt_dataflow.c opt_dataflow.h
+                       opt_deadcode.c opt_deadcode.h
+                       opt_emptybind.c opt_emptybind.h
+                       opt_evaluate.c opt_evaluate.h
+                       opt_garbageCollector.c opt_garbageCollector.h
+                       opt_generator.c opt_generator.h
+                       opt_querylog.c opt_querylog.h
+                       opt_inline.c opt_inline.h
+                       opt_jit.c opt_jit.h
+                       opt_projectionpath.c opt_projectionpath.h
+                       opt_macro.c opt_macro.h
+                       opt_matpack.c opt_matpack.h
+                       opt_json.c opt_json.h
_______________________________________________
checkin-list mailing list
[email protected]
https://www.monetdb.org/mailman/listinfo/checkin-list

Reply via email to