You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@trafficserver.apache.org by yu...@apache.org on 2014/01/25 19:45:09 UTC

git commit: TS-2504: Set LDFLAGS/CPPFLAGS properly in crypto.m4

Updated Branches:
  refs/heads/master c4b5e554d -> 0f4c7b8ff


TS-2504: Set LDFLAGS/CPPFLAGS properly in crypto.m4

At the end of AX_CHECK_OPENSSL(), LDFLAGS/CPPFLAGS/LIBS variables
will be reset, so there is no sense in setting these variables within
AX_CHECK_OPENSSL(). We should set them outside of it.

Signed-off-by: Yunkai Zhang <qi...@taobao.com>


Project: http://git-wip-us.apache.org/repos/asf/trafficserver/repo
Commit: http://git-wip-us.apache.org/repos/asf/trafficserver/commit/0f4c7b8f
Tree: http://git-wip-us.apache.org/repos/asf/trafficserver/tree/0f4c7b8f
Diff: http://git-wip-us.apache.org/repos/asf/trafficserver/diff/0f4c7b8f

Branch: refs/heads/master
Commit: 0f4c7b8ffb26326dbd2cde77c986726ffe8f0552
Parents: c4b5e55
Author: Yunkai Zhang <qi...@taobao.com>
Authored: Sun Jan 26 02:25:57 2014 +0800
Committer: Yunkai Zhang <qi...@taobao.com>
Committed: Sun Jan 26 02:43:26 2014 +0800

----------------------------------------------------------------------
 build/crypto.m4 | 12 ++++++++----
 1 file changed, 8 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/trafficserver/blob/0f4c7b8f/build/crypto.m4
----------------------------------------------------------------------
diff --git a/build/crypto.m4 b/build/crypto.m4
index 94919dc..08730c9 100644
--- a/build/crypto.m4
+++ b/build/crypto.m4
@@ -22,16 +22,20 @@ dnl
 dnl TS_CHECK_CRYPTO: look for crypto libraries and headers
 dnl
 AC_DEFUN([TS_CHECK_CRYPTO], [
-  enable_crypto=no
   AC_SEARCH_LIBS([crypt], [crypt], [AC_SUBST([LIBCRYPT],["-lcrypt"])])
 
   AX_CHECK_OPENSSL([
-    TS_ADDTO(CPPFLAGS, [$OPENSSL_INCLUDES])
-    TS_ADDTO(LDFLAGS, [$OPENSSL_LDFLAGS])
+    enable_crypto=yes
   ], [
-   AC_ERROR(failed to find OpenSSL)
+    AC_ERROR(failed to find OpenSSL)
+    enable_crypto=no
   ])
 
+  if test "x${enable_crypto}" = "xyes"; then
+    TS_ADDTO(LDFLAGS, [$OPENSSL_LDFLAGS])
+    TS_ADDTO(CPPFLAGS, [$OPENSSL_INCLUDES])
+  fi
+
   dnl add checks for other varieties of ssl here
 ])
 dnl


Re: git commit: TS-2504: Set LDFLAGS/CPPFLAGS properly in crypto.m4

Posted by James Peach <jp...@apache.org>.
On Jan 25, 2014, at 10:45 AM, yunkai@apache.org wrote:

> Updated Branches:
>  refs/heads/master c4b5e554d -> 0f4c7b8ff
> 
> 
> TS-2504: Set LDFLAGS/CPPFLAGS properly in crypto.m4
> 
> At the end of AX_CHECK_OPENSSL(), LDFLAGS/CPPFLAGS/LIBS variables
> will be reset, so there is no sense in setting these variables within
> AX_CHECK_OPENSSL(). We should set them outside of it.

Good catch. Sorry, I should have tested that better.

