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, :)
23 if test x$CYGWIN = xyes; then
24 AC_MSG_WARN([Cygwin found, setting -mno-cygwin])
25 CFLAGS="$CFLAGS -mno-cygwin"
29 AM_CONDITIONAL(MINGW32, test x$MINGW32 = xyes)
30 if test x$MINGW32 = xyes; then
31 GL_LIBS="opengl32 glu32"
33 D2X_ARCH_SUBDIRS=win32
39 CFLAGS="$CFLAGS -O2 -Wall"
41 dnl Count warnings as errors?
43 [ --enable-werror Count compiler warning as errors ],,)
44 if test x$enable_werror = xyes; then
45 CFLAGS="-Werror $CFLAGS"
48 dnl Build with NDEBUG?
50 [ --disable-debug Take out debug symbols, Asserts, Int3, etc ],,)
51 if test x$enable_debug = xno; then
58 AM_CONDITIONAL(ENV_DJGPP, test "$host_os" = "msdosdjgpp")
59 if test "$host_os" = "msdosdjgpp"; then
61 CFLAGS="-I \$(top_srcdir)/arch/dos/include $CFLAGS"
62 AC_PATH_PROG(NASM, nasm, no)
66 CFLAGS="-pipe $CFLAGS"
71 AC_MSG_ERROR(SDL not found. Make sure sdl-config is in your PATH, or specify with --with-sdl-prefix)
75 AC_CHECK_HEADERS(netipx/ipx.h)
79 [ --with-opengl Build OpenGL support ],
83 *) AC_MSG_ERROR(bad value ${withval} for --with-opengl) ;;
86 if test x$opengl = xtrue; then
87 for lib in $GL_LIBS; do
88 AC_CHECK_LIB($lib, main,
89 OGL_LIBS="${OGL_LIBS} -l$lib",
90 [AC_MSG_ERROR([$lib not found, --with-opengl cannot be used])
97 AM_CONDITIONAL(USE_OPENGL, test x$opengl = xtrue)
99 CFLAGS="$SDL_CFLAGS $CFLAGS"
103 [ --with-ggi Build GGI support ],
104 [case "${withval}" in
107 *) AC_MSG_ERROR(bad value ${withval} for --with-ggi) ;;
110 if test x$ggi = xtrue; then
111 AC_CHECK_LIB(ggi, ggiInit,
113 [AC_MSG_ERROR([GGI not found, GGI version cannot be built]); ggi=false])
114 AC_CHECK_LIB(gii, giiInit,
115 GGI_LIBS="${GGI_LIBS} -lgii",
116 [AC_MSG_ERROR([GII not found, GGI version cannot be built]); ggi=false])
119 AM_CONDITIONAL(USE_GGI, test x$ggi = xtrue)
123 [ --with-svga Build SVGALib support ],
124 [case "${withval}" in
127 *) AC_MSG_ERROR(bad value ${withval} for --with-svga) ;;
130 if test x$svga = xtrue; then
131 AC_CHECK_LIB(vga, vga_getmousetype,
133 [AC_MSG_ERROR([vga not found, SVGALib cannot be built])
136 AC_CHECK_LIB(vgagl,gl_getcontext,
137 SVGA_LIBS="${SVGA_LIBS} -lvgagl",
138 [AC_MSG_ERROR([vgagl not found, SVGALib cannot be built])
143 AM_CONDITIONAL(USE_SVGALIB, test x$svga = xtrue)
145 if test x$opengl = xtrue; then
149 if test x$svga = xtrue; then
153 if test x$ggi = xtrue; then
162 AC_PATH_PROG(NASM, $NASM_PROG, no)
163 CFLAGS="-I\$(top_srcdir)/input/linux/include -I\$(top_srcdir)/arch/linux/include $CFLAGS"
167 dnl Check for network
168 AC_ARG_ENABLE(network,
169 [ --disable-network Do not build network/serial support ],,)
170 if test x$enable_network != xno; then
173 AM_CONDITIONAL(USE_NETWORK, test x$enable_network != xno)
175 dnl Check for assembler
176 AC_ARG_ENABLE(assembler,
177 [ --disable-assembler Do not use assembler optimization ],,)
178 if test x$enable_assembler = xno; then
181 if test x$NASM = xno; then
182 AC_MSG_ERROR([$NASM not found. Install it or use --disable-assembler])
184 NASMFLAGS="-i\$(srcdir)/ $NASMFLAGS"
187 NASMFLAGS="-f win32 $NASMFLAGS"
190 NASMFLAGS="-f coff -i\$(srcdir)/"
193 NASMFLAGS="-f elf -d__linux__ -i\$(srcdir)/"
196 AC_MSG_ERROR([Assembler not supported for this OS])
200 AM_CONDITIONAL(USE_ASM, test x$enable_assembler != xno)
202 AC_SUBST(D2X_ARCH_SUBDIRS)
212 #libdir='$(shell pwd)/${top_srcdir}/main'