----- Original Message -----
From: "Bill Moseley" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Tuesday, March 11, 2003 4:21 AM
Subject: non-standard lib locations.


> Perhaps a better list.
>

Sheesh!! You're having some difficulty getting an answer to this one, aren't
you - and I can't really help much :-)

But I'll provide some observations from Win32 viewpoint. Perhaps that will
encourage someone to come forward with some elaborations - and maybe the odd
correction, as well.

> I want to provide better or more complete instructions in a module's
> README for linking with a library installed in a non-standard location.
>
> I just want to make sure I have this correct, and that it will work for
> most platforms with Perl >= 5.00503.
>
> For example, build some C library called "foo" and install like:
>
>    $ ./configure --prefix=$HOME/foo
>

'./configure' won't work from a cmd.exe (or command.com) shell - and that's
the only shell that many people on Windows use.
For those of us using Mingw compiler and who also have a MSYS shell there's
no problem - and the
same probably goes for those using Cygwin.

>    $ make && make install
>
> And then build a Perl module that links with the above library:
>
>    $ perl Makefile.PL \
>      CCFLAGS=-I$HOME/foo/include \
>      LIBS="-lz -L$HOME/foo/lib -lfoo"
>
>    $ LD_RUN_PATH=$HOME/foo/lib make
>
> My questions are:
>
> - Is that the recommended way?
>

Don't know. Not too sure that '$HOME' has any meaning on windows. And,
afaik, '-lz' never does anything. If I have an extra lib to link to I can
just do:
perl makefile.pl LIBS="-LC:/absolute/path/to/lib -lfoo"
Unfortunately that doesn't seem to find a shared lib, even if it's in the
directory specified. I've always made shared libs findable by simply placing
the shared lib in one of the directories in my "path".

> - Can someone explain when to use INC vs. CCFLAGS?
>

Haven't messed with CCFLAGS. Is there some situation where using INC (and
the -I switch) doesn't work ?

> - What I don't like about using LIBS in this situation is that it requires
> the user to specify all the libs (as defined in the Makefile.PL).
>

I don't follow that - could be my fault, not yours :-)

> Seems like it would be nice to just be able to specify a list of prefixes.
> There's more control with LIBS, but in most cases specifying a prefix-type
> dire would be enough.
>
> - seems like LD_RUN_PATH is not always needed.  Is that dependent on the
> version of MakeMaker?
>
>
> BTW -- is there a way to build a ppm module for Windows on Linux?
>

Well - the 'ppm' part is pretty easy - it's just a matter of building a
tar.gz of the blib and writing an XML file (.ppd).
The tricky bit would be to build the windows binaries on a linux box. I
don't know how one could do that - but I'm not qualified to say it can't be
done.

Hope there's something in there that helps.

Cheers,
Rob



Reply via email to