E-Mail:
Get our new Windows 7 eBook (PDF) for $7 with 70+ Tips. Download Now!

Compiling Software from Source, Part III

  • No Related Post

Compiling Software from Source, Part III

There’s no point in doing an example that’s too easy, right? Being
the masochist I am, I think I’ll try to compile the GNOME 2.2.1
source. This is a sprawling piece of work since it has all kinds
of dependency issues. Nice and complicated. I want to make sure
you realize that this isn’t really a follow-along kind of thing
unless you really feel like banging your head into a wall. This is
more so you can watch problem-solving methods. I guarantee there
will be plenty of problems to solve here.

First I go to www.gnome.org to
grab the source, which I download all into ~/Downloads/GNOME2.2.1.
I grab everything in http://ftp.gnome.org/pub/GNOME/desktop/2.2/2.2.1/sources/ that
ends in .bz2, since this is the new “Best compression” format.

Now, let the insanity begin! I should warn you, I’m not a
programmer by trade. I have a kind of logic I approach these
problems with, and no doubt it will make some programmers cringe.
I’ll let them speak up for themselves once they stop screaming and
crying at my methods! (I know there are more organized ways to do
this. I’m just not that organized a person.)

So, I look through the list of what I just downloaded and look for
the most central program in there. Since I’m looking at GNOME, I
figure that’s the gnome-desktop package. A quick bunzip2 and I’ve got it
uncompressed, a tar xvf and
it’s unpackaged into its own directory. I change to that
directory, do an ls, and what
do you know, I see Makefiles and a file named “configure.” I take
a quick look in the INSTALL file and sure enough, it’s autoconf,
so I run ./configure and wait
for the inevitable complaint (it’s never THAT easy!) There we go:

checking for pkg-config... /usr/bin/pkg-config
COMPILE WARNINGS yes
checking what warning flags to pass to the C compiler... -Wall -Wunused -Wmissing-prototypes -Wmissing-declarations
checking what language compliance flags to pass to the C compiler...
***** WARNING: Building without libstartup-notification
checking for gdk-pixbuf-2.0 >= 2.0.3 gtk+-2.0 >= 2.1.2 libgnomeui-2.0 >= 2.1.0 gnome-vfs-2.0 >= 2.0.0 ... Package libgnomeui-2.0 was not found in the pkg-config search path.
Perhaps you should add the directory containing 'libgnomeui-2.0.pc'
to the PKG_CONFIG_PATH environment variable
No package 'libgnomeui-2.0' found

configure: error: Library requirements (gdk-pixbuf-2.0 >= 2.0.3 gtk+-2.0 >= 2.1.2
libgnomeui-2.0 >= 2.1.0 gnome-vfs-2.0 >= 2.0.0 ) not met; consider adjusting the
PKG_CONFIG_PATH environment variable if your libraries are in a nonstandard prefix
so pkg-config can find them.

Looking through the libraries it’s complaining about (I’ve marked
them off in bold type), I just kind of pick one and use that as a
leaping-off point. I’ll go with the first, gdk-pixbuf. I go back
to the directory with all of my GNOME 2.2.1 downloads and open up
the gdk-pixbuf package… or, um, there is no gdk-pixbuf package.
A quick look at the URL I grabbed the files from shows me that I
didn’t miss the file, so this library’s inside another library.
That’s fine, I’ll open up the gtk+ package instead. That one’s
actually there.

When I type ./configure
inside the gtk+ directory, I get:

checking for TIFFFlushData in -ltiff34... no
configure: WARNING: *** TIFF plug-in will not be built (TIFF library not found)
***
configure: error:
*** Checks for TIFF loader failed. You can build without it by passing
*** --without-libtiff to configure but some programs using GTK+ may
*** not work properly

I do have libtiff installed, I can check using RPM:


$ rpm -q libtiff
libtiff-3.5.7-11

Maybe it’s not looking in the right directory. I start with:

$ locate libtiff
/usr/lib/libtiff.so.3
/usr/lib/libtiff.so.3.5
/usr/share/doc/libtiff-3.5.7
/usr/share/doc/libtiff-3.5.7/COPYRIGHT
/usr/share/doc/libtiff-3.5.7/README
/usr/share/doc/libtiff-3.5.7/VERSION

Then I type:

$ ./configure --help | more

which eventually shows me:


  --bindir=DIR           user executables [EPREFIX/bin]
  --sbindir=DIR          system admin executables [EPREFIX/sbin]
  --libexecdir=DIR       program executables [EPREFIX/libexec]
  --datadir=DIR          read-only architecture-independent data [PREFIX/share]
  --sysconfdir=DIR       read-only single-machine data [PREFIX/etc]
  --sharedstatedir=DIR   modifiable architecture-independent data [PREFIX/com]
  --localstatedir=DIR    modifiable single-machine data [PREFIX/var]
  --libdir=DIR           object code libraries [EPREFIX/lib]
  --includedir=DIR       C header files [PREFIX/include]
  --oldincludedir=DIR    C header files for non-gcc [/usr/include]

Okay, then, so I want to know where EPREFIX is set. A bit
farther up in the output I see:

  --exec-prefix=EPREFIX   install architecture-dependent files in EPREFIX
                          [PREFIX]

So, since my TIFF libraries are in /usr/lib, I just need to use:

./configure -libdir=/usr/lib

Oops, same result. My library versions probably don’t match up. I
look in the README file and find nothing useful. But in the
INSTALL file:

 - The TIFF, PNG, and JPEG image loading libraries. You most
   likely have these installed on your system already. If not
   these libraries are available from:

    http://www.libtiff.org/
    ftp://swrinde.nde.swri.edu/pub/png/src/
    ftp://ftp.uu.net/graphics/jpeg/

Since I don’t see any TIFF, PNG, or JPEG libraries in the code I
downloaded from the GNOME servers, I guess I’ll go get them while
you’re reading this. I’ll end up with multiple versions of the
libraries on my system so I’ll have to be careful that nothing
gets overwritten, but I’ll wait to install them until next week.

Next week: The compiling from source train wreck
continues…

What Do You Think?

 
35 queries / 0.379 seconds.