mirror of
https://github.com/macports/macports-ports.git
synced 2026-07-12 18:20:25 -07:00
- fix implicit function declarations Closes: https://trac.macports.org/ticket/73495 Closes: https://trac.macports.org/ticket/72916 Closes: https://trac.macports.org/ticket/73728
155 lines
5.1 KiB
Diff
155 lines
5.1 KiB
Diff
Fix implicit functions for EVP_CIPHER_CTX_cleanup and getgrent_r
|
|
|
|
From: https://github.com/dun/munge/commit/ede8c9b613f5fce0bedea4f9e71924f4920b9edf
|
|
From: https://github.com/dun/munge/commit/deb85536441ab28733e4d8f8a76e5a725afe8ecd
|
|
From: https://github.com/dun/munge/commit/9317fe8a7efe692d8c5547c3b5c83dacb2c26872
|
|
|
|
--- m4/x_ac_check_openssl.m4.orig 2026-02-10 03:07:53.000000000 -0500
|
|
+++ m4/x_ac_check_openssl.m4 2026-04-12 19:55:34.982749017 -0400
|
|
@@ -124,28 +124,34 @@
|
|
# and the <INCLUDES> are the prologue of the test source to be linked.
|
|
# The AC_LANG_PROGRAM #undef in the preamble is needed to thwart #define
|
|
# macros used for backwards-compatibility of deprecated functions.
|
|
+# This check only runs if AC_CHECK_FUNCS has determined the function exists
|
|
+# (i.e., ac_cv_func_<NAME> = yes), preventing implicit function declaration
|
|
+# warnings when testing non-existent functions.
|
|
#
|
|
AC_DEFUN([_X_AC_CHECK_OPENSSL_FUNC_RETURNS_INT], [
|
|
- AC_CACHE_CHECK(
|
|
- [if $1 returns int],
|
|
- [ac_cv_func_$1_returns_int], [
|
|
- AS_VAR_SET([ac_cv_func_$1_returns_int], no)
|
|
- AC_LINK_IFELSE([
|
|
- AC_LANG_PROGRAM(
|
|
- [[
|
|
+ AS_IF(
|
|
+ [test "AS_VAR_GET([ac_cv_func_$1])" = yes], [
|
|
+ AC_CACHE_CHECK(
|
|
+ [if $1 returns int],
|
|
+ [ac_cv_func_$1_returns_int], [
|
|
+ AS_VAR_SET([ac_cv_func_$1_returns_int], no)
|
|
+ AC_LINK_IFELSE([
|
|
+ AC_LANG_PROGRAM(
|
|
+ [[
|
|
$3
|
|
#undef $1
|
|
]],
|
|
- [[int rv = $1 ($2);]]
|
|
- )],
|
|
- AS_VAR_SET([ac_cv_func_$1_returns_int], yes),
|
|
- AS_VAR_SET([ac_cv_func_$1_returns_int], no)
|
|
- )]
|
|
- )
|
|
- AS_IF(
|
|
- [test AS_VAR_GET([ac_cv_func_$1_returns_int]) = yes],
|
|
- AC_DEFINE(AS_TR_CPP([HAVE_$1_RETURN_INT]), [1],
|
|
- [Define to 1 if the `$1' function returns int.]
|
|
+ [[int rv = $1 ($2);]]
|
|
+ )],
|
|
+ AS_VAR_SET([ac_cv_func_$1_returns_int], yes),
|
|
+ AS_VAR_SET([ac_cv_func_$1_returns_int], no)
|
|
+ )]
|
|
)
|
|
+ AS_IF(
|
|
+ [test AS_VAR_GET([ac_cv_func_$1_returns_int]) = yes],
|
|
+ AC_DEFINE(AS_TR_CPP([HAVE_$1_RETURN_INT]), [1],
|
|
+ [Define to 1 if the `$1' function returns int.]
|
|
+ )
|
|
+ )]
|
|
)]
|
|
)
|
|
--- m4/x_ac_getgrent.m4.orig 2026-02-10 03:07:53.000000000 -0500
|
|
+++ m4/x_ac_getgrent.m4 2026-04-12 19:57:35.898190342 -0400
|
|
@@ -18,17 +18,41 @@
|
|
|
|
AC_DEFUN([X_AC_GETGRENT], [
|
|
AC_CHECK_FUNCS(getgrent)
|
|
+ _X_AC_GETGRENT_CHECK_WNO_IMPLICIT
|
|
+ _x_ac_getgrent_cflags_save="${CFLAGS}"
|
|
+ _x_ac_getgrent_werror_save="${ac_c_werror_flag}"
|
|
+ CFLAGS="${CFLAGS} ${x_ac_getgrent_wno_implicit_flag}"
|
|
+ ac_c_werror_flag=yes
|
|
_X_AC_GETGRENT_R_AIX
|
|
_X_AC_GETGRENT_R_GNU
|
|
_X_AC_GETGRENT_R_SUN
|
|
+ CFLAGS="${_x_ac_getgrent_cflags_save}"
|
|
+ ac_c_werror_flag="${_x_ac_getgrent_werror_save}"
|
|
])
|
|
|
|
+AC_DEFUN([_X_AC_GETGRENT_CHECK_WNO_IMPLICIT], [
|
|
+ AC_MSG_CHECKING([if ${CC} supports -Wno-implicit-function-declaration])
|
|
+ _x_ac_getgrent_check_cflags_save="${CFLAGS}"
|
|
+ CFLAGS="${CFLAGS} -Wno-implicit-function-declaration -Werror"
|
|
+ AC_COMPILE_IFELSE(
|
|
+ [AC_LANG_PROGRAM()],
|
|
+ [ x_ac_getgrent_have_wno_implicit=yes
|
|
+ x_ac_getgrent_wno_implicit_flag="-Wno-implicit-function-declaration" ],
|
|
+ [ x_ac_getgrent_have_wno_implicit=no
|
|
+ x_ac_getgrent_wno_implicit_flag="" ]
|
|
+ )
|
|
+ CFLAGS="${_x_ac_getgrent_check_cflags_save}"
|
|
+ AS_IF(
|
|
+ [test "x${x_ac_getgrent_have_wno_implicit}" = xyes],
|
|
+ [AC_MSG_RESULT([yes])],
|
|
+ [AC_MSG_RESULT([no])]
|
|
+ )]
|
|
+)
|
|
+
|
|
AC_DEFUN([_X_AC_GETGRENT_R_AIX], [
|
|
AC_CACHE_CHECK(
|
|
[for getgrent_r (AIX)],
|
|
[x_ac_cv_have_getgrent_r_aix], [
|
|
- _x_ac_getgrent_r_aix_c_werror_flag="$ac_c_werror_flag"
|
|
- ac_c_werror_flag=yes
|
|
AC_LINK_IFELSE([
|
|
AC_LANG_PROGRAM([[
|
|
#define _THREAD_SAFE 1
|
|
@@ -44,8 +68,7 @@
|
|
)],
|
|
AS_VAR_SET(x_ac_cv_have_getgrent_r_aix, yes),
|
|
AS_VAR_SET(x_ac_cv_have_getgrent_r_aix, no)
|
|
- )
|
|
- ac_c_werror_flag="$_x_ac_getgrent_r_aix_c_werror_flag"]
|
|
+ )]
|
|
)
|
|
AS_IF([test AS_VAR_GET(x_ac_cv_have_getgrent_r_aix) = yes],
|
|
AC_DEFINE([HAVE_GETGRENT_R_AIX], [1],
|
|
@@ -58,8 +81,6 @@
|
|
AC_CACHE_CHECK(
|
|
[for getgrent_r (GNU)],
|
|
[x_ac_cv_have_getgrent_r_gnu], [
|
|
- _x_ac_getgrent_r_gnu_c_werror_flag="$ac_c_werror_flag"
|
|
- ac_c_werror_flag=yes
|
|
AC_LINK_IFELSE([
|
|
AC_LANG_PROGRAM([[
|
|
#define _GNU_SOURCE 1
|
|
@@ -73,8 +94,7 @@
|
|
)],
|
|
AS_VAR_SET(x_ac_cv_have_getgrent_r_gnu, yes),
|
|
AS_VAR_SET(x_ac_cv_have_getgrent_r_gnu, no)
|
|
- )
|
|
- ac_c_werror_flag="$_x_ac_getgrent_r_gnu_c_werror_flag"]
|
|
+ )]
|
|
)
|
|
AS_IF([test AS_VAR_GET(x_ac_cv_have_getgrent_r_gnu) = yes],
|
|
AC_DEFINE([HAVE_GETGRENT_R_GNU], [1],
|
|
@@ -87,8 +107,6 @@
|
|
AC_CACHE_CHECK(
|
|
[for getgrent_r (SunOS)],
|
|
[x_ac_cv_have_getgrent_r_sun], [
|
|
- _x_ac_getgrent_r_sun_c_werror_flag="$ac_c_werror_flag"
|
|
- ac_c_werror_flag=yes
|
|
AC_LINK_IFELSE([
|
|
AC_LANG_PROGRAM([[
|
|
#include <grp.h>
|
|
@@ -100,8 +118,7 @@
|
|
)],
|
|
AS_VAR_SET(x_ac_cv_have_getgrent_r_sun, yes),
|
|
AS_VAR_SET(x_ac_cv_have_getgrent_r_sun, no)
|
|
- )
|
|
- ac_c_werror_flag="$_x_ac_getgrent_r_sun_c_werror_flag"]
|
|
+ )]
|
|
)
|
|
AS_IF([test AS_VAR_GET(x_ac_cv_have_getgrent_r_sun) = yes],
|
|
AC_DEFINE([HAVE_GETGRENT_R_SUN], [1],
|