diff options
| author | Maxim Dounin <mdounin@mdounin.ru> | 2013-09-04 20:48:28 +0400 |
|---|---|---|
| committer | Maxim Dounin <mdounin@mdounin.ru> | 2013-09-04 20:48:28 +0400 |
| commit | 48d96ced6ff6cea533d56d0d09129f6632a19e4d (patch) | |
| tree | f3196223e3dd9173aaf91dff959498799c0e3ea2 /auto/lib | |
| parent | 74b7a910137a99b5fb073e7c27858c019f96a8cc (diff) | |
| download | nginx-48d96ced6ff6cea533d56d0d09129f6632a19e4d.tar.gz nginx-48d96ced6ff6cea533d56d0d09129f6632a19e4d.tar.bz2 | |
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.
Diffstat (limited to 'auto/lib')
| -rw-r--r-- | auto/lib/openssl/conf | 4 | ||||
| -rw-r--r-- | auto/lib/pcre/conf | 5 | ||||
| -rw-r--r-- | auto/lib/pcre/make | 19 | ||||
| -rw-r--r-- | auto/lib/zlib/make | 23 |
4 files changed, 40 insertions, 11 deletions
diff --git a/auto/lib/openssl/conf b/auto/lib/openssl/conf index 528ee1794..a65815f63 100644 --- a/auto/lib/openssl/conf +++ b/auto/lib/openssl/conf @@ -33,6 +33,10 @@ if [ $OPENSSL != NONE ]; then CORE_LIBS="$CORE_LIBS $OPENSSL/.openssl/lib/libssl.a" CORE_LIBS="$CORE_LIBS $OPENSSL/.openssl/lib/libcrypto.a" CORE_LIBS="$CORE_LIBS $NGX_LIBDL" + + if [ "$NGX_PLATFORM" = win32 ]; then + CORE_LIBS="$CORE_LIBS -lgdi32 -lcrypt32 -lws2_32" + fi ;; esac diff --git a/auto/lib/pcre/conf b/auto/lib/pcre/conf index 345860053..939f01b77 100644 --- a/auto/lib/pcre/conf +++ b/auto/lib/pcre/conf @@ -73,6 +73,11 @@ if [ $PCRE != NONE ]; then *) have=NGX_PCRE . auto/have + + if [ "$NGX_PLATFORM" = win32 ]; then + have=PCRE_STATIC . auto/have + fi + CORE_DEPS="$CORE_DEPS $PCRE/pcre.h" LINK_DEPS="$LINK_DEPS $PCRE/.libs/libpcre.a" CORE_LIBS="$CORE_LIBS $PCRE/.libs/libpcre.a" diff --git a/auto/lib/pcre/make b/auto/lib/pcre/make index c50d12f9f..0a27a112c 100644 --- a/auto/lib/pcre/make +++ b/auto/lib/pcre/make @@ -23,14 +23,16 @@ case "$NGX_CC_NAME" in ngx_pcre=`echo \-DPCRE=\"$PCRE\" | sed -e "s/\//$ngx_regex_dirsep/g"` ;; -esac + *) + ngx_makefile= + ;; +esac -case "$NGX_PLATFORM" in - win32) +if [ -n "$ngx_makefile" ]; then - cat << END >> $NGX_MAKEFILE + cat << END >> $NGX_MAKEFILE `echo "$PCRE/pcre.lib: $PCRE/pcre.h $NGX_MAKEFILE" \ | sed -e "s/\//$ngx_regex_dirsep/g"` @@ -41,10 +43,9 @@ case "$NGX_PLATFORM" in END - ;; +else - *) - cat << END >> $NGX_MAKEFILE + cat << END >> $NGX_MAKEFILE $PCRE/pcre.h: $PCRE/Makefile @@ -60,6 +61,4 @@ $PCRE/.libs/libpcre.a: $PCRE/Makefile END - ;; - -esac +fi diff --git a/auto/lib/zlib/make b/auto/lib/zlib/make index 9401a1d1a..7875ef67f 100644 --- a/auto/lib/zlib/make +++ b/auto/lib/zlib/make @@ -24,6 +24,10 @@ case "$NGX_CC_NAME" in ngx_zlib=`echo \-DZLIB=\"$ZLIB\" | sed -e "s/\//$ngx_regex_dirsep/g"` ;; + *) + ngx_makefile= + ;; + esac @@ -33,13 +37,30 @@ done=NO case "$NGX_PLATFORM" in win32) - cat << END >> $NGX_MAKEFILE + + if [ -n "$ngx_makefile" ]; then + cat << END >> $NGX_MAKEFILE `echo "$ZLIB/zlib.lib: $NGX_MAKEFILE" | sed -e "s/\//$ngx_regex_dirsep/g"` \$(MAKE) -f auto/lib/zlib/$ngx_makefile $ngx_opt $ngx_zlib END + else + + cat << END >> $NGX_MAKEFILE + +$ZLIB/libz.a: $NGX_MAKEFILE + cd $ZLIB \\ + && \$(MAKE) distclean \\ + && \$(MAKE) -f win32/Makefile.gcc \\ + CFLAGS="$ZLIB_OPT" CC="\$(CC)" \\ + libz.a + +END + + fi + done=YES ;; |
