Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adding Lazarus Package file support to Indy 10.7 #576

Open
wants to merge 8 commits into
base: Indy-10.7
Choose a base branch
from

Conversation

MWASoftware
Copy link

This pull requests removes the out-of-date "getIndy.sh" and replaces it with a set of lazarus packages in the new subdir "lazarus-fpc". This packages have the same structure as the Delphi packages and do not require any changes to the source tree to be
used.
Makefile.fpc files are also provided for use with fpcmake.

See README.lazarus-fpc for more information.

There are also some minor patches to the source files in order to ensure that they can be compiled with FPC.

Lib/System/IdWinsock2.pas Outdated Show resolved Hide resolved
@@ -34,6 +34,7 @@ interface

{$I IdCompilerDefines.inc}

{$IFDEF WINDOWS}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

IdWship6 is a Windows-only unit. It should not be compiled in other platforms. This check is redundant.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Lazarus/fpc is a cross-platform write once environment and has a substantial number of Windows users. It is wrong to exclude a unit from a Lazarus package on the grounds that it can only be used in Windows.

Conditional compilation within the unit is the simplest way of allowing platform specific code to be part of a unit. The Lazarus IDE maintains package units automatically and platform specific units cannot be readily included in a package whilst compiling them only when the package is compiled on their target platform.

lazarus-fpc/indysystem.pas Outdated Show resolved Hide resolved
IdBaseComponent, IdComponent, IdCTypes, IdException, IdGlobal, IdIDN,
IdResourceStrings, IdResourceStringsDotNet11, IdResourceStringsIconv,
IdResourceStringsKylixCompat, IdResourceStringsTextEncoding,
IdResourceStringsUnix, IdResourceStringsVCLPosix, IdStack, IdStackBSDBase,
Copy link
Member

@rlebeau rlebeau Jan 8, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

VCLPosix is for Delphi only. FreePascal should not be compiling Indy's VCLPosix units. Also, FreePascal should not be compiling Unix units on Windows, and vice versa.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I can confirm that removing the VCLPosix units does not seem to affect the Lazarus packages on Linux or Windows and have removed them from the lazarus packages on my Indy10-7 branch.

IdResourceStringsKylixCompat, IdResourceStringsTextEncoding,
IdResourceStringsUnix, IdResourceStringsVCLPosix, IdStack, IdStackBSDBase,
IdStackConsts, IdStream, IdStreamVCL, IdStruct, IdTransactedFileStream,
IdVCLPosixSupplemental, IdWinsock2, IdWship6, IdAntiFreezeBase,
Copy link
Member

@rlebeau rlebeau Jan 8, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

IdWinsock2 and IdWship6 should not be compiled on non-Windows platforms. And Posix units should not be compiled on Windows.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants