[BACK]Return to README CVS log [TXT][DIR] Up to [local] / xenocara

Annotation of xenocara/README, Revision 1.49

1.1       matthieu    1:
                      2:        Notes on building Xenocara for OpenBSD X hackers
                      3:
                      4: This document presents some techniques that can be useful for people
                      5: wanting to hack the xenocara tree. It assumes some basic knowledge of
                      6: the OpenBSD build system, as described in the release(8) manual page.
                      7:
                      8: o About Xenocara
                      9:   --------------
1.11      david      10: Xenocara is the name chosen for OpenBSD's version of X. It's
1.29      matthieu   11: currently based on X.Org 7.7 and its dependencies. The goal of
1.1       matthieu   12: Xenocara is to provide a framework to host local modifications and to
                     13: automate the build of the modular X.Org components, including 3rd
1.11      david      14: party packages and some software maintained by OpenBSD developers.
1.1       matthieu   15:
                     16: o Source tree
                     17:   -----------
                     18:
                     19: The organisation of the xenocara directory follows the general
                     20: organisation used in X.Org:
                     21:
                     22: - app:      X applications and utilities
                     23: - data:             various data files (keyboard mappings and bitmaps)
                     24: - doc:      documentation
                     25: - driver:    input and video drivers
                     26: - font:             fonts
                     27: - lib:      libraries
                     28: - proto:     X protocol headers
                     29: - util:             utilities that don't fit anywhere else
1.24      matthieu   30: - xserver:   the source for the X servers
1.1       matthieu   31:
                     32: In addition Xenocara uses the following directories:
                     33:
1.28      matthieu   34: - dist:            contains some of the 3rd party sources, when keeping them
1.44      sthen      35:            separate helps the build system (fontconfig, xcb and
1.36      matthieu   36:             xkeyboard-config)
1.1       matthieu   37: - distrib:  all binary distribution related tools and data
1.36      matthieu   38: - etc:     some default config files
1.3       matthieu   39: - share:    make(1) configuration for Xenocara
1.1       matthieu   40:
1.2       matthieu   41: At the top-level directory two files describe the individual
1.3       matthieu   42: components of Xenocara:
1.1       matthieu   43:
1.2       matthieu   44: - MODULES  lists all X.Org components (imported from the X.Org
                     45:           distribution at http://xorg.freedesktop.org/archive/)
1.3       matthieu   46: - 3RDPARTY lists all 3rd party software components provided in Xenocara,
1.2       matthieu   47:           either as dependencies of the X.Org software, or as
                     48:           complements to it to provide a more useable default
                     49:           environment.
                     50:
                     51: o Compiling and installing
                     52:   ------------------------
                     53:
1.25      matthieu   54: Xenocara is made up of almost three hundred different independent
                     55: packages that need to be built and installed in the right order,
                     56: especially while bootstrapping (while /usr/X11R6 is still empty). The
                     57: Xenocara Makefiles take care of that using the 'build' target.
1.2       matthieu   58:
1.5       matthieu   59:   Quick startup guide
                     60:
                     61: The following steps will build and install everything for the first time.
                     62:
1.37      matthieu   63:  cd /usr/xenocara
                     64:  doas make bootstrap
1.41      matthieu   65:  doas make obj
1.37      matthieu   66:  doas make build
1.5       matthieu   67:
                     68: If you want to use another obj directory see below.
                     69:
1.2       matthieu   70:   Requirements
                     71:
                     72: A freshly checked out xenocara tree is buildable without any external
1.23      matthieu   73: tool. Only the xenocara and the src (currently only the
1.24      matthieu   74: src/sys/dev/pci/pcidevs file) trees are needed.
1.23      matthieu   75:
                     76: However if you start modifying things in the automake build
1.2       matthieu   77: system used by many packages, you will need to have the following
1.3       matthieu   78: GNU autotools packages installed:
1.2       matthieu   79:
1.31      matthieu   80:     - automake 1.12 (devel/automake/1.12)
1.48      matthieu   81:     - autoconf 2.71 (devel/autoconf/2.71)
1.47      matthieu   82:     - metaauto (devel/metaauto)
                     83:     - libtool (devel/libtool)
1.46      matthieu   84:     - gettext-tools (devel/gettext)
1.2       matthieu   85:
1.47      matthieu   86: If you have your source tree on an NFS partition, make sure the clocks
1.23      matthieu   87: of your server and client are properly synchronised. Any significant
                     88: drift will cause various problems during builds.
1.17      matthieu   89:
1.8       matthieu   90:   Path
                     91:
1.24      matthieu   92: To build Xenocara, you need to have /usr/X11R6/bin in your PATH.
1.8       matthieu   93:
1.3       matthieu   94: If you have installed the full Xenocara X sets on your system, you
                     95: don't need to build all of Xenocara to patch one element. You can go
1.24      matthieu   96: to any module sub-directory and run 'make build' from there.
1.2       matthieu   97:
1.8       matthieu   98:   Source directory
                     99:
                    100: The variable XSRCDIR can be set either in the environment or in
1.9       matthieu  101: /etc/mk.conf to point to the xenocara source tree, in case you keep it
1.21      matthieu  102: in a non-standard directory (the default is /usr/xenocara).
1.8       matthieu  103:
1.2       matthieu  104:   Objdirs
                    105:
1.41      matthieu  106: Xenocara requires objdirs. Just run 'make obj' as root at any level
                    107: before 'make build' to make sure that the object directories are
                    108: created.  XOBJDIR defines the obj directory that is used (defaults to
                    109: /usr/xobj).  It should be created before running 'make obj'.
1.2       matthieu  110:
                    111: o Regenerating configure scripts
                    112:   ------------------------------
                    113:
                    114: Whenever you touched an import file for GNU autotools (Makefile.am,
                    115: configure.ac mostly), you need to rebuild the configure script and
1.24      matthieu  116: makefiles skeletons. For that use the following command in the
1.14      matthieu  117: directory where you edited the autotools source files:
1.2       matthieu  118:
1.39      jsg       119:  make -f Makefile.bsd-wrapper autoreconf
1.38      matthieu  120:  doas make -f Makefile.bsd-wrapper build
1.2       matthieu  121:
1.15      matthieu  122: o Cleaning in packages managed by autotools
                    123:   -----------------------------------------
                    124:
                    125: One common problem when building xenocara is the case where the obj
                    126: directory didn't exist (or the symbolic link pointed to a non-existent
1.24      matthieu  127: directory) when the source was first built. After fixing this problem,
                    128: 'configure' will refuse to work in the obj dir, because the source
                    129: is already configured.
