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, 28 Feb 2013 11:12:32 +0000 (12:12 +0100)
Fedora and Debian have this in different locations

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

index 7069efb..87ae843 100644 (file)
@@ -43,7 +43,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)