2006-11-29 11:55:38 -07: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
|
|
|
|
--------------
|
2007-04-04 16:27:53 -06:00
|
|
|
Xenocara is the name chosen for OpenBSD's version of X. It's
|
2012-07-22 23:50:37 -06:00
|
|
|
currently based on X.Org 7.7 and its dependencies. The goal of
|
2006-11-29 11:55:38 -07:00
|
|
|
Xenocara is to provide a framework to host local modifications and to
|
|
|
|
automate the build of the modular X.Org components, including 3rd
|
2007-04-04 16:27:53 -06:00
|
|
|
party packages and some software maintained by OpenBSD developers.
|
2006-11-29 11:55:38 -07:00
|
|
|
|
|
|
|
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
|
2008-10-05 02:10:05 -06:00
|
|
|
- xserver: the source for the X servers
|
2006-11-29 11:55:38 -07:00
|
|
|
|
|
|
|
In addition Xenocara uses the following directories:
|
|
|
|
|
2012-01-28 14:04:42 -07:00
|
|
|
- dist: contains some of the 3rd party sources, when keeping them
|
2016-01-18 11:01:37 -07:00
|
|
|
separate helps the build system (fontconfig, xcb and
|
|
|
|
xkeyboard-config)
|
2006-11-29 11:55:38 -07:00
|
|
|
- distrib: all binary distribution related tools and data
|
2016-01-18 11:01:37 -07:00
|
|
|
- etc: some default config files
|
2006-11-30 10:58:48 -07:00
|
|
|
- share: make(1) configuration for Xenocara
|
2006-11-29 11:55:38 -07:00
|
|
|
|
2006-11-29 15:25:07 -07:00
|
|
|
At the top-level directory two files describe the individual
|
2006-11-30 10:58:48 -07:00
|
|
|
components of Xenocara:
|
2006-11-29 11:55:38 -07:00
|
|
|
|
2006-11-29 15:25:07 -07:00
|
|
|
- MODULES lists all X.Org components (imported from the X.Org
|
|
|
|
distribution at http://xorg.freedesktop.org/archive/)
|
2006-11-30 10:58:48 -07:00
|
|
|
- 3RDPARTY lists all 3rd party software components provided in Xenocara,
|
2006-11-29 15:25:07 -07:00
|
|
|
either as dependencies of the X.Org software, or as
|
|
|
|
complements to it to provide a more useable default
|
|
|
|
environment.
|
|
|
|
|
|
|
|
o Compiling and installing
|
|
|
|
------------------------
|
|
|
|
|
2008-10-09 23:32:58 -06:00
|
|
|
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.
|
2006-11-29 15:25:07 -07:00
|
|
|
|
2006-12-12 14:07:25 -07:00
|
|
|
Quick startup guide
|
|
|
|
|
|
|
|
The following steps will build and install everything for the first time.
|
|
|
|
|
2016-10-14 12:29:18 -06:00
|
|
|
cd /usr/xenocara
|
|
|
|
doas make bootstrap
|
2006-12-12 14:07:25 -07:00
|
|
|
make obj
|
2016-10-14 12:29:18 -06:00
|
|
|
doas make build
|
2006-12-12 14:07:25 -07:00
|
|
|
|
|
|
|
If you want to use another obj directory see below.
|
|
|
|
|
2006-11-29 15:25:07 -07:00
|
|
|
Requirements
|
|
|
|
|
|
|
|
A freshly checked out xenocara tree is buildable without any external
|
2008-10-05 02:08:33 -06:00
|
|
|
tool. Only the xenocara and the src (currently only the
|
2008-10-05 02:10:05 -06:00
|
|
|
src/sys/dev/pci/pcidevs file) trees are needed.
|
2008-10-05 02:08:33 -06:00
|
|
|
|
|
|
|
However if you start modifying things in the automake build
|
2006-11-29 15:25:07 -07:00
|
|
|
system used by many packages, you will need to have the following
|
2006-11-30 10:58:48 -07:00
|
|
|
GNU autotools packages installed:
|
2006-11-29 15:25:07 -07:00
|
|
|
|
2012-08-05 12:08:05 -06:00
|
|
|
- automake 1.12 (devel/automake/1.12)
|
|
|
|
- autoconf 2.69 (devel/autoconf/2.69)
|
2012-08-04 11:10:01 -06:00
|
|
|
- metaauto 0.9 (or later) (devel/metaauto)
|
2012-01-28 14:04:42 -07:00
|
|
|
- libtool 2.4.2 (or later) (devel/libtool)
|
2006-11-29 15:25:07 -07:00
|
|
|
|
2007-04-09 12:58:23 -06:00
|
|
|
If you have your source tree on an NFS partition, make sure the clock
|
2008-10-05 02:08:33 -06:00
|
|
|
of your server and client are properly synchronised. Any significant
|
|
|
|
drift will cause various problems during builds.
|
2007-04-09 12:58:23 -06:00
|
|
|
|
2007-03-31 14:25:53 -06:00
|
|
|
Path
|
|
|
|
|
2008-10-05 02:10:05 -06:00
|
|
|
To build Xenocara, you need to have /usr/X11R6/bin in your PATH.
|
2007-03-31 14:25:53 -06:00
|
|
|
|
2006-11-30 10:58:48 -07:00
|
|
|
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
|
2008-10-05 02:10:05 -06:00
|
|
|
to any module sub-directory and run 'make build' from there.
|
2006-11-29 15:25:07 -07:00
|
|
|
|
2007-03-31 14:25:53 -06:00
|
|
|
Source directory
|
|
|
|
|
|
|
|
The variable XSRCDIR can be set either in the environment or in
|
2007-04-01 13:04:58 -06:00
|
|
|
/etc/mk.conf to point to the xenocara source tree, in case you keep it
|
2008-03-03 00:01:44 -07:00
|
|
|
in a non-standard directory (the default is /usr/xenocara).
|
2007-03-31 14:25:53 -06:00
|
|
|
|
2006-11-29 15:25:07 -07:00
|
|
|
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
|
2008-10-05 02:10:05 -06:00
|
|
|
sure that the object directories are created.
|
|
|
|
XOBJDIR defines the obj directory that is used (defaults to /usr/xobj).
|
2007-04-07 07:18:40 -06:00
|
|
|
It should be created before running 'make obj'.
|
2006-11-29 15:25:07 -07:00
|
|
|
|
|
|
|
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
|
2008-10-05 02:10:05 -06:00
|
|
|
makefiles skeletons. For that use the following command in the
|
2007-04-07 07:21:12 -06:00
|
|
|
directory where you edited the autotools source files:
|
2006-11-29 15:25:07 -07:00
|
|
|
|
2017-02-23 20:07:03 -07:00
|
|
|
make -f Makefile.bsd-wrapper autoreconf
|
2017-02-12 11:19:54 -07:00
|
|
|
doas make -f Makefile.bsd-wrapper build
|
2006-11-29 15:25:07 -07:00
|
|
|
|
2007-04-07 07:35:06 -06:00
|
|
|
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
|
2008-10-05 02:10:05 -06:00
|
|
|
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.
|
2007-04-07 07:35:06 -06:00
|
|
|
|
|
|
|
To recover from this in one package:
|
|
|
|
|
|
|
|
rm -f obj
|
|
|
|
make -f Makefile.bsd-wrapper cleandir
|
|
|
|
mkdir XOBJDIR
|
|
|
|
make -f Makefile.bsd-wrapper obj
|
2016-10-14 12:29:18 -06:00
|
|
|
doas make -f Makefile.bsd-wrapper build
|
2007-04-07 07:35:06 -06:00
|
|
|
|
|
|
|
or from the root of the xenocara tree:
|
|
|
|
|
2008-10-05 02:10:05 -06:00
|
|
|
find . -type l -name obj | xargs rm -f
|
2007-04-07 07:35:06 -06:00
|
|
|
make cleandir
|
|
|
|
mkdir XOBJDIR
|
|
|
|
make obj
|
2016-10-14 12:29:18 -06:00
|
|
|
doas make build
|
2007-04-07 07:35:06 -06:00
|
|
|
|
2007-04-07 10:07:41 -06:00
|
|
|
for more desperate cases, remove all files from XSRCDIR not in CVS:
|
2007-04-07 07:35:06 -06:00
|
|
|
|
|
|
|
cd XSRCDIR
|
|
|
|
cvs -q update -PAd -I - | awk '$1=="?" {print $2}' | xargs rm -f
|
|
|
|
|
2007-05-31 18:19:52 -06:00
|
|
|
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
|
2008-10-05 02:10:05 -06:00
|
|
|
2) put
|
2007-05-31 18:19:52 -06:00
|
|
|
|
|
|
|
Option "NoTrapSignals" "true"
|
|
|
|
|
2008-10-05 02:10:05 -06:00
|
|
|
in the "ServerFlags" section of /etc/X11/xorg.conf. If such a section
|
2007-05-31 18:19:52 -06:00
|
|
|
doesn't exist, it can be added as follow:
|
|
|
|
|
|
|
|
Section "ServerFlags"
|
|
|
|
Option "NoTrapSignals" "true"
|
|
|
|
EndSection
|
|
|
|
|
2008-10-05 02:10:05 -06:00
|
|
|
anywhere in the configuration file.
|
2007-05-31 18:19:52 -06:00
|
|
|
|
|
|
|
3) start the X server as root, with the -keepPriv option. A regular
|
2017-08-19 03:12:13 -06:00
|
|
|
user is not allowed to use this option. If you use xenodm, you can
|
|
|
|
add the option in /etc/X11/xenodm/Xservers. If you want to use
|
|
|
|
startx, you need to run it as root, like this:
|
2007-05-31 18:19:52 -06:00
|
|
|
|
|
|
|
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>
|
|
|
|
|
2007-04-07 07:35:06 -06:00
|
|
|
--
|
2017-08-19 03:12:13 -06:00
|
|
|
$OpenBSD: README,v 1.40 2017/08/19 09:12:13 matthieu Exp $
|