From 9aa15a645560393eee20fc85a6f6e2e42dc8e535 Mon Sep 17 00:00:00 2001 From: Cory Fields Date: Thu, 24 Sep 2015 14:10:43 -0400 Subject: [PATCH 1/7] build: move installed files to build-aux Rather than cluttering up the repo root. --- Makefile.am | 1 + build-aux/m4/.empty | 0 configure.ac | 4 +++- 3 files changed, 4 insertions(+), 1 deletion(-) create mode 100644 build-aux/m4/.empty diff --git a/Makefile.am b/Makefile.am index 16b59286a8fce..e49587a252406 100644 --- a/Makefile.am +++ b/Makefile.am @@ -1,3 +1,4 @@ +ACLOCAL_AMFLAGS = -I build-aux/m4 SUBDIRS = lib test diff --git a/build-aux/m4/.empty b/build-aux/m4/.empty new file mode 100644 index 0000000000000..e69de29bb2d1d diff --git a/configure.ac b/configure.ac index 74c97922218b8..c4a0ce4407663 100644 --- a/configure.ac +++ b/configure.ac @@ -19,8 +19,10 @@ AC_INIT([univalue], [1.0.0], AC_PREREQ(2.60) AC_CONFIG_SRCDIR([lib/univalue.cpp]) -AM_INIT_AUTOMAKE([gnu]) +AC_CONFIG_AUX_DIR([build-aux]) +AC_CONFIG_MACRO_DIR([build-aux/m4]) AC_CONFIG_HEADERS([univalue-config.h]) +AM_INIT_AUTOMAKE([gnu]) LIBUNIVALUE_MAJOR_VERSION=libunivalue_major_version LIBUNIVALUE_MINOR_VERSION=libunivalue_minor_version From 0b391ebb7eb81956c6c5c0d8626001ddd8008fb9 Mon Sep 17 00:00:00 2001 From: Cory Fields Date: Thu, 24 Sep 2015 14:12:52 -0400 Subject: [PATCH 2/7] build: Don't require old gnu-style files --- AUTHORS | 5 ----- ChangeLog | 3 --- NEWS | 4 ---- configure.ac | 2 +- 4 files changed, 1 insertion(+), 13 deletions(-) delete mode 100644 AUTHORS delete mode 100644 ChangeLog delete mode 100644 NEWS diff --git a/AUTHORS b/AUTHORS deleted file mode 100644 index 638b22cbeaa49..0000000000000 --- a/AUTHORS +++ /dev/null @@ -1,5 +0,0 @@ -Tests from MIT-licensed "vjson" - -See git log for remaining author details. -(placeholder GNU file required by automake) - diff --git a/ChangeLog b/ChangeLog deleted file mode 100644 index 808ff3bb69905..0000000000000 --- a/ChangeLog +++ /dev/null @@ -1,3 +0,0 @@ -See git log. -(placeholder GNU file required by automake) - diff --git a/NEWS b/NEWS deleted file mode 100644 index 3dda3fc42faa3..0000000000000 --- a/NEWS +++ /dev/null @@ -1,4 +0,0 @@ - -See git log. -(placeholder GNU file required by automake) - diff --git a/configure.ac b/configure.ac index c4a0ce4407663..03cb5260e8c1c 100644 --- a/configure.ac +++ b/configure.ac @@ -22,7 +22,7 @@ AC_CONFIG_SRCDIR([lib/univalue.cpp]) AC_CONFIG_AUX_DIR([build-aux]) AC_CONFIG_MACRO_DIR([build-aux/m4]) AC_CONFIG_HEADERS([univalue-config.h]) -AM_INIT_AUTOMAKE([gnu]) +AM_INIT_AUTOMAKE([foreign]) LIBUNIVALUE_MAJOR_VERSION=libunivalue_major_version LIBUNIVALUE_MINOR_VERSION=libunivalue_minor_version From e450ac495dc4e3f9807c732d6deb03f2e8727908 Mon Sep 17 00:00:00 2001 From: Cory Fields Date: Thu, 24 Sep 2015 14:13:57 -0400 Subject: [PATCH 3/7] build: use glibtoolize if possible Needed on some BSDs --- autogen.sh | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/autogen.sh b/autogen.sh index 5b883a6a4c070..4b38721faad09 100755 --- a/autogen.sh +++ b/autogen.sh @@ -2,4 +2,8 @@ set -e srcdir="$(dirname $0)" cd "$srcdir" +if [ -z ${LIBTOOLIZE} ] && GLIBTOOLIZE="`which glibtoolize 2>/dev/null`"; then + LIBTOOLIZE="${GLIBTOOLIZE}" + export LIBTOOLIZE +fi autoreconf --install --force From 51f051d3fc111329916e93f1403905f46aae71e7 Mon Sep 17 00:00:00 2001 From: Cory Fields Date: Thu, 24 Sep 2015 14:15:23 -0400 Subject: [PATCH 4/7] build: Drop a bunch of unnecessary or duped checks --- configure.ac | 17 +---------------- 1 file changed, 1 insertion(+), 16 deletions(-) diff --git a/configure.ac b/configure.ac index 03cb5260e8c1c..ddafc91dc12de 100644 --- a/configure.ac +++ b/configure.ac @@ -40,22 +40,7 @@ AC_SUBST(LIBUNIVALUE_REVISION) AC_SUBST(LIBUNIVALUE_AGE) LT_INIT - -AC_PROG_CXX -AC_PROG_CC -AC_PROG_CPP -AC_PROG_CXXCPP -AC_PROG_INSTALL -AC_PROG_OBJC -AC_PROG_LN_S -AC_PROG_MKDIR_P -AC_PROG_SED -AC_PATH_TOOL(AR, ar) -AC_PATH_TOOL(RANLIB, ranlib) -AC_PATH_TOOL(STRIP, strip) -PKG_PROG_PKG_CONFIG - -AC_LANG_PUSH([C++]) +LT_LANG([C++]) AC_CONFIG_FILES([ lib/Makefile From 1ef5d635b2e72d87b279ae1eb8ce6d513fa632ef Mon Sep 17 00:00:00 2001 From: Cory Fields Date: Thu, 24 Sep 2015 14:15:45 -0400 Subject: [PATCH 5/7] build: enable silent rules by default --- configure.ac | 3 +++ 1 file changed, 3 insertions(+) diff --git a/configure.ac b/configure.ac index ddafc91dc12de..2a1b51059f033 100644 --- a/configure.ac +++ b/configure.ac @@ -17,6 +17,9 @@ m4_define([libunivalue_version], [libunivalue_major_version().libunivalue_minor_ AC_INIT([univalue], [1.0.0], [http://github.com/jgarzik/univalue/]) +dnl make the compilation flags quiet unless V=1 is used +m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])]) + AC_PREREQ(2.60) AC_CONFIG_SRCDIR([lib/univalue.cpp]) AC_CONFIG_AUX_DIR([build-aux]) From c3c41189893fdb12167efe59133d891ee593113f Mon Sep 17 00:00:00 2001 From: Cory Fields Date: Thu, 24 Sep 2015 14:25:55 -0400 Subject: [PATCH 6/7] build: Don't use a SUBDIR for the lib build --- Makefile.am | 19 ++++++++++++++++++- configure.ac | 3 +-- lib/Makefile.am | 18 ------------------ 3 files changed, 19 insertions(+), 21 deletions(-) delete mode 100644 lib/Makefile.am diff --git a/Makefile.am b/Makefile.am index e49587a252406..b11ca18a991b0 100644 --- a/Makefile.am +++ b/Makefile.am @@ -1,4 +1,21 @@ ACLOCAL_AMFLAGS = -I build-aux/m4 -SUBDIRS = lib test +include_HEADERS = lib/univalue.h lib/univalue_escapes.h + +lib_LTLIBRARIES = lib/libunivalue.la + +lib_libunivalue_la_SOURCES = \ + lib/univalue.cpp \ + lib/univalue_read.cpp \ + lib/univalue_write.cpp + +lib_libunivalue_la_LDFLAGS = \ + -version-info $(LIBUNIVALUE_CURRENT):$(LIBUNIVALUE_REVISION):$(LIBUNIVALUE_AGE) \ + -no-undefined + +noinst_PROGRAMS = lib/gen + +lib_gen_SOURCES = lib/gen.cpp + +SUBDIRS = . test diff --git a/configure.ac b/configure.ac index 2a1b51059f033..24af5cae8fff8 100644 --- a/configure.ac +++ b/configure.ac @@ -25,7 +25,7 @@ AC_CONFIG_SRCDIR([lib/univalue.cpp]) AC_CONFIG_AUX_DIR([build-aux]) AC_CONFIG_MACRO_DIR([build-aux/m4]) AC_CONFIG_HEADERS([univalue-config.h]) -AM_INIT_AUTOMAKE([foreign]) +AM_INIT_AUTOMAKE([subdir-objects foreign]) LIBUNIVALUE_MAJOR_VERSION=libunivalue_major_version LIBUNIVALUE_MINOR_VERSION=libunivalue_minor_version @@ -46,7 +46,6 @@ LT_INIT LT_LANG([C++]) AC_CONFIG_FILES([ - lib/Makefile test/Makefile Makefile lib/libunivalue.pc diff --git a/lib/Makefile.am b/lib/Makefile.am deleted file mode 100644 index aa4a134e5c35d..0000000000000 --- a/lib/Makefile.am +++ /dev/null @@ -1,18 +0,0 @@ - -include_HEADERS = univalue.h univalue_escapes.h - -lib_LTLIBRARIES = libunivalue.la - -libunivalue_la_SOURCES = \ - univalue.cpp \ - univalue_read.cpp \ - univalue_write.cpp - -libunivalue_la_LDFLAGS = \ - -version-info $(LIBUNIVALUE_CURRENT):$(LIBUNIVALUE_REVISION):$(LIBUNIVALUE_AGE) \ - -no-undefined - -noinst_PROGRAMS = gen - -gen_SOURCES = gen.cpp - From 650213418415efa536bff7216a000d654826a249 Mon Sep 17 00:00:00 2001 From: Cory Fields Date: Thu, 24 Sep 2015 14:45:40 -0400 Subject: [PATCH 7/7] build: don't use a SUBDIR for the test build --- Makefile.am | 50 ++++++++++++++++++++++++++++++++++++++++++++++-- configure.ac | 1 - test/Makefile.am | 48 ---------------------------------------------- 3 files changed, 48 insertions(+), 51 deletions(-) delete mode 100644 test/Makefile.am diff --git a/Makefile.am b/Makefile.am index b11ca18a991b0..8419ef643b11d 100644 --- a/Makefile.am +++ b/Makefile.am @@ -13,9 +13,55 @@ lib_libunivalue_la_LDFLAGS = \ -version-info $(LIBUNIVALUE_CURRENT):$(LIBUNIVALUE_REVISION):$(LIBUNIVALUE_AGE) \ -no-undefined -noinst_PROGRAMS = lib/gen +TESTS = test/unitester + +noinst_PROGRAMS = lib/gen $(TESTS) lib_gen_SOURCES = lib/gen.cpp -SUBDIRS = . test +TEST_DATA_DIR=test + +test_unitester_SOURCES = test/unitester.cpp +test_unitester_LDADD = lib/libunivalue.la +test_unitester_CXXFLAGS = -I$(top_srcdir)/lib -DJSON_TEST_SRC=\"$(srcdir)/$(TEST_DATA_DIR)\" + +TEST_FILES = \ + $(TEST_DATA_DIR)/fail10.json \ + $(TEST_DATA_DIR)/fail11.json \ + $(TEST_DATA_DIR)/fail12.json \ + $(TEST_DATA_DIR)/fail13.json \ + $(TEST_DATA_DIR)/fail14.json \ + $(TEST_DATA_DIR)/fail15.json \ + $(TEST_DATA_DIR)/fail16.json \ + $(TEST_DATA_DIR)/fail17.json \ + $(TEST_DATA_DIR)/fail18.json \ + $(TEST_DATA_DIR)/fail19.json \ + $(TEST_DATA_DIR)/fail1.json \ + $(TEST_DATA_DIR)/fail20.json \ + $(TEST_DATA_DIR)/fail21.json \ + $(TEST_DATA_DIR)/fail22.json \ + $(TEST_DATA_DIR)/fail23.json \ + $(TEST_DATA_DIR)/fail24.json \ + $(TEST_DATA_DIR)/fail25.json \ + $(TEST_DATA_DIR)/fail26.json \ + $(TEST_DATA_DIR)/fail27.json \ + $(TEST_DATA_DIR)/fail28.json \ + $(TEST_DATA_DIR)/fail29.json \ + $(TEST_DATA_DIR)/fail2.json \ + $(TEST_DATA_DIR)/fail30.json \ + $(TEST_DATA_DIR)/fail31.json \ + $(TEST_DATA_DIR)/fail32.json \ + $(TEST_DATA_DIR)/fail33.json \ + $(TEST_DATA_DIR)/fail34.json \ + $(TEST_DATA_DIR)/fail3.json \ + $(TEST_DATA_DIR)/fail4.json \ + $(TEST_DATA_DIR)/fail5.json \ + $(TEST_DATA_DIR)/fail6.json \ + $(TEST_DATA_DIR)/fail7.json \ + $(TEST_DATA_DIR)/fail8.json \ + $(TEST_DATA_DIR)/fail9.json \ + $(TEST_DATA_DIR)/pass1.json \ + $(TEST_DATA_DIR)/pass2.json \ + $(TEST_DATA_DIR)/pass3.json +EXTRA_DIST=$(TEST_FILES) diff --git a/configure.ac b/configure.ac index 24af5cae8fff8..9c423f004b7e1 100644 --- a/configure.ac +++ b/configure.ac @@ -46,7 +46,6 @@ LT_INIT LT_LANG([C++]) AC_CONFIG_FILES([ - test/Makefile Makefile lib/libunivalue.pc lib/libunivalue-uninstalled.pc]) diff --git a/test/Makefile.am b/test/Makefile.am deleted file mode 100644 index 88969754644a2..0000000000000 --- a/test/Makefile.am +++ /dev/null @@ -1,48 +0,0 @@ - -TESTS = unitester - -noinst_PROGRAMS = unitester - -unitester_SOURCES = unitester.cpp -unitester_LDADD = ../lib/libunivalue.la -unitester_CXXFLAGS = -I$(top_srcdir)/lib -DJSON_TEST_SRC=\"$(top_srcdir)/test\" - -EXTRA_DIST = \ - fail10.json \ - fail11.json \ - fail12.json \ - fail13.json \ - fail14.json \ - fail15.json \ - fail16.json \ - fail17.json \ - fail18.json \ - fail19.json \ - fail1.json \ - fail20.json \ - fail21.json \ - fail22.json \ - fail23.json \ - fail24.json \ - fail25.json \ - fail26.json \ - fail27.json \ - fail28.json \ - fail29.json \ - fail2.json \ - fail30.json \ - fail31.json \ - fail32.json \ - fail33.json \ - fail34.json \ - fail3.json \ - fail4.json \ - fail5.json \ - fail6.json \ - fail7.json \ - fail8.json \ - fail9.json \ - pass1.json \ - pass2.json \ - pass3.json -