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="-D_REENTRANT -pipe $CFLAGS"
56 AM_CONDITIONAL(ENV_CYGWIN, test "$host_os" = "cygwin")
58 AC_DEFINE(__ENV_LINUX__)
60 if test "$host_os" = "cygwin"; then
61 AC_CHECK_LIB(SDL, SDL_Init, SDL_LIBS="-lSDL", AC_MSG_ERROR(The SDL which is required not found.))
63 AC_CHECK_LIB(SDL, SDL_Init, SDL_LIBS="-lSDL", AC_MSG_ERROR(The SDL which is required not found.),-ldl -lpthread)
65 AC_CHECK_HEADERS(netipx/ipx.h)
70 [ --with-opengl Build OpenGL support ],
74 *) AC_MSG_ERROR(bad value ${withval} for --with-opengl) ;;
77 if test x$opengl = xtrue; then
78 if test "$host_os" = "cygwin"; then
79 AC_CHECK_LIB(GL, main,
80 OGL_LIBS="-lopengl32",
81 [AC_MSG_ERROR([GL not found, OpenGL cannot be built])
84 AC_CHECK_LIB(GLU,main,
85 OGL_LIBS="${OGL_LIBS} -lglu32",
86 [AC_MSG_ERROR([GLU not found, OpenGL cannot be built])
90 AC_CHECK_LIB(GL, main,
92 [AC_MSG_ERROR([GL not found, OpenGL cannot be built])
95 AC_CHECK_LIB(GLU,main,
96 OGL_LIBS="${OGL_LIBS} -lGLU",
97 [AC_MSG_ERROR([GLU not found, OpenGL cannot be built])
103 AM_CONDITIONAL(USE_OPENGL, test x$opengl = xtrue)
107 [ --with-ggi Build GGI support ],
108 [case "${withval}" in
111 *) AC_MSG_ERROR(bad value ${withval} for --with-ggi) ;;
114 if test x$ggi = xtrue; then
115 AC_CHECK_LIB(ggi, ggiInit,
117 [AC_MSG_ERROR([GGI not found, GGI version cannot be built]); ggi=false])
118 AC_CHECK_LIB(gii, giiInit,
119 GGI_LIBS="${GGI_LIBS} -lgii",
120 [AC_MSG_ERROR([GII not found, GGI version cannot be built]); ggi=false])
123 AM_CONDITIONAL(USE_GGI, test x$ggi = xtrue)
127 [ --with-svga Build SVGALib support ],
128 [case "${withval}" in
131 *) AC_MSG_ERROR(bad value ${withval} for --with-svga) ;;
134 if test x$svga = xtrue; then
135 AC_CHECK_LIB(vga, vga_getmousetype,
137 [AC_MSG_ERROR([vga not found, SVGALib cannot be built])
140 AC_CHECK_LIB(vgagl,gl_getcontext,
141 SVGA_LIBS="${SVGA_LIBS} -lvgagl",
142 [AC_MSG_ERROR([vgagl not found, SVGALib cannot be built])
147 AM_CONDITIONAL(USE_SVGALIB, test x$svga = xtrue)
149 if test x$opengl = xtrue; then
153 if test x$svga = xtrue; then
157 if test x$ggi = xtrue; then
166 AC_PATH_PROG(NASM, nasm, no)
167 CFLAGS="-I\$(top_srcdir)/input/linux/include -I\$(top_srcdir)/arch/linux/include $CFLAGS"
171 # Check for NASM and network
174 AC_ARG_WITH(assembler,
175 [ --without-assembler Do not use assembler optimization ],
176 if test x$withval = xno; then
180 [ --without-network Do not build network/serial support ],
181 if test x$withval = xno; then
185 if test "$NASM" = "no"; then
188 if test "$NO_ASM" = 1; then
194 NASMFLAGS="-f win32 -i\$(srcdir)/"
197 NASMFLAGS="-f coff -i\$(srcdir)/"
200 NASMFLAGS="-f elf -d__ENV_LINUX__ -i\$(srcdir)/"
203 AC_MSG_ERROR([Assembler not supported for this OS])
206 if test "$NO_NETWORK" = 0; then
209 AM_CONDITIONAL(USE_ASM, test "$NO_ASM" != 1)
210 AM_CONDITIONAL(USE_NETWORK, test "$NO_NETWORK" != 1)
220 #libdir='$(shell pwd)/${top_srcdir}/main'
227 arch/dos/allg_snd/Makefile
228 arch/dos/allg_snd/sound/Makefile
229 arch/dos/allg_snd/sound/drv/Makefile
230 arch/dos/bak/Makefile
231 arch/dos/comm/Makefile
232 arch/dos/comm/include/Makefile
233 arch/dos/include/Makefile
234 arch/dos/mm_snd/Makefile
235 arch/dos/mm_snd/include/Makefile
236 arch/include/Makefile
238 arch/ogl/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