1 # -*- mode: shell-script -*-
2 AC_INIT(main/inferno.c)
4 AC_VALIDATE_CACHED_SYSTEM_TUPLE(
10 AM_CONFIG_HEADER(conf.h)
11 AM_INIT_AUTOMAKE(d2x, 0.0.9)
16 AC_CHECK_TOOL(CC, gcc, :)
18 AC_CHECK_TOOL(RANLIB, ranlib, :)
19 AC_CHECK_TOOL(AR, ar, :)
27 dnl Count warnings as errors?
29 [ --with-werror Count compiler warning as errors ],
31 yes) CFLAGS="-Werror $CFLAGS" ;;
33 *) AC_MSG_ERROR(bad value ${withval} for --with-werror) ;;
36 dnl Build with NDEBUG?
38 [ --with-ndebug Take out extra Asserts, Int3, etc ],
40 yes) AC_DEFINE(NDEBUG) ;;
42 *) AC_MSG_ERROR(bad value ${withval} for --with-ndebug) ;;
46 AM_CONDITIONAL(ENV_DJGPP, test "$host_os" = "msdosdjgpp")
47 if test "$host_os" = "msdosdjgpp"; then
49 CFLAGS="-I \$(top_srcdir)/arch/dos/include $CFLAGS"
50 AC_DEFINE(__ENV_DJGPP__)
51 AC_PATH_PROG(NASM, nasm, no)
55 CFLAGS="-pipe $CFLAGS"
56 AM_CONDITIONAL(ENV_CYGWIN, test "$host_os" = "cygwin")
58 AC_DEFINE(__ENV_LINUX__)
61 AC_MSG_RESULT([SDL_CFLAGS=$SDL_CFLAGS SDL_LIBS=$SDL_LIBS]),
62 AC_MSG_ERROR(SDL not found. Make sure sdl-config is in your PATH, or specify with --with-sdl-prefix)
64 if test "$host_os" = "cygwin"; then
65 # mingw32-specific stuff, I guess...?
66 SDL_CFLAGS=`echo $SDL_CFLAGS | sed 's/-Dmain=SDL_main//'`
67 SDL_LIBS=`echo $SDL_LIBS | sed 's/-lmingw32//' | sed 's/-mwindows//' | sed 's/-lSDLmain//'`
68 AC_MSG_RESULT([Using SDL_CFLAGS=$SDL_CFLAGS SDL_LIBS=$SDL_LIBS])
73 AC_CHECK_HEADERS(netipx/ipx.h)
77 [ --with-opengl Build OpenGL support ],
81 *) AC_MSG_ERROR(bad value ${withval} for --with-opengl) ;;
84 if test x$opengl = xtrue; then
85 if test "$host_os" = "cygwin"; then
86 AC_CHECK_LIB(opengl32, main,
87 OGL_LIBS="-lopengl32",
88 [AC_MSG_ERROR([opengl32 not found, OpenGL cannot be built])
91 AC_CHECK_LIB(glu32,main,
92 OGL_LIBS="${OGL_LIBS} -lglu32",
93 [AC_MSG_ERROR([glu32 not found, OpenGL cannot be built])
97 AC_CHECK_LIB(GL, main,
99 [AC_MSG_ERROR([GL not found, OpenGL cannot be built])
102 AC_CHECK_LIB(GLU,main,
103 OGL_LIBS="${OGL_LIBS} -lGLU",
104 [AC_MSG_ERROR([GLU not found, OpenGL cannot be built])
110 AM_CONDITIONAL(USE_OPENGL, test x$opengl = xtrue)
112 CFLAGS="$SDL_CFLAGS $CFLAGS"
116 [ --with-ggi Build GGI support ],
117 [case "${withval}" in
120 *) AC_MSG_ERROR(bad value ${withval} for --with-ggi) ;;
123 if test x$ggi = xtrue; then
124 AC_CHECK_LIB(ggi, ggiInit,
126 [AC_MSG_ERROR([GGI not found, GGI version cannot be built]); ggi=false])
127 AC_CHECK_LIB(gii, giiInit,
128 GGI_LIBS="${GGI_LIBS} -lgii",
129 [AC_MSG_ERROR([GII not found, GGI version cannot be built]); ggi=false])
132 AM_CONDITIONAL(USE_GGI, test x$ggi = xtrue)
136 [ --with-svga Build SVGALib support ],
137 [case "${withval}" in
140 *) AC_MSG_ERROR(bad value ${withval} for --with-svga) ;;
143 if test x$svga = xtrue; then
144 AC_CHECK_LIB(vga, vga_getmousetype,
146 [AC_MSG_ERROR([vga not found, SVGALib cannot be built])
149 AC_CHECK_LIB(vgagl,gl_getcontext,
150 SVGA_LIBS="${SVGA_LIBS} -lvgagl",
151 [AC_MSG_ERROR([vgagl not found, SVGALib cannot be built])
156 AM_CONDITIONAL(USE_SVGALIB, test x$svga = xtrue)
158 if test x$opengl = xtrue; then
162 if test x$svga = xtrue; then
166 if test x$ggi = xtrue; then
175 AC_PATH_PROG(NASM, nasm, no)
176 CFLAGS="-I\$(top_srcdir)/input/linux/include -I\$(top_srcdir)/arch/linux/include $CFLAGS"
180 # Check for NASM and network
183 AC_ARG_WITH(assembler,
184 [ --without-assembler Do not use assembler optimization ],
185 if test x$withval = xno; then
189 [ --without-network Do not build network/serial support ],
190 if test x$withval = xno; then
194 if test "$NASM" = "no"; then
197 if test "$NO_ASM" = 1; then
203 NASMFLAGS="-f win32 -i\$(srcdir)/"
206 NASMFLAGS="-f coff -i\$(srcdir)/"
209 NASMFLAGS="-f elf -d__ENV_LINUX__ -i\$(srcdir)/"
212 AC_MSG_ERROR([Assembler not supported for this OS])
215 if test "$NO_NETWORK" = 0; then
218 AM_CONDITIONAL(USE_ASM, test "$NO_ASM" != 1)
219 AM_CONDITIONAL(USE_NETWORK, test "$NO_NETWORK" != 1)
229 #libdir='$(shell pwd)/${top_srcdir}/main'
236 arch/dos/allg_snd/Makefile
237 arch/dos/allg_snd/sound/Makefile
238 arch/dos/allg_snd/sound/drv/Makefile
239 arch/dos/bak/Makefile
240 arch/dos/comm/Makefile
241 arch/dos/comm/include/Makefile
242 arch/dos/include/Makefile
243 arch/dos/mm_snd/Makefile
244 arch/dos/mm_snd/include/Makefile
245 arch/include/Makefile
247 arch/linux/include/Makefile
249 arch/win32/d3dframe/Makefile
250 arch/win32/include/Makefile
257 input/linux/include/Makefile
269 unused/novga/Makefile
270 unused/pa_null/Makefile
273 unused/vga/new/Makefile
274 unused/win95/Makefile
277 tools/cvs2cl/Makefile