Commit aa864d214249bc16b93a56dbdc1cac91fa276a46

Authored by Jay Berkenbilt
1 parent d1368a38

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.
Makefile
... ... @@ -97,12 +97,7 @@ $(foreach B,$(BUILD_ITEMS),$(eval \
97 97 clean_$(B): ; \
98 98 $(RM) -r $(B)/$(OUTPUT_DIR)))
99 99  
100   -AUTOFILES = configure aclocal.m4 libqpdf/qpdf/qpdf-config.h.in
101   -autofiles.zip: $(AUTOFILES)
102   - $(RM) autofiles.zip
103   - zip autofiles.zip $(AUTOFILES)
104   -
105   -DISTFILES = $(AUTOFILES) doc/qpdf-manual.html doc/qpdf-manual.pdf
  100 +DISTFILES = doc/qpdf-manual.html doc/qpdf-manual.pdf
106 101 distfiles.zip: $(DISTFILES)
107 102 $(RM) distfiles.zip
108 103 zip distfiles.zip $(DISTFILES)
... ... @@ -116,10 +111,9 @@ distclean: clean
116 111 $(RM) libqpdf.pc libqpdf.map
117 112  
118 113 maintainer-clean: distclean
119   - $(RM) configure doc/qpdf-manual.* libqpdf/qpdf/qpdf-config.h.in
120   - $(RM) aclocal.m4
121   - $(RM) -r install-mingw install-msvc external-libs
122   - $(RM) autofiles.zip distfiles.zip
  114 + $(RM) doc/qpdf-manual.*
  115 + $(RM) -r install-mingw* install-msvc* external-libs
  116 + $(RM) distfiles.zip
123 117  
124 118 .PHONY: $(TEST_TARGETS)
125 119  
... ...
README-maintainer
... ... @@ -269,10 +269,10 @@ If building or editing documentation, configure with
269 269 `--enable-doc-maintenance`. This will ensure that all tools or files
270 270 required to validate and build documentation are available.
271 271  
272   -If you want to run `make maintainer-clean`, `make distclean`, or `make
273   -autofiles.zip` and you haven't run `./configure`, you can pass
274   -`CLEAN=1` to make on the command line to prevent it from complaining
275   -about configure not having been run.
  272 +If you want to run `make maintainer-clean` or `make distclean` and you
  273 +haven't run `./configure`, you can pass `CLEAN=1` to make on the
  274 +command line to prevent it from complaining about configure not having
  275 +been run.
276 276  
277 277 If you want to run checks without rerunning the build, pass
278 278 `NO_REBUILD=1` to make. This can be useful for special testing
... ... @@ -283,10 +283,8 @@ LOCAL WINDOWS TESTING PROCEDURE
283 283  
284 284 This is what I do for routine testing on Windows.
285 285  
286   -From Linux, run `./autogen.sh` and `make autofiles.zip CLEAN=1`.
287   -
288   -From Windows, git clone from my Linux clone, unzip `external-libs`,
289   -and unzip `autofiles.zip`.
  286 +From Windows, git clone from my Linux clone, and unzip
  287 +`external-libs`.
290 288  
291 289 Look at `make_windows_releases`. Set up path the same way and run
292 290 whichever `./config-*` is appropriate for whichever compiler I need to
... ...
README-windows.md
... ... @@ -40,7 +40,7 @@ You can also download `qpdf-external-libs-src.zip` and follow the instructions i
40 40  
41 41 # Building from version control
42 42  
43   -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.
  43 +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.
44 44  
45 45 # Building with MinGW
46 46  
... ...
autogen.sh
1 1 #!/bin/sh
  2 +set -e
2 3 aclocal -I m4
3 4 autoheader
4 5 autoconf
  6 +md5sum configure.ac m4/* >| autofiles.sums
... ...
azure-pipelines/build-linux
... ... @@ -4,7 +4,6 @@ sudo apt-get update
4 4 sudo apt-get -y install \
5 5 autoconf build-essential zlib1g-dev libjpeg-dev \
6 6 docbook-xsl fop xsltproc libxml2-utils inkscape imagemagick
7   -./autogen.sh
8 7 ./configure --enable-werror --enable-doc-maintenance \
9 8 --enable-show-failed-test-output
10 9 make -j$(nproc)
... ...
configure.ac
... ... @@ -11,6 +11,22 @@ AC_CONFIG_FILES([libqpdf.pc])
11 11 AC_CONFIG_FILES([libqpdf.map])
12 12 AC_CONFIG_HEADERS([libqpdf/qpdf/qpdf-config.h])
13 13  
  14 +# Check to see if automatically generated files are outdated and if we
  15 +# can update them.
  16 +AC_CHECK_PROG(AUTOCONF,autoconf,1,0)
  17 +AC_CHECK_PROG(AUTOHEADER,autoheader,1,0)
  18 +AC_CHECK_PROG(ACLOCAL,aclocal,1,0)
  19 +AC_CHECK_PROG(MD5SUM,md5sum,1,0)
  20 +if test "$AUTOCONF$AUTOHEADER$ACLOCAL$MD5SUM" = "1111"; then
  21 + if ! md5sum configure.ac m4/* | diff - autofiles.sums; then
  22 + AC_MSG_ERROR(autofiles are autodated; rerun autogen.sh)
  23 + fi
  24 +fi
  25 +
  26 +if md5sum configure.ac m4/* | diff -q - autofiles.sums; then
  27 + echo "Automatically generated files are stale; rerun autogen.sh"
  28 +fi
  29 +
14 30 AC_PROG_CC
15 31 AC_PROG_CC_C99
16 32 AC_PROG_CXX
... ...
ispell-words
... ... @@ -111,7 +111,6 @@ auth
111 111 AuthEvent
112 112 autobuilder
113 113 autoconf
114   -autofiles
115 114 autogen
116 115 autoheader
117 116 autolabel
... ...