yselkowitz / rpms / condor

Forked from rpms/condor 6 years ago
Clone
Blob Blame History Raw
diff --git a/src/aclocal.m4 b/src/aclocal.m4
index 24542d2..3fb2c83 100644
--- a/src/aclocal.m4
+++ b/src/aclocal.m4
@@ -243,6 +243,38 @@ AC_DEFUN([MF_LIB_CHECK],
           CFLAGS="$_cflags_save"])
         [cv_ext_]m4_tolower($1)[=yes])])
 
+#
+## THIS SHOULD WORK, BUT DOESN'T! FOR SOME REASON AC_CHECK_HEADER DOES
+## NOT BEHAVE LIKE AC_CHECK_LIB
+#
+# MF_HEADER_CHECK(name,
+#                 header)
+#
+# This is a useful function that can be provided as a test to
+# CHECK_EXTERNAL. It checks for a header file to determine if the
+# external is available.
+#
+# Arguments:
+#  * name: The externals name 
+#  * header: A header file to test for,
+#             e.g. [classad/classad_distribution.h]
+#
+# Results:
+# * cv_ext_<name> set to yes, if the header is found
+#                        no, otherwise
+#
+# Note: This function uses _dir if it is set. It should be set to a
+# path that includes a lib/ and include/ directory.
+#
+AC_DEFUN([MF_HEADER_CHECK],
+  [_cflags_save="$CFLAGS"
+   AS_IF([test "x$_dir" != x],
+    [CFLAGS="$CFLAGS -I$_dir/include"])
+   AC_CHECK_HEADER([$2],
+     [cv_ext_]m4_tolower($1)[=yes],
+     [cv_ext_]m4_tolower($1)[=no
+      CFLAGS="$_cflags_save"
+      AC_MSG_WARN([$1: could not find $2])])])
 
 #######################################################################
 # CONDOR_EXTERNAL_VERSION written by Derek Wright
diff --git a/src/configure.ac b/src/configure.ac
index d20ca4d..599e277 100644
--- a/src/configure.ac
+++ b/src/configure.ac
@@ -2392,7 +2392,10 @@ CHECK_EXTERNAL([zlib], [1.2.3], [$_cv_zlib_requirement],
                [use zlib (provides compression support)],
                MF_LIB_CHECK([zlib], [[z deflate]]))
 
-CHECK_EXTERNAL([classads], [1.0rc5], [soft])
+CHECK_EXTERNAL([classads], [1.0rc5], [soft],
+               [use new ClassAds (provides -better-analyze and more)],
+	       # This REALLY should test for headers, like most checks...
+               MF_LIB_CHECK([classads], [[classad cclassad_create]]))	       
 
 CHECK_EXTERNAL([srb], [3.2.1], [soft])