build: use automake as a build system

Also provide a convenient pkg-config file at the same time.
This commit is contained in:
Jan Engelhardt 2014-08-10 10:50:29 +09:00
parent ef3f1430dd
commit 87532e8cab
5 changed files with 80 additions and 1 deletions

19
.gitignore vendored
View File

@ -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

37
Makefile.am Normal file
View File

@ -0,0 +1,37 @@
# -*- Makefile -*-
ACLOCAL_AMFLAGS = -I m4
AM_CPPFLAGS = -I${top_srcdir}
AM_CXXFLAGS = -Wall -Wextra -Wno-unknown-pragmas -Wshadow
if ENABLE_DEBUG
AM_CPPFLAGS += -DDEBUG
AM_CXXFLAGS += -g
endif
lib_LTLIBRARIES = libebml.la
libebml_la_SOURCES = \
src/Debug.cpp src/EbmlBinary.cpp src/EbmlContexts.cpp \
src/EbmlCrc32.cpp src/EbmlDate.cpp src/EbmlDummy.cpp \
src/EbmlElement.cpp src/EbmlFloat.cpp src/EbmlHead.cpp \
src/EbmlMaster.cpp src/EbmlSInteger.cpp src/EbmlStream.cpp \
src/EbmlString.cpp src/EbmlSubHead.cpp src/EbmlUInteger.cpp \
src/EbmlUnicodeString.cpp src/EbmlVersion.cpp src/EbmlVoid.cpp \
src/IOCallback.cpp src/MemIOCallback.cpp src/StdIOCallback.cpp
libebml_la_LDFLAGS = -version-info 4:0:0 -no-undefined
nobase_include_HEADERS = \
ebml/Debug.h ebml/EbmlBinary.h ebml/EbmlConfig.h ebml/EbmlContexts.h \
ebml/EbmlCrc32.h ebml/EbmlDate.h ebml/EbmlDummy.h ebml/EbmlElement.h \
ebml/EbmlEndian.h ebml/EbmlFloat.h ebml/EbmlHead.h ebml/EbmlId.h \
ebml/EbmlMaster.h ebml/EbmlSInteger.h ebml/EbmlStream.h \
ebml/EbmlString.h ebml/EbmlSubHead.h ebml/EbmlTypes.h \
ebml/EbmlUInteger.h ebml/EbmlUnicodeString.h ebml/EbmlVersion.h \
ebml/EbmlVoid.h ebml/IOCallback.h ebml/MemIOCallback.h \
ebml/StdIOCallback.h \
ebml/c/libebml_t.h
pkgconfigdir = ${libdir}/pkgconfig
pkgconfig_DATA = libebml.pc
${pkgconfig_DATA}: config.status

13
configure.ac Normal file
View File

@ -0,0 +1,13 @@
AC_INIT([libebml], [1.3.0])
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])
AC_CONFIG_FILES([Makefile libebml.pc])
AC_OUTPUT

10
libebml.pc.in Normal file
View File

@ -0,0 +1,10 @@
prefix=@prefix@
exec_prefix=@exec_prefix@
libdir=@libdir@
includedir=@includedir@
Name: libebml
Description: Library for parsing EBML data structures
Version: @PACKAGE_VERSION@
Libs: -L${libdir} -lebml
Cflags: -I${includedir}

2
m4/.gitignore vendored Normal file
View File

@ -0,0 +1,2 @@
/libtool.m4
/lt*.m4