Re: compile error with cyrus-imapd-2.3.16-autocreate Patch
by: Aristotelis <arisg.NOSP@MMER.noc.edunet.gr>, @ Tue, 11 May 2010 13:32:40 +0300

Mike Mildner wrote:
> ----- original Nachricht --------
>
> Betreff: Re: compile error with cyrus-imapd-2.3.16-autocreate Patch
> Gesendet: Do, 06. Mai 2010
> Von: Aristotelis
>
>> Mike Mildner wrote:
>>> Hi,
>>>
>>> i have a strange compile error, when i try to compile the
>> cyrus-imap-server with your patch.
>>> my configure options for 32bit:
>>> --sysconfdir=/etc/cyrus --with-sasl=/usr/lib --with-perl
>> --with-cyrus-user=cyrus --with-cyrus-group=mail --with-dbdir=/usr
>> --with-bdb-libdir=/usr/lib --with-bdb-incdir=/usr/include
>> --with-openssl=/usr --without-ucdsnmp --with-cyrus-prefix=/pkg/usr/cyrus"
>>> my compiler flags:
>>> export CC="gcc -m32"
>>> export CXX="g++ -m32"
>>> configure runs normaly and then short after make:
>>>
>>> ...
>>> config.status: WARNING: 'Makefile.in' seems to ignore the --datarootdir
>> setting
>>> config.status: creating config.h
>>>
>>> ### Making all in /usr/src/cyrus-imapd-2.3.16/man
>>> make[1]: Entering directory `/usr/src/cyrus-imapd-2.3.16/man'
>>> creating imapd.conf.5
>>> ./../tools/config2man ./../lib/imapoptions > ./imapd.conf.5
>>> make[1]: Leaving directory `/usr/src/cyrus-imapd-2.3.16/man'
>>> ### Making all in /usr/src/cyrus-imapd-2.3.16/lib
>>> make[1]: Entering directory `/usr/src/cyrus-imapd-2.3.16/lib'
>>> ./../tools/config2header CC="gcc -m32" ./imapopts.c ./imapopts.h <
>> ./imapoptions
>>> wrong number of arguments at (eval 1) line 41, line 258.
>>> make[1]: *** [imapopts.c] error 9
>>> make[1]: Leaving directory `/usr/src/cyrus-imapd-2.3.16/lib'
>>> make: *** [all] error 1
>>>
>>> it has to do with the CC/CXX flags, why? when i unsetting this flags the
>> build runs fine?
>>> Hope there is a solution.
>>> thanks and greetings from (undergoing) europe/germany ;-)
>>>
>>
>> Hello, thanks for using our patch.
>>
>> Have you tried compiling the vanilla cyrus tree without out patch and
>> compiles ok with these flags?? Just asking before i try to check if
>> there is something strange in our patch.
>>
>> Best regards,
>> Aristotelis
>>
> Yes, of course. I'm running at the moment on the actual verison auf cyrus-imap-2.3.16. And now, i would add your autopatch.
> the vanilla version is o.k. my test case:
>
> tar xf cyrus-imap...
> cd cyrus-imap..
> ./configure && make <--all fine, and then:
> cd ..
> rm -rf cyrus-imap...
> tar xf cyrus-imap...
> cd cyrus-imap..
> patch -p1 <../yourPatch
> export CC="gcc -m32"
> ./configure && make <-- the error from above
> make distclean
> unset CC
> ./configure && make <-- all fine
> make distclean
> export CC="gcc -m32"
> ./configure && make <-- the error from above
> and so on.
>
> thanks
> --- original Nachricht Ende ----
>


Hello again,

sorry for taking some time to reply.

I don't think this is a problem with out patch per se, but it is the
way you are trying to pass flags to the compiler.

The reason that it doesn't happen in the vanilla installation is that
the imapopts.c and imapopts.h are in sync with the imapoptions file, so
the /../tools/config2header doesn't even execute. Our patch changes
imapoptions file, so the tool runs, and the extra flags confuse it
somehow. (you can try yourself by taking the vanilla cyrus imap tree and
remove the imapopts.c and imapopts.h files before the make, or the
configure step)

Instead of having CC="gcc -m32" why not having just CC=gcc and
CFLAGS="-m32" and CXXFLAGS="-m32" and CXX=g++ ??

I think this will solve your problems.

Best regards
Aristotelis