Commit 9dad9584 authored by Simon Morlat's avatar Simon Morlat

change configure script to add more clever error messages

parent 7669cf43
......@@ -118,8 +118,6 @@ AC_DEFUN([MS_CHECK_VIDEO],[
AC_CHECK_HEADERS(libswscale/swscale.h)
CPPFLAGS=$CPPFLAGS_save
enable_sdl_default=false
enable_x11_default=true
if test "$macosx_found" = "yes" ; then
enable_sdl_default=true
enable_x11_default=false
......@@ -129,6 +127,12 @@ AC_DEFUN([MS_CHECK_VIDEO],[
dnl AC_LANG_PUSH([Objective C])
dnl AC_CHECK_HEADERS([QTKit/QTKit.h],[],[AC_MSG_ERROR([QTKit framework not found, required for video support])])
dnl AC_LANG_POP([Objective C])
elif test "$ios_found" = "yes" ; then
enable_sdl_default=false
enable_x11_default=false
else
enable_sdl_default=false
enable_x11_default=true
fi
AC_ARG_ENABLE(sdl,
......@@ -141,7 +145,7 @@ AC_DEFUN([MS_CHECK_VIDEO],[
sdl_found="false"
if test "$enable_sdl" = "true"; then
PKG_CHECK_MODULES(SDL, [sdl >= 1.2.0 ],sdl_found=true,sdl_found=false)
PKG_CHECK_MODULES(SDL, [sdl >= 1.2.0 ],sdl_found=true,[AC_MSG_ERROR([No SDL library found])])
fi
......@@ -170,16 +174,13 @@ AC_DEFUN([MS_CHECK_VIDEO],[
AC_CHECK_HEADERS(X11/extensions/Xvlib.h,[] ,[enable_xv=false],[
#include <X11/Xlib.h>
])
AC_CHECK_LIB(Xv,XvCreateImage,[LIBS="$LIBS -lXv"])
fi
fi
if ! test "$mingw_found" = "yes" && test !"$ios_found" = "yes" ; then
if test "$enable_xv$sdl_found" = "falsefalse" ; then
AC_MSG_ERROR([No video output API found. Install either X11+Xv headers or SDL library.])
AC_CHECK_LIB(Xv,XvCreateImage,[LIBS="$LIBS -lXv"],[enable_xv=false])
if test "$enable_xv" = "false" ; then
AC_MSG_ERROR([No X video output API found. Please install X11+Xv headers.])
fi
fi
fi
AC_ARG_ENABLE(theora,
[ --disable-theora Disable theora support],
[case "${enableval}" in
......
......@@ -263,13 +263,21 @@ if test x$mingw_found = xyes ; then
found_sound=yes
fi
AC_ARG_ENABLE(sound,
[ --disable-sound Turn off all possible sound backend (default=no)],
[case "${enableval}" in
yes) use_sound=true ;;
no) use_sound=false ;;
*) AC_MSG_ERROR(bad value ${enableval} for --disable-sound) ;;
esac],[use_sound=true])
AC_ARG_ENABLE(oss,
[ --enable-oss Disable oss support],
[ --enable-oss Enable oss support],
[case "${enableval}" in
yes) oss=true ;;
no) oss=false ;;
*) AC_MSG_ERROR(bad value ${enableval} for --disable-oss) ;;
esac],[oss=true])
esac],[oss=$use_sound])
if "$oss" = "true"; then
AC_CHECK_HEADERS(soundcard.h sys/soundcard.h machine/soundcard.h sys/audio.h)
......@@ -292,7 +300,7 @@ AC_ARG_ENABLE(alsa,
yes) alsa=true ;;
no) alsa=false ;;
*) AC_MSG_ERROR(bad value ${enableval} for --enable-alsa) ;;
esac],[alsa=true])
esac],[alsa=$use_sound])
if test "$alsa" = "true"; then
AC_CHECK_HEADERS(alsa/asoundlib.h,
......@@ -316,7 +324,7 @@ AC_ARG_ENABLE(artsc,
yes) artsc=true ;;
no) artsc=false ;;
*) AC_MSG_ERROR(bad value ${enableval} for --enable-artsc) ;;
esac],[artsc=no])
esac],[artsc=false])
arts_enabled=false
......@@ -377,9 +385,9 @@ AC_ARG_ENABLE(macsnd,
yes) macsnd=true ;;
no) macsnd=false ;;
*) AC_MSG_ERROR(bad value ${enableval} for --enable-macsnd) ;;
esac],[macsnd=true])
esac],[macsnd=$use_sound])
macaqsnd_default=false;
macaqsnd_default=$use_sound
if test "$ios_found" = "yes" ; then
macaqsnd_default=true;
fi
......@@ -411,46 +419,6 @@ fi
AM_CONDITIONAL(BUILD_MACSND, test x$macsnd_enabled = xtrue)
AM_CONDITIONAL(BUILD_MACAQSND, test x$macaqsnd = xtrue)
AM_CONDITIONAL(BUILD_IOSIOUNIT, test x$ios_found = xyes)
dnl AM_CONDITIONAL(BUILD_MSSILK, test x$ios_found = xyes)
AM_CONDITIONAL(BUILD_MSSILK, test x = y)
AC_ARG_ENABLE(jack,
[ --disable-jack Disable jack support],
[case "${enableval}" in
yes) jack=true ;;
no) jack=false ;;
*) AC_MSG_ERROR(bad value ${enableval} for --disable-jack) ;;
esac],[jack=true])
if test x$jack = xtrue; then
dnl Check for samplerate libraries
dnl Check for jack libraries (sound output plugin)
PKG_CHECK_MODULES(JACK,jack >= 0.15.0,
[
dnl we' found jack devel files
PKG_CHECK_MODULES(SAMPLERATE, samplerate >= 0.0.13,
[AC_DEFINE(__JACK_ENABLED__,1,[Jack support])
found_sound=yes
jack_found=yes] ,
[echo "libsamplerate not found, jack support disabled."])
AC_SUBST(SAMPLERATE_CFLAGS)
AC_SUBST(SAMPLERATE_LIBS)
],
[echo "No jack support."] )
if test x$jack_found = xno ; then
dnl reset flags
JACK_CFLAGS=
JACK_LIBS=
SAMPLERATE_CFLAGS=
SAMPLERATE_LIBS=
fi
AC_SUBST(JACK_CFLAGS)
AC_SUBST(JACK_LIBS)
fi
AC_ARG_ENABLE(pulseaudio,
[ --disable-pulseaudio Disable pulseaudio support],
......@@ -458,7 +426,7 @@ AC_ARG_ENABLE(pulseaudio,
yes) pulseaudio=true ;;
no) pulseaudio=false ;;
*) AC_MSG_ERROR(bad value ${enableval} for --disable-pulseaudio) ;;
esac],[pulseaudio=true])
esac],[pulseaudio=$use_sound])
if test x$pulseaudio = xtrue ; then
......@@ -470,8 +438,8 @@ fi
AM_CONDITIONAL(BUILD_PULSEAUDIO,test x$pulseaudio = xtrue)
if test "$found_sound" = "no"; then
AC_MSG_WARN([Could not find a support sound driver API])
if test "${found_sound}${use_sound}" = "noyes"; then
AC_MSG_ERROR([Could not find a support sound driver API. Use --disable-sound if you don't care about having sound.])
fi
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment