allow users to control whether jpeg/png support

SVN revision: 16639
This commit is contained in:
Mike Frysinger 2005-09-07 04:16:49 +00:00
parent 5b000f2a5e
commit e93b056b17
1 changed files with 80 additions and 36 deletions

View File

@ -182,6 +182,22 @@ my_libs=$freetype_libs" "$x_libs" "$dlopen_libs" -lm"
AC_SUBST(my_includes) AC_SUBST(my_includes)
AC_SUBST(my_libs) AC_SUBST(my_libs)
AC_MSG_CHECKING(whether to enable jpeg support)
AC_ARG_WITH(jpeg,
[AC_HELP_STRING([--without-jpeg],[Disable JPEG image loader])],
[
if test "$withval" = no ; then
jpeg_loader=no
else
jpeg_loader=yes
fi
],[ jpeg_loader=auto ]
)
AC_MSG_RESULT($jpeg_loader)
if test "$jpeg_loader" != no ; then
AC_CHECK_LIB(jpeg, jpeg_destroy_decompress, AC_CHECK_LIB(jpeg, jpeg_destroy_decompress,
jpeg_ok=yes, jpeg_ok=yes,
jpeg_ok=no jpeg_ok=no
@ -203,9 +219,31 @@ if test "$jpeg_ok" = yes; then
AC_MSG_WARN(*** Native JPEG support will not be built (JPEG header file not found) ***) AC_MSG_WARN(*** Native JPEG support will not be built (JPEG header file not found) ***)
fi fi
fi fi
if test "$jpeg_loader" = yes -a "$jpeg_ok" = no; then
AC_MSG_ERROR(JPEG support was requested but system does not support it)
fi
else
jpeg_ok=no
fi
AM_CONDITIONAL(BUILD_JPEG_LOADER, test "$jpeg_ok" = yes) AM_CONDITIONAL(BUILD_JPEG_LOADER, test "$jpeg_ok" = yes)
AC_SUBST(JPEGLIBS) AC_SUBST(JPEGLIBS)
AC_MSG_CHECKING(whether to enable png support)
AC_ARG_WITH(png,
[AC_HELP_STRING([--without-png],[Disable PNG image loader])],
[
if test "$withval" = no ; then
png_loader=no
else
png_loader=yes
fi
],[ png_loader=auto ]
)
AC_MSG_RESULT($png_loader)
if test "$png_loader" != no ; then
AC_CHECK_LIB(png, png_read_info, AC_CHECK_LIB(png, png_read_info,
png_ok=yes, png_ok=yes,
png_ok=no png_ok=no
@ -227,6 +265,12 @@ if test "$png_ok" = yes; then
AC_MSG_WARN(*** Native PNG support will not be built (PNG header file not found) ***) AC_MSG_WARN(*** Native PNG support will not be built (PNG header file not found) ***)
fi fi
fi fi
if test "$png_loader" = yes -a "$png_ok" = no; then
AC_MSG_ERROR(PNG support was requested but system does not support it)
fi
else
png_ok=no
fi
AM_CONDITIONAL(BUILD_PNG_LOADER, test "$png_ok" = yes) AM_CONDITIONAL(BUILD_PNG_LOADER, test "$png_ok" = yes)
AC_SUBST(PNGLIBS) AC_SUBST(PNGLIBS)