Fix check of OpenEXR >= 3.0 library.

Add check if OpenEXR needs explicit C++ standard.

Signed-off-by: Slávek Banko <slavek.banko@axis.cz>
(cherry picked from commit f808f70c93)
r14.0.x
Slávek Banko 3 years ago
parent bb0215ccd3
commit 246f9df57c
No known key found for this signature in database
GPG Key ID: 608F5293A04BE668

@ -415,7 +415,8 @@ fi
# OPENEXR
if test $sq_codec_openexr = yes; then
PKG_CHECK_MODULES([OpenEXR], OpenEXR, [
PKG_CHECK_MODULES([OpenEXR], OpenEXR,
[
SQ_EXR_CFLAGS=$OpenEXR_CFLAGS
SQ_EXR_LDFLAGS=$OpenEXR_LIBS
@ -424,25 +425,53 @@ PKG_CHECK_MODULES([OpenEXR], OpenEXR, [
CPPFLAGS="$SQ_EXR_CFLAGS $CPPFLAGS $USE_EXCEPTIONS"
LDFLAGS="$LDFLAGS $SQ_EXR_LDFLAGS"
BASE_CPPFLAGS="$CPPFLAGS"
AC_LANG_SAVE
AC_LANG_CPLUSPLUS
AC_CHECK_HEADERS([OpenEXR/ImfRgbaFile.h], [
AC_CHECK_LIB([IlmImf], [ImfInputFileName], [
sq_have_openexr="yes"
AC_SUBST(SQ_EXR_CFLAGS)
AC_SUBST(SQ_EXR_LDFLAGS)
], [sq_have_openexr="no" missing OpenEXR libopenexr])
],
[sq_have_openexr="no" missing OpenEXR libopenexr])
AC_CHECK_HEADERS([OpenEXR/ImfRgbaFile.h],
[sq_have_openexr_headers="yes"],
[
for CXX_STD_TEST in 11 14 17; do
AC_MSG_CHECKING([OpenEXR build with C++$CXX_STD_TEST])
CPPFLAGS="$BASE_CPPFLAGS -std=c++$CXX_STD_TEST"
$as_unset ac_cv_header_OpenEXR_ImfRgbaFile_h
AC_CHECK_HEADERS([OpenEXR/ImfRgbaFile.h],
[
sq_have_openexr_headers="yes"
SQ_EXR_CFLAGS+=" -std=c++$CXX_STD_TEST"
],
[sq_have_openexr="no" missing OpenEXR libopenexr])
if test x$sq_have_openexr_headers = xyes; then
break
fi
done
])
if test x$sq_have_openexr_headers = xyes; then
AC_CHECK_LIB([OpenEXR], [ImfInputFileName],
[
sq_have_openexr="yes"
AC_SUBST(SQ_EXR_CFLAGS)
AC_SUBST(SQ_EXR_LDFLAGS)
],
[
AC_CHECK_LIB([IlmImf], [ImfInputFileName],
[
sq_have_openexr="yes"
AC_SUBST(SQ_EXR_CFLAGS)
AC_SUBST(SQ_EXR_LDFLAGS)
],
[sq_have_openexr="no" missing OpenEXR libopenexr])
])
fi
AC_LANG_RESTORE
CPPFLAGS=$_cppflags
LDFLAGS=$_ldflags
],
[sq_have_openexr="no" missing OpenEXR libopenexr])
],
[sq_have_openexr="no" missing OpenEXR libopenexr])
fi
_cppflags=$CPPFLAGS

@ -1,6 +1,6 @@
CXXFLAGS = @CXXFLAGS@ -fexceptions
CXXFLAGS = @CXXFLAGS@ -fexceptions @SQ_EXR_CFLAGS@
INCLUDES = -I../include @SQ_EXR_CFLAGS@
INCLUDES = -I../include
pkglib_LTLIBRARIES = libkls_openexr.la

Loading…
Cancel
Save