pud: detect the java include directory
authorFerry Huberts <ferry.huberts@pelagic.nl>
Thu, 14 Feb 2013 17:13:22 +0000 (18:13 +0100)
committerFerry Huberts <ferry.huberts@pelagic.nl>
Thu, 14 Feb 2013 17:14:15 +0000 (18:14 +0100)
Fedora and Debian have this in different locations

Signed-off-by: Ferry Huberts <ferry.huberts@pelagic.nl>
lib/pud/wireformat-java/Makefile

index 74b2593..d960411 100644 (file)
@@ -55,7 +55,20 @@ LIBDIR_BUILD = lib
 INC_DIR_WIREFORMAT = ../wireformat/include
 INC_DIR_WIREFORMAT_FULL = $(INC_DIR_WIREFORMAT)/$(WIREFORMAT_PROJECT)
 
-INC_DIR_JVM = /usr/lib/jvm/java/include
+ifneq ($(wildcard /usr/lib/jvm/java),)
+  INC_DIR_JVM = /usr/lib/jvm/java/include
+else
+ifneq ($(wildcard /usr/lib/jvm/java-1.7.0-openjdk$(ARCH)),)
+  INC_DIR_JVM = /usr/lib/jvm/java-1.7.0-openjdk$(ARCH)/include
+else
+ifneq ($(wildcard /usr/lib/jvm/java-1.6.0-openjdk$(ARCH)),)
+  INC_DIR_JVM = /usr/lib/jvm/java-1.6.0-openjdk$(ARCH)/include
+else
+  $(error No java detected)
+endif
+endif
+endif
+
 INC_DIR_JVM_OS = $(INC_DIR_JVM)/$(OS)