ocaml-tmk-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Ocaml-tmk-devel] configure script


From: Paul Pelzl
Subject: [Ocaml-tmk-devel] configure script
Date: Thu, 10 Apr 2008 00:54:10 -0500

I've been doing some more curses development lately, so I decided to
invest some time in trying to get my ocaml-tmk fork reintegrated with
the New And Improved OCaml Curses.

I've attached a patch which adds an autoconf-based configure script.
The script performs some basic ncurses detection: it searches for
ncurses headers in several common locations, and does a link test.  In
addition, one can pass the "--enable-widec" option to configure,
causing the build script to link against a wide-character-enabled
ncurses.  Most of the configure code has been used in Wyrd for a
couple of years, and appears to be pretty robust.

For those who are familiar with bzr, it would be easier to review
these changes by branching from
http://pessimization.com/software/bzr/ocaml-tmk/autoconf/ .

Regarding the --enable-widec capability: linking against libncursesw
effectively provides transparent UTF-8 support.  In Wyrd, I do the
following to render UTF-8:

    0) Use a UTF-8 terminal.
    1) Check Curses.Config.wide_ncurses to see if the library
       has wide char support (this is provided by the patch).
    2) Issue a call to setlocale(LC_ALL, ""), to kick ncurses
       into rendering UTF-8.
    3) Use UTF-8 aware functions for computing string lengths
       when laying out the UI.

I use a tiny C extension to access setlocale() from OCaml.  Since this
is required to kick ncurses into the right mode, would it be
appropriate to provide a binding within ocaml-curses?

I've also been experimenting with ocamlbuild, and finding it to be a
pretty sweet tool.  Would there be interest in a patch to use
ocamlbuild instead of OCamlMakefile?

Paul




reply via email to

[Prev in Thread] Current Thread [Next in Thread]