Convert uses of XKeycodeToKeysym (deprecated) to XkbKeycodeToKeysym
[oweals/cde.git] / cde / programs / dtlogin / Imakefile
1 XCOMM $TOG: Imakefile /main/21 1999/03/01 18:26:06 mgreess $
2 #define IHaveSubdirs
3 #define PassCDebugFlags 'CDEBUGFLAGS=$(CDEBUGFLAGS)'
4
5 SUBDIRS = config $(XDMSUBDIRS) $(BLSSUBDIRS) $(AFSSUBDIRS)
6
7 #if CDE_USEXINERAMA
8 XINOPT = -DUSE_XINERAMA
9 XINLIB = -lDtXinerama -lXinerama
10 #endif
11
12 MakeSubdirs($(SUBDIRS))
13 DependSubdirs($(SUBDIRS))
14
15 #if InstallXdmConfig 
16    XDMCONFIGDIR = XdmConfigurationSubdirectory
17      XDMSUBDIRS = $(XDMCONFIGDIR) bootxutil
18 #endif
19
20 /* please list any new dtlogin headers for use by krb and rgy */
21 HEADERS = dm.h vg.h vglogo.h vgmsg.h vgproto.h
22
23 #if HasXdmAuth
24 DESDEFS = -DHASDES -DHASXDMAUTH -DSILLYEXPORTRULE
25 DESOBJS = xdmauth.o
26 DESSRCS = xdmauth.c
27 #elif HasDESLibrary
28 DESDEFS = -DHASDES
29 DESOBJS = xdmauth.o
30 DESSRCS = xdmauth.c
31 #else
32 DESDEFS = 
33 DESOBJS =
34 DESSRCS = 
35 #endif
36
37 #ifndef UsePamLibrary
38 # define UsePamLibrary  NO
39 #endif
40
41 #if UsePamLibrary
42 PAM_SRCS = pam_svc.c
43 PAM_OBJS = pam_svc.o
44 PAM_LIB = -lpam
45 #else
46 PAM_SRCS =
47 PAM_OBJS =
48 PAM_LIB =
49 #endif
50
51 #ifdef SunArchitecture 
52 SOLARIS_SRCS = solaris.c
53 SOLARIS_OBJS = solaris.o
54 #else
55 SOLARIS_SRCS =
56 SOLARIS_OBJS =
57 #endif
58
59 #if defined(SunArchitecture) && !UsePamLibrary
60 /* Unsure when libauth went away */
61 #  if (OSMajorVersion == 5) && (OSMinorVersion < 5)
62 PAM_LIB = -lauth
63 #  else
64 PAM_SRCS = pam_svc.c
65 PAM_OBJS = pam_svc.o
66 PAM_LIB = -lpam
67 #  endif
68 #endif
69
70          XDMDIR = $(CDE_LOGFILES_TOP)
71
72 /******************  DTLOGIN ARCHIVE SECTION *****************
73    A better long-term solution is a dtgreet subdirectory since dtgreet
74    is built with shared libraries.
75    dtlogin is always built archived in HP because of 
76    its importance for user startup. DEPLIBS needs to be explicitly set
77    because default is null DEPLIBS for shared libraries.
78    Does this need to be ifdef'd hp? */
79 /* Defaults */
80 LOGINDEPXMULIB = $(DEPXMULIB)
81 LOGINXMULIB = $(XMULIB)
82 LOGINDEPXLIB = $(DEPXLIB)
83 LOGINXLIB = $(XLIB)
84
85 #ifdef HPArchitecture
86 #  if !defined(UseInstalled) && !defined(UseMitLibrariesFromSystemOnly) && \
87        defined(SHLIB)
88 LOGINDEPXMULIB = $(XMUSRC)/libXmu.a
89 LOGINXMULIB = $(LOGINDEPXMULIB)
90 LOGINDEPXLIB = $(XLIBSRC)/libX11.a
91 LOGINXLIB = $(LOGINDEPXLIB)
92 /* This is really a kludge !! */
93 LOGINLDOPTIONS = -Wl,-a archive
94 #  endif
95 #  if OSMajorVersion >= 10
96 SYS_LIBRARIES = -lsec
97 #  endif
98 #endif
99
100 #if defined(SunArchitecture)
101 /* note: libcmd.a is a Sun static private lib for login related work. 
102  *       It should come before $(PAM_LIB) in link line, at least when compiled
103  *       on Solaris 2.4 and run on Solaris 2.5.  In Solaris 2.4 some of 
104  *       libcmd.a functions are also in libauth.so.  But on Solaris 2.5 
105  *       these Sun private functions have been removed from libauth.so. */
106 SYS_LIBRARIES = -lm -ldl -lgen -lresolv -lbsm -lcmd $(PAM_LIB)
107    EXTRA_DEFINES = -DPAM
108
109
110 #  if UsePamLibrary
111    EXTRA_DEFINES = -DPAM
112 #  endif
113 #endif
114
115 #if defined(RsArchitecture)
116 SYS_LIBRARIES = -ls
117 #endif
118
119 #ifdef AlphaArchitecture
120 SYS_LIBRARIES = -lm -lXdmcp
121 #endif
122
123 #if defined(LinuxArchitecture) || \
124     defined(FreeBSDArchitecture) || defined(NetBSDArchitecture)
125 SYS_LIBRARIES = -lm -lcrypt
126 EXTRA_DEFINES = $(XINOPT)
127 LOGINXLIB = $(XLIB) $(XINLIB)
128 /* just use the system provided Xau and Xdmcp*/
129 DEPXAUTHLIB = 
130 DEPXDMCPLIB = 
131 #endif
132
133 /* Add in freetype header locations, required for modern Motif libs */
134 #ifdef LinuxArchitecture
135 INCLUDES = -I/usr/include/freetype2
136 #endif
137
138 #if defined(BSDArchitecture)
139 INCLUDES = -I$(XPROJECTROOT)/include/freetype2
140 #endif
141
142 /**************************************************************************
143  *
144  *  Source and object modules
145  *
146  *    SRCS1 = Dtlogin sources
147  *    OBJS1 = Dtlogin objects
148  *
149  *    SRCS2 = Dtgreet sources
150  *    OBJS2 = Dtgreet objects
151  *
152  *    SRCS3 = Dtchooser sources
153  *    OBJS3 - Dtchooser objects
154  *
155  **************************************************************************/
156
157           PROG1 = dtlogin
158
159           SRCS1 = access.c account.c auth.c genauth.c daemon.c dm.c \
160                   dpylist.c error.c file.c mitauth.c protodpy.c policy.c \
161                   reset.c resource.c server.c session.c socket.c util.c \
162                   verify.c sysauth.c fontpath.c $(DESSRCS) qualify.c choose.c \
163                   netaddr.c xdmcp.c $(PAM_SRCS) $(SOLARIS_SRCS)
164
165           OBJS1 = access.o account.o auth.o genauth.o daemon.o dm.o \
166                   dpylist.o error.o file.o mitauth.o protodpy.o policy.o \
167                   reset.o resource.o server.o session.o socket.o util.o \
168                   verify.o sysauth.o fontpath.o $(DESOBJS) qualify.o choose.o \
169                   netaddr.o xdmcp.o $(PAM_OBJS) $(SOLARIS_OBJS)
170
171           PROG2 = dtgreet
172 #ifdef AlphaArchitecture
173           SRCS2 = vgcallback.c vglogo.c vgmain.c vgutil.c vglang.c vgsiaform.c
174           OBJS2 = vgcallback.o vglogo.o vgmain.o vgutil.o vglang.o vgsiaform.o
175 #else
176           SRCS2 = vgcallback.c vglogo.c vgmain.c vgutil.c vglang.c
177           OBJS2 = vgcallback.o vglogo.o vgmain.o vgutil.o vglang.o
178 #endif
179
180           PROG3 = dtchooser
181           SRCS3 = chooser.c dtchooser.c vglogo.c vgutil.c \
182                   vgcallback.c vglang.c
183           OBJS3 = chooser.o dtchooser.o vglogo.o vgutil.o \
184                   vgcallback.o vglang.o
185
186        PROGRAMS = $(PROG1) $(PROG2) $(PROG3)
187
188 /**************************************************************************
189  *
190  *  Defines
191  *
192  **************************************************************************/
193
194 #if defined (SunArchitecture)
195   NATIVEXBINDIR = /usr/openwin/bin
196 #elif defined(FreeBSDArchitecture)
197   NATIVEXBINDIR = /usr/local/bin
198 #elif defined(OpenBSDArchitecture)
199   NATIVEXBINDIR = /usr/X11R6/bin
200 #elif defined(NetBSDArchitecture)
201   NATIVEXBINDIR = /usr/X11R7/bin
202 #else
203   NATIVEXBINDIR = /usr/bin/X11
204 #endif
205
206         SIGDEFS = $(SIGNAL_DEFINES)
207
208         XBINDIR = $(XPROJECTROOT)/bin
209  OSMAJORVERSION = OSMajorVersion
210  OSMINORVERSION = OSMinorVersion
211      DTDEFINES = $(DESDEFS) ConnectionFlags \
212                   -DBINDIR=\"$(XBINDIR)\" -DXDMDIR=\"$(XDMDIR)\" $(SIGDEFS) \
213                   -DOSMAJORVERSION=$(OSMAJORVERSION) \
214                   -DOSMINORVERSION=$(OSMINORVERSION) \
215                   -DCDE_INSTALLATION_TOP=\"$(CDE_INSTALLATION_TOP)\" \
216                   -DCDE_CONFIGURATION_TOP=\"$(CDE_CONFIGURATION_TOP)\"
217
218  DEPEND_DEFINES = $(DEPENDDEFINES)
219 #if defined (HPArchitecture)
220         DEFINES = $(DTDEFINES) -D_XPG2 -DAUDIT -DBYPASSLOGIN ServerExtraDefines
221 #elif defined (RsArchitecture)
222         DEFINES = $(DTDEFINES) -D_ILS_MACROS -DBSD44SOCKETS \
223                   -D__NetBSD__ -DENABLE_DYNAMIC_LANGLIST
224 #elif defined (AlphaArchitecture)
225         DEFINES = $(DTDEFINES) -DXDMCP -DSIA
226 #elif defined (LinuxArchitecture)
227         DEFINES = $(DTDEFINES) -DXDMCP
228 #elif defined (OpenBSDArchitecture)
229         DEFINES = $(DTDEFINES) -DXDMCP
230 #elif defined (FreeBSDArchitecture)
231         DEFINES = $(DTDEFINES) -DXDMCP
232 #else
233         DEFINES = $(DTDEFINES) -D_NO_PROTO
234 #endif
235
236 XCOMM
237 XCOMM Special definitions for compiling default resources; these parameters
238 XCOMM should be set in util/imake.includes/site.def or the appropriate .macros
239 XCOMM file in that directory.  The lack of initial spaces is to prevent imake
240 XCOMM from accidently turning the lines into rules by putting a leading tab.
241 XCOMM
242 XCOMM Do NOT change these lines!
243 XCOMM
244 DEF_SERVER = $(XBINDIR)/X
245 DEF_USER_PATH = DefaultUserPath:/usr/ccs/bin:$(NATIVEXBINDIR):$(XBINDIR)
246 DEF_SYSTEM_PATH = DefaultSystemPath:$(NATIVEXBINDIR):$(XBINDIR)
247 BOURNE_SHELL = DefaultSystemShell
248 CPP_PROGRAM = CppCmd
249 DEF_BM_PATH = $(CDE_CONFIGURATION_TOP)/appconfig/icons/%L/%B%M.bm:$(CDE_CONFIGURATION_TOP)/appconfig/icons/%L/%B%M.pm:$(CDE_CONFIGURATION_TOP)/appconfig/icons/%L/%B:$(CDE_CONFIGURATION_TOP)/appconfig/icons/C/%B%M.bm:$(CDE_CONFIGURATION_TOP)/appconfig/icons/C/%B%M.pm:$(CDE_CONFIGURATION_TOP)/appconfig/icons/C/%B:$(CDE_INSTALLATION_TOP)/appconfig/icons/%L/%B%M.bm:$(CDE_INSTALLATION_TOP)/appconfig/icons/%L/%B%M.pm:$(CDE_INSTALLATION_TOP)/appconfig/icons/%L/%B:$(CDE_INSTALLATION_TOP)/appconfig/icons/C/%B%M.bm:$(CDE_INSTALLATION_TOP)/appconfig/icons/C/%B%M.pm:$(CDE_INSTALLATION_TOP)/appconfig/icons/C/%B
250 DEF_PM_PATH=$(CDE_CONFIGURATION_TOP)/appconfig/icons/%L/%B%M.pm:$(CDE_CONFIGURATION_TOP)/appconfig/icons/%L/%B%M.bm:$(CDE_CONFIGURATION_TOP)/appconfig/icons/%L/%B:$(CDE_CONFIGURATION_TOP)/appconfig/icons/C/%B%M.pm:$(CDE_CONFIGURATION_TOP)/appconfig/icons/C/%B%M.bm:$(CDE_CONFIGURATION_TOP)/appconfig/icons/C/%B:$(CDE_INSTALLATION_TOP)/appconfig/icons/%L/%B%M.pm:$(CDE_INSTALLATION_TOP)/appconfig/icons/%L/%B%M.bm:$(CDE_INSTALLATION_TOP)/appconfig/icons/%L/%B:$(CDE_INSTALLATION_TOP)/appconfig/icons/C/%B%M.pm:$(CDE_INSTALLATION_TOP)/appconfig/icons/C/%B%M.bm:$(CDE_INSTALLATION_TOP)/appconfig/icons/C/%B
251
252 RES_DEFINES = '-DDEF_SERVER_LINE=":0 Local local $(DEF_SERVER) :0"' \
253                   '-DXRDB_PROGRAM="$(XBINDIR)/xrdb"' \
254                   '-DDEF_USER_PATH="$(DEF_USER_PATH)"' \
255                   '-DDEF_SYSTEM_PATH="$(DEF_SYSTEM_PATH)"' \
256                   '-DDEF_FAILSAFE_CLIENT="$(XBINDIR)/xterm"' \
257                   '-DDEF_AUTH_FILE="$(XDMDIR)/auth-server"' \
258                   '-DDEF_AUTH_DIR="$(XDMDIR)"' \
259                   '-DCPP_PROGRAM="$(CPP_PROGRAM)"' \
260                   '-DDEF_PM_SEARCH_PATH="$(DEF_PM_PATH)"' \
261                   '-DDEF_BM_SEARCH_PATH="$(DEF_BM_PATH)"'
262
263 XCOMM
264 XCOMM These -D flags had to be taken out of the RES_DEFINES macro in order
265 XCOMM to get around a buffer limitation in the Sun C compiler code generation
266 XCOMM phase.  The code generation phase creates a temporary assembler file
267 XCOMM containing the command line to the compiler and all the .ident pragmas.
268 XCOMM With resent changes to the Imakefile, the command line had gotten so
269 XCOMM long that it exceeded an internal buffer length resulting in errors in
270 XCOMM the generated assembler code.  The EXTRA_RES_DEFINES were extracted
271 XCOMM from the RES_DEFINES macro in order to shorten the command line on
272 XCOMM the Sun platform.  These particular -D flags were chosen as the
273 XCOMM least likely to change or be system dependent.
274 XCOMM
275 #ifdef SunArchitecture 
276 EXTRA_RES_DEFINES =
277 #else
278 EXTRA_RES_DEFINES = \
279                   '-DDEF_SESSION="$(CDE_INSTALLATION_TOP)/bin/Xsession"' \
280                   '-DDEF_SYSTEM_SHELL="$(BOURNE_SHELL)"' \
281                   '-DDEF_CHOOSER="$(CDE_INSTALLATION_TOP)/bin/dtchooser"' \
282                   '-DDEF_XDM_CONFIG="Xconfig"'
283 #endif
284
285
286
287 /**************************************************************************
288  *
289  *  Libraries
290  *
291  *    BASE_LIBS1 = dtlogin base libraries
292  *    BASE_LIBS2 = dtgreet base libraries
293  *
294  **************************************************************************/
295
296
297     DEPLIBS1 = $(DEPXAUTHLIB) $(DEPXDMCPLIB) $(LOGINDEPXMULIB) $(LOGINDEPXLIB)
298     DEPLIBS2  = $(DEPDTWIDGETLIB) $(DEPDTSVCLIB) $(DEPTTLIB) $(DEPXMLIB)  \
299                 $(DEPXTOOLLIB) $(DEPXLIB)
300     DEPLIBS3 = $(DEPXDMCPLIB) $(DEPXMLIB) $(DEPXTOOLLIB) $(DEPXLIB)
301
302     BASE_LIBS1  = $(XAUTHLIB) $(LOGINXMULIB) $(XDMCPLIB) $(LOGINXLIB)
303     BASE_LIBS2  = $(DTWIDGETLIB) $(DTSVCLIB) $(TTLIB) $(XMLIB) \
304                   $(XTOOLLIB) $(XLIB) $(XINLIB)
305     BASE_LIBS3  = $(DTWIDGETLIB) $(DTSVCLIB) $(TTLIB) $(XDMCPLIB) $(XMLIB) \
306                   $(XTOOLLIB) $(XLIB) $(XINLIB)
307
308     LOCAL_LIBRARIES1 = $(BASE_LIBS1) $(IAFSYSLIB)
309     LOCAL_LIBRARIES2 = $(BASE_LIBS2)
310     LOCAL_LIBRARIES3 = $(BASE_LIBS3)
311
312 /**************************************************************************
313  *
314  *  Extra things for the HP-UX BLS version
315  *
316  **************************************************************************/
317
318 #if !defined(BLS) && defined(HPArchitecture) && (OSMajorVersion == 8) && \
319      (OSMinorVersion == 8)
320 # define BLS
321 #endif
322
323 #ifdef BLS
324         BLSSUBDIRS = bls
325          BLSLIBSRC = ./bls
326     EXTRA_DEFINES = -UAUDIT -D_NO_PROTO
327      EXTRA_CFLAGS = -Wp,-H256000
328   EXTRA_LIBRARIES = $(BLSLIBSRC)/libbls.a -lsec ExtraLibraries
329   STD_CPP_DEFINES = -DSYSV  -DBLS
330 #endif
331
332
333
334 /**************************************************************************
335  *
336  *  Extra things for the Kerberos/AFS version (dtlogin.krb)
337  *
338  **************************************************************************/
339
340 #ifdef USE_KRB
341
342      AFSSUBDIRS = afs
343
344       KRBLIBSRC = $(LIBSRC)/krb
345       DEPKRBLIB = $(KRBLIBSRC)/libkrb.a
346          KRBLIB = $(DEPKRBLIB)
347
348       DESLIBSRC = $(LIBSRC)/des
349       DEPDESLIB = $(DESLIBSRC)/libdes.a
350          DESLIB = $(DEPDESLIB)
351
352   KRBINCLUDESRC = $(KRBLIBSRC)/include
353       AFSLIBSRC = ./afs
354   AFSINCLUDESRC = $(AFSLIBSRC)
355  EXTRA_INCLUDES = -I$(KRBINCLUDESRC) -I$(AFSINCLUDESRC)
356   EXTRA_DEFINES = -D__KERBEROS -D__AFS
357
358 LOCAL_LIBRARIES1 = $(BASE_LIBS1)  \
359                    $(KRBLIB) \
360                    $(IAFSYSLIB) \
361                    $(AFSLIBSRC)/libafsutil.a \
362                    $(AFSLIBSRC)/$(VENDOR)/$(HARDWARE)/libdes.a
363
364 LOCAL_LIBRARIES2 = $(BASE_LIBS2) \
365                    $(KRBLIB) \
366                    $(AFSLIBSRC)/$(VENDOR)/$(HARDWARE)/libkauth.a \
367                    $(AFSLIBSRC)/$(VENDOR)/$(HARDWARE)/libprot.a \
368                    $(AFSLIBSRC)/$(VENDOR)/$(HARDWARE)/libubik.a \
369                    $(AFSLIBSRC)/$(VENDOR)/$(HARDWARE)/libauth.a \
370                    $(AFSLIBSRC)/$(VENDOR)/$(HARDWARE)/librxkad.a \
371                    $(AFSLIBSRC)/$(VENDOR)/$(HARDWARE)/libsys.a \
372                    $(AFSLIBSRC)/$(VENDOR)/$(HARDWARE)/libdes.a \
373                    $(AFSLIBSRC)/$(VENDOR)/$(HARDWARE)/librx.a \
374                    $(AFSLIBSRC)/$(VENDOR)/$(HARDWARE)/liblwp.a \
375                    $(AFSLIBSRC)/$(VENDOR)/$(HARDWARE)/libcom_err.a \
376                    $(AFSLIBSRC)/libafsutil.a \
377                    -lBSD
378 #endif
379
380
381
382 /**************************************************************************
383  *
384  *  Extra things for the Passwd Etc. version (dtlogin.rgy)
385  *
386  **************************************************************************/
387
388 #ifdef USE_RGY
389      EXTRA_INCLUDES = -I$(RGYINCLUDESRC)
390       EXTRA_DEFINES = -D__PASSWD_ETC +e
391     EXTRA_LIBRARIES = $(RGYLIB) $(NCKLIB) -lndbm -lBSD ExtraLibraries
392 #endif
393
394
395
396 /**************************************************************************
397  *
398  *  Extra things for Dtge 
399  *
400  *    HIDDEN_SYMBOLS1 = dtlogin hidden symbols
401  *    HIDDEN_SYMBOLS2 = dtgreet hidden symbols
402  *
403  **************************************************************************/
404
405 #ifdef HPArchitecture
406 #  ifdef __hp9000s300
407
408       HIDDEN_SYMBOLS1 = -h _main -h _BecomeDaemon -h _GetHourGlass \
409                         -h _Verify
410       HIDDEN_SYMBOLS2 = -h _main -h _LogError  -h _PingServer
411
412 #  else
413
414       HIDDEN_SYMBOLS1 = -h main -h BecomeDaemon -h GetHourGlass \
415                         -h Verify 
416       HIDDEN_SYMBOLS2 = -h main -h LogError  -h PingServer
417
418 #  endif
419 #endif
420
421
422
423 /**************************************************************************
424  *
425  *  Rules
426  *
427  **************************************************************************/
428
429 #if defined(USE_KRB) || defined(USE_RGY)
430 includes::
431         @for i in $(SRCS1) $(SRCS2) $(HEADERS); do \
432         $(RM) $$i; \
433         echo "linking $(DTLOGINSRC)/$$i to $$i";\
434         ln -f -s $(DTLOGINSRC)/$$i .; \
435         done
436 #endif
437
438
439 ComplexProgramTarget_1($(PROG1),$(LOCAL_LIBRARIES1), $(LOGINLDOPTIONS))
440 ComplexProgramTarget_2($(PROG2),$(LOCAL_LIBRARIES2), /**/)
441 ComplexProgramTarget_3($(PROG3),$(LOCAL_LIBRARIES3), /**/)
442
443 #ifdef __ppc
444 /* Problem with "-O" in dtgreet ... wrong size login widget. */
445 /* Override "-O" (xO2) with "-xO1". */
446 vgutil.o:
447         $(RM) $@
448         $(CC) -c $(CFLAGS) -xO1 $(_NOOP_) $*.c
449 #endif
450
451 SpecialObjectRule(resource.o, $(ICONFIGFILES), $(EXTRA_RES_DEFINES) $(RES_DEFINES) $(CCINLIBS))
452 #if defined(HPArchitecture) && !defined(DEBUGTREE)
453 SpecialObjectRule(session.o,,+O1 $(CCINLIBS))
454 #endif
455
456 #if !defined(USE_KRB) && !defined(USE_RGY)
457
458 LOCAL_CPP_DEFINES = -DCDE_CONFIGURATION_TOP=$(CDE_CONFIGURATION_TOP) \
459                     -DCDE_INSTALLATION_TOP=$(CDE_INSTALLATION_TOP) \
460                     -DCDE_LOGFILES_TOP=$(CDE_LOGFILES_TOP)
461
462 #endif /* USE_KRB && USE_RGY */
463
464 #if InstallXdmConfig 
465 MakeDirectories(install,$(XDMDIR))
466 #endif
467
468 /*
469  * Don't install; let people read the instructions about putting in the
470  * abort-display() resource:
471  */
472 #ifdef comment
473 InstallProgramWithFlags(xdmshell,$(XBINDIR), /**/)
474 #endif
475
476 #if !defined(USE_KRB) && !defined(USE_RGY) && defined(BuildHugeObject) && \
477      defined(HPArchitecture) && !defined(BLS)
478 /***** For dtge make a client_OBJS.o using client_main.o ******/
479 /***** This implies the existence of client_main.c       ******/
480 SpecialRelocatableTarget(dtlogin,$(HIDDEN_SYMBOLS1),$(OBJS1))
481 SpecialRelocatableTarget(dtgreet,$(HIDDEN_SYMBOLS2),$(OBJS2))
482 #endif