summaryrefslogtreecommitdiff
path: root/ext/List
diff options
context:
space:
mode:
authorJarkko Hietaniemi <jhi@iki.fi>2001-06-06 11:42:10 +0000
committerJarkko Hietaniemi <jhi@iki.fi>2001-06-06 11:42:10 +0000
commit376b1d05dbf171472c0619bf63fc51913b729360 (patch)
treef220bd223303e11ad172b0ce078ecd708e4aa42d /ext/List
parent2090ab20212398e485f20cd7e50303dcd3601be7 (diff)
downloadperl-376b1d05dbf171472c0619bf63fc51913b729360.tar.gz
MakeMaker magic to compile (when no dynamic loading)
List/Util.xsc as (ListUtil.c and) ListUtil.o since POSIX-BC (BS2000) linker has an evil limitation of being unable to include in the same executable several object files with the same name - case-insensitively - because otherwise we conflict with util.c. Strictly speaking currently required only in POSIX-BC but probably will do no harm elsewhere where static linking is required. p4raw-id: //depot/perl@10453
Diffstat (limited to 'ext/List')
-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__
+ }
+}