XCOMM $Xorg: Imakefile,v 1.3 2000/08/17 19:54:14 cpqbld Exp $




XCOMM $XFree86: xc/programs/xdm/Imakefile,v 3.52 2002/12/07 20:31:04 herrb Exp $

#define IHaveSubdirs
#define PassCDebugFlags 'CDEBUGFLAGS=$(CDEBUGFLAGS)'

#ifndef BuildChooser
#define BuildChooser !SystemV
#endif

#ifndef SharedLibXdmGreet
#define SharedLibXdmGreet (HasSharedLibraries && (defined(AlphaArchitecture) || SystemV4))
#endif

#ifndef BuildBoth
#define BuildBoth (defined(LinuxArchitecture) && !SharedLibXdmGreet && !UseElfFormat)
#endif

#ifndef LinuxShadowSuite
#define LinuxShadowSuite NO
#endif

#if HasXdmAuth
XDMAUTH_DEFINES = -DHASXDMAUTH
XDMAUTHOBJS = xdmauth.o
XDMAUTHSRCS = xdmauth.c
#endif

#if HasSecureRPC
RPC_DEFINES = -DSECURE_RPC
RPCOBJS = rpcauth.o
RPCSRCS = rpcauth.c
RPCLIB = -lrpcsvc
#endif

#if HasKrbIV
KRBIV_DEFINES = KrbIVDefines
KRBIV_INCLUDES = KrbIVIncludes
KRBIVLIB = KrbIVLibraries
#endif

#if HasKrb5
KRB5_DEFINES = Krb5Defines
KRB5_INCLUDE = Krb5Includes
KRB5OBJS = krb5auth.o
KRB5SRCS = krb5auth.c
#endif

#if SharedLibXdmGreet
GREET_DIR = greeter
#if SystemV4 || (SharedLibXdmGreet && (defined(LinuxArchitecture) || defined(NetBSDArchitecture) || defined(GNUMachArchitecture)))
    DLLIBRARY = DlLibrary
#endif
#else
GREET_DEFINES = -DGREET_USER_STATIC $(KRBIV_DEFINES) $(KRBIV_INCLUDES)
GREETSRCS = greet.c verify.c Login.c
GREETOBJS = greet.o verify.o Login.o
#if BuildBoth
GREETSHADOWSRCS = greetsh.c verifysh.c Loginsh.c
GREETSHADOWOBJS = greetsh.o verifysh.o Loginsh.o
#if !UseElfFormat
SHADOWLIB = -lshadow
#endif
#endif
#endif

#if BuildXineramaLibrary
XINERAMA_DEFINES = -DUSE_XINERAMA
XINDEPLIBS = $(DEPXINERAMALIB)
XINLIBS = $(XINERAMALIB)
#endif

XPM_DEFINES = -DXPM 

/* This is correct for Linux and FreeBSD */
#if HasPam
PAM_LIBRARIES = PamLibraries
PAM_DEFINES = -DUSE_PAM
#endif

#if HasBSDAuth
BSDAUTH_DEFINES = -DUSE_BSDAUTH
#endif

#if SystemV4 || HasShadowPasswd
#if !LinuxShadowSuite
PWD_DEFINES = -DUSESHADOW
#else
PWD_DEFINES = -DUSESHADOW -DSHADOWSUITE
#endif

#if !defined(i386IscArchitecture) && !defined(i386ScoArchitecture) && !defined(LinuxArchitecture) && !defined(NTOArchitecture) && !defined(SGIArchitecture)
SYS_LIBRARIES3 = -lresolv
#endif
#if SystemV || defined(SequentArchitecture)
SYS_LIBRARIES1 = -lsec
#endif
#if defined(LinuxArchitecture) && (!UseElfFormat || LinuxShadowSuite)
SYS_LIBRARIES1 = -lshadow
#endif
#endif

#if defined(UltrixArchitecture)
SYS_LIBRARIES1 = -lauth
#endif

#if (defined(AIXArchitecture) && (OSMajorVersion >= 3))
SYS_LIBRARIES1 = -ls
#endif

#if HasLibCrypt
#ifdef SpecialLibCrypt
CRYPT_LIBRARIES = SpecialLibCrypt
#else
CRYPT_LIBRARIES = -lcrypt
#if defined(LynxOSArchitecture)
CRYPT_DEFINES = -DHAS_CRYPT
#endif
#endif
#endif

#if HasBSD44Sockets
SOCK_DEFINES = -DBSD44SOCKETS
#endif

#if defined(i386Architecture) || defined(AmigaArchitecture)
FRAGILE_DEFINES = -DFRAGILE_DEV_MEM
#endif

#if defined(NetBSDArchitecture) && \
    ((OSMajorVersion > 1) || \
     (OSMajorVersion == 1 && OSMinorVersion > 3))
RANDOM_DEFINES = -DDEV_RANDOM=\"/dev/urandom\"
#endif

#ifdef OpenBSDArchitecture
RANDOM_DEFINES = -DARC4_RANDOM
#endif

#if HasVFork
VFORK_DEFINES = -DHAS_VFORK
#endif

