README 7.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225
  1. Notes on building Xenocara for OpenBSD X hackers
  2. This document presents some techniques that can be useful for people
  3. wanting to hack the xenocara tree. It assumes some basic knowledge of
  4. the OpenBSD build system, as described in the release(8) manual page.
  5. o About Xenocara
  6. --------------
  7. Xenocara is the name chosen for OpenBSD's version of X. It's
  8. currently based on X.Org 7.7 and its dependencies. The goal of
  9. Xenocara is to provide a framework to host local modifications and to
  10. automate the build of the modular X.Org components, including 3rd
  11. party packages and some software maintained by OpenBSD developers.
  12. o Source tree
  13. -----------
  14. The organisation of the xenocara directory follows the general
  15. organisation used in X.Org:
  16. - app: X applications and utilities
  17. - data: various data files (keyboard mappings and bitmaps)
  18. - doc: documentation
  19. - driver: input and video drivers
  20. - font: fonts
  21. - lib: libraries
  22. - proto: X protocol headers
  23. - util: utilities that don't fit anywhere else
  24. - xserver: the source for the X servers
  25. In addition Xenocara uses the following directories:
  26. - dist: contains some of the 3rd party sources, when keeping them
  27. separate helps the build system (Mesa and xkeyboard-config)
  28. - distrib: all binary distribution related tools and data
  29. - etc: mtree(8) data files
  30. - share: make(1) configuration for Xenocara
  31. At the top-level directory two files describe the individual
  32. components of Xenocara:
  33. - MODULES lists all X.Org components (imported from the X.Org
  34. distribution at http://xorg.freedesktop.org/archive/)
  35. - 3RDPARTY lists all 3rd party software components provided in Xenocara,
  36. either as dependencies of the X.Org software, or as
  37. complements to it to provide a more useable default
  38. environment.
  39. o Compiling and installing
  40. ------------------------
  41. Xenocara is made up of almost three hundred different independent
  42. packages that need to be built and installed in the right order,
  43. especially while bootstrapping (while /usr/X11R6 is still empty). The
  44. Xenocara Makefiles take care of that using the 'build' target.
  45. Quick startup guide
  46. The following steps will build and install everything for the first time.
  47. cd xenocara
  48. make bootstrap
  49. make obj
  50. make build
  51. If you want to use another obj directory see below.
  52. Requirements
  53. A freshly checked out xenocara tree is buildable without any external
  54. tool. Only the xenocara and the src (currently only the
  55. src/sys/dev/pci/pcidevs file) trees are needed.
  56. However if you start modifying things in the automake build
  57. system used by many packages, you will need to have the following
  58. GNU autotools packages installed:
  59. - automake 1.12 (devel/automake/1.12)
  60. - autoconf 2.69 (devel/autoconf/2.69)
  61. - metaauto 0.9 (or later) (devel/metaauto)
  62. - libtool 2.4.2 (or later) (devel/libtool)
  63. If you have your source tree on an NFS partition, make sure the clock
  64. of your server and client are properly synchronised. Any significant
  65. drift will cause various problems during builds.
  66. Path
  67. To build Xenocara, you need to have /usr/X11R6/bin in your PATH.
  68. Sudo
  69. If the SUDO variable points to your sudo(8) binary in /etc/mk.conf,
  70. 'make build' can be run as a normal user. It will raise its privileges
  71. whenever needed with sudo. Otherwise, you need to run make build as
  72. root.
  73. If you have installed the full Xenocara X sets on your system, you
  74. don't need to build all of Xenocara to patch one element. You can go
  75. to any module sub-directory and run 'make build' from there.
  76. Source directory
  77. The variable XSRCDIR can be set either in the environment or in
  78. /etc/mk.conf to point to the xenocara source tree, in case you keep it
  79. in a non-standard directory (the default is /usr/xenocara).
  80. Objdirs
  81. Xenocara supports objdirs (and it's even the recommended way to build
  82. things). Just run 'make obj' at any level before 'make build' to make
  83. sure that the object directories are created.
  84. XOBJDIR defines the obj directory that is used (defaults to /usr/xobj).
  85. It should be created before running 'make obj'.
  86. o Regenerating configure scripts
  87. ------------------------------
  88. Whenever you touched an import file for GNU autotools (Makefile.am,
  89. configure.ac mostly), you need to rebuild the configure script and
  90. makefiles skeletons. For that use the following command in the
  91. directory where you edited the autotools source files:
  92. env XENOCARA_RERUN_AUTOCONF=Yes make -f Makefile.bsd-wrapper build
  93. You can also set XENOCARA_RERUN_AUTOCONF in /etc/mk.conf or in the
  94. environment to force the regeneration of configure scripts
  95. in every component during a make build.
  96. o Building Gallium3D with LLVM support
  97. --------------------------------------
  98. When building Mesa with LLVM support instead of the 'classic'
  99. software rasteriser the Gallium3D LLVMpipe rasteriser will be used.
  100. The radeonsi driver for Southern Islands and newer AMD Radeon parts
  101. is only built when Gallium is compiled with LLVM support as it requires
  102. the R600 LLVM target.
  103. You will need to have the llvm and libelf packages installed and use the following
  104. command in the libGL build directory:
  105. env XENOCARA_BUILD_GALLIUM=llvm make obj
  106. env XENOCARA_BUILD_GALLIUM=llvm make build
  107. Alternatively, you can also set XENOCARA_BUILD_GALLIUM in /etc/mk.conf
  108. or in your environment.
  109. o Cleaning in packages managed by autotools
  110. -----------------------------------------
  111. One common problem when building xenocara is the case where the obj
  112. directory didn't exist (or the symbolic link pointed to a non-existent
  113. directory) when the source was first built. After fixing this problem,
  114. 'configure' will refuse to work in the obj dir, because the source
  115. is already configured.
  116. To recover from this in one package:
  117. rm -f obj
  118. make -f Makefile.bsd-wrapper cleandir
  119. mkdir XOBJDIR
  120. make -f Makefile.bsd-wrapper obj
  121. make -f Makefile.bsd-wrapper build
  122. or from the root of the xenocara tree:
  123. find . -type l -name obj | xargs rm -f
  124. make cleandir
  125. mkdir XOBJDIR
  126. make obj
  127. make build
  128. for more desperate cases, remove all files from XSRCDIR not in CVS:
  129. cd XSRCDIR
  130. cvs -q update -PAd -I - | awk '$1=="?" {print $2}' | xargs rm -f
  131. o How to build something with debug information?
  132. ----------------------------------------------
  133. You can use "env CFLAGS=-g make -f Makefile.bsd-wrapper build" to
  134. build any module with debugging information, but you'll need to remove
  135. XOBJDIR/xorg-config.cache.${MACHINE} before doing that because
  136. autoconf caches the value of CFLAGS in its cache.
  137. o How to get a core file out of the X server?
  138. -------------------------------------------
  139. Several things are needed:
  140. 1) set kern.nosuidcoredump=2 in /etc/sysctl.conf
  141. 2) put
  142. Option "NoTrapSignals" "true"
  143. in the "ServerFlags" section of /etc/X11/xorg.conf. If such a section
  144. doesn't exist, it can be added as follow:
  145. Section "ServerFlags"
  146. Option "NoTrapSignals" "true"
  147. EndSection
  148. anywhere in the configuration file.
  149. 3) start the X server as root, with the -keepPriv option. A regular
  150. user is not allowed to use this option. If you use xdm, you can add
  151. the option in /etc/X11/xdm/Xservers. If you want to use startx, you
  152. need to run it as root, like this:
  153. startx -- /usr/X11R6/bin/X -keepPriv
  154. Now the X server will dump core when catching a fatal signal. But it
  155. will also not be able to restore the text mode on exit. So be prepared
  156. to log in remotely (serial terminal or ssh) to reboot your machine or
  157. to restart X.
  158. The core dump will be in /var/crash.
  159. See also <http://xorg.freedesktop.org/wiki/Development/Documentation/ServerDebugging>
  160. --
  161. $OpenBSD: README,v 1.34 2013/09/07 02:18:32 jsg Exp $