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