-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathconfigure.ac
180 lines (160 loc) · 2.96 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
AC_PREREQ(2.59)
AC_INIT([refsprogs],[0.1],[[email protected]])
LIBREFS_VERSION="1"
AC_CONFIG_SRCDIR([refsprogs/refsls.c])
# Environment
AC_CANONICAL_HOST
AC_CANONICAL_TARGET
# Automake
AM_INIT_AUTOMAKE([])
AC_CONFIG_HEADERS([config.h])
AC_CONFIG_MACRO_DIR([m4])
AM_MAINTAINER_MODE
# Options.
AC_ARG_ENABLE(
[library],
[AS_HELP_STRING(
[--disable-library],
[do not install librefs but link it statically into the binaries]
)],
[],
[enable_library="yes"]
)
AC_ARG_ENABLE(
[refs-fuse],
[AS_HELP_STRING(
[--disable-refs-fuse],
[do not build the FUSE driver (eliminates libfuse dependency)]
)],
[case $enableval in
yes)
enable_refs_fuse="yes"
;;
no)
enable_refs_fuse="no"
;;
*)
AC_MSG_ERROR([[Unknown option to --enable-refs-fuse: $enableval]])
;;
esac],
[enable_refs_fuse="yes"]
)
# Programs
AC_PROG_CC(gcc cc)
AC_PROG_LN_S
AM_PROG_CC_C_O
ifdef(
[LT_INIT],
[LT_INIT],
[AC_PROG_LIBTOOL]
)
AC_PROG_INSTALL
PKG_PROG_PKG_CONFIG
# Checks for header files.
AC_CHECK_HEADERS([ \
errno.h \
fcntl.h \
inttypes.h \
limits.h \
stdint.h \
stdio.h \
stdlib.h \
stdarg.h \
string.h \
time.h \
unistd.h \
linux/fs.h \
sys/disk.h \
sys/ioctl.h \
sys/stat.h \
])
# Checks for typedefs, structures, and compiler characteristics.
AC_C_CONST
AC_C_INLINE
AC_TYPE_OFF_T
AC_TYPE_SIZE_T
# Checks for library functions.
AC_FUNC_MEMCMP
AC_FUNC_STAT
AC_CHECK_FUNCS([ \
flsll \
strerror \
strtoull \
])
# Checks for character conversion libraries.
case "$target_os" in
mingw*)
# No action needed, we use Win32 character conversion APIs.
;;
*)
NO_ICONV=0
AC_SEARCH_LIBS(
[iconv_open],
[iconv],
[],
[NO_ICONV=1],
[]
)
if test $NO_ICONV -eq 1; then
NO_ICONV=0
AC_CHECK_LIB(
[iconv],
[libiconv_open],
[],
[NO_ICONV=1]
)
fi
if test $NO_ICONV -eq 1; then
AC_MSG_ERROR([[Unable to locate iconv library.]])
fi
;;
esac
if test "x$enable_refs_fuse" == "xyes"; then
# Checks for FUSE library.
FUSE_MODULE_CFLAGS=""
FUSE_MODULE_LIBS=""
case "$target_os" in
netbsd*)
# Use librefuse.
FUSE_MODULE_LIBS="-lrefuse"
;;
mingw*)
# Dokan is used. Currently the user needs to specify libfuse include and
# library paths manually.
;;
*)
# Other platforms (Linux, FreeBSD, ...) use pkg-config.
PKG_CHECK_MODULES(
[FUSE_MODULE],
[fuse >= 2.6.0],
[],
[]
)
;;
esac
fi
AC_SYS_LARGEFILE
# Settings
AC_SUBST([LIBREFS_VERSION])
AC_SUBST([FUSE_MODULE_CFLAGS])
AC_SUBST([FUSE_MODULE_LIBS])
AM_CONDITIONAL([INSTALL_LIBRARY], [test "${enable_library}" = "yes"])
AM_CONDITIONAL([ENABLE_NFCONV], [test "${enable_nfconv}" = "yes"])
AM_CONDITIONAL([ENABLE_REFS_FUSE], [test "x${enable_refs_fuse}" = "xyes"])
# generate files
AC_CONFIG_FILES([
Makefile
include/Makefile
include/refs/Makefile
librefs/Makefile
librefs/librefs.pc
refsprogs/Makefile
refsprogs/redb.8
refsprogs/refs-fuse.8
refsprogs/refscat.8
refsprogs/refsinfo.8
refsprogs/refslabel.8
refsprogs/refsls.8
])
AC_OUTPUT
echo "You can now type 'make' to build refsprogs."