libtldevel
Introduction
Libtldevel is a library I use to develop C programs. It contains wrappers around memory allocation functions and modules to do various other things.
The library includes code from:
klib - by attractive chaos
easel - from the Sean Eddy / Elena Rivas lab
Installation
To use this library, unpack it in the root directory of your C project. Rename the unpacked tldevel-XXX
tldevel
and make add the macro “ax_with_tldevel.m4” to a m4
directory in your project. In configure.ac
:
AM_INIT_AUTOMAKE
LT_INIT
AC_CONFIG_MACRO_DIRS([m4])
m4_include([m4/ax_with_tldevel.m4])
AX_WITH_TLDEVEL
Add lib_tldevel to subdirs in main top level Makefile.am
:
SUBDIRS = $(TLDEVELDIR)
And let add the library to project Makefile.am
’s that need it
AM_CFLAGS = @TLDEVEL_CPPFLAGS@
LIBS = @TLDEVEL_LIB@
To make this work nicely with my emacs config let company know where tldevel is installed
((c-mode (eval setq company-clang-arguments (append
company-clang-arguments
'("-I../tldevel-1.0")))))
The main autogen.sh
script should also know about it:
#!/usr/bin/env sh
exists()
{
command -v "$1" >/dev/null 2>&1
}
if ! exists libtoolize; then
if ! exists glibtoolize; then
echo 'libtool/glibtool not found!'
echo 'to install using homebrew:'
echo 'brew install libtool'
exit 1
fi
fi
if ! exists aclocal; then
echo 'aclocal not found!'
echo 'to install using homebrew:'
echo 'brew install automake'
exit 1
fi
if ! exists autoheader; then
echo 'autoheader not found!'
echo 'to install using homebrew:'
echo 'brew install automake'
exit 1
fi
if ! exists automake; then
echo 'automake not found!'
echo 'to install using homebrew:'
echo 'brew install automake'
exit 1
fi
if ! exists autoconf; then
echo 'autoconf not found!'
echo 'to install using homebrew:'
echo 'brew install automake'
exit 1
fi
This is the main block.
test -n "$srcdir" || srcdir=`dirname "$0"`
cd "$srcdir"
case `uname` in Darwin*) glibtoolize --force --copy ;;
*) libtoolize --force --copy ;;
esac
aclocal -I m4 $AL_OPTS
autoheader $AH_OPTS
automake --add-missing --copy --gnu $AM_OPTS
autoconf $AC_OPTS
Notes
At some point I should add wrappers and/or test scripts for GNU =libavl=.