Debian Codegraph @

configure.ac

raw ◀ ▶
Source reconstructed at patch state 1 of 2 — not the installed (fully patched) source.
2 Debian patches touch this file
1 dnl $Id: configure.ac,v 1.40 2004/04/04 16:40:22 grumbel Exp $
2 dnl
3 dnl Process this file with autoconf to produce a configure script.
4 dnl
5
6 AC_PREREQ(2.50)
7 AC_INIT(ClanLib, 1.0.0)
8 AC_CONFIG_SRCDIR(Sources/API/core.h)
9 AC_CANONICAL_TARGET
10 AM_INIT_AUTOMAKE( foreign dist-bzip2 dist-zip 1.5b subdir-objects )
11 AM_MAINTAINER_MODE
12
13 CLANLIB_MAJOR_VERSION=1
14 CLANLIB_MINOR_VERSION=0
15 CLANLIB_MICRO_VERSION=0
16
17 CLANLIB_VERSION=$CLANLIB_MAJOR_VERSION.$CLANLIB_MINOR_VERSION.$CLANLIB_MICRO_VERSION
18
19 AC_SUBST(CLANLIB_MAJOR_VERSION)
20 AC_SUBST(CLANLIB_MINOR_VERSION)
21 AC_SUBST(CLANLIB_MICRO_VERSION)
22 AC_SUBST(CLANLIB_VERSION)
23
24 # Set this to: MAJOR.MINOR, ie 0.7, 0.8, 0.9 it gets append as:
25 # libclanDisplay-$LT_RELEASE
26 LT_RELEASE=$CLANLIB_MAJOR_VERSION.$CLANLIB_MINOR_VERSION
27 if test -z "$LDFLAGS_LT_RELEASE"; then
28 LDFLAGS_LT_RELEASE=-release $LT_RELEASE
29 fi
30
31 # If any features got added to the API since last release incremeant
32 # this by 1 (ie increment this for each develpment release, and only
33 # if features have been added to a stable release)
34 LT_CURRENT=1
35
36 # If any interfaces have been added since the last public release,
37 # then increment AGE. If any interfaces have been removed since the
38 # last public release, then set AGE to 0. So when backward compability
39 # is broken, set this to 0, else stay in sinc with LT_CURRENT
40 # (development releases should stay 0, stable be in sync with
41 # LT_CURRENT)
42 LT_AGE=0
43
44 # If LT_CURRENT has changed, set this to 0, if LT_CURRENT stayed the
45 # same increment by 1 (so stable releases should increment, while
46 # development releases stay at 0)
47 LT_REVISION=0
48
49 # libclanFoobar-$LT_RELEASE.so.[$LT_CURRENT-$LT_AGE].$LT_AGE.$LT_REVISION
50
51 AC_SUBST(LDFLAGS_LT_RELEASE)
52 AC_SUBST(LT_RELEASE)
53 AC_SUBST(LT_CURRENT)
54 AC_SUBST(LT_REVISION)
55 AC_SUBST(LT_AGE)
56
57 AC_PROG_CXX
58 AC_PROG_CC
59 AM_PROG_AS
60 AC_PROG_CPP
61 AC_PROG_INSTALL
62 AC_PROG_LIBTOOL
63
64 AC_LANG(C++)
65
66 AC_PATH_PROG(PKG_CONFIG, pkg-config, no)
67
68 case $target in
69 *cygwin* )
70 X11="no"
71 WIN32="yes"
72 CXXFLAGS="$CXXFLAGS -mno-cygwin -DWIN32"
73 ;;
74 *mingw*)
75 X11="no"
76 WIN32="yes"
77 ;;
78 *)
79 X11="yes"
80 WIN32="no"
81 dnl We set CC and AS here to make libtool happy
82 dnl FIXME: Why exactly do we do this?!
83 ;;
84 esac
85
86 # Extra flags that are needed to compile
87 if test "$WIN32" = "yes"; then
88 extra_CFLAGS_clanApp="-mwindows"
89 extra_LIBS_clanCore="-lz"
90 extra_LIBS_clanDisplay="-lwinmm -lddraw -ldinput8 -ldxguid -lgdi32 -lole32 -ljpeg -lpng"
91 extra_LIBS_clanGL="-lopengl32 -lglu32"
92 extra_LIBS_clanSound="-ldsound -ldxguid -lwinmm"
93 extra_LIBS_clanMikMod="-lmikmod"
94 extra_LIBS_clanVorbis="-lvorbis -logg"
95 extra_LIBS_clanSDL="-lSDL"
96 extra_LIBS_clanNetwork="-lws2_32"
97 fi
98
99 AC_SUBST(extra_CFLAGS_clanApp)
100 AC_SUBST(extra_CFLAGS_clanCore)
101 AC_SUBST(extra_CFLAGS_clanDisplay)
102 AC_SUBST(extra_CFLAGS_clanGL)
103 AC_SUBST(extra_CFLAGS_clanSDL)
104 AC_SUBST(extra_CFLAGS_clanGUI)
105 AC_SUBST(extra_CFLAGS_clanSignals)
106 AC_SUBST(extra_CFLAGS_clanSound)
107 AC_SUBST(extra_CFLAGS_clanNetwork)
108 AC_SUBST(extra_CFLAGS_clanVorbis)
109 AC_SUBST(extra_CFLAGS_clanMikMod)
110
111 AC_SUBST(extra_LIBS_clanApp)
112 AC_SUBST(extra_LIBS_clanCore)
113 AC_SUBST(extra_LIBS_clanDisplay)
114 AC_SUBST(extra_LIBS_clanGL)
115 AC_SUBST(extra_LIBS_clanSDL)
116 AC_SUBST(extra_LIBS_clanGUI)
117 AC_SUBST(extra_LIBS_clanSignals)
118 AC_SUBST(extra_LIBS_clanSound)
119 AC_SUBST(extra_LIBS_clanNetwork)
120 AC_SUBST(extra_LIBS_clanVorbis)
121 AC_SUBST(extra_LIBS_clanMikMod)
122
123 AM_CONDITIONAL([WIN32], [test $WIN32 = "yes"])
124 AM_CONDITIONAL(LINUX, [test -n "`echo ${target} | grep linux`"])
125
126 dnl ----------------------------------------
127 dnl Additional include and library paths:
128 dnl ----------------------------------------
129
130 AC_ARG_WITH([extra-includes], AS_HELP_STRING([--with-extra-includes=DIR],[Add extra include paths]),
131 use_extra_includes="$withval",
132 use_extra_includes=NO
133 )
134 if test -n "$use_extra_includes" && test "$use_extra_includes" != "NO"; then
135 ac_save_ifs=$IFS
136 IFS=':'
137 for dir in $use_extra_includes; do
138 extra_includes="$extra_includes -I$dir"
139 done
140 IFS=$ac_save_ifs
141 fi
142
143 CXXFLAGS="$CXXFLAGS $extra_includes"
144
145 AC_ARG_WITH(extra-libs, AS_HELP_STRING([--with-extra-libs=DIR],[Add extra library paths]),
146 use_extra_libs=$withval,
147 use_extra_libs=NO
148 )
149 if test -n "$use_extra_libs" && test "$use_extra_libs" != "NO"; then
150 ac_save_ifs=$IFS
151 IFS=':'
152 for dir in $use_extra_libs; do
153 extra_libraries="$extra_libraries -L$dir"
154 done
155 IFS=$ac_save_ifs
156 fi
157
158 AC_ARG_WITH(sdl-gfx, AS_HELP_STRING([--with-sdl-gfx],[use sdl-gfx library for scaling and rotation (automatic)]),
159 use_sdl_gfx="$withval", use_sdl_gfx=auto)
160
161 AC_CHECK_HEADERS(unistd.h fcntl.h sys/kd.h sys/vt.h sys/sysctl.h)
162 AC_EGREP_HEADER(fcvt, stdlib.h,,AC_DEFINE(NEED_FCVT))
163
164 dnl Checks the system type
165 AC_MSG_CHECKING(for i386)
166 case $target_cpu in
167 i?86) i386=enabled;;
168 *) i386=disabled;;
169 esac
170
171 if test x$i386 = "xenabled"; then
172 AC_MSG_RESULT(yes)
173 else
174 AC_MSG_RESULT(no)
175 fi
176
177 dnl -----------------------------------------------------
178 dnl Check commandline parameters to the configure script:
179 dnl -----------------------------------------------------
180
181 AC_MSG_CHECKING(for i386 assembly support)
182 CHECK_ENABLED(asm386,
183 AC_HELP_STRING([--enable-asm386], [Enable i386 assembly support]),
184 USE_I386_ASSEMBLER, $i386)
185
186 AC_MSG_CHECKING(for dynamic loading support)
187 CHECK_ENABLED(dyn,
188 AC_HELP_STRING([--enable-dyn], [Enable dynamic loading]),
189 USE_DYN, disabled)
190
191 AC_CHECK_HEADER(libgen.h)
192 AC_CHECK_HEADER(sys/types.h)
193 AC_CHECK_HEADER(sys/ipc.h)
194 AC_CHECK_HEADER(sys/shm.h)
195 AC_CHECK_HEADER(fstab.h, AC_DEFINE([HAVE_FSTAB_H]))
196
197 AC_MSG_CHECKING([for extern *__progname])
198 AC_TRY_COMPILE([],
199 [extern const char *__progname;],
200 AC_MSG_RESULT(yes);AC_DEFINE(EXTERN___PROGNAME),
201 AC_MSG_RESULT(no))
202
203 dnl -----------------------------------------------------------------------
204 dnl Check system endianess: (note: ClanLib is _not_ endian clean right now)
205 dnl -----------------------------------------------------------------------
206
207 dnl AC_C_BIGENDIAN
208 dnl AC_CHECK_SIZEOF(int, 4)
209
210 if test "$ac_cv_sizeof_int" = "8"; then
211 AC_DEFINE(USE_64BIT)
212 fi
213
214 if test "$ac_cv_c_bigendian" = "yes"; then
215 AC_DEFINE(USE_BIG_ENDIAN)
216 fi
217
218 dnl ----------------------------------------
219 dnl Search for libraries useful for ClanLib:
220 dnl ----------------------------------------
221 if test "$WIN32" = "no"; then
222 AC_CHECK_LIB(pthread,pthread_create,AC_SUBST(LIBPTHREAD,"-lpthread"), AC_MSG_ERROR([" *** ClanLib requires pthread to run."]))
223 fi
224 AC_CHECK_LIB(z, main, , AC_MSG_ERROR([" *** ClanLib requires zlib."]))
225
226 dnl ----------------------------------------------------------
227 dnl Check for ClanLib modules that should be enabled/disabled
228 dnl ----------------------------------------------------------
229 echo ""
230 echo "Checking for ClanLib Modules to build..."
231 echo "========================================"
232
233 CLANLIB_ARG_ENABLE(docs, auto, [Build Clanlib documentation], [whether we should try to build documentation])
234
235 CLANLIB_ARG_ENABLE(clanDisplay, auto, [Build clanDisplay module], [whether we should try to build clanDisplay])
236
237 CLANLIB_ARG_ENABLE(clanSDL, auto, [Build clanSDL module], [whether we should try to build clanSDL])
238
239 CLANLIB_ARG_ENABLE(clanGL, auto, [Build clanGL module], [whether we should try to build clanGL])
240
241 CLANLIB_ARG_ENABLE(clanSound, auto, [Build clanSound module], [whether we should try to build clanSound])
242
243 CLANLIB_ARG_ENABLE(clanNetwork, auto, [Build clanNetwork module], [whether we should try to build clanNetwork])
244
245 CLANLIB_ARG_ENABLE(clanGUI, auto, [Build clanGUI module], [whether we should try to build clanGUI])
246
247 CLANLIB_ARG_ENABLE(clanMikMod, auto, [Build clanMikMod module], [whether we should try to build clanMikMod])
248
249 CLANLIB_ARG_ENABLE(clanVorbis, auto, [Build clanVorbis module], [whether we should try to build clanVorbis])
250
251 echo ""
252 if test "$enable_clanDisplay" != "no"; then
253 echo "Checking for clanDisplay stuff"
254 echo "=============================="
255 CLANLIB_CHECK_LIB(png, [`cat $srcdir/Setup/Tests/png.cpp`], clanDisplay, [ *** Cannot find png], [-lz])
256 CLANLIB_CHECK_LIB(jpeg, [`cat $srcdir/Setup/Tests/jpeg.cpp`], clanDisplay, [ *** Cannot find jpeg])
257 if test "$WIN32" = "yes" && test "$enable_clanDisplay" != "no"; then
258 CLANLIB_CHECK_LIB(gdi32,[#include <windows.h>
259 int main(){} void used_stuff(){ CreateCompatibleDC(NULL); }],
260 clanDisplay, [ *** Cannot find gdi32])
261 CLANLIB_CHECK_LIB(dinput8,[#include <dinput.h>
262 #if DIRECTINPUT_HEADER_VERSION < 0x0800
263 #error Need newer DirectInput header! (version 8)
264 #endif
265 int main(){}void used_stuff(){ DirectInput8Create(NULL, 0, IID_IDirectInput8, NULL, 0); } ],
266 clanDisplay, [ *** Cannot find version 8 of DirectInput], [-ldxguid -lole32])
267 fi
268 fi
269
270 if test "$enable_clanDisplay" != "no"; then
271 enable_clanDisplay=yes
272 if test "$X11" = "yes"; then
273 AC_PATH_X
274 AC_PATH_XTRA
275
276 if false; then
277 echo "---------------------------"
278 echo "LIBS: $LIBS"
279 echo "LDFLAGS: $LDFLAGS"
280 echo "CXXFLAGS: $CXXFLAGS"
281 echo "CFLAGS: $CFLAGS"
282 echo "X_CFLAGS: $X_CFLAGS"
283 echo "X_LIBS: $X_LIBS"
284 echo "X_EXTRA_LIBS: $X_EXTRA_LIBS"
285 echo "X_PRE_LIBS: $X_PRE_LIBS"
286 echo "x_includes: $x_includes"
287 echo "x_libraries: $x_libraries"
288 echo "---------------------------"
289 fi
290
291 dnl Add the flags we found to the default ones
292 dnl CLAGS="$CFLAGS $X_CFLAGS"
293 dnl CXXFLAGS="$CXXFLAGS $X_CFLAGS"
294 CPPFLAGS="$CPPFLAGS $X_CFLAGS"
295 LDFLAGS="$LDFLAGS $X_LIBS"
296
297
298 OLDLIBS="$LIBS"
299 LIBS=""
300 AC_SEARCH_LIBS(XF86VidModeQueryExtension, [ Xxf86vm_pic Xxf86vm ],
301 [ VIDMODE=enabled; X_LIBS="$X_LIBS $LIBS" ], [ VIDMODE=disabled ], [ $X_LIBS ])
302 LIBS="$OLDLIBS"
303 clanDisplay_CFLAGS="$clanDisplay_CFLAGS $X_CFLAGS"
304 clanDisplay_LIBS="$clanDisplay_LIBS $X_LIBS -lX11 $X_EXTRA_LIBS"
305 fi
306
307 if test "$enable_clanSDL" != "no"; then
308 AC_LANG(C)
309 echo "Checking for clanSDL stuff"
310 echo "=============================="
311 AM_PATH_SDL([1.2.0],
312 [AC_SUBST(SDL_CFLAGS)
313 AC_SUBST(SDL_LIBS)],
314 CLANLIB_DISABLE_MODULE(clanSDL, [ *** Could not find SDL]))
315 if test "$enable_clanSDL" != "no"; then
316 enable_clanSDL=yes
317 dnl testing for SDL_gfx
318 if test "$use_sdl_gfx" != "no"; then
319 OLDLIBS="$LIBS"
320 LIBS="$SDL_LIBS $LIBS"
321 AC_CHECK_LIB(SDL_gfx, zoomSurface,
322 [SDL_LIBS="$SDL_LIBS -lSDL_gfx"
323 AC_DEFINE(HAVE_LIBSDL_GFX)],
324 [if test "$use_sdl_gfx" = "auto"; then
325 AC_MSG_WARN([SDL_gfx not found, clanSDL will not be able to use scaling and rotation!])
326 else
327 AC_MSG_ERROR([SDL_gfx not found!])
328 fi])
329 LIBS="$OLDLIBS"
330 fi
331 clanSDL_LIBS="$clanSDL_LIBS $SDL_LIBS"
332 clanSDL_CFLAGS="$clanSDL_CFLAGS $SDL_CFLAGS"
333 fi
334 AC_LANG(C++)
335 fi
336
337 if test "$enable_clanGL" != "no"; then
338 echo "Checking for clanGL stuff"
339 echo "=============================="
340 if test "$WIN32" = "yes"; then
341 CLANLIB_CHECK_LIB(opengl32, [`cat $srcdir/Setup/Tests/opengl.cpp`], clanGL, [ *** Cannot find opengl32/glu32], [-lglu32])
342 else # test "$WIN32" = "yes"
343 CLANLIB_CHECK_LIB(GL, [`cat $srcdir/Setup/Tests/opengl.cpp`], clanGL, [ *** Cannot find GL/GLU], [-lGLU -lpthread])
344 if test "$enable_clanGL" != "no" && test "$X11" = "yes"; then
345 AC_CHECK_LIB(Xi,XListInputDevices, [clanGL_LIBS="$clanGL_LIBS $X_LIBS -lX11 $X_EXTRA_LIBS -lXi"],
346 CLANLIB_DISABLE_MODULE(clanGL, [ *** Cannot find libXi (xinput)]))
347 if test "$enable_clanGL" != "no"; then
348
349 dnl Check that glXGetProcAddressARB is defined in glx.h
350 AC_MSG_CHECKING([whether glx.h defines glXGetProcAddressARB]);
351 AC_TRY_COMPILE([#define GLX_GLXEXT_PROTOTYPES
352 #include <GL/glx.h>], [ char *foo = (char*) glXGetProcAddressARB; ],
353 glx_has_getprocaddressarb="yes", glx_has_getprocaddressarb="no")
354 AC_MSG_RESULT([$glx_has_getprocaddressarb])
355
356 if test "x$glx_has_getprocaddressarb" = "xyes"; then
357 AC_DEFINE(HAVE_GLX_GETPROCADDRESSARB, 1,
358 [Define if the OpenGL library supports the glXGetProcAddressARB call])
359 fi
360
361 dnl Check for linux/joystick.h
362 linux_joystick=no
363 AC_CHECK_HEADERS(linux/joystick.h, linux_joystick=yes)
364 AM_CONDITIONAL(LINUX_JOYSTICK, test x$linux_joystick = xyes)
365
366 dnl Check for linux/input.h
367 linux_input=no
368 AC_CHECK_HEADERS(linux/input.h, linux_input=yes)
369 AM_CONDITIONAL(LINUX_INPUT, test x$linux_input = xyes)
370 fi
371 fi
372 fi
373 test "$enable_clanGL" = "auto" && enable_clanGL=yes
374 fi
375 test "$enable_clanGUI" = "auto" && enable_clanGUI=yes
376 echo ""
377 else
378 CLANLIB_DISABLE_MODULE(clanSDL, [ *** clanSDL depends on clanDisplay])
379 CLANLIB_DISABLE_MODULE(clanGUI, [ *** clanGUI depends on clanDisplay])
380 CLANLIB_DISABLE_MODULE(clanGL, [ *** clanGL depends on clanDisplay])
381 fi
382
383 if test "$enable_clanSound" != "no"; then
384 echo "Checking for clanSound stuff"
385 echo "============================"
386 if test "$WIN32" = "yes"; then
387 CLANLIB_CHECK_LIB(dsound,[#include <dsound.h>
388 int main() { return 0; } void used_stuff() {DirectSoundCreate(NULL, NULL, NULL);}],
389 clanSound, [ *** Cannot find directsound libs],[-ldxguid -lwinmm])
390 else
391 dnl OSS header check
392 soundcard_h=no
393 AC_CHECK_HEADERS(machine/soundcard.h sys/soundcard.h soundcard.h, [soundcard_h=yes && break])
394 if test "$soundcard_h" == "no"; then
395 CLANLIB_DISABLE_MODULE(clanSound,[ *** Cannot find soundcard.h])
396 fi
397 sound_libs=""
398 have_alsa=no
399 AC_CHECK_LIB(ossaudio, _oss_ioctl, sound_libs=-lossaudio)
400 AC_CHECK_HEADERS(asoundlib.h alsa/asoundlib.h, [have_alsa=yes && break])
401 if test "$have_alsa" != "no"; then
402 sound_libs="$sound_libs -lasound"
403 fi
404 SOUND_LDFLAGS="$sound_libs"
405 AM_CONDITIONAL(ALSA, test x$have_alsa = xyes)
406 AC_SUBST(SOUND_LDFLAGS)
407 fi
408 fi
409
410 if test "$enable_clanSound" != "no"; then
411 enable_clanSound=yes
412 echo ""
413 CLANLIB_CHECK_LIB(mikmod, [`cat $srcdir/Setup/Tests/mikmod.cpp`], clanMikMod, [ *** Cannot find mikmod])
414 test "$enable_clanMikMod" = "auto" && enable_clanMikMod=yes
415
416 PKG_CHECK_MODULES(clanVorbis, vorbis >= 1.0,,[AC_MSG_CHECKING([for libvorbis directly])
417 CLANLIB_CHECK_LIB(vorbis, [`cat $srcdir/Setup/Tests/vorbis.cpp`], clanVorbis, [ *** Cannot find vorbis],[-logg])])
418 test "$enable_clanVorbis" = "auto" && enable_clanVorbis=yes
419 echo ""
420 else
421 CLANLIB_DISABLE_MODULE(clanMikMod, [ *** clanMikMod depends on clanSound])
422 CLANLIB_DISABLE_MODULE(clanVorbis, [ *** clanVorbis depends on clanSound])
423 fi
424
425 if test "$enable_clanNetwork" != "no"; then
426 echo "Checking for clanNetwork stuff"
427 echo "=============================="
428 if test "$WIN32" = "yes"; then
429 dnl make sure we have winsock2
430 CLANLIB_CHECK_LIB(ws2_32,[
431 #include <winsock2.h>
432 int main(){ return 0;}
433 void used_stuff() {WSAStartup(0, NULL);}
434 ], clanNetwork, [ *** Could not find ws2_32 (winsock2)])
435 fi
436 fi
437
438 if test "$enable_clanNetwork" != "no"; then
439 enable_clanNetwork=yes
440 dnl Disabled IPV6 thing because on all the linuxes I have tried it on, it just doesnt work.
441 dnl (the getaddr functions are there, but using it just causes it to fail) -- mbn 27 marts 2003
442 dnl Works fine on my system. You gotta have the ipv6 module loaded thought. --Mark April 13, 2003
443 AC_CHECK_FUNC(getaddrinfo,getaddr=enabled,)
444
445 AC_MSG_CHECKING(for GetAddr (ipv6) support)
446 CHECK_ENABLED(getaddr,
447 AC_HELP_STRING([--enable-getaddr], [Enable getaddr(ipv6) functions in Network]),
448 USE_GETADDR, $getaddr)
449
450 echo ""
451 fi
452
453 dnl ----------------------------------------------------
454 dnl Which clan subprojects & examples should be compiled?
455 dnl ----------------------------------------------------
456
457 # Set the include path
458 CXXFLAGS="$CXXFLAGS -I\$(top_srcdir)/Sources"
459
460 # Modules which will be build
461 ClanLib_Modules="Application"
462 ClanLib_pkgconfig="clanApp.pc"
463
464 # API header files for the Modules which will be installed
465 ClanLib_API_Modules="$ClanLib_API_Modules \$(clanApp_includes)"
466
467 # Default examples which will be build
468 ClanLib_Examples="Directory Minimum Resources ResourcesCustom Signals ThreadSync XML Zip"
469
470 CLANLIB_ENABLE_MODULES([Core Signals])
471
472 if test "$enable_clanDisplay" = "yes"; then
473 CLANLIB_ENABLE_MODULES(Display)
474 fi
475 if test "$enable_clanSound" = "yes"; then
476 CLANLIB_ENABLE_MODULES(Sound)
477 ClanLib_Examples="$ClanLib_Examples SoundFilters SoundBuffer StreamSoundProvider PlayCD"
478 fi
479
480 if test "$enable_clanSDL" = "yes"; then
481 CLANLIB_ENABLE_MODULES(SDL)
482 fi
483 if test "$enable_clanGL" = "yes"; then
484 CLANLIB_ENABLE_MODULES(GL)
485 ClanLib_Examples="$ClanLib_Examples AdventureScene Basic2D Canvas DisplayModes Font GLCube GLFog GlyphBuffer InitDisplay Joystick MousePoll MouseSignal Pacman ShadowOfTheBeast Surface SpritesRTS ScreenShot Time"
486 fi
487
488 if test "$enable_clanGUI" = "yes"; then
489 CLANLIB_ENABLE_MODULES([GUI GUIStyleSilver])
490 ClanLib_Examples="$ClanLib_Examples GLGUICube GUISimple GUILayout GUITreeView GUIWindow GUIInputDialog GUIScript GUIStyle PilotsPuzzle"
491 fi
492
493 if test "$enable_clanNetwork" = "yes"; then
494 CLANLIB_ENABLE_MODULES(Network)
495 ClanLib_Examples="$ClanLib_Examples NetChannel NetFTP IRCBot CTalk UDPTunnel"
496 # todo: Many of these examples require more than Network, and a check should be performed
497 fi
498
499 if test "$enable_clanMikMod" = "yes"; then
500 CLANLIB_ENABLE_MODULES(MikMod)
501 ClanLib_Examples="$ClanLib_Examples MikMod"
502 fi
503
504 if test "$enable_clanVorbis" = "yes"; then
505 CLANLIB_ENABLE_MODULES(Vorbis)
506 ClanLib_Examples="$ClanLib_Examples Vorbis"
507 fi
508
509 dnl ----------------------------------------------------
510 dnl Setup libs to be linked with the core library files.
511 dnl ----------------------------------------------------
512
513 dnl check wich display targets to build
514
515 if false; then
516 if test "$USE_DIRECTFB" = "enabled"; then
517 disp_directfb='$(DISP_DIRECTFB)';
518 else
519 directfb_cflags="";
520 directfb_libs="";
521 fi
522
523 AC_SUBST(directfb_cflags)
524 AC_SUBST(directfb_libs)
525 AC_SUBST(disp_directfb)
526 fi
527
528 AC_SUBST(js_cflags)
529 AC_SUBST(js_libs)
530 AC_SUBST(js_defs)
531
532 AC_SUBST(extra_includes)
533 AC_SUBST(extra_libraries)
534
535 AC_SUBST(libs)
536 AC_SUBST(objf_nondyn)
537 AC_SUBST(LIBS)
538
539 dnl ---------------------------------------------------------------------
540 dnl Set which extra object files that should be used in case of assembly:
541 dnl ---------------------------------------------------------------------
542
543 if test "$USE_I386_ASSEMBLER" = "enabled"; then
544 clanSound_extra_objects="$clanSound_extra_objects mixer_asm.lo"
545 fi
546
547 AC_SUBST(clanSound_extra_objects)
548
549 dnl ----------------------------------------
550 dnl Check for documentation generation tools
551 dnl ----------------------------------------
552 if test "$enable_docs" != "no"; then
553 echo "Checking for Documentation stuff"
554 echo "================================"
555 AC_PATH_PROG([perl_exec], [perl])
556 if test -z "$perl_exec"; then
557 if test "$enable_docs" = "yes"; then
558 AC_MSG_ERROR([cannot find perl])
559 else
560 AC_MSG_WARN([cannot find perl])
561 enable_docs=no
562 fi
563 fi
564 fi
565 if test "$enable_docs" != "no"; then
566 xslt_exec=''
567 AC_PATH_PROGS([xslt_exec], [Xalan xsltproc sabcmd MSXSL])
568 if test -z "$xslt_exec"; then
569 if test "$enable_docs" = "yes"; then
570 AC_MSG_ERROR([cannot find xalan, xsltproc, sabcmd or MSXSL])
571 else
572 AC_MSG_WARN([cannot find xalan, xsltproc, sabcmd or MSXSL. Disabling documentation generation]); enable_docs=no
573 fi
574 else
575 # $1="xml file" $2="output file" $3="xslt stylesheet"
576 case "$xslt_exec" in
577 *Xalan)
578 xslt_exec="$xslt_exec -o \$2 \$1 \$3"
579 ;;
580 *xsltproc)
581 xslt_exec="$xslt_exec -o \$2 \$3 \$1"
582 ;;
583 *sabcmd)
584 xslt_exec="$xslt_exec \$3 \$1 \$2"
585 ;;
586 *MSXSL)
587 xslt_exec="$xslt_exec \$1 \$3 -o \$2"
588 esac
589 fi
590 fi
591 AC_MSG_CHECKING([if documentation should be generated]); AC_MSG_RESULT([$enable_docs])
592 if test "$enable_docs" != "no"; then
593 Kavanek_Tutorial_HTML=CLANLIB_FILE_LIST([Documentation/Tutorial/Kavanek], [*.xml], ['$0!="menu.xml"{sub("\\.xml$",".html");print}'])
594 AC_SUBST(Kavanek_Tutorial_HTML)
595 AC_SUBST(ClanLib_docs,"Documentation")
596 AC_SUBST(ClanLib_add_docs,"Reference Overview")
597 enable_docs=yes
598 AC_CONFIG_FILES([Documentation/Utilities/xslt.sh], [chmod +x Documentation/Utilities/xslt.sh])
599 AC_CONFIG_FILES([Documentation/Utilities/webbuilder.pl], [chmod +x Documentation/Utilities/webbuilder.pl])
600 AC_CONFIG_FILES([Documentation/Reference/pce2], [chmod +x Documentation/Reference/pce2])
601 AC_CONFIG_FILES([Documentation/Makefile Documentation/Overview/Makefile Documentation/Reference/Makefile
602 Documentation/Tutorial/Makefile Documentation/Tutorial/Kavanek/Makefile])
603 fi
604
605 echo ""
606
607
608 dnl --------------------
609 dnl Check for debug mode
610 dnl --------------------
611
612 echo "Checking for debugging and profiling"
613 echo "===================================="
614 AC_MSG_CHECKING(for debug mode)
615 AC_ARG_ENABLE(debug, AC_HELP_STRING([--enable-debug], [Enable debugging support]),, enable_debug="no")
616
617 if test "$enable_debug" != "no"; then
618 CXXFLAGS="$CXXFLAGS -DDEBUG=1 -g -O0 -Wall"
619 AC_MSG_RESULT([enabled])
620 else
621 AC_MSG_RESULT([disabled])
622 fi
623
624 dnl ----------------------
625 dnl Check for profile mode
626 dnl ----------------------
627
628 AC_MSG_CHECKING(for profile mode)
629 AC_ARG_ENABLE(profile, AC_HELP_STRING([--enable-profile], [Enable profiling supprt]),, enable_profile="no")
630
631 if test "$enable_profile" != "no"; then
632 CXXFLAGS="$CXXFLAGS -pg -g3 -ggdb3 -ftest-coverage -fprofile-arcs"
633 dnl support for gcov and gprof
634 AC_MSG_RESULT([enabled])
635 else
636 AC_MSG_RESULT([disabled])
637 fi
638 echo ""
639
640 dnl -------------------------
641 dnl Check for Maintainer Mode
642 dnl -------------------------
643 AC_MSG_CHECKING(for maintainer mode)
644 AC_ARG_ENABLE(maintainer-mode, AC_HELP_STRING([--enable-maintainer-mode], [Enable maintainer mode]),, enable_maintainer_mode="no")
645
646 if test "$enable_maintainer_mode" != "no"; then
647 CXXFLAGS="$CXXFLAGS -Werror"
648 AC_MSG_RESULT([enabled])
649 else
650 AC_MSG_RESULT([disabled])
651 fi
652
653 dnl ---------------------
654 dnl Finish configuration:
655 dnl ---------------------
656
657 # Set which parts of ClanLib should be build (could probally solved more nicely)
658 AC_SUBST(ClanLib_Modules)
659 AC_SUBST(ClanLib_pkgconfig)
660 AC_SUBST(ClanLib_API_Modules)
661 AC_SUBST(ClanLib_Examples)
662
663 AC_CONFIG_FILES([
664 pkgconfig/clanApp.pc
665 pkgconfig/Makefile
666 Makefile
667 Examples/Makefile
668 Examples/Makefile.conf
669 Setup/Makefile
670 Sources/API/Makefile
671 Sources/Application/Makefile
672 Sources/Makefile
673 Tests/Makefile.conf
674 ])
675
676 AC_OUTPUT
677
678
679 dnl echo Building dependencies...please wait.
680 dnl make dep > /dev/null 2>&1
681
682 echo "------------------------------------------------------------------------------"
683 echo "The following modules will be built:"
684 echo ""
685 echo " clanGL = $enable_clanGL"
686 echo " clanSDL = $enable_clanSDL"
687 echo " clanApp = yes"
688 echo " clanGUI = $enable_clanGUI"
689 echo " clanCore = yes"
690 echo " clanSound = $enable_clanSound"
691 echo " clanNetwork = $enable_clanNetwork"
692 echo " clanSignals = yes"
693 echo " clanDisplay = $enable_clanDisplay"
694 echo " clanMikmod = $enable_clanMikMod"
695 echo " clanVorbis = $enable_clanVorbis"
696 echo ""
697 echo " Build Documentation = $enable_docs"
698 echo " Debug Build = $enable_debug"
699 dnl echo " CXXFLAGS = $CXXFLAGS"
700 dnl echo " LIBS = $LIBS"
701 dnl echo " LDFLAGS = $LDFLAGS"
702 dnl echo ""
703 echo "------------------------------------------------------------------------------"
704 echo "Configure done."
705 echo ""
706 echo "Type 'make' to compile ClanLib."
707 echo ""
708
709 dnl Local Variables:
710 dnl compile-command: "./autogen.sh && ./configure"
711 dnl End:
712
713 dnl EOF dnl