Menu

[r8100]: / trunk / toolkits / basemap / geos-3.1.1 / configure.in  Maximize  Restore  History

Download this file

361 lines (308 with data), 10.9 kB

dnl $Id: configure.in 2573 2009-06-10 16:17:46Z pramsey $
dnl
dnl configure.in - autoconf input template to produce ./configure script
dnl
dnl version 2.52 is required for Cygwin libtool support
AC_PREREQ([2.52])

dnl local vars to hold user's preferences --------------------------------
AC_INIT([source/headers/geos.h])
AC_CANONICAL_SYSTEM

AC_CONFIG_MACRO_DIR([macros])

dnl -- JTS_PORT: the version of JTS this release is bound to
JTS_PORT=1.7.1

dnl -- Version info for the CAPI
CAPI_INTERFACE_CURRENT=7
CAPI_INTERFACE_REVISION=0
CAPI_INTERFACE_AGE=6

dnl
dnl -- Release versions / C++ library SONAME will use these
dnl -- encoding ABI break at every release
dnl
VERSION_MAJOR=3
VERSION_MINOR=1
VERSION_PATCH=1
VERSION="$VERSION_MAJOR.$VERSION_MINOR.$VERSION_PATCH"

dnl CAPI_VERSION_MAJOR=$(($CAPI_INTERFACE_CURRENT-$CAPI_INTERFACE_AGE))
dnl the following should be more portable
CAPI_VERSION_MAJOR=`expr $CAPI_INTERFACE_CURRENT - $CAPI_INTERFACE_AGE`
CAPI_VERSION_MINOR=$CAPI_INTERFACE_AGE
CAPI_VERSION_PATCH=$CAPI_INTERFACE_REVISION
CAPI_VERSION="$CAPI_VERSION_MAJOR.$CAPI_VERSION_MINOR.$CAPI_VERSION_PATCH"

AM_INIT_AUTOMAKE([geos], [$VERSION], [no-define])
AM_CONFIG_HEADER([source/headers/config.h])
AM_CONFIG_HEADER([source/headers/geos/platform.h])
AC_PROG_CC

dnl use libtool ----------------------------------------------------------
AC_LIBTOOL_DLOPEN
AC_LIBTOOL_WIN32_DLL
AC_PROG_LIBTOOL

dnl check for programs ----------------------------------------------------
AC_PROG_CXX
AC_ISC_POSIX
AC_PROG_INSTALL
AC_PROG_MAKE_SET

dnl function checks ------------------------------------------------------
AC_FUNC_CLOSEDIR_VOID
AC_FUNC_MEMCMP
AC_FUNC_STRFTIME
AC_FUNC_VPRINTF
AC_FUNC_ALLOCA
AC_HEADER_DIRENT
AC_HEADER_STDC
AC_CHECK_HEADERS([memory.h])
AC_CHECK_HEADERS([unistd.h])
AC_CHECK_HEADERS([ieeefp.h])
AC_CHECK_HEADERS([sys/file.h])
AC_CHECK_HEADERS([sys/time.h])
AC_CHECK_FUNCS([strchr memcpy gettimeofday])
AC_HEADER_STAT
AC_STRUCT_TM
AC_TYPE_SIZE_T
AC_C_CONST

dnl --------------------------------------------------------------------
dnl - Check for inline and cassert settings
dnl --------------------------------------------------------------------


AC_ARG_ENABLE([inline], [  --disable-inline    Disable inlining],
	[case "${enableval}" in
		yes) enable_inline=true ;;
		no)  enable_inline=false ;;
		*) AC_MSG_ERROR(bad value ${enableval} for --enable-inline);;
	esac],
	[enable_inline=true]
)

AC_ARG_ENABLE([cassert], [  --disable-cassert   Disable assertion checking],
	[case "${enableval}" in
		yes) enable_cassert=true ;;
		no)  enable_cassert=false ;;
		*) AC_MSG_ERROR(bad value ${enableval} for --enable-cassert);;
	esac],
	[enable_cassert=true]
)

INLINE_FLAGS=
AC_SUBST(INLINE_FLAGS)
if test x"$enable_inline" = xtrue; then
	INLINE_FLAGS="-DGEOS_INLINE"
	CXXFLAGS="$CXXFLAGS $INLINE_FLAGS"
fi

if test x"$enable_cassert" = xfalse; then
	CXXFLAGS="$CXXFLAGS -DNDEBUG"
fi

dnl --------------------------------------------------------------------
dnl - Append default C++ and C flags 
dnl --------------------------------------------------------------------

