
This utility is written in Objective-C. 
You need an Objective-C compiler to compile it :

	http://sourceforge.net/projects/objc

It also requires the System V ETI (Extended Terminal Interface) package : System V curses and the System V forms and menus libraries.

The installation procedure is :

1. Get flex (if not present on your system)
This should not be necessary, most Linux distributions have flex

2. Get Berkeley Yacc (and install as "byacc")
Some Linux distributions already have "byacc"

On SUSE Tumbleweed run: zypper install byacc
Or on Debian Linux run: apt install byacc
On OpenIndiana run: pkg install byacc

3. Get Objective-C compiler bootstrap (unless you have a binary Objective-C pkg)
Run ./configure;make;make install to install this

4. Get Objective-C compiler
Install this after step 3 (or install an Objective-C compiler from a repo)

5.  Cursel supports both AT&T System-V UNIX curses and ncurses.

Originally cursel was written on Slackware Linux 7, Solaris 8, Unixware 7, and SCO OpenServer and assumed that the <curses.h> header file would be used (which was ncurses in the case of Slackware Linux).

Since release 1.0.3, the configure script uses the autoconf-archive macros, by John Zaitseff, Reuben Thomas, Damian Pietras and Mark Pulford.

This means that ./configure supports --with-ncurses and with-ncursesw flags (or --without-ncurses and --without-ncursesw) to find the curses and ETI header files and libraries.

Type ./configure --help to see those flags or options.

For example on Solaris one can configure

	./configure --without-ncurses --without-ncursesw

and avoid the ncurses.h (to use the Oracle/Sun/System V/AT&T curses.h)

It also should disable the ncursesw (wide char) libraries.

On systems with pkg-config the configure script will use M4 (macros). 

The settings can also be checked with the following commands :

	pkg-config --cflags ncurses 
	pkg-config --libs ncurses 

Not all systems provide cflags and library names.

6. Then do a ./configure;make;make install of "CURSEL"

Please inspect the Makefile and "config.h" after 'configure'

There may be missing -I or -L flags, despite using the ax_with_curses.m4 macros (limitations of the macros).

For example config.h may incorrectly define HAVE_NCURSES_FORM_H and HAVE_NCURSES_MENU_H (this seems a limitation of the ax_with_curses.m4 macros).

pkg-config may produce output that is unknown to the objc compiler driver.

On SUSE Tumbleweed, currently pkg-config --libs ncurses produces

	-Wl,--push-state,--asneeded -ltinfo -Wl,--popstate

but this is not understood by the objc compiler driver,
and could also be considered a limitation of the ax_with_curses.m4 M4 macros.

One can manually delete the -Wl ... part of the LIBS line before running 'make'.

If the build fails on some specific header file, try reconfigure without that header file.

For example, if the build fails on <regex.h>, please report this, and try:

	./configure ac_cv_header_regex_h=no

This will disable the regex support in cursel and build as if <regex.h> were not there.

On Linux openSUSE Tumbleweed, cursel can be compiled with regex support, despite a syntax error on the regexec() function prototype with __pmatch[__restrict __nmatch] in the Tumbleweed header file <regex.h>.

The error can be solved by adding -D__STDC_NO_VLA__ (no variable length array) and/or -D_Restrict_arr_ to MFLAGS or IFLAGS in the cursel Makefile, to avoid the __restrict keyword in the VLA array declaration, that is used (unfortunately) in the <regex.h> header file.
 
The POSIX standard defines a prototype for regexec() but the Tumbleweed header file uses a different prototype using a VLA syntax.

7. (Optional) :

	ln -s /usr/local/bin/cursel /bin/fmli

I wrote the software in 1999/2000 on Slackware 7.0 Linux, using ncurses-5.0 990918.  The hardware was a Dell PC (Intel) with one monochrome (black/green) serial-line terminal attached to it.

Platforms on which CURSEL is known to work :

	* Slackware 7 Linux
	* Slackware 8.1 Linux
	* Slackware 15 Linux
	* Solaris 2.6
	* UnixWare 2
	* UnixWare 7
	* SCO OpenServer
	* HP-UX 11 (with ncurses not with HP curses)
	* OpenSolaris 
	* OpenIndiana
	* Solaris 11.3/11.4 (AT&T/Sun/Oracle curses and ncurses 5.7 p20081102)
	* OpenBSD 7.7 (ncurses 6.4 patchlevel 20230826)
	* openSUSE Tumbleweed (gcc 15.2.1 ncurses)

