summaryrefslogtreecommitdiffstats
path: root/funtools/saoconfig
blob: 0e4b40445f0c373b7bd0e1eed91871b42d807e0b (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
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
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
#!/bin/sh
set -x
rm -rf ./config.cache

if [ x"$1" = x ]; then
  name=`uname -n`
else
  if [ x"$1" = x"--" ]; then
    name=`uname -n`
  else
    name="$1"
  fi
  shift
fi

if [ x"$CFLAGS" = x ]; then
  CFLAGS="-g"
  export CFLAGS
fi
if [ x"$LDFLAGS" = x ]; then
  LDFLAGS="-g"
  export LDFLAGS
fi

GCCFLAGS="-W -Wall -Wno-implicit-int"
STRICTFLAGS="-pedantic -Wall -Wpointer-arith -Wcast-align -Wstrict-prototypes -Wredundant-decls -Wnested-externs -Wconversion -Wno-implicit-int"

CF="--config-cache"
BIT64="-m64 -mcpu=v9"
LARGEFILE="-D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64"
LARGEFILE64="-D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64"

# handle saord builds specially
if [ x$name = xsaord ]; then
  SAORDPREFIX=/soft/saord
  SAORDCC="gcc"
  SAORDCFLAGS="-O2"
  platform=`uname`
  case $platform in
  Darwin)
    USEDL="no"
    ;;
  SunOS)
    SAORDCC="cc"
    SAORDCFLAGS="-g"
    ;;
  *)
    USEDL="yes"
   ;;
  esac
fi

echo "configure for: " $name

case $name in
  cc)
  ./configure	$CF					\
		CC=cc CFLAGS="$CFLAGS" $*
  ;;

  gcc)
  ./configure	$CF					\
		CC=gcc CFLAGS="$CFLAGS $GCCFLAGS" $*
  ;;

  strict)
  ./configure	$CF					\
		CC=gcc CFLAGS="$CFLAGS $STRICTFLAGS" $*
  ;;

# large file support
  large)
  ./configure	$CF 							\
		--without-tcl 						\
	  	--with-filter-cc=gcc					\
		--prefix=${HOME}					\
		CC=gcc CFLAGS="$CFLAGS $GCCFLAGS $LARGEFILE"		\
      		$*
  ;;

# Solaris 64bit support
  64bit)
  ./configure	$CF 							\
		--without-tcl 						\
	  	--with-filter-cc=gcc					\
      		--with-filter-cflags="$BIT64"				\
		--prefix=${HOME}					\
		CC=gcc CFLAGS="$CFLAGS $GCCFLAGS $BIT64 LARGEFILE64"	\
      		LDFLAGS="-g $BIT64 -L/usr/lib/sparcv9" $*
  ;;

# Solaris 64bit and largefile support
  large64)
  ./configure	$CF 							\
		--without-tcl 						\
	  	--with-filter-cc=gcc					\
      		--with-filter-cflags="$BIT64"				\
		--prefix=${HOME}					\
		CC=gcc CFLAGS="$CFLAGS $GCCFLAGS $BIT64 $LARGEFILE"	\
      		LDFLAGS="-g $BIT64 -L/usr/lib/sparcv9" $*
  ;;

  opt)
  ./configure 	$CF					\
		--prefix=${HOME}			\
      		--enable-dl=yes				\
  		CC=gcc CFLAGS="$CFLAGS $GCCFLAGS -O2"	\
		$*
  ;;

  dl)
  ./configure	$CF					\
		--enable-dl=yes CC=gcc CFLAGS="$CFLAGS $GCCFLAGS" $*
  ;;

  shared)
  ./configure 	$CF					\
      		--enable-shared=yes			\
  		CC=gcc CFLAGS="$CFLAGS $GCCFLAGS"	\
		$*
  ;;

  shlib)
  ./configure 	$CF					\
      		--enable-shared=link			\
  		CC=gcc CFLAGS="$CFLAGS $GCCFLAGS"	\
		$*
  ;;

  shdl)
  ./configure 	$CF					\
      		--enable-shared=link			\
      		--enable-dl=yes				\
  		CC=gcc CFLAGS="$CFLAGS $GCCFLAGS"	\
		$*
  ;;

  mainlib)
  ./configure 	$CF					\
      		--enable-mainlib=yes			\
  		CC=gcc CFLAGS="$CFLAGS $GCCFLAGS"	\
		$*
  ;;

  shmainlib)
  ./configure 	$CF					\
      		--enable-shared=yes			\
      		--enable-mainlib=yes			\
  		CC=gcc CFLAGS="$CFLAGS $GCCFLAGS"	\
		$*
  ;;

  noansi)
  ./configure	$CF					\
		CC=gcc CFLAGS="$CFLAGS $GCCFLAGS -DNO_ANSI_FUNC" $*
  ;;

  saord*)
  ./configure 	$CF					\
		--prefix=$SAORDPREFIX			\
      		--enable-dl="$USEDL"			\
      		--with-filter-cflags="$SAORDCFLAGS"	\
      		CC=$SAORDCC CFLAGS="$CFLAGS $SAORDCFLAGS"	\
 		$*
  ;;

  bokhara*)
  ./configure 	$CF					\
		--prefix=$HOME				\
      		--enable-dl=yes				\
      		--with-filter-cflags="-O2"		\
  		CC=gcc CFLAGS="$CFLAGS $GCCFLAGS"	\
 		$*
  ;;

  cfa208*|moscow*)
  ./configure 	$CF					\
		--prefix=${HOME}			\
      		--enable-dl=yes				\
  		CC=gcc CFLAGS="$CFLAGS $GCCFLAGS"	\
		$*
  ;;

  akela*|baba*)
  ./configure 	$CF					\
      		--with-filter-cflags="-O2"		\
		--prefix=${HOME}			\
		CC=gcc CFLAGS="$CFLAGS $GCCFLAGS" $*
  ;;

  ds9*)
  ./configure 	$CF					\
		--prefix=${HOME}			\
      		--enable-dl=yes				\
      		--enable-fpu-double=yes			\
		CC=gcc CFLAGS="$CFLAGS $GCCFLAGS" $*
  ;;

  jove*|JOVE*)
  ./configure 	$CF					\
		--prefix=${HOME}			\
		CC=icc CFLAGS="$CFLAGS"  $*
  ;;

  apple*|APPLE*)
  ./configure 	$CF					\
  		--prefix=${HOME} $*
  ;;

  mred)
  ./configure 	$CF					\
		--prefix=${HOME}/pub/usr/local		\
		 CC=cc CFLAGS="$CFLAGS" $*
  ;;

  mocha*|Mocha*|luwak*|*Luwak*|decaf*|Decaf*|barista*|Barista*|knomad*|Knomad*)
  ./configure	$CF 							\
	  	--with-filter-cc=gcc					\
		--prefix=/usr/local					\
      		--with-filter-cflags="-O2"		\
		CC=gcc CFLAGS="$CFLAGS $GCCFLAGS $LARGEFILE -O2"	\
      		$*
  ;;

  voyager*|VOYAGER*)
  ./configure 	$CF					\
  		--enable-posix_spawn --prefix=${HOME}   \
		CC=gcc CFLAGS="$CFLAGS $GCCFLAGS" $*
  ;;

  *)
  ./configure 	$CF $*
  ;;

esac