irix-attempt-to-detect-kernel-mem-routines-20040317
[openafs.git] / src / cf / osconf.m4
1
2 AC_DEFUN(OPENAFS_OSCONF, [
3
4 dnl defaults, override in case below as needed
5 XCFLAGS='${DBG} ${OPTMZ}'
6 SHLIB_SUFFIX="so"
7 CC="cc"
8 MT_CC="cc"
9 XLIBS="${LIB_AFSDB}"
10
11 dnl debugging and optimization flag defaults
12 dnl Note, these are all the defaults for if debug/optimize turned on, and
13 dnl the arch cases below do not override
14 KERN_DBG=-g
15 KERN_OPTMZ=-O
16 DBG=-g
17 OPTMZ=-O
18 LWP_DBG=-g
19 LWP_OPTMZ=-O
20
21 dnl standard programs
22 AC_PROG_RANLIB
23 AC_CHECK_PROGS(AS, as, [${am_missing_run}as])
24 AC_CHECK_PROGS(AR, ar, [${am_missing_run}ar])
25 AC_CHECK_PROGS(MV, mv, [${am_missing_run}mv])
26 AC_CHECK_PROGS(RM, rm, [${am_missing_run}rm])
27 AC_CHECK_PROGS(LD, ld, [${am_missing_run}ld])
28 AC_CHECK_PROGS(CP, cp, [${am_missing_run}cp])
29 AC_CHECK_PROGS(STRIP, strip, [${am_missing_run}strip])
30 AC_CHECK_PROGS(LORDER, lorder, [${am_missing_run}lorder])
31
32 dnl TODO - need to disable STRIP if we are doing debugging in any user space code
33
34 case $AFS_SYSNAME in
35         alpha_dux40)
36                 LEX="lex"
37                 CSTATIC="-non_shared"
38                 DBG="-g3"
39                 MT_CFLAGS='-D_REENTRANT=1 -pthread -DAFS_PTHREAD_ENV ${XCFLAGS}'
40                 MT_LIBS="-pthread -lpthread -lmach -lexc -lc"
41                 TXLIBS="-lcurses"
42                 XCFLAGS="-D_NO_PROTO -DOSF"
43                 SHLIB_LINKER="${CC} -all -shared -expect_unresolved \"*\""
44                 ;;
45
46         alpha_dux50)
47                 LEX="flex -l"
48                 DBG="-g3"
49                 CSTATIC="-non_shared"
50                 MT_CFLAGS='-D_REENTRANT=1 -pthread -DAFS_PTHREAD_ENV ${XCFLAGS}'
51                 MT_LIBS="-pthread -lpthread -lmach -lexc -lc"
52                 TXLIBS="-lcurses"
53                 XCFLAGS="-D_NO_PROTO -DOSF"
54                 SHLIB_LINKER="${CC} -all -shared -expect_unresolved \"*\""
55                 ;;
56
57         alpha_dux51)
58                 LEX="flex -l"
59                 DBG="-g3"
60                 CSTATIC="-non_shared"
61                 LWP_OPTMZ="-O2"
62                 MT_CFLAGS='-D_REENTRANT=1 -pthread -DAFS_PTHREAD_ENV ${XCFLAGS}'
63                 MT_LIBS="-pthread -lpthread -lmach -lexc -lc"
64                 TXLIBS="-lcurses"
65                 XCFLAGS="-D_NO_PROTO -DOSF"
66                 SHLIB_LINKER="${CC} -all -shared -expect_unresolved \"*\""
67                 ;;
68
69         alpha_linux_22)
70                 KERN_OPTMZ=-O2
71                 LEX="flex -l"
72                 MT_CFLAGS='-DAFS_PTHREAD_ENV -pthread -D_REENTRANT ${XCFLAGS}'
73                 MT_LIBS="-lpthread"
74                 PAM_CFLAGS="-O2 -Dlinux -DLINUX_PAM -fPIC"
75                 SHLIB_LDFLAGS="-shared -Xlinker -x"
76                 TXLIBS="-lncurses"
77                 XCFLAGS="-O2 -D_LARGEFILE64_SOURCE"
78                 YACC="bison -y"
79                 SHLIB_LINKER="${MT_CC} -shared"
80                 ;;
81
82         alpha_linux_24)
83                 KERN_OPTMZ=-O2
84                 LEX="flex -l"
85                 MT_CFLAGS='-DAFS_PTHREAD_ENV -pthread -D_REENTRANT ${XCFLAGS}'
86                 MT_LIBS="-lpthread"
87                 PAM_CFLAGS="-O2 -Dlinux -DLINUX_PAM -fPIC"
88                 SHLIB_LDFLAGS="-shared -Xlinker -x"
89                 TXLIBS="-lncurses"
90                 XCFLAGS="-O2 -D_LARGEFILE64_SOURCE"
91                 YACC="bison -y"
92                 SHLIB_LINKER="${MT_CC} -shared"
93                 ;;
94
95         hp_ux102)
96                 AS="/usr/ccs/bin/as"
97                 CC="/opt/ansic/bin/cc -Ae"
98                 DBM="/lib/libndbm.a"
99                 LD="/bin/ld"
100                 LEX="/opt/langtools/bin/lex"
101                 LWP_OPTMZ="-O"
102                 MT_CC="/opt/ansic/bin/cc -Ae"
103                 MT_CFLAGS='-D_POSIX_C_SOURCE=199506L -DAFS_PTHREAD_ENV ${XCFLAGS}'
104                 MT_LIBS="-L/opt/dce/lib -ldce"
105                 MV="/bin/mv"
106                 OPTMZ="-O"
107                 PAM_CFLAGS="+DA1.0 +z -Wl,+k"
108                 PAM_LIBS="/usr/lib/libpam.1"
109                 RANLIB="/usr/bin/ranlib"
110                 RM="/bin/rm"
111                 SHLIB_LDFLAGS="-b -Bsymbolic"
112                 SHLIB_SUFFIX="sl"
113                 TXLIBS="/usr/lib/libHcurses.a"
114                 VFSCK_CFLAGS="-D_FILE64"
115                 XCFLAGS0="-ldld -lc -Wp,-H200000 -Wl,-a,archive -DAUTH_DBM_LOG +z -Wl,+k -D_LARGEFILE64_SOURCE"
116                 XCFLAGS64="${XCFLAGS0} +DA2.0W"
117                 XCFLAGS="${XCFLAGS0} +DA1.0"
118                 YACC="/opt/langtools/bin/yacc"
119                 SHLIB_LINKER="ld -b"
120                 ;;
121
122         hp_ux11*)
123                 AR="/usr/bin/ar"
124                 AS="/usr/ccs/bin/as"
125                 CC="/opt/ansic/bin/cc"
126                 DBM="/lib/libndbm.a"
127                 LD="/bin/ld   "
128                 LEX="/opt/langtools/bin/lex"
129                 LWP_OPTMZ="-O"
130                 MT_CC="$CC"
131                 MT_CFLAGS='-D_POSIX_C_SOURCE=199506L -DAFS_PTHREAD_ENV ${XCFLAGS}'
132                 MT_LIBS="-lpthread"
133                 MV="/bin/mv"
134                 OPTMZ="-O"
135                 PAM_CFLAGS="+DA1.0 +z -Wl,+k"
136                 PAM_LIBS="/usr/lib/libpam.1"
137                 RANLIB="/usr/bin/ranlib"
138                 RM="/bin/rm"
139                 SHLIB_LDFLAGS="-b -Bsymbolic"
140                 SHLIB_SUFFIX="sl"
141                 TXLIBS="/usr/lib/libHcurses.a"
142                 VFSCK_CFLAGS="-I/usr/old/usr/include -D_FILE64"
143                 XCFLAGS0="-ldld -lc -Wp,-H200000 -Wl,-a,archive -DAUTH_DBM_LOG +z -Wl,+k -D_LARGEFILE64_SOURCE"
144                 XCFLAGS64="${XCFLAGS0} +DA2.0W"
145                 XCFLAGS="${XCFLAGS0} +DA1.0"
146                 XLIBELFA="-lelf"
147                 #XLIBS="${LIB_AFSDB} -lnsl"
148                 XLIBS="${LIB_AFSDB}"
149                 YACC="/opt/langtools/bin/yacc"
150                 SHLIB_LINKER="ld -b"
151                 ;;
152
153         ia64_hpux*)
154                 AR="/usr/bin/ar"
155                 AS="/usr/ccs/bin/as"
156                 CC="/opt/ansic/bin/cc"
157                 DBM="/lib/hpux32/libndbm.so"
158                 LD="/bin/ld   "
159                 LEX="/opt/langtools/bin/lex"
160                 LWP_OPTMZ=""
161                 MT_CC="$CC"
162                 MT_CFLAGS='-D_POSIX_C_SOURCE=199506L -DAFS_PTHREAD_ENV ${XCFLAGS}'
163                 MT_LIBS="-lpthread"
164                 MV="/bin/mv"
165                 OPTMZ="-O"
166                 PAM_CFLAGS="-b +z -Wl,+k"
167                 PAM_LIBS="/usr/lib/hpux32/libpam.so"
168                 RANLIB="/usr/bin/ranlib"
169                 RM="/bin/rm"
170                 SHLIB_LDFLAGS="-b -Bsymbolic"
171                 SHLIB_SUFFIX="sl"
172                 TXLIBS="/usr/lib/hpux32/libcurses.so"
173                 VFSCK_CFLAGS="-I/usr/old/usr/include -D_FILE64"
174                 XCFLAGS0="-ldld -lc -Wp,-H200000 -Wl,-a,archive_shared -DAUTH_DBM_LOG +z -Wl,+k -D_LARGEFILE64_SOURCE"
175                 XCFLAGS64="${XCFLAGS0} +DD64"
176                 XCFLAGS="${XCFLAGS0}"
177                 XLIBELFA="-lelf"
178                 #XLIBS="${LIB_AFSDB} -lnsl"
179                 XLIBS="${LIB_AFSDB}"
180                 YACC="/opt/langtools/bin/yacc"
181                 SHLIB_LINKER="ld -b"
182                 ;;
183
184         *fbsd_*)
185                 LEX="flex -l"
186                 MT_CFLAGS='-DAFS_PTHREAD_ENV -pthread -D_REENTRANT ${XCFLAGS}'
187                 MT_LIBS="-pthread"
188                 PAM_CFLAGS="-O2 -pipe -fPIC"
189                 SHLIB_LDFLAGS="-shared -Xlinker -x"
190                 TXLIBS="-lncurses"
191                 XCFLAGS="-O2 -pipe"
192                 YACC="byacc"
193                 ;;
194
195         *nbsd20)
196                 LEX="flex -l"
197                 MT_CFLAGS='${XCFLAGS} -DAFS_PTHREAD_ENV -D_REENTRANT '
198                 MT_LIBS="-lpthread" # XXX -pthread soon
199                 PAM_CFLAGS="-O2 -pipe -fPIC"
200                 SHLIB_LDFLAGS="-shared -Xlinker -x"
201                 TXLIBS="/usr/lib/libcurses.so"
202                 XCFLAGS="-O2 -pipe"
203                 YACC="yacc"
204                 ;;
205
206         *nbsd15|*nbsd16)
207                 LEX="flex -l"
208                 MT_CFLAGS='${XCFLAGS}'
209                 MT_LIBS=""
210                 PAM_CFLAGS="-O2 -pipe -fPIC"
211                 SHLIB_LDFLAGS="-shared -Xlinker -x"
212                 TXLIBS="/usr/lib/libcurses.so"
213                 XCFLAGS="-O2 -pipe"
214                 YACC="bison -y"
215                 ;;
216
217         ia64_linux24)
218                 KERN_OPTMZ=-O2
219                 LEX="flex -l"
220                 MT_CFLAGS='-DAFS_PTHREAD_ENV -pthread -D_REENTRANT ${XCFLAGS}'
221                 MT_LIBS="-lpthread"
222                 PAM_CFLAGS="-g -O2 -Dlinux -DLINUX_PAM -fPIC"
223                 SHLIB_LDFLAGS="-shared -Xlinker -x"
224                 TXLIBS="-lncurses"
225                 XCFLAGS="-g -O2 -D_LARGEFILE64_SOURCE -G0"
226                 SHLIB_LINKER="${MT_CC} -shared"
227                 ;;
228
229         amd64_linux24)
230                 KERN_OPTMZ=-O2
231                 LEX="flex -l"
232                 MT_CFLAGS='-DAFS_PTHREAD_ENV -pthread -D_REENTRANT ${XCFLAGS}'
233                 MT_LIBS="-lpthread"
234                 PAM_CFLAGS="-g -O2 -Dlinux -DLINUX_PAM -fPIC"
235                 SHLIB_LDFLAGS="-shared -Xlinker -x"
236                 TXLIBS="-lncurses"
237                 XCFLAGS="-g -O2 -D_LARGEFILE64_SOURCE"
238                 SHLIB_LINKER="${MT_CC} -shared"
239                 ;;
240
241         ppc64_linux24)
242                 KERN_OPTMZ=-O2
243                 LEX="flex -l"
244                 MT_CFLAGS='-DAFS_PTHREAD_ENV -pthread -D_REENTRANT ${XCFLAGS}'
245                 MT_LIBS="-lpthread"
246                 PAM_CFLAGS="-g -O2 -Dlinux -DLINUX_PAM -fPIC"
247                 SHLIB_LDFLAGS="-shared -Xlinker -x"
248                 TXLIBS="/usr/lib64/libncurses.so"
249                 XCFLAGS="-g -O2 -D_LARGEFILE64_SOURCE"
250                 SHLIB_LINKER="${MT_CC} -shared"
251                 ;;
252
253         i386_linux22)
254                 CC="gcc -pipe"
255                 MT_CC="gcc -pipe"
256                 KERN_OPTMZ=-O2
257                 LEX="flex -l"
258                 MT_CFLAGS='-DAFS_PTHREAD_ENV -pthread -D_REENTRANT ${XCFLAGS}'
259                 MT_LIBS="-lpthread"
260                 PAM_CFLAGS="-O2 -Dlinux -DLINUX_PAM -fPIC"
261                 SHLIB_LDFLAGS="-shared -Xlinker -x"
262                 TXLIBS="-lncurses"
263                 XCFLAGS="-O2 -D_LARGEFILE64_SOURCE"
264                 YACC="bison -y"
265                 SHLIB_LINKER="${MT_CC} -shared"
266                 ;;
267
268         i386_umlinux22)
269                 CC="gcc -pipe"
270                 MT_CC="gcc -pipe"
271                 KERN_OPTMZ=-O2
272                 LEX="flex -l"
273                 MT_CFLAGS='-DAFS_PTHREAD_ENV -pthread -D_REENTRANT ${XCFLAGS}'
274                 MT_LIBS="-lpthread"
275                 PAM_CFLAGS="-O2 -Dlinux -DLINUX_PAM -fPIC"
276                 SHLIB_LDFLAGS="-shared -Xlinker -x"
277                 TXLIBS="-lncurses"
278                 XCFLAGS="-O2 -D_LARGEFILE64_SOURCE"
279                 YACC="bison -y"
280                 SHLIB_LINKER="${MT_CC} -shared"
281                 ;;
282
283         i386_linux24)
284                 CC="gcc -pipe"
285                 MT_CC="gcc -pipe"
286                 KERN_OPTMZ=-O2
287                 LEX="flex -l"
288                 MT_CFLAGS='-DAFS_PTHREAD_ENV -pthread -D_REENTRANT ${XCFLAGS}'
289                 MT_LIBS="-lpthread"
290                 DBG=-g
291                 KERN_DBG=-g
292                 LWP_DBG=-g
293                 LWP_OPTMZ=-O2
294                 OPTMZ=-O2
295                 PAM_CFLAGS="-g -O2 -Dlinux -DLINUX_PAM -fPIC"
296                 SHLIB_LDFLAGS="-shared -Xlinker -x"
297                 TXLIBS="-lncurses"
298                 XCFLAGS="-g -O2 -D_LARGEFILE64_SOURCE"
299                 SHLIB_LINKER="${MT_CC} -shared"
300                 ;;
301
302         i386_umlinux24)
303                 CC="gcc -pipe"
304                 MT_CC="gcc -pipe"
305                 KERN_OPTMZ=-O2
306                 LEX="flex -l"
307                 MT_CFLAGS='-DAFS_PTHREAD_ENV -pthread -D_REENTRANT ${XCFLAGS}'
308                 MT_LIBS="-lpthread"
309                 DBG=-g
310                 KERN_DBG=-g
311                 LWP_DBG=-g
312                 LWP_OPTMZ=-O2
313                 OPTMZ=-O2
314                 PAM_CFLAGS="-g -O2 -Dlinux -DLINUX_PAM -fPIC"
315                 SHLIB_LDFLAGS="-shared -Xlinker -x"
316                 TXLIBS="-lncurses"
317                 XCFLAGS="-g -O2 -D_LARGEFILE64_SOURCE"
318                 SHLIB_LINKER="${MT_CC} -shared"
319                 ;;
320
321         *_obsd*)
322                 LEX="flex -l"
323                 MT_CFLAGS='-DAFS_PTHREAD_ENV -pthread -D_REENTRANT ${XCFLAGS}'
324                 MT_LIBS="-pthread"
325                 PAM_CFLAGS="-O2 -pipe -fpic"
326                 SHLIB_CFLAGS="-fpic"
327                 SHLIB_LDFLAGS="-shared -Xlinker -x"
328                 TXLIBS="/usr/lib/libcurses.a"
329                 XCFLAGS="-O2"
330                 YACC="yacc"
331                 ;;
332
333         parisc_linux24)
334                 KERN_OPTMZ=-O2
335                 LEX="flex -l"
336                 MT_CFLAGS='-DAFS_PTHREAD_ENV -pthread -D_REENTRANT ${XCFLAGS}'
337                 MT_LIBS="-lpthread"
338                 PAM_CFLAGS="-O2 -Dlinux -DLINUX_PAM -fPIC"
339                 SHLIB_LDFLAGS="-shared -Xlinker -x"
340                 TXLIBS="-lncurses"
341                 XCFLAGS="-O2 -D_LARGEFILE64_SOURCE"
342                 YACC="bison -y"
343                 SHLIB_LINKER="${MT_CC} -shared"
344                 ;;
345
346         ppc_darwin_12)
347                 AFSD_LDFLAGS="-F/System/Library/PrivateFrameworks -framework DiskArbitration"
348                 LEX="lex -l"
349                 REGEX_OBJ="regex.o"
350                 XCFLAGS="-traditional-cpp"
351                 ;;
352
353         ppc_darwin_13)
354                 AFSD_LDFLAGS="-F/System/Library/PrivateFrameworks -framework DiskArbitration"
355                 LEX="lex -l"
356                 LWP_OPTMZ="-O2"
357                 REGEX_OBJ="regex.o"
358                 XCFLAGS="-no-cpp-precomp"
359                 ;;
360
361         ppc_darwin_14)
362                 AFSD_LDFLAGS="-F/System/Library/PrivateFrameworks -framework DiskArbitration"
363                 LEX="lex -l"
364                 LWP_OPTMZ="-O2"
365                 REGEX_OBJ="regex.o"
366                 XCFLAGS="-no-cpp-precomp"
367                 ;;
368
369         ppc_darwin_60)
370                 AFSD_LDFLAGS="-F/System/Library/PrivateFrameworks -framework DiskArbitration"
371                 LEX="lex -l"
372                 LWP_OPTMZ="-O2"
373                 REGEX_OBJ="regex.o"
374                 XCFLAGS="-no-cpp-precomp"
375                 TXLIBS="-lncurses"
376                 ;;
377
378         ppc_darwin_70)
379                 AFSD_LDFLAGS="-F/System/Library/PrivateFrameworks -framework DiskArbitration"
380                 LEX="lex -l"
381                 MT_CFLAGS='-DAFS_PTHREAD_ENV -D_REENTRANT ${XCFLAGS}'
382                 KROOT=
383                 KINCLUDES='-I$(KROOT)/System/Library/Frameworks/Kernel.framework/Headers'
384                 LWP_OPTMZ="-O2"
385                 REGEX_OBJ="regex.o"
386                 XCFLAGS="-no-cpp-precomp"
387                 TXLIBS="-lncurses"
388                 EXTRA_VLIBOBJS="fstab.o"
389                 ;;
390
391         ppc_linux22)
392                 INSTALL="install"
393                 KERN_OPTMZ=-O2
394                 LEX="flex -l"
395                 MT_CFLAGS='-DAFS_PTHREAD_ENV -pthread -D_REENTRANT ${XCFLAGS}'
396                 MT_LIBS="-lpthread"
397                 PAM_CFLAGS="-O2 -Dlinux -DLINUX_PAM -fPIC"
398                 SHLIB_LDFLAGS="-shared -Xlinker -x"
399                 TXLIBS="-lncurses"
400                 XCFLAGS="-O2 -D_LARGEFILE64_SOURCE"
401                 YACC="bison -y"
402                 SHLIB_LINKER="${MT_CC} -shared"
403                 ;;
404
405         ppc_linux24)
406                 KERN_OPTMZ=-O2
407                 LEX="flex -l"
408                 MT_CFLAGS='-DAFS_PTHREAD_ENV -pthread -D_REENTRANT ${XCFLAGS}'
409                 MT_LIBS="-lpthread"
410                 PAM_CFLAGS="-O2 -Dlinux -DLINUX_PAM -fPIC"
411                 SHLIB_LDFLAGS="-shared -Xlinker -x"
412                 TXLIBS="-lncurses"
413                 XCFLAGS="-O2 -D_LARGEFILE64_SOURCE"
414                 YACC="bison -y"
415                 SHLIB_LINKER="${MT_CC} -shared"
416                 ;;
417
418         rs_aix42)
419                 DBG=""
420                 LEX="lex"
421                 LIBSYS_AIX_EXP="afsl.exp"
422                 MT_CC="xlc_r"
423                 MT_CFLAGS='-DAFS_PTHREAD_ENV ${XCFLAGS}'
424                 MT_LIBS="-lpthreads"
425                 SHLIB_SUFFIX="o"
426                 TXLIBS="-lcurses"
427                 XCFLAGS="-K -D_NO_PROTO -D_NONSTD_TYPES -D_MBI=void"
428                 XLIBS="${LIB_AFSDB} -ldl"
429                 SHLIB_LINKER="${MT_CC} -bM:SRE -berok"
430                 AIX64="#"
431                 ;;
432
433         rs_aix51)
434                 DBG=""
435                 LEX="lex"
436                 LIBSYS_AIX_EXP="afsl.exp"
437                 MT_CC="xlc_r"
438                 MT_CFLAGS='-DAFS_PTHREAD_ENV ${XCFLAGS}'
439                 MT_LIBS="-lpthreads"
440                 SHLIB_SUFFIX="o"
441                 TXLIBS="-lcurses"
442                 XCFLAGS="-K -D_NO_PROTO -D_NONSTD_TYPES -D_MBI=void"
443                 XLIBS="${LIB_AFSDB} -ldl"
444                 SHLIB_LINKER="${MT_CC} -bM:SRE -berok"
445                 AIX64=""
446                 ;;
447
448         s390_linux22)
449                 CC="gcc"
450                 LD="gcc"
451                 KERN_OPTMZ=-O2
452                 LEX="flex -l"
453                 MT_CC="$CC"
454                 MT_CFLAGS='-DAFS_PTHREAD_ENV -pthread -D_REENTRANT ${XCFLAGS}'
455                 MT_LIBS="-lpthread"
456                 PAM_CFLAGS="-O -Dlinux -DLINUX_PAM -fPIC"
457                 SHLIB_LDFLAGS="-shared -Xlinker -x"
458                 TXLIBS="-lncurses"
459                 XCFLAGS="-O -g -D_LARGEFILE64_SOURCE"
460                 YACC="bison -y"
461                 SHLIB_LINKER="${MT_CC} -shared"
462                 ;;
463
464         s390_linux24)
465                 CC="gcc"
466                 LD="gcc"
467                 KERN_OPTMZ=-O2
468                 LEX="flex -l"
469                 MT_CC="$CC"
470                 MT_CFLAGS='-DAFS_PTHREAD_ENV -pthread -D_REENTRANT ${XCFLAGS}'
471                 MT_LIBS="-lpthread"
472                 PAM_CFLAGS="-O -Dlinux -DLINUX_PAM -fPIC"
473                 SHLIB_LDFLAGS="-shared -Xlinker -x"
474                 TXLIBS="-lncurses"
475                 XCFLAGS="-O -g -D_LARGEFILE64_SOURCE"
476                 YACC="bison -y"
477                 SHLIB_LINKER="${MT_CC} -shared"
478                 ;;
479
480         sgi_62)
481                 PINSTALL_LIBS=-lmld
482                 AFSD_LIBS="/usr/lib/libdwarf.a /usr/lib/libelf.a"
483                 FSINCLUDES="-I/usr/include/sys/fs"
484                 LEX="lex"
485                 MT_CFLAGS='-D_SGI_MP_SOURCE -DAFS_PTHREAD_ENV ${XCFLAGS}'
486                 MT_LIBS="-lpthread"
487                 TXLIBS="-lcurses"
488                 XCFLAGS64="-64 -mips3"
489                 XCFLAGS="-o32"
490                 XLDFLAGS64="-64"
491                 XLDFLAGS="-o32"
492                 SHLIB_LINKER="${CC} -shared"
493                 ;;
494
495         sgi_63)
496                 PINSTALL_LIBS=-lmld
497                 AFSD_LIBS="/usr/lib/libdwarf.a /usr/lib/libelf.a"
498                 FSINCLUDES="-I/usr/include/sys/fs"
499                 LEX="lex"
500                 MT_CFLAGS='-D_SGI_MP_SOURCE -DAFS_PTHREAD_ENV ${XCFLAGS}'
501                 MT_LIBS="-lpthread"
502                 TXLIBS="-lcurses"
503                 XCFLAGS64="-D_BSD_COMPAT -64 -mips3"
504                 XCFLAGS="-D_OLD_TERMIOS -D_BSD_COMPAT -o32"
505                 XLDFLAGS64="-64"
506                 XLDFLAGS="-o32"
507                 SHLIB_LINKER="${CC} -shared"
508                 ;;
509
510         sgi_64)
511                 AFSD_LIBS="/usr/lib32/libdwarf.a /usr/lib32/libelf.a"
512                 FSINCLUDES="-I/usr/include/sys/fs"
513                 LEX="lex"
514                 MT_CFLAGS='-D_SGI_MP_SOURCE -DAFS_PTHREAD_ENV ${XCFLAGS}'
515                 MT_LIBS="-lpthread"
516                 TXLIBS="-lcurses"
517                 XCFLAGS64="-D_BSD_COMPAT -64 -mips3"
518                 XCFLAGS="-D_OLD_TERMIOS -D_BSD_COMPAT -n32 -woff 1009,1110,1116,1164,1171,1177,1183,1185,1204,1233,1515,1516,1548,1169,1174,1177,1196,1498,1506,1552"
519                 XLDFLAGS64="-64"
520                 XLDFLAGS="-n32"
521                 SHLIB_LINKER="${CC} -shared"
522                 ;;
523
524         sgi_65)
525                 AFSD_LIBS="/usr/lib32/libdwarf.a /usr/lib32/libelf.a"
526                 CC="/usr/bin/cc"
527                 FSINCLUDES="-I/usr/include/sys/fs"
528                 LD="/usr/bin/ld"
529                 LEX="lex"
530                 MT_CC="/usr/bin/cc"
531                 MT_CFLAGS='-D_SGI_MP_SOURCE -DAFS_PTHREAD_ENV ${XCFLAGS}'
532                 MT_LIBS="-lpthread"
533                 TXLIBS="-lcurses"
534                 XCFLAGS64="-64 -mips3"
535                 XCFLAGS="-n32 -mips3 -woff 1009,1110,1116,1164,1171,1177,1183,1185,1204,1233,1515,1516,1548,1169,1174,1177,1196,1498,1506,1552"
536                 XLDFLAGS64="-64 -mips3"
537                 XLDFLAGS="-n32 -mips3"
538                 SHLIB_LINKER="${CC} -shared"
539                 ;;
540
541         sparc64_linux22)
542                 KERN_OPTMZ=-O2
543                 LEX="flex -l"
544                 MT_CFLAGS='-DAFS_PTHREAD_ENV -pthread -D_REENTRANT ${XCFLAGS}'
545                 MT_LIBS="-lpthread"
546                 PAM_CFLAGS="-O2 -Dlinux -DLINUX_PAM -fPIC"
547                 SHLIB_LDFLAGS="-shared -Xlinker -x"
548                 TXLIBS="-lncurses"
549                 XCFLAGS="-O2 -D_LARGEFILE64_SOURCE"
550                 YACC="bison -y"
551                 SHLIB_LINKER="${MT_CC} -shared"
552                 ;;
553
554         sparc64_linux24)
555                 KERN_OPTMZ=-O2
556                 LEX="flex -l"
557                 MT_CFLAGS='-DAFS_PTHREAD_ENV -pthread -D_REENTRANT ${XCFLAGS}'
558                 MT_LIBS="-lpthread"
559                 PAM_CFLAGS="-O2 -Dlinux -DLINUX_PAM -fPIC"
560                 SHLIB_LDFLAGS="-shared -Xlinker -x"
561                 TXLIBS="-lncurses"
562                 XCFLAGS="-O2 -D_LARGEFILE64_SOURCE"
563                 YACC="bison -y"
564                 SHLIB_LINKER="${MT_CC} -shared"
565                 ;;
566
567         sparc_linux22)
568                 KERN_OPTMZ=-O2
569                 LEX="flex -l"
570                 MT_CFLAGS='-DAFS_PTHREAD_ENV -pthread -D_REENTRANT ${XCFLAGS}'
571                 MT_LIBS="-lpthread"
572                 PAM_CFLAGS="-O2 -Dlinux -DLINUX_PAM -fPIC"
573                 SHLIB_LDFLAGS="-shared -Xlinker -x"
574                 TXLIBS="-lncurses"
575                 XCFLAGS="-O2 -D_LARGEFILE64_SOURCE"
576                 YACC="bison -y"
577                 SHLIB_LINKER="${MT_CC} -shared"
578                 ;;
579
580         sun4_413)
581                 CCXPG2="/usr/xpg2bin/cc"
582                 CC="gcc"
583                 LEX="lex"
584                 SHLIB_CFLAGS="-PIC"
585                 TXLIBS="-lcurses -ltermcap"
586                 XCFLAGS=""
587                 XLIBELFA="-lelf"
588                 XLIBKVM="-lkvm"
589                 XLIBS="${LIB_AFSDB}"
590                 LD="ld"
591                 ;;
592
593         sun4x_55)
594                 CC="/opt/SUNWspro/bin/cc"
595                 LEX="lex"
596                 MT_CC="/opt/SUNWspro/bin/cc"
597                 MT_CFLAGS='-mt -DAFS_PTHREAD_ENV ${XCFLAGS}'
598                 MT_LIBS="-lpthread -lsocket"
599                 SHLIB_CFLAGS="-KPIC"
600                 TXLIBS="-lcurses"
601                 XCFLAGS="-dy -Bdynamic"
602                 XLIBELFA="-lelf"
603                 XLIBKVM="-lkvm"
604                 XLIBS="${LIB_AFSDB} -lsocket -lnsl -lintl -ldl"
605                 LD="/usr/ccs/bin/ld"
606                 SHLIB_LINKER="${CC} -G -dy -Wl,-M\$(srcdir)/mapfile -Bsymbolic -z text"
607                 ;;
608
609         sun4x_56)
610                 CC="/opt/SUNWspro/bin/cc"
611                 LEX="lex"
612                 MT_CC="/opt/SUNWspro/bin/cc"
613                 MT_CFLAGS='-mt -DAFS_PTHREAD_ENV ${XCFLAGS}'
614                 MT_LIBS="-lpthread -lsocket"
615                 PAM_CFLAGS="-KPIC"
616                 PAM_LIBS="-lc -lpam -lsocket -lnsl -lm"
617                 SHLIB_CFLAGS="-KPIC"
618                 SHLIB_LDFLAGS="-G -Bsymbolic"
619                 TXLIBS="-L/usr/ccs/lib -lcurses"
620                 XCFLAGS="-dy -Bdynamic"
621                 XLIBELFA="-lelf"
622                 LD="/usr/ccs/bin/ld"
623                 XLIBKVM="-lkvm"
624                 XLIBS="${LIB_AFSDB} -lsocket -lnsl -lintl -ldl"
625                 SHLIB_LINKER="${CC} -G -dy -Wl,-M\$(srcdir)/mapfile -Bsymbolic -z text"
626                 ;;
627
628         sun4x_57)
629                 CC="/opt/SUNWspro/bin/cc"
630                 LEX="lex"
631                 LD="/usr/ccs/bin/ld"
632                 MT_CC="/opt/SUNWspro/bin/cc"
633                 MT_CFLAGS='-mt -DAFS_PTHREAD_ENV ${XCFLAGS}'
634                 MT_LIBS="-lpthread -lsocket"
635                 PAM_CFLAGS="-KPIC"
636                 PAM_LIBS="-lc -lpam -lsocket -lnsl -lm"
637                 SHLIB_CFLAGS="-KPIC"
638                 SHLIB_LDFLAGS="-G -Bsymbolic"
639                 TXLIBS="-lcurses"
640                 XCFLAGS64='${XCFLAGS} -xarch=v9'
641                 XCFLAGS="-dy -Bdynamic"
642                 XLIBELFA="-lelf"
643                 XLIBKVM="-lkvm"
644                 XLIBS="${LIB_AFSDB} -lsocket -lnsl -lintl -ldl"
645                 SHLIB_LINKER="${CC} -G -dy -Wl,-M\$(srcdir)/mapfile -Bsymbolic -z text"
646                 ;;
647
648         sun4x_58)
649                 CC="/opt/SUNWspro/bin/cc"
650                 LEX="lex"
651                 LD="/usr/ccs/bin/ld"
652                 MT_CC="/opt/SUNWspro/bin/cc"
653                 MT_CFLAGS='-mt -DAFS_PTHREAD_ENV ${XCFLAGS}'
654                 MT_LIBS="-lpthread -lsocket"
655                 PAM_CFLAGS="-KPIC"
656                 PAM_LIBS="-lc -lpam -lsocket -lnsl -lm"
657                 SHLIB_CFLAGS="-KPIC"
658                 SHLIB_LDFLAGS="-G -Bsymbolic"
659                 TXLIBS="-lcurses"
660                 XCFLAGS64='${XCFLAGS} -xarch=v9'
661                 XCFLAGS="-dy -Bdynamic"
662                 XLIBELFA="-lelf"
663                 XLIBKVM="-lkvm"
664                 XLIBS="${LIB_AFSDB} -lsocket -lnsl -lintl -ldl"
665                 SHLIB_LINKER="${CC} -G -dy -Wl,-M\$(srcdir)/mapfile -Bsymbolic -z text"
666                 ;;
667
668         sun4x_59)
669                 CC="/opt/SUNWspro/bin/cc"
670                 LEX="lex"
671                 LD="/usr/ccs/bin/ld"
672                 MT_CC="/opt/SUNWspro/bin/cc"
673                 MT_CFLAGS='-mt -DAFS_PTHREAD_ENV ${XCFLAGS}'
674                 MT_LIBS="-lpthread -lsocket"
675                 PAM_CFLAGS="-KPIC"
676                 PAM_LIBS="-lc -lpam -lsocket -lnsl -lm"
677                 SHLIB_CFLAGS="-KPIC"
678                 SHLIB_LDFLAGS="-G -Bsymbolic"
679                 TXLIBS="-lcurses"
680                 XCFLAGS64='${XCFLAGS} -xarch=v9'
681                 XCFLAGS="-dy -Bdynamic"
682                 XLIBELFA="-lelf"
683                 XLIBKVM="-lkvm"
684                 XLIBS="${LIB_AFSDB} -lsocket -lnsl -lintl -ldl"
685                 SHLIB_LINKER="${CC} -G -dy -Wl,-M\$(srcdir)/mapfile -Bsymbolic -z text"
686                 ;;
687
688         sunx86_57)
689                 CC="/opt/SUNWspro/bin/cc"
690                 LEX="lex"
691                 LD="/usr/ccs/bin/ld"
692                 MT_CC="/opt/SUNWspro/bin/cc"
693                 MT_CFLAGS='-mt -DAFS_PTHREAD_ENV ${XCFLAGS}'
694                 MT_LIBS="-lpthread -lsocket"
695                 PAM_CFLAGS="-KPIC"
696                 PAM_LIBS="-lc -lpam -lsocket -lnsl -lm"
697                 SHLIB_CFLAGS="-KPIC"
698                 SHLIB_LDFLAGS="-G -Bsymbolic"
699                 TXLIBS="-lcurses"
700                 XCFLAGS64='${XCFLAGS} -xarch=v9'
701                 XCFLAGS="-dy -Bdynamic"
702                 XLIBELFA="-lelf"
703                 XLIBKVM="-lkvm"
704                 XLIBS="${LIB_AFSDB} -lsocket -lnsl -lintl -ldl"
705                 SHLIB_LINKER="${CC} -G -dy -Wl,-M\$(srcdir)/mapfile -Bsymbolic -z text"
706                 ;;
707
708
709         sunx86_58)
710                 CC="/opt/SUNWspro/bin/cc"
711                 LEX="lex"
712                 LD="/usr/ccs/bin/ld"
713                 MT_CC="/opt/SUNWspro/bin/cc"
714                 MT_CFLAGS='-mt -DAFS_PTHREAD_ENV ${XCFLAGS}'
715                 MT_LIBS="-lpthread -lsocket"
716                 PAM_CFLAGS="-KPIC"
717                 PAM_LIBS="-lc -lpam -lsocket -lnsl -lm"
718                 SHLIB_CFLAGS="-KPIC"
719                 SHLIB_LDFLAGS="-G -Bsymbolic"
720                 TXLIBS="-lcurses"
721                 XCFLAGS64='${XCFLAGS} -xarch=v9'
722                 XCFLAGS="-dy -Bdynamic"
723                 XLIBELFA="-lelf"
724                 XLIBKVM="-lkvm"
725                 XLIBS="${LIB_AFSDB} -lsocket -lnsl -lintl -ldl"
726                 SHLIB_LINKER="${CC} -G -dy -Wl,-M\$(srcdir)/mapfile -Bsymbolic -z text"
727                 ;;
728
729
730 esac
731
732 #
733 # Special build targets
734 #
735 case $AFS_SYSNAME in
736         sgi_6*)
737                 IRIX_SYS_SYSTM_H_HAS_MEM_FUNCS
738                 XFS_SIZE_CHECK="xfs_size_check"
739                 install_XFS_SIZE_CHECK='$(DESTDIR)${afssrvsbindir}/xfs_size_check'
740                 dest_XFS_SIZE_CHECK='$(DEST)/root.server/usr/afs/bin/xfs_size_check'
741         
742                 AC_SUBST(XFS_SIZE_CHECK)
743                 AC_SUBST(install_XFS_SIZE_CHECK)
744                 AC_SUBST(dest_XFS_SIZE_CHECK)
745         ;;
746         
747         sun4x_*|sunx86_*)
748                 FS_CONV_SOL26="fs_conv_sol26"
749                 install_FS_CONV_SOL26='$(DESTDIR)${afssrvsbindir}/fs_conv_sol26'
750                 dest_FS_CONV_SOL26='$(DEST)/root.server/usr/afs/bin/fs_conv_sol26'
751
752                 AC_SUBST(FS_CONV_SOL26)
753                 AC_SUBST(install_FS_CONV_SOL26)
754                 AC_SUBST(dest_FS_CONV_SOL26)
755         ;;
756
757         alpha_dux*)
758                 FS_CONV_OSF40D="fs_conv_dux40D"
759                 install_FS_CONV_OSF40D='$(DESTDIR)${afssrvsbindir}/fs_conv_dux40D'
760                 dest_FS_CONV_OSF40D='$(DEST)/root.server/usr/afs/bin/fs_conv_dux40D'
761
762                 AC_SUBST(FS_CONV_OSF40D)
763                 AC_SUBST(install_FS_CONV_OSF40D)
764                 AC_SUBST(dest_FS_CONV_OSF40D)
765         ;;
766 esac
767
768 dnl Disable the default for debugging/optimization if not enabled
769 if test "x$enable_debug_kernel" = "xno"; then
770   KERN_DBG=
771 fi
772
773 if test "x$enable_optimize_kernel" = "xno"; then
774   KERN_OPTMZ=
775 fi
776
777 if test "x$enable_debug" = "xno"; then
778   DBG=
779 fi
780
781 if test "x$enable_optimize" = "xno"; then
782   OPTMZ=
783 fi
784
785 if test "x$enable_debug_lwp" = "xno"; then
786   LWP_DBG=
787 fi
788
789 if test "x$enable_optimize_lwp" = "xno"; then
790   LWP_OPTMZ=
791 fi
792
793 AC_SUBST(CCXPG2)
794 AC_SUBST(AFSD_LIBS)
795 AC_SUBST(AFSD_LDFLAGS)
796 AC_SUBST(AIX64)
797 AC_SUBST(AR)
798 AC_SUBST(AS)
799 AC_SUBST(CP)
800 AC_SUBST(DBG)
801 AC_SUBST(FSINCLUDES)
802 AC_SUBST(KERN_DBG)
803 AC_SUBST(KERN_OPTMZ)
804 AC_SUBST(LD)
805 AC_SUBST(LEX)
806 AC_SUBST(LWP_DBG)
807 AC_SUBST(LWP_OPTMZ)
808 AC_SUBST(MT_CC)
809 AC_SUBST(MT_CFLAGS)
810 AC_SUBST(MT_LIBS)
811 AC_SUBST(MV)
812 AC_SUBST(OPTMZ)
813 AC_SUBST(PAM_CFLAGS)
814 AC_SUBST(PAM_LIBS)
815 AC_SUBST(PINSTALL_LIBS)
816 AC_SUBST(RANLIB)
817 AC_SUBST(REGEX_OBJ)
818 AC_SUBST(RM)
819 AC_SUBST(SHLIB_CFLAGS)
820 AC_SUBST(SHLIB_LDFLAGS)
821 AC_SUBST(SHLIB_LINKER)
822 AC_SUBST(SHLIB_SUFFIX)
823 AC_SUBST(TXLIBS)
824 AC_SUBST(VFSCK_CFLAGS)
825 AC_SUBST(XCFLAGS)
826 AC_SUBST(XCFLAGS64)
827 AC_SUBST(XLDFLAGS)
828 AC_SUBST(XLDFLAGS64)
829 AC_SUBST(XLIBELFA)
830 AC_SUBST(XLIBKVM)
831 AC_SUBST(XLIBS)
832 AC_SUBST(YACC)
833
834
835 ])