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