Skip to content

Commit 292cb5a

Browse files
committed
Add path information back to amalgamate.sh (Fixes simdjson#808)
1 parent fa4ce6a commit 292cb5a

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

singleheader/amalgamate.sh

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,12 +6,12 @@
66
set -e
77

88
SCRIPTPATH="$( cd "$(dirname "$0")" ; pwd -P )"
9-
9+
PROJECTPATH=$(realpath "$SCRIPTPATH/..");
1010
echo "We are about to amalgamate all simdjson files into one source file. "
1111
echo "See https://www.sqlite.org/amalgamation.html and https://en.wikipedia.org/wiki/Single_Compilation_Unit for rationale. "
1212

13-
if [ -z "$AMALGAMATE_SOURCE_PATH" ]; then AMALGAMATE_SOURCE_PATH="$SCRIPTPATH/../src"; fi
14-
if [ -z "$AMALGAMATE_INCLUDE_PATH" ]; then AMALGAMATE_INCLUDE_PATH="$SCRIPTPATH/../include"; fi
13+
if [ -z "$AMALGAMATE_SOURCE_PATH" ]; then AMALGAMATE_SOURCE_PATH=$(realpath "$SCRIPTPATH/../src"); fi
14+
if [ -z "$AMALGAMATE_INCLUDE_PATH" ]; then AMALGAMATE_INCLUDE_PATH=$(realpath "$SCRIPTPATH/../include"); fi
1515
if [ -z "$AMALGAMATE_OUTPUT_PATH" ]; then AMALGAMATE_OUTPUT_PATH="$SCRIPTPATH"; fi
1616

1717
# this list excludes the "src/generic headers"
@@ -66,8 +66,9 @@ function doinclude()
6666
function dofile()
6767
{
6868
file="$1/$2"
69+
RELFILE=${file#"$PROJECTPATH/"}
6970
# Last lines are always ignored. Files should end by an empty lines.
70-
echo "/* begin file ${2} */"
71+
echo "/* begin file $RELFILE */"
7172
# echo "#line 8 \"$1\"" ## redefining the line/file is not nearly as useful as it sounds for debugging. It breaks IDEs.
7273
while IFS= read -r line || [ -n "$line" ];
7374
do

0 commit comments

Comments
 (0)