perlmod: global knob to disable comment stripping modules

Certain strings are misinterpreted as comments by perlmod.mk and removed
when they shouldn't be (in particular, perl-cgi).  Enable this whenever
you have sufficient flash space.

Globally, CONFIG_PERL_NOCOMMENT=y (default) causes comments to be stripped
as before.  However, a package (like perl-cgi) can override this with
PKG_LEAVE_COMMENTS=1.

Signed-off-by: Philip Prindeville <philipp@redfish-solutions.com>
This commit is contained in:
Philip Prindeville
2017-01-02 22:55:17 -07:00
parent afda05e417
commit 785b67a27e
3 changed files with 21 additions and 5 deletions
+7 -3
View File
@@ -129,9 +129,7 @@ define perlmod/Install/NoStrip
endef
define perlmod/Install
$(call perlmod/Install/NoStrip,$(1),$(2),$(3))
define perlmod/_DoStrip
@echo "---> Stripping modules in: $(strip $(1))$(PERL_SITELIB)"
find $(strip $(1))$(PERL_SITELIB) -name \*.pm -or -name \*.pl | \
xargs -r sed -i \
@@ -141,6 +139,12 @@ define perlmod/Install
-e '/^#[^!"'"'"']/d'
endef
define perlmod/Install
$(call perlmod/Install/NoStrip,$(1),$(2),$(3))
$(if $(CONFIG_PERL_NOCOMMENT),$(if $(PKG_LEAVE_COMMENTS),,$(call perlmod/_DoStrip,$(1),$(2),$(3))))
endef
# You probably don't want to use this directly. Look at perlmod/InstallTests
define perlmod/_InstallTests
$(INSTALL_DIR) $(strip $(1))