winexe README
=============

Winexe makes use of Samba version 4. Winexe can be built such that
it is linked to Samba dynamically linked libraries, resulting in an
executable less than one megabyte in size.  Alternatively it can be
statically linked to Samba libraries, resulting in an executable that
is several megabytes in size. The latter version is still dynamically
linked to a number of other libraries such as libc.  


Instructions for Samba shared library build
-------------------------------------------

Get dependencies.

On Debian 7 with APT access to the Debian unstable and experimental
repositories:

    apt-get install \
        gcc-mingw-w64 \
        libtalloc-dev \
        libtevent-dev \
        libpopt-dev \
        samba-dev \
        samba-common-bin \
        libdcerpc-dev \
        libsamba-credentials-dev \
        libsamba-util-dev \
        libsmbclient-raw-dev \
        libndr-standard-dev \
        libsamba-hostconfig-dev

Build.

    cd source
    ./waf configure
    ./waf

Run.

    build/winexe --help


Instructions for Samba static library build
-------------------------------------------

On Debian 7 with APT access to the Debian unstable repository,
install dependencies.

    sudo apt-get install \
        gcc-mingw-w64 \
        comerr-dev \
        libpopt-dev \
        libbsd-dev \            
        zlib1g-dev \
        libc6-dev \
        python-dev

On RedHat-like distros including
* Fedora 18
* CentOS 6 with added EPEL and and lfarkas (http://www.lfarkas.org/linux/packages/centos/6/mingw-w64/) repos
install dependencies

    yum install \
        gcc \
        perl \
        mingw-binutils-generic \
        mingw-filesystem-base \
        mingw32-binutils \
        mingw32-cpp \
        mingw32-crt \
        mingw32-filesystem \
        mingw32-gcc \
        mingw32-headers \
        mingw64-binutils \
        mingw64-cpp \
        mingw64-crt \
        mingw64-filesystem \
        mingw64-gcc \
        mingw64-headers \
        libcom_err-devel \
        popt-devel \
        zlib-devel \
        zlib-static \
        glibc-devel \
        glibc-static \
        python-devel

and make sure that libbsd-devel is *not* installed.

    yum remove \
        libbsd-devel

Get the Samba source code.

    git clone git://git.samba.org/samba.git samba

Build. The argument of the "samba-dir" option is the path to the samba source
tree that was just downloaded. The "configure" step takes a long time because
it builds Samba 4.

    cd source
    ./waf configure --samba-dir=../samba
    ./waf

Run.

    build/winexe-static --help

The build system tries to find paths to headers and libraries, but you
can also specify these as follows.

    ./waf configure --samba-dir=../samba --samba-inc-dirs=... --samba-lib-dirs=...

To build the shared-library version in addition to the static-library
version, add the "--enable-shared" option.

    ./waf configure --samba-dir=../samba --enable-shared




Credits
-------
Written by Andrzej Hajda <andrzej.hajda@wp.pl>

Contributions were made by:
* Thomas Hood, RAAF Technology bv, Netherlands <thomas@raaftech.nl>

License
-------
Please see the COPYING file for the text of the GNU GPL version 3.

