aboutsummaryrefslogtreecommitdiff
path: root/src/configure.solaris.orig
blob: 5818ee9b9e87831311d4a08bf64acee39106bbc4 (plain) (blame)
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
86
87
88
89
90
91
92
93
94
95
96
97
98
#!/bin/sh

echo "***********************************"
echo "***** Preparing Makefiles *********"
echo "******** for Solaris **************"
echo "***********************************"

cp Makefile.Solaris Makefile
cp fuv/Makefile.Solaris fuv/Makefile
cp fes/Makefile.Solaris fes/Makefile
cp analysis/Makefile.Solaris analysis/Makefile
cp libcf/Makefile.Solaris libcf/Makefile
cp cal/jitter/Makefile.Solaris cal/jitter/Makefile
cp slalib/mk.sv slalib/mk

echo "***********************************"
echo "***** Configuring cfitsio *********"
echo "***********************************"

cd cfitsio
./configure
cd ..

echo "***********************************"
echo "***** Done configuring cfitsio ****"
echo "***********************************"

FC=""
for ac_prog in f77 g77 gfortran f90 
do
# Extract the first word of "$ac_prog", so it can be a program name with args.
  set dummy $ac_prog; ac_word=$2
  echo "checking for $ac_word..."  
  IFS="${IFS= 	}"; ac_save_ifs="$IFS"; IFS=":"
  ac_dummy="$PATH"
  for ac_dir in $ac_dummy; do
    test -z "$ac_dir" && ac_dir=.
    if test -f $ac_dir/$ac_word; then
      FC="$ac_prog"
      break
    fi
  done
  IFS="$ac_save_ifs"
  if test -n "$FC"; then
    echo "     yes"
  else
    echo "     no"
  fi
  test -n "$FC" && break
done
test -n "$FC" || FC="nope"

if test $FC = 'nope' ; then
  echo "Warning: No acceptable fortran 77 compiler was found."
  echo "Please install one either from the GNU compilers GCC, either from Sun Studio."
  echo "Read INSTALLING_CalFUSEv3.2.1 for details."
else
  FFLAGS="-fno-second-underscore -O -fPIC"
  if test $FC = 'f90' ; then
    for mk in Makefile analysis/Makefile cal/jitter/Makefile fes/Makefile
    do
      mv $mk ${mk}.sv
      sed -e "s/-lM77 -lF77/-lfui -lfsu/g" ${mk}.sv > $mk
    done 
    FFLAGS="-f77 -ftrap=%none -O -PIC"
  fi
  if test $FC = 'gfortran' ; then
    for mk in Makefile analysis/Makefile cal/jitter/Makefile fes/Makefile
    do
      mv $mk ${mk}.sv
      sed -e "s/-lM77 -lF77/-lgfortran/g" ${mk}.sv > $mk
    done  
  fi
  if test $FC = 'g77' ; then
    for mk in Makefile analysis/Makefile cal/jitter/Makefile fes/Makefile
    do
      mv $mk ${mk}.sv
      sed -e "s/-lM77 -lF77/-lg2c/g" ${mk}.sv > $mk
    done  
  fi
  if test $FC = 'f77' ; then
    if f77 2> /dev/null | grep -c f90 ; then
      for mk in Makefile analysis/Makefile cal/jitter/Makefile fes/Makefile
      do
        mv $mk ${mk}.sv
        sed -e "s/-lM77 -lF77/-lfui -lfsu/g" ${mk}.sv > $mk
      done  
    fi
  else
    sed -e "s/f77/${FC}/g" slalib/mk.sv > slalib/mk.sv2
    sed -e "s/FFLAGS='-O -PIC'/FFLAGS='${FFLAGS}'/g" slalib/mk.sv2 > slalib/mk
    rm -f slalib/mk.sv2
  fi
  echo
  echo "Type 'make clean' then 'make -e install'"
fi