# How to compile cSOAP

## Introduction

This document shows in short examples how to compile cSOAP under *nix systems.

cSOAP is implemented in ANSI C. So it should be possible to compile it with every ANSI C conform compiler. If you can not compile it with your compiler, please post it to the mailinglist, so we can alter neccessary code or Makefiles.

## Dependecies

cSOAP depends on libxml2 and pkg-config tool.

        + libxml2      : http://xmlsoft.org
        + pkg-config   : http://pkgconfig.freedesktop.org/wiki/

## Build libxml2

First you must build the libxml2 library. You can test if you have this library on your system by typing xml2-config in a command prompt.

    $ xml2-config
    Usage: xml2-config [OPTION]

    Known values for OPTION are:

      --prefix=DIR          change libxml prefix [default /usr]
      --libs                print library linking information
      --cflags              print pre-processor and compiler flags
      --help                display this help and exit
      --version             output version information

Otherwise download the latest sourcecode form http://xmlsoft.org. lets say you downloaded `libxml2-[version].tar.gz` into you build directory.

    $tar zxvf libxml2-[version].tar.gz
    $cd libxml2-[version]
    $./configure --prefix=$LIBXMLDIST
    $make
    $make install

where $LIBXMLDIST is your directory where you want to install libxml2 (usually /usr or /usr/local). Replace it with your pathname.

## Build cSOAP

At this time we assume that you have pkg-config and libxml2 installed properly on you system. To check if you have pkg-config, just type "pkg-config" in a command prompt.

    $pkg-config
    Must specify package names on the command line

Otherwise got to http://pkgconfig.freedesktop.org/wiki/ and folow the instructions

Now we must download the latest cSOAP package into the build directory. Goto "http://sourceforge.net/project/showfiles.php?group_id=74977" (or click just the download menu item) and download the latest cSOAP package. Lets say libsoap-[version].tar.gz.

    $tar zxvf libsoap-[version].tar.gz
    $cd libsoap-[version]
    $./configure --prefix=$LIBSOAPDIST --with-libxml-prefix=$LIBXMLDIST
    $make
    $make install

where $LIBSOAPDIST is your directory where you want to install libsoap (usually /usr or /usr/local) and $LIBXMLDIST is the directory where you installed libxml2 (see section "Build libxml2"). Replace this variables with your pathnames.

## I'm in hurry. Show me all at once

Ok. Here is a script which will download, compile and install csoap and libxml2.

    #-----------------------------------------------------------
    #!/bin/sh

    # Alter this variables for your installation directory
    LIBSOAPDIST=/usr/local
    LIBXMLDIST=/usr/local

    # Download and install libxml2

    wget ftp://ftp.xmlsoft.org/libxml2-2.6.20.tar.gz
    tar zxvf libxml2-2.6.20.tar.gz
    cd libxml2-2.6.20
    ./configure --prefix=$LIBXMLDIST
    make
    make install
    cd ..

    # Download and install cSOAP

    wget http://kent.dl.sourceforge.net/sourceforge/csoap/libsoap-1.0.3.tar.gz
    tar zxvf libsoap-1.0.3.tar.gz
    cd libsoap-1.0.3
    ./configure --prefix=$LIBSOAPDIST --with-libxml-prefix=$LIBXMLDIST
    make
    make install

    #-----------------------------------------------------------