#ifndef XCOMM
#ifdef GNUCPP
#define XCOMM \#
#else
#define XCOMM #
#endif
#endif

XCOMM##########################################################################
XCOMM##########################################################################
XCOMM#####	ONLY for Vax Motif 1.1 / X11r4
XCOMM##########################################################################
XCOMM##########################################################################


XCOMM###########################################################################
XCOMM# Wc.tmpl:  Makefile defines for Widget Creation Library
XCOMM# 
XCOMM# Author:		David E. Smyth
XCOMM# SCCS_data:	%Z% %M%	%I% %E% %U%
XCOMM###########################################################################

/******************************************************************************
** There are three sections:
** First section:  Almost all sites must set some values.
** Second section: A few sites must set some values.
** Third section:  I think no sites need to set any values.
*/


/*#############################################################################
**#############################################################################
** First section:  Almost all sites must set some values.
**#############################################################################
**###########################################################################**/

/******************************************************************************
** Release level of your Imake, X and Xt system:
** 30 = X11R3					
** 35 = Motif 1.0 release of Xt Intrinsics
** 40 = X11R4 where XtNameToWidget barfs on Gadgets (early patch levels)
** 41 = X11R4 with fixed XtNameToWidget
** 50 = X11R5
*/
#define XRelease 41

/* Solaris needs this: */
#ifdef SOLARIS
#undef HasGcc
#define HasGcc 1
     OPENWINHOME=/usr/openwin
     MKDIRHIER=/usr/openwin/bin/mkdirhier
#endif

XCOMM These added to make compiling/installing work right on Athena

BUILDINCTOP=/mit/wcl/build/`machtype`/include
BUILDINCDIR=$(BUILDINCTOP)/X11
WCLINSTALLTOP=/mit/wcl/wcl25
BINDIR=$(WCLINSTALLTOP)/bin
USRLIBDIR=$(WCLINSTALLTOP)/lib
MANPATH=$(WCLINSTALLTOP)/man
INCROOT=$(WCLINSTALLTOP)/include
XAPPLOADDIR=$(WCLINSTALLTOP)/app-defaults
MKDIRHIER=mkdirhier

/******************************************************************************
** Which flavors of libraries do you need?  Shared library systems by default
** do not build normal libraries, so you must ask for them if you need them.
*/
#define ForceNormalLibs YES
#define MakeDebugLibs   YES
#define MakeProfileLibs YES

/******************************************************************************
** Widget Libraries you have available
*/
#ifdef VaxArchitecture
#define HaveAthenaWidgetSet    NO
#else
#define HaveAthenaWidgetSet   YES
#endif
#define HaveMotifWidgetSet    YES
#define HaveMotifHacks        NO
#define HaveOpenLookWidgetSet NO

/******************************************************************************
** Special Flags for compiling files which use widget libraries
** (Your Imake installation may take care of these flags already).
**
** XpLibraryOptions	cc flags passed to files using Athena widgets
** XmpLibraryOptions	cc flags passed to files using Motif widgets
** XopLibraryOptions	cc flags passed to files using OpenLook widgets
** DebugClientOptions	cc flags passed to build Test.o files.  Note that
**			if you have debug versions of libraries which use
**			-DXTTRACEMEMORY then you must set this here too!
**			If you have XtSetDefaultFilePredicate() and 
**			XrmTraceFiles() - but I doubt you do - then set
**			-DXTRACEFILEHACKS.
*/
#define XpLibraryOptions
#define XmpLibraryOptions -D_NO_PROTO
#define XopLibraryOptions -I/usr/openwin/include -I/usr/openwin/include/Xol
#define DebugClientOptions -g -DASSERTIONS


/*#############################################################################
**#############################################################################
** Second section: A few sites must set some values.
**#############################################################################
**###########################################################################**/

/******************************************************************************
** If your system supports dynamic linking as SVR4 or SunOS with the
** library "dl" and the include file <dlfcn.h> and the functions
** dlopen() and dlsym() and the macro RTLD_LAZY then you can use some
** wizzy dynamic linking stuff.  Unfortunately, gcc does not support this.
*/
#if defined(SVR4) || defined(SunArchitecture) && !HasGcc && !MakeProfileLibs
#define Has_dlopen_And_dlsym YES
#else
#define Has_dlopen_And_dlsym NO
#endif

/******************************************************************************
** Motif FileSelectionBox uses reg_ex or regcmp which on SVR4 is in libgen,
** on some other machines it is in libPW.   See regcmp(3)
*/
#ifdef SVR4
    REGEXLIB = -lgen
