caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
* Re: [Caml-list] cygwin/mingw linking
@ 2001-09-16 16:05 CaptnJamesKirk
  2001-09-16 18:03 ` RE : " Lionel Fourquaux
  0 siblings, 1 reply; 8+ messages in thread
From: CaptnJamesKirk @ 2001-09-16 16:05 UTC (permalink / raw)
  To: caml-list

In a message dated 9/14/2001 6:41:57 PM Central Daylight Time, 
CaptnJamesKirk@aol.com writes:

> Hi everyone,
>  
>  I've got OCaml 3.02 succesfully installed, compiled, and working under 
>  Windows ME using the latest cygwin. I would like to be able to link my 
>  programs using mingw so the executable doesn't need cygwin1.dll. The docs 
>  mention using the -output-obj option to create an *.o object file that can 
>  be linked, but the manual talks about wrapping this with a C program, 
etc., 
>  which is not what I want. I just want to manually link the object file(s) 
>  with whichever libraries are needed, using a separate mingw installation. 
> Can I do this?
>  
>  /John

Doesn't look like it's possible now. Here's what I tried. I compiled 
"hello_world.ml" with the "-output-obj" option to produce "camlprog.o". Next, 
still under cygwin, I tried "gcc -o hello_world camlprog.o -lgdi32 
-L/usr/lib/ocaml -lasmrun" and it worked! So, I could manually link a 
complete ocmal program without wrapping with a C program. Next, I exited from 
cygwin and opened up my dos-box for mingw (which doesn't have the cygwin bin 
directory in it's path, so there's no conflict). I used the "camlprog.o" 
which was created under cygwin and directed the linker to the ocaml libs. 
Unfortunately, the linker now complains with, among other things, 

/cygwin/lib/ocaml/libasmrun.a(signals.o)(.text+0x17):signals.c: undefined 
reference to `sigemptyset'

If I'm not mistaken, these are references to some of the more "unix-like" 
functions that cygwin provides and mingw doesn't so it can avoid using the 
cygwin1.dll. So it looks like even a simple "hello world" program need things 
from the ocaml libs that call the cygwin1.dll.

This is unfortunate. I think support for mingw would be a big plus for ocaml. 
Not only is mingw easier to install and use under Windows than cygwin, it 
doesn't require the pesky cygwin1.dll.

/John

-------------------
Bug reports: http://caml.inria.fr/bin/caml-bugs  FAQ: http://caml.inria.fr/FAQ/
To unsubscribe, mail caml-list-request@inria.fr  Archives: http://caml.inria.fr


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

* RE : [Caml-list] cygwin/mingw linking
  2001-09-16 16:05 [Caml-list] cygwin/mingw linking CaptnJamesKirk
@ 2001-09-16 18:03 ` Lionel Fourquaux
  2001-09-17  8:40   ` Dmitry Bely
  0 siblings, 1 reply; 8+ messages in thread
From: Lionel Fourquaux @ 2001-09-16 18:03 UTC (permalink / raw)
  To: CaptnJamesKirk, caml-list

I think that you should use the win32 version of ocaml instead if the
cygwin one. You may want to rebuild it to use the mingw tools. It's not
entirely trivial, but it has already been done. The Unix lib causes some
problems, though.


