bitstring on mingw

12 views
Skip to first unread message

Matthieu Dubuget

unread,
Mar 30, 2009, 11:13:54 AM3/30/09
to bits...@googlegroups.com
Hello,

I'm trying to get bitstring compiled on mingw. Did anybody try this?

It seems to be ok (with some adjustments), but it isn't: the problem
seems to be that
the pre-processor does not work.

The two first tests are ok. The third ones fails with this:

File "tests/a10_match_bits.ml", line 31, characters 5-6:
Parse error: ":" expected after [patt] (in [patt_field])
File "tests/a10_match_bits.ml", line 1, characters 0-1:
Error: Preprocessor error

(I renamed the test file to avoid:

Warning X: bad source file name: "10_match_bits" is not a valid module
name.)


Here is how I did:

svn co http://bitstring.googlecode.com/svn/trunk bitstring-svn
cd bitstring-svn
patch -p1 < dynlink-bitstring.patch
./bootstrap
./configure

ADJUSTMENTS:

SUPPRESSED ^M at the end of OCAMLLIB

MODIFIED CFLAGS:
-CFLAGS = -g -O2 -Wall -Werror -fPIC -I$(top_srcdir) -I$(OCAMLLIB)
+CFLAGS = -g -mno-cygwin -O2 -mms-bitfields -Wall -Werror
-I$(top_srcdir) -I$(OCAMLLIB) -I/usr/include

MODIFIED THE INSTALL RULE:
install:
- ocamlfind install bitstring META *.mli *.cmx *.cma *.cmxa *.a *.so \
+ ocamlfind install bitstring META *.mli *.cmx *.cma *.cmxa *.a *.dll \
bitstring.cmi \
bitstring_persistent.cmi \
pa_bitstring.cmo
@for d in $(SUBDIRS); do $(MAKE) -C $$d $@; done


I also suppressed one 'test' dependency, because it's production fails:
tests/test.bmpp

Thanks for any help

Salutations

Matt


Matthieu Dubuget

unread,
Mar 31, 2009, 3:11:09 AM3/31/09
to bits...@googlegroups.com
Matthieu Dubuget a écrit :

> Hello,
>
> I'm trying to get bitstring compiled on mingw. Did anybody try this?
>
> It seems to be ok (with some adjustments), but it isn't: the problem
> seems to be that
> the pre-processor does not work.
>
> The two first tests are ok. The third ones fails with this:
>
> File "tests/a10_match_bits.ml", line 31, characters 5-6:
> Parse error: ":" expected after [patt] (in [patt_field])
> File "tests/a10_match_bits.ml", line 1, characters 0-1:
> Error: Preprocessor error
>
> (I renamed the test file to avoid:
>
> Warning X: bad source file name: "10_match_bits" is not a valid module
> name.)
>
>
> Here is how I did:
>
> svn co http://bitstring.googlecode.com/svn/trunk bitstring-svn
> cd bitstring-svn
> patch -p1 < dynlink-bitstring.patch
> ./bootstrap
> ./configure
>
> ADJUSTMENTS:
>
> SUPPRESSED ^M at the end of OCAMLLIB
>

Mmm. I'm sure there is a simple way to get rid of this problem, either
by modifying configure.ac or modify parameters of cygwin. The OCAMLLIB
value is used in other files during configuration: they also have to be
corrected, until I find a patch.

> MODIFIED CFLAGS:
> -CFLAGS = -g -O2 -Wall -Werror -fPIC -I$(top_srcdir) -I$(OCAMLLIB)
> +CFLAGS = -g -mno-cygwin -O2 -mms-bitfields -Wall -Werror
> -I$(top_srcdir) -I$(OCAMLLIB) -I/usr/include
>

I'm using C flags from 'ocamlc -config'.

I don't understand why I have to add '/usr/include' in the search path,
though? Maybe a bad configuration of my system?

> MODIFIED THE INSTALL RULE:
> install:
> - ocamlfind install bitstring META *.mli *.cmx *.cma *.cmxa *.a *.so \
> + ocamlfind install bitstring META *.mli *.cmx *.cma *.cmxa *.a *.dll \
> bitstring.cmi \
> bitstring_persistent.cmi \
> pa_bitstring.cmo
> @for d in $(SUBDIRS); do $(MAKE) -C $$d $@; done
>
>
> I also suppressed one 'test' dependency, because it's production fails:
> tests/test.bmpp
>

This one is solved by using open_out_bin instead of open_out in
create_test_pattern.ml.

Salutations

Matt

Matthieu Dubuget

unread,
Mar 31, 2009, 3:20:33 AM3/31/09
to bits...@googlegroups.com
Matthieu Dubuget a écrit :

I'm calling configure from cygwin. But compiling with -mno-cygwin...

Richard Jones

unread,
Apr 30, 2009, 5:12:40 AM4/30/09
to bits...@googlegroups.com
On Mon, Mar 30, 2009 at 05:13:54PM +0200, Matthieu Dubuget wrote:
> I'm trying to get bitstring compiled on mingw. Did anybody try this?

Did you solve this in the end? Sounds like more of a problem with
camlp4 itself on MinGW, rather than bitstring specifically.

Rich.

--
Richard Jones
Red Hat

Matthieu Dubuget

unread,
May 6, 2009, 9:27:22 AM5/6/09
to bits...@googlegroups.com
| Sujet : « [bitstring] Re: bitstring on mingw »
| Pour : « bits...@googlegroups.com »
| De : « Richard Jones <ri...@annexia.org> »
| Le Thu Apr 30 2009 11:12:40 GMT+0200 (CEST)

Hello Richard,

I don't remember if I already answered your question or not?

The answer is no. I did not solve this problem. I may try again soon.

The problem is that I have almost no knowledge about camlp4…

During my tests, I remember I had to slightly modify some configuration
files:
from memory, I inserted a pipe in order to suppress '\r' from the
configuration
informations read from ocamlc.

Salutations

Matt


Reply all
Reply to author
Forward
0 new messages