Changeset 325


Ignore:
Timestamp:
Jun 9, 2007 3:19:11 AM (13 years ago)
Author:
andreasw
Message:

added compile_f2c tool to compiler Fortran source with f2c and MSVC compiler; a few fixes to Cygwin

Location:
trunk
Files:
4 added
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/coin.m4

    r324 r325  
    1 # Copyright (C) 2006, 2007 International Business Machines..
     1# Copyright (C) 2006, 2007 International Business Machines.
    22# All Rights Reserved.
    33# This file is distributed under the Common Public License.
     
    782782# now that CPPFLAGS contains -mno-cygwin when it needs it. -- lh, 061214 --
    783783
     784# AW 070609: I restored the previous version, since otherwise the warnings
     785# still pop up for the cl compiler
     786
    784787AC_DEFUN([AC_COIN_CHECK_HEADER],
    785 [# if test x"$4" = x; then
    786  # hdr="#include <$1>"
    787  # else
    788   hdr="$4"
    789  # fi
    790 AC_CHECK_HEADERS([$1],[$2],[$3],[$4])
     788[if test x"$4" = x; then
     789  hdr="#include <$1>"
     790else
     791  hdr="$4"
     792fi
     793AC_CHECK_HEADERS([$1],[$2],[$3],[$hdr])
    791794]) # AC_COIN_CHECK_HEADER
    792795
     
    11341137            coin_dbg_fflags='-debug'
    11351138          ;;
     1139          compile_f2c*)
     1140            coin_opt_fflags='-MT -O2'
     1141            coin_add_fflags='-nologo -wd4996'
     1142            coin_dbg_fflags='-MTd'
     1143          ;;
    11361144        esac
    11371145        ;;
     
    12771285AC_LANG_PUSH([Fortran 77])
    12781286
     1287save_FLIBS="$FLIBS"
     1288
    12791289AC_F77_WRAPPERS
    12801290
    1281 # This is to correct a missing exclusion in autoconf 2.59
    1282 if test x"$FLIBS" != x; then
    1283   my_flibs=
    1284   for flag in $FLIBS; do
    1285     case $flag in
    1286       -lcrt*.o) ;;
    1287              *) my_flibs="$my_flibs $flag" ;;
    1288     esac
    1289   done
    1290   FLIBS="$my_flibs"
    1291 fi
    1292 
    1293 case $build in
    1294 # The following is a fix to define FLIBS for ifort on Windows
    1295    *-cygwin* | *-mingw*)
    1296      case "$F77" in
    1297        ifort* | */ifort* | IFORT* | */IFORT*)
     1291if test x"$save_FLIBS" != x; then
     1292  FLIBS="$save_FLIBS"
     1293else
     1294  # This is to correct a missing exclusion in autoconf 2.59
     1295  if test x"$FLIBS" != x; then
     1296    my_flibs=
     1297    for flag in $FLIBS; do
     1298      case $flag in
     1299        -lcrt*.o) ;;
     1300               *) my_flibs="$my_flibs $flag" ;;
     1301      esac
     1302    done
     1303    FLIBS="$my_flibs"
     1304  fi
     1305
     1306  case $build in
     1307  # The following is a fix to define FLIBS for ifort on Windows
     1308     *-cygwin* | *-mingw*)
     1309       case "$F77" in
     1310         ifort* | */ifort* | IFORT* | */IFORT*)
    12981311           FLIBS="-link libifcorert.lib $LIBS /NODEFAULTLIB:libc.lib";;
    1299      esac;;
    1300    *-hp-*)
    1301        FLIBS="$FLIBS -lm";;
    1302    *-ibm-*)
    1303        FLIBS=`echo $FLIBS | sed 's/-lc)/-lc/g'` ;;
    1304    *-linux-*)
    1305      case "$F77" in
    1306        pgf77* | */pgf77* | pgf90* | */pgf90*)
     1312         compile_f2c*)
     1313           FLIBS=`$F77 -FLIBS` ;;
     1314       esac;;
     1315     *-hp-*)
     1316         FLIBS="$FLIBS -lm";;
     1317     *-ibm-*)
     1318         FLIBS=`echo $FLIBS | sed 's/-lc)/-lc/g'` ;;
     1319     *-linux-*)
     1320       case "$F77" in
     1321         pgf77* | */pgf77* | pgf90* | */pgf90*)
    13071322# ask linker to go through the archives multiple times
    13081323# (the Fortran compiler seems to do that automatically...
    1309          FLIBS="-Wl,--start-group $FLIBS -Wl,--end-group" ;;
    1310      esac
    1311 esac
     1324           FLIBS="-Wl,--start-group $FLIBS -Wl,--end-group" ;;
     1325       esac
     1326  esac
     1327  ac_cv_f77_libs="$FLIBS"
     1328fi
     1329
     1330AC_LANG_POP([Fortran 77])
    13121331
    13131332]) # AC_COIN_F77_WRAPPERS
     
    13351354  *-cygwin* | *-mingw*)
    13361355     if test "$enable_doscompile" = msvc ; then
    1337        coin_f77_comps="ifort fl32"
     1356       coin_f77_comps="ifort fl32 compile_f2c"
    13381357     else
    13391358       coin_f77_comps="gfortran g77 ifort fl32"
     
    18031822            -e 's%lib /OUT:%lib -OUT:%' \
    18041823            -e "s%cygpath -w%$CYGPATH_W%" \
    1805             -e 's%$AR x \\$f_ex_an_ar_oldlib%bla=\\`lib -nologo -list \\$f_ex_an_ar_oldlib | xargs echo\\`; echo \\$bla; for i in \\$bla; do lib -nologo -extract:\\$i \\$f_ex_an_ar_oldlib; done%' \
     1824            -e 's%$AR x \\$f_ex_an_ar_oldlib%bla=\\`lib -nologo -list \\$f_ex_an_ar_oldlib | xargs echo | dos2unix\\`; echo \\$bla; for i in \\$bla; do lib -nologo -extract:\\$i \\$f_ex_an_ar_oldlib; done%' \
    18061825            -e 's/$AR t/lib -nologo -list/' \
    18071826            -e 's%f_ex_an_ar_oldlib="\($?*1*\)"%f_ex_an_ar_oldlib='\`"$CYGPATH_W"' \1`%' \
Note: See TracChangeset for help on using the changeset viewer.