mascarenhas/alien — pull request #19 by gvvaughan (2012-06-15 09:30:38+00:00)
Title: rockspec: don't clobber environment flags.

* rockspec/alien-0.5.2-1.rockspec (build): It's more hygienic to
put configure flags *after* the configure invocation.
Also, append to any existing CPPFLAGS passed in the build
environment.

Since Mac OS Lion ships with a libffi missing the recent closure APIs required by alien, I have to pass the include and library paths for my self-installed libffi to luarocks, otherwise it won't build:

```
CC=gcc-4.2 CFLAGS=-I/usr/local/Cellar/libffi/3.0.11/lib/libffi-3.0.11/include LDFLAGS=-L/usr/local/Cellar/libffi/3.0.11/lib luarocks make rockspecs/alien-0.5.2-1.rockspec
```

This match makes that possible without having to build and install directly from source.

Note: CC=gcc-4.2 is the Snow Leopard compiler, because XCode on Lion uses llvm and clang which don't compile alien properly. It is available with homebrew - ```brew install apple-gcc-4.2``` This is probably something that should go in the alien README for future builders on Mac OS X Lion?