Only distribute README.OPL in the Windows package, don't bother including it in the...
[chocolate-doom.git] / configure.in
blobb097bb2ffe8410dca8fb4baf4ecbb7ea4a4b131a
1 AC_INIT(Chocolate Doom, 1.2.1, fraggle@gmail.com, chocolate-doom)
3 PACKAGE_SHORTDESC="Conservative Doom source port"
4 PACKAGE_COPYRIGHT="Copyright (C) 1993-2010"
5 PACKAGE_LICENSE="GNU General Public License, version 2"
6 PACKAGE_MAINTAINER="Simon Howard"
7 PACKAGE_URL="http://www.chocolate-doom.org/"
9 AC_CONFIG_AUX_DIR(autotools)
11 orig_CFLAGS="$CFLAGS"
13 AC_PROG_CC
14 AC_PROG_RANLIB
15 AC_CHECK_PROG(HAVE_PYTHON, python, true, false)
17 OPT_LEVEL=2
19 # Engine room, we need more speed!
21 AC_ARG_ENABLE(penis-extension, 
22 [  --enable-penis-extension   Enable counterproductive compiler optimisations ],
23 [ OPT_LEVEL=3 ])
25 # If this is gcc, we have some options we'd like to turn on.  Turn on 
26 # optimisation and debugging symbols.
28 if test "$GCC" = "yes"
29 then
30         CFLAGS="-O$OPT_LEVEL -g -Wall $orig_CFLAGS"
33 dnl Search for SDL ...
35 AM_PATH_SDL(1.1.3)
37 # Add the SDL compiler flags to the default compiler flag variables. 
38 # It is important to do this now, before checking for headers and
39 # library functions.  The reason being that on Windows, sdl-config
40 # sets the -mno-cygwin compiler option in order to generate MinGW 
41 # executables.  If we don't do this now, we might end up discovering
42 # header files that are not actually available to us when we come
43 # to compile.
45 CFLAGS="$CFLAGS $SDL_CFLAGS"
46 LDFLAGS="$LDFLAGS $SDL_LIBS"
48 # On some platforms, SDL renames main() to SDL_main() using a #define,
49 # so that its own main, stored in the SDLmain library, can be run first.
50 # Unfortunately, this causes problems for autoconf, which builds
51 # test programs to probe the system.  All library/header/symbol checks
52 # must be run in this block, that performs a workaround for the problem.
54 AC_SDL_MAIN_WORKAROUND([
56     # Check for SDL_mixer.
58     AC_CHECK_LIB(SDL_mixer,Mix_LoadMUS,[
59         SDLMIXER_LIBS="$SDLMIXER_LIBS -lSDL_mixer"
60     ],[
61         echo "*** Could not find SDL_mixer.  Please install it."
62         exit -1
63     ])
65     # Check for SDL_net.
67     AC_CHECK_LIB(SDL_net,SDLNet_UDP_Send,[
68         SDLNET_LIBS="$SDLNET_LIBS -lSDL_net"
69     ],[
70         echo "*** Could not find SDL_net.  Please install it."
71         exit -1
72     ])
74     # Check for libsamplerate.
76     AC_CHECK_LIB(samplerate, src_new)
78     AC_CHECK_HEADERS([linux/kd.h dev/isa/spkrio.h dev/speaker/speaker.h])
79     AC_CHECK_FUNCS(mmap sched_setaffinity ioperm)
81     # OpenBSD I/O i386 library for I/O port access.
82     # (64 bit has the same thing with a different name!)
84     AC_CHECK_LIB(i386, i386_iopl)
85     AC_CHECK_LIB(amd64, amd64_iopl)
88 AC_CHECK_TOOL(WINDRES, windres, )
89 AC_CHECK_TOOL(STRIP, strip, )
91 # Windows CE build?
93 WINDOWS_CE=false
95 case "$host" in
96     *mingw32ce*|*cegcc*|*wince*)
97         CFLAGS="-I../wince $CFLAGS"
98         WINDOWS_CE=true
99         ;;
100     *)
101         ;;
102 esac
104 AM_CONDITIONAL(WINDOWS_CE, $WINDOWS_CE)
105 AM_CONDITIONAL(HAVE_WINDRES, test "$WINDRES" != "")
106 AM_CONDITIONAL(HAVE_PYTHON, $HAVE_PYTHON)
108 dnl Automake v1.8.0 is required, please upgrade!
110 AM_INIT_AUTOMAKE([1.8.0])
112 WINDOWS_RC_VERSION=`echo $PACKAGE_VERSION.0 | sed 's/\./, /g' `
114 AM_CONFIG_HEADER(config.h:config.hin)
116 AC_SUBST(WINDOWS_RC_VERSION)
117 AC_SUBST(SDLMIXER_CFLAGS)
118 AC_SUBST(SDLMIXER_LIBS)
120 AC_SUBST(SDLNET_CFLAGS)
121 AC_SUBST(SDLNET_LIBS)
123 AC_SUBST(ac_aux_dir)
125 AC_SUBST(PACKAGE_SHORTDESC)
126 AC_SUBST(PACKAGE_COPYRIGHT)
127 AC_SUBST(PACKAGE_LICENSE)
128 AC_SUBST(PACKAGE_MAINTAINER)
129 AC_SUBST(PACKAGE_URL)
130 AC_SUBST(PACKAGE_LONGDESC)
132 dnl Shut up the datarootdir warnings.
133 AC_DEFUN([AC_DATAROOTDIR_CHECKED])
135 AC_OUTPUT([
136 Makefile
137 rpm.spec
138 man/Makefile
139 opl/Makefile
140 opl/examples/Makefile
141 pcsound/Makefile
142 pkg/Makefile
143 pkg/config.make
144 pkg/osx/Info.plist
145 pkg/osx/Info-gnustep.plist
146 setup/Makefile
147 setup/setup-res.rc
148 src/Makefile
149 src/doom-screensaver.desktop
150 src/resource.rc
151 textscreen/Makefile
152 textscreen/examples/Makefile
153 wince/Makefile