From patchwork Wed Apr 12 09:39:25 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arnout Vandecappelle X-Patchwork-Id: 749893 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from fraxinus.osuosl.org (smtp4.osuosl.org [140.211.166.137]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 3w2zZ060wRz9sNJ for ; Wed, 12 Apr 2017 19:45:44 +1000 (AEST) Received: from localhost (localhost [127.0.0.1]) by fraxinus.osuosl.org (Postfix) with ESMTP id 88A9D88397; Wed, 12 Apr 2017 09:45:23 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from fraxinus.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id AONQntdxnyJA; Wed, 12 Apr 2017 09:45:22 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by fraxinus.osuosl.org (Postfix) with ESMTP id B395788432; Wed, 12 Apr 2017 09:42:15 +0000 (UTC) X-Original-To: buildroot@lists.busybox.net Delivered-To: buildroot@osuosl.org Received: from fraxinus.osuosl.org (smtp4.osuosl.org [140.211.166.137]) by ash.osuosl.org (Postfix) with ESMTP id 120DE1C3EF4 for ; Wed, 12 Apr 2017 09:40:29 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by fraxinus.osuosl.org (Postfix) with ESMTP id 0EB6E87364 for ; Wed, 12 Apr 2017 09:40:29 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from fraxinus.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id fYb_Xi2R84vO for ; Wed, 12 Apr 2017 09:40:23 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from exchange.essensium.com (220.77.144.195.ipv4.evonet.be [195.144.77.220]) by fraxinus.osuosl.org (Postfix) with ESMTPS id 328E587361 for ; Wed, 12 Apr 2017 09:40:12 +0000 (UTC) Received: from vandecaa-laptop.local.ess-mail.com (10.3.4.128) by beleexch01.local.ess-mail.com (10.3.7.8) with Microsoft SMTP Server (TLS) id 15.0.847.32; Wed, 12 Apr 2017 11:39:57 +0200 From: "Arnout Vandecappelle (Essensium/Mind)" To: Date: Wed, 12 Apr 2017 11:39:25 +0200 Message-ID: <20170412093928.1006-52-arnout@mind.be> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20170412093928.1006-1-arnout@mind.be> References: <20170412093928.1006-1-arnout@mind.be> MIME-Version: 1.0 X-Originating-IP: [10.3.4.128] X-ClientProxiedBy: beleexch01.local.ess-mail.com (10.3.7.8) To beleexch01.local.ess-mail.com (10.3.7.8) Subject: [Buildroot] [PATCH 51/53] libselinux: rework host installation X-BeenThere: buildroot@busybox.net X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: Discussion and development of buildroot List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: buildroot-bounces@busybox.net Sender: "buildroot" libselinux has a pretty peculiar interpretation of DESTDIR and PREFIX. PREFIX is not consistently used: some installation paths are forced to $(DESTDIR)/usr/... . In other cases, PREFIX is indeed used. PREFIX defaults to $(DESTDIR)/usr. Try to be a little bit more correct by passing both DESTDIR and PREFIX, both set to $(HOST_DIR). This is not a complete fix: man pages are still installed in $(HOST_DIR)/usr - but we don't care about that. Also simplify the symlink creation, like how it's done in libsepol. Signed-off-by: Arnout Vandecappelle (Essensium/Mind) --- package/libselinux/libselinux.mk | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) diff --git a/package/libselinux/libselinux.mk b/package/libselinux/libselinux.mk index 0d97c17e3a..0483d4d2b0 100644 --- a/package/libselinux/libselinux.mk +++ b/package/libselinux/libselinux.mk @@ -79,32 +79,31 @@ HOST_LIBSELINUX_PYINC = -I$(HOST_DIR)/include/python$(PYTHON_VERSION_MAJOR)/ HOST_LIBSELINUX_PYLIBVER = python$(PYTHON_VERSION_MAJOR) endif +# DESTDIR is needed during the compile to compute library and header paths. HOST_LIBSELINUX_MAKE_OPTS = \ $(HOST_CONFIGURE_OPTS) \ + DESTDIR=$(HOST_DIR) \ + PREFIX=$(HOST_DIR) \ LDFLAGS="$(HOST_LDFLAGS) -lpcre -lpthread" \ PYINC="$(HOST_LIBSELINUX_PYINC)" \ PYSITEDIR="$(HOST_DIR)/lib/$(HOST_LIBSELINUX_PYLIBVER)/site-packages" \ SWIG_LIB="$(HOST_DIR)/share/swig/$(SWIG_VERSION)/" define HOST_LIBSELINUX_BUILD_CMDS - # DESTDIR is needed during the compile to compute library and - # header paths. $(HOST_MAKE_ENV) $(MAKE1) -C $(@D) \ - $(HOST_LIBSELINUX_MAKE_OPTS) DESTDIR=$(HOST_DIR) \ - SHLIBDIR=$(HOST_DIR)/lib all + $(HOST_LIBSELINUX_MAKE_OPTS) all # Generate python interface wrapper $(HOST_MAKE_ENV) $(MAKE1) -C $(@D) \ - $(HOST_LIBSELINUX_MAKE_OPTS) DESTDIR=$(HOST_DIR) swigify pywrap + $(HOST_LIBSELINUX_MAKE_OPTS) swigify pywrap endef define HOST_LIBSELINUX_INSTALL_CMDS $(HOST_MAKE_ENV) $(MAKE) -C $(@D) \ - $(HOST_LIBSELINUX_MAKE_OPTS) DESTDIR=$(HOST_DIR) \ - SHLIBDIR=$(HOST_DIR)/lib SBINDIR=$(HOST_DIR)/sbin install - (cd $(HOST_DIR)/lib; $(HOSTLN) -sf libselinux.so.1 libselinux.so) + $(HOST_LIBSELINUX_MAKE_OPTS) install + ln -sf libselinux.so.1 $(HOST_DIR)/lib/libselinux.so # Install python interface wrapper $(HOST_MAKE_ENV) $(MAKE) -C $(@D) \ - $(HOST_LIBSELINUX_MAKE_OPTS) DESTDIR=$(HOST_DIR) install-pywrap + $(HOST_LIBSELINUX_MAKE_OPTS) install-pywrap endef $(eval $(generic-package))