Skip to content

Commit ce30a08

Browse files
committed
feature: added new C API ngx_http_lua_pcre_version to wrap the pcre_version() C API in libpcre.
1 parent ef9e750 commit ce30a08

File tree

2 files changed

+7
-55
lines changed

2 files changed

+7
-55
lines changed

config

Lines changed: 0 additions & 55 deletions
Original file line numberDiff line numberDiff line change
@@ -497,61 +497,6 @@ fi
497497

498498
# ----------------------------------------
499499

500-
if [ $USE_PCRE = YES -o $PCRE != NONE ] && [ $PCRE != NO -a $PCRE != YES ]; then
501-
# force pcre_version symbol to be required when PCRE is statically linked
502-
case "$NGX_PLATFORM" in
503-
Darwin:*)
504-
ngx_feature="require defined symbols (-u)"
505-
ngx_feature_name=
506-
ngx_feature_path=
507-
ngx_feature_libs="-Wl,-u,_strerror"
508-
ngx_feature_run=no
509-
ngx_feature_incs="#include <stdio.h>"
510-
ngx_feature_test='printf("hello");'
511-
512-
. auto/feature
513-
514-
if [ $ngx_found = yes ]; then
515-
CORE_LIBS="-Wl,-u,_pcre_version $CORE_LIBS"
516-
fi
517-
;;
518-
519-
*)
520-
ngx_feature="require defined symbols (--require-defined)"
521-
ngx_feature_name=
522-
ngx_feature_path=
523-
ngx_feature_libs="-Wl,--require-defined=strerror"
524-
ngx_feature_run=no
525-
ngx_feature_incs="#include <stdio.h>"
526-
ngx_feature_test='printf("hello");'
527-
528-
. auto/feature
529-
530-
if [ $ngx_found = yes ]; then
531-
CORE_LIBS="-Wl,--require-defined=pcre_version $CORE_LIBS"
532-
533-
else
534-
# ld 2.25 and below (--required-defined was introduced in 2.26)
535-
ngx_feature="require defined symbols fallback (--undefined)"
536-
ngx_feature_name=
537-
ngx_feature_path=
538-
ngx_feature_libs="-Wl,--undefined=strerror"
539-
ngx_feature_run=no
540-
ngx_feature_incs="#include <stdio.h>"
541-
ngx_feature_test='printf("hello");'
542-
543-
. auto/feature
544-
545-
if [ $ngx_found = yes ]; then
546-
CORE_LIBS="-Wl,--undefined=pcre_version $CORE_LIBS"
547-
fi
548-
fi
549-
;;
550-
esac
551-
fi
552-
553-
# ----------------------------------------
554-
555500
USE_MD5=YES
556501
USE_SHA1=YES
557502

src/ngx_http_lua_regex.c

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -582,6 +582,13 @@ ngx_http_lua_ffi_max_regex_cache_size(void)
582582
}
583583

584584

585+
const char *
586+
ngx_http_lua_ffi_pcre_version(void)
587+
{
588+
return pcre_version();
589+
}
590+
591+
585592
#endif /* NGX_PCRE */
586593

587594

0 commit comments

Comments
 (0)