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_WITH(dux-kernel-headers,
25 [ --with-dux-kernel-headers=path use the kernel headers found at path(optional, defaults to first match in /usr/sys)]
27 AC_ARG_WITH(linux-kernel-headers,
28 [ --with-linux-kernel-headers=path use the kernel headers found at path(optional, defaults to /usr/src/linux)]
30 AC_ARG_ENABLE(kernel-module,
31 [ --disable-kernel-module disable compilation of the kernel module (defaults to enabled)],, enable_kernel_module="yes"
33 AC_ARG_ENABLE(redhat-buildsys,
34 [ --enable-redhat-buildsys enable compilation of the redhat build system kernel (defaults to disabled)],, enable_redhat_buildsys="no"
44 dnl Various compiler setup.
51 dnl Checks for programs.
58 OPENAFS_CHECK_BIGENDIAN
60 AC_MSG_CHECKING(your OS)
65 if test "x$enable_redhat_buildsys" = "xyes"; then
66 AC_DEFINE(ENABLE_REDHAT_BUILDSYS)
68 if test "x$enable_kernel_module" = "xyes"; then
69 if test "x$with_linux_kernel_headers" != "x"; then
70 LINUX_KERNEL_PATH="$with_linux_kernel_headers"
72 LINUX_KERNEL_PATH="/usr/src/linux"
74 if test -f "$LINUX_KERNEL_PATH/include/linux/version.h"; then
75 linux_kvers=`fgrep UTS_RELEASE $LINUX_KERNEL_PATH/include/linux/version.h |awk 'BEGIN { FS="\"" } { print $2 }'|tail -1`
76 if test "x$linux_kvers" = "x"; then
77 if test -f "$LINUX_KERNEL_PATH/include/linux/version-up.h"; then
78 linux_kvers=`fgrep UTS_RELEASE $LINUX_KERNEL_PATH/include/linux/version-up.h |awk 'BEGIN { FS="\"" } { print $2 }'|tail -1`
79 if test "x$linux_kvers" = "x"; then
81 AC_MSG_ERROR(Linux headers lack version definition [2])
84 LINUX_VERSION="$linux_kvers"
87 AC_MSG_ERROR(Linux headers lack version definition)
91 LINUX_VERSION="$linux_kvers"
94 enable_kernel_module="no"
96 if test ! -f "$LINUX_KERNEL_PATH/include/linux/autoconf.h"; then
97 enable_kernel_module="no"
99 if test "x$enable_kernel_module" = "xno"; then
100 if test "x$with_linux_kernel_headers" != "x"; then
101 AC_MSG_ERROR(No usable linux headers found at $LINUX_KERNEL_PATH)
104 AC_MSG_WARN(No usable linux headers found at $LINUX_KERNEL_PATH so disabling kernel module)
109 if test "x$enable_kernel_module" = "xyes"; then
110 LINUX_FS_STRUCT_INODE_HAS_I_BYTES
111 LINUX_FS_STRUCT_ADDRESS_SPACE_HAS_PAGE_LOCK
112 LINUX_INODE_SETATTR_RETURN_TYPE
115 if test "x$ac_cv_linux_func_inode_setattr_returns_int" = "xyes" ; then
116 AC_DEFINE(INODE_SETATTR_NOT_VOID)
118 if test "x$ac_cv_linux_fs_struct_inode_has_i_bytes" = "xyes"; then
119 AC_DEFINE(STRUCT_INODE_HAS_I_BYTES)
121 if test "x$ac_cv_linux_fs_struct_address_space_has_page_lock" = "xyes"; then
122 AC_DEFINE(STRUCT_ADDRESS_SPACE_HAS_PAGE_LOCK)
130 SOLARIS_UFSVFS_HAS_DQRWLOCK
142 AC_MSG_RESULT(rs_aix)
146 AC_MSG_RESULT(alpha_dux)
147 if test "x$enable_kernel_module" = "xyes"; then
148 if test "x$with_dux_kernel_headers" != "x"; then
149 HEADER_RT=`ls ${with_dux_kernel_headers}/rt_preempt.h | head -1 | sed 's,/rt_preempt.h,,;s,/usr/sys/,,'`
151 HEADER_RT=`ls /usr/sys/*/rt_preempt.h | head -1 | sed 's,/rt_preempt.h,,;s,/usr/sys/,,'`
154 if test "$HEADER_RT" = "*" ; then
155 AC_MSG_ERROR([Need a configured kernel directory])
157 AC_SUBST([HEADER_RT])
161 AC_MSG_RESULT(ppc_darwin)
165 AC_MSG_RESULT(i386_fbsd)
168 AC_MSG_RESULT($system)
172 if test "x$with_afs_sysname" != "x"; then
173 AFS_SYSNAME="$with_afs_sysname"
175 AC_MSG_CHECKING(your AFS sysname)
178 AFS_SYSNAME="i386_fbsd_42"
181 AFS_SYSNAME="hp_ux110"
184 AFS_SYSNAME="hp_ux102"
186 powerpc-apple-darwin1.2*)
187 AFS_SYSNAME="ppc_darwin_12"
189 powerpc-apple-darwin1.3*)
190 AFS_SYSNAME="ppc_darwin_13"
192 sparc-sun-solaris2.5*)
193 AFS_SYSNAME="sun4x_55"
195 sparc-sun-solaris2.6)
196 AFS_SYSNAME="sun4x_56"
198 sparc-sun-solaris2.7)
199 AFS_SYSNAME="sun4x_57"
201 sparc-sun-solaris2.8)
202 AFS_SYSNAME="sun4x_58"
205 AFS_SYSNAME="alpha_dux40"
208 AFS_SYSNAME="alpha_dux50"
214 AFS_SYSNAME="ppc_linuxXX"
217 AFS_SYSNAME="alpha_linux_XX"
220 AFS_SYSNAME="sparc_linuxXX"
223 AFS_SYSNAME="sparc64_linuxXX"
226 AFS_SYSNAME="i386_linuxXX"
229 AFS_SYSNAME="rs_aix42"
232 AFS_SYSNAME="rs_aix42"
235 AC_MSG_ERROR(An AFS sysname is required)
241 AFS_SYSKVERS=`echo $LINUX_VERSION | awk -F\. '{print $1 $2}'`
242 if test "x${AFS_SYSKVERS}" = "x"; then
243 AC_MSG_ERROR(Couldn't guess your Linux version. Please use the --with-afs-sysname option to configure an AFS sysname.)
245 _AFS_SYSNAME=`echo $AFS_SYSNAME|sed s/XX\$/$AFS_SYSKVERS/`
246 AFS_SYSNAME="$_AFS_SYSNAME"
249 AC_MSG_RESULT($AFS_SYSNAME)
253 if test "x${MKAFS_OSTYPE}" = "xIRIX"; then
254 echo Skipping library tests because they confuse Irix.
256 AC_CHECK_FUNCS(socket)
258 if test "$ac_cv_func_socket" = no; then
259 for lib in socket inet; do
260 if test "$HAVE_SOCKET" != 1; then
261 AC_CHECK_LIB(${lib}, socket,LIBS="$LIBS -l$lib";HAVE_SOCKET=1;AC_DEFINE(HAVE_SOCKET))
266 AC_CHECK_FUNCS(connect)
268 if test "$ac_cv_func_connect" = no; then
270 if test "$HAVE_CONNECT" != 1; then
271 AC_CHECK_LIB(${lib}, connect,LIBS="$LIBS -l$lib";HAVE_CONNECT=1;AC_DEFINE(HAVE_CONNECT))
276 AC_CHECK_FUNCS(gethostbyname)
277 if test "$ac_cv_func_gethostbyname" = no; then
278 for lib in dns nsl resolv; do
279 if test "$HAVE_GETHOSTBYNAME" != 1; then
280 AC_CHECK_LIB(${lib}, gethostbyname, LIBS="$LIBS -l$lib";HAVE_GETHOSTBYNAME=1;AC_DEFINE(HAVE_GETHOSTBYNAME))
285 AC_CHECK_FUNCS(res_search)
286 if test "$ac_cv_func_res_search" = no; then
287 for lib in dns nsl resolv; do
288 if test "$HAVE_RES_SEARCH" != 1; then
289 AC_CHECK_LIB(${lib}, res_search, LIBS="$LIBS -l$lib";HAVE_RES_SEARCH=1;AC_DEFINE(HAVE_RES_SEARCH))
292 if test "$HAVE_RES_SEARCH" = 1; then
293 LIB_res_search="-l$lib"
299 AC_CHECK_LIB(pthread, pthread_attr_init,
300 PTHREAD_LIBS="-lpthread")
301 if test "x$PTHREAD_LIBS" = xerror; then
302 AC_CHECK_LIB(pthreads, pthread_attr_init,
303 PTHREAD_LIBS="-lpthreads")
305 if test "x$PTHREAD_LIBS" = xerror; then
306 AC_CHECK_LIB(c_r, pthread_attr_init,
307 PTHREAD_LIBS="-lc_r")
309 if test "x$PTHREAD_LIBS" = xerror; then
310 AC_CHECK_FUNC(pthread_attr_init, PTHREAD_LIBS="")
312 if test "x$PTHREAD_LIBS" = xerror; then
313 AC_MSG_WARN(*** Unable to locate working posix thread library ***)
315 AC_SUBST(PTHREAD_LIBS)
318 if test "$enable_obsolete" = "yes"; then
323 if test "$enable_insecure" = "yes"; then
328 if test "$enable_fast_restart" = "yes"; then
329 AC_DEFINE(FAST_RESTART)
332 if test "$enable_bitmap_later" = "yes"; then
333 AC_DEFINE(BITMAP_LATER)
336 if test "$enable_bos_restricted_mode" = "yes"; then
337 AC_DEFINE(BOS_RESTRICTED_MODE)
340 if test "$enable_namei_fileserver" = "yes"; then
341 AC_DEFINE(AFS_NAMEI_ENV)
344 if test "$enable_afsdb" = "yes"; then
345 LIB_AFSDB="$LIB_res_search"
346 AC_DEFINE(AFS_AFSDB_ENV)
350 TOP_SRCDIR="${SRCDIR_PARENT}/src"
352 dnl checks for header files.
356 AC_CHECK_HEADERS(stdlib.h string.h unistd.h fcntl.h sys/time.h sys/file.h)
357 AC_CHECK_HEADERS(netinet/in.h netdb.h sys/fcntl.h sys/mnttab.h sys/mntent.h)
358 AC_CHECK_HEADERS(mntent.h sys/vfs.h sys/param.h sys/fs_types.h)
359 AC_CHECK_HEADERS(sys/mount.h strings.h termios.h signal.h)
360 AC_CHECK_HEADERS(windows.h malloc.h winsock2.h direct.h io.h)
361 AC_CHECK_HEADERS(security/pam_modules.h siad.h usersec.h)
363 AC_CHECK_FUNCS(utimes random srandom getdtablesize snprintf re_comp re_exec)
365 if test "x$enable_kernel_module" = "xyes"; then
366 ENABLE_KERNEL_MODULE=libafs
369 AC_SUBST(AFS_SYSNAME)
370 AC_SUBST(ENABLE_KERNEL_MODULE)
372 AC_SUBST(LINUX_KERNEL_PATH)
373 AC_SUBST(LINUX_VERSION)
374 AC_SUBST(MKAFS_OSTYPE)
376 AC_SUBST(WITH_OBSOLETE)
377 AC_SUBST(WITH_INSECURE)
381 src/config/Makefile.version-NOCML \
382 src/config/Makefile.${AFS_SYSNAME} \
383 src/libafs/MakefileProto.${MKAFS_OSTYPE} \
385 src/afsd/afs.ppc_darwin.plist \