Permalink
Browse files

Merge pull request #21 from hsn10/master

Fix compile problems on windows with mingw
  • Loading branch information...
2 parents e67e1a9 + b662e5b commit cdba7b3618fd74b62e2c475f8e23f53684cb94eb @chirino chirino committed Feb 7, 2013
View
@@ -173,8 +173,20 @@
</archive>
</configuration>
</plugin>
-
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-source-plugin</artifactId>
+ <version>2.2.1</version>
+ <executions>
+ <execution>
+ <id>attach-sources</id>
+ <phase>package</phase>
+ <goals>
+ <goal>jar-no-fork</goal>
+ </goals>
+ </execution>
+ </executions>
+ </plugin>
</plugins>
</build>
-
</project>
@@ -91,8 +91,8 @@ static final native int link(
@JniMethod(conditional="defined(_WIN32) || defined(_WIN64)")
static final native int CreateHardLinkW(
- @JniArg(cast="LPCTSTR", flags={POINTER_ARG, UNICODE}) String target,
- @JniArg(cast="LPCTSTR", flags={POINTER_ARG, UNICODE}) String source,
+ @JniArg(cast="LPCWSTR", flags={POINTER_ARG, UNICODE}) String target,
+ @JniArg(cast="LPCWSTR", flags={POINTER_ARG, UNICODE}) String source,
@JniArg(cast="LPSECURITY_ATTRIBUTES", flags={POINTER_ARG}) long lpSecurityAttributes);
@JniMethod(flags={CONSTANT_GETTER})
@@ -0,0 +1,23 @@
+CC = gcc
+CXX = g++
+
+JDK = /c/java/jdk7
+PLATFORM = win32
+
+CPPFLAGS = -I/usr/local/include -I$(JDK)/include -I$(JDK)/include/$(PLATFORM)
+LDFLAGS = -L/usr/local/lib
+
+OBJS = src/leveldbjni.o src/leveldbjni_stats.o src/leveldbjni_structs.o \
+ src/buffer.o src/hawtjni.o
+
+.cc.o:
+ $(CXX) $(CPPFLAGS) -c $< -o $@
+
+.c.o:
+ $(CC) $(CPPFLAGS) -c $< -o $@
+
+leveldbjni.dll: $(OBJS)
+ $(CC) -shared -o $@ -Wl,"--strip-all" -Wl,"--export-all-symbols" $(OBJS) -lleveldb $(LDFLAGS) -lstdc++
+
+clean:
+ rm -f $(OBJS) *.dll
@@ -35,13 +35,15 @@
#ifdef HAVE_CONFIG_H
/* configure based build.. we will use what it discovered about the platform */
#include "config.h"
-#else
- #if defined(_WIN32) || defined(_WIN64)
+#endif
+#if defined(_WIN32) || defined(_WIN64)
/* Windows based build */
+ #define _WIN32_WINNT 0x0501
+ #include <windows.h>
+#endif
+#if !defined(HAVE_CONFIG_H) && (defined(_WIN32) || defined(_WIN64))
#define HAVE_STDLIB_H 1
#define HAVE_STRINGS_H 1
- #include <windows.h>
- #endif
#endif
#ifdef HAVE_UNISTD_H

0 comments on commit cdba7b3

Please sign in to comment.