Upgrade to Time-HiRes-1.85
[p5sagit/p5-mst-13.2.git] / ext / List / Util / Makefile.PL
index e2b7be9..48dccdb 100644 (file)
@@ -2,12 +2,22 @@ use ExtUtils::MakeMaker;
 
 WriteMakefile(
     VERSION_FROM    => "lib/List/Util.pm",
-    MAN3PODS    => {},  # Pods will be built by installman.
+    MAN3PODS        => {},  # Pods will be built by installman.
     NAME            => "List::Util",
+    DEFINE          => "-DPERL_EXT",
 );
 
 package MY;
 
+# We go through the ListUtil.c trickery to foil platforms
+# that have the feature combination of
+# (1) static builds
+# (2) allowing only one object by the same name in the static library
+# (3) the object name matching being case-blind
+# This means that we can't have the top-level util.o
+# and the extension-level Util.o in the same build.
+# One such platform is the POSIX-BC BS2000 EBCDIC mainframe platform.
+
 BEGIN {
     use Config;
     unless (defined $Config{usedl}) {
@@ -16,29 +26,19 @@ 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
+ListUtil.c:    Util.xs
+       $(PERL) -I$(PERL_ARCHLIB) -I$(PERL_LIB) $(XSUBPP) $(XSPROTOARG) $(XSUBPPARGS) Util.xs > ListUtil.xsc && $(MV) ListUtil.xsc ListUtil.c
 ';
 }
 
-sub c_o {
+sub xs_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)
+Util$(OBJ_EXT):        ListUtil.c
+       $(CCCMD) $(CCCDLFLAGS) -I$(PERL_INC) $(DEFINE) ListUtil.c
+       $(MV) ListUtil$(OBJ_EXT) Util$(OBJ_EXT)
 ';
 }