Skip to content

Commit b7a2072

Browse files
committed
Made the rpm-related pkg-config configuration more robust.
The same target of the check (`rpm`) screwed up other checks. Checks for different `librpm` versions have `rpm4`, rpm5`, ... targets that are then transferred to the `rpm_...` env variables. Fixes: #453
1 parent f15145b commit b7a2072

File tree

1 file changed

+11
-7
lines changed

1 file changed

+11
-7
lines changed

configure.ac

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -375,22 +375,26 @@ AC_SUBST(sigwaitinfo_LIBS)
375375
# libopenscap links against librpm if found. Otherwise we carry own implementation of rpmvercmp.
376376
echo
377377
echo '* Checking for rpm library (optional dependency of libopenscap) '
378-
PKG_CHECK_MODULES([rpm], [rpm >= 4.4],[
379-
SAVE_LIBS=$LIBS
378+
AC_SUBST([rpm_CFLAGS])
379+
AC_SUBST([rpm_LIBS])
380+
PKG_CHECK_MODULES([rpm4], [rpm >= 4.4],[
380381
AC_DEFINE([HAVE_RPMVERCMP], [1], [Define to 1 if there is rpmvercmp available.])
381-
AC_SUBST([rpm_CFLAGS])
382-
AC_SUBST([rpm_LIBS])
383-
LIBS=$SAVE_LIBS
382+
rpm_CFLAGS="$rpm4_CFLAGS"
383+
rpm_LIBS="$rpm4_LIBS"
384384
],[
385385
AC_MSG_NOTICE([!!! librpm not found. The rpmvercmp function will be emulated. !!!])
386386
])
387-
PKG_CHECK_MODULES([rpm], [rpm >= 4.6],[
387+
PKG_CHECK_MODULES([rpm6], [rpm >= 4.6],[
388388
AC_DEFINE([HAVE_RPM46], [1], [Define to 1 if rpm is newer than 4.6.])
389+
rpm_CFLAGS="$rpm6_CFLAGS"
390+
rpm_LIBS="$rpm6_LIBS"
389391
],[
390392
AC_MSG_NOTICE([librpm is older than 4.6])
391393
])
392-
PKG_CHECK_MODULES([rpm], [rpm >= 4.7],[
394+
PKG_CHECK_MODULES([rpm7], [rpm >= 4.7],[
393395
AC_DEFINE([HAVE_RPM47], [1], [Define to 1 if rpm is newer than 4.7.])
396+
rpm_CFLAGS="$rpm7_CFLAGS"
397+
rpm_LIBS="$rpm7_LIBS"
394398
],[
395399
AC_MSG_NOTICE([librpm is older than 4.7])
396400
])

0 commit comments

Comments
 (0)