Changeset: e84860c5c3fd for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB/rev/e84860c5c3fd
Modified Files:
        clients/Tests/exports.stable.out
        clients/mapiclient/mclient.c
        clients/mapiclient/msqldump.c
        clients/mapilib/mapi.c
        clients/mapilib/mapi.h
        clients/odbc/driver/ODBCError.c
        clients/odbc/driver/ODBCUtil.c
        clients/odbc/driver/SQLGetInfo.c
        cmake/monetdb-versions.cmake
        common/stream/stream.c
        common/stream/stream.h
        gdk/gdk_utils.c
        gdk/gdk_utils.h
        monetdb5/mal/mal.c
        monetdb5/mal/mal.h
        monetdb5/mal/mal_profiler.c
        monetdb_config.h.in
        sql/backends/monet5/vaults/shp/shp.h
        tools/merovingian/client/monetdb.c
        tools/merovingian/daemon/argvcmds.c
        tools/merovingian/daemon/controlrunner.c
        tools/merovingian/daemon/merovingian.c
        tools/merovingian/daemon/proxy.c
        tools/monetdbe/monetdbe.c
        tools/monetdbe/monetdbe.h
Branch: default
Log Message:

Introduce defines and functions to get version numbers of various parts.
Also get rid of some configure legacy (generic defines, such as
VERSION and PACKAGE_*).


diffs (truncated from 545 to 300 lines):

diff --git a/clients/Tests/exports.stable.out b/clients/Tests/exports.stable.out
--- a/clients/Tests/exports.stable.out
+++ b/clients/Tests/exports.stable.out
@@ -287,6 +287,7 @@ gdk_return GDKgetsemval(int sem_id, int 
 gdk_return GDKinit(struct opt *set, int setlen, bool embedded);
 void *GDKinitmmap(size_t id, size_t size, size_t *return_size);
 bool GDKinmemory(int farmid);
+const char *GDKlibversion(void) __attribute__((__const__));
 ATOMIC_TYPE GDKlockcnt;
 ATOMIC_TYPE GDKlockcontentioncnt;
 MT_Lock *volatile GDKlocklist;
@@ -628,7 +629,7 @@ const char *mapi_get_lang(Mapi mid) __at
 int64_t mapi_get_last_id(MapiHdl hdl) __attribute__((__nonnull__(1)));
 int mapi_get_len(MapiHdl hdl, int fnr) __attribute__((__nonnull__(1)));
 int64_t mapi_get_maloptimizertime(MapiHdl hdl) __attribute__((__nonnull__(1)));
-const char *mapi_get_mapi_version(Mapi mid) __attribute__((__nonnull__(1)));
+const char *mapi_get_mapi_version(void);
 const char *mapi_get_monet_version(Mapi mid) __attribute__((__nonnull__(1)));
 const char *mapi_get_motd(Mapi mid) __attribute__((__nonnull__(1)));
 char *mapi_get_name(MapiHdl hdl, int fnr) __attribute__((__nonnull__(1)));
@@ -1111,6 +1112,7 @@ MT_Lock mal_remoteLock;
 void mal_reset(void);
 int mal_startup(void);
 void mal_unquote(char *msg);
+const char *mal_version(void);
 stream *maleventstream;
 const char *manifoldRef;
 const char *mapiRef;
@@ -1473,6 +1475,7 @@ ssize_t mnstr_read_block(stream *restric
 ssize_t mnstr_readline(stream *restrict s, void *restrict buf, size_t maxcnt);
 void mnstr_set_bigendian(stream *s, bool bigendian);
 void mnstr_settimeout(stream *s, unsigned int ms, bool (*func)(void *), void 
*data);
+const char *mnstr_version(void);
 ssize_t mnstr_write(stream *restrict s, const void *restrict buf, size_t 
elmsize, size_t cnt);
 int mnstr_writeBte(stream *s, int8_t val);
 int mnstr_writeBteArray(stream *restrict s, const int8_t *restrict val, size_t 
cnt);
diff --git a/clients/mapiclient/mclient.c b/clients/mapiclient/mclient.c
--- a/clients/mapiclient/mclient.c
+++ b/clients/mapiclient/mclient.c
@@ -3349,7 +3349,7 @@ main(int argc, char **argv)
                case 'v': {
                        mnstr_printf(toConsole,
                                     "mclient, the MonetDB interactive "
-                                    "terminal, version %s", VERSION);
+                                    "terminal, version %s", MONETDB_VERSION);
 #ifdef MONETDB_RELEASE
                        mnstr_printf(toConsole, " (%s)", MONETDB_RELEASE);
 #else
@@ -3372,6 +3372,8 @@ main(int argc, char **argv)
                                     "character encoding: %s\n",
                                     encoding ? encoding : "utf-8 (default)");
 #endif
+                       mnstr_printf(toConsole, "using mapi library %s\n",
+                                                mapi_get_mapi_version());
                        return 0;
                }
                case 'w':
