[opus] [libopusfile PATCH] build: implement autotools build system for libopusfile.

Diego Elio Pettenò flameeyes at flameeyes.eu
Tue Sep 25 08:20:58 PDT 2012

On 24/09/2012 21:49, Timothy B. Terriberry wrote:
> Skipping running autoheader succeeds. This is a good start, but there
> are a number of issues.

I've locally added the autogen.sh to call `autoreconf -fis` — will be in
patch v2 by the end of the day.

> --enable-http doesn't actually add -DOP_ENABLE_HTTP to the CFLAGS, so
> the actual http support doesn't get built.


> The configure check for lrintf doesn't define -DOP_HAVE_LRINTF on
> success, so that doesn't actually get used, either.


> make debug doesn't add -DOP_ENABLE_ASSERTIONS, so assertions aren't
> enabled. I think I'd also prefer to use $(filter-out) to remove -O
> from CFLAGS, instead of trying to override with -O0.

Fixed the assertions _but_ $(filter-out) requires you to actually give
it a set of values to filter, so something along the lines of
$(filter-out -O1 -O2 -O3 -Os,$(CFLAGS)) — but this is not really
reliable, as gcc actually accepts -O4 -O5 -O6 etc. as aliases to -O3.

-O0 on the other hand will disable all levels, and since the arguments
are parsed in order, the last one encountered wins.

> It would also be nice to get --enable-fixed-point (-DOP_FIXED_PINT)


> and --disable-float (-DOP_DISABLE_FLOAT_API, requires
> -DOP_FIXED_POINT, should disable linking with -lm for lrintf).


> The default CFLAGS should include -std=c89 -pedantic -Wextra
> -Wno-parentheses -Wno-long-long -Wall

Done. Note that -Wall has to come before -Wno-* otherwise it'll always
enable them.

> They should also include -fvisibility=hidden. Right now I believe you
> are exporting the internal library functions.

Done with a modified m4/attributes.m4 from feng (the one in systemd is
broken, note to self: gotta fix it).

> Really, we should be
> doing this with a linker script, so we can build an export list for
> Windows from the same source, but adding the flag is the easiest
> thing to do for now.

Both are nice things to do, honestly. The Windows export list is easy to
use with libtool, but using hidden visibility gets you some improvements
during the compile step sometimes (not often, but sometimes).

Diego Elio Pettenò — Flameeyes
flameeyes at flameeyes.euhttp://blog.flameeyes.eu/

More information about the opus mailing list