diff options
Diffstat (limited to 'configure.ac')
-rw-r--r-- | configure.ac | 53 |
1 files changed, 41 insertions, 12 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 |