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