1
0
mirror of https://git.openwrt.org/feed/packages.git synced 2024-06-15 20:03:57 +02:00
openwrt-packages/libs/apr/patches/000-060-backport-require-stdlib.patch
Michael Pratt 980707ac10 apr: add autotools compatibility backports
Backport a bunch of patches that fixes build
when using new Autoconf and Automake.

The patches removed are replaced by upstream backports
which are more complete.

Signed-off-by: Michael Pratt <mcpratt@pm.me>
2022-09-09 15:20:58 -07:00

107 lines
2.5 KiB
Diff

From 9d9c6990afaa7ad8eea0be524481bb48a5dd1b09
From: Jim Jagielski <jim@apache.org>
Date: Thu, 29 Oct 2020 20:16:55 +0000
Subject: [PATCH] calls to exit() require stdlib.h or else we get
-Werror,-Wimplicit-function-declaration
git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1882979 13f79535-47bb-0310-9956-ffa450edef68
---
build/apr_common.m4 | 3 +++
build/apr_network.m4 | 15 +++++++++++++++
configure.in | 6 +++++-
3 files changed, 23 insertions(+), 1 deletion(-)
--- a/build/apr_common.m4
+++ b/build/apr_common.m4
@@ -495,6 +495,9 @@ AC_CACHE_CHECK([whether return code from
#include <errno.h>
#include <string.h>
#include <stdio.h>
+#ifdef HAVE_STDLIB_H
+#include <stdlib.h>
+#endif
main()
{
char buf[1024];
--- a/build/apr_network.m4
+++ b/build/apr_network.m4
@@ -63,6 +63,9 @@ AC_DEFUN([APR_CHECK_WORKING_GETADDRINFO]
#ifdef HAVE_SYS_SOCKET_H
#include <sys/socket.h>
#endif
+#ifdef HAVE_STDLIB_H
+#include <stdlib.h>
+#endif
int main(void) {
struct addrinfo hints, *ai;
@@ -151,6 +154,9 @@ AC_DEFUN([APR_CHECK_WORKING_GETNAMEINFO]
#ifdef HAVE_NETINET_IN_H
#include <netinet/in.h>
#endif
+#ifdef HAVE_STDLIB_H
+#include <stdlib.h>
+#endif
int main(void) {
struct sockaddr_in sa;
@@ -194,6 +200,9 @@ AC_DEFUN([APR_CHECK_NEGATIVE_EAI], [
#ifdef HAVE_NETDB_H
#include <netdb.h>
#endif
+#ifdef HAVE_STDLIB_H
+#include <stdlib.h>
+#endif
int main(void) {
if (EAI_ADDRFAMILY < 0) {
@@ -403,6 +412,9 @@ AC_DEFUN([APR_CHECK_TCP_NODELAY_INHERITE
#ifndef HAVE_SOCKLEN_T
typedef int socklen_t;
#endif
+#ifdef HAVE_STDLIB_H
+#include <stdlib.h>
+#endif
int main(void) {
int listen_s, connected_s, client_s;
int listen_port, rc;
@@ -588,6 +600,9 @@ typedef int socklen_t;
#ifdef HAVE_FCNTL_H
#include <fcntl.h>
#endif
+#ifdef HAVE_STDLIB_H
+#include <stdlib.h>
+#endif
int main(void) {
int listen_s, connected_s, client_s;
int listen_port, rc;
--- a/configure.in
+++ b/configure.in
@@ -2208,6 +2208,7 @@ AC_TRY_RUN([
#include <sys/types.h>
#include <sys/time.h>
#include <sys/resource.h>
+#include <stdlib.h>
main()
{
struct rlimit limit;
@@ -2307,6 +2308,7 @@ if test "$threads" = "1"; then
AC_TRY_RUN([
#include <sys/types.h>
#include <pthread.h>
+#include <stdlib.h>
int main()
{
pthread_mutex_t mutex;
@@ -2430,7 +2432,9 @@ AC_TRY_RUN([
#endif
#include <fcntl.h>
#include <errno.h>
-
+#ifdef HAVE_STDLIB_H
+#include <stdlib.h>
+#endif
int fd;
struct flock proc_mutex_lock_it = {0};
const char *fname = "conftest.fcntl";