Opened 2 years ago

Last modified 2 years ago

#2422 closed defect

Issue with OpenSSL Makefile Perl Command and %cd% not resolving properly — at Version 3

Reported by: justdan23@… Owned by:
Priority: blocker Milestone:
Component: nginx-core Version: 1.22.x
Keywords: Cc: justdan23@…
uname -a: justdan23@gmail.com
nginx -V: Not Able to Build on Windows using MSYS2 and MingW64

Description (last modified by justdan23@…)

Version: master (and) stable-1.22 branches
File: nginx/auto/lib/openssl/Makefile
Platform: VC-WIN64A on Windows OS using MSYS2 (64-bit) and Mingw64 (64-bit)

Issue: perl Configure changed to VC-WIN64A manually (but occurs with VC-WIN32), and results in %cd% not resolving to objs/lib/ folder causing an error where it is unable to find the folder pre location.

# Copyright (C) Igor Sysoev
# Copyright (C) Nginx, Inc.

all:
	export cd=/home/justd/nginx/dist

	cd $(OPENSSL)
	
	perl Configure VC-WIN64A no-shared no-threads			\
		--prefix="%cd%/openssl" 				\
		--openssldir="%cd%/openssl/ssl" 			\
		$(OPENSSL_OPT)

	if exist ms\do_ms.bat (						\
		ms\do_ms						\
		&& $(MAKE) -f ms\nt.mak					\
		&& $(MAKE) -f ms\nt.mak install				\
	) else (							\
		$(MAKE)							\
		&& $(MAKE) install_sw					\
	)

Error Output:

$ make
make -f objs/Makefile
make[1]: Entering directory '/home/justd/nginx'
make -f auto/lib/openssl/makefile.msvc                                  OPENSSL="objs/lib/openssl" OPENSSL_OPT=""
make[2]: Entering directory '/home/justd/nginx'
export cd=/home/justd/nginx/dist
cd objs/lib/openssl
perl Configure VC-WIN64A no-shared no-threads                   \
        --prefix="%cd%/openssl"                                 \
        --openssldir="%cd%/openssl/ssl"                         \

Can't open perl script "Configure": No such file or directory
make[2]: *** [auto/lib/openssl/makefile.msvc:10: all] Error 2
make[2]: Leaving directory '/home/justd/nginx'
make[1]: *** [objs/Makefile:1825: objs/lib/openssl/openssl/include/openssl/ssl.h] Error 2
make[1]: Leaving directory '/home/justd/nginx'
make: *** [Makefile:10: build] Error 2

I uploaded the zip of the entire dev environment at the URL below:
https://1drv.ms/u/s!AqtOkpGwHMQ2rBP002wedbn5n1Lx?e=W3zXoP

Change History (6)

by justdan23@…, 2 years ago

Attachment: Makefile added

objs/Makefile

by justdan23@…, 2 years ago

Attachment: makefile.msvc added

From nginx-dev\auto\lib\openssl\Makefile.msvc

by justdan23@…, 2 years ago

Attachment: makefile.2.msvc added

From nginx-dev\auto\cc

comment:1 by Maxim Dounin, 2 years ago

Resolution: invalid
Status: newclosed

For MSVC builds, you are expected to use nmake as provided by MSVC, not GNU make. See Building nginx on the Win32 platform with Visual C for details.

comment:2 by justdan23@…, 2 years ago

I uploaded the zip of the entire dev environment at the URL below:
https://1drv.ms/u/s!AqtOkpGwHMQ2rBP002wedbn5n1Lx?e=W3zXoP

comment:3 by justdan23@…, 2 years ago

Description: modified (diff)
Resolution: invalid
Status: closedreopened

I tried with 'nmake' and the result is the same:

$ nmake

Microsoft (R) Program Maintenance Utility Version 14.34.31935.0
Copyright (C) Microsoft Corporation.  All rights reserved.

        "C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.34.31933\bin\Hostx64\x64\nmake.exe" -f objs/Makefile

Microsoft (R) Program Maintenance Utility Version 14.34.31935.0
Copyright (C) Microsoft Corporation.  All rights reserved.

        "C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.34.31933\bin\Hostx64\x64\nmake.exe" -f auto/lib/openssl/makefile.msvc                                    OPENSSL="objs/lib/openssl" OPENSSL_OPT=""

Microsoft (R) Program Maintenance Utility Version 14.34.31935.0
Copyright (C) Microsoft Corporation.  All rights reserved.

        cd objs/lib/openssl
        perl Configure VC-WIN64A no-shared no-threads                    --prefix="%cd%/openssl"                                 --openssldir="%cd%/openssl/ssl"
Configuring OpenSSL version 3.0.8-dev for target VC-WIN64A
Using os-specific seed configuration

Failure!  makefile wasn't produced.
Please read INSTALL.md and associated NOTES-* files.  You may also have to
look over your available compiler tool chain or change your configuration.


******************************************************************************
This perl implementation doesn't produce Windows like paths (with backward
slash directory separators).  Please use an implementation that matches your
building platform.

This Perl version: 5.36.0 for x86_64-msys-thread-multi
******************************************************************************
NMAKE : fatal error U1077: 'perl' : return code '0xff'
Stop.
NMAKE : fatal error U1077: '"C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.34.31933\bin\Hostx64\x64\nmake.exe"' : return code '0x2'
Stop.
NMAKE : fatal error U1077: '"C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.34.31933\bin\Hostx64\x64\nmake.exe"' : return code '0x2'
Stop.
Note: See TracTickets for help on using tickets.