[Gdal-dev] Any possibility of static compile?

Curt, WE7U archer at eskimo.com
Mon Dec 4 13:14:33 EST 2006


On Sun, 3 Dec 2006, Curt Mills wrote:

> I need to do a static compile of my app.  I've been able to compile
> Shapelib, proj, geotiff, and a few other libraries statically so
> far.
>
> I'd like to get GDAL compiled in, of which we use some of the OGR
> functions, but I recall reading earlier about some problems with
> static compiles of GDAL.  Is there a way to get OGR or the full
> GDAL/OGR library compiled statically these days?
>
> There's also a way under Linux Standard Base rules to distribute a
> shared library along with the application, so that's my backup plan.
> I'd much rather distribute the entire thing statically linked if
> possible though.  Any hope?

To be more specific:  The "Building GDAL From Source" web page says
this:


  "You could just link against the static libraries (normally
   gdal/gdal.a gdal/ogr/ogr.a gdal/frmts/o/ *.a gdal/gdal.a
   gdal/port/cpl.a)..."


Yes, the "gdal/gdal.a" portion is listed twice there and yes it has
a space listed before the "*" (probably shouldn't).

No, I can't find any *.a files other than "gdal.a" in the build:


  > find . -type f -print | grep "\.a"
  ./pymod/.libs/_gdalmodule.a
  ./ogr/ogrsf_frmts/ili/iom/LICENSE.apache
  ./.libs/libgdal.a


It was compiled like this:


  CC=lsbcc ./configure \
      --prefix=/opt/lsb-gdal \
      --exec_prefix=/opt/lsb-gdal \
      --enable-static


Does the GDAL build no longer support building static versions of
all the libraries?  Are there some easy tweaks to get a static
compile working again?

--
Curt, WE7U.   APRS Client Comparisons: http://www.eskimo.com/~archer
"Lotto:    A tax on people who are bad at math." -- unknown
"Windows:  Microsoft's tax on computer illiterates." -- WE7U
"The world DOES revolve around me:  I picked the coordinate system!"



More information about the Gdal-dev mailing list