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.1)
16 AC_CHECK_TOOL(CC, gcc, :)
18 AC_CHECK_TOOL(RANLIB, ranlib, :)
19 AC_CHECK_TOOL(AR, ar, :)
28 if test x$CYGWIN = xyes; then
29 AC_MSG_WARN([Cygwin found, setting -mno-cygwin])
30 CFLAGS="$CFLAGS -mno-cygwin"
34 AM_CONDITIONAL(MINGW32, test x$MINGW32 = xyes)
35 if test x$MINGW32 = xyes; then
36 AC_MSG_WARN([mingw32 found, disabling network])
38 GL_LIBS="opengl32 glu32"
42 CFLAGS="$CFLAGS -g -O2 -Wall"
44 dnl Count warnings as errors?
46 [ --with-werror Count compiler warning as errors ],
48 yes) CFLAGS="-Werror $CFLAGS" ;;
50 *) AC_MSG_ERROR(bad value ${withval} for --with-werror) ;;
53 dnl Build with NDEBUG?
55 [ --with-ndebug Take out extra Asserts, Int3, etc ],
57 yes) AC_DEFINE(NDEBUG) ;;
59 *) AC_MSG_ERROR(bad value ${withval} for --with-ndebug) ;;
63 AM_CONDITIONAL(ENV_DJGPP, test "$host_os" = "msdosdjgpp")
64 if test "$host_os" = "msdosdjgpp"; then
66 CFLAGS="-I \$(top_srcdir)/arch/dos/include $CFLAGS"
67 AC_PATH_PROG(NASM, nasm, no)
71 CFLAGS="-pipe $CFLAGS"
74 *linux*) AC_DEFINE(__ENV_LINUX__) ;;
80 AC_MSG_ERROR(SDL not found. Make sure sdl-config is in your PATH, or specify with --with-sdl-prefix)
84 AC_CHECK_HEADERS(netipx/ipx.h)
88 [ --with-opengl Build OpenGL support ],
92 *) AC_MSG_ERROR(bad value ${withval} for --with-opengl) ;;
95 if test x$opengl = xtrue; then
96 for lib in $GL_LIBS; do
97 AC_CHECK_LIB($lib, main,
98 OGL_LIBS="${OGL_LIBS} -l$lib",
99 [AC_MSG_ERROR([$lib not found, --with-opengl cannot be used])
106 AM_CONDITIONAL(USE_OPENGL, test x$opengl = xtrue)
108 CFLAGS="$SDL_CFLAGS $CFLAGS"
112 [ --with-ggi Build GGI support ],
113 [case "${withval}" in
116 *) AC_MSG_ERROR(bad value ${withval} for --with-ggi) ;;
119 if test x$ggi = xtrue; then
120 AC_CHECK_LIB(ggi, ggiInit,
122 [AC_MSG_ERROR([GGI not found, GGI version cannot be built]); ggi=false])
123 AC_CHECK_LIB(gii, giiInit,
124 GGI_LIBS="${GGI_LIBS} -lgii",
125 [AC_MSG_ERROR([GII not found, GGI version cannot be built]); ggi=false])
128 AM_CONDITIONAL(USE_GGI, test x$ggi = xtrue)
132 [ --with-svga Build SVGALib support ],
133 [case "${withval}" in
136 *) AC_MSG_ERROR(bad value ${withval} for --with-svga) ;;
139 if test x$svga = xtrue; then
140 AC_CHECK_LIB(vga, vga_getmousetype,
142 [AC_MSG_ERROR([vga not found, SVGALib cannot be built])
145 AC_CHECK_LIB(vgagl,gl_getcontext,
146 SVGA_LIBS="${SVGA_LIBS} -lvgagl",
147 [AC_MSG_ERROR([vgagl not found, SVGALib cannot be built])
152 AM_CONDITIONAL(USE_SVGALIB, test x$svga = xtrue)
154 if test x$opengl = xtrue; then
158 if test x$svga = xtrue; then
162 if test x$ggi = xtrue; then
171 AC_PATH_PROG(NASM, $NASM_PROG, no)
172 CFLAGS="-I\$(top_srcdir)/input/linux/include -I\$(top_srcdir)/arch/linux/include $CFLAGS"
176 # Check for NASM and network
177 AC_ARG_WITH(assembler,
178 [ --without-assembler Do not use assembler optimization ],
179 if test x$withval = xno; then
183 [ --without-network Do not build network/serial support ],
184 if test x$withval = xno; then
188 if test "$NASM" = "no"; then
191 if test "$NO_ASM" = 1; then
193 NASMFLAGS="-i\$(srcdir)/ $NASMFLAGS"
197 NASMFLAGS="-f win32 $NASMFLAGS"
200 NASMFLAGS="-f coff -i\$(srcdir)/"
203 NASMFLAGS="-f elf -d__ENV_LINUX__ -i\$(srcdir)/"
206 AC_MSG_ERROR([Assembler not supported for this OS])
209 if test "$NO_NETWORK" = 0; then
212 AM_CONDITIONAL(USE_ASM, test "$NO_ASM" != 1)
213 AM_CONDITIONAL(USE_NETWORK, test "$NO_NETWORK" != 1)
223 #libdir='$(shell pwd)/${top_srcdir}/main'