upstream nginx-0.7.31
[nginx.git] / nginx / auto / lib / pcre / make
1
2 # Copyright (C) Igor Sysoev
3
4
5 case "$NGX_CC_NAME" in
6
7     msvc*)
8         ngx_makefile=makefile.msvc
9         ngx_opt="CPU_OPT=\"$CPU_OPT\" LIBC=$LIBC"
10     ;;
11
12     owc*)
13         ngx_makefile=makefile.owc
14         ngx_opt="CPU_OPT=\"$CPU_OPT\""
15     ;;
16
17     bcc)
18         ngx_makefile=makefile.bcc
19         ngx_opt="-DCPU_OPT=\"$CPU_OPT\""
20     ;;
21
22 esac
23
24
25 case "$NGX_PLATFORM" in
26
27     win32)
28         cp auto/lib/pcre/patch.pcre.in $PCRE
29         cp auto/lib/pcre/patch.pcre.in.owc $PCRE
30         cp auto/lib/pcre/patch.config.in $PCRE
31         cp auto/lib/pcre/patch.pcre.c $PCRE
32         cp auto/lib/pcre/$ngx_makefile $PCRE
33
34         ngx_pcre=`echo $PCRE | sed -e "s/\//$ngx_regex_dirsep/g"`
35
36         cat << END                                            >> $NGX_MAKEFILE
37
38 `echo "$PCRE/pcre.h:    $NGX_MAKEFILE" | sed -e "s/\//$ngx_regex_dirsep/g"`
39         cd $ngx_pcre
40         \$(MAKE) -f $ngx_makefile pcre.h
41         cd ..\\..\\..
42
43
44 `echo "$PCRE/pcre.lib:  $PCRE/pcre.h" | sed -e "s/\//$ngx_regex_dirsep/g"`
45         cd $ngx_pcre
46         \$(MAKE) -f $ngx_makefile $ngx_opt
47         cd ..\\..\\..
48
49 END
50
51     ;;
52
53     *)
54         cat << END                                            >> $NGX_MAKEFILE
55
56 $PCRE/pcre.h:   $PCRE/Makefile
57
58 $PCRE/Makefile: $NGX_MAKEFILE
59         cd $PCRE \\
60         && if [ -f Makefile ]; then \$(MAKE) distclean; fi \\
61         && CC="\$(CC)" CFLAGS="$PCRE_OPT" \\
62         ./configure --disable-shared
63
64
65 $PCRE/.libs/libpcre.a:  $PCRE/Makefile
66         cd $PCRE \\
67         && \$(MAKE) libpcre.la
68
69 END
70
71     ;;
72
73 esac