Changeset: bb4060950b3b for MonetDB
URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=bb4060950b3b
Modified Files:
        gdk/gdk_posix.c
        tools/embedded/embeddedr.c
        tools/embedded/rpackage/configure.win
        tools/embedded/windows/monetdb_config.h.in
        tools/embedded/windows/sedscript.tpl
Branch: embedded
Log Message:

32-Bit Windows


diffs (100 lines):

diff --git a/gdk/gdk_posix.c b/gdk/gdk_posix.c
--- a/gdk/gdk_posix.c
+++ b/gdk/gdk_posix.c
@@ -711,10 +711,11 @@ MT_init_posix(void)
 size_t
 MT_getrss(void)
 {
+#ifdef _WIN64
        PROCESS_MEMORY_COUNTERS ctr;
-
        if (GetProcessMemoryInfo(GetCurrentProcess(), &ctr, sizeof(ctr)))
                return ctr.WorkingSetSize;
+#endif
        return 0;
 }
 
diff --git a/tools/embedded/embeddedr.c b/tools/embedded/embeddedr.c
--- a/tools/embedded/embeddedr.c
+++ b/tools/embedded/embeddedr.c
@@ -67,6 +67,9 @@ SEXP monetdb_startup_R(SEXP dbdirsexp, S
                return ScalarLogical(0);
        }
 
+#if defined(WIN32) && !defined(_WIN64)
+       warning("MonetDBLite running in a 32-Bit Windows. This is not 
recommended.");
+#endif
        res = monetdb_startup((char*) CHAR(STRING_ELT(dbdirsexp, 0)),
                LOGICAL(silentsexp)[0], LOGICAL(sequentialsexp)[0]);
 
diff --git a/tools/embedded/rpackage/configure.win 
b/tools/embedded/rpackage/configure.win
--- a/tools/embedded/rpackage/configure.win
+++ b/tools/embedded/rpackage/configure.win
@@ -1,8 +1,16 @@
 # figure out where the sourcetree is
 SRC=`pwd | sed -e 's|/cygdrive/||' -e 's|/|:/|'`"/src"
 
+# figure out bitness
+if [ "$R_ARCH" = "/i386" ] 
+then
+       BITS=32
+else
+       BITS=64
+fi
+
 # patch sedscript for build/install/library paths
-sed  -e "s|%PREFIX%|${R_PACKAGE_DIR}/libs|" -e "s|%SRCDIR%|$SRC|" -e 
"s|%RINCLUDE%|${R_HOME}/include|" src/tools/embedded/windows/sedscript.tpl > 
src/tools/embedded/windows/sedscript
+sed -e "s|%BITS%|$BITS|" -e "s|%PREFIX%|${R_PACKAGE_DIR}/libs|" -e 
"s|%SRCDIR%|$SRC|" -e "s|%RINCLUDE%|${R_HOME}/include|" 
src/tools/embedded/windows/sedscript.tpl > src/tools/embedded/windows/sedscript
 
 # FIXME
 cp src/tools/embedded/windows/monetdb_config.h.in src/
@@ -11,19 +19,16 @@ cp src/tools/embedded/windows/monetdb_co
 sh src/tools/embedded/windows/pmc.sh
 
 # download/unpack some dependencies
-R --quiet -e 
"download.file('http://dev.monetdb.org/Assets/R/misc/msvcr100.dll', 
'src/tools/embedded/windows/msvcr100.dll', mode='wb')"
+R --quiet -e 
"download.file('http://dev.monetdb.org/Assets/R/misc/msvcr100-$BITS.dll', 
'src/tools/embedded/windows/msvcr100.dll', mode='wb')"
 R --quiet -e "setwd('src/tools/embedded/windows/'); tf <- tempfile(); 
download.file('http://dev.monetdb.org/Assets/R/misc/pcre-8.37.zip', tf, 
mode='wb'); unzip(tf)"
 
 cd src
 make -j
 OFILES=`find common clients/mapilib/ gdk monetdb5/mal monetdb5/modules 
monetdb5/optimizer sql tools/embedded -name "*.lo" | tr "\n" " "`
 
-rm libmonetdb5.dll
-gcc -shared -m64 -o libmonetdb5.dll $OFILES -lws2_32 -lpthread -lpsapi 
-Ltools/embedded/windows/pcre-8.37/libs/x64/ -lpcre `R CMD config --ldflags`
+gcc -shared -m$BITS -o libmonetdb5.dll $OFILES -lws2_32 -lpthread -lpsapi 
-Ltools/embedded/windows/pcre-8.37/libs/$R_ARCH/ -lpcre `R CMD config --ldflags`
 
 cd ../
-mkdir -p $R_PACKAGE_DIR/libs/x64
-cp src/tools/embedded/windows/pcre-8.37/libs/x64/pcre.dll 
$R_PACKAGE_DIR/libs/x64/
-cp src/tools/embedded/windows/msvcr100.dll $R_PACKAGE_DIR/libs/x64/
-
-# When configure.win is run the environment variables R_HOME (which uses 
‘/’ as the file separator), R_ARCH and Use R_ARCH_BIN will be set. Use 
R_ARCH to decide if this is a 64-bit build (its value there is ‘/x64’) and 
to install DLLs to the correct place (${R_HOME}/libs${R_ARCH}). Use R_ARCH_BIN 
to find the correct place under the bin directory, e.g. 
${R_HOME}/bin${R_ARCH_BIN}/Rscript.exe.
+mkdir -p $R_PACKAGE_DIR/libs/$R_ARCH/
+cp src/tools/embedded/windows/pcre-8.37/libs/$R_ARCH/pcre.dll 
$R_PACKAGE_DIR/libs/$R_ARCH/
+cp src/tools/embedded/windows/msvcr100.dll $R_PACKAGE_DIR/libs/$R_ARCH/
diff --git a/tools/embedded/windows/monetdb_config.h.in 
b/tools/embedded/windows/monetdb_config.h.in
--- a/tools/embedded/windows/monetdb_config.h.in
+++ b/tools/embedded/windows/monetdb_config.h.in
@@ -306,9 +306,6 @@
 
 /* Define to 1 if you have the `llabs' function. */
 #define HAVE_LLABS 1
-#if _MSC_VER <= 1500
-#define llabs _abs64
-#endif
 
 /* Define to 1 if you have the <locale.h> header file. */
 #define HAVE_LOCALE_H 1
diff --git a/tools/embedded/windows/sedscript.tpl 
b/tools/embedded/windows/sedscript.tpl
--- a/tools/embedded/windows/sedscript.tpl
+++ b/tools/embedded/windows/sedscript.tpl
@@ -43,7 +43,7 @@ s|@CC@|gcc|
 s|@CCDEPMODE@||
 s|@cfitsio_CFLAGS@||
 s|@cfitsio_LIBS@||
-s|@CFLAGS@|-m64 -O3 -I"%RINCLUDE%"|
+s|@CFLAGS@|-m%BITS% -O3 -I"%RINCLUDE%"|
 s|@CLASSPATH@||
 s|@compilercall@||
 s|@configure_input@||
_______________________________________________
checkin-list mailing list
[email protected]
https://www.monetdb.org/mailman/listinfo/checkin-list

Reply via email to