forums.ps2dev.org Forum Index forums.ps2dev.org
Homebrew PS2, PSP & PS3 Development Discussions
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Found a bug in one of the depend scripts

 
Post new topic   Reply to topic    forums.ps2dev.org Forum Index -> PSP Development
View previous topic :: View next topic  
Author Message
J.F.



Joined: 22 Feb 2004
Posts: 2906

PostPosted: Mon Aug 13, 2007 2:23 pm    Post subject: Found a bug in one of the depend scripts Reply with quote

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
View user's profile Send private message AIM Address
jimparis



Joined: 10 Jun 2005
Posts: 1179
Location: Boston

PostPosted: Mon Aug 13, 2007 3:26 pm    Post subject: Reply with quote

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
View user's profile Send private message
ooPo
Site Admin


Joined: 17 Jan 2004
Posts: 2032
Location: Canada

PostPosted: Wed Aug 15, 2007 3:41 am    Post subject: Reply with quote

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
View user's profile Send private message Visit poster's website
J.F.



Joined: 22 Feb 2004
Posts: 2906

PostPosted: Wed Aug 15, 2007 5:34 am    Post subject: Reply with quote

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
View user's profile Send private message AIM Address
ooPo
Site Admin


Joined: 17 Jan 2004
Posts: 2032
Location: Canada

PostPosted: Wed Aug 15, 2007 3:11 pm    Post subject: Reply with quote

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
View user's profile Send private message Visit poster's website
J.F.



Joined: 22 Feb 2004
Posts: 2906

PostPosted: Wed Aug 15, 2007 5:29 pm    Post subject: Reply with quote

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
View user's profile Send private message AIM Address
ooPo
Site Admin


Joined: 17 Jan 2004
Posts: 2032
Location: Canada

PostPosted: Thu Aug 16, 2007 4:04 am    Post subject: Reply with quote

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
View user's profile Send private message Visit poster's website
J.F.



Joined: 22 Feb 2004
Posts: 2906

PostPosted: Thu Aug 16, 2007 6:57 am    Post subject: Reply with quote

ooPo wrote:
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.


Okay, I double-checked that and Ubuntu does have it, but Fedora doesn't. Odd...

I did some more checking, and the only place to get libncurses.a for Fedora 7 is

http://www-ccrma.stanford.edu/planetccrma/mirror/fedora/linux/releases/7/Everything/x86_64/os/Fedora/ncurses-static-5.6-6.20070303.fc7.x86_64.rpm

They also have a 32 bit rpm as well for folks on 32 bit systems.
Back to top
View user's profile Send private message AIM Address
StrmnNrmn



Joined: 14 Feb 2007
Posts: 46
Location: London, UK

PostPosted: Mon Aug 20, 2007 7:52 am    Post subject: Reply with quote

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
View user's profile Send private message Visit poster's website MSN Messenger
Display posts from previous:   
Post new topic   Reply to topic    forums.ps2dev.org Forum Index -> PSP Development All times are GMT + 10 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group