forked from mirror/ledisdb
add lua build tag
maybe install golua error, and lua cannot be used
This commit is contained in:
parent
8ad6eabd6a
commit
b9ea592026
|
@ -16,4 +16,4 @@ go get github.com/BurntSushi/toml
|
|||
|
||||
go get github.com/siddontang/go-bson/bson
|
||||
|
||||
go get github.com/aarzilli/golua/lua
|
||||
go get github.com/siddontang/golua/lua
|
7
dev.sh
7
dev.sh
|
@ -74,6 +74,13 @@ if [ -f $HYPERLEVELDB_DIR/include/hyperleveldb/c.h ]; then
|
|||
GO_BUILD_TAGS="$GO_BUILD_TAGS hyperleveldb"
|
||||
fi
|
||||
|
||||
#check lua
|
||||
CHECK_LUA_FILE="$LEDISTOP/tools/check_lua.go"
|
||||
go run $CHECK_LUA_FILE 2>/dev/null
|
||||
if [ "$?" = 0 ]; then
|
||||
GO_BUILD_TAGS="$GO_BUILD_TAGS lua"
|
||||
fi
|
||||
|
||||
export CGO_CFLAGS
|
||||
export CGO_CXXFLAGS
|
||||
export CGO_LDFLAGS
|
||||
|
|
|
@ -1,10 +1,12 @@
|
|||
// +build lua
|
||||
|
||||
package server
|
||||
|
||||
import (
|
||||
"crypto/sha1"
|
||||
"encoding/hex"
|
||||
"fmt"
|
||||
"github.com/aarzilli/golua/lua"
|
||||
"github.com/siddontang/golua/lua"
|
||||
"github.com/siddontang/ledisdb/ledis"
|
||||
"strconv"
|
||||
"strings"
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
// +build lua
|
||||
|
||||
package server
|
||||
|
||||
import (
|
||||
|
|
|
@ -1,9 +1,11 @@
|
|||
// +build lua
|
||||
|
||||
package server
|
||||
|
||||
import (
|
||||
"encoding/hex"
|
||||
"fmt"
|
||||
"github.com/aarzilli/golua/lua"
|
||||
"github.com/siddontang/golua/lua"
|
||||
"github.com/siddontang/ledisdb/ledis"
|
||||
"io"
|
||||
"sync"
|
||||
|
@ -159,6 +161,10 @@ func (app *App) openScript() {
|
|||
l.OpenTable()
|
||||
l.OpenPackage()
|
||||
|
||||
l.OpenCJson()
|
||||
l.OpenCMsgpack()
|
||||
l.OpenStruct()
|
||||
|
||||
l.Register("error", luaErrorHandler)
|
||||
|
||||
s.l = l
|
||||
|
|
|
@ -0,0 +1,10 @@
|
|||
// +build !lua
|
||||
|
||||
package server
|
||||
|
||||
type script struct {
|
||||
}
|
||||
|
||||
func (app *App) openScript() {}
|
||||
|
||||
func (app *App) closeScript() {}
|
|
@ -1,8 +1,10 @@
|
|||
// +build lua
|
||||
|
||||
package server
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"github.com/aarzilli/golua/lua"
|
||||
"github.com/siddontang/golua/lua"
|
||||
"github.com/siddontang/ledisdb/config"
|
||||
|
||||
"testing"
|
||||
|
|
|
@ -0,0 +1,8 @@
|
|||
package main
|
||||
|
||||
import "github.com/siddontang/golua/lua"
|
||||
|
||||
func main() {
|
||||
L := lua.NewState()
|
||||
L.Close()
|
||||
}
|
Loading…
Reference in New Issue