Changeset: 98dba790d517 for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=98dba790d517
Modified Files:
        cmake/FindLiblas.cmake
        cmake/FindUUID.cmake
        gdk/gdk_system.h
        monetdb5/mal/mal_linker.c
Branch: cmake-fun
Log Message:

Fixed find libraries on macOS and removed AIX code.


diffs (131 lines):

diff --git a/cmake/FindLiblas.cmake b/cmake/FindLiblas.cmake
--- a/cmake/FindLiblas.cmake
+++ b/cmake/FindLiblas.cmake
@@ -12,19 +12,23 @@ find_path(LIBLAS_INCLUDE_DIR NAMES libla
 # Look for the library.
 find_library(LIBLAS_LIBRARY las)
 find_library(LIBLAS_C_LIBRARY las_c)
-find_library(BOOST_PROGRAM_LIBRARY boost_program_options)
-find_library(BOOST_THREAD_LIBRARY boost_thread)
+find_library(BOOST_PROGRAM_LIBRARY NAMES boost_program_options 
boost_program_options-mt)
+find_library(BOOST_THREAD_LIBRARY NAMES boost_thread boost_thread-mt)
 find_library(GEOTIFF_LIBRARY geotiff)
 find_library(TIFF_LIBRARY tiff)
-if(${CMAKE_SYSTEM_NAME} STREQUAL "Linux") # Linux requires laszip and gdal 
libraries
+if(${CMAKE_SYSTEM_NAME} STREQUAL "Linux")
        find_library(LASZIP_LIBRARY laszip)
-       find_library(GDL_LIBRARY gdal)
 else()
        set(LASZIP_LIBRARY "")
-       set(GDL_LIBRARY "")
 endif()
-if(LIBLAS_LIBRARY AND LIBLAS_C_LIBRARY AND BOOST_PROGRAM_LIBRARY AND 
BOOST_THREAD_LIBRARY AND GDL_LIBRARY AND GEOTIFF_LIBRARY AND TIFF_LIBRARY AND 
LASZIP_LIBRARY)
-       set(LIBLAS_LIBRARIES 
"${LIBLAS_LIBRARY};${LIBLAS_C_LIBRARY};${BOOST_PROGRAM_LIBRARY};${BOOST_THREAD_LIBRARY};${GDL_LIBRARY};${GEOTIFF_LIBRARY};${TIFF_LIBRARY};${LASZIP_LIBRARY}")
+if(${CMAKE_SYSTEM_NAME} MATCHES "^Linux|Darwin$")
+       find_library(GDAL_LIBRARY gdal)
+else()
+       set(GDAL_LIBRARY "")
+endif()
+
+if(LIBLAS_LIBRARY AND LIBLAS_C_LIBRARY AND BOOST_PROGRAM_LIBRARY AND 
BOOST_THREAD_LIBRARY AND GDAL_LIBRARY AND GEOTIFF_LIBRARY AND TIFF_LIBRARY AND 
LASZIP_LIBRARY)
+       set(LIBLAS_LIBRARIES 
"${LIBLAS_LIBRARY};${LIBLAS_C_LIBRARY};${BOOST_PROGRAM_LIBRARY};${BOOST_THREAD_LIBRARY};${GDAL_LIBRARY};${GEOTIFF_LIBRARY};${TIFF_LIBRARY};${LASZIP_LIBRARY}")
 endif()
 
 # Handle the QUIETLY and REQUIRED arguments and set LIBLAS_FOUND to TRUE if 
all listed variables are TRUE.
diff --git a/cmake/FindUUID.cmake b/cmake/FindUUID.cmake
--- a/cmake/FindUUID.cmake
+++ b/cmake/FindUUID.cmake
@@ -26,6 +26,10 @@ endif()
 
 # Handle the QUIETLY and REQUIRED arguments and set UUID_FOUND to TRUE if all 
listed variables are TRUE.
 include(FindPackageHandleStandardArgs)
-find_package_handle_standard_args(UUID DEFAULT_MSG UUID_LIBRARIES 
UUID_INCLUDE_DIR)
+if(${CMAKE_SYSTEM_NAME} STREQUAL "Linux")
+       find_package_handle_standard_args(UUID DEFAULT_MSG UUID_LIBRARIES 
UUID_INCLUDE_DIR)
+else()
+       find_package_handle_standard_args(UUID DEFAULT_MSG UUID_INCLUDE_DIR)
+endif()
 
 mark_as_advanced(UUID_INCLUDE_DIR UUID_LIBRARIES)
diff --git a/gdk/gdk_system.h b/gdk/gdk_system.h
--- a/gdk/gdk_system.h
+++ b/gdk/gdk_system.h
@@ -539,59 +539,6 @@ typedef struct {
 #define MT_sema_up(s)          dispatch_semaphore_signal((s)->sema)
 #define MT_sema_down(s)                dispatch_semaphore_wait((s)->sema, 
DISPATCH_TIME_FOREVER)
 
-#elif defined(_AIX) || defined(__MACH__)
-
-/* simulate semaphores using mutex and condition variable */
-
-typedef struct {
-       int cnt;
-       pthread_mutex_t mutex;
-       pthread_cond_t cond;
-       char name[16];
-} MT_Sema;
-
-#define MT_sema_init(s, nr, n)                                 \
-       do {                                                    \
-               strncpy((s)->name, (n), sizeof((s)->name));     \
-               (s)->name[sizeof((s)->name) - 1] = 0;           \
-               (s)->cnt = (nr);                                \
-               pthread_mutex_init(&(s)->mutex, 0);             \
-               pthread_cond_init(&(s)->cond, 0);               \
-       } while (0)
-
-#define MT_sema_destroy(s)                             \
-       do {                                            \
-               pthread_mutex_destroy(&(s)->mutex);     \
-               pthread_cond_destroy(&(s)->cond);       \
-       } while (0)
-
-#define MT_sema_up(s)                                          \
-       do {                                                    \
-               pthread_mutex_lock(&(s)->mutex);                \
-               if ((s)->cnt++ < 0) {                           \
-                       pthread_cond_signal(&(s)->cond);        \
-               }                                               \
-               pthread_mutex_unlock(&(s)->mutex);              \
-       } while (0)
-
-#define MT_sema_down(s)                                                        
\
-       do {                                                            \
-               TEMDEBUG fprintf(stderr, "#%s: %s: sema %s down...\n",  \
-                                MT_thread_getname(), __func__, (s)->name); \
-               pthread_mutex_lock(&(s)->mutex);                        \
-               if (--(s)->cnt < 0) {                                   \
-                       MT_thread_setsemawait(s);                       \
-                       do {                                            \
-                               pthread_cond_wait(&(s)->cond,           \
-                                                 &(s)->mutex);         \
-                       } while ((s)->cnt < 0);                         \
-                       MT_thread_setsemawait(NULL);                    \
-                       pthread_mutex_unlock(&(s)->mutex);              \
-               }                                                       \
-               TEMDEBUG fprintf(stderr, "#%s: %s: sema %s down complete\n", \
-                                MT_thread_getname(), __func__, (s)->name); \
-       } while (0)
-
 #else
 
 typedef struct {
diff --git a/monetdb5/mal/mal_linker.c b/monetdb5/mal/mal_linker.c
--- a/monetdb5/mal/mal_linker.c
+++ b/monetdb5/mal/mal_linker.c
@@ -187,15 +187,9 @@ loadLibrary(str filename, int flag)
                        ;
 
                /* try hardcoded SO_EXT if that is the same for modules */
-#ifdef _AIX
-               len = snprintf(nme, FILENAME_MAX, "%.*s%c%s_%s%s(%s_%s.0)",
-                                (int) (p - mod_path),
-                                mod_path, DIR_SEP, SO_PREFIX, s, SO_EXT, 
SO_PREFIX, s);
-#else
                len = snprintf(nme, FILENAME_MAX, "%.*s%c%s_%s%s",
                                 (int) (p - mod_path),
                                 mod_path, DIR_SEP, SO_PREFIX, s, SO_EXT);
-#endif
                if (len == -1 || len >= FILENAME_MAX)
                        throw(LOADER, "loadLibrary", RUNTIME_LOAD_ERROR 
"Library filename path is too large");
                handle = dlopen(nme, mode);
_______________________________________________
checkin-list mailing list
[email protected]
https://www.monetdb.org/mailman/listinfo/checkin-list

Reply via email to