1.15      matthieu  130:
                    131: To recover from this in one package:
                    132:
                    133:  rm -f obj
                    134:  make -f Makefile.bsd-wrapper cleandir
                    135:  mkdir XOBJDIR
                    136:  make -f Makefile.bsd-wrapper obj
1.37      matthieu  137:  doas make -f Makefile.bsd-wrapper build
1.15      matthieu  138:
                    139: or from the root of the xenocara tree:
                    140:
1.24      matthieu  141:  find . -type l -name obj | xargs rm -f
1.15      matthieu  142:  make cleandir
                    143:  mkdir XOBJDIR
                    144:  make obj
1.37      matthieu  145:  doas make build
1.15      matthieu  146:
1.16      matthieu  147: for more desperate cases, remove all files from XSRCDIR not in CVS:
1.15      matthieu  148:
                    149:  cd XSRCDIR
                    150:  cvs -q update -PAd -I - | awk '$1=="?" {print $2}' | xargs rm -f
                    151:
1.42      matthieu  152: o Updating XCB to a new release
                    153:   -----------------------------
                    154:
                    155: libxcb uses C source files that are generated from the XML protocol
                    156: specification using xcbgen, written in Python. On OpenBSD those files
                    157: cannot be generated during a normal 'make build' since Python is not
                    158: in the base system. So the generated version are checked in CVS
                    159: (in lib/libxcb/src/). Here is the receipt to update them when updating
                    160: to a new release of XCB:
                    161:
                    162: 1) Update proto/xcb-proto.
                    163: 2) Update the x11/py-xcbgen port to the same version and install the
1.43      matthieu  164:    python3 package.
1.42      matthieu  165: 3) Update dist/libxcb.
                    166: 4) Check lib/libxcb/src/Makefile if new files need to be generated.
                    167: 5) Run 'make' in lib/xcb/src to generate the files for the new version.
                    168: 6) Check lib/libxcb/ for other files needing updates.
                    169: 7) Commit the result.
                    170:
1.19      matthieu  171: o How to build something with debug information?
                    172:   ----------------------------------------------
                    173:
                    174: You can use "env CFLAGS=-g make -f Makefile.bsd-wrapper build" to
                    175: build any module with debugging information, but you'll need to remove
                    176: XOBJDIR/xorg-config.cache.${MACHINE} before doing that because
                    177: autoconf caches the value of CFLAGS in its cache.
                    178:
                    179: o How to get a core file out of the X server?
                    180:   -------------------------------------------
                    181:
                    182: Several things are needed:
                    183:
1.49    ! matthieu  184: 1) set kern.nosuidcoredump=3 in /etc/sysctl.conf
1.19      matthieu  185:
1.49    ! matthieu  186: 2) start the X server as root, with the -keepPriv option. If you use
        !           187:    xenodm, you can add the option in /etc/X11/xenodm/Xservers. If you
        !           188:    want to use startx, you need to run it as root, like this:
1.19      matthieu  189:
                    190:    startx -- /usr/X11R6/bin/X -keepPriv
                    191:
1.49    ! matthieu  192: Now the X server should dump core when catching a fatal signal and the
        !           193: core dump should be in /var/crash/Xorg/<pid>.core.
1.19      matthieu  194:
1.49    ! matthieu  195: Alternatively, if the X server is using the modesetting(4) driver
        !           196: (it's the case with most recent AMD and Intel GPUs), it can be started
        !           197: as a regular user, without setting kern.nosuidcoredump=3, and the core
        !           198: dump will be in the current directory where startx was executed.
1.19      matthieu  199:
                    200: See also <http://xorg.freedesktop.org/wiki/Development/Documentation/ServerDebugging>
                    201:
1.45      tb        202: --
1.49    ! matthieu  203: $OpenBSD: README,v 1.48 2023/05/07 06:55:21 matthieu Exp $