Add Makefile for building CAB files, dependency calculation.
[chocolate-doom.git] / configure.in
blob4b29cee50217344ebca9b85b7f170dde93652d9a
1 AC_INIT(Chocolate Doom, 1.2.1, fraggle@gmail.com, chocolate-doom)
3 AC_CONFIG_AUX_DIR(autotools)
5 orig_CFLAGS="$CFLAGS"
7 AC_PROG_CC
8 AC_PROG_RANLIB
9 AC_CHECK_PROG(HAVE_PYTHON, python, true, false)
11 OPT_LEVEL=2
13 # Engine room, we need more speed!
15 AC_ARG_ENABLE(penis-extension, 
16 [  --enable-penis-extension   Enable counterproductive compiler optimisations ],
17 [ OPT_LEVEL=3 ])
19 # If this is gcc, we have some options we'd like to turn on.  Turn on 
20 # optimisation and debugging symbols.
22 if test "$GCC" = "yes"
23 then
24         CFLAGS="-O$OPT_LEVEL -g -Wall $orig_CFLAGS"
27 dnl Search for SDL ...
29 AM_PATH_SDL(1.1.3)
31 # Add the SDL compiler flags to the default compiler flag variables. 
32 # It is important to do this now, before checking for headers and
33 # library functions.  The reason being that on Windows, sdl-config
34 # sets the -mno-cygwin compiler option in order to generate MinGW 
35 # executables.  If we don't do this now, we might end up discovering
36 # header files that are not actually available to us when we come
37 # to compile.
39 CFLAGS="$CFLAGS $SDL_CFLAGS"
40 LDFLAGS="$LDFLAGS $SDL_LIBS"
42 AC_CHECK_LIB(SDL_mixer,Mix_LoadMUS,[
43     SDLMIXER_LIBS="$SDLMIXER_LIBS -lSDL_mixer"
44 ],[
45     echo "*** Could not find SDL_mixer.  Please install it."
46     exit -1
49 AC_CHECK_LIB(SDL_net,SDLNet_UDP_Send,[
50     SDLNET_LIBS="$SDLNET_LIBS -lSDL_net"
51 ],[
52     echo "*** Could not find SDL_net.  Please install it."
53     exit -1
56 # Windows CE build?
58 WINDOWS_CE=false
60 case "$host" in
61     *mingw32ce*|*cegcc*|*wince*)
62         CFLAGS="-I../wince $CFLAGS"
63         WINDOWS_CE=true
64         ;;
65     *)
66         ;;
67 esac
69 AC_CHECK_HEADERS([linux/kd.h dev/isa/spkrio.h dev/speaker/speaker.h])
70 AC_CHECK_FUNCS(mmap sched_setaffinity)
72 # DWF 2008-02-10:  FIXME
73 AC_CHECK_LIB(samplerate, src_new)
75 AC_CHECK_TOOL(WINDRES, windres, )
77 AM_CONDITIONAL(WINDOWS_CE, $WINDOWS_CE)
78 AM_CONDITIONAL(HAVE_WINDRES, test "$WINDRES" != "")
79 AM_CONDITIONAL(HAVE_PYTHON, $HAVE_PYTHON)
81 dnl Automake v1.8.0 is required, please upgrade!
83 AM_INIT_AUTOMAKE([1.8.0])
85 WINDOWS_RC_VERSION=`echo $PACKAGE_VERSION.0 | sed 's/\./, /g' `
87 AM_CONFIG_HEADER(config.h:config.hin)
89 AC_SUBST(WINDOWS_RC_VERSION)
90 AC_SUBST(SDLMIXER_CFLAGS)
91 AC_SUBST(SDLMIXER_LIBS)
93 AC_SUBST(SDLNET_CFLAGS)
94 AC_SUBST(SDLNET_LIBS)
96 AC_SUBST(ac_aux_dir)
98 dnl Shut up the datarootdir warnings.
99 AC_DEFUN([AC_DATAROOTDIR_CHECKED])
101 AC_OUTPUT([
102 Makefile
103 wince/Makefile
104 textscreen/Makefile
105 textscreen/examples/Makefile
106 setup/Makefile
107 man/Makefile
108 src/Makefile
109 pcsound/Makefile
110 pkg/wince/Makefile
111 src/resource.rc
112 src/doom-screensaver.desktop
113 setup/setup-res.rc