#include <dirent.h>])
])
-AS_CASE([$have_dirfd:$have_ddfd],
- [no:no],
- [AC_MSG_ERROR([cannot find a method to get filedescriptor of directory])]
-)
+AM_CONDITIONAL([HAVE_DIRFD], [test "x$have_dirfd" = xyes -o "x$have_ddfd" = xyes])
AC_MSG_CHECKING([whether program_invocation_short_name is defined])
)
UL_BUILD_INIT([libblkid])
UL_REQUIRES_HAVE([libblkid], [openat], [openat functions])
+UL_REQUIRES_HAVE([libblkid], [dirfd,ddfd], [dirfd or ddfd function])
AC_SUBST([LIBBLKID_DATE])
AC_SUBST([LIBBLKID_VERSION])
AC_SUBST([LIBBLKID_VERSION_INFO])
UL_BUILD_INIT([libmount])
UL_REQUIRES_BUILD([libmount], [libblkid])
UL_REQUIRES_HAVE([libmount], [scanf_alloc_modifier], [scanf string alloc modifier])
+UL_REQUIRES_HAVE([libmount], [dirfd,ddfd], [dirfd or ddfd function])
AM_CONDITIONAL([BUILD_LIBMOUNT], [test "x$build_libmount" = xyes])
AM_CONDITIONAL([BUILD_LIBMOUNT_TESTS], [test "x$build_libmount" = xyes -a "x$enable_static" = xyes])
AS_IF([test "x$build_libmount" = xyes], [
UL_BUILD_INIT([fdisk])
UL_REQUIRES_HAVE([fdisk], [openat], [openat functions])
+UL_REQUIRES_HAVE([fdisk], [dirfd,ddfd], [dirfd or ddfd function])
UL_REQUIRES_BUILD([fdisk], [libfdisk])
UL_REQUIRES_BUILD([fdisk], [libsmartcols])
AM_CONDITIONAL([BUILD_FDISK], [test "x$build_fdisk" = xyes])
UL_BUILD_INIT([sfdisk])
UL_REQUIRES_HAVE([sfdisk], [openat], [openat functions])
+UL_REQUIRES_HAVE([sfdisk], [dirfd,ddfd], [dirfd or ddfd function])
UL_REQUIRES_BUILD([sfdisk], [libfdisk])
UL_REQUIRES_BUILD([sfdisk], [libsmartcols])
AM_CONDITIONAL([BUILD_SFDISK], [test "x$build_sfdisk" = xyes])
UL_BUILD_INIT([switch_root])
UL_REQUIRES_LINUX([switch_root])
UL_REQUIRES_HAVE([switch_root], [openat], [openat function])
+UL_REQUIRES_HAVE([switch_root], [dirfd,ddfd], [dirfd or ddfd function])
AM_CONDITIONAL([BUILD_SWITCH_ROOT], [test "x$build_switch_root" = xyes])
endif
if HAVE_OPENAT
+if HAVE_DIRFD
libcommon_la_SOURCES += lib/path.c
libcommon_la_SOURCES += lib/procutils.c
libcommon_la_SOURCES += lib/sysfs.c
endif
+endif
noinst_LTLIBRARIES += libtcolors.la
libtcolors_la_CFLAGS = $(AM_CFLAGS)
endif
if HAVE_OPENAT
+if HAVE_DIRFD
check_PROGRAMS += test_procutils
check_PROGRAMS += test_path
endif
+endif
test_ttyutils_SOURCES = lib/ttyutils.c
test_ttyutils_CFLAGS = $(AM_CFLAGS) -DTEST_PROGRAM_TTYUTILS
test_randutils_CFLAGS = $(AM_CFLAGS) -DTEST_PROGRAM_RANDUTILS
if HAVE_OPENAT
+if HAVE_DIRFD
test_procutils_SOURCES = lib/procutils.c
test_procutils_CFLAGS = $(AM_CFLAGS) -DTEST_PROGRAM_PROCUTILS
-endif
-if HAVE_OPENAT
test_path_SOURCES = lib/path.c lib/fileutils.c
if HAVE_CPU_SET_T
test_path_SOURCES += lib/cpuset.c
test_path_CFLAGS = $(AM_CFLAGS) -DTEST_PROGRAM_PATH
test_path_LDADD = $(LDADD)
endif
+endif
if LINUX
test_cpuset_SOURCES = lib/cpuset.c