forked from xoreos/xoreos
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathconfigure.ac
270 lines (213 loc) · 5.41 KB
/
configure.ac
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
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
AC_PREREQ([2.65])
AC_INIT([eos],[0.0.1])
AC_CONFIG_HEADERS([config.h])
AC_CONFIG_SRCDIR([config.h.in])
AC_CONFIG_MACRO_DIR([m4])
AC_CONFIG_AUX_DIR([build-aux])
AC_CANONICAL_TARGET
AM_INIT_AUTOMAKE([1.11 -Wall no-dist-gzip dist-xz subdir-objects])
# Support silent build rules. Disable
# by either passing --disable-silent-rules to configure or passing V=1
# to make
AM_SILENT_RULES([yes])
dnl SDL params to configure
AC_ARG_VAR(SDL_CONFIG, [sdl-config utility])
AC_ARG_VAR(SDL_CFLAGS, [C compiler flags for SDL])
AC_ARG_VAR(SDL_LIBS, [libraries to pass to the linker for SDL])
dnl libtool
LT_PREREQ([2.2])
LT_INIT([disable-shared])
dnl We're C++
AC_PROG_CXX
AM_PROG_CC_C_O
dnl We want a make install
AC_PROG_INSTALL
dnl --with-werror
AC_ARG_WITH([werror], [AS_HELP_STRING([--with-werror], [Compile with -Werror @<:@default=no@:>@])], [], [with_werror=no])
if test "x$with_werror" = "xyes"; then
WERROR="-Werror -Werror=unused-but-set-variable"
fi
dnl Standard C, C++
AC_C_CONST
AC_HEADER_STDC
dnl Endianness
AC_C_BIGENDIAN()
dnl Special variables of the size of pointers
AC_TYPE_INTPTR_T
AC_TYPE_UINTPTR_T
dnl math library and special float functions
AC_CHECK_LIB([m], [cos])
AC_CHECK_FUNCS([fabs])
AC_CHECK_FUNCS([fmin])
AC_CHECK_FUNCS([fmax])
AC_CHECK_FUNCS([fabsf])
AC_CHECK_FUNCS([fminf])
AC_CHECK_FUNCS([fmaxf])
dnl SDL
AC_CHECK_PROG([SDL_CONFIG], [sdl-config], [sdl-config])
if test -n "$SDL_CONFIG"; then
if test -z "$SDL_CFLAGS"; then
SDL_CFLAGS=`$SDL_CONFIG --cflags`
fi
if test -z "$SDL_LIBS"; then
SDL_LIBS=`$SDL_CONFIG --libs`
fi
fi
save_LIBS="$LIBS"
LIBS="$LIBS $SDL_LIBS"
AC_CHECK_FUNC(SDL_Init, , AC_CHECK_LIB(SDL, SDL_Init, SDL_LIBS="$SDL_LIBS -lSDL", nosdl=1))
LIBS="$save_LIBS"
if test -n "$nosdl"; then
AC_MSG_ERROR([SDL is required and could not be found!])
fi
dnl faad
AC_CHECK_HEADER("neaacdec.h", , nolibfaad=1)
if test -n "$nolibfaad"; then
AC_MSG_ERROR([libfaad is required and could not be found])
fi
FAAD_CFLAGS=""
FAAD_LIBS="-lfaad"
dnl MAD
AC_CHECK_HEADER("mad.h", , nolibmad=1)
if test -n "$nolibmad"; then
AC_MSG_ERROR([libMAD is required and could not be found])
fi
MAD_CFLAGS=""
MAD_LIBS="-lmad"
dnl libvorbisfile and libogg
AC_CHECK_HEADER("vorbis/vorbisfile.h", , novorbis=1)
if test -n "$novorbis"; then
AC_MSG_ERROR([libOgg and libVorbis are required and could not be found])
fi
VORBIS_CFLAGS=""
VORBIS_LIBS="-lvorbisfile"
OGG_CFLAGS=""
OGG_LIBS="-logg"
dnl Xvid
AC_CHECK_HEADER("xvid.h", , nolibxvid=1)
if test -n "$nolibxvid"; then
AC_MSG_ERROR([libxvidcore is required and could not be found])
fi
XVID_CFLAGS=""
XVID_LIBS="-lxvidcore"
dnl zlib
AC_CHECK_HEADER("zlib.h", , nozlib=1)
if test -n "$nozlib"; then
AC_MSG_ERROR([zlib is required and could not be found])
fi
Z_CFLAGS=""
Z_LIBS="-lz"
dnl iconv
AM_ICONV
if test "x$am_cv_func_iconv" != "xyes"; then
AC_MSG_ERROR([No useable iconv() function found])
fi
dnl FreeType2
AC_CHECK_FT2([11.0.5], [], [AC_MSG_ERROR([FreeType2 is required to compile eos])])
dnl Boost
BOOST_REQUIRE
BOOST_STRING_ALGO
BOOST_SYSTEM
BOOST_FILESYSTEM
BOOST_REGEX
BOOST_UNORDERED
BOOST_HASH
BOOST_DATE_TIME
BOOST_FUNCTION
BOOST_BIND
BOOST_UUID
dnl OpenGL
case "$target" in
*darwin*)
dnl Do not run the OpenGL checks on OS X, they will incorrectly find the X11
dnl OpenGL libraries which we do not want.
dnl TODO: Eventually add a test for OS X for OpenGL
GL_CFLAGS=""
GL_LIBS="-framework OpenGL"
;;
*)
AX_CHECK_GL
if test -n "$no_gl"; then
AC_MSG_ERROR([OpenGL is required and could not be found!])
fi
;;
esac;
dnl OpenAL
case "$target" in
*darwin*)
dnl TODO: Eventually add a test for OS X for OpenAL
AL_CFLAGS="-I/System/Library/Frameworks/OpenAL.framework/Headers"
AL_LIBS="-framework OpenAL"
;;
*)
AC_CHECK_HEADER("AL/al.h", , no_al=1)
AC_CHECK_HEADER("AL/alc.h", , no_al=1)
if test -n "$no_al"; then
AC_MSG_ERROR([OpenAL is required and could not be found!])
fi
AL_CFLAGS=""
AL_LIBS="-lopenal"
;;
esac;
dnl Extra flags
case "$target" in
*darwin*)
EOS_CFLAGS="-DUNIX -DMACOSX"
EOS_LIBS=""
;;
*)
EOS_CFLAGS="-DUNIX"
EOS_LIBS=""
;;
esac;
AC_SUBST(SDL_LIBS)
AC_SUBST(SDL_CFLAGS)
AC_SUBST(FT2_CFLAGS)
AC_SUBST(FT2_LIBS)
AC_SUBST(GL_CFLAGS)
AC_SUBST(GL_LIBS)
AC_SUBST(AL_CFLAGS)
AC_SUBST(AL_LIBS)
AC_SUBST(FAAD_CFLAGS)
AC_SUBST(FAAD_LIBS)
AC_SUBST(MAD_CFLAGS)
AC_SUBST(MAD_LIBS)
AC_SUBST(OGG_CFLAGS)
AC_SUBST(OGG_LIBS)
AC_SUBST(VORBIS_CFLAGS)
AC_SUBST(VORBIS_LIBS)
AC_SUBST(XVID_CFLAGS)
AC_SUBST(XVID_LIBS)
AC_SUBST(Z_CFLAGS)
AC_SUBST(Z_LIBS)
AC_SUBST(EOS_CFLAGS)
AC_SUBST(EOS_LIBS)
AC_SUBST(WERROR)
AC_CONFIG_FILES([
utf8cpp/Makefile \
glew/Makefile \
lua/Makefile \
src/common/Makefile \
src/graphics/Makefile \
src/graphics/images/Makefile \
src/graphics/aurora/Makefile \
src/sound/Makefile \
src/sound/decoders/Makefile \
src/video/Makefile \
src/video/codecs/Makefile \
src/video/aurora/Makefile \
src/events/Makefile \
src/aurora/Makefile \
src/aurora/nwscript/Makefile \
src/engines/Makefile \
src/engines/nwn/Makefile \
src/engines/nwn2/Makefile \
src/engines/kotor/Makefile \
src/engines/kotor2/Makefile \
src/engines/thewitcher/Makefile \
src/engines/sonic/Makefile \
src/engines/dragonage/Makefile \
src/engines/jade/Makefile \
src/Makefile \
Makefile])
AC_OUTPUT