Skip to content

Commit

Permalink
Use autotools for building
Browse files Browse the repository at this point in the history
  • Loading branch information
benlangfeld committed Jan 7, 2014
1 parent 0ef7748 commit b26bfc7
Show file tree
Hide file tree
Showing 15 changed files with 127 additions and 0 deletions.
22 changes: 22 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -16,3 +16,25 @@
*.exe
*.out
*.app

# Autotools stuff
/INSTALL
/Makefile
/Makefile.in
/aclocal.m4
/autom4te.cache/
/config*
/depcomp
/cspeech-*.pc
/cspeech-*.tar.*
/cspeechconfig.h
/install-sh
/libtool
/ltmain.sh
/missing
/stamp-h?
.deps/
.dirstamp
.libs/
*.l[ao]
/compile
Empty file added AUTHORS
Empty file.
File renamed without changes.
Empty file added ChangeLog
Empty file.
68 changes: 68 additions & 0 deletions Makefile.am
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
## Place generated object files (.o) into the same directory as their source
## files, in order to avoid collisions when non-recursive make is used.
AUTOMAKE_OPTIONS = subdir-objects

## Additional flags to pass to aclocal when it is invoked automatically at
## make time. The ${ACLOCAL_FLAGS} variable is picked up from the environment
## to provide a way for the user to supply additional arguments.
ACLOCAL_AMFLAGS = ${ACLOCAL_FLAGS}

## Define a libtool archive target "libcspeech-@[email protected]", with
## @CSPEECH_API_VERSION@ substituted into the generated Makefile at configure
## time.
## The libtool archive file (.la) will be installed into the directory named
## by the predefined variable $(bindir), along with the actual shared library
## file (.so).
lib_LTLIBRARIES = libcspeech-@[email protected]

## Define the source file list for the "libcspeech-@[email protected]"
## target. Note that @CSPEECH_API_VERSION@ is not interpreted by Automake and
## will therefore be treated as if it were literally part of the target name,
## and the variable name derived from that.
## The file extension .cc is recognized by Automake, and makes it produce
## rules which invoke the C++ compiler to produce a libtool object file (.lo)
## from each source file. Note that it is not necessary to list header files
## which are already listed elsewhere in a _HEADERS variable assignment.
libcspeech_@CSPEECH_API_VERSION@_la_SOURCES = cspeech/nlsml.cc \
cspeech/srgs.cc

## Instruct libtool to include ABI version information in the generated shared
## library file (.so). The library ABI version is defined in configure.ac, so
## that all version information is kept in one place.
libcspeech_@CSPEECH_API_VERSION@_la_LDFLAGS = -version-info $(CSPEECH_SO_VERSION)

## Define the list of public header files and their install location. The
## nobase_ prefix instructs Automake to not strip the directory part from each
## filename, in order to avoid the need to define separate file lists for each
## installation directory. This only works if the directory hierarchy in the
## source tree matches the hierarchy at the install location, however.
cspeech_includedir = $(includedir)/cspeech-$(CSPEECH_API_VERSION)
nobase_cspeech_include_HEADERS = cspeech.h \
cspeech/nlsml.h \
cspeech/srgs.h

## The generated configuration header is installed in its own subdirectory of
## $(libdir). The reason for this is that the configuration information put
## into this header file describes the target platform the installed library
## has been built for. Thus the file must not be installed into a location
## intended for architecture-independent files, as defined by the Filesystem
## Hierarchy Standard (FHS).
## The nodist_ prefix instructs Automake to not generate rules for including
## the listed files in the distribution on 'make dist'. Files that are listed
## in _HEADERS variables are normally included in the distribution, but the
## configuration header file is generated at configure time and should not be
## shipped with the source tarball.
cspeech_libincludedir = $(libdir)/cspeech-$(CSPEECH_API_VERSION)/include
nodist_cspeech_libinclude_HEADERS = cspeechconfig.h

## Install the generated pkg-config file (.pc) into the expected location for
## architecture-dependent package configuration information. Occasionally,
## pkg-config files are also used for architecture-independent data packages,
## in which case the correct install location would be $(datadir)/pkgconfig.
pkgconfigdir = $(libdir)/pkgconfig
pkgconfig_DATA = cspeech-$(CSPEECH_API_VERSION).pc

## Define an independent executable script for inclusion in the distribution
## archive. However, it will not be installed on an end user's system due to
## the noinst_ prefix.
dist_noinst_SCRIPTS = autogen.sh
Empty file added NEWS
Empty file.
File renamed without changes.
6 changes: 6 additions & 0 deletions autogen.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
#!/bin/sh -e
test -n "$srcdir" || srcdir=`dirname "$0"`
test -n "$srcdir" || srcdir=.

autoreconf --force --install --verbose "$srcdir"
test -n "$NOCONFIGURE" || "$srcdir/configure" "$@"
20 changes: 20 additions & 0 deletions cspeech.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
/*
* cspeech - Speech document (SSML, SRGS, NLSML) modelling and matching for C
* Copyright (C) 2013, Grasshopper
*
* License: MIT
*
* Contributor(s):
* Chris Rienzo <[email protected]>
*
* cspeech.h
*
*/

#ifndef CSPEECH_H_
#define CSPEECH_H_

#include <cspeech/srgs.h>
#include <cspeech/nlsml.h>

#endif // CSPEECH_H_
11 changes: 11 additions & 0 deletions cspeech.pc.in
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
prefix=@prefix@
exec_prefix=@exec_prefix@
libdir=@libdir@
includedir=@includedir@

Name: @PACKAGE_NAME@
Description: Speech document (SSML, SRGS, NLSML) modelling and matching for C
Version: @PACKAGE_VERSION@
URL: @PACKAGE_URL@
Libs: -L${libdir} -lexample-@CSPEECH_API_VERSION@
Cflags: -I${includedir}/cspeech-@CSPEECH_API_VERSION@ -I${libdir}/cspeech-@CSPEECH_API_VERSION@/include
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Empty file added cspeechconfig.h.in
Empty file.

0 comments on commit b26bfc7

Please sign in to comment.