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