[liblouis-liblouisxml] Building with Cygwin

  • From: James Teh <jamie@xxxxxxxxxxx>
  • To: liblouis/liblouisxml mailing list <liblouis-liblouisxml@xxxxxxxxxxxxx>
  • Date: Sat, 17 Jan 2009 08:21:04 +1000

Hi all,

Allow me to provide some clarifications regarding building with Cygwin.

As you probably already know, Cygwin provides an emulation layer using cygwin1.dll and other such dlls for Unix specific system calls and other functions. When you build with no special options under Cygwin, the resulting executables and dlls require the Cygwin emulation layer. While this is useable, it is not ideal for distribution as a native Windows build.

For code that doesn't require Unix specific functions, Cygwin can also build using mingw, which produces native Windows code that does not depend on Cygwin.

Because you need to pass some arguments to gcc, this is not as simple as it could be. You need to create the following script and place it in the Cygwin PATH (I use /usr/local/bin):
--begin--
#!/bin/bash
gcc -mno-cygwin "$@"
--end--
(Of course, you only need to do this bit once.)

Now, change to the liblouis source dir and run configure like this:
./configure CC=mgcc --build=mingw32
(Apparently, CC="gcc -mno-cygwin", which would be a lot simpler, causes problems because one of the tools strips the command line argument.)

Running:
make
will now build liblouis.
make install will install it to Cygwin's /usr/local. However, you could do:
make install DESTDIR=/path/to/desired/dest/dir
to make it install all relevant files to a specific location.

One problem is that I'm not sure how to stop it from calling the dll "liblouis-1.dll". I would prefer "liblouis.dll" under Windows. Michel, does mingw do this or is this a Cygwin/mingw issue?

Regarding liblouisxml, I suspect this will be somewhat trickier. This is because Cygwin provides its own version of libxml2, but this doubtless depends on Cygwin, which is undesirable. You would have to build using a mingw version of libxml2, but I'm not sure how to do that under Cygwin.

It's probably simpler to just use mingw and msys, as you don't have to worry about the Cygwin dependency at all. However, I thought I'd provide these instructions for those that care. :)

--
James Teh
Email/MSN Messenger/Jabber: jamie@xxxxxxxxxxx
Web site: http://www.jantrid.net/
For a description of the software and to download it go to
http://www.jjb-software.com

Other related posts: