Port Configure script to C99
Related to: <https://fedoraproject.org/wiki/Changes/PortingToModernC> <https://fedoraproject.org/wiki/Toolchain/PortingToModernC>
This commit is contained in:
parent
0a669179f7
commit
f509e07f88
94
perl-configure-c99.patch
Normal file
94
perl-configure-c99.patch
Normal file
@ -0,0 +1,94 @@
|
|||||||
|
Avoid implicit ints and implicit function declarations, for improved
|
||||||
|
compatibility with future compilers which will reject them by default.
|
||||||
|
|
||||||
|
Submitted upstream: <https://github.com/Perl/perl5/pull/20718>
|
||||||
|
|
||||||
|
diff --git a/Configure b/Configure
|
||||||
|
index 9bd6a7ad9465c2ce..75c090edc37015da 100755
|
||||||
|
--- a/Configure
|
||||||
|
+++ b/Configure
|
||||||
|
@@ -4638,7 +4638,7 @@ esac
|
||||||
|
# so we will take those off from locincpth.
|
||||||
|
case "$gccversion" in
|
||||||
|
3.*)
|
||||||
|
- echo "main(){}">try.c
|
||||||
|
+ echo "int main(){}">try.c
|
||||||
|
for incdir in $locincpth; do
|
||||||
|
warn=`$cc $ccflags -I$incdir -c try.c 2>&1 | \
|
||||||
|
grep '^c[cp]p*[01]: warning: changing search order '`
|
||||||
|
@@ -5771,6 +5771,7 @@ case "$intsize" in
|
||||||
|
#ifdef I_STDLIB
|
||||||
|
#include <stdlib.h>
|
||||||
|
#endif
|
||||||
|
+#include <stdio.h>
|
||||||
|
int main()
|
||||||
|
{
|
||||||
|
printf("intsize=%d;\n", (int)sizeof(int));
|
||||||
|
@@ -6844,6 +6845,7 @@ case "$doublesize" in
|
||||||
|
#ifdef I_STDLIB
|
||||||
|
#include <stdlib.h>
|
||||||
|
#endif
|
||||||
|
+#include <stdio.h>
|
||||||
|
int main()
|
||||||
|
{
|
||||||
|
printf("%d\n", (int)sizeof(double));
|
||||||
|
@@ -12606,7 +12608,7 @@ case "$dlsrc" in
|
||||||
|
dl_dlopen.xs)
|
||||||
|
echo "Checking whether your dlsym() needs a leading underscore ..." >&4
|
||||||
|
$cat >dyna.c <<'EOM'
|
||||||
|
-fred () { }
|
||||||
|
+void fred (void) { }
|
||||||
|
EOM
|
||||||
|
|
||||||
|
$cat >fred.c<<EOM
|
||||||
|
@@ -12625,7 +12627,7 @@ $cat >fred.c<<EOM
|
||||||
|
#include <link.h>
|
||||||
|
#endif
|
||||||
|
|
||||||
|
-extern int fred() ;
|
||||||
|
+extern void fred(void) ;
|
||||||
|
|
||||||
|
int main()
|
||||||
|
{
|
||||||
|
@@ -13659,6 +13661,7 @@ $cat >try.c <<EOP
|
||||||
|
#ifdef I_STDLIB
|
||||||
|
#include <stdlib.h>
|
||||||
|
#endif
|
||||||
|
+#include <string.h>
|
||||||
|
#define FILE_ptr(fp) $stdio_ptr
|
||||||
|
#define FILE_cnt(fp) $stdio_cnt
|
||||||
|
int main() {
|
||||||
|
@@ -16166,6 +16169,7 @@ echo "Checking to see if your libm supports _LIB_VERSION..." >&4
|
||||||
|
$cat >try.c <<EOCP
|
||||||
|
#include <unistd.h>
|
||||||
|
#include <math.h>
|
||||||
|
+#include <stdio.h>
|
||||||
|
int main (int argc, char *argv[])
|
||||||
|
{
|
||||||
|
printf ("%d\n", _LIB_VERSION);
|
||||||
|
@@ -22063,13 +22067,15 @@ pager="$ans"
|
||||||
|
: see if ar generates random libraries by itself
|
||||||
|
echo " "
|
||||||
|
echo "Checking how to generate random libraries on your machine..." >&4
|
||||||
|
-echo 'int bar1() { return bar2(); }' > bar1.c
|
||||||
|
+echo 'extern int bar2(); int bar1() { return bar2(); }' > bar1.c
|
||||||
|
echo 'int bar2() { return 2; }' > bar2.c
|
||||||
|
$cat > foo.c <<EOP
|
||||||
|
#$i_stdlib I_STDLIB
|
||||||
|
#ifdef I_STDLIB
|
||||||
|
#include <stdlib.h>
|
||||||
|
#endif
|
||||||
|
+#include <stdio.h>
|
||||||
|
+extern int bar1();
|
||||||
|
int main() { printf("%d\n", bar1()); exit(0); }
|
||||||
|
EOP
|
||||||
|
$cc $ccflags -c bar1.c >/dev/null 2>&1
|
||||||
|
@@ -22295,7 +22301,7 @@ EOM
|
||||||
|
for nfd in 'int' 'size_t' 'unsigned long' 'unsigned' ; do
|
||||||
|
for tmo in 'struct timeval *' 'const struct timeval *'; do
|
||||||
|
case "$val" in
|
||||||
|
- '') try="$extern_C select _(($nfd, $xxx, $xxx, $xxx, $tmo));"
|
||||||
|
+ '') try="$extern_C int select _(($nfd, $xxx, $xxx, $xxx, $tmo));"
|
||||||
|
if ./protochk "$try" $hdrs; then
|
||||||
|
echo "Your system accepts $xxx."
|
||||||
|
val="$xxx"
|
@ -104,7 +104,7 @@ License: GPL+ or Artistic
|
|||||||
Epoch: %{perl_epoch}
|
Epoch: %{perl_epoch}
|
||||||
Version: %{perl_version}
|
Version: %{perl_version}
|
||||||
# release number must be even higher, because dual-lived modules will be broken otherwise
|
# release number must be even higher, because dual-lived modules will be broken otherwise
|
||||||
Release: 493%{?dist}
|
Release: 494%{?dist}
|
||||||
Summary: Practical Extraction and Report Language
|
Summary: Practical Extraction and Report Language
|
||||||
Url: https://www.perl.org/
|
Url: https://www.perl.org/
|
||||||
Source0: https://www.cpan.org/src/5.0/perl-%{perl_version}.tar.xz
|
Source0: https://www.cpan.org/src/5.0/perl-%{perl_version}.tar.xz
|
||||||
@ -176,6 +176,7 @@ Patch201: perl-5.16.3-Link-XS-modules-to-libperl.so-with-EU-MM-on-Linux.pa
|
|||||||
|
|
||||||
# If optimizing -O is used, add the definition to .ph files, bug #2152012
|
# If optimizing -O is used, add the definition to .ph files, bug #2152012
|
||||||
Patch202: perl-5.36.0-Add-definition-of-OPTIMIZE-to-.ph-files.patch
|
Patch202: perl-5.36.0-Add-definition-of-OPTIMIZE-to-.ph-files.patch
|
||||||
|
Patch203: perl-configure-c99.patch
|
||||||
|
|
||||||
# Update some of the bundled modules
|
# Update some of the bundled modules
|
||||||
# see http://fedoraproject.org/wiki/Perl/perl.spec for instructions
|
# see http://fedoraproject.org/wiki/Perl/perl.spec for instructions
|
||||||
@ -4199,6 +4200,7 @@ you're not running VMS, this module does nothing.
|
|||||||
%patch200 -p1
|
%patch200 -p1
|
||||||
%patch201 -p1
|
%patch201 -p1
|
||||||
%patch202 -p1
|
%patch202 -p1
|
||||||
|
%patch203 -p1
|
||||||
|
|
||||||
%if !%{defined perl_bootstrap}
|
%if !%{defined perl_bootstrap}
|
||||||
# Local patch tracking
|
# Local patch tracking
|
||||||
@ -7003,6 +7005,9 @@ popd
|
|||||||
|
|
||||||
# Old changelog entries are preserved in CVS.
|
# Old changelog entries are preserved in CVS.
|
||||||
%changelog
|
%changelog
|
||||||
|
* Tue Jan 17 2023 Florian Weimer <fweimer@redhat.com> - 4:5.36.0-494
|
||||||
|
- Port Configure script to C99
|
||||||
|
|
||||||
* Tue Jan 10 2023 Jitka Plesnikova <jplesnik@redhat.com> - 4:5.36.0-493
|
* Tue Jan 10 2023 Jitka Plesnikova <jplesnik@redhat.com> - 4:5.36.0-493
|
||||||
- Add definition of OPTIMIZE to .ph files, if optimizing is used
|
- Add definition of OPTIMIZE to .ph files, if optimizing is used
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user