Florian Weimer 2022-12-12 10:41:49 +01:00
parent c8296376a7
commit 709b74898f
2 changed files with 74 additions and 2 deletions

68
pcp-configure-c99.patch Normal file
View File

@ -0,0 +1,68 @@
Avoid calling the undeclared exit function. Include <string.h> for
strcmp. Improves compatibility with future compilers which are likely
to reject implicit function declarations by default.
Submitted upstream:
<https://github.com/performancecopilot/pcp/pull/1727>
diff --git a/configure b/configure
index d8726f045b264191..f285191756825493 100755
--- a/configure
+++ b/configure
@@ -14409,7 +14409,7 @@ main ()
{
double x = 123.456;
- if (fpclassify(x) == FP_NAN) exit(1);
+ if (fpclassify(x) == FP_NAN) return 1;
;
return 0;
@@ -14438,7 +14438,7 @@ main ()
{
double x = 123.456;
- if (fpclassify(x) == FP_NAN) exit(1);
+ if (fpclassify(x) == FP_NAN) return 1;
;
return 0;
@@ -16433,6 +16433,7 @@ else
/* end confdefs.h. */
#include <time.h>
+#include <string.h>
int main () {
char b[32]="";
time_t t = time(NULL);
diff --git a/configure.ac b/configure.ac
index f12e652dd5e6f20e..4f737c78ff63e670 100644
--- a/configure.ac
+++ b/configure.ac
@@ -3097,7 +3097,7 @@ AC_TRY_LINK(
],
[
double x = 123.456;
- if (fpclassify(x) == FP_NAN) exit(1);
+ if (fpclassify(x) == FP_NAN) return 1;
], ac_cv_func_fpclassify=yes)
AC_MSG_RESULT($ac_cv_func_fpclassify)
if test $ac_cv_func_fpclassify = no
@@ -3112,7 +3112,7 @@ then
],
[
double x = 123.456;
- if (fpclassify(x) == FP_NAN) exit(1);
+ if (fpclassify(x) == FP_NAN) return 1;
], ac_cv_func_fpclassify=yes)
AC_MSG_RESULT($ac_cv_func_fpclassify)
if test $ac_cv_func_fpclassify = yes
@@ -3737,6 +3737,7 @@ AC_MSG_CHECKING([if strftime knows about %z])
AC_TRY_RUN(
[
#include <time.h>
+#include <string.h>
int main () {
char b[32]="";
time_t t = time(NULL);

View File

@ -1,12 +1,13 @@
Name: pcp
Version: 6.0.1
Release: 3%{?dist}
Release: 4%{?dist}
Summary: System-level performance monitoring and performance management
License: GPLv2+ and LGPLv2+ and CC-BY
URL: https://pcp.io
%global artifactory https://performancecopilot.jfrog.io/artifactory
Source0: %{artifactory}/pcp-source-release/pcp-%{version}.src.tar.gz
Patch0: pcp-configure-c99.patch
# The additional linker flags break out-of-tree PMDAs.
# https://bugzilla.redhat.com/show_bug.cgi?id=2043092
@ -2286,7 +2287,7 @@ updated policy package.
%prep
%setup -q
%autosetup -p1
%build
# the buildsubdir macro gets defined in %%setup and is apparently only available in the next step (i.e. the %%build step)
@ -3371,6 +3372,9 @@ fi
%files zeroconf -f pcp-zeroconf-files.rpm
%changelog
* Mon Dec 12 2022 Florian Weimer <fweimer@redhat.com> - 6.0.1-4
- Port configure script to C99
* Thu Nov 03 2022 Jiri Olsa <jolsa@kernel.org> - 6.0.1-3
- rebuilt for libbpf 1.0