QGIS/configure.in

472 lines
14 KiB
Plaintext
Raw Normal View History

dnl Process this file with autoconf to produce a configure script.
dnl configure.in,v 1.204 2004/10/21 17:27:35 mcoletti Exp
AC_INIT
dnl 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_PREREQ(2.52)
AC_CONFIG_HEADERS(qgsconfig.h)
dnl ---------------------------------------------------------------------------
dnl version number
dnl ---------------------------------------------------------------------------
MAJOR_VERSION=0
MINOR_VERSION=6
MICRO_VERSION=0
EXTRA_VERSION=20
if test $EXTRA_VERSION -eq 0; then
VERSION=${MAJOR_VERSION}.${MINOR_VERSION}.${MICRO_VERSION}
else
VERSION=${MAJOR_VERSION}.${MINOR_VERSION}.${MICRO_VERSION}devel${EXTRA_VERSION}
fi
dnl ---------------------------------------------------------------------------
dnl library interfase version number
dnl change when lib interface changes
dnl see http://www.gnu.org/software/libtool/manual.html#TOC32
dnl ---------------------------------------------------------------------------
INTERFACE_VERSION=0:1:0
AM_INIT_AUTOMAKE(qgis, ${VERSION})
AC_SUBST(MAJOR_VERSION)
AC_SUBST(MINOR_VERSION)
AC_SUBST(MICRO_VERSION)
AC_SUBST(EXTRA_VERSION)
AC_SUBST(INTERFACE_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 Check for Endian stuff to manage big endian anomalies
dnl ---------------------------------------------------------------------------
AC_C_BIGENDIAN
AC_CHECK_HEADERS([endian.h])
AC_CHECK_HEADERS([machine/endian.h])
dnl ---------------------------------------------------------------------------
dnl check lib64 environment
dnl ---------------------------------------------------------------------------
AQ_CHECK_LIB64
dnl ---------------------------------------------------------------------------
dnl Qt check
dnl ---------------------------------------------------------------------------
AQ_CHECK_QT
AM_CONDITIONAL([HAVE_QTMAC], [test x$QTDIR != x -a -f "$QTDIR/config.tests/mac/tst_mac_version"])
dnl ---------------------------------------------------------------------------
dnl GDAL/OGR
dnl ---------------------------------------------------------------------------
AQ_CHECK_GDAL
dnl ---------------------------------------------------------------------------
dnl GEOS
dnl ---------------------------------------------------------------------------
AQ_CHECK_GEOS
if test x"$ac_geos" = "xno"; then
AC_MSG_ERROR("GEOS is required and was not found")
fi
dnl ---------------------------------------------------------------------------
dnl PROJ
dnl ---------------------------------------------------------------------------
AC_ARG_WITH(projdir,
AC_HELP_STRING([--with-projdir=DIR],
[ Proj4 installation directory, e.g. '--with-projdir=/usr/local']),
[
AC_MSG_CHECKING([for Proj4 library in $with_projdir])
if test -d "$with_projdir/lib"; then
LDFLAGS="$LDFLAGS -L$with_projdir/lib"
CPPFLAGS="$CPPFLAGS -I$with_projdir/include"
AC_MSG_RESULT(["$with_projdir exists"])
AC_CHECK_HEADERS(proj_api.h,
[PROJ_INC="-I$with_projdir/include"],
[
AC_MSG_ERROR([*** Proj4 headers not found.])
])
AC_CHECK_LIB(proj,pj_is_latlong,
[
have_proj_lib=yes
PROJ_LIB="-L$with_projdir/lib -lproj"
],
[
AC_MSG_ERROR([*** Proj4 library not found.])
])
else
AC_MSG_ERROR([*** directory $with_projdir does not exist.])
fi
],
[
AC_CHECK_HEADERS(proj_api.h,[PROJ_INC=""],
[
AC_MSG_ERROR([*** Proj4 headers not found.])
])
]
AC_CHECK_LIB(proj,pj_is_latlong,
[
have_proj_lib=yes
PROJ_LIB="-lproj"
],
[
AC_MSG_ERROR([Proj4 is required and was not found.])
])
)
AC_SUBST(PROJ_INC)
AC_SUBST(PROJ_LIB)
dnl ---------------------------------------------------------------------------
dnl SQLITE
dnl ---------------------------------------------------------------------------
AC_ARG_WITH(sqlite3dir,
AC_HELP_STRING([--with-sqlite3dir=DIR],
[ sqlite3 installation directory, e.g. '--with-sqlite3=/usr/local']),
[
AC_MSG_CHECKING([for Sqlite3 library in $with_sqlite3dir])
if test -d "$with_sqlite3dir/lib"; then
LDFLAGS="$LDFLAGS -L$with_sqlite3dir/lib"
CPPFLAGS="$CPPFLAGS -I$with_sqlite3dir/include"
AC_MSG_RESULT(["$with_sqlite3dir exists"])
AC_CHECK_HEADERS(sqlite3.h,
[SQLITE3_INC="-I$with_sqlite3dir/include"],
[
AC_MSG_ERROR([*** Sqlite3 headers not found.])
])
AC_CHECK_LIB(sqlite3,sqlite3_open,
[
have_sqlite3_lib=yes
SQLITE3_LIB="-L$with_sqlite3dir/lib -lsqlite3"
],
[
AC_MSG_ERROR([*** Sqlite3 library not found.])
])
else
AC_MSG_ERROR([*** directory $with_sqlite3dir does not exist.])
fi
],
[
AC_CHECK_HEADERS(sqlite3.h,[SQLITE3_INC=""],
[
AC_MSG_ERROR([*** Sqlite3 headers not found.])
])
AC_CHECK_LIB(sqlite3,sqlite3_open,
[
have_sqlite3_lib=yes
SQLITE3_LIB="-lsqlite3"
],
[
AC_MSG_ERROR([*** Sqlite3 library not found.])
])
]
)
AC_SUBST(SQLITE3_INC)
AC_SUBST(SQLITE3_LIB)
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"
ac_postgresql_version=`$PG_CONFIG --version | sed -e 's#PostgreSQL ##'`
postgresql_version_string="(Version $ac_postgresql_version)"
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 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/grass57/dist.i686-pc-linux-gnu)]))
AC_MSG_CHECKING([for GRASS])
if test -n "$with_grass" -a x"$with_grass" != "xno"; then
# I don't know how to add library path to AC_CHECK_LIB()
if test ! -f "$GISLIB"; then
GISLIB=`ls $with_grass/${_lib}/libgrass_gis.dylib 2> /dev/null`
fi
if test ! -f "$GISLIB"; then
GISLIB=`ls $with_grass/${_lib}/libgrass_gis.so 2> /dev/null`
fi
if test ! -f "$GISLIB"; then
GISLIB=`ls $with_grass/${_lib}/libgrass_gis.a 2> /dev/null`
fi
if test ! -f "$GISLIB"; then
AC_MSG_ERROR( [GRASS library not found in $with_grass/${_lib}] )
fi
GRASS_LIB="-L$with_grass/${_lib} -lgrass_vect -lgrass_dig2 -lgrass_dbmiclient -lgrass_dbmibase -lgrass_shape -lgrass_dgl -lgrass_rtree -lgrass_gis -lgrass_datetime -lgrass_linkm -lgrass_form -lgrass_gproj"
GISINC=`ls $with_grass/include/gis.h`
if test ! -f "$GISINC"; then
AC_MSG_ERROR( [GRASS headers not found] )
fi
GRASS_BASE="$with_grass"
GRASS_INC="$with_grass/include/"
HAVE_GRASS=1
AC_MSG_RESULT([yes])
ac_grass="yes"
else
AC_MSG_RESULT([no])
ac_grass="no"
fi
AC_SUBST(GRASS_BASE)
AC_SUBST(HAVE_GRASS)
AC_SUBST(GRASS_LIB)
AC_SUBST(GRASS_INC)
AM_CONDITIONAL([HAVE_GRASS], [test "$ac_grass" = "yes"])
dnl ---------------------------------------------------------------------------
dnl GPX and GPS plugins
dnl ---------------------------------------------------------------------------
AC_ARG_ENABLE(gpx,
AC_HELP_STRING([--disable-gpx],
[Disable the GPX provider and the GPS plugin (built by default if libexpat is found)]),
[ac_gpx=$enableval], [ac_gpx=yes])
AC_MSG_CHECKING([GPX provider and GPS plugin should be installed (default: yes)])
AC_MSG_RESULT([$ac_gpx])
have_expat_lib=no
if [ test $ac_gpx = yes ] ; then
AC_CHECK_LIB(expat, XML_ParserCreate, have_expat_lib=yes)
fi
AM_CONDITIONAL([HAVE_EXPAT], [test "$have_expat_lib" = "yes"])
dnl ---------------------------------------------------------------------------
dnl Community registration plugin
dnl ---------------------------------------------------------------------------
AC_ARG_ENABLE(community,
AC_HELP_STRING([--enable-community],
[Enable the community registration plugin (broken!)]),
[ac_com=yes], [ac_com=no])
AC_MSG_CHECKING([community registration plugin should be installed (broken)])
AC_MSG_RESULT([$ac_com])
AM_CONDITIONAL([WITH_COMMUNITY], [test "$ac_com" = "yes"])
dnl ---------------------------------------------------------------------------
dnl Georeferencing plugin
dnl ---------------------------------------------------------------------------
AC_ARG_ENABLE(georef,
AC_HELP_STRING([--disable-georef],
[Disable the georeferencing plugin (built by default if libgsl is found)]),
[ac_georef=$enableval], [ac_georef=yes])
have_gsl_lib=no
if [ test $ac_georef = yes ] ; then
PKG_CHECK_MODULES(GSL, gsl >= 1.5.9, have_gsl_lib=yes, have_gsl_lib=no)
fi
AM_CONDITIONAL([HAVE_GSL], [test "$have_gsl_lib" = "yes"])
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
src/svg/Makefile
src/svg/biology/Makefile
src/svg/geometric/Makefile
src/svg/gpsicons/Makefile
src/svg/icon/Makefile
src/svg/north_arrows/Makefile
src/svg/symbol/Makefile
src/images/Makefile
src/images/north_arrows/Makefile
src/images/splash/Makefile
src/images/icons/Makefile
src/images/developers/Makefile
src/resources/Makefile
src/themes/Makefile
src/themes/default/Makefile
providers/Makefile
providers/ogr/Makefile
providers/postgres/Makefile
providers/delimitedtext/Makefile
providers/grass/Makefile
providers/gpx/Makefile
plugins/Makefile
plugins/community_reg_plugin/Makefile
plugins/copyright_label/Makefile
plugins/delimited_text/Makefile
plugins/example/Makefile
plugins/geoprocessing/Makefile
plugins/georeferencer/Makefile
plugins/gps_importer/Makefile
plugins/grid_maker/Makefile
plugins/grass/Makefile
plugins/grass/config/Makefile
plugins/grass/modules/Makefile
plugins/grass/themes/Makefile
plugins/grass/themes/default/Makefile
plugins/maplayer/Makefile
plugins/north_arrow/Makefile
plugins/scale_bar/Makefile
plugins/spit/Makefile
doc/Makefile
doc/install_guide/Makefile
doc/images/Makefile
doc/plugins/Makefile
doc/plugins/geoprocessing/Makefile
doc/plugins/geoprocessing/buffer/Makefile
doc/plugins/delimited_text/Makefile
tools/Makefile
tools/qgis_config/Makefile
widgets/Makefile
widgets/projectionselector/Makefile
designer_plugins/Makefile
i18n/Makefile
qgis.spec
])
AC_OUTPUT
dnl Output the configuration summary
echo ""
echo "=========================================="
echo "$PACKAGE $VERSION"
echo "------------------------------------------"
echo "GDAL/OGR : $ac_gdalogr (Version $ac_gdalogr_version)"
echo "GEOS : $ac_geos (Version $ac_geos_version)"
echo "PostgreSQL : $ac_postgresql $postgresql_version_string"
echo "GRASS : $ac_grass"
echo "SPIT : $ac_spit"
echo "Georeferencer : $have_gsl_lib"
echo "GPS/GPX : $have_expat_lib"
echo "PROJ4 : $have_proj_lib"
echo "SQLITE3 : $have_sqlite3_lib"
echo ""
echo "Debug : $ac_debug"
echo "Plugin dir : ${libdir}/$PACKAGE"
echo ""
echo "The binary will be installed in $prefix/bin"
echo ""
echo "The build is using Qt in $QTDIR"
echo "------------------------------------------"
echo "Configure finished, type 'make' to build."