summaryrefslogtreecommitdiffstats
path: root/kdm/backend/Imakefile
blob: 75efcb45ab59e9485997bfa38d5019adfc1e9cb6 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
/* well, we have no subdirs ...
#define PassCDebugFlags 'CDEBUGFLAGS=$(CDEBUGFLAGS)'
*/

#ifdef DEBUG
CDEBUGFLAGS := $(CDEBUGFLAGS) -g
#endif

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

#ifndef LinuxShadowSuite
#define LinuxShadowSuite NO
#endif

#if FSUseSyslog
LOG_DEFINES = -DUSE_SYSLOG
#endif

#ifdef NoXDMCP
XDMCPLIB =
#else
XDMCP_DEFINES = -DXDMCP
#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
#if NOAFS
KRBIV_DEFINES = KrbIVDefines -DNO_AFS
#else
KRBIV_DEFINES = KrbIVDefines
#endif
KRBIV_INCLUDES = KrbIVIncludes
KRBIVLIB = KrbIVLibraries
#endif

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

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

#if HasPam
#undef HasShadowPasswd
#define HasShadowPasswd NO
#undef HasLibCrypt
#define HasLibCrypt NO
#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

#ifdef RandomDefines
RANDOM_DEFINES = RandomDefines
#elif defined(OpenBSDArchitecture)
RANDOM_DEFINES = -DARC4_RANDOM
#elif defined(LinuxArchitecture)
RANDOM_DEFINES = -DDEV_RANDOM=\"/dev/urandom\"
#elif defined(NetBSDArchitecture) && \
  ((OSMajorVersion > 1) || \
   (OSMajorVersion == 1 && OSMinorVersion > 3))
RANDOM_DEFINES = -DDEV_RANDOM=\"/dev/urandom\"
#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

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

  INCLUDES = $(KRB5_INCLUDE)
   DEPLIBS = $(DEPXLIB) $(DEPXAUTHLIB) $(DEPXDMCPLIB)
   LOCAL_LIBRARIES = $(XLIB) $(XAUTHLIB) \
 $(XDMCPLIB) $(RPCLIB) $(PAM_LIBRARIES) \
 $(CRYPT_LIBRARIES) $(KRBIVLIB)

      COMMSRCS = auth.c daemon.c server.c dpylist.c dm.c error.c \
		 netaddr.c reset.c resource.c protodpy.c policy.c \
		 session.c socket.c streams.c util.c xdmcp.c \
		 process.c mitauth.c \
		 genauth.c access.c choose.c \
		 $(XDMAUTHSRCS) $(RPCSRCS) $(KRB5SRCS)
      COMMOBJS = auth.o daemon.o server.o dpylist.o dm.o error.o \
		 netaddr.o reset.o resource.o protodpy.o policy.o \
		 session.o socket.o streams.o util.o xdmcp.o \
		 process.o mitauth.o \
		 genauth.o access.o choose.o \
		 $(XDMAUTHOBJS) $(RPCOBJS) $(KRB5OBJS)

         SRCS1 = $(COMMSRCS) client.c
         OBJS1 = $(COMMOBJS) client.o

#if BuildBoth
         SRCS2 = $(COMMSRCS) clientsh.c
         OBJS2 = $(COMMOBJS) clientsh.o

    XDM_SHADOW = xdm-shadow
#endif

       PROGRAMS = xdm $(XDM_SHADOW)


 OSMAJORVERSION = OSMajorVersion
 OSMINORVERSION = OSMinorVersion
   CONN_DEFINES = $(CONNECTION_FLAGS)
        DEFINES = $(SIGNAL_DEFINES) $(LOG_DEFINES) \
  $(CRYPT_DEFINES)$(PWD_DEFINES)  \
  $(BSDAUTH_DEFINES) $(PAM_DEFINES) $(USER_CONTEXT_DEFINES) \
  $(XDMAUTH_DEFINES) $(RPC_DEFINES) $(KRB5_DEFINES) \
  $(XDMCP_DEFINES) $(SOCK_DEFINES) $(CONN_DEFINES) \
  $(FRAGILE_DEFINES) $(RANDOM_DEFINES) $(PROCTITLE_DEFINES) \
  -DOSMAJORVERSION=$(OSMAJORVERSION) -DOSMINORVERSION=$(OSMINORVERSION) \
  -Dconst=

ComplexProgramTarget_1(xdm,$(LOCAL_LIBRARIES),NullParameter)
#if BuildBoth
NormalProgramTarget(xdm-shadow,$(OBJS2),$(DEPLIBS),$(LOCAL_LIBRARIES),-lshadow)
InstallProgram(xdm-shadow,$(BINDIR))
ObjectFromSpecialSource(clientsh,client,-DUSESHADOW)
#endif

#if defined(FreeBSDArchitecture) && (OSMajorVersion < 2)
XCOMM only for daemon.c? it's used in some other places, too.
SpecialCObjectRule(daemon,$(ICONFIGFILES),-UCSRG_BASED)
#endif