Newbie Question about Libraries, Man pages, and Info

Newbie Question about Libraries, Man pages, and Info

Post by Christopher R. Jone » Wed, 03 Mar 1999 04:00:00



I need help with some basic concepts re upgrading, building and and
installing software:

I installed Redhat 5.3 on my Pentium Pro 2 weeks ago.  I installed MySQL and
got is working fine.  Then I decided to get the egcs compiler and rebuild
MySQL for optimal performance.

I installed the egcs from source and placed the executables /usr/local/bin.
Then I backed up the original gcc executables from /usr/bin and created
symbolic
links to the egcs files.

Then I tried to build MySQL - I got a configure error - no termcap or
ncurses libraries.  Locate found /lib/libtermcap.so.2.0.8 ,
/lib/libtermcap.so.2.0 ,/lib/libncurses.so.4 , and /lib/libncurses.so.4.2.
I thought these were the libraries I was looking for.  But someone kindly
pointed out that I needed libtermcap.a and libncurses.a
I found these on the REDHAT distrubution CD and installed them.  MySQL
compiled and installed fine.

My confusion is over file types.  What is a lib???.so and how is it
different from a lib???.a

If I installed a more optimized compiler - egcs.  Would I not also need to
rebuild libraries for best performance.  If so, how does one go about doing
that?

How do I get the egcs man pages and the info pages recognized by man and
info?
I tried backing up the original gcc.1 and created a symbolic to the new,
egcs, gcc.1
man still brings up the old information.  I have no idea how to update
info???

Thanks for reading through this very long question.

 
 
 

Newbie Question about Libraries, Man pages, and Info

Post by David Z. Maz » Wed, 03 Mar 1999 04:00:00



CRJ> I installed Redhat 5.3 on my Pentium Pro 2 weeks ago.

(You mean RH5.2?)

CRJ> I installed the egcs from source and placed the executables
CRJ> /usr/local/bin.  Then I backed up the original gcc executables
CRJ> from /usr/bin and created symbolic links to the egcs files.

The symlinks should be unnecessary; /usr/local/bin should be in your
default PATH.  ('echo $PATH' to check.)  In Debian, gcc is GNU cc 2.7
or 2.8, egcc is the EGCS cc, and cc is a symlink to one or the other;
this lets you use both EGCS and GNU cc on the same system.

CRJ> Then I tried to build MySQL - I got a configure error - no
CRJ> termcap or ncurses libraries.  Locate found
CRJ> /lib/libtermcap.so.2.0.8 , /lib/libtermcap.so.2.0
CRJ> ,/lib/libncurses.so.4 , and /lib/libncurses.so.4.2.  I thought
CRJ> these were the libraries I was looking for.

They are, but the linker (ld) won't find them without a symlink to the
library named e.g. libtermcap.so (no version number).  Additionally,
you need appropriate header files for the library.  Both are included
in a package named something along the lines of 'termcap-devel'.

CRJ> But someone kindly pointed out that I needed libtermcap.a and
CRJ> libncurses.a I found these on the REDHAT distrubution CD and
CRJ> installed them.  MySQL compiled and installed fine.

(Sounds like you installed the -devel package.  :-)

CRJ> My confusion is over file types.  What is a lib???.so and how is it
CRJ> different from a lib???.a

lib???.a is a static-link library.  When you link with a .a file, the
code in it gets slurped into the executable.  This makes the resulting
binary larger, but without a dependency on some external library file.

lib???.so is a shared library.  When you link with a .so file, the
linker makes a note of which library it needs (by reading the "soname"
from the library) and stores this in the binary.  The actual code is
in the library file.  For example:

        libtermcap.a            Static library
        libtermcap.so           Link to libtermcap.so.4, for linker use
        libtermcap.so.4         Link to libtermcap.so.4.2, used by
                                dynamic linker
        libtermcap.so.4.2       The actual dynamic library

This scheme lets you have other versions of the same library around,
for example:

        libtermcap.so.4.0       Obsolete libtermcap v4.x
        libtermcap.so.3         Link to libtermcap.so.3.8
        libtermcap.so.3.8       libtermcap v3.x, for older applications

If you don't have the correct libraries available, the application
fails to run.  You can check what libraries a particular binary needs
with the 'ldd' command.

CRJ> If I installed a more optimized compiler - egcs.  Would I not
CRJ> also need to rebuild libraries for best performance.  If so, how
CRJ> does one go about doing that?

Quite likely; the process is similar to compiling other applications.

(If you're going to be recompiling most of your system, you might be
better off using a Linux distribution more amenable to this.
Recompiling most of your Red Hat system will probably make it
difficult to properly upgrade the system later.  A distribution such
as Slackware is much less sensitive to random changes you make.
Alternatively, you can build RPMs customized for your system; I know
almost nothing about how one would go about doing this.)

CRJ> How do I get the egcs man pages and the info pages recognized by
CRJ> man and info?  I tried backing up the original gcc.1 and created
CRJ> a symbolic to the new, egcs, gcc.1 man still brings up the old
CRJ> information.

The Right Thing To Do (TM) is to leave the old gcc.1 in place, and add
/usr/local/man to your MANPATH environment variable if it isn't there
already.  (egcc.1 would be in /usr/local/man/man1, then.)  You'll
probably need to give man(1) some option to make it forget its cached
copy of the gcc(1) man page; see man's man page for more information.

CRJ> I have no idea how to update info???

Info has two parts: the actual info file, which should probably wind
up in /usr/info, and a "directory" file which comes up when you first
launch Info.  You should be able to edit /usr/info/dir on your own
without too much trouble; I don't know if Red Hat offers any utilities
for managing this file.

--

"Hey, Doug, do you mind if I push the Emergency Booth Self-Destruct Button?"
"Oh, sure, Dave, whatever...you _do_ know what that does, right?"

 
 
 

1. info reads man page instead of info docs

Hello,

I am trying to read the info documentation for a2ps but when I type

$ info a2ps

the info program brings up the man page instead. I have both the info
and man documentation on my system. Do I have a configuration problem?
Here are the files I have. I am running Red Hat 5.2. Is anyone familiar
with this problem? Shouldn't info bring up one of the info files instead?


/usr/man/man1/a2ps.1

/usr/info/a2ps.info-1.gz  /usr/info/a2ps.info-3.gz
/usr/info/a2ps.info-5.gz
/usr/info/a2ps.info-2.gz  /usr/info/a2ps.info-4.gz  /usr/info/a2ps.info.gz

Thanks,

Neil Zanella

2. Microsoft busmouse on the ATI ULTRA , cannot be opened?

3. Any library to turn HTML page to a man page format?

4. ICQJava and KDE

5. Newbie question about man pages

6. kerneld/scsi support

7. Newbie question MAN pages

8. ping -f 127.0.0.1

9. Restoring man pages (Newbie question)

10. Standard man pages to "Catted" man pages!

11. How to format BSD man pages (groff man) using "classical" troff man?

12. info & man pages

13. How to install man page or info in 4.3.2