| View previous topic :: View next topic |
| Author |
Message |
J.F.
Joined: 22 Feb 2004 Posts: 2906
|
Posted: Mon Aug 13, 2007 2:23 pm Post subject: Found a bug in one of the depend scripts |
|
|
In the check-ncurses.sh depend script, it does this:
| Code: | #!/bin/sh
# check-ncurses.sh by Dan Peori (danpeori@oopo.net)
## 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. |
|
| Back to top |
|
 |
jimparis
Joined: 10 Jun 2005 Posts: 1179 Location: Boston
|
Posted: Mon Aug 13, 2007 3:26 pm Post subject: |
|
|
| 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? |
|
| Back to top |
|
 |
ooPo Site Admin
Joined: 17 Jan 2004 Posts: 2032 Location: Canada
|
Posted: Wed Aug 15, 2007 3:41 am Post subject: |
|
|
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. |
|
| Back to top |
|
 |
J.F.
Joined: 22 Feb 2004 Posts: 2906
|
Posted: Wed Aug 15, 2007 5:34 am Post subject: |
|
|
| 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. |
|
| Back to top |
|
 |
ooPo Site Admin
Joined: 17 Jan 2004 Posts: 2032 Location: Canada
|
Posted: Wed Aug 15, 2007 3:11 pm Post subject: |
|
|
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.
Here's some more info:
http://tldp.org/HOWTO/Program-Library-HOWTO/static-libraries.html
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? |
|
| Back to top |
|
 |
J.F.
Joined: 22 Feb 2004 Posts: 2906
|
Posted: Wed Aug 15, 2007 5:29 pm Post subject: |
|
|
| 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.
Here's some more info:
http://tldp.org/HOWTO/Program-Library-HOWTO/static-libraries.html
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. |
|
| Back to top |
|
 |
ooPo Site Admin
Joined: 17 Jan 2004 Posts: 2032 Location: Canada
|
Posted: Thu Aug 16, 2007 4:04 am Post subject: |
|
|
Xubuntu (and any other Ubuntu-based distro) would use this package for ncurses dev:
http://packages.ubuntu.com/feisty/libdevel/libncurses5-dev
Which includes this file:
| Code: | | usr/lib/libncurses.a |
Regardless, I'll modify the script to look for /usr/include/ncurses.h. |
|
| Back to top |
|
 |
J.F.
Joined: 22 Feb 2004 Posts: 2906
|
|
| Back to top |
|
 |
StrmnNrmn
Joined: 14 Feb 2007 Posts: 46 Location: London, UK
|
Posted: Mon Aug 20, 2007 7:52 am Post subject: |
|
|
The depends script wasn't working under OSX either - it needs to look for libncurses.dylib. I wrote a bit about it here.
Checking for /usr/include/ncurses.h should work too. |
|
| Back to top |
|
 |
|