[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Autoconf] Use of custom m4 macros
From: |
Fred |
Subject: |
[Autoconf] Use of custom m4 macros |
Date: |
6 Apr 2005 10:48:41 -0700 |
Hello everybody,
I have created a few libraries using autotools, namely
autoconf/autoheader/automake. I have for each of these libraries an m4
script inspired from a distributed package (gsl) called e.g. mylib.m4.
As all these libs interact together, I would like to automatize the
search for other libraries. For now, I search it using low level
autoconf functions (see below) - I would like to either reuse created
m4 macros (but no idea how to do that) or to write one generic because
all my libs are found following this scheme i.e. I have three to five
times the snippet below with just 'mylib' which changes. I have tried
to copy the m4 macros into the new project directory and ran aclocal,
but the local m4 macros were not read and used.
How to do that? any help appreciated...
fred
----- snippet - autoconf.ac ----
mylib_prefix=no
AC_ARG_WITH(mylib-prefix,
[AC_HELP_STRING([--with-mylib-prefix=DIR],
[My great library (mylib) installation prefix]
)],
[mylib_prefix=${withval}]
)
if test "x${mylib_prefix}" != xno; then
CFLAGS="${CFLAGS} -I${mylib_prefix}/include -L${mylib_prefix}/lib"
fi
AC_CHECK_LIB([mylib], [main])
if test "x$ac_cv_lib_mylib_main" = xno; then
AC_MSG_RESULT([
ERROR: Mylib was not found ; use
the configure flag --with-mylib-prefix=<path>. For more info see
infopage
at www.blabla...
])
AC_MSG_ERROR([ please correct and rerun configure])
fi
----- snippet - end ----
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Autoconf] Use of custom m4 macros,
Fred <=