Update NEWS file with user visible changes and other noteworthy things
[openafs.git] / acinclude.m4
1 dnl This file contains the common configuration code which would
2 dnl otherwise be duplicated between configure and configure-libafs.
3 dnl
4 dnl NB: Because this code is a macro, references to positional shell
5 dnl parameters must be done like $[]1 instead of $1
6
7 AC_DEFUN(OPENAFS_CONFIGURE_COMMON,[
8
9 AC_CANONICAL_HOST
10 SRCDIR_PARENT=`pwd`
11
12 #BOZO_SAVE_CORES BOS_RESTRICTED_MODE BOS_NEW_CONFIG pam sia
13 AC_ARG_WITH(afs-sysname,
14 [  --with-afs-sysname=sys    use sys for the afs sysname]
15 )
16 AC_ARG_ENABLE( obsolete,
17 [  --enable-obsolete                    enable obsolete portions of AFS (mpp, ntp and package)],, enable_obsolete="no")
18 AC_ARG_ENABLE( insecure,
19 [  --enable-insecure                    enable insecure portions of AFS (ftpd, inetd, rcp, rlogind and rsh)],, enable_insecure="no")
20 AC_ARG_ENABLE( afsdb,
21 [  --disable-afsdb                      disable AFSDB RR support],, enable_afsdb="yes")
22 AC_ARG_ENABLE( bos-restricted-mode,
23 [  --enable-bos-restricted-mode         enable bosserver restricted mode which disables certain bosserver functionality],, enable_bos_restricted_mode="no")
24 AC_ARG_ENABLE( namei-fileserver,
25 [  --enable-namei-fileserver            force compilation of namei fileserver in preference to inode fileserver],, enable_namei_fileserver="no")
26 AC_ARG_ENABLE( fast-restart,
27 [  --enable-fast-restart                enable fast startup of file server without salvaging],, enable_fast_restart="no")
28 AC_ARG_ENABLE( bitmap-later,
29 [  --enable-bitmap-later                enable fast startup of file server by not reading bitmap till needed],, enable_bitmap_later="no")
30 AC_ARG_ENABLE( full-vos-listvol-switch,
31 [  --enable-full-vos-listvol-switch     enable vos full listvol switch for formatted output],, enable_full_vos_listvol_switch="no")
32 AC_ARG_WITH(dux-kernel-headers,
33 [  --with-dux-kernel-headers=path       use the kernel headers found at path(optional, defaults to first match in /usr/sys)]
34 )
35 AC_ARG_WITH(linux-kernel-headers,
36 [  --with-linux-kernel-headers=path     use the kernel headers found at path(optional, defaults to /usr/src/linux)]
37 )
38 AC_ARG_ENABLE(kernel-module,
39 [  --disable-kernel-module              disable compilation of the kernel module (defaults to enabled)],, enable_kernel_module="yes"
40 )
41 AC_ARG_ENABLE(redhat-buildsys,
42 [  --enable-redhat-buildsys             enable compilation of the redhat build system kernel (defaults to disabled)],, enable_redhat_buildsys="no"
43 )
44 AC_ARG_ENABLE(transarc-paths,
45 [  --enable-transarc-paths                      Use Transarc style paths like /usr/afs and /usr/vice],, enable_transarc_paths="no"
46 )
47 AC_ARG_ENABLE(tivoli-tsm,
48 [  --enable-tivoli-tsm                  Enable use of the Tivoli TSM API libraries for butc support],, enable_tivoli_tsm="no"
49 )
50 AC_ARG_ENABLE(debug-kernel,
51 [  --enable-debug-kernel                enable compilation of the kernel module with debugging information (defaults to disabled)],, enable_debug_kernel="no"
52 )
53
54 dnl weird ass systems
55 AC_AIX
56 AC_ISC_POSIX
57 AC_MINIX
58
59 dnl Various compiler setup.
60 AC_TYPE_PID_T
61 AC_TYPE_SIZE_T
62 AC_TYPE_SIGNAL
63
64 dnl Checks for programs.
65 AC_PROG_INSTALL
66 AC_PROG_LN_S
67 AC_PROG_RANLIB
68 AC_PROG_YACC
69 AM_PROG_LEX
70
71 OPENAFS_CHECK_BIGENDIAN
72
73 KERN_DEBUG_OPT=
74 if test "x$enable_debug_kernel" = "xyes"; then
75   KERN_DEBUG_OPT=-g
76 fi
77
78 AC_MSG_CHECKING(your OS)
79 system=$host
80 case $system in
81         *-linux*)
82                 MKAFS_OSTYPE=LINUX
83                 if test "x$enable_redhat_buildsys" = "xyes"; then
84                  AC_DEFINE(ENABLE_REDHAT_BUILDSYS)
85                 fi
86                 if test "x$enable_kernel_module" = "xyes"; then
87                  if test "x$with_linux_kernel_headers" != "x"; then
88                    LINUX_KERNEL_PATH="$with_linux_kernel_headers"
89                  else
90                    LINUX_KERNEL_PATH="/usr/src/linux"
91                  fi
92                  if test -f "$LINUX_KERNEL_PATH/include/linux/version.h"; then
93                   linux_kvers=`fgrep UTS_RELEASE $LINUX_KERNEL_PATH/include/linux/version.h |awk 'BEGIN { FS="\"" } { print $[]2 }'|tail -1`
94                   if test "x$linux_kvers" = "x"; then
95                     if test -f "$LINUX_KERNEL_PATH/include/linux/version-up.h"; then
96                       linux_kvers=`fgrep UTS_RELEASE $LINUX_KERNEL_PATH/include/linux/version-up.h |awk 'BEGIN { FS="\"" } { print $[]2 }'|tail -1`
97                       if test "x$linux_kvers" = "x"; then
98
99                         AC_MSG_ERROR(Linux headers lack version definition [2])
100                         exit 1
101                       else
102                         LINUX_VERSION="$linux_kvers"
103                       fi
104                     else
105                       AC_MSG_ERROR(Linux headers lack version definition)
106                       exit 1
107                     fi
108                   else
109                     LINUX_VERSION="$linux_kvers"
110                   fi
111                  else
112                     enable_kernel_module="no"
113                  fi
114                  if test ! -f "$LINUX_KERNEL_PATH/include/linux/autoconf.h"; then
115                      enable_kernel_module="no"
116                  fi
117                  if test "x$enable_kernel_module" = "xno"; then
118                   if test "x$with_linux_kernel_headers" != "x"; then
119                    AC_MSG_ERROR(No usable linux headers found at $LINUX_KERNEL_PATH)
120                    exit 1
121                   else
122                    AC_MSG_WARN(No usable linux headers found at $LINUX_KERNEL_PATH so disabling kernel module)
123                   fi
124                  fi
125                 fi
126                 AC_MSG_RESULT(linux)
127                 if test "x$enable_kernel_module" = "xyes"; then
128                  OMIT_FRAME_POINTER=
129                  if test "x$enable_debug_kernel" = "xno"; then
130                         OMIT_FRAME_POINTER=-fomit-frame-pointer
131                  fi
132                  AC_SUBST(OMIT_FRAME_POINTER)
133                  ifdef([OPENAFS_CONFIGURE_LIBAFS],
134                    [LINUX_BUILD_VNODE_FROM_INODE(src/config,afs)],
135                    [LINUX_BUILD_VNODE_FROM_INODE(${srcdir}/src/config,src/afs/LINUX,${srcdir}/src/afs/LINUX)]
136                  )
137                  LINUX_FS_STRUCT_ADDRESS_SPACE_HAS_PAGE_LOCK
138                  LINUX_FS_STRUCT_ADDRESS_SPACE_HAS_GFP_MASK
139                  LINUX_FS_STRUCT_INODE_HAS_I_TRUNCATE_SEM
140                  LINUX_FS_STRUCT_INODE_HAS_I_DIRTY_DATA_BUFFERS
141                  LINUX_FS_STRUCT_INODE_HAS_I_DEVICES
142                  LINUX_INODE_SETATTR_RETURN_TYPE
143                  LINUX_COMPLETION_H_EXISTS
144                  LINUX_EXPORTS_TASKLIST_LOCK
145                  LINUX_NEED_RHCONFIG
146                  LINUX_WHICH_MODULES
147                  if test "x$ac_cv_linux_exports_tasklist_lock" = "xyes" ; then
148                   AC_DEFINE(EXPORTED_TASKLIST_LOCK)
149                  fi
150                  if test "x$ac_cv_linux_completion_h_exists" = "xyes" ; then
151                   AC_DEFINE(COMPLETION_H_EXISTS)
152                  fi
153                  if test "x$ac_cv_linux_func_inode_setattr_returns_int" = "xyes" ; then
154                   AC_DEFINE(INODE_SETATTR_NOT_VOID)
155                  fi
156                  if test "x$ac_cv_linux_fs_struct_address_space_has_page_lock" = "xyes"; then 
157                   AC_DEFINE(STRUCT_ADDRESS_SPACE_HAS_PAGE_LOCK)
158                  fi
159                  if test "x$ac_cv_linux_fs_struct_address_space_has_gfp_mask" = "xyes"; then 
160                   AC_DEFINE(STRUCT_ADDRESS_SPACE_HAS_GFP_MASK)
161                  fi
162                  if test "x$ac_cv_linux_fs_struct_inode_has_i_truncate_sem" = "xyes"; then 
163                   AC_DEFINE(STRUCT_INODE_HAS_I_TRUNCATE_SEM)
164                  fi
165                  if test "x$ac_cv_linux_fs_struct_inode_has_i_devices" = "xyes"; then 
166                   AC_DEFINE(STRUCT_INODE_HAS_I_DEVICES)
167                  fi
168                  if test "x$ac_cv_linux_fs_struct_inode_has_i_dirty_data_buffers" = "xyes"; then 
169                   AC_DEFINE(STRUCT_INODE_HAS_I_DIRTY_DATA_BUFFERS)
170                  fi
171                 :
172                 fi
173                 ;;
174         *-solaris*)
175                 MKAFS_OSTYPE=SOLARIS
176                 AC_MSG_RESULT(sun4)
177                 SOLARIS_UFSVFS_HAS_DQRWLOCK
178                 SOLARIS_PROC_HAS_P_COREFILE
179                 ;;
180         *-sunos*)
181                 MKAFS_OSTYPE=SUNOS
182                 enable_kernel_module=no
183                 AC_MSG_RESULT(sun4)
184                 ;;
185         *-hpux*)
186                 MKAFS_OSTYPE=HPUX
187                 AC_MSG_RESULT(hp_ux)
188                 ;;
189         *-irix*)
190                 if test -d /usr/include/sys/SN/SN1; then
191                  IRIX_BUILD_IP35="IP35"
192                 fi
193                 MKAFS_OSTYPE=IRIX
194                 AC_MSG_RESULT(sgi)
195                 ;;
196         *-aix*)
197                 MKAFS_OSTYPE=AIX
198                 AC_MSG_RESULT(rs_aix)
199                 ;;
200         *-osf*)
201                 MKAFS_OSTYPE=DUX
202                 AC_MSG_RESULT(alpha_dux)
203                 if test "x$enable_kernel_module" = "xyes"; then
204                  if test "x$with_dux_kernel_headers" != "x"; then
205                    HEADER_RT=`ls ${with_dux_kernel_headers}/rt_preempt.h | head -1 | sed 's,/rt_preempt.h,,;s,/usr/sys/,,'`
206                  else
207                    HEADER_RT=`ls /usr/sys/*/rt_preempt.h | head -1 | sed 's,/rt_preempt.h,,;s,/usr/sys/,,'`
208                  fi
209                 fi
210                 if test "$HEADER_RT" = "*" ; then
211                         AC_MSG_ERROR([Need a configured kernel directory])
212                 fi
213                 AC_SUBST([HEADER_RT])
214                 ;;
215         *-darwin*)
216                 MKAFS_OSTYPE=DARWIN
217                 AC_MSG_RESULT(ppc_darwin)
218                 ;;
219         *-freebsd*)
220                 MKAFS_OSTYPE=FBSD
221                 AC_MSG_RESULT(i386_fbsd)
222                 ;;
223         *-netbsd*)
224                 MKAFS_OSTYPE=NBSD
225                 AC_MSG_RESULT(nbsd)
226                 ;;
227         *-openbsd*)
228                 MKAFS_OSTYPE=OBSD
229                 AC_MSG_RESULT(i386_obsd)
230                 ;;
231         *)
232                 AC_MSG_RESULT($system)
233                 ;;
234 esac
235 AC_SUBST(KERN_DEBUG_OPT)
236
237 if test "x$with_afs_sysname" != "x"; then
238         AFS_SYSNAME="$with_afs_sysname"
239 else
240         AC_MSG_CHECKING(your AFS sysname)
241         case $host in
242                 i386-unknown-openbsd3.1)
243                         AFS_SYSNAME="i386_obsd31"
244                         ;;
245                 i?86-*-freebsd4.2*)
246                         AFS_SYSNAME="i386_fbsd_42"
247                         ;;
248                 i?86-*-freebsd4.3*)
249                         AFS_SYSNAME="i386_fbsd_43"
250                         ;;
251                 i?86-*-freebsd4.4*)
252                         AFS_SYSNAME="i386_fbsd_44"
253                         ;;
254                 i?86-*-freebsd4.5*)
255                         AFS_SYSNAME="i386_fbsd_45"
256                         ;;
257                 i?86-*-freebsd4.6*)
258                         AFS_SYSNAME="i386_fbsd_46"
259                         ;;
260                 i?86-*-netbsd*1.5*)
261                         AFS_PARAM_COMMON=param.nbsd15.h
262                         AFS_SYSNAME="i386_nbsd15"
263                         ;;
264                 alpha-*-netbsd*1.5*)
265                         AFS_PARAM_COMMON=param.nbsd15.h
266                         AFS_SYSNAME="alpha_nbsd15"
267                         ;;
268                 i?86-*-netbsd*1.6*)
269                         AFS_PARAM_COMMON=param.nbsd16.h
270                         AFS_SYSNAME="i386_nbsd16"
271                         ;;
272                 alpha-*-netbsd*1.6*)
273                         AFS_PARAM_COMMON=param.nbsd16.h
274                         AFS_SYSNAME="alpha_nbsd16"
275                         ;;
276                 hppa*-hp-hpux11*)
277                         AFS_SYSNAME="hp_ux110"
278                         ;;
279                 hppa*-hp-hpux10*)
280                         AFS_SYSNAME="hp_ux102"
281                         ;;
282                 powerpc-apple-darwin1.2*)
283                         AFS_SYSNAME="ppc_darwin_12"
284                         ;;
285                 powerpc-apple-darwin1.3*)
286                         AFS_SYSNAME="ppc_darwin_13"
287                         ;;
288                 powerpc-apple-darwin1.4*)
289                         AFS_SYSNAME="ppc_darwin_14"
290                         ;;
291                 powerpc-apple-darwin5.1*)
292                         AFS_SYSNAME="ppc_darwin_14"
293                         ;;
294                 powerpc-apple-darwin5.2*)
295                         AFS_SYSNAME="ppc_darwin_14"
296                         ;;
297                 powerpc-apple-darwin5.3*)
298                         AFS_SYSNAME="ppc_darwin_14"
299                         ;;
300                 powerpc-apple-darwin5.4*)
301                         AFS_SYSNAME="ppc_darwin_14"
302                         ;;
303                 powerpc-apple-darwin5.5*)
304                         AFS_SYSNAME="ppc_darwin_14"
305                         ;;
306                 powerpc-apple-darwin6.0*)
307                         AFS_SYSNAME="ppc_darwin_60"
308                         ;;
309                 sparc-sun-solaris2.5*)
310                         AFS_SYSNAME="sun4x_55"
311                         ;;
312                 sparc-sun-solaris2.6)
313                         AFS_SYSNAME="sun4x_56"
314                         ;;
315                 sparc-sun-solaris2.7)
316                         AFS_SYSNAME="sun4x_57"
317                         ;;
318                 sparc-sun-solaris2.8)
319                         AFS_SYSNAME="sun4x_58"
320                         ;;
321                 sparc-sun-solaris2.9)
322                         AFS_SYSNAME="sun4x_59"
323                         ;;
324                 sparc-sun-sunos4*)
325                         AFS_SYSNAME="sun4_413"
326                         ;;
327                 i386-pc-solaris2.7)
328                         AFS_SYSNAME="sunx86_57"
329                         ;;
330                 i386-pc-solaris2.8)
331                         AFS_SYSNAME="sunx86_58"
332                         ;;
333                 i386-pc-solaris2.9)
334                         AFS_SYSNAME="sunx86_59"
335                         ;;
336                 alpha*-dec-osf4.0*)
337                         AFS_SYSNAME="alpha_dux40"
338                         ;;
339                 alpha*-dec-osf5.0*)
340                         AFS_SYSNAME="alpha_dux50"
341                         ;;
342                 mips-sgi-irix6.5)
343                         AFS_SYSNAME="sgi_65"
344                         ;;
345                 ia64-*-linux*)
346                         AFS_SYSNAME="ia64_linuxXX"
347                         ;;
348                 powerpc-*-linux*)
349                         AFS_SYSNAME="ppc_linuxXX"
350                         ;;
351                 alpha*-linux*)
352                         AFS_SYSNAME="alpha_linux_XX"
353                         ;;
354                 s390-*-linux*)
355                         AFS_SYSNAME="s390_linuxXX"
356                         ;;
357                 sparc-*-linux*)
358                         AFS_SYSNAME="sparc_linuxXX"
359                         ;;
360                 sparc64-*-linux*)
361                         AFS_SYSNAME="sparc64_linuxXX"
362                         ;;
363                 i?86-*-linux*)
364                         AFS_SYSNAME="i386_linuxXX"
365                         ;;
366                 parisc-*-linux-gnu)
367                         AFS_SYSNAME="parisc_linuxXX"
368                         ;;
369                 power*-ibm-aix4.2*)
370                         AFS_SYSNAME="rs_aix42"
371                         ;;
372                 power*-ibm-aix4.3*)
373                         AFS_SYSNAME="rs_aix42"
374                         ;;
375                 *)
376                         AC_MSG_ERROR(An AFS sysname is required)
377                         exit 1
378                         ;;
379         esac
380         case $AFS_SYSNAME in
381                 *_linux*)
382                         AFS_SYSKVERS=`echo $LINUX_VERSION | awk -F\. '{print $[]1 $[]2}'`
383                         if test "x${AFS_SYSKVERS}" = "x"; then
384                          AC_MSG_ERROR(Couldn't guess your Linux version. Please use the --with-afs-sysname option to configure an AFS sysname.)
385                         fi
386                         _AFS_SYSNAME=`echo $AFS_SYSNAME|sed s/XX\$/$AFS_SYSKVERS/`
387                         AFS_SYSNAME="$_AFS_SYSNAME"
388                         ;;
389         esac
390         AC_MSG_RESULT($AFS_SYSNAME)
391 fi
392
393 case $AFS_SYSNAME in
394         *_darwin*)
395                 DARWIN_PLIST=src/libafs/afs.${AFS_SYSNAME}.plist
396                 DARWIN_INFOFILE=afs.${AFS_SYSNAME}.plist
397                 dnl the test below fails on darwin, even if the CPPFLAGS below
398                 dnl are added. the headers from Kernel.Framework must be used
399                 dnl when KERNEL is defined.
400
401                 dnl really, such a thing isn't guaranteed to work on any 
402                 dnl platform until the kernel cflags from MakefileProto are
403                 dnl known to configure
404                 AC_DEFINE(HAVE_STRUCT_BUF)
405                 ;;
406         *)
407 AC_MSG_CHECKING(for definition of struct buf)
408 dnl save_CPPFLAGS="$CPPFLAGS"
409 dnl CPPFLAGS="$CPPFLAGS -DKERNEL -D_KERNEL -D__KERNEL -D__KERNEL__"
410 AC_CACHE_VAL(ac_cv_have_struct_buf, [
411         ac_cv_have_struct_buf=no
412         AC_TRY_COMPILE(
413                 [#include <sys/buf.h>],
414                 [struct buf x;
415                 printf("%d\n", sizeof(x));],
416                 ac_cv_have_struct_buf=yes,)
417         ]
418 )
419 dnl CPPFLAGS="$save_CPPFLAGS"
420 AC_MSG_RESULT($ac_cv_have_struct_buf)
421 if test "$ac_cv_have_struct_buf" = yes; then
422         AC_DEFINE(HAVE_STRUCT_BUF)
423 fi
424 ;;
425 esac
426
427
428 AC_CACHE_VAL(ac_cv_sockaddr_len,
429 [
430 AC_MSG_CHECKING([if struct sockaddr has sa_len field])
431 AC_TRY_COMPILE( [#include <sys/types.h>
432 #include <sys/socket.h>],
433 [struct sockaddr *a;
434 a->sa_len=0;], ac_cv_sockaddr_len=yes, ac_cv_sockaddr_len=no)
435 AC_MSG_RESULT($ac_cv_sockaddr_len)])
436 if test "$ac_cv_sockaddr_len" = "yes"; then
437    AC_DEFINE(STRUCT_SOCKADDR_HAS_SA_LEN)
438 fi
439 if test "x${MKAFS_OSTYPE}" = "xIRIX"; then
440         echo Skipping library tests because they confuse Irix.
441 else
442   AC_CHECK_FUNCS(socket)
443
444   if test "$ac_cv_func_socket" = no; then
445     for lib in socket inet; do
446         if test "$HAVE_SOCKET" != 1; then
447                 AC_CHECK_LIB(${lib}, socket,LIBS="$LIBS -l$lib";HAVE_SOCKET=1;AC_DEFINE(HAVE_SOCKET))
448         fi
449     done
450   fi
451   
452   AC_CHECK_FUNCS(connect)       
453
454   if test "$ac_cv_func_connect" = no; then
455     for lib in nsl; do
456         if test "$HAVE_CONNECT" != 1; then
457                 AC_CHECK_LIB(${lib}, connect,LIBS="$LIBS -l$lib";HAVE_CONNECT=1;AC_DEFINE(HAVE_CONNECT))
458         fi
459     done
460   fi
461
462   AC_CHECK_FUNCS(gethostbyname)
463   if test "$ac_cv_func_gethostbyname" = no; then
464         for lib in dns nsl resolv; do
465           if test "$HAVE_GETHOSTBYNAME" != 1; then
466             AC_CHECK_LIB(${lib}, gethostbyname, LIBS="$LIBS -l$lib";HAVE_GETHOSTBYNAME=1;AC_DEFINE(HAVE_GETHOSTBYNAME))
467           fi
468         done    
469   fi    
470
471   AC_CHECK_FUNCS(res_search)
472   if test "$ac_cv_func_res_search" = no; then
473         for lib in dns nsl resolv; do
474           if test "$HAVE_RES_SEARCH" != 1; then
475             AC_CHECK_LIB(${lib}, res_search, LIBS="$LIBS -l$lib";HAVE_RES_SEARCH=1;AC_DEFINE(HAVE_RES_SEARCH))
476           fi
477         done    
478         if test "$HAVE_RES_SEARCH" = 1; then
479           LIB_res_search="-l$lib"       
480         fi
481   fi    
482 fi
483
484 PTHREAD_LIBS=error
485 AC_CHECK_LIB(pthread, pthread_attr_init,
486              PTHREAD_LIBS="-lpthread")
487 if test "x$PTHREAD_LIBS" = xerror; then
488         AC_CHECK_LIB(pthreads, pthread_attr_init,
489                 PTHREAD_LIBS="-lpthreads")
490 fi
491 if test "x$PTHREAD_LIBS" = xerror; then
492         AC_CHECK_LIB(c_r, pthread_attr_init,
493                 PTHREAD_LIBS="-lc_r")
494 fi
495 if test "x$PTHREAD_LIBS" = xerror; then
496         AC_CHECK_FUNC(pthread_attr_init, PTHREAD_LIBS="")
497 fi
498 if test "x$PTHREAD_LIBS" = xerror; then
499         AC_MSG_WARN(*** Unable to locate working posix thread library ***)
500 fi
501 AC_SUBST(PTHREAD_LIBS)
502
503 WITH_OBSOLETE=NO
504 if test "$enable_obsolete" = "yes"; then
505         WITH_OBSOLETE=YES
506 fi
507
508 WITH_INSECURE=NO
509 if test "$enable_insecure" = "yes"; then
510         WITH_INSECURE=YES
511 fi
512
513 # Fast restart
514 if test "$enable_fast_restart" = "yes"; then
515         AC_DEFINE(FAST_RESTART)
516 fi
517
518 if test "$enable_bitmap_later" = "yes"; then
519         AC_DEFINE(BITMAP_LATER)
520 fi
521
522 if test "$enable_full_vos_listvol_switch" = "yes"; then
523         AC_DEFINE(FULL_LISTVOL_SWITCH)
524 fi
525
526 if test "$enable_bos_restricted_mode" = "yes"; then
527         AC_DEFINE(BOS_RESTRICTED_MODE)
528 fi
529
530 if test "$enable_namei_fileserver" = "yes"; then
531         AC_DEFINE(AFS_NAMEI_ENV)
532 fi
533
534 if test "$enable_afsdb" = "yes"; then
535         LIB_AFSDB="$LIB_res_search"
536         AC_DEFINE(AFS_AFSDB_ENV)
537 fi
538
539 dnl check for tivoli
540 AC_MSG_CHECKING(for tivoli tsm butc support)
541 XBSA_CFLAGS=""
542 if test "$enable_tivoli_tsm" = "yes"; then
543         XBSADIR1=/usr/tivoli/tsm/client/api/bin/xopen
544         XBSADIR2=/opt/tivoli/tsm/client/api/bin/xopen
545
546         if test -e "$XBSADIR1/xbsa.h"; then
547                 XBSA_CFLAGS="-Dxbsa -I$XBSADIR1"
548                 AC_MSG_RESULT([yes, $XBSA_CFLAGS])
549         elif test -e "$XBSADIR2/xbsa.h"; then
550                 XBSA_CFLAGS="-Dxbsa -I$XBSADIR2"
551                 AC_MSG_RESULT([yes, $XBSA_CFLAGS])
552         else
553                 AC_MSG_RESULT([no, missing xbsa.h header file])
554         fi
555 else
556         AC_MSG_RESULT([no])
557 fi
558 AC_SUBST(XBSA_CFLAGS)
559
560 dnl checks for header files.
561 AC_HEADER_STDC
562 AC_HEADER_SYS_WAIT
563 AC_HEADER_DIRENT
564 AC_CHECK_HEADERS(stdlib.h string.h unistd.h fcntl.h sys/time.h sys/file.h)
565 AC_CHECK_HEADERS(netinet/in.h netdb.h sys/fcntl.h sys/mnttab.h sys/mntent.h)
566 AC_CHECK_HEADERS(mntent.h sys/vfs.h sys/param.h sys/fs_types.h)
567 AC_CHECK_HEADERS(sys/mount.h strings.h termios.h signal.h)
568 AC_CHECK_HEADERS(windows.h malloc.h winsock2.h direct.h io.h)
569 AC_CHECK_HEADERS(security/pam_modules.h siad.h usersec.h ucontext.h)
570
571 AC_CHECK_FUNCS(utimes random srandom getdtablesize snprintf re_comp re_exec)
572 AC_CHECK_FUNCS(setprogname getprogname sigaction)
573 AC_CHECK_TYPE(ssize_t, int)
574
575 dnl Directory PATH handling
576 if test "x$enable_transarc_paths" = "xyes"  ; then 
577     afsconfdir=${afsconfdir=/usr/afs/etc}
578     viceetcdir=${viceetcdir=/usr/vice/etc}
579     afskerneldir=${afskerneldir=${viceetcdir}}
580     afssrvbindir=${afssrvbindir=/usr/afs/bin}
581     afssrvsbindir=${afssrvsbindir=/usr/afs/bin}
582     afssrvlibexecdir=${afssrvlibexecdir=/usr/afs/bin}
583     afsdbdir=${afsdbdir=/usr/afs/db}
584     afslogsdir=${afslogsdir=/usr/afs/logs}
585     afslocaldir=${afslocaldir=/usr/afs/local}
586     afsbackupdir=${afsbackupdir=/usr/afs/backup}
587     afsbosconfigdir=${afsbosconfigdir=/usr/afs/local}
588 else 
589     afsconfdir=${afsconfdir='${sysconfdir}/openafs/server'}
590     viceetcdir=${viceetcdir='${sysconfdir}/openafs'}
591     afskerneldir=${afskerneldir='${libdir}/openafs'}
592     afssrvbindir=${afssrvbindir='${bindir}'}
593     afssrvsbindir=${afssrvsbindir='${sbindir}'}
594     afssrvlibexecdir=${afssrvlibexecdir='${libexecdir}/openafs'}
595     afsdbdir=${afsdbdir='${localstatedir}/openafs/db'}
596     afslogsdir=${afslogsdir='${localstatedir}/openafs/logs'}
597     afslocaldir=${afslocaldir='${localstatedir}/openafs'}
598     afsbackupdir=${afsbackupdir='${localstatedir}/openafs/backup'}
599     afsbosconfigdir=${afsbosconfigdir='${sysconfdir}/openafs'}
600 fi
601 AC_SUBST(afsconfdir)
602 AC_SUBST(viceetcdir)
603 AC_SUBST(afskerneldir)
604 AC_SUBST(afssrvbindir)
605 AC_SUBST(afssrvsbindir)
606 AC_SUBST(afssrvlibexecdir)
607 AC_SUBST(afsdbdir)
608 AC_SUBST(afslogsdir)
609 AC_SUBST(afslocaldir)
610 AC_SUBST(afsbackupdir)
611 AC_SUBST(afsbosconfigdir)
612
613 if test "x$enable_kernel_module" = "xyes"; then
614 ENABLE_KERNEL_MODULE=libafs
615 fi
616
617 AC_SUBST(AFS_SYSNAME)
618 AC_SUBST(AFS_PARAM_COMMON)
619 AC_SUBST(ENABLE_KERNEL_MODULE)
620 AC_SUBST(LIB_AFSDB)
621 AC_SUBST(LINUX_KERNEL_PATH)
622 AC_SUBST(LINUX_VERSION)
623 AC_SUBST(MKAFS_OSTYPE)
624 AC_SUBST(TOP_OBJDIR)
625 AC_SUBST(TOP_SRCDIR)
626 AC_SUBST(TOP_INCDIR)
627 AC_SUBST(TOP_LIBDIR)
628 AC_SUBST(DEST)
629 AC_SUBST(WITH_OBSOLETE)
630 AC_SUBST(WITH_INSECURE)
631 AC_SUBST(DARWIN_INFOFILE)
632 AC_SUBST(IRIX_BUILD_IP35)
633
634 OPENAFS_OSCONF
635
636 ])