1 dnl This file contains the common configuration code which would
2 dnl otherwise be duplicated between configure and configure-libafs.
4 dnl NB: Because this code is a macro, references to positional shell
5 dnl parameters must be done like $[]1 instead of $1
7 AC_DEFUN([OPENAFS_CONFIGURE_COMMON],[
12 #BOZO_SAVE_CORES pam sia
13 AC_ARG_WITH(afs-sysname,
14 [ --with-afs-sysname=sys use sys for the afs sysname]
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")
21 [ --disable-afsdb disable AFSDB RR support],, enable_afsdb="yes")
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)]
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)]
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)]
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)]
52 AC_ARG_ENABLE(kernel-module,
53 [ --disable-kernel-module disable compilation of the kernel module (defaults to enabled)],, enable_kernel_module="yes"
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"
58 AC_ARG_ENABLE(transarc-paths,
59 [ --enable-transarc-paths Use Transarc style paths like /usr/afs and /usr/vice],, enable_transarc_paths="no"
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"
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"
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"
71 [ --enable-debug enable compilation of the user space code with debugging information (defaults to disabled)],, enable_debug="no"
73 AC_ARG_ENABLE(optimize,
74 [ --disable-optimize disable optimization for compilation of the user space code (defaults to enabled)],, enable_optimize="yes"
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"
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"
90 dnl Various compiler setup.
94 COMPILER_HAS_FUNCTION_MACRO
96 dnl Checks for programs.
103 OPENAFS_CHECK_BIGENDIAN
105 AC_MSG_CHECKING(your OS)
110 if test "x$enable_redhat_buildsys" = "xyes"; then
111 AC_DEFINE(ENABLE_REDHAT_BUILDSYS, 1, [define if you have redhat buildsystem])
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"
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"
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
129 AC_MSG_ERROR(Linux headers lack version definition [2])
132 LINUX_VERSION="$linux_kvers"
135 AC_MSG_ERROR(Linux headers lack version definition)
139 LINUX_VERSION="$linux_kvers"
142 enable_kernel_module="no"
144 if test ! -f "$LINUX_KERNEL_PATH/include/linux/autoconf.h"; then
145 enable_kernel_module="no"
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)
152 AC_MSG_WARN(No usable linux headers found at $LINUX_KERNEL_PATH so disabling kernel module)
155 dnl do we need to determine SUBARCH from autoconf.h
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])
164 if test "x$enable_debug_kernel" = "xno"; then
165 LINUX_GCC_KOPTS="$LINUX_GCC_KOPTS -fomit-frame-pointer"
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)]
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
192 LINUX_KERNEL_SOCK_CREATE
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
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
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
224 if test "x$ac_cv_linux_exports_kallsyms_symbol" = "xyes"; then
225 linux_syscall_method=kallsyms_symbol
227 if test "x$linux_syscall_method" = "xnone"; then
228 AC_MSG_ERROR([no available sys_call_table access method])
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])
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])
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])
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])
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])
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])
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])
253 if test "x$ac_cv_linux_exports_sys_call_table" = "xyes"; then
254 AC_DEFINE(EXPORTED_SYS_CALL_TABLE)
256 if test "x$ac_cv_linux_exports_ia32_sys_call_table" = "xyes"; then
257 AC_DEFINE(EXPORTED_IA32_SYS_CALL_TABLE)
259 if test "x$ac_cv_linux_exports_kallsyms_symbol" = "xyes"; then
260 AC_DEFINE(EXPORTED_KALLSYMS_SYMBOL)
262 if test "x$ac_cv_linux_exports_kallsyms_address" = "xyes"; then
263 AC_DEFINE(EXPORTED_KALLSYMS_ADDRESS)
265 if test "x$ac_cv_linux_completion_h_exists" = "xyes" ; then
266 AC_DEFINE(COMPLETION_H_EXISTS, 1, [define if completion_h exists])
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])
271 if test "x$ac_cv_linux_defines_prev_task" = "xyes" ; then
272 AC_DEFINE(DEFINED_PREV_TASK, 1, [define if prev_task defined])
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])
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])
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])
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])
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])
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])
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])
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])
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])
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])
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])
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])
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])
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])
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])
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])
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])
331 SOLARIS_UFSVFS_HAS_DQRWLOCK
332 SOLARIS_PROC_HAS_P_COREFILE
333 SOLARIS_FS_HAS_FS_ROLLED
337 enable_kernel_module=no
345 if test -d /usr/include/sys/SN/SN1; then
346 IRIX_BUILD_IP35="IP35"
353 AC_MSG_RESULT(rs_aix)
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/,,'`
362 HEADER_RT=`ls /usr/sys/*/rt_preempt.h | head -1 | sed 's,/rt_preempt.h,,;s,/usr/sys/,,'`
365 if test "$HEADER_RT" = "*" ; then
366 AC_MSG_ERROR([Need a configured kernel directory])
368 AC_SUBST([HEADER_RT])
372 AC_MSG_RESULT(ppc_darwin)
376 AC_MSG_RESULT(i386_fbsd)
384 AC_MSG_RESULT(i386_obsd)
387 AC_MSG_RESULT($system)
391 if test "x$with_afs_sysname" != "x"; then
392 AFS_SYSNAME="$with_afs_sysname"
394 AC_MSG_CHECKING(your AFS sysname)
397 AFS_SYSNAME="i386_obsd31"
400 AFS_SYSNAME="i386_obsd32"
403 AFS_SYSNAME="i386_obsd33"
406 AFS_SYSNAME="i386_obsd34"
409 AFS_SYSNAME="i386_obsd35"
412 AFS_SYSNAME="i386_obsd36"
415 AFS_SYSNAME="i386_fbsd_42"
418 AFS_SYSNAME="i386_fbsd_43"
421 AFS_SYSNAME="i386_fbsd_44"
424 AFS_SYSNAME="i386_fbsd_45"
427 AFS_SYSNAME="i386_fbsd_46"
430 AFS_SYSNAME="i386_fbsd_47"
433 AFS_SYSNAME="i386_fbsd_50"
436 AFS_SYSNAME="i386_fbsd_51"
439 AFS_SYSNAME="i386_fbsd_52"
442 AFS_SYSNAME="i386_fbsd_53"
445 AFS_PARAM_COMMON=param.nbsd15.h
446 AFS_SYSNAME="i386_nbsd15"
449 AFS_PARAM_COMMON=param.nbsd15.h
450 AFS_SYSNAME="alpha_nbsd15"
452 i?86-*-netbsd*1.6[[M-Z]]*)
453 AFS_PARAM_COMMON=param.nbsd20.h
454 AFS_SYSNAME="i386_nbsd20"
456 powerpc-*-netbsd*1.6[[M-Z]]*)
457 AFS_PARAM_COMMON=param.nbsd20.h
458 AFS_SYSNAME="ppc_nbsd20"
461 AFS_PARAM_COMMON=param.nbsd20.h
462 AFS_SYSNAME="i386_nbsd20"
464 powerpc-*-netbsd*2.0*)
465 AFS_PARAM_COMMON=param.nbsd20.h
466 AFS_SYSNAME="ppc_nbsd20"
469 AFS_PARAM_COMMON=param.nbsd16.h
470 AFS_SYSNAME="i386_nbsd16"
473 AFS_PARAM_COMMON=param.nbsd16.h
474 AFS_SYSNAME="alpha_nbsd16"
476 powerpc-*-netbsd*1.6*)
477 AFS_PARAM_COMMON=param.nbsd16.h
478 AFS_SYSNAME="ppc_nbsd16"
481 AFS_PARAM_COMMON=param.nbsd21.h
482 AFS_SYSNAME="i386_nbsd21"
485 AFS_SYSNAME="hp_ux110"
488 AFS_SYSNAME="hp_ux11i"
491 AFS_SYSNAME="ia64_hpux1122"
494 AFS_SYSNAME="ia64_hpux1123"
497 AFS_SYSNAME="hp_ux102"
499 powerpc-apple-darwin1.2*)
500 AFS_SYSNAME="ppc_darwin_12"
502 powerpc-apple-darwin1.3*)
503 AFS_SYSNAME="ppc_darwin_13"
505 powerpc-apple-darwin1.4*)
506 AFS_SYSNAME="ppc_darwin_14"
508 powerpc-apple-darwin5.1*)
509 AFS_SYSNAME="ppc_darwin_14"
511 powerpc-apple-darwin5.2*)
512 AFS_SYSNAME="ppc_darwin_14"
514 powerpc-apple-darwin5.3*)
515 AFS_SYSNAME="ppc_darwin_14"
517 powerpc-apple-darwin5.4*)
518 AFS_SYSNAME="ppc_darwin_14"
520 powerpc-apple-darwin5.5*)
521 AFS_SYSNAME="ppc_darwin_14"
523 powerpc-apple-darwin6.0*)
524 AFS_SYSNAME="ppc_darwin_60"
526 powerpc-apple-darwin6.1*)
527 AFS_SYSNAME="ppc_darwin_60"
529 powerpc-apple-darwin6.2*)
530 AFS_SYSNAME="ppc_darwin_60"
532 powerpc-apple-darwin6.3*)
533 AFS_SYSNAME="ppc_darwin_60"
535 powerpc-apple-darwin6.4*)
536 AFS_SYSNAME="ppc_darwin_60"
538 powerpc-apple-darwin6.5*)
539 AFS_SYSNAME="ppc_darwin_60"
541 powerpc-apple-darwin7.0*)
542 AFS_SYSNAME="ppc_darwin_70"
544 powerpc-apple-darwin7.1*)
545 AFS_SYSNAME="ppc_darwin_70"
547 powerpc-apple-darwin7.2*)
548 AFS_SYSNAME="ppc_darwin_70"
550 powerpc-apple-darwin7.3*)
551 AFS_SYSNAME="ppc_darwin_70"
553 powerpc-apple-darwin7.4*)
554 AFS_SYSNAME="ppc_darwin_70"
556 powerpc-apple-darwin7.5*)
557 AFS_SYSNAME="ppc_darwin_70"
559 sparc-sun-solaris2.5*)
560 AFS_SYSNAME="sun4x_55"
563 sparc-sun-solaris2.6)
564 AFS_SYSNAME="sun4x_56"
566 sparc-sun-solaris2.7)
567 AFS_SYSNAME="sun4x_57"
569 sparc-sun-solaris2.8)
570 AFS_SYSNAME="sun4x_58"
572 sparc-sun-solaris2.9)
573 AFS_SYSNAME="sun4x_59"
575 sparc-sun-solaris2.10)
576 AFS_SYSNAME="sun4x_510"
579 AFS_SYSNAME="sun4_413"
583 AFS_SYSNAME="sunx86_57"
586 AFS_SYSNAME="sunx86_58"
589 AFS_SYSNAME="sunx86_59"
592 AFS_SYSNAME="sunx86_510"
595 AFS_SYSNAME="alpha_dux40"
598 AFS_SYSNAME="alpha_dux50"
601 AFS_SYSNAME="alpha_dux51"
607 AFS_SYSNAME="ia64_linuxXX"
610 AFS_SYSNAME="ppc_linuxXX"
613 AFS_SYSNAME="ppc64_linuxXX"
616 AFS_SYSNAME="alpha_linux_XX"
619 AFS_SYSNAME="s390_linuxXX"
622 AFS_SYSNAME="s390x_linuxXX"
625 AFS_SYSNAME="sparc_linuxXX"
628 AFS_SYSNAME="sparc64_linuxXX"
631 AFS_SYSNAME="i386_linuxXX"
634 AFS_SYSNAME="parisc_linuxXX"
638 AFS_SYSNAME="rs_aix42"
641 AFS_SYSNAME="rs_aix42"
644 AFS_SYSNAME="rs_aix51"
647 AFS_SYSNAME="rs_aix52"
650 AFS_SYSNAME="amd64_linuxXX"
654 AC_MSG_ERROR(An AFS sysname is required)
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.)
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"
668 [#include <linux/autoconf.h>],
669 [#ifndef CONFIG_USERMODE
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/`
676 CPPFLAGS="$save_CPPFLAGS"
677 AFS_SYSNAME="$_AFS_SYSNAME"
680 AC_MSG_RESULT($AFS_SYSNAME)
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.
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])
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
703 [#include <sys/buf.h>],
705 printf("%d\n", sizeof(x));],
706 ac_cv_have_struct_buf=yes,)
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])
718 AC_CACHE_VAL(ac_cv_sockaddr_len,
720 AC_MSG_CHECKING([if struct sockaddr has sa_len field])
721 AC_TRY_COMPILE( [#include <sys/types.h>
722 #include <sys/socket.h>],
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])
729 if test "x${MKAFS_OSTYPE}" = "xIRIX"; then
730 echo Skipping library tests because they confuse Irix.
732 AC_CHECK_FUNCS(socket)
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]))
742 AC_CHECK_FUNCS(connect)
744 if test "$ac_cv_func_connect" = no; then
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]))
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]))
761 dnl darwin wants it, aix hates it
762 AC_MSG_CHECKING(for the useability of arpa/nameser_compat.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>
773 ], [static int i; i = 0;],
775 AC_DEFINE(HAVE_ARPA_NAMESER_COMPAT_H)],
779 openafs_save_libs="$LIBS"
780 AC_MSG_CHECKING([for res_search])
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
788 LIBS="$openafs_save_libs"
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])
799 AC_DEFINE(HAVE_RES_SEARCH, 1, [])
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")
812 if test "x$PTHREAD_LIBS" = xerror; then
813 AC_CHECK_LIB(c_r, pthread_attr_init,
814 PTHREAD_LIBS="-lc_r")
816 if test "x$PTHREAD_LIBS" = xerror; then
817 AC_CHECK_FUNC(pthread_attr_init, PTHREAD_LIBS="")
819 if test "x$PTHREAD_LIBS" = xerror; then
820 AC_MSG_WARN(*** Unable to locate working posix thread library ***)
822 AC_SUBST(PTHREAD_LIBS)
825 if test "$enable_obsolete" = "yes"; then
830 if test "$enable_insecure" = "yes"; then
834 if test "x$with_bsd_kernel_headers" != "x"; then
835 BSD_KERNEL_PATH="$with_bsd_kernel_headers"
837 BSD_KERNEL_PATH="/usr/src/sys"
840 if test "x$with_bsd_kernel_build" != "x"; then
841 BSD_KERNEL_BUILD="$with_bsd_kernel_build"
845 BSD_KERNEL_BUILD="${BSD_KERNEL_PATH}/compile/GENERIC"
848 BSD_KERNEL_BUILD="${BSD_KERNEL_PATH}/i386/compile/GENERIC"
854 if test "$enable_supergroups" = "yes"; then
855 AC_DEFINE(SUPERGROUPS, 1, [define if you want to have support for nested pts groups])
858 if test "$enable_fast_restart" = "yes"; then
859 AC_DEFINE(FAST_RESTART, 1, [define if you want to have fast restart])
862 if test "$enable_bitmap_later" = "yes"; then
863 AC_DEFINE(BITMAP_LATER, 1, [define if you want to salvager to check bitmasks later])
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])
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])
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])
878 if test "$enable_largefile_fileserver" = "yes"; then
879 AC_DEFINE(AFS_LARGEFILE_ENV, 1, [define if you want large file fileserver])
882 if test "$enable_namei_fileserver" = "yes"; then
883 AC_DEFINE(AFS_NAMEI_ENV, 1, [define if you want to want namei fileserver])
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])
892 AC_MSG_CHECKING(for tivoli tsm butc support)
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
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])
905 AC_MSG_RESULT([no, missing xbsa.h header file])
910 AC_SUBST(XBSA_CFLAGS)
912 dnl checks for header files.
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)
923 if test "$ac_cv_header_security_pam_modules_h" = yes -a "$enable_pam" = yes; then
930 if test "$enable_login" = yes; then
935 AC_SUBST(BUILD_LOGIN)
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)
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])
952 AC_CHECK_TYPE(ssize_t, int)
955 AC_CHECK_FUNCS(timegm)
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}
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'}
985 AC_SUBST(afskerneldir)
986 AC_SUBST(afssrvbindir)
987 AC_SUBST(afssrvsbindir)
988 AC_SUBST(afssrvlibexecdir)
991 AC_SUBST(afslocaldir)
992 AC_SUBST(afsbackupdir)
993 AC_SUBST(afsbosconfigdir)
995 if test "x$enable_kernel_module" = "xyes"; then
996 ENABLE_KERNEL_MODULE=libafs
999 AC_SUBST(AFS_SYSNAME)
1000 AC_SUBST(AFS_PARAM_COMMON)
1001 AC_SUBST(ENABLE_KERNEL_MODULE)
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)
1013 AC_SUBST(WITH_OBSOLETE)
1014 AC_SUBST(WITH_INSECURE)
1015 AC_SUBST(DARWIN_INFOFILE)
1016 AC_SUBST(IRIX_BUILD_IP35)
1020 TOP_SRCDIR="${srcdir}/src"
1022 dnl If we're using ./configure, need a more reasonable TOP_SRCDIR, since relative links don't work everywhere
1028 TOP_SRCDIR=`cd $TOP_SRCDIR; pwd`
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"
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)