Re: [libav-devel] [RFC] [PATCH] configure: Make sure config.h isn't accidentally included in builds for the host

2016-11-03 Thread Martin Storsjö

On Thu, 3 Nov 2016, Diego Biurrun wrote:


On Thu, Nov 03, 2016 at 02:32:10PM +0200, Martin Storsjö wrote:

In aacps_tablegen.h, only include libm.h if building for the target.

If actual fallbacks are needed here (in practice, sinf and cosf,
which are missing on Plan 9 - they are present even on MSVC), we need
to include libm.h, but this relies on configure test results for the
target. These test results can't be used for the host (e.g. when this
header is used when building with --enable-hardcoded-tables).

This clearly breaks builds with hardcoded tables on Plan 9 (not
cross builds from another host to Plan 9 though), instead of relying on
coincidences that config.h for the target might match the host build
config as well.


So, speaking of Plan 9, IMO we should discuss if keeping support for it
is worth the trouble. It was a nice joke and pun with the 9 release, but
that has run its course.


Well, keeping it in itself isn't too much trouble, except we have no idea 
if it still works, and for things like this particular include of libm.h, 
I can't test. That said, I'm not opposed to removing it either, bringing 
the set of things back to things we test regularly.



--- a/configure
+++ b/configure
@@ -3719,6 +3719,7 @@ check_cc -D_LARGEFILE_SOURCE <

You can merge these two lines.


Ah, yes

// Martin
___
libav-devel mailing list
libav-devel@libav.org
https://lists.libav.org/mailman/listinfo/libav-devel

Re: [libav-devel] [RFC] [PATCH] configure: Make sure config.h isn't accidentally included in builds for the host

2016-11-03 Thread Diego Biurrun
On Thu, Nov 03, 2016 at 02:32:10PM +0200, Martin Storsjö wrote:
> In aacps_tablegen.h, only include libm.h if building for the target.
> 
> If actual fallbacks are needed here (in practice, sinf and cosf,
> which are missing on Plan 9 - they are present even on MSVC), we need
> to include libm.h, but this relies on configure test results for the
> target. These test results can't be used for the host (e.g. when this
> header is used when building with --enable-hardcoded-tables).
> 
> This clearly breaks builds with hardcoded tables on Plan 9 (not
> cross builds from another host to Plan 9 though), instead of relying on
> coincidences that config.h for the target might match the host build
> config as well.

So, speaking of Plan 9, IMO we should discuss if keeping support for it
is worth the trouble. It was a nice joke and pun with the 9 release, but
that has run its course.

> --- a/configure
> +++ b/configure
> @@ -3719,6 +3719,7 @@ check_cc -D_LARGEFILE_SOURCE < -D_LARGEFILE_SOURCE
>  EOF
>  
>  add_host_cppflags -D_ISOC99_SOURCE
> +add_host_cppflags -DHOST_BUILD

You can merge these two lines.

>  check_host_cflags -std=c99
>  check_host_cflags -Wall
>  check_host_cflags -O3
> @@ -5356,6 +5357,9 @@ cat > $TMPH <  #define EXTERN_PREFIX "${extern_prefix}"
>  #define EXTERN_ASM ${extern_prefix}
>  #define SLIBSUF "$SLIBSUF"
> +#ifdef HOST_BUILD
> +#error config.h must not be included in host builds
> +#endif
>  EOF

Go figure, I had practically the same idea some time ago ..

Diego
___
libav-devel mailing list
libav-devel@libav.org
https://lists.libav.org/mailman/listinfo/libav-devel

[libav-devel] [RFC] [PATCH] configure: Make sure config.h isn't accidentally included in builds for the host

2016-11-03 Thread Martin Storsjö
In aacps_tablegen.h, only include libm.h if building for the target.

If actual fallbacks are needed here (in practice, sinf and cosf,
which are missing on Plan 9 - they are present even on MSVC), we need
to include libm.h, but this relies on configure test results for the
target. These test results can't be used for the host (e.g. when this
header is used when building with --enable-hardcoded-tables).

This clearly breaks builds with hardcoded tables on Plan 9 (not
cross builds from another host to Plan 9 though), instead of relying on
coincidences that config.h for the target might match the host build
config as well.
---
 configure   | 4 
 libavcodec/aacps_tablegen.h | 2 ++
 2 files changed, 6 insertions(+)

diff --git a/configure b/configure
index 9264bb5..b43642f 100755
--- a/configure
+++ b/configure
@@ -3719,6 +3719,7 @@ check_cc -D_LARGEFILE_SOURCE < $TMPH