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"
38 CFLAGS="$CFLAGS -O2 -Wall"
40 dnl Enable cross-platform bitmap/palette loader?
41 AC_ARG_ENABLE(xploader,
42 [ --enable-xploader Enable xp bitmap/palette loader ],,)
43 if test x$enable_xploader = xyes; then
44 AC_DEFINE(PORTABLE_LOADER)
47 dnl Count warnings as errors?
49 [ --enable-werror Count compiler warning as errors ],,)
50 if test x$enable_werror = xyes; then
51 CFLAGS="-Werror $CFLAGS"
54 dnl Build with NDEBUG?
56 [ --disable-debug Take out debug symbols, Asserts, Int3, etc ],,)
57 if test x$enable_debug = xno; then
64 AM_CONDITIONAL(ENV_DJGPP, test "$host_os" = "msdosdjgpp")
65 if test "$host_os" = "msdosdjgpp"; then
67 CFLAGS="-I \$(top_srcdir)/arch/dos/include $CFLAGS"
68 AC_PATH_PROG(NASM, nasm, no)
72 CFLAGS="-pipe $CFLAGS"
74 if test x$MINGW32 = xyes; then
75 D2X_ARCH_SUBDIRS=win32
77 D2X_ARCH_SUBDIRS=linux
83 AC_MSG_ERROR(SDL not found. Make sure sdl-config is in your PATH, or specify with --with-sdl-prefix)
87 AC_CHECK_HEADERS(netipx/ipx.h)
91 [ --with-opengl Build OpenGL support ],
95 *) AC_MSG_ERROR(bad value ${withval} for --with-opengl) ;;
98 if test x$opengl = xtrue; then
99 for lib in $GL_LIBS; do
100 AC_CHECK_LIB($lib, main,
101 OGL_LIBS="${OGL_LIBS} -l$lib",
102 [AC_MSG_ERROR([$lib not found, --with-opengl cannot be used])
109 AM_CONDITIONAL(USE_OPENGL, test x$opengl = xtrue)
111 CFLAGS="$SDL_CFLAGS $CFLAGS"
115 [ --with-ggi Build GGI support ],
116 [case "${withval}" in
119 *) AC_MSG_ERROR(bad value ${withval} for --with-ggi) ;;
122 if test x$ggi = xtrue; then
123 AC_CHECK_LIB(ggi, ggiInit,
125 [AC_MSG_ERROR([GGI not found, GGI version cannot be built]); ggi=false])
126 AC_CHECK_LIB(gii, giiInit,
127 GGI_LIBS="${GGI_LIBS} -lgii",
128 [AC_MSG_ERROR([GII not found, GGI version cannot be built]); ggi=false])
131 AM_CONDITIONAL(USE_GGI, test x$ggi = xtrue)
135 [ --with-svga Build SVGALib support ],
136 [case "${withval}" in
139 *) AC_MSG_ERROR(bad value ${withval} for --with-svga) ;;
142 if test x$svga = xtrue; then
143 AC_CHECK_LIB(vga, vga_getmousetype,
145 [AC_MSG_ERROR([vga not found, SVGALib cannot be built])
148 AC_CHECK_LIB(vgagl,gl_getcontext,
149 SVGA_LIBS="${SVGA_LIBS} -lvgagl",
150 [AC_MSG_ERROR([vgagl not found, SVGALib cannot be built])
155 AM_CONDITIONAL(USE_SVGALIB, test x$svga = xtrue)
157 if test x$opengl = xtrue; then
161 if test x$svga = xtrue; then
165 if test x$ggi = xtrue; then
174 AC_PATH_PROG(NASM, $NASM_PROG, no)
175 CFLAGS="-I\$(top_srcdir)/input/linux/include -I\$(top_srcdir)/arch/linux/include $CFLAGS"
179 dnl Check for network
180 AC_ARG_ENABLE(network,
181 [ --disable-network Do not build network/serial support ],,)
182 if test x$enable_network != xno; then
185 AM_CONDITIONAL(USE_NETWORK, test x$enable_network != xno)
187 dnl Check for assembler
188 AC_ARG_ENABLE(assembler,
189 [ --disable-assembler Do not use assembler optimization ],,)
190 if test x$enable_assembler = xno; then
193 if test x$NASM = xno; then
194 AC_MSG_ERROR([$NASM not found. Install it or use --disable-assembler])
196 NASMFLAGS="-i\$(srcdir)/ $NASMFLAGS"
199 NASMFLAGS="-f win32 $NASMFLAGS"
202 NASMFLAGS="-f coff $NASMFLAGS"
205 NASMFLAGS="-f elf -d__linux__ $NASMFLAGS"
208 AC_MSG_ERROR([Assembler not supported for this OS])
212 AM_CONDITIONAL(USE_ASM, test x$enable_assembler != xno)
214 AC_SUBST(D2X_ARCH_SUBDIRS)
224 #libdir='$(shell pwd)/${top_srcdir}/main'