Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Throw unimplemented.
[simgrid.git] / src / smpi / smpicc.in
1 #! /bin/sh
2
3 CC=@CMAKE_C_COMPILER@
4
5 INCLUDEARGS="@includeflag@"
6 CMAKE_LINKARGS="-L@libdir@"
7
8 @SMPITOOLS_SH@
9
10 list_set CFLAGS
11 list_set LINKARGS
12 if [ "@WIN32@" != "1" ]; then
13     list_add CFLAGS "-Dmain=smpi_simulated_main_"
14     list_add LINKARGS "-lsimgrid"
15 else
16     list_add CFLAGS "-include" "@includedir@/smpi/smpi_main.h"
17     list_add LINKARGS "@libdir@\libsimgrid.dll"
18 fi
19
20 list_set CMDLINE "${CC}"
21 list_add_not_empty CMDLINE "${CFLAGS}"
22 while [ $# -gt 0 ]; do
23     ARG="$1"
24     shift
25     case "${ARG}" in
26         -c)
27             CMAKE_LINKARGS=""
28             LINKARGS=""
29             list_add CMDLINE "-c"
30             ;;
31         *.c)
32             SRCFILE="$(readlink -f ${ARG} 2>/dev/null)"
33             if [ -z "$SRCFILE" ] ; then
34                 SRCFILE="$ARG"
35             fi
36             list_add CMDLINE "${SRCFILE}"
37             ;;
38         *)
39             list_add CMDLINE "${ARG}"
40       ;;
41   esac
42 done
43
44 list_add_not_empty CMDLINE ${INCLUDEARGS}
45 list_add_not_empty CMDLINE ${CMAKE_LINKARGS}
46 list_add_not_empty CMDLINE "${LINKARGS}"
47
48 eval $(list_get CMDLINE)
49 "$@"