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