[Dovecot] Autocreate plugin for 1.1 - not compile in FreeBSD (gcc problem?)
Hello all.
I try to compile Autocreate plugin for 1.1 in FreeBSD 7.0-p6. gcc version:
# gcc -v Using built-in specs. Target: i386-undermydesk-freebsd Configured with: FreeBSD/i386 system compiler Thread model: posix gcc version 4.2.1 20070719 [FreeBSD]
But it gives me a:
mx# sh -x patch.sh
- export DOVECOT=/usr/ports/mail/dovecot/work/dovecot-1.1.7
- gcc -fPIC -shared -g -Wall -I/usr/ports/mail/dovecot/work/dovecot-1.1.7 -I/usr/ports/mail/dovecot/work/dovecot-1.1.7/src/lib -I/usr/ports/mail/dovecot/work/dovecot-1.1.7/src/lib-storage -I/usr/ports/mail/dovecot/work/dovecot-1.1.7/src/lib-mail -I/usr/ports/mail/dovecot/work/dovecot-1.1.7/src/lib-imap -DHAVE_CONFIG_H autocreate-plugin.c -o autocreate_plugin.so In file included from /usr/ports/mail/dovecot/work/dovecot-1.1.7/src/lib/lib.h:24, from autocreate-plugin.c:22: /usr/ports/mail/dovecot/work/dovecot-1.1.7/src/lib/compat.h:55:29: error: sys/sysmacros.h: No such file or directory
- cp autocreate_plugin.so /usr/local/lib/dovecot/imap/autocreate_plugin.so cp: autocreate_plugin.so: No such file or directory mx#
I try do this at Debian Etch and all work well.
gcc version: # gcc -v Using built-in specs. Target: i486-linux-gnu Configured with: ../src/configure -v --enable-languages=c,c++,fortran,objc,obj-c++,treelang --prefix=/usr --enable-shared --with-system-zlib --libexecdir=/usr/lib --without-included-gettext --enable-threads=posix --enable-nls --program-suffix=-4.1 --enable-__cxa_atexit --enable-clocale=gnu --enable-libstdcxx-debug --enable-mpfr --with-tune=i686 --enable-checking=release i486-linux-gnu Thread model: posix gcc version 4.1.2 20061115 (prerelease) (Debian 4.1.1-21)
How can I compile it on FreeBSD? autocreate_plugin.so from Debian not working at FreeBSD.
-- Best regards, Proskurin Kirill
Heh - I solve it. To make it compile in FreeBSD you need to:
cd /usr/ports/mail/dovecot make extract mkdir work/dovecot-1.1.*/sys locate sysmacros.h cp /your/path/to/sysmacros.h work/dovecot-1.1.*/sys/ patch it as sayd at wiki.
And then all work well.
I update wiki now.
Hello all.
I try to compile Autocreate plugin for 1.1 in FreeBSD 7.0-p6. gcc version:
# gcc -v Using built-in specs. Target: i386-undermydesk-freebsd Configured with: FreeBSD/i386 system compiler Thread model: posix gcc version 4.2.1 20070719 [FreeBSD]
But it gives me a:
mx# sh -x patch.sh
- export DOVECOT=/usr/ports/mail/dovecot/work/dovecot-1.1.7
- gcc -fPIC -shared -g -Wall -I/usr/ports/mail/dovecot/work/dovecot-1.1.7 -I/usr/ports/mail/dovecot/work/dovecot-1.1.7/src/lib -I/usr/ports/mail/dovecot/work/dovecot-1.1.7/src/lib-storage -I/usr/ports/mail/dovecot/work/dovecot-1.1.7/src/lib-mail -I/usr/ports/mail/dovecot/work/dovecot-1.1.7/src/lib-imap -DHAVE_CONFIG_H autocreate-plugin.c -o autocreate_plugin.so In file included from /usr/ports/mail/dovecot/work/dovecot-1.1.7/src/lib/lib.h:24, from autocreate-plugin.c:22: /usr/ports/mail/dovecot/work/dovecot-1.1.7/src/lib/compat.h:55:29: error: sys/sysmacros.h: No such file or directory
- cp autocreate_plugin.so /usr/local/lib/dovecot/imap/autocreate_plugin.so cp: autocreate_plugin.so: No such file or directory mx#
I try do this at Debian Etch and all work well.
gcc version: # gcc -v Using built-in specs. Target: i486-linux-gnu Configured with: ../src/configure -v --enable-languages=c,c++,fortran,objc,obj-c++,treelang --prefix=/usr --enable-shared --with-system-zlib --libexecdir=/usr/lib --without-included-gettext --enable-threads=posix --enable-nls --program-suffix=-4.1 --enable-__cxa_atexit --enable-clocale=gnu --enable-libstdcxx-debug --enable-mpfr --with-tune=i686 --enable-checking=release i486-linux-gnu Thread model: posix gcc version 4.1.2 20061115 (prerelease) (Debian 4.1.1-21)
How can I compile it on FreeBSD? autocreate_plugin.so from Debian not working at FreeBSD.
-- С уважением, Проскурин Кирилл. Группа компаний "Форекс Клуб" 115093, Москва, ул. Щипок, 18 +7(495)727-06-26 доб. 1070 www.forexclub.ru
On Sat, 2008-12-13 at 13:08 +0300, Proskurin Kirill wrote:
Heh - I solve it. To make it compile in FreeBSD you need to:
cd /usr/ports/mail/dovecot make extract mkdir work/dovecot-1.1.*/sys locate sysmacros.h cp /your/path/to/sysmacros.h work/dovecot-1.1.*/sys/ patch it as sayd at wiki.
And then all work well.
I don't really understand why that would be necessary. The sysmacros.h isn't required. In that case Dovecot's config.h shouldn't have HAVE_SYS_SYSMACROS_H defined, but you do for some reason. Why is the port doing that?
I'd rather say this is a bug in the FreeBSD ports. If you compiled Dovecot directly from sources you wouldn't have had this problem.
Hello, Timo.
On Sat, 2008-12-13 at 13:08 +0300, Proskurin Kirill wrote:
Heh - I solve it. To make it compile in FreeBSD you need to:
cd /usr/ports/mail/dovecot make extract mkdir work/dovecot-1.1.*/sys locate sysmacros.h cp /your/path/to/sysmacros.h work/dovecot-1.1.*/sys/ patch it as sayd at wiki.
And then all work well.
I don't really understand why that would be necessary. The sysmacros.h isn't required. In that case Dovecot's config.h shouldn't have HAVE_SYS_SYSMACROS_H defined, but you do for some reason. Why is the port doing that?
I'd rather say this is a bug in the FreeBSD ports. If you compiled Dovecot directly from sources you wouldn't have had this problem.
Well may be. But:
newmail# grep -R -i sysmacros work/dovecot-1.1.7/
work/dovecot-1.1.7/configure.in: sys/uio.h sys/sysmacros.h sys/resource.h sys/select.h libgen.h
work/dovecot-1.1.7/config.h:/* Define to 1 if you have the
work/dovecot-1.1.7/ChangeLog: And the missing sys/sysmacros.h include..
work/dovecot-1.1.7/src/lib/compat.h:#ifdef HAVE_SYS_SYSMACROS_H
work/dovecot-1.1.7/src/lib/compat.h:# include
md5 of sources from your site and from ports is same. I not a programmer at all and can`t help here.
-- Best regards, Proskurin Kirill
Yarema, do you have any thoughts on this?
On Sat, 2008-12-13 at 13:54 +0300, Proskurin Kirill wrote:
I'd rather say this is a bug in the FreeBSD ports. If you compiled Dovecot directly from sources you wouldn't have had this problem.
Well may be. But: .. work/dovecot-1.1.7/config.h:#define HAVE_SYS_SYSMACROS_H 1
I don't think this line should be here. I'm guessing the FreeBSD port adds some include paths for the sys/sysmacros.h that cause this to get set. But when compiling the autocreate plugin that include path isn't set, so it fails.
The sys/sysmacros.h is set only to use major() and minor() macros, but if it's missing it's just comparing struct stat.st_dev with == operator, which should work fine in FreeBSD.
I update wiki now.
The annoying problem with that is that this will happen with ALL plugins, not just with autocreate plugin. So it's kind of in the wrong wiki page. But people probably won't find it elsewhere.. I'd rather see about getting this fixed in FreeBSD port.
Hello, Timo.
Yarema, do you have any thoughts on this?
On Sat, 2008-12-13 at 13:54 +0300, Proskurin Kirill wrote:
I'd rather say this is a bug in the FreeBSD ports. If you compiled Dovecot directly from sources you wouldn't have had this problem.
Well may be. But: .. work/dovecot-1.1.7/config.h:#define HAVE_SYS_SYSMACROS_H 1
I don't think this line should be here. I'm guessing the FreeBSD port adds some include paths for the sys/sysmacros.h that cause this to get set. But when compiling the autocreate plugin that include path isn't set, so it fails.
The sys/sysmacros.h is set only to use major() and minor() macros, but if it's missing it's just comparing struct stat.st_dev with == operator, which should work fine in FreeBSD.
Ok I will try to send this to port maintainer - may be he helps. Thank you for your work, Timo.
-- Best regards, Proskurin Kirill
Timo Sirainen wrote:
Yarema, do you have any thoughts on this?
On Sat, 2008-12-13 at 13:54 +0300, Proskurin Kirill wrote:
I'd rather say this is a bug in the FreeBSD ports. If you compiled Dovecot directly from sources you wouldn't have had this problem. Well may be. But: .. work/dovecot-1.1.7/config.h:#define HAVE_SYS_SYSMACROS_H 1
I don't think this line should be here. I'm guessing the FreeBSD port adds some include paths for the sys/sysmacros.h that cause this to get set. But when compiling the autocreate plugin that include path isn't set, so it fails.
The sys/sysmacros.h is set only to use major() and minor() macros, but if it's missing it's just comparing struct stat.st_dev with == operator, which should work fine in FreeBSD.
I update wiki now.
The annoying problem with that is that this will happen with ALL plugins, not just with autocreate plugin. So it's kind of in the wrong wiki page. But people probably won't find it elsewhere.. I'd rather see about getting this fixed in FreeBSD port.
I just did a fresh build/install based on the latest dovecot-1.1.7_1 in FreeBSD ports. Inspecting work/dovecot-1.1.7/config.h revealed this:
/* Define to 1 if you have the
So all I can say is I cannot reproduce this issue when building from ports.
-- Yarema
Здравствуйте, Yarema.
The annoying problem with that is that this will happen with ALL plugins, not just with autocreate plugin. So it's kind of in the wrong wiki page. But people probably won't find it elsewhere.. I'd rather see about getting this fixed in FreeBSD port.
I just did a fresh build/install based on the latest dovecot-1.1.7_1 in FreeBSD ports. Inspecting work/dovecot-1.1.7/config.h revealed this:
/* Define to 1 if you have the
header file. */ /* #undef HAVE_SYS_SYSMACROS_H */
So all I can say is I cannot reproduce this issue when building from ports.
Hm. I update ports and try it again:
mx# cd /usr/ports/mail/dovecot mx# make clean ===> Cleaning for dovecot-1.1.7_1 mx# make extract ===> WARNING: Vulnerability database out of date, checking anyway ===> Found saved configuration for dovecot-1.1.3 ===> Extracting for dovecot-1.1.7_1 => MD5 Checksum OK for dovecot-1.1.7.tar.gz. => SHA256 Checksum OK for dovecot-1.1.7.tar.gz. => MD5 Checksum OK for dovecot-1.1.7-managesieve-0.10.4.diff.gz. => SHA256 Checksum OK for dovecot-1.1.7-managesieve-0.10.4.diff.gz. mx# cd /tmp/ mx# sh -x /tmp/patch.sh
- export DOVECOT=/usr/ports/mail/dovecot/work/dovecot-1.1.7
- gcc -fPIC -shared -g -Wall -I/usr/ports/mail/dovecot/work/dovecot-1.1.7 -I/usr/ports/mail/dovecot/work/dovecot-1.1.7/src/lib -I/usr/ports/mail/dovecot/work/dovecot-1.1.7/src/lib-storage -I/usr/ports/mail/dovecot/work/dovecot-1.1.7/src/lib-mail -I/usr/ports/mail/dovecot/work/dovecot-1.1.7/src/lib-imap -DHAVE_CONFIG_H autocreate-plugin.c -o autocreate_plugin.so In file included from /usr/ports/mail/dovecot/work/dovecot-1.1.7/src/lib/lib.h:24, from autocreate-plugin.c:22: /usr/ports/mail/dovecot/work/dovecot-1.1.7/src/lib/compat.h:55:29: error: sys/sysmacros.h: No such file or directory mx# uname -a FreeBSD mx.domain.off 7.0-RELEASE-p5 FreeBSD 7.0-RELEASE-p5 #1: Thu Oct 2 14:18:27 MSD 2008 root@mx.domain.off:/usr/obj/usr/src/sys/CUSTOM i386 mx#
Diff from GENERIC kernel it is just PF and ALTQ enabled.
-- Best regards, Proskurin Kirill
On Sun, 2008-12-14 at 00:41 +0300, Proskurin Kirill wrote:
Hm. I update ports and try it again:
mx# cd /usr/ports/mail/dovecot mx# make clean ===> Cleaning for dovecot-1.1.7_1 mx# make extract ===> WARNING: Vulnerability database out of date, checking anyway ===> Found saved configuration for dovecot-1.1.3 ===> Extracting for dovecot-1.1.7_1 => MD5 Checksum OK for dovecot-1.1.7.tar.gz. => SHA256 Checksum OK for dovecot-1.1.7.tar.gz. => MD5 Checksum OK for dovecot-1.1.7-managesieve-0.10.4.diff.gz. => SHA256 Checksum OK for dovecot-1.1.7-managesieve-0.10.4.diff.gz.
Oh. You haven't run configure at this point, so it's using config.h that's distributed in the dovecot tarball and reflects my machine's configuration. That won't work. I'm surprised it worked even this well. I wonder why the config.h is even included in the tarball. Maybe I should remove it.
On Sun, 2008-12-14 at 04:41 +0200, Timo Sirainen wrote:
Oh. You haven't run configure at this point, so it's using config.h that's distributed in the dovecot tarball and reflects my machine's configuration. That won't work. I'm surprised it worked even this well. I wonder why the config.h is even included in the tarball. Maybe I should remove it.
Yes, looks like it was a bug. The next Dovecot version won't contain config.h in the tarball anymore.
Hello, Timo.
On Sun, 2008-12-14 at 00:41 +0300, Proskurin Kirill wrote:
Hm. I update ports and try it again:
mx# cd /usr/ports/mail/dovecot mx# make clean ===> Cleaning for dovecot-1.1.7_1 mx# make extract ===> WARNING: Vulnerability database out of date, checking anyway ===> Found saved configuration for dovecot-1.1.3 ===> Extracting for dovecot-1.1.7_1 => MD5 Checksum OK for dovecot-1.1.7.tar.gz. => SHA256 Checksum OK for dovecot-1.1.7.tar.gz. => MD5 Checksum OK for dovecot-1.1.7-managesieve-0.10.4.diff.gz. => SHA256 Checksum OK for dovecot-1.1.7-managesieve-0.10.4.diff.gz.
Oh. You haven't run configure at this point, so it's using config.h that's distributed in the dovecot tarball and reflects my machine's configuration. That won't work. I'm surprised it worked even this well. I wonder why the config.h is even included in the tarball. Maybe I should remove it.
Yes you right. After "make configure" patch compile without any problem. Now it is really solved. ;-)
-- Best regards, Prsokurin Kirill
participants (3)
-
Proskurin Kirill
-
Timo Sirainen
-
Yarema