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
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
I'm calling configure from cygwin. But compiling with -mno-cygwin...
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
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