~ubuntu-branches/ubuntu/trusty/nginx/trusty-proposed

« back to all changes in this revision

Viewing changes to auto/cc/clang

  • Committer: Package Import Robot
  • Author(s): Kartik Mistry
  • Date: 2013-04-25 12:51:45 UTC
  • mfrom: (1.3.28)
  • mto: (1.3.29) (15.1.2 experimental)
  • mto: This revision was merged to the branch mainline in revision 64.
  • Revision ID: package-import@ubuntu.com-20130425125145-ugl0wor6bq0u5eae
Tags: upstream-1.4.0
ImportĀ upstreamĀ versionĀ 1.4.0

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
 
 
2
# Copyright (C) Nginx, Inc.
 
3
 
 
4
 
 
5
# clang
 
6
 
 
7
 
 
8
NGX_CLANG_VER=`$CC -v 2>&1 | grep 'clang version' 2>&1 \
 
9
                           | sed -e 's/^.*clang version \(.*\)/\1/'`
 
10
 
 
11
echo " + clang version: $NGX_CLANG_VER"
 
12
 
 
13
have=NGX_COMPILER value="\"clang $NGX_CLANG_VER\"" . auto/define
 
14
 
 
15
 
 
16
CC_TEST_FLAGS="-pipe"
 
17
 
 
18
 
 
19
# optimizations
 
20
 
 
21
#NGX_CLANG_OPT="-O2"
 
22
#NGX_CLANG_OPT="-Oz"
 
23
NGX_CLANG_OPT="-O"
 
24
 
 
25
case $CPU in
 
26
    pentium)
 
27
        # optimize for Pentium
 
28
        CPU_OPT="-march=pentium"
 
29
        NGX_CPU_CACHE_LINE=32
 
30
    ;;
 
31
 
 
32
    pentiumpro | pentium3)
 
33
        # optimize for Pentium Pro, Pentium II and Pentium III
 
34
        CPU_OPT="-march=pentiumpro"
 
35
        NGX_CPU_CACHE_LINE=32
 
36
    ;;
 
37
 
 
38
    pentium4)
 
39
        # optimize for Pentium 4
 
40
        CPU_OPT="-march=pentium4"
 
41
        NGX_CPU_CACHE_LINE=128
 
42
    ;;
 
43
 
 
44
    athlon)
 
45
        # optimize for Athlon
 
46
        CPU_OPT="-march=athlon"
 
47
        NGX_CPU_CACHE_LINE=64
 
48
    ;;
 
49
 
 
50
    opteron)
 
51
        # optimize for Opteron
 
52
        CPU_OPT="-march=opteron"
 
53
        NGX_CPU_CACHE_LINE=64
 
54
    ;;
 
55
 
 
56
esac
 
57
 
 
58
CC_AUX_FLAGS="$CC_AUX_FLAGS $CPU_OPT"
 
59
 
 
60
 
 
61
CFLAGS="$CFLAGS -pipe $CPU_OPT"
 
62
 
 
63
if [ ".$PCRE_OPT" = "." ]; then
 
64
    PCRE_OPT="-O2 -pipe $CPU_OPT"
 
65
else
 
66
    PCRE_OPT="$PCRE_OPT -pipe"
 
67
fi
 
68
 
 
69
if [ ".$MD5_OPT" = "." ]; then
 
70
    MD5_OPT="-O2 -pipe $CPU_OPT"
 
71
else
 
72
    MD5_OPT="$MD5_OPT -pipe"
 
73
fi
 
74
 
 
75
if [ ".$ZLIB_OPT" = "." ]; then
 
76
    ZLIB_OPT="-O2 -pipe $CPU_OPT"
 
77
else
 
78
    ZLIB_OPT="$ZLIB_OPT -pipe"
 
79
fi
 
80
 
 
81
 
 
82
# warnings
 
83
 
 
84
CFLAGS="$CFLAGS $NGX_CLANG_OPT -Wall -Wextra -Wpointer-arith"
 
85
#CFLAGS="$CFLAGS -Wmissing-prototypes"
 
86
 
 
87
# we have a lot of unused function arguments
 
88
CFLAGS="$CFLAGS -Wno-unused-parameter"
 
89
 
 
90
# stop on warning
 
91
#CFLAGS="$CFLAGS -Werror"
 
92
 
 
93
# debug
 
94
CFLAGS="$CFLAGS -g"
 
95
 
 
96
if [ ".$CPP" = "." ]; then
 
97
    CPP="$CC -E"
 
98
fi