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.1.0)
16 AC_CHECK_TOOL(CC, gcc, :)
18 AC_CHECK_TOOL(RANLIB, ranlib, :)
19 AC_CHECK_TOOL(AR, ar, :)
27 if test x$CYGWIN = xyes; then
28 AC_MSG_WARN([Cygwin found, setting -mno-cygwin])
29 CFLAGS="$CFLAGS -mno-cygwin"
33 AM_CONDITIONAL(MINGW32, test x$MINGW32 = xyes)
34 if test x$MINGW32 = xyes; then
35 GL_LIBS="opengl32 glu32"
36 AC_MSG_WARN([mingw32 found, disabling network and assembler])
41 CFLAGS="$CFLAGS -g -O2 -Wall"
43 dnl Count warnings as errors?
45 [ --with-werror Count compiler warning as errors ],
47 yes) CFLAGS="-Werror $CFLAGS" ;;
49 *) AC_MSG_ERROR(bad value ${withval} for --with-werror) ;;
52 dnl Build with NDEBUG?
54 [ --with-ndebug Take out extra Asserts, Int3, etc ],
56 yes) AC_DEFINE(NDEBUG) ;;
58 *) AC_MSG_ERROR(bad value ${withval} for --with-ndebug) ;;
62 AM_CONDITIONAL(ENV_DJGPP, test "$host_os" = "msdosdjgpp")
63 if test "$host_os" = "msdosdjgpp"; then
65 CFLAGS="-I \$(top_srcdir)/arch/dos/include $CFLAGS"
66 AC_PATH_PROG(NASM, nasm, no)
70 CFLAGS="-pipe $CFLAGS"
73 *linux*) AC_DEFINE(__ENV_LINUX__) ;;
79 AC_MSG_ERROR(SDL not found. Make sure sdl-config is in your PATH, or specify with --with-sdl-prefix)
83 AC_CHECK_HEADERS(netipx/ipx.h)
87 [ --with-opengl Build OpenGL support ],
91 *) AC_MSG_ERROR(bad value ${withval} for --with-opengl) ;;
94 if test x$opengl = xtrue; then
95 for lib in $GL_LIBS; do
96 AC_CHECK_LIB($lib, main,
97 OGL_LIBS="${OGL_LIBS} -l$lib",
98 [AC_MSG_ERROR([$lib not found, --with-opengl cannot be used])
105 AM_CONDITIONAL(USE_OPENGL, test x$opengl = xtrue)
107 CFLAGS="$SDL_CFLAGS $CFLAGS"
111 [ --with-ggi Build GGI support ],
112 [case "${withval}" in
115 *) AC_MSG_ERROR(bad value ${withval} for --with-ggi) ;;
118 if test x$ggi = xtrue; then
119 AC_CHECK_LIB(ggi, ggiInit,
121 [AC_MSG_ERROR([GGI not found, GGI version cannot be built]); ggi=false])
122 AC_CHECK_LIB(gii, giiInit,
123 GGI_LIBS="${GGI_LIBS} -lgii",
124 [AC_MSG_ERROR([GII not found, GGI version cannot be built]); ggi=false])
127 AM_CONDITIONAL(USE_GGI, test x$ggi = xtrue)
131 [ --with-svga Build SVGALib support ],
132 [case "${withval}" in
135 *) AC_MSG_ERROR(bad value ${withval} for --with-svga) ;;
138 if test x$svga = xtrue; then
139 AC_CHECK_LIB(vga, vga_getmousetype,
141 [AC_MSG_ERROR([vga not found, SVGALib cannot be built])
144 AC_CHECK_LIB(vgagl,gl_getcontext,
145 SVGA_LIBS="${SVGA_LIBS} -lvgagl",
146 [AC_MSG_ERROR([vgagl not found, SVGALib cannot be built])
151 AM_CONDITIONAL(USE_SVGALIB, test x$svga = xtrue)
153 if test x$opengl = xtrue; then
157 if test x$svga = xtrue; then
161 if test x$ggi = xtrue; then
170 AC_PATH_PROG(NASM, nasm, no)
171 CFLAGS="-I\$(top_srcdir)/input/linux/include -I\$(top_srcdir)/arch/linux/include $CFLAGS"
175 # Check for NASM and network
176 AC_ARG_WITH(assembler,
177 [ --without-assembler Do not use assembler optimization ],
178 if test x$withval = xno; then
182 [ --without-network Do not build network/serial support ],
183 if test x$withval = xno; then
187 if test "$NASM" = "no"; then
190 if test "$NO_ASM" = 1; then
196 NASMFLAGS="-f win32 -i\$(srcdir)/"
199 NASMFLAGS="-f coff -i\$(srcdir)/"
202 NASMFLAGS="-f elf -d__ENV_LINUX__ -i\$(srcdir)/"
205 AC_MSG_ERROR([Assembler not supported for this OS])
208 if test "$NO_NETWORK" = 0; then
211 AM_CONDITIONAL(USE_ASM, test "$NO_ASM" != 1)
212 AM_CONDITIONAL(USE_NETWORK, test "$NO_NETWORK" != 1)
222 #libdir='$(shell pwd)/${top_srcdir}/main'
229 arch/dos/allg_snd/Makefile
230 arch/dos/allg_snd/sound/Makefile
231 arch/dos/allg_snd/sound/drv/Makefile
232 arch/dos/bak/Makefile
233 arch/dos/comm/Makefile
234 arch/dos/comm/include/Makefile
235 arch/dos/include/Makefile
236 arch/dos/mm_snd/Makefile
237 arch/dos/mm_snd/include/Makefile
238 arch/include/Makefile
240 arch/linux/include/Makefile
242 arch/win32/d3dframe/Makefile
243 arch/win32/include/Makefile
250 input/linux/include/Makefile
262 unused/novga/Makefile
263 unused/pa_null/Makefile
266 unused/vga/new/Makefile
267 unused/win95/Makefile
270 tools/cvs2cl/Makefile