Subject: Re: Compiling Perl under b20.1
From: Sebastien Barre <[email-masked]>
To: Charles Wilson <[email-masked]>
Cc: [email-masked]
Date: Mon, 08 Mar 1999 14:36:58 +0100

At 03:07 08/03/99 -0500, Charles Wilson wrote:

>> -------------------------------
>> 1) I was unable to install !! (what about you ?)

>I had no problems -- BUT I had renamed /usr/bin/install to cyg-install, and 
>copied Pierre Humblet's install script from

Let's try. Hum. No, that does not work. 'make install' call a perl script
'installperl'.

>> administrateur [545] /usr/local/src/perl5.005_02$ cd /usr/local/
>> administrateur [546] /usr/local$ ll
>> total 0
>> drwxr-xr-x   2 administ Aucun           0 Mar  7 22:54 bin/
>> [...]

>Look here - you're running as Administrator. Adds a little credence to my 
>theory.

Oh yes, no pb about it, but see my new email about 'ntea', I thought that
might *also* solve problems for directories. Well, I could change the
ownership of /usr/local/bin (*grin*), or apply a patch.

>> -------------------------------
>> 2) Perl Modules
>>
>Nope, I didn't try this. I just wanted a basic build.

Too bad :)

>The Right Thing is to define a global in cw32imp.h that says "You already 
>included me, skip the rest of this file" eg

>#ifndef CW32IMP
>#define CW32IMP
>---rest of file
>#endif

No, sorry, that's not the problem (but indeed cw32imp.h was lacking this
feature). I investigate a bit further, and found that the file was included
once, but it redefined some stuff previously defined in many other headers
:(( You definitely have to exclude this file. That would be nice if you
could try a very simple Module like String-CRC (see CPAN repository).

ftp://ftp.cise.ufl.edu/pub/perl/CPAN/modules/by-module/String/String-CRC-1.0
.tar.gz

% cd String-CRC-1.0
% perl Makefile.PL
% make
% make test

>> Notice the '0a0d' !! But I was using both 'binmode' AND binary mount that
>> time, where the hell is this '0a0d' coming from ? ((

>I don't know. But I suspect one of the scripts in lib/extutils/ is doing the 
>work of creating the extralibs.ld files when you invoke make -f
Makefile.aperl....
>Unfortunately these scripts are way beyond my limited perl abilities.

>will help the linker ignore its presence. The real issue is where is it 
>coming from in the first place. That, I can't answer. Maybe somebody else??

I found it ! SORRY, my fault (once again).

The 'Od' following the "-ld" came from an old module that I compiled for
Perl (DB_File) as I was testing my old Perl build (it was lying around).
And of course, I did that while my partitions where mounted as text ! And
this is where it comes from, as the file was then copied to the obscure
Perl directories, and is now used as part as the concatenation :(

I rebuild it in binary mount mode, and all modules compile perfectly :

=> do not mix modules build in text and binary mount modes !

Well, I guess we are near the end : 2 problems to solve for me 
	- install fail
	- cw32imp.h shall NOT be include

Thanks

P.S. :
Here is summary of what I think about the modules :

Some Perl modules are bundled with .xs files which are translated to .c
format and compiled to produce object files (.o) and/or a library (.a).
These .xs are extensions/stubs that might be useful to speed up functions
or access external libraries/packages. If Perl was built statically, then
these extensions have to be statically linked (added) against perl.exe in
order to produce a new perl.exe which will be reinstalled somewhere
(replacing the old one).

Perl maintains a list of extensions that have been added to the current
perl.exe (that is, all modules except libperl.a). As an extension might
also depend on other libraries (for example, a module might implement a
perl extension to handle the Zlib, and therefore shall refer to -lz), Perl
also stores a list (text file) of additional(extra) libs needed for every
module. This seems to be site specific : for a module M, it might be
located in two places :
     /usr/local/lib/perl5/5.00502/cygwin32/auto/M/extralibs.ld
     /usr/local/lib/perl5/site_perl/cygwin32/auto/M/extralibs.ld

For example, the DB_File module is a Perl extension designed to allow
anyone to use the Berkeley DB library (which have to be build separately).
Its extralibs.ld might be '-L/usr/local/lib -ldb' (notice the -ldb).

Note : this /usr/local/lib/perl5/site_perl/cygwin32/auto/M/ will also store
the extensions itself (.a) useful to rebuild the whole perl.exe.

After building/testing/installing an extension module you might update the
new perl.exe by issuing in the module directory :

> make -f Makefile.aperl inst_perl MAP_TARGET=perl.exe

This step will build a new perl.exe by compiling a classical perlmain.c
file, statically link it to libperl.a, to ALL previous extensions (.a
stored in cygwin32/auto/M/), to usual libraries (-lcygwin -lm, etc.) AND to
all extralibs. The list of all extralibs is computed by concatenating (cat)
all extralibs.ld (for every known extensions + the current one), leading to
an extralibs.all file, which is used.

BEWARE of your mount mode. If you compiled some modules on text mounted
partitions, the extralibs.ld file will store very nasty '0d' bytes related
to the way Windows handle text file ('\n' are translated to'0a0d' instead
of 'Oa' in Unix world). If you switch to binary mount mode, the previously
described process will FAIL because the linker will crash on '0d' in
extralibs.all : in binary mode, it will not understand that 'OaOd' might be
swallowed together, it will just swallow 'Oa', thus leaving the 'Od'.

______________________________________________________________
Sebastien Barre                  http://www.hds.utc.fr/~barre/

--
Want to unsubscribe from this list?
Send a message to [email-masked]