Skip to content

Instantly share code, notes, and snippets.

@zhaozg
Created September 2, 2014 01:40
Show Gist options
  • Save zhaozg/f0768b40c65894a96cfd to your computer and use it in GitHub Desktop.
Save zhaozg/f0768b40c65894a96cfd to your computer and use it in GitHub Desktop.
detect lua lib in Makefile
exist = $(shell pkg-config --exists luajit; if [ $?=0 ]; then echo "exist"; else echo "notexist"; fi;)
ifeq ($(exist), exist)
override CFLAGS += $(shell pkg-config luajit --cflags)
override LFLAGS += $(shell pkg-config luajit --libs)
else
exist = $(shell pkg-config --exists lua; if [ $?=0 ]; then echo "exist"; else echo "notexist"; fi;)
ifeq ($(exist), exist)
override CFLAGS += $(shell pkg-config lua --cflags)
override LFLAGS += $(shell pkg-config lua --libs)
endif
endif
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment