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