[MPlayer-dev-eng] [PATCH] _res_comment for echores (configure)
Reimar Döffinger
Reimar.Doeffinger at stud.uni-karlsruhe.de
Sun Sep 11 15:20:43 CEST 2005
Hi,
this patch makes the echores command in configure output append the
content of the _res_comment variable and clear it afterwards.
It also changes quite a few checks to take advantage of this new
feature.
I think it makes some things really a lot easier.
Please test and comment.
Greetings,
Reimar Döffinger
-------------- next part --------------
Index: configure
===================================================================
RCS file: /cvsroot/mplayer/main/configure,v
retrieving revision 1.1057
diff -u -r1.1057 configure
--- configure 11 Sep 2005 10:57:28 -0000 1.1057
+++ configure 11 Sep 2005 13:16:09 -0000
@@ -136,10 +136,14 @@
# Use this to echo the results of a check
echores() {
- echo "Result is: $@" >> "$TMPLOG"
+ if test "$_res_comment" ; then
+ _res_comment="($_res_comment)"
+ fi
+ echo "Result is: $@ $_res_comment" >> "$TMPLOG"
echo "##########################################" >> "$TMPLOG"
echo "" >> "$TMPLOG"
- echo "$@"
+ echo "$@ $_res_comment"
+ _res_comment=""
}
#############################################################################
@@ -2280,11 +2284,10 @@
else
_def_i18n='#undef USE_I18N'
fi
-if test -z "$_i18n_libs" ; then
- echores "$_i18n"
-else
- echores "$_i18n (using $_i18n_libs)"
+if test "$_i18n_libs" ; then
+ _res_comment="using $_i18n_libs"
fi
+echores "$_i18n"
echocheck "langinfo"
@@ -3019,11 +3022,11 @@
fi
if test "$_termcap" = yes ; then
_def_termcap='#define USE_TERMCAP 1'
- echores "yes (using $_ld_termcap)"
+ _res_comment="using $_ld_termcap"
else
_def_termcap='#undef USE_TERMCAP'
- echores no
fi
+echores "$_termcap"
echocheck "termios"
@@ -3057,12 +3060,13 @@
elif test "$_def_termios_h_name" = 'termios.h' ; then
_def_termios_h='#define HAVE_TERMIOS_H 1'
fi
- echores "yes (using $_def_termios_h_name)"
+ _res_comment="using $_def_termios_h_name"
else
_def_termios='#undef HAVE_TERMIOS'
_def_termios_h_name=''
- echores "no"
+ _termios=no
fi
+echores "$_termios"
echocheck "shm"
@@ -3519,19 +3523,18 @@
_directfb_version=`"$TMPO"`
_def_directfb_version="#define DIRECTFBVERSION $_directfb_version"
if test "$_directfb_version" -ge 913; then
- echores "yes ($_directfb_version)"
+ _res_comment="$_directfb_version"
else
_def_directfb_version='#undef DIRECTFBVERSION'
_directfb=no
- echores "no (version >=0.9.13 required)"
+ _res_comment="version >=0.9.13 required"
fi
else
_directfb=no
- echores "no (failed to get version)"
+ _res_comment="failed to get version"
fi
-else
- echores "$_directfb"
fi
+echores "$_directfb"
if test "$_directfb" = yes ; then
_def_directfb='#define HAVE_DIRECTFB 1'
@@ -3598,15 +3601,16 @@
_def_x11='#define HAVE_X11 1'
_vosrc="$_vosrc x11_common.c vo_x11.c vo_xover.c"
_vomodules="x11 xover $_vomodules"
- echores "yes (using $I)"
+ _res_comment="using $I"
else
_x11=no
_def_x11='#undef HAVE_X11'
_inc_x11=''
_ld_x11=''
_novomodules="x11 $_novomodules"
- echores "no (check if the dev(el) packages are installed)"
+ _res_comment="check if the dev(el) packages are installed"
fi
+echores "$_x11"
echocheck "DPMS"
@@ -3841,6 +3845,7 @@
if test "$_gl_win32" = yes ; then
_def_gl_win32='#define GL_WIN32 1'
_vosrc="$_vosrc w32_common.c"
+ _res_comment="win32 version"
fi
_vomodules="opengl $_vomodules"
else
@@ -4056,21 +4061,19 @@
EOF
if cc_check ; then
_dvb=yes
- echores "yes"
else
for I in "$_inc_dvb" "-I/usr/src/DVB/ost/include" ; do
if cc_check "$I" ; then
_dvb=yes
_inc_dvb="$I"
- echores "yes (using $_inc_dvb)"
+ _res_comment="using $_inc_dvb"
break
fi
done
- test "$_dvb" = no && echores "no (specify path to DVB/ost/include with --with-dvbincdir=DIR)"
+ test "$_dvb" = no && _res_comment="specify path to DVB/ost/include with --with-dvbincdir=DIR"
fi
-else
- echores "no"
fi
+echores "$_dvb"
if test "$_dvb" = yes ; then
_def_dvb='#define HAVE_DVB 1'
_def_dvb_in='#define HAS_DVBIN_SUPPORT 1'
@@ -4097,21 +4100,19 @@
EOF
if cc_check ; then
_dvbhead=yes
- echores "yes"
else
for I in "$_inc_dvb" "-I/usr/src/DVB/include" ; do
if cc_check "$I" ; then
_dvbhead=yes
_inc_dvb="$I"
- echores "yes (using $_inc_dvb)"
+ _res_comment="using $_inc_dvb"
break
fi
done
- test "$_dvbhead" = no && echores "no (specify path to DVB/include (HEAD Version) with --with-dvbincdir=DIR)"
+ test "$_dvbhead" = no && _res_comment="specify path to DVB/include (HEAD Version) with --with-dvbincdir=DIR"
fi
- else
- echores "no"
fi
+ echores "$_dvbhead"
if test "$_dvbhead" = yes ; then
_def_dvb='#define HAVE_DVB_HEAD 1'
_def_dvb_in='#define HAS_DVBIN_SUPPORT 1'
@@ -4140,7 +4141,7 @@
if irix ; then
# Don't check for -lpng on irix since it has its own libpng
# incompatible with the GNU libpng
- echores "disabled on irix (not GNU libpng)"
+ _res_comment="disabled on irix (not GNU libpng)"
else
cat > $TMPC << EOF
#include <png.h>
@@ -4154,17 +4155,13 @@
if cc_check -lpng -lz $_ld_lm ; then
if "$TMPO" >> "$TMPLOG" ; then
_png=yes
- echores yes
else
- echores "no (mismatch of library and header versions)"
+ _res_comment="mismatch of library and header versions"
fi
- else
- echores no
fi
fi
-else
- echores "$_png"
fi
+echores "$_png"
if test "$_png" = yes ; then
_def_png='#define HAVE_PNG 1'
_ld_png='-lpng -lz'
@@ -4354,12 +4351,11 @@
_ld_vesa="-lvbe -llrmi"
_vosrc="$_vosrc vo_vesa.c vesa_lvo.c gtf.c"
_vomodules="vesa $_vomodules"
- echores "yes"
else
_def_vesa='#undef HAVE_VESA'
- echores "no"
_novomodules="vesa $_novomodules"
fi
+echores "$_vesa"
#################
# VIDEO + AUDIO #
@@ -4393,7 +4389,7 @@
fi
_sdl=yes
else
- _sdl=outdated
+ _res_comment=outdated
fi
fi
fi
@@ -4414,13 +4410,13 @@
_vomodules="sdl $_vomodules"
_aosrc="$_aosrc ao_sdl.c"
_aomodules="sdl $_aomodules"
- echores "yes (using $_sdlconfig)"
+ _res_comment="using $_sdlconfig"
else
_def_sdl='#undef HAVE_SDL'
_novomodules="sdl $_novomodules"
_noaomodules="sdl $_noaomodules"
- echores "no"
fi
+echores "$_sdl"
echocheck "Windows waveout"
if test "$_win32waveout" = auto ; then
@@ -4507,14 +4503,14 @@
_aosrc="$_aosrc ao_dxr2.c"
_aomodules="dxr2 $_aomodules"
_vomodules="dxr2 $_vomodules"
- echores "yes (using $_inc_dxr2)"
+ _res_comment="using $_inc_dxr2"
else
_def_dxr2='#undef HAVE_DXR2'
_noaomodules="dxr2 $_noaomodules"
_novomodules="dxr2 $_novomodules"
_inc_dxr2=""
- echores "no"
fi
+echores "$_dxr2"
echocheck "DXR3/H+"
if test "$_dxr3" = auto ; then
@@ -4570,13 +4566,11 @@
if test -d libfame && test -f libfame/fame.h ; then
# disable fame on cygwin as no sense to port - atmos
cygwin || _fame=yes
- echores $_fame
else
- echores "no (no fame dir)"
+ _res_comment="no fame dir"
fi
-else
- echores "$_fame"
fi
+echores "$_fame"
_def_fame='#undef USE_LIBFAME'
if test "$_fame" = yes ; then
@@ -4791,42 +4785,46 @@
_def_sys_asoundlib_h='#undef HAVE_SYS_ASOUNDLIB_H'
_def_alsa_asoundlib_h='#undef HAVE_ALSA_ASOUNDLIB_H'
if test "$_alsaver" ; then
+ _alsa=yes
if test "$_alsaver" = '0.5.x' ; then
_aosrc="$_aosrc ao_alsa5.c"
_aomodules="alsa5 $_aomodules"
_def_alsa5='#define HAVE_ALSA5 1'
_def_sys_asoundlib_h='#define HAVE_SYS_ASOUNDLIB_H 1'
- echores "yes (using alsa 0.5.x and sys/asoundlib.h)"
+ _res_comment="using alsa 0.5.x and sys/asoundlib.h"
elif test "$_alsaver" = '0.9.x-sys' ; then
_aosrc="$_aosrc ao_alsa.c"
_aomodules="alsa $_aomodules"
_def_alsa9='#define HAVE_ALSA9 1'
_def_sys_asoundlib_h='#define HAVE_SYS_ASOUNDLIB_H 1'
- echores "yes (using alsa 0.9.x and sys/asoundlib.h)"
+ _res_comment="using alsa 0.9.x and sys/asoundlib.h"
elif test "$_alsaver" = '0.9.x-alsa' ; then
_aosrc="$_aosrc ao_alsa.c"
_aomodules="alsa $_aomodules"
_def_alsa9='#define HAVE_ALSA9 1'
_def_alsa_asoundlib_h='#define HAVE_ALSA_ASOUNDLIB_H 1'
- echores "yes (using alsa 0.9.x and alsa/asoundlib.h)"
+ _res_comment="using alsa 0.9.x and alsa/asoundlib.h"
elif test "$_alsaver" = '1.0.x-sys' ; then
_aosrc="$_aosrc ao_alsa.c"
_aomodules="alsa $_aomodules"
_def_alsa1x="#define HAVE_ALSA1X 1"
_def_alsa_asoundlib_h='#define HAVE_SYS_ASOUNDLIB_H 1'
- echores "yes (using alsa 1.0.x and sys/asoundlib.h)"
+ _res_comment="using alsa 1.0.x and sys/asoundlib.h"
elif test "$_alsaver" = '1.0.x-alsa' ; then
_aosrc="$_aosrc ao_alsa.c"
_aomodules="alsa $_aomodules"
_def_alsa1x="#define HAVE_ALSA1X 1"
_def_alsa_asoundlib_h='#define HAVE_ALSA_ASOUNDLIB_H 1'
- echores "yes (using alsa 1.0.x and alsa/asoundlib.h)"
+ _res_comment="using alsa 1.0.x and alsa/asoundlib.h"
+ else
+ _alsa=no
+ _res_comment="unknown version"
fi
_ld_alsa="-lasound $_ld_dl $_ld_pthread"
else
_noaomodules="alsa $_noaomodules"
- echores "no"
fi
+echores "$_alsa"
echocheck "Sun audio"
@@ -5081,7 +5079,7 @@
# freetype depends on iconv
if test "$_iconv" = no ; then
_freetype=no
- rez_comment="(iconv support needed)"
+ _res_comment="iconv support needed"
fi
if test "$_freetype" = auto ; then
@@ -5126,12 +5124,11 @@
else
_def_freetype='#undef HAVE_FREETYPE'
fi
-echores "$_freetype $rez_comment"
-rez_comment=""
+echores "$_freetype"
if test "$_freetype" = no ; then
_fontconfig=no
- rez_comment="(freetype support needed)"
+ _res_comment="freetype support needed"
fi
echocheck "fontconfig"
if test "$_fontconfig" = auto ; then
@@ -5163,8 +5160,7 @@
else
_def_fontconfig='#undef HAVE_FONTCONFIG'
fi
-echores "$_fontconfig $rez_comment"
-rez_comment=""
+echores "$_fontconfig"
echocheck "fribidi with charsets"
if test "$_fribidi" = yes ; then
@@ -5323,11 +5319,10 @@
_toolame_lib=""
_nocodecmodules="toolame $_nocodecmodules"
fi
-if test -z "$_toolamedir" ; then
- echores "$_toolame"
-else
- echores "$_toolame (using $_toolamedir)"
+if test "$_toolamedir" ; then
+ _res_comment="using $_toolamedir"
fi
+echores "$_toolame"
echocheck "Twolame"
if test "$_twolame" = auto ; then
@@ -5387,14 +5382,13 @@
_nocodecmodules="libvorbis $_nocodecmodules"
fi
if test "$_vorbis" = yes -a "$_tremor_internal" = yes -a "$_tremor_low" = yes ; then
- echores "$_vorbis (internal low accuracy Tremor)"
+ _res_comment="internal low accuracy Tremor"
elif test "$_vorbis" = yes -a "$_tremor_internal" = yes ; then
- echores "$_vorbis (internal Tremor)"
+ _res_comment="internal Tremor"
elif test "$_vorbis" = yes -a "$_tremor" = yes ; then
- echores "$_vorbis (Tremor)"
-else
- echores "$_vorbis"
+ _res_comment="Tremor"
fi
+echores "$_vorbis"
echocheck "OggTheora support (only the CVS version!)"
if test "$_theora" = auto ; then
@@ -5600,10 +5594,8 @@
EOF
cc_check $_inc_faad $_ld_faad $_ld_lm && _faad_external=yes
fi
- echores "$_faad_external"
-else
- echores "no"
fi
+echores "$_faad_external"
if test "$_faad_external" = yes; then
_def_faad='#define HAVE_FAAD 1'
@@ -5668,13 +5660,13 @@
fi
if test "$_win32" = yes ; then
_def_win32='#define USE_WIN32DLL 1'
- echores "yes (using $_win32libdir)"
+ _res_comment="using $_win32libdir"
else
_def_win32='#undef USE_WIN32DLL'
_nocodecmodules="win32 $_nocodecmodules"
_dshow=no
- echores "no"
fi
+echores "$_win32"
if test "$_win32" != no ; then
_def_win32_loader='#undef WIN32_LOADER'
@@ -5751,7 +5743,9 @@
echocheck "XAnim DLL"
if test "$_xanim" = auto ; then
_xanim=no
+ _res_comment="dynamic loader support needed"
if test "$_dl" = yes ; then
+ _res_comment="no suitable directory found - see DOCS/HTML/$_doc_lang/codecs.html"
if test -z "$_xanimlibdir" ; then
for I in "$_libdir/codecs" /usr/local/lib/xanim/mods /usr/lib/xanim/mods /usr/lib/xanim $XANIM_MOD_DIR ; do
if test -d "$I" ; then
@@ -5761,38 +5755,29 @@
done
fi
test "$_xanimlibdir" && _xanim=yes
- if test "$_xanim" = yes ; then
- echores "yes (using $_xanimlibdir)"
- else
- echores "no (no suitable directory found - see DOCS/HTML/$_doc_lang/codecs.html)"
- fi
- else
- echores "no (dynamic loader support needed)"
fi
-else
- echores "$_xanim (using $_xanimlibdir)"
fi
if test "$_xanim" = yes ; then
_def_xanim='#define USE_XANIM 1'
_def_xanim_path="#define XACODEC_PATH \"$_xanimlibdir\""
_codecmodules="xanim $_codecmodules"
+ _res_comment="using $_xanimlibdir"
else
_def_xanim='#undef USE_XANIM'
_def_xanim_path='#undef XACODEC_PATH'
_nocodecmodules="xanim $_nocodecmodules"
fi
+echores "$_xanim"
echocheck "RealPlayer DLL"
if test "$_real" = auto ; then
_real=no
+ _res_comment="dynamic loader support needed"
if test "$_dl" = yes || test "$_win32" = yes ; then
# if test "$_dl" = yes ; then
+ _res_comment="tested only on Linux/FreeBSD/NetBSD/Cygwin/MinGW/Darwin"
if linux || freebsd || netbsd || win32 || darwin ; then
- _real=yes
- else
- echores "no (tested only on Linux/FreeBSD/NetBSD/Cygwin/MinGW/Darwin)"
- fi
- if test "$_real" = yes ; then
+ _res_comment="no suitable directory found - see DOCS/HTML/$_doc_lang/codecs.html"
if test -z "$_reallibdir" ; then
for I in "$_libdir/codecs" "$_libdir/real" /usr/lib/real \
/usr/lib/RealPlayer{9,8,}/Codecs /usr/local/RealPlayer{9,8,}/Codecs \
@@ -5805,28 +5790,21 @@
fi
done
fi
- test "$_reallibdir" || _real=no
- if test "$_real" = yes ; then
- echores "yes (using $_reallibdir)"
- else
- echores "no (no suitable directory found - see DOCS/HTML/$_doc_lang/codecs.html)"
- fi
+ test "$_reallibdir" && _real=yes
fi
- else
- echores "no (dynamic loader support needed)"
fi
-else
- echores "$_real (using $_reallibdir)"
fi
if test "$_real" = yes ; then
_def_real='#define USE_REALCODECS 1'
_def_real_path="#define REALCODEC_PATH \"$_reallibdir\""
_codecmodules="real $_codecmodules"
+ _res_comment="using $_reallibdir"
else
_def_real='#undef USE_REALCODECS'
_def_real_path="#undef REALCODEC_PATH"
_nocodecmodules="real $_nocodecmodules"
fi
+echores "$_real"
echocheck "LIVE.COM Streaming Media libraries"
@@ -5914,7 +5892,9 @@
if test "$_libavcodec" = auto ; then
# Note: static linking is preferred to dynamic linking
_libavcodec=no
+ _res_comment="see DOCS/HTML/$_doc_lang/codecs.html"
if test -d libavcodec && test -f libavcodec/utils.c ; then
+ _res_comment="old ffmpeg version, use CVS !"
if grep avcodec_find_encoder_by_name libavcodec/utils.c > /dev/null 2>&1 ; then
# check if libavutil is a required
cat > $TMPC << EOF
@@ -5930,21 +5910,15 @@
else
_libavutil_required="yes"
fi
- if test "$_libavutil_required" != "$_libavutil"; then
- _libavcodec="no (libavutil availability does not fit libavcodec version)"
- else
+ _res_comment="libavutil availability does not fit libavcodec version"
+ if test "$_libavutil_required" = "$_libavutil"; then
_libavcodec="yes"
+ _res_comment=""
fi
- echores $_libavcodec
- else
- echores "no (old ffmpeg version, use CVS !)"
fi
- else
- echores "no (see DOCS/HTML/$_doc_lang/codecs.html)"
fi
-else
- echores "$_libavcodec"
fi
+echores "$_libavcodec"
echocheck "FFmpeg libavformat (static)"
if test "$_libavformat" = auto ; then
@@ -5952,13 +5926,9 @@
_libavformat=no
if test -d libavformat && test -f libavformat/utils.c ; then
_libavformat=yes
- echores "yes"
- else
- echores "no"
fi
-else
- echores "$_libavformat"
fi
+echores "$_libavformat"
_def_haveffpostprocess='no'
if test -d libavcodec && test -f libavcodec/libpostproc/postprocess.h ; then
@@ -5969,6 +5939,7 @@
echocheck "FFmpeg libavcodec (dynamic)"
if test "$_libavcodecso" = auto ; then
_libavcodecso=no
+ _res_comment="libavcodec.so is broken/obsolete"
# FIXME : check for avcodec_find_encoder_by_name() for mencoder
cat > $TMPC << EOF
#define FF_POSTPROCESS 1
@@ -5980,13 +5951,10 @@
EOF
if cc_check -lavcodec $_ld_lm ; then
_libavcodecso=yes
- echores "yes (using libavcodec.so)"
- else
- echores "no (libavcodec.so is broken/obsolete)"
+ _res_comment="using libavcodec.so, but static libavcodec is recommended"
fi
-else
- echores "$_libavcodecso"
fi
+echores "$_libavcodecso"
fi
_def_libavcodec='#undef USE_LIBAVCODEC'
@@ -6023,17 +5991,14 @@
fi
echocheck "amr narrowband"
-_echomsg=""
if test "$_amr_nb" = auto ; then
+ _amr_nb=no
if test -f libavcodec/amr_float/sp_dec.c ; then
if test "$_libavcodec" = yes ; then
_amr_nb=yes
else
- _amr_nb=no
- _echomsg "libavcodec (static) is required by amr_nb, sorry"
+ _res_comment="libavcodec (static) is required by amr_nb, sorry"
fi
- else
- _amr_nb=no
fi
fi
if test "$_amr_nb" = yes ; then
@@ -6052,11 +6017,11 @@
_amr_nb_fixed=yes
else
_amr_nb_fixed=no
- _echomsg="(disabled by amr_nb)"
+ _res_comment="disabled by amr_nb"
fi
else
_amr_nb_fixed=no
- _echomsg "libavcodec (static) is required by amr_nb-fixed, sorry"
+ _res_comment="libavcodec (static) is required by amr_nb-fixed, sorry"
fi
else
_amr_nb_fixed=no
@@ -6069,7 +6034,7 @@
else
_def_amr_nb_fixed='#undef AMR_NB_FIXED'
fi
-echores "$_amr_nb_fixed $_echomsg"
+echores "$_amr_nb_fixed"
if test "$_amr_nb" = yes ; then
_codecmodules="amr_nb $_codecmodules"
@@ -6078,17 +6043,14 @@
fi
echocheck "amr wideband"
-_echomsg=""
if test "$_amr_wb" = auto ; then
+ _amr_wb=no
if test -f libavcodec/amrwb_float/dec_dtx.c ; then
if test "$_libavcodec" = yes ; then
_amr_wb=yes
else
- _amr_wb=no
- _echomsg="libavcodec (static) is required by amr_wb, sorry"
+ _res_comment="libavcodec (static) is required by amr_wb, sorry"
fi
- else
- _amr_wb=no
fi
fi
if test "$_amr_wb" = yes ; then
@@ -6098,7 +6060,7 @@
_def_amr_wb='#undef AMR_WB'
_nocodecmodules="amr_wb $_nocodecmodules"
fi
-echores "$_amr_wb $_echomsg"
+echores "$_amr_wb"
echocheck "libdv-0.9.5+"
if test "$_libdv" = auto ; then
@@ -6134,17 +6096,16 @@
_def_zr='#define HAVE_ZR 1'
_vosrc="$_vosrc vo_zr2.c vo_zr.c jpeg_enc.c"
_vomodules="zr zr2 $_vomodules"
- echores "$_zr"
else
- echores "libavcodec (static) is required by zr, sorry"
+ _res_comment="libavcodec (static) is required by zr, sorry"
_novomodules="zr $_novomodules"
_def_zr='#undef HAVE_ZR'
fi
else
_def_zr='#undef HAVE_ZR'
_novomodules="zr zr2 $_novomodules"
- echores "$_zr"
fi
+echores "$_zr"
echocheck "bl"
if test "$_bl" = yes ; then
More information about the MPlayer-dev-eng
mailing list