2005-01-24 11:00:04 +00:00
|
|
|
AC_INIT(README.postgis)
|
|
|
|
|
2005-04-18 14:46:48 +00:00
|
|
|
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`"
|
|
|
|
|
2005-01-26 08:18:46 +00:00
|
|
|
|
2005-04-14 11:23:30 +00:00
|
|
|
|
|
|
|
dnl
|
|
|
|
dnl Test for GEOS
|
|
|
|
dnl
|
2005-01-26 08:18:46 +00:00
|
|
|
|
2005-01-24 11:00:04 +00:00
|
|
|
AC_SUBST(USE_GEOS)
|
|
|
|
AC_SUBST(GEOS_DIR)
|
2005-04-14 11:23:30 +00:00
|
|
|
USE_GEOS=0
|
|
|
|
GEOS_DIR=
|
2005-01-24 11:00:04 +00:00
|
|
|
AC_ARG_WITH(geos,
|
2005-04-18 14:46:48 +00:00
|
|
|
[ --with-geos[[=ARG]] enable spatial predicates and operators using GEOS
|
|
|
|
[[ARG=path to geos-config]]],
|
2005-04-14 11:23:30 +00:00
|
|
|
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
|
2005-01-24 11:00:04 +00:00
|
|
|
)
|
2005-04-14 11:23:30 +00:00
|
|
|
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
|
2005-01-24 11:00:04 +00:00
|
|
|
|
|
|
|
AC_SUBST(USE_PROJ)
|
|
|
|
AC_SUBST(PROJ_DIR)
|
2005-04-14 11:23:30 +00:00
|
|
|
USE_PROJ=0
|
|
|
|
PROJ_DIR=
|
|
|
|
AC_PATH_PROG([PROJ], [proj])
|
|
|
|
if test -n "$PROJ"; then
|
|
|
|
USE_PROJ=1
|
|
|
|
PROJ_DIR=`dirname $PROJ`/..
|
2005-01-24 11:23:54 +00:00
|
|
|
fi
|
2005-01-24 11:00:04 +00:00
|
|
|
AC_ARG_WITH(proj,
|
2005-04-14 11:23:30 +00:00
|
|
|
[ --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
|
2005-01-24 11:00:04 +00:00
|
|
|
)
|
2005-04-14 11:23:30 +00:00
|
|
|
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
|
2005-01-24 11:00:04 +00:00
|
|
|
|
2005-04-14 11:23:30 +00:00
|
|
|
AC_SUBST(USE_JTS)
|
|
|
|
AC_SUBST(JTS_INCLUDES)
|
|
|
|
AC_SUBST(JTS_LIBDIR)
|
|
|
|
USE_JTS=0
|
|
|
|
JTS_INCLUDES=
|
|
|
|
JTS_INCLUDES=
|
|
|
|
AC_ARG_WITH(jts,
|
2005-04-18 14:46:48 +00:00
|
|
|
[ --with-jts[[=ARG]] use JTS for spatial predicates and operators
|
|
|
|
[[ARG=path to jts-config]]],
|
2005-04-14 11:23:30 +00:00
|
|
|
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`
|
2005-01-24 11:00:04 +00:00
|
|
|
fi
|
|
|
|
|
2005-04-18 14:46:48 +00:00
|
|
|
dnl
|
2005-04-14 11:23:30 +00:00
|
|
|
dnl Search flex and yacc
|
2005-04-18 14:46:48 +00:00
|
|
|
dnl
|
2005-04-14 11:23:30 +00:00
|
|
|
AC_SUBST(FLEX)
|
|
|
|
AC_PATH_PROG([FLEX], [flex])
|
2005-01-24 15:22:56 +00:00
|
|
|
if test -z "$FLEX"; then
|
|
|
|
AC_MSG_ERROR(Can't find 'flex');
|
|
|
|
fi
|
|
|
|
|
2005-04-14 11:23:30 +00:00
|
|
|
AC_SUBST(YACC)
|
|
|
|
AC_PATH_PROG([YACC], [yacc])
|
2005-01-24 15:22:56 +00:00
|
|
|
if test -z "$YACC"; then
|
|
|
|
AC_MSG_ERROR(Can't find 'yacc');
|
|
|
|
fi
|
|
|
|
|
2005-04-18 14:46:48 +00:00
|
|
|
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
|
|
|
|
|
2005-04-14 11:23:30 +00:00
|
|
|
|
|
|
|
dnl if test $USE_JTS -gt 0; then
|
|
|
|
dnl AC_MSG_RESULT([ GEOS disabled, using JTS.]);
|
|
|
|
dnl USE_GEOS=0
|
|
|
|
dnl fi
|
|
|
|
|
2005-04-18 14:46:48 +00:00
|
|
|
AC_OUTPUT(Makefile.config)
|
|
|
|
|
2005-04-14 11:23:30 +00:00
|
|
|
AC_MSG_RESULT([ ])
|
|
|
|
AC_MSG_RESULT([ SUMMARY])
|
2005-04-18 14:46:48 +00:00
|
|
|
AC_MSG_RESULT([ -------------------------------------------------------])
|
|
|
|
AC_MSG_RESULT([ ])
|
|
|
|
AC_MSG_RESULT([ PGSQL: $PGCONFIG])
|
2005-04-14 11:23:30 +00:00
|
|
|
|
|
|
|
if test $USE_JTS -gt 0; then
|
2005-04-18 14:46:48 +00:00
|
|
|
AC_MSG_RESULT([ JTS: includedir=$JTS_INCLUDES libdir=$JTS_LIBDIR])
|
2005-04-14 11:23:30 +00:00
|
|
|
fi
|
2005-01-24 11:00:04 +00:00
|
|
|
if test $USE_GEOS -gt 0; then
|
2005-04-18 14:46:48 +00:00
|
|
|
AC_MSG_RESULT([ GEOS: $GEOSCONFIG])
|
2005-01-24 11:00:04 +00:00
|
|
|
fi
|
|
|
|
if test $USE_PROJ -gt 0; then
|
2005-04-18 14:46:48 +00:00
|
|
|
AC_MSG_RESULT([ PROJ: dir=$PROJ_DIR])
|
2005-01-24 11:00:04 +00:00
|
|
|
fi
|
2005-04-14 11:23:30 +00:00
|
|
|
dnl AC_MSG_RESULT([ FLEX: path=$FLEX])
|
|
|
|
dnl AC_MSG_RESULT([ YACC: path=$YACC])
|
|
|
|
|
2005-04-18 14:46:48 +00:00
|
|
|
AC_MSG_RESULT([ ])
|
2005-04-19 09:20:47 +00:00
|
|
|
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])
|
2005-04-18 14:46:48 +00:00
|
|
|
|
|
|
|
AC_MSG_RESULT([ -------------------------------------------------------])
|
2005-04-14 11:23:30 +00:00
|
|
|
AC_MSG_RESULT([ ])
|
2005-01-24 15:22:56 +00:00
|
|
|
|