Question about CheckForLibrary function in configure script
Giuseppe Sacco <[email protected]> Wed, 10 Feb 2010 02:28:49 +0100
| Newsgroups | gmane.comp.telephony.fax.hylafax.devel |
|---|---|
| Message-ID | <1265765329.12232.78.camel@scarafaggio> |
Hi all,
I found that libutil is required on some system for accessing logwtmp()
and logout() system function. As an example, the library is required on
freebsd, while it isn't on linux.
hylafax configure script check for LIBUTIL this way: first LIBUTIL is
set to "", then it does this call:
if CheckForLibrary logwtmp -lutil; then
Note "Looks like -lutil is needed for wtmp file logging."
LIBUTIL="-lutil"
HAS_LOGWTMP=yes
else
HAS_LOGWTMP=no
fi
that uses the following CheckForLibrary function
#
# Look for a library using a known (unique) function.
#
CheckForLibrary()
{
f=$1; shift
libs="$@";
cat>t.c<<EOF
int t() { $f(); return 0; }
int main(){ t(); return 0; }
EOF
capture cat t.c
runMake t "t:; \${CCF} t.c $libs"
}
My question is: this function only check if the source compile once
linked with the library. So, when on system that do not require the
library to be linked, it still get the library in LIBUTIL.
Is this correct?
Thanks,
Giuseppe
____________________ HylaFAX(tm) Developers Mailing List ____________________
To subscribe/unsubscribe, click http://lists.hylafax.org/cgi-bin/lsg2.cgi
On UNIX: mail -s unsubscribe [email protected] < /dev/null