summaryrefslogtreecommitdiff
path: root/ext/List/Util/Makefile.PL
diff options
context:
space:
mode:
Diffstat (limited to 'ext/List/Util/Makefile.PL')
-rw-r--r--ext/List/Util/Makefile.PL39
1 files changed, 39 insertions, 0 deletions
diff --git a/ext/List/Util/Makefile.PL b/ext/List/Util/Makefile.PL
index 079437b750..bc6dff608d 100644
--- a/ext/List/Util/Makefile.PL
+++ b/ext/List/Util/Makefile.PL
@@ -5,3 +5,42 @@ WriteMakefile(
NAME => "List::Util",
);
+package MY;
+
+BEGIN {
+ use Config;
+ unless (defined $Config{usedl}) {
+ eval <<'__EOMM__';
+sub xs_c {
+ my($self) = shift;
+ return '' unless $self->needs_linking();
+'
+.xs.c:
+ $(PERL) -I$(PERL_ARCHLIB) -I$(PERL_LIB) $(XSUBPP) $(XSPROTOARG) $(XSUBPPARGS) $*.xs > List$*.xsc && $(MV) List$*.xsc List$*.c
+';
+}
+
+sub c_o {
+ my($self) = shift;
+ return '' unless $self->needs_linking();
+'
+.c$(OBJ_EXT):
+ $(CCCMD) $(CCCDLFLAGS) -I$(PERL_INC) $(DEFINE) List$*.c
+ $(MV) List$*$(OBJ_EXT) $*$(OBJ_EXT)
+';
+}
+
+sub xs_o { # many makes are too dumb to use xs_c then c_o
+ my($self) = shift;
+ return '' unless $self->needs_linking();
+'
+.xs$(OBJ_EXT):
+ $(PERL) -I$(PERL_ARCHLIB) -I$(PERL_LIB) $(XSUBPP) $(XSPROTOARG) $(XSUBPPARGS) $*.xs > List$*.xsc && $(MV) List$*.xsc List$*.c
+ $(CCCMD) $(CCCDLFLAGS) -I$(PERL_INC) $(DEFINE) List$*.c
+ $(MV) List$*$(OBJ_EXT) $*$(OBJ_EXT)
+';
+}
+
+__EOMM__
+ }
+}