Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752866AbbGSDne (ORCPT ); Sat, 18 Jul 2015 23:43:34 -0400 Received: from smtp.gentoo.org ([140.211.166.183]:53863 "EHLO smtp.gentoo.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752603AbbGSDnd (ORCPT ); Sat, 18 Jul 2015 23:43:33 -0400 From: Richard Yao To: Peter Zijlstra Cc: Naohiro Aota , =?UTF-8?q?Emilio=20L=C3=B3pez?= , Richard Yao , Ingo Molnar , Arnaldo Carvalho de Melo , Jiri Olsa , Namhyung Kim , Adrian Hunter , linux-kernel@vger.kernel.org (open list:PERFORMANCE EVENTS SUBSYSTEM) Subject: [PATCH] perf tools: Do not require /bin/sh be bash Date: Sat, 18 Jul 2015 23:43:00 -0400 Message-Id: <1437277382-57362-1-git-send-email-ryao@gentoo.org> X-Mailer: git-send-email 2.3.6 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Commit fcfd6611fbccdbf2593bd949097a5c0e45cd96da truncated .config-detected by piping echo -n to it. On systems where /bin/sh is not bash and echo is a builtin, echo -n prints "-n", which breaks the build: .config-detected:1: *** missing separator. Stop. This broke builds on my Gentoo systems where /bin/sh is dash and possibly other systems where /bin/sh is not bash as well. It is easily solved by piping cat /dev/null. Piping an empty command should have been a suitable substitute, but zsh hangs when asked to do that. This method of truncating a file works on bash, busybox ash, dash and zsh. Other shells were not tested. Signed-off-by: Richard Yao Reviewed-by: Emilio López --- tools/perf/config/Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/perf/config/Makefile b/tools/perf/config/Makefile index 094ddae..70426d6 100644 --- a/tools/perf/config/Makefile +++ b/tools/perf/config/Makefile @@ -11,7 +11,7 @@ ifneq ($(obj-perf),) obj-perf := $(abspath $(obj-perf))/ endif -$(shell echo -n > $(OUTPUT).config-detected) +$(shell cat /dev/null > $(OUTPUT).config-detected) detected = $(shell echo "$(1)=y" >> $(OUTPUT).config-detected) detected_var = $(shell echo "$(1)=$($(1))" >> $(OUTPUT).config-detected) -- 2.3.6