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_INODE_SETATTR_RETURN_TYPE
118 if test "x$ac_cv_linux_func_inode_setattr_returns_int" = "xyes" ; then
119 AC_DEFINE(INODE_SETATTR_NOT_VOID)
121 if test "x$ac_cv_linux_fs_struct_inode_has_i_cdev" = "xyes"; then
122 AC_DEFINE(STRUCT_INODE_HAS_I_CDEV)
124 if test "x$ac_cv_linux_fs_struct_inode_has_i_bytes" = "xyes"; then
125 AC_DEFINE(STRUCT_INODE_HAS_I_BYTES)
127 if test "x$ac_cv_linux_fs_struct_address_space_has_page_lock" = "xyes"; then
128 AC_DEFINE(STRUCT_ADDRESS_SPACE_HAS_PAGE_LOCK)
136 SOLARIS_UFSVFS_HAS_DQRWLOCK
148 AC_MSG_RESULT(rs_aix)
152 AC_MSG_RESULT(alpha_dux)
153 if test "x$enable_kernel_module" = "xyes"; then
154 if test "x$with_dux_kernel_headers" != "x"; then
155 HEADER_RT=`ls ${with_dux_kernel_headers}/rt_preempt.h | head -1 | sed 's,/rt_preempt.h,,;s,/usr/sys/,,'`
157 HEADER_RT=`ls /usr/sys/*/rt_preempt.h | head -1 | sed 's,/rt_preempt.h,,;s,/usr/sys/,,'`
160 if test "$HEADER_RT" = "*" ; then
161 AC_MSG_ERROR([Need a configured kernel directory])
163 AC_SUBST([HEADER_RT])
167 AC_MSG_RESULT(ppc_darwin)
171 AC_MSG_RESULT(i386_fbsd)
174 AC_MSG_RESULT($system)
178 if test "x$with_afs_sysname" != "x"; then
179 AFS_SYSNAME="$with_afs_sysname"
181 AC_MSG_CHECKING(your AFS sysname)
184 AFS_SYSNAME="i386_fbsd_42"
187 AFS_SYSNAME="hp_ux110"
190 AFS_SYSNAME="hp_ux110"
193 AFS_SYSNAME="hp_ux102"
195 powerpc-apple-darwin1.2*)
196 AFS_SYSNAME="ppc_darwin_12"
198 powerpc-apple-darwin1.3*)
199 AFS_SYSNAME="ppc_darwin_13"
201 sparc-sun-solaris2.5*)
202 AFS_SYSNAME="sun4x_55"
204 sparc-sun-solaris2.6)
205 AFS_SYSNAME="sun4x_56"
207 sparc-sun-solaris2.7)
208 AFS_SYSNAME="sun4x_57"
210 sparc-sun-solaris2.8)
211 AFS_SYSNAME="sun4x_58"
214 AFS_SYSNAME="alpha_dux40"
217 AFS_SYSNAME="alpha_dux50"
223 AFS_SYSNAME="ia64_linuxXX"
226 AFS_SYSNAME="ppc_linuxXX"
229 AFS_SYSNAME="alpha_linux_XX"
232 AFS_SYSNAME="s390_linuxXX"
235 AFS_SYSNAME="sparc_linuxXX"
238 AFS_SYSNAME="sparc64_linuxXX"
241 AFS_SYSNAME="i386_linuxXX"
244 AFS_SYSNAME="rs_aix42"
247 AFS_SYSNAME="rs_aix42"
250 AC_MSG_ERROR(An AFS sysname is required)
256 AFS_SYSKVERS=`echo $LINUX_VERSION | awk -F\. '{print $1 $2}'`
257 if test "x${AFS_SYSKVERS}" = "x"; then
258 AC_MSG_ERROR(Couldn't guess your Linux version. Please use the --with-afs-sysname option to configure an AFS sysname.)
260 _AFS_SYSNAME=`echo $AFS_SYSNAME|sed s/XX\$/$AFS_SYSKVERS/`
261 AFS_SYSNAME="$_AFS_SYSNAME"
264 AC_MSG_RESULT($AFS_SYSNAME)
268 if test "x${MKAFS_OSTYPE}" = "xIRIX"; then
269 echo Skipping library tests because they confuse Irix.
271 AC_CHECK_FUNCS(socket)
273 if test "$ac_cv_func_socket" = no; then
274 for lib in socket inet; do
275 if test "$HAVE_SOCKET" != 1; then
276 AC_CHECK_LIB(${lib}, socket,LIBS="$LIBS -l$lib";HAVE_SOCKET=1;AC_DEFINE(HAVE_SOCKET))
281 AC_CHECK_FUNCS(connect)
283 if test "$ac_cv_func_connect" = no; then
285 if test "$HAVE_CONNECT" != 1; then
286 AC_CHECK_LIB(${lib}, connect,LIBS="$LIBS -l$lib";HAVE_CONNECT=1;AC_DEFINE(HAVE_CONNECT))
291 AC_CHECK_FUNCS(gethostbyname)
292 if test "$ac_cv_func_gethostbyname" = no; then
293 for lib in dns nsl resolv; do
294 if test "$HAVE_GETHOSTBYNAME" != 1; then
295 AC_CHECK_LIB(${lib}, gethostbyname, LIBS="$LIBS -l$lib";HAVE_GETHOSTBYNAME=1;AC_DEFINE(HAVE_GETHOSTBYNAME))
300 AC_CHECK_FUNCS(res_search)
301 if test "$ac_cv_func_res_search" = no; then
302 for lib in dns nsl resolv; do
303 if test "$HAVE_RES_SEARCH" != 1; then
304 AC_CHECK_LIB(${lib}, res_search, LIBS="$LIBS -l$lib";HAVE_RES_SEARCH=1;AC_DEFINE(HAVE_RES_SEARCH))
307 if test "$HAVE_RES_SEARCH" = 1; then
308 LIB_res_search="-l$lib"
314 AC_CHECK_LIB(pthread, pthread_attr_init,
315 PTHREAD_LIBS="-lpthread")
316 if test "x$PTHREAD_LIBS" = xerror; then
317 AC_CHECK_LIB(pthreads, pthread_attr_init,
318 PTHREAD_LIBS="-lpthreads")
320 if test "x$PTHREAD_LIBS" = xerror; then
321 AC_CHECK_LIB(c_r, pthread_attr_init,
322 PTHREAD_LIBS="-lc_r")
324 if test "x$PTHREAD_LIBS" = xerror; then
325 AC_CHECK_FUNC(pthread_attr_init, PTHREAD_LIBS="")
327 if test "x$PTHREAD_LIBS" = xerror; then
328 AC_MSG_WARN(*** Unable to locate working posix thread library ***)
330 AC_SUBST(PTHREAD_LIBS)
333 if test "$enable_obsolete" = "yes"; then
338 if test "$enable_insecure" = "yes"; then
343 if test "$enable_fast_restart" = "yes"; then
344 AC_DEFINE(FAST_RESTART)
347 if test "$enable_bitmap_later" = "yes"; then
348 AC_DEFINE(BITMAP_LATER)
351 if test "$enable_full_vos_listvol_switch" = "yes"; then
352 AC_DEFINE(FULL_LISTVOL_SWITCH)
355 if test "$enable_bos_restricted_mode" = "yes"; then
356 AC_DEFINE(BOS_RESTRICTED_MODE)
359 if test "$enable_namei_fileserver" = "yes"; then
360 AC_DEFINE(AFS_NAMEI_ENV)
363 if test "$enable_afsdb" = "yes"; then
364 LIB_AFSDB="$LIB_res_search"
365 AC_DEFINE(AFS_AFSDB_ENV)
369 TOP_SRCDIR="${SRCDIR_PARENT}/src"
370 DESTDIR="${SRCDIR_PARENT}/${AFS_SYSNAME}/dest/"
371 SRCDIR="${SRCDIR_PARENT}/${AFS_SYSNAME}/dest/"
373 dnl checks for header files.
377 AC_CHECK_HEADERS(stdlib.h string.h unistd.h fcntl.h sys/time.h sys/file.h)
378 AC_CHECK_HEADERS(netinet/in.h netdb.h sys/fcntl.h sys/mnttab.h sys/mntent.h)
379 AC_CHECK_HEADERS(mntent.h sys/vfs.h sys/param.h sys/fs_types.h)
380 AC_CHECK_HEADERS(sys/mount.h strings.h termios.h signal.h)
381 AC_CHECK_HEADERS(windows.h malloc.h winsock2.h direct.h io.h)
382 AC_CHECK_HEADERS(security/pam_modules.h siad.h usersec.h)
384 AC_CHECK_FUNCS(utimes random srandom getdtablesize snprintf re_comp re_exec)
386 if test "x$enable_kernel_module" = "xyes"; then
387 ENABLE_KERNEL_MODULE=libafs
390 AC_SUBST(AFS_SYSNAME)
391 AC_SUBST(ENABLE_KERNEL_MODULE)
393 AC_SUBST(LINUX_KERNEL_PATH)
394 AC_SUBST(LINUX_VERSION)
395 AC_SUBST(MKAFS_OSTYPE)
399 AC_SUBST(WITH_OBSOLETE)
400 AC_SUBST(WITH_INSECURE)
404 src/config/Makefile.version-NOCML \
405 src/config/Makefile.${AFS_SYSNAME} \
406 src/libafs/MakefileProto.${MKAFS_OSTYPE} \
407 src/libuafs/MakefileProto.${MKAFS_OSTYPE} \
409 src/afsd/afs.ppc_darwin.plist \
412 src/afsmonitor/Makefile \
413 src/afsweb/Makefile \
415 src/auth/test/Makefile \
417 src/bozo/test/Makefile \
419 src/bu_utils/Makefile \
420 src/bubasics/Makefile \
421 src/bucoord/Makefile \
425 src/cmd/test/Makefile \
427 src/comerr/test/Makefile \
428 src/comerr/Makefile \
429 src/config/Makefile \
431 src/des/test/Makefile \
433 src/des_stub/Makefile \
434 src/dir/test/Makefile \
436 src/export/Makefile \
437 src/finale/Makefile \
439 src/fsprobe/Makefile \
440 src/ftpd43+/Makefile \
443 src/kauth/test/Makefile \
445 src/libacl/test/Makefile \
446 src/libacl/Makefile \
447 src/libadmin/adminutil/Makefile \
448 src/libadmin/Makefile \
449 src/libadmin/bos/Makefile \
450 src/libadmin/cfg/test/Makefile \
451 src/libadmin/cfg/Makefile \
452 src/libadmin/client/Makefile \
453 src/libadmin/kas/Makefile \
454 src/libadmin/pts/Makefile \
455 src/libadmin/samples/Makefile \
456 src/libadmin/test/Makefile \
457 src/libadmin/vos/Makefile \
458 src/libafsauthent/Makefile \
459 src/libafsrpc/Makefile \
460 src/log/test/Makefile \
463 src/lwp/test/Makefile \
468 src/package/Makefile \
470 src/pinstall/test/Makefile \
471 src/pinstall/Makefile \
472 src/procmgmt/Makefile \
473 src/procmgmt/test/Makefile \
474 src/ptserver/Makefile \
476 src/rlogind/Makefile \
479 src/rx/bulk.example/Makefile \
480 src/rx/bulktest/Makefile \
481 src/rx/multi.example/Makefile \
482 src/rx/simple.example/Makefile \
483 src/rx/test/Makefile \
486 src/rxkad/test/Makefile \
487 src/rxstat/Makefile \
489 src/sgistuff/Makefile \
494 src/tviced/Makefile \
496 src/update/Makefile \
497 src/usd/test/Makefile \
501 src/util/test/Makefile \
502 src/venus/test/Makefile \
506 src/vlserver/Makefile \
508 src/vol/test/Makefile \
509 src/volser/Makefile \
510 src/wsadmin.src/Makefile \