Subject: Re: CVS commit: src/gnu/usr.sbin/postfix/tlsmgr
To: None <netbsd@lists.veego.de>
From: Havard Eidnes <he@uninett.no>
List: source-changes
Date: 09/04/2005 20:54:15
> > LIBCRYPTO is also needed, fixes build on sun2 (static link only, so=
 far).
>
> Could you please tell me where LIBCRYPTO gets defined?
> I can't find it in src/share/mk =


LIBCRYPTO gets defined in a loop in bsd.prog.mk:

.for _lib in \
        asn1 bsdmalloc bz2 c c_pic cdk com_err compat crypt \
        crypto crypto_idea crypto_mdc2 crypto_rc5 \
        curses dbm des edit event \
        form fl g2c gcc gnumalloc gssapi hdb intl ipsec \
        kadm kadm5clnt kadm5srv kafs kdb krb krb5 kstream kvm l \
        m magic menu objc ossaudio pam pcap pci pmc posix pthread pthre=
ad_dbg \
        radius resolv rmt roken rpcsvc rt skey sl ss ssh ssl termcap \
        usbhid util wrap y z
.ifndef LIB${_lib:tu}
LIB${_lib:tu}=3D  ${DESTDIR}/usr/lib/lib${_lib}.a
.MADE:          ${LIB${_lib:tu}}        # Note: ${DESTDIR} will be expa=
nded
.endif
.endfor

> IMHO it needs to be added to bsd.hostprog.mk

Hm, is postfix's tlsmgr a host program?

Though...  It seems to me that the order of the libraries on that link
line is "off" -- I would expect -lcrypto to be needed after -lssl.
For dynamic-linking systems the ordering doesn't matter, but not so
for static-linking systems, of which we still have at least one.  Yes,
I realize that referring explicitly to the *.a fila (via LIBCRYPTO)
was not a great move, and that -l<lib> might be preferable for
referring to common system libraries.

So instead of

> -LDADD+=3D ${LIBPMASTER} ${LIBPGLOBAL} ${LIBPTLS} ${LIBCRYPTO} ${LIBP=
UTIL} -lssl
> +LDADD+=3D ${LIBPMASTER} ${LIBPGLOBAL} ${LIBPTLS} -lcrypto ${LIBPUTIL=
} -lssl

let me suggest

-DPADD+=3D ${LIBPMASTER} ${LIBPGLOBAL} ${LIBPTLS} ${LIBCRYPTO} ${LIBPUT=
IL}
+DPADD+=3D ${LIBPMASTER} ${LIBPGLOBAL} ${LIBPTLS} ${LIBPUTIL} ${LIBCRYP=
TO}
-LDADD+=3D ${LIBPMASTER} ${LIBPGLOBAL} ${LIBPTLS} ${LIBCRYPTO} ${LIBPUT=
IL} -lssl
+LDADD+=3D ${LIBPMASTER} ${LIBPGLOBAL} ${LIBPTLS} ${LIBPUTIL} -lssl -lc=
rypto

With this in place, it links both for i386 and sun2.

Regards,

- H=E5vard