add an explicit --disable-qrcodegen configure option
Change-Id: If8e965fa955aecdb9e7011bdddc690de9cad0c4d Reviewed-on: https://gerrit.libreoffice.org/c/core/+/103120 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com>
This commit is contained in:
@@ -4191,6 +4191,8 @@ gb_ExternalProject__use_qrcodegen :=
|
|||||||
|
|
||||||
else # !SYSTEM_QRCODEGEN
|
else # !SYSTEM_QRCODEGEN
|
||||||
|
|
||||||
|
ifneq ($(ENABLE_QRCODEGEN),)
|
||||||
|
|
||||||
define gb_LinkTarget__use_qrcodegen
|
define gb_LinkTarget__use_qrcodegen
|
||||||
$(call gb_LinkTarget_use_unpacked,$(1),qrcodegen)
|
$(call gb_LinkTarget_use_unpacked,$(1),qrcodegen)
|
||||||
$(call gb_LinkTarget_set_include,$(1),\
|
$(call gb_LinkTarget_set_include,$(1),\
|
||||||
@@ -4208,6 +4210,13 @@ $(call gb_ExternalProject_use_static_libraries,$(1),qrcodegen)
|
|||||||
|
|
||||||
endef
|
endef
|
||||||
|
|
||||||
|
else # !ENABLE_QRCODEGEN
|
||||||
|
|
||||||
|
define gb_LinkTarget__use_qrcodegen
|
||||||
|
endef
|
||||||
|
|
||||||
|
endif # ENABLE_QRCODEGEN
|
||||||
|
|
||||||
endif # SYSTEM_QRCODEGEN
|
endif # SYSTEM_QRCODEGEN
|
||||||
|
|
||||||
define gb_LinkTarget__use_dtoa
|
define gb_LinkTarget__use_dtoa
|
||||||
|
@@ -501,6 +501,7 @@ export PYTHON_VERSION=@PYTHON_VERSION@
|
|||||||
export PYTHON_VERSION_MAJOR=@PYTHON_VERSION_MAJOR@
|
export PYTHON_VERSION_MAJOR=@PYTHON_VERSION_MAJOR@
|
||||||
export PYTHON_VERSION_MINOR=@PYTHON_VERSION_MINOR@
|
export PYTHON_VERSION_MINOR=@PYTHON_VERSION_MINOR@
|
||||||
export PYTHONWARNINGS=@PYTHONWARNINGS@
|
export PYTHONWARNINGS=@PYTHONWARNINGS@
|
||||||
|
export ENABLE_QRCODEGEN=@ENABLE_QRCODEGEN@
|
||||||
export QRCODEGEN_CFLAGS=$(gb_SPACE)@QRCODEGEN_CFLAGS@
|
export QRCODEGEN_CFLAGS=$(gb_SPACE)@QRCODEGEN_CFLAGS@
|
||||||
export QRCODEGEN_LIBS=$(gb_SPACE)@QRCODEGEN_LIBS@
|
export QRCODEGEN_LIBS=$(gb_SPACE)@QRCODEGEN_LIBS@
|
||||||
export QT5_CFLAGS=$(gb_SPACE)@QT5_CFLAGS@
|
export QT5_CFLAGS=$(gb_SPACE)@QT5_CFLAGS@
|
||||||
|
17
config_host/config_qrcodegen.h.in
Normal file
17
config_host/config_qrcodegen.h.in
Normal file
@@ -0,0 +1,17 @@
|
|||||||
|
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
|
||||||
|
/*
|
||||||
|
* This file is part of the LibreOffice project.
|
||||||
|
*
|
||||||
|
* This Source Code Form is subject to the terms of the Mozilla Public
|
||||||
|
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||||
|
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
|
||||||
|
*/
|
||||||
|
|
||||||
|
#ifndef INCLUDED_CONFIG_QRCODEGEN_H
|
||||||
|
#define INCLUDED_CONFIG_QRCODEGEN_H
|
||||||
|
|
||||||
|
#define ENABLE_QRCODEGEN 0
|
||||||
|
|
||||||
|
#endif
|
||||||
|
|
||||||
|
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|
52
configure.ac
52
configure.ac
@@ -2034,6 +2034,10 @@ AC_ARG_WITH(system-hunspell,
|
|||||||
[Use libhunspell already on system.]),,
|
[Use libhunspell already on system.]),,
|
||||||
[with_system_hunspell="$with_system_libs"])
|
[with_system_hunspell="$with_system_libs"])
|
||||||
|
|
||||||
|
libo_FUZZ_ARG_ENABLE(qrcodegen,
|
||||||
|
AS_HELP_STRING([--disable-qrcodegen],
|
||||||
|
[Disable use of qrcodegen external library.]))
|
||||||
|
|
||||||
AC_ARG_WITH(system-qrcodegen,
|
AC_ARG_WITH(system-qrcodegen,
|
||||||
AS_HELP_STRING([--with-system-qrcodegen],
|
AS_HELP_STRING([--with-system-qrcodegen],
|
||||||
[Use libqrcodegen already on system.]),,
|
[Use libqrcodegen already on system.]),,
|
||||||
@@ -10536,26 +10540,39 @@ AC_SUBST(HUNSPELL_LIBS)
|
|||||||
dnl ===================================================================
|
dnl ===================================================================
|
||||||
dnl Check for system qrcodegen
|
dnl Check for system qrcodegen
|
||||||
dnl ===================================================================
|
dnl ===================================================================
|
||||||
AC_MSG_CHECKING([which libqrcodegen to use])
|
AC_MSG_CHECKING([whether to use libqrcodegen])
|
||||||
if test "$with_system_qrcodegen" = "yes"; then
|
if test "$enable_libqrcodegen" = "no"; then
|
||||||
AC_MSG_RESULT([external])
|
AC_MSG_RESULT([no])
|
||||||
SYSTEM_QRCODEGEN=TRUE
|
ENABLE_QRCODEGEN=
|
||||||
AC_LANG_PUSH([C++])
|
|
||||||
AC_CHECK_HEADER(qrcodegen/QrCode.hpp, [],
|
|
||||||
[AC_MSG_ERROR(qrcodegen headers not found.)], [#include <stdexcept>])
|
|
||||||
AC_CHECK_LIB([qrcodegencpp], [main], [:],
|
|
||||||
[ AC_MSG_ERROR(qrcodegen C++ library not found.) ], [])
|
|
||||||
QRCODEGEN_LIBS=-lqrcodegencpp
|
|
||||||
AC_LANG_POP([C++])
|
|
||||||
QRCODEGEN_CFLAGS=$(printf '%s' "$QRCODEGEN_CFLAGS" | sed -e "s/-I/${ISYSTEM?}/g")
|
|
||||||
FilterLibs "${QRCODEGEN_LIBS}"
|
|
||||||
QRCODEGEN_LIBS="${filteredlibs}"
|
|
||||||
else
|
|
||||||
AC_MSG_RESULT([internal])
|
|
||||||
SYSTEM_QRCODEGEN=
|
SYSTEM_QRCODEGEN=
|
||||||
BUILD_TYPE="$BUILD_TYPE QRCODEGEN"
|
else
|
||||||
|
AC_MSG_RESULT([yes])
|
||||||
|
ENABLE_QRCODEGEN=TRUE
|
||||||
|
AC_MSG_CHECKING([which libqrcodegen to use])
|
||||||
|
if test "$with_system_qrcodegen" = "yes"; then
|
||||||
|
AC_MSG_RESULT([external])
|
||||||
|
SYSTEM_QRCODEGEN=TRUE
|
||||||
|
AC_LANG_PUSH([C++])
|
||||||
|
AC_CHECK_HEADER(qrcodegen/QrCode.hpp, [],
|
||||||
|
[AC_MSG_ERROR(qrcodegen headers not found.)], [#include <stdexcept>])
|
||||||
|
AC_CHECK_LIB([qrcodegencpp], [main], [:],
|
||||||
|
[ AC_MSG_ERROR(qrcodegen C++ library not found.) ], [])
|
||||||
|
QRCODEGEN_LIBS=-lqrcodegencpp
|
||||||
|
AC_LANG_POP([C++])
|
||||||
|
QRCODEGEN_CFLAGS=$(printf '%s' "$QRCODEGEN_CFLAGS" | sed -e "s/-I/${ISYSTEM?}/g")
|
||||||
|
FilterLibs "${QRCODEGEN_LIBS}"
|
||||||
|
QRCODEGEN_LIBS="${filteredlibs}"
|
||||||
|
else
|
||||||
|
AC_MSG_RESULT([internal])
|
||||||
|
SYSTEM_QRCODEGEN=
|
||||||
|
BUILD_TYPE="$BUILD_TYPE QRCODEGEN"
|
||||||
|
fi
|
||||||
|
if test "$ENABLE_QRCODEGEN" = TRUE; then
|
||||||
|
AC_DEFINE(ENABLE_QRCODEGEN)
|
||||||
|
fi
|
||||||
fi
|
fi
|
||||||
AC_SUBST(SYSTEM_QRCODEGEN)
|
AC_SUBST(SYSTEM_QRCODEGEN)
|
||||||
|
AC_SUBST(ENABLE_QRCODEGEN)
|
||||||
AC_SUBST(QRCODEGEN_CFLAGS)
|
AC_SUBST(QRCODEGEN_CFLAGS)
|
||||||
AC_SUBST(QRCODEGEN_LIBS)
|
AC_SUBST(QRCODEGEN_LIBS)
|
||||||
|
|
||||||
@@ -13815,6 +13832,7 @@ AC_CONFIG_HEADERS([config_host/config_mpl.h])
|
|||||||
AC_CONFIG_HEADERS([config_host/config_oox.h])
|
AC_CONFIG_HEADERS([config_host/config_oox.h])
|
||||||
AC_CONFIG_HEADERS([config_host/config_options.h])
|
AC_CONFIG_HEADERS([config_host/config_options.h])
|
||||||
AC_CONFIG_HEADERS([config_host/config_options_calc.h])
|
AC_CONFIG_HEADERS([config_host/config_options_calc.h])
|
||||||
|
AC_CONFIG_HEADERS([config_host/config_qrcodegen.h])
|
||||||
AC_CONFIG_HEADERS([config_host/config_skia.h])
|
AC_CONFIG_HEADERS([config_host/config_skia.h])
|
||||||
AC_CONFIG_HEADERS([config_host/config_typesizes.h])
|
AC_CONFIG_HEADERS([config_host/config_typesizes.h])
|
||||||
AC_CONFIG_HEADERS([config_host/config_vendor.h])
|
AC_CONFIG_HEADERS([config_host/config_vendor.h])
|
||||||
|
@@ -17,11 +17,15 @@
|
|||||||
#include <utility>
|
#include <utility>
|
||||||
#include <vcl/svapp.hxx>
|
#include <vcl/svapp.hxx>
|
||||||
|
|
||||||
|
#include <config_qrcodegen.h>
|
||||||
|
|
||||||
|
#if ENABLE_QRCODEGEN
|
||||||
#if defined(SYSTEM_QRCODEGEN)
|
#if defined(SYSTEM_QRCODEGEN)
|
||||||
#include <qrcodegen/QrCode.hpp>
|
#include <qrcodegen/QrCode.hpp>
|
||||||
#else
|
#else
|
||||||
#include <QrCode.hpp>
|
#include <QrCode.hpp>
|
||||||
#endif
|
#endif
|
||||||
|
#endif
|
||||||
|
|
||||||
#include <com/sun/star/beans/XPropertySet.hpp>
|
#include <com/sun/star/beans/XPropertySet.hpp>
|
||||||
#include <com/sun/star/drawing/XDrawPageSupplier.hpp>
|
#include <com/sun/star/drawing/XDrawPageSupplier.hpp>
|
||||||
@@ -56,7 +60,9 @@ using namespace css::sheet;
|
|||||||
using namespace css::text;
|
using namespace css::text;
|
||||||
using namespace css::drawing;
|
using namespace css::drawing;
|
||||||
using namespace css::graphic;
|
using namespace css::graphic;
|
||||||
|
#if ENABLE_QRCODEGEN
|
||||||
using namespace qrcodegen;
|
using namespace qrcodegen;
|
||||||
|
#endif
|
||||||
|
|
||||||
QrCodeGenDialog::QrCodeGenDialog(weld::Widget* pParent, Reference<XModel> xModel,
|
QrCodeGenDialog::QrCodeGenDialog(weld::Widget* pParent, Reference<XModel> xModel,
|
||||||
bool bEditExisting)
|
bool bEditExisting)
|
||||||
@@ -104,6 +110,7 @@ QrCodeGenDialog::QrCodeGenDialog(weld::Widget* pParent, Reference<XModel> xModel
|
|||||||
|
|
||||||
short QrCodeGenDialog::run()
|
short QrCodeGenDialog::run()
|
||||||
{
|
{
|
||||||
|
#if ENABLE_QRCODEGEN
|
||||||
short nRet;
|
short nRet;
|
||||||
while (true)
|
while (true)
|
||||||
{
|
{
|
||||||
@@ -127,10 +134,14 @@ short QrCodeGenDialog::run()
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
return nRet;
|
return nRet;
|
||||||
|
#else
|
||||||
|
return RET_CANCEL;
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
void QrCodeGenDialog::Apply()
|
void QrCodeGenDialog::Apply()
|
||||||
{
|
{
|
||||||
|
#if ENABLE_QRCODEGEN
|
||||||
css::drawing::QRCode aQRCode;
|
css::drawing::QRCode aQRCode;
|
||||||
aQRCode.Payload = m_xEdittext->get_text();
|
aQRCode.Payload = m_xEdittext->get_text();
|
||||||
|
|
||||||
@@ -250,13 +261,12 @@ void QrCodeGenDialog::Apply()
|
|||||||
//Not implemented for math,base and other apps.
|
//Not implemented for math,base and other apps.
|
||||||
throw uno::RuntimeException("Not implemented");
|
throw uno::RuntimeException("Not implemented");
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
OUString QrCodeGenDialog::GenerateQRCode(OUString aQRText, long aQRECC, int aQRBorder)
|
OUString QrCodeGenDialog::GenerateQRCode(OUString aQRText, long aQRECC, int aQRBorder)
|
||||||
{
|
{
|
||||||
#if ENABLE_FUZZERS
|
#if ENABLE_QRCODEGEN
|
||||||
return OUString();
|
|
||||||
#else
|
|
||||||
//Select ECC:: value from aQrECC
|
//Select ECC:: value from aQrECC
|
||||||
qrcodegen::QrCode::Ecc bqrEcc = qrcodegen::QrCode::Ecc::LOW;
|
qrcodegen::QrCode::Ecc bqrEcc = qrcodegen::QrCode::Ecc::LOW;
|
||||||
|
|
||||||
@@ -293,6 +303,11 @@ OUString QrCodeGenDialog::GenerateQRCode(OUString aQRText, long aQRECC, int aQRB
|
|||||||
std::string svg = qr0.toSvgString(aQRBorder);
|
std::string svg = qr0.toSvgString(aQRBorder);
|
||||||
//cstring to OUString
|
//cstring to OUString
|
||||||
return OUString::createFromAscii(svg.c_str());
|
return OUString::createFromAscii(svg.c_str());
|
||||||
|
#else
|
||||||
|
(void)aQRText;
|
||||||
|
(void)aQRECC;
|
||||||
|
(void)aQRBorder;
|
||||||
|
return OUString();
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -16,5 +16,6 @@
|
|||||||
--disable-dbus
|
--disable-dbus
|
||||||
--disable-cups
|
--disable-cups
|
||||||
--disable-odk
|
--disable-odk
|
||||||
|
--disable-qrcodegen
|
||||||
--without-java
|
--without-java
|
||||||
--enable-ld=gold
|
--enable-ld=gold
|
||||||
|
4
external/qrcodegen/Module_qrcodegen.mk
vendored
4
external/qrcodegen/Module_qrcodegen.mk
vendored
@@ -13,8 +13,12 @@ $(eval $(call gb_Module_add_targets,qrcodegen,\
|
|||||||
UnpackedTarball_qrcodegen \
|
UnpackedTarball_qrcodegen \
|
||||||
))
|
))
|
||||||
|
|
||||||
|
ifeq ($(ENABLE_QRCODEGEN),TRUE)
|
||||||
|
|
||||||
$(eval $(call gb_Module_add_targets,qrcodegen,\
|
$(eval $(call gb_Module_add_targets,qrcodegen,\
|
||||||
StaticLibrary_qrcodegen \
|
StaticLibrary_qrcodegen \
|
||||||
))
|
))
|
||||||
|
|
||||||
|
endif
|
||||||
|
|
||||||
# vim: set noet sw=4 ts=4:
|
# vim: set noet sw=4 ts=4:
|
||||||
|
Reference in New Issue
Block a user