comparison configure @ 196:9b82a3ef38ee

added --cc option patch from Bivanbi
author arpi_esp
date Thu, 22 Mar 2001 19:21:32 +0000
parents ddf1ab273f03
children 26d2d4d3331a
comparison
equal deleted inserted replaced
195:452453f82bfa 196:9b82a3ef38ee
4 # MPlayer configurator. (C) 2000 Pontscho/fresh!mindworkz 4 # MPlayer configurator. (C) 2000 Pontscho/fresh!mindworkz
5 # pontscho@makacs.poliod.hu 5 # pontscho@makacs.poliod.hu
6 # 6 #
7 # Changes in reversed order: 7 # Changes in reversed order:
8 # 8 #
9 # 2000/03/08 by LGB: 9 # 2001/03/22 by Bivanbi:
10 # - new option: --cc (to specify C compiler path+name)
11 #
12 # 2001/03/08 by LGB:
10 # - DGA detection-o-matic :) 13 # - DGA detection-o-matic :)
11 # - '--disable-dga' option to force disabling DGA vo driver compiling into mplayer 14 # - '--disable-dga' option to force disabling DGA vo driver compiling into mplayer
12 # - line about '--enable-dga' is added to the help message 15 # - line about '--enable-dga' is added to the help message
13 # 16 #
14 # 2000/02/26 by A'rpi: 17 # 2001/02/26 by A'rpi:
15 # - added DGA option: --enable-dga 18 # - added DGA option: --enable-dga
16 # - no notify if --with-win32libdir used [Tibcu] 19 # - no notify if --with-win32libdir used [Tibcu]
17 # 20 #
18 # 2000/02/25 by LGB: 21 # 2001/02/25 by LGB:
19 # - TMPDIR or TEMPDIR variable is honored during tests for temporary files 22 # - TMPDIR or TEMPDIR variable is honored during tests for temporary files
20 # - ChangeLog inside configure was reversed ;-) 23 # - ChangeLog inside configure was reversed ;-)
21 # 24 #
22 # some changes by A'rpi/ESP-team: 25 # some changes by A'rpi/ESP-team:
23 # - added 'athlon' target for the new athlongcc [Ian Kumlien] 26 # - added 'athlon' target for the new athlongcc [Ian Kumlien]
60 cat << EOF 63 cat << EOF
61 64
62 usage: $0 [options] 65 usage: $0 [options]
63 66
64 params: 67 params:
68 --cc use this C compiler to build MPlayer [gcc]
65 --enable-mmx build with mmx support [autodetect] 69 --enable-mmx build with mmx support [autodetect]
66 --enable-3dnow build with 3dnow! support [autodetect] 70 --enable-3dnow build with 3dnow! support [autodetect]
67 --enable-sse build with sse support [autodetect] 71 --enable-sse build with sse support [autodetect]
68 --enable-gl build with OpenGL render support [autodetect] 72 --enable-gl build with OpenGL render support [autodetect]
69 --enable-dga build with DGA support [autodetect] 73 --enable-dga build with DGA support [autodetect]
113 # --- 117 # ---
114 118
115 # config files 119 # config files
116 CCONF='config.h' 120 CCONF='config.h'
117 MCONF='config.mak' 121 MCONF='config.mak'
122
123 # --- Check for C compiler:
124
125 _cc=gcc
126
127 for ac_option
128 do
129 case "$ac_option" in
130 --cc=*)
131 _cc=`echo $ac_option | cut -d '=' -f 2`
132 ;;
133 esac
134 done
118 135
119 # --- 136 # ---
120 137
121 TAB=`echo -n -e "\t"` 138 TAB=`echo -n -e "\t"`
122 pname=`cat /proc/cpuinfo | grep 'model name' | cut -d ':' -f 2` 139 pname=`cat /proc/cpuinfo | grep 'model name' | cut -d ':' -f 2`
285 # to fall back till 386. 302 # to fall back till 386.
286 303
287 #echo -n "Checking your GCC CPU optimalization abilities: " 304 #echo -n "Checking your GCC CPU optimalization abilities: "
288 if [ "$proc" = "k7" ]; then 305 if [ "$proc" = "k7" ]; then
289 # echo -n "trying k7 " 306 # echo -n "trying k7 "
290 gcc $TMPC -o $TMPO -march=$proc -mcpu=$proc &> /dev/null || proc=athlon 307 $_cc $TMPC -o $TMPO -march=$proc -mcpu=$proc &> /dev/null || proc=athlon
291 fi 308 fi
292 if [ "$proc" = "athlon" ]; then 309 if [ "$proc" = "athlon" ]; then
293 # echo -n "trying athlon " 310 # echo -n "trying athlon "
294 gcc $TMPC -o $TMPO -march=$proc -mcpu=$proc &> /dev/null || proc=k6 311 $_cc $TMPC -o $TMPO -march=$proc -mcpu=$proc &> /dev/null || proc=k6
295 fi 312 fi
296 if [ "$proc" = "k6" ]; then 313 if [ "$proc" = "k6" ]; then
297 # echo -n "trying k6 " 314 # echo -n "trying k6 "
298 gcc $TMPC -o $TMPO -march=$proc -mcpu=$proc &> /dev/null || proc=k5 315 $_cc $TMPC -o $TMPO -march=$proc -mcpu=$proc &> /dev/null || proc=k5
299 fi 316 fi
300 if [ "$proc" = "k5" ]; then 317 if [ "$proc" = "k5" ]; then
301 # echo -n "trying k5 " 318 # echo -n "trying k5 "
302 gcc $TMPC -o $TMPO -march=$proc -mcpu=$proc &> /dev/null || proc=pentium 319 $_cc $TMPC -o $TMPO -march=$proc -mcpu=$proc &> /dev/null || proc=pentium
303 fi 320 fi
304 if [ "$proc" = "i686" ]; then 321 if [ "$proc" = "i686" ]; then
305 # echo -n "trying i686 " 322 # echo -n "trying i686 "
306 gcc $TMPC -o $TMPO -march=$proc -mcpu=$proc &> /dev/null || proc=pentiumpro 323 $_cc $TMPC -o $TMPO -march=$proc -mcpu=$proc &> /dev/null || proc=pentiumpro
307 fi 324 fi
308 if [ "$proc" = "pentiumpro" ]; then 325 if [ "$proc" = "pentiumpro" ]; then
309 # echo -n "trying pentiumpro " 326 # echo -n "trying pentiumpro "
310 gcc $TMPC -o $TMPO -march=$proc -mcpu=$proc &> /dev/null || proc=pentium 327 $_cc $TMPC -o $TMPO -march=$proc -mcpu=$proc &> /dev/null || proc=pentium
311 fi 328 fi
312 if [ "$proc" = "pentium" ]; then 329 if [ "$proc" = "pentium" ]; then
313 # echo -n "trying pentium " 330 # echo -n "trying pentium "
314 gcc $TMPC -o $TMPO -march=$proc -mcpu=$proc &> /dev/null || proc=i486 331 $_cc $TMPC -o $TMPO -march=$proc -mcpu=$proc &> /dev/null || proc=i486
315 fi 332 fi
316 if [ "$proc" = "i486" ]; then 333 if [ "$proc" = "i486" ]; then
317 # echo -n "trying i486 " 334 # echo -n "trying i486 "
318 gcc $TMPC -o $TMPO -march=$proc -mcpu=$proc &> /dev/null || proc=i386 335 $_cc $TMPC -o $TMPO -march=$proc -mcpu=$proc &> /dev/null || proc=i386
319 fi 336 fi
320 if [ "$proc" = "i386" ]; then 337 if [ "$proc" = "i386" ]; then
321 # echo -n "trying i386 " 338 # echo -n "trying i386 "
322 gcc $TMPC -o $TMPO -march=$proc -mcpu=$proc &> /dev/null || proc=error 339 $_cc $TMPC -o $TMPO -march=$proc -mcpu=$proc &> /dev/null || proc=error
323 fi 340 fi
324 if [ "$proc" = "error" ]; then 341 if [ "$proc" = "error" ]; then
325 echo 342 echo
326 echo "Your gcc does not support even \"i386\" for '-march' and '-mcpu'." >&2 343 echo "Your gcc does not support even \"i386\" for '-march' and '-mcpu'." >&2
327 rm -f $TMPC $TMPO 344 rm -f $TMPC $TMPO
330 #echo "DONE (${proc})." 347 #echo "DONE (${proc})."
331 348
332 349
333 # check GL & X11 & Xext & Xv & SDL & termcap libs 350 # check GL & X11 & Xext & Xv & SDL & termcap libs
334 351
335 gcc $TMPC -o $TMPO $_x11libdir/ -lGL &> /dev/null && _gl=yes 352 $_cc $TMPC -o $TMPO $_x11libdir/ -lGL &> /dev/null && _gl=yes
336 gcc $TMPC -o $TMPO $_x11libdir -lX11 -lXext &> /dev/null && _x11=yes 353 $_cc $TMPC -o $TMPO $_x11libdir -lX11 -lXext &> /dev/null && _x11=yes
337 gcc $TMPC -o $TMPO $_x11libdir -lXv &> /dev/null && _xv=yes 354 $_cc $TMPC -o $TMPO $_x11libdir -lXv &> /dev/null && _xv=yes
338 gcc $TMPC -o $TMPO $_x11libdir -L/usr/local/lib/ -lpthread &> /dev/null || \ 355 $_cc $TMPC -o $TMPO $_x11libdir -L/usr/local/lib/ -lpthread &> /dev/null || \
339 { echo "Lib pthread not found."; rm -f $TMPC $TMPO ; exit 1; } 356 { echo "Lib pthread not found."; rm -f $TMPC $TMPO ; exit 1; }
340 357
341 # SDL disabled by default (0.11pre22-) because of the compilation problems 358 # SDL disabled by default (0.11pre22-) because of the compilation problems
342 # this is very buggy & experimental code, use it only if you really need it!! 359 # this is very buggy & experimental code, use it only if you really need it!!
343 _have_sdl=no 360 _have_sdl=no
344 gcc $TMPC -o $TMPO $_x11libdir -L/usr/local/lib/ -lSDL -lpthread &> /dev/null && _have_sdl=yes 361 $_cc $TMPC -o $TMPO $_x11libdir -L/usr/local/lib/ -lSDL -lpthread &> /dev/null && _have_sdl=yes
345 362
346 _termcap=no 363 _termcap=no
347 gcc $TMPC -o $TMPO -ltermcap &> /dev/null && _termcap=yes 364 $_cc $TMPC -o $TMPO -ltermcap &> /dev/null && _termcap=yes
348 365
349 _binutils=no 366 _binutils=no
350 as libac3/downmix/downmix_i386.S -o $TMPO &> /dev/null && _binutils=yes 367 as libac3/downmix/downmix_i386.S -o $TMPO &> /dev/null && _binutils=yes
351 368
352 # LGB: Check DGA 369 # LGB: Check DGA
357 #include <X11/extensions/xf86dga.h> 374 #include <X11/extensions/xf86dga.h>
358 int main (void) { return 0;} 375 int main (void) { return 0;}
359 EOF 376 EOF
360 377
361 _dga=no 378 _dga=no
362 gcc $TMPC -o $TMPO -L/usr/X11R6/lib -L/usr/X11/lib -lX11 -lXext -lXxf86dga -lXxf86vm &> /dev/null && _dga=yes 379 $_cc $TMPC -o $TMPO -L/usr/X11R6/lib -L/usr/X11/lib -lX11 -lXext -lXxf86dga -lXxf86vm &> /dev/null && _dga=yes
363 # Note: the -lXxf86vm library is the VideoMode extension and though it's 380 # Note: the -lXxf86vm library is the VideoMode extension and though it's
364 # not needed for DGA, AFAIK every distribution packages together with DGA 381 # not needed for DGA, AFAIK every distribution packages together with DGA
365 # stuffs named 'X extensions' or something similar. This check can be usefull 382 # stuffs named 'X extensions' or something similar. This check can be usefull
366 # for further mplayer versions to set resolution by mplayer itself. 383 # for further mplayer versions to set resolution by mplayer itself.
367 # If you run into problems, remove '-lXxf86vm'. 384 # If you run into problems, remove '-lXxf86vm'.
371 cat > $TMPC << EOF 388 cat > $TMPC << EOF
372 #include <GL/gl.h> 389 #include <GL/gl.h>
373 int main( void ) { return 0; } 390 int main( void ) { return 0; }
374 EOF 391 EOF
375 392
376 gcc $TMPC -o $TMPO $_x11libdir/ -lGL &> /dev/null || \ 393 $_cc $TMPC -o $TMPO $_x11libdir/ -lGL &> /dev/null || \
377 { _gl=no; echo "GL includes not found!";} 394 { _gl=no; echo "GL includes not found!";}
378 395
379 rm -f $TMPC $TMPO 396 rm -f $TMPC $TMPO
380 397
381 398
493 _x=`echo $ac_option | cut -d '=' -f 2` 510 _x=`echo $ac_option | cut -d '=' -f 2`
494 ;; 511 ;;
495 --size-y=*) 512 --size-y=*)
496 _y=`echo $ac_option | cut -d '=' -f 2` 513 _y=`echo $ac_option | cut -d '=' -f 2`
497 ;; 514 ;;
515 --cc=*)
516 ;;
498 esac 517 esac
499 done 518 done
500 519
501 # to screen. 520 # to screen.
502 521 echo "Using C compiler: $_cc"
503 echo "Checking for cpu vendor ... $pvendor ( $pfamily:$pmodel:$pstepping )" 522 echo "Checking for cpu vendor ... $pvendor ( $pfamily:$pmodel:$pstepping )"
504 echo "Checking for cpu type ... $pname" 523 echo "Checking for cpu type ... $pname"
505 echo "Optimizing to ... $proc" 524 echo "Optimizing to ... $proc"
506 echo "Checking for mmx support ... $_mmx" 525 echo "Checking for mmx support ... $_mmx"
507 echo "Checking for 3dnow support ... $_3dnow" 526 echo "Checking for 3dnow support ... $_3dnow"
569 cat > $MCONF << EOF 588 cat > $MCONF << EOF
570 589
571 # -------- Generated by ./configure ----------- 590 # -------- Generated by ./configure -----------
572 591
573 AR=ar 592 AR=ar
574 CC=gcc 593 CC=$_cc
575 # OPTFLAGS=-O4 -march=$proc -mcpu=$proc -pipe -fomit-frame-pointer -ffast-math 594 # OPTFLAGS=-O4 -march=$proc -mcpu=$proc -pipe -fomit-frame-pointer -ffast-math
576 OPTFLAGS=-O4 -march=$proc -mcpu=$proc -pipe -ffast-math 595 OPTFLAGS=-O4 -march=$proc -mcpu=$proc -pipe -ffast-math
577 # LIBS=-L/usr/lib -L/usr/local/lib $_x11libdir $_gllib $_sdllib $_dgalib $_x11lib $_xvlib 596 # LIBS=-L/usr/lib -L/usr/local/lib $_x11libdir $_gllib $_sdllib $_dgalib $_x11lib $_xvlib
578 X_LIBS=$_x11libdir $_gllib $_sdllib $_dgalib $_x11lib $_xvlib 597 X_LIBS=$_x11libdir $_gllib $_sdllib $_dgalib $_x11lib $_xvlib
579 TERMCAP_LIB=$_libtermcap 598 TERMCAP_LIB=$_libtermcap