#if UseXKBInClients
XKB_CLIENT_DEFINES = XkbClientDefines
#endif

#if HasSetUserContext
USER_CONTEXT_DEFINES = -DHAS_SETUSERCONTEXT
# XXX - only FreeBSD has this in libutil
SYS_LIBRARIES1 = -lutil
#endif

#if HasSetProcTitle
PROCTITLE_DEFINES = -DHAS_SETPROCTITLE
#endif

#if !HasSnprintf
SNPRINTFSRCS = snprintf.c 
SNPRINTFOBJS = snprintf.o
#endif

  SYS_LIBRARIES = $(SYS_LIBRARIES1) $(SYS_LIBRARIES2) $(SYS_LIBRARIES3)

   XDMCONFIGDIR = XdmConfigurationSubdirectory
        SUBDIRS = $(GREET_DIR) $(XDMCONFIGDIR)

INCLUDES = $(KRB5_INCLUDE)
DEPLIBS = $(DEPXMULIB) $(DEPXTOOLLIB) $(DEPXLIB) $(DEPXAUTHLIB) \
	$(DEPXDMCPLIB) $(XINDEPLIBS)
LOCAL_LIBRARIES = $(XPMLIB) $(XMULIB) $(XTOOLLIB) $(XLIB) $(XAUTHLIB) \
	$(XDMCPLIB) $(RPCLIB) $(PAM_LIBRARIES) $(DLLIBRARY) \
	$(CRYPT_LIBRARIES) $(KRBIVLIB) $(XINLIBS)

          SRCS1 = auth.c daemon.c server.c dpylist.c dm.c error.c file.c \
		  netaddr.c reset.c resource.c protodpy.c policy.c \
		  session.c socket.c streams.c util.c xdmcp.c \
		  mitauth.c \
		  genauth.c access.c choose.c \
		  $(XDMAUTHSRCS) $(RPCSRCS) $(KRB5SRCS) $(GREETSRCS) \
		  $(SNPRINTFSRCS) 
          OBJS1 = auth.o daemon.o server.o dpylist.o dm.o error.o file.o \
		  netaddr.o reset.o resource.o protodpy.o policy.o \
		  session.o socket.o streams.o util.o xdmcp.o \
		  mitauth.o \
		  genauth.o access.o choose.o \
		  $(XDMAUTHOBJS) $(RPCOBJS) $(KRB5OBJS) $(GREETOBJS) \
		  $(SNPRINTFOBJS)
          SRCS2 = xdmshell.c 
          OBJS2 = xdmshell.o 
#if BuildChooser
          SRCS3 = chooser.c
          OBJS3 = chooser.o
       DEPLIBS3 = XawClientDepLibs XkbClientDepLibs $(DEPXDMCPLIB) \
		  $(XINDEPLIBS)
          LIBS3 = XawClientLibs XkbClientLibs $(XDMCPLIB) $(XINLIBS)
#endif

          SRCS4 = sessreg.c
          OBJS4 = sessreg.o

#if BuildBoth
          SRCS5 = auth.c daemon.c server.c dpylist.c dm.c error.c file.c \
		  netaddr.c reset.c resource.c protodpy.c policy.c \
		  sessionsh.c socket.c streams.c util.c xdmcp.c \
		  mitauth.c \
		  genauth.c access.c choose.c \
		  $(XDMAUTHSRCS) $(RPCSRCS) $(KRB5SRCS) $(GREETSHADOWSRCS)
          OBJS5 = auth.o daemon.o server.o dpylist.o dm.o error.o file.o \
		  netaddr.o reset.o resource.o protodpy.o policy.o \
		  sessionsh.o socket.o streams.o util.o xdmcp.o \
		  mitauth.o \
		  genauth.o access.o choose.o \
		  $(XDMAUTHOBJS) $(RPCOBJS) $(KRB5OBJS) $(GREETSHADOWOBJS)
     XDM_SHADOW = ProgramTargetName(xdm-shadow)
#endif
#if BuildChooser
        CHOOSER = ProgramTargetName(chooser)
#endif
       PROGRAMS = ProgramTargetName(xdm) ProgramTargetName(xdmshell) ProgramTargetName(sessreg) $(CHOOSER) $(XDM_SHADOW)

 OSMAJORVERSION = OSMajorVersion
 OSMINORVERSION = OSMinorVersion
   CONN_DEFINES = $(CONNECTION_FLAGS)
        DEFINES = -DBINDIR=\"$(BINDIR)\" -DXDMDIR=\"$(XDMDIR)\" \
		$(SIGNAL_DEFINES) $(CRYPT_DEFINES) $(BSDAUTH_DEFINES) \
		$(XDMAUTH_DEFINES) $(RPC_DEFINES) $(KRB5_DEFINES) \
		$(PWD_DEFINES) $(PAM_DEFINES) $(CONN_DEFINES) \
		$(GREET_DEFINES) $(FRAGILE_DEFINES) $(RANDOM_DEFINES) \
		-DOSMAJORVERSION=$(OSMAJORVERSION) \
		-DOSMINORVERSION=$(OSMINORVERSION) \
		$(XKB_CLIENT_DEFINES) $(USER_CONTEXT_DEFINES) \
		$(XPM_DEFINES) $(XINERAMA_DEFINES) $(PROCTITLE_DEFINES)

