[Xastir] Libgeotiff & OS X

Tom Russo russo at bogoflux.losalamos.nm.us
Thu Aug 26 20:52:05 EDT 2004


On Thu, Aug 26, 2004 at 06:35:55PM -0400, a Mr. Richard Feyler of Fort Lee, New Jersey <shadow at dementia.org> writes 'Dear Rosanne Rosannadanna':
> On Thu, 26 Aug 2004, Derrick J Brashear wrote:
> 
> >Jeff: for now, edit "configure" directly, find all occurances of -lgeotiff 
> >and replace them with -lgeotiff -ltiff
> >
> >This is a hack but it should get you back in business for now.
> 
> I'm not an autoconf expert: does this really use each (outer) library 
> found in the (inner) tests?
> 
>     AC_CHECK_LIB(tiff, TIFFClose, AC_CHECK_LIB(proj, pj_init, 
> AC_CHECK_LIB(geotiff, GTIFNew, use_geotiff=yes
>     LIBS="$LIBS -ltiff -lgeotiff"
>     AC_DEFINE(HAVE_LIBGEOTIFF, , Define to 1 if you have the `geotiff' 
> library (
> -lgeotiff). )
>     )))
> 
> I thought it didn't.

It doesn't.  I was surprised to see that somehow configure gets through this
test anyway on my machine (which has tiff, but apparently doesn't seem to 
require -ltiff when linking the simple GTIFNew test).

This should be:

     AC_CHECK_LIB(tiff, TIFFClose,
                  LIBS="$LIBS -ltiff" 
                  AC_CHECK_LIB(proj, pj_init,
                               AC_CHECK_LIB(geotiff, GTIFNew, 
                                           use_geotiff=yes
                                           LIBS="$LIBS -lgeotiff"
                                           AC_DEFINE(HAVE_LIBGEOTIFF, , 
       Define to 1 if you have the `geotiff' library ( -lgeotiff). ) )))

which forces -ltiff in as soon as it knows that it works.

Actually, since proj has already been probed earlier (and use_proj is 
already set) it would be better to do something like this:

#check for libtiff, libgeotiff
  if test "${use_proj}" = "yes" ; then
      use_geotiff=yes
      AC_ARG_WITH(geotiff,
         [  --without-geotiff       Disable geotiff features.],
	use_geotiff=$withval)
      if test "${use_geotiff}" = "yes"; then
          AC_CHECK_LIB(tiff, TIFFClose,
               LIBS="$LIBS -ltiff"
               use_tiff=yes
               AC_DEFINE(HAVE_TIFF, , Define to 1 if you have the 'tiff' library
 (-ltiff)))
         if test "${use_tiff}" = "yes"; then
           use_geotiff=no
                   AC_CHECK_LIB(geotiff, GTIFNew, 
                   use_geotiff=yes
                   LIBS="$LIBS -lgeotiff"
                   AC_DEFINE(HAVE_LIBGEOTIFF, ,
       Define to 1 if you have the `geotiff' library ( -lgeotiff). ) )
         fi
      fi
  fi 

As it is now, proj is being probed a second time even when we know it's there,
and -ltiff isn't put into LIBS until after geotiff is found.  Apparently in 
the version of geotiff that Jeff has -ltiff is needed to link the simple test 
case in the probe for GTIFNew.

-- 
Tom Russo    KM5VY     SAR502  DM64ux         http://www.swcp.com/~russo/
Tijeras, NM  QRPL#1592 K2#398  SOC#236 AHTB#1 http://www.qsl.net/~km5vy/
 "One man alone can be pretty dumb sometimes, but for real bona fide
 stupidity, there ain't nothin' can beat teamwork." - Edward Abbey




More information about the Xastir mailing list