1 # -*- mode: shell-script -*-
2 AC_INIT(main/inferno.c)
8 AM_CONFIG_HEADER(conf.h)
9 AM_INIT_AUTOMAKE(d2x, 0.1.2)
13 #kludge to keep autoconf from adding -g -O2
19 AC_CHECK_TOOL(CC, gcc, :)
20 AC_CHECK_TOOL(RANLIB, ranlib, :)
21 AC_CHECK_TOOL(STRIP, strip, :)
22 AC_CHECK_TOOL(AR, ar, :)
25 AC_PATH_PROGS(NASM, nasmw nasm, no)
29 if test x$CYGWIN = xyes; then
30 AC_MSG_WARN([Cygwin found, setting -mno-cygwin])
31 CFLAGS="-mno-cygwin $CFLAGS"
35 AM_CONDITIONAL(MINGW32, test x$MINGW32 = xyes)
36 if test x$MINGW32 = xyes; then
37 GL_LIBS="opengl32 glu32"
42 dnl Set $prefix and $exec_prefix to $ac_default_prefix if they are not set
43 test "x$prefix" = "xNONE" && prefix=$ac_default_prefix
44 test "x$exec_prefix" = "xNONE" && exec_prefix="${prefix}"
46 dnl Set default locations to find data files.
48 default_sharepath="$foo/games/$PACKAGE"
50 CFLAGS="-Wall $CFLAGS"
52 dnl Enable editor build?
54 [ --enable-editor Build editor? (not functional)],,)
55 if test x$enable_editor = xyes; then
57 D2X_MAIN_SUBDIRS=editor
59 AM_CONDITIONAL(EDITOR, test x$enable_editor = xyes)
61 dnl Enable shareware build?
62 AC_ARG_ENABLE(shareware,
63 [ --enable-shareware Build for demo datafiles (not functional)],,)
64 if test x$enable_shareware = xyes; then
66 D2X_FEATURES="shareware ${D2X_FEATURES}"
68 AM_CONDITIONAL(SHAREWARE, test x$enable_shareware = xyes)
70 dnl Enable movie trick?
72 [ --enable-movie-trick Enable trick to show movies],,)
73 if test x$enable_movie_trick = xyes; then
74 AC_DEFINE(MOVIE_TRICK)
75 D2X_FEATURES="movie_trick ${D2X_FEATURES}"
77 AM_CONDITIONAL(MOVIE_TRICK, test x$enable_movie_trick = xyes)
80 AC_ARG_ENABLE(nmovies,
81 [ --enable-nmovies Turn off movies (render endlevel flythrough)],,)
82 if test x$enable_nmovies = xyes; then
84 D2X_FEATURES="nmovies ${D2X_FEATURES}"
86 AM_CONDITIONAL(NMOVIES, test x$enable_nmovies = xyes)
88 dnl Enable cross-platform bitmap/palette loader?
89 AC_ARG_ENABLE(xploader,
90 [ --enable-xploader Enable cross-platform bitmap/palette loader ],,)
91 if test x$enable_xploader = xyes; then
92 AC_DEFINE(PORTABLE_LOADER)
93 D2X_FEATURES="xploader ${D2X_FEATURES}"
96 dnl Count warnings as errors?
98 [ --enable-werror Count compiler warning as errors ],,)
99 if test x$enable_werror = xyes; then
100 CFLAGS="-Werror $CFLAGS"
101 D2X_FEATURES="werror ${D2X_FEATURES}"
104 dnl Build with NDEBUG?
106 [ --disable-debug Take out debug symbols, Asserts, Int3, etc ],,)
107 if test x$enable_debug = xno; then
112 D2X_FEATURES="debug ${D2X_FEATURES}"
115 AC_ARG_WITH(sharepath,
116 [[ --with-sharepath=DIR Use DIR for shared game data [DATADIR/games/d2x]]],
117 sharepath=$withval, sharepath="auto")
118 if test "x$sharepath" = "xauto" -o "x$sharepath" = "xyes" -o "x$sharepath" = "x"; then
119 sharepath="$default_sharepath"
121 AC_DEFINE_UNQUOTED(SHAREPATH, "$sharepath")
124 AM_CONDITIONAL(DJGPP, test "$host_os" = "msdosdjgpp")
125 if test "$host_os" = "msdosdjgpp"; then
127 CFLAGS="-I \$(top_srcdir)/arch/dos/include $CFLAGS"
132 CFLAGS="-pipe $CFLAGS"
137 AC_MSG_ERROR(SDL not found. Make sure sdl-config is in your PATH, or specify with --with-sdl-prefix)
139 CFLAGS="$SDL_CFLAGS $CFLAGS"
140 LIBS="$SDL_LIBS $LIBS"
145 AC_CHECK_HEADERS(netipx/ipx.h)
149 [ --with-opengl Build OpenGL support ],,)
150 if test x$with_opengl = xyes; then
151 for lib in $GL_LIBS; do
152 AC_CHECK_LIB($lib, main,
153 OGL_LIBS="${OGL_LIBS} -l$lib",
154 [AC_MSG_ERROR([$lib not found, --with-opengl cannot be used])
161 D2X_ARCH_SUBDIRS="ogl ${D2X_ARCH_SUBDIRS}"
164 AM_CONDITIONAL(USE_OPENGL, test x$with_opengl = xyes)
168 [ --with-ggi Build GGI support ],,)
169 if test x$with_ggi = xyes; then
170 AC_CHECK_LIB(ggi, ggiInit,
172 [AC_MSG_ERROR([GGI not found, GGI version cannot be built]); ggi=false])
173 AC_CHECK_LIB(gii, giiInit,
174 GGI_LIBS="${GGI_LIBS} -lgii",
175 [AC_MSG_ERROR([GII not found, GGI version cannot be built]); ggi=false])
178 D2X_ARCH_SUBDIRS="ggi ${D2X_ARCH_SUBDIRS}"
181 AM_CONDITIONAL(USE_GGI, test x$with_ggi = xyes)
185 [ --with-svga Build SVGALib support ],,)
186 if test x$with_svga = xyes; then
187 AC_CHECK_LIB(vga,vga_getmousetype,
189 [AC_MSG_ERROR([vga not found, SVGALib cannot be built])
192 AC_CHECK_LIB(vgagl,gl_getcontext,
193 SVGA_LIBS="${SVGA_LIBS} -lvgagl",
194 [AC_MSG_ERROR([vgagl not found, SVGALib cannot be built])
199 D2X_ARCH_SUBDIRS="svgalib ${D2X_ARCH_SUBDIRS}"
202 AM_CONDITIONAL(USE_SVGALIB, test x$with_svga = xyes)
204 if test x$MINGW32 = xyes; then
205 D2X_ARCH_SUBDIRS="win32 ${D2X_ARCH_SUBDIRS}"
206 AC_DEFINE(SDL_JOYSTICK)
208 CFLAGS="-I \$(top_srcdir)/arch/linux/include $CFLAGS"
209 D2X_ARCH_SUBDIRS="linux ${D2X_ARCH_SUBDIRS}"
211 dnl Check for SDL joystick
212 AC_ARG_ENABLE(sdl-joystick,
213 [ --enable-sdl-joystick Use SDL joystick (required for mingw) ],,)
214 if test x$enable_sdl_joystick = xyes; then
215 AC_DEFINE(SDL_JOYSTICK)
216 D2X_FEATURES="sdl_joystick ${D2X_FEATURES}"
218 AM_CONDITIONAL(SDL_JOYSTICK, test x$enable_sdl_joystick = xyes)
222 dnl Check for network
223 AC_ARG_ENABLE(network,
224 [ --disable-network Do not build network/serial support ],,)
225 if test x$enable_network != xno; then
227 D2X_FEATURES="network ${D2X_FEATURES}"
229 AM_CONDITIONAL(USE_NETWORK, test x$enable_network != xno)
231 dnl Check for assembler
232 AC_ARG_ENABLE(assembler,
233 [ --disable-assembler Do not use assembler optimization ],,)
234 if test x$enable_assembler = xno; then
236 D2X_FEATURES="no_asm ${D2X_FEATURES}"
238 if test x$NASM = xno; then
239 AC_MSG_ERROR([nasm not found. Install it or use --disable-assembler])
241 NASMFLAGS="-i\$(srcdir)/ $NASMFLAGS"
244 NASMFLAGS="-f win32 $NASMFLAGS"
247 NASMFLAGS="-f coff $NASMFLAGS"
250 NASMFLAGS="-f elf -d__linux__ $NASMFLAGS"
253 AC_MSG_ERROR([Assembler not supported for this OS])
257 AM_CONDITIONAL(USE_ASM, test x$enable_assembler != xno)
261 AC_SUBST(D2X_ARCH_SUBDIRS)
263 AC_SUBST(D2X_MAIN_SUBDIRS)
281 arch/svgalib/Makefile
294 d2x has been configured successfully.
296 Platform(s): $D2X_ARCH_SUBDIRS
297 Features : $D2X_FEATURES $D2X_MAIN_SUBDIRS
299 Shared game data directory: $sharepath