Diego Elio Pettenò
2012-Sep-25 03:04 UTC
[opus] [libopusfile PATCH] build: implement autotools build system for libopusfile.
--- This includes the check target that Tim requested. Signed-off-by: Diego Elio Petten? <flameeyes at flameeyes.eu> --- .gitignore | 24 ++++++++++++++++++++++++ Makefile.am | 22 ++++++++++++++++++++++ configure.ac | 14 ++++++++++++++ 3 file modificati, 60 inserzioni(+) create mode 100644 .gitignore create mode 100644 Makefile.am create mode 100644 configure.ac diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..d75d9ef --- /dev/null +++ b/.gitignore @@ -0,0 +1,24 @@ +*.la +*.lo +*.o +*~ +.deps +.dirstamp +.libs +/Makefile +Makefile.in +aclocal.m4 +autom4te.cache/ +config.guess +config.log +config.status +config.sub +configure +depcomp +examples/opusfile_example +examples/seeking_example +install-sh +libopusfile-*.tar.* +libtool +ltmain.sh +missing diff --git a/Makefile.am b/Makefile.am new file mode 100644 index 0000000..098a63d --- /dev/null +++ b/Makefile.am @@ -0,0 +1,22 @@ +AM_CFLAGS = -I$(top_srcdir)/include $(DEPS_CFLAGS) + +dist_doc_DATA = COPYING AUTHORS README.txt + +include_HEADERS = include/opusfile.h + +lib_LTLIBRARIES = libopusfile.la +libopusfile_la_SOURCES = \ + src/http.c src/info.c \ + src/internal.c src/internal.h \ + src/opusfile.c src/stream.c +libopusfile_la_LIBADD = $(DEPS_LIBS) + +EXTRA_PROGRAMS = examples/opusfile_example examples/seeking_example + +examples_opusfile_example_LDADD = libopusfile.la +examples_seeking_example_LDADD = libopusfile.la + +example: $(EXTRA_PROGRAMS) + +debug: + $(MAKE) CFLAGS="$(CFLAGS) -ggdb -O0" all example diff --git a/configure.ac b/configure.ac new file mode 100644 index 0000000..6113ee6 --- /dev/null +++ b/configure.ac @@ -0,0 +1,14 @@ +AC_INIT([libopusfile], [0.0]) + +AM_INIT_AUTOMAKE([1.11 foreign dist-bzip2]) + +LT_INIT + +AC_ARG_ENABLE([http], AS_HELP_STRING([--disable-http], [Disable HTTP support])) + +AS_IF([test "x$enable_http" != "xno"], [openssl="openssl"]) +PKG_CHECK_MODULES([DEPS], [ogg opus ]${openssl}) + +AC_SEARCH_LIBS([lrintf], [m]) + +AC_OUTPUT([Makefile]) -- 1.7.12
Timothy B. Terriberry
2012-Sep-25 04:00 UTC
[opus] [libopusfile PATCH] build: implement autotools build system for libopusfile.
Diego Elio Petten? wrote:> This includes the check target that Tim requested.Thanks for that. Right now (using autogen.sh copied from libopus), I am getting: autoheader-2.68: error: AC_CONFIG_HEADERS not found in configure.ac
Timothy B. Terriberry
2012-Sep-25 04:49 UTC
[opus] [libopusfile PATCH] build: implement autotools build system for libopusfile.
Skipping running autoheader succeeds. This is a good start, but there are a number of issues. --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. 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). I also find some kind of summary showing whether all of these options are enabled or disabled when configure is done to be extraordinarily useful (it lets users know both what the defaults are and what options are available in the first place, since the chances they'll run --help are slim). The default CFLAGS should include -std=c89 -pedantic -Wextra -Wno-parentheses -Wno-long-long -Wall They should also include -fvisibility=hidden. Right now I believe you are exporting the internal library functions. 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.
Maybe Matching Threads
- [libopusfile PATCH] build: implement autotools build system for libopusfile. (v3)
- [libopusfile PATCH] build: implement autotools build system for libopusfile. (v2)
- [libopusfile PATCH] build: implement autotools build system for libopusfile. (v4)
- Question about libopusfile downloading the last 64K when duration is not needed
- libopusfile win32 dll (MSVC)