configure.in
author Sam Lantinga <slouken@lokigames.com>
Fri, 02 Mar 2001 22:48:41 +0000
changeset 22 5f9c7cfd0b79
parent 12 94f2a42b2df8
child 24 69f3d44d56da
permissions -rw-r--r--
Mattias Engdeg�rd - Fri Mar 2 14:48:09 PST 2001
* Cleaned up some compiler warnings
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@7
    15
MINOR_VERSION=1
slouken@12
    16
MICRO_VERSION=1
slouken@12
    17
INTERFACE_AGE=1
slouken@12
    18
BINARY_AGE=1
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@2
    42
dnl Detect the canonical host and target build environment
slouken@2
    43
AC_CANONICAL_HOST
slouken@2
    44
AC_CANONICAL_TARGET
slouken@2
    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@2
    60
    *-*-cygwin* | *-*-mingw32*)
slouken@2
    61
        if test "$build" != "$target"; then # cross-compiling
slouken@2
    62
            ac_default_prefix=/usr/local/cross-tools/i386-mingw32msvc
slouken@2
    63
        fi
slouken@2
    64
        ;;
slouken@0
    65
esac
slouken@0
    66
slouken@0
    67
dnl Check for SDL
slouken@4
    68
SDL_VERSION=1.1.5
slouken@0
    69
AM_PATH_SDL($SDL_VERSION,
slouken@0
    70
            :,
slouken@0
    71
	    AC_MSG_ERROR([*** SDL version $SDL_VERSION not found!])
slouken@0
    72
)
slouken@0
    73
CFLAGS="$CFLAGS $SDL_CFLAGS"
slouken@0
    74
IMG_LIBS="$IMG_LIBS $SDL_LIBS"
slouken@2
    75
LIBS="$SDL_LIBS $LIBS"
slouken@0
    76
slouken@0
    77
dnl Check command-line options
slouken@0
    78
AC_ARG_ENABLE(bmp,
slouken@0
    79
[  --enable-bmp            support loading BMP images [default=yes]],
slouken@0
    80
              , enable_bmp=yes)
slouken@0
    81
if test x$enable_bmp = xyes; then
slouken@0
    82
    CFLAGS="$CFLAGS -DLOAD_BMP"
slouken@0
    83
fi
slouken@0
    84
AC_ARG_ENABLE(gif,
slouken@0
    85
[  --enable-gif            support loading GIF images [default=yes]],
slouken@0
    86
              , enable_gif=yes)
slouken@0
    87
if test x$enable_gif = xyes; then
slouken@0
    88
    CFLAGS="$CFLAGS -DLOAD_GIF"
slouken@0
    89
fi
slouken@0
    90
AC_ARG_ENABLE(jpg,
slouken@0
    91
[  --enable-jpg            support loading JPG images [default=yes]],
slouken@0
    92
              , enable_jpg=yes)
slouken@0
    93
if test x$enable_jpg = xyes; then
slouken@0
    94
    AC_CHECK_LIB(jpeg, jpeg_CreateDecompress, have_libjpeg=yes)
slouken@0
    95
    if test x$have_libjpeg = xyes; then
slouken@0
    96
        CFLAGS="$CFLAGS -DLOAD_JPG"
slouken@0
    97
        IMG_LIBS="$IMG_LIBS -ljpeg"
slouken@0
    98
    else
slouken@0
    99
        AC_MSG_WARN(
slouken@0
   100
*** Unable to find JPEG library (http://www.ijg.org/)
slouken@0
   101
])
slouken@0
   102
        AC_MSG_WARN([JPG image loading disabled])
slouken@0
   103
    fi
slouken@0
   104
fi
slouken@0
   105
AC_ARG_ENABLE(pcx,
slouken@0
   106
[  --enable-pcx            support loading PCX images [default=yes]],
slouken@0
   107
              , enable_pcx=yes)
slouken@0
   108
if test x$enable_pcx = xyes; then
slouken@0
   109
    CFLAGS="$CFLAGS -DLOAD_PCX"
