Page 1 of 1

pksh under MACOS X 10.3

Posted: Thu May 27, 2004 4:00 am
by MainframeOSX
Need help to compile pksh under Mac OSX. The Dev-Tools are installed
and the readline.h and the other componets are in the include directory.
After i type make into my console it give me an error:

/usr/bin/gcc common.o pukklink.o pksh.o -o pksh -lreadline -lcurses -lncurses -L/usr/local/lib -I/usr/local/include -I/usr/include
ld: can't locate file for: -lreadline
make: *** [pksh] Error 1

What is wrong?

Need i the binary of readline?

Need answers!

Thanx

Posted: Thu May 27, 2004 4:11 am
by ole
Yes you need binary.
-lreadline means that the library called readline should be linked along with other objects. Find the library readline (or compile it) and edit the makefile. Insert the -Ldirectory/to/the/library just before -lreadline.

Posted: Thu May 27, 2004 4:24 am
by mharris
readline is a gnu package. If you need to rebuild it from source, the most recent tarball is at http://ftp.gnu.org/pub/gnu/readline/readline-4.3.tar.gz but I do not know if any tweaks are needed for the ps2dev environment. The home page is at http://cnswww.cns.cwru.edu/php/chet/readline/rltop.html

There are probably ps2dev binaries around somewhere...

Posted: Thu May 27, 2004 4:55 am
by ooPo
Unless you need pksh for something specific, there are other clients you could use. I hear ps2client is nice. :)

( http://www.oopo.net/consoledev )

Posted: Thu May 27, 2004 6:55 am
by blackdroid
ooPo: you are good at self promoting, I need to buy your book ;)

MainframeOSX: as ooPo has said you need to let the compiler know where libreadline.a is.usually it is installed in /usr/local/lib, atleast here on my powerbook. ( and that is in the -L path in the Makefile ).

Posted: Thu May 27, 2004 7:18 am
by mharris
mharris wrote:readline is a gnu package. If you need to rebuild it from source, the most recent tarball is at http://ftp.gnu.org/pub/gnu/readline/readline-4.3.tar.gz but I do not know if any tweaks are needed for the ps2dev environment. The home page is at http://cnswww.cns.cwru.edu/php/chet/readline/rltop.html

There are probably ps2dev binaries around somewhere...
OK, so I'm brain-dead from lack of sleep; you need the lib for OSX, not ps2dev (erm, where's the keyboard...)

Like bd said, you should have it somewhere like /usr/local/lib -- try 'locate libreadline' at a shell prompt. It should find a .a file and some .so files. If they're not there, you'll need to build from source or get a binary package from somewhere.

Posted: Wed Jun 02, 2004 12:26 am
by calvin
On OS X, you can also use the Fink pre-compiled packages.

http://fink.sourceforge.net/

They default to being in /sw/{lib,include}, so for the linking stage, you'd have "-L/sw/lib" as part of your command line along with the "-lreadline"
(translates to look in /sw/lib for libreadline.a).

This is what I did for the compiler chain I built back in October. (Taking a page from ooPo's self-promotion):

http://ps2dev.nextgened.com/ps2dev/down ... ksh.tar.gz

As you can guess from the name, my compile of pksh is in there as well.

However, I've since also included ps2client in my toolbox, and it is quite nice. I still bounce back and forth quite a bit, though. (For no particular reason - they both work and I use which ever comes to mind first. I have ps2client in several of my scripts though).

As soon as I get the SDL port done, I'll re-vamp the Macintosh tool line again to update it with the complete compiler, pksh, ps2client, PS2SDK, and SDL setup. Right now it only includes the compilers and pksh, IIRC.

Thanx

Posted: Tue Jun 08, 2004 5:27 am
by MainframeOSX
Thanx to all where have give my an answers! It work's fine on MacOS X.

Posted: Tue Jun 08, 2004 6:57 pm
by blackdroid
Ofcourse it works :)