#else
#ifdef SGIArchitecture
    REGEXLIB = -lPW
#else
    REGEXLIB =
#endif
#endif

/******************************************************************************
** Debug library extension: The new X11R5 standard is to append "_d" to
** library names for the degugged versions of libraries.  Some sites use
** the older convention of appending "_g" instead.
*/
#define DebugLibraryExtension _d

DLX = DebugLibraryExtension

/******************************************************************************
** Normal and Debugged versions of widget and X libraries.  The values
** "DebugLibXaw" are usually defined in Project.tmpl.  The debugged versions
** of libraries are used to create more complete Test programs.
*/
#ifndef DebugLibXaw
#define DebugLibXaw  NO
#endif
#ifndef DebugLibXcu
#define DebugLibXcu  NO
#endif
#ifndef DebugLibXm
#define DebugLibXm   NO
#endif
#ifndef DebugLibXol
#define DebugLibXol  NO
#endif
#ifndef DebugLibXmu
#define DebugLibXmu  NO
#endif
#ifndef DebugLibXt
#define DebugLibXt   NO
#endif
#ifndef DebugLibX
#define DebugLibX    NO
#endif
#ifndef DebugLibXext
#define DebugLibXext NO
#endif

/******************************************************************************
** You usually do not have to edit these, but you may need to provide
** -L<libpath> before these.
** 
** XAWLIB, XMULIB, XTOOLLIB, EXTENSIONLIB, and XLIB are defined in
** your Imake configuration.
*/
#if DebugLibXaw
  DEBUGXAWLIB = -lXaw$(DLX)
#else
  DEBUGXAWLIB = $(XAWLIB)
#endif

     XCULIB = -lXcu
#if DebugLibXcu
DEBUGXCULIB = -lXcu$(DLX)
#else
DEBUGXCULIB = $(XCULIB)
#endif

     XMLIB = -lXm $(REGEXLIB)
#if DebugLibXm
DEBUGXMLIB = -lXm$(DLX) $(REGEXLIB)
#else
DEBUGXMLIB = $(XMLIB)
#endif

     XOLLIB = -L/usr/openwin/lib -lXol
#if DebugLibXol
DEBUGXOLLIB = -lXol$(DLX)
#else
DEBUGXOLLIB = $(XOLLIB)
#endif

#if DebugLibXmu
DEBUGXMULIB = -lXmu$(DLX)
#else
DEBUGXMULIB = $(XMULIB)
#endif

#if DebugLibXt
DEBUGXTOOLLIB = -lXt$(DLX)
#else
DEBUGXTOOLLIB = $(XTOOLLIB)
#endif

#if DebugLibXext
DEBUGXEXTLIB = -lXext$(DLX)
#else
DEBUGXEXTLIB = $(EXTENSIONLIB)
#endif

#if DebugLibX
DEBUGXLIB = $(DEBUGXEXTLIB) -lX11$(DLX)
#else
DEBUGXLIB = $(DEBUGXEXTLIB) -lX11
#endif


/******************************************************************************
** Only a very poorly configured system (like SCO) needs this.  If you get
** an error like this:
**   /usr/include/X11/Xos.h(81) : fatal error: cannot open find 'strings.h'
** then you should set this stuff up, and/or make a link in /usr/include
** from strings.h to string.h
*/
#define NeedLocal_strings_h NO
#if NeedLocal_strings_h
  GET_LOCAL_STRINGS_H = ln -s /usr/include/string.h ./strings.h
/*
  GET_LOCAL_STRINGS_H = ln /usr/include/string.h ./strings.h
  GET_LOCAL_STRINGS_H = cp /usr/include/string.h ./strings.h
*/
#endif


/*#############################################################################
**#############################################################################
** Third section:  I think no sites need to set any values.
** BUT PLEASE LOOK, you may be able to give me some suggestions...
**#############################################################################
**###########################################################################**/

#ifndef WcTopDir
#define WcTopDir .
#endif

/******************************************************************************
** Backward compatibility: X11R4 uses HasSunOSSharedLibraries, X11R5 uses
** HasSharedLibraries instead.
*/
#if XRelease < 50
#ifndef HasSharedLibraries
#ifdef HasSunOSSharedLibraries
#define HasSharedLibraries HasSunOSSharedLibraries
#else
#define HasSharedLibraries NO
#endif
#endif
#endif

