From 67b99eadbda0cbf96a3f7b89fcd8ab5f6c4058f6 Mon Sep 17 00:00:00 2001 From: Leonid Yuriev Date: Sun, 24 Jan 2021 03:17:52 +0300 Subject: [PATCH] mdbx-make: workaround for BSD's sed limitations. Resolves https://github.com/erthink/libmdbx/issues/156 Related to https://github.com/erthink/libmdbx/issues/155 Change-Id: I68da3f40b055da08a905525a4a31b44018d419b0 --- .github/actions/spelling/expect.txt | 1 + GNUmakefile | 8 +++++++- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/.github/actions/spelling/expect.txt b/.github/actions/spelling/expect.txt index 8b66f26f..ac8638c7 100644 --- a/.github/actions/spelling/expect.txt +++ b/.github/actions/spelling/expect.txt @@ -110,6 +110,7 @@ botanicus branchpage brisson brs +BSD's bsdi bsearch bswap diff --git a/GNUmakefile b/GNUmakefile index 4de6b817..5a0c7f00 100644 --- a/GNUmakefile +++ b/GNUmakefile @@ -325,9 +325,15 @@ dist/mdbx.h: mdbx.h src/version.c $(lastword $(MAKEFILE_LIST)) dist/mdbx.h++: mdbx.h++ src/version.c $(lastword $(MAKEFILE_LIST)) mkdir -p dist && cp $< $@ +# Macro with the new line (i.e. \n) for sed's pattern as the workaround for BSD's sed limitations +define NL + + +endef + dist/@tmp-shared_internals.inc: src/version.c $(ALLOY_DEPS) $(lastword $(MAKEFILE_LIST)) mkdir -p dist && sed \ - -e 's|#pragma once|#define MDBX_ALLOY 1\n#define MDBX_BUILD_SOURCERY $(MDBX_BUILD_SOURCERY)|' \ + -e 's|#pragma once|#define MDBX_ALLOY 1\$(NL)#define MDBX_BUILD_SOURCERY $(MDBX_BUILD_SOURCERY)|' \ -e 's|#include "../mdbx.h"|@INCLUDE "mdbx.h"|' \ -e '/#include "defs.h"/r src/defs.h' \ -e '/#include "osal.h"/r src/osal.h' \