Also, the -ltermcap and -lncurses specs are pretty old. I wonder if we still need them on Slackware and other Linux when -lreadline is present.Quote
-ltermcap is still needed. I compiled the code without -lncurses.
Sorry for dumb questions, but I'm just curious why don't you rely on autoconf or cmake? They can simplify detection a lot, especially since you are targeting multiple platforms. Or do you target portable make? If not so, GNU make contains a bunch of advanced constructs like branching, evaluation, substitution and etc. which allows easier writing of more complex build code and can be done without autoconf or cmake.