blob: 0886748ff5abb5b801970904b3405686f0f20f3e (
plain)
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
|
# $NetBSD: platform.mk,v 1.12 2022/05/07 09:36:16 taca Exp $
#
#
# Common definition for ruby*-base package.
#
.if !defined(_RUBY_PLATFORM_MK)
_RUBY_PLATFORM_MK= # defined
.include "../../lang/ruby/rubyversion.mk"
.include "../../mk/compiler.mk"
#
# sort by length of module's name for PLIST_AWK
#
_RUBY_BUNDLE_MODULES!= \
echo ${RUBY_BUNDLE_MODULES} | tr ' ' '\012' | \
awk '{print length(), $$0}' | sort -nr | awk '{print $$2}'
.for s in ${_RUBY_BUNDLE_MODULES}
t:=RUBY_${s:tu:S/-/_/g}_VER
v:=${${t}}
. if !empty(v)
_RUBY_PLIST_SUBST:= ${_RUBY_PLIST_SUBST} ${t}=${v}
_RUBY_PLIST_AWK:= ${_RUBY_PLIST_AWK} { sub(/${s}-${v}/, "${s}-$${${t}}"); }
. endif
.endfor
PLIST_SUBST+= ${_RUBY_PLIST_SUBST}
PRINT_PLIST_AWK+= ${_RUBY_PLIST_AWK}
MAKE_DIRS+= ${RUBY_SITEARCHLIB} ${RUBY_VENDORARCHLIB} ${RUBY_SITERIDIR}
FILES_SUBST+= DATE=${DATE:Q}
REQD_DIRS+= ${GEM_HOME}/cache
REQD_DIRS+= ${GEM_HOME}/doc
#
# substitute path in rubygems.
#
SUBST_CLASSES+= conf
SUBST_STAGE.conf= pre-install
SUBST_FILES.conf= lib/rubygems/config_file.rb
SUBST_VARS.conf= PKG_SYSCONFDIR
SUBST_MESSAGE.conf= Fixing configuration files.
SUBST_NOOP_OK.conf= yes # not needed for ruby-base>=2.6
#
# Don't reference pkgsrc's INSTALL macro since Ruby expect it could
# execute by unprivileged user.
#
CONFIGURE_ENV+= INSTALL="${INSTALL} ${COPY}" \
INSTALL_DATA= INSTALL_PROGRAM= INSTALL_SCRIPT=
CONFIGURE_ENV+= ac_cv_prog_PKG_CONFIG=""
#
# prevent unwanted mkdir recorded in rbconfig.rb
#
CONFIGURE_ENV+= MKDIR_P=${MKDIR:Q}
# Ruby build process depends on config.status's content
CONFIG_STATUS_OVERRIDE= # empty
########
#
# Platform
#
#
# Darwin
#
# Don't like Apple's builtin OpenSSL.
#
.if ${OPSYS} == "Darwin"
USE_BUILTIN.openssl= no
.endif
#
# DragonFly
#
#
# Work around for getucontext(3)
#
.if ${OPSYS} == "DragonFly" && ${OS_VERSION} == "1.8.0"
CONFIGURE_ENV+= ac_cv_header_ucontext_h=no
.endif
#
# Linux
#
# /usr/bin/dtrace is not DTrace.
#
.if ${OPSYS} == "Linux" && exists(/usr/bin/dtrace)
CONFIGURE_ARGS+= --disable-dtrace
.endif
#
# NetBSD
#
# dtrace support has problem on i386. (No official NetBSD release is
# built with dtrace enabled yet, so this problem is on 7.99.* only.)
#
.if ${OPSYS} == "NetBSD" && ${MACHINE_ARCH} == "i386"
CONFIGURE_ARGS+= --disable-dtrace
.endif
#
# NetBSD
#
# dtrace support can cause problems with miniruby on arm.
#
.if !empty(MACHINE_PLATFORM:MNetBSD-*-*arm*) || !empty(MACHINE_PLATFORM:MNetBSD-*-aarch64*)
CONFIGURE_ARGS+= --disable-dtrace
.endif
#
# NetBSD
#
# NetBSD 8.0 has problem with using static_assert macro.
# This is very ad hoc fix to prevent it.
#
.if ${OPSYS} == "NetBSD" && ${OPSYS_VERSION} == 080000
CFLAGS+= -DRB_AVOID_STATIC_ASSERT
.endif
#
# Solaris
#
# fix build with sunpro.
#
.if !empty(PKGSRC_COMPILER:Msunpro)
LIBS.SunOS+= -B static -lsunmath -B dynamic -lm
LDFLAGS.SunOS+= -L${SUNWSPROBASE}/lib -Wl,-R${SUNWSPROBASE}/lib
CONFIGURE_ENV+= LDSHARED="${CC} -G"
.else
LIBS.SunOS+= -lm
.endif
CONFIGURE_ENV.SunOS+= OBJCOPY=:
#
# MirBSD
#
# if present, an unsupported sysconf call is used
#
CONFIGURE_ENV.MirBSD+= ac_cv_func_getgrnam_r=no
# On platforms where DTrace is available, we need to invoke dtrace(1)
# with the original PATH. Otherwise it gets confused in the presence
# of our cc wrapper because it tries to invoke the system-default gcc
# with argv[0] set to "gcc", not the absolute path to gcc.
.if exists(/usr/sbin/dtrace)
post-wrapper:
${RUN}(${ECHO} '#!${SH}'; \
${ECHO} 'PATH=/bin:/usr/bin:/sbin:/usr/sbin; export PATH'; \
${ECHO} '/usr/sbin/dtrace $$@') \
> "${WRAPPER_BINDIR}/dtrace"
${RUN}${CHMOD} +x "${WRAPPER_BINDIR}/dtrace"
.endif
#
# bmake doesn't like the codesign/POSTLINK constructs for Darwin.
#
.if ${OPSYS} == "Cygwin" || ${OPSYS} == "Darwin"
USE_TOOLS+= gmake
MAKE_FILE= GNUmakefile
.endif
########
#
# PLIST
#
# Win32 support (for Cygwin)
#
PLIST_VARS+= win32
.if ${OPSYS} == "Cygwin"
PLIST.win32= yes
.endif
#
# IRIX work around which should be fixed.
#
PLIST_VARS+= io
.if ${OPSYS} != "IRIX"
PLIST.io= yes
.endif
.endif # _RUBY_REPLACE_MK
|