@@ -151,10 +151,24 @@ def extract_file(file, target)
151
151
end
152
152
end
153
153
154
+ def setup_path
155
+ @prev_path = ENV [ 'PATH' ]
156
+ git_perl = 'C:/Program Files/Git/usr/bin'
157
+ if File . directory? ( git_perl )
158
+ ENV [ 'PATH' ] = git_perl + ';' + ENV [ 'PATH' ]
159
+ ENV [ 'PERL' ] = 'perl'
160
+ end
161
+ end
162
+
163
+ def restore_path
164
+ ENV [ 'PATH' ] = @prev_path
165
+ end
166
+
154
167
def configure
155
168
config = if host =~/mingw/
156
169
host =~/x86_64/ ? 'mingw64' : 'mingw'
157
170
end
171
+ setup_path
158
172
args = [ "CFLAGS=-DDSO_WIN32" ,
159
173
"./Configure" ,
160
174
"no-shared" ,
@@ -164,6 +178,7 @@ def configure
164
178
args . unshift ( "CROSS_COMPILE=#{ host } -" ) if enable_config ( "cross-build" )
165
179
166
180
execute "configure" , "sh -c \" #{ args . join ( " " ) } \" "
181
+ restore_path
167
182
end
168
183
169
184
def dllwrap ( dllname , outputlib , deffile , linkto )
@@ -180,6 +195,7 @@ def dllwrap(dllname, outputlib, deffile, linkto)
180
195
end
181
196
182
197
def compile
198
+ setup_path
183
199
super
184
200
# OpenSSL DLLs are called "libcrypto32.dll" and "libssl32.dll" per default,
185
201
# regardless to the version. This is best suited to meet the Windows DLL hell.
@@ -189,6 +205,7 @@ def compile
189
205
execute "mkdef-ssl32" , "(perl util/mkdef.pl ssl 32 >libssl32.def)"
190
206
dllwrap ( "libcrypto32-#{ version } -#{ host } " , "libcrypto.dll.a" , "libcrypto32.def" , "libcrypto.a -lws2_32 -lgdi32 -lcrypt32" )
191
207
dllwrap ( "libssl32-#{ version } -#{ host } " , "libssl.dll.a" , "libssl32.def" , "libssl.a libcrypto.dll.a" )
208
+ restore_path
192
209
end
193
210
194
211
def install
0 commit comments