Anton,

Do not run configure stunnel. Not required. After your openssl is compiled, Just edit mingw.mak. You also need to set the SSLDIR (I guess you did ;) ...
And just comment the line that includes applink.c in stunnel.c

Regards,

Jose
From: Anton Tkachev <[email protected]>
Date: Wed, 1 Aug 2012 15:54:45 +0700
To: Jose Alf.<[email protected]>
Cc: [email protected]<[email protected]>; [email protected]<[email protected]>
Subject: Re: [stunnel-users] Build stunnel 4.53 binaries for windows error

I used the same openssl version: 1.0.0h
I had to change also CFLAGS in mingw.mak from
�� CFLAGS=-g -O2 -Wall $(DEFINES) -I$(SSLDIR)/inc32
to
�� CFLAGS=-g -O2 -Wall $(DEFINES) -I$(SSLDIR)/include
because folder inc32 doesn't exist.

Now when I run make -f mingw.mak I get the following error:
# make -f mingw.mak
host machine is a linux machine
make: [makedirs] Error 1 (ignored)
make: [makedirs] Error 1 (ignored)
make: [makedirs] Error 1 (ignored)
make: [makedirs] Error 1 (ignored)
/usr/bin/i586-mingw32msvc-gcc -g -O2 -Wall -D_WIN32_WINNT=0x0501 -I/usr/src/openssl-1.0.0h/include -o../obj/MGW32/stunnel.o -c ../src/stunnel.c
../src/stunnel.c:44: warning: expected [error|warning|ignored] after �#pragma GCC diagnostic�
../src/stunnel.c:47:29: error: openssl/applink.c: No such file or directory
../src/stunnel.c:49: warning: expected [error|warning|ignored] after �#pragma GCC diagnostic�
make: *** [../obj/MGW32/stunnel.o] Error 1

How do you configure openssl and stunnel?
./Configure --cross-compile-prefix=i586-mingw32msvc- mingw shared zlib-dynamic
and
./configure --with-ssl=/usr/src/openssl-1.0.0h
?

2012/8/1 Jose Alf. <[email protected]>
Anton,
Actually, I managed to compile it under Debian. We were doing it wrong. We must use the same method I use under Windows :)
1. Go to the src directory and edit the file mingw.mak. Set variables CC, RC, RCP as needed. I attach mine for you.
2. From src, execute make -f mingw.mak
3. If everything's fine, you'll find stunnel.exe in bin/MGW32
Time ti update the docs?
regards
Jose

From: Anton Tkachev <[email protected]>
To: Jose Alf. <[email protected]>
Cc: "[email protected]" <[email protected]>; "[email protected]" <[email protected]>
Sent: Tuesday, July 31, 2012 2:39 AM
Subject: Re: [stunnel-users] Build stunnel 4.53 binaries for windows error

Hey Jose,

Could you just share your build inctructions under windows?
If it works, fine - I can use windows too :)

Thank you,
Anton.

2012/7/24 Jose Alf. <[email protected]>
Anton,
I usually compile my stunnel under windows (mingw). I tested with Debian Squeeze installation and I found the same problem. In step 6, ./configure finish fine, but the Make step does not work.
I checked and I found the included directories are not th right ones. I will take a look later this week.
Mich,
Any suggestions?
Regards
Jose
From: Anton Tkachev <[email protected]>
To: [email protected]
Cc: [email protected]; [email protected]
Sent: Monday, July 23, 2012 7:11 AM
Subject: Re: [stunnel-users] Build stunnel 4.53 binaries for windows error

> Does the ./configure script under stunnel-4.53 finish OK?
Yes. No errors at this step.

> I also think that you should pass a parameter to force the cross compilation of stunnel. It could be using the default system compiler. Maybe set CC, GCC environment vars to point to the cross compiler path before running ./configure: eg
>
> export CC=/usr/pathtomingwgcc/bin/gcc
My mingw installation doesn't have any compiler.

I think the problem in openssl path, because error message is:
# make stunnel.exe
i586-mingw32msvc-gcc -c -I/usr/src/openssl-1.0.0f-i586/include -mthreads -fstack-protector -O2 -Wall -Wextra -Wno-long-long -pedantic -o str.obj str.c
In file included from str.c:38:
common.h:392:33: error: openssl/opensslconf.h: No such file or directory
common.h:405:27: error: openssl/lhash.h: No such file or directory
common.h:406:25: error: openssl/ssl.h: No such file or directory
...

These files exist in /usr/src/openssl-1.0.0f-i586/include/openssl directory, but building doesn't work anyway...


2012/7/20 <[email protected]>
Anton,

Does the ./configure script under stunnel-4.53 finish OK? I also think that you should pass a parameter to force the cross compilation of stunnel. It could be using the default system compiler. Maybe set CC, GCC environment vars to point to the cross compiler path before running ./configure: eg

export CC=/usr/pathtomingwgcc/bin/gcc

Enjoy!
From: Anton Tkachev <[email protected]>
Date: Fri, 20 Jul 2012 21:44:09 +0700
Subject: Re: [stunnel-users] Build stunnel 4.53 binaries for windows error

Hey Jose,
Thank you for your response!

> You cross compiled your openssl 1.01c for mingw32, right?
Yes, I used
./Configure --cross-compile-prefix=i586-mingw32msvc- mingw shared zlib-dynamic
command.

> Try passing the path of your mingw32 openssl includes and libs to stunnel configure:
>
> --with-openssl*=
>
> Do configure --help to see the exact syntax.

Do you mean
./configure --with-ssl=/usr/src/openssl-1.0.1c-i586 --includedir=/usr/i586-mingw32msvc/include --libdir=/usr/i586-mingw32msvc/lib
?
Unfortunately 'make stunnel.exe' returns the same error in this case.

2012/7/20 <[email protected]>
Anton,

Ahh... The joys of cross compiling!

You cross compiled your openssl 1.01c for mingw32, right? Or you installed the mingw32 version. �Try passing the path of your mingw32 openssl includes and libs to stunnel configure:

--with-openssl*=

Do configure --help to see the exact syntax.

Let us know how it goes.
-----Original Message-----
From: Anton Tkachev <[email protected]>
Sender: [email protected]
Date: Fri, 20 Jul 2012 16:28:57
To: <[email protected]>
Subject: [stunnel-users] Build stunnel 4.53 binaries for windows error

_______________________________________________
stunnel-users mailing list
[email protected]
http://stunnel.mirt.net/mailman/listinfo/stunnel-users