# Getting Libwww from the CVS Repository

CVS allows YOU to follow the development of libwww and its sample applications closely and to contribute with patches and new features.

- How does libwww releases and CVS work together?
- How to check out libwww from CVS
- SSH Based CVS Checkout
- How to get the latest edits from CVS
- CVS Write access and policy
- How to get bootstrapped after checking out
- How to compile libwww

The following requires that you are familiar with CVS - if not then look at Cyclic's pages on CVS or the excellent information provided by Pascal.Molli.

## Libwww Releases

CVS allows you to use the very latest version of libwww - as soon as a fix or a new feature is commited to the CVS repository then you can update your working version and you will have it right away.

The purpose of "releases" is to say that now we believe that the code is stable with a well defined set of features. Until now, we have been giving out distribution files every time we announced a release. This will not change, but you can use the CVS repository in exactly the same way - often with much less overhead than dealing with a distribution package.

Every release is marked in the CVS repository using tags, so that it is possible to retrieve a complete release using the CVS `-r` option (note that `-r` is "sticky"). Check out the online CVS log walker for the current set of release tags. We were less strict tagging all the files in early releases so don't go too far back in the past if you expect to be able to compile the code!

## Anonymous CVS Checkout

Anonymous checkout is read-only access which allows you to get the latest edits and to provide patches to be integrated into the code base. The instructions should work for both Unix and Windows. Make sure you are running at least CVS 1.9 or later. Start by login as follows:

    % cvs -d :pserver:anonymous@dev.w3.org:/sources/public login

after which you type "anonymous" as password.

### Checkout the Latest Version

To get the latest version from the CVS repository, run this command:

    % cvs -d :pserver:anonymous@dev.w3.org:/sources/public -z3 checkout libwww

After which you will get all the code coming at you, you'd better have at least 10MBytes available on your machine. Now you are ready to getting boot strapped.

### Checkout a Specific Revision

If you want to get a specific release using CVS tags then you can do this by using the the CVS "`-r`" option, for example

    % cvs -d :pserver:anonymous@dev.w3.org:/sources/public -z3 -r Release-5-1m checkout libwww

Check the CVS log walker for the current set of release tags. If you at some point want to revert to the latest untagged version then you should use the following command:

    % cd libwww
    % cvs -z3 update -A

## CVS Write Access

Only libwww collaborators who have intimate knowledge of the code base and have proven their ability to code libwww have CVS write access. If you are considering becoming a libwww contributor then make sure that you have read the libwww style guide as well as the list of things to do before committing changes to libwww.

## SSH Based CVS Checkout

Libwww collaborators can get read/write access to the CVS repository using SSH. You setup CVS to use SSH as remote shell by setting the `CVS_RSH` env variable. Using bash or similar, it looks like this:

    % export CVS_RSH=/usr/local/bin/ssh

When you are using SSH, you don't need to do a CVS login. Instead you can just go ahead checking out libwww like this

    % cvs -d dev.w3.org:/sources/public checkout libwww

and you will be prompted for your SSH credentials. Again, if you want a specific revision then use something like this

    % cvs -d dev.w3.org:/sources/public -r Release-5-1m checkout libwww

The Apache Group has some special notes on how to use SSH for Windows.

## How to Get the Latest Updates

The big advantage of using CVS is that you easily can keep your version of the code base up to date with the latest edits and changes committed to CVS. Whenever something has been committed, a notification will be sent to the <www-lib@w3.org> mailing list (see here how to subscribe) as well as getting listed on the latest changes page.

Once you have checked out the libwww CVS tree (not a specific revision), you can get any updates committed to the tree by using the cvs update command like this

    % cd libwww
    % cvs -z3 update -d
    % cd ..

It is important that you use the "`-d`" flag so that you get new directories as well as updated files. Remember that some of the automatically generated header files (`*.h`) or the Windows DLL files (`*.dll`) may have to be regenerated after a checkout - please repeat the first step from the bootstrapping mechanism in order to do this.

## Getting Bootstrapped

When compiling directly from the CVS repository there are a few steps you have to go through which are already done if compiling from a distribution package. For example, the `*.h`, `Makefile`, and `*.def` files must be generated before you can compile. Generate the files by following these steps:

### Windows and Unix

On both Windows and Unix you can generate the `*.h` files and the `*.def` files by running a Perl script provided by Eric Prud'hommeaux. Never mind that it gives a few warnings when it runs - they are all OK. It requires that you have a recent version of Perl on your machine. Run the script like this (note the explicit use of the perl interpreter):

    % cd libwww
    % perl config/winConfigure.pl

Windows people are now done and can jump directly to the instructions for how to compile libwww for Windows. On Unix, you need some more...

### Unix (continued)

On Unix you MUST have the following GNU tools installed in order to continue. Check that you have the following programs with the correct version number:

gcc and GNU make
  Automake relies on features provided by gcc and GNU make that don't come with other compilers and makes. When compiling directly from our CVS repository you MUST therefore use these tools.
GNU automake (at least version 1.3)
  Automake is a tool for automatically generating Makefile.in's which are used by autoconf
GNU autoconf (at least version 2.12)
  A tool for automatically generating Makefile's which are used by make
GNU libtool (at least version 1.1)
  A tool for automatically handling generation of shared libraries

Optionally these tools are used by libwww if available

W3C www
  If available then the libwww Line Mode Browser is used by the makefiles to generate the header files (from `.html` to `.h`) and some other files as needed. If not available then the perl script is used instead.

#### Using the GNU Tools

After having checked that you have the programs you need, you are now ready to use them. Don't worry about the warnings produced by autoconf - that's OK. Run them like this:

    % aclocal; autoheader; automake; autoconf

## Compiling libwww

Remember to subscribe to the <www-lib@w3.org> mailing list (findmail archives) for information of new features as well as discussions of problems and ideas.

Libwww uses GNU Libtool in order to build shared libraries on a variety of systems. While this is very nice for making usable binaries, it can be a pain when trying to debug a program. For that reason, compilation of shared libraries can be turned off by specifying the `--disable-shared` option to `configure`.

Congratulations - you are now ready to compile libwww!