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