Skip to content

Commit 2556f07

Browse files
authored
Merge pull request #36 from nikic/oniguruma
Link against oniguruma statically
2 parents 5a73705 + efd74ac commit 2556f07

File tree

3 files changed

+20
-14
lines changed

3 files changed

+20
-14
lines changed

.travis.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,7 @@ install:
8484
- ./bin/install-libzip
8585
- ./bin/install-libsodium
8686
- ./bin/install-password-argon2
87+
- . ./bin/install-onig # sourced to export ONIG_LIBS
8788
- |
8889
if [[ -f default_configure_options.$RELEASE-${VERSION%*.*} ]]; then
8990
cp default_configure_options.$RELEASE-${VERSION%*.*} $HOME/.php-build/share/php-build/default_configure_options
@@ -155,5 +156,4 @@ addons:
155156
- libcurl4-openssl-dev
156157
- libzip-dev
157158
- libgmp3-dev
158-
- libonig-dev
159159
- expect

bin/install-onig

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
#!/usr/bin/env bash
2+
3+
# Keep using the bundled library on versions that have it
4+
if [[ ! $VERSION =~ ^7.4 && ! $VERSION =~ ^master$ ]]; then
5+
echo 'PHP < 7.4 has bundled libonig, skip installation'
6+
return 0
7+
fi
8+
9+
mkdir onig
10+
pushd onig
11+
wget -O - https://github.com/kkos/oniguruma/releases/download/v6.9.1/onig-6.9.1.tar.gz \
12+
| tar -xz --strip-components=1
13+
./configure
14+
make
15+
popd
16+
17+
# Link against libonig statically
18+
export ONIG_CFLAGS="-I$PWD/onig/src"
19+
export ONIG_LIBS="-L$PWD/onig/src/.libs -l:libonig.a"

oniguruma.pc

Lines changed: 0 additions & 13 deletions
This file was deleted.

0 commit comments

Comments
 (0)