Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
when SMPI_PRETEND_CC is set, don't replace program xx by subroutine xx, we want to...
[simgrid.git] / src / smpi / smpiff.in
index 7ce663c..a642099 100644 (file)
@@ -40,13 +40,17 @@ trap 'cleanup' EXIT
 
 filter_and_compile_f77() {
     list_add TMPFILES "${TMPFILE}"
-    #replace "program main_name by subroutine user_main (and the end clause as well)"
-    if [ $TRACE_CALL_LOCATION -gt 0 ]; then
-      echo "#include \"@includedir@/smpi/smpi_extended_traces_fortran.h\"" > ${TMPFILE}
-      echo "#line 1 \"${ARG}\"" >> ${TMPFILE}
+    if [ "x${SMPI_PRETEND_CC}" = "x" ]; then
+      #replace "program main_name by subroutine user_main (and the end clause as well)"
+      if [ $TRACE_CALL_LOCATION -gt 0 ]; then
+        echo "#include \"@includedir@/smpi/smpi_extended_traces_fortran.h\"" > ${TMPFILE}
+        echo "#line 1 \"${ARG}\"" >> ${TMPFILE}
+      fi
+      sed 's/^[[:space:]]\{6\}[[:space:]]*\([eE][nN][dD] \)\{0,1\}[pP][rR][oO][gG][rR][aA][mM][^a-zA-Z0-9]*\([a-zA-Z0-9_]*\)/      \1subroutine user_main /g' "${ARG}" >> "${TMPFILE}"
+      SRCFILE="${TMPFILE}"
+    else
+      SRCFILE="${ARG}"
     fi
-    sed 's/^[[:space:]]\{6\}[[:space:]]*\([eE][nN][dD] \)\{0,1\}[pP][rR][oO][gG][rR][aA][mM][^a-zA-Z0-9]*\([a-zA-Z0-9_]*\)/      \1subroutine user_main /g' "${ARG}" >> "${TMPFILE}"
-    SRCFILE="${TMPFILE}"
     list_add CMDLINE "${SRCFILE}"
 }
 filter_and_compile_f90() {