On Sun, May 11, 2014 at 08:57:29PM -0500, Larry Stone wrote:
> > The above syntax is incorrect. Try
> >
> > ... CCARGS='
> > -DUSE_TLS -I/usr/local/ssl/include
> > -DUSE_SASL_AUTH
> > -DDEF_COMMAND_DIR=\"/usr/local/sbin\"
> > -DDEF_CONFIG_DIR=\"/usr/local/etc/postfix\"
> > -DDEF_DAEMON_DIR=\"/usr/local/libexec/postfix\"
> > -DHAS_PCRE -I/usr/local/include
> > ' \
> > AUXLIBS='
> > -L /usr/local/ssl/lib -lssl -lcrypto
> > -L/usr/local/lib -lpcre
> > '
>
> That worked. Thanks.
>
> But I don't understand why.
Wrong mental model of the C-compiler '-D' option syntax.
> I'm assuming the key difference was on the -DUSE_TLS directive.
This is a boolean option, "-DFOO" is equivalent to "-DFOO=1". The
option just activates the '#ifdef USE_TLS <tls-specific code> #endif'
blocks in the Postfix source code. It DOES NOT take any parameters.
To include additional directories in the header search path you
need a "-I /some/path" option.
> With the new OpenSSL version, /usr/local/ssl/include contains
> only the openssl directory which in turn contains all the openssl
> header files. So how does the path specified behind -DUSE_TLS work?
It is a separate option and need be after or even adjacent to -DUSE_TLS.
Because OpenSSL header files are included as:
#include <openssl/ssl.h>
#include <openssl/evp.h>
...
The right path to add the search path is the directory containing
the "openssl" directory with all the headers. In particular this
works when the header paths are of the form:
/usr/include/openssl/some_openssl_header.h
and the default compiler search path contains /usr/include.
--
Viktor.