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
@@ -12,6 +12,7 @@ my @myobjs = map { s|.c$|$Config{obj_ext
);
my $myextlib = "src/liballinone$Config{lib_ext}";
my $mycflags = "$Config{ccflags} $Config{cccdlflags} $Config{optimize}";
+$mycflags .= " $ENV{CFLAGS}" if $ENV{CFLAGS};
#FIX: gcc with -flto is a trouble maker see https://github.com/DCIT/perl-CryptX/issues/32
$mycflags =~ s/-flto\b//g;
--- a/src/Makefile
+++ b/src/Makefile
@@ -167,4 +167,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 $@