diff options
Diffstat (limited to 'm4')
-rw-r--r-- | m4/ChangeLog | 5 | ||||
-rw-r--r-- | m4/tar-ustar.m4 | 43 |
2 files changed, 48 insertions, 0 deletions
diff --git a/m4/ChangeLog b/m4/ChangeLog index ec1cee584..35d2f49e9 100644 --- a/m4/ChangeLog +++ b/m4/ChangeLog @@ -1,3 +1,8 @@ +2005-08-04 David Shaw <[email protected]> + + * tar-ustar.m4: New. Check for a tar that creates USTAR format + tar files. + 2005-07-20 David Shaw <[email protected]> * libcurl.m4: Check that our libcurl has diff --git a/m4/tar-ustar.m4 b/m4/tar-ustar.m4 new file mode 100644 index 000000000..8b3d01457 --- /dev/null +++ b/m4/tar-ustar.m4 @@ -0,0 +1,43 @@ +dnl Check for a tar program that speaks ustar format +dnl Copyright (C) 2005 Free Software Foundation, Inc. +dnl +dnl This file is free software, distributed under the terms of the GNU +dnl General Public License. As a special exception to the GNU General +dnl Public License, this file may be distributed as part of a program +dnl that contains a configuration script generated by Autoconf, under +dnl the same distribution terms as the rest of that program. + +AC_DEFUN([GNUPG_CHECK_USTAR], +[ + AC_ARG_WITH(tar, + AC_HELP_STRING([--with-tar=PATH],[look for a tar program in PATH]), + [_do_tar=$withval]) + + if test x$_do_tar != xno ; then + + if test x$_do_tar = x ; then + AC_PATH_PROG(TAR,"tar") + _mytar=$ac_cv_path_TAR + fi + + # Check if our tar is ustar format. If so, it's good. TODO: Add some + # code to check various options, etc, to try and create ustar + # format. + + if test x$_mytar != x ; then + AC_MSG_CHECKING([whether $_mytar speaks USTAR]) + echo hithere > conftest.txt + $_mytar -cf - conftest.txt | grep -q ustar + _tar_bad=$? + rm conftest.txt + + if test x$_tar_bad = x0 ; then + AC_MSG_RESULT([yes]) + else + AC_MSG_RESULT([no]) + fi + fi + fi + + AM_CONDITIONAL(HAVE_USTAR, test x$_tar_bad = x0) +])dnl |