1 # -*- mode: shell-script -*-
2 AC_INIT(main/inferno.c)
7 AM_CONFIG_HEADER(conf.h)
8 AM_INIT_AUTOMAKE(d2x, 0.1.2)
12 #kludge to keep autoconf from adding -g -O2
18 AC_CHECK_TOOL(CC, gcc, :)
19 AC_CHECK_TOOL(RANLIB, ranlib, :)
20 AC_CHECK_TOOL(AR, ar, :)
23 AC_PATH_PROGS(NASM, nasmw nasm, no)
27 if test x$CYGWIN = xyes; then
28 AC_MSG_WARN([Cygwin found, setting -mno-cygwin])
29 CFLAGS="-mno-cygwin $CFLAGS"
33 AM_CONDITIONAL(MINGW32, test x$MINGW32 = xyes)
34 if test x$MINGW32 = xyes; then
35 GL_LIBS="opengl32 glu32"
40 CFLAGS="-Wall $CFLAGS"
42 dnl Enable editor build?
44 [ --enable-editor Build editor? (not functional)],,)
45 if test x$enable_editor = xyes; then
47 D2X_MAIN_SUBDIRS=editor
49 AM_CONDITIONAL(EDITOR, test x$enable_editor = xyes)
51 dnl Enable shareware build?
52 AC_ARG_ENABLE(shareware,
53 [ --enable-shareware Build for demo datafiles (not functional)],,)
54 if test x$enable_shareware = xyes; then
57 AM_CONDITIONAL(SHAREWARE, test x$enable_shareware = xyes)
60 AC_ARG_ENABLE(nmovies,
61 [ --enable-nmovies Enable rendering of endlevel flythrough],,)
62 if test x$enable_nmovies = xyes; then
65 AM_CONDITIONAL(NMOVIES, test x$enable_nmovies = xyes)
67 dnl Enable cross-platform bitmap/palette loader?
68 AC_ARG_ENABLE(xploader,
69 [ --enable-xploader Enable cross-platform bitmap/palette loader ],,)
70 if test x$enable_xploader = xyes; then
71 AC_DEFINE(PORTABLE_LOADER)
74 dnl Count warnings as errors?
76 [ --enable-werror Count compiler warning as errors ],,)
77 if test x$enable_werror = xyes; then
78 CFLAGS="-Werror $CFLAGS"
81 dnl Build with NDEBUG?
83 [ --disable-debug Take out debug symbols, Asserts, Int3, etc ],,)
84 if test x$enable_debug = xno; then
92 AM_CONDITIONAL(ENV_DJGPP, test "$host_os" = "msdosdjgpp")
93 if test "$host_os" = "msdosdjgpp"; then
95 CFLAGS="-I \$(top_srcdir)/arch/dos/include $CFLAGS"
100 CFLAGS="-pipe $CFLAGS"
105 AC_MSG_ERROR(SDL not found. Make sure sdl-config is in your PATH, or specify with --with-sdl-prefix)
112 AC_CHECK_HEADERS(netipx/ipx.h)
116 [ --with-opengl Build OpenGL support ],,)
117 if test x$with_opengl = xyes; then
118 for lib in $GL_LIBS; do
119 AC_CHECK_LIB($lib, main,
120 OGL_LIBS="${OGL_LIBS} -l$lib",
121 [AC_MSG_ERROR([$lib not found, --with-opengl cannot be used])
128 D2X_ARCH_SUBDIRS="${D2X_ARCH_SUBDIRS} ogl"
131 AM_CONDITIONAL(USE_OPENGL, test x$with_opengl = xyes)
135 [ --with-ggi Build GGI support ],,)
136 if test x$with_ggi = xyes; then
137 AC_CHECK_LIB(ggi, ggiInit,
139 [AC_MSG_ERROR([GGI not found, GGI version cannot be built]); ggi=false])
140 AC_CHECK_LIB(gii, giiInit,
141 GGI_LIBS="${GGI_LIBS} -lgii",
142 [AC_MSG_ERROR([GII not found, GGI version cannot be built]); ggi=false])
145 D2X_ARCH_SUBDIRS="${D2X_ARCH_SUBDIRS} ggi"
148 AM_CONDITIONAL(USE_GGI, test x$with_ggi = xyes)
152 [ --with-svga Build SVGALib support ],,)
153 if test x$with_svga = xyes; then
154 AC_CHECK_LIB(vga,vga_getmousetype,
156 [AC_MSG_ERROR([vga not found, SVGALib cannot be built])
159 AC_CHECK_LIB(vgagl,gl_getcontext,
160 SVGA_LIBS="${SVGA_LIBS} -lvgagl",
161 [AC_MSG_ERROR([vgagl not found, SVGALib cannot be built])
166 D2X_ARCH_SUBDIRS="${D2X_ARCH_SUBDIRS} svgalib"
169 AM_CONDITIONAL(USE_SVGALIB, test x$with_svga = yes)
171 if test x$MINGW32 = xyes; then
172 D2X_ARCH_SUBDIRS="${D2X_ARCH_SUBDIRS} win32"
174 CFLAGS="-I \$(top_srcdir)/arch/linux/include $CFLAGS"
175 D2X_ARCH_SUBDIRS="${D2X_ARCH_SUBDIRS} linux"
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_PROG 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)
216 AC_SUBST(D2X_ARCH_SUBDIRS)
218 AC_SUBST(D2X_MAIN_SUBDIRS)
236 arch/svgalib/Makefile