configure.in
author Sam Lantinga <slouken@libsdl.org>
Tue, 24 Jul 2001 05:11:09 +0000
changeset 40 2fabaf8296e5
parent 35 4b1f174486fa
child 43 c904a1959598
permissions -rw-r--r--
Oops, typos in configure.in
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@35
    16
MICRO_VERSION=1
slouken@28
    17
INTERFACE_AGE=0
slouken@35
    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@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@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@2
    65
            ac_default_prefix=/usr/local/cross-tools/i386-mingw32msvc
slouken@2
    66
        fi
slouken@2
    67
        ;;
slouken@0
    68
esac
slouken@0
    69
slouken@0
    70
dnl Check for SDL
slouken@29
    71
SDL_VERSION=1.2.0
slouken@0
    72
AM_PATH_SDL($SDL_VERSION,
slouken@0
    73
            :,
slouken@0
    74
	    AC_MSG_ERROR([*** SDL version $SDL_VERSION not found!])
slouken@0
    75
)
slouken@0
    76
CFLAGS="$CFLAGS $SDL_CFLAGS"
slouken@0
    77
IMG_LIBS="$IMG_LIBS $SDL_LIBS"
slouken@2
    78
LIBS="$SDL_LIBS $LIBS"
slouken@0
    79
slouken@0
    80
dnl Check command-line options
slouken@0
    81
AC_ARG_ENABLE(bmp,
slouken@0
    82
[  --enable-bmp            support loading BMP images [default=yes]],
slouken@0
    83
              , enable_bmp=yes)
slouken@0
    84
if test x$enable_bmp = xyes; then
slouken@0
    85
    CFLAGS="$CFLAGS -DLOAD_BMP"
slouken@0
    86
fi
slouken@0
    87
AC_ARG_ENABLE(gif,
slouken@0
    88
[  --enable-gif            support loading GIF images [default=yes]],
slouken@0
    89
              , enable_gif=yes)
slouken@0
    90
if test x$enable_gif = xyes; then
slouken@0
    91
    CFLAGS="$CFLAGS -DLOAD_GIF"
slouken@0
    92
fi
slouken@0
    93
AC_ARG_ENABLE(jpg,
slouken@0
    94
[  --enable-jpg            support loading JPG images [default=yes]],
slouken@0
    95
              , enable_jpg=yes)
slouken@0
    96
if test x$enable_jpg = xyes; then
slouken@0
    97
    AC_CHECK_LIB(jpeg, jpeg_CreateDecompress, have_libjpeg=yes)
slouken@0
    98
    if test x$have_libjpeg = xyes; then
slouken@0
    99
        CFLAGS="$CFLAGS -DLOAD_JPG"
slouken@0
   100
        IMG_LIBS="$IMG_LIBS -ljpeg"
slouken@0
   101
    else
