# Process this file with autoconf to produce a configure script.
AC_INIT(fGIS, 0.0.1, dron@remotesensing.org)
-# AC_CONFIG_HEADERS([config.h])
AM_INIT_AUTOMAKE
-# AC_CONFIG_SRCDIR([include/regex.h])
AM_CONFIG_HEADER(include/config.h)
dnl Checks for programs.
# AC_CHECK_LIB([dl], [main])
# FIXME: Replace `main' with a function in `-lefence':
# AC_CHECK_LIB([efence], [main])
-# FIXME: Replace `main' with a function in `-lepp':
-# AC_CHECK_LIB([epp], [main])
# FIXME: Replace `main' with a function in `-lm':
# AC_CHECK_LIB([m], [main])
# FIXME: Replace `main' with a function in `-lproj':
AC_FUNC_VPRINTF
AC_CHECK_FUNCS([bzero floor ftruncate memmove memset munmap re_comp regcomp sqrt strchr strdup strrchr strtol])
-AC_DEFINE_UNQUOTED(FGIS_CONFIG, "$sysconfdir", [Define this to the location of the global config file])
+dnl ---------------------------------------------------------------------------
+dnl Handle global configuration file placement
+dnl ---------------------------------------------------------------------------
+
+dnl FIXME: won't works
+dnl AC_DEFINE_DIR(FGIS_CONFDIR, "$sysconfdir", [Define this to the location of the global config file])
+AC_SUBST_DIR(FGIS_CONFDIR,"$sysconfdir")
+AC_DEFINE_UNQUOTED(FGIS_CONFDIR,"$FGIS_CONFDIR",[Define this to the location of the global config file])
+AC_SUBST(FGIS_CONFDIR,$FGIS_CONFDIR)
dnl ---------------------------------------------------------------------------
-dnl Check for Tcl/Tk installation
+dnl Handle placement of the engine module (fgis.so)
dnl ---------------------------------------------------------------------------
-AC_ARG_WITH(tcl,[ --with-tcl[=ARG] Include Tcl support (ARG=yes or path)],,)
-if test "$with_tcl" = "yes" -o "$with_tcl" = "" ; then
+AC_SUBST_DIR(FGIS_LIBDIR,"$libdir")
+AC_SUBST(FGIS_LIBDIR,$FGIS_LIBDIR)
+
+dnl ---------------------------------------------------------------------------
+dnl Handle placement of the fGIS Tcl/Tk modules
+dnl ---------------------------------------------------------------------------
- AC_CHECK_LIB(tcl8.3,Tcl_CreateCommand,HAVE_TCL83=yes,HAVE_TCL83=no,$LIBS)
+AC_SUBST_DIR(FGIS_SCRIPTDIR,"$libdir/fgis/tcl")
+AC_SUBST(FGIS_SCRIPTDIR,$FGIS_SCRIPTDIR)
- if test "HAVE_TCL83"="yes"; then
+dnl ---------------------------------------------------------------------------
+dnl Define path for EPPL7 library sources. Temporary hack, the whole this
+dnl library will be removed soon
+dnl ---------------------------------------------------------------------------
- if test -r /usr/include/tcl8.3/tcl.h ; then
-
- LIBS="-ltcl8.3 $LIBS"
- TCL_INCLUDE="-I/usr/include/tcl8.3"
- echo "using Tcl 8.3"
-
- fi
+AC_SUBST(LIBEPP,../lib/libepp.la)
- fi
+dnl ---------------------------------------------------------------------------
+dnl Check for Tcl/Tk installation
+dnl ---------------------------------------------------------------------------
+CY_AC_PATH_TCLH
+if test x"$no_tcl" = x"true" ; then
+ echo " ERROR: Can't find Tcl headers or library."
+ echo " See README for information on how to obtain Tcl."
+ echo " If Tcl is installed, see INSTALL on how to tell"
+ echo " configure where Tcl is installed."
+ exit 1
fi
+CY_AC_PATH_TCLCONFIG
+CY_AC_LOAD_TCLCONFIG
+AC_SUBST(TCL_INC_DIR,$TCL_INC_DIR)
+AC_SUBST(TCL_PACKAGE_PATH,$TCL_PACKAGE_PATH)
-AC_SUBST(TCL_INCLUDE,$TCL_INCLUDE)
+CY_AC_PATH_TKH
+CY_AC_PATH_TKCONFIG
+CY_AC_LOAD_TKCONFIG
+AC_SUBST(TK_INC_DIR,$TK_INC_DIR)
+if [[[ $TK_VERSION < "8.4" ]]]; then
+ AC_DEFINE([TK_84PREV], , [Define this variable if your Tk version less then 8.4])
+fi
AC_CONFIG_FILES([Makefile
+ etc/Makefile
+ etc/fgis.rc
dll/Makefile
epu/Makefile
include/Makefile
- tcl/Makefile])
+ lib/Makefile
+ tcl/Makefile
+ tcl/pkgIndex.tcl])
AC_OUTPUT
+