updated for supporting 64 bit.
authorGengbin Zheng <gzheng@illinois.edu>
Mon, 9 Jan 2006 05:15:05 +0000 (05:15 +0000)
committerGengbin Zheng <gzheng@illinois.edu>
Mon, 9 Jan 2006 05:15:05 +0000 (05:15 +0000)
src/arch/common/conv-mach-g95.sh

index 35cef0247053979f0483c8b1668824e77adc3bce..952bec864dbc640e44b9d95d0c0fd29ac6c16e82 100644 (file)
@@ -1,22 +1,36 @@
-# GNU f95
+# g95.org
 
 CMK_CC="$CMK_CC -DCMK_G95"
 CMK_CXX="$CMK_CXX -DCMK_G95"
 
+if test -n "$CMK_MACOSX64" 
+then
+CMK_F90FLAGS="$CMK_F90FLAGS -m64"
+fi
+
+if test -n "$CMK_MACOSX"
+then
+CMK_F90FLAGS="$CMK_F90FLAGS -fno-common"
+fi
+
 CMK_CF90=`which g95 2>/dev/null`
 CMK_FPP="/lib/cpp -P -CC"
-CMK_CF90="$CMK_CF90 -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 librarya:  
+# find f90 library:
 #it can be at g95-install/lib/gcc-lib/i686-pc-linux-gnu/4.0.1
 F90DIR=`which g95 2> /dev/null`
-if test -h "$F90DIR"
+#F90DIR=$HOME/g95-install/bin/g95
+readlinkcmd=`which readlink 2> /dev/null`
+if test -h "$F90DIR" && test -x "$readlinkcmd"
 then
   F90DIR=`readlink $F90DIR`
+  test `basename $F90DIR` = "$F90DIR" && F90DIR=`which g95 2> /dev/null`
 fi
-F90LIBDIR="`dirname $F90DIR`/../lib/*/*/*"
-F90LIBDIR=`cd $F90LIBDIR && pwd`
-CMK_F90LIBS="-L$F90LIBDIR -lf95 "
+F90DIR="`dirname $F90DIR`"
+F90LIBDIR=`cd $F90DIR/../lib/gcc-lib/*/*; pwd`
+CMK_F90LIBS="-L$F90LIBDIR -lf95 -lgcc_eh"
+
 CMK_MOD_NAME_ALLCAPS=
 CMK_MOD_EXT="mod"
 CMK_F90_USE_MODDIR=1