[PATCH] Use .exe for binaries for all win32 compilers

Maxim Dounin mdounin at mdounin.ru
Tue Jun 6 17:09:52 UTC 2017


Hello!

On Tue, Jun 06, 2017 at 05:54:01PM +0300, Orgad Shaneh wrote:

> > http://mailman.nginx.org/pipermail/nginx-devel/2016-December/009234.html
> 
> Thanks. It is needed with MSYS2 / gcc. Proposing a new patch:
> 
> ---
>  auto/cc/bcc  | 1 -
>  auto/cc/conf | 7 ++++++-
>  auto/cc/msvc | 1 -
>  auto/cc/owc  | 1 -
>  4 files changed, 6 insertions(+), 4 deletions(-)
> 
> diff --git a/auto/cc/bcc b/auto/cc/bcc
> index ec82e60f..e990a9f7 100644
> --- a/auto/cc/bcc
> +++ b/auto/cc/bcc
> @@ -62,7 +62,6 @@ ngx_include_opt="-I"
>  ngx_objout="-o"
>  ngx_binout="-e"
>  ngx_objext="obj"
> -ngx_binext=".exe"
> 
>  ngx_long_start='@&&|
>   '
> diff --git a/auto/cc/conf b/auto/cc/conf
> index afbca62b..7e1186b5 100644
> --- a/auto/cc/conf
> +++ b/auto/cc/conf
> @@ -14,9 +14,14 @@ ngx_pic_opt="-fPIC"
>  ngx_objout="-o "
>  ngx_binout="-o "
>  ngx_objext="o"
> -ngx_binext=
>  ngx_modext=".so"
> 
> +if [ "$NGX_PLATFORM" = win32 ]; then
> +    ngx_binext=".exe"
> +else
> +    ngx_binext=
> +fi
> +
>  ngx_long_start=
>  ngx_long_end=
> 

Looking more at this I tend to think that a better place would be 
to redefine it in auto/os/win32, like this:

diff --git a/auto/os/win32 b/auto/os/win32
--- a/auto/os/win32
+++ b/auto/os/win32
@@ -13,6 +13,7 @@ NGX_ICONS="$NGX_WIN32_ICONS"
 SELECT_SRCS=$WIN32_SELECT_SRCS
 
 ngx_pic_opt=
+ngx_binext=".exe"
 
 case "$NGX_CC_NAME" in
 

Full patch modified accordingly provided below.  Please test if it 
works for you.

# HG changeset patch
# User Orgad Shaneh <orgads at gmail.com>
# Date 1496767054 -10800
#      Tue Jun 06 19:37:34 2017 +0300
# Node ID 6c9b1238cf5c99ffc5a8a449ce738606e312350e
# Parent  23bea7aaebe287722ec5b5252e145da55d7906a9
Configure: use .exe for binaries for all win32 compilers.

diff --git a/auto/cc/bcc b/auto/cc/bcc
--- a/auto/cc/bcc
+++ b/auto/cc/bcc
@@ -62,7 +62,6 @@ ngx_include_opt="-I"
 ngx_objout="-o"
 ngx_binout="-e"
 ngx_objext="obj"
-ngx_binext=".exe"
 
 ngx_long_start='@&&|
 	'
diff --git a/auto/cc/msvc b/auto/cc/msvc
--- a/auto/cc/msvc
+++ b/auto/cc/msvc
@@ -142,7 +142,6 @@ ngx_pic_opt=
 ngx_objout="-Fo"
 ngx_binout="-Fe"
 ngx_objext="obj"
-ngx_binext=".exe"
 
 ngx_long_start='@<<
 	'
diff --git a/auto/cc/owc b/auto/cc/owc
--- a/auto/cc/owc
+++ b/auto/cc/owc
@@ -84,7 +84,6 @@ ngx_include_opt="-i="
 ngx_objout="-fo"
 ngx_binout="-fe="
 ngx_objext="obj"
-ngx_binext=".exe"
 
 ngx_regex_dirsep='\\'
 ngx_dirsep="\\"
diff --git a/auto/os/win32 b/auto/os/win32
--- a/auto/os/win32
+++ b/auto/os/win32
@@ -13,6 +13,7 @@ NGX_ICONS="$NGX_WIN32_ICONS"
 SELECT_SRCS=$WIN32_SELECT_SRCS
 
 ngx_pic_opt=
+ngx_binext=".exe"
 
 case "$NGX_CC_NAME" in
 

-- 
Maxim Dounin
http://nginx.org/


More information about the nginx-devel mailing list