slouken@40
   102
        AC_MSG_WARN([
slouken@0
   103
*** Unable to find JPEG library (http://www.ijg.org/)
slouken@0
   104
])
slouken@0
   105
        AC_MSG_WARN([JPG image loading disabled])
slouken@0
   106
    fi
slouken@0
   107
fi
slouken@0
   108
AC_ARG_ENABLE(pcx,
slouken@0
   109
[  --enable-pcx            support loading PCX images [default=yes]],
slouken@0
   110
              , enable_pcx=yes)
slouken@0
   111
if test x$enable_pcx = xyes; then
slouken@0
   112
    CFLAGS="$CFLAGS -DLOAD_PCX"
slouken@0
   113
fi
slouken@0
   114
AC_ARG_ENABLE(png,
slouken@0
   115
[  --enable-png            support loading PNG images [default=yes]],
slouken@0
   116
              , enable_png=yes)
slouken@0
   117
if test x$enable_png = xyes; then
slouken@0
   118
    AC_CHECK_LIB(png, png_create_read_struct, have_libpng=yes, , -lz)
slouken@0
   119
    if test x$have_libpng != xyes; then
slouken@0
   120
        AC_MSG_WARN([
slouken@0
   121
*** Unable to find PNG library (http://www.cdrom.com/pub/png/)
slouken@0
   122
])
slouken@0
   123
    fi
slouken@0
   124
    AC_CHECK_LIB(z, uncompress, have_libz=yes)
slouken@0
   125
    if test x$have_libz != xyes; then
slouken@0
   126
        AC_MSG_WARN([
slouken@0
   127
*** Unable to find Zlib library (http://www.cdrom.com/pub/infozip/zlib/)
slouken@0
   128
])
slouken@0
   129
    fi
slouken@0
   130
    if test x$have_libpng = xyes -a x$have_libz = xyes; then
slouken@0
   131
        CFLAGS="$CFLAGS -DLOAD_PNG"
slouken@0
   132
        IMG_LIBS="$IMG_LIBS -lpng -lz"
slouken@0
   133
    else
slouken@0
   134
        AC_MSG_WARN([PNG image loading disabled])
slouken@0
   135
    fi
slouken@0
   136
fi
slouken@24
   137
AC_ARG_ENABLE(pnm,
slouken@24
   138
[  --enable-pnm            support loading PNM images [default=yes]],
slouken@24
   139
              , enable_pnm=yes)
slouken@24
   140
if test x$enable_pnm = xyes; then
slouken@24
   141
    CFLAGS="$CFLAGS -DLOAD_PNM"
slouken@0
   142
fi
slouken@0
   143
AC_ARG_ENABLE(tga,
slouken@0
   144
[  --enable-tga            support loading TGA images [default=yes]],
slouken@0
   145
              , enable_tga=yes)
slouken@0
   146
if test x$enable_tga = xyes; then
slouken@0
   147
    CFLAGS="$CFLAGS -DLOAD_TGA"
slouken@0
   148
fi
slouken@0
   149
AC_ARG_ENABLE(tif,
slouken@5
   150
[  --enable-tif            support loading TIFF images [default=no]],
slouken@5
   151
              , enable_tif=no)
slouken@0
   152
if test x$enable_tif = xyes; then
slouken@0
   153
    AC_CHECK_LIB(tiff, TIFFClientOpen, have_libtiff=yes)
slouken@0
   154
    if test x$have_libtiff = xyes; then
slouken@0
   155
        CFLAGS="$CFLAGS -DLOAD_TIF"
slouken@0
   156
        IMG_LIBS="$IMG_LIBS -ltiff"
slouken@0
   157
    else
slouken@40
   158
        AC_MSG_WARN([
slouken@0
   159
*** Unable to find Tiff library (ftp://ftp.sgi.com/graphics/tiff/)
slouken@0
   160
])
slouken@0
   161
        AC_MSG_WARN([TIF image loading disabled])
slouken@0
   162
    fi
slouken@0
   163
fi
slouken@26
   164
AC_ARG_ENABLE(xcf,
slouken@26
   165
[  --enable-xcf            support loading XCF images [default=no]],
slouken@26
   166
              , enable_xcf=no)
slouken@26
   167
if test x$enable_xcf = xyes; then
slouken@26
   168
    CFLAGS="$CFLAGS -DLOAD_XCF"
slouken@26
   169
fi
slouken@7
   170
AC_ARG_ENABLE(xpm,
slouken@7
   171
[  --enable-xpm            support loading XPM images [default=yes]],
slouken@7
   172
              , enable_xpm=yes)
slouken@7
   173
if test x$enable_xpm = xyes; then
slouken@7
   174
    CFLAGS="$CFLAGS -DLOAD_XPM"
slouken@7
   175
fi
slouken@0
   176
AC_SUBST(IMG_LIBS)
slouken@0
   177
slouken@0
   178
# Finally create all the generated files
slouken@0
   179
AC_OUTPUT([
slouken@0
   180
Makefile
slouken@0
   181
SDL_image.spec
slouken@0
   182
])