From c079ae3eb0e518954e990482a9e2c4ca588160ab Mon Sep 17 00:00:00 2001 From: Florian Weimer Date: Dec 23 2022 20:22:35 +0000 Subject: C99 compatibility fixes for the configure script Related to: --- diff --git a/emacs-configure-c99-1.patch b/emacs-configure-c99-1.patch new file mode 100644 index 0000000..7e257a8 --- /dev/null +++ b/emacs-configure-c99-1.patch @@ -0,0 +1,51 @@ +Remove obsolete a.out linker test. It contains an implicit +function declaration, leading to false positives. + +Submitted upstream: + + + +diff --git a/configure.ac b/configure.ac +index 660784347bbc0dcd..cc390d40b33a1d8f 100644 +--- a/configure.ac ++++ b/configure.ac +@@ -2493,39 +2493,6 @@ if test "${HAVE_X11}" = "yes"; then + export LD_RUN_PATH + fi + +- if test "${opsys}" = "gnu-linux"; then +- AC_CACHE_CHECK([whether X on GNU/Linux needs -b to link], [emacs_cv_b_link], +- [AC_LINK_IFELSE([AC_LANG_PROGRAM([[]], +- [[XOpenDisplay ("foo");]])], +- [xgnu_linux_first_failure=no], +- [xgnu_linux_first_failure=yes]) +- if test "${xgnu_linux_first_failure}" = "yes"; then +- OLD_CPPFLAGS="$CPPFLAGS" +- OLD_LIBS="$LIBS" +- CPPFLAGS="$CPPFLAGS -b i486-linuxaout" +- LIBS="$LIBS -b i486-linuxaout" +- AC_LINK_IFELSE([AC_LANG_PROGRAM([[]], +- [[XOpenDisplay ("foo");]])], +- [xgnu_linux_second_failure=no], +- [xgnu_linux_second_failure=yes]) +- if test "${xgnu_linux_second_failure}" = "yes"; then +- # If we get the same failure with -b, there is no use adding -b. +- # So leave it out. This plays safe. +- emacs_cv_b_link=no +- else +- emacs_cv_b_link=yes +- fi +- CPPFLAGS=$OLD_CPPFLAGS +- LIBS=$OLD_LIBS +- else +- emacs_cv_b_link=no +- fi]) +- if test "x$emacs_cv_b_link" = xyes ; then +- LD_SWITCH_X_SITE="$LD_SWITCH_X_SITE -b i486-linuxaout" +- C_SWITCH_X_SITE="$C_SWITCH_X_SITE -b i486-linuxaout" +- fi +- fi +- + # Reportedly, some broken Solaris systems have XKBlib.h but are missing + # header files included from there. + AC_CACHE_CHECK([for Xkb], [emacs_cv_xkb], diff --git a/emacs-configure-c99-2.patch b/emacs-configure-c99-2.patch new file mode 100644 index 0000000..7c64540 --- /dev/null +++ b/emacs-configure-c99-2.patch @@ -0,0 +1,19 @@ +Avoid an implicit declaration of the malloc function. Improves C99 +compatibility. + +Submitted upstream: + + + +diff --git a/configure.ac b/configure.ac +index cc390d40b33a1d8f..7be08de740cfc486 100644 +--- a/configure.ac ++++ b/configure.ac +@@ -4590,6 +4590,7 @@ AC_CACHE_CHECK([whether signals can be handled on alternate stack], + [emacs_cv_alternate_stack], + [AC_COMPILE_IFELSE( + [AC_LANG_PROGRAM([[#include ++ #include + ]], + [[stack_t ss; + struct sigaction sa; diff --git a/emacs.spec b/emacs.spec index 985940c..e910ae2 100644 --- a/emacs.spec +++ b/emacs.spec @@ -5,7 +5,7 @@ Summary: GNU Emacs text editor Name: emacs Epoch: 1 Version: 28.1 -Release: 3%{?dist} +Release: 4%{?dist} License: GPLv3+ and CC0 URL: http://www.gnu.org/software/emacs/ Source0: https://ftp.gnu.org/gnu/emacs/emacs-%{version}.tar.xz @@ -25,6 +25,8 @@ Patch1: emacs-spellchecker.patch Patch2: emacs-system-crypto-policies.patch Patch3: emacs-libdir-vs-systemd.patch Patch4: emacs-pdmp-fingerprint.patch +Patch5: emacs-configure-c99-1.patch +Patch6: emacs-configure-c99-2.patch BuildRequires: gcc BuildRequires: atk-devel @@ -205,6 +207,8 @@ cp -p %{SOURCE3} lib/ %patch2 -p1 -b .system-crypto-policies %patch3 -p1 -b .libdir-vs-systemd %patch4 -p1 -b .pdmp-fingerprint +%patch5 -p1 +%patch6 -p1 autoconf grep -v "tetris.elc" lisp/Makefile.in > lisp/Makefile.in.new \ @@ -512,6 +516,9 @@ desktop-file-validate %{buildroot}/%{_datadir}/applications/*.desktop %{_includedir}/emacs-module.h %changelog +* Fri Dec 23 2022 Florian Weimer - 1:28.1-4 +- C99 compatibility fixes for the configure script + * Thu Jul 21 2022 Fedora Release Engineering - 1:28.1-3 - Rebuilt for https://fedoraproject.org/wiki/Fedora_37_Mass_Rebuild