Mercurial > hg > nginx-quic
annotate auto/cc/name @ 5360:3d2d3e1cf427
Win32: MinGW GCC compatibility.
Several warnings silenced, notably (ngx_socket_t) -1 is now checked
on socket operations instead of -1, as ngx_socket_t is unsigned on win32
and gcc complains on comparison.
With this patch, it's now possible to compile nginx using mingw gcc,
with options we normally compile on win32.
author | Maxim Dounin <mdounin@mdounin.ru> |
---|---|
date | Wed, 04 Sep 2013 20:48:28 +0400 |
parents | f1daa0356a1d |
children | 78f8ac479735 |
rev | line source |
---|---|
455 | 1 |
2 # Copyright (C) Igor Sysoev | |
4412 | 3 # Copyright (C) Nginx, Inc. |
455 | 4 |
5 | |
946 | 6 if [ "$NGX_PLATFORM" != win32 ]; then |
7 | |
8 ngx_feature="C compiler" | |
9 ngx_feature_name= | |
10 ngx_feature_run=yes | |
11 ngx_feature_incs= | |
12 ngx_feature_path= | |
13 ngx_feature_libs= | |
14 ngx_feature_test= | |
15 . auto/feature | |
16 | |
17 if [ $ngx_found = no ]; then | |
18 echo | |
19 echo $0: error: C compiler $CC is not found | |
20 echo | |
21 exit 1 | |
22 fi | |
23 | |
24 fi | |
455 | 25 |
26 | |
577 | 27 if [ "$CC" = cl ]; then |
461 | 28 if `$NGX_WINE $CC -v 2>&1 \ |
4229
fbd6d1e5cdef
Fix of building by Microsoft Visual C++ 10 compiler.
Igor Sysoev <igor@sysoev.ru>
parents:
1639
diff
changeset
|
29 | grep '^Microsoft (R) 32-bit C/C++ Optimizing Compiler Version 16' \ |
fbd6d1e5cdef
Fix of building by Microsoft Visual C++ 10 compiler.
Igor Sysoev <igor@sysoev.ru>
parents:
1639
diff
changeset
|
30 >/dev/null 2>&1`; then |
fbd6d1e5cdef
Fix of building by Microsoft Visual C++ 10 compiler.
Igor Sysoev <igor@sysoev.ru>
parents:
1639
diff
changeset
|
31 |
fbd6d1e5cdef
Fix of building by Microsoft Visual C++ 10 compiler.
Igor Sysoev <igor@sysoev.ru>
parents:
1639
diff
changeset
|
32 NGX_CC_NAME=msvc10 |
fbd6d1e5cdef
Fix of building by Microsoft Visual C++ 10 compiler.
Igor Sysoev <igor@sysoev.ru>
parents:
1639
diff
changeset
|
33 echo " + using Microsoft Visual C++ 10 compiler" |
fbd6d1e5cdef
Fix of building by Microsoft Visual C++ 10 compiler.
Igor Sysoev <igor@sysoev.ru>
parents:
1639
diff
changeset
|
34 |
4758
1f908d2dde8d
Replaced a number of "else if" with "elif".
Ruslan Ermilov <ru@nginx.com>
parents:
4492
diff
changeset
|
35 elif `$NGX_WINE $CC -v 2>&1 \ |
1639
7d125a707158
msvc8 compatibility: it can not build with debug under Wine
Igor Sysoev <igor@sysoev.ru>
parents:
946
diff
changeset
|
36 | grep '^Microsoft (R) 32-bit C/C++ Optimizing Compiler Version 14' \ |
7d125a707158
msvc8 compatibility: it can not build with debug under Wine
Igor Sysoev <igor@sysoev.ru>
parents:
946
diff
changeset
|
37 >/dev/null 2>&1`; then |
7d125a707158
msvc8 compatibility: it can not build with debug under Wine
Igor Sysoev <igor@sysoev.ru>
parents:
946
diff
changeset
|
38 |
7d125a707158
msvc8 compatibility: it can not build with debug under Wine
Igor Sysoev <igor@sysoev.ru>
parents:
946
diff
changeset
|
39 NGX_CC_NAME=msvc8 |
7d125a707158
msvc8 compatibility: it can not build with debug under Wine
Igor Sysoev <igor@sysoev.ru>
parents:
946
diff
changeset
|
40 echo " + using Microsoft Visual C++ 8 compiler" |
7d125a707158
msvc8 compatibility: it can not build with debug under Wine
Igor Sysoev <igor@sysoev.ru>
parents:
946
diff
changeset
|
41 |
4758
1f908d2dde8d
Replaced a number of "else if" with "elif".
Ruslan Ermilov <ru@nginx.com>
parents:
4492
diff
changeset
|
42 elif `$NGX_WINE $CC -v 2>&1 \ |
461 | 43 | grep '^Microsoft (R) 32-bit C/C++ Optimizing Compiler Version 13' \ |
703 | 44 >/dev/null 2>&1`; then |
461 | 45 |
46 NGX_CC_NAME=msvc7 | |
946 | 47 echo " + using Microsoft Visual C++ 7 compiler" |
461 | 48 |
49 else | |
50 NGX_CC_NAME=msvc | |
946 | 51 echo " + using Microsoft Visual C++ compiler" |
461 | 52 fi |
455 | 53 |
4758
1f908d2dde8d
Replaced a number of "else if" with "elif".
Ruslan Ermilov <ru@nginx.com>
parents:
4492
diff
changeset
|
54 elif [ "$CC" = wcl386 ]; then |
455 | 55 NGX_CC_NAME=owc |
946 | 56 echo " + using Open Watcom C compiler" |
455 | 57 |
4758
1f908d2dde8d
Replaced a number of "else if" with "elif".
Ruslan Ermilov <ru@nginx.com>
parents:
4492
diff
changeset
|
58 elif [ "$CC" = bcc32 ]; then |
455 | 59 NGX_CC_NAME=bcc |
946 | 60 echo " + using Borland C++ compiler" |
455 | 61 |
4758
1f908d2dde8d
Replaced a number of "else if" with "elif".
Ruslan Ermilov <ru@nginx.com>
parents:
4492
diff
changeset
|
62 elif `$CC -V 2>&1 | grep '^Intel(R) C' >/dev/null 2>&1`; then |
4492
4871a7dc12a9
Configure: moved icc detection before gcc.
Maxim Dounin <mdounin@mdounin.ru>
parents:
4412
diff
changeset
|
63 NGX_CC_NAME=icc |
4871a7dc12a9
Configure: moved icc detection before gcc.
Maxim Dounin <mdounin@mdounin.ru>
parents:
4412
diff
changeset
|
64 echo " + using Intel C++ compiler" |
4871a7dc12a9
Configure: moved icc detection before gcc.
Maxim Dounin <mdounin@mdounin.ru>
parents:
4412
diff
changeset
|
65 |
4758
1f908d2dde8d
Replaced a number of "else if" with "elif".
Ruslan Ermilov <ru@nginx.com>
parents:
4492
diff
changeset
|
66 elif `$CC -v 2>&1 | grep 'gcc version' >/dev/null 2>&1`; then |
455 | 67 NGX_CC_NAME=gcc |
946 | 68 echo " + using GNU C compiler" |
455 | 69 |
5187
f1daa0356a1d
Configure: fixed detection of newer Apple clang compilers.
Ruslan Ermilov <ru@nginx.com>
parents:
4762
diff
changeset
|
70 elif `$CC -v 2>&1 | grep '\(clang\|LLVM\) version' >/dev/null 2>&1`; then |
4762
182aee3b1bf5
Added the Clang compiler support.
Ruslan Ermilov <ru@nginx.com>
parents:
4758
diff
changeset
|
71 NGX_CC_NAME=clang |
182aee3b1bf5
Added the Clang compiler support.
Ruslan Ermilov <ru@nginx.com>
parents:
4758
diff
changeset
|
72 echo " + using Clang C compiler" |
182aee3b1bf5
Added the Clang compiler support.
Ruslan Ermilov <ru@nginx.com>
parents:
4758
diff
changeset
|
73 |
4758
1f908d2dde8d
Replaced a number of "else if" with "elif".
Ruslan Ermilov <ru@nginx.com>
parents:
4492
diff
changeset
|
74 elif `$CC -V 2>&1 | grep 'Sun C' >/dev/null 2>&1`; then |
561 | 75 NGX_CC_NAME=sunc |
946 | 76 echo " + using Sun C compiler" |
561 | 77 |
4758
1f908d2dde8d
Replaced a number of "else if" with "elif".
Ruslan Ermilov <ru@nginx.com>
parents:
4492
diff
changeset
|
78 elif `$CC -V 2>&1 | grep '^Compaq C' >/dev/null 2>&1`; then |
455 | 79 NGX_CC_NAME=ccc |
946 | 80 echo " + using Compaq C compiler" |
455 | 81 |
4758
1f908d2dde8d
Replaced a number of "else if" with "elif".
Ruslan Ermilov <ru@nginx.com>
parents:
4492
diff
changeset
|
82 elif `$CC -V 2>&1 | grep '^aCC: ' >/dev/null 2>&1`; then |
455 | 83 NGX_CC_NAME=acc |
946 | 84 echo " + using HP aC++ compiler" |
455 | 85 |
86 else | |
517 | 87 NGX_CC_NAME=unknown |
455 | 88 |
4758
1f908d2dde8d
Replaced a number of "else if" with "elif".
Ruslan Ermilov <ru@nginx.com>
parents:
4492
diff
changeset
|
89 fi |