macos: add support for MacOS 10.13
[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} ${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_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_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_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         ppc_darwin_70)
279                 CC="cc"
280                 AFSD_LDFLAGS="-F/System/Library/PrivateFrameworks -framework DiskArbitration -framework SystemConfiguration -framework IOKit -framework CoreFoundation"
281                 MT_CFLAGS='-D_REENTRANT'
282                 KROOT=
283                 KINCLUDES='-I$(KROOT)/System/Library/Frameworks/Kernel.framework/Headers'
284                 LWP_OPTMZ="-O2"
285                 REGEX_OBJ="regex.lo"
286                 XCFLAGS="-no-cpp-precomp"
287                 EXTRA_VLIBOBJS="fstab.o"
288                 SHLIB_LINKER="${CC} \${ARCHFLAGS} -dynamiclib"
289                 SHLIB_SUFFIX="dylib"
290                 XLIBS="${LIB_AFSDB} -framework CoreFoundation"
291                 ;;
292
293         *_darwin_80)
294                 CC="cc"
295                 AFSD_LDFLAGS="-F/System/Library/PrivateFrameworks -framework DiskArbitration -framework SystemConfiguration -framework IOKit -framework CoreFoundation"
296                 MT_CFLAGS="-D_REENTRANT"
297                 KROOT=
298                 KINCLUDES='-I$(KROOT)/System/Library/Frameworks/Kernel.framework/Headers'
299                 KERN_OPTMZ="-Os"
300                 LWP_OPTMZ="-Os"
301                 OPTMZ="-Os"
302                 REGEX_OBJ="regex.lo"
303                 EXTRA_VLIBOBJS="fstab.o"
304                 SHLIB_LINKER="${CC} \${ARCHFLAGS} -dynamiclib"
305                 SHLIB_SUFFIX="dylib"
306                 RANLIB="ranlib -c"
307                 XLIBS="${LIB_AFSDB} -framework CoreFoundation"
308                 ;;
309
310         *_darwin_90)
311                 AFSD_LDFLAGS="-F/System/Library/PrivateFrameworks -framework DiskArbitration -framework SystemConfiguration -framework IOKit -framework CoreFoundation"
312                 MT_CFLAGS="-D_REENTRANT"
313                 KROOT=
314                 KINCLUDES='-I$(KROOT)/System/Library/Frameworks/Kernel.framework/Headers'
315                 LD="cc"
316                 KERN_OPTMZ="-Os"
317                 LWP_OPTMZ="-Os"
318                 OPTMZ="-Os"
319                 REGEX_OBJ="regex.lo"
320                 EXTRA_VLIBOBJS="fstab.o"
321                 SHLIB_LINKER="${CC} \${ARCHFLAGS} -dynamiclib"
322                 SHLIB_SUFFIX="dylib"
323                 RANLIB="ranlib -c"
324                 XLIBS="${LIB_AFSDB} -framework CoreFoundation"
325                 ;;
326
327         arm_darwin_100)
328                 AFSD_LDFLAGS="-F/System/Library/PrivateFrameworks -framework SystemConfiguration -framework IOKit -framework CoreFoundation"
329                 MT_CFLAGS="-D_REENTRANT"
330                 MT_LIBS="${LIB_AFSDB} -framework CoreFoundation"
331                 KROOT=
332                 KINCLUDES='-I$(KROOT)/System/Library/Frameworks/Kernel.framework/Headers'
333                 LD="cc"
334                 KERN_OPTMZ="-Os"
335                 LWP_OPTMZ="-Os"
336                 OPTMZ="-Os"
337                 PAM_LIBS="-lpam"
338                 REGEX_OBJ="regex.lo"
339                 TXLIBS="-lncurses"
340                 EXTRA_VLIBOBJS="fstab.o"
341                 SHLIB_LINKER="${CC} -dynamiclib"
342                 SHLIB_SUFFIX="dylib"
343                 RANLIB="ranlib"
344                 XLIBS="${LIB_AFSDB} -framework CoreFoundation"
345                 ;;
346
347         *_darwin_100 | *_darwin_110 | *_darwin_120 | *_darwin_130 | *_darwin_140 | *_darwin_150 | *_darwin_160 | *_darwin_170)
348                 AFSD_LDFLAGS="-F/System/Library/PrivateFrameworks -framework DiskArbitration -framework SystemConfiguration -framework IOKit -framework CoreFoundation"
349                 MT_CFLAGS="-D_REENTRANT"
350                 MT_LIBS='${XLIBS}'
351                 KROOT=
352                 KINCLUDES='-I$(KROOT)/System/Library/Frameworks/Kernel.framework/Headers'
353                 LD="cc"
354                 KERN_OPTMZ="-Os"
355                 LWP_OPTMZ="-Os"
356                 OPTMZ="-Os"
357                 PAM_LIBS="-lpam"
358                 REGEX_OBJ="regex.lo"
359                 EXTRA_VLIBOBJS="fstab.o"
360                 SHLIB_LINKER="${CC} \${ARCHFLAGS} -dynamiclib"
361                 SHLIB_SUFFIX="dylib"
362                 RANLIB="ranlib"
363                 XLIBS="${LIB_AFSDB} -framework CoreFoundation"
364                 ;;
365
366         ppc_linux*)
367                 KERN_OPTMZ=-O2
368                 MT_CFLAGS='-pthread -D_REENTRANT'
369                 PAM_OPTMZ=-O2
370                 PAM_CFLAGS="-Dlinux -DLINUX_PAM -fPIC"
371                 SHLIB_CFLAGS="-fPIC"
372                 SHLIB_LDFLAGS="-shared -Xlinker -x"
373                 SHLIB_LINKER="${CC} -shared"
374                 ;;
375
376         rs_aix42)
377                 CC="cc"
378                 DBG=""
379                 LIBSYS_AIX_EXP="afsl.exp"
380                 MT_CC="xlc_r"
381                 SHLIB_SUFFIX="o"
382                 XCFLAGS="-K -D_NONSTD_TYPES -D_MBI=void"
383                 XLIBS="${LIB_AFSDB} ${LIB_libintl} -ldl"
384                 SHLIB_LINKER="${MT_CC} -bM:SRE -berok"
385                 AIX32="yes"
386                 AIX64="no"
387                 ;;
388
389         rs_aix51 | rs_aix52 | rs_aix53) 
390                 CC="cc"
391                 DBG="-g"
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="yes"
400                 ;;
401
402         rs_aix61)       
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="no"
412                 AIX64="yes"
413                 ;;
414
415         s390_linux26)
416                 LD="ld"
417                 KERN_OPTMZ=-O2
418                 MT_CFLAGS='-pthread -D_REENTRANT'
419                 PAM_OPTMZ=-O2
420                 PAM_CFLAGS="-Dlinux -DLINUX_PAM -fPIC"
421                 SHLIB_CFLAGS="-fPIC"
422                 SHLIB_LDFLAGS="-shared -Xlinker -x"
423                 SHLIB_LINKER="${CC} -shared"
424                 ;;
425
426         s390x_linux26)
427                 CCOBJ="\$(CC) -fPIC"
428                 LD="ld"
429                 KERN_OPTMZ=-O2
430                 MT_CFLAGS='-pthread -D_REENTRANT'
431                 PAM_OPTMZ=-O
432                 PAM_CFLAGS="-Dlinux -DLINUX_PAM -fPIC"
433                 SHLIB_CFLAGS="-fPIC"
434                 SHLIB_LDFLAGS="-shared -Xlinker -x -Xlinker -Bsymbolic"
435                 OPTMZ=-O
436                 XCFLAGS="-D__s390x__"
437                 SHLIB_LINKER="${CC} -shared"
438                 ;;
439
440         sgi_62)
441                 CC="cc"
442                 AFSD_LIBS="/usr/lib/libdwarf.a /usr/lib/libelf.a"
443                 FSINCLUDES="-I/usr/include/sys/fs"
444                 MT_CFLAGS='-D_SGI_MP_SOURCE'
445                 XCFLAGS64="-64 -mips3"
446                 XCFLAGS="-o32"
447                 XLDFLAGS64="-64"
448                 XLDFLAGS="-o32"
449                 SHLIB_LINKER="${CC} -shared"
450                 ;;
451
452         sgi_63)
453                 CC="cc"
454                 AFSD_LIBS="/usr/lib/libdwarf.a /usr/lib/libelf.a"
455                 FSINCLUDES="-I/usr/include/sys/fs"
456                 MT_CFLAGS='-D_SGI_MP_SOURCE'
457                 XCFLAGS64="-D_BSD_COMPAT -64 -mips3"
458                 XCFLAGS="-D_OLD_TERMIOS -D_BSD_COMPAT -o32"
459                 XLDFLAGS64="-64"
460                 XLDFLAGS="-o32"
461                 SHLIB_LINKER="${CC} -shared"
462                 ;;
463
464         sgi_64)
465                 CC="cc"
466                 AFSD_LIBS="/usr/lib32/libdwarf.a /usr/lib32/libelf.a"
467                 FSINCLUDES="-I/usr/include/sys/fs"
468                 MT_CFLAGS='-D_SGI_MP_SOURCE'
469                 XCFLAGS64="-D_BSD_COMPAT -64 -mips3"
470                 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"
471                 XLDFLAGS64="-64"
472                 XLDFLAGS="-n32"
473                 SHLIB_LINKER="${CC} -shared"
474                 ;;
475
476         sgi_65)
477                 AFSD_LIBS="/usr/lib32/libdwarf.a /usr/lib32/libelf.a"
478                 CC="/usr/bin/cc"
479                 FSINCLUDES="-I/usr/include/sys/fs"
480                 LD="/usr/bin/ld"
481                 MT_CFLAGS='-D_SGI_MP_SOURCE'
482                 XCFLAGS64="-64 -mips3"
483                 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"
484                 XLDFLAGS64="-64 -mips3"
485                 XLDFLAGS="-n32 -mips3"
486                 SHLIB_LINKER="${CC} -shared"
487                 ;;
488
489         sparc*_linux*)
490                 KERN_OPTMZ=-O2
491                 MT_CFLAGS='-pthread -D_REENTRANT'
492                 PAM_OPTMZ=-O2
493                 PAM_CFLAGS="-Dlinux -DLINUX_PAM -fPIC"
494                 SHLIB_CFLAGS="-fPIC"
495                 SHLIB_LDFLAGS="-shared -Xlinker -x"
496                 XCFLAGS64="-m64"
497                 XLDFLAGS64="-m64"
498                 SHLIB_LINKER="${CC} -shared"
499                 ;;
500
501         sun4x_5*)
502                 CC=$SOLARISCC
503                 LD="/usr/ccs/bin/ld"
504                 MT_CFLAGS='-mt'
505                 PAM_CFLAGS="-KPIC"
506                 PAM_LIBS="-lc -lpam -lsocket -lnsl -lm"
507                 SHLIB_CFLAGS="-KPIC"
508                 SHLIB_LDFLAGS="-G -Bsymbolic"
509                 XCFLAGS64='${XCFLAGS} -m64'
510                 XCFLAGS="-dy -Bdynamic"
511                 XLIBELFA="-lelf"
512                 XLIBKVM="-lkvm"
513                 XLIBS="${LIB_AFSDB} -lsocket -lnsl -lintl -ldl"
514                 SHLIB_LINKER="${CC} -G -dy -Bsymbolic -z text"
515                 LWP_OPTMZ="-g"
516                 ;;
517
518         sunx86_5*)
519                 case $AFS_SYSNAME in
520                         sunx86_58|sunx86_59)
521                                 XARCHFLAGS=""
522                                 ;;
523                         *)
524                                 if test "x`echo "${ARCHFLAGS}" | grep m32`" != "x" ; then
525                                         CURRENTBUILDARCH=i386
526                                 fi
527                                 if test "x`echo "${ARCHFLAGS}" | grep m64`" != "x" ; then
528                                         CURRENTBUILDARCH=amd64
529                                 fi
530                                 if test "x${CURRENTBUILDARCH}" = "x" ; then
531                                         CURRENTBUILDARCH=`isainfo -k`
532                                 fi
533                                 if test "${CURRENTBUILDARCH}" = "amd64" ; then
534                                         XARCHFLAGS="-m64"
535                                 fi
536                                 ;;
537                 esac
538
539                 CC=$SOLARISCC
540                 CFLAGS="$CFLAGS ${XARCHFLAGS}"
541                 LD="/usr/ccs/bin/ld"
542                 MT_CFLAGS='-mt'
543                 KERN_OPTMZ="-xO3"
544                 PAM_CFLAGS="-KPIC"
545                 PAM_LIBS="-lc -lpam -lsocket -lnsl -lm"
546                 SHLIB_CFLAGS="-KPIC"
547                 SHLIB_LDFLAGS="-G -Bsymbolic"
548                 XCFLAGS0="-dy -Bdynamic"
549                 XCFLAGS64="${XCFLAGS0} -m64"
550                 XCFLAGS="${XCFLAGS0} ${XARCHFLAGS}"
551                 XLDFLAGS64="-m64"
552                 XLDFLAGS="${XARCHFLAGS}"
553                 ASFLAGS="${XARCHFLAGS}"
554                 XLIBELFA="-lelf"
555                 XLIBKVM="-lkvm"
556                 XLIBS="${LIB_AFSDB} -lsocket -lnsl -lintl -ldl"
557                 SHLIB_LINKER="${CC} ${XARCHFLAGS} -G -dy -Bsymbolic -z text"
558                 ;;
559
560 esac
561
562 MT_CFLAGS="${MT_CFLAGS} -DAFS_PTHREAD_ENV"
563
564 #
565 # Defaults for --enable-optimize-kernel
566 #
567 if test "x$enable_optimize_kernel" = "x" ; then
568   AS_CASE([$AFS_SYSNAME],
569     [sunx86_510|sunx86_511],
570       dnl Somewhere around Solaris Studio 12.*, the compiler started adding SSE
571       dnl instructions to optimized code, without any known way to turn it off.
572       dnl To cope, this condition was added to change the default to
573       dnl 'no'.
574       dnl Now that we have an autoconf test to allow disabling the SSE
575       dnl optimizations, it's safe to once more default to 'yes' here.
576       [enable_optimize_kernel=yes],
577     [enable_optimize_kernel=yes])
578 fi
579
580 #
581 # Special build targets
582 #
583 case $AFS_SYSNAME in
584         sgi_6*)
585                 IRIX_SYS_SYSTM_H_HAS_MEM_FUNCS
586                 XFS_SIZE_CHECK="xfs_size_check"
587                 install_XFS_SIZE_CHECK='$(DESTDIR)${afssrvsbindir}/xfs_size_check'
588                 dest_XFS_SIZE_CHECK='$(DEST)/root.server/usr/afs/bin/xfs_size_check'
589         
590                 AC_SUBST(XFS_SIZE_CHECK)
591                 AC_SUBST(install_XFS_SIZE_CHECK)
592                 AC_SUBST(dest_XFS_SIZE_CHECK)
593         ;;
594         *_fbsd_*)
595                 if test "x$enable_debug_kernel" = "xyes"; then
596                         DEBUG_FLAGS=-g
597                         AC_SUBST(DEBUG_FLAGS)
598                 fi
599         ;;
600 esac
601
602 dnl Disable the default for debugging/optimization if not enabled
603 if test "x$enable_debug_kernel" = "xno"; then
604   KERN_DBG=
605 fi
606
607 if test "x$enable_optimize_kernel" = "xno"; then
608   KERN_OPTMZ=
609 fi
610
611 if test "x$enable_debug" = "xno"; then
612   DBG=
613   NO_STRIP_BIN=-s
614 fi
615
616 if test "x$enable_optimize" = "xno"; then
617   OPTMZ=
618 fi
619
620 if test "x$enable_debug_lwp" = "xno"; then
621   LWP_DBG=
622 fi
623
624 if test "x$enable_optimize_lwp" = "xno"; then
625   LWP_OPTMZ=
626 fi
627
628 if test "x$enable_strip_binaries" != "xno"; then
629   if test "x$enable_strip_binaries" = "xmaybe" -a "x$enable_debug" = "xyes"; then
630     NO_STRIP_BIN=
631   else
632     NO_STRIP_BIN=-s
633   fi
634 else
635   NO_STRIP_BIN=
636 fi
637
638 CFLAGS_NOERROR=
639 CFLAGS_NOSTRICT=-fno-strict-aliasing
640 CFLAGS_NOUNUSED=
641 CFLAGS_NOOLDSTYLE=
642 XCFLAGS_NOCHECKING="$XCFLAGS"
643
644 if test "x$GCC" = "xyes"; then
645   if test "x$enable_warnings" = "xyes"; then
646     XCFLAGS="${XCFLAGS} -Wall -Wstrict-prototypes -Wold-style-definition -Wpointer-arith"
647   fi
648   if test "x$enable_checking" != "xno"; then
649     XCFLAGS="${XCFLAGS} -Wall -Wstrict-prototypes -Wold-style-definition -Werror -fdiagnostics-show-option -Wpointer-arith"
650     if test "x$enable_checking" != "xall"; then
651       CFLAGS_NOERROR="-Wno-error"
652       CFLAGS_NOUNUSED="-Wno-unused"
653       CFLAGS_NOOLDSTYLE="-Wno-old-style-definition"
654       AC_DEFINE(IGNORE_SOME_GCC_WARNINGS, 1, [define to disable some gcc warnings in warnings-as-errors mode])
655     else
656       CFLAGS_NOSTRICT=
657     fi
658   fi
659 else
660   case $AFS_SYSNAME in
661     sun*_51?)
662       # Solaris Studio
663       warn_common="-v -errfmt=error -errtags=yes -erroff=E_ATTRIBUTE_UNKNOWN,E_END_OF_LOOP_CODE_NOT_REACHED"
664       if test "x$enable_warnings" = "xyes" ; then
665         XCFLAGS="${XCFLAGS} $warn_common"
666       fi
667       if test "x$enable_checking" != "xno" ; then
668         XCFLAGS="${XCFLAGS} $warn_common -errwarn=%all"
669         if test "x$enable_checking" != "xall" ; then
670           CFLAGS_NOERROR="-errwarn=%none"
671         fi
672       fi
673       ;;
674   esac
675 fi
676
677 dnl horribly cheating, assuming double / is ok.
678 case $INSTALL in
679   ./* ) 
680     INSTALL="/@abs_top_srcdir@/install-sh -c"
681   ;;
682   *) 
683   ;;
684 esac
685
686 INSTALL_PROGRAM="${INSTALL_PROGRAM} ${NO_STRIP_BIN}"
687
688 AC_SUBST(CCXPG2)
689 AC_SUBST(CCOBJ)
690 AC_SUBST(AFSD_LIBS)
691 AC_SUBST(AFSD_LDFLAGS)
692 AC_SUBST(AIX32)
693 AC_SUBST(AIX64)
694 AC_SUBST(AR)
695 AC_SUBST(AS)
696 AC_SUBST(ASFLAGS)
697 AC_SUBST(CP)
698 AC_SUBST(DBG)
699 AC_SUBST(FSINCLUDES)
700 AC_SUBST(KERN_DBG)
701 AC_SUBST(KERN_OPTMZ)
702 AC_SUBST(LD)
703 AC_SUBST(LEX)
704 AC_SUBST(LWP_DBG)
705 AC_SUBST(LWP_OPTMZ)
706 AC_SUBST(MT_CC)
707 AC_SUBST(MT_CFLAGS)
708 AC_SUBST(MT_LIBS)
709 AC_SUBST(MV)
710 AC_SUBST(NO_STRIP_BIN)
711 AC_SUBST(OPTMZ)
712 AC_SUBST(PAM_CFLAGS)
713 AC_SUBST(PAM_LIBS)
714 AC_SUBST(PAM_DBG)
715 AC_SUBST(PAM_OPTMZ)
716 AC_SUBST(RANLIB)
717 AC_SUBST(REGEX_OBJ)
718 AC_SUBST(RM)
719 AC_SUBST(RXDEBUG)
720 AC_SUBST(SHLIB_CFLAGS)
721 AC_SUBST(SHLIB_LDFLAGS)
722 AC_SUBST(SHLIB_LINKER)
723 AC_SUBST(SHLIB_SUFFIX)
724 AC_SUBST(VFSCK_CFLAGS)
725 AC_SUBST(XCFLAGS)
726 AC_SUBST(CFLAGS_NOERROR)
727 AC_SUBST(CFLAGS_NOSTRICT)
728 AC_SUBST(CFLAGS_NOUNUSED)
729 AC_SUBST(CFLAGS_NOOLDSTYLE)
730 AC_SUBST(XCFLAGS64)
731 AC_SUBST(XLDFLAGS)
732 AC_SUBST(XLDFLAGS64)
733 AC_SUBST(XLIBELFA)
734 AC_SUBST(XLIBKVM)
735 AC_SUBST(XLIBS)
736 AC_SUBST(YACC)
737
738
739 ])