Readline 8 on OpenBSD

Proably I should migrate my midnoi tool to use editline(3) but since OpenBSD only ships with readline-7.0p0 and midnoi needs readline 8 (it was written for the 2009 macbook, RIP 2022) one must compile readline into some other directory and use that.

    $ localarchdir
    OpenBSD7.3-amd64
    $ ./configure --prefix=~/usr/`localarchdir` && make && make install
    ...

This is something of a kluge, but the lib/pkgconfig/readline.pc file needs modifiction, notably to remove the termcap line, to add -lncurses, and to use rpath linking.

    prefix=/home/jmates/usr/OpenBSD7.3-amd64
    exec_prefix=${prefix}
    libdir=${exec_prefix}/lib
    includedir=${prefix}/include

    Name: Readline
    Description: Gnu Readline library for command line editing
    URL: http://tiswww.cwru.edu/php/chet/readline/rltop.html
    Version: 8.2
    Libs: -Wl,-R ${libdir} -L${libdir} -lreadline -lncurses
    Cflags: -I${includedir}

https://thrig.me/src/lingua.git

    $ grep midnoi Makefile
    midnoi: midnoi.c
            $(CC) $(CFLAGS) `pkg-config --cflags --libs readline sqlite3` midnoi.c -o midnoi
    $ echo $PKG_CONFIG_PATH
    /home/jmates/usr/OpenBSD7.3-amd64/lib/pkgconfig:/usr/local/lib/pkgconfig
    $ ldd ./midnoi | grep readl
            00000628bea8b000 00000628beaea000 rlib  0    1   0      /home/jmates/usr/OpenBSD7.3-amd64/lib/libreadline.so.8.2

some other OpenBSD thing

tags #readline #openbsd