X Window System Imake Configuration Guide Release 4beta 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 util/imake/imake.c 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: SystemV whether or not based on SVR2 OSMajorVersion major version number of OS OSMinorVersion minor version number of OS UnalignedReferencesAllowed if allowed to deref arbitrary addresses ExecableScripts if scripts with #! may be exec'ed BourneShell filename of Bourne shell ConstructMFLAGS whether or not to do MFLAGS with MAKEFLAGS HasSockets whether or not system has bsd sockets HasVFork whether or not libc has vfork() HasPutenv whether or not libc has putenv() HasVoidSignalReturn whether or not signal() proc is type void HasBsearch whether or not libc has bsearch() HasSaberC whether or not system has Saber C IncRoot path below which X11 includes live UNCOMPRESSPATH name of uncompress program OptimizedCDebugFlags C compiler flags to turn on optimizer DebuggableCDebugFlags C compiler flags to turn on debugger NoOpCDebugFlags C compiler default flags DefaultCDebugFlags one of previous 3 for compiling programs LibraryCDebugFlags one of previous 3 for compiling libraries DefaultCCOptions C compiler flags for floating point, etc. LibraryCCOptions C compiler flags for libraries for f.p. etc. ServerCCOptions C compiler flags for server for f.p. etc. InstBinFlags install modes for program binaries InstUidFlags install modes for setuid programs (xterm) InstLibFlags install modes for libraries InstIncFlags install modes for includes InstManFlags install modes for manual pages InstDatFlags install modes for data files InstKmemFlags install modes for setgid kmem programs (xload) ArCmd command to create and add to libraries BootstrapCFlags initial -Dmacro for systems that don't have 'em CcCmd command to run C compiler AsCmd command to run assembler CompressCmd command to run compress CppCmd command to run C preprocessor PreProcessCmd command to run cpp with C default defines InstallCmd command to do bsd-style install LdCmd command to run loader LintCmd command to run linter LintLibFlag flag to tell lint to create a library LintOpts default lint options CpCmd command to copy a file LnCmd command to soft link (if possible) a file MakeCmd command to make from Makefile MvCmd command to rename a file RanlibCmd command to run after creating a library RanlibInstFlags special flags to ranlib for installed libs RmCmd command to remove a file StandardCppDefines defines for cpp'ing scripts StandardDefines defines and flags for C compiler ExtraLibraries special libraries at end of load line ExtraLoadFlags special flags for load lines CompatibilityFlags defines for turning on source code compat TagsCmd command for generating C tags Project.tmpl provides defaults for the following variables: BuildServer whether or not to build a server InstallXinitConfig whether or not to install xinit config stuff InstallXdmConfig whether or not to install xdm config stuff InstallAppDefFiles whether or not to install app-defaults InstallOldHeaderFiles whether or not to install old include files NeedBerklibInXlib whether or not need BSDisms in Xlib ManDirectoryRoot top of manual pages ManSuffix suffix for X program manual pages LibManSuffix suffix for Xlib manual pages UNCOMPRESSFILT define for server command to uncompress stdin BDFTOSNFFILT define for server command to compile bdf files SHELLPATH define for server command to run shell ZBDFTOSNFFILT define for server command to uncompress,comp FontFilters define for server for filters to provide PrimaryScreenResolution resolution of primary screen for servers DefaultFontPath default font path for servers DefaultRGBDatabase default rgb database path for servers FontCompilerFlags flags for font compiler ConnectionFlags flags for turning on networking transports FontDefines server compile flags for enabling font filters ExtensionDefines types of extensions desired ServerCDebugFlags C compiler flags for server LibraryDefines special C compiler for building libraries ServerDefines special C compiler flags for building servers BinDir path for installed programs IncRoot path for top of X11 includes directory LibDir path for installed libraries ConfigDir path for installed config stuff LintlibDir path for installed lint libraries FontDir path for installed fonts AdmDir path for system administrative directories XinitDir path for xinit config stuff XdmDir path for xdm config stuff XdmConfigurationSubdirectory default xdm config sources AwmDir path for installed awm default stuff TwmDir path for installed twm default stuff GwmDir path for installed gwm default stuff ManPath macro for directory where to put man pages ManSourcePath macro for subdirectory where to put man pages ManDir macro for program man page subdir LibmanDir macro for library man page subdir XAppLoadDir path for installed app-defaults OsNameDefines define for giving OS name DefaultUserPath default user login path for xdm DefaultSystemPath default system path for xdm DefaultSystemShell default shell for xdm UseCCMakeDepend whether or not to use slow shell script DependDir source directory for makedepend DependCmd command to run make depend RemoveTargetProgramByMoving whether or not files removed by moving HasSunOSSharedLibraries whether or not system has SunOS 4.0 shared libs SharedXlib whether or not to share Xlib SharedXlibRev version for shared Xlib BandAidLibraryNeeded whether or not Xlib needs extra files BandAidLibrarySources extra Xlib source files BandAidLibraryObjects extra Xlib object files NeedDefaultDepLibs whether or not Imakefiles have been updated 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. We strongly recommend that people try to use the default directories if at all possible so that X11 can coexist peacefully with X10. 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.