Remove support for Solaris pre-8
[openafs.git] / src / cf / osconf.m4
1
2 AC_DEFUN([OPENAFS_OSCONF], [
3
4 dnl defaults, override in case below as needed
5 RXDEBUG="-DRXDEBUG"
6 SHLIB_SUFFIX="so"
7 CCOBJ="$CC"
8 MT_CC="$CC"
9 XLIBS="${LIB_AFSDB} ${XBSA_XLIBS} ${LIB_libintl}"
10 MT_LIBS='-lpthread ${XLIBS}'
11
12 dnl debugging and optimization flag defaults
13 dnl Note, these are all the defaults for if debug/optimize turned on, and
14 dnl the arch cases below do override as needed
15 KERN_DBG=-g
16 KERN_OPTMZ=-O
17 DBG=-g
18 OPTMZ=-O
19 LWP_DBG=-g
20 NO_STRIP_BIN=
21 LWP_OPTMZ=-O
22 PAM_DBG=-g
23 PAM_OPTMZ=
24
25 dnl standard programs
26 AC_PROG_RANLIB
27 AC_CHECK_PROGS(AS, as, [${am_missing_run}as])
28 AC_CHECK_PROGS(AR, ar, [${am_missing_run}ar])
29 AC_CHECK_PROGS(MV, mv, [${am_missing_run}mv])
30 AC_CHECK_PROGS(RM, rm, [${am_missing_run}rm])
31 AC_CHECK_PROGS(LD, ld, [${am_missing_run}ld])
32 AC_CHECK_PROGS(CP, cp, [${am_missing_run}cp])
33 AC_CHECK_PROGS(STRIP, strip, [${am_missing_run}strip])
34 AC_CHECK_PROGS(LORDER, lorder, [${am_missing_run}lorder])
35
36 dnl TODO - need to disable STRIP if we are doing debugging in any user space code
37
38 case $AFS_SYSNAME in
39         alpha_dux40)
40                 CC="cc"
41                 CCOBJ="cc"
42                 MT_CC="cc"
43                 CSTATIC="-non_shared"
44                 DBG="-g3"
45                 MT_CFLAGS='-D_REENTRANT=1 -pthread'
46                 MT_LIBS="-pthread -lpthread -lmach -lexc -lc"
47                 XCFLAGS="-D_NO_PROTO -DOSF"
48                 SHLIB_LINKER="${CC} -all -shared -expect_unresolved \"*\""
49                 ;;
50
51         alpha_dux50 | alpha_dux51)
52                 CC="cc"
53                 CCOBJ="cc"
54                 MT_CC="cc"
55                 DBG="-g3"
56                 CSTATIC="-non_shared"
57                 LWP_OPTMZ="-O2"
58                 MT_CFLAGS='-D_REENTRANT=1 -pthread'
59                 MT_LIBS="-pthread -lpthread -lmach -lexc -lc"
60                 XCFLAGS="-D_NO_PROTO -DOSF"
61                 SHLIB_LINKER="${CC} -all -shared -expect_unresolved \"*\""
62                 ;;
63
64         alpha_linux_22 | alpha_linux_24 | alpha_linux_26)
65                 CCOBJ="${CC} -fPIC"
66                 MT_CFLAGS='-pthread -D_REENTRANT'
67                 PAM_OPTMZ=-O2
68                 PAM_CFLAGS="-Dlinux -DLINUX_PAM -fPIC"
69                 SHLIB_CFLAGS="-fPIC"
70                 SHLIB_LDFLAGS="-shared -Xlinker -x"
71                 SHLIB_LINKER="${MT_CC} -shared"
72                 ;;
73
74         arm_linux_24 | arm_linux26)
75                 CCOBJ="${CC} -fPIC"
76                 MT_CFLAGS='-pthread -D_REENTRANT'
77                 PAM_OPTMZ=-O2
78                 PAM_CFLAGS="-Dlinux -DLINUX_PAM -fPIC"
79                 SHLIB_CFLAGS="-fPIC"
80                 SHLIB_LDFLAGS="-shared -Xlinker -x"
81                 SHLIB_LINKER="${MT_CC} -shared"
82                 ;;
83
84         hp_ux102)
85                 AS="/usr/ccs/bin/as"
86                 CC="/opt/ansic/bin/cc -Ae"
87                 CCOBJ="/opt/ansic/bin/cc -Ae"
88                 DBM="/lib/libndbm.a"
89                 LD="/bin/ld"
90                 LEX="/opt/langtools/bin/lex"
91                 LWP_OPTMZ="-O"
92                 MT_CC="/opt/ansic/bin/cc -Ae"
93                 MT_CFLAGS='-D_POSIX_C_SOURCE=199506L'
94                 MT_LIBS='-L/opt/dce/lib -ldce ${XLIBS}'
95                 MV="/bin/mv"
96                 OPTMZ="-O"
97                 PAM_CFLAGS="+DA1.0 +z -Wl,+k"
98                 PAM_LIBS="/usr/lib/libpam.1"
99                 RANLIB="/usr/bin/ranlib"
100                 RM="/bin/rm"
101                 SHLIB_LDFLAGS="-b -Bsymbolic"
102                 SHLIB_SUFFIX="sl"
103                 VFSCK_CFLAGS="-D_FILE64"
104                 XCFLAGS0="-ldld -lc -Wp,-H200000 -Wl,-a,archive -DAUTH_DBM_LOG +z -Wl,+k -D_LARGEFILE64_SOURCE"
105                 XCFLAGS64="${XCFLAGS0} +DA2.0W"
106                 XCFLAGS="${XCFLAGS0} +DA1.0"
107                 YACC="/opt/langtools/bin/yacc"
108                 SHLIB_LINKER="ld -b"
109                 ;;
110
111         hp_ux11*)
112                 AR="/usr/bin/ar"
113                 AS="/usr/ccs/bin/as"
114                 CC="/opt/ansic/bin/cc"
115                 CCOBJ="/opt/ansic/bin/cc"
116                 DBM="/lib/libndbm.a"
117                 LD="/bin/ld   "
118                 LEX="/opt/langtools/bin/lex"
119                 LWP_OPTMZ="-O"
120                 MT_CC="$CC"
121                 MT_CFLAGS='-D_POSIX_C_SOURCE=199506L'
122                 MV="/bin/mv"
123                 OPTMZ="-O"
124                 PAM_CFLAGS="+DA1.0 +z -Wl,+k"
125                 PAM_LIBS="/usr/lib/libpam.1"
126                 RANLIB="/usr/bin/ranlib"
127                 RM="/bin/rm"
128                 SHLIB_LDFLAGS="-b -Bsymbolic"
129                 SHLIB_SUFFIX="sl"
130                 VFSCK_CFLAGS="-I/usr/old/usr/include -D_FILE64"
131                 XCFLAGS0="-ldld -lc -Wp,-H200000 -Wl,-a,archive -DAUTH_DBM_LOG +z -Wl,+k -D_LARGEFILE64_SOURCE"
132                 XCFLAGS64="${XCFLAGS0} +DA2.0W"
133                 XCFLAGS="${XCFLAGS0} +DA1.0"
134                 XLIBELFA="-lelf"
135                 YACC="/opt/langtools/bin/yacc"
136                 SHLIB_LINKER="ld -b"
137                 ;;
138
139         ia64_hpux*)
140                 AR="/usr/bin/ar"
141                 AS="/usr/ccs/bin/as"
142                 CC="/opt/ansic/bin/cc"
143                 CCOBJ="/opt/ansic/bin/cc"
144                 DBM="/lib/hpux32/libndbm.so"
145                 LD="/bin/ld   "
146                 LEX="/opt/langtools/bin/lex"
147                 LWP_OPTMZ=""
148                 MT_CC="$CC"
149                 MT_CFLAGS='-D_POSIX_C_SOURCE=199506L'
150                 MV="/bin/mv"
151                 OPTMZ="-O"
152                 PAM_CFLAGS="-b +z -Wl,+k"
153                 PAM_LIBS="/usr/lib/hpux32/libpam.so"
154                 RANLIB="/usr/bin/ranlib"
155                 RM="/bin/rm"
156                 SHLIB_LDFLAGS="-b -Bsymbolic"
157                 SHLIB_SUFFIX="sl"
158                 VFSCK_CFLAGS="-I/usr/old/usr/include -D_FILE64"
159                 XCFLAGS0="-ldld -lc -Wp,-H200000 -Wl,-a,archive_shared -DAUTH_DBM_LOG +z -Wl,+k -D_LARGEFILE64_SOURCE"
160                 XCFLAGS64="${XCFLAGS0} +DD64"
161                 XCFLAGS="${XCFLAGS0}"
162                 XLIBELFA="-lelf"
163                 YACC="/opt/langtools/bin/yacc"
164                 SHLIB_LINKER="ld -b"
165                 ;;
166
167         i386_fbsd_*)
168                 MT_CFLAGS='-pthread -D_REENTRANT'
169                 PAM_OPTMZ=-O2
170                 PAM_CFLAGS="-pipe -fPIC"
171                 SHLIB_LDFLAGS="-shared -Xlinker -x"
172                 SHLIB_LINKER="${MT_CC} -shared"
173                 XCFLAGS="-pipe"
174                 ;;
175
176         i386_dfbsd_*)
177                 MT_CFLAGS='-pthread -D_REENTRANT'
178                 PAM_OPTMZ=-O2
179                 PAM_CFLAGS="-pipe -fPIC"
180                 SHLIB_LDFLAGS="-shared -Xlinker -x"
181                 SHLIB_LINKER="${MT_CC} -shared"
182                 XCFLAGS="-pipe"
183                 ;;
184
185         amd64_fbsd_*)
186                 MT_CFLAGS='-pthread -D_REENTRANT'
187                 PAM_CFLAGS="-O2 -pipe -fPIC"
188                 SHLIB_LDFLAGS="-shared -Xlinker -x"
189                 SHLIB_LINKER="${MT_CC} -shared"
190                 XCFLAGS="-O2 -pipe -fPIC"
191                 ;;
192
193         *nbsd2*|*nbsd3*|*nbsd4*|*nbsd5*|*nbsd6*)
194                 MT_CFLAGS='-pthread -D_REENTRANT'
195                 PAM_OPTMZ=-O2
196                 PAM_CFLAGS="-pipe -fPIC"
197                 SHLIB_CFLAGS="-fPIC"
198                 SHLIB_LDFLAGS="-shared -Xlinker -x"
199                 SHLIB_LINKER="${MT_CC} -shared"
200                 XCFLAGS="-pipe"
201                 ;;
202
203         *nbsd15|*nbsd16)
204                 MT_LIBS='${XLIBS}'
205                 PAM_OPTMZ=-O2
206                 PAM_CFLAGS="-pipe -fPIC"
207                 SHLIB_LDFLAGS="-shared -Xlinker -x"
208                 SHLIB_LINKER="${MT_CC} -shared"
209                 XCFLAGS="-pipe"
210                 ;;
211
212         ia64_linux24|ia64_linux26)
213                 KERN_OPTMZ=-O2
214                 MT_CFLAGS='-pthread -D_REENTRANT'
215                 PAM_OPTMZ=-O2
216                 PAM_CFLAGS="-Dlinux -DLINUX_PAM -fPIC"
217                 SHLIB_CFLAGS="-fPIC"
218                 SHLIB_LDFLAGS="-shared -Xlinker -x"
219                 XCFLAGS="-G0"
220                 SHLIB_LINKER="${MT_CC} -shared"
221                 ;;
222
223         amd64_linux*)
224                 CCOBJ="${CC} -fPIC"
225                 KERN_OPTMZ=-O2
226                 MT_CFLAGS='-pthread -D_REENTRANT'
227                 PAM_OPTMZ=-O2
228                 PAM_CFLAGS="-Dlinux -DLINUX_PAM -fPIC"
229                 SHLIB_CFLAGS="-fPIC"
230                 SHLIB_LDFLAGS="-shared -Xlinker -x"
231                 SHLIB_LINKER="${MT_CC} -shared"
232                 ;;
233
234         ppc64_linux24 | ppc64_linux26)
235                 MT_CFLAGS='-pthread -D_REENTRANT'
236                 PAM_OPTMZ=-O2
237                 PAM_CFLAGS="-Dlinux -DLINUX_PAM -fPIC"
238                 SHLIB_LDFLAGS="-shared -Xlinker -x"
239                 SHLIB_CFLAGS="-fPIC"
240                 SHLIB_LINKER="${MT_CC} -shared"
241                 ;;
242
243         i386_linux*)
244                 KERN_OPTMZ=-O2
245                 MT_CFLAGS='-pthread -D_REENTRANT'
246                 DBG=-g
247                 KERN_DBG=-g
248                 LWP_DBG=-g
249                 LWP_OPTMZ=-O2
250                 OPTMZ=-O2
251                 PAM_CFLAGS="-Dlinux -DLINUX_PAM -fPIC"
252                 SHLIB_CFLAGS="-fPIC"
253                 SHLIB_LDFLAGS="-shared -Xlinker -x"
254                 SHLIB_LINKER="${MT_CC} -shared"
255                 ;;
256
257         i386_umlinux22 | i386_umlinux24 | i386_umlinux26)
258                 MT_CFLAGS='-pthread -D_REENTRANT'
259                 DBG=-g
260                 LWP_DBG=-g
261                 LWP_OPTMZ=-O2
262                 OPTMZ=-O2
263                 PAM_OPTMZ=-O2
264                 PAM_CFLAGS="-Dlinux -DLINUX_PAM -fPIC"
265                 SHLIB_CFLAGS="-fPIC"
266                 SHLIB_LDFLAGS="-shared -Xlinker -x"
267                 SHLIB_LINKER="${MT_CC} -shared"
268                 ;;
269
270         *_obsd*)
271                 KERN_OPTMZ=-O2
272                 MT_CFLAGS='-pthread -D_REENTRANT'
273                 LWP_OPTMZ=-O2
274                 OPTMZ=-O2
275                 PAM_OPTMZ=-O2
276                 PAM_CFLAGS="-pipe -fpic"
277                 SHLIB_CFLAGS="-fpic"
278                 SHLIB_LDFLAGS="-shared -Xlinker -x"
279                 SHLIB_LINKER="${MT_CC} -shared"
280                 XCFLAGS=
281                 ;;
282
283         parisc_linux24)
284                 KERN_OPTMZ=-O2
285                 MT_CFLAGS='-pthread -D_REENTRANT'
286                 PAM_OPTMZ=-O2
287                 PAM_CFLAGS="-Dlinux -DLINUX_PAM -fPIC"
288                 SHLIB_CFLAGS="-fPIC"
289                 SHLIB_LDFLAGS="-shared -Xlinker -x"
290                 SHLIB_LINKER="${MT_CC} -shared"
291                 ;;
292
293         ppc_darwin_70)
294                 CC="cc"
295                 CCOBJ="cc"
296                 MT_CC="cc"
297                 AFSD_LDFLAGS="-F/System/Library/PrivateFrameworks -framework DiskArbitration -framework SystemConfiguration -framework IOKit -framework CoreFoundation"
298                 MT_CFLAGS='-D_REENTRANT'
299                 KROOT=
300                 KINCLUDES='-I$(KROOT)/System/Library/Frameworks/Kernel.framework/Headers'
301                 LWP_OPTMZ="-O2"
302                 REGEX_OBJ="regex.o"
303                 REGEX_OBJ_PIC="regex_pic.o"
304                 XCFLAGS="-no-cpp-precomp"
305                 EXTRA_VLIBOBJS="fstab.o"
306                 SHLIB_LINKER="${MT_CC} \${ARCHFLAGS} -dynamiclib"
307                 SHLIB_SUFFIX="dylib"
308                 XLIBS="${LIB_AFSDB} ${XBSA_XLIBS} -framework CoreFoundation"
309                 ;;
310
311         *_darwin_80)
312                 CC="cc"
313                 CCOBJ="cc"
314                 MT_CC="cc"
315                 AFSD_LDFLAGS="-F/System/Library/PrivateFrameworks -framework DiskArbitration -framework SystemConfiguration -framework IOKit -framework CoreFoundation"
316                 MT_CFLAGS="-D_REENTRANT"
317                 KROOT=
318                 KINCLUDES='-I$(KROOT)/System/Library/Frameworks/Kernel.framework/Headers'
319                 KERN_OPTMZ="-Os"
320                 LWP_OPTMZ="-Os"
321                 OPTMZ="-Os"
322                 REGEX_OBJ="regex.o"
323                 REGEX_OBJ_PIC="regex_pic.o"
324                 EXTRA_VLIBOBJS="fstab.o"
325                 SHLIB_LINKER="${MT_CC} \${ARCHFLAGS} -dynamiclib"
326                 SHLIB_SUFFIX="dylib"
327                 RANLIB="ranlib -c"
328                 XLIBS="${LIB_AFSDB} ${XBSA_XLIBS} -framework CoreFoundation"
329                 ;;
330
331         *_darwin_90)
332                 AFSD_LDFLAGS="-F/System/Library/PrivateFrameworks -framework DiskArbitration -framework SystemConfiguration -framework IOKit -framework CoreFoundation"
333                 MT_CFLAGS="-D_REENTRANT"
334                 KROOT=
335                 KINCLUDES='-I$(KROOT)/System/Library/Frameworks/Kernel.framework/Headers'
336                 LD="cc"
337                 KERN_OPTMZ="-Os"
338                 LWP_OPTMZ="-Os"
339                 OPTMZ="-Os"
340                 REGEX_OBJ="regex.o"
341                 REGEX_OBJ_PIC="regex_pic.o"
342                 EXTRA_VLIBOBJS="fstab.o"
343                 SHLIB_LINKER="${MT_CC} \${ARCHFLAGS} -dynamiclib"
344                 SHLIB_SUFFIX="dylib"
345                 RANLIB="ranlib -c"
346                 XLIBS="${LIB_AFSDB} ${XBSA_XLIBS} -framework CoreFoundation"
347                 ;;
348
349         arm_darwin_100)
350                 AFSD_LDFLAGS="-F/System/Library/PrivateFrameworks -framework SystemConfiguration -framework IOKit -framework CoreFoundation"
351                 MT_CFLAGS="-D_REENTRANT"
352                 MT_LIBS="${LIB_AFSDB} -framework CoreFoundation"
353                 KROOT=
354                 KINCLUDES='-I$(KROOT)/System/Library/Frameworks/Kernel.framework/Headers'
355                 LD="cc"
356                 KERN_OPTMZ="-Os"
357                 LWP_OPTMZ="-Os"
358                 OPTMZ="-Os"
359                 PAM_LIBS="-lpam"
360                 REGEX_OBJ="regex.o"
361                 TXLIBS="-lncurses"
362                 EXTRA_VLIBOBJS="fstab.o"
363                 SHLIB_LINKER="${MT_CC} -dynamiclib"
364                 SHLIB_SUFFIX="dylib"
365                 RANLIB="ranlib"
366                 XLIBS="${LIB_AFSDB} ${XBSA_XLIBS} -framework CoreFoundation"
367                 ;;
368
369         *_darwin_100 | *_darwin_110 )
370                 AFSD_LDFLAGS="-F/System/Library/PrivateFrameworks -framework DiskArbitration -framework SystemConfiguration -framework IOKit -framework CoreFoundation"
371                 MT_CFLAGS="-D_REENTRANT"
372                 MT_LIBS='${XLIBS}'
373                 KROOT=
374                 KINCLUDES='-I$(KROOT)/System/Library/Frameworks/Kernel.framework/Headers'
375                 LD="cc"
376                 KERN_OPTMZ="-Os"
377                 LWP_OPTMZ="-Os"
378                 OPTMZ="-Os"
379                 PAM_LIBS="-lpam"
380                 REGEX_OBJ="regex.o"
381                 REGEX_OBJ_PIC="regex_pic.o"
382                 EXTRA_VLIBOBJS="fstab.o"
383                 SHLIB_LINKER="${MT_CC} \${ARCHFLAGS} -dynamiclib"
384                 SHLIB_SUFFIX="dylib"
385                 RANLIB="ranlib"
386                 XLIBS="${LIB_AFSDB} ${XBSA_XLIBS} -framework CoreFoundation"
387                 ;;
388
389         ppc_linux*)
390                 KERN_OPTMZ=-O2
391                 MT_CFLAGS='-pthread -D_REENTRANT'
392                 PAM_OPTMZ=-O2
393                 PAM_CFLAGS="-Dlinux -DLINUX_PAM -fPIC"
394                 SHLIB_CFLAGS="-fPIC"
395                 SHLIB_LDFLAGS="-shared -Xlinker -x"
396                 SHLIB_LINKER="${MT_CC} -shared"
397                 ;;
398
399         rs_aix42)
400                 CC="cc"
401                 CCOBJ="cc"
402                 DBG=""
403                 LIBSYS_AIX_EXP="afsl.exp"
404                 MT_CC="xlc_r"
405                 SHLIB_SUFFIX="o"
406                 XCFLAGS="-K -D_NONSTD_TYPES -D_MBI=void"
407                 XLIBS="${LIB_AFSDB} ${LIB_libintl} -ldl"
408                 SHLIB_LINKER="${MT_CC} -bM:SRE -berok"
409                 AIX32="yes"
410                 AIX64="no"
411                 ;;
412
413         rs_aix51 | rs_aix52 | rs_aix53) 
414                 CC="cc"
415                 CCOBJ="cc"
416                 DBG="-g"
417                 LIBSYS_AIX_EXP="afsl.exp"
418                 MT_CC="xlc_r"
419                 SHLIB_SUFFIX="o"
420                 XCFLAGS="-K -D_NONSTD_TYPES -D_MBI=void"
421                 XLIBS="${LIB_AFSDB} ${LIB_libintl} -ldl"
422                 SHLIB_LINKER="${MT_CC} -bM:SRE -berok"
423                 AIX32="yes"
424                 AIX64="yes"
425                 ;;
426
427         rs_aix61)       
428                 CC="cc"
429                 CCOBJ="cc"
430                 DBG="-g"
431                 LIBSYS_AIX_EXP="afsl.exp"
432                 MT_CC="xlc_r"
433                 SHLIB_SUFFIX="o"
434                 XCFLAGS="-K -D_NONSTD_TYPES -D_MBI=void"
435                 XLIBS="${LIB_AFSDB} ${LIB_libintl} -ldl"
436                 SHLIB_LINKER="${MT_CC} -bM:SRE -berok"
437                 AIX32="no"
438                 AIX64="yes"
439                 ;;
440
441         s390_linux22|s390_linux24|s390_linux26)
442                 LD="ld"
443                 KERN_OPTMZ=-O2
444                 MT_CC="$CC"
445                 MT_CFLAGS='-pthread -D_REENTRANT'
446                 PAM_OPTMZ=-O2
447                 PAM_CFLAGS="-Dlinux -DLINUX_PAM -fPIC"
448                 SHLIB_CFLAGS="-fPIC"
449                 SHLIB_LDFLAGS="-shared -Xlinker -x"
450                 SHLIB_LINKER="${MT_CC} -shared"
451                 ;;
452
453         s390x_linux24|s390x_linux26)
454                 CCOBJ="${CC} -fPIC"
455                 LD="ld"
456                 KERN_OPTMZ=-O2
457                 MT_CC="$CC"
458                 MT_CFLAGS='-pthread -D_REENTRANT'
459                 PAM_OPTMZ=-O
460                 PAM_CFLAGS="-Dlinux -DLINUX_PAM -fPIC"
461                 SHLIB_CFLAGS="-fPIC"
462                 SHLIB_LDFLAGS="-shared -Xlinker -x -Xlinker -Bsymbolic"
463                 OPTMZ=-O
464                 XCFLAGS="-D__s390x__"
465                 SHLIB_LINKER="${MT_CC} -shared"
466                 ;;
467
468         sgi_62)
469                 CC="cc"
470                 CCOBJ="cc"
471                 MT_CC="cc"
472                 AFSD_LIBS="/usr/lib/libdwarf.a /usr/lib/libelf.a"
473                 FSINCLUDES="-I/usr/include/sys/fs"
474                 MT_CFLAGS='-D_SGI_MP_SOURCE'
475                 XCFLAGS64="-64 -mips3"
476                 XCFLAGS="-o32"
477                 XLDFLAGS64="-64"
478                 XLDFLAGS="-o32"
479                 SHLIB_LINKER="${CC} -shared"
480                 ;;
481
482         sgi_63)
483                 CC="cc"
484                 CCOBJ="cc"
485                 MT_CC="cc"
486                 AFSD_LIBS="/usr/lib/libdwarf.a /usr/lib/libelf.a"
487                 FSINCLUDES="-I/usr/include/sys/fs"
488                 MT_CFLAGS='-D_SGI_MP_SOURCE'
489                 XCFLAGS64="-D_BSD_COMPAT -64 -mips3"
490                 XCFLAGS="-D_OLD_TERMIOS -D_BSD_COMPAT -o32"
491                 XLDFLAGS64="-64"
492                 XLDFLAGS="-o32"
493                 SHLIB_LINKER="${CC} -shared"
494                 ;;
495
496         sgi_64)
497                 CC="cc"
498                 CCOBJ="cc"
499                 MT_CC="cc"
500                 AFSD_LIBS="/usr/lib32/libdwarf.a /usr/lib32/libelf.a"
501                 FSINCLUDES="-I/usr/include/sys/fs"
502                 MT_CFLAGS='-D_SGI_MP_SOURCE'
503                 XCFLAGS64="-D_BSD_COMPAT -64 -mips3"
504                 XCFLAGS="-D_OLD_TERMIOS -D_BSD_COMPAT -n32 -woff 1009,1014,1110,1116,1164,1169,1171,1174,1177,1183,1185,1204,1233,1515,1516,1548,1169,1174,1177,1196,1498,1506,1552,3201 -Wl,-woff,84,-woff,15"
505                 XLDFLAGS64="-64"
506                 XLDFLAGS="-n32"
507                 SHLIB_LINKER="${CC} -shared"
508                 ;;
509
510         sgi_65)
511                 AFSD_LIBS="/usr/lib32/libdwarf.a /usr/lib32/libelf.a"
512                 CC="/usr/bin/cc"
513                 CCOBJ="/usr/bin/cc"
514                 FSINCLUDES="-I/usr/include/sys/fs"
515                 LD="/usr/bin/ld"
516                 MT_CC="/usr/bin/cc"
517                 MT_CFLAGS='-D_SGI_MP_SOURCE'
518                 XCFLAGS64="-64 -mips3"
519                 XCFLAGS="-n32 -mips3 -woff 1009,1014,1110,1116,1164,1171,1177,1183,1185,1204,1233,1515,1516,1548,1169,1174,1177,1196,1498,1506,1552,3201 -Wl,-woff,84,-woff,15"
520                 XLDFLAGS64="-64 -mips3"
521                 XLDFLAGS="-n32 -mips3"
522                 SHLIB_LINKER="${CC} -shared"
523                 ;;
524
525         sparc*_linux*)
526                 KERN_OPTMZ=-O2
527                 MT_CFLAGS='-pthread -D_REENTRANT'
528                 PAM_OPTMZ=-O2
529                 PAM_CFLAGS="-Dlinux -DLINUX_PAM -fPIC"
530                 SHLIB_CFLAGS="-fPIC"
531                 SHLIB_LDFLAGS="-shared -Xlinker -x"
532                 XCFLAGS64="-m64"
533                 XLDFLAGS64="-m64"
534                 SHLIB_LINKER="${MT_CC} -shared"
535                 ;;
536
537         sun4x_58|sun4x_59)
538                 CC=$SOLARISCC
539                 CCOBJ=$SOLARISCC
540                 LD="/usr/ccs/bin/ld"
541                 MT_CC=$SOLARISCC
542                 MT_CFLAGS='-mt'
543                 PAM_CFLAGS="-KPIC"
544                 PAM_LIBS="-lc -lpam -lsocket -lnsl -lm"
545                 SHLIB_CFLAGS="-KPIC"
546                 SHLIB_LDFLAGS="-G -Bsymbolic"
547                 XCFLAGS64='${XCFLAGS} -xarch=v9'
548                 XCFLAGS="-dy -Bdynamic"
549                 XLIBELFA="-lelf"
550                 XLIBKVM="-lkvm"
551                 XLIBS="${LIB_AFSDB} -lsocket -lnsl -lintl -ldl"
552                 SHLIB_LINKER="${CC} -G -dy -Bsymbolic -z text"
553                 LWP_OPTMZ="-g"
554                 ;;
555
556         sun4x_510)
557                 CC=$SOLARISCC
558                 CCOBJ=$SOLARISCC
559                 LD="/usr/ccs/bin/ld"
560                 MT_CC=$SOLARISCC
561                 MT_CFLAGS='-mt'
562                 PAM_CFLAGS="-KPIC"
563                 PAM_LIBS="-lc -lpam -lsocket -lnsl -lm"
564                 SHLIB_CFLAGS="-KPIC"
565                 SHLIB_LDFLAGS="-G -Bsymbolic"
566                 XCFLAGS64='${XCFLAGS} -m64'
567                 XCFLAGS="-dy -Bdynamic"
568                 XLIBELFA="-lelf"
569                 XLIBKVM="-lkvm"
570                 XLIBS="${LIB_AFSDB} -lsocket -lnsl -lintl -ldl"
571                 SHLIB_LINKER="${CC} -G -dy -Bsymbolic -z text"
572                 LWP_OPTMZ="-g"
573                 ;;
574
575         sun4x_511)
576                 CC=$SOLARISCC
577                 CCOBJ=$SOLARISCC
578                 LD="/usr/ccs/bin/ld"
579                 MT_CC=$SOLARISCC
580                 MT_CFLAGS='-mt'
581                 PAM_CFLAGS="-KPIC"
582                 PAM_LIBS="-lc -lpam -lsocket -lnsl -lm"
583                 SHLIB_CFLAGS="-KPIC"
584                 SHLIB_LDFLAGS="-G -Bsymbolic"
585                 XCFLAGS64='${XCFLAGS} -xarch=v9'
586                 XCFLAGS="-dy -Bdynamic"
587                 XLIBELFA="-lelf"
588                 XLIBKVM="-lkvm"
589                 XLIBS="${LIB_AFSDB} -lsocket -lnsl -lintl -ldl"
590                 SHLIB_LINKER="${CC} -G -dy -Bsymbolic -z text"
591                 LWP_OPTMZ="-g"
592                 ;;
593
594         sunx86_58|sunx86_59)
595                 CC=$SOLARISCC
596                 CCOBJ=$SOLARISCC
597                 LD="/usr/ccs/bin/ld"
598                 MT_CC=$SOLARISCC
599                 MT_CFLAGS='-mt'
600                 PAM_CFLAGS="-KPIC"
601                 PAM_LIBS="-lc -lpam -lsocket -lnsl -lm"
602                 SHLIB_CFLAGS="-KPIC"
603                 SHLIB_LDFLAGS="-G -Bsymbolic"
604                 XCFLAGS64='${XCFLAGS} -xarch=amd64'
605                 XCFLAGS="-dy -Bdynamic"
606                 XLIBELFA="-lelf"
607                 XLIBKVM="-lkvm"
608                 XLIBS="${LIB_AFSDB} -lsocket -lnsl -lintl -ldl"
609                 SHLIB_LINKER="${CC} -G -dy -Bsymbolic -z text"
610                 ;;
611
612         sunx86_510)
613                 CC=$SOLARISCC
614                 CCOBJ=$SOLARISCC
615                 LD="/usr/ccs/bin/ld"
616                 MT_CC=$SOLARISCC
617                 MT_CFLAGS='-mt'
618                 PAM_CFLAGS="-KPIC"
619                 PAM_LIBS="-lc -lpam -lsocket -lnsl -lm"
620                 SHLIB_CFLAGS="-KPIC"
621                 SHLIB_LDFLAGS="-G -Bsymbolic"
622                 XCFLAGS64='${XCFLAGS} -m64'
623                 XCFLAGS="-dy -Bdynamic"
624                 XLIBELFA="-lelf"
625                 XLIBKVM="-lkvm"
626                 XLIBS="${LIB_AFSDB} -lsocket -lnsl -lintl -ldl"
627                 SHLIB_LINKER="${CC} -G -dy -Bsymbolic -z text"
628                 ;;
629
630         sunx86_511)
631                 CC=$SOLARISCC
632                 CCOBJ=$SOLARISCC
633                 LD="/usr/ccs/bin/ld"
634                 MT_CC=$SOLARISCC
635                 MT_CFLAGS='-mt'
636                 PAM_CFLAGS="-KPIC"
637                 PAM_LIBS="-lc -lpam -lsocket -lnsl -lm"
638                 SHLIB_CFLAGS="-KPIC"
639                 SHLIB_LDFLAGS="-G -Bsymbolic"
640                 XCFLAGS64='${XCFLAGS} -xarch=amd64'
641                 XCFLAGS="-dy -Bdynamic"
642                 XLIBELFA="-lelf"
643                 XLIBKVM="-lkvm"
644                 XLIBS="${LIB_AFSDB} -lsocket -lnsl -lintl -ldl"
645                 SHLIB_LINKER="${CC} -G -dy -Bsymbolic -z text"
646                 ;;
647 esac
648
649 MT_CFLAGS="${MT_CFLAGS} -DAFS_PTHREAD_ENV"
650
651 #
652 # Special build targets
653 #
654 case $AFS_SYSNAME in
655         sgi_6*)
656                 IRIX_SYS_SYSTM_H_HAS_MEM_FUNCS
657                 XFS_SIZE_CHECK="xfs_size_check"
658                 install_XFS_SIZE_CHECK='$(DESTDIR)${afssrvsbindir}/xfs_size_check'
659                 dest_XFS_SIZE_CHECK='$(DEST)/root.server/usr/afs/bin/xfs_size_check'
660         
661                 AC_SUBST(XFS_SIZE_CHECK)
662                 AC_SUBST(install_XFS_SIZE_CHECK)
663                 AC_SUBST(dest_XFS_SIZE_CHECK)
664         ;;
665 esac
666
667 dnl Disable the default for debugging/optimization if not enabled
668 if test "x$enable_debug_kernel" = "xno"; then
669   KERN_DBG=
670 fi
671
672 if test "x$enable_optimize_kernel" = "xno"; then
673   KERN_OPTMZ=
674 fi
675
676 if test "x$enable_debug" = "xno"; then
677   DBG=
678   NO_STRIP_BIN=-s
679 fi
680
681 if test "x$enable_optimize" = "xno"; then
682   OPTMZ=
683 fi
684
685 if test "x$enable_debug_lwp" = "xno"; then
686   LWP_DBG=
687 fi
688
689 if test "x$enable_optimize_lwp" = "xno"; then
690   LWP_OPTMZ=
691 fi
692
693 if test "x$enable_strip_binaries" != "xno"; then
694   if test "x$enable_strip_binaries" = "xmaybe" -a "x$enable_debug" = "xyes"; then
695     NO_STRIP_BIN=
696   else
697     NO_STRIP_BIN=-s
698   fi
699 else
700   NO_STRIP_BIN=
701 fi
702
703 CFLAGS_NOERROR=
704 CFLAGS_NOSTRICT=
705 CFLAGS_NOUNUSED=
706 CFLAGS_NOOLDSTYLE=
707
708 if test "x$GCC" = "xyes"; then
709   if test "x$enable_warnings" = "xyes"; then
710     XCFLAGS="${XCFLAGS} -Wall -Wstrict-prototypes -Wold-style-definition -Wpointer-arith"
711   fi
712   if test "x$enable_checking" != "xno"; then
713     XCFLAGS="${XCFLAGS} -Wall -Wstrict-prototypes -Wold-style-definition -Werror -fdiagnostics-show-option -Wpointer-arith"
714     if test "x$enable_checking" != "xall"; then
715       CFLAGS_NOERROR="-Wno-error"
716       CFLAGS_NOSTRICT="-fno-strict-aliasing"
717       CFLAGS_NOUNUSED="-Wno-unused"
718       CFLAGS_NOOLDSTYLE="-Wno-old-style-definition"
719       AC_DEFINE(IGNORE_SOME_GCC_WARNINGS, 1, [define to disable some gcc warnings in warnings-as-errors mode])
720     fi
721   fi
722 else
723   case $AFS_SYSNAME in
724     sun*_51?)
725       # Solaris Studio
726       warn_common="-v -errfmt=error -errtags=yes -erroff=E_ATTRIBUTE_UNKNOWN,E_END_OF_LOOP_CODE_NOT_REACHED"
727       if test "x$enable_warnings" = "xyes" ; then
728         XCFLAGS="${XCFLAGS} $warn_common"
729       fi
730       if test "x$enable_checking" != "xno" ; then
731         XCFLAGS="${XCFLAGS} $warn_common -errwarn=%all"
732         if test "x$enable_checking" != "xall" ; then
733           CFLAGS_NOERROR="-errwarn=%none"
734         fi
735       fi
736       ;;
737   esac
738 fi
739
740 dnl horribly cheating, assuming double / is ok.
741 case $INSTALL in
742   ./* ) 
743     INSTALL="/@abs_top_srcdir@/install-sh -c"
744   ;;
745   *) 
746   ;;
747 esac
748
749 INSTALL_PROGRAM="${INSTALL_PROGRAM} ${NO_STRIP_BIN}"
750
751 AC_SUBST(CCXPG2)
752 AC_SUBST(CCOBJ)
753 AC_SUBST(AFSD_LIBS)
754 AC_SUBST(AFSD_LDFLAGS)
755 AC_SUBST(AIX32)
756 AC_SUBST(AIX64)
757 AC_SUBST(AR)
758 AC_SUBST(AS)
759 AC_SUBST(CP)
760 AC_SUBST(DBG)
761 AC_SUBST(FSINCLUDES)
762 AC_SUBST(KERN_DBG)
763 AC_SUBST(KERN_OPTMZ)
764 AC_SUBST(LD)
765 AC_SUBST(LEX)
766 AC_SUBST(LWP_DBG)
767 AC_SUBST(LWP_OPTMZ)
768 AC_SUBST(MT_CC)
769 AC_SUBST(MT_CFLAGS)
770 AC_SUBST(MT_LIBS)
771 AC_SUBST(MV)
772 AC_SUBST(NO_STRIP_BIN)
773 AC_SUBST(OPTMZ)
774 AC_SUBST(PAM_CFLAGS)
775 AC_SUBST(PAM_LIBS)
776 AC_SUBST(PAM_DBG)
777 AC_SUBST(PAM_OPTMZ)
778 AC_SUBST(RANLIB)
779 AC_SUBST(REGEX_OBJ)
780 AC_SUBST(REGEX_OBJ_PIC)
781 AC_SUBST(RM)
782 AC_SUBST(RXDEBUG)
783 AC_SUBST(SHLIB_CFLAGS)
784 AC_SUBST(SHLIB_LDFLAGS)
785 AC_SUBST(SHLIB_LINKER)
786 AC_SUBST(SHLIB_SUFFIX)
787 AC_SUBST(VFSCK_CFLAGS)
788 AC_SUBST(XCFLAGS)
789 AC_SUBST(CFLAGS_NOERROR)
790 AC_SUBST(CFLAGS_NOSTRICT)
791 AC_SUBST(CFLAGS_NOUNUSED)
792 AC_SUBST(CFLAGS_NOOLDSTYLE)
793 AC_SUBST(XCFLAGS64)
794 AC_SUBST(XLDFLAGS)
795 AC_SUBST(XLDFLAGS64)
796 AC_SUBST(XLIBELFA)
797 AC_SUBST(XLIBKVM)
798 AC_SUBST(XLIBS)
799 AC_SUBST(YACC)
800
801
802 ])