caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
* MinGW port w/o Cygwin?
@ 2007-12-20 14:30 Kuba Ober
  2007-12-20 15:23 ` Zheng Li
  0 siblings, 1 reply; 16+ messages in thread
From: Kuba Ober @ 2007-12-20 14:30 UTC (permalink / raw)
  To: caml-list

I'm looking at getting the MinGW/MSYS port working w/o Cygwin.

I understand that command line length is problematic under Windows,
among other things. I was thinking of implementing (if not present yet) 
argument files for MinGW, along with requisite build system changes
in Ocaml itself, such that native builds under Windows could be done
without Cygwin. I'd also try and get the patches accepted into MinGW
/ MSYS.

Are there any other issues which prevent the MSYS-based build from
working? Does anyone have a "to-do" list for that, that I could start working 
on?

For me, Cygwin is a big showstopper, and I'd really want to move my Lisp code 
base to Ocaml, but it has to build on Windows without kludges. Yeah, I know,
GCL (which I use) is a big kludge in itself ;)

Cheers, Kuba


^ permalink raw reply	[flat|nested] 16+ messages in thread

* Re: MinGW port w/o Cygwin?
  2007-12-20 14:30 MinGW port w/o Cygwin? Kuba Ober
@ 2007-12-20 15:23 ` Zheng Li
  2007-12-20 20:18   ` [Caml-list] " Kuba Ober
  0 siblings, 1 reply; 16+ messages in thread
From: Zheng Li @ 2007-12-20 15:23 UTC (permalink / raw)
  To: caml-list


FYI, http://d2bg.nfshost.com/lang/ocaml/ocaml.compilation.with.mingw

Kuba Ober <ober.14@osu.edu> writes:
> I'm looking at getting the MinGW/MSYS port working w/o Cygwin.
>
> I understand that command line length is problematic under Windows,
> among other things. I was thinking of implementing (if not present yet) 
> argument files for MinGW, along with requisite build system changes
> in Ocaml itself, such that native builds under Windows could be done
> without Cygwin. I'd also try and get the patches accepted into MinGW
> / MSYS.

Cheers
-- 
Zheng Li
http://www.pps.jussieu.fr/~li


^ permalink raw reply	[flat|nested] 16+ messages in thread

* Re: [Caml-list] Re: MinGW port w/o Cygwin?
  2007-12-20 15:23 ` Zheng Li
@ 2007-12-20 20:18   ` Kuba Ober
  2007-12-21 14:06     ` Dmitry Bely
  0 siblings, 1 reply; 16+ messages in thread
From: Kuba Ober @ 2007-12-20 20:18 UTC (permalink / raw)
  To: caml-list

On Thursday 20 December 2007, Zheng Li wrote:
> FYI, http://d2bg.nfshost.com/lang/ocaml/ocaml.compilation.with.mingw

Tried it and sure enough - it works!!! (On an XP machine that never saw Cygwin
either).

That's *extremely* good news to me.

I guess that Ocaml maintainers should just drop that Cygwin requirement, and 
tweak their build process to work "out of the box" with MSYS/MinGW.

Cheers, Kuba


^ permalink raw reply	[flat|nested] 16+ messages in thread

* Re: [Caml-list] Re: MinGW port w/o Cygwin?
  2007-12-20 20:18   ` [Caml-list] " Kuba Ober
@ 2007-12-21 14:06     ` Dmitry Bely
  2007-12-23 15:20       ` "Márk S. Zoltán"
  2007-12-26 17:45       ` Kuba Ober
  0 siblings, 2 replies; 16+ messages in thread
From: Dmitry Bely @ 2007-12-21 14:06 UTC (permalink / raw)
  To: ocaml

On Dec 20, 2007 11:18 PM, Kuba Ober <ober.14@osu.edu> wrote:

> Tried it and sure enough - it works!!! (On an XP machine that never saw Cygwin
> either).
>
> That's *extremely* good news to me.
>
> I guess that Ocaml maintainers should just drop that Cygwin requirement, and
> tweak their build process to work "out of the box" with MSYS/MinGW.

If MSYS become mandatory I strongly disagree. Cygwin is a common
requirement for building any Ocaml distribution on Windows (even if
you use Microsoft Visual Studio). I see absolutely no problem to
install and use it. Why I should bother to install another Cygwin fork
(MSYS) and handle name clashes etc.?

- Dmitry Bely


^ permalink raw reply	[flat|nested] 16+ messages in thread

