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