QGIS/configure.in

277 lines
7.9 KiB
Plaintext
Raw Normal View History

dnl Process this file with autoconf to produce a configure script.
dnl configure.in,v 1.30 2004/03/22 20:04:56 mcoletti Exp
AC_INIT
#AC_CONFIG_SRCDIR([libtool])
- s/config.h/qgsconfig.h [0] - qgsconfig.h now has header sentinals - now will install headers in $(prefix)/qgis/include and libqis.* library in $(prefix)/lib [1] - "src/Makefile" no longer relies on explicit dependencies and uses better naming scheme for created source files [2] Notes: [0] To eliminate any file namespace collisions. Unfortunately there will still be some macro name collisions. These are harmless, though annoying. What needs to happen is that all header file references to "qgsconfig.h" be moved to implementation files, thus breaking any include dependencies for external software. [1] There currently does not exist a way to make this optional; these will always install. In the future, this might be something toggleable by a configure script option. Moreover, there does not currently exist a "qgis-config" script for getting command line options for external, dependant software; there might be one in a future release. I decided to err on including too many header files; almost certainly some of the header files that are currently installed can be culled from the "to install" list. The new make file has two targets: the old qgis application target, and a second one for the library. As plug-ins are developed, there may be a need to add more source files to the library to link against. I just added in the bare minimum for the current set of plug-ins. If more sources need to be added, just add them to libqgis_la_SOURCES, near the bottom of "src/Makefile.am". [2] All *.ui files will create corresponding *.uic.h and *.uic.cpp files. Since these also need MOC files, *.moc.uic.cpp files are also automatically created. git-svn-id: http://svn.osgeo.org/qgis/trunk/qgis@1056 c8812cc2-4d05-0410-92ff-de0c093fc19c
2004-03-22 20:00:55 +00:00
dnl header sentinals for qgsconfig.h
AH_TOP(
[#ifndef QGSCONFIG_H
#define QGSCONFIG_H
])
AH_BOTTOM(
[#endif]
)
AC_CONFIG_HEADERS([qgsconfig.h])
dnl ---------------------------------------------------------------------------
dnl version number
dnl ---------------------------------------------------------------------------
MAJOR_VERSION=0
MINOR_VERSION=1
MICRO_VERSION=0
EXTRA_VERSION=8
if test $EXTRA_VERSION -eq 0; then
VERSION=${MAJOR_VERSION}.${MINOR_VERSION}.${MICRO_VERSION}devel
else
VERSION=${MAJOR_VERSION}.${MINOR_VERSION}.${MICRO_VERSION}devel${EXTRA_VERSION}
fi
AM_INIT_AUTOMAKE(qgis, ${VERSION})
AC_PREFIX_PROGRAM(gcc)
AC_PROG_CXX
AC_LANG([C++])
AC_PROG_LN_S
AC_PROG_MAKE_SET
AC_PROG_INSTALL
AC_LIBTOOL_DLOPEN
AC_PROG_LIBTOOL
dnl ---------------------------------------------------------------------------
dnl Qt check
dnl ---------------------------------------------------------------------------
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']))
AC_MSG_CHECKING([for GDAL])
if test x"$with_gdal" = "xyes" -o x"$with_gdal" = "x" ; then
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_RESULT([yes])
elif test x"$with_gdal" = "xno" ; then
ac_gdalogr=no
AC_MSG_RESULT([no])
else
if test -x "$with_gdal/gdal-config" ; then
GDAL_CONFIG="$with_gdal/gdal-config"
AC_MSG_RESULT([yes])
else
AC_MSG_ERROR("Cannot find $with_gdal/gdal-config")
fi
fi
if test x"$ac_gdalogr" != "xno" ; then
AC_MSG_CHECKING([for OGR in GDAL])
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)
ac_gdalogr=yes
GDAL_LIB="`$GDAL_CONFIG --libs`"
GDAL_CFLAGS="`$GDAL_CONFIG --cflags`"
AC_SUBST(GDAL_LIB)
AC_SUBST(GDAL_CFLAGS)
fi
dnl ---------------------------------------------------------------------------
dnl PostgreSQL
dnl ---------------------------------------------------------------------------
AC_ARG_WITH(postgresql,
AC_HELP_STRING([--with-postgresql=path],
[PostgreSQL (PostGIS) Support (full path to pg_config)]))
AC_MSG_CHECKING([for PostgreSQL])
if test x"$with_postgresql" = "xyes" -o x"$with_postgresql" = "x" ; then
AC_MSG_RESULT([yes])
AC_PATH_PROG([PG_CONFIG], [pg_config], [no])
elif test x"$with_postgresql" = "xno" ; then
AC_MSG_RESULT([no])
PG_CONFIG=no
else
AC_MSG_RESULT([yes])
PG_CONFIG="$with_postgresql/pg_config"
fi
if test x"$PG_CONFIG" != "xno" ; then
PG_LIB="-L`$PG_CONFIG --libdir` -lpq"
PG_INC="`$PG_CONFIG --includedir`"
AC_MSG_CHECKING([for postgreSQL libs])
AC_MSG_RESULT([$PG_LIB])
AC_DEFINE([HAVE_POSTGRESQL],1,
[Define to 1 if PostgreSQL is available])
ac_postgresql="yes"
else
ac_postgresql="no"
fi
AC_SUBST(PG_INC)
AC_SUBST(PG_LIB)
AM_CONDITIONAL([HAVE_POSTGRESQL], [test "$ac_postgresql" = "yes"])
dnl ---------------------------------------------------------------------------
dnl checking if gdal and/or postgresql are available
dnl ---------------------------------------------------------------------------
if test x"$ac_postgresql" = "xno" -a x"$ac_gdalogr" = "xno"; then
AC_MSG_ERROR("QGIS without GDAL(with OGR support) and PostgreSQL makes no sense!")
fi
dnl ---------------------------------------------------------------------------
dnl SPIT plugin
dnl ---------------------------------------------------------------------------
AC_ARG_ENABLE(spit,
AC_HELP_STRING([--disable-spit],
[disable Shapefile to PostgreSQL (PostGIS) import plugin (built by default with PostgreSQL support)]),
[ac_spit=$enableval], [ac_spit=yes])
AC_MSG_CHECKING([for SPIT])
if test x"$ac_spit" = "xyes"; then
if test x"$ac_postgresql" = "xyes" -a x"$ac_gdalogr" = "xyes"; then
AC_MSG_RESULT([yes])
else
ac_spit="no"
if test x"$ac_postgresql" = "xno" ; then
AC_MSG_RESULT([no (PostgreSQL not available)])
else
AC_MSG_RESULT([no (GDAL with OGR support not available)])
fi
fi
else
AC_MSG_RESULT([no])
fi
AM_CONDITIONAL([HAVE_SPIT], [test "$ac_spit" = "yes"])
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)
dnl ---------------------------------------------------------------------------
dnl Debugging
dnl ---------------------------------------------------------------------------
AC_ARG_ENABLE(debug,
AC_HELP_STRING([--enable-debug],
[Enable debuging messages [[default=no]]]),
[ac_debug=$enableval], [ac_debug=no])
AC_MSG_CHECKING([if debug statements should be sent to stdout/stderr])
if test x"$ac_debug" = "xno" ; then
DEBUG_QGIS=-DNO_DEBUG
AC_MSG_RESULT([no])
else
DEBUG_QGIS=-DQGISDEBUG
AC_MSG_RESULT([yes])
fi
AC_SUBST(DEBUG_QGIS)
#echo ${prefix}/lib
#ac_libdir=${prefix}/lib/$PACKAGE
#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
providers/delimitedtext/Makefile
plugins/Makefile
plugins/spit/Makefile
plugins/example/Makefile
plugins/maplayer/Makefile
plugins/geoprocessing/Makefile
doc/Makefile
doc/skin/Makefile
doc/skin/images/Makefile
doc/images/Makefile
doc/plugins/Makefile
doc/plugins/geoprocessing/Makefile
doc/plugins/geoprocessing/buffer/Makefile
doc/plugins/delimited_text/Makefile
qgis.spec
plugins/delimited_text/Makefile
])
AC_OUTPUT
dnl Output the configuration summary
echo ""
echo "=========================================="
echo "$PACKAGE $VERSION"
echo "------------------------------------------"
echo "GDAL/OGR : $ac_gdalogr"
echo "PostgreSQL : $ac_postgresql"
echo "SPIT : $ac_spit"
echo ""
echo "Debug : $ac_debug"
echo "Plugin dir : ${prefix}/lib/$PACKAGE"
echo ""
echo "The binary will be installed in $prefix/bin"
echo "------------------------------------------"
echo "Configure finished, type 'make' to build."