* Re: Re: [Caml-list] Re: MinGW port w/o Cygwin?
  2007-12-21 14:06     ` Dmitry Bely
@ 2007-12-23 15:20       ` "Márk S. Zoltán"
  2007-12-23 16:33         ` Re : " Adrien
  2007-12-24 10:40         ` Richard Jones
  2007-12-26 17:45       ` Kuba Ober
  1 sibling, 2 replies; 16+ messages in thread
From: "Márk S. Zoltán" @ 2007-12-23 15:20 UTC (permalink / raw)
  To: Caml Mailing List

[-- Attachment #1: Type: text/plain, Size: 3242 bytes --]

Dmitry Bely wrote:
> On Dec 20, 2007 11:18 PM, Kuba Ober <ober.14@osu.edu> wrote:
>
>   
>> Tried it and sure enough - it works!!! (On an XP machine that never saw Cygwin
>> either).
>>
>> That's *extremely* good news to me.
>>
>> I guess that Ocaml maintainers should just drop that Cygwin requirement, and
>> tweak their build process to work "out of the box" with MSYS/MinGW.
>>     
>
> If MSYS become mandatory I strongly disagree. Cygwin is a common
> requirement for building any Ocaml distribution on Windows (even if
> you use Microsoft Visual Studio). I see absolutely no problem to
> install and use it. Why I should bother to install another Cygwin fork
> (MSYS) and handle name clashes etc.?
>
> - Dmitry Bely
>
>   

I am using my clandestine MSys + MinGW OCaml since about 3.0, and I have 
originally switched to MSys because the configuration scripts of a 
number of other apps and libraries did not handle the -mno-cygwin flag, 
or any other flag for that matter: the 'supply extra compiler flags' 
feature seemed to be thoroughly broken in all configure scripts, I 
wonder if anyone ever uses it. When it comes to building apps from 
tarballs, the best bet is to use Cygwin alone, if you can abide by 
having to carry cygwin1.dll around - I cannot. Next best is MSys, and 
the worst is Cygwin with -mno-cygwin, supported by very few apps. On the 
positive side, I have kept MSys and Cygwin side-by-side for years and 
never had any name clashes. If you want two variants of the same app, 
e.g. a Cygwin ocaml (for debugging, which does not work in the MinGW 
variant) and an MSys + MinGW ocaml (for release builds without a need 
for cygwin1.dll), AND you want the same home directory for both systems, 
THEN you need to make sure your .profile or .bashrc 'sed-its' the path 
to point to the correct app depending on the system being fired up; I 
did it and never ran into name clashes or anything similar.

I don't think the MinGW-over-Cygwin variant must actually be dropped, 
since a pure MSys + MinGW version would be relatively easy to maintain 
alongside it. As an illustration, pretty much all I ever needed to do is 
comment out a code snippet in ccomp.ml (to prevent a responsefile from 
being even used, see below) and then build ocaml on MSys according to 
the same procedure one would use for MinGW over Cygwin. With v3.10 this 
works like a charm (some much earlier versions required extra setup 
because the camlp4 Win32 build used to be slightly aberrant).

====================================

MSys howto:  edit utils\ccomp.ml by commenting-out the following code:

let quote_files lst =
  let s =
    String.concat " "
      (List.map (fun f -> if f = "" then f else Filename.quote f) lst) in
  (*if Sys.os_type = "Win32" && String.length s >= 256
  then build_diversion lst
  else*) s

Copy config\Makefile.mingw to config\Makefile and edit it to set your 
preferences (e.g. I always disable shared libs - maybe they wouldn't 
work with this method at all, I don't know). Copy config\m-nt.h to 
config\m.h and config\s-nt.h to config\s.h. I also usually copy the main 
Makefile.nt onto Makefile, such that I don't have to remember to type -f 
Makefile.nt on the make command line. Works without a hitch.


[-- Attachment #2: Type: text/html, Size: 3848 bytes --]

^ permalink raw reply	[flat|nested] 16+ messages in thread

* Re : Re: [Caml-list] Re: MinGW port w/o Cygwin?
  2007-12-23 15:20       ` "Márk S. Zoltán"
@ 2007-12-23 16:33         ` Adrien
  2007-12-24 12:50           ` Dmitry Bely
  2007-12-26 17:54           ` Kuba Ober
  2007-12-24 10:40         ` Richard Jones
  1 sibling, 2 replies; 16+ messages in thread
