1 # Process this file with autoconf to produce a configure script.
2 AC_INIT(fGIS, 0.0.2, dron@remotesensing.org)
4 AM_CONFIG_HEADER(include/config.h)
6 dnl Checks for programs.
13 # Checks for libraries.
14 # FIXME: Replace `main' with a function in `-lX11':
15 # AC_CHECK_LIB([X11], [main])
16 # FIXME: Replace `main' with a function in `-ldl':
17 # AC_CHECK_LIB([dl], [main])
18 # FIXME: Replace `main' with a function in `-lefence':
19 # AC_CHECK_LIB([efence], [main])
20 # FIXME: Replace `main' with a function in `-lm':
21 # AC_CHECK_LIB([m], [main])
22 # FIXME: Replace `main' with a function in `-lproj':
23 # AC_CHECK_LIB([proj], [main])
25 # Checks for header files.
29 AC_CHECK_HEADERS([limits.h malloc.h stddef.h stdlib.h string.h strings.h unistd.h])
31 # Checks for typedefs, structures, and compiler characteristics.
36 # Checks for library functions.
44 AC_CHECK_FUNCS([bzero floor ftruncate memmove memset munmap re_comp regcomp sqrt strchr strdup strrchr strtol])
46 dnl ---------------------------------------------------------------------------
47 dnl Handle global configuration file placement
48 dnl ---------------------------------------------------------------------------
50 dnl FIXME: won't works
51 dnl AC_DEFINE_DIR(FGIS_CONFDIR, "$sysconfdir", [Define this to the location of the global config file])
52 AC_SUBST_DIR(FGIS_CONFDIR,"$sysconfdir")
53 AC_DEFINE_UNQUOTED(FGIS_CONFDIR,"$FGIS_CONFDIR",[Define this to the location of the global config file])
54 AC_SUBST(FGIS_CONFDIR,$FGIS_CONFDIR)
56 dnl ---------------------------------------------------------------------------
57 dnl Handle placement of the engine module (fgis.so)
58 dnl ---------------------------------------------------------------------------
60 AC_SUBST_DIR(FGIS_LIBDIR,"$libdir")
61 AC_SUBST(FGIS_LIBDIR,$FGIS_LIBDIR)
63 dnl ---------------------------------------------------------------------------
64 dnl Handle placement of the fGIS Tcl/Tk modules
65 dnl ---------------------------------------------------------------------------
67 AC_SUBST_DIR(FGIS_SCRIPTDIR,"$libdir/fgis/tcl")
68 AC_SUBST(FGIS_SCRIPTDIR,$FGIS_SCRIPTDIR)
70 dnl ---------------------------------------------------------------------------
71 dnl Define path for EPPL7 library sources. Temporary hack, the whole this
72 dnl library will be removed soon
73 dnl ---------------------------------------------------------------------------
75 AC_SUBST(LIBEPP,../lib/libepp.la)
77 dnl ---------------------------------------------------------------------------
78 dnl Check for Tcl/Tk installation
79 dnl ---------------------------------------------------------------------------
84 ERROR: Can't find Tcl headers or library. See README for information
85 on how to obtain Tcl. If Tcl is installed, see INSTALL on how to tell
86 configure where Tcl is installed.
89 if test x"$no_tcl" = x"true" ; then
90 AC_MSG_ERROR([$tcl_missing_msg])
94 AC_SUBST(TCL_INC_DIR,$TCL_INC_DIR)
95 AC_SUBST(TCL_PACKAGE_PATH,$TCL_PACKAGE_PATH)
100 AC_SUBST(TK_INC_DIR,$TK_INC_DIR)
101 if [[[ $TK_VERSION < "8.4" ]]]; then
102 AC_DEFINE([TK_84PREV], , [Define this variable if your Tk version less then 8.4])
105 dnl ---------------------------------------------------------------------------
106 dnl Find the required GDAL libraries, and include files.
107 dnl ---------------------------------------------------------------------------
109 AC_ARG_WITH(gdal,[ --with-gdal[[=DIR]] path to GDAL build tree],,)
111 if test "$with_gdal" != "" ; then
113 echo Using requested GDAL_HOME of $GDAL_HOME
114 elif test "$GDAL_HOME" != "" ; then
115 echo Using predefined GDAL_HOME=$GDAL_HOME
116 elif test -d ../gdal ; then
117 GDAL_HOME=`pwd`/../gdal
118 echo Found local GDAL_HOME=$GDAL_HOME
120 AC_CHECK_LIB(gdal.1.1,GDALOpen,gdal_found=1,gdal_found=0)
123 fGIS requires GDAL 1.1, but libgdal.1.1.so was not found. Please download
124 and install it. See http://www.remotesensing.org/gdal/
127 if test "$gdal_found" != "1" ; then
128 AC_MSG_ERROR([$gdal_missing_msg])
132 fGIS requires GDAL 1.1, but gdal.h was not found. Please ensure GDAL,
133 and the development include files are installed, or that you run configure
134 with --with-gdal=path_to_gdal_build_tree.
135 See http://www.remotesensing.org/gdal/
138 AC_CHECK_HEADERS(gdal.h)
139 if test "$ac_cv_header_gdal_h" != "yes" ; then
140 AC_MSG_ERROR([$gdal_h_missing_msg])
142 GDAL_LIB="-lgdal.1.1"
143 LIBS="$GDAL_LIB $LIBS"
145 AC_SUBST(GDAL_INC,$GDAL_INC)
148 if test "$GDAL_HOME" != "" ; then
149 GDAL_LIB="-L$GDAL_HOME -lgdal.1.1"
150 LIBS="$GDAL_LIB $LIBS"
152 GDAL_INC="-I$GDAL_HOME/port -I$GDAL_HOME/core -I$GDAL_HOME/ogr"
154 if test ! -d $GDAL_HOME/core ; then
156 AC_MSG_ERROR([Unable to find $GDAL_HOME/core directory, are you sure a
157 regular GDAL build tree can be found at $GDAL_HOME?])
160 if test ! -f $GDAL_HOME/libgdal.1.1.so ; then
162 AC_MSG_ERROR([Unable to find $GDAL_HOME/libgdal.1.1.so, are you sure a
163 regular GDAL build tree can be found at $GDAL_HOME?])
166 AC_SUBST(GDAL_INC,$GDAL_INC)
169 AC_CONFIG_FILES([Makefile