Skip to content

Commit 3d4eed1

Browse files
committed
Use builtin regex library for linux for better portability
CentOS 7 seems to segfault when built against its system PCRE library
1 parent a769e9a commit 3d4eed1

1 file changed

Lines changed: 65 additions & 36 deletions

File tree

vendor/libgit2.gyp

Lines changed: 65 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -370,16 +370,18 @@
370370
"<!(krb5-config gssapi --libs)"
371371
]
372372
}],
373-
["OS=='linux' or OS.endswith('bsd') or <(is_IBMi) == 1", {
374-
"cflags": [
375-
"<!(pcre-config --cflags-posix)"
376-
],
377-
"libraries": [
378-
"<!(pcre-config --libs-posix)"
373+
["OS=='win' or OS=='linux' or OS.endswith('bsd') or <(is_IBMi) == 1", {
374+
"dependencies": [
375+
"pcre"
379376
],
377+
"include_dirs": ["libgit2/deps/pcre"],
378+
"defines": [
379+
"GIT_REGEX_BUILTIN"
380+
]
381+
}],
382+
["OS=='linux' or OS.endswith('bsd') or <(is_IBMi) == 1", {
380383
"defines": [
381384
"GIT_OPENSSL",
382-
"GIT_REGEX_PCRE",
383385
"GIT_USE_FUTIMENS",
384386
"GIT_USE_STAT_MTIM"
385387
]
@@ -390,13 +392,8 @@
390392
]
391393
}],
392394
["OS=='win'", {
393-
"dependencies": [
394-
"pcre"
395-
],
396-
"include_dirs": ["libgit2/deps/pcre"],
397395
"defines": [
398-
"GIT_WINHTTP",
399-
"GIT_REGEX_BUILTIN"
396+
"GIT_WINHTTP"
400397
],
401398
"msvs_settings": {
402399
"VCLinkerTool": {
@@ -704,29 +701,61 @@
704701
"libgit2/deps/pcre/pcre_xclass.c",
705702
"libgit2/deps/pcre/ucp.h"
706703
],
707-
"defines": [
708-
"HAVE_SYS_STAT_H",
709-
"HAVE_SYS_TYPES_H",
710-
"HAVE_WINDOWS_H",
711-
"HAVE_STDINT_H",
712-
"HAVE_INTTYPES_H",
713-
"HAVE_MEMMOVE",
714-
"HAVE_STRERROR",
715-
"HAVE_STRTOLL",
716-
"HAVE__STRTOI64",
717-
"SUPPORT_PCRE8",
718-
"NO_RECURSE",
719-
"HAVE_LONG_LONG",
720-
"HAVE_UNSIGNED_LONG_LONG",
721-
"NEWLINE=10",
722-
"POSIX_MALLOC_THRESHOLD=10",
723-
"LINK_SIZE=2",
724-
"PARENS_NEST_LIMIT=250",
725-
"MATCH_LIMIT=10000000",
726-
"MATCH_LIMIT_RECURSION=10000000",
727-
"PCREGREP_BUFSIZE",
728-
"MAX_NAME_SIZE=32",
729-
"MAX_NAME_COUNT=10000"
704+
"conditions": [
705+
["OS=='linux' or OS.endswith('bsd') or <(is_IBMi) == 1", {
706+
"defines": [
707+
"HAVE_DIRENT_H",
708+
"HAVE_SYS_STAT_H",
709+
"HAVE_SYS_TYPES_H",
710+
"HAVE_UNISTD_H",
711+
"HAVE_STDINT_H",
712+
"HAVE_INTTYPES_H",
713+
"HAVE_BCOPY",
714+
"HAVE_MEMMOVE",
715+
"HAVE_STRERROR",
716+
"HAVE_STRTOLL",
717+
"HAVE_STRTOQ",
718+
"SUPPORT_PCRE8",
719+
"NO_RECURSE",
720+
"HAVE_LONG_LONG",
721+
"HAVE_UNSIGNED_LONG_LONG",
722+
"NEWLINE=10",
723+
"POSIX_MALLOC_THRESHOLD=10",
724+
"LINK_SIZE=2",
725+
"PARENS_NEST_LIMIT=250",
726+
"MATCH_LIMIT=10000000",
727+
"MATCH_LIMIT_RECURSION=10000000",
728+
"PCREGREP_BUFSIZE",
729+
"MAX_NAME_SIZE=32",
730+
"MAX_NAME_COUNT=10000"
731+
]
732+
}],
733+
["OS=='win'", {
734+
"defines": [
735+
"HAVE_SYS_STAT_H",
736+
"HAVE_SYS_TYPES_H",
737+
"HAVE_WINDOWS_H",
738+
"HAVE_STDINT_H",
739+
"HAVE_INTTYPES_H",
740+
"HAVE_MEMMOVE",
741+
"HAVE_STRERROR",
742+
"HAVE_STRTOLL",
743+
"HAVE__STRTOI64",
744+
"SUPPORT_PCRE8",
745+
"NO_RECURSE",
746+
"HAVE_LONG_LONG",
747+
"HAVE_UNSIGNED_LONG_LONG",
748+
"NEWLINE=10",
749+
"POSIX_MALLOC_THRESHOLD=10",
750+
"LINK_SIZE=2",
751+
"PARENS_NEST_LIMIT=250",
752+
"MATCH_LIMIT=10000000",
753+
"MATCH_LIMIT_RECURSION=10000000",
754+
"PCREGREP_BUFSIZE",
755+
"MAX_NAME_SIZE=32",
756+
"MAX_NAME_COUNT=10000"
757+
]
758+
}]
730759
]
731760
}
732761
]

0 commit comments

Comments
 (0)