1dnl
2dnl  Copyright <=2006 by the cuyo developers
3dnl  Maintenance modifications 2006-2011 by the cuyo developers
4dnl
5dnl  This program is free software; you can redistribute it and/or modify
6dnl  it under the terms of the GNU General Public License as published by
7dnl  the Free Software Foundation; either version 2 of the License, or
8dnl  (at your option) any later version.
9dnl
10dnl  This program is distributed in the hope that it will be useful,
11dnl  but WITHOUT ANY WARRANTY; without even the implied warranty of
12dnl  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
13dnl  GNU General Public License for more details.
14dnl
15dnl  You should have received a copy of the GNU General Public License
16dnl  along with this program; if not, write to the Free Software
17dnl  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
18dnl
19
20dnl Muss immer am Anfang stehen.
21AC_INIT(cuyo,[2.1.0], cuyo@karimmi.de)
22dnl Die angegebene Datei ist irgend eine; und nur dazu da, um an deren
23dnl Existenz rausfinden zu k�nnen, ob's das richtige Verzeichnis ist.
24AC_CONFIG_SRCDIR(src/cuyo.cpp)
25dnl these here make AM_PATH_SDL_CUYO less noisy
26AC_ARG_PROGRAM
27
28AM_INIT_AUTOMAKE([foreign -Wall -Wno-portability])
29
30dnl Bernhard will das: (damit kaputte Automakes nix kaputt machen)
31AM_MAINTAINER_MODE
32
33dnl Sorgt daf�r, dass defines nicht mit -D �bergeben werden, sondern in
34dnl config.h geschrieben werden. (Dazu muss vorher autoheader aufgerufen
35dnl werden, um config.h.in zu erzeugen.) Wenn man Automake benutzt, muss
36dnl man die AM_-Version dieses Makros verwenden. (Warum auch immer.)
37AM_CONFIG_HEADER(config.h)
38
39dnl This is a C++ program, no need to test the C compiler
40AC_LANG(C++)
41
42dnl -------------------------------------------------------------------------
43dnl debug
44dnl -------------------------------------------------------------------------
45
46dnl Auskommentiert:
47
48dnl Hier kann man zur ./configure - zeit noch ein --enable-debug angeben.
49dnl AC_ARG_ENABLE(debug, [  --enable-debug          compile with debugging symbols and without optimisation if no CFLAGS is given],
50dnl	[CXXDBGFLAGS="-g"], [CXXDBGFLAGS="-O2"])
51
52dnl -------------------------------------------------------------------------
53dnl Basic g++ stuff
54dnl -------------------------------------------------------------------------
55
56if test "${CXXFLAGS+set}" != set ; then
57	CXXFLAGS="-Wall -W -ansi $CXXDBGFLAGS"
58fi
59
60dnl g++:
61AC_PROG_CXX
62dnl Das Programm, mit dem installiert wird:
63AC_PROG_INSTALL
64
65dnl Checks for typedefs, structures, and compiler characteristics.
66AC_C_CONST
67
68
69dnl -------------------------------------------------------------------------
70dnl gettext stuff
71dnl -------------------------------------------------------------------------
72
73dnl AM_GNU_GETTEXT([external],[need-formatstring-macros])
74
75MY_GETTEXT
76
77
78dnl -------------------------------------------------------------------------
79dnl Lex & Yacc
80dnl -------------------------------------------------------------------------
81
82
83AM_PROG_LEX
84dnl AM_PROG_LEX scheint einen Bug zu haben: Da taucht die Zeile
85dnl test -n "$LEX" || LEX=""$missing_dir/missing flex""
86dnl im configure-skript auf. Also mit zu vielen Anf�hrungszeichen.
87dnl Aber die info-page von automake sagt sowieso, dass, wenn man
88dnl %noyywrap verwendet, man statt AM_PROG_LEX aufzurufen folgendes
89dnl tun soll:
90dnl AC_PROG_LEX
91dnl if test "$LEX" != flex; then
92dnl   LEX="$SHELL $missing_dir/missing flex"
93dnl   AC_SUBST(LEX_OUTPUT_ROOT, lex.yy)
94dnl   AC_SUBST(LEXLIB, '')
95dnl fi
96
97AC_PROG_YACC
98
99dnl Wohin werden Level und Bilder installiert?
100dnl AC_DEFINE_DIR(DATADIR, datadir)
101
102
103dnl -------------------------------------------------------------------------
104dnl libz
105dnl -------------------------------------------------------------------------
106
107
108dnl Gibt's die LibZ? Wenn ja, kann Cuyo komprimierte Bilddateien
109dnl laden. Wenn's die Lib gibt, wird:
110dnl - "-lz" an gcc �bergeben (genauer: vor die autoconf-Variable @LIBS@ geh�ngt)
111dnl - In config.h wird "#define HAVE_LIBZ 1" geschrieben
112dnl - Das "if HASLIBZ" in den Makefile.am ausgef�hrt
113dnl AC_CHECK_LIB(z, gzopen)
114AC_CHECK_LIB(z, gzopen, [
115  dnl "#define HAVE_LIBZ 1" in config.h schreiben (siehe auch acconfig.h)
116  AC_DEFINE_UNQUOTED(HAVE_LIBZ, 1, [Define this to enable reading of .xpm.gz files. Needs libz.])
117  LIBS="-lz $LIBS"
118  HASLIBZ=true
119])
120AM_CONDITIONAL(HASLIBZ, test a$HASLIBZ = atrue)
121
122
123dnl -------------------------------------------------------------------------
124dnl SDL
125dnl -------------------------------------------------------------------------
126
127AM_PATH_SDL_CUYO(1.2.0)
128if test -z "$SDL_LIBS"; then AC_MSG_ERROR([SDL is required to compile Cuyo])
129fi
130
131AC_CHECK_LIB(SDL_mixer,Mix_OpenAudio,[SDL_LIBS="$SDL_LIBS -lSDL_mixer"],
132		[AC_MSG_ERROR([SDL_mixer is required to compile Cuyo])],
133                [$SDL_LIBS])
134
135save_CPPFLAGS="$CPPFLAGS"
136CPPFLAGS="$CPPFLAGS $SDL_CPPFLAGS"
137AC_CHECK_HEADER(SDL_mixer.h,,[AC_MSG_ERROR([SDL_mixer.h is required to compile Cuyo])])
138CPPFLAGS="$save_CPPFLAGS"
139
140
141dnl -------------------------------------------------------------------------
142dnl datasrc-maintainer-mode
143dnl -------------------------------------------------------------------------
144
145
146AC_ARG_ENABLE(datasrc-maintainer-mode, [  --enable-datasrc-maintainer-mode          rebuild file lists in the datasrc directory, if necessary; needs ocaml],
147	[DATASRC_MAINTAINER_MODE=true], [DATASRC_MAINTAINER_MODE=false])
148AC_SUBST(DATASRC_MAINTAINER_MODE)
149
150
151
152dnl -------------------------------------------------------------------------
153dnl Create makefiles
154dnl -------------------------------------------------------------------------
155
156
157dnl Makefiles erzeugen...
158AC_OUTPUT(Makefile src/Makefile data/Makefile docs/Makefile icons/Makefile po/Makefile)
159