Eugene Grosbein <eu...@grosbein.net> writes:

> 11.08.2020 20:49, Bengt Ahlgren wrote:
>
>> I have since long compiled sendmail in base with SASL using a src.conf
>> like this:
>> 
>> # sendmail with SASL required for outgoing SMTP AUTH, see:
>> # https://www.freebsd.org/doc/en/books/handbook/SMTP-Auth.html
>> # depends on port security/cyrus-sasl2
>> SENDMAIL_CFLAGS=-I/usr/local/include/sasl -DSASL
>> SENDMAIL_LDFLAGS=-L/usr/local/lib
>> SENDMAIL_LDADD=-lsasl2
>> 
>> Since I'm still using 11.4, I had to start using openssl from ports due
>> to qt5 5.15.  Then the above didn't work anymore, so a bit reluctantly I
>> added -I/usr/local/include to the CFLAGS above, fearing that some other
>> random include file could be picked up.
>
> The Handbook was updated. Take a look to the link you have in the comment 
> above
> for new settings.

Thanks, wasn't aware that it was updated!  Makes sense to not add
-L/usr/local/lib!  The updated settings from the handbook does build
fine also on 11.4 with the openssl port.

>> It however compiled and the
>> resulting binary is linked thus:
>> 
>> # ldd /usr/obj/usr/src/usr.sbin/sendmail/sendmail
>> /usr/obj/usr/src/usr.sbin/sendmail/sendmail:
>>         libsasl2.so.3 => /usr/local/lib/libsasl2.so.3 (0x8008db000)
>>         libutil.so.9 => /lib/libutil.so.9 (0x800af9000)
>>         libssl.so.11 => /usr/local/lib/libssl.so.11 (0x800d0d000)
>>         libcrypto.so.11 => /usr/local/lib/libcrypto.so.11 (0x801000000)
>>         libwrap.so.6 => /usr/lib/libwrap.so.6 (0x8014cb000)
>>         libc.so.7 => /lib/libc.so.7 (0x8016d4000)
>>         libdl.so.1 => /usr/lib/libdl.so.1 (0x801a8b000)
>>         libthr.so.3 => /lib/libthr.so.3 (0x801c8c000)
>> 
>> Does this look right?  Are there any know issues with this?
>
> If it's working for you, that's fine. If you like to minimize linking
> with ports libraries,
> use updated instructions from the Handbook. Sendmail will build and
> link with base system
> libssl/libcrypto and use only libsasl2 from ports/packages.

Then the question is whether I need openssl libraries from ports, when I
use that for all ports with DEFAULT_VERSIONS+=ssl=openssl due to QT5
requirements?

If I want to link with openssl from ports, it looks like I anyway need
SENDMAIL_LDFLAGS=-L/usr/local/lib, otherwise the linker will pick up
libssl and libcrypto from base.  Specifying the full path for these
libraries, like for libsasl2 in the handbook, only results in
double-linking with libraries from both ports and base.  So I ended up
with:

SENDMAIL_CFLAGS=-I/usr/local/include -I/usr/local/include/sasl -DSASL
SENDMAIL_LDFLAGS=-L/usr/local/lib
SENDMAIL_LDADD=/usr/local/lib/libsasl2.so

Bengt
_______________________________________________
freebsd-stable@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/freebsd-stable
To unsubscribe, send any mail to "freebsd-stable-unsubscr...@freebsd.org"

Reply via email to