On Mon, Feb 16, 2009 at 10:26 AM, stan <[email protected]> wrote: > I am having some problems with incorrect results with configure detecting > function prototypes on Solaris 2.5. What is happening is configure is not > detecting that these exist, when they do, and is therefore causing an > mismatched declaration to be inserted. > > I have never had to look in to how configure makes these checks, but I > suppose that I need to, to contribute back the appropriate fixes. > > Can anyone point me to a resource explaining how these test work?
The story is a bit more interesting, actually. I don't know why these checks were added -- it seems that any system that *has* a socket() syscall, but doesn't put it in a header file, is both ancient and badly broken. When I reorganized the configure logic into macros (see config/amanda/*.m4), I checked the 'cvs blame' on these lines, and traced it back to Blair Zajac among others. I asked him what they were for, and he couldn't recall. >From configure.in: 262 # 263 # Declarations 264 # 265 # Checks for library functions and if the function is declared in 266 # an appropriate header file. Functions which exist, but for which 267 # no declaration is available, are declared in common-src/amanda.h. 268 # It's not clear that any existing system implements but does not 269 # declare common functions such as these. 270 # It was easy enough to leave the checks in, so I did so. One possible fix here is to conditionalize all of the decl checks which only result in a declaration in amanda.h on an option like --enable-system-decls, which defaults to disabled. This would speed up configure runs for most of us, while still allowing whoever's compiling on the PDP-11 to enable the checks. If we don't hear anything for a while -- say, a release cycle -- we can remove the option and checks entirely. The tricky part here is that some of those function checks are actually used elsewhere in the code to conditionalize some operation on support from the C library or kernel. We don't want to remove those checks! The way to tell is to grep for the symbols created by each check -- if the symbol only appears in amanda.h, then the check can be removed. Thanks for working on this! Dustin -- Storage Software Engineer http://www.zmanda.com
