diff --git a/configure.ac b/configure.ac index f2e11509..41bf039e 100644 --- a/configure.ac +++ b/configure.ac @@ -361,25 +361,23 @@ fi # Detect cunit library PKG_CHECK_MODULES([CUNIT], [cunit >= 2.1], [have_cunit=yes], [have_cunit=no]) +# If pkg-config does not find cunit, check it using AC_CHECK_LIB. We +# do this because Debian (Ubuntu) lacks pkg-config file for cunit. +if test "x${have_cunit}" = "xno"; then + AC_CHECK_LIB([cunit], [CU_initialize_registry], [have_cunit=yes], [have_cunit=no]) + if test "x${have_cunit}" = "xyes"; then + CUNIT_LIBS="-lcunit" + CUNIT_CFLAGS="" + AC_SUBST([CUNIT_LIBS]) + AC_SUBST([CUNIT_CFLAGS]) + fi +fi AM_CONDITIONAL(HAVE_CUNIT, [test "x$have_cunit" != "xno"]) AM_CONDITIONAL(HAVE_AMDGPU, [test "x$AMDGPU" = xyes]) if test "x$AMDGPU" = xyes; then AC_DEFINE(HAVE_AMDGPU, 1, [Have amdgpu support]) - - # If pkg-config does not find cunit, check it using AC_CHECK_LIB. We - # do this because Debian (Ubuntu) lacks pkg-config file for cunit. - if test "x${have_cunit}" = "xno"; then - AC_CHECK_LIB([cunit], [CU_initialize_registry], [have_cunit=yes], [have_cunit=no]) - if test "x${have_cunit}" = "xyes"; then - CUNIT_LIBS="-lcunit" - CUNIT_CFLAGS="" - AC_SUBST([CUNIT_LIBS]) - AC_SUBST([CUNIT_CFLAGS]) - fi - fi - AC_DEFINE(HAVE_CUNIT, [test "x$have_cunit" != "xno"], [Enable CUNIT Have amdgpu support]) if test "x$have_cunit" = "xno"; then