summaryrefslogtreecommitdiff
path: root/lib/make/known-architectures/irix
blob: e46e65d107b3da58966863fbb1aa31ea11ef4a22 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
#! /bin/sh
#  /*@@
#    @file      irix
#    @date      Thu Feb 25 12:20:53 1999
#    @author    Tom Goodale
#    @desc 
#   
#    @enddesc 
#    @version $Header: /mnt/data2/cvs2svn/cvs-repositories/Cactus/lib/make/known-architectures/irix,v 1.7 1999-07-05 14:10:26 allen Exp $
#  @@*/

# extract the CPU type from hinv output
# (assumes all processors are of equal type :-)
IRIX_CPU="`hinv -t cpu | tail -n 1 | sed 's/^[^R]*R\([01-9]*\).*$/\1/'`"

case $IRIX_CPU in
    10000)
    IRIX_BITS=64 
    ;;
    *)
    IRIX_BITS=32
    ;;
esac


case "$IRIX_BITS:$CC" in
    64:gcc)
    echo gcc can\'t compile 64 bit, changing to cc
    CC=cc
    CXX=CC
    ;;
esac

case "$IRIX_BITS:$CC" in
    64:cc)
    CFLAGS="$CFLAGS -O3 -64 -mips4 -r10000"
    CXXFLAGS="$CXXFLAGS -O3 -64 -mips4 -r10000"
    ;;
    32:cc)
    CFLAGS="$CFLAGS -O3 -n32 -mips3"
    CXXFLAGS="$CXXFLAGS -O3 -n32 -mips3"
    ;;
    *)
    ;;
esac

case "$IRIX_BITS" in
    64)
    F90FLAGS="$F90FLAGS -O3  \
	-OPT:roundoff=3:IEEE_arithmetic=3:const_copy_limit=100000 \
	-r10000 -TARG:proc=r10000 \
	-64 -mips4"
    F77FLAGS="$F90FLAGS" 
    ;;
    32)
    F90FLAGS="-O3  \
	    -OPT:roundoff=3:IEEE_arithmetic=3:fold_arith_limit=10000:const_copy_limit=100000 \
	    -n32 -mips3"
    F77FLAGS="$F90FLAGS" 
    ;;
    *)
    ;;
esac

case "$IRIX_BITS:$LD" in
    64:CC)
    LDFLAGS="$LDFLAGS -64 -Wl,\"-woff 84\",\"-woff 85\""
    ;;
    32:CC)
    LDFLAGS="$LDFLAGS -n32 -Wl,\"-woff 84\",\"-woff 85\""
    ;;
    *)
    ;;
esac

case $IRIX_BITS in
    64)
    LIBS="$LIBS malloc perfex fpe fortran ftn ftn90 m"
    ;;
    32)
    LIBS="$LIBS malloc fpe fortran ftn ftn90 m"
    ;;
    *)
    ;;
esac