Convert uses of XKeycodeToKeysym (deprecated) to XkbKeycodeToKeysym
[oweals/cde.git] / cde / config / cf / Motif.tmpl
1 /* 
2  *  @OSF_COPYRIGHT@
3  *  COPYRIGHT NOTICE
4  *  Copyright (c) 1990, 1991, 1992, 1993, 1998 The Open Group, Inc.
5  *  ALL RIGHTS RESERVED (MOTIF). See the file named COPYRIGHT.MOTIF for
6  *  the full copyright text.
7  *
8  * (c) Copyright 1996 Digital Equipment Corporation.
9  * (c) Copyright 1996 Hewlett-Packard Company.
10  * (c) Copyright 1996 International Business Machines Corp.
11  * (c) Copyright 1996 Sun Microsystems, Inc.
12  * (c) Copyright 1996 Novell, Inc. 
13  * (c) Copyright 1996 FUJITSU LIMITED.
14  * (c) Copyright 1996 Hitachi.
15  */ 
16 XCOMM $TOG: Motif.tmpl /main/6 1999/05/19 17:00:05 mgreess $
17
18 /* Include the X11 project template file. */
19 #include <X11.tmpl>
20
21 #ifdef AUTOMATION
22 # ifndef Automation
23 #  define Automation    YES
24 # endif
25 #else
26 # define NO_AUTOMATION
27 #endif
28
29 #ifdef USE_VISTACC
30 # ifndef UseVista
31 #  define UseVista
32 # endif
33 # ifndef CATCMD
34 #  define CATCMD cat
35 # endif
36 #endif
37
38 #ifdef USE_PURIFY
39 # ifndef UsePurify
40 #  define UsePurify
41 # endif
42 #endif
43
44 #ifdef DEBUG_GEOMETRY
45 # ifndef DebugGeometry
46 #  define DebugGeometry YES
47 # endif
48 #endif
49
50
51 #ifndef _MUse
52 # if UseInstalledMotif
53 #  define _MUse(a,b) a
54 # else
55 #  define _MUse(a,b) b
56 # endif
57 #endif
58
59 #ifndef _MUseCat
60 # if (__STDC__ && !defined(UnixCpp)) || defined(AnsiCpp) || defined(__llvm__)
61 #  if UseInstalledMotif
62 #   define _MUseCat(a,b,c) a##c
63 #  else
64 #   define _MUseCat(a,b,c) b##c
65 #  endif
66 # else
67 #  if UseInstalledMotif
68 #   define _MUseCat(a,b,c) a/**/c
69 #  else
70 #   define _MUseCat(a,b,c) b/**/c
71 #  endif
72 # endif
73 #endif
74
75 #ifndef MTop
76 # if ImportMotif || UseInstalledMotif
77 #  define MTop $(TOP)/imports/motif
78 # else
79 #  define MTop $(TOP)
80 # endif
81 #endif
82
83 #ifndef BuildDocDir
84 # define BuildDocDir $(BUILDINCROOT)/doc
85 #endif
86 #ifndef BuildLocDir
87 # define BuildLocDir $(BUILDINCROOT)/localized
88 #endif
89
90 #ifndef MotifDefines
91 # define MotifDefines /**/
92 #endif
93
94 #ifndef XmDefines
95 # define XmDefines  /**/
96 #endif
97
98 #ifndef MwmDefines
99 # define MwmDefines /**/
100 #endif
101
102 #ifndef UilFlags
103 # define UilFlags /**/
104 #endif
105
106 #ifndef TestDefines
107 # define TestDefines /**/
108 #endif
109
110 #ifndef AutoDefines
111 # if Automation
112 #  define AutoDefines -DAUTOMATION
113 # else
114 #  define AutoDefines /**/
115 # endif
116 #endif
117
118 #ifndef AutoIncludes
119 # if Automation
120 #  define AutoIncludes -I$(AUTOSCRIPTSRC)
121 # else
122 #  define AutoIncludes /**/
123 # endif
124 #endif
125
126 #ifdef UsePurify
127 # define PurifyFilesToClean *.pure_linkinfo *.pure_hardlink
128 #else
129 # define PurifyFilesToClean
130 #endif
131 #if Automation
132 # define TestExtraFilesToClean *.Dat *.Scr PurifyFilesToClean
133 #else 
134 # define TestExtraFilesToClean *.Dat PurifyFilesToClean
135 #endif 
136
137 #ifndef UsrIncDir
138 # define UsrIncDir IncRoot
139 #endif
140
141 /* Place to install .uid files */
142 #ifndef UidDir
143 # define UidDir $(LIBDIR)/uid
144 #endif
145
146 #ifndef XmExtraLibraries
147 # define XmExtraLibraries /**/
148 #endif
149
150 #ifndef YaccFlags
151 # define YaccFlags /**/
152 #endif
153
154 #define MotifSharedRev          2.1
155
156 #ifndef BuildMotifConfig
157 # define BuildMotifConfig       YES
158 #endif
159 #ifndef BuildMotifDemos
160 # define BuildMotifDemos        YES
161 #endif
162 #ifndef BuildWMLTable
163 # define BuildWMLTable          YES
164 #endif
165
166 #ifndef SharedLibXm
167 # define SharedLibXm            HasSharedLibraries
168 #endif
169 #ifndef NormalLibXm
170 # define NormalLibXm            (!SharedLibXm | ForceNormalLib)
171 #endif
172 #ifndef DebugLibXm
173 # define DebugLibXm             NO
174 #endif
175 #ifndef ProfileLibXm
176 # define ProfileLibXm           NO
177 #endif
178 #ifndef SharedXmRev
179 # define SharedXmRev            MotifSharedRev
180 #endif
181
182 #ifndef SharedLibMrm
183 # define SharedLibMrm           HasSharedLibraries
184 #endif
185 #ifndef NormalLibMrm
186 # define NormalLibMrm           (!SharedLibMrm | ForceNormalLib)
187 #endif
188 #ifndef DebugLibMrm
189 # define DebugLibMrm            NO
190 #endif
191 #ifndef ProfileLibMrm
192 # define ProfileLibMrm          NO
193 #endif
194 #ifndef SharedMrmRev
195 # define SharedMrmRev           MotifSharedRev
196 #endif
197
198 #ifndef SharedLibUil
199 # define SharedLibUil           HasSharedLibraries
200 #endif
201 #ifndef NormalLibUil
202 # define NormalLibUil           (!SharedLibUil | ForceNormalLib)
203 #endif
204 #ifndef DebugLibUil
205 # define DebugLibUil            NO
206 #endif
207 #ifndef ProfileLibUil
208 # define ProfileLibUil          NO
209 #endif
210 #ifndef SharedUilRev
211 # define SharedUilRev           MotifSharedRev
212 #endif
213
214 #ifndef SharedLibACommon
215 # define SharedLibACommon       HasSharedLibraries
216 #endif
217 #ifndef NormalLibACommon
218 # define NormalLibACommon       (!SharedLibACommon | ForceNormalLib)
219 #endif
220 #ifndef DebugLibACommon
221 # define DebugLibACommon        NO
222 #endif
223 #ifndef ProfileLibACommon
224 # define ProfileLibACommon      NO
225 #endif
226 #ifndef SharedACommonRev
227 # define SharedACommonRev       MotifSharedRev
228 #endif
229
230 #ifndef SharedLibScript
231 # define SharedLibScript        HasSharedLibraries
232 #endif
233 #ifndef NormalLibScript
234 # define NormalLibScript        (!SharedLibScript | ForceNormalLib)
235 #endif
236 #ifndef DebugLibScript
237 # define DebugLibScript         NO
238 #endif
239 #ifndef ProfileLibScript
240 # define ProfileLibScript       NO
241 #endif
242 #ifndef SharedScriptRev
243 # define SharedScriptRev        MotifSharedRev
244 #endif
245
246 #ifndef SharedLibUtil
247 # define SharedLibUtil          HasSharedLibraries
248 #endif
249 #ifndef NormalLibUtil
250 # define NormalLibUtil          (!SharedLibUtil | ForceNormalLib)
251 #endif
252 #ifndef DebugLibUtil
253 # define DebugLibUtil           NO
254 #endif
255 #ifndef ProfileLibUtil
256 # define ProfileLibUtil         NO
257 #endif
258 #ifndef SharedUtilRev
259 # define SharedUtilRev          MotifSharedRev
260 #endif
261
262 #ifndef SharedLibCreate
263 # define SharedLibCreate        HasSharedLibraries
264 #endif
265 #ifndef NormalLibCreate
266 # define NormalLibCreate        (!SharedLibCreate | ForceNormalLib)
267 #endif
268 #ifndef DebugLibCreate
269 # define DebugLibCreate         NO
270 #endif
271 #ifndef ProfileLibCreate
272 # define ProfileLibCreate       NO
273 #endif
274 #ifndef SharedCreateRev
275 # define SharedCreateRev        MotifSharedRev
276 #endif
277
278 #ifndef SharedLibVisual
279 # define SharedLibVisual        HasSharedLibraries
280 #endif
281 #ifndef NormalLibVisual
282 # define NormalLibVisual        (!SharedLibVisual | ForceNormalLib)
283 #endif
284 #ifndef DebugLibVisual
285 # define DebugLibVisual         NO
286 #endif
287 #ifndef ProfileLibVisual
288 # define ProfileLibVisual       NO
289 #endif
290 #ifndef SharedVisualRev
291 # define SharedVisualRev        MotifSharedRev
292 #endif
293
294 #ifndef SharedLibSynth
295 # define SharedLibSynth         HasSharedLibraries
296 #endif
297 #ifndef NormalLibSynth
298 # define NormalLibSynth         (!SharedLibSynth | ForceNormalLib)
299 #endif
300 #ifndef DebugLibSynth
301 # define DebugLibSynth          NO
302 #endif
303 #ifndef ProfileLibSynth
304 # define ProfileLibSynth        NO
305 #endif
306 #ifndef SharedSynthRev
307 # define SharedSynthRev         MotifSharedRev
308 #endif
309
310 #ifndef SharedLibMCommon
311 # define SharedLibMCommon       HasSharedLibraries
312 #endif
313 #ifndef NormalLibMCommon
314 # define NormalLibMCommon       (!SharedLibMCommon | ForceNormalLib)
315 #endif
316 #ifndef DebugLibMCommon
317 # define DebugLibMCommon        NO
318 #endif
319 #ifndef ProfileLibMCommon
320 # define ProfileLibMCommon      NO
321 #endif
322 #ifndef SharedMCommonRev
323 # define SharedMCommonRev       MotifSharedRev
324 #endif
325
326 #ifndef XmClientLibs
327 # define XmClientLibs $(XMLIB) $(XTOOLLIB) $(XLIB) $(XMEXTRA_LIBS)
328 #endif
329 #ifndef XmClientDepLibs
330 # define XmClientDepLibs $(DEPXMLIB) $(DEPXTOOLLIB) $(DEPXLIB)
331 #endif
332
333 #ifndef MrmClientLibs 
334 # define MrmClientLibs $(MRESOURCELIB) $(XMLIB) $(XTOOLLIB) $(XLIB) $(XMEXTRA_LIBS)
335 #endif
336 #ifndef MrmClientDepLibs
337 # define MrmClientDepLibs $(DEPMRESOURCELIB) $(DEPXMLIB) $(DEPXTOOLLIB) $(DEPXLIB)
338 #endif
339
340 #ifndef UilClientLibs
341 # define UilClientLibs $(UILLIB) $(MRESOURCELIB) $(XMLIB) $(XTOOLLIB) $(XLIB) $(XMEXTRA_LIBS)
342 #endif
343 #ifndef UilClientDepLibs
344 # define UilClientDepLibs $(DEPUILLIB) $(DEPMRESOURCELIB) $(DEPXMLIB) $(DEPXTOOLLIB) $(DEPXLIB)
345 #endif
346
347 #ifndef TestClientLibs
348 # define TestClientLibs $(PURIFYLIBS) $(TESTCOMLIB) \
349                 $(AUTOSCRIPTLIB) $(AUTOUTILLIB) \
350                 $(AUTOCREATELIB) $(AUTOVISUALLIB) $(AUTOSYNTHLIB) \
351         $(XMLIB) $(TESTGEOLIB) $(XTOOLLIB) $(XLIB) \
352         $(AUTOEXTRALIBS) $(XMEXTRA_LIBS)
353 #endif
354 #ifndef TestUilClientLibs
355 # define TestUilClientLibs $(PURIFYLIBS) $(TESTUILCOMLIB) $(TESTCOMLIB) \
356                 $(AUTOSCRIPTLIB) $(AUTOUTILLIB) \
357                 $(AUTOCREATELIB) $(AUTOVISUALLIB) $(AUTOSYNTHLIB) \
358         $(UILLIB) $(MRESOURCELIB) $(XMLIB) $(TESTGEOLIB) \
359         $(XTOOLLIB) $(XLIB) $(AUTOEXTRALIBS) $(XMEXTRA_LIBS)
360 #endif
361 #ifndef TestClientDepLibs
362 # define TestClientDepLibs XmClientDepLibs
363 #endif
364 #ifndef TestUilClientDepLibs
365 # define TestUilClientDepLibs UilClientDepLibs
366 #endif
367
368 /* hardcoded default path.  Contrary to the original duplicate of USRLIBDIR
369    in the Imakefiles. */
370 #ifndef VirtualBindingsPath
371 # define VirtualBindingsPath /usr/lib/Xm/bindings
372 #endif
373
374               MTOP = MTop
375 TOP_MOTIF_INCLUDES = -I$(MINCLUDESRC)
376 #if defined(UseInstalled) || (UseInstalledMotif && UseInstalledX11)
377       UIL_INCLUDES = -I$(USRINCDIR)/uil
378 #else
379       UIL_INCLUDES = -I$(UILSRC)
380 #endif
381 #ifdef BuildLibPathVar
382     MOTIFENVLIBDIR = MotifBuildLibPath
383 #endif
384
385 /* Message catalog usage */
386 #ifndef GencatCmd
387 # define GencatCmd              gencat
388 #endif
389 #ifndef GencatFlags
390 # define GencatFlags            /**/
391 #endif
392 #if defined(NoMessageCatalog)
393 # define BuildMessageCatalog    NO
394 # define MessageCatalogDefines  -DNO_MESSAGE_CATALOG
395 #else
396 # define BuildMessageCatalog    YES 
397 # define MessageCatalogDefines  /**/
398 #endif
399 #ifndef MessageCatalogRule
400 # if BuildMessageCatalog
401 #  define MessageCatalogRule(prefix)    Real_MessageCatalogRule(prefix)
402 # else
403 #  define MessageCatalogRule(prefix)    Stub_MessageCatalogRule(prefix)
404 # endif
405 #endif
406
407       USRINCDIR = UsrIncDir
408          UIDDIR = UidDir
409         TESTSRC = $(MTOP)/tests
410         TESTLIB = $(TESTSRC)/lib
411   GENERALSRCLIB = $(TESTSRC)/General/lib
412   GENERALSRCBIN = $(TESTSRC)/General/bin
413    MANUALSRCLIB = $(TESTSRC)/Manual/lib
414    MANUALSRCBIN = $(TESTSRC)/Manual/bin
415      AUTOSRCLIB = $(TESTSRC)/Auto/lib
416      AUTOSRCBIN = $(TESTSRC)/Auto/bin
417        COMMONPP = $(GENERALSRCBIN)/Commonpp
418          GENRUN = $(GENERALSRCBIN)/Genrun
419          MANRUN = $(GENERALSRCBIN)/Manrun
420 #ifdef DebugLib
421   TESTMALLOCSRC = $(GENERALSRCLIB)/Malloc
422 #endif
423 #ifdef DebugGeometry
424      TESTGEOSRC = $(TESTLIB)/Geometry
425 #endif
426 #ifdef Automation
427      TESTCOMSRC = $(AUTOSRCLIB)/Common
428   AUTOSCRIPTSRC = $(AUTOSRCLIB)/Script
429    AUTOSYNTHSRC = $(AUTOSRCLIB)/Synth
430   AUTOCREATESRC = $(AUTOSRCLIB)/Create
431   AUTOVISUALSRC = $(AUTOSRCLIB)/Visual
432     AUTOUTILSRC = $(AUTOSRCLIB)/Util
433   AUTOEXTRALIBS = -ll -ly -lm
434 #else
435      TESTCOMSRC = $(MANUALSRCLIB)/Common
436 #endif
437
438     BUILDDOCDIR = BuildDocDir
439     BUILDLOCDIR = BuildLocDir
440
441 /* MTOOLKITSRC  should be removed */
442     MTOOLKITSRC = $(TOOLKITSRC)
443 #if ImportMotif || UseInstalledMotif
444         MDOCSRC = $(MTOP)/doc
445         MLOCSRC = $(MTOP)/localized
446 #else
447         MLOCSRC = $(MTOP)/exports/localized
448 #endif
449 #if defined(TopMotifInclude)
450     MINCLUDESRC = TopMotifInclude
451 #elif ImportMotif || UseInstalledMotif
452     MINCLUDESRC = $(MTOP)/include
453 #else
454     MINCLUDESRC = $(MTOP)/exports/include
455 #endif
456         MLIBSRC = $(MTOP)/lib
457      MCLIENTSRC = $(MTOP)/clients
458        MDEMOSRC = $(MTOP)/demos
459      MWIDGETSRC = $(MLIBSRC)/Xm
460    MRESOURCESRC = $(MLIBSRC)/Mrm
461          UILSRC = $(MCLIENTSRC)/uil
462 #ifdef MotifProjectRoot
463    MPROJECTROOT = MotifProjectRoot
464 #endif
465
466             UIL = _MUse(uil,$(UILSRC)/uil)
467          DEPUIL = _MUseCat($(BINDIR),$(UILSRC),/uil)
468
469    XMEXTRA_LIBS = XmExtraLibraries
470
471 /* These libraries use UseInstalledMotif instead of UseInstalled. */
472 #undef _Use
473 #undef _UseCat
474 #define _Use    _MUse
475 #define _UseCat _MUseCat
476
477 #ifndef MBuildLibDir
478 # define MBuildLibDir   BuildLibDir
479 #endif
480
481 #if SharedLibXm
482 SharedLibReferences(XM,Xm,$(MWIDGETSRC),SOXMREV,SharedXmRev)
483 #else
484 ProjectUnsharedLibReferences(XM,Xm,$(MWIDGETSRC),MBuildLibDir)
485 #endif
486
487 #if SharedLibMrm
488 SharedLibReferences(MRESOURCE,Mrm,$(MRESOURCESRC),SOMRMREV,SharedMrmRev)
489 #else
490 ProjectUnsharedLibReferences(MRESOURCE,Mrm,$(MRESOURCESRC),MBuildLibDir)
491 #endif
492
493 #if SharedLibUil
494 SharedLibReferences(UIL,Uil,$(UILSRC),SOUILREV,SharedUilRev)
495 #else
496 ProjectUnsharedLibReferences(UIL,Uil,$(UILSRC),MBuildLibDir)
497 #endif
498
499 #ifdef DebugGeometry
500 ProjectUnsharedLibReferences(TESTGEO,XtGeo,$(TESTGEOSRC),MBuildLibDir)
501 #endif
502
503 #if Automation
504
505 # if SharedLibACommon
506 SharedLibReferences(TESTCOM,ACommon,$(TESTCOMSRC),SOACOMMONREV,SharedACommonRev)
507 # else
508 ProjectUnsharedLibReferences(TESTCOM,ACommon,$(TESTCOMSRC),MBuildLibDir)
509 # endif
510
511 TESTUILCOMLIB = $(TESTCOMSRC)/libACommonUil.a
512
513 # if SharedLibScript
514 SharedLibReferences(AUTOSCRIPT,Script,$(AUTOSCRIPTSRC),SOSCRIPTREV,SharedScriptRev)
515 # else
516 ProjectUnsharedLibReferences(AUTOSCRIPT,Script,$(AUTOSCRIPTSRC),MBuildLibDir)
517 # endif
518
519 # if SharedLibSynth
520 SharedLibReferences(AUTOSYNTH,Synth,$(AUTOSYNTHSRC),SOSYNTHREV,SharedSynthRev)
521 # else
522 ProjectUnsharedLibReferences(AUTOSYNTH,Synth,$(AUTOSYNTHSRC),MBuildLibDir)
523 # endif
524
525 # if SharedLibCreate
526 SharedLibReferences(AUTOCREATE,Create,$(AUTOCREATESRC),SOCREATEREV,SharedCreateRev)
527 # else
528 ProjectUnsharedLibReferences(AUTOCREATE,Create,$(AUTOCREATESRC),MBuildLibDir)
529 # endif
530
531 # if SharedLibVisual
532 SharedLibReferences(AUTOVISUAL,Visual,$(AUTOVISUALSRC),SOVISUALREV,SharedVisualRev)
533 # else
534 ProjectUnsharedLibReferences(AUTOVISUAL,Visual,$(AUTOVISUALSRC),MBuildLibDir)
535 # endif
536
537 # if SharedLibUtil
538 SharedLibReferences(AUTOUTIL,Util,$(AUTOUTILSRC),SOUTILREV,SharedUtilRev)
539 # else
540 ProjectUnsharedLibReferences(AUTOUTIL,Util,$(AUTOUTILSRC),MBuildLibDir)
541 # endif
542
543 #else   /* Manual */
544
545 # if SharedLibMCommon
546 SharedLibReferences(TESTCOM,MCommon,$(TESTCOMSRC),SOMCOMMONREV,SharedMCommonRev)
547 # else
548 ProjectUnsharedLibReferences(TESTCOM,MCommon,$(TESTCOMSRC),MBuildLibDir)
549 # endif
550 TESTUILCOMLIB = $(TESTCOMSRC)/libMCommonUil.a
551
552 #endif  /* Automation */
553
554
555 /* Revert to the normal library rules. */
556 #undef _Use
557 #undef _UseCat
558 #define _Use    _XUse
559 #define _UseCat _XUseCat
560
561
562 #ifdef UsePurify
563      PURIFYLIBS = $(PURIFYHOME)/purify_stubs.a
564 #endif
565   LINTMRESOURCE = $(MRESOURCESRC)/libMrm.a
566 LINTXMWIDGETLIB = $(MWIDGETSRC)/llib-l/Xm.ln
567      LINTXMTOOL = $(MTOOLKITSRC)/llib-lXt.ln
568      LINTUILLIB = $(UILSRC)/llib-lUil.ln
569
570       YACCFLAGS = YaccFlags
571        UILFLAGS = UilFlags
572     GENCATFLAGS = GencatFlags
573          GENCAT = GencatCmd $(GENCATFLAGS)
574       MKCATTOOL = $(TOP)/programs/localized/util/mkcatdefs
575
576          RM_CMD = $(RM) FilesToClean ExtraFilesToClean TestExtraFilesToClean
577
578 #if NeedDefaultDepLibs
579 # if HasSharedLibraries || defined(UseInstalled)
580         DEPLIBS = $(DEPXMLIB) $(DEPXTOOLLIB) $(DEPXLIB)
581 # else
582         DEPLIBS = $(LOCAL_LIBRARIES)
583 # endif
584        DEPLIBS1 = $(DEPLIBS)
585        DEPLIBS2 = $(DEPLIBS)
586        DEPLIBS3 = $(DEPLIBS)
587 #endif /* NeedDefaultDepLibs */
588
589 /* check for existence of Dtinfo Motif Documents */
590 #if defined(LinuxArchitecture)
591       MOTIF_DOC = $(shell if test -f $(MDOCSRC)/C/guides/bookcase.bc; then echo -D_MOTIFDOC_; fi)
592 #elif defined(SunArchitecture)
593   MOTIF_DOC :sh = if test -f ../imports/motif/doc/C/guides/bookcase.bc; then echo -D_MOTIFDOC_; else echo; fi
594 #elif defined(BSDArchitecture)
595      MOTIF_DOC != if test -f $(MDOCSRC)/C/guides/bookcase.bc; then echo -D_MOTIFDOC_; else echo; fi
596 #else
597       MOTIF_DOC = -D_MOTIFDOC_
598 #endif