2001-01-31 13:56:54 +00:00
|
|
|
# -*- mode: shell-script -*-
|
2001-01-29 14:09:49 +00:00
|
|
|
AC_INIT(main/inferno.c)
|
2001-01-19 03:30:16 +00:00
|
|
|
|
2001-01-31 13:56:54 +00:00
|
|
|
AC_VALIDATE_CACHED_SYSTEM_TUPLE(
|
|
|
|
rm $cache_file
|
|
|
|
echo restart configure
|
|
|
|
exit 1
|
|
|
|
)
|
|
|
|
|
2001-01-19 03:30:16 +00:00
|
|
|
AM_CONFIG_HEADER(conf.h)
|
2001-10-13 03:02:12 +00:00
|
|
|
AM_INIT_AUTOMAKE(d2x, 0.1.1)
|
2001-01-19 03:30:16 +00:00
|
|
|
|
|
|
|
AM_MAINTAINER_MODE
|
|
|
|
|
2001-01-31 13:56:54 +00:00
|
|
|
AC_PROG_INSTALL
|
2001-10-25 08:25:35 +00:00
|
|
|
AC_PROG_CC
|
|
|
|
AC_PROG_MAKE_SET
|
2001-01-19 03:30:16 +00:00
|
|
|
AC_ISC_POSIX
|
2001-01-31 13:56:54 +00:00
|
|
|
AC_CHECK_TOOL(RANLIB, ranlib, :)
|
|
|
|
AC_CHECK_TOOL(AR, ar, :)
|
2001-01-19 03:30:16 +00:00
|
|
|
AC_STDC_HEADERS
|
|
|
|
|
|
|
|
AC_CYGWIN
|
2001-10-23 21:51:50 +00:00
|
|
|
AC_MINGW32
|
2001-10-12 00:18:40 +00:00
|
|
|
if test x$CYGWIN = xyes; then
|
|
|
|
AC_MSG_WARN([Cygwin found, setting -mno-cygwin])
|
|
|
|
CFLAGS="$CFLAGS -mno-cygwin"
|
2001-10-23 21:51:50 +00:00
|
|
|
MINGW32=yes
|
2001-10-12 00:18:40 +00:00
|
|
|
fi
|
|
|
|
|
|
|
|
AM_CONDITIONAL(MINGW32, test x$MINGW32 = xyes)
|
|
|
|
if test x$MINGW32 = xyes; then
|
2001-10-13 01:31:41 +00:00
|
|
|
GL_LIBS="opengl32 glu32"
|
|
|
|
NASM_PROG=nasmw
|
2001-10-19 00:30:31 +00:00
|
|
|
else
|
|
|
|
GL_LIBS="GL GLU"
|
|
|
|
NASM_PROG=nasm
|
2001-10-12 00:18:40 +00:00
|
|
|
fi
|
2001-01-19 03:30:16 +00:00
|
|
|
|
2001-10-19 00:30:31 +00:00
|
|
|
CFLAGS="$CFLAGS -O2 -Wall"
|
2001-01-22 13:39:54 +00:00
|
|
|
|
2001-10-23 21:51:50 +00:00
|
|
|
dnl Enable editor build?
|
|
|
|
AC_ARG_ENABLE(editor,
|
2001-10-24 07:08:59 +00:00
|
|
|
[ --enable-editor Build editor? (not functional)],,)
|
2001-10-23 21:51:50 +00:00
|
|
|
if test x$enable_editor = xyes; then
|
|
|
|
AC_DEFINE(EDITOR)
|
2001-10-25 02:27:57 +00:00
|
|
|
D2X_MAIN_SUBDIRS=editor
|
2001-10-23 21:51:50 +00:00
|
|
|
fi
|
|
|
|
AM_CONDITIONAL(EDITOR, test x$enable_editor = xyes)
|
|
|
|
|
2001-10-19 08:10:30 +00:00
|
|
|
dnl Enable cross-platform bitmap/palette loader?
|
|
|
|
AC_ARG_ENABLE(xploader,
|
2001-10-24 07:08:59 +00:00
|
|
|
[ --enable-xploader Enable cross-platform bitmap/palette loader ],,)
|
2001-10-19 08:10:30 +00:00
|
|
|
if test x$enable_xploader = xyes; then
|
|
|
|
AC_DEFINE(PORTABLE_LOADER)
|
|
|
|
fi
|
|
|
|
|
2001-01-22 13:39:54 +00:00
|
|
|
dnl Count warnings as errors?
|
2001-10-19 00:30:31 +00:00
|
|
|
AC_ARG_ENABLE(werror,
|
|
|
|
[ --enable-werror Count compiler warning as errors ],,)
|
|
|
|
if test x$enable_werror = xyes; then
|
|
|
|
CFLAGS="-Werror $CFLAGS"
|
|
|
|
fi
|
2001-01-22 13:39:54 +00:00
|
|
|
|
|
|
|
dnl Build with NDEBUG?
|
2001-10-19 00:30:31 +00:00
|
|
|
AC_ARG_ENABLE(debug,
|
|
|
|
[ --disable-debug Take out debug symbols, Asserts, Int3, etc ],,)
|
|
|
|
if test x$enable_debug = xno; then
|
|
|
|
AC_DEFINE(NDEBUG)
|
|
|
|
else
|
|
|
|
CFLAGS="-g $CFLAGS"
|
|
|
|
fi
|
2001-01-19 03:34:09 +00:00
|
|
|
|
|
|
|
# Test for DJGPP
|
2001-01-31 13:56:54 +00:00
|
|
|
AM_CONDITIONAL(ENV_DJGPP, test "$host_os" = "msdosdjgpp")
|
|
|
|
if test "$host_os" = "msdosdjgpp"; then
|
2001-01-19 03:34:09 +00:00
|
|
|
|
|
|
|
CFLAGS="-I \$(top_srcdir)/arch/dos/include $CFLAGS"
|
2001-01-31 13:56:54 +00:00
|
|
|
AC_PATH_PROG(NASM, nasm, no)
|
2001-10-24 09:30:02 +00:00
|
|
|
TARGETS=d2x
|
2001-10-19 09:01:56 +00:00
|
|
|
D2X_ARCH_SUBDIRS=dos
|
2001-01-19 03:34:09 +00:00
|
|
|
else
|
2001-10-23 21:51:50 +00:00
|
|
|
|
2001-02-01 09:24:04 +00:00
|
|
|
CFLAGS="-pipe $CFLAGS"
|
2001-01-30 04:45:51 +00:00
|
|
|
|
2001-10-12 00:18:40 +00:00
|
|
|
dnl Check for SDL
|
2001-02-01 09:24:04 +00:00
|
|
|
AM_PATH_SDL(1.1.7,
|
2001-10-12 00:18:40 +00:00
|
|
|
:,
|
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)
|
|
|
|
)
|
2001-01-19 03:34:09 +00:00
|
|
|
AC_SUBST(SDL_LIBS)
|
|
|
|
|
2001-10-24 09:30:02 +00:00
|
|
|
TARGETS=d2x-sdl
|
|
|
|
D2X_ARCH_SUBDIRS=sdl
|
|
|
|
|
2001-02-01 09:24:04 +00:00
|
|
|
AC_CHECK_HEADERS(netipx/ipx.h)
|
|
|
|
|
2001-01-19 03:34:09 +00:00
|
|
|
# Check for OpenGL
|
|
|
|
AC_ARG_WITH(opengl,
|
2001-10-23 21:51:50 +00:00
|
|
|
[ --with-opengl Build OpenGL support ],,)
|
|
|
|
if test x$with_opengl = xyes; then
|
2001-10-12 00:18:40 +00:00
|
|
|
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",
|
2001-10-12 00:18:40 +00:00
|
|
|
[AC_MSG_ERROR([$lib not found, --with-opengl cannot be used])
|
|
|
|
opengl=false],
|
2001-10-12 01:50:09 +00:00
|
|
|
${OGL_LIBS}
|
2001-10-12 00:18:40 +00:00
|
|
|
)
|
|
|
|
done
|
2001-10-23 21:51:50 +00:00
|
|
|
AC_DEFINE(OGL)
|
2001-10-24 09:30:02 +00:00
|
|
|
TARGETS=d2x-ogl
|
2001-10-25 08:25:35 +00:00
|
|
|
D2X_ARCH_SUBDIRS="${D2X_ARCH_SUBDIRS} ogl"
|
2001-01-19 03:34:09 +00:00
|
|
|
fi
|
2001-01-22 13:39:54 +00:00
|
|
|
AC_SUBST(OGL_LIBS)
|
2001-10-23 21:51:50 +00:00
|
|
|
AM_CONDITIONAL(USE_OPENGL, test x$with_opengl = xyes)
|
2001-02-01 09:24:04 +00:00
|
|
|
|
2001-01-22 13:39:54 +00:00
|
|
|
# Check for GGI
|
|
|
|
AC_ARG_WITH(ggi,
|
2001-10-23 21:51:50 +00:00
|
|
|
[ --with-ggi Build GGI support ],,)
|
|
|
|
if test x$with_ggi = xyes; then
|
2001-01-22 13:39:54 +00:00
|
|
|
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])
|
2001-10-23 21:51:50 +00:00
|
|
|
AC_DEFINE(GGI)
|
2001-10-24 09:30:02 +00:00
|
|
|
TARGETS=d2x-ggi
|
2001-10-25 08:25:35 +00:00
|
|
|
D2X_ARCH_SUBDIRS="${D2X_ARCH_SUBDIRS} ggi"
|
2001-01-22 13:39:54 +00:00
|
|
|
fi
|
|
|
|
AC_SUBST(GGI_LIBS)
|
2001-10-24 09:30:02 +00:00
|
|
|
AM_CONDITIONAL(USE_GGI, test x$with_ggi = xyes)
|
2001-01-22 13:39:54 +00:00
|
|
|
|
|
|
|
# Check for SVGALib
|
|
|
|
AC_ARG_WITH(svga,
|
2001-10-23 21:51:50 +00:00
|
|
|
[ --with-svga Build SVGALib support ],,)
|
|
|
|
if test x$with_svga = xyes; then
|
|
|
|
AC_CHECK_LIB(vga,vga_getmousetype,
|
2001-01-22 13:39:54 +00:00
|
|
|
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)
|
2001-10-23 21:51:50 +00:00
|
|
|
AC_DEFINE(SVGA)
|
2001-10-24 09:30:02 +00:00
|
|
|
TARGETS=d2x-svga
|
2001-10-25 08:25:35 +00:00
|
|
|
D2X_ARCH_SUBDIRS="${D2X_ARCH_SUBDIRS} svgalib"
|
2001-01-22 13:39:54 +00:00
|
|
|
fi
|
|
|
|
AC_SUBST(SVGA_LIBS)
|
2001-10-23 21:51:50 +00:00
|
|
|
AM_CONDITIONAL(USE_SVGALIB, test x$with_svga = yes)
|
2001-01-19 03:34:09 +00:00
|
|
|
|
2001-10-24 09:30:02 +00:00
|
|
|
if test x$MINGW32 = xyes; then
|
|
|
|
D2X_ARCH_SUBDIRS="${D2X_ARCH_SUBDIRS} win32"
|
|
|
|
else
|
|
|
|
CFLAGS="-I \$(top_srcdir)/arch/linux/include $CFLAGS"
|
|
|
|
D2X_ARCH_SUBDIRS="${D2X_ARCH_SUBDIRS} linux"
|
|
|
|
fi
|
|
|
|
|
2001-10-13 01:31:41 +00:00
|
|
|
AC_PATH_PROG(NASM, $NASM_PROG, no)
|
2001-01-19 03:34:09 +00:00
|
|
|
fi
|
2001-01-19 03:30:16 +00:00
|
|
|
|
2001-10-19 00:30:31 +00:00
|
|
|
dnl Check for network
|
|
|
|
AC_ARG_ENABLE(network,
|
|
|
|
[ --disable-network Do not build network/serial support ],,)
|
|
|
|
if test x$enable_network != xno; then
|
|
|
|
AC_DEFINE(NETWORK)
|
2001-01-19 03:30:16 +00:00
|
|
|
fi
|
2001-10-19 00:30:31 +00:00
|
|
|
AM_CONDITIONAL(USE_NETWORK, test x$enable_network != xno)
|
|
|
|
|
|
|
|
dnl Check for assembler
|
|
|
|
AC_ARG_ENABLE(assembler,
|
|
|
|
[ --disable-assembler Do not use assembler optimization ],,)
|
|
|
|
if test x$enable_assembler = xno; then
|
|
|
|
AC_DEFINE(NO_ASM)
|
2001-01-19 03:30:16 +00:00
|
|
|
else
|
2001-10-19 00:30:31 +00:00
|
|
|
if test x$NASM = xno; then
|
2001-10-19 10:52:38 +00:00
|
|
|
AC_MSG_ERROR([$NASM_PROG not found. Install it or use --disable-assembler])
|
2001-10-19 00:30:31 +00:00
|
|
|
else
|
2001-10-18 00:10:03 +00:00
|
|
|
NASMFLAGS="-i\$(srcdir)/ $NASMFLAGS"
|
2001-01-31 13:56:54 +00:00
|
|
|
case $host_os in
|
|
|
|
cygwin)
|
2001-10-13 01:31:41 +00:00
|
|
|
NASMFLAGS="-f win32 $NASMFLAGS"
|
2001-01-19 03:30:16 +00:00
|
|
|
;;
|
2001-01-31 13:56:54 +00:00
|
|
|
msdosdjgpp)
|
2001-10-19 08:10:30 +00:00
|
|
|
NASMFLAGS="-f coff $NASMFLAGS"
|
2001-01-31 13:56:54 +00:00
|
|
|
;;
|
|
|
|
linux*)
|
2001-10-19 08:10:30 +00:00
|
|
|
NASMFLAGS="-f elf -d__linux__ $NASMFLAGS"
|
2001-01-19 03:30:16 +00:00
|
|
|
;;
|
2001-01-31 13:56:54 +00:00
|
|
|
*)
|
|
|
|
AC_MSG_ERROR([Assembler not supported for this OS])
|
2001-01-19 03:30:16 +00:00
|
|
|
esac
|
2001-10-19 00:30:31 +00:00
|
|
|
fi
|
2001-01-19 03:30:16 +00:00
|
|
|
fi
|
2001-10-19 00:30:31 +00:00
|
|
|
AM_CONDITIONAL(USE_ASM, test x$enable_assembler != xno)
|
|
|
|
|
2001-10-25 02:27:57 +00:00
|
|
|
AM_PROG_AS
|
|
|
|
|
2001-10-19 00:30:31 +00:00
|
|
|
AC_SUBST(D2X_ARCH_SUBDIRS)
|
2001-01-29 14:09:49 +00:00
|
|
|
|
2001-10-25 02:27:57 +00:00
|
|
|
AC_SUBST(D2X_MAIN_SUBDIRS)
|
|
|
|
|
2001-10-24 09:30:02 +00:00
|
|
|
AC_SUBST(TARGETS)
|
|
|
|
|
2001-01-19 03:30:16 +00:00
|
|
|
AC_SUBST(NASMFLAGS)
|
|
|
|
|
2001-01-19 03:34:09 +00:00
|
|
|
AC_SUBST(CFLAGS)
|
2001-01-19 03:30:16 +00:00
|
|
|
|
|
|
|
AC_OUTPUT(
|
|
|
|
Makefile
|
|
|
|
2d/Makefile
|
|
|
|
3d/Makefile
|
2001-01-24 11:11:07 +00:00
|
|
|
arch/Makefile
|
2001-10-19 09:01:56 +00:00
|
|
|
arch/dos/Makefile
|
2001-10-24 09:30:02 +00:00
|
|
|
arch/ggi/Makefile
|
2001-10-19 08:10:30 +00:00
|
|
|
arch/linux/Makefile
|
2001-10-25 08:25:35 +00:00
|
|
|
arch/ogl/Makefile
|
2001-10-19 09:01:56 +00:00
|
|
|
arch/sdl/Makefile
|
2001-10-24 09:30:02 +00:00
|
|
|
arch/svgalib/Makefile
|
2001-10-19 00:30:31 +00:00
|
|
|
arch/win32/Makefile
|
2001-01-19 03:30:16 +00:00
|
|
|
cfile/Makefile
|
|
|
|
iff/Makefile
|
|
|
|
main/Makefile
|
2001-10-25 02:27:57 +00:00
|
|
|
main/editor/Makefile
|
2001-01-24 11:11:07 +00:00
|
|
|
maths/Makefile
|
|
|
|
mem/Makefile
|
|
|
|
misc/Makefile
|
|
|
|
texmap/Makefile
|
|
|
|
)
|