configure.in
author Sam Lantinga <slouken@libsdl.org>
Sun, 04 Jan 2004 17:41:55 +0000
changeset 97 e1161bd417c4
parent 93 7b2be211c12f
child 106 65e8cd587119
permissions -rw-r--r--
Updated copyright information for 2004 (Happy New Year!)
     1 dnl Process this file with autoconf to produce a configure script.
     2 AC_INIT(README)
     3 
     4 dnl Set various version strings - taken gratefully from the GTk sources
     5 
     6 # Making releases:
     7 #   MICRO_VERSION += 1;
     8 #   INTERFACE_AGE += 1;
     9 #   BINARY_AGE += 1;
    10 # if any functions have been added, set INTERFACE_AGE to 0.
    11 # if backwards compatibility has been broken,
    12 # set BINARY_AGE and INTERFACE_AGE to 0.
    13 
    14 MAJOR_VERSION=1
    15 MINOR_VERSION=2
    16 MICRO_VERSION=4
    17 INTERFACE_AGE=3
    18 BINARY_AGE=4
    19 VERSION=$MAJOR_VERSION.$MINOR_VERSION.$MICRO_VERSION
    20 
    21 AC_SUBST(MAJOR_VERSION)
    22 AC_SUBST(MINOR_VERSION)
    23 AC_SUBST(MICRO_VERSION)
    24 AC_SUBST(INTERFACE_AGE)
    25 AC_SUBST(BINARY_AGE)
    26 AC_SUBST(VERSION)
    27 
    28 # libtool versioning
    29 LT_RELEASE=$MAJOR_VERSION.$MINOR_VERSION
    30 LT_CURRENT=`expr $MICRO_VERSION - $INTERFACE_AGE`
    31 LT_REVISION=$INTERFACE_AGE
    32 LT_AGE=`expr $BINARY_AGE - $INTERFACE_AGE`
    33 
    34 AC_SUBST(LT_RELEASE)
    35 AC_SUBST(LT_CURRENT)
    36 AC_SUBST(LT_REVISION)
    37 AC_SUBST(LT_AGE)
    38 
    39 dnl Detect the canonical host and target build environment
    40 AC_CANONICAL_HOST
    41 AC_CANONICAL_TARGET
    42 
    43 dnl Setup for automake
    44 AM_INIT_AUTOMAKE(SDL_image, $VERSION)
    45 AM_MAINTAINER_MODE
    46 
    47 dnl Check for tools
    48 
    49 AC_LIBTOOL_WIN32_DLL
    50 AM_PROG_LIBTOOL
    51 AC_PROG_MAKE_SET
    52 AC_PROG_CC
    53 AC_C_INLINE
    54 AC_PROG_INSTALL
    55 
    56 dnl The alpha architecture needs special flags for binary portability
    57 case "$target" in
    58     alpha*-*-linux*)
    59         CFLAGS="$CFLAGS -mcpu=ev4 -Wa,-mall"
    60         ;;
    61     *-*-beos*)
    62         ac_default_prefix=/boot/develop/tools/gnupro
    63         ;;
    64     *-*-cygwin* | *-*-mingw32*)
    65         if test "$build" != "$target"; then # cross-compiling
    66             # Default cross-compile location
    67             ac_default_prefix=/usr/local/cross-tools/i386-mingw32msvc
    68         else
    69             # Look for the location of the tools and install there
    70             if [ "$BUILD_PREFIX" != "" ]; then
    71                 ac_default_prefix=$BUILD_PREFIX
    72             fi
    73         fi
    74         ;;
    75 esac
    76 
    77 dnl Check for SDL
    78 SDL_VERSION=1.2.4
    79 AM_PATH_SDL($SDL_VERSION,
    80             :,
    81 	    AC_MSG_ERROR([*** SDL version $SDL_VERSION not found!])
    82 )
    83 CFLAGS="$CFLAGS $SDL_CFLAGS"
    84 LIBS="$LIBS $SDL_LIBS"
    85 
    86 dnl Check command-line options
    87 AC_ARG_ENABLE(bmp,
    88 [  --enable-bmp            support loading BMP images [default=yes]],
    89               , enable_bmp=yes)
    90 if test x$enable_bmp = xyes; then
    91     CFLAGS="$CFLAGS -DLOAD_BMP"
    92 fi
    93 AC_ARG_ENABLE(gif,
    94 [  --enable-gif            support loading GIF images [default=yes]],
    95               , enable_gif=yes)
    96 if test x$enable_gif = xyes; then
    97     CFLAGS="$CFLAGS -DLOAD_GIF"
    98 fi
    99 AC_ARG_ENABLE(jpg,
   100 [  --enable-jpg            support loading JPG images [default=yes]],
   101               , enable_jpg=yes)
   102 if test x$enable_jpg = xyes; then
   103     AC_CHECK_LIB(jpeg, jpeg_CreateDecompress, have_libjpeg=yes)
   104     if test x$have_libjpeg = xyes; then
   105         CFLAGS="$CFLAGS -DLOAD_JPG"
   106         IMG_LIBS="$IMG_LIBS -ljpeg"
   107     else
   108         AC_MSG_WARN([
   109 *** Unable to find JPEG library (http://www.ijg.org/)
   110 ])
   111         AC_MSG_WARN([JPG image loading disabled])
   112     fi
   113 fi
   114 AC_ARG_ENABLE(lbm,
   115 [  --enable-lbm            support loading LBM images [default=yes]],
   116               , enable_lbm=yes)
   117 if test x$enable_lbm = xyes; then
   118     CFLAGS="$CFLAGS -DLOAD_LBM"
   119 fi
   120 AC_ARG_ENABLE(pcx,
   121 [  --enable-pcx            support loading PCX images [default=yes]],
   122               , enable_pcx=yes)
   123 if test x$enable_pcx = xyes; then
   124     CFLAGS="$CFLAGS -DLOAD_PCX"
   125 fi
   126 AC_ARG_ENABLE(png,
   127 [  --enable-png            support loading PNG images [default=yes]],
   128               , enable_png=yes)
   129 if test x$enable_png = xyes; then
   130     AC_CHECK_LIB(png, png_create_read_struct, have_libpng=yes, , -lz)
   131     if test x$have_libpng != xyes; then
   132         AC_MSG_WARN([
   133 *** Unable to find PNG library (http://www.libpng.org/pub/png/libpng.html)
   134 ])
   135     fi
   136     AC_CHECK_LIB(z, uncompress, have_libz=yes)
   137     if test x$have_libz != xyes; then
   138         AC_MSG_WARN([
   139 *** Unable to find Zlib library (http://www.gzip.org/zlib/)
   140 ])
   141     fi
   142     if test x$have_libpng = xyes -a x$have_libz = xyes; then
   143         CFLAGS="$CFLAGS -DLOAD_PNG"
   144         IMG_LIBS="$IMG_LIBS -lpng -lz"
   145     else
   146         AC_MSG_WARN([PNG image loading disabled])
   147     fi
   148 fi
   149 AC_ARG_ENABLE(pnm,
   150 [  --enable-pnm            support loading PNM images [default=yes]],
   151               , enable_pnm=yes)
   152 if test x$enable_pnm = xyes; then
   153     CFLAGS="$CFLAGS -DLOAD_PNM"
   154 fi
   155 AC_ARG_ENABLE(tga,
   156 [  --enable-tga            support loading TGA images [default=yes]],
   157               , enable_tga=yes)
   158 if test x$enable_tga = xyes; then
   159     CFLAGS="$CFLAGS -DLOAD_TGA"
   160 fi
   161 AC_ARG_ENABLE(tif,
   162 [  --enable-tif            support loading TIFF images [default=no]],
   163               , enable_tif=no)
   164 if test x$enable_tif = xyes; then
   165     AC_CHECK_LIB(tiff, TIFFClientOpen, have_libtiff=yes)
   166     if test x$have_libtiff = xyes; then
   167         CFLAGS="$CFLAGS -DLOAD_TIF"
   168         IMG_LIBS="$IMG_LIBS -ltiff"
   169     else
   170         AC_MSG_WARN([
   171 *** Unable to find Tiff library (ftp://ftp.sgi.com/graphics/tiff/)
   172 ])
   173         AC_MSG_WARN([TIF image loading disabled])
   174     fi
   175 fi
   176 AC_ARG_ENABLE(xcf,
   177 [  --enable-xcf            support loading XCF images [default=no]],
   178               , enable_xcf=no)
   179 if test x$enable_xcf = xyes; then
   180     CFLAGS="$CFLAGS -DLOAD_XCF"
   181 fi
   182 AC_ARG_ENABLE(xpm,
   183 [  --enable-xpm            support loading XPM images [default=yes]],
   184               , enable_xpm=yes)
   185 if test x$enable_xpm = xyes; then
   186     CFLAGS="$CFLAGS -DLOAD_XPM"
   187 fi
   188 AC_SUBST(IMG_LIBS)
   189 
   190 # Finally create all the generated files
   191 AC_OUTPUT([
   192 Makefile
   193 SDL_image.spec
   194 SDL_image.qpg
   195 ])