In preparation of Cyrus IMAP 2.5: autoconf and automake

Greg Banks gnb at fastmail.fm
Mon Apr 30 03:57:51 EDT 2012


G'day,

On Sat, Apr 28, 2012, at 11:39 AM, Carson Gaspar wrote:

Thanks for the bug report!

> The below is on Solaris 11 using the studio compiler, using the snapshot 
> from the URL below.
> 
> On 4/28/12 9:15 AM, Jeroen van Meeuwen (Kolab Systems) wrote:
> > http://git.cyrusimap.org/cyrus-imapd/snapshot/cyrus-imapd-2.5-snapshot-autoconf-and-automake.tar.gz
> >
> > The canonical build process we think applies, generally speaking, is:
> >
> > $ autoreconf -v

This should have been

$ autoreconf -vi

> I also see:
> 
> OPENSSL_LIB = -L/Tools/SunOS_5.11_i86pc_amd64/openssl-1.0.0f-aesni/lib 
> -L/Tools/SunOS_5.11_i86pc_amd64/openssl-1.0.0f-aesni/lib 
> -R/Tools/SunOS_5.11_i86pc_amd64/openssl-1.0.0f-aesni/lib
> 
> Something is adding the openssl -L flag twice. LDFLAGS only has it once.

It seems we have yet more historically broken logic in the
implementation of various --with-foo arguments to configure.  I'm
guessing your configure arguments included

--with-openssl=/Tools/SunOS_5.11_i86pc_amd64/openssl-1.0.0f-aesni

?  On our test systems, the OpenSSL headers are in /usr/include/openssl/
and libssl is in /usr/lib, so we're taking a different path through the
configure code.  I've fixed this in commit 'automake: rejig OpenSSL
linker flags and libraries'

> lib/auth_krb5.c fails to build, because autofoo does absolutely nothing 
> to find krb5.h:
> 
> "lib/auth_krb5.c", line 60: cannot find include file: <krb5.h>
> 
> The only configure options I see are for krb4.
> 
> If I manually fix the krb5 problem, I get to:

We'll take a look at this later.

> 
> Adding '-Xc' to the sun studio compiler to keep it from polluting the 
> namespace would fix that, 

If the description of -Xc here

http://docs.oracle.com/cd/E24457_01/html/E22003/cc.1.html

is correct then we definitely want to use it.  The compiler default
behaviour is suitable for transitioning from K&R C to ANSI C, a process
that we've recently completed in Cyrus (only two decades late).  But for
the time being we have bigger problems.

> but would also undefine __FUNCTION__ causing 
> the build to fail on the snmp bits.

I'm confused by this statement.  We don't use __FUNCTION__ anywhere
exception in a unit test, and that's just a leftover debugging thing
that could be removed.  Can you post the error messages from your build
failure?

> So I renamed all instances of "sun" 
> to "mysun" in imap/append.c and imap/idlemsg.c.

Sure, if you like.


> 
> Undefined                       first referenced
>   symbol                             in file
> krb5_free_principal                 lib/libcyrus.a(auth_krb5.o)
> krb5_realm_compare                  lib/libcyrus.a(auth_krb5.o)
> krb5_build_principal                lib/libcyrus.a(auth_krb5.o)
> uuid_unparse_lower                  imap/libimap.a(mailbox.o)
> krb5_get_default_realm              lib/libcyrus.a(auth_krb5.o)
> krb5_parse_name                     lib/libcyrus.a(auth_krb5.o)
> krb5_init_context                   lib/libcyrus.a(auth_krb5.o)
> krb5_free_context                   lib/libcyrus.a(auth_krb5.o)
> krb5_unparse_name                   lib/libcyrus.a(auth_krb5.o)
> 
> So not only is autofoo not bothering to find the header file, it isn't 
> adding the krb5 libs, either! How on earth does this link for anyone?! 
> Manually adding LIBS='-lkrb5' to configure fixes all but the uuid
> problem.

I'm not sure what went wrong here...

> 
> Solaris 11 has libuuid, but libuuid only has libuuid_unparse, not 
> libuuid_unparse_lower. configure only checks for uuid_generate (which is 
> present). I forced it to fail the uuid check by passing 
> ac_cv_lib_uuid_uuid_generate=no to configure.

Ok, the lack of uuid_unparse_lower() should be easy to work around using
lcase().

> 
> With the above changes, it correctly compiles and links, and spot 
> checking it appears RPATH is correctly set everywhere.

Ok.

-- 
Greg.


More information about the Cyrus-devel mailing list