Changeset: 86fdba99ba59 for MonetDB
URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=86fdba99ba59
Modified Files:
pathfinder/src/tools/Makefile.ag
pathfinder/src/tools/Mserver.mx
Branch: default
Log Message:
removed obsolete statically linked Mserver for MonetDB/XQuery
in case we will ever feel the need, again, to have a statically
linked server for MonetDB4/XQuery or MonetDB5/SQL,
we should consider moving the servers from monetdb[45]/tools/
to a new top-level servers/ (or alike) directory, that is built
after all other components are built, such that is can statically
link all available modules (without the need to replicate the
servers' source files).
diffs (truncated from 378 to 300 lines):
diff --git a/pathfinder/src/tools/Makefile.ag b/pathfinder/src/tools/Makefile.ag
--- a/pathfinder/src/tools/Makefile.ag
+++ b/pathfinder/src/tools/Makefile.ag
@@ -78,14 +78,6 @@
SOURCES = initmodules.mx
}
-bin_Mserver = {
- COND = LINK_STATIC
- SOURCES = Mserver.mx
- LIBS = libinitmodules STATIC_MODS @SHARED_LIBS@ $(EXTRA_LIBS) \
- ../../../gdk/libbat \
- ../../../monetdb4/monet/libmonet
-}
-
lib_embeddedxq = {
SOURCES = embeddedclient.c.in
LIBS = libinitmodules STATIC_MODS @SHARED_LIBS@ $(EXTRA_LIBS) \
diff --git a/pathfinder/src/tools/Mserver.mx b/pathfinder/src/tools/Mserver.mx
deleted file mode 100644
--- a/pathfinder/src/tools/Mserver.mx
+++ /dev/null
@@ -1,355 +0,0 @@
-@/
-The contents of this file are subject to the MonetDB Public License
-Version 1.1 (the "License"); you may not use this file except in
-compliance with the License. You may obtain a copy of the License at
-http://monetdb.cwi.nl/Legal/MonetDBLicense-1.1.html
-
-Software distributed under the License is distributed on an "AS IS"
-basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the
-License for the specific language governing rights and limitations
-under the License.
-
-The Original Code is the MonetDB Database System.
-
-The Initial Developer of the Original Code is CWI.
-Portions created by CWI are Copyright (C) 1997-July 2008 CWI.
-Copyright August 2008-2011 MonetDB B.V.
-All Rights Reserved.
-@
-
-@f Mserver
-@a M.L. Kersten, P. Boncz, Niels Nes
-@v 4.1
-@* The Monet Server
-@T
-The {\tt Mserver} is the Monet server. The database administrator starts
-and stops it. (S)he can type on the console, which is started on the
-standard input/output.
-
-@+ Manual Page
-@T
-The Mserver is a multi-threaded program. There is one system thread, and for
-each user (system administrator included) there is one worker thread.
-As a default, the Mserver also starts the network listener thread,
-on the port number specified in the parameter file.
-
-@- Usage
-@T
-\begin{verbatim}
-Mserver { [ --dbname <db-name> ]
- [ --dbfarm <dbfarm> ]
- [ --dbinit <stmt> ]
- [ -c|--config <config-file> ]
- [ -d<value>|--debug=value ]
- [ -s|--set [option=value] ] set option can be given multiple times
- to override verious options
- } [ <mil-script> ]
-\end{verbatim}
-
-Since the console has no command-line history nor file name completion,
-you are {\bf recommended} to use the
-@[<a href="../MapiClient/index.html">mclient</a>@ program for interactive
sessions
-instead.
-
-The options have the following meaning:
-\begin{description}
-\item[{\tt --dbname $<$db-name$>$ }]
- open the database {\em db-name}.
-\item[{\tt --config $<$config-file$>$ }]
- where to find the environment settings
-\end{description}
-
-@{
-@+ Implementation
-@h
-#ifndef _MONET_GLOBAL_H_
-#define _MONET_GLOBAL_H_
-
-#include "monet.h"
-#include "yytree.h"
-
-#endif /* _MONET_GLOBAL_H_ */
-@c
-#include "monetdb_config.h"
-#include "Mserver.h"
-
-#ifdef _CRTDBG_MAP_ALLOC
-/* Windows only:
- our definition of new and delete clashes with the one if
- _CRTDBG_MAP_ALLOC is defined.
-*/
-#undef _CRTDBG_MAP_ALLOC
-#endif
-
-#include "monet_context.h"
-#include "monet_interpreter.h"
-#include "monet_parse.h"
-#include "monet_queue.h"
-#include "monet_client.h"
-#include "monet_process.h"
-#include "monet_options.h"
-#include "initmodules.h"
-#include <locale.h>
-
-#ifndef HAVE_GETOPT_LONG
-# include "monet_getopt.h"
-#else
-# ifdef HAVE_GETOPT_H
-# include "getopt.h"
-# endif
-#endif
-
-#ifdef NATIVE_WIN32
-#define getcwd _getcwd
-#endif
-@-
-The architecture is setup to handle multiple streams of requests.
-The first thread started represents the server. It reads from standard input
-and writes to standard input. This is also a way to recognize the server
-actions.
-To start the server in the background one should use the argument -background.
-This closes standard input. Direct execution in the background may cause
-the server to hang in stdio for input from the terminal.
-@
-@
-The server thread started remains in existence until all other threads die.
-The server is stopped by cntrl-D or the quit command.
-@
-
-@-
-Brain-damaged Sun engineers decided to use malloc for allocating an enormous
-buffer of 20 bytes in the sunos2.5.5.X thread library, making the tunable
-malloc library totally unusable, since it requires you to do advice before any
-use of malloc(). We hack around it, by using realloc(0,size) in
-gdk/gdk_utils.mx and wrapping malloc in the below dummy function:
-@c
-#ifdef HAVE_MALLOPT
-static int malloc_init = 1;
-#endif
-@c
-static void
-usage(char *prog, int debug, opt *set, int setlen)
-{
- fprintf(stderr, "Usage: %s [ options ] [ script+ ]
\n", prog);
- fprintf(stderr, "Options are:
\n");
- fprintf(stderr, " -c <config_file> | --config=<config_file>
\n");
- fprintf(stderr, " --dbname=<database_name>
\n");
- fprintf(stderr, "
--dbfarm=<database_directory>\n");
- fprintf(stderr, " --dbinit=<MIL_statement>
\n");
- fprintf(stderr, " -d<debug_level> | --debug=<debug_level>
\n");
- fprintf(stderr, " -s <option>=<value> | --set <option>=<value>
\n");
- fprintf(stderr, " -? | --help
\n");
- if (debug)
- mo_print_options(set, setlen);
- exit(-1);
-}
-
-static str
-absolute_path(str s)
-{
- if (!MT_path_absolute(s)) {
- str ret = (str) GDKmalloc(strlen(s) + strlen(monet_cwd) + 2);
-
- sprintf(ret, "%s%c%s", monet_cwd, DIR_SEP, s);
- return ret;
- }
- return GDKstrdup(s);
-}
-
-static Client
-Monet_init(opt *set, int setlen)
-{
- /* determine Monet's kernel settings. */
- if (!GDKinit(set, setlen))
- return NULL;
-
- monet_daemon = GDKembedded;
- if (GDKgetenv_isyes("monet_daemon") || GDKgetenv_isyes("daemon")) {
- monet_daemon = 1;
-#ifdef HAVE_SETSID
- setsid();
-#endif
- }
- return monet_init();
-}
-
-@c
-int
-main(int argc, char **av)
-{
- Client c;
- char *prog = *av;
- opt *set = NULL;
- int idx = 0, debug = 0, setlen = 0, status = 1;
-
- static struct option long_options[] = {
- {"config", 1, 0, 'c'},
- {"dbname", 1, 0, 0},
- {"dbfarm", 1, 0, 0},
- {"dbinit", 1, 0, 0},
- {"debug", 2, 0, 'd'},
- {"help", 0, 0, '?'},
- {"nostalgic", 0, 0, 0},
- {"set", 1, 0, 's'},
- {"trace", 0, 0, 0},
- {0, 0, 0, 0}
- };
-
-@-
-We give malloc advice here. Main goal: prevent fragmentation.
-We do this by declaring everything below 2K as 'small'. These
-values will be drawn from a fixed pools of 400K.
-A grain size of 128 bytes is used to keep overhead low.
-
-We do this by declaring everything below 2K as 'small'. These
-values will be drawn from a fixed pools of 400K.
-A grain size of 128 bytes is used to keep overhead low.
-Trivial remark: for dynamically linked executables the mallopt
-capabilities depend on the malloc implementation used at run time.
-@= mallopt
- if (malloc_init) {
-/* for (Red Hat) Linux (6.2) unused and ignored at least as of glibc-2.1.3-15
*/
-/* for (Red Hat) Linux (8) used at least as of glibc-2.2.93-5 */
- if (mallopt(M_MXFAST, 192)) {
- fprintf(stderr, "monet: mallopt(M_MXFAST,192) fails.\n");
- }
-#ifdef M_BLKSZ
- if (mallopt(M_BLKSZ, 8*1024)) {
- fprintf(stderr, "monet: mallopt(M_BLKSZ,8*1024) fails.\n");
- }
-#endif
- }
- malloc_init=0;
-@
-@c
- if (setlocale(LC_CTYPE, "") == NULL) {
- GDKfatal("cannot set locale\n");
- }
-#ifdef HAVE_MALLOPT
- @:mallopt@
-#endif
-
- if (getcwd(monet_cwd, PATHLENGTH - 1) == NULL) {
- perror("pwd");
- GDKfatal("Monet_init: could not determine current directory\n");
- }
-
- if (!(setlen = mo_builtin_settings(&set)))
- usage(prog, debug, set, setlen);
-
- setlen = mo_add_option(&set, setlen, opt_config, "prefix",
MONETDB4_PREFIX);
- setlen = mo_add_option(&set, setlen, opt_config, "config",
MONETDB4_CONFFILE);
-
- for (;;) {
- int option_index = 0;
-
- int opt = getopt_long(argc, av, "c:d::?s:", long_options,
&option_index);
-
- if (opt == -1)
- break;
-
- switch (opt) {
- case 0:
- if (strcmp(long_options[option_index].name, "dbname")
== 0) {
- setlen = mo_add_option(&set, setlen,
opt_cmdline, "gdk_dbname", optarg);
- break;
- }
- if (strcmp(long_options[option_index].name, "dbfarm")
== 0) {
- setlen = mo_add_option(&set, setlen,
opt_cmdline, "gdk_dbfarm", optarg);
- break;
- }
- if (strcmp(long_options[option_index].name, "dbinit")
== 0) {
- if (monet_dbinit)
- fprintf(stderr, "!ERROR: --dbinit set
twice," " last one takes precedence\n");
- monet_dbinit = optarg;
- break;
- }
- if (strcmp(long_options[option_index].name, "trace") ==
0) {
- monet_listing = 1;
- break;
- }
- if (strcmp(long_options[option_index].name,
"nostalgic") == 0) {
- monet_nostalgic = 1;
- break;
- }
- usage(prog, debug, set, setlen);
- break;
- case 'c':
_______________________________________________
Checkin-list mailing list
[email protected]
http://mail.monetdb.org/mailman/listinfo/checkin-list