]> git.ipfire.org Git - thirdparty/util-linux.git/blobdiff - configure.ac
Merge branch 'PR/libsmartcols-reduce-fix' of github.com:karelzak/util-linux-work
[thirdparty/util-linux.git] / configure.ac
index 7a0c4f29170964ce6ca778c041a29016655cf3ad..b360e448ea952ecbb4fbc2ec96c855e76476ad42 100644 (file)
@@ -92,6 +92,8 @@ AS_CASE([$prefix],
 
   ]
 )
+AC_SUBST([localstatedir])
+
 
 # default for old versions without $runstatedir
 AS_IF([test x"$runstatedir" = x], [runstatedir='${localstatedir}/run'])
@@ -101,7 +103,6 @@ AS_CASE([$localstatedir:$runstatedir],
  [NONE:'${localstatedir}/run' | /var:'${localstatedir}/run' | NONE:'/run' ],
    [runstatedir=/run; AC_MSG_NOTICE([  --runstatedir defaults to /run])]
 )
-
 AC_SUBST([runstatedir])
 
 
@@ -131,6 +132,7 @@ AC_PROG_CC
 AM_PROG_CC_C_O
 AC_PROG_MKDIR_P
 AC_PROG_YACC
+AC_PROG_SED
 
 # Don't use autotools integrated LEX/YACC support for libsmartcols
 AC_PATH_PROG([FLEX], [flex])
