dxx-rebirth/configure.in
2001-01-24 05:35:33 +00:00

207 lines
5.1 KiB
Plaintext

AC_INIT(main/game.c)
AM_CONFIG_HEADER(conf.h)
AM_INIT_AUTOMAKE(d2x, 0.0.9)
AM_MAINTAINER_MODE
AC_ISC_POSIX
AC_PROG_CC
AC_PROG_RANLIB
AC_STDC_HEADERS
AC_CYGWIN
AC_MINGW32
CFLAGS="-g -O2 -Wall"
dnl Count warnings as errors?
AC_ARG_ENABLE(werror,
[ --enable-werror Count compiler warning as errors ],
[case "${enableval}" in
yes) CFLAGS="-Werror $CFLAGS" ;;
no) ;;
*) AC_MSG_ERROR(bad value ${enableval} for --enable-werror) ;;
esac],)
dnl Build with NDEBUG?
AC_ARG_ENABLE(ndebug,
[ --enable-ndebug Take out extra Asserts, Int3, etc ],
[case "${enableval}" in
yes) AC_DEFINE(NDEBUG) ;;
no) ;;
*) AC_MSG_ERROR(bad value ${withval} for --enable-ndebug) ;;
esac],)
# Test for DJGPP
if test "$OSTYPE" = "MSDOS"; then
CFLAGS="-I \$(top_srcdir)/arch/dos/include $CFLAGS"
AM_CONDITIONAL(ENV_DJGPP, test "$OSTYPE" = "MSDOS")
AC_DEFINE(__ENV_DJGPP__)
AC_PATH_PROG(NASM, nasmw, no)
else
CFLAGS="-D_REENTRANT -pipe $CFLAGS"
AM_CONDITIONAL(ENV_LINUX, test "$OSTYPE" != "MSDOS")
AC_DEFINE(__ENV_LINUX__)
AC_CHECK_LIB(SDL, SDL_Init, SDL_LIBS="-lSDL", AC_MSG_ERROR(The SDL which is required not found.),-ldl -lpthread)
AC_CHECK_HEADERS(netipx/ipx.h)
AC_SUBST(SDL_LIBS)
# Check for OpenGL
AC_ARG_WITH(opengl,
[ --with-opengl Build OpenGL support ],
[case "${withval}" in
yes) opengl=true ;;
no) opengl=false ;;
*) AC_MSG_ERROR(bad value ${withval} for --with-opengl) ;;
esac],[opengl=false])
if test x$opengl = xtrue; then
AC_CHECK_LIB(GL, main,
OGL_LIBS="-lGL",
[AC_MSG_ERROR([GL not found, OpenGL cannot be built])
opengl=false],
-L/usr/X11R6/lib -lX11 -lXext -lm)
AC_CHECK_LIB(GLU,main,
OGL_LIBS="${OGL_LIBS} -lGLU",
[AC_MSG_ERROR([GLU not found, OpenGL cannot be built])
opengl=false],
-lGL -L/usr/X11R6/lib -lX11 -lXext -lm)
fi
AC_SUBST(OGL_LIBS)
AM_CONDITIONAL(USE_OPENGL, test x$opengl = xtrue)
# Check for GGI
AC_ARG_WITH(ggi,
[ --with-ggi Build GGI support ],
[case "${withval}" in
yes) ggi=true ;;
no) ggi=false ;;
*) AC_MSG_ERROR(bad value ${withval} for --with-ggi) ;;
esac],[ggi=false])
if test x$ggi = xtrue; then
AC_CHECK_LIB(ggi, ggiInit,
GGI_LIBS="-lggi",
[AC_MSG_ERROR([GGI not found, GGI version cannot be built]); ggi=false])
AC_CHECK_LIB(gii, giiInit,
GGI_LIBS="${GGI_LIBS} -lgii",
[AC_MSG_ERROR([GII not found, GGI version cannot be built]); ggi=false])
fi
AC_SUBST(GGI_LIBS)
AM_CONDITIONAL(USE_GGI, test x$ggi = xtrue)
# Check for SVGALib
AC_ARG_WITH(svga,
[ --with-svga Build SVGALib support ],
[case "${withval}" in
yes) svga=true ;;
no) svga=false ;;
*) AC_MSG_ERROR(bad value ${withval} for --with-svga) ;;
esac],[svga=false])
if test x$svga = xtrue; then
AC_CHECK_LIB(vga, vga_getmousetype,
SVGA_LIBS="-lvga",
[AC_MSG_ERROR([vga not found, SVGALib cannot be built])
svga=false],
)
AC_CHECK_LIB(vgagl,gl_getcontext,
SVGA_LIBS="${SVGA_LIBS} -lvgagl",
[AC_MSG_ERROR([vgagl not found, SVGALib cannot be built])
svga=false],
-lvga)
fi
AC_SUBST(SVGA_LIBS)
AM_CONDITIONAL(USE_SVGALIB, test x$svga = xtrue)
if test x$opengl = xtrue; then
AC_DEFINE(OGL)
CFLAGS="-I \$(top_srcdir)/input/ggi/include $CFLAGS"
else
if test x$svga = xtrue; then
AC_DEFINE(SVGA)
CFLAGS="-I \$(top_srcdir)/input/svgalib/include $CFLAGS"
else
if test x$ggi = xtrue; then
AC_DEFINE(GGI)
CFLAGS="-I \$(top_srcdir)/input/ggi/include $CFLAGS"
else
CFLAGS="-I \$(top_srcdir)/input/sdl/include $CFLAGS"
fi
fi
fi
AC_PATH_PROG(NASM, nasm, no)
CFLAGS="-I \$(top_srcdir)/input/linux/include -I \$(top_srcdir)/arch/linux/include $CFLAGS"
fi
# Check for NASM and network
NO_ASM=0
NO_NETWORK=0
AC_ARG_WITH(assembler,
[ --without-assembler Do not use assembler optimization ],
if test x$withval = xno; then
NO_ASM=1
fi)
AC_ARG_WITH(network,
[ --without-network Do not build network/serial support ],
if test x$withval = xno; then
NO_NETWORK=1
fi)
if test "$NASM" = "no"; then
NO_ASM=1
fi
if test "$NO_ASM" = 1; then
AC_DEFINE(NO_ASM)
NASMFLAGS=""
else
case $ARCH in
win32)
NASMFLAGS="-f win32"
;;
*)
if test "$OSTYPE" = "MSDOS"; then
NASMFLAGS="-f coff"
else
NASMFLAGS="-f elf -d__ENV_LINUX__ -i\$(srcdir)/"
fi
;;
esac
fi
if test "$NO_NETWORK" = 0; then
AC_DEFINE(NETWORK)
fi
AM_CONDITIONAL(USE_ASM, test "$NO_ASM" != 1)
AC_SUBST(NASMFLAGS)
AC_SUBST(CFLAGS)
AC_ARG_PROGRAM
#libdir='$(shell pwd)/${top_srcdir}/main'
AC_OUTPUT(
Makefile
2d/Makefile
3d/Makefile
maths/Makefile
mem/Makefile
cfile/Makefile
iff/Makefile
texmap/Makefile
misc/Makefile
input/Makefile
video/Makefile
sound/Makefile
arch/Makefile
main/Makefile
)