On Wed, 20 Feb 2013, Diego Biurrun wrote:

This is required to make math constants visible. Fixes Bugzilla #414.
---

Updated to take Cygwin into account as well.  Needs testing when
cross-compiling mingw from a linux host at least.

configure |    2 ++
1 files changed, 2 insertions(+), 0 deletions(-)

diff --git a/configure b/configure
index ec3b049..f047c78 100755
--- a/configure
+++ b/configure
@@ -3073,6 +3073,7 @@ elif check_cpp_condition features.h "defined __GLIBC__"; 
then
elif check_cpp_condition newlib.h "defined _NEWLIB_VERSION"; then
    libc_type=newlib
    add_cppflags -U__STRICT_ANSI__
+    add_host_cppflags -U__STRICT_ANSI__
elif check_header _mingw.h; then
    libc_type=mingw
    check_cpp_condition _mingw.h \
@@ -3080,6 +3081,7 @@ elif check_header _mingw.h; then
            (__MINGW32_MAJOR_VERSION == 3 && __MINGW32_MINOR_VERSION >= 15)" ||
        die "ERROR: MinGW runtime version must be >= 3.15."
    add_cppflags -U__STRICT_ANSI__
+    add_host_cppflags -U__STRICT_ANSI__
elif check_func_headers stdlib.h _get_doserrno; then
    libc_type=msvcrt
    add_compat strtod.o strtod=avpriv_strtod
--
1.7.9

This is wrong. The fact that the target system has the header _mingw.h or newlib.h does not imply anything about the host system. This would 1) lead to trying to add -U__STRICT_ANSI__ for the host system when cross compiling from linux to windows, and 2) lead to not trying to add -U__STRICT_ANSI__ for the host system when cross compiling from windows to linux.

The checks for host and target headers must be totally separate, with no decisions inferred from one to the other. The proper way would be to wrap the whole libc detection into a function that can be called for both host and target. Or then you use simpler logic for the host cflags (always adding -U__STRICT_ANSI__ if it works).

But deciding on host system features based on the target is very wrong.

// Martin
_______________________________________________
libav-devel mailing list
[email protected]
https://lists.libav.org/mailman/listinfo/libav-devel

Reply via email to