From 65ef05d3ff8daaff5c263a32f0da4dd01529c690 Mon Sep 17 00:00:00 2001 From: Chris Young Date: Tue, 4 Jan 2022 12:21:20 +0000 Subject: ppc-amigaos: Fix libcurl build --- .../patches/libcurl/ppc-amigaos/configure.p | 13 ++++++++ .../patches/libcurl/ppc-amigaos/lib.curl_setup.h.p | 8 ++--- .../patches/libcurl/ppc-amigaos/lib.hostip4.c.p | 39 +++++++++++----------- 3 files changed, 36 insertions(+), 24 deletions(-) create mode 100644 sdk/recipes/patches/libcurl/ppc-amigaos/configure.p diff --git a/sdk/recipes/patches/libcurl/ppc-amigaos/configure.p b/sdk/recipes/patches/libcurl/ppc-amigaos/configure.p new file mode 100644 index 0000000..91bf677 --- /dev/null +++ b/sdk/recipes/patches/libcurl/ppc-amigaos/configure.p @@ -0,0 +1,13 @@ +--- configure 2022-01-04 11:43:20.490235234 +0000 ++++ configure 2022-01-04 11:56:40.357605123 +0000 +@@ -44201,9 +44201,7 @@ fi + + if test "$USE_THREADS_POSIX" != "1" + then +- CFLAGS="$CFLAGS -pthread" +- # assign PTHREAD for pkg-config use +- PTHREAD=" -pthread" ++ + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for pthread_create in -lpthread" >&5 + $as_echo_n "checking for pthread_create in -lpthread... " >&6; } + if ${ac_cv_lib_pthread_pthread_create+:} false; then : diff --git a/sdk/recipes/patches/libcurl/ppc-amigaos/lib.curl_setup.h.p b/sdk/recipes/patches/libcurl/ppc-amigaos/lib.curl_setup.h.p index 0e52d73..b0c6404 100644 --- a/sdk/recipes/patches/libcurl/ppc-amigaos/lib.curl_setup.h.p +++ b/sdk/recipes/patches/libcurl/ppc-amigaos/lib.curl_setup.h.p @@ -1,9 +1,9 @@ ---- lib/curl_setup.h 2019-03-30 13:44:08.576270700 +0000 -+++ lib/curl_setup.h 2019-03-30 13:44:33.011975643 +0000 -@@ -314,7 +314,8 @@ - # include +--- lib/curl_setup.h 2022-01-04 10:53:18.770467711 +0000 ++++ lib/curl_setup.h 2022-01-04 10:54:58.216791681 +0000 +@@ -286,7 +286,8 @@ # include # include + # include -# ifdef HAVE_PROTO_BSDSOCKET_H +# define HAVE_SELECT 1 +# if 0 diff --git a/sdk/recipes/patches/libcurl/ppc-amigaos/lib.hostip4.c.p b/sdk/recipes/patches/libcurl/ppc-amigaos/lib.hostip4.c.p index 39952b8..8d3ffa1 100644 --- a/sdk/recipes/patches/libcurl/ppc-amigaos/lib.hostip4.c.p +++ b/sdk/recipes/patches/libcurl/ppc-amigaos/lib.hostip4.c.p @@ -1,6 +1,6 @@ ---- lib/hostip4.c 2020-01-05 09:50:51.000000000 +0000 -+++ lib/hostip4.c 2020-05-07 16:02:59.313823259 +0100 -@@ -120,6 +120,10 @@ Curl_addrinfo *Curl_getaddrinfo(struct c +--- lib/hostip4.c 2022-01-04 10:57:27.790270827 +0000 ++++ lib/hostip4.c 2022-01-04 11:01:43.125967497 +0000 +@@ -120,6 +120,10 @@ struct Curl_addrinfo *Curl_getaddrinfo(s * implying that only threadsafe code and function calls may be used. * */ @@ -8,23 +8,23 @@ +#include +#include +#endif - Curl_addrinfo *Curl_ipv4_resolve_r(const char *hostname, - int port) + struct Curl_addrinfo *Curl_ipv4_resolve_r(const char *hostname, + int port) { -@@ -130,6 +134,9 @@ Curl_addrinfo *Curl_ipv4_resolve_r(const +@@ -129,6 +133,9 @@ struct Curl_addrinfo *Curl_ipv4_resolve_ + struct Curl_addrinfo *ai = NULL; struct hostent *h = NULL; - struct in_addr in; struct hostent *buf = NULL; +#ifdef __amigaos4__ + struct SocketIFace *ISocket = NULL; +#endif - #ifdef ENABLE_IPV6 - { -@@ -302,7 +309,20 @@ Curl_addrinfo *Curl_ipv4_resolve_r(const - * gethostbyname() is the preferred one. - */ - else { + #if defined(HAVE_GETADDRINFO_THREADSAFE) + struct addrinfo hints; +@@ -284,7 +291,20 @@ struct Curl_addrinfo *Curl_ipv4_resolve_ + * getaddrinfo() nor gethostbyname_r() function or for which + * gethostbyname() is the preferred one. + */ +#ifdef __amigaos4__ + struct Library *SocketBase = IExec->OpenLibrary("bsdsocket.library", 4); + if (SocketBase) @@ -36,17 +36,16 @@ + { + h = ISocket->gethostbyname((void*)hostname); + } -+#else - h = gethostbyname((void *)hostname); ++#else + h = gethostbyname((void *)hostname); +#endif #endif /* HAVE_GETADDRINFO_THREADSAFE || HAVE_GETHOSTBYNAME_R */ - } -@@ -312,7 +332,14 @@ Curl_addrinfo *Curl_ipv4_resolve_r(const - if(buf) /* used a *_r() function */ + if(h) { +@@ -294,6 +314,14 @@ struct Curl_addrinfo *Curl_ipv4_resolve_ free(buf); } -- + +#ifdef __amigaos4__ + if (ISocket) + { @@ -54,7 +53,7 @@ + IExec->DropInterface((struct Interface *)ISocket); + IExec->CloseLibrary(SocketBase); + } -+#endif ++#endif return ai; } #endif /* defined(CURLRES_IPV4) && !defined(CURLRES_ARES) */ -- cgit v1.2.3