# Set default CXXFLAGS and CFLAGS if not set by the user
# -pedantic: ISO does not support long long
# we add -Wno-long-long to avoid those messages
WARNFLAGS=""
AC_LIBTOOL_COMPILER_OPTION([if $compiler supports -pedantic], [dummy], [-pedantic], [], [WARNFLAGS="$WARNFLAGS -pedantic"], [])
AC_LIBTOOL_COMPILER_OPTION([if $compiler supports -Wall], [dummy], [-Wall], [], [WARNFLAGS="$WARNFLAGS -Wall"], [])
AC_LIBTOOL_COMPILER_OPTION([if $compiler supports -ansi], [dummy], [-ansi], [], [WARNFLAGS="$WARNFLAGS -ansi"], [])
AC_LIBTOOL_COMPILER_OPTION([if $compiler supports -Wno-long-long], [dummy], [-Wno-long-long], [], [WARNFLAGS="$WARNFLAGS -Wno-long-long"], [])
CXXFLAGS="${CXXFLAGS} ${WARNFLAGS}"
CFLAGS="${CFLAGS} ${WARNFLAGS}"

dnl --------------------------------------------------------------------
dnl - Look for a 64bit integer (do after CFLAGS is set)
dnl --------------------------------------------------------------------

dnl Find a working 64bit integer
PGAC_TYPE_64BIT_INT([int64_t])
if test x"$HAVE_INT64_T_64" = x"no" ; then
  PGAC_TYPE_64BIT_INT([long int])
  if test x"$HAVE_LONG_INT_64" = x"no" ; then
    PGAC_TYPE_64BIT_INT([long long int])
  fi
fi




dnl --------------------------------------------------------------------
dnl - check whether python is required for the build
dnl --------------------------------------------------------------------

AC_ARG_ENABLE([python], [  --enable-python    Enable build of python module],
	[case "${enableval}" in
		yes) use_python=true ;;
		no)  use_python=false ;;
		*) AC_MSG_ERROR(bad value ${enableval} for --enable-python) ;;
	esac],
	[use_python=false]
)


dnl --------------------------------------------------------------------
dnl - check whether ruby is required for the build
dnl --------------------------------------------------------------------

AC_ARG_ENABLE([ruby], [  --enable-ruby    Enable build of ruby module],
	[case "${enableval}" in
		yes) use_ruby=true ;;
		no)  use_ruby=false ;;
		*) AC_MSG_ERROR(bad value ${enableval} for --enable-ruby) ;;
	esac],
	[use_ruby=false]
)


dnl --------------------------------------------------------------------
dnl - check for swig if python or ruby are enabled
dnl --------------------------------------------------------------------

use_swig=false
if test x"$use_python" = xtrue || test x"$use_ruby" = xtrue; then
	AC_PROG_SWIG(1.3.28)
	if test x"$SWIG" != "x"; then
	    SWIG_ENABLE_CXX	
            AC_SUBST(SWIG)           
 
            use_swig=true 
	fi
fi
AM_CONDITIONAL(ENABLE_SWIG, [ test x"$use_swig" = xtrue ])


dnl --------------------------------------------------------------------
dnl - check for python if enabled
dnl --------------------------------------------------------------------

if test x"$use_python" = xtrue; then
	dnl Check for Python 
        AM_PATH_PYTHON	
        SWIG_PYTHON

	if test x"$PYTHON" = "x"; then
		use_python=false
	fi
	
	AC_SUBST(PYTHON)
	AC_SUBST(SWIG_PYTHON_CPPFLAGS)
	AC_SUBST(SWIG_PYTHON_OPT)
fi
AM_CONDITIONAL(ENABLE_PYTHON, [test x"$use_python" = xtrue])


dnl --------------------------------------------------------------------
dnl - check for ruby if enabled
dnl --------------------------------------------------------------------

if test x"$use_ruby" = xtrue; then
	dnl Check for Ruby 
	AC_RUBY_DEVEL

	if test x"$RUBY" = x; then
		use_ruby=false
	fi

fi
AM_CONDITIONAL(ENABLE_RUBY, [ test x"$use_ruby" = xtrue ])


dnl --------------------------------------------------------------------
dnl - check for boost 
dnl --------------------------------------------------------------------

dnl -- AX_BOOST(1.32)
dnl -- if test "x$ax_cv_boost_unit_test_framework" = "xyes"; then
dnl -- 	use_boost_utf=yes
dnl -- else
dnl -- 	use_boost_utf=no
dnl -- fi
dnl -- AM_CONDITIONAL(ENABLE_BOOST_UTF, [test "x$use_boost_utf" = "xyes"])

