configure.in
author Sam Lantinga <slouken@lokigames.com>
Thu, 10 Aug 2000 06:05:39 +0000
changeset 0 76be7dab668c
child 2 e273b0e38b8b
permissions -rw-r--r--
Initial revision
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@0
    15
MINOR_VERSION=0
slouken@0
    16
MICRO_VERSION=9
slouken@0
    17
INTERFACE_AGE=0
slouken@0
    18
BINARY_AGE=9
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@0
    39
dnl Setup for automake
slouken@0
    40
AM_INIT_AUTOMAKE(SDL_image, $VERSION)
slouken@0
    41
slouken@0
    42
dnl Check for tools
slouken@0
    43
slouken@0
    44
AC_PROG_MAKE_SET
slouken@0
    45
AC_PROG_CC
slouken@0
    46
AM_PROG_LIBTOOL
slouken@0
    47
AC_PROG_INSTALL
slouken@0
    48
slouken@0
    49
dnl The alpha architecture needs special flags for binary portability
slouken@0
    50
AC_CANONICAL_TARGET
slouken@0
    51
case "$target" in
slouken@0
    52
    alpha*-*-linux*)
slouken@0
    53
        CFLAGS="$CFLAGS -mcpu=ev4 -Wa,-mall"
slouken@0
    54
        ;;
slouken@0
    55
esac
slouken@0
    56
slouken@0
    57
dnl Check for SDL
slouken@0
    58
SDL_VERSION=1.1.3
slouken@0
    59
AM_PATH_SDL($SDL_VERSION,
slouken@0
    60
            :,
slouken@0
    61
	    AC_MSG_ERROR([*** SDL version $SDL_VERSION not found!])
slouken@0
    62
)
slouken@0
    63
CFLAGS="$CFLAGS $SDL_CFLAGS"
slouken@0
    64
IMG_LIBS="$IMG_LIBS $SDL_LIBS"
slouken@0
    65
slouken@0
    66
dnl Check command-line options
slouken@0
    67
AC_ARG_ENABLE(bmp,
slouken@0
    68
[  --enable-bmp            support loading BMP images [default=yes]],
slouken@0
    69
              , enable_bmp=yes)
slouken@0
    70
if test x$enable_bmp = xyes; then
slouken@0
    71
    CFLAGS="$CFLAGS -DLOAD_BMP"
slouken@0
    72
fi
slouken@0
    73
AC_ARG_ENABLE(gif,
slouken@0
    74
[  --enable-gif            support loading GIF images [default=yes]],
slouken@0
    75
              , enable_gif=yes)
slouken@0
    76
if test x$enable_gif = xyes; then
slouken@0
    77
    CFLAGS="$CFLAGS -DLOAD_GIF"
slouken@0
    78
fi
slouken@0
    79
AC_ARG_ENABLE(jpg,
slouken@0
    80
[  --enable-jpg            support loading JPG images [default=yes]],
slouken@0
    81
              , enable_jpg=yes)
slouken@0
    82
if test x$enable_jpg = xyes; then
slouken@0
    83
    AC_CHECK_LIB(jpeg, jpeg_CreateDecompress, have_libjpeg=yes)
slouken@0
    84
    if test x$have_libjpeg = xyes; then
slouken@0
    85
        CFLAGS="$CFLAGS -DLOAD_JPG"
slouken@0
    86
        IMG_LIBS="$IMG_LIBS -ljpeg"
slouken@0
    87
    else
slouken@0
    88
        AC_MSG_WARN(
slouken@0
    89
*** Unable to find JPEG library (http://www.ijg.org/)
slouken@0
    90
])
slouken@0
    91
        AC_MSG_WARN([JPG image loading disabled])
slouken@0
    92
    fi
slouken@0
    93
fi
slouken@0
    94
AC_ARG_ENABLE(pcx,
slouken@0
    95
[  --enable-pcx            support loading PCX images [default=yes]],
slouken@0
    96
              , enable_pcx=yes)
slouken@0
    97
if test x$enable_pcx = xyes; then
slouken@0
    98
    CFLAGS="$CFLAGS -DLOAD_PCX"
slouken@0
    99
fi
slouken@0
   100
AC_ARG_ENABLE(png,
slouken@0
   101
[  --enable-png            support loading PNG images [default=yes]],
slouken@0
   102
              , enable_png=yes)
slouken@0
   103
if test x$enable_png = xyes; then
slouken@0
   104
    AC_CHECK_LIB(png, png_create_read_struct, have_libpng=yes, , -lz)
slouken@0
   105
    if test x$have_libpng != xyes; then
slouken@0
   106
        AC_MSG_WARN([
slouken@0
   107
*** Unable to find PNG library (http://www.cdrom.com/pub/png/)
slouken@0
   108
])
slouken@0
   109
    fi
slouken@0
   110
    AC_CHECK_LIB(z, uncompress, have_libz=yes)
slouken@0
   111
    if test x$have_libz != xyes; then
slouken@0
   112
        AC_MSG_WARN([
slouken@0
   113
*** Unable to find Zlib library (http://www.cdrom.com/pub/infozip/zlib/)
slouken@0
   114
])
slouken@0
   115
    fi
slouken@0
   116
    if test x$have_libpng = xyes -a x$have_libz = xyes; then
slouken@0
   117
        CFLAGS="$CFLAGS -DLOAD_PNG"
slouken@0
   118
        IMG_LIBS="$IMG_LIBS -lpng -lz"
slouken@0
   119
    else
slouken@0
   120
        AC_MSG_WARN([PNG image loading disabled])
slouken@0
   121
    fi
slouken@0
   122
fi
slouken@0
   123
AC_ARG_ENABLE(ppm,
slouken@0
   124
[  --enable-ppm            support loading PPM images [default=yes]],
slouken@0
   125
              , enable_ppm=yes)
slouken@0
   126
if test x$enable_ppm = xyes; then
slouken@0
   127
    CFLAGS="$CFLAGS -DLOAD_PPM"
slouken@0
   128
fi
slouken@0
   129
AC_ARG_ENABLE(tga,
slouken@0
   130
[  --enable-tga            support loading TGA images [default=yes]],
slouken@0
   131
              , enable_tga=yes)
slouken@0
   132
if test x$enable_tga = xyes; then
slouken@0
   133
    CFLAGS="$CFLAGS -DLOAD_TGA"
slouken@0
   134
fi
slouken@0
   135
AC_ARG_ENABLE(tif,
slouken@0
   136
[  --enable-tif            support loading TIF images [default=yes]],
slouken@0
   137
              , enable_tif=yes)
slouken@0
   138
if test x$enable_tif = xyes; then
slouken@0
   139
    AC_CHECK_LIB(tiff, TIFFClientOpen, have_libtiff=yes)
slouken@0
   140
    if test x$have_libtiff = xyes; then
slouken@0
   141
        CFLAGS="$CFLAGS -DLOAD_TIF"
slouken@0
   142
        IMG_LIBS="$IMG_LIBS -ltiff"
slouken@0
   143
    else
slouken@0
   144
        AC_MSG_WARN(
slouken@0
   145
*** Unable to find Tiff library (ftp://ftp.sgi.com/graphics/tiff/)
slouken@0
   146
])
slouken@0
   147
        AC_MSG_WARN([TIF image loading disabled])
slouken@0
   148
    fi
slouken@0
   149
fi
slouken@0
   150
AC_SUBST(IMG_LIBS)
slouken@0
   151
slouken@0
   152
# Finally create all the generated files
slouken@0
   153
AC_OUTPUT([
slouken@0
   154
Makefile
slouken@0
   155
SDL_image.spec
slouken@0
   156
])