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(STRIP, strip, :)
21 AC_CHECK_TOOL(AR, ar, :)
24 AC_PATH_PROGS(NASM, nasmw nasm, no)
28 if test x$CYGWIN = xyes; then
29 AC_MSG_WARN([Cygwin found, setting -mno-cygwin])
30 CFLAGS="-mno-cygwin $CFLAGS"
34 AM_CONDITIONAL(MINGW32, test x$MINGW32 = xyes)
35 if test x$MINGW32 = xyes; then
36 GL_LIBS="opengl32 glu32"
41 CFLAGS="-Wall $CFLAGS"
43 dnl Enable editor build?
45 [ --enable-editor Build editor? (not functional)],,)
46 if test x$enable_editor = xyes; then
48 D2X_MAIN_SUBDIRS=editor
50 AM_CONDITIONAL(EDITOR, test x$enable_editor = xyes)
52 dnl Enable shareware build?
53 AC_ARG_ENABLE(shareware,
54 [ --enable-shareware Build for demo datafiles (not functional)],,)
55 if test x$enable_shareware = xyes; then
58 AM_CONDITIONAL(SHAREWARE, test x$enable_shareware = xyes)
61 AC_ARG_ENABLE(nmovies,
62 [ --enable-nmovies Enable rendering of endlevel flythrough],,)
63 if test x$enable_nmovies = xyes; then
66 AM_CONDITIONAL(NMOVIES, test x$enable_nmovies = xyes)
68 dnl Enable cross-platform bitmap/palette loader?
69 AC_ARG_ENABLE(xploader,
70 [ --enable-xploader Enable cross-platform bitmap/palette loader ],,)
71 if test x$enable_xploader = xyes; then
72 AC_DEFINE(PORTABLE_LOADER)
75 dnl Count warnings as errors?
77 [ --enable-werror Count compiler warning as errors ],,)
78 if test x$enable_werror = xyes; then
79 CFLAGS="-Werror $CFLAGS"
82 dnl Build with NDEBUG?
84 [ --disable-debug Take out debug symbols, Asserts, Int3, etc ],,)
85 if test x$enable_debug = xno; then
93 AM_CONDITIONAL(DJGPP, test "$host_os" = "msdosdjgpp")
94 if test "$host_os" = "msdosdjgpp"; then
96 CFLAGS="-I \$(top_srcdir)/arch/dos/include $CFLAGS"
101 CFLAGS="-pipe $CFLAGS"
106 AC_MSG_ERROR(SDL not found. Make sure sdl-config is in your PATH, or specify with --with-sdl-prefix)
108 CFLAGS="$SDL_CFLAGS $CFLAGS"
109 LIBS="$SDL_LIBS $LIBS"
114 AC_CHECK_HEADERS(netipx/ipx.h)
118 [ --with-opengl Build OpenGL support ],,)
119 if test x$with_opengl = xyes; then
120 for lib in $GL_LIBS; do
121 AC_CHECK_LIB($lib, main,
122 OGL_LIBS="${OGL_LIBS} -l$lib",
123 [AC_MSG_ERROR([$lib not found, --with-opengl cannot be used])
130 D2X_ARCH_SUBDIRS="ogl ${D2X_ARCH_SUBDIRS}"
133 AM_CONDITIONAL(USE_OPENGL, test x$with_opengl = xyes)
137 [ --with-ggi Build GGI support ],,)
138 if test x$with_ggi = xyes; then
139 AC_CHECK_LIB(ggi, ggiInit,
141 [AC_MSG_ERROR([GGI not found, GGI version cannot be built]); ggi=false])
142 AC_CHECK_LIB(gii, giiInit,
143 GGI_LIBS="${GGI_LIBS} -lgii",
144 [AC_MSG_ERROR([GII not found, GGI version cannot be built]); ggi=false])
147 D2X_ARCH_SUBDIRS="ggi ${D2X_ARCH_SUBDIRS}"
150 AM_CONDITIONAL(USE_GGI, test x$with_ggi = xyes)
154 [ --with-svga Build SVGALib support ],,)
155 if test x$with_svga = xyes; then
156 AC_CHECK_LIB(vga,vga_getmousetype,
158 [AC_MSG_ERROR([vga not found, SVGALib cannot be built])
161 AC_CHECK_LIB(vgagl,gl_getcontext,
162 SVGA_LIBS="${SVGA_LIBS} -lvgagl",
163 [AC_MSG_ERROR([vgagl not found, SVGALib cannot be built])
168 D2X_ARCH_SUBDIRS="svgalib ${D2X_ARCH_SUBDIRS}"
171 AM_CONDITIONAL(USE_SVGALIB, test x$with_svga = xyes)
173 if test x$MINGW32 = xyes; then
174 D2X_ARCH_SUBDIRS="win32 ${D2X_ARCH_SUBDIRS}"
175 AC_DEFINE(SDL_JOYSTICK)
177 CFLAGS="-I \$(top_srcdir)/arch/linux/include $CFLAGS"
178 D2X_ARCH_SUBDIRS="linux ${D2X_ARCH_SUBDIRS}"
180 dnl Check for SDL joystick
181 AC_ARG_ENABLE(sdl-joystick,
182 [ --enable-sdl-joystick Use SDL joystick (required for mingw) ],,)
183 if test x$enable_sdl_joystick = xyes; then
184 AC_DEFINE(SDL_JOYSTICK)
186 AM_CONDITIONAL(SDL_JOYSTICK, test x$enable_sdl_joystick = xyes)
190 dnl Check for network
191 AC_ARG_ENABLE(network,
192 [ --disable-network Do not build network/serial support ],,)
193 if test x$enable_network != xno; then
196 AM_CONDITIONAL(USE_NETWORK, test x$enable_network != xno)
198 dnl Check for assembler
199 AC_ARG_ENABLE(assembler,
200 [ --disable-assembler Do not use assembler optimization ],,)
201 if test x$enable_assembler = xno; then
204 if test x$NASM = xno; then
205 AC_MSG_ERROR([$NASM_PROG not found. Install it or use --disable-assembler])
207 NASMFLAGS="-i\$(srcdir)/ $NASMFLAGS"
210 NASMFLAGS="-f win32 $NASMFLAGS"
213 NASMFLAGS="-f coff $NASMFLAGS"
216 NASMFLAGS="-f elf -d__linux__ $NASMFLAGS"
219 AC_MSG_ERROR([Assembler not supported for this OS])
223 AM_CONDITIONAL(USE_ASM, test x$enable_assembler != xno)
227 AC_SUBST(D2X_ARCH_SUBDIRS)
229 AC_SUBST(D2X_MAIN_SUBDIRS)
247 arch/svgalib/Makefile