[Rprotobuf-commits] r738 - / pkg/src windows
noreply at r-forge.r-project.org
noreply at r-forge.r-project.org
Fri Jan 10 21:16:15 CET 2014
Author: jeroenooms
Date: 2014-01-10 21:16:15 +0100 (Fri, 10 Jan 2014)
New Revision: 738
Added:
pkg/src/Makevars.win
windows/
windows/cross-compile.sh
windows/lib/
Log:
adding some windows stuff
Added: pkg/src/Makevars.win
===================================================================
--- pkg/src/Makevars.win (rev 0)
+++ pkg/src/Makevars.win 2014-01-10 20:16:15 UTC (rev 738)
@@ -0,0 +1,7 @@
+# -*- mode: Makefile -*-
+##
+## The folders C:/protobuf-2.5.0/lib/{i386,x64}/ contain static libraries for windows.
+RCPP_LDFLAGS = $(shell "${R_HOME}/bin${R_ARCH_BIN}/Rscript.exe" -e "Rcpp:::LdFlags()")
+PROTOBUFROOT= "C:/protobuf-2.5.0"
+PKG_CPPFLAGS= -I$(PROTOBUFROOT)/src
+PKG_LIBS=$(RCPP_LDFLAGS) -L$(PROTOBUFROOT)/lib${R_ARCH} -lprotobuf
Added: windows/cross-compile.sh
===================================================================
--- windows/cross-compile.sh (rev 0)
+++ windows/cross-compile.sh 2014-01-10 20:16:15 UTC (rev 738)
@@ -0,0 +1,26 @@
+# Script to create static libraries for windows using on mingw-w64 v3.0
+# cross compiler on Ubuntu 14.04 (older versions of mingw-w64 didn't work)
+
+# install cross compilers
+sudo apt-get install make gcc-mingw-w64-x86-64 gcc-mingw-w64-i686 mingw-w64
+
+# create output dirs
+mkdir -p lib/{i386,x64}
+
+# get libprotobuf
+wget https://protobuf.googlecode.com/files/protobuf-2.5.0.tar.gz
+tar xzvf protobuf-2.5.0.tar.gz
+cd protobuf-2.5.0
+
+# Build for win32
+./configure --host=i686-w64-mingw32 --disable-shared
+make
+cp src/.libs/libprotobuf.a ../lib/i386/
+make clean
+
+# Build for win64
+./configure --host=x86_64-w64-mingw32 --disable-shared
+make
+cp src/.libs/libprotobuf.a ../lib/x64/
+make clean
+
More information about the Rprotobuf-commits
mailing list