Revert "Move closer to the standard autotools idiom. (#3187)" (#3255)
Before adoption: this commit came in with the history the project adopted, so no landing records it.
This partially reverts commit d8463c25491b6150d748155ac530a3205d072e37. Revert reason: version string should be updated more often.
authored by itchyny · committed by GitHub · parent aea8efa · Browse files · 4 files·+27 added−11 removed
This commit
State
Before adoption: this commit came in with the history the project adopted, so no landing records it.
Diff stats
4 files+27 added−11 removed
- other:+27 added−11 removed
Provenance
- Commit
abde27d- Tree
f39e3f8- Author
itchyny <itchyny@cybozu.co.jp>- Committer
GitHub <noreply@github.com>- Parent
aea8efa
4 files changed+27 added−11 removed
modified:src/main.c+2 added
31 unmodified lines32 33 #include "jv.h"34 #include "jq.h"35 #include "util.h"36+#include "src/version.h"37+#include "src/config_opts.inc"38 39 int jq_testsuite(jv lib_dirs, int verbose, int argc, char* argv[]);40 41 /*666 unmodified linesmodified:.gitignore+3 added-2 removed
16 unmodified lines17 jq.118 19 # Generated source20 src/builtin.inc21-src/config.h.in22-src/config.h21+src/config_opts.inc22 *.pc23 24 # Autotools junk25 .libs13 unmodified lines39 jq-*.zip40 configure41 aclocal.m442 Makefile.in43+version.h44+.remake-version-h45 config.cache46 *.rpm47 m4/libtool.m448 m4/ltoptions.m412 unmodified linesmodified:configure.ac-5 removed
234 unmodified lines235 AC_MSG_ERROR(unknown endianness),236 AC_MSG_ERROR(universal endianness not supported)237 )238 239-AC_DEFINE_UNQUOTED([JQ_CONFIG], ["$ac_cs_config"], [The options jq was configured with.])240-AH_BOTTOM([#define JQ_VERSION PACKAGE_VERSION])241-239 dnl Oniguruma240 AC_ARG_WITH([oniguruma],241 [AS_HELP_STRING([--with-oniguruma=prefix],242 [try this for a non-standard install prefix of the oniguruma library])], ,40 unmodified lines283 AM_CONDITIONAL([BUILD_ONIGURUMA], [test "x$build_oniguruma" = xyes])284 AM_CONDITIONAL([WITH_ONIGURUMA], [test "x$with_oniguruma" != xno])285 286 AC_CONFIG_MACRO_DIRS([config/m4 m4])290-AC_CONFIG_HEADERS([src/config.h])291-CFLAGS="$CFLAGS --include src/config.h"287 AC_CONFIG_FILES([Makefile libjq.pc])288 AC_OUTPUT289 modified:Makefile.am+22 added-4 removed
32 unmodified lines33 # While there is some autoconf macro support for lex/flex, it doesn't support34 # header file creation so we'll use good old make35 if MAINTAINER_MODE36 BUILT_SOURCES = src/lexer.h src/lexer.c src/parser.h src/parser.c \37- src/builtin.inc37+ src/builtin.inc src/config_opts.inc src/version.h38 src/lexer.c: src/lexer.l39 $(AM_V_LEX) flex -o src/lexer.c --header-file=src/lexer.h $<40 src/lexer.h: src/lexer.c41 else42-BUILT_SOURCES = src/builtin.inc42+BUILT_SOURCES = src/builtin.inc src/config_opts.inc src/version.h43 .y.c:44 $(AM_V_YACC) echo "NOT building parser.c!"45 .l.c:46 $(AM_V_LEX) echo "NOT building lexer.c!"48 unmodified lines95 endif96 97 ### Building the jq binary98 99+# Remake the version.h header file if, and only if, the git ID has changed100+.PHONY: .FORCE101+.FORCE:102+generate_ver = ver="`{ $(srcdir)/scripts/version || echo '$(VERSION)' ; } | sed 's/.*/\x23define JQ_VERSION \"&\"/'`"103+.remake-version-h: .FORCE104+ @ $(generate_ver); test "x`cat src/version.h 2>/dev/null`" = "x$$ver" || touch .remake-version-h105+src/version.h: .remake-version-h106+ mkdir -p src107+ $(AM_V_GEN) $(generate_ver); echo "$$ver" > $@108+src/config_opts.inc:109+ mkdir -p src110+ $(AM_V_GEN) if test -x ./config.status; then \111+ ./config.status --config; \112+ else echo "(unknown)"; \113+ fi | sed -e 's/\\/\\\\/g' -e 's/"/\\"/g' -e 's/^/"/' -e 's/$$/"/' -e 's/^/#define JQ_CONFIG /' > $@114+src/main.c: src/version.h src/config_opts.inc115+116 src/builtin.inc: $(srcdir)/src/builtin.jq117 mkdir -p src118 $(AM_V_GEN) od -v -A n -t o1 -- $< | \119 sed -e 's/$$/ /' \2 unmodified lines122 -e 's/ 0/ 0/g' \123 -e 's/ \([123456789]\)/ 0\1/g' > $@124 src/builtin.o: src/builtin.inc125 109-CLEANFILES = src/builtin.inc126+CLEANFILES = src/version.h .remake-version-h src/builtin.inc src/config_opts.inc127 128 bin_PROGRAMS = jq129 jq_SOURCES = src/main.c130 jq_LDADD = libjq.la -lm82 unmodified lines213 docs/validate_manual_schema.py docs/manual_schema.yml214 215 EXTRA_DIST = $(DOC_FILES) $(man_MANS) $(TESTS) $(TEST_LOG_COMPILER) \216 jq.1.prebuilt jq.spec src/lexer.c src/lexer.h src/parser.c \200- src/parser.h src/builtin.jq scripts/version libjq.pc \217+ src/parser.h src/version.h src/builtin.jq scripts/version \218+ libjq.pc \219 tests/modules/a.jq tests/modules/b/b.jq tests/modules/c/c.jq \220 tests/modules/c/d.jq tests/modules/data.json \221 tests/modules/home1/.jq tests/modules/home2/.jq/g.jq \222 tests/modules/lib/jq/e/e.jq tests/modules/lib/jq/f.jq \30 unmodified lines