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