Go to file
2013-06-23 17:57:50 +00:00
app properly fix (and re-organize) selfont selection. 2013-06-23 17:57:50 +00:00
data Update to xkeyboard-config 2.7 2012-10-06 15:41:11 +00:00
dist byteswap.h and bswap_32 aren't portable, replace them with calls to 2013-06-17 23:21:23 +00:00
distrib xenocara for beagle, no X server at this point. 2013-06-21 10:38:32 +00:00
doc Native build system for gl-docs. Removes last dependency 2012-08-07 21:10:35 +00:00
driver Default to EXA acceleration. 2013-06-14 21:27:14 +00:00
etc Force the use of mkdir to create directories. 2012-08-05 19:52:22 +00:00
font let build and release proceed through the exact same steps, avoiding 2012-08-18 10:38:39 +00:00
kdrive Don't touch the xserver autotools files a 2nd time in kdrive. 2012-08-08 21:54:33 +00:00
lib Update to libXv 1.0.9 2013-06-23 09:51:37 +00:00
proto update to inputproto 2.3 2013-05-30 13:00:06 +00:00
share/mk Allow flags to be passed to make using ${MAKE_FLAGS} 2013-04-14 19:57:40 +00:00
util Remove things that are no longer linked to the build: imake,cf and pciids 2012-11-02 18:59:03 +00:00
xserver Update to X server 1.14.1. Tested by many during t2k13. Thanks. 2013-06-07 17:28:45 +00:00
3RDPARTY update 2013-06-07 17:39:48 +00:00
Makefile after a compiler update, landisk can now handle pixman and thus xserver again 2013-02-21 17:45:32 +00:00
MODULES update 2013-06-14 21:42:36 +00:00
README Create the obj dir when building the gallium driver. 2013-05-14 07:55:46 +00:00

	Notes on building Xenocara for OpenBSD X hackers

This document presents some techniques that can be useful for people
wanting to hack the xenocara tree. It assumes some basic knowledge of
the OpenBSD build system, as described in the release(8) manual page.

o About Xenocara
  --------------
Xenocara is the name chosen for OpenBSD's version of X. It's
currently based on X.Org 7.7 and its dependencies. The goal of
Xenocara is to provide a framework to host local modifications and to
automate the build of the modular X.Org components, including 3rd
party packages and some software maintained by OpenBSD developers.

o Source tree
  -----------

The organisation of the xenocara directory follows the general
organisation used in X.Org:

- app:	     X applications and utilities
- data:	     various data files (keyboard mappings and bitmaps)
- doc:	     documentation
- driver:    input and video drivers
- font:	     fonts
- lib:	     libraries
- proto:     X protocol headers
- util:	     utilities that don't fit anywhere else
- xserver:   the source for the X servers

In addition Xenocara uses the following directories:

- dist:	    contains some of the 3rd party sources, when keeping them
  	    separate helps the build system (Mesa and xkeyboard-config)
- distrib:  all binary distribution related tools and data
- etc:	    mtree(8) data files
- share:    make(1) configuration for Xenocara

At the top-level directory two files describe the individual
components of Xenocara:

