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
|
AC_INIT([Haskell GLUT package], [2.1.2.1], [sven.panne@aedion.de], [GLUT])
# Safety check: Ensure that we are in the correct source directory.
AC_CONFIG_SRCDIR([include/HsGLUT.h.in])
# The first file mentioned below will be generated by autoheader and contains
# defines which are needed during package build time only. The second header
# contains all kinds of stuff which is needed for using this package.
AC_CONFIG_HEADERS([include/HsGLUTConfig.h include/HsGLUT.h])
# Necessary for Cabal, which passes with --with-cc flag on Windows:
AC_ARG_WITH([cc],
[C compiler],
[CC=$withval])
AC_PROG_CC()
# we do not really care about this here, but this avoids a warning about an
# unknown option
FP_ARG_COMPILER
# We set this to "yes" later when we have found GLUT libs and headers.
GLUT_BUILD_PACKAGE=no
# Shall we build this package at all?
FP_ARG_GLUT
if test x"$enable_glut" = xyes; then
# Check for GLUT include paths and libraries
FP_CHECK_GLUT
if test "$GLUT_LIBS" = no; then
AC_MSG_FAILURE([no GLUT library found, so this package cannot be built])
fi
# check for GLUT include files
glut_found_header=no
fp_save_cppflags="$CPPFLAGS"
CPPFLAGS="$CPPFLAGS $X_CFLAGS"
AC_CHECK_HEADERS([GL/glut.h GLUT/glut.h], [glut_found_header=yes])
CPPFLAGS="$fp_save_cppflags"
if test "$glut_found_header" = no; then
AC_MSG_FAILURE([no GLUT header found, so this package cannot be built])
fi
GLUT_BUILD_PACKAGE=yes
AC_CHECK_HEADERS([windows.h])
AC_DEFINE_UNQUOTED([GLUT_EXTRA_LIBS],
[`echo HSGLUT_cbits $GLUT_EXTRA_LIBS | sed -e 's/[[^ ]]*/,"&"/g' -e 's/^ *,//'`],
[Extra libraries for GLUT, as a list of string literals.])
AC_DEFINE_UNQUOTED([GLUT_CFLAGS],
[`echo '' $GLUT_CFLAGS | sed -e 's/-[[^ ]]*/,"&"/g' -e 's/^ *,//'`],
[C flags for GLUT, as a list of string literals.])
AC_DEFINE_UNQUOTED([GLUT_LIBS],
[`echo '' $GLUT_LIBS | sed -e 's/-[[^ ]]*/,"&"/g' -e 's/^ *,//'`],
[Library flags for GLUT, as a list of string literals.])
AC_DEFINE_UNQUOTED([GLUT_FRAMEWORKS],
[`echo '' $GLUT_FRAMEWORKS | sed -e 's/-[[^ ]]*/,"&"/g' -e 's/^ *,//'`],
[Framework flags for GLUT, as a list of string literals.])
fi
if test "$GLUT_BUILD_PACKAGE" = yes; then
BUILD_PACKAGE_BOOL=True
else
BUILD_PACKAGE_BOOL=False
fi
AC_SUBST([BUILD_PACKAGE_BOOL])
case "$host" in
*-mingw32) CALLCONV=stdcall ;;
*) CALLCONV=ccall ;;
esac
AC_SUBST([CALLCONV])
AC_CONFIG_FILES([GLUT.buildinfo])
AC_OUTPUT
|