D&C GLug - Home Page

[ Date Index ] [ Thread Index ] [ <= Previous by date / thread ] [ Next by date / thread => ]

Re: [LUG] How to compile one program from the xorg tree?

 

Simon Williams wrote:
> I have downloaded a CVS version of xorg (or at least a big part of it). 
> It contains a small program called ephyr. How do I compile just that 
> program?

1. CVS will require maintainer scripts to be built, so the process
typically starts with ./autogen.sh but before you run that, check with:
$ tail autogen.sh
to see if autogen.sh calls the newly generated ./configure directly. If
it does, you will have to specify your options to ./autogen.sh for it to
pass on. So, run ./autogen.sh with no options first, then run
./configure --help and work out the extra options you need, then re-run
./autogen.sh with those options.

2. You always have to run ./configure but if you can identify options
that disable certain sections of code, it will be easier to get it to
complete. Not all packages have many steps like this but most have at
least one or two.

3. To identify areas you can skip, check the contents of Makefile.am in
each directory. If there are conditionals surrounding certain
instructions, identify how those conditionals are set and pass those
options to ./configure.
if BUILD_DWI
DWIBE=dwi
else
DWIBE=
endif

SUBDIRS = $(DWIBE) file

This means that if BUILD_DWI is not set, the dwi/ directory beneath this
Makefile.am will be completely omitted from the build. By specifying
this option to ./configure, you should also find that the build omits
checking for dependencies of this section of code.

4. Check the Makefile.am of the directory containing the programme you
want to build. Check for dependencies here and ensure that those are
built before the process steps into this final directory. Identify the
locations of all local libraries that are referenced in the Makefile.am.

5. Don't just run 'make' from the top level directory. Use your list of
dependencies generated from the final Makefile.am and 'cd' into those
directories before running make. Also, attempt to build that specific
library *only* instead of all code in that directory *and all
subdirectories* which is the default action of 'make'. Use:
make -C <dir> <libname>.la

e.g. make -C qof libqof.la

> It looks like just doing "make ephyr.c" or "gcc ephyr.c" will work, 
> except that it wants a whole bunch of include files from the rest of the 
>   tree.

You want to be able to make a shared library or a complete binary - just
compiling to object code is insufficient. e.g.

make -C qof/test/ test-date.o

is very different to

make -C qof/test/ test-date

Only after the second command can you run:
./qof/test/test-date

The second command also requires that all symbols can be resolved which
is where the various dependencies come in. The command line can become
very long (larger than one complete terminal screen in gnucash) and the
only reasonable decision is to let 'make' build the command line.


-- 

Neil Williams
=============
http://www.data-freedom.org/
http://www.nosoftwarepatents.com/
http://www.linux.codehelp.co.uk/


Attachment: signature.asc
Description: OpenPGP digital signature

-- 
The Mailing List for the Devon & Cornwall LUG
http://mailman.dclug.org.uk/listinfo/list
FAQ: http://www.dcglug.org.uk/linux_adm/list-faq.html