From 8da7b226def76b14b18cb29c4a9d41316ae6cfcd Mon Sep 17 00:00:00 2001 From: Stepets Date: Sat, 26 Apr 2014 14:26:31 +0400 Subject: LuaJIT auto detect part 2 now one may just type "make" without specifing flags and libs and get luajit compatible lanes build !!pkg-config required!! --- src/Makefile | 36 ++++++++++++++++++++++-------------- 1 file changed, 22 insertions(+), 14 deletions(-) (limited to 'src') diff --git a/src/Makefile b/src/Makefile index b50c10d..539f56e 100644 --- a/src/Makefile +++ b/src/Makefile @@ -41,24 +41,32 @@ ifeq "$(LUAROCKS)" "" # Autodetect LUA_FLAGS and/or LUA_LIBS # ifneq "$(shell which pkg-config)" "" - ifeq "$(shell pkg-config --exists lua5.1 && echo 1)" "1" - LUA_FLAGS:=$(shell pkg-config --cflags lua5.1) - LUA_LIBS:=$(shell pkg-config --libs lua5.1) + ifeq "$(shell pkg-config --exists luajit && echo 1)" "1" + LUA_FLAGS:=$(shell pkg-config --cflags luajit) + LUA_LIBS:=$(shell pkg-config --libs luajit) # - # Ubuntu: -I/usr/include/lua5.1 - # -llua5.1 + # Debian: -I/usr/include/luajit-2.0 + # -lluajit-5.1 else - ifeq "$(shell pkg-config --exists lua && echo 1)" "1" - LUA_FLAGS:=$(shell pkg-config --cflags lua) - LUA_LIBS:=$(shell pkg-config --libs lua) + ifeq "$(shell pkg-config --exists lua5.1 && echo 1)" "1" + LUA_FLAGS:=$(shell pkg-config --cflags lua5.1) + LUA_LIBS:=$(shell pkg-config --libs lua5.1) # - # OS X fink with pkg-config: - # -I/sw/include - # -L/sw/lib -llua -lm + # Ubuntu: -I/usr/include/lua5.1 + # -llua5.1 else - $(warning *** 'pkg-config' existed but did not know of 'lua[5.1]' - Good luck!) - LUA_FLAGS:= - LUA_LIBS:=-llua + ifeq "$(shell pkg-config --exists lua && echo 1)" "1" + LUA_FLAGS:=$(shell pkg-config --cflags lua) + LUA_LIBS:=$(shell pkg-config --libs lua) + # + # OS X fink with pkg-config: + # -I/sw/include + # -L/sw/lib -llua -lm + else + $(warning *** 'pkg-config' existed but did not know of 'lua[5.1]' - Good luck!) + LUA_FLAGS:= + LUA_LIBS:=-llua + endif endif endif else -- cgit v1.2.3-55-g6feb