xolox/lua-apr — Issue #10: Build on Mac OS X
Author: mkottman
Created: 2011-11-21 09:01:16+00:00
State: open

In order to successfully build lua-apr on Mac OS X (Lion), I had to modify the file `etc/make.lua` to include paths for Lua in lflags, as these were missing:

diff --git a/etc/make.lua b/etc/make.lua
index 09d8bd1..7ed366f 100644
--- a/etc/make.lua
+++ b/etc/make.lua
@@ -154,6 +154,9 @@ end

local function getlflags()
local flags = {}
+ mergeflags(flags, 'pkg-config --libs lua5.1') -- Debian/Ubuntu
+ mergeflags(flags, 'pkg-config --libs lua-5.1') -- FreeBSD
+ mergeflags(flags, 'pkg-config --libs lua') -- Arch Linux
-- Linker flags for APR 1.
mergeflags(flags, 'apr-1-config --link-ld --libs')
mergeflags(flags, 'pkg-config --libs apr-1')

Here is the result on running tests (looks ok, not sure about io_net):

Running base64 tests: OK
Running crypt tests: OK
Running date tests: OK
Running dbd tests: Skipped!
Running dbm tests: OK
Running env tests: OK
Running filepath tests: OK
Running fnmatch tests: OK
Running getopt tests: OK
Running http tests: OK
Running io_dir tests: Failed! (/usr/local/share/lua/5.1/apr/test/io_dir.lua:23: File exists)
Running io_file tests: OK (2.02s)
Running io_net tests: *** Lua/APR status_to_name(670008) failed, might be a bug?
Failed! (/usr/local/share/lua/5.1/apr/test/io_net.lua:22: nodename nor servname provided, or not known)
Running ldap tests:
Warning: Failed to bind to LDAP server, I'm assuming it's not available (reason: Can't contact LDAP server)
Skipped!
Running memcache tests:
Warning: Looks like memcached isn't available! (Connection refused)
Skipped!
Running misc tests: OK
Running pollset tests: OK (1.02s)
Running proc tests: OK
Running shm tests: OK
Running signal tests: OK
Running str tests: OK
Running thread tests: OK (1.02s)
Running thread_queue tests: OK
Running time tests: OK
Running uri tests: OK
Running user tests: OK
Running uuid tests: OK
Running xlate tests: OK
Running xml tests: OK
Done!