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