On Wed, Mar 02, 2016 at 06:27:26PM +1000, Brett @Google wrote: > I am upgrading 3.0.x to 3.1 it seems the build process has changed, there > are a few issues at least on solaris, maybe due to the dual 32/64 bit > library formats when compared to Linux.
As Wietse said, nothing relevant changed in the build between 3.0 and 3.1. Perhaps your toolchain has changed (if your 3.0 builds are sufficiently far in the past). > 1. Is seems to be no longer possible to have a different location for the > berkeley db include or lib directories. makedefs seems to just try one set > of assumptions about the base OS, and that you are using gcc, and gives up > returning -DNO_DB. The Postfix makedefs script NEVER sets "-DNO_DB", this is an option you can supply to disable BerkeleyDB when it might otherwise be on. Furthermore, on SunOS Postfix also does not probe for BerkeleyDB. You decide whether to add "-DHAS_DB" with an appropriate include path or not. > makedefs does not even try to run a actual test, it > seems. but like the problem below, if it is running a 32 bit test, it wont > link with a 64 bit library There was never any such test. The only platforms where makedefs conditionally enables HAS_DB are 3 flavours of HP-UX and one flavour of Ultrix. > The old code might have defaulted to including <db.h> and > linking -ldb, as this definitely work. With SunOS, there was never default or implicit support for BerkeleyDB. You had to explicitly enable it with command-line options. > My current 3.1 build config for both things (work in progress) is : > > make -k Makefile.init makefiles \ > ... CC=cc \ > CCARGS='-m64 -xtarget=ultraT1 -xcode=pic32 -I/usr/local/server-libs/include > -I/usr/local/server-libs/include/sasl -DHAS_LDAP -DHAS_PCRE -DHAS_DB ... You're setting -DHAS_DB, so you'll get BerkeleyDB, provided the right headers are in the include path. > AUXLIBS='-m64 -L/usr/local/server-libs/lib -R/usr/local/server-libs/lib > -lssl -lcrypto -lsasl2 -ldb' \ And you've included "-ldb", which is presumably the right BerkeleyDB library that matches the headers, and is found on the library directory search list. BerkeleyDB support will be in libpostfix-util.so, so you'll want the right run-time library search path for that. So if BerkeleyDB is not on the system-default library search path, you may need to have a SHLIB_RPATH that includes additional directories. > SHLIB_RPATH='-m64 -Wl,-R,/usr/local/postfix/libexec' \ This will just find libpostfix-util.so as a dependency of libpostfix-global.so, ... but might not find a non-default location for BerkeleyDB. > AUXLIBS_LDAP='-L/usr/local/server-libs/lib -R/usr/local/server-libs/lib > -lldap -llber' \ > AUXLIBS_PCRE='-L/usr/local/server-libs/lib -R/usr/local/server-libs/lib > -lpcre' The LDAP and PCRE drivers are dynamic, but BerkeleyDB is built-in to libpostfix-util. So the configuration for these is different. > Above build config seems to work fine, except for the omission of > berkeleydb to provide hash: map type, and libicu* for UTF8 encoding of > email addresses. The BerkeleyDB "omission" you speak of is not plausible. If you include "HAS_DB" in CCARGS, your code will either have BerkeleyDB or fail to compile. It might also fail to run when shared libraries are not found at run-time, but "omission" is not plausible. -- Viktor.