1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88
|
dnl Process this file with autoconf to produce a configure script.
AC_INIT(TestGfxPrimitives.c)
dnl Setup for automake
AM_INIT_AUTOMAKE(TestGfxPrimitives, 1.0)
dnl SDL version required
SDL_VERSION=1.2.0
dnl Setup for automake
dnl Detect the canonical host and target build environment
AC_CANONICAL_HOST
AC_CANONICAL_TARGET
dnl Check for compilers
AC_LIBTOOL_WIN32_DLL
AM_PROG_LIBTOOL
AC_PROG_MAKE_SET
AC_PROG_CC
AC_PROG_CXX
AC_PROG_INSTALL
dnl Check for compiler environment
AC_C_CONST
dnl Set for C compiler by default
AC_LANG_C
dnl Setup target flagsw
case "$target" in
*-*-cygwin* | *-*-mingw32*)
CFLAGS="$CFLAGS -DWIN32"
if test "$build" != "$target"; then # cross-compiling
ac_default_prefix=/usr/local/cross-tools/i386-mingw32msvc
fi
;;
*)
dnl nothing to do
;;
esac
dnl Figure out which math library to use
case "$target" in
*-*-cygwin* | *-*-mingw32*)
MATHLIB=""
;;
*-*-beos*)
MATHLIB=""
;;
*-*-darwin*)
MATHLIB=""
;;
*-*-aix*)
MATHLIB="-lm"
if test x$ac_cv_prog_gcc = xyes; then
CFLAGS="-mthreads"
fi
;;
*)
MATHLIB="-lm"
;;
esac
AC_SUBST(MATHLIB)
LIBS="$LIBS $MATHLIB"
dnl Check for SDL
AM_PATH_SDL($SDL_VERSION,
:,
AC_MSG_ERROR([*** SDL version $SDL_VERSION not found!])
)
CFLAGS="$CFLAGS $SDL_CFLAGS"
LIBS="$LIBS $SDL_LIBS"
dnl Check for the SDL_gfx lib
have_sdlgfx=no
AC_CHECK_LIB(SDL_gfx, pixelColor , have_sdlgfx=yes)
if test x$have_sdlgfx = xyes; then
LIBS="$LIBS -lSDL_gfx"
else
AC_MSG_ERROR([
*** Unable to find SDL_gfx library
])
fi
# Finally create all the generated files
AC_OUTPUT([Makefile])
|