[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: question regarding AC_CHECK_LIB
From: |
Noah Misch |
Subject: |
Re: question regarding AC_CHECK_LIB |
Date: |
Tue, 28 Dec 2004 15:04:22 -0800 |
User-agent: |
Mutt/1.5.6i |
> krishna wrote:
> >1.How do i specify the additional paths which AC_CHECK_LIB should check?
This is the typical idiom:
save_LDFLAGS="$LDFLAGS"
LDFLAGS="-L/dir $LDFLAGS"
AC_CHECK_LIB(...)
LDFLAGS="$save_LDFLAGS"
You could wrap it in a macro:
# AC_VAR_EXCURSION(VAR, VALUE, EXPRESSION)
# ----------------------------------------
# Set VAR, a shell variable, to VALUE, and expand EXPRESSION. Then, restore VAR
# to its original value.
AC_DEFUN([AC_VAR_EXCURSION],
[ave_save_$1="$$1"
$1="$2"
$3
$1="$ave_save_$1"])
and then:
AC_VAR_EXCURSION([LDFLAGS], [-L/dir $LDFLAGS], [AC_CHECK_LIB(...)])
> >2.Morever by default AC_CHECK_LIB looks for dynamic libraries.How do I
> >specify that I should look for a static library.
AC_CHECK_LIB looks for both static and dynamic libraries. If you wish to find
only static libraries, you could determine the compiler flag(s) that do what
`-static' does for gcc and add them to LDFLAGS for the AC_CHECK_LIB. It is
probably easiest to harness Libtool for that.