2004-03-02 04:00:04 +08:00
|
|
|
|
2004-09-30 00:00:49 +08:00
|
|
|
# Copyright (C) Igor Sysoev
|
2012-01-18 23:07:43 +08:00
|
|
|
# Copyright (C) Nginx, Inc.
|
2004-09-30 00:00:49 +08:00
|
|
|
|
|
|
|
|
2021-12-25 06:07:15 +08:00
|
|
|
if [ $PCRE_LIBRARY = PCRE2 ]; then
|
|
|
|
|
|
|
|
# PCRE2
|
|
|
|
|
|
|
|
if [ $NGX_CC_NAME = msvc ]; then
|
|
|
|
|
|
|
|
# With PCRE2, it is not possible to compile all sources.
|
|
|
|
# Since list of source files changes between versions, we
|
|
|
|
# test files which might not be present.
|
|
|
|
|
|
|
|
ngx_pcre_srcs="pcre2_auto_possess.c \
|
|
|
|
pcre2_chartables.c \
|
|
|
|
pcre2_compile.c \
|
|
|
|
pcre2_config.c \
|
|
|
|
pcre2_context.c \
|
|
|
|
pcre2_dfa_match.c \
|
|
|
|
pcre2_error.c \
|
|
|
|
pcre2_jit_compile.c \
|
|
|
|
pcre2_maketables.c \
|
|
|
|
pcre2_match.c \
|
|
|
|
pcre2_match_data.c \
|
|
|
|
pcre2_newline.c \
|
|
|
|
pcre2_ord2utf.c \
|
|
|
|
pcre2_pattern_info.c \
|
|
|
|
pcre2_string_utils.c \
|
|
|
|
pcre2_study.c \
|
|
|
|
pcre2_substitute.c \
|
|
|
|
pcre2_substring.c \
|
|
|
|
pcre2_tables.c \
|
|
|
|
pcre2_ucd.c \
|
|
|
|
pcre2_valid_utf.c \
|
|
|
|
pcre2_xclass.c"
|
|
|
|
|
|
|
|
ngx_pcre_test="pcre2_convert.c \
|
|
|
|
pcre2_extuni.c \
|
|
|
|
pcre2_find_bracket.c \
|
|
|
|
pcre2_script_run.c \
|
|
|
|
pcre2_serialize.c"
|
|
|
|
|
|
|
|
for ngx_src in $ngx_pcre_test
|
|
|
|
do
|
|
|
|
if [ -f $PCRE/src/$ngx_src ]; then
|
|
|
|
ngx_pcre_srcs="$ngx_pcre_srcs $ngx_src"
|
|
|
|
fi
|
|
|
|
done
|
|
|
|
|
|
|
|
ngx_pcre_objs=`echo $ngx_pcre_srcs \
|
|
|
|
| sed -e "s#\([^ ]*\.\)c#\1$ngx_objext#g"`
|
|
|
|
|
|
|
|
ngx_pcre_srcs=`echo $ngx_pcre_srcs \
|
|
|
|
| sed -e "s/ *\([^ ][^ ]*\)/$ngx_regex_cont\1/g"`
|
|
|
|
ngx_pcre_objs=`echo $ngx_pcre_objs \
|
|
|
|
| sed -e "s/ *\([^ ][^ ]*\)/$ngx_regex_cont\1/g"`
|
|
|
|
|
|
|
|
cat << END >> $NGX_MAKEFILE
|
|
|
|
|
|
|
|
PCRE_CFLAGS = -O2 -Ob1 -Oi -Gs $LIBC $CPU_OPT
|
|
|
|
PCRE_FLAGS = -DHAVE_CONFIG_H -DPCRE2_STATIC -DPCRE2_CODE_UNIT_WIDTH=8 \\
|
|
|
|
-DHAVE_MEMMOVE
|
|
|
|
|
|
|
|
PCRE_SRCS = $ngx_pcre_srcs
|
|
|
|
PCRE_OBJS = $ngx_pcre_objs
|
|
|
|
|
|
|
|
$PCRE/src/pcre2.h:
|
|
|
|
cd $PCRE/src \\
|
|
|
|
&& copy /y config.h.generic config.h \\
|
|
|
|
&& copy /y pcre2.h.generic pcre2.h \\
|
|
|
|
&& copy /y pcre2_chartables.c.dist pcre2_chartables.c
|
|
|
|
|
|
|
|
$PCRE/src/pcre2-8.lib: $PCRE/src/pcre2.h $NGX_MAKEFILE
|
|
|
|
cd $PCRE/src \\
|
|
|
|
&& cl -nologo -c \$(PCRE_CFLAGS) -I . \$(PCRE_FLAGS) \$(PCRE_SRCS) \\
|
|
|
|
&& link -lib -out:pcre2-8.lib -verbose:lib \$(PCRE_OBJS)
|
2004-03-02 04:00:04 +08:00
|
|
|
|
2021-12-25 06:07:15 +08:00
|
|
|
END
|
|
|
|
|
|
|
|
else
|
|
|
|
|
|
|
|
cat << END >> $NGX_MAKEFILE
|
2004-03-10 03:47:07 +08:00
|
|
|
|
2021-12-25 06:07:15 +08:00
|
|
|
$PCRE/src/pcre2.h: $PCRE/Makefile
|
|
|
|
|
|
|
|
$PCRE/Makefile: $NGX_MAKEFILE
|
|
|
|
cd $PCRE \\
|
|
|
|
&& if [ -f Makefile ]; then \$(MAKE) distclean; fi \\
|
|
|
|
&& CC="\$(CC)" CFLAGS="$PCRE_OPT" \\
|
|
|
|
./configure --disable-shared $PCRE_CONF_OPT
|
2004-03-30 01:43:58 +08:00
|
|
|
|
2021-12-25 06:07:15 +08:00
|
|
|
$PCRE/.libs/libpcre2-8.a: $PCRE/Makefile
|
|
|
|
cd $PCRE \\
|
|
|
|
&& \$(MAKE) libpcre2-8.la
|
2004-03-10 03:47:07 +08:00
|
|
|
|
2021-12-25 06:07:15 +08:00
|
|
|
END
|
2004-03-10 03:47:07 +08:00
|
|
|
|
2021-12-25 06:07:15 +08:00
|
|
|
fi
|
2004-03-10 03:47:07 +08:00
|
|
|
|
|
|
|
|
2021-12-25 06:07:15 +08:00
|
|
|
else
|
2004-03-30 01:43:58 +08:00
|
|
|
|
2021-12-25 06:07:15 +08:00
|
|
|
# PCRE
|
|
|
|
|
|
|
|
case "$NGX_CC_NAME" in
|
|
|
|
|
|
|
|
msvc)
|
|
|
|
ngx_makefile=makefile.msvc
|
|
|
|
ngx_opt="CPU_OPT=\"$CPU_OPT\" LIBC=$LIBC"
|
|
|
|
ngx_pcre="PCRE=\"$PCRE\""
|
|
|
|
;;
|
|
|
|
|
|
|
|
owc)
|
|
|
|
ngx_makefile=makefile.owc
|
|
|
|
ngx_opt="CPU_OPT=\"$CPU_OPT\""
|
|
|
|
ngx_pcre=`echo PCRE=\"$PCRE\" | sed -e "s/\//$ngx_regex_dirsep/g"`
|
|
|
|
;;
|
|
|
|
|
|
|
|
bcc)
|
|
|
|
ngx_makefile=makefile.bcc
|
|
|
|
ngx_opt="-DCPU_OPT=\"$CPU_OPT\""
|
|
|
|
ngx_pcre=`echo \-DPCRE=\"$PCRE\" \
|
|
|
|
| sed -e "s/\//$ngx_regex_dirsep/g"`
|
|
|
|
;;
|
|
|
|
|
|
|
|
*)
|
|
|
|
ngx_makefile=
|
|
|
|
;;
|
|
|
|
|
|
|
|
esac
|
|
|
|
|
|
|
|
|
|
|
|
if [ -n "$ngx_makefile" ]; then
|
|
|
|
|
|
|
|
cat << END >> $NGX_MAKEFILE
|
2004-03-30 01:43:58 +08:00
|
|
|
|
2013-08-24 02:53:54 +08:00
|
|
|
`echo "$PCRE/pcre.lib: $PCRE/pcre.h $NGX_MAKEFILE" \
|
|
|
|
| sed -e "s/\//$ngx_regex_dirsep/g"`
|
2009-05-12 21:15:43 +08:00
|
|
|
\$(MAKE) -f auto/lib/pcre/$ngx_makefile $ngx_pcre $ngx_opt
|
2004-11-21 03:52:20 +08:00
|
|
|
|
2009-05-14 03:48:21 +08:00
|
|
|
`echo "$PCRE/pcre.h:" | sed -e "s/\//$ngx_regex_dirsep/g"`
|
|
|
|
\$(MAKE) -f auto/lib/pcre/$ngx_makefile $ngx_pcre pcre.h
|
|
|
|
|
2004-11-21 03:52:20 +08:00
|
|
|
END
|
2004-03-30 01:43:58 +08:00
|
|
|
|
2021-12-25 06:07:15 +08:00
|
|
|
else
|
2004-03-10 03:47:07 +08:00
|
|
|
|
2021-12-25 06:07:15 +08:00
|
|
|
cat << END >> $NGX_MAKEFILE
|
2004-11-21 03:52:20 +08:00
|
|
|
|
2007-04-18 19:09:38 +08:00
|
|
|
$PCRE/pcre.h: $PCRE/Makefile
|
|
|
|
|
|
|
|
$PCRE/Makefile: $NGX_MAKEFILE
|
2004-11-21 03:52:20 +08:00
|
|
|
cd $PCRE \\
|
2005-06-16 02:33:41 +08:00
|
|
|
&& if [ -f Makefile ]; then \$(MAKE) distclean; fi \\
|
2004-11-21 03:52:20 +08:00
|
|
|
&& CC="\$(CC)" CFLAGS="$PCRE_OPT" \\
|
2011-12-26 21:10:36 +08:00
|
|
|
./configure --disable-shared $PCRE_CONF_OPT
|
2004-11-21 03:52:20 +08:00
|
|
|
|
2007-04-18 19:09:38 +08:00
|
|
|
$PCRE/.libs/libpcre.a: $PCRE/Makefile
|
2004-11-21 03:52:20 +08:00
|
|
|
cd $PCRE \\
|
|
|
|
&& \$(MAKE) libpcre.la
|
|
|
|
|
|
|
|
END
|
|
|
|
|
2021-12-25 06:07:15 +08:00
|
|
|
fi
|
|
|
|
|
2013-09-05 00:48:28 +08:00
|
|
|
fi
|