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