File: configure.ac

package info (click to toggle)
cuyo 2.0.0brl1-3
  • links: PTS, VCS
  • area: main
  • in suites: jessie, jessie-kfreebsd, stretch
  • size: 15,624 kB
  • sloc: cpp: 11,728; ml: 5,515; sh: 1,179; makefile: 757; yacc: 558; awk: 355; lex: 244; perl: 193
file content (182 lines) | stat: -rw-r--r-- 6,263 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
dnl
dnl  Copyright <=2006 by the cuyo developers
dnl  Maintenance modifications 2006-2011 by the cuyo developers
dnl
dnl  This program is free software; you can redistribute it and/or modify
dnl  it under the terms of the GNU General Public License as published by
dnl  the Free Software Foundation; either version 2 of the License, or
dnl  (at your option) any later version.
dnl
dnl  This program is distributed in the hope that it will be useful,
dnl  but WITHOUT ANY WARRANTY; without even the implied warranty of
dnl  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
dnl  GNU General Public License for more details.
dnl
dnl  You should have received a copy of the GNU General Public License
dnl  along with this program; if not, write to the Free Software
dnl  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
dnl

dnl Muss immer am Anfang stehen.
dnl AC_INIT(cuyo,[2.0.0], cuyo@karimmi.de)
AC_INIT(cuyo,[2.0.0brl1], brlink@debian.org)
dnl Die angegebene Datei ist irgend eine; und nur dazu da, um an deren
dnl Existenz rausfinden zu k�nnen, ob's das richtige Verzeichnis ist.
AC_CONFIG_SRCDIR(src/cuyo.cpp)
dnl these here make AM_PATH_SDL_CUYO less noisy
AC_ARG_PROGRAM

AM_INIT_AUTOMAKE([foreign -Wall -Wno-portability])

dnl Bernhard will das: (damit kaputte Automakes nix kaputt machen)
AM_MAINTAINER_MODE

dnl Sorgt daf�r, dass defines nicht mit -D �bergeben werden, sondern in
dnl config.h geschrieben werden. (Dazu muss vorher autoheader aufgerufen
dnl werden, um config.h.in zu erzeugen.) Wenn man Automake benutzt, muss
dnl man die AM_-Version dieses Makros verwenden. (Warum auch immer.)
AM_CONFIG_HEADER(config.h)

dnl This is a C++ program, no need to test the C compiler
AC_LANG(C++)

AC_PROG_AWK
dnl -------------------------------------------------------------------------
dnl debug
dnl -------------------------------------------------------------------------

dnl Auskommentiert:

dnl -------------------------------------------------------------------------
dnl Basic g++ stuff
dnl -------------------------------------------------------------------------

if test "${CXXFLAGS+set}" != set ; then
	CXXFLAGS="-Wall -W -ansi -O2 -g"
fi

dnl g++:
AC_PROG_CXX
dnl Das Programm, mit dem installiert wird:
AC_PROG_INSTALL

dnl Checks for typedefs, structures, and compiler characteristics.
AC_C_CONST


dnl -------------------------------------------------------------------------
dnl gettext stuff
dnl -------------------------------------------------------------------------

dnl AM_GNU_GETTEXT([external],[need-formatstring-macros])

MY_GETTEXT


dnl -------------------------------------------------------------------------
dnl Lex & Yacc
dnl -------------------------------------------------------------------------


AM_PROG_LEX
dnl AM_PROG_LEX scheint einen Bug zu haben: Da taucht die Zeile
dnl test -n "$LEX" || LEX=""$missing_dir/missing flex""
dnl im configure-skript auf. Also mit zu vielen Anf�hrungszeichen.
dnl Aber die info-page von automake sagt sowieso, dass, wenn man
dnl %noyywrap verwendet, man statt AM_PROG_LEX aufzurufen folgendes
dnl tun soll:
dnl AC_PROG_LEX
dnl if test "$LEX" != flex; then
dnl   LEX="$SHELL $missing_dir/missing flex"
dnl   AC_SUBST(LEX_OUTPUT_ROOT, lex.yy)
dnl   AC_SUBST(LEXLIB, '')
dnl fi

AC_PROG_YACC

