From b74bb40780e060e4312b73f08dc0bca5f187bb54 Mon Sep 17 00:00:00 2001 From: Leah X Schmidt Date: Fri, 21 Dec 2012 12:13:04 -0500 Subject: [PATCH] Make miniupnpc jar file build on win32 --- miniupnpc/.gitignore | 1 + miniupnpc/Makefile | 8 ++++++++ miniupnpc/java/testjava.bat | 8 ++++++++ 3 files changed, 17 insertions(+) create mode 100755 miniupnpc/java/testjava.bat diff --git a/miniupnpc/.gitignore b/miniupnpc/.gitignore index 0a88a2d..c0ad56c 100644 --- a/miniupnpc/.gitignore +++ b/miniupnpc/.gitignore @@ -3,6 +3,7 @@ build/ *.o *.a *.so +*.dll *.dylib Makefile.bak miniupnpcstrings.h diff --git a/miniupnpc/Makefile b/miniupnpc/Makefile index f3178bf..d50f7f8 100644 --- a/miniupnpc/Makefile +++ b/miniupnpc/Makefile @@ -19,6 +19,9 @@ endif ifeq ($(OS), Linux) JARSUFFIX=linux endif +ifneq (,$(findstring NT-5.1,$(OS))) +JARSUFFIX=win32 +endif HAVE_IPV6 ?= yes export HAVE_IPV6 @@ -77,9 +80,14 @@ ifeq ($(OS), Darwin) SONAME = $(basename $(SHAREDLIBRARY)).$(APIVERSION).dylib CFLAGS := -DMACOSX -D_DARWIN_C_SOURCE $(CFLAGS) else +ifeq ($(OS), Linux) SHAREDLIBRARY = libminiupnpc.so SONAME = $(SHAREDLIBRARY).$(APIVERSION) endif +ifeq ($(JARSUFFIX), win32) + SHAREDLIBRARY = miniupnpc.dll +endif +endif EXECUTABLES = upnpc-static EXECUTABLES_ADDTESTS = testminixml minixmlvalid testupnpreplyparse \ diff --git a/miniupnpc/java/testjava.bat b/miniupnpc/java/testjava.bat new file mode 100755 index 0000000..b836da1 --- /dev/null +++ b/miniupnpc/java/testjava.bat @@ -0,0 +1,8 @@ +@echo off +set JAVA=java +set JAVAC=javac +REM notice the semicolon for Windows. Write once, run ... oh nevermind +set CP=miniupnpc_win32.jar;. + +%JAVAC% -cp "%CP%" JavaBridgeTest.java || exit 1 +%JAVA% -cp "%CP%" JavaBridgeTest 12345 UDP || exit 1