This repository was archived by the owner on Nov 2, 2019. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathconfigure.ac
More file actions
187 lines (148 loc) · 5.26 KB
/
configure.ac
File metadata and controls
187 lines (148 loc) · 5.26 KB
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
dnl ColdRuby -- V8-based Ruby implementation.
dnl Copyright (C) 2011 Sergey Gridassov <grindars@gmail.com>
dnl
dnl This program is free software; you can redistribute it and/or modify
dnl it under the terms of the GNU General Public License as published by
dnl the Free Software Foundation; either version 2 of the License, or
dnl (at your option) any later version.
dnl
dnl This program is distributed in the hope that it will be useful,
dnl but WITHOUT ANY WARRANTY; without even the implied warranty of
dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
dnl GNU General Public License for more details.
dnl
dnl You should have received a copy of the GNU General Public License
dnl along with this program; if not, write to the Free Software
dnl Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
AC_PREREQ([2.62])
AC_INIT([coldruby], [0.1], [coldruby-dev@lists.whitequark.org])
AC_CONFIG_SRCDIR([coldruby/main.cpp])
AC_CONFIG_MACRO_DIR([m4])
AM_INIT_AUTOMAKE
LT_INIT([dlopen win32-dll])
AC_LANG([C++])
AC_PROG_CXX
AX_PTHREAD([:], [AC_MSG_ERROR([pthreads is required])])
CC="$PTHREAD_CC"
AC_SUBST([PTHREAD_CFLAGS])
AC_SUBST([PTHREAD_LIBS])
AC_MSG_CHECKING([for ruby >= 1.9])
AC_PATH_PROGS_FEATURE_CHECK([RUBY], [ruby1.9.1 ruby], [
ver=`$ac_path_RUBY --version | cut -d ' ' -f 2`
AS_VERSION_COMPARE([$ver], [1.9], [:], [ac_cv_path_RUBY=$ac_path_RUBY ac_path_RUBY_found=:], \
[ac_cv_path_RUBY=$ac_path_RUBY ac_path_RUBY_found=:])
], [AC_MSG_ERROR([unable to find ruby])])
AC_SUBST([RUBY], [$ac_cv_path_RUBY])
AC_MSG_RESULT([$RUBY])
AC_MSG_CHECKING([for ruby development files location])
$RUBY -r rbconfig -e "RbConfig::CONFIG.each { |k, v| print 'RVAR_', k, '=\"', v, \"\\\"\n\" }" > rconftest.sh && source $PWD/rconftest.sh 2>/dev/null
if test $? -ne 0; then
rm -f rconftest.sh
AC_MSG_RESULT([none])
AC_MSG_ERROR([ruby failed])
fi
rm -f rconftest.sh
AC_DEFINE_UNQUOTED([RUBY_VERSION], ["$RVAR_ruby_version"], [Ruby version.])
MRI_LIBS="$RVAR_LIBRUBYARG $RVAR_SOLIBS"
MRI_CPPFLAGS="-I$RVAR_rubyhdrdir/$RVAR_sitearch"
for var in RVAR_vendorhdrdir RVAR_sitehdrdir RVAR_rubyhdrdir RVAR_includedir; do
var=`eval echo \\\$\$var`
if test "x$var" != "x"; then
MRI_CPPFLAGS="$MRI_CPPFLAGS -I$var"
fi
done
AC_MSG_RESULT([done])
AC_SUBST([MRI_CPPFLAGS])
AC_SUBST([MRI_LIBS])
dnl sanity checks
OLD_CPPFLAGS="$CPPFLAGS"
OLD_LIBS="$LIBS"
CPPFLAGS="$CPPFLAGS $MRI_CPPFLAGS"
LIBS="$LIBS $MRI_LIBS"
AC_CHECK_HEADER([ruby.h], [], [
AC_MSG_ERROR([unable to find ruby])
])
AC_SEARCH_LIBS([ruby_init], [], [], [
AC_MSG_ERROR([unable to find ruby])
])
CPPFLAGS="$OLD_CPPFLAGS"
LIBS="$OLD_LIBS"
AC_ARG_ENABLE([developer-mode], [AS_HELP_STRING([--enable-developer-mode], [use local coldruby compiler instead of system])],
[compilerdir="$PWD/lib" runtimedir="$PWD/runtime" stdlibdir="$PWD/stdlib" DEVELOPER_MODE=1], [compilerdir="$datadir/coldruby" runtimedir="$datadir/coldruby/runtime" stdlibdir="$datadir/coldruby/stdlib" DEVELOPER_MODE=0])
AC_SUBST([DEVELOPER_MODE])
AM_CONDITIONAL([DEVELOPER_MODE], [test x$DEVELOPER_MODE = x1])
extensiondir=${libdir}/coldruby/${VERSION}
AC_SUBST([extensiondir])
AC_SUBST([compilerdir])
AC_SUBST([runtimedir])
AC_SUBST([stdlibdir])
AC_ARG_WITH([compiler],
[AS_HELP_STRING([--with-compiler@<:@=PATH@:>@], [specify compiler root])]
, [compilerdir=$with_compiler])
AC_MSG_CHECKING([for compiler root])
AC_MSG_RESULT([$compilerdir])
AC_MSG_CHECKING([for runtime root])
AC_MSG_RESULT([$runtimedir])
DX_HTML_FEATURE(ON)
DX_CHM_FEATURE(OFF)
DX_CHI_FEATURE(OFF)
DX_MAN_FEATURE(OFF)
DX_RTF_FEATURE(OFF)
DX_XML_FEATURE(OFF)
DX_PDF_FEATURE(OFF)
DX_PS_FEATURE(OFF)
DX_INIT_DOXYGEN(coldruby, doxygen.cfg, doc)
AC_CHECK_HEADER([v8.h], [], [
AC_MSG_ERROR([V8 not found])
])
V8_LIBS=
AC_CHECK_LIB([v8], [_ZN2v86Script3RunEv], [V8_LIBS=-lv8], [
AC_MSG_ERROR([V8 not found])
])
AC_SUBST([V8_LIBS])
AC_CACHE_CHECK(for stack end address, rb_cv_stack_end_address,
[rb_cv_stack_end_address=no
for addr in __libc_stack_end _SEND; do
AC_TRY_LINK(
[extern void *$addr;],
[if (!$addr) return 1;],
[rb_cv_stack_end_address="$addr"; break])
done])
if test $rb_cv_stack_end_address != no; then
AC_DEFINE_UNQUOTED(STACK_END_ADDRESS, $rb_cv_stack_end_address,
[Symbol containing end of stack])
fi
AH_TOP(
[/*
* ColdRuby -- V8-based Ruby implementation.
* Copyright (C) 2011 Sergey Gridassov <grindars@gmail.com>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
])
AC_CONFIG_HEADERS([config.h])
AC_CONFIG_FILES([
Makefile
libcoldruby/Makefile
coldruby/Makefile
coldruby-static/Makefile
coldruby-nodejs/Makefile
lib/Makefile
runtime/Makefile
stdlib/Makefile
ext/Makefile
ext/kernel/Makefile
])
AC_OUTPUT