X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/84402e8e2ee2a2d0bef25fdceb0a263ed8b471f6..a66cfa3e250bfd537fb32d32f71c44115beeb6f6:/src/smpi/smpif90.in diff --git a/src/smpi/smpif90.in b/src/smpi/smpif90.in index 859db13287..d89ff5e7f9 100644 --- a/src/smpi/smpif90.in +++ b/src/smpi/smpif90.in @@ -19,6 +19,13 @@ list_set FFLAGS @SMPI_Fortran_FLAGS@ list_set LINKARGS "-lsimgrid" @SMPI_Fortran_LIBS@ "-lm" if [ "x${SMPI_PRETEND_CC}" = "x" ]; then list_add LINKARGS "-shared" + if [ "x${SMPI_NO_UNDEFINED_CHECK}" = "x" ]; then + if [ "x@APPLE@" != "x1" ]; then + list_add LINKARGS "-Wl,-z,defs" + else + list_add LINKARGS "-Wl,-undefined,error" + fi + fi else echo "Warning: smpif90 pretends to be a regular compiler (SMPI_PRETEND_CC is set). Produced binaries will not be usable in SimGrid." fi @@ -34,8 +41,12 @@ trap 'cleanup' EXIT filter_and_compile() { list_add TMPFILES "${TMPFILE}" #replace "program main_name by subroutine user_main (and the end clause as well)" - sed 's/^\([[:space:]]*\)\([eE][nN][dD] \)\{0,1\}[pP][rR][oO][gG][rR][aA][mM][^a-zA-Z0-9]*\([a-zA-Z0-9_]*\)/\1\2subroutine user_main /g' "${ARG}" >> "${TMPFILE}" - SRCFILE="${TMPFILE}" + if [ "x${SMPI_PRETEND_CC}" = "x" ]; then + sed 's/^\([[:space:]]*\)\([eE][nN][dD] \)\{0,1\}[pP][rR][oO][gG][rR][aA][mM][^a-zA-Z0-9]*\([a-zA-Z0-9_]*\)/\1\2subroutine user_main /g' "${ARG}" >> "${TMPFILE}" + SRCFILE="${TMPFILE}" + else + SRCFILE="${ARG}" + fi list_add CMDLINE "${SRCFILE}" }