From: Adrien @ 2007-12-23 16:33 UTC (permalink / raw)
  To: "Márk S. Zoltán"; +Cc: Caml Mailing List

2007/12/20, Kuba Ober <ober.14@osu.edu>:
> I guess that Ocaml maintainers should just drop that Cygwin requirement, and
> tweak their build process to work "out of the box" with MSYS/MinGW.

You shouldn't see cygwin as a _requirement_.
Ocaml installation from source (let the binary distributions be a
special case) use C. If there is no c compiler installed as it is
under all windows installations (I mean right after setup is
completed) ocaml simply can't be installed ; the problem is not with
ocaml or cygwin but with windows. Cygwin is not a fancy requirement
just one of the few ways to get a c compiler under windows.

Also mingw without cygwin still lacks a lot of things. Capabilities
are there but it seems header files have not been updated in ages and
linker flags need to be different (you will often need -lws2_32 for
many C apps especially).
It is possible to "activate" a *lot* of ocaml features, as seen in
config/s.h, (did that for pthreads among others) by expanding mingw
header files and adding a few linker flags.
Anyway, the result is a big headache for the developper. I perfectly
understand the ocaml team is not willing to make a complete mingw/msys
port ; it's such a mess.


2007/12/23, "Márk S. Zoltán" <zoltan.s.mark@dravanet.hu>:
> I don't think the MinGW-over-Cygwin variant must actually be dropped,
> since a pure MSys + MinGW version would be relatively easy to maintain
> alongside it.
So there would be msvc, cygwin, cygwin/mingw, msys/mingw with
different configuration files for each. While such a port would be
easy to create it wouldn't be wise to create it imho ; it wouldn't
help maintaining and would create bugs along with more work for the
ocaml team.
Just look at the x86-32/x86-64 arch reunification of the linux kernel
(1) for a similar story.
  http://lwn.net/Articles/243704/

And then one could add a SFU port (Services For Unix) which lets you
compile ocaml without problem except that it works so well ocaml
thinks it is running under unix and uses forward-slashes as path
separators. (everything that ./configure can enable is enabled)

(* For the story, as recently as yesterday, I wanted to rsync a
slackware-current repository but had lost one of the few proper
non-cygwin rsync windows port so I downloaded the source and tried to
compile with mingw just to remember last time I tried I spent two
hours. I then used sfu, cd'ed in the source directory, ./configure,
make, strip and within 90 seconds my rsync build was ready to
download. SFU is free though not free as in free speech, but when
you've spent hours on msys/mingw, you can accept anything and be
really happy with it. *)


> As an illustration, pretty much all I ever needed to do is
> comment out a code snippet in ccomp.ml (to prevent a responsefile from
> being even used, see below) and then build ocaml on MSys according to
> the same procedure one would use for MinGW over Cygwin. With v3.10 this
> works like a charm.

The 256 characters limit is now 4096 in ocaml 3.11 so you don't even
need to edit it. But don't think it means inria is readying an
msys/mingw port, this was just a side effect and another problems
appeared, though it is as trivial to fix.


 ---

Adrien Nader


^ permalink raw reply	[flat|nested] 16+ messages in thread

* Re: Re: [Caml-list] Re: MinGW port w/o Cygwin?
  2007-12-23 15:20       ` "Márk S. Zoltán"
  2007-12-23 16:33         ` Re : " Adrien
@ 2007-12-24 10:40         ` Richard Jones
  2007-12-26 18:01           ` Kuba Ober
  1 sibling, 1 reply; 16+ messages in thread
From: Richard Jones @ 2007-12-24 10:40 UTC (permalink / raw)
  To: Márk S. Zoltán; +Cc: Caml Mailing List

On Sun, Dec 23, 2007 at 04:20:01PM +0100, "Márk S. Zoltán" wrote:
> I am using my clandestine MSys + MinGW OCaml since about 3.0, and I have 
> originally switched to MSys because the configuration scripts of a 
> number of other apps and libraries did not handle the -mno-cygwin flag, 
> or any other flag for that matter: the 'supply extra compiler flags' 
> feature seemed to be thoroughly broken in all configure scripts, I 
> wonder if anyone ever uses it.

The problem is that configure.ac authors have to follow a series of
arcane conventions to make sure they don't delete the user-specified
CFLAGS.  Since they don't, and there's no indication to the author
that they have, it is often broken.  But then the auto* tools are just
terrible like this.

Rich.

