From 292cb5a5af04cc60293eacaac1153d28ea83c804 Mon Sep 17 00:00:00 2001 From: Furkan Usta Date: Sat, 2 May 2020 17:59:15 +0300 Subject: [PATCH] Add path information back to amalgamate.sh (Fixes #808) --- singleheader/amalgamate.sh | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/singleheader/amalgamate.sh b/singleheader/amalgamate.sh index 5459dd5e..b7e125b4 100755 --- a/singleheader/amalgamate.sh +++ b/singleheader/amalgamate.sh @@ -6,12 +6,12 @@ set -e SCRIPTPATH="$( cd "$(dirname "$0")" ; pwd -P )" - +PROJECTPATH=$(realpath "$SCRIPTPATH/.."); echo "We are about to amalgamate all simdjson files into one source file. " echo "See https://www.sqlite.org/amalgamation.html and https://en.wikipedia.org/wiki/Single_Compilation_Unit for rationale. " -if [ -z "$AMALGAMATE_SOURCE_PATH" ]; then AMALGAMATE_SOURCE_PATH="$SCRIPTPATH/../src"; fi -if [ -z "$AMALGAMATE_INCLUDE_PATH" ]; then AMALGAMATE_INCLUDE_PATH="$SCRIPTPATH/../include"; fi +if [ -z "$AMALGAMATE_SOURCE_PATH" ]; then AMALGAMATE_SOURCE_PATH=$(realpath "$SCRIPTPATH/../src"); fi +if [ -z "$AMALGAMATE_INCLUDE_PATH" ]; then AMALGAMATE_INCLUDE_PATH=$(realpath "$SCRIPTPATH/../include"); fi if [ -z "$AMALGAMATE_OUTPUT_PATH" ]; then AMALGAMATE_OUTPUT_PATH="$SCRIPTPATH"; fi # this list excludes the "src/generic headers" @@ -66,8 +66,9 @@ function doinclude() function dofile() { file="$1/$2" + RELFILE=${file#"$PROJECTPATH/"} # Last lines are always ignored. Files should end by an empty lines. - echo "/* begin file ${2} */" + echo "/* begin file $RELFILE */" # echo "#line 8 \"$1\"" ## redefining the line/file is not nearly as useful as it sounds for debugging. It breaks IDEs. while IFS= read -r line || [ -n "$line" ]; do