Difference between revisions of "Xorg7/MesaLib"

From CBLFS
Jump to navigationJump to search
(Fix compiling on non-x86 architectures and add 32bit multilib information)
(Multilib)
Line 75: Line 75:
 
==Multilib==
 
==Multilib==
  
=== 32-bit ===
+
=== 32Bit ===
 
 
Set the PKG_CONFIG_PATH:
 
 
 
export PKG_CONFIG_PATH="${PKG_CONFIG_PATH32}"
 
  
 
Apply the patch and correct some hardcoded paths.
 
Apply the patch and correct some hardcoded paths.
Line 95: Line 91:
 
Compile the package:
 
Compile the package:
  
 +
PKG_CONFIG_PATH="${PKG_CONFIG_PATH32}" \
 
  make CC="gcc ${BUILD32}" OPT_FLAGS="${BUILD32}" linux-dri
 
  make CC="gcc ${BUILD32}" OPT_FLAGS="${BUILD32}" linux-dri
  
Line 103: Line 100:
 
  install -m755 lib/*dri* ${XORG_PREFIX}/lib/X11/modules/dri
 
  install -m755 lib/*dri* ${XORG_PREFIX}/lib/X11/modules/dri
  
Clean up the enviornment:
+
=== N32 ===
 +
 
 +
=== 64Bit ===
 +
 
 +
Apply the patch and correct some hardcoded paths.
 +
 
 +
patch -Np1 -i ../mesa-6.5-drop_static_inline.patch &&
 +
sed -i "s:X11R6/lib:&64:g" $(grep -lr X11R6/lib *) &&
 +
sed -i "s@/usr/X11R6@$XORG_PREFIX@g" $(grep -lr /usr/X11R6 *) &&
 +
sed -i configs/linux-dri* -e "s/-DHAVE_ALIAS/& -DGLX_USE_TLS/" &&
 +
sed -i 's@lib/modules@lib/X11/modules@' src/glx/x11/dri_glx.c &&
 +
sed -i 's@lib/modules@lib/X11/modules@' src/mesa/drivers/dri/Makefile.template &&
 +
sed -i "/^LIB_DIR=/s:/lib:&64:" bin/installmesa
 +
 
 +
Fix an error with output redirection if /bin/sh is not the Bash shell on your system:
 +
 
 +
sed -i 's%>& /dev/null%>/dev/null%' src/mesa/drivers/dri/Makefile.template
 +
 
 +
Compile the package:
 +
 
 +
PKG_CONFIG_PATH="${PKG_CONFIG_PATH64}" \
 +
make CC="gcc ${BUILD64}" OPT_FLAGS="${BUILD64}" linux-dri
  
  unset PKG_CONFIG_PATH
+
Install the binaries and modules.
 +
 
 +
  bin/installmesa ${XORG_PREFIX} &&
 +
install -d ${XORG_PREFIX}/lib64/X11/modules/dri &&
 +
install -m755 lib/*dri* ${XORG_PREFIX}/lib64/X11/modules/dri
  
 
Forward to [[Xorg7/xbitmaps|xbitmaps]]
 
Forward to [[Xorg7/xbitmaps|xbitmaps]]

Revision as of 15:50, 10 October 2006

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

Back to libdrm

MesaLib

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, if you choose to install the demos, extract all three tarballs from the same toplevel directory. All three will extract to the Mesa-6.5 directory.

Dependencies

Required

   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.

Non-Multilib

Apply the patch and correct some hardcoded paths.

patch -Np1 -i ../mesa-6.5-drop_static_inline.patch &&
sed -i "s@/usr/X11R6@$XORG_PREFIX@g"$(grep -lr /usr/X11R6 *) &&
sed -i 's@lib/modules@lib/X11/modules@' src/glx/x11/dri_glx.c &&
sed -i 's@lib/modules@lib/X11/modules@' src/mesa/drivers/dri/Makefile.template

Fix an error with output redirection if /bin/sh is not the Bash shell on your system:

sed -i 's%>& /dev/null%>/dev/null%' src/mesa/drivers/dri/Makefile.template

Compile the package:

make linux-dri

Install the binaries and modules.

bin/installmesa ${XORG_PREFIX} &&
install -d ${XORG_PREFIX}/lib/X11/modules/dri &&
install -m755 lib/*dri* ${XORG_PREFIX}/lib/X11/modules/dri

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

Multilib

32Bit

Apply the patch and correct some hardcoded paths.

patch -Np1 -i ../mesa-6.5-drop_static_inline.patch &&
sed -i "s@/usr/X11R6@$XORG_PREFIX@g" $(grep -lr /usr/X11R6 *) &&
sed -i configs/linux-dri* -e "s/-DHAVE_ALIAS/& -DGLX_USE_TLS/" &&
sed -i 's@lib/modules@lib/X11/modules@' src/glx/x11/dri_glx.c &&
sed -i 's@lib/modules@lib/X11/modules@' src/mesa/drivers/dri/Makefile.template

Fix an error with output redirection if /bin/sh is not the Bash shell on your system:

sed -i 's%>& /dev/null%>/dev/null%' src/mesa/drivers/dri/Makefile.template

Compile the package:

PKG_CONFIG_PATH="${PKG_CONFIG_PATH32}" \
make CC="gcc ${BUILD32}" OPT_FLAGS="${BUILD32}" linux-dri

Install the binaries and modules.

bin/installmesa ${XORG_PREFIX} &&
install -d ${XORG_PREFIX}/lib/X11/modules/dri &&
install -m755 lib/*dri* ${XORG_PREFIX}/lib/X11/modules/dri

N32

64Bit

Apply the patch and correct some hardcoded paths.

patch -Np1 -i ../mesa-6.5-drop_static_inline.patch &&
sed -i "s:X11R6/lib:&64:g" $(grep -lr X11R6/lib *) &&
sed -i "s@/usr/X11R6@$XORG_PREFIX@g" $(grep -lr /usr/X11R6 *) &&
sed -i configs/linux-dri* -e "s/-DHAVE_ALIAS/& -DGLX_USE_TLS/" &&
sed -i 's@lib/modules@lib/X11/modules@' src/glx/x11/dri_glx.c &&
sed -i 's@lib/modules@lib/X11/modules@' src/mesa/drivers/dri/Makefile.template &&
sed -i "/^LIB_DIR=/s:/lib:&64:" bin/installmesa

Fix an error with output redirection if /bin/sh is not the Bash shell on your system:

sed -i 's%>& /dev/null%>/dev/null%' src/mesa/drivers/dri/Makefile.template

Compile the package:

PKG_CONFIG_PATH="${PKG_CONFIG_PATH64}" \
make CC="gcc ${BUILD64}" OPT_FLAGS="${BUILD64}" linux-dri

Install the binaries and modules.

bin/installmesa ${XORG_PREFIX} &&
install -d ${XORG_PREFIX}/lib64/X11/modules/dri &&
install -m755 lib/*dri* ${XORG_PREFIX}/lib64/X11/modules/dri

Forward to xbitmaps