On Mon, Nov 24, 2014 at 6:01 PM, Anders Roxell <anders.rox...@linaro.org> wrote:
> Always check OpenSSL dependency
>
> Signed-off-by: Anders Roxell <anders.rox...@linaro.org>
> ---
>  configure.ac | 34 +++++++++++++++++++++++++---------
>  1 file changed, 25 insertions(+), 9 deletions(-)
>
> diff --git a/configure.ac b/configure.ac
> index 3752f3d..acd0060 100644
> --- a/configure.ac
> +++ b/configure.ac
> @@ -126,21 +126,37 @@ if test -z "$DOXYGEN";
>  fi
>
>  ##########################################################################
> -# Check for openssl availability
> +# Set optional OpenSSL path
>  ##########################################################################
> -
>  AC_ARG_WITH([openssl-path],
>  AC_HELP_STRING([--with-openssl-path=DIR Path to openssl libs and headers],
>                 [(or in the default path if not specified).]),
> -[OPENSSL_PATH=$withval
> -AM_CFLAGS="$AM_CFLAGS -I$OPENSSL_PATH/include"
> -AM_LDFLAGS="$AM_LDFLAGS -L$OPENSSL_PATH/lib -lcrypto"
> -],[
> +    [OPENSSL_PATH=$withval
> +    AM_CFLAGS="$AM_CFLAGS -I$OPENSSL_PATH/include"
> +    AM_LDFLAGS="$AM_LDFLAGS -L$OPENSSL_PATH/lib"
> +    ],[AC_MSG_RESULT([no])])
> +
> +##########################################################################
> +# Save and set temporary compilation flags
> +##########################################################################
> +OLD_LDFLAGS=$LDFLAGS
> +OLD_CFLAGS=$CFLAGS
> +LDFLAGS="$AM_LDFLAGS $LDFLAGS"
> +CFLAGS="$AM_CFLAGS $CFLAGS"

Can you describe your setup in which not setting these temporary
CFLAGS and LDFLAGS does not work? Or simply what's the rationale of
doing this?

> +
> +##########################################################################
> +# Check for OpenSSL availability
> +##########################################################################
>  AC_CHECK_LIB([crypto], [EVP_EncryptInit], [],
> -             [AC_MSG_FAILURE([can't find openssl crypto lib])])
> +             [AC_MSG_FAILURE([OpenSSL libraries required])])
>  AC_CHECK_HEADERS([openssl/des.h openssl/rand.h openssl/hmac.h 
> openssl/evp.h], [],
> -             [AC_MSG_FAILURE([can't find openssl crypto headers])])
> -    ])
> +             [AC_MSG_ERROR([OpenSSL headers required])])
> +
> +##########################################################################
> +# Restore old saved variables
> +##########################################################################
> +LDFLAGS=$OLD_LDFLAGS
> +CFLAGS=$OLD_CFLAGS
>
>  ##########################################################################
>  # Default warning setup
> --
> 2.1.0
>
>
> _______________________________________________
> lng-odp mailing list
> lng-odp@lists.linaro.org
> http://lists.linaro.org/mailman/listinfo/lng-odp

_______________________________________________
lng-odp mailing list
lng-odp@lists.linaro.org
http://lists.linaro.org/mailman/listinfo/lng-odp

Reply via email to