Difference between revisions of "Xorg7/MesaLib"

From CBLFS
Jump to navigationJump to search
Line 31: Line 31:
  
 
=== Required ===
 
=== Required ===
 
 
* Xorg [[Xorg7/Protocol_Headers|Protocol Headers]] glproto >=1.4.5
 
* Xorg [[Xorg7/Protocol_Headers|Protocol Headers]] glproto >=1.4.5
 
* Xorg [[Xorg7/Libraries|Libraries]]
 
* Xorg [[Xorg7/Libraries|Libraries]]
Line 37: Line 36:
 
* [[Xorg7/libdrm|libdrm]]
 
* [[Xorg7/libdrm|libdrm]]
  
{{Note|Don't remove the source after building MesaLib.  It is needed by the Xorg Xserver build.  You need to pass the path to the MesaLib source when building xorg-server, so take note of it.}}
+
== Optional ===
 +
* [[XCB]]
  
{{Note|Executing 'make' in the top of the source tree will provide a list of supported targetsSeveral of these are 64-bit targets.  Do not use these on a '''pure''' 64-bit system.  The config files for these targets look in $XORG_PREFIX/lib64 for dependenciesThey are really for multilib use and the regular ''linux'' or ''linux-dri'' target are appropriate for either the pure 32-bit or pure 64-bit system.}}
+
{{Note|Don't remove the source after building MesaIt is needed by the [[Xorg7/Xserver]] buildYou need to pass the path to the MesaLib source when building xorg-server, so take note of it.}}
  
 
== Non-Multilib ==
 
== Non-Multilib ==
  
Apply the patch and correct some hardcoded paths.
+
Apply a patch that solves some linker errors with the savage dri driver.
  
  patch -Np1 -i ../mesa-{{Mesa-Version}}-drop_static_inline.patch &&
+
  patch -Np1 -i ../mesa-{{Mesa-Version}}-drop_static_inline.patch
sed -i "s@/usr/X11R6@$XORG_PREFIX@g" $(grep -lr /usr/X11R6 *) &&
 
sed -i 's@lib/modules@lib/xorg/modules@' src/glx/x11/dri_glx.c &&
 
sed -i 's@lib/modules@lib/xorg/modules@' src/mesa/drivers/dri/Makefile.template
 
  
Fix an error with output redirection if /bin/sh is not the Bash shell on your system:
+
Create a config:
  
  sed -i 's%>& /dev/null%>/dev/null%' src/mesa/drivers/dri/Makefile.template
+
  ln -sf linux-dri configs/current &&
 +
echo 'X11_INCLUDES = $(shell pkg-config --cflags-only-I x11)' >> configs/current &&
 +
echo 'CFLAGS += $(X11_INCLUDES)' >> configs/current &&
 +
echo 'EXTRA_LIB_PATH = $(shell pkg-config --libs-only-L x11)' >> configs/current &&
 +
echo "DRI_DRIVER_INSTALL_DIR = ${XORG_PREFIX}/lib/xorg/modules/dri" >> configs/current &&
 +
echo "INSTALL_DIR = /usr" >> configs/current &&
 +
echo "LIB_DIR = lib" >> configs/current
  
Compile the package:
+
If you have [[XCB]] installed you also need to add the following to the config:
  
  make realclean
+
  echo 'DEFINES += -DUSE_XCB' >> configs/current &&
  make linux-dri
+
echo 'X11_INCLUDES += $(shell pkg-config --cflags-only-I xcb x11-xcb xcb-glx)' >> configs/current &&
 +
  echo 'GL_LIB_DEPS += $(shell pkg-config --libs xcb x11-xcb xcb-glx)' >> configs/current
  
Install the binaries and modules.
+
Compile the package:
  
  bin/installmesa ${XORG_PREFIX} &&
+
  make default
install -d ${XORG_PREFIX}/lib/xorg/modules/dri &&
 
install -m755 lib/*dri* ${XORG_PREFIX}/lib/xorg/modules/dri
 
  
If you chose to download and extract the demos, compile them now.
+
Install the package:
  
sed -i 's@-l$(GLUT_LIB)@@g' configs/default &&
+
  make install
cd progs/xdemos &&
 
  make PROGS='glxinfo glxgears'
 
  
Install the demo programs.
+
If you would like to build and install glxinfo and glxgears execute the following command:
  
  install -m755 glxinfo glxgears ${XORG_PREFIX}/bin
+
make ${MAKEOPTS} -C progs/xdemos glxinfo glxgears &&
 +
  install -m755 -v progs/xdemos/{glxinfo,glxgears} /usr/bin
  
 
== Multilib ==
 
== Multilib ==
Line 79: Line 80:
 
=== 32Bit ===
 
=== 32Bit ===
  
The Mesa source is needed to build the x-server, save the Mesa source tree for use with the 32-bit x-server build.
+
The Mesa source is needed to build [[Xorg7/Xserver]], save the Mesa source tree for use with the build.
 +
 
 +
mv Mesa-{{Mesa-Version}}{,-32} &&
 +
cd Mesa-{{Mesa-Version}}-32
 +
 
 +
Apply a patch that solves some linker errors with the savage dri driver.
  
  mv Mesa-{{Mesa-Version}} Mesa-{{Mesa-Version}}-32
+
  patch -Np1 -i ../mesa-{{Mesa-Version}}-drop_static_inline.patch
  
Apply the patch and correct some hardcoded paths.
+
Create a config:
  
  patch -Np1 -i ../mesa-{{Mesa-Version}}-drop_static_inline.patch &&
+
  ln -sf linux-dri configs/current &&
  sed -i configs/linux-dri* \
+
echo 'X11_INCLUDES = $(shell pkg-config --cflags-only-I x11)' >> configs/current &&
    -e "s@/usr/X11R6@$XORG_PREFIX@g" \
+
  echo 'CFLAGS += $(X11_INCLUDES)' >> configs/current &&
    -e "s/-DHAVE_ALIAS/& -DGLX_USE_TLS/" &&
+
echo 'EXTRA_LIB_PATH = $(shell pkg-config --libs-only-L x11)' >> configs/current &&
  sed -i "s@/usr/local@$XORG_PREFIX@g" bin/installmesa &&
+
  echo "DRI_DRIVER_INSTALL_DIR = ${XORG_PREFIX}/lib/xorg/modules/dri" >> configs/current &&
sed -i 's@lib/modules@lib/xorg/modules@' src/glx/x11/dri_glx.c &&
+
  echo "INSTALL_DIR = /usr" >> configs/current &&
  sed -i 's@lib/modules@lib/xorg/modules@' src/mesa/drivers/dri/Makefile.template
+
  echo "LIB_DIR = lib" >> configs/current
  
Fix an error with output redirection if /bin/sh is not the Bash shell on your system:
+
If you have [[XCB]] installed you also need to add the following to the config:
  
  sed -i 's%>& /dev/null%>/dev/null%' src/mesa/drivers/dri/Makefile.template
+
  echo 'DEFINES += -DUSE_XCB' >> configs/current &&
 +
echo 'X11_INCLUDES += $(shell pkg-config --cflags-only-I xcb x11-xcb xcb-glx)' >> configs/current &&
 +
echo 'GL_LIB_DEPS += $(shell pkg-config --libs xcb x11-xcb xcb-glx)' >> configs/current
  
 
Compile the package:
 
Compile the package:
  
 
  PKG_CONFIG_PATH="${PKG_CONFIG_PATH32}" \
 
  PKG_CONFIG_PATH="${PKG_CONFIG_PATH32}" \
  make CC="gcc ${BUILD32}" OPT_FLAGS="${BUILD32}" linux-dri
+
  make CC="gcc ${BUILD32}" CXX="g++ ${BUILD32}" default
  
Install the binaries and modules.
+
Install the package:
  
  bin/installmesa ${XORG_PREFIX} &&
+
  make install
install -d ${XORG_PREFIX}/lib/xorg/modules/dri &&
 
install -m755 lib/*dri* ${XORG_PREFIX}/lib/xorg/modules/dri
 
  
DEMOS: Only 1 Installation needed!
+
=== N32 ===
If you chose to download and extract the demos, compile them now.
 
 
 
sed -i 's@-l$(GLUT_LIB)@@g' configs/default &&
 
cd progs/xdemos &&
 
make PROGS='glxinfo glxgears'
 
 
 
Install the demo programs.
 
  
install -m755 glxinfo glxgears ${XORG_PREFIX}/bin
+
The Mesa source is needed to build [[Xorg7/Xserver]], save the Mesa source tree for use with the build.
  
=== N32 ===
+
mv Mesa-{{Mesa-Version}}{,-n32} &&
 +
cd Mesa-{{Mesa-Version}}-n32
  
The Mesa source is needed to build the x-server, save the Mesa source tree for use with the N32 x-server build.
+
Apply a patch that solves some linker errors with the savage dri driver.
  
  mv Mesa-{{Mesa-Version}} Mesa-{{Mesa-Version}}-N32
+
  patch -Np1 -i ../mesa-{{Mesa-Version}}-drop_static_inline.patch
  
Apply the patch and correct some hardcoded paths.
+
Create a config:
  
  patch -Np1 -i ../mesa-{{Mesa-Version}}-drop_static_inline.patch &&
+
  ln -sf linux-dri configs/current &&
  sed -i configs/linux-dri* \
+
  echo 'X11_INCLUDES = $(shell pkg-config --cflags-only-I x11)' >> configs/current &&
    -e "s@/usr/X11R6@${XORG_PREFIX}@g" \
+
echo 'CFLAGS += $(X11_INCLUDES)' >> configs/current &&
    -e "s/-DHAVE_ALIAS/& -DGLX_USE_TLS/" &&
+
  echo 'EXTRA_LIB_PATH = $(shell pkg-config --libs-only-L x11)' >> configs/current &&
  sed -i bin/installmesa \
+
echo "DRI_DRIVER_INSTALL_DIR = ${XORG_PREFIX}/lib32/xorg/modules/dri" >> configs/current &&
    -e 's@LIB_DIR=$1/lib@&32@' \
+
echo "INSTALL_DIR = /usr" >> configs/current &&
    -e 's@LIB_DIR="/usr/local/lib@&32@' \
+
echo "LIB_DIR = lib32" >> configs/current
    -e "s@/usr/local@${XORG_PREFIX}@g"
 
  
Fix an error with output redirection if /bin/sh is not the Bash shell on your system:
+
If you have [[XCB]] installed you also need to add the following to the config:
  
  sed -i 's%>& /dev/null%>/dev/null%' src/mesa/drivers/dri/Makefile.template
+
  echo 'DEFINES += -DUSE_XCB' >> configs/current &&
 +
echo 'X11_INCLUDES += $(shell pkg-config --cflags-only-I xcb x11-xcb xcb-glx)' >> configs/current &&
 +
echo 'GL_LIB_DEPS += $(shell pkg-config --libs xcb x11-xcb xcb-glx)' >> configs/current
  
 
Compile the package:
 
Compile the package:
  
  PKG_CONFIG_PATH="${PKG_CONFIG_PATHN32}" \
+
  PKG_CONFIG_PATH="${PKG_CONFIG_PATH32}" \
  make CC="gcc ${BUILDN32}" OPT_FLAGS="${BUILDN32}" '''linux-dri'''
+
  make CC="gcc ${BUILD32}" CXX="g++ ${BUILD32}" default
  
Install the binaries and modules.
+
Install the package:
  
  bin/installmesa ${XORG_PREFIX} &&
+
  make install
install -d ${XORG_PREFIX}/lib32/xorg/modules/dri &&
 
install -m755 lib32/*dri* ${XORG_PREFIX}/lib32/xorg/modules/dri
 
  
DEMOS: Only 1 Installation Needed!
+
=== 64Bit ===
If you chose to download and extract the demos, compile them now.
 
 
 
sed -i 's@-l$(GLUT_LIB)@@g' configs/default &&
 
cd progs/xdemos &&
 
make PROGS='glxinfo glxgears'
 
 
 
Install the demo programs.
 
  
install -m755 glxinfo glxgears ${XORG_PREFIX}/bin
+
The Mesa source is needed to build [[Xorg7/Xserver]], save the Mesa source tree for use with the build.
  
=== 64Bit ===
+
mv Mesa-{{Mesa-Version}}{,-64} &&
 +
cd Mesa-{{Mesa-Version}}-64
  
The Mesa source is needed to build the x-server, save the Mesa source tree for use with the 64-bit x-server build.
+
Apply a patch that solves some linker errors with the savage dri driver.
  
  mv Mesa-{{Mesa-Version}} Mesa-{{Mesa-Version}}-64
+
  patch -Np1 -i ../mesa-{{Mesa-Version}}-drop_static_inline.patch
  
Apply the patch and correct some hardcoded paths.
+
Create a config:
  
  patch -Np1 -i ../mesa-{{Mesa-Version}}-drop_static_inline.patch &&
+
  ln -sf linux-dri configs/current &&
  sed -i configs/linux-dri* \
+
  echo 'X11_INCLUDES = $(shell pkg-config --cflags-only-I x11)' >> configs/current &&
    -e "s@/usr/X11R6@${XORG_PREFIX}@g" \
+
echo 'CFLAGS += $(X11_INCLUDES)' >> configs/current &&
    -e "s/-DHAVE_ALIAS/& -DGLX_USE_TLS/" &&
+
  echo 'EXTRA_LIB_PATH = $(shell pkg-config --libs-only-L x11)' >> configs/current &&
  sed -i bin/installmesa \
+
echo "DRI_DRIVER_INSTALL_DIR = ${XORG_PREFIX}/lib64/xorg/modules/dri" >> configs/current &&
    -e 's@LIB_DIR=$1/lib@&64@' \
+
echo "INSTALL_DIR = /usr" >> configs/current &&
    -e 's@LIB_DIR="/usr/local/lib@&64@' \
+
echo "LIB_DIR = lib64" >> configs/current
    -e "s@/usr/local@${XORG_PREFIX}@g"
 
  
Fix an error with output redirection if /bin/sh is not the Bash shell on your system:
+
If you have [[XCB]] installed you also need to add the following to the config:
  
  sed -i 's%>& /dev/null%>/dev/null%' src/mesa/drivers/dri/Makefile.template
+
  echo 'DEFINES += -DUSE_XCB' >> configs/current &&
 +
echo 'X11_INCLUDES += $(shell pkg-config --cflags-only-I xcb x11-xcb xcb-glx)' >> configs/current &&
 +
echo 'GL_LIB_DEPS += $(shell pkg-config --libs xcb x11-xcb xcb-glx)' >> configs/current
  
 
Compile the package:
 
Compile the package:
  
 
  PKG_CONFIG_PATH="${PKG_CONFIG_PATH64}" \
 
  PKG_CONFIG_PATH="${PKG_CONFIG_PATH64}" \
  make CC="gcc ${BUILD64}" OPT_FLAGS="${BUILD64}" '''linux-dri-x86-64'''
+
  make CC="gcc ${BUILD64}" CXX="g++ ${BUILD64}" default
 
 
Install the binaries and modules.
 
 
 
bin/installmesa ${XORG_PREFIX} &&
 
install -d ${XORG_PREFIX}/lib64/xorg/modules/dri &&
 
install -m755 lib64/*dri* ${XORG_PREFIX}/lib64/xorg/modules/dri
 
  
DEMOS: Only 1 Installation Needed!
+
Install the package:
If you chose to download and extract the demos, compile them now.
 
  
sed -i 's@-l$(GLUT_LIB)@@g' configs/default &&
+
  make install
cd progs/xdemos &&
 
  make PROGS='glxinfo glxgears'
 
  
Install the demo programs.
+
If you would like to build and install glxinfo and glxgears execute the following command:
  
  install -m755 glxinfo glxgears ${XORG_PREFIX}/bin
+
make ${MAKEOPTS} -C progs/xdemos glxinfo glxgears &&
 +
  install -m755 -v progs/xdemos/{glxinfo,glxgears} /usr/bin
  
 
Forward to [[Xorg7/xbitmaps|xbitmaps]]
 
Forward to [[Xorg7/xbitmaps|xbitmaps]]

Revision as of 15:17, 24 April 2007

Download Source:
http://prdownloads.sourceforge.net/mesa3d/MesaLib-7.9.tar.bz2
http://prdownloads.sourceforge.net/mesa3d/MesaDemos-7.9.tar.bz2
http://prdownloads.sourceforge.net/mesa3d/MesaGLUT-7.9.tar.bz2
Download Patch:
http://svn.cross-lfs.org/svn/repos/patches/Mesa/mesa-7.9-drop_static_inline.patch

Back to libdrm

Introduction to Mesa

Mesa is an OpenGL compatible 3D library. Three packages are available.

  • MesaLib - the main Mesa library source code, drivers and documentation.
  • MesaDemos - OpenGL demonstration and test programs. Most of the programs require GLUT.
  • MesaGLUT - provides a working libglut.

If you're not interested in running the demos, you'll only need the first package. However, there are a few other packages that can use a GLUT library (such as LibTIFF), so you may wish to install MesaGLUT as well. If you choose to install the demos, extract all three tarballs from the same toplevel directory. All three will extract to the Mesa-7.9 directory.

Homepage: http://www.mesa3d.org/

Dependencies

Required

Optional =

Caution.png

Note

Don't remove the source after building Mesa. It is needed by the Xorg7/Xserver build. You need to pass the path to the MesaLib source when building xorg-server, so take note of it.

Non-Multilib

Apply a patch that solves some linker errors with the savage dri driver.

patch -Np1 -i ../mesa-7.9-drop_static_inline.patch

Create a config:

ln -sf linux-dri configs/current &&
echo 'X11_INCLUDES = $(shell pkg-config --cflags-only-I x11)' >> configs/current &&
echo 'CFLAGS += $(X11_INCLUDES)' >> configs/current &&
echo 'EXTRA_LIB_PATH = $(shell pkg-config --libs-only-L x11)' >> configs/current &&
echo "DRI_DRIVER_INSTALL_DIR = ${XORG_PREFIX}/lib/xorg/modules/dri" >> configs/current &&
echo "INSTALL_DIR = /usr" >> configs/current &&
echo "LIB_DIR = lib" >> configs/current

If you have XCB installed you also need to add the following to the config:

echo 'DEFINES += -DUSE_XCB' >> configs/current &&
echo 'X11_INCLUDES += $(shell pkg-config --cflags-only-I xcb x11-xcb xcb-glx)' >> configs/current &&
echo 'GL_LIB_DEPS += $(shell pkg-config --libs xcb x11-xcb xcb-glx)' >> configs/current

Compile the package:

make default

Install the package:

make install

If you would like to build and install glxinfo and glxgears execute the following command:

make ${MAKEOPTS} -C progs/xdemos glxinfo glxgears &&
install -m755 -v progs/xdemos/{glxinfo,glxgears} /usr/bin

Multilib

32Bit

The Mesa source is needed to build Xorg7/Xserver, save the Mesa source tree for use with the build.

mv Mesa-7.9{,-32} &&
cd Mesa-7.9-32

Apply a patch that solves some linker errors with the savage dri driver.

patch -Np1 -i ../mesa-7.9-drop_static_inline.patch

Create a config:

ln -sf linux-dri configs/current &&
echo 'X11_INCLUDES = $(shell pkg-config --cflags-only-I x11)' >> configs/current &&
echo 'CFLAGS += $(X11_INCLUDES)' >> configs/current &&
echo 'EXTRA_LIB_PATH = $(shell pkg-config --libs-only-L x11)' >> configs/current &&
echo "DRI_DRIVER_INSTALL_DIR = ${XORG_PREFIX}/lib/xorg/modules/dri" >> configs/current &&
echo "INSTALL_DIR = /usr" >> configs/current &&
echo "LIB_DIR = lib" >> configs/current

If you have XCB installed you also need to add the following to the config:

echo 'DEFINES += -DUSE_XCB' >> configs/current &&
echo 'X11_INCLUDES += $(shell pkg-config --cflags-only-I xcb x11-xcb xcb-glx)' >> configs/current &&
echo 'GL_LIB_DEPS += $(shell pkg-config --libs xcb x11-xcb xcb-glx)' >> configs/current

Compile the package:

PKG_CONFIG_PATH="${PKG_CONFIG_PATH32}" \
make CC="gcc ${BUILD32}" CXX="g++ ${BUILD32}" default

Install the package:

make install

N32

The Mesa source is needed to build Xorg7/Xserver, save the Mesa source tree for use with the build.

mv Mesa-7.9{,-n32} &&
cd Mesa-7.9-n32

Apply a patch that solves some linker errors with the savage dri driver.

patch -Np1 -i ../mesa-7.9-drop_static_inline.patch

Create a config:

ln -sf linux-dri configs/current &&
echo 'X11_INCLUDES = $(shell pkg-config --cflags-only-I x11)' >> configs/current &&
echo 'CFLAGS += $(X11_INCLUDES)' >> configs/current &&
echo 'EXTRA_LIB_PATH = $(shell pkg-config --libs-only-L x11)' >> configs/current &&
echo "DRI_DRIVER_INSTALL_DIR = ${XORG_PREFIX}/lib32/xorg/modules/dri" >> configs/current &&
echo "INSTALL_DIR = /usr" >> configs/current &&
echo "LIB_DIR = lib32" >> configs/current

If you have XCB installed you also need to add the following to the config:

echo 'DEFINES += -DUSE_XCB' >> configs/current &&
echo 'X11_INCLUDES += $(shell pkg-config --cflags-only-I xcb x11-xcb xcb-glx)' >> configs/current &&
echo 'GL_LIB_DEPS += $(shell pkg-config --libs xcb x11-xcb xcb-glx)' >> configs/current

Compile the package:

PKG_CONFIG_PATH="${PKG_CONFIG_PATH32}" \
make CC="gcc ${BUILD32}" CXX="g++ ${BUILD32}" default

Install the package:

make install

64Bit

The Mesa source is needed to build Xorg7/Xserver, save the Mesa source tree for use with the build.

mv Mesa-7.9{,-64} &&
cd Mesa-7.9-64

Apply a patch that solves some linker errors with the savage dri driver.

patch -Np1 -i ../mesa-7.9-drop_static_inline.patch

Create a config:

ln -sf linux-dri configs/current &&
echo 'X11_INCLUDES = $(shell pkg-config --cflags-only-I x11)' >> configs/current &&
echo 'CFLAGS += $(X11_INCLUDES)' >> configs/current &&
echo 'EXTRA_LIB_PATH = $(shell pkg-config --libs-only-L x11)' >> configs/current &&
echo "DRI_DRIVER_INSTALL_DIR = ${XORG_PREFIX}/lib64/xorg/modules/dri" >> configs/current &&
echo "INSTALL_DIR = /usr" >> configs/current &&
echo "LIB_DIR = lib64" >> configs/current

If you have XCB installed you also need to add the following to the config:

echo 'DEFINES += -DUSE_XCB' >> configs/current &&
echo 'X11_INCLUDES += $(shell pkg-config --cflags-only-I xcb x11-xcb xcb-glx)' >> configs/current &&
echo 'GL_LIB_DEPS += $(shell pkg-config --libs xcb x11-xcb xcb-glx)' >> configs/current

Compile the package:

PKG_CONFIG_PATH="${PKG_CONFIG_PATH64}" \
make CC="gcc ${BUILD64}" CXX="g++ ${BUILD64}" default

Install the package:

make install

If you would like to build and install glxinfo and glxgears execute the following command:

make ${MAKEOPTS} -C progs/xdemos glxinfo glxgears &&
install -m755 -v progs/xdemos/{glxinfo,glxgears} /usr/bin

Forward to xbitmaps

Contents

Installed Directories: /usr/include/GLES
Installed Programs: None
Installed Libraries: libGL.so, libGLU.so, libGLw.so, libOSMesa.so, libglut.so

Short Description