-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathconfigure.ac
368 lines (304 loc) · 8.18 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
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
AC_PREREQ(2.52)
AC_INIT
AC_CONFIG_SRCDIR([acinclude.m4])
AC_CANONICAL_TARGET([])
AM_CONFIG_HEADER(config.h)
AM_INIT_AUTOMAKE(freesci, 0.6.5-devel)
AC_PROG_CC
#AC_LIBTOOL_DLOPEN
AC_PROG_RANLIB
#AM_PROG_LIBTOOL
#AC_PROG_LIBTOOL
AC_CHECK_HEADERS(limits.h)
AC_CHECK_HEADERS(fcntl.h)
AC_CHECK_HEADERS(sys/uio.h)
AC_CHECK_HEADERS(sys/soundcard.h)
AC_CHECK_HEADERS(sys/time.h)
AC_CHECK_HEADERS(obstack.h)
AC_CHECK_HEADERS(dirent.h)
AC_CHECK_HEADERS(unistd.h)
AC_CHECK_HEADERS(fnmatch.h)
AC_CHECK_HEADERS(getopt.h setjmp.h)
AC_CHECK_HEADERS(proto/camd.h)
AC_C_INLINE
if test "$cross_compiling" != "yes"; then
AC_CHECK_SIZEOF(short)
AC_CHECK_SIZEOF(int)
AC_CHECK_SIZEOF(long)
else
case "$host_cpu" in
alpha*)
AC_DEFINE(SIZEOF_SHORT, 2)
AC_DEFINE(SIZEOF_INT, 4)
AC_DEFINE(SIZEOF_LONG, 8)
;;
i*86*|powerpc|arm)
AC_DEFINE(SIZEOF_SHORT, 2)
AC_DEFINE(SIZEOF_INT, 4)
AC_DEFINE(SIZEOF_LONG, 4)
;;
m68k*)
AC_DEFINE(SIZEOF_SHORT, 2)
AC_DEFINE(SIZEOF_LONG, 4)
;;
*)
echo "Your CPU type is $host_cpu."
AC_MSG_ERROR([
" There are no reliable default sizes for short,"
" int and long on your host processor known to us,"
" so we we cannot support cross-compiling for it."
" Please contact the FreeSCI development mailing list,"
" so that we can work this out..."])
;;
esac
fi
EXTRA_INCLUDES=""
case "${host_os}" in
cygwin*)
AC_CHECK_LIB(cygwin, usleep)
LIBS="-lwinmm $LIBS"
;;
mingw*)
EXTRA_INCLUDES='-I$(top_srcdir)/src/include/win32'
LIBS="-lwinmm $LIBS"
;;
darwin*)
AC_DEFINE([MACOSX], [1], [Define to 1 if you use Mac OS X.])
CFLAGS="-no-cpp-precomp $CFLAGS"
# Disable Apple's broken preprocessor
;;
esac
AC_CHECK_FUNCS(memchr fnmatch pipe socketpair fork sched_yield memfrob ffs getopt_long isblank usleep setitimer unlink rmdir gettimeofday)
AC_CHECK_LIB(winmm, timeBeginPeriod)
AC_CHECK_LIB([pthread], pthread_create,
[AC_CHECK_HEADER(pthread.h,
AC_DEFINE([HAVE_PTHREAD], [1], [Define to 1 if you have the `pthread' library (-lpthread).])
LIBS="$LIBS -lpthread")
]
)
AM_PATH_ALSA(0.5.0, [AC_DEFINE([HAVE_ALSA], [1], [Define to 1 if you have ALSA.])], [echo >/dev/null])
AM_WITHOUT_SOUND
AC_PATH_GGI
AC_PATH_DIRECTFB
#AC_CHECK_FSCI_DLOPEN
SCIV_LDFLAGS=""
AC_SUBST(SCIV_LDFLAGS)
AC_SUBST(EXTRA_INCLUDES)
AC_CHECK_HEADERS(dmedia/midi.h)
if test "${ac_cv_header_dmedia_midi_h}" = "yes"; then
case ${host_os} in
irix*)
found_sound=yes
LIBS="-lmd $LIBS"
esac
fi
AC_CHECK_HEADERS(dmedia/audio.h)
if test "${ac_cv_header_dmedia_audio_h}" = "yes"; then
case ${host_os} in
irix*)
found_sound=yes
LIBS="-laudio -lpthread $LIBS"
esac
fi
AC_CHECK_HEADERS(fluidsynth.h)
if test "${ac_cv_header_fluidsynth_h}" = "yes"; then
LIBS="-lfluidsynth $LIBS"
fi
AC_ARG_WITH(sdl, [ --without-sdl Do not build the SDL driver])
if test x"$with_sdl" != xno; then
AM_PATH_SDL(1.1.8, [
AC_DEFINE([HAVE_SDL], [1], [Define to 1 if you have the `SDL' library (-lSDL).])
fsci_sdl_driver="yes"
AC_TRY_COMPILE([
#include <SDL.h>
], [], AC_DEFINE([SDL_HEADER_IMMEDIATE], [1], [Define to 1 if `#include <SDL.h>' works.]));
],
[
fsci_sdl_driver=""
])
else
AC_MSG_CHECKING([for SDL])
AC_MSG_RESULT([disabled]) # Well, we should give some kind of feedback...
fsci_sdl_driver=""
fi
AC_PATH_CURSES
if test x"$ac_curses_libraries" != x; then
AC_CHECK_HEADERS(readline/readline.h, [ ac_readline="-lreadline" ], [ ac_readline="" ])
AC_SUBST(ac_readline)
AC_CHECK_HEADERS(readline/history.h)
fi
#--- beginning
AC_PATH_XTRA
if test x"$have_x" = xyes; then
# in Debian, the freetype headers are in a strange place
if test -d "/usr/include/freetype2"; then
CPPFLAGS="$CPPFLAGS -I/usr/include/freetype2"
CPFLAGS="$CPFLAGS -I/usr/include/freetype2"
fi
AC_CHECK_HEADERS([X11/Xft/Xft.h])
AC_CHECK_LIB(Xft, XftDisplayInfoGet, [X_LIBS="$XLIBS -lXft"])
AC_CHECK_HEADERS(X11/extensions/Xrender.h, [X_LIBS="$XLIBS -lXrender"])
AC_CHECK_LIB(fontconfig, FcInit, [X_LIBS="$X_LIBS -lfontconfig"])
AC_CHECK_HEADERS(X11/extensions/Xinerama.h, [X_LIBS="$X_LIBS -lXinerama"], [], [#include <X11/Xlib.h>])
AC_CHECK_XSHM
fi
AC_MSG_CHECKING(for Alpha hardware and gcc or ccc style __asm__)
AC_TRY_COMPILE([], [
#ifdef __DECC
# define my_asm(x) asm (x)
#else
# define my_asm(x) __asm__ (x)
#endif
#ifndef __alpha__
#error "Not on Alpha"
#endif
my_asm("zapnot \$31, \$31, \$31");
return 0;
], [
AC_MSG_RESULT(found.)
ev6_cpu="-mcpu=ev6"
AC_DEFINE([HAVE_ALPHA_EV6_SUPPORT], [1], [Define to 1 if you have Alpha EV6 or PCA56 hardware.])
],
[
AC_MSG_RESULT(not present.);
ev6_cpu=""
])
#--- end
AC_SUBST(ev6_cpu)
fsci_xlib_driver=""
if test x"$have_x" = xyes; then
if test x"$x_libraries" != xNONE; then
if test x"$x_libraries" != x; then
LIBS="-L$x_libraries $LIBS"
fi
AC_CHECK_LIB(Xi, XGrabDevice, [X_LIBS="$X_LIBS -lXi"])
AC_CHECK_LIB(X11, XOpenDisplay, [X_LIBS="$X_LIBS -lX11"])
AC_CHECK_LIB(Xext, XShmAttach, [X_LIBS="$X_LIBS -lXext"])
fsci_xlib_driver="yes"
fi
fi
dnl if test "no_x" != yes; then
dnl AC_PATH_GLX
dnl fi
AC_SUBST(ac_glx_libraries)
fsci_xlib_dl=""
fsci_sdl_dl=""
fsci_ggi_dl=""
fsci_xlib_st=""
fsci_sdl_st=""
fsci_ggi_st=""
if test x"$dlopen" = xyes; then
if test x"$fsci_ggi_driver" = xyes; then
fsci_ggi_dl="ggi_driver.la"
fi
if test x"$fsci_sdl_driver" = xyes; then
fsci_sdl_dl="sdl_driver.la"
fi
if test x"$fsci_xlib_driver" = xyes; then
fsci_xlib_dl="xlib_driver.la"
fi
else
if test x"$fsci_ggi_driver" = xyes; then
fsci_ggi_st="ggi_driver.o"
LIBS="$LIBS $ac_ggi_libraries"
fi
if test x"$fsci_directfb_driver" = xyes; then
fsci_dfb_st="directfb_driver.o"
LIBS="$LIBS $ac_directfb_libraries"
fi
if test x"$fsci_sdl_driver" = xyes; then
fsci_sdl_st="sdl_driver.o"
LIBS="$LIBS $SDL_LIBS"
fi
if test x"$fsci_xlib_driver" = xyes; then
fsci_xlib_st="xlib_driver.o"
LIBS="$LIBS $X_LIBS"
fi
fi
AC_SUBST(fsci_xlib_dl)
AC_SUBST(fsci_sdl_dl)
AC_SUBST(fsci_ggi_dl)
AC_SUBST(fsci_dfb_dl)
AC_SUBST(fsci_xlib_st)
AC_SUBST(fsci_sdl_st)
AC_SUBST(fsci_ggi_st)
AC_SUBST(fsci_dfb_st)
dnl AC_SUBST(ac_xlib_o)
dnl AC_SUBST(ac_sdl_o)
dnl AC_SUBST(ac_ggi_o)
AC_CHECK_LIB(m, cos, [LIB_M="-lm"], [LIB_M=""])
dnl AC_CHECK_LIB(c, sprintf, [LIB_C="-lc"], [LIB_C=""])
AC_SUBST(LIB_M)
AC_CHECK_HEADERS(Xm/MwmUtil.h)
AC_PATH_PNG
AC_SUBST(ac_png_includes)
AC_SUBST(ac_png_libraries)
AM_PROG_LEX
AC_PROG_YACC
AC_C_PARAMETRIZED_BIGENDIAN
AC_ARG_WITH(efence,
[ --with-efence link against libefence (for debugging)],
[LIBS="$LIBS -lefence"],
[LIBS="$LIBS $LIB_C"])
AC_ARG_WITH(Wall,
[ --with-Wall compile using -Wall],
[CFLAGS="-Wall $CFLAGS"],
[])
AC_ARG_WITH(E,
[ --with-E compile using -E (output from pre-processor only)],
[CFLAGS="-E $CFLAGS"],
[])
AC_ARG_WITH(console,
[ --with-console Build with on-screen console support],
[WANT_CONSOLE=64
AC_DEFINE(WANT_CONSOLE)],
[])
AC_ARG_WITH(forced-console,
[ --with-forced-console Enforce usage of on-screen console on all gfx drivers],
[
AC_DEFINE([WANT_CONSOLE], [1], [Define to 1 if you want to build with on-screen console support.])
AC_DEFINE([FORCE_CONSOLE], [1], [Define to 1 if you want to enforce usage of on-screen console on all gfx drivers.])],
[])
AC_ARG_WITH(pic-scaling,
[ --without-pic-scaling Disable support for scaled images])
if test x"$with_pic_scaling" != xno; then
AC_DEFINE([WITH_PIC_SCALING], [1], [Define to 1 if you want SCI0 pic resource scaling support.])
fi
CFSML_FLAGS=""
AM_WITH_DMALLOC
AM_WITH_MALLOC_DEBUG
AM_WITHOUT_MALLOC_CHECKS
AC_SUBST(CFSML_FLAGS)
RPM_VERSION=`echo $VERSION | sed 's/\-/_/'`
AC_SUBST(RPM_VERSION)
SDL_CFLAGS="$CFLAGS $SDL_CFLAGS"
AC_CONFIG_FILES([Makefile \
debian/Makefile \
desktop/Makefile \
doc/Makefile \
doc/misc/Makefile \
doc/man/Makefile \
conf/Makefile \
custom/Makefile \
src/Makefile \
src/scicore/Makefile \
src/engine/Makefile \
src/gfx/Makefile \
src/gfx/drivers/Makefile \
src/gfx/resource/Makefile \
src/include/Makefile \
src/include/win32/Makefile \
src/include/beos/Makefile \
src/tools/Makefile \
src/win32/Makefile \
src/sfx/Makefile \
src/sfx/timer/Makefile \
src/sfx/seq/Makefile \
src/sfx/player/Makefile \
src/sfx/device/Makefile \
src/sfx/mixer/Makefile \
src/sfx/pcm_device/Makefile \
src/sfx/softseq/Makefile \
src/menu/Makefile \
freesci.spec])
AC_OUTPUT