From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80]) by finch.gentoo.org (Postfix) with ESMTP id 11173139894 for ; Mon, 24 Aug 2015 21:22:14 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 67F441422E; Mon, 24 Aug 2015 21:22:12 +0000 (UTC) Received: from smtp.gentoo.org (smtp.gentoo.org [140.211.166.183]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by pigeon.gentoo.org (Postfix) with ESMTPS id 0A5CA1422E for ; Mon, 24 Aug 2015 21:22:10 +0000 (UTC) Received: from oystercatcher.gentoo.org (oystercatcher.gentoo.org [148.251.78.52]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id 08CE83406A6 for ; Mon, 24 Aug 2015 21:22:10 +0000 (UTC) Received: from localhost.localdomain (localhost [127.0.0.1]) by oystercatcher.gentoo.org (Postfix) with ESMTP id AC86016B for ; Mon, 24 Aug 2015 21:22:08 +0000 (UTC) From: "Mike Frysinger" To: gentoo-commits@lists.gentoo.org Content-Transfer-Encoding: 8bit Content-type: text/plain; charset=UTF-8 Reply-To: gentoo-dev@lists.gentoo.org, "Mike Frysinger" Message-ID: <1440451181.9d0a60f489c17e47e08aa5ec09da8d7049e402ea.vapier@gentoo> Subject: [gentoo-commits] proj/pax-utils:master commit in: / X-VCS-Repository: proj/pax-utils X-VCS-Files: Makefile configure.ac paxinc.h X-VCS-Directories: / X-VCS-Committer: vapier X-VCS-Committer-Name: Mike Frysinger X-VCS-Revision: 9d0a60f489c17e47e08aa5ec09da8d7049e402ea X-VCS-Branch: master Date: Mon, 24 Aug 2015 21:22:08 +0000 (UTC) Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-commits@lists.gentoo.org X-Archives-Salt: 3130251a-9a57-478b-9bff-2ae77a1da9b4 X-Archives-Hash: 959f88037eab06ac051b4c2fd566f983 commit: 9d0a60f489c17e47e08aa5ec09da8d7049e402ea Author: Mike Frysinger gentoo org> AuthorDate: Mon Aug 24 21:19:41 2015 +0000 Commit: Mike Frysinger gentoo org> CommitDate: Mon Aug 24 21:19:41 2015 +0000 URL: https://gitweb.gentoo.org/proj/pax-utils.git/commit/?id=9d0a60f4 build: add plumbing for building w/debug code For cases where we want extra debug messages, add some debug knobs. This will be used in a follow up commit to make it easier to triage seccomp failures. Makefile | 8 ++++---- configure.ac | 5 +++++ paxinc.h | 6 ++++++ 3 files changed, 15 insertions(+), 4 deletions(-) diff --git a/Makefile b/Makefile index 3abfee7..26cc9d4 100644 --- a/Makefile +++ b/Makefile @@ -36,10 +36,6 @@ MKDIR := mkdir -p INS_EXE := install -m755 INS_DATA := install -m644 -# Some fun settings -#CFLAGS += -DEBUG -g -#LDFLAGS += -pie - PKG_CONFIG ?= pkg-config ifeq ($(USE_CAP),yes) @@ -49,6 +45,10 @@ CPPFLAGS-pspax.c += $(LIBCAPS_CFLAGS) -DWANT_SYSCAP LIBS-pspax += $(LIBCAPS_LIBS) endif +ifeq ($(USE_DEBUG),yes) +override CPPFLAGS += -DEBUG +endif + ifeq ($(USE_SECCOMP),yes) LIBSECCOMP_CFLAGS := $(shell $(PKG_CONFIG) --cflags libseccomp) LIBSECCOMP_LIBS := $(shell $(PKG_CONFIG) --libs libseccomp) diff --git a/configure.ac b/configure.ac index 327d9b8..3b4de91 100644 --- a/configure.ac +++ b/configure.ac @@ -23,6 +23,11 @@ AS_IF([test "x$with_caps" = "xyes"], [ LIBS="$LIBS $LIBCAP_LIBS" ]) +AC_ARG_WITH([debug], [AS_HELP_STRING([--with-debug], [enable debug code])]) +AS_IF([test "x$with_debug" = "xyes"], [ + CPPFLAGS="$CPPFLAGS -DEBUG" +]) + AC_ARG_WITH([python], [AS_HELP_STRING([--with-python], [use lddtree.py])]) AM_CONDITIONAL([USE_PYTHON], [test "x$with_python" = "xyes"]) diff --git a/paxinc.h b/paxinc.h index a8d6d9b..e687b3a 100644 --- a/paxinc.h +++ b/paxinc.h @@ -22,6 +22,12 @@ # define VCSID "" #endif +#ifdef EBUG +# define USE_DEBUG 1 +#else +# define USE_DEBUG 0 +#endif + /* ELF love */ #include "elf.h" #include "paxelf.h"