aaaaaa123456789 / libplum

Image-handling library that allows reading and writing common image file formats
The Unlicense
11 stars 5 forks source link

merge.sh fails on macOS #16

Open Rangi42 opened 6 days ago

Rangi42 commented 6 days ago
% make
mkdir -p build
./merge.sh header/libplum.h > build/libplum.h
./merge.sh: line 4: declare: -A: invalid option
declare: usage: declare [-afFirtx] [-p] [name[=value] ...]
make: *** [build/libplum.h] Error 2

Can this feasibly use POSIX sh?

aaaaaa123456789 commented 5 days ago

I don't know enough about shell scripting to be able to tell offhand — can it be done? merge.sh is a fairly short self-contained script; if you can rewrite it to use POSIX sh, go for it.

The goal of the script is simple: given one or more input files (as command-line arguments), concatenate them into one large output file, copying any files included by #include "foo" (but not #include <foo>) into the output the first time (and only the first time) the filename is encountered. Note that all #include "foo" statements are stripped by the copy process (the first time, the statement is replaced by the file; subsequent ones for the same file are just skipped).