Import Upstream version 20180207
[hcoop/debian/mlton.git] / mlnlffigen / gen-cppcmd
CommitLineData
7f918cf1
CE
1#!/usr/bin/env bash
2
3set -e
4
5dir=`dirname "$0"`
6src=`cd "$dir/.." && pwd`
7eval `"$src/bin/platform"`
8
9output () {
10 echo "val defaultCppCmd = \"gcc $1 -E -U__GNUC__ %o %s > %t\""
11}
12
13# The flags here should match the flags used by mlton. At least the
14# 64 vs 32 bit flags have an effect on what the system headers look
15# like.
16case "$HOST_OS-$HOST_ARCH" in
17aix-*)
18 output "-maix64"
19 ;;
20*-ia64)
21 output "-mlp64"
22 ;;
23*-amd64)
24 output "-m64"
25 ;;
26*-x86)
27 output "-m32"
28 ;;
29*-sparc)
30 output "-m32"
31 ;;
32*)
33 output ""
34 ;;
35esac