From 50ee70f49275f38837bcc474ea10b021d25177c3 Mon Sep 17 00:00:00 2001 From: James Duley Date: Sun, 26 Jul 2015 21:30:41 +0100 Subject: [PATCH] LP-61 addtional make config options: added libbasename & GCS_LIBRARY_BASENAME Change-Id: Ied2f50b3f87d40ef7fb0bbad0fff4cd0fd9bb8a9 --- Makefile | 1 + ground/openpilotgcs/openpilotgcs.pri | 4 +++- package/Linux.mk | 8 +++++--- package/linux/librepilot.spec | 8 ++------ 4 files changed, 11 insertions(+), 10 deletions(-) diff --git a/Makefile b/Makefile index dd944fcd6..128d1e47c 100644 --- a/Makefile +++ b/Makefile @@ -477,6 +477,7 @@ openpilotgcs_qmake $(OPENPILOTGCS_MAKEFILE): | $(OPENPILOTGCS_DIR) -spec $(QT_SPEC) -r CONFIG+=$(GCS_BUILD_CONF) CONFIG+=$(GCS_SILENT) \ 'GCS_BIG_NAME="$(GCS_BIG_NAME)"' GCS_SMALL_NAME=$(GCS_SMALL_NAME) \ 'ORG_BIG_NAME="$(ORG_BIG_NAME)"' ORG_SMALL_NAME=$(ORG_SMALL_NAME) \ + 'GCS_LIBRARY_BASENAME=$(libbasename)' \ $(GCS_QMAKE_OPTS) .PHONY: openpilotgcs diff --git a/ground/openpilotgcs/openpilotgcs.pri b/ground/openpilotgcs/openpilotgcs.pri index 0e4f71141..bbe138e0f 100644 --- a/ground/openpilotgcs/openpilotgcs.pri +++ b/ground/openpilotgcs/openpilotgcs.pri @@ -140,6 +140,8 @@ isEmpty(ORG_BIG_NAME) { ORG_BIG_NAME = "$$ORG_BIG_NAME" } +isEmpty(GCS_LIBRARY_BASENAME):GCS_LIBRARY_BASENAME = lib + macx { GCS_APP_TARGET = $$GCS_BIG_NAME GCS_PATH = $$GCS_BUILD_TREE/$${GCS_APP_TARGET}.app/Contents @@ -155,7 +157,7 @@ macx { GCS_APP_TARGET = $$GCS_SMALL_NAME GCS_PATH = $$GCS_BUILD_TREE GCS_APP_PATH = $$GCS_PATH/bin - GCS_LIBRARY_PATH = $$GCS_PATH/lib/$$GCS_SMALL_NAME + GCS_LIBRARY_PATH = $$GCS_PATH/$$GCS_LIBRARY_BASENAME/$$GCS_SMALL_NAME GCS_PLUGIN_PATH = $$GCS_LIBRARY_PATH/plugins GCS_DATA_PATH = $$GCS_PATH/share/$$GCS_SMALL_NAME GCS_DOC_PATH = $$GCS_PATH/share/doc diff --git a/package/Linux.mk b/package/Linux.mk index 40b32bb23..3d61b329e 100644 --- a/package/Linux.mk +++ b/package/Linux.mk @@ -81,10 +81,12 @@ endif # Debian based distro? # Install Linux Target # ############################## -enable-udev-rules ?= no +enable-udev-rules := no + prefix := /usr/local bindir := $(prefix)/bin -libdir := $(prefix)/lib +libbasename := lib +libdir := $(prefix)/$(libbasename) datadir := $(prefix)/share udevrulesdir := /etc/udev/rules.d @@ -101,7 +103,7 @@ install: $(V1) $(MKDIR) -p $(DESTDIR)$(datadir)/applications $(V1) $(MKDIR) -p $(DESTDIR)$(datadir)/pixmaps $(V1) $(INSTALL) $(BUILD_DIR)/$(GCS_SMALL_NAME)_$(GCS_BUILD_CONF)/bin/$(GCS_SMALL_NAME) $(DESTDIR)$(bindir) - $(V1) $(INSTALL) $(BUILD_DIR)/$(GCS_SMALL_NAME)_$(GCS_BUILD_CONF)/lib/$(GCS_SMALL_NAME) $(DESTDIR)$(libdir) + $(V1) $(INSTALL) $(BUILD_DIR)/$(GCS_SMALL_NAME)_$(GCS_BUILD_CONF)/$(libbasename)/$(GCS_SMALL_NAME) $(DESTDIR)$(libdir) $(V1) $(INSTALL) $(BUILD_DIR)/$(GCS_SMALL_NAME)_$(GCS_BUILD_CONF)/share/$(GCS_SMALL_NAME) $(DESTDIR)$(datadir) $(V1) $(INSTALL) -T $(ROOT_DIR)/package/linux/gcs.desktop $(DESTDIR)$(datadir)/applications/$(ORG_SMALL_NAME).desktop $(V1) $(INSTALL) -T $(ROOT_DIR)/ground/openpilotgcs/src/plugins/coreplugin/images/$(ORG_SMALL_NAME)_logo_128.png \ diff --git a/package/linux/librepilot.spec b/package/linux/librepilot.spec index 1330fba42..5d653644e 100644 --- a/package/linux/librepilot.spec +++ b/package/linux/librepilot.spec @@ -52,13 +52,9 @@ and ease of use. %prep %setup -q -n %{name}-%{version}-%{gitrev} -# Fix hardcoded paths -sed -i 's!lib/$$GCS_SMALL_NAME!%{_lib}/$$GCS_SMALL_NAME!g' ground/openpilotgcs/openpilotgcs.pri -sed -i 's!lib/$(GCS_SMALL_NAME!%{_lib}/$(GCS_SMALL_NAME!g' package/Linux.mk - %build -make %{?_smp_mflags} gcs QMAKE=qmake-qt5 CC=%{__cc} CXX=%{__cxx} libdir=%{_libdir} +make %{?_smp_mflags} gcs QMAKE=qmake-qt5 CC=%{__cc} CXX=%{__cxx} libbasename=%{_lib} #make -j1 opfw_resource @@ -66,7 +62,7 @@ make %{?_smp_mflags} gcs QMAKE=qmake-qt5 CC=%{__cc} CXX=%{__cxx} libdir=%{_libdi rm -rf $RPM_BUILD_ROOT make install DESTDIR=$RPM_BUILD_ROOT \ prefix=%{_prefix} \ - libdir=%{_libdir} \ + libbasename=%{_lib} \ enable-udev-rules=yes \ udevrulesdir=%{_udevrulesdir}