From 0b786b627502132d2ccea1785a0743a22b3f3736 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sl=C3=A1vek=20Banko?= Date: Mon, 19 Aug 2019 02:54:47 +0200 Subject: [PATCH] Fix FTBFS with exiv2 >= 0.27. This resolves bug 3017. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Slávek Banko --- ConfigureChecks.cmake | 2 ++ config.h.cmake | 3 +++ libkexiv2/configure.in.in | 19 +++++++++++++------ libkexiv2/libkexiv2/kexiv2private.h | 8 ++++++++ 4 files changed, 26 insertions(+), 6 deletions(-) diff --git a/ConfigureChecks.cmake b/ConfigureChecks.cmake index 7c18e99..b582576 100644 --- a/ConfigureChecks.cmake +++ b/ConfigureChecks.cmake @@ -32,6 +32,8 @@ if( NOT EXIV2_FOUND ) tde_message_fatal( "exiv2 is required, but was not found on your system" ) endif( NOT EXIV2_FOUND ) +check_include_file_cxx( "exiv2/exiv2.hpp" HAVE_EXIV2_HPP ) + ##### check for header diff --git a/config.h.cmake b/config.h.cmake index b26b50a..1b91529 100644 --- a/config.h.cmake +++ b/config.h.cmake @@ -7,5 +7,8 @@ significant byte first (like Motorola and SPARC, unlike Intel). */ #cmakedefine WORDS_BIGENDIAN @WORDS_BIGENDIAN@ +/* Defined if you have header */ +#cmakedefine HAVE_EXIV2_HPP 1 + /* Defined if you have header */ #cmakedefine KDEMACROS_USABLE 1 diff --git a/libkexiv2/configure.in.in b/libkexiv2/configure.in.in index b37e50f..0b79e84 100644 --- a/libkexiv2/configure.in.in +++ b/libkexiv2/configure.in.in @@ -17,6 +17,19 @@ if test "x$have_exiv2" != "xyes"; then DO_NOT_COMPILE="libkexiv2 $DO_NOT_COMPILE" fi +AC_LANG_SAVE +AC_LANG_CPLUSPLUS +SAVE_CPPFLAGS=$CPPFLAGS +SAVE_CXXFLAGS=$CXXFLAGS +CPPFLAGS="$CPPFLAGS $EXIV2_CFLAGS" +CXXFLAGS="$CXXFLAGS $USE_EXCEPTIONS $EXIV2_CFLAGS" +AC_CHECK_HEADER(exiv2/exiv2.hpp, + [ AC_DEFINE(HAVE_EXIV2_HPP, 1, [Defined if you have header]) ] +) +CPPFLAGS=$SAVE_CPPFLAGS +CXXFLAGS=$SAVE_CXXFLAGS +AC_LANG_RESTORE + AC_OUTPUT([ libkexiv2/libkexiv2.pc ]) # ----------------------------------------------------------------- @@ -45,9 +58,3 @@ AC_COMPILE_IFELSE( ) CPPFLAGS=$libkexiv2_kdemacros_cppflags AC_LANG_POP(C++) - - - - - - diff --git a/libkexiv2/libkexiv2/kexiv2private.h b/libkexiv2/libkexiv2/kexiv2private.h index 31a5dcf..952e48a 100644 --- a/libkexiv2/libkexiv2/kexiv2private.h +++ b/libkexiv2/libkexiv2/kexiv2private.h @@ -24,6 +24,10 @@ #ifndef KEXIV2_PRIVATE_H #define KEXIV2_PRIVATE_H +#if defined( HAVE_CONFIG_H ) +#include "config.h" +#endif + // C++ includes. #include @@ -54,6 +58,9 @@ // See http://gcc.gnu.org/wiki/Visibility, the section about c++ exceptions. // They are needed for all libexiv2 versions that do not care about visibility. #pragma GCC visibility push(default) +#if defined(HAVE_EXIV2_HPP) +#include +#else #include #include #include @@ -61,6 +68,7 @@ #include #include #include +#endif #pragma GCC visibility pop // Check if Exiv2 support XMP