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
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
|
X Window System
Imake Configuration Guide
Release 4
Abstract
This document describes the various parameters that are used to configure this
release of the X Window System. It should be read by anyone who is porting X
to a new platform or attempting to change the default installation.
0. Overview
Sources for a paper giving an overview of the build system may be found in
./doc/config/usenixws/paper.ms.
1. Introduction
Because Makefiles are inherently unportable, this release uses a tool called
Imake to generate platform-specific Makefiles from machine-independent
descriptions called Imakefiles. It makes very heavy use of the C preprocessor
both for constants and macro functions and can be somewhat tricky to master.
However, it is invaluable for making the release easy to configure on a wide
variety of machines.
Imakefiles usually contain definitions of make variables plus one or more
invocations of macro functions to build the desired parts of the Makefile.
Imake reads a template file containing definitions that are common to all
Makefiles, which includes a machine-specific file containing definitions for
the various commonly used commands and flags for enabling certain build
options. It then includes a rules file in which all of the various macro
functions are defined followed by the Imakefile being processed. Finally,
it appends a set of common rules to the bottom.
2. The template file
All of the common configuration parameters and make rules are located in
the file Imake.tmpl. The top of the file defines some useful constants
and then has a series of conditional blocks for setting the platform type.
This requires that there be a unique preprocessor symbol that can be used to
identify which configuration block to use. Systems whose cpp does not define
such a symbol must add one to the cpp_argv table in config/imakemdep.h and
build with BOOTSTRAPCFLAGS set to the appropriate name. Any additional flags
(such as -DSYSV or -DUSG) that are needed to compile imake.c should be added
to the file ccflags.c.
Each block defines several symbol names representing the type of system
being configured:
#define MacroIncludeFile "PLATFORM.cf"
#define MacroFile PLATFORM.cf
#define PLATFORMArchitecture
where PLATFORM is the type of the system being configured. The redundant
versions are needed because one is used by cpp to include the file and the
other is used in generating filenames. The Architecture variable may be
used in Imakefiles to obtain platform-specific rules or values. The unique
symbols that were used to select the configuration block are then undefined
to prevent Imakefiles from using system-dependent rules as opposed to
platform-dependent (some platforms run on multiple systems).
The rest of the template file should not be edited. Server-specific changes
can be made in the appropriate .cf file and site-specific changes can be
made in site.def. Any parameter that is not set will be given a default value
in the appropriate .tmpl file. THESE DEFAULTS SHOULD NOT BE CHANGED.
3. Server-specific .cf file
Differences between operating systems are handled by setting various
configuration parameters in the .cf files. The easiest way to create
a new one is to:
o find a configuration similar to yours or start with generic.cf.
o set the SystemV variable if your OS is based on SVR2.
o set the OSName, OSMajorVersion, and OSMinorVersion variables.
o set BuildServer to NO if you are doing a client-only build.
o look at the other .cf files, Imake.tmpl, and Project.tmpl to see
if there are any variables you'd like to set; common ones include:
HasSockets, HasVFork, HasVoidSignalReturn, HasBsearch,
HasPutenv, NeedBerklibInXlib, ConnectionFlags, CcCmd, LnCmd,
setTtyGroup, UnalignedReferencesAllowed
Imake.tmpl provides defaults for the following variables:
ArCmd command used to create libraries
AsCmd command used to run assembler
BootstrapCFlags missing cpp symbols needed to get started
BourneShell command used to run Bourne Shell
CURDIR current directory relative to top of sources
CcCmd command to run C compiler
CompatibilityFlags flags turn on backwards compatibility
CompressCmd command to run compress program
ConstructMFLAGS System V option to set MFLAGS make variable
CpCmd command to copy one file to another
CppCmd command to run C preprocessor
DebuggableCDebugFlags C compiler -I's and -D's to turn on debug info
DefaultCCOptions default special C compiler options
DefaultCDebugFlags debug/optimize flags for programs
DestDir prefix to root directory when installed
ExecableScripts boolean for systems that can exec() #!/bin/sh
ExtraLibraries system-specific libraries need to link
ExtraLoadFlags system-specific loader flags
FilesToClean files to delete in make clean
FortranCmd command to run Fortran compiler
FortranDebugFlags flags for Fortran debug info
FortranFlags Fortran compiler flags
HasBsearch boolean for libc has bsearch()
HasDESLibrary boolean for system has DES library
HasFortran boolean for system has Fortran compiler
HasGcc boolean for system has GNU C compiler
HasLargeTmp boolean for system has /tmp space
HasNdbm boolean for system has ndbm routines
HasPutenv boolean for libc has putenv()
HasSaberC boolean for system has Saber C
HasSharedLibraries boolean for system has shared libraries
HasSockets boolean for system has BSD sockets
HasSunOSSharedLibraries boolean for system has SunOS shared libs
HasVFork boolean for system has vfork()
HasVoidSignalReturn boolean for POSIX signal() procs
IncRoot parent of X11 include directory
InstDatFlags install flags for data files
InstIncFlags install flags for header files
InstKmemFlags install flags for xload to get at /dev/kmem
InstLibFlags install flags for libraries
InstManFlags install flags for manual pages
InstPgmFlags install flags for normal programs
InstScrFlags install flags for scripts
InstUidFlags install flags for xterm to chown /dev/ptys
InstallCmd command to install files
LdCmd command to run loader
LdCombineFlags flags for incremental loading
LibraryCCOptions special C compiler options for libraries
LibraryCDebugFlags library debug/optimize flags to override defs
LibraryCcCmd command to run C compiler in libraries
LintCmd command to run lint
LintLibFlag flags to generate lint libraries
LintOpts lint options to control strictness
LnCmd command to link two files
LoaderLibPrefix loader flags before libraries
MacroFile name of machine-dependent config params file
MacroIncludeFile <MacroFile>
MakeCmd command to run make
MvCmd command to rename a file
NdbmDefines -D's to turn on use of ndbm routines
NeedFunctionPrototypes whether or not to force function prototypes
NeedWidePrototypes whether or not to widen function prototypes
NoOpCDebugFlags C compiler flags to not debug or optimize
OSMajorVersion major version number of operating system
OSMinorVersion minor version number of operating system
OptimizedCDebugFlags C compiler flags to turn on optimization
PexCDebugFlags special -D's for PEX
PreProcessCmd command to run /lib/cpp on scripts
RanlibCmd command to clean up libraries
RanlibInstFlags flags to ranlib after copying
RmCmd command to delete files
ServerCCOptions server C compiler options to override defaults
ServerCcCmd command to run C compiler in server
SharedCodeDef -D's to turn on sharable code in libraries
SharedLibraryDef -D's to turn on use of shared libraries
StandardCppDefines -D's for running cpp
StandardDefines -D's for running C compiler
StandardIncludes -I's for running C compiler
StripInstalledPrograms boolean for sites that want to install -s
SystemV boolean for systems that are at least SVR2
TOPDIR relative path to top of sources
TagsCmd command to run tags
UNCOMPRESSPATH command to run uncompress
UnalignedReferencesAllowed boolean for unaligned copies ok
UsrLibDir directory in which to install libraries
Project.tmpl provides defaults for the following variables:
AdmDir directory containing system log files
AllocateLocalDefines -D's to turn on alloca()
AwmDir directory containing awm config files
BDFTOSNFFILT command to run bdftosnf
BandAidLibraryNeeded boolean for systems that need extra Xlib stuff
BandAidLibraryObjects Xlib object files to merge in
BandAidLibrarySources Xlib source files to merge in
BinDir directory in which to install programs
BuildExamples boolean controlling make of examples stuff
BuildIncRoot relative path to location of headers in build
BuildIncTop path from build includes directory to top
BuildServer boolean controlling make of server stuff
BuildXawBC boolean controlling R3 compatibility in Xaw
ConfigDir install directory for config files
ConnectionFlags -D's for supported transports
ContribDir location of user-contributed sources
DebugLibX boolean for compiling extra Xlib -g
DebugLibXArchive boolean for building extra libX11_g.a
DebugLibXaw boolean for compiling/building) libXaw_g
DebugLibXext boolean for compiling/building) libXext_g
DebugLibXmu boolean for compiling/building) libXmu_g
DebugLibXt boolean for compiling/building) libXt_g
DebugOldLibX boolean for compiling/building) liboldX_g
DefaultFontPath default server font path
DefaultRGBDatabase default server rgb color database
DefaultSystemPath default system xdm PATH environment variable
DefaultSystemShell default /bin/sh
DefaultUserPath default user xdm PATH environment variable
DependCmd command to run makedepend
DependDir build directory containing makedepend program
DoInstallExtensionsIntoXlib merge -lXext into -lX11
ExtensionDefines -D's for extensions
FontCompilerFlags flags for bdftosnf
FontDefines -D's to turn on font options
FontDir directory in which to install fonts
FontFilters -D's to specify font conversion filters
GwmDir directory in which to install gwm config stuff
HasInputExtension boolean for systems that want XInput extension
IncRoot parent directory of installed header files
InstallAppDefFiles boolean for installing new app defaults files
InstallOldHeaderFiles boolean for installing R3-compatible headers
InstallXdmConfig boolean for installing xdm config files
InstallXinitConfig boolean for installing xinit files
LibDir directory in which to install X11 data files
LibManSuffix man suffix for library pages
LibmanDir directory in which to install library man pages
LibraryDefines -D's for libraries
LintlibDir directory in which to install lint libs
ManDir directory in which to install program man pages
ManDirectoryRoot parent of man directories relative to root
ManPath full path of parent directory
ManSourcePath common prefix of man page directories
ManSuffix man suffix for programs
NeedBerklibInXlib boolean for systems that need BSD emulation
NeedDefaultDepLibs boolean for enabling default DEPLIBS
PrimaryScreenResolution resolution of default server screen
ProfileLibX boolean for compiling -p Xlib
ProfileLibXArchive boolean for building libX11_p
ProfileLibXaw boolean for compiling/building libXaw_p
ProfileLibXext boolean for compiling/building libXext_p
ProfileLibXmu boolean for compiling/building libXmu_p
ProfileLibXt boolean for compiling/building libXt_p
ProfileOldLibX boolean for compiling/building liboldX_p
ProjectX boolean indicating this is the X Window System
RemoveTargetProgramByMoving boolean for rm -f that doesn't
SHELLPATH -D for /bin/sh
ServerCDebugFlags server debug/opt compiler flags
ServerDefines -D's for server
SharedLibX boolean for making sharable libX11
SharedLibXaw boolean for making sharable libXaw
SharedLibXext boolean for making sharable libXext
SharedLibXmu boolean for making sharable libXmu
SharedLibXt boolean for making sharable libXt
SharedOldLibX boolean for making sharable liboldX
SharedOldXRev version number for shared libX11
SharedXawRev version number for shared libXaw
SharedXextRev version number for shared libXext
SharedXlibRev version number for shared libXmu
SharedXmuRev version number for shared libXt
SharedXtRev version number for shared liboldX
TwmDir directory in which to install twm config files
UNCOMPRESSFILT -D of command to run uncompress
UseCCMakeDepend boolean for using alternate makedepend script
XAppLoadDir directory in which to install app defaults
XawClientDepLibs DEPLIBS for clients that use Xaw
XawClientLibs LOCAL_LIBRARIES for clients that use Xaw
XdmConfigurationSubdirectory name of default xdm configuration
XdmDir directory in which to install xdm files
XinitDir directory in which to install xinit files
ZBDFTOSNFFILT -D to run uncompress and bdftosnf
4. Site-specific site.def file
The site.def file is used to set configuration parameters that apply to all all
servers in a given site. It should use #ifndef so that servers may still
override it. The second use for site.def is to define installation directories
and flags. The following additional build parameters are defined:
HasXcuWidgets include Xcu make variables in Makefiles
HasXwWidgets include Xw make variables in Makefiles
5. Imakefiles
Individual Imakefiles may use any of the macros defined in Imake.rules. Many
of these rules use auxillary make variables:
FILE used by lint1 phase
INSTALLFLAGS used by default installs
LINTLIBS used by NormalLintTarget
LOCAL_LIBRARIES used by ComplexProgramTarget
MAKEFILE_SUBDIR used by MakeMakeSubdirs
OBJS used by ComplexProgramTarget
OBJS1 used by ComplexProgramTarget_1
OBJS2 used by ComplexProgramTarget_2
OBJS3 used by ComplexProgramTarget_3
PROGRAM used by ComplexProgramTarget
PROGRAMS used by ComplexProgramTarget_1
SRCS used by DependTarget
SRCS1 used by DependTarget
SRCS2 used by DependTarget
SRCS3 used by DependTarget
The easiest way to write an Imakefile is to find another one that does the
same thing and modify it.
The most important guidelines are that the X Libraries be refered to by their
make variables names (e.g. $(XLIB)) rather than -llib, and should go in
LOCAL_LIBRARIES rather than SYSTEM_LIBRARIES (which is only for things like
-lm).
|