linux26-set-mps-correctly-200412102
[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 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( pam,
23 [  --disable-pam                        disable PAM support],, enable_pam="yes")
24 AC_ARG_ENABLE( bos-restricted-mode,
25 [  --enable-bos-restricted-mode         enable bosserver restricted mode which disables certain bosserver functionality],, enable_bos_restricted_mode="no")
26 AC_ARG_ENABLE( bos-new-config,
27 [  --enable-bos-new-config              enable bosserver pickup of BosConfig.new on restarts],, enable_bos_new_config="no")
28 AC_ARG_ENABLE( largefile-fileserver,
29 [  --enable-largefile-fileserver        enable large file support in fileserver],, enable_largefile_fileserver="no")
30 AC_ARG_ENABLE( namei-fileserver,
31 [  --enable-namei-fileserver            force compilation of namei fileserver in preference to inode fileserver],, enable_namei_fileserver="no")
32 AC_ARG_ENABLE( supergroups,
33 [  --enable-supergroups                 enable support for nested pts groups],, enable_supergroups="no")
34 AC_ARG_ENABLE( fast-restart,
35 [  --enable-fast-restart                enable fast startup of file server without salvaging],, enable_fast_restart="no")
36 AC_ARG_ENABLE( bitmap-later,
37 [  --enable-bitmap-later                enable fast startup of file server by not reading bitmap till needed],, enable_bitmap_later="no")
38 AC_ARG_ENABLE( full-vos-listvol-switch,
39 [  --disable-full-vos-listvol-switch    disable vos full listvol switch for formatted output],, enable_full_vos_listvol_switch="yes")
40 AC_ARG_WITH(dux-kernel-headers,
41 [  --with-dux-kernel-headers=path       use the kernel headers found at path(optional, defaults to first match in /usr/sys)]
42 )
43 AC_ARG_WITH(linux-kernel-headers,
44 [  --with-linux-kernel-headers=path     use the kernel headers found at path(optional, defaults to /usr/src/linux-2.4, then /usr/src/linux)]
45 )
46 AC_ARG_WITH(bsd-kernel-headers,
47 [  --with-bsd-kernel-headers=path       use the kernel headers found at path(optional, defaults to /usr/src/sys)]
48 )
49 AC_ARG_WITH(bsd-kernel-build,
50 [  --with-bsd-kernel-build=path         use the kernel build found at path(optional, defaults to KSRC/i386/compile/GENERIC)]
51 )
52 AC_ARG_ENABLE(kernel-module,
53 [  --disable-kernel-module              disable compilation of the kernel module (defaults to enabled)],, enable_kernel_module="yes"
54 )
55 AC_ARG_ENABLE(redhat-buildsys,
56 [  --enable-redhat-buildsys             enable compilation of the redhat build system kernel (defaults to disabled)],, enable_redhat_buildsys="no"
57 )
58 AC_ARG_ENABLE(transarc-paths,
59 [  --enable-transarc-paths                      Use Transarc style paths like /usr/afs and /usr/vice],, enable_transarc_paths="no"
60 )
61 AC_ARG_ENABLE(tivoli-tsm,
62 [  --enable-tivoli-tsm                  Enable use of the Tivoli TSM API libraries for butc support],, enable_tivoli_tsm="no"
63 )
64 AC_ARG_ENABLE(debug-kernel,
65 [  --enable-debug-kernel                enable compilation of the kernel module with debugging information (defaults to disabled)],, enable_debug_kernel="no"
66 )
67 AC_ARG_ENABLE(optimize-kernel,
68 [  --disable-optimize-kernel            disable compilation of the kernel module with optimization (defaults based on platform)],, enable_optimize_kernel="yes"
69 )
70 AC_ARG_ENABLE(debug,
71 [  --enable-debug                       enable compilation of the user space code with debugging information (defaults to disabled)],, enable_debug="no"
72 )
73 AC_ARG_ENABLE(optimize,
74 [  --disable-optimize                   disable optimization for compilation of the user space code (defaults to enabled)],, enable_optimize="yes"
75 )
76 AC_ARG_ENABLE(debug-lwp,
77 [  --enable-debug-lwp                   enable compilation of the LWP code with debugging information (defaults to disabled)],, enable_debug_lwp="no"
78 )
79 AC_ARG_ENABLE(optimize-lwp,
80 [  --disable-optimize-lwp               disable optimization for compilation of the LWP code (defaults to enabled)],, enable_optimize_lwp="yes"
81 )
82
83 enable_login="no"
84
85 dnl weird ass systems
86 AC_AIX
87 AC_ISC_POSIX
88 AC_MINIX
89
90 dnl Various compiler setup.
91 AC_TYPE_PID_T
92 AC_TYPE_SIZE_T
93 AC_TYPE_SIGNAL
94 COMPILER_HAS_FUNCTION_MACRO
95
96 dnl Checks for programs.
97 AC_PROG_INSTALL
98 AC_PROG_LN_S
99 AC_PROG_RANLIB
100 AC_PROG_YACC
101 AM_PROG_LEX
102
103 OPENAFS_CHECK_BIGENDIAN
104
105 AC_MSG_CHECKING(your OS)
106 system=$host
107 case $system in
108         *-linux*)
109                 MKAFS_OSTYPE=LINUX
110                 if test "x$enable_redhat_buildsys" = "xyes"; then
111                  AC_DEFINE(ENABLE_REDHAT_BUILDSYS, 1, [define if you have redhat buildsystem])
112                 fi
113                 if test "x$enable_kernel_module" = "xyes"; then
114                  if test "x$with_linux_kernel_headers" != "x"; then
115                    LINUX_KERNEL_PATH="$with_linux_kernel_headers"
116                  else
117                    LINUX_KERNEL_PATH="/usr/src/linux-2.4"
118                    if test ! -f "$LINUX_KERNEL_PATH/include/linux/version.h"; then
119                      LINUX_KERNEL_PATH="/usr/src/linux"
120                    fi
121                  fi
122                  if test -f "$LINUX_KERNEL_PATH/include/linux/version.h"; then
123                   linux_kvers=`fgrep UTS_RELEASE $LINUX_KERNEL_PATH/include/linux/version.h |awk 'BEGIN { FS="\"" } { print $[]2 }'|tail -n 1`
124                   if test "x$linux_kvers" = "x"; then
125                     if test -f "$LINUX_KERNEL_PATH/include/linux/version-up.h"; then
126                       linux_kvers=`fgrep UTS_RELEASE $LINUX_KERNEL_PATH/include/linux/version-up.h |awk 'BEGIN { FS="\"" } { print $[]2 }'|tail -n 1`
127                       if test "x$linux_kvers" = "x"; then
128
129                         AC_MSG_ERROR(Linux headers lack version definition [2])
130                         exit 1
131                       else
132                         LINUX_VERSION="$linux_kvers"
133                       fi
134                     else
135                       AC_MSG_ERROR(Linux headers lack version definition)
136                       exit 1
137                     fi
138                   else
139                     LINUX_VERSION="$linux_kvers"
140                   fi
141                  else
142                     enable_kernel_module="no"
143                  fi
144                  if test ! -f "$LINUX_KERNEL_PATH/include/linux/autoconf.h"; then
145                      enable_kernel_module="no"
146                  fi
147                  if test "x$enable_kernel_module" = "xno"; then
148                   if test "x$with_linux_kernel_headers" != "x"; then
149                    AC_MSG_ERROR(No usable linux headers found at $LINUX_KERNEL_PATH)
150                    exit 1
151                   else
152                    AC_MSG_WARN(No usable linux headers found at $LINUX_KERNEL_PATH so disabling kernel module)
153                   fi
154                  fi
155                  dnl do we need to determine SUBARCH from autoconf.h
156                  SUBARCH=default
157                 fi
158                 AC_MSG_RESULT(linux)
159                 if test "x$enable_kernel_module" = "xyes"; then
160                  AFS_SYSKVERS=`echo $LINUX_VERSION | awk -F\. '{print $[]1 $[]2}'`
161                  if test "x${AFS_SYSKVERS}" = "x"; then
162                         AC_MSG_ERROR(Couldn't guess your Linux version [2])
163                  fi
164                  if test "x$enable_debug_kernel" = "xno"; then
165                         LINUX_GCC_KOPTS="$LINUX_GCC_KOPTS -fomit-frame-pointer"
166                  fi
167                  OPENAFS_GCC_SUPPORTS_MARCH
168                  AC_SUBST(P5PLUS_KOPTS)
169                  OPENAFS_GCC_NEEDS_NO_STRENGTH_REDUCE
170                  OPENAFS_GCC_NEEDS_NO_STRICT_ALIASING
171                  OPENAFS_GCC_SUPPORTS_NO_COMMON
172                  OPENAFS_GCC_SUPPORTS_PIPE
173                  AC_SUBST(LINUX_GCC_KOPTS)
174                  ifdef([OPENAFS_CONFIGURE_LIBAFS],
175                    [LINUX_BUILD_VNODE_FROM_INODE(src/config,afs)],
176                    [LINUX_BUILD_VNODE_FROM_INODE(${srcdir}/src/config,src/afs/LINUX,${srcdir}/src/afs/LINUX)]
177                  )
178                  LINUX_COMPLETION_H_EXISTS
179                  LINUX_DEFINES_FOR_EACH_PROCESS
180                  LINUX_DEFINES_PREV_TASK
181                  LINUX_EXPORTS_TASKLIST_LOCK
182                  LINUX_FS_STRUCT_ADDRESS_SPACE_HAS_PAGE_LOCK
183                  LINUX_FS_STRUCT_ADDRESS_SPACE_HAS_GFP_MASK
184                  LINUX_FS_STRUCT_INODE_HAS_I_ALLOC_SEM
185                  LINUX_FS_STRUCT_INODE_HAS_I_TRUNCATE_SEM
186                  LINUX_FS_STRUCT_INODE_HAS_I_DIRTY_DATA_BUFFERS
187                  LINUX_FS_STRUCT_INODE_HAS_I_DEVICES
188                  LINUX_FS_STRUCT_INODE_HAS_I_SECURITY
189                  LINUX_INODE_SETATTR_RETURN_TYPE
190                  LINUX_KERNEL_LINUX_SYSCALL_H
191                  LINUX_KERNEL_SELINUX
192                  LINUX_KERNEL_SOCK_CREATE
193                  LINUX_NEED_RHCONFIG
194                  LINUX_RECALC_SIGPENDING_ARG_TYPE
195                  LINUX_SCHED_STRUCT_TASK_STRUCT_HAS_PARENT
196                  LINUX_SCHED_STRUCT_TASK_STRUCT_HAS_REAL_PARENT
197                  LINUX_SCHED_STRUCT_TASK_STRUCT_HAS_SIG
198                  LINUX_SCHED_STRUCT_TASK_STRUCT_HAS_SIGHAND
199                  LINUX_SCHED_STRUCT_TASK_STRUCT_HAS_SIGMASK_LOCK
200                  LINUX_WHICH_MODULES
201                  if test "x$ac_cv_linux_config_modversions" = "xno" -o $AFS_SYSKVERS -ge 26; then
202                    AC_MSG_WARN([Cannot determine sys_call_table status. assuming it isn't exported])
203                    ac_cv_linux_exports_sys_call_table=no
204                    if test -f "$LINUX_KERNEL_PATH/include/asm/ia32_unistd.h"; then
205                      ac_cv_linux_exports_ia32_sys_call_table=yes
206                    fi
207                  else
208                    LINUX_EXPORTS_INIT_MM
209                    LINUX_EXPORTS_KALLSYMS_ADDRESS
210                    LINUX_EXPORTS_KALLSYMS_SYMBOL
211                    LINUX_EXPORTS_SYS_CALL_TABLE
212                    LINUX_EXPORTS_IA32_SYS_CALL_TABLE
213                    LINUX_EXPORTS_SYS_CHDIR
214                    LINUX_EXPORTS_SYS_CLOSE
215                    LINUX_EXPORTS_SYS_WAIT4
216                    if test "x$ac_cv_linux_exports_sys_call_table" = "xno"; then
217                          linux_syscall_method=none
218                          if test "x$ac_cv_linux_exports_init_mm" = "xyes"; then
219                             linux_syscall_method=scan
220                             if test "x$ac_cv_linux_exports_kallsyms_address" = "xyes"; then
221                                linux_syscall_method=scan_with_kallsyms_address
222                             fi
223                          fi
224                          if test "x$ac_cv_linux_exports_kallsyms_symbol" = "xyes"; then
225                             linux_syscall_method=kallsyms_symbol
226                          fi
227                          if test "x$linux_syscall_method" = "xnone"; then
228                         AC_MSG_ERROR([no available sys_call_table access method])
229                          fi
230                    fi
231                  fi
232                  if test -f "$LINUX_KERNEL_PATH/include/linux/in_systm.h"; then
233                   AC_DEFINE(HAVE_IN_SYSTM_H, 1, [define if you have in_systm.h header file])
234                  fi
235                  if test -f "$LINUX_KERNEL_PATH/include/linux/mm_inline.h"; then
236                   AC_DEFINE(HAVE_MM_INLINE_H, 1, [define if you have mm_inline.h header file])
237                  fi
238                  if test -f "$LINUX_KERNEL_PATH/include/linux/in_systm.h"; then
239                   AC_DEFINE(HAVE_IN_SYSTM_H, 1, [define if you have in_systm.h header file])
240                  fi
241                  if test "x$ac_cv_linux_exports_sys_chdir" = "xyes" ; then
242                   AC_DEFINE(EXPORTED_SYS_CHDIR, 1, [define if your linux kernel exports sys_chdir])
243                  fi
244                  if test "x$ac_cv_linux_exports_sys_close" = "xyes" ; then
245                   AC_DEFINE(EXPORTED_SYS_CLOSE, 1, [define if your linux kernel exports sys_close])
246                  fi
247                  if test "x$ac_cv_linux_exports_sys_wait4" = "xyes" ; then
248                   AC_DEFINE(EXPORTED_SYS_WAIT4, 1, [define if your linux kernel exports sys_wait4])
249                  fi
250                  if test "x$ac_cv_linux_exports_tasklist_lock" = "xyes" ; then
251                   AC_DEFINE(EXPORTED_TASKLIST_LOCK, 1, [define if your linux kernel exports tasklist_lock])
252                  fi
253                  if test "x$ac_cv_linux_exports_sys_call_table" = "xyes"; then
254                   AC_DEFINE(EXPORTED_SYS_CALL_TABLE)
255                  fi
256                  if test "x$ac_cv_linux_exports_ia32_sys_call_table" = "xyes"; then
257                   AC_DEFINE(EXPORTED_IA32_SYS_CALL_TABLE)
258                  fi
259                  if test "x$ac_cv_linux_exports_kallsyms_symbol" = "xyes"; then
260                   AC_DEFINE(EXPORTED_KALLSYMS_SYMBOL)
261                  fi
262                  if test "x$ac_cv_linux_exports_kallsyms_address" = "xyes"; then
263                   AC_DEFINE(EXPORTED_KALLSYMS_ADDRESS)
264                  fi
265                  if test "x$ac_cv_linux_completion_h_exists" = "xyes" ; then
266                   AC_DEFINE(COMPLETION_H_EXISTS, 1, [define if completion_h exists])
267                  fi
268                  if test "x$ac_cv_linux_defines_for_each_process" = "xyes" ; then
269                   AC_DEFINE(DEFINED_FOR_EACH_PROCESS, 1, [define if for_each_process defined])
270                  fi
271                  if test "x$ac_cv_linux_defines_prev_task" = "xyes" ; then
272                   AC_DEFINE(DEFINED_PREV_TASK, 1, [define if prev_task defined])
273                  fi
274                  if test "x$ac_cv_linux_func_inode_setattr_returns_int" = "xyes" ; then
275                   AC_DEFINE(INODE_SETATTR_NOT_VOID, 1, [define if your setattr return return non-void])
276                  fi
277                  if test "x$ac_cv_linux_fs_struct_address_space_has_page_lock" = "xyes"; then 
278                   AC_DEFINE(STRUCT_ADDRESS_SPACE_HAS_PAGE_LOCK, 1, [define if your struct address_space has page_lock])
279                  fi
280                  if test "x$ac_cv_linux_fs_struct_address_space_has_gfp_mask" = "xyes"; then 
281                   AC_DEFINE(STRUCT_ADDRESS_SPACE_HAS_GFP_MASK, 1, [define if your struct address_space has gfp_mask])
282                  fi
283                  if test "x$ac_cv_linux_fs_struct_inode_has_i_truncate_sem" = "xyes"; then 
284                   AC_DEFINE(STRUCT_INODE_HAS_I_TRUNCATE_SEM, 1, [define if your struct inode has truncate_sem])
285                  fi
286                  if test "x$ac_cv_linux_fs_struct_inode_has_i_alloc_sem" = "xyes"; then 
287                   AC_DEFINE(STRUCT_INODE_HAS_I_ALLOC_SEM, 1, [define if your struct inode has alloc_sem])
288                  fi
289                  if test "x$ac_cv_linux_fs_struct_inode_has_i_devices" = "xyes"; then 
290                   AC_DEFINE(STRUCT_INODE_HAS_I_DEVICES, 1, [define if you struct inode has i_devices])
291                  fi
292                  if test "x$ac_cv_linux_fs_struct_inode_has_i_security" = "xyes"; then 
293                   AC_DEFINE(STRUCT_INODE_HAS_I_SECURITY, 1, [define if you struct inode has i_security])
294                  fi
295                  if test "x$ac_cv_linux_fs_struct_inode_has_i_dirty_data_buffers" = "xyes"; then 
296                   AC_DEFINE(STRUCT_INODE_HAS_I_DIRTY_DATA_BUFFERS, 1, [define if your struct inode has data_buffers])
297                  fi
298                  if test "x$ac_cv_linux_func_recalc_sigpending_takes_void" = "xyes"; then 
299                   AC_DEFINE(RECALC_SIGPENDING_TAKES_VOID, 1, [define if your recalc_sigpending takes void])
300                  fi
301                  if test "x$ac_cv_linux_kernel_is_selinux" = "xyes" ; then
302                   AC_DEFINE(LINUX_KERNEL_IS_SELINUX, 1, [define if your linux kernel uses SELinux features])
303                  fi
304                  if test "x$ac_cv_linux_kernel_sock_create_v" = "xyes" ; then
305                   AC_DEFINE(LINUX_KERNEL_SOCK_CREATE_V, 1, [define if your linux kernel uses 5 arguments for sock_create])
306                  fi
307                  if test "x$ac_linux_syscall" = "xyes" ; then
308                   AC_DEFINE(HAVE_KERNEL_LINUX_SYSCALL_H, 1, [define if your linux kernel has linux/syscall.h])
309                  fi
310                  if test "x$ac_cv_linux_sched_struct_task_struct_has_parent" = "xyes"; then 
311                   AC_DEFINE(STRUCT_TASK_STRUCT_HAS_PARENT, 1, [define if your struct task_struct has parent])
312                  fi
313                  if test "x$ac_cv_linux_sched_struct_task_struct_has_real_parent" = "xyes"; then 
314                   AC_DEFINE(STRUCT_TASK_STRUCT_HAS_REAL_PARENT, 1, [define if your struct task_struct has real_parent])
315                  fi
316                  if test "x$ac_cv_linux_sched_struct_task_struct_has_sigmask_lock" = "xyes"; then 
317                   AC_DEFINE(STRUCT_TASK_STRUCT_HAS_SIGMASK_LOCK, 1, [define if your struct task_struct has sigmask_lock])
318                  fi
319                  if test "x$ac_cv_linux_sched_struct_task_struct_has_sighand" = "xyes"; then 
320                   AC_DEFINE(STRUCT_TASK_STRUCT_HAS_SIGHAND, 1, [define if your struct task_struct has sighand])
321                  fi
322                  if test "x$ac_cv_linux_sched_struct_task_struct_has_sig" = "xyes"; then 
323                   AC_DEFINE(STRUCT_TASK_STRUCT_HAS_SIG, 1, [define if your struct task_struct has sig])
324                  fi
325                 :
326                 fi
327                 ;;
328         *-solaris*)
329                 MKAFS_OSTYPE=SOLARIS
330                 AC_MSG_RESULT(sun4)
331                 SOLARIS_UFSVFS_HAS_DQRWLOCK
332                 SOLARIS_PROC_HAS_P_COREFILE
333                 SOLARIS_FS_HAS_FS_ROLLED
334                 ;;
335         *-sunos*)
336                 MKAFS_OSTYPE=SUNOS
337                 enable_kernel_module=no
338                 AC_MSG_RESULT(sun4)
339                 ;;
340         *-hpux*)
341                 MKAFS_OSTYPE=HPUX
342                 AC_MSG_RESULT(hp_ux)
343                 ;;
344         *-irix*)
345                 if test -d /usr/include/sys/SN/SN1; then
346                  IRIX_BUILD_IP35="IP35"
347                 fi
348                 MKAFS_OSTYPE=IRIX
349                 AC_MSG_RESULT(sgi)
350                 ;;
351         *-aix*)
352                 MKAFS_OSTYPE=AIX
353                 AC_MSG_RESULT(rs_aix)
354                 ;;
355         *-osf*)
356                 MKAFS_OSTYPE=DUX
357                 AC_MSG_RESULT(alpha_dux)
358                 if test "x$enable_kernel_module" = "xyes"; then
359                  if test "x$with_dux_kernel_headers" != "x"; then
360                    HEADER_RT=`ls ${with_dux_kernel_headers}/rt_preempt.h | head -1 | sed 's,/rt_preempt.h,,;s,/usr/sys/,,'`
361                  else
362                    HEADER_RT=`ls /usr/sys/*/rt_preempt.h | head -1 | sed 's,/rt_preempt.h,,;s,/usr/sys/,,'`
363                  fi
364                 fi
365                 if test "$HEADER_RT" = "*" ; then
366                         AC_MSG_ERROR([Need a configured kernel directory])
367                 fi
368                 AC_SUBST([HEADER_RT])
369                 ;;
370         *-darwin*)
371                 MKAFS_OSTYPE=DARWIN
372                 AC_MSG_RESULT(ppc_darwin)
373                 ;;
374         *-freebsd*)
375                 MKAFS_OSTYPE=FBSD
376                 AC_MSG_RESULT(i386_fbsd)
377                 ;;
378         *-netbsd*)
379                 MKAFS_OSTYPE=NBSD
380                 AC_MSG_RESULT(nbsd)
381                 ;;
382         *-openbsd*)
383                 MKAFS_OSTYPE=OBSD
384                 AC_MSG_RESULT(i386_obsd)
385                 ;;
386         *)
387                 AC_MSG_RESULT($system)
388                 ;;
389 esac
390
391 if test "x$with_afs_sysname" != "x"; then
392         AFS_SYSNAME="$with_afs_sysname"
393 else
394         AC_MSG_CHECKING(your AFS sysname)
395         case $host in
396                 i?86-*-openbsd3.1)
397                         AFS_SYSNAME="i386_obsd31"
398                         ;;
399                 i?86-*-openbsd3.2)
400                         AFS_SYSNAME="i386_obsd32"
401                         ;;
402                 i?86-*-openbsd3.3)
403                         AFS_SYSNAME="i386_obsd33"
404                         ;;
405                 i?86-*-openbsd3.4)
406                         AFS_SYSNAME="i386_obsd34"
407                         ;;
408                 i?86-*-openbsd3.5)
409                         AFS_SYSNAME="i386_obsd35"
410                         ;;
411                 i?86-*-openbsd3.6)
412                         AFS_SYSNAME="i386_obsd36"
413                         ;;
414                 i?86-*-freebsd4.2*)
415                         AFS_SYSNAME="i386_fbsd_42"
416                         ;;
417                 i?86-*-freebsd4.3*)
418                         AFS_SYSNAME="i386_fbsd_43"
419                         ;;
420                 i?86-*-freebsd4.4*)
421                         AFS_SYSNAME="i386_fbsd_44"
422                         ;;
423                 i?86-*-freebsd4.5*)
424                         AFS_SYSNAME="i386_fbsd_45"
425                         ;;
426                 i?86-*-freebsd4.6*)
427                         AFS_SYSNAME="i386_fbsd_46"
428                         ;;
429                 i?86-*-freebsd4.7*)
430                         AFS_SYSNAME="i386_fbsd_47"
431                         ;;
432                 i?86-*-freebsd5.0*)
433                         AFS_SYSNAME="i386_fbsd_50"
434                         ;;
435                 i?86-*-freebsd5.1*)
436                         AFS_SYSNAME="i386_fbsd_51"
437                         ;;
438                 i?86-*-freebsd5.2*)
439                         AFS_SYSNAME="i386_fbsd_52"
440                         ;;
441                 i?86-*-freebsd5.3*)
442                         AFS_SYSNAME="i386_fbsd_53"
443                         ;;
444                 i?86-*-netbsd*1.5*)
445                         AFS_PARAM_COMMON=param.nbsd15.h
446                         AFS_SYSNAME="i386_nbsd15"
447                         ;;
448                 alpha-*-netbsd*1.5*)
449                         AFS_PARAM_COMMON=param.nbsd15.h
450                         AFS_SYSNAME="alpha_nbsd15"
451                         ;;
452                 i?86-*-netbsd*1.6[[M-Z]]*)
453                         AFS_PARAM_COMMON=param.nbsd20.h
454                         AFS_SYSNAME="i386_nbsd20"
455                         ;;
456                 powerpc-*-netbsd*1.6[[M-Z]]*)
457                         AFS_PARAM_COMMON=param.nbsd20.h
458                         AFS_SYSNAME="ppc_nbsd20"
459                         ;;
460                 i?86-*-netbsd*2.0*)
461                         AFS_PARAM_COMMON=param.nbsd20.h
462                         AFS_SYSNAME="i386_nbsd20"
463                         ;;
464                 powerpc-*-netbsd*2.0*)
465                         AFS_PARAM_COMMON=param.nbsd20.h
466                         AFS_SYSNAME="ppc_nbsd20"
467                         ;;
468                 i?86-*-netbsd*1.6*)
469                         AFS_PARAM_COMMON=param.nbsd16.h
470                         AFS_SYSNAME="i386_nbsd16"
471                         ;;
472                 alpha-*-netbsd*1.6*)
473                         AFS_PARAM_COMMON=param.nbsd16.h
474                         AFS_SYSNAME="alpha_nbsd16"
475                         ;;
476                 powerpc-*-netbsd*1.6*)
477                         AFS_PARAM_COMMON=param.nbsd16.h
478                         AFS_SYSNAME="ppc_nbsd16"
479                         ;;
480                 i?86-*-netbsd*2.99*)
481                         AFS_PARAM_COMMON=param.nbsd21.h
482                         AFS_SYSNAME="i386_nbsd21"
483                         ;;
484                 hppa*-hp-hpux11.0*)
485                         AFS_SYSNAME="hp_ux110"
486                         ;;
487                 hppa*-hp-hpux11.11)
488                         AFS_SYSNAME="hp_ux11i"
489                         ;;
490                 ia64-hp-hpux11.22)
491                         AFS_SYSNAME="ia64_hpux1122"
492                         ;;
493                 ia64-hp-hpux*)
494                         AFS_SYSNAME="ia64_hpux1123"
495                         ;;
496                 hppa*-hp-hpux10*)
497                         AFS_SYSNAME="hp_ux102"
498                         ;;
499                 powerpc-apple-darwin1.2*)
500                         AFS_SYSNAME="ppc_darwin_12"
501                         ;;
502                 powerpc-apple-darwin1.3*)
503                         AFS_SYSNAME="ppc_darwin_13"
504                         ;;
505                 powerpc-apple-darwin1.4*)
506                         AFS_SYSNAME="ppc_darwin_14"
507                         ;;
508                 powerpc-apple-darwin5.1*)
509                         AFS_SYSNAME="ppc_darwin_14"
510                         ;;
511                 powerpc-apple-darwin5.2*)
512                         AFS_SYSNAME="ppc_darwin_14"
513                         ;;
514                 powerpc-apple-darwin5.3*)
515                         AFS_SYSNAME="ppc_darwin_14"
516                         ;;
517                 powerpc-apple-darwin5.4*)
518                         AFS_SYSNAME="ppc_darwin_14"
519                         ;;
520                 powerpc-apple-darwin5.5*)
521                         AFS_SYSNAME="ppc_darwin_14"
522                         ;;
523                 powerpc-apple-darwin6.0*)
524                         AFS_SYSNAME="ppc_darwin_60"
525                         ;;
526                 powerpc-apple-darwin6.1*)
527                         AFS_SYSNAME="ppc_darwin_60"
528                         ;;
529                 powerpc-apple-darwin6.2*)
530                         AFS_SYSNAME="ppc_darwin_60"
531                         ;;
532                 powerpc-apple-darwin6.3*)
533                         AFS_SYSNAME="ppc_darwin_60"
534                         ;;
535                 powerpc-apple-darwin6.4*)
536                         AFS_SYSNAME="ppc_darwin_60"
537                         ;;
538                 powerpc-apple-darwin6.5*)
539                         AFS_SYSNAME="ppc_darwin_60"
540                         ;;
541                 powerpc-apple-darwin7.0*)
542                         AFS_SYSNAME="ppc_darwin_70"
543                         ;;
544                 powerpc-apple-darwin7.1*)
545                         AFS_SYSNAME="ppc_darwin_70"
546                         ;;
547                 powerpc-apple-darwin7.2*)
548                         AFS_SYSNAME="ppc_darwin_70"
549                         ;;
550                 powerpc-apple-darwin7.3*)
551                         AFS_SYSNAME="ppc_darwin_70"
552                         ;;
553                 powerpc-apple-darwin7.4*)
554                         AFS_SYSNAME="ppc_darwin_70"
555                         ;;
556                 powerpc-apple-darwin7.5*)
557                         AFS_SYSNAME="ppc_darwin_70"
558                         ;;
559                 sparc-sun-solaris2.5*)
560                         AFS_SYSNAME="sun4x_55"
561                         enable_login="yes"
562                         ;;
563                 sparc-sun-solaris2.6)
564                         AFS_SYSNAME="sun4x_56"
565                         ;;
566                 sparc-sun-solaris2.7)
567                         AFS_SYSNAME="sun4x_57"
568                         ;;
569                 sparc-sun-solaris2.8)
570                         AFS_SYSNAME="sun4x_58"
571                         ;;
572                 sparc-sun-solaris2.9)
573                         AFS_SYSNAME="sun4x_59"
574                         ;;
575                 sparc-sun-solaris2.10)
576                         AFS_SYSNAME="sun4x_510"
577                         ;;
578                 sparc-sun-sunos4*)
579                         AFS_SYSNAME="sun4_413"
580                         enable_login="yes"
581                         ;;
582                 i386-pc-solaris2.7)
583                         AFS_SYSNAME="sunx86_57"
584                         ;;
585                 i386-pc-solaris2.8)
586                         AFS_SYSNAME="sunx86_58"
587                         ;;
588                 i386-pc-solaris2.9)
589                         AFS_SYSNAME="sunx86_59"
590                         ;;
591                 i386-pc-solaris2.10)
592                         AFS_SYSNAME="sunx86_510"
593                         ;;
594                 alpha*-dec-osf4.0*)
595                         AFS_SYSNAME="alpha_dux40"
596                         ;;
597                 alpha*-dec-osf5.0*)
598                         AFS_SYSNAME="alpha_dux50"
599                         ;;
600                 alpha*-dec-osf5.1*)
601                         AFS_SYSNAME="alpha_dux51"
602                         ;;
603                 mips-sgi-irix6.5)
604                         AFS_SYSNAME="sgi_65"
605                         ;;
606                 ia64-*-linux*)
607                         AFS_SYSNAME="ia64_linuxXX"
608                         ;;
609                 powerpc-*-linux*)
610                         AFS_SYSNAME="ppc_linuxXX"
611                         ;;
612                 powerpc64-*-linux*)
613                         AFS_SYSNAME="ppc64_linuxXX"
614                         ;;
615                 alpha*-linux*)
616                         AFS_SYSNAME="alpha_linux_XX"
617                         ;;
618                 s390-*-linux*)
619                         AFS_SYSNAME="s390_linuxXX"
620                         ;;
621                 s390x-*-linux*)
622                         AFS_SYSNAME="s390x_linuxXX"
623                         ;;
624                 sparc-*-linux*)
625                         AFS_SYSNAME="sparc_linuxXX"
626                         ;;
627                 sparc64-*-linux*)
628                         AFS_SYSNAME="sparc64_linuxXX"
629                         ;;
630                 i?86-*-linux*)
631                         AFS_SYSNAME="i386_linuxXX"
632                         ;;
633                 parisc-*-linux-gnu)
634                         AFS_SYSNAME="parisc_linuxXX"
635                         enable_pam="no"
636                         ;;
637                 power*-ibm-aix4.2*)
638                         AFS_SYSNAME="rs_aix42"
639                         ;;
640                 power*-ibm-aix4.3*)
641                         AFS_SYSNAME="rs_aix42"
642                         ;;
643                 power*-ibm-aix5.1*)
644                         AFS_SYSNAME="rs_aix51"
645                         ;;
646                 power*-ibm-aix5.2*)
647                         AFS_SYSNAME="rs_aix52"
648                         ;;
649                 x86_64-*-linux-gnu)
650                         AFS_SYSNAME="amd64_linuxXX"
651                         enable_pam="no"
652                         ;;
653                 *)
654                         AC_MSG_ERROR(An AFS sysname is required)
655                         exit 1
656                         ;;
657         esac
658         case $AFS_SYSNAME in
659                 *_linux*)
660                         if test "x${AFS_SYSKVERS}" = "x"; then
661                          AC_MSG_ERROR(Couldn't guess your Linux version. Please use the --with-afs-sysname option to configure an AFS sysname.)
662                         fi
663                         _AFS_SYSNAME=`echo $AFS_SYSNAME|sed s/XX\$/$AFS_SYSKVERS/`
664                         AFS_SYSNAME="$_AFS_SYSNAME"
665                         save_CPPFLAGS="$CPPFLAGS"
666                         CPPFLAGS="-I${LINUX_KERNEL_PATH}/include $CPPFLAGS"
667                         AC_TRY_COMPILE(
668                          [#include <linux/autoconf.h>],
669                          [#ifndef CONFIG_USERMODE
670                           #error not UML
671                           #endif],
672                          ac_cv_linux_is_uml=yes,)
673                         if test "${ac_cv_linux_is_uml}" = yes; then
674                          _AFS_SYSNAME=`echo $AFS_SYSNAME|sed s/linux/umlinux/`
675                         fi
676                         CPPFLAGS="$save_CPPFLAGS"
677                         AFS_SYSNAME="$_AFS_SYSNAME"
678                         ;;
679         esac
680         AC_MSG_RESULT($AFS_SYSNAME)
681 fi
682
683 case $AFS_SYSNAME in
684         *_darwin*)
685                 DARWIN_PLIST=src/libafs/afs.${AFS_SYSNAME}.plist
686                 DARWIN_INFOFILE=afs.${AFS_SYSNAME}.plist
687                 dnl the test below fails on darwin, even if the CPPFLAGS below
688                 dnl are added. the headers from Kernel.Framework must be used
689                 dnl when KERNEL is defined.
690
691                 dnl really, such a thing isn't guaranteed to work on any 
692                 dnl platform until the kernel cflags from MakefileProto are
693                 dnl known to configure
694                 AC_DEFINE(HAVE_STRUCT_BUF, 1, [define if you have a struct buf])
695                 ;;
696         *)
697 AC_MSG_CHECKING(for definition of struct buf)
698 dnl save_CPPFLAGS="$CPPFLAGS"
699 dnl CPPFLAGS="$CPPFLAGS -DKERNEL -D_KERNEL -D__KERNEL -D__KERNEL__"
700 AC_CACHE_VAL(ac_cv_have_struct_buf, [
701         ac_cv_have_struct_buf=no
702         AC_TRY_COMPILE(
703                 [#include <sys/buf.h>],
704                 [struct buf x;
705                 printf("%d\n", sizeof(x));],
706                 ac_cv_have_struct_buf=yes,)
707         ]
708 )
709 dnl CPPFLAGS="$save_CPPFLAGS"
710 AC_MSG_RESULT($ac_cv_have_struct_buf)
711 if test "$ac_cv_have_struct_buf" = yes; then
712         AC_DEFINE(HAVE_STRUCT_BUF, 1, [define if you have a struct buf])
713 fi
714 ;;
715 esac
716
717
718 AC_CACHE_VAL(ac_cv_sockaddr_len,
719 [
720 AC_MSG_CHECKING([if struct sockaddr has sa_len field])
721 AC_TRY_COMPILE( [#include <sys/types.h>
722 #include <sys/socket.h>],
723 [struct sockaddr *a;
724 a->sa_len=0;], ac_cv_sockaddr_len=yes, ac_cv_sockaddr_len=no)
725 AC_MSG_RESULT($ac_cv_sockaddr_len)])
726 if test "$ac_cv_sockaddr_len" = "yes"; then
727    AC_DEFINE(STRUCT_SOCKADDR_HAS_SA_LEN, 1, [define if you struct sockaddr sa_len])
728 fi
729 if test "x${MKAFS_OSTYPE}" = "xIRIX"; then
730         echo Skipping library tests because they confuse Irix.
731 else
732   AC_CHECK_FUNCS(socket)
733
734   if test "$ac_cv_func_socket" = no; then
735     for lib in socket inet; do
736         if test "$HAVE_SOCKET" != 1; then
737                 AC_CHECK_LIB(${lib}, socket,LIBS="$LIBS -l$lib";HAVE_SOCKET=1;AC_DEFINE(HAVE_SOCKET, 1, [define if you have socket]))
738         fi
739     done
740   fi
741   
742   AC_CHECK_FUNCS(connect)       
743
744   if test "$ac_cv_func_connect" = no; then
745     for lib in nsl; do
746         if test "$HAVE_CONNECT" != 1; then
747                 AC_CHECK_LIB(${lib}, connect,LIBS="$LIBS -l$lib";HAVE_CONNECT=1;AC_DEFINE(HAVE_CONNECT, 1, [define if you have connect]))
748         fi
749     done
750   fi
751
752   AC_CHECK_FUNCS(gethostbyname)
753   if test "$ac_cv_func_gethostbyname" = no; then
754         for lib in dns nsl resolv; do
755           if test "$HAVE_GETHOSTBYNAME" != 1; then
756             AC_CHECK_LIB(${lib}, gethostbyname, LIBS="$LIBS -l$lib";HAVE_GETHOSTBYNAME=1;AC_DEFINE(HAVE_GETHOSTBYNAME, 1, [define if you have gethostbyname]))
757           fi
758         done    
759   fi    
760
761   dnl darwin wants it, aix hates it
762   AC_MSG_CHECKING(for the useability of arpa/nameser_compat.h)
763   AC_TRY_COMPILE([
764   #include <stdlib.h>
765   #include <stdio.h>
766   #include <sys/types.h>
767   #include <sys/socket.h>
768   #include <netinet/in.h>
769   #include <arpa/inet.h>
770   #include <arpa/nameser.h>
771   #include <arpa/nameser_compat.h>
772   #include <resolv.h>
773   ], [static int i; i = 0;],
774   [AC_MSG_RESULT(yes)
775    AC_DEFINE(HAVE_ARPA_NAMESER_COMPAT_H)],
776   [AC_MSG_RESULT(no)
777    ])
778
779   openafs_save_libs="$LIBS"
780   AC_MSG_CHECKING([for res_search])
781   AC_FUNC_RES_SEARCH
782
783   if test "$ac_cv_func_res_search" = no; then
784       for lib in dns nsl resolv; do
785         if test "$ac_cv_func_res_search" != yes; then
786           LIBS="-l$lib $LIBS"
787           AC_FUNC_RES_SEARCH
788           LIBS="$openafs_save_libs"
789         fi
790       done    
791       if test "$ac_cv_func_res_search" = yes; then
792         LIB_res_search="-l$lib"       
793         AC_DEFINE(HAVE_RES_SEARCH, 1, [])
794         AC_MSG_RESULT([yes, in lib$lib])
795       else
796         AC_MSG_RESULT(no)
797       fi
798   else
799     AC_DEFINE(HAVE_RES_SEARCH, 1, [])
800     AC_MSG_RESULT(yes)
801   fi
802   
803 fi
804
805 PTHREAD_LIBS=error
806 AC_CHECK_LIB(pthread, pthread_attr_init,
807              PTHREAD_LIBS="-lpthread")
808 if test "x$PTHREAD_LIBS" = xerror; then
809         AC_CHECK_LIB(pthreads, pthread_attr_init,
810                 PTHREAD_LIBS="-lpthreads")
811 fi
812 if test "x$PTHREAD_LIBS" = xerror; then
813         AC_CHECK_LIB(c_r, pthread_attr_init,
814                 PTHREAD_LIBS="-lc_r")
815 fi
816 if test "x$PTHREAD_LIBS" = xerror; then
817         AC_CHECK_FUNC(pthread_attr_init, PTHREAD_LIBS="")
818 fi
819 if test "x$PTHREAD_LIBS" = xerror; then
820         AC_MSG_WARN(*** Unable to locate working posix thread library ***)
821 fi
822 AC_SUBST(PTHREAD_LIBS)
823
824 WITH_OBSOLETE=NO
825 if test "$enable_obsolete" = "yes"; then
826         WITH_OBSOLETE=YES
827 fi
828
829 WITH_INSECURE=NO
830 if test "$enable_insecure" = "yes"; then
831         WITH_INSECURE=YES
832 fi
833
834 if test "x$with_bsd_kernel_headers" != "x"; then
835         BSD_KERNEL_PATH="$with_bsd_kernel_headers"
836 else
837         BSD_KERNEL_PATH="/usr/src/sys"
838 fi
839
840 if test "x$with_bsd_kernel_build" != "x"; then
841         BSD_KERNEL_BUILD="$with_bsd_kernel_build"
842 else
843         case $AFS_SYSNAME in
844                 i386_fbsd_4?)
845                         BSD_KERNEL_BUILD="${BSD_KERNEL_PATH}/compile/GENERIC"
846                         ;;
847                 i386_fbsd_5?)
848                         BSD_KERNEL_BUILD="${BSD_KERNEL_PATH}/i386/compile/GENERIC"
849                         ;;
850         esac
851 fi
852
853 # Fast restart
854 if test "$enable_supergroups" = "yes"; then
855         AC_DEFINE(SUPERGROUPS, 1, [define if you want to have support for nested pts groups])
856 fi
857
858 if test "$enable_fast_restart" = "yes"; then
859         AC_DEFINE(FAST_RESTART, 1, [define if you want to have fast restart])
860 fi
861
862 if test "$enable_bitmap_later" = "yes"; then
863         AC_DEFINE(BITMAP_LATER, 1, [define if you want to salvager to check bitmasks later])
864 fi
865
866 if test "$enable_full_vos_listvol_switch" = "yes"; then
867         AC_DEFINE(FULL_LISTVOL_SWITCH, 1, [define if you want to want listvol switch])
868 fi
869
870 if test "$enable_bos_restricted_mode" = "yes"; then
871         AC_DEFINE(BOS_RESTRICTED_MODE, 1, [define if you want to want bos restricted mode])
872 fi
873
874 if test "$enable_bos_new_config" = "yes"; then
875         AC_DEFINE(BOS_NEW_CONFIG, 1, [define if you want to enable automatic renaming of BosConfig.new to BosConfig at startup])
876 fi
877
878 if test "$enable_largefile_fileserver" = "yes"; then
879         AC_DEFINE(AFS_LARGEFILE_ENV, 1, [define if you want large file fileserver])
880 fi
881
882 if test "$enable_namei_fileserver" = "yes"; then
883         AC_DEFINE(AFS_NAMEI_ENV, 1, [define if you want to want namei fileserver])
884 fi
885
886 if test "$enable_afsdb" = "yes"; then
887         LIB_AFSDB="$LIB_res_search"
888         AC_DEFINE(AFS_AFSDB_ENV, 1, [define if you want to want search afsdb rr])
889 fi
890
891 dnl check for tivoli
892 AC_MSG_CHECKING(for tivoli tsm butc support)
893 XBSA_CFLAGS=""
894 if test "$enable_tivoli_tsm" = "yes"; then
895         XBSADIR1=/usr/tivoli/tsm/client/api/bin/xopen
896         XBSADIR2=/opt/tivoli/tsm/client/api/bin/xopen
897
898         if test -e "$XBSADIR1/xbsa.h"; then
899                 XBSA_CFLAGS="-Dxbsa -I$XBSADIR1"
900                 AC_MSG_RESULT([yes, $XBSA_CFLAGS])
901         elif test -e "$XBSADIR2/xbsa.h"; then
902                 XBSA_CFLAGS="-Dxbsa -I$XBSADIR2"
903                 AC_MSG_RESULT([yes, $XBSA_CFLAGS])
904         else
905                 AC_MSG_RESULT([no, missing xbsa.h header file])
906         fi
907 else
908         AC_MSG_RESULT([no])
909 fi
910 AC_SUBST(XBSA_CFLAGS)
911
912 dnl checks for header files.
913 AC_HEADER_STDC
914 AC_HEADER_SYS_WAIT
915 AC_HEADER_DIRENT
916 AC_CHECK_HEADERS(stdlib.h string.h unistd.h fcntl.h sys/time.h sys/file.h)
917 AC_CHECK_HEADERS(netinet/in.h netdb.h sys/fcntl.h sys/mnttab.h sys/mntent.h)
918 AC_CHECK_HEADERS(mntent.h sys/vfs.h sys/param.h sys/fs_types.h sys/fstyp.h)
919 AC_CHECK_HEADERS(sys/mount.h strings.h termios.h signal.h)
920 AC_CHECK_HEADERS(windows.h malloc.h winsock2.h direct.h io.h sys/user.h)
921 AC_CHECK_HEADERS(security/pam_modules.h siad.h usersec.h ucontext.h regex.h)
922
923 if test "$ac_cv_header_security_pam_modules_h" = yes -a "$enable_pam" = yes; then
924         HAVE_PAM="yes"
925 else
926         HAVE_PAM="no"
927 fi
928 AC_SUBST(HAVE_PAM)
929
930 if test "$enable_login" = yes; then
931         BUILD_LOGIN="yes"
932 else
933         BUILD_LOGIN="no"
934 fi
935 AC_SUBST(BUILD_LOGIN)
936
937 AC_CHECK_FUNCS(utimes random srandom getdtablesize snprintf strlcat strlcpy re_comp re_exec)
938 AC_CHECK_FUNCS(setprogname getprogname sigaction mkstemp vsnprintf strerror)
939
940 AC_CHECK_FUNCS(regcomp regexec regerror)
941 AC_MSG_CHECKING([for POSIX regex library])
942 if test "$ac_cv_header_regex_h" = "yes" && \
943         test "$ac_cv_func_regcomp" = "yes" && \
944         test "$ac_cv_func_regexec" = "yes" && \
945         test "$ac_cv_func_regerror" = "yes"; then
946     AC_DEFINE(HAVE_POSIX_REGEX, 1, [define if you have POSIX regex library])
947     AC_MSG_RESULT(yes)
948 else
949     AC_MSG_RESULT(no)
950 fi
951         
952 AC_CHECK_TYPE(ssize_t, int)
953 AC_SIZEOF_TYPE(long)
954
955 AC_CHECK_FUNCS(timegm)
956
957 dnl Directory PATH handling
958 if test "x$enable_transarc_paths" = "xyes"  ; then 
959     afsconfdir=${afsconfdir=/usr/afs/etc}
960     viceetcdir=${viceetcdir=/usr/vice/etc}
961     afskerneldir=${afskerneldir=${viceetcdir}}
962     afssrvbindir=${afssrvbindir=/usr/afs/bin}
963     afssrvsbindir=${afssrvsbindir=/usr/afs/bin}
964     afssrvlibexecdir=${afssrvlibexecdir=/usr/afs/bin}
965     afsdbdir=${afsdbdir=/usr/afs/db}
966     afslogsdir=${afslogsdir=/usr/afs/logs}
967     afslocaldir=${afslocaldir=/usr/afs/local}
968     afsbackupdir=${afsbackupdir=/usr/afs/backup}
969     afsbosconfigdir=${afsbosconfigdir=/usr/afs/local}
970 else 
971     afsconfdir=${afsconfdir='${sysconfdir}/openafs/server'}
972     viceetcdir=${viceetcdir='${sysconfdir}/openafs'}
973     afskerneldir=${afskerneldir='${libdir}/openafs'}
974     afssrvbindir=${afssrvbindir='${bindir}'}
975     afssrvsbindir=${afssrvsbindir='${sbindir}'}
976     afssrvlibexecdir=${afssrvlibexecdir='${libexecdir}/openafs'}
977     afsdbdir=${afsdbdir='${localstatedir}/openafs/db'}
978     afslogsdir=${afslogsdir='${localstatedir}/openafs/logs'}
979     afslocaldir=${afslocaldir='${localstatedir}/openafs'}
980     afsbackupdir=${afsbackupdir='${localstatedir}/openafs/backup'}
981     afsbosconfigdir=${afsbosconfigdir='${sysconfdir}/openafs'}
982 fi
983 AC_SUBST(afsconfdir)
984 AC_SUBST(viceetcdir)
985 AC_SUBST(afskerneldir)
986 AC_SUBST(afssrvbindir)
987 AC_SUBST(afssrvsbindir)
988 AC_SUBST(afssrvlibexecdir)
989 AC_SUBST(afsdbdir)
990 AC_SUBST(afslogsdir)
991 AC_SUBST(afslocaldir)
992 AC_SUBST(afsbackupdir)
993 AC_SUBST(afsbosconfigdir)
994
995 if test "x$enable_kernel_module" = "xyes"; then
996 ENABLE_KERNEL_MODULE=libafs
997 fi
998
999 AC_SUBST(AFS_SYSNAME)
1000 AC_SUBST(AFS_PARAM_COMMON)
1001 AC_SUBST(ENABLE_KERNEL_MODULE)
1002 AC_SUBST(LIB_AFSDB)
1003 AC_SUBST(LINUX_KERNEL_PATH)
1004 AC_SUBST(BSD_KERNEL_PATH)
1005 AC_SUBST(BSD_KERNEL_BUILD)
1006 AC_SUBST(LINUX_VERSION)
1007 AC_SUBST(MKAFS_OSTYPE)
1008 AC_SUBST(TOP_OBJDIR)
1009 AC_SUBST(TOP_SRCDIR)
1010 AC_SUBST(TOP_INCDIR)
1011 AC_SUBST(TOP_LIBDIR)
1012 AC_SUBST(DEST)
1013 AC_SUBST(WITH_OBSOLETE)
1014 AC_SUBST(WITH_INSECURE)
1015 AC_SUBST(DARWIN_INFOFILE)
1016 AC_SUBST(IRIX_BUILD_IP35)
1017
1018 OPENAFS_OSCONF
1019
1020 TOP_SRCDIR="${srcdir}/src"
1021 dnl
1022 dnl If we're using ./configure, need a more reasonable TOP_SRCDIR, since relative links don't work everywhere
1023 dnl
1024 case $TOP_SRCDIR in
1025         /*)
1026                 ;;
1027         *)
1028                 TOP_SRCDIR=`cd $TOP_SRCDIR; pwd`
1029                 ;;
1030 esac
1031
1032 TOP_OBJDIR="${SRCDIR_PARENT}"
1033 TOP_INCDIR="${SRCDIR_PARENT}/include"
1034 TOP_LIBDIR="${SRCDIR_PARENT}/lib"
1035 if test "${DEST}x" = "x"; then
1036         DEST="${SRCDIR_PARENT}/${AFS_SYSNAME}/dest"
1037 fi
1038
1039 HELPER_SPLINT="${TOP_SRCDIR}/helper-splint.sh"
1040 HELPER_SPLINTCFG="${TOP_SRCDIR}/splint.cfg"
1041 AC_SUBST(HELPER_SPLINT)
1042 AC_SUBST(HELPER_SPLINTCFG)
1043
1044
1045 ])