]>
Commit | Line | Data |
---|---|---|
034d378b | 1 | AC_INIT([util-linux], |
38c75b59 | 2 | m4_esyscmd([tools/git-version-gen .tarball-version]), |
4230b2d4 | 3 | [kzak@redhat.com], [], |
033b5a52 | 4 | [https://www.kernel.org/pub/linux/utils/util-linux/]) |
baf39af1 | 5 | |
b0e6b25e | 6 | |
4230b2d4 | 7 | AC_PREREQ([2.64]) |
48d7b13a | 8 | |
034d378b | 9 | AC_CONFIG_AUX_DIR([config]) |
b12991dd | 10 | AC_CONFIG_MACRO_DIR([m4]) |
eaf70198 | 11 | dnl AC_USE_SYSTEM_EXTENSIONS must be called before any macros that run |
4230b2d4 | 12 | dnl the compiler (like LT_INIT) to avoid autoconf errors. |
eaf70198 | 13 | AC_USE_SYSTEM_EXTENSIONS |
a527a360 | 14 | AM_INIT_AUTOMAKE([-Wall -Wno-portability foreign 1.10 tar-pax no-dist-gzip dist-xz subdir-objects]) |
48d7b13a | 15 | |
eb35c251 | 16 | m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])], |
f06b4328 | 17 | [AC_SUBST([AM_DEFAULT_VERBOSITY], [1])]) |
316795fc | 18 | m4_ifdef([AM_PROG_AR], [AM_PROG_AR]) |
eb35c251 | 19 | |
034d378b | 20 | AC_CONFIG_SRCDIR([sys-utils/mount.c]) |
15a9b48c SK |
21 | AC_PREFIX_DEFAULT([/usr]) |
22 | ||
33b0be6d KZ |
23 | dnl version details from <major>.<minor>[-<suffix>] |
24 | PACKAGE_VERSION_MAJOR=$(echo $PACKAGE_VERSION | awk -F. '{print $1}') | |
0f0972ac | 25 | PACKAGE_VERSION_MINOR=$(echo $PACKAGE_VERSION | awk -F. '{ |
c25b7d8a | 26 | sub("-.*","",$2); print $2}') |
c42a6d4d | 27 | PACKAGE_VERSION_RELEASE=$(echo $PACKAGE_VERSION | awk -F. '{ |
c25b7d8a | 28 | sub("-.*","",$3); print $3 ~ /^@<:@0-9@:>@+$/ ? $3 : 0}') |
a0948ffe | 29 | |
33b0be6d KZ |
30 | dnl libblkid version |
31 | LIBBLKID_VERSION="$PACKAGE_VERSION_MAJOR.$PACKAGE_VERSION_MINOR.$PACKAGE_VERSION_RELEASE" | |
3401d7c4 | 32 | LIBBLKID_DATE="24-Jan-2024" |
dc2b8d87 KZ |
33 | LIBBLKID_LT_MAJOR=1 |
34 | LIBBLKID_LT_MINOR=1 | |
35 | LIBBLKID_LT_MICRO=0 | |
36 | LIBBLKID_VERSION_INFO=`expr $LIBBLKID_LT_MAJOR + $LIBBLKID_LT_MINOR`:$LIBBLKID_LT_MICRO:$LIBBLKID_LT_MINOR | |
a0948ffe | 37 | |
f6076f55 KZ |
38 | dnl libuuid version |
39 | LIBUUID_VERSION="$PACKAGE_VERSION_MAJOR.$PACKAGE_VERSION_MINOR.$PACKAGE_VERSION_RELEASE" | |
dc2b8d87 KZ |
40 | LIBUUID_LT_MAJOR=1 |
41 | LIBUUID_LT_MINOR=3 | |
42 | LIBUUID_LT_MICRO=0 | |
43 | LIBUUID_VERSION_INFO=`expr $LIBUUID_LT_MAJOR + $LIBUUID_LT_MINOR`:$LIBUUID_LT_MICRO:$LIBUUID_LT_MINOR | |
f6076f55 | 44 | |
c2e299d0 SS |
45 | dnl liblastlog2 version |
46 | LIBLASTLOG2_VERSION="$PACKAGE_VERSION_MAJOR.$PACKAGE_VERSION_MINOR.$PACKAGE_VERSION_RELEASE" | |
476c8614 SS |
47 | LIBLASTLOG2_LT_MAJOR=2 |
48 | LIBLASTLOG2_LT_MINOR=0 | |
c2e299d0 SS |
49 | LIBLASTLOG2_LT_MICRO=0 |
50 | LIBLASTLOG2_VERSION_INFO=`expr $LIBLASTLOG2_LT_MAJOR + $LIBLASTLOG2_LT_MINOR`:$LIBLASTLOG2_LT_MICRO:$LIBLASTLOG2_LT_MINOR | |
51 | ||
f1cde479 KZ |
52 | dnl libmount version |
53 | LIBMOUNT_VERSION="$PACKAGE_VERSION_MAJOR.$PACKAGE_VERSION_MINOR.$PACKAGE_VERSION_RELEASE" | |
54 | LIBMOUNT_LT_MAJOR=1 | |
55 | LIBMOUNT_LT_MINOR=1 | |
56 | LIBMOUNT_LT_MICRO=0 | |
57 | LIBMOUNT_VERSION_INFO=`expr $LIBMOUNT_LT_MAJOR + $LIBMOUNT_LT_MINOR`:$LIBMOUNT_LT_MICRO:$LIBMOUNT_LT_MINOR | |
58 | ||
1a4d989e OO |
59 | dnl libsmartcols version |
60 | LIBSMARTCOLS_VERSION="$PACKAGE_VERSION_MAJOR.$PACKAGE_VERSION_MINOR.$PACKAGE_VERSION_RELEASE" | |
61 | LIBSMARTCOLS_LT_MAJOR=1 | |
62 | LIBSMARTCOLS_LT_MINOR=1 | |
63 | LIBSMARTCOLS_LT_MICRO=0 | |
64 | LIBSMARTCOLS_VERSION_INFO=`expr $LIBSMARTCOLS_LT_MAJOR + $LIBSMARTCOLS_LT_MINOR`:$LIBSMARTCOLS_LT_MICRO:$LIBSMARTCOLS_LT_MINOR | |
65 | ||
0bb4c979 KZ |
66 | dnl libfdisk version |
67 | LIBFDISK_VERSION="$PACKAGE_VERSION_MAJOR.$PACKAGE_VERSION_MINOR.$PACKAGE_VERSION_RELEASE" | |
68 | LIBFDISK_LT_MAJOR=1 | |
69 | LIBFDISK_LT_MINOR=1 | |
70 | LIBFDISK_LT_MICRO=0 | |
71 | LIBFDISK_VERSION_INFO=`expr $LIBFDISK_LT_MAJOR + $LIBFDISK_LT_MINOR`:$LIBFDISK_LT_MICRO:$LIBFDISK_LT_MINOR | |
72 | ||
15a9b48c | 73 | # Check whether exec_prefix=/usr: |
9f57e6e8 SK |
74 | AS_CASE([$exec_prefix:$prefix], |
75 | [NONE:NONE | NONE:/usr | /usr:*], | |
76 | [AC_MSG_NOTICE([Default --exec-prefix detected.]) | |
17794746 KZ |
77 | AS_CASE([$bindir], ['${exec_prefix}/bin'], [bindir=/bin; AC_MSG_NOTICE([ --bindir defaults to /bin]) ]) |
78 | AS_CASE([$sbindir], ['${exec_prefix}/sbin'], [sbindir=/sbin; AC_MSG_NOTICE([ --sbindir defaults to /sbin])]) | |
79 | AS_CASE([$libdir], ['${exec_prefix}/lib'], [libdir=/lib; AC_MSG_NOTICE([ --libdir defaults to /lib]) ]) | |
f40e316f | 80 | AS_CASE([$libdir], ['${exec_prefix}/lib64'],[libdir=/lib64; AC_MSG_NOTICE([ --libdir defaults to /lib64]) ]) |
9f57e6e8 SK |
81 | ] |
82 | ) | |
83 | ||
3d289965 KZ |
84 | # Check whether prefix=/usr |
85 | AS_CASE([$prefix], | |
86 | [NONE | /usr], | |
87 | [AC_MSG_NOTICE([Default --prefix detected.]) | |
88 | AS_CASE([$localstatedir], [NONE | '${prefix}/var' | "${prefix}"/var ], | |
89 | [localstatedir=/var; AC_MSG_NOTICE([ --localstatedir defaults to /var])]) | |
90 | AS_CASE([$sysconfdir], [NONE | '${prefix}/etc' | "${prefix}"/etc ], | |
91 | [sysconfdir=/etc; AC_MSG_NOTICE([ --sysconfdir defaults to /etc])]) | |
92 | ||
93 | ] | |
94 | ) | |
107b2fbe KZ |
95 | AC_SUBST([localstatedir]) |
96 | ||
8df54559 AH |
97 | |
98 | # default for old versions without $runstatedir | |
99 | AS_IF([test x"$runstatedir" = x], [runstatedir='${localstatedir}/run']) | |
100 | ||
101 | # our default if $localstatedir unchanged | |
102 | AS_CASE([$localstatedir:$runstatedir], | |
103 | [NONE:'${localstatedir}/run' | /var:'${localstatedir}/run' | NONE:'/run' ], | |
104 | [runstatedir=/run; AC_MSG_NOTICE([ --runstatedir defaults to /run])] | |
9f57e6e8 | 105 | ) |
8df54559 | 106 | AC_SUBST([runstatedir]) |
07a16b9d | 107 | |
b0a0d7d5 | 108 | |
996fb358 | 109 | # The original default values of {bin,sbin,lib}dir |
aaf3e8f5 | 110 | usrbin_execdir='${exec_prefix}/bin' |
30688dde | 111 | AC_SUBST([usrbin_execdir]) |
996fb358 | 112 | |
aaf3e8f5 | 113 | usrsbin_execdir='${exec_prefix}/sbin' |
30688dde | 114 | AC_SUBST([usrsbin_execdir]) |
996fb358 | 115 | |
9f57e6e8 | 116 | AS_CASE([$libdir], |
b2b61efc | 117 | ['${exec_prefix}/'* | '${prefix}/'* | /usr/* | "${prefix}"/* ], |
9f57e6e8 SK |
118 | [usrlib_execdir=$libdir], |
119 | [usrlib_execdir='${exec_prefix}'$libdir] | |
120 | ) | |
30688dde | 121 | AC_SUBST([usrlib_execdir]) |
996fb358 | 122 | |
c2409b55 KZ |
123 | # static configuration maintaned by packages (e.g. /usr/lib) |
124 | AC_ARG_VAR([SYSCONFSTATICDIR], | |
125 | [Path to static system configuration, default ${prefix}/lib]) | |
126 | AS_IF([test "x$SYSCONFSTATICDIR" = x], | |
127 | [sysconfstaticdir='${prefix}/lib'], | |
128 | [sysconfstaticdir=$SYSCONFSTATICDIR]) | |
129 | AC_SUBST([sysconfstaticdir]) | |
130 | ||
4230b2d4 | 131 | AC_PROG_CC |
31c9c1c4 | 132 | AM_PROG_CC_C_O |
18336d16 | 133 | AC_PROG_MKDIR_P |
30d7f61f | 134 | AC_PROG_YACC |
cf4f9ec8 KZ |
135 | |
136 | # Don't use autotools integrated LEX/YACC support for libsmartcols | |
137 | AC_PATH_PROG([FLEX], [flex]) | |
138 | AC_PATH_PROG([BISON], [bison]) | |
139 | ||
a6996860 | 140 | AC_CANONICAL_HOST |
85b4c147 | 141 | AC_C_CONST |
e79829db | 142 | AC_C_VOLATILE |
b12991dd | 143 | |
0e60bc9b | 144 | dnl Compiler warnings |
b1b54edf | 145 | UL_WARN_ADD([-fno-common]) |
9dc72d0b | 146 | UL_WARN_ADD([-Wall]) |
0e60bc9b | 147 | UL_WARN_ADD([-Wextra]) |
c25b7d8a SK |
148 | |
149 | UL_WARN_ADD([-Waddress-of-packed-member]) | |
150 | UL_WARN_ADD([-Wdiscarded-qualifiers]) | |
4230d576 | 151 | UL_WARN_ADD([-Wembedded-directive]) |
c25b7d8a SK |
152 | UL_WARN_ADD([-Wextra-semi]) |
153 | UL_WARN_ADD([-Wformat-security]) | |
154 | UL_WARN_ADD([-Wimplicit-function-declaration]) | |
b1b54edf KZ |
155 | UL_WARN_ADD([-Wmissing-declarations]) |
156 | UL_WARN_ADD([-Wmissing-parameter-type]) | |
157 | UL_WARN_ADD([-Wmissing-prototypes]) | |
c25b7d8a | 158 | UL_WARN_ADD([-Wnested-externs]) |
0e60bc9b | 159 | UL_WARN_ADD([-Wno-missing-field-initializers]) |
9df5ac34 | 160 | UL_WARN_ADD([-Wold-style-definition]) |
c25b7d8a | 161 | UL_WARN_ADD([-Wpointer-arith]) |
b1b54edf | 162 | UL_WARN_ADD([-Wredundant-decls]) |
0e60bc9b | 163 | UL_WARN_ADD([-Wsign-compare]) |
c25b7d8a | 164 | UL_WARN_ADD([-Wstrict-prototypes]) |
0e60bc9b KZ |
165 | UL_WARN_ADD([-Wtype-limits]) |
166 | UL_WARN_ADD([-Wuninitialized]) | |
b1b54edf KZ |
167 | UL_WARN_ADD([-Wunused-but-set-parameter]) |
168 | UL_WARN_ADD([-Wunused-but-set-variable]) | |
0e60bc9b | 169 | UL_WARN_ADD([-Wunused-parameter]) |
0e60bc9b | 170 | UL_WARN_ADD([-Wunused-result]) |
bec5c9db | 171 | UL_WARN_ADD([-Wunused-variable]) |
a52f9bdd | 172 | UL_WARN_ADD([-Wvla]) |
2a91b213 | 173 | UL_WARN_ADD([-Walloca]) |
63c80c4c KZ |
174 | |
175 | AC_ARG_ENABLE([werror], | |
176 | AS_HELP_STRING([--enable-werror], [make all compiler warnings into errors]), | |
177 | [], [enable_werror=no] | |
178 | ) | |
179 | AS_IF([test "x$enable_werror" = xyes], [ | |
180 | UL_WARN_ADD([-Werror]) | |
181 | ],[ | |
182 | UL_WARN_ADD([-Werror=sequence-point]) | |
183 | ]) | |
184 | ||
0e60bc9b KZ |
185 | AC_SUBST([WARN_CFLAGS]) |
186 | ||
63c80c4c | 187 | |
034d378b | 188 | UL_WARN_ADD([-Wno-clobbered], [BSD_WARN_CFLAGS]) |
7697771d | 189 | AC_SUBST([BSD_WARN_CFLAGS]) |
4f9d999a KZ |
190 | |
191 | UL_WARN_ADD([-Wno-cast-function-type], [PYTHON_WARN_CFLAGS]) | |
192 | AC_SUBST([PYTHON_WARN_CFLAGS]) | |
193 | ||
b97cc9a8 KZ |
194 | |
195 | AC_ARG_ENABLE([asan], | |
196 | AS_HELP_STRING([--enable-asan], [compile with Address Sanitizer]), | |
197 | [], [enable_asan=no] | |
198 | ) | |
2afbcec5 | 199 | AS_IF([test "x$enable_asan" = xyes], [ |
b97cc9a8 | 200 | UL_WARN_ADD([-fsanitize=address]) |
ef61c093 | 201 | ASAN_LDFLAGS="-fsanitize=address" |
b97cc9a8 | 202 | ]) |
ef61c093 | 203 | AC_SUBST([ASAN_LDFLAGS]) |
b97cc9a8 | 204 | |
e6a4d8cc EV |
205 | AC_ARG_ENABLE([ubsan], |
206 | AS_HELP_STRING([--enable-ubsan], [compile with UBsan]), | |
207 | [], [enable_ubsan=no] | |
208 | ) | |
209 | AS_IF([test "x$enable_ubsan" = xyes], [ | |
210 | UL_WARN_ADD([-fsanitize=undefined]) | |
211 | UBSAN_LDFLAGS="-fsanitize=undefined" | |
212 | ]) | |
213 | AC_SUBST([UBSAN_LDFLAGS]) | |
214 | ||
ccdc47b7 EV |
215 | AC_ARG_ENABLE([fuzzing-engine], |
216 | AS_HELP_STRING([--enable-fuzzing-engine], [compile with fuzzing engine]), | |
217 | [], [enable_fuzzing_engine=no] | |
218 | ) | |
948182f4 | 219 | AS_IF([test "x$enable_fuzzing_engine" = xyes && test "x$LIB_FUZZING_ENGINE" = x], [ |
75196cd8 EV |
220 | UL_WARN_ADD([-fno-omit-frame-pointer]) |
221 | UL_WARN_ADD([-gline-tables-only]) | |
222 | UL_WARN_ADD([-fsanitize=fuzzer-no-link]) | |
223 | FUZZING_ENGINE_LDFLAGS="-fsanitize=fuzzer-no-link" | |
224 | ]) | |
225 | AC_SUBST([FUZZING_ENGINE_LDFLAGS]) | |
ccdc47b7 | 226 | AC_PROG_CXX |
75196cd8 EV |
227 | AM_CONDITIONAL([FUZZING_ENGINE], [test "x$enable_fuzzing_engine" = xyes]) |
228 | AM_CONDITIONAL([OSS_FUZZ], [test "x$LIB_FUZZING_ENGINE" != x]) | |
ccdc47b7 | 229 | |
b4b8f8c2 FS |
230 | AC_ARG_ENABLE([coverage], |
231 | AS_HELP_STRING([--enable-coverage], [compile with gcov]), | |
232 | [], [enable_coverage=no] | |
233 | ) | |
234 | AS_IF([test "x$enable_coverage" = xyes], [ | |
235 | UL_WARN_ADD([--coverage]) | |
236 | COVERAGE_LDFLAGS="--coverage" | |
237 | ]) | |
238 | AC_SUBST([COVERAGE_LDFLAGS]) | |
239 | AM_CONDITIONAL([WITH_COVERAGE], [test "x$enable_coverage" = xyes]) | |
240 | ||
b12991dd KZ |
241 | dnl libtool-2 |
242 | LT_INIT | |
48d7b13a | 243 | |
3719bf8d RM |
244 | dnl check supported linker flags |
245 | AX_CHECK_VSCRIPT | |
246 | ||
fd0f4132 SK |
247 | m4_ifndef([PKG_PROG_PKG_CONFIG], |
248 | [m4_fatal([Could not locate the pkg-config autoconf | |
249 | macros. These are usually located in /usr/share/aclocal/pkg.m4. | |
250 | If your macros are in a different location, try setting the | |
251 | environment variable AL_OPTS="-I/other/macro/dir" before running | |
bf2603c7 | 252 | ./autogen.sh or autoreconf again. Make sure pkg-config is installed.])]) |
d06d028a | 253 | PKG_PROG_PKG_CONFIG |
99f95a1e | 254 | PKG_INSTALLDIR(['${usrlib_execdir}/pkgconfig']) |
d06d028a | 255 | |
22aa5166 KZ |
256 | GTK_DOC_CHECK([1.10]) |
257 | AC_PATH_PROG([XSLTPROC], [xsltproc]) | |
236421a4 KZ |
258 | |
259 | ||
8c182554 | 260 | linux_os=no |
8026fa9b KZ |
261 | bsd_os=no |
262 | AS_CASE([${host_os}], | |
263 | [*linux*], | |
264 | [linux_os=yes], | |
40733239 RM |
265 | [*darwin*], |
266 | [darwin_os=yes], | |
8026fa9b KZ |
267 | [*bsd*], |
268 | [bsd_os=yes]) | |
034d378b | 269 | AM_CONDITIONAL([LINUX], [test "x$linux_os" = xyes]) |
40733239 | 270 | AM_CONDITIONAL([DARWIN], [test "x$darwin_os" = xyes]) |
8026fa9b KZ |
271 | AM_CONDITIONAL([BSD], [test "x$bsd_os" = xyes]) |
272 | ||
40733239 RM |
273 | AS_IF([test "x$darwin_os" = xyes], [ |
274 | AC_DEFINE([_DARWIN_C_SOURCE], [1], [Enable MAP_ANON in sys/mman.h on Mac OS X]) | |
275 | ]) | |
8c182554 | 276 | |
3c6e292c | 277 | dnl define ARCH_<NAME> conditionals |
034d378b SK |
278 | UL_SET_ARCH([I86], [i?86-*]) |
279 | UL_SET_ARCH([86_64], [x86_64*]) | |
280 | UL_SET_ARCH([IA64], [ia64*]) | |
281 | UL_SET_ARCH([S390], [s390*]) | |
282 | UL_SET_ARCH([SPARC], [sparc*]) | |
283 | UL_SET_ARCH([PPC], [ppc*|powerpc*]) | |
284 | UL_SET_ARCH([M68K], [m68*]) | |
285 | UL_SET_ARCH([MIPS], [mips*]) | |
f319e301 | 286 | UL_SET_ARCH([HPPA], [hppa*|parisc*]) |
3c6e292c | 287 | |
48d7b13a | 288 | AC_SYS_LARGEFILE |
2c656779 | 289 | AC_HEADER_ASSERT |
f69eba17 | 290 | AC_STRUCT_TIMEZONE |
f6e7a21c TW |
291 | UL_YEAR2038_INIT |
292 | AC_SYS_YEAR2038_RECOMMENDED | |
48d7b13a | 293 | |
f8d75a66 | 294 | dnl Don't forget to maintain alternatively allowed versions in autogen.sh! |
91c520bc | 295 | AM_GNU_GETTEXT_VERSION([0.18.3]) |
09734b00 | 296 | AM_GNU_GETTEXT([external]) |
3013eb9d SK |
297 | |
298 | AS_IF([test -d "$srcdir/po"], [ | |
299 | ALL_LINGUAS=`cd $srcdir/po > /dev/null && echo *.po | sed 's/\.po//g'` | |
c25b7d8a SK |
300 | ], [dnl echo $ALL_LINGUAS | sed 's/ /\n/g' | sort -u | column -xc 72 -o ' ' | sed 's/^/\t/' |
301 | ALL_LINGUAS=" | |
302 | af am ar as be bg bn bn_IN ca | |
303 | cs cy da de el en_GB es et eu_ES | |
304 | fa fi fr gl gu he hi hr hu | |
305 | hy id is it ja ka kn ko ku | |
306 | lo lt lv mk ml mr ms my nb | |
307 | nl nn no nso or pa pl pt pt_BR | |
308 | ro ru si sk sl sq sr sr@Latn sv | |
309 | ta te th tr uk ur vi zh_CN zh_TW | |
310 | zu | |
311 | "]) | |
09734b00 | 312 | |
e460a5bf | 313 | AC_CHECK_HEADERS([linux/compiler.h linux/blkpg.h linux/major.h], [], [], [ |
48d7b13a KZ |
314 | #ifdef HAVE_LINUX_COMPILER_H |
315 | #include <linux/compiler.h> | |
316 | #endif | |
317 | ]) | |
f06b4328 | 318 | AC_CHECK_HEADERS([ \ |
908ac36f MY |
319 | asm-generic/fcntl.h \ |
320 | asm/fcntl.h \ | |
f06b4328 | 321 | asm/io.h \ |
c25b7d8a SK |
322 | byteswap.h \ |
323 | endian.h \ | |
f06b4328 | 324 | err.h \ |
a0948ffe | 325 | errno.h \ |
f06b4328 | 326 | fcntl.h \ |
a0948ffe | 327 | getopt.h \ |
f06b4328 | 328 | inttypes.h \ |
6578ced7 | 329 | lastlog.h \ |
77835be2 | 330 | libutil.h \ |
ba05b9ff | 331 | linux/audit.h \ |
0c44599f | 332 | linux/bpf.h \ |
647f80e4 | 333 | linux/blkzoned.h \ |
5a971329 | 334 | linux/btrfs.h \ |
c25b7d8a | 335 | linux/capability.h \ |
f06b4328 SK |
336 | linux/cdrom.h \ |
337 | linux/falloc.h \ | |
a0948ffe | 338 | linux/fd.h \ |
c25b7d8a | 339 | linux/fiemap.h \ |
ae015d71 | 340 | linux/landlock.h \ |
f4d700d7 | 341 | linux/kcmp.h \ |
c25b7d8a | 342 | linux/net_namespace.h \ |
d652d4c6 | 343 | linux/nsfs.h \ |
627428a9 | 344 | linux/pr.h \ |
f06b4328 | 345 | linux/raw.h \ |
c25b7d8a | 346 | linux/securebits.h \ |
a0948ffe KZ |
347 | linux/tiocl.h \ |
348 | linux/version.h \ | |
c25b7d8a | 349 | linux/watchdog.h \ |
259bed15 | 350 | linux/if_alg.h \ |
8b7f16fc | 351 | locale.h \ |
607c2a72 | 352 | mntent.h \ |
754fed0c | 353 | net/if_dl.h \ |
c25b7d8a | 354 | net/if.h \ |
f06b4328 SK |
355 | netinet/in.h \ |
356 | paths.h \ | |
357 | pty.h \ | |
fe2c9909 | 358 | security/pam_appl.h \ |
dd3bbc9c | 359 | security/pam_modules.h \ |
c25b7d8a | 360 | shadow.h \ |
f06b4328 | 361 | stdint.h \ |
78288764 | 362 | stdio_ext.h \ |
a0948ffe KZ |
363 | stdlib.h \ |
364 | sys/disk.h \ | |
365 | sys/disklabel.h \ | |
c25b7d8a | 366 | sys/endian.h \ |
f06b4328 | 367 | sys/file.h \ |
f06b4328 SK |
368 | sys/ioccom.h \ |
369 | sys/ioctl.h \ | |
c25b7d8a | 370 | sys/io.h \ |
a0948ffe | 371 | sys/mkdev.h \ |
ac1c53e4 | 372 | sys/mount.h \ |
4ebac79f | 373 | sys/param.h \ |
84732a88 | 374 | sys/pidfd.h \ |
a0948ffe | 375 | sys/prctl.h \ |
f06b4328 | 376 | sys/resource.h \ |
c25b7d8a | 377 | sys/sendfile.h \ |
651b25cd | 378 | sys/signalfd.h \ |
2a7c1f70 | 379 | sys/socket.h \ |
f06b4328 | 380 | sys/sockio.h \ |
a0948ffe | 381 | sys/stat.h \ |
3671d4a8 | 382 | sys/statfs.h \ |
f06b4328 SK |
383 | sys/swap.h \ |
384 | sys/syscall.h \ | |
c25b7d8a | 385 | sys/sysmacros.h \ |
f06b4328 | 386 | sys/time.h \ |
87ee2658 | 387 | sys/timex.h \ |
00c505d9 | 388 | sys/ttydefaults.h \ |
a0948ffe | 389 | sys/types.h \ |
ac1c53e4 | 390 | sys/ucred.h \ |
754fed0c | 391 | sys/un.h \ |
3671d4a8 | 392 | sys/vfs.h \ |
40b119b9 | 393 | sys/xattr.h \ |
f06b4328 | 394 | unistd.h \ |
77835be2 | 395 | utmp.h \ |
b4b919fe | 396 | utmpx.h \ |
f06b4328 | 397 | ]) |
dc61d398 | 398 | |
a0357292 KZ |
399 | # There is a collision in old kernel-headers. The both files mount.h and fs.h |
400 | # define MS_* macros. Fixed by kernel commit e462ec50cb5fad19f6003a3d8087f4a0945dd2b1. | |
401 | # | |
402 | AC_CHECK_HEADERS([linux/fs.h ], [], [], | |
403 | [#ifdef HAVE_SYS_MOUNT_H | |
404 | # include <linux/fs.h> | |
405 | # include <sys/mount.h> | |
406 | #endif | |
407 | ]) | |
408 | ||
5502e73d MM |
409 | AC_CHECK_HEADERS([linux/mount.h ], [], [], |
410 | [#ifdef HAVE_LINUX_MOUNT_H | |
411 | # include <linux/mount.h> | |
412 | #endif | |
413 | ]) | |
414 | ||
db4e2645 KZ |
415 | AC_CHECK_HEADERS([linux/gsmmux.h ], [], [], |
416 | [#ifdef LINUX_GSMMUX_H | |
417 | # include <linux/gsmmux.h> | |
418 | #endif | |
419 | ]) | |
420 | ||
fe2c9909 WJ |
421 | AC_CHECK_HEADERS([security/pam_misc.h], |
422 | [AM_CONDITIONAL([HAVE_LINUXPAM], [true])], | |
423 | [AM_CONDITIONAL([HAVE_LINUXPAM], [false])], [ | |
424 | #ifdef HAVE_SECURITY_PAM_APPL_H | |
425 | #include <security/pam_appl.h> | |
426 | #endif | |
427 | ]) | |
428 | ||
e5ad3a6a SK |
429 | AC_CHECK_DECLS([BLK_ZONE_REP_CAPACITY], [], [], [ |
430 | #include <linux/blkzoned.h> | |
431 | ]) | |
432 | ||
627428a9 | 433 | AC_CHECK_DECLS([PR_REP_CAPACITY], [], [], [ |
434 | #include <linux/pr.h> | |
435 | ]) | |
436 | ||
fe2c9909 WJ |
437 | AC_CHECK_HEADERS([security/openpam.h], [], [], [ |
438 | #ifdef HAVE_SECURITY_PAM_APPL_H | |
439 | #include <security/pam_appl.h> | |
440 | #endif | |
441 | ]) | |
442 | ||
a67387b7 | 443 | AC_CHECK_HEADERS([langinfo.h], |
ac660b80 ZJS |
444 | [AM_CONDITIONAL([HAVE_LANGINFO_H], [true])], |
445 | [AM_CONDITIONAL([HAVE_LANGINFO_H], [false])]) | |
a67387b7 | 446 | |
4e12a62e RL |
447 | AC_MSG_CHECKING([whether langinfo.h defines ALTMON_x constants]) |
448 | AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ | |
449 | #include <langinfo.h> | |
450 | ]], [[ | |
451 | char *str; | |
452 | str = nl_langinfo (ALTMON_1); | |
453 | str = nl_langinfo (ALTMON_2); | |
454 | str = nl_langinfo (ALTMON_3); | |
455 | str = nl_langinfo (ALTMON_4); | |
456 | str = nl_langinfo (ALTMON_5); | |
457 | str = nl_langinfo (ALTMON_6); | |
458 | str = nl_langinfo (ALTMON_7); | |
459 | str = nl_langinfo (ALTMON_8); | |
460 | str = nl_langinfo (ALTMON_9); | |
461 | str = nl_langinfo (ALTMON_10); | |
462 | str = nl_langinfo (ALTMON_11); | |
463 | str = nl_langinfo (ALTMON_12); | |
464 | ]])], [ | |
465 | AC_MSG_RESULT([yes]) | |
466 | AC_DEFINE([HAVE_LANGINFO_ALTMON], [1], | |
467 | [Define if langinfo.h defines ALTMON_x constants]) | |
468 | ], [ | |
469 | AC_MSG_RESULT([no]) | |
470 | ]) | |
471 | ||
472 | ||
473 | AC_MSG_CHECKING([whether langinfo.h defines _NL_ABALTMON_x constants]) | |
474 | AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ | |
475 | #include <langinfo.h> | |
476 | ]], [[ | |
477 | char *str; | |
478 | str = nl_langinfo (_NL_ABALTMON_1); | |
479 | str = nl_langinfo (_NL_ABALTMON_2); | |
480 | str = nl_langinfo (_NL_ABALTMON_3); | |
481 | str = nl_langinfo (_NL_ABALTMON_4); | |
482 | str = nl_langinfo (_NL_ABALTMON_5); | |
483 | str = nl_langinfo (_NL_ABALTMON_6); | |
484 | str = nl_langinfo (_NL_ABALTMON_7); | |
485 | str = nl_langinfo (_NL_ABALTMON_8); | |
486 | str = nl_langinfo (_NL_ABALTMON_9); | |
487 | str = nl_langinfo (_NL_ABALTMON_10); | |
488 | str = nl_langinfo (_NL_ABALTMON_11); | |
489 | str = nl_langinfo (_NL_ABALTMON_12); | |
490 | ]])], [ | |
491 | AC_MSG_RESULT([yes]) | |
492 | AC_DEFINE([HAVE_LANGINFO_NL_ABALTMON], [1], | |
493 | [Define if langinfo.h defines _NL_ABALTMON_x constants]) | |
494 | ], [ | |
495 | AC_MSG_RESULT([no]) | |
496 | ]) | |
497 | ||
498 | ||
16ba8d58 KZ |
499 | dnl Convert some ac_cv_header_* variables to have_* |
500 | dnl | |
ba05b9ff | 501 | have_linux_audit_h=$ac_cv_header_linux_audit_h |
70bb5345 | 502 | have_linux_blkzoned_h=$ac_cv_header_linux_blkzoned_h |
5a971329 | 503 | have_linux_btrfs_h=$ac_cv_header_linux_btrfs_h |
c25b7d8a | 504 | have_linux_capability_h=$ac_cv_header_linux_capability_h |
f4d700d7 | 505 | have_linux_kcmp_h=$ac_cv_header_linux_kcmp_h |
5502e73d | 506 | have_linux_mount_h=$ac_cv_header_linux_mount_h |
627428a9 | 507 | have_linux_pr_h=$ac_cv_header_linux_pr_h |
16ba8d58 | 508 | have_linux_raw_h=$ac_cv_header_linux_raw_h |
48469f90 | 509 | have_linux_securebits_h=$ac_cv_header_linux_securebits_h |
c25b7d8a | 510 | have_linux_version_h=$ac_cv_header_linux_version_h |
5b0289b9 | 511 | have_linux_watchdog_h=$ac_cv_header_linux_watchdog_h |
c25b7d8a SK |
512 | have_pty_h=$ac_cv_header_pty_h |
513 | have_security_openpam_h=$ac_cv_header_security_openpam_h | |
fe2c9909 | 514 | have_security_pam_appl_h=$ac_cv_header_security_pam_appl_h |
ff0cb84d | 515 | have_security_pam_misc_h=$ac_cv_header_security_pam_misc_h |
dd3bbc9c | 516 | have_security_pam_modules_h=$ac_cv_header_security_pam_modules_h |
d00c10ed | 517 | have_shadow_h=$ac_cv_header_shadow_h |
651b25cd | 518 | have_sys_signalfd_h=$ac_cv_header_sys_signalfd_h |
b4b919fe | 519 | have_utmpx_h=$ac_cv_header_utmpx_h |
94c8821b | 520 | have_mntent_h=$ac_cv_header_mntent_h |
0c44599f KZ |
521 | have_sys_vfs_h=$ac_cv_header_sys_vfs_h |
522 | have_linux_bpf_h=$ac_cv_header_linux_bpf_h | |
a67387b7 | 523 | |
8a931412 KZ |
524 | AS_CASE([$linux_os:$have_linux_version_h], |
525 | [yes:no], | |
526 | [AC_MSG_ERROR([kernel headers required on Linux])] | |
527 | ) | |
528 | ||
a67387b7 KZ |
529 | AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ |
530 | #include <time.h> | |
531 | #include <unistd.h> | |
532 | ]], [[ | |
533 | int a = 0; | |
534 | struct tm *tm = localtime(0); | |
535 | if (a == -1) /* false */ | |
f06b4328 | 536 | sleep(tm->tm_gmtoff); |
a67387b7 | 537 | ]])], |
034d378b | 538 | [AC_DEFINE([HAVE_TM_GMTOFF], [1], [Does struct tm have a field tm_gmtoff?]) |
a67387b7 KZ |
539 | ]) |
540 | ||
10efb9ea | 541 | AC_CHECK_TYPES([struct mount_attr], [], [], [[#include <linux/mount.h>]]) |
0120be6f | 542 | AC_CHECK_TYPES([enum fsconfig_command], [], [], [[#include <linux/mount.h>]]) |
013e0db4 | 543 | |
a67387b7 KZ |
544 | AC_CHECK_MEMBERS([struct termios.c_line],,, |
545 | [[#include <termios.h>]]) | |
546 | ||
547 | AC_CHECK_MEMBERS([struct stat.st_mtim.tv_nsec],,, | |
c0136ac0 KZ |
548 | [[#include <sys/stat.h>]]) |
549 | ||
7d679f29 | 550 | AC_CHECK_TYPES([struct statx], [], [], [[#include <sys/stat.h>]]) |
c0136ac0 | 551 | AC_CHECK_MEMBERS([struct statx.stx_mnt_id],,, |
7d679f29 | 552 | [[#include <sys/stat.h>]]) |
a67387b7 | 553 | |
a88057d9 TP |
554 | AC_CHECK_DECLS([_NL_TIME_WEEK_1STDAY],[],[],[[#include <langinfo.h>]]) |
555 | ||
0e9b73d3 | 556 | AC_CHECK_DECL([environ], |
034d378b | 557 | [AC_DEFINE([HAVE_ENVIRON_DECL], [1], |
0e9b73d3 SK |
558 | [Define to 1 if have **environ prototype])], |
559 | ) | |
560 | ||
561 | AC_CHECK_DECL([strsignal], | |
034d378b | 562 | [AC_DEFINE([HAVE_STRSIGNAL_DECL], [1], |
0e9b73d3 SK |
563 | [Define to 1 if have strsignal function prototype])], |
564 | ) | |
565 | ||
1eb16fd7 KZ |
566 | AC_CHECK_DECL([TIOCGLCKTRMIOS], |
567 | [have_tiocglcktrmios=yes], [have_tiocglcktrmios=no], | |
c25b7d8a | 568 | [#include <sys/ioctl.h>]) |
1eb16fd7 KZ |
569 | AC_CHECK_DECL([SOCK_CLOEXEC], |
570 | [have_sock_cloexec=yes], [have_sock_cloexec=no], | |
571 | [#include <sys/types.h> | |
c25b7d8a | 572 | #include <sys/socket.h>]) |
1eb16fd7 KZ |
573 | AC_CHECK_DECL([SOCK_NONBLOCK], |
574 | [have_sock_nonblock=yes], [have_sock_nonblock=no], | |
575 | [#include <sys/types.h> | |
c25b7d8a | 576 | #include <sys/socket.h>]) |
1eb16fd7 KZ |
577 | AC_CHECK_DECL([SO_PASSCRED], |
578 | [have_so_passcred=yes], [have_so_passcred=no], | |
579 | [#include <sys/types.h> | |
c25b7d8a | 580 | #include <sys/socket.h>]) |
1eb16fd7 | 581 | |
f06b4328 | 582 | AC_CHECK_FUNCS([ \ |
c214cbeb | 583 | cachestat \ |
75efef98 | 584 | clearenv \ |
f0649c0d | 585 | close_range \ |
c08396c7 | 586 | eaccess \ |
eb76ca98 FG |
587 | err \ |
588 | errx \ | |
87583438 | 589 | explicit_bzero \ |
c25b7d8a SK |
590 | __fpending \ |
591 | __fpurge \ | |
592 | fpurge \ | |
d9b022bd | 593 | fnmatch \ |
0120be6f KZ |
594 | fsconfig \ |
595 | fsmount \ | |
596 | fsopen \ | |
597 | fspick \ | |
bf962c0a SK |
598 | fsync \ |
599 | getdomainname \ | |
f06b4328 SK |
600 | getdtablesize \ |
601 | getexecname \ | |
602 | getmntinfo \ | |
cc01c2dc | 603 | getrandom \ |
f06b4328 | 604 | getrlimit \ |
c829aebc | 605 | getsgnam \ |
1cf6e936 | 606 | getttynam \ |
f06b4328 | 607 | inotify_init \ |
3ac22f7a | 608 | jrand48 \ |
ae015d71 TW |
609 | landlock_create_ruleset \ |
610 | landlock_add_rule \ | |
611 | landlock_restrict_self \ | |
bf962c0a | 612 | lchown \ |
3854515c KZ |
613 | lgetxattr \ |
614 | llistxattr \ | |
a0948ffe | 615 | llseek \ |
670b10ae | 616 | newlocale \ |
02887b73 | 617 | mempcpy \ |
4d751c00 | 618 | mkostemp \ |
013e0db4 CB |
619 | move_mount \ |
620 | mount_setattr \ | |
f06b4328 | 621 | nanosleep \ |
7d3a07d8 | 622 | ntp_gettime \ |
013e0db4 | 623 | open_tree \ |
f06b4328 | 624 | personality \ |
6e6b9a1d SK |
625 | pidfd_open \ |
626 | pidfd_send_signal \ | |
f06b4328 SK |
627 | posix_fadvise \ |
628 | prctl \ | |
9c7955da | 629 | qsort_r \ |
0322c9cd | 630 | reallocarray \ |
cd094a05 | 631 | renameat2 \ |
f06b4328 | 632 | rpmatch \ |
485a8bfa | 633 | scandirat \ |
c25b7d8a SK |
634 | sched_setattr \ |
635 | sched_setscheduler \ | |
636 | __secure_getenv \ | |
637 | secure_getenv \ | |
360cdaa6 | 638 | sendfile \ |
30fbf2f6 | 639 | setprogname \ |
69045d3d KZ |
640 | setresgid \ |
641 | setresuid \ | |
f06b4328 SK |
642 | sigqueue \ |
643 | srandom \ | |
30c59d67 | 644 | statx \ |
f06b4328 | 645 | strnchr \ |
69b7e41e KZ |
646 | strndup \ |
647 | strnlen \ | |
670b10ae | 648 | strtod_l \ |
f06b4328 | 649 | sysconf \ |
88e0f3df | 650 | sysinfo \ |
b72a75e9 | 651 | timegm \ |
f06b4328 | 652 | usleep \ |
670b10ae | 653 | uselocale \ |
c25b7d8a | 654 | utimensat \ |
31f85fce | 655 | vwarnx \ |
eb76ca98 FG |
656 | warn \ |
657 | warnx \ | |
f06b4328 | 658 | ]) |
48d7b13a | 659 | AC_FUNC_FSEEKO |
48d7b13a | 660 | |
90d5285d | 661 | AC_CHECK_FUNCS([futimens], [have_futimens=yes]) |
c25b7d8a | 662 | AC_CHECK_FUNCS([getusershell], [have_getusershell=yes],[have_getusershell=no]) |
90d5285d | 663 | AC_CHECK_FUNCS([inotify_init1], [have_inotify_init1=yes]) |
c25b7d8a SK |
664 | AC_CHECK_FUNCS([ioperm iopl], [have_io=yes]) |
665 | AC_CHECK_FUNCS([openat fstatat unlinkat], [have_openat=yes], [have_openat=no]) | |
f9c4d138 | 666 | AC_CHECK_FUNCS([open_memstream], [have_open_memstream=yes],[have_open_memstream=no]) |
e52b58e6 | 667 | AC_CHECK_FUNCS([reboot], [have_reboot=yes],[have_reboot=no]) |
227ebea7 | 668 | AC_CHECK_FUNCS([updwtmpx updwtmpx], [have_gnu_utmpx=yes], [have_gnu_utmpx=no]) |
465e9973 | 669 | |
dc049516 | 670 | AM_CONDITIONAL([HAVE_OPENAT], [test "x$have_openat" = xyes]) |
ae015d71 | 671 | AM_CONDITIONAL([HAVE_LINUX_LANDLOCK_H], [test "x$ac_cv_header_linux_landlock_h" = xyes]) |
dc049516 | 672 | |
7a3b35b9 KZ |
673 | have_setns_syscall="yes" |
674 | UL_CHECK_SYSCALL([setns]) | |
675 | AS_IF([test "x$ul_cv_syscall_setns" = xno], [ | |
676 | have_setns_syscall="no" | |
677 | ]) | |
feda4342 | 678 | |
6e6b9a1d SK |
679 | UL_CHECK_SYSCALL([pidfd_open]) |
680 | UL_CHECK_SYSCALL([pidfd_send_signal]) | |
f0649c0d | 681 | UL_CHECK_SYSCALL([close_range]) |
0120be6f KZ |
682 | UL_CHECK_SYSCALL([fsconfig]) |
683 | UL_CHECK_SYSCALL([fsmount]) | |
684 | UL_CHECK_SYSCALL([fsopen]) | |
685 | UL_CHECK_SYSCALL([fspick]) | |
e087a188 | 686 | UL_CHECK_SYSCALL([mount_setattr]) |
0120be6f KZ |
687 | UL_CHECK_SYSCALL([move_mount]) |
688 | UL_CHECK_SYSCALL([open_tree]) | |
689 | ||
9040c090 KZ |
690 | AS_IF([test "x$ul_cv_syscall_fsconfig" = xno || |
691 | test "x$ul_cv_syscall_fsmount" = xno || | |
692 | test "x$ul_cv_syscall_fsopen" = xno || | |
693 | test "x$ul_cv_syscall_fspick" = xno || | |
694 | test "x$ul_cv_syscall_mount_setattr" = xno || | |
695 | test "x$ul_cv_syscall_move_mount" = xno || | |
696 | test "x$ul_cv_syscall_open_tree" = xno], | |
697 | [ | |
698 | have_mountfd_api="no" | |
699 | ],[ | |
700 | have_mountfd_api="yes" | |
701 | AC_DEFINE([HAVE_MOUNTFD_API], [1], [Define to 1 if you want mount API based on FDs.]) | |
702 | ]) | |
703 | ||
e087a188 | 704 | |
feda4342 KZ |
705 | AC_CHECK_FUNCS([isnan], [], |
706 | [AC_CHECK_LIB([m], [isnan], [MATH_LIBS="-lm"])] | |
4953018e | 707 | [AC_CHECK_LIB([m], [__isnan], [MATH_LIBS="-lm"])] |
feda4342 KZ |
708 | ) |
709 | AC_SUBST([MATH_LIBS]) | |
710 | ||
711 | ||
378543e1 | 712 | dnl lib/mononotic.c may require -lrt |
254743e4 KZ |
713 | AC_CHECK_FUNCS([clock_gettime], [], |
714 | [AC_CHECK_LIB([rt], [clock_gettime], [REALTIME_LIBS="-lrt"])] | |
715 | ) | |
bd9b94d1 | 716 | |
254743e4 | 717 | have_timer="no" |
f07a82c9 | 718 | AC_CHECK_FUNCS([timer_create], |
7944a03c | 719 | [have_timer="yes"], |
254743e4 KZ |
720 | [AC_CHECK_LIB([rt], [timer_create], [ |
721 | have_timer="yes" | |
722 | REALTIME_LIBS="-lrt" | |
f2458cf9 | 723 | AC_DEFINE([HAVE_TIMER_CREATE], [1], [Define if timer_create exist in -lrt]) |
bf6be9f5 LT |
724 | ],[ |
725 | AC_SEARCH_LIBS([timer_create], [rt], [ | |
726 | AC_MSG_RESULT(yes) | |
727 | have_timer="yes" | |
728 | REALTIME_LIBS="-lrt -lpthread" | |
f2458cf9 | 729 | AC_DEFINE([HAVE_TIMER_CREATE], [1], [Define if timer_create exist in -lrt -lpthread]) |
bf6be9f5 LT |
730 | ],[], [-lpthread] |
731 | ) | |
9a558f9c | 732 | ])] |
254743e4 | 733 | ) |
8fc4a886 | 734 | |
f07a82c9 KZ |
735 | AC_SUBST([REALTIME_LIBS]) |
736 | ||
6df5acf9 KZ |
737 | AS_IF([test x"$have_timer" = xno], [ |
738 | AC_CHECK_FUNCS([setitimer], [have_timer="yes"], [have_timer="no"]) | |
739 | ]) | |
740 | ||
f07a82c9 KZ |
741 | |
742 | AC_CHECK_LIB([rtas], [rtas_get_sysparm], [ | |
743 | RTAS_LIBS="-lrtas" | |
f2458cf9 | 744 | AC_DEFINE([HAVE_LIBRTAS], [1], [Define if librtas exists]) |
f07a82c9 KZ |
745 | ]) |
746 | AC_SUBST([RTAS_LIBS]) | |
747 | ||
8fc4a886 | 748 | |
034d378b | 749 | AC_CHECK_MEMBER([struct sockaddr.sa_len], |
f2458cf9 | 750 | AC_DEFINE([HAVE_SA_LEN], [1], [Define if struct sockaddr contains sa_len]), [], |
754fed0c KZ |
751 | [#include <sys/types.h> |
752 | #include <sys/socket.h>]) | |
753 | ||
60cc9f94 | 754 | SOCKET_LIBS= |
60cc9f94 | 755 | AC_SEARCH_LIBS([socket], [socket], |
3013eb9d SK |
756 | [AS_IF([test x"$ac_cv_search_socket" != x"none required"], |
757 | [SOCKET_LIBS="$SOCKET_LIBS -lsocket"]) | |
758 | ]) | |
60cc9f94 FG |
759 | AC_SUBST([SOCKET_LIBS]) |
760 | ||
d58c47d9 FG |
761 | |
762 | have_dirfd=no | |
763 | AC_CHECK_FUNCS([dirfd], [have_dirfd=yes], [have_dirfd=no]) | |
3013eb9d | 764 | AS_IF([test x"$have_dirfd" = xno], [ |
d58c47d9 FG |
765 | AC_CHECK_DECLS([dirfd], |
766 | [have_dirfd=yes], [have_dirfd=no], | |
767 | [#include <sys/types.h> | |
768 | #include <dirent.h>]) | |
3013eb9d | 769 | ]) |
d58c47d9 FG |
770 | |
771 | have_ddfd=no | |
3013eb9d | 772 | AS_IF([test x"$have_dirfd" = xno], [ |
d58c47d9 FG |
773 | AC_CHECK_MEMBERS([DIR.dd_fd], |
774 | [have_ddfd=yes], [have_ddfd=no], | |
775 | [#include <sys/types.h> | |
776 | #include <dirent.h>]) | |
3013eb9d | 777 | ]) |
d58c47d9 | 778 | |
948182f4 | 779 | AM_CONDITIONAL([HAVE_DIRFD], [test "x$have_dirfd" = xyes || test "x$have_ddfd" = xyes]) |
d58c47d9 | 780 | |
330555c4 MY |
781 | MQ_LIBS= |
782 | AC_CHECK_LIB([rt], [mq_open], [MQ_LIBS="-lrt"]) | |
783 | AC_SUBST([MQ_LIBS]) | |
d58c47d9 | 784 | |
d6abf168 SK |
785 | AC_MSG_CHECKING([whether program_invocation_short_name is defined]) |
786 | AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ | |
37edac9a | 787 | #include <errno.h> |
d6abf168 SK |
788 | ]], [[ |
789 | program_invocation_short_name = "test"; | |
790 | ]])], [ | |
791 | AC_MSG_RESULT([yes]) | |
792 | AC_DEFINE([HAVE_PROGRAM_INVOCATION_SHORT_NAME], [1], | |
793 | [Define if program_invocation_short_name is defined]) | |
794 | ], [ | |
795 | AC_MSG_RESULT([no]) | |
796 | ]) | |
797 | ||
a804f444 FG |
798 | |
799 | AC_MSG_CHECKING([whether __progname is defined]) | |
800 | AC_LINK_IFELSE([AC_LANG_PROGRAM([extern char *__progname;], | |
cf582a2e | 801 | [if (*__progname == 0) return 1;])], |
034d378b SK |
802 | AC_DEFINE([HAVE___PROGNAME], [1], [Define if __progname is defined]) |
803 | AC_MSG_RESULT([yes]), | |
804 | AC_MSG_RESULT([no])) | |
a804f444 | 805 | |
a0cf9105 LB |
806 | AC_CHECK_DECL([IOC_OPAL_GET_STATUS], |
807 | [AC_DEFINE([HAVE_OPAL_GET_STATUS], [1], | |
808 | [Define to 1 if OPAL status ioctl is defined])],, | |
809 | [#include <linux/sed-opal.h>]) | |
810 | ||
8569410c | 811 | dnl Static compilation |
44bf6d80 | 812 | m4_define([UL_STATIC_PROGRAMS], [blkid, fdisk, losetup, mount, nsenter, partx, sfdisk, umount, unshare]) |
8569410c SK |
813 | |
814 | AC_ARG_ENABLE([static-programs], | |
815 | [AS_HELP_STRING([--enable-static-programs=LIST], | |
816 | [link static the programs in LIST (comma-separated, | |
132ea941 | 817 | supported for ]m4_defn([UL_STATIC_PROGRAMS])[)])]) |
8569410c | 818 | |
9f57e6e8 SK |
819 | AS_CASE([$enable_static_programs], |
820 | [yes], | |
d924b10b | 821 | [enable_static_programs=m4_quote(UL_STATIC_PROGRAMS)], |
9f57e6e8 SK |
822 | [no], |
823 | [enable_static_programs=] | |
824 | ) | |
8569410c | 825 | |
8569410c | 826 | dnl Set all the individual AM_CONDITIONALs |
132ea941 | 827 | m4_foreach([UL_PRG], m4_defn([UL_STATIC_PROGRAMS]), [ |
9f57e6e8 SK |
828 | AS_CASE([,$enable_static_programs,], |
829 | [*,UL_PRG,*], [static_[]UL_PRG=yes] | |
830 | ) | |
d924b10b | 831 | AS_IF([test "x$static_[]UL_PRG" = xyes], [AC_MSG_NOTICE([enable static build: UL_PRG.])]) |
132ea941 KZ |
832 | AM_CONDITIONAL([HAVE_STATIC_]m4_toupper(UL_PRG), |
833 | [test "x$static_[]UL_PRG" = xyes]) | |
8569410c SK |
834 | ]) |
835 | ||
08b1c219 KZ |
836 | |
837 | AC_ARG_ENABLE([all-programs], | |
838 | AS_HELP_STRING([--disable-all-programs], [disable everything, might be overridden by --enable-<name>]), | |
839 | [], [enable_all_programs=undefined] | |
840 | ) | |
841 | ||
842 | AS_CASE([$enable_all_programs], | |
7477f356 | 843 | [yes], [AC_MSG_WARN([force to build all programs by default]) |
c25b7d8a | 844 | ul_default_estate=check], |
22a900a9 | 845 | [no], [AC_MSG_WARN([disable all programs and man pages by default]) |
c25b7d8a | 846 | ul_default_estate=no] |
08b1c219 KZ |
847 | ) |
848 | ||
849 | ||
22a900a9 KZ |
850 | AC_ARG_ENABLE([asciidoc], |
851 | AS_HELP_STRING([--disable-asciidoc], [do not generate man pages from asciidoc]), | |
852 | [], [UL_DEFAULT_ENABLE([asciidoc], [check])] | |
853 | ) | |
854 | UL_BUILD_INIT([asciidoc]) | |
855 | UL_REQUIRES_PROGRAM([asciidoc], [ASCIIDOCTOR], [asciidoctor], [man pages]) | |
856 | AM_CONDITIONAL([ENABLE_ASCIIDOC], [test "x$build_asciidoc" = xyes]) | |
a5b09369 | 857 | have_asciidoctor_failure_level=no |
25a70dcb TW |
858 | AS_IF([test "x$build_asciidoc" = xyes], [ |
859 | AC_MSG_CHECKING([whether ${ASCIIDOCTOR} supports --failure-level]) | |
860 | AS_IF([${ASCIIDOCTOR} --help | grep failure-level >/dev/null 2>&1 ], [ | |
861 | AC_MSG_RESULT([yes]) | |
a5b09369 | 862 | have_asciidoctor_failure_level=yes |
25a70dcb TW |
863 | ], [ |
864 | AC_MSG_RESULT([no]) | |
25a70dcb TW |
865 | ]) |
866 | ]) | |
a5b09369 | 867 | AM_CONDITIONAL([HAVE_ASCIIDOCTOR_FAILURE_LEVEL], [test "x$have_asciidoctor_failure_level" = xyes]) |
22a900a9 | 868 | |
1a30b2bd KZ |
869 | have_manpages=no |
870 | AS_IF([test -f "$srcdir/sys-utils/mount.8"], [ | |
871 | AC_MSG_NOTICE([re-use already generated man-pages.]) | |
872 | have_manpages=yes] | |
873 | ) | |
874 | AM_CONDITIONAL([HAVE_MANPAGES], [test "x$have_manpages" = xyes]) | |
875 | ||
22a900a9 | 876 | |
8f5fff53 | 877 | AC_ARG_ENABLE([poman], |
9acfc349 KZ |
878 | AS_HELP_STRING([--disable-poman], [generate translated man pages]), |
879 | [], [UL_DEFAULT_ENABLE([poman], [check])] | |
8f5fff53 KZ |
880 | ) |
881 | UL_BUILD_INIT([poman]) | |
882 | UL_REQUIRES_PROGRAM([poman], [PO4A], [po4a], [translated man pages]) | |
5e42ec32 | 883 | AM_CONDITIONAL([ENABLE_POMAN], [test "x$build_poman" = xyes]) |
8f5fff53 KZ |
884 | |
885 | ||
d7a01582 | 886 | AX_CHECK_TLS |
3ac22f7a | 887 | |
37a11e1a | 888 | have_pty=no |
17d71034 KZ |
889 | AC_ARG_WITH([util], AS_HELP_STRING([--without-util], [compile without libutil]), |
890 | [], [with_util=auto] | |
891 | ) | |
892 | AS_IF([test "x$with_util" = xno], [ | |
893 | AM_CONDITIONAL([HAVE_UTIL], [false]) | |
894 | have_util=no | |
895 | ], [ | |
896 | UL_CHECK_LIB([util], [openpty]) | |
897 | ]) | |
898 | ||
948182f4 | 899 | AS_IF([test "x$have_pty_h" = xyes && test "x$have_sys_signalfd_h" = xyes && test "x$have_util" = xyes], [ |
6954895c KZ |
900 | AM_CONDITIONAL([HAVE_PTY], [true]) |
901 | AC_DEFINE([HAVE_PTY], [1], [have PTY support]) | |
37a11e1a | 902 | have_pty=yes |
6954895c KZ |
903 | ], [ |
904 | AM_CONDITIONAL([HAVE_PTY], [false]) | |
905 | ]) | |
17d71034 | 906 | |
3aecf79d KZ |
907 | AC_CHECK_TYPES([union semun], [], [], [[ |
908 | #include <sys/sem.h> | |
909 | ]]) | |
034d378b | 910 | AC_CHECK_TYPES([loff_t]) |
3aecf79d | 911 | |
4cb6fea5 KZ |
912 | |
913 | AC_ARG_ENABLE([widechar], | |
914 | AS_HELP_STRING([--disable-widechar], [do not compile wide character support]), | |
915 | [], [enable_widechar=check] | |
916 | ) | |
917 | UL_BUILD_INIT([widechar]) | |
918 | UL_REQUIRES_COMPILE([widechar], [[ | |
919 | #include <wchar.h> | |
920 | #include <wctype.h> | |
921 | #include <stdio.h> | |
1632856e | 922 | #include <stdlib.h> |
4cb6fea5 KZ |
923 | ]], [[ |
924 | wchar_t wc; | |
925 | wint_t w; | |
926 | w = fgetwc(stdin); | |
927 | if (w == WEOF) exit(1); | |
928 | wc = w; | |
929 | fputwc(wc,stdout); | |
930 | ]], | |
931 | [wchar_t support]) | |
932 | ||
933 | AS_IF([test "x$build_widechar" = xyes ], [ | |
934 | AC_DEFINE([HAVE_WIDECHAR], [1], [Do we have wide character support?]) | |
3aecf79d KZ |
935 | ]) |
936 | ||
4cb6fea5 | 937 | |
3aecf79d KZ |
938 | AC_CHECK_TYPES([cpu_set_t], [have_cpu_set_t=yes], [], [[ |
939 | #include <sched.h> | |
940 | ]]) | |
941 | ||
034d378b | 942 | AM_CONDITIONAL([HAVE_CPU_SET_T], [test "x$have_cpu_set_t" = xyes]) |
3aecf79d | 943 | |
b09bc508 MF |
944 | AC_CHECK_TYPES([sighandler_t], [], [], [[ |
945 | #include <signal.h> | |
946 | ]]) | |
947 | ||
3aecf79d KZ |
948 | AC_CHECK_DECLS([CPU_ALLOC], [], [], [[ |
949 | #include <sched.h> | |
950 | ]]) | |
951 | ||
8d35bdc9 | 952 | # on Solaris, you can't mix and match standards, since we use c99 |
218b1dd6 | 953 | # apparently at this stage, XOPEN_SOURCE will conflict. As workaround, |
8d35bdc9 | 954 | # check for crypt.h and use that without XOPEN_SOURCE. |
8229ed2f | 955 | have_crypt=no |
8d35bdc9 KZ |
956 | AC_CHECK_HEADERS([crypt.h]) |
957 | AC_LINK_IFELSE([AC_LANG_PROGRAM([[ | |
958 | #ifdef HAVE_CRYPT_H | |
959 | #include <crypt.h> | |
960 | #else | |
961 | #define _XOPEN_SOURCE | |
962 | #include <unistd.h> | |
963 | #endif | |
964 | ]], [[ | |
965 | char *c = crypt("abc","pw"); | |
70c364b4 JN |
966 | ]])],[ |
967 | have_libcrypt=no | |
968 | have_crypt=yes | |
969 | ],[ | |
75cba8d5 | 970 | UL_SET_LIBS([-lcrypt]) |
637cc045 | 971 | AC_LINK_IFELSE([AC_LANG_PROGRAM([[ |
8d35bdc9 KZ |
972 | #ifdef HAVE_CRYPT_H |
973 | #include <crypt.h> | |
974 | #else | |
975 | #define _XOPEN_SOURCE | |
976 | #include <unistd.h> | |
977 | #endif | |
978 | ]], [[ | |
979 | char *c = crypt("abc","pw"); | |
980 | ]])],[ | |
8d35bdc9 | 981 | have_libcrypt=yes |
8229ed2f | 982 | have_crypt=yes |
8d35bdc9 | 983 | ],[ |
8229ed2f | 984 | AC_MSG_WARN([crypt() is not available]) |
8d35bdc9 | 985 | ]) |
75cba8d5 | 986 | UL_RESTORE_LIBS |
8d35bdc9 | 987 | ]) |
034d378b | 988 | AM_CONDITIONAL([HAVE_LIBCRYPT], [test "x$have_libcrypt" = xyes]) |
8d35bdc9 | 989 | |
13f5473e | 990 | |
75ad4910 KZ |
991 | AC_ARG_WITH([selinux], |
992 | AS_HELP_STRING([--with-selinux], [compile with SELinux support]), | |
034d378b | 993 | [], [with_selinux=no] |
75ad4910 KZ |
994 | ) |
995 | ||
3013eb9d | 996 | AS_IF([test "x$with_selinux" = xno], [ |
034d378b | 997 | AM_CONDITIONAL([HAVE_SELINUX], [false]) |
3013eb9d | 998 | ], [ |
ca27216a | 999 | PKG_CHECK_MODULES([SELINUX], [libselinux >= 2.5], [have_selinux=yes], [have_selinux=no]) |
9f57e6e8 SK |
1000 | AS_CASE([$with_selinux:$have_selinux], |
1001 | [yes:no], [AC_MSG_ERROR([SELinux selected but libselinux not found or too old])] | |
1002 | ) | |
3013eb9d | 1003 | AS_IF([test "x$have_selinux" = xyes], [ |
1468eda6 KZ |
1004 | AC_DEFINE([HAVE_LIBSELINUX], [1], [Define if SELinux is available]) |
1005 | UL_PKG_STATIC([SELINUX_LIBS_STATIC], [libselinux]) | |
1006 | AM_CONDITIONAL([HAVE_SELINUX], [true]) | |
1007 | ||
75cba8d5 | 1008 | UL_SET_LIBS([$SELINUX_LIBS]) |
312f04f4 KZ |
1009 | # This function is missing in old libselinux 1.xx versions |
1010 | AC_CHECK_FUNCS([security_get_initial_context]) | |
75cba8d5 | 1011 | UL_RESTORE_LIBS |
3013eb9d SK |
1012 | ]) |
1013 | ]) | |
75ad4910 KZ |
1014 | AC_SUBST([SELINUX_LIBS]) |
1015 | AC_SUBST([SELINUX_LIBS_STATIC]) | |
1016 | ||
0273afda | 1017 | |
75ad4910 KZ |
1018 | AC_ARG_WITH([audit], |
1019 | AS_HELP_STRING([--with-audit], [compile with audit support]), | |
034d378b | 1020 | [], [with_audit=no] |
75ad4910 KZ |
1021 | ) |
1022 | ||
3013eb9d | 1023 | AS_IF([test "x$with_audit" = xno], [ |
034d378b | 1024 | AM_CONDITIONAL([HAVE_AUDIT], [false]) |
3013eb9d | 1025 | ], [ |
034d378b | 1026 | UL_CHECK_LIB([audit], [audit_log_user_message]) |
9f57e6e8 SK |
1027 | AS_CASE([$with_audit:$have_audit], |
1028 | [yes:no], | |
1029 | [AC_MSG_ERROR([Audit selected but libaudit not found (or does not support audit_log_user_message())])] | |
1030 | ) | |
3013eb9d | 1031 | ]) |
75ad4910 KZ |
1032 | |
1033 | AC_ARG_WITH([udev], AS_HELP_STRING([--without-udev], [compile without udev support]), | |
034d378b | 1034 | [], [with_udev=auto] |
75ad4910 KZ |
1035 | ) |
1036 | ||
3013eb9d | 1037 | AS_IF([test "x$with_udev" = xno], [ |
034d378b | 1038 | AM_CONDITIONAL([HAVE_UDEV], [false]) |
3013eb9d | 1039 | ], [ |
034d378b | 1040 | UL_CHECK_LIB([udev], [udev_new]) |
9f57e6e8 SK |
1041 | AS_CASE([$with_udev:$have_udev], |
1042 | [yes:no], | |
1043 | [AC_MSG_ERROR([udev selected but libudev not found])] | |
1044 | ) | |
3013eb9d | 1045 | ]) |
75ad4910 | 1046 | |
2b8f22bd | 1047 | |
4ffcc7a9 KZ |
1048 | dnl wide-char ncurses |
1049 | AC_ARG_WITH([ncursesw], | |
95a89bd3 | 1050 | AS_HELP_STRING([--without-ncursesw], [do not build with wide-char ncurses]), |
4ffcc7a9 KZ |
1051 | [], [with_ncursesw=auto] |
1052 | ) | |
1053 | have_ncursesw=no | |
3cc8a9f4 | 1054 | have_ncursesw_header=no |
4ffcc7a9 | 1055 | AS_IF([test "x$with_ncursesw" != xno], [ |
e5cc93b5 KZ |
1056 | UL_NCURSES_CHECK([ncursesw]) |
1057 | AS_IF([test "x$have_ncursesw" = xyes], [ | |
3947ca4c KZ |
1058 | AC_CHECK_HEADERS([ncursesw/ncurses.h], [have_ncursesw_header=yes]) |
1059 | AC_CHECK_HEADERS([ncursesw/term.h]) | |
87c26ce5 KZ |
1060 | |
1061 | # Define HAVE_NCURSES_H only if check for HAVE_NCURSESW_NCURSES_H is | |
1062 | # unsuccessful to avoid too many *_H permitations in config.h | |
1063 | AS_IF([test "x$have_ncursesw_header" = xno], [ | |
1064 | AC_CHECK_HEADERS([ncurses.h], [have_ncursesw_header=yes]) | |
1065 | AC_CHECK_HEADERS([term.h]) | |
1066 | ]) | |
3cc8a9f4 KZ |
1067 | AS_IF([test "x$have_ncursesw_header" = xno], [have_ncursesw=no]) |
1068 | ]) | |
1069 | AS_IF([test "x$have_ncursesw" = xyes], [ | |
f1512be8 | 1070 | CURSES_LIB_NAME="ncursesw" |
3cc8a9f4 | 1071 | AC_DEFINE([HAVE_LIBNCURSESW], [1], [Define if ncursesw library available]) |
e5cc93b5 | 1072 | ]) |
4ffcc7a9 KZ |
1073 | ]) |
1074 | AS_CASE([$with_ncursesw:$have_ncursesw], | |
1075 | [yes:no], [AC_MSG_ERROR([ncursesw selected, but library not found])]) | |
2b8f22bd | 1076 | |
43cc76e2 | 1077 | |
4ffcc7a9 KZ |
1078 | dnl non-wide ncurses |
1079 | AC_ARG_WITH([ncurses], | |
95a89bd3 | 1080 | AS_HELP_STRING([--with-ncurses], [build with non-wide ncurses]), |
4ffcc7a9 KZ |
1081 | [], [with_ncurses=auto] |
1082 | ) | |
1083 | have_ncurses=no | |
3cc8a9f4 | 1084 | have_ncurses_header=no |
18dae5d8 KZ |
1085 | AS_CASE([$with_ncurses:$build_widechar], |
1086 | [yes:yes], [AC_MSG_ERROR([wide-char support enabled, but non-wide ncurses selects])]) | |
1087 | ||
948182f4 | 1088 | AS_IF([test "x$have_ncursesw" = xno && test "x$with_ncurses" != xno ], [ |
e5cc93b5 KZ |
1089 | UL_NCURSES_CHECK([ncurses]) |
1090 | AS_IF([test "x$have_ncurses" = xyes], [ | |
87c26ce5 KZ |
1091 | AC_CHECK_HEADERS([ncurses/ncurses.h], [have_ncurses_header=yes]) |
1092 | AC_CHECK_HEADERS([ncurses/term.h]) | |
1093 | ||
1094 | # Define HAVE_NCURSES_H only if check for HAVE_NCURSES_NCURSES_H is | |
1095 | # unsuccessful to avoid too many *_H permitations in config.h | |
1096 | AS_IF([test "x$have_ncurses_header" = xno], [ | |
1097 | AC_CHECK_HEADERS([ncurses.h], [have_ncurses_header=yes]) | |
1098 | AC_CHECK_HEADERS([term.h]) | |
1099 | ]) | |
3cc8a9f4 KZ |
1100 | AS_IF([test "x$have_ncurses_header" = xno], [have_ncurses=no]) |
1101 | ]) | |
1102 | AS_IF([test "x$have_ncurses" = xyes], [ | |
4ffcc7a9 | 1103 | CURSES_LIB_NAME="ncurses" |
3cc8a9f4 | 1104 | AC_DEFINE([HAVE_LIBNCURSES], [1], [Define if ncurses library available]) |
e5cc93b5 | 1105 | ]) |
3013eb9d | 1106 | ]) |
4ffcc7a9 KZ |
1107 | AS_CASE([$with_ncurses:$have_ncurses], |
1108 | [yes:no], [AC_MSG_ERROR([ncurses selected, but library not found])]) | |
1109 | ||
2b8f22bd | 1110 | AC_SUBST([NCURSES_CFLAGS]) |
75ad4910 | 1111 | AC_SUBST([NCURSES_LIBS]) |
948182f4 | 1112 | AM_CONDITIONAL([HAVE_NCURSES], [test "x$have_ncursesw" = xyes || test "x$have_ncurses" = xyes]) |
75ad4910 KZ |
1113 | |
1114 | ||
1115 | AC_ARG_WITH([slang], | |
4ffcc7a9 | 1116 | AS_HELP_STRING([--with-slang], [compile cfdisk with slang rather than ncurses]), |
034d378b | 1117 | [], [with_slang=no] |
75ad4910 | 1118 | ) |
50ea6795 | 1119 | have_slang=no |
3013eb9d | 1120 | AS_IF([test "x$with_slang" = xyes], [ |
75ad4910 KZ |
1121 | AC_CHECK_HEADERS([slang.h slang/slang.h]) |
1122 | AC_CHECK_HEADERS([slcurses.h slang/slcurses.h], | |
50ea6795 | 1123 | [have_slang=yes], [], [ |
75ad4910 KZ |
1124 | #ifdef HAVE_SLANG_H |
1125 | #include <slang.h> | |
1126 | #elif defined(HAVE_SLANG_SLANG_H) | |
1127 | #include <slang/slang.h> | |
1128 | #endif | |
1129 | ]) | |
3013eb9d | 1130 | AS_IF([test "x$have_slang" = xno], [ |
f1512be8 KZ |
1131 | AC_MSG_ERROR([slang selected but slcurses.h not found])], |
1132 | [CURSES_LIB_NAME=slang | |
3013eb9d SK |
1133 | ]) |
1134 | ]) | |
034d378b | 1135 | AM_CONDITIONAL([HAVE_SLANG], [test "x$have_slang" = xyes]) |
50ea6795 | 1136 | |
50ea6795 | 1137 | |
948182f4 | 1138 | AS_IF([test "x$have_slang" = xyes || test "x$have_ncursesw" = xyes || test "x$have_ncurses" = xyes], [ |
f1512be8 KZ |
1139 | AC_CHECK_LIB([$CURSES_LIB_NAME], use_default_colors, [ |
1140 | AC_DEFINE(HAVE_USE_DEFAULT_COLORS, 1, | |
7556c944 KZ |
1141 | [Define if curses library has the use_default_colors().]) |
1142 | ]) | |
1143 | AC_CHECK_LIB([$CURSES_LIB_NAME], resizeterm, [ | |
1144 | AC_DEFINE(HAVE_RESIZETERM, 1, | |
1145 | [Define if curses library has the resizeterm().]) | |
f1512be8 KZ |
1146 | ]) |
1147 | ]) | |
1148 | ||
50ea6795 | 1149 | |
17d71034 KZ |
1150 | AC_ARG_WITH([tinfo], AS_HELP_STRING([--without-tinfo], [compile without libtinfo]), |
1151 | [], [with_tinfo=auto] | |
1152 | ) | |
1153 | have_tinfo=no | |
ad442a81 | 1154 | have_tinfow=no |
17d71034 | 1155 | AS_IF([test "x$with_tinfo" != xno], [ |
ad442a81 KZ |
1156 | AS_IF([test "x$have_ncursesw" = xyes], [ |
1157 | UL_TINFO_CHECK([tinfow]) | |
1158 | ]) | |
1159 | AS_IF([test "x$have_tinfow" = xno], [ | |
1160 | UL_TINFO_CHECK([tinfo]) | |
17d71034 | 1161 | ]) |
2b8f22bd MF |
1162 | ]) |
1163 | AC_SUBST([TINFO_LIBS]) | |
0b28c2ec | 1164 | AC_SUBST([TINFO_LIBS_STATIC]) |
ccf92e6d | 1165 | AC_SUBST([TINFO_CFLAGS]) |
948182f4 IM |
1166 | AM_CONDITIONAL([HAVE_TINFO], [test "x$have_tinfo" = xyes || test "x$have_tinfow" = xyes]) |
1167 | AS_IF([test "x$have_tinfo" = xyes || test "x$have_tinfow" = xyes], [ | |
ad442a81 | 1168 | AC_DEFINE(HAVE_LIBTINFO, 1, [Define if libtinfo or libtinfow available.]) |
4310faf9 | 1169 | ]) |
75ad4910 KZ |
1170 | |
1171 | ||
0b28c2ec | 1172 | AC_ARG_WITH([readline], |
95a89bd3 | 1173 | AS_HELP_STRING([--without-readline], [do not build with GNU Readline support]), |
0b28c2ec KZ |
1174 | [], [with_readline=auto] |
1175 | ) | |
1176 | ||
1177 | AS_IF([test "x$with_readline" = xno], [ | |
1178 | AM_CONDITIONAL([HAVE_READLINE], [false]) | |
1179 | ], [ | |
1180 | UL_CHECK_LIB([readline], [readline]) | |
1181 | AS_CASE([$with_readline:$have_readline], | |
1182 | [yes:no], | |
1183 | [AC_MSG_ERROR([readline selected but libreadline not found ])], | |
1184 | [*:yes], | |
1185 | [READLINE_LIBS="-lreadline" | |
1186 | READLINE_LIBS_STATIC="-lreadline $TINFO_LIBS_STATIC"] | |
1187 | ) | |
1188 | ]) | |
1189 | AC_SUBST([READLINE_LIBS]) | |
1190 | AC_SUBST([READLINE_LIBS_STATIC]) | |
1191 | ||
1192 | ||
75ad4910 KZ |
1193 | AC_ARG_WITH([utempter], |
1194 | AS_HELP_STRING([--with-utempter], [compile script(1) with libutempter]), | |
034d378b | 1195 | [], [with_utempter=no] |
75ad4910 KZ |
1196 | ) |
1197 | ||
3013eb9d | 1198 | AS_IF([test "x$with_utempter" = xyes], [ |
034d378b | 1199 | UL_CHECK_LIB([utempter], [utempter_add_record]) |
3013eb9d | 1200 | AS_IF([test "x$have_utempter" = xno], [ |
75ad4910 | 1201 | AC_MSG_ERROR([utempter selected but libutempter not found]) |
3013eb9d SK |
1202 | ]) |
1203 | ], [ | |
034d378b | 1204 | AM_CONDITIONAL([HAVE_UTEMPTER], [false]) |
3013eb9d | 1205 | ]) |
75ad4910 KZ |
1206 | |
1207 | ||
1dbbde66 KZ |
1208 | dnl |
1209 | dnl libuuid | |
1210 | dnl | |
17afb032 KZ |
1211 | AC_ARG_ENABLE([libuuid], |
1212 | AS_HELP_STRING([--disable-libuuid], [do not build libuuid and uuid utilities]), | |
08b1c219 | 1213 | [], [UL_DEFAULT_ENABLE([libuuid], [yes])] |
17afb032 | 1214 | ) |
fa7be20e | 1215 | UL_BUILD_INIT([libuuid]) |
dc2b8d87 KZ |
1216 | AC_SUBST([LIBUUID_VERSION]) |
1217 | AC_SUBST([LIBUUID_VERSION_INFO]) | |
fa7be20e | 1218 | AM_CONDITIONAL(BUILD_LIBUUID, test "x$build_libuuid" = xyes) |
9dc801d2 | 1219 | |
3e584e85 RM |
1220 | AC_ARG_ENABLE([libuuid-force-uuidd], |
1221 | AS_HELP_STRING([--enable-libuuid-force-uuidd], [support uuidd even though the daemon is not built]), | |
1222 | [], [enable_libuuid_force_uuidd=no] | |
1223 | ) | |
1224 | ||
13985252 | 1225 | AS_IF([test "x$build_libuuid" = xyes], [ |
17afb032 | 1226 | AC_DEFINE(HAVE_LIBUUID, 1, [Define to 1 if you have the -luuid.]) |
3013eb9d | 1227 | ]) |
48d7b13a | 1228 | |
c2e299d0 SS |
1229 | dnl |
1230 | dnl liblastlog2 | |
1231 | dnl | |
1232 | AC_ARG_ENABLE([liblastlog2], | |
1233 | AS_HELP_STRING([--disable-liblastlog2], [do not build liblastlog2 and lastlog2 utilities]), | |
dd3bbc9c | 1234 | [], [UL_DEFAULT_ENABLE([liblastlog2], [yes])] |
c2e299d0 | 1235 | ) |
dd3bbc9c KZ |
1236 | UL_BUILD_INIT([liblastlog2]) |
1237 | ||
1238 | have_sqlite3=no | |
1239 | AS_IF([test "x$build_liblastlog2" = xyes], [ | |
1240 | PKG_CHECK_MODULES([SQLITE3], [sqlite3], [have_sqlite3=yes], [have_sqlite3=no]) | |
1241 | ]) | |
1242 | UL_REQUIRES_HAVE([liblastlog2], [sqlite3], [sqlite3 library]) | |
1243 | AC_SUBST([SQLITE3_LIBS]) | |
1244 | ||
c2e299d0 SS |
1245 | AC_SUBST([LIBLASTLOG2_VERSION]) |
1246 | AC_SUBST([LIBLASTLOG2_VERSION_INFO]) | |
1247 | AC_DEFINE_UNQUOTED([LIBLASTLOG2_VERSION], ["$LIBLASTLOG2_VERSION"], [liblastlog2 version string]) | |
dd3bbc9c KZ |
1248 | AM_CONDITIONAL([BUILD_LIBLASTLOG2], [test "x$build_liblastlog2" = xyes]) |
1249 | AM_CONDITIONAL([BUILD_LIBLASTLOG2_TESTS], [test "x$build_liblastlog2" = xyes && test "x$enable_static" = xyes]) | |
1250 | ||
1251 | ||
1252 | AC_ARG_ENABLE([pam_lastlog2], | |
1253 | AS_HELP_STRING([--disable-pam-lastlog2], [do not build PAM lastlog2 module]), | |
1254 | [], [UL_DEFAULT_ENABLE([pam_lastlog2], [check])] | |
1255 | ) | |
1256 | UL_BUILD_INIT([pam_lastlog2]) | |
1257 | UL_REQUIRES_BUILD([pam_lastlog2], [liblastlog2]) | |
1258 | UL_REQUIRES_HAVE([pam_lastlog2], [security_pam_modules_h], [pam_modules.h header file]) | |
1259 | AM_CONDITIONAL([BUILD_PAM_LASTLOG2], [test "x$build_pam_lastlog2" = xyes]) | |
c2e299d0 | 1260 | |
c2e299d0 | 1261 | |
1dbbde66 KZ |
1262 | dnl |
1263 | dnl libblkid | |
1264 | dnl | |
f910b559 | 1265 | AC_ARG_ENABLE([libblkid], |
1d12ed57 | 1266 | AS_HELP_STRING([--disable-libblkid], [do not build libblkid and many related utilities]), |
dc049516 | 1267 | [], [UL_DEFAULT_ENABLE([libblkid], [check])] |
40f07ff7 | 1268 | ) |
61a074f7 | 1269 | UL_BUILD_INIT([libblkid]) |
dc049516 | 1270 | UL_REQUIRES_HAVE([libblkid], [openat], [openat functions]) |
a68ed87f | 1271 | UL_REQUIRES_HAVE([libblkid], [dirfd,ddfd], [dirfd or ddfd function]) |
033cf439 | 1272 | AC_SUBST([LIBBLKID_DATE]) |
dc2b8d87 KZ |
1273 | AC_SUBST([LIBBLKID_VERSION]) |
1274 | AC_SUBST([LIBBLKID_VERSION_INFO]) | |
034d378b SK |
1275 | AC_DEFINE_UNQUOTED([LIBBLKID_VERSION], ["$LIBBLKID_VERSION"], [libblkid version string]) |
1276 | AC_DEFINE_UNQUOTED([LIBBLKID_DATE], ["$LIBBLKID_DATE"], [libblkid date string]) | |
3013eb9d | 1277 | AS_IF([test "x$build_libblkid" = xyes], [ |
034d378b | 1278 | AC_DEFINE([HAVE_LIBBLKID], [1], [Define to 1 if you have the -lblkid.]) |
3013eb9d | 1279 | ]) |
034d378b | 1280 | AM_CONDITIONAL([BUILD_LIBBLKID], [test "x$build_libblkid" = xyes]) |
948182f4 | 1281 | AM_CONDITIONAL([BUILD_LIBBLKID_TESTS], [test "x$build_libblkid" = xyes && test "x$enable_static" = xyes]) |
f910b559 | 1282 | |
1dbbde66 KZ |
1283 | dnl |
1284 | dnl libmount | |
1285 | dnl | |
f1cde479 KZ |
1286 | AC_ARG_ENABLE([libmount], |
1287 | AS_HELP_STRING([--disable-libmount], [do not build libmount]), | |
08b1c219 | 1288 | [], [UL_DEFAULT_ENABLE([libmount], [check])] |
f1cde479 | 1289 | ) |
61a074f7 | 1290 | UL_BUILD_INIT([libmount]) |
13f5473e | 1291 | UL_REQUIRES_BUILD([libmount], [libblkid]) |
a68ed87f | 1292 | UL_REQUIRES_HAVE([libmount], [dirfd,ddfd], [dirfd or ddfd function]) |
94c8821b | 1293 | UL_REQUIRES_HAVE([libmount], [mntent_h], [mntent.h header file]) |
0c44599f | 1294 | UL_REQUIRES_HAVE([libmount], [sys_vfs_h], [sys/vfs.h header file]) |
034d378b | 1295 | AM_CONDITIONAL([BUILD_LIBMOUNT], [test "x$build_libmount" = xyes]) |
948182f4 | 1296 | AM_CONDITIONAL([BUILD_LIBMOUNT_TESTS], [test "x$build_libmount" = xyes && test "x$enable_static" = xyes]) |
30c34afb | 1297 | AS_IF([test "x$build_libmount" = xyes], [ |
7a3b35b9 KZ |
1298 | AC_DEFINE(HAVE_LIBMOUNT, 1, [Define if libmount available.]) |
1299 | AS_IF([test "x$have_setns_syscall" = "xyes"], [ | |
1300 | AC_DEFINE([USE_LIBMOUNT_SUPPORT_NAMESPACES], [1], [Define to 1 if want to support namepaces.]) | |
1301 | ],[ | |
1302 | AC_MSG_WARN([libmount will be compiled without namespaces support]) | |
1303 | ]) | |
30c34afb | 1304 | ]) |
8e368761 | 1305 | |
f1cde479 | 1306 | AC_SUBST([LIBMOUNT_VERSION]) |
10e1d2e5 SH |
1307 | AC_SUBST([LIBMOUNT_MAJOR_VERSION], $PACKAGE_VERSION_MAJOR) |
1308 | AC_SUBST([LIBMOUNT_MINOR_VERSION], $PACKAGE_VERSION_MINOR) | |
1309 | AC_SUBST([LIBMOUNT_PATCH_VERSION], $PACKAGE_VERSION_RELEASE) | |
f1cde479 | 1310 | AC_SUBST([LIBMOUNT_VERSION_INFO]) |
034d378b | 1311 | AC_DEFINE_UNQUOTED([LIBMOUNT_VERSION], ["$LIBMOUNT_VERSION"], [libmount version string]) |
13f5473e | 1312 | |
9040c090 KZ |
1313 | AC_ARG_ENABLE([libmount-mountfd-support], |
1314 | AS_HELP_STRING([--disable-libmount-mountfd-support], [do not use new mount API based on FDs]), | |
1315 | [], [enable_libmount_mountfd_support=check] | |
1316 | ) | |
1317 | UL_BUILD_INIT([libmount_mountfd_support]) | |
1318 | UL_REQUIRES_BUILD([libmount_mountfd_support], [libmount]) | |
1319 | UL_REQUIRES_LINUX([libmount_mountfd_support]) | |
1320 | UL_REQUIRES_HAVE([libmount_mountfd_support], [mountfd_api], [mount FDs based API]) | |
5502e73d | 1321 | UL_REQUIRES_HAVE([libmount_mountfd_support], [linux_mount_h], [linux/mount.h]) |
9040c090 KZ |
1322 | AS_IF([test "x$build_libmount_mountfd_support" = xyes ], [ |
1323 | AC_DEFINE([USE_LIBMOUNT_MOUNTFD_SUPPORT], [1], [Enable support for new mount FD based kernel API]) | |
1324 | ]) | |
1325 | ||
1326 | ||
1a4d989e OO |
1327 | dnl |
1328 | dnl libsmartcols | |
1329 | dnl | |
1330 | AC_ARG_ENABLE([libsmartcols], | |
1331 | AS_HELP_STRING([--disable-libsmartcols], [do not build libsmartcols]), | |
08b1c219 | 1332 | [], [UL_DEFAULT_ENABLE([libsmartcols], [yes])] |
1a4d989e OO |
1333 | ) |
1334 | UL_BUILD_INIT([libsmartcols]) | |
1a4d989e | 1335 | AM_CONDITIONAL([BUILD_LIBSMARTCOLS], [test "x$build_libsmartcols" = xyes]) |
1a4d989e OO |
1336 | |
1337 | AC_SUBST([LIBSMARTCOLS_VERSION]) | |
1338 | AC_SUBST([LIBSMARTCOLS_VERSION_INFO]) | |
1339 | AC_DEFINE_UNQUOTED([LIBSMARTCOLS_VERSION], ["$LIBSMARTCOLS_VERSION"], [libsmartcols version string]) | |
1340 | ||
1341 | ||
eb6a03f3 | 1342 | dnl |
0bb4c979 | 1343 | dnl libfdisk |
eb6a03f3 | 1344 | dnl |
0bb4c979 KZ |
1345 | AC_ARG_ENABLE([libfdisk], |
1346 | AS_HELP_STRING([--disable-libfdisk], [do not build libfdisk]), | |
1347 | [], [UL_DEFAULT_ENABLE([libfdisk], [check])] | |
1348 | ) | |
1349 | UL_BUILD_INIT([libfdisk]) | |
eb6a03f3 | 1350 | UL_REQUIRES_BUILD([libfdisk], [libuuid]) |
034d378b | 1351 | AM_CONDITIONAL([BUILD_LIBFDISK], [test "x$build_libfdisk" = xyes]) |
948182f4 | 1352 | AM_CONDITIONAL([BUILD_LIBFDISK_TESTS], [test "x$build_libfdisk" = xyes && test "x$enable_static" = xyes]) |
0bb4c979 | 1353 | |
ed79557e KZ |
1354 | AS_IF([test "x$build_libblkid" = xyes], |
1355 | [LIBFDISK_PC_REQUIRES="uuid blkid"],[LIBFDISK_PC_REQUIRES="uuid"]) | |
1356 | AC_SUBST([LIBFDISK_PC_REQUIRES]) | |
1357 | ||
0bb4c979 | 1358 | AC_SUBST([LIBFDISK_VERSION]) |
791da22d KZ |
1359 | AC_SUBST([LIBFDISK_MAJOR_VERSION], $PACKAGE_VERSION_MAJOR) |
1360 | AC_SUBST([LIBFDISK_MINOR_VERSION], $PACKAGE_VERSION_MINOR) | |
1361 | AC_SUBST([LIBFDISK_PATCH_VERSION], $PACKAGE_VERSION_RELEASE) | |
0bb4c979 KZ |
1362 | AC_SUBST([LIBFDISK_VERSION_INFO]) |
1363 | AC_DEFINE_UNQUOTED([LIBFDISK_VERSION], ["$LIBFDISK_VERSION"], [libfdisk version string]) | |
1364 | ||
eb6a03f3 | 1365 | |
9c7431fd CS |
1366 | AC_ARG_ENABLE([fdisks], |
1367 | AS_HELP_STRING([--disable-fdisks], [do not build fdisk(8), sfdisk(8) and cfdisk(8)]), | |
1368 | [], [UL_DEFAULT_ENABLE([fdisks], [check])] | |
1369 | ) | |
1370 | enable_fdisk=$enable_fdisks | |
1371 | enable_sfdisk=$enable_fdisks | |
1372 | enable_cfdisk=$enable_fdisks | |
1373 | ||
1374 | UL_BUILD_INIT([fdisk]) | |
dc049516 | 1375 | UL_REQUIRES_HAVE([fdisk], [openat], [openat functions]) |
a68ed87f | 1376 | UL_REQUIRES_HAVE([fdisk], [dirfd,ddfd], [dirfd or ddfd function]) |
eb6a03f3 | 1377 | UL_REQUIRES_BUILD([fdisk], [libfdisk]) |
d44115f3 | 1378 | UL_REQUIRES_BUILD([fdisk], [libsmartcols]) |
034d378b | 1379 | AM_CONDITIONAL([BUILD_FDISK], [test "x$build_fdisk" = xyes]) |
eb6a03f3 KZ |
1380 | |
1381 | ||
9c7431fd | 1382 | UL_BUILD_INIT([sfdisk]) |
dc049516 | 1383 | UL_REQUIRES_HAVE([sfdisk], [openat], [openat functions]) |
a68ed87f | 1384 | UL_REQUIRES_HAVE([sfdisk], [dirfd,ddfd], [dirfd or ddfd function]) |
9c1f9dd3 KZ |
1385 | UL_REQUIRES_BUILD([sfdisk], [libfdisk]) |
1386 | UL_REQUIRES_BUILD([sfdisk], [libsmartcols]) | |
ecc6047e KZ |
1387 | AM_CONDITIONAL([BUILD_SFDISK], [test "x$build_sfdisk" = xyes]) |
1388 | ||
1389 | ||
9c7431fd | 1390 | UL_BUILD_INIT([cfdisk]) |
08b1c219 KZ |
1391 | UL_REQUIRES_BUILD([cfdisk], [libfdisk]) |
1392 | UL_REQUIRES_BUILD([cfdisk], [libsmartcols]) | |
9dd55a04 | 1393 | UL_REQUIRES_HAVE([cfdisk], [open_memstream], [open_memstream function]) |
4ffcc7a9 | 1394 | UL_REQUIRES_HAVE([cfdisk], [ncursesw,slang,ncurses], [ncursesw, ncurses or slang library]) |
08b1c219 KZ |
1395 | AM_CONDITIONAL([BUILD_CFDISK], [test "x$build_cfdisk" = xyes]) |
1396 | ||
1397 | ||
434b07a0 KZ |
1398 | AC_ARG_ENABLE([mount], |
1399 | AS_HELP_STRING([--disable-mount], [do not build mount(8) and umount(8)]), | |
08b1c219 | 1400 | [], [UL_DEFAULT_ENABLE([mount], [check])] |
ecdba5dd | 1401 | ) |
434b07a0 | 1402 | UL_BUILD_INIT([mount]) |
53e8c16e | 1403 | UL_REQUIRES_LINUX([mount]) |
434b07a0 | 1404 | UL_REQUIRES_BUILD([mount], [libmount]) |
034d378b | 1405 | AM_CONDITIONAL([BUILD_MOUNT], [test "x$build_mount" = xyes]) |
ecdba5dd KZ |
1406 | |
1407 | ||
bafe1a75 KZ |
1408 | AC_ARG_ENABLE([losetup], |
1409 | AS_HELP_STRING([--disable-losetup], [do not build losetup]), | |
08b1c219 | 1410 | [], [UL_DEFAULT_ENABLE([losetup], [check])] |
bafe1a75 KZ |
1411 | ) |
1412 | UL_BUILD_INIT([losetup]) | |
1413 | UL_REQUIRES_LINUX([losetup]) | |
7477f356 | 1414 | UL_REQUIRES_BUILD([losetup], [libsmartcols]) |
034d378b | 1415 | AM_CONDITIONAL([BUILD_LOSETUP], [test "x$build_losetup" = xyes]) |
bafe1a75 | 1416 | |
0624d840 KZ |
1417 | AC_ARG_ENABLE([zramctl], |
1418 | AS_HELP_STRING([--disable-zramctl], [do not build zramctl]), | |
1419 | [], [UL_DEFAULT_ENABLE([zramctl], [check])] | |
1420 | ) | |
1421 | UL_BUILD_INIT([zramctl]) | |
1422 | UL_REQUIRES_LINUX([zramctl]) | |
1423 | UL_REQUIRES_BUILD([zramctl], [libsmartcols]) | |
1424 | AM_CONDITIONAL([BUILD_ZRAMCTL], [test "x$build_zramctl" = xyes]) | |
bafe1a75 | 1425 | |
1dbbde66 KZ |
1426 | AC_ARG_ENABLE([fsck], |
1427 | AS_HELP_STRING([--disable-fsck], [do not build fsck]), | |
08b1c219 | 1428 | [], [UL_DEFAULT_ENABLE([fsck], [check])] |
1dbbde66 | 1429 | ) |
61a074f7 | 1430 | UL_BUILD_INIT([fsck]) |
a7b585ea | 1431 | UL_REQUIRES_BUILD([fsck], [libmount]) |
034d378b | 1432 | AM_CONDITIONAL([BUILD_FSCK], [test "x$build_fsck" = xyes]) |
1dbbde66 KZ |
1433 | |
1434 | ||
1435 | AC_ARG_ENABLE([partx], | |
1436 | AS_HELP_STRING([--disable-partx], [do not build addpart, delpart, partx]), | |
08b1c219 | 1437 | [], [UL_DEFAULT_ENABLE([partx], [check])] |
1dbbde66 | 1438 | ) |
61a074f7 | 1439 | UL_BUILD_INIT([partx]) |
ecde2536 KZ |
1440 | UL_REQUIRES_LINUX([partx]) |
1441 | UL_REQUIRES_BUILD([partx], [libblkid]) | |
08b1c219 | 1442 | UL_REQUIRES_BUILD([partx], [libsmartcols]) |
034d378b | 1443 | AM_CONDITIONAL([BUILD_PARTX], [test "x$build_partx" = xyes]) |
1dbbde66 KZ |
1444 | |
1445 | ||
1dbbde66 KZ |
1446 | AC_ARG_ENABLE([uuidd], |
1447 | AS_HELP_STRING([--disable-uuidd], [do not build the uuid daemon]), | |
08b1c219 | 1448 | [], [UL_DEFAULT_ENABLE([uuidd], [check])] |
1dbbde66 | 1449 | ) |
61a074f7 | 1450 | UL_BUILD_INIT([uuidd]) |
bcdab497 | 1451 | UL_REQUIRES_BUILD([uuidd], [libuuid]) |
651b25cd RM |
1452 | UL_REQUIRES_HAVE([uuidd], [timer], [timer_create function]) |
1453 | UL_REQUIRES_HAVE([uuidd], [sys_signalfd_h], [sys/signalfd.h header]) | |
2afbcec5 | 1454 | AS_IF([test "x$build_uuidd" = xyes || test "x$enable_libuuid_force_uuidd" = xyes], [ |
034d378b | 1455 | AC_DEFINE([HAVE_UUIDD], [1], [Define to 1 if you want to use uuid daemon.]) |
3013eb9d | 1456 | ]) |
034d378b | 1457 | AM_CONDITIONAL([BUILD_UUIDD], [test "x$build_uuidd" = xyes]) |
1dbbde66 KZ |
1458 | |
1459 | ||
5ec1108c | 1460 | AC_ARG_ENABLE([uuidgen], |
1461 | AS_HELP_STRING([--disable-uuidgen], [do not build uuidgen]), | |
1462 | [], [UL_DEFAULT_ENABLE([uuidgen], [check])] | |
1463 | ) | |
1464 | UL_BUILD_INIT([uuidgen]) | |
1b15cbd1 KZ |
1465 | UL_REQUIRES_BUILD([uuidgen], [libuuid]) |
1466 | AM_CONDITIONAL([BUILD_UUIDGEN], [test "x$build_uuidgen" = xyes]) | |
1467 | ||
83893f26 SK |
1468 | UL_BUILD_INIT([uuidparse], [check]) |
1469 | UL_REQUIRES_BUILD([uuidparse], [libuuid]) | |
1470 | UL_REQUIRES_BUILD([uuidparse], [libsmartcols]) | |
1471 | AM_CONDITIONAL([BUILD_UUIDPARSE], [test "x$build_uuidparse" = xyes]) | |
1472 | ||
5ec1108c | 1473 | AC_ARG_ENABLE([blkid], |
1474 | AS_HELP_STRING([--disable-blkid], [do not build blkid(8)]), | |
1475 | [], [UL_DEFAULT_ENABLE([blkid], [check])] | |
1476 | ) | |
1477 | UL_BUILD_INIT([blkid]) | |
15a2c741 KZ |
1478 | UL_REQUIRES_BUILD([blkid], [libblkid]) |
1479 | AM_CONDITIONAL([BUILD_BLKID], [test "x$build_blkid" = xyes]) | |
1480 | ||
1481 | UL_BUILD_INIT([findfs], [check]) | |
1482 | UL_REQUIRES_BUILD([findfs], [libblkid]) | |
1483 | AM_CONDITIONAL([BUILD_FINDFS], [test "x$build_findfs" = xyes]) | |
1484 | ||
a76cd5f6 SV |
1485 | AC_ARG_ENABLE([wipefs], |
1486 | AS_HELP_STRING([--disable-wipefs], [do not build wipefs]), | |
1487 | [], [UL_DEFAULT_ENABLE([wipefs], [check])] | |
1488 | ) | |
1489 | UL_BUILD_INIT([wipefs]) | |
15a2c741 | 1490 | UL_REQUIRES_BUILD([wipefs], [libblkid]) |
d9921b2a | 1491 | UL_REQUIRES_BUILD([wipefs], [libsmartcols]) |
15a2c741 KZ |
1492 | AM_CONDITIONAL([BUILD_WIPEFS], [test "x$build_wipefs" = xyes]) |
1493 | ||
1494 | UL_BUILD_INIT([findmnt], [check]) | |
1495 | UL_REQUIRES_BUILD([findmnt], [libmount]) | |
169b4a8c | 1496 | UL_REQUIRES_BUILD([findmnt], [libblkid]) |
15a2c741 KZ |
1497 | UL_REQUIRES_BUILD([findmnt], [libsmartcols]) |
1498 | AM_CONDITIONAL([BUILD_FINDMNT], [test "x$build_findmnt" = xyes]) | |
1499 | ||
1b15cbd1 | 1500 | |
0164c245 | 1501 | AC_ARG_ENABLE([mountpoint], |
2023ccc4 | 1502 | AS_HELP_STRING([--disable-mountpoint], [do not build mountpoint]), |
08b1c219 | 1503 | [], [UL_DEFAULT_ENABLE([mountpoint], [check])] |
0164c245 | 1504 | ) |
61a074f7 | 1505 | UL_BUILD_INIT([mountpoint]) |
a9127bc1 | 1506 | UL_REQUIRES_BUILD([mountpoint], [libmount]) |
034d378b | 1507 | AM_CONDITIONAL([BUILD_MOUNTPOINT], [test "x$build_mountpoint" = xyes]) |
0164c245 KZ |
1508 | |
1509 | ||
10e56b49 KZ |
1510 | AC_ARG_ENABLE([fallocate], |
1511 | AS_HELP_STRING([--disable-fallocate], [do not build fallocate]), | |
08b1c219 | 1512 | [], [UL_DEFAULT_ENABLE([fallocate], [check])] |
10e56b49 | 1513 | ) |
61a074f7 | 1514 | UL_BUILD_INIT([fallocate]) |
10e56b49 KZ |
1515 | UL_REQUIRES_LINUX([fallocate]) |
1516 | UL_REQUIRES_SYSCALL_CHECK([fallocate], [UL_CHECK_SYSCALL([fallocate])]) | |
034d378b | 1517 | AM_CONDITIONAL([BUILD_FALLOCATE], [test "x$build_fallocate" = xyes]) |
10e56b49 | 1518 | |
3013eb9d | 1519 | AS_IF([test "x$build_fallocate" = xyes], [ |
10e56b49 KZ |
1520 | dnl check for valid fallocate() function |
1521 | dnl with 32 bits glibc 2.10, fallocate() exists but not fallocate64() | |
1522 | dnl when _FILE_OFFSET_BITS==64, fallocate() is redirect to fallocate64() | |
1523 | dnl and program can't be linked. | |
1524 | dnl AC_CHECK_FUNC can't catch such errors since it's redefining | |
1525 | dnl function prototype. | |
1526 | AC_MSG_CHECKING([for valid fallocate() function]) | |
1527 | AC_LINK_IFELSE([AC_LANG_PROGRAM([[ | |
b832c2fe YD |
1528 | #ifdef HAVE_UNISTD_H |
1529 | # include <unistd.h> | |
1530 | #endif | |
1531 | #ifdef HAVE_SYS_TYPES_H | |
1532 | # include <sys/types.h> | |
1533 | #endif | |
1534 | #ifdef HAVE_LINUX_FALLOC_H | |
1535 | # include <linux/falloc.h> | |
1536 | #endif | |
1537 | #ifdef HAVE_FCNTL_H | |
1538 | # include <fcntl.h> | |
1539 | #endif | |
1540 | ]],[[ | |
1541 | long ret; | |
b832c2fe | 1542 | ret = fallocate(0, FALLOC_FL_KEEP_SIZE, 0xfffffffful, 0xfffffffful); |
b832c2fe YD |
1543 | if (ret != 0) { |
1544 | return 1; | |
1545 | } | |
1546 | ]])],[ | |
10e56b49 | 1547 | AC_MSG_RESULT([yes]) |
034d378b | 1548 | AC_DEFINE([HAVE_FALLOCATE], [1], [Have valid fallocate() function])],[ |
10e56b49 | 1549 | AC_MSG_RESULT([no])]) |
3013eb9d | 1550 | ]) |
10e56b49 | 1551 | |
833f9a7a DC |
1552 | AS_IF([test "x$build_fallocate" = xyes], [ |
1553 | dnl check for valid posix_fallocate() function | |
1554 | AC_MSG_CHECKING([for valid posix_fallocate() function]) | |
1555 | AC_LINK_IFELSE([AC_LANG_PROGRAM([[ | |
1556 | #ifdef HAVE_UNISTD_H | |
1557 | # include <unistd.h> | |
1558 | #endif | |
1559 | #ifdef HAVE_SYS_TYPES_H | |
1560 | # include <sys/types.h> | |
1561 | #endif | |
1562 | #ifdef HAVE_LINUX_FALLOC_H | |
1563 | # include <linux/falloc.h> | |
1564 | #endif | |
1565 | #ifdef HAVE_FCNTL_H | |
1566 | # include <fcntl.h> | |
1567 | #endif | |
1568 | ]],[[ | |
1569 | long ret; | |
1570 | ret = posix_fallocate(0, 0xfffffffful, 0xfffffffful); | |
1571 | if (ret != 0) { | |
1572 | return 1; | |
1573 | } | |
1574 | ]])],[ | |
1575 | AC_MSG_RESULT([yes]) | |
1576 | AC_DEFINE([HAVE_POSIX_FALLOCATE], [1], [Have valid posix_fallocate() function])],[ | |
1577 | AC_MSG_RESULT([no])]) | |
1578 | ]) | |
1579 | ||
19a224ad | 1580 | |
a2ea6670 KZ |
1581 | AC_ARG_ENABLE([unshare], |
1582 | AS_HELP_STRING([--disable-unshare], [do not build unshare]), | |
08b1c219 | 1583 | [], [UL_DEFAULT_ENABLE([unshare], [check])] |
a2ea6670 | 1584 | ) |
61a074f7 | 1585 | UL_BUILD_INIT([unshare]) |
a2ea6670 KZ |
1586 | UL_REQUIRES_LINUX([unshare]) |
1587 | UL_REQUIRES_SYSCALL_CHECK([unshare], [UL_CHECK_SYSCALL([unshare])]) | |
2c2ff2ed | 1588 | UL_REQUIRES_HAVE([unshare], [linux_capability_h], [linux/capability.h header file]) |
034d378b | 1589 | AM_CONDITIONAL([BUILD_UNSHARE], [test "x$build_unshare" = xyes]) |
01e94325 KZ |
1590 | |
1591 | AC_MSG_CHECKING([for valid unshare() function]) | |
1592 | AC_LINK_IFELSE([AC_LANG_PROGRAM([[ | |
1593 | #include <sched.h> | |
1594 | ]],[[ | |
1595 | int ret; | |
1596 | ret = unshare(0); | |
1597 | if (ret != 0) { | |
1598 | return 1; | |
1599 | } | |
1600 | ]])],[ | |
1601 | AC_MSG_RESULT([yes]) | |
1602 | AC_DEFINE([HAVE_UNSHARE], [1], [Have valid unshare() function])], | |
1603 | [ | |
1604 | AC_MSG_RESULT([no]) | |
1605 | ]) | |
1606 | ||
b3425806 | 1607 | |
f8aa8e94 EB |
1608 | AC_ARG_ENABLE([nsenter], |
1609 | AS_HELP_STRING([--disable-nsenter], [do not build nsenter]), | |
08b1c219 | 1610 | [], [UL_DEFAULT_ENABLE([nsenter], [check])] |
f8aa8e94 EB |
1611 | ) |
1612 | UL_BUILD_INIT([nsenter]) | |
1613 | UL_REQUIRES_LINUX([nsenter]) | |
7a3b35b9 | 1614 | UL_REQUIRES_HAVE([nsenter], [setns_syscall], [setns syscall]) |
034d378b | 1615 | AM_CONDITIONAL([BUILD_NSENTER], [test "x$build_nsenter" = xyes]) |
01e94325 KZ |
1616 | |
1617 | AC_MSG_CHECKING([for valid setns() function]) | |
1618 | AC_LINK_IFELSE([AC_LANG_PROGRAM([[ | |
1619 | #include <sched.h> | |
1620 | #include <errno.h> | |
1621 | ]],[[ | |
1622 | int ret; | |
1623 | ret = setns(0, 0); | |
1624 | if (ret != EINVAL && ret != EBADF && ret != EPERM) { | |
1625 | return 1; | |
1626 | } | |
1627 | ]])],[ | |
1628 | AC_MSG_RESULT([yes]) | |
1629 | AC_DEFINE([HAVE_SETNS], [1], [Have valid setns() function])], | |
1630 | [ | |
1631 | AC_MSG_RESULT([no]) | |
1632 | ]) | |
b3425806 | 1633 | |
17d71034 KZ |
1634 | |
1635 | AC_ARG_WITH([cap_ng], | |
801afcb0 | 1636 | AS_HELP_STRING([--without-cap-ng], [compile without libcap-ng]), |
17d71034 KZ |
1637 | [], [with_cap_ng=auto] |
1638 | ) | |
801afcb0 MF |
1639 | AS_IF([test "x$with_cap_ng" = xno], [ |
1640 | AM_CONDITIONAL([HAVE_CAP_NG], [false]) | |
1641 | have_cap_ng=no | |
1642 | ],[ | |
17d71034 KZ |
1643 | UL_CHECK_LIB([cap-ng], [capng_apply], [cap_ng]) |
1644 | ]) | |
1645 | ||
1646 | ||
5600c405 AL |
1647 | AC_ARG_ENABLE([setpriv], |
1648 | AS_HELP_STRING([--disable-setpriv], [do not build setpriv]), | |
08b1c219 | 1649 | [], [UL_DEFAULT_ENABLE([setpriv], [check])] |
5600c405 AL |
1650 | ) |
1651 | UL_BUILD_INIT([setpriv]) | |
1652 | UL_REQUIRES_LINUX([setpriv]) | |
2c2ff2ed KZ |
1653 | UL_REQUIRES_HAVE([setpriv], [linux_securebits_h], [linux/securebits.h header file]) |
1654 | UL_REQUIRES_HAVE([setpriv], [linux_capability_h], [linux/capability.h header file]) | |
e1b8ba20 | 1655 | UL_REQUIRES_HAVE([setpriv], [cap_ng], [libcap-ng library]) |
034d378b | 1656 | AM_CONDITIONAL([BUILD_SETPRIV], [test "x$build_setpriv" = xyes]) |
5600c405 | 1657 | |
04ae85a7 RM |
1658 | AC_ARG_ENABLE([hardlink], |
1659 | AS_HELP_STRING([--disable-hardlink], [do not build hardlink]), | |
1660 | [], [UL_DEFAULT_ENABLE([hardlink], [check])] | |
1661 | ) | |
1662 | UL_BUILD_INIT([hardlink]) | |
1663 | AM_CONDITIONAL([BUILD_HARDLINK], [test "x$build_hardlink" = xyes]) | |
5600c405 | 1664 | |
43989bad | 1665 | |
539feec1 ML |
1666 | AC_ARG_ENABLE([eject], |
1667 | AS_HELP_STRING([--disable-eject], [do not build eject]), | |
08b1c219 | 1668 | [], [UL_DEFAULT_ENABLE([eject], [check])] |
539feec1 ML |
1669 | ) |
1670 | UL_BUILD_INIT([eject]) | |
1671 | UL_REQUIRES_LINUX([eject]) | |
7770e7df | 1672 | UL_REQUIRES_BUILD([eject], [libmount]) |
034d378b | 1673 | AM_CONDITIONAL([BUILD_EJECT], [test "x$build_eject" = xyes]) |
539feec1 ML |
1674 | |
1675 | ||
48d7b13a | 1676 | AC_ARG_ENABLE([agetty], |
7fa4f112 | 1677 | AS_HELP_STRING([--disable-agetty], [do not build agetty]), |
d00c10ed | 1678 | [], [UL_DEFAULT_ENABLE([agetty], [check])] |
48d7b13a | 1679 | ) |
61a074f7 | 1680 | UL_BUILD_INIT([agetty]) |
b4b919fe | 1681 | UL_REQUIRES_HAVE([agetty], [utmpx_h], [utmpx.h header]) |
73afd3f8 | 1682 | UL_REQUIRES_HAVE([agetty], [gnu_utmpx], [GNU utmpx functions]) |
034d378b | 1683 | AM_CONDITIONAL([BUILD_AGETTY], [test "x$build_agetty" = xyes]) |
948182f4 | 1684 | AS_IF([test "x$have_futimens" = xyes && test "x$have_inotify_init1" = xyes ], [ |
90d5285d KZ |
1685 | AC_DEFINE([AGETTY_RELOAD], [1], [Enable agetty --reload feature]) |
1686 | ],[ | |
1687 | AC_MSG_WARN([futimens or inotify_init1 not found; agetty(8) will not provide ---reload functionality]) | |
1688 | ]) | |
0fc74be1 | 1689 | |
48d7b13a | 1690 | |
1eb16fd7 | 1691 | AC_ARG_ENABLE([plymouth_support], |
c89edac5 | 1692 | AS_HELP_STRING([--disable-plymouth_support], [do not care about plymouth in sulogin(8) and agetty(8)]), |
d67f61c0 | 1693 | [], [enable_plymouth_support=check] |
1eb16fd7 KZ |
1694 | ) |
1695 | UL_BUILD_INIT([plymouth_support]) | |
1696 | UL_REQUIRES_HAVE([plymouth_support], [tiocglcktrmios], [TIOCGLCKTRMIOS flag]) | |
1697 | UL_REQUIRES_HAVE([plymouth_support], [sock_cloexec], [SOCK_CLOEXEC flag]) | |
1698 | UL_REQUIRES_HAVE([plymouth_support], [sock_nonblock], [SOCK_NONBLOCK flag]) | |
1699 | UL_REQUIRES_HAVE([plymouth_support], [so_passcred], [SO_PASSCRED flag]) | |
1700 | AM_CONDITIONAL([USE_PLYMOUTH_SUPPORT], [test "x$build_plymouth_support" = xyes]) | |
1701 | AS_IF([test "x$build_plymouth_support" = xyes ], [ | |
c89edac5 | 1702 | AC_DEFINE([USE_PLYMOUTH_SUPPORT], [1], [Enable plymouth support feature for sulogin and agetty]) |
1eb16fd7 KZ |
1703 | ]) |
1704 | ||
1705 | ||
17d71034 KZ |
1706 | AC_ARG_WITH([libz], |
1707 | AS_HELP_STRING([--without-libz], [compile without libz]), | |
1708 | [], [with_libz=auto] | |
1709 | ) | |
1710 | AS_IF([test "x$with_libz" = xno], [have_z=no], [ | |
1711 | AC_CHECK_LIB([z], [crc32], [have_z=yes], [have_z=no]) | |
1712 | ]) | |
1713 | ||
09070e1a SK |
1714 | AC_ARG_WITH([libmagic], |
1715 | AS_HELP_STRING([--without-libmagic], [compile without libmagic]), | |
1716 | [], [with_libmagic=auto] | |
1717 | ) | |
1718 | AS_IF([test "x$with_libmagic" = xno], [have_magic=no], [ | |
1719 | AC_CHECK_LIB([magic], [magic_open], [ | |
263381dd MM |
1720 | AC_CHECK_HEADER(magic.h, [ |
1721 | AC_DEFINE([HAVE_MAGIC], [1], [Define to 1 if you have the libmagic present.]) | |
1722 | MAGIC_LIBS="-lmagic" | |
1723 | ]) | |
09070e1a SK |
1724 | ]) |
1725 | ]) | |
1726 | AC_SUBST([MAGIC_LIBS]) | |
1727 | ||
17d71034 | 1728 | |
9cb68977 | 1729 | AC_ARG_ENABLE([cramfs], |
7fa4f112 | 1730 | AS_HELP_STRING([--disable-cramfs], [do not build fsck.cramfs, mkfs.cramfs]), |
08b1c219 | 1731 | [], [UL_DEFAULT_ENABLE([cramfs], [check])] |
9cb68977 | 1732 | ) |
61a074f7 | 1733 | UL_BUILD_INIT([cramfs]) |
d81b5a52 | 1734 | UL_REQUIRES_HAVE([cramfs], [z], [z library]) |
034d378b | 1735 | AM_CONDITIONAL([BUILD_CRAMFS], [test "x$build_cramfs" = xyes]) |
9cb68977 | 1736 | |
a13cdb7a | 1737 | |
8d6f0bae | 1738 | AC_ARG_ENABLE([bfs], |
834fc88c | 1739 | AS_HELP_STRING([--disable-bfs], [do not build mkfs.bfs]), |
08b1c219 | 1740 | [], [UL_DEFAULT_ENABLE([bfs], [yes])] |
834fc88c KZ |
1741 | ) |
1742 | UL_BUILD_INIT([bfs]) | |
034d378b | 1743 | AM_CONDITIONAL([BUILD_BFS], [test "x$build_bfs" = xyes]) |
834fc88c KZ |
1744 | |
1745 | ||
3d9fdac5 KZ |
1746 | AC_ARG_ENABLE([minix], |
1747 | AS_HELP_STRING([--disable-minix], [do not build fsck.minix, mkfs.minix]), | |
08b1c219 | 1748 | [], [UL_DEFAULT_ENABLE([minix], [yes])] |
3d9fdac5 KZ |
1749 | ) |
1750 | UL_BUILD_INIT([minix]) | |
1751 | AM_CONDITIONAL([BUILD_MINIX], [test "x$build_minix" = xyes]) | |
1752 | ||
1753 | ||
8d6f0bae | 1754 | AC_ARG_ENABLE([fdformat], |
13b26e3c SK |
1755 | AS_HELP_STRING([--enable-fdformat], [build fdformat]), |
1756 | [], [UL_DEFAULT_ENABLE([fdformat], [no])] | |
8d6f0bae KZ |
1757 | ) |
1758 | UL_BUILD_INIT([fdformat]) | |
1759 | UL_REQUIRES_LINUX([fdformat]) | |
034d378b | 1760 | AM_CONDITIONAL([BUILD_FDFORMAT], [test "x$build_fdformat" = xyes]) |
8d6f0bae KZ |
1761 | |
1762 | ||
6acf31ac KZ |
1763 | AC_ARG_ENABLE([hwclock], |
1764 | AS_HELP_STRING([--disable-hwclock], [do not build hwclock]), | |
08b1c219 | 1765 | [], [UL_DEFAULT_ENABLE([hwclock], [check])] |
6acf31ac KZ |
1766 | ) |
1767 | have_linuxdummy=$linux_os | |
1768 | ||
1769 | UL_BUILD_INIT([hwclock]) | |
1770 | UL_REQUIRES_HAVE([hwclock], [io, linuxdummy], [ioperm iopl function or Linux]) | |
034d378b | 1771 | AM_CONDITIONAL([BUILD_HWCLOCK], [test "x$build_hwclock" = xyes]) |
e09ebf22 | 1772 | |
b1062292 | 1773 | AC_ARG_ENABLE([hwclock_cmos], |
88bc304b | 1774 | AS_HELP_STRING([--disable-hwclock-cmos], [do not use CMOS clock]), |
b1062292 | 1775 | [], [enable_hwclock_cmos=check] |
88bc304b | 1776 | ) |
b1062292 KZ |
1777 | UL_BUILD_INIT([hwclock_cmos]) |
1778 | UL_REQUIRES_BUILD([hwclock_cmos], [hwclock]) | |
1779 | UL_REQUIRES_ARCH([hwclock_cmos], [i?86-*,x86_64*]) | |
1780 | AM_CONDITIONAL([USE_HWCLOCK_CMOS], [test "x$build_hwclock_cmos" = xyes]) | |
1781 | AS_IF([test "x$build_hwclock_cmos" = xyes ], [ | |
1782 | AC_DEFINE([USE_HWCLOCK_CMOS], [1], [Define to 1 if want to use CMOS clock.]) | |
88bc304b CS |
1783 | ]) |
1784 | ||
e8c21c89 KZ |
1785 | AC_ARG_ENABLE([hwclock_gplv3], |
1786 | AS_HELP_STRING([--disable-hwclock-gplv3], [do not use datetime parsing GPLv3 code]), | |
1787 | [], [enable_hwclock_gplv3=yes] | |
1788 | ) | |
1789 | AM_CONDITIONAL([USE_HWCLOCK_GPLv3_DATETIME], [test "x$enable_hwclock_gplv3" = xyes]) | |
1790 | AS_IF([test "x$enable_hwclock_gplv3" = xyes ], [ | |
1791 | AC_DEFINE([USE_HWCLOCK_GPLv3_DATETIME], [1], [use datetime parsing GPLv3 code to hwclock]) | |
1792 | ]) | |
1793 | ||
88bc304b | 1794 | |
5ec1108c | 1795 | AC_ARG_ENABLE([mkfs], |
1796 | AS_HELP_STRING([--disable-mkfs], [do not build mkfs(8)]), | |
1797 | [], [UL_DEFAULT_ENABLE([mkfs], [check])] | |
1798 | ) | |
1799 | UL_BUILD_INIT([mkfs]) | |
ecc6047e KZ |
1800 | AM_CONDITIONAL([BUILD_MKFS], [test "x$build_mkfs" = xyes]) |
1801 | ||
1802 | UL_BUILD_INIT([isosize], [yes]) | |
1803 | AM_CONDITIONAL([BUILD_ISOSIZE], [test "x$build_isosize" = xyes]) | |
1804 | ||
3d9fdac5 | 1805 | |
5ec1108c | 1806 | AC_ARG_ENABLE([fstrim], |
1807 | AS_HELP_STRING([--disable-fstrim], [do not build fstrim(8)]), | |
1808 | [], [UL_DEFAULT_ENABLE([fstrim], [check])] | |
1809 | ) | |
1810 | UL_BUILD_INIT([fstrim]) | |
7b040214 KZ |
1811 | UL_REQUIRES_LINUX([fstrim]) |
1812 | UL_REQUIRES_BUILD([fstrim], [libmount]) | |
1813 | AM_CONDITIONAL([BUILD_FSTRIM], [test "x$build_fstrim" = xyes]) | |
1814 | ||
1815 | ||
5ec1108c | 1816 | AC_ARG_ENABLE([swapon], |
1817 | AS_HELP_STRING([--disable-swapon], [do not build swapon(8) and swapoff(8)]), | |
1818 | [], [UL_DEFAULT_ENABLE([swapon], [check])] | |
1819 | ) | |
1820 | UL_BUILD_INIT([swapon]) | |
143635c9 | 1821 | UL_REQUIRES_LINUX([swapon]) |
cf9b16f1 KZ |
1822 | UL_REQUIRES_SYSCALL_CHECK([swapon], [UL_CHECK_SYSCALL([swapon])], [swapon]) |
1823 | UL_REQUIRES_SYSCALL_CHECK([swapon], [UL_CHECK_SYSCALL([swapoff])], [swapoff]) | |
143635c9 | 1824 | UL_REQUIRES_BUILD([swapon], [libblkid]) |
7770e7df | 1825 | UL_REQUIRES_BUILD([swapon], [libmount]) |
7477f356 | 1826 | UL_REQUIRES_BUILD([swapon], [libsmartcols]) |
034d378b | 1827 | AM_CONDITIONAL([BUILD_SWAPON], [test "x$build_swapon" = xyes]) |
cf9b16f1 KZ |
1828 | AC_CHECK_FUNCS([swapon]) |
1829 | AC_CHECK_FUNCS([swapoff]) | |
143635c9 KZ |
1830 | |
1831 | ||
61a074f7 | 1832 | UL_BUILD_INIT([lsblk], [check]) |
a13cdb7a KZ |
1833 | UL_REQUIRES_LINUX([lsblk]) |
1834 | UL_REQUIRES_BUILD([lsblk], [libblkid]) | |
9554f7ab | 1835 | UL_REQUIRES_BUILD([lsblk], [libmount]) |
7477f356 | 1836 | UL_REQUIRES_BUILD([lsblk], [libsmartcols]) |
034d378b | 1837 | AM_CONDITIONAL([BUILD_LSBLK], [test "x$build_lsblk" = xyes]) |
9cb68977 | 1838 | |
a3d3b770 | 1839 | |
5ec1108c | 1840 | AC_ARG_ENABLE([lscpu], |
1841 | AS_HELP_STRING([--disable-lscpu], [do not build lscpu]), | |
1842 | [], [UL_DEFAULT_ENABLE([lscpu], [check])] | |
1843 | ) | |
1844 | UL_BUILD_INIT([lscpu]) | |
da396d88 | 1845 | UL_REQUIRES_LINUX([lscpu]) |
7477f356 | 1846 | UL_REQUIRES_BUILD([lscpu], [libsmartcols]) |
da396d88 | 1847 | UL_REQUIRES_HAVE([lscpu], [cpu_set_t], [cpu_set_t type]) |
034d378b | 1848 | AM_CONDITIONAL([BUILD_LSCPU], [test "x$build_lscpu" = xyes]) |
da396d88 | 1849 | |
f2c3f2c7 AP |
1850 | AC_ARG_ENABLE([lsfd], |
1851 | AS_HELP_STRING([--disable-lsfd], [do not build lsfd]), | |
1852 | [], [UL_DEFAULT_ENABLE([lsfd], [check])] | |
1853 | ) | |
1854 | UL_BUILD_INIT([lsfd]) | |
128beb71 MY |
1855 | UL_REQUIRES_LINUX([lsfd]) |
1856 | UL_REQUIRES_BUILD([lsfd], [libsmartcols]) | |
0c44599f | 1857 | UL_REQUIRES_HAVE([lsfd], [linux_bpf_h], [linux/bpf.h header file]) |
128beb71 | 1858 | AM_CONDITIONAL([BUILD_LSFD], [test "x$build_lsfd" = xyes]) |
a3d3b770 | 1859 | |
50e6f15b RM |
1860 | AC_ARG_ENABLE([lslogins], |
1861 | AS_HELP_STRING([--disable-lslogins], [do not build lslogins]), | |
1862 | [], [UL_DEFAULT_ENABLE([lslogins], [check])] | |
1863 | ) | |
1864 | UL_BUILD_INIT([lslogins]) | |
ab1cfad5 | 1865 | UL_REQUIRES_BUILD([lslogins], [libsmartcols]) |
d00c10ed | 1866 | UL_REQUIRES_HAVE([lslogins], [shadow_h], [shadow.h header]) |
b4b919fe | 1867 | UL_REQUIRES_HAVE([lslogins], [utmpx_h], [utmpx.h header]) |
73afd3f8 | 1868 | UL_REQUIRES_HAVE([lslogins], [gnu_utmpx], [GNU utmpx functions]) |
ab1cfad5 OO |
1869 | AM_CONDITIONAL([BUILD_LSLOGINS], [test "x$build_lslogins" = xyes]) |
1870 | ||
1871 | ||
61a074f7 | 1872 | UL_BUILD_INIT([chcpu], [check]) |
da396d88 KZ |
1873 | UL_REQUIRES_LINUX([chcpu]) |
1874 | UL_REQUIRES_HAVE([chcpu], [cpu_set_t], [cpu_set_t type]) | |
034d378b | 1875 | AM_CONDITIONAL([BUILD_CHCPU], [test "x$build_chcpu" = xyes]) |
da396d88 | 1876 | |
a13cdb7a | 1877 | |
7fcccbdf KZ |
1878 | AC_ARG_ENABLE([wdctl], |
1879 | AS_HELP_STRING([--disable-wdctl], [do not build wdctl]), | |
08b1c219 | 1880 | [], [UL_DEFAULT_ENABLE([wdctl], [check])] |
7fcccbdf KZ |
1881 | ) |
1882 | UL_BUILD_INIT([wdctl]) | |
5b0289b9 | 1883 | UL_REQUIRES_LINUX([wdctl]) |
7477f356 | 1884 | UL_REQUIRES_BUILD([wdctl], [libsmartcols]) |
5b0289b9 | 1885 | UL_REQUIRES_HAVE([wdctl], [linux_watchdog_h], [linux/watchdog.h header file]) |
034d378b | 1886 | AM_CONDITIONAL([BUILD_WDCTL], [test "x$build_wdctl" = xyes]) |
5b0289b9 KZ |
1887 | |
1888 | ||
54dbc8cf KZ |
1889 | UL_BUILD_INIT([swaplabel], [check]) |
1890 | UL_REQUIRES_BUILD([swaplabel], [libblkid]) | |
034d378b | 1891 | AM_CONDITIONAL([BUILD_SWAPLABEL], [test "x$build_swaplabel" = xyes]) |
54dbc8cf KZ |
1892 | |
1893 | ||
ecc6047e KZ |
1894 | UL_BUILD_INIT([mkswap], [yes]) |
1895 | AM_CONDITIONAL([BUILD_MKSWAP], [test "x$build_mkswap" = xyes]) | |
948182f4 | 1896 | AS_IF([test "x$build_mkswap" = xyes && test "x$build_libuuid" != xyes], [ |
08b1c219 KZ |
1897 | AC_MSG_WARN([uuid library is not found; mkswap(8) will not generate UUIDs]) |
1898 | ]) | |
ecc6047e | 1899 | |
328eb445 KZ |
1900 | |
1901 | AC_ARG_ENABLE([cal], | |
1902 | AS_HELP_STRING([--disable-cal], [do not build cal]), | |
1903 | [], [UL_DEFAULT_ENABLE([cal], [check])] | |
1904 | ) | |
1905 | UL_BUILD_INIT([cal]) | |
1b15cbd1 KZ |
1906 | AM_CONDITIONAL([BUILD_CAL], [test "x$build_cal" = xyes]) |
1907 | ||
50e6f15b RM |
1908 | AC_ARG_ENABLE([logger], |
1909 | AS_HELP_STRING([--disable-logger], [do not build logger]), | |
1910 | [], [UL_DEFAULT_ENABLE([logger], [check])] | |
1911 | ) | |
1912 | UL_BUILD_INIT([logger]) | |
1b15cbd1 KZ |
1913 | AM_CONDITIONAL([BUILD_LOGGER], [test "x$build_logger" = xyes]) |
1914 | ||
4c838e6c | 1915 | UL_BUILD_INIT([look], [yes]) |
1b15cbd1 KZ |
1916 | AM_CONDITIONAL([BUILD_LOOK], [test "x$build_look" = xyes]) |
1917 | ||
1918 | UL_BUILD_INIT([mcookie], [yes]) | |
1919 | AM_CONDITIONAL([BUILD_MCOOKIE], [test "x$build_mcookie" = xyes]) | |
1920 | ||
1921 | UL_BUILD_INIT([namei], [yes]) | |
1922 | AM_CONDITIONAL([BUILD_NAMEI], [test "x$build_namei" = xyes]) | |
1923 | ||
c9ab7387 AH |
1924 | matriplet="$($CC -print-multiarch 2>/dev/null || true)" |
1925 | if test "x$matriplet" != "x"; then | |
1926 | AC_DEFINE_UNQUOTED([MULTIARCHTRIPLET], ["$matriplet"], | |
1927 | ["Multi-arch triplet for whereis library search path"]) | |
1928 | fi | |
b7fc158a SN |
1929 | AC_ARG_ENABLE([whereis], |
1930 | AS_HELP_STRING([--disable-whereis], [do not build whereis]), | |
1931 | [], [UL_DEFAULT_ENABLE([whereis], [check])] | |
1932 | ) | |
1933 | UL_BUILD_INIT([whereis]) | |
1b15cbd1 KZ |
1934 | AM_CONDITIONAL([BUILD_WHEREIS], [test "x$build_whereis" = xyes]) |
1935 | ||
c221578e NS |
1936 | AC_ARG_ENABLE([pipesz], |
1937 | AS_HELP_STRING([--disable-pipesz], [do not build pipesz]), | |
62604365 | 1938 | [], [UL_DEFAULT_ENABLE([pipesz], [check])] |
c221578e NS |
1939 | ) |
1940 | UL_BUILD_INIT([pipesz]) | |
1941 | UL_REQUIRES_LINUX([pipesz]) | |
1942 | AM_CONDITIONAL([BUILD_PIPESZ], [test "x$build_pipesz" = xyes]) | |
1943 | ||
642e1c69 MY |
1944 | UL_BUILD_INIT([fadvise], [check]) |
1945 | UL_REQUIRES_LINUX([fadvise]) | |
1946 | AM_CONDITIONAL([BUILD_FADVISE], [test "x$build_fadvise" = xyes]) | |
1947 | ||
c0d75916 FS |
1948 | AC_ARG_ENABLE([waitpid], |
1949 | AS_HELP_STRING([--disable-waitpid], [do not build waitpid]), | |
58c16c84 | 1950 | [], [UL_DEFAULT_ENABLE([waitpid], [check])] |
c0d75916 FS |
1951 | ) |
1952 | UL_BUILD_INIT([waitpid]) | |
550d32c4 | 1953 | UL_REQUIRES_LINUX([waitpid]) |
ffdd75cc | 1954 | UL_REQUIRES_SYSCALL_CHECK([waitpid], [UL_CHECK_SYSCALL([pidfd_open])], [pidfd_open]) |
550d32c4 TW |
1955 | AM_CONDITIONAL([BUILD_WAITPID], [test "x$build_waitpid" = xyes]) |
1956 | ||
ba05b9ff KZ |
1957 | AC_ARG_ENABLE([enosys], |
1958 | AS_HELP_STRING([--disable-enosys], [do not build enosys]), | |
1959 | [], [UL_DEFAULT_ENABLE([enosys], [check])] | |
1960 | ) | |
1961 | UL_BUILD_INIT([enosys]) | |
cba52cc1 | 1962 | UL_REQUIRES_LINUX([enosys]) |
ba05b9ff | 1963 | UL_REQUIRES_HAVE([enosys], [linux_audit_h], [linux/audit.h header file]) |
3e0bbb12 TW |
1964 | AS_IF([test "x$build_enosys" = xyes], [ |
1965 | AC_MSG_CHECKING([for valid audit arch]) | |
1966 | AC_COMPILE_IFELSE( | |
1967 | [AC_LANG_PROGRAM([[#include "${srcdir}/include/audit-arch.h"]])], | |
1968 | [AC_MSG_RESULT([yes])], | |
1969 | [AC_MSG_RESULT([no]) | |
1970 | build_enosys=no | |
1971 | ]) | |
1972 | ]) | |
cba52cc1 TW |
1973 | AM_CONDITIONAL([BUILD_ENOSYS], [test "x$build_enosys" = xyes]) |
1974 | ||
22c41e99 KZ |
1975 | UL_BUILD_INIT([lsclocks], [check]) |
1976 | UL_REQUIRES_LINUX([lsclocks]) | |
956ccf25 | 1977 | UL_REQUIRES_BUILD([lsclocks], [libsmartcols]) |
e9ddea79 TW |
1978 | AM_CONDITIONAL([BUILD_LSCLOCKS], [test "x$build_lsclocks" = xyes]) |
1979 | ||
3adaaa15 KZ |
1980 | UL_BUILD_INIT([getopt], [yes]) |
1981 | AM_CONDITIONAL([BUILD_GETOPT], [test "x$build_getopt" = xyes]) | |
1982 | ||
ecc6047e KZ |
1983 | |
1984 | UL_BUILD_INIT([blockdev], [check]) | |
1985 | UL_REQUIRES_LINUX([blockdev]) | |
1986 | AM_CONDITIONAL([BUILD_BLOCKDEV], [test "x$build_blockdev" = xyes]) | |
1987 | ||
1988 | ||
945ac250 KZ |
1989 | UL_BUILD_INIT([prlimit], [check]) |
1990 | UL_REQUIRES_LINUX([prlimit]) | |
7477f356 | 1991 | UL_REQUIRES_BUILD([prlimit], [libsmartcols]) |
945ac250 | 1992 | UL_REQUIRES_SYSCALL_CHECK([prlimit], [UL_CHECK_SYSCALL([prlimit64])], [prlimit64]) |
034d378b | 1993 | AM_CONDITIONAL([BUILD_PRLIMIT], [test "x$build_prlimit" = xyes]) |
3013eb9d | 1994 | AS_IF([test "x$build_prlimit" = xyes], [ |
01e94325 KZ |
1995 | dnl check for valid prlimit() function |
1996 | AC_MSG_CHECKING([for valid prlimit() function]) | |
1997 | AC_LINK_IFELSE([AC_LANG_PROGRAM([[ | |
1998 | #include <sys/types.h> | |
1999 | #include <sys/time.h> | |
2000 | #include <sys/resource.h> | |
2001 | #include <stddef.h> | |
2002 | ]],[[ | |
2003 | int ret; | |
2004 | ret = prlimit(0, RLIMIT_AS, NULL, NULL); | |
2005 | if (ret != 0) { | |
2006 | return 1; | |
2007 | } | |
2008 | ]])],[ | |
2009 | AC_MSG_RESULT([yes]) | |
2010 | AC_DEFINE([HAVE_PRLIMIT], [1], [Have valid prlimit() function])],[ | |
2011 | AC_MSG_RESULT([no])]) | |
3013eb9d | 2012 | ]) |
945ac250 KZ |
2013 | |
2014 | ||
01e94325 | 2015 | |
3dc02ef4 DB |
2016 | UL_BUILD_INIT([lslocks], [check]) |
2017 | UL_REQUIRES_LINUX([lslocks]) | |
ec1204dc | 2018 | UL_REQUIRES_BUILD([lslocks], [libmount]) |
7477f356 | 2019 | UL_REQUIRES_BUILD([lslocks], [libsmartcols]) |
034d378b | 2020 | AM_CONDITIONAL([BUILD_LSLOCKS], [test "x$build_lslocks" = xyes]) |
3dc02ef4 DB |
2021 | |
2022 | ||
bd671347 KZ |
2023 | AC_ARG_ENABLE([switch_root], |
2024 | AS_HELP_STRING([--disable-switch_root], [do not build switch_root]), | |
08b1c219 | 2025 | [], [UL_DEFAULT_ENABLE([switch_root], [check])] |
bd671347 | 2026 | ) |
61a074f7 | 2027 | UL_BUILD_INIT([switch_root]) |
a3d3b770 KZ |
2028 | UL_REQUIRES_LINUX([switch_root]) |
2029 | UL_REQUIRES_HAVE([switch_root], [openat], [openat function]) | |
a68ed87f | 2030 | UL_REQUIRES_HAVE([switch_root], [dirfd,ddfd], [dirfd or ddfd function]) |
034d378b | 2031 | AM_CONDITIONAL([BUILD_SWITCH_ROOT], [test "x$build_switch_root" = xyes]) |
bd671347 KZ |
2032 | |
2033 | ||
11125e7a KZ |
2034 | AC_ARG_ENABLE([pivot_root], |
2035 | AS_HELP_STRING([--disable-pivot_root], [do not build pivot_root]), | |
08b1c219 | 2036 | [], [UL_DEFAULT_ENABLE([pivot_root], [check])] |
11125e7a | 2037 | ) |
61a074f7 | 2038 | UL_BUILD_INIT([pivot_root]) |
5cbbdfbf | 2039 | UL_REQUIRES_LINUX([pivot_root]) |
9f632667 | 2040 | UL_REQUIRES_SYSCALL_CHECK([pivot_root], [UL_CHECK_SYSCALL([pivot_root])]) |
034d378b | 2041 | AM_CONDITIONAL([BUILD_PIVOT_ROOT], [test "x$build_pivot_root" = xyes]) |
11125e7a KZ |
2042 | |
2043 | ||
c12fc5e1 | 2044 | UL_BUILD_INIT([flock], [check]) |
3001923b | 2045 | UL_REQUIRES_HAVE([flock], [timer], [timer_create/setitimer function]) |
205dbb7a KZ |
2046 | AM_CONDITIONAL([BUILD_FLOCK], [test "x$build_flock" = xyes]) |
2047 | ||
bdfe4601 | 2048 | |
cad2d1ac HC |
2049 | AC_ARG_ENABLE([lsmem], |
2050 | AS_HELP_STRING([--disable-lsmem], [do not build lsmem]), | |
bdfe4601 | 2051 | [], [UL_DEFAULT_ENABLE([lsmem], [check])] |
cad2d1ac HC |
2052 | ) |
2053 | UL_BUILD_INIT([lsmem]) | |
bdfe4601 | 2054 | UL_REQUIRES_LINUX([lsmem]) |
8b7f00a8 | 2055 | UL_REQUIRES_BUILD([lsmem], [libsmartcols]) |
cad2d1ac HC |
2056 | AM_CONDITIONAL([BUILD_LSMEM], [test "x$build_lsmem" = xyes]) |
2057 | ||
bdfe4601 | 2058 | |
30e1ea8b HC |
2059 | AC_ARG_ENABLE([chmem], |
2060 | AS_HELP_STRING([--disable-chmem], [do not build chmem]), | |
bdfe4601 | 2061 | [], [UL_DEFAULT_ENABLE([chmem], [check])] |
30e1ea8b HC |
2062 | ) |
2063 | UL_BUILD_INIT([chmem]) | |
bdfe4601 | 2064 | UL_REQUIRES_LINUX([chmem]) |
30e1ea8b HC |
2065 | AM_CONDITIONAL([BUILD_CHMEM], [test "x$build_chmem" = xyes]) |
2066 | ||
205dbb7a | 2067 | |
45020b67 KZ |
2068 | AC_ARG_ENABLE([ipcmk], |
2069 | AS_HELP_STRING([--disable-ipcmk], [do not build ipcmk]), | |
2070 | [], [UL_DEFAULT_ENABLE([ipcmk], [check])] | |
2071 | ) | |
2072 | UL_BUILD_INIT([ipcmk]) | |
2073 | UL_EXCLUDE_ARCH([ipcmk], [*darwin*]) | |
2074 | AM_CONDITIONAL([BUILD_IPCMK], [test "x$build_ipcmk" = xyes]) | |
bdfe4601 | 2075 | |
42a4a152 RM |
2076 | AC_ARG_ENABLE([ipcrm], |
2077 | AS_HELP_STRING([--disable-ipcrm], [do not build ipcrm]), | |
45020b67 | 2078 | [], [UL_DEFAULT_ENABLE([ipcrm], [check])] |
42a4a152 RM |
2079 | ) |
2080 | UL_BUILD_INIT([ipcrm]) | |
45020b67 | 2081 | UL_EXCLUDE_ARCH([ipcrm], [*darwin*]) |
205dbb7a KZ |
2082 | AM_CONDITIONAL([BUILD_IPCRM], [test "x$build_ipcrm" = xyes]) |
2083 | ||
42a4a152 RM |
2084 | AC_ARG_ENABLE([ipcs], |
2085 | AS_HELP_STRING([--disable-ipcs], [do not build ipcs]), | |
45020b67 | 2086 | [], [UL_DEFAULT_ENABLE([ipcs], [check])] |
42a4a152 RM |
2087 | ) |
2088 | UL_BUILD_INIT([ipcs]) | |
45020b67 | 2089 | UL_EXCLUDE_ARCH([ipcs], [*darwin*]) |
205dbb7a KZ |
2090 | AM_CONDITIONAL([BUILD_IPCS], [test "x$build_ipcs" = xyes]) |
2091 | ||
a0f62b0b | 2092 | |
4f6610f5 SK |
2093 | AC_ARG_ENABLE([irqtop], |
2094 | AS_HELP_STRING([--disable-irqtop], [do not build irqtop]), | |
c61470c7 | 2095 | [], [UL_DEFAULT_ENABLE([irqtop], [check])] |
4f6610f5 SK |
2096 | ) |
2097 | UL_BUILD_INIT([irqtop]) | |
fa8c5cd5 | 2098 | UL_REQUIRES_LINUX([irqtop]) |
a0f62b0b KZ |
2099 | UL_REQUIRES_BUILD([irqtop], [libsmartcols]) |
2100 | UL_REQUIRES_HAVE([irqtop], [open_memstream], [open_memstream function]) | |
2101 | UL_REQUIRES_HAVE([irqtop], [ncursesw,slang,ncurses], [ncursesw, ncurses or slang library]) | |
4f6610f5 SK |
2102 | AM_CONDITIONAL([BUILD_IRQTOP], [test "x$build_irqtop" = xyes]) |
2103 | ||
a0f62b0b KZ |
2104 | AC_ARG_ENABLE([lsirq], |
2105 | AS_HELP_STRING([--disable-lsirq], [do not build lsirq]), | |
c61470c7 | 2106 | [], [UL_DEFAULT_ENABLE([lsirq], [check])] |
a0f62b0b KZ |
2107 | ) |
2108 | UL_BUILD_INIT([lsirq]) | |
2109 | UL_REQUIRES_LINUX([lsirq]) | |
2110 | UL_REQUIRES_BUILD([lsirq], [libsmartcols]) | |
2111 | AM_CONDITIONAL([BUILD_LSIRQ], [test "x$build_lsirq" = xyes]) | |
2112 | ||
2113 | ||
8fa223da KZ |
2114 | UL_BUILD_INIT([choom], [check]) |
2115 | UL_REQUIRES_LINUX([choom]) | |
2116 | AM_CONDITIONAL([BUILD_CHOOM], [test "x$build_choom" = xyes]) | |
2117 | ||
9d20ffda KZ |
2118 | UL_BUILD_INIT([lsipc], [check]) |
2119 | UL_REQUIRES_LINUX([lsipc]) | |
2120 | UL_REQUIRES_BUILD([lsipc], [libsmartcols]) | |
2121 | AM_CONDITIONAL([BUILD_LSIPC], [test "x$build_lsipc" = xyes]) | |
2122 | ||
dcf8f3b4 FF |
2123 | AC_ARG_ENABLE([lsns], |
2124 | AS_HELP_STRING([--disable-lsns], [do not build lsns]), | |
2125 | [], [UL_DEFAULT_ENABLE([lsns], [check])] | |
2126 | ) | |
2127 | UL_BUILD_INIT([lsns]) | |
8a204562 KZ |
2128 | UL_REQUIRES_LINUX([lsns]) |
2129 | UL_REQUIRES_BUILD([lsns], [libsmartcols]) | |
4b328279 | 2130 | UL_REQUIRES_BUILD([lsns], [libmount]) |
8a204562 KZ |
2131 | AM_CONDITIONAL([BUILD_LSNS], [test "x$build_lsns" = xyes]) |
2132 | ||
205dbb7a KZ |
2133 | UL_BUILD_INIT([renice], [yes]) |
2134 | AM_CONDITIONAL([BUILD_RENICE], [test "x$build_renice" = xyes]) | |
2135 | ||
3d47ab05 KZ |
2136 | |
2137 | AC_ARG_ENABLE([rfkill], | |
2138 | AS_HELP_STRING([--disable-rfkill], [do not build rfkill]), | |
271552c7 | 2139 | [], [UL_DEFAULT_ENABLE([rfkill], [check])] |
3d47ab05 KZ |
2140 | ) |
2141 | UL_BUILD_INIT([rfkill]) | |
367f4080 | 2142 | UL_REQUIRES_LINUX([rfkill]) |
b3849c66 | 2143 | UL_REQUIRES_BUILD([rfkill], [libsmartcols]) |
c0d78c90 SK |
2144 | AM_CONDITIONAL([BUILD_RFKILL], [test "x$build_rfkill" = xyes]) |
2145 | ||
3d47ab05 | 2146 | |
f092076f DDM |
2147 | UL_BUILD_INIT([setpgid], [yes]) |
2148 | AM_CONDITIONAL([BUILD_SETPGID], [test "x$build_setpgid" = xyes]) | |
2149 | ||
205dbb7a KZ |
2150 | UL_BUILD_INIT([setsid], [yes]) |
2151 | AM_CONDITIONAL([BUILD_SETSID], [test "x$build_setsid" = xyes]) | |
2152 | ||
2153 | UL_BUILD_INIT([readprofile], [check]) | |
2154 | UL_REQUIRES_LINUX([readprofile]) | |
2155 | AM_CONDITIONAL([BUILD_READPROFILE], [test "x$build_readprofile" = xyes]) | |
2156 | ||
2157 | UL_BUILD_INIT([dmesg], [check]) | |
2158 | UL_REQUIRES_LINUX([dmesg]) | |
2159 | AM_CONDITIONAL([BUILD_DMESG], [test "x$build_dmesg" = xyes]) | |
2160 | ||
2161 | UL_BUILD_INIT([ctrlaltdel], [check]) | |
2162 | UL_REQUIRES_LINUX([ctrlaltdel]) | |
e52b58e6 CTV |
2163 | dnl we assume reboot() to be the 1-argument variant, because even considering |
2164 | dnl widely used alternative C libraries like uclibc, dietlibc and musl, | |
2165 | dnl reboot() with multiple arguments is yet only found in glibc versions | |
2166 | dnl earlier than 2.x. | |
9dd55a04 | 2167 | UL_REQUIRES_HAVE([ctrlaltdel], [reboot], [reboot function]) |
205dbb7a KZ |
2168 | AM_CONDITIONAL([BUILD_CTRLALTDEL], [test "x$build_ctrlaltdel" = xyes]) |
2169 | ||
b6252de2 KZ |
2170 | AC_ARG_ENABLE([exch], |
2171 | AS_HELP_STRING([--disable-exch], [do not build exch]), | |
2172 | [], [UL_DEFAULT_ENABLE([exch], [check])] | |
2173 | ) | |
cd094a05 MY |
2174 | UL_BUILD_INIT([exch]) |
2175 | UL_REQUIRES_LINUX([exch]) | |
b6252de2 | 2176 | UL_REQUIRES_SYSCALL_CHECK([exch], [UL_CHECK_SYSCALL([renameat2])]) |
cd094a05 MY |
2177 | AM_CONDITIONAL([BUILD_EXCH], [test "x$build_exch" = xyes]) |
2178 | ||
a921a7de MY |
2179 | UL_BUILD_INIT([fincore], [check]) |
2180 | UL_REQUIRES_LINUX([fincore]) | |
3e37d7b7 | 2181 | UL_REQUIRES_BUILD([fincore], [libsmartcols]) |
a921a7de MY |
2182 | AM_CONDITIONAL([BUILD_FINCORE], [test "x$build_fincore" = xyes]) |
2183 | ||
205dbb7a KZ |
2184 | UL_BUILD_INIT([fsfreeze], [check]) |
2185 | UL_REQUIRES_LINUX([fsfreeze]) | |
2186 | AM_CONDITIONAL([BUILD_FSFREEZE], [test "x$build_fsfreeze" = xyes]) | |
2187 | ||
2188 | UL_BUILD_INIT([blkdiscard], [check]) | |
2189 | UL_REQUIRES_LINUX([blkdiscard]) | |
2190 | AM_CONDITIONAL([BUILD_BLKDISCARD], [test "x$build_blkdiscard" = xyes]) | |
2191 | ||
1ad8ef91 KZ |
2192 | UL_BUILD_INIT([blkzone], [check]) |
2193 | UL_REQUIRES_LINUX([blkzone]) | |
2194 | UL_REQUIRES_HAVE([blkzone], [linux_blkzoned_h], [linux/blkzoned.h header]) | |
2195 | AM_CONDITIONAL([BUILD_BLKZONE], [test "x$build_blkzone" = xyes]) | |
2196 | ||
627428a9 | 2197 | UL_BUILD_INIT([blkpr], [check]) |
2198 | UL_REQUIRES_LINUX([blkpr]) | |
2199 | UL_REQUIRES_HAVE([blkpr], [linux_pr_h], [linux/pr.h header]) | |
2200 | AM_CONDITIONAL([BUILD_BLKPR], [test "x$build_blkpr" = xyes]) | |
2201 | ||
205dbb7a KZ |
2202 | UL_BUILD_INIT([ldattach], [check]) |
2203 | UL_REQUIRES_LINUX([ldattach]) | |
2204 | AM_CONDITIONAL([BUILD_LDATTACH], [test "x$build_ldattach" = xyes]) | |
2205 | ||
2206 | UL_BUILD_INIT([rtcwake], [check]) | |
2207 | UL_REQUIRES_LINUX([rtcwake]) | |
2208 | AM_CONDITIONAL([BUILD_RTCWAKE], [test "x$build_rtcwake" = xyes]) | |
2209 | ||
2210 | UL_BUILD_INIT([setarch], [check]) | |
2211 | UL_REQUIRES_LINUX([setarch]) | |
2212 | AM_CONDITIONAL([BUILD_SETARCH], [test "x$build_setarch" = xyes]) | |
2213 | ||
d4b58873 KZ |
2214 | |
2215 | # build_scriptutils= is just configure-only variable to control | |
2216 | # script, scriptreplay and scriptlive | |
2217 | AC_ARG_ENABLE([scriptutils], | |
2218 | AS_HELP_STRING([--disable-scriptutils], [do not build script, scriptreplay and scriptlive]), | |
2219 | [], [UL_DEFAULT_ENABLE([scriptutils], [check])] | |
2220 | ) | |
2221 | ||
2222 | UL_ENABLE_ALIAS([script], [scriptutils]) | |
2223 | UL_BUILD_INIT([script]) | |
870235d0 | 2224 | UL_REQUIRES_HAVE([script], [pty], [openpty function (libutil)]) |
3f91b990 KZ |
2225 | AM_CONDITIONAL([BUILD_SCRIPT], [test "x$build_script" = xyes]) |
2226 | ||
d4b58873 KZ |
2227 | UL_ENABLE_ALIAS([scriptreplay], [scriptutils]) |
2228 | UL_BUILD_INIT([scriptreplay]) | |
3f91b990 KZ |
2229 | AM_CONDITIONAL([BUILD_SCRIPTREPLAY], [test "x$build_scriptreplay" = xyes]) |
2230 | ||
d4b58873 KZ |
2231 | UL_ENABLE_ALIAS([scriptlive], [scriptutils]) |
2232 | UL_BUILD_INIT([scriptlive]) | |
870235d0 | 2233 | UL_REQUIRES_HAVE([scriptlive], [pty], [openpty function (libutil)]) |
33869e5a KZ |
2234 | AM_CONDITIONAL([BUILD_SCRIPTLIVE], [test "x$build_scriptlive" = xyes]) |
2235 | ||
d4b58873 | 2236 | |
8886d84e TW |
2237 | UL_BUILD_INIT([col], [check]) |
2238 | UL_REQUIRES_COMPILE([col], [#include <limits.h>], [__GLIBC__], [building for glibc]) | |
cb45354e KZ |
2239 | AM_CONDITIONAL([BUILD_COL], [test "x$build_col" = xyes]) |
2240 | ||
2241 | UL_BUILD_INIT([colcrt], [yes]) | |
2242 | AM_CONDITIONAL([BUILD_COLCRT], [test "x$build_colcrt" = xyes]) | |
2243 | ||
2244 | UL_BUILD_INIT([colrm], [yes]) | |
2245 | AM_CONDITIONAL([BUILD_COLRM], [test "x$build_colrm" = xyes]) | |
2246 | ||
38d69192 KZ |
2247 | UL_BUILD_INIT([column], [check]) |
2248 | UL_REQUIRES_BUILD([column], [libsmartcols]) | |
cb45354e KZ |
2249 | AM_CONDITIONAL([BUILD_COLUMN], [test "x$build_column" = xyes]) |
2250 | ||
2251 | UL_BUILD_INIT([hexdump], [yes]) | |
2252 | AM_CONDITIONAL([BUILD_HEXDUMP], [test "x$build_hexdump" = xyes]) | |
2253 | ||
2254 | UL_BUILD_INIT([rev], [yes]) | |
2255 | AM_CONDITIONAL([BUILD_REV], [test "x$build_rev" = xyes]) | |
2256 | ||
3f91b990 | 2257 | |
1342ffcb SK |
2258 | AC_ARG_ENABLE([tunelp], |
2259 | AS_HELP_STRING([--enable-tunelp], [build tunelp]), | |
08b1c219 | 2260 | [], [UL_DEFAULT_ENABLE([tunelp], [no])] |
1342ffcb SK |
2261 | ) |
2262 | UL_BUILD_INIT([tunelp]) | |
2263 | UL_REQUIRES_LINUX([tunelp]) | |
034d378b | 2264 | AM_CONDITIONAL([BUILD_TUNELP], [test "x$build_tunelp" = xyes]) |
1342ffcb SK |
2265 | |
2266 | ||
48d7b13a | 2267 | AC_ARG_ENABLE([kill], |
4be753aa | 2268 | AS_HELP_STRING([--disable-kill], [do not build kill]), |
08b1c219 | 2269 | [], [UL_DEFAULT_ENABLE([kill], [check])] |
48d7b13a | 2270 | ) |
61a074f7 | 2271 | UL_BUILD_INIT([kill]) |
4be753aa | 2272 | UL_REQUIRES_LINUX([kill]) |
034d378b | 2273 | AM_CONDITIONAL([BUILD_KILL], [test "x$build_kill" = xyes]) |
48d7b13a | 2274 | |
ce602720 | 2275 | |
48d7b13a | 2276 | AC_ARG_ENABLE([last], |
ce602720 | 2277 | AS_HELP_STRING([--disable-last], [do not build last]), |
08b1c219 | 2278 | [], [UL_DEFAULT_ENABLE([last], [check])] |
48d7b13a | 2279 | ) |
61a074f7 | 2280 | UL_BUILD_INIT([last]) |
b4b919fe | 2281 | UL_REQUIRES_HAVE([last], [utmpx_h], [utmpx.h header]) |
73afd3f8 | 2282 | UL_REQUIRES_HAVE([last], [gnu_utmpx], [GNU utmpx functions]) |
034d378b | 2283 | AM_CONDITIONAL([BUILD_LAST], [test "x$build_last" = xyes]) |
2dc68529 | 2284 | |
48d7b13a | 2285 | |
78d5ceac | 2286 | AC_ARG_ENABLE([utmpdump], |
c9b53461 | 2287 | AS_HELP_STRING([--disable-utmpdump], [do not build utmpdump]), |
d00c10ed | 2288 | [], [UL_DEFAULT_ENABLE([utmpdump], [check])] |
78d5ceac KZ |
2289 | ) |
2290 | UL_BUILD_INIT([utmpdump]) | |
b4b919fe | 2291 | UL_REQUIRES_HAVE([utmpdump], [utmpx_h], [utmpx.h header]) |
73afd3f8 | 2292 | UL_REQUIRES_HAVE([utmpdump], [gnu_utmpx], [GNU utmpx functions]) |
034d378b | 2293 | AM_CONDITIONAL([BUILD_UTMPDUMP], [test "x$build_utmpdump" = xyes]) |
78d5ceac KZ |
2294 | |
2295 | ||
c135a8bd SK |
2296 | AC_ARG_ENABLE([line], |
2297 | AS_HELP_STRING([--enable-line], [build line]), | |
08b1c219 | 2298 | [], [UL_DEFAULT_ENABLE([line], [no])] |
c135a8bd | 2299 | ) |
61a074f7 | 2300 | UL_BUILD_INIT([line]) |
034d378b | 2301 | AM_CONDITIONAL([BUILD_LINE], [test "x$build_line" = xyes]) |
2dc68529 | 2302 | |
48d7b13a KZ |
2303 | |
2304 | AC_ARG_ENABLE([mesg], | |
5c0b406d | 2305 | AS_HELP_STRING([--disable-mesg], [do not build mesg]), |
08b1c219 | 2306 | [], [UL_DEFAULT_ENABLE([mesg], [yes])] |
48d7b13a | 2307 | ) |
61a074f7 | 2308 | UL_BUILD_INIT([mesg]) |
034d378b | 2309 | AM_CONDITIONAL([BUILD_MESG], [test "x$build_mesg" = xyes]) |
48d7b13a KZ |
2310 | |
2311 | ||
48d7b13a | 2312 | AC_ARG_ENABLE([raw], |
5c0b406d | 2313 | AS_HELP_STRING([--disable-raw], [do not build raw]), |
08b1c219 | 2314 | [], [UL_DEFAULT_ENABLE([raw], [check])] |
48d7b13a | 2315 | ) |
61a074f7 | 2316 | UL_BUILD_INIT([raw]) |
16ba8d58 KZ |
2317 | UL_REQUIRES_LINUX([raw]) |
2318 | UL_REQUIRES_HAVE([raw], [linux_raw_h], [raw.h header file]) | |
034d378b | 2319 | AM_CONDITIONAL([BUILD_RAW], [test "x$build_raw" = xyes]) |
48d7b13a KZ |
2320 | |
2321 | ||
48d7b13a | 2322 | AC_ARG_ENABLE([rename], |
7fa4f112 | 2323 | AS_HELP_STRING([--disable-rename], [do not build rename]), |
08b1c219 | 2324 | [], [UL_DEFAULT_ENABLE([rename], [yes])] |
48d7b13a | 2325 | ) |
61a074f7 | 2326 | UL_BUILD_INIT([rename]) |
034d378b | 2327 | AM_CONDITIONAL([BUILD_RENAME], [test "x$build_rename" = xyes]) |
48d7b13a KZ |
2328 | |
2329 | ||
cc76731e KZ |
2330 | AC_ARG_ENABLE([vipw], |
2331 | AS_HELP_STRING([--enable-vipw], [build vipw]), | |
08b1c219 | 2332 | [], [UL_DEFAULT_ENABLE([vipw], [no])] |
48d7b13a | 2333 | ) |
cc76731e | 2334 | UL_BUILD_INIT([vipw]) |
d00c10ed | 2335 | UL_REQUIRES_HAVE([vipw], [shadow_h], [shadow.h header]) |
034d378b | 2336 | AM_CONDITIONAL([BUILD_VIPW], [test "x$build_vipw" = xyes]) |
9cb68977 | 2337 | |
c94b3604 | 2338 | |
aec9ecbd KZ |
2339 | AC_ARG_ENABLE([newgrp], |
2340 | AS_HELP_STRING([--enable-newgrp], [build newgrp]), | |
08b1c219 | 2341 | [], [UL_DEFAULT_ENABLE([newgrp], [no])] |
aec9ecbd KZ |
2342 | ) |
2343 | UL_BUILD_INIT([newgrp]) | |
8229ed2f | 2344 | UL_REQUIRES_HAVE([newgrp], [crypt], [crypt function]) |
034d378b | 2345 | AM_CONDITIONAL([BUILD_NEWGRP], [test "x$build_newgrp" = xyes]) |
aec9ecbd KZ |
2346 | |
2347 | ||
d86918b6 | 2348 | AC_ARG_WITH([user], AS_HELP_STRING([--without-user], [compile without libuser (remote chsh)]), |
034d378b | 2349 | [], [with_user=check] |
7e4714f2 | 2350 | ) |
6e93c52f | 2351 | have_user=no |
3013eb9d | 2352 | AS_IF([test "x$with_user" != xno], [ |
2771954b | 2353 | PKG_CHECK_MODULES(LIBUSER,[libuser >= 0.58], [have_user=yes], [have_user=no]) |
9f57e6e8 SK |
2354 | AS_CASE([$with_user:$have_user], |
2355 | [yes:no], | |
2356 | [AC_MSG_ERROR([user selected but libuser not found])], | |
2357 | [*:yes], | |
2358 | [AC_DEFINE([HAVE_LIBUSER], [1], [Define if libuser is available])] | |
2359 | ) | |
1f6ec24c KZ |
2360 | # temporary solution, libuser has stupid .pc where are exported all |
2361 | # private dependencies to Requires: instead of Requires.private: | |
3013eb9d | 2362 | AS_IF([test "x$have_user" = xyes], [ |
1f6ec24c | 2363 | LIBUSER_LIBS=-luser |
3013eb9d SK |
2364 | ]) |
2365 | ]) | |
034d378b | 2366 | AM_CONDITIONAL([HAVE_USER], [test "x$have_user" = xyes]) |
7e4714f2 | 2367 | |
d86918b6 KZ |
2368 | AC_ARG_ENABLE([chfn-chsh-password], |
2369 | AS_HELP_STRING([--disable-chfn-chsh-password], [do not require the user to enter the password in chfn and chsh]), | |
034d378b | 2370 | [], [enable_chfn_chsh_password=yes] |
d86918b6 KZ |
2371 | ) |
2372 | ||
2373 | AC_ARG_ENABLE([chfn-chsh], | |
f205a073 | 2374 | AS_HELP_STRING([--disable-chfn-chsh], [do not build chfn and chsh]), |
9a4e9c9d | 2375 | [], [UL_DEFAULT_ENABLE([chfn_chsh], [check])] |
d86918b6 KZ |
2376 | ) |
2377 | UL_BUILD_INIT([chfn_chsh]) | |
d00c10ed | 2378 | UL_REQUIRES_HAVE([chfn_chsh], [shadow_h], [shadow.h header]) |
49a3d609 | 2379 | UL_REQUIRES_HAVE([chfn_chsh], [getusershell], [getusershell function]) |
d86918b6 | 2380 | |
948182f4 | 2381 | AS_IF([test "x$enable_chfn_chsh_password" = xyes || test "x$have_user" = xyes], [ |
fe2c9909 | 2382 | UL_REQUIRES_HAVE([chfn_chsh], [security_pam_appl_h], [PAM header file]) |
034d378b | 2383 | AC_DEFINE([CHFN_CHSH_PASSWORD], [1], [Should chfn and chsh require the user to enter the password?]) |
3013eb9d | 2384 | ]) |
034d378b SK |
2385 | AM_CONDITIONAL([BUILD_CHFN_CHSH], [test "x$build_chfn_chsh" = xyes]) |
2386 | AM_CONDITIONAL([CHFN_CHSH_PASSWORD], [test "x$enable_chfn_chsh_password" = xyes]) | |
d86918b6 KZ |
2387 | |
2388 | AC_ARG_ENABLE([chsh-only-listed], | |
5c0b406d BS |
2389 | AS_HELP_STRING([--disable-chsh-only-listed], [chsh: allow shells not in /etc/shells]), |
2390 | [], enable_chsh_only_listed=yes | |
d86918b6 | 2391 | ) |
7e4714f2 | 2392 | |
3013eb9d SK |
2393 | AS_IF([test "x$enable_chsh_only_listed" = xyes], [ |
2394 | AC_DEFINE([ONLY_LISTED_SHELLS], [1], [Should chsh allow only shells in /etc/shells?]) | |
2395 | ]) | |
71681ee5 | 2396 | |
2c8a3e16 | 2397 | |
e7614a07 KZ |
2398 | AC_ARG_ENABLE([login], |
2399 | AS_HELP_STRING([--disable-login], [do not build login]), | |
08b1c219 | 2400 | [], [UL_DEFAULT_ENABLE([login], [check])] |
e7614a07 KZ |
2401 | ) |
2402 | UL_BUILD_INIT([login]) | |
fe2c9909 WJ |
2403 | UL_REQUIRES_HAVE([login], [security_pam_appl_h], [PAM header file]) |
2404 | UL_REQUIRES_HAVE([login], [security_pam_misc_h, security_openpam_h], [PAM conversation functions]) | |
b4b919fe | 2405 | UL_REQUIRES_HAVE([login], [utmpx_h], [utmpx.h header]) |
73afd3f8 | 2406 | UL_REQUIRES_HAVE([login], [gnu_utmpx], [GNU utmpx functions]) |
034d378b | 2407 | AM_CONDITIONAL([BUILD_LOGIN], [test "x$build_login" = xyes]) |
e7614a07 | 2408 | |
71681ee5 KZ |
2409 | AC_ARG_ENABLE([login-chown-vcs], |
2410 | AS_HELP_STRING([--enable-login-chown-vcs], [let login chown /dev/vcsN]), | |
034d378b | 2411 | [], [enable_login_chown_vcs=no] |
71681ee5 KZ |
2412 | ) |
2413 | ||
3013eb9d | 2414 | AS_IF([test "x$enable_login_chown_vcs" = xyes], [ |
034d378b | 2415 | AC_DEFINE([LOGIN_CHOWN_VCS], [1], [Should login chown /dev/vcsN?]) |
3013eb9d | 2416 | ]) |
71681ee5 KZ |
2417 | |
2418 | AC_ARG_ENABLE([login-stat-mail], | |
2419 | AS_HELP_STRING([--enable-login-stat-mail], [let login stat() the mailbox]), | |
034d378b | 2420 | [], [enable_login_stat_mail=no] |
71681ee5 KZ |
2421 | ) |
2422 | ||
3013eb9d | 2423 | AS_IF([test "x$enable_login_stat_mail" = xyes], [ |
034d378b | 2424 | AC_DEFINE([LOGIN_STAT_MAIL], [1], [Should login stat() the mailbox?]) |
3013eb9d | 2425 | ]) |
71681ee5 | 2426 | |
e8b6e4ea SS |
2427 | AC_ARG_ENABLE([login-lastlog], |
2428 | AS_HELP_STRING([--enable-login-lastlog], [program login writes lastlog entries]), | |
2429 | [], [enable_login_lastlogin=no] | |
2430 | ) | |
2431 | ||
2432 | AS_IF([test "x$enable_login_lastlogin" != xno], [ | |
2433 | AC_DEFINE([USE_LOGIN_LASTLOG], | |
2434 | [1], | |
2435 | [Define if program login writes lastlog entries]) | |
2436 | ]) | |
e7614a07 | 2437 | |
88407b93 KZ |
2438 | AC_ARG_ENABLE([nologin], |
2439 | AS_HELP_STRING([--disable-nologin], [do not build nologin]), | |
08b1c219 | 2440 | [], [UL_DEFAULT_ENABLE([nologin], [yes])] |
88407b93 KZ |
2441 | ) |
2442 | UL_BUILD_INIT([nologin]) | |
2443 | AM_CONDITIONAL([BUILD_NOLOGIN], [test "x$build_nologin" = xyes]) | |
2444 | ||
2445 | ||
e7614a07 KZ |
2446 | AC_ARG_ENABLE([sulogin], |
2447 | AS_HELP_STRING([--disable-sulogin], [do not build sulogin]), | |
d00c10ed | 2448 | [], [UL_DEFAULT_ENABLE([sulogin], [check])] |
e7614a07 KZ |
2449 | ) |
2450 | UL_BUILD_INIT([sulogin]) | |
8229ed2f | 2451 | UL_REQUIRES_HAVE([sulogin], [crypt], [crypt function]) |
d00c10ed | 2452 | UL_REQUIRES_HAVE([sulogin], [shadow_h], [shadow.h header]) |
034d378b | 2453 | AM_CONDITIONAL([BUILD_SULOGIN], [test "x$build_sulogin" = xyes]) |
e7614a07 | 2454 | |
f17f5f48 | 2455 | |
ff4c5555 KZ |
2456 | AC_ARG_ENABLE([su], |
2457 | AS_HELP_STRING([--disable-su], [do not build su]), | |
08b1c219 | 2458 | [], [UL_DEFAULT_ENABLE([su], [check])] |
ff4c5555 KZ |
2459 | ) |
2460 | UL_BUILD_INIT([su]) | |
fe2c9909 | 2461 | UL_REQUIRES_HAVE([su], [security_pam_appl_h], [PAM header file]) |
b4b919fe | 2462 | UL_REQUIRES_HAVE([su], [utmpx_h], [utmpx.h header]) |
73afd3f8 | 2463 | UL_REQUIRES_HAVE([su], [gnu_utmpx], [GNU utmpx functions]) |
034d378b | 2464 | AM_CONDITIONAL([BUILD_SU], [test "x$build_su" = xyes]) |
ff4c5555 KZ |
2465 | |
2466 | ||
7ec6adb1 KZ |
2467 | AC_ARG_ENABLE([runuser], |
2468 | AS_HELP_STRING([--disable-runuser], [do not build runuser]), | |
08b1c219 | 2469 | [], [UL_DEFAULT_ENABLE([runuser], [check])] |
7ec6adb1 KZ |
2470 | ) |
2471 | UL_BUILD_INIT([runuser]) | |
fe2c9909 | 2472 | UL_REQUIRES_HAVE([runuser], [security_pam_appl_h], [PAM header file]) |
b4b919fe | 2473 | UL_REQUIRES_HAVE([runuser], [utmpx_h], [utmpx.h header]) |
73afd3f8 | 2474 | UL_REQUIRES_HAVE([runuser], [gnu_utmpx], [GNU utmpx functions]) |
034d378b | 2475 | AM_CONDITIONAL([BUILD_RUNUSER], [test "x$build_runuser" = xyes]) |
7ec6adb1 KZ |
2476 | |
2477 | ||
53b22add KZ |
2478 | AC_ARG_ENABLE([ul], |
2479 | AS_HELP_STRING([--disable-ul], [do not build ul]), | |
08b1c219 | 2480 | [], [UL_DEFAULT_ENABLE([ul], [check])] |
53b22add KZ |
2481 | ) |
2482 | UL_BUILD_INIT([ul]) | |
3cc8a9f4 | 2483 | UL_REQUIRES_HAVE([ul], [ncursesw, ncurses], [ncursesw or ncurses libraries]) |
034d378b | 2484 | AM_CONDITIONAL([BUILD_UL], [test "x$build_ul" = xyes]) |
53b22add KZ |
2485 | |
2486 | ||
2487 | AC_ARG_ENABLE([more], | |
2488 | AS_HELP_STRING([--disable-more], [do not build more]), | |
08b1c219 | 2489 | [], [UL_DEFAULT_ENABLE([more], [check])] |
53b22add KZ |
2490 | ) |
2491 | UL_BUILD_INIT([more]) | |
3cc8a9f4 | 2492 | UL_REQUIRES_HAVE([more], [ncursesw, ncurses], [ncursesw or ncurses libraries]) |
823ef319 | 2493 | UL_REQUIRES_LINUX([more]) |
034d378b | 2494 | AM_CONDITIONAL([BUILD_MORE], [test "x$build_more" = xyes]) |
53b22add KZ |
2495 | |
2496 | ||
2497 | AC_ARG_ENABLE([pg], | |
00971cca SK |
2498 | AS_HELP_STRING([--enable-pg], [build pg]), |
2499 | [], [UL_DEFAULT_ENABLE([pg], [no])] | |
53b22add KZ |
2500 | ) |
2501 | UL_BUILD_INIT([pg]) | |
4b439e2d | 2502 | UL_REQUIRES_HAVE([pg], [ncursesw, ncurses], [ncursesw or ncurses library]) |
034d378b | 2503 | AM_CONDITIONAL([BUILD_PG], [test "x$build_pg" = xyes]) |
53b22add KZ |
2504 | |
2505 | ||
d78d0409 KZ |
2506 | AC_ARG_ENABLE([setterm], |
2507 | AS_HELP_STRING([--disable-setterm], [do not build setterm]), | |
08b1c219 | 2508 | [], [UL_DEFAULT_ENABLE([setterm], [check])] |
d78d0409 KZ |
2509 | ) |
2510 | UL_BUILD_INIT([setterm]) | |
2511 | UL_REQUIRES_LINUX([setterm]) | |
4b439e2d | 2512 | UL_REQUIRES_HAVE([setterm], [ncursesw, ncurses], [ncursesw or ncurses library]) |
034d378b | 2513 | AM_CONDITIONAL([BUILD_SETTERM], [test "x$build_setterm" = xyes]) |
d78d0409 | 2514 | |
d6ace0b8 KZ |
2515 | # build_schedutils= is just configure-only variable to control |
2516 | # ionice, taskset and chrt | |
48d7b13a | 2517 | AC_ARG_ENABLE([schedutils], |
34228e69 | 2518 | AS_HELP_STRING([--disable-schedutils], [do not build chrt, ionice, taskset]), |
fc72f51e | 2519 | [], [UL_DEFAULT_ENABLE([schedutils], [check])] |
48d7b13a | 2520 | ) |
17d5e11b | 2521 | |
6f2eb034 KZ |
2522 | |
2523 | UL_ENABLE_ALIAS([ionice], [schedutils]) | |
2524 | UL_BUILD_INIT([ionice]) | |
17d5e11b KZ |
2525 | UL_REQUIRES_SYSCALL_CHECK([ionice], |
2526 | [UL_CHECK_SYSCALL([ioprio_set], | |
f06b4328 SK |
2527 | [alpha], [442], |
2528 | [i*86], [289], | |
2529 | [ia64*], [1274], | |
2530 | [powerpc*], [273], | |
2531 | [s390*], [282], | |
2532 | [sparc*], [196], | |
2533 | [sh*], [288], | |
2534 | [x86_64*], [251])], | |
17d5e11b KZ |
2535 | [ioprio_set]) |
2536 | ||
2537 | UL_REQUIRES_SYSCALL_CHECK([ionice], | |
2538 | [UL_CHECK_SYSCALL([ioprio_get], | |
f06b4328 SK |
2539 | [alpha], [443], |
2540 | [i*86], [290], | |
2541 | [ia64*], [1275], | |
2542 | [powerpc*], [274], | |
2543 | [s390*], [283], | |
2544 | [sparc*], [218], | |
2545 | [sh*], [289], | |
2546 | [x86_64*], [252])], | |
17d5e11b KZ |
2547 | [ioprio_get]) |
2548 | ||
034d378b | 2549 | AM_CONDITIONAL([BUILD_IONICE], [test "x$build_ionice" = xyes]) |
17d5e11b | 2550 | |
6f2eb034 KZ |
2551 | |
2552 | UL_ENABLE_ALIAS([taskset], [schedutils]) | |
2553 | UL_BUILD_INIT([taskset]) | |
e21e6d26 | 2554 | UL_REQUIRES_HAVE([taskset], [cpu_set_t], [cpu_set_t type]) |
17d5e11b KZ |
2555 | UL_REQUIRES_SYSCALL_CHECK([taskset], |
2556 | [UL_CHECK_SYSCALL([sched_getaffinity])], | |
2557 | [sched_getaffinity]) | |
034d378b | 2558 | AM_CONDITIONAL([BUILD_TASKSET], [test "x$build_taskset" = xyes]) |
48d7b13a | 2559 | |
ee20c303 RM |
2560 | |
2561 | have_schedsetter=no | |
2562 | AS_IF([test "x$ac_cv_func_sched_setscheduler" = xyes], [have_schedsetter=yes], | |
2563 | [test "x$ac_cv_func_sched_setattr" = xyes], [have_schedsetter=yes]) | |
2564 | ||
6f2eb034 KZ |
2565 | UL_ENABLE_ALIAS([chrt], [schedutils]) |
2566 | UL_BUILD_INIT([chrt]) | |
ee20c303 | 2567 | UL_REQUIRES_HAVE([chrt], [schedsetter], [sched_set functions]) |
d6ace0b8 KZ |
2568 | AM_CONDITIONAL([BUILD_CHRT], [test "x$build_chrt" = xyes]) |
2569 | ||
15167589 KZ |
2570 | AS_IF([test "x$build_chrt" = xyes], [ |
2571 | UL_CHECK_SYSCALL([sched_setattr]) | |
2572 | ]) | |
2573 | ||
f59654bb QY |
2574 | UL_ENABLE_ALIAS([uclampset], [schedutils]) |
2575 | UL_BUILD_INIT([uclampset]) | |
82643a9b KZ |
2576 | UL_REQUIRES_SYSCALL_CHECK([uclampset], |
2577 | [UL_CHECK_SYSCALL([sched_setattr])], [sched_setattr]) | |
f59654bb QY |
2578 | AM_CONDITIONAL([BUILD_UCLAMPSET], [test "x$build_uclampset" = xyes]) |
2579 | ||
48d7b13a KZ |
2580 | |
2581 | AC_ARG_ENABLE([wall], | |
7fa4f112 | 2582 | AS_HELP_STRING([--disable-wall], [do not build wall]), |
d00c10ed | 2583 | [], [UL_DEFAULT_ENABLE([wall], [check])] |
48d7b13a | 2584 | ) |
8fc8888b | 2585 | UL_BUILD_INIT([wall]) |
b4b919fe | 2586 | UL_REQUIRES_HAVE([wall], [utmpx_h], [utmpx.h header]) |
034d378b | 2587 | AM_CONDITIONAL([BUILD_WALL], [test "x$build_wall" = xyes]) |
48d7b13a KZ |
2588 | |
2589 | ||
2590 | AC_ARG_ENABLE([write], | |
7fa4f112 | 2591 | AS_HELP_STRING([--enable-write], [build write]), |
08b1c219 | 2592 | [], [UL_DEFAULT_ENABLE([write], [no])] |
48d7b13a | 2593 | ) |
61a074f7 | 2594 | UL_BUILD_INIT([write]) |
b4b919fe | 2595 | UL_REQUIRES_HAVE([write], [utmpx_h], [utmpx.h header]) |
73afd3f8 | 2596 | UL_REQUIRES_HAVE([write], [gnu_utmpx], [GNU utmpx functions]) |
034d378b | 2597 | AM_CONDITIONAL([BUILD_WRITE], [test "x$build_write" = xyes]) |
48d7b13a KZ |
2598 | |
2599 | ||
5a971329 | 2600 | AC_ARG_WITH([btrfs], |
95a89bd3 | 2601 | AS_HELP_STRING([--without-btrfs], [do not build with btrfs support]), |
5a971329 KZ |
2602 | [], [with_btrfs=check] |
2603 | ) | |
2604 | have_btrfs=no | |
2605 | AS_IF([test "x$with_btrfs" != xno], [ | |
2606 | AS_CASE([$with_btrfs:$have_linux_btrfs_h], | |
2607 | [yes:no], | |
2608 | [AC_MSG_ERROR([btrfs selected but linux/btrfs.h not found])], | |
2609 | [check:no], | |
2610 | [AC_MSG_WARN([linux/btrfs.h not found, do not build with btrfs support])], | |
2611 | [*:yes], | |
2612 | [have_btrfs=yes | |
2613 | AC_DEFINE([HAVE_BTRFS_SUPPORT], [1], [Define if btrfs stuff is available])] | |
2614 | ) | |
2615 | ]) | |
2616 | AM_CONDITIONAL([HAVE_BTRFS], [test "x$have_btrfs" = xyes]) | |
2617 | ||
2618 | ||
ebff016a | 2619 | AC_ARG_WITH([systemd], |
95a89bd3 | 2620 | AS_HELP_STRING([--without-systemd], [do not build with systemd support]), |
ebff016a KZ |
2621 | [], [with_systemd=check] |
2622 | ) | |
2623 | ||
2624 | have_systemd=no | |
2625 | AS_IF([test "x$with_systemd" != xno], [ | |
2626 | # new version -- all libsystemd-* libs merged into libsystemd | |
2627 | PKG_CHECK_MODULES([SYSTEMD], [libsystemd], [have_systemd=yes], [have_systemd=no]) | |
2628 | # old versions | |
2629 | AS_IF([test "x$have_systemd" != "xyes"], [ | |
2630 | PKG_CHECK_MODULES([SYSTEMD_DAEMON], [libsystemd-daemon], | |
2631 | [have_systemd_daemon=yes], [have_systemd_daemon=no]) | |
2632 | PKG_CHECK_MODULES([SYSTEMD_JOURNAL], [libsystemd-journal], | |
2633 | [have_systemd_journal=yes], [have_systemd_journal=no]) | |
948182f4 | 2634 | AS_IF([test "x$have_systemd_daemon" = "xyes" && test "x$have_systemd_journal" = "xyes" ],[ |
ebff016a | 2635 | have_systemd=yes]) |
ea45d34c | 2636 | ]) |
ebff016a KZ |
2637 | AS_CASE([$with_systemd:$have_systemd], |
2638 | [yes:no], | |
2639 | [AC_MSG_ERROR([systemd expected but libsystemd not found])], | |
2640 | [*:yes], | |
2641 | AC_DEFINE([HAVE_LIBSYSTEMD], [1], [Define if libsystemd is available]) | |
b66b5b97 | 2642 | AC_DEFINE([USE_SYSTEMD], [1], [Define if systemd support is wanted ]) |
87fcd95a | 2643 | AC_CHECK_DECLS([sd_session_get_username], [], [], [#include <systemd/sd-login.h>]) |
ebff016a | 2644 | ) |
3013eb9d | 2645 | ]) |
ebff016a KZ |
2646 | AM_CONDITIONAL([HAVE_SYSTEMD], [test "x$have_systemd" = xyes]) |
2647 | ||
bbe289c4 | 2648 | |
1b68c379 | 2649 | AC_ARG_WITH([systemdsystemunitdir], |
95a89bd3 | 2650 | AS_HELP_STRING([--with-systemdsystemunitdir=DIR], [directory for systemd unit files (requires systemd support)]), |
f6d3f34a | 2651 | [], [ |
7a95313c | 2652 | AS_IF([test "x$have_systemd" = xyes], [ |
f6d3f34a KZ |
2653 | PKG_CHECK_VAR([with_systemdsystemunitdir], [systemd], [systemdsystemunitdir], |
2654 | [], | |
2655 | [with_systemdsystemunitdir=no]) | |
7a95313c KZ |
2656 | ]) |
2657 | ]) | |
3013eb9d | 2658 | AS_IF([test "x$with_systemdsystemunitdir" != "xno"], [ |
1b68c379 | 2659 | AC_SUBST([systemdsystemunitdir], [$with_systemdsystemunitdir]) |
3013eb9d | 2660 | ]) |
1b68c379 | 2661 | |
c2e299d0 SS |
2662 | AC_ARG_WITH([tmpfilesdir], |
2663 | AS_HELP_STRING([--with-tmpfilesdir=DIR], [directory for tmpfiles. See tmpfiles.d(5) for details]), | |
2664 | [], [ | |
2665 | AS_IF([test "x$have_systemd" = xyes], [ | |
2666 | PKG_CHECK_VAR([with_tmpfilesdir], [systemd], [tmpfilesdir], | |
2667 | [], | |
2668 | [with_tmpfilesdir=no]) | |
2669 | ]) | |
2670 | ]) | |
2671 | AS_IF([test "x$with_tmpfilesdir" != "xno"], [ | |
2672 | AC_SUBST([tmpfilesdir], [$with_tmpfilesdir]) | |
2673 | ]) | |
bbe289c4 | 2674 | |
b8095d25 KZ |
2675 | AC_ARG_WITH([smack], |
2676 | AS_HELP_STRING([--with-smack], [build with SMACK support]), | |
2677 | [], [with_smack=no] | |
2678 | ) | |
2679 | AS_IF([test "x$with_smack" = xyes], [ | |
2680 | AC_DEFINE([HAVE_SMACK], [1], [Add SMACK support]) | |
2681 | ]) | |
2682 | ||
9e584ff3 TK |
2683 | AC_ARG_WITH([econf], |
2684 | AS_HELP_STRING([--without-econf], [do not use libeconf]), | |
2685 | [], [with_econf=check] | |
2686 | ) | |
2687 | ||
2688 | have_econf=no | |
2689 | AS_IF([test "x$with_econf" != xno], [ | |
9e584ff3 TK |
2690 | PKG_CHECK_MODULES([ECONF], [libeconf], [have_econf=yes], [have_econf=no]) |
2691 | AS_CASE([$with_econf:$have_econf], | |
2692 | [yes:no], | |
2693 | [AC_MSG_ERROR([libeconf expected but libeconf not found])], | |
2694 | [*:yes], | |
2695 | AC_DEFINE([HAVE_LIBECONF], [1], [Define if libeconf is available]) | |
2696 | ) | |
2697 | ]) | |
2698 | AM_CONDITIONAL([HAVE_ECONF], [test "x$have_econf" = xyes]) | |
2699 | ||
fee99106 | 2700 | AC_ARG_WITH([vendordir], |
cb776288 | 2701 | AS_HELP_STRING([--with-vendordir=DIR], [Directory for distribution provided configuration files]), |
fee99106 | 2702 | [], [] |
9e584ff3 | 2703 | ) |
fee99106 KZ |
2704 | AC_SUBST([vendordir], [$with_vendordir]) |
2705 | AM_CONDITIONAL([USE_VENDORDIR], [test "x$with_vendordir" != x]) | |
2706 | AS_IF([test "x$with_vendordir" != x], [ | |
2707 | AC_DEFINE([USE_VENDORDIR], [1], [Define to 1 to use vendordir]) | |
2708 | ]) | |
9e584ff3 | 2709 | |
b8095d25 | 2710 | |
ece777e9 KZ |
2711 | AC_ARG_ENABLE([bash-completion], |
2712 | AS_HELP_STRING([--disable-bash-completion], [do not install bash completion files]), | |
034d378b | 2713 | [], [enable_bash_completion=yes] |
ece777e9 KZ |
2714 | ) |
2715 | ||
034d378b | 2716 | AM_CONDITIONAL([BUILD_BASH_COMPLETION], [test "x$enable_bash_completion" = xyes]) |
ece777e9 | 2717 | |
f6d3f34a KZ |
2718 | AC_ARG_WITH([bashcompletiondir], |
2719 | AS_HELP_STRING([--with-bashcompletiondir=DIR], [Bash completions directory]), | |
2720 | [], [ | |
2721 | AS_IF([test "x$enable_bash_completion" = xyes], [ | |
2722 | PKG_CHECK_VAR([with_bashcompletiondir], [bash-completion], [completionsdir], | |
2723 | [], | |
2724 | [with_bashcompletiondir=${datadir}/bash-completion/completions]) | |
2725 | ]) | |
2726 | ]) | |
140e4c7b KZ |
2727 | AS_IF([test "x$enable_bash_completion" = xyes], [ |
2728 | AC_SUBST([bashcompletiondir], [$with_bashcompletiondir]) | |
2729 | ]) | |
f6d3f34a | 2730 | |
9cc36e9f | 2731 | |
d78df0ac | 2732 | AC_ARG_WITH([python], |
4c54effb KZ |
2733 | AS_HELP_STRING([--without-python], [do not build python bindings, use --with-python={2,3} to force version]), |
2734 | [], [with_python=check withval=check] | |
d78df0ac | 2735 | ) |
8e5c4675 | 2736 | |
d78df0ac | 2737 | have_python=no |
b2ae8c57 | 2738 | have_libpython=no |
8e5c4675 KZ |
2739 | AS_IF([test "x$with_python" != xno], [ |
2740 | # We follow distributions default and look for PKG module name "python" | |
2741 | # (minimal version is 2) but if major version is explicitly specified by | |
2742 | # --with-python=2 or --with-python=3 then we look for PKG module "python2" or | |
2743 | # "python3". | |
948182f4 | 2744 | AS_IF([test "x$withval" != xno && test "x$withval" != xyes && test "x$withval" != xcheck], |
0b567ae5 | 2745 | [pymajor="$withval"; PYTHON=python${pymajor}], [pymajor="2"]) |
b2ae8c57 KZ |
2746 | |
2747 | # check for python interpreter | |
0b567ae5 | 2748 | AM_PATH_PYTHON([$pymajor], [have_python=yes], [have_python=no]) |
8e5c4675 KZ |
2749 | AS_CASE([$with_python:$have_python], |
2750 | [yes:no], | |
b2ae8c57 | 2751 | [AC_MSG_ERROR([python selected but python interpreter not found])], |
4c54effb | 2752 | [check:no], |
b2ae8c57 | 2753 | [AC_MSG_WARN([python interpreter not found, do not build python bindings])], |
4c54effb | 2754 | [*:yes], |
b2ae8c57 | 2755 | # check for python development stuff |
c6cdefd7 TW |
2756 | [ |
2757 | PKG_CHECK_MODULES([PYTHON], [python-$PYTHON_VERSION], [have_libpython=yes], [have_libpython=no]) | |
2758 | ||
2759 | # https://github.com/util-linux/util-linux/issues/2366 | |
2760 | AX_COMPARE_VERSION([$PYTHON_VERSION], [ge], [3.12], [ | |
2761 | UL_WARN_ADD([-Wno-error=redundant-decls], [PYTHON_CFLAGS]) | |
2762 | ]) | |
2763 | ] | |
8e5c4675 | 2764 | ) |
d78df0ac KZ |
2765 | ]) |
2766 | ||
da0ec90b KZ |
2767 | |
2768 | AC_ARG_ENABLE([pylibmount], | |
2769 | AS_HELP_STRING([--disable-pylibmount], [do not build pylibmount]), | |
2770 | [], [UL_DEFAULT_ENABLE([pylibmount], [check])] | |
2771 | ) | |
2772 | UL_BUILD_INIT([pylibmount]) | |
b2ae8c57 | 2773 | UL_REQUIRES_HAVE([pylibmount], [libpython], [libpython]) |
da0ec90b | 2774 | UL_REQUIRES_BUILD([pylibmount], [libmount]) |
d78df0ac KZ |
2775 | AM_CONDITIONAL([BUILD_PYLIBMOUNT], [test "x$build_pylibmount" = "xyes"]) |
2776 | ||
324330ac FB |
2777 | # We need to introduce a verbatim dependency into the Makefile, without automake |
2778 | # trying to interpret it, so push it as a AM_SUBST_NOTMAKE variable. | |
2779 | verbatim_pylibmount_dependency=' | |
2780 | ||
2781 | # pylibmountexec module must be installed after usrlib_exec libraries, | |
2782 | # otherwise the libtool relink step will fail to find libmount.la and | |
2783 | # will try -lmount which is possibly not available. | |
2784 | install-pylibmountexecLTLIBRARIES: install-usrlib_execLTLIBRARIES | |
2785 | ||
2786 | ' | |
2787 | AC_SUBST([verbatim_pylibmount_dependency]) | |
2788 | AM_SUBST_NOTMAKE([verbatim_pylibmount_dependency]) | |
d78df0ac | 2789 | |
48d7b13a | 2790 | AC_ARG_ENABLE([pg-bell], |
7fa4f112 | 2791 | AS_HELP_STRING([--disable-pg-bell], [let pg not ring the bell on invalid keys]), |
034d378b | 2792 | [], [enable_pg_bell=yes] |
48d7b13a KZ |
2793 | ) |
2794 | ||
3013eb9d | 2795 | AS_IF([test "x$enable_pg_bell" = xyes], [ |
034d378b | 2796 | AC_DEFINE([PG_BELL], [1], [Should pg ring the bell on invalid keys?]) |
3013eb9d | 2797 | ]) |
48d7b13a KZ |
2798 | |
2799 | ||
bb4cb69d MF |
2800 | AC_DEFUN([FS_PATHS_DEFAULT], [/sbin:/sbin/fs.d:/sbin/fs]) |
2801 | AC_ARG_ENABLE([fs-paths-default], | |
2802 | AS_HELP_STRING([--enable-fs-paths-default=paths], [default search path for fs helpers @<:@FS_PATHS_DEFAULT@:>@]), | |
9f57e6e8 SK |
2803 | [AS_CASE([$enableval], |
2804 | [yes], [fs_paths_defaults="FS_PATHS_DEFAULT"], | |
2805 | [no], [fs_paths_defaults=""], | |
2806 | [fs_paths_defaults="$enableval"] | |
2807 | )], | |
bb4cb69d MF |
2808 | [fs_paths_defaults="FS_PATHS_DEFAULT"] |
2809 | ) | |
2810 | AC_ARG_ENABLE([fs-paths-extra], | |
2811 | AS_HELP_STRING([--enable-fs-paths-extra=paths], [additional search paths for fs helpers]), | |
9f57e6e8 SK |
2812 | [AS_CASE([$enableval], |
2813 | [yes|no], [fs_paths_extra=""], | |
2814 | [fs_paths_extra="$enableval"] | |
2815 | )], | |
bb4cb69d MF |
2816 | [fs_paths_extra=""] |
2817 | ) | |
2818 | fs_paths="$fs_paths_defaults" | |
3013eb9d SK |
2819 | AS_IF([test "x$fs_paths_extra" != "x"], [ |
2820 | AS_IF([test "x$fs_paths" != "x"], [ | |
bb4cb69d | 2821 | fs_paths="${fs_paths}:" |
3013eb9d | 2822 | ]) |
bb4cb69d | 2823 | fs_paths="${fs_paths}${fs_paths_extra}" |
3013eb9d | 2824 | ]) |
bb4cb69d MF |
2825 | AC_DEFINE_UNQUOTED([FS_SEARCH_PATH], "$fs_paths", [search path for fs helpers]) |
2826 | ||
2827 | ||
48d7b13a | 2828 | AC_ARG_ENABLE([use-tty-group], |
7fa4f112 | 2829 | AS_HELP_STRING([--disable-use-tty-group], [do not install wall and write setgid tty]), |
034d378b | 2830 | [], [enable_use_tty_group=yes] |
48d7b13a | 2831 | ) |
034d378b | 2832 | AM_CONDITIONAL([USE_TTY_GROUP], [test "x$enable_use_tty_group" = xyes]) |
48d7b13a | 2833 | |
3013eb9d | 2834 | AS_IF([test "x$enable_use_tty_group" = xyes], [ |
034d378b | 2835 | AC_DEFINE([USE_TTY_GROUP], [1], [Should wall and write be installed setgid tty?]) |
3013eb9d | 2836 | ]) |
48d7b13a | 2837 | |
ab6478ef WF |
2838 | |
2839 | AC_ARG_ENABLE([sulogin-emergency-mount], | |
479d50bd DR |
2840 | AS_HELP_STRING([--enable-sulogin-emergency-mount], |
2841 | [use emergency mount of /dev and /proc for sulogin]), | |
034d378b | 2842 | [], [enable_sulogin_emergency_mount=no] |
ab6478ef WF |
2843 | ) |
2844 | ||
3013eb9d | 2845 | AS_IF([test "x$enable_sulogin_emergency_mount" = xyes], [ |
89c7c6ea KZ |
2846 | AS_IF([test "x$linux_os" = xyes], [ ], |
2847 | [AC_MSG_ERROR([--enable-sulogin-emergency-mount selected for non-linux system])]) | |
034d378b | 2848 | AC_DEFINE([USE_SULOGIN_EMERGENCY_MOUNT], [1], |
3c560686 | 2849 | [Should sulogin use an emergency mount of /dev and /proc?]) |
3013eb9d | 2850 | ]) |
ab6478ef WF |
2851 | |
2852 | ||
f71d1104 KZ |
2853 | AC_ARG_ENABLE([usrdir-path], |
2854 | AS_HELP_STRING([--enable-usrdir-path], [use only /usr paths in PATH env. variable (recommended on systems with /bin -> /usr/bin symlinks)]), | |
2855 | [], [enable_usrdir_path=no] | |
2856 | ) | |
2857 | ||
2afbcec5 | 2858 | AS_IF([test "x$enable_usrdir_path" = xyes], [ |
f71d1104 KZ |
2859 | AC_DEFINE([USE_USRDIR_PATHS_ONLY], [1], [Define to 1 to remove /bin and /sbin from PATH env.variable]) |
2860 | ]) | |
2861 | ||
2862 | ||
f3831bbd KZ |
2863 | AC_ARG_ENABLE([makeinstall-chown], |
2864 | AS_HELP_STRING([--disable-makeinstall-chown], [do not do chown-like operations during "make install"]), | |
034d378b | 2865 | [], [enable_makeinstall_chown=yes] |
f3831bbd | 2866 | ) |
034d378b | 2867 | AM_CONDITIONAL([MAKEINSTALL_DO_CHOWN], [test "x$enable_makeinstall_chown" = xyes]) |
f3831bbd | 2868 | |
81f55ab9 | 2869 | |
4c24a7ae KZ |
2870 | AC_ARG_ENABLE([makeinstall-setuid], |
2871 | AS_HELP_STRING([--disable-makeinstall-setuid], [do not do setuid chmod operations during "make install"]), | |
034d378b | 2872 | [], [enable_makeinstall_setuid=yes] |
4c24a7ae | 2873 | ) |
034d378b | 2874 | AM_CONDITIONAL([MAKEINSTALL_DO_SETUID], [test "x$enable_makeinstall_setuid" = xyes]) |
4c24a7ae | 2875 | |
06bcee19 | 2876 | |
81f55ab9 KZ |
2877 | AC_ARG_ENABLE([colors-default], |
2878 | AS_HELP_STRING([--disable-colors-default], [do not colorize output from utils by default]), | |
2879 | [], [enable_colors_default=yes] | |
2880 | ) | |
2881 | AS_IF([test "x$enable_colors_default" = xyes], [ | |
2882 | AC_DEFINE([USE_COLORS_BY_DEFAULT], [1], [Enables colorized output from utils by default]) | |
2883 | ]) | |
2884 | ||
2885 | ||
e6a49887 LB |
2886 | AC_ARG_WITH([cryptsetup], |
2887 | AS_HELP_STRING([--with-cryptsetup], [compile with cryptsetup support]), | |
2888 | [], [with_cryptsetup=no] | |
2889 | ) | |
2890 | ||
2891 | AS_IF([test "x$with_cryptsetup" = xno], [ | |
2892 | AM_CONDITIONAL([HAVE_CRYPTSETUP], [false]) | |
488fd4c3 | 2893 | AM_CONDITIONAL([CRYPTSETUP_VIA_DLOPEN], [false]) |
e6a49887 LB |
2894 | ], [ |
2895 | PKG_CHECK_MODULES([CRYPTSETUP], [libcryptsetup], | |
2896 | [AC_DEFINE([HAVE_CRYPTSETUP], [1], [Define if cryptsetup is available]) | |
2897 | UL_PKG_STATIC([CRYPTSETUP_LIBS_STATIC], [libcryptsetup]) | |
2898 | AM_CONDITIONAL([HAVE_CRYPTSETUP], [true]) | |
123b1a67 LB |
2899 | SAVE_CFLAGS="$CFLAGS" |
2900 | CFLAGS="$CRYPTSETUP_CFLAGS $CFLAGS" | |
2901 | SAVE_LIBS="$LIBS" | |
2902 | LIBS="$CRYPTSETUP_LIBS $LIBS" | |
2903 | AC_CHECK_LIB([cryptsetup], [crypt_activate_by_signed_key], [ | |
f2458cf9 | 2904 | AC_DEFINE([HAVE_CRYPT_ACTIVATE_BY_SIGNED_KEY], [1], [Define if crypt_activate_by_signed_key exist in -lcryptsetup]) |
123b1a67 | 2905 | ]) |
488fd4c3 LB |
2906 | AS_IF([test "x$with_cryptsetup" = xdlopen], [ |
2907 | LIBS="-ldl $LIBS" | |
2908 | AC_CHECK_LIB([dl], [dlsym], [ | |
2909 | AC_DEFINE([CRYPTSETUP_VIA_DLOPEN], [1], [Define if cryptsetup is to be loaded via dlopen]) | |
2910 | AM_CONDITIONAL([CRYPTSETUP_VIA_DLOPEN], [true]) | |
2911 | ], [AC_MSG_ERROR([libdl required to build with cryptsetup support])]) | |
2912 | ], [ | |
2913 | AM_CONDITIONAL([CRYPTSETUP_VIA_DLOPEN], [false]) | |
2914 | ]) | |
123b1a67 LB |
2915 | CFLAGS="$SAVE_CFLAGS" |
2916 | LIBS="$SAVE_LIBS" | |
e6a49887 LB |
2917 | have_cryptsetup=yes], |
2918 | [have_cryptsetup=no | |
488fd4c3 LB |
2919 | AM_CONDITIONAL([HAVE_CRYPTSETUP], [false]) |
2920 | AM_CONDITIONAL([CRYPTSETUP_VIA_DLOPEN], [false]) | |
2921 | ]) | |
e6a49887 LB |
2922 | |
2923 | AS_CASE([$with_cryptsetup:$have_cryptsetup], | |
2924 | [yes:no], [AC_MSG_WARN([cryptsetup selected but libcryptsetup not found])] | |
2925 | ) | |
2926 | ]) | |
2927 | AC_SUBST([CRYPTSETUP_LIBS]) | |
2928 | AC_SUBST([CRYPTSETUP_LIBS_STATIC]) | |
2929 | ||
2930 | ||
1f10890f SK |
2931 | AC_ARG_VAR([SUID_CFLAGS], |
2932 | [CFLAGS used for binaries which are usually with the suid bit]) | |
2933 | AC_ARG_VAR([SUID_LDFLAGS], | |
2934 | [LDFLAGS used for binaries which are usually with the suid bit]) | |
06bcee19 | 2935 | |
03d00d49 KZ |
2936 | AC_ARG_VAR([DAEMON_CFLAGS], |
2937 | [CFLAGS used for binaries which are usually executed as daemons]) | |
2938 | AC_ARG_VAR([DAEMON_LDFLAGS], | |
2939 | [LDFLAGS used for binaries which are usually executed as daemons]) | |
2940 | ||
2941 | AC_ARG_VAR([SOLIB_CFLAGS], | |
2942 | [CFLAGS used for shared libraries]) | |
2943 | AC_ARG_VAR([SOLIB_LDFLAGS], | |
2944 | [LDFLAGS used for shared libraries]) | |
2945 | ||
2ad21963 KZ |
2946 | AC_ARG_VAR([ADJTIME_PATH], |
2947 | [Path to hwclock adjtime file, default /etc/adjtime]) | |
2948 | AS_IF([test "x$ADJTIME_PATH" = x], [ADJTIME_PATH="/etc/adjtime"]) | |
2949 | AC_DEFINE_UNQUOTED([CONFIG_ADJTIME_PATH], "$ADJTIME_PATH", [Path to hwclock adjtime file]) | |
2950 | ||
0cc63f0b TW |
2951 | if test "x${build_alias}" != "x${host_alias}"; then |
2952 | AC_MSG_NOTICE([setting link_all_deplibs=unknown for libtool]) | |
2953 | # work around Debian patch to libtool breaking cross-compiles | |
2954 | # https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=702737 | |
2955 | # https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=297726 | |
2956 | link_all_deplibs=unknown | |
2957 | fi | |
2958 | ||
2ad21963 | 2959 | |
9cb68977 | 2960 | LIBS="" |
48d7b13a | 2961 | |
48d7b13a | 2962 | |
034d378b | 2963 | AC_CONFIG_HEADERS([config.h]) |
48d7b13a | 2964 | |
d4baf92e KZ |
2965 | # |
2966 | # Don't use configure.ac to replace install paths! See Makefile PATHFILES for | |
2967 | # more details. | |
2968 | # | |
8eeb575c | 2969 | AC_CONFIG_FILES([ |
f06b4328 | 2970 | Makefile |
31a938ac | 2971 | libblkid/docs/Makefile |
8fb4efae | 2972 | libblkid/docs/version.xml |
8fb4efae | 2973 | libblkid/src/blkid.h |
705854f3 KZ |
2974 | libfdisk/docs/Makefile |
2975 | libfdisk/docs/version.xml | |
2976 | libfdisk/src/libfdisk.h | |
31a938ac | 2977 | libmount/docs/Makefile |
2aefc0a8 | 2978 | libmount/docs/version.xml |
f06b4328 | 2979 | libmount/src/libmount.h |
1d90bcb1 OO |
2980 | libsmartcols/docs/Makefile |
2981 | libsmartcols/docs/version.xml | |
1a4d989e | 2982 | libsmartcols/src/libsmartcols.h |
f06b4328 | 2983 | po/Makefile.in |
8f5fff53 | 2984 | po-man/Makefile |
8eeb575c | 2985 | ]) |
48d7b13a KZ |
2986 | |
2987 | AC_OUTPUT | |
4e1073c2 KZ |
2988 | |
2989 | AC_MSG_RESULT([ | |
a73035dc | 2990 | ${PACKAGE} ${VERSION} |
4e1073c2 | 2991 | |
a73035dc KZ |
2992 | prefix: ${prefix} |
2993 | exec prefix: ${exec_prefix} | |
4e1073c2 | 2994 | |
a73035dc KZ |
2995 | bindir: ${bindir} |
2996 | sbindir: ${sbindir} | |
2997 | libdir: ${libdir} | |
2998 | usrbin_execdir: ${usrbin_execdir} | |
2999 | usrsbin_execdir: ${usrsbin_execdir} | |
3000 | usrlib_execdir: ${usrlib_execdir} | |
3d289965 | 3001 | |
a73035dc KZ |
3002 | localstatedir: ${localstatedir} |
3003 | runstatedir: ${runstatedir} | |
3004 | includedir: ${includedir} | |
3005 | sysconfdir: ${sysconfdir} | |
3006 | sysconfstaticdir: ${sysconfstaticdir} | |
3d289965 | 3007 | |
a73035dc | 3008 | vendordir: ${with_vendordir} |
4e1073c2 | 3009 | |
a73035dc KZ |
3010 | Python: ${PYTHON} |
3011 | Python version: ${PYTHON_VERSION} | |
3012 | Python libs: ${pyexecdir} | |
8e5c4675 | 3013 | |
a73035dc KZ |
3014 | Bash completions: ${with_bashcompletiondir} |
3015 | Systemd support: ${have_systemd} | |
3016 | Systemd unitdir: ${with_systemdsystemunitdir} | |
c2e299d0 | 3017 | tmpfilesdir: ${with_tmpfilesdir} |
a73035dc KZ |
3018 | libeconf support: ${have_econf} |
3019 | Btrfs support: ${have_btrfs} | |
dd3bbc9c | 3020 | lastlog2 support: ${build_liblastlog2} |
a73035dc | 3021 | Wide-char support: ${build_widechar} |
034ca748 | 3022 | libcryptsetup support: ${have_cryptsetup} |
3745d4a9 | 3023 | |
a73035dc KZ |
3024 | Manual pages: ${build_asciidoc} |
3025 | Manual pages translated: ${build_poman} | |
4e1073c2 | 3026 | |
8519f4dd | 3027 | compiler: ${CC} / ${CXX} |
a73035dc KZ |
3028 | suid cflags: ${SUID_CFLAGS} |
3029 | ldflags: ${LDFLAGS} | |
3030 | suid ldflags: ${SUID_LDFLAGS} | |
3031 | ASAN enabled: ${enable_asan} | |
b4b8f8c2 FS |
3032 | Fuzzing enabled: ${enable_fuzzing_engine} |
3033 | Coverage enabled ${enable_coverage} | |
22a900a9 | 3034 | |
a73035dc KZ |
3035 | cflags: ${CFLAGS} |
3036 | ||
3037 | warnings: | |
4e1073c2 KZ |
3038 | |
3039 | ${WARN_CFLAGS} | |
b4b84389 | 3040 | |
a73035dc | 3041 | Type 'make' or 'make <utilname>' to compile. |
4e1073c2 | 3042 | ]) |