@node ax_path_generic @unnumberedsec ax_path_generic @majorheading Synopsis @smallexample AX_PATH_GENERIC(LIBRARY,[MINIMUM-VERSION,[SED-EXPR-EXTRACTOR]],[ACTION-IF-FOUND],[ACTION-IF-NOT-FOUND],[CONFIG-SCRIPTS],[CFLAGS-ARG],[LIBS-ARG]) @end smallexample @majorheading Description Runs the LIBRARY-config script and defines LIBRARY_CFLAGS and LIBRARY_LIBS unless the user had predefined them in the environment. 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'. Preferably use CONFIG-SCRIPTS as config script, CFLAGS-ARG instead of `--cflags` and LIBS-ARG instead of `--libs`, if given. The SED-EXPR-EXTRACTOR parameter represents 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'. The macro respects LIBRARY_CONFIG, LIBRARY_CFLAGS and LIBRARY_LIBS variables. If the first one is defined, it specifies the name of the config script to use. If the latter two are defined, the script is not ran at all and their values are used instead (if only one of them is defined, the empty value of the remaining one is still used). Example: @smallexample AX_PATH_GENERIC(Foo, 1.0.0) @end smallexample 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: @smallexample FOO_CFLAGS to `foo-config --cflags` FOO_LIBS to `foo-config --libs` @end smallexample Example: @smallexample AX_PATH_GENERIC([Bar],,,[ AC_MSG_ERROR([Cannot find Bar library]) ]) @end smallexample would check for bar-config program, defining and substituting the following variables: @smallexample BAR_CFLAGS to `bar-config --cflags` BAR_LIBS to `bar-config --libs` @end smallexample Example: @smallexample ./configure BAZ_LIBS=/usr/lib/libbaz.a @end smallexample would link with a static version of baz library even if `baz-config --libs` returns just "-lbaz" that would normally result in using the shared library. This macro is a rearranged version of AC_PATH_GENERIC from Angus Lees. @majorheading Source Code Download the @uref{http://git.savannah.gnu.org/gitweb/?p=autoconf-archive.git;a=blob_plain;f=m4/ax_path_generic.m4,latest version of @file{ax_path_generic.m4}} or browse @uref{http://git.savannah.gnu.org/gitweb/?p=autoconf-archive.git;a=history;f=m4/ax_path_generic.m4,the macro's revision history}. @majorheading License @w{Copyright @copyright{} 2009 Francesco Salvestrini @email{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. This file is offered as-is, without any warranty.