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

Annotation of xenocara/README, Revision 1.34

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
                     35:            separate helps the build system (Mesa and xkeyboard-config)
1.1       matthieu   36: - distrib:  all binary distribution related tools and data
                     37: - etc:     mtree(8) data files
1.3       matthieu   38: - share:    make(1) configuration for Xenocara
1.1       matthieu   39:
1.2       matthieu   40: At the top-level directory two files describe the individual
1.3       matthieu   41: components of Xenocara:
1.1       matthieu   42:
1.2       matthieu   43: - MODULES  lists all X.Org components (imported from the X.Org
                     44:           distribution at http://xorg.freedesktop.org/archive/)
1.3       matthieu   45: - 3RDPARTY lists all 3rd party software components provided in Xenocara,
1.2       matthieu   46:           either as dependencies of the X.Org software, or as
                     47:           complements to it to provide a more useable default
                     48:           environment.
                     49:
                     50: o Compiling and installing
                     51:   ------------------------
                     52:
1.25      matthieu   53: Xenocara is made up of almost three hundred different independent
                     54: packages that need to be built and installed in the right order,
                     55: especially while bootstrapping (while /usr/X11R6 is still empty). The
                     56: Xenocara Makefiles take care of that using the 'build' target.
1.2       matthieu   57:
1.5       matthieu   58:   Quick startup guide
                     59:
                     60: The following steps will build and install everything for the first time.
                     61:
1.7       matthieu   62:  cd xenocara
1.5       matthieu   63:  make bootstrap
                     64:  make obj
                     65:  make build
                     66:
                     67: If you want to use another obj directory see below.
                     68:
1.2       matthieu   69:   Requirements
                     70:
                     71: A freshly checked out xenocara tree is buildable without any external
1.23      matthieu   72: tool. Only the xenocara and the src (currently only the
1.24      matthieu   73: src/sys/dev/pci/pcidevs file) trees are needed.
1.23      matthieu   74:
                     75: However if you start modifying things in the automake build
1.2       matthieu   76: system used by many packages, you will need to have the following
1.3       matthieu   77: GNU autotools packages installed:
1.2       matthieu   78:
1.31      matthieu   79:     - automake 1.12 (devel/automake/1.12)
                     80:     - autoconf 2.69 (devel/autoconf/2.69)
1.30      matthieu   81:     - metaauto 0.9 (or later) (devel/metaauto)
1.28      matthieu   82:     - libtool 2.4.2 (or later) (devel/libtool)
1.2       matthieu   83:
1.17      matthieu   84: If you have your source tree on an NFS partition, make sure the clock
1.23      matthieu   85: of your server and client are properly synchronised. Any significant
                     86: drift will cause various problems during builds.
1.17      matthieu   87:
1.8       matthieu   88:   Path
                     89:
1.24      matthieu   90: To build Xenocara, you need to have /usr/X11R6/bin in your PATH.
1.8       matthieu   91:
1.2       matthieu   92:   Sudo
                     93:
                     94: If the SUDO variable points to your sudo(8) binary in /etc/mk.conf,
                     95: 'make build' can be run as a normal user. It will raise its privileges
                     96: whenever needed with sudo. Otherwise, you need to run make build as
                     97: root.
                     98:
1.3       matthieu   99: If you have installed the full Xenocara X sets on your system, you
                    100: don't need to build all of Xenocara to patch one element. You can go
1.24      matthieu  101: to any module sub-directory and run 'make build' from there.
1.2       matthieu  102:
1.8       matthieu  103:   Source directory
                    104:
                    105: The variable XSRCDIR can be set either in the environment or in
1.9       matthieu  106: /etc/mk.conf to point to the xenocara source tree, in case you keep it
1.21      matthieu  107: in a non-standard directory (the default is /usr/xenocara).
1.8       matthieu  108:
1.2       matthieu  109:   Objdirs
                    110:
                    111: Xenocara supports objdirs (and it's even the recommended way to build
                    112: things). Just run 'make obj' at any level before 'make build' to make
1.24      matthieu  113: sure that the object directories are created.
                    114: XOBJDIR defines the obj directory that is used (defaults to /usr/xobj).
1.13      matthieu  115: It should be created before running 'make obj'.
1.2       matthieu  116:
                    117: o Regenerating configure scripts
                    118:   ------------------------------
                    119:
                    120: Whenever you touched an import file for GNU autotools (Makefile.am,
                    121: configure.ac mostly), you need to rebuild the configure script and
1.24      matthieu  122: makefiles skeletons. For that use the following command in the
1.14      matthieu  123: directory where you edited the autotools source files:
1.2       matthieu  124:
                    125:  env XENOCARA_RERUN_AUTOCONF=Yes make -f Makefile.bsd-wrapper build
                    126:
1.24      matthieu  127: You can also set XENOCARA_RERUN_AUTOCONF in /etc/mk.conf or in the
                    128: environment to force the regeneration of configure scripts
1.14      matthieu  129: in every component during a make build.
1.2       matthieu  130:
1.34    ! jsg       131: o Building Gallium3D with LLVM support
1.32      mpi       132:   --------------------------------------
                    133:
1.34    ! jsg       134: When building Mesa with LLVM support instead of the 'classic'
        !           135: software rasteriser the Gallium3D LLVMpipe rasteriser will be used.
        !           136:
        !           137: The radeonsi driver for Southern Islands and newer AMD Radeon parts
        !           138: is only built when Gallium is compiled with LLVM support as it requires
        !           139: the R600 LLVM target.
        !           140:
        !           141: You will need to have the llvm and libelf packages installed and use the following
        !           142: command in the libGL build directory:
1.32      mpi       143:
1.33      ajacouto  144:  env XENOCARA_BUILD_GALLIUM=llvm make obj
1.32      mpi       145:  env XENOCARA_BUILD_GALLIUM=llvm make build
                    146:
                    147: Alternatively, you can also set XENOCARA_BUILD_GALLIUM in /etc/mk.conf
                    148: or in your environment.
                    149:
1.15      matthieu  150: o Cleaning in packages managed by autotools
                    151:   -----------------------------------------
                    152:
                    153: One common problem when building xenocara is the case where the obj
                    154: directory didn't exist (or the symbolic link pointed to a non-existent
1.24      matthieu  155: directory) when the source was first built. After fixing this problem,
                    156: 'configure' will refuse to work in the obj dir, because the source
                    157: is already configured.
