Cyrus 2.3.9: Errors compiling outside source directory

Vincent Fox vbfox at ucdavis.edu
Sat Sep 22 19:36:03 EDT 2007


So our protocol is we have a central repository in AFS for
source code.  Then we write a script called BUILD.ksh that
does all the right stuff to compile into a /tmp/(package)-obj
directory on each build platform. This is not working for me
yet on Cyrus 2.3.9 as the configure utility as-is doesn't
get things quite right.

For example, building the chartable.c file, it doesn't
include the -I for the original source "lib" directory that
has the charset.h file it needs.  Without this it fails.

I hacked around this by putting a CPPFLAGS variable
in my BUILD.ksh script, since I don't grok yet the configure
utility enough to suggest a patch for the source.  I will include
a copy of my script below in case it helps anyone else.  It got
me farther but still fails on cyrusdb_quotalegacy.c, I think due
to it being unable to read in the right glob.h file.

OS: Solaris 10u3
Compiler GCC 4.2.1

==== filename: BUILD.ksh
#!/bin/ksh
. ./vars
PATH=/ucd/bin:/ucd/sbin:/usr/bin:/usr/sbin:/usr/ccs/bin:/usr/openwin/bin
LD_LIBRARY_PATH=/ucd/lib:/usr/lib:/usr/lib/sparcv9
CONFIG_SHELL=/bin/ksh
CC=/ucd/bin/gcc
MAKE=/ucd/bin/make
CFLAGS="-g -O"
CPPFLAGS="-I/ucd/src/$PKG/$PROJ/$PROJ/et -I/ucd/src/$PKG/$PROJ/$PROJ/lib 
-I/ucd/src/$PKG/$PROJ/$PRO
J/imap -I/ucd/src/$PKG/$PROJ/$PROJ/installsieve 
-I/ucd/src/$PKG/$PROJ/$PROJ/seive"
export PATH LD_LIBRARY_PATH CONFIG_SHELL CC
export MAKE CFLAGS CPPFLAGS

if [ -e $OBJD ] ; then
        echo cleaning $OBJD
        cd $OBJD
        if [ $? -ne 0 ] ; then
                echo bad cd $OBJD
                exit
        fi
        make distclean
else
        mkdir $OBJD
        if [ $? -ne 0 ] ; then
                echo bad mkdir $OBJD
                exit
        fi
fi

cd $OBJD

/ucd/src/$PKG/$PROJ/$PROJ/configure \
                --prefix=/ucd \
                --enable-gssapi=/usr \
                --with-cyrus-prefix=/ucd \
                --with-cyrus-user=cyrusd \
                --with-cyrus-group=cyrusd \
                --with-dbdir=/ucd \
                --with-openssl=/ucd \
                --with-sasl=/ucd \
                --with-mboxlist-db=skiplist \
                --with-annotation-db=skiplist \
                --with-seen-db=skiplist \
                --enable-fulldirhash \
                --with-auth=unix \
                --without-snmp \
                --with-perl=/ucd/bin/perl \
                --sysconfdir=/ucd/local/etc \
                --enable-idled \
                --enable-replication \
                CC=gcc \
                CFLAGS="-g -O"

$MAKE depend
$MAKE CFLAGS="$CFLAGS" all

==== filename: vars
PKG=cyrus-imapd
REV=2.3.9
PROJ=$PKG-$REV
OBJD=/tmp/$PROJ-obj
OS=sparc-sun-solaris2.10

===== tail of the compile failure
gcc -c -I.. -I/ucd/include 
-I/ucd/src/cyrus-imapd/cyrus-imapd-2.3.9/cyrus-imapd-2.3.9/et 
-I/ucd/src/cyrus-imapd/cyrus-imapd-2.3.9/cyrus-imapd-2.3.9/lib 
-I/ucd/src/cyrus-imapd/cyrus-imapd-2.3.9/cyrus-imapd-2.3.9/imap 
-I/ucd/src/cyrus-imapd/cyrus-imapd-2.3.9/cyrus-imapd-2.3.9/installsieve 
-I/ucd/src/cyrus-imapd/cyrus-imapd-2.3.9/cyrus-imapd-2.3.9/seive 
-I/ucd/include -I/usr/include 
-I/ucd/src/cyrus-imapd/cyrus-imapd-2.3.9/cyrus-imapd-2.3.9/et 
-I/ucd/include -DHAVE_CONFIG_H  -g -O \
        
/ucd/src/cyrus-imapd/cyrus-imapd-2.3.9/cyrus-imapd-2.3.9/lib/cyrusdb_quotalegacy.c
/ucd/src/cyrus-imapd/cyrus-imapd-2.3.9/cyrus-imapd-2.3.9/lib/cyrusdb_quotalegacy.c: 
In function 'foreach':
/ucd/src/cyrus-imapd/cyrus-imapd-2.3.9/cyrus-imapd-2.3.9/lib/cyrusdb_quotalegacy.c:481: 
error: 'glob_t' undeclared (first use in this function)
/ucd/src/cyrus-imapd/cyrus-imapd-2.3.9/cyrus-imapd-2.3.9/lib/cyrusdb_quotalegacy.c:481: 
error: (Each undeclared identifier is reported only once
/ucd/src/cyrus-imapd/cyrus-imapd-2.3.9/cyrus-imapd-2.3.9/lib/cyrusdb_quotalegacy.c:481: 
error: for each function it appears in.)
/ucd/src/cyrus-imapd/cyrus-imapd-2.3.9/cyrus-imapd-2.3.9/lib/cyrusdb_quotalegacy.c:481: 
error: expected ';' before 'globbuf'
/ucd/src/cyrus-imapd/cyrus-imapd-2.3.9/cyrus-imapd-2.3.9/lib/cyrusdb_quotalegacy.c:502: 
error: expected ')' before ',' token
/ucd/src/cyrus-imapd/cyrus-imapd-2.3.9/cyrus-imapd-2.3.9/lib/cyrusdb_quotalegacy.c:509: 
error: expected ')' before ',' token
/ucd/src/cyrus-imapd/cyrus-imapd-2.3.9/cyrus-imapd-2.3.9/lib/cyrusdb_quotalegacy.c:514: 
error: expected ')' before ',' token
/ucd/src/cyrus-imapd/cyrus-imapd-2.3.9/cyrus-imapd-2.3.9/lib/cyrusdb_quotalegacy.c:520: 
error: expected ')' before ',' token
/ucd/src/cyrus-imapd/cyrus-imapd-2.3.9/cyrus-imapd-2.3.9/lib/cyrusdb_quotalegacy.c:528: 
error: 'globbuf' undeclared (first use in this function)
make[1]: *** 
[/ucd/src/cyrus-imapd/cyrus-imapd-2.3.9/cyrus-imapd-2.3.9/lib/cyrusdb_quotalegacy.o] 
Error 1
make[1]: Leaving directory `/tmp/cyrus-imapd-2.3.9-obj/lib'
make: *** [all] Error 1
bash-3.00#





More information about the Info-cyrus mailing list