slouken@0
   110
fi
slouken@0
   111
AC_ARG_ENABLE(png,
slouken@0
   112
[  --enable-png            support loading PNG images [default=yes]],
slouken@0
   113
              , enable_png=yes)
slouken@0
   114
if test x$enable_png = xyes; then
slouken@0
   115
    AC_CHECK_LIB(png, png_create_read_struct, have_libpng=yes, , -lz)
slouken@0
   116
    if test x$have_libpng != xyes; then
slouken@0
   117
        AC_MSG_WARN([
slouken@0
   118
*** Unable to find PNG library (http://www.cdrom.com/pub/png/)
slouken@0
   119
])
slouken@0
   120
    fi
slouken@0
   121
    AC_CHECK_LIB(z, uncompress, have_libz=yes)
slouken@0
   122
    if test x$have_libz != xyes; then
slouken@0
   123
        AC_MSG_WARN([
slouken@0
   124
*** Unable to find Zlib library (http://www.cdrom.com/pub/infozip/zlib/)
slouken@0
   125
])
slouken@0
   126
    fi
slouken@0
   127
    if test x$have_libpng = xyes -a x$have_libz = xyes; then
slouken@0
   128
        CFLAGS="$CFLAGS -DLOAD_PNG"
slouken@0
   129
        IMG_LIBS="$IMG_LIBS -lpng -lz"
slouken@0
   130
    else
slouken@0
   131
        AC_MSG_WARN([PNG image loading disabled])
slouken@0
   132
    fi
slouken@0
   133
fi
slouken@0
   134
AC_ARG_ENABLE(ppm,
slouken@0
   135
[  --enable-ppm            support loading PPM images [default=yes]],
slouken@0
   136
              , enable_ppm=yes)
slouken@0
   137
if test x$enable_ppm = xyes; then
slouken@0
   138
    CFLAGS="$CFLAGS -DLOAD_PPM"
slouken@0
   139
fi
slouken@0
   140
AC_ARG_ENABLE(tga,
slouken@0
   141
[  --enable-tga            support loading TGA images [default=yes]],
slouken@0
   142
              , enable_tga=yes)
slouken@0
   143
if test x$enable_tga = xyes; then
slouken@0
   144
    CFLAGS="$CFLAGS -DLOAD_TGA"
slouken@0
   145
fi
slouken@0
   146
AC_ARG_ENABLE(tif,
slouken@5
   147
[  --enable-tif            support loading TIFF images [default=no]],
slouken@5
   148
              , enable_tif=no)
slouken@0
   149
if test x$enable_tif = xyes; then
slouken@0
   150
    AC_CHECK_LIB(tiff, TIFFClientOpen, have_libtiff=yes)
slouken@0
   151
    if test x$have_libtiff = xyes; then
slouken@0
   152
        CFLAGS="$CFLAGS -DLOAD_TIF"
slouken@0
   153
        IMG_LIBS="$IMG_LIBS -ltiff"
slouken@0
   154
    else
slouken@0
   155
        AC_MSG_WARN(
slouken@0
   156
*** Unable to find Tiff library (ftp://ftp.sgi.com/graphics/tiff/)
slouken@0
   157
])
slouken@0
   158
        AC_MSG_WARN([TIF image loading disabled])
slouken@0
   159
    fi
slouken@0
   160
fi
slouken@7
   161
AC_ARG_ENABLE(xpm,
slouken@7
   162
[  --enable-xpm            support loading XPM images [default=yes]],
slouken@7
   163
              , enable_xpm=yes)
slouken@7
   164
if test x$enable_xpm = xyes; then
slouken@7
   165
    CFLAGS="$CFLAGS -DLOAD_XPM"
slouken@7
   166
fi
slouken@0
   167
AC_SUBST(IMG_LIBS)
slouken@0
   168
slouken@0
   169
# Finally create all the generated files
slouken@0
   170
AC_OUTPUT([
slouken@0
   171
Makefile
slouken@0
   172
SDL_image.spec
slouken@0
   173
])