1.15      matthieu  158:
                    159: To recover from this in one package:
                    160:
                    161:  rm -f obj
                    162:  make -f Makefile.bsd-wrapper cleandir
                    163:  mkdir XOBJDIR
                    164:  make -f Makefile.bsd-wrapper obj
                    165:  make -f Makefile.bsd-wrapper build
                    166:
                    167: or from the root of the xenocara tree:
                    168:
1.24      matthieu  169:  find . -type l -name obj | xargs rm -f
1.15      matthieu  170:  make cleandir
                    171:  mkdir XOBJDIR
                    172:  make obj
                    173:  make build
                    174:
1.16      matthieu  175: for more desperate cases, remove all files from XSRCDIR not in CVS:
1.15      matthieu  176:
                    177:  cd XSRCDIR
                    178:  cvs -q update -PAd -I - | awk '$1=="?" {print $2}' | xargs rm -f
                    179:
1.19      matthieu  180: o How to build something with debug information?
                    181:   ----------------------------------------------
                    182:
                    183: You can use "env CFLAGS=-g make -f Makefile.bsd-wrapper build" to
                    184: build any module with debugging information, but you'll need to remove
                    185: XOBJDIR/xorg-config.cache.${MACHINE} before doing that because
                    186: autoconf caches the value of CFLAGS in its cache.
                    187:
                    188: o How to get a core file out of the X server?
                    189:   -------------------------------------------
                    190:
                    191: Several things are needed:
                    192:
                    193: 1) set kern.nosuidcoredump=2 in /etc/sysctl.conf
1.24      matthieu  194: 2) put
1.19      matthieu  195:
                    196:         Option  "NoTrapSignals" "true"
                    197:
1.24      matthieu  198:    in the "ServerFlags" section of /etc/X11/xorg.conf. If such a section
1.19      matthieu  199:    doesn't exist, it can be added as follow:
                    200:
                    201:    Section "ServerFlags"
                    202:         Option  "NoTrapSignals" "true"
                    203:    EndSection
                    204:
1.24      matthieu  205:    anywhere in the configuration file.
1.19      matthieu  206:
                    207: 3) start the X server as root, with the -keepPriv option. A regular
                    208:    user is not allowed to use this option. If you use xdm, you can add
                    209:    the option in /etc/X11/xdm/Xservers. If you want to use startx, you
                    210:    need to run it as root, like this:
                    211:
                    212:    startx -- /usr/X11R6/bin/X -keepPriv
                    213:
                    214: Now the X server will dump core when catching a fatal signal. But it
                    215: will also not be able to restore the text mode on exit. So be prepared
                    216: to log in remotely (serial terminal or ssh) to reboot your machine or
                    217: to restart X.
                    218:
                    219: The core dump will be in /var/crash.
                    220:
                    221: See also <http://xorg.freedesktop.org/wiki/Development/Documentation/ServerDebugging>
                    222:
1.15      matthieu  223: --
1.34    ! jsg       224: $OpenBSD: README,v 1.33 2013/05/14 07:55:46 ajacoutot Exp $