Subject: Re: Compiling XMCD
To: None <port-mac68k@netbsd.org>
From: John Valdes <valdes@macavity.uchicago.edu>
List: port-mac68k
Date: 06/25/1999 12:04:50
Stephen Eastman writes:
> I am attempting to compile xmcd 1.5 and am configuring the make.inc
> file.

If you want to build it on your own, rather than use the already built 2.4
xmcd package, you should instead use imake (Imakefiles and xmkmf) rather
editing make.inc.

Note that in order to build xmcd, you'll first need to install lesstif
and optionally ncurses if you want to run cda in "visual" mode.  I
believe both are in the pkg system (else you can compile those as well).

Once you have lesstif and ncurses installed, simply follow the
instructions in docs_d/INSTALL.  Before running xmkmf and 'make
Makefiles', you'll need to edit two Imakefiles, cda_d/Imakefile and
xmcd_d/Imakefile.

You need to change cda_d/Imakefile so that it compiles cda w/ visual
support and so that it can find the ncurses library.  This involves 3
changes.  In the DEFINES section, change:

  #if defined(NetBSDArchitecture) || defined(__bsdi__)
  DEFINES= -DBSDCOMPAT -DNOVISUAL -DUSE_TERMIOS

to

  #if defined(NetBSDArchitecture) || defined(__bsdi__)
  DEFINES= -DBSDCOMPAT -DUSE_TERMIOS

(ie, delete the '-DNOVISUAL' define).  In the STD_INCLUDES section,
add the appropriate -I option to that the compiler can find the
ncurses include files, eg:

  #else   /* all others */
  STD_INCLUDES=-I/usr/local/include/ncurses

Finally, in the LOCAL_LIBRARIES you'll need to add options so that the
linker can find the ncurses library.  Depending on where it's
installed, you may also need to and -L and -R options, eg:

  #if defined(NetBSDArchitecture) || defined(__bsdi__)
  LOCAL_LIBRARIES=-L/usr/local/lib -R/usr/lib:/usr/local/lib -lncurses

You'll need to make a similar change to xmcd_d/Imakefile so that it can
find your lesstif (Motif) library.  Change the line:

  /*
   * #include "Motif.tmpl"
   * #include "Motif.rules"
   */
  LOCAL_LIBRARIES= XmClientLibs

to, eg,

  LOCAL_LIBRARIES=-L/usr/local/lib \
  -R/usr/lib:/usr/X11R6/lib:/usr/local/lib -lXm -lXt -lSM -lICE -lX11

(if your lesstif library is in /usr/X11R6/lib, you can leave out the
-L and -R options).  Likewise, if your lesstif headers aren't in a
standard location (eg, /usr/X11R6/include/X11/Xm), you'll need to add
a -I option to the INCLUDES definition, eg:

  /*
   * Add local include path
   */
  INCLUDES=-I.. -I/usr/local/include


With those changes, you should be able to compile xmcd w/

 1) xmkmf
 2) make Makefiles
 3) make

Hope this helps,

John