comparison configure @ 2943:9cc53b9f76c8

Major cleanups Progressive tests Some tests improved Log file added ...other things I can't remember...
author pl
date Sat, 17 Nov 2001 03:53:05 +0000
parents 5ecae3e4db37
children 92ad139d6a7d
comparison
equal deleted inserted replaced
2942:89b3dd86b50b 2943:9cc53b9f76c8
1 #! /bin/sh 1 #! /bin/sh
2
3 # 2 #
4 # MPlayer configurator. (C) 2000 Pontscho/fresh!mindworkz 3 # Original version (C) 2000 Pontscho/fresh!mindworkz
5 # pontscho@makacs.poliod.hu 4 # pontscho@makacs.poliod.hu
6 # 5 #
7 # Changes in reversed order: 6 # History / Contributors: check the cvs log !
8 # 2001/11/15 by Gabucino
9 # - optional linking parameters for static linking
10 # 7 #
11 # 2001/11/14 by David Holm 8 # Cleanups all over the place (c) 2001 pl
12 # - added --enable-libvo2 for dev purposes
13 # 9 #
14 # 2001/11/14 by Gabucino
15 # - dunno who made the --target option but now it even works
16 # - fixed some Intel arch test for --target
17 # - added static linking with --enable-static
18 # 10 #
19 # 2001/10/26 by al3x 11 # Guidelines:
20 # - added detection of zlib (used by libmpdemux/demux_mov.c) 12 # If the option is named 'opt':
13 # _opt : should have a value in yes/no/auto
14 # _def_opt : '#define ... 1' or '#undef ...' that is: some C code
15 # _ld_opt : ' -L/path/dir -lopt ' that is: some GCC option
16 # _inc_opt : ' -I/path/dir/include '
21 # 17 #
22 # 2001/10/22 by Jeroen Dobbelaere 18 # GOTCHAS:
23 # - added selection of libmad 19 # - config files are currently:
20 # config2.h config2.mak libvo/config2.mak libao2/config2.mak
21 # Gui/config2.mak
22 # - removed xmmp/esd
23 # - removec dvbincdir/madincdir/cssincdir: add them to extraincdir
24 # 24 #
25 # 2001/08/27 by Johannes Feigl 25 #############################################################################
26 # - added manual selection of language 26
27 # 27 # Prefer these macros to full length text !
28 # 2001/08/22 by Nick Kurshev 28 # These macros only return an error code - NO display is done
29 # - added autodetection of local language
30 #
31 # 2001/07/31 by Steve Davies
32 # - added --enable-largefiles
33 #
34 # 2001/07/12 by Juergen Keil
35 # - add support for non-x86 targets
36 # - add autoconf checks for loader/wine
37 # - fix linux 2.2.x kernel check vs. SSE usage
38 #
39 # 2001/07/04 by Juergen Keil
40 # - autodetect the assembler binary used by the GCC C compiler
41 #
42 # 2001/07/03 by Nick Kurshev
43 # - added universal way of configuring SUBDIRS
44 # - moved configurable stuff of depended SUBDIRS to SUBDIRS
45 #
46 # 2001/06/05 by Pontscho
47 # - added alsa and esd detection
48 #
49 # 2001/06/05 by Nick Kurshev
50 # - added checking of kernel version
51 #
52 # 2001/06/04 by Nick Kurshev
53 # - added hard checking of gcc and soft of assembler
54 #
55 # 2001/05/30 by LGB
56 # - added --prefix support
57 #
58 # 2001/05/?? by Juergen Keil
59 # - autodetect OSS & Sun style audio
60 # - cpu feature detection for non-linux x86 systems
61 # - converted from bash to bourne shell script
62 #
63 # 2001/05/22 by Nick Kurshev
64 # - added definition of CPU clone
65 #
66 # 2001/04/16 by LGB
67 # - added libcss stuffs
68 #
69 # 2001/04/15 by Pontscho
70 # - added --disable-select option
71 # - added X11DIR variable in config.mak and fix syncfb Makefile -L/usr/X11/lib bug
72 #
73 # 2001/03/24 by Mike Graffam:
74 # - added autodetect code for XF86VidMode, along with explicit --enable-vm
75 #
76 # 2001/03/22 by Bivanbi:
77 # - new option: --cc (to specify C compiler path+name)
78 #
79 # 2001/03/08 by LGB:
80 # - DGA detect-o-matic :)
81 # - '--disable-dga' option to force disabling DGA vo driver compiling into mplayer
82 # - line about '--enable-dga' is added to the help message
83 #
84 # 2001/02/26 by A'rpi:
85 # - added DGA option: --enable-dga
86 # - no notify if --with-win32libdir used [Tibcu]
87 #
88 # 2001/02/25 by LGB:
89 # - TMPDIR or TEMPDIR variable is honored during tests for temporary files
90 # - ChangeLog inside configure was reversed ;-)
91 #
92 # some changes by A'rpi/ESP-team:
93 # - added 'athlon' target for the new athlongcc [Ian Kumlien]
94 # - applied _win32libdir=-L patch by Magnus Pfeffer
95 #
96 # some changes by LGB:
97 # - Ehhh, AMD K6-2 returns with cpuid 5 ;-) Changing back Arpi's last change :)
98 # More info: AMD K6-2 reports with family 5, duron with 6, so I attached
99 # much finer CPU type detection based on Linux kernel's one :)
100 # (k5: 5, model<6, k6: 5, model>=6, k7: 6, model=any)
101 # - On some exit point (error) temporary files were not deleted. Fixed.
102 # - $TMP and $TMP2 are renamed to $TMPC and $TMPO ;-)
103 # - Some useless { ... } are removed
104 #
105 # some changes by A'rpi/ESP-team:
106 # - the --with-win32libdir patch by Aaron Hope applied
107 # - some english bugfix again :)
108 # - cpu type selection changed:
109 # ( k7->k6->k5-> ) || (i686->pentiumpro-> ) pentium-> i486 -> i386 -> error!
110 # - cpu type for AMD/family=5 changed k6->k5
111 #
112 # some changes by LGB (Gábor Lénárt):
113 # - SOME gcc may support 'k7', so I added tests for ALL CPU type optimization
114 # switches with the ability to find out the best optimization for your CPU.
115 # - Help moved to the begining to avoid tests if user only wants help.
116 # - A one lined help to indicate detailed help for users
117 # - Fixed /tmp race (PIDs can be predicted, I added random numbers as well)
118 #
119 # some changes by A'rpi/ESP-team:
120 # - some english bugfix :)
121 # - removed _??exists flags, _?? is enough...
122 # - creating only config.mak files instead of whole Makefiles
123 #
124 # --
125
126 # SOME MACROS/USEFUL FUNCTIONS
127 # Returns error code only - NO displaye
128 cc_check() { 29 cc_check() {
129 ( "$_cc" "$TMPC" -o "$TMPO" "$@" ) >/dev/null 2>&1 30 cat "$TMPC" >> "$TMPLOG"
130 return "$?" 31 echo >> "$TMPLOG"
32 echo "$_cc $TMPC -o $TMPO $@" >> "$TMPLOG"
33 ( "$_cc" $_inc_extra $_ld_extra "$TMPC" -o "$TMPO" "$@" ) >> "$TMPLOG" 2>&1
34 return "$?"
131 } 35 }
132 36
133 # Display error message, flushes tempfile, exit 37 # Display error message, flushes tempfile, exit
134 die () { 38 die () {
135 echo 39 echo
136 echo "Error: $@" >&2 40 echo "Error: $@" >&2
137 echo >&2 41 echo >&2
138 rm -f "$TMPO" "$TMPC" "$TMPS" "$TMPCPP" 42 rm -f "$TMPO" "$TMPC" "$TMPS" "$TMPCPP"
139 exit 1 43 echo "Check "$TMPLOG" if you don't understand why it failed."
44 exit 1
140 } 45 }
141 46
47 # OS test booleans functions
142 linux() { test "$system_name" = "Linux" ; return "$?" ; } 48 linux() { test "$system_name" = "Linux" ; return "$?" ; }
143 sunos() { test "$system_name" = "SunOS" ; return "$?" ; } 49 sunos() { test "$system_name" = "SunOS" ; return "$?" ; }
144 irix() { test "$system_name" = "IRIX" ; return "$?" ; } 50 irix() { test "$system_name" = "IRIX" ; return "$?" ; }
145 cygwin() { test "$system_name" = "CYGWIN" ; return "$?" ; } 51 cygwin() { test "$system_name" = "CYGWIN" ; return "$?" ; }
146 freebsd() { test "$system_name" = "FreeBSD" ; return "$?" ; } 52 freebsd() { test "$system_name" = "FreeBSD" ; return "$?" ; }
147 netbsd() { test "$system_name" = "NetBSD" ; return "$?" ; } 53 netbsd() { test "$system_name" = "NetBSD" ; return "$?" ; }
148 bsdos() { test "$system_name" = "BSD/OS" ; return "$?" ; } 54 bsdos() { test "$system_name" = "BSD/OS" ; return "$?" ; }
149 openbsd() { test "$system_name" = "OpenBSD" ; return "$?" ; } 55 openbsd() { test "$system_name" = "OpenBSD" ; return "$?" ; }
150 bsd() { freebsd || netbsd || bsdos || openbsd ; return "$?" ; } 56 bsd() { freebsd || netbsd || bsdos || openbsd ; return "$?" ; }
151 57
58 # Use this before starting a check
59 echocheck() {
60 echo "============ Checking for $@ ============" >> "$TMPLOG"
61 echo "$_echo_n" "Checking for $@ ... $_echo_c"
62 }
63
64 # Use this to echo the results of a check
65 echores() {
66 echo "Result is $@" >> "$TMPLOG"
67 echo "##########################################" >> "$TMPLOG"
68 echo "" >> "$TMPLOG"
69 echo "$@"
70 }
71 #############################################################################
152 72
153 # Check how echo works in this /bin/sh 73 # Check how echo works in this /bin/sh
154 case `echo -n` in 74 case `echo -n` in
155 -n) _echo_n= _echo_c='\c';; # seems to be a SysV echo 75 -n) _echo_n='' _echo_c='\c' ;; # SysV echo
156 *) _echo_n=-n _echo_c=;; # OK, a BSD style echo 76 *) _echo_n=-n _echo_c='' ;; # BSD echo
157 esac 77 esac
158 78
159 LANGUAGES=`echo help_mp-??.h | sed "s/help_mp-\(..\).h/\1/g"` 79 LANGUAGES=`echo help_mp-??.h | sed "s/help_mp-\(..\).h/\1/g"`
160 80
161 for parm in "$@" ; do 81 for parm in "$@" ; do
162 if test "$parm" = "--help" || test "$parm" = "-help" || test "$parm" = "-h" ; then 82 if test "$parm" = "--help" || test "$parm" = "-help" || test "$parm" = "-h" ; then
163 cat << EOF 83 cat << EOF
164 84
165 Usage: `basename $0` [OPTIONS]... 85 Usage: $0 [OPTIONS]...
166 86
167 Configuration: 87 Configuration:
168 -h, --help display this help and exit 88 -h, --help display this help and exit
169 89
170 Installation directories: 90 Installation directories:
171 --prefix=DIR use this prefix for installing mplayer [/usr/local] 91 --prefix=DIR use this prefix for installing mplayer [/usr/local]
172 --datadir=DIR use this prefix for installing machine independent 92 --datadir=DIR use this prefix for installing machine independent
173 data [/usr/local/share/mplayer] 93 data [/usr/local/share/mplayer]
174 94
175 Optional features: 95 Optional features:
176 --enable-largefiles enable support for files >2^32 bytes long [disable] 96 --enable-largefiles enable support for files >2^32 bytes long [disable]
177 --enable-termcap use termcap database for key codes [disable] 97 --enable-termcap use termcap database for key codes [disable]
178 --enable-xmmp use XMMP audio drivers [disable] 98 --enable-lirc enable LIRC (remote control) support [disable]
179 --enable-lirc enable LIRC (remote control) support [autodetect]
180 --enable-gui enable GUI [disable] 99 --enable-gui enable GUI [disable]
181 --enable-tv enable TV Interface (tv/dvb grabbers) [disable] 100 --enable-tv enable TV Interface (tv/dvb grabbers) [disable]
182 --disable-win32 disable Win32 DLL support [autodetect] 101 --disable-win32 disable Win32 DLL support [autodetect]
183 --disable-dshow disable DirectShow support (if no C++ compiler and 102 --disable-dshow disable DirectShow support (if no C++ compiler and
184 libs are available or find the dshow codecs slower 103 libs are available or find the dshow codecs slower
185 than the old VfW ones) [autodetect] 104 than the old VfW ones) [autodetect]
186 --disable-xanim disable XAnim DLL support [autodetect] 105 --disable-xanim disable XAnim DLL support [autodetect]
187 --enable-vorbis build with OggVorbis support [autodetect] 106 --enable-vorbis build with OggVorbis support [autodetect]
188 --disable-iconv do not use iconv(3) function [autodetect] 107 --disable-iconv do not use iconv(3) function [autodetect]
189 108
194 --enable-sdl build with SDL render support [autodetect] 113 --enable-sdl build with SDL render support [autodetect]
195 --enable-aa build with AAlib render support [autodetect] 114 --enable-aa build with AAlib render support [autodetect]
196 --enable-ggi build with GGI render support [autodetect] 115 --enable-ggi build with GGI render support [autodetect]
197 --enable-dxr3 build with DXR3/H+ render support [autodetect] 116 --enable-dxr3 build with DXR3/H+ render support [autodetect]
198 --enable-dvb build with support for output via DVB-Card [autodetect] 117 --enable-dvb build with support for output via DVB-Card [autodetect]
199 --enable-mga build with mga_vid support 118 --enable-mga build with mga_vid support
200 (check for /dev/mga_vid) [autodetect] 119 (check for /dev/mga_vid) [autodetect]
201 --enable-xmga build with mga_vid X Window support 120 --enable-xmga build with mga_vid X Window support
202 (check for X & /dev/mga_vid) [autodetect] 121 (check for X & /dev/mga_vid) [autodetect]
203 --enable-xv build with Xv render support for X 4.x [autodetect] 122 --enable-xv build with Xv render support for X 4.x [autodetect]
204 --enable-vm build with XF86VidMode support for x11 driver [disable] 123 --enable-vm build with XF86VidMode support for x11 driver [disable]
208 --enable-mlib build with MLIB support (Solaris only) [disable] 127 --enable-mlib build with MLIB support (Solaris only) [disable]
209 128
210 Audio: 129 Audio:
211 --disable-ossaudio disable OSS sound support [autodetect] 130 --disable-ossaudio disable OSS sound support [autodetect]
212 --disable-alsa disable alsa sound support [autodetect] 131 --disable-alsa disable alsa sound support [autodetect]
213 --disable-esd disable esd sound support [autodetect]
214 --disable-sunaudio disable Sun sound support [autodetect] 132 --disable-sunaudio disable Sun sound support [autodetect]
215 --disable-mad disable mad audio support [autodetect] 133 --disable-mad disable mad audio support [autodetect]
216 134
217 Miscellaneous options: 135 Miscellaneous options:
218 --cc=COMPILER use this C compiler to build MPlayer [gcc] 136 --cc=COMPILER use this C compiler to build MPlayer [gcc]
234 --enable-sse build with sse support [autodetect] 152 --enable-sse build with sse support [autodetect]
235 --disable-fastmemcpy disable 3dnow/sse/mmx optimized memcpy() [enable] 153 --disable-fastmemcpy disable 3dnow/sse/mmx optimized memcpy() [enable]
236 --enable-debug[=1-3] compile debugging information into mplayer [disable] 154 --enable-debug[=1-3] compile debugging information into mplayer [disable]
237 --enable-profile compile profiling information into mplayer [disable] 155 --enable-profile compile profiling information into mplayer [disable]
238 156
239 Hazardous options: 157 Hazardous options a.k.a. "DO NOT BUGREPORT ANYTHING !"
240 If you ever use one of these options, DO NOT BUGREPORT ANYTHING !
241 --disable-gcc-checking disable gcc version checking 158 --disable-gcc-checking disable gcc version checking
242 --disable-kernel-extchk disables checking for CPU extension support in
243 your kernel (MMX, SSE, ...)
244 159
245 Use these options if autodetection fails: 160 Use these options if autodetection fails:
161 --with-extraincdir=DIR extra headers (png, dvb, mad, sdl, css, ...) in DIR
162 --with-extralibdir=DIR extra library files (png, SDL, ...) in DIR
163 --with-x11incdir=DIR X headers in DIR
246 --with-x11libdir=DIR X library files in DIR 164 --with-x11libdir=DIR X library files in DIR
247 --with-x11incdir=DIR X headers in DIR
248 --with-win32libdir=DIR W*ndows DLL files in DIR 165 --with-win32libdir=DIR W*ndows DLL files in DIR
249 --with-xanimlibdir=DIR XAnim DLL files in DIR 166 --with-xanimlibdir=DIR XAnim DLL files in DIR
250 --with-csslibdir=DIR 'libcss.so' (libcss shared lib.) in DIR 167 --with-csslibdir=DIR 'libcss.so' in DIR
251 --with-cssincdir=DIR 'css.h' (libcss header file) in DIR
252 --with-sdl-config=PATH path to sdl*-config (e.g.: /opt/bin/sdl-config) 168 --with-sdl-config=PATH path to sdl*-config (e.g.: /opt/bin/sdl-config)
253 --with-gtk-config=PATH path to gtk*-config (e.g.: /opt/bin/gtk-config) 169 --with-gtk-config=PATH path to gtk*-config (e.g.: /opt/bin/gtk-config)
254 --with-glib-config=PATH path to glib*-config (e.g.: /opt/bin/glib-config) 170 --with-glib-config=PATH path to glib*-config (e.g.: /opt/bin/glib-config)
255 --with-extralibdir=DIR extra library files (png, SDL, ...) in DIR
256 --with-extraincdir=DIR extra headers (png, SDL) are in DIR
257 --with-dvbincdir=DIR dvb-driver files in DIR
258 --with-madlibdir=DIR 'libmad.so' (libmad shared lib.) in DIR 171 --with-madlibdir=DIR 'libmad.so' (libmad shared lib.) in DIR
259 --with-madincdir=DIR 'mad.h' (libmad header file) in DIR
260 172
261 EOF 173 EOF
262 exit 0 174 exit 0
263 fi 175 fi
264 done # for parm in ... 176 done # for parm in ...
265 177
178
179 # 1st pass checking for vital options
266 _cc=gcc 180 _cc=gcc
267 test "$CC" && _cc="$CC" 181 test "$CC" && _cc="$CC"
268
269 _as=auto 182 _as=auto
270 _x11=auto
271 _sdlconfig=
272 _gtkconfig=
273 _glibconfig=
274
275 for ac_option do 183 for ac_option do
276 case "$ac_option" in 184 case "$ac_option" in
277 --enable-static)
278 _static="-static"
279 ;;
280 --enable-static=*)
281 _static="-static `echo $ac_option | cut -d '=' -f 2`"
282 ;;
283 --target=*) 185 --target=*)
284 _target=`echo $ac_option | cut -d '=' -f 2` 186 _target=`echo $ac_option | cut -d '=' -f 2`
285 ;; 187 ;;
286 --cc=*) 188 --cc=*)
287 _cc=`echo $ac_option | cut -d '=' -f 2` 189 _cc=`echo $ac_option | cut -d '=' -f 2`
288 ;; 190 ;;
289 --as=*) 191 --as=*)
290 _as=`echo $ac_option | cut -d '=' -f 2` 192 _as=`echo $ac_option | cut -d '=' -f 2`
291 ;; 193 ;;
292 --language=*)
293 LINGUAS=`echo $ac_option | cut -d '=' -f 2`
294 ;;
295 --disable-gcc-checking) 194 --disable-gcc-checking)
296 _skip_cc_check=yes 195 _skip_cc_check=yes
297 ;; 196 ;;
298 --disable-as-checking) 197 --with-extraincdir=*)
299 _skip_as_check=yes 198 _inc_extra=-I`echo $ac_option | cut -d '=' -f 2 | sed 's,:, -I,g'`
300 ;; 199 ;;
301 --with-x11libdir=*)
302 _x11libdir=-L`echo $ac_option | cut -d '=' -f 2`
303 ;;
304 --with-x11incdir=*)
305 _x11incdir=-I`echo $ac_option | cut -d '=' -f 2`
306 ;;
307 --enable-x11)
308 _x11=yes
309 ;;
310 --disable-x11)
311 _x11=no
312 ;;
313 --with-sdl-config=*)
314 _sdlconfig=`echo $ac_option | cut -d '=' -f 2`
315 ;;
316 --with-gtk-config=*)
317 _gtkconfig=`echo $ac_option | cut -d '=' -f 2`
318 ;;
319 --with-glib-config=*)
320 _glibconfig=`echo $ac_option | cut -d '=' -f 2`
321 ;;
322 --with-extralibdir=*) 200 --with-extralibdir=*)
323 _extralibdir=-L`echo $ac_option | cut -d '=' -f 2 | sed 's,:, -L,g'` 201 _ld_extra=-L`echo $ac_option | cut -d '=' -f 2 | sed 's,:, -L,g'`
324 ;; 202 ;;
325 --with-extraincdir=*) 203 esac
326 _extraincdir=-I`echo $ac_option | cut -d '=' -f 2 | sed 's,:, -I,g'`
327 ;;
328 --with-dvbincdir=*)
329 _dvbincdir=-I`echo $ac_option | cut -d '=' -f 2 | sed 's,:, -I,g'`
330 ;;
331 --with-madlibdir=*)
332 _madlibdir=-L`echo $ac_option | cut -d '=' -f 2 | sed 's,:, -L,g'`
333 ;;
334 --with-madincdir=*)
335 _madincdir=-I`echo $ac_option | cut -d '=' -f 2 | sed 's,:, -I,g'`
336 ;;
337 esac
338 done 204 done
339 205
340 # LGB: Some inital help
341
342 cat <<EOF
343
344 You can get detailed help on configure with: `basename $0` --help
345
346 Please wait while ./configure discovers your software and hardware environment!
347
348 EOF
349 206
350 # Determine our OS name and CPU architecture 207 # Determine our OS name and CPU architecture
351 if test -z "$_target" ; then 208 if test -z "$_target" ; then
352 # OS name 209 # OS name
353 system_name=`( uname -s ) 2>&1` 210 system_name=`( uname -s ) 2>&1`
354 case "$system_name" in 211 case "$system_name" in
355 Linux|FreeBSD|NetBSD|BSD/OS|OpenBSD|SunOS) 212 Linux|FreeBSD|NetBSD|BSD/OS|OpenBSD|SunOS)
356 : # well-known OSes 213 ;;
357 ;; 214 IRIX*)
358 IRIX*) 215 system_name=IRIX
359 system_name=IRIX 216 ;;
360 ;; 217 [cC][yY][gG][wW][iI][nN]*)
361 [cC][yY][gG][wW][iI][nN]*) 218 system_name=CYGWIN
362 system_name=CYGWIN 219 ;;
363 ;; 220 *)
364 *) 221 system_name="$system_name-UNKNOWN"
365 system_name="$system_name-UNKNOWN" 222 ;;
366 ;; 223 esac
367 esac 224
368 225
369 226 # host's CPU/instruction set
370 # host's CPU/instruction set
371 host_arch=`( uname -p ) 2>&1` 227 host_arch=`( uname -p ) 2>&1`
372 case "$host_arch" in 228 case "$host_arch" in
373 i386|sparc|ppc|alpha|arm|mips) 229 i386|sparc|ppc|alpha|arm|mips)
374 # fine, uname -p output looks good, it has returned 230 ;;
375 # something this configure script recognizes 231
376 ;; 232 *) # uname -p on Linux returns 'unknown' for the processor type,
377 233 # OpenBSD returns 'Intel Pentium/MMX ("Genuine Intel" 586-class)'
378 *) # uname -p on Linux returns 'unknown' for the processor type, 234
379 # OpenBSD returns 'Intel Pentium/MMX ("Genuine Intel" 586-class)' 235 # Maybe uname -m (machine hardware name) returns something we
380 236 # recognize.
381 # Maybe uname -m (machine hardware name) returns something we 237
382 # recognize. 238 case "`( uname -m ) 2>&1`" in
383 239 i[3-9]86) host_arch=i386 ;;
384 case "`uname -m 2>&1`" in 240 ppc) host_arch=ppc ;;
385 i[3-9]86) 241 alpha) host_arch=alpha ;;
386 host_arch=i386;; 242 sparc*) host_arch=sparc ;;
387 ppc) 243 arm*) host_arch=arm ;;
388 host_arch=ppc;; 244 *) host_arch=UNKNOWN ;;
389 alpha) 245 esac
390 host_arch=alpha;; 246 ;;
391 sparc*) 247 esac
392 host_arch=sparc;; 248 else
393 arm*) 249 system_name=`echo $_target | cut -d '-' -f 2`
394 host_arch=arm;; 250 host_arch=`echo $_target | cut -d '-' -f 1`
395 esac
396 ;;
397 esac
398 else
399 system_name=`echo $_target | cut -d '-' -f 2`
400 host_arch=`echo $_target | cut -d '-' -f 1`
401 fi 251 fi
402 252
403 echo "Detected operating system: $system_name" 253 echo "Detected operating system: $system_name"
404 echo "Detected host architecture: $host_arch" 254 echo "Detected host architecture: $host_arch"
405 255
406 # Determine OS dependent libs
407 _confcygwin="TARGET_CYGWIN=no"
408 _confwin32=
409 if bsd ; then
410 _archlibs="-rdynamic -pthread"
411 elif cygwin ; then
412 _confcygwin="TARGET_CYGWIN=yes"
413 _confwin32="#define WIN32"
414 _archlibs="-lpthread"
415 else
416 _archlibs="-ldl -lpthread"
417 fi
418
419 if bsdos ; then
420 _archlibs="$_archlibs -ldvd"
421 fi
422
423 # LGB: temporary files 256 # LGB: temporary files
424 for I in "$TMPDIR" "$TEMPDIR" "/tmp" ; do 257 for I in "$TMPDIR" "$TEMPDIR" "/tmp" ; do
425 test "$I" && break 258 test "$I" && break
426 done 259 done
427 TMPC="$I/mplayer-conf-$RANDOM-$RANDOM-$$.c" 260
428 TMPCPP="$I/mplayer-conf-$RANDOM-$RANDOM-$$.cpp" 261 # FIXME use this when debug phases is over:
429 TMPO="$I/mplayer-conf-$RANDOM-$RANDOM-$$.o" 262 # TMPLOG="$I/configure2-$RANDOM-$$.log"
430 TMPS="$I/mplayer-conf-$RANDOM-$RANDOM-$$.S" 263 TMPLOG="configure2.log"
431 264 rm -f "$TMPLOG"
432 # --- 265 TMPC="$I/mplayer-conf-$RANDOM-$$.c"
266 TMPCPP="$I/mplayer-conf-$RANDOM-$$.cpp"
267 TMPO="$I/mplayer-conf-$RANDOM-$$.o"
268 TMPS="$I/mplayer-conf-$RANDOM-$$.S"
433 269
434 # config files 270 # config files
435 CCONF='config.h' 271
436 MCONF='config.mak' 272 # FIXME: A lot of stuff is installed under /usr/local
437 CHELP='help_mp.h' 273 # NK: But we should never use this stuff implicitly since we call compiler
438 274 # from /usr we should be sure that there no effects from other compilers
439 if test -z "$_x11libdir" ; then 275 # (libraries) which might be installed into /usr/local. Let users use this
440 for I in /usr/X11R6/lib /usr/X11/lib /usr/lib32 /usr/openwin/lib ; do 276 # stuff explicitly as command line argument. In other words: It would be
441 if test -d "$I" ; then 277 # resonable have or only /usr/include or only /usr/local/include.
442 _x11libdir="-L$I"
443 break;
444 fi
445 done
446 fi
447
448 if test -z "$_x11incdir" ; then
449 for I in /usr/include /usr/X11R6/include /usr/X11/include /usr/openwin/include ; do
450 if test -d "$I/X11" ; then
451 if test "$I" != /usr/include; then
452 _x11incdir="-I$I"
453 fi
454 break
455 fi
456 done
457 fi
458
459 # Lots of stuff are installed under /usr/local
460 # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
461 # NK: But we should never use this stuff implicitly
462 # since we call compiler from /usr we should be sure
463 # that there no effects from other compilers (libraries)
464 # which might be installed into /usr/local.
465 # Let users use this stuff explicitly as command line argument.
466 # In other words: It would be resonable have or only /usr/include
467 # or only /usr/local/include.
468 278
469 if freebsd ; then 279 if freebsd ; then
470 _extralibdir=-L/usr/local/lib 280 _ld_extra="$_ld_extra -L/usr/local/lib"
471 _extraincdir=-I/usr/local/include 281 _inc_extra="$_inc_extra -I/usr/local/include"
472 fi 282 fi
473 283
474 test -z "$_extralibdir" && _extralibdir=-L/usr/lib
475 test -z "$_extraincdir" && _extraincdir=-I/usr/include
476
477 # ---
478 284
479 # Checking CC version... 285 # Checking CC version...
480 # gcc-3.0 merges optimizations coming from egcs, pgcc, agcc, ... 286 # gcc-3.0 merges optimizations coming from egcs, pgcc, agcc, ...
481 if test "$_skip_cc_check" != yes ; then 287 if test "$_skip_cc_check" != yes ; then
482 echo $_echo_n "Checking version of $_cc ... $_echo_c" 288 echocheck "$_cc version"
483 cc_version=`$_cc -v 2>&1 | sed -n 's/^.*version \([aegcygnustp-]*[0-9.]*\).*$/\1/p'` 289 cc_version=`$_cc -v 2>&1 | sed -n 's/^.*version \([aegcygnustp-]*[0-9.]*\).*$/\1/p'`
484 case $cc_version in 290 case $cc_version in
485 '') cc_version="v. ?.??, bad"; cc_verc_fail=yes;; 291 '')
292 cc_version="v. ?.??, bad"
293 cc_verc_fail=yes
294 ;;
486 2.95.[2-9]|2.95.[2-9].[0-9]|3.[0-9]|3.[0-9].[0-9]) 295 2.95.[2-9]|2.95.[2-9].[0-9]|3.[0-9]|3.[0-9].[0-9])
487 cc_version="$cc_version, ok";; 296 cc_version="$cc_version, ok"
488 *) cc_version="$cc_version, bad"; cc_verc_fail=yes;; 297 ;;
489 esac 298 *)
490 echo "$cc_version" 299 cc_version="$cc_version, bad"
491 if test "$cc_verc_fail" ; then 300 cc_verc_fail=yes
492 cat <<EOF 301 ;;
302 esac
303 echores "$cc_version"
304 if test "$cc_verc_fail" ; then
305 cat <<EOF
493 306
494 *** Please downgrade/upgrade C compiler to gcc-2.95.x or gcc-3.x version! *** 307 *** Please downgrade/upgrade C compiler to gcc-2.95.x or gcc-3.x version! ***
495 308
496 You're using a different compiler than us, and we don't have the time to make 309 You are using a different compiler than ours. We do not have the time to make
497 sure everything works with every compiler out there. Please either use the 310 sure everything works with compilers than the one we use. Use either use the
498 same compiler we do, or use --disable-gcc-checking but DO *NOT* report bugs 311 same compiler as ours, or use --disable-gcc-checking but DO *NOT* REPORT BUGS
499 unless you can reproduce them after recompiling with 2.95.x or 3.x version! 312 unless you can reproduce them after recompiling with 2.95.x or 3.0.x version!
500 313
501 Note for gcc 2.96 users: there were and are problems with this version! 314 Note for gcc 2.96 users: some versions of this compiler are known to miscompile
502 If you get compile errors, first upgrade to the latest 2.96 release 315 mplayer and lame (which is used for mencoder). If you get compile errors,
503 (but minimum 2.96-85) and try again. If the problem still exists, try with 316 first upgrade to the latest 2.96 release (but minimum 2.96-85) and try again.
504 gcc 3.x (or 2.95.x) *BEFORE* reporting bugs! gcc 2.96 is TOTALLY UNSUPPORTED 317 If the problem still exists, try with gcc 3.0.x (or 2.95.x) *BEFORE* reporting
505 by us! *** For details please read DOCS/gcc-2.96-3.0.html *** 318 bugs!
506 319
507 EOF 320 GCC 2.96 IS NOT AND WILL NOT BE SUPPORTED BY US !
508 die "Bad gcc version" 321
509 fi 322 *** For details please read DOCS/gcc-2.96-3.0.html ***
510 else 323
511 # echo "YOU'VE SELECTED '--disable-gcc-checking'. PLEASE DON'T SEND US ANY BUGREPORTS!" 324 EOF
512 325 die "Bad gcc version"
326 fi
327 else
513 cat <<EOF 328 cat <<EOF
514 329
515 ****************************************************************************** 330 ******************************************************************************
516 331
517 Hmm. You really want to compile MPlayer with an *UNSUPPORTED* C compiler? 332 Hmm. You really want to compile MPlayer with an *UNSUPPORTED* C compiler?
518 Ok. You know. Do it. But did you already read DOCS/gcc-2.96-3.0.html ??? 333 Ok. You know. Do it. But did you already read DOCS/gcc-2.96-3.0.html ???
519 334
520 DO NOT SEND BUGREPORTS OR COMPLAIN, it's *YOUR* fault! (exactly compiler's) 335 DO NOT SEND BUGREPORTS OR COMPLAIN, it's *YOUR* compiler's fault!
521 Get ready for mysterious crashes, no-picture bugs, strange noises... REALLY! 336 Get ready for mysterious crashes, no-picture bugs, strange noises... REALLY!
337 Lame which is used by mencoder produces weird errors, too.
522 338
523 If you have any problem, then install GCC 2.95.x or 3.x version and try again. 339 If you have any problem, then install GCC 2.95.x or 3.x version and try again.
524 If the problem _still_ exists, then read DOCS/bugreports.html ! 340 If the problem _still_ exists, then read DOCS/bugreports.html !
525 341
342 *** DO NOT SEND BUGREPORTS OR COMPLAIN it's *YOUR* compiler's fault! ***
343
526 ****************************************************************************** 344 ******************************************************************************
527 345
528 EOF 346 EOF
529 347
530 read _answer 348 read _answer
531
532 # if test "$_answer" != "gcc 2.96 is broken" ; then
533 # die "Wrong answer. Next time try 'gcc 2.96 is broken'. But you'd better to downgrade."
534 # fi
535 349
536 fi 350 fi
537 # --- 351 # ---
538 352
539 # now that we know what compiler should be used for compilation, try to find 353 # now that we know what compiler should be used for compilation, try to find
540 # out which assembler is used by the $_cc compiler 354 # out which assembler is used by the $_cc compiler
541 if test "$_as" = auto ; then 355 if test "$_as" = auto ; then
542 _as=`$_cc -print-prog-name=as` 356 _as=`$_cc -print-prog-name=as`
543 if test -z "$_as" ; then 357 test -z "$_as" && _as=as
544 _as=as 358 fi
545 fi 359
546 fi 360 # Try to find the available options for the current CPU
547 361 if test "$host_arch" = i386 ; then
548 if test "$host_arch" = i386 || test "$host_arch" = i486 || test "$host_arch" = i586 || test "$host_arch" = i686; then 362 if test -r /proc/cpuinfo ; then
549 if test -r /proc/cpuinfo ; then 363 # linux with /proc mounted, extract cpu information from it
550 # linux with /proc mounted, extract cpu information from it 364 _cpuinfo="cat /proc/cpuinfo"
551 _cpuinfo="cat /proc/cpuinfo" 365 elif test -r /compat/linux/proc/cpuinfo ; then
552 elif test -r /compat/linux/proc/cpuinfo ; then 366 # FreeBSD with linux emulation /proc mounted,
553 # FreeBSD with linux emulation /proc mounted, 367 # extract cpu information from it
554 # extract cpu information from it 368 _cpuinfo="cat /compat/linux/proc/cpuinfo"
555 _cpuinfo="cat /compat/linux/proc/cpuinfo" 369 else
556 else 370 # all other OS try to extract cpu information from a small helper
557 # all other OS try to extract cpu information from a small helper 371 # program TOOLS/cpuinfo instead
558 # program TOOLS/cpuinfo instead 372 $_cc -o TOOLS/cpuinfo TOOLS/cpuinfo.c
559 $_cc -o TOOLS/cpuinfo TOOLS/cpuinfo.c 373 _cpuinfo="TOOLS/cpuinfo"
560 _cpuinfo="TOOLS/cpuinfo" 374 fi
561 fi 375
562 376 pname=`$_cpuinfo | grep 'model name' | cut -d ':' -f 2 | head -1`
563 pname=`$_cpuinfo | grep 'model name' | cut -d ':' -f 2 | head -1` 377 pvendor=`$_cpuinfo | grep 'vendor_id' | cut -d ':' -f 2 | cut -d ' ' -f 2 | head -1`
564 pparam=`$_cpuinfo | grep 'features' | cut -d ':' -f 2 | head -1` 378 pfamily=`$_cpuinfo | grep 'cpu family' | cut -d ':' -f 2 | cut -d ' ' -f 2 | head -1`
565 if test -z "$pparam" ; then 379 pmodel=`$_cpuinfo | grep -v 'model name' | grep 'model' | cut -d ':' -f 2 | cut -d ' ' -f 2 | head -1`
566 pparam=`$_cpuinfo | grep 'flags' | cut -d ':' -f 2 | head -1` 380 pstepping=`$_cpuinfo | grep 'stepping' | cut -d ':' -f 2 | cut -d ' ' -f 2 | head -1`
567 fi 381
568 pvendor=`$_cpuinfo | grep 'vendor_id' | cut -d ':' -f 2 | cut -d ' ' -f 2 | head -1` 382 pparam=`$_cpuinfo | grep 'features' | cut -d ':' -f 2 | head -1`
569 pfamily=`$_cpuinfo | grep 'cpu family' | cut -d ':' -f 2 | cut -d ' ' -f 2 | head -1` 383 if test -z "$pparam" ; then
570 pmodel=`$_cpuinfo | grep -v 'model name' | grep 'model' | cut -d ':' -f 2 | cut -d ' ' -f 2 | head -1` 384 pparam=`$_cpuinfo | grep 'flags' | cut -d ':' -f 2 | head -1`
571 pstepping=`$_cpuinfo | grep 'stepping' | cut -d ':' -f 2 | cut -d ' ' -f 2 | head -1` 385 fi
572 else 386
573 # not an x86 host, cpuinfo stuff is not relevant 387 _mmx=no
574 pname= pparam= pvendor= pfamily= pmodel= pstepping= 388 _3dnow=no
575 fi 389 _3dnowex=no
576 390 _mmx2=no
577 _mmx=no 391 _sse=no
578 _mmx2=no 392 _sse2=no
579 _3dnow=no 393
580 _3dnowex=no 394 for i in $pparam ; do
581 _mtrr=no 395 case "$i" in
582 _sse=no 396 3dnow) _3dnow=yes ;;
583 _vo2=no 397 3dnowext) _3dnow=yes _3dnowex=yes ;;
584 398 mmx) _mmx=yes ;;
585 _mga=no 399 mmxext) _mmx2=yes ;;
586 _gl=no 400 mtrr|k6_mtrr) _mtrr=yes ;;
587 _sdl=no 401 xmm|sse|kni) _sse=yes _mmx2=yes ;;
588 _aa=no 402 esac
589 _ggi=no
590 _xv=no
591 _vm=no
592 _xinerama=no
593 _xdpms_3=no
594 _xdpms_4=no
595 _3dfx=no
596 _tdfxfb=no
597 _syncfb=no
598 _mlib=no _mlibdir=/opt/SUNWmlib
599 _xmga=autodetect
600 _dga=no
601 _dga2=no
602 _svga=no
603 _fbdev=no
604 _dvb=no
605 _dxr3=no
606 linux && _fbdev=yes
607 _lirc=no
608 _css=no
609 _dvdread=no
610 _win32=no
611 _dshow=no
612 _xanim=yes
613 if test x"$host_arch" = x"i386" -o x"$host_arch" = x"i486" -o x"$host_arch" = x"i586" -o x"$host_arch" = x"i686" ; then
614 _win32=yes ; _dshow=yes
615 fi
616 _fastmemcpy=yes
617 _streaming=no
618 _libavcodec=no
619 _libavcodec_so=no
620 _kernelextcheck=yes
621
622 _x=1
623 _y=1
624
625 _gllib=
626 _sdllib=
627 _sdlcflags=
628 _aalib=
629 _ggilib=
630 _xvlib=
631 _x11lib=
632 _xineramalib=
633 _iconvlib=
634 _dxr3lib=
635 _volib=
636
637 _select='#define HAVE_AUDIO_SELECT'
638
639 _gui=no
640
641 _tv=no
642
643 _alsa=yes
644 _esd=yes
645 _mad=yes
646
647 for i in $pparam; do
648
649 case "$i" in
650 3dnow)
651 _3dnow=yes
652 ;;
653 3dnowext)
654 _3dnow=yes
655 _3dnowex=yes
656 ;;
657 mmx)
658 _mmx=yes
659 ;;
660 mmxext)
661 _mmx2=yes
662 ;;
663 mtrr|k6_mtrr)
664 _mtrr=yes
665 ;;
666 xmm|sse|kni)
667 _sse=yes
668 _mmx2=yes
669 ;;
670 esac
671
672 done
673
674
675 # Check for win32 codecs directory
676 _win32libdir=
677 if test "$_win32" = yes ; then
678 for I in /usr/local/lib/win32 /usr/lib/win32 ; do
679 if test -d "$I" ; then
680 _win32libdir="$I"
681 break;
682 fi;
683 done 403 done
684 fi 404
685 405 echocheck "CPU vendor"
686 _xanimlibdir= 406 echores "$pvendor ($pfamily:$pmodel:$pstepping)"
687 if test "$_xanim" = yes ; then 407
688 for I in /usr/local/lib/xanim/mods /usr/lib/xanim/mods ; do 408 echocheck "CPU type"
689 if test -d "$I" ; then 409 echores "$pname"
690 _xanimlibdir="$I" 410
691 break; 411 fi
692 fi; 412
693 done 413
694 fi
695
696 if test -d libavcodec && test -f libavcodec/Makefile ; then
697 _libavcodec=yes
698 fi
699
700 #Checking for libffmpeg.so
701 cat > $TMPC << EOF
702 #include <libffmpeg/avcodec.h>
703 int main( void ) { return 0; }
704 EOF
705 cc_check $_extraincdir $_extralibdir -lffmpeg -lm && _libavcodec_so=yes
706
707 if test -c /dev/mga_vid ; then
708 _mga=yes
709 _syncfb=yes
710 fi
711
712 if test -c /dev/ost/video ; then
713 _dvb=yes
714 fi
715
716 if test -c /dev/lirc ; then
717 _lirc=yes
718 fi
719
720 cat > $TMPC << EOF
721 int main( void ) { return 0; }
722 EOF
723 414
724 case "$host_arch" in 415 case "$host_arch" in
725 i386|i486|i586|i686) 416 i386)
726 _arch="#define ARCH_X86 1" 417 _def_arch="#define ARCH_X86 1"
727 _target_arch="TARGET_ARCH_X86=yes" 418 _target_arch="TARGET_ARCH_X86 = yes"
728 _words_endian="#undef WORDS_BIGENDIAN" 419 _def_words_endian="#undef WORDS_BIGENDIAN"
729 proc=pentium 420 iproc=586
730 iproc=586 421 proc=pentium
731 422
732 case "$pvendor" in 423 case "$pvendor" in
733 AuthenticAMD) 424 AuthenticAMD)
734 case "$pfamily" in 425 case "$pfamily" in
735 3) 426 3) proc=i386 iproc=386 ;;
736 proc=i386 427 4) proc=i486 iproc=486 ;;
737 iproc=386 428 5) proc=k5 iproc=586 # LGB: models are: K5/SSA5 K5 K5 K5 ? ? K6 K6 K6-2 K6-3
738 ;; 429 test "$pmodel" -ge 6 && proc=k6 ;;
739 4) 430 6|7) proc=k7 iproc=686 ;;
740 proc=i486 431 *) proc=pentium iproc=586 ;;
741 iproc=486
742 ;;
743 5)
744 if test "$pmodel" -ge 6 ; then # LGB: models are: K5/SSA5 K5 K5 K5 ? ? K6 K6 K6-2 K6-3
745 proc=k6
746 else
747 proc=k5
748 fi
749 iproc=586
750 ;;
751 6|7) # LGB: Though it seems Athlon CPUs returns with "6"
752 proc=k7
753 iproc=686
754 ;;
755 *)
756 proc=pentium
757 iproc=586
758 ;;
759 esac
760 ;;
761 GenuineIntel)
762 case "$pfamily" in
763 3)
764 proc=i386
765 iproc=386
766 ;;
767 4)
768 proc=i486
769 iproc=486
770 ;;
771 5)
772 proc=pentium
773 iproc=586
774 ;;
775 6)
776 proc=i686
777 iproc=686
778 ;;
779 *)
780 proc=pentium
781 iproc=586
782 ;;
783 esac
784 ;;
785 unknown) # added by Gabucino - upon Tibcu's request
786 case "$pfamily" in
787 3)
788 proc=i386
789 iproc=386
790 ;;
791 4)
792 proc=i486
793 iproc=486
794 ;;
795 *)
796 proc=pentium
797 iproc=586
798 ;;
799 esac
800 ;;
801 *)
802 proc=pentium
803 iproc=586
804 ;;
805 esac 432 esac
433 ;;
434 GenuineIntel)
435 case "$pfamily" in
436 3) proc=i386 iproc=386 ;;
437 4) proc=i486 iproc=486 ;;
438 5) proc=pentium iproc=586 ;;
439 6) proc=i686 iproc=686 ;;
440 *) proc=pentium iproc=586 ;;
441 esac
442 ;;
443 unknown)
444 case "$pfamily" in
445 3) proc=i386 iproc=386 ;;
446 4) proc=i486 iproc=486 ;;
447 *) proc=pentium iproc=586 ;;
448 esac
449 ;;
450 *)
451 proc=pentium iproc=586 ;;
452 esac
806 453
807 # check that gcc supports our cpu, if not, fallback to pentium 454 # check that gcc supports our cpu, if not, fallback to pentium
808 # LGB: check -mcpu and -march swithing step by step with enabling 455 # LGB: check -mcpu and -march swithing step by step with enabling
809 # to fall back till 386. 456 # to fall back till 386.
810 457
811 #echo -n "Checking your GCC CPU optimalization abilities: " 458 echocheck "GCC & CPU optimization abilities"
459 cat > $TMPC << EOF
460 int main(void) { return 0; }
461 EOF
462
812 if test "$proc" = "k7" ; then 463 if test "$proc" = "k7" ; then
813 cc_check -march=$proc -mcpu=$proc || proc=athlon 464 cc_check -march=$proc -mcpu=$proc || proc=athlon
814 fi 465 fi
815 if test "$proc" = "athlon" ; then 466 if test "$proc" = "athlon" ; then
816 cc_check -march=$proc -mcpu=$proc || proc=pentiumpro 467 cc_check -march=$proc -mcpu=$proc || proc=pentiumpro
817 fi 468 fi
818 if test "$proc" = "k6" ; then 469 if test "$proc" = "k6" ; then
819 cc_check -march=$proc -mcpu=$proc || proc=k5 470 cc_check -march=$proc -mcpu=$proc || proc=k5
820 fi 471 fi
821 if test "$proc" = "k5" ; then 472 if test "$proc" = "k5" ; then
822 cc_check -march=$proc -mcpu=$proc || proc=pentium 473 cc_check -march=$proc -mcpu=$proc || proc=pentium
823 fi 474 fi
824 if test "$proc" = "i686" ; then 475 if test "$proc" = "i686" ; then
825 cc_check -march=$proc -mcpu=$proc || proc=pentiumpro 476 cc_check -march=$proc -mcpu=$proc || proc=pentiumpro
826 fi 477 fi
827 if test "$proc" = "pentiumpro" ; then 478 if test "$proc" = "pentiumpro" ; then
828 cc_check -march=$proc -mcpu=$proc || proc=pentium 479 cc_check -march=$proc -mcpu=$proc || proc=pentium
829 fi 480 fi
830 if test "$proc" = "pentium" ; then 481 if test "$proc" = "pentium" ; then
831 cc_check -march=$proc -mcpu=$proc || proc=i486 482 cc_check -march=$proc -mcpu=$proc || proc=i486
832 fi 483 fi
833 if test "$proc" = "i486" ; then 484 if test "$proc" = "i486" ; then
834 cc_check -march=$proc -mcpu=$proc || proc=i386 485 cc_check -march=$proc -mcpu=$proc || proc=i386
835 fi 486 fi
836 if test "$proc" = "i386" ; then 487 if test "$proc" = "i386" ; then
837 cc_check -march=$proc -mcpu=$proc || proc=error 488 cc_check -march=$proc -mcpu=$proc || proc=error
838 fi 489 fi
839 if test "$proc" = "error" ; then 490 if test "$proc" = "error" ; then
840 die "Your gcc does not support even \"i386\" for '-march' and '-mcpu'." 491 die "Your $_cc does not support even \"i386\" for '-march' and '-mcpu'."
841 fi 492 fi
842 493
843 _march="-march=$proc" 494 _march="-march=$proc"
844 _mcpu="-mcpu=$proc" 495 _mcpu="-mcpu=$proc"
845 496
846 ##
847 ## Gabucino : --target takes effect here (hopefully...) by overwriting 497 ## Gabucino : --target takes effect here (hopefully...) by overwriting
848 ## autodetected mcpu/march parameters 498 ## autodetected mcpu/march parameters
849 ##
850
851 if test "$_target" ; then 499 if test "$_target" ; then
852 _march="-march=$host_arch" 500 _march="-march=$host_arch"
853 _mcpu="-mcpu=$host_arch" 501 _mcpu="-mcpu=$host_arch"
854 proc="$_target" # a little cosmetic 502 proc="$_target"
855 fi 503 fi
856 504
857 #echo "DONE (${proc})." 505 echores "$proc"
858 ;; 506 ;;
859 507
860 508 sparc)
861 sparc) 509 _def_arch='#define ARCH_SPARC 1'
862 _arch="#define ARCH_SPARC 1" 510 _target_arch='TARGET_ARCH_SPARC = yes'
863 _target_arch="TARGET_ARCH_SPARC=yes" 511 _def_words_endian='#define WORDS_BIGENDIAN 1'
864 _words_endian="#define WORDS_BIGENDIAN 1" 512 iproc='sparc'
865 iproc=sparc 513 proc='v8'
866 proc=v8 514 _march=''
867 _march=""
868 _mcpu="-mcpu=$proc" 515 _mcpu="-mcpu=$proc"
869 ;; 516 ;;
870 517
871 arm) 518 arm)
872 _arch="#define ARCH_ARM 1" 519 _def_arch="#define ARCH_ARM 1"
873 _target_arch="TARGET_ARCH_ARM=yes" 520 _target_arch='TARGET_ARCH_ARM = yes'
874 _words_endian="#undef WORDS_BIGENDIAN" 521 _def_words_endian='#undef WORDS_BIGENDIAN'
875 iproc=arm 522 iproc=arm
876 proc= 523 proc=''
877 _march="" 524 _march=''
878 _mcpu="" 525 _mcpu=''
879 ;; 526 ;;
880 527
881 ppc) 528 ppc)
882 _arch="#define ARCH_PPC 1" 529 _def_arch='#define ARCH_PPC 1'
883 _target_arch="TARGET_ARCH_PPC=yes" 530 _target_arch='TARGET_ARCH_PPC = yes'
884 _words_endian="#define WORDS_BIGENDIAN 1" 531 _def_words_endian='#define WORDS_BIGENDIAN 1'
885 iproc=ppc 532 iproc='ppc'
886 proc= 533 proc=''
887 _march="" 534 _march=''
888 _mcpu="" 535 _mcpu=''
889 ;; 536 ;;
890 537
891 alpha) 538 alpha)
892 _arch="#define ARCH_ALPHA 1" 539 _def_arch='#define ARCH_ALPHA 1'
893 _target_arch="TARGET_ARCH_ALPHA=yes" 540 _target_arch='TARGET_ARCH_ALPHA = yes'
894 _words_endian="#undef WORDS_BIGENDIAN" 541 _def_words_endian='#undef WORDS_BIGENDIAN'
895 iproc=alpha 542 iproc='alpha'
896 proc= 543 proc=''
897 _march="" 544 _march=''
898 _mcpu="-mcpu=ev56" 545 _mcpu='-mcpu=ev56'
899 ;; 546 ;;
900 547
901 mips) 548 mips)
902 _arch="#define ARCH_SGI_MIPS 1" 549 _def_arch="#define ARCH_SGI_MIPS 1"
903 _target_arch="TARGET_ARCH_SGI_MIPS=yes" 550 _target_arch="TARGET_ARCH_SGI_MIPS = yes"
904 _words_endian="#define WORDS_BIGENDIAN 1" 551 _def_words_endian='#define WORDS_BIGENDIAN 1'
905 iproc=sgi-mips 552 iproc='sgi-mips'
906 proc=default 553 proc=''
907 _march="" 554 _march=''
908 _mcpu="-mcpu=$proc" 555 _mcpu=''
909 _skip_as_check=yes 556 ;;
910 # _png=no 557
911 # CFLAGS="-O4 $_march $_mcpu -ffast-math -fomit-frame-pointer" 558 *)
912 ;;
913
914 *)
915 echo "The architecture of your CPU ($host_arch) is not supported by this configure script" 559 echo "The architecture of your CPU ($host_arch) is not supported by this configure script"
916 echo "It seems noone has ported MPlayer to your OS or CPU type yet." 560 echo "It seems noone has ported MPlayer to your OS or CPU type yet."
917 die "unsupported architecture $host_arch" 561 die "unsupported architecture $host_arch"
918 ;; 562 ;;
919 esac 563 esac
920 564
921 # --- 565
922 566 echocheck "binutils"
923 # Checking for localization ... 567 _binutils=no
924 if test -z "$LINGUAS" ; then 568 $_as libac3/downmix/downmix_i386.S -o $TMPO > /dev/null 2>&1 && _binutils=yes
925 LINGUAS="en" 569 echores "$_binutils"
926 fi 570
927 echo Checking for language ... "$LINGUAS" 571
928 _mp_help="help_mp-${LINGUAS}.h" 572 if test "$host_arch" = i386 ; then
929 573 extcheck() {
930 test -f "$_mp_help" || { 574 if test "$1" = yes ; then
931 echo "Language file (${_mp_help}) not found!" 575 echocheck "kernel support of $2"
932 LINGUAS="en" 576 cat > $TMPC <<EOF
933 _mp_help="help_mp-"$LINGUAS".h" 577 int main(void){__asm__ __volatile__ ("$3":::"memory");return(0);}
934 } 578 EOF
935 echo Using ... "$_mp_help" file 579
936 580 if ( cc_check && $TMPO ) > /dev/null 2>&1 ; then
937 cc_check $_extraincdir $_extralibdir -lvgagl -lvga && _svga=yes 581 echores "yes"
582 return 0
583 else
584 echores "failed"
585 echo "It seems that your kernel does not correctly support $2."
586 echo "To use $2 extensions in MPlayer, you have to upgrade/recompile your kernel!"
587 return 1
588 fi
589 fi
590 return 1
591 }
592
593 extcheck $_mmx "mmx" "emms" && _mmx=yes
594 extcheck $_3dnow "3dnow" "femms" && _3dnow=yes
595 extcheck $_3dnowex "3dnowex" "pswapd %%mm0, %%mm0" && _3dnowex=yes
596 extcheck $_mmx2 "mmx2" "sfence" && _mmx2=yes
597 extcheck $_sse "sse" "xorps %%xmm0, %%xmm0" && _sse=yes
598 extcheck $_sse2 "sse2" "xorpd %%xmm0, %%xmm0" && _sse2=yes
599 echocheck "mtrr support"
600 echores "$_mtrr"
601
602 fi
603
938 604
939 # Checking for posix threads lib... 605 # Checking for posix threads lib...
606 cat > $TMPC << EOF
607 int main(void) { return 0; }
608 EOF
940 if bsd ; then 609 if bsd ; then
941 cc_check -pthread || die "Lib pthread not found." 610 cc_check -pthread || die "Lib pthread not found."
942 else 611 else
943 cc_check -lpthread || die "Lib pthread not found." 612 cc_check -lpthread || die "Lib pthread not found."
944 fi 613 fi
945 614
946 615
947 # Trying to find a sdl*-config if user did not specify one 616 _prefix="/usr/local"
617
618 _libavcodec=auto
619 _libavcodec_so=auto
620
621 _x11=auto
622 _dga=auto
623 _dga2=auto
624 _xv=auto
625 _sdl=auto
626 _png=auto
627 _gl=auto
628 _ggi=auto
629 _aa=auto
630 _svga=auto
631 _fbdev=no
632 _dvb=auto
633 _dxr3=auto
634 _iconv=auto
635 _ossaudio=auto
636 _mad=auto
637 _vorbis=auto
638 _css=auto
639 _dvdread=auto
640 _xanim=auto
641 _xinerama=auto
642 _mga=auto
643 _xmga=auto
644 _vm=auto
645 _mlib=auto
646 _sgiaudio=auto
647 _sunaudio=auto
648 _alsa=auto
649
650 _fastmemcpy=yes
651 _win32=auto
652 _dshow=auto
653 _def_select='#define HAVE_AUDIO_SELECT'
654
655 _tv=no
656 _streaming=no
657 _divx4linux=auto
658 _lirc=no
659 _gui=no
660 _termcap=no
661 _3dfx=no
662 _tdfxfb=no
663
664 _x=1
665 _y=1
666 _language=en
667
668
669
670 for ac_option do
671 case "$ac_option" in
672 # Skip 1st pass
673 --target=*) ;;
674 --cc=*) ;;
675 --as=*) ;;
676 --disable-gcc-checking) ;;
677 --with-extraincdir=*) ;;
678 --with-extralibdir=*) ;;
679
680 # Real 2nd pass
681 --enable-x11) _x11=yes ;;
682 --disable-x11) _x11=no ;;
683 --enable-dga) _dga=yes ;;
684 --disable-dga) _dga=no ;;
685 --enable-dga2) _dga2=yes ;;
686 --disable-dga2) _dga2=no ;;
687 --enable-xv) _xv=yes ;;
688 --disable-xv) _xv=no ;;
689 --enable-sdl) _sdl=yes ;;
690 --disable-sdl) _sdl=no ;;
691 --enable-png) _png=yes ;;
692 --disable-png) _png=no ;;
693 --enable-gl) _gl=yes ;;
694 --disable-gl) _gl=no ;;
695 --enable-ggi) _ggi=yes ;;
696 --disable-ggi) _ggi=no ;;
697 --enable-aa) _aa=yes ;;
698 --disable-aa) _aa=no ;;
699 --enable-svga) _svga=yes ;;
700 --disable-svga) _svga=no ;;
701 --enable-fbdev) _fbdev=yes ;;
702 --disable-fbdev) _fbdev=no ;;
703 --enable-dvb) _dvb=yes ;;
704 --disable-dvb) _dvb=no ;;
705 --enable-dxr3) _dxr3=yes ;;
706 --disable-dxr3) _dxr3=no ;;
707 --enable-iconv) _iconv=yes ;;
708 --disable-iconv) _iconv=no ;;
709 --enable-ossaudio) _ossaudio=yes ;;
710 --disable-ossaudio) _ossaudio=no ;;
711 --enable-mad) _mad=yes ;;
712 --disable-mad) _mad=no ;;
713 --enable-vorbis) _vorbis=yes ;;
714 --disable-vorbis) _vorbis=no ;;
715 --enable-css) _css=yes ;;
716 --disable-css) _css=no ;;
717 --enable-dvdread) _dvdread=yes ;;
718 --disable-dvdread) _dvdread=no ;;
719 --enable-xanim) _xanim=yes ;;
720 --disable-xanim) _xanim=no ;;
721 --enable-xinerama) _xinerama=yes ;;
722 --disable-xinerama) _xinerama=no ;;
723 --enable-mga) _mga=yes ;;
724 --disable-mga) _mga=no ;;
725 --enable-xmga) _xmga=yes ;;
726 --disable-xmga) _xmga=no ;;
727 --enable-vm) _vm=yes ;;
728 --disable-vm) _vm=no ;;
729 --enable-mlib) _mlib=yes ;;
730 --disable-mlib) _mlib=no ;;
731 --enable-sunaudio) _sunaudio=yes ;;
732 --disable-sunaudio) _sunaudio=no ;;
733 --enable-sgiaudio) _sgiaudio=yes ;;
734 --disable-sgiaudio) _sgiaudio=no ;;
735 --enable-alsa) _alsa=yes ;;
736 --disable-alsa) _alsa=no ;;
737 --enable-tv) _tv=yes ;;
738 --disable-tv) _tv=no ;;
739 --enable-fastmemcpy) _fastmemcpy=yes ;;
740 --disable-fastmemcpy) _fastmemcpy=no ;;
741 --enable-tv) _tv=yes ;;
742 --disable-tv) _tv=no ;;
743 --enable-streaming) _streaming=yes ;;
744 --disable-streaming) _streaming=no ;;
745 --enable-divx4linux) _divx4linux=yes ;;
746 --disable-divx4linux) _divx4linux=no ;;
747 --enable-lirc) _lirc=yes ;;
748 --disable-lirc) _lirc=no ;;
749 --enable-gui) _gui=yes ;;
750 --disable-gui) _gui=no ;;
751 --enable-termcap) _termcap=yes ;;
752 --disable-termcap) _termcap=no ;;
753 --enable-3dfx) _3dfx=yes ;;
754 --disable-3dfx) _3dfx=no ;;
755 --enable-tdfxfb) _tdfxfb=yes ;;
756 --disable-tdfxfb) _tdfxfb=no ;;
757 --enable-mtrr) _mtrr=yes ;;
758 --disable-mtrr) _mtrr=no ;;
759
760 --enable-select) _def_select='#define HAVE_AUDIO_SELECT' ;;
761 --disable-select) _def_select='#undef HAVE_AUDIO_SELECT' ;;
762
763 --enable-static) _ld_static='-static' ;;
764 --disable-static) _ld_static='' ;;
765 --enable-static=*)
766 _ld_static="-static `echo $ac_option | cut -d '=' -f 2`"
767 ;;
768
769 --language=*)
770 LINGUAS=`echo $ac_option | cut -d '=' -f 2`
771 ;;
772
773 --with-win32libdir=*)
774 _win32libdir=`echo $ac_option | cut -d '=' -f 2`
775 _win32=yes
776 ;;
777 --with-xanimlibdir=*)
778 _xanimlibdir=`echo $ac_option | cut -d '=' -f 2`
779 _xanim=yes
780 ;;
781 --with-csslibdir=*)
782 _csslibdir=`echo $ac_option | cut -d '=' -f 2`
783 _css=yes
784 ;;
785 --with-mlibdir=*)
786 _mlibdir=`echo $ac_option | cut -d '=' -f 2`
787 _mlib=yes
788 ;;
789
790 --size-x=*)
791 _x=`echo $ac_option | cut -d '=' -f 2`
792 ;;
793 --size-y=*)
794 _y=`echo $ac_option | cut -d '=' -f 2`
795 ;;
796
797 --enable-largefiles)
798 _largefiles=yes
799 ;;
800
801 --enable-profile)
802 _profile='-p'
803 ;;
804 --enable-debug)
805 _debug='-g'
806 ;;
807 --enable-debug=*)
808 _debug=`echo $_echo_n '-g'$_echo_c; echo $ac_option | cut -d '=' -f 2`
809 ;;
810
811 --enable-sse) _sse=yes ;;
812 --disable-sse) _sse=no ;;
813 --enable-mmx2) _mmx2=yes ;;
814 --disable-mmx2) _mmx2=no ;;
815 --enable-3dnow) _3dnow=yes ;;
816 --disable-3dnow) _3dnow=no _3dnowex=no ;;
817 --enable-3dnowex) _3dnow=yes _3dnowex=yes ;;
818 --disable-3dnowex) _3dnowex=no ;;
819 --enable-mmx) _mmx=yes ;;
820 --disable-mmx) # without mmx 3Dnow! and stuff is also not possible
821 _3dnow=no _3dnowex=no _mmx=no _mmx2=no ;;
822
823 --enable-win32) _win32=yes ;;
824 --disable-win32) _win32=no _dshow=no ;;
825 --enable-dshow) _win32=yes _dshow=yes ;;
826 --disable-dshow) _dshow=no ;;
827
828 --with-x11incdir=*)
829 _inc_x11=-I`echo $ac_option | cut -d '=' -f 2 | sed 's,:, -I,g'`
830 ;;
831 --with-x11libdir=*)
832 _ld_x11=-L`echo $ac_option | cut -d '=' -f 2 | sed 's,:, -L,g'`
833 ;;
834 --with-sdl-config=*)
835 _sdlconfig=`echo $ac_option | cut -d '=' -f 2`
836 ;;
837 --with-gtk-config=*)
838 _gtkconfig=`echo $ac_option | cut -d '=' -f 2`
839 ;;
840 --with-glib-config=*)
841 _glibconfig=`echo $ac_option | cut -d '=' -f 2`
842 ;;
843 --with-madlibdir=*)
844 _ld_mad=-L`echo $ac_option | cut -d '=' -f 2 | sed 's,:, -L,g'`
845 ;;
846
847 --prefix=*)
848 _prefix=`echo $ac_option | cut -d '=' -f 2`
849 ;;
850 --datadir=*)
851 _datadir=`echo $ac_option | cut -d '=' -f 2`
852 ;;
853
854 *)
855 echo "Unknown parameter: $ac_option"
856 ;;
857
858 esac
859 done
860
861 # Atmos: moved this here, to be correct, if --prefix is specified
862 test -z "$_datadir" && _datadir=$_prefix"/share/mplayer"
863
864
865
866 if test "$host_arch" = i386 ; then
867 # Checking assembler (_as) compatibility...
868 # Added workaround for older as that reads from stdin by default - atmos
869 as_version=`echo '' | $_as -version 2>&1 | sed -n 's/^.*assembler \(version \)*\([0-9.]*\).*$/\2/p'`
870 echocheck "assembler ($_as $as_version)"
871
872 _pref_as_version='2.9.1'
873 echo 'nop' > $TMPS
874 if test "$_mmx" = yes ; then
875 echo 'emms' >> $TMPS
876 fi
877 if test "$_3dnow" = yes ; then
878 _pref_as_version='2.10.1'
879 echo 'femms' >> $TMPS
880 fi
881 if test "$_3dnowex" = yes ; then
882 _pref_as_version='2.10.1'
883 echo 'pswapd %mm0, %mm0' >> $TMPS
884 fi
885 if test "$_mmx2" = yes ; then
886 _pref_as_version='2.10.1'
887 echo 'movntq %mm0, (%eax)' >> $TMPS
888 fi
889 if test "$_sse" = yes ; then
890 _pref_as_version='2.10.1'
891 echo 'xorps %xmm0, %xmm0' >> $TMPS
892 fi
893 #if test "$_sse2" = yes ; then
894 # _pref_as_version='2.11'
895 # echo 'xorpd %xmm0, %xmm0' >> $TMPS
896 #fi
897 $_as $TMPS -o $TMPO > /dev/null 2>&1 || as_verc_fail=yes
898
899 if test "$as_verc_fail" != yes ; then
900 echores "ok"
901 else
902 echores "failed"
903 echo "Upgrade binutils to ${_pref_as_version} ..."
904 die "obsolete binutils version"
905 fi
906 fi
907
908 _def_mmx='#undef HAVE_MMX'
909 test "$_mmx" = yes && _def_mmx='#define HAVE_MMX 1'
910 _def_mmx2='#undef HAVE_MMX2'
911 test "$_mmx2" = yes && _def_mmx2='#define HAVE_MMX2 1'
912 _def_3dnow='#undef HAVE_3DNOW'
913 test "$_3dnow" = yes && _def_3dnow='#define HAVE_3DNOW 1'
914 _def_3dnowex='#undef HAVE_3DNOWEX'
915 test "$_3dnowex" = yes && _def_3dnowex='#define HAVE_3DNOWEX 1'
916 _def_sse='#undef HAVE_SSE'
917 test "$_sse" = yes && _def_sse='#define HAVE_SSE 1'
918
919
920 # Checking kernel version...
921 if test "$host_arch" = i386 && linux ; then
922 _k_verc_problem=no
923 kernel_version=`uname -r 2>&1`
924 echocheck "$system_name kernel version"
925 case "$kernel_version" in
926 '') kernel_version="?.??"; _k_verc_fail=yes;;
927 [0-1].[0-9].[0-9]*|2.[0-3].[0-9]*)
928 _k_verc_problem=yes;;
929 esac
930 if test "$_k_verc_problem" = yes && test "$_sse" = yes ; then
931 _k_verc_fail=yes
932 fi
933 if test "$_k_verc_fail" ; then
934 echores "$kernel_version, fail"
935 echo "WARNING! If you want to run mplayer on this system, get prepared for problems!"
936 echo " 2.2.x has a limited (SSE support of 2.2.x series is limited. Upgrade kernel or use --disable-sse)"
937 echo "Older kernel won't work correctly with mplayer (in"
938 else
939 echores "$kernel_version, ok"
940 fi
941 fi
942
943
944
945 ######################
946 # MAIN TESTS GO HERE #
947 ######################
948
949
950 echocheck "Screen size ..."
951 _def_x="#define SCREEN_SIZE_X $_x"
952 _def_y="#define SCREEN_SIZE_Y $_y"
953 echores "${_x} x ${_y}"
954
955
956 echocheck "Extra headers"
957 echores "$_extraincdir"
958
959
960 echocheck "Extra libs"
961 echores "$_extralibdir"
962
963
964 echocheck "kstat"
965 cat > $TMPC << EOF
966 int main(void) { return 0; }
967 EOF
968 _kstat=no
969 cc_check -lkstat && _kstat=yes
970 if test "$_kstat" = yes ; then
971 _ld_arch="-lkstat ${_ld_arch}"
972 fi
973 if test "$_kstat" = yes ; then
974 _def_kstat="#define HAVE_LIBKSTAT 1"
975 else
976 _def_kstat="#undef HAVE_LIBKSTAT"
977 fi
978 echores "$_kstat"
979
980
981 echocheck "posix4"
982 _posix4=no
983 cc_check -lposix4 && _posix4=yes
984 if test "$_posix4" = yes ; then
985 _ld_arch="-lposix4 ${_ld_arch}"
986 fi
987 echores "$_posix4"
988
989
990 echocheck "socklib"
991 # for Solaris (socket stuff is in -lsocket, gethostbyname and friends in -lnsl):
992 cat > $TMPC << EOF
993 int main(void) { return 0; }
994 EOF
995 cc_check $_ld_sock -lsocket && _ld_sock="$_ld_sock -lsocket"
996 cc_check $_ld_sock -lnsl && _ld_sock="$_ld_sock -lnsl"
997 echores "$_ld_sock"
998
999
1000 echocheck "malloc.h"
1001 cat > $TMPC << EOF
1002 #include <malloc.h>
1003 int main(void) { return 0; }
1004 EOF
1005 _malloc=no
1006 cc_check && _malloc=yes
1007 if test "$_malloc" = yes ; then
1008 _def_malloc='#define HAVE_MALLOC_H 1'
1009 else
1010 _def_malloc='#undef HAVE_MALLOC_H'
1011 fi
1012 # malloc.h emits a warning in FreeBSD
1013 freebsd && _def_malloc='#undef HAVE_MALLOC_H'
1014 echores "$_malloc"
1015
1016
1017 echocheck "memalign()"
1018 # XXX restrict to x86 ? extend to other CPUs/cacheline sizes ?
1019 cat > $TMPC << EOF
1020 #include <malloc.h>
1021 int main (void) {
1022 char *string = memalign(64, sizeof(char));
1023 return 0;
1024 }
1025 EOF
1026 _memalign=no
1027 cc_check && _memalign=yes
1028 if test "$_memalign" = yes ; then
1029 _def_memalign='#define HAVE_MEMALIGN 1'
1030 else
1031 _def_memalign='#undef HAVE_MEMALIGN'
1032 fi
1033 echores "$_memalign"
1034
1035
1036 echocheck "alloca.h"
1037 cat > $TMPC << EOF
1038 #include <alloca.h>
1039 int main(void) { return 0; }
1040 EOF
1041 _alloca=no
1042 cc_check && _alloca=yes
1043 if cc_check ; then
1044 _def_alloca='#define HAVE_ALLOCA_H 1'
1045 else
1046 _def_alloca='#undef HAVE_ALLOCA_H'
1047 fi
1048 echores "$_alloca"
1049
1050
1051 echocheck "mman.h"
1052 cat > $TMPC << EOF
1053 #include <sys/types.h>
1054 #include <sys/mman.h>
1055 int main(void) { return 0; }
1056 EOF
1057 _mman=no
1058 cc_check && _mman=yes
1059 if test "$_mman" = yes ; then
1060 _def_mman='#define HAVE_SYS_MMAN_H 1'
1061 else
1062 _def_mman='#undef HAVE_SYS_MMAN_H'
1063 fi
1064 echores "$_mman"
1065
1066
1067 echocheck "dlfcn.h"
1068 cat > $TMPC << EOF
1069 #include <dlfcn.h>
1070 int main(void) { return 0; }
1071 EOF
1072 _dl=no
1073 cc_check -ldl && _dl=yes
1074 if test "$_dl" = yes ; then
1075 _def_dl='#define HAVE_LIBDL 1'
1076 else
1077 _def_dl='#undef HAVE_LIBDL'
1078 fi
1079 echores "$_dl"
1080
1081
1082 echocheck "sys/soundcard.h"
1083 cat > $TMPC << EOF
1084 #include <sys/soundcard.h>
1085 int main(void) { return 0; }
1086 EOF
1087 _sys_soundcard=no
1088 cc_check && _sys_soundcard=yes
1089 if test "$_sys_soundcard" = yes ; then
1090 _def_sys_soundcard='#define HAVE_SYS_SOUNDCARD_H 1'
1091 else
1092 _def_sys_soundcard='#undef HAVE_SYS_SOUNDCARD_H'
1093 fi
1094 echores "$_sys_soundcard"
1095
1096
1097 echocheck "termcap"
1098 if test "$termcap" = yes ; then
1099 # FIXME: User wanted so he'll get it
1100 _termcap=no
1101 cat > $TMPC <<EOF
1102 int main(void) { return 0; }
1103 EOF
1104 cc_check -ltermcap && _termcap=yes
1105 else
1106 _termcap=no
1107 fi
1108 if test "$_termcap" = yes ; then
1109 _def_termcap='#define USE_TERMCAP 1'
1110 _ld_termcap='-ltermcap'
1111 else
1112 _def_termcap='#undef USE_TERMCAP'
1113 fi
1114 echores "$_termcap"
1115
1116
1117 echocheck "3dfx"
1118 if test "$_3dfx" = yes ; then
1119 _def_3dfx='#define HAVE_3DFX 1'
1120 _vosrc="$_vosrc vo_3dfx.c"
1121 else
1122 _def_3dfx='#undef HAVE_3DFX'
1123 fi
1124 echores "$_3dfx"
1125
1126
1127 echocheck "tdfxfb"
1128 if test "$_tdfxfb" = yes ; then
1129 _def_tdfxfb='#define HAVE_TDFXFB 1'
1130 _vosrc="$_vosrc vo_tdfxfb.c"
1131 else
1132 _def_tdfxfb='#undef HAVE_TDFXFB'
1133 fi
1134 echores "$_tdfxfb"
1135
1136
1137 # Checking for localization ...
1138 echocheck "language"
1139 test -z "$LINGUAS" && LINGUAS="en"
1140 if test -f "help_mp-${LINGUAS}.h" ; then
1141 echores "using ${LINGUAS}"
1142 else
1143 echores "${LINGUAS} not found, using en"
1144 LINGUAS="en"
1145 fi
1146 _mp_help="help_mp-${LINGUAS}.h"
1147 test -f help_mp-${LINGUAS}.h || die "help_mp-${LINGUAS}.h not found"
1148
1149
1150 echocheck "vsscanf()"
1151 cat > $TMPC << EOF
1152 #include <stdarg.h>
1153 int main(void) { vsscanf(); return 0; }
1154 EOF
1155 _vsscanf=no
1156 cc_check && _vsscanf=yes
1157 if test "$_vsscanf" = yes ; then
1158 _def_vsscanf='#define HAVE_VSSCANF 1'
1159 else
1160 _def_vsscanf='#undef HAVE_VSSCANF'
1161 fi
1162 echores "$_vsscanf"
1163
1164
1165 echocheck "X11 headers"
1166 if test -z "$_x11incdir" ; then
1167 for I in /usr/include /usr/X11R6/include /usr/X11/include /usr/openwin/include ; do
1168 if test -d "$I/X11" ; then
1169 _x11incdir="$I"
1170 echores "found $I"
1171 break
1172 fi
1173 done
1174 fi
1175 if test -z "$_x11incdir" ; then
1176 _x11=no
1177 echores "not found"
1178 elif test "$_x11incdir" != "/usr/include" ; then
1179 _inc_x11="-I$_x11incdir"
1180 fi
1181
1182
1183 echocheck "X11 libs"
1184 if test -z "$_x11libdir" ; then
1185 for I in /usr/X11R6/lib /usr/X11/lib /usr/lib32 /usr/openwin/lib ; do
1186 if test -d "$I" ; then
1187 _x11libdir="$I"
1188 echores "found $I"
1189 break;
1190 fi
1191 done
1192 fi
1193 if test -z "$_x11libdir" ; then
1194 _x11=no
1195 echores "not found"
1196 fi
1197 _ld_x11="-L$_x11libdir -lX11 -lXext"
1198
1199
1200 echocheck "X11"
1201 if test "$_x11" = auto ; then
1202 cat > $TMPC <<EOF
1203 int main(void) { return 0; }
1204 EOF
1205 _x11=no
1206 cc_check $_ld_x11 -lXext $_ld_sock && _x11=yes
1207 fi
1208 if test "$_x11" = yes ; then
1209 _def_x11='#define HAVE_X11 1'
1210 _vosrc="$_vosrc vo_x11.c"
1211 else
1212 _def_x11='#undef HAVE_X11'
1213 fi
1214 echores "$_x11"
1215
1216
1217 echocheck "DMPS"
1218 _xdpms3=no
1219 if test "$_x11" = yes ; then
1220 cat > $TMPC <<EOF
1221 #include <X11/Xmd.h>
1222 #include <X11/Xlib.h>
1223 #include <X11/Xutil.h>
1224 #include <X11/Xatom.h>
1225 #include <X11/extensions/dpms.h>
1226 int main(void) { return 0; }
1227 EOF
1228 cc_check $_ld_x11 -lXdpms $_ld_sock && _xdpms3=yes
1229 fi
1230 _xdpms4=no
1231 if test "$_x11" = yes ; then
1232 cat > $TMPC <<EOF
1233 #include <X11/Xmd.h>
1234 #include <X11/Xlib.h>
1235 #include <X11/Xutil.h>
1236 #include <X11/Xatom.h>
1237 #include <X11/extensions/dpms.h>
1238 int main(void) {
1239 (void) DPMSQueryExtension(0, 0, 0);
1240 }
1241 EOF
1242 cc_check $_ld_x11 && _xdpms4=yes
1243 fi
1244
1245 if test "$_xdpms4" = yes ; then
1246 _def_xdpms='#define HAVE_XDPMS 1'
1247 echores "using xdpms4"
1248 elif test "$_xdpms3" = yes ; then
1249 _def_xdpms='#define HAVE_XDPMS 1'
1250 _ld_x11='$_ld_x11 -lXdpms'
1251 echores "using xdpms3"
1252 else
1253 _def_xdpms='#undef HAVE_XDPMS'
1254 echores "no"
1255 fi
1256
1257
1258 echocheck "Xv"
1259 if test "$_x11" = yes && test "$_xv" = auto ; then
1260 cat > $TMPC <<EOF
1261 int main(void) { return 0; }
1262 EOF
1263 _xv=no
1264 cc_check $_ld_x11 -lXv $_ld_sock && _xv=yes
1265 else
1266 _xv=no
1267 fi
1268 if test "$_xv" = yes ; then
1269 _def_xv='#define HAVE_XV 1'
1270 _ld_xv='-lXv'
1271 _vosrc="$_vosrc vo_xv.c"
1272 else
1273 _def_xv='#undef HAVE_XV'
1274 fi
1275 echores "$_xv"
1276
1277
1278 echocheck "Xinerama"
1279 if test "$_x11" = yes && test "$_xinerama" = auto ; then
1280 cat > $TMPC <<EOF
1281 int main(void) { return 0; }
1282 EOF
1283 _xinerama=no
1284 cc_check $_ld_x11 -lXinerama $_ld_sock && _xinerama=yes
1285 else
1286 _xinerama=no
1287 fi
1288 if test "$_xinerama" = yes ; then
1289 _def_xinerama='#define HAVE_XINERAMA 1'
1290 _ld_xinerama='-lXinerama'
1291 else
1292 _def_xinerama='#undef HAVE_XINERAMA'
1293 fi
1294 echores "$_xinerama"
1295
1296
1297 # Note: the -lXxf86vm library is the VideoMode extension and though it's not
1298 # needed for DGA, AFAIK every distribution packages together with DGA stuffs
1299 # named 'X extensions' or something similar.
1300 # This check may be useful for future mplayer versions (to change resolution)
1301 # If you run into problems, remove '-lXxf86vm'.
1302 echocheck "Xxf86vm"
1303 if test "$_x11" = yes && test "$_vm" = auto ; then
1304 cat > $TMPC <<EOF
1305 int main(void) { return 0; }
1306 EOF
1307 _vm=no
1308 cc_check $_inc_x11 $_ld_x11 -lXxf86vm $_ld_sock && _vm=yes
1309 else
1310 _vm=no
1311 fi
1312 if test "$_vm" = yes ; then
1313 _def_vm='#define HAVE_XF86VM 1'
1314 _ld_vm='-lXxf86vm'
1315 else
1316 _def_vm='#undef HAVE_XF86VM'
1317 fi
1318 echores "$_vm"
1319
1320
1321 echocheck "DGA"
1322 if test "$_x11" = yes && test "$_dga" = auto ; then
1323 cat > $TMPC << EOF
1324 #include <stdio.h>
1325 #include <X11/Xlib.h>
1326 #include <X11/extensions/xf86dga.h>
1327 int main (void) { return 0; }
1328 EOF
1329 _dga=no
1330 cc_check $_inc_x11 $_ld_x11 -lXxf86dga -lXxf86vm && _dga=yes
1331 else
1332 _dga=no
1333 fi
1334 if test "$_dga" = yes ; then
1335 _def_dga='#define HAVE_DGA 1'
1336 _ld_dga='-lXxf86dga'
1337 _vosrc="$_vosrc vo_dga.c"
1338 else
1339 _def_dga='#undef HAVE_DGA'
1340 fi
1341 echores "$_dga"
1342
1343
1344 echocheck "DGA 2.0"
1345 if test "$_x11" = yes && test "$_dga2" = auto ; then
1346 cat > $TMPC << EOF
1347 #include <stdio.h>
1348 #include <X11/Xlib.h>
1349 #include <X11/extensions/xf86dga.h>
1350 int main (void) { XDGAMode mode; XDGADevice device; return 0; }
1351 EOF
1352 _dga2=no
1353 cc_check $_inc_x11 $_ld_x11 -lXxf86dga -lXxf86vm $_ld_sock && _dga2=yes
1354 else
1355 _dga2=no
1356 fi
1357 if test "$_dga2" = yes ; then
1358 _def_dga2='#define HAVE_DGA2 1'
1359 _vosrc="$_vosrc vo_dga.c"
1360 else
1361 _def_dga2='#undef HAVE_DGA2'
1362 fi
1363 echores "$_dga2"
1364
1365
1366 echocheck "SDL"
948 if test -z "$_sdlconfig" ; then 1367 if test -z "$_sdlconfig" ; then
949 if ( sdl-config --version ) >/dev/null 2>&1 ; then 1368 if ( sdl-config --version ) >/dev/null 2>&1 ; then
950 _sdlconfig="sdl-config" 1369 _sdlconfig="sdl-config"
951 elif ( sdl11-config --version ) >/dev/null 2>&1 ; then 1370 elif ( sdl11-config --version ) >/dev/null 2>&1 ; then
952 _sdlconfig="sdl11-config" 1371 _sdlconfig="sdl11-config"
953 else 1372 else
954 _sdlconfig=false 1373 _sdlconfig=false
955 fi 1374 fi
956 fi 1375 fi
957 1376 if test "$_sdl" = auto || test "$_sdl" = yes ; then
958 # Atmosfear: added SDL versioncheck and autodetect; removed warnings. 1377 _sdl=no
959 _sdl=no 1378 if "$_sdlconfig" --version >/dev/null 2>&1 ; then
960 if "$_sdlconfig" --version >/dev/null 2>&1 ; then 1379 if cc_check `$_sdlconfig --cflags` `$_sdlconfig --libs` ; then
961 if cc_check `$_sdlconfig --cflags` `$_sdlconfig --libs` ; then 1380 _sdlversion=`$_sdlconfig --version | sed 's/[^0-9]//g'`
962 _sdlversion=`$_sdlconfig --version | sed 's/[^0-9]//g'` 1381 if test "$_sdlversion" -gt 116 ; then
963 if test "$_sdlversion" -gt 116 ; then 1382 if test "$_sdlversion" -lt 121 ; then
964 if test "$_sdlversion" -lt 121 ; then 1383 _def_sdlbuggy='#define BUGGY_SDL'
965 _sdlbuggy='#define BUGGY_SDL' 1384 else
966 else 1385 _def_sdlbuggy='#undef BUGGY_SDL'
967 _sdlbuggy='#undef BUGGY_SDL' 1386 fi
968 fi 1387 _sdl=yes
969 _sdl=yes 1388 else
970 else 1389 _sdl=outdated
971 _sdl=outdated 1390 fi
1391 fi
1392 fi
1393 fi
1394 if test "$_sdl" = yes ; then
1395 _def_sdl='#define HAVE_SDL 1'
1396 _ld_sdl=`$_sdlconfig --libs`
1397 _inc_sdl=`$_sdlconfig --cflags`
1398 _vosrc="$_vosrc vo_sdl.c"
1399 _aosrc="$_aosrc ao_sdl.c"
1400 else
1401 _def_sdl='#undef HAVE_SDL'
1402 fi
1403 echores "$_sdl (with $_sdlconfig)"
1404
1405
1406 echocheck "OpenGL"
1407 if test "$_gl" = auto ; then
1408 cat > $TMPC << EOF
1409 #include <GL/gl.h>
1410 int main(void) { return 0; }
1411 EOF
1412 _gl=no
1413 if bsd ; then
1414 cc_check $_inc_x11 $_ld_x11 -lGL -lm -pthread $_ld_sock && _gl=yes
1415 else
1416 cc_check $_inc_x11 $_ld_x11 -lGL -lm $_ld_sock && _gl=yes
1417 fi
1418 fi
1419 if test "$_gl" = yes ; then
1420 _ld_gl='-lGL'
1421 # FIXME check this for OpenBSD & BSD/OS
1422 # Under XFree86 4.x GL port is poorly designed
1423 bsd && test -r /usr/X11R6/bin/XFree86 && _ld_gl='-lGL -pthread'
1424 _def_gl='#define HAVE_GL 1'
1425 _vosrc="$_vosrc vo_gl.c vo_gl2.c"
1426 else
1427 _def_gl='#undef HAVE_GL'
1428 fi
1429 echores "$_gl"
1430
1431
1432 echocheck "/dev/mga_vid"
1433 if test "$_mga" = auto ; then
1434 _mga=no
1435 test -c /dev/mga_vid && _mga=yes
1436 fi
1437 if test "$_mga" = yes ; then
1438 _def_mga='#define HAVE_MGA 1'
1439 _vosrc="$_vosrc vo_mga.c"
1440 else
1441 _def_mga='#undef HAVE_MGA'
1442 fi
1443 echores "$_mga"
1444
1445
1446 echocheck "syncfb"
1447 _syncfb=no
1448 test "$_mga" = yes && _syncfb=yes
1449 if test "$_syncfb" = yes ; then
1450 _def_syncfb='#define HAVE_SYNCFB 1'
1451 _vosrc="$_vosrc vo_syncfb.c"
1452 else
1453 _def_syncfb='#undef HAVE_SYNCFB'
1454 fi
1455 echores "$_syncfb"
1456
1457
1458 echocheck "xmga"
1459 if test "$_xmga" = auto ; then
1460 _xmga=no
1461 test "$_x11" = yes && test "$_mga" = yes && _xmga=yes
1462 fi
1463 if test "$_xmga" = yes ; then
1464 _def_xmga='#define HAVE_XMGA 1'
1465 _vosrc="$_vosrc vo_xmga.c"
1466 else
1467 _def_xmga='#undef HAVE_XMGA'
1468 fi
1469 echores "$_xmga"
1470
1471
1472 echocheck "GGI"
1473 if test "$_ggi" = auto ; then
1474 cat > $TMPC << EOF
1475 #include <ggi/ggi.h>
1476 int main(void) { return 0; }
1477 EOF
1478 _ggi=no
1479 cc_check -lggi && _ggi=yes
1480 fi
1481 if test "$_ggi" = yes ; then
1482 _def_ggi='#define HAVE_GGI 1'
1483 _ld_ggi='-lggi'
1484 _vosrc="$_vosrc vo_ggi.c"
1485 else
1486 _def_ggi='#undef HAVE_GGI'
1487 fi
1488 echores "$_ggi"
1489
1490
1491 echocheck "AA"
1492 if test "$_aa" = auto ; then
1493 cat > $TMPC << EOF
1494 #include <aalib.h>
1495 int main(void) { return 0; }
1496 EOF
1497 _aa=no
1498 cc_check -laa && _aa=yes
1499 fi
1500 if test "$_aa" = yes ; then
1501 _def_aa='#define HAVE_AA 1'
1502 _ld_aa='-laa'
1503 _vosrc="$_vosrc vo_aa.c"
1504 else
1505 _def_aa='#undef HAVE_AA'
1506 fi
1507 echores "$_aa"
1508
1509
1510 echocheck "SVGAlib"
1511 if test "$_svga" = auto ; then
1512 cat > $TMPC << EOF
1513 #include <vga.h>
1514 #include <vgagl.h>
1515 int main(void) { return 0; }
1516 EOF
1517 _svga=no
1518 cc_check -lvgagl -lvga && _svga=yes
1519 fi
1520 if test "$_svga" = yes ; then
1521 _def_svga='#define HAVE_SVGALIB 1'
1522 _ld_svga='-lvgagl -lvga'
1523 _vosrc="$_vosrc vo_svga.c"
1524 else
1525 _def_svga='#undef HAVE_SVGALIB'
1526 fi
1527 echores "$_svga"
1528
1529
1530 echocheck "FBDev"
1531 if test "$_fbdev" = auto ; then
1532 _fbdev=no
1533 linux && _fbdev=yes
1534 fi
1535 if test "$_fbdev" = yes ; then
1536 _def_fbdev='#define HAVE_FBDEV 1'
1537 _vosrc="$_vosrc vo_fbdev.c"
1538 else
1539 _def_fbdev='#undef HAVE_FBDEV'
1540 fi
1541 echores "$_fbdev"
1542
1543
1544 echocheck "DVB"
1545 if test "$_dvb" != no ; then
1546 _dvb=no
1547 test -c /dev/ost/video && _dvb=yes
1548 fi
1549 if test "$_dvb" = yes ; then
1550 _def_dvb='#define HAVE_DVB 1'
1551 else
1552 _def_dvb='#undef HAVE_DVB'
1553 fi
1554 echores "$_dvb"
1555
1556
1557 echocheck "DXR3/H+"
1558 if test "$_dxr3" = auto ; then
1559 cat > $TMPC << EOF
1560 #include <libdxr3/api.h>
1561 int main(void) { return 0; }
1562 EOF
1563 _dxr3=no
1564 cc_check -ldxr3 && _dxr3=yes
1565 fi
1566 if test "$_dxr3" = yes ; then
1567 _def_dxr3='#define HAVE_DXR3 1'
1568 _ld_dxr3='-ldxr3'
1569 _vosrc="$_vosrc vo_dxr3.c"
1570 _aosrc="$_aosrc ao_dxr3.c"
1571 else
1572 _def_dxr3='#undef HAVE_DXR3'
1573 fi
1574 echores "$_dxr3"
1575
1576
1577 echocheck "OSS Audio"
1578 if test "$_ossaudio" = auto ; then
1579 cat > $TMPC << EOF
1580 #include <sys/soundcard.h>
1581 int main(void) { int arg = SNDCTL_DSP_SETFRAGMENT; return 0; }
1582 EOF
1583 _ossaudio=no
1584 cc_check && _ossaudio=yes
1585 fi
1586 if test "$_ossaudio" = yes ; then
1587 _def_ossaudio='#define USE_OSS_AUDIO 1'
1588 _aosrc="$_aosrc ao_oss.c"
1589 else
1590 _def_ossaudio='#undef USE_OSS_AUDIO'
1591 fi
1592 echores "$_ossaudio"
1593
1594
1595 echocheck "ALSA audio"
1596 if test "$_alsa" = auto || test "$_alsa" = yes; then
1597 _alsa=no
1598 cat > $TMPC << EOF
1599 #include <sys/asoundlib.h>
1600 #include <sys/soundcard.h>
1601 int main(void) { return (!(SND_LIB_MAJOR==0 && SND_LIB_MINOR==5)); }
1602 EOF
1603 cc_check -lasound -ldl -lpthread && $TMPO && _alsaver='0.5.x'
1604
1605 cat > $TMPC << EOF
1606 #include <sys/asoundlib.h>
1607 #include <sys/soundcard.h>
1608 int main(void) { return (!(SND_LIB_MAJOR==0 && SND_LIB_MINOR==9)); }
1609 EOF
1610 cc_check -lasound -ldl -lpthread && $TMPO && _alsaver='0.9.x'
1611 if test "$_alsaver" ; then
1612 _alsa=yes
1613 echores "yes ($_alsaver)"
1614 else
1615 echores "no"
1616 fi
1617 else
1618 echores "no"
1619 fi
1620 _def_alsa5='#undef HAVE_ALSA5'
1621 _def_alsa9='#undef HAVE_ALSA9'
1622 if test "$_alsa" = yes ; then
1623 if test "$_alsaver" = '0.5.x' ; then
1624 _aosrc="$_aosrc ao_alsa5.c"
1625 _def_alsa5='#define HAVE_ALSA5 1'
1626 elif test "$_alsaver" = '0.9.x' ; then
1627 _aosrc="$_aosrc ao_alsa9.c"
1628 _def_alsa9='#define HAVE_ALSA9 1'
1629 fi
1630 _ld_alsa='-lasound'
1631 fi
1632
1633
1634 echocheck "Sun audio"
1635 if test "$_sunaudio" = auto ; then
1636 cat > $TMPC << EOF
1637 #include <sys/types.h>
1638 #include <sys/audioio.h>
1639 int main(void) { audio_info_t info; AUDIO_INITINFO(&info); }
1640 EOF
1641 _sunaudio=no
1642 cc_check && _sunaudio=yes
1643 fi
1644 if test "$_sunaudio" = yes ; then
1645 _def_sunaudio='#define USE_SUN_AUDIO 1'
1646 _aosrc="$_aosrc ao_sun.c"
1647 else
1648 _def_sunaudio='#undef USE_SUN_AUDIO'
1649 fi
1650 echores "$_sunaudio"
1651
1652
1653 echocheck "Sun mediaLib"
1654 if test "$_mlib" = auto ; then
1655 _mlib=no
1656 test -z "$_mlibdir" && _mlibdir=/opt/SUNWmlib
1657 cat > $TMPC << EOF
1658 #include <mlib.h>
1659 int main(void) { mlib_VideoColorYUV2ABGR420(0,0,0,0,0,0,0,0,0); return 0; }
1660 EOF
1661 cc_check -I${_mlibdir}/include -L${_mlibdir}/lib -lmlib && _mlib=yes
1662 fi
1663 if test "$_mlib" = yes ; then
1664 _def_mlib='#define HAVE_MLIB 1'
1665 _inc_mlib=" -I${_mlibdir}/include "
1666 _ld_mlibl=" -L${_mlibdir}/lib -R${_mlibdir}/lib -lmlib "
1667 else
1668 _def_mlib='#undef HAVE_MLIB'
1669 fi
1670 echores "$_mlib"
1671
1672
1673 echocheck "SGI Audio"
1674 if test "$_sgiaudio" = auto ; then
1675 # check for SGI audio
1676 cat > $TMPC << EOF
1677 #include <dmedia/audio.h>
1678 int main(void) { return 0; }
1679 EOF
1680 _sgiaudio=no
1681 cc_check && _sgiaudio=yes
1682 fi
1683 if test "$_sgiaudio" = "yes" ; then
1684 _def_sgiaudio='#define USE_SGI_AUDIO 1'
1685 _ld_sgiaudio='-laudio'
1686 _aosrc="$_aosrc ao_sgi.c"
1687 else
1688 _def_sgiaudio='#undef USE_SGI_AUDIO'
1689 fi
1690 echores "$_sgiaudio"
1691
1692
1693 echocheck "Encrypted DVD support"
1694 if test "$_dvdread" = auto ; then
1695 cat > $TMPC << EOF
1696 #include <dvdread/dvd_reader.h>
1697 #include <dvdread/ifo_types.h>
1698 #include <dvdread/ifo_read.h>
1699 #include <dvdread/nav_read.h>
1700 int main(void) { return 0; }
1701 EOF
1702 _dvdread=no
1703 cc_check \
1704 -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -D_LARGEFILE64_SOURCE -ldvdread && \
1705 _dvdread=yes
1706 fi
1707 if test "$_css" = auto ; then
1708 cat > $TMPC <<EOF
1709 #include <css.h>
1710 int main(void) { int i=CSSisEncrypted(0); return 0; }
1711 EOF
1712 _css=no
1713 cc_check -lcss && _css=yes
1714 fi
1715 # dvdread preferred to DeCSS
1716 if test "$_dvdread" = yes ; then
1717 _largefiles=yes
1718 _def_dvdread='#define USE_DVDREAD 1'
1719 _def_css='#undef HAVE_LIBCSS'
1720 _ld_css='-ldvdread'
1721 echores "-ldvdread"
1722 elif test "$_css" = yes ; then
1723 _def_dvdread='#undef USE_DVDREAD'
1724 _def_css='#define HAVE_LIBCSS 1'
1725 test "$_csslibdir" && _ld_css="-L${_csslibdir} ${_ld_css}"
1726 echores "-lcss"
1727 else
1728 _def_dvdread='#undef USE_DVDREAD'
1729 _def_css='#undef HAVE_LIBCSS'
1730 echores "none"
1731 fi
1732
1733
1734 echocheck "zlib"
1735 cat > $TMPC << EOF
1736 #include <zlib.h>
1737 int main(void) { return 0; }
1738 EOF
1739 _zlib=no
1740 cc_check -lz && _zlib=yes
1741 if test "$_zlib" = yes ; then
1742 _def_zlib='#define HAVE_ZLIB 1'
1743 _ld_zlib='-lz'
1744 else
1745 _def_zlib='#undef HAVE_ZLIB'
1746 fi
1747 echores "$_zlib"
1748
1749
1750 echocheck "PNG support"
1751 if test "$_png" = auto ; then
1752 _png=no
1753 if irix ; then
1754 # Don't check for -lpng on irix since it has its own libpng
1755 # incompatible with the GNU libpng
1756 echores "disabled on irix (not GNU libpng)"
1757 else
1758 cc_check -lpng -lz -lm && _png=yes
1759 echores yes
1760 fi
1761 else
1762 echores "$_png"
1763 fi
1764 if test "$_png" = yes ; then
1765 _def_png='#define HAVE_PNG 1'
1766 _ld_png='-lpng -lz'
1767 _vosrc="$_vosrc vo_png.c"
1768 else
1769 _def_png='#undef HAVE_PNG'
1770 fi
1771
1772
1773 echocheck "mad support"
1774 if test "$_mad" = auto ; then
1775 _mad=no
1776 cat > $TMPC << EOF
1777 #include <mad.h>
1778 int main(void) { return 0; }
1779 EOF
1780 cc_check $_madlibdir -lmad && _mad=yes
1781 fi
1782 if test "$_mad" = yes ; then
1783 _def_mad='#define USE_LIBMAD 1'
1784 _ld_mad='-lmad'
1785 else
1786 _def_mad='#undef USE_LIBMAD'
1787 fi
1788 echores "$_mad"
1789
1790
1791 echocheck "OggVorbis support"
1792 if test "$_vorbis" = auto ; then
1793 _vorbis=no
1794 cat > $TMPC << EOF
1795 #include <vorbis/codec.h>
1796 int main(void) { return 0; }
1797 EOF
1798 cc_check -lvorbis -lm && _vorbis=yes
1799 fi
1800 if test "$_vorbis" = yes ; then
1801 _def_vorbis='#define HAVE_OGGVORBIS 1'
1802 _ld_vorbis='-lvorbis -lm'
1803 else
1804 _def_vorbis='#undef HAVE_OGGVORBIS'
1805 fi
1806 echores "$_vorbis"
1807
1808
1809 echocheck "Win32 DLL support"
1810 if test "$_win32" = auto ; then
1811 _win32=no
1812 if test "$host_arch" = i386 ; then
1813 if test -z "$_win32libdir" ; then
1814 for I in /usr/local/lib/win32 /usr/lib/win32 ; do
1815 if test -d "$I" ; then
1816 _win32libdir="$I"
1817 break;
1818 fi;
1819 done
1820 fi
1821 test "$_win32libdir" && _win32=yes
1822 fi
1823 fi
1824 if test "$_win32" = yes ; then
1825 _def_win32='#define USE_WIN32DLL 1'
1826 _ld_win32='-Lloader -lloader'
1827 _dep_win32='loader/libloader.a'
1828 else
1829 _def_win32='#undef USE_WIN32DLL'
1830 fi
1831 echores "$_win32"
1832
1833
1834 echocheck "DirectShow"
1835 if test "$_win32" = yes && test "$_dshow" = auto ; then
1836 _dshow=no
1837 # check if compiler supports C++ and C++-libs are installed correctly
1838 cat > "$TMPCPP" << EOF
1839 #include <string>
1840 class myclass {
1841 private: int ret;
1842 public: int myreturn(void);
1843 };
1844 int myclass::myreturn(void) { ret = 0; return ret ; }
1845 int main(void) { myclass myobject; return myobject.myreturn(); }
1846 EOF
1847 echo "------------------------------------------------" >> "$TMPLOG"
1848 cat "$TMPCPP" >> "$TMPLOG"
1849 if ( "$_cc" "$TMPCPP" -o "$TMPO" && "$TMPO" ) >> "$TMPLOG" 2>&1 ; then
1850 _dshow=yes
1851 echores "yes (C++ is ok)"
1852 else
1853 echores "no"
1854 cat << EOF
1855
1856 Your C++ runtime environment is broken.
1857
1858 Hints: Does $_cc support C++ ? Have you a C++ compiler installed ?
1859 Are the C++ libraries correctly installed ?
1860 Check for libstdc++ and in (/etc/)ld.so.conf
1861
1862 If you don't need DirectShow support, you can also use:
1863 ./configure --disable-dshow <your-normal-configure-options>
1864 to disable building of the C++ based DirectShow code.
1865
1866 EOF
1867 die "$_cc's C++ is broken"
1868 fi
1869 else
1870 _dshow=no
1871 echores "$_dshow"
1872 fi
1873 if test "$_dshow" = yes ; then
1874 _def_dshow='#define USE_DIRECTSHOW 1'
1875 _ld_dshow='-Lloader/DirectShow -lDS_Filter -lstdc++'
1876 _dep_dshow='loader/DirectShow/libDS_Filter.a'
1877 else
1878 _def_dshow='#undef USE_DIRECTSHOW'
1879 fi
1880
1881
1882 echocheck "XAnim DLL"
1883 if test "$_xanim" = auto ; then
1884 _xanim=no
1885 if test "$_dl" = yes ; then
1886 if test "$host_arch" = i386 ; then
1887 if test -z "$_xanimlibdir" ; then
1888 for I in /usr/local/lib/xanim/mods /usr/lib/xanim/mods ; do
1889 if test -d "$I" ; then
1890 _xanimlibdir="$I"
1891 break;
1892 fi;
1893 done
972 fi 1894 fi
973 fi 1895 test "$_xanimlibdir" && _xanim=yes
974 fi 1896 echores "yes"
975 1897 else
976 1898 echores "not supported non x86"
977 # Atmosfear: added libcss autodetect 1899 fi
978 _css=no 1900 else
979 for I in "/usr/local" "/usr" ; do 1901 echores "libdl needed"
980 if test -s "$I/lib/libcss.so" && test -s "$I/include/css.h" ; then 1902 fi
981 _csslibdir="$I/lib/" 1903 else
982 _cssincdir="$I/include" 1904 echores "$_xanim"
983 _css=yes 1905 fi
984 break; 1906 if test "$_xanim" = yes ; then
985 fi 1907 _def_xanim='#define USE_XANIM 1'
986 done 1908 _def_xanim_path="#define XACODEC_PATH \"$_xanimlibdir\""
987 1909 else
988 _aa=no 1910 _def_xanim='#undef USE_XANIM'
989 cc_check $_extraincdir $_extralibdir -laa && _aa=yes 1911 _def_xanim_path='#undef XACODEC_PATH'
990 1912 fi
991 _dxr3=no 1913
992 cc_check $_extraincdir $_extralibdir -ldxr3 && _dxr3=yes 1914
993 1915 echocheck "iconv"
994 _divx4linux=no 1916 if test "$_iconv" = auto ; then
995 cc_check $_extraincdir $_extralibdir -ldivxdecore -lm && _divx4linux=yes 1917 if freebsd ; then
996 1918 _iconv_tmp='#include <giconv.h>'
997 _termcap=no 1919 else
998 cc_check $_extraincdir $_extralibdir -ltermcap && _termcap=yes 1920 _iconv_tmp='#include <iconv.h>'
999 1921 fi
1000 _png=no 1922 cat > $TMPC << EOF
1001 if irix ; then
1002 # Don't check for -lpng on irix since it has its own libpng
1003 # incompatible with the GNU libpng
1004 :
1005 else
1006 cc_check $_extraincdir $_extralibdir -lpng -lz -lm && _png=yes
1007 fi
1008
1009 _vorbis=no
1010 cc_check $_extraincdir $_extralibdir -lvorbis -lm && _vorbis=yes
1011
1012 _ggi=no
1013 cc_check $_extraincdir $_extralibdir -lggi && _ggi=yes
1014
1015 _kstat=no
1016 cc_check -lkstat && _kstat=yes _archlibs="-lkstat $_archlibs"
1017 cc_check -lposix4 && _archlibs="-lposix4 $_archlibs"
1018
1019 _binutils=no
1020 $_as libac3/downmix/downmix_i386.S -o $TMPO > /dev/null 2>&1 && _binutils=yes
1021
1022 # echo binutils: $_binutils
1023
1024
1025 # ----------- Check X11 and related libs (GL, Xxf86vm, Xv, DGA) --------------
1026
1027 # for Solaris (socket stuff is in -lsocket, gethostbyname and friends in -lnsl):
1028 _socklib=
1029 cc_check $_socklib -lsocket && _socklib="$_socklib -lsocket"
1030 cc_check $_socklib -lnsl && _socklib="$_socklib -lnsl"
1031
1032 if test "$_x11" = auto ; then
1033 _x11=no
1034 cc_check $_x11libdir -lX11 -lXext $_socklib && _x11=yes
1035 fi
1036
1037 if test "$_x11" = yes ; then
1038
1039 cc_check $_x11libdir -lX11 -lXext -lXdpms $_socklib && _xdpms_3=yes
1040 ( nm `echo $_x11libdir | cut -c 3-`/libXext.a | grep DPMSQueryExtension ) > /dev/null 2>&1 && _xdpms_4=yes
1041 cc_check $_x11libdir -lX11 -lXext -lXv $_socklib && _xv=yes
1042 cc_check $_x11libdir -lX11 -lXext -lXxf86vm $_socklib && _vm=yes
1043 cc_check $_x11libdir -lX11 -lXext -lXinerama $_socklib && _xinerama=yes
1044
1045 # XXX this is not yet checked with OpenBSD - atmos
1046 if freebsd || openbsd ; then
1047 cc_check $_x11libdir -lX11 -lXext -lGL -lm -pthread $_socklib && _gl=yes
1048 else
1049 cc_check $_x11libdir -lX11 -lXext -lGL -lm $_socklib && _gl=yes
1050 fi
1051
1052 if freebsd ; then
1053 _iconv_tmp='#include <giconv.h>'
1054 else
1055 _iconv_tmp='#include <iconv.h>'
1056 fi
1057
1058 cat > $TMPC << EOF
1059 #include <stdio.h> 1923 #include <stdio.h>
1060 #include <unistd.h> 1924 #include <unistd.h>
1061 $_iconv_tmp 1925 $_iconv_tmp
1062
1063 #define INBUFSIZE 1024 1926 #define INBUFSIZE 1024
1064 #define OUTBUFSIZE 4096 1927 #define OUTBUFSIZE 4096
1065 1928
1066 char inbuffer[INBUFSIZE]; 1929 char inbuffer[INBUFSIZE];
1067 char outbuffer[OUTBUFSIZE]; 1930 char outbuffer[OUTBUFSIZE];
1068 1931
1069 main() 1932 int main(void) {
1070 { ssize_t numread; 1933 ssize_t numread;
1071 iconv_t icdsc; 1934 iconv_t icdsc;
1072 char *tocode="UTF-8"; 1935 char *tocode="UTF-8";
1073 char *fromcode="cp1250"; 1936 char *fromcode="cp1250";
1074 if ((icdsc = iconv_open (tocode, fromcode)) != (iconv_t)(-1)){ 1937 if ((icdsc = iconv_open (tocode, fromcode)) != (iconv_t)(-1)) {
1075 while ((numread = read (0, inbuffer, INBUFSIZE))){ 1938 while ((numread = read (0, inbuffer, INBUFSIZE))) {
1076 char *iptr=inbuffer; 1939 char *iptr=inbuffer;
1077 char *optr=outbuffer; 1940 char *optr=outbuffer;
1078 size_t inleft=numread; 1941 size_t inleft=numread;
1079 size_t outleft=OUTBUFSIZE; 1942 size_t outleft=OUTBUFSIZE;
1080 if (iconv (icdsc, 1943 if (iconv(icdsc, (const char **)&iptr, &inleft, &optr, &outleft)
1081 (const char **)&iptr, &inleft, &optr, &outleft) 1944 != (size_t)(-1)) {
1082 !=(size_t)(-1)){ 1945 write (1, outbuffer, OUTBUFSIZE - outleft);
1083 write (1, outbuffer, OUTBUFSIZE - outleft); 1946 }
1084 } 1947 }
1085 } 1948 if (iconv_close(icdsc) == -1)
1086 if (iconv_close (icdsc) == -1) ; 1949 ;
1087 } 1950 }
1088 } 1951 }
1089 1952 EOF
1090 EOF 1953 _iconv=no
1091 _iconv=yes 1954 if freebsd ; then
1092 if freebsd ; then 1955 cc_check -lm -lgiconv && _iconv=yes
1093 cc_check $_extraincdir $_extralibdir -lm -lgiconv >/dev/null 2>&1 || \ 1956 elif bsdos ; then
1094 { _iconv=no ; echo "iconv(3) function not detected!" ;} 1957 cc_check -lm -liconv && _iconv=yes
1095 elif bsdos ; then 1958 else
1096 cc_check $_extraincdir $_extralibdir -lm -liconv >/dev/null 2>&1 || \ 1959 cc_check -lm && _iconv=yes
1097 { _iconv=no ; echo "iconv(3) function not detected!" ;} 1960 fi
1098 else 1961 fi
1099 cc_check -lm || \ 1962 if test "$_iconv" = yes ; then
1100 { _iconv=no ; echo "iconv(3) function not detected!" ;} 1963 _def_iconv='#define USE_ICONV 1'
1101 fi 1964 freebsd && _ld_iconv='-lgiconv'
1102 cat > $TMPC << EOF 1965 bsdos && _ld_iconv='-liconv'
1103 #include <GL/gl.h> 1966 else
1104 int main( void ) { return 0; } 1967 _def_iconv='#undef USE_ICONV'
1105 EOF 1968 fi
1106 # XXX check this for OpenBSD and BSD/OS 1969 echores "$_iconv"
1107 if freebsd || openbsd ; then 1970
1108 cc_check $_x11incdir $_x11libdir -lX11 -lXext -lGL -lm -pthread $_socklib || \ 1971
1109 { _gl=no; echo "GL includes not found!"; } 1972 echocheck "FFmpeg codec"
1110 else 1973 if test "$_libavcodec" = auto ; then
1111 cc_check $_x11libdir -lX11 -lXext -lGL -lm $_socklib || \ 1974 # Note: static link is preferred to dynamic link
1112 { _gl=no; echo "GL includes not found!"; } 1975 _libavcodec=no
1113 fi 1976 test -d libavcodec && test -f libavcodec/Makefile && _libavcodec=yes
1114 1977 fi
1115 cat > $TMPC << EOF 1978 if test "$_libavcodec_so" = auto ; then
1116 #include <stdio.h> 1979 _libavcodec_so=no
1117 #include <X11/Xlib.h> 1980 cat > $TMPC << EOF
1118 #include <X11/extensions/xf86dga.h> 1981 #include <libffmpeg/avcodec.h>
1119 int main (void) { return 0;} 1982 int main(void) { return 0; }
1120 EOF 1983 EOF
1121 1984 cc_check -lffmpeg -lm && _libavcodec_so=yes
1122 cc_check $_x11incdir -L/usr/X11R6/lib -L/usr/X11/lib -lX11 -lXext -lXxf86dga -lXxf86vm && _dga=yes 1985 fi
1123 # Note: the -lXxf86vm library is the VideoMode extension and though it's 1986 _def_libavcodec='#undef USE_LIBAVCODEC'
1124 # not needed for DGA, AFAIK every distribution packages together with DGA 1987 _def_libavcodec_so='#undef USE_LIBAVCODEC'
1125 # stuffs named 'X extensions' or something similar. This check can be usefull 1988 _def_ffpostprocess='#undef FF_POSTPROCESS'
1126 # for further mplayer versions to set resolution by mplayer itself. 1989 if test "$_libavcodec" = yes ; then
1127 # If you run into problems, remove '-lXxf86vm'. 1990 _def_libavcodec='#define USE_LIBAVCODEC 1'
1128 1991 _ld_libavcodec='-Llibavcodec -lavcodec'
1129 # Check if DGA is 2.0 or greater 1992 _dep_libavcodec='libavcodec/libavcodec.a'
1130 cat > $TMPC << EOF 1993 _def_ffpostprocess='#define FF_POSTPROCESS 1'
1131 #include <stdio.h> 1994 echores "static libavcodec"
1132 #include <X11/Xlib.h> 1995 elif test "$_libavcodec_so" = yes ; then
1133 #include <X11/extensions/xf86dga.h> 1996 _def_libavcodec_so='#define USE_LIBAVCODEC_SO 1'
1134 int main (void) { XDGAMode mode; XDGADevice device; return 0;} 1997 _ld_libavcodec='-lffmpeg'
1135 EOF 1998 _def_ffpostprocess='#define FF_POSTPROCESS 1'
1136 1999 echores "dynamic libffmpeg.so"
1137 _dga2=no 2000 else
1138 cc_check $_x11incdir -L/usr/X11R6/lib -L/usr/X11/lib -lX11 -lXext -lXxf86dga -lXxf86vm $_socklib && _dga2=yes 2001 echores "not found"
1139 2002 fi
1140 # --- checkin X11 XShape extension 2003
1141 2004
1142 # echo -en 'Checking XShape extension ... ' 2005 # FIXME : variables don't have a "standard" name so check this one day
1143 2006 if test "$_divx4linux" = auto ; then
1144 cat > $TMPC << EOF 2007 _divx4linux=no
2008 echocheck "Divx4linux decore"
2009 cat > $TMPC << EOF
2010 #include <decore.h>
2011 int main(void) { return DEC_OPT_FRAME_311; }
2012 EOF
2013 _divx4linux_decore=no
2014 if cc_check -ldivxdecore -lm ; then
2015 _divx4linux_decore=yes
2016 else
2017 _divx4linux_decore='not found'
2018 fi
2019 echores "$_divx4linux_decore"
2020 test "$_divx4linux_decore" = yes && _divx4linux=yes
2021 echocheck "Divx4linux encore (for mencoder)"
2022 cat > $TMPC <<EOF
2023 #include <encore2.h>
2024 int main(void) { return 0; }
2025 EOF
2026 _divx4linux_encore=no
2027 cc_check -ldivxencore -lm && _divx4linux_encore=yes
2028 echores "$_divx4linux_encore"
2029 fi
2030 _def_decore='#undef NEW_DECORE'
2031 _ld_decore='-Lopendivx -ldecore'
2032 _def_encore='#undef NEW_ENCORE'
2033 if test "$_divx4linux_decore" = yes ; then
2034 _def_decore='#define NEW_DECORE 1'
2035 _ld_decore='-ldivxdecore opendivx/postprocess.o'
2036 if test "$_divx4linux_encore" = yes ; then
2037 _def_encore='#define NEW_ENCORE 1'
2038 _ld_encore='-ldivxencore'
2039 fi
2040 fi
2041
2042
2043 echocheck "lirc"
2044 if test "$_lirc" = yes ; then
2045 _def_lirc='#define HAVE_LIRC 1'
2046 _ld_lirc='-llirc_client'
2047 else
2048 _def_lirc='#undef HAVE_LIRC'
2049 fi
2050 echores "$_lirc"
2051
2052
2053 echocheck "fastmemcpy"
2054 # FIXME fastmemcpy check
2055 if test "$_fastmemcpy" = yes ; then
2056 _def_fastmemcpy='#define USE_FASTMEMCPY 1'
2057 else
2058 _def_fastmemcpy='#undef USE_FASTMEMCPY'
2059 fi
2060 echores "$_fastmemcpy"
2061
2062
2063 echocheck "TV interface"
2064 # FIXME tv check
2065 if test "$_tv" = yes ; then
2066 _def_tv='#define USE_TV 1'
2067 else
2068 _def_tv='#undef USE_TV'
2069 fi
2070 echores "$_tv"
2071
2072
2073 echocheck "streaming"
2074 # FIXME streaming check
2075 if test "$_streaming" = yes ; then
2076 _def_streaming='#define STREAMING 1'
2077 # FIXME _streamingsrcs='asf_streaming.c network.c url.c http.c'
2078 else
2079 _def_streaming='#undef STREAMING'
2080 fi
2081 echores "$_streaming"
2082
2083
2084
2085 # --------------- GUI specific tests begin -------------------
2086 echo
2087 echocheck "GUI"
2088 echo "$_gui"
2089 if test "$_gui" = yes ; then
2090
2091 echocheck "XShape extension"
2092 _xshape=no
2093 if test "$_x11" = yes ; then
2094 cat > $TMPC << EOF
1145 #include <X11/Xlib.h> 2095 #include <X11/Xlib.h>
1146 #include <X11/Xproto.h> 2096 #include <X11/Xproto.h>
1147 #include <X11/Xutil.h> 2097 #include <X11/Xutil.h>
1148 #include <X11/extensions/shape.h> 2098 #include <X11/extensions/shape.h>
1149 #include <stdlib.h> 2099 #include <stdlib.h>
1150 int main( void ) 2100 int main(void) {
1151 { 2101 char *name = ":0.0";
1152 char * name = ":0.0"; 2102 Display *wsDisplay;
1153 Display * wsDisplay; 2103 int exitvar = 0;
1154 int exitvar = 0; 2104 int eventbase, errorbase;
1155 int eventbase,errorbase; 2105 if (getenv("DISPLAY"))
1156 2106 name=getenv("DISPLAY");
1157 if ( getenv( "DISPLAY" ) ) name=getenv( "DISPLAY" ); 2107 wsDisplay=XOpenDisplay(name);
1158 wsDisplay=XOpenDisplay( name ); 2108 if (!XShapeQueryExtension(wsDisplay,&eventbase,&errorbase))
1159 if ( !XShapeQueryExtension( wsDisplay,&eventbase,&errorbase ) ) exitvar=1; 2109 exitvar=1;
1160 XCloseDisplay( wsDisplay ); 2110 XCloseDisplay(wsDisplay);
1161 return exitvar; 2111 return exitvar;
1162 } 2112 }
1163 EOF 2113 EOF
1164 2114 cc_check $_inc_x11 $_ld_x11 $_ld_sock && _xshape=yes
1165 _xshape=no 2115 fi
1166 cc_check $_x11incdir -L/usr/X11R6/lib -L/usr/X11/lib -lX11 -lXext $_socklib && _xshape=yes 2116 if test "$_xshape" = yes ; then
1167 2117 _def_xshape='#define HAVE_XSHAPE 1'
1168 fi
1169
1170 cat > $TMPC << EOF
1171 #include <decore.h>
1172 int main( void ) { return DEC_OPT_FRAME_311; }
1173 EOF
1174 cc_check $_extraincdir $_extralibdir -ldivxdecore -lm || \
1175 { _divx4linux=no; echo "DivX4Linux includes (decore.h) not found!"; }
1176
1177 cat > $TMPC << EOF
1178 #include <dvdread/dvd_reader.h>
1179 #include <dvdread/ifo_types.h>
1180 #include <dvdread/ifo_read.h>
1181 #include <dvdread/nav_read.h>
1182 int main( void ) { return 0; }
1183 EOF
1184 cc_check $_extraincdir $_extralibdir -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -D_LARGEFILE64_SOURCE -ldvdread && \
1185 { _dvdread=yes; _largefiles=yes; }
1186
1187
1188 cat > $TMPC << EOF
1189 #include <mlib.h>
1190 int main( void ) { mlib_VideoColorYUV2ABGR420(0,0,0,0,0,0,0,0,0); return 0; }
1191 EOF
1192 cc_check $_extraincdir $_extralibdir -I$_mlibdir/include -L$_mlibdir/lib -lmlib && _mlib=yes
1193
1194
1195
1196
1197 # ---
1198 # check availability of some header files
1199
1200 # check for malloc.h
1201 cat > $TMPC << EOF
1202 #include <malloc.h>
1203 int main( void ) { return 0; }
1204 EOF
1205 _malloc_h=no
1206 cc_check && _malloc_h=yes
1207
1208
1209 # check for memalign() in malloc.h
1210 # XXX restrict to x86 ? extend to other CPUs/cacheline sizes ?
1211 cat > $TMPC << EOF
1212 #include <malloc.h>
1213 int main ( void ) {
1214 char *string = NULL;
1215 string = memalign(64, sizeof(char));
1216 return 0;
1217 }
1218 EOF
1219 _memalign=no
1220 cc_check && _memalign=yes
1221
1222
1223 # check for alloca.h
1224 cat > $TMPC << EOF
1225 #include <alloca.h>
1226 int main( void ) { return 0; }
1227 EOF
1228 _alloca_h=no
1229 cc_check && _alloca_h=yes
1230
1231
1232 # check for mman.h
1233 cat > $TMPC << EOF
1234 #include <sys/types.h>
1235 #include <sys/mman.h>
1236 int main( void ) { return 0; }
1237 EOF
1238 _sys_mman_h=no
1239 cc_check && _sys_mman_h=yes
1240
1241
1242 # check for dlfcn.h
1243 cat > $TMPC << EOF
1244 #include <dlfcn.h>
1245 int main( void ) { return 0; }
1246 EOF
1247 _libdl=no
1248 cc_check -ldl && _libdl=yes
1249
1250 # check for zlib.h
1251 cat > $TMPC << EOF
1252 #include <zlib.h>
1253 int main( void ) { return 0; }
1254 EOF
1255 _zlib=no
1256 cc_check -lz && _zlib=yes
1257
1258 # check for sys/soundcard.h
1259 cat > $TMPC << EOF
1260 #include <sys/soundcard.h>
1261 int main( void ) { return 0; }
1262 EOF
1263 _sys_soundcard_h=no
1264 cc_check && _sys_soundcard_h=yes
1265
1266 # check for vsscanf
1267 cat > $TMPC << EOF
1268 int main( void ) { vsscanf(); return 0; }
1269 EOF
1270 _vsscanf=no
1271 cc_check && _vsscanf=yes
1272
1273
1274 # ---
1275 # try to detect type of audio supported on this machine
1276
1277
1278 # check for OSS audio
1279 cat > $TMPC << EOF
1280 #include <sys/soundcard.h>
1281 int main( void ) { int arg = SNDCTL_DSP_SETFRAGMENT; }
1282 EOF
1283 _oss_audio=no
1284 cc_check && _oss_audio=yes
1285
1286
1287 # check for ALSA audio: 0.5.x then 0.9.x
1288 if test "$_alsa" = yes ; then
1289 _alsaver=no
1290 cat > $TMPC << EOF
1291 #include <sys/asoundlib.h>
1292 #include <sys/soundcard.h>
1293 int main( void ) { if(SND_LIB_MAJOR==0&&SND_LIB_MINOR==5)return 0; return 1; }
1294 EOF
1295 cc_check -lasound -ldl -lpthread && $TMPO && _alsaver='0.5.x'
1296
1297 cat > $TMPC << EOF
1298 #include <sys/asoundlib.h>
1299 #include <sys/soundcard.h>
1300 int main( void ) { if(SND_LIB_MAJOR==0&&SND_LIB_MINOR==9)return 0; return 1; }
1301 EOF
1302 cc_check -lasound -ldl -lpthread && $TMPO && _alsaver='0.9.x'
1303 fi
1304 test "$_alsaver" || _alsa=no
1305
1306
1307 # check for ESD audio
1308 cat > $TMPC << EOF
1309 #include <esd.h>
1310 int main( void ){ return 0; }
1311 EOF
1312 cc_check $_extraincdir $_extralibdir -lesd || _esd=no
1313
1314
1315 # check for SUN audio
1316 cat > $TMPC << EOF
1317 #include <sys/types.h>
1318 #include <sys/audioio.h>
1319 int main( void ) { audio_info_t info; AUDIO_INITINFO(&info); }
1320 EOF
1321 _sun_audio=no
1322 cc_check && _sun_audio=yes
1323
1324
1325 # check for SGI audio
1326 cat > $TMPC << EOF
1327 #include <dmedia/audio.h>
1328 int main( void ) { return 0; }
1329 EOF
1330 _sgi_audio=no
1331 cc_check && _sgi_audio=yes
1332
1333
1334 # check for mad library
1335 cat > $TMPC << EOF
1336 #include <mad.h>
1337 int main(void) { return 0; }
1338 EOF
1339 cc_check $_extraincdir $_extralibdir $_madlibdir $_madincdir -lmad || _mad=no
1340
1341
1342 # ---
1343
1344 # check for the parameters.
1345
1346 _prefix="/usr/local"
1347
1348 for ac_option do
1349 case "$ac_option" in
1350 --enable-profile)
1351 _profile='-p'
1352 ;;
1353 --enable-debug)
1354 _debug='-g'
1355 ;;
1356 --enable-largefiles)
1357 _largefiles=yes
1358 ;;
1359 --enable-debug=*)
1360 _debug=`echo $_echo_n '-g'$_echo_c; echo $ac_option | cut -d '=' -f 2`
1361 ;;
1362 --enable-css)
1363 _css=yes
1364 ;;
1365 --enable-png)
1366 _png=yes
1367 ;;
1368 --enable-sse)
1369 _sse=yes
1370 ;;
1371 --enable-3dnow)
1372 _3dnow=yes
1373 ;;
1374 --enable-3dnowex)
1375 _3dnow=yes
1376 _3dnowex=yes
1377 ;;
1378 --enable-mmx)
1379 _mmx=yes
1380 ;;
1381 --enable-mmx2)
1382 _mmx2=yes
1383 ;;
1384 --enable-mtrr)
1385 _mtrr=yes
1386 ;;
1387 --enable-gl)
1388 _gl=yes
1389 ;;
1390 --enable-sdl)
1391 _sdl=yes
1392 ;;
1393 --enable-aa)
1394 _aa=yes
1395 ;;
1396 --enable-ggi)
1397 _ggi=yes
1398 ;;
1399 --enable-mga)
1400 _mga=yes
1401 ;;
1402 --enable-xmga)
1403 _xmga=yes
1404 ;;
1405 --enable-svga)
1406 _svga=yes
1407 ;;
1408 --enable-dga)
1409 _dga=yes
1410 ;;
1411 --enable-dga2)
1412 _dga2=yes
1413 ;;
1414 --enable-xv)
1415 _xv=yes
1416 ;;
1417 --enable-vm)
1418 _vm=yes
1419 ;;
1420 --enable-xinerama)
1421 _xinerama=yes
1422 ;;
1423 --enable-3dfx)
1424 _3dfx=yes
1425 ;;
1426 --enable-tdfxfb)
1427 _tdfxfb=yes
1428 ;;
1429 --enable-syncfb)
1430 _syncfb=yes
1431 ;;
1432 --enable-fbdev)
1433 _fbdev=yes
1434 ;;
1435 --enable-dvb)
1436 _dvb=yes
1437 ;;
1438 --enable-dxr3)
1439 _dxr3=yes
1440 ;;
1441 --enable-libvo2)
1442 _vo2=yes
1443 ;;
1444 --enable-iconv)
1445 _iconv=yes
1446 ;;
1447 --enable-mlib)
1448 _mlib=yes
1449 ;;
1450 --enable-vorbis)
1451 _vorbis=yes
1452 ;;
1453 --enable-termcap)
1454 _termcap=yes
1455 ;;
1456 --enable-xmmp)
1457 _xmmp=yes
1458 ;;
1459 --enable-ossaudio)
1460 _oss_audio=yes
1461 ;;
1462 --enable-sunaudio)
1463 _sun_audio=yes
1464 ;;
1465 --enable-lirc)
1466 _lirc=yes
1467 ;;
1468 --enable-select)
1469 _select='#define HAVE_AUDIO_SELECT'
1470 ;;
1471 --enable-gui)
1472 _gui=yes
1473 ;;
1474 --enable-tv)
1475 _tv=yes
1476 ;;
1477 --enable-streaming)
1478 _streaming=yes
1479 ;;
1480 --enable-divx4)
1481 _divx4linux=yes
1482 ;;
1483 --enable-mad)
1484 _mad=yes
1485 ;;
1486 --disable-mad)
1487 _mad=no
1488 ;;
1489 --disable-css)
1490 _css=no
1491 ;;
1492 --disable-png)
1493 _png=no
1494 ;;
1495 --disable-kernel-extchk)
1496 _kernelextcheck=no
1497 ;;
1498 --disable-sse)
1499 _sse=no
1500 ;;
1501 --disable-3dnow)
1502 _3dnow=no
1503 _3dnowex=no
1504 ;;
1505 --disable-3dnowex)
1506 _3dnowex=no
1507 ;;
1508 --disable-mmx)
1509 # without mmx 3Dnow! and stuff is also not possible
1510 _3dnow=no
1511 _3dnowex=no
1512 _mmx=no
1513 _mmx2=no
1514 ;;
1515 --disable-mmx2)
1516 _mmx2=no
1517 ;;
1518 --disable-mtrr)
1519 _mtrr=no
1520 ;;
1521 --disable-gl)
1522 _gl=no
1523 ;;
1524 --disable-sdl)
1525 _sdl=no
1526 ;;
1527 --disable-aa)
1528 _aa=no
1529 ;;
1530 --disable-ggi)
1531 _ggi=no
1532 ;;
1533 --disable-mga)
1534 _mga=no
1535 ;;
1536 --disable-xmga)
1537 _xmga=no
1538 ;;
1539 --disable-xv)
1540 _xv=no
1541 ;;
1542 --disable-vm)
1543 _vm=no
1544 ;;
1545 --disable-xinerama)
1546 _xinerama=no
1547 ;;
1548 --disable-mlib)
1549 _mlib=no
1550 ;;
1551 --disable-svga)
1552 _svga=no
1553 ;;
1554 --disable-dga)
1555 _dga=no
1556 ;;
1557 --disable-dga2)
1558 _dga2=no
1559 ;;
1560 --disable-fbdev)
1561 _fbdev=no
1562 ;;
1563 --disable-dxr3)
1564 _dxr3=no
1565 ;;
1566 --disable-dvb)
1567 _dvb=no
1568 ;;
1569 --disable-lirc)
1570 _lirc=no
1571 ;;
1572 --disable-iconv)
1573 _iconv=no
1574 ;;
1575 --disable-termcap)
1576 _termcap=no
1577 ;;
1578 --disable-select)
1579 _select='#undef HAVE_AUDIO_SELECT'
1580 ;;
1581 --disable-win32)
1582 _win32libdir=
1583 _win32=no
1584 _dshow=no # no dshow without win32dlls
1585 ;;
1586 --disable-dshow)
1587 _dshow=no
1588 ;;
1589 --disable-xanim)
1590 _xanim=no
1591 _xanimlibdir=
1592 ;;
1593 --disable-fastmemcpy)
1594 _fastmemcpy=no
1595 ;;
1596 --disable-gui)
1597 _gui=no
1598 ;;
1599 --disable-tv)
1600 _tv=no
1601 ;;
1602 --disable-alsa)
1603 _alsaver='notfound'
1604 _alsa=no
1605 ;;
1606 --disable-esd)
1607 _esd=no
1608 ;;
1609 --disable-ossaudio)
1610 _oss_audio=no
1611 ;;
1612 --disable-sunaudio)
1613 _sun_audio=no
1614 ;;
1615 --disable-divx4)
1616 _divx4linux=no
1617 ;;
1618 --disable-vorbis)
1619 _vorbis=no
1620 ;;
1621 --with-win32libdir=*)
1622 _win32libdir=`echo $ac_option | cut -d '=' -f 2`
1623 _win32=yes
1624 ;;
1625 --with-xanimlibdir=*)
1626 _xanimlibdir=`echo $ac_option | cut -d '=' -f 2`
1627 _xanim=yes
1628 ;;
1629 --with-csslibdir=*)
1630 _csslibdir=`echo $ac_option | cut -d '=' -f 2`
1631 _css=yes
1632 ;;
1633 --with-cssincdir=*)
1634 _cssincdir=`echo $ac_option | cut -d '=' -f 2`
1635 _css=yes
1636 ;;
1637 --with-mlibdir=*)
1638 _mlibdir=`echo $ac_option | cut -d '=' -f 2`
1639 _mlib=yes
1640 ;;
1641 --size-x=*)
1642 _x=`echo $ac_option | cut -d '=' -f 2`
1643 ;;
1644 --size-y=*)
1645 _y=`echo $ac_option | cut -d '=' -f 2`
1646 ;;
1647 --with-x11libdir=*)
1648 ;;
1649 --with-x11incdir=*)
1650 ;;
1651 --with-extralibdir=*)
1652 ;;
1653 --with-extraincdir=*)
1654 ;;
1655 --with-dvbincdir=*)
1656 ;;
1657 --prefix=*)
1658 _prefix=`echo $ac_option | cut -d '=' -f 2`
1659 ;;
1660 --datadir=*)
1661 _datadir=`echo $ac_option | cut -d '=' -f 2`
1662 ;;
1663 --cc=*)
1664 ;;
1665 --as=*)
1666 ;;
1667 --target=*)
1668 ;;
1669 --disable-x11*)
1670 ;;
1671 --disable-syncfb*)
1672 ;;
1673 --enable-static*)
1674 ;;
1675 --disable-static*)
1676 ;;
1677 *)
1678 echo "Unknown parameter: $ac_option"
1679 ;;
1680 esac
1681 done
1682
1683 # Atmos: moved this here, to be correct, if --prefix is specified
1684 if test -z "$_datadir" ; then
1685 _datadir=$_prefix"/share/mplayer"
1686 fi
1687
1688 # Checking assembler (_as) compatibility...
1689 # Added workaround for older as that reads from stdin by default - atmos
1690 as_version=`echo '' | $_as -version 2>&1 | sed -n 's/^.*assembler \(version \)*\([0-9.]*\).*$/\2/p'`
1691 echo $_echo_n "Checking assembler ($_as) ... $as_version, $_echo_c"
1692 _pref_as_version='2.9.1'
1693 ### this test disabled, see _binutils test above! --A'rpi
1694 # cat > astest.S <<EOF
1695 # filds -2(%ebp)
1696 # EOF
1697 # $_as astest.S -o astest.o > /dev/null 2>&1 || as_verc_fail=yes
1698
1699 cat > $TMPS <<EOF
1700 nop
1701 EOF
1702
1703 if test "$_mmx" = yes ; then
1704 cat >> $TMPS <<EOF
1705 emms
1706 EOF
1707 fi
1708
1709 if test "$_3dnow" = yes ; then
1710 _pref_as_version='2.10.1'
1711 cat >> $TMPS <<EOF
1712 femms
1713 EOF
1714 fi
1715
1716 if test "$_3dnowex" = yes ; then
1717 _pref_as_version='2.10.1'
1718 cat >> $TMPS <<EOF
1719 pswapd %mm0, %mm0
1720 EOF
1721 fi
1722
1723 if test "$_mmx2" = yes ; then
1724 _pref_as_version='2.10.1'
1725 cat >> $TMPS <<EOF
1726 movntq %mm0, (%eax)
1727 EOF
1728 fi
1729
1730 if test "$_sse" = yes ; then
1731 _pref_as_version='2.10.1'
1732 cat >> $TMPS <<EOF
1733 xorps %xmm0, %xmm0
1734 EOF
1735 fi
1736 # Note: for SSE2 assembler v2.11 should be preferred --Nick
1737 #if test "$_sse2" = yes ; then
1738 #_pref_as_version='2.11'
1739 #cat >> $TMPS <<EOF
1740 #xorpd %xmm0, %xmm0
1741 #EOF
1742 #fi
1743 $_as $TMPS -o $TMPO > /dev/null 2>&1 || as_verc_fail=yes
1744
1745 if test "$as_verc_fail" != yes ; then
1746 echo "ok"
1747 else
1748 echo "failed"
1749 echo "Please upgrade(downgrade) binutils to "$_pref_as_version"..."
1750 if test "$_skip_as_check" != yes ; then
1751 die "Bad binutils version"
1752 else 2118 else
1753 echo "YOU'VE SELECTED '--disable-as-checking'. PLEASE DON'T SEND US ANY BUGREPORTS!" 2119 die "the GUI requires the X11 extension XShape (which was not found)"
1754 fi 2120 fi
1755 fi 2121 echores "$_xshape"
1756 2122
1757 # Atmosfear: Checking kernel support for cpu extensions ... 2123
1758 extcheck() { 2124 # Check for GTK:
1759 if test "$1" = yes ; then 2125 echocheck "gtk version"
1760 echo $_echo_n "Checking $2 support in Kernel ... $_echo_c" 2126 if test -z "$_gtkconfig" ; then
1761 cat > $TMPC <<EOF 2127 if ( gtk-config --version ) >/dev/null 2>&1 ; then
1762 int main(void){__asm__ __volatile__ ("$3":::"memory");return(0);} 2128 _gtkconfig="gtk-config"
1763 EOF 2129 elif ( gtk12-config --version ) >/dev/null 2>&1 ; then
1764 2130 _gtkconfig="gtk12-config"
1765 if (cc_check && $TMPO) > /dev/null 2>&1 ; then 2131 else
1766 echo "ok" 2132 die "the GUI requires GTK (which was not found)"
1767 return 1
1768 else
1769 echo "failed"
1770 echo "It seems that your kernel does not correctly support $2."
1771 echo "To use $2 extensions in MPlayer, you have to upgrade/recompile your kernel!"
1772 return 0
1773 fi
1774 fi
1775 return 1
1776 }
1777 if test "$_kernelextcheck" = yes ; then
1778 if extcheck $_mmx "mmx" "emms" ; then _mmx=no ; fi
1779 if extcheck $_3dnow "3dnow" "femms" ; then _3dnow=no ; fi
1780 if extcheck $_3dnowex "3dnowex" "pswapd %%mm0, %%mm0" ; then _3dnowex=no ; fi
1781 if extcheck $_mmx2 "mmx2" "sfence" ; then _mmx2=no ; fi
1782 if extcheck $_sse "sse" "xorps %%xmm0, %%xmm0" ; then _sse=no ; fi
1783 #if extcheck $_sse2 "sse2" "xorpd %%xmm0, %%xmm0" ; then _sse2=no ; fi
1784 fi
1785
1786 # Checking kernel version...
1787 if linux ; then
1788 _k_verc_problem=no
1789 kernel_version=`uname -r 2>&1`
1790 echo $_echo_n "Checking $system_name kernel version ... $_echo_c"
1791 case "$kernel_version" in
1792 '') kernel_version="?.??"; _k_verc_fail=yes;;
1793 [0-1].[0-9].[0-9]*|2.[0-3].[0-9]*)
1794 _k_verc_problem=yes;;
1795 esac
1796 if test "$_k_verc_problem" = yes && test "$_sse" = yes ; then
1797 _k_verc_fail=yes
1798 fi 2133 fi
1799 if test "$_k_verc_fail" ; then 2134 fi
1800 echo "$kernel_version, fail" 2135 _gtk=`$_gtkconfig --version 2>&1`
1801 echo "WARNING! If you want to run mplayer on this system, be prepared for problems!" 2136 _inc_gtk=`$_gtkconfig --cflags 2>&1`
1802 echo "(SSE support of 2.2.x series is limited. Upgrade kernel or use --disable-sse)" 2137 _ld_gtk=`$_gtkconfig --libs 2>&1`
2138 echores "$_gtk (with $_gtkconfig)"
2139
2140 # Check for GLIB
2141 echocheck "glib version"
2142 if test -z "$_glibconfig" ; then
2143 if ( glib-config --version ) >/dev/null 2>&1 ; then
2144 _glibconfig="glib-config"
2145 elif ( glib12-config --version ) >/dev/null 2>&1 ; then
2146 _glibconfig="glib12-config"
1803 else 2147 else
1804 echo "$kernel_version, ok" 2148 die "the GUI requires GLIB (which was not found)"
1805 fi 2149 fi
1806 fi 2150 fi
1807 2151 _glib=`$_glibconfig --version 2>&1`
1808 if test "$_xmga" = "autodetect" ; then 2152 _inc_glib=`$_glibconfig --cflags 2>&1`
1809 if test "$_x11" = yes && test "$_mga" = yes ; then 2153 _ld_glib=`$_glibconfig --libs 2>&1`
1810 _xmga=yes 2154 echores "$_glib (with $_glibconfig)"
1811 else 2155
1812 _xmga=no 2156 _def_gui='#define HAVE_NEW_GUI 1'
1813 fi 2157 _ld_gui='-LGui -lgui $(GTKLIB) $(GLIBLIB)'
1814 fi 2158
1815 2159 cat > Gui/config2.mak << EOF
1816 if test "$_xanim" = yes && test "$_libdl" = no ; then 2160 # -------- Generated by configure2 -----------
1817 if freebsd ; then 2161
1818 _xanim=yes 2162 GTKINC = $_inc_gtk
1819 else 2163 GTKLIBS = $_ld_gtk
1820 _xanim=no 2164 GLIBINC = $_inc_glib
1821 fi 2165 GLIBLIBS = $_ld_glib
1822 fi 2166
1823 2167 EOF
1824 # to screen. 2168
1825 echo "Install prefix: $_prefix" 2169 else
1826 echo "Data directory: $_datadir" 2170 _def_gui='#undef HAVE_NEW_GUI'
1827 if test "$host_arch" = i386 || test "$host_arch" = i486 || test "$host_arch" = i586 || test "$host_arch" = i686 ; then 2171 fi
1828 echo "Checking for cpu vendor ... $pvendor ( $pfamily:$pmodel:$pstepping )" 2172 # --------------- GUI specific tests end -------------------
1829 echo "Checking for cpu type ... $pname" 2173
1830 fi 2174
1831 echo "Optimizing to ... $proc" 2175
1832 if test "$host_arch" = i386 || test "$host_arch" = i486 || test "$host_arch" = i586 || test "$host_arch" = i686 ; then 2176 #############################################################################
1833 echo "Checking for mmx support ... $_mmx"
1834 echo "Checking for mmx2 support ... $_mmx2"
1835 echo "Checking for 3dnow support ... $_3dnow"
1836 echo "Checking for 3dnowex support ... $_3dnowex"
1837 echo "Checking for sse support ... $_sse"
1838 echo "Checking for mtrr support ... $_mtrr"
1839 fi
1840 echo "Screen size ... ${_x}x${_y}"
1841 echo "Checking for X11 libs ... $_x11libdir"
1842 echo "Checking for X11 headers ... $_x11incdir"
1843 if test "$_vo2" = yes ; then
1844 echo "Checking for libvo2 ... $_vo2"
1845 else
1846 echo "Checking mga_vid device ... $_mga"
1847 echo "Checking for xmga ... $_xmga"
1848 echo "Checking for SDL ... $_sdl (with $_sdlconfig)"
1849 echo "Checking for AA ... $_aa"
1850 echo "Checking for GGI ... $_ggi"
1851 echo "Checking for OpenGL ... $_gl"
1852 echo "Checking for Xv ... $_xv"
1853 echo "Checking for Xinerama ... $_xinerama"
1854 echo "Checking for X11 ... $_x11"
1855 echo "Checking for DGA ... $_dga"
1856 echo "Checking for DGA 2.0 .. $_dga2"
1857 echo "Checking for Xf86VM ... $_vm"
1858 echo "Checking for SVGAlib ... $_svga"
1859 echo "Checking for FBDev ... $_fbdev"
1860 echo "Checking for DVB ... $_dvb"
1861 echo "Checking for DXR3/H+ ... $_dxr3"
1862 fi
1863 echo "Checking for OSS Audio ... $_oss_audio"
1864 echo "Checking for ALSA Audio ... $_alsaver"
1865 echo "Checking for ESD Audio ... $_esd"
1866 echo "Checking for Sun Audio ... $_sun_audio"
1867 echo "Checking for Sun mediaLib ... $_mlib"
1868 echo "Checking for SGI Audio ... $_sgi_audio"
1869 echo "Checking for LIRC ... $_lirc"
1870 echo "Checking for DeCSS support ... $_css"
1871 echo "Checking for DVDread support ... $_dvdread"
1872 echo "Checking for PNG support ... $_png"
1873 echo "Checking for mad support ... $_mad"
1874 echo "Checking for OggVorbis support ... $_vorbis"
1875 echo "Checking for Win32 DLL support ... $_win32"
1876 echo "Checking for XAnim DLL support ... $_xanim"
1877 echo "Checking for DirectShow ... $_dshow"
1878 echo "Checking for iconv function ... $_iconv"
1879 echo "Checking for zlib ... $_zlib"
1880
1881 # check if compiler supports C++ and C++-libs are installed correctly
1882 if test "$_win32" = yes && test "$_dshow" = yes ; then
1883 cat > "$TMPCPP" << EOF
1884 /* very useful C++ test program by atmos */
1885 #include <string>
1886
1887 class myclass {
1888 private:
1889 int ret;
1890 public:
1891 int myreturn(void);
1892 };
1893
1894 int myclass::myreturn(void) {
1895 ret = 0;
1896 return ret;
1897 }
1898
1899 int main(void) {
1900 myclass myobject;
1901 return myobject.myreturn();
1902 }
1903 EOF
1904 echo $_echo_n "Checking if your compiler '$_cc' supports C++ ... $_echo_c"
1905 if ( "$_cc" "$TMPCPP" -o "$TMPO" ) > /dev/null 2>&1 ; then
1906 echo yes
1907 echo $_echo_n "Checking for proper C++ runtime enviroment ... $_echo_c"
1908 if "$TMPO" ; then
1909 echo yes
1910 else
1911 echo no
1912 cat << EOF
1913 Your C++ runtime enviroment is broken, make sure you correctly install the
1914 C++ libraries (libstdc++) and that the library path containing them is in
1915 your (/etc/)ld.so.conf!
1916 If you don't need DirectShow support, you can also use:
1917 ./configure --disable-dshow <your-normal-configure-options>
1918 to disable building of the C++ based DirectShow code.
1919 EOF
1920 die "C++ runtime enviroment broken"
1921 fi
1922 else
1923 echo no
1924 cat << EOF
1925 Your C++ compiler does not support C++, make sure you have enabled it on
1926 compiler compilation or for binary packages, make sure the appropriate
1927 packages are installed!
1928 If you don't need DirectShow support, you can also use:
1929 ./configure --disable-dshow <your-normal-configure-options>
1930 to disable building of the C++ based DirectShow code.
1931 EOF
1932 die "C++ compiler not supporting C++"
1933 fi
1934 fi
1935
1936 echo "Checking for libavcodec ... $_libavcodec"
1937 echo "Checking for libffmpeg.so ... $_libavcodec_so"
1938 echo "Checking for divx4linux ... $_divx4linux"
1939 echo "Checking for fastmemcpy ... $_fastmemcpy"
1940 echo "Checking for TV Interface ... $_tv"
1941 echo "Extra libs : $_extralibdir"
1942 echo "Extra headers : $_extraincdir"
1943 # write conf files.
1944
1945 if test "$_gui" = yes ; then
1946 # --------------- GUI begin -------------------
1947
1948 echo
1949
1950 # Check for GTK:
1951 echo $_echo_n "Checking for gtk version ... $_echo_c"
1952 if test -z "$_gtkconfig" ; then
1953 if ( gtk-config --version ) >/dev/null 2>&1 ; then
1954 _gtkconfig="gtk-config"
1955 elif ( gtk12-config --version ) >/dev/null 2>&1 ; then
1956 _gtkconfig="gtk12-config"
1957 else
1958 die "gtk not found"
1959 fi
1960 fi
1961 _gtk=`$_gtkconfig --version 2>&1`
1962 _gtkinc=`$_gtkconfig --cflags 2>&1`
1963 _gtklib=`$_gtkconfig --libs 2>&1`
1964 echo "$_gtk (with $_gtkconfig)"
1965
1966
1967 # Check for GLIB
1968 echo $_echo_n "Checking for glib version ... $_echo_c"
1969 if test -z "$_glibconfig" ; then
1970 if ( glib-config --version ) >/dev/null 2>&1 ; then
1971 _glibconfig="glib-config"
1972 elif ( glib12-config --version ) >/dev/null 2>&1 ; then
1973 _glibconfig="glib12-config"
1974 else
1975 die "glib not found"
1976 fi
1977 fi
1978 _glib=`$_glibconfig --version 2>&1`
1979 _glibinc=`$_glibconfig --cflags 2>&1`
1980 _gliblib=`$_glibconfig --libs 2>&1`
1981 echo "$_glib (with $_glibconfig)"
1982
1983 cat > Gui/config.mak << EOF
1984
1985 # -------- Generated by ./configure -----------
1986
1987 GTKINC=$_gtkinc
1988 GTKLIBS=$_gtklib
1989 GLIBINC=$_glibinc
1990 GLIBLIBS=$_gliblib
1991
1992 EOF
1993
1994
1995 # --------------- GUI end -------------------
1996 fi
1997
1998 _streamingdef='#undef STREAMING'
1999 if test "$_streaming" = yes ; then
2000 # _streamingsrcs='asf_streaming.c network.c url.c http.c'
2001 _streamingdef='#define STREAMING'
2002 fi
2003
2004 if test "$_gl" = yes ; then
2005 # XXX check this for OpenBSD & BSD/OS
2006 if freebsd || openbsd ; then
2007 # Under XFree86 4.x GL port is poorly designed
2008 if test -r /usr/X11R6/bin/XFree86 ; then
2009 _gllib='-lGL -pthread'
2010 else
2011 _gllib='-lGL'
2012 fi
2013 else
2014 _gllib='-lGL'
2015 fi
2016 fi
2017
2018 _cssdef='#undef HAVE_LIBCSS'
2019 _csslib=''
2020 _cssinc=''
2021
2022 if test "$_dvdread" = yes ; then
2023 _csslib='-ldvdread'
2024 _dvdreaddef='#define USE_DVDREAD'
2025 _css=no
2026 else
2027 _dvdreaddef='#undef USE_DVDREAD'
2028
2029 if test "$_css" = yes ; then
2030 if test "$_csslibdir" ; then
2031 _csslib="-L${_csslibdir} -lcss"
2032 else
2033 _csslib='-lcss'
2034 fi
2035 _cssdef='#define HAVE_LIBCSS'
2036 if test "$_cssincdir" ; then
2037 _cssinc="-I${_cssincdir}"
2038 else
2039 _cssinc=""
2040 fi
2041 fi
2042
2043 fi
2044
2045
2046 if test "$_win32" = yes ; then
2047 _use_win32dll="#define USE_WIN32DLL 1"
2048 _win32lib="-Lloader -lloader"
2049 _win32dep="loader/libloader.a"
2050 if test "$_dshow" = yes ; then
2051 _use_directshow="#define USE_DIRECTSHOW"
2052 _dshowlib="-Lloader/DirectShow -lDS_Filter -lstdc++"
2053 _dshowdep="loader/DirectShow/libDS_Filter.a"
2054 else
2055 _dshow="#undef USE_DIRECTSHOW"
2056 _dshowlib=
2057 _dshowdep=
2058 fi
2059 else
2060 _use_win32dll="#undef USE_WIN32DLL"
2061 _win32lib=
2062 _win32dep=
2063 _use_directshow="#undef USE_DIRECTSHOW"
2064 _dshowlib=
2065 _dshowdep=
2066 fi
2067
2068 if test "$_xanim" = yes ; then
2069 _use_xanim="#define USE_XANIM 1"
2070 _xanim_path="#define XACODEC_PATH \"$_xanimlibdir\""
2071 else
2072 _use_xanim="#undef USE_XANIM"
2073 _xanim_path=
2074 fi
2075
2076
2077 if test "$_libavcodec" = yes ; then
2078 _lavclib='-Llibavcodec -lavcodec'
2079 _lavcdep='libavcodec/libavcodec.a'
2080 _libavcodec='#define USE_LIBAVCODEC'
2081 _libavcodecso='#undef USE_LIBAVCODEC_SO'
2082 _ffpostprocess='#define FF_POSTPROCESS'
2083 else
2084 if test "$_libavcodec_so" = yes ; then
2085 _lavclib='-lffmpeg'
2086 _lavcdep=''
2087 _libavcodec='#define USE_LIBAVCODEC'
2088 _libavcodecso='#define USE_LIBAVCODEC_SO'
2089 _ffpostprocess='#define FF_POSTPROCESS'
2090 else
2091 _lavclib=''
2092 _lavcdep=''
2093 _libavcodec='#undef USE_LIBAVCODEC'
2094 _libavcodecso='#undef USE_LIBAVCODEC'
2095 _ffpostprocess='#undef FF_POSTPROCESS'
2096 fi
2097 fi
2098
2099 if test "$_fastmemcpy" = yes ; then
2100 _fastmemcpy='#define USE_FASTMEMCPY'
2101 else
2102 _fastmemcpy='#undef USE_FASTMEMCPY'
2103 fi
2104
2105 if test "$_x11" = yes ; then
2106 if test "$_xdpms_3" = yes ; then
2107 _x11lib='-lX11 -lXext -lXdpms'
2108 _have_xdpms='#define HAVE_XDPMS 1'
2109 elif test "$_xdpms_4" = yes ; then
2110 _x11lib='-lX11 -lXext'
2111 _have_xdpms='#define HAVE_XDPMS 1'
2112 else
2113 _x11lib='-lX11 -lXext'
2114 _have_xdpms='#undef HAVE_XDPMS'
2115 fi
2116 fi
2117
2118 if test "$_xv" = yes ; then
2119 _xvlib='-lXv'
2120 fi
2121
2122 if test "$_xinerama" = yes ; then
2123 _xineramalib='-lXinerama'
2124 fi
2125
2126 if test "$_sdl" = yes ; then
2127 _sdllib=`$_sdlconfig --libs`
2128 _sdlcflags=`$_sdlconfig --cflags`
2129 fi
2130
2131 if test "$_ggi" = yes ; then
2132 _ggilib='-lggi'
2133 fi
2134
2135 if test "$_dga" = yes ; then
2136 _dgalib='-lXxf86dga'
2137 fi
2138
2139 if test "$_svga" = yes ; then
2140 _svgalib='-lvgagl -lvga'
2141 fi
2142
2143 if test "$_vm" = yes ; then
2144 _vmlib='-lXxf86vm'
2145 fi
2146
2147 if test "$_termcap" = yes ; then
2148 _termcap='#define USE_TERMCAP'
2149 _libtermcap='-ltermcap'
2150 else
2151 _termcap='#undef USE_TERMCAP'
2152 _libtermcap=''
2153 fi
2154
2155 if test "$_kstat" = yes ; then
2156 _have_libkstat="#define HAVE_LIBKSTAT 1"
2157 else
2158 _have_libkstat="#undef HAVE_LIBKSTAT"
2159 fi
2160
2161 if test "$_xmmp" = yes ; then
2162 _xmmpaudio='#define USE_XMMP_AUDIO'
2163 _xmmplibs='-Llibxmm -lxmm'
2164 else
2165 _xmmpaudio='#undef USE_XMMP_AUDIO'
2166 fi
2167
2168 if test "$_iconv" = yes ; then
2169 _iconv='#define USE_ICONV'
2170 if freebsd ; then
2171 _iconvlib="-lgiconv"
2172 elif bsdos ; then
2173 _iconvlib="-liconv"
2174 fi
2175 else
2176 _iconv='#undef USE_ICONV'
2177 fi
2178
2179 if test "$_lirc" = yes ; then
2180 _lircdefs='#define HAVE_LIRC'
2181 _lirclibs='-llirc_client'
2182 else
2183 _lircdefs='#undef HAVE_LIRC'
2184 _lirclibs=''
2185 fi
2186
2187 if test "$_png" = yes ; then
2188 _libpng='-lpng -lz'
2189 fi
2190
2191
2192 if test "$_vorbis" = yes ; then
2193 _vorbis='#define HAVE_OGGVORBIS'
2194 _libvorbis='-lvorbis -lm'
2195 else
2196 _vorbis='#undef HAVE_OGGVORBIS'
2197 fi
2198
2199 _aosrc=''
2200
2201 _alsa5='#undef HAVE_ALSA5'
2202 _alsa9='#undef HAVE_ALSA9'
2203 if test "$_alsa" = yes ; then
2204 if test "$_alsaver" = '0.5.x' ; then
2205 _aosrc="$_aosrc ao_alsa5.c"
2206 _alsa5='#define HAVE_ALSA5'
2207 _alsalib='-lasound';
2208 elif test "$_alsaver" = '0.9.x' ; then
2209 _aosrc="$_aosrc ao_alsa9.c"
2210 _alsa9='#define HAVE_ALSA9'
2211 _alsalib='-lasound'
2212 fi
2213 fi
2214
2215 _esdd='#undef HAVE_ESD'
2216 #if test "$_esd" = yes ; then
2217 # _esdd='#define HAVE_ESD'
2218 # _aosrc="$_aosrc ao_esd.c"
2219 # _esdlib='-lesd'
2220 #fi
2221
2222 if test "$_oss_audio" = yes ; then
2223 _ossaudio='#define USE_OSS_AUDIO'
2224 _aosrc="$_aosrc ao_oss.c"
2225 else
2226 _ossaudio='#undef USE_OSS_AUDIO'
2227 fi
2228
2229 if test "$_sun_audio" = yes ; then
2230 _sunaudio='#define USE_SUN_AUDIO'
2231 _aosrc="$_aosrc ao_sun.c"
2232 else
2233 _sunaudio='#undef USE_SUN_AUDIO'
2234 fi
2235
2236 if [ "$_sgi_audio" = "yes" ]; then
2237 _sgiaudio='#define USE_SGI_AUDIO'
2238 _aosrc="$_aosrc ao_sgi.c"
2239 _sgi_audio_lib='-laudio'
2240 else
2241 _sgiaudio='#undef USE_SGI_AUDIO'
2242 fi
2243
2244 if test "$_sys_soundcard_h" = yes ; then
2245 _have_soundcard_h='#define HAVE_SYS_SOUNDCARD_H 1'
2246 else
2247 _have_soundcard_h='#undef HAVE_SYS_SOUNDCARD_H'
2248 fi
2249
2250 if test "$_malloc_h" = yes ; then
2251 _have_malloc_h='#define HAVE_MALLOC_H 1'
2252 else
2253 _have_malloc_h='#undef HAVE_MALLOC_H'
2254 fi
2255 # malloc.h emits a warning in FreeBSD
2256 freebsd && _have_malloc_h='#undef HAVE_MALLOC_H'
2257
2258 if test "$_memalign" = yes ; then
2259 _have_memalign='#define HAVE_MEMALIGN 1'
2260 else
2261 _have_memalign='#undef HAVE_MEMALIGN'
2262 fi
2263
2264 if test "$_alloca_h" = yes ; then
2265 _have_alloca_h='#define HAVE_ALLOCA_H 1'
2266 else
2267 _have_alloca_h='#undef HAVE_ALLOCA_H'
2268 fi
2269
2270 if test "$_sys_mman_h" = yes ; then
2271 _have_mman_h='#define HAVE_SYS_MMAN_H 1'
2272 else
2273 _have_mman_h='#undef HAVE_SYS_MMAN_H'
2274 fi
2275
2276 if test "$_libdl" = yes ; then
2277 _have_libdl='#define HAVE_LIBDL 1'
2278 else
2279 _have_libdl='#undef HAVE_LIBDL'
2280 fi
2281
2282 if test "$_zlib" = yes ; then
2283 _have_zlib='#define HAVE_ZLIB 1'
2284 _zlib='-lz'
2285 else
2286 _have_zlib='#undef HAVE_ZLIB'
2287 _zlib=''
2288 fi
2289
2290 if test "$_vsscanf" = yes ; then
2291 _have_vsscanf='#define HAVE_VSSCANF 1'
2292 else
2293 _have_vsscanf='#undef HAVE_VSSCANF'
2294 fi
2295 2177
2296 # Checking for CFLAGS 2178 # Checking for CFLAGS
2297 if test "$_profile" || test "$_debug" ; then 2179 if test "$_profile" || test "$_debug" ; then
2298 CFLAGS="-W -Wall -O2 $_march $_mcpu $_debug $_profile" 2180 CFLAGS="-W -Wall -O2 $_march $_mcpu $_debug $_profile"
2299 elif test -z "$CFLAGS" ; then 2181 elif test -z "$CFLAGS" ; then
2300 if [ "$host_arch" != "mips" ]; then 2182 if [ "$host_arch" != "mips" ]; then
2301 CFLAGS="-O4 $_march $_mcpu -pipe -ffast-math -fomit-frame-pointer" 2183 CFLAGS="-O4 $_march $_mcpu -pipe -ffast-math -fomit-frame-pointer"
2302 else 2184 else
2303 CFLAGS="-O4 $_march $_mcpu -ffast-math -fomit-frame-pointer" 2185 CFLAGS="-O4 $_march $_mcpu -ffast-math -fomit-frame-pointer"
2304 fi 2186 fi
2305 else 2187 else
2306 cat <<EOF 2188 cat <<EOF
2307 MPlayer is using custom CFLAGS set by you, it is strongly recommended that you 2189
2308 let MPlayer choose the correct CFLAGS! 2190 MPlayer compilation will use CFLAGS set by you, but:
2309 To do so execute CFLAGS= ./configure <your options> 2191 DO NOT BUGREPORT IF IT DOES NOT WORK
2310 EOF 2192
2311 fi 2193 It is strongly recommended you let MPlayer choose the correct CFLAGS!
2312 2194 To do so, execute 'CFLAGS= ./configure <options>'
2313 # XXX check this for OpenBSD and BSD/OS 2195
2314 # Mandatory for MT applications on Linux & FreeBSD 2196 EOF
2197 fi
2198
2199 # Thread support
2315 if linux ; then 2200 if linux ; then
2316 CFLAGS="$CFLAGS -D_REENTRANT" 2201 CFLAGS="$CFLAGS -D_REENTRANT"
2317 elif bsd ; then 2202 elif bsd ; then
2203 # FIXME bsd needs this so maybe other OS'es
2318 CFLAGS="$CFLAGS -D_THREAD_SAFE" 2204 CFLAGS="$CFLAGS -D_THREAD_SAFE"
2319 fi 2205 fi
2320
2321 2206
2322 # 64 bit file offsets? 2207 # 64 bit file offsets?
2323 if test "$_largefiles" = yes || freebsd ; then 2208 if test "$_largefiles" = yes || freebsd ; then
2324 CFLAGS="$CFLAGS -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64" 2209 CFLAGS="$CFLAGS -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64"
2325 if test "$_dvdread" = yes ; then 2210 if test "$_dvdread" = yes ; then
2326 # dvdread support requires this (for off64_t) 2211 # dvdread support requires this (for off64_t)
2327 CFLAGS="$CFLAGS -D_LARGEFILE64_SOURCE" 2212 CFLAGS="$CFLAGS -D_LARGEFILE64_SOURCE"
2328 fi 2213 fi
2329 fi 2214 fi
2330 2215
2331 # echo 'CFLAGS=$(OPTFLAGS) -Wall -DMPG12PLAY' >> config.mak 2216 # Determine OS dependent libs
2332 2217 _confcygwin="TARGET_CYGWIN = no"
2333 echo "Creating $CCONF" 2218 if bsd ; then
2334 2219 _ld_arch="-rdynamic -pthread"
2335 if test "$_mmx" = yes ; then 2220 elif cygwin ; then
2336 _mmx='#define HAVE_MMX' 2221 _confcygwin="TARGET_CYGWIN = yes"
2337 _cfg_mmx=yes 2222 _def_confwin32="#define WIN32"
2338 else 2223 _ld_arch="-lpthread"
2339 _mmx='#undef HAVE_MMX' 2224 else
2340 _cfg_mmx=no 2225 _ld_arch="-ldl -lpthread"
2341 fi 2226 fi
2342 2227
2343 if test "$_mmx2" = yes ; then 2228 bsdos && _ld_arch="$_ld_arch -ldvd"
2344 _mmx2='#define HAVE_MMX2' 2229
2345 _cfg_mmx2=yes 2230 _def_debug='#undef MP_DEBUG'
2346 else 2231 test "$_debug" && _def_debug='#define MP_DEBUG 1'
2347 _mmx2='#undef HAVE_MMX2' 2232
2348 _cfg_mmx2=no 2233 _def_linux='#undef TARGET_LINUX'
2349 fi 2234 linux && _def_linux='#define TARGET_LINUX 1'
2350 2235
2351 if test "$_3dnow" = yes ; then 2236
2352 _3dnowm='#define HAVE_3DNOW' 2237 #############################################################################
2353 _cfg_3dnow=yes 2238 echo "Creating config2.mak"
2354 else 2239 cat > config2.mak << EOF
2355 _3dnowm='#undef HAVE_3DNOW' 2240 # -------- Generated by ./configure2 -----------
2356 _cfg_3dnow=no 2241
2357 fi 2242 LANG = C
2358 2243 TARGET_OS = $system_name
2359 if test "$_3dnowex" = yes ; then
2360 _3dnowexm='#define HAVE_3DNOWEX'
2361 _cfg_3dnowex=yes
2362 else
2363 _3dnowexm='#undef HAVE_3DNOWEX'
2364 _cfg_3dnowex=no
2365 fi
2366
2367 if test "$_sse" = yes ; then
2368 _ssem='#define HAVE_SSE'
2369 _cfg_sse=yes
2370 else
2371 _ssem='#undef HAVE_SSE'
2372 _cfg_sse=no
2373 fi
2374
2375 # ---
2376
2377 _vosrc=''
2378 #_aosrc=''
2379
2380 if test "$_aa" = yes ; then
2381 _aa='#define HAVE_AA'
2382 _vosrc=$_vosrc' vo_aa.c'
2383 _aalib='-laa'
2384 else
2385 _aa='#undef HAVE_AA'
2386 _aalib=''
2387 fi
2388
2389 if test "$_png" = yes ; then
2390 _png='#define HAVE_PNG'
2391 _vosrc=$_vosrc' vo_png.c'
2392 else
2393 _png='#undef HAVE_PNG'
2394 fi
2395
2396 if test "$_mad" = yes ; then
2397 _madlibrary='#define USE_LIBMAD'
2398 _libmad='-lmad'
2399 else
2400 _madlibrary='#undef USE_LIBMAD'
2401 _libmad=
2402 fi
2403
2404 if test "$_mlib" = yes ; then
2405 _mlibdef='#define HAVE_MLIB'
2406 _mlibinc="-I$_mlibdir/include"
2407 _mliblib="-L$_mlibdir/lib -R$_mlibdir/lib -lmlib"
2408 else
2409 _mlibdef='#undef HAVE_MLIB'
2410 _mlibinc= _mliblib=
2411 fi
2412
2413 # ---
2414
2415 if test "$_gl" = yes ; then
2416 _gl='#define HAVE_GL'
2417 _vosrc=$_vosrc' vo_gl.c vo_gl2.c'
2418 else
2419 _gl='#undef HAVE_GL'
2420 fi
2421
2422 if test "$_sdl" = yes ; then
2423 _sdldef='#define HAVE_SDL'
2424 _vosrc=$_vosrc' vo_sdl.c'
2425 _aosrc=$_aosrc' ao_sdl.c'
2426 else
2427 _sdldef='#undef HAVE_SDL'
2428 fi
2429
2430 if test "$_ggi" = yes ; then
2431 _ggi='#define HAVE_GGI'
2432 _vosrc=$_vosrc' vo_ggi.c'
2433 else
2434 _ggi='#undef HAVE_GGI'
2435 fi
2436
2437 if test "$_x11" = yes ; then
2438 _x11='#define HAVE_X11'
2439 _vosrc=$_vosrc' vo_x11.c'
2440 else
2441 _x11='#undef HAVE_X11'
2442 fi
2443
2444 if test "$_xv" = yes ; then
2445 _xv='#define HAVE_XV'
2446 _vosrc=$_vosrc' vo_xv.c'
2447 else
2448 _xv='#undef HAVE_XV'
2449 fi
2450
2451 if test "$_vm" = yes ; then
2452 _vm='#define HAVE_XF86VM'
2453 else
2454 _vm='#undef HAVE_XF86VM'
2455 fi
2456
2457 if test "$_xinerama" = yes ; then
2458 _xinerama='#define HAVE_XINERAMA'
2459 else
2460 _xinerama='#undef HAVE_XINERAMA'
2461 fi
2462
2463 if test "$_mga" = yes ; then
2464 _mga='#define HAVE_MGA'
2465 _vosrc=$_vosrc' vo_mga.c'
2466 else
2467 _mga='#undef HAVE_MGA'
2468 fi
2469
2470 if test "$_xmga" = yes ; then
2471 _vosrc=$_vosrc' vo_xmga.c'
2472 _xmga='#define HAVE_XMGA'
2473 else
2474 _xmga='#undef HAVE_XMGA'
2475 fi
2476
2477 if test "$_syncfb" = yes ; then
2478 _syncfb='#define HAVE_SYNCFB'
2479 _vosrc=$_vosrc' vo_syncfb.c'
2480 else
2481 _syncfb='#undef HAVE_SYNCFB'
2482 fi
2483
2484 if test "$_3dfx" = yes ; then
2485 _3dfx='#define HAVE_3DFX'
2486 _vosrc=$_vosrc' vo_3dfx.c'
2487 else
2488 _3dfx='#undef HAVE_3DFX'
2489 fi
2490
2491 if test "$_tdfxfb" = yes ; then
2492 _tdfxfb='#define HAVE_TDFXFB'
2493 _vosrc=$_vosrc' vo_tdfxfb.c'
2494 else
2495 _tdfxfb='#undef HAVE_TDFXFB'
2496 fi
2497
2498 if test "$_svga" = yes ; then
2499 _svga='#define HAVE_SVGALIB'
2500 _vosrc=$_vosrc' vo_svga.c'
2501 else
2502 _svga='#undef HAVE_SVGALIB'
2503 fi
2504
2505 if test "$_dga" = yes ; then
2506 _dga='#define HAVE_DGA'
2507 # _vosrc=$_vosrc' vo_dga.c vo_fsdga.c'
2508 _vosrc=$_vosrc' vo_dga.c'
2509 else
2510 _dga='#undef HAVE_DGA'
2511 fi
2512
2513 if test "$_dga2" = yes ; then
2514 _dga2='#define HAVE_DGA2'
2515 # _vosrc=$_vosrc' vo_dga.c vo_fsdga.c'
2516 _vosrc=$_vosrc' vo_dga.c'
2517 else
2518 _dga2='#undef HAVE_DGA2'
2519 fi
2520
2521 if test "$_xshape" = yes ; then
2522 _xshape_def='#define HAVE_XSHAPE'
2523 else
2524 _xshape_def='#undef HAVE_XSHAPE'
2525 fi
2526
2527 if test "$_fbdev" = yes ; then
2528 _fbdev='#define HAVE_FBDEV'
2529 _vosrc=$_vosrc' vo_fbdev.c'
2530 else
2531 _fbdev='#undef HAVE_FBDEV'
2532 fi
2533
2534 if test "$_dvb" = yes ; then
2535 _have_dvb='#define HAVE_DVB'
2536 else
2537 _have_dvb='#undef HAVE_DVB'
2538 fi
2539
2540 if test "$_tv" = yes ; then
2541 _tv='#define USE_TV'
2542 else
2543 _tv='#undef USE_TV'
2544 fi
2545
2546 if test "$_vo2" = yes ; then
2547 _vodef='-DUSE_LIBVO2'
2548 _volib='-Llibvo2 -lvo2'
2549 _voinc='-Ilibvo2'
2550 _vodir='libvo2'
2551 else
2552 _vodef=''
2553 _volib='-Llibvo -lvo'
2554 _voinc='-Ilibvo'
2555 _vodir='libvo'
2556 _aosrc=$_aosrc' ao_mpegpes.c'
2557 fi
2558
2559 if test "$_dxr3" = yes ; then
2560 _dxr3='#define HAVE_DXR3'
2561 _dxr3lib='-ldxr3'
2562 _vosrc=$_vosrc' vo_dxr3.c'
2563 _aosrc=$_aosrc' ao_dxr3.c'
2564 else
2565 _dxr3='#undef HAVE_DXR3'
2566 fi
2567
2568 if test "$_gui" = yes ; then
2569 _gui_def='#define HAVE_NEW_GUI'
2570 _gui_lib='-LGui -lgui $(GTKLIB) $(GLIBLIB)'
2571 else
2572 _gui_def='#undef HAVE_NEW_GUI'
2573 _gui_lib=
2574 fi
2575
2576 if test "$_divx4linux" = yes ; then
2577 _divx4def='#define NEW_DECORE'
2578 _decorelibs='-ldivxdecore opendivx/postprocess.o'
2579 _encorelibs='-ldivxencore'
2580 else
2581 _divx4def='#undef NEW_DECORE'
2582 _decorelibs='-Lopendivx -ldecore'
2583 fi
2584
2585 if test "$_debug" ; then
2586 _debugdef='#define MP_DEBUG'
2587 else
2588 _debugdef='#undef MP_DEBUG'
2589 fi
2590
2591 if test "$system_name" = "Linux" ; then
2592 _linux_def='#define TARGET_LINUX'
2593 else
2594 _linux_def='#undef TARGET_LINUX'
2595 fi
2596 echo
2597 echo "Creating $MCONF"
2598 cat > $MCONF << EOF
2599
2600 # -------- Generated by ./configure -----------
2601
2602 LANG=C
2603 TARGET_OS=$system_name
2604 prefix = $_prefix 2244 prefix = $_prefix
2605 AR=ar 2245 AR = ar
2606 CC=$_cc 2246 CC = $_cc
2607 # OPTFLAGS=-O4 $_profile $_debug $_march $_mcpu -pipe -fomit-frame-pointer -ffast-math 2247 # OPTFLAGS = -O4 $_profile $_debug $_march $_mcpu -pipe -fomit-frame-pointer -ffast-math
2608 OPTFLAGS=$CFLAGS $_vodef 2248 OPTFLAGS = $CFLAGS
2609 EXTRA_INC=$_extraincdir $_voinc $_gtkinc 2249 EXTRA_INC = $_inc_extra $_inc_gtk
2610 WIN32_PATH=-DWIN32_PATH=\\"$_win32libdir\\" 2250 WIN32_PATH = -DWIN32_PATH=\\"$_win32libdir\\"
2611 VO_INC=$_voinc 2251
2612 2252 STREAMING = $_streaming
2613 X11_INC=$_x11incdir 2253
2614 X11DIR=$_x11libdir 2254 X11_INC = $_inc_x11
2615 X_LIBS=$_x11libdir $_extralibdir $_volib $_volibdir $_gllib $_ggilib $_dxr3lib $_sdllib $_dgalib $_x11lib $_xvlib $_vmlib $_svgalib $_libpng $_socklib $_aalib $_libvorbis $_xineramalib $_libmad $_zlib 2255 X11DIR = $_ld_x11
2616 VO_LIB=$_volib 2256 X_LIBS = $_ld_x11 $_ld_extra $_ld_gl $_ld_ggi $_ld_dxr3 $_ld_sdl $_ld_dga $_ld_xv $_ld_vm $_ld_svga $_ld_png $_ld_sock $_ld_aa $_ld_vorbis $_ld_xinerama $_ld_mad $_ld_z
2617 2257
2618 TERMCAP_LIB=$_libtermcap 2258 TERMCAP_LIB = $_ld_termcap
2619 XMM_LIBS = $_xmmplibs 2259 LIRC_LIBS = $_ld_lirc
2620 LIRC_LIBS = $_lirclibs 2260 CSS_USE = $_css
2621 CSS_USE=$_css 2261 CSS_LIB = $_ld_css
2622 CSS_LIB = $_csslib 2262 SDL_INC = $_inc_sdl
2623 CSS_INC = $_cssinc 2263 W32_DEP = $_dep_win32
2624 SDL_INC = $_sdlcflags 2264 W32_LIB = $_ld_win32
2625 W32_DEP = $_win32dep 2265 DS_DEP = $_dep_dshow
2626 W32_LIB = $_win32lib 2266 DS_LIB = $_ld_dshow
2627 DS_DEP = $_dshowdep 2267 AV_DEP = $_dep_avcodec
2628 DS_LIB = $_dshowlib
2629 AV_DEP = $_lavcdep
2630 AV_LIB = $_lavclib 2268 AV_LIB = $_lavclib
2631 ALSA_LIB = $_alsalib 2269 ALSA_LIB = $ld__alsa
2632 ESD_LIB = $_esdlib 2270 SGI_AUDIO_LIB = $_ld_sgiaudio
2633 SGI_AUDIO_LIB = $_sgi_audio_lib 2271 ARCH_LIBS = $_ld_arch $_ld_iconv
2634 ARCH_LIBS = $_archlibs $_iconvlib 2272 DIVX4LINUX = $_divx4linux
2635 STREAMING=$_streaming 2273 DECORE_LIBS = $_ld_decore
2636 DECORE_LIBS = $_decorelibs 2274 ENCORE_LIBS = $_ld_encore
2637 ENCORE_LIBS = $_encorelibs 2275 HAVE_MLIB = $_mlib
2638 DIVX4LINUX=$_divx4linux 2276 MLIB_INC = $_inc_mlib
2639 MLIB_INC = $_mlibinc 2277 MLIB_LIB = $_ld_mlib
2640 MLIB_LIB = $_mliblib
2641 MADLIB_INC = $_madincdir
2642 MADLIB_LIB = $_madlibdir 2278 MADLIB_LIB = $_madlibdir
2643 DVB_INC = $_dvbincdir 2279 STATIC = $_ld_static
2644 STATIC = $_static
2645 2280
2646 # --- Some stuff for autoconfigure ---- 2281 # --- Some stuff for autoconfigure ----
2647 $_target_arch 2282 $_target_arch
2648 $_confcygwin 2283 $_confcygwin
2649 TARGET_CPU=$iproc 2284 TARGET_CPU=$iproc
2650 TARGET_MMX=$_cfg_mmx 2285 TARGET_MMX = $_mmx
2651 TARGET_MMX2=$_cfg_mmx2 2286 TARGET_MMX2 = $_mmx2
2652 TARGET_3DNOW=$_cfg_3dnow 2287 TARGET_3DNOW = $_3dnow
2653 TARGET_3DNOWEX=$_cfg_3dnowex 2288 TARGET_3DNOWEX = $_3dnowex
2654 TARGET_SSE=$_cfg_sse 2289 TARGET_SSE = $_sse
2655 VODIR=$_vodir 2290
2656 2291 BINUTILS = $_binutils
2657 BINUTILS=$_binutils
2658
2659 HAVE_MLIB=$_mlib
2660 2292
2661 # --- GUI stuff --- 2293 # --- GUI stuff ---
2662 GTKLIB=$_gtklib 2294 GTKLIB = $_ld_gtk
2663 GLIBLIB=$_gliblib 2295 GLIBLIB = $_ld_glib
2664 GUI_LIBS = $_gui_lib 2296 GUI_LIBS = $_ld_gui
2665 GUI=$_gui 2297 GUI = $_gui
2666 DEBUG=-DDEBUG 2298 DEBUG = -DDEBUG
2667 2299
2668 EOF 2300 EOF
2669 2301
2670 cat > $CCONF << EOF 2302 #############################################################################
2671 2303 echo "Creating config2.h"
2672 /* -------- Generated by ./configure ----------- */ 2304 cat > config2.h << EOF
2673 2305 /* -------- Generated by configure2 ----------- */
2674 #define USE_OSD 2306
2675 #define USE_SUB 2307 #define USE_OSD 1
2676 2308 #define USE_SUB 1
2677 $_debugdef 2309
2678 2310 $_def_debug
2679 $_dvdreaddef 2311
2312 $_def_dvdread
2680 2313
2681 /* Common data directory (for fonts, etc) */ 2314 /* Common data directory (for fonts, etc) */
2682 #define DATADIR "$_datadir" 2315 #define DATADIR "$_datadir"
2683 2316
2684 /* Define this to compile stream-caching support, it can be enabled via 2317 /* Define this to compile stream-caching support, it can be enabled via
2685 -cache <kilobytes> */ 2318 -cache <kilobytes> */
2686 #define USE_STREAM_CACHE 2319 #define USE_STREAM_CACHE 1
2687 2320
2688 /* Define for using new DivX4Linux library, instead of open-source OpenDivX */ 2321 /* Define for using new DivX4Linux library, instead of open-source OpenDivX */
2689 /* You have to change DECORE_LIBS in config.mak too! */ 2322 /* You have to change DECORE_LIBS in config.mak too! */
2690 $_divx4def 2323 $_def_decore
2324 $_def_encore
2691 2325
2692 /* Define this to enable avg. byte/sec-based AVI sync method by default: 2326 /* Define this to enable avg. byte/sec-based AVI sync method by default:
2693 (use -bps or -nobps commandline option for run-time method selection) 2327 (use -bps or -nobps commandline option for run-time method selection)
2694 -bps gives better sync for vbr mp3 audio, it is now default */ 2328 -bps gives better sync for vbr mp3 audio, it is now default */
2695 #define AVI_SYNC_BPS 2329 #define AVI_SYNC_BPS 1
2696 2330
2697 /* Undefine this if you want soundcard-only timing by default: 2331 /* Undefine this if you want soundcard-only timing by default:
2698 You can still change this with the -alsa or -noalsa command-line option! 2332 You can still change this with the -alsa or -noalsa command-line option!
2699 (This function was originally impemented to solve ALSA driver's big 2333 (This function was originally impemented to solve ALSA driver's big
2700 buffer problems, but it seems to be useful for every soundcard drivers) */ 2334 buffer problems, but it seems to be useful for every soundcard drivers) */
2701 #define ALSA_TIMER 2335 #define ALSA_TIMER 1
2702 2336
2703 /* Undefine this if you don't want to select mono audio (left or right) 2337 /* Undefine this if you don't want to select mono audio (left or right)
2704 with a stereo MPEG layer 2/3 audio stream. The command-line option 2338 with a stereo MPEG layer 2/3 audio stream. The command-line option
2705 -stereo has three possible values (0 for stereo, 1 for left-only, 2 for 2339 -stereo has three possible values (0 for stereo, 1 for left-only, 2 for
2706 right-only), with 0 being the default. 2340 right-only), with 0 being the default.
2707 */ 2341 */
2708 #define USE_FAKE_MONO 2342 #define USE_FAKE_MONO 1
2709 2343
2710 /* Undefine this if your soundcard driver has no working select(). 2344 /* Undefine this if your soundcard driver has no working select().
2711 If you have kernel Oops, player hangups, or just no audio, you should 2345 If you have kernel Oops, player hangups, or just no audio, you should
2712 try to recompile MPlayer with this option disabled! */ 2346 try to recompile MPlayer with this option disabled! */
2713 $_select 2347 $_def_select
2714 2348
2715 /* define this to use iconv(3) function to codepage conversions */ 2349 /* define this to use iconv(3) function to codepage conversions */
2716 $_iconv 2350 $_def_iconv
2717
2718 /* XMMP support: (test code) */
2719 $_xmmpaudio
2720 #define LIBDIR "/usr/local/lib"
2721 #define PLUGINDIR LIBDIR "/xmmp/Plugins"
2722 #define XMMP_AUDIO_DRIVER PLUGINDIR "/Sound/oss.so"
2723 2351
2724 /* set up max. outburst. use 65536 for ALSA 0.5, for others 16384 is enough */ 2352 /* set up max. outburst. use 65536 for ALSA 0.5, for others 16384 is enough */
2725 #define MAX_OUTBURST 65536 2353 #define MAX_OUTBURST 65536
2726 2354
2727 /* set up audio OUTBURST. Do not change this! */ 2355 /* set up audio OUTBURST. Do not change this! */
2731 //#define OUTBURST 1024 2359 //#define OUTBURST 1024
2732 #define OUTBURST 512 2360 #define OUTBURST 512
2733 #endif 2361 #endif
2734 2362
2735 /* Define this if your system has the header file for the OSS sound interface */ 2363 /* Define this if your system has the header file for the OSS sound interface */
2736 $_have_soundcard_h 2364 $_def_sys_soundcard
2737 2365
2738 /* Define this if your system has the "malloc.h" header file */ 2366 /* Define this if your system has the "malloc.h" header file */
2739 $_have_malloc_h 2367 $_def_malloc
2740 2368
2741 /* memalign is mapped to malloc if unsupported */ 2369 /* memalign is mapped to malloc if unsupported */
2742 $_have_memalign 2370 $_def_memalign
2743 #ifndef HAVE_MEMALIGN 2371 #ifndef HAVE_MEMALIGN
2744 # define memalign(a,b) malloc(b) 2372 # define memalign(a,b) malloc(b)
2745 #endif 2373 #endif
2746 2374
2747 /* Define this if your system has the "alloca.h" header file */ 2375 /* Define this if your system has the "alloca.h" header file */
2748 $_have_alloca_h 2376 $_def_alloca
2749 2377
2750 /* Define this if your system has the "sys/mman.h" header file */ 2378 /* Define this if your system has the "sys/mman.h" header file */
2751 $_have_mman_h 2379 $_def_mman
2752 2380
2753 /* Define this if you have the elf dynamic linker -ldl library */ 2381 /* Define this if you have the elf dynamic linker -ldl library */
2754 $_have_libdl 2382 $_def_dl
2755 2383
2756 /* Define this if you have the kstat kernel statistics library */ 2384 /* Define this if you have the kstat kernel statistics library */
2757 $_have_libkstat 2385 $_def_kstat
2758 2386
2759 /* Define this if you have zlib */ 2387 /* Define this if you have zlib */
2760 $_have_zlib 2388 $_def_zlib
2761 2389
2762 /* Define this if your system has vsscanf */ 2390 /* Define this if your system has vsscanf */
2763 $_have_vsscanf 2391 $_def_vsscanf
2764 2392
2765 /* LIRC (remote control, see www.lirc.org) support: */ 2393 /* LIRC (remote control, see www.lirc.org) support: */
2766 $_lircdefs 2394 $_def_lirc
2767 2395
2768 /* DeCSS support using libcss */ 2396 /* DeCSS support using libcss */
2769 $_cssdef 2397 $_def_css
2770 2398
2771 /* Define this to enable MPEG 1/2 image postprocessing (requires FAST cpu!) */ 2399 /* Define this to enable MPEG 1/2 image postprocessing (requires FAST cpu!) */
2772 #define MPEG12_POSTPROC 2400 #define MPEG12_POSTPROC 1
2773 2401
2774 /* Define this to enable image postprocessing in libavcodec (requires FAST cpu!) */ 2402 /* Define this to enable image postprocessing in libavcodec (requires FAST cpu!) */
2775 $_ffpostprocess 2403 $_def_ffpostprocess
2776 2404
2777 #define HAVE_ODIVX_POSTPROCESS 2405 #define HAVE_ODIVX_POSTPROCESS 1
2778 2406
2779 /* Win32 DLL support */ 2407 /* Win32 DLL support */
2780 $_use_win32dll 2408 $_def_win32
2781 2409
2782 /* DirectShow support */ 2410 /* DirectShow support */
2783 $_use_directshow 2411 $_def_dshow
2784 2412
2785 /* ffmpeg's libavcodec support (requires libavcodec source) */ 2413 /* ffmpeg's libavcodec support (requires libavcodec source) */
2786 $_libavcodec 2414 $_def_libavcodec
2787 $_libavcodecso 2415 $_def_libavcodec_so
2416
2788 /* use only decoders from libavcodec: */ 2417 /* use only decoders from libavcodec: */
2789 #define CONFIG_DECODERS 2418 #define CONFIG_DECODERS 1
2790 2419
2791 /* XAnim DLL support */ 2420 /* XAnim DLL support */
2792 $_use_xanim 2421 $_def_xanim
2793 $_xanim_path 2422 $_def_xanim_path
2794 2423
2795 /* Use 3dnow/mmxext/sse/mmx optimized fast memcpy() [maybe buggy... signal 4]*/ 2424 /* Use 3dnow/mmxext/sse/mmx optimized fast memcpy() [maybe buggy... signal 4]*/
2796 $_fastmemcpy 2425 $_def_fastmemcpy
2797 2426
2798 /* gui support, please do not edit this option */ 2427 /* gui support, please do not edit this option */
2799 $_gui_def 2428 $_def_gui
2800 #define PREFIX "$_prefix" 2429 #define PREFIX "$_prefix"
2801 2430
2802 /* Audio lib drivers */ 2431 /* Audio lib drivers */
2803 $_ossaudio 2432 $_def_ossaudio
2804 $_alsa5 2433 $_def_alsa5
2805 $_alsa9 2434 $_def_alsa9
2806 $_esdd 2435 $_def_sunaudio
2807 $_sunaudio 2436 $_def_sgiaudio
2808 $_sgiaudio
2809 2437
2810 /* Enable fast OSD/SUB renderer (looks ugly, but uses less CPU power) */ 2438 /* Enable fast OSD/SUB renderer (looks ugly, but uses less CPU power) */
2811 #undef FAST_OSD 2439 #undef FAST_OSD
2812 #undef FAST_OSD_TABLE 2440 #undef FAST_OSD_TABLE
2813 2441
2814 /* Enable TV Interface support */ 2442 /* Enable TV Interface support */
2815 $_tv 2443 $_def_tv
2816 2444
2817 /* Define if your processor stores words with the most significant 2445 /* Define if your processor stores words with the most significant
2818 byte first (like Motorola and SPARC, unlike Intel and VAX). */ 2446 byte first (like Motorola and SPARC, unlike Intel and VAX). */
2819 $_words_endian 2447 $_def_words_endian
2820 2448
2821 $_arch 2449 $_def_arch
2822 2450
2823 $_confwin32 2451 /* Define this for Cygwin build for win32 */
2452 $_def_confwin32
2824 2453
2825 /* Define this to any prefered value from 386 up to infinity with step 100 */ 2454 /* Define this to any prefered value from 386 up to infinity with step 100 */
2826 #define __CPU__ $iproc 2455 #define __CPU__ $iproc
2827 2456
2828 $_linux_def 2457 $_def_linux
2829 2458
2830 #ifdef sun 2459 #ifdef sun
2831 #define DEFAULT_CDROM_DEVICE "/vol/dev/aliases/cdrom0" 2460 #define DEFAULT_CDROM_DEVICE "/vol/dev/aliases/cdrom0"
2832 #define DEFAULT_DVD_DEVICE DEFAULT_CDROM_DEVICE 2461 #define DEFAULT_DVD_DEVICE DEFAULT_CDROM_DEVICE
2833 #else 2462 #else
2843 ** See ./configure --help for details. 2472 ** See ./configure --help for details.
2844 ** 2473 **
2845 *---------------------------------------------------------------------------*/ 2474 *---------------------------------------------------------------------------*/
2846 2475
2847 /* termcap flag for getch2.c */ 2476 /* termcap flag for getch2.c */
2848 $_termcap 2477 $_def_termcap
2849 2478
2850 /* enable PNG support */ 2479 /* enable PNG support */
2851 $_png 2480 $_def_png
2852 2481
2853 /* libmad support */ 2482 /* libmad support */
2854 $_madlibrary 2483 $_def_mad
2855 2484
2856 /* enable OggVorbis support */ 2485 /* enable OggVorbis support */
2857 $_vorbis 2486 $_def_vorbis
2858 2487
2859 $_streamingdef 2488 $_def_streaming
2860 2489
2861 /* Extension defines */ 2490 /* Extension defines */
2862 $_3dnowm // only define if you have 3DNOW (AMD k6-2, AMD Athlon, iDT WinChip, etc.) 2491 $_def_3dnow // only define if you have 3DNOW (AMD k6-2, AMD Athlon, iDT WinChip, etc.)
2863 $_3dnowexm // only define if you have 3DNOWEX (AMD Athlon, etc.) 2492 $_def_3dnowex // only define if you have 3DNOWEX (AMD Athlon, etc.)
2864 $_mmx // only define if you have MMX (newer x86 chips, not P54C/PPro) 2493 $_def_mmx // only define if you have MMX (newer x86 chips, not P54C/PPro)
2865 $_mmx2 // only define if you have MMX2 (Athlon/PIII/4/CelII) 2494 $_def_mmx2 // only define if you have MMX2 (Athlon/PIII/4/CelII)
2866 $_ssem // only define if you have SSE (Intel Pentium III/4 or Celeron II) 2495 $_def_sse // only define if you have SSE (Intel Pentium III/4 or Celeron II)
2867 2496
2868 #ifdef HAVE_MMX 2497 #ifdef HAVE_MMX
2869 #define USE_MMX_IDCT 2498 #define USE_MMX_IDCT 1
2870 #endif 2499 #endif
2871 2500
2872 $_mlibdef // Sun mediaLib, available only on solaris 2501 $_def_mlib // Sun mediaLib, available only on solaris
2873 2502
2874 /* libmpeg2 uses a different feature test macro for mediaLib */ 2503 /* libmpeg2 uses a different feature test macro for mediaLib */
2875 #ifdef HAVE_MLIB 2504 #ifdef HAVE_MLIB
2876 #define LIBMPEG2_MLIB 2505 #define LIBMPEG2_MLIB 1
2877 #endif 2506 #endif
2878 2507
2879 /* libvo options */ 2508 /* libvo options */
2880 #define SCREEN_SIZE_X $_x 2509 $_def_x
2881 #define SCREEN_SIZE_Y $_y 2510 $_def_y
2882 $_x11 2511 $_def_x11
2883 $_xv 2512 $_def_xv
2884 $_vm 2513 $_def_vm
2885 $_xinerama 2514 $_def_xinerama
2886 $_gl 2515 $_def_gl
2887 $_dga 2516 $_def_dga
2888 $_dga2 2517 $_def_dga2
2889 $_sdldef 2518 $_def_sdl
2890 /* defined for SDLlib with keyrepeat bugs (before 1.2.1) */ 2519 /* defined for SDLlib with keyrepeat bugs (before 1.2.1) */
2891 $_sdlbuggy 2520 $_def_sdlbuggy
2892 $_ggi 2521 $_def_ggi
2893 $_3dfx 2522 $_def_3dfx
2894 $_tdfxfb 2523 $_def_tdfxfb
2895 $_mga 2524 $_def_mga
2896 $_xmga 2525 $_def_xmga
2897 $_syncfb 2526 $_def_syncfb
2898 $_fbdev 2527 $_def_fbdev
2899 $_dxr3 2528 $_def_dxr3
2900 $_have_dvb 2529 $_def_dvb
2901 $_svga 2530 $_def_svga
2902 $_have_xdpms 2531 $_def_xdpms
2903 $_aa 2532 $_def_aa
2904 2533
2905 /* used by GUI: */ 2534 /* used by GUI: */
2906 $_xshape_def 2535 $_def_xshape
2907 2536
2908 #if defined(HAVE_GL)||defined(HAVE_X11)||defined(HAVE_XV) 2537 #if defined(HAVE_GL) || defined(HAVE_X11) || defined(HAVE_XV)
2909 #define X11_FULLSCREEN 2538 #define X11_FULLSCREEN 1
2910 #endif 2539 #endif
2911 2540
2912 EOF 2541 EOF
2913 2542
2914 echo "Creating libvo/config.mak" 2543 #############################################################################
2915 2544
2545 echo "Creating libvo/config2.mak"
2916 _voobj=`echo $_vosrc | sed -e 's/\.c/\.o/g'` 2546 _voobj=`echo $_vosrc | sed -e 's/\.c/\.o/g'`
2917 2547 cat > libvo/config2.mak << EOF
2918 cat > libvo/config.mak << EOF
2919
2920 include ../config.mak 2548 include ../config.mak
2921 2549 OPTIONAL_SRCS = $_vosrc
2922 OPTIONAL_SRCS=$_vosrc 2550 OPTIONAL_OBJS = $_voobj
2923 OPTIONAL_OBJS=$_voobj 2551 EOF
2924 2552
2925 EOF 2553 #############################################################################
2926 2554
2927 echo "Creating libao2/config.mak" 2555 echo "Creating libao2/config2.mak"
2928
2929 _aoobj=`echo $_aosrc | sed -e 's/\.c/\.o/g'` 2556 _aoobj=`echo $_aosrc | sed -e 's/\.c/\.o/g'`
2930 2557 cat > libao2/config2.mak << EOF
2931 cat > libao2/config.mak << EOF
2932
2933 include ../config.mak 2558 include ../config.mak
2934 2559 OPTIONAL_SRCS = $_aosrc
2935 OPTIONAL_SRCS=$_aosrc 2560 OPTIONAL_OBJS = $_aoobj
2936 OPTIONAL_OBJS=$_aoobj 2561 EOF
2937 2562
2938 EOF 2563 #############################################################################
2564
2565 echo "Creating help_mp.h"
2566 cat > help_mp.h << EOF
2567 #include "$_mp_help"
2568 EOF
2569
2570 #############################################################################
2939 2571
2940 cat << EOF 2572 cat << EOF
2941 2573
2942 Config files successfully generated by ./configure ! 2574 Config files successfully generated by ./configure !
2943 Please check config.h and config.mak files, tune CPU and optimization flags if 2575
2944 you don't like these defaults. 2576 Install prefix: $_prefix
2945 You can compile the program with 'make' and install with 'make install'. Good 2577 Data directory: $_datadir
2946 luck! 2578
2947 2579 'config.h' and 'config.mak' contain your configuration options.
2580 Note: if you alter theses files (for instance CFLAGS) MPlayer may no longer
2581 compile *** DON'T BUGREPORT if you tweak these files ***
2582
2583 'make' will now compile MPlayer and 'make install' will install it.
2948 Note: On non-Linux systems you might need to use 'gmake' instead of 'make'. 2584 Note: On non-Linux systems you might need to use 'gmake' instead of 'make'.
2949 2585
2950 EOF 2586 EOF
2951 2587
2952 echo Creating $CHELP
2953 cat > $CHELP << EOF
2954 #include "$_mp_help"
2955 EOF
2956 2588
2957 if test "$_mtrr" = yes ; then 2589 if test "$_mtrr" = yes ; then
2958 echo "Please check mtrr settings at /proc/mtrr (see DOCS/video.html#2.2.1.1)" 2590 echo "Please check mtrr settings at /proc/mtrr (see DOCS/video.html#2.2.1.1)"
2959 echo 2591 echo
2960 fi 2592 fi
2961 2593
2962 if test "$_sdl" = "outdated" ; then 2594 if test "$_sdl" = "outdated" ; then
2963 cat <<EOF 2595 cat <<EOF
2964 You have an outdated version of libSDL installed (older than v1.1.7) and SDL 2596 You have an outdated version of libSDL installed (older than v1.1.7) and SDL
2972 2604
2973 Use --enable-sdl to force usage of libSDL. 2605 Use --enable-sdl to force usage of libSDL.
2974 EOF 2606 EOF
2975 fi 2607 fi
2976 2608
2977 if test "$host_arch" = "i386" || test "$host_arch" = "i486" || test "$host_arch" = "i586" || test "$host_arch" = "i686" ; then 2609 if test "$host_arch" = "i386" ; then
2978 if test "$_win32" = no ; then 2610 if test "$_win32" = no ; then
2979 if test "$_win32libdir" ; then 2611 if test "$_win32libdir" ; then
2980 cat <<EOF 2612 cat <<EOF
2981 Failed to find a WIN32 codecs dir at $_win32libdir! 2613 Failed to find a WIN32 codecs dir at $_win32libdir!
2982 Create it and copy the DLL files there! (You can get them from your windows 2614 Create it and copy the DLL files there! (You can get them from your windows
2983 directory or download them from: 2615 directory or download them from:
2984 ftp://ftp.MPlayerHQ.hu/MPlayer/releases/w32codec.zip 2616 ftp://ftp.MPlayerHQ.hu/MPlayer/releases/w32codec.zip
2985 EOF 2617 EOF
2986 fi 2618 fi
2987 else 2619 else
2988 if test "$_win32libdir" ; then 2620 if test "$_win32libdir" ; then
2989 echo "Ok, found Win32 codecs directory at $_win32libdir." 2621 echo "Ok, found Win32 codecs directory at $_win32libdir."
2990 else 2622 else
2991 cat <<EOF 2623 cat <<EOF
2992 Failed to find a WIN32 codecs dir! 2624 Failed to find a WIN32 codecs dir!
2993 Create it and copy the DLL files there! (You can get them from your windows 2625 Create it and copy the DLL files there! (You can get them from your windows
2995 ftp://ftp.MPlayerHQ.hu/MPlayer/releases/w32codec.zip 2627 ftp://ftp.MPlayerHQ.hu/MPlayer/releases/w32codec.zip
2996 EOF 2628 EOF
2997 fi 2629 fi
2998 fi 2630 fi
2999 else 2631 else
3000 cat <<EOF 2632 cat <<EOF
3001 NOTE: WIN32 codec DLLs are not supported on your CPU ($host_arch). 2633 NOTE: WIN32 codec DLLs are not supported on your CPU ($host_arch).
3002 You may encounter a few AVI files that cannot be played due to missing 2634 You may encounter a few AVI files that cannot be played due to missing
3003 opensource video/audio codec support. 2635 opensource video/audio codec support.
3004 EOF 2636 EOF
3005 fi 2637 fi
3006 2638
2639 cat <<EOF
2640
2641 If you cannot understand why a test failed please check $TMPLOG
2642 If you believe it is a bug in configure2 please report it.
2643
2644 EOF
2645
3007 # Last move: 2646 # Last move:
3008 rm -f "$TMPO" "$TMPC" "$TMPS" "$TMPCPP" 2647 rm -f "$TMPO" "$TMPC" "$TMPS" "$TMPCPP"
3009 2648