develooper Front page | perl.makemaker | Postings from August 2012

What's the best way to make "perl Makefile.PL" set the CC variableto a different path?

Thread Next
From:
Shlomi Fish
Date:
August 8, 2012 02:32
Subject:
What's the best way to make "perl Makefile.PL" set the CC variableto a different path?
Message ID:
20120808123158.164120eb@lap.shlomifish.org
Hi all,

what is the best way to make perl Makefile.PL set the value of the CC variable in the "Makefile" file
to a different value? I sometimes want to make it point to /usr/bin/clang because clang compiles much faster
than gcc, and produces compatible binaries, so the "make" stage is less time-consuming.

So far the only way I found is to do something like:

sub MY::postamble {

    my $CC_LINE =
    (
        exists($ENV{CC})
            ? "CC = $ENV{CC}"
            : ''
    );

  return "$CC_LINE\n\n" . <<'MAKE_FRAG';

This adds a second "CC = " line which overrides the first and built-in one.

Is there a better way?

Regards,

	Shlomi Fish

-- 
-----------------------------------------------------------------
Shlomi Fish       http://www.shlomifish.org/
My Favourite FOSS - http://www.shlomifish.org/open-source/favourite/

I learned a lot from my teachers, and from my friends more than my teachers,
and from my pupils the most. — Rabbi Hanina

Please reply to list if it's a mailing list post - http://shlom.in/reply .

Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About