--- configure.in 2005-09-21 02:56:09.000000000 -0500 +++ configure.in 2006-01-09 22:57:14.000000000 -0600 @@ -98,133 +98,164 @@ # # Checks for libpng # -AC_MSG_CHECKING(for libpng) - if test -z "$PNG_LIBS"; then - AC_CHECK_LIB(png, png_read_info, - [AC_CHECK_HEADER(png.h, - png_ok=yes, - png_ok=no)], - AC_MSG_ERROR(*** PNG library (libpng) not found ***), -lz -lm) - if test "$png_ok" = yes; then - AC_MSG_CHECKING([for png_structp in png.h]) - AC_TRY_COMPILE([#include ], - [png_structp pp; png_infop info; png_colorp cmap; png_create_read_struct;], - png_ok=yes, - png_ok=no) - AC_MSG_RESULT($png_ok) - if test "$png_ok" = yes; then - PNG_LIBS='-lpng -lz' - else - AC_MSG_ERROR(*** PNG library (libpng) is too old ***) - fi - else - AC_MSG_ERROR(*** PNG header file not found ***) - fi - fi -AC_SUBST(PNG_LIBS) +AC_ARG_ENABLE([png], + [AC_HELP_STRING([--disable-png],[disable support for png])],, + [enable_png=yes]) + +if test x$enable_png = xyes ; then + AC_MSG_CHECKING(PNG Support) + AC_MSG_RESULT() + + AC_CHECK_LIB(png, png_read_info, + [AC_CHECK_HEADER(png.h,,[AC_MSG_ERROR([*** PNG headers not found ***])])], + [AC_MSG_ERROR([*** PNG library not found ***])]) + + AC_MSG_CHECKING([for png_structp in png.h]) + AC_TRY_COMPILE([#include ], + [png_struct pp; png_infop info; png_colorp cmap;png_create_read_struct;],, + [AC_MSG_ERROR([*** PNG library (libpng) is too old ***])]) + + PNG_LIBS='-lpng -lm -lz' + AC_SUBST(PNG_LIBS) + + HAVE_PNG=yes +else + HAVE_PNG=no +fi # # Checks for libjpeg # -jpeg_ok=no -AC_MSG_CHECKING(for libjpeg) - if test -z "$JPEG_LIBS"; then - AC_CHECK_LIB(jpeg, jpeg_destroy_decompress, - [AC_CHECK_HEADER(jpeglib.h, - jpeg_ok=yes, - jpeg_ok=no)], - AC_MSG_WARN([*** Internal jpegtran will not be built (JPEG library not found) ***]), -lm) - if test "$jpeg_ok" = yes; then - JPEG_LIBS='-ljpeg' - AC_DEFINE(HAVE_LIBJPEG, 1, [Have libjpeg]) - AC_CHECK_LIB(jpeg, jpeg_simple_progression, - AC_DEFINE(HAVE_PROGRESSIVE_JPEG, 1, - [Define to 1 if jpeglib supports progressive JPEG.]), - AC_MSG_WARN(JPEG library does not support progressive saving.)) - else - AC_MSG_WARN([*** Internal jpegtran will not be built (JPEG library not found) ***]) - fi - fi -AC_SUBST(JPEG_LIBS) +AC_ARG_ENABLE([jpeg], + [AC_HELP_STRING([--disable-jpeg],[disable support for jpeg])],, + [enable_jpeg=yes]) + +if test x$enable_jpeg = xyes ; then + AC_MSG_CHECKING(JPEG Support) + AC_MSG_RESULT() + + AC_CHECK_LIB(jpeg, jpeg_destroy_decompress, + [AC_CHECK_HEADER(jpeglib.h,,[AC_MSG_ERROR([*** JPEG headers not found ***])])], + [AC_MSG_ERROR([*** JPEG library not found ***])]) + + AC_CHECK_LIB(jpeg, jpeg_simple_progression, + [AC_DEFINE(HAVE_PROGRESSIVE_JPEG, 1, [Define to 1 if libjpeg supports progressive JPEG.])], + [AC_MSG_WARN(JPEG library does not support progressive saving.)]) + + JPEG_LIBS='-ljpeg -lm -lz' + AC_SUBST(JPEG_LIBS) + + HAVE_JPEG=yes +else + HAVE_JPEG=no +fi # # Checks for libtiff # -tiff_ok=no -AC_MSG_CHECKING(for libtiff) - if test -z "$TIFF_LIBS"; then - AC_CHECK_LIB(tiff, TIFFWriteScanline, - [AC_CHECK_HEADER(tiffio.h, - tiff_ok=yes, - tiff_ok=no)], - AC_MSG_WARN([*** (TIFF library not found) ***]), -lm -lz) - if test "$tiff_ok" = yes; then - TIFF_LIBS='-ltiff -ljpeg -lz' - AC_DEFINE(HAVE_LIBTIFF, 1, [Have libtiff]) - else - AC_MSG_WARN([*** (TIFF library not found) ***]) - fi - fi -AC_SUBST(TIFF_LIBS) +AC_ARG_ENABLE([tiff], + [AC_HELP_STRING([--disable-tiff],[disable support for tiff])],, + [enable_tiff=yes]) + +if test x$enable_tiff = xyes ; then + AC_MSG_CHECKING(TIFF Support) + AC_MSG_RESULT() + AC_CHECK_LIB(tiff, TIFFWriteScanline, + [AC_CHECK_HEADER(tiffio.h,,[AC_MSG_ERROR([*** TIFF headers not found ***])])], + [AC_MSG_ERROR([*** TIFF library not found ***])]) + + AC_DEFINE(HAVE_LIBTIFF, 1, [Define to 1 if libtiff support is included]) + + TIFF_LIBS='-ltiff -lm -lz' + AC_SUBST(TIFF_LIBS) + + HAVE_TIFF=yes +else + HAVE_TIFF=no +fi # # Checks for Xft/XRender # -have_render=false -RENDER_LIBS="" -AC_CHECK_LIB(Xrender, XRenderFindFormat, - have_render=true,:,-lXext $GTHUMB_LIBS) -if $have_render ; then - RENDER_LIBS="-lXrender -lXext" - AC_DEFINE(HAVE_RENDER, 1, [Have Xft/XRender]) + +AC_ARG_ENABLE([render], + [AC_HELP_STRING([--disable-render],[disable support for Xrender])],, + [enable_render=yes]) + +if test x$enable_render = xyes ; then + AC_MSG_CHECKING(Xrender Support) + AC_MSG_RESULT() + + AC_CHECK_LIB(Xrender, XRenderFindFormat,,,[-lXext $GTHUMB_LIBS]) + + AC_DEFINE(HAVE_RENDER, 1, [Define to 1 if Xft/XRender support is included]) + + RENDER_LIBS='-lXrender -lXext' + AC_SUBST(RENDER_LIBS) + + HAVE_RENDER=yes +else + HAVE_RENDER=no fi -AC_SUBST(RENDER_LIBS) # # Checks for libexif # -AC_MSG_CHECKING(for libexif) -have_libexif=no -EXIF_LIBS="" -EXIF_CFLAGS="" -if pkg-config --atleast-version=$LIBEXIF_REQUIRED libexif; then - have_libexif="yes (0.6.x)" - EXIF_LIBS=`pkg-config --libs libexif` - EXIF_CFLAGS=`pkg-config --cflags libexif` - AC_DEFINE(HAVE_LIBEXIF, 1, [Have libexif]) -elif pkg-config --atleast-version=$LIBEXIF_0_5_REQUIRED libexif; then - have_libexif="yes (0.5.x)" - EXIF_LIBS=`pkg-config --libs libexif` - EXIF_CFLAGS=`pkg-config --cflags libexif` - AC_DEFINE(HAVE_LIBEXIF, 1, [Have libexif]) - AC_DEFINE(HAVE_LIBEXIF_0_5, 1, [Have libexif 0.5.x]) -fi -AC_MSG_RESULT($have_libexif) -AC_SUBST(EXIF_LIBS) -AC_SUBST(EXIF_CFLAGS) + +AC_ARG_ENABLE([exif], + [AC_HELP_STRING([--disable-exif],[disable support for libexif])],, + [enable_exif=yes]) + +if test x$enable_exif = xyes ; then + AC_MSG_CHECKING(EXIF Support) + AC_MSG_RESULT() + + PKG_CHECK_MODULES(EXIF, libexif >= $LIBEXIF_REQUIRED,, + [PKG_CHECK_MODULES(EXIF, libexif >= $LIBEXIF_0_5_REQUIRED, + [AC_DEFINE(HAVE_LIBEXIF_0_5, 1, [Using libexif 0.5])], + [AC_MSG_ERROR([*** libexif not found ***])] + ) + ]) + + AC_DEFINE(HAVE_LIBEXIF, 1, [Define to 1 if we have libexif support]) + + AC_SUBST(EXIF_LIBS) + AC_SUBST(EXIF_CFLAGS) + + HAVE_EXIF=yes +else + HAVE_EXIF=no +fi # # Checks for libgphoto2 # -AC_MSG_CHECKING(for libgphoto2) -have_libgphoto=no -LIBGPHOTO_LIBS="" -LIBGPHOTO_CFLAGS="" -if pkg-config --atleast-version=$LIBGPHOTO_REQUIRED libgphoto2; then - have_libgphoto=yes - LIBGPHOTO_LIBS=`pkg-config --libs libgphoto2` - LIBGPHOTO_CFLAGS=`pkg-config --cflags libgphoto2` - AC_DEFINE(HAVE_LIBGPHOTO, 1, [Have libgphoto]) -fi -AC_MSG_RESULT($have_libgphoto) -AC_SUBST(LIBGPHOTO_LIBS) -AC_SUBST(LIBGPHOTO_CFLAGS) + +AC_ARG_ENABLE([gphoto2], + [AC_HELP_STRING([--disable-gphoto2],[disable support for libgphoto2])],, + [enable_gphoto2=yes]) + +if test x$enable_gphoto2 = xyes ; then + AC_MSG_CHECKING(GPHOTO2 Support) + AC_MSG_RESULT() + + PKG_CHECK_MODULES(LIBGPHOTO, libgphoto2 >= $LIBGPHOTO_REQUIRED) + + AC_DEFINE(HAVE_LIBGPHOTO, 1, [Define to 1 to enable libgphoto2 support]) + + AC_SUBST(LIBGPHOTO_LIBS) + AC_SUBST(LIBGPHOTO_CFLAGS) + + HAVE_GPHOTO2=yes +else + HAVE_GPHOTO2=no +fi dnl ############################################### @@ -308,10 +339,11 @@ Source code location: ${srcdir} Compiler: ${CC} - Have Render: ${have_render} - Have libexif: ${have_libexif} - Have libjpeg: ${jpeg_ok} - Have libtiff: ${tiff_ok} - Have libgphoto: ${have_libgphoto} + Have Render: ${HAVE_RENDER} + Have libexif: ${HAVE_EXIF} + Have libpng: ${HAVE_PNG} + Have libjpeg: ${HAVE_JPEG} + Have libtiff: ${HAVE_TIFF} + Have libgphoto: ${HAVE_GPHOTO2} "