QGIS/configure.in

173 lines
4.7 KiB
Plaintext
Raw Normal View History

dnl Process this file with autoconf to produce a configure script.
AC_INIT
#AC_CONFIG_SRCDIR([libtool])
AM_INIT_AUTOMAKE(qgis, 0.0.14)
AC_PREFIX_PROGRAM(gcc)
AC_PROG_CXX
AC_LANG([C++])
AC_PROG_LIBTOOL
gw_CHECK_QT
dnl ---------------------------------------------------------------------------
dnl GDAL/OGR
dnl ---------------------------------------------------------------------------
AC_ARG_WITH(gdal,
AC_HELP_STRING([--with-gdal=path],
[Full path to 'gdal-config' script, e.g. '--with-gdal=/usr/local/bin/gdal-config' ]),
[if test -x "$with_gdal/gdal-config" ; then
GDAL_CONFIG="$with_gdal/gdal-config"
else
AC_MSG_ERROR("Cannot find $with_gdal")
fi],
[GDAL_CONFIG=`which gdal-config`
if test ! -x "$GDAL_CONFIG" ; then
AC_MSG_ERROR(["Cannot find gdal-config, try to use --with-gdal option"])
fi])
AC_MSG_CHECKING([for GDAL/OGR])
if test x`$GDAL_CONFIG --ogr-enabled` = "xno" ; then
AC_MSG_ERROR([GDAL must be compiled with OGR support and currently is not.])
fi
AC_MSG_RESULT(yes)
GDAL_LIB="`$GDAL_CONFIG --libs`"
GDAL_CFLAGS="`$GDAL_CONFIG --cflags`"
AC_SUBST(GDAL_LIB)
AC_SUBST(GDAL_CFLAGS)
dnl ---------------------------------------------------------------------------
dnl PostgreSQL
dnl ---------------------------------------------------------------------------
AC_ARG_WITH(pg,
AC_HELP_STRING([--with-pg=path],
[PostgreSQL (PostGIS) Support (full path to pg_config)]))
AC_MSG_CHECKING([for PostgreSQL])
if test x"$with_pg" = "xyes" -o x"$with_pg" = "x" ; then
AC_PATH_PROG([PG_CONFIG], [pg_config], [no])
elif test x"$with_pg" = "xno" ; then
PG_CONFIG=no
else
PG_CONFIG="$with_pg/pg_config"
fi
if test x"$PG_CONFIG" = "xno" ; then
AC_MSG_RESULT([no])
else
HAVE_PG=1
PG_LIB="-L`$PG_CONFIG --libdir` -lpq"
PG_INC="`$PG_CONFIG --includedir`"
AC_MSG_RESULT([yes])
AC_MSG_CHECKING([for postgreSQL libs])
AC_MSG_RESULT([$PG_LIB])
fi
AC_SUBST(HAVE_PG)
AC_SUBST(PG_INC)
AC_SUBST(PG_LIB)
AM_CONDITIONAL(POSTGRESDB, test x$HAVE_PG = x1)
dnl ---------------------------------------------------------------------------
dnl SPIT plugin
dnl ---------------------------------------------------------------------------
AC_ARG_WITH(spit,
AC_HELP_STRING([--with-spit],
[Shapefile to PostgreSQL (PostGIS) import plugin (built by default with PostgreSQL support)]))
AC_MSG_CHECKING([SPIT option])
if test x"$with_spit" = "xno" ; then
WANT_SPIT=0
else
if test x"$with_pg" = "xyes" -o x"$with_pg" = "x" ; then
WANT_SPIT=1
else
WANT_SPIT=0
fi
fi
if test x"$WANT_SPIT" = "x1" ; then
AC_MSG_RESULT([yes])
else
AC_MSG_RESULT([no])
fi
AC_SUBST(WANT_SPIT)
AM_CONDITIONAL(SPIT, test x$WANT_SPIT = x1)
dnl ---------------------------------------------------------------------------
dnl GRASS and GRASS++ package
dnl ---------------------------------------------------------------------------
# AC_ARG_WITH(grass,
# AC_HELP_STRING([--with-grass=DIR],[GRASS Support (full path to GRASS binary package, e.g. --with-grass=/usr1/grass51/dist.i686-pc-linux-gnu)]))
# AC_ARG_WITH(grasspp,
# AC_HELP_STRING([--with-grasspp=DIR],[Full path to GRASS++ binary package]))
# AC_MSG_CHECKING([for GRASS])
# if test x"$with_grass" != "xno" -a "$with_grass" != "x" ; then
# # I don't know how to add library path to AC_CHECK_LIB()
# GISLIB=`ls $with_grass/lib/libgrass_gis.*`
# if test ! -f "$GISLIB"; then
# AC_MSG_ERROR( [GRASS library not found] )
# fi
# GRASSPPLIB=`ls $with_grasspp/libgrass++.*`
# if test ! -f "$GRASSPPLIB"; then
# AC_MSG_ERROR( [GRASS++ library not found] )
# fi
# GRASS_LIB="-L$with_grass/lib/ -L$with_grasspp -lgrass_vect -lgrass_dig2 -lgrass_dbmiclient -lgrass_dbmibase -lgrass_shape -lgrass_dgl -lgrass_rtree -lgrass_gis -lgrass_datetime -lgrass_linkm -lgrass_form -lgrass++"
# GISINC=`ls $with_grass/include/gis.h`
# if test ! -f "$GISINC"; then
# AC_MSG_ERROR( [GRASS headers not found] )
# fi
# GRASSPPINC=`ls $with_grasspp/GRASS.h`
# if test ! -f "$GRASSPPINC"; then
# AC_MSG_ERROR( [GRASS++ headers not found] )
# fi
# GRASS_INC="$with_grass/include/ $with_grasspp/"
# HAVE_GRASS=1
# AC_MSG_RESULT([yes])
# else
# AC_MSG_RESULT([no])
# fi
# AC_SUBST(HAVE_GRASS)
# AC_SUBST(GRASS_LIB)
# AC_SUBST(GRASS_INC)
#echo ${prefix}/lib
libdir=${prefix}/lib
AC_MSG_CHECKING([plugin install directory])
AC_MSG_RESULT([$libdir])
#echo Plugins will be installed in $libdir
AC_CONFIG_FILES([
Makefile
src/Makefile
providers/Makefile
providers/ogr/Makefile
providers/postgres/Makefile
plugins/Makefile
plugins/spit/Makefile
plugins/example/Makefile
plugins/maplayer/Makefile
plugins/geoprocessing/Makefile
])
AC_OUTPUT