dnl -*- Autoconf -*- dnl $Id: configure.ac,v 1.4 2004-03-29 11:31:45 dron Exp $ dnl dnl Tag Image File Format (TIFF) Software dnl dnl Copyright (C) 2004, Andrey Kiselev dnl dnl Permission to use, copy, modify, distribute, and sell this software and dnl its documentation for any purpose is hereby granted without fee, provided dnl that (i) the above copyright notices and this permission notice appear in dnl all copies of the software and related documentation, and (ii) the names of dnl Sam Leffler and Silicon Graphics may not be used in any advertising or dnl publicity relating to the software without the specific, prior written dnl permission of Sam Leffler and Silicon Graphics. dnl dnl THE SOFTWARE IS PROVIDED "AS-IS" AND WITHOUT WARRANTY OF ANY KIND, dnl EXPRESS, IMPLIED OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY dnl WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. dnl dnl IN NO EVENT SHALL SAM LEFFLER OR SILICON GRAPHICS BE LIABLE FOR dnl ANY SPECIAL, INCIDENTAL, INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY KIND, dnl OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, dnl WHETHER OR NOT ADVISED OF THE POSSIBILITY OF DAMAGE, AND ON ANY THEORY OF dnl LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE dnl OF THIS SOFTWARE. dnl Process this file with autoconf to produce a configure script. AC_PREREQ(2.59) AC_INIT([LibTIFF Software], 3.7.0, [tiff@remotesensing.org], libtiff) AM_INIT_AUTOMAKE AC_CONFIG_SRCDIR(libtiff/config.h.in) AM_CONFIG_HEADER(libtiff/config.h) dnl Versioning LIBTIFF_MAJOR_VERSION=3 LIBTIFF_MINOR_VERSION=7 LIBTIFF_MICRO_VERSION=0 LIBTIFF_VERSION=$LIBTIFF_MAJOR_VERSION.$LIBTIFF_MINOR_VERSION.$LIBTIFF_MICRO_VERSION AC_SUBST(LIBTIFF_MAJOR_VERSION) AC_SUBST(LIBTIFF_MINOR_VERSION) AC_SUBST(LIBTIFF_MICRO_VERSION) AC_SUBST(LIBTIFF_VERSION) dnl Checks for programs. AC_PROG_LIBTOOL AC_PROG_CC AC_PROG_INSTALL AC_PROG_LN_S AC_PROG_RANLIB dnl Checks for libraries. AC_CHECK_LIB([GL], [main]) AC_CHECK_LIB([c], [main]) AC_CHECK_LIB([gl], [main]) AC_CHECK_LIB([glut], [main]) dnl We don't need to add math library at all targets case "$target_os" in cygwin* | mingw32* | beos* | darwin*) ;; *) AC_CHECK_LIB(m,main,,,) ;; esac dnl Checks for header files. AC_HEADER_STDC AC_CHECK_HEADERS([fcntl.h limits.h malloc.h memory.h stdlib.h string.h sys/time.h unistd.h]) dnl Checks for typedefs, structures, and compiler characteristics. AC_HEADER_STDBOOL AC_C_CONST AC_C_BIGENDIAN AC_TYPE_OFF_T AC_TYPE_SIZE_T AC_HEADER_TIME AC_STRUCT_TM dnl Checks for library functions. AC_FUNC_ERROR_AT_LINE AC_FUNC_MALLOC AC_FUNC_MEMCMP AC_FUNC_MMAP AC_FUNC_REALLOC AC_FUNC_VPRINTF AC_CHECK_FUNCS([floor gettimeofday isascii memmove memset munmap pow sqrt strcasecmp strchr strncasecmp strrchr strstr strtol strtoul]) AC_SYS_LARGEFILE dnl --------------------------------------------------------------------------- dnl Check for ZLIB. dnl --------------------------------------------------------------------------- HAVE_ZLIB=no AC_ARG_ENABLE(zlib, AS_HELP_STRING([--disable-zlib], [disable Zlib usage (required for Deflate compression, enabled by default)]),,) AC_ARG_WITH(zlib-inc,AS_HELP_STRING([--with-zlib-inc=ARG], [location of Zlib headers (specify, if not in standard place)]),,) AC_ARG_WITH(zlib-lib,AS_HELP_STRING([--with-zlib-lib=ARG], [location of Zlib library binary (specify, if not in standard place)]),,) if test "x$enable_zlib" != "xno" ; then if test "x$with_zlib_lib" = "xyes" ; then AC_CHECK_LIB(z, inflateEnd, [zlib_lib=yes], [zlib_lib=no],) elif test "x$with_zlib_lib" != "xno" ; then LIBS="$with_zlib_lib $LIBS" AC_CHECK_LIB(z, inflateEnd, [zlib_lib=yes], [zlib_lib=no],) if test "$zlib_lib" = "no" ; then AC_MSG_ERROR([Zlib library not found in $with_zlib_lib]) fi fi if test "x$with_zlib_h" = "xyes" ; then AC_CHECK_HEADER(zlib.h, [zlib_h=yes], [zlib_h=no]) elif test "x$with_zlib_h" != "xno" ; then INCLUDE="$with_zlib_h $INCLUDE" AC_CHECK_HEADER(zlib.h, [zlib_h=yes], [zlib_h=no]) if test "$zlib_h" = "no" ; then AC_MSG_ERROR([Zlib headers not found in $with_zlib_h]) fi fi if test "$zlib_lib" = "yes" -a "$zlib_h" = "yes" ; then HAVE_ZLIB=yes fi fi if test "$HAVE_ZLIB" = "yes" ; then CPPFLAGS="-DZIP_SUPPORT $CPPFLAGS" LIBS="-lz $LIBS" fi dnl --------------------------------------------------------------------------- dnl Check for JPEG. dnl --------------------------------------------------------------------------- HAVE_JPEG=no AC_ARG_ENABLE(jpeg, AS_HELP_STRING([--disable-jpeg], [disable IJG JPEG library usage (required for JPEG compression, enabled by default)]),,) AC_ARG_WITH(jpeg-inc,AS_HELP_STRING([--with-jpeg-inc=ARG], [location of IJG JPEG library headers (specify, if not in standard place)]),,) AC_ARG_WITH(jpeg-lib,AS_HELP_STRING([--with-jpeg-lib=ARG], [location of IJG JPEG library binary (specify, if not in standard place)]),,) if test "x$enable_jpeg" != "xno" ; then if test "x$with_jpeg_lib" = "xyes" ; then AC_CHECK_LIB(jpeg, jpeg_read_scanlines, [jpeg_lib=yes], [jpeg_lib=no],) elif test "x$with_jpeg_lib" != "xno" ; then LIBS="$with_jpeg_lib $LIBS" AC_CHECK_LIB(jpeg, jpeg_read_scanlines, [jpeg_lib=yes], [jpeg_lib=no],) if test "$jpeg_lib" = "no" ; then AC_MSG_ERROR([IJG JPEG library not found in $with_jpeg_lib]) fi fi if test "x$with_jpeg_h" = "xyes" ; then AC_CHECK_HEADER(jpeglib.h, [jpeg_h=yes], [jpeg_h=no]) elif test "x$with_jpeg_h" != "xno" ; then INCLUDE="$with_jpeg_h $INCLUDE" AC_CHECK_HEADER(jpeglib.h, [jpeg_h=yes], [jpeg_h=no]) if test "$jpeg_h" = "no" ; then AC_MSG_ERROR([IJG JPEG library headers not found in $with_jpeg_h]) fi fi if test "$jpeg_lib" = "yes" -a "$jpeg_h" = "yes" ; then HAVE_JPEG=yes fi fi if test "$HAVE_JPEG" = "yes" ; then CPPFLAGS="-DJPEG_SUPPORT $CPPFLAGS" LIBS="-ljpeg $LIBS" fi dnl --------------------------------------------------------------------------- dnl Check for Old JPEG. dnl --------------------------------------------------------------------------- HAVE_OJPEG=no AC_ARG_ENABLE(old-jpeg, AS_HELP_STRING([--enable-old-jpeg], [enable support for Old JPEG compresson (read contrib/ojpeg/README first! Compilation fails with unpatched IJG JPEG library)]), [HAVE_OJPEG=yes], [HAVE_OJPEG=no]) if test "$HAVE_JPEG" = "yes" -a "$HAVE_OJPEG" = "yes" ; then CPPFLAGS="-DOJPEG_SUPPORT $CPPFLAGS" fi dnl --------------------------------------------------------------------------- AC_SUBST(LIBTIFF,../libtiff/libtiff.la) AC_CONFIG_FILES([Makefile \ html/Makefile \ html/images/Makefile \ html/man/Makefile \ libtiff/Makefile \ man/Makefile \ port/Makefile \ tools/Makefile]) AC_OUTPUT