mirror of
https://github.com/jqlang/jq.git
synced 2026-10-11 21:49:50 +00:00
* Create `src/config.h` instead of passing everything on the compiler command line. * To reduce the magnitude of this change, add `--include src/config.h` to CFLAGS instead of adding `#include "src/config.h"` at the top of each source file. Not all compilers support this, but I don't think we care about anything other than gcc and clang at this point. * Rather than generate `src/config_opts.inc`, emit `JQ_CONFIG` directly into `src/config.h`. * Rather than generate `src/version.h`, define `JQ_VERSION` as an alias for the standard `PACKAGE_VERSION`.
14 lines
313 B
Bash
Executable File
14 lines
313 B
Bash
Executable File
#!/bin/sh
|
|
set -eu
|
|
|
|
cd "$(dirname "$0")/../"
|
|
test -e .git || exit 1
|
|
|
|
if git describe --tags --match 'jq-*' >/dev/null 2>&1; then
|
|
git describe --tags --match 'jq-*' --dirty | sed 's/^jq-//'
|
|
else
|
|
branch=$(git rev-parse --abbrev-ref HEAD)
|
|
commit=$(git describe --always --dirty)
|
|
echo "${branch}-${commit}"
|
|
fi
|