[GRASS-SVN] r30241 - in grass/branches/releasebranch_6_3: . include/Make

svn_grass at osgeo.org svn_grass at osgeo.org
Mon Feb 18 16:38:33 EST 2008


Author: martinl
Date: 2008-02-18 16:38:33 -0500 (Mon, 18 Feb 2008)
New Revision: 30241

Modified:
   grass/branches/releasebranch_6_3/configure.in
   grass/branches/releasebranch_6_3/include/Make/Platform.make.in
Log:
wxwidgets and python checks merged from trunk, #38

Modified: grass/branches/releasebranch_6_3/configure.in
===================================================================
--- grass/branches/releasebranch_6_3/configure.in	2008-02-18 20:52:12 UTC (rev 30240)
+++ grass/branches/releasebranch_6_3/configure.in	2008-02-18 21:38:33 UTC (rev 30241)
@@ -8,15 +8,16 @@
 # PURPOSE:  	This configure runs all the tests to determine what components
 #   	    	are installed on the current system. It also defines certain
 #   	    	configuration variables for compilation and installation.
-# COPYRIGHT:    (C) 2000,2004 by the GRASS Development Team
+# COPYRIGHT:    (C) 2000-2008 by the GRASS Development Team
 #
 #               This program is free software under the GNU General Public
 #   	    	License (>=v2). Read the file COPYING that comes with GRASS
 #   	    	for details.
 #
-# MANUAL:       http://www.gnu.org/manual/autoconf/html_mono/autoconf.html
+# MANUAL:       http://www.gnu.org/software/autoconf/manual/autoconf.html
 # Website for   config.guess, config.sub:
 #               http://savannah.gnu.org/cgi-bin/viewcvs/config/config/
+#               Note: use autoconf-2.13
 #############################################################################
 
 define([AC_CACHE_LOAD], )
@@ -191,7 +192,12 @@
 LOC_ARG_WITH(readline, Readline, no)
 LOC_ARG_WITH(opendwg, openDWG, no)
 LOC_ARG_WITH(curses, Curses, yes)
-LOC_ARG_WITH(python, PYTHON, no)
+AC_ARG_WITH(python,
+[  --with-python[=path/python-config] enable Python support (python-config with path, \
+e.g. '--with-python=/usr/bin/python2.5-config', default: no)],, with_python="no")
+AC_ARG_WITH(wxwidgets,
+[  --with-wxwidgets[=path/wx-config] enable wxWidgets support (wx-config with path, \
+e.g. '--with-wxwidgets=/usr/local/bin/wx-config', default: no)],, with_wxwidgets="no")
 
 # With includes and libs options
 
@@ -670,7 +676,6 @@
 
 if test "`basename xx/$with_gdal`" = "gdal-config" ; then
   GDAL_CONFIG="$with_gdal"
-  AC_MSG_RESULT(yes)
 fi
 
 if test "$with_gdal" = "no" ; then
@@ -1587,56 +1592,115 @@
 
 # Python check
 
-LOC_CHECK_USE(python, PYTHON, USE_PYTHON)
+AC_MSG_CHECKING(whether to use Python)
 
-if test -n "$USE_PYTHON"; then
+PYTHONINC=
+PYTHONCFLAGS=
+PYTHONLDFLAGS=
+USE_PYTHON=
 
-# check for Python executable 
-
-if test -z "$PYTHON_BIN"; then
-  AC_PATH_PROG(PYTHON_BIN, python)
-  if test -z "$PYTHON_BIN"; then
-    AC_PATH_PROG(PYTHON_BIN, python2.3)
-    if test -z "$PYTHON_BIN"; then
-      AC_PATH_PROG(PYTHON_BIN, python2.4)
-      if test -z "$PYTHON_BIN"; then
-         AC_MSG_ERROR(python binary not found in path)
-      fi
-    fi
+if test "$with_python" = "no" ; then
+  AC_MSG_RESULT(no)
+else
+  AC_MSG_RESULT(yes)
+  USE_PYTHON="1"
+  if test "$with_python" != "yes" ; then
+    PY_CONFIG="$with_python"
   fi
-fi
-AC_SUBST(PYTHON)
-PYTHON=`basename $PYTHON_BIN`
 
+  AC_PATH_PROG(PY_CONFIG, python-config, no)
 
-# check for Python executable
-if test -z "$PYTHON_BIN"; then
-  AC_PATH_PROG(PYTHON_BIN, python)
-  if test -z "$PYTHON_BIN"; then
-    AC_MSG_ERROR(python binary not found in path)
-  fi
-fi
+  if test "$PY_CONFIG" = "no" ; then
+    AC_MSG_ERROR([*** couldn't find python-config])
+ fi
 
-# find out python version
-AC_MSG_CHECKING(Python version)
-PYVERSION=`$PYTHON_BIN -c ['import sys; print sys.version[:3]'`]
-PYMAJVERSION=`$PYTHON_BIN -c ['import sys; print sys.version[:1]'`]
-PYMINVERSION=`$PYTHON_BIN -c ['import sys; print sys.version[2:3]'`]
-AC_MSG_RESULT($PYVERSION)
-AC_SUBST(PYVERSION)
+  # With Python includes directory 
 
-# make sure Python is version 2
-if test "$PYMAJVERSION" -lt "2" || \
-   (test "$PYMAJVERSION" -eq "2" && test "$PYMINVERSION" -lt "2"); then
-  AC_MSG_ERROR([This version of GRASS requires at least Python version 2.3.  
-The one you have seems to be $PYVERSION.  You can specify an alternate python 
-by using (for example) --with-python=/usr/bin/python2.3])
-fi
+  PYTHONINC=`"$PY_CONFIG" --includes`
+  LOC_CHECK_INCLUDES(Python.h,Python,$PYTHONINC) 
 
