Sorry for the delay, but here is a revised patch to detect perldoc.

- If Perldoc is detected, no warning messages will be printed and things will work as before
- If Perldoc is not detected
- Configure.pl will print a message saying that the docs will not be built
- docs/ will not be built
- When 'make docs' or 'make html' is run, a message will be echoed to the screen explaining that perldoc is required.


James

Leopold Toetsch wrote:

Nicholas Clark <[EMAIL PROTECTED]> wrote:



I don't like the build blowing up on me when there is no perldoc, and on
some machines that I use I'm not in a position to change this.



So, as opinions aren't really matching, let's try this approach:

The configure step from that patch doesn't bail out, but prints a big
fat warning about the lack of accessing perl and parrot docs, disables
the parrot doc make target and continues.



Nicholas Clark



leo



--- config_o2/auto/perldoc.pl	1969-12-31 19:00:00.000000000 -0500
+++ config/auto/perldoc.pl	2004-11-18 22:02:39.000000000 -0500
@@ -0,0 +1,36 @@
+#! perl -w
+# Copyright: 2001-2004 The Perl Foundation.  All Rights Reserved.
+
+=head1 NAME
+
+config/auto/perldoc - Perldoc
+
+=head1 DESCRIPTION
+
+Determines if Perldoc exists on the system.
+
+=cut
+
+package Configure::Step;
+
+use strict;
+use vars qw($description @args);
+use Parrot::Configure::Step ':auto';
+
+$description="Determining if your system has perldoc installed...";
+
[EMAIL PROTECTED](verbose);
+
+sub runstep {
+    
+    my $a = `perldoc perldoc`;
+    unless ($a =~ m/perldoc/) {
+	Configure::Data->set(perldoc => 0);
+	Configure::Data->set(notperldoc => 1);
+    } else {
+        Configure::Data->set(perldoc => 1);
+	Configure::Data->set(notperldoc => 0);
+    }
+}
+
+1;
? .MANIFEST.swp
? .Makefile.swp
? .config_perldoc.patch.swp
? config/auto/.headers.pl.swp
? config/auto/.perldoc.pl.swp
? config/auto/perldoc.pl
? config/gen/.makefiles.pl.swp
? config/gen/makefiles/.root.in.swp
? docs/.Makefile.swp
? icu/source/test/testdata/out
? lib/Parrot/Configure/.Step.pm.swp
? tools/dev/.install_files.pl.swp
Index: MANIFEST
===================================================================
RCS file: /cvs/public/parrot/MANIFEST,v
retrieving revision 1.772
diff -u -r1.772 MANIFEST
--- MANIFEST	18 Nov 2004 07:01:10 -0000	1.772
+++ MANIFEST	19 Nov 2004 21:34:56 -0000
@@ -158,6 +158,7 @@
 config/auto/memalign/test_c.in                    []
 config/auto/memalign/test_c2.in                   []
 config/auto/pack.pl                               []
+config/auto/perldoc.pl                            []
 config/auto/signal.pl                             []
 config/auto/signal/test_1.in                      []
 config/auto/signal/test_2.in                      []
Index: config/gen/makefiles.pl
===================================================================
RCS file: /cvs/public/parrot/config/gen/makefiles.pl,v
retrieving revision 1.36
diff -u -r1.36 makefiles.pl
--- config/gen/makefiles.pl	13 Sep 2004 05:25:51 -0000	1.36
+++ config/gen/makefiles.pl	19 Nov 2004 21:34:56 -0000
@@ -88,34 +88,39 @@
   genfile('config/gen/makefiles/parrot_compiler.in', 'languages/parrot_compiler/Makefile',
           commentType => '#', replace_slashes => 1);
 
