From 3557e46b6d1e99491be0dc4ee85fe157475c0ae3 Mon Sep 17 00:00:00 2001 From: Michael Vetter Date: Tue, 31 May 2022 08:50:44 +0200 Subject: [PATCH] build: dont define HAVE_QRENCODE at all in case not present Before we got an error when libqrencode was not installed: `src/ui/console.c:52:10: fatal error: qrencode.h: No such file or directory` Which looked like HAVE_QRENCODE was true. config.status showed: `config.status:D["HAVE_QRENCODE"]=" 0"` Holger pointed to me that there is not just true and false but defined and undefined. So one solution was to use `#if HAVE_QRENCODE == 1` to check for the actual value. Or dont define HAVE_QRENCODE in the non present case at all. In all the other HAVE_ variables we use this approach. I think i at first chose the wrong way out of confusion with BUILD_ and HAVE_. --- configure.ac | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/configure.ac b/configure.ac index 9f78d7ec..96495386 100644 --- a/configure.ac +++ b/configure.ac @@ -350,8 +350,7 @@ AM_CONDITIONAL([THEMES_INSTALL], "$THEMES_INSTALL") if test "x$enable_omemo_qrcode" != xno; then PKG_CHECK_MODULES([libqrencode], [libqrencode], [AC_DEFINE([HAVE_QRENCODE], [1], [Have QRencode]) LIBS="$libqrencode_LIBS $LIBS" CFLAGS="$libqrencode_CFLAGS $CFLAGS"], - [AC_DEFINE([HAVE_QRENCODE], [0], [Dont have QRencode]) - AS_IF([test "x$enable_qrcode" = xyes], + [AS_IF([test "x$enable_qrcode" = xyes], [AC_MSG_ERROR([libqrencode not found])], [AC_MSG_NOTICE([librencode not found])])]) fi