Beefy Boxes and Bandwidth Generously Provided by pair Networks
Problems? Is your data what you think it is?
 
PerlMonks  

Re^2: RFC: Changing Perl Config settings

by syphilis (Archbishop)
on Feb 24, 2008 at 00:15 UTC ( #669797=note: print w/replies, xml ) Need Help??


in reply to Re: RFC: Changing Perl Config settings
in thread Changing Perl Config settings

set INCLUDE=%BASE%c\include;%INCLUDE% set LIB=%BASE%c\lib;%LIB%


That's interesting. I've noticed that Strawberry sets those two environment variables, but I've never understood why. Afaict, with MinGW (including Strawberry's MinGW), the compiler and linker search those locations by default. In fact, I've unset those 2 envvars, and everything still works fine:
C:\_32\C>set LIB LIB= C:\_32\C>set INCLUDE INCLUDE= C:\_32\C>type try.c #include <stdio.h> int main(void) { printf("Hello from strawberry\n"); return 0; } C:\_32\C>gcc -o try.exe try.c C:\_32\C>try Hello from strawberry C:\_32\C>
Similarly, if I'm building a perl extension using Strawberry Perl, the standard headers and libraries get found fine - even though those 2 envvars are unset. Perhaps those 2 envvars could be useful when it comes to finding headers and libraries that are stored in non-default locations. (I haven't tried that. I prefer to keep LIB and INCLUDE unset, and provide the non-standard locations with the -I and -L switches.)

Update: I've since found time to take a closer look - and I can find no evidence that MinGW and Strawberry Perl take any notice at all of the INCLUDE and LIB environment variables. Visual Studio certainly does ... but not MinGW.

Cheers,
Rob

Replies are listed 'Best First'.
Re^3: RFC: Changing Perl Config settings
by Bloodrage (Monk) on Feb 25, 2008 at 00:57 UTC

    Fantastic, so I wasn't imagining things when I thought things weren't working as they should. It looks like I need to spend some time getting MinGW to compile some things outside the CPAN shell. It also explains why my program helps, because it explictly sets the -I and -L switches when it reconfigures CPAN's Config.pm.

    I'm now considering the benefits of flattening my include directory structures into X:\strawberry\c\include rather than to have one for a) strawberry, b) GTK/Glade/Glib/Cairo... and c) a usr/include dir for 'one off' libraries. The current multiple include locations has the advantage of being able to update one without breaking the others, where the flattened version may result in overwriting 'good' with 'bad' when installing new material.

    PS: I think I can circumvent the difficulty compiling GTK2-Perl by manually installing the ActivState PPM... except I don't want this compiling issue to continue being a PITA when in the field with this portable Perl-onna-stick thing.

      by manually installing the ActivState PPM ...

      There's also the CPAN version of PPM which doesn't have all the whizz-bang-u-bute features of ActiveState's proprietary PPM - but it's quite functional. (There's a patch that enables it to handle zipped binaries, so that the ppm packages at the trouchelle rep are also accessible.)

      Cheers,
      Rob

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://669797]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others contemplating the Monastery: (4)
As of 2022-05-25 15:32 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    Do you prefer to work remotely?



    Results (90 votes). Check out past polls.

    Notices?