-
-  # set up docs/Makefile, partly based on the .ops in the root dir
-
-  opendir OPS, "ops" or die "opendir ops: $!";
-  my @ops = sort grep { !/^\./ && /\.ops$/ } readdir OPS;
-  closedir OPS;
-
-  my $pod = join " ", map { my $t = $_; $t =~ s/\.ops$/.pod/; "ops/$t" } @ops;
-
-  Configure::Data->set(pod => $pod);
-
-  genfile('config/gen/makefiles/docs.in',      'docs/Makefile',
-          commentType => '#');
-
-  Configure::Data->set(pod => undef);
-
-  open MAKEFILE, ">> docs/Makefile" or die "open >> docs/Makefile: $!";
-
-  foreach my $ops (@ops) {
-      my $pod = $ops;
-      $pod =~ s/\.ops$/.pod/;
-      print MAKEFILE <<"EOM";
+  my $perldoc = Configure::Data->get('perldoc');
+  if ($perldoc) {
+    # set up docs/Makefile, partly based on the .ops in the root dir
+  
+    opendir OPS, "ops" or die "opendir ops: $!";
+    my @ops = sort grep { !/^\./ && /\.ops$/ } readdir OPS;
+    closedir OPS;
+  
+    my $pod = join " ", map { my $t = $_; $t =~ s/\.ops$/.pod/; "ops/$t" } @ops;
+  
+    Configure::Data->set(pod => $pod);
+  
+    genfile('config/gen/makefiles/docs.in',      'docs/Makefile',
+            commentType => '#');
+  
+    Configure::Data->set(pod => undef);
+  
+    open MAKEFILE, ">> docs/Makefile" or die "open >> docs/Makefile: $!";
+  
+    foreach my $ops (@ops) {
+        my $pod = $ops;
+        $pod =~ s/\.ops$/.pod/;
+        print MAKEFILE <<"EOM";
 ops/$pod: ../ops/$ops
 	perldoc -u ../ops/$ops > ops/$pod
-EOM
-  }
 
-  close MAKEFILE
+EOM
+    }
+  
+    close MAKEFILE
+    } else {
+        print "\nNo Perldoc, not generating a docs makefile.\n";
+    }
 }
 
 1;
Index: config/gen/makefiles/root.in
===================================================================
RCS file: /cvs/public/parrot/config/gen/makefiles/root.in,v
retrieving revision 1.261
diff -u -r1.261 root.in
--- config/gen/makefiles/root.in	15 Nov 2004 02:38:10 -0000	1.261
+++ config/gen/makefiles/root.in	19 Nov 2004 21:35:04 -0000
@@ -93,7 +93,7 @@
 GEN_MAKEFILES = \
     Makefile \
     languages/Makefile \
-    docs/Makefile \
+#CONDITIONED_LINE(perldoc):    docs/Makefile \
     dynclasses/Makefile \
     dynoplibs/Makefile \
     languages/cola/Makefile \
@@ -988,15 +988,25 @@
 #
 ###############################################################################
 
-docs : docs.dummy
+#CONDITIONED_LINE(perldoc):docs : docs.dummy
+#CONDITIONED_LINE(notperldoc):docs : docs.stub
 
+#CONDITIONED_LINE(perldoc):html : html.dummy
+#CONDITIONED_LINE(notperldoc):html : html.stub
+
+html.stub:
+	echo "Perldoc is required, but not detected."
+
+docs.stub:
+	echo "Perldoc is required, but not detected."
+	
 docs.dummy :
 	$(MAKE_C) docs
 
 docs-clean :
 	$(MAKE_C) docs clean
 
-html :
+html.dummy :
 	$(MAKE_C) docs html
 
 html-clean :
Index: lib/Parrot/Configure/RunSteps.pm
===================================================================
RCS file: /cvs/public/parrot/lib/Parrot/Configure/RunSteps.pm,v
retrieving revision 1.46
diff -u -r1.46 RunSteps.pm
--- lib/Parrot/Configure/RunSteps.pm	14 Nov 2004 21:14:33 -0000	1.46
+++ lib/Parrot/Configure/RunSteps.pm	19 Nov 2004 21:35:18 -0000
@@ -58,6 +58,7 @@
     auto/aio.pl
     auto/gmp.pl
     auto/snprintf.pl
+    auto/perldoc.pl
     gen/icu.pl
     gen/config_h.pl
     gen/core_pmcs.pl

Reply via email to