diff --git a/clients/mapiclient/msqldump.c b/clients/mapiclient/msqldump.c
--- a/clients/mapiclient/msqldump.c
+++ b/clients/mapiclient/msqldump.c
@@ -159,7 +159,7 @@ main(int argc, char **argv)
                        break;
                case 'v': {
                        printf("msqldump, the MonetDB interactive database "
-                              "dump tool, version %s", VERSION);
+                              "dump tool, version %s", MONETDB_VERSION);
 #ifdef MONETDB_RELEASE
                        printf(" (%s)", MONETDB_RELEASE);
 #else
@@ -247,7 +247,7 @@ main(int argc, char **argv)
                        *p = 0;
 
                mnstr_printf(out,
-                            "-- msqldump version %s", VERSION);
+                            "-- msqldump version %s", MONETDB_VERSION);
 #ifdef MONETDB_RELEASE
                mnstr_printf(out, " (%s)", MONETDB_RELEASE);
 #else
diff --git a/clients/mapilib/mapi.c b/clients/mapilib/mapi.c
--- a/clients/mapilib/mapi.c
+++ b/clients/mapilib/mapi.c
@@ -891,7 +891,6 @@ enum mapi_lang_t {
 */
 struct MapiStruct {
        char *server;           /* server version */
-       const char *mapiversion; /* mapi version */
        char *hostname;
        int port;
        char *username;
@@ -1909,7 +1908,6 @@ static const struct MapiStruct MapiStruc
        .auto_commit = true,
        .error = MOK,
        .languageId = LANG_SQL,
-       .mapiversion = "mapi 1.0",
        .cachelimit = 100,
        .redirmax = 10,
        .blk.eos = false,
@@ -5671,9 +5669,9 @@ mapi_get_uri(Mapi mid)
 }
 
 const char *
-mapi_get_mapi_version(Mapi mid)
+mapi_get_mapi_version(void)
 {
-       return mid->mapiversion;
+       return MAPI_VERSION;
 }
 
 const char *
diff --git a/clients/mapilib/mapi.h b/clients/mapilib/mapi.h
--- a/clients/mapilib/mapi.h
+++ b/clients/mapilib/mapi.h
@@ -235,8 +235,7 @@ mapi_export const char *mapi_get_host(Ma
        __attribute__((__nonnull__(1)));
 mapi_export const char *mapi_get_user(Mapi mid)
        __attribute__((__nonnull__(1)));
-mapi_export const char *mapi_get_mapi_version(Mapi mid)
-       __attribute__((__nonnull__(1)));
+mapi_export const char *mapi_get_mapi_version(void);
 mapi_export const char *mapi_get_monet_version(Mapi mid)
        __attribute__((__nonnull__(1)));
 mapi_export const char *mapi_get_motd(Mapi mid)
diff --git a/clients/odbc/driver/ODBCError.c b/clients/odbc/driver/ODBCError.c
--- a/clients/odbc/driver/ODBCError.c
+++ b/clients/odbc/driver/ODBCError.c
@@ -39,7 +39,7 @@ struct tODBCError {
        struct tODBCError *next;        /* pointer to the next Error object or 
NULL */
 };
 
-const char ODBCErrorMsgPrefix[] = "[MonetDB][ODBC Driver " PACKAGE_VERSION "]";
+const char ODBCErrorMsgPrefix[] = "[MonetDB][ODBC Driver " MONETDB_VERSION "]";
 const int ODBCErrorMsgPrefixLength = (int) sizeof(ODBCErrorMsgPrefix) - 1;
 
 /*
diff --git a/clients/odbc/driver/ODBCUtil.c b/clients/odbc/driver/ODBCUtil.c
--- a/clients/odbc/driver/ODBCUtil.c
+++ b/clients/odbc/driver/ODBCUtil.c
@@ -39,7 +39,7 @@ BOOL WINAPI
 DllMain(HINSTANCE hinstDLL, DWORD reason, LPVOID reserved)
 {
 #ifdef ODBCDEBUG
-       ODBCLOG("DllMain %ld (%s)\n", (long) reason, PACKAGE_STRING);
+       ODBCLOG("DllMain %ld (MonetDB %s)\n", (long) reason, MONETDB_VERSION);
 #endif
        (void) hinstDLL;
        (void) reason;
diff --git a/clients/odbc/driver/SQLGetInfo.c b/clients/odbc/driver/SQLGetInfo.c
--- a/clients/odbc/driver/SQLGetInfo.c
+++ b/clients/odbc/driver/SQLGetInfo.c
@@ -410,7 +410,7 @@ MNDBGetInfo(ODBCDbc *dbc,
                len = sizeof(SQLINTEGER);
                break;
        case SQL_DBMS_NAME:
-               sValue = PACKAGE_NAME;
+               sValue = "MonetDB";
                break;
        case SQL_DBMS_VER:
                snprintf(buf, sizeof(buf), "%02d.%02d.%04d",
@@ -438,10 +438,10 @@ MNDBGetInfo(ODBCDbc *dbc,
        case SQL_DRIVER_ODBC_VER:
                sValue = MONETDB_ODBC_VER;
                break;
-       case SQL_DRIVER_VER: {
-               int maj = 0, min = 0, pat = 0;
-               sscanf(PACKAGE_VERSION, "%d.%d.%d", &maj, &min, &pat);
-               snprintf(buf, sizeof(buf), "%02d.%02d.%04d %s", maj, min, pat,
+       case SQL_DRIVER_VER:
+               snprintf(buf, sizeof(buf), "%02d.%02d.%04d %s",
+                        MONETDB_VERSION_MAJOR, MONETDB_VERSION_MINOR,
+                        MONETDB_VERSION_PATCH,
 #ifdef MONETDB_RELEASE
                         MONETDB_RELEASE
 #else
@@ -450,7 +450,6 @@ MNDBGetInfo(ODBCDbc *dbc,
                        );
                sValue = buf;
                break;
-       }
        case SQL_DROP_ASSERTION:
                /* SQL_DA_DROP_ASSERION */
                break;
diff --git a/cmake/monetdb-versions.cmake b/cmake/monetdb-versions.cmake
--- a/cmake/monetdb-versions.cmake
+++ b/cmake/monetdb-versions.cmake
@@ -15,10 +15,12 @@ if(RELEASE_VERSION)
 endif()
 set(MONETDB_VERSION 
"${MONETDB_VERSION_MAJOR}.${MONETDB_VERSION_MINOR}.${MONETDB_VERSION_PATCH}")
 
-# Version numbers for the shared libraries that we provide
-# the numbers are: <CURRENT>:<REVISION>:<AGE>
+# Version numbers for the shared libraries that we provide.
 # The scheme used here comes from libtool but is also usable in the
 # current context.
+# The libtool scheme uses values <CURRENT>:<REVISION>:<AGE>, but we
+# have renamed them here to <CURRENT>, <PATCH>, <MINOR> respectively.
+
 # These numbers must be changed according to the following rules
 # (follow them all in order):
 
@@ -36,12 +38,12 @@ set(MONETDB_VERSION "${MONETDB_VERSION_M
 # In other words
 # X   if there are no code changes, don't change version numbers;
 # FIX if there are changes to the code (bug fixes) but no API changes,
-#     just increment REVISION;
+#     just increment PATCH;
 # NEW if there are only backward compatible API changes (new
-#     interfaces), increment both CURRENT and AGE, and set REVISION to
+#     interfaces), increment both CURRENT and MINOR, and set PATCH to
 #     0;
 # BRK if there are also incompatible API changes (interfaces removed or
-#     changed), increment CURRENT, and set AGE and REVISION to 0.
+#     changed), increment CURRENT, and set MINOR and PATCH to 0.
 #     IMPORTANT: also change debian package names for the relevant
 #     library.  This involves renaming the file in debian/ and
 #     updating references to the package in debian/control.  The version
@@ -50,35 +52,35 @@ set(MONETDB_VERSION "${MONETDB_VERSION_M
 # version of the GDK library (subdirectory gdk; also includes
 # common/options and common/utils)
 set(GDK_VERSION_CURRENT "22")
-set(GDK_VERSION_REVISION "3")
-set(GDK_VERSION_AGE "1")
-math(EXPR GDK_VERSION_MAJOR "${GDK_VERSION_CURRENT} - ${GDK_VERSION_AGE}")
-set(GDK_VERSION 
"${GDK_VERSION_MAJOR}.${GDK_VERSION_AGE}.${GDK_VERSION_REVISION}")
+set(GDK_VERSION_MINOR "1")
+set(GDK_VERSION_PATCH "3")
+math(EXPR GDK_VERSION_MAJOR "${GDK_VERSION_CURRENT} - ${GDK_VERSION_MINOR}")
+set(GDK_VERSION 
"${GDK_VERSION_MAJOR}.${GDK_VERSION_MINOR}.${GDK_VERSION_PATCH}")
 
 # version of the MAPI library (subdirectory clients/mapilib)
 set(MAPI_VERSION_CURRENT "12")
-set(MAPI_VERSION_REVISION "6")
-set(MAPI_VERSION_AGE "0")
-math(EXPR MAPI_VERSION_MAJOR "${MAPI_VERSION_CURRENT} - ${MAPI_VERSION_AGE}")
-set(MAPI_VERSION 
"${MAPI_VERSION_MAJOR}.${MAPI_VERSION_AGE}.${MAPI_VERSION_REVISION}")
+set(MAPI_VERSION_MINOR "0")
+set(MAPI_VERSION_PATCH "6")
+math(EXPR MAPI_VERSION_MAJOR "${MAPI_VERSION_CURRENT} - ${MAPI_VERSION_MINOR}")
+set(MAPI_VERSION 
"${MAPI_VERSION_MAJOR}.${MAPI_VERSION_MINOR}.${MAPI_VERSION_PATCH}")
 
 # version of the MONETDB5 library (subdirectory monetdb5, not including extras 
or sql)
 set(MONETDB5_VERSION_CURRENT "30")
-set(MONETDB5_VERSION_REVISION "6")
-set(MONETDB5_VERSION_AGE "0")
-math(EXPR MONETDB5_VERSION_MAJOR "${MONETDB5_VERSION_CURRENT} - 
${MONETDB5_VERSION_AGE}")
-set(MONETDB5_VERSION 
"${MONETDB5_VERSION_MAJOR}.${MONETDB5_VERSION_AGE}.${MONETDB5_VERSION_REVISION}")
+set(MONETDB5_VERSION_MINOR "0")
+set(MONETDB5_VERSION_PATCH "6")
+math(EXPR MONETDB5_VERSION_MAJOR "${MONETDB5_VERSION_CURRENT} - 
${MONETDB5_VERSION_MINOR}")
+set(MONETDB5_VERSION 
"${MONETDB5_VERSION_MAJOR}.${MONETDB5_VERSION_MINOR}.${MONETDB5_VERSION_PATCH}")
 
 # version of the MONETDBE library (subdirectory tools/monetdbe)
 set(MONETDBE_VERSION_CURRENT "1")
-set(MONETDBE_VERSION_REVISION "2")
-set(MONETDBE_VERSION_AGE "0")
-math(EXPR MONETDBE_VERSION_MAJOR "${MONETDBE_VERSION_CURRENT} - 
${MONETDBE_VERSION_AGE}")
-set(MONETDBE_VERSION 
"${MONETDBE_VERSION_MAJOR}.${MONETDBE_VERSION_AGE}.${MONETDBE_VERSION_REVISION}")
+set(MONETDBE_VERSION_MINOR "0")
+set(MONETDBE_VERSION_PATCH "2")
+math(EXPR MONETDBE_VERSION_MAJOR "${MONETDBE_VERSION_CURRENT} - 
${MONETDBE_VERSION_MINOR}")
+set(MONETDBE_VERSION 
"${MONETDBE_VERSION_MAJOR}.${MONETDBE_VERSION_MINOR}.${MONETDBE_VERSION_PATCH}")
 
 # version of the STREAM library (subdirectory common/stream)
 set(STREAM_VERSION_CURRENT "14")
-set(STREAM_VERSION_REVISION "4")
-set(STREAM_VERSION_AGE "0")
-math(EXPR STREAM_VERSION_MAJOR "${STREAM_VERSION_CURRENT} - 
${STREAM_VERSION_AGE}")
-set(STREAM_VERSION 
"${STREAM_VERSION_MAJOR}.${STREAM_VERSION_AGE}.${STREAM_VERSION_REVISION}")
+set(STREAM_VERSION_MINOR "0")
+set(STREAM_VERSION_PATCH "4")
+math(EXPR STREAM_VERSION_MAJOR "${STREAM_VERSION_CURRENT} - 
${STREAM_VERSION_MINOR}")
+set(STREAM_VERSION 
"${STREAM_VERSION_MAJOR}.${STREAM_VERSION_MINOR}.${STREAM_VERSION_PATCH}")
diff --git a/common/stream/stream.c b/common/stream/stream.c
--- a/common/stream/stream.c
+++ b/common/stream/stream.c
@@ -167,6 +167,11 @@ mnstr_init(void)
        return 0;
 }
 
+const char *
+mnstr_version(void)
+{
+       return STREAM_VERSION;
+}
 
 /* Read at most cnt elements of size elmsize from the stream.  Returns
  * the number of elements actually read or < 0 on failure. */
diff --git a/common/stream/stream.h b/common/stream/stream.h
--- a/common/stream/stream.h
+++ b/common/stream/stream.h
@@ -93,6 +93,8 @@ typedef enum mnstr_flush_level {
        MNSTR_FLUSH_ALL = 2,  // write all data and also reset compression state
 } mnstr_flush_level;
 
+stream_export const char *mnstr_version(void);
+
 stream_export char *mnstr_error(const stream *s);
 stream_export const char* mnstr_peek_error(const stream *s);
 stream_export mnstr_error_kind mnstr_errnr(const stream *s);
diff --git a/gdk/gdk_utils.c b/gdk/gdk_utils.c
--- a/gdk/gdk_utils.c
_______________________________________________
checkin-list mailing list
checkin-list@monetdb.org
https://www.monetdb.org/mailman/listinfo/checkin-list

Reply via email to