Security cleanup / fixup part 3.

1. Make HAVE_CAPSET into CAPSET as it can be overridden by the user via configure.
2. Add shims for using a different libcap-2 compliant library if one existed (libcap-ng is no
   freaking way near libcap-2, and that's what's available on Fedora 13).

Signed-off-by: Garrett Cooper <yanegomi@gmail.com>
diff --git a/m4/ltp-cap.m4 b/m4/ltp-cap.m4
index ede30bb..8b15a3a 100644
--- a/m4/ltp-cap.m4
+++ b/m4/ltp-cap.m4
@@ -1,5 +1,6 @@
 dnl
 dnl Copyright (c) Cisco Systems Inc., 2009
+dnl Copyright (c) Linux Test Project, 2010
 dnl
 dnl This program is free software;  you can redistribute it and/or modify
 dnl it under the terms of the GNU General Public License as published by
@@ -25,14 +26,13 @@
 AC_DEFUN([LTP_CHECK_CAPABILITY_SUPPORT],[
 AH_TEMPLATE(HAVE_LIBCAP,
 [Define to 1 if you have libcap-2 installed.])
-AC_CHECK_HEADERS(sys/capability.h,[
-	LTP_CAPABILITY_SUPPORT=yes
-	AC_CHECK_LIB(cap,cap_compare,[AC_DEFINE(HAVE_LIBCAP) cap_libs="-lcap"])
-	AC_CHECK_PROG(HAVE_SETCAP,capset,[have_capset="yes"])
-])
-if test "x$have_capset" != xyes; then
-	have_capset=no
+AC_CHECK_HEADER([sys/capability.h],[capability_header_prefix="sys"])
+if test "x$capability_header_prefix" != x; then
+	AC_CHECK_LIB(cap,cap_compare,[cap_libs="-lcap"])
+	AC_CHECK_PROG(CAPSET,capset,capset)
+fi
+if test "x$cap_libs" != x; then
+	AC_DEFINE(HAVE_LIBCAP)
 fi
 AC_SUBST(CAP_LIBS,$cap_libs)
-AC_SUBST(HAVE_CAPSET,$have_capset)
 ])