-- 
Richard Jones
Red Hat


^ permalink raw reply	[flat|nested] 16+ messages in thread

* Re: Re : Re: [Caml-list] Re: MinGW port w/o Cygwin?
  2007-12-23 16:33         ` Re : " Adrien
@ 2007-12-24 12:50           ` Dmitry Bely
  2007-12-26 17:59             ` Kuba Ober
  2007-12-26 17:54           ` Kuba Ober
  1 sibling, 1 reply; 16+ messages in thread
From: Dmitry Bely @ 2007-12-24 12:50 UTC (permalink / raw)
  To: Caml Mailing List

On Dec 23, 2007 7:33 PM, Adrien <camaradetux@gmail.com> wrote:

> > I guess that Ocaml maintainers should just drop that Cygwin requirement, and
> > tweak their build process to work "out of the box" with MSYS/MinGW.
>
> You shouldn't see cygwin as a _requirement_.
> Ocaml installation from source (let the binary distributions be a
> special case) use C. If there is no c compiler installed as it is
> under all windows installations (I mean right after setup is
> completed) ocaml simply can't be installed ; the problem is not with
> ocaml or cygwin but with windows. Cygwin is not a fancy requirement
> just one of the few ways to get a c compiler under windows.

Not only compiler; Ocaml build process actively uses various Unix
utilities that Cygwin provides: make, sh, sed, etc. I see no reason to
have another set of there utilities in addition to Cygwin's one.

- Dmitry Bely


^ permalink raw reply	[flat|nested] 16+ messages in thread

* Re: [Caml-list] Re: MinGW port w/o Cygwin?
  2007-12-21 14:06     ` Dmitry Bely
  2007-12-23 15:20       ` "Márk S. Zoltán"
@ 2007-12-26 17:45       ` Kuba Ober
  2007-12-26 22:48         ` Dmitry Bely
  1 sibling, 1 reply; 16+ messages in thread
From: Kuba Ober @ 2007-12-26 17:45 UTC (permalink / raw)
  To: caml-list

On Friday 21 December 2007, Dmitry Bely wrote:
> On Dec 20, 2007 11:18 PM, Kuba Ober <ober.14@osu.edu> wrote:
> > Tried it and sure enough - it works!!! (On an XP machine that never saw
> > Cygwin either).
> >
> > That's *extremely* good news to me.
> >
> > I guess that Ocaml maintainers should just drop that Cygwin requirement,
> > and tweak their build process to work "out of the box" with MSYS/MinGW.
>
> If MSYS become mandatory I strongly disagree. Cygwin is a common
> requirement for building any Ocaml distribution on Windows (even if
> you use Microsoft Visual Studio). I see absolutely no problem to
> install and use it. Why I should bother to install another Cygwin fork
> (MSYS) and handle name clashes etc.?

Cygwin and MSYS are very different. Calling one another's fork is like saying 
that Linux and FreeBSD are both UNIX forks.

Cygwin is a make-believe unix environment on WIndows. It's a big hack.

MSYS is just a bunch of Unix tools ported to run *natively* on Windows.

Cygwin is a common requirement because it makes things simpler on the surface. 
When in fact, it makes everything much worse off.

Cheers, Kuba


^ permalink raw reply	[flat|nested] 16+ messages in thread

* Re: Re : Re: [Caml-list] Re: MinGW port w/o Cygwin?
  2007-12-23 16:33         ` Re : " Adrien
  2007-12-24 12:50           ` Dmitry Bely
@ 2007-12-26 17:54           ` Kuba Ober
  2008-01-06 15:14             ` Re : " Adrien
  1 sibling, 1 reply; 16+ messages in thread
From: Kuba Ober @ 2007-12-26 17:54 UTC (permalink / raw)
  To: caml-list

On Sunday 23 December 2007, Adrien wrote:
> 2007/12/20, Kuba Ober <ober.14@osu.edu>:
> > I guess that Ocaml maintainers should just drop that Cygwin requirement,
> > and tweak their build process to work "out of the box" with MSYS/MinGW.
>
> You shouldn't see cygwin as a _requirement_.
> Ocaml installation from source (let the binary distributions be a
> special case) use C. If there is no c compiler installed as it is
> under all windows installations (I mean right after setup is
> completed) ocaml simply can't be installed ; the problem is not with
> ocaml or cygwin but with windows. Cygwin is not a fancy requirement
> just one of the few ways to get a c compiler under windows.
>
> Also mingw without cygwin still lacks a lot of things. Capabilities
> are there but it seems header files have not been updated in ages and
> linker flags need to be different (you will often need -lws2_32 for
> many C apps especially).

