On Tue, 21 Sep 2010, Brad Jorsch wrote:

 > >i need someone to turn
 > >AC_CHECK_FUNC(strlcat, AC_DEFINE(HAVE_STRLCAT, 1, Check for strlcat))
 > >into something along the lines of
 > >
 > >if (strlcat is in libc)
 > >     define HAVE_STRLCAT
 > >else if (strlcat is in libbsd)
 > >     define HAVE_STRLCAT
 > >     define HAVE_LIBBSD
 > >     add -lbsd to LIBS (wutil libs)
 > >else
 > >     just move along
 > 
 > Is there really a need to define HAVE_LIBBSD? All we care about is
 > HAVE_STRLCAT, no matter how it is available.

there could be a need, but i'm not even close to knowing squat about 
autoconf, so i may be really wrong.

on the bsds (where these functions are in libc), they can be had by 
simply including <string.h>. on linux with libbsd, <bsd/string.h> is 
needed too (in addition to the "normal" string.h), so some sort of 
marker is needed to decide whether or not to include <bsd/string.h>. 
am i wrong thinking this?

also, in the libbsd case, -lbsd needs to be added to the wutil/wings 
libs (XXX clean up where and how), whereas on a real bsd, no 
additional nothing is needed, it just comes with libc.

 > dnl Check for strlcat
 > dnl =================
 > AC_SEARCH_LIBS([strlcat],[bsd],[AC_DEFINE(HAVE_STRLCAT, 1, [Define if 
 > strlcat is available])])
 > 
 > Works correctly for me, at any rate.

i'll give that a try, thanks.

-- 
[-]

mkdir /nonexistent


-- 
To unsubscribe, send mail to wmaker-dev-unsubscr...@lists.windowmaker.org.

Reply via email to