> -----Original Message-----
> From: owner-caml-list@pauillac.inria.fr [mailto:owner-caml-
> list@pauillac.inria.fr] On Behalf Of CaptnJamesKirk@aol.com
> Sent: Sunday, September 16, 2001 6:05 PM
> To: caml-list@pauillac.inria.fr
> Subject: Re: [Caml-list] cygwin/mingw linking
>
> In a message dated 9/14/2001 6:41:57 PM Central Daylight Time,
> CaptnJamesKirk@aol.com writes:
>
> > Hi everyone,
> >
> >  I've got OCaml 3.02 succesfully installed, compiled, and working
under
> >  Windows ME using the latest cygwin. I would like to be able to link
my
> >  programs using mingw so the executable doesn't need cygwin1.dll.
The
> docs
> >  mention using the -output-obj option to create an *.o object file
that
> can
> >  be linked, but the manual talks about wrapping this with a C
program,
> etc.,
> >  which is not what I want. I just want to manually link the object
> file(s)
> >  with whichever libraries are needed, using a separate mingw
> installation.
> > Can I do this?
> >
> >  /John
>
> Doesn't look like it's possible now. Here's what I tried. I compiled
> "hello_world.ml" with the "-output-obj" option to produce
"camlprog.o".
> Next,
> still under cygwin, I tried "gcc -o hello_world camlprog.o -lgdi32
> -L/usr/lib/ocaml -lasmrun" and it worked! So, I could manually link a
> complete ocmal program without wrapping with a C program. Next, I
exited
> from
> cygwin and opened up my dos-box for mingw (which doesn't have the
cygwin
> bin
> directory in it's path, so there's no conflict). I used the
"camlprog.o"
> which was created under cygwin and directed the linker to the ocaml
libs.
> Unfortunately, the linker now complains with, among other things,
>
> /cygwin/lib/ocaml/libasmrun.a(signals.o)(.text+0x17):signals.c:
undefined
> reference to `sigemptyset'
>
> If I'm not mistaken, these are references to some of the more
"unix-like"
> functions that cygwin provides and mingw doesn't so it can avoid using
the
> cygwin1.dll. So it looks like even a simple "hello world" program need
> things
> from the ocaml libs that call the cygwin1.dll.
>
> This is unfortunate. I think support for mingw would be a big plus for
> ocaml.
> Not only is mingw easier to install and use under Windows than cygwin,
it
> doesn't require the pesky cygwin1.dll.
>
> /John
>
> -------------------
> Bug reports: http://caml.inria.fr/bin/caml-bugs  FAQ:
> http://caml.inria.fr/FAQ/
> To unsubscribe, mail caml-list-request@inria.fr  Archives:
> http://caml.inria.fr


-------------------
Bug reports: http://caml.inria.fr/bin/caml-bugs  FAQ: http://caml.inria.fr/FAQ/
To unsubscribe, mail caml-list-request@inria.fr  Archives: http://caml.inria.fr


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

* Re: RE : [Caml-list] cygwin/mingw linking
  2001-09-16 18:03 ` RE : " Lionel Fourquaux
@ 2001-09-17  8:40   ` Dmitry Bely
  2001-09-17 10:02     ` RE : " Lionel Fourquaux
  0 siblings, 1 reply; 8+ messages in thread
From: Dmitry Bely @ 2001-09-17  8:40 UTC (permalink / raw)
  To: caml-list

"Lionel Fourquaux" <lionel.fourquaux@wanadoo.fr> writes:

> I think that you should use the win32 version of ocaml instead if the
> cygwin one. You may want to rebuild it to use the mingw tools. It's not
> entirely trivial, but it has already been done. The Unix lib causes some
> problems, though.

No problem - it's already adapted for MSVC and can be directly compiled
with mingw because mingw uses just the same clib (msvcrt.dll). What should
be done to compile OCaml with mingw:

