forked from luakit/luakit
-
Notifications
You must be signed in to change notification settings - Fork 0
/
config.mk
98 lines (77 loc) · 2.82 KB
/
config.mk
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
# === Luakit Makefile Configuration ==========================================
# Compile/link options.
CC ?= gcc
CFLAGS += -std=gnu99 -ggdb -W -Wall -Wextra
LDFLAGS +=
CPPFLAGS +=
# Get current luakit version.
VERSION ?= $(shell ./build-utils/getversion.sh)
CPPFLAGS += -DVERSION=\"$(VERSION)\"
# === Paths ==================================================================
PREFIX ?= /usr/local
MANPREFIX ?= $(PREFIX)/share/man
DOCDIR ?= $(PREFIX)/share/luakit/docs
INSTALLDIR := $(DESTDIR)$(PREFIX)
MANPREFIX := $(DESTDIR)$(MANPREFIX)
DOCDIR := $(DESTDIR)$(DOCDIR)
# Should luakit be built to load relative config paths (./lib ./config) ?
# (Useful when running luakit from it's source directory, disable otherwise).
ifneq ($(DEVELOPMENT_PATHS),0)
CPPFLAGS += -DDEVELOPMENT_PATHS
endif
# === Platform specific ======================================================
uname_s := $(shell uname -s)
# Mac OSX
ifeq ($(uname_s),Darwin)
LINKER_EXPORT_DYNAMIC = 0
endif
# Some systems need the --export-dynamic linker option to load other
# dynamically linked C Lua modules (for example lua-filesystem).
ifneq ($(LINKER_EXPORT_DYNAMIC),0)
LDFLAGS += -Wl,--export-dynamic
endif
# === Lua package name detection =============================================
LUA_PKG_NAMES += lua lua-5.1 lua5.1 lua51
# Force linking against Lua's Just-In-Time compiler.
# See http://luajit.org/ for more information.
ifeq ($(USE_LUAJIT),1)
LUA_PKG_NAME := luajit
else
# User hasn't specificed, use LuaJIT if we can find it.
ifneq ($(USE_LUAJIT),0)
LUA_PKG_NAMES := luajit $(LUA_PKG_NAMES)
endif
endif
# Search for Lua package name if not forced by user.
ifeq ($(LUA_PKG_NAME),)
LUA_PKG_NAME = $(shell sh -c '(for name in $(LUA_PKG_NAMES); do \
pkg-config --exists $$name && echo $$name; done) | head -n 1')
endif
# === Required build packages ================================================
# Packages required to build luakit.
PKGS += gtk+-2.0
PKGS += gthread-2.0
PKGS += webkit-1.0
PKGS += sqlite3
PKGS += $(LUA_PKG_NAME)
# For systems using older WebKit-GTK versions which bundle JavaScriptCore
# within the WebKit-GTK package.
ifneq ($(NO_JAVASCRIPTCORE),1)
PKGS += javascriptcoregtk-1.0
endif
# Build luakit with libunique bindings? (single instance support)
ifneq ($(USE_UNIQUE),0)
CPPFLAGS += -DWITH_UNIQUE
PKGS += unique-1.0
endif
# Check user has correct packages installed (and found by pkg-config).
PKGS_OK := $(shell pkg-config --print-errors --exists $(PKGS) && echo 1)
ifneq ($(PKGS_OK),1)
$(error Cannot find required package(s\) to build luakit. Please \
check you have the above packages installed and try again.)
endif
# Add pkg-config options to compile flags.
CFLAGS += $(shell pkg-config --cflags $(PKGS))
CFLAGS += -I./
# Add pkg-config options to linker flags.
LDFLAGS += $(shell pkg-config --libs $(PKGS))