Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!tut.cis.ohio-state.edu!snorkelwacker!bloom-beacon!denali.wv.tek.COM!paulsh From: paulsh@denali.wv.tek.COM (Paul Shearer) Newsgroups: comp.windows.x Subject: Re: Bug with imake (I think) Message-ID: <9007311753.AA01310@denali.WV.TEK.COM> Date: 31 Jul 90 17:53:50 GMT References: <1244@sirius.ucs.adelaide.edu.au> Sender: daemon@athena.mit.edu (Mr Background) Organization: The Internet Lines: 119 This is NOT an imake bug. The mistake made below is a common one. The user should remember the general rule that Make macros are all capitals and the cpp macros have only the first letter capitalized. Thus the convention is: ALL_CAPITALS this is a Makefile macro FirstLetterCapital this is a cpp macro to be set in configuration files Remember that the Makefile is built from Imake.tmpl which expands the following files in this order: machine.cf site.def Project.tmpl Imake.rules Imakefile The file that contains the defalut cpp macro "DefaultUserPath" is Project.tmpl. The correct fix is to set the cpp macro in either your machine.cf file if you want to change it only on your platform, or in site.def if you want to change it in all platforms you are building at your site. Thus see the fix below: > In my continuous quest to make X happily live in /usr/local/... (and > to install the various fixes) I have run into what looks like a bug. > > In mit/clients/xdm/Imakefile there is a section of "code" > > /**/# > /**/# Special definitions for compiling default resources; these parameters > /**/# should be set in util/imake.includes/site.def or the appropriate .macros > /**/# file in that directory. The lack of initial spaces is to prevent imake > /**/# from accidently turning the lines into rules by putting a leading tab. > /**/# > /**/# Do NOT change these lines! > /**/# > DEF_SERVER = $(BINDIR)/X > DEF_USER_PATH = DefaultUserPath /* no leading spaces or imake will */ > DEF_SYSTEM_PATH = DefaultSystemPath /* indent as rule */ > BOURNE_SHELL = DefaultSystemShell > CPP_PROGRAM = CppCmd > > When you try adding #define's to site.def to set these values, such as > > #ifndef DEF_USER_PATH > #define DEF_USER_PATH ":/usr/bin:/usr/local/bin/X11:/usr/ucb:/usr/local/bin" > #endif > #ifndef DEF_SYSTEM_PATH > #define DEF_SYSTEM_PATH "/etc:/usr/bin:/usr/local/bin/X11:/usr/ucb:/usr/local/bin" > #endif > No, the correct fix is to define the cpp macro, not the Makefile macro. If you do this in site.def it will override the MIT defaults provided in the file Project.tmpl which is expanded after site.def. If someone on a platform at your site defines them differently in their machine.cf file they will get their definitions, since machine.cf is expanded before site.def. #ifndef DefaultUserPath #define DefaultUserPath ":/usr/bin:/usr/local/bin/X11:/usr/ucb:/usr/local/bin" #endif #ifndef DefaultSystemPath #define DefaultSystemPath "/etc:/usr/bin:/usr/local/bin/X11:/usr/ucb:/usr/local/bin" #endif The Makefile below gave the following results because the real default cpp macros on the right of the = were defined in Project.tmpl and you incorrectly defined the Makefile Macro on the left of the = in your site.def. > The resulting Makefile (after make World) gives > > # > # Special definitions for compiling default resources; these parameters > # should be set in util/imake.includes/site.def or the appropriate .macros > # file in that directory. The lack of initial spaces is to prevent imake > # from accidently turning the lines into rules by putting a leading tab. > # > # Do NOT change these lines! > # > DEF_SERVER = $(BINDIR)/X > ":/usr/bin:/usr/local/bin/X11:/usr/ucb:/usr/local/bin" = > :/bin:/usr/bin:$(BINDIR):/usr/ucb > "/etc:/usr/bin:/usr/local/bin/X11:/usr/ucb:/usr/local/bin" = > /etc:/bin:/usr/bin:$(BINDIR):/usr/ucb > BOURNE_SHELL = /bin/sh > CPP_PROGRAM = /lib/cpp > > Which doesn't work (strangely enough). Since DEF_*_PATH are only used in > resource.c (in that directory) I removed the definitions from site.def, > but it means that I can't modify the default paths this way which is a pain. > > Any suggestions? > > Also if anyone has a list of places I should have modified to make X work > Mark Prior Phone : +61 8 228 5680 > University Computing Services Telex : UNIVAD AA89141 > University of Adelaide Fax : +61 8 223 6245 > GPO Box 498 Adelaide S.AUSTRALIA 5001 E-mail: mrp@ucs.adelaide.edu.au Paul Shearer M.S. 61-049 Tektronix, Inc. P.O. Box 1000 Wilsonville, OR 97070-1000 W (503) 685-2137 FAX (503) 682-1500 paulsh@orca.wv.tek.com tektronix!orca!paulsh