2004-08-07 03:24:49 +00:00
|
|
|
# $FreeBSD$
|
|
|
|
|
|
|
|
# Process this file with autoconf to produce a configure script.
|
2004-08-08 01:30:30 +00:00
|
|
|
AC_INIT(bsdtar, @VERSION@, kientzle@freebsd.org)
|
|
|
|
AM_INIT_AUTOMAKE(bsdtar, @VERSION@)
|
2004-08-07 03:24:49 +00:00
|
|
|
AC_CONFIG_SRCDIR([bsdtar.c])
|
|
|
|
AM_CONFIG_HEADER([config.h])
|
|
|
|
|
|
|
|
# Checks for programs.
|
|
|
|
AC_PROG_CC
|
2005-03-13 18:36:24 +00:00
|
|
|
AC_PROG_YACC
|
2004-08-07 03:24:49 +00:00
|
|
|
|
|
|
|
# Checks for header files.
|
|
|
|
AC_HEADER_DIRENT
|
|
|
|
AC_HEADER_STDC
|
2005-04-17 19:43:37 +00:00
|
|
|
AC_CHECK_HEADERS([bzlib.h fcntl.h inttypes.h langinfo.h limits.h locale.h paths.h stdint.h stdlib.h string.h sys/ioctl.h sys/param.h unistd.h zlib.h])
|
2004-08-07 03:24:49 +00:00
|
|
|
|
|
|
|
# Checks for libraries.
|
|
|
|
AC_CHECK_LIB([z], [inflate])
|
|
|
|
AC_CHECK_LIB([bz2], [BZ2_bzDecompressInit])
|
|
|
|
AC_CHECK_LIB([archive], [archive_version])
|
|
|
|
|
|
|
|
# Checks for typedefs, structures, and compiler characteristics.
|
|
|
|
AC_C_CONST
|
|
|
|
AC_TYPE_UID_T
|
|
|
|
AC_TYPE_MODE_T
|
|
|
|
AC_TYPE_OFF_T
|
|
|
|
AC_TYPE_SIZE_T
|
2004-08-08 01:30:30 +00:00
|
|
|
AC_CHECK_TYPE(id_t, [unsigned long])
|
2005-04-17 19:43:37 +00:00
|
|
|
AC_CHECK_MEMBERS([struct stat.st_rdev, struct stat.st_mtimespec.tv_nsec, struct stat.st_mtim.tv_nsec])
|
|
|
|
|
|
|
|
|
2004-08-07 03:24:49 +00:00
|
|
|
AC_CHECK_DECL([D_MD_ORDER],
|
2005-04-17 19:43:37 +00:00
|
|
|
[AC_DEFINE(HAVE_D_MD_ORDER, 1, [Define to 1 if nl_langinfo supports D_MD_ORDER])],
|
|
|
|
[],
|
|
|
|
[#if HAVE_LANGINFO_H
|
|
|
|
#include <langinfo.h>
|
|
|
|
#endif
|
|
|
|
])
|
|
|
|
|
|
|
|
AC_FUNC_FNMATCH
|
2004-12-22 06:08:04 +00:00
|
|
|
AC_CHECK_DECL([FNM_LEADING_DIR],
|
2005-04-17 19:43:37 +00:00
|
|
|
[AC_DEFINE(HAVE_FNM_LEADING_DIR, 1, [Define to 1 if fnmatch(3) supports the FNM_LEADING_DIR flag])],
|
|
|
|
[],
|
|
|
|
[#if HAVE_FNMATCH
|
|
|
|
#define _GNU_SOURCE /* Required on Linux to get GNU extensions */
|
|
|
|
#include <fnmatch.h>
|
|
|
|
#endif
|
|
|
|
])
|
|
|
|
|
|
|
|
# Check for dirent.d_namlen field explicitly
|
|
|
|
AC_CHECK_MEMBER(struct dirent.d_namlen,,,
|
|
|
|
[#if HAVE_DIRENT_H
|
|
|
|
#include <dirent.h>
|
|
|
|
#endif
|
|
|
|
])
|
|
|
|
|
|
|
|
# Check for ACL support
|
|
|
|
AC_CHECK_HEADERS([sys/acl.h])
|
2005-04-23 18:41:28 +00:00
|
|
|
AC_CHECK_LIB([acl],[acl_get_file])
|
2005-04-17 19:43:37 +00:00
|
|
|
|
|
|
|
AC_CHECK_TYPES(acl_permset_t,,,
|
|
|
|
[#if HAVE_SYS_TYPES_H
|
|
|
|
#include <sys/types.h>
|
|
|
|
#endif
|
|
|
|
#if HAVE_SYS_ACL_H
|
|
|
|
#include <sys/acl.h>
|
|
|
|
#endif
|
|
|
|
])
|
|
|
|
|
|
|
|
# The "acl_get_perm()" function was omitted from the POSIX draft.
|
|
|
|
# (It's a pretty obvious oversight; otherwise, there's no way to
|
|
|
|
# test for specific permissions in a permset.) Linux uses the obvious
|
|
|
|
# name, FreeBSD adds _np to mark it as "non-Posix extension."
|
|
|
|
# Test for both as a double-check that we really have POSIX-style ACL support.
|
|
|
|
AC_CHECK_FUNCS(acl_get_perm_np acl_get_perm,,,
|
|
|
|
[#if HAVE_SYS_TYPES_H
|
|
|
|
#include <sys/types.h>
|
|
|
|
#endif
|
|
|
|
#if HAVE_SYS_ACL_H
|
|
|
|
#include <sys/acl.h>
|
|
|
|
#endif
|
|
|
|
])
|
|
|
|
|
2004-08-07 03:24:49 +00:00
|
|
|
# Checks for library functions.
|
|
|
|
AC_PROG_GCC_TRADITIONAL
|
|
|
|
AC_FUNC_LSTAT
|
|
|
|
AC_HEADER_MAJOR
|
|
|
|
AC_FUNC_MALLOC
|
|
|
|
AC_FUNC_STAT
|
|
|
|
AC_FUNC_STRFTIME
|
|
|
|
AC_FUNC_VPRINTF
|
2005-04-17 19:43:37 +00:00
|
|
|
AC_CHECK_TYPES([uintmax_t, unsigned long long])
|
|
|
|
AC_CHECK_FUNCS([chflags fchdir ftruncate getopt_long memmove memset nl_langinfo reallocf setlocale strchr strdup strerror strrchr])
|
2004-08-07 03:24:49 +00:00
|
|
|
|
2004-08-08 01:30:30 +00:00
|
|
|
#
|
|
|
|
# If any of the common 64-bit types is defined, set "int64_t"
|
|
|
|
#
|
|
|
|
AC_CHECK_TYPE(__int64_t, [long long])
|
|
|
|
AC_CHECK_TYPE(_int64_t, [__int64_t])
|
|
|
|
AC_CHECK_TYPE(int64_t, [_int64_t])
|
|
|
|
|
|
|
|
#
|
|
|
|
# If any of the common 64-bit unsigned types is defined, set "uint64_t"
|
|
|
|
#
|
|
|
|
AC_CHECK_TYPE(__uint64_t, [unsigned long long])
|
|
|
|
AC_CHECK_TYPE(_uint64_t, [__uint64_t])
|
|
|
|
AC_CHECK_TYPE(u_int64_t, [_uint64_t])
|
|
|
|
AC_CHECK_TYPE(uint64_t, [u_int64_t])
|
|
|
|
|
2004-08-07 03:24:49 +00:00
|
|
|
#define HAVE_CHFLAGS 1
|
|
|
|
|
|
|
|
# Additional requirements
|
|
|
|
AC_SYS_LARGEFILE
|
|
|
|
|
|
|
|
AC_CONFIG_FILES([Makefile])
|
|
|
|
AC_OUTPUT
|