~ubuntu-branches/ubuntu/utopic/gridengine/utopic

« back to all changes in this revision

Viewing changes to source/security/gss/aimk

  • Committer: Bazaar Package Importer
  • Author(s): Mark Hymers
  • Date: 2008-06-25 22:36:13 UTC
  • Revision ID: james.westby@ubuntu.com-20080625223613-tvd9xlhuoct9kyhm
Tags: upstream-6.2~beta2
ImportĀ upstreamĀ versionĀ 6.2~beta2

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#!/bin/csh -fb
 
2
#
 
3
#
 
4
# aimk - Architecture Independent MaKefile
 
5
#
 
6
# Originally aimk comes from the PVM distribution
 
7
#
 
8
#___INFO__MARK_BEGIN__
 
9
##########################################################################
 
10
#
 
11
#  The Contents of this file are made available subject to the terms of
 
12
#  the Sun Industry Standards Source License Version 1.2
 
13
#
 
14
#  Sun Microsystems Inc., March, 2001
 
15
#
 
16
#
 
17
#  Sun Industry Standards Source License Version 1.2
 
18
#  =================================================
 
19
#  The contents of this file are subject to the Sun Industry Standards
 
20
#  Source License Version 1.2 (the "License"); You may not use this file
 
21
#  except in compliance with the License. You may obtain a copy of the
 
22
#  License at http://gridengine.sunsource.net/Gridengine_SISSL_license.html
 
23
#
 
24
#  Software provided under this License is provided on an "AS IS" basis,
 
25
#  WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
 
26
#  WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
 
27
#  MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
 
28
#  See the License for the specific provisions governing your rights and
 
29
#  obligations concerning the Software.
 
30
#
 
31
#  The Initial Developer of the Original Code is: Sun Microsystems, Inc.
 
32
#
 
33
#  Copyright: 2001 by Sun Microsystems, Inc.
 
34
#
 
35
#  All Rights Reserved.
 
36
#
 
37
##########################################################################
 
38
#___INFO__MARK_END__
 
39
 
 
40
set noglob
 
41
 
 
42
if (! $?SGE_ROOT) then
 
43
   echo Please set your SGE_ROOT environment variable before calling aimk
 
44
   echo
 
45
   exit 1
 
46
endif
 
47
 
 
48
if (! $?KRB_HOME) then
 
49
   #set KRB_HOME = /krb5/
 
50
   set KRB_HOME = /usr/local/
 
51
endif
 
52
 
 
53
# common compiler and linker settings 
 
54
#
 
55
unsetenv LD_LIBRARY_PATH
 
56
set CC         = cc
 
57
set ARCH       = `$SGE_ROOT/util/arch`
 
58
set MAKE       = make
 
59
set MAKEFILE   = ../Makefile
 
60
set SDIR       = ".."
 
61
set CFLAGS     = ""
 
62
set LFLAGS     = ""
 
63
set LIBS       = ""
 
64
set DEBUG_FLAG = ""
 
65
set RANLIB     = echo
 
66
set STATIC     = "-static -nostartfiles"
 
67
set START_FILE = ""
 
68
 
 
69
unset nomk
 
70
set found
 
