Enterprise Software

Messages from make install

The window managers and terminal applications that ship with Solaris are a bit hungry in the area of memory consumption—and a bit old-fashioned looking. In this Daily Drill Down, Stew Benedict shows you how to build and set up XFce.


The window managers and terminal applications that ship with Solaris are a bit hungry in the area of memory consumption—and a bit old-fashioned in the area of visual appeal. In this Daily Drill Down, I'll show you how to build and set up XFce, a window manager very similar to CDE, but with more features and much lighter in weight. In addition, I'll set up an alternate xterm, Rxvt, which will give you just as slick a desktop as that of your Linux friends with its transparency options. Also, since I'll need to install a number of graphics libraries to fully utilize XFce, I'll install the graphics application, Gimp, for manipulating graphics.

What does XFce contain?
XFcehas the following standard components/features:
  • xfwm:The window manager, with a larger number of configuration options, such as window shading and other options
  • xfce:The main panel, much like CDE's main panel (Figure A)
  • xfbackground:To set workspace backgrounds
  • xfsound:A sound daemon for window manager events, such as opening and closing applications (Figure B)
  • xfpager:A window pager adapted from fvwm, with a graphical view of all of your desktops and the ability to drag applications to a different desktop
  • xfmouse:A control module for defining your mouse settings (Figure C)
  • xftree:A file browser/manager

Figure A
The CDE main panel


Figure B
The xfsound configuration window


Figure C
The control window for mouse settings


Solaris has announced that they will be standardizing on the GNOME desktop in future releases of Solaris. This will bring the Solaris desktop more in line with what Linux users are accustomed to, but that's a bit too much overhead for an older SPARC like I’m using here.

Getting XFce
Let’s start with XFce. The latest version as of this writing is 3.5.2, and you can download it from the official XFce site. You’ll find some additional themes/backgrounds as well.

In addition, you’ll need the following tarballs:

And to get the full-blown effects of jpeg and png backdrops, you’ll want the following:

You’ll also want to get Rxvt as your new terminal program and Sox to enable XFce's sound module:

