From: lam@wk95.nas.nasa.gov (Tai L. Lam)
Subject: Motif.tmpl
Organization: NAS, NASA Ames Research Center, Moffett Field, CA
Date: Tue, 29 Sep 92 22:54:21 GMT

I am building the OSF/Motif but I run into a problem.  I would like 
to get some help from some of the Xpert users in this newsgroup.

I compiled and installed motif 1.1.4 on a sun 4, everything completed 
without a complaint.  I copied the demos/dogs to my home directory for 
testing. Then, I ran into this problem. This is a log of my work:

  ==============================
  troll.lam 91> xmkmf
  mv Makefile Makefile.bak
  imake -DUseInstalled -I/usr/lib/X11/config
  troll.lam 92> make
  rm -f dogs
  cc -o dogs -O -D_NO_PROTO -DSTRINGS_ALIGNED -DNO_REGEX -DNO_ISDIR -DUSE_RE_COMP-DUSE_GETWD dogs.o Dog.o Square.o ./lib/Mrm/libMrm.a ./lib/Xm/libXm.a    -lXt -lX11
  ld: ./lib/Mrm/libMrm.a: No such file or directory
  *** Error code 4
  make: Fatal error: Command failed for target `dogs'
  ======================

The ./dogs/Imakefile looks like this:

  -------------------------------------------------------------------------
  INCLUDES = -I. -I$(UILSRC) -I$(MTOOLKITSRC) -I$(LIBSRC)
  LOCAL_LIBRARIES = $(MRESOURCELIB) $(XMLIB)
  SRCS1=  dogs.c Dog.c Square.c
  OBJS1=  dogs.o Dog.o Square.o
  UILS1= dogs.uil
  PROGRAMS = dogs
  NormalLibraryObjectRule()
  ComplexProgramTarget_1(dogs,$(LOCAL_LIBRARIES), $(SYSLIBS))
  MComplexUidTarget_1(dogs)
  DependTarget()
  -------------------------------------------------------------------------

A segment of the installed /usr/lib/X11/config/Motif.tmpl looks like this:

  -------------------------------------------------------------------------
  #ifndef UsrIncDir
  #define UsrIncDir $(DESTDIR)/usr/include
  #endif
      USRINCDIR = UsrIncDir
        TESTSRC = $(TOP)/tests
    MTOOLKITSRC = $(LIBSRC)/Xt
     MWIDGETSRC = $(LIBSRC)/Xm
   MRESOURCESRC = $(LIBSRC)/Mrm
         UILSRC = $(CLIENTSRC)/uil
            UIL = $(UILSRC)/uil
      XMTOOLLIB = $(MTOOLKITSRC)/libXt.a
          XMLIB = $(MWIDGETSRC)/libXm.a
   MRESOURCELIB = $(MRESOURCESRC)/libMrm.a
         UILLIB = $(UILSRC)/libUil.a
  ----------------------------------------------------------------------------

Make complained that 

	ld: ./lib/Mrm/libMrm.a: No such file or directory

A know that my problem comes from Motif.tmpl. It is because Motif.tmpl 
points everything (XMLIB = $(MWIDGETSRC)/libXm.a) back to the actual 
source tree but I am compiling the demos outside the source tree.  Therefore, 
./lib/Mrm/libMrm.a is not found.  I don't believe that the motif source is
required to reside on the system once motif is installed.  
I checked on the SGI Motif.tmpls file, they have 

	XMLIB = -lXm

Am I suppose to do the same?

I modified my Motif.tmpl as below. I have seen the same approach in the 
Project.tmpl file.
-------------------------------------------------------------------------
#ifdef UseInstalled
#define _Use(a,b) a
#else
#define _Use(a,b) b
#endif

            UIL = _Use($(BINDIR), $(UILSRC))/uil
      XMTOOLLIB = _Use($(USLLIBDIR), $(MTOOLKITSRC))/libXt.a
          XMLIB = _Use($(USRLIBDIR), $(MWIDGETSRC))/libXm.a
   MRESOURCELIB = _Use($(USRLIBDIR), $(MRESOURCESRC))/libMrm.a
DEPMRESOURCELIB = _Use($(USRLIBDIR), $(MRESOURCESRC))/libMrm.a
         UILLIB = _Use($(USRLIBSIR), $(UILSRC))/libUil.a

---------------------------------------------------------------------

My questions are:

	What have I done wrong in my installation?
	How do I fix it?
	Do I need to have a different Motif.tmpl for installation?
	If yes, is the above approach correct?
	

I hope that some of the Xpert users in this news group can help me out.

Thanks in advance.


Terance Lam
NASA Ames

Newsgroups: comp.windows.x.motif