Add nbsd60 param files and autoconf logic
[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         sun4_413)
538                 CCXPG2="/usr/xpg2bin/cc"
539                 CC="gcc"
540                 CCOBJ="gcc"
541                 SHLIB_CFLAGS="-PIC"
542                 XCFLAGS=""
543                 XLIBELFA="-lelf"
544                 XLIBKVM="-lkvm"
545                 XLIBS="${LIB_AFSDB}"
546                 LD="ld"
547                 ;;
548
549         sun4x_55)
550                 CC=$SOLARISCC
551                 CCOBJ=$SOLARISCC
552                 MT_CC=$SOLARISCC
553                 MT_CFLAGS='-mt'
554                 SHLIB_CFLAGS="-KPIC"
555                 XCFLAGS="-dy -Bdynamic"
556                 XLIBELFA="-lelf"
557                 XLIBKVM="-lkvm"
558                 XLIBS="${LIB_AFSDB} -lsocket -lnsl -lintl -ldl"
559                 LD="/usr/ccs/bin/ld"
560                 SHLIB_LINKER="${CC} -G -dy -Bsymbolic -z text"
561                 LWP_OPTMZ="-g"
562                 ;;
563
564         sun4x_56|sun4x_57|sun4x_58|sun4x_59)
565                 CC=$SOLARISCC
566                 CCOBJ=$SOLARISCC
567                 LD="/usr/ccs/bin/ld"
568                 MT_CC=$SOLARISCC
569                 MT_CFLAGS='-mt'
570                 PAM_CFLAGS="-KPIC"
571                 PAM_LIBS="-lc -lpam -lsocket -lnsl -lm"
572                 SHLIB_CFLAGS="-KPIC"
573                 SHLIB_LDFLAGS="-G -Bsymbolic"
574                 XCFLAGS64='${XCFLAGS} -xarch=v9'
575                 XCFLAGS="-dy -Bdynamic"
576                 XLIBELFA="-lelf"
577                 XLIBKVM="-lkvm"
578                 XLIBS="${LIB_AFSDB} -lsocket -lnsl -lintl -ldl"
579                 SHLIB_LINKER="${CC} -G -dy -Bsymbolic -z text"
580                 LWP_OPTMZ="-g"
581                 ;;
582
583         sun4x_510)
584                 CC=$SOLARISCC
585                 CCOBJ=$SOLARISCC
586                 LD="/usr/ccs/bin/ld"
587                 MT_CC=$SOLARISCC
588                 MT_CFLAGS='-mt'
589                 PAM_CFLAGS="-KPIC"
590                 PAM_LIBS="-lc -lpam -lsocket -lnsl -lm"
591                 SHLIB_CFLAGS="-KPIC"
592                 SHLIB_LDFLAGS="-G -Bsymbolic"
593                 XCFLAGS64='${XCFLAGS} -m64'
594                 XCFLAGS="-dy -Bdynamic"
595                 XLIBELFA="-lelf"
596                 XLIBKVM="-lkvm"
597                 XLIBS="${LIB_AFSDB} -lsocket -lnsl -lintl -ldl"
598                 SHLIB_LINKER="${CC} -G -dy -Bsymbolic -z text"
599                 LWP_OPTMZ="-g"
600                 ;;
601
602         sun4x_511)
603                 CC=$SOLARISCC
604                 CCOBJ=$SOLARISCC
605                 LD="/usr/ccs/bin/ld"
606                 MT_CC=$SOLARISCC
607                 MT_CFLAGS='-mt'
608                 PAM_CFLAGS="-KPIC"
609                 PAM_LIBS="-lc -lpam -lsocket -lnsl -lm"
610                 SHLIB_CFLAGS="-KPIC"
611                 SHLIB_LDFLAGS="-G -Bsymbolic"
612                 XCFLAGS64='${XCFLAGS} -xarch=v9'
613                 XCFLAGS="-dy -Bdynamic"
614                 XLIBELFA="-lelf"
615                 XLIBKVM="-lkvm"
616                 XLIBS="${LIB_AFSDB} -lsocket -lnsl -lintl -ldl"
617                 SHLIB_LINKER="${CC} -G -dy -Bsymbolic -z text"
618                 LWP_OPTMZ="-g"
619                 ;;
620
621         sunx86_57|sunx86_58|sunx86_59)
622                 CC=$SOLARISCC
623                 CCOBJ=$SOLARISCC
624                 LD="/usr/ccs/bin/ld"
625                 MT_CC=$SOLARISCC
626                 MT_CFLAGS='-mt'
627                 PAM_CFLAGS="-KPIC"
628                 PAM_LIBS="-lc -lpam -lsocket -lnsl -lm"
629                 SHLIB_CFLAGS="-KPIC"
630                 SHLIB_LDFLAGS="-G -Bsymbolic"
631                 XCFLAGS64='${XCFLAGS} -xarch=amd64'
632                 XCFLAGS="-dy -Bdynamic"
633                 XLIBELFA="-lelf"
634                 XLIBKVM="-lkvm"
635                 XLIBS="${LIB_AFSDB} -lsocket -lnsl -lintl -ldl"
636                 SHLIB_LINKER="${CC} -G -dy -Bsymbolic -z text"
637                 ;;
638
639         sunx86_510)
640                 CC=$SOLARISCC
641                 CCOBJ=$SOLARISCC
642                 LD="/usr/ccs/bin/ld"
643                 MT_CC=$SOLARISCC
644                 MT_CFLAGS='-mt'
645                 PAM_CFLAGS="-KPIC"
646                 PAM_LIBS="-lc -lpam -lsocket -lnsl -lm"
647                 SHLIB_CFLAGS="-KPIC"
648                 SHLIB_LDFLAGS="-G -Bsymbolic"
649                 XCFLAGS64='${XCFLAGS} -m64'
650                 XCFLAGS="-dy -Bdynamic"
651                 XLIBELFA="-lelf"
652                 XLIBKVM="-lkvm"
653                 XLIBS="${LIB_AFSDB} -lsocket -lnsl -lintl -ldl"
654                 SHLIB_LINKER="${CC} -G -dy -Bsymbolic -z text"
655                 ;;
656
657         sunx86_511)
658                 CC=$SOLARISCC
659                 CCOBJ=$SOLARISCC
660                 LD="/usr/ccs/bin/ld"
661                 MT_CC=$SOLARISCC
662                 MT_CFLAGS='-mt'
663                 PAM_CFLAGS="-KPIC"
664                 PAM_LIBS="-lc -lpam -lsocket -lnsl -lm"
665                 SHLIB_CFLAGS="-KPIC"
666                 SHLIB_LDFLAGS="-G -Bsymbolic"
667                 XCFLAGS64='${XCFLAGS} -xarch=amd64'
668                 XCFLAGS="-dy -Bdynamic"
669                 XLIBELFA="-lelf"
670                 XLIBKVM="-lkvm"
671                 XLIBS="${LIB_AFSDB} -lsocket -lnsl -lintl -ldl"
672                 SHLIB_LINKER="${CC} -G -dy -Bsymbolic -z text"
673                 ;;
674 esac
675
676 MT_CFLAGS="${MT_CFLAGS} -DAFS_PTHREAD_ENV"
677
678 #
679 # Special build targets
680 #
681 case $AFS_SYSNAME in
682         sgi_6*)
683                 IRIX_SYS_SYSTM_H_HAS_MEM_FUNCS
684                 XFS_SIZE_CHECK="xfs_size_check"
685                 install_XFS_SIZE_CHECK='$(DESTDIR)${afssrvsbindir}/xfs_size_check'
686                 dest_XFS_SIZE_CHECK='$(DEST)/root.server/usr/afs/bin/xfs_size_check'
687         
688                 AC_SUBST(XFS_SIZE_CHECK)
689                 AC_SUBST(install_XFS_SIZE_CHECK)
690                 AC_SUBST(dest_XFS_SIZE_CHECK)
691         ;;
692 esac
693
694 dnl Disable the default for debugging/optimization if not enabled
695 if test "x$enable_debug_kernel" = "xno"; then
696   KERN_DBG=
697 fi
698
699 if test "x$enable_optimize_kernel" = "xno"; then
700   KERN_OPTMZ=
701 fi
702
703 if test "x$enable_debug" = "xno"; then
704   DBG=
705   NO_STRIP_BIN=-s
706 fi
707
708 if test "x$enable_optimize" = "xno"; then
709   OPTMZ=
710 fi
711
712 if test "x$enable_debug_lwp" = "xno"; then
713   LWP_DBG=
714 fi
715
716 if test "x$enable_optimize_lwp" = "xno"; then
717   LWP_OPTMZ=
718 fi
719
720 if test "x$enable_strip_binaries" != "xno"; then
721   if test "x$enable_strip_binaries" = "xmaybe" -a "x$enable_debug" = "xyes"; then
722     NO_STRIP_BIN=
723   else
724     NO_STRIP_BIN=-s
725   fi
726 else
727   NO_STRIP_BIN=
728 fi
729
730 CFLAGS_NOERROR=
731 CFLAGS_NOSTRICT=
732 CFLAGS_NOUNUSED=
733 CFLAGS_NOOLDSTYLE=
734
735 if test "x$GCC" = "xyes"; then
736   if test "x$enable_warnings" = "xyes"; then
737     XCFLAGS="${XCFLAGS} -Wall -Wstrict-prototypes -Wold-style-definition -Wpointer-arith"
738   fi
739   if test "x$enable_checking" != "xno"; then
740     XCFLAGS="${XCFLAGS} -Wall -Wstrict-prototypes -Wold-style-definition -Werror -fdiagnostics-show-option -Wpointer-arith"
741     if test "x$enable_checking" != "xall"; then
742       CFLAGS_NOERROR="-Wno-error"
743       CFLAGS_NOSTRICT="-fno-strict-aliasing"
744       CFLAGS_NOUNUSED="-Wno-unused"
745       CFLAGS_NOOLDSTYLE="-Wno-old-style-definition"
746       AC_DEFINE(IGNORE_SOME_GCC_WARNINGS, 1, [define to disable some gcc warnings in warnings-as-errors mode])
747     fi
748   fi
749 else
750   case $AFS_SYSNAME in
751     sun*_51?)
752       # Solaris Studio
753       warn_common="-v -errfmt=error -errtags=yes -erroff=E_ATTRIBUTE_UNKNOWN,E_END_OF_LOOP_CODE_NOT_REACHED"
754       if test "x$enable_warnings" = "xyes" ; then
755         XCFLAGS="${XCFLAGS} $warn_common"
756       fi
757       if test "x$enable_checking" != "xno" ; then
758         XCFLAGS="${XCFLAGS} $warn_common -errwarn=%all"
759         if test "x$enable_checking" != "xall" ; then
760           CFLAGS_NOERROR="-errwarn=%none"
761         fi
762       fi
763       ;;
764   esac
765 fi
766
767 dnl horribly cheating, assuming double / is ok.
768 case $INSTALL in
769   ./* ) 
770     INSTALL="/@abs_top_srcdir@/install-sh -c"
771   ;;
772   *) 
773   ;;
774 esac
775
776 INSTALL_PROGRAM="${INSTALL_PROGRAM} ${NO_STRIP_BIN}"
777
778 AC_SUBST(CCXPG2)
779 AC_SUBST(CCOBJ)
780 AC_SUBST(AFSD_LIBS)
781 AC_SUBST(AFSD_LDFLAGS)
782 AC_SUBST(AIX32)
783 AC_SUBST(AIX64)
784 AC_SUBST(AR)
785 AC_SUBST(AS)
786 AC_SUBST(CP)
787 AC_SUBST(DBG)
788 AC_SUBST(FSINCLUDES)
789 AC_SUBST(KERN_DBG)
790 AC_SUBST(KERN_OPTMZ)
791 AC_SUBST(LD)
792 AC_SUBST(LEX)
793 AC_SUBST(LWP_DBG)
794 AC_SUBST(LWP_OPTMZ)
795 AC_SUBST(MT_CC)
796 AC_SUBST(MT_CFLAGS)
797 AC_SUBST(MT_LIBS)
798 AC_SUBST(MV)
799 AC_SUBST(NO_STRIP_BIN)
800 AC_SUBST(OPTMZ)
801 AC_SUBST(PAM_CFLAGS)
802 AC_SUBST(PAM_LIBS)
803 AC_SUBST(PAM_DBG)
804 AC_SUBST(PAM_OPTMZ)
805 AC_SUBST(RANLIB)
806 AC_SUBST(REGEX_OBJ)
807 AC_SUBST(REGEX_OBJ_PIC)
808 AC_SUBST(RM)
809 AC_SUBST(RXDEBUG)
810 AC_SUBST(SHLIB_CFLAGS)
811 AC_SUBST(SHLIB_LDFLAGS)
812 AC_SUBST(SHLIB_LINKER)
813 AC_SUBST(SHLIB_SUFFIX)
814 AC_SUBST(VFSCK_CFLAGS)
815 AC_SUBST(XCFLAGS)
816 AC_SUBST(CFLAGS_NOERROR)
817 AC_SUBST(CFLAGS_NOSTRICT)
818 AC_SUBST(CFLAGS_NOUNUSED)
819 AC_SUBST(CFLAGS_NOOLDSTYLE)
820 AC_SUBST(XCFLAGS64)
821 AC_SUBST(XLDFLAGS)
822 AC_SUBST(XLDFLAGS64)
823 AC_SUBST(XLIBELFA)
824 AC_SUBST(XLIBKVM)
825 AC_SUBST(XLIBS)
826 AC_SUBST(YACC)
827
828
829 ])