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 dnl Set $prefix and $exec_prefix to $ac_default_prefix if they are not set
42 test "x$prefix" = "xNONE" && prefix=$ac_default_prefix
43 test "x$exec_prefix" = "xNONE" && exec_prefix="${prefix}"
45 dnl Set default locations to find data files.
47 default_sharepath="$foo/games/$PACKAGE"
49 CFLAGS="-Wall $CFLAGS"
51 dnl Enable editor build?
53 [ --enable-editor Build editor? (not functional)],,)
54 if test x$enable_editor = xyes; then
56 D2X_MAIN_SUBDIRS=editor
58 AM_CONDITIONAL(EDITOR, test x$enable_editor = xyes)
60 dnl Enable shareware build?
61 AC_ARG_ENABLE(shareware,
62 [ --enable-shareware Build for demo datafiles (not functional)],,)
63 if test x$enable_shareware = xyes; then
66 AM_CONDITIONAL(SHAREWARE, test x$enable_shareware = xyes)
68 dnl Enable movie trick?
70 [ --enable-movie-trick Enable trick to show movies],,)
71 if test x$enable_movie_trick = xyes; then
72 AC_DEFINE(MOVIE_TRICK)
74 AM_CONDITIONAL(MOVIE_TRICK, test x$enable_movie_trick = xyes)
77 AC_ARG_ENABLE(nmovies,
78 [ --enable-nmovies Turn off movies (render endlevel flythrough)],,)
79 if test x$enable_nmovies = xyes; then
82 AM_CONDITIONAL(NMOVIES, test x$enable_nmovies = xyes)
84 dnl Enable cross-platform bitmap/palette loader?
85 AC_ARG_ENABLE(xploader,
86 [ --enable-xploader Enable cross-platform bitmap/palette loader ],,)
87 if test x$enable_xploader = xyes; then
88 AC_DEFINE(PORTABLE_LOADER)
91 dnl Count warnings as errors?
93 [ --enable-werror Count compiler warning as errors ],,)
94 if test x$enable_werror = xyes; then
95 CFLAGS="-Werror $CFLAGS"
98 dnl Build with NDEBUG?
100 [ --disable-debug Take out debug symbols, Asserts, Int3, etc ],,)
101 if test x$enable_debug = xno; then
108 AC_ARG_WITH(sharepath,
109 [[ --with-sharepath=DIR Use DIR for shared game data [DATADIR/games/d2x]]],
110 sharepath=$withval, sharepath="auto")
111 if test "x$sharepath" = "xauto" -o "x$sharepath" = "xyes" -o "x$sharepath" = "x"; then
112 sharepath="$default_sharepath"
114 AC_DEFINE_UNQUOTED(SHAREPATH, "$sharepath")
117 AM_CONDITIONAL(DJGPP, test "$host_os" = "msdosdjgpp")
118 if test "$host_os" = "msdosdjgpp"; then
120 CFLAGS="-I \$(top_srcdir)/arch/dos/include $CFLAGS"
125 CFLAGS="-pipe $CFLAGS"
130 AC_MSG_ERROR(SDL not found. Make sure sdl-config is in your PATH, or specify with --with-sdl-prefix)
132 CFLAGS="$SDL_CFLAGS $CFLAGS"
133 LIBS="$SDL_LIBS $LIBS"
138 AC_CHECK_HEADERS(netipx/ipx.h)
142 [ --with-opengl Build OpenGL support ],,)
143 if test x$with_opengl = xyes; then
144 for lib in $GL_LIBS; do
145 AC_CHECK_LIB($lib, main,
146 OGL_LIBS="${OGL_LIBS} -l$lib",
147 [AC_MSG_ERROR([$lib not found, --with-opengl cannot be used])
154 D2X_ARCH_SUBDIRS="ogl ${D2X_ARCH_SUBDIRS}"
157 AM_CONDITIONAL(USE_OPENGL, test x$with_opengl = xyes)
161 [ --with-ggi Build GGI support ],,)
162 if test x$with_ggi = xyes; then
163 AC_CHECK_LIB(ggi, ggiInit,
165 [AC_MSG_ERROR([GGI not found, GGI version cannot be built]); ggi=false])
166 AC_CHECK_LIB(gii, giiInit,
167 GGI_LIBS="${GGI_LIBS} -lgii",
168 [AC_MSG_ERROR([GII not found, GGI version cannot be built]); ggi=false])
171 D2X_ARCH_SUBDIRS="ggi ${D2X_ARCH_SUBDIRS}"
174 AM_CONDITIONAL(USE_GGI, test x$with_ggi = xyes)
178 [ --with-svga Build SVGALib support ],,)
179 if test x$with_svga = xyes; then
180 AC_CHECK_LIB(vga,vga_getmousetype,
182 [AC_MSG_ERROR([vga not found, SVGALib cannot be built])
185 AC_CHECK_LIB(vgagl,gl_getcontext,
186 SVGA_LIBS="${SVGA_LIBS} -lvgagl",
187 [AC_MSG_ERROR([vgagl not found, SVGALib cannot be built])
192 D2X_ARCH_SUBDIRS="svgalib ${D2X_ARCH_SUBDIRS}"
195 AM_CONDITIONAL(USE_SVGALIB, test x$with_svga = xyes)
197 if test x$MINGW32 = xyes; then
198 D2X_ARCH_SUBDIRS="win32 ${D2X_ARCH_SUBDIRS}"
199 AC_DEFINE(SDL_JOYSTICK)
201 CFLAGS="-I \$(top_srcdir)/arch/linux/include $CFLAGS"
202 D2X_ARCH_SUBDIRS="linux ${D2X_ARCH_SUBDIRS}"
204 dnl Check for SDL joystick
205 AC_ARG_ENABLE(sdl-joystick,
206 [ --enable-sdl-joystick Use SDL joystick (required for mingw) ],,)
207 if test x$enable_sdl_joystick = xyes; then
208 AC_DEFINE(SDL_JOYSTICK)
210 AM_CONDITIONAL(SDL_JOYSTICK, test x$enable_sdl_joystick = xyes)
214 dnl Check for network
215 AC_ARG_ENABLE(network,
216 [ --disable-network Do not build network/serial support ],,)
217 if test x$enable_network != xno; then
220 AM_CONDITIONAL(USE_NETWORK, test x$enable_network != xno)
222 dnl Check for assembler
223 AC_ARG_ENABLE(assembler,
224 [ --disable-assembler Do not use assembler optimization ],,)
225 if test x$enable_assembler = xno; then
228 if test x$NASM = xno; then
229 AC_MSG_ERROR([nasm not found. Install it or use --disable-assembler])
231 NASMFLAGS="-i\$(srcdir)/ $NASMFLAGS"
234 NASMFLAGS="-f win32 $NASMFLAGS"
237 NASMFLAGS="-f coff $NASMFLAGS"
240 NASMFLAGS="-f elf -d__linux__ $NASMFLAGS"
243 AC_MSG_ERROR([Assembler not supported for this OS])
247 AM_CONDITIONAL(USE_ASM, test x$enable_assembler != xno)
251 AC_SUBST(D2X_ARCH_SUBDIRS)
253 AC_SUBST(D2X_MAIN_SUBDIRS)
271 arch/svgalib/Makefile