Skip to content
Permalink
Browse files

Update windows build script. (#56)

Libwinpthread is now compiled statically.
  • Loading branch information...
scudette committed Jan 10, 2018
1 parent 077964a commit db5394ec5c4470dec05db419c569724473c5f917
Showing with 6 additions and 4 deletions.
  1. +1 −1 README.linux
  2. +4 −2 src/Makefile.am
  3. +1 −1 src/rdf.cc
@@ -44,7 +44,7 @@ cd ..

apt-get source libraptor2-dev
cd raptor2-2.0.13/
./configure --prefix=$PREFIX --enable-static --without-www LDFLAGS="-L/home/scudette/build/static/lib -static -static-libstdc++" --enable-serializers="turtle ntriples" --enable-parsers="turtle ntriples"
./configure --prefix=$PREFIX --enable-static --without-www LDFLAGS="-L$PREFIX/lib -static -static-libstdc++" --enable-serializers="turtle ntriples" --enable-parsers="turtle ntriples"
make -j4 install
cd ..

@@ -12,6 +12,8 @@ AM_CPPFLAGS = -I$(top_srcdir)/src
# (https://gcc.gnu.org/bugzilla/show_bug.cgi?id=52991)
if WINDOWS
WINCXXFLAGS = -mno-ms-bitfields
# On windows we want to compile libpthread statically.
PTHREAD_FLAGS = -Wl,-Bstatic,--whole-archive,-lpthread -Wl,--no-whole-archive
else
UNIXLDFLAGS = ${UUID_CFLAGS}
endif
@@ -22,8 +24,8 @@ AM_CXXFLAGS = $(WINCXXFLAGS)

# Support static builds.
if STATIC_BUILD
STATIC_LIBLDFLAGS = -static -static-libstdc++ -static-libgcc
STATIC_LINKERLDFLAGS = -static -static-libstdc++ -static-libgcc
STATIC_LIBLDFLAGS = -static -static-libstdc++ -static-libgcc ${PTHREAD_FLAGS}
STATIC_LINKERLDFLAGS = -static -static-libstdc++ -static-libgcc ${PTHREAD_FLAGS}
endif

# The -no-undefined flag allows libtool to generate shared libraries for
@@ -275,7 +275,7 @@ static std::string abspath(std::string path) {
// The windows version of this function is somewhat simpler.
DWORD buffer_len = GetFullPathName(path.c_str(), 0, NULL, NULL);
if (buffer_len > 0) {
auto buffer = std::unique_ptr<char>(new char[buffer_len]);
auto buffer = std::unique_ptr<TCHAR>(new TCHAR[buffer_len]);
GetFullPathName(path.c_str(), buffer_len, buffer.get(), NULL);
return std::string(buffer.get());
}

0 comments on commit db5394e

Please sign in to comment.
You can’t perform that action at this time.