dnl things to substitute in output ----------------------------------------
AC_SUBST(VERSION)
AC_SUBST(VERSION_MAJOR)
AC_SUBST(VERSION_MINOR)
AC_SUBST(VERSION_PATCH)
AC_SUBST(INTERFACE_CURRENT)
AC_SUBST(INTERFACE_REVISION)
AC_SUBST(INTERFACE_AGE)
AC_SUBST(JTS_PORT)
AC_SUBST(CAPI_VERSION)
AC_SUBST(CAPI_VERSION_MAJOR)
AC_SUBST(CAPI_VERSION_MINOR)
AC_SUBST(CAPI_VERSION_PATCH)
AC_SUBST(CAPI_INTERFACE_CURRENT)
AC_SUBST(CAPI_INTERFACE_REVISION)
AC_SUBST(CAPI_INTERFACE_AGE)

dnl output stuff ----------------------------------------------------------

AC_OUTPUT([
	Makefile 
	build/Makefile
	build/msvc80/Makefile
	build/msvc80/geos_c_dll/Makefile
	build/msvc80/geos_lib/Makefile
	build/msvc80/geos_python/Makefile
	build/msvc80/geos_ruby/Makefile
	build/msvc80/geos_unit/Makefile
	build/msvc90/Makefile
	build/msvc90/geos_c_dll/Makefile
	build/msvc90/geos_lib/Makefile
	build/msvc90/geos_python/Makefile
	build/msvc90/geos_ruby/Makefile
	build/msvc90/geos_unit/Makefile
	capi/Makefile
	capi/geos_c.h
	doc/Doxyfile
	doc/Makefile
	macros/Makefile
	source/Makefile 
	source/algorithm/Makefile
	source/algorithm/locate/Makefile
	source/geom/Makefile
	source/geom/prep/Makefile
	source/geom/util/Makefile
	source/geomgraph/Makefile
	source/geomgraph/index/Makefile
	source/headers/Makefile
	source/headers/geos/Makefile
	source/headers/geos/algorithm/Makefile
	source/headers/geos/algorithm/locate/Makefile
	source/headers/geos/geom/Makefile
	source/headers/geos/geom/prep/Makefile
	source/headers/geos/geom/util/Makefile
	source/headers/geos/geomgraph/Makefile
	source/headers/geos/geomgraph/index/Makefile
	source/headers/geos/index/Makefile
	source/headers/geos/index/bintree/Makefile
	source/headers/geos/index/chain/Makefile
	source/headers/geos/index/intervalrtree/Makefile
	source/headers/geos/index/quadtree/Makefile
	source/headers/geos/index/strtree/Makefile
	source/headers/geos/index/sweepline/Makefile
	source/headers/geos/io/Makefile
	source/headers/geos/noding/Makefile
	source/headers/geos/noding/snapround/Makefile
	source/headers/geos/operation/Makefile
	source/headers/geos/operation/buffer/Makefile
	source/headers/geos/operation/distance/Makefile
	source/headers/geos/operation/linemerge/Makefile
	source/headers/geos/operation/overlay/Makefile
	source/headers/geos/operation/polygonize/Makefile
	source/headers/geos/operation/predicate/Makefile
	source/headers/geos/operation/relate/Makefile
	source/headers/geos/operation/union/Makefile
	source/headers/geos/operation/valid/Makefile
	source/headers/geos/planargraph/Makefile
	source/headers/geos/planargraph/algorithm/Makefile
	source/headers/geos/precision/Makefile
	source/headers/geos/simplify/Makefile
	source/headers/geos/util/Makefile
	source/headers/geos/version.h
	source/index/Makefile
	source/index/bintree/Makefile
	source/index/chain/Makefile
	source/index/intervalrtree/Makefile
	source/index/quadtree/Makefile
	source/index/strtree/Makefile
	source/index/sweepline/Makefile
	source/io/Makefile
	source/noding/Makefile
	source/noding/snapround/Makefile
	source/operation/Makefile
	source/operation/buffer/Makefile
	source/operation/distance/Makefile
	source/operation/linemerge/Makefile
	source/operation/overlay/Makefile
	source/operation/polygonize/Makefile
	source/operation/predicate/Makefile
	source/operation/relate/Makefile
	source/operation/union/Makefile
	source/operation/valid/Makefile
	source/planargraph/Makefile
	source/precision/Makefile
	source/simplify/Makefile
	source/util/Makefile
	swig/geos.i
	swig/Makefile
	swig/python/Makefile
	swig/python/tests/Makefile
	swig/ruby/Makefile
	swig/ruby/test/Makefile
	tests/Makefile
	tests/bigtest/Makefile
	tests/unit/Makefile
	tests/tut/Makefile
	tests/xmltester/Makefile
	tools/Makefile
	tools/geos-config
	])



dnl -- echo "---------------------------------------"
dnl -- echo "Boost UTF: $use_boost_utf"
echo "Swig: $use_swig"
echo "Python: $use_python"
echo "Ruby: $use_ruby"
dnl -- echo "---------------------------------------"