XCOMM
XCOMM Special definitions for compiling default resources; these parameters
XCOMM should be set in util/imake.includes/site.def or the appropriate .macros
XCOMM file in that directory.  The lack of initial spaces is to prevent imake
XCOMM from accidently turning the lines into rules by putting a leading tab.
XCOMM
XCOMM Do NOT change these lines!
XCOMM
DEF_SERVER = $(BINDIR)/X
DEF_USER_PATH = DefaultUserPath		/* no leading spaces or imake will */
DEF_SYSTEM_PATH = DefaultSystemPath	/* indent as rule */
BOURNE_SHELL = DefaultSystemShell
RES_DEFINES = '-DDEF_SERVER_LINE=":0 local $(DEF_SERVER) :0"' \
		  '-DXRDB_PROGRAM="$(BINDIR)/xrdb"' \
		  '-DDEF_SESSION="$(BINDIR)/xterm -ls"' \
		  '-DDEF_USER_PATH="$(DEF_USER_PATH)"' \
		  '-DDEF_SYSTEM_PATH="$(DEF_SYSTEM_PATH)"' \
		  '-DDEF_SYSTEM_SHELL="$(BOURNE_SHELL)"' \
		  '-DDEF_FAILSAFE_CLIENT="$(BINDIR)/xterm"' \
		  '-DDEF_XDM_CONFIG="$(XDMDIR)/xdm-config"' \
		  '-DDEF_CHOOSER="$(XDMDIR)/chooser"' \
		  '-DDEF_AUTH_DIR="$(XDMDIR)"' \
		  '-DDEF_GREETER_LIB="$(XDMDIR)/libXdmGreet.so"'

ComplexProgramTarget_1(xdm,$(LOCAL_LIBRARIES),NullParameter)
LinkConfDirectory(xdm,.,xdm,.)
#ifdef VarDbDirectory
LinkConfDirectoryLong(xdm,xdm,authdir,authdir,$(CONFDIR),$(VARDBDIR))
#endif
NormalProgramTarget(xdmshell,$(OBJS2),NullParameter,NullParameter,NullParameter)
NormalProgramTarget(sessreg,$(OBJS4),NullParameter,NullParameter,NullParameter)
InstallProgram(sessreg,$(BINDIR))
InstallManPage(sessreg,$(MANDIR))

#if defined(FreeBSDArchitecture) && (OSMajorVersion < 2)
SpecialCObjectRule(daemon,$(ICONFIGFILES),-UCSRG_BASED)
#endif

#if BuildChooser
SpecialCObjectRule(chooser, $(ICONFIGFILES), $(SOCK_DEFINES))
NormalProgramTarget(chooser,$(OBJS3),$(DEPLIBS3),$(LIBS3),NullParameter)
InstallProgram(chooser,$(XDMDIR))
InstallAppDefaults(Chooser)
#endif
#if BuildBoth
NormalProgramTarget(xdm-shadow,$(OBJS5),$(DEPLIBS),$(LOCAL_LIBRARIES),$(SHADOWLIB))
InstallProgram(xdm-shadow,$(BINDIR))
#endif

SpecialCObjectRule(auth,$(ICONFIGFILES),$(SOCK_DEFINES))
SpecialCObjectRule(policy,$(ICONFIGFILES),$(_NOOP_))
SpecialCObjectRule(resource,$(ICONFIGFILES),$(RES_DEFINES))
SpecialCObjectRule(socket,$(ICONFIGFILES),$(SOCK_DEFINES))
SpecialCObjectRule(xdmcp,$(ICONFIGFILES),$(SOCK_DEFINES))
SpecialCObjectRule(xdmshell,$(ICONFIGFILES),$(VFORK_DEFINES))

#if !SharedLibXdmGreet
LinkSourceFile(greet.c,greeter)
LinkSourceFile(verify.c,greeter)
LinkSourceFile(Login.c,greeter)
LinkSourceFile(Login.h,greeter)
LinkSourceFile(LoginP.h,greeter)
#if BuildBoth
ObjectFromSpecialSource(greetsh,greet,-DUSESHADOW)
ObjectFromSpecialSource(verifysh,verify,-DUSESHADOW)
ObjectFromSpecialSource(Loginsh,Login,-DUSESHADOW)
ObjectFromSpecialSource(sessionsh,session,-DUSESHADOW)
#endif
#endif /* !SharedLibXdmGreet */

#if !HasSnprintf
LinkSourceFile(snprintf.c,$(LIBSRC)/misc)
#endif

#ifdef IHaveSubdirs
MakeSubdirs($(SUBDIRS))
DependSubdirs($(SUBDIRS))
#endif

/*
 * Don't install; let people read the instructions about putting in the
 * abort-display() resource:
 */
#ifdef comment
InstallProgramWithFlags(xdmshell,$(BINDIR),NullParameter)
#endif
