develooper Front page | perl.perl5.porters | Postings from October 2003

Re: [perl #24367] [PATCH] configure flag -Dextras="HTML::Parser" doesn't seem to do anything

Andy Dougherty
October 31, 2003 12:31
Re: [perl #24367] [PATCH] configure flag -Dextras="HTML::Parser" doesn't seem to do anything
Message ID:
On Thu, 30 Oct 2003, Travis J.I. Corcoran wrote:

> First: I'd like to thank everyone here for all the good work with Perl.
> I'm configuring perl 5.8.1 as follows
> 	sh Configure -de -Uusedl -Dextras="HTML::Parser"
>      -Dstatic_ext="B ByteLoader Cwd DB_File Data/Dumper Devel/DProf
> 		 Devel/PPPort Devel/Peek Digest/MD5 Encode Fcntl File/Glob
> 		 Filter/Util/Call I18N/Langinfo IO IPC/SysV List/Util MIME/Base64
> 		 Opcode POSIX PerlIO/encoding PerlIO/scalar PerlIO/via SDBM_File
> 		 Socket Storable Sys/Hostname Sys/Syslog Time/HiRes
> 		 Unicode/Normalize attrs re threads threads/shared Encode/Byte
> 		 Encode/CN Encode/EBCDIC Encode/JP Encode/KR Encode/Symbol
> 		 Encode/TW Encode/Unicode HTML/Parser"
> and when I follow this with "make", I do not see that HTML::Parser has
> been fetched from CPAN:
>    - no reference to HTML::Parser appears in the output of make
>    - the find command sees no files under the config/build directory

The short story is that this isn't going to work without dynamic loading.

The longer story is that the makefile does include HTML::Parser -- look
for makefile rules involving 'extras.lst'.  The makefile is set
up to use ./perl to run CPAN to fetch the extras.  Unfortunately, in the
absence of dynamic loading, the makefile is also set to build the ./perl
executable by linking in the "extras" as static extensions.  In fact, your
'make' command should have failed with an output looking something like
the following (I've cut out lots of irrelevant library lines).

        Skipping lib/auto/HTML/Parser/Parser.a (directory does not exist)
    cc -o perl  perlmain.o lib/auto/DynaLoader/DynaLoader.a
	lib/auto/B/B.a lib/auto/ByteLoader/ByteLoader.a lib/auto/Cwd/Cwd.a
	lib/auto/DB_File/DB_File.a lib/auto/Data/Dumper/Dumper.a
	[ . . . ]
	lib/auto/Encode/Unicode/Unicode.a lib/auto/HTML/Parser/Parser.a
	[ . . . ]
	lib/auto/Encode/TW/TW.a lib/auto/Encode/Unicode/Unicode.a libperl.a
	`cat ext.libs` -lnsl -ldb -ldl -lm -lcrypt -lutil -lc
    cc: lib/auto/HTML/Parser/Parser.a: No such file or directory
    make: *** [perl] Error 1

Note that it does mention HTML::Parser.

I don't see an easy way around this.  Fortunately, there are several existing
workarounds.  The following patch to INSTALL makes this explicit:

--- INSTALL.old	2003-10-31 15:18:29.000000000 -0500
+++ INSTALL	2003-10-31 15:25:53.000000000 -0500
@@ -1109,6 +1109,9 @@
 you can build and install extensions just fine even if you don't have
 dynamic loading.  See lib/ExtUtils/ for more details.)

+If you have dynamic loading, another way of specifying extra modules
+is described in L<"Adding extra modules to the build"> below.
 You can learn more about each of the supplied extensions by consulting the
 documentation in the individual .pm modules, located under the
 ext/ subdirectory.
@@ -1471,6 +1474,9 @@
 or answer first 'y' to the question 'Install any extra modules?' and
 then answer "Compress::Zlib Bundle::LWP DBI" to the 'Extras?' question.
 The module or the bundle names are as for the CPAN module 'install' command.
+This will only work if those modules are to be built as dynamic
+extensions.  If you wish to include those extra modules as static
+extensions, see L<"Extensions"> above.

 Notice that because the CPAN module will be used to fetch the extra
 modules, you will need access to the CPAN, either via the Internet,

Finally, I'd note that specifying a long list of -Dstatic_ext='...' is
usually not the best way to achieve whatever end you are trying to
achieve.  With -Uusedl, all available supported extensions get
automatically listed in static_ext anyway.  If you wish to change that
default list in some way, you might consider one of the alternatives
suggested in the INSTALL file in the section on "Extensions".

    Andy Dougherty Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at | Group listing | About