1 AC_INIT(src/config/stds.h)
2 AM_INIT_AUTOMAKE(openafs,devel)
4 AC_CONFIG_HEADER(src/config/afsconfig.h)
6 #BOZO_SAVE_CORES BOS_RESTRICTED_MODE BOS_NEW_CONFIG pam sia
7 AC_ARG_WITH(afs-sysname,
8 [ --with-afs-sysname=sys use sys for the afs sysname]
10 AC_ARG_ENABLE( obsolete,
11 [ --enable-obsolete enable obsolete portions of AFS (mpp, ntp and package)],, enable_obsolete="no")
12 AC_ARG_ENABLE( insecure,
13 [ --enable-insecure enable insecure portions of AFS (ftpd, inetd, rcp, rlogind and rsh)],, enable_insecure="no")
15 [ --disable-afsdb disable AFSDB RR support],, enable_afsdb="yes")
16 AC_ARG_ENABLE( bos-restricted-mode,
17 [ --enable-bos-restricted-mode enable bosserver restricted mode which disables certain bosserver functionality],, enable_bos_restricted_mode="no")
18 AC_ARG_ENABLE( namei-fileserver,
19 [ --enable-namei-fileserver force compilation of namei fileserver in preference to inode fileserver],, enable_namei_fileserver="no")
20 AC_ARG_ENABLE( fast-restart,
21 [ --enable-fast-restart enable fast startup of file server without salvaging],, enable_fast_restart="no")
22 AC_ARG_ENABLE( bitmap-later,
23 [ --enable-bitmap-later enable fast startup of file server by not reading bitmap till needed],, enable_bitmap_later="no")
24 AC_ARG_ENABLE( full-vos-listvol-switch,
25 [ --enable-full-vos-listvol-switch enable vos full listvol switch for formatted output],, enable_full_vos_listvol_switch="no")
26 AC_ARG_WITH(dux-kernel-headers,
27 [ --with-dux-kernel-headers=path use the kernel headers found at path(optional, defaults to first match in /usr/sys)]
29 AC_ARG_WITH(linux-kernel-headers,
30 [ --with-linux-kernel-headers=path use the kernel headers found at path(optional, defaults to /usr/src/linux)]
32 AC_ARG_ENABLE(kernel-module,
33 [ --disable-kernel-module disable compilation of the kernel module (defaults to enabled)],, enable_kernel_module="yes"
35 AC_ARG_ENABLE(redhat-buildsys,
36 [ --enable-redhat-buildsys enable compilation of the redhat build system kernel (defaults to disabled)],, enable_redhat_buildsys="no"
46 dnl Various compiler setup.
53 dnl Checks for programs.
60 OPENAFS_CHECK_BIGENDIAN
62 AC_MSG_CHECKING(your OS)
67 if test "x$enable_redhat_buildsys" = "xyes"; then
68 AC_DEFINE(ENABLE_REDHAT_BUILDSYS)
70 if test "x$enable_kernel_module" = "xyes"; then
71 if test "x$with_linux_kernel_headers" != "x"; then
72 LINUX_KERNEL_PATH="$with_linux_kernel_headers"
74 LINUX_KERNEL_PATH="/usr/src/linux"
76 if test -f "$LINUX_KERNEL_PATH/include/linux/version.h"; then
77 linux_kvers=`fgrep UTS_RELEASE $LINUX_KERNEL_PATH/include/linux/version.h |awk 'BEGIN { FS="\"" } { print $2 }'|tail -1`
78 if test "x$linux_kvers" = "x"; then
79 if test -f "$LINUX_KERNEL_PATH/include/linux/version-up.h"; then
80 linux_kvers=`fgrep UTS_RELEASE $LINUX_KERNEL_PATH/include/linux/version-up.h |awk 'BEGIN { FS="\"" } { print $2 }'|tail -1`
81 if test "x$linux_kvers" = "x"; then
83 AC_MSG_ERROR(Linux headers lack version definition [2])
86 LINUX_VERSION="$linux_kvers"
89 AC_MSG_ERROR(Linux headers lack version definition)
93 LINUX_VERSION="$linux_kvers"
96 enable_kernel_module="no"
98 if test ! -f "$LINUX_KERNEL_PATH/include/linux/autoconf.h"; then
99 enable_kernel_module="no"
101 if test "x$enable_kernel_module" = "xno"; then
102 if test "x$with_linux_kernel_headers" != "x"; then
103 AC_MSG_ERROR(No usable linux headers found at $LINUX_KERNEL_PATH)
106 AC_MSG_WARN(No usable linux headers found at $LINUX_KERNEL_PATH so disabling kernel module)
111 if test "x$enable_kernel_module" = "xyes"; then
112 LINUX_FS_STRUCT_INODE_HAS_I_BYTES
113 LINUX_FS_STRUCT_ADDRESS_SPACE_HAS_PAGE_LOCK
114 LINUX_FS_STRUCT_INODE_HAS_I_CDEV
115 LINUX_FS_STRUCT_INODE_HAS_I_TRUNCATE_SEM
116 LINUX_INODE_SETATTR_RETURN_TYPE
119 if test "x$ac_cv_linux_func_inode_setattr_returns_int" = "xyes" ; then
120 AC_DEFINE(INODE_SETATTR_NOT_VOID)
122 if test "x$ac_cv_linux_fs_struct_inode_has_i_cdev" = "xyes"; then
123 AC_DEFINE(STRUCT_INODE_HAS_I_CDEV)
125 if test "x$ac_cv_linux_fs_struct_inode_has_i_truncate_sem" = "xyes"; then
126 AC_DEFINE(STRUCT_INODE_HAS_I_TRUNCATE_SEM)
128 if test "x$ac_cv_linux_fs_struct_inode_has_i_bytes" = "xyes"; then
129 AC_DEFINE(STRUCT_INODE_HAS_I_BYTES)
131 if test "x$ac_cv_linux_fs_struct_address_space_has_page_lock" = "xyes"; then
132 AC_DEFINE(STRUCT_ADDRESS_SPACE_HAS_PAGE_LOCK)
140 SOLARIS_UFSVFS_HAS_DQRWLOCK
152 AC_MSG_RESULT(rs_aix)
156 AC_MSG_RESULT(alpha_dux)
157 if test "x$enable_kernel_module" = "xyes"; then
158 if test "x$with_dux_kernel_headers" != "x"; then
159 HEADER_RT=`ls ${with_dux_kernel_headers}/rt_preempt.h | head -1 | sed 's,/rt_preempt.h,,;s,/usr/sys/,,'`
161 HEADER_RT=`ls /usr/sys/*/rt_preempt.h | head -1 | sed 's,/rt_preempt.h,,;s,/usr/sys/,,'`
164 if test "$HEADER_RT" = "*" ; then
165 AC_MSG_ERROR([Need a configured kernel directory])
167 AC_SUBST([HEADER_RT])
171 AC_MSG_RESULT(ppc_darwin)
175 AC_MSG_RESULT(i386_fbsd)
178 AC_MSG_RESULT($system)
182 if test "x$with_afs_sysname" != "x"; then
183 AFS_SYSNAME="$with_afs_sysname"
185 AC_MSG_CHECKING(your AFS sysname)
188 AFS_SYSNAME="i386_fbsd_42"
191 AFS_SYSNAME="hp_ux110"
194 AFS_SYSNAME="hp_ux110"
197 AFS_SYSNAME="hp_ux102"
199 powerpc-apple-darwin1.2*)
200 AFS_SYSNAME="ppc_darwin_12"
202 powerpc-apple-darwin1.3*)
203 AFS_SYSNAME="ppc_darwin_13"
205 sparc-sun-solaris2.5*)
206 AFS_SYSNAME="sun4x_55"
208 sparc-sun-solaris2.6)
209 AFS_SYSNAME="sun4x_56"
211 sparc-sun-solaris2.7)
212 AFS_SYSNAME="sun4x_57"
214 sparc-sun-solaris2.8)
215 AFS_SYSNAME="sun4x_58"
218 AFS_SYSNAME="alpha_dux40"
221 AFS_SYSNAME="alpha_dux50"
227 AFS_SYSNAME="ia64_linuxXX"
230 AFS_SYSNAME="ppc_linuxXX"
233 AFS_SYSNAME="alpha_linux_XX"
236 AFS_SYSNAME="s390_linuxXX"
239 AFS_SYSNAME="sparc_linuxXX"
242 AFS_SYSNAME="sparc64_linuxXX"
245 AFS_SYSNAME="i386_linuxXX"
248 AFS_SYSNAME="rs_aix42"
251 AFS_SYSNAME="rs_aix42"
254 AC_MSG_ERROR(An AFS sysname is required)
260 AFS_SYSKVERS=`echo $LINUX_VERSION | awk -F\. '{print $1 $2}'`
261 if test "x${AFS_SYSKVERS}" = "x"; then
262 AC_MSG_ERROR(Couldn't guess your Linux version. Please use the --with-afs-sysname option to configure an AFS sysname.)
264 _AFS_SYSNAME=`echo $AFS_SYSNAME|sed s/XX\$/$AFS_SYSKVERS/`
265 AFS_SYSNAME="$_AFS_SYSNAME"
268 AC_MSG_RESULT($AFS_SYSNAME)
272 if test "x${MKAFS_OSTYPE}" = "xIRIX"; then
273 echo Skipping library tests because they confuse Irix.
275 AC_CHECK_FUNCS(socket)
277 if test "$ac_cv_func_socket" = no; then
278 for lib in socket inet; do
279 if test "$HAVE_SOCKET" != 1; then
280 AC_CHECK_LIB(${lib}, socket,LIBS="$LIBS -l$lib";HAVE_SOCKET=1;AC_DEFINE(HAVE_SOCKET))
285 AC_CHECK_FUNCS(connect)
287 if test "$ac_cv_func_connect" = no; then
289 if test "$HAVE_CONNECT" != 1; then
290 AC_CHECK_LIB(${lib}, connect,LIBS="$LIBS -l$lib";HAVE_CONNECT=1;AC_DEFINE(HAVE_CONNECT))
295 AC_CHECK_FUNCS(gethostbyname)
296 if test "$ac_cv_func_gethostbyname" = no; then
297 for lib in dns nsl resolv; do
298 if test "$HAVE_GETHOSTBYNAME" != 1; then
299 AC_CHECK_LIB(${lib}, gethostbyname, LIBS="$LIBS -l$lib";HAVE_GETHOSTBYNAME=1;AC_DEFINE(HAVE_GETHOSTBYNAME))
304 AC_CHECK_FUNCS(res_search)
305 if test "$ac_cv_func_res_search" = no; then
306 for lib in dns nsl resolv; do
307 if test "$HAVE_RES_SEARCH" != 1; then
308 AC_CHECK_LIB(${lib}, res_search, LIBS="$LIBS -l$lib";HAVE_RES_SEARCH=1;AC_DEFINE(HAVE_RES_SEARCH))
311 if test "$HAVE_RES_SEARCH" = 1; then
312 LIB_res_search="-l$lib"
318 AC_CHECK_LIB(pthread, pthread_attr_init,
319 PTHREAD_LIBS="-lpthread")
320 if test "x$PTHREAD_LIBS" = xerror; then
321 AC_CHECK_LIB(pthreads, pthread_attr_init,
322 PTHREAD_LIBS="-lpthreads")
324 if test "x$PTHREAD_LIBS" = xerror; then
325 AC_CHECK_LIB(c_r, pthread_attr_init,
326 PTHREAD_LIBS="-lc_r")
328 if test "x$PTHREAD_LIBS" = xerror; then
329 AC_CHECK_FUNC(pthread_attr_init, PTHREAD_LIBS="")
331 if test "x$PTHREAD_LIBS" = xerror; then
332 AC_MSG_WARN(*** Unable to locate working posix thread library ***)
334 AC_SUBST(PTHREAD_LIBS)
337 if test "$enable_obsolete" = "yes"; then
342 if test "$enable_insecure" = "yes"; then
347 if test "$enable_fast_restart" = "yes"; then
348 AC_DEFINE(FAST_RESTART)
351 if test "$enable_bitmap_later" = "yes"; then
352 AC_DEFINE(BITMAP_LATER)
355 if test "$enable_full_vos_listvol_switch" = "yes"; then
356 AC_DEFINE(FULL_LISTVOL_SWITCH)
359 if test "$enable_bos_restricted_mode" = "yes"; then
360 AC_DEFINE(BOS_RESTRICTED_MODE)
363 if test "$enable_namei_fileserver" = "yes"; then
364 AC_DEFINE(AFS_NAMEI_ENV)
367 if test "$enable_afsdb" = "yes"; then
368 LIB_AFSDB="$LIB_res_search"
369 AC_DEFINE(AFS_AFSDB_ENV)
373 TOP_SRCDIR="${SRCDIR_PARENT}/src"
374 DESTDIR="${SRCDIR_PARENT}/${AFS_SYSNAME}/dest/"
375 SRCDIR="${SRCDIR_PARENT}/${AFS_SYSNAME}/dest/"
377 dnl checks for header files.
381 AC_CHECK_HEADERS(stdlib.h string.h unistd.h fcntl.h sys/time.h sys/file.h)
382 AC_CHECK_HEADERS(netinet/in.h netdb.h sys/fcntl.h sys/mnttab.h sys/mntent.h)
383 AC_CHECK_HEADERS(mntent.h sys/vfs.h sys/param.h sys/fs_types.h)
384 AC_CHECK_HEADERS(sys/mount.h strings.h termios.h signal.h)
385 AC_CHECK_HEADERS(windows.h malloc.h winsock2.h direct.h io.h)
386 AC_CHECK_HEADERS(security/pam_modules.h siad.h usersec.h)
388 AC_CHECK_FUNCS(utimes random srandom getdtablesize snprintf re_comp re_exec)
390 if test "x$enable_kernel_module" = "xyes"; then
391 ENABLE_KERNEL_MODULE=libafs
394 AC_SUBST(AFS_SYSNAME)
395 AC_SUBST(ENABLE_KERNEL_MODULE)
397 AC_SUBST(LINUX_KERNEL_PATH)
398 AC_SUBST(LINUX_VERSION)
399 AC_SUBST(MKAFS_OSTYPE)
403 AC_SUBST(WITH_OBSOLETE)
404 AC_SUBST(WITH_INSECURE)
408 src/config/Makefile.version-NOCML \
409 src/config/Makefile.${AFS_SYSNAME} \
410 src/libafs/MakefileProto.${MKAFS_OSTYPE} \
411 src/libuafs/MakefileProto.${MKAFS_OSTYPE} \
413 src/afsd/afs.ppc_darwin.plist \
416 src/afsmonitor/Makefile \
417 src/afsweb/Makefile \
419 src/auth/test/Makefile \
421 src/bozo/test/Makefile \
423 src/bu_utils/Makefile \
424 src/bubasics/Makefile \
425 src/bucoord/Makefile \
429 src/cmd/test/Makefile \
431 src/comerr/test/Makefile \
432 src/comerr/Makefile \
433 src/config/Makefile \
435 src/des/test/Makefile \
437 src/des_stub/Makefile \
438 src/dir/test/Makefile \
440 src/export/Makefile \
441 src/finale/Makefile \
443 src/fsprobe/Makefile \
444 src/ftpd43+/Makefile \
447 src/kauth/test/Makefile \
449 src/libacl/test/Makefile \
450 src/libacl/Makefile \
451 src/libadmin/adminutil/Makefile \
452 src/libadmin/Makefile \
453 src/libadmin/bos/Makefile \
454 src/libadmin/cfg/test/Makefile \
455 src/libadmin/cfg/Makefile \
456 src/libadmin/client/Makefile \
457 src/libadmin/kas/Makefile \
458 src/libadmin/pts/Makefile \
459 src/libadmin/samples/Makefile \
460 src/libadmin/test/Makefile \
461 src/libadmin/vos/Makefile \
462 src/libafsauthent/Makefile \
463 src/libafsrpc/Makefile \
464 src/log/test/Makefile \
467 src/lwp/test/Makefile \
472 src/package/Makefile \
474 src/pinstall/test/Makefile \
475 src/pinstall/Makefile \
476 src/procmgmt/Makefile \
477 src/procmgmt/test/Makefile \
478 src/ptserver/Makefile \
480 src/rlogind/Makefile \
483 src/rx/bulk.example/Makefile \
484 src/rx/bulktest/Makefile \
485 src/rx/multi.example/Makefile \
486 src/rx/simple.example/Makefile \
487 src/rx/test/Makefile \
490 src/rxkad/test/Makefile \
491 src/rxstat/Makefile \
493 src/sgistuff/Makefile \
498 src/tviced/Makefile \
500 src/update/Makefile \
501 src/usd/test/Makefile \
505 src/util/test/Makefile \
506 src/venus/test/Makefile \
510 src/vlserver/Makefile \
512 src/vol/test/Makefile \
513 src/volser/Makefile \
514 src/wsadmin.src/Makefile \