4 smpicc="$prefix/bin/smpicc"
5 smpif2c="$prefix/bin/smpif2c"
9 list_set ARGS "-DMAIN__=user_main" "-Diargc_=smpi_process_argc" "-Dgetarg_=smpi_process_getarg"
10 list_set LINKARGS "-L@F2C_LIBRARY_PATH@" "-lf2c" "-lm"
13 while [ $# -gt 0 ]; do
18 SRCFILE="$(readlink -f ${ARG} 2>/dev/null)"
19 if [ -z "$SRCFILE" ] ; then
22 list_add SRCFILES "${SRCFILE}"
25 if [ "${ARG}" = "-c" ]; then
28 list_add ARGS "${ARG}"
32 list_add_not_empty ARGS "${LINKARGS}"
37 TMPFILE=$(mymktemp "${SRCFILE}" ".f")
38 CFILE="${TMPFILE%.f}.c"
42 cp "${SRCFILE}" "${TMPFILE}" \
43 && "$smpif2c" "${TMPFILE}" \
44 && "$smpicc" "$@" "${CFILE}" \
46 && rm -f "${TMPFILE}" \
49 # When the file is compiled with "-c" and no output file is specified with
50 # "-o", rename the output. FIXME: do it properly.
51 if [ -f "${CFILE%.c}.o" ]; then
52 mv "${CFILE%.c}.o" "${SRCFILE%.f}.o"
56 if [ -n "${SRCFILES}" ]; then
57 eval $(list_get SRCFILES)
58 for SRCFILE in "$@"; do