THe right way is to update mingw headers, submit to the maintainers, and go 
from there. That's the OSS way.

> Anyway, the result is a big headache for the developper. I perfectly
> understand the ocaml team is not willing to make a complete mingw/msys
> port ; it's such a mess.

It's the only sane way to go. THere's no technical reason to require a unix 
environment to build ocaml. Big applications build on Windows just fine...

> So there would be msvc, cygwin, cygwin/mingw, msys/mingw with
> different configuration files for each. While such a port would be
> easy to create it wouldn't be wise to create it imho ; it wouldn't
> help maintaining and would create bugs along with more work for the
> ocaml team.

Supporting Cygwin at all is a waste IMHO. Either you run Unix or Windows, 
choose one and stick with it...

> And then one could add a SFU port (Services For Unix) which lets you
> compile ocaml without problem except that it works so well ocaml
> thinks it is running under unix and uses forward-slashes as path
> separators. (everything that ./configure can enable is enabled)

IIRC Windows accepts forward slashes everywhere just fine.

> compile with mingw just to remember last time I tried I spent two
> hours. I then used sfu, cd'ed in the source directory, ./configure,
> make, strip and within 90 seconds my rsync build was ready to
> download. SFU is free though not free as in free speech, but when
> you've spent hours on msys/mingw, you can accept anything and be
> really happy with it. *)

Well, all it means is that Ocaml wasn't designed to build on Windows, that's 
it. MSYS provides what reasonably can be provided without a Unix emulation 
layer. THe fact that Oaml uses a Unix-centric build system and whatnot makes 
things the way they are. The windows build could dispense with configure and 
whatnot.

Cheers, Kuba


^ permalink raw reply	[flat|nested] 16+ messages in thread

* Re: Re : Re: [Caml-list] Re: MinGW port w/o Cygwin?
  2007-12-24 12:50           ` Dmitry Bely
@ 2007-12-26 17:59             ` Kuba Ober
  0 siblings, 0 replies; 16+ messages in thread
From: Kuba Ober @ 2007-12-26 17:59 UTC (permalink / raw)
  To: caml-list

On Monday 24 December 2007, Dmitry Bely wrote:
> On Dec 23, 2007 7:33 PM, Adrien <camaradetux@gmail.com> wrote:
> > > I guess that Ocaml maintainers should just drop that Cygwin
> > > requirement, and tweak their build process to work "out of the box"
> > > with MSYS/MinGW.
> >
> > You shouldn't see cygwin as a _requirement_.
> > Ocaml installation from source (let the binary distributions be a
> > special case) use C. If there is no c compiler installed as it is
> > under all windows installations (I mean right after setup is
> > completed) ocaml simply can't be installed ; the problem is not with
> > ocaml or cygwin but with windows. Cygwin is not a fancy requirement
> > just one of the few ways to get a c compiler under windows.
>
> Not only compiler; Ocaml build process actively uses various Unix
> utilities that Cygwin provides: make, sh, sed, etc. I see no reason to
> have another set of there utilities in addition to Cygwin's one.

Because this really mixes things up. The Ocaml build environment becomes very 
different from Ocaml execution environment. To a point where if, say, Ocaml's 
build process would use Ocaml at a late point in the process, you'd need two 
Ocaml builds: one native, one cygwin-based. The native one wouldn't dig any 
cygwin paths for example, yet would be what you want to use if you were to 
distribute Ocaml with your commercial application, for example.

Basically, at this point Ocaml is very Windows-unfriendly because of this 
attitude. For a good example of how it shuld work/look, see Trolltech's Qt, 
whose build process works just fine on Windows without bringing in Cygwin or 
even MSYS. It runs using various VC versions, as well as Mingw.

Cheers, Kuba


^ permalink raw reply	[flat|nested] 16+ messages in thread

* Re: [Caml-list] Re: MinGW port w/o Cygwin?
  2007-12-24 10:40         ` Richard Jones
@ 2007-12-26 18:01           ` Kuba Ober
  0 siblings, 0 replies; 16+ messages in thread
From: Kuba Ober @ 2007-12-26 18:01 UTC (permalink / raw)
  To: caml-list

