On 2023/11/01 17:53, Viktor Dukhovni via Postfix-users wrote:
On Wed, Nov 01, 2023 at 12:07:31PM +0200, Jaco Lesch via Postfix-users wrote:
Building an OpenSSL Application
The development files are available in the /usr/openssl/3/sub-directo-
ries. To build an OpenSSL application, use the following cc command
line options:
export PKG_CONFIG_PATH=/usr/openssl/3/lib/64/pkgconfig
cc `pkg-config --cflags --libs libssl libcrypto` [ flag... ] file
Can you share the output you see for:
$ export PKG_CONFIG_PATH=/usr/openssl/3/lib/64/pkgconfig
$ pkg-config --cflags --libs libssl libcrypto
The output from pkg-config:
~$ export PKG_CONFIG_PATH=/usr/openssl/3/lib/64/pkgconfig
~$ pkg-config --cflags --libs libssl libcrypto
-I/usr/openssl/3/include -L/usr/openssl/3/lib/amd64 -lssl -lcrypto
For comparison, my build of OpenSSL 3.2 beta from stock upstream sources
(with a custom --prefix) yields:
$ export PKG_CONFIG_PATH=/usr/local/siteexec/lib/pkgconfig
$ pkg-config --cflags libssl libcrypto
-I/usr/local/siteexec/include
$ pkg-config --libs libssl libcrypto
-L/usr/local/siteexec/lib -lssl -lcrypto
To compile the Postix source I used the following options for make:
=================================================================================
export PKG_CONFIG_PATH=/usr/openssl/3/lib/64/pkgconfig
make makefiles dynamicmaps=yes shared=yes \
CC="/usr/bin/gcc `pkg-config --cflags --libs libssl libcrypto`" \
CCARGS="-m64 -DUSE_DB -DUSE_TLS -I/usr/openssl/3/include" \
AUXLIBS="-ldb -R/usr/openssl/3/lib -L/usr/openssl/3/lib -lssl -lcrypto"
\
openssl_path="/usr/openssl/3/bin/openssl"
I would have tried instead:
PKG_CONFIG_PATH=/usr/openssl/3/lib/64/pkgconfig \
make makefiles dynamicmaps=yes shared=yes \
openssl_path="/usr/openssl/3/bin/openssl" \
CC="/usr/bin/gcc -m64" \
CCARGS="-DUSE_DB -DUSE_TLS $(pkg-config --cflags libssl libcrypto)" \
AUXLIBS="-ldb $(pkg-config --libs libssl libcrypto)" \
but, you may still also need an explicit "-R/usr/openssl/3/lib" option,
if that's not part of what "pkg-config" returns for "--libs".
And Viktor your options for make compile 100%, no need for the explicit
"-R/usr/openssl/3/lib" option. Have compiled both static and dynamic to
verify. Regards
--
---
Jaco Lesch
SAIX HLS
Emai:ja...@saix.net
_______________________________________________
Postfix-users mailing list -- postfix-users@postfix.org
To unsubscribe send an email to postfix-users-le...@postfix.org