Recent

Author Topic: Runtime dependencies, X11 etc.  (Read 9902 times)

wotanica

  • Guest
Runtime dependencies, X11 etc.
« on: August 31, 2010, 04:13:17 am »
Having finally got around to installing lazarus on my mac (use delphi on the pc), im slightly confused about "what is what"  :-\. So i have some basic questions i hope someone can answere me.

1. I had to install X11, does this mean that the applications i build with lazarus will also need x11?
2. Having failed at installing it manually, i resorted to "fink". This worked fine but my output binaries were divided into two (!). One "unix executable file" and one "normal application". When i deleted the unix file my app would not run (i suspected as much). :o Is the smallest executable just a stub to get x11 going?

3. Also, i keep getting "unknown stabs" errors. I disabled the debugger and the output now works (after copying the jpeg library as mentioned on this forum). But why would a jpeg lib cause damage to laz? dont we have native pascal jpeg loaders?

4. Is is not possible at all to get a regular installer for lazarus on the mac? One that dont depend on unix stuff?
Previously i installed the normal commandline freepascal and converted some delphi code. It generated one, single executable with no X11 at all? No criticism, but why the X11 dependency? And will my apps depend on X11 as well?

Kind regards
« Last Edit: August 31, 2010, 04:31:59 am by wotanica »

Leledumbo

  • Hero Member
  • *****
  • Posts: 8108
  • Programming + Glam Metal + Tae Kwon Do = Me
Re: Runtime dependencies, X11 etc.
« Reply #1 on: August 31, 2010, 07:27:12 am »
Quote
1. I had to install X11, does this mean that the applications i build with lazarus will also need x11?
Depending on widgetset used to build the application. Carbon doesn't, gtk2 does.

kamischi

  • Full Member
  • ***
  • Posts: 177
Re: Runtime dependencies, X11 etc.
« Reply #2 on: August 31, 2010, 10:26:48 am »
Quote
1. I had to install X11, does this mean that the applications i build with lazarus will also need x11?
As leledumbo stated above, this depends on the widget set you are using. The carbon widget set does not need X11, the gtk2 widget set does.
Quote
2. Having failed at installing it manually, i resorted to "fink". This worked fine but my output binaries were divided into two (!). One "unix executable file" and one "normal application". When i deleted the unix file my app would not run (i suspected as much). :o Is the smallest executable just a stub to get x11 going?
Inside the normal application is a symlink to the unix executable (yourProgram.app -> Contents -> MacOS -> LinkToUnixExecutable). Therefore, the normal applications cannot run, if you delete the unix executable. For testing, this is good enough. For a final normal application, you have to replace symlink in the normal application by the unix executable. If you need more information about the internal structure of a normal application, read this:

http://developer.apple.com/iphone/library/documentation/CoreFoundation/Conceptual/CFBundles/BundleTypes/BundleTypes.html#//apple_ref/doc/uid/10000123i-CH101-SW13

This helps, too:

http://doc.trolltech.com/4.3/deployment-mac.html
Quote
3. Also, i keep getting "unknown stabs" errors. I disabled the debugger and the output now works (after copying the jpeg library as mentioned on this forum). But why would a jpeg lib cause damage to laz? dont we have native pascal jpeg loaders?
The reason for "unknown stabs" errors are related to the format of the debug information. Can you add -gw to your options? I assume your are on 10.6. Is that right? I will have a look at this, but I am very busy the next three weeks and cannot promise a time. I have to check about the jpeg lib.
Quote
4. Is is not possible at all to get a regular installer for lazarus on the mac? One that dont depend on unix stuff?
It all depends on man power :)
Quote
Previously i installed the normal commandline freepascal and converted some delphi code. It generated one, single executable with no X11 at all? No criticism, but why the X11 dependency?
To enable the creation of applications with the gtk2 widget set.
Quote
And will my apps depend on X11 as well?
If you keep the default settings for the widget set to carbon, then no.
Quote
Kind regards
I hope this helps. For interactive discussions, there is the lazarus-ide irc channel on freenode.

MiSchi
fpc 2.6.4, lazarus 1.4.0, Mac OS X, fink

felipemdc

  • Administrator
  • Hero Member
  • *
  • Posts: 3541
Re: Runtime dependencies, X11 etc.
« Reply #3 on: August 31, 2010, 10:42:12 am »
1. I had to install X11

You probably installed something wrong. The default Lazarus for Mac OS X is based on Carbon and doesn't require X11. Where did you download Lazarus from?

Read the documentation about how to install Lazarus:

http://wiki.freepascal.org/Installing_Lazarus_on_MacOS_X

More specifically the section "Installation from disk images" reads:

Quote
Download and install the three packages FPC, FPCSrc and Lazarus in this order: https://sourceforge.net/project/showfiles.php?group_id=89339

This is the easiest way to install Lazarus on Mac OS X. The FPC sources are installed under /usr/local/share/fpcsrc.

There is no mention of "X11" in this page.

And in general I recommend read our wiki documentation:

http://wiki.freepascal.org/Lazarus_Documentation

Quote
3. Also, i keep getting "unknown stabs" errors. I disabled the debugger and the output now works (after copying the jpeg library as mentioned on this forum). But why would a jpeg lib cause damage to laz? dont we have native pascal jpeg loaders?

These are linker messages caused by a bug in the Mac OS X Linker. You can safely ignore them.

http://wiki.freepascal.org/Carbon_interface_FAQ#Unknown_Stabs

Our JPEG loaders are native Pascal by the way.

Quote
4. Is is not possible at all to get a regular installer for lazarus on the mac? One that dont depend on unix stuff?

It already comes in a regular Mac installer and Lazarus doesn't depend on any Unix stuff. You are doing something wrong. See answer in question 1.

Quote
It generated one, single executable with no X11 at all? No criticism, but why the X11 dependency? And will my apps depend on X11 as well?

There exists no X11 dependency, you installing something wrong or in a wrong way.

wotanica

  • Guest
Re: Runtime dependencies, X11 etc.
« Reply #4 on: August 31, 2010, 05:32:23 pm »
First, thanks to everyone for helping out, it means a lot.
I think the X11 stuff came in earlier when i downloaded lazarus with the gtk widgets (i probably mixed these up).
Fink also downloaded a truckload of files and compiled it using GCC on the fly, took all night :(

I have tried to completely remove lazarus + fpc from my mac so i could do a clean install, but since im fairly new to the mac - i have no idea where/what files to delete. I had the same problem when i tried linux (where freepascal works brilliantly and out of the box i might add!).

I realize that i have some learning to do when it comes to OS structure, so sorry for that -- and thank you for the pointers on what i need to learn.

One of the core reasons i want this to work on my computer (OSX 10.6.4 / 2,4 intel core duo / 4 gig ram / macbook pro) is because i want to port over code from delphi. I have 10 years of quality classes that are buildt as pascal friendly (portable) as possible. I get frustrated when i cant even get the widget set right on the mac :P This is a typical class: http://delphimax.wordpress.com/2010/01/09/easy-rc4-encryption/

Hm. Okey.
So let's say i want to completely remove lazarus and freepascal. Completely wipe it all from my system.
How exactly do i do this? I know there are some files in /shared - but where is the rest?

On another note:
I have started a group on facebook (an active one), please join to support the pascal language if you have the time: Search for "Delphi developer" in the groups section. Or see delphimax.wordpress.com


kamischi

  • Full Member
  • ***
  • Posts: 177
Re: Runtime dependencies, X11 etc.
« Reply #5 on: September 02, 2010, 08:27:52 am »
I am aware that the installation through fink drags in a lot of other stuff, which takes quite a while. The reason is to enable building programs with the gtk2 widget set also with lazarus-aqua. Maybe, I should reconsider this decision and try to do a separate and slim carbon-only package and make the gtk2 widget set available only as an add-on package.

If you want to remove all fpc and lazarus packages installed using fink, this command should do it:

fink -r purge fpc-config

If you want to remove only lazarus, use this:

fink -r purge lazarus-common

after this, none of the packages from "fink list fpc" and "fink list lazarus" should have an "i" in front of its name.

Regarding removing fpc/lazarus as installed from disk images, please check the lazarus wiki pages. If I recall correctly, there is a script file.
« Last Edit: September 02, 2010, 08:42:04 am by kamischi »
fpc 2.6.4, lazarus 1.4.0, Mac OS X, fink

kamischi

  • Full Member
  • ***
  • Posts: 177
Re: Runtime dependencies, X11 etc.
« Reply #6 on: September 02, 2010, 05:34:40 pm »
As of today, I applied a patch to the Lazarus packages in fink, which should prevent the "unknown stabs ..." warnings.
fpc 2.6.4, lazarus 1.4.0, Mac OS X, fink

wotanica

  • Guest
Re: Runtime dependencies, X11 etc.
« Reply #7 on: September 03, 2010, 09:12:25 am »
As of today, I applied a patch to the Lazarus packages in fink, which should prevent the "unknown stabs ..." warnings.

Exellent! This should make the transition from Delphi to freepascal more smooth!