diff options
| author | Ulrich Müller | 2019-08-11 11:24:07 +0200 |
|---|---|---|
| committer | Ulrich Müller | 2019-08-20 17:04:26 +0200 |
| commit | 65dc07f563f229faadaa44312776941abbf6e1b6 (patch) | |
| tree | da62da5cd6c11efebcbc3d3ccbcb174e204dbbc9 | |
| parent | 4e0c5830dab466be2df99b8814b742a662d67ac7 (diff) | |
| download | emacs-65dc07f563f229faadaa44312776941abbf6e1b6.tar.gz emacs-65dc07f563f229faadaa44312776941abbf6e1b6.zip | |
* configure.ac (HAVE_JPEG): Test for window system. (Bug#36995)
| -rw-r--r-- | configure.ac | 78 |
1 files changed, 40 insertions, 38 deletions
diff --git a/configure.ac b/configure.ac index 1400fcb5bc7..6c83d61921e 100644 --- a/configure.ac +++ b/configure.ac | |||
| @@ -3606,44 +3606,46 @@ HAVE_JPEG=no | |||
| 3606 | LIBJPEG= | 3606 | LIBJPEG= |
| 3607 | if test "${NS_IMPL_COCOA}" = yes; then | 3607 | if test "${NS_IMPL_COCOA}" = yes; then |
| 3608 | : # Cocoa provides its own jpeg support, so do nothing. | 3608 | : # Cocoa provides its own jpeg support, so do nothing. |
| 3609 | elif test "${with_jpeg}" != "no"; then | 3609 | elif test "${HAVE_X11}" = "yes" || test "${HAVE_W32}" = "yes"; then |
| 3610 | AC_CACHE_CHECK([for jpeglib 6b or later], | 3610 | if test "${with_jpeg}" != "no"; then |
| 3611 | [emacs_cv_jpeglib], | 3611 | AC_CACHE_CHECK([for jpeglib 6b or later], |
| 3612 | [OLD_LIBS=$LIBS | 3612 | [emacs_cv_jpeglib], |
| 3613 | for emacs_cv_jpeglib in yes -ljpeg no; do | 3613 | [OLD_LIBS=$LIBS |
| 3614 | case $emacs_cv_jpeglib in | 3614 | for emacs_cv_jpeglib in yes -ljpeg no; do |
| 3615 | yes) ;; | 3615 | case $emacs_cv_jpeglib in |
| 3616 | no) break;; | 3616 | yes) ;; |
| 3617 | *) LIBS="$LIBS $emacs_cv_jpeglib";; | 3617 | no) break;; |
| 3618 | esac | 3618 | *) LIBS="$LIBS $emacs_cv_jpeglib";; |
| 3619 | AC_LINK_IFELSE( | 3619 | esac |
| 3620 | [AC_LANG_PROGRAM( | 3620 | AC_LINK_IFELSE( |
| 3621 | [[#undef HAVE_STDLIB_H /* Avoid config.h/jpeglib.h collision. */ | 3621 | [AC_LANG_PROGRAM( |
| 3622 | #include <stdio.h> /* jpeglib.h needs FILE and size_t. */ | 3622 | [[#undef HAVE_STDLIB_H /* Avoid config.h/jpeglib.h collision. */ |
| 3623 | #include <jpeglib.h> | 3623 | #include <stdio.h> /* jpeglib.h needs FILE and size_t. */ |
| 3624 | #include <jerror.h> | 3624 | #include <jpeglib.h> |
| 3625 | char verify[JPEG_LIB_VERSION < 62 ? -1 : 1]; | 3625 | #include <jerror.h> |
| 3626 | struct jpeg_decompress_struct cinfo; | 3626 | char verify[JPEG_LIB_VERSION < 62 ? -1 : 1]; |
| 3627 | ]], | 3627 | struct jpeg_decompress_struct cinfo; |
| 3628 | [[ | 3628 | ]], |
| 3629 | jpeg_create_decompress (&cinfo); | 3629 | [[ |
| 3630 | WARNMS (&cinfo, JWRN_JPEG_EOF); | 3630 | jpeg_create_decompress (&cinfo); |
| 3631 | jpeg_destroy_decompress (&cinfo); | 3631 | WARNMS (&cinfo, JWRN_JPEG_EOF); |
| 3632 | ]])], | 3632 | jpeg_destroy_decompress (&cinfo); |
| 3633 | [emacs_link_ok=yes], | 3633 | ]])], |
| 3634 | [emacs_link_ok=no]) | 3634 | [emacs_link_ok=yes], |
| 3635 | LIBS=$OLD_LIBS | 3635 | [emacs_link_ok=no]) |
| 3636 | test $emacs_link_ok = yes && break | 3636 | LIBS=$OLD_LIBS |
| 3637 | done]) | 3637 | test $emacs_link_ok = yes && break |
| 3638 | if test "$emacs_cv_jpeglib" != no; then | 3638 | done]) |
| 3639 | HAVE_JPEG=yes | 3639 | if test "$emacs_cv_jpeglib" != no; then |
| 3640 | AC_DEFINE([HAVE_JPEG], 1, | 3640 | HAVE_JPEG=yes |
| 3641 | [Define to 1 if you have the jpeg library (typically -ljpeg).]) | 3641 | AC_DEFINE([HAVE_JPEG], 1, |
| 3642 | ### mingw32 doesn't use -ljpeg, since it loads the library | 3642 | [Define to 1 if you have the jpeg library (typically -ljpeg).]) |
| 3643 | ### dynamically when needed, and doesn't want a run-time | 3643 | ### mingw32 doesn't use -ljpeg, since it loads the library |
| 3644 | ### dependency on the jpeglib DLL. | 3644 | ### dynamically when needed, and doesn't want a run-time |
| 3645 | test "$emacs_cv_jpeglib" != yes && test "${opsys}" != "mingw32" \ | 3645 | ### dependency on the jpeglib DLL. |
| 3646 | && LIBJPEG=$emacs_cv_jpeglib | 3646 | test "$emacs_cv_jpeglib" != yes && test "${opsys}" != "mingw32" \ |
| 3647 | && LIBJPEG=$emacs_cv_jpeglib | ||
| 3648 | fi | ||
| 3647 | fi | 3649 | fi |
| 3648 | fi | 3650 | fi |
| 3649 | AC_SUBST(LIBJPEG) | 3651 | AC_SUBST(LIBJPEG) |