Hi all,

making noise is not my intention, so sorry in advance if it is the case.

As I saw at least two dedicated scripts for compiling FlightGear these 
last days, I'd take few minutes to expose my own one ;). Indeed it 
exists and is released for something like more than two years. I think 
it is an interesting one as it allows a lot of flexibility and the 
compilation of "not only FlightGear related" programs, but quite every 
programs.

here it is: http://seb.marque.free.fr/fichiers/scripts/bash/compile.tgz

./compile is a bash script which actually offers kind of "API" (function 
and variables) to ease the download/update, compilation and installation 
steps. The compilation and installation do not touch the system (no need 
of root rights), neither the user environment. I created it after some 
use of the excellent fgfs-builder makefile, from which it takes the 
concepts of project and products.
A project is a directory in which co-exist one or more products. A 
product is a set of rules for download and compilation, generally for a 
single application. Products generally have multiple flavours available 
(i.e. dev, testing and stable). Products' rules are written in a 
collection of files that can be found in compile.d directory.

It has many features. Some of the most interesting ones are:
- auto-update of the script when new version is available (and user have 
write rights on it)
- separates sources directories, build directories and install directories.
- allows fine tune of what has to be updated and what has to be compiled 
(permanently or using command-line)
- jails project in only one directory (remove a project is as easy as $ 
rm -fr projectdir)
- splits configuration, warnings and errors messages in different log files
- allows sharing parts of a project in an other project (useful to share 
base or libs)
- with-only-one-finger and all-automatic concepts
- patch management (adding, storing, removing)
- manages git/cvs/svn/hg, zipped, gzipped and bzipped archives
- manages autogen-configure-make, cmake, bootstrap, scons and jam 
systems, but other systems can be used in product rules (as for FGCOM)
- easy command-line syntax
- possibility to override products rules by your own ones
- talks in a lovely sh..ty English :p
- easily handles different versions of a single application (separated 
in different project for now but I'm working on it, also see 
list-projects option)

It does not manage dependancies (only some checks in order to know if a 
used application is installed and available as cmake, svn, ...), and it 
is not intented for user that don't know how to compile on Linux system 
(but I know some people already using it without any knowledge about 
how-to-compile :D).

If you want to give it a try, here are some explanations:
- the first argument of the script *must* be the absolute path or the 
relative path to `pwd' of the project directory. Exceptions made for 
"list", "list-projects" and "help|--help|-h" options.
- the creation of a project is done the first time using the bareword 
"create"
- off course, the defaults products are OSG/svn, PLIB/svn, SG/cvs, 
FG/cvs, FGbase/cvs (and recently FGRUN/cvs) :D
- the project directory contains 4 subdirs and some launch scripts:
   - sources: where the source code of each product takes place
   - build: the dir used for the build (it contains hard links of the 
sources subdir)
   - install: where compiled applications are installed (bin, include, 
lib, share)
   - config: where the logs are stored, and patches too. classified by 
product. You can also find a "project_name".conf file in which are 
stored the products of this project. Tip: here you can use "-" before 
the product name to permanently avoid compilation of the product, "+" to 
permanently avoid source update for the product, and "#" to permanently 
skip the product.

For a first try:
$ ./compile my_try create
will create a project in `pwd`/my_try containing the default products as 
described above. There is a "problem" here as I've never found the way 
to avoid the CVS password entry by hand (I've tried all I could do with 
pipes and redirections without any success :/)

then
$ ./compile my_try
will update and compile every product alone (or continue an aborted 
compilation).

to add a product:
$ ./compile my_try add=product1(,product2,..)

to apply the script only for a (some) product(s):
$ ./compile my_try only=product1(,product2,...)

to skip a (some) product(s):
$ ./compile my_try skip=product1(,product2,...)

these two last only work if the product(s) is (are) already downloaded.
You can also use
$ ./compile list
to get a list of available products

and
$ ./compile help
for a succint help

On my system, I use it that way:
the script is in my user space, symbolic-linked in /usr/local/sbin, and 
the directory compile.d is symbolic-linked in /usr/local/share allowing 
then to use "compile" instead of "./compile".
I use it quite daily for FG (for sure ;)), OpenTTD and Warzone2100, but 
every product has been tested at least one time on my system (some of 
them quite a long time ago though :/).
An other way I used it while I've got (too) many projects was:
$ for p in `compile list-projects`; do compile $p; done

I know users from Ubuntu, Mandriva, Debian Squeeze and Sid.

Hope that I haven't been too noisy and this script could find some 
interest from some of you guys.

best regards
seb

------------------------------------------------------------------------------
_______________________________________________
Flightgear-devel mailing list
Flightgear-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/flightgear-devel

Reply via email to