Skip to content

Commit e94dd3f

Browse files
committed
bugfix: ensured the 'pcre_version' symbol is also preserved on Darwin platforms.
Follow-up commit to 5a97cce
1 parent b2c2c2a commit e94dd3f

File tree

1 file changed

+32
-13
lines changed

1 file changed

+32
-13
lines changed

Diff for: config

+32-13
Original file line numberDiff line numberDiff line change
@@ -450,22 +450,41 @@ ngx_feature_test='struct sigaction act;
450450

451451
. auto/feature
452452

453-
if [ $PCRE != NO -a $PCRE != YES ]; then
454-
# force pcre_version symbol to be undefined when PCRE is statically linked
453+
if [ $USE_PCRE = YES -o $PCRE != NONE ] && [ $PCRE != NO -a $PCRE != YES ]; then
454+
# force pcre_version symbol to be required when PCRE is statically linked
455+
case "$NGX_PLATFORM" in
456+
Darwin:*)
457+
ngx_feature="require defined symbols (-u)"
458+
ngx_feature_name=
459+
ngx_feature_path=
460+
ngx_feature_libs="-Wl,-u,_strerror"
461+
ngx_feature_run=no
462+
ngx_feature_incs="#include <stdio.h>"
463+
ngx_feature_test='printf("hello");'
455464

456-
ngx_feature="force undefined symbols (--undefined)"
457-
ngx_feature_libs="-Wl,--undefined=printf"
458-
ngx_feature_name=
459-
ngx_feature_run=no
460-
ngx_feature_incs="#include <stdio.h>"
461-
ngx_feature_path=
462-
ngx_feature_test='printf("hello");'
465+
. auto/feature
463466

464-
. auto/feature
467+
if [ $ngx_found = yes ]; then
468+
CORE_LIBS="-Wl,-u,_pcre_version $CORE_LIBS"
469+
fi
470+
;;
465471

466-
if [ $ngx_found = yes ]; then
467-
CORE_LIBS="$CORE_LIBS -Wl,--undefined=pcre_version"
468-
fi
472+
*)
473+
ngx_feature="require defined symbols (--require-defined)"
474+
ngx_feature_name=
475+
ngx_feature_path=
476+
ngx_feature_libs="-Wl,--require-defined=strerror"
477+
ngx_feature_run=no
478+
ngx_feature_incs="#include <stdio.h>"
479+
ngx_feature_test='printf("hello");'
480+
481+
. auto/feature
482+
483+
if [ $ngx_found = yes ]; then
484+
CORE_LIBS="-Wl,--require-defined=pcre_version $CORE_LIBS"
485+
fi
486+
;;
487+
esac
469488
fi
470489

471490
#CFLAGS=$"$CFLAGS -DLUA_DEFAULT_PATH='\"/usr/local/openresty/lualib/?.lua\"'"

0 commit comments

Comments
 (0)