Subject: | Makefile.PL ignores Perl CCFLAGS |
Makefile.PL added "CCFLAGS => '-Wall'". That lost Perl compiler flags and that can make the XS module incompatible to the interpreter. An example is when Perl is built with 64-bit intetegers on 32-bit platform or when Perl is built with large file support. An attached patch fixes it./
Subject: | Image-Sane-2-Respect-Perl-CCFLAGS.patch |
From 91baf50f2924acd3930bedf6b047e3f143311b30 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Petr=20P=C3=ADsa=C5=99?= <ppisar@redhat.com>
Date: Tue, 10 Sep 2019 09:15:31 +0200
Subject: [PATCH] Respect Perl CCFLAGS
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Makefile.PL CCFLAGS defaults to $Config{ccflags}. If Makefile.PL
redefines them, it must copy the value. Compiler flags influence ABI
and missing them could make the XS module incompatible to the Perl
interpreter.
Signed-off-by: Petr PÃsaÅ <ppisar@redhat.com>
---
Makefile.PL | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/Makefile.PL b/Makefile.PL
index 1912ea4..f49b283 100644
--- a/Makefile.PL
+++ b/Makefile.PL
@@ -3,6 +3,7 @@ use ExtUtils::MakeMaker;
use ExtUtils::Depends;
use ExtUtils::PkgConfig;
use English;
+use Config;
# minimum required version of dependancies we need to build
our %build_reqs = ( 'libsane' => '1.0.19', );
@@ -33,6 +34,7 @@ WriteMakefile(
VERSION_FROM => 'lib/Image/Sane.pm', # finds $VERSION
PREREQ_PM => { Readonly => 0, Exception::Class => 0 },
CONFIGURE_REQUIRES => {
+ Config => 0,
ExtUtils::Depends => 0,
ExtUtils::PkgConfig => 0
},
@@ -56,7 +58,7 @@ WriteMakefile(
: ()
),
LIBS => [$lib], # e.g., '-lm'
- CCFLAGS => '-Wall',
+ CCFLAGS => "$Config{ccflags} -Wall",
DEFINE => '', # e.g., '-DHAVE_SOMETHING'
INC => $inc, # e.g., '-I. -I/usr/include/other'
# Un-comment this if you add C files to link with later:
--
2.21.0