Beefy Boxes and Bandwidth Generously Provided by pair Networks
"be consistent"
 
PerlMonks  

comment on

( [id://3333]=superdoc: print w/replies, xml ) Need Help??
 ...

Appreciated a lot that you, nobull, posted this since it could not have come at a better time for me: I just set up Strawberry on a new box and hadn’t started using it yet.

There is no need to pass these setting. The Makefile invokes GCC as simply “gcc” thus assuming that the environment (at least PATH) is configured correctly to find the correct GCC installation. If you are using the GCC.EXE that’s found by traversing the PATH environment variable then you should be using the (standard) headers and libraries that are found by traversing the LIB and INCLUDE environment variables.

It might not be smart to take for granted that the user’s PATH is set up correctly. Mine or yours always would be; but a lot of experience answering questions on realtime chat has demonstrated that many users do not even know what PATH is, or understand PATH and other environmental vars at all. This applies to people right here on Perlmonks everyday; I am not talking at all about some hypothetical breed far outside the possible user base of Strawberry. So a superior approach might be to set cc in the Perl Config-heavy.pl file to the fully-qualified pathname where the mingw gcc that’s shipped with Strawberry is installed. That way the right gcc is always called:

Config_heavy.pl: cc='gcc'
        becomes       cc='C:/strawberry/c/bin/gcc'

Strawberry’s setup program alters the MSWindows system PATH (%Path%) env var but that’s inherently fragile when something later (like a brain-damaged user or other software setup program) could come along and clobber that.

The idea of adding these parameters to CPAN’s makepl_arg so that, eventually down the pipeline, the C compiler will have the right flags to find its own standard headers is addressed in your writeup, nobull: it simply isn’t necessary. It’s something only folks mostly ignorant of how gcc works would think they need to do. However, ExtUtils does check for libs. I don’t believe that it does any checking for headers (MakeMaker's INC) at all. If LIBS needs to be set, it is up to the module author and the user installing the module to work out how to tell ExtUtils what libs and where.

On another note, the manual page for ExtUtils::MakeMaker says:

LIBS – An anonymous array of alternative library specifications to be searched for (in order) until at least one library is found.

I note that one sees no anonymous array being created when Strawberry does

makepl_arg => q[LIBS=-LC:\\strawberry\\c\\lib INC=-IC:\\strawberry\\c\\include],

Right there one suspects cargo-cult coding is going on, where Adam Kennedy does not, as I have found is usual, really understand what is going on. (Yes, I can read, and yes, I know that what ExtUtils does with that plain scalar string is to create a single-entry anonymous array. It’s still dumb and wrong for the commandline (via CPAN.pm) to be used for this in any case, and it’s worse because the approach used is less self-documenting by employing an obscure feature of ExtUtils.)

Adam is great at faking understanding and announcing ambitious projects, then shoving the burden of fixing the fruits of his half-assed guesses off onto other parties (in this case, suggesting that other CPAN authors are the ones doing things wrong). He’s really good at defensively closing himself down to feedback and really really bad at self-motivated learning and asking questions of people who actually know stuff.

In summation, yeah, this is not being done the right way by the current release of Strawberry 5.10. This needs to be fixed.


In reply to Re^3: Strawberry CPAN.pm wrongly overrides INC in Makefile.PL by Intrepid
in thread Strawberry CPAN.pm wrongly overrides INC in Makefile.PL by nobull

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post; it's "PerlMonks-approved HTML":



  • Are you posting in the right place? Check out Where do I post X? to know for sure.
  • Posts may use any of the Perl Monks Approved HTML tags. Currently these include the following:
    <code> <a> <b> <big> <blockquote> <br /> <dd> <dl> <dt> <em> <font> <h1> <h2> <h3> <h4> <h5> <h6> <hr /> <i> <li> <nbsp> <ol> <p> <small> <strike> <strong> <sub> <sup> <table> <td> <th> <tr> <tt> <u> <ul>
  • Snippets of code should be wrapped in <code> tags not <pre> tags. In fact, <pre> tags should generally be avoided. If they must be used, extreme care should be taken to ensure that their contents do not have long lines (<70 chars), in order to prevent horizontal scrolling (and possible janitor intervention).
  • Want more info? How to link or How to display code and escape characters are good places to start.
Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others having a coffee break in the Monastery: (4)
As of 2024-03-28 15:50 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found