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
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
|
From 8301a3c8e542675e9b5f310d79ad24b9a12baaf8 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Sl=C3=A1vek=20Banko?= <slavek.banko@axis.cz>
Date: Wed, 22 Sep 2021 20:38:45 +0200
Subject: Add check whether Ruby requires explicit specification of C++
standard.
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Signed-off-by: Slávek Banko <slavek.banko@axis.cz>
---
korundum/bin/Makefile.am | 2 +
korundum/configure.in.in | 90 +++++++++++++++++++++++++++++++
korundum/rubylib/korundum/Makefile.am | 2 +
korundum/rubylib/korundum/configure.in.in | 59 --------------------
qtruby/bin/Makefile.am | 2 +
qtruby/configure.in.in | 90 +++++++++++++++++++++++++++++++
qtruby/rubylib/designer/uilib/Makefile.am | 2 +
qtruby/rubylib/qtruby/Makefile.am | 2 +
qtruby/rubylib/qtruby/configure.in.in | 59 --------------------
9 files changed, 190 insertions(+), 118 deletions(-)
create mode 100644 korundum/configure.in.in
delete mode 100644 korundum/rubylib/korundum/configure.in.in
create mode 100644 qtruby/configure.in.in
delete mode 100644 qtruby/rubylib/qtruby/configure.in.in
diff --git a/korundum/bin/Makefile.am b/korundum/bin/Makefile.am
index 508f7731..47a8bb02 100644
--- a/korundum/bin/Makefile.am
+++ b/korundum/bin/Makefile.am
@@ -1,3 +1,5 @@
+CXXFLAGS += $(RUBY_CXXFLAGS)
+
INCLUDES = $(all_includes) -I$(RUBY_ARCHDIR) $(RUBY_CFLAGS)
bin_PROGRAMS = krubyinit
diff --git a/korundum/configure.in.in b/korundum/configure.in.in
new file mode 100644
index 00000000..c420adc9
--- /dev/null
+++ b/korundum/configure.in.in
@@ -0,0 +1,90 @@
+AC_CHECK_PROG(RUBY_EXECUTABLE, ruby, ruby)
+
+if test -z "RUBY_EXECUTABLE"; then
+ DO_NOT_COMPILE="$DO_NOT_COMPILE korundum"
+else
+ RUBY_MAJOR=`${RUBY_EXECUTABLE} -r rbconfig -e "puts RbConfig::CONFIG.fetch(%q(MAJOR))"`
+ RUBY_MINOR=`${RUBY_EXECUTABLE} -r rbconfig -e "puts RbConfig::CONFIG.fetch(%q(MINOR))"`
+
+ RUBY_ARCHDIR=`${RUBY_EXECUTABLE} -r rbconfig -e "puts RbConfig::CONFIG.fetch(%q(archdir))"`
+ RUBY_SITEARCHDIR=`${RUBY_EXECUTABLE} -r rbconfig -e "puts RbConfig::CONFIG.fetch(%q(sitearchdir))"`
+ RUBY_SITEDIR=`${RUBY_EXECUTABLE} -r rbconfig -e "puts RbConfig::CONFIG.fetch(%q(sitelibdir))"`
+ RUBY_LIBDIR=`${RUBY_EXECUTABLE} -r rbconfig -e "puts RbConfig::CONFIG.fetch(%q(libdir))"`
+ RUBY_RUBYLIBDIR=`${RUBY_EXECUTABLE} -r rbconfig -e "puts RbConfig::CONFIG.fetch(%q(rubylibdir))"`
+ RUBY_LIBRUBYARG=`${RUBY_EXECUTABLE} -r rbconfig -e "puts RbConfig::CONFIG.fetch(%q(LIBRUBYARG_SHARED))"`
+
+ RUBY_SERIES="$RUBY_MAJOR$RUBY_MINOR"
+ if test "$RUBY_SERIES" -ge "19"; then
+ AC_DEFINE_UNQUOTED(HAVE_RUBY_1_9, 1, [Defines if your system has Ruby 1.9.x])
+ fi
+
+ if test `${RUBY_EXECUTABLE} -r rbconfig -e "puts RbConfig::CONFIG.key?(%q(rubyhdrdir))"` = "true"; then
+ RUBY_INCLUDEDIR=`${RUBY_EXECUTABLE} -r rbconfig -e "puts RbConfig::CONFIG.fetch(%q(rubyhdrdir))"`
+ if test `${RUBY_EXECUTABLE} -r rbconfig -e "puts RbConfig::CONFIG.key?(%q(rubyarchhdrdir))"` = "true"; then
+ RUBY_ARCHINCLUDEDIR=`${RUBY_EXECUTABLE} -r rbconfig -e "puts RbConfig::CONFIG.fetch(%q(rubyarchhdrdir))"`
+ else
+ RUBY_ARCH=`${RUBY_EXECUTABLE} -r rbconfig -e "puts RbConfig::CONFIG.fetch(%q(arch))"`
+ RUBY_ARCHINCLUDEDIR=${RUBY_INCLUDEDIR}/${RUBY_ARCH}
+ fi
+ RUBY_CFLAGS="-I${RUBY_INCLUDEDIR} -I${RUBY_ARCHINCLUDEDIR}"
+ else
+ RUBY_INCLUDEDIR=`${RUBY_EXECUTABLE} -r rbconfig -e "puts RbConfig::CONFIG.fetch(%q(archdir))"`
+ RUBY_CFLAGS="-I${RUBY_INCLUDEDIR}"
+ fi
+
+ # check if Ruby requires explicit specification of C++ standard
+ AC_LANG_SAVE
+ AC_LANG_CPLUSPLUS
+ SAVED_CXXFLAGS="$CXXFLAGS"
+ for CXX_STD_TEST in "" 11 14 17; do
+ CXXFLAGS="$SAVED_CXXFLAGS"
+ if test "x$CXX_STD_TEST" = "x"; then
+ AC_MSG_CHECKING([Ruby build with default C++ standard])
+ RUBY_CXXFLAGS=""
+ else
+ AC_MSG_CHECKING([Ruby build with C++$CXX_STD_TEST])
+ RUBY_CXXFLAGS="-std=c++$CXX_STD_TEST"
+ fi
+ CXXFLAGS="$SAVED_CXXFLAGS $RUBY_CFLAGS $RUBY_CXXFLAGS"
+ AC_TRY_COMPILE([
+ #include <ruby.h>
+ ],[ ],
+ ruby_cxx_std=yes,
+ ruby_cxx_std=no
+ )
+ if test "x$ruby_cxx_std" = "xyes"; then
+ AC_SUBST(RUBY_CXXFLAGS)
+ AC_MSG_RESULT(yes)
+ break
+ else
+ AC_MSG_RESULT(no)
+ fi
+ done
+ CXXFLAGS="$SAVED_CXXFLAGS"
+ AC_LANG_RESTORE
+
+ # Removes trailing slashes, if any, to avoid fail to install with recent libtool.
+ RUBY_ARCHDIR=${RUBY_ARCHDIR%/}
+ RUBY_SITEDIR=${RUBY_SITEDIR%/}
+ RUBY_LIBDIR=${RUBY_LIBDIR%/}
+ RUBY_RUBYLIBDIR=${RUBY_RUBYLIBDIR%/}
+
+ AC_MSG_RESULT([\
+ archdir $RUBY_ARCHDIR,
+ sitearchdir $RUBY_SITEARCHDIR,
+ sitedir $RUBY_SITEDIR,
+ rubylibdir $RUBY_RUBYLIBDIR,
+ libdir $RUBY_LIBDIR,
+ includedir $RUBY_INCLUDEDIR,
+ librubyarg $RUBY_LIBRUBYARG,
+ cflags $RUBY_CFLAGS,
+ cxxflags $RUBY_CXXFLAGS])
+ AC_SUBST(RUBY_ARCHDIR)
+ AC_SUBST(RUBY_SITEARCHDIR)
+ AC_SUBST(RUBY_SITEDIR)
+ AC_SUBST(RUBY_RUBYLIBDIR)
+ AC_SUBST(RUBY_LIBDIR)
+ AC_SUBST(RUBY_INCLUDEDIR)
+ AC_SUBST(RUBY_LIBRUBYARG)
+ AC_SUBST(RUBY_CFLAGS)
+fi
diff --git a/korundum/rubylib/korundum/Makefile.am b/korundum/rubylib/korundum/Makefile.am
index 840b6ab6..74995c3d 100644
--- a/korundum/rubylib/korundum/Makefile.am
+++ b/korundum/rubylib/korundum/Makefile.am
@@ -1,3 +1,5 @@
+CXXFLAGS += $(RUBY_CXXFLAGS)
+
INCLUDES = -I$(top_srcdir)/smoke -I$(top_srcdir)/qtruby/rubylib/qtruby $(all_includes) -I$(RUBY_ARCHDIR) $(RUBY_CFLAGS)
rubylibdir = $(RUBY_ARCHDIR)
diff --git a/korundum/rubylib/korundum/configure.in.in b/korundum/rubylib/korundum/configure.in.in
deleted file mode 100644
index 0a987639..00000000
--- a/korundum/rubylib/korundum/configure.in.in
+++ /dev/null
@@ -1,59 +0,0 @@
-AC_CHECK_PROG(RUBY_EXECUTABLE, ruby, ruby)
-
-if test -z "RUBY_EXECUTABLE"; then
- DO_NOT_COMPILE="$DO_NOT_COMPILE korundum"
-else
- RUBY_MAJOR=`${RUBY_EXECUTABLE} -r rbconfig -e "puts RbConfig::CONFIG.fetch(%q(MAJOR))"`
- RUBY_MINOR=`${RUBY_EXECUTABLE} -r rbconfig -e "puts RbConfig::CONFIG.fetch(%q(MINOR))"`
-
- RUBY_ARCHDIR=`${RUBY_EXECUTABLE} -r rbconfig -e "puts RbConfig::CONFIG.fetch(%q(archdir))"`
- RUBY_SITEARCHDIR=`${RUBY_EXECUTABLE} -r rbconfig -e "puts RbConfig::CONFIG.fetch(%q(sitearchdir))"`
- RUBY_SITEDIR=`${RUBY_EXECUTABLE} -r rbconfig -e "puts RbConfig::CONFIG.fetch(%q(sitelibdir))"`
- RUBY_LIBDIR=`${RUBY_EXECUTABLE} -r rbconfig -e "puts RbConfig::CONFIG.fetch(%q(libdir))"`
- RUBY_RUBYLIBDIR=`${RUBY_EXECUTABLE} -r rbconfig -e "puts RbConfig::CONFIG.fetch(%q(rubylibdir))"`
- RUBY_LIBRUBYARG=`${RUBY_EXECUTABLE} -r rbconfig -e "puts RbConfig::CONFIG.fetch(%q(LIBRUBYARG_SHARED))"`
-
- RUBY_SERIES="$RUBY_MAJOR$RUBY_MINOR"
- if test "$RUBY_SERIES" -ge "19"; then
- AC_DEFINE_UNQUOTED(HAVE_RUBY_1_9, 1, [Defines if your system has Ruby 1.9.x])
- fi
-
- if test `${RUBY_EXECUTABLE} -r rbconfig -e "puts RbConfig::CONFIG.key?(%q(rubyhdrdir))"` = "true"; then
- RUBY_INCLUDEDIR=`${RUBY_EXECUTABLE} -r rbconfig -e "puts RbConfig::CONFIG.fetch(%q(rubyhdrdir))"`
- if test `${RUBY_EXECUTABLE} -r rbconfig -e "puts RbConfig::CONFIG.key?(%q(rubyarchhdrdir))"` = "true"; then
- RUBY_ARCHINCLUDEDIR=`${RUBY_EXECUTABLE} -r rbconfig -e "puts RbConfig::CONFIG.fetch(%q(rubyarchhdrdir))"`
- else
- RUBY_ARCH=`${RUBY_EXECUTABLE} -r rbconfig -e "puts RbConfig::CONFIG.fetch(%q(arch))"`
- RUBY_ARCHINCLUDEDIR=${RUBY_INCLUDEDIR}/${RUBY_ARCH}
- fi
- RUBY_CFLAGS="-I${RUBY_INCLUDEDIR} -I${RUBY_ARCHINCLUDEDIR}"
- else
- RUBY_INCLUDEDIR=`${RUBY_EXECUTABLE} -r rbconfig -e "puts RbConfig::CONFIG.fetch(%q(archdir))"`
- RUBY_CFLAGS="-I${RUBY_INCLUDEDIR}"
- fi
-
- # Removes trailing slashes, if any, to avoid fail to install with recent libtool.
- RUBY_ARCHDIR=${RUBY_ARCHDIR%/}
- RUBY_SITEDIR=${RUBY_SITEDIR%/}
- RUBY_LIBDIR=${RUBY_LIBDIR%/}
- RUBY_RUBYLIBDIR=${RUBY_RUBYLIBDIR%/}
-
- AC_MSG_RESULT([\
- archdir $RUBY_ARCHDIR,
- sitearchdir $RUBY_SITEARCHDIR,
- sitedir $RUBY_SITEDIR,
- rubylibdir $RUBY_RUBYLIBDIR,
- libdir $RUBY_LIBDIR,
- includedir $RUBY_INCLUDEDIR,
- librubyarg $RUBY_LIBRUBYARG,
- cflags $RUBY_CFLAGS])
- AC_SUBST(RUBY_ARCHDIR)
- AC_SUBST(RUBY_SITEARCHDIR)
- AC_SUBST(RUBY_SITEDIR)
- AC_SUBST(RUBY_RUBYLIBDIR)
- AC_SUBST(RUBY_LIBDIR)
- AC_SUBST(RUBY_INCLUDEDIR)
- AC_SUBST(RUBY_LIBRUBYARG)
- AC_SUBST(RUBY_CFLAGS)
-fi
-
diff --git a/qtruby/bin/Makefile.am b/qtruby/bin/Makefile.am
index a1005f0b..988ba3d4 100644
--- a/qtruby/bin/Makefile.am
+++ b/qtruby/bin/Makefile.am
@@ -1,3 +1,5 @@
+CXXFLAGS += $(RUBY_CXXFLAGS)
+
INCLUDES = $(all_includes) -I$(RUBY_ARCHDIR) $(RUBY_CFLAGS)
bin_PROGRAMS = qtrubyinit
diff --git a/qtruby/configure.in.in b/qtruby/configure.in.in
new file mode 100644
index 00000000..84ad88ec
--- /dev/null
+++ b/qtruby/configure.in.in
@@ -0,0 +1,90 @@
+AC_CHECK_PROG(RUBY_EXECUTABLE, ruby, ruby)
+
+if test -z "RUBY_EXECUTABLE"; then
+ DO_NOT_COMPILE="$DO_NOT_COMPILE qtruby"
+else
+ RUBY_MAJOR=`${RUBY_EXECUTABLE} -r rbconfig -e "puts RbConfig::CONFIG.fetch(%q(MAJOR))"`
+ RUBY_MINOR=`${RUBY_EXECUTABLE} -r rbconfig -e "puts RbConfig::CONFIG.fetch(%q(MINOR))"`
+
+ RUBY_ARCHDIR=`${RUBY_EXECUTABLE} -r rbconfig -e "puts RbConfig::CONFIG.fetch(%q(archdir))"`
+ RUBY_SITEARCHDIR=`${RUBY_EXECUTABLE} -r rbconfig -e "puts RbConfig::CONFIG.fetch(%q(sitearchdir))"`
+ RUBY_SITEDIR=`${RUBY_EXECUTABLE} -r rbconfig -e "puts RbConfig::CONFIG.fetch(%q(sitelibdir))"`
+ RUBY_LIBDIR=`${RUBY_EXECUTABLE} -r rbconfig -e "puts RbConfig::CONFIG.fetch(%q(libdir))"`
+ RUBY_RUBYLIBDIR=`${RUBY_EXECUTABLE} -r rbconfig -e "puts RbConfig::CONFIG.fetch(%q(rubylibdir))"`
+ RUBY_LIBRUBYARG=`${RUBY_EXECUTABLE} -r rbconfig -e "puts RbConfig::CONFIG.fetch(%q(LIBRUBYARG_SHARED))"`
+
+ RUBY_SERIES="$RUBY_MAJOR$RUBY_MINOR"
+ if test "$RUBY_SERIES" -ge "19"; then
+ AC_DEFINE_UNQUOTED(HAVE_RUBY_1_9, 1, [Defines if your system has Ruby 1.9.x])
+ fi
+
+ if test `${RUBY_EXECUTABLE} -r rbconfig -e "puts RbConfig::CONFIG.key?(%q(rubyhdrdir))"` = "true"; then
+ RUBY_INCLUDEDIR=`${RUBY_EXECUTABLE} -r rbconfig -e "puts RbConfig::CONFIG.fetch(%q(rubyhdrdir))"`
+ if test `${RUBY_EXECUTABLE} -r rbconfig -e "puts RbConfig::CONFIG.key?(%q(rubyarchhdrdir))"` = "true"; then
+ RUBY_ARCHINCLUDEDIR=`${RUBY_EXECUTABLE} -r rbconfig -e "puts RbConfig::CONFIG.fetch(%q(rubyarchhdrdir))"`
+ else
+ RUBY_ARCH=`${RUBY_EXECUTABLE} -r rbconfig -e "puts RbConfig::CONFIG.fetch(%q(arch))"`
+ RUBY_ARCHINCLUDEDIR=${RUBY_INCLUDEDIR}/${RUBY_ARCH}
+ fi
+ RUBY_CFLAGS="-I${RUBY_INCLUDEDIR} -I${RUBY_ARCHINCLUDEDIR}"
+ else
+ RUBY_INCLUDEDIR=`${RUBY_EXECUTABLE} -r rbconfig -e "puts RbConfig::CONFIG.fetch(%q(archdir))"`
+ RUBY_CFLAGS="-I${RUBY_INCLUDEDIR}"
+ fi
+
+ # check if Ruby requires explicit specification of C++ standard
+ AC_LANG_SAVE
+ AC_LANG_CPLUSPLUS
+ SAVED_CXXFLAGS="$CXXFLAGS"
+ for CXX_STD_TEST in "" 11 14 17; do
+ CXXFLAGS="$SAVED_CXXFLAGS"
+ if test "x$CXX_STD_TEST" = "x"; then
+ AC_MSG_CHECKING([Ruby build with default C++ standard])
+ RUBY_CXXFLAGS=""
+ else
+ AC_MSG_CHECKING([Ruby build with C++$CXX_STD_TEST])
+ RUBY_CXXFLAGS="-std=c++$CXX_STD_TEST"
+ fi
+ CXXFLAGS="$SAVED_CXXFLAGS $RUBY_CFLAGS $RUBY_CXXFLAGS"
+ AC_TRY_COMPILE([
+ #include <ruby.h>
+ ],[ ],
+ ruby_cxx_std=yes,
+ ruby_cxx_std=no
+ )
+ if test "x$ruby_cxx_std" = "xyes"; then
+ AC_SUBST(RUBY_CXXFLAGS)
+ AC_MSG_RESULT(yes)
+ break
+ else
+ AC_MSG_RESULT(no)
+ fi
+ done
+ CXXFLAGS="$SAVED_CXXFLAGS"
+ AC_LANG_RESTORE
+
+ # Removes trailing slashes, if any, to avoid fail to install with recent libtool.
+ RUBY_ARCHDIR=${RUBY_ARCHDIR%/}
+ RUBY_SITEDIR=${RUBY_SITEDIR%/}
+ RUBY_LIBDIR=${RUBY_LIBDIR%/}
+ RUBY_RUBYLIBDIR=${RUBY_RUBYLIBDIR%/}
+
+ AC_MSG_RESULT([\
+ archdir $RUBY_ARCHDIR,
+ sitearchdir $RUBY_SITEARCHDIR,
+ sitedir $RUBY_SITEDIR,
+ rubylibdir $RUBY_RUBYLIBDIR,
+ libdir $RUBY_LIBDIR,
+ includedir $RUBY_INCLUDEDIR,
+ librubyarg $RUBY_LIBRUBYARG,
+ cflags $RUBY_CFLAGS,
+ cxxflags $RUBY_CXXFLAGS])
+ AC_SUBST(RUBY_ARCHDIR)
+ AC_SUBST(RUBY_SITEARCHDIR)
+ AC_SUBST(RUBY_SITEDIR)
+ AC_SUBST(RUBY_RUBYLIBDIR)
+ AC_SUBST(RUBY_LIBDIR)
+ AC_SUBST(RUBY_INCLUDEDIR)
+ AC_SUBST(RUBY_LIBRUBYARG)
+ AC_SUBST(RUBY_CFLAGS)
+fi
diff --git a/qtruby/rubylib/designer/uilib/Makefile.am b/qtruby/rubylib/designer/uilib/Makefile.am
index 45876ed6..80363009 100644
--- a/qtruby/rubylib/designer/uilib/Makefile.am
+++ b/qtruby/rubylib/designer/uilib/Makefile.am
@@ -1,3 +1,5 @@
+CXXFLAGS += $(RUBY_CXXFLAGS)
+
INCLUDES = -I$(top_srcdir)/smoke -I$(top_srcdir)/qtruby/rubylib/qtruby $(all_includes) -I$(RUBY_ARCHDIR) $(RUBY_CFLAGS)
rubylibdir = $(RUBY_ARCHDIR)
diff --git a/qtruby/rubylib/qtruby/Makefile.am b/qtruby/rubylib/qtruby/Makefile.am
index 7083719c..c273c599 100644
--- a/qtruby/rubylib/qtruby/Makefile.am
+++ b/qtruby/rubylib/qtruby/Makefile.am
@@ -1,3 +1,5 @@
+CXXFLAGS += $(RUBY_CXXFLAGS)
+
INCLUDES = -I$(top_srcdir)/smoke $(all_includes) -I$(RUBY_ARCHDIR) $(RUBY_CFLAGS)
noinst_HEADERS = qtruby.h marshall.h smokeruby.h extconf.rb
diff --git a/qtruby/rubylib/qtruby/configure.in.in b/qtruby/rubylib/qtruby/configure.in.in
deleted file mode 100644
index db0594a3..00000000
--- a/qtruby/rubylib/qtruby/configure.in.in
+++ /dev/null
@@ -1,59 +0,0 @@
-AC_CHECK_PROG(RUBY_EXECUTABLE, ruby, ruby)
-
-if test -z "RUBY_EXECUTABLE"; then
- DO_NOT_COMPILE="$DO_NOT_COMPILE qtruby"
-else
- RUBY_MAJOR=`${RUBY_EXECUTABLE} -r rbconfig -e "puts RbConfig::CONFIG.fetch(%q(MAJOR))"`
- RUBY_MINOR=`${RUBY_EXECUTABLE} -r rbconfig -e "puts RbConfig::CONFIG.fetch(%q(MINOR))"`
-
- RUBY_ARCHDIR=`${RUBY_EXECUTABLE} -r rbconfig -e "puts RbConfig::CONFIG.fetch(%q(archdir))"`
- RUBY_SITEARCHDIR=`${RUBY_EXECUTABLE} -r rbconfig -e "puts RbConfig::CONFIG.fetch(%q(sitearchdir))"`
- RUBY_SITEDIR=`${RUBY_EXECUTABLE} -r rbconfig -e "puts RbConfig::CONFIG.fetch(%q(sitelibdir))"`
- RUBY_LIBDIR=`${RUBY_EXECUTABLE} -r rbconfig -e "puts RbConfig::CONFIG.fetch(%q(libdir))"`
- RUBY_RUBYLIBDIR=`${RUBY_EXECUTABLE} -r rbconfig -e "puts RbConfig::CONFIG.fetch(%q(rubylibdir))"`
- RUBY_LIBRUBYARG=`${RUBY_EXECUTABLE} -r rbconfig -e "puts RbConfig::CONFIG.fetch(%q(LIBRUBYARG_SHARED))"`
-
- RUBY_SERIES="$RUBY_MAJOR$RUBY_MINOR"
- if test "$RUBY_SERIES" -ge "19"; then
- AC_DEFINE_UNQUOTED(HAVE_RUBY_1_9, 1, [Defines if your system has Ruby 1.9.x])
- fi
-
- if test `${RUBY_EXECUTABLE} -r rbconfig -e "puts RbConfig::CONFIG.key?(%q(rubyhdrdir))"` = "true"; then
- RUBY_INCLUDEDIR=`${RUBY_EXECUTABLE} -r rbconfig -e "puts RbConfig::CONFIG.fetch(%q(rubyhdrdir))"`
- if test `${RUBY_EXECUTABLE} -r rbconfig -e "puts RbConfig::CONFIG.key?(%q(rubyarchhdrdir))"` = "true"; then
- RUBY_ARCHINCLUDEDIR=`${RUBY_EXECUTABLE} -r rbconfig -e "puts RbConfig::CONFIG.fetch(%q(rubyarchhdrdir))"`
- else
- RUBY_ARCH=`${RUBY_EXECUTABLE} -r rbconfig -e "puts RbConfig::CONFIG.fetch(%q(arch))"`
- RUBY_ARCHINCLUDEDIR=${RUBY_INCLUDEDIR}/${RUBY_ARCH}
- fi
- RUBY_CFLAGS="-I${RUBY_INCLUDEDIR} -I${RUBY_ARCHINCLUDEDIR}"
- else
- RUBY_INCLUDEDIR=`${RUBY_EXECUTABLE} -r rbconfig -e "puts RbConfig::CONFIG.fetch(%q(archdir))"`
- RUBY_CFLAGS="-I${RUBY_INCLUDEDIR}"
- fi
-
- # Removes trailing slashes, if any, to avoid fail to install with recent libtool.
- RUBY_ARCHDIR=${RUBY_ARCHDIR%/}
- RUBY_SITEDIR=${RUBY_SITEDIR%/}
- RUBY_LIBDIR=${RUBY_LIBDIR%/}
- RUBY_RUBYLIBDIR=${RUBY_RUBYLIBDIR%/}
-
- AC_MSG_RESULT([\
- archdir $RUBY_ARCHDIR,
- sitearchdir $RUBY_SITEARCHDIR,
- sitedir $RUBY_SITEDIR,
- rubylibdir $RUBY_RUBYLIBDIR,
- libdir $RUBY_LIBDIR,
- includedir $RUBY_INCLUDEDIR,
- librubyarg $RUBY_LIBRUBYARG,
- cflags $RUBY_CFLAGS])
- AC_SUBST(RUBY_ARCHDIR)
- AC_SUBST(RUBY_SITEARCHDIR)
- AC_SUBST(RUBY_SITEDIR)
- AC_SUBST(RUBY_RUBYLIBDIR)
- AC_SUBST(RUBY_LIBDIR)
- AC_SUBST(RUBY_INCLUDEDIR)
- AC_SUBST(RUBY_LIBRUBYARG)
- AC_SUBST(RUBY_CFLAGS)
-fi
-
--
cgit v1.2.1
|