perl and compiling C code

Frank Schima macsforever2000 at macports.org
Wed Apr 24 15:08:06 PDT 2013


Sorry to reply to my own post.


On Apr 24, 2013, at 2:48 PM, Frank Schima <macsforever2000 at macports.org> wrote:

> I'm attempting to make a port for p5-wx [1] and it needs to compile C code. I ran into a problem compiling it. It is using perl Makefile.PL to build. In IRC, jmr noticed that in line 177 of the file Config_heavy.pl (/opt/local/lib/perl5/5.12.4/darwin-thread-multi-2level/Config_heavy.pl) from the perl5.12 port has the following ccflags:
> 
> ccflags='-pipe -O2  -fno-common -DPERL_DARWIN -I/opt/local/include -no-cpp-precomp -fno-strict-aliasing -fstack-protector -I/opt/local/include'
> 
> The "-no-cpp-precomp" flag causes problems and is not needed anymore. I filed a ticket about this [2]. I actually had to remove it from the file above to get past that error. 

I still need the perl5.16 port modified. 

> I also want to try to add "-std=gnu89" to get it to compile with clang.
> 
> I tried adding the following but it did not seem to have any effect:
> 
>    configure.cflags-append -std=gnu89

It turns out I didn't need this part. But what is strange - to me - is my solution to the problem. I modified the configure args as follows:

    configure.args  installdirs=vendor

I was overriding the default from the perl portgroup:

    default configure.args {"installdirs=vendor --config cc=\"${configure.cc}\" --config ld=\"${configure.cc}\""}

Does anyone know why that worked?

> Is there a way in my p5-wx Portfile to modify the ccflags that perl recognizes when compiling with clang (or gcc or whatever)?

For the record, it does appear to build with Apple clang from Xcode 4.6.2 on Mac OS X 10.8.3. 

> 
> 
> Cheers!
> Frank
> 
> [1] <http://search.cpan.org/dist/Wx/docs/INSTALL.pod>
> [2] <https://trac.macports.org/ticket/38913>
> _______________________________________________
> macports-dev mailing list
> macports-dev at lists.macosforge.org
> https://lists.macosforge.org/mailman/listinfo/macports-dev

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macosforge.org/pipermail/macports-dev/attachments/20130424/1197e7b7/attachment.html>


More information about the macports-dev mailing list