Changeset: 156dc8dde933 for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=156dc8dde933
Added Files:
        monetdb5/tools/monetdb.c
Modified Files:
        clients/mapiclient/CMakeLists.txt
        clients/mapiclient/mclient.c
        clients/mapiclient/msqldump.c
        common/options/CMakeLists.txt
        common/options/monet_getopt.h
        common/options/monet_options.h
        common/utils/CMakeLists.txt
        common/utils/mcrypt.h
        common/utils/msabaoth.h
        common/utils/mutils.h
        common/utils/muuid.h
        monetdb5/tools/CMakeLists.txt
Branch: cmake-fun
Log Message:

Utils generated libraries don't require to expose their symbols.


diffs (truncated from 419 to 300 lines):

diff --git a/clients/mapiclient/CMakeLists.txt 
b/clients/mapiclient/CMakeLists.txt
--- a/clients/mapiclient/CMakeLists.txt
+++ b/clients/mapiclient/CMakeLists.txt
@@ -11,27 +11,27 @@ include_directories(../mapilib ../../com
 add_library(mcutil STATIC dump.c dotmonetdb.c dotmonetdb.h eventparser.c 
eventparser.h)
 
 add_executable(mclient mclient.c ReadlineTools.c ReadlineTools.h mhelp.c 
mhelp.h)
-target_link_libraries(mclient PRIVATE mcutil mutils mcrypt mapi stream 
${READLINE_LIBS} ${READLINE_LIBRARIES}
+target_link_libraries(mclient PRIVATE mcutil mutils mcrypt moptions mapi 
stream ${READLINE_LIBS} ${READLINE_LIBRARIES}
                                          ${SOCKET_LIBRARIES} ${ZLIB_LIBRARIES} 
${BZIP2_LIBRARIES} ${SNAPPY_LIBRARIES} ${LZ4_LIBRARIES}
                                          ${LIBLZMA_LIBRARIES} 
${CURL_LIBRARIES} ${ICONV_LIBRARIES} ${CRYPTO_LIBRARIES})
 
 add_executable(msqldump msqldump.c msqldump.h)
-target_link_libraries(msqldump PRIVATE mcutil mutils mapi stream 
${SOCKET_LIBRARIES} ${ZLIB_LIBRARIES}
+target_link_libraries(msqldump PRIVATE mcutil mutils moptions mapi stream 
${SOCKET_LIBRARIES} ${ZLIB_LIBRARIES}
                                          ${BZIP2_LIBRARIES} 
${SNAPPY_LIBRARIES} ${LZ4_LIBRARIES} ${LIBLZMA_LIBRARIES} ${CURL_LIBRARIES}
                                          ${ICONV_LIBRARIES} 
${CRYPTO_LIBRARIES})
 
 add_executable(stethoscope stethoscope.c)
-target_link_libraries(stethoscope PRIVATE mcutil mutils mapi stream 
${SOCKET_LIBRARIES} ${ZLIB_LIBRARIES}
+target_link_libraries(stethoscope PRIVATE mcutil mutils moptions mapi stream 
${SOCKET_LIBRARIES} ${ZLIB_LIBRARIES}
                                          ${BZIP2_LIBRARIES} 
${SNAPPY_LIBRARIES} ${LZ4_LIBRARIES} ${LIBLZMA_LIBRARIES} ${CURL_LIBRARIES}
                                          ${ICONV_LIBRARIES} 
${CRYPTO_LIBRARIES})
 
 add_executable(tachograph tachograph.c)
-target_link_libraries(tachograph PRIVATE mcutil mutils mapi stream 
${SOCKET_LIBRARIES} ${ZLIB_LIBRARIES}
+target_link_libraries(tachograph PRIVATE mcutil mutils moptions mapi stream 
${SOCKET_LIBRARIES} ${ZLIB_LIBRARIES}
                                          ${BZIP2_LIBRARIES} 
${SNAPPY_LIBRARIES} ${LZ4_LIBRARIES} ${LIBLZMA_LIBRARIES} ${CURL_LIBRARIES}
                                          ${ICONV_LIBRARIES} 
${CRYPTO_LIBRARIES})
 
 add_executable(tomograph tomograph.c)
-target_link_libraries(tomograph PRIVATE mcutil mutils mapi stream 
${SOCKET_LIBRARIES} ${ZLIB_LIBRARIES}
+target_link_libraries(tomograph PRIVATE mcutil mutils moptions mapi stream 
${SOCKET_LIBRARIES} ${ZLIB_LIBRARIES}
                                          ${BZIP2_LIBRARIES} 
${SNAPPY_LIBRARIES} ${LZ4_LIBRARIES} ${LIBLZMA_LIBRARIES} ${CURL_LIBRARIES}
                                          ${ICONV_LIBRARIES} 
${CRYPTO_LIBRARIES})
 
diff --git a/clients/mapiclient/mclient.c b/clients/mapiclient/mclient.c
--- a/clients/mapiclient/mclient.c
+++ b/clients/mapiclient/mclient.c
@@ -37,7 +37,6 @@
 #endif
 #include "stream.h"
 #include "msqldump.h"
-#define LIBMUTILS 1
 #include "mprompt.h"
 #include "mutils.h"            /* mercurial_revision */
 #include "dotmonetdb.h"
diff --git a/clients/mapiclient/msqldump.c b/clients/mapiclient/msqldump.c
--- a/clients/mapiclient/msqldump.c
+++ b/clients/mapiclient/msqldump.c
@@ -26,7 +26,6 @@
 
 #include "stream.h"
 #include "msqldump.h"
-#define LIBMUTILS 1
 #include "mprompt.h"
 #include "mutils.h"            /* mercurial_revision */
 #include "dotmonetdb.h"
diff --git a/common/options/CMakeLists.txt b/common/options/CMakeLists.txt
--- a/common/options/CMakeLists.txt
+++ b/common/options/CMakeLists.txt
@@ -8,5 +8,4 @@
 
 add_library(moptions STATIC monet_options.c monet_options.h monet_getopt.h)
 set_target_properties(moptions PROPERTIES POSITION_INDEPENDENT_CODE ON)
-target_compile_definitions(moptions PRIVATE LIBMOPTIONS LIBGDK LIBMAPI)
 install(FILES monet_options.h DESTINATION ${INCLUDEDIR}/monetdb)
diff --git a/common/options/monet_getopt.h b/common/options/monet_getopt.h
--- a/common/options/monet_getopt.h
+++ b/common/options/monet_getopt.h
@@ -46,26 +46,13 @@
 extern "C" {
 #endif
 
-#ifndef moptions_export
-/* avoid using "#ifdef WIN32" so that this file does not need our config.h */
-#if defined(_MSC_VER) || defined(__CYGWIN__) || defined(__MINGW32__)
-#if !defined(LIBMOPTIONS) && !defined(LIBGDK) && !defined(LIBMAPI)
-#define moptions_export extern __declspec(dllimport)
-#else
-#define moptions_export extern __declspec(dllexport)
-#endif
-#else
-#define moptions_export extern
-#endif
-#endif
-
 /* For communication from `getopt' to the caller.
    When `getopt' finds an option that takes an argument,
    the argument value is returned here.
    Also, when `ordering' is RETURN_IN_ORDER,
    each non-option ARGV-element is returned here.  */
 
-       moptions_export char *optarg;
+       extern char *optarg;
 
 /* Index in ARGV of the next element to be scanned.
    This is used for communication to and from the caller
@@ -79,16 +66,16 @@ extern "C" {
    Otherwise, `optind' communicates from one call to the next
    how much of ARGV has been scanned so far.  */
 
-       moptions_export int optind;
+       extern int optind;
 
 /* Callers store zero here to inhibit the error message `getopt' prints
    for unrecognized options.  */
 
-       moptions_export int opterr;
+       extern int opterr;
 
 /* Set to an option character which was unrecognized.  */
 
-       moptions_export int optopt;
+       extern int optopt;
 
 #ifndef __need_getopt
 /* Describe the long-named options requested by the application.
@@ -163,28 +150,28 @@ extern "C" {
    differences in the consts, in stdlib.h.  To avoid compilation
    errors, only prototype getopt for the GNU C library.  */
 #ifndef HAVE_GETOPT
-       moptions_export int getopt(int __argc__, char *const *__argv__, const 
char *__shortopts);
+       extern int getopt(int __argc__, char *const *__argv__, const char 
*__shortopts);
 #endif
 # else                         /* not __GNU_LIBRARY__ */
 #ifndef HAVE_GETOPT
-       moptions_export int getopt();
+       extern int getopt();
 #endif
 # endif                                /* __GNU_LIBRARY__ */
 
 # ifndef __need_getopt
-       moptions_export int getopt_long(int __argc__, char *const *__argv__, 
const char *__shortopts, const struct option *__longopts, int *__longind);
-       moptions_export int getopt_long_only(int __argc__, char *const 
*__argv__, const char *__shortopts, const struct option *__longopts, int 
*__longind);
+       extern int getopt_long(int __argc__, char *const *__argv__, const char 
*__shortopts, const struct option *__longopts, int *__longind);
+       extern int getopt_long_only(int __argc__, char *const *__argv__, const 
char *__shortopts, const struct option *__longopts, int *__longind);
 
 /* Internal only.  Users should not call this directly.  */
        extern int _getopt_internal(int __argc__, char *const *__argv__, const 
char *__shortopts, const struct option *__longopts, int *__longind, int 
__long_only);
 # endif
 #else                          /* not __STDC__ */
 #ifndef HAVE_GETOPT
-       moptions_export int getopt();
+       extern int getopt();
 #endif
 # ifndef __need_getopt
-       moptions_export int getopt_long();
-       moptions_export int getopt_long_only();
+       extern int getopt_long();
+       extern int getopt_long_only();
 
        extern int _getopt_internal();
 # endif
diff --git a/common/options/monet_options.h b/common/options/monet_options.h
--- a/common/options/monet_options.h
+++ b/common/options/monet_options.h
@@ -25,40 +25,27 @@ typedef struct opt {
 extern "C" {
 #endif
 
-#ifndef moptions_export
-/* avoid using "#ifdef WIN32" so that this file does not need our config.h */
-#if defined(_MSC_VER) || defined(__CYGWIN__) || defined(__MINGW32__)
-#if !defined(LIBMOPTIONS) && !defined(LIBGDK) && !defined(LIBMAPI)
-#define moptions_export extern __declspec(dllimport)
-#else
-#define moptions_export extern __declspec(dllexport)
-#endif
-#else
-#define moptions_export extern
-#endif
-#endif
-
 /* mo_print_options will print the option set on stderr */
-moptions_export void mo_print_options(opt *set, int setlen);
+extern void mo_print_options(opt *set, int setlen);
 
 /* mo_find_option, finds the option with the given name in the option set
    (set,setlen). */
-moptions_export char *mo_find_option(opt *set, int setlen, const char *name);
+extern char *mo_find_option(opt *set, int setlen, const char *name);
 
 /* mo_system_config will add the options from the system config file
    (returns the new setlen) */
-moptions_export int mo_system_config(opt **Set, int setlen);
+extern int mo_system_config(opt **Set, int setlen);
 
 /* mo_builtin_settings, will place the builtin settings into a new
    option set (returns the length of this set). */
-moptions_export int mo_builtin_settings(opt **Set);
+extern int mo_builtin_settings(opt **Set);
 
 /* mo_add_option will add a single option to the option set
    (returns new length) */
-moptions_export int mo_add_option(opt **Set, int setlen, opt_kind kind, const 
char *name, const char *value);
+extern int mo_add_option(opt **Set, int setlen, opt_kind kind, const char 
*name, const char *value);
 
 /* mo_free_options will free the resouces take by the options set */
-moptions_export void mo_free_options(opt *set, int setlen);
+extern void mo_free_options(opt *set, int setlen);
 
 #ifdef __cplusplus
 }
diff --git a/common/utils/CMakeLists.txt b/common/utils/CMakeLists.txt
--- a/common/utils/CMakeLists.txt
+++ b/common/utils/CMakeLists.txt
@@ -10,10 +10,7 @@ include_directories(${CRYPTO_INCLUDE_DIR
 
 add_library(mutils STATIC mutils.h mutils.c prompt.c mprompt.h revision.c)
 set_target_properties(mutils PROPERTIES POSITION_INDEPENDENT_CODE ON)
-target_compile_definitions(mutils PRIVATE LIBMUTILS LIBGDK LIBMEROUTIL)
 add_library(mcrypt STATIC mcrypt.h mcrypt.c)
 set_target_properties(mcrypt PROPERTIES POSITION_INDEPENDENT_CODE ON)
-target_compile_definitions(mcrypt PRIVATE LIBMAPI LIBMCRYPT)
 add_library(msabaoth STATIC muuid.h muuid.c msabaoth.h msabaoth.c)
 set_target_properties(msabaoth PROPERTIES POSITION_INDEPENDENT_CODE ON)
-target_compile_definitions(msabaoth PRIVATE LIBMUUID LIBMAL LIBATOMS LIBKERNEL 
LIBOPTIMIZER LIBSCHEDULER LIBMONETDB5 LIBMSABAOTH)
diff --git a/common/utils/mcrypt.h b/common/utils/mcrypt.h
--- a/common/utils/mcrypt.h
+++ b/common/utils/mcrypt.h
@@ -9,25 +9,15 @@
 #ifndef _SEEN_MCRYPT_H
 #define _SEEN_MCRYPT_H 1
 
-#if defined(_MSC_VER) || defined(__CYGWIN__) || defined(__MINGW32__)
-#if !defined(LIBMAPI) && !defined(LIBMCRYPT)
-#define mcrypt_export extern __declspec(dllimport)
-#else
-#define mcrypt_export extern __declspec(dllexport)
-#endif
-#else
-#define mcrypt_export extern
+extern const char *mcrypt_getHashAlgorithms(void);
+extern char *mcrypt_MD5Sum(const char *string, size_t len);
+extern char *mcrypt_SHA1Sum(const char *string, size_t len);
+extern char *mcrypt_SHA224Sum(const char *string, size_t len);
+extern char *mcrypt_SHA256Sum(const char *string, size_t len);
+extern char *mcrypt_SHA384Sum(const char *string, size_t len);
+extern char *mcrypt_SHA512Sum(const char *string, size_t len);
+extern char *mcrypt_RIPEMD160Sum(const char *string, size_t len);
+extern char *mcrypt_BackendSum(const char *string, size_t len);
+extern char *mcrypt_hashPassword(const char *algo, const char *password, const 
char *challenge);
 #endif
 
-mcrypt_export const char *mcrypt_getHashAlgorithms(void);
-mcrypt_export char *mcrypt_MD5Sum(const char *string, size_t len);
-mcrypt_export char *mcrypt_SHA1Sum(const char *string, size_t len);
-mcrypt_export char *mcrypt_SHA224Sum(const char *string, size_t len);
-mcrypt_export char *mcrypt_SHA256Sum(const char *string, size_t len);
-mcrypt_export char *mcrypt_SHA384Sum(const char *string, size_t len);
-mcrypt_export char *mcrypt_SHA512Sum(const char *string, size_t len);
-mcrypt_export char *mcrypt_RIPEMD160Sum(const char *string, size_t len);
-mcrypt_export char *mcrypt_BackendSum(const char *string, size_t len);
-mcrypt_export char *mcrypt_hashPassword(const char *algo, const char 
*password, const char *challenge);
-#endif
-
diff --git a/common/utils/msabaoth.h b/common/utils/msabaoth.h
--- a/common/utils/msabaoth.h
+++ b/common/utils/msabaoth.h
@@ -51,32 +51,22 @@ typedef struct Ssabuplog {
        double crashavg30; /* average of crashes in the last 30 start attempts 
*/
 } sabuplog;
 
-#ifdef WIN32
-#if !defined(LIBMAL) && !defined(LIBATOMS) && !defined(LIBKERNEL) && 
!defined(LIBOPTIMIZER) && !defined(LIBSCHEDULER) && !defined(LIBMONETDB5) && 
!defined(LIBMSABAOTH)
-#define msab_export extern __declspec(dllimport)
-#else
-#define msab_export extern __declspec(dllexport)
-#endif
-#else
-#define msab_export extern
-#endif
-
-msab_export void msab_dbpathinit(const char *dbpath);
-msab_export void msab_dbfarminit(const char *dbfarm);
-msab_export char *msab_getDBfarm(char **ret);
-msab_export char *msab_getDBname(char **ret);
-msab_export char *msab_marchScenario(const char *lang);
-msab_export char *msab_retreatScenario(const char *lang);
-msab_export char *msab_marchConnection(const char *host, const int port);
-msab_export char *msab_wildRetreat(void);
-msab_export char *msab_registerStarting(void);
-msab_export char *msab_registerStarted(void);
-msab_export char *msab_registerStop(void);
-msab_export char *msab_getMyStatus(sabdb** ret);
-msab_export char *msab_getStatus(sabdb** ret, char *dbname);
-msab_export char *msab_freeStatus(sabdb** ret);
-msab_export char *msab_getUplogInfo(sabuplog *ret, const sabdb *db);
-msab_export char *msab_serialise(char **ret, const sabdb *db);
-msab_export char *msab_deserialise(sabdb **ret, char *sabdb);
+extern void msab_dbpathinit(const char *dbpath);
+extern void msab_dbfarminit(const char *dbfarm);
+extern char *msab_getDBfarm(char **ret);
+extern char *msab_getDBname(char **ret);
+extern char *msab_marchScenario(const char *lang);
+extern char *msab_retreatScenario(const char *lang);
+extern char *msab_marchConnection(const char *host, const int port);
+extern char *msab_wildRetreat(void);
+extern char *msab_registerStarting(void);
_______________________________________________
checkin-list mailing list
checkin-list@monetdb.org
https://www.monetdb.org/mailman/listinfo/checkin-list

Reply via email to