On 1/14/08, Rob Kendrick <[EMAIL PROTECTED]> wrote:
> Under Debian and Debian-like systems (such as Ubuntu), Lua's header
> files are stored in /usr/include/lua5.1/ and the shared object is called
> liblua5.1.so.  This is so you can have multiple versions installed at
> once.
>
> wxLua's configure script does not detect Lua when it is installed in
> such a location, and uses its built-in version.
>
> Additionally, I cannot find an option to force wxLua to use its internal
> version in the event it does find a copy on the system.
>

Francesco, I think this should fix it. Add new --enable-systemlua=yes/no/auto.

Not committed.

Regards,
    John


AC_ARG_ENABLE([systemlua],
                [AC_HELP_STRING([--enable-systemlua], [Use the system
Lua (default is auto)])],
                [], [enable_systemlua=auto])
AC_ARG_WITH([lua-prefix],
                [AC_HELP_STRING([--with-lua-prefix], [Prefix where Lua
is installed (optional)])],
                [lua_dir="$withval"], [lua_dir=""])

...

# 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

AC_MSG_CHECKING([if Lua 5.1 is installed])

if test ! "$enable_systemlua" = "no"; then

    UTILS_SAVE_COREVAR()

    # force C compilation, not C++
    CPPFLAGS="-x c $CPPFLAGS"

    # use their Lua path --with-lua-prefix=$lua_dir
    if test ! "$lua_dir" = ""; then
        CPPFLAGS="-I$lua_dir $CPPFLAGS"
    fi
    LIBS="$LIBS -llua5.1"
    AC_LINK_IFELSE([
                    AC_LANG_PROGRAM([#include <lua.h>],
                                    [lua_newtable(NULL);])
                    ],
                    [LUA_PRESENCE=1], [LUA_PRESENCE=0])

    # NOTE: put this AC_MSG_CHECKING macro call immediately before
    #       the AC_MSG_RESULT macro calls as otherwise messages coming
    #       from other macros called by AC_LINK_IFELSE may interfere
    #       in the final output
    if test "$LUA_PRESENCE" = "1"; then
        AC_MSG_RESULT([yes, using system Lua])
        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

    UTILS_RESTORE_COREVAR()        # remove the -llua5.1 piece from $LIBS

else
    AC_MSG_RESULT([using built-in Lua --enable-systemlua=no])
    USE_SYSTEM_LUA=0
    LUA_DIR="`pwd`/$srcdir/modules/lua"
fi

-------------------------------------------------------------------------
Check out the new SourceForge.net Marketplace.
It's the best place to buy or sell services for
just about anything Open Source.
http://ad.doubleclick.net/clk;164216239;13503038;w?http://sf.net/marketplace
_______________________________________________
wxlua-users mailing list
wxlua-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wxlua-users

Reply via email to