libtar version 1.2.17
[libtar.git] / configure.ac
blob47c8f69e32a911caac1e455ba5c3ae51a62681c3
1 dnl ### Normal initialization. ######################################
2 AC_INIT([libtar], [1.2.17])
3 AC_PREREQ([2.61])
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 AM_INIT_AUTOMAKE([dist-bzip2])
14 ENCAP_PKG([], [postinstall-encap])
17 dnl ### Load subdirectory modules. ##################################
18 PSG_MODULE([compat])
19 PSG_MODULE([listhash], [libtar])
22 dnl ### Set some option defaults. ###################################
23 if test -z "$CFLAGS"; then
24   CFLAGS="-O"
26 MKDIR="mkdir -p -m 755"
27 AC_SUBST([MKDIR])
30 dnl ### Check for compiler et al. ###################################
31 AC_USE_SYSTEM_EXTENSIONS
32 AC_PROG_CC
33 AC_PROG_LIBTOOL
34 AC_PROG_INSTALL
35 AC_PROG_LN_S
36 AC_PROG_MAKE_SET
39 dnl ### Compiler characteristics. ##################################
40 AC_C_CONST
43 dnl ### Checks for header files. ###################################
44 AC_HEADER_STDC
45 AC_CHECK_HEADERS([unistd.h])
46 AC_HEADER_MAJOR
47 PSG_REPLACE_TYPE([major_t], [unsigned int], [
48   #include <sys/types.h>
49   #ifdef MAJOR_IN_MKDEV
50   # include <sys/mkdev.h>
51   #else
52   # ifdef MAJOR_IN_SYSMACROS
53   #  include <sys/sysmacros.h>
54   # endif
55   #endif
57 PSG_REPLACE_TYPE([minor_t], [unsigned int], [
58   #include <sys/types.h>
59   #ifdef MAJOR_IN_MKDEV
60   # include <sys/mkdev.h>
61   #else
62   # ifdef MAJOR_IN_SYSMACROS
63   #  include <sys/sysmacros.h>
64   # endif
65   #endif
67 PSG_REPLACE_TYPE([dev_t], [unsigned long], [
68   #include <sys/types.h>
69   #ifdef MAJOR_IN_MKDEV
70   # include <sys/mkdev.h>
71   #else
72   # ifdef MAJOR_IN_SYSMACROS
73   #  include <sys/sysmacros.h>
74   # endif
75   #endif
77 PSG_REPLACE_TYPE([socklen_t], [unsigned long], [
78   #include <sys/types.h>
79   #include <sys/socket.h>
81 PSG_REPLACE_TYPE([uint64_t], [long long])
82 AC_TYPE_MODE_T
83 AC_TYPE_OFF_T
84 AC_TYPE_SIZE_T
85 AC_TYPE_UID_T
86 PSG_REPLACE_TYPE([nlink_t], [unsigned short])
89 dnl ### Check for needed functions. ################################
90 COMPAT_FUNC_BASENAME
91 COMPAT_FUNC_DIRNAME
92 COMPAT_FUNC_FNMATCH
93 AC_CHECK_FUNCS([lchown])
94 COMPAT_FUNC_MAKEDEV
95 COMPAT_FUNC_SNPRINTF
96 COMPAT_FUNC_STRDUP
97 AC_FUNC_STRFTIME
98 COMPAT_FUNC_STRLCPY
99 COMPAT_FUNC_STRMODE
100 COMPAT_FUNC_STRSEP
103 dnl ### Check for libraries. #######################################
104 AC_ARG_WITH([zlib],
105   [  --without-zlib          Use external gzip binary instead of zlib],
106   [],
107   [with_zlib=yes])
108 if test "$with_zlib" = "yes"; then
109   AC_CHECK_LIB([z], [gzread])
113 dnl ### Create output files. #######################################
114 AC_CONFIG_FILES([Makefile lib/Makefile libtar/Makefile doc/Makefile])
115 AC_OUTPUT