71
 
 
72
while ($#argv >= 1 && $?found)
 
73
 
 
74
   switch ("$argv[1]")
 
75
   case "-h":
 
76
   case "-help":
 
77
      echo "aimk options:"
 
78
      echo '     -nomk      dont call make - echo architecture and exit'
 
79
      echo '     -debug     compile with "-g" option'
 
80
      echo '     -cc        force usage of "cc" as compiler'
 
81
      echo '     -gcc       force usage of "gcc" as compiler'
 
82
      echo '     -gss       compile with the Kerberos GSSAPI libraries'
 
83
      exit 0
 
84
      breaksw
 
85
   case "-nomk":
 
86
      set nomk
 
87
      set argv = ($argv[2-])
 
88
      breaksw
 
89
   case "-debug":
 
90
      set argv  = ($argv[2-])
 
91
      set DEBUG_FLAG = "$DEBUG_FLAG -g"
 
92
      breaksw      
 
93
   case "-gcc"
 
94
      set argv     = ($argv[2-])
 
95
      set CC       = gcc
 
96
      breaksw
 
97
   case "-cc"
 
98
      set argv     = ($argv[2-])
 
99
      set CC       = cc
 
100
      breaksw
 
101
   case "-gss"
 
102
      set argv     = ($argv[2-])
 
103
      set CFLAGS  = "-DKERBEROS -I$KRB_HOME/include/gssapi -I$KRB_HOME/include $CFLAGS"
 
104
      set LFLAGS  = "-L$KRB_HOME/lib $LFLAGS"
 
105
      set LIBS    = "$LIBS -lgssapi_krb5 -lkrb5 -lk5crypto -lcom_err"
 
106
      breaksw
 
107
   case "-dce"
 
108
      set argv     = ($argv[2-])
 
109
      set CFLAGS  = "-DDCE -I/usr/include/dce $CFLAGS"
 
110
      set LIBS    = "$LIBS -ldce -threads"
 
111
      breaksw
 
112
   default:
 
113
      unset found
 
114
      breaksw
 
115
   endsw
 
116
end
 
117
 
 
118
set CTOR = ""
 
119
set DTOR = ""
 
120
 
 
121
switch ($ARCH)
 
122
 
 
123
case aix41:
 
124
case aix42:
 
125
   set CFLAGS = "-DAIX41 -DUSE_STDARG $DEBUG_FLAG $CFLAGS"
 
126
   set LFLAGS = "$DEBUG_FLAG $LFLAGS"
 
127
   set LIBS = "$LIBS"
 
128
   breaksw
 
129
 
 
130
case cray:
 
131
   set CFLAGS   = "-DCRAY $DEBUG_FLAG $CFLAGS"
 
132
   set LFLAGS   = "$DEBUG_FLAG $LFLAGS"
 
133
   set LIBS = "$LIBS"
 
134
   breaksw
 
135
 
 
136
case irix5:
 
137
   if ( $CC == gcc ) then
 
138
      set CFLAGS = "-Wall -Wstrict-prototypes -DIRIX5 $DEBUG_FLAG $CFLAGS"
 
139
   else
 
140
      set CFLAGS = "-DIRIX5 $DEBUG_FLAG $CFLAGS"
 
141
   endif
 
142
   set LFLAGS = "$DEBUG_FLAG $LFLAGS"
 
143
   set LIBS = "$LIBS"
 
144
   breaksw
 
145
 
 
146
case irix6*:
 
147
   set CFLAGS = "-DIRIX6 $DEBUG_FLAG $CFLAGS"
 
148
   set LFLAGS = "$DEBUG_FLAG $LFLAGS"
 
149
   set LIBS = "$LIBS"
 
150
   set DTOR = "/usr/lib/crt1.o"
 
151
   set DTOR = "/usr/lib/crtn.o"
 
152
        set STATIC   = "-nostartfiles"
 
153
   breaksw
 
154
 
 
155
case hp:
 
156
   if ( $CC == gcc ) then
 
157
      set CFLAGS = "-Wall -Wstrict-prototypes -DHPUX $DEBUG_FLAG $CFLAGS"
 
158
   else
 
159
      set CFLAGS = "-Aa -D_HPUX_SOURCE -DHPUX $DEBUG_FLAG $CFLAGS"
 
160
   endif
 
161
   set LFLAGS = "$DEBUG_FLAG $LFLAGS"
 
162
   set LIBS = "$LIBS"
 
163
   breaksw
 
164
 
 
165
case hp10:
 
166
   if ( $CC == gcc ) then
 
167
      set CFLAGS = "-O -Wall -Wstrict-prototypes -DHP10 $DEBUG_FLAG $CFLAGS"
 
168
   else
 
169
      set CFLAGS = "-Ae -O -DHP10 $DEBUG_FLAG $CFLAGS"
 
170
   endif
 
171
   set LFLAGS = "$DEBUG_FLAG $LFLAGS"
 
172
   set LIBS = "$LIBS"
 
173
   breaksw
 
174
 
 
175
 
 
176
case *linux:
 
177
   set CC = gcc
 
178
   set CFLAGS = "-O -Wall -DLINUX $DEBUG_FLAG $CFLAGS"
 
179
   set LFLAGS = "$DEBUG_FLAG $LFLAGS"
 
180
   set LIBS = "$LIBS"
 
181
   set START_FILE = "/usr/lib/crti.o /usr/lib/crtbegin.o"
 
182
   set CTOR = "/usr/lib/crti.o /usr/lib/crtbegin.o"
 
183
   set DTOR = "/usr/lib/crtend.o /usr/lib/crtn.o"
 
184
   breaksw
 
185
 
 
186
case osf:
 
187
case osf4:
 
188
case tru64:
 
189
   if ( $CC == gcc ) then
 
190
      set CFLAGS = "-Wall -Wstrict-prototypes -D_BSD -DALPHA $DEBUG_FLAG $CFLAGS"
 
191
   else
 
192
      set CFLAGS = "-std1 -warnprotos -D_BSD -DALPHA $DEBUG_FLAG $CFLAGS -Olimit 1500"
 
193
   endif
 
194
   set LFLAGS = "$DEBUG_FLAG $LFLAGS"
 
195
   set LIBS = "$LIBS"
 
196
   breaksw
 
197
 
 
198
case rs6000:
 
199
   if ( $CC == gcc ) then
 
200
      set CFLAGS = "-Wall -Wstrict-prototypes -DAIX32 $DEBUG_FLAG $CFLAGS"
 
201
   else
 
202
      set CFLAGS = "-DAIX32 -DUSE_STDARG $DEBUG_FLAG $CFLAGS"
 
203
   endif
 
204
   set LFLAGS = "$DEBUG_FLAG $LFLAGS"
 
205
   set LIBS = "$LIBS"
 
206
   breaksw
 
207
 
 
208
case solaris:
 
209
#   set CC   = "gcc"
 
210
   if ( $CC == gcc ) then
 
211
      set CFLAGS   = "-DSOLARIS -O -Wall $DEBUG_FLAG $CFLAGS"
 
212
   else
 
213
      set CFLAGS = "-std1 -DSOLARIS -O $DEBUG_FLAG $CFLAGS"
 
214
   endif
 
215
   set LIBS = "$LIBS -lresolv -lsocket -lnsl"         
 
216
        set STATIC   = "-nostartfiles"
 
217
   breaksw
 
218
 
 
219
case sun4:
 
220
   set CC = gcc
 
221
   set CFLAGS = "-Wall -Wstrict-prototypes -DSUN4 $DEBUG_FLAG $CFLAGS"
 
222
   set LFLAGS = "-static $DEBUG_FLAG $LFLAGS"
 
223
   set LIBS   = "$LIBS"
 
224
   set RANLIB = ranlib
 
225
   breaksw
 
226
 
 
227
default:
 
228
   echo "ERROR: Architecture not yet supported by CODINE-aimk"
 
229
   exit 1
 
230
endsw
 
231
 
 
232
#----------------------------------------
 
233
if ($?nomk) then
 
234
   echo $ARCH
 
235
   exit 0
 
236
endif
 
237
 
 
238
if ( ! -d $ARCH ) then
 
239
   echo "INFO: Architecture directory $ARCH doesn't exist. Making"
 
240
   mkdir $ARCH
 
241
endif
 
242
 
 
243
echo making in $ARCH/ for $ARCH
 
244
cd $ARCH
 
245
 
 
246
 
 
247
$MAKE -f $MAKEFILE.security "CC=$CC" "CFLAGS=$CFLAGS" "LFLAGS=$LFLAGS" \
 
248
      "SDIR=$SDIR" "LIBS=$LIBS" \
 
249
      "RANLIB=$RANLIB" "STATIC=$STATIC" "ARCH=$ARCH" \
 
250
      "START_FILE=$START_FILE" \
 
251
      "CTOR=$CTOR" "DTOR=$DTOR" $argv