On Fri, Mar 20, 2009 at 11:07:01AM -0500, William Kyngesburye scratched on the 
wall:
> Indeed, configuring sqlite to compile as a dylib on OSX is easy (it's  
> the default).

  Duh.  I really hate the way autoconf hides things in ".libs".  I was
  doing a huge series of test builds and wasn't actually installing
  stuff, so I missed the fact that it was, indeed, building the dynamic
  library.

> I think what Richard may mean is packaging an installer so that the  
> dylib is installed where it needs to be.  As you point out Jay, dylibs  
> have additional metadata, part of that is the full path to the dylib,  
> and this is also in the sqlite program.  So the dylib needs to be  
> installed where it was compiled to be - /usr/local/lib.  It is possible 
> to set DYLD_LIBRARY_PATH, like LD_LIBRARY_PATH on Linux, but Mac users 
> don't want to be bothered by this.

  Not exactly.  A dylib doesn't know where it is, but it does like a
  full path to the things it links to (i.e. libgcc, libSystem).  You
  can dig through the MachO header with otool(1).

  The big sticky point with dylib files vs ELF .so files is that Apple
  provides no simple tool to re-write the paths inside the dylib file
  (IIRC, libtool under Linux will do this).  So, if you have a package
  that builds and links a series of inter-related dylib files, you can
  get into a messy situation if you try to move the dylib files from
  their original install location.  In the case of SQLite, it doesn't
  matter, as the only libs SQLite is linking against are the system
  libs.

  I also disagree with your "Mac users don't want to be bothered by
  this" idea.  SQLite doesn't provide an XCode project file, after all.
  You're going to be digging around on the command line to build,
  install, and use these kinds of tools.  By the time you've reached
  this level, OS X is just another UNIX system.  Mucking around with
  libtool or some such low-level tool to re-path dynamic libraries
  under Linux is not exactly something your run-of-the-mill admin is
  very familiar with.  A software engineer, perhaps, but not most users
  or more admins.

> Using a static library means the sqlite program can be installed  
> whereever the user likes, as long as they know how to run it (ie it's in 
> their PATH).  No admin permissions needed.

  Outside of the minor detail that Mach-O has no concept of a "static
  library", I'm not really interested in having a static vs dynamic
  argument.  I understand the advantages and disadvantages of both,
  especially in light of the push to use amalgamation distributions.

  But the current set of Mac OS X distributions essentially forces you
  to go to source code since there are no libraries available.  If all
  three platforms are supported, I'd kind of expect the same four
  downloads for all three platforms.

> With a dylib, the program can still be anywhere, but the dylib needs to 
> be where the program expects it, normally in /usr/local/lib, which needs 
> admin permissions.  Either a script to copy it there could work (again, 
> there's the issue of us being Mac users), or a Mac installer package is 
> needed.

  For stuff like this, I don't think anyone is expecting an installer.
  If you need one, you should be using some kind of package management
  system for installing SQLite.

  After all, neither the Windows SQLite3.DLL nor the Linux libsqlite3.so
  download distributions have any kind of install scripts-- the
  downloads are just the raw library files.  No reason for a Mac OS X 
  .dylib distribution to be any different than the Linux .so distribution.
  People either know what the files are and what to do with them, or
  they're better off being confused.



  BTW, part of the reason I'm asking these questions is that I'm trying
  to write some docs having to do with the build/install process of
  SQLite on different platforms.  I've got a lot of UNIX experience, so
  the Linux/Mac stuff is pretty easy, but I'm a bit of a newbie on
  Windows.  If there are any folks out there that have some cross
  platform experience (i.e. speak UNIX) but spend a fair amount of time
  under Windows, I'd love to hear from you.

    -j

-- 
Jay A. Kreibich < J A Y  @  K R E I B I.C H >

"Our opponent is an alien starship packed with atomic bombs.  We have
 a protractor."   "I'll go home and see if I can scrounge up a ruler
 and a piece of string."  --from Anathem by Neal Stephenson
_______________________________________________
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Reply via email to