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