Search the FAQ Archives

3 - A - B - C - D - E - F - G - H - I - J - K - L - M
N - O - P - Q - R - S - T - U - V - W - X - Y - Z - Internet FAQ Archives

Motif FAQ (Part 7 of 9)
Section - 239) How do I build Motif 1.2.2 on Solaris 2.1 with Sun C?

( Part1 - Part2 - Part3 - Part4 - Part5 - Part6 - Part7 - Part8 - Part9 - Single Page )
[ Usenet FAQs | Web FAQs | Documents | RFC Index | Sex offenders ]

Top Document: Motif FAQ (Part 7 of 9)
Previous Document: 238) Is it easy to build Motif for a Sun?
Next Document: 240) What compile errors/warnings might I get in both Sun 3 and Sun
See reader questions & answers on this topic! - Help others by sharing your knowledge
[Last modified: Oct 94]

Prepared by Ric Steinberger.  4/09/93

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 ( for several useful
suggestions.  Other people, including OSF staff, especially David Brooks
(, helped as well.  My thanks to you all.

1. Build X11R5 from the mit distribution.  You need to retrieve the sources
from (in pub/R5) and patches 1 - 22 (or fixes 1-26) pub/R5/fixes).
There are several other sites that contain the X11R5 sources.  After
installing patch 19, apply PEXlib.tar.Z, also available from 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-7300).  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.  Some of the changes
are based on R5.SunOS5.patch files.  A complete set of config files relevant
to Solaris have been placed in the anon-ftp account of in
pub/motif/solaris21-motif122-config.tar.Z.  They are also available from OSF
on their mail response server (available to support contract holders) and they
will send them directly to full support contract holders.  Decompress and
untar this file in your Motif config subdirectory.  Copy site.def.sample to
site.def, then edit site.def.  You will probably want to uncomment the
ProjectRoot section and use the same value used in your X11R5 build.  Also,
you will probably want to use /usr/ucb/install in you installed the UCB
compatibility suite.  Otherwise you might want to use the install supplied at
the end of this memo.  [I used the UCB version and can't swear that this
works.  Bit it should.  Put it someplace like /usr/local/bin and chmod +x it.]

There are two patches to consider.  One fixes a cursor problem in
./lib/Xm/TextF.c.  The other removes a Berkeleyism.  These patches should
probably be consider unofficial at present.  Failure to deal with the
Berkeleyism (bzero) means you will need to link with -lucb -lelf.  This will
probably work, but why bother?  Furthermore, if you move the Motif binaries to
a machine without the ucb compatability suite, you won't have the sharable
libs you need.

[The actual patches have been censored because they contain OSF source code]

Patch 1: In TextF.c there are several places _XmTextFieldDrawInsertionPoint is
called. These should be moved two or three lines further down *after* the "if
(!XtIsRealized(tf)) return True;" statement.

patch 2: The call to bzero in lib/Xm/Visual.c should be replaced by the
equivalent call to memset

Both these patches can be applied in the ./lib/Xm directory.  If you don't
have the patch program (how did you build X11?), you can get it in the
vendor/cygnus directory of, or you can build it from source.  Be
sure to get the latest version (2.0.12.u8).

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 be
replaced by SEEK_END.  SEEK_END is in stdio.h.  These two fixes will allow
motifshell to build.  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.] 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!).

# .xinitrc - OpenWindows startup script.
if [ -f $HOME/.Xdefaults ]; then
xrdb $HOME/.Xdefaults              # Load Users X11 resource database
if [ -f $HOME/.Xdefaults.sun ]; then
xrdb -merge $HOME/.Xdefaults.sun
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

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:
/usr/openwin/lib.  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 to be "picked up" from elsewhere, like /usr/X11R5/lib, but the
one emacs links with is, and the mit one is  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.]

User Contributions:

Comment about this article, ask questions, or add new information about this topic:


Top Document: Motif FAQ (Part 7 of 9)
Previous Document: 238) Is it easy to build Motif for a Sun?
Next Document: 240) What compile errors/warnings might I get in both Sun 3 and Sun

Part1 - Part2 - Part3 - Part4 - Part5 - Part6 - Part7 - Part8 - Part9 - Single Page

[ Usenet FAQs | Web FAQs | Documents | RFC Index ]

Send corrections/additions to the FAQ Maintainer: (Ken Lee)

Last Update March 27 2014 @ 02:11 PM