Menu ▾ ▴

#14 [1.36] compilation failed under cygwin

open
nobody
None
5
2006-11-27
2006-11-27
No

basically some libraries need to be included:

Some other "issues"
1/ cd /cygdrive/c/src/test/shttpd
make win-release
=> no 'win' target in src/Makefile

2/ cd src
make mingw
=> lot of errors (and warnings) under cygwin
'http://www.cygwin.com'

3/ Nice tool but some docs would be nice... Maybe i'll write some textfile describing us I discover the application.

4/ lot's of "deprecated" errors on MS VC 2005
#if defined(_MSC_VER) && _MSC_VER > 1400 && !defined(_CRT_SECURE_NO_DEPRECATE)
==> This is VS 2005
#endif

Greetz

Discussion

  • Sergey Lyubka

    Sergey Lyubka - 2006-12-02

    Logged In: YES
    user_id=215691
    Originator: NO

    some #pragmas have been added, warnings should go.
    is it true or mingw build is still unclean?

     
  • Dave Jones

    Dave Jones - 2006-12-03

    Logged In: YES
    user_id=123639
    Originator: NO

    1/ I think this is fixed in the current CVS HEAD

    2/ I haven't tried compiling under Cygwin yet, but I've found it compiles happily under a "pure" MingW environment (i.e. no Cygwin at all, just running the MSYS shell).

    4/ Under MS VC 2005 I just use the following patch (against CVS HEAD) to compat_win32.h to disable all the deprecation warnings:

    Index: compat_win32.h

    RCS file: /cvsroot/shttpd/shttpd/src/compat_win32.h,v
    retrieving revision 1.3
    diff -r1.3 compat_win32.h
    11,13d10
    < /* Tip from Justin Maximilian, suppress errors from winsock2.h */
    < #define _WINSOCKAPI_
    <
    15d11
    < #include <winsock2.h>
    28a25,27
    > #if (_MSC_VER >= 1400) // VC8+
    > #pragma warning(disable : 4996) // Disable all deprecation warnings
    > #endif // VC8+

     
  • Steven Van Ingelgem

     
  • Steven Van Ingelgem

    Logged In: YES
    user_id=569271
    Originator: YES

    1/ win-release is kind of tricky ;) Not everyone out there has MS tools installed. Maybe something to put on a ToDo-list that you would be able to choose which release? (like mingw-release, vc-release, bcc-release)?

    2/ Please find in attachement the build I did (cvs clean checkout, cd shttpd, cd src, make mingw under a just now updated cygwin build-environment).

    3/ Decided not to go for it and put my effort in a cpp-class... The only sad thing I found out is that shttpd is single threaded.

    4/ Yeah, MSVC 2k5 is weird

     
  • Sergey Lyubka

    Sergey Lyubka - 2006-12-03

    Logged In: YES
    user_id=215691
    Originator: NO

    the top-level Makefile is not supposed to be used by everyone. It is solely for the project admins, for creating releases on sf.net site. So I would not consider changing it.
    About mingw, please write to shttpd-general mailing list. Another shttpd developer, Luke Dunstan, knows much more about mingw than I do.

     
  • Luke Dunstan

    Luke Dunstan - 2006-12-05

    Logged In: YES
    user_id=30442
    Originator: NO

    Cygwin is not MinGW (unless maybe if you compile with -mno-cygwin) so I would not really expect "make mingw" to work. I don't use Cygwin so I can't really help with porting the makefile or code.

     
  • Dave Jones

    Dave Jones - 2006-12-05

    Logged In: YES
    user_id=123639
    Originator: NO

    I've got it compiling happily now under Cygwin. There's a couple of ways to do it:

    If you want the resulting executable to run in the Cygwin environment (i.e. be reliant upon cygwin1.dll and such like) then use "make unix" (not "make mingw"). It builds with several warnings about O_BINARY being redefined, but seems to run happily enough (although obviously the unix build lacks the GUI).

    If you want the resulting executable to be a "true" Windows app (independent of Cygwin) you need to add -mno-cygwin to the CFLAGS. For example:

    CFLAGS="-mno-cygwin" make mingw

    In this case it builds cleanly and the resulting binary seems to run as happily as a build from "pure" MinGW. However, as mentioned in #1608193 the GUI doesn't currently work with a MinGW build - the (pretty simple) solution can be found in that report, see the comments (ignore my conclusion in the report itself).

    If you want to get the binary as small as possible, try adding -O2 to the CFLAGS and remember to "strip" the binary afterward (of course, if you don't require certain functionality like SSL or CGI, you can add -DNO_SSL and -DNO_CGI, among others, to the CFLAGS). For example:

    CFLAGS="-O2 -DNO_SSL -DNO_CGI -mno-cygwin" make mingw && strip shttpd.exe

    On my system this results in a nice, small 54k executable (might be a bit larger than standard as my working copy currently has the NT service wrapper stuff in it).

    Good luck!

     
  • Sergey Lyubka

    Sergey Lyubka - 2008-05-27

    Logged In: YES
    user_id=215691
    Originator: NO

    What is the status of this? Does anybody care about MinGW?
    If not, I'll close the bug in one month or so.

     

Log in to post a comment.