[packages/php/PHP_7_2] more configure fixes

atler atler at pld-linux.org
Fri Jan 24 21:17:30 CET 2025


commit ea527344ad1d621544ff9b4c1e42ef1383ce56f2
Author: Jan Palus <atler at pld-linux.org>
Date:   Fri Jan 24 21:04:24 2025 +0100

    more configure fixes

 configure.patch | 236 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++
 php.spec        |   2 +-
 readdir_r.patch |  30 -------
 3 files changed, 237 insertions(+), 31 deletions(-)
---
diff --git a/php.spec b/php.spec
index 123ab94..62f45c5 100644
--- a/php.spec
+++ b/php.spec
@@ -228,7 +228,7 @@ Patch76:	missing-includes.patch
 Patch77:	libxml2-2.12.patch
 Patch78:	types.patch
 Patch79:	includes.patch
-Patch80:	readdir_r.patch
+Patch80:	configure.patch
 URL:		https://www.php.net/
 %{?with_interbase:%{!?with_interbase_inst:BuildRequires:	Firebird-devel >= 1.0.2.908-2}}
 %{?with_pspell:BuildRequires:	aspell-devel >= 2:0.50.0}
diff --git a/configure.patch b/configure.patch
new file mode 100644
index 0000000..283a218
--- /dev/null
+++ b/configure.patch
@@ -0,0 +1,236 @@
+--- php-7.2.34/acinclude.m4.orig	2025-01-23 20:45:18.432571977 +0100
++++ php-7.2.34/acinclude.m4	2025-01-23 20:54:20.252520613 +0100
+@@ -1349,12 +1349,13 @@
+ #define _REENTRANT
+ #include <sys/types.h>
+ #include <dirent.h>
++#include <stdlib.h>
+ 
+ #ifndef PATH_MAX
+ #define PATH_MAX 1024
+ #endif
+ 
+-main() {
++int main() {
+   DIR *dir;
+   char entry[sizeof(struct dirent)+PATH_MAX];
+   struct dirent *pentry = (struct dirent *) &entry;
+@@ -1363,10 +1364,10 @@
+   if (!dir)
+     exit(1);
+   if (readdir_r(dir, (struct dirent *) entry, &pentry) == 0) {
+-    close(dir);
++    closedir(dir);
+     exit(0);
+   }
+-  close(dir);
++  closedir(dir);
+   exit(1);
+ }
+     ],[
+--- php-7.2.34/acinclude.m4.orig	2025-01-24 18:36:21.516873084 +0100
++++ php-7.2.34/acinclude.m4	2025-01-24 20:22:44.293766361 +0100
+@@ -1157,7 +1157,7 @@
+ AC_TRY_RUN([
+ #include <time.h>
+ 
+-main() {
++int main() {
+ char buf[27];
+ struct tm t;
+ time_t old = 0;
+@@ -1210,8 +1210,9 @@
+ #include <fcntl.h>
+ #include <unistd.h>
+ #include <errno.h>
++#include <stdlib.h>
+ $1
+-    main() {
++    int main() {
+     int fd = open("conftest_in", O_WRONLY|O_CREAT, 0600);
+ 
+     if (fd < 0) exit(1);
+@@ -1240,8 +1241,9 @@
+ #include <fcntl.h>
+ #include <unistd.h>
+ #include <errno.h>
++#include <stdlib.h>
+ $1
+-    main() {
++    int main() {
+     char buf[3];
+     int fd = open("conftest_in", O_RDONLY);
+     if (fd < 0) exit(1);
+@@ -1474,7 +1476,10 @@
+ dnl
+ AC_DEFUN([PHP_AC_BROKEN_SPRINTF],[
+   AC_CACHE_CHECK(whether sprintf is broken, ac_cv_broken_sprintf,[
+-    AC_TRY_RUN([main() {char buf[20];exit(sprintf(buf,"testing 123")!=11); }],[
++    AC_TRY_RUN([
++#include <stdio.h>
++#include <stdlib.h>
++int main() {char buf[20];exit(sprintf(buf,"testing 123")!=11); }],[
+       ac_cv_broken_sprintf=no
+     ],[
+       ac_cv_broken_sprintf=yes
+@@ -1698,6 +1703,8 @@
+   AC_CACHE_VAL(_cv_have_broken_glibc_fopen_append,[
+   AC_TRY_RUN([
+ #include <stdio.h>
++#include <stdlib.h>
++#include <unistd.h>
+ int main(int argc, char *argv[])
+ {
+   FILE *fp;
+@@ -1765,6 +1772,7 @@
+ AC_TRY_RUN([
+ #define _GNU_SOURCE
+ #include <stdio.h>
++#include <stdlib.h>
+ 
+ struct cookiedata {
+   __off64_t pos;
+@@ -1781,7 +1789,7 @@
+ 
+ cookie_io_functions_t funcs = {reader, writer, seeker, closer};
+ 
+-main() {
++int main() {
+   struct cookiedata g = { 0 };
+   FILE *fp = fopencookie(&g, "r", funcs);
+ 
+@@ -1898,7 +1906,7 @@
+   if test "$found" = "yes"; then
+     ac_libs=$LIBS
+     LIBS="$LIBS -l$2"
+-    AC_TRY_RUN([main() { return (0); }],[found=yes],[found=no],[found=no])
++    AC_TRY_RUN([int main() { return (0); }],[found=yes],[found=no],[found=no])
+     LIBS=$ac_libs
+   fi
+ 
+@@ -2951,7 +2959,7 @@
+ 
+ #define TEXT "This is the test message -- "
+ 
+-main()
++int main()
+ {
+   int n;
+ 
+--- php-7.2.34/configure.ac.orig	2025-01-24 18:36:21.610206957 +0100
++++ php-7.2.34/configure.ac	2025-01-24 19:52:10.669915792 +0100
+@@ -697,6 +697,8 @@
+ #ifndef AF_INET
+ # include <sys/socket.h>
+ #endif
++#include <string.h>
++#include <stdlib.h>
+ int main(void) {
+   struct addrinfo *ai, *pai, hints;
+ 
+#if HAVE_CRYPT
+--- php-7.2.34/Zend/Zend.m4.orig	2020-09-30 07:15:55.000000000 +0200
++++ php-7.2.34/Zend/Zend.m4	2025-01-24 20:27:19.468520028 +0100
+@@ -111,6 +111,7 @@
+ 
+ AC_TRY_RUN([
+ #include <limits.h>
++#include <stdlib.h>
+ 
+ int main()
+ {
+@@ -224,6 +225,7 @@
+ 
+ AC_TRY_RUN([
+ #include <stdio.h>
++#include <stdlib.h>
+ 
+ typedef union _mm_align_test {
+   void *ptr;
+@@ -321,6 +323,7 @@
+ #include <sys/mman.h>
+ #include <stdlib.h>
+ #include <stdio.h>
++#include <unistd.h>
+ #ifndef MAP_ANON
+ # ifdef MAP_ANONYMOUS
+ #  define MAP_ANON MAP_ANONYMOUS
+--- php-7.2.34/ext/standard/config.m4.orig	2020-09-30 07:15:50.000000000 +0200
++++ php-7.2.34/ext/standard/config.m4	2025-01-24 20:47:56.395667726 +0100
+@@ -7,6 +7,8 @@
+ AC_TRY_RUN( [
+ #include <stdio.h>
+ #include <stdlib.h>
++#include <string.h>
++#include <unistd.h>
+ 
+ int main(int argc, char **argv)
+ {
+@@ -68,6 +70,8 @@
+ #if HAVE_CRYPT_H
+ #include <crypt.h>
+ #endif
++#include <stdlib.h>
++#include <string.h>
+ 
+ int main() {
+ #if HAVE_CRYPT
+@@ -93,6 +97,8 @@
+ #if HAVE_CRYPT_H
+ #include <crypt.h>
+ #endif
++#include <stdlib.h>
++#include <string.h>
+ 
+ int main() {
+ #if HAVE_CRYPT
+@@ -118,6 +124,8 @@
+ #if HAVE_CRYPT_H
+ #include <crypt.h>
+ #endif
++#include <stdlib.h>
++#include <string.h>
+ 
+ int main() {
+ #if HAVE_CRYPT
+@@ -153,6 +161,8 @@
+ #if HAVE_CRYPT_H
+ #include <crypt.h>
+ #endif
++#include <stdlib.h>
++#include <string.h>
+ 
+ int main() {
+ #if HAVE_CRYPT
+@@ -185,6 +195,8 @@
+ #if HAVE_CRYPT_H
+ #include <crypt.h>
+ #endif
++#include <stdlib.h>
++#include <string.h>
+ 
+ int main() {
+ #if HAVE_CRYPT
+@@ -216,6 +228,8 @@
+ #if HAVE_CRYPT_H
+ #include <crypt.h>
+ #endif
++#include <stdlib.h>
++#include <string.h>
+ 
+ int main() {
+ #if HAVE_CRYPT
+--- php-7.2.34/Zend/acinclude.m4.orig	2020-09-30 07:15:55.000000000 +0200
++++ php-7.2.34/Zend/acinclude.m4	2025-01-24 20:51:32.443588605 +0100
+@@ -67,7 +67,10 @@
+ dnl
+ AC_DEFUN([AC_ZEND_BROKEN_SPRINTF],[
+   AC_CACHE_CHECK(whether sprintf is broken, ac_cv_broken_sprintf,[
+-    AC_TRY_RUN([main() {char buf[20];exit(sprintf(buf,"testing 123")!=11); }],[
++    AC_TRY_RUN([
++#include <stdio.h>
++#include <stdlib.h>
++int main() {char buf[20];exit(sprintf(buf,"testing 123")!=11); }],[
+       ac_cv_broken_sprintf=no
+     ],[
+       ac_cv_broken_sprintf=yes
diff --git a/readdir_r.patch b/readdir_r.patch
deleted file mode 100644
index 7164ffc..0000000
--- a/readdir_r.patch
+++ /dev/null
@@ -1,30 +0,0 @@
---- php-7.2.34/acinclude.m4.orig	2025-01-23 20:45:18.432571977 +0100
-+++ php-7.2.34/acinclude.m4	2025-01-23 20:54:20.252520613 +0100
-@@ -1349,12 +1349,13 @@
- #define _REENTRANT
- #include <sys/types.h>
- #include <dirent.h>
-+#include <stdlib.h>
- 
- #ifndef PATH_MAX
- #define PATH_MAX 1024
- #endif
- 
--main() {
-+int main() {
-   DIR *dir;
-   char entry[sizeof(struct dirent)+PATH_MAX];
-   struct dirent *pentry = (struct dirent *) &entry;
-@@ -1363,10 +1364,10 @@
-   if (!dir)
-     exit(1);
-   if (readdir_r(dir, (struct dirent *) entry, &pentry) == 0) {
--    close(dir);
-+    closedir(dir);
-     exit(0);
-   }
--  close(dir);
-+  closedir(dir);
-   exit(1);
- }
-     ],[
================================================================

---- gitweb:

http://git.pld-linux.org/gitweb.cgi/packages/php.git/commitdiff/ea527344ad1d621544ff9b4c1e42ef1383ce56f2



More information about the pld-cvs-commit mailing list