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