1 AC_INIT([xfsprogs], [4.15.1], [linux-xfs@vger.kernel.org])
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)
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
18 AC_CHECK_PROGS(BUILD_CC, gcc cc)
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"
31 [ --enable-shared=[yes/no] Enable use of shared libraries [default=yes]],,
33 AC_SUBST(enable_shared)
35 AC_ARG_ENABLE(gettext,
36 [ --enable-gettext=[yes/no] Enable alternate language support [default=yes]],,
38 AC_SUBST(enable_gettext)
41 [ --enable-blkid=[yes/no] Enable use of block device id library [default=yes]],,
43 AC_SUBST(enable_blkid)
45 AC_ARG_ENABLE(readline,
46 [ --enable-readline=[yes/no] Enable readline command editing [default=no]],
47 test $enable_readline = yes && libreadline="-lreadline",
50 AC_SUBST(enable_readline)
52 AC_ARG_ENABLE(editline,
53 [ --enable-editline=[yes/no] Enable editline command editing [default=no]],
54 test $enable_editline = yes && libeditline="-ledit",
57 AC_SUBST(enable_editline)
59 AC_ARG_ENABLE(termcap,
60 [ --enable-termcap=[yes/no] Enable terminal capabilities library [default=no]],
61 test $enable_termcap = yes && libtermcap="-ltermcap",)
66 [ --enable-lib64=[yes/no] Enable lib64 support [default=yes]],,
68 AC_SUBST(enable_lib64)
71 [ --enable-librt=[yes/no] Enable librt support [default=yes]],,
73 AC_SUBST(enable_librt)
75 # Enable UBSAN; set enable_ubsan=probe below to enable autoprobe.
77 [ --enable-ubsan=[yes/no] Enable Undefined Behavior Sanitizer (UBSAN) [default=no]],,
79 AC_SUBST(enable_ubsan)
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]],,
85 AC_SUBST(enable_addrsan)
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]],,
91 AC_SUBST(enable_threadsan)
94 [ --enable-lto=[yes/no] Enable link time optimization (LTO) [default=probe]],,
99 # If the user specified a libdir ending in lib64 do not append another
100 # 64 to the library names.
102 base_libdir=`basename "$libdir"`
109 # Some important tools should be installed into the root partitions.
111 # Check whether exec_prefix=/usr: and install them to /sbin in that
112 # case. If the user choses a different prefix assume he just wants
113 # a local install for testing and not a system install.
115 case $exec_prefix:$prefix in
116 NONE:NONE | NONE:/usr | /usr:*)
118 root_libdir="/${base_libdir}"
121 root_sbindir="${sbindir}"
122 root_libdir="${libdir}"
126 AC_SUBST([root_sbindir])
127 AC_SUBST([root_libdir])
129 # Find localized files. Don't descend into any "dot directories"
130 # (like .git or .pc from quilt). Strangely, the "-print" argument
131 # to "find" is required, to avoid including such directories in the
134 for lfile in `find ${srcdir} -path './.??*' -prune -o -name '*.c' -type f -print || exit 1`; do
135 LOCALIZED_FILES="$LOCALIZED_FILES \$(TOPDIR)/$lfile"
137 AC_SUBST(LOCALIZED_FILES)
139 AC_PACKAGE_GLOBALS(xfsprogs)
140 AC_PACKAGE_UTILITIES(xfsprogs)
141 AC_MULTILIB($enable_lib64)
144 AC_PACKAGE_NEED_UUID_H
145 AC_PACKAGE_NEED_UUIDCOMPARE
147 AC_PACKAGE_NEED_PTHREAD_H
148 AC_PACKAGE_NEED_PTHREADMUTEXINIT
160 AC_HAVE_COPY_FILE_RANGE
161 AC_HAVE_SYNC_FILE_RANGE
168 AC_NEED_INTERNAL_FSXATTR
174 AC_PACKAGE_WANT_ATTRIBUTES_H
176 AC_PACKAGE_WANT_UNINORM_H
182 AC_CONFIG_SYSTEMD_SYSTEM_UNIT_DIR
185 if test "$enable_blkid" = yes; then
189 if test "$enable_ubsan" = "yes" || test "$enable_ubsan" = "probe"; then
190 AC_PACKAGE_CHECK_UBSAN
192 if test "$enable_ubsan" = "yes" && test "$have_ubsan" != "yes"; then
193 AC_MSG_ERROR([UBSAN not supported by compiler.])
196 if test "$enable_addrsan" = "yes" || test "$enable_addrsan" = "probe"; then
197 AC_PACKAGE_CHECK_ADDRSAN
199 if test "$enable_addrsan" = "yes" && test "$have_addrsan" != "yes"; then
200 AC_MSG_ERROR([ADDRSAN not supported by compiler.])
203 if test "$enable_threadsan" = "yes" || test "$enable_threadsan" = "probe"; then
204 AC_PACKAGE_CHECK_THREADSAN
206 if test "$enable_threadsan" = "yes" && test "$have_threadsan" != "yes"; then
207 AC_MSG_ERROR([THREADSAN not supported by compiler.])
210 if test "$have_threadsan" = "yes" && test "$have_addrsan" = "yes"; then
211 AC_MSG_WARN([ADDRSAN and THREADSAN are not known to work together.])
214 if test "$enable_lto" = "yes" || test "$enable_lto" = "probe"; then
217 if test "$enable_lto" = "yes" && test "$have_lto" != "yes"; then
218 AC_MSG_ERROR([LTO not supported by compiler.])
221 AC_PACKAGE_CHECK_RETPOLINE
222 AC_CHECK_SIZEOF([long])
223 AC_CHECK_SIZEOF([char *])
227 AC_CONFIG_FILES([include/builddefs])