@ -25,23 +25,50 @@ ifdef NO_C99_FORMAT
CFLAGS += -DNO_C99_FORMAT
CFLAGS += -DNO_C99_FORMAT
e n d i f
e n d i f
nullstring :=
fourspace := $( nullstring)
i f d e f N O _ L U A
i f d e f N O _ L U A
CFLAGS += -DNO_LUA
$( info $( fourspace) * building without specified Lua support)
CGIT_CFLAGS += -DNO_LUA
e l s e
e l s e
LUAJIT_CFLAGS := $( shell pkg-config --cflags luajit 2>/dev/null)
i f e q ( V A N I L L A , $( LUA_IMPLEMENTATION ) )
LUAJIT_LIBS := $( shell pkg-config --libs luajit 2>/dev/null)
CFLAGS += -llua
LUA_LIBS := $( shell pkg-config --libs lua 2>/dev/null)
e l s e
LUA_CFLAGS := $( shell pkg-config --cflags lua 2>/dev/null)
LUAJIT_LIBS := $( shell pkg-config --libs luajit)
i f e q ( J I T , $( LUA_IMPLEMENTATION ) )
LUAJIT_CFLAGS := $( shell pkg-config --cflags luajit)
ifeq ( $( strip $( LUAJIT_LIBS) ) ,)
$( error LuaJIT specified via LUA_IMPLEMENTATION = JIT, but library could not be found.)
endif
$( info $( fourspace) * building with selected LuaJIT)
CGIT_LIBS += $( LUAJIT_LIBS)
CGIT_CFLAGS += $( LUAJIT_CFLAGS)
e l s e i f e q ( V A N I L L A , $( LUA_IMPLEMENTATION ) )
ifeq ( $( strip $( LUA_LIBS) ) ,)
$( error Lua specified via LUA_IMPLEMENTATION = VANILLA, but library could not be found.)
endif
$( info $( fourspace) * building with selected Lua)
CGIT_LIBS += $( LUA_LIBS)
CGIT_LIBS += $( LUA_CFLAGS)
e l s e i f n e q ( $( strip $ ( LUAJIT_LIBS ) ) , )
$( info $( fourspace) * building with autodetected LuaJIT)
CGIT_LIBS += $( LUAJIT_LIBS)
CGIT_LIBS += $( LUAJIT_LIBS)
CFLAGS += $( LUAJIT_CFLAGS)
CGIT_CFLAGS += $( LUAJIT_CFLAGS)
e l s e i f n e q ( $( strip $ ( LUA_LIBS ) ) , )
$( info $( fourspace) * building with autodetected Lua)
CGIT_LIBS += $( LUA_LIBS)
CGIT_CFLAGS += $( LUA_CFLAGS)
e l s e
$( info $( fourspace) * building without autodetected Lua support)
NO_LUA := YesPlease
CGIT_CFLAGS += -DNO_LUA
e n d i f
e n d i f
e n d i f
e n d i f
CGIT_LIBS += -ldl
# Add -ldl to linker flags on non-BSD systems.
i f e q ( $( findstring BSD ,$ ( uname_S ) ) , )
CGIT_LIBS += -ldl
e n d i f
CGIT_OBJ_NAMES += cgit.o
CGIT_OBJ_NAMES += cgit.o