[comp.windows.x] Makefile problem with contrib clients

weening@Gang-of-Four.Stanford.EDU (Joe Weening) (01/08/90)

The makefiles that I get with "xmkmf" for contrib clients have a
problem with library dependencies.  Here's what I'm doing:

  (The MIT libraries and clients have all been installed in the
  standard locations.)

  % cd /src/X11R4/contrib/clients/xrn
  % xmkmf
  mv Makefile Makefile.bak
  imake -DUseInstalled -I/usr/lib/X11/config
  % make
  ... all the sources are compiled with no problems ...
  Make:  Don't know how to make -lXaw.  Stop.
  % 

It is fairly easy to see what the problem is, by looking in the
Makefile.  It includes the lines:

           XAWLIB = 			  -lXaw
          DEPLIBS = $(LOCAL_LIBRARIES)
  LOCAL_LIBRARIES = $(XAWLIB) $(XMULIB) $(XTOOLLIB) $(XLIB)

xrn: $(OBJS) $(DEPLIBS)
	 $(RM) $@
	$(CC) -o $@ $(OBJS) $(LDOPTIONS) $(LOCAL_LIBRARIES) $(LDLIBS) $(EXTRA_LOAD_FLAGS)


So "xrn" eventually depends on "-lXaw", which make doesn't know about.
This problem is the result of -DUseInstalled, since it doesn't affect
the MIT clients.
--
Joe Weening                                Computer Science Dept.
weening@Gang-of-Four.Stanford.EDU          Stanford University

rws@EXPO.LCS.MIT.EDU (Bob Scheifler) (01/08/90)

    So "xrn" eventually depends on "-lXaw", which make doesn't know about.
    This problem is the result of -DUseInstalled, since it doesn't affect
    the MIT clients.

Not exactly.  It's a result of a change from R3 to R4, separating out
"libraries" from "dependencies".  The MIT client Imakefiles define both
DEPLIBS and LOCAL_LIBRARIES explicitly, e.g.

        DEPLIBS = XawClientDepLibs
LOCAL_LIBRARIES = XawClientLibs

or more verbosely,

        DEPLIBS = $(DEPXAWLIB) $(DEPXMULIB) $(DEPXTOOLLIB) $(DEPXLIB)
LOCAL_LIBRARIES = $(XAWLIB) $(XMULIB) $(XTOOLLIB) $(XLIB)

In config/Project.tmpl there is a fallback hack for when DEPLIBS isn't
defined, to use LOCAL_LIBRARIES instead (unless shared libraries are used).
Clearly, this doesn't work perfectly.

Change xrn's Imakefile to use one of the above two forms.