--- gdal-1.11.0/configure.in.orig 2014-05-11 06:25:06.870303219 +0200 +++ gdal-1.11.0/configure.in 2014-05-11 09:17:12.103421341 +0200 @@ -718,25 +718,33 @@ # Check for GRASS 5.7.0 or later library use. # TODO: separate libs for rasters and vectors -if test "$with_grass" != "yes" -a "$with_grass" != "no" ; then +if test "$with_grass" != "no" ; then - AC_CHECK_LIB(grass_gis,G_is_initialized,GRASS_SETTING=grass70+,GRASS_SETTING=no,-L$with_grass/lib -lgrass_datetime) + if test "$with_grass" = "yes" ; then + GRASS_I= + GRASS_L= + GRASS_GISBASE="$prefix" + else + GRASS_I="-I$with_grass/include" + GRASS_L="-L$with_grass/lib" + GRASS_GISBASE="$with_grass" + fi + AC_CHECK_LIB(grass_gis,G_is_initialized,GRASS_SETTING=grass70+,GRASS_SETTING=no,$GRASS_L -lgrass_datetime) if test "$GRASS_SETTING" = "no" ; then - AC_CHECK_LIB(grass_gis,G_asprintf,GRASS_SETTING=grass57+,GRASS_SETTING=no,-L$with_grass/lib -lgrass_datetime) + AC_CHECK_LIB(grass_gis,G_asprintf,GRASS_SETTING=grass57+,GRASS_SETTING=no,$GRASS_L -lgrass_datetime) fi if test "$GRASS_SETTING" != "no" ; then if test "$GRASS_SETTING" = "grass70+" ; then G_RASTLIBS="-lgrass_raster -lgrass_imagery" G_VECTLIBS="-lgrass_vector -lgrass_dig2 -lgrass_dgl -lgrass_rtree -lgrass_linkm -lgrass_dbmiclient -lgrass_dbmibase" - LIBS="-L$with_grass/lib $G_VECTLIBS $G_RASTLIBS -lgrass_gproj -lgrass_gmath -lgrass_gis -lgrass_datetime $LIBS" + LIBS="$GRASS_L $G_VECTLIBS $G_RASTLIBS -lgrass_gproj -lgrass_gmath -lgrass_gis -lgrass_datetime $LIBS" else G_RASTLIBS="-lgrass_I" G_VECTLIBS="-lgrass_vect -lgrass_dig2 -lgrass_dgl -lgrass_rtree -lgrass_linkm -lgrass_dbmiclient -lgrass_dbmibase" - LIBS="-L$with_grass/lib $G_VECTLIBS $G_RASTLIBS -lgrass_gproj -lgrass_vask -lgrass_gmath -lgrass_gis -lgrass_datetime $LIBS" + LIBS="$GRASS_L $G_VECTLIBS $G_RASTLIBS -lgrass_gproj -lgrass_vask -lgrass_gmath -lgrass_gis -lgrass_datetime $LIBS" fi - GRASS_INCLUDE="-I$with_grass/include" - GRASS_GISBASE="$with_grass" + GRASS_INCLUDE="$GRASS_I" HAVE_GRASS=yes else AC_MSG_ERROR([--with-grass=$with_grass requested, but libraries not found!])