1.1 --- a/configure.ac Mon Jan 05 17:39:05 2009 +0000
1.2 +++ b/configure.ac Tue Jan 06 14:06:00 2009 +0000
1.3 @@ -154,19 +154,21 @@
1.4 [AC_MSG_ERROR([Can't find expat library. Please install expat.])])
1.5 AC_SUBST(EXPAT_LIBS)
1.6
1.7 -RPM_LIB=""
1.8 -AC_ARG_WITH(rpm, [ --with-rpm=<dir> Use rpm from here],
1.9 - [
1.10 - rpm=$withval
1.11 - CPPFLAGS="$CPPFLAGS -I$withval/include"
1.12 - LDFLAGS="$LDFLAGS -L$withval/lib"
1.13 - ]
1.14 - )
1.15 -AC_CHECK_HEADERS(rpm/rpmlib.h, [],
1.16 - [AC_MSG_ERROR([Can't find rpm/rpmlib.h. Please install rpm-devel.])])
1.17 -AC_CHECK_LIB(rpm,rpmdbOpen,[RPM_LIBS="-lrpm"],
1.18 - [AC_MSG_ERROR([Can't find rpm library. Please install rpm-devel.])])
1.19 +RPM_LIBS=""
1.20 +AC_ARG_WITH(rpm, [ --with-rpm=<dir> Use rpm from here])
1.21 +
1.22 +AS_IF([test "$with_rpm" != no],
1.23 + [if test "$with_rpm" != yes; then
1.24 + CPPFLAGS="$CPPFLAGS -I$with_rpm/include"
1.25 + LDFLAGS="$LDFLAGS -L$with_rpm/lib"
1.26 + fi
1.27 + AC_CHECK_HEADERS(rpm/rpmlib.h, [],
1.28 + [AC_MSG_ERROR([Can't find rpm/rpmlib.h. Please install rpm-devel or use --without-rpm.])])
1.29 + AC_CHECK_LIB(rpm,rpmdbOpen,[RPM_LIBS="-lrpm"],
1.30 + [AC_MSG_ERROR([Can't find rpm library. Please install rpm-devel or use --without-rpm.])])
1.31 + AC_DEFINE([HAVE_RPMLIB], [1], [Define if you have librpm])])
1.32 AC_SUBST(RPM_LIBS)
1.33 +AM_CONDITIONAL([HAVE_RPMLIB], [test -n "$RPM_LIBS"])
1.34
1.35 if test "x$GCC" = "xyes"; then
1.36 LDFLAGS="-Wl,--as-needed $LDFLAGS"