[liblouis-liblouisxml] Re: Pre-built Windows binaries

  • From: "Michael Whapples" <dmarc-noreply@xxxxxxxxxxxxx> (Redacted sender "mwhapples@xxxxxxx" for DMARC)
  • To: liblouis-liblouisxml@xxxxxxxxxxxxx
  • Date: Fri, 4 Sep 2015 13:05:15 +0100

I think the specific code I referred to was if you compile LibLouis without any compile options then the Windows build uses the program path and goes relative to that (IE. the case when you give a table name with no path components).

The code I am thinking of is in compileTranslationTable.c in the getTablePath function, where it uses a #ifdef _WIN32

The above is based on what I find in the current source code and matching it to what I remembered. Would be good if we could work out a way to find the executable's path on other platforms.

Michael Whapples

On 04/09/2015 12:09, Bert Frees wrote:

Hi Michael,

I agree.

Actually the table paths can be relative on all platforms, also Mac OS. And I
don't even think any special code was needed to accomplish that. The command
line tools just work as long as you specify the (relative or absolute) path to
the table, if you just specify the table name liblouus will not find the
table. The way I'm using my prebuilt liblouis binaries in my application is by
always specifying absolute table paths.



Michael Whapples writes:

I am not really sure whether it would be useful for MacOSX considering
certain things in the build process and what one gets out.

The main thing which comes to my mind is that the default table path
gets hard coded into liblouis by the compile process, so if I were to
compile liblouis on my system to have a table path of
/Users/mwhapples/my_tables, then my build of liblouis is almost
certainly not going to work on anyone elses system.

I think something similar happens with the command line tools of
liblouis and where they look for the liblouis library.

OK, I could use some fairly generic type path like
/usr/share/liblouis/tables which installing the binary build could
create and place the tables in, but that in itself is a bit wrong on the
Mac as it would require an installer rather than distributing an
appbundle and would mean writing files into system directories.

LibLouis itself is not an end user tool and in my mind its really for
the end user application developers to create a suitable binary
distribution. As an example my JLouis java bindings for LibLouis does a
certain amount of work to allow the Java application to set the table
path (and if they are not I could get the JLouis bindings to default the
path to somewhere relative to the JLouis JAR should the application not
set a table path). This is something which the command line tools of
LibLouis do not do and so lower their suitability for portable
redistribution in binary form.

It is worth noting that I seem to remember there being special code in
LibLouis which makes the table path relative for Windows binaries. May
be this should also be the case for MacOSX. If that were done then it
would be more suitable for binary distribution.
For a description of the software, to download it and links to
project pages go to http://liblouis.org

For a description of the software, to download it and links to
project pages go to http://liblouis.org

Other related posts: