Removed m4 includes, and straightened out [] m4 quoting for modern autoconfs
[libtar.git] / configure.ac
blobbca370c7f48d4a1d0c856171611f2fbf71ce2896
1 dnl ### Normal initialization. ######################################
2 AC_INIT([libtar], [1.2.11])
3 AC_PREREQ([2.57])
4 AC_CONFIG_AUX_DIR([autoconf])
5 AC_CONFIG_HEADERS([config.h])
6 AC_COPYRIGHT([[
7 Copyright (c) 1998-2003 University of Illinois Board of Trustees
8 Copyright (c) 1998-2003 Mark D. Roth
9 All rights reserved.
10 ]])
11 AC_CONFIG_SRCDIR([lib/libtar.h])
12 AC_CONFIG_MACRO_DIR([autoconf])
13 ENCAP_PKG([], [postinstall-encap])
16 dnl ### Load subdirectory modules. ##################################
17 PSG_MODULE([compat])
18 PSG_MODULE([listhash], [libtar])
21 dnl ### Set some option defaults. ###################################
22 if test -z "$CFLAGS"; then
23   CFLAGS="-O"
25 MKDIR="mkdir -p -m 755"
26 AC_SUBST([MKDIR])
29 dnl ### Check for compiler et al. ###################################
30 AC_PROG_CC
31 AC_PROG_RANLIB
32 AC_PROG_INSTALL
33 AC_PROG_LN_S
34 AC_PROG_MAKE_SET
37 dnl ### Compiler characteristics. ##################################
38 AC_AIX
39 AC_C_CONST
42 dnl ### Checks for header files. ###################################
43 AC_HEADER_STDC
44 AC_CHECK_HEADERS([unistd.h])
45 AC_HEADER_MAJOR
46 PSG_REPLACE_TYPE([major_t], [unsigned int], [
47   #include <sys/types.h>
48   #ifdef MAJOR_IN_MKDEV
49   # include <sys/mkdev.h>
50   #else
51   # ifdef MAJOR_IN_SYSMACROS
52   #  include <sys/sysmacros.h>
53   # endif
54   #endif
56 PSG_REPLACE_TYPE([minor_t], [unsigned int], [
57   #include <sys/types.h>
58   #ifdef MAJOR_IN_MKDEV
59   # include <sys/mkdev.h>
60   #else
61   # ifdef MAJOR_IN_SYSMACROS
62   #  include <sys/sysmacros.h>
63   # endif
64   #endif
66 PSG_REPLACE_TYPE([dev_t], [unsigned long], [
67   #include <sys/types.h>
68   #ifdef MAJOR_IN_MKDEV
69   # include <sys/mkdev.h>
70   #else
71   # ifdef MAJOR_IN_SYSMACROS
72   #  include <sys/sysmacros.h>
73   # endif
74   #endif
76 PSG_REPLACE_TYPE([socklen_t], [unsigned long], [
77   #include <sys/types.h>
78   #include <sys/socket.h>
80 PSG_REPLACE_TYPE([uint64_t], [long long])
81 AC_TYPE_MODE_T
82 AC_TYPE_OFF_T
83 AC_TYPE_SIZE_T
84 AC_TYPE_UID_T
85 PSG_REPLACE_TYPE([nlink_t], [unsigned short])
88 dnl ### Check for needed functions. ################################
89 COMPAT_FUNC_BASENAME
90 COMPAT_FUNC_DIRNAME
91 COMPAT_FUNC_FNMATCH
92 AC_CHECK_FUNCS([lchown])
93 COMPAT_FUNC_MAKEDEV
94 COMPAT_FUNC_SNPRINTF
95 COMPAT_FUNC_STRDUP
96 AC_FUNC_STRFTIME
97 COMPAT_FUNC_STRLCPY
98 COMPAT_FUNC_STRMODE
99 COMPAT_FUNC_STRSEP
102 dnl ### Check for libraries. #######################################
103 AC_ARG_WITH([zlib],
104   [  --without-zlib          Use external gzip binary instead of zlib],
105   [],
106   [with_zlib=yes])
107 if test "$with_zlib" = "yes"; then
108   AC_CHECK_LIB([z], [gzread])
112 dnl ### Create output files. #######################################
113 AC_CONFIG_FILES([Makefile lib/Makefile libtar/Makefile doc/Makefile])
114 AC_OUTPUT