aboutsummaryrefslogtreecommitdiff
path: root/Makefile
diff options
context:
space:
mode:
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile58
1 files changed, 38 insertions, 20 deletions
diff --git a/Makefile b/Makefile
index 10e0ba1..1cf5d53 100644
--- a/Makefile
+++ b/Makefile
@@ -4,31 +4,49 @@ LUA_VERSION = 5.1
4# See http://lua-users.org/wiki/BuildingModules for platform specific 4# See http://lua-users.org/wiki/BuildingModules for platform specific
5# details. 5# details.
6 6
7## Linux/BSD 7## Available Lua CJSON specific workarounds
8PREFIX ?= /usr/local 8#
9LDFLAGS += -shared 9# To ensure JSON encoding/decoding works correctly for locales using
10# comma decimal separators, Lua CJSON must be compiled with one of
11# these options:
12# USE_POSIX_USELOCALE: Linux, OSX. Thread safe. Recommended option.
13# USE_POSIX_SETLOCALE: Works on all ANSI C platforms. May be used when
14# thread-safety isn't required.
15#
16# USE_INTERNAL_ISINF: Handle Solaris platforms that are missing isinf().
17
18# Tweak one of these platform sections below to suit your situation.
19
20## Linux
21PREFIX ?= /usr/local
22CFLAGS_EXTRA ?= -DUSE_POSIX_USELOCALE
23LDFLAGS_EXTRA ?= -shared
24
25## FreeBSD
26#PREFIX ?= /usr/local
27#CFLAGS_EXTRA ?= -DUSE_POSIX_SETLOCALE
28#LUA_INCLUDE_DIR ?= $(PREFIX)/include/lua51
29#LDFLAGS_EXTRA ?= -shared
10 30
11## OSX (Macports) 31## OSX (Macports)
12#PREFIX ?= /opt/local 32#PREFIX ?= /opt/local
13#LDFLAGS += -bundle -undefined dynamic_lookup 33#CFLAGS_EXTRA ?= -DUSE_POSIX_USELOCALE
34#LDFLAGS_EXTRA ?= -bundle -undefined dynamic_lookup
14 35
15LUA_INCLUDE_DIR ?= $(PREFIX)/include 36## Solaris
16LUA_LIB_DIR ?= $(PREFIX)/lib/lua/$(LUA_VERSION) 37#PREFIX ?= /usr/local
38#CFLAGS_EXTRA ?= -DUSE_POSIX_SETLOCALE -DUSE_INTERNAL_ISINF
39#LDFLAGS_EXTRA ?= -shared
17 40
18#CFLAGS ?= -g -Wall -pedantic -fno-inline 41## End platform specific section
19CFLAGS ?= -g -O3 -Wall -pedantic
20override CFLAGS += -fpic -I$(LUA_INCLUDE_DIR) -DVERSION=\"$(CJSON_VERSION)\"
21 42
22## Optional work arounds 43LUA_INCLUDE_DIR ?= $(PREFIX)/include
23# Handle Solaris platforms that are missing isinf(). 44LUA_LIB_DIR ?= $(PREFIX)/lib/lua/$(LUA_VERSION)
24#override CFLAGS += -DUSE_INTERNAL_ISINF 45
25# Handle locales that use comma as a decimal separator on locale aware 46#CFLAGS ?= -g -Wall -pedantic -fno-inline
26# platforms (optional, but recommended). 47CFLAGS ?= -O3 -Wall -pedantic
27# USE_POSIX_USELOCALE: Linux, OSX. Thread safe. Recommended option. 48override CFLAGS += $(CFLAGS_EXTRA) -fpic -I$(LUA_INCLUDE_DIR) -DVERSION=\"$(CJSON_VERSION)\"
28# USE_POSIX_SETLOCALE: Works on all ANSI C platforms. May be used when 49override LDFLAGS += $(LDFLAGS_EXTRA)
29# thread-safety isn't required.
30override CFLAGS += -DUSE_POSIX_USELOCALE
31#override CFLAGS += -DUSE_POSIX_SETLOCALE
32 50
33INSTALL ?= install 51INSTALL ?= install
34 52