diff options
| author | Paul Eggert | 2015-04-15 18:30:01 -0700 |
|---|---|---|
| committer | Paul Eggert | 2015-04-15 18:30:46 -0700 |
| commit | 5761a2ecb1a5178d2ea69a39725bdee368a754a5 (patch) | |
| tree | d5c16729dc68d0d419a1a66441dee015839d2177 | |
| parent | c0c57f8b36d4472296f9bc237a16b9876488472c (diff) | |
| download | emacs-5761a2ecb1a5178d2ea69a39725bdee368a754a5.tar.gz emacs-5761a2ecb1a5178d2ea69a39725bdee368a754a5.zip | |
Port jpeg configuration to Solaris 10 with Sun C
* configure.ac: Check for jpeglib 6b by trying to link it, instead
of relying on cpp magic that has problems in practice. Check for
both jpeglib.h and jerror.h features. Remove special case for
mingw32, which should no longer be needed (and if it were needed,
should now be addressable by hotwiring emacs_cv_jpeglib).
Fixes: bug#20332
| -rw-r--r-- | configure.ac | 76 |
1 files changed, 34 insertions, 42 deletions
diff --git a/configure.ac b/configure.ac index 858cf786456..c35e9626611 100644 --- a/configure.ac +++ b/configure.ac | |||
| @@ -3189,48 +3189,40 @@ AC_SUBST(LIBXPM) | |||
| 3189 | ### mingw32 doesn't use -ljpeg, since it loads the library dynamically. | 3189 | ### mingw32 doesn't use -ljpeg, since it loads the library dynamically. |
| 3190 | HAVE_JPEG=no | 3190 | HAVE_JPEG=no |
| 3191 | LIBJPEG= | 3191 | LIBJPEG= |
| 3192 | if test "${opsys}" = "mingw32"; then | 3192 | if test "${with_jpeg}" != "no"; then |
| 3193 | if test "${with_jpeg}" != "no"; then | 3193 | AC_CACHE_CHECK([for jpeglib 6b or later], |
| 3194 | dnl Checking for jpeglib.h can lose because of a redefinition of | 3194 | [emacs_cv_jpeglib], |
| 3195 | dnl HAVE_STDLIB_H. | 3195 | [OLD_LIBS=$LIBS |
| 3196 | AC_CHECK_HEADER(jerror.h, HAVE_JPEG=yes, HAVE_JPEG=no) | 3196 | for emacs_cv_jpeglib in yes -ljpeg no; do |
| 3197 | fi | 3197 | case $emacs_cv_jpeglib in |
| 3198 | AH_TEMPLATE(HAVE_JPEG, [Define to 1 if you have the jpeg library (-ljpeg).])dnl | 3198 | yes) ;; |
| 3199 | if test "${HAVE_JPEG}" = "yes"; then | 3199 | no) break;; |
| 3200 | AC_DEFINE(HAVE_JPEG) | 3200 | *) LIBS="$LIBS $emacs_cv_jpeglib";; |
| 3201 | AC_EGREP_CPP([version 6b or later], | 3201 | esac |
| 3202 | [#include <jpeglib.h> | 3202 | AC_LINK_IFELSE( |
| 3203 | #if JPEG_LIB_VERSION >= 62 | 3203 | [AC_LANG_PROGRAM( |
| 3204 | version 6b or later | 3204 | [[#undef HAVE_STDLIB_H /* Avoid config.h/jpeglib.h collision. */ |
| 3205 | #endif | 3205 | #include <stdio.h> /* jpeglib.h needs FILE and size_t. */ |
| 3206 | ], | 3206 | #include <jpeglib.h> |
| 3207 | [AC_DEFINE(HAVE_JPEG)], | 3207 | #include <jerror.h> |
| 3208 | [AC_MSG_WARN([libjpeg found, but not version 6b or later]) | 3208 | char verify[JPEG_LIB_VERSION < 62 ? -1 : 1]; |
| 3209 | HAVE_JPEG=no]) | 3209 | struct jpeg_decompress_struct cinfo; |
| 3210 | fi | 3210 | ]], |
| 3211 | elif test "${HAVE_X11}" = "yes" || test "${HAVE_W32}" = "yes"; then | 3211 | [[ |
| 3212 | if test "${with_jpeg}" != "no"; then | 3212 | jpeg_create_decompress (&cinfo); |
| 3213 | dnl Checking for jpeglib.h can lose because of a redefinition of | 3213 | WARNMS (&cinfo, JWRN_JPEG_EOF); |
| 3214 | dnl HAVE_STDLIB_H. | 3214 | jpeg_destroy_decompress (&cinfo); |
| 3215 | AC_CHECK_HEADER(jerror.h, | 3215 | ]])], |
| 3216 | [AC_CHECK_LIB(jpeg, jpeg_destroy_compress, HAVE_JPEG=yes)]) | 3216 | [emacs_link_ok=yes], |
| 3217 | fi | 3217 | [emacs_link_ok=no]) |
| 3218 | 3218 | LIBS=$OLD_LIBS | |
| 3219 | AH_TEMPLATE(HAVE_JPEG, [Define to 1 if you have the jpeg library (-ljpeg).])dnl | 3219 | test $emacs_link_ok = yes && break |
| 3220 | if test "${HAVE_JPEG}" = "yes"; then | 3220 | done]) |
| 3221 | AC_DEFINE(HAVE_JPEG) | 3221 | if test "$emacs_cv_jpeglib" != no; then |
| 3222 | AC_EGREP_CPP([version 6b or later], | 3222 | HAVE_JPEG=yes |
| 3223 | [#include <jpeglib.h> | 3223 | AC_DEFINE([HAVE_JPEG], 1, |
| 3224 | #if JPEG_LIB_VERSION >= 62 | 3224 | [Define to 1 if you have the jpeg library (typically -ljpeg).]) |
| 3225 | version 6b or later | 3225 | test "$emacs_cv_jpeglib" != yes && LIBJPEG=$emacs_cv_jpeglib |
| 3226 | #endif | ||
| 3227 | ], | ||
| 3228 | [AC_DEFINE(HAVE_JPEG)], | ||
| 3229 | [AC_MSG_WARN([libjpeg found, but not version 6b or later]) | ||
| 3230 | HAVE_JPEG=no]) | ||
| 3231 | fi | ||
| 3232 | if test "${HAVE_JPEG}" = "yes"; then | ||
| 3233 | LIBJPEG=-ljpeg | ||
| 3234 | fi | 3226 | fi |
| 3235 | fi | 3227 | fi |
| 3236 | AC_SUBST(LIBJPEG) | 3228 | AC_SUBST(LIBJPEG) |