Gnu Gettext is also required to build XFce:
  • gettext

  • I took all these tarballs and dropped them into /home/stew/build.

    Installing all the components
    The first step is to make and install Glib. Glib is a set of useful C routines needed for GTK+. To do this, issue the following commands:
    cd build
    gtar -xzf glib-1.2.8.tar.gz
    cd glib-1.2.8
    ./configure
    gmake
    sudo gmake install


    Remember, in a previous Daily Drill Down, “Setting up Web-based groupware applications on Solaris,” I set up gcc, gnu tar (renamed as gtar), gnu make (renamed as gmake), and sudo. I make it a habit to do as much as I can as user stew and use sudo for one-time root commands, such as installing software. Sudo prompts you for your password and warns you once daily of the implications of running root commands. This gives you a moment to reflect on what you are doing before you trash your system.

    Click here to view the message that appears during make install:
    ============================================================
    Libraries have been installed in:
       /usr/local/lib

    If you ever happen to want to link against installed libraries
    in a given directory, LIBDIR, you must either use libtool,
    and specify the full pathname of the library, or use
    `-LLIBDIR' flag during linking and do at least one of the following:
       - add LIBDIR to the `LD_LIBRARY_PATH' environment variable
         during execution
       - use the `-RLIBDIR' linker flag

    See any operating system documentation about shared libraries for
    more information, such as the ld(1) and ld.so(8) manual pages.
    ============================================================

    So you’ll need to do the following or the gtk build will fail.

    For bash:
    export LD_LIBRARY_PATH=/usr/local/lib

    For csh:
    setenv LD_LIBRARY_PATH /usr/local/lib

    Make/install GTK+
    GTK+is a GUI widget library very common in the Linux world. It originated from the Gimp project, a Linux graphics application along the lines of Photoshop. It is also the underlying widget set for the GNOME desktop.

    The GTK+ installation process looks like this:
    gtar -xzf  gtk+-1.2.8.tar.gz
    cd gtk+-1.2.8
    ./configure
    gmake
    sudo gmake install

    Remember, you'll see the message about LD_LIBRARY_PATH.
    Notice a pattern here? It's really not that bad building from source—most of the time. You'll hit an occasional snag, but you can generally work through it with a little investigation.

    Make/install libXpm
    LibXpmis the basic X pixmap library. You'll need this library to be able to manipulate and use color pixmaps.

    The install process goes like this:
    gtar -xzf xpm-3.4k.tar.gz
    cd xpm-3.4k
    sudo ln -s /usr/ccs/bin/ranlib ranlib
    gmake -f Makefile.noX  CC=gcc
    sudo mkdir /usr/local/lib/X11
    sudo gmake -f Makefile.noX  CC=gcc install
    sudo mkdir /usr/local/man/manl
    sudo gmake -f Makefile.noX  CC=gcc install.man


    The tarball is set up to create a makefile using xmkmf, which I did not find on my Solaris box, so I used -f Makefile.noX in order to use the provided file. The CC=gcc command simply ensures that we use Gnu's gcc and not the Solaris cc in /usr/ccs/bin.

    Make/install Gnu’s gettext
    Gnu’s gettext is a set of tools that provide a framework within which other free packages may produce multilingual messages. This provides XFce multi-language support.

    The install process? No problem.
    gtar -xzf gettext-0.10.35.tar.gz
    cd gettext-0.10.35
    ./configure
    gmake
    sudo gmake install


    Make/install Imlib
    Lmlibis a fast graphics and image library. In some respects, it replaces libXpm, but I'll go ahead and install both. Installing Imlib is as simple as this:
    gtar -xzf imlib-1.9.8.tar.gz
    cd imlib-1.9.8
    ./configure
    gmake
    sudo gmake install


    Make/install zlib
    Zlibis a compression/decompression library. You need it for PNG graphics. Zlib is installed with these commands:
    gtar -xzf zlib.tar.gz
    cd zlib-1.1.3
    ./configure
    gmake
    sudo gmake install


    Make/install libpng
    Libpngis for support of the PNG graphics format, which most UNIX folks use now instead of the gif format owned by Unisys. For this one, you do not want LD_LIBRARY_PATH set, so type the following:
    unset  LD_LIBRARY_PATH
    followed by:
    gtar -xzf libpng-1.0.8.tar.gz
    cd libpng-1.0.8
    cp scripts/makefile.solaris Makefile
    gmake CC=gcc LD=/usr/ccs/bin/ld
    gmake test
    sudo gmake install


    Define CC, and this time LD, to ensure that you use /usr/ccs/bin/ld and not /usr/ucb/ld.

    Make/install libjpeg and the jpeg libraries
    Jpeg is another graphics format, generally used for photographic images. Jpeg is installed by simply running these commands:
    gtar -xzf jpegsrc.v6b.tar.gz
    ./configure
    gmake
    sudo gmake install
    sudo gmake install-lib


    Make/install libtiff:
    Tiff is yet another graphics format used in publishing and sometimes as an interim format in fax conversion. Install tiff with these commands:
    gtar -xzf tiff-v3.5.5.tar.gz
    cd tiff-v3.5.5
    ./configure
    gmake
    sudo gmake install


    Finally…building XFce
    Okay, are you still with me? Now that I have all the support files in place, I can build XFce. All this may have seemed like a lot of hassle, but I've just built a nice set of libraries I can use down the road to build a number of things.

    I build XFce with these commands:
    gtar -xzf xfce-3.5.2.tar.gz
    cd xfce-3.5.2
    export LD_LIBRARY_PATH=/usr/local/lib


    The install of libxpm.a in /usr/local/X11/lib seems to be a problem, so I linked it to /usr/local/lib (as root) with this:
    cd /usr/local/lib
    ln -s X11/libXpm.a libXpm.a


    I want to strip the applications too, so let’s add a symlink to /usr/ccs/bin/strip (as root) with this:
    cd /usr/local/bin
    ln -s /usr/ccs/bin/strip strip
    ./configure —prefix=/usr/local —datadir=/usr/local/share —enable-dt
    gmake
    sudo gmake install-strip


    The —prefix option ensures that you install in /usr/local with your other add-ons, and —datadir is where the backdrops, sounds, and other XFce options will reside.

    Install-stripruns strip, which strips off symbols from object files, reducing their size. The —enable-dt option will add XFce as a choice in Sun's GUI X login: dtlogin.

    Setting up XFce
    Any user who wants to run XFce should issue the command
    xfce_setup

    This sets up the base directory structure, per user. If you want to use this as a global configuration, you could add it to /etc/skel.

    You'll also want to add the LD_LIBRARY_PATH environment in .dtprofile in the user's home directory, as shown here:
    LD_LIBRARY_PATH=/usr/local/lib
    export LD_LIBRARY_PATH


    Again, you could make this effective for new users by editing the files in /etc/skel.

    You can now add the additional themes and graphics.
    sudo cp Argon_XFce_Palettes.tar.gz /usr/local/share/xfce/
    cd /usr/local/share/xfce/
    sudo gtar -xzf Argon_Xfce_Palettes.tar.gz
    sudo rm Argon_Xfce_Palettes.tar.gz


    If you click on the palette in the XFce main panel, you can increase the font size from the default 10 to 12 to make things a bit easier to read at the 1152x900 resolution at which the SPARCstation 20 runs.

    Okay, XFce is all set up graphically. It's much like CDE, with the control panel at the bottom, a file browser (Xftree), and a window pager (Xfpager). XFce also has support for GNOME applications, but I won't get into that in this Daily Drill Down.

    Configuring XFce
    Now that I have the new window manager running, let's enable sound events. First we install sox.
    gtar -xzf sox-12.17.tar.gz
    cd sox-12.17
    ./configure
    gmake
    sudo gmake install


    To use audio with XFce, edit the shell script xfplay in /usr/local/bin, replacing the existing line
    exec sox $1 -t ossdsp /dev/dsp

    with the following:
    exec /usr/local/bin/sox $1 -t au /dev/audio

    Just place a # character in front of the old line.

    You may need to run /usr/openwin/bin/audiocontrol to set the appropriate output device and volume. I went ahead and added a command on the XFce main panel for it. Then, either click the desktop and select Sound or select it from the main panel. You should also click the palette icon on the main panel and make sure that xfsound is launched at startup.

    Building a console
    Finally, I'll build rxvt, a much slimmer terminal program with some nice graphical features.
    gtar -xzf rxvt-2.6.0.tar.gz
    cd rxvt-2.6.0


    If you're already running XFce, your LD_LIBRARY_PATH is set; otherwise, you'll need to set it again like this:
    ./configure —enable-xpm-background —enable-transparency \
    —enable-next-scroll —enable-half-shadow gmake
    gmake clock  (yet another clock app!)
    sudo gmake install


    You can launch rxvt with a number of options; here are a couple of the ones I like:
    rxvt -pixmap /usr/local/share/xfce/backdrops/Space.xpm \
    -fn fixed -bg black -fg white


    This sets a night sky-type background pixmap, with a fixed font and white text on a black background.

    This option selects a quasi-transparent background with the same font features:
    rxvt -fn fixed -bg black -fg white –tr

    Many different option combinations are possible.
    The command rxvt -h lists the choices.
    That's it! Figure D shows the default CDE desktop, and Figure E shows my new improved XFce desktop.

    Figure D
    The CDE desktop


    Figure E
    The XFce desktop


    You'll also notice from the two listings below that you get all the eye-candy but lower memory consumption than from the default CDE desktop, so you have more resources available for your Web server and database server. It's not a big difference, and chances are if you were running services on the box, you wouldn’t be running X at all, but it helps. Rxvt is a big saver compared to dtterm. XFce, with all its components, is probably about the same as CDE, but a bit nicer looking in my opinion. The primary limitation at this point is in color allocation. The older SPARCstations have only 8-bit frame buffer cards, so you’re limited to 256 colors. There are better cards, but they’re somewhat expensive. For the SPARCstation 20, you can add a 4-MB or 8-MB VSIMM for about $50 to $100 and use the on-board frame buffer, which will give you 24-bit color.

    Here’s the listing for CDE:
    CDE:
    last pid:  1030;  load averages:  0.58,  0.30,  0.25    10:54:19
    46 processes:  45 sleeping, 1 on cpu

    Memory: 160M real, 68M free, 28M swap in use, 402M swap free

       PID USERNAME THR PRI NICE  SIZE   RES STATE   TIME  CPU COMMAND
      1006 stew       8  59    0 8156K 6528K sleep   0:05  4.48% dtwm
       918  root      1  59    0 9644K 6456K sleep   0:06  3.36% Xsun
      1030 stew       1  10    0 1440K  980K cpu/2   0:00  1.91% top
      1009 stew       1  59    0 6552K 4616K sleep   0:01  0.97% sdtperfmeter

      1007 stew       1  43    0 6620K 4496K sleep   0:00  0.91% dtterm
      1000 stew       1  45    0 6632K 4380K sleep   0:00  0.42% dtsession
       999  stew      5  59    0 4048K 3000K sleep   0:00  0.36% ttsession
       937  stew      1  59    0 1724K 1104K sleep   0:00  0.27% Xsession
      1022 stew       1  52    0 2324K 1572K sleep   0:00  0.27% bash


    And here’s the listing for XFce:
    XFce:

    last pid:   903;  load averages:  0.20,  0.19,  0.21    10:52:48
    50 processes:  49 sleeping, 1 on cpu

    Memory: 160M real, 72M free, 27M swap in use, 403M swap free

       PID USERNAME THR PRI NICE SIZE   RES STATE   TIME  CPU COMMAND
       903 stew      1  30    0 1440K  988K cpu/0   0:00  1.94% top
       783 root      1  59    0 9596K 6380K sleep   0:09  0.23% Xsun
       884 stew      1  58    0 2340K 1640K sleep   0:00  0.08% bash
       876 stew      1  49    0 5776K 4808K sleep   0:08  0.07% xfce
       872 stew      1  51    0 2988K 2124K sleep   0:03  0.03% xfwm
       879 stew      1  59    0 2216K 1660K sleep   0:00  0.01% rxvt
       870 stew      4  59    0 4044K 2992K sleep   0:00  0.00% ttsession
       802 stew      1  10    0 1684K 1064K sleep   0:00  0.00% Xsession.xfce


    Installing Gimp
    Finally, now that you have gtk and the graphics libraries, you can make and install Gimp, the premier graphics program in the Linux world. Grab the following files:

    You’ll need Gtk-Perl for some of the Gimp's scripting functions:
    gtar -xzf Gtk-Perl-0.6123.tar.gz
    cd Gtk-Perl-0.6123
    perl Makefile.PL
    gmake test
    sudo gmake install


    And now I’ll build Gimp itself. (I should warn you, on my SPARCstation 20, this took several hours to build.)
    gtar -tzf gimp-1.1.29.tar.gz
    cd gimp-1.1.29
    ./configure
    gmake
    sudo gmake install-strip


    This fails before installing some important scripts, so you must issue this command to finish:
    sudo gmake install-am

    Thedata-extras command adds additional textures, brush shapes, and other features.
    gtar -xzf gimp-data-extras-1.1.29.tar.gz
    cd gimp-data-extras-1.1.29
    ./configure
    gmake
    sudo gmake install


    And, if you're going to be getting into graphics, you may as well add some quality fonts.
    cd /usr/openwin/lib/X11/fonts
    sudo cp /home/stew/build/ sharefonts-0.10.tar.gz .
    sudo cp /home/stew/buildfreefonts-0.10.tar.gz .
    sudo gtar -xzf sharefonts-0.10.tar.gz
    sudo gtar -xzf freefonts-0.10.tar.gz
    sudo rm sharefonts-0.10.tar.gz freefonts-0.10.tar.gz


    To make the fonts available, issue these commands:
    /usr/openwin/bin/xset fp+ /usr/openwin/lib/X11/fonts/sharefont/
    /usr/openwin/bin/xset fp+ /usr/openwin/lib/X11/fonts/freefont/
    /usr/openwin/bin/xset fp rehash


    To make the changes permanent, add the above lines to .xinitrc in your home directory for XFce only. Otherwise, edit .dtprofile in your home directory if you want them available in CDE also. Again, to activate the program for new users, edit the files in /etc/skel.

    You'll want to add /usr/local/man to your MANPATH variable. Add the following to your .bashrc or .profile file:
    export MANPATH=$MANPATH:/usr/local/man  (for bash)
    setenv MANPATH $MANPATH:/usr/local/man (for csh)


    It seems that Sun's X server does not allow the use of the X shared memory extension, so you should start Gimp with the following:
    gimp —no-xshm

    You can modify the command on the XFce control panel. The first time you run Gimp, you will be informed that a default directory structure will be set up in your home directory for your personal Gimp configuration and options. The first startup was rather slow on my machine, but subsequent launches were a bit faster. There is a nice on-line introductory guide to Gimp at the Gimp Savvy site.

    Lastly, let's set up xscreensaver for some fancier screensavers. You can download it from the Official Xscreensaver site.

    Unpack it and install it with these commands:
    gtar -xzf xscreensaver-3.25.tar.gz
    cd xscreensaver-3.25
    ./configure
    gmake
    sudo gmake install


    You now have somewhere shy of 100 screensaver options, instead of the few that come standard with Solaris.

    Conclusion
    Let your Linux friends go on about their whiz-bang desktops, you now have bragging rights, too. XFce is light enough that you can still do useful work on your older SPARCstation while it’s running. With Gimp, you have the tools to do some pretty extensive image editing, as well as some automated scripts to create things like Web page logos and other graphics. Under the hood, you still have the maturity of Solaris.

    In this Daily Drill Down, I've also taught you a bit about the ins and outs of compiling and installing source code on a Solaris box, which isn't too bad once you have the right tools in place.
    The authors and editors have taken care in preparation of the content contained herein but make no expressed or implied warranty of any kind and assume no responsibility for errors or omissions. No liability is assumed for any damages. Always have a verified backup before making any changes.

    Editor's Picks

    Free Newsletters, In your Inbox