[Slackbuilds-users] Perl-modules and CFLAGS

Robby Workman rworkman at slackbuilds.org
Thu Jul 1 04:28:55 UTC 2010

On Wed, 23 Jun 2010 23:28:04 +0200
Thomas Morper <thomas at beingboiled.info> wrote:

> Dear Slackbuilders,
> I'm in the process of preparing some Perl-modules for SBo but I'm
> unsure how to handle CFLAGS "the right way" when C is involved.
> A MakeMaker-based Makefile.PL allows you to pass the CCFLAGS and
> OPTIMIZE variables to the compiler, however...
> 1.) 'perl Makefile.PL CCFLAGS="$SLKCFLAGS"' isn't a very good idea,
> since it will a overwrite the CCFLAGS defaults and something like a
> missing "-D_LARGEFILE_SOURCE" will haunt you later on.
> 2.) 'perl Makefile.PL OPTIMIZE="$SLKCFLAGS"' isn't perfect, either. So
> far I've got three modules and in each one OPTIMIZE behaves
> differently:
>  - module1 only has "-O2" as a default but will accept OPTIMIZE
>  - module2 uses what Perl was compiled with as a default, e.g. "-O2
>    -march=i486 -mtune=i686" and thus doesn't need OPTIMIZE, but will
>    use it if it's set
>  - module3 is similar to module2, however for some of its C-sources it
>    will use the Perl defaults instead of whatever you set OPTIMIZE to
> My conclusion: there are 18000 modules on cpan.org - don't waste your
> time trying to find the über-perfect settings for each one, just go
> with the defaults unless there's a good reason for manual
> intervention (e.g. doesn't work otherwise).
> In SBo-terms: set ARCH, SLKCFLAGS and LIBDIRSUFFIX as we always do,
> but don't care about it; the result will be fine for most users.
> Those who want more from their Perl modules still only have to add a
> single line to the module's SlackBuild script.
> Interestingly, this is what the current template does :-) So, is this
> the way to go or am I missing something and the CFLAGS actually do
> need more attention?

I think the status quo is good enough :-)

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 198 bytes
Desc: not available
URL: <http://lists.slackbuilds.org/pipermail/slackbuilds-users/attachments/20100630/3f6c6561/attachment.asc>

More information about the SlackBuilds-users mailing list