forked from alperakcan/fuse-ext2
-
Notifications
You must be signed in to change notification settings - Fork 0
/
configure.ac
194 lines (178 loc) · 4.33 KB
/
configure.ac
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
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
AC_INIT([fuse-ext2], [0.0.9], [[email protected]])
AC_CANONICAL_TARGET
AM_INIT_AUTOMAKE([-Wall -Werror foreign])
AC_CONFIG_HEADER([config.h])
# Checks for programs.
AC_PROG_CXX
AC_PROG_AWK
AC_PROG_CC
AC_PROG_INSTALL
m4_ifdef([AM_PROG_AR], [AM_PROG_AR])
m4_ifdef([AC_PROG_LIB],[AC_PROG_LIB],[m4_warn(portability,[Missing AC_PROJ_LIB])])
AC_PROG_OBJC
AC_PROG_LIBTOOL
AC_PATH_PROG(CHMOD, chmod, :)
case $target_os in
*linux*) arch=linux;;
*darwin*) arch=darwin;;
*) arch=unknown;;
esac
# Large file support
AC_TYPE_SIZE_T
AC_TYPE_OFF_T
AC_DEFINE([_LARGE_FILE_SOURCE], [], [Large files support])
AC_DEFINE([_FILE_OFFSET_BITS], [64], [File Offset size])
# Checks for header files.
AC_HEADER_DIRENT
AC_HEADER_STDC
AC_HEADER_MAJOR
AC_CHECK_HEADERS([ \
fcntl.h \
malloc.h \
mntent.h \
netinet/in.h \
paths.h \
stddef.h \
stdlib.h \
string.h \
linux/fd.h \
sys/file.h \
sys/ioctl.h \
sys/mount.h \
sys/param.h \
sys/statvfs.h \
sys/time.h \
sys/types.h \
sys/stat.h \
sys/mkdev.h \
sys/ioctl.h \
sys/syscall.h \
sys/resource.h \
sys/mman.h \
sys/prctl.h \
sys/disklabel.h \
sys/queue.h \
sys/socket.h \
sys/un.h \
sys/sockio.h \
net/if.h \
netinet/in.h \
net/if_dl.h \
errno.h \
unistd.h \
utime.h \
getopt.h \
inttypes.h \
])
AC_CHECK_HEADERS(sys/disk.h sys/mount.h,,,
[[
#if HAVE_SYS_QUEUE_H
#include <sys/queue.h>
#endif
]])
# Checks for typedefs, structures, and compiler characteristics.
AC_C_CONST
AC_C_INLINE
AC_TYPE_MODE_T
AC_TYPE_OFF_T
AC_TYPE_SIZE_T
AC_TYPE_SSIZE_T
AC_CHECK_MEMBERS([struct stat.st_blksize])
AC_STRUCT_ST_BLOCKS
AC_CHECK_MEMBERS([struct stat.st_rdev])
AC_HEADER_TIME
AC_CHECK_DECL(llseek,[AC_DEFINE(HAVE_LLSEEK_PROTOTYPE, 1, [Define to 1 if you have the `llseek' prototype.])],,
[#include <unistd.h>])
AC_CHECK_DECL(lseek64,[AC_DEFINE(HAVE_LSEEK64_PROTOTYPE, 1, [Define to 1 if you have the `lseek64' prototype.])],,
[#define _LARGEFILE_SOURCE
#define _LARGEFILE64_SOURCE
#include <unistd.h>])
dnl Check to see if ssize_t was decleared
AC_CHECK_TYPE(ssize_t,[AC_DEFINE(HAVE_TYPE_SSIZE_T, 1, [Define to 1 if you have the `ssize_t' prototype.])],,
[#include <sys/types.h>])
# Checks for library functions.
AC_FUNC_VPRINTF
AC_FUNC_CHOWN
AC_FUNC_CLOSEDIR_VOID
AC_FUNC_GETMNTENT
AC_PROG_GCC_TRADITIONAL
AC_FUNC_MALLOC
AC_FUNC_MEMCMP
AC_FUNC_MMAP
AC_FUNC_REALLOC
AC_FUNC_SELECT_ARGTYPES
AC_FUNC_STAT
AC_FUNC_UTIME_NULL
AC_CHECK_FUNCS([ \
ftruncate \
getmntent \
getmntinfo \
getpagesize \
hasmntopt \
memmove \
memset \
munmap \
random \
select \
srand \
srandom \
strcasecmp \
strchr \
strdup \
strerror \
strrchr \
strtol \
strtoul \
strtoull \
uname \
utime \
llseek \
lseek64 \
])
# Checks for libraries
AC_SEARCH_LIBS([sem_post], [pthread], [], [AC_MSG_ERROR([Can't find pthreads, please install it])])
AC_SEARCH_LIBS([fuse_main], [osxfuse fuse], [], [AC_MSG_ERROR([Can't find libfuse, please install it])])
AC_SEARCH_LIBS([com_err], [com_err], [], [AC_MSG_ERROR([Can't find comerr, please install it])])
AC_SEARCH_LIBS([ext2fs_open], [ext2fs], [], [AC_MSG_ERROR([Can't find e2fslibs, please install it])])
AC_MSG_CHECKING([if FUSE on this system is too new for us])
AC_EGREP_CPP([fuse_version_yes], [
#define _FILE_OFFSET_BITS 64
#define FUSE_USE_VERSION 27
#include "fuse.h"
#if FUSE_VERSION > 27
fuse_version_yes
#endif
], AC_DEFINE([FUSE_USE_VERSION], [27], [Version of FUSE interface]) AC_MSG_RESULT([yes]),
AC_DEFINE([FUSE_USE_VERSION], [FUSE_VERSION], [Version of FUSE interface]) AC_MSG_RESULT([no]))
# Check extra parameters
AC_ARG_ENABLE([debug],
[ --enable-debug enable noisy debug],
if test "$enableval" = "no"
then
DEBUG_CMT=#
echo "Disabling debug support"
else
DEBUG_CMT=
AC_DEFINE(ENABLE_DEBUG, 1, [Define to 1 if you want 'debug' support.])
echo "Enabling debug support"
fi
,
DEBUG_CMT=
echo "Disabling debug support by default"
AC_DEFINE(ENABLE_DEBUG, 0, [Define to 1 if you want 'debug' support.])
)
AC_ARG_WITH(pkgconfigdir,
[ --with-pkgconfigdir=DIR pkgconfig file in DIR @<:@LIBDIR/pkgconfig@:>@],
[pkgconfigdir=$withval],
[pkgconfigdir='${libdir}/pkgconfig'])
AC_SUBST(pkgconfigdir)
AM_CONDITIONAL(LINUX, test "$arch" = linux)
AM_CONDITIONAL(DARWIN, test "$arch" = darwin)
AC_CONFIG_FILES([
fuse-ext2.pc
Makefile
fuse-ext2/Makefile
tools/Makefile
tools/macosx/Makefile
])
AC_OUTPUT