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