Replace bunch of rpm version checks with feature checks to get this to
[apt.git] / configure.ac
index dc2bead..64c3082 100644 (file)
@@ -76,7 +76,8 @@ else
 
    AC_CHECK_HEADER(rpm/rpmlib.h, [],
                   [AC_MSG_ERROR([Can't find rpmlib.h])])
-   AC_CHECK_HEADERS([rpm/rpmsx.h rpm/misc.h])
+   AC_CHECK_HEADERS([rpm/rpmsx.h rpm/misc.h rpm/rpmcallback.h, rpm/rpmcb.h,
+                    rpm/rpmmessages.h])
 
    if test $RPM_VERSION_MAJOR -lt 4; then
       RPMLIBS="-lrpm -lz -lbz2 -lpopt"
@@ -92,6 +93,22 @@ else
    AC_SUBST(RPMLIBS)
 fi
 
+dnl Various rpm variant capability checks
+AC_MSG_CHECKING(for rpmdsGetconf)
+AC_EGREP_HEADER(rpmdsGetconf, rpm/rpmds.h,
+       [AC_MSG_RESULT(yes) AC_DEFINE(RPM_HAVE_DSGETCONF, 1, [rpmdsGetconf]) ],
+       [AC_MSG_RESULT(no) ])
+
+AC_MSG_CHECKING(for rpmdsRpmlib)
+AC_EGREP_HEADER(rpmdsRpmlib, rpm/rpmds.h,
+       [AC_MSG_RESULT(yes) AC_DEFINE(RPM_HAVE_DSRPMLIB, 1, [rpmdsRpmlib]) ],
+       [AC_MSG_RESULT(no) ])
+       
+AC_MSG_CHECKING(for fdigests)
+AC_EGREP_HEADER(RPMTRANS_FLAG_NOFDIGESTS, rpm/rpmlib.h
+       [AC_MSG_RESULT(yes) AC_DEFINE(RPM_HAVE_FDIGESTS, 1, [fdigests]) ],
+       [AC_MSG_RESULT(no) ])
+
 dnl Can we use g++ hash_map?
 AH_TEMPLATE(APT_WITH_GNU_HASH_MAP,
            [Define to 1 if you want to use the g++ hash_map extension])