summaryrefslogtreecommitdiff
path: root/configure.ac
blob: 1d97ed2314845d57dd3d8f93bd76910f060daa9e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
# Copyright (C) 2006 Lauri Leukkunen
# Based on the configure.ac script from fakechroot package


AC_PREREQ(2.59)
AC_INIT([sb2], [1.99b], [lle@rahina.org])
#AC_CANONICAL_TARGET
#AM_INIT_AUTOMAKE
#AM_MAINTAINER_MODE
#AC_CONFIG_SRCDIR([src/libfakechroot.c])
AC_CONFIG_HEADER([include/config.h])
AC_LANG_C

# Checks for programs.
AC_PROG_MAKE_SET

# Checks for libraries.
AC_CHECK_LIB([dl], [dlsym])

# Checks for header files.
AC_HEADER_DIRENT
AC_HEADER_STDC
AC_CHECK_HEADERS([ \
fcntl.h \
fts.h \
ftw.h \
shadow.h \
stdlib.h \
string.h \
unistd.h \
utime.h \
sys/xattr.h \
])

# 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
AC_HEADER_TIME

# Checks for library functions.
AC_FUNC_ALLOCA
AC_FUNC_CHOWN
AC_FUNC_LSTAT
AC_FUNC_LSTAT_FOLLOWS_SLASHED_SYMLINK
AC_FUNC_MALLOC
AC_FUNC_STAT
AC_FUNC_UTIME_NULL
AC_CHECK_FUNCS([ \
__lxstat \
__lxstat64 \
__open \
__open64 \
__opendir2 \
__xmknod \
__xstat \
__xstat64 \
_xftw \
_xftw64 \
access \
accessat \
acct \
canonicalize_file_name \
chdir \
chmod \
chown \
creat \
creat64 \
dlmopen \
dlopen \
euidaccess \
execl \
execle \
execlp \
execv \
execve \
execvp \
faccessat \
fchmodat \
fchownat \
futimesat \
fopen \
fopen64 \
freopen \
freopen64 \
fstatat \
fts_open \
ftw \
ftw64 \
get_current_dir_name \
getcwd \
getwd \
getxattr \
glob \
glob64 \
glob_pattern_p \
lchmod \
lchown \
lckpwdf \
lgetxattr \
link \
linkat \
listxattr \
llistxattr \
lremovexattr \
lsetxattr \
lstat \
lstat64 \
lutimes \
mkdir \
mkdirat \
mkdtemp \
mknod \
mknodat \
mkfifo \
mkfifoat \
mkstemp \
mkstemp64 \
mktemp \
nftw \
nftw64 \
open \
open64 \
openat \
openat64 \
opendir \
pathconf \
readlink \
readlinkat \
realpath \
remove \
removexattr \
rename \
renameat \
revoke \
rmdir \
scandir \
scandir64 \
setenv \
setxattr \
stat \
stat64 \
strchrnul \
symlink \
symlinkat \
tempnam \
tmpnam \
truncate \
truncate64 \
unlink \
unlinkat \
ulckpwdf \
utime \
utimes \
])

AC_EGREP_CPP(EM_386,
[
#include <asm/elf.h>
ELF_ARCH
], elf_arch=EM_386, elf_arch=EM_X86_64
)
AH_TEMPLATE([ELF_ARCH], [ELF architecture])
AC_DEFINE_UNQUOTED(ELF_ARCH, ${elf_arch})

AH_TEMPLATE([READLINK_TYPE], [readlink() return type])
AC_COMPILE_IFELSE([AC_LANG_SOURCE([[
#include <unistd.h>
ssize_t readlink(const char *path, char *buf, size_t bufsize) 
{ return 0; }]])], 
readlink_type="ssize_t", readlink_type="int")
AC_DEFINE_UNQUOTED(READLINK_TYPE, ${readlink_type})

AC_OUTPUT