Skip to content

Commit 3741e5c

Browse files
committed
Add autotools build system
1 parent b1fea20 commit 3741e5c

12 files changed

+756
-0
lines changed

Makefile.am

+105
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,105 @@
1+
2+
SUBDIRS = src examples include
3+
if ENABLE_DOCS
4+
SUBDIRS += doc
5+
endif
6+
7+
DIST_SUBDIRS = src examples include
8+
#DIST_SUBDIRS += doc
9+
10+
ACLOCAL_AMFLAGS = -I m4
11+
12+
AM_CFLAGS = -I$(top_srcdir)/include $(DEPS_CFLAGS)
13+
14+
dist_doc_DATA = COPYING AUTHORS README.txt
15+
16+
pkgconfigdir = $(libdir)/pkgconfig
17+
pkgconfig_DATA = daala.pc
18+
19+
debug:
20+
$(MAKE) CFLAGS="${CFLAGS} -O0 -ggdb -DOP_ENABLE_ASSERTIONS" all
21+
22+
EXTRA_DIST = \
23+
daala.pc.in \
24+
daala-uninstalled.pc.in \
25+
doc/Makefile \
26+
unix/Makefile
27+
28+
# Targets to build and install just the library without the docs
29+
daala install-daala: NO_DOXYGEN = 1
30+
31+
daala: all
32+
install-daala: install
33+
34+
# Or just the docs
35+
docs: doc/doxygen-build.stamp
36+
37+
install-docs:
38+
@if [ -z "$(NO_DOXYGEN)" ]; then \
39+
( cd doc && \
40+
echo "Installing documentation in $(DESTDIR)$(docdir)"; \
41+
$(INSTALL) -d $(DESTDIR)$(docdir)/html/search; \
42+
for f in `find html -type f \! -name "installdox"` ; do \
43+
$(INSTALL_DATA) $$f $(DESTDIR)$(docdir)/$$f; \
44+
done ) \
45+
fi
46+
47+
doc/doxygen-build.stamp: doc/Doxyfile $(top_srcdir)/doc/daala_logo.svg \
48+
$(top_srcdir)/include/*.h
49+
@[ -n "$(NO_DOXYGEN)" ] || ( cd doc && doxygen && touch $(@F) )
50+
51+
52+
if HAVE_DOXYGEN
53+
54+
# Or everything (by default)
55+
all-local: docs
56+
57+
install-data-local: install-docs
58+
59+
clean-local:
60+
$(RM) -r doc/html
61+
$(RM) -r doc/latex
62+
$(RM) doc/doxygen-build.stamp
63+
64+
uninstall-local:
65+
$(RM) -r $(DESTDIR)$(docdir)/html
66+
67+
endif
68+
69+
# We check this every time make is run, with configure.ac being touched to
70+
# trigger an update of the build system files if update_version changes the
71+
# current PACKAGE_VERSION (or if package_version was modified manually by a
72+
# user with either AUTO_UPDATE=no or no update_version script present - the
73+
# latter being the normal case for tarball releases).
74+
#
75+
# We can't just add the package_version file to CONFIGURE_DEPENDENCIES since
76+
# simply running autoconf will not actually regenerate configure for us when
77+
# the content of that file changes (due to autoconf dependency checking not
78+
# knowing about that without us creating yet another file for it to include).
79+
#
80+
# The MAKECMDGOALS check is a gnu-make'ism, but will degrade 'gracefully' for
81+
# makes that don't support it. The only loss of functionality is not forcing
82+
# an update of package_version for `make dist` if AUTO_UPDATE=no, but that is
83+
# unlikely to be a real problem for any real user.
84+
$(top_srcdir)/configure.ac: force
85+
@case "$(MAKECMDGOALS)" in \
86+
dist-hook) exit 0 ;; \
87+
dist-* | dist | distcheck | distclean) _arg=release ;; \
88+
esac; \
89+
if ! $(top_srcdir)/update_version $$_arg 2> /dev/null; then \
90+
if [ ! -e $(top_srcdir)/package_version ]; then \
91+
echo 'PACKAGE_VERSION="unknown"' > $(top_srcdir)/package_version; \
92+
fi; \
93+
. $(top_srcdir)/package_version || exit 1; \
94+
[ "$(PACKAGE_VERSION)" != "$$PACKAGE_VERSION" ] || exit 0; \
95+
fi; \
96+
touch $@
97+
98+
force:
99+
100+
# Create a minimal package_version file when make dist is run.
101+
dist-hook:
102+
echo 'PACKAGE_VERSION="$(PACKAGE_VERSION)"' > $(top_distdir)/package_version
103+
104+
105+
.PHONY: daala install-daala docs install-docs

README.txt

Whitespace-only changes.

autogen.sh

+16
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
#!/bin/sh
2+
# Run this to set up the build system: configure, makefiles, etc.
3+
set -e
4+
5+
srcdir=`dirname $0`
6+
test -n "$srcdir" && cd "$srcdir"
7+
8+
echo "Updating build configuration files for daala, please wait...."
9+
10+
ACLOCAL_FLAGS="-I m4"
11+
autoreconf -if
12+
13+
if test "$NO_CONFIGURE" = "" ; then
14+
./configure $@
15+
fi
16+

configure.ac

+126
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,126 @@
1+
# autoconf source script for generating configure
2+
3+
dnl The package_version file will be automatically synced to the git revision
4+
dnl by the update_version script when configured in the repository, but will
5+
dnl remain constant in tarball releases unless it is manually edited.
6+
m4_define([CURRENT_VERSION],
7+
m4_esyscmd([ if test -e package_version || ./update_version; then
8+
. ./package_version
9+
printf "$PACKAGE_VERSION"
10+
else
11+
printf "unknown"
12+
fi ]))
13+
14+
AC_INIT([daala],[CURRENT_VERSION],[daala@xiph.org])
15+
AC_CONFIG_SRCDIR([src/decode.c])
16+
17+
AC_USE_SYSTEM_EXTENSIONS
18+
AC_SYS_LARGEFILE
19+
20+
AM_INIT_AUTOMAKE([1.11 foreign no-define])
21+
AM_MAINTAINER_MODE([enable])
22+
LT_INIT
23+
24+
m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])])
25+
26+
AC_CONFIG_MACRO_DIR([m4])
27+
28+
dnl Library versioning for libtool.
29+
dnl Please update these for releases.
30+
dnl CURRENT, REVISION, AGE
31+
dnl - library source changed -> increment REVISION
32+
dnl - interfaces added/removed/changed -> increment CURRENT, REVISION = 0
33+
dnl - interfaces added -> increment AGE
34+
dnl - interfaces removed -> AGE = 0
35+
36+
OP_LT_CURRENT=0
37+
OP_LT_REVISION=1
38+
OP_LT_AGE=0
39+
40+
AC_SUBST(OP_LT_CURRENT)
41+
AC_SUBST(OP_LT_REVISION)
42+
AC_SUBST(OP_LT_AGE)
43+
44+
CC_CHECK_CFLAGS_APPEND(
45+
[-std=c89 -pedantic -Wall -Wextra -Wno-parentheses -Wno-long-long])
46+
47+
# Platform-specific tweaks
48+
case $host in
49+
*-mingw*)
50+
# -std=c89 causes some warnings under mingw.
51+
CC_CHECK_CFLAGS_APPEND([-U__STRICT_ANSI__])
52+
# We need WINNT>=0x501 (WindowsXP) for getaddrinfo/freeaddrinfo.
53+
# It's okay to define this even when HTTP support is disabled, as it only
54+
# affects header declarations, not linking (unless we actually use some
55+
# XP-only functions).
56+
AC_DEFINE_UNQUOTED(_WIN32_WINNT,0x501,
57+
[We need at least WindowsXP for getaddrinfo/freaddrinfo])
58+
host_mingw=true
59+
;;
60+
esac
61+
AM_CONDITIONAL(OP_WIN32, test "$host_mingw" = "true")
62+
63+
AC_ARG_ENABLE([assertions],
64+
AS_HELP_STRING([--enable-assertions], [Enable assertions in code]),,
65+
enable_assertions=no)
66+
67+
AS_IF([test "$enable_assertions" = "yes"], [
68+
AC_DEFINE([OP_ENABLE_ASSERTIONS], [1], [Enable assertions in code])
69+
])
70+
71+
PKG_CHECK_MODULES([DEPS], [ogg >= 1.3 sdl])
72+
73+
#CC_ATTRIBUTE_VISIBILITY([default], [
74+
# CC_FLAG_VISIBILITY([CFLAGS="${CFLAGS} -fvisibility=hidden"])
75+
#])
76+
77+
dnl Check for doxygen
78+
AC_ARG_ENABLE([doc],
79+
AS_HELP_STRING([--disable-doc], [Do not build API documentation]),,
80+
[enable_doc=yes]
81+
)
82+
AC_CHECK_PROG(HAVE_DOXYGEN, doxygen, yes, no)
83+
if test "$HAVE_DOXYGEN" != "yes" -o "$enable_doc" != "yes" ; then
84+
HAVE_DOXYGEN="no"
85+
enable_doc="no"
86+
fi
87+
AM_CONDITIONAL(HAVE_DOXYGEN, [test $HAVE_DOXYGEN = yes])
88+
89+
AC_CHECK_PROG(HAVE_FIG2DEV, fig2dev, yes, no)
90+
if test "$HAVE_FIG2DEV" != "yes" -o "$enable_doc" != "yes" ; then
91+
HAVE_FIG2DEV="no"
92+
enable_doc="no"
93+
fi
94+
AM_CONDITIONAL(HAVE_FIG2DEV, [test $HAVE_FIG2DEV = yes])
95+
96+
AM_CONDITIONAL(ENABLE_X86ASM, [test yes = yes])
97+
98+
AM_CONDITIONAL(ENABLE_DOCS, [test $enable_doc = yes])
99+
100+
DAALA_DEC_LIBS="\$(top_builddir)/src/libdaaladec.la \$(top_builddir)/src/libdaalabase.la -lm"
101+
AC_SUBST(DAALA_DEC_LIBS)
102+
103+
DAALA_ENC_LIBS="\$(top_builddir)/src/libdaalaenc.la \$(top_builddir)/src/libdaalabase.la -lm"
104+
AC_SUBST(DAALA_ENC_LIBS)
105+
106+
AC_CONFIG_FILES([
107+
Makefile
108+
daala.pc
109+
daala-uninstalled.pc
110+
src/Makefile
111+
examples/Makefile
112+
include/Makefile
113+
])
114+
AC_OUTPUT
115+
116+
AC_MSG_NOTICE([
117+
------------------------------------------------------------------------
118+
$PACKAGE_NAME $PACKAGE_VERSION: Automatic configuration OK.
119+
120+
Assertions ................... ${enable_assertions}
121+
122+
Hidden visibility ............ ${cc_cv_flag_visibility}
123+
124+
API documentation ............ ${enable_doc}
125+
------------------------------------------------------------------------
126+
])

daala-uninstalled.pc.in

+14
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
# daala uninstalled pkg-config file
2+
3+
prefix=
4+
exec_prefix=
5+
libdir=${pcfiledir}/.libs
6+
includedir=${pcfiledir}/@top_srcdir@/include
7+
8+
Name: daala uninstalled
9+
Description: Daala encoding/decoding library (not installed)
10+
Version: @PACKAGE_VERSION@
11+
Requires.private: ogg >= 1.3
12+
Conflicts:
13+
Libs: ${libdir}/libdaala.la @lrintf_lib@
14+
Cflags: -I${includedir}

daala.pc.in

+15
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
# daala installed pkg-config file
2+
3+
prefix=@prefix@
4+
exec_prefix=@exec_prefix@
5+
libdir=@libdir@
6+
includedir=@includedir@
7+
8+
Name: daala
9+
Description: Daala encoding/decoding library
10+
Version: @PACKAGE_VERSION@
11+
Requires.private: ogg >= 1.3
12+
Conflicts:
13+
Libs: -L${libdir} -ldaala
14+
Libs.private: @lrintf_lib@
15+
Cflags: -I${includedir}/daala

doc/Makefile

+3
Original file line numberDiff line numberDiff line change
@@ -63,3 +63,6 @@ distclean: clean
6363
maintainer-clean: distclean
6464

6565
maintainerclean: maintainer-clean
66+
67+
distdir:
68+

examples/Makefile.am

+12
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
2+
noinst_PROGRAMS = dump_video encoder_example player_example
3+
4+
dump_video_SOURCES = dump_video.c
5+
dump_video_LDADD = $(DAALA_DEC_LIBS) $(DEPS_LIBS)
6+
7+
encoder_example_SOURCES = encoder_example.c
8+
encoder_example_LDADD = $(DAALA_ENC_LIBS) $(DEPS_LIBS)
9+
10+
player_example_SOURCES = player_example.c
11+
player_example_LDADD = $(DAALA_ENC_LIBS) $(DEPS_LIBS)
12+

include/Makefile.am

+6
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
daalaincludedir = ${includedir}/daala
2+
daalainclude_HEADERS = \
3+
daala/codec.h \
4+
daala/daaladec.h \
5+
daala/daalaenc.h
6+

0 commit comments

Comments
 (0)