mirror of
https://github.com/corda/corda.git
synced 2025-01-17 02:09:50 +00:00
fix windows cross openjdk-src build
This mainly involves some makefile ugliness to work around bugs in the native Windows OpenJDK code involving conflicting static and not-static declarations which GCC 4.0 and later justifiably reject but MSVC tolerates.
This commit is contained in:
parent
af8e043989
commit
4a3b5ad1ab
31
makefile
31
makefile
@ -268,18 +268,18 @@ ifeq ($(platform),windows)
|
||||
|
||||
ifeq (,$(filter mingw32 cygwin,$(build-platform)))
|
||||
openjdk-extra-cflags += -I$(src)/openjdk/caseSensitive
|
||||
cxx = x86_64-w64-mingw32-g++ -m32
|
||||
cc = x86_64-w64-mingw32-gcc -m32
|
||||
dlltool = x86_64-w64-mingw32-dlltool -mi386 --as-flags=--32
|
||||
ar = x86_64-w64-mingw32-ar
|
||||
ranlib = x86_64-w64-mingw32-ranlib
|
||||
strip = x86_64-w64-mingw32-strip --strip-all
|
||||
# cxx = i586-mingw32msvc-g++
|
||||
# cc = i586-mingw32msvc-gcc
|
||||
# dlltool = i586-mingw32msvc-dlltool
|
||||
# ar = i586-mingw32msvc-ar
|
||||
# ranlib = i586-mingw32msvc-ranlib
|
||||
# strip = i586-mingw32msvc-strip
|
||||
# cxx = x86_64-w64-mingw32-g++ -m32
|
||||
# cc = x86_64-w64-mingw32-gcc -m32
|
||||
# dlltool = x86_64-w64-mingw32-dlltool -mi386 --as-flags=--32
|
||||
# ar = x86_64-w64-mingw32-ar
|
||||
# ranlib = x86_64-w64-mingw32-ranlib
|
||||
# strip = x86_64-w64-mingw32-strip --strip-all
|
||||
cxx = i586-mingw32msvc-g++
|
||||
cc = i586-mingw32msvc-gcc
|
||||
dlltool = i586-mingw32msvc-dlltool
|
||||
ar = i586-mingw32msvc-ar
|
||||
ranlib = i586-mingw32msvc-ranlib
|
||||
strip = i586-mingw32msvc-strip --strip-all
|
||||
else
|
||||
build-system = windows
|
||||
common-cflags += "-I$(JAVA_HOME)/include/win32"
|
||||
@ -824,8 +824,10 @@ $(openjdk-objects): $(build)/openjdk/%.o: $(openjdk-src)/%.c \
|
||||
$(openjdk-headers-dep)
|
||||
@echo "compiling $(@)"
|
||||
@mkdir -p $(dir $(@))
|
||||
sed 's/^static jclass ia_class;//' < $(<) > $(build)/openjdk/$(notdir $(<))
|
||||
$(cc) -fPIC $(openjdk-extra-cflags) $(openjdk-cflags) \
|
||||
$(optimization-cflags) -w -c $(<) $(call output,$(@))
|
||||
$(optimization-cflags) -w -c $(build)/openjdk/$(notdir $(<)) \
|
||||
$(call output,$(@))
|
||||
|
||||
$(openjdk-local-objects): $(build)/openjdk/%.o: $(src)/openjdk/%.c \
|
||||
$(openjdk-headers-dep)
|
||||
@ -843,6 +845,9 @@ ifeq ($(platform),windows)
|
||||
sed 's/^#ifdef _WIN64/#if 1/' \
|
||||
< "$(openjdk-src)/windows/native/java/net/net_util_md.h" \
|
||||
> $(build)/openjdk/net_util_md.h
|
||||
cp "$(openjdk-src)/windows/native/java/net/NetworkInterface.h" \
|
||||
$(build)/openjdk/NetworkInterface.h
|
||||
echo 'static int getAddrsFromAdapter(IP_ADAPTER_ADDRESSES *ptr, netaddr **netaddrPP);' >> $(build)/openjdk/NetworkInterface.h
|
||||
endif
|
||||
@touch $(@)
|
||||
|
||||
|
@ -221,6 +221,7 @@ ifeq ($(platform),windows)
|
||||
"-I$(openjdk-src)/windows/native/java/io" \
|
||||
"-I$(openjdk-src)/windows/native/java/net" \
|
||||
"-I$(openjdk-src)/windows/native/java/util" \
|
||||
"-I$(openjdk-src)/windows/native/sun/nio/ch" \
|
||||
"-I$(openjdk-src)/windows/javavm/include" \
|
||||
"-I$(root)/win32/include" \
|
||||
-D_JNI_IMPLEMENTATION_ \
|
||||
|
@ -54,6 +54,8 @@
|
||||
|
||||
typedef int socklen_t;
|
||||
|
||||
# define RTLD_DEFAULT 0
|
||||
|
||||
#else // not PLATFORM_WINDOWS
|
||||
|
||||
# include <unistd.h>
|
||||
|
1
src/openjdk/caseSensitive/WS2tcpip.h
Normal file
1
src/openjdk/caseSensitive/WS2tcpip.h
Normal file
@ -0,0 +1 @@
|
||||
#include "ws2tcpip.h"
|
Loading…
Reference in New Issue
Block a user