-fi
+  PYTHONCFLAGS=`"$PY_CONFIG" --cflags`
 
+  # With Python library directory
+
+  PYTHONLDFLAGS=`"$PY_CONFIG" --ldflags`
+
+fi # Done checking Python
+
+AC_SUBST(PYTHONINC)
+AC_SUBST(PYTHONCFLAGS)
+AC_SUBST(PYTHONLDFLAGS)
 AC_SUBST(USE_PYTHON)
 
+# Enable wxWidgets support (for wxGUI)
+
+AC_MSG_CHECKING(whether to use wxWidgets)
+
+WXVERSION=
+WXWIDGETSCXXFLAGS= 
+WXWIDGETSCPPFLAGS=  
+WXWIDGETSLIB=  
+USE_WXWIDGETS=
+
+if test "$with_wxwidgets" = "no" ; then
+  AC_MSG_RESULT(no)
+else
+  AC_MSG_RESULT(yes)
+  USE_WXWIDGETS="1"
+  if test "`basename $with_wxwidgets`" = "wx-config" ; then
+    WX_CONFIG="$with_wxwidgets"
+  fi
+
+  AC_PATH_PROG(WX_CONFIG, wx-config, no)
+
+  if test "$WX_CONFIG" = "no" ; then
+    AC_MSG_ERROR([*** couldn't find wx-config
+
+  	  	  wxWidgets must be installed on your system.
+  
+                  Please check that wx-config is in path, the directory
+                  where wxWidgets libraries are installed (returned by
+                  'wx-config --libs' or 'wx-config --static --libs' command)
+                  is in LD_LIBRARY_PATH or equivalent variable and
+                  wxWidgets version is 2.8.1 or above.])
+ fi
+
+ # Check wxWidgets version
+
+ REQWX="2.8.1"
+
+ AC_MSG_CHECKING([wxWidgets version])
+ if WXVERSION=`"$WX_CONFIG" --version`; then
+   AC_MSG_RESULT([$WXVERSION])
+ else
+   AC_MSG_RESULT([not found])
+   AC_MSG_ERROR([wxWidgets is required.])
+ fi
+ if test `expr "$WXVERSION" \< "$REQWX"` = 1 ; then
+   AC_MSG_ERROR([*** wxWidgets "$REQWX" or later is required.])
+ fi
+
+ # With wxWidgets includes directory 
+
+ WXWIDGETSCXXFLAGS=`"$WX_CONFIG" --cxxflags`
+ WXWIDGETSCPPFLAGS=`"$WX_CONFIG" --cppflags`
+
+ LOC_CHECK_INCLUDES(wx/wxprec.h,wxWidgets,$WXWIDGETSCPPFLAGS) 
+ LOC_CHECK_INCLUDES(wx/wxPython/pseudodc.h,wxWidgets,$WXWIDGETSCPPFLAGS) 
+
+ # With wxWidgets library directory 
+
+ WXWIDGETSLIB=`"$WX_CONFIG" --libs`
+fi # $USE_WXWIDGETS
+
+AC_SUBST(WXVERSION) 
+AC_SUBST(WXWIDGETSCXXFLAGS)
+AC_SUBST(WXWIDGETSCPPFLAGS) 
+AC_SUBST(WXWIDGETSLIB) 
+AC_SUBST(USE_WXWIDGETS) 
+
+# Done checking wxWidgets
+
 USE_TERMIO=
 AC_SUBST(USE_TERMIO)
 
@@ -1697,6 +1761,7 @@
 LOC_MSG_USE(Readline support,USE_READLINE)
 LOC_MSG_USE(SQLite support,USE_SQLITE)
 LOC_MSG_USE(Tcl/Tk support,USE_TCLTK)
+LOC_MSG_USE(wxWidgets support,USE_WXWIDGETS)
 LOC_MSG_USE(TIFF support,USE_TIFF)
 LOC_MSG_USE(X11 support,USE_X11)
 LOC_MSG_USE(MacOSX application,MACOSX_APP)

Modified: grass/branches/releasebranch_6_3/include/Make/Platform.make.in
===================================================================
--- grass/branches/releasebranch_6_3/include/Make/Platform.make.in	2008-02-18 20:52:12 UTC (rev 30240)
+++ grass/branches/releasebranch_6_3/include/Make/Platform.make.in	2008-02-18 21:38:33 UTC (rev 30241)
@@ -204,9 +204,18 @@
 USE_OPENDWG         = @USE_OPENDWG@
 
 #Python
-PYVERSION           = @PYVERSION@
+PYTHONINC           = @PYTHONINC@
+PYTHONCFLAGS        = @PYTHONCFLAGS@
+PYTHONLDFLAGS       = @PYTHONLDFLAGS@
 USE_PYTHON          = @USE_PYTHON@
 
+#wxWidgets
+WXVERSION           = @WXVERSION@
+WXWIDGETSCXXFLAGS   = @WXWIDGETSCXXFLAGS@
+WXWIDGETSCPPFLAGS   = @WXWIDGETSCPPFLAGS@
+WXWIDGETSLIB        = @WXWIDGETSLIB@
+USE_WXWIDGETS       = @USE_WXWIDGETS@
+
 #i18N
 HAVE_NLS            = @HAVE_NLS@
 



More information about the grass-commit mailing list