configure.in
changeset 249 3a26a4b9ab13
parent 232 f974cb06ba25
child 254 1ad5ff083036
     1.1 --- a/configure.in	Tue Aug 24 07:54:43 2004 +0000
     1.2 +++ b/configure.in	Sat Nov 13 00:38:01 2004 +0000
     1.3 @@ -103,9 +103,47 @@
     1.4  if test x$enable_music_wave = xyes; then
     1.5      CFLAGS="$CFLAGS -DWAV_MUSIC"
     1.6  fi
     1.7 +no_libmikmod=no
     1.8 +libmikmod_maj=3
     1.9 +libmikmod_min=1
    1.10 +libmikmod_rev=10
    1.11 +libmikmod_ver="$libmikmod_maj.$libmikmod_min.$libmikmod_rev"
    1.12 +AC_ARG_ENABLE(music-libmikmod,
    1.13 +[  --enable-music-libmikmod  enable MOD music via externl libmikmod [default=yes]],
    1.14 +              , enable_music_libmikmod=yes)
    1.15 +if test x$enable_music_libmikmod = xyes; then
    1.16 +	AC_PATH_PROG(LIBMIKMOD_CONFIG, libmikmod-config, no, [$PATH])
    1.17 +	if test "$LIBMIKMOD_CONFIG" = "no" ; then
    1.18 +		no_libmikmod==yes
    1.19 +	else
    1.20 +		CFLAGS_SAVED="$CFLAGS"
    1.21 +		LIBS_SAVED="$LIBS"
    1.22 +		CFLAGS="$CFLAGS -DLIBMIKMOD_MUSIC `$LIBMIKMOD_CONFIG --cflags`"
    1.23 +		LIBS="$LIBS `$LIBMIKMOD_CONFIG --libs`"
    1.24 +		AC_MSG_CHECKING([for libmikmod - version >= $libmikmod_ver])
    1.25 +		AC_TRY_RUN([
    1.26 +#include "mikmod.h"
    1.27 +#include "stdio.h"
    1.28 +
    1.29 +int main(int argc, char **argv)
    1.30 +{
    1.31 +	long maj=$libmikmod_maj,min=$libmikmod_min,rev=$libmikmod_rev,ver=MikMod_GetVersion();
    1.32 +	/*printf("(%d.%d.%d) ",ver>>16,(ver>>8)&0xff,ver&0xff);*/
    1.33 +	if(ver>=((maj<<16)|(min<<8)|(rev))) {
    1.34 +		printf("yes\n");
    1.35 +		return 0;
    1.36 +	}
    1.37 +	printf("no\n*** libmikmod is older than %d.%d.%d, not using.\n",maj,min,rev);
    1.38 +	return 1;
    1.39 +}
    1.40 +],, no_libmikmod=yes;CFLAGS="$CFLAGS_SAVED";LIBS="$LIBS_SAVED",
    1.41 +[echo $ac_n "cross compiling; assumed OK... $ac_c"])
    1.42 +	fi
    1.43 +fi
    1.44 +
    1.45  AC_ARG_ENABLE(music-mod,
    1.46  [  --enable-music-mod      enable MOD music via mikmod [default=yes]],
    1.47 -              , enable_music_mod=yes)
    1.48 +, enable_music_mod=$no_libmikmod)
    1.49  if test x$enable_music_mod = xyes; then
    1.50      CFLAGS="$CFLAGS -DMOD_MUSIC -I\$(top_srcdir)/mikmod"
    1.51      MUSIC_SUBDIRS="$MUSIC_SUBDIRS mikmod"