postgis/configure.in

238 lines
5.1 KiB
Plaintext
Raw Normal View History

AC_INIT(README.postgis)
dnl AC_ARG_ENABLE(autoconf, [ --enable-autoconf really use autoconf],
dnl AC_MSG_RESULT(Using autoconf),
dnl AC_MSG_ERROR([
dnl
dnl Autoconf-based configuration is not widely tested.
dnl If you want to use it anyway specify --enable-autoconf.
dnl ])
dnl )
dnl
dnl Compilers
dnl
AC_PROG_CC
AC_PROG_CXX
dnl
dnl Search for pg_config and setup pgsql stuff
dnl
AC_SUBST(PGCONFIG)
PGCONFIG=
AC_ARG_WITH(pgsql,
[ --with-pgsql[[=ARG]] build for a specific pgsql version
[[ARG=path to pg_config]]],
if test "$with_pgsql" != "no" -a "$with_pgsql" != "yes"; then
if ! test -x "$with_pgsql"; then
AC_MSG_ERROR([$with_pgsql is not an executable file]);
fi
PGCONFIG="$with_pgsql"
fi
)
if test -z "$PGCONFIG"; then
AC_PATH_PROG([PGCONFIG], [pg_config])
fi
if test -z "$PGCONFIG"; then
AC_MSG_ERROR([PostgreSQL is required by PostGIS]);
fi
AC_SUBST(PGFEINCLUDES)
AC_SUBST(PGBEINCLUDES)
AC_SUBST(PGFELIBS)
AC_SUBST(MODULE_INSTALLDIR)
PGFEINCLUDES="-I`${PGCONFIG} --includedir`"
PGFELIBS="-L`${PGCONFIG} --libdir` -lpq"
PGBEINCLUDES="-I`${PGCONFIG} --includedir-server`"
MODULE_INSTALLDIR="`${PGCONFIG} --pkglibdir`"
dnl
dnl Test for GEOS
dnl
AC_SUBST(USE_GEOS)
AC_SUBST(GEOS_DIR)
USE_GEOS=0
GEOS_DIR=
AC_ARG_WITH(geos,
[ --with-geos[[=ARG]] enable spatial predicates and operators using GEOS
[[ARG=path to geos-config]]],
if test "$with_geos" != "no"; then
USE_GEOS=1
if test "$with_geos" != "yes"; then
if ! test -e "$with_geos"; then
AC_MSG_ERROR([ARG of --with-geos is not an (executable) file]);
else
GEOSCONFIG="$with_geos"
fi
fi
fi
)
if test $USE_GEOS -gt 0; then
if test -z "$GEOSCONFIG"; then
AC_PATH_PROG([GEOSCONFIG], [geos-config])
if test -z "$GEOSCONFIG"; then
AC_MSG_ERROR([Can't find geos-config]);
fi
fi
GEOS_DIR=`$GEOSCONFIG --prefix`
fi
AC_SUBST(USE_PROJ)
AC_SUBST(PROJ_DIR)
USE_PROJ=0
PROJ_DIR=
AC_PATH_PROG([PROJ], [proj])
if test -n "$PROJ"; then
USE_PROJ=1
PROJ_DIR=`dirname $PROJ`/..
fi
AC_ARG_WITH(proj,
[ --with-proj[[=DIR]] enable reprojection support],
if test "$with_proj" = "no"; then
USE_PROJ=0
else
if test "$with_proj" != "yes"; then
PROJ_DIR=$with_proj
fi
fi
)
if test $USE_PROJ -gt 0; then
if ! test -e $PROJ_DIR/include/projects.h; then
AC_MSG_ERROR([Can't find proj dir.]);
fi
fi
AC_SUBST(USE_JTS)
AC_SUBST(JTS_INCLUDES)
AC_SUBST(JTS_LIBDIR)
USE_JTS=0
JTS_INCLUDES=
JTS_INCLUDES=
AC_ARG_WITH(jts,
[ --with-jts[[=ARG]] use JTS for spatial predicates and operators
[[ARG=path to jts-config]]],
if test "$with_jts" != "no"; then
USE_JTS=1
if test "$with_jts" != "yes"; then
if ! test -e "$with_jts"; then
AC_MSG_ERROR([ARG of --with-jts is not an (executable) file]);
else
JTSCONFIG=$with_jts
fi
fi
fi
)
if test $USE_JTS -gt 0; then
if test -z "$JTSCONFIG"; then
AC_PATH_PROG([JTSCONFIG], [jts-config])
if test -z "$JTSCONFIG"; then
AC_MSG_ERROR([Can't find jts-config]);
fi
fi
JTS_INCLUDES=`$JTSCONFIG --includedir`
JTS_LIBDIR=`$JTSCONFIG --libdir`
fi
dnl
dnl Search flex and yacc
dnl
AC_SUBST(FLEX)
AC_PATH_PROG([FLEX], [flex])
if test -z "$FLEX"; then
AC_MSG_ERROR(Can't find 'flex');
fi
AC_SUBST(YACC)
AC_PATH_PROG([YACC], [yacc])
if test -z "$YACC"; then
AC_MSG_ERROR(Can't find 'yacc');
fi
dnl
dnl Find 'install'
dnl
AC_PATH_PROG([INSTALL], [install])
if test -z "$INSTALL"; then
AC_MSG_ERROR(Can't find 'install');
fi
dnl
dnl DL stuff
dnl
AC_SUBST(DLSUFFIX)
AC_SUBST(DLFLAGS)
DLSUFFIX=.so
DLFLAGS=-shared
AC_SUBST(docdir)
docdir='${prefix}/doc'
AC_ARG_WITH(docdir,
[ --with-docdir=DIR install the documentation in DIR [[PREFIX/doc]]],
if test "$with_docdir" = "yes"; then
AC_MSG_ERROR([option --with-docdir requires an argument])
fi
if test "$with_docdir" = "no"; then
docdir=""
else
docdir="$with_docdir"
fi
)
dnl
dnl Find 'html/docbook.xsl'
dnl
AC_SUBST(XSLBASE)
XSLBASE=
SEARCHPATH="
/usr/share/sgml/docbook/xsl-stylesheets
/usr/share/xml/docbook/stylesheet/nwalsh
"
for p in ${SEARCHPATH}; do
if test -r ${p}/html/docbook.xsl; then
XSLBASE=${p}
break
fi
done
dnl if test $USE_JTS -gt 0; then
dnl AC_MSG_RESULT([ GEOS disabled, using JTS.]);
dnl USE_GEOS=0
dnl fi
AC_OUTPUT(Makefile.config)
AC_MSG_RESULT([ ])
AC_MSG_RESULT([ SUMMARY])
AC_MSG_RESULT([ -------------------------------------------------------])
AC_MSG_RESULT([ ])
AC_MSG_RESULT([ PGSQL: $PGCONFIG])
if test $USE_JTS -gt 0; then
AC_MSG_RESULT([ JTS: includedir=$JTS_INCLUDES libdir=$JTS_LIBDIR])
fi
if test $USE_GEOS -gt 0; then
AC_MSG_RESULT([ GEOS: $GEOSCONFIG])
fi
if test $USE_PROJ -gt 0; then
AC_MSG_RESULT([ PROJ: dir=$PROJ_DIR])
fi
dnl AC_MSG_RESULT([ FLEX: path=$FLEX])
dnl AC_MSG_RESULT([ YACC: path=$YACC])
AC_MSG_RESULT([ ])
AC_MSG_RESULT([ PREFIX: $prefix])
AC_MSG_RESULT([ EXECPREFIX: $exec_prefix])
AC_MSG_RESULT([ DOC: $docdir/postgis])
AC_MSG_RESULT([ DATA: $datadir/postgis])
AC_MSG_RESULT([ MAN: $mandir])
AC_MSG_RESULT([ BIN: $bindir])
AC_MSG_RESULT([ EXT: $MODULE_INSTALLDIR])
AC_MSG_RESULT([ -------------------------------------------------------])
AC_MSG_RESULT([ ])