openexr: fix compilation with openexr >= 2.4.0 in autotools
authorTim-Philipp Müller <tim@centricular.com>
Mon, 11 Nov 2019 13:03:22 +0000 (13:03 +0000)
committerTim-Philipp Müller <tim@centricular.com>
Mon, 11 Nov 2019 13:09:29 +0000 (13:09 +0000)
Only pass -std=c++98 for openexr 2.3.x.

configure.ac
ext/openexr/Makefile.am

index 6685758..bdc34c6 100644 (file)
@@ -1896,6 +1896,15 @@ dnl *** OpenEXR ***
 translit(dnm, m, l) AM_CONDITIONAL(USE_OPENEXR, true)
 AG_GST_CHECK_FEATURE(OPENEXR, [openexr library], openexr, [
   AG_GST_PKG_CHECK_MODULES(OPENEXR, OpenEXR)
+  if test "x$HAVE_OPENEXR" = "xyes"; then
+    AG_GST_PKG_CHECK_MODULES(OPENEXR240, OpenEXR >= 2.4.0)
+    if test "x$HAVE_OPENEXR240" = "xyes"; then
+      OPENEXR_STDCFLAGS=
+    else
+      OPENEXR_STDCFLAGS="-std=c++98"
+    fi
+    AC_SUBST([OPENEXR_STDCFLAGS])
+  fi
 ])
 
 dnl *** openh264 ***
index 1a95fee..d7a3e5b 100644 (file)
@@ -6,7 +6,7 @@ libgstopenexr_la_CFLAGS = \
        $(OPENEXR_CFLAGS)
 libgstopenexr_la_CXXFLAGS = \
        $(GST_PLUGINS_BASE_CFLAGS) $(GST_BASE_CFLAGS) $(GST_CXXFLAGS) \
-       $(OPENEXR_CFLAGS) -std=c++98
+       $(OPENEXR_CFLAGS) $(OPENEXR_STDCFLAGS)
 libgstopenexr_la_LIBADD = \
        $(GST_PLUGINS_BASE_LIBS) -lgstvideo-$(GST_API_VERSION) \
        $(GST_BASE_LIBS) $(GST_LIBS) $(OPENEXR_LIBS)