Released version 3-2015061300
[notion.git] / libextl / system-autodetect.mk
blob48417cac46e932f6e445b7b50ffabf48a9cb990a
1 ##
2 ## System settings
3 ##
6 ##
7 ## Installation paths
8 ##
10 PREFIX=/usr/local
12 # Unless you are creating a package conforming to some OS's standards, you
13 # probably do not want to modify the following directories:
15 # Main binaries
16 BINDIR=$(PREFIX)/bin
17 # Configuration .lua files
18 ETCDIR=$(PREFIX)/etc/libextl
19 # Some .lua files and ion-* shell scripts
20 SHAREDIR=$(PREFIX)/share/libextl
21 # Manual pages
22 MANDIR=$(PREFIX)/share/man
23 # Some documents
24 DOCDIR=$(PREFIX)/share/doc/libextl
25 # Nothing at the moment
26 INCDIR=$(PREFIX)/include/libextl
27 # Nothing at the moment
28 LIBDIR=$(PREFIX)/lib
29 # Modules
30 MODULEDIR=$(LIBDIR)/libextl/mod
31 # Compiled Lua source code
32 LCDIR=$(LIBDIR)/libextl/lc
33 # ion-completefile (does not belong in SHAREDIR being a binary file)
34 EXTRABINDIR=$(LIBDIR)/libextl/bin
35 # For ion-completeman system-wide cache
36 VARDIR=/var/cache/libextl
37 # Message catalogs
38 LOCALEDIR=$(PREFIX)/share/locale
42 ## Libtu
45 LIBTU_LIBS = -ltu
46 LIBTU_INCLUDES =
49 ## Lua
52 # To skip auto-detection of lua uncomment this and edit the variables below to
53 # suit your installation of lua.
54 #LUA_MANUAL=1
56 # Default to paths and names that should work for a build installed from the
57 # official Lua 5.1 source tarball.
58 LUA_DIR=$(shell dirname `which lua` | xargs dirname)
59 LUA_LIBS=-L$(LUA_DIR)/lib -llua
60 LUA_INCLUDES = -I$(LUA_DIR)/include
61 LUA=$(LUA_DIR)/bin/lua
62 LUAC=$(LUA_DIR)/bin/luac
64 # Attempt to autodect lua using pkg-config.
66 ifndef LUA_MANUAL
68 ifeq (5.2,$(findstring 5.2,$(shell pkg-config --exists lua5.2 && pkg-config --modversion lua5.2)))
70 LUA_LIBS=`pkg-config --libs lua5.2`
71 LUA_INCLUDES=`pkg-config --cflags lua5.2`
72 LUA=`which lua5.2`
73 LUAC=`which luac5.2`
75 else ifeq (5.1,$(findstring 5.1,$(shell pkg-config --exists lua5.1 && pkg-config --modversion lua5.1)))
77 LUA_LIBS=`pkg-config --libs lua5.1`
78 LUA_INCLUDES=`pkg-config --cflags lua5.1`
79 LUA=`which lua5.1`
80 LUAC=`which luac5.1`
82 else ifeq (5.1,$(findstring 5.1,$(shell pkg-config --exists lua && pkg-config --modversion lua)))
84 LUA_LIBS=`pkg-config --libs lua`
85 LUA_INCLUDES=`pkg-config --cflags lua`
86 LUA=`which lua`
87 LUAC=`which luac`
89 endif # lua
91 endif # LUA_MANUAL
95 ## C compiler
98 CC=gcc
100 # Same as '-Wall -pedantic' without '-Wunused' as callbacks often
101 # have unused variables.
102 WARN= -W -Wimplicit -Wreturn-type -Wswitch -Wcomment \
103 -Wtrigraphs -Wformat -Wchar-subscripts \
104 -Wparentheses -pedantic -Wuninitialized
106 CFLAGS=-g -Os $(WARN) $(DEFINES) $(EXTRA_INCLUDES) $(INCLUDES)
107 LDFLAGS=-g -Os $(EXTRA_LIBS) $(LIBS)
109 # The following options are mainly for development use and can be used
110 # to check that the code seems to conform to some standards. Depending
111 # on the version and vendor of you libc, the options may or may not have
112 # expected results. If you define one of C99_SOURCE or XOPEN_SOURCE, you
113 # may also have to define the other.
115 #C89_SOURCE=-ansi
117 #POSIX_SOURCE=-D_POSIX_SOURCE
119 # Most systems
120 #XOPEN_SOURCE=-D_XOPEN_SOURCE -D_XOPEN_SOURCE_EXTENDED
121 # SunOS, (Irix)
122 #XOPEN_SOURCE=-D__EXTENSIONS__
124 #C99_SOURCE=-std=c99 -DCF_HAS_VA_COPY
126 # The -DCF_HAS_VA_COPY option should allow for some optimisations, and
127 # in some cases simply defining
128 #C99_SOURCE=-DCF_HAS_VA_COPY
129 # might allow for those optimisations to be taken without any special
130 # libc or compiler options.
133 ## AR
136 AR=ar
137 ARFLAGS=cr
138 RANLIB=ranlib
142 ## Install & strip
145 INSTALL=sh $(TOPDIR)/install-sh -c
146 INSTALLDIR=mkdir -p
148 BIN_MODE=755
149 DATA_MODE=644
151 STRIP=strip
153 RM=rm