> 
> Signed-off-by: Yunkai Zhang <qi...@taobao.com>
> 
> 
> Project: http://git-wip-us.apache.org/repos/asf/trafficserver/repo
> Commit: http://git-wip-us.apache.org/repos/asf/trafficserver/commit/0f4c7b8f
> Tree: http://git-wip-us.apache.org/repos/asf/trafficserver/tree/0f4c7b8f
> Diff: http://git-wip-us.apache.org/repos/asf/trafficserver/diff/0f4c7b8f
> 
> Branch: refs/heads/master
> Commit: 0f4c7b8ffb26326dbd2cde77c986726ffe8f0552
> Parents: c4b5e55
> Author: Yunkai Zhang <qi...@taobao.com>
> Authored: Sun Jan 26 02:25:57 2014 +0800
> Committer: Yunkai Zhang <qi...@taobao.com>
> Committed: Sun Jan 26 02:43:26 2014 +0800
> 
> ----------------------------------------------------------------------
> build/crypto.m4 | 12 ++++++++----
> 1 file changed, 8 insertions(+), 4 deletions(-)
> ----------------------------------------------------------------------
> 
> 
> http://git-wip-us.apache.org/repos/asf/trafficserver/blob/0f4c7b8f/build/crypto.m4
> ----------------------------------------------------------------------
> diff --git a/build/crypto.m4 b/build/crypto.m4
> index 94919dc..08730c9 100644
> --- a/build/crypto.m4
> +++ b/build/crypto.m4
> @@ -22,16 +22,20 @@ dnl
> dnl TS_CHECK_CRYPTO: look for crypto libraries and headers
> dnl
> AC_DEFUN([TS_CHECK_CRYPTO], [
> -  enable_crypto=no
>   AC_SEARCH_LIBS([crypt], [crypt], [AC_SUBST([LIBCRYPT],["-lcrypt"])])
> 
>   AX_CHECK_OPENSSL([
> -    TS_ADDTO(CPPFLAGS, [$OPENSSL_INCLUDES])
> -    TS_ADDTO(LDFLAGS, [$OPENSSL_LDFLAGS])
> +    enable_crypto=yes
>   ], [
> -   AC_ERROR(failed to find OpenSSL)
> +    AC_ERROR(failed to find OpenSSL)
> +    enable_crypto=no
>   ])
> 
> +  if test "x${enable_crypto}" = "xyes"; then
> +    TS_ADDTO(LDFLAGS, [$OPENSSL_LDFLAGS])
> +    TS_ADDTO(CPPFLAGS, [$OPENSSL_INCLUDES])
> +  fi
> +
>   dnl add checks for other varieties of ssl here
> ])
> dnl
> 


Re: git commit: TS-2504: Set LDFLAGS/CPPFLAGS properly in crypto.m4

Posted by James Peach <jp...@apache.org>.
On Jan 25, 2014, at 10:45 AM, yunkai@apache.org wrote:

> Updated Branches:
>  refs/heads/master c4b5e554d -> 0f4c7b8ff
> 
> 
> TS-2504: Set LDFLAGS/CPPFLAGS properly in crypto.m4
> 
> At the end of AX_CHECK_OPENSSL(), LDFLAGS/CPPFLAGS/LIBS variables
> will be reset, so there is no sense in setting these variables within
> AX_CHECK_OPENSSL(). We should set them outside of it.

Good catch. Sorry, I should have tested that better.

> 
> Signed-off-by: Yunkai Zhang <qi...@taobao.com>
> 
> 
> Project: http://git-wip-us.apache.org/repos/asf/trafficserver/repo
> Commit: http://git-wip-us.apache.org/repos/asf/trafficserver/commit/0f4c7b8f
> Tree: http://git-wip-us.apache.org/repos/asf/trafficserver/tree/0f4c7b8f
> Diff: http://git-wip-us.apache.org/repos/asf/trafficserver/diff/0f4c7b8f
> 
> Branch: refs/heads/master
> Commit: 0f4c7b8ffb26326dbd2cde77c986726ffe8f0552
> Parents: c4b5e55
> Author: Yunkai Zhang <qi...@taobao.com>
> Authored: Sun Jan 26 02:25:57 2014 +0800
> Committer: Yunkai Zhang <qi...@taobao.com>
> Committed: Sun Jan 26 02:43:26 2014 +0800
> 
> ----------------------------------------------------------------------
> build/crypto.m4 | 12 ++++++++----
> 1 file changed, 8 insertions(+), 4 deletions(-)
> ----------------------------------------------------------------------
> 
> 
> http://git-wip-us.apache.org/repos/asf/trafficserver/blob/0f4c7b8f/build/crypto.m4
> ----------------------------------------------------------------------
> diff --git a/build/crypto.m4 b/build/crypto.m4
> index 94919dc..08730c9 100644
> --- a/build/crypto.m4
> +++ b/build/crypto.m4
> @@ -22,16 +22,20 @@ dnl
> dnl TS_CHECK_CRYPTO: look for crypto libraries and headers
> dnl
> AC_DEFUN([TS_CHECK_CRYPTO], [
> -  enable_crypto=no
>   AC_SEARCH_LIBS([crypt], [crypt], [AC_SUBST([LIBCRYPT],["-lcrypt"])])
> 
>   AX_CHECK_OPENSSL([
> -    TS_ADDTO(CPPFLAGS, [$OPENSSL_INCLUDES])
> -    TS_ADDTO(LDFLAGS, [$OPENSSL_LDFLAGS])
> +    enable_crypto=yes
>   ], [
> -   AC_ERROR(failed to find OpenSSL)
> +    AC_ERROR(failed to find OpenSSL)
> +    enable_crypto=no
>   ])
> 
> +  if test "x${enable_crypto}" = "xyes"; then
> +    TS_ADDTO(LDFLAGS, [$OPENSSL_LDFLAGS])
> +    TS_ADDTO(CPPFLAGS, [$OPENSSL_INCLUDES])
> +  fi
> +
>   dnl add checks for other varieties of ssl here
> ])
> dnl
>