Description: replace calls to OSInfo.class by calls to dpkg-architecture.
 The ‘lib’ directory is removed from this package, see ‘debian/README.source’.
Author: Charles Plessy <plessy@debian.org>
Forwarded: not-needed
diff --git a/Makefile.common b/Makefile.common
index f4a3fdd..991c5e0 100644
--- a/Makefile.common
+++ b/Makefile.common
@@ -11,17 +11,9 @@ JAVA  := "$$JAVA_HOME/bin/java"
 JAVAC := "$$JAVA_HOME/bin/javac" 
 JAVAH := "$$JAVA_HOME/bin/javah"
 
-OSINFO_CLASS := org.xerial.snappy.OSInfo
-OSINFO_PROG := lib/org/xerial/snappy/OSInfo.class
-
-## building OSInfo.java 
-#$(info compiling OSInfo.java)
-#$(shell mkdir -p lib)
-#$(shell $(JAVAC) src/main/java/org/sqlite/OSInfo.java -d lib)
-
-OS_NAME := $(shell $(JAVA) -cp lib $(OSINFO_CLASS) --os)
-OS_ARCH := $(shell $(JAVA) -cp lib $(OSINFO_CLASS) --arch)
-LIB_FOLDER := $(shell $(JAVA) -cp lib $(OSINFO_CLASS))
+OS_NAME := $(shell dpkg-architecture -qDEB_BUILD_ARCH_OS)
+OS_ARCH := $(shell dpkg-architecture -qDEB_BUILD_ARCH)
+LIB_FOLDER := $(OS_NAME)/$(OS_ARCH)
 
 # Windows uses different path separators
 ifeq ($(OS_NAME),Windows)
@@ -41,7 +33,7 @@ endif
 
 # os=Default is meant to be generic unix/linux
 
-known_os_archs := Linux-i386 Linux-amd64 Mac-i386 Mac-x86_64 Windows-x86 Windows-amd64
+known_os_archs := linux-i386 linux-amd64 Mac-i386 Mac-x86_64 Windows-x86 Windows-amd64
 os_arch := $(OS_NAME)-$(OS_ARCH)
 
 ifeq (,$(findstring $(strip $(os_arch)),$(known_os_archs)))
