updated for ubuntu 7.10 (gfortran 4.2)
authorGengbin Zheng <gzheng@illinois.edu>
Fri, 26 Oct 2007 20:50:17 +0000 (20:50 +0000)
committerGengbin Zheng <gzheng@illinois.edu>
Fri, 26 Oct 2007 20:50:17 +0000 (20:50 +0000)
src/arch/common/conv-mach-gfortran.sh

index a5e1717628ee9281966ba4bf1cc985f95d3690f1..bd6c844389bc6de1c54c98b32a18e3c717c6a6b3 100644 (file)
@@ -15,7 +15,7 @@ fi
 
 CMK_CF90=`which gfortran 2>/dev/null`
 CMK_FPP="/lib/cpp -P -CC"
-CMK_CF90="$CMK_CF90 $CMK_F90FLAGS -fPIC -fno-second-underscore -fdollar-ok"
+CMK_CF90="$CMK_CF90 $CMK_F90FLAGS -fPIC -fno-second-underscore -fdollar-ok" 
 CMK_CF90_FIXED="$CMK_CF90 -ffixed-form "
 # find f90 library:
 #it can be at gfortran-install/lib/gcc-lib/i686-pc-linux-gnu/4.0.1
@@ -28,11 +28,16 @@ then
   test `basename $F90DIR` = "$F90DIR" && F90DIR=`which gfortran 2> /dev/null`
 fi
 F90DIR="`dirname $F90DIR`"
-if test "$F90DIR" = '/usr/bin'
+
+# test some well-known place
+if test -f /usr/lib/libgfortran.a
 then
-F90LIBDIR=/usr/lib
+  F90LIBDIR=/usr/lib
 else
-F90LIBDIR=`cd $F90DIR/../lib/gcc/ia64-unknown-linux-gnu/4.1.0; pwd`
+  f95target=`gfortran -v 2>&1 | grep Target | cut -f2 -d' '`
+  f95version=`gfortran -v 2>&1 | grep 'gcc version' | cut -d' ' -f3`
+  F90LIBDIR=`cd $F90DIR/../lib/gcc/$f95target/$f95version/; pwd`
+  #F90LIBDIR=`cd $F90DIR/../lib/gcc/ia64-unknown-linux-gnu/4.1.0; pwd`
 fi
 CMK_F90LIBS="-L$F90LIBDIR -lgfortran -lgcc_eh"