Mercurial > mplayer.hg
comparison configure @ 2973:82943d529c69
merge of latest commits to configure1 (alex's qnx support)
dynamic detection of pthread and dl
output files have now their final name (config.h instead of config2.h, ...)
some FIXME removed
author | pl |
---|---|
date | Sun, 18 Nov 2001 17:45:23 +0000 |
parents | 98dacfba1195 |
children | ebf80361ec88 |
comparison
equal
deleted
inserted
replaced
2972:71272beb9000 | 2973:82943d529c69 |
---|---|
15 # _ld_opt : ' -L/path/dir -lopt ' that is: some GCC option | 15 # _ld_opt : ' -L/path/dir -lopt ' that is: some GCC option |
16 # _inc_opt : ' -I/path/dir/include ' | 16 # _inc_opt : ' -I/path/dir/include ' |
17 # | 17 # |
18 # GOTCHAS: | 18 # GOTCHAS: |
19 # - config files are currently: | 19 # - config files are currently: |
20 # config2.h config2.mak libvo/config2.mak libao2/config2.mak | 20 # config.h config.mak libvo/config.mak libao2/config.mak |
21 # Gui/config2.mak libvo2/config2.mak | 21 # Gui/config.mak libvo2/config.mak |
22 # - removed xmmp/esd | 22 # - removed xmmp/esd |
23 # - removed dvbincdir/madincdir/cssincdir: add them to extraincdir | 23 # - removed dvbincdir/madincdir/cssincdir: add them to extraincdir |
24 # | 24 # |
25 ############################################################################# | 25 ############################################################################# |
26 | 26 |
52 freebsd() { test "$system_name" = "FreeBSD" ; return "$?" ; } | 52 freebsd() { test "$system_name" = "FreeBSD" ; return "$?" ; } |
53 netbsd() { test "$system_name" = "NetBSD" ; return "$?" ; } | 53 netbsd() { test "$system_name" = "NetBSD" ; return "$?" ; } |
54 bsdos() { test "$system_name" = "BSD/OS" ; return "$?" ; } | 54 bsdos() { test "$system_name" = "BSD/OS" ; return "$?" ; } |
55 openbsd() { test "$system_name" = "OpenBSD" ; return "$?" ; } | 55 openbsd() { test "$system_name" = "OpenBSD" ; return "$?" ; } |
56 bsd() { freebsd || netbsd || bsdos || openbsd ; return "$?" ; } | 56 bsd() { freebsd || netbsd || bsdos || openbsd ; return "$?" ; } |
57 qnx() { test "$system_name" = "QNX" ; return "$?" ; } | |
57 | 58 |
58 # Use this before starting a check | 59 # Use this before starting a check |
59 echocheck() { | 60 echocheck() { |
60 echo "============ Checking for $@ ============" >> "$TMPLOG" | 61 echo "============ Checking for $@ ============" >> "$TMPLOG" |
61 echo "$_echo_n" "Checking for $@ ... $_echo_c" | 62 echo "$_echo_n" "Checking for $@ ... $_echo_c" |
207 # Determine our OS name and CPU architecture | 208 # Determine our OS name and CPU architecture |
208 if test -z "$_target" ; then | 209 if test -z "$_target" ; then |
209 # OS name | 210 # OS name |
210 system_name=`( uname -s ) 2>&1` | 211 system_name=`( uname -s ) 2>&1` |
211 case "$system_name" in | 212 case "$system_name" in |
212 Linux|FreeBSD|NetBSD|BSD/OS|OpenBSD|SunOS) | 213 Linux|FreeBSD|NetBSD|BSD/OS|OpenBSD|SunOS|QNX) |
213 ;; | 214 ;; |
214 IRIX*) | 215 IRIX*) |
215 system_name=IRIX | 216 system_name=IRIX |
216 ;; | 217 ;; |
217 [cC][yY][gG][wW][iI][nN]*) | 218 [cC][yY][gG][wW][iI][nN]*) |
234 | 235 |
235 # Maybe uname -m (machine hardware name) returns something we | 236 # Maybe uname -m (machine hardware name) returns something we |
236 # recognize. | 237 # recognize. |
237 | 238 |
238 case "`( uname -m ) 2>&1`" in | 239 case "`( uname -m ) 2>&1`" in |
239 i[3-9]86) host_arch=i386 ;; | 240 i[3-9]86|x86*) host_arch=i386 ;; |
240 ppc) host_arch=ppc ;; | 241 ppc) host_arch=ppc ;; |
241 alpha) host_arch=alpha ;; | 242 alpha) host_arch=alpha ;; |
242 sparc*) host_arch=sparc ;; | 243 sparc*) host_arch=sparc ;; |
243 arm*) host_arch=arm ;; | 244 arm*) host_arch=arm ;; |
244 *) host_arch=UNKNOWN ;; | 245 *) host_arch=UNKNOWN ;; |
245 esac | 246 esac |
246 ;; | 247 ;; |
247 esac | 248 esac |
248 else | 249 else |
249 system_name=`echo $_target | cut -d '-' -f 2` | 250 system_name=`echo $_target | cut -d '-' -f 2` |
256 # LGB: temporary files | 257 # LGB: temporary files |
257 for I in "$TMPDIR" "$TEMPDIR" "/tmp" ; do | 258 for I in "$TMPDIR" "$TEMPDIR" "/tmp" ; do |
258 test "$I" && break | 259 test "$I" && break |
259 done | 260 done |
260 | 261 |
261 # FIXME use this when debug phases is over: | 262 TMPLOG="$I/configure-$RANDOM-$$.log" |
262 # TMPLOG="$I/configure2-$RANDOM-$$.log" | |
263 TMPLOG="configure2.log" | |
264 rm -f "$TMPLOG" | |
265 TMPC="$I/mplayer-conf-$RANDOM-$$.c" | 263 TMPC="$I/mplayer-conf-$RANDOM-$$.c" |
266 TMPCPP="$I/mplayer-conf-$RANDOM-$$.cpp" | 264 TMPCPP="$I/mplayer-conf-$RANDOM-$$.cpp" |
267 TMPO="$I/mplayer-conf-$RANDOM-$$.o" | 265 TMPO="$I/mplayer-conf-$RANDOM-$$.o" |
268 TMPS="$I/mplayer-conf-$RANDOM-$$.S" | 266 TMPS="$I/mplayer-conf-$RANDOM-$$.S" |
269 | 267 |
597 extcheck $_sse "sse" "xorps %%xmm0, %%xmm0" && _sse=yes | 595 extcheck $_sse "sse" "xorps %%xmm0, %%xmm0" && _sse=yes |
598 extcheck $_sse2 "sse2" "xorpd %%xmm0, %%xmm0" && _sse2=yes | 596 extcheck $_sse2 "sse2" "xorpd %%xmm0, %%xmm0" && _sse2=yes |
599 echocheck "mtrr support" | 597 echocheck "mtrr support" |
600 echores "$_mtrr" | 598 echores "$_mtrr" |
601 | 599 |
602 fi | |
603 | |
604 | |
605 # Checking for posix threads lib... | |
606 cat > $TMPC << EOF | |
607 int main(void) { return 0; } | |
608 EOF | |
609 if bsd ; then | |
610 cc_check -pthread || die "Lib pthread not found." | |
611 else | |
612 cc_check -lpthread || die "Lib pthread not found." | |
613 fi | 600 fi |
614 | 601 |
615 | 602 |
616 _prefix="/usr/local" | 603 _prefix="/usr/local" |
617 | 604 |
1051 _def_mman='#undef HAVE_SYS_MMAN_H' | 1038 _def_mman='#undef HAVE_SYS_MMAN_H' |
1052 fi | 1039 fi |
1053 echores "$_mman" | 1040 echores "$_mman" |
1054 | 1041 |
1055 | 1042 |
1056 echocheck "dlfcn.h" | 1043 echocheck "dynamic loader" |
1057 cat > $TMPC << EOF | 1044 cat > $TMPC << EOF |
1058 #include <dlfcn.h> | 1045 #include <dlfcn.h> |
1059 int main(void) { return 0; } | 1046 int main(void) { dlopen(0, 0); dlclose(0); dlsym(0, 0); return 0; } |
1060 EOF | 1047 EOF |
1061 _dl=no | 1048 _dl=no |
1062 cc_check -ldl && _dl=yes | 1049 if cc_check ; then |
1050 _dl=yes | |
1051 elif cc_check -ldl ; then | |
1052 _dl=yes | |
1053 _ld_dl='-ldl' | |
1054 fi | |
1063 if test "$_dl" = yes ; then | 1055 if test "$_dl" = yes ; then |
1064 _def_dl='#define HAVE_LIBDL 1' | 1056 _def_dl='#define HAVE_LIBDL 1' |
1065 else | 1057 else |
1066 _def_dl='#undef HAVE_LIBDL' | 1058 _def_dl='#undef HAVE_LIBDL' |
1067 fi | 1059 fi |
1068 echores "$_dl" | 1060 echores "$_dl" |
1061 | |
1062 | |
1063 echocheck "pthread" | |
1064 cat > $TMPC << EOF | |
1065 int main(void) { (void) pthread_create (0, 0, 0, 0); return 0; } | |
1066 EOF | |
1067 if cc_check -lpthread ; then | |
1068 _ld_pthread='-lpthread' | |
1069 elif cc_check -pthread ; then | |
1070 _ld_pthread='-pthread' | |
1071 else | |
1072 die "Lib pthread not found." | |
1073 fi | |
1074 echores "using $_ld_pthread" | |
1069 | 1075 |
1070 | 1076 |
1071 echocheck "sys/soundcard.h" | 1077 echocheck "sys/soundcard.h" |
1072 cat > $TMPC << EOF | 1078 cat > $TMPC << EOF |
1073 #include <sys/soundcard.h> | 1079 #include <sys/soundcard.h> |
1361 #include <GL/gl.h> | 1367 #include <GL/gl.h> |
1362 int main(void) { return 0; } | 1368 int main(void) { return 0; } |
1363 EOF | 1369 EOF |
1364 _gl=no | 1370 _gl=no |
1365 if bsd ; then | 1371 if bsd ; then |
1366 cc_check $_inc_x11 $_ld_x11 -lGL -lm -pthread $_ld_sock && _gl=yes | 1372 cc_check $_inc_x11 $_ld_x11 -lGL -lm $_ld_pthread $_ld_sock && _gl=yes |
1367 else | 1373 else |
1368 cc_check $_inc_x11 $_ld_x11 -lGL -lm $_ld_sock && _gl=yes | 1374 cc_check $_inc_x11 $_ld_x11 -lGL -lm $_ld_sock && _gl=yes |
1369 fi | 1375 fi |
1370 fi | 1376 fi |
1371 if test "$_gl" = yes ; then | 1377 if test "$_gl" = yes ; then |
1372 _ld_gl='-lGL' | 1378 _ld_gl='-lGL' |
1373 # FIXME check this for OpenBSD & BSD/OS | 1379 # FIXME check this for OpenBSD & BSD/OS |
1374 # Under XFree86 4.x GL port is poorly designed | 1380 # Under XFree86 4.x GL port is poorly designed |
1375 bsd && test -r /usr/X11R6/bin/XFree86 && _ld_gl='-lGL -pthread' | 1381 bsd && test -r /usr/X11R6/bin/XFree86 && _ld_gl="-lGL $_ld_pthread" |
1376 _def_gl='#define HAVE_GL 1' | 1382 _def_gl='#define HAVE_GL 1' |
1377 _vosrc="$_vosrc vo_gl.c vo_gl2.c" | 1383 _vosrc="$_vosrc vo_gl.c vo_gl2.c" |
1378 else | 1384 else |
1379 _def_gl='#undef HAVE_GL' | 1385 _def_gl='#undef HAVE_GL' |
1380 fi | 1386 fi |
1626 cat > $TMPC << EOF | 1632 cat > $TMPC << EOF |
1627 #include <sys/asoundlib.h> | 1633 #include <sys/asoundlib.h> |
1628 #include <sys/soundcard.h> | 1634 #include <sys/soundcard.h> |
1629 int main(void) { return (!(SND_LIB_MAJOR==0 && SND_LIB_MINOR==5)); } | 1635 int main(void) { return (!(SND_LIB_MAJOR==0 && SND_LIB_MINOR==5)); } |
1630 EOF | 1636 EOF |
1631 cc_check -lasound -ldl -lpthread && $TMPO && _alsaver='0.5.x' | 1637 cc_check -lasound $_ld_dl $_ld_pthread && $TMPO && _alsaver='0.5.x' |
1632 | 1638 |
1633 cat > $TMPC << EOF | 1639 cat > $TMPC << EOF |
1634 #include <sys/asoundlib.h> | 1640 #include <sys/asoundlib.h> |
1635 #include <sys/soundcard.h> | 1641 #include <sys/soundcard.h> |
1636 int main(void) { return (!(SND_LIB_MAJOR==0 && SND_LIB_MINOR==9)); } | 1642 int main(void) { return (!(SND_LIB_MAJOR==0 && SND_LIB_MINOR==9)); } |
1637 EOF | 1643 EOF |
1638 cc_check -lasound -ldl -lpthread && $TMPO && _alsaver='0.9.x' | 1644 cc_check -lasound $_ld_dl $_ld_pthread && $TMPO && _alsaver='0.9.x' |
1639 if test "$_alsaver" ; then | 1645 if test "$_alsaver" ; then |
1640 _alsa=yes | 1646 _alsa=yes |
1641 echores "yes ($_alsaver)" | 1647 echores "yes ($_alsaver)" |
1642 else | 1648 else |
1643 echores "no" | 1649 echores "no" |
1884 fi | 1890 fi |
1885 | 1891 |
1886 | 1892 |
1887 echocheck "XAnim DLL" | 1893 echocheck "XAnim DLL" |
1888 if test "$_xanim" = auto ; then | 1894 if test "$_xanim" = auto ; then |
1889 # xanim only requires dlopen() and/or libdl | |
1890 cat > $TMPC << EOF | |
1891 int main(void) { (void) dlopen(0, 0); return 0; } | |
1892 EOF | |
1893 _xanim=no | 1895 _xanim=no |
1894 if cc_check || test "$_dl" = yes ; then | 1896 if test "$_dl" = yes ; then |
1895 if test "$host_arch" = i386 ; then | 1897 if test "$host_arch" = i386 ; then |
1896 if test -z "$_xanimlibdir" ; then | 1898 if test -z "$_xanimlibdir" ; then |
1897 for I in /usr/local/lib/xanim/mods /usr/lib/xanim/mods ; do | 1899 for I in /usr/local/lib/xanim/mods /usr/lib/xanim/mods ; do |
1898 if test -d "$I" ; then | 1900 if test -d "$I" ; then |
1899 _xanimlibdir="$I" | 1901 _xanimlibdir="$I" |
1902 done | 1904 done |
1903 fi | 1905 fi |
1904 test "$_xanimlibdir" && _xanim=yes | 1906 test "$_xanimlibdir" && _xanim=yes |
1905 echores "yes" | 1907 echores "yes" |
1906 else | 1908 else |
1907 echores "not supported non x86" | 1909 echores "not supported on non x86" |
1908 fi | 1910 fi |
1909 else | 1911 else |
1910 echores "libdl needed" | 1912 echores "dl support needed" |
1911 fi | 1913 fi |
1912 else | 1914 else |
1913 echores "$_xanim" | 1915 echores "$_xanim" |
1914 fi | 1916 fi |
1915 if test "$_xanim" = yes ; then | 1917 if test "$_xanim" = yes ; then |
2062 fi | 2064 fi |
2063 echores "$_lirc" | 2065 echores "$_lirc" |
2064 | 2066 |
2065 | 2067 |
2066 echocheck "fastmemcpy" | 2068 echocheck "fastmemcpy" |
2067 # FIXME fastmemcpy check | 2069 # fastmemcpy check is done earlier with tests of CPU & binutils features |
2068 if test "$_fastmemcpy" = yes ; then | 2070 if test "$_fastmemcpy" = yes ; then |
2069 _def_fastmemcpy='#define USE_FASTMEMCPY 1' | 2071 _def_fastmemcpy='#define USE_FASTMEMCPY 1' |
2070 else | 2072 else |
2071 _def_fastmemcpy='#undef USE_FASTMEMCPY' | 2073 _def_fastmemcpy='#undef USE_FASTMEMCPY' |
2072 fi | 2074 fi |
2167 echores "$_glib (with $_glibconfig)" | 2169 echores "$_glib (with $_glibconfig)" |
2168 | 2170 |
2169 _def_gui='#define HAVE_NEW_GUI 1' | 2171 _def_gui='#define HAVE_NEW_GUI 1' |
2170 _ld_gui='-LGui -lgui $(GTKLIB) $(GLIBLIB)' | 2172 _ld_gui='-LGui -lgui $(GTKLIB) $(GLIBLIB)' |
2171 | 2173 |
2172 cat > Gui/config2.mak << EOF | 2174 cat > Gui/config.mak << EOF |
2173 # -------- Generated by configure2 ----------- | 2175 # -------- Generated by configure ----------- |
2174 | 2176 |
2175 GTKINC = $_inc_gtk | 2177 GTKINC = $_inc_gtk |
2176 GTKLIBS = $_ld_gtk | 2178 GTKLIBS = $_ld_gtk |
2177 GLIBINC = $_inc_glib | 2179 GLIBINC = $_inc_glib |
2178 GLIBLIBS = $_ld_glib | 2180 GLIBLIBS = $_ld_glib |
2225 CFLAGS="$CFLAGS -D_LARGEFILE64_SOURCE" | 2227 CFLAGS="$CFLAGS -D_LARGEFILE64_SOURCE" |
2226 fi | 2228 fi |
2227 fi | 2229 fi |
2228 | 2230 |
2229 # Determine OS dependent libs | 2231 # Determine OS dependent libs |
2230 _confcygwin="TARGET_CYGWIN = no" | 2232 if cygwin ; then |
2231 if bsd ; then | 2233 _confcygwin='TARGET_CYGWIN = yes' |
2232 _ld_arch="-rdynamic -pthread" | 2234 _def_confwin32='#define WIN32' |
2233 elif cygwin ; then | 2235 else |
2234 _confcygwin="TARGET_CYGWIN = yes" | 2236 _confcygwin="TARGET_CYGWIN = no" |
2235 _def_confwin32="#define WIN32" | 2237 fi |
2236 _ld_arch="-lpthread" | 2238 |
2237 else | 2239 _ld_arch="$_ld_pthread $_ld_dl" |
2238 _ld_arch="-ldl -lpthread" | 2240 bsd && _ld_arch="-rdynamic $_ld_arch" |
2239 fi | |
2240 | |
2241 bsdos && _ld_arch="$_ld_arch -ldvd" | 2241 bsdos && _ld_arch="$_ld_arch -ldvd" |
2242 | 2242 |
2243 _def_debug='#undef MP_DEBUG' | 2243 _def_debug='#undef MP_DEBUG' |
2244 test "$_debug" && _def_debug='#define MP_DEBUG 1' | 2244 test "$_debug" && _def_debug='#define MP_DEBUG 1' |
2245 | 2245 |
2246 _def_linux='#undef TARGET_LINUX' | 2246 _def_linux='#undef TARGET_LINUX' |
2247 linux && _def_linux='#define TARGET_LINUX 1' | 2247 linux && _def_linux='#define TARGET_LINUX 1' |
2248 | 2248 |
2249 | 2249 |
2250 ############################################################################# | 2250 ############################################################################# |
2251 echo "Creating config2.mak" | 2251 echo "Creating config.mak" |
2252 cat > config2.mak << EOF | 2252 cat > config.mak << EOF |
2253 # -------- Generated by ./configure2 ----------- | 2253 # -------- Generated by configure ----------- |
2254 | 2254 |
2255 LANG = C | 2255 LANG = C |
2256 TARGET_OS = $system_name | 2256 TARGET_OS = $system_name |
2257 prefix = $_prefix | 2257 prefix = $_prefix |
2258 AR = ar | 2258 AR = ar |
2313 DEBUG = -DDEBUG | 2313 DEBUG = -DDEBUG |
2314 | 2314 |
2315 EOF | 2315 EOF |
2316 | 2316 |
2317 ############################################################################# | 2317 ############################################################################# |
2318 echo "Creating config2.h" | 2318 echo "Creating config.h" |
2319 cat > config2.h << EOF | 2319 cat > config.h << EOF |
2320 /* -------- Generated by configure2 ----------- */ | 2320 /* -------- Generated by configure ----------- */ |
2321 | 2321 |
2322 #define USE_OSD 1 | 2322 #define USE_OSD 1 |
2323 #define USE_SUB 1 | 2323 #define USE_SUB 1 |
2324 | 2324 |
2325 $_def_debug | 2325 $_def_debug |
2555 | 2555 |
2556 EOF | 2556 EOF |
2557 | 2557 |
2558 ############################################################################# | 2558 ############################################################################# |
2559 | 2559 |
2560 echo "Creating libvo/config2.mak" | 2560 echo "Creating libvo/config.mak" |
2561 _voobj=`echo $_vosrc | sed -e 's/\.c/\.o/g'` | 2561 _voobj=`echo $_vosrc | sed -e 's/\.c/\.o/g'` |
2562 cat > libvo/config2.mak << EOF | 2562 cat > libvo/config.mak << EOF |
2563 include ../config.mak | 2563 include ../config.mak |
2564 OPTIONAL_SRCS = $_vosrc | 2564 OPTIONAL_SRCS = $_vosrc |
2565 OPTIONAL_OBJS = $_voobj | 2565 OPTIONAL_OBJS = $_voobj |
2566 EOF | 2566 EOF |
2567 | 2567 |
2568 ############################################################################# | 2568 ############################################################################# |
2569 | 2569 |
2570 echo "Creating libvo2/config2.mak" | 2570 echo "Creating libvo2/config.mak" |
2571 _vo2obj=`echo $_vo2src | sed -e 's/\.c/\.o/g'` | 2571 _vo2obj=`echo $_vo2src | sed -e 's/\.c/\.o/g'` |
2572 cat > libvo2/config2.mak << EOF | 2572 cat > libvo2/config.mak << EOF |
2573 include ../config.mak | 2573 include ../config.mak |
2574 OPTIONAL_SRCS = $_vo2src | 2574 OPTIONAL_SRCS = $_vo2src |
2575 OPTIONAL_OBJS = $_vo2obj | 2575 OPTIONAL_OBJS = $_vo2obj |
2576 EOF | 2576 EOF |
2577 | 2577 |
2578 ############################################################################# | 2578 ############################################################################# |
2579 | 2579 |
2580 echo "Creating libao2/config2.mak" | 2580 echo "Creating libao2/config.mak" |
2581 _aoobj=`echo $_aosrc | sed -e 's/\.c/\.o/g'` | 2581 _aoobj=`echo $_aosrc | sed -e 's/\.c/\.o/g'` |
2582 cat > libao2/config2.mak << EOF | 2582 cat > libao2/config.mak << EOF |
2583 include ../config.mak | 2583 include ../config.mak |
2584 OPTIONAL_SRCS = $_aosrc | 2584 OPTIONAL_SRCS = $_aosrc |
2585 OPTIONAL_OBJS = $_aoobj | 2585 OPTIONAL_OBJS = $_aoobj |
2586 EOF | 2586 EOF |
2587 | 2587 |
2661 EOF | 2661 EOF |
2662 fi | 2662 fi |
2663 | 2663 |
2664 cat <<EOF | 2664 cat <<EOF |
2665 | 2665 |
2666 If you cannot understand why a test failed please check $TMPLOG | 2666 If you cannot understand why a test failed please check $TMPLOG. |
2667 If you believe it is a bug in configure2 please report it. | 2667 If you believe it is a bug in configure, please report it. |
2668 | 2668 |
2669 EOF | 2669 EOF |
2670 | 2670 |
2671 # Last move: | 2671 # Last move: |
2672 rm -f "$TMPO" "$TMPC" "$TMPS" "$TMPCPP" | 2672 rm -f "$TMPO" "$TMPC" "$TMPS" "$TMPCPP" |