On Monday 24 December 2007, Richard Jones wrote:
> On Sun, Dec 23, 2007 at 04:20:01PM +0100, "Márk S. Zoltán" wrote:
> > I am using my clandestine MSys + MinGW OCaml since about 3.0, and I have
> > originally switched to MSys because the configuration scripts of a
> > number of other apps and libraries did not handle the -mno-cygwin flag,
> > or any other flag for that matter: the 'supply extra compiler flags'
> > feature seemed to be thoroughly broken in all configure scripts, I
> > wonder if anyone ever uses it.
>
> The problem is that configure.ac authors have to follow a series of
> arcane conventions to make sure they don't delete the user-specified
> CFLAGS.  Since they don't, and there's no indication to the author
> that they have, it is often broken.  But then the auto* tools are just
> terrible like this.

Using autotools for a windows build is insane. Just don't. Code the makefile 
by hand, it'll be much simpler. Or generate one on Unix when the tarball is 
being prepared.

Cheers, Kuba


^ permalink raw reply	[flat|nested] 16+ messages in thread

* Re: [Caml-list] Re: MinGW port w/o Cygwin?
  2007-12-26 17:45       ` Kuba Ober
@ 2007-12-26 22:48         ` Dmitry Bely
  2007-12-27 12:41           ` Kuba Ober
  0 siblings, 1 reply; 16+ messages in thread
From: Dmitry Bely @ 2007-12-26 22:48 UTC (permalink / raw)
  To: ocaml

On Dec 26, 2007 8:45 PM, Kuba Ober <ober.14@osu.edu> wrote:
>
> > If MSYS become mandatory I strongly disagree. Cygwin is a common
> > requirement for building any Ocaml distribution on Windows (even if
> > you use Microsoft Visual Studio). I see absolutely no problem to
> > install and use it. Why I should bother to install another Cygwin fork
> > (MSYS) and handle name clashes etc.?
>
> Cygwin and MSYS are very different. Calling one another's fork is like saying
> that Linux and FreeBSD are both UNIX forks.

It looks like an offtopic here but still:

http://www.mingw.org/MinGWiki/index.php/MSYS
"The POSIX layer used by MSYS is a fork of the 1.3.3 version of Cygwin."

In fact they just forked cygwin1.dll and stripped it down.

- Dmitry Bely


^ permalink raw reply	[flat|nested] 16+ messages in thread

* Re: [Caml-list] Re: MinGW port w/o Cygwin?
  2007-12-26 22:48         ` Dmitry Bely
@ 2007-12-27 12:41           ` Kuba Ober
  0 siblings, 0 replies; 16+ messages in thread
From: Kuba Ober @ 2007-12-27 12:41 UTC (permalink / raw)
  To: caml-list

On Wednesday 26 December 2007, Dmitry Bely wrote:
> On Dec 26, 2007 8:45 PM, Kuba Ober <ober.14@osu.edu> wrote:
> > > If MSYS become mandatory I strongly disagree. Cygwin is a common
> > > requirement for building any Ocaml distribution on Windows (even if
> > > you use Microsoft Visual Studio). I see absolutely no problem to
> > > install and use it. Why I should bother to install another Cygwin fork
> > > (MSYS) and handle name clashes etc.?
> >
> > Cygwin and MSYS are very different. Calling one another's fork is like
> > saying that Linux and FreeBSD are both UNIX forks.
>
> It looks like an offtopic here but still:
>
> http://www.mingw.org/MinGWiki/index.php/MSYS
> "The POSIX layer used by MSYS is a fork of the 1.3.3 version of Cygwin."
>
> In fact they just forked cygwin1.dll and stripped it down.

Hmm, interesting, I didn't know that. Yet I'd still imagine that the POSIX 
layer in MSYS is targeted toward the build tools themselves, not "other" 
software.

Cheers, Kuba


^ permalink raw reply	[flat|nested] 16+ messages in thread

* Re : Re : Re: [Caml-list] Re: MinGW port w/o Cygwin?
  2007-12-26 17:54           ` Kuba Ober
@ 2008-01-06 15:14             ` Adrien
  2008-01-08 14:25               ` Kuba Ober
  0 siblings, 1 reply; 16+ messages in thread
From: Adrien @ 2008-01-06 15:14 UTC (permalink / raw)
  To: Kuba Ober; +Cc: caml-list

