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
This commit is contained in:
Leonid Yuriev 2021-01-24 03:17:52 +03:00
parent 95ae324580
commit 67b99eadbd
2 changed files with 8 additions and 1 deletions

View File

@ -110,6 +110,7 @@ botanicus
branchpage
brisson
brs
BSD's
bsdi
bsearch
bswap

View File

@ -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' \