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)
60 dnl Enable movie trick?
62 [ --enable-movie-trick Enable trick to show movies],,)
63 if test x$enable_movie_trick = xyes; then
64 AC_DEFINE(MOVIE_TRICK)
66 AM_CONDITIONAL(MOVIE_TRICK, test x$enable_movie_trick = xyes)
69 AC_ARG_ENABLE(nmovies,
70 [ --enable-nmovies Turn off movies (render endlevel flythrough)],,)
71 if test x$enable_nmovies = xyes; then
74 AM_CONDITIONAL(NMOVIES, test x$enable_nmovies = xyes)
76 dnl Enable cross-platform bitmap/palette loader?
77 AC_ARG_ENABLE(xploader,
78 [ --enable-xploader Enable cross-platform bitmap/palette loader ],,)
79 if test x$enable_xploader = xyes; then
80 AC_DEFINE(PORTABLE_LOADER)
83 dnl Count warnings as errors?
85 [ --enable-werror Count compiler warning as errors ],,)
86 if test x$enable_werror = xyes; then
87 CFLAGS="-Werror $CFLAGS"
90 dnl Build with NDEBUG?
92 [ --disable-debug Take out debug symbols, Asserts, Int3, etc ],,)
93 if test x$enable_debug = xno; then
101 AM_CONDITIONAL(DJGPP, test "$host_os" = "msdosdjgpp")
102 if test "$host_os" = "msdosdjgpp"; then
104 CFLAGS="-I \$(top_srcdir)/arch/dos/include $CFLAGS"
109 CFLAGS="-pipe $CFLAGS"
114 AC_MSG_ERROR(SDL not found. Make sure sdl-config is in your PATH, or specify with --with-sdl-prefix)
116 CFLAGS="$SDL_CFLAGS $CFLAGS"
117 LIBS="$SDL_LIBS $LIBS"
122 AC_CHECK_HEADERS(netipx/ipx.h)
126 [ --with-opengl Build OpenGL support ],,)
127 if test x$with_opengl = xyes; then
128 for lib in $GL_LIBS; do
129 AC_CHECK_LIB($lib, main,
130 OGL_LIBS="${OGL_LIBS} -l$lib",
131 [AC_MSG_ERROR([$lib not found, --with-opengl cannot be used])
138 D2X_ARCH_SUBDIRS="ogl ${D2X_ARCH_SUBDIRS}"
141 AM_CONDITIONAL(USE_OPENGL, test x$with_opengl = xyes)
145 [ --with-ggi Build GGI support ],,)
146 if test x$with_ggi = xyes; then
147 AC_CHECK_LIB(ggi, ggiInit,
149 [AC_MSG_ERROR([GGI not found, GGI version cannot be built]); ggi=false])
150 AC_CHECK_LIB(gii, giiInit,
151 GGI_LIBS="${GGI_LIBS} -lgii",
152 [AC_MSG_ERROR([GII not found, GGI version cannot be built]); ggi=false])
155 D2X_ARCH_SUBDIRS="ggi ${D2X_ARCH_SUBDIRS}"
158 AM_CONDITIONAL(USE_GGI, test x$with_ggi = xyes)
162 [ --with-svga Build SVGALib support ],,)
163 if test x$with_svga = xyes; then
164 AC_CHECK_LIB(vga,vga_getmousetype,
166 [AC_MSG_ERROR([vga not found, SVGALib cannot be built])
169 AC_CHECK_LIB(vgagl,gl_getcontext,
170 SVGA_LIBS="${SVGA_LIBS} -lvgagl",
171 [AC_MSG_ERROR([vgagl not found, SVGALib cannot be built])
176 D2X_ARCH_SUBDIRS="svgalib ${D2X_ARCH_SUBDIRS}"
179 AM_CONDITIONAL(USE_SVGALIB, test x$with_svga = xyes)
181 if test x$MINGW32 = xyes; then
182 D2X_ARCH_SUBDIRS="win32 ${D2X_ARCH_SUBDIRS}"
183 AC_DEFINE(SDL_JOYSTICK)
185 CFLAGS="-I \$(top_srcdir)/arch/linux/include $CFLAGS"
186 D2X_ARCH_SUBDIRS="linux ${D2X_ARCH_SUBDIRS}"
188 dnl Check for SDL joystick
189 AC_ARG_ENABLE(sdl-joystick,
190 [ --enable-sdl-joystick Use SDL joystick (required for mingw) ],,)
191 if test x$enable_sdl_joystick = xyes; then
192 AC_DEFINE(SDL_JOYSTICK)
194 AM_CONDITIONAL(SDL_JOYSTICK, test x$enable_sdl_joystick = xyes)
198 dnl Check for network
199 AC_ARG_ENABLE(network,
200 [ --disable-network Do not build network/serial support ],,)
201 if test x$enable_network != xno; then
204 AM_CONDITIONAL(USE_NETWORK, test x$enable_network != xno)
206 dnl Check for assembler
207 AC_ARG_ENABLE(assembler,
208 [ --disable-assembler Do not use assembler optimization ],,)
209 if test x$enable_assembler = xno; then
212 if test x$NASM = xno; then
213 AC_MSG_ERROR([nasm not found. Install it or use --disable-assembler])
215 NASMFLAGS="-i\$(srcdir)/ $NASMFLAGS"
218 NASMFLAGS="-f win32 $NASMFLAGS"
221 NASMFLAGS="-f coff $NASMFLAGS"
224 NASMFLAGS="-f elf -d__linux__ $NASMFLAGS"
227 AC_MSG_ERROR([Assembler not supported for this OS])
231 AM_CONDITIONAL(USE_ASM, test x$enable_assembler != xno)
235 AC_SUBST(D2X_ARCH_SUBDIRS)
237 AC_SUBST(D2X_MAIN_SUBDIRS)
255 arch/svgalib/Makefile