--- admin/gildas-env.sh.orig	2014-01-30 12:23:02.000000000 +0100
+++ admin/gildas-env.sh	2014-02-28 15:13:17.000000000 +0100
@@ -418,7 +418,7 @@
     fi
     #
     # Check availability of g++. This only has an impact on ATM2009
-    if \which g++ > /dev/null 2>&1; then
+    if \which @CXX@ > /dev/null 2>&1; then
         ATM2009_PRESENT=yes
     else
         gagenv_message "g++ not found in your \$PATH"
@@ -435,34 +435,34 @@
         NUMPY_PRESENT=no
         NUMERIC_PRESENT=no
         SQLITE3_PRESENT=no
-        if \which python > /dev/null 2>&1; then
+        if \which @PYTHON@ > /dev/null 2>&1; then
             # Check the version of python the user is currently using
-            if python -V 2>&1 > /dev/null 2>&1; then
-        	PY_VERS_FULL=`python -V 2>&1 | cut -d' ' -f2`
+            if @PYTHON@ -V 2>&1 > /dev/null 2>&1; then
+        	PY_VERS_FULL=`@PYTHON@ -V 2>&1 | cut -d' ' -f2`
         	PY_VERS=`echo $PY_VERS_FULL | sed "s%\([0-9]\.[0-9][0-9]*\).*%\1%"`
         	# Search for Python header and library. kernel/python/binding/setup.py
         	# does exactly the same, so this should be consistent
-        	PYTHON_INC_DIR=`python -c "import distutils.sysconfig; print(distutils.sysconfig.get_config_var('INCLUDEPY'))"`
+        	PYTHON_INC_DIR=`@PYTHON@ -c "import distutils.sysconfig; print(distutils.sysconfig.get_config_var('INCLUDEPY'))"`
         	if [ -e "$PYTHON_INC_DIR/Python.h" ]; then PYTHON_INC=yes; else PYTHON_INC=no; fi
-        	PYTHON_LIB_DIR=`python -c "import distutils.sysconfig; print(distutils.sysconfig.get_config_var('LIBDIR'))"`
+        	PYTHON_LIB_DIR=`@PYTHON@ -c "import distutils.sysconfig; print(distutils.sysconfig.get_config_var('LIBDIR'))"`
         	PYTHON_LIB=yes  # libpython name on the various supported systems is just
         	                # unpredictible. Can not check in advance if the linker will
         	                # find it or not.
         	#
         	# Now search for Numpy or Numeric
-        	if python -c "import numpy" > /dev/null 2>&1; then
+        	if @PYTHON@ -c "import numpy" > /dev/null 2>&1; then
         	    NUMPY_PRESENT=yes
-        	    NUMPY_INC_DIR=`python -c "import numpy; print(numpy.__path__[0] + '/core/include')"`
+        	    NUMPY_INC_DIR=`@PYTHON@ -c "import numpy; print(numpy.__path__[0] + '/core/include')"`
         	    if [ -e "$NUMPY_INC_DIR/numpy/arrayobject.h" ]; then
         		NUMPY_INC_PRESENT=yes
         	    else
         		NUMPY_INC_PRESENT=no
         	    fi
-        	elif  python -c "import Numeric"> /dev/null 2>&1; then
+        	elif  @PYTHON@ -c "import Numeric"> /dev/null 2>&1; then
         	    NUMERIC_PRESENT=yes
         	fi
         	# Search for sqlite3
-        	if python -c "import sqlite3" > /dev/null 2>&1; then
+        	if @PYTHON@ -c "import sqlite3" > /dev/null 2>&1; then
         	    SQLITE3_PRESENT=yes
         	fi
             fi
@@ -538,11 +538,11 @@
             ATM2003_PRESENT=yes
             ATM2003_LIB_DIR=$DIR
         fi
-        if file_present "liblapack." "${DIR}"; then
+        if file_present "libLAPACK." "${DIR}"; then
             LAPACK_PRESENT=yes
             LAPACK_LIB_DIR=$DIR
         fi
-        if file_present "libblas." "${DIR}"; then
+        if file_present "libBLAS." "${DIR}"; then
             BLAS_PRESENT=yes
             BLAS_LIB_DIR=$DIR
         fi
@@ -550,13 +550,13 @@
             SLATEC_PRESENT=yes
             SLATEC_LIB_DIR=$DIR
         fi
-        if file_present "libfftw3." "${DIR}"; then
-            FFTW3_PRESENT=yes
-            FFTW3_LIB_DIR=$DIR
-            if file_present "libfftw3f." "${DIR}"; then
-        	FFTW3F_PRESENT=yes
-            fi
-        fi
+#        if file_present "libfftw3." "${DIR}"; then
+#            FFTW3_PRESENT=yes
+#            FFTW3_LIB_DIR=$DIR
+#            if file_present "libfftw3f." "${DIR}"; then
+#        	FFTW3F_PRESENT=yes
+#            fi
+#        fi
         if file_present "libasdmStandalone." "${DIR}"; then
             SDM_PRESENT=yes
             if [ "$SDM_PRESENT" = "yes" ]; then
@@ -590,6 +590,8 @@
     XML_PRESENT="yes"
     #
     unset GAG_LIB_DEP_PATH GAG_INC_DEP_PATH
+    GAG_INC_DEP_PATH=$GAG_INC_DEP_PATH:@PREFIX@/include
+    GAG_LIB_DEP_PATH=$GAG_INC_DEP_PATH:@PREFIX@/lib
     #
     if [ "$X11_INC" = "yes" ]; then
         gagenv_message "Found X11 header  in $X11_INC_DIR"
