autoconf
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: License and replacement files


From: Russ Allbery
Subject: Re: License and replacement files
Date: Fri, 13 Sep 2002 12:16:01 -0700
User-agent: Gnus/5.090008 (Oort Gnus v0.08) XEmacs/21.4 (Honest Recruiter, sparc-sun-solaris2.6)

Akim Demaille <address@hidden> writes:

> I think AC_FUNC_GETLOADAVG is the only example, is it not?

I've not checked recently.  I seem to remember there being others that had
similar problems but not to the same extent.

Quickly looking over the autoconf 2.53 documentation, the following macros
are also non-obvious to use if you don't already have the right
replacement code or really understand what's going on:

    AC_FUNC_ALLOCA
    AC_FUNC_SELECT_ARGTYPES
    AC_FUNC_VPRINTF

The following macros expect you to provide replacements, but implementing
the replacements is somewhat more obvious:

    AC_FUNC_ERROR_AT_LINE
    AC_FUNC_FNMATCH
    AC_FUNC_MEMCMP
    AC_FUNC_MKTIME
    AC_FUNC_OBSTACK
    AC_FUNC_STAT
    AC_FUNC_LSTAT
    AC_FUNC_STRTOD
    AC_FUNC_STRNLEN

In addition, many of the header test macros are also inobvious to use in
systems where they fail (I've by and large just given up on AC_HEADER_STDC
at this point and just assume that it succeeds).

There are probably other cases; these are just the ones that I saw on a
quick scan.

> I agree this is a problem.  How did you solve this issue?

For AC_FUNC_MEMCMP, I wrote my own replacement.  It's in the public
domain; anyone is free to use it.

For AC_FUNC_GETLOADAVG, we decided to only support load average checking
on those systems that had getloadavg in libc, so I just use AC_CHECK_FUNCS
and don't use the macro.

I've thought about trying to use alloca, but reimplementing alloca on
systems that don't support it isn't something that I look forward to.

For the others listed, I've just not needed them.  I do have other macros
that we use for INN that check for missing or bad functions and provide
replacements.  Currently, we have:

    INN_FUNC_INET_NTOA
    INN_FUNC_SNPRINTF

with replacement functions, plus replacement functions for all of:

AC_REPLACE_FUNCS(fseeko ftello getpagesize hstrerror inet_aton mkstemp \
                 pread pwrite seteuid strcasecmp strerror strlcat strlcpy \
                 strspn setenv)

as well as a bunch of code to probe properties of mmap and its supporting
functions, properties of IPv6 support, ways to obtain time zone names and
UTC offsets, and several other things.

The strspn and strcasecmp replacements are pure BSD source.  The rest,
IIRC, I wrote myself, and are generally all in the public domain.  Some of
them aren't that suitable for use outside of INN, but most of them are.

I rewrote several of them from first principals, such as mkstemp, strlcat,
strlcpy, and strerror, specifically to avoid any licensing problems so
that I could have a fully public-domain replacement function.

Oh, we also have replacement code for setproctitle, but it isn't public
domain (it's under INN's license, since I reused the replacement code that
Rich Salz wrote, way back when).

-- 
Russ Allbery (address@hidden)             <http://www.eyrie.org/~eagle/>




reply via email to

[Prev in Thread] Current Thread [Next in Thread]