HOWTO compile the mga driver on your system

Installation and Configuration HOWTOs for the unofficial drivers

HOWTO compile the mga driver on your system

Postby » Thu Oct 18, 2007 9:36 pm

If you don't want to use the precompiled binary archives for any reason,
there's of course the possibility to compile the mga driver on your own.

Usually, compiling the driver is very easy (given that all the necessary build
environment tools and libraries are already installed on your system, e.g.
gcc, make, etc.):

1. Download the source for the latest version

Code: Select all
tuxx@tuxxpad:/tmp$ wget -q

2. Extract the source

Code: Select all
tuxx@tuxxpad:/tmp$ tar xf matroxdriver_mga-x86-4.4.4-source.tgz

3. Change into the directory and run `./configure`:

Code: Select all
tuxx@tuxxpad:/tmp$ cd matroxdriver_mga-x86-4.4.4-source/7.0.0/src/mga/
tuxx@tuxxpad:/tmp/matroxdriver_mga-x86-4.4.4-source/7.0.0/src/mga$ ./configure
checking for a BSD-compatible install... /usr/bin/install -c
checking whether build environment is sane... yes
checking for gawk... no
checking for mawk... mawk
checking whether make sets $(MAKE)... yes
checking whether to enable maintainer-specific portions of Makefiles... no
checking build system type... i686-pc-linux-gnu
checking host system type... i686-pc-linux-gnu
checking for style of include used by make... GNU
checking for gcc... gcc
checking for C compiler default output file name... a.out
checking whether the C compiler works... yes
checking pkg-config is at least version 0.9.0... yes
checking for XORG... yes
checking for ANSI C header files... (cached) yes
checking for /usr/include/xorg/dri.h... yes
checking for /usr/include/xorg/sarea.h... yes
checking for /usr/include/xorg/dristruct.h... yes
checking whether to include DRI support... yes
checking for DRI... yes
configure: creating ./config.status
config.status: creating Makefile
config.status: creating src/Makefile
config.status: creating man/Makefile
config.status: creating util/Makefile
config.status: creating config.h
config.status: executing depfiles commands

If `./configure` fails, it usually tells you exactly what's wrong (missing packages,
wrong configuration, etc.). Only if `./configure` exits without errors you
may continue to compile the driver module.

4. Configure the build system to make use of the mgahal library

Code: Select all
tuxx@tuxxpad:/tmp/matroxdriver_mga-x86-4.4.4-source/7.0.0/src/mga$ echo "#define USEMGAHAL 1" >>config.h

5. Compile the beast

Code: Select all
tuxx@tuxxpad:/tmp/matroxdriver_mga-x86-4.4.4-source/7.0.0/src/mga$ make
make  all-recursive
make[1]: Entering directory `/tmp/matroxdriver_mga-x86-4.4.4-source/7.0.0/src/mga'
Making all in src
make[2]: Entering directory `/tmp/matroxdriver_mga-x86-4.4.4-source/7.0.0/src/mga/src'
if /bin/sh ../libtool --mode=compile gcc -DHAVE_CONFIG_H -I. -I. -I..    -I/usr/include/xorg -I/usr/include/pixman-1   -I/usr/include/drm -I/usr/include/X11/dri   -g -O2 -MT clientlx.lo -MD -MP -MF ".deps/clientlx.Tpo" \
          -c -o clientlx.lo `test -f 'clientlx.c' || echo './'`clientlx.c; \
        then mv -f ".deps/clientlx.Tpo" ".deps/clientlx.Plo"; \
        else rm -f ".deps/clientlx.Tpo"; exit 1; \
mkdir .libs
gcc -DHAVE_CONFIG_H -I. -I. -I.. -I/usr/include/xorg -I/usr/include/pixman-1 -I/usr/include/drm -I/usr/include/X11/dri -g -O2 -MT clientlx.lo -MD -MP -MF .deps/clientlx.Tpo -c clientlx.c  -fPIC -DPIC -o .libs/clientlx.o
/bin/sh ../libtool --mode=link gcc  -g -O2   -o stormdwg  stormdwg.o
mkdir .libs
gcc -g -O2 -o stormdwg stormdwg.o
make[2]: Leaving directory `/tmp/matroxdriver_mga-x86-4.4.4-source/7.0.0/src/mga/util'
make[2]: Entering directory `/tmp/matroxdriver_mga-x86-4.4.4-source/7.0.0/src/mga'
make[2]: Nothing to be done for `all-am'.
make[2]: Leaving directory `/tmp/matroxdriver_mga-x86-4.4.4-source/7.0.0/src/mga'
make[1]: Leaving directory `/tmp/matroxdriver_mga-x86-4.4.4-source/7.0.0/src/mga'

6. Finished

The driver has been successfully compiled and resides in the subdirectory

Code: Select all
tuxx@tuxxpad:/tmp/matroxdriver_mga-x86-4.4.4-source/7.0.0/src/mga$ find -name "*.so"

Please note, that the is _NOT_ included in the source package.
You need to download the binary package and extract it to get the
User avatar
Supreme Commander
Supreme Commander
Posts: 2199
Joined: Mon Jan 01, 2007 12:51 pm
Location: Vassach - Austria - Europe

Return to HOWTOs

Who is online

Users browsing this forum: No registered users and 1 guest