Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can you provide a detailed nginx-clojure-embed compilation process ? #269

Open
xtherk opened this issue Aug 2, 2022 · 8 comments
Open

Comments

@xtherk
Copy link

xtherk commented Aug 2, 2022

Since the release version does not support the ip_hash feature, I want to try to compile.

nginx-1.23.1
pcre-8.45
openssl-3.0.5
msvc cl 19.29
perl-5.32.1

I successfully compiled nginx.exe with this environment.

Progress

I execute /nginx-clojure-embed/configure-win32 , it output ..

creating xxxxxxx/nginx-compile/nginx-clojure/nginx-clojure-embed\Makefile
done
please try make to compile shared library of nginx-clojure-embed
please modify xxxxx/nginx-compile/nginx/auto/lib/sha1/makefile.msvc to add openssl sha headers
./configure-win32: line 149: LIBC: command not found
./configure-win32: line 149: CPU_OPT: command not found
CFLAGS = -nologo -O2 -Ob1 -Oi -Gs   -D L_ENDIAN -I xxxxxx/nginx-compile/nginx/objs/lib/openssl-3.0.5/openssl/include -I xxxxxx/nginx-compile/nginx/objs/lib/openssl-3.0.5/crypto

But the current version of nginx no longer exists lib/sha1/makefile.msvc so idk how do it,
Or can you provide support ip_hash nginx (dll/so/dylib) ?

@xtherk xtherk changed the title Can you provide a detailed nginx-clojure-embedded compilation process ? Can you provide a detailed nginx-clojure-embed compilation process ? Aug 2, 2022
@xfeep
Copy link
Member

xfeep commented Aug 6, 2022

Please try to execute below command under nginx folder after you execute nginx-clojure-embed/configure-win32

nmake -f objs/Makefile NGX_WIN64=1 embed

If successful, a dll file named nginx-clojure-embed-windows-x64.dll will appear under the folder objs.

@xtherk
Copy link
Author

xtherk commented Aug 8, 2022

Please try to execute below command under nginx folder after you execute nginx-clojure-embed/configure-win32

nmake -f objs/Makefile NGX_WIN64=1 embed

If successful, a dll file named nginx-clojure-embed-windows-x64.dll will appear under the folder objs.

Ok thank you, I will try later, if there is a problem, I will report again.

@xtherk
Copy link
Author

xtherk commented Aug 8, 2022

I executed nmake -f objs/Makefile NGX_WIN64=1 embed, but it failed immediately.

C:\Users\xtherk\Desktop\nginx-env\nginx>nmake -f objs/Makefile NGX_WIN64=1 embed
        "C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.29.30133\bin\HostX64\x64\nmake.exe" -f auto/lib/openssl/makefile.msvc                                   OPENSSL="objs/lib/openssl-3.0.5" OPENSSL_OPT="enable-tlsext"

        cd objs/lib/openssl-3.0.5
        perl Configure VC-WIN64A no-shared                               --prefix="%cd%/openssl"                                 --openssldir="%cd%/openssl/ssl"                         enable-tlsext

Failure!  build file 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.

***** Unsupported options: enable-tlsext
NMAKE : fatal error U1077: “perl”: 返回代码“0xff”
Stop.
NMAKE : fatal error U1077: “"C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.29.30133\bin\HostX64\x64\nmake.exe"”: 返回代码“0x2”
Stop.

I tried google some answers, but did not query useful information.

@xtherk
Copy link
Author

xtherk commented Aug 8, 2022

I remove the option OPENSSL_OPT="enable-tlsext" and try again.
After a period of time, it output:

找不到 C:\Users\xtherk\Desktop\nginx-env\nginx\objs\lib\openssl-3.0.5\legacy.*
NMAKE : fatal error U1077: “cmd”: 返回代码“0x1”
Stop.
NMAKE : fatal error U1077: “"C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.29.30133\bin\HostX64\x64\nmake.exe"”: 返回代码“0x2”
Stop.
NMAKE : fatal error U1077: “if”: 返回代码“0x2”
Stop.
NMAKE : fatal error U1077: “"C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.29.30133\bin\HostX64\x64\nmake.exe"”: 返回代码“0x2”
Stop.

I compiled in a clean virtual machine.

@xfeep
Copy link
Member

xfeep commented Aug 9, 2022

@xtherk

Sorry, some internals of NGINX have changed since 1.23.0, so even though we fixed compilation issues with openssl 3.x on windows, we cannot successfully compile nginx-clojure with these versions.
I'll try to fix it if I'm free.

@xtherk
Copy link
Author

xtherk commented Aug 9, 2022

@xtherk

Sorry, some internals of NGINX have changed since 1.23.0, so even though we fixed compilation issues with openssl 3.x on windows, we cannot successfully compile nginx-clojure with these versions. I'll try to fix it if I'm free.

Ok thanks.

Can you provide your previous compilation of successful nginx version information and Virtual Studio version.
Thank you very much.

@xfeep
Copy link
Member

xfeep commented Aug 9, 2022

Building nginx-clojure-embed on windows is harder than on other systems.

Below is my compilation environment:

  • Windows XP 64-bit
  • cl and nmake from VC++ 2010 Express
  • MingGW msys
  • openssl 1.1.0e
  • Active perl 5.18.2

And we must modify auto/lib/openssl/makefile.msvc to



all:
	cd $(OPENSSL)

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

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

Also add below code to nginx_win32_config.h

#ifdef _MSC_VER
#pragma warning(disable:4201)
#pragma warning(disable:4306)
#pragma warning(disable:4244)
#pragma warning(disable:4267)
#pragma warning(disable:4334)
#pragma warning(disable:4018)
#pragma warning(disable:4133)
#pragma warning(disable:4214)
#endif

@xtherk
Copy link
Author

xtherk commented Aug 9, 2022

@xfeep 非常感谢!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants