id summary reporter owner description type status priority milestone component version severity resolution keywords cc 1297 Framework builds for OSX hobu warmerdam "{{{ Time to straighten out my notes and get this going. These are ideas on what to do for a GDAL framework, and a few specific patches (but not comprehensive). This will probably be a bit disjointed (and I noted a couple bugs that I should get off my butt and report). My plan is not just a purely OSX framework, but something that can be used by unix software without changes to that software, thus there are some additions to the standard framework structure. - Basic structure (* unix compatibility additions): GDAL.framework GDAL -> Versions/Current/GDAL Headers -> Versions/Current/Headers Programs -> Versions/Current/Programs Resources -> Versions/Current/Resources unix * -> Versions/Current/unix Versions [M.m] GDAL [=libgdal.dylib] Headers [=include] Programs [=bin] Resources [=share] unix * bin -> ../Programs include -> ../Headers lib libgdal.dylib -> ../../GDAL Current -> [M.m] (I went with unix versions with Major.minor, so currently it would be 1.3. Apple generally uses a default A, B, C...) In my current GDAL framework I also have a Libraries folder for all the support dependencies that aren't in the system or other frameworks. This isn't necessary for a framework build, it's up to the user to decide what to do with those. - shared-only - no such thing as a static framework. - plugins - a framework should not be changed to extend it, ie with plugins. Plugins should be installed externally to the framework. So I decided to put plugins in the standard Application Support folders for OS X: /Library/Application Support/GDAL/PlugIns and ~/Library/Application Support/GDAL/PlugIns. This required patching the plugin loading to add these as default locations. I conditionalized it on MACOSX_FRAMEWORK. Of course a user can still add to that in the usual way. Affected files: gcore/gdaldrivermanager.cpp, ogr/ogrsf_frmts/generic/ogrsfdriverregistrar.cpp NOTE: bug (non-framework) in ogrsfdriverregistrar.cpp: the home plugin searchpath should be 'lib/gdalplugins', not 'lib'. - configure - add --enable-macosx-framework, which should do: I'm conditionalizing framework stuff on MACOSX_FRAMEWORK, so this should be set. Since it's used in both code and the makefile, it needs to be added to GDALmake.opt.in and cpl_config.h.in. I have patches for those bits, but not the configure setup (I just hacked configure, I don't know how to change configure.in). Also, the install prefix for frameworks is fixed, in /Library/Frameworks/GDAL.framework/Versions/M.m, though it's a bit more complicated because the framework base is just /Library/Frameworks/GDAL.framework, and the symlinks must be setup there. Plus there is the unix compatibility version of prefix. Library install_name and GDAL_PREFIX should be the full, versioned prefix. But prefix in gdal_config should be the unix compatibility prefix. I used two vars for the FW prefixes: fwprefix = /Library/Frameworks/GDAL.framework fwverprefix = ${fwprefix}/Versions/$(GDAL_MMVER) and a major.minor version var is needed for this (GDAL_MMVER). Then set the INST_* as (override base --*dir= options and defaults): INST_PREFIX = ${fwprefix} INST_INCLUDE = ${fwverprefix}/Headers INST_DATA = ${fwverprefix}/Resources/gdal INST_LIB = ${fwverprefix} INST_BIN = ${fwverprefix}/Programs INST_DOCS = ${fwverprefix}/Resources/doc INST_MAN = ${fwverprefix}/Resources/man NOTE: bug/wish (non-framework) - currently in gdalmake-opt.in INST_DOCS = @exec_prefix@/doc, this makes it impossible to override the doc dir and forces it outside the share dir (OSX docs [man/doc/info] are normally inside share). Configure needs a --with-docdir option. The normal prefix for the build should be the versioned FW prefix. - gdal_config - framework use should never need to look at gdal_config. gdal_config is for a normal unix build. So, it needs the unix prefix, and have -lgdal and -I and -L flags pointing to the unix folder. But this shouldn't interfere with building the framework with the framework prefix. So basically, set prefix here as /Library/Frameworks/GDAL.framework/Versions/M.m/unix. - makefile - setup framework dirs, install and rename lib. install-actions target: create framework folder structure. install-lib target: completely separate install procedure for framework - bypass libtool because lib symlinks and .la not needed, and lib is renamed. NOTE: bug - install-docs target is missing $(DESTDIR) on copying html files: -cp html/*.* $(INST_DOCS)/gdal +cp html/*.* $(DESTDIR)$(INST_DOCS)/gdal - headers - I was worried that a major change to GDAL was needed to reorganize the headers. Happily, no changes needed. In case you don't know, locating headers in OSX frameworks involves a bit of CPP magic. There are builtin framework dirs and these are searched automatically (new ones are added with -F flag). Without adding to the include search path, when one specifies , CPP looks in the framework's Headers folder. So ""#include "" will find gdal.h without adding any -I flags. And with the rest of the GDAL headers using the quoted include form, they are also found. Patch files: Here are patches for the sources and makefile, mentioned above. I don't have a patch for configure.in or other autoconfig stuff, so you'll have to figure out what's needed as mentioned above. They shouldn't get in the way of the current build, and will be dormant until the configure stuff is added. For the makefile, install part, I had to bypass the libtool install because: I don't want the .la file, I don't want the symlinks, and I do want to rename it on install. If there are libtool install options to do these, that would make it simpler. Ask questions. I probably missed something. Or mis-described something... }}}" enhancement closed highest default unspecified minor fixed kyngchaos@…