@@ -315,8 +317,6 @@ AC_CHECK_HEADERS([linux/compiler.h linux/blkpg.h linux/major.h], [], [], [
 #endif
 ])
 AC_CHECK_HEADERS([ \
-       asm-generic/fcntl.h \
-       asm/fcntl.h \
        asm/io.h \
        byteswap.h \
        endian.h \
@@ -327,6 +327,8 @@ AC_CHECK_HEADERS([ \
        inttypes.h \
        lastlog.h \
        libutil.h \
+       linux/audit.h \
+       linux/bpf.h \
        linux/blkzoned.h \
        linux/btrfs.h \
        linux/capability.h \
@@ -353,6 +355,7 @@ AC_CHECK_HEADERS([ \
        paths.h \
        pty.h \
        security/pam_appl.h \
+       security/pam_modules.h \
        shadow.h \
        stdint.h \
        stdio_ext.h \
@@ -390,7 +393,6 @@ AC_CHECK_HEADERS([ \
        unistd.h \
        utmp.h \
        utmpx.h \
-       sqlite3.h \
 ])
 
 # There is a collision in old kernel-headers. The both files mount.h and fs.h
@@ -495,6 +497,7 @@ AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
 
 dnl Convert some ac_cv_header_* variables to have_*
 dnl
+have_linux_audit_h=$ac_cv_header_linux_audit_h
 have_linux_blkzoned_h=$ac_cv_header_linux_blkzoned_h
 have_linux_btrfs_h=$ac_cv_header_linux_btrfs_h
 have_linux_capability_h=$ac_cv_header_linux_capability_h
@@ -509,11 +512,13 @@ have_pty_h=$ac_cv_header_pty_h
 have_security_openpam_h=$ac_cv_header_security_openpam_h
 have_security_pam_appl_h=$ac_cv_header_security_pam_appl_h
 have_security_pam_misc_h=$ac_cv_header_security_pam_misc_h
+have_security_pam_modules_h=$ac_cv_header_security_pam_modules_h
 have_shadow_h=$ac_cv_header_shadow_h
 have_sys_signalfd_h=$ac_cv_header_sys_signalfd_h
 have_utmpx_h=$ac_cv_header_utmpx_h
 have_mntent_h=$ac_cv_header_mntent_h
-have_sqlite3_h=$ac_cv_header_sqlite3_h
+have_sys_vfs_h=$ac_cv_header_sys_vfs_h
+have_linux_bpf_h=$ac_cv_header_linux_bpf_h
 
 AS_CASE([$linux_os:$have_linux_version_h],
   [yes:no],
@@ -803,7 +808,7 @@ AC_CHECK_DECL([IOC_OPAL_GET_STATUS],
              [#include <linux/sed-opal.h>])
 
 dnl Static compilation
-m4_define([UL_STATIC_PROGRAMS], [blkid, fdisk, losetup, mount, nsenter, sfdisk, umount, unshare])
+m4_define([UL_STATIC_PROGRAMS], [blkid, fdisk, losetup, mount, nsenter, partx, sfdisk, umount, unshare])
 
 AC_ARG_ENABLE([static-programs],
   [AS_HELP_STRING([--enable-static-programs=LIST],
@@ -1225,26 +1230,33 @@ dnl liblastlog2
 dnl
 AC_ARG_ENABLE([liblastlog2],
   AS_HELP_STRING([--disable-liblastlog2], [do not build liblastlog2 and lastlog2 utilities]),
-  [enable_liblastlog2=no], [enable_liblastlog2=check]
+  [], [UL_DEFAULT_ENABLE([liblastlog2], [yes])]
 )
+UL_BUILD_INIT([liblastlog2])
+
+have_sqlite3=no
+AS_IF([test "x$build_liblastlog2" = xyes], [
+  PKG_CHECK_MODULES([SQLITE3], [sqlite3], [have_sqlite3=yes], [have_sqlite3=no])
+])
+UL_REQUIRES_HAVE([liblastlog2], [sqlite3], [sqlite3 library])
+AC_SUBST([SQLITE3_LIBS])
+
 AC_SUBST([LIBLASTLOG2_VERSION])
 AC_SUBST([LIBLASTLOG2_VERSION_INFO])
 AC_DEFINE_UNQUOTED([LIBLASTLOG2_VERSION], ["$LIBLASTLOG2_VERSION"], [liblastlog2 version string])
+AM_CONDITIONAL([BUILD_LIBLASTLOG2], [test "x$build_liblastlog2" = xyes])
+AM_CONDITIONAL([BUILD_LIBLASTLOG2_TESTS], [test "x$build_liblastlog2" = xyes && test "x$enable_static" = xyes])
+
+
+AC_ARG_ENABLE([pam_lastlog2],
+  AS_HELP_STRING([--disable-pam-lastlog2], [do not build PAM lastlog2 module]),
+  [], [UL_DEFAULT_ENABLE([pam_lastlog2], [check])]
+)
+UL_BUILD_INIT([pam_lastlog2])
+UL_REQUIRES_BUILD([pam_lastlog2], [liblastlog2])
+UL_REQUIRES_HAVE([pam_lastlog2], [security_pam_modules_h], [pam_modules.h header file])
+AM_CONDITIONAL([BUILD_PAM_LASTLOG2], [test "x$build_pam_lastlog2" = xyes])
 
-have_lastlog2=no
-AS_IF([test "x$enable_liblastlog2" != xno], [
-  AS_CASE([$enable_liblastlog2:$have_sqlite3_h],
-    [yes:no],
-       [AC_MSG_ERROR([lastlog2 selected but sqlite3.h not found])],
-    [check:no],
-       [AC_MSG_WARN([sqlite3.h not found, do not build with lastlog2 support])],
-    [*:yes],
-       [have_lastlog2=yes
-        AC_DEFINE(HAVE_LIBLASTLOG2, 1, [Define to 1 if you have the -llastlog2.])]
-  )
-])
-AM_CONDITIONAL([BUILD_LIBLASTLOG2], [test "x$have_lastlog2" = xyes])
-AM_CONDITIONAL([BUILD_LIBLASTLOG2_TESTS], [test "x$have_lastlog2" = xyes && test "x$enable_static" = xyes])
 
 dnl
 dnl libblkid
@@ -1278,6 +1290,7 @@ UL_BUILD_INIT([libmount])
 UL_REQUIRES_BUILD([libmount], [libblkid])
 UL_REQUIRES_HAVE([libmount], [dirfd,ddfd], [dirfd or ddfd function])
 UL_REQUIRES_HAVE([libmount], [mntent_h], [mntent.h header file])
+UL_REQUIRES_HAVE([libmount], [sys_vfs_h], [sys/vfs.h header file])
 AM_CONDITIONAL([BUILD_LIBMOUNT], [test "x$build_libmount" = xyes])
 AM_CONDITIONAL([BUILD_LIBMOUNT_TESTS], [test "x$build_libmount" = xyes && test "x$enable_static" = xyes])
 AS_IF([test "x$build_libmount" = xyes], [
@@ -1840,6 +1853,7 @@ AC_ARG_ENABLE([lsfd],
 UL_BUILD_INIT([lsfd])
 UL_REQUIRES_LINUX([lsfd])
 UL_REQUIRES_BUILD([lsfd], [libsmartcols])
+UL_REQUIRES_HAVE([lsfd], [linux_bpf_h], [linux/bpf.h header file])
 AM_CONDITIONAL([BUILD_LSFD], [test "x$build_lsfd" = xyes])
 
 AC_ARG_ENABLE([lslogins],
@@ -1939,8 +1953,13 @@ UL_REQUIRES_LINUX([waitpid])
 UL_REQUIRES_SYSCALL_CHECK([waitpid], [UL_CHECK_SYSCALL([pidfd_open])], [pidfd_open])
 AM_CONDITIONAL([BUILD_WAITPID], [test "x$build_waitpid" = xyes])
 
-UL_BUILD_INIT([enosys], [check])
+AC_ARG_ENABLE([enosys],
+  AS_HELP_STRING([--disable-enosys], [do not build enosys]),
+  [], [UL_DEFAULT_ENABLE([enosys], [check])]
+)
+UL_BUILD_INIT([enosys])
 UL_REQUIRES_LINUX([enosys])
+UL_REQUIRES_HAVE([enosys], [linux_audit_h], [linux/audit.h header file])
 AS_IF([test "x$build_enosys" = xyes], [
   AC_MSG_CHECKING([for valid audit arch])
   AC_COMPILE_IFELSE(
@@ -1954,6 +1973,7 @@ AM_CONDITIONAL([BUILD_ENOSYS], [test "x$build_enosys" = xyes])
 
 UL_BUILD_INIT([lsclocks], [check])
 UL_REQUIRES_LINUX([lsclocks])
+UL_REQUIRES_BUILD([lsclocks], [libsmartcols])
 AM_CONDITIONAL([BUILD_LSCLOCKS], [test "x$build_lsclocks" = xyes])
 
 UL_BUILD_INIT([getopt], [yes])
@@ -2492,9 +2512,9 @@ UL_REQUIRES_HAVE([setterm], [ncursesw, ncurses], [ncursesw or ncurses library])
 AM_CONDITIONAL([BUILD_SETTERM], [test "x$build_setterm" = xyes])
 
 # build_schedutils= is just configure-only variable to control
-# ionice, taskset and chrt
+# ionice, taskset, coresched and chrt
 AC_ARG_ENABLE([schedutils],
-  AS_HELP_STRING([--disable-schedutils], [do not build chrt, ionice, taskset]),
+  AS_HELP_STRING([--disable-schedutils], [do not build chrt, ionice, taskset, coresched]),
   [], [UL_DEFAULT_ENABLE([schedutils], [check])]
 )
 
@@ -2537,6 +2557,14 @@ UL_REQUIRES_SYSCALL_CHECK([taskset],
 AM_CONDITIONAL([BUILD_TASKSET], [test "x$build_taskset" = xyes])
 
 
+UL_ENABLE_ALIAS([coresched], [schedutils])
+UL_BUILD_INIT([coresched])
+UL_REQUIRES_SYSCALL_CHECK([coresched],
+       [UL_CHECK_SYSCALL([prctl])],
+       [prctl])
+AM_CONDITIONAL([BUILD_CORESCHED], [test "x$build_coresched" = xyes])
+
+
 have_schedsetter=no
 AS_IF([test "x$ac_cv_func_sched_setscheduler" = xyes], [have_schedsetter=yes],
       [test "x$ac_cv_func_sched_setattr" = xyes], [have_schedsetter=yes])
@@ -2996,7 +3024,7 @@ AC_MSG_RESULT([
         tmpfilesdir:               ${with_tmpfilesdir}
         libeconf support:          ${have_econf}
         Btrfs support:             ${have_btrfs}
-        lastlog2 support:          ${have_lastlog2}
+        lastlog2 support:          ${build_liblastlog2}
         Wide-char support:         ${build_widechar}
         libcryptsetup support:     ${have_cryptsetup}