]>
Commit | Line | Data |
---|---|---|
1 | AC_INIT([xfsprogs], [4.19.0-rc0], [linux-xfs@vger.kernel.org]) | |
2 | AC_PREREQ(2.50) | |
3 | AC_CONFIG_AUX_DIR([.]) | |
4 | AC_CONFIG_MACRO_DIR([m4]) | |
5 | AC_CONFIG_SRCDIR([include/libxfs.h]) | |
6 | AC_CONFIG_HEADER(include/platform_defs.h) | |
7 | AC_PREFIX_DEFAULT(/usr) | |
8 | ||
9 | AC_PROG_INSTALL | |
10 | AC_PROG_LIBTOOL | |
11 | ||
12 | AC_PROG_CC | |
13 | AC_ARG_VAR(BUILD_CC, [C compiler for build tools]) | |
14 | if test "${BUILD_CC+set}" != "set"; then | |
15 | if test $cross_compiling = no; then | |
16 | BUILD_CC="$CC" | |
17 | else | |
18 | AC_CHECK_PROGS(BUILD_CC, gcc cc) | |
19 | fi | |
20 | fi | |
21 | AC_ARG_VAR(BUILD_CFLAGS, [C compiler flags for build tools]) | |
22 | if test "${BUILD_CFLAGS+set}" != "set"; then | |
23 | if test $cross_compiling = no; then | |
24 | BUILD_CFLAGS="$CFLAGS" | |
25 | else | |
26 | BUILD_CFLAGS="-g -O2" | |
27 | fi | |
28 | fi | |
29 | ||
30 | AC_ARG_ENABLE(shared, | |
31 | [ --enable-shared=[yes/no] Enable use of shared libraries [default=yes]],, | |
32 | enable_shared=yes) | |
33 | AC_SUBST(enable_shared) | |
34 | ||
35 | AC_ARG_ENABLE(gettext, | |
36 | [ --enable-gettext=[yes/no] Enable alternate language support [default=yes]],, | |
37 | enable_gettext=yes) | |
38 | AC_SUBST(enable_gettext) | |
39 | ||
40 | AC_ARG_ENABLE(blkid, | |
41 | [ --enable-blkid=[yes/no] Enable use of block device id library [default=yes]],, | |
42 | enable_blkid=yes) | |
43 | AC_SUBST(enable_blkid) | |
44 | ||
45 | AC_ARG_ENABLE(readline, | |
46 | [ --enable-readline=[yes/no] Enable readline command editing [default=no]], | |
47 | test $enable_readline = yes && libreadline="-lreadline", | |
48 | enable_readline=no) | |
49 | AC_SUBST(libreadline) | |
50 | AC_SUBST(enable_readline) | |
51 | ||
52 | AC_ARG_ENABLE(editline, | |
53 | [ --enable-editline=[yes/no] Enable editline command editing [default=no]], | |
54 | test $enable_editline = yes && libeditline="-ledit", | |
55 | enable_editline=no) | |
56 | AC_SUBST(libeditline) | |
57 | AC_SUBST(enable_editline) | |
58 | ||
59 | AC_ARG_ENABLE(termcap, | |
60 | [ --enable-termcap=[yes/no] Enable terminal capabilities library [default=no]], | |
61 | test $enable_termcap = yes && libtermcap="-ltermcap",) | |
62 | AC_SUBST(libtermcap) | |
63 | ||
64 | ||
65 | AC_ARG_ENABLE(lib64, | |
66 | [ --enable-lib64=[yes/no] Enable lib64 support [default=yes]],, | |
67 | enable_lib64=yes) | |
68 | AC_SUBST(enable_lib64) | |
69 | ||
70 | AC_ARG_ENABLE(librt, | |
71 | [ --enable-librt=[yes/no] Enable librt support [default=yes]],, | |
72 | enable_librt=yes) | |
73 | AC_SUBST(enable_librt) | |
74 | ||
75 | # Enable UBSAN; set enable_ubsan=probe below to enable autoprobe. | |
76 | AC_ARG_ENABLE(ubsan, | |
77 | [ --enable-ubsan=[yes/no] Enable Undefined Behavior Sanitizer (UBSAN) [default=no]],, | |
78 | enable_ubsan=no) | |
79 | AC_SUBST(enable_ubsan) | |
80 | ||
81 | # Enable ADDRSAN; set enable_addrsan=probe below to enable autoprobe. | |
82 | AC_ARG_ENABLE(addrsan, | |
83 | [ --enable-addrsan=[yes/no] Enable Address Sanitizer (ADDRSAN) [default=no]],, | |
84 | enable_addrsan=no) | |
85 | AC_SUBST(enable_addrsan) | |
86 | ||
87 | # Enable THREADSAN; set enable_threadsan=probe to enable autoprobe. | |
88 | AC_ARG_ENABLE(threadsan, | |
89 | [ --enable-threadsan=[yes/no] Enable Thread Sanitizer (THREADSAN) [default=no]],, | |
90 | enable_threadsan=no) | |
91 | AC_SUBST(enable_threadsan) | |
92 | ||
93 | AC_ARG_ENABLE(lto, | |
94 | [ --enable-lto=[yes/no] Enable link time optimization (LTO) [default=probe]],, | |
95 | enable_lto=probe) | |
96 | AC_SUBST(enable_lto) | |
97 | ||
98 | # Enable xfs_scrub build | |
99 | AC_ARG_ENABLE(scrub, | |
100 | [ --enable-scrub=[yes/no] Enable build of xfs_scrub utility [default=yes]],, | |
101 | enable_scrub=yes) | |
102 | AC_SUBST(enable_scrub) | |
103 | ||
104 | # Enable libicu for xfs_scrubbing of malicious unicode sequences in names | |
105 | AC_ARG_ENABLE(libicu, | |
106 | [ --enable-libicu=[yes/no] Enable Unicode name scanning in xfs_scrub (libicu) [default=probe]],, | |
107 | enable_libicu=probe) | |
108 | ||
109 | # | |
110 | # If the user specified a libdir ending in lib64 do not append another | |
111 | # 64 to the library names. | |
112 | # | |
113 | base_libdir=`basename "$libdir"` | |
114 | case $base_libdir in | |
115 | lib64) | |
116 | enable_lib64=no | |
117 | esac | |
118 | ||
119 | # | |
120 | # Some important tools should be installed into the root partitions. | |
121 | # | |
122 | # Check whether exec_prefix=/usr: and install them to /sbin in that | |
123 | # case. If the user choses a different prefix assume he just wants | |
124 | # a local install for testing and not a system install. | |
125 | # | |
126 | case $exec_prefix:$prefix in | |
127 | NONE:NONE | NONE:/usr | /usr:*) | |
128 | root_sbindir='/sbin' | |
129 | root_libdir="/${base_libdir}" | |
130 | ;; | |
131 | *) | |
132 | root_sbindir="${sbindir}" | |
133 | root_libdir="${libdir}" | |
134 | ;; | |
135 | esac | |
136 | ||
137 | AC_SUBST([root_sbindir]) | |
138 | AC_SUBST([root_libdir]) | |
139 | ||
140 | # Find localized files. Don't descend into any "dot directories" | |
141 | # (like .git or .pc from quilt). Strangely, the "-print" argument | |
142 | # to "find" is required, to avoid including such directories in the | |
143 | # list. | |
144 | LOCALIZED_FILES="" | |
145 | for lfile in `find ${srcdir} -path './.??*' -prune -o -name '*.c' -type f -print || exit 1`; do | |
146 | LOCALIZED_FILES="$LOCALIZED_FILES \$(TOPDIR)/$lfile" | |
147 | done | |
148 | AC_SUBST(LOCALIZED_FILES) | |
149 | ||
150 | AC_PACKAGE_GLOBALS(xfsprogs) | |
151 | AC_PACKAGE_UTILITIES(xfsprogs) | |
152 | AC_MULTILIB($enable_lib64) | |
153 | AC_RT($enable_librt) | |
154 | ||
155 | AC_PACKAGE_NEED_UUID_H | |
156 | AC_PACKAGE_NEED_UUIDCOMPARE | |
157 | ||
158 | AC_PACKAGE_NEED_PTHREAD_H | |
159 | AC_PACKAGE_NEED_PTHREADMUTEXINIT | |
160 | ||
161 | AC_HAVE_FADVISE | |
162 | AC_HAVE_MADVISE | |
163 | AC_HAVE_MINCORE | |
164 | AC_HAVE_SENDFILE | |
165 | AC_HAVE_GETMNTENT | |
166 | AC_HAVE_FALLOCATE | |
167 | AC_HAVE_FIEMAP | |
168 | AC_HAVE_PWRITEV2 | |
169 | AC_HAVE_PREADV | |
170 | AC_HAVE_COPY_FILE_RANGE | |
171 | AC_HAVE_SYNC_FILE_RANGE | |
172 | AC_HAVE_SYNCFS | |
173 | AC_HAVE_MNTENT | |
174 | AC_HAVE_FLS | |
175 | AC_HAVE_READDIR | |
176 | AC_HAVE_FSETXATTR | |
177 | AC_HAVE_MREMAP | |
178 | AC_NEED_INTERNAL_FSXATTR | |
179 | AC_HAVE_GETFSMAP | |
180 | AC_HAVE_STATFS_FLAGS | |
181 | AC_HAVE_MAP_SYNC | |
182 | AC_HAVE_DEVMAPPER | |
183 | AC_HAVE_MALLINFO | |
184 | AC_PACKAGE_WANT_ATTRIBUTES_H | |
185 | AC_HAVE_LIBATTR | |
186 | if test "$enable_scrub" = "yes"; then | |
187 | if test "$enable_libicu" = "yes" || test "$enable_libicu" = "probe"; then | |
188 | AC_HAVE_LIBICU | |
189 | fi | |
190 | if test "$enable_libicu" = "yes" && test "$have_libicu" != "yes"; then | |
191 | AC_MSG_ERROR([libicu not found.]) | |
192 | fi | |
193 | fi | |
194 | AC_HAVE_OPENAT | |
195 | AC_HAVE_FSTATAT | |
196 | AC_HAVE_SG_IO | |
197 | AC_HAVE_HDIO_GETGEO | |
198 | AC_CONFIG_SYSTEMD_SYSTEM_UNIT_DIR | |
199 | AC_CONFIG_CROND_DIR | |
200 | ||
201 | if test "$enable_blkid" = yes; then | |
202 | AC_HAVE_BLKID_TOPO | |
203 | fi | |
204 | ||
205 | if test "$enable_ubsan" = "yes" || test "$enable_ubsan" = "probe"; then | |
206 | AC_PACKAGE_CHECK_UBSAN | |
207 | fi | |
208 | if test "$enable_ubsan" = "yes" && test "$have_ubsan" != "yes"; then | |
209 | AC_MSG_ERROR([UBSAN not supported by compiler.]) | |
210 | fi | |
211 | ||
212 | if test "$enable_addrsan" = "yes" || test "$enable_addrsan" = "probe"; then | |
213 | AC_PACKAGE_CHECK_ADDRSAN | |
214 | fi | |
215 | if test "$enable_addrsan" = "yes" && test "$have_addrsan" != "yes"; then | |
216 | AC_MSG_ERROR([ADDRSAN not supported by compiler.]) | |
217 | fi | |
218 | ||
219 | if test "$enable_threadsan" = "yes" || test "$enable_threadsan" = "probe"; then | |
220 | AC_PACKAGE_CHECK_THREADSAN | |
221 | fi | |
222 | if test "$enable_threadsan" = "yes" && test "$have_threadsan" != "yes"; then | |
223 | AC_MSG_ERROR([THREADSAN not supported by compiler.]) | |
224 | fi | |
225 | ||
226 | if test "$have_threadsan" = "yes" && test "$have_addrsan" = "yes"; then | |
227 | AC_MSG_WARN([ADDRSAN and THREADSAN are not known to work together.]) | |
228 | fi | |
229 | ||
230 | if test "$enable_lto" = "yes" || test "$enable_lto" = "probe"; then | |
231 | AC_PACKAGE_CHECK_LTO | |
232 | fi | |
233 | if test "$enable_lto" = "yes" && test "$have_lto" != "yes"; then | |
234 | AC_MSG_ERROR([LTO not supported by compiler.]) | |
235 | fi | |
236 | ||
237 | AC_CHECK_SIZEOF([long]) | |
238 | AC_CHECK_SIZEOF([char *]) | |
239 | AC_TYPE_UMODE_T | |
240 | AC_MANUAL_FORMAT | |
241 | ||
242 | AC_CONFIG_FILES([include/builddefs]) | |
243 | AC_OUTPUT |