You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@apr.apache.org by Rainer Jung <ra...@kippdata.de> on 2023/03/27 12:00:45 UTC

Re: svn commit: r1908503 - in /apr/apr/trunk: build/crypto.m4 crypto/apr_crypto_openssl.c

Hi Yann,

Am 18.03.23 um 17:33 schrieb ylavic@apache.org:
> Author: ylavic
> Date: Sat Mar 18 16:33:08 2023
> New Revision: 1908503
> 
> URL: http://svn.apache.org/viewvc?rev=1908503&view=rev
> Log:
> crypto_openssl: Fix configure/detection of OPENSSL_init_crypto()
> 
> Modified:
>      apr/apr/trunk/build/crypto.m4
>      apr/apr/trunk/crypto/apr_crypto_openssl.c
> 
> Modified: apr/apr/trunk/build/crypto.m4
> URL: http://svn.apache.org/viewvc/apr/apr/trunk/build/crypto.m4?rev=1908503&r1=1908502&r2=1908503&view=diff
> ==============================================================================
> --- apr/apr/trunk/build/crypto.m4 (original)
> +++ apr/apr/trunk/build/crypto.m4 Sat Mar 18 16:33:08 2023
...

> @@ -113,15 +112,13 @@ AC_DEFUN([APU_CHECK_CRYPTO_OPENSSL], [
>         AC_MSG_NOTICE(checking for openssl in $withval)
>         AC_CHECK_HEADERS(openssl/x509.h, [openssl_have_headers=1])
>         AC_CHECK_LIB(crypto, EVP_CIPHER_CTX_new, openssl_have_libs=1)
> -      if test "$openssl_have_headers" != "0" && test "$openssl_have_libs" != "0"; then
> +      if test "$openssl_have_headers" = "1" && test "$openssl_have_libs" = "1"; then
>           apu_have_openssl=1
> -        APR_ADDTO(LDFLAGS, [-L$withval/lib])
> -        APR_ADDTO(INCLUDES, [-I$withval/include])
 >         fi
 > -
 > -      AC_CHECK_DECLS([EVP_PKEY_CTX_new, OPENSSL_init_crypto], [], [],
 > -                     [#include <openssl/evp.h>])
 > -
 > +    fi
 > +    if test "$apu_have_openssl" = "1"; then
 > +        AC_CHECK_LIB(crypto, OPENSSL_init_crypto)
 > +        AC_CHECK_FUNCS([OPENSSL_init_crypto])
 >       fi

Hmmm, for me this dropped "APR_ADDTO(INCLUDES,..." breaks the apr trunk 
build. The path to the OpenSSL header files gets no longer added to any 
INCLUDES variable for the build.

For 1.7.x and 1.6.x you committed it differently:

-        APR_ADDTO(APRUTIL_LDFLAGS, [-L$withval/lib])
-        APR_ADDTO(APRUTIL_INCLUDES, [-I$withval/include])
+        APR_ADDTO(APRUTIL_INCLUDES, [$openssl_CPPFLAGS])
+        APR_ADDTO(APRUTIL_LDFLAGS, [$openssl_LDFLAGS])

So maybe adding back APR_ADDTO for INCLUDES (and LDFLAGS?) but with the 
new values would be the right thing? Before the change, the addition to 
INCLUDES get copied over to EXTRA_INCLUDES and ends up in 
build/apr_rules.mk.

Best regards,

Rainer

Re: svn commit: r1908503 - in /apr/apr/trunk: build/crypto.m4 crypto/apr_crypto_openssl.c

Posted by Rainer Jung <ra...@kippdata.de>.
Thanks Yann, looks good here.

Am 27.03.23 um 15:43 schrieb Yann Ylavic:
> Hi Rainer;
> 
> On Mon, Mar 27, 2023 at 2:02 PM Rainer Jung <ra...@kippdata.de> wrote:
>>
>> Am 18.03.23 um 17:33 schrieb ylavic@apache.org:
>>>
>>> @@ -113,15 +112,13 @@ AC_DEFUN([APU_CHECK_CRYPTO_OPENSSL], [
>>>          AC_MSG_NOTICE(checking for openssl in $withval)
>>>          AC_CHECK_HEADERS(openssl/x509.h, [openssl_have_headers=1])
>>>          AC_CHECK_LIB(crypto, EVP_CIPHER_CTX_new, openssl_have_libs=1)
>>> -      if test "$openssl_have_headers" != "0" && test "$openssl_have_libs" != "0"; then
>>> +      if test "$openssl_have_headers" = "1" && test "$openssl_have_libs" = "1"; then
>>>            apu_have_openssl=1
>>> -        APR_ADDTO(LDFLAGS, [-L$withval/lib])
>>> -        APR_ADDTO(INCLUDES, [-I$withval/include])
>>   >         fi
>>   > -
>>   > -      AC_CHECK_DECLS([EVP_PKEY_CTX_new, OPENSSL_init_crypto], [], [],
>>   > -                     [#include <openssl/evp.h>])
>>   > -
>>   > +    fi
>>   > +    if test "$apu_have_openssl" = "1"; then
>>   > +        AC_CHECK_LIB(crypto, OPENSSL_init_crypto)
>>   > +        AC_CHECK_FUNCS([OPENSSL_init_crypto])
>>   >       fi
>>
>> Hmmm, for me this dropped "APR_ADDTO(INCLUDES,..." breaks the apr trunk
>> build. The path to the OpenSSL header files gets no longer added to any
>> INCLUDES variable for the build.
> 
> Ah yes, I thought both LDFLAGS and INCLUDES were already set above but
> it is LDFLAGS and CPPFLAGS actually.
> Restored in r1908749.
> 
> Thanks!
> Yann.

Re: svn commit: r1908503 - in /apr/apr/trunk: build/crypto.m4 crypto/apr_crypto_openssl.c

Posted by Yann Ylavic <yl...@gmail.com>.
Hi Rainer;

On Mon, Mar 27, 2023 at 2:02 PM Rainer Jung <ra...@kippdata.de> wrote:
>
> Am 18.03.23 um 17:33 schrieb ylavic@apache.org:
> >
> > @@ -113,15 +112,13 @@ AC_DEFUN([APU_CHECK_CRYPTO_OPENSSL], [
> >         AC_MSG_NOTICE(checking for openssl in $withval)
> >         AC_CHECK_HEADERS(openssl/x509.h, [openssl_have_headers=1])
> >         AC_CHECK_LIB(crypto, EVP_CIPHER_CTX_new, openssl_have_libs=1)
> > -      if test "$openssl_have_headers" != "0" && test "$openssl_have_libs" != "0"; then
> > +      if test "$openssl_have_headers" = "1" && test "$openssl_have_libs" = "1"; then
> >           apu_have_openssl=1
> > -        APR_ADDTO(LDFLAGS, [-L$withval/lib])
> > -        APR_ADDTO(INCLUDES, [-I$withval/include])
>  >         fi
>  > -
>  > -      AC_CHECK_DECLS([EVP_PKEY_CTX_new, OPENSSL_init_crypto], [], [],
>  > -                     [#include <openssl/evp.h>])
>  > -
>  > +    fi
>  > +    if test "$apu_have_openssl" = "1"; then
>  > +        AC_CHECK_LIB(crypto, OPENSSL_init_crypto)
>  > +        AC_CHECK_FUNCS([OPENSSL_init_crypto])
>  >       fi
>
> Hmmm, for me this dropped "APR_ADDTO(INCLUDES,..." breaks the apr trunk
> build. The path to the OpenSSL header files gets no longer added to any
> INCLUDES variable for the build.

Ah yes, I thought both LDFLAGS and INCLUDES were already set above but
it is LDFLAGS and CPPFLAGS actually.
Restored in r1908749.

Thanks!
Yann.