From: Rob Browning Date: Thu, 8 May 2014 18:44:11 +0000 (-0500) Subject: Write the system ARG_MAX to an autogenerated config.py at configure time. X-Git-Tag: 0.26-rc1~8 X-Git-Url: https://arthur.barton.de/cgi-bin/gitweb.cgi?a=commitdiff_plain;ds=sidebyside;h=b72365ad597edbc528da5b93528fc3a67a18d58e;p=bup.git Write the system ARG_MAX to an autogenerated config.py at configure time. Signed-off-by: Rob Browning --- diff --git a/.gitignore b/.gitignore index b5a261e..25184bf 100644 --- a/.gitignore +++ b/.gitignore @@ -1,6 +1,7 @@ /bup /cmd/bup-* /lib/bup/_version.py +/lib/bup/config.py randomgen memtest *.o diff --git a/Makefile b/Makefile index d8b19b5..599835f 100644 --- a/Makefile +++ b/Makefile @@ -174,7 +174,7 @@ clean: Documentation/clean config/clean .*~ *~ */*~ lib/*/*~ lib/*/*/*~ \ *.pyc */*.pyc lib/*/*.pyc lib/*/*/*.pyc \ bup bup-* cmd/bup-* lib/bup/_version.py randomgen memtest \ - testfs.img lib/bup/t/testfs.img + testfs.img lib/bup/t/testfs.img lib/bup/config.py if test -e t/mnt; then t/cleanup-mounts-under t/mnt; fi if test -e t/mnt; then rm -r t/mnt; fi if test -e t/tmp; then t/cleanup-mounts-under t/tmp; fi diff --git a/config/configure b/config/configure index d6156d2..e5f70dc 100755 --- a/config/configure +++ b/config/configure @@ -74,4 +74,22 @@ AC_CHECK_FIELD stat st_atimensec sys/types.h sys/stat.h unistd.h AC_CHECK_FIELD stat st_mtimensec sys/types.h sys/stat.h unistd.h AC_CHECK_FIELD stat st_ctimensec sys/types.h sys/stat.h unistd.h +cat > ../lib/bup/config.py <> ../lib/bup/config.py; then + AC_FAIL "ERROR: could not write to config.py." + fi + LOG " ($val_arg_max)" +fi + AC_OUTPUT config.vars diff --git a/lib/bup/t/tconfig.py b/lib/bup/t/tconfig.py new file mode 100644 index 0000000..1b5fbda --- /dev/null +++ b/lib/bup/t/tconfig.py @@ -0,0 +1,8 @@ +from helpers import readpipe +from wvtest import * +import config + + +@wvtest +def test_arg_max(): + WVPASSEQ(int(readpipe(['getconf', 'ARG_MAX'])), config.arg_max)