From patchwork Thu Sep 22 19:49:04 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bowgo Tsai X-Patchwork-Id: 9346861 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 5DA62607D0 for ; Thu, 22 Sep 2016 20:00:44 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id B18272ABFA for ; Thu, 22 Sep 2016 20:00:43 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 99D322AC4E; Thu, 22 Sep 2016 20:00:43 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-4.1 required=2.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, RCVD_IN_DNSWL_MED, T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from emsm-gh1-uea11.nsa.gov (emsm-gh1-uea11.nsa.gov [8.44.101.9]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id C4AA02ABFA for ; Thu, 22 Sep 2016 20:00:42 +0000 (UTC) X-IronPort-AV: E=Sophos;i="5.30,379,1470700800"; d="scan'208";a="19485129" IronPort-PHdr: =?us-ascii?q?9a23=3An2EzBBWkOpeg8SAOyULPNhWfiFTV8LGtZVwlr6E/?= =?us-ascii?q?grcLSJyIuqrYZhCOt8tkgFKBZ4jH8fUM07OQ6PG6HzRcqs/d6DgrS99lb1c9k8?= =?us-ascii?q?IYnggtUoauKHbQC7rUVRE8B9lIT1R//nu2YgB/Ecf6YEDO8DXptWZBUiv2OQc9?= =?us-ascii?q?HOnpAIma153xjLHovcWPKFwU3HKUWvBbFF2OtwLft80b08NJC50a7V/3mEZOYP?= =?us-ascii?q?lc3mhyJFiezF7W78a0+4N/oWwL46pyv/NaVe3GW4hwDfkBVHV1e1wysdbmsRjF?= =?us-ascii?q?UBun+moXUmJQlAFBRQfC8kLURJD05wH9qeV6kBWBNMy+GbozRjul87xiSTfnjy?= =?us-ascii?q?AIMzN/+2bS3J8jxJlHqQ6s8kQsi7XfZ5uYYb8nJq4=3D?= X-IPAS-Result: =?us-ascii?q?A2EeAgCeN+RX/wHyM5BeHAEBBAEBCgEBFwEBBAEBCgEBgxA?= =?us-ascii?q?BAQEBAR5XfLoeBRg6IAOHbkwBAQEBAQEBAQIBAlsngjIEAxMFBAEiARYLMAEBA?= =?us-ascii?q?QEBAQEBAQEgAg03KgEEAg8oBgEBDCALAQIDCQIXCCABCAgDAS0DAQUBCx8LBRg?= =?us-ascii?q?EAYgpoWuBMj4yilaFMAEBBYgMAQoBAQEbCBCEF4IQiGoRAYV6jy+KS4RZgU6JP?= =?us-ascii?q?wKCOoccJYVvjyIxgRFUJYJmggdlhHB4gScBAQE?= Received: from unknown (HELO tarius.tycho.ncsc.mil) ([144.51.242.1]) by emsm-gh1-uea11.nsa.gov with ESMTP; 22 Sep 2016 20:00:34 +0000 Received: from prometheus.infosec.tycho.ncsc.mil (prometheus [192.168.25.40]) by tarius.tycho.ncsc.mil (8.14.4/8.14.4) with ESMTP id u8MJxs9i015797; Thu, 22 Sep 2016 16:00:04 -0400 Received: from tarius.tycho.ncsc.mil (tarius.infosec.tycho.ncsc.mil [144.51.242.1]) by prometheus.infosec.tycho.ncsc.mil (8.15.2/8.15.2) with ESMTP id u8MJnO58148191 for ; Thu, 22 Sep 2016 15:49:24 -0400 Received: from goalie.tycho.ncsc.mil (goalie [144.51.242.250]) by tarius.tycho.ncsc.mil (8.14.4/8.14.4) with ESMTP id u8MJnO8w014524 for ; Thu, 22 Sep 2016 15:49:24 -0400 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: A1AqAABONeRXhincVdFeHAYMgz0BAQEBAXV8tmmDNQVZHIYCgWxMAQIBAQEBAQITAQEBCAsLCRmFEwEVLgEBNwEvIEUBBQE1IogpoWuBMj4yilaFMAEBBYd+AQEBBwIdCBCEF4IQi2QLgwePL4pLhFmBTok/AoI6hxyGFI8iMYEReYMFgWgxNIcPAQEB X-IPAS-Result: A1AqAABONeRXhincVdFeHAYMgz0BAQEBAXV8tmmDNQVZHIYCgWxMAQIBAQEBAQITAQEBCAsLCRmFEwEVLgEBNwEvIEUBBQE1IogpoWuBMj4yilaFMAEBBYd+AQEBBwIdCBCEF4IQi2QLgwePL4pLhFmBTok/AoI6hxyGFI8iMYEReYMFgWgxNIcPAQEB X-IronPort-AV: E=Sophos;i="5.30,379,1470715200"; d="scan'208";a="5723397" Received: from emsm-gh1-uea11.corp.nsa.gov (HELO emsm-gh1-uea11.nsa.gov) ([10.208.41.37]) by goalie.tycho.ncsc.mil with ESMTP; 22 Sep 2016 15:49:23 -0400 IronPort-PHdr: =?us-ascii?q?9a23=3AmRVT9BKfwqyHtPBIK9mcpTZWNBhigK39O0sv0rFi?= =?us-ascii?q?tYgUKfjxwZ3uMQTl6Ol3ixeRBMOAuqgC07ad6vy4EUU7or+5+EgYd5JNUxJXwe?= =?us-ascii?q?43pCcHRPC/NEvgMfTxZDY7FskRHHVs/nW8LFQHUJ2mPw6anHS+4HYoFwnlMkIt?= =?us-ascii?q?f6KuS9SU15j8jrzqs7ToICxwzAKnZr1zKBjk5S7wjeIxxbVYF6Aq1xHSqWFJce?= =?us-ascii?q?kFjUlhJFaUggqurpzopM0roGxsvKc6+spBV7jqV7gpRrxfSjI9OiY649O4mwPE?= =?us-ascii?q?SF6l4WQTVS0qiRNJS1zP6w71WYvquyrSue161y2Xe8bxSOZnCnyZ8653RUqw22?= =?us-ascii?q?88PDkj/TSPhw=3D=3D?= X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: =?us-ascii?q?A0HDAABONeRXhincVdFeHAEFAQsBGQEFA?= =?us-ascii?q?QsBgxABAQEBAXV8tmmDNQUYQRyGAoFsTAEBAQEBAQEBAgECEAEBAQgLCwkZL4I?= =?us-ascii?q?yGAsBIgEWCzABAQEBAQEBAQEBIAINNyoBFS4BATcBLyBFAQUBNSKIKaFrgTI+M?= =?us-ascii?q?opWhTABAQWHfgEBAQcCARwIEIQXghCLZAuDB48vikuEWYFOiT8CgjqHHIYUjyI?= =?us-ascii?q?xgRF5gwWBaDE0hw8BAQE?= X-IPAS-Result: =?us-ascii?q?A0HDAABONeRXhincVdFeHAEFAQsBGQEFAQsBgxABAQEBAXV?= =?us-ascii?q?8tmmDNQUYQRyGAoFsTAEBAQEBAQEBAgECEAEBAQgLCwkZL4IyGAsBIgEWCzABA?= =?us-ascii?q?QEBAQEBAQEBIAINNyoBFS4BATcBLyBFAQUBNSKIKaFrgTI+MopWhTABAQWHfgE?= =?us-ascii?q?BAQcCARwIEIQXghCLZAuDB48vikuEWYFOiT8CgjqHHIYUjyIxgRF5gwWBaDE0h?= =?us-ascii?q?w8BAQE?= X-IronPort-AV: E=Sophos;i="5.30,379,1470700800"; d="scan'208";a="19484675" Received: from mail-pa0-f41.google.com ([209.85.220.41]) by emsm-gh1-uea11.nsa.gov with ESMTP/TLS/AES128-GCM-SHA256; 22 Sep 2016 19:49:19 +0000 Received: by mail-pa0-f41.google.com with SMTP id oz2so32230268pac.2 for ; Thu, 22 Sep 2016 12:49:19 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=from:to:cc:subject:date:message-id; bh=EI+Dyn4OisM0w/GVXjj4jsl+AA/Cy4yscSqE3SCq9js=; b=MZfkjkLXw6mFoFqt7OM9d8mKOZ3xndIs7R2EtxV2aPE4euwCuwslVBVBnBk++TwnQ4 lbsLgUmQYExOBZShW/4iQ8YfxuetYvfyffPm3/0uY1L7Q6ZGAzSjM4xHJ2tstS2ooNpy WFIGVM9np+8Pu1hOrFhXVXwX4Ny+GoCCtBqDagYjj+yJWT4Yajw6246fuwNjeMBYV8+Z Tm3CGO9WFd4RKF/3llR+A6GHr/LT96OYWXanvdduVsyBa2OnQAlHS7FyEHqUuSjoQmkw BpVNHoJ68mMWAOk4rN5fyDpn0+5N42Fat9fn5/YanlxgT1ZwUWmyGaA3lNMKPw/TA7GY i5eA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=EI+Dyn4OisM0w/GVXjj4jsl+AA/Cy4yscSqE3SCq9js=; b=FkctkvRErFHGeE+cRcAp5EpXbD+Ig0FRp1Xkxu8paJOVl5VbaeMUtte05TocurP/jf M9rFKGrUoJb1UGKC7ANSpiVJLMTzEENEwbXAb5qC5m89aXUkCLICSIVRZT6+Uq50gWRs VksvNQ4Gq+VsKdqKnINfsw2Zc1LFKHg0imX1GH8G7tC+4FQLChLeljMHfKA3DxzCbT3o ELfJQud210IvssxOTKBGm5bNerhYkZ3RnrA0x+bl/gjGrbo5K8CPZsDX43qSlXp0W3Pw ZICdYad61obWZ8tlh+YbImkB2ilqZnnDM2KdG3MBQUFUPPJ1c2N1QQfNKSiBqIpAbr+9 agdg== X-Gm-Message-State: AE9vXwPJk18+3A6bk6te2UqI1BF6VvdGBWxxuTRUdMzN9Cj+oziz+Mr0PNTrmzuCZFrp+axF X-Received: by 10.66.34.101 with SMTP id y5mr6219811pai.95.1474573748285; Thu, 22 Sep 2016 12:49:08 -0700 (PDT) Received: from bowgotsai-z840.tpe.corp.google.com ([172.30.210.152]) by smtp.gmail.com with ESMTPSA id b125sm5978835pfg.36.2016.09.22.12.49.07 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Thu, 22 Sep 2016 12:49:07 -0700 (PDT) From: Bowgo Tsai To: selinux@tycho.nsa.gov Subject: [PATCH 2/2] Add libsepol and secil host and device targets Date: Fri, 23 Sep 2016 03:49:04 +0800 Message-Id: <1474573744-124781-1-git-send-email-bowgotsai@google.com> X-Mailer: git-send-email 2.8.0.rc3.226.g39d4020 X-Mailman-Approved-At: Thu, 22 Sep 2016 15:51:05 -0400 X-BeenThere: selinux@tycho.nsa.gov X-Mailman-Version: 2.1.20 Precedence: list List-Id: "Security-Enhanced Linux \(SELinux\) mailing list" List-Post: List-Help: Cc: bowgotsai MIME-Version: 1.0 Errors-To: selinux-bounces@tycho.nsa.gov Sender: "Selinux" X-Virus-Scanned: ClamAV using ClamSMTP From: bowgotsai Also clean up some LOCAL_C_INCLUDES as it should be included by LOCAL_EXPORT_C_INCLUDE_DIRS from libsepol. BUG=31366888 Change-Id: I0e21279097f0635761672b838ad26861fc49e9ea --- checkpolicy/Android.mk | 8 -------- libsepol/Android.mk | 15 +++++++++++---- secilc/Android.mk | 21 +++++++++++++++------ secilc/secilc.c | 2 +- 4 files changed, 27 insertions(+), 19 deletions(-) diff --git a/checkpolicy/Android.mk b/checkpolicy/Android.mk index ee2f158..53409f8 100644 --- a/checkpolicy/Android.mk +++ b/checkpolicy/Android.mk @@ -12,11 +12,6 @@ common_cflags := \ -Wall -Wshadow -O2 \ -pipe -fno-strict-aliasing \ -common_includes := \ - $(LOCAL_PATH)/ \ - $(LOCAL_PATH)/../libsepol/include/ \ - $(LOCAL_PATH)/../libsepol/src/ \ - ## # checkpolicy # @@ -24,7 +19,6 @@ include $(CLEAR_VARS) LOCAL_MODULE := checkpolicy LOCAL_MODULE_TAGS := optional -LOCAL_C_INCLUDES := $(common_includes) LOCAL_CFLAGS := $(common_cflags) LOCAL_SRC_FILES := $(common_src_files) checkpolicy.c LOCAL_STATIC_LIBRARIES := libsepol @@ -41,7 +35,6 @@ include $(CLEAR_VARS) LOCAL_MODULE := checkmodule LOCAL_MODULE_TAGS := optional -LOCAL_C_INCLUDES := $(common_includes) LOCAL_CFLAGS := $(common_cflags) LOCAL_SRC_FILES := $(common_src_files) checkmodule.c LOCAL_STATIC_LIBRARIES := libsepol @@ -57,7 +50,6 @@ include $(CLEAR_VARS) LOCAL_MODULE := dispol LOCAL_MODULE_TAGS := optional -LOCAL_C_INCLUDES := $(common_includes) LOCAL_CFLAGS := $(common_cflags) LOCAL_SRC_FILES := test/dispol.c LOCAL_STATIC_LIBRARIES := libsepol diff --git a/libsepol/Android.mk b/libsepol/Android.mk index e9cfeef..637669a 100644 --- a/libsepol/Android.mk +++ b/libsepol/Android.mk @@ -93,7 +93,9 @@ LOCAL_C_INCLUDES := $(common_includes) LOCAL_CFLAGS := $(common_cflags) LOCAL_CPPFLAGS := $(yacc_flags) LOCAL_SRC_FILES := $(common_src_files) $(cil_src_files) -LOCAL_EXPORT_C_INCLUDE_DIRS := $(LOCAL_PATH)/include +LOCAL_EXPORT_C_INCLUDE_DIRS := \ + $(LOCAL_PATH)/include \ + $(LOCAL_PATH)/cil/include include $(BUILD_HOST_SHARED_LIBRARY) @@ -108,7 +110,9 @@ LOCAL_C_INCLUDES := $(common_includes) LOCAL_CFLAGS := $(common_cflags) LOCAL_CPPFLAGS := $(yacc_flags) LOCAL_SRC_FILES := $(common_src_files) $(cil_src_files) -LOCAL_EXPORT_C_INCLUDE_DIRS := $(LOCAL_PATH)/include +LOCAL_EXPORT_C_INCLUDE_DIRS := \ + $(LOCAL_PATH)/include \ + $(LOCAL_PATH)/cil/include include $(BUILD_HOST_STATIC_LIBRARY) @@ -132,7 +136,10 @@ LOCAL_MODULE := libsepol LOCAL_MODULE_TAGES := optional LOCAL_C_INCLUDES := $(common_includes) LOCAL_CFLAGS := $(common_cflags) -LOCAL_SRC_FILES := $(common_src_files) -LOCAL_EXPORT_C_INCLUDE_DIRS := $(LOCAL_PATH)/include +LOCAL_CPPFLAGS := $(yacc_flags) +LOCAL_SRC_FILES := $(common_src_files) $(cil_src_files) +LOCAL_EXPORT_C_INCLUDE_DIRS := \ + $(LOCAL_PATH)/include \ + $(LOCAL_PATH)/cil/include include $(BUILD_STATIC_LIBRARY) diff --git a/secilc/Android.mk b/secilc/Android.mk index 6c7b9d3..6d0f702 100644 --- a/secilc/Android.mk +++ b/secilc/Android.mk @@ -6,21 +6,30 @@ common_cflags := \ -Wall -Wshadow -O2 \ -pipe -fno-strict-aliasing \ -common_includes := \ - $(LOCAL_PATH)/../libsepol/cil/include/ \ - $(LOCAL_PATH)/../libsepol/include/ \ - ## -# secilc +# secilc on the host. # include $(CLEAR_VARS) LOCAL_MODULE := secilc LOCAL_MODULE_TAGS := optional -LOCAL_C_INCLUDES := $(common_includes) LOCAL_CFLAGS := $(common_cflags) LOCAL_SRC_FILES := secilc.c LOCAL_SHARED_LIBRARIES := libsepol LOCAL_MODULE_CLASS := EXECUTABLES include $(BUILD_HOST_EXECUTABLE) + +## +# secilc on the target. +# +include $(CLEAR_VARS) + +LOCAL_MODULE := secilc +LOCAL_MODULE_TAGS := optional +LOCAL_CFLAGS := $(common_cflags) +LOCAL_SRC_FILES := secilc.c +LOCAL_STATIC_LIBRARIES := libsepol +LOCAL_MODULE_CLASS := EXECUTABLES + +include $(BUILD_EXECUTABLE) diff --git a/secilc/secilc.c b/secilc/secilc.c index e98abe2..dad1e90 100644 --- a/secilc/secilc.c +++ b/secilc/secilc.c @@ -35,7 +35,7 @@ #include #ifdef ANDROID -#include +#include #else #include #endif