-
Notifications
You must be signed in to change notification settings - Fork 23
/
configure.ac
295 lines (267 loc) · 8.35 KB
/
configure.ac
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
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
AC_PREREQ([2.68])
AC_INIT([luacxx], [3.0], [dafrito@gmail.com], [luacxx], [http://www.github.com/dafrito/luacxx])
AC_SUBST([PACKAGE_RELEASE], [1])
AC_SUBST([PACKAGE_DESCRIPTION], ["C++11 bindings and modules for Lua"])
AM_INIT_AUTOMAKE([-Wall foreign serial-tests subdir-objects])
AC_CONFIG_SRCDIR([src/stack.hpp])
AC_CONFIG_HEADERS([src/config.hpp])
AC_CONFIG_MACRO_DIR([m4])
m4_ifdef([AM_PROG_AR], [AM_PROG_AR])
LT_PREREQ([2.2])
LT_INIT
AC_PROG_LIBTOOL
# Check for build programs
AC_PROG_CXX
AC_PROG_CC
AC_PROG_INSTALL
AC_PROG_LN_S
AC_LANG([C++])
AC_HEADER_STDBOOL
AC_TYPE_SIZE_T
AX_CXX_COMPILE_STDCXX_11([noext],[stdcxx11_CFLAGS])
AC_SUBST([stdcxx11_CFLAGS])
# Check for Boost. It's used for unit tests
AX_BOOST_BASE([], [:], [:])
AX_BOOST_UNIT_TEST_FRAMEWORK
AX_HAVE_QT_MOC
PKG_CHECK_MODULES(lua, [lua >= 5.0],
[],
[AC_MSG_ERROR([Lua is required to build Luacxx])]
)
luacxx_with_default=no
AC_ARG_WITH([linux],
[AS_HELP_STRING([--with-linux], [build linux module])],
[],
[with_linux=$luacxx_with_default]
)
if test x$with_linux = xyes; then
AC_CHECK_HEADER(["linux/input.h"],
[with_linux=yes],
[with_linux=no]
)
AC_DEFINE([HAVE_linux], [1], [Defined if linux is available])
fi;
AM_CONDITIONAL([BUILD_linux], [test x$with_linux = xyes])
AC_ARG_WITH([Qt5Core],
[AS_HELP_STRING([--with-Qt5Core], [build Qt5Core module])],
[],
[with_Qt5Core=$luacxx_with_default]
)
if test x$with_Qt5Core = xyes; then
PKG_CHECK_MODULES(Qt5Core, [Qt5Core],
[with_Qt5Core=yes],
[with_Qt5Core=no]
)
AC_DEFINE([HAVE_Qt5Core], [1], [Defined if Qt5Core is available])
fi;
AM_CONDITIONAL([BUILD_Qt5Core], [test x$with_Qt5Core = xyes])
AC_ARG_WITH([Qt5Network],
[AS_HELP_STRING([--with-Qt5Network], [build Qt5Network module])],
[],
[with_Qt5Network=$luacxx_with_default]
)
if test x$with_Qt5Network = xyes; then
PKG_CHECK_MODULES(Qt5Network, [Qt5Network],
[with_Qt5Network=yes],
[with_Qt5Network=no]
)
AC_DEFINE([HAVE_Qt5Network], [1], [Defined if Qt5Network is available])
fi;
AM_CONDITIONAL([BUILD_Qt5Network], [test x$with_Qt5Network = xyes])
AC_ARG_WITH([Qt5Gui],
[AS_HELP_STRING([--with-Qt5Gui], [build Qt5Gui module])],
[],
[with_Qt5Gui=$luacxx_with_default]
)
if test x$with_Qt5Gui = xyes; then
PKG_CHECK_MODULES(Qt5Gui, [Qt5Gui],
[with_Qt5Gui=yes],
[with_Qt5Gui=no]
)
AC_DEFINE([HAVE_Qt5Gui], [1], [Defined if Qt5Gui is available])
fi;
AM_CONDITIONAL([BUILD_Qt5Gui], [test x$with_Qt5Gui = xyes])
AC_ARG_WITH([Qt5Sql],
[AS_HELP_STRING([--with-Qt5Sql], [build Qt5Sql module])],
[],
[with_Qt5Sql=$luacxx_with_default]
)
if test x$with_Qt5Sql = xyes; then
PKG_CHECK_MODULES(Qt5Sql, [Qt5Sql],
[with_Qt5Sql=yes],
[with_Qt5Sql=no]
)
AC_DEFINE([HAVE_Qt5Sql], [1], [Defined if Qt5Sql is available])
fi;
AM_CONDITIONAL([BUILD_Qt5Sql], [test x$with_Qt5Sql = xyes])
AC_ARG_WITH([Qt5Widgets],
[AS_HELP_STRING([--with-Qt5Widgets], [build Qt5Widgets module])],
[],
[with_Qt5Widgets=$luacxx_with_default]
)
if test x$with_Qt5Widgets = xyes; then
PKG_CHECK_MODULES(Qt5Widgets, [Qt5Widgets],
[with_Qt5Widgets=yes],
[with_Qt5Widgets=no]
)
AC_DEFINE([HAVE_Qt5Widgets], [1], [Defined if Qt5Widgets is available])
fi;
AM_CONDITIONAL([BUILD_Qt5Widgets], [test x$with_Qt5Widgets = xyes])
AC_ARG_WITH([ncurses],
[AS_HELP_STRING([--with-ncurses], [build ncurses module])],
[],
[with_ncurses=$luacxx_with_default]
)
if test x$with_ncurses = xyes; then
PKG_CHECK_MODULES(ncurses, [ncursesw],
[with_ncurses=yes],
[with_ncurses=no]
)
AC_DEFINE([HAVE_ncurses], [1], [Defined if ncurses is available])
fi;
AM_CONDITIONAL([BUILD_ncurses], [test x$with_ncurses = xyes])
AC_ARG_WITH([libevdev],
[AS_HELP_STRING([--with-libevdev], [build libevdev module])],
[],
[with_libevdev=$luacxx_with_default]
)
if test x$with_libevdev = xyes; then
PKG_CHECK_MODULES(libevdev, [libevdev],
[with_libevdev=yes],
[with_libevdev=no]
)
AC_DEFINE([HAVE_libevdev], [1], [Defined if libevdev is available])
fi;
AM_CONDITIONAL([BUILD_libevdev], [test x$with_libevdev = xyes])
AC_ARG_WITH([libinput],
[AS_HELP_STRING([--with-libinput], [build libinput module])],
[],
[with_libinput=$luacxx_with_default]
)
if test x$with_libinput = xyes; then
PKG_CHECK_MODULES(libinput, [libinput],
[with_libinput=yes],
[with_libinput=no]
)
AC_DEFINE([HAVE_libinput], [1], [Defined if libinput is available])
fi;
AM_CONDITIONAL([BUILD_libinput], [test x$with_libinput = xyes])
AC_ARG_WITH([nanomsg],
[AS_HELP_STRING([--with-nanomsg], [build nanomsg module])],
[],
[with_nanomsg=$luacxx_with_default]
)
if test x$with_nanomsg = xyes; then
PKG_CHECK_MODULES(nanomsg, [libnanomsg],
[with_nanomsg=yes],
[with_nanomsg=no]
)
AC_DEFINE([HAVE_nanomsg], [1], [Defined if nanomsg is available])
fi;
AM_CONDITIONAL([BUILD_nanomsg], [test x$with_nanomsg = xyes])
AC_ARG_WITH([egl],
[AS_HELP_STRING([--with-egl], [build egl module])],
[],
[with_egl=$luacxx_with_default]
)
if test x$with_egl = xyes; then
PKG_CHECK_MODULES(egl, [egl],
[with_egl=yes],
[with_egl=no]
)
AC_DEFINE([HAVE_egl], [1], [Defined if egl is available])
fi;
AM_CONDITIONAL([BUILD_egl], [test x$with_egl = xyes])
AC_ARG_WITH([gbm],
[AS_HELP_STRING([--with-gbm], [build gbm module])],
[],
[with_gbm=$luacxx_with_default]
)
if test x$with_gbm = xyes; then
PKG_CHECK_MODULES(gbm, [gbm],
[with_gbm=yes],
[with_gbm=no]
)
AC_DEFINE([HAVE_gbm], [1], [Defined if gbm is available])
fi;
AM_CONDITIONAL([BUILD_gbm], [test x$with_gbm = xyes])
AC_ARG_WITH([drm],
[AS_HELP_STRING([--with-drm], [build drm module])],
[],
[with_drm=$luacxx_with_default]
)
if test x$with_drm = xyes; then
PKG_CHECK_MODULES(drm, [libdrm],
[with_drm=yes],
[with_drm=no]
)
AC_DEFINE([HAVE_drm], [1], [Defined if drm is available])
fi;
AM_CONDITIONAL([BUILD_drm], [test x$with_drm = xyes])
AC_ARG_WITH([gobject-introspection],
[AS_HELP_STRING([--with-gobject-introspection], [build gobject-introspection module])],
[],
[with_gobject_introspection=$luacxx_with_default]
)
if test x$with_gobject_introspection = xyes; then
PKG_CHECK_MODULES(gobject_introspection, [gobject-introspection-no-export-1.0],
[with_gobject_introspection=yes],
[with_gobject_introspection=no]
)
AC_DEFINE([HAVE_gobject_introspection], [1], [Defined if gobject-introspection is available])
fi;
AM_CONDITIONAL([BUILD_gobject_introspection], [test x$with_gobject_introspection = xyes])
AC_ARG_WITH([llvm],
[AS_HELP_STRING([--with-llvm], [build modules for LLVM])],
[],
[with_llvm=$luacxx_with_default]
)
AC_SUBST(llvm_CFLAGS)
AC_SUBST(llvm_LIBS)
if test x$with_llvm = xyes; then
AC_CHECK_PROG([with_llvm], [llvm-config], [yes], [no])
llvm_CFLAGS=`llvm-config --cxxflags`
llvm_LIBS=`llvm-config --ldflags`
AC_DEFINE([HAVE_llvm], [1], [Defined if LLVM is available])
else
with_llvm=no
fi;
AM_CONDITIONAL([BUILD_llvm], [test x$with_llvm = xyes])
AC_CONFIG_FILES([
Makefile
src/Makefile
luacxx.spec
src/pkg-config/luacxx.pc.head
src/pkg-config/llvm.pc.head
src/pkg-config/Qt5Core.pc.head
src/pkg-config/Qt5Network.pc.head
src/pkg-config/Qt5Gui.pc.head
src/pkg-config/Qt5Sql.pc.head
src/pkg-config/Qt5Widgets.pc.head
src/pkg-config/gobject-introspection.pc.head
src/pkg-config/ncurses.pc.head
src/pkg-config/nanomsg.pc.head
src/pkg-config/libevdev.pc.head
src/pkg-config/libinput.pc.head
src/pkg-config/egl.pc.head
src/pkg-config/drm.pc.head
src/pkg-config/gbm.pc.head
src/pkg-config/linux.pc.head
])
AC_OUTPUT
AC_MSG_RESULT([
Qt5Core ${with_Qt5Core}
Qt5Network ${with_Qt5Network}
Qt5Sql ${with_Qt5Sql}
Qt5Gui ${with_Qt5Gui}
Qt5Widgets ${with_Qt5Widgets}
ncurses ${with_ncurses}
libinput ${with_libinput}
libevdev ${with_libevdev}
nanomsg ${with_nanomsg}
llvm ${with_llvm}
gobject-introspection ${with_gobject_introspection}
egl ${with_egl}
gbm ${with_gbm}
drm ${with_drm}
])