/******************************************************************************
** I do not want to figure out SGI shared libraries, as they are soon going
** to SVR4 which is alot better anyway.  If someone wants to donate the
** library specification files, I will incorporate them
*/
#ifdef SGIArchitecture
#if OSMajorVersion < 4
#ifdef HasSharedLibraries
#undef HasSharedLibraries
#endif
#define HasSharedLibraries NO
#endif
#if OSMajorVersion == 4 && OSMinorVersion == 0
#ifdef HasSharedLibraries
#undef HasSharedLibraries
#endif
#define HasSharedLibraries NO
#endif
#endif /*SGIArchitecture*/

/******************************************************************************
** gcc shared libraries do NOT seem to work.
*/
#if HasGcc
#undef HasSharedLibraries
#define HasSharedLibraries NO
#undef Has_dlopen_And_dlsym
#define Has_dlopen_And_dlsym NO
#endif

/******************************************************************************
** This is used to build the Test clients.
*/
DEBUG_CLIENT_OPTIONS = DebugClientOptions

/******************************************************************************
** Extra capability is provided if your system supports dlopen() and dlsym().
** Also, another library is required by Wcl (-ldl) and a test library is
** built in the Stuff sub directory.
*/
#if Has_dlopen_And_dlsym
DYN_LINK_FLAGS = -DWC_HAS_dlopen_AND_dlsym
        DYNLIB = -ldl
       WcSTUFF = Stuff
#endif

      WCTOPDIR = WcTopDir
#ifdef VaxArchitecture
VSPRINTF_C=vsprintf.c
VSPRINTF_O=vsprintf.o
GCC_INCLUDES=-I/mit/gnu/lib/gcc-include
RANLIBINSTFLAGS=-t
#endif
EXTRA_INCLUDES = -I$(WCTOPDIR) -I$(WCTOPDIR)/include $(GCC_INCLUDES) -I/usr/athena/include
         WCLIB = -lWcr4 $(DYNLIB)
      WCLDFLAG = -L$(WCTOPDIR)/Wc -L/usr/athena/lib
         XPLIB = -lXp
      XPLDFLAG = -L$(WCTOPDIR)/Xp
        XMPLIB = -lXmp
     XMPLDFLAG = -L$(WCTOPDIR)/Xmp
        XOPLIB = -lXop
     XOPLDFLAG = -L$(WCTOPDIR)/Xop
    APPDEF_DEF =

#define NormalLibWc  ForceNormalLibs
#define NormalLibXp  ForceNormalLibs
#define NormalLibXmp ForceNormalLibs
#define NormalLibXop ForceNormalLibs

#define DebugLibWc  MakeDebugLibs
#define DebugLibXp  MakeDebugLibs
#define DebugLibXmp MakeDebugLibs
#define DebugLibXop MakeDebugLibs

#if MakeDebugLibs
    DEBUGWCLIB = -lWcr4$(DLX) $(DYNLIB)
    DEBUGXPLIB = -lXp$(DLX)
   DEBUGXMPLIB = -lXmp$(DLX)
   DEBUGXOPLIB = -lXop$(DLX)
#else
    DEBUGWCLIB = $(WCLIB)
    DEBUGXPLIB = $(XPLIB)
   DEBUGXMPLIB = $(XMPLIB)
   DEBUGXOPLIB = $(XOPLIB)
#endif

#define ProfileLibWc  MakeProfileLibs
#define ProfileLibXp  MakeProfileLibs
#define ProfileLibXmp MakeProfileLibs
#define ProfileLibXop MakeProfileLibs

       SOWCREV = 2.5

#define SharedLibWc  HasSharedLibraries
#define SharedLibXp  HasSharedLibraries
#define SharedLibXmp HasSharedLibraries
#define SharedLibXop HasSharedLibraries

#if XRelease < 50
/******************************************************************************
** Fix broken include path specification from old releases of Imake.
** This forces local Wcl include files to be searched before system
** include files.  This helps alot when a system already has installed
** a previous version of Wcl.  
******************************************************************************
** This must use any variables used by your Imake.tmpl file, simply re-ordered!
******************************************************************************
*/
  ALLINCLUDES = $(INCLUDES) $(EXTRA_INCLUDES) $(TOP_INCLUDES) $(STD_INCLUDES) $(VENDOR_INCLUDES)
   ALLDEFINES = $(ALLINCLUDES) $(STD_DEFINES) $(EXTRA_DEFINES) $(PROTO_DEFINES) $(DEFINES) $(COMPATFLAGS)
       Cflags = $(CDEBUGFLAGS) $(CCOPTIONS) $(ALLDEFINES)
    LINTFLAGS = $(LINTOPTS) -DLINT $(ALLDEFINES)
#endif