2007/12/26, Kuba Ober <ober.14@osu.edu>:
> On Sunday 23 December 2007, Adrien wrote:
> > 2007/12/20, Kuba Ober <ober.14@osu.edu>:
> > > I guess that Ocaml maintainers should just drop that Cygwin requirement,
> > > and tweak their build process to work "out of the box" with MSYS/MinGW.
> >
> > You shouldn't see cygwin as a _requirement_.
> > Ocaml installation from source (let the binary distributions be a
> > special case) use C. If there is no c compiler installed as it is
> > under all windows installations (I mean right after setup is
> > completed) ocaml simply can't be installed ; the problem is not with
> > ocaml or cygwin but with windows. Cygwin is not a fancy requirement
> > just one of the few ways to get a c compiler under windows.
> >
> > Also mingw without cygwin still lacks a lot of things. Capabilities
> > are there but it seems header files have not been updated in ages and
> > linker flags need to be different (you will often need -lws2_32 for
> > many C apps especially).
>
> THe right way is to update mingw headers, submit to the maintainers, and go
> from there. That's the OSS way.

I know, I only lack of time to do this properly and I've been
astonished to see some headers were older than Internet Explorer 5.5
(or even 5) !
It seemed to be the dev just didn't feel like updating the headers so
it would take me some time to convince them with a nice and polished
patch.


> > Anyway, the result is a big headache for the developper. I perfectly
> > understand the ocaml team is not willing to make a complete mingw/msys
> > port ; it's such a mess.
>
> It's the only sane way to go. THere's no technical reason to require a unix
> environment to build ocaml. Big applications build on Windows just fine...

Ocaml doesn't rely on an unix environment. It makes use of it when
available though. How could you run a configure script on windows
without msys|mingw|cygwin ? [btw the result is incorrect on msys/mingw
so don't use] The only solutions are else proprietary non-microsoft
shells running only under windows with specific scripting languages or
a proprietary microsoft shell running only under windows with a
specific scripting language.

If you consider python (or perl iirc, or even tcl/tk), the same rule
apply and compiling from source under windows is not advised. OCaml on
the other hand 1-works and 2-works even on unsupported toolchains. I
too would love something better but I think we can't really complain.

> > So there would be msvc, cygwin, cygwin/mingw, msys/mingw with
> > different configuration files for each. While such a port would be
> > easy to create it wouldn't be wise to create it imho ; it wouldn't
> > help maintaining and would create bugs along with more work for the
> > ocaml team.
> Supporting Cygwin at all is a waste IMHO. Either you run Unix or Windows,
> choose one and stick with it...
>

Cygwin works and is commercially supported. Porting efforts are also
less important than for msys ; I would say porting from unix to cygwin
is easier than porting from cygwin to windows.


> > And then one could add a SFU port (Services For Unix) which lets you
> > compile ocaml without problem except that it works so well ocaml
> > thinks it is running under unix and uses forward-slashes as path
> > separators. (everything that ./configure can enable is enabled)
>
> IIRC Windows accepts forward slashes everywhere just fine.

I just checked and that's true. The problem was maybe with "/c/"
(mingw) or "/dev/fs/C:/" (sfu) instead of windows's "c:". I'll have to
check.


> > compile with mingw just to remember last time I tried I spent two
> > hours. I then used sfu, cd'ed in the source directory, ./configure,
> > make, strip and within 90 seconds my rsync build was ready to
> > download. SFU is free though not free as in free speech, but when
> > you've spent hours on msys/mingw, you can accept anything and be
> > really happy with it. *)
>
> Well, all it means is that Ocaml wasn't designed to build on Windows, that's
> it. MSYS provides what reasonably can be provided without a Unix emulation
> layer. THe fact that Oaml uses a Unix-centric build system and whatnot makes
> things the way they are. The windows build could dispense with configure and
> whatnot.

MSYS is far from providing anything sufficient. SFU is not an
emulation layer either : in my rsync example, I then ran my executable
outside of sfu. I think the executables are native to windows. As I've
said, msys has incredibly outdated headers : in one header, it defined
internet explorer version as 3... (hint, if you need a header for
msys, use those from wine). That's where the problem lies.
I've already worked on updated headers and compiler flags for cygwin.
You can get pthreads, dirent and tons of other things just by updating
a few text files. MSYS won't be a proper platform if this is not done
and wine has already done half the work.

About the windows build, it is already avoiding configure scripts but
then the options are determined by the lowest common factor because
since most of the required tools are not provided by windows (cc,
headers), you can't be sure about what is available. But then the
ocaml Makefile.nt files are already doing this.
Related is question 10 on this page :
http://www.interopsystems.com/SurveyResults.htm (yes, nearly 87%)


 ---
