Autoconf Archive Macros by Category
Search:

ax_path_generic

SYNOPSIS

AX_PATH_GENERIC(LIBRARY,[MINIMUM-VERSION,[SED-EXPR-EXTRACTOR]],[ACTION-IF-FOUND],[ACTION-IF-NOT-FOUND],[CONFIG-SCRIPTS],[CFLAGS-ARG],[LIBS-ARG])

DESCRIPTION

Runs the LIBRARY-config script and defines LIBRARY_CFLAGS and LIBRARY_LIBS

The script must support `--cflags' and `--libs' args. If MINIMUM-VERSION is specified, the script must also support the `--version' arg. If the `--with-library-[exec-]prefix' arguments to ./configure are given, it must also support `--prefix' and `--exec-prefix'. Prefereable use CONFIG-SCRIPTS as config script, CFLAGS-ARG instead of `--cflags` and LIBS-ARG instead of `--libs`, if given.

The SED-EXPR-EXTRACTOR parameter representes the expression used in sed to extract the version number. Use it if your 'foo-config --version' dumps something like 'Foo library v1.0.0 (alfa)' instead of '1.0.0'.

Example:

   AX_PATH_GENERIC(Foo, 1.0.0)

would run `foo-config --version' and check that it is at least 1.0.0, if successful the following variables would be defined and substituted:

   FOO_CFLAGS to `foo-config --cflags`
   FOO_LIBS   to `foo-config --libs`

Example:

   AX_PATH_GENERIC([Bar],,,[
      AC_MSG_ERROR([Cannot find Bar library])
   ])

would check for bar-config program, defining and substituting the following variables:

   BAR_CFLAGS to `bar-config --cflags`
   BAR_LIBS   to `bar-config --libs`

This macro is a rearranged version of AC_PATH_GENERIC from Angus Lees.

SOURCE CODE

Download ax_path_generic.m4 or browse the revision history.

LICENSE

Copyright © 2009 Francesco Salvestrini <salvestrini@users.sourceforge.net>

Copying and distribution of this file, with or without modification, are permitted in any medium without royalty provided the copyright notice and this notice are preserved.