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