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