mirror of https://github.com/profanity-im/profanity.git synced 2024-06-16 21:35:24 +00:00

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

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
This commit is contained in:
Michael Vetter 2022-05-31 08:50:44 +02:00
parent 1a7017e44c
commit 3557e46b6d

View File

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])])])