1 AC_INIT([xfsprogs],[6.6.0],[linux-xfs@vger.kernel.org])
4 AC_CONFIG_MACRO_DIR([m4])
5 AC_CONFIG_SRCDIR([include/libxfs.h])
6 AC_PREFIX_DEFAULT(/usr)
12 AC_ARG_VAR(BUILD_CC, [C compiler for build tools])
13 if test "${BUILD_CC+set}" != "set"; then
14 if test $cross_compiling = no; then
17 AC_CHECK_PROGS(BUILD_CC, gcc cc)
20 AC_ARG_VAR(BUILD_CFLAGS, [C compiler flags for build tools])
21 if test "${BUILD_CFLAGS+set}" != "set"; then
22 if test $cross_compiling = no; then
23 BUILD_CFLAGS="$CFLAGS"
30 [ --enable-shared=[yes/no] Enable use of shared libraries [default=yes]],,
32 AC_SUBST(enable_shared)
34 AC_ARG_ENABLE(gettext,
35 [ --enable-gettext=[yes/no] Enable alternate language support [default=yes]],,
37 AC_SUBST(enable_gettext)
40 [ --enable-blkid=[yes/no] Enable use of block device id library [default=yes]],,
42 AC_SUBST(enable_blkid)
44 AC_ARG_ENABLE(editline,
45 [ --enable-editline=[yes/no] Enable editline command editing [default=no]],
46 test $enable_editline = yes && libeditline="-ledit",
49 AC_SUBST(enable_editline)
51 AC_ARG_ENABLE(termcap,
52 [ --enable-termcap=[yes/no] Enable terminal capabilities library [default=no]],
53 test $enable_termcap = yes && libtermcap="-ltermcap",)
58 [ --enable-lib64=[yes/no] Enable lib64 support [default=yes]],,
60 AC_SUBST(enable_lib64)
62 AC_ARG_WITH([multiarch],
63 [ --with-multiarch=ARCH Specify the multiarch triplet],
68 [ --enable-librt=[yes/no] Enable librt support [default=yes]],,
70 AC_SUBST(enable_librt)
72 # Enable UBSAN; set enable_ubsan=probe below to enable autoprobe.
74 [ --enable-ubsan=[yes/no] Enable Undefined Behavior Sanitizer (UBSAN) [default=no]],,
76 AC_SUBST(enable_ubsan)
78 # Enable ADDRSAN; set enable_addrsan=probe below to enable autoprobe.
79 AC_ARG_ENABLE(addrsan,
80 [ --enable-addrsan=[yes/no] Enable Address Sanitizer (ADDRSAN) [default=no]],,
82 AC_SUBST(enable_addrsan)
84 # Enable THREADSAN; set enable_threadsan=probe to enable autoprobe.
85 AC_ARG_ENABLE(threadsan,
86 [ --enable-threadsan=[yes/no] Enable Thread Sanitizer (THREADSAN) [default=no]],,
88 AC_SUBST(enable_threadsan)
91 [ --enable-lto=[yes/no] Enable link time optimization (LTO) [default=no]],,
95 # Enable xfs_scrub build
97 [ --enable-scrub=[yes/no] Enable build of xfs_scrub utility [default=yes]],,
99 AC_SUBST(enable_scrub)
101 # Enable libicu for xfs_scrubbing of malicious unicode sequences in names
102 AC_ARG_ENABLE(libicu,
103 [ --enable-libicu=[yes/no] Enable Unicode name scanning in xfs_scrub (libicu) [default=probe]],,
107 # If the user specified a libdir ending in lib64 do not append another
108 # 64 to the library names.
110 base_libdir=`basename "$libdir"`
117 # If the user specified a multiarch path then disable lib64
119 test -n "$multiarch" && enable_lib64=no
122 # Some important tools should be installed into the root partitions.
124 # Check whether exec_prefix=/usr: and install them to /sbin in that
125 # case. If the user chooses a different prefix assume they just want
126 # a local install for testing and not a system install.
128 case $exec_prefix:$prefix in
129 NONE:NONE | NONE:/usr | /usr:*)
131 root_libdir="/${base_libdir}"
134 root_sbindir="${sbindir}"
135 root_libdir="${libdir}"
139 AC_SUBST([root_sbindir])
140 AC_SUBST([root_libdir])
142 # Find localized files. Don't descend into any "dot directories"
143 # (like .git or .pc from quilt). Strangely, the "-print" argument
144 # to "find" is required, to avoid including such directories in the
147 for lfile in `find ${srcdir} -path './.??*' -prune -o -name '*.c' -type f -print || exit 1`; do
148 LOCALIZED_FILES="$LOCALIZED_FILES \$(TOPDIR)/$lfile"
150 AC_SUBST(LOCALIZED_FILES)
152 AC_PACKAGE_GLOBALS(xfsprogs)
153 AC_PACKAGE_UTILITIES(xfsprogs)
154 AC_MULTILIB($enable_lib64)
155 AC_MULTIARCH($multiarch)
158 AC_PACKAGE_NEED_INI_H
159 AC_PACKAGE_NEED_LIBINIH
161 AC_PACKAGE_NEED_UUID_H
162 AC_PACKAGE_NEED_UUIDCOMPARE
164 AC_PACKAGE_NEED_PTHREAD_H
165 AC_PACKAGE_NEED_PTHREADMUTEXINIT
167 AC_PACKAGE_NEED_URCU_H
168 AC_PACKAGE_NEED_RCU_INIT
178 AC_HAVE_COPY_FILE_RANGE
179 AC_HAVE_SYNC_FILE_RANGE
185 AC_NEED_INTERNAL_FSXATTR
186 AC_NEED_INTERNAL_FSCRYPT_ADD_KEY_ARG
187 AC_NEED_INTERNAL_FSCRYPT_POLICY_V2
194 AC_PACKAGE_WANT_ATTRIBUTES_H
196 if test "$enable_scrub" = "yes"; then
197 if test "$enable_libicu" = "yes" || test "$enable_libicu" = "probe"; then
200 if test "$enable_libicu" = "yes" && test "$have_libicu" != "yes"; then
201 AC_MSG_ERROR([libicu not found.])
208 AC_CONFIG_SYSTEMD_SYSTEM_UNIT_DIR
210 AC_CONFIG_UDEV_RULE_DIR
212 if test "$enable_blkid" = yes; then
216 if test "$enable_ubsan" = "yes" || test "$enable_ubsan" = "probe"; then
217 AC_PACKAGE_CHECK_UBSAN
219 if test "$enable_ubsan" = "yes" && test "$have_ubsan" != "yes"; then
220 AC_MSG_ERROR([UBSAN not supported by compiler.])
223 if test "$enable_addrsan" = "yes" || test "$enable_addrsan" = "probe"; then
224 AC_PACKAGE_CHECK_ADDRSAN
226 if test "$enable_addrsan" = "yes" && test "$have_addrsan" != "yes"; then
227 AC_MSG_ERROR([ADDRSAN not supported by compiler.])
230 if test "$enable_threadsan" = "yes" || test "$enable_threadsan" = "probe"; then
231 AC_PACKAGE_CHECK_THREADSAN
233 if test "$enable_threadsan" = "yes" && test "$have_threadsan" != "yes"; then
234 AC_MSG_ERROR([THREADSAN not supported by compiler.])
237 if test "$have_threadsan" = "yes" && test "$have_addrsan" = "yes"; then
238 AC_MSG_WARN([ADDRSAN and THREADSAN are not known to work together.])
241 if test "$enable_lto" = "yes" || test "$enable_lto" = "probe"; then
244 if test "$enable_lto" = "yes" && test "$have_lto" != "yes"; then
245 AC_MSG_ERROR([LTO not supported by compiler.])
249 AC_HAVE_LIBURCU_ATOMIC64
251 AC_CONFIG_FILES([include/builddefs])