README revision 591
0b062f4990db5cc6db2fe3398926f71b92a67407Brian WellingtonThis is documentation of the Makefile system used in this tree.
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein
75c0816e8295e180f4bc7f10db3d0d880383bc1cMark AndrewsGeneral Overview:
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein-----------------
0b062f4990db5cc6db2fe3398926f71b92a67407Brian WellingtonThis tree builds dozens of open source modules that are each released
0b062f4990db5cc6db2fe3398926f71b92a67407Brian Wellingtonseparately and delivered as source in seperate tarballs. These modules
0b062f4990db5cc6db2fe3398926f71b92a67407Brian Wellingtonare organized in subdirectories based on the X.Org module list, though
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austeinmodules from other sources are included as appropriate. For instance,
8a66318e41ed14c5a88130e8c362610e8faa2121Mark Andrewsthe application xterm is built in open-src/app/xterm, while the fontconfig
8a66318e41ed14c5a88130e8c362610e8faa2121Mark Andrewslibrary is in open-src/lib/fontconfig.
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein
8a66318e41ed14c5a88130e8c362610e8faa2121Mark AndrewsIn this tree, the term "module" is used for a specific set of source built
8a66318e41ed14c5a88130e8c362610e8faa2121Mark Andrewsgenerally from a single tarball from upstream, such as xterm or fontconfig.
8a66318e41ed14c5a88130e8c362610e8faa2121Mark AndrewsThe directories grouping these together are referred to as "module type"
8a66318e41ed14c5a88130e8c362610e8faa2121Mark Andrewsdirectories - app, lib, font, etc. Each module is thus found in a
0b062f4990db5cc6db2fe3398926f71b92a67407Brian Wellingtonsubdirectory of the form open-src/<module type>/<module> . Various flags
94fc951a9b5679def2a05387a5c251f5cb8eb9c9Mark Andrewscan be set at either the individual module level or for all modules of a
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austeinmodule type.
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob AusteinFor each module, at build time the tarball is unpacked, patches applied for
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austeinpost-release bug fixes or customizations, and then the build is run.
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob AusteinTo allow building both 32-bit and 64-bit versions in the same build,
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austeinthis all happens in subdirectories named build_32 & build_64 in each
75c0816e8295e180f4bc7f10db3d0d880383bc1cMark Andrewsmodules' directory. Since those subdirectories are competely recreatable
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austeinfrom the source tarball and patches, rebuilding the tree or running make clean
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austeinsimply removes them entirely and recreates them.
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob AusteinYou should be able to run make commands in any module directory or
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austeinmodule-type directory, though since most of the intermodule dependencies
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austeinare not declared, many modules will break unless you've done a full-tree
94fc951a9b5679def2a05387a5c251f5cb8eb9c9Mark Andrewsbuild at some point to populate the proto area with the bits needed.
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein
94fc951a9b5679def2a05387a5c251f5cb8eb9c9Mark Andrews=============================================================================
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob AusteinMake targets you can build in each module:
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein------------------------------------------
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob AusteinFor most of these you can append _32 or _64 to do just the 32-bit or 64-bit
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austeinversions of the targets, while the version listed here repeats for all build
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austeintypes set in the BUILD_TYPES variable. These are defined in the
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austeinopen-src/common/Makefile.inc file, though open-src/<module type>/Makefile.inc
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austeinmay add additional rules needed for modules of that type.
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein
94fc951a9b5679def2a05387a5c251f5cb8eb9c9Mark Andrewsmake clean
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein Completely removes build_* directories.
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austeinmake source
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein Creates build_* directories by unpacking sources from tarball
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein and applying patches.
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austeinmake configure
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein Runs GNU autoconf script or similar configuration steps if
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein needed, including autoreconf or delibtoolize if variables are set.
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein (Runs make source first if needed.)
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austeinmake build
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein Compile the software into the binaries that get installed.
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein (Runs make configure first if needed.)
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austeinmake install
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein Install files into the proto area where make_release_packages
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein will pull them from to make packages and where other parts of
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein the build will use them. (Runs make build first if needed.)
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austeinmake all (or just "make" with no arguments)
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein equivalent to make build for most modules
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austeinmake debug
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein same as make all, but with compiler optimization flags changed
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein to "-g". (Note that if you haven't done a make clean first,
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein doesn't force a recompile, so running make debug in a directory
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein you already built non-debug may not actually build debug versions.)
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austeinmake debug-install
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein same as make install, but with compiler optimization flags changed
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein to "-g". (See warning on make debug about doing a make clean first.)
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austeinmake download
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein If open-src/tarballs does not contain the tarball needed for this
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein module, download it from $(SOURCE_URL). (See "Building from git"
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein section below if MODULE_VERSION=git.)
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austeinmake regen-patches
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein Create a directory new/ containing patches generated against the
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein current tarball. Useful when updating to a new version and patches
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein still apply, but you want to get rid of warnings about patch fuzz
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein and line offsets.
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austeinmake git-update
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein See "Building from git" section below.
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein=============================================================================
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob AusteinMake targets you can build in parent directories:
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein-------------------------------------------------
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob AusteinIn the top-level open-src directory, or any of the module type directories,
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austeinyou can run these make commands to run the appropriate targets for all modules
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austeinin that directory. The Makefiles at each level all include the same rules
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austeinfrom open-src/common/Makefile.subdirs to define these.
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austeinmake all
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein Run make all in all subdirectories.
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austeinmake clean
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein Run make clean in all subdirectories.
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austeinmake World
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein Run make clean in all subdirectories, then make all in all subdirs.
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austeinmake install
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein Run make install in all subdirectories.
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austeinmake download
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein Run make download in all subdirectories.
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austeinmake source
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein Run make source in all subdirectories.
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austeinmake git-update
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein Run make git-update in all subdirectories.
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austeinmake debug-build
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein Run make debug-build in all subdirectories.
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austeinmake debug-install
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein Run make debug-install in all subdirectories.
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein
94fc951a9b5679def2a05387a5c251f5cb8eb9c9Mark Andrews=============================================================================
94fc951a9b5679def2a05387a5c251f5cb8eb9c9Mark Andrews
94fc951a9b5679def2a05387a5c251f5cb8eb9c9Mark AndrewsVariables that can be set in the Makefile for each module:
94fc951a9b5679def2a05387a5c251f5cb8eb9c9Mark Andrews----------------------------------------------------------
94fc951a9b5679def2a05387a5c251f5cb8eb9c9Mark Andrews
94fc951a9b5679def2a05387a5c251f5cb8eb9c9Mark AndrewsRequired for all modules:
94fc951a9b5679def2a05387a5c251f5cb8eb9c9Mark Andrews
94fc951a9b5679def2a05387a5c251f5cb8eb9c9Mark AndrewsMODULE_NAME
94fc951a9b5679def2a05387a5c251f5cb8eb9c9Mark Andrews - Name of the module being built - usually the same as the name of the
94fc951a9b5679def2a05387a5c251f5cb8eb9c9Mark Andrews directory it's being built in and the tarball used for the sources.
94fc951a9b5679def2a05387a5c251f5cb8eb9c9Mark Andrews
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob AusteinMODULE_VERSION
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein - Version of the source to use, used by default in the tarball name and
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein source directory unpacked from it.
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein - Special values:
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein "git" - see "Building from git" below
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein "src" - used when there is no upstream tarball, only local sources
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein "NONE" - used when no build_* directories are created
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob AusteinRequired for some modules:
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob AusteinSUN_PACKAGE
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein - Package name that this module is shipped in, to list in attributes section
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein of man page
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein * Required if SUNTOUCHED_MANPAGES is not empty
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob AusteinMODULE_STABILITY
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein - Interface Stability to list in attributes section of man page
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein * Required if SUNTOUCHED_MANPAGES is not empty
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob AusteinLIBNAME
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein - Name of library built in this module
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein * Required for lib modules if SUNTOUCHED_MANPAGES is not empty
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein or if *.spec files are being used to set library versioning information.
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob AusteinOptional, default is empty:
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob AusteinSOURCE_UNCOMPRESS
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein - Command to use to uncompress tarball, if not bzcat
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob AusteinSOURCE_PATCHES
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein - Patches to apply to the sources after unpacking the tarball
94fc951a9b5679def2a05387a5c251f5cb8eb9c9Mark Andrews Entries can be either a simple file name or filename,flags
94fc951a9b5679def2a05387a5c251f5cb8eb9c9Mark Andrews to specify flags to be passed to gpatch. The flags argument
94fc951a9b5679def2a05387a5c251f5cb8eb9c9Mark Andrews is most commonly used to specify -p1 to ignore the a/ & b/ path
94fc951a9b5679def2a05387a5c251f5cb8eb9c9Mark Andrews prefixes in git-generated patch files - if no flags are specified,
94fc951a9b5679def2a05387a5c251f5cb8eb9c9Mark Andrews -p0 is passed to treat paths as relative to the top of $(BUILD_DIR).
94fc951a9b5679def2a05387a5c251f5cb8eb9c9Mark Andrews
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob AusteinADDITIONAL_SOURCE_DIR
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein - Directory containing additional source files to be linked into the
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein build directory by the default_source rule.
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob AusteinSUNTOUCHED_MANPAGES
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein - Man pages to add Solaris attributes section and other common Solaris
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein man page conventions to, via the open-src/common/suntouch-manpages.pl
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein script.
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob AusteinMODULE_SUNTOUCH_MAN_FLAGS
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein - Additional flags to pass to open-src/common/suntouch-manpages.pl, such as
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein -p /usr/X11/bin to add a path of /usr/X11/bin to the command in the
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein synopsis. Available flags are:
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein -a '{attribute, value}, ...' - entries for Attributes section table
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein -l libname - add library line to synopsis
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein -p path - add path to command in synopsis
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob AusteinFIX_PC_FILES
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein - Names of pkgconfig .pc or .pc.in files in the module, which will be
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein "fixed" to add required -R flags for linking libraries with and remove
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein unnecessary Requires.privates lines from.
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob AusteinMODULE_SOURCE_DEPS, MODULE_CONFIGURE_DEPS,
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob AusteinMODULE_BUILD_DEPS, MODULE_INSTALL_DEPS
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein - Makefile targets/rules that the default_* rules list as dependencies
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob AusteinMODULE_ADD_SOURCE_TARGETS, MODULE_ADD_CONFIGURE_TARGETS,
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob AusteinMODULE_ADD_BUILD_TARGETS, MODULE_ADD_INSTALL_TARGETS
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein - Additional targets/rules run by "make source", "make configure", etc.
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein in addition to default_* if *_TARGETS is not overridden.
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob AusteinMODULE_CONFIG_OPTS
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein - Additional arguments passed to configure script by default_config rule
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob AusteinMODULE_CONFIG_ENV
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein - Additional environment variables passed to configure script
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein by default_config rule
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob AusteinMODULE_CFLAGS
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein - C Compiler flags passed to configure via CFLAGS variable by
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein default_config rule.
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob AusteinMODULE_CXXFLAGS
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein - C++ Compiler flags passed to configure via CXXFLAGS variable by
94fc951a9b5679def2a05387a5c251f5cb8eb9c9Mark Andrews default_config rule.
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob AusteinMODULE_CPPFLAGS
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein - C preprocessor flags (-I & -D) passed to configure via CPPFLAGS
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein variable by default_config rule.
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob AusteinMODULE_LDFLAGS
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein - Linker flags passed to configure via LDFLAGS variable by default_config
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein rule.
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob AusteinUSE_DEFAULT_CONFIG_CPPFLAGS
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein - If set to "no", don't pass the normal set of -I flags in CPPFLAGS
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein to configure script in default_config rule. MODULE_CPPFLAGS and
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein MODTYPE_CPPFLAGS will still be passed.
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob AusteinUSE_DEFAULT_CONFIG_LDFLAGS
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein - If set to "no", don't pass the normal set of linker flags in LDFLAGS
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein to configure script in default_config rule. MODULE_LDFLAGS and
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein MODTYPE_LDFLAGS will still be passed.
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob AusteinUSE_DEFAULT_CONFIG_ENV
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein - If set to "no", don't pass the normal set of default environment variables
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein to configure script in default_config rule. MODULE_CONFIG_ENV and
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein MODTYPE_CONFIG_ENG will still be passed.
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob AusteinAUTORECONF
94fc951a9b5679def2a05387a5c251f5cb8eb9c9Mark Andrews - If set to "yes", the default_config rule will run autoreconf before
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein running configure, to regenerate autoconf/automake/libtool created
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein files after patches have been applied to the *.ac/*.am/*.in source files.
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob AusteinDELIBTOOLIZE
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein - If set to "yes", the default_config rule will run the script
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein open-src/common/delibtoolize.pl to remove libtool calls from Makefiles
94fc951a9b5679def2a05387a5c251f5cb8eb9c9Mark Andrews after running configure.
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob AusteinMODULE_LD_OPTIONS
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein - Additional options passed via LD_OPTIONS environment variable to
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein force options to be used by ld, regardless of options passed by
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein libtool/compiler etc. Used by default_build & default_install rules.
MODULE_BUILD_ENV
- Additional environment variables passed when calling make
by default_build & default_install rules
MODULE_MAKEFLAGS
- Additional command line arguments passed when calling make
by default_build & default_install
MODULE_BUILD_MAKEFLAGS
- Additional command line arguments passed when calling make
by default_build
MODULE_INSTALL_MAKEFLAGS
- Additional command line arguments passed when calling make
by default_install
EXTRA_LICENSES
- Additional files containing copyright & license information for this module,
beyond what's in LICENSE_FILE, such as subsets for specific packages.
Will be copied under their own names to $(PROTODIR)/licenses/<path>/
for use by include statements in package copyright.add files, where
path is the same as the directory & subdirectory the module source is in.
Files are looked for relative to module directory, include $(SOURCE_DIR)/
in the filename to look relative to the top-level source directory.
Optional, with non-empty default:
* Important, for these, to override the default values, you must not only
set the variable, but set another variable <variable>_SET=yes before the
Makefile.inc is included to prevent the default from being set. For
example:
SOURCE_URL=http://fontconfig.org/release/$(SOURCE_TARBALL_NAME)
SOURCE_URL_SET=yes
MODULE_COMPILER
- Compiler to use, either "suncc" or "gcc".
Default: $(DEFAULT_COMPILER) setting in common/Makefile.init,
which is set to suncc in the master sources.
MODULE_MAKE
- make command to use, either "$(MAKE)" or "$(GNUMAKE)".
Default: "$(MAKE)" (which is assumed to be Solaris make, not GNU).
MODULE_PREFIX
- Prefix to install files under, passed to configure scripts via --prefix.
Default: $(X11_DIR) (aka /usr/X11).
SOURCE_DIRNAME
- Directory that will be created when the source tarball is unpacked.
Default: $(MODULE_NAME)-$(MODULE_VERSION)
SOURCE_TARBALL_NAME
- Name of tarball file under open-src/tarballs directory for this module.
Set to "NONE" if there is no upstream tarball.
Default: $(SOURCE_DIRNAME).tar.bz2
SOURCE_TARBALL_DIR
- For X.Org sources, what directory the source tarball & git repo is in
on freedesktop.org - usually the same as the module type directory in
this tree.
Default: $(MODTYPE)
SOURCE_URL
- URL to download the SOURCE_TARBALL from when running "make download"
Default: $(XORG_RELEASES_URL)/$(SOURCE_TARBALL_DIR)/$(SOURCE_TARBALL_NAME)
GIT_URL
- URL to check out the current sources via the git code manager if
MODULE_VERSION is set to "git" - see "Building from git" below
Default: $(XORG_GIT_URL)/$(SOURCE_TARBALL_DIR)/$(MODULE_NAME).git
BUILD_TYPES
- What type of output to build for this module - usually the word-size of
the binaries built (32 and/or 64), but may be set to any string if other
distinctions are useful. For most modules that don't build binaries,
(fonts, proto headers, docs, etc.) it's set to 32 for simplicity.
For each value xx in this list, a build_xx directory will be made and
the source_xx, configure_xx, build_xx and install_xx rules run.
Default: 32
SOURCE_TARGETS, CONFIGURE_TARGETS, BUILD_TARGETS, INSTALL_TARGETS
- Makefile targets/rules to run for "make source", "make configure",
"make build", and "make install"
Defaults: default_source, default_configure, default_build, default_install
The *_TARGETS may be appended to by setting the MODTYPE_ADD_*_TARGETS
and/or MODULE_ADD_*_TARGETS variables.
AUTOCONF_TARGET
- File created by running the default_configure rule. If this file exists,
make will not run the default_configure rule - if it does not exist, it
will be run.
Default: $(SOURCE_DIR)/Makefile
LICENSE_FILE
- File containing copyright & license information for this module.
Will be copied to $(PROTODIR)/licenses/<path>/COPYING
for use by include statements in package copyright.add files, where
path is the same as the directory & subdirectory the module source is in.
File is looked for first in module directory, if not found there,
in top-level source directory (SOURCE_DIR).
Default: COPYING
MODULE_MTLEVEL
- For modules in the lib directory, Multi-thread safety level to list in
attributes section of SUNTOUCHED_MANPAGES
Default: See XInitThreads(3X11)
=============================================================================
Variables that can be set in the Makefile.inc for each module type:
-------------------------------------------------------------------
Some settings are common to most, if not all of the modules of a given
type. For those, these variables can be set in
open-src/<module_type>/Makefile.inc - they have the same meanings and uses
as the MODULE_* versions documented above, and appear in commands before
the MODULE_* versions - the general pattern is
foo=<tree-wide-defaults> $(MODTYPE_foo) $(MODULE_foo)
Required for all module types:
MODTYPE
- Name of the directory for this module type, usually the same as the
directory for the module type in X.Org's source trees.
Optional, default is empty:
- MODTYPE_SUNTOUCH_MAN_FLAGS
- MODTYPE_SOURCE_DEPS
- MODTYPE_CONFIGURE_DEPS
- MODTYPE_BUILD_DEPS
- MODTYPE_INSTALL_DEPS
- MODTYPE_ADD_SOURCE_TARGETS
- MODTYPE_ADD_CONFIGURE_TARGETS
- MODTYPE_ADD_BUILD_TARGETS
- MODTYPE_ADD_INSTALL_TARGETS
- MODTYPE_CONFIG_OPTS
- MODTYPE_CONFIG_ENV
- MODTYPE_CFLAGS
- MODTYPE_CXXFLAGS
- MODTYPE_CPPFLAGS
- MODTYPE_LDFLAGS
- MODTYPE_LD_OPTIONS
- MODTYPE_BUILD_ENV
- MODTYPE_MAKEFLAGS
- MODTYPE_BUILD_MAKEFLAGS
- MODTYPE_INSTALL_MAKEFLAGS
Optional, with non-empty default:
[See note in module variable section about setting _SET variables to override]
- MODTYPE_COMPILER
- MODTYPE_MAKE
- MODTYPE_PREFIX
=============================================================================
Setting per-platform variables:
-------------------------------
open-src/common/Makefile.init defines $MACH to be either sparc or i386
for the platform being built. You can reference this variable in the
names of other variables to set different values for each platform.
For instance, to build only 64-bit on SPARC, but both 32-bit and 64-bit
on x86/x64, you can do:
BUILD_TYPES_sparc=64
BUILD_TYPES_i386=32 64
BUILD_TYPES=$(BUILD_TYPES_$(MACH))
BUILD_TYPES_SET=yes
=============================================================================
Variables you may want to customize for your site/tree:
XORG_RELEASES_URL & SF_DOWNLOADS_URL (set in open-src/common/Makefile.init)
- urls for X.Org & sourceforge mirrors to download tarballs from
FDO_GIT_URL (set in open-src/common/Makefile.init)
- url for git repositories hosted on freedesktop.org, including
X.Org, Mesa, pixman, etc. - defaults to anonymous git over http, can
change to use another protocol if needed
=============================================================================
Tools for developers to use:
Some tools to ease development are available in the util/build-tools
directory of the tree.
find-build-errors - looks for a log/buildit-XW file (or another file you
specify on the command line) and tries to isolate out just the
build errors for easier reading than the raw build logs.
If you did buildit -p, also shows packaging errors.
xmake - when you change one file in a large module like xserver and just
want to rebuild in that subdirectory of the build_32 or build_64
tree, running xmake will attempt to run make or gmake in that
directory with the same flags and environment variables that would
be passed from running make in the module make directory
=============================================================================
Building from git:
For debugging and development purposes, such as working on the merge of
a X.org release still in development, you can choose to to check out a
the upstream sources from a the git repository instead of a tarball.
You must *NOT* check in to the master gate a module using this feature,
since this would produce a build that's not reproducible and changing
unexpectedly.
To use this, set MODULE_VERSION to "git" in a module's Makefile.
To check out a branch other than master, add GIT_BRANCH="branch-name".
Once you've done this "make download" will clone the git repo initially, and
"make git-update" will update an existing repo. The clone will be located
in the $(MODULE_NAME)-git subdirectory in the module directory, and the
"make source" command will copy it instead of unpacking a tarball.
=============================================================================
Known deficiencies (aka TODO):
Things we should fix someday, but haven't had time to do yet, include:
- Builds are slow. Painfully slow. Things we might be able to do to
speed them up include:
- Using a cache of configure script results shared among all the
components in the tree
- Setting up proper parallel make rules so that multi-core/cpu
machines can build more than one bit at a time.
- Profiling the builds to see where bottlenecks are
- There aren't dependency relationships listed in most of the module
makefiles - you can't bringover the tree and just cd open-src/xserver/xorg
and make, because it won't find many of the dependencies - pretty much you
have to run ./buildit at the toplevel first to build the entire tree and then
go to work on the module you care about. It would be cool if it would do
this for you (like I believe the ON tree does), though tracking down all the
dependencies will probably take a while - getting them done for xserver/xorg
first would be most useful.
=============================================================================
Copyright 2008 Sun Microsystems, Inc. All rights reserved.
Use subject to license terms.
Permission is hereby granted, free of charge, to any person obtaining a
copy of this software and associated documentation files (the
"Software"), to deal in the Software without restriction, including
without limitation the rights to use, copy, modify, merge, publish,
distribute, and/or sell copies of the Software, and to permit persons
to whom the Software is furnished to do so, provided that the above
copyright notice(s) and this permission notice appear in all copies of
the Software and that both the above copyright notice(s) and this
permission notice appear in supporting documentation.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT
OF THIRD PARTY RIGHTS. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
HOLDERS INCLUDED IN THIS NOTICE BE LIABLE FOR ANY CLAIM, OR ANY SPECIAL
INDIRECT OR CONSEQUENTIAL DAMAGES, OR ANY DAMAGES WHATSOEVER RESULTING
FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT,
NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION
WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
Except as contained in this notice, the name of a copyright holder
shall not be used in advertising or otherwise to promote the sale, use
or other dealings in this Software without prior written authorization
of the copyright holder.