5 # Some system may have custom pkg-config executable name
6 PKG_CONFIG ?
= pkg-config
12 # Installation path prefix. Unless you know what you're doing, the default
13 # of /usr/local is likely the correct choice.
14 #DIST: PREFIX=/usr/local
17 # Unless you are creating a package conforming to some OS's standards, you
18 # probably do not want to modify the following directories:
22 # Some .lua files and ion-* shell scripts
23 SHAREDIR
=$(PREFIX
)/share
/notion
25 MANDIR
=$(PREFIX
)/share
/man
27 DOCDIR
=$(PREFIX
)/share
/doc
/notion
28 # Nothing at the moment
31 MODULEDIR
=$(LIBDIR
)/notion
/mod
32 # Compiled Lua source code
33 LCDIR
=$(LIBDIR
)/notion
/lc
34 # ion-completefile (does not belong in SHAREDIR being a binary file)
35 EXTRABINDIR
=$(LIBDIR
)/notion
/bin
36 # For notion-completeman system-wide cache
37 VARDIR
=/var
/cache
/notion
39 LOCALEDIR
=$(PREFIX
)/share
/locale
41 # Configuration .lua files. Overrideable, as config files are usually
42 # not placed under $(PREFIX).
43 ETCDIR ?
= $(PREFIX
)/etc
/notion
45 # Force all include files to be installed to /usr even if the
46 # PREFIX is unset. No header files are installed at the moment
49 INCDIR
= $(PREFIX
)/include/notion
51 INCDIR
= /usr
/include/notion
54 # Executable suffix (for Cygwin).
62 # Set PRELOAD_MODULES=1 if your system does not support dynamically loaded
63 # modules through 'libdl' or has non-standard naming conventions.
64 # You will likely need this option on e.g. Cygwin and Mac OS X.
67 # Flags to link with libdl. Even if PRELOAD_MODULES=1, you may need this
68 # setting (for e.g. Lua, when not instructed by pkg-config).
76 include $(TOPDIR
)/build
/lua-detect.mk
79 ## X libraries, includes and options
83 X11_PREFIX ?
= /usr
/X11R6
85 #X11_PREFIX ?= /usr/openwin
87 X11_LIBS
=-L
$(X11_PREFIX
)/lib
-lX11
-lXext
88 X11_INCLUDES
=-I
$(X11_PREFIX
)/include
90 # XFree86 libraries up to 4.3.0 have a bug that can cause a segfault.
91 # The following setting should work around that situation.
92 DEFINES
+= -DCF_XFREE86_TEXTPROP_BUG_WORKAROUND
94 # Use the Xutf8 routines (XFree86 extension) instead of the Xmb routines
95 # in an UTF-8 locale. (No, you don't need this in UTF-8 locales, and
96 # most likely don't even want. It's only there because both Xmb and
97 # Xutf8 routines are broken, in different ways.)
98 #DEFINES += -DCF_DE_USE_XUTF8
100 # Remap F11 key to SunF36 and F12 to SunF37? You may want to set this
102 #DEFINES += -DCF_SUN_F1X_REMAP
109 # If you're on an archaic system (such as relatively recent *BSD releases)
110 # without even dummy multibyte/widechar and localisation support, you may
111 # have to uncomment the following line:
112 #DEFINES += -DCF_NO_LOCALE -DCF_NO_GETTEXT
114 # On some other systems you may need to explicitly link against libintl.
115 #EXTRA_LIBS += -lintl
116 # You may also need to give the location of its headers. The following
117 # should work on Mac OS X (which needs the above option as well) with
119 #EXTRA_INCLUDES += -I/opt/local/include
126 # You may uncomment this if you know that your system C libary provides
127 # asprintf and vasprintf. (GNU libc does.) If HAS_SYSTEM_ASPRINTF is not
128 # defined, an implementation provided in libtu/sprintf_2.2/ is used.
129 HAS_SYSTEM_ASPRINTF ?
= 1
131 # The following setting is needed with GNU libc for clock_gettime and the
132 # monotonic clock. Other systems may not need it, or may not provide a
133 # monotonic clock at all (which Ion can live with, and usually detect).
136 # Cygwin needs this. Also when you disable _BSD_SOURCE you may need it.
137 #DEFINES += -DCF_NO_GETLOADAVG
141 # If you're using/have gcc, it is unlikely that you need to modify
142 # any of the settings below this line.
144 #####################################################################
153 WARN
=-W
-Wall
-pedantic
155 CFLAGS
+= -Os
$(WARN
) $(DEFINES
) $(INCLUDES
) $(EXTRA_INCLUDES
) \
156 -DHAS_SYSTEM_ASPRINTF
=$(HAS_SYSTEM_ASPRINTF
)
158 LDFLAGS
+= -Wl
,--as-needed
$(LIBS
) $(EXTRA_LIBS
)
159 EXPORT_DYNAMIC
=-Xlinker
--export-dynamic
161 # The following options are mainly for development use and can be used
162 # to check that the code seems to conform to some standards. Depending
163 # on the version and vendor of you libc, the options may or may not have
164 # expected results. If you define one of C99_SOURCE or XOPEN_SOURCE, you
165 # may also have to define the other.
169 POSIX_SOURCE?
=-D_POSIX_C_SOURCE
=200112L
170 BSD_SOURCE?
=-D_BSD_SOURCE
173 XOPEN_SOURCE
=-D_XOPEN_SOURCE
-D_XOPEN_SOURCE_EXTENDED
175 #XOPEN_SOURCE=-D__EXTENSIONS__
177 C99_SOURCE?
=-std
=c99
-DCF_HAS_VA_COPY
179 # The -DCF_HAS_VA_COPY option should allow for some optimisations, and
180 # in some cases simply defining
181 #C99_SOURCE=-DCF_HAS_VA_COPY
182 # might allow for those optimisations to be taken without any special
183 # libc or compiler options.
198 INSTALL ?
= sh
$(TOPDIR
)/install-sh
-c
200 INSTALLDIR ?
= mkdir
-p
215 ifeq ($(PRELOAD_MODULES
),1)
216 X11_LIBS
+= -lXinerama
-lXrandr