summaryrefslogtreecommitdiff
path: root/configure.ac
diff options
context:
space:
mode:
authorFabian Groffen <grobian@gentoo.org>2011-01-21 17:48:14 +0100
committerKarel Zak <kzak@redhat.com>2011-01-23 22:17:14 +0100
commitd58c47d9a49805157ff0669afe02fa4f9d8adf78 (patch)
tree6bd8e603aa195bed3b2f0127135afdff1cceec9c /configure.ac
parent3e27b34eb039911e9c0160e2dbc0a841fa70a570 (diff)
downloadutil-linux-old-d58c47d9a49805157ff0669afe02fa4f9d8adf78.tar.gz
include: emulate dirfd when necessary
dirfd is not available on Solaris 10, it is available on latest OpenSolaris releases though. Do some autoconf trickery to determine if providing an alternative dirfd function is necessary and possible. shlibs/blkid/src/read.c: Do not define _XOPEN_SOURCE to 600, or DIR will lose it's dd_fd member again. Rearrange defines and includes to make sense per comments, and not conflict on Solaris. Signed-off-by: Fabian Groffen <grobian@gentoo.org>
Diffstat (limited to 'configure.ac')
-rw-r--r--configure.ac24
1 files changed, 24 insertions, 0 deletions
diff --git a/configure.ac b/configure.ac
index 246afd4f..2aadacf5 100644
--- a/configure.ac
+++ b/configure.ac
@@ -224,6 +224,30 @@ AC_SEARCH_LIBS([socket], [socket],
fi])
AC_SUBST([SOCKET_LIBS])
+
+have_dirfd=no
+AC_CHECK_FUNCS([dirfd], [have_dirfd=yes], [have_dirfd=no])
+if test x"$have_dirfd" = xno ; then
+ AC_CHECK_DECLS([dirfd],
+ [have_dirfd=yes], [have_dirfd=no],
+ [#include <sys/types.h>
+ #include <dirent.h>])
+fi
+
+have_ddfd=no
+if test x"$have_dirfd" = xno ; then
+ AC_CHECK_MEMBERS([DIR.dd_fd],
+ [have_ddfd=yes], [have_ddfd=no],
+ [#include <sys/types.h>
+ #include <dirent.h>])
+fi
+
+case "$have_dirfd:$have_ddfd" in
+no:no)
+ AC_MSG_ERROR([cannot find a method to get filedescriptor of directory]) ;;
+esac
+
+
dnl Static compilation
m4_define([UTIL_STATIC_PROGRAMS], [losetup, mount, umount, fdisk, sfdisk, blkid])