#!/bin/sh
# check-ncurses.sh by Dan Peori ([email protected])
## Check for a ncurses library.
ls /usr/lib/libncurses.a 1> /dev/null || ls /usr/lib/libncurses.dll.a || { echo "ERROR: Install ncurses before continuing."; exit 1; }
That won't work on linux systems. It needs to be "/usr/lib/libncurses.so". I noticed this was changed since I ran the toolchain last - probably to make it work with CygWin. You need to add libncurses.so to those or you're breaking all the linux folks.
Of course, the real right way to do it would be to just try to link a test program against "-lncurses". Has anyone considered using autoconf to do the detection?
As I'm on a linux system, I'm fairly sure it will indeed work on linux systems.
Generally, libncurses.so is always available. You need it to run ncurses-linked programs. But libncurses.a is there only when the ncurses development package is installed. That's why the test is written the way it is.
ooPo wrote:As I'm on a linux system, I'm fairly sure it will indeed work on linux systems.
Generally, libncurses.so is always available. You need it to run ncurses-linked programs. But libncurses.a is there only when the ncurses development package is installed. That's why the test is written the way it is.
No. I'm on linux (Fedora 7), and have ncurses and ncurses-devel installed, so I KNOW there's no .a file. .a files were abandoned a couple years ago in favor of .so. The only .a files you'll find these days are a couple old, backwards-compatibility libs for really old apps.
Old old apps? Being a static library, they wouldn't come with .a files - the code has already been statically linked into the app.
Most linux distributions give you .a files when you install the development package because static linking is still relevant and very useful in many cases. Saying it has been abandoned reflects a very narrow viewpoint.
Still, you have a valid point about a bug if Fedora sees fit to not include the file. Can you tell me what it does install so we can pick a file to check for?
ooPo wrote:Old old apps? Being a static library, they wouldn't come with .a files - the code has already been statically linked into the app.
Most linux distributions give you .a files when you install the development package because static linking is still relevant and very useful in many cases. Saying it has been abandoned reflects a very narrow viewpoint.
Still, you have a valid point about a bug if Fedora sees fit to not include the file. Can you tell me what it does install so we can pick a file to check for?
What can I say? I've got the latest Fedora with developer packages for almost everything and only 104 out of 2134 lib files are .a with the rest being .so. Looking at the file lists for -devel packages in the package manager, the vast majority use .so files, not .a files. It's been that way for at least a year that I'm aware of.
I stated the lib in the first post: "/usr/lib/libncurses.so"
Using that in the depends script works perfectly with Fedora 7.
A quick check of Xubuntu 7.04 minimum install set to compile the toolchain reveals only 49 out of 961 lib files are .a with the rest being .so. It also doesn't use libncurses.a. I don't think any modern linux distro does.
A closer look at Xubuntu shows they don't use an ncurses lib in /usr/lib/ at all. It uses /lib/libncurses.so.5 instead. I don't think the current ncurses depend check will work reliably on MOST systems. Jimparis has it right - the only way that stands a chance of working for everyone is to link a test program against -lncurses.