From 9c9e04569d219015a112d4821cb73cadc0736c69 Mon Sep 17 00:00:00 2001 From: Florian Weimer Date: Fri, 13 Jan 2023 17:37:40 +0100 Subject: [PATCH] Port configure script to C99 Related to: --- jq-configure-c99-1.patch | 19 +++++++++++++++++++ jq-configure-c99-2.patch | 18 ++++++++++++++++++ jq.spec | 7 ++++++- 3 files changed, 43 insertions(+), 1 deletion(-) create mode 100644 jq-configure-c99-1.patch create mode 100644 jq-configure-c99-2.patch diff --git a/jq-configure-c99-1.patch b/jq-configure-c99-1.patch new file mode 100644 index 0000000..96e753a --- /dev/null +++ b/jq-configure-c99-1.patch @@ -0,0 +1,19 @@ +Use AC_USE_SYSTEM_EXTENSIONS to build with _GNU_SOURCE (and similar +macros on non-GNU systems), to avoid an implicit declaration of the +strptime function. This improves compatibility with future compilers +which do not support implicit function declarations. + +Submitted upstream: + +diff --git a/configure.ac b/configure.ac +index 21628bfd5fe99485..ccd494ad7c365839 100644 +--- a/configure.ac ++++ b/configure.ac +@@ -19,6 +19,7 @@ AC_PROG_CPP_WERROR + AC_PROG_YACC + AC_OBJEXT + AC_EXEEXT ++AC_USE_SYSTEM_EXTENSIONS + LT_INIT([shared static win32-dll]) + AM_PROG_CC_C_O + diff --git a/jq-configure-c99-2.patch b/jq-configure-c99-2.patch new file mode 100644 index 0000000..718565f --- /dev/null +++ b/jq-configure-c99-2.patch @@ -0,0 +1,18 @@ +The gettimeofday function is declared in , not , +according to POSIX and actual systems. + +Submitted upstream: + +diff --git a/configure.ac b/configure.ac +index ccd494ad7c365839..c3edaa32756b807c 100644 +--- a/configure.ac ++++ b/configure.ac +@@ -135,7 +135,7 @@ AC_FIND_FUNC([gmtime_r], [c], [#include ], [0, 0]) + AC_FIND_FUNC([gmtime], [c], [#include ], [0]) + AC_FIND_FUNC([localtime_r], [c], [#include ], [0, 0]) + AC_FIND_FUNC([localtime], [c], [#include ], [0]) +-AC_FIND_FUNC([gettimeofday], [c], [#include ], [0, 0]) ++AC_FIND_FUNC([gettimeofday], [c], [#include ], [0, 0]) + AC_CHECK_MEMBER([struct tm.tm_gmtoff], [AC_DEFINE([HAVE_TM_TM_GMT_OFF],1,[Define to 1 if the system has the tm_gmt_off field in struct tm])], + [], [[#include ]]) + AC_CHECK_MEMBER([struct tm.__tm_gmtoff], [AC_DEFINE([HAVE_TM___TM_GMT_OFF],1,[Define to 1 if the system has the __tm_gmt_off field in struct tm])], diff --git a/jq.spec b/jq.spec index b29aaf1..e08f6d0 100644 --- a/jq.spec +++ b/jq.spec @@ -1,6 +1,6 @@ Name: jq Version: 1.6 -Release: 14%{?dist} +Release: 15%{?dist} Summary: Command-line JSON processor License: MIT and ASL 2.0 and CC-BY and GPLv3 @@ -10,6 +10,8 @@ Source0: https://github.com/stedolan/jq/releases/download/%{name}-%{versi Patch0: jq-decimal-literal-number.patch # Backport of PR#2400 for RHBZ#2017285 Patch1: jq-fix-non-decimal-string.patch +Patch2: jq-configure-c99-1.patch +Patch3: jq-configure-c99-2.patch BuildRequires: gcc BuildRequires: flex @@ -103,6 +105,9 @@ make check %changelog +* Fri Jan 13 2023 Florian Weimer - 1.6-15 +- Port configure script to C99 + * Thu Jul 21 2022 Fedora Release Engineering - 1.6-14 - Rebuilt for https://fedoraproject.org/wiki/Fedora_37_Mass_Rebuild