Skip to content

Commit

Permalink
Merge pull request #675 from matthiasblaesing/static_build_windows
Browse files Browse the repository at this point in the history
Staticly link the windows jnidispatch.dll when build with MSVC compiler
  • Loading branch information
twall authored Jul 5, 2016
2 parents 6a288ba + 058f12a commit adb916e
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 4 deletions.
1 change: 1 addition & 0 deletions CHANGES.md
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,7 @@ Bug Fixes
* [#633](https://github.com/java-native-access/jna/pull/633): Restore default usage of platform native encoding for Java strings passed to native functions (was hard-coded to UTF-8 in 4.0 and later) [@amake](https://github.com/amake)
* [#634](https://github.com/java-native-access/jna/pull/634): Improve BSTR handling and add `SysStringByteLen` and `SysStringLen` to `com.sun.jna.platform.win32.OleAuto` - [@matthiasblaesing](https://github.com/matthiasblaesing).
* [#646](https://github.com/java-native-access/jna/issues/646): `platform.win32.COM.COMBindingBaseObject` swallows reason if instantiation fails - [@matthiasblaesing](https://github.com/matthiasblaesing).
* [#636](https://github.com/java-native-access/jna/issues/636); Staticly link visual c++ runtime when building with MSVC - [@matthiasblaesing](https://github.com/matthiasblaesing).

Release 4.2.1
=============
Expand Down
Binary file modified lib/native/win32-x86-64.jar
Binary file not shown.
Binary file modified lib/native/win32-x86.jar
Binary file not shown.
13 changes: 9 additions & 4 deletions native/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -207,19 +207,24 @@ STRIP=@echo
LIBPFX=
LIBSFX=.dll
TESTLIB_TRUNC=$(BUILD)/testlib-truncated.dll

ifeq ($(ARCH),amd64)
MINGW_PREFIX?=x86_64-w64-mingw32-
FFI_CONFIG+=--host=x86_64-w64-mingw32
# Need windres from mingw distribution, even if building with MSVC
WINDRES=$(MINGW_PREFIX)windres
MINGW=$(MINGW_PREFIX)gcc
else
MINGW_PREFIX?=i686-pc-mingw32-
FFI_CONFIG+=--host=i686-w64-mingw32
MINGW_PREFIX?=i686-w64-mingw32-
endif
# Need windres from mingw distribution, even if building with MSVC
WINDRES=$(MINGW_PREFIX)windres
MINGW=$(MINGW_PREFIX)gcc

ifeq ($(USE_MSVC),true)
# MS compiler
CC=$(FFI_SRC)/msvcc.sh
ifneq ($(DYNAMIC_LIBFFI),true)
CDEFINES+=-DUSE_STATIC_RTL
endif
COPT=
CPP=cl -nologo -EP
LD=link
Expand Down

0 comments on commit adb916e

Please sign in to comment.