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)
73 CFLAGS="-pipe $CFLAGS"
76 if test x$MINGW32 = xyes; then
77 D2X_ARCH_SUBDIRS="win32 ${D2X_ARCH_SUBDIRS}"
79 D2X_ARCH_SUBDIRS="linux ${D2X_ARCH_SUBDIRS}"
85 AC_MSG_ERROR(SDL not found. Make sure sdl-config is in your PATH, or specify with --with-sdl-prefix)
89 AC_CHECK_HEADERS(netipx/ipx.h)
93 [ --with-opengl Build OpenGL support ],
97 *) AC_MSG_ERROR(bad value ${withval} for --with-opengl) ;;
100 if test x$opengl = xtrue; then
101 for lib in $GL_LIBS; do
102 AC_CHECK_LIB($lib, main,
103 OGL_LIBS="${OGL_LIBS} -l$lib",
104 [AC_MSG_ERROR([$lib not found, --with-opengl cannot be used])
111 AM_CONDITIONAL(USE_OPENGL, test x$opengl = xtrue)
113 CFLAGS="$SDL_CFLAGS $CFLAGS"
117 [ --with-ggi Build GGI support ],
118 [case "${withval}" in
121 *) AC_MSG_ERROR(bad value ${withval} for --with-ggi) ;;
124 if test x$ggi = xtrue; then
125 AC_CHECK_LIB(ggi, ggiInit,
127 [AC_MSG_ERROR([GGI not found, GGI version cannot be built]); ggi=false])
128 AC_CHECK_LIB(gii, giiInit,
129 GGI_LIBS="${GGI_LIBS} -lgii",
130 [AC_MSG_ERROR([GII not found, GGI version cannot be built]); ggi=false])
133 AM_CONDITIONAL(USE_GGI, test x$ggi = xtrue)
137 [ --with-svga Build SVGALib support ],
138 [case "${withval}" in
141 *) AC_MSG_ERROR(bad value ${withval} for --with-svga) ;;
144 if test x$svga = xtrue; then
145 AC_CHECK_LIB(vga, vga_getmousetype,
147 [AC_MSG_ERROR([vga not found, SVGALib cannot be built])
150 AC_CHECK_LIB(vgagl,gl_getcontext,
151 SVGA_LIBS="${SVGA_LIBS} -lvgagl",
152 [AC_MSG_ERROR([vgagl not found, SVGALib cannot be built])
157 AM_CONDITIONAL(USE_SVGALIB, test x$svga = xtrue)
159 if test x$opengl = xtrue; then
163 if test x$svga = xtrue; then
167 if test x$ggi = xtrue; then
176 AC_PATH_PROG(NASM, $NASM_PROG, no)
177 CFLAGS="-I\$(top_srcdir)/input/linux/include -I\$(top_srcdir)/arch/linux/include $CFLAGS"
181 dnl Check for network
182 AC_ARG_ENABLE(network,
183 [ --disable-network Do not build network/serial support ],,)
184 if test x$enable_network != xno; then
187 AM_CONDITIONAL(USE_NETWORK, test x$enable_network != xno)
189 dnl Check for assembler
190 AC_ARG_ENABLE(assembler,
191 [ --disable-assembler Do not use assembler optimization ],,)
192 if test x$enable_assembler = xno; then
195 if test x$NASM = xno; then
196 AC_MSG_ERROR([$NASM not found. Install it or use --disable-assembler])
198 NASMFLAGS="-i\$(srcdir)/ $NASMFLAGS"
201 NASMFLAGS="-f win32 $NASMFLAGS"
204 NASMFLAGS="-f coff $NASMFLAGS"
207 NASMFLAGS="-f elf -d__linux__ $NASMFLAGS"
210 AC_MSG_ERROR([Assembler not supported for this OS])
214 AM_CONDITIONAL(USE_ASM, test x$enable_assembler != xno)
216 AC_SUBST(D2X_ARCH_SUBDIRS)
226 #libdir='$(shell pwd)/${top_srcdir}/main'