summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSlávek Banko <slavek.banko@axis.cz>2019-10-30 19:30:37 +0100
committerSlávek Banko <slavek.banko@axis.cz>2019-10-30 19:30:58 +0100
commitff3a6a1c2888eab92679dd330641978e7e6feb5d (patch)
treed99e0ca6a46be23bc5c8a6fa877519a4f88db906
parent3c395c2ebd223c43685a9fc5dcbb41aef05149b3 (diff)
downloadkoffice-ff3a6a1c2888eab92679dd330641978e7e6feb5d.tar.gz
koffice-ff3a6a1c2888eab92679dd330641978e7e6feb5d.zip
Add check whether OpenEXR requires explicit specification of C++ standard.
Signed-off-by: Slávek Banko <slavek.banko@axis.cz> (cherry picked from commit 82895daec0ccb16c14b98e1b21b49dd71d68dd2f)
-rw-r--r--configure.in.in33
-rw-r--r--filters/chalk/openexr/Makefile.am2
2 files changed, 34 insertions, 1 deletions
diff --git a/configure.in.in b/configure.in.in
index 01eed782..fcc96492 100644
--- a/configure.in.in
+++ b/configure.in.in
@@ -288,6 +288,37 @@ fi
if test -n "$OPENEXR_LIBS"
then
AC_MSG_RESULT([yes])
+
+ AC_LANG_SAVE
+ AC_LANG_CPLUSPLUS
+ SAVED_CXXFLAGS="$CXXFLAGS"
+ for CXX_STD_TEST in "" 11 14 17; do
+ CXXFLAGS="$SAVED_CXXFLAGS"
+ if test "x$CXX_STD_TEST" = "x"; then
+ AC_MSG_CHECKING([OpenEXR build with default C++ standard])
+ OPENEXR_CXXFLAGS=""
+ else
+ AC_MSG_CHECKING([OpenEXR build with C++$CXX_STD_TEST])
+ OPENEXR_CXXFLAGS="-std=c++$CXX_STD_TEST"
+ fi
+ CXXFLAGS="$SAVED_CXXFLAGS $OPENEXR_CFLAGS $OPENEXR_CXXFLAGS"
+ AC_TRY_COMPILE([
+ #include <ImfRgbaFile.h>
+ ],[ ],
+ openexr_cxx_std=yes,
+ openexr_cxx_std=no
+ )
+ if test "x$openexr_cxx_std" = "xyes"; then
+ AC_SUBST(OPENEXR_CXXFLAGS)
+ AC_MSG_RESULT(yes)
+ break
+ else
+ AC_MSG_RESULT(no)
+ fi
+ done
+ CXXFLAGS="$SAVED_CXXFLAGS"
+ AC_LANG_RESTORE
+
else
AC_MSG_RESULT([not found])
fi
@@ -296,6 +327,6 @@ AC_SUBST(OPENEXR_LIBS)
AC_SUBST(OPENEXR_CFLAGS)
AC_SUBST(OPENEXR_RPATH)
-AM_CONDITIONAL(have_openexr, test -n "$OPENEXR_LIBS")
+AM_CONDITIONAL(have_openexr, test "x$openexr_cxx_std" = "xyes")
# --- End of OpenEXR check ---
diff --git a/filters/chalk/openexr/Makefile.am b/filters/chalk/openexr/Makefile.am
index e254687d..e95381c6 100644
--- a/filters/chalk/openexr/Makefile.am
+++ b/filters/chalk/openexr/Makefile.am
@@ -13,6 +13,8 @@ AM_CPPFLAGS= \
$(OPENEXR_CFLAGS) \
$(all_includes)
+CXXFLAGS += $(OPENEXR_CXXFLAGS)
+
kde_module_LTLIBRARIES = libchalk_openexr_import.la libchalk_openexr_export.la
libchalk_openexr_export_la_LDFLAGS = $(KDE_PLUGIN) $(KDE_RPATH) $(all_libraries) -module -avoid-version -no-undefined $(all_libraries) -ltdecore -ltdeui $(LIB_QT) -lkjs -ltdefx -ltdeio -ltdeparts