Autotools Quick Reference
You can use then the following basic autotools setup, which is just 9 lines. You can start from here and add more stuff (including libtool).
configure.ac:
AC_INIT([package], [version])
AM_INIT_AUTOMAKE([foreign])
AC_CONFIG_SRCDIR([configure.ac])
AC_CONFIG_HEADERS([config.h]) # not even really needed
AC_PROG_CC # or AC_PROG_CXX
AC_CONFIG_FILES([Makefile])
AC_OUTPUT
Makefile.am:
bin_PROGRAMS = hello
hello_SOURCES = hello.c
That's enough for:
$ autoreconf -fvi
$ ./configure
$ make
On top of this, for each package you need, you add:
PKG_CHECK_MODULES([cairo], [cairo])
PKG_CHECK_MODULES([fontconfig], [fontconfig])
and
AM_CFLAGS = $(cairo_CFLAGS) $(fontconfig_CFLAGS)
LIBS = $(cairo_LIBS) $(fontconfig_LIBS)
respectively in configure.ac (after AC_PROG_CC) and Makefile.am.
More information