Skip to content

Commit 73fd7d6

Browse files
committed
location of jpcre binary
1 parent d0d418c commit 73fd7d6

1 file changed

Lines changed: 26 additions & 10 deletions

File tree

regex/lib.ijs

Lines changed: 26 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -14,22 +14,38 @@ NB. =========================================================
1414
NB. pcre2 library is in bin or tools/regex
1515
3 : 0''
1616
select. UNAME
17-
case. 'Win' do. t=. 'jpcre2.dll'
18-
case. 'Darwin' do. t=. 'libjpcre2.dylib'
1917
case. 'Android' do. pcre2dll=: 'libjpcre2.so' return.
20-
case. do. t=. 'libjpcre2.so'
18+
case. 'Darwin' do. t0=. 'libpcre2' [ ext=. '.dylib' [ arch=. ''
19+
case. 'Win' do. t0=. 'pcre2' [ ext=. '.dll' [ arch=. ((-.IF64)#<'-32'),(('arm64'-:9!:56'cpu')#<'-a64')
20+
case. do.
21+
t0=. 'libpcre2' [ ext=. '.so'
22+
if. IFRASPI do.
23+
arch=. ((-.IF64)#<'-32')
24+
else.
25+
arch=. ((-.IF64)#<'-32'),(('arm64'-:9!:56'cpu')#<'-a64')
26+
end.
2127
end.
2228

23-
f=. BINPATH,'/',t
24-
if. 0 = 1!:4 :: 0: <f do.
25-
f=. jpath '~tools/regex/',t
29+
found=. 0
30+
for_ar. arch do.
31+
if. 1= ftype f=. BINPATH,'/',t0,(>ar),ext do.
32+
found=. 1 break.
33+
elseif. 1= ftype f=. jpath '~tools/regex/',t0,(>ar),ext do.
34+
found=. 1 break.
35+
end.
36+
end.
37+
38+
if. -.found do.
39+
if. 1= ftype f=. BINPATH,'/',t0,ext do.
40+
found=. 1
41+
elseif. 1= ftype f=. jpath '~tools/regex/',t0,ext do.
42+
found=. 1
43+
end.
2644
end.
2745

2846
NB. fall back one more time
29-
if. IFUNIX *. 0 = 1!:4 :: 0: <f do.
30-
f=. unxlib 'pcre2'
31-
elseif. 0 = 1!:4 :: 0: <f do.
32-
f=. t
47+
if. -.found do.
48+
if. IFUNIX do. f=. unxlib 'pcre2' else. f=. t0,ext end.
3349
end.
3450

3551
pcre2dll=: f

0 commit comments

Comments
 (0)