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