1 AC_INIT(Makefile.common)
2 AM_INIT_AUTOMAKE(openafs-libafs,devel)
4 AC_CONFIG_HEADER(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_FS_STRUCT_INODE_HAS_I_DIRTY_DATA_BUFFERS
117 LINUX_FS_STRUCT_INODE_HAS_I_MAPPING_OVERLOAD
118 LINUX_INODE_SETATTR_RETURN_TYPE
121 if test "x$ac_cv_linux_func_inode_setattr_returns_int" = "xyes" ; then
122 AC_DEFINE(INODE_SETATTR_NOT_VOID)
124 if test "x$ac_cv_linux_fs_struct_inode_has_i_dirty_data_buffers" = "xyes"; then
125 AC_DEFINE(STRUCT_INODE_HAS_I_DIRTY_DATA_BUFFERS)
127 if test "x$ac_cv_linux_fs_struct_inode_has_i_mapping_overload" = "xyes"; then
128 AC_DEFINE(STRUCT_INODE_HAS_I_MAPPING_OVERLOAD)
130 if test "x$ac_cv_linux_fs_struct_inode_has_i_cdev" = "xyes"; then
131 AC_DEFINE(STRUCT_INODE_HAS_I_CDEV)
133 if test "x$ac_cv_linux_fs_struct_inode_has_i_truncate_sem" = "xyes"; then
134 AC_DEFINE(STRUCT_INODE_HAS_I_TRUNCATE_SEM)
136 if test "x$ac_cv_linux_fs_struct_inode_has_i_bytes" = "xyes"; then
137 AC_DEFINE(STRUCT_INODE_HAS_I_BYTES)
139 if test "x$ac_cv_linux_fs_struct_address_space_has_page_lock" = "xyes"; then
140 AC_DEFINE(STRUCT_ADDRESS_SPACE_HAS_PAGE_LOCK)
148 SOLARIS_UFSVFS_HAS_DQRWLOCK
160 AC_MSG_RESULT(rs_aix)
164 AC_MSG_RESULT(alpha_dux)
165 if test "x$enable_kernel_module" = "xyes"; then
166 if test "x$with_dux_kernel_headers" != "x"; then
167 HEADER_RT=`ls ${with_dux_kernel_headers}/rt_preempt.h | head -1 | sed 's,/rt_preempt.h,,;s,/usr/sys/,,'`
169 HEADER_RT=`ls /usr/sys/*/rt_preempt.h | head -1 | sed 's,/rt_preempt.h,,;s,/usr/sys/,,'`
172 if test "$HEADER_RT" = "*" ; then
173 AC_MSG_ERROR([Need a configured kernel directory])
175 AC_SUBST([HEADER_RT])
179 AC_MSG_RESULT(ppc_darwin)
183 AC_MSG_RESULT(i386_fbsd)
186 AC_MSG_RESULT($system)
190 if test "x$with_afs_sysname" != "x"; then
191 AFS_SYSNAME="$with_afs_sysname"
193 AC_MSG_CHECKING(your AFS sysname)
196 AFS_SYSNAME="i386_fbsd_42"
199 AFS_SYSNAME="hp_ux110"
202 AFS_SYSNAME="hp_ux102"
204 powerpc-apple-darwin1.2*)
205 AFS_SYSNAME="ppc_darwin_12"
207 powerpc-apple-darwin1.3*)
208 AFS_SYSNAME="ppc_darwin_13"
210 sparc-sun-solaris2.5*)
211 AFS_SYSNAME="sun4x_55"
213 sparc-sun-solaris2.6)
214 AFS_SYSNAME="sun4x_56"
216 sparc-sun-solaris2.7)
217 AFS_SYSNAME="sun4x_57"
219 sparc-sun-solaris2.8)
220 AFS_SYSNAME="sun4x_58"
223 AFS_SYSNAME="alpha_dux40"
226 AFS_SYSNAME="alpha_dux50"
232 AFS_SYSNAME="ia64_linuxXX"
235 AFS_SYSNAME="ppc_linuxXX"
238 AFS_SYSNAME="alpha_linux_XX"
241 AFS_SYSNAME="s390_linuxXX"
244 AFS_SYSNAME="sparc_linuxXX"
247 AFS_SYSNAME="sparc64_linuxXX"
250 AFS_SYSNAME="i386_linuxXX"
253 AFS_SYSNAME="rs_aix42"
256 AFS_SYSNAME="rs_aix42"
259 AC_MSG_ERROR(An AFS sysname is required)
265 AFS_SYSKVERS=`echo $LINUX_VERSION | awk -F\. '{print $1 $2}'`
266 if test "x${AFS_SYSKVERS}" = "x"; then
267 AC_MSG_ERROR(Couldn't guess your Linux version. Please use the --with-afs-sysname option to configure an AFS sysname.)
269 _AFS_SYSNAME=`echo $AFS_SYSNAME|sed s/XX\$/$AFS_SYSKVERS/`
270 AFS_SYSNAME="$_AFS_SYSNAME"
273 AC_MSG_RESULT($AFS_SYSNAME)
277 if test "x${MKAFS_OSTYPE}" = "xIRIX"; then
278 echo Skipping library tests because they confuse Irix.
280 AC_CHECK_FUNCS(socket)
282 if test "$ac_cv_func_socket" = no; then
283 for lib in socket inet; do
284 if test "$HAVE_SOCKET" != 1; then
285 AC_CHECK_LIB(${lib}, socket,LIBS="$LIBS -l$lib";HAVE_SOCKET=1;AC_DEFINE(HAVE_SOCKET))
290 AC_CHECK_FUNCS(connect)
292 if test "$ac_cv_func_connect" = no; then
294 if test "$HAVE_CONNECT" != 1; then
295 AC_CHECK_LIB(${lib}, connect,LIBS="$LIBS -l$lib";HAVE_CONNECT=1;AC_DEFINE(HAVE_CONNECT))
300 AC_CHECK_FUNCS(gethostbyname)
301 if test "$ac_cv_func_gethostbyname" = no; then
302 for lib in dns nsl resolv; do
303 if test "$HAVE_GETHOSTBYNAME" != 1; then
304 AC_CHECK_LIB(${lib}, gethostbyname, LIBS="$LIBS -l$lib";HAVE_GETHOSTBYNAME=1;AC_DEFINE(HAVE_GETHOSTBYNAME))
309 AC_CHECK_FUNCS(res_search)
310 if test "$ac_cv_func_res_search" = no; then
311 for lib in dns nsl resolv; do
312 if test "$HAVE_RES_SEARCH" != 1; then
313 AC_CHECK_LIB(${lib}, res_search, LIBS="$LIBS -l$lib";HAVE_RES_SEARCH=1;AC_DEFINE(HAVE_RES_SEARCH))
316 if test "$HAVE_RES_SEARCH" = 1; then
317 LIB_res_search="-l$lib"
323 AC_CHECK_LIB(pthread, pthread_attr_init,
324 PTHREAD_LIBS="-lpthread")
325 if test "x$PTHREAD_LIBS" = xerror; then
326 AC_CHECK_LIB(pthreads, pthread_attr_init,
327 PTHREAD_LIBS="-lpthreads")
329 if test "x$PTHREAD_LIBS" = xerror; then
330 AC_CHECK_LIB(c_r, pthread_attr_init,
331 PTHREAD_LIBS="-lc_r")
333 if test "x$PTHREAD_LIBS" = xerror; then
334 AC_CHECK_FUNC(pthread_attr_init, PTHREAD_LIBS="")
336 if test "x$PTHREAD_LIBS" = xerror; then
337 AC_MSG_WARN(*** Unable to locate working posix thread library ***)
339 AC_SUBST(PTHREAD_LIBS)
342 if test "$enable_obsolete" = "yes"; then
347 if test "$enable_insecure" = "yes"; then
352 if test "$enable_fast_restart" = "yes"; then
353 AC_DEFINE(FAST_RESTART)
356 if test "$enable_bitmap_later" = "yes"; then
357 AC_DEFINE(BITMAP_LATER)
360 if test "$enable_full_vos_listvol_switch" = "yes"; then
361 AC_DEFINE(FULL_LISTVOL_SWITCH)
364 if test "$enable_bos_restricted_mode" = "yes"; then
365 AC_DEFINE(BOS_RESTRICTED_MODE)
368 if test "$enable_namei_fileserver" = "yes"; then
369 AC_DEFINE(AFS_NAMEI_ENV)
372 if test "$enable_afsdb" = "yes"; then
373 LIB_AFSDB="$LIB_res_search"
374 AC_DEFINE(AFS_AFSDB_ENV)
378 TOP_SRCDIR="${SRCDIR_PARENT}"
379 DESTDIR="${SRCDIR_PARENT}/${AFS_SYSNAME}/dest/"
380 SRCDIR="${SRCDIR_PARENT}/${AFS_SYSNAME}/dest/"
382 dnl checks for header files.
386 AC_CHECK_HEADERS(stdlib.h string.h unistd.h fcntl.h sys/time.h sys/file.h)
387 AC_CHECK_HEADERS(netinet/in.h netdb.h sys/fcntl.h sys/mnttab.h sys/mntent.h)
388 AC_CHECK_HEADERS(mntent.h sys/vfs.h sys/param.h sys/fs_types.h)
389 AC_CHECK_HEADERS(sys/mount.h strings.h termios.h signal.h)
390 AC_CHECK_HEADERS(windows.h malloc.h winsock2.h direct.h io.h)
391 AC_CHECK_HEADERS(security/pam_modules.h siad.h usersec.h)
393 AC_CHECK_FUNCS(utimes random srandom getdtablesize snprintf re_comp re_exec)
395 if test "x$enable_kernel_module" = "xyes"; then
396 ENABLE_KERNEL_MODULE=libafs
399 AC_SUBST(AFS_SYSNAME)
400 AC_SUBST(ENABLE_KERNEL_MODULE)
402 AC_SUBST(LINUX_KERNEL_PATH)
403 AC_SUBST(LINUX_VERSION)
404 AC_SUBST(MKAFS_OSTYPE)
408 AC_SUBST(WITH_OBSOLETE)
409 AC_SUBST(WITH_INSECURE)
413 config/Makefile.${AFS_SYSNAME} \