From: Jarkko Hietaniemi Date: Wed, 6 Jun 2001 11:42:10 +0000 (+0000) Subject: MakeMaker magic to compile (when no dynamic loading) X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=376b1d05dbf171472c0619bf63fc51913b729360;p=p5sagit%2Fp5-mst-13.2.git 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 --- diff --git a/ext/List/Util/Makefile.PL b/ext/List/Util/Makefile.PL index 079437b..bc6dff6 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__ + } +}