aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJay Berkenbilt <ejb@ql.org>2018-10-11 23:23:31 +0200
committerJay Berkenbilt <ejb@ql.org>2018-10-11 23:27:54 +0200
commitaa864d214249bc16b93a56dbdc1cac91fa276a46 (patch)
treef7f9753040607b5ebe9a5c465b6ea45a68694933
parentd1368a38516726e0891660696e86585ad37bf55e (diff)
downloadqpdf-aa864d214249bc16b93a56dbdc1cac91fa276a46.tar.zst
Automatically detect outdated generated files
Update documentation to reflect that automatically generated files are committed. Detect when they are outdated if we have the ability to regenerate them.
-rw-r--r--Makefile14
-rw-r--r--README-maintainer14
-rw-r--r--README-windows.md2
-rwxr-xr-xautogen.sh2
-rwxr-xr-xazure-pipelines/build-linux1
-rw-r--r--configure.ac16
-rw-r--r--ispell-words1
7 files changed, 29 insertions, 21 deletions
diff --git a/Makefile b/Makefile
index 17cae493..414430ea 100644
--- a/Makefile
+++ b/Makefile
@@ -97,12 +97,7 @@ $(foreach B,$(BUILD_ITEMS),$(eval \
clean_$(B): ; \
$(RM) -r $(B)/$(OUTPUT_DIR)))
-AUTOFILES = configure aclocal.m4 libqpdf/qpdf/qpdf-config.h.in
-autofiles.zip: $(AUTOFILES)
- $(RM) autofiles.zip
- zip autofiles.zip $(AUTOFILES)
-
-DISTFILES = $(AUTOFILES) doc/qpdf-manual.html doc/qpdf-manual.pdf
+DISTFILES = doc/qpdf-manual.html doc/qpdf-manual.pdf
distfiles.zip: $(DISTFILES)
$(RM) distfiles.zip
zip distfiles.zip $(DISTFILES)
@@ -116,10 +111,9 @@ distclean: clean
$(RM) libqpdf.pc libqpdf.map
maintainer-clean: distclean
- $(RM) configure doc/qpdf-manual.* libqpdf/qpdf/qpdf-config.h.in
- $(RM) aclocal.m4
- $(RM) -r install-mingw install-msvc external-libs
- $(RM) autofiles.zip distfiles.zip
+ $(RM) doc/qpdf-manual.*
+ $(RM) -r install-mingw* install-msvc* external-libs
+ $(RM) distfiles.zip
.PHONY: $(TEST_TARGETS)
diff --git a/README-maintainer b/README-maintainer
index 69f5116b..2f52aa68 100644
--- a/README-maintainer
+++ b/README-maintainer
@@ -269,10 +269,10 @@ If building or editing documentation, configure with
`--enable-doc-maintenance`. This will ensure that all tools or files
required to validate and build documentation are available.
-If you want to run `make maintainer-clean`, `make distclean`, or `make
-autofiles.zip` and you haven't run `./configure`, you can pass
-`CLEAN=1` to make on the command line to prevent it from complaining
-about configure not having been run.
+If you want to run `make maintainer-clean` or `make distclean` and you
+haven't run `./configure`, you can pass `CLEAN=1` to make on the
+command line to prevent it from complaining about configure not having
+been run.
If you want to run checks without rerunning the build, pass
`NO_REBUILD=1` to make. This can be useful for special testing
@@ -283,10 +283,8 @@ LOCAL WINDOWS TESTING PROCEDURE
This is what I do for routine testing on Windows.
-From Linux, run `./autogen.sh` and `make autofiles.zip CLEAN=1`.
-
-From Windows, git clone from my Linux clone, unzip `external-libs`,
-and unzip `autofiles.zip`.
+From Windows, git clone from my Linux clone, and unzip
+`external-libs`.
Look at `make_windows_releases`. Set up path the same way and run
whichever `./config-*` is appropriate for whichever compiler I need to
diff --git a/README-windows.md b/README-windows.md
index 87bebc2b..471e773c 100644
--- a/README-windows.md
+++ b/README-windows.md
@@ -40,7 +40,7 @@ You can also download `qpdf-external-libs-src.zip` and follow the instructions i
# Building from version control
-If you check out qpdf from version control, you will not have the files that are generated by autoconf. If you are not changing these files, you can grab them from a source distribution or create them from a system that has autoconf. To create them from scratch, run `./autogen.sh` on a system that has autoconf installed. Once you have them, you can run `make CLEAN=1 autofiles.zip`. This will create an autofiles.zip that you can extract on top of a fresh checkout.
+If you check out qpdf from version control, documentation files will not be generated or installed. Documentation files are included in the source distribution, but they can only be built from Linux.
# Building with MinGW
diff --git a/autogen.sh b/autogen.sh
index f6a3afbd..48ac0d37 100755
--- a/autogen.sh
+++ b/autogen.sh
@@ -1,4 +1,6 @@
#!/bin/sh
+set -e
aclocal -I m4
autoheader
autoconf
+md5sum configure.ac m4/* >| autofiles.sums
diff --git a/azure-pipelines/build-linux b/azure-pipelines/build-linux
index 89be3c6b..250469a3 100755
--- a/azure-pipelines/build-linux
+++ b/azure-pipelines/build-linux
@@ -4,7 +4,6 @@ sudo apt-get update
sudo apt-get -y install \
autoconf build-essential zlib1g-dev libjpeg-dev \
docbook-xsl fop xsltproc libxml2-utils inkscape imagemagick
-./autogen.sh
./configure --enable-werror --enable-doc-maintenance \
--enable-show-failed-test-output
make -j$(nproc)
diff --git a/configure.ac b/configure.ac
index 199feeed..afef1958 100644
--- a/configure.ac
+++ b/configure.ac
@@ -11,6 +11,22 @@ AC_CONFIG_FILES([libqpdf.pc])
AC_CONFIG_FILES([libqpdf.map])
AC_CONFIG_HEADERS([libqpdf/qpdf/qpdf-config.h])
+# Check to see if automatically generated files are outdated and if we
+# can update them.
+AC_CHECK_PROG(AUTOCONF,autoconf,1,0)
+AC_CHECK_PROG(AUTOHEADER,autoheader,1,0)
+AC_CHECK_PROG(ACLOCAL,aclocal,1,0)
+AC_CHECK_PROG(MD5SUM,md5sum,1,0)
+if test "$AUTOCONF$AUTOHEADER$ACLOCAL$MD5SUM" = "1111"; then
+ if ! md5sum configure.ac m4/* | diff - autofiles.sums; then
+ AC_MSG_ERROR(autofiles are autodated; rerun autogen.sh)
+ fi
+fi
+
+if md5sum configure.ac m4/* | diff -q - autofiles.sums; then
+ echo "Automatically generated files are stale; rerun autogen.sh"
+fi
+
AC_PROG_CC
AC_PROG_CC_C99
AC_PROG_CXX
diff --git a/ispell-words b/ispell-words
index e310cf36..9e8a63e1 100644
--- a/ispell-words
+++ b/ispell-words
@@ -111,7 +111,6 @@ auth
AuthEvent
autobuilder
autoconf
-autofiles
autogen
autoheader
autolabel