Skip to content

Commit

Permalink
Add a generic lluadash tag
Browse files Browse the repository at this point in the history
Adds a generic lluadash tag that used in conjunction with a lua version
tag uses liblua-X.Y as the library name.
  • Loading branch information
aarzilli committed Aug 9, 2024
1 parent 11106aa commit e24027f
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 21 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ If you want to statically link to liblua.a you can do that with `-tags luaa`. Lu
specifying `-tags luajit`.

The library uses lua5.1 by default but also supports lua5.2 by specifying `-tags lua52`, lua5.3 by
specifying `-tags lua53`, and lua5.4 by specifying `-tags lua54`.
specifying `-tags lua53`, and lua5.4 by specifying `-tags lua54`. If the library installed on your system has a dash, for example it is called `liblua-5.4` use the `lluadash` tag: `go build -tags lua54,lluadash ...`.

QUICK START
---------------------
Expand Down
43 changes: 23 additions & 20 deletions lua/lua.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,26 +15,29 @@ package lua
#cgo luaa LDFLAGS: -llua -lm -ldl
#cgo luajit LDFLAGS: -lluajit-5.1
#cgo lluadash5.1 LDFLAGS: -llua-5.1
#cgo linux,!lua52,!lua53,!lua54,!llua,!luaa,!luajit,!lluadash5.1 LDFLAGS: -llua5.1
#cgo linux,lua52,!llua,!luaa,!luajit,!lluadash5.1 LDFLAGS: -llua5.2
#cgo linux,lua53,!llua,!luaa,!luajit,!lluadash5.1 LDFLAGS: -llua5.3
#cgo linux,lua54,!llua,!luaa,!luajit,!lluadash5.1 LDFLAGS: -llua5.4 -lm
#cgo darwin,!lua52,!lua53,!lua54,!llua,!luaa,!luajit,!lluadash5.1 pkg-config: lua5.1
#cgo darwin,lua52,!llua,!luaa,!luajit,!lluadash5.1 pkg-config: lua5.2
#cgo darwin,lua53,!llua,!luaa,!luajit,!lluadash5.1 pkg-config: lua5.3
#cgo darwin,lua54,!llua,!luaa,!luajit,!lluadash5.1 pkg-config: lua5.4 m
#cgo freebsd,!lua52,!lua53,!lua54,!llua,!luaa,!luajit,!lluadash5.1 LDFLAGS: -llua-5.1
#cgo freebsd,lua52,!llua,!luaa,!luajit,!lluadash5.1 LDFLAGS: -llua-5.2
#cgo freebsd,lua53,!llua,!luaa,!luajit,!lluadash5.1 LDFLAGS: -llua-5.3
#cgo freebsd,lua54,!llua,!luaa,!luajit,!lluadash5.1 LDFLAGS: -llua-5.4 -lm
#cgo windows,!lua52,!lua53,!lua54,!llua,!luaa,!luajit,!lluadash5.1 LDFLAGS: -L${SRCDIR} -llua -lmingwex -lmingw32
#cgo windows,lua52,!llua,!luaa,!luajit,!lluadash5.1 LDFLAGS: -llua52
#cgo windows,lua53,!llua,!luaa,!luajit,!lluadash5.1 LDFLAGS: -llua53
#cgo windows,lua54,!llua,!luaa,!luajit,!lluadash5.1 LDFLAGS: -llua54
#cgo lua52,lluadash LDFLAGS: -llua-5.4
#cgo lua53,lluadash LDFLAGS: -llua-5.3
#cgo lua54,lluadash LDFLAGS: -llua-5.4 -lm
#cgo linux,!lua52,!lua53,!lua54,!llua,!luaa,!luajit,!lluadash5.1,!lluadash LDFLAGS: -llua5.1
#cgo linux,lua52,!llua,!luaa,!luajit,!lluadash5.1,!lluadash LDFLAGS: -llua5.2
#cgo linux,lua53,!llua,!luaa,!luajit,!lluadash5.1,!lluadash LDFLAGS: -llua5.3
#cgo linux,lua54,!llua,!luaa,!luajit,!lluadash5.1,!lluadash LDFLAGS: -llua5.4 -lm
#cgo darwin,!lua52,!lua53,!lua54,!llua,!luaa,!luajit,!lluadash5.1,!lluadash pkg-config: lua5.1
#cgo darwin,lua52,!llua,!luaa,!luajit,!lluadash5.1,!lluadash pkg-config: lua5.2
#cgo darwin,lua53,!llua,!luaa,!luajit,!lluadash5.1,!lluadash pkg-config: lua5.3
#cgo darwin,lua54,!llua,!luaa,!luajit,!lluadash5.1,!lluadash pkg-config: lua5.4 m
#cgo freebsd,!lua52,!lua53,!lua54,!llua,!luaa,!luajit,!lluadash5.1,!lluadash LDFLAGS: -llua-5.1
#cgo freebsd,lua52,!llua,!luaa,!luajit,!lluadash5.1,!lluadash LDFLAGS: -llua-5.2
#cgo freebsd,lua53,!llua,!luaa,!luajit,!lluadash5.1,!lluadash LDFLAGS: -llua-5.3
#cgo freebsd,lua54,!llua,!luaa,!luajit,!lluadash5.1,!lluadash LDFLAGS: -llua-5.4 -lm
#cgo windows,!lua52,!lua53,!lua54,!llua,!luaa,!luajit,!lluadash5.1,!lluadash LDFLAGS: -L${SRCDIR} -llua -lmingwex -lmingw32
#cgo windows,lua52,!llua,!luaa,!luajit,!lluadash5.1,!lluadash LDFLAGS: -llua52
#cgo windows,lua53,!llua,!luaa,!luajit,!lluadash5.1,!lluadash LDFLAGS: -llua53
#cgo windows,lua54,!llua,!luaa,!luajit,!lluadash5.1,!lluadash LDFLAGS: -llua54
#include <lua.h>
#include <stdlib.h>
Expand Down

0 comments on commit e24027f

Please sign in to comment.