[Lazarus] Lazarus project compile flags

Toan Pham tpham3783 at gmail.com
Fri Jan 30 22:58:19 CET 2015


Ideally, it would be nice to compile any fpc project using the following
command:

fpc `fpc-config --cflags --ldflags rtl,lcl,lcl-gtk2,paszlib` project1.lpr

fpc-config is a utility that manages configuration of all packages, and
knows where and what to pass along to the fpc compiler.





On Fri, Jan 30, 2015 at 4:42 PM, Toan Pham <tpham3783 at gmail.com> wrote:

>
> Mattias,
>
> lazbuild does the work, but then i even want to get away from lazbuild
> dependency.
> I muck around with fpcmake but then, it too can't really create a proper
> makefile project.
> for some reasons, fpcmake failed to know where to locate the LCL gtk2
> interface directory.
> The best way is probably to do it manually, like autoconfigure and
> pkg-config.
> Please share if you know of other ways.
>
>
> thank you
>
>
>
>
>
>
> On Fri, Jan 30, 2015 at 4:17 PM, Mattias Gaertner <
> nc-gaertnma at netcologne.de> wrote:
>
>> On Fri, 30 Jan 2015 12:56:12 -0500
>> Toan Pham <tpham3783 at gmail.com> wrote:
>>
>> > Hi,
>> >
>> >
>> > When we compile an object-pascal/delphi project, we generally rely on
>> > Lazarus to do the work.
>> > Yet, normally Lazarus knows how a project is setup and knows link the
>> > project with its run-time library.  This is good, but not so good if you
>> > want to compile the application without lazarus.
>> >
>> >
>> > So, as an example, a object pascal project may have the following
>> FPC_FLAGS:
>> >
>> > -MObjFPC -Scghi -O1 -g -gl -vewnhi -Filib/i386-linux -Fl/opt/gnome/lib
>> > -Fu/usr/lib/lazarus/1.2.4/lcl/units/i386-linux/gtk2
>> > -Fu/usr/lib/lazarus/1.2.4/lcl/units/i386-linux
>> > -Fu/usr/lib/lazarus/1.2.4/components/lazutils/lib/i386-linux
>> > -Fu/usr/lib/lazarus/1.2.4/packager/units/i386-linux -Fu.
>> -FUlib/i386-linux
>> > -l -dLCL -dLCLgtk2
>> >
>> > These directives are the equivalent of C++/C, compile and link flags.
>> > Typically we call pkg-config to find out the flags when we compile a
>> c/C++
>> > application.  Is there a lazarus/fpc utility that is equivalent to
>> > pkg-config that would allow me to find out these flags at
>> compile/configure
>> > time?
>> >
>> > I really want to be able to build a project without lazarus, and on
>> > different machine machines.
>>
>> You can use lazbuild to build without the IDE. You can build lazbuild
>> on machines without GUI libraries:
>> make lazbuild
>>
>>
>> Mattias
>>
>> --
>> _______________________________________________
>> Lazarus mailing list
>> Lazarus at lists.lazarus.freepascal.org
>> http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus
>>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.lazarus-ide.org/pipermail/lazarus/attachments/20150130/743c59ae/attachment-0003.html>


More information about the Lazarus mailing list