On Sat, Mar 6, 2010 at 01:14 UTC, Harlan Stenn wrote:
> You could look at the configure.ac in ntp-dev (or any recent
> ntp-stable), say:
>
>  http://ntp.bkbits.net:8080/ntp-dev/configure.ac?REV=4b6a0c4clgted0re5ogPZQx0QgLLPw
>
> and find the hunk of code starting with:
>
>  AC_MSG_CHECKING([for openssl include directory])
>
> and decide for yourself if there is a better way to go...

I wouldn't recommend using that snippet as a model for two reasons:

1)  It tests for openssl/opensslconf.h but no NTP code includes that file.
2)  it tests for the existence of the header rather than its usability.

If I were to improve that snippet, I would use AC_COMPILE_IFELSE in
the loop to attempt to compile a trivial program that calls an openssl
function #including the same header file(s) as the real openssl client
code in NTP.  Looking at libntp/ssl_init.c, that would be something
like:

CPPFLAGS=$SAVED_CPPFLAGS -I$loop_dir
AC_COMPILE_IFELSE(
    AC_LANG_PROGRAM(
        [[
            #include "openssl/err.h"
            #include "openssl/rand.h"
        ]],
        [[
            ERR_load_crypto_strings();
        ]]
    ),
    [ break ],
    []
)

Cheers,
Dave Hart


Reply via email to