On May 11, 2014, at 9:04 PM, Viktor Dukhovni <postfix-us...@dukhovni.org> wrote:
> 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, thanks, that greatly improves my understanding of how those options works. And also serves as a reminder not to put to much trust in other people’s “how to” documents since if I now understand it correctly, the '-I/usr/include/openssl’ in the original document I followed at diymacserver.com was meaningless and instead, the headers were found from the default /usr/include. -- Larry Stone lston...@stonejongleux.com http://www.stonejongleux.com/
smime.p7s
Description: S/MIME cryptographic signature