From patchwork Sat May 23 04:01:21 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: rcombs X-Patchwork-Id: 19812 Return-Path: X-Original-To: patchwork@ffaux-bg.ffmpeg.org Delivered-To: patchwork@ffaux-bg.ffmpeg.org Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org [79.124.17.100]) by ffaux.localdomain (Postfix) with ESMTP id A9D5A44BD24 for ; Sat, 23 May 2020 07:01:36 +0300 (EEST) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 849A168A777; Sat, 23 May 2020 07:01:36 +0300 (EEST) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from so254-54.mailgun.net (so254-54.mailgun.net [198.61.254.54]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id CF874689256 for ; Sat, 23 May 2020 07:01:29 +0300 (EEST) DKIM-Signature: a=rsa-sha256; v=1; c=relaxed/relaxed; d=rcombs.me; q=dns/txt; s=mx; t=1590206489; h=Content-Transfer-Encoding: MIME-Version: Message-Id: Date: Subject: To: From: Sender; bh=igRjIednMuZj7RTEOU1sdj+eBfwQ5Xp9XeXVNWZFSCQ=; b=QlL0OaVEKeLVOEoBY3sMXtCkgncK9sW26u40oOUAstOJOWlkSoe8MzwTy43qiJ07qamEPqZp 1gSaXXv8Oz0qeJFsPrTtu6F+rXer/nj+30dyloAVTcwY/5hU21KddyzgF3obqsmiv5Ncv5wU kbiJ1JJ2J6LIF4H7KHxchJHcOxg= X-Mailgun-Sending-Ip: 198.61.254.54 X-Mailgun-Sid: WyJiZDU1MSIsICJmZm1wZWctZGV2ZWxAZmZtcGVnLm9yZyIsICJiMGJhIl0= Received: from rcombs-mbp.localdomain ( [24.14.135.13]) by smtp-out-n03.prod.us-east-1.postgun.com with SMTP id 5ec8a0177171b6d7e4472f02 (version=TLS1.2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256); Sat, 23 May 2020 04:01:27 GMT From: rcombs To: ffmpeg-devel@ffmpeg.org Date: Fri, 22 May 2020 23:01:21 -0500 Message-Id: <20200523040122.83476-1-rcombs@rcombs.me> X-Mailer: git-send-email 2.26.2 MIME-Version: 1.0 Subject: [FFmpeg-devel] [PATCH 1/2] compat/cuda/ptx2c: remove shell loop X-BeenThere: ffmpeg-devel@ffmpeg.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: FFmpeg development discussions and patches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: FFmpeg development discussions and patches Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" This improves build times dramatically --- compat/cuda/ptx2c.sh | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/compat/cuda/ptx2c.sh b/compat/cuda/ptx2c.sh index 0750e7a3b7..435a9b4b6c 100755 --- a/compat/cuda/ptx2c.sh +++ b/compat/cuda/ptx2c.sh @@ -27,10 +27,8 @@ IN="$2" NAME="$(basename "$IN" | sed 's/\..*//')" printf "const char %s_ptx[] = \\" "$NAME" > "$OUT" -while IFS= read -r LINE -do - printf "\n\t\"%s\\\n\"" "$(printf "%s" "$LINE" | sed -e 's/\r//g' -e 's/["\\]/\\&/g')" >> "$OUT" -done < "$IN" -printf ";\n" >> "$OUT" +echo >> "$OUT" +sed -e 's/\r//g' -e 's/["\\]/\\&/g' -e 's/^[[:space:]]*/\t"/' -e 's/$/\\n"/' < "$IN" >> "$OUT" +echo ";" >> "$OUT" exit 0 From patchwork Sat May 23 04:01:22 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: rcombs X-Patchwork-Id: 19813 Return-Path: X-Original-To: patchwork@ffaux-bg.ffmpeg.org Delivered-To: patchwork@ffaux-bg.ffmpeg.org Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org [79.124.17.100]) by ffaux.localdomain (Postfix) with ESMTP id B5DDC44BD56 for ; Sat, 23 May 2020 07:02:11 +0300 (EEST) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 9A01768ABB0; Sat, 23 May 2020 07:02:11 +0300 (EEST) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from so254-54.mailgun.net (so254-54.mailgun.net [198.61.254.54]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 5006468807D for ; Sat, 23 May 2020 07:02:05 +0300 (EEST) DKIM-Signature: a=rsa-sha256; v=1; c=relaxed/relaxed; d=rcombs.me; q=dns/txt; s=mx; t=1590206528; h=Content-Transfer-Encoding: MIME-Version: References: In-Reply-To: Message-Id: Date: Subject: To: From: Sender; bh=tESdoCVb7nFyWTU/2u/VkYgOWjNOlpwOZWo1N2koWuk=; b=KmfpI9oPxyrUfF81l2W5TAZHrnCi63fwxzCREa7h+0RckAaaqIkl+Lm9XpVEipgBjC5AeVc3 5XIpDmMHthmHFld3m1b9VFF7hkKcPKtGaxTfB3B23/R0eO0X7WZpsgRuNSdctJf/yuzlzbMF i0FCAhBXHgIQdls+vUr2OiOJWnY= X-Mailgun-Sending-Ip: 198.61.254.54 X-Mailgun-Sid: WyJiZDU1MSIsICJmZm1wZWctZGV2ZWxAZmZtcGVnLm9yZyIsICJiMGJhIl0= Received: from rcombs-mbp.localdomain ( [24.14.135.13]) by smtp-out-n03.prod.us-east-1.postgun.com with SMTP id 5ec8a0174110e14718ba54c3 (version=TLS1.2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256); Sat, 23 May 2020 04:01:27 GMT From: rcombs To: ffmpeg-devel@ffmpeg.org Date: Fri, 22 May 2020 23:01:22 -0500 Message-Id: <20200523040122.83476-2-rcombs@rcombs.me> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20200523040122.83476-1-rcombs@rcombs.me> References: <20200523040122.83476-1-rcombs@rcombs.me> MIME-Version: 1.0 Subject: [FFmpeg-devel] [PATCH 2/2] compat/cuda/ptx2c: fix BSD sed compatibility X-BeenThere: ffmpeg-devel@ffmpeg.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: FFmpeg development discussions and patches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: FFmpeg development discussions and patches Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" This fixes cross-compiling from macOS to other platforms --- compat/cuda/ptx2c.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/compat/cuda/ptx2c.sh b/compat/cuda/ptx2c.sh index 435a9b4b6c..c41875a2d4 100755 --- a/compat/cuda/ptx2c.sh +++ b/compat/cuda/ptx2c.sh @@ -28,7 +28,7 @@ NAME="$(basename "$IN" | sed 's/\..*//')" printf "const char %s_ptx[] = \\" "$NAME" > "$OUT" echo >> "$OUT" -sed -e 's/\r//g' -e 's/["\\]/\\&/g' -e 's/^[[:space:]]*/\t"/' -e 's/$/\\n"/' < "$IN" >> "$OUT" +sed -e $'s/\r//g' -e 's/["\\]/\\&/g' -e $'s/^[[:space:]]*/\t"/' -e 's/$/\\n"/' < "$IN" >> "$OUT" echo ";" >> "$OUT" exit 0