Description: pass through hardening flags to the build system
Origin: vendor
Forwarded: not-yet
Author: gregor herrmann <gregoa@debian.org>
Last-Update: 2013-06-18

--- a/inc/Module/Build/Scintilla.pm
+++ b/inc/Module/Build/Scintilla.pm
@@ -89,7 +89,9 @@ sub stc_linker {
 
 sub stc_ldflags {
 	my $self = shift;
-	return Alien::wxWidgets->link_flags;
+	my $flags = Alien::wxWidgets->link_flags;
+	$flags .= ' ' . $ENV{LDFLAGS};
+	return $flags;
 }
 
 sub stc_defines {
@@ -119,6 +121,7 @@ sub stc_ccflags {
 	my $flags   = qx($command);
 	chomp($flags);
 	$flags .= ' ' . Alien::wxWidgets->c_flags;
+	$flags .= ' ' . $ENV{CFLAGS} . ' ' . $ENV{CPPFLAGS};
 	return $flags;
 }
 
--- a/inc/Module/Build/Scintilla/GTK.pm
+++ b/inc/Module/Build/Scintilla/GTK.pm
@@ -124,6 +124,8 @@ sub stc_build_xs {
 		Alien::wxWidgets->defines,
 		$Config{ccflags},
 		$Config{optimize},
+		$ENV{CFLAGS},
+		$ENV{CPPFLAGS},
 		'-DWXPL_EXT -DVERSION=\"' . $dist_version . '\" -DXS_VERSION=\"' . $dist_version . '\"',
 		'Scintilla.c',
 	);
@@ -138,6 +140,7 @@ sub stc_link_xs {
 		Alien::wxWidgets->linker,
 		Alien::wxWidgets->link_flags,
 		$Config{lddlflags},
+		$ENV{LDFLAGS},
 		'-fPIC -L.',
 		'-s -o ' . $dll,
 		'Scintilla.o',
