From d94e8de4a4c3f9c12e5cf58528e17644e7ffdc43 Mon Sep 17 00:00:00 2001 From: Sam Lantinga Date: Mon, 7 Oct 2019 10:37:37 -0700 Subject: [PATCH] Moved SDL detection after graphic libraries so SDL linker flags don't affect them --- configure | 1777 +++++++++++++++++++++++++------------------------- configure.in | 21 +- 2 files changed, 896 insertions(+), 902 deletions(-) diff --git a/configure b/configure index 37ea0822..e31d1d9f 100755 --- a/configure +++ b/configure @@ -745,15 +745,15 @@ am__EXEEXT_TRUE LTLIBOBJS LIBOBJS IMG_LIBS +SDL2_CONFIG +SDL_LIBS +SDL_CFLAGS +SDL_VERSION LIBWEBP_LIBS LIBWEBP_CFLAGS LIBPNG_LIBS LIBPNG_CFLAGS -SDL2_CONFIG -SDL_LIBS -SDL_CFLAGS PKG_CONFIG -SDL_VERSION USE_VERSION_RC_FALSE USE_VERSION_RC_TRUE USE_IMAGEIO_FALSE @@ -898,9 +898,6 @@ enable_libtool_lock enable_dependency_tracking enable_silent_rules enable_imageio -with_sdl_prefix -with_sdl_exec_prefix -enable_sdltest enable_bmp enable_gif enable_jpg @@ -920,6 +917,9 @@ enable_xv enable_webp enable_webpdec enable_webp_shared +with_sdl_prefix +with_sdl_exec_prefix +enable_sdltest ' ac_precious_vars='build_alias host_alias @@ -933,12 +933,12 @@ CPP OBJC OBJCFLAGS PKG_CONFIG -SDL_CFLAGS -SDL_LIBS LIBPNG_CFLAGS LIBPNG_LIBS LIBWEBP_CFLAGS -LIBWEBP_LIBS' +LIBWEBP_LIBS +SDL_CFLAGS +SDL_LIBS' # Initialize some variables set by options. @@ -1569,7 +1569,6 @@ Optional Features: --disable-silent-rules verbose build output (undo: "make V=0") --enable-imageio use native Mac OS X frameworks for loading images [default=yes] - --disable-sdltest Do not try to compile and run a test SDL program --enable-bmp support loading BMP/ICO/CUR images [default=yes] --enable-gif support loading GIF images [default=yes] --enable-jpg support loading JPG images [default=yes] @@ -1590,6 +1589,7 @@ Optional Features: --enable-webpdec support loading WEBP images via libwebpdecoder instead of libwebp [default=no] --enable-webp-shared dynamically load WEBP support [[default=yes]] + --disable-sdltest Do not try to compile and run a test SDL program Optional Packages: --with-PACKAGE[=ARG] use PACKAGE [ARG=yes] @@ -1612,8 +1612,6 @@ Some influential environment variables: OBJC Objective C compiler command OBJCFLAGS Objective C compiler flags PKG_CONFIG path to pkg-config utility - SDL_CFLAGS C compiler flags for SDL, overriding pkg-config - SDL_LIBS linker flags for SDL, overriding pkg-config LIBPNG_CFLAGS C compiler flags for LIBPNG, overriding pkg-config LIBPNG_LIBS linker flags for LIBPNG, overriding pkg-config @@ -1621,6 +1619,8 @@ Some influential environment variables: C compiler flags for LIBWEBP, overriding pkg-config LIBWEBP_LIBS linker flags for LIBWEBP, overriding pkg-config + SDL_CFLAGS C compiler flags for SDL, overriding pkg-config + SDL_LIBS linker flags for SDL, overriding pkg-config Use these variables to override the choices made by `configure' or to help it to find libraries and programs with nonstandard names/locations. @@ -12214,8 +12214,217 @@ find_lib() done } -SDL_VERSION=2.0.8 +# Check whether --enable-bmp was given. +if test "${enable_bmp+set}" = set; then : + enableval=$enable_bmp; +else + enable_bmp=yes +fi + +# Check whether --enable-gif was given. +if test "${enable_gif+set}" = set; then : + enableval=$enable_gif; +else + enable_gif=yes +fi + +# Check whether --enable-jpg was given. +if test "${enable_jpg+set}" = set; then : + enableval=$enable_jpg; +else + enable_jpg=yes +fi + +# Check whether --enable-jpg-shared was given. +if test "${enable_jpg_shared+set}" = set; then : + enableval=$enable_jpg_shared; +else + enable_jpg_shared=yes +fi + +# Check whether --enable-lbm was given. +if test "${enable_lbm+set}" = set; then : + enableval=$enable_lbm; +else + enable_lbm=yes +fi + +# Check whether --enable-pcx was given. +if test "${enable_pcx+set}" = set; then : + enableval=$enable_pcx; +else + enable_pcx=yes +fi + +# Check whether --enable-png was given. +if test "${enable_png+set}" = set; then : + enableval=$enable_png; +else + enable_png=yes +fi + +# Check whether --enable-png-shared was given. +if test "${enable_png_shared+set}" = set; then : + enableval=$enable_png_shared; +else + enable_png_shared=yes +fi + +# Check whether --enable-pnm was given. +if test "${enable_pnm+set}" = set; then : + enableval=$enable_pnm; +else + enable_pnm=yes +fi + +# Check whether --enable-svg was given. +if test "${enable_svg+set}" = set; then : + enableval=$enable_svg; +else + enable_svg=yes +fi + +# Check whether --enable-tga was given. +if test "${enable_tga+set}" = set; then : + enableval=$enable_tga; +else + enable_tga=yes +fi + +# Check whether --enable-tif was given. +if test "${enable_tif+set}" = set; then : + enableval=$enable_tif; +else + enable_tif=yes +fi + +# Check whether --enable-tif-shared was given. +if test "${enable_tif_shared+set}" = set; then : + enableval=$enable_tif_shared; +else + enable_tif_shared=yes +fi + +# Check whether --enable-xcf was given. +if test "${enable_xcf+set}" = set; then : + enableval=$enable_xcf; +else + enable_xcf=yes +fi + +# Check whether --enable-xpm was given. +if test "${enable_xpm+set}" = set; then : + enableval=$enable_xpm; +else + enable_xpm=yes +fi + +# Check whether --enable-xv was given. +if test "${enable_xv+set}" = set; then : + enableval=$enable_xv; +else + enable_xv=yes +fi + +# Check whether --enable-webp was given. +if test "${enable_webp+set}" = set; then : + enableval=$enable_webp; +else + enable_webp=yes +fi + +# Check whether --enable-webpdec was given. +if test "${enable_webpdec+set}" = set; then : + enableval=$enable_webpdec; +else + enable_webpdec=no +fi + +# Check whether --enable-webp-shared was given. +if test "${enable_webp_shared+set}" = set; then : + enableval=$enable_webp_shared; +else + enable_webp_shared=yes +fi + + +if (test x$enable_jpg = xyes || test x$enable_tif = xyes) && test x$enable_imageio != xyes; then + ac_fn_c_check_header_mongrel "$LINENO" "jpeglib.h" "ac_cv_header_jpeglib_h" "$ac_includes_default" +if test "x$ac_cv_header_jpeglib_h" = x""yes; then : + have_jpg_hdr=yes +fi + + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for jpeg_CreateDecompress in -ljpeg" >&5 +$as_echo_n "checking for jpeg_CreateDecompress in -ljpeg... " >&6; } +if test "${ac_cv_lib_jpeg_jpeg_CreateDecompress+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-ljpeg $LIBS" +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char jpeg_CreateDecompress (); +int +main () +{ +return jpeg_CreateDecompress (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + ac_cv_lib_jpeg_jpeg_CreateDecompress=yes +else + ac_cv_lib_jpeg_jpeg_CreateDecompress=no +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_jpeg_jpeg_CreateDecompress" >&5 +$as_echo "$ac_cv_lib_jpeg_jpeg_CreateDecompress" >&6; } +if test "x$ac_cv_lib_jpeg_jpeg_CreateDecompress" = x""yes; then : + have_jpg_lib=yes +fi + + if test x$have_jpg_hdr = xyes -a x$have_jpg_lib = xyes; then + if test x$enable_jpg = xyes; then + $as_echo "#define LOAD_JPG 1" >>confdefs.h + + fi + LIBS="-ljpeg $LIBS" + + case "$host" in + *-*-darwin*) + jpg_lib=`find_lib libjpeg.dylib` + ;; + *-*-cygwin* | *-*-mingw32*) + jpg_lib=`find_lib "libjpeg*.dll"` + ;; + *) + jpg_lib=`find_lib "libjpeg[0-9]*.so.*"` + if test x$jpg_lib = x; then + jpg_lib=`find_lib "libjpeg.so.*"` + fi + ;; + esac + elif test x$enable_jpg = xyes; then + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: *** Unable to find JPEG library (http://www.ijg.org/)" >&5 +$as_echo "$as_me: WARNING: *** Unable to find JPEG library (http://www.ijg.org/)" >&2;} + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: JPG image loading disabled" >&5 +$as_echo "$as_me: WARNING: JPG image loading disabled" >&2;} + fi +fi +if test x$enable_png = xyes -a x$enable_imageio != xyes; then if test "x$ac_cv_env_PKG_CONFIG_set" != "xset"; then @@ -12333,66 +12542,39 @@ $as_echo "no" >&6; } fi -# Check whether --with-sdl-prefix was given. -if test "${with_sdl_prefix+set}" = set; then : - withval=$with_sdl_prefix; sdl_prefix="$withval" +pkg_failed=no +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for LIBPNG" >&5 +$as_echo_n "checking for LIBPNG... " >&6; } + +if test -n "$PKG_CONFIG"; then + if test -n "$LIBPNG_CFLAGS"; then + pkg_cv_LIBPNG_CFLAGS="$LIBPNG_CFLAGS" + else + if test -n "$PKG_CONFIG" && \ + { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"libpng\""; } >&5 + ($PKG_CONFIG --exists --print-errors "libpng") 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; then + pkg_cv_LIBPNG_CFLAGS=`$PKG_CONFIG --cflags "libpng" 2>/dev/null` else - sdl_prefix="" -fi - - -# Check whether --with-sdl-exec-prefix was given. -if test "${with_sdl_exec_prefix+set}" = set; then : - withval=$with_sdl_exec_prefix; sdl_exec_prefix="$withval" -else - sdl_exec_prefix="" -fi - -# Check whether --enable-sdltest was given. -if test "${enable_sdltest+set}" = set; then : - enableval=$enable_sdltest; -else - enable_sdltest=yes -fi - - - min_sdl_version=$SDL_VERSION - - if test "x$sdl_prefix$sdl_exec_prefix" = x ; then - -pkg_failed=no -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for SDL" >&5 -$as_echo_n "checking for SDL... " >&6; } - -if test -n "$PKG_CONFIG"; then - if test -n "$SDL_CFLAGS"; then - pkg_cv_SDL_CFLAGS="$SDL_CFLAGS" - else - if test -n "$PKG_CONFIG" && \ - { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"sdl2 >= \$min_sdl_version\""; } >&5 - ($PKG_CONFIG --exists --print-errors "sdl2 >= $min_sdl_version") 2>&5 - ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; }; then - pkg_cv_SDL_CFLAGS=`$PKG_CONFIG --cflags "sdl2 >= $min_sdl_version" 2>/dev/null` -else - pkg_failed=yes + pkg_failed=yes fi fi else pkg_failed=untried fi if test -n "$PKG_CONFIG"; then - if test -n "$SDL_LIBS"; then - pkg_cv_SDL_LIBS="$SDL_LIBS" + if test -n "$LIBPNG_LIBS"; then + pkg_cv_LIBPNG_LIBS="$LIBPNG_LIBS" else if test -n "$PKG_CONFIG" && \ - { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"sdl2 >= \$min_sdl_version\""; } >&5 - ($PKG_CONFIG --exists --print-errors "sdl2 >= $min_sdl_version") 2>&5 + { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"libpng\""; } >&5 + ($PKG_CONFIG --exists --print-errors "libpng") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then - pkg_cv_SDL_LIBS=`$PKG_CONFIG --libs "sdl2 >= $min_sdl_version" 2>/dev/null` + pkg_cv_LIBPNG_LIBS=`$PKG_CONFIG --libs "libpng" 2>/dev/null` else pkg_failed=yes fi @@ -12411,420 +12593,314 @@ else _pkg_short_errors_supported=no fi if test $_pkg_short_errors_supported = yes; then - SDL_PKG_ERRORS=`$PKG_CONFIG --short-errors --errors-to-stdout --print-errors "sdl2 >= $min_sdl_version"` + LIBPNG_PKG_ERRORS=`$PKG_CONFIG --short-errors --errors-to-stdout --print-errors "libpng"` else - SDL_PKG_ERRORS=`$PKG_CONFIG --errors-to-stdout --print-errors "sdl2 >= $min_sdl_version"` + LIBPNG_PKG_ERRORS=`$PKG_CONFIG --errors-to-stdout --print-errors "libpng"` fi # Put the nasty error message in config.log where it belongs - echo "$SDL_PKG_ERRORS" >&5 + echo "$LIBPNG_PKG_ERRORS" >&5 { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } - sdl_pc=no -elif test $pkg_failed = untried; then - sdl_pc=no -else - SDL_CFLAGS=$pkg_cv_SDL_CFLAGS - SDL_LIBS=$pkg_cv_SDL_LIBS - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } - sdl_pc=yes + ac_fn_c_check_header_mongrel "$LINENO" "png.h" "ac_cv_header_png_h" "$ac_includes_default" +if test "x$ac_cv_header_png_h" = x""yes; then : + + have_png_hdr=yes + LIBPNG_CFLAGS="" + fi - else - sdl_pc=no - if test x$sdl_exec_prefix != x ; then - sdl_config_args="$sdl_config_args --exec-prefix=$sdl_exec_prefix" - if test x${SDL2_CONFIG+set} != xset ; then - SDL2_CONFIG=$sdl_exec_prefix/bin/sdl2-config - fi - fi - if test x$sdl_prefix != x ; then - sdl_config_args="$sdl_config_args --prefix=$sdl_prefix" - if test x${SDL2_CONFIG+set} != xset ; then - SDL2_CONFIG=$sdl_prefix/bin/sdl2-config - fi - fi - fi - if test "x$sdl_pc" = xyes ; then - no_sdl="" - SDL2_CONFIG="pkg-config sdl2" - else - as_save_PATH="$PATH" - if test "x$prefix" != xNONE && test "$cross_compiling" != yes; then - PATH="$prefix/bin:$prefix/usr/bin:$PATH" - fi - # Extract the first word of "sdl2-config", so it can be a program name with args. -set dummy sdl2-config; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if test "${ac_cv_path_SDL2_CONFIG+set}" = set; then : + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for png_create_read_struct in -lpng" >&5 +$as_echo_n "checking for png_create_read_struct in -lpng... " >&6; } +if test "${ac_cv_lib_png_png_create_read_struct+set}" = set; then : $as_echo_n "(cached) " >&6 else - case $SDL2_CONFIG in - [\\/]* | ?:[\\/]*) - ac_cv_path_SDL2_CONFIG="$SDL2_CONFIG" # Let the user override the test with a path. - ;; - *) - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then - ac_cv_path_SDL2_CONFIG="$as_dir/$ac_word$ac_exec_ext" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS + ac_check_lib_save_LIBS=$LIBS +LIBS="-lpng -lz $LIBS" +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ - test -z "$ac_cv_path_SDL2_CONFIG" && ac_cv_path_SDL2_CONFIG="no" - ;; -esac -fi -SDL2_CONFIG=$ac_cv_path_SDL2_CONFIG -if test -n "$SDL2_CONFIG"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $SDL2_CONFIG" >&5 -$as_echo "$SDL2_CONFIG" >&6; } +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char png_create_read_struct (); +int +main () +{ +return png_create_read_struct (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + ac_cv_lib_png_png_create_read_struct=yes else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + ac_cv_lib_png_png_create_read_struct=no fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_png_png_create_read_struct" >&5 +$as_echo "$ac_cv_lib_png_png_create_read_struct" >&6; } +if test "x$ac_cv_lib_png_png_create_read_struct" = x""yes; then : + + have_png_lib=yes + LIBPNG_LIBS="-lpng -lz" +fi - PATH="$as_save_PATH" - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for SDL - version >= $min_sdl_version" >&5 -$as_echo_n "checking for SDL - version >= $min_sdl_version... " >&6; } - no_sdl="" - if test "$SDL2_CONFIG" = "no" ; then - no_sdl=yes - else - SDL_CFLAGS=`$SDL2_CONFIG $sdl_config_args --cflags` - SDL_LIBS=`$SDL2_CONFIG $sdl_config_args --libs` +elif test $pkg_failed = untried; then + ac_fn_c_check_header_mongrel "$LINENO" "png.h" "ac_cv_header_png_h" "$ac_includes_default" +if test "x$ac_cv_header_png_h" = x""yes; then : - sdl_major_version=`$SDL2_CONFIG $sdl_config_args --version | \ - sed 's/\([0-9]*\).\([0-9]*\).\([0-9]*\)/\1/'` - sdl_minor_version=`$SDL2_CONFIG $sdl_config_args --version | \ - sed 's/\([0-9]*\).\([0-9]*\).\([0-9]*\)/\2/'` - sdl_micro_version=`$SDL2_CONFIG $sdl_config_args --version | \ - sed 's/\([0-9]*\).\([0-9]*\).\([0-9]*\)/\3/'` - if test "x$enable_sdltest" = "xyes" ; then - ac_save_CFLAGS="$CFLAGS" - ac_save_CXXFLAGS="$CXXFLAGS" - ac_save_LIBS="$LIBS" - CFLAGS="$CFLAGS $SDL_CFLAGS" - CXXFLAGS="$CXXFLAGS $SDL_CFLAGS" - LIBS="$LIBS $SDL_LIBS" - rm -f conf.sdltest - if test "$cross_compiling" = yes; then : - echo $ac_n "cross compiling; assumed OK... $ac_c" + have_png_hdr=yes + LIBPNG_CFLAGS="" + +fi + + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for png_create_read_struct in -lpng" >&5 +$as_echo_n "checking for png_create_read_struct in -lpng... " >&6; } +if test "${ac_cv_lib_png_png_create_read_struct+set}" = set; then : + $as_echo_n "(cached) " >&6 else - cat confdefs.h - <<_ACEOF >conftest.$ac_ext + ac_check_lib_save_LIBS=$LIBS +LIBS="-lpng -lz $LIBS" +cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ -#include -#include -#include -#include "SDL.h" - -char* -my_strdup (char *str) +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char png_create_read_struct (); +int +main () { - char *new_str; +return png_create_read_struct (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + ac_cv_lib_png_png_create_read_struct=yes +else + ac_cv_lib_png_png_create_read_struct=no +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_png_png_create_read_struct" >&5 +$as_echo "$ac_cv_lib_png_png_create_read_struct" >&6; } +if test "x$ac_cv_lib_png_png_create_read_struct" = x""yes; then : - if (str) - { - new_str = (char *)malloc ((strlen (str) + 1) * sizeof(char)); - strcpy (new_str, str); - } - else - new_str = NULL; + have_png_lib=yes + LIBPNG_LIBS="-lpng -lz" - return new_str; -} +fi -int main (int argc, char *argv[]) -{ - int major, minor, micro; - char *tmp_version; - - /* This hangs on some systems (?) - system ("touch conf.sdltest"); - */ - { FILE *fp = fopen("conf.sdltest", "a"); if ( fp ) fclose(fp); } - - /* HP/UX 9 (%@#!) writes to sscanf strings */ - tmp_version = my_strdup("$min_sdl_version"); - if (sscanf(tmp_version, "%d.%d.%d", &major, &minor, µ) != 3) { - printf("%s, bad version string\n", "$min_sdl_version"); - exit(1); - } - - if (($sdl_major_version > major) || - (($sdl_major_version == major) && ($sdl_minor_version > minor)) || - (($sdl_major_version == major) && ($sdl_minor_version == minor) && ($sdl_micro_version >= micro))) - { - return 0; - } - else - { - printf("\n*** 'sdl2-config --version' returned %d.%d.%d, but the minimum version\n", $sdl_major_version, $sdl_minor_version, $sdl_micro_version); - printf("*** of SDL required is %d.%d.%d. If sdl2-config is correct, then it is\n", major, minor, micro); - printf("*** best to upgrade to the required version.\n"); - printf("*** If sdl2-config was wrong, set the environment variable SDL2_CONFIG\n"); - printf("*** to point to the correct copy of sdl2-config, and remove the file\n"); - printf("*** config.cache before re-running configure\n"); - return 1; - } -} - - -_ACEOF -if ac_fn_c_try_run "$LINENO"; then : else - no_sdl=yes -fi -rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ - conftest.$ac_objext conftest.beam conftest.$ac_ext + LIBPNG_CFLAGS=$pkg_cv_LIBPNG_CFLAGS + LIBPNG_LIBS=$pkg_cv_LIBPNG_LIBS + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } + have_png_hdr=yes + have_png_lib=yes + fi + if test x$have_png_hdr = xyes -a x$have_png_lib = xyes; then + $as_echo "#define LOAD_PNG 1" >>confdefs.h - CFLAGS="$ac_save_CFLAGS" - CXXFLAGS="$ac_save_CXXFLAGS" - LIBS="$ac_save_LIBS" - fi - fi - if test "x$no_sdl" = x ; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } + + case "$host" in + *-*-darwin*) + png_lib=`find_lib libpng.dylib` + ;; + *-*-cygwin* | *-*-mingw32*) + png_lib=`find_lib "libpng*.dll"` + ;; + *) + png_lib=`find_lib "libpng[0-9]*.so.*"` + if test x$png_lib = x; then + png_lib=`find_lib "libpng.so.*"` + fi + ;; + esac else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: *** Unable to find PNG library (http://www.libpng.org/pub/png/libpng.html)" >&5 +$as_echo "$as_me: WARNING: *** Unable to find PNG library (http://www.libpng.org/pub/png/libpng.html)" >&2;} + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: PNG image loading disabled" >&5 +$as_echo "$as_me: WARNING: PNG image loading disabled" >&2;} fi - fi - if test "x$no_sdl" = x ; then - : - else - if test "$SDL2_CONFIG" = "no" ; then - echo "*** The sdl2-config script installed by SDL could not be found" - echo "*** If SDL was installed in PREFIX, make sure PREFIX/bin is in" - echo "*** your path, or set the SDL2_CONFIG environment variable to the" - echo "*** full path to sdl2-config." - else - if test -f conf.sdltest ; then - : - else - echo "*** Could not run SDL test program, checking why..." - CFLAGS="$CFLAGS $SDL_CFLAGS" - CXXFLAGS="$CXXFLAGS $SDL_CFLAGS" - LIBS="$LIBS $SDL_LIBS" - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ +fi -#include -#include "SDL.h" +if test x$enable_tif = xyes -a x$enable_imageio != xyes; then + ac_fn_c_check_header_mongrel "$LINENO" "tiffio.h" "ac_cv_header_tiffio_h" "$ac_includes_default" +if test "x$ac_cv_header_tiffio_h" = x""yes; then : + have_tif_hdr=yes +fi -int main(int argc, char *argv[]) -{ return 0; } -#undef main -#define main K_and_R_C_main + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for TIFFClientOpen in -ltiff" >&5 +$as_echo_n "checking for TIFFClientOpen in -ltiff... " >&6; } +if test "${ac_cv_lib_tiff_TIFFClientOpen+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-ltiff -lz $LIBS" +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char TIFFClientOpen (); int main () { - return 0; +return TIFFClientOpen (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : - echo "*** The test program compiled, but did not run. This usually means" - echo "*** that the run-time linker is not finding SDL or finding the wrong" - echo "*** version of SDL. If it is not finding SDL, you'll need to set your" - echo "*** LD_LIBRARY_PATH environment variable, or edit /etc/ld.so.conf to point" - echo "*** to the installed location Also, make sure you have run ldconfig if that" - echo "*** is required on your system" - echo "***" - echo "*** If you have an old version installed, it is best to remove it, although" - echo "*** you may also be able to get things to work by modifying LD_LIBRARY_PATH" + ac_cv_lib_tiff_TIFFClientOpen=yes else - echo "*** The test program failed to compile or link. See the file config.log for the" - echo "*** exact error that occured. This usually means SDL was incorrectly installed" - echo "*** or that you have moved SDL since it was installed. In the latter case, you" - echo "*** may want to edit the sdl2-config script: $SDL2_CONFIG" + ac_cv_lib_tiff_TIFFClientOpen=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext - CFLAGS="$ac_save_CFLAGS" - CXXFLAGS="$ac_save_CXXFLAGS" - LIBS="$ac_save_LIBS" - fi - fi - SDL_CFLAGS="" - SDL_LIBS="" - as_fn_error "*** SDL version $SDL_VERSION not found!" "$LINENO" 5 - - fi - +LIBS=$ac_check_lib_save_LIBS +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_tiff_TIFFClientOpen" >&5 +$as_echo "$ac_cv_lib_tiff_TIFFClientOpen" >&6; } +if test "x$ac_cv_lib_tiff_TIFFClientOpen" = x""yes; then : + have_tif_lib=yes +fi - rm -f conf.sdltest + if test x$have_tif_hdr = xyes -a x$have_tif_lib = xyes; then + $as_echo "#define LOAD_TIF 1" >>confdefs.h -CFLAGS="$CFLAGS $SDL_CFLAGS" -LIBS="$LIBS $SDL_LIBS" -saved_LIBS="$LIBS" -# Check whether --enable-bmp was given. -if test "${enable_bmp+set}" = set; then : - enableval=$enable_bmp; -else - enable_bmp=yes + case "$host" in + *-*-darwin*) + tif_lib=`find_lib libtiff.dylib` + ;; + *-*-cygwin* | *-*-mingw32*) + tif_lib=`find_lib "libtiff-*.dll"` + ;; + *) + tif_lib=`find_lib "libtiff[0-9]*.so.*"` + if test x$tif_lib = x; then + tif_lib=`find_lib "libtiff.so.*"` + fi + ;; + esac + else + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: *** Unable to find Tiff library (http://www.remotesensing.org/libtiff/)" >&5 +$as_echo "$as_me: WARNING: *** Unable to find Tiff library (http://www.remotesensing.org/libtiff/)" >&2;} + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: TIF image loading disabled" >&5 +$as_echo "$as_me: WARNING: TIF image loading disabled" >&2;} + fi fi -# Check whether --enable-gif was given. -if test "${enable_gif+set}" = set; then : - enableval=$enable_gif; +if test x$enable_webpdec = xyes; then + webplib=webpdecoder else - enable_gif=yes + webplib=webp fi +if test x$enable_webp = xyes; then -# Check whether --enable-jpg was given. -if test "${enable_jpg+set}" = set; then : - enableval=$enable_jpg; -else - enable_jpg=yes -fi +pkg_failed=no +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for LIBWEBP" >&5 +$as_echo_n "checking for LIBWEBP... " >&6; } -# Check whether --enable-jpg-shared was given. -if test "${enable_jpg_shared+set}" = set; then : - enableval=$enable_jpg_shared; +if test -n "$PKG_CONFIG"; then + if test -n "$LIBWEBP_CFLAGS"; then + pkg_cv_LIBWEBP_CFLAGS="$LIBWEBP_CFLAGS" + else + if test -n "$PKG_CONFIG" && \ + { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"lib\$webplib\""; } >&5 + ($PKG_CONFIG --exists --print-errors "lib$webplib") 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; then + pkg_cv_LIBWEBP_CFLAGS=`$PKG_CONFIG --cflags "lib$webplib" 2>/dev/null` else - enable_jpg_shared=yes + pkg_failed=yes fi - -# Check whether --enable-lbm was given. -if test "${enable_lbm+set}" = set; then : - enableval=$enable_lbm; + fi else - enable_lbm=yes + pkg_failed=untried fi - -# Check whether --enable-pcx was given. -if test "${enable_pcx+set}" = set; then : - enableval=$enable_pcx; +if test -n "$PKG_CONFIG"; then + if test -n "$LIBWEBP_LIBS"; then + pkg_cv_LIBWEBP_LIBS="$LIBWEBP_LIBS" + else + if test -n "$PKG_CONFIG" && \ + { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"lib\$webplib\""; } >&5 + ($PKG_CONFIG --exists --print-errors "lib$webplib") 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; then + pkg_cv_LIBWEBP_LIBS=`$PKG_CONFIG --libs "lib$webplib" 2>/dev/null` else - enable_pcx=yes + pkg_failed=yes fi - -# Check whether --enable-png was given. -if test "${enable_png+set}" = set; then : - enableval=$enable_png; + fi else - enable_png=yes + pkg_failed=untried fi -# Check whether --enable-png-shared was given. -if test "${enable_png_shared+set}" = set; then : - enableval=$enable_png_shared; -else - enable_png_shared=yes -fi - -# Check whether --enable-pnm was given. -if test "${enable_pnm+set}" = set; then : - enableval=$enable_pnm; -else - enable_pnm=yes -fi - -# Check whether --enable-svg was given. -if test "${enable_svg+set}" = set; then : - enableval=$enable_svg; -else - enable_svg=yes -fi - -# Check whether --enable-tga was given. -if test "${enable_tga+set}" = set; then : - enableval=$enable_tga; -else - enable_tga=yes -fi - -# Check whether --enable-tif was given. -if test "${enable_tif+set}" = set; then : - enableval=$enable_tif; -else - enable_tif=yes -fi - -# Check whether --enable-tif-shared was given. -if test "${enable_tif_shared+set}" = set; then : - enableval=$enable_tif_shared; -else - enable_tif_shared=yes -fi - -# Check whether --enable-xcf was given. -if test "${enable_xcf+set}" = set; then : - enableval=$enable_xcf; -else - enable_xcf=yes -fi - -# Check whether --enable-xpm was given. -if test "${enable_xpm+set}" = set; then : - enableval=$enable_xpm; -else - enable_xpm=yes -fi -# Check whether --enable-xv was given. -if test "${enable_xv+set}" = set; then : - enableval=$enable_xv; -else - enable_xv=yes -fi -# Check whether --enable-webp was given. -if test "${enable_webp+set}" = set; then : - enableval=$enable_webp; -else - enable_webp=yes -fi +if test $pkg_failed = yes; then -# Check whether --enable-webpdec was given. -if test "${enable_webpdec+set}" = set; then : - enableval=$enable_webpdec; +if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then + _pkg_short_errors_supported=yes else - enable_webpdec=no + _pkg_short_errors_supported=no fi + if test $_pkg_short_errors_supported = yes; then + LIBWEBP_PKG_ERRORS=`$PKG_CONFIG --short-errors --errors-to-stdout --print-errors "lib$webplib"` + else + LIBWEBP_PKG_ERRORS=`$PKG_CONFIG --errors-to-stdout --print-errors "lib$webplib"` + fi + # Put the nasty error message in config.log where it belongs + echo "$LIBWEBP_PKG_ERRORS" >&5 -# Check whether --enable-webp-shared was given. -if test "${enable_webp_shared+set}" = set; then : - enableval=$enable_webp_shared; -else - enable_webp_shared=yes -fi + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } + ac_fn_c_check_header_mongrel "$LINENO" "webp/decode.h" "ac_cv_header_webp_decode_h" "$ac_includes_default" +if test "x$ac_cv_header_webp_decode_h" = x""yes; then : + have_webp_hdr=yes + LIBWEBP_CFLAGS="" -if (test x$enable_jpg = xyes || test x$enable_tif = xyes) && test x$enable_imageio != xyes; then - ac_fn_c_check_header_mongrel "$LINENO" "jpeglib.h" "ac_cv_header_jpeglib_h" "$ac_includes_default" -if test "x$ac_cv_header_jpeglib_h" = x""yes; then : - have_jpg_hdr=yes fi - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for jpeg_CreateDecompress in -ljpeg" >&5 -$as_echo_n "checking for jpeg_CreateDecompress in -ljpeg... " >&6; } -if test "${ac_cv_lib_jpeg_jpeg_CreateDecompress+set}" = set; then : + as_ac_Lib=`$as_echo "ac_cv_lib_$webplib''_WebPGetDecoderVersion" | $as_tr_sh` +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for WebPGetDecoderVersion in -l$webplib" >&5 +$as_echo_n "checking for WebPGetDecoderVersion in -l$webplib... " >&6; } +if { as_var=$as_ac_Lib; eval "test \"\${$as_var+set}\" = set"; }; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS -LIBS="-ljpeg $LIBS" +LIBS="-l$webplib -lm $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ @@ -12834,137 +12910,54 @@ cat confdefs.h - <<_ACEOF >conftest.$ac_ext #ifdef __cplusplus extern "C" #endif -char jpeg_CreateDecompress (); +char WebPGetDecoderVersion (); int main () { -return jpeg_CreateDecompress (); +return WebPGetDecoderVersion (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : - ac_cv_lib_jpeg_jpeg_CreateDecompress=yes + eval "$as_ac_Lib=yes" else - ac_cv_lib_jpeg_jpeg_CreateDecompress=no + eval "$as_ac_Lib=no" fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_jpeg_jpeg_CreateDecompress" >&5 -$as_echo "$ac_cv_lib_jpeg_jpeg_CreateDecompress" >&6; } -if test "x$ac_cv_lib_jpeg_jpeg_CreateDecompress" = x""yes; then : - have_jpg_lib=yes -fi - - if test x$have_jpg_hdr = xyes -a x$have_jpg_lib = xyes; then - if test x$enable_jpg = xyes; then - $as_echo "#define LOAD_JPG 1" >>confdefs.h - - fi - LIBS="-ljpeg $LIBS" - - case "$host" in - *-*-darwin*) - jpg_lib=`find_lib libjpeg.dylib` - ;; - *-*-cygwin* | *-*-mingw32*) - jpg_lib=`find_lib "libjpeg*.dll"` - ;; - *) - jpg_lib=`find_lib "libjpeg[0-9]*.so.*"` - if test x$jpg_lib = x; then - jpg_lib=`find_lib "libjpeg.so.*"` - fi - ;; - esac - elif test x$enable_jpg = xyes; then - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: *** Unable to find JPEG library (http://www.ijg.org/)" >&5 -$as_echo "$as_me: WARNING: *** Unable to find JPEG library (http://www.ijg.org/)" >&2;} - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: JPG image loading disabled" >&5 -$as_echo "$as_me: WARNING: JPG image loading disabled" >&2;} - fi -fi - -if test x$enable_png = xyes -a x$enable_imageio != xyes; then +eval ac_res=\$$as_ac_Lib + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 +$as_echo "$ac_res" >&6; } +eval as_val=\$$as_ac_Lib + if test "x$as_val" = x""yes; then : -pkg_failed=no -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for LIBPNG" >&5 -$as_echo_n "checking for LIBPNG... " >&6; } + have_webp_lib=yes + LIBWEBP_LIBS="-l$webplib" -if test -n "$PKG_CONFIG"; then - if test -n "$LIBPNG_CFLAGS"; then - pkg_cv_LIBPNG_CFLAGS="$LIBPNG_CFLAGS" - else - if test -n "$PKG_CONFIG" && \ - { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"libpng\""; } >&5 - ($PKG_CONFIG --exists --print-errors "libpng") 2>&5 - ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; }; then - pkg_cv_LIBPNG_CFLAGS=`$PKG_CONFIG --cflags "libpng" 2>/dev/null` -else - pkg_failed=yes -fi - fi -else - pkg_failed=untried -fi -if test -n "$PKG_CONFIG"; then - if test -n "$LIBPNG_LIBS"; then - pkg_cv_LIBPNG_LIBS="$LIBPNG_LIBS" - else - if test -n "$PKG_CONFIG" && \ - { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"libpng\""; } >&5 - ($PKG_CONFIG --exists --print-errors "libpng") 2>&5 - ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; }; then - pkg_cv_LIBPNG_LIBS=`$PKG_CONFIG --libs "libpng" 2>/dev/null` -else - pkg_failed=yes -fi - fi -else - pkg_failed=untried fi +elif test $pkg_failed = untried; then + ac_fn_c_check_header_mongrel "$LINENO" "webp/decode.h" "ac_cv_header_webp_decode_h" "$ac_includes_default" +if test "x$ac_cv_header_webp_decode_h" = x""yes; then : -if test $pkg_failed = yes; then - -if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then - _pkg_short_errors_supported=yes -else - _pkg_short_errors_supported=no -fi - if test $_pkg_short_errors_supported = yes; then - LIBPNG_PKG_ERRORS=`$PKG_CONFIG --short-errors --errors-to-stdout --print-errors "libpng"` - else - LIBPNG_PKG_ERRORS=`$PKG_CONFIG --errors-to-stdout --print-errors "libpng"` - fi - # Put the nasty error message in config.log where it belongs - echo "$LIBPNG_PKG_ERRORS" >&5 - - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } - ac_fn_c_check_header_mongrel "$LINENO" "png.h" "ac_cv_header_png_h" "$ac_includes_default" -if test "x$ac_cv_header_png_h" = x""yes; then : - - have_png_hdr=yes - LIBPNG_CFLAGS="" + have_webp_hdr=yes + LIBWEBP_CFLAGS="" fi - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for png_create_read_struct in -lpng" >&5 -$as_echo_n "checking for png_create_read_struct in -lpng... " >&6; } -if test "${ac_cv_lib_png_png_create_read_struct+set}" = set; then : + as_ac_Lib=`$as_echo "ac_cv_lib_$webplib''_WebPGetDecoderVersion" | $as_tr_sh` +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for WebPGetDecoderVersion in -l$webplib" >&5 +$as_echo_n "checking for WebPGetDecoderVersion in -l$webplib... " >&6; } +if { as_var=$as_ac_Lib; eval "test \"\${$as_var+set}\" = set"; }; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS -LIBS="-lpng -lz $LIBS" +LIBS="-l$webplib -lm $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ @@ -12974,514 +12967,518 @@ cat confdefs.h - <<_ACEOF >conftest.$ac_ext #ifdef __cplusplus extern "C" #endif -char png_create_read_struct (); +char WebPGetDecoderVersion (); int main () { -return png_create_read_struct (); +return WebPGetDecoderVersion (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : - ac_cv_lib_png_png_create_read_struct=yes + eval "$as_ac_Lib=yes" else - ac_cv_lib_png_png_create_read_struct=no + eval "$as_ac_Lib=no" fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_png_png_create_read_struct" >&5 -$as_echo "$ac_cv_lib_png_png_create_read_struct" >&6; } -if test "x$ac_cv_lib_png_png_create_read_struct" = x""yes; then : +eval ac_res=\$$as_ac_Lib + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 +$as_echo "$ac_res" >&6; } +eval as_val=\$$as_ac_Lib + if test "x$as_val" = x""yes; then : - have_png_lib=yes - LIBPNG_LIBS="-lpng -lz" - -fi - - -elif test $pkg_failed = untried; then - ac_fn_c_check_header_mongrel "$LINENO" "png.h" "ac_cv_header_png_h" "$ac_includes_default" -if test "x$ac_cv_header_png_h" = x""yes; then : - - have_png_hdr=yes - LIBPNG_CFLAGS="" - -fi - - - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for png_create_read_struct in -lpng" >&5 -$as_echo_n "checking for png_create_read_struct in -lpng... " >&6; } -if test "${ac_cv_lib_png_png_create_read_struct+set}" = set; then : - $as_echo_n "(cached) " >&6 -else - ac_check_lib_save_LIBS=$LIBS -LIBS="-lpng -lz $LIBS" -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -/* Override any GCC internal prototype to avoid an error. - Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif -char png_create_read_struct (); -int -main () -{ -return png_create_read_struct (); - ; - return 0; -} -_ACEOF -if ac_fn_c_try_link "$LINENO"; then : - ac_cv_lib_png_png_create_read_struct=yes -else - ac_cv_lib_png_png_create_read_struct=no -fi -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext -LIBS=$ac_check_lib_save_LIBS -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_png_png_create_read_struct" >&5 -$as_echo "$ac_cv_lib_png_png_create_read_struct" >&6; } -if test "x$ac_cv_lib_png_png_create_read_struct" = x""yes; then : - - have_png_lib=yes - LIBPNG_LIBS="-lpng -lz" + have_webp_lib=yes + LIBWEBP_LIBS="-l$webplib" fi else - LIBPNG_CFLAGS=$pkg_cv_LIBPNG_CFLAGS - LIBPNG_LIBS=$pkg_cv_LIBPNG_LIBS + LIBWEBP_CFLAGS=$pkg_cv_LIBWEBP_CFLAGS + LIBWEBP_LIBS=$pkg_cv_LIBWEBP_LIBS { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } - have_png_hdr=yes - have_png_lib=yes + have_webp_hdr=yes + have_webp_lib=yes fi - if test x$have_png_hdr = xyes -a x$have_png_lib = xyes; then - $as_echo "#define LOAD_PNG 1" >>confdefs.h + if test x$have_webp_hdr = xyes -a x$have_webp_lib = xyes; then + $as_echo "#define LOAD_WEBP 1" >>confdefs.h case "$host" in *-*-darwin*) - png_lib=`find_lib libpng.dylib` + webp_lib=`find_lib lib$webplib.dylib` ;; *-*-cygwin* | *-*-mingw32*) - png_lib=`find_lib "libpng*.dll"` + webp_lib=`find_lib "lib$webplib-*.dll"` ;; *) - png_lib=`find_lib "libpng[0-9]*.so.*"` - if test x$png_lib = x; then - png_lib=`find_lib "libpng.so.*"` + webp_lib=`find_lib "lib$webplib[0-9]*.so.*"` + if test x$webp_lib = x; then + webp_lib=`find_lib "lib$webplib.so.*"` fi ;; esac else - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: *** Unable to find PNG library (http://www.libpng.org/pub/png/libpng.html)" >&5 -$as_echo "$as_me: WARNING: *** Unable to find PNG library (http://www.libpng.org/pub/png/libpng.html)" >&2;} - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: PNG image loading disabled" >&5 -$as_echo "$as_me: WARNING: PNG image loading disabled" >&2;} + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: *** Unable to find WEBP library (http://code.google.com/intl/en-US/speed/webp/index.html)" >&5 +$as_echo "$as_me: WARNING: *** Unable to find WEBP library (http://code.google.com/intl/en-US/speed/webp/index.html)" >&2;} + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: WEBP Pimage loading disabled" >&5 +$as_echo "$as_me: WARNING: WEBP Pimage loading disabled" >&2;} fi fi -if test x$enable_tif = xyes -a x$enable_imageio != xyes; then - ac_fn_c_check_header_mongrel "$LINENO" "tiffio.h" "ac_cv_header_tiffio_h" "$ac_includes_default" -if test "x$ac_cv_header_tiffio_h" = x""yes; then : - have_tif_hdr=yes +if test x$enable_bmp = xyes; then + $as_echo "#define LOAD_BMP 1" >>confdefs.h + fi +if test x$enable_gif = xyes; then + $as_echo "#define LOAD_GIF 1" >>confdefs.h - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for TIFFClientOpen in -ltiff" >&5 -$as_echo_n "checking for TIFFClientOpen in -ltiff... " >&6; } -if test "${ac_cv_lib_tiff_TIFFClientOpen+set}" = set; then : - $as_echo_n "(cached) " >&6 -else - ac_check_lib_save_LIBS=$LIBS -LIBS="-ltiff -lz $LIBS" -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ +fi + +if test x$enable_lbm = xyes; then + $as_echo "#define LOAD_LBM 1" >>confdefs.h -/* Override any GCC internal prototype to avoid an error. - Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif -char TIFFClientOpen (); -int -main () -{ -return TIFFClientOpen (); - ; - return 0; -} -_ACEOF -if ac_fn_c_try_link "$LINENO"; then : - ac_cv_lib_tiff_TIFFClientOpen=yes -else - ac_cv_lib_tiff_TIFFClientOpen=no fi -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext -LIBS=$ac_check_lib_save_LIBS + +if test x$enable_pcx = xyes; then + $as_echo "#define LOAD_PCX 1" >>confdefs.h + fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_tiff_TIFFClientOpen" >&5 -$as_echo "$ac_cv_lib_tiff_TIFFClientOpen" >&6; } -if test "x$ac_cv_lib_tiff_TIFFClientOpen" = x""yes; then : - have_tif_lib=yes + +if test x$enable_pnm = xyes; then + $as_echo "#define LOAD_PNM 1" >>confdefs.h + fi - if test x$have_tif_hdr = xyes -a x$have_tif_lib = xyes; then - $as_echo "#define LOAD_TIF 1" >>confdefs.h +if test x$enable_svg = xyes; then + $as_echo "#define LOAD_SVG 1" >>confdefs.h +fi + +if test x$enable_tga = xyes; then + $as_echo "#define LOAD_TGA 1" >>confdefs.h - case "$host" in - *-*-darwin*) - tif_lib=`find_lib libtiff.dylib` - ;; - *-*-cygwin* | *-*-mingw32*) - tif_lib=`find_lib "libtiff-*.dll"` - ;; - *) - tif_lib=`find_lib "libtiff[0-9]*.so.*"` - if test x$tif_lib = x; then - tif_lib=`find_lib "libtiff.so.*"` - fi - ;; - esac - else - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: *** Unable to find Tiff library (http://www.remotesensing.org/libtiff/)" >&5 -$as_echo "$as_me: WARNING: *** Unable to find Tiff library (http://www.remotesensing.org/libtiff/)" >&2;} - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: TIF image loading disabled" >&5 -$as_echo "$as_me: WARNING: TIF image loading disabled" >&2;} - fi fi -if test x$enable_webpdec = xyes; then - webplib=webpdecoder -else - webplib=webp +if test x$enable_xcf = xyes; then + $as_echo "#define LOAD_XCF 1" >>confdefs.h + fi -if test x$enable_webp = xyes; then -pkg_failed=no -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for LIBWEBP" >&5 -$as_echo_n "checking for LIBWEBP... " >&6; } +if test x$enable_xpm = xyes; then + $as_echo "#define LOAD_XPM 1" >>confdefs.h + +fi + +if test x$enable_xv = xyes; then + $as_echo "#define LOAD_XV 1" >>confdefs.h -if test -n "$PKG_CONFIG"; then - if test -n "$LIBWEBP_CFLAGS"; then - pkg_cv_LIBWEBP_CFLAGS="$LIBWEBP_CFLAGS" - else - if test -n "$PKG_CONFIG" && \ - { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"lib\$webplib\""; } >&5 - ($PKG_CONFIG --exists --print-errors "lib$webplib") 2>&5 - ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; }; then - pkg_cv_LIBWEBP_CFLAGS=`$PKG_CONFIG --cflags "lib$webplib" 2>/dev/null` -else - pkg_failed=yes fi + +if test x$enable_webp = xyes -a x$have_webp_hdr = xyes -a x$have_webp_lib = xyes; then + CFLAGS="$LIBWEBP_CFLAGS $CFLAGS" + if test x$enable_webp_shared = xyes && test x$webp_lib != x; then + echo "-- dynamic libwebp -> $webp_lib" + cat >>confdefs.h <<_ACEOF +#define LOAD_WEBP_DYNAMIC "$webp_lib" +_ACEOF + + else + IMG_LIBS="$LIBWEBP_LIBS $IMG_LIBS" fi -else - pkg_failed=untried fi -if test -n "$PKG_CONFIG"; then - if test -n "$LIBWEBP_LIBS"; then - pkg_cv_LIBWEBP_LIBS="$LIBWEBP_LIBS" + +if test x$enable_tif = xyes -a x$have_tif_hdr = xyes -a x$have_tif_lib = xyes; then + if test x$enable_tif_shared = xyes && test x$tif_lib != x; then + echo "-- dynamic libtiff -> $tif_lib" + cat >>confdefs.h <<_ACEOF +#define LOAD_TIF_DYNAMIC "$tif_lib" +_ACEOF + else - if test -n "$PKG_CONFIG" && \ - { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"lib\$webplib\""; } >&5 - ($PKG_CONFIG --exists --print-errors "lib$webplib") 2>&5 - ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; }; then - pkg_cv_LIBWEBP_LIBS=`$PKG_CONFIG --libs "lib$webplib" 2>/dev/null` -else - pkg_failed=yes + if test x$have_libjpeg = xyes; then + # Disable dynamic jpeg since we're linking it explicitly + jpg_lib='' + fi + IMG_LIBS="-ltiff -lz $IMG_LIBS" + fi fi +if test x$enable_jpg = xyes -a x$have_jpg_hdr = xyes -a x$have_jpg_lib = xyes; then + if test x$enable_jpg_shared = xyes && test x$jpg_lib != x; then + echo "-- dynamic libjpeg -> $jpg_lib" + cat >>confdefs.h <<_ACEOF +#define LOAD_JPG_DYNAMIC "$jpg_lib" +_ACEOF + + else + IMG_LIBS="-ljpeg $IMG_LIBS" fi -else - pkg_failed=untried fi +if test x$enable_png = xyes -a x$have_png_hdr = xyes -a x$have_png_lib = xyes; then + CFLAGS="$LIBPNG_CFLAGS $CFLAGS" + if test x$enable_png_shared = xyes && test x$png_lib != x; then + echo "-- dynamic libpng -> $png_lib" + cat >>confdefs.h <<_ACEOF +#define LOAD_PNG_DYNAMIC "$png_lib" +_ACEOF + else + IMG_LIBS="$LIBPNG_LIBS $IMG_LIBS" + fi +fi +SDL_VERSION=2.0.8 -if test $pkg_failed = yes; then -if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then - _pkg_short_errors_supported=yes +# Check whether --with-sdl-prefix was given. +if test "${with_sdl_prefix+set}" = set; then : + withval=$with_sdl_prefix; sdl_prefix="$withval" else - _pkg_short_errors_supported=no -fi - if test $_pkg_short_errors_supported = yes; then - LIBWEBP_PKG_ERRORS=`$PKG_CONFIG --short-errors --errors-to-stdout --print-errors "lib$webplib"` - else - LIBWEBP_PKG_ERRORS=`$PKG_CONFIG --errors-to-stdout --print-errors "lib$webplib"` - fi - # Put the nasty error message in config.log where it belongs - echo "$LIBWEBP_PKG_ERRORS" >&5 - - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } - ac_fn_c_check_header_mongrel "$LINENO" "webp/decode.h" "ac_cv_header_webp_decode_h" "$ac_includes_default" -if test "x$ac_cv_header_webp_decode_h" = x""yes; then : - - have_webp_hdr=yes - LIBWEBP_CFLAGS="" - + sdl_prefix="" fi - as_ac_Lib=`$as_echo "ac_cv_lib_$webplib''_WebPGetDecoderVersion" | $as_tr_sh` -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for WebPGetDecoderVersion in -l$webplib" >&5 -$as_echo_n "checking for WebPGetDecoderVersion in -l$webplib... " >&6; } -if { as_var=$as_ac_Lib; eval "test \"\${$as_var+set}\" = set"; }; then : - $as_echo_n "(cached) " >&6 +# Check whether --with-sdl-exec-prefix was given. +if test "${with_sdl_exec_prefix+set}" = set; then : + withval=$with_sdl_exec_prefix; sdl_exec_prefix="$withval" else - ac_check_lib_save_LIBS=$LIBS -LIBS="-l$webplib -lm $LIBS" -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ + sdl_exec_prefix="" +fi -/* Override any GCC internal prototype to avoid an error. - Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif -char WebPGetDecoderVersion (); -int -main () -{ -return WebPGetDecoderVersion (); - ; - return 0; -} -_ACEOF -if ac_fn_c_try_link "$LINENO"; then : - eval "$as_ac_Lib=yes" +# Check whether --enable-sdltest was given. +if test "${enable_sdltest+set}" = set; then : + enableval=$enable_sdltest; else - eval "$as_ac_Lib=no" -fi -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext -LIBS=$ac_check_lib_save_LIBS + enable_sdltest=yes fi -eval ac_res=\$$as_ac_Lib - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 -$as_echo "$ac_res" >&6; } -eval as_val=\$$as_ac_Lib - if test "x$as_val" = x""yes; then : - - have_webp_lib=yes - LIBWEBP_LIBS="-l$webplib" -fi + min_sdl_version=$SDL_VERSION -elif test $pkg_failed = untried; then - ac_fn_c_check_header_mongrel "$LINENO" "webp/decode.h" "ac_cv_header_webp_decode_h" "$ac_includes_default" -if test "x$ac_cv_header_webp_decode_h" = x""yes; then : + if test "x$sdl_prefix$sdl_exec_prefix" = x ; then - have_webp_hdr=yes - LIBWEBP_CFLAGS="" +pkg_failed=no +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for SDL" >&5 +$as_echo_n "checking for SDL... " >&6; } +if test -n "$PKG_CONFIG"; then + if test -n "$SDL_CFLAGS"; then + pkg_cv_SDL_CFLAGS="$SDL_CFLAGS" + else + if test -n "$PKG_CONFIG" && \ + { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"sdl2 >= \$min_sdl_version\""; } >&5 + ($PKG_CONFIG --exists --print-errors "sdl2 >= $min_sdl_version") 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; then + pkg_cv_SDL_CFLAGS=`$PKG_CONFIG --cflags "sdl2 >= $min_sdl_version" 2>/dev/null` +else + pkg_failed=yes fi - - - as_ac_Lib=`$as_echo "ac_cv_lib_$webplib''_WebPGetDecoderVersion" | $as_tr_sh` -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for WebPGetDecoderVersion in -l$webplib" >&5 -$as_echo_n "checking for WebPGetDecoderVersion in -l$webplib... " >&6; } -if { as_var=$as_ac_Lib; eval "test \"\${$as_var+set}\" = set"; }; then : - $as_echo_n "(cached) " >&6 + fi else - ac_check_lib_save_LIBS=$LIBS -LIBS="-l$webplib -lm $LIBS" -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -/* Override any GCC internal prototype to avoid an error. - Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif -char WebPGetDecoderVersion (); -int -main () -{ -return WebPGetDecoderVersion (); - ; - return 0; -} -_ACEOF -if ac_fn_c_try_link "$LINENO"; then : - eval "$as_ac_Lib=yes" + pkg_failed=untried +fi +if test -n "$PKG_CONFIG"; then + if test -n "$SDL_LIBS"; then + pkg_cv_SDL_LIBS="$SDL_LIBS" + else + if test -n "$PKG_CONFIG" && \ + { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"sdl2 >= \$min_sdl_version\""; } >&5 + ($PKG_CONFIG --exists --print-errors "sdl2 >= $min_sdl_version") 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; then + pkg_cv_SDL_LIBS=`$PKG_CONFIG --libs "sdl2 >= $min_sdl_version" 2>/dev/null` else - eval "$as_ac_Lib=no" + pkg_failed=yes fi -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext -LIBS=$ac_check_lib_save_LIBS + fi +else + pkg_failed=untried fi -eval ac_res=\$$as_ac_Lib - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 -$as_echo "$ac_res" >&6; } -eval as_val=\$$as_ac_Lib - if test "x$as_val" = x""yes; then : - have_webp_lib=yes - LIBWEBP_LIBS="-l$webplib" -fi +if test $pkg_failed = yes; then + +if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then + _pkg_short_errors_supported=yes +else + _pkg_short_errors_supported=no +fi + if test $_pkg_short_errors_supported = yes; then + SDL_PKG_ERRORS=`$PKG_CONFIG --short-errors --errors-to-stdout --print-errors "sdl2 >= $min_sdl_version"` + else + SDL_PKG_ERRORS=`$PKG_CONFIG --errors-to-stdout --print-errors "sdl2 >= $min_sdl_version"` + fi + # Put the nasty error message in config.log where it belongs + echo "$SDL_PKG_ERRORS" >&5 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } + sdl_pc=no +elif test $pkg_failed = untried; then + sdl_pc=no else - LIBWEBP_CFLAGS=$pkg_cv_LIBWEBP_CFLAGS - LIBWEBP_LIBS=$pkg_cv_LIBWEBP_LIBS + SDL_CFLAGS=$pkg_cv_SDL_CFLAGS + SDL_LIBS=$pkg_cv_SDL_LIBS { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } - have_webp_hdr=yes - have_webp_lib=yes - + sdl_pc=yes fi - if test x$have_webp_hdr = xyes -a x$have_webp_lib = xyes; then - $as_echo "#define LOAD_WEBP 1" >>confdefs.h - - - case "$host" in - *-*-darwin*) - webp_lib=`find_lib lib$webplib.dylib` - ;; - *-*-cygwin* | *-*-mingw32*) - webp_lib=`find_lib "lib$webplib-*.dll"` - ;; - *) - webp_lib=`find_lib "lib$webplib[0-9]*.so.*"` - if test x$webp_lib = x; then - webp_lib=`find_lib "lib$webplib.so.*"` - fi - ;; - esac - else - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: *** Unable to find WEBP library (http://code.google.com/intl/en-US/speed/webp/index.html)" >&5 -$as_echo "$as_me: WARNING: *** Unable to find WEBP library (http://code.google.com/intl/en-US/speed/webp/index.html)" >&2;} - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: WEBP Pimage loading disabled" >&5 -$as_echo "$as_me: WARNING: WEBP Pimage loading disabled" >&2;} + else + sdl_pc=no + if test x$sdl_exec_prefix != x ; then + sdl_config_args="$sdl_config_args --exec-prefix=$sdl_exec_prefix" + if test x${SDL2_CONFIG+set} != xset ; then + SDL2_CONFIG=$sdl_exec_prefix/bin/sdl2-config + fi fi -fi + if test x$sdl_prefix != x ; then + sdl_config_args="$sdl_config_args --prefix=$sdl_prefix" + if test x${SDL2_CONFIG+set} != xset ; then + SDL2_CONFIG=$sdl_prefix/bin/sdl2-config + fi + fi + fi -if test x$enable_bmp = xyes; then - $as_echo "#define LOAD_BMP 1" >>confdefs.h + if test "x$sdl_pc" = xyes ; then + no_sdl="" + SDL2_CONFIG="pkg-config sdl2" + else + as_save_PATH="$PATH" + if test "x$prefix" != xNONE && test "$cross_compiling" != yes; then + PATH="$prefix/bin:$prefix/usr/bin:$PATH" + fi + # Extract the first word of "sdl2-config", so it can be a program name with args. +set dummy sdl2-config; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if test "${ac_cv_path_SDL2_CONFIG+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + case $SDL2_CONFIG in + [\\/]* | ?:[\\/]*) + ac_cv_path_SDL2_CONFIG="$SDL2_CONFIG" # Let the user override the test with a path. + ;; + *) + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_path_SDL2_CONFIG="$as_dir/$ac_word$ac_exec_ext" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + test -z "$ac_cv_path_SDL2_CONFIG" && ac_cv_path_SDL2_CONFIG="no" + ;; +esac fi - -if test x$enable_gif = xyes; then - $as_echo "#define LOAD_GIF 1" >>confdefs.h - +SDL2_CONFIG=$ac_cv_path_SDL2_CONFIG +if test -n "$SDL2_CONFIG"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $SDL2_CONFIG" >&5 +$as_echo "$SDL2_CONFIG" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } fi -if test x$enable_lbm = xyes; then - $as_echo "#define LOAD_LBM 1" >>confdefs.h -fi - -if test x$enable_pcx = xyes; then - $as_echo "#define LOAD_PCX 1" >>confdefs.h + PATH="$as_save_PATH" + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for SDL - version >= $min_sdl_version" >&5 +$as_echo_n "checking for SDL - version >= $min_sdl_version... " >&6; } + no_sdl="" -fi + if test "$SDL2_CONFIG" = "no" ; then + no_sdl=yes + else + SDL_CFLAGS=`$SDL2_CONFIG $sdl_config_args --cflags` + SDL_LIBS=`$SDL2_CONFIG $sdl_config_args --libs` -if test x$enable_pnm = xyes; then - $as_echo "#define LOAD_PNM 1" >>confdefs.h + sdl_major_version=`$SDL2_CONFIG $sdl_config_args --version | \ + sed 's/\([0-9]*\).\([0-9]*\).\([0-9]*\)/\1/'` + sdl_minor_version=`$SDL2_CONFIG $sdl_config_args --version | \ + sed 's/\([0-9]*\).\([0-9]*\).\([0-9]*\)/\2/'` + sdl_micro_version=`$SDL2_CONFIG $sdl_config_args --version | \ + sed 's/\([0-9]*\).\([0-9]*\).\([0-9]*\)/\3/'` + if test "x$enable_sdltest" = "xyes" ; then + ac_save_CFLAGS="$CFLAGS" + ac_save_CXXFLAGS="$CXXFLAGS" + ac_save_LIBS="$LIBS" + CFLAGS="$CFLAGS $SDL_CFLAGS" + CXXFLAGS="$CXXFLAGS $SDL_CFLAGS" + LIBS="$LIBS $SDL_LIBS" + rm -f conf.sdltest + if test "$cross_compiling" = yes; then : + echo $ac_n "cross compiling; assumed OK... $ac_c" +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ -fi +#include +#include +#include +#include "SDL.h" -if test x$enable_svg = xyes; then - $as_echo "#define LOAD_SVG 1" >>confdefs.h +char* +my_strdup (char *str) +{ + char *new_str; -fi + if (str) + { + new_str = (char *)malloc ((strlen (str) + 1) * sizeof(char)); + strcpy (new_str, str); + } + else + new_str = NULL; -if test x$enable_tga = xyes; then - $as_echo "#define LOAD_TGA 1" >>confdefs.h + return new_str; +} -fi +int main (int argc, char *argv[]) +{ + int major, minor, micro; + char *tmp_version; -if test x$enable_xcf = xyes; then - $as_echo "#define LOAD_XCF 1" >>confdefs.h + /* This hangs on some systems (?) + system ("touch conf.sdltest"); + */ + { FILE *fp = fopen("conf.sdltest", "a"); if ( fp ) fclose(fp); } -fi + /* HP/UX 9 (%@#!) writes to sscanf strings */ + tmp_version = my_strdup("$min_sdl_version"); + if (sscanf(tmp_version, "%d.%d.%d", &major, &minor, µ) != 3) { + printf("%s, bad version string\n", "$min_sdl_version"); + exit(1); + } -if test x$enable_xpm = xyes; then - $as_echo "#define LOAD_XPM 1" >>confdefs.h + if (($sdl_major_version > major) || + (($sdl_major_version == major) && ($sdl_minor_version > minor)) || + (($sdl_major_version == major) && ($sdl_minor_version == minor) && ($sdl_micro_version >= micro))) + { + return 0; + } + else + { + printf("\n*** 'sdl2-config --version' returned %d.%d.%d, but the minimum version\n", $sdl_major_version, $sdl_minor_version, $sdl_micro_version); + printf("*** of SDL required is %d.%d.%d. If sdl2-config is correct, then it is\n", major, minor, micro); + printf("*** best to upgrade to the required version.\n"); + printf("*** If sdl2-config was wrong, set the environment variable SDL2_CONFIG\n"); + printf("*** to point to the correct copy of sdl2-config, and remove the file\n"); + printf("*** config.cache before re-running configure\n"); + return 1; + } +} -fi -if test x$enable_xv = xyes; then - $as_echo "#define LOAD_XV 1" >>confdefs.h +_ACEOF +if ac_fn_c_try_run "$LINENO"; then : +else + no_sdl=yes +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest.beam conftest.$ac_ext fi -if test x$enable_webp = xyes -a x$have_webp_hdr = xyes -a x$have_webp_lib = xyes; then - CFLAGS="$LIBWEBP_CFLAGS $CFLAGS" - if test x$enable_webp_shared = xyes && test x$webp_lib != x; then - echo "-- dynamic libwebp -> $webp_lib" - cat >>confdefs.h <<_ACEOF -#define LOAD_WEBP_DYNAMIC "$webp_lib" -_ACEOF - + CFLAGS="$ac_save_CFLAGS" + CXXFLAGS="$ac_save_CXXFLAGS" + LIBS="$ac_save_LIBS" + fi + fi + if test "x$no_sdl" = x ; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } else - IMG_LIBS="$LIBWEBP_LIBS $IMG_LIBS" + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } fi -fi + fi + if test "x$no_sdl" = x ; then + : + else + if test "$SDL2_CONFIG" = "no" ; then + echo "*** The sdl2-config script installed by SDL could not be found" + echo "*** If SDL was installed in PREFIX, make sure PREFIX/bin is in" + echo "*** your path, or set the SDL2_CONFIG environment variable to the" + echo "*** full path to sdl2-config." + else + if test -f conf.sdltest ; then + : + else + echo "*** Could not run SDL test program, checking why..." + CFLAGS="$CFLAGS $SDL_CFLAGS" + CXXFLAGS="$CXXFLAGS $SDL_CFLAGS" + LIBS="$LIBS $SDL_LIBS" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ -if test x$enable_tif = xyes -a x$have_tif_hdr = xyes -a x$have_tif_lib = xyes; then - if test x$enable_tif_shared = xyes && test x$tif_lib != x; then - echo "-- dynamic libtiff -> $tif_lib" - cat >>confdefs.h <<_ACEOF -#define LOAD_TIF_DYNAMIC "$tif_lib" -_ACEOF +#include +#include "SDL.h" - else - if test x$have_libjpeg = xyes; then - # Disable dynamic jpeg since we're linking it explicitly - jpg_lib='' - fi - IMG_LIBS="-ltiff -lz $IMG_LIBS" - fi -fi -if test x$enable_jpg = xyes -a x$have_jpg_hdr = xyes -a x$have_jpg_lib = xyes; then - if test x$enable_jpg_shared = xyes && test x$jpg_lib != x; then - echo "-- dynamic libjpeg -> $jpg_lib" - cat >>confdefs.h <<_ACEOF -#define LOAD_JPG_DYNAMIC "$jpg_lib" -_ACEOF +int main(int argc, char *argv[]) +{ return 0; } +#undef main +#define main K_and_R_C_main - else - IMG_LIBS="-ljpeg $IMG_LIBS" - fi -fi -if test x$enable_png = xyes -a x$have_png_hdr = xyes -a x$have_png_lib = xyes; then - CFLAGS="$LIBPNG_CFLAGS $CFLAGS" - if test x$enable_png_shared = xyes && test x$png_lib != x; then - echo "-- dynamic libpng -> $png_lib" - cat >>confdefs.h <<_ACEOF -#define LOAD_PNG_DYNAMIC "$png_lib" +int +main () +{ + return 0; + ; + return 0; +} _ACEOF - - else - IMG_LIBS="$LIBPNG_LIBS $IMG_LIBS" - fi +if ac_fn_c_try_link "$LINENO"; then : + echo "*** The test program compiled, but did not run. This usually means" + echo "*** that the run-time linker is not finding SDL or finding the wrong" + echo "*** version of SDL. If it is not finding SDL, you'll need to set your" + echo "*** LD_LIBRARY_PATH environment variable, or edit /etc/ld.so.conf to point" + echo "*** to the installed location Also, make sure you have run ldconfig if that" + echo "*** is required on your system" + echo "***" + echo "*** If you have an old version installed, it is best to remove it, although" + echo "*** you may also be able to get things to work by modifying LD_LIBRARY_PATH" +else + echo "*** The test program failed to compile or link. See the file config.log for the" + echo "*** exact error that occured. This usually means SDL was incorrectly installed" + echo "*** or that you have moved SDL since it was installed. In the latter case, you" + echo "*** may want to edit the sdl2-config script: $SDL2_CONFIG" fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext + CFLAGS="$ac_save_CFLAGS" + CXXFLAGS="$ac_save_CXXFLAGS" + LIBS="$ac_save_LIBS" + fi + fi + SDL_CFLAGS="" + SDL_LIBS="" + as_fn_error "*** SDL version $SDL_VERSION not found!" "$LINENO" 5 -LIBS="$saved_LIBS" + fi + + + rm -f conf.sdltest + +CFLAGS="$CFLAGS $SDL_CFLAGS" +LIBS="$LIBS $SDL_LIBS" diff --git a/configure.in b/configure.in index 2b8bd6dc..094f5ab3 100644 --- a/configure.in +++ b/configure.in @@ -115,17 +115,6 @@ find_lib() done } -dnl Check for SDL -SDL_VERSION=2.0.8 -AC_SUBST(SDL_VERSION) -AM_PATH_SDL2($SDL_VERSION, - :, - AC_MSG_ERROR([*** SDL version $SDL_VERSION not found!]) -) -CFLAGS="$CFLAGS $SDL_CFLAGS" -LIBS="$LIBS $SDL_LIBS" -saved_LIBS="$LIBS" - dnl Check command-line options AC_ARG_ENABLE([bmp], [AC_HELP_STRING([--enable-bmp], [support loading BMP/ICO/CUR images [default=yes]])], [], [enable_bmp=yes]) @@ -380,7 +369,15 @@ if test x$enable_png = xyes -a x$have_png_hdr = xyes -a x$have_png_lib = xyes; t fi fi -LIBS="$saved_LIBS" +dnl Check for SDL +SDL_VERSION=2.0.8 +AC_SUBST(SDL_VERSION) +AM_PATH_SDL2($SDL_VERSION, + :, + AC_MSG_ERROR([*** SDL version $SDL_VERSION not found!]) +) +CFLAGS="$CFLAGS $SDL_CFLAGS" +LIBS="$LIBS $SDL_LIBS" AC_SUBST([WINDRES]) AC_SUBST([IMG_LIBS])