Description: accept CFLAGS and CPPFLAGS from the environment
This is particularly useful for Debian, where the build system puts
various hardening flags in CFLAGS and CPPFLAGS
Author: Damyan Ivanov <dmn@debian.org>
Forwarded: https://github.com/DCIT/perl-CryptX/pull/39
Bug: https://github.com/DCIT/perl-CryptX/pull/39
--- a/Makefile.PL
+++ b/Makefile.PL
@@ -25,7 +25,7 @@ $mycflags =~ s/-Wwrite-strings\b//g;
$mycflags =~ s/-Wcast-qual\b//g;
#FIX: this is particularly useful for Debian https://github.com/DCIT/perl-CryptX/pull/39
-$mycflags = "$ENV{CFLAGS} $ENV{CPPFLAGS}" if $ENV{CFLAGS} || $ENV{CPPFLAGS};
+$mycflags .= " $ENV{CFLAGS}" if $ENV{CFLAGS};
#FIX: avoid "ar: fatal: Numeric group ID too large" see https://github.com/DCIT/perl-CryptX/issues/33
my $myarflags = '$(AR_STATIC_ARGS)';
--- a/src/Makefile
+++ b/src/Makefile
@@ -170,4 +170,4 @@ clean:
.SUFFIXES: .o .c
.c$(OBJ_EXT):
- $(CC) -Iltm -Iltc/headers -DLTC_SOURCE -DLTC_NO_TEST -DLTC_NO_PROTOTYPES -DLTM_DESC $(CFLAGS) -c $< -o $@
+ $(CC) -Iltm -Iltc/headers -DLTC_SOURCE -DLTC_NO_TEST -DLTC_NO_PROTOTYPES -DLTM_DESC $(CFLAGS) $(CPPFLAGS) -c $< -o $@