diff options
author | Slávek Banko <slavek.banko@axis.cz> | 2021-07-09 02:07:32 +0200 |
---|---|---|
committer | Slávek Banko <slavek.banko@axis.cz> | 2021-07-09 03:20:48 +0200 |
commit | f808f70c938a5d764e474014b73fdb625c80eaff (patch) | |
tree | bb07d5e3a77c5de390b1d3df679dbb613e10e19e | |
parent | 0e5b1a249f1194ca7746cb93b56373061a57138b (diff) | |
download | libksquirrel-f808f70c938a5d764e474014b73fdb625c80eaff.tar.gz libksquirrel-f808f70c938a5d764e474014b73fdb625c80eaff.zip |
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>
-rw-r--r-- | configure.ac | 53 | ||||
-rw-r--r-- | kernel/kls_openexr/Makefile.am | 4 |
2 files changed, 43 insertions, 14 deletions
diff --git a/configure.ac b/configure.ac index 6411b9c..43fd881 100644 --- a/configure.ac +++ b/configure.ac @@ -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 diff --git a/kernel/kls_openexr/Makefile.am b/kernel/kls_openexr/Makefile.am index debce0e..15c16e0 100644 --- a/kernel/kls_openexr/Makefile.am +++ b/kernel/kls_openexr/Makefile.am @@ -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 |