                       README for the Indy 10 FPC Version

This is an effort to make Indy 10 work in FreePascal using the Lazarus IDE. Our 
goal is to eventually get this code merged into the main Indy branch which 
would then support both Borland Delphi and FreePascal. Our goals are to support 
in Linux and other operating systems including various microprocessor 
architecture that FreePascal supports. At the same time, we want to follow the 
Indy Coding Conventions and Standards" 
(http://www.indyproject.org/sockets/Teams/Core/Docs/Standards/) so that NET is 
supported at the same time. The goal is to support as many systems as we can.

Some success has been reported with:

Win32
Linux
FreeBSD
Mac OS/X (Darwin)

Currently, we would like to support the following systems.

Win64
WinCE
Sun Solaris

Remember that the success of this effort depends upon you and what you 
contribute. Most of this is being done by people who choose to volunteer their 
limited time.

                                    License

Read the COPYING file located in this distribution.

                           Installation Instructions

If you have a RPM-based distribution (such as Fedora or Mandravia) and you 
install FreePascal as root, we recommend using the Indy RPM. As a user, setup 
your user account to build RPM's with the advice from 
http://www.rpm.org/hintskinks/buildtree/ and then use the makeindyrpm.sh script 
to build the Indy RPM's. Then install the indy-fpc and indy-fpc-src RPM's that 
you created. We do NOT distribute precompiled Indy RPM binaries. We do permit 
others to build RPM's for distribution.

If you have a Debian-based Linux distribution and you have installed Free 
Pascal as a Debian package, you can make .deb packages with "dpkg-buildpackag 
-rfakeroot" and than install them with "dpkg -install indy*.deb".

Otherwise, do the following:

Change directory to "fpc" and run "make all". If you are using 
Windows, you must use the GNU BinUtils Make program that is included in most 
FreePascal distributions.
 
Run "make all" followed by "make install" from the fpc directory. You may 
be able to specify an install prefix by adding "INSTALL_PREFIX=fpcbasedir".

If you are running Lazarus, you may install the design-time package into 
Lazarus. Just open, compile, and install the indylaz.lpk file located in the 
lazarus directory.

You probably should read the Development Tutorial (aka Build FAQ) at 
http://www.stack.nl/~marcov/buildfaq.pdf for more information about the 
FreePascal build process.

In your programs, you should have the following in your main program file:
 
  {$IFDEF UNIX}{$IFDEF UseCThreads}
  cthreads, 
  {$ENDIF}{$ENDIF}

defined as the first entry in your uses clause. Then when compiling, use the 
"-dUseCThreads" parameter. This is important on Unix systems because Indy uses 
multithreading in most servers and in some client components.

                                  Known Issues

In Linux, this code requires that you have FreePascal 2.0.3 snapshots 
(ftp://ftp.freepascal.org/pub/fpc/snapshot/v20/i386-linux/fpc-2.0.3.i386-linux.tar.gz)
or the current development snapshots. Earlier versions of the FreePascal RTL 
do not have some constants defined and Indy uses those constants. Patches for 
this were submitted in October 2005.

The ElizaWeb demo may terminate after serving one page with the error, 
"Exception=A thread cannot destroy itself except by setting FreeOnTerminate and 
leaving" in Unix operating systems. The current snapshot versions of FPC have a 
fix for this problem.

In IdStackLinux and IdStackUnix, we need a working TIdStackLinux.ReceiveMsg and 
TIdStackUnix.ReceiveMsg that uses the standard Posix recvmsg system call. This 
is required for ICMPv6 support.

The FTP server demo does not work yet. I have to do some coding to get it to 
work in both Unix and Win32. The code and component settings will probably be 
different for each platform.

On Mac OS/X (Darwin), there is a problem with the type TUnixSockAddr type 
definition. This was fixed on 2/25/2006 in the FreePascal source-code tree.. 
The fix is to patch rtl/unix/sockets.pp with these lines above the file 
includes directives:

d{$ifdef Darwin}
{$DEFINE SOCK_HAS_SINLEN}               // BSD definition of scoketaddr
{$endif}  

In Win32, you may get an error saying that libasync is missing. This has been 
fixed in the current snapshots in both the Fixes_2_0 and Trunk Subversion 
branches.

IdSysLinux should be renamed IdSysUnix because it is used on all Unix targets 
or I might make a separate file.

                                For Linux Users

In Linux, we no longer use IdStackLinux for libc. If you want to use the 
libc-based stack backend, you have to modify the Makefile.fpc and then 
rebuilding the Makefile with fpcmake. We do not recommend using libc because 
that is not being used in some Linux architectures.

                                  ZLib Support

Indy is capable of using ZLib for compression capabilities using the ZLib 
library (http://www.zlib.net/). If you are using TIdCompressorZLib or 
TIdCompressionIntercept, your program will require ZLib. On most Unix-systems, 
ZLib is usually installed because a lot of things depend on it. 

On Windows, there is no standard ZLib installed by default. For Windows, you 
should install the official ZLIB1.DLL from the http://www.zlib.net website in 
the same directory as your program because there's several .DLL's with the same 
name and various versions may be floating around. The ZLIB1.DLL you use must 
use the cdecl conventions. We eventually hope to get ZLib statically linked 
into the Indy libraries like we do with Borland Delphi versions.

We strongly urge you to use ZLib 1.2.3. Indy might work with some older 
versions of ZLIB but do not rely on that. Indy uses the relatively new 
functions; inflateBackInit_, inflateBackEnd, and inflateBack and we may use 
other new functions as time goes on. The newest ZLib version also fixes bugs 
including some security issues.

The Indy library itself has no direct dependencies on ZLib and you could use it 
with ZLib because the ZLib shared library is dynamically loaded.

                                OpenSSL Support

Indy is capable of using OpenSSL for some encryption functions such as NTLM and 
SSL. If you are using the IdAuthenticationNTLM unit, 
TIdSSLIOHandlerSocketOpenSSL or TIdServerIOHandlerSSLOpenSSL, your program will 
require the OpenSSL libraries.

On many Unix systems, OpenSSL is installed by default but on a few, you may 
have to install it yourself. On 64-bit Unix systems, OpenSSL will not work 
properly because the OpenSSL header file IdSSLOpenSSLHeaders.pas assumes that a 
C Long type is 32bits while it really is 64bit on those platforms.

On Win32, you can use the standard .DLL's from 
http://www.openssl.org/related/binaries.html.

For a Win64 bit version of OpenSSL, you will have to compile the .DLL's. 
Install the "Microsoft Platform SDK for Windows Server 2003 R2" and ActivePerl 
( located at http://www.activestate.com/Products/ActivePerl/?mp=1 ). More 
recent Microsoft SDK's do not include the ml64 assembler and OpenSSL requires 
it. Then do the following:

> perl Configure VC-WIN64A
> ms\do_win64a
> nmake -f ms\ntdll.mak
> cd out32dll
> ..\ms\test

Note that some jurisdictions regulate the use and export of strong cryptography 
while others may prohibit the use of strong cryptography but other nations may 
have no restriction at all. If you have any questions about using or exporting 
SSL, ask your lawyer.  We can NOT give you legal advise.

                                 Contacting Us

For peer support, you may use the 
news://news.atozed.com/atozedsoftware.indy.fpc newsgroup. Do not E-Mail us if 
you need help with your program or using Indy. Only E-Mail us if you have 
specific improvements, code contributions, or wish to report success with some 
particular target operating systems. Remember that all Indy developers 
are volunteers who give their time without any compensation.

