fixed --with-libjpeg=sys

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@10755 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Vadim Zeitlin
2001-07-02 09:38:06 +00:00
parent 54276ccf5b
commit 463abc6470
2 changed files with 133 additions and 106 deletions

View File

@@ -3200,7 +3200,29 @@ if test "$wxUSE_LIBJPEG" = "yes" -o "$wxUSE_LIBJPEG" = "sys" ; then
JPEG_INCLUDE="-I\${top_srcdir}/src/jpeg"
else
JPEG_LINK=
AC_CHECK_HEADER(jpeglib.h, AC_CHECK_LIB(jpeg, jpeg_read_header, JPEG_LINK="-ljpeg"))
dnl can't use AC_CHECK_HEADER as jconfig.h defines things like
dnl HAVE_STDLIB_H which are already defined and this provokes
dnl a compiler warning which configure considers as an error...
AC_MSG_CHECKING(for jpeglib.h)
AC_CACHE_VAL(ac_cv_header_jpeglib_h,
AC_TRY_COMPILE(
[
#undef HAVE_STDLIB_H
#include <stdio.h>
#include <jpeglib.h>
],
[
],
ac_cv_header_jpeglib_h=yes,
ac_cv_header_jpeglib_h=no
)
)
AC_MSG_RESULT($ac_cv_header_jpeglib_h)
if test "$ac_cv_header_jpeglib_h" = "yes"; then
AC_CHECK_LIB(jpeg, jpeg_read_header, JPEG_LINK="-ljpeg")
fi
if test "x$JPEG_LINK" = "x" ; then
AC_MSG_ERROR(system jpeg library not found! Use --with-libjpeg=yes to use the built-in one)
fi