From 9ba85a0ef21b8424e7ab5e016768683d4ada252c Mon Sep 17 00:00:00 2001 From: Jens Thiele Date: Tue, 5 Dec 2006 10:07:18 +0000 Subject: [PATCH] provide m4 macro to make configure script of libt2n/codegen users simple --- Makefile.am | 3 +++ example-codegen/configure.in | 10 +--------- libt2n.m4 | 11 +++++++++++ 3 files changed, 15 insertions(+), 9 deletions(-) create mode 100644 libt2n.m4 diff --git a/Makefile.am b/Makefile.am index dec3f8a..4733f2c 100644 --- a/Makefile.am +++ b/Makefile.am @@ -15,3 +15,6 @@ all: config.h $(MAKE) $(AM_MAKEFLAGS) all-recursive $(MAKE) $(AM_MAKEFLAGS) check endif + +m4datadir = $(datadir)/aclocal +m4data_DATA = libt2n.m4 diff --git a/example-codegen/configure.in b/example-codegen/configure.in index fc39e9f..9f6da86 100644 --- a/example-codegen/configure.in +++ b/example-codegen/configure.in @@ -6,14 +6,6 @@ AC_LANG_CPLUSPLUS AC_PROG_CXX AM_PROG_LIBTOOL - -dnl: todo wrap this in a m4 macro? - -PKG_CHECK_MODULES(LIBT2N, libt2n = 0.1) -LIBT2N_CODEGEN=`$PKG_CONFIG --variable libt2n_codegen libt2n` -LIBT2N_DATADIR=`$PKG_CONFIG --variable libt2n_datadir libt2n` -LIBT2N_CLIENT_PCTEMPLATE="$LIBT2N_DATADIR/clientlib.pc.in" -AC_SUBST(LIBT2N_CODEGEN) -AC_SUBST(LIBT2N_CLIENT_PCTEMPLATE) +LIBT2N_CHECK(libt2n > 0.1) AC_OUTPUT(Makefile) diff --git a/libt2n.m4 b/libt2n.m4 new file mode 100644 index 0000000..6d3ba22 --- /dev/null +++ b/libt2n.m4 @@ -0,0 +1,11 @@ +dnl test for libt2n and libt2n-codegen +dnl LIBT2N(VERSION, action-if, action-not) +AC_DEFUN([LIBT2N_CHECK], +[ + PKG_CHECK_MODULES(LIBT2N, [$1], [$2], [$3]) + LIBT2N_CODEGEN=`$PKG_CONFIG --variable libt2n_codegen libt2n` + LIBT2N_DATADIR=`$PKG_CONFIG --variable libt2n_datadir libt2n` + LIBT2N_CLIENT_PCTEMPLATE="$LIBT2N_DATADIR/clientlib.pc.in" + AC_SUBST(LIBT2N_CODEGEN) + AC_SUBST(LIBT2N_CLIENT_PCTEMPLATE) +]) -- 1.7.1