dnl Wohin werden Level und Bilder installiert?
dnl AC_DEFINE_DIR(DATADIR, datadir)


dnl -------------------------------------------------------------------------
dnl libz
dnl -------------------------------------------------------------------------


dnl Gibt's die LibZ? Wenn ja, kann Cuyo komprimierte Bilddateien
dnl laden. Wenn's die Lib gibt, wird:
dnl - "-lz" an gcc �bergeben (genauer: vor die autoconf-Variable @LIBS@ geh�ngt)
dnl - In config.h wird "#define HAVE_LIBZ 1" geschrieben
dnl - Das "if HASLIBZ" in den Makefile.am ausgef�hrt
dnl AC_CHECK_LIB(z, gzopen)
AC_CHECK_LIB(z, gzopen, [
  dnl "#define HAVE_LIBZ 1" in config.h schreiben (siehe auch acconfig.h)
  AC_DEFINE_UNQUOTED(HAVE_LIBZ, 1, [Define this to enable reading of .xpm.gz files. Needs libz.])
  LIBS="-lz $LIBS"
  HASLIBZ=true
])
AM_CONDITIONAL(HASLIBZ, test a$HASLIBZ = atrue)


dnl -------------------------------------------------------------------------
dnl SDL
dnl -------------------------------------------------------------------------

AM_PATH_SDL_CUYO(1.2.0)
if test -z "$SDL_LIBS"; then AC_MSG_ERROR([SDL is required to compile Cuyo])
fi

AC_CHECK_LIB(SDL_mixer,Mix_OpenAudio,[SDL_LIBS="$SDL_LIBS -lSDL_mixer"],
		[AC_MSG_ERROR([SDL_mixer is required to compile Cuyo])],
                [$SDL_LIBS])

save_CPPFLAGS="$CPPFLAGS"
CPPFLAGS="$CPPFLAGS $SDL_CPPFLAGS"
AC_CHECK_HEADER(SDL_mixer.h,,[AC_MSG_ERROR([SDL_mixer.h is required to compile Cuyo])])
CPPFLAGS="$save_CPPFLAGS"

dnl -------------------------------------------------------------------------
dnl How to compile ocaml
dnl -------------------------------------------------------------------------

AC_ARG_VAR([OCAMLOPT],[ocaml native compiler to use (ocamlopt)])
AC_ARG_VAR([OCAMLC],[ocaml compiler to use (ocamlc), used if no native compiler found or cross-compiling])
AC_ARG_VAR([OCAMLLEX],[ocaml lex to use (ocamllex)])
if test "$cross_compiling" = yes ; then
	native_ocaml=no
else
	AC_PATH_PROG([OCAMLOPT],[ocamlopt], [NONE])
	if test "$OCAMLOPT" = "NONE" ; then
		native_ocaml=no
	else
		native_ocaml=yes
		AC_SUBST(MLC,['${OCAMLOPT}'])
		AC_SUBST(mlo,[cmx])
		AC_SUBST(mla,[cmxa])
		AC_SUBST(mlrun,[opt])
	fi
fi
if test "$native_ocaml" = "no" ; then
	AC_PATH_PROG([OCAMLC],[ocamlc],[NONE])
	if test "$OCAMLC" = "NONE" ; then
		AC_MSG_ERROR([Could not find ocamlopt nor ocamlc, try setting OCAMLOPT or OCAMLC])
		native_ocaml=no
	else
		native_ocaml=yes
		AC_SUBST(MLC,['${OCAMLC}'])
		AC_SUBST(mlo,[cmo])
		AC_SUBST(mla,[cma])
		AC_SUBST(mlrun,[mlrun])
	fi
fi
AC_PATH_PROG([OCAMLLEX],[ocamllex],[NONE])
if test "$OCAMLLEX" = "NONE" ; then
	AC_MSG_ERROR([Could not find ocamllex, try setting OCAMLLEX])
fi

dnl -------------------------------------------------------------------------
dnl Create makefiles
dnl -------------------------------------------------------------------------

dnl Makefiles erzeugen...
AC_OUTPUT(Makefile src/Makefile data/Makefile docs/Makefile icons/Makefile po/Makefile)