Skip to content

Instantly share code, notes, and snippets.

@deryni
Created November 26, 2013 03:37
Show Gist options
  • Save deryni/7653111 to your computer and use it in GitHub Desktop.
Save deryni/7653111 to your computer and use it in GitHub Desktop.
lua-detect.mk test
LUA_VERSION := $(or $(LUA_VERSION), $(shell \
(pkg-config --exists lua5.2 && echo 5.2) \
|| (pkg-config --exists lua5.1 && echo 5.1) \
|| (pkg-config --exists lua && echo 5.0)))
LUA_VERSION2 := $(or $(LUA_VERSION2), $(shell \
for ver in 5.2 5.1 ""; do\
pkg-config --exists lua$$ver && echo "lua$$ver" && exit;\
done))
$(info $$(LUA_VERSION): $(LUA_VERSION))
$(info $$(LUA_VERSION2): $(LUA_VERSION2))
$(info LV)
$(info $(shell pkg-config --libs --cflags $(LUA_VERSION)))
$(info LV2)
$(info $(shell pkg-config --libs --cflags $(LUA_VERSION2)))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment