1 # -*- mode: shell-script -*-
2 AC_INIT(main/inferno.c)
9 AM_CONFIG_HEADER(conf.h)
10 AM_INIT_AUTOMAKE(d2x, 0.1.2)
14 #kludge to keep autoconf from adding -g -O2
20 AC_CHECK_TOOL(CC, gcc, :)
21 AC_CHECK_TOOL(RANLIB, ranlib, :)
22 AC_CHECK_TOOL(STRIP, strip, :)
23 AC_CHECK_TOOL(AR, ar, :)
26 AC_PATH_PROGS(NASM, nasmw nasm, no)
30 if test x$CYGWIN = xyes; then
31 AC_MSG_WARN([Cygwin found, setting -mno-cygwin])
32 CFLAGS="-mno-cygwin $CFLAGS"
36 AM_CONDITIONAL(MINGW32, test x$MINGW32 = xyes)
37 if test x$MINGW32 = xyes; then
38 GL_LIBS="opengl32 glu32"
43 dnl Set $prefix and $exec_prefix to $ac_default_prefix if they are not set
44 test "x$prefix" = "xNONE" && prefix=$ac_default_prefix
45 test "x$exec_prefix" = "xNONE" && exec_prefix="${prefix}"
47 dnl Set default locations to find data files.
49 default_sharepath="$foo/games/$PACKAGE"
51 CFLAGS="-Wall $CFLAGS"
53 dnl Enable editor build?
55 [ --enable-editor Build editor? (not functional)],,)
56 if test x$enable_editor = xyes; then
58 D2X_MAIN_SUBDIRS=editor
60 AM_CONDITIONAL(EDITOR, test x$enable_editor = xyes)
62 dnl Enable shareware build?
63 AC_ARG_ENABLE(shareware,
64 [ --enable-shareware Build for demo datafiles (not functional)],,)
65 if test x$enable_shareware = xyes; then
67 D2X_FEATURES="shareware ${D2X_FEATURES}"
69 AM_CONDITIONAL(SHAREWARE, test x$enable_shareware = xyes)
71 dnl Enable movie trick?
73 [ --enable-movie-trick Enable trick to show movies],,)
74 if test x$enable_movie_trick = xyes; then
75 AC_DEFINE(MOVIE_TRICK)
76 D2X_FEATURES="movie_trick ${D2X_FEATURES}"
78 AM_CONDITIONAL(MOVIE_TRICK, test x$enable_movie_trick = xyes)
81 AC_ARG_ENABLE(nmovies,
82 [ --enable-nmovies Turn off movies (render endlevel flythrough)],,)
83 if test x$enable_nmovies = xyes; then
85 D2X_FEATURES="nmovies ${D2X_FEATURES}"
87 AM_CONDITIONAL(NMOVIES, test x$enable_nmovies = xyes)
89 dnl Enable cross-platform bitmap/palette loader?
90 AC_ARG_ENABLE(xploader,
91 [ --enable-xploader Enable cross-platform bitmap/palette loader ],,)
92 if test x$enable_xploader = xyes; then
93 AC_DEFINE(PORTABLE_LOADER)
94 D2X_FEATURES="xploader ${D2X_FEATURES}"
97 dnl Count warnings as errors?
99 [ --enable-werror Count compiler warning as errors ],,)
100 if test x$enable_werror = xyes; then
101 CFLAGS="-Werror $CFLAGS"
102 D2X_FEATURES="werror ${D2X_FEATURES}"
105 dnl Build with NDEBUG?
107 [ --disable-debug Take out debug symbols, Asserts, Int3, etc ],,)
108 if test x$enable_debug = xno; then
113 D2X_FEATURES="debug ${D2X_FEATURES}"
116 dnl Build with RELEASE?
117 AC_ARG_ENABLE(release,
118 [ --enable-release Release build. Removes debug/editor things ],,)
119 if test x$enable_release = xyes; then
121 D2X_FEATURES="release ${D2X_FEATURES}"
124 AC_ARG_WITH(sharepath,
125 [[ --with-sharepath=DIR Use DIR for shared game data [DATADIR/games/d2x]]],
126 sharepath=$withval, sharepath="auto")
127 if test "x$sharepath" = "xauto" -o "x$sharepath" = "xyes" -o "x$sharepath" = "x"; then
128 sharepath="$default_sharepath"
130 AC_DEFINE_UNQUOTED(SHAREPATH, "$sharepath")
133 AM_CONDITIONAL(DJGPP, test "$host_os" = "msdosdjgpp")
134 if test "$host_os" = "msdosdjgpp"; then
136 CFLAGS="-I \$(top_srcdir)/arch/dos/include $CFLAGS"
141 CFLAGS="-pipe $CFLAGS"
146 AC_MSG_ERROR(SDL not found. Make sure sdl-config is in your PATH, or specify with --with-sdl-prefix)
148 CFLAGS="$SDL_CFLAGS $CFLAGS"
149 LIBS="$SDL_LIBS $LIBS"
154 AC_CHECK_HEADERS(netipx/ipx.h)
158 [ --with-opengl Build OpenGL support ],,)
159 if test x$with_opengl = xyes; then
160 for lib in $GL_LIBS; do
161 AC_CHECK_LIB($lib, main,
162 OGL_LIBS="${OGL_LIBS} -l$lib",
163 [AC_MSG_ERROR([$lib not found, --with-opengl cannot be used])
170 D2X_ARCH_SUBDIRS="ogl ${D2X_ARCH_SUBDIRS}"
173 AM_CONDITIONAL(USE_OPENGL, test x$with_opengl = xyes)
177 [ --with-ggi Build GGI support ],,)
178 if test x$with_ggi = xyes; then
179 AC_CHECK_LIB(ggi, ggiInit,
181 [AC_MSG_ERROR([GGI not found, GGI version cannot be built]); ggi=false])
182 AC_CHECK_LIB(gii, giiInit,
183 GGI_LIBS="${GGI_LIBS} -lgii",
184 [AC_MSG_ERROR([GII not found, GGI version cannot be built]); ggi=false])
187 D2X_ARCH_SUBDIRS="ggi ${D2X_ARCH_SUBDIRS}"
190 AM_CONDITIONAL(USE_GGI, test x$with_ggi = xyes)
194 [ --with-svga Build SVGALib support ],,)
195 if test x$with_svga = xyes; then
196 AC_CHECK_LIB(vga,vga_getmousetype,
198 [AC_MSG_ERROR([vga not found, SVGALib cannot be built])
201 AC_CHECK_LIB(vgagl,gl_getcontext,
202 SVGA_LIBS="${SVGA_LIBS} -lvgagl",
203 [AC_MSG_ERROR([vgagl not found, SVGALib cannot be built])
208 D2X_ARCH_SUBDIRS="svgalib ${D2X_ARCH_SUBDIRS}"
211 AM_CONDITIONAL(USE_SVGALIB, test x$with_svga = xyes)
213 if test x$MINGW32 = xyes; then
214 D2X_ARCH_SUBDIRS="win32 ${D2X_ARCH_SUBDIRS}"
215 AC_DEFINE(SDL_JOYSTICK)
217 CFLAGS="-I \$(top_srcdir)/arch/linux/include $CFLAGS"
218 D2X_ARCH_SUBDIRS="linux ${D2X_ARCH_SUBDIRS}"
220 dnl Check for SDL joystick
221 AC_ARG_ENABLE(sdl-joystick,
222 [ --enable-sdl-joystick Use SDL joystick (required for mingw) ],,)
223 if test x$enable_sdl_joystick = xyes; then
224 AC_DEFINE(SDL_JOYSTICK)
225 D2X_FEATURES="sdl_joystick ${D2X_FEATURES}"
227 AM_CONDITIONAL(SDL_JOYSTICK, test x$enable_sdl_joystick = xyes)
231 dnl Check for network
232 AC_ARG_ENABLE(network,
233 [ --disable-network Do not build network/serial support ],,)
234 if test x$enable_network != xno; then
236 D2X_FEATURES="network ${D2X_FEATURES}"
238 AM_CONDITIONAL(USE_NETWORK, test x$enable_network != xno)
240 dnl Check for assembler
241 AC_ARG_ENABLE(assembler,
242 [ --disable-assembler Do not use assembler optimization ],,)
243 if test x$enable_assembler = xno; then
245 D2X_FEATURES="no_asm ${D2X_FEATURES}"
247 if test x$NASM = xno; then
248 AC_MSG_ERROR([nasm not found. Install it or use --disable-assembler])
250 NASMFLAGS="-i\$(srcdir)/ $NASMFLAGS"
253 NASMFLAGS="-f win32 $NASMFLAGS"
256 NASMFLAGS="-f coff $NASMFLAGS"
259 NASMFLAGS="-f elf -d__linux__ $NASMFLAGS"
262 AC_MSG_ERROR([Assembler not supported for this OS])
266 AM_CONDITIONAL(USE_ASM, test x$enable_assembler != xno)
270 AC_SUBST(D2X_ARCH_SUBDIRS)
272 AC_SUBST(D2X_MAIN_SUBDIRS)
290 arch/svgalib/Makefile
303 d2x has been configured successfully.
305 Platform(s): $D2X_ARCH_SUBDIRS
306 Features : $D2X_FEATURES $D2X_MAIN_SUBDIRS
308 Shared game data directory: $sharepath