From 0c2a302948d7e2ca5938e19bdc6c66649c7b6a34 Mon Sep 17 00:00:00 2001 From: Uoti Urpala Date: Wed, 29 Feb 2012 22:49:18 +0200 Subject: configure: show PKG_CONFIG_PATH and CFLAGS in config.log When the build wrapper repo scripts run configure they set a custom PKG_CONFIG_PATH environment variable. Show the value of this in config.log to make it easier to rerun configure with a tweaked version of the same parameters. Also show CFLAGS if set, as it's likely to break things. --- configure | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'configure') diff --git a/configure b/configure index 4a1f9ddd9c..f59b1b5a73 100755 --- a/configure +++ b/configure @@ -1374,7 +1374,14 @@ TMPH="$mplayer_tmpdir/tmp.h" TMPS="$mplayer_tmpdir/tmp.S" rm -f "$TMPLOG" -echo configuration: $configuration > "$TMPLOG" +echo Parameters configure was run with: > "$TMPLOG" +if test -n "$CFLAGS" ; then + echo ${_echo_n} CFLAGS="'$CFLAGS' ${_echo_c}" >> "$TMPLOG" +fi +if test -n "$PKG_CONFIG_PATH" ; then + echo ${_echo_n} PKG_CONFIG_PATH="'$PKG_CONFIG_PATH' ${_echo_c}" >> "$TMPLOG" +fi +echo ./configure $configuration >> "$TMPLOG" echo >> "$TMPLOG" -- cgit v1.2.3 From 75bc1591e8be6c4f39e67dcaff8f1564ff4ffd02 Mon Sep 17 00:00:00 2001 From: Kovensky Date: Mon, 2 Aug 2010 01:21:51 -0300 Subject: configure: fix target triplet check for mingw targets mingw32 and mingw64's recommended triplets are i686-pc-mingw32 / x86_64-w64-mingw32, neither has mingw32 in the middle. --- configure | 34 +++++++++++++++++++--------------- 1 file changed, 19 insertions(+), 15 deletions(-) (limited to 'configure') diff --git a/configure b/configure index f59b1b5a73..b28b38d6d5 100755 --- a/configure +++ b/configure @@ -1268,21 +1268,25 @@ if test -z "$_target" ; then ;; esac else # if test -z "$_target" - system_name=$(echo $_target | cut -d '-' -f 2) - case "$(echo $system_name | tr A-Z a-z)" in - linux) system_name=Linux ;; - freebsd) system_name=FreeBSD ;; - gnu/kfreebsd) system_name=FreeBSD ;; - netbsd) system_name=NetBSD ;; - bsd/os) system_name=BSD/OS ;; - openbsd) system_name=OpenBSD ;; - dragonfly) system_name=DragonFly ;; - sunos) system_name=SunOS ;; - qnx) system_name=QNX ;; - morphos) system_name=MorphOS ;; - amigaos) system_name=AmigaOS ;; - mingw32*) system_name=MINGW32 ;; - esac + for i in 2 3; do + system_name=$(echo $_target | cut -d '-' -f $i) + case "$(echo $system_name | tr A-Z a-z)" in + linux) system_name=Linux ;; + freebsd) system_name=FreeBSD ;; + gnu/kfreebsd) system_name=FreeBSD ;; + netbsd) system_name=NetBSD ;; + bsd/os) system_name=BSD/OS ;; + openbsd) system_name=OpenBSD ;; + dragonfly) system_name=DragonFly ;; + sunos) system_name=SunOS ;; + qnx) system_name=QNX ;; + morphos) system_name=MorphOS ;; + amigaos) system_name=AmigaOS ;; + mingw32*) system_name=MINGW32 ;; + *) continue ;; + esac + break + done # We need to convert underscores so that values like k6-2 and pentium-mmx can be passed host_arch=$(echo $_target | cut -d '-' -f 1) if test $(echo $host_arch) != "x86_64" ; then -- cgit v1.2.3 From cca0b196bac19dac82ba778ef5527ba0b9431925 Mon Sep 17 00:00:00 2001 From: wm4 Date: Tue, 31 Jan 2012 19:36:16 +0100 Subject: configure: disable cross compilation auto detection This didn't work very well when cross compiling from Linux to Windows: it tries to execute an .exe file, which succeeds if wine is installed. As consequence it detects "no" as result. In general this won't work if emulation for the target architecture is available. Remove it. --- configure | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'configure') diff --git a/configure b/configure index b28b38d6d5..c5c99c7d33 100755 --- a/configure +++ b/configure @@ -476,7 +476,7 @@ Available values for --language-msg are: all $msg_lang_all Miscellaneous options: --enable-runtime-cpudetection enable runtime CPU detection [disable] - --enable-cross-compile enable cross-compilation [autodetect] + --enable-cross-compile enable cross-compilation [disable] --cc=COMPILER C compiler to build MPlayer [gcc] --host-cc=COMPILER C compiler for tools needed while building [gcc] --as=ASSEMBLER assembler to build MPlayer [as] @@ -560,7 +560,7 @@ _as=auto _nm=auto _yasm=yasm _runtime_cpudetection=no -_cross_compile=auto +_cross_compile=no _prefix="/usr/local" ffmpeg=auto ffmpeg_internals=no @@ -1478,9 +1478,10 @@ echo "Detected operating system: $system_name" echo "Detected host architecture: $host_arch" echocheck "cross compilation" -if test $_cross_compile = auto ; then +if test $_cross_compile = yes ; then _cross_compile=yes - cflag_check "" && "$TMPEXE" && _cross_compile=no +else + _cross_compile=no fi echores $_cross_compile -- cgit v1.2.3 From 2e2c03ecb1c6c3681179d105241b64256cfde600 Mon Sep 17 00:00:00 2001 From: wm4 Date: Tue, 31 Jan 2012 08:29:53 +0100 Subject: configure: use cross toolchain if --target is given If --enable-cross-compile is specified, passing --target=i686-w64-mingw32 for example will check if i686-w64-mingw32-gcc can be used. This is only done if the compiler isn't specified via --cc or the CC environment variable. The same is done for some other build tools, such as pkg-config. (Only the C compiler will try to use a fallback in this case.) --- configure | 105 ++++++++++++++++++++++++++++++++++++-------------------------- 1 file changed, 61 insertions(+), 44 deletions(-) (limited to 'configure') diff --git a/configure b/configure index c5c99c7d33..053e00dc74 100755 --- a/configure +++ b/configure @@ -551,14 +551,15 @@ neon=auto _iwmmxt=auto _altivec=auto _install=install -_ranlib=ranlib -_windres=windres -_cc=cc -_ar=ar +_pkg_config=auto +_ranlib=auto +_windres=auto +_cc=auto +_ar=auto test "$CC" && _cc="$CC" _as=auto _nm=auto -_yasm=yasm +_yasm=auto _runtime_cpudetection=no _cross_compile=no _prefix="/usr/local" @@ -1198,6 +1199,58 @@ test -z "$_confdir" && _confdir="$_prefix/etc/mplayer" test -z "$_libdir" && _libdir="$_prefix/lib" test -z "$_localedir" && _localedir="$_prefix/share/locale" +for tmpdir in "$TMPDIR" "$TEMPDIR" "/tmp" ; do + test "$tmpdir" && break +done + +mplayer_tmpdir="$tmpdir/mplayer-configure-$RANDOM-$$" +mkdir $mplayer_tmpdir || die "Unable to create tmpdir." + +TMPLOG="config.log" + +rm -f "$TMPLOG" +echo Parameters configure was run with: > "$TMPLOG" +if test -n "$CFLAGS" ; then + echo ${_echo_n} CFLAGS="'$CFLAGS' ${_echo_c}" >> "$TMPLOG" +fi +if test -n "$PKG_CONFIG_PATH" ; then + echo ${_echo_n} PKG_CONFIG_PATH="'$PKG_CONFIG_PATH' ${_echo_c}" >> "$TMPLOG" +fi +echo ./configure $configuration >> "$TMPLOG" +echo >> "$TMPLOG" + + +echocheck "cross compilation" +echores $_cross_compile + +if test $_cross_compile = yes; then + tmp_run() { + return 0 + } + test "$_host_cc" || _host_cc=cc +fi + +tool_prefix="" + +if test $_cross_compile = yes ; then + # Usually cross-compiler prefixes match with the target triplet + test -n "$_target" && tool_prefix="$_target"- +fi + +test "$_ranlib" = auto && _ranlib="$tool_prefix"ranlib +test "$_windres" = auto && _windres="$tool_prefix"windres +test "$_ar" = auto && _ar="$tool_prefix"ar +test "$_yasm" = auto && _yasm="$tool_prefix"yasm +test "$_pkg_config" = auto && _pkg_config="$tool_prefix"pkg-config + +if test "$_cc" = auto ; then + if test -n "$tool_prefix" ; then + _cc="$tool_prefix"gcc + else + _cc=cc + fi +fi + # Determine our OS name and CPU architecture if test -z "$_target" ; then # OS name @@ -1363,32 +1416,12 @@ if os2 ; then def_priority="#define CONFIG_PRIORITY 1" fi -for tmpdir in "$TMPDIR" "$TEMPDIR" "/tmp" ; do - test "$tmpdir" && break -done - -mplayer_tmpdir="$tmpdir/mplayer-configure-$RANDOM-$$" -mkdir $mplayer_tmpdir || die "Unable to create tmpdir." - -TMPLOG="config.log" TMPC="$mplayer_tmpdir/tmp.c" TMPCPP="$mplayer_tmpdir/tmp.cpp" TMPEXE="$mplayer_tmpdir/tmp$_exesuf" TMPH="$mplayer_tmpdir/tmp.h" TMPS="$mplayer_tmpdir/tmp.S" -rm -f "$TMPLOG" -echo Parameters configure was run with: > "$TMPLOG" -if test -n "$CFLAGS" ; then - echo ${_echo_n} CFLAGS="'$CFLAGS' ${_echo_c}" >> "$TMPLOG" -fi -if test -n "$PKG_CONFIG_PATH" ; then - echo ${_echo_n} PKG_CONFIG_PATH="'$PKG_CONFIG_PATH' ${_echo_c}" >> "$TMPLOG" -fi -echo ./configure $configuration >> "$TMPLOG" -echo >> "$TMPLOG" - - if test "$_runtime_cpudetection" = yes && ! x86 && ! ppc; then die "Runtime CPU detection only works for x86, x86-64 and PPC!" fi @@ -1474,28 +1507,13 @@ EOF cc_check && host_arch=x86_64 || host_arch=i386 fi -echo "Detected operating system: $system_name" -echo "Detected host architecture: $host_arch" - -echocheck "cross compilation" -if test $_cross_compile = yes ; then - _cross_compile=yes -else - _cross_compile=no -fi -echores $_cross_compile - -if test $_cross_compile = yes; then - tmp_run() { - return 0 - } - test "$_host_cc" || _host_cc=cc -fi - echocheck "host cc" test "$_host_cc" || _host_cc=$_cc echores $_host_cc +echo "Detected operating system: $system_name" +echo "Detected host architecture: $host_arch" + # --- # now that we know what compiler should be used for compilation, try to find @@ -3623,7 +3641,6 @@ echores "$_apple_ir" fi #if linux echocheck "pkg-config" -_pkg_config=pkg-config if $($_pkg_config --version > /dev/null 2>&1); then if test "$_ld_static"; then _pkg_config="$_pkg_config --static" -- cgit v1.2.3 From 7332ae76b789fa0feda14a3f4ff880808e438d6a Mon Sep 17 00:00:00 2001 From: wm4 Date: Tue, 31 Jan 2012 08:30:09 +0100 Subject: configure: allow changing pkg-config binary with --pkg-config --- configure | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'configure') diff --git a/configure b/configure index 053e00dc74..1b66ca7b17 100755 --- a/configure +++ b/configure @@ -483,6 +483,7 @@ Miscellaneous options: --nm=NM nm tool to build MPlayer [nm] --yasm=YASM Yasm assembler to build MPlayer [yasm] --ar=AR librarian to build MPlayer [ar] + --pkg-config=PKGCONFIG pkg-config to find some libraries [pkg-config] --ranlib=RANLIB ranlib to build MPlayer [ranlib] --windres=WINDRES windres to build MPlayer [windres] --target=PLATFORM target platform (i386-linux, arm-linux, etc) @@ -800,6 +801,9 @@ for ac_option do --ar=*) _ar=$(echo $ac_option | cut -d '=' -f 2) ;; + --pkg-config=*) + _pkg_config=$(echo $ac_option | cut -d '=' -f 2) + ;; --ranlib=*) _ranlib=$(echo $ac_option | cut -d '=' -f 2) ;; -- cgit v1.2.3 From eebe9309ecd70f86f0a52f09712db833df589206 Mon Sep 17 00:00:00 2001 From: wm4 Date: Tue, 31 Jan 2012 08:31:04 +0100 Subject: configure: add __USE_MINGW_ANSI_STDIO on MinGW This makes MinGW redirect certain stdio functions (such as the sprintf family) from the MSVCRT libc to a standard compliant MinGW implementation. This fixes a crash in talloc.c when compiling mplayer with MinGW-w64. The problem is most likely with talloc_vasprintf(), which calls vsnprintf with a small buffer and checks its return value to find out how much space the formatted string requires. Without this commit, vsnprintf would always return -1, and then the code calls abort(). (lachs0r figured out this one.) --- configure | 1 + 1 file changed, 1 insertion(+) (limited to 'configure') diff --git a/configure b/configure index 1b66ca7b17..fd3bfc83bd 100755 --- a/configure +++ b/configure @@ -1397,6 +1397,7 @@ fi if mingw32 ; then _getch=getch2-win.c need_shmem=no + extra_cflags="$extra_cflags -D__USE_MINGW_ANSI_STDIO=1" fi if amigaos ; then -- cgit v1.2.3 From 3f659fd1766c3ae649cbdac21485cda06d29ccb6 Mon Sep 17 00:00:00 2001 From: Uoti Urpala Date: Sun, 4 Mar 2012 20:38:42 +0200 Subject: configure: disable live555 by default Latest liblivemedia version disables APIs we need. The code still exists in the library and the changelog says the old interface can be enabled with "#define RTSPCLIENT_SYNCHRONOUS_INTERFACE". However, the code on the library side is disabled by default too, and seems to be disabled in distro packages, so defining that in the player does not help (just delays the failure until link time). It's possible the distro packages will be changed to enable this, but since dropping live555 support is desirable anyway, change configure to disable support by default at least for now. The live555 code is the only part of the source that's in C++. Including C headers in code compiled as C++ has caused issues at times, so deleting this code would have a maintenance benefit. Reportedly the rtsp support in Libav has improved, so there should be less need for live555. --- configure | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'configure') diff --git a/configure b/configure index fd3bfc83bd..5a6433de95 100755 --- a/configure +++ b/configure @@ -335,7 +335,7 @@ Optional features: --disable-networking disable networking [enable] --enable-winsock2_h enable winsock2_h [autodetect] --enable-smb enable Samba (SMB) input [autodetect] - --enable-live enable LIVE555 Streaming Media [autodetect] + --enable-live enable LIVE555 Streaming Media [disable] --enable-nemesi enable Nemesi Streaming Media [autodetect] --disable-vcd disable VCD support [autodetect] --disable-bluray disable Blu-ray support [autodetect] @@ -634,7 +634,7 @@ _dvdread_internal=auto _libdvdcss_internal=auto _xanim=auto _real=auto -_live=auto +_live=no _nemesi=auto _native_rtsp=yes _xinerama=auto @@ -5745,7 +5745,7 @@ fi echores "$_nemesi" echocheck "LIVE555 Streaming Media libraries" -if test "$_live" = auto && test "$networking" = yes ; then +if test "$_live" != no && test "$networking" = yes ; then cat > $TMPCPP << EOF #include #if (LIVEMEDIA_LIBRARY_VERSION_INT < 1141257600) -- cgit v1.2.3 From 2a2f8672188273831dacd58a0dc76055326e4ce2 Mon Sep 17 00:00:00 2001 From: Uoti Urpala Date: Sun, 4 Mar 2012 21:53:42 +0200 Subject: configure: fix --enable-static Hack around shell programming breakage that made Libav check fail with --enable-static. --- configure | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'configure') diff --git a/configure b/configure index 5a6433de95..53a9ead726 100755 --- a/configure +++ b/configure @@ -166,6 +166,7 @@ yasm_check() { } pkg_config_add() { + unset IFS # shell should not be used for programming echo >> "$TMPLOG" echo "$_pkg_config --cflags $@" >> "$TMPLOG" ctmp=$($_pkg_config --cflags "$@" 2>> "$TMPLOG") || return $? @@ -5802,9 +5803,7 @@ all_libav_libs="libavutil > 51.21.0:libavcodec > 53.34.0:libavformat > 53.20.0:l echocheck "Libav ($all_libav_libs)" if test "$ffmpeg" = auto ; then IFS=":" # shell should not be used for programming - if pkg_config_add $all_libav_libs ; then - unset IFS - else + if ! pkg_config_add $all_libav_libs ; then die "Unable to find development files for some of the required Libav libraries above. Aborting." fi fi -- cgit v1.2.3