- MODULES  lists all X.Org components (imported from the X.Org
	   distribution at http://xorg.freedesktop.org/archive/)
- 3RDPARTY lists all 3rd party software components provided in Xenocara,
	   either as dependencies of the X.Org software, or as
	   complements to it to provide a more useable default
	   environment.

o Compiling and installing
  ------------------------

Xenocara is made up of almost three hundred different independent
packages that need to be built and installed in the right order,
especially while bootstrapping (while /usr/X11R6 is still empty). The
Xenocara Makefiles take care of that using the 'build' target.

  Quick startup guide

The following steps will build and install everything for the first time.

 cd xenocara
 make bootstrap
 make obj
 make build

If you want to use another obj directory see below.

  Requirements

A freshly checked out xenocara tree is buildable without any external
tool. Only the xenocara and the src (currently only the
src/sys/dev/pci/pcidevs file) trees are needed.

However if you start modifying things in the automake build
system used by many packages, you will need to have the following
GNU autotools packages installed:

    - automake 1.12 (devel/automake/1.12)
    - autoconf 2.69 (devel/autoconf/2.69)
    - metaauto 0.9 (or later) (devel/metaauto)
    - libtool 2.4.2 (or later) (devel/libtool)

If you have your source tree on an NFS partition, make sure the clock
of your server and client are properly synchronised. Any significant
drift will cause various problems during builds.

  Path

To build Xenocara, you need to have /usr/X11R6/bin in your PATH.

  Sudo

If the SUDO variable points to your sudo(8) binary in /etc/mk.conf,
'make build' can be run as a normal user. It will raise its privileges
whenever needed with sudo. Otherwise, you need to run make build as
root.

If you have installed the full Xenocara X sets on your system, you
don't need to build all of Xenocara to patch one element. You can go
to any module sub-directory and run 'make build' from there.

  Source directory

The variable XSRCDIR can be set either in the environment or in
/etc/mk.conf to point to the xenocara source tree, in case you keep it
in a non-standard directory (the default is /usr/xenocara).

  Objdirs

Xenocara supports objdirs (and it's even the recommended way to build
things). Just run 'make obj' at any level before 'make build' to make
sure that the object directories are created.
XOBJDIR defines the obj directory that is used (defaults to /usr/xobj).
It should be created before running 'make obj'.

o Regenerating configure scripts
  ------------------------------

Whenever you touched an import file for GNU autotools (Makefile.am,
configure.ac mostly), you need to rebuild the configure script and
makefiles skeletons. For that use the following command in the
directory where you edited the autotools source files:

 env XENOCARA_RERUN_AUTOCONF=Yes make -f Makefile.bsd-wrapper build

You can also set XENOCARA_RERUN_AUTOCONF in /etc/mk.conf or in the
environment to force the regeneration of configure scripts
in every component during a make build.

o Building Gallium3D rasterizer for Mesa
  --------------------------------------

The Gallium3D software rasterizer can be built to be used as an
alternative to the default Mesa software rasterizer. For that, use
the following command in the libGL build directory (the default is 
/usr/xenocara/lib/libGL):

 env XENOCARA_BUILD_GALLIUM=Yes make obj
 env XENOCARA_BUILD_GALLIUM=Yes make build

This software rasertizer can also benefit from the LLVM infrastructure
and use a special pipe if it is built with LLVM support. You will need
to have the llvm package installed and use the following command in the
libGL build directory:

 env XENOCARA_BUILD_GALLIUM=llvm make obj
 env XENOCARA_BUILD_GALLIUM=llvm make build

Alternatively, you can also set XENOCARA_BUILD_GALLIUM in /etc/mk.conf
or in your environment.

o Cleaning in packages managed by autotools
  -----------------------------------------

One common problem when building xenocara is the case where the obj
directory didn't exist (or the symbolic link pointed to a non-existent
directory) when the source was first built. After fixing this problem,
'configure' will refuse to work in the obj dir, because the source
is already configured.

To recover from this in one package:

 rm -f obj
 make -f Makefile.bsd-wrapper cleandir
 mkdir XOBJDIR
 make -f Makefile.bsd-wrapper obj
 make -f Makefile.bsd-wrapper build

or from the root of the xenocara tree:

 find . -type l -name obj | xargs rm -f
 make cleandir
 mkdir XOBJDIR
 make obj
 make build

for more desperate cases, remove all files from XSRCDIR not in CVS:

 cd XSRCDIR
 cvs -q update -PAd -I - | awk '$1=="?" {print $2}' | xargs rm -f

o How to build something with debug information?
  ----------------------------------------------

You can use "env CFLAGS=-g make -f Makefile.bsd-wrapper build" to
build any module with debugging information, but you'll need to remove
XOBJDIR/xorg-config.cache.${MACHINE} before doing that because
autoconf caches the value of CFLAGS in its cache.

o How to get a core file out of the X server?
  -------------------------------------------

Several things are needed:

1) set kern.nosuidcoredump=2 in /etc/sysctl.conf
2) put

        Option  "NoTrapSignals" "true"

   in the "ServerFlags" section of /etc/X11/xorg.conf. If such a section
   doesn't exist, it can be added as follow:

   Section "ServerFlags"
        Option  "NoTrapSignals" "true"
   EndSection

   anywhere in the configuration file.

3) start the X server as root, with the -keepPriv option. A regular
   user is not allowed to use this option. If you use xdm, you can add
   the option in /etc/X11/xdm/Xservers. If you want to use startx, you
   need to run it as root, like this:

   startx -- /usr/X11R6/bin/X -keepPriv

Now the X server will dump core when catching a fatal signal. But it
will also not be able to restore the text mode on exit. So be prepared
to log in remotely (serial terminal or ssh) to reboot your machine or
to restart X.

The core dump will be in /var/crash.

See also <http://xorg.freedesktop.org/wiki/Development/Documentation/ServerDebugging>

-- 
$OpenBSD: README,v 1.33 2013/05/14 07:55:46 ajacoutot Exp $