From 78334a0d2c7491f3fb4e0846d3771196ad7de59a Mon Sep 17 00:00:00 2001 From: Moritz Bunkus Date: Sun, 21 Dec 2014 10:22:49 +0100 Subject: [PATCH] build system: add autoconf/automake-based system --- .gitignore | 19 +++++++++++++- Makefile.am | 65 +++++++++++++++++++++++++++++++++++++++++++++++ autogen.sh | 9 +++++++ configure.ac | 14 ++++++++++ libmatroska.pc.in | 11 ++++++++ m4/.gitignore | 2 ++ 6 files changed, 119 insertions(+), 1 deletion(-) create mode 100644 Makefile.am create mode 100755 autogen.sh create mode 100644 configure.ac create mode 100644 libmatroska.pc.in create mode 100644 m4/.gitignore diff --git a/.gitignore b/.gitignore index b3ef86c..0a62324 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1,18 @@ -*.[ao] +.deps/ +.libs/ +*.a +*.la +*.lo +*.o +*.pc +Makefile +Makefile.in +.dirstamp + +/aclocal.m4 +/autom4te.cache/ +/build-aux/ +/config.* +/configure +/libtool +/stamp-h1 diff --git a/Makefile.am b/Makefile.am new file mode 100644 index 0000000..f3b881d --- /dev/null +++ b/Makefile.am @@ -0,0 +1,65 @@ +# -*- Makefile -*- + +ACLOCAL_AMFLAGS = -I m4 + +AM_CPPFLAGS = -I${top_srcdir} +AM_CXXFLAGS = -Wall -Wextra -Wno-unknown-pragmas -Wshadow $(EBML_CFLAGS) +if ENABLE_DEBUG +AM_CPPFLAGS += -DDEBUG +AM_CXXFLAGS += -g +endif + +lib_LTLIBRARIES = libmatroska.la +libmatroska_la_SOURCES = \ + src/FileKax.cpp \ + src/KaxAttached.cpp \ + src/KaxAttachments.cpp \ + src/KaxBlock.cpp \ + src/KaxBlockData.cpp \ + src/KaxCluster.cpp \ + src/KaxContexts.cpp \ + src/KaxCues.cpp \ + src/KaxCuesData.cpp \ + src/KaxInfoData.cpp \ + src/KaxSeekHead.cpp \ + src/KaxSegment.cpp \ + src/KaxSemantic.cpp \ + src/KaxTracks.cpp \ + src/KaxVersion.cpp +libmatroska_la_LDFLAGS = -version-info 6:0:0 -no-undefined + +nobase_include_HEADERS = \ + matroska/c/libmatroska.h \ + matroska/c/libmatroska_t.h \ + matroska/FileKax.h \ + matroska/KaxAttached.h \ + matroska/KaxAttachments.h \ + matroska/KaxBlockData.h \ + matroska/KaxBlock.h \ + matroska/KaxChapters.h \ + matroska/KaxClusterData.h \ + matroska/KaxCluster.h \ + matroska/KaxConfig.h \ + matroska/KaxContentEncoding.h \ + matroska/KaxContexts.h \ + matroska/KaxCuesData.h \ + matroska/KaxCues.h \ + matroska/KaxDefines.h \ + matroska/KaxInfoData.h \ + matroska/KaxInfo.h \ + matroska/KaxSeekHead.h \ + matroska/KaxSegment.h \ + matroska/KaxSemantic.h \ + matroska/KaxTag.h \ + matroska/KaxTags.h \ + matroska/KaxTrackAudio.h \ + matroska/KaxTrackEntryData.h \ + matroska/KaxTracks.h \ + matroska/KaxTrackVideo.h \ + matroska/KaxTypes.h \ + matroska/KaxVersion.h + +pkgconfigdir = ${libdir}/pkgconfig +pkgconfig_DATA = libmatroska.pc + +${pkgconfig_DATA}: config.status diff --git a/autogen.sh b/autogen.sh new file mode 100755 index 0000000..9ad2906 --- /dev/null +++ b/autogen.sh @@ -0,0 +1,9 @@ +#!/bin/bash + +set -e + +aclocal +autoheader +libtoolize --copy +automake --add-missing --copy +autoconf diff --git a/configure.ac b/configure.ac new file mode 100644 index 0000000..fa2fef1 --- /dev/null +++ b/configure.ac @@ -0,0 +1,14 @@ +AC_INIT([libmatroska], [1.4.2]) +AC_CONFIG_AUX_DIR([build-aux]) +AC_CONFIG_HEADERS([config.h]) +AC_CONFIG_MACRO_DIR([m4]) +AM_INIT_AUTOMAKE([foreign subdir-objects tar-pax]) +AC_PROG_CXX +LT_INIT +AC_ARG_ENABLE([debug], + AS_HELP_STRING([--enable-debug], [Add -g -DDEBUG to compile flags]), + [enable_debug="$withval"], [enable_debug=no]) +AM_CONDITIONAL([ENABLE_DEBUG], [test "$enable_debug" = yes]) +PKG_CHECK_MODULES([EBML],[libebml >= 1.3.1]) +AC_CONFIG_FILES([Makefile libmatroska.pc]) +AC_OUTPUT diff --git a/libmatroska.pc.in b/libmatroska.pc.in new file mode 100644 index 0000000..4e9b9d4 --- /dev/null +++ b/libmatroska.pc.in @@ -0,0 +1,11 @@ +prefix=@prefix@ +exec_prefix=@exec_prefix@ +libdir=@libdir@ +includedir=@includedir@ + +Name: libmatroska +Description: Library for parsing EBML data structures +Version: @PACKAGE_VERSION@ +Requires.private: libebml +Libs: -L${libdir} -lmatroska +Cflags: -I${includedir} diff --git a/m4/.gitignore b/m4/.gitignore new file mode 100644 index 0000000..64d9bbc --- /dev/null +++ b/m4/.gitignore @@ -0,0 +1,2 @@ +/libtool.m4 +/lt*.m4 -- 2.40.0