All of lore.kernel.org
 help / color / mirror / Atom feed
From: Vitaly Chikunov <vt@altlinux.org>
To: Steven Rostedt <rostedt@goodmis.org>, linux-trace-devel@vger.kernel.org
Cc: Vitaly Chikunov <vt@altlinux.org>, "Dmitry V . Levin" <ldv@altlinux.org>
Subject: [PATCH 1/2] Makefile: Fix CUNIT_INSTALLED test to work with make 4.3 and dash
Date: Mon, 20 Jul 2020 19:44:52 +0300	[thread overview]
Message-ID: <20200720164453.5161-1-vt@altlinux.org> (raw)

In GNU Make 4.3 there is backward incompatible change that there is no need
to quote '#' in shell invocations anymore. If quoted, backslash character is
passed into gcc making cunit (and vsock) tests fail to compile.

Also, `echo -e' is replaced with `printf' to interpret '\n', because, on
Debian dash's `echo' does not support `-e', thus having `-e' passed into
test source making gcc fail to compile the test.

make test error message:

  Makefile:342: *** CUnit framework not installed, cannot build unit tests.  Stop.

Signed-off-by: Vitaly Chikunov <vt@altlinux.org>
Cc: Dmitry V. Levin <ldv@altlinux.org>
---
 Makefile | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/Makefile b/Makefile
index 4b72a04..6b606da 100644
--- a/Makefile
+++ b/Makefile
@@ -86,6 +86,8 @@ plugin_traceevent_dir_SQ = $(subst ','\'',$(plugin_traceevent_dir))
 plugin_tracecmd_dir_SQ = $(subst ','\'',$(plugin_tracecmd_dir))
 python_dir_SQ = $(subst ','\'',$(python_dir))
 
+pound := \#
+
 VAR_DIR = -DVAR_DIR="$(var_dir)"
 VAR_DIR_SQ = '$(subst ','\'',$(VAR_DIR))'
 var_dir_SQ = '$(subst ','\'',$(var_dir))'
@@ -233,14 +235,14 @@ CFLAGS ?= -g -Wall
 CPPFLAGS ?=
 LDFLAGS ?=
 
-VSOCK_DEFINED := $(shell if (echo "\#include <linux/vm_sockets.h>" | $(CC) -E - >/dev/null 2>&1) ; then echo 1; else echo 0 ; fi)
+VSOCK_DEFINED := $(shell if (echo "$(pound)include <linux/vm_sockets.h>" | $(CC) -E - >/dev/null 2>&1) ; then echo 1; else echo 0 ; fi)
 
 export VSOCK_DEFINED
 ifeq ($(VSOCK_DEFINED), 1)
 CFLAGS += -DVSOCK
 endif
 
-CUNIT_INSTALLED := $(shell if (echo -e "\#include <CUnit/Basic.h>\n void main(){CU_initialize_registry();}" | $(CC) -x c -lcunit - >/dev/null 2>&1) ; then echo 1; else echo 0 ; fi)
+CUNIT_INSTALLED := $(shell if (printf "$(pound)include <CUnit/Basic.h>\n void main(){CU_initialize_registry();}" | $(CC) -x c -lcunit - >/dev/null 2>&1) ; then echo 1; else echo 0 ; fi)
 export CUNIT_INSTALLED
 
 export CFLAGS
-- 
2.11.0


             reply	other threads:[~2020-07-20 16:45 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-07-20 16:44 Vitaly Chikunov [this message]
2020-07-20 16:44 ` [PATCH 2/2] Makefile: Fix build of utest on systems with --as-needed enabled Vitaly Chikunov
2020-07-22 21:58   ` Steven Rostedt

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20200720164453.5161-1-vt@altlinux.org \
    --to=vt@altlinux.org \
    --cc=ldv@altlinux.org \
    --cc=linux-trace-devel@vger.kernel.org \
    --cc=rostedt@goodmis.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.