@Bill Cole, and others.

Thanks Bill. The key in all this was the “-ldb” … I’d missed that one. This is 
my make script now.

As you can see, I’m trying to remove all references to macports - and I think I 
have, and rely only only on Homebrew for extra stuff. It was - is - a bit of a 
mess I know. Been putting stuff on and off this machine for years now.
However - it all still works, and the build from this Makefile completed 
without errors this time.
I’m aware that it could use a bit of cleaning up as well, but for now - it 
works.

make -f Makefile.init dynamicmaps=yes CCARGS='-DHAS_MYSQL 
-I/usr/local/include/mysql -I/usr/local/include -DUSE_TLS -DUSE_SASL_AUTH 
-DUSE_CYRUS_SASL 
-I/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sasl
 -DDEF_SERVER_SASL_TYPE=\"dovecot\" -DHAS_PCRE -I/opt/local/include 
-DEF_COMMAND_DIR=\"/usr/local/sbin\" -DEF_CONGIG_DIR=\"/usr/local/etc/postfix\" 
-DEF_DAEMON_DIR=\"/usr/local/libexec/postfix\" 
-DEF_DATA_DIR=\"/var/lib/postfix\" -DEF_MAILQ_PATH=\"/usr/local/bin/mailq\" 
-DEF_HTML_DIR=\"/usr/share/doc/postfix/html\" 
-DEF_MANPAGE_DIR=\"/usr/local/man\" 
-DEF_NEWALIAS_PATH=\"/usr/local/bin/newaliases\" 
-DEF_QUEUE_DIR=\"/private/var/spool/postfix\" 
-DEF_README_DIR=\"/usr/share/doc/postfix\" 
-DEF_SENDMAIL_PATH=\"/usr/local/sbin/sendmail\"' 'AUXLIBS=-L/usr/lib -lsasl2 
-L/usr/local/opt/openssl/lib -lssl -lcrypto -L/usr/local/lib -ldb' 
'AUXLIBS_IUUC=-L/usr/local/Cellar/icu4c/62.1/lib -licuuc' 
'AUXLIBS_MYSQL=-L/usr/local/lib -lmysqlclient -lz -lm' 'A
UXLIBS_PCRE=-L/usr/local/lib -lpcre’

In summary of the switches.
I have built in
MySQL
SASL
Cyrus-Sasl SASL support
Dovecot SASL support
PCRE
OpenSSL
Crypto
TLS


Thanks for the detailed breakdown. I pointed me right to the missing library. 
It was installed, I just wasn’t pointing to it.

Robert


> On 8 Nov 2018, at 16:18, Bill Cole 
> <postfixlists-070...@billmail.scconsult.com> wrote:
> 
> On 8 Nov 2018, at 4:20, Robert Chalmers wrote:
> 
>> It’s almost through the build but failing on this.
>> 
>> Undefined symbols for architecture x86_64:
>>  "_db_create", referenced from:
>>      import-atom in libpostfix-util.dylib
>>  "_db_env_create", referenced from:
>>      import-atom in libpostfix-util.dylib
>>  "_db_version", referenced from:
>>      import-atom in libpostfix-util.dylib
>> ld: symbol(s) not found for architecture x86_64
>> clang: error: linker command failed with exit code 1 (use -v to see 
>> invocation)
>> make: *** [master] Error 1
>> make: *** [update] Error 1
>> make: *** [update] Error 2
> 
> Those symbols are from Berkeley DB. This implies that somewhere you have 
> included headers for BDB but can't find the BDB libraries at link time.
> 
>> My Make script is this:
>> 
>> make -f Makefile.init dynamicmaps=yes CCARGS='-DHAS_MYSQL 
>> -I/usr/local/include/mysql -DUSE_TLS -DUSE_SASL_AUTH -DUSE_CYRUS_SASL 
>> -I/opt/local/include/sasl 
>> -I/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sasl
>>  -DDEF_SERVER_SASL_TYPE=\"dovecot\" -DHAS_PCRE -I/opt/local/include
> 
> Hmmm.... Looks like you are building against both stuff installed under 
> /usr/local (used by Homebrew and many OSS projects by default) and under 
> /opt/local (typically MacPorts) and if you have a version of BDB installed in 
> either tree, Postfix may find its headers and so expect to be able to find 
> implementations of its symbols at link time.
> 
> Complicating matters, in any event the configure stage will find 
> /usr/include/db.h, the header for the original simpler Berkeley DB 
> implementation built into macOS.
> 
>> -DEF_COMMAND_DIR=\"/usr/local/sbin\" 
>> -DEF_CONGIG_DIR=\"/usr/local/etc/postfix\" 
>> -DEF_DAEMON_DIR=\"/usr/local/libexec/postfix\" 
>> -DEF_DATA_DIR=\"/var/lib/postfix\" -DEF_MAILQ_PATH=\"/usr/local/bin/mailq\" 
>> -DEF_HTML_DIR=\"/usr/share/doc/postfix/html\" 
>> -DEF_MANPAGE_DIR=\"/usr/local/man\" 
>> -DEF_NEWALIAS_PATH=\"/usr/local/bin/newaliases\" 
>> -DEF_QUEUE_DIR=\"/private/var/spool/postfix\" 
>> -DEF_README_DIR=\"/usr/share/doc/postfix\" 
>> -DEF_SENDMAIL_PATH=\"/usr/local/sbin/sendmail\"' 'AUXLIBS=-L/usr/lib -lsasl2 
>> -L/usr/local/opt/openssl/lib -lssl -lcrypto -L/usr/local/lib' 
>> 'AUXLIBS_IUUC=-L/usr/local/Cellar/icu4c/62.1/lib -licuuc'
> 
> So that's Homebrew...
> 
>> 'AUXLIBS_MYSQL=-L/usr/local/lib -lmysqlclient -lz -lm' 
>> 'AUXLIBS_PCRE=-L/usr/local/lib -lpcre’
> 
> Unless you've done an unusual installation of BDB, nothing here will find a 
> BDB implementation. You would need a '-L' option pointing to the installation 
> directory and '-ldb' telling the linker to load the db library.
> 
> Also note: You MAY have libraries in that jumble linked against one or more 
> existing BDB installations and that becomes a mess pretty fast.
> 
>> any ideas where to turn?
> 
> Find where you've got a Berkeley DB implementation installed and see the 
> Postfix DB_README for details. Alternatively, you could just use the MacPorts 
> port of Postfix and have it handle all the details for you, rather than 
> grabbing random components from the base, Homebrew, manual installations, and 
> MacPorts. Build consistency across Postfix and its dependencies is critical 
> and using MacPorts would assure that for you.

Robert Chalmers
https://robert-chalmers.uk
aut...@robert-chalmers.uk
@R_A_Chalmers

Reply via email to