Adrien Nader


^ permalink raw reply	[flat|nested] 16+ messages in thread

* Re: Re : Re : Re: [Caml-list] Re: MinGW port w/o Cygwin?
  2008-01-06 15:14             ` Re : " Adrien
@ 2008-01-08 14:25               ` Kuba Ober
  0 siblings, 0 replies; 16+ messages in thread
From: Kuba Ober @ 2008-01-08 14:25 UTC (permalink / raw)
  To: caml-list

On Sunday 06 January 2008, you wrote:
> 2007/12/26, Kuba Ober <ober.14@osu.edu>:
> > On Sunday 23 December 2007, Adrien wrote:
> > > 2007/12/20, Kuba Ober <ober.14@osu.edu>:
> > > > I guess that Ocaml maintainers should just drop that Cygwin
> > > > requirement, and tweak their build process to work "out of the box"
> > > > with MSYS/MinGW.
> > >
> > > You shouldn't see cygwin as a _requirement_.
> > > Ocaml installation from source (let the binary distributions be a
> > > special case) use C. If there is no c compiler installed as it is
> > > under all windows installations (I mean right after setup is
> > > completed) ocaml simply can't be installed ; the problem is not with
> > > ocaml or cygwin but with windows. Cygwin is not a fancy requirement
> > > just one of the few ways to get a c compiler under windows.
> > >
> > > Also mingw without cygwin still lacks a lot of things. Capabilities
> > > are there but it seems header files have not been updated in ages and
> > > linker flags need to be different (you will often need -lws2_32 for
> > > many C apps especially).
> >
> > THe right way is to update mingw headers, submit to the maintainers, and
> > go from there. That's the OSS way.
>
> I know, I only lack of time to do this properly and I've been
> astonished to see some headers were older than Internet Explorer 5.5
> (or even 5) !
> It seemed to be the dev just didn't feel like updating the headers so
> it would take me some time to convince them with a nice and polished
> patch.
>
> > > Anyway, the result is a big headache for the developper. I perfectly
> > > understand the ocaml team is not willing to make a complete mingw/msys
> > > port ; it's such a mess.
> >
> > It's the only sane way to go. THere's no technical reason to require a
> > unix environment to build ocaml. Big applications build on Windows just
> > fine...
>
> Ocaml doesn't rely on an unix environment. It makes use of it when
> available though. How could you run a configure script on windows
> without msys|mingw|cygwin ?

You write it in something other than shell. Say in C++ or OCaml. Qt does just 
fine with configure written in C++/Qt. They even have a graphical front-end 
to it.

> The only solutions are else proprietary non-microsoft
> shells 

Nope. See above.

> About the windows build, it is already avoiding configure scripts but
> then the options are determined by the lowest common factor because
> since most of the required tools are not provided by windows (cc,
> headers), you can't be sure about what is available. But then the
> ocaml Makefile.nt files are already doing this.

Trolltech has approached that problem reasonably well. They provide a 
precompiled (executable) configure mechanism, and a few handmade makefiles to 
build their makefile-generator under the supported development environments 
(3 versions of Visual C++, Mingw gcc). After the makefile generator is built, 
it creates native makefiles which work either in Microsoft's nmake, or under 
Mingw/MSYS gnu make.

Cheers, Kuba


^ permalink raw reply	[flat|nested] 16+ messages in thread

end of thread, other threads:[~2008-01-08 14:26 UTC | newest]

Thread overview: 16+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2007-12-20 14:30 MinGW port w/o Cygwin? Kuba Ober
2007-12-20 15:23 ` Zheng Li
2007-12-20 20:18   ` [Caml-list] " Kuba Ober
2007-12-21 14:06     ` Dmitry Bely
2007-12-23 15:20       ` "Márk S. Zoltán"
2007-12-23 16:33         ` Re : " Adrien
2007-12-24 12:50           ` Dmitry Bely
2007-12-26 17:59             ` Kuba Ober
2007-12-26 17:54           ` Kuba Ober
2008-01-06 15:14             ` Re : " Adrien
2008-01-08 14:25               ` Kuba Ober
2007-12-24 10:40         ` Richard Jones
2007-12-26 18:01           ` Kuba Ober
2007-12-26 17:45       ` Kuba Ober
2007-12-26 22:48         ` Dmitry Bely
2007-12-27 12:41           ` Kuba Ober

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).