Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Mailing lists / fpc-pascal / 2020-08

fpmake addlibrary

8 messages · 2 people ·

Reply by email Subscribe to this list Your subscription

Read-only archive. Use j and k to move between messages.

Mattias Gaertner
to Michael Van Canneyt

On Sun, 30 Aug 2020 13:38:12 +0200 (CEST)
Michael Van Canneyt via fpc-pascal

Show quoted text 10 lines
On Sun, 30 Aug 2020, Mattias Gaertner via fpc-pascal wrote: > Hi, > > AddLibrary('libbla.pp') creates under Linux "blalib.so". > I want "bla.so". > > How to do that? AddLibrary('libbla.pp').SetExeName('bla');

Creates "bla", not "bla.so".

Mattias

Reply by email

Michael Van Canneyt
to Mattias Gaertner
Mattias Gaertner wrote 16 lines
On Sun, 30 Aug 2020 13:38:12 +0200 (CEST) Michael Van Canneyt via fpc-pascal wrote: > On Sun, 30 Aug 2020, Mattias Gaertner via fpc-pascal wrote: > > > Hi, > > > > AddLibrary('libbla.pp') creates under Linux "blalib.so". > > I want "bla.so". > > > > How to do that? > > AddLibrary('libbla.pp').SetExeName('bla'); Creates "bla", not "bla.so".

I had a look at the code, it indeed cuts off the extension. That does not seem logical.

Maybe we need to add OutputFileName : string which simply sets the -o option, SetExeName() can then just set OutputFileName.

Michael.

Reply by email

Mattias Gaertner
to Michael Van Canneyt

On Sun, 30 Aug 2020 14:16:14 +0200 (CEST)
Michael Van Canneyt via fpc-pascal

Show quoted text 24 lines
On Sun, 30 Aug 2020, Mattias Gaertner via fpc-pascal wrote: > On Sun, 30 Aug 2020 13:38:12 +0200 (CEST) > Michael Van Canneyt via fpc-pascal > wrote: > >> On Sun, 30 Aug 2020, Mattias Gaertner via fpc-pascal wrote: >> >> > Hi, >> > >> > AddLibrary('libbla.pp') creates under Linux "blalib.so". >> > I want "bla.so". >> > >> > How to do that? >> >> AddLibrary('libbla.pp').SetExeName('bla'); > > Creates "bla", not "bla.so". I had a look at the code, it indeed cuts off the extension. That does not seem logical. Maybe we need to add OutputFileName : string which simply sets the -o option, SetExeName() can then just set OutputFileName.

Is there a workaround for fpc 3.2.0?

Mattias

Reply by email

Michael Van Canneyt
to Mattias Gaertner
Mattias Gaertner wrote 30 lines
On Sun, 30 Aug 2020 14:16:14 +0200 (CEST) Michael Van Canneyt via fpc-pascal wrote: > On Sun, 30 Aug 2020, Mattias Gaertner via fpc-pascal wrote: > > > On Sun, 30 Aug 2020 13:38:12 +0200 (CEST) > > Michael Van Canneyt via fpc-pascal > > wrote: > > > >> On Sun, 30 Aug 2020, Mattias Gaertner via fpc-pascal wrote: > >> > >> > Hi, > >> > > >> > AddLibrary('libbla.pp') creates under Linux "blalib.so". > >> > I want "bla.so". > >> > > >> > How to do that? > >> > >> AddLibrary('libbla.pp').SetExeName('bla'); > > > > Creates "bla", not "bla.so". > > I had a look at the code, it indeed cuts off the extension. > That does not seem logical. > > Maybe we need to add OutputFileName : string which simply sets the -o > option, SetExeName() can then just set OutputFileName. Is there a workaround for fpc 3.2.0?

Yes:

AddLibrary('libbla.pp').Options.Add('-obla.so')

Michael.

Reply by email

Mattias Gaertner
Show quoted text 20 lines
On Sun, 30 Aug 2020, Mattias Gaertner wrote: > On Sun, 30 Aug 2020 14:30:11 +0200 (CEST) > Michael Van Canneyt wrote: > >> [...] >>> Is there a workaround for fpc 3.2.0? >> >> Yes: >> >> AddLibrary('libbla.pp').Options.Add('-obla.so') > > Do you mean: > > {$IFDEF Linux} > AddLibrary('libbla.pp').Options.Add('-obla.so') > {$ENDIF} Will be ok unless you want to crosscompile. In the latter case you must check the installer targetOS.

How?

Mattias

Reply by email

Michael Van Canneyt
to Mattias Gaertner
Mattias Gaertner wrote 25 lines
On Sun, 30 Aug 2020 16:22:58 +0200 (CEST) Michael Van Canneyt wrote: > On Sun, 30 Aug 2020, Mattias Gaertner wrote: > > > On Sun, 30 Aug 2020 14:30:11 +0200 (CEST) > > Michael Van Canneyt wrote: > > > >> [...] > >>> Is there a workaround for fpc 3.2.0? > >> > >> Yes: > >> > >> AddLibrary('libbla.pp').Options.Add('-obla.so') > > > > Do you mean: > > > > {$IFDEF Linux} > > AddLibrary('libbla.pp').Options.Add('-obla.so') > > {$ENDIF} > > Will be ok unless you want to crosscompile. In the latter case you > must check the installer targetOS. How?
var
   T : TTarget;
   P : TPackage;
begin
    P:=Installer.AddPackage('yourgreatpackage');
    T:=P.AddLibrary('libbla.pp');
    if Defaults.OS=Linux then
       T.Options.Add('-obla.so');
end;

Michael.

Reply by email