backtracking / ocamlgraph

OCaml graph library
http://backtracking.github.io/ocamlgraph/
Other
233 stars 60 forks source link

Configuration script error when building for Windows #39

Closed martin-neuhaeusser closed 9 years ago

martin-neuhaeusser commented 9 years ago

Configuring the build of ocamlgraph for Windows using the Cygwin environment fails in detecting ocamlfind's presence:

$ ./configure
checking for ocamlc... ocamlc
ocaml version is 4.02.2
ocaml library path is C:/ocamlmgw/lib
checking for ocamlopt... ocamlopt
checking ocamlopt version... ok
checking for ocamlc.opt... ocamlc.opt
checking ocamlc.opt version... ok
checking for ocamlopt.opt... ocamlopt.opt
checking ocamlc.opt version... ok
checking for ocamldep... ocamldep
checking for ocamllex... ocamllex
checking for ocamllex.opt... ocamllex.opt
checking for ocamlyacc... ocamlyacc
checking for ocamldoc... ocamldoc
checking for ocamldoc.opt... ocamldoc.opt
checking for ocamlweb... true
checking for ocamlfind... ocamlfind
OCamlfind detected but disabled. Standard libraries differ:
  ocamlc: 'C:/ocamlmgw/lib'
  ocamlfind: 'C:\ocamlmgw\lib'
checking for C:/ocamlmgw/lib/lablgtk2/lablgtk.cmxa... no
checking Win32 platform... yes
configure: WARNING: lablgnomecanvas not found: the graph editor and view_graph will not be compiled
configure: creating ./config.status
config.status: creating Makefile

This behavior is due to the difference in Windows path separators that are reported by ocamlfind and ocamlc. The build succeeds, once the test in line 2253 in ocamlgraph's configure script is deleted.

backtracking commented 9 years ago

We could remove this test, of course, but it was purposely added to avoid inconsistency between an old version of ocamlfind lying around in your PATH (for a former version of OCaml).

Do you know if there is a way to perform such a test in a platform-independent way?

Jean-Christophe

Le 24/06/2015 10:08, Martin R. Neuhäußer a écrit :

Configuring the build of ocamlgraph for Windows using the Cygwin environment fails in detecting ocamlfind's presence:

$ ./configure checking for ocamlc... ocamlc ocaml version is 4.02.2 ocaml library path is C:/ocamlmgw/lib checking for ocamlopt... ocamlopt checking ocamlopt version... ok checking for ocamlc.opt... ocamlc.opt checking ocamlc.opt version... ok checking for ocamlopt.opt... ocamlopt.opt checking ocamlc.opt version... ok checking for ocamldep... ocamldep checking for ocamllex... ocamllex checking for ocamllex.opt... ocamllex.opt checking for ocamlyacc... ocamlyacc checking for ocamldoc... ocamldoc checking for ocamldoc.opt... ocamldoc.opt checking for ocamlweb... true checking for ocamlfind... ocamlfind OCamlfind detected but disabled. Standard libraries differ: ocamlc: 'C:/ocamlmgw/lib' ocamlfind: 'C:\ocamlmgw\lib' checking for C:/ocamlmgw/lib/lablgtk2/lablgtk.cmxa... no checking Win32 platform... yes configure: WARNING: lablgnomecanvas not found: the graph editor and view_graph will not be compiled configure: creating ./config.status config.status: creating Makefile

This behavior is due to the difference in Windows path separators that are reported by ocamlfind and ocamlc. The build succeeds, once the test in line 2253 in ocamlgraph's configure script is deleted.

— Reply to this email directly or view it on GitHub https://github.com/backtracking/ocamlgraph/issues/39.

martin-neuhaeusser commented 9 years ago

The command tr \\ /replaces any occurrence of a backslash by a slash. It is widely available on Linux and on Cygwin (which is where most Windows-builds occur).

If one filtered the string via a call to tr \\ /before the comparison, this might help. At least, it should not break anything on Linux...