Commit c9d11d70a739fa521c2adaebd0ae5b88e643eb78

Authored by Jay Berkenbilt
1 parent cd7c0bf3

Improve autofiles checksum check

autofiles.sums
1   -778da79a0593929b27db80016877d550 configure.ac
2   -d16a8e8947744745887520e331e59e39 m4/ax_random_device.m4
3   -2cc70ef55adb11e355f6e8c30dcab090 m4/libtool.m4
4   -064af1799febaa676203302bbf359180 m4/ltoptions.m4
5   -fa2891f9060865871cbbaa1c6e2d96f4 m4/ltsugar.m4
6   -d936fd6b2025c9b5322f826117d7f30c m4/ltversion.m4
7   -22aa295bf5320aec7fba6756ff11058a m4/lt~obsolete.m4
  1 +9e7830c08cda9f1ffcbc6e6cce79e58dd6d8de5f6b9a889067c816b23f463025 configure.ac
  2 +35bc5c645dc42d47f2daeea06f8f3e767c8a1aee6a35eb2b4854fd2ce66c3413 m4/ax_random_device.m4
  3 +37f8897d5f68d7d484e5457832a8f190ddb7507fa2a467cb7ee2be40a4364643 m4/libtool.m4
  4 +e77ebba8361b36f14b4d0927173a034b98c5d05049697a9ded84d85eb99a7990 m4/ltoptions.m4
  5 +5a6735cda60e0ba0d1b706c0ef648f5d096298da46daefd9cdecdb6a0f4584d3 m4/ltsugar.m4
  6 +a27b754709de61575197bf5a980696c98ae49da3f92f0de8ee7f42dd543b7465 m4/ltversion.m4
  7 +26fa3285c35dd6ab00ed1e466ba92a17e4655e01897731ec18a587a4cf5e4f8d m4/lt~obsolete.m4
... ...
autogen.sh
... ... @@ -3,4 +3,4 @@ set -e
3 3 aclocal -I m4
4 4 autoheader
5 5 autoconf
6   -md5sum configure.ac m4/* >| autofiles.sums
  6 +sha256sum configure.ac m4/* >| autofiles.sums
... ...
configure
... ... @@ -698,7 +698,7 @@ CPPFLAGS
698 698 LDFLAGS
699 699 CFLAGS
700 700 CC
701   -MD5SUM
  701 +SHA256SUM
702 702 ACLOCAL
703 703 AUTOHEADER
704 704 AUTOCONF
... ... @@ -2564,15 +2564,15 @@ $as_echo "no" >&6; }
2564 2564 fi
2565 2565  
2566 2566  
2567   -# Extract the first word of "md5sum", so it can be a program name with args.
2568   -set dummy md5sum; ac_word=$2
  2567 +# Extract the first word of "sha256sum", so it can be a program name with args.
  2568 +set dummy sha256sum; ac_word=$2
2569 2569 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
2570 2570 $as_echo_n "checking for $ac_word... " >&6; }
2571   -if ${ac_cv_prog_MD5SUM+:} false; then :
  2571 +if ${ac_cv_prog_SHA256SUM+:} false; then :
2572 2572 $as_echo_n "(cached) " >&6
2573 2573 else
2574   - if test -n "$MD5SUM"; then
2575   - ac_cv_prog_MD5SUM="$MD5SUM" # Let the user override the test.
  2574 + if test -n "$SHA256SUM"; then
  2575 + ac_cv_prog_SHA256SUM="$SHA256SUM" # Let the user override the test.
2576 2576 else
2577 2577 as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
2578 2578 for as_dir in $PATH
... ... @@ -2581,7 +2581,7 @@ do
2581 2581 test -z "$as_dir" && as_dir=.
2582 2582 for ac_exec_ext in '' $ac_executable_extensions; do
2583 2583 if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
2584   - ac_cv_prog_MD5SUM="1"
  2584 + ac_cv_prog_SHA256SUM="1"
2585 2585 $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
2586 2586 break 2
2587 2587 fi
... ... @@ -2589,21 +2589,21 @@ done
2589 2589 done
2590 2590 IFS=$as_save_IFS
2591 2591  
2592   - test -z "$ac_cv_prog_MD5SUM" && ac_cv_prog_MD5SUM="0"
  2592 + test -z "$ac_cv_prog_SHA256SUM" && ac_cv_prog_SHA256SUM="0"
2593 2593 fi
2594 2594 fi
2595   -MD5SUM=$ac_cv_prog_MD5SUM
2596   -if test -n "$MD5SUM"; then
2597   - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MD5SUM" >&5
2598   -$as_echo "$MD5SUM" >&6; }
  2595 +SHA256SUM=$ac_cv_prog_SHA256SUM
  2596 +if test -n "$SHA256SUM"; then
  2597 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $SHA256SUM" >&5
  2598 +$as_echo "$SHA256SUM" >&6; }
2599 2599 else
2600 2600 { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
2601 2601 $as_echo "no" >&6; }
2602 2602 fi
2603 2603  
2604 2604  
2605   -if test "$AUTOCONF$AUTOHEADER$ACLOCAL$MD5SUM" = "1111"; then
2606   - if ! md5sum configure.ac m4/* | diff -w - autofiles.sums; then
  2605 +if test "$AUTOCONF$AUTOHEADER$ACLOCAL$SHA256SUM" = "1111"; then
  2606 + if ! sha256sum -c autofiles.sums; then
2607 2607 as_fn_error $? "autofiles are autodated; rerun autogen.sh" "$LINENO" 5
2608 2608 fi
2609 2609 fi
... ...
configure.ac
... ... @@ -16,9 +16,9 @@ AC_CONFIG_HEADERS([libqpdf/qpdf/qpdf-config.h])
16 16 AC_CHECK_PROG(AUTOCONF,autoconf,1,0)
17 17 AC_CHECK_PROG(AUTOHEADER,autoheader,1,0)
18 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 -w - autofiles.sums; then
  19 +AC_CHECK_PROG(SHA256SUM,sha256sum,1,0)
  20 +if test "$AUTOCONF$AUTOHEADER$ACLOCAL$SHA256SUM" = "1111"; then
  21 + if ! sha256sum -c autofiles.sums; then
22 22 AC_MSG_ERROR(autofiles are autodated; rerun autogen.sh)
23 23 fi
24 24 fi
... ...