1#                                               -*- Autoconf -*-
2# Process this file with autoconf to produce a configure script.
3
4###############################################################################
5#
6# Author: Lasse Collin
7#
8# This file has been put into the public domain.
9# You can do whatever you want with this file.
10#
11###############################################################################
12
13# NOTE: Don't add useless checks. autoscan detects this and that, but don't
14# let it confuse you. For example, we don't care about checking for behavior
15# of malloc(), stat(), or lstat(), since we don't use those functions in
16# a way that would cause the problems the autoconf macros check.
17
18AC_PREREQ([2.52])
19
20AC_INIT([XZ Utils], 5.0.0, [joerg@NetBSD.org], [xz], [http://tukaani.org/xz/])
21AC_CONFIG_MACRO_DIR([m4])
22AC_CONFIG_HEADER([config.h])
23AC_CONFIG_AUX_DIR([../../gnu/dist/autoconf/config])
24
25AC_CANONICAL_HOST
26AC_USE_SYSTEM_EXTENSIONS
27
28###########
29# Filters #
30###########
31
32m4_define([SUPPORTED_FILTERS], [lzma1,lzma2,delta,x86,powerpc,ia64,arm,armthumb,sparc])
33
34m4_foreach([NAME], [SUPPORTED_FILTERS], [
35	AC_DEFINE(HAVE_ENCODER_[]m4_toupper(NAME), [1],
36	    [Define to 1 if] NAME [encoder is enabled.])
37	AC_DEFINE(HAVE_DECODER_[]m4_toupper(NAME), [1],
38	    [Define to 1 if] NAME [decoder is enabled.])
39])
40
41#################
42# Match finders #
43#################
44
45m4_define([SUPPORTED_MATCH_FINDERS], [hc3,hc4,bt2,bt3,bt4])
46
47m4_foreach([NAME], [SUPPORTED_MATCH_FINDERS], [
48	AC_DEFINE(HAVE_MF_[]m4_toupper(NAME), [1],
49	    [Define to 1 to enable] NAME [match finder.])
50])
51
52####################
53# Integrity checks #
54####################
55
56m4_define([SUPPORTED_CHECKS], [crc32,crc64,sha256])
57
58m4_foreach([NAME], [SUPPORTED_CHECKS], [
59	AC_DEFINE(HAVE_CHECK_[]m4_toupper(NAME), [1],
60	    [Define to 1 if] NAME [integrity check is enabled.])
61])
62
63
64###########################
65# Assembler optimizations #
66###########################
67
68AM_CONDITIONAL(COND_ASM_X86, false)
69AM_CONDITIONAL(COND_ASM_X86_64, false)
70
71
72#####################
73# Size optimization #
74#####################
75
76if false; then
77	AC_DEFINE([HAVE_SMALL], [1], [Define to 1 if optimizing for size.])
78fi
79
80
81AC_DEFINE_UNQUOTED([ASSUME_RAM], [128],
82    [How many MiB of RAM to assume if the real amount cannot be determined.])
83
84# There is currently no workarounds in this package if some of
85# these headers are missing.
86AC_CHECK_HEADERS([fcntl.h limits.h sys/time.h],
87	[],
88	[AC_MSG_ERROR([Required header file(s) are missing.])])
89
90AC_HEADER_STDBOOL
91
92AC_TYPE_UINT8_T
93AC_TYPE_UINT16_T
94AC_TYPE_INT32_T
95AC_TYPE_UINT32_T
96AC_TYPE_INT64_T
97AC_TYPE_UINT64_T
98AC_TYPE_UINTPTR_T
99
100AC_CHECK_SIZEOF([size_t])
101
102# The command line tool can copy high resolution timestamps if such
103# information is availabe in struct stat. Otherwise one second accuracy
104# is used.
105AC_CHECK_MEMBERS([
106	struct stat.st_atim.tv_nsec,
107	struct stat.st_atimespec.tv_nsec,
108	struct stat.st_atimensec,
109	struct stat.st_uatime,
110	struct stat.st_atim.st__tim.tv_nsec])
111
112AC_SYS_LARGEFILE
113AC_C_BIGENDIAN
114
115# Find the best function to set timestamps.
116AC_CHECK_FUNCS([futimens futimes futimesat utimes utime], [break])
117
118TUKLIB_PROGNAME
119TUKLIB_INTEGER
120TUKLIB_PHYSMEM
121TUKLIB_CPUCORES
122TUKLIB_MBSTR
123
124AC_OUTPUT
125