Page MenuHomeFreeBSD

Add support for GCC-based targets to luajit
ClosedPublic

Authored by jhibbits on Jan 9 2018, 4:49 AM.

Details

Summary

luajit requires CC to be passed on the command line, not via the Make
environment in order to override the Makefile. Pass it explicitly, and for GCC
targets (powerpc, mips, sparc64) explicitly use ports GCC.

Test Plan

Successfully built on powerpc. Does not build for powerpc64, though.

Diff Detail

Repository
rP FreeBSD ports repository
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.

Event Timeline

lang/luajit/Makefile
21–23 ↗(On Diff #37662)

ARCH is not defined before including b.p.options.m.

lang/luajit/Makefile
21–23 ↗(On Diff #37662)

Hm, now I'm wondering how my build completed successfully.

lang/luajit/Makefile
21–23 ↗(On Diff #37662)

If you are cross-building, poudriere defines ARCH in make.conf or something, so it will work, but only when crossbuilding, it would break on amd64 for example :-)

lang/luajit/Makefile
21–23 ↗(On Diff #37662)

I just tested, by adding a ".info ${ARCH}" into that block, and it did print out "powerpc". Might ARCH be defined elsewhere, too, maybe implicitly?

lang/luajit/Makefile
21–23 ↗(On Diff #37662)

Aha, got it... yeah, crossbuilding to ppc32 on ppc64, and ARCH is defined in the make.conf. I guess I need to include b.p.pre.mk / b.p.post.mk?

lang/luajit/Makefile
21–23 ↗(On Diff #37662)

No need to bring pre and post, simply include bsd.port.options.mk before the .if.

Update given mat's feedback. Tested with powerpc and powerpc64

lang/luajit/Makefile
6 ↗(On Diff #37680)

You do not need to bump PORTREVISION, it does not change anything for the architectures where it already worked, and it did not previously exist in the new architectures.

17 ↗(On Diff #37680)

You do not need += here.

lang/luajit/Makefile
6 ↗(On Diff #37680)

This is an artifact of using two different ports trees for my work (poudriere, and commit). The real ports tree does have the PORTREVISION already, my 'commit' tree does not. Will update svn and repost the fixed diff with the MAKE_ARGS correction.

mat added inline comments.
lang/luajit/Makefile
6 ↗(On Diff #37680)

No need to re-update it, just commit it :-)

This revision is now accepted and ready to land.Jan 9 2018, 3:41 PM
This revision was automatically updated to reflect the committed changes.