]> git.ipfire.org Git - thirdparty/xfsprogs-dev.git/blame - configure.ac
xfs_repair: fix the problem of repair failure caused by dirty flag being abnormally...
[thirdparty/xfsprogs-dev.git] / configure.ac
CommitLineData
bacc3981 1AC_INIT([xfsprogs],[6.4.0],[linux-xfs@vger.kernel.org])
1a35c8df 2AC_PREREQ([2.69])
07c561fe
AG
3AC_CONFIG_AUX_DIR([.])
4AC_CONFIG_MACRO_DIR([m4])
f474cd4f 5AC_CONFIG_SRCDIR([include/libxfs.h])
69d66277 6AC_CONFIG_HEADERS([include/platform_defs.h])
521902a9 7AC_PREFIX_DEFAULT(/usr)
9440d84d 8
84322551 9AC_PROG_INSTALL
69d66277 10LT_INIT
07c561fe 11
e14913c1 12AC_PROG_CC
0a71e383
GG
13AC_ARG_VAR(BUILD_CC, [C compiler for build tools])
14if 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
20fi
21AC_ARG_VAR(BUILD_CFLAGS, [C compiler flags for build tools])
22if 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
e14913c1
TT
28fi
29
534b0bfd 30AC_ARG_ENABLE(shared,
09c343eb 31[ --enable-shared=[yes/no] Enable use of shared libraries [default=yes]],,
d5dca43b
NS
32 enable_shared=yes)
33AC_SUBST(enable_shared)
34
16c44ed2 35AC_ARG_ENABLE(gettext,
09c343eb 36[ --enable-gettext=[yes/no] Enable alternate language support [default=yes]],,
16c44ed2
NS
37 enable_gettext=yes)
38AC_SUBST(enable_gettext)
39
6635d6ab 40AC_ARG_ENABLE(blkid,
09c343eb 41[ --enable-blkid=[yes/no] Enable use of block device id library [default=yes]],,
6635d6ab
JT
42 enable_blkid=yes)
43AC_SUBST(enable_blkid)
44
d4b9ebda 45AC_ARG_ENABLE(editline,
09c343eb 46[ --enable-editline=[yes/no] Enable editline command editing [default=no]],
541a1d4f 47 test $enable_editline = yes && libeditline="-ledit",
d4b9ebda 48 enable_editline=no)
d4b9ebda
NS
49AC_SUBST(libeditline)
50AC_SUBST(enable_editline)
51
541a1d4f 52AC_ARG_ENABLE(termcap,
09c343eb 53[ --enable-termcap=[yes/no] Enable terminal capabilities library [default=no]],
541a1d4f
NS
54 test $enable_termcap = yes && libtermcap="-ltermcap",)
55AC_SUBST(libtermcap)
56
e4da9941 57
82805b60 58AC_ARG_ENABLE(lib64,
09c343eb 59[ --enable-lib64=[yes/no] Enable lib64 support [default=yes]],,
595e27db 60 enable_lib64=yes)
82805b60
TS
61AC_SUBST(enable_lib64)
62
e63257c0
DW
63AC_ARG_WITH([multiarch],
64[ --with-multiarch=ARCH Specify the multiarch triplet],
65 multiarch=$withval)
66AC_SUBST(multiarch)
67
1d43056b 68AC_ARG_ENABLE(librt,
09c343eb 69[ --enable-librt=[yes/no] Enable librt support [default=yes]],,
1d43056b
JT
70 enable_librt=yes)
71AC_SUBST(enable_librt)
0caa2bae 72
e99e3d7d
DW
73# Enable UBSAN; set enable_ubsan=probe below to enable autoprobe.
74AC_ARG_ENABLE(ubsan,
09c343eb 75[ --enable-ubsan=[yes/no] Enable Undefined Behavior Sanitizer (UBSAN) [default=no]],,
e99e3d7d
DW
76 enable_ubsan=no)
77AC_SUBST(enable_ubsan)
78
de9c45b8
DW
79# Enable ADDRSAN; set enable_addrsan=probe below to enable autoprobe.
80AC_ARG_ENABLE(addrsan,
09c343eb 81[ --enable-addrsan=[yes/no] Enable Address Sanitizer (ADDRSAN) [default=no]],,
de9c45b8
DW
82 enable_addrsan=no)
83AC_SUBST(enable_addrsan)
84
30127fbf
DW
85# Enable THREADSAN; set enable_threadsan=probe to enable autoprobe.
86AC_ARG_ENABLE(threadsan,
09c343eb 87[ --enable-threadsan=[yes/no] Enable Thread Sanitizer (THREADSAN) [default=no]],,
30127fbf
DW
88 enable_threadsan=no)
89AC_SUBST(enable_threadsan)
90
e61f1552 91AC_ARG_ENABLE(lto,
09c343eb 92[ --enable-lto=[yes/no] Enable link time optimization (LTO) [default=no]],,
d18ae0e7 93 enable_lto=no)
e61f1552
DW
94AC_SUBST(enable_lto)
95
9fae859a
ES
96# Enable xfs_scrub build
97AC_ARG_ENABLE(scrub,
09c343eb 98[ --enable-scrub=[yes/no] Enable build of xfs_scrub utility [default=yes]],,
9fae859a
ES
99 enable_scrub=yes)
100AC_SUBST(enable_scrub)
101
bff5d1a4
DW
102# Enable libicu for xfs_scrubbing of malicious unicode sequences in names
103AC_ARG_ENABLE(libicu,
09c343eb 104[ --enable-libicu=[yes/no] Enable Unicode name scanning in xfs_scrub (libicu) [default=probe]],,
bff5d1a4
DW
105 enable_libicu=probe)
106
595e27db
CH
107#
108# If the user specified a libdir ending in lib64 do not append another
109# 64 to the library names.
110#
111base_libdir=`basename "$libdir"`
112case $base_libdir in
113lib64)
114 enable_lib64=no
115esac
116
e63257c0
DW
117#
118# If the user specified a multiarch path then disable lib64
119#
120test -n "$multiarch" && enable_lib64=no
121
595e27db
CH
122#
123# Some important tools should be installed into the root partitions.
124#
125# Check whether exec_prefix=/usr: and install them to /sbin in that
15ce5839 126# case. If the user chooses a different prefix assume they just want
595e27db
CH
127# a local install for testing and not a system install.
128#
129case $exec_prefix:$prefix in
130NONE:NONE | NONE:/usr | /usr:*)
131 root_sbindir='/sbin'
595e27db 132 root_libdir="/${base_libdir}"
2ccb8cf0
CH
133 ;;
134*)
135 root_sbindir="${sbindir}"
136 root_libdir="${libdir}"
137 ;;
595e27db
CH
138esac
139
2ccb8cf0
CH
140AC_SUBST([root_sbindir])
141AC_SUBST([root_libdir])
142
d9ee1c4c
AE
143# Find localized files. Don't descend into any "dot directories"
144# (like .git or .pc from quilt). Strangely, the "-print" argument
145# to "find" is required, to avoid including such directories in the
146# list.
8c053393 147LOCALIZED_FILES=""
d9ee1c4c 148for lfile in `find ${srcdir} -path './.??*' -prune -o -name '*.c' -type f -print || exit 1`; do
8c053393
AM
149 LOCALIZED_FILES="$LOCALIZED_FILES \$(TOPDIR)/$lfile"
150done
151AC_SUBST(LOCALIZED_FILES)
152
16c44ed2
NS
153AC_PACKAGE_GLOBALS(xfsprogs)
154AC_PACKAGE_UTILITIES(xfsprogs)
82805b60 155AC_MULTILIB($enable_lib64)
e63257c0 156AC_MULTIARCH($multiarch)
1d43056b 157AC_RT($enable_librt)
93d9f139 158
50949a0f
DC
159AC_PACKAGE_NEED_INI_H
160AC_PACKAGE_NEED_LIBINIH
161
0686de0f 162AC_PACKAGE_NEED_UUID_H
7b9d2be9 163AC_PACKAGE_NEED_UUIDCOMPARE
fc49813f 164
949c0f10
NS
165AC_PACKAGE_NEED_PTHREAD_H
166AC_PACKAGE_NEED_PTHREADMUTEXINIT
167
e4da1b16
DC
168AC_PACKAGE_NEED_URCU_H
169AC_PACKAGE_NEED_RCU_INIT
170
0bba1a49
NS
171AC_HAVE_FADVISE
172AC_HAVE_MADVISE
173AC_HAVE_MINCORE
174AC_HAVE_SENDFILE
cfe6e3f0 175AC_HAVE_GETMNTENT
c0b5232a 176AC_HAVE_FALLOCATE
8f0e0912 177AC_HAVE_FIEMAP
c5deeac9 178AC_HAVE_PWRITEV2
197d5828 179AC_HAVE_PREADV
628e112a 180AC_HAVE_COPY_FILE_RANGE
197d5828 181AC_HAVE_SYNC_FILE_RANGE
eb24bcff 182AC_HAVE_SYNCFS
5ae294ea 183AC_HAVE_MNTENT
5121281b 184AC_HAVE_FLS
3bc05641 185AC_HAVE_READDIR
c14c7b79 186AC_HAVE_FSETXATTR
a49984b3 187AC_HAVE_MREMAP
6529e656 188AC_NEED_INTERNAL_FSXATTR
dfe209d8 189AC_NEED_INTERNAL_FSCRYPT_ADD_KEY_ARG
71956d72 190AC_HAVE_GETFSMAP
ce9adab0 191AC_HAVE_STATFS_FLAGS
dad79683 192AC_HAVE_MAP_SYNC
851c5d11 193AC_HAVE_DEVMAPPER
173a0283 194AC_HAVE_MALLINFO
c74f0468 195AC_HAVE_MALLINFO2
396cd022
DW
196AC_PACKAGE_WANT_ATTRIBUTES_H
197AC_HAVE_LIBATTR
9fae859a
ES
198if test "$enable_scrub" = "yes"; then
199 if test "$enable_libicu" = "yes" || test "$enable_libicu" = "probe"; then
200 AC_HAVE_LIBICU
201 fi
202 if test "$enable_libicu" = "yes" && test "$have_libicu" != "yes"; then
203 AC_MSG_ERROR([libicu not found.])
204 fi
bff5d1a4 205fi
b364a9c0
DW
206AC_HAVE_OPENAT
207AC_HAVE_FSTATAT
03c0cd8f
DW
208AC_HAVE_SG_IO
209AC_HAVE_HDIO_GETGEO
824b5807
DW
210AC_CONFIG_SYSTEMD_SYSTEM_UNIT_DIR
211AC_CONFIG_CROND_DIR
0bba1a49 212
6635d6ab
JT
213if test "$enable_blkid" = yes; then
214AC_HAVE_BLKID_TOPO
215fi
216
e99e3d7d
DW
217if test "$enable_ubsan" = "yes" || test "$enable_ubsan" = "probe"; then
218 AC_PACKAGE_CHECK_UBSAN
219fi
220if test "$enable_ubsan" = "yes" && test "$have_ubsan" != "yes"; then
221 AC_MSG_ERROR([UBSAN not supported by compiler.])
222fi
223
de9c45b8
DW
224if test "$enable_addrsan" = "yes" || test "$enable_addrsan" = "probe"; then
225 AC_PACKAGE_CHECK_ADDRSAN
226fi
227if test "$enable_addrsan" = "yes" && test "$have_addrsan" != "yes"; then
228 AC_MSG_ERROR([ADDRSAN not supported by compiler.])
229fi
230
30127fbf
DW
231if test "$enable_threadsan" = "yes" || test "$enable_threadsan" = "probe"; then
232 AC_PACKAGE_CHECK_THREADSAN
233fi
234if test "$enable_threadsan" = "yes" && test "$have_threadsan" != "yes"; then
235 AC_MSG_ERROR([THREADSAN not supported by compiler.])
236fi
237
238if test "$have_threadsan" = "yes" && test "$have_addrsan" = "yes"; then
239 AC_MSG_WARN([ADDRSAN and THREADSAN are not known to work together.])
240fi
241
e61f1552
DW
242if test "$enable_lto" = "yes" || test "$enable_lto" = "probe"; then
243 AC_PACKAGE_CHECK_LTO
244fi
245if test "$enable_lto" = "yes" && test "$have_lto" != "yes"; then
246 AC_MSG_ERROR([LTO not supported by compiler.])
247fi
248
865f1075
JE
249AC_CHECK_SIZEOF([long])
250AC_CHECK_SIZEOF([char *])
cd960ece 251AC_TYPE_UMODE_T
16c44ed2 252AC_MANUAL_FORMAT
7448af58 253AC_HAVE_LIBURCU_ATOMIC64
fc49813f 254
f474cd4f
JE
255AC_CONFIG_FILES([include/builddefs])
256AC_OUTPUT