Bug #48654 Proxy does not compile when lua not installed but available
Submitted: 10 Nov 2009 4:52 Modified: 25 Nov 2009 16:00
Reporter: Roel Van de Paar Email Updates:
Status: Not a Bug Impact on me:
None 
Category:MySQL Proxy: Install/Config Severity:S1 (Critical)
Version:0.7.2 & latest bzr OS:Linux
Assigned to: CPU Architecture:Any

[10 Nov 2009 4:52] Roel Van de Paar
Description:
roel@roel-ubuntu-vm:/proxy/mysql-proxy-0.7.2$ echo $LUA_CFLAGS
-I/proxy/lua-5.1.4/include
roel@roel-ubuntu-vm:/proxy/mysql-proxy-0.7.2$ echo $LUA_LIBS
-I/proxy/lua-5.1.4
roel@roel-ubuntu-vm:/proxy/mysql-proxy-0.7.2$ ls /proxy/lua-5.1.4
bin2c5.1  include  liblua5.1.a  liblua5.1.so  lua5.1  luac5.1
roel@roel-ubuntu-vm:/proxy/mysql-proxy-0.7.2$ ls /proxy/lua-5.1.4/include/
lauxlib.h  luaconf.h  lua.h  lua.hpp  lualib.h
roel@roel-ubuntu-vm:/proxy/mysql-proxy-0.7.2$ ./configure --with-mysql=/proxy/mysql-5.1.40-proxied/bin/mysql_config
[...lots of output...]
checking for LUA... yes
[...lots of output...]
roel@roel-ubuntu-vm:/proxy/mysql-proxy-0.7.2$ make
[...lots of output...]
mv -f .deps/mysql_binlog_dump-mysql-binlog-dump.Tpo .deps/mysql_binlog_dump-mysql-binlog-dump.Po
/bin/bash ../libtool --tag=CC   --mode=link gcc -DLUAEXTDIR="\"/usr/local/lib/mysql-proxy/lua\""  -DPLUGINDIR="\"/usr/local/lib/mysql-proxy/plugins\"" -g -O2   -o mysql-binlog-dump mysql_binlog_dump-mysql-binlog-dump.o -lglib-2.0   -Wl,--export-dynamic -lgmodule-2.0 -lglib-2.0   libmysql-chassis.la -pthread -lgthread-2.0 -lrt -lglib-2.0   libmysql-proxy.la 
libtool: link: gcc -DLUAEXTDIR=\"/usr/local/lib/mysql-proxy/lua\" -DPLUGINDIR=\"/usr/local/lib/mysql-proxy/plugins\" -g -O2 -o .libs/mysql-binlog-dump mysql_binlog_dump-mysql-binlog-dump.o -Wl,--export-dynamic -pthread  ./.libs/libmysql-chassis.so /usr/lib/libgthread-2.0.so -lrt ./.libs/libmysql-proxy.so /proxy/mysql-proxy-0.7.2/src/.libs/libmysql-chassis.so -levent /usr/lib/libgmodule-2.0.so /usr/lib/libglib-2.0.so -pthread
./.libs/libmysql-proxy.so: undefined reference to `lua_getmetatable'
./.libs/libmysql-proxy.so: undefined reference to `luaL_typerror'
./.libs/libmysql-chassis.so: undefined reference to `lua_getfield'
./.libs/libmysql-chassis.so: undefined reference to `lua_isstring'
./.libs/libmysql-proxy.so: undefined reference to `lua_setmetatable'
./.libs/libmysql-chassis.so: undefined reference to `lua_pushstring'
./.libs/libmysql-chassis.so: undefined reference to `lua_atpanic'
./.libs/libmysql-chassis.so: undefined reference to `lua_getstack'
./.libs/libmysql-chassis.so: undefined reference to `lua_tonumber'
./.libs/libmysql-chassis.so: undefined reference to `lua_createtable'
./.libs/libmysql-chassis.so: undefined reference to `luaL_openlibs'
./.libs/libmysql-proxy.so: undefined reference to `lua_pushnumber'
./.libs/libmysql-chassis.so: undefined reference to `lua_getinfo'
./.libs/libmysql-chassis.so: undefined reference to `lua_isnumber'
./.libs/libmysql-chassis.so: undefined reference to `lua_pushinteger'
./.libs/libmysql-proxy.so: undefined reference to `lua_settable'
./.libs/libmysql-proxy.so: undefined reference to `lua_xmove'
./.libs/libmysql-proxy.so: undefined reference to `lua_rawgeti'
./.libs/libmysql-chassis.so: undefined reference to `lua_newstate'
./.libs/libmysql-proxy.so: undefined reference to `luaL_checklstring'
./.libs/libmysql-proxy.so: undefined reference to `lua_touserdata'
./.libs/libmysql-proxy.so: undefined reference to `lua_pushlightuserdata'
./.libs/libmysql-chassis.so: undefined reference to `lua_pcall'
./.libs/libmysql-proxy.so: undefined reference to `lua_getfenv'
./.libs/libmysql-proxy.so: undefined reference to `luaL_unref'
./.libs/libmysql-chassis.so: undefined reference to `lua_settop'
./.libs/libmysql-chassis.so: undefined reference to `lua_toboolean'
./.libs/libmysql-proxy.so: undefined reference to `lua_pushvalue'
./.libs/libmysql-proxy.so: undefined reference to `lua_rawseti'
./.libs/libmysql-proxy.so: undefined reference to `lua_newuserdata'
./.libs/libmysql-chassis.so: undefined reference to `lua_load'
./.libs/libmysql-proxy.so: undefined reference to `lua_pushboolean'
./.libs/libmysql-chassis.so: undefined reference to `lua_type'
./.libs/libmysql-proxy.so: undefined reference to `lua_tointeger'
./.libs/libmysql-chassis.so: undefined reference to `lua_setfield'
./.libs/libmysql-proxy.so: undefined reference to `luaL_register'
./.libs/libmysql-chassis.so: undefined reference to `lua_gettop'
./.libs/libmysql-chassis.so: undefined reference to `lua_next'
./.libs/libmysql-proxy.so: undefined reference to `luaL_argerror'
./.libs/libmysql-chassis.so: undefined reference to `lua_close'
./.libs/libmysql-chassis.so: undefined reference to `lua_tolstring'
./.libs/libmysql-chassis.so: undefined reference to `lua_remove'
./.libs/libmysql-proxy.so: undefined reference to `lua_setfenv'
./.libs/libmysql-proxy.so: undefined reference to `lua_gettable'
./.libs/libmysql-chassis.so: undefined reference to `lua_typename'
./.libs/libmysql-proxy.so: undefined reference to `lua_pushcclosure'
./.libs/libmysql-proxy.so: undefined reference to `luaL_checktype'
./.libs/libmysql-proxy.so: undefined reference to `lua_pushlstring'
./.libs/libmysql-proxy.so: undefined reference to `luaL_error'
./.libs/libmysql-proxy.so: undefined reference to `luaL_checkinteger'
./.libs/libmysql-chassis.so: undefined reference to `lua_pushnil'
./.libs/libmysql-proxy.so: undefined reference to `luaL_ref'
./.libs/libmysql-proxy.so: undefined reference to `lua_newthread'
collect2: ld returned 1 exit status
make[3]: *** [mysql-binlog-dump] Error 1
make[3]: Leaving directory `/proxy/mysql-proxy-0.7.2/src'
make[2]: *** [all] Error 2
make[2]: Leaving directory `/proxy/mysql-proxy-0.7.2/src'
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory `/proxy/mysql-proxy-0.7.2'
make: *** [all] Error 2
roel@roel-ubuntu-vm:/proxy/mysql-proxy-0.7.2$ 

How to repeat:
Try to compile proxy 0.7.2 (or latest bzr) when lua 5.1.4 has not been installed, but where the lua files are available in another directory and LUA_CFLAGS and LUA_LIBS have been set.
[10 Nov 2009 4:54] Roel Van de Paar
Verifying as D2
[10 Nov 2009 4:55] Roel Van de Paar
Also see https://answers.launchpad.net/mysql-proxy/+question/58950
[25 Nov 2009 15:56] Enterprise Tools JIRA Robot
Jan Kneschke writes: 
The INSTALL file says:

  $ ./configure \
    LUA_CFLAGS="-I/directory/of/lua.h" \
    LUA_LDFLAGS="-L/directory/of/liblua.so -llua"
[25 Nov 2009 16:00] Enterprise Tools JIRA Robot
Mark Leith writes: 
Not a bug - build issues are fully documented now in the 0.8.0 INSTALL file.