[PATCH] clean up header checks

Mike Frysinger vapier at gentoo.org
Mon Jun 1 03:45:32 UTC 2009


Convert all of the #ifdef checks for specific headers to AC_CHECK_HEADERS
to avoid nested arch checks.  Also reformat AC_CHECK_HEADERS in the
configure.ac file in the process to keep it sorted and easily updated and
prevent merging errors in the future.

Signed-off-by: Mike Frysinger <vapier at gentoo.org>
---
 configure.ac |   34 +++++++++++++++++++++++++++++++++-
 system.c     |    6 +++---
 2 files changed, 36 insertions(+), 4 deletions(-)

diff --git a/configure.ac b/configure.ac
index ffbfeb4..3b1db7c 100644
--- a/configure.ac
+++ b/configure.ac
@@ -209,7 +209,39 @@ AC_CHECK_LIB(nsl, main)
 fi
 
 AC_CHECK_FUNCS(sigaction strerror strsignal pread sys_siglist _sys_siglist getdents mctl prctl sendmsg inet_ntop if_indextoname)
-AC_CHECK_HEADERS([sys/reg.h sys/filio.h sys/acl.h sys/asynch.h sys/door.h stropts.h sys/conf.h sys/stream.h sys/tihdr.h sys/tiuser.h sys/sysconfig.h ioctls.h sys/ioctl.h sys/ptrace.h termio.h linux/ptrace.h asm/reg.h sys/uio.h sys/aio.h poll.h sys/poll.h sys/vfs.h asm/sysmips.h linux/utsname.h sys/nscsys.h mqueue.h sys/epoll.h libaio.h inttypes.h], [], [])
+AC_CHECK_HEADERS([ \
+	inttypes.h \
+	ioctls.h \
+	libaio.h \
+	mqueue.h \
+	poll.h \
+	stropts.h \
+	termio.h \
+	sys/acl.h \
+	sys/aio.h \
+	sys/asynch.h \
+	sys/conf.h \
+	sys/door.h \
+	sys/epoll.h \
+	sys/filio.h \
+	sys/ioctl.h \
+	sys/nscsys.h \
+	sys/poll.h \
+	sys/ptrace.h \
+	sys/reg.h \
+	sys/stream.h \
+	sys/sysconfig.h \
+	sys/tihdr.h \
+	sys/tiuser.h \
+	sys/uio.h \
+	sys/vfs.h \
+	asm/cachectl.h \
+	asm/reg.h \
+	asm/sysmips.h \
+	linux/capability.h \
+	linux/ptrace.h \
+	linux/utsname.h \
+], [], [])
 AC_CHECK_HEADERS([linux/icmp.h linux/in6.h linux/netlink.h linux/if_packet.h],
                  [], [], [#include <stddef.h>
 #include <linux/socket.h>])
diff --git a/system.c b/system.c
index 7751c45..e060040 100644
--- a/system.c
+++ b/system.c
@@ -66,11 +66,11 @@
 
 #include <sys/syscall.h>
 
-#ifdef SYS_capget
+#ifdef HAVE_LINUX_CAPABILITY_H
 #include <linux/capability.h>
 #endif
 
-#ifdef SYS_cacheflush
+#ifdef HAVE_ASM_CACHECTL_H
 #include <asm/cachectl.h>
 #endif
 
@@ -78,7 +78,7 @@
 #include <linux/utsname.h>
 #endif
 
-#ifdef MIPS
+#ifdef HAVE_ASM_SYSMIPS_H
 #include <asm/sysmips.h>
 #endif
 
-- 
1.6.3





More information about the Strace-devel mailing list