1. Manually create proper config/Makefile config/m.h config/s.h (configure
script won't work for mingw).
2. Update many makefiles to sync them with MSVC port (add necessary
conditionals etc.)
3. win32unix library uses undocumented _dospamerr() function that is
available only in the static MSVC runtime. You should exctract it from
Microsoft RTL sources.
4. gcc does not understand  __declspec( thread ), so you need somethere

#ifdef __GNUC__
#define TLS __attribute__((section (".tls$")))
#else
#define TLS __declspec( thread )
#endif

5. something else, that I've forgotten to mention...

Hope to hear from you soon,
Dmitry


-------------------
Bug reports: http://caml.inria.fr/bin/caml-bugs  FAQ: http://caml.inria.fr/FAQ/
To unsubscribe, mail caml-list-request@inria.fr  Archives: http://caml.inria.fr


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

* RE : RE : [Caml-list] cygwin/mingw linking
  2001-09-17  8:40   ` Dmitry Bely
@ 2001-09-17 10:02     ` Lionel Fourquaux
  2001-09-17 10:35       ` Einar Karttunen
                         ` (2 more replies)
  0 siblings, 3 replies; 8+ messages in thread
From: Lionel Fourquaux @ 2001-09-17 10:02 UTC (permalink / raw)
  To: 'Dmitry Bely', caml-list



> -----Original Message-----
> From: owner-caml-list@pauillac.inria.fr [mailto:owner-caml-
> list@pauillac.inria.fr] On Behalf Of Dmitry Bely
> Sent: Monday, September 17, 2001 10:41 AM
> To: caml-list@inria.fr
> Subject: Re: RE : [Caml-list] cygwin/mingw linking
>
> 3. win32unix library uses undocumented _dospamerr() function that is
> available only in the static MSVC runtime. You should exctract it from
> Microsoft RTL sources.

	That's what I was thinking about. There are two problems with
this:
 * You need msvc to get this file (DOSMAP.C).
 * It has already been pointed out in this list that there can be some
licence problems.





-------------------
Bug reports: http://caml.inria.fr/bin/caml-bugs  FAQ: http://caml.inria.fr/FAQ/
To unsubscribe, mail caml-list-request@inria.fr  Archives: http://caml.inria.fr


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

* Re: [Caml-list] cygwin/mingw linking
  2001-09-17 10:02     ` RE : " Lionel Fourquaux
@ 2001-09-17 10:35       ` Einar Karttunen
  2001-09-17 13:47       ` RE : RE : " Art Yerkes
  2001-09-18 14:24       ` RE : RE : " Xavier Leroy
  2 siblings, 0 replies; 8+ messages in thread
From: Einar Karttunen @ 2001-09-17 10:35 UTC (permalink / raw)
  To: Lionel Fourquaux; +Cc: caml-list

On Mon, Sep 17, 2001 at 12:02:16PM +0200, Lionel Fourquaux wrote:
> 
> > 3. win32unix library uses undocumented _dospamerr() function that is
> > available only in the static MSVC runtime. You should exctract it from
> > Microsoft RTL sources.
> 
> 	That's what I was thinking about. There are two problems with
> this:
>  * You need msvc to get this file (DOSMAP.C).
>  * It has already been pointed out in this list that there can be some
> licence problems.
> 
Has anyone tried compiling ocaml with lccwin32 or borland compilers?
I will probably try to get it to compile with lccwin32 in the near
future and would appreciate any experiences trying to compile ocaml
on non-standard platforms.

- Einar Karttunen 

-------------------
Bug reports: http://caml.inria.fr/bin/caml-bugs  FAQ: http://caml.inria.fr/FAQ/
To unsubscribe, mail caml-list-request@inria.fr  Archives: http://caml.inria.fr


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

* Re: RE : RE : [Caml-list] cygwin/mingw linking
  2001-09-17 10:02     ` RE : " Lionel Fourquaux
  2001-09-17 10:35       ` Einar Karttunen
@ 2001-09-17 13:47       ` Art Yerkes
  2001-09-17 15:14         ` Dmitry Bely
  2001-09-18 14:24       ` RE : RE : " Xavier Leroy
  2 siblings, 1 reply; 8+ messages in thread
From: Art Yerkes @ 2001-09-17 13:47 UTC (permalink / raw)
  To: Lionel Fourquaux, 'Dmitry Bely', caml-list

Lionel Fourquaux <lionel.fourquaux@wanadoo.fr> said:

If it is _dosmaperr you are thinking of, this function can be taken from
other GPL code, namely win32.c from cvsnt.

http://cvs.cvsnt.org/cgi-bin/cvsweb/cvsnt/windows-NT/win32.c

> 
> 
> > -----Original Message-----
> > From: owner-caml-list@pauillac.inria.fr [mailto:owner-caml-
> > list@pauillac.inria.fr] On Behalf Of Dmitry Bely
> > Sent: Monday, September 17, 2001 10:41 AM
> > To: caml-list@inria.fr
> > Subject: Re: RE : [Caml-list] cygwin/mingw linking
> >
> > 3. win32unix library uses undocumented _dospamerr() function that is
> > available only in the static MSVC runtime. You should exctract it from
> > Microsoft RTL sources.
> 
> 	That's what I was thinking about. There are two problems with
> this:
>  * You need msvc to get this file (DOSMAP.C).
>  * It has already been pointed out in this list that there can be some
> licence problems.
> 
> 
> 
> 
> 
> -------------------
> Bug reports: http://caml.inria.fr/bin/caml-bugs  FAQ: 
http://caml.inria.fr/FAQ/
> To unsubscribe, mail caml-list-request@inria.fr  Archives: 
http://caml.inria.fr
> 



-- 
HTTP_TRACE( "RTSPSession has died of snarfage.\n" )
-- Anonymous C source file
#define SS_USR      6        /* The user is broken           */
-- Anonymous Header File


-------------------
Bug reports: http://caml.inria.fr/bin/caml-bugs  FAQ: http://caml.inria.fr/FAQ/
To unsubscribe, mail caml-list-request@inria.fr  Archives: http://caml.inria.fr


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

* Re: [Caml-list] cygwin/mingw linking
  2001-09-17 13:47       ` RE : RE : " Art Yerkes
@ 2001-09-17 15:14         ` Dmitry Bely
  0 siblings, 0 replies; 8+ messages in thread
From: Dmitry Bely @ 2001-09-17 15:14 UTC (permalink / raw)
  To: caml-list

"Art Yerkes" <ayerkes@gmvnetwork.com> writes:

> If it is _dosmaperr you are thinking of,

Yes, sorry for the typo.

> this function can be taken from
> other GPL code, namely win32.c from cvsnt.
> 
> http://cvs.cvsnt.org/cgi-bin/cvsweb/cvsnt/windows-NT/win32.c

Unfortunately we need LGPL license here, because _dosmaperr() is a part of OCaml
runtime library. Can this code be distributed under LGPL? 

Hope to hear from you soon,
Dmitry


-------------------
Bug reports: http://caml.inria.fr/bin/caml-bugs  FAQ: http://caml.inria.fr/FAQ/
To unsubscribe, mail caml-list-request@inria.fr  Archives: http://caml.inria.fr


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

* Re: RE : RE : [Caml-list] cygwin/mingw linking
  2001-09-17 10:02     ` RE : " Lionel Fourquaux
  2001-09-17 10:35       ` Einar Karttunen
  2001-09-17 13:47       ` RE : RE : " Art Yerkes
@ 2001-09-18 14:24       ` Xavier Leroy
  2 siblings, 0 replies; 8+ messages in thread
From: Xavier Leroy @ 2001-09-18 14:24 UTC (permalink / raw)
  To: Lionel Fourquaux; +Cc: 'Dmitry Bely', caml-list

> > 3. win32unix library uses undocumented _dospamerr() function that is
> > available only in the static MSVC runtime. You should exctract it from
> > Microsoft RTL sources.

The working sources of OCaml no longer depend on _dosmaperr(), so this
problem will disappear in the next release.

- Xavier Leroy
-------------------
Bug reports: http://caml.inria.fr/bin/caml-bugs  FAQ: http://caml.inria.fr/FAQ/
To unsubscribe, mail caml-list-request@inria.fr  Archives: http://caml.inria.fr


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

end of thread, other threads:[~2001-09-18 14:24 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2001-09-16 16:05 [Caml-list] cygwin/mingw linking CaptnJamesKirk
2001-09-16 18:03 ` RE : " Lionel Fourquaux
2001-09-17  8:40   ` Dmitry Bely
2001-09-17 10:02     ` RE : " Lionel Fourquaux
2001-09-17 10:35       ` Einar Karttunen
2001-09-17 13:47       ` RE : RE : " Art Yerkes
2001-09-17 15:14         ` Dmitry Bely
2001-09-18 14:24       ` RE : RE : " Xavier Leroy

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).