-------------------------------------
 INSTALL for ipmiutil source
-------------------------------------
 
The ipmiutil source package provides IPMI-based utilities and kernel 
patches for managing various servers in Linux or Windows.

The same source files can be built in both Linux and Windows as shown 
below.
 
-------------------------------------
  Build instructions for Linux 
-------------------------------------

To build with some GPL code:  
If you are building ipmiutil for open-source, then the MD2 hash 
for IPMI LAN and the valinux driver interface (/dev/ipmikcs) can 
be supported.  If so, you should specify the following during 
configure:
   "./configure --enable-gpl"
The default is to build with only BSD-licensed code and not to 
include the MD2 and valinux features.  The md2.h and ipmi_ioctl.h
files with GPL code can be removed if this option is not enabled.

To build a standalone binary without IPMI LAN 2.0 (lanplus plugin),
which may be desirable for use on bootable media (USB/CDROM), to 
decrease the size or to avoid using libcrypto, you can specify the 
following during configure:
   "./configure --disable-lanplus"
or
   "./configure --enable-standalone"
builds it without lanplus libs and without GPL code.

To add LanDesk IPMI support:
Support for the LanDesk IPMI driver requires a library supplied by 
LanDesk (libipmiapi.a).  After obtaining this library, place it in
lib/libipmiapi.a.  Then you can link ipmiutil to support it by 
specifying the following during configure:
   "./configure --enable-landesk=yes"

To build with GNU freeipmi local interface:
Edit util/Makefile.am to uncomment the HAVE_GNU line and the LDADD line 
with -lfreeipmi, then also comment out the following GNU_STUB line.
WARNING: freeipmi-0.2.3 has a naming conflict with ipmi_cmd() that
would require some code changes to link properly.

Steps to build for Linux:
# ./beforeconf.sh
  Which automates these functions:
   * copying libtool files
   * aclocal   (may be needed if automake versions are different)
   * autoconf  (may be needed if automake versions are different)
# ./configure
      --enable-landesk       adds landesk library support [default=no]
      --disable-lanplus      disable lanplus library support
      --enable-standalone    build standalone, with no GPL or LanPlus libs.
      --enable-gpl           build with some GPL code [default=no]
# make
To install this package, use one of the following:
#  make install
#  make rpm
The make rpm produces a binary rpm, and a source rpm, which can be 
installed with "rpm -i *.rpm".

-------------------------------------
  Build instructions for Windows 
-------------------------------------

Steps to build for Windows:
1) Install Visual Studio 6.0 or later.
2) Download the contributed files needed, see
     http://ipmiutil.sf.net/FILES/ipmiutil-contrib.zip 
   or from their original locations 
   public domain getopt.c:
     http://www.koders.com/c/fid034963469B932D9D87F91C86680EB08DB4DE9AA3.aspx
   GNU LGPL getopt.c:
     http://svn.xiph.org/trunk/ogg-tools/oggsplit/
   openssl:
     http://www.openssl.org/source/openssl-0.9.7l.tar.gz
3) Copy getopt.* to util/
4) Build the openssl for Windows as per INSTALL.W32 for VC++
5) Copy the resulting *.lib to lib/ and *.dll to util/
   Copy openssl/*.h to lib/lanplus/openssl/

6) Edit buildwin.cmd to reflect the installed location of the VC libraries.

   Notes for VS8 (VS2005)
   set VCDIR="C:\Program Files\Microsoft Visual Studio 8\VC"
    VS8 needs to add to PATH %VCDIR%\bin;
                       %VCDIR%\platformsdk\bin;
                            %VCDIR%\common7\ide;
                            %VCDIR%\common7\tools\bin
    VS8 may need CFLAG /D_CRT_SECURE_NO_DEPRECATE,
        VCLIB_ADD=/LIBPATH:%VCDIR%\PlatformSDK\lib
        VCINCL_ADD=%VCDIR%\PlatformSDK\include
    VS8 does not have libc.lib, use libcmt.lib instead.

7) Run buildwin.cmd

