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, :)
24 if test x$CYGWIN = xyes; then
25 AC_MSG_WARN([Cygwin found, setting -mno-cygwin])
26 CFLAGS="$CFLAGS -mno-cygwin"
30 AM_CONDITIONAL(MINGW32, test x$MINGW32 = xyes)
31 if test x$MINGW32 = xyes; then
32 GL_LIBS="opengl32 glu32"
39 CFLAGS="$CFLAGS -O2 -Wall"
41 dnl Enable editor build?
43 [ --enable-editor Build editor? (not functional)],,)
44 if test x$enable_editor = xyes; then
46 D2X_MAIN_SUBDIRS=editor
48 AM_CONDITIONAL(EDITOR, test x$enable_editor = xyes)
50 dnl Enable cross-platform bitmap/palette loader?
51 AC_ARG_ENABLE(xploader,
52 [ --enable-xploader Enable cross-platform bitmap/palette loader ],,)
53 if test x$enable_xploader = xyes; then
54 AC_DEFINE(PORTABLE_LOADER)
57 dnl Count warnings as errors?
59 [ --enable-werror Count compiler warning as errors ],,)
60 if test x$enable_werror = xyes; then
61 CFLAGS="-Werror $CFLAGS"
64 dnl Build with NDEBUG?
66 [ --disable-debug Take out debug symbols, Asserts, Int3, etc ],,)
67 if test x$enable_debug = xno; then
74 AM_CONDITIONAL(ENV_DJGPP, test "$host_os" = "msdosdjgpp")
75 if test "$host_os" = "msdosdjgpp"; then
77 CFLAGS="-I \$(top_srcdir)/arch/dos/include $CFLAGS"
78 AC_PATH_PROG(NASM, nasm, no)
83 CFLAGS="-pipe $CFLAGS"
88 AC_MSG_ERROR(SDL not found. Make sure sdl-config is in your PATH, or specify with --with-sdl-prefix)
95 AC_CHECK_HEADERS(netipx/ipx.h)
99 [ --with-opengl Build OpenGL support ],,)
100 if test x$with_opengl = xyes; 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])
113 AM_CONDITIONAL(USE_OPENGL, test x$with_opengl = xyes)
117 [ --with-ggi Build GGI support ],,)
118 if test x$with_ggi = xyes; then
119 AC_CHECK_LIB(ggi, ggiInit,
121 [AC_MSG_ERROR([GGI not found, GGI version cannot be built]); ggi=false])
122 AC_CHECK_LIB(gii, giiInit,
123 GGI_LIBS="${GGI_LIBS} -lgii",
124 [AC_MSG_ERROR([GII not found, GGI version cannot be built]); ggi=false])
127 D2X_ARCH_SUBDIRS = "${D2X_ARCH_SUBDIRS} ggi"
130 AM_CONDITIONAL(USE_GGI, test x$with_ggi = xyes)
134 [ --with-svga Build SVGALib support ],,)
135 if test x$with_svga = xyes; then
136 AC_CHECK_LIB(vga,vga_getmousetype,
138 [AC_MSG_ERROR([vga not found, SVGALib cannot be built])
141 AC_CHECK_LIB(vgagl,gl_getcontext,
142 SVGA_LIBS="${SVGA_LIBS} -lvgagl",
143 [AC_MSG_ERROR([vgagl not found, SVGALib cannot be built])
148 D2X_ARCH_SUBDIRS = "${D2X_ARCH_SUBDIRS} svgalib"
151 AM_CONDITIONAL(USE_SVGALIB, test x$with_svga = yes)
153 if test x$MINGW32 = xyes; then
154 D2X_ARCH_SUBDIRS="${D2X_ARCH_SUBDIRS} win32"
156 CFLAGS="-I \$(top_srcdir)/arch/linux/include $CFLAGS"
157 D2X_ARCH_SUBDIRS="${D2X_ARCH_SUBDIRS} linux"
160 AC_PATH_PROG(NASM, $NASM_PROG, no)
163 dnl Check for network
164 AC_ARG_ENABLE(network,
165 [ --disable-network Do not build network/serial support ],,)
166 if test x$enable_network != xno; then
169 AM_CONDITIONAL(USE_NETWORK, test x$enable_network != xno)
171 dnl Check for assembler
172 AC_ARG_ENABLE(assembler,
173 [ --disable-assembler Do not use assembler optimization ],,)
174 if test x$enable_assembler = xno; then
177 if test x$NASM = xno; then
178 AC_MSG_ERROR([$NASM_PROG not found. Install it or use --disable-assembler])
180 NASMFLAGS="-i\$(srcdir)/ $NASMFLAGS"
183 NASMFLAGS="-f win32 $NASMFLAGS"
186 NASMFLAGS="-f coff $NASMFLAGS"
189 NASMFLAGS="-f elf -d__linux__ $NASMFLAGS"
192 AC_MSG_ERROR([Assembler not supported for this OS])
196 AM_CONDITIONAL(USE_ASM, test x$enable_assembler != xno)
200 AC_SUBST(D2X_ARCH_SUBDIRS)
202 AC_SUBST(D2X_MAIN_SUBDIRS)
219 arch/svgalib/Makefile