-
Notifications
You must be signed in to change notification settings - Fork 51
/
irafuser.csh
executable file
·216 lines (189 loc) · 6.36 KB
/
irafuser.csh
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
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
#!/bin/csh -f
#
# IRAF definitions for the UNIX/csh user. The additional variables iraf$ and
# home$ should be defined in the user's .login file.
set old_method = 0
if ($old_method == 1) then
setenv OS_MACH `uname -s | tr '[A-Z]' '[a-z]' | cut -c1-6`
if (`uname -m` == "x86_64") then
if ($OS_MACH == "darwin") then
setenv MACH darwin
setenv IRAFARCH darwin
else
setenv MACH linux64
setenv IRAFARCH linux64
endif
else if (-f /etc/redhat-release) then
setenv MACH redhat
else
setenv MACH `uname -s | tr '[A-Z]' '[a-z]'`
endif
if ($MACH == "darwin") then
# Let the IRAFARCH override the machine to support cross compilation.
if ($?IRAFARCH) then
if ("$IRAFARCH" == "macosx") then
setenv MACH macosx
else if ("$IRAFARCH" == "macintel") then
setenv MACH macintel
endif
else
if ("`uname -m`" == "i386") then
setenv MACH macosx
setenv IRAFARCH macosx
else if ("`uname -m`" == "x86_64") then
setenv MACH macintel
setenv IRAFARCH macintel
else
setenv MACH ipad
setenv IRAFARCH ipad
endif
endif
else if ($OS_MACH == "cygwin") then
setenv MACH cygwin
endif
else # old_method
set a = `$iraf/unix/hlib/irafarch.csh`
if ($status == 0) then
setenv MACH $a
setenv IRAFARCH $a
else
echo "Error: "$a
exit 1
endif
endif # old_method
setenv hostid unix
setenv host ${iraf}unix/
setenv hlib ${iraf}unix/hlib/
setenv hbin ${iraf}unix/bin.$MACH/
setenv tmp /tmp/
# Default to GCC for compilation.
setenv CC gcc
setenv F77 $hlib/f77.sh
setenv F2C /usr/bin/f2c
setenv RANLIB ranlib
switch ($MACH)
case freebsd:
setenv HSI_CF "-O -DBSD -DPOSIX -w -Wunused -m32"
setenv HSI_XF "-Inolibc -/DBSD -w -/Wunused -/m32"
setenv HSI_FF "-O -DBLD_KERNEL -m32"
setenv HSI_LF "-static -m32 -B/usr/lib32 -L/usr/lib32"
setenv HSI_F77LIBS ""
setenv HSI_LFLAGS ""
setenv HSI_OSLIBS "-lcompat"
set mkzflags = "'lflags=-z' -/static"
breaksw
case macosx:
setenv HSI_CF "-O -DMACOSX -w -Wunused -arch i386 -m32 -mmacosx-version-min=10.4"
setenv HSI_XF "-Inolibc -/DMACOSX -w -/Wunused -/m32 -/arch -//i386"
setenv HSI_FF "-O -arch i386 -m32 -DBLD_KERNEL -mmacosx-version-min=10.4"
setenv HSI_LF "-arch i386 -m32 -mmacosx-version-min=10.4"
setenv HSI_F77LIBS ""
setenv HSI_LFLAGS ""
setenv HSI_OSLIBS ""
set mkzflags = "'lflags=-z'"
breaksw
case macintel:
setenv HSI_CF "-O -DMACOSX -DMACINTEL -DMACH64 -w -Wunused -m64 -g"
setenv HSI_XF "-Inolibc -/DMACOSX -/DMACINTEL -w -/Wunused -/DMACH64 -/m64"
setenv HSI_FF "-O -m64 -DMACH64 -DBLD_KERNEL"
setenv HSI_LF "-m64 -DMACH64"
setenv HSI_F77LIBS ""
setenv HSI_LFLAGS ""
setenv HSI_OSLIBS ""
set mkzflags = "'lflags=-z'"
breaksw
case ipad:
setenv XC_CFLAGS "-I/var/include"
setenv HSI_CF "-O -I/var/include -DMACOSX -DMACINTEL -DIPAD -w -Wunused"
setenv HSI_XF "-Inolibc -/DMACOSX -/DMACINTEL -/DIPAD -w -/Wunused"
setenv HSI_FF "-O -DBLD_KERNEL"
setenv HSI_LF ""
setenv HSI_F77LIBS ""
setenv HSI_LFLAGS ""
setenv HSI_OSLIBS ""
set mkzflags = "'lflags=-z'"
breaksw
# Add ${iraf}unix/f2c to include since f2c on fedora has a different
# set of include definitions
case linux64:
setenv XC_CFLAGS "-I${iraf}unix/f2c"
setenv XC_FFLAGS "-I${iraf}unix/f2c"
setenv HSI_CF "-I${iraf}unix/f2c -g -O2 -I/usr/include -I${hlib}libc -DLINUX -DREDHAT -DPOSIX -DSYSV -DLINUX64 -DMACH64 -w -m64 -DNOLIBCNAMES -DHOST_F2C -DHOST_CURL -DHOST_EXPAT -DHOST_XMLRPC -DHOST_CFITSIO"
setenv HSI_XF "-I${iraf}unix/f2c -g -Inolibc -I${hlib}libc -w -/m64 -/Wunused"
setenv HSI_FF "-I${iraf}unix/f2c -g -m64 -DBLD_KERNEL"
setenv HSI_LF "-m64 "
setenv HSI_F77LIBS ""
setenv HSI_LFLAGS ""
setenv HSI_OSLIBS ""
set mkzflags = "'lflags=-Nxz -/Wl,-Bstatic'"
breaksw
case linux:
case redhat:
setenv HSI_CF "-g -O2 -I/usr/include -I${hlib}libc -DLINUX -DREDHAT -DPOSIX -DSYSV -w -m32 -Wunused -DHOST_F2C -DHOST_CURL -DHOST_EXPAT -DHOST_XMLRPC -DHOST_CFITSIO"
setenv HSI_XF "-Inolibc -I${hlib}libc -w -/Wunused -/m32"
setenv HSI_FF "-O -DBLD_KERNEL -m32"
setenv HSI_LF "-m32"
setenv HSI_F77LIBS ""
setenv HSI_LFLAGS ""
setenv HSI_OSLIBS ""
set mkzflags = "'lflags=-Nxz -/Wl,-Bstatic'"
breaksw
case sunos:
setenv HSI_CF "-O -DSOLARIS -DX86 -DPOSIX -DSYSV -w -Wunused"
setenv HSI_XF "-Inolibc -w -/Wunused"
setenv HSI_FF "-O"
#setenv HSI_LF "-t -Wl,-Bstatic"
#setenv HSI_LFLAGS "-t -Wl,-Bstatic"
#setenv HSI_OSLIBS \
# "-lsocket -lnsl -lintl -Wl,-Bdynamic -ldl -Wl,-Bstatic -lelf"
setenv HSI_LF "-t"
setenv HSI_F77LIBS ""
setenv HSI_LFLAGS "-t"
setenv HSI_OSLIBS "-lsocket -lnsl -lintl -ldl -lelf"
set mkzflags = "'lflags=-Nxz -/Wl,-Bstatic'"
breaksw
case cygwin:
setenv HSI_CF "-O -DCYGWIN -DLINUX -DREDHAT -DPOSIX -DSYSV -w -Wunused"
setenv HSI_XF "-Inolibc -w -/Wunused -/DCYGWIN"
setenv HSI_FF "-O"
#setenv HSI_LF "-Wl,-Bstatic"
setenv HSI_LF ""
setenv HSI_F77LIBS ""
setenv HSI_LFLAGS ""
setenv HSI_OSLIBS "${iraf}unix/bin.cygwin/libcompat.a"
set mkzflags = "'lflags=-Nxz -/Wl,-Bstatic'"
breaksw
default:
echo 'Warning in hlib$irafuser.csh: unknown platform '"$MACH"
exit 1
breaksw
endsw
# Prepend a user <iraf.h> file to the compile flags in case we don't
# install as root.
#
setenv HSI_CF "-I${HOME}/.iraf/ $HSI_CF"
setenv HSI_FF "-I${HOME}/.iraf/ $HSI_FF"
setenv HSI_LF "-I${HOME}/.iraf/ $HSI_LF"
setenv HSI_XF "-I${HOME}/.iraf/ $HSI_XF"
setenv XC_CFLAGS "-I${HOME}/.iraf/"
# The following determines whether or not the VOS is used for filename mapping.
if (-f ${iraf}lib/libsys.a) then
setenv HSI_LIBS\
"${hbin}libboot.a ${iraf}lib/libsys.a ${iraf}lib/libvops.a -lf2c ${hbin}libos.a"
else
setenv HSI_CF "$HSI_CF -DNOVOS"
setenv HSI_LIBS "${hbin}libboot.a ${hbin}libos.a"
endif
setenv HSI_LIBS "$HSI_LIBS $HSI_OSLIBS"
alias mkiraf ${hlib}mkiraf.csh
alias mkmlist ${hlib}mkmlist.csh
alias mkz ${hbin}mkpkg.e "$mkzflags"
alias edsym ${hbin}edsym.e
alias generic ${hbin}generic.e
alias mkpkg ${hbin}mkpkg.e
alias rmbin ${hbin}rmbin.e
alias rmfiles ${hbin}rmfiles.e
alias rtar ${hbin}rtar.e
alias wtar ${hbin}wtar.e
alias xc ${hbin}xc.e
alias xyacc ${hbin}xyacc.e