add a LIBSUBDIR setting to control /usr/lib path

Don't hardcode /usr/lib all the time as that is wrong on many systems
(like x86_64).  Add a variable the ebuild can set to the right place.

BUG=chromium:874977
TEST=building for stout installs libs into /usr/lib64 now

Change-Id: Icb058498a354a1914be640638a9983aa53bcfe67
Reviewed-on: https://chromium-review.googlesource.com/c/1391968
Reviewed-by: Mike Frysinger <vapier@chromium.org>
Tested-by: Mike Frysinger <vapier@chromium.org>
diff --git a/GobiConnectionMgmt/Makefile b/GobiConnectionMgmt/Makefile
index 4d4ce15..1eb0a2e 100644
--- a/GobiConnectionMgmt/Makefile
+++ b/GobiConnectionMgmt/Makefile
@@ -52,8 +52,8 @@
       all
 
 install: $(OUTPUT) GobiConnectionMgmtAPI.h
-	install -d $(PREFIX)/usr/lib
-	install -t $(PREFIX)/usr/lib $(OUTPUT)
+	install -d $(PREFIX)/usr/$(LIBSUBDIR)
+	install -t $(PREFIX)/usr/$(LIBSUBDIR) $(OUTPUT)
 	install -d $(PREFIX)/usr/include/gobi
 	install -t $(PREFIX)/usr/include/gobi $(filter %.h,$^)
 
diff --git a/GobiImageMgmt/Makefile b/GobiImageMgmt/Makefile
index e1c6237..89ba69c 100644
--- a/GobiImageMgmt/Makefile
+++ b/GobiImageMgmt/Makefile
@@ -31,8 +31,8 @@
       all
 
 install: $(OUTPUT) GobiImageMgmtAPI.h
-	install -d $(PREFIX)/usr/lib
-	install -t $(PREFIX)/usr/lib $(OUTPUT)
+	install -d $(PREFIX)/usr/$(LIBSUBDIR)
+	install -t $(PREFIX)/usr/$(LIBSUBDIR) $(OUTPUT)
 	install -d $(PREFIX)/usr/include/gobi
 	install -t $(PREFIX)/usr/include/gobi $(filter %.h,$^)
 
diff --git a/Makefile b/Makefile
index 0f8b49a..aa09fc7 100644
--- a/Makefile
+++ b/Makefile
@@ -4,6 +4,7 @@
 
 ROOT := $(DESTDIR)/opt/Qualcomm
 PREFIX := $(DESTDIR)
+LIBSUBDIR ?= lib
 CXXFLAGS += -fPIC -Werror
 # TODO(benchan): Gobi code has lots of other warnings, which should be cleaned
 # up eventually.