dxx-rebirth/configure.in

272 lines
6.2 KiB
Plaintext
Raw Normal View History

# -*- mode: shell-script -*-
2001-01-29 14:09:49 +00:00
AC_INIT(main/inferno.c)
AC_VALIDATE_CACHED_SYSTEM_TUPLE(
rm $cache_file
echo restart configure
exit 1
)
AM_CONFIG_HEADER(conf.h)
AM_INIT_AUTOMAKE(d2x, 0.1.0)
AM_MAINTAINER_MODE
AC_PROG_INSTALL
AC_CHECK_TOOL(CC, gcc, :)
AC_ISC_POSIX
AC_CHECK_TOOL(RANLIB, ranlib, :)
AC_CHECK_TOOL(AR, ar, :)
AC_STDC_HEADERS
NO_ASM=0
NO_NETWORK=0
GL_LIBS="GL GLU"
2001-10-13 01:31:41 +00:00
NASM_PROG=nasm
AC_CYGWIN
if test x$CYGWIN = xyes; then
AC_MSG_WARN([Cygwin found, setting -mno-cygwin])
CFLAGS="$CFLAGS -mno-cygwin"
fi
AC_MINGW32
AM_CONDITIONAL(MINGW32, test x$MINGW32 = xyes)
if test x$MINGW32 = xyes; then
2001-10-13 01:31:41 +00:00
AC_MSG_WARN([mingw32 found, disabling network])
NO_NETWORK=1
2001-10-13 01:31:41 +00:00
GL_LIBS="opengl32 glu32"
NASM_PROG=nasmw
fi
CFLAGS="$CFLAGS -g -O2 -Wall"
2001-01-22 13:39:54 +00:00
dnl Count warnings as errors?
AC_ARG_WITH(werror,
[ --with-werror Count compiler warning as errors ],
[case "${withval}" in
2001-01-22 13:39:54 +00:00
yes) CFLAGS="-Werror $CFLAGS" ;;
no) ;;
*) AC_MSG_ERROR(bad value ${withval} for --with-werror) ;;
2001-01-22 13:39:54 +00:00
esac],)
dnl Build with NDEBUG?
AC_ARG_WITH(ndebug,
[ --with-ndebug Take out extra Asserts, Int3, etc ],
[case "${withval}" in
2001-01-24 05:35:33 +00:00
yes) AC_DEFINE(NDEBUG) ;;
2001-01-22 13:39:54 +00:00
no) ;;
*) AC_MSG_ERROR(bad value ${withval} for --with-ndebug) ;;
2001-01-22 13:39:54 +00:00
esac],)
# Test for DJGPP
AM_CONDITIONAL(ENV_DJGPP, test "$host_os" = "msdosdjgpp")
if test "$host_os" = "msdosdjgpp"; then
CFLAGS="-I \$(top_srcdir)/arch/dos/include $CFLAGS"
AC_PATH_PROG(NASM, nasm, no)
2001-01-29 14:09:49 +00:00
TARGETS=d2x
else
2001-02-01 09:24:04 +00:00
CFLAGS="-pipe $CFLAGS"
case "$host_os" in
*linux*) AC_DEFINE(__ENV_LINUX__) ;;
esac
dnl Check for SDL
2001-02-01 09:24:04 +00:00
AM_PATH_SDL(1.1.7,
:,
2001-02-01 09:24:04 +00:00
AC_MSG_ERROR(SDL not found. Make sure sdl-config is in your PATH, or specify with --with-sdl-prefix)
)
AC_SUBST(SDL_LIBS)
2001-02-01 09:24:04 +00:00
AC_CHECK_HEADERS(netipx/ipx.h)
# 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
for lib in $GL_LIBS; do
AC_CHECK_LIB($lib, main,
2001-10-12 01:50:09 +00:00
OGL_LIBS="${OGL_LIBS} -l$lib",
[AC_MSG_ERROR([$lib not found, --with-opengl cannot be used])
opengl=false],
2001-10-12 01:50:09 +00:00
${OGL_LIBS}
)
done
fi
2001-01-22 13:39:54 +00:00
AC_SUBST(OGL_LIBS)
AM_CONDITIONAL(USE_OPENGL, test x$opengl = xtrue)
2001-02-01 09:24:04 +00:00
CFLAGS="$SDL_CFLAGS $CFLAGS"
2001-01-22 13:39:54 +00:00
# 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)
2001-01-29 14:09:49 +00:00
TARGETS=d2x-ogl
else
2001-01-22 13:39:54 +00:00
if test x$svga = xtrue; then
AC_DEFINE(SVGA)
2001-01-29 14:09:49 +00:00
TARGETS=d2x-svga
2001-01-22 13:39:54 +00:00
else
if test x$ggi = xtrue; then
AC_DEFINE(GGI)
2001-01-29 14:09:49 +00:00
TARGETS=d2x-ggi
else
TARGETS=d2x-sdl
2001-01-22 13:39:54 +00:00
fi
fi
fi
2001-10-13 01:31:41 +00:00
AC_PATH_PROG(NASM, $NASM_PROG, no)
2001-01-29 14:09:49 +00:00
CFLAGS="-I\$(top_srcdir)/input/linux/include -I\$(top_srcdir)/arch/linux/include $CFLAGS"
fi
# Check for NASM and network
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)
2001-10-13 01:31:41 +00:00
NASMFLAGS="-i\$(srcdir)/ $NASMFLAGS"
else
case $host_os in
cygwin)
2001-10-13 01:31:41 +00:00
NASMFLAGS="-f win32 $NASMFLAGS"
;;
msdosdjgpp)
NASMFLAGS="-f coff -i\$(srcdir)/"
;;
linux*)
NASMFLAGS="-f elf -d__ENV_LINUX__ -i\$(srcdir)/"
;;
*)
AC_MSG_ERROR([Assembler not supported for this OS])
esac
fi
if test "$NO_NETWORK" = 0; then
AC_DEFINE(NETWORK)
fi
AM_CONDITIONAL(USE_ASM, test "$NO_ASM" != 1)
2001-01-29 14:09:49 +00:00
AM_CONDITIONAL(USE_NETWORK, test "$NO_NETWORK" != 1)
AC_SUBST(NASMFLAGS)
AC_SUBST(CFLAGS)
2001-01-29 14:09:49 +00:00
AC_SUBST(TARGETS)
AC_ARG_PROGRAM
#libdir='$(shell pwd)/${top_srcdir}/main'
AC_OUTPUT(
Makefile
2d/Makefile
3d/Makefile
arch/Makefile
arch/dos/Makefile
arch/dos/allg_snd/Makefile
arch/dos/allg_snd/sound/Makefile
arch/dos/allg_snd/sound/drv/Makefile
arch/dos/bak/Makefile
arch/dos/comm/Makefile
arch/dos/comm/include/Makefile
arch/dos/include/Makefile
arch/dos/mm_snd/Makefile
arch/dos/mm_snd/include/Makefile
2001-01-28 16:21:54 +00:00
arch/include/Makefile
arch/linux/Makefile
arch/linux/include/Makefile
arch/win32/Makefile
arch/win32/d3dframe/Makefile
arch/win32/include/Makefile
cfile/Makefile
iff/Makefile
iff/archive/Makefile
includes/Makefile
input/Makefile
input/linux/Makefile
input/linux/include/Makefile
main/Makefile
main/editor/Makefile
main/old/Makefile
maths/Makefile
mem/Makefile
misc/Makefile
sound/Makefile
texmap/Makefile
unused/Makefile
unused/bios/Makefile
unused/lib/Makefile
unused/novga/Makefile
unused/pa_null/Makefile
unused/ui/Makefile
unused/vga/Makefile
unused/vga/new/Makefile
unused/win95/Makefile
video/Makefile
tools/Makefile
tools/cvs2cl/Makefile
)