Changeset: bd45fe62c5f0 for MonetDB
URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=bd45fe62c5f0
Modified Files:
java/src/nl/cwi/monetdb/jdbc/MonetPreparedStatementJavaImpl.java
Branch: sciql
Log Message:
Merge with default branch.
diffs (truncated from 2473 to 300 lines):
diff --git a/NT/winconfig.py b/NT/winconfig.py
--- a/NT/winconfig.py
+++ b/NT/winconfig.py
@@ -41,7 +41,6 @@
("@pkgincludedir@", r'%prefix%\include\@PACKAGE@'),
("@DIRSEP@", '\\'),
("@CROSS_COMPILING_FALSE@", ''),
- ("@LINK_STATIC_FALSE@", ''),
("@HAVE_CLIENTS_FALSE@", '#'),
("@HAVE_MONETDB_FALSE@", '#'),
("@NATIVE_WIN32_FALSE@", '#'),
diff --git a/clients/mapilib/mapi.c b/clients/mapilib/mapi.c
--- a/clients/mapilib/mapi.c
+++ b/clients/mapilib/mapi.c
@@ -3271,11 +3271,11 @@
switch (hdl->params[i].intype) {
case MAPI_TINY:
checkSpace(5);
- sprintf(hdl->query + k, "%hhd", *(signed char
*) src);
+ sprintf(hdl->query + k, "%d", *(signed char *)
src);
break;
case MAPI_UTINY:
checkSpace(5);
- sprintf(hdl->query + k, "%hhu", *(unsigned char
*) src);
+ sprintf(hdl->query + k, "%u", *(unsigned char
*) src);
break;
case MAPI_SHORT:
checkSpace(10);
@@ -3283,7 +3283,7 @@
break;
case MAPI_USHORT:
checkSpace(10);
- sprintf(hdl->query + k, "%hu", *(unsigned short
*) src);
+ sprintf(hdl->query + k, "%u", *(unsigned short
*) src);
break;
case MAPI_INT:
checkSpace(20);
@@ -3320,7 +3320,7 @@
case MAPI_DATE:
checkSpace(50);
sprintf(hdl->query + k,
- "DATE '%04d-%02hu-%02hu'",
+ "DATE '%04d-%02u-%02u'",
((MapiDate *) src)->year,
((MapiDate *) src)->month,
((MapiDate *) src)->day);
@@ -3328,7 +3328,7 @@
case MAPI_TIME:
checkSpace(60);
sprintf(hdl->query + k,
- "TIME '%02hu:%02hu:%02hu'",
+ "TIME '%02u:%02u:%02u'",
((MapiTime *) src)->hour,
((MapiTime *) src)->minute,
((MapiTime *) src)->second);
@@ -3336,7 +3336,7 @@
case MAPI_DATETIME:
checkSpace(110);
sprintf(hdl->query + k,
- "TIMESTAMP '%04d-%02hu-%02hu
%02hu:%02hu:%02hu.%09u'",
+ "TIMESTAMP '%04d-%02u-%02u
%02u:%02u:%02u.%09u'",
((MapiDateTime *) src)->year,
((MapiDateTime *) src)->month,
((MapiDateTime *) src)->day,
diff --git a/common/utils/mutils.c b/common/utils/mutils.c
--- a/common/utils/mutils.c
+++ b/common/utils/mutils.c
@@ -28,6 +28,10 @@
#include "mutils.h"
+#ifdef HAVE_MACH_O_DYLD_H
+# include <mach-o/dyld.h> /* _NSGetExecutablePath on OSX >=10.5 */
+#endif
+
#ifdef NATIVE_WIN32
#include <stdio.h>
@@ -311,3 +315,40 @@
printf("back traces are not supported on this platform\n");
}
#endif
+
+static char _bin_path[1024];
+char *
+get_bin_path(void)
+{
+ /* getting the path to the executable's binary, isn't all that
+ * simple, unfortunately */
+#if defined(_MSC_VER) /* Windows */
+ if (GetModuleFileName(NULL, _bin_path,
+ (DWORD) sizeof(_bin_path)) != 0)
+ return _bin_path;
+#elif defined(HAVE__NSGETEXECUTABLEPATH) /* Darwin/OSX */
+ uint32_t size = sizeof(_bin_path);
+ if (_NSGetExecutablePath(_bin_path, &size) == 0)
+ return _bin_path;
+#elif defined(HAVE_SYS_SYSCTL_H) && defined(KERN_PROC_PATHNAME) /* BSD */
+ int mib[4];
+ size_t cb = sizeof(_bin_path);
+ mib[0] = CTL_KERN;
+ mib[1] = KERN_PROC;
+ mib[2] = KERN_PROC_PATHNAME;
+ mib[3] = -1;
+ if (sysctl(mib, 4, _bin_path, &cb, NULL, 0) == 0)
+ return _bin_path;
+#elif defined(HAVE_GETEXECNAME) /* Solaris */
+ const char *execn = getexecname();
+ /* copy, such that the caller can actually modify this string */
+ snprintf(_bin_path, sizeof(_bin_path), "%s", execn);
+ return _bin_path;
+#else /* try Linux approach */
+ if (readlink("/proc/self/exe",
+ _bin_path, sizeof(_bin_path)) != -1)
+ return _bin_path;
+#endif
+ /* could use argv[0] (passed) to deduce location based on PATH */
+ return NULL;
+}
diff --git a/common/utils/mutils.h b/common/utils/mutils.h
--- a/common/utils/mutils.h
+++ b/common/utils/mutils.h
@@ -73,5 +73,6 @@
mutils_export int MT_lockf(char *filename, int mode, off_t off, off_t len);
mutils_export void print_trace(void);
+mutils_export char *get_bin_path(void);
#endif /* _MUTILS_H_ */
diff --git a/configure.ag b/configure.ag
--- a/configure.ag
+++ b/configure.ag
@@ -865,33 +865,119 @@
AC_MSG_RESULT([$noexpand])
fi
-dnl --enable-debug
AC_ARG_ENABLE(debug,
AS_HELP_STRING([--enable-debug],
[enable full debugging (default=yes for development sources)]),
enable_debug=$enableval,
- enable_debug=$dft_debug)
+ enable_debug=def_$dft_debug)
+
+AC_ARG_ENABLE(assert,
+ AS_HELP_STRING([--enable-assert],
+ [enable assertions in the code (default=yes for development
sources)]),
+ enable_assert=$enableval,
+ enable_assert=def_$dft_assert)
+
+AC_ARG_ENABLE(optimize,
+ AS_HELP_STRING([--enable-optimize],
+ [enable extra optimization (default=no)]),
+ enable_optim=$enableval,
+ enable_optim=def_$dft_optimi)
+
+AC_ARG_ENABLE(warning,
+ AS_HELP_STRING([--enable-warning],
+ [enable extended compiler warnings (default=$dft_warning)]),
+ enable_warning=$enableval,
+ enable_warning=def_$dft_warning)
+
+need_profiling=no
+AC_ARG_ENABLE(profile,
+ AS_HELP_STRING([--enable-profile], [enable profiling (default=no)]),
+ enable_prof=$enableval,
+ enable_prof=no)
+
+need_instrument=no
+AC_ARG_ENABLE(instrument,
+ AS_HELP_STRING([--enable-instrument],
+ [enable instrument (default=no)]),
+ enable_instrument=$enableval,
+ enable_instrument=no)
+
+dnl check whether no (explictly chosen) mutual exclusive combinations
+dnl were made, compatability matrix:
+dnl deb ass opt war pro ins
+dnl debug \ C X C C C
+dnl assert C \ C C C C
+dnl optimize X C \ C X X
+dnl warnings C C C \ C C
+dnl profile C C X C \ C
+dnl instrument C C X C C \
+
+case "x$enable_debug.$enable_optim.$enable_prof.$enable_instrument" in
+ # find conflicts
+ xyes.yes.*.*)
+ AC_MSG_ERROR([combining --enable-optimize and --enable-debug is
not possible])
+ ;;
+ x*.yes.yes.*)
+ AC_MSG_ERROR([combining --enable-optimize and --enable-profile
is not possible])
+ ;;
+ x*.yes.*.yes)
+ AC_MSG_ERROR([combining --enable-optimize and
--enable-instrument is not possible])
+ ;;
+ # handle defaults after user requests
+ xyes.*.*.*)
+ enable_debug=yes
+ enable_optim=no
+ enable_prof="`echo $enable_prof | sed 's:^def_::'`"
+ enable_instrument="`echo $enable_instrument | sed 's:^def_::'`"
+ ;;
+ x*.*.yes.*)
+ enable_debug="`echo $enable_debug | sed 's:^def_::'`"
+ enable_optim=no
+ enable_prof=yes
+ enable_instrument="`echo $enable_instrument | sed 's:^def_::'`"
+ ;;
+ x*.*.*.yes)
+ enable_debug="`echo $enable_debug | sed 's:^def_::'`"
+ enable_optim=no
+ enable_prof="`echo $enable_prof | sed 's:^def_::'`"
+ enable_instrument=yes
+ ;;
+ x*.*no.*.*)
+ enable_debug="`echo $enable_debug | sed 's:^def_::'`"
+ enable_optim=no
+ enable_prof="`echo $enable_prof | sed 's:^def_::'`"
+ enable_instrument="`echo $enable_instrument | sed 's:^def_::'`"
+ ;;
+ x*.*yes.*.*) # enable-optimize overrules other defaults
+ enable_optim=yes
+ enable_debug=no
+ enable_prof=no
+ enable_instrument=no
+ ;;
+ x*)
+ AC_MSG_WARN([unhandled configuration
$enable_debug.$enable_optim.$enable_prof.$enable_instrument, please file a bug
on bugs.monetdb.org])
+ ;;
+esac
+# make defaults real for flags which don't conflict with anything
+enable_assert="`echo $enable_assert | sed 's:^def_::'`"
+enable_warning="`echo $enable_warning | sed 's:^def_::'`"
AC_MSG_CHECKING([for --enable-debug])
-origCFLAGS=$CFLAGS
if test "x$enable_debug" = xyes; then
- if test "x$enable_optim" = xyes; then
- AC_MSG_ERROR([combining --enable-optimize and --enable-debug is
not possible.])
- else
- dnl remove "-Ox" as some compilers don't like "-g -Ox"
combinations
- CFLAGS=" $CFLAGS "
- CFLAGS="`echo "$CFLAGS" | sed -e 's| -O[[0-9]] | |g' -e 's| -g
| |g' -e 's|^ ||' -e 's| $||'`"
- JAVACFLAGS=" $JAVACFLAGS "
- JAVACFLAGS="`echo "$JAVACFLAGS" | sed -e 's| -O | |g' -e 's| -g
| |g' -e 's| -g:[[a-z]]* | |g' -e 's|^ ||' -e 's| $||'`"
- dnl add "-g"
- CFLAGS="$CFLAGS -g"
- JAVACFLAGS="$JAVACFLAGS -g"
- case "$GCC-$host_os" in
- yes-aix*)
- CFLAGS="$CFLAGS -gxcoff"
- ;;
- esac
- fi
+ origCFLAGS=$CFLAGS
+ dnl remove "-Ox" as some compilers don't like "-g -Ox" combinations
+ CFLAGS=" $CFLAGS "
+ CFLAGS="`echo "$CFLAGS" | sed -e 's| -O[[0-9]] | |g' -e 's| -g | |g' -e
's|^ ||' -e 's| $||'`"
+ JAVACFLAGS=" $JAVACFLAGS "
+ JAVACFLAGS="`echo "$JAVACFLAGS" | sed -e 's| -O | |g' -e 's| -g | |g'
-e 's| -g:[[a-z]]* | |g' -e 's|^ ||' -e 's| $||'`"
+ dnl add "-g"
+ CFLAGS="$CFLAGS -g"
+ JAVACFLAGS="$JAVACFLAGS -g"
+ case "$GCC-$host_os" in
+ yes-aix*)
+ CFLAGS="$CFLAGS -gxcoff"
+ ;;
+ esac
changedCFLAGS=
for flag in $origCFLAGS ; do
@@ -912,13 +998,6 @@
AC_MSG_RESULT([no])
fi
-dnl --enable-assert
-AC_ARG_ENABLE(assert,
- AS_HELP_STRING([--enable-assert],
- [enable assertions in the code (default=yes for development
sources)]),
- enable_assert=$enableval,
- enable_assert=$dft_assert)
-
AC_MSG_CHECKING([for --enable-assert])
if test "x$enable_assert" = xno; then
AC_DEFINE(NDEBUG, 1, [Define if you do not want assertions])
@@ -927,31 +1006,19 @@
AC_MSG_RESULT([yes])
fi
-dnl --enable-optimize
-AC_ARG_ENABLE(optimize,
- AS_HELP_STRING([--enable-optimize],
- [enable extra optimization (default=no)]),
- enable_optim=$enableval, enable_optim=$dft_optimi)
AC_MSG_CHECKING([for --enable-optimize])
if test "x$enable_optim" = xyes; then
- if test "x$enable_debug" = xyes; then
- AC_MSG_ERROR([combining --enable-optimize and --enable-debug is not
possible.])
_______________________________________________
Checkin-list mailing list
[email protected]
http://mail.monetdb.org/mailman/listinfo/checkin-list