1
0
mirror of https://github.com/mpv-player/mpv synced 2025-02-09 08:27:18 +00:00

added --cc option patch from Bivanbi

git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@197 b3059339-0415-0410-9bf9-f77b7e298cf2
This commit is contained in:
arpi_esp 2001-03-22 19:21:32 +00:00
parent 83a5430364
commit f68ce195c9

63
configure vendored
View File

@ -6,16 +6,19 @@
# #
# Changes in reversed order: # Changes in reversed order:
# #
# 2000/03/08 by LGB: # 2001/03/22 by Bivanbi:
# - new option: --cc (to specify C compiler path+name)
#
# 2001/03/08 by LGB:
# - DGA detection-o-matic :) # - DGA detection-o-matic :)
# - '--disable-dga' option to force disabling DGA vo driver compiling into mplayer # - '--disable-dga' option to force disabling DGA vo driver compiling into mplayer
# - line about '--enable-dga' is added to the help message # - line about '--enable-dga' is added to the help message
# #
# 2000/02/26 by A'rpi: # 2001/02/26 by A'rpi:
# - added DGA option: --enable-dga # - added DGA option: --enable-dga
# - no notify if --with-win32libdir used [Tibcu] # - no notify if --with-win32libdir used [Tibcu]
# #
# 2000/02/25 by LGB: # 2001/02/25 by LGB:
# - TMPDIR or TEMPDIR variable is honored during tests for temporary files # - TMPDIR or TEMPDIR variable is honored during tests for temporary files
# - ChangeLog inside configure was reversed ;-) # - ChangeLog inside configure was reversed ;-)
# #
@ -62,6 +65,7 @@ cat << EOF
usage: $0 [options] usage: $0 [options]
params: params:
--cc use this C compiler to build MPlayer [gcc]
--enable-mmx build with mmx support [autodetect] --enable-mmx build with mmx support [autodetect]
--enable-3dnow build with 3dnow! support [autodetect] --enable-3dnow build with 3dnow! support [autodetect]
--enable-sse build with sse support [autodetect] --enable-sse build with sse support [autodetect]
@ -116,6 +120,19 @@ fi
CCONF='config.h' CCONF='config.h'
MCONF='config.mak' MCONF='config.mak'
# --- Check for C compiler:
_cc=gcc
for ac_option
do
case "$ac_option" in
--cc=*)
_cc=`echo $ac_option | cut -d '=' -f 2`
;;
esac
done
# --- # ---
TAB=`echo -n -e "\t"` TAB=`echo -n -e "\t"`
@ -287,39 +304,39 @@ EOF
#echo -n "Checking your GCC CPU optimalization abilities: " #echo -n "Checking your GCC CPU optimalization abilities: "
if [ "$proc" = "k7" ]; then if [ "$proc" = "k7" ]; then
# echo -n "trying k7 " # echo -n "trying k7 "
gcc $TMPC -o $TMPO -march=$proc -mcpu=$proc &> /dev/null || proc=athlon $_cc $TMPC -o $TMPO -march=$proc -mcpu=$proc &> /dev/null || proc=athlon
fi fi
if [ "$proc" = "athlon" ]; then if [ "$proc" = "athlon" ]; then
# echo -n "trying athlon " # echo -n "trying athlon "
gcc $TMPC -o $TMPO -march=$proc -mcpu=$proc &> /dev/null || proc=k6 $_cc $TMPC -o $TMPO -march=$proc -mcpu=$proc &> /dev/null || proc=k6
fi fi
if [ "$proc" = "k6" ]; then if [ "$proc" = "k6" ]; then
# echo -n "trying k6 " # echo -n "trying k6 "
gcc $TMPC -o $TMPO -march=$proc -mcpu=$proc &> /dev/null || proc=k5 $_cc $TMPC -o $TMPO -march=$proc -mcpu=$proc &> /dev/null || proc=k5
fi fi
if [ "$proc" = "k5" ]; then if [ "$proc" = "k5" ]; then
# echo -n "trying k5 " # echo -n "trying k5 "
gcc $TMPC -o $TMPO -march=$proc -mcpu=$proc &> /dev/null || proc=pentium $_cc $TMPC -o $TMPO -march=$proc -mcpu=$proc &> /dev/null || proc=pentium
fi fi
if [ "$proc" = "i686" ]; then if [ "$proc" = "i686" ]; then
# echo -n "trying i686 " # echo -n "trying i686 "
gcc $TMPC -o $TMPO -march=$proc -mcpu=$proc &> /dev/null || proc=pentiumpro $_cc $TMPC -o $TMPO -march=$proc -mcpu=$proc &> /dev/null || proc=pentiumpro
fi fi
if [ "$proc" = "pentiumpro" ]; then if [ "$proc" = "pentiumpro" ]; then
# echo -n "trying pentiumpro " # echo -n "trying pentiumpro "
gcc $TMPC -o $TMPO -march=$proc -mcpu=$proc &> /dev/null || proc=pentium $_cc $TMPC -o $TMPO -march=$proc -mcpu=$proc &> /dev/null || proc=pentium
fi fi
if [ "$proc" = "pentium" ]; then if [ "$proc" = "pentium" ]; then
# echo -n "trying pentium " # echo -n "trying pentium "
gcc $TMPC -o $TMPO -march=$proc -mcpu=$proc &> /dev/null || proc=i486 $_cc $TMPC -o $TMPO -march=$proc -mcpu=$proc &> /dev/null || proc=i486
fi fi
if [ "$proc" = "i486" ]; then if [ "$proc" = "i486" ]; then
# echo -n "trying i486 " # echo -n "trying i486 "
gcc $TMPC -o $TMPO -march=$proc -mcpu=$proc &> /dev/null || proc=i386 $_cc $TMPC -o $TMPO -march=$proc -mcpu=$proc &> /dev/null || proc=i386
fi fi
if [ "$proc" = "i386" ]; then if [ "$proc" = "i386" ]; then
# echo -n "trying i386 " # echo -n "trying i386 "
gcc $TMPC -o $TMPO -march=$proc -mcpu=$proc &> /dev/null || proc=error $_cc $TMPC -o $TMPO -march=$proc -mcpu=$proc &> /dev/null || proc=error
fi fi
if [ "$proc" = "error" ]; then if [ "$proc" = "error" ]; then
echo echo
@ -332,19 +349,19 @@ fi
# check GL & X11 & Xext & Xv & SDL & termcap libs # check GL & X11 & Xext & Xv & SDL & termcap libs
gcc $TMPC -o $TMPO $_x11libdir/ -lGL &> /dev/null && _gl=yes $_cc $TMPC -o $TMPO $_x11libdir/ -lGL &> /dev/null && _gl=yes
gcc $TMPC -o $TMPO $_x11libdir -lX11 -lXext &> /dev/null && _x11=yes $_cc $TMPC -o $TMPO $_x11libdir -lX11 -lXext &> /dev/null && _x11=yes
gcc $TMPC -o $TMPO $_x11libdir -lXv &> /dev/null && _xv=yes $_cc $TMPC -o $TMPO $_x11libdir -lXv &> /dev/null && _xv=yes
gcc $TMPC -o $TMPO $_x11libdir -L/usr/local/lib/ -lpthread &> /dev/null || \ $_cc $TMPC -o $TMPO $_x11libdir -L/usr/local/lib/ -lpthread &> /dev/null || \
{ echo "Lib pthread not found."; rm -f $TMPC $TMPO ; exit 1; } { echo "Lib pthread not found."; rm -f $TMPC $TMPO ; exit 1; }
# SDL disabled by default (0.11pre22-) because of the compilation problems # SDL disabled by default (0.11pre22-) because of the compilation problems
# this is very buggy & experimental code, use it only if you really need it!! # this is very buggy & experimental code, use it only if you really need it!!
_have_sdl=no _have_sdl=no
gcc $TMPC -o $TMPO $_x11libdir -L/usr/local/lib/ -lSDL -lpthread &> /dev/null && _have_sdl=yes $_cc $TMPC -o $TMPO $_x11libdir -L/usr/local/lib/ -lSDL -lpthread &> /dev/null && _have_sdl=yes
_termcap=no _termcap=no
gcc $TMPC -o $TMPO -ltermcap &> /dev/null && _termcap=yes $_cc $TMPC -o $TMPO -ltermcap &> /dev/null && _termcap=yes
_binutils=no _binutils=no
as libac3/downmix/downmix_i386.S -o $TMPO &> /dev/null && _binutils=yes as libac3/downmix/downmix_i386.S -o $TMPO &> /dev/null && _binutils=yes
@ -359,7 +376,7 @@ int main (void) { return 0;}
EOF EOF
_dga=no _dga=no
gcc $TMPC -o $TMPO -L/usr/X11R6/lib -L/usr/X11/lib -lX11 -lXext -lXxf86dga -lXxf86vm &> /dev/null && _dga=yes $_cc $TMPC -o $TMPO -L/usr/X11R6/lib -L/usr/X11/lib -lX11 -lXext -lXxf86dga -lXxf86vm &> /dev/null && _dga=yes
# Note: the -lXxf86vm library is the VideoMode extension and though it's # Note: the -lXxf86vm library is the VideoMode extension and though it's
# not needed for DGA, AFAIK every distribution packages together with DGA # not needed for DGA, AFAIK every distribution packages together with DGA
# stuffs named 'X extensions' or something similar. This check can be usefull # stuffs named 'X extensions' or something similar. This check can be usefull
@ -373,7 +390,7 @@ cat > $TMPC << EOF
int main( void ) { return 0; } int main( void ) { return 0; }
EOF EOF
gcc $TMPC -o $TMPO $_x11libdir/ -lGL &> /dev/null || \ $_cc $TMPC -o $TMPO $_x11libdir/ -lGL &> /dev/null || \
{ _gl=no; echo "GL includes not found!";} { _gl=no; echo "GL includes not found!";}
rm -f $TMPC $TMPO rm -f $TMPC $TMPO
@ -495,11 +512,13 @@ do
--size-y=*) --size-y=*)
_y=`echo $ac_option | cut -d '=' -f 2` _y=`echo $ac_option | cut -d '=' -f 2`
;; ;;
--cc=*)
;;
esac esac
done done
# to screen. # to screen.
echo "Using C compiler: $_cc"
echo "Checking for cpu vendor ... $pvendor ( $pfamily:$pmodel:$pstepping )" echo "Checking for cpu vendor ... $pvendor ( $pfamily:$pmodel:$pstepping )"
echo "Checking for cpu type ... $pname" echo "Checking for cpu type ... $pname"
echo "Optimizing to ... $proc" echo "Optimizing to ... $proc"
@ -571,7 +590,7 @@ cat > $MCONF << EOF
# -------- Generated by ./configure ----------- # -------- Generated by ./configure -----------
AR=ar AR=ar
CC=gcc CC=$_cc
# OPTFLAGS=-O4 -march=$proc -mcpu=$proc -pipe -fomit-frame-pointer -ffast-math # OPTFLAGS=-O4 -march=$proc -mcpu=$proc -pipe -fomit-frame-pointer -ffast-math
OPTFLAGS=-O4 -march=$proc -mcpu=$proc -pipe -ffast-math OPTFLAGS=-O4 -march=$proc -mcpu=$proc -pipe -ffast-math
# LIBS=-L/usr/lib -L/usr/local/lib $_x11libdir $_gllib $_sdllib $_dgalib $_x11lib $_xvlib # LIBS=-L/usr/lib -L/usr/local/lib $_x11libdir $_gllib $_sdllib $_dgalib $_x11lib $_xvlib