Changeset: ce19036f2a30 for MonetDB
URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=ce19036f2a30
Modified Files:
configure.ag
tools/mserver/Makefile.ag
tools/mserver/mserver5.c
Branch: default
Log Message:
Merged from Jul2012
diffs (119 lines):
diff --git a/configure.ag b/configure.ag
--- a/configure.ag
+++ b/configure.ag
@@ -1641,28 +1641,30 @@ if test "x$have_pthread" != xno; then
esac
CPPFLAGS="$save_CPPFLAGS"
- case $GCC in
- yes)
+ save_LIBS="$LIBS"
+ save_CPPFLAGS="$CPPFLAGS"
+ case $GCC-$have_pthread in
+ yes-auto|yes-yes)
# use GCC's knowledge about the target platform, sets
flags
# for both the preprocessor as well as the linker
- PTHREAD_INCS="$PTHREAD_INCS -pthread"
- PTHREAD_LIBS="$PTHREAD_LIBS -pthread"
- CPPFLAGS="$CPPFLAGS -pthread"
- LIBS="$LIBS -pthread"
+ PTHREAD_INCS="-pthread"
+ PTHREAD_LIBS="-pthread"
+ CPPFLAGS="$CPPFLAGS $PTHREAD_INCS"
+ LIBS="$LIBS $PTHREAD_LIBS"
;;
*)
- save_LIBS="$LIBS"
# ok, do old-fashioned stuff
- LIBS="$LIBS $PTHREAD_LIBS" # in case user did
--with-pthreads
+ CPPFLAGS="$CPPFLAGS $PTHREAD_INCS" # in case user did
--with-pthreads
+ LIBS="$LIBS $PTHREAD_LIBS"
pthread_found=yes
AC_SEARCH_LIBS([sem_init], [pthreadGC2 pthreadGC1
pthreadGC pthread],
- [PTHREAD_LIBS="$PTHREAD_LIBS
$ac_cv_search_sem_init"],
+ [LIBS="$LIBS $ac_cv_search_sem_init"],
[pthread_found=no])
if test x"$pthread_found" = xno ; then
pthread_found=yes
dnl sun
AC_SEARCH_LIBS([sem_post], [pthread],
- [PTHREAD_LIBS="$PTHREAD_LIBS -lpthread
-lposix4"],
+ [LIBS="$LIBS -lpthread -lposix4"],
[pthread_found=no],
"-lposix4")
fi
@@ -1670,7 +1672,7 @@ if test "x$have_pthread" != xno; then
pthread_found=yes
dnl hp-ux
AC_SEARCH_LIBS([sem_post], [pthread],
- [PTHREAD_LIBS="$PTHREAD_LIBS -lpthread
-lrt"],
+ [LIBS="$LIBS -lpthread -lrt"],
[pthread_found=no],
"-lrt")
fi
@@ -1680,7 +1682,7 @@ if test "x$have_pthread" != xno; then
fi
have_pthread=no
fi
- LIBS="$save_LIBS"
+ PTHREAD_LIBS="$LIBS"
;;
esac
@@ -1699,11 +1701,9 @@ if test "x$have_pthread" != xno; then
dnl this function very ugly is overloaded with semaphore stuff
dnl so we DO need to check for it, for platforms which have it
dnl in a separate lib, like Solaris
- oldLIBS="$LIBS"
- LIBS="$PTHREAD_LIBS"
AC_SEARCH_LIBS(sem_wait, rt)
- PTHREAD_LIBS="$LIBS"
- LIBS="$oldLIBS"
+
+ LIBS="$save_LIBS"
CPPFLAGS="$save_CPPFLAGS"
fi
diff --git a/tools/mserver/Makefile.ag b/tools/mserver/Makefile.ag
--- a/tools/mserver/Makefile.ag
+++ b/tools/mserver/Makefile.ag
@@ -32,6 +32,6 @@ bin_mserver5 = {
SOURCES = mserver5.c monet_version.h monet_version.c.in
LIBS = ../../monetdb5/tools/libmonetdb5 \
../../gdk/libbat \
- $(SOCKET_LIBS) $(MALLOC_LIBS) $(PTHREAD_LIBS) $(DL_LIBS) \
- $(curl_LIBS) $(pcre_LIBS) $(openssl_LIBS) $(PSAPILIB)
+ $(curl_LIBS) $(pcre_LIBS) $(openssl_LIBS) $(PSAPILIB) \
+ $(SOCKET_LIBS) $(MALLOC_LIBS) $(DL_LIBS) $(PTHREAD_LIBS)
}
diff --git a/tools/mserver/mserver5.c b/tools/mserver/mserver5.c
--- a/tools/mserver/mserver5.c
+++ b/tools/mserver/mserver5.c
@@ -208,6 +208,7 @@ main(int argc, char **av)
str err = MAL_SUCCEED;
char prmodpath[1024];
char *modpath = NULL;
+ char *binpath = NULL;
static struct option long_options[] = {
{ "config", 1, 0, 'c' },
@@ -267,6 +268,11 @@ main(int argc, char **av)
GDKfatal("monet_init: could not determine current directory\n");
}
+ /* retrieve binpath early (before monet_init) because some
+ * implementations require the working directory when the binary was
+ * called */
+ binpath = get_bin_path();
+
if (!(setlen = mo_builtin_settings(&set)))
usage(prog);
@@ -442,7 +448,6 @@ main(int argc, char **av)
char *libdirs[] = { "lib", "lib64", "lib/64", "lib32", NULL };
size_t i;
struct stat sb;
- char *binpath = get_bin_path();
if (binpath != NULL) {
char *p = strrchr(binpath, DIR_SEP);
if (p != NULL)
_______________________________________________
Checkin-list mailing list
[email protected]
http://mail.monetdb.org/mailman/listinfo/checkin-list