From: Francesco M. <fr...@us...> - 2006-12-19 21:12:33
|
Update of /cvsroot/wxlua/wxLua/build/autoconf In directory sc8-pr-cvs9.sourceforge.net:/tmp/cvs-serv19847/build/autoconf Modified Files: aclocal.m4 autoconf_inc.m4 configure.ac Log Message: now BUILDDIR is set exactly like the wxWidgets builddir system LUA is now used if available on Unix or on Windows with USE_SYSTEM_LUA=1 changed the way the lua headers are included (removed the 'lua/include' prefix) to make it possible to use external lua Now when using built-in LUA the generated library is named lua5.1 and it overwrites any eventually preexisting lua library (when installed). Fixed the "samples" directory copy when srcdir==. Index: autoconf_inc.m4 =================================================================== RCS file: /cvsroot/wxlua/wxLua/build/autoconf/autoconf_inc.m4,v retrieving revision 1.20 retrieving revision 1.21 diff -C2 -d -r1.20 -r1.21 *** autoconf_inc.m4 11 Dec 2006 00:08:19 -0000 1.20 --- autoconf_inc.m4 19 Dec 2006 21:11:59 -0000 1.21 *************** *** 117,120 **** --- 117,126 ---- fi AC_SUBST(COND_SHARED_0) + dnl ### begin block 20_COND_SHARED_0_USE_SYSTEM_LUA_0[../../modules/build/bakefiles/modules.bkl] ### + COND_SHARED_0_USE_SYSTEM_LUA_0="#" + if test "x$SHARED" = "x0" -a "x$USE_SYSTEM_LUA" = "x0" ; then + COND_SHARED_0_USE_SYSTEM_LUA_0="" + fi + AC_SUBST(COND_SHARED_0_USE_SYSTEM_LUA_0) dnl ### begin block 20_COND_SHARED_0_USE_WXBINDSTC_1[../../modules/build/bakefiles/modules.bkl] ### COND_SHARED_0_USE_WXBINDSTC_1="#" *************** *** 147,150 **** --- 153,162 ---- fi AC_SUBST(COND_SHARED_1_USE_LUAMODULE_1) + dnl ### begin block 20_COND_SHARED_1_USE_SYSTEM_LUA_0[../../modules/build/bakefiles/modules.bkl] ### + COND_SHARED_1_USE_SYSTEM_LUA_0="#" + if test "x$SHARED" = "x1" -a "x$USE_SYSTEM_LUA" = "x0" ; then + COND_SHARED_1_USE_SYSTEM_LUA_0="" + fi + AC_SUBST(COND_SHARED_1_USE_SYSTEM_LUA_0) dnl ### begin block 20_COND_SHARED_1_USE_WXBINDSTC_1[../../modules/build/bakefiles/modules.bkl] ### COND_SHARED_1_USE_WXBINDSTC_1="#" Index: configure.ac =================================================================== RCS file: /cvsroot/wxlua/wxLua/build/autoconf/configure.ac,v retrieving revision 1.33 retrieving revision 1.34 diff -C2 -d -r1.33 -r1.34 *** configure.ac 11 Dec 2006 00:08:19 -0000 1.33 --- configure.ac 19 Dec 2006 21:11:59 -0000 1.34 *************** *** 60,63 **** --- 60,67 ---- [], [enable_customwxbind_install=yes]) + AC_ARG_WITH([lua-prefix], + [AC_HELP_STRING([--with-lua-prefix], [Prefix where Lua is installed (optional)])], + [lua_dir="$withval"], [lua_dir=""]) + AM_YESNO_OPTCHECK([USE_WXLUAAPP], [enable_wxlua_app], [--enable-wxlua-app]) *************** *** 74,77 **** --- 78,99 ---- + + AC_MSG_CHECKING([for --with-lua-prefix option]) + if [[ $lua_dir != "" ]]; then + + # user explicitely provided a path to its own lua, check that it's an absolute path + # (or it won't work for out-of-tree builds) + case $lua_dir in + /*) continue;; + *) + AC_MSG_ERROR([ + You must provide an absolute path for the --with-lua-prefix option. + ]) + esac + fi + AC_MSG_RESULT([$lua_dir]) + + + # Global wxLua options: # we could use these to define options like --enable-all-apps but these would *************** *** 91,95 **** ##################################################################### - # check for wxWidgets # --- 113,116 ---- *************** *** 102,133 **** ! # Checks used to determine right LUA flags (see modules/lua/src/Makefile) ! luadefs= ! lualibs= ! # these do not require additional libs ! AC_CHECK_FUNC([isatty], [luadefs="$luadefs -DLUA_USE_ISATTY"]) ! AC_CHECK_FUNC([mkstemp], [luadefs="$luadefs -DLUA_USE_MKSTEMP"]) ! AC_CHECK_FUNC([popen], [luadefs="$luadefs -DLUA_USE_POPEN"]) ! AC_CHECK_FUNC([_longjmp], [luadefs="$luadefs -DLUA_USE_ULONGJMP"]) ! # these require addlibs ! AC_CHECK_LIB([dl], [dlopen], [ ! AC_CHECK_HEADER([dlfcn.h], [ ! luadefs="$luadefs -DLUA_USE_DLOPEN" ! lualibs="$lualibs -ldl" ! ]) ! ]) ! AC_CHECK_LIB([readline], [readline], [ ! luadefs="$luadefs -DLUA_USE_READLINE" ! lualibs="$lualibs -lreadline" ! ]) ! LUA_PLATFORM_SPECIFIC_CFLAGS=$luadefs ! LUA_PLATFORM_SPECIFIC_LDFLAGS=$lualibs ! AC_SUBST(LUA_PLATFORM_SPECIFIC_CFLAGS) ! AC_SUBST(LUA_PLATFORM_SPECIFIC_LDFLAGS) --- 123,190 ---- + # check for Lua + # + # NB: by default we try to use the system-wide lua 5.1; if it does not + # exist then we use our built-in lua ! if test "$lua_dir" = ""; then ! AC_MSG_CHECKING([if Lua 5.1 is installed]) ! LIBS="$LIBS -llua5.1" ! AC_LINK_IFELSE([ ! AC_LANG_PROGRAM([#include <lua.h>], ! [lua_newtable(NULL);]) ! ], ! [LUA_PRESENCE=1], [LUA_PRESENCE=0]) ! if test "$LUA_PRESENCE" = "1"; then ! AC_MSG_RESULT([yes]) ! USE_SYSTEM_LUA=1 ! else ! AC_MSG_RESULT([not found, falling back to the built-in lua]) ! USE_SYSTEM_LUA=0 ! # LUA_DIR must always be an absolute path! ! LUA_DIR="`pwd`/$srcdir/modules/lua" ! AC_SUBST([LUA_DIR]) ! fi + else + + USE_SYSTEM_LUA=1 + LUA_DIR="$lua_dir" + fi + + + if test "$USE_SYSTEM_LUA" = "0"; then + + # Checks used to determine right LUA flags (see modules/lua/src/Makefile) + luadefs= + lualibs= + + # these do not require additional libs + AC_CHECK_FUNC([isatty], [luadefs="$luadefs -DLUA_USE_ISATTY"]) + AC_CHECK_FUNC([mkstemp], [luadefs="$luadefs -DLUA_USE_MKSTEMP"]) + AC_CHECK_FUNC([popen], [luadefs="$luadefs -DLUA_USE_POPEN"]) + AC_CHECK_FUNC([_longjmp], [luadefs="$luadefs -DLUA_USE_ULONGJMP"]) + + # these require addlibs + AC_CHECK_LIB([dl], [dlopen], [ + AC_CHECK_HEADER([dlfcn.h], [ + luadefs="$luadefs -DLUA_USE_DLOPEN" + lualibs="$lualibs -ldl" + ]) + ]) + AC_CHECK_LIB([readline], [readline], [ + luadefs="$luadefs -DLUA_USE_READLINE" + lualibs="$lualibs -lreadline" + ]) + + LUA_PLATFORM_SPECIFIC_CFLAGS=$luadefs + LUA_PLATFORM_SPECIFIC_LDFLAGS=$lualibs + AC_SUBST(LUA_PLATFORM_SPECIFIC_CFLAGS) + AC_SUBST(LUA_PLATFORM_SPECIFIC_LDFLAGS) + + fi *************** *** 334,338 **** # the wx.so library in ../lib; thus we need to copy the sample(s) to the # build directory to preserve the relative path correctness ! if [[ "$top_srcdir" != "." ]]; then AC_MSG_NOTICE([configure: copying $srcdir/samples to ./samples]) --- 391,399 ---- # the wx.so library in ../lib; thus we need to copy the sample(s) to the # build directory to preserve the relative path correctness ! # ! # NOTE: we cannot check $top_srcdir here since it's not defined yet at this ! # point of the configure script ! # ! if [[ ! -d "samples" ]]; then AC_MSG_NOTICE([configure: copying $srcdir/samples to ./samples]) *************** *** 374,377 **** --- 435,446 ---- # modules echo + + if test "$USE_SYSTEM_LUA" = "1"; then + echo " - Using SYSTEM lua library (prefix is $lua_dir)" + else + echo " - Using BUILT-IN lua library" + fi + + AM_BOOLOPT_SUMMARY([USE_WXBINDSTC], [" - wxBindSTC module: yes"], |