Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

use pkg-config to detect cflags #10

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,13 @@ PREFIX = /usr/local
CFLAGS = -O3 -Wall -pedantic -DNDEBUG
CJSON_CFLAGS = -fpic
CJSON_LDFLAGS = -shared
LUA_PC = lua$(LUA_VERSION)
LUA_INCLUDE_DIR = $(PREFIX)/include
LUA_CMODULE_DIR = $(PREFIX)/lib/lua/$(LUA_VERSION)
LUA_MODULE_DIR = $(PREFIX)/share/lua/$(LUA_VERSION)
LUA_BIN_DIR = $(PREFIX)/bin
LUA_CFLAGS = $(shell pkg-config $(LUA_PC) --cflags --silence-errors \
|| echo "-I$(LUA_INCLUDE_DIR)")

##### Platform overrides #####
##
Expand Down Expand Up @@ -79,7 +82,7 @@ EXECPERM = 755

ASCIIDOC = asciidoc

BUILD_CFLAGS = -I$(LUA_INCLUDE_DIR) $(CJSON_CFLAGS)
BUILD_CFLAGS = $(LUA_CFLAGS) $(CJSON_CFLAGS)
OBJS = lua_cjson.o strbuf.o $(FPCONV_OBJS)

.PHONY: all clean install install-extra doc
Expand Down