#! /bin/sh
+# Copyright (c) 2012-2014. The SimGrid Team.
+# All rights reserved.
+
+# This program is free software; you can redistribute it and/or modify it
+# under the terms of the license (GNU LGPL) which comes with this package.
+
+SIMGRID_VERSION="@SIMGRID_VERSION_STRING@"
+
F90=@GFORTRAN_EXE@
INCLUDEARGS="@includeflag@"
}
trap 'cleanup' EXIT
-list_set CMDLINE
+list_set CMDLINE "${F90}"
+list_add_not_empty CMDLINE "${FFLAGS}"
while [ $# -gt 0 ]; do
ARG="$1"
shift
SRCFILE="${TMPFILE}"
list_add CMDLINE "${SRCFILE}"
;;
+ '-version' | '--version' | '-v')
+ # -e is not recognised by MS-DOS...
+ echo -e $SIMGRID_VERSION
+ exit 0
+ ;;
*)
list_add CMDLINE "${ARG}"
;;
esac
done
-list_set CMDLINE "${FFLAGS}" "${CMDLINE}" ${INCLUDEARGS} ${CMAKE_LINKARGS} "${LINKARGS}"
-eval $(list_get CMDLINE)
+list_add_not_empty CMDLINE ${INCLUDEARGS}
+list_add_not_empty CMDLINE ${CMAKE_LINKARGS}
+list_add_not_empty CMDLINE "${LINKARGS}"
-"${F90}" "$@"
+eval $(list_get CMDLINE)
+"$@"