diff -r ed8155380e45 -r 53e1185e2366 configure.ac
--- a/configure.ac Mon Jan 05 17:39:05 2009 +0000
+++ b/configure.ac Tue Jan 06 14:06:00 2009 +0000
@@ -154,19 +154,21 @@
[AC_MSG_ERROR([Can't find expat library. Please install expat.])])
AC_SUBST(EXPAT_LIBS)
-RPM_LIB=""
-AC_ARG_WITH(rpm, [ --with-rpm=
Use rpm from here],
- [
- rpm=$withval
- CPPFLAGS="$CPPFLAGS -I$withval/include"
- LDFLAGS="$LDFLAGS -L$withval/lib"
- ]
- )
-AC_CHECK_HEADERS(rpm/rpmlib.h, [],
- [AC_MSG_ERROR([Can't find rpm/rpmlib.h. Please install rpm-devel.])])
-AC_CHECK_LIB(rpm,rpmdbOpen,[RPM_LIBS="-lrpm"],
- [AC_MSG_ERROR([Can't find rpm library. Please install rpm-devel.])])
+RPM_LIBS=""
+AC_ARG_WITH(rpm, [ --with-rpm= Use rpm from here])
+
+AS_IF([test "$with_rpm" != no],
+ [if test "$with_rpm" != yes; then
+ CPPFLAGS="$CPPFLAGS -I$with_rpm/include"
+ LDFLAGS="$LDFLAGS -L$with_rpm/lib"
+ fi
+ AC_CHECK_HEADERS(rpm/rpmlib.h, [],
+ [AC_MSG_ERROR([Can't find rpm/rpmlib.h. Please install rpm-devel or use --without-rpm.])])
+ AC_CHECK_LIB(rpm,rpmdbOpen,[RPM_LIBS="-lrpm"],
+ [AC_MSG_ERROR([Can't find rpm library. Please install rpm-devel or use --without-rpm.])])
+ AC_DEFINE([HAVE_RPMLIB], [1], [Define if you have librpm])])
AC_SUBST(RPM_LIBS)
+AM_CONDITIONAL([HAVE_RPMLIB], [test -n "$RPM_LIBS"])
if test "x$GCC" = "xyes"; then
LDFLAGS="-Wl,--as-needed $LDFLAGS"