* [Buildroot] [PATCH] package/socat: fix static openssl compatibility
@ 2023-11-21 17:47 Byron Gallagher
2023-11-21 18:09 ` Baruch Siach via buildroot
2023-11-23 10:15 ` Thomas Petazzoni via buildroot
0 siblings, 2 replies; 8+ messages in thread
From: Byron Gallagher @ 2023-11-21 17:47 UTC (permalink / raw)
To: buildroot; +Cc: Byron Gallagher
4028ee71743a25af172809e098e4c8eb61bf55f4 disables static openssl
compatibility due to issues linking against zlib.
This patch re-enables the functionality by patching socat's
autoconf to include zlib when locating openssl. Bug also reported
upstream via socat@dest-unreach.org.
Signed-off-by: Byron Gallagher <trippgallagher98@gmail.com>
---
...-build-link-against-zlib-for-openssl.patch | 35 +++++++++++++++++++
package/socat/socat.mk | 2 +-
2 files changed, 36 insertions(+), 1 deletion(-)
create mode 100644 package/socat/0003-build-link-against-zlib-for-openssl.patch
diff --git a/package/socat/0003-build-link-against-zlib-for-openssl.patch b/package/socat/0003-build-link-against-zlib-for-openssl.patch
new file mode 100644
index 0000000000..3851d5bcab
--- /dev/null
+++ b/package/socat/0003-build-link-against-zlib-for-openssl.patch
@@ -0,0 +1,35 @@
+From 0434a4674a012a35f6390d9afc4812de59a394ab Mon Sep 17 00:00:00 2001
+From: Byron Gallagher <trippgallagher98@gmail.com>
+Date: Tue, 21 Nov 2023 12:25:18 -0500
+Subject: [PATCH] build: link against zlib for openssl
+
+If openssl is static, socat will not find it due to autoconf
+failures on AC_TRY_LINK without -lz.
+
+Signed-off-by: Byron Gallagher <trippgallagher98@gmail.com>
+---
+ configure.ac | 4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/configure.ac b/configure.ac
+index 9d60473..ae0e6bd 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -580,12 +580,12 @@ if test -n "$WITH_OPENSSL" -a "$sc_cv_have_openssl_ssl_h" = 'yes'; then
+ if test -n "$OPENSSL_BASE"; then
+ L="$OPENSSL_BASE/lib"; LIBS="$LIBS -L$L -lssl -lcrypto"
+ else
+- LIBS="$LIBS -lssl -lcrypto"
++ LIBS="$LIBS -lssl -lcrypto -lz"
+ fi
+ AC_TRY_LINK([#include <openssl/ssl.h>],
+ [SSL_library_init();ERR_error_string()],
+ [sc_cv_have_libssl='yes'],
+- [ LIBS="$LIBS -lcrypto"
++ [ LIBS="$LIBS -lcrypto -lz"
+ AC_TRY_LINK([#include <openssl/ssl.h>],
+ [SSL_library_init()],
+ [sc_cv_have_libssl='yes'],
+--
+2.34.1
+
diff --git a/package/socat/socat.mk b/package/socat/socat.mk
index f958f26522..0741605687 100644
--- a/package/socat/socat.mk
+++ b/package/socat/socat.mk
@@ -39,7 +39,7 @@ SOCAT_DEPENDENCIES = host-autoconf
# incompatibile license (GPL-3.0+)
SOCAT_CONF_OPTS = --disable-readline
-ifeq ($(BR2_PACKAGE_LIBOPENSSL):$(BR2_STATIC_LIBS),y:)
+ifeq ($(BR2_PACKAGE_LIBOPENSSL),y)
SOCAT_DEPENDENCIES += openssl
else
SOCAT_CONF_OPTS += --disable-openssl
--
2.34.1
_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot
^ permalink raw reply related [flat|nested] 8+ messages in thread
* Re: [Buildroot] [PATCH] package/socat: fix static openssl compatibility
2023-11-21 17:47 [Buildroot] [PATCH] package/socat: fix static openssl compatibility Byron Gallagher
@ 2023-11-21 18:09 ` Baruch Siach via buildroot
2023-11-21 18:25 ` Byron Gallagher
2023-11-23 10:15 ` Thomas Petazzoni via buildroot
1 sibling, 1 reply; 8+ messages in thread
From: Baruch Siach via buildroot @ 2023-11-21 18:09 UTC (permalink / raw)
To: Byron Gallagher; +Cc: buildroot
Hi Byron,
On Tue, Nov 21 2023, Byron Gallagher wrote:
> 4028ee71743a25af172809e098e4c8eb61bf55f4 disables static openssl
> compatibility due to issues linking against zlib.
>
> This patch re-enables the functionality by patching socat's
> autoconf to include zlib when locating openssl. Bug also reported
> upstream via socat@dest-unreach.org.
>
> Signed-off-by: Byron Gallagher <trippgallagher98@gmail.com>
> ---
> ...-build-link-against-zlib-for-openssl.patch | 35 +++++++++++++++++++
> package/socat/socat.mk | 2 +-
> 2 files changed, 36 insertions(+), 1 deletion(-)
> create mode 100644 package/socat/0003-build-link-against-zlib-for-openssl.patch
>
> diff --git a/package/socat/0003-build-link-against-zlib-for-openssl.patch
> b/package/socat/0003-build-link-against-zlib-for-openssl.patch
> new file mode 100644
> index 0000000000..3851d5bcab
> --- /dev/null
> +++ b/package/socat/0003-build-link-against-zlib-for-openssl.patch
> @@ -0,0 +1,35 @@
> +From 0434a4674a012a35f6390d9afc4812de59a394ab Mon Sep 17 00:00:00 2001
> +From: Byron Gallagher <trippgallagher98@gmail.com>
> +Date: Tue, 21 Nov 2023 12:25:18 -0500
> +Subject: [PATCH] build: link against zlib for openssl
> +
> +If openssl is static, socat will not find it due to autoconf
> +failures on AC_TRY_LINK without -lz.
> +
Patches should have Upstream: tag. See
https://buildroot.org/downloads/manual/manual.html#_additional_patch_documentation
In this case adding something like
Upstream: sent to socat@dest-unreach.org
should be enough.
baruch
> +Signed-off-by: Byron Gallagher <trippgallagher98@gmail.com>
> +---
> + configure.ac | 4 ++--
> + 1 file changed, 2 insertions(+), 2 deletions(-)
> +
> +diff --git a/configure.ac b/configure.ac
> +index 9d60473..ae0e6bd 100644
> +--- a/configure.ac
> ++++ b/configure.ac
> +@@ -580,12 +580,12 @@ if test -n "$WITH_OPENSSL" -a "$sc_cv_have_openssl_ssl_h" = 'yes'; then
> + if test -n "$OPENSSL_BASE"; then
> + L="$OPENSSL_BASE/lib"; LIBS="$LIBS -L$L -lssl -lcrypto"
> + else
> +- LIBS="$LIBS -lssl -lcrypto"
> ++ LIBS="$LIBS -lssl -lcrypto -lz"
> + fi
> + AC_TRY_LINK([#include <openssl/ssl.h>],
> + [SSL_library_init();ERR_error_string()],
> + [sc_cv_have_libssl='yes'],
> +- [ LIBS="$LIBS -lcrypto"
> ++ [ LIBS="$LIBS -lcrypto -lz"
> + AC_TRY_LINK([#include <openssl/ssl.h>],
> + [SSL_library_init()],
> + [sc_cv_have_libssl='yes'],
> +--
> +2.34.1
> +
> diff --git a/package/socat/socat.mk b/package/socat/socat.mk
> index f958f26522..0741605687 100644
> --- a/package/socat/socat.mk
> +++ b/package/socat/socat.mk
> @@ -39,7 +39,7 @@ SOCAT_DEPENDENCIES = host-autoconf
> # incompatibile license (GPL-3.0+)
> SOCAT_CONF_OPTS = --disable-readline
>
> -ifeq ($(BR2_PACKAGE_LIBOPENSSL):$(BR2_STATIC_LIBS),y:)
> +ifeq ($(BR2_PACKAGE_LIBOPENSSL),y)
> SOCAT_DEPENDENCIES += openssl
> else
> SOCAT_CONF_OPTS += --disable-openssl
--
~. .~ Tk Open Systems
=}------------------------------------------------ooO--U--Ooo------------{=
- baruch@tkos.co.il - tel: +972.52.368.4656, http://www.tkos.co.il -
_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot
^ permalink raw reply [flat|nested] 8+ messages in thread
* [Buildroot] [PATCH] package/socat: fix static openssl compatibility
2023-11-21 18:09 ` Baruch Siach via buildroot
@ 2023-11-21 18:25 ` Byron Gallagher
2023-11-26 15:41 ` Yann E. MORIN
0 siblings, 1 reply; 8+ messages in thread
From: Byron Gallagher @ 2023-11-21 18:25 UTC (permalink / raw)
To: buildroot; +Cc: Byron Gallagher
4028ee71743a25af172809e098e4c8eb61bf55f4 disables static openssl
compatibility due to issues linking against zlib.
This patch re-enables the functionality by patching socat's
autoconf to include zlib when locating openssl. Bug also reported
upstream via socat@dest-unreach.org.
Signed-off-by: Byron Gallagher <trippgallagher98@gmail.com>
---
...-build-link-against-zlib-for-openssl.patch | 36 +++++++++++++++++++
package/socat/socat.mk | 2 +-
2 files changed, 37 insertions(+), 1 deletion(-)
create mode 100644 package/socat/0003-build-link-against-zlib-for-openssl.patch
diff --git a/package/socat/0003-build-link-against-zlib-for-openssl.patch b/package/socat/0003-build-link-against-zlib-for-openssl.patch
new file mode 100644
index 0000000000..257f5225b1
--- /dev/null
+++ b/package/socat/0003-build-link-against-zlib-for-openssl.patch
@@ -0,0 +1,36 @@
+From 0434a4674a012a35f6390d9afc4812de59a394ab Mon Sep 17 00:00:00 2001
+From: Byron Gallagher <trippgallagher98@gmail.com>
+Date: Tue, 21 Nov 2023 12:25:18 -0500
+Subject: [PATCH] build: link against zlib for openssl
+
+If openssl is static, socat will not find it due to autoconf
+failures on AC_TRY_LINK without -lz.
+
+Upstream: sent to socat at dest-unreach.org
+Signed-off-by: Byron Gallagher <trippgallagher98@gmail.com>
+---
+ configure.ac | 4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/configure.ac b/configure.ac
+index 9d60473..ae0e6bd 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -580,12 +580,12 @@ if test -n "$WITH_OPENSSL" -a "$sc_cv_have_openssl_ssl_h" = 'yes'; then
+ if test -n "$OPENSSL_BASE"; then
+ L="$OPENSSL_BASE/lib"; LIBS="$LIBS -L$L -lssl -lcrypto"
+ else
+- LIBS="$LIBS -lssl -lcrypto"
++ LIBS="$LIBS -lssl -lcrypto -lz"
+ fi
+ AC_TRY_LINK([#include <openssl/ssl.h>],
+ [SSL_library_init();ERR_error_string()],
+ [sc_cv_have_libssl='yes'],
+- [ LIBS="$LIBS -lcrypto"
++ [ LIBS="$LIBS -lcrypto -lz"
+ AC_TRY_LINK([#include <openssl/ssl.h>],
+ [SSL_library_init()],
+ [sc_cv_have_libssl='yes'],
+--
+2.34.1
+
diff --git a/package/socat/socat.mk b/package/socat/socat.mk
index f958f26522..0741605687 100644
--- a/package/socat/socat.mk
+++ b/package/socat/socat.mk
@@ -39,7 +39,7 @@ SOCAT_DEPENDENCIES = host-autoconf
# incompatibile license (GPL-3.0+)
SOCAT_CONF_OPTS = --disable-readline
-ifeq ($(BR2_PACKAGE_LIBOPENSSL):$(BR2_STATIC_LIBS),y:)
+ifeq ($(BR2_PACKAGE_LIBOPENSSL),y)
SOCAT_DEPENDENCIES += openssl
else
SOCAT_CONF_OPTS += --disable-openssl
--
2.34.1
_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot
^ permalink raw reply related [flat|nested] 8+ messages in thread
* Re: [Buildroot] [PATCH] package/socat: fix static openssl compatibility
2023-11-21 17:47 [Buildroot] [PATCH] package/socat: fix static openssl compatibility Byron Gallagher
2023-11-21 18:09 ` Baruch Siach via buildroot
@ 2023-11-23 10:15 ` Thomas Petazzoni via buildroot
2023-11-23 17:55 ` Byron Gallagher
1 sibling, 1 reply; 8+ messages in thread
From: Thomas Petazzoni via buildroot @ 2023-11-23 10:15 UTC (permalink / raw)
To: Byron Gallagher; +Cc: buildroot
Hello Byron,
On Tue, 21 Nov 2023 12:47:22 -0500
Byron Gallagher <trippgallagher98@gmail.com> wrote:
> +diff --git a/configure.ac b/configure.ac
> +index 9d60473..ae0e6bd 100644
> +--- a/configure.ac
> ++++ b/configure.ac
> +@@ -580,12 +580,12 @@ if test -n "$WITH_OPENSSL" -a "$sc_cv_have_openssl_ssl_h" = 'yes'; then
> + if test -n "$OPENSSL_BASE"; then
> + L="$OPENSSL_BASE/lib"; LIBS="$LIBS -L$L -lssl -lcrypto"
> + else
> +- LIBS="$LIBS -lssl -lcrypto"
> ++ LIBS="$LIBS -lssl -lcrypto -lz"
The downside of this is that socat is then directly linked to libz even
when it's not needed (dynamic linking situation).
The correct/ideal way of handling this is to use pkg-config, as it
properly says whether we need -lssl -lcrypto (dynamic linking case) or
-lssl -lcrypto -lz (static linking case), without hardcoding this in
socat itself.
Best regards,
Thomas
--
Thomas Petazzoni, co-owner and CEO, Bootlin
Embedded Linux and Kernel engineering and training
https://bootlin.com
_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [Buildroot] [PATCH] package/socat: fix static openssl compatibility
2023-11-23 10:15 ` Thomas Petazzoni via buildroot
@ 2023-11-23 17:55 ` Byron Gallagher
2023-11-24 8:53 ` Thomas Petazzoni via buildroot
0 siblings, 1 reply; 8+ messages in thread
From: Byron Gallagher @ 2023-11-23 17:55 UTC (permalink / raw)
To: Thomas Petazzoni; +Cc: buildroot
[-- Attachment #1.1: Type: text/plain, Size: 1436 bytes --]
Hi Thomas,
That makes sense. In this case would it be sufficient to add another layer
of AC_TRY_LINK to check the static case? i.e. we try with -lssl -lcrypto
first and if fail, try again with -lssl -lcrypto -lz?
Best Regards,
Byron
On Thu, Nov 23, 2023 at 5:15 AM Thomas Petazzoni <
thomas.petazzoni@bootlin.com> wrote:
> Hello Byron,
>
> On Tue, 21 Nov 2023 12:47:22 -0500
> Byron Gallagher <trippgallagher98@gmail.com> wrote:
>
> > +diff --git a/configure.ac b/configure.ac
> > +index 9d60473..ae0e6bd 100644
> > +--- a/configure.ac
> > ++++ b/configure.ac
> > +@@ -580,12 +580,12 @@ if test -n "$WITH_OPENSSL" -a
> "$sc_cv_have_openssl_ssl_h" = 'yes'; then
> > + if test -n "$OPENSSL_BASE"; then
> > + L="$OPENSSL_BASE/lib"; LIBS="$LIBS -L$L -lssl -lcrypto"
> > + else
> > +- LIBS="$LIBS -lssl -lcrypto"
> > ++ LIBS="$LIBS -lssl -lcrypto -lz"
>
> The downside of this is that socat is then directly linked to libz even
> when it's not needed (dynamic linking situation).
>
> The correct/ideal way of handling this is to use pkg-config, as it
> properly says whether we need -lssl -lcrypto (dynamic linking case) or
> -lssl -lcrypto -lz (static linking case), without hardcoding this in
> socat itself.
>
> Best regards,
>
> Thomas
> --
> Thomas Petazzoni, co-owner and CEO, Bootlin
> Embedded Linux and Kernel engineering and training
> https://bootlin.com
>
[-- Attachment #1.2: Type: text/html, Size: 2396 bytes --]
[-- Attachment #2: Type: text/plain, Size: 150 bytes --]
_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [Buildroot] [PATCH] package/socat: fix static openssl compatibility
2023-11-23 17:55 ` Byron Gallagher
@ 2023-11-24 8:53 ` Thomas Petazzoni via buildroot
2023-11-30 20:18 ` Byron Gallagher
0 siblings, 1 reply; 8+ messages in thread
From: Thomas Petazzoni via buildroot @ 2023-11-24 8:53 UTC (permalink / raw)
To: Byron Gallagher; +Cc: buildroot
Hello Byron,
On Thu, 23 Nov 2023 12:55:33 -0500
Byron Gallagher <trippgallagher98@gmail.com> wrote:
> That makes sense. In this case would it be sufficient to add another layer
> of AC_TRY_LINK to check the static case? i.e. we try with -lssl -lcrypto
> first and if fail, try again with -lssl -lcrypto -lz?
That's an option indeed. But the best solution is really to use
pkg-config, through PKG_CHECK_MODULES(), and only if not found via
pkg-config fall back on the existing crap that uses AC_TRY_LINK().
Best regards,
Thomas
--
Thomas Petazzoni, co-owner and CEO, Bootlin
Embedded Linux and Kernel engineering and training
https://bootlin.com
_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [Buildroot] [PATCH] package/socat: fix static openssl compatibility
2023-11-21 18:25 ` Byron Gallagher
@ 2023-11-26 15:41 ` Yann E. MORIN
0 siblings, 0 replies; 8+ messages in thread
From: Yann E. MORIN @ 2023-11-26 15:41 UTC (permalink / raw)
To: Byron Gallagher; +Cc: buildroot
Byron, All,
On 2023-11-21 13:25 -0500, Byron Gallagher spake thusly:
> 4028ee71743a25af172809e098e4c8eb61bf55f4 disables static openssl
> compatibility due to issues linking against zlib.
>
> This patch re-enables the functionality by patching socat's
> autoconf to include zlib when locating openssl. Bug also reported
> upstream via socat@dest-unreach.org.
Since you sent this new iteration, Thomas replied to your initial patch,
usggesting using pkg-config to find the necessary SSL libs.
So, I've marked both your patches as changes requested in patchwork.
Thanks!
Regards,
Yann E. MORIN.
> Signed-off-by: Byron Gallagher <trippgallagher98@gmail.com>
> ---
> ...-build-link-against-zlib-for-openssl.patch | 36 +++++++++++++++++++
> package/socat/socat.mk | 2 +-
> 2 files changed, 37 insertions(+), 1 deletion(-)
> create mode 100644 package/socat/0003-build-link-against-zlib-for-openssl.patch
>
> diff --git a/package/socat/0003-build-link-against-zlib-for-openssl.patch b/package/socat/0003-build-link-against-zlib-for-openssl.patch
> new file mode 100644
> index 0000000000..257f5225b1
> --- /dev/null
> +++ b/package/socat/0003-build-link-against-zlib-for-openssl.patch
> @@ -0,0 +1,36 @@
> +From 0434a4674a012a35f6390d9afc4812de59a394ab Mon Sep 17 00:00:00 2001
> +From: Byron Gallagher <trippgallagher98@gmail.com>
> +Date: Tue, 21 Nov 2023 12:25:18 -0500
> +Subject: [PATCH] build: link against zlib for openssl
> +
> +If openssl is static, socat will not find it due to autoconf
> +failures on AC_TRY_LINK without -lz.
> +
> +Upstream: sent to socat at dest-unreach.org
> +Signed-off-by: Byron Gallagher <trippgallagher98@gmail.com>
> +---
> + configure.ac | 4 ++--
> + 1 file changed, 2 insertions(+), 2 deletions(-)
> +
> +diff --git a/configure.ac b/configure.ac
> +index 9d60473..ae0e6bd 100644
> +--- a/configure.ac
> ++++ b/configure.ac
> +@@ -580,12 +580,12 @@ if test -n "$WITH_OPENSSL" -a "$sc_cv_have_openssl_ssl_h" = 'yes'; then
> + if test -n "$OPENSSL_BASE"; then
> + L="$OPENSSL_BASE/lib"; LIBS="$LIBS -L$L -lssl -lcrypto"
> + else
> +- LIBS="$LIBS -lssl -lcrypto"
> ++ LIBS="$LIBS -lssl -lcrypto -lz"
> + fi
> + AC_TRY_LINK([#include <openssl/ssl.h>],
> + [SSL_library_init();ERR_error_string()],
> + [sc_cv_have_libssl='yes'],
> +- [ LIBS="$LIBS -lcrypto"
> ++ [ LIBS="$LIBS -lcrypto -lz"
> + AC_TRY_LINK([#include <openssl/ssl.h>],
> + [SSL_library_init()],
> + [sc_cv_have_libssl='yes'],
> +--
> +2.34.1
> +
> diff --git a/package/socat/socat.mk b/package/socat/socat.mk
> index f958f26522..0741605687 100644
> --- a/package/socat/socat.mk
> +++ b/package/socat/socat.mk
> @@ -39,7 +39,7 @@ SOCAT_DEPENDENCIES = host-autoconf
> # incompatibile license (GPL-3.0+)
> SOCAT_CONF_OPTS = --disable-readline
>
> -ifeq ($(BR2_PACKAGE_LIBOPENSSL):$(BR2_STATIC_LIBS),y:)
> +ifeq ($(BR2_PACKAGE_LIBOPENSSL),y)
> SOCAT_DEPENDENCIES += openssl
> else
> SOCAT_CONF_OPTS += --disable-openssl
> --
> 2.34.1
>
> _______________________________________________
> buildroot mailing list
> buildroot@buildroot.org
> https://lists.buildroot.org/mailman/listinfo/buildroot
--
.-----------------.--------------------.------------------.--------------------.
| Yann E. MORIN | Real-Time Embedded | /"\ ASCII RIBBON | Erics' conspiracy: |
| +33 662 376 056 | Software Designer | \ / CAMPAIGN | ___ |
| +33 561 099 427 `------------.-------: X AGAINST | \e/ There is no |
| http://ymorin.is-a-geek.org/ | _/*\_ | / \ HTML MAIL | v conspiracy. |
'------------------------------^-------^------------------^--------------------'
_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [Buildroot] [PATCH] package/socat: fix static openssl compatibility
2023-11-24 8:53 ` Thomas Petazzoni via buildroot
@ 2023-11-30 20:18 ` Byron Gallagher
0 siblings, 0 replies; 8+ messages in thread
From: Byron Gallagher @ 2023-11-30 20:18 UTC (permalink / raw)
To: Thomas Petazzoni; +Cc: buildroot
Hi Thomas,
I believe I've implemented the changes in my local version but would
like your thoughts.
1. Socat package now has to be autoreconf rather than simple autotools
with a pre-config hook that runs autoconf independently.
2. The upstream socat configure.ac uses the old AC_DEFINE(FOO) format
which causes autoheader to fail. I've changed every invocation to the
correct AC_DEFINE(FOO, [VAL], [Description])
3. The changes to the relevant block for finding libssl are as follows:
580,593c580,603
< if test -n "$OPENSSL_BASE"; then
< L="$OPENSSL_BASE/lib"; LIBS="$LIBS -L$L -lssl -lcrypto"
< else
< LIBS="$LIBS -lssl -lcrypto"
< fi
< AC_TRY_LINK([#include <openssl/ssl.h>],
< [SSL_library_init();ERR_error_string()],
< [sc_cv_have_libssl='yes'],
< [ LIBS="$LIBS -lcrypto"
< AC_TRY_LINK([#include <openssl/ssl.h>],
< [SSL_library_init()],
< [sc_cv_have_libssl='yes'],
< [sc_cv_have_libssl='no'])
< ])
---
> PKG_CHECK_MODULES(LIBSSL, libssl,
> [
> LIBS="$LIBS $LIBSSL_LIBS"
> CFLAGS="$CFLAGS $LIBSSL_CFLAGS"
> sc_cv_have_libssl='yes'
> ],
> [
> if test -n "$OPENSSL_BASE"; then
> L="$OPENSSL_BASE/lib"; LIBS="$LIBS -L$L -lssl -lcrypto"
> else
> LIBS="$LIBS -lssl -lcrypto"
> fi
> AC_TRY_LINK([#include <openssl/ssl.h>],
> [SSL_library_init();ERR_error_string()],
> [sc_cv_have_libssl='yes'],
> [ LIBS="$LIBS -lcrypto"
> AC_TRY_LINK([#include <openssl/ssl.h>],
> [SSL_library_init()],
> [sc_cv_have_libssl='yes'],
> [sc_cv_have_libssl='no'])
> ])
> AC_MSG_RESULT($sc_cv_have_libssl)
> ])
On Fri, Nov 24, 2023 at 3:53 AM Thomas Petazzoni
<thomas.petazzoni@bootlin.com> wrote:
>
> Hello Byron,
>
> On Thu, 23 Nov 2023 12:55:33 -0500
> Byron Gallagher <trippgallagher98@gmail.com> wrote:
>
> > That makes sense. In this case would it be sufficient to add another layer
> > of AC_TRY_LINK to check the static case? i.e. we try with -lssl -lcrypto
> > first and if fail, try again with -lssl -lcrypto -lz?
>
> That's an option indeed. But the best solution is really to use
> pkg-config, through PKG_CHECK_MODULES(), and only if not found via
> pkg-config fall back on the existing crap that uses AC_TRY_LINK().
>
> Best regards,
>
> Thomas
> --
> Thomas Petazzoni, co-owner and CEO, Bootlin
> Embedded Linux and Kernel engineering and training
> https://bootlin.com
_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot
^ permalink raw reply [flat|nested] 8+ messages in thread
end of thread, other threads:[~2023-11-30 20:18 UTC | newest]
Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-11-21 17:47 [Buildroot] [PATCH] package/socat: fix static openssl compatibility Byron Gallagher
2023-11-21 18:09 ` Baruch Siach via buildroot
2023-11-21 18:25 ` Byron Gallagher
2023-11-26 15:41 ` Yann E. MORIN
2023-11-23 10:15 ` Thomas Petazzoni via buildroot
2023-11-23 17:55 ` Byron Gallagher
2023-11-24 8:53 ` Thomas Petazzoni via buildroot
2023-11-30 20:18 ` Byron Gallagher
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox