Bug 121834 - [patch] lang/lua: split AR into AR/ARFLAGS (for cross build override of AR)
Summary: [patch] lang/lua: split AR into AR/ARFLAGS (for cross build override of AR)
Status: Closed FIXED
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: Normal Affects Only Me
Assignee: freebsd-ports-bugs (Nobody)
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2008-03-18 16:10 UTC by John E. Hein
Modified: 2008-08-10 16:20 UTC (History)
1 user (show)

See Also:


Attachments
file.diff (760 bytes, patch)
2008-03-18 16:10 UTC, John E. Hein
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description John E. Hein 2008-03-18 16:10:00 UTC
The lang/lua port has a Makefile in the distribution that _almost_ works
for cross compiles (e.g., to arm).  But AR is defined as 'AR=ar rcu'.

Normally one overrides compile tools (CC, AR, RANLIB, etc.) with
cross versions of the tool (e.g., CC=arm-cc or similar).  It's
hard to override AR for lua since its definition includes the
flags to AR.  This is a deviation from the way things are normally
done and it breaks when one passes in AR=arm-ar (since the flags
will be missing when it comes time to run $(AR)).

see also discussion at http://marc.info/?l=lua-l&m=120468996914376&w=2

The reaction to the patch shown in the thread (and below) was all
positive (although there was some digression into conversation about
cross building in general and whether lua should use autoconf).  But I
don't know if it made it in to lua's repo since that is private.

Fix: Add following patch file to lang/lua port.  With this patch
I can cross build and use lua (tested on arm).

[Note: this is still needed in the most recent lua port, 5.1.3,
 that was released in Jan 2008]
How-To-Repeat: 
Build cross tools for you favorite platform.

Try to cross build lua with the common technique of overriding
the build tools, like so (just make sym links named foo-* to the real tools
for purposes of testing)...

make MAKE_ARGS='CC=foo-cc AR=foo-ar' MAKE_ENV=STRIPBIN=foo-strip

See it fail when it gets to the ar line...

 .
 .
 .
foo-cc -O2 -fno-strict-aliasing -pipe  -O2 -Wall -DLUA_USE_POSIX -DLUA_USE_DLOPEN -c loadlib.c
foo-cc -O2 -fno-strict-aliasing -pipe  -O2 -Wall -DLUA_USE_POSIX -DLUA_USE_DLOPEN -c linit.c
foo-ar liblua.a lapi.o lcode.o ldebug.o ldo.o ldump.o lfunc.o lgc.o llex.o lmem.o lobject.o lopcodes.o lparser.o lstate.o lstring.o ltable.o ltm.o lundump.o lvm.o lzio.o lauxlib.o lbaselib.o ldblib.o liolib.o lmathlib.o loslib.o ltablib.o lstrlib.o loadlib.o linit.o
foo-ar: illegal option -- .
Usage: foo-ar [emulation options] [-]{dmpqrstx}[abcfilNoPsSuvV] [member-name] [count] archive-file file...
 .
 .
 .
Comment 1 Edwin Groothuis freebsd_committer freebsd_triage 2008-03-18 17:50:53 UTC
State Changed
From-To: open->feedback

Awaiting maintainers feedback (via the GNATS Auto Assign Tool)
Comment 2 Felippe de Meirelles Motta freebsd_committer freebsd_triage 2008-06-22 00:37:47 UTC
State Changed
From-To: feedback->open

Feedback timeout.
Comment 3 Felippe de Meirelles Motta freebsd_committer freebsd_triage 2008-06-22 00:38:10 UTC
Class Changed
From-To: change-request->sw-bug

Fix PR class.
Comment 4 John E. Hein 2008-06-22 18:44:30 UTC
Can a committer pull the trigger on this, please?
Comment 5 dfilter service freebsd_committer freebsd_triage 2008-08-10 16:18:03 UTC
alepulver    2008-08-10 15:17:49 UTC

  FreeBSD ports repository

  Added files:
    lang/lua/files       patch-src-Makefile 
  Log:
  - Split AR parameters to ARFLAGS variable to allow redefining AR for
    cross-compilation.
  
  PR:             ports/121834
  Submitted by:   John Hein <jhein@timing.com>
  Approved by:    maintainer (timeout)
  
  Revision  Changes    Path
  1.1       +21 -0     ports/lang/lua/files/patch-src-Makefile (new)
_______________________________________________
cvs-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/cvs-all
To unsubscribe, send any mail to "cvs-all-unsubscribe@freebsd.org"
Comment 6 Alejandro Pulver freebsd_committer freebsd_triage 2008-08-10 16:18:23 UTC
State Changed
From-To: open->closed

Committed. Thanks!