Motif 1.2.2 & Solaris 2.1 Build summary

2007-12-25 8:10:00

Several people have asked me to post a summary of what I needed to do

to build motif 1.2.2 on a Solaris 2.1 system. Here is that summary.

It is available via anon-ftp on updike.sri.com. [If I make changes

to it, I will update that file.]

===============================================================================

Prepared by Ric Steinberger. ric@updike.sri.com 3/26/93

Available via anon-ftp on updike.sri.com

What follows is a description of the steps I used to build Motif 1.2.2

on a SUN IPX running Solaris 2.1. Sun's C compiler (2.0.1) was used.

Many thanks go to Kaleb Keithley (kaleb@devvax.jpl.nasa.gov) for several

useful suggestions. Other people, including OSF staff, too numerous to

name helped as well. My thanks to you all.

1. Build X11R5 from the mit distribution. You need to retrieve the sources

   from export.lcs.mit.edu (in pub/R5) and patches 1 - 22 (or 23) (in

   pub/R5/fixes). There are several other sites that contain the X11R5

   sources. After installing patch 19, apply PEXlib.tar.Z, also available

   from export.lcs.mit.edu in pub/R5/fixes. You can apply also

   R5.Xsun.multi-screen and R5.SunOS5.patch. There are .README files

   that explain how to patch. Be SURE to read

   R5.SunOS5.patch.README for details on how to BUILD X11. You probably

   want to use the ProjectRoot feature in the site.def file in the

   mit/config directory. You will NEED to edit that file to do that.

2. Obtain the Motif 1.2.2 distribution from OSF (617-621-8700). You may

   need to first install the 1.2 tape, then the 1.2.1 and finally the

   1.2.2 tape. You might want to do a "chmod -R u+w ." after unloading

   each tape.

3. In the config directory, there are several changes I made. I don't

   claim that they are ALL necessary or appropriate and would welcome

   feedback on this. In cases where I refer to files from the

   R5.SunOS5.patch, if you build the mit X11R5 after you applied

   this patch, the files will be in the mit/config directory.

   a) Change the site.def file so ProjectRoot is used. Just uncomment

      the last part of the file. Use the same ProjectRoot as you used

      for the mit X11 build/install.

   b) Modify Motif.tmpl:

        #ifndef XmExtraLibraries

        #if defined(SystemV4) && defined(SparcArchitecture)

        /* #define XmExtraLibraries -lgen

        #define XmExtraLibraries -lgen -lucb -lelf

        #else

        #define XmExtraLibraries /**/

        #endif

        #endif

        This goes after the /* Place to install .uid files */ lines.

        Note that I needed to use the ucb and elf libs. After discussions

        with Kaleb Keithley, I'm not sure how I might have avoided this,

        given that I built mit X11 with all the above-mentioned patches.

        I agree that ucb compatability modes should be avoided whenever

        possible. Perhaps I misunderstood some of Kaleb's comments.

        I had LD_LIBRARY_PATH set to:

        /opt/SUNWspro/lib:/usr/ccs/lib:/usr/ucblib:/usr/X11R5/lib:/usr/lib:

        /usr/openwin/lib

        [The first entry is somewhat bogus. The SUN C compiler install

         document tells you to do it, but that directory doesn't even

         exist!]

        

   c) Use the sun.cf from the R5.SunOS5.patch. Add

        #define MotifDefines -DSTRINGS_ALIGNED -DNO_REGCOMP -DINCLUDE_ALLOCA_H

   d) Use the sunLib.rules from OSF or the R5.SunOS5.patch. They appear

        to be the same.

   e) Use the sunLib.tmpl from the R5.SunOS5.patch

   f) Use the sv4Lib.rules from the R5.SunOS5.patch. Remove the symbol:

        LdRunPath. It seems to have been put there instead of something

        like $$(LD_RUN_PATH).

   g) Use the sv4Lib.tmpl file from the R5.SunOS5.patch.

4) Use the README-1.2.1 file as a guideline for building motif. I followed

   directions in the section called, "Using X11R5 Installed Libraries

   and Header Files." If you make a mistake after your first build

   attempt, copy Makefile.ini to Makefile before retrying. You may

   need to do this in the config subdirectory too, depending on what

   went wrong.

5) After make Makefiles, do make includes, make depend, then make (or

   as OSF recommends, make -k). This gets as far as motifshell in the

   demos, which fails to build because O_RDONLY and L_XTND are

   not defined. O_RDONLY is in fcntl.h (actually <sys/fcntl.h>, but

   fcntl.h includes this.) L_XTND can allegedly be replaced by SEEK_END.

   I haven't tried these yet. Note: many MANY compiler warning messages

   will be generated during the build process.

6) You can go to the demos/xmsamplers directory and do a make there.

   Other demos may build, or not depending on whatever. . . .

7) make install will do the install. [It will fail at motifshell

   if you don't fix it, as mentioned above.] You can do a make install

   in demos/xmsamplers if you want these.

8) If running on a SUN (as opposed to an X term), you will (probably) need

   to start openwin with something like:

        openwin -server /usr/X11R5/bin/Xsun

   [You might want to use an alias for this. Maybe add -escape too.]

   This fixes an annoying problem: The mouse keys stop working after you

   click on an icon to get the icon menu (on SUNs only, not X terms).

   The ALT keys still work, if you get stuck. I don't know whether this

   is a bug in SUN's server or whether it is Motif related.

   Here is a copy of my .xinitrc: It's not elegant. Sun's default

   openwin startup file is in: /usr/openwin/lib/Xinitrc. You can

   copy this to ~/.xinitrc and customize as desired. Obviously, the

   default behavior is to start the OpenLook environment (boo!).

#!/bin/sh

#

# .xinitrc - OpenWindows startup script.

#

if [ -f $HOME/.Xdefaults ]; then

    xrdb $HOME/.Xdefaults # Load Users X11 resource database

fi

if [ -f $HOME/.Xdefaults.sun ]; then

    xrdb -merge $HOME/.Xdefaults.sun

fi

DISPLAY=`hostname`:0.0

export DISPLAY

xhost + > /dev/null

#xterm -sb -sl 512 -T `hostname` -ls -n `hostname` &

xterm -sb -sl 512 -T `hostname` -n `hostname` &

mwm &

xclock -geometry +1010+0 &

xload -geometry +710+5 -fg red &

xsetroot -solid salmon &

xterm -sb -sl 100 -T CONSOLE_DO_NOT_LOGOUT -C -n console -iconic

#wait

Here's .Xdefaults.sun, which gives me a more readable font for use with

motif on Sun monitors:

!Some additional .Xdefaults values specifically for SUN

!

! After loading .Xdefaults, xrdb -merge .Xdefaults.sun

!

Mwm*fontList: 8x16

!Mwm*fontList: vtbold

!Change as desired.

You will probably want to maintain LD_LIBRARY_PATH to something like,

if not identical to, the value suggested above. If you use emacs,

you will need to leave /usr/openwin/lib there. [This is because you probably,

like me, used the distributed version of s-sol2.h, which explicitly

refers to windowing libraries as being in the /usr/openwin locations.

Yes, I know that emacs/Solaris ought to allow LibXt.so.N.M to be

"picked up" from elsewhere, like /usr/X11R5/lib, but the one emacs links

with is LibXt.so.4.something, and the mit one is LibXt.so.5.something.

So it seems to want the .4 one. Any comments? I'd prefer not to

rebuild emacs based on the X11R5 libs because I occassionally need to

move the emacs binaries to machines without the mit files.]

Comments

Got something to say?

You must be logged in to post a comment.