Re: LinkLib Issues In freebsd Lazarus
Bob wrote: Mike Meyer wrote: Well, one solution is to distribute sources - which works especially well if you provide a port. See below for more on that. Yes, but the sources Makefile would have to be not only version aware, but also "port-status" aware as well, and then call ld with the proper args. Worse, if 6.5 comes out, and the libs are renamed to libgdk.1.2.0 for instance, then no one will know what to look for until something breaks. IIUC correctly, the libraries you are complaining about are from *ports* and not the base system, so the version of FreeBSD is irrelevant. Why not look to see how *other* ports which use libgdk do things? You might find more help on the ports mailing list. For your pre-compiled binary would libmap.conf help? For a src port, I would bet that there's already a "right way to do it" that gets around your problem, even if it's just some ifdefs or similar in the Makefile. --Alex ___ freebsd-questions@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-questions To unsubscribe, send any mail to "[EMAIL PROTECTED]"
Re: LinkLib Issues In freebsd Lazarus
Mike Meyer wrote: > Well, one solution is to distribute sources - which works especially > well if you provide a port. See below for more on that. > Yes, but the sources Makefile would have to be not only version aware, but also "port-status" aware as well, and then call ld with the proper args. Worse, if 6.5 comes out, and the libs are renamed to libgdk.1.2.0 for instance, then no one will know what to look for until something breaks. > If you want to distribute binaries, you could simply include the > correct libraries in your tarball, and only install them if they > aren't installed. > Actually, my first thought would be to check whether or not the old lib-name was there, and, if so simply ln -s old-lib new-lib via the install script; something I believe the development team should have done when they changed the names, simply to maintain backwards compatibility. However, I don't know what effect this would have on a port upgrade, (I am a newbie on day 10 of FreeBSD) if the upgrade finds the new-lib-name as a link? Barf-Time? FreeBSD is not limited to software available through the ports collection alone, nor should it be. > I'm just trying to point > out some ways you can deal with it. > Yes, and thanks! I think I will ask what the lead time is on the FPC-2.0.4 release. If it will be soon, and if this issue is resolved, then I will simply start over at that point :-) Otherwise, I will have to rethink how to deal with this in the long run. Thanks for your many suggestions, and for your help! Bob ___ freebsd-questions@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-questions To unsubscribe, send any mail to "[EMAIL PROTECTED]"
Re: LinkLib Issues In freebsd Lazarus
In <[EMAIL PROTECTED]>, Bob <[EMAIL PROTECTED]> typed: > I have been involved in a parallel discussion on the fpc-devel list, and > have discovered a few facts which will impact the manufacture of a > freepascal Lazarus port. In fact, what I have learned will impact the > usability of FPC on freepascal itself. > > The "problem" which initiated this thread was the "wrong naming" of some > libraries. Well, it turns out that this renaming was done mid-stream by > the freebsd development team, and not by the freepascal folks. > > It seems that from freebsd 6.0 to freebsd 6.1 (the one I am using) > library names were arbitrarily changed. The ones I ran into were libgdk, > libgtk, and libglib. In all previous versions (prior to 6.1) of freebsd, > the lib versions 1.2 were named libgdk12, libgtk12, and libglib12 they > were changed in 6.1 to libgdk-12, libgtk-12, and libglib-12 > respectively. I wonder how many more library names were changed? This is > a real blow to any third party software developer, who's software will > likely start to bomb on freebsd6.1, where it ran just fine on 6.0 I can't help with this. I have no idea why it was done - it certainly wasn't discussed on -hackers. > BIG problem! If I compile a program on my 6.1 system, which makes any > dynamic calls to these libraries (and possibly others as yet unknown), > that executable will ONLY run on freebsd 6.1, and bomb on all prior > versions. My "fix" of patching the freepascal 2.0.2, or your method of > sym-linking, while fixing the local problem of compiling Lazarus, breaks > all portability to previous freebsd installs. This is a bad thing the > freebsd folks have done! Well, one solution is to distribute sources - which works especially well if you provide a port. See below for more on that. If you want to distribute binaries, you could simply include the correct libraries in your tarball, and only install them if they aren't installed. > There are some dirty work-arounds, and according to the fpc developers, > they will be implementing some new tools to deal with this in fpc-2.0.4, > who's rc2 has just been released. > > I can see making these kinds of changes from a 5.x version to a 6.x > version, as bad as even that would be, but to make such a change from > within the 6.x branch is pretty inconsiderate IMHO. > > Given the above, it would be senseless to create a "port" of lazarus, > which would require a "port" of the "patched" fpc sources, (as a > dependency), and then have a development system which was tied to a > particular version of freebsd. No, it's not senseless. You can *ask* the various libraries what they need, by runnig "gdk-pixbuf-config --libs", for example. However, you shouldn't need to do that. Adding something like "USE_GNOME=gdkpixbuf" to your port Makefile will cause the Makefile to add all the appropriate dependencies to CFLAGS. Except you may not use CFLAGS, and may have to go back to gdk-pixbuf-config to get the data you need. You may even need to tweak the output to make it accpetable to fpc. Basically, this change is only really painfull if you want to distribute binaries. In that case, you could, as mentioned above,distribute binaries of the libraries as well. Or you could not support anything prior to 6.1 (actually, that's not correct - my 5.5 system has the new library naming). Or - since this change is in the ports system, not FreeBSD proper, and the ports tree can be updated independently of the base system, require that 6.0 users update their ports tree and the libraries in question. Please note, I'm not trying to defend or justify this change - you pointing it out is the first I'd heard of it. I'm just trying to point out some ways you can deal with it. http://www.mired.org/consulting.html Independent Network/Unix/Perforce consultant, email for more information. ___ freebsd-questions@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-questions To unsubscribe, send any mail to "[EMAIL PROTECTED]"
Re: LinkLib Issues In freebsd Lazarus
Mike Meyer wrote: > > It's *really* unusual for a port to install a binary tarball if the > source is available. Most ports that install binaries are for > commercial products for which source isn't available. > In this case, the unusual rules. Here are the contents of the "ports" binary.i386-freebsd.tar demo.tar.gz doc-pdf.tar.gz install.sh > > A port is basically a Makefile plus at least some text files. The > ports tree includes a lot of make machinery to > fetch/extract/patch/build/etc. based on that. See the porters handbook > at http://www.freebsd.org/doc/en_US.ISO8859-1/books/porters-handbook/index.html >> for details. Thanks Mike. I have been involved in a parallel discussion on the fpc-devel list, and have discovered a few facts which will impact the manufacture of a freepascal Lazarus port. In fact, what I have learned will impact the usability of FPC on freepascal itself. The "problem" which initiated this thread was the "wrong naming" of some libraries. Well, it turns out that this renaming was done mid-stream by the freebsd development team, and not by the freepascal folks. It seems that from freebsd 6.0 to freebsd 6.1 (the one I am using) library names were arbitrarily changed. The ones I ran into were libgdk, libgtk, and libglib. In all previous versions (prior to 6.1) of freebsd, the lib versions 1.2 were named libgdk12, libgtk12, and libglib12 they were changed in 6.1 to libgdk-12, libgtk-12, and libglib-12 respectively. I wonder how many more library names were changed? This is a real blow to any third party software developer, who's software will likely start to bomb on freebsd6.1, where it ran just fine on 6.0 BIG problem! If I compile a program on my 6.1 system, which makes any dynamic calls to these libraries (and possibly others as yet unknown), that executable will ONLY run on freebsd 6.1, and bomb on all prior versions. My "fix" of patching the freepascal 2.0.2, or your method of sym-linking, while fixing the local problem of compiling Lazarus, breaks all portability to previous freebsd installs. This is a bad thing the freebsd folks have done! There are some dirty work-arounds, and according to the fpc developers, they will be implementing some new tools to deal with this in fpc-2.0.4, who's rc2 has just been released. I can see making these kinds of changes from a 5.x version to a 6.x version, as bad as even that would be, but to make such a change from within the 6.x branch is pretty inconsiderate IMHO. Given the above, it would be senseless to create a "port" of lazarus, which would require a "port" of the "patched" fpc sources, (as a dependency), and then have a development system which was tied to a particular version of freebsd. Bob ___ freebsd-questions@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-questions To unsubscribe, send any mail to "[EMAIL PROTECTED]"
Re: LinkLib Issues In freebsd Lazarus
In <[EMAIL PROTECTED]>, Bob <[EMAIL PROTECTED]> typed: > > I'd say this is a mistake. You should probably install the fpc port in > > /usr/ports/lang/fpc. There may be reasons to install your own version > > instead of a port, but you haven't presented any. > As per the Lazarus docs/INSTALL, compiling Lazarus requires the FPC > source tree, A binary install of FPC won't do. It's *really* unusual for a port to install a binary tarball if the source is available. Most ports that install binaries are for commercial products for which source isn't available. > > Again, you should probably have used the ports version, in > > editors/fpc-ide. > That's the text-mode IDE, not the GUI one, called Lazarus. That port doesn't say very much about what it is, other than it's an fpc-ide. Sorry for the mistake. > So, all that is needed is to apply the patches I mentioned in my OP, get > the proper gdk-pixbuf installed from ports, and it is as good as gold. > > Now, how can I create a port for Lazarus, now that I have it compiled > and running? You'll probably want to start by creating an fpc port that builds from source. A lazarus port could fetch the source files itself and use them, but if I were using them, I'd like to know that the fpc I was using was built from the sources the ide used. A port is basically a Makefile plus at least some text files. The ports tree includes a lot of make machinery to fetch/extract/patch/build/etc. based on that. See the porters handbook at http://www.freebsd.org/doc/en_US.ISO8859-1/books/porters-handbook/index.html > for details. http://www.mired.org/consulting.html Independent Network/Unix/Perforce consultant, email for more information. ___ freebsd-questions@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-questions To unsubscribe, send any mail to "[EMAIL PROTECTED]"
Re: LinkLib Issues In freebsd Lazarus
Bob wrote: So, all that is needed is to apply the patches I mentioned in my OP, get the proper gdk-pixbuf installed from ports, and it is as good as gold. Now, how can I create a port for Lazarus, now that I have it compiled and running? Bob The porter's handbook should get you started: http://www.freebsd.org/doc/en_US.ISO8859-1/books/porters-handbook/ HTH, Micah ___ freebsd-questions@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-questions To unsubscribe, send any mail to "[EMAIL PROTECTED]"
Re: LinkLib Issues In freebsd Lazarus
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Mike Meyer wrote: > > I'd say this is a mistake. You should probably install the fpc port in > /usr/ports/lang/fpc. There may be reasons to install your own version > instead of a port, but you haven't presented any. > Mike thanks! You gave me the missing piece of this puzzle! It all now works a charm! As per the Lazarus docs/INSTALL, compiling Lazarus requires the FPC source tree, A binary install of FPC won't do. > Again, you should probably have used the ports version, in > editors/fpc-ide. That's the text-mode IDE, not the GUI one, called Lazarus. >> the following libraries were not found by ld: glib12, gdk12, and gtk12. > > Where did you get these from? And what versions are they? > >From the FPC Source tree fpc-2.0.2/ packages/extra/gtk/gdk/gdk.pp <- wants gdk 1.2 packages/extra/gtk/gdk/gdk.pp <- wants gtk 1.2 and packages/extra/gtk/glib/glib.pp <- wants glib 1.2 each of the above .pp source files calls for the proper lib by the wrong name for freebsd. They all are missing the "-" in the version number. > Well, yeah - you're linking against *the wrong library*. My system has > a /usr/X11R6/lib/libgdk_pixbuf.a, installed from the > graphics/gdk-pixbuf port. That does have the function you're looking > for. And here is the Million Dollar answer! PORTS graphics/gdk-pixbuf When I went looking for the proper lib, I did not see it. Possibly because I was looking for gdk_pixbuf :-( > If you want to continue the way > you started, delete your bogus symlink, and install the > graphics/gdk-pixbuf port to get the library you need. > Since I need the sources, I didn't have any other option but to continue. I deleted the symlink, and installed the graphics/gdk-pixbuf port, and Lazarus compiled, and linked! So, all that is needed is to apply the patches I mentioned in my OP, get the proper gdk-pixbuf installed from ports, and it is as good as gold. Now, how can I create a port for Lazarus, now that I have it compiled and running? Bob -BEGIN PGP SIGNATURE- Version: GnuPG v1.4.2.2 (FreeBSD) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iD8DBQFEus5iAexE5bK/mHkRAjCCAKCAl3A2PPbQhSabqSFseYLiv6m86QCeMzdE dzHlNEGOEGyHI1GqDlcFehg= =B/PS -END PGP SIGNATURE- ___ freebsd-questions@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-questions To unsubscribe, send any mail to "[EMAIL PROTECTED]"
Re: LinkLib Issues In freebsd Lazarus
This is really more appropriate for -questions, so I've redirected it there. In <[EMAIL PROTECTED]>, Bob Richards <[EMAIL PROTECTED]> typed: > Hi Folks: > > I believe this is a "hacker" issue, at least any possible solution is. > > I recently moved from Linux to FreeBSD as my primary work environment. > My development system of choice is FreePascal. I installed FPC-2.0.2 > from the official FreePascal distribution tar ball I'd say this is a mistake. You should probably install the fpc port in /usr/ports/lang/fpc. There may be reasons to install your own version instead of a port, but you haven't presented any. > My next step was to install Lazarus, the FPC IDE, and here is where I > have run into troubles. Again, you should probably have used the ports version, in editors/fpc-ide. > A tar-ball install ran well until Lazarus was being Linked. The errors were: > > the following libraries were not found by ld: glib12, gdk12, and gtk12. Where did you get these from? And what versions are they? > a grep -r in the FPC-2.0.2 source tree revealed the problems, in every > case of: > > packages/extra/ glib, gtk, and gdk the linklib statements were wrong thus: > > {$ifdef FreeBSD} >gtkdll='gtk12'; >{$linklib gtk12} > > So, I created a patch to fix the above constructs to: > > {$ifdef FreeBSD} > gtkdll='gtk-12'; > {$linklib gtk-12} > > For all three libraries; since freebsd names these libraries with a "-" > > I recompiled and reinstalled FPC-2.0.2 with the patches applied, > re-tested the compiler; all OK! > > I went back to the Lazarus source tree gmake clean; gmake and received > the following error: > > Free Pascal Compiler version 2.0.2 [2006/07/14] for i386 > Copyright (c) 1993-2005 by Florian Klaempfl > Target OS: FreeBSD/ELF for i386 > Compiling lazarus.pp > Linking ../lazarus > /usr/bin/ld: cannot find -lgdk_pixbuf > lazarus.pp(113,1) Error: Error while linking > > a locate gdk_pixbuf finds: /usr/X11R6/lib/libgdk_pixbuf-2.0 > > So, at this point I just sym-linked my libgdk_pixbuf-2.0 to > libgdk_pixbuf: ln -s libgdk_pixbuf-2.0.a libgdk_pixbuf.a This is almost certainly a mistake, as a major version number change indicates that the interface changed. > and ran gmake again, only to produce: > > Linking ../lazarus > /usr/home/bob/lazarus/lcl/units/i386-freebsd/gtk/gtkint.o(.text+0x6f65): > In function `DATASOURCEINITIALIZE': > gtkobject.inc:2309: undefined reference to `gdk_pixbuf_get_from_drawable' > > Many many more "undefined reference" to something missing in gdk_pixbuf. Well, yeah - you're linking against *the wrong library*. My system has a /usr/X11R6/lib/libgdk_pixbuf.a, installed from the graphics/gdk-pixbuf port. That does have the function you're looking for. > so: freebsd's stock-installed gdk_pixbuf does not contain the functions > needed! No, FreeBSD's stock-installed gdk_pixbuf-2.0 does not contain the functions you need from gdk_pixbuf. This should not be surprising. > So, I went to ports and found "ruby18-gdk_pixbuf2-0.14.1" a make > install provided "gdk_pixbuf2.so" but no "gdk_pixbuf2.a" !! I find it > odd that no provision is provided to link to this lib! Again, you *don't want* gdk_pixbuf2. And that port doesn't provide gdk_pixbuf2, but almost certainly requires it, so it'll install the port to provide that library if it isn't there. But that doesn't help you at all. > Funny! I moved away from Linux mainly because of Library-Hell issues :-) Shared library versioning hell is platform-independent. In general, FreeBSD's port/package system is older than Linux package managers. This means they got to learn from it, and are in some ways better. On the other hand, it also means that the freebsd ports system has features that those systems may not have yet. In particular, you can use the sysutils/portupdate port to update ports, and it will move old versions of shared librarys out of the way so they don't confuse new builds, but will still be found by older packages that depend on them. You can also use the sysutils/portsearch port to find files that the ports will install for you. > Any thoughts on this would be greatly appreciated. I seem to have run > out of things to try here. Surely someone has successfully compiled > Lazarus on freebsd I'd install the fpc and fpc-ide ports. If you want to continue the way you started, delete your bogus symlink, and install the graphics/gdk-pixbuf port to get the library you need. http://www.mired.org/consulting.html Independent Network/Unix/Perforce consultant, email for more information. ___ freebsd-questions@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-questions To unsubscribe, send any mail to "[EMAIL PROTECTED]"