dnl aclocal.m4 generated automatically by aclocal 1.4 dnl Copyright (C) 1994, 1995-8, 1999 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. dnl This program is distributed in the hope that it will be useful, dnl but WITHOUT ANY WARRANTY, to the extent permitted by law; without dnl even the implied warranty of MERCHANTABILITY or FITNESS FOR A dnl PARTICULAR PURPOSE. dnl This file contains the common configuration code which would dnl otherwise be duplicated between configure and configure-libafs. dnl dnl NB: Because this code is a macro, references to positional shell dnl parameters must be done like $[]1 instead of $1 AC_DEFUN(OPENAFS_CONFIGURE_COMMON,[ AC_CANONICAL_HOST SRCDIR_PARENT=`pwd` #BOZO_SAVE_CORES BOS_RESTRICTED_MODE BOS_NEW_CONFIG pam sia AC_ARG_WITH(afs-sysname, [ --with-afs-sysname=sys use sys for the afs sysname] ) AC_ARG_ENABLE( obsolete, [ --enable-obsolete enable obsolete portions of AFS (mpp, ntp and package)],, enable_obsolete="no") AC_ARG_ENABLE( insecure, [ --enable-insecure enable insecure portions of AFS (ftpd, inetd, rcp, rlogind and rsh)],, enable_insecure="no") AC_ARG_ENABLE( afsdb, [ --disable-afsdb disable AFSDB RR support],, enable_afsdb="yes") AC_ARG_ENABLE( bos-restricted-mode, [ --enable-bos-restricted-mode enable bosserver restricted mode which disables certain bosserver functionality],, enable_bos_restricted_mode="no") AC_ARG_ENABLE( namei-fileserver, [ --enable-namei-fileserver force compilation of namei fileserver in preference to inode fileserver],, enable_namei_fileserver="no") AC_ARG_ENABLE( fast-restart, [ --enable-fast-restart enable fast startup of file server without salvaging],, enable_fast_restart="no") AC_ARG_ENABLE( bitmap-later, [ --enable-bitmap-later enable fast startup of file server by not reading bitmap till needed],, enable_bitmap_later="no") AC_ARG_ENABLE( full-vos-listvol-switch, [ --enable-full-vos-listvol-switch enable vos full listvol switch for formatted output],, enable_full_vos_listvol_switch="no") AC_ARG_WITH(dux-kernel-headers, [ --with-dux-kernel-headers=path use the kernel headers found at path(optional, defaults to first match in /usr/sys)] ) AC_ARG_WITH(linux-kernel-headers, [ --with-linux-kernel-headers=path use the kernel headers found at path(optional, defaults to /usr/src/linux)] ) AC_ARG_ENABLE(kernel-module, [ --disable-kernel-module disable compilation of the kernel module (defaults to enabled)],, enable_kernel_module="yes" ) AC_ARG_ENABLE(redhat-buildsys, [ --enable-redhat-buildsys enable compilation of the redhat build system kernel (defaults to disabled)],, enable_redhat_buildsys="no" ) AC_ARG_ENABLE(transarc-paths, [ --enable-transarc-paths Use Transarc style paths like /usr/afs and /usr/vice],, enable_transarc_paths="no" ) AC_ARG_ENABLE(tivoli-tsm, [ --enable-tivoli-tsm Enable use of the Tivoli TSM API libraries for butc support],, enable_tivoli_tsm="no" ) AC_ARG_ENABLE(debug-kernel, [ --enable-debug-kernel enable compilation of the kernel module with debugging information (defaults to disabled)],, enable_debug_kernel="no" ) dnl weird ass systems AC_AIX AC_ISC_POSIX AC_MINIX dnl Various compiler setup. AC_TYPE_PID_T AC_TYPE_SIZE_T AC_TYPE_SIGNAL dnl Checks for programs. AC_PROG_INSTALL AC_PROG_LN_S AC_PROG_RANLIB AC_PROG_YACC AM_PROG_LEX OPENAFS_CHECK_BIGENDIAN KERN_DEBUG_OPT= if test "x$enable_debug_kernel" = "xyes"; then KERN_DEBUG_OPT=-g fi AC_MSG_CHECKING(your OS) system=$host case $system in *-linux*) MKAFS_OSTYPE=LINUX if test "x$enable_redhat_buildsys" = "xyes"; then AC_DEFINE(ENABLE_REDHAT_BUILDSYS, 1, [define if you have redhat buildsystem]) fi if test "x$enable_kernel_module" = "xyes"; then if test "x$with_linux_kernel_headers" != "x"; then LINUX_KERNEL_PATH="$with_linux_kernel_headers" else LINUX_KERNEL_PATH="/usr/src/linux" fi if test -f "$LINUX_KERNEL_PATH/include/linux/version.h"; then linux_kvers=`fgrep UTS_RELEASE $LINUX_KERNEL_PATH/include/linux/version.h |awk 'BEGIN { FS="\"" } { print $[]2 }'|tail -1` if test "x$linux_kvers" = "x"; then if test -f "$LINUX_KERNEL_PATH/include/linux/version-up.h"; then linux_kvers=`fgrep UTS_RELEASE $LINUX_KERNEL_PATH/include/linux/version-up.h |awk 'BEGIN { FS="\"" } { print $[]2 }'|tail -1` if test "x$linux_kvers" = "x"; then AC_MSG_ERROR(Linux headers lack version definition [2]) exit 1 else LINUX_VERSION="$linux_kvers" fi else AC_MSG_ERROR(Linux headers lack version definition) exit 1 fi else LINUX_VERSION="$linux_kvers" fi else enable_kernel_module="no" fi if test ! -f "$LINUX_KERNEL_PATH/include/linux/autoconf.h"; then enable_kernel_module="no" fi if test "x$enable_kernel_module" = "xno"; then if test "x$with_linux_kernel_headers" != "x"; then AC_MSG_ERROR(No usable linux headers found at $LINUX_KERNEL_PATH) exit 1 else AC_MSG_WARN(No usable linux headers found at $LINUX_KERNEL_PATH so disabling kernel module) fi fi fi AC_MSG_RESULT(linux) if test "x$enable_kernel_module" = "xyes"; then OMIT_FRAME_POINTER= if test "x$enable_debug_kernel" = "xno"; then OMIT_FRAME_POINTER=-fomit-frame-pointer fi AC_SUBST(OMIT_FRAME_POINTER) OPENAFS_GCC_SUPPORTS_MARCH AC_SUBST(P5PLUS_KOPTS) OPENAFS_GCC_NEEDS_NO_STRENGTH_REDUCE OPENAFS_GCC_NEEDS_NO_STRICT_ALIASING OPENAFS_GCC_SUPPORTS_NO_COMMON AC_SUBST(LINUX_GCC_KOPTS) ifdef([OPENAFS_CONFIGURE_LIBAFS], [LINUX_BUILD_VNODE_FROM_INODE(config,afs)], [LINUX_BUILD_VNODE_FROM_INODE(src/config,src/afs/LINUX)] ) LINUX_FS_STRUCT_ADDRESS_SPACE_HAS_PAGE_LOCK LINUX_FS_STRUCT_ADDRESS_SPACE_HAS_GFP_MASK LINUX_FS_STRUCT_INODE_HAS_I_TRUNCATE_SEM LINUX_FS_STRUCT_INODE_HAS_I_DIRTY_DATA_BUFFERS LINUX_FS_STRUCT_INODE_HAS_I_DEVICES LINUX_INODE_SETATTR_RETURN_TYPE LINUX_COMPLETION_H_EXISTS LINUX_EXPORTS_TASKLIST_LOCK LINUX_NEED_RHCONFIG LINUX_WHICH_MODULES if test "x$ac_cv_linux_config_modversions" = "xno"; then AC_MSG_WARN([Cannot determine sys_call_table status. assuming it's exported]) ac_cv_linux_exports_sys_call_table=yes else LINUX_EXPORTS_SYS_CALL_TABLE LINUX_EXPORTS_KALLSYMS_SYMBOL LINUX_EXPORTS_KALLSYMS_ADDRESS LINUX_EXPORTS_INIT_MM if test "x$ac_cv_linux_exports_sys_call_table" = "xno"; then linux_syscall_method=none if test "x$ac_cv_linux_exports_init_mm" = "xyes"; then linux_syscall_method=scan if test "x$ac_cv_linux_exports_kallsyms_address" = "xyes"; then linux_syscall_method=scan_with_kallsyms_address fi fi if test "x$ac_cv_linux_exports_kallsyms_symbol" = "xyes"; then linux_syscall_method=kallsyms_symbol fi if test "x$linux_syscall_method" = "xnone"; then AC_MSG_ERROR([no available sys_call_table access method]) fi fi fi if test "x$ac_cv_linux_exports_tasklist_lock" = "xyes" ; then AC_DEFINE(EXPORTED_TASKLIST_LOCK, 1, [define if your linux kernel exports tasklist_lock]) fi if test "x$ac_cv_linux_exports_sys_call_table" = "xyes"; then AC_DEFINE(EXPORTED_SYS_CALL_TABLE) fi if test "x$ac_cv_linux_exports_kallsyms_symbol" = "xyes"; then AC_DEFINE(EXPORTED_KALLSYMS_SYMBOL) fi if test "x$ac_cv_linux_exports_kallsyms_address" = "xyes"; then AC_DEFINE(EXPORTED_KALLSYMS_ADDRESS) fi if test "x$ac_cv_linux_completion_h_exists" = "xyes" ; then AC_DEFINE(COMPLETION_H_EXISTS, 1, [define if your h_exists exists]) fi if test "x$ac_cv_linux_func_inode_setattr_returns_int" = "xyes" ; then AC_DEFINE(INODE_SETATTR_NOT_VOID, 1, [define if your setattr return return non-void]) fi if test "x$ac_cv_linux_fs_struct_address_space_has_page_lock" = "xyes"; then AC_DEFINE(STRUCT_ADDRESS_SPACE_HAS_PAGE_LOCK, 1, [define if your struct address_space has page_lock]) fi if test "x$ac_cv_linux_fs_struct_address_space_has_gfp_mask" = "xyes"; then AC_DEFINE(STRUCT_ADDRESS_SPACE_HAS_GFP_MASK, 1, [define if your struct address_space has gfp_mask]) fi if test "x$ac_cv_linux_fs_struct_inode_has_i_truncate_sem" = "xyes"; then AC_DEFINE(STRUCT_INODE_HAS_I_TRUNCATE_SEM, 1, [define if your struct inode has truncate_sem]) fi if test "x$ac_cv_linux_fs_struct_inode_has_i_devices" = "xyes"; then AC_DEFINE(STRUCT_INODE_HAS_I_DEVICES, 1, [define if you struct inode has i_devices]) fi if test "x$ac_cv_linux_fs_struct_inode_has_i_dirty_data_buffers" = "xyes"; then AC_DEFINE(STRUCT_INODE_HAS_I_DIRTY_DATA_BUFFERS, 1, [define if you struct inode has data_buffers]) fi : fi ;; *-solaris*) MKAFS_OSTYPE=SOLARIS AC_MSG_RESULT(sun4) SOLARIS_UFSVFS_HAS_DQRWLOCK SOLARIS_PROC_HAS_P_COREFILE ;; *-sunos*) MKAFS_OSTYPE=SUNOS enable_kernel_module=no AC_MSG_RESULT(sun4) ;; *-hpux*) MKAFS_OSTYPE=HPUX AC_MSG_RESULT(hp_ux) ;; *-irix*) if test -d /usr/include/sys/SN/SN1; then IRIX_BUILD_IP35="IP35" fi MKAFS_OSTYPE=IRIX AC_MSG_RESULT(sgi) ;; *-aix*) MKAFS_OSTYPE=AIX AC_MSG_RESULT(rs_aix) ;; *-osf*) MKAFS_OSTYPE=DUX AC_MSG_RESULT(alpha_dux) if test "x$enable_kernel_module" = "xyes"; then if test "x$with_dux_kernel_headers" != "x"; then HEADER_RT=`ls ${with_dux_kernel_headers}/rt_preempt.h | head -1 | sed 's,/rt_preempt.h,,;s,/usr/sys/,,'` else HEADER_RT=`ls /usr/sys/*/rt_preempt.h | head -1 | sed 's,/rt_preempt.h,,;s,/usr/sys/,,'` fi fi if test "$HEADER_RT" = "*" ; then AC_MSG_ERROR([Need a configured kernel directory]) fi AC_SUBST([HEADER_RT]) ;; *-darwin*) MKAFS_OSTYPE=DARWIN AC_MSG_RESULT(ppc_darwin) ;; *-freebsd*) MKAFS_OSTYPE=FBSD AC_MSG_RESULT(i386_fbsd) ;; *-openbsd*) MKAFS_OSTYPE=OBSD AC_MSG_RESULT(i386_obsd) ;; *) AC_MSG_RESULT($system) ;; esac AC_SUBST(KERN_DEBUG_OPT) if test "x$with_afs_sysname" != "x"; then AFS_SYSNAME="$with_afs_sysname" else AC_MSG_CHECKING(your AFS sysname) case $host in i?86-*-freebsd4.2*) AFS_SYSNAME="i386_fbsd_42" ;; i?86-*-freebsd4.3*) AFS_SYSNAME="i386_fbsd_43" ;; i?86-*-freebsd4.4*) AFS_SYSNAME="i386_fbsd_44" ;; i?86-*-freebsd4.5*) AFS_SYSNAME="i386_fbsd_45" ;; i?86-*-freebsd4.6*) AFS_SYSNAME="i386_fbsd_46" ;; hppa*-hp-hpux11*) AFS_SYSNAME="hp_ux110" ;; hppa*-hp-hpux10*) AFS_SYSNAME="hp_ux102" ;; powerpc-apple-darwin1.2*) AFS_SYSNAME="ppc_darwin_12" ;; powerpc-apple-darwin1.3*) AFS_SYSNAME="ppc_darwin_13" ;; powerpc-apple-darwin1.4*) AFS_SYSNAME="ppc_darwin_14" ;; powerpc-apple-darwin5.1*) AFS_SYSNAME="ppc_darwin_14" ;; powerpc-apple-darwin5.2*) AFS_SYSNAME="ppc_darwin_14" ;; powerpc-apple-darwin5.3*) AFS_SYSNAME="ppc_darwin_14" ;; powerpc-apple-darwin5.4*) AFS_SYSNAME="ppc_darwin_14" ;; powerpc-apple-darwin5.5*) AFS_SYSNAME="ppc_darwin_14" ;; powerpc-apple-darwin6.0*) AFS_SYSNAME="ppc_darwin_60" ;; powerpc-apple-darwin6.1*) AFS_SYSNAME="ppc_darwin_60" ;; powerpc-apple-darwin6.2*) AFS_SYSNAME="ppc_darwin_60" ;; sparc-sun-solaris2.5*) AFS_SYSNAME="sun4x_55" ;; sparc-sun-solaris2.6) AFS_SYSNAME="sun4x_56" ;; sparc-sun-solaris2.7) AFS_SYSNAME="sun4x_57" ;; sparc-sun-solaris2.8) AFS_SYSNAME="sun4x_58" ;; sparc-sun-solaris2.9) AFS_SYSNAME="sun4x_59" ;; sparc-sun-sunos4*) AFS_SYSNAME="sun4_413" ;; i386-pc-solaris2.7) AFS_SYSNAME="sunx86_57" ;; i386-pc-solaris2.8) AFS_SYSNAME="sunx86_58" ;; i386-pc-solaris2.9) AFS_SYSNAME="sunx86_59" ;; alpha*-dec-osf4.0*) AFS_SYSNAME="alpha_dux40" ;; alpha*-dec-osf5.0*) AFS_SYSNAME="alpha_dux50" ;; mips-sgi-irix6.5) AFS_SYSNAME="sgi_65" ;; ia64-*-linux*) AFS_SYSNAME="ia64_linuxXX" ;; powerpc-*-linux*) AFS_SYSNAME="ppc_linuxXX" ;; alpha*-linux*) AFS_SYSNAME="alpha_linux_XX" ;; s390-*-linux*) AFS_SYSNAME="s390_linuxXX" ;; sparc-*-linux*) AFS_SYSNAME="sparc_linuxXX" ;; sparc64-*-linux*) AFS_SYSNAME="sparc64_linuxXX" ;; i?86-*-linux*) AFS_SYSNAME="i386_linuxXX" ;; parisc-*-linux-gnu) AFS_SYSNAME="parisc_linuxXX" ;; power*-ibm-aix4.2*) AFS_SYSNAME="rs_aix42" ;; power*-ibm-aix4.3*) AFS_SYSNAME="rs_aix42" ;; *) AC_MSG_ERROR(An AFS sysname is required) exit 1 ;; esac case $AFS_SYSNAME in *_linux*) AFS_SYSKVERS=`echo $LINUX_VERSION | awk -F\. '{print $[]1 $[]2}'` if test "x${AFS_SYSKVERS}" = "x"; then AC_MSG_ERROR(Couldn't guess your Linux version. Please use the --with-afs-sysname option to configure an AFS sysname.) fi _AFS_SYSNAME=`echo $AFS_SYSNAME|sed s/XX\$/$AFS_SYSKVERS/` AFS_SYSNAME="$_AFS_SYSNAME" ;; esac AC_MSG_RESULT($AFS_SYSNAME) fi case $AFS_SYSNAME in *_darwin*) DARWIN_PLIST=src/libafs/afs.${AFS_SYSNAME}.plist DARWIN_INFOFILE=afs.${AFS_SYSNAME}.plist ;; esac AC_CACHE_VAL(ac_cv_sockaddr_len, [ AC_MSG_CHECKING([if struct sockaddr has sa_len field]) AC_TRY_COMPILE( [#include #include ], [struct sockaddr *a; a->sa_len=0;], ac_cv_sockaddr_len=yes, ac_cv_sockaddr_len=no) AC_MSG_RESULT($ac_cv_sockaddr_len)]) if test "$ac_cv_sockaddr_len" = "yes"; then AC_DEFINE(STRUCT_SOCKADDR_HAS_SA_LEN, 1, [define if you struct sockaddr sa_len]) fi if test "x${MKAFS_OSTYPE}" = "xIRIX"; then echo Skipping library tests because they confuse Irix. else AC_CHECK_FUNCS(socket) if test "$ac_cv_func_socket" = no; then for lib in socket inet; do if test "$HAVE_SOCKET" != 1; then AC_CHECK_LIB(${lib}, socket,LIBS="$LIBS -l$lib";HAVE_SOCKET=1;AC_DEFINE(HAVE_SOCKET, 1, [define if you have socket])) fi done fi AC_CHECK_FUNCS(connect) if test "$ac_cv_func_connect" = no; then for lib in nsl; do if test "$HAVE_CONNECT" != 1; then AC_CHECK_LIB(${lib}, connect,LIBS="$LIBS -l$lib";HAVE_CONNECT=1;AC_DEFINE(HAVE_CONNECT, 1, [define if you have connect])) fi done fi AC_CHECK_FUNCS(gethostbyname) if test "$ac_cv_func_gethostbyname" = no; then for lib in dns nsl resolv; do if test "$HAVE_GETHOSTBYNAME" != 1; then AC_CHECK_LIB(${lib}, gethostbyname, LIBS="$LIBS -l$lib";HAVE_GETHOSTBYNAME=1;AC_DEFINE(HAVE_GETHOSTBYNAME, 1, [define if you have gethostbyname])) fi done fi AC_CHECK_FUNCS(res_search) if test "$ac_cv_func_res_search" = no; then for lib in dns nsl resolv; do if test "$HAVE_RES_SEARCH" != 1; then AC_CHECK_LIB(${lib}, res_search, LIBS="$LIBS -l$lib";HAVE_RES_SEARCH=1;AC_DEFINE(HAVE_RES_SEARCH, 1, [define if you have res_search])) fi done if test "$HAVE_RES_SEARCH" = 1; then LIB_res_search="-l$lib" fi fi fi PTHREAD_LIBS=error AC_CHECK_LIB(pthread, pthread_attr_init, PTHREAD_LIBS="-lpthread") if test "x$PTHREAD_LIBS" = xerror; then AC_CHECK_LIB(pthreads, pthread_attr_init, PTHREAD_LIBS="-lpthreads") fi if test "x$PTHREAD_LIBS" = xerror; then AC_CHECK_LIB(c_r, pthread_attr_init, PTHREAD_LIBS="-lc_r") fi if test "x$PTHREAD_LIBS" = xerror; then AC_CHECK_FUNC(pthread_attr_init, PTHREAD_LIBS="") fi if test "x$PTHREAD_LIBS" = xerror; then AC_MSG_WARN(*** Unable to locate working posix thread library ***) fi AC_SUBST(PTHREAD_LIBS) WITH_OBSOLETE=NO if test "$enable_obsolete" = "yes"; then WITH_OBSOLETE=YES fi WITH_INSECURE=NO if test "$enable_insecure" = "yes"; then WITH_INSECURE=YES fi # Fast restart if test "$enable_fast_restart" = "yes"; then AC_DEFINE(FAST_RESTART, 1, [define if you want to have fast restart]) fi if test "$enable_bitmap_later" = "yes"; then AC_DEFINE(BITMAP_LATER, 1, [define if you want to salvager to check bitmasks later]) fi if test "$enable_full_vos_listvol_switch" = "yes"; then AC_DEFINE(FULL_LISTVOL_SWITCH, 1, [define if you want to want listvol switch]) fi if test "$enable_bos_restricted_mode" = "yes"; then AC_DEFINE(BOS_RESTRICTED_MODE, 1, [define if you want to want bos restricted mode]) fi if test "$enable_namei_fileserver" = "yes"; then AC_DEFINE(AFS_NAMEI_ENV, 1, [define if you want to want namei fileserver]) fi if test "$enable_afsdb" = "yes"; then LIB_AFSDB="$LIB_res_search" AC_DEFINE(AFS_AFSDB_ENV, 1, [define if you want to want search afsdb rr]) fi dnl check for tivoli AC_MSG_CHECKING(for tivoli tsm butc support) XBSA_CFLAGS="" if test "$enable_tivoli_tsm" = "yes"; then XBSADIR1=/usr/tivoli/tsm/client/api/bin/xopen XBSADIR2=/opt/tivoli/tsm/client/api/bin/xopen if test -e "$XBSADIR1/xbsa.h"; then XBSA_CFLAGS="-Dxbsa -I$XBSADIR1" AC_MSG_RESULT([yes, $XBSA_CFLAGS]) elif test -e "$XBSADIR2/xbsa.h"; then XBSA_CFLAGS="-Dxbsa -I$XBSADIR2" AC_MSG_RESULT([yes, $XBSA_CFLAGS]) else AC_MSG_RESULT([no, missing xbsa.h header file]) fi else AC_MSG_RESULT([no]) fi AC_SUBST(XBSA_CFLAGS) dnl checks for header files. AC_HEADER_STDC AC_HEADER_SYS_WAIT AC_HEADER_DIRENT AC_CHECK_HEADERS(stdlib.h string.h unistd.h fcntl.h sys/time.h sys/file.h) AC_CHECK_HEADERS(netinet/in.h netdb.h sys/fcntl.h sys/mnttab.h sys/mntent.h) AC_CHECK_HEADERS(mntent.h sys/vfs.h sys/param.h sys/fs_types.h) AC_CHECK_HEADERS(sys/mount.h strings.h termios.h signal.h) AC_CHECK_HEADERS(windows.h malloc.h winsock2.h direct.h io.h) AC_CHECK_HEADERS(security/pam_modules.h siad.h usersec.h ucontext.h) AC_CHECK_FUNCS(utimes random srandom getdtablesize snprintf re_comp re_exec) AC_CHECK_FUNCS(setprogname getprogname sigaction) AC_CHECK_TYPE(ssize_t, int) AC_CHECK_FUNCS(timegm) dnl Directory PATH handling if test "x$enable_transarc_paths" = "xyes" ; then afsconfdir=${afsconfdir=/usr/afs/etc} viceetcdir=${viceetcdir=/usr/vice/etc} afskerneldir=${afskerneldir=${viceetcdir}} afssrvbindir=${afssrvbindir=/usr/afs/bin} afssrvsbindir=${afssrvsbindir=/usr/afs/bin} afssrvlibexecdir=${afssrvlibexecdir=/usr/afs/bin} afsdbdir=${afsdbdir=/usr/afs/db} afslogsdir=${afslogsdir=/usr/afs/logs} afslocaldir=${afslocaldir=/usr/afs/local} afsbackupdir=${afsbackupdir=/usr/afs/backup} afsbosconfigdir=${afsbosconfigdir=/usr/afs/local} else afsconfdir=${afsconfdir='${sysconfdir}/openafs/server'} viceetcdir=${viceetcdir='${sysconfdir}/openafs'} afskerneldir=${afskerneldir='${libdir}/openafs'} afssrvbindir=${afssrvbindir='${bindir}'} afssrvsbindir=${afssrvsbindir='${sbindir}'} afssrvlibexecdir=${afssrvlibexecdir='${libexecdir}/openafs'} afsdbdir=${afsdbdir='${localstatedir}/openafs/db'} afslogsdir=${afslogsdir='${localstatedir}/openafs/logs'} afslocaldir=${afslocaldir='${localstatedir}/openafs'} afsbackupdir=${afsbackupdir='${localstatedir}/openafs/backup'} afsbosconfigdir=${afsbosconfigdir='${sysconfdir}/openafs'} fi AC_SUBST(afsconfdir) AC_SUBST(viceetcdir) AC_SUBST(afskerneldir) AC_SUBST(afssrvbindir) AC_SUBST(afssrvsbindir) AC_SUBST(afssrvlibexecdir) AC_SUBST(afsdbdir) AC_SUBST(afslogsdir) AC_SUBST(afslocaldir) AC_SUBST(afsbackupdir) AC_SUBST(afsbosconfigdir) if test "x$enable_kernel_module" = "xyes"; then ENABLE_KERNEL_MODULE=libafs fi AC_SUBST(AFS_SYSNAME) AC_SUBST(ENABLE_KERNEL_MODULE) AC_SUBST(LIB_AFSDB) AC_SUBST(LINUX_KERNEL_PATH) AC_SUBST(LINUX_VERSION) AC_SUBST(MKAFS_OSTYPE) AC_SUBST(TOP_SRCDIR) AC_SUBST(TOP_INCDIR) AC_SUBST(TOP_LIBDIR) AC_SUBST(DEST) AC_SUBST(WITH_OBSOLETE) AC_SUBST(WITH_INSECURE) AC_SUBST(DARWIN_INFOFILE) AC_SUBST(IRIX_BUILD_IP35) ]) dnl AM_PROG_LEX dnl Look for flex, lex or missing, then run AC_PROG_LEX and AC_DECL_YYTEXT AC_DEFUN(AM_PROG_LEX, [missing_dir=ifelse([$1],,`cd $ac_aux_dir && pwd`,$1) AC_CHECK_PROGS(LEX, flex lex, "$missing_dir/missing flex") AC_PROG_LEX AC_DECL_YYTEXT]) dnl dnl $Id: aclocal.m4,v 1.3 2002-12-13 22:06:41 zacheiss Exp $ dnl dnl check if this computer is little or big-endian dnl if we can figure it out at compile-time then don't define the cpp symbol dnl otherwise test for it and define it. also allow options for overriding dnl it when cross-compiling AC_DEFUN(OPENAFS_CHECK_BIGENDIAN, [ AC_ARG_ENABLE(bigendian, [ --enable-bigendian the target is big endian], openafs_cv_c_bigendian=yes) AC_ARG_ENABLE(littleendian, [ --enable-littleendian the target is little endian], openafs_cv_c_bigendian=no) AC_CACHE_CHECK(whether byte order is known at compile time, openafs_cv_c_bigendian_compile, [AC_TRY_COMPILE([ #include #include ],[ #if !BYTE_ORDER || !BIG_ENDIAN || !LITTLE_ENDIAN bogus endian macros #endif], openafs_cv_c_bigendian_compile=yes, openafs_cv_c_bigendian_compile=no)]) AC_CACHE_CHECK(whether byte ordering is bigendian, openafs_cv_c_bigendian,[ if test "$openafs_cv_c_bigendian_compile" = "yes"; then AC_TRY_COMPILE([ #include #include ],[ #if BYTE_ORDER != BIG_ENDIAN not big endian #endif], openafs_cv_c_bigendian=yes, openafs_cv_c_bigendian=no) else AC_TRY_RUN([main () { /* Are we little or big endian? From Harbison&Steele. */ union { long l; char c[sizeof (long)]; } u; u.l = 1; exit (u.c[sizeof (long) - 1] == 1); }], openafs_cv_c_bigendian=no, openafs_cv_c_bigendian=yes, AC_MSG_ERROR([specify either --enable-bigendian or --enable-littleendian])) fi ]) if test "$openafs_cv_c_bigendian" = "yes"; then AC_DEFINE(WORDS_BIGENDIAN, 1, [define if target is big endian])dnl fi if test "$openafs_cv_c_bigendian_compile" = "yes"; then AC_DEFINE(ENDIANESS_IN_SYS_PARAM_H, 1, [define if sys/param.h defines the endiness])dnl fi ]) AC_DEFUN(OPENAFS_GCC_SUPPORTS_MARCH, [ AC_MSG_CHECKING(if $CC accepts -march=pentium) save_CFLAGS="$CFLAGS" CFLAGS="-MARCH=pentium" AC_CACHE_VAL(openafs_gcc_supports_march,[ AC_TRY_COMPILE( [], [int x;], openafs_gcc_supports_march=yes, openafs_gcc_supports_march=no)]) AC_MSG_RESULT($openafs_gcc_supports_march) if test x$openafs_gcc_supports_march = xyes; then P5PLUS_KOPTS="-march=pentium" else P5PLUS_KOPTS="-m486 -malign-loops=2 -malign-jumps=2 -malign-functions=2" fi CFLAGS="$save_CFLAGS" ]) AC_DEFUN(OPENAFS_GCC_NEEDS_NO_STRICT_ALIASING, [ AC_MSG_CHECKING(if $CC needs -fno-strict-aliasing) save_CFLAGS="$CFLAGS" CFLAGS="-fno-strict-aliasing" AC_CACHE_VAL(openafs_gcc_needs_no_strict_aliasing,[ AC_TRY_COMPILE( [], [int x;], openafs_gcc_needs_no_strict_aliasing=yes, openafs_gcc_needs_no_strict_aliasing=no)]) AC_MSG_RESULT($openafs_gcc_needs_no_strict_aliasing) if test x$openafs_gcc_needs_no_strict_aliasing = xyes; then LINUX_GCC_KOPTS="$LINUX_GCC_KOPTS -fno-strict-aliasing" fi CFLAGS="$save_CFLAGS" ]) AC_DEFUN(OPENAFS_GCC_NEEDS_NO_STRENGTH_REDUCE, [ AC_MSG_CHECKING(if $CC needs -fno-strength-reduce) save_CFLAGS="$CFLAGS" CFLAGS="-fno-strength-reduce" AC_CACHE_VAL(openafs_gcc_needs_no_strength_reduce,[ AC_TRY_COMPILE( [], [int x;], openafs_gcc_needs_no_strength_reduce=yes, openafs_gcc_needs_no_strength_reduce=no)]) AC_MSG_RESULT($openafs_gcc_needs_no_strength_reduce) if test x$openafs_gcc_needs_no_strength_reduce = xyes; then LINUX_GCC_KOPTS="$LINUX_GCC_KOPTS -fno-strength-reduce" fi CFLAGS="$save_CFLAGS" ]) AC_DEFUN(OPENAFS_GCC_SUPPORTS_NO_COMMON, [ AC_MSG_CHECKING(if $CC supports -fno-common) save_CFLAGS="$CFLAGS" CFLAGS="-fno-common" AC_CACHE_VAL(openafs_gcc_supports_no_common,[ AC_TRY_COMPILE( [], [int x;], openafs_gcc_supports_no_common=yes, openafs_gcc_supports_no_common=no)]) AC_MSG_RESULT($openafs_gcc_supports_no_common) if test x$openafs_gcc_supports_no_common = xyes; then LINUX_GCC_KOPTS="$LINUX_GCC_KOPTS -fno-common" fi CFLAGS="$save_CFLAGS" ]) AC_DEFUN(LINUX_FS_STRUCT_ADDRESS_SPACE_HAS_GFP_MASK, [ AC_MSG_CHECKING(for gfp_mask in struct address_space) save_CPPFLAGS="$CPPFLAGS" CPPFLAGS="-I${LINUX_KERNEL_PATH}/include -D__KERNEL__ $CPPFLAGS" AC_CACHE_VAL(ac_cv_linux_fs_struct_address_space_has_gfp_mask, [ AC_TRY_COMPILE( [#include ], [struct address_space _a; printf("%d\n", _a.gfp_mask);], ac_cv_linux_fs_struct_address_space_has_gfp_mask=yes, ac_cv_linux_fs_struct_address_space_has_gfp_mask=no)]) AC_MSG_RESULT($ac_cv_linux_fs_struct_address_space_has_gfp_mask) CPPFLAGS="$save_CPPFLAGS"]) AC_DEFUN(LINUX_FS_STRUCT_INODE_HAS_I_BYTES, [ AC_MSG_CHECKING(for i_bytes in struct inode) save_CPPFLAGS="$CPPFLAGS" CPPFLAGS="-I${LINUX_KERNEL_PATH}/include -D__KERNEL__ $CPPFLAGS" AC_CACHE_VAL(ac_cv_linux_fs_struct_inode_has_i_bytes, [ AC_TRY_COMPILE( [#include ], [struct inode _inode; printf("%d\n", _inode.i_bytes);], ac_cv_linux_fs_struct_inode_has_i_bytes=yes, ac_cv_linux_fs_struct_inode_has_i_bytes=no)]) AC_MSG_RESULT($ac_cv_linux_fs_struct_inode_has_i_bytes) CPPFLAGS="$save_CPPFLAGS"]) AC_DEFUN(LINUX_FS_STRUCT_INODE_HAS_I_TRUNCATE_SEM, [ AC_MSG_CHECKING(for i_truncate_sem in struct inode) save_CPPFLAGS="$CPPFLAGS" CPPFLAGS="-I${LINUX_KERNEL_PATH}/include -D__KERNEL__ $CPPFLAGS" AC_CACHE_VAL(ac_cv_linux_fs_struct_inode_has_i_truncate_sem, [ AC_TRY_COMPILE( [#include ], [struct inode _i; printf("%x\n", _i.i_truncate_sem);], ac_cv_linux_fs_struct_inode_has_i_truncate_sem=yes, ac_cv_linux_fs_struct_inode_has_i_truncate_sem=no)]) AC_MSG_RESULT($ac_cv_linux_fs_struct_inode_has_i_truncate_sem) CPPFLAGS="$save_CPPFLAGS"]) AC_DEFUN(LINUX_FS_STRUCT_ADDRESS_SPACE_HAS_PAGE_LOCK, [ AC_MSG_CHECKING(for page_lock in struct address_space) save_CPPFLAGS="$CPPFLAGS" CPPFLAGS="-I${LINUX_KERNEL_PATH}/include -D__KERNEL__ $CPPFLAGS" AC_CACHE_VAL(ac_cv_linux_fs_struct_address_space_has_page_lock, [ AC_TRY_COMPILE( [#include ], [struct address_space _a_s; printf("%x\n", _a_s.page_lock);], ac_cv_linux_fs_struct_address_space_has_page_lock=yes, ac_cv_linux_fs_struct_address_space_has_page_lock=no)]) AC_MSG_RESULT($ac_cv_linux_fs_struct_address_space_has_page_lock) CPPFLAGS="$save_CPPFLAGS"]) dnl LINUX_BUILD_VNODE_FROM_INODE (configdir, outputdir) dnl defaults: (src/config, src/afs/LINUX) AC_DEFUN(LINUX_BUILD_VNODE_FROM_INODE, [ AC_MSG_CHECKING(whether to build osi_vfs.h) configdir=ifelse([$1], ,src/config,$1) outputdir=ifelse([$2], ,src/afs/LINUX,$2) chmod +x $configdir/make_vnode.pl $configdir/make_vnode.pl -i $LINUX_KERNEL_PATH -o $outputdir ]) AC_DEFUN(LINUX_EXPORTS_TASKLIST_LOCK, [ AC_MSG_CHECKING(for exported tasklist_lock) save_CPPFLAGS="$CPPFLAGS" CPPFLAGS="-I${LINUX_KERNEL_PATH}/include -D__KERNEL__ $CPPFLAGS" AC_CACHE_VAL(ac_cv_linux_exports_tasklist_lock, [ AC_TRY_COMPILE( [#include ], [#ifndef __ver_tasklist_lock #error tasklist_lock not exported #endif], ac_cv_linux_exports_tasklist_lock=yes, ac_cv_linux_exports_tasklist_lock=no)]) AC_MSG_RESULT($ac_cv_linux_exports_tasklist_lock) CPPFLAGS="$save_CPPFLAGS"]) AC_DEFUN(LINUX_EXPORTS_SYS_CALL_TABLE, [ AC_MSG_CHECKING(for exported sys_call_table) save_CPPFLAGS="$CPPFLAGS" CPPFLAGS="-I${LINUX_KERNEL_PATH}/include -D__KERNEL__ $CPPFLAGS" AC_CACHE_VAL(ac_cv_linux_exports_sys_call_table, [ AC_TRY_COMPILE( [#include ], [#ifndef __ver_sys_call_table #error sys_call_table not exported #endif], ac_cv_linux_exports_sys_call_table=yes, ac_cv_linux_exports_sys_call_table=no)]) AC_MSG_RESULT($ac_cv_linux_exports_sys_call_table) CPPFLAGS="$save_CPPFLAGS"]) AC_DEFUN(LINUX_EXPORTS_INIT_MM, [ AC_MSG_CHECKING(for exported init_mm) save_CPPFLAGS="$CPPFLAGS" CPPFLAGS="-I${LINUX_KERNEL_PATH}/include -D__KERNEL__ $CPPFLAGS" AC_CACHE_VAL(ac_cv_linux_exports_init_mm, [ AC_TRY_COMPILE( [#include ], [#ifndef __ver_init_mm #error init_mm not exported #endif], ac_cv_linux_exports_init_mm=yes, ac_cv_linux_exports_init_mm=no)]) AC_MSG_RESULT($ac_cv_linux_exports_init_mm) CPPFLAGS="$save_CPPFLAGS"]) AC_DEFUN(LINUX_EXPORTS_KALLSYMS_SYMBOL, [ AC_MSG_CHECKING(for exported kallsyms_symbol_to_address) save_CPPFLAGS="$CPPFLAGS" CPPFLAGS="-I${LINUX_KERNEL_PATH}/include -D__KERNEL__ $CPPFLAGS" AC_CACHE_VAL(ac_cv_linux_exports_kallsyms_symbol, [ AC_TRY_COMPILE( [#include ], [#ifndef __ver_kallsyms_symbol_to_address #error kallsyms_symbol_to_address not exported #endif], ac_cv_linux_exports_kallsyms_symbol=yes, ac_cv_linux_exports_kallsyms_symbol=no)]) AC_MSG_RESULT($ac_cv_linux_exports_kallsyms_symbol) CPPFLAGS="$save_CPPFLAGS"]) AC_DEFUN(LINUX_EXPORTS_KALLSYMS_ADDRESS, [ AC_MSG_CHECKING(for exported kallsyms_address_to_symbol) save_CPPFLAGS="$CPPFLAGS" CPPFLAGS="-I${LINUX_KERNEL_PATH}/include -D__KERNEL__ $CPPFLAGS" AC_CACHE_VAL(ac_cv_linux_exports_kallsyms_address, [ AC_TRY_COMPILE( [#include ], [#ifndef __ver_kallsyms_address_to_symbol #error kallsyms_address_to_symbol not exported #endif], ac_cv_linux_exports_kallsyms_address=yes, ac_cv_linux_exports_kallsyms_address=no)]) AC_MSG_RESULT($ac_cv_linux_exports_kallsyms_address) CPPFLAGS="$save_CPPFLAGS"]) AC_DEFUN(LINUX_COMPLETION_H_EXISTS, [ AC_MSG_CHECKING(for linux/completion.h existance) save_CPPFLAGS="$CPPFLAGS" CPPFLAGS="-I${LINUX_KERNEL_PATH}/include -D__KERNEL__ $CPPFLAGS" AC_CACHE_VAL(ac_cv_linux_completion_h_exists, [ AC_TRY_COMPILE( [#include #include ], [struct completion _c; #if LINUX_VERSION_CODE <= KERNEL_VERSION(2,4,8) lose #endif ], ac_cv_linux_completion_h_exists=yes, ac_cv_linux_completion_h_exists=no)]) AC_MSG_RESULT($ac_cv_linux_completion_h_exists) CPPFLAGS="$save_CPPFLAGS"]) AC_DEFUN(LINUX_FS_STRUCT_INODE_HAS_I_MMAP_SHARED, [ AC_MSG_CHECKING(for i_mmap_shared in struct inode) save_CPPFLAGS="$CPPFLAGS" CPPFLAGS="-I${LINUX_KERNEL_PATH}/include -D__KERNEL__ $CPPFLAGS" AC_CACHE_VAL(ac_cv_linux_fs_struct_inode_has_i_mmap_shared, [ AC_TRY_COMPILE( [#include ], [struct inode _inode; printf("%d\n", _inode.i_mmap_shared);], ac_cv_linux_fs_struct_inode_has_i_mmap_shared=yes, ac_cv_linux_fs_struct_inode_has_i_mmap_shared=no)]) AC_MSG_RESULT($ac_cv_linux_fs_struct_inode_has_i_mmap_shared) CPPFLAGS="$save_CPPFLAGS"]) AC_DEFUN(LINUX_FS_STRUCT_INODE_HAS_I_DIRTY_DATA_BUFFERS, [ AC_MSG_CHECKING(for i_dirty_data_buffers in struct inode) save_CPPFLAGS="$CPPFLAGS" CPPFLAGS="-I${LINUX_KERNEL_PATH}/include -D__KERNEL__ $CPPFLAGS" AC_CACHE_VAL(ac_cv_linux_fs_struct_inode_has_i_dirty_data_buffers, [ AC_TRY_COMPILE( [#include ], [struct inode _inode; printf("%d\n", _inode.i_dirty_data_buffers);], ac_cv_linux_fs_struct_inode_has_i_dirty_data_buffers=yes, ac_cv_linux_fs_struct_inode_has_i_dirty_data_buffers=no)]) AC_MSG_RESULT($ac_cv_linux_fs_struct_inode_has_i_dirty_data_buffers) CPPFLAGS="$save_CPPFLAGS"]) AC_DEFUN(LINUX_FS_STRUCT_INODE_HAS_I_MAPPING_OVERLOAD, [ AC_MSG_CHECKING(for i_mapping_overload in struct inode) save_CPPFLAGS="$CPPFLAGS" CPPFLAGS="-I${LINUX_KERNEL_PATH}/include -D__KERNEL__ $CPPFLAGS" AC_CACHE_VAL(ac_cv_linux_fs_struct_inode_has_i_mapping_overload, [ AC_TRY_COMPILE( [#include ], [struct inode _inode; printf("%d\n", _inode.i_mapping_overload);], ac_cv_linux_fs_struct_inode_has_i_mapping_overload=yes, ac_cv_linux_fs_struct_inode_has_i_mapping_overload=no)]) AC_MSG_RESULT($ac_cv_linux_fs_struct_inode_has_i_mapping_overload) CPPFLAGS="$save_CPPFLAGS"]) AC_DEFUN(LINUX_FS_STRUCT_INODE_HAS_I_CDEV, [ AC_MSG_CHECKING(for i_cdev in struct inode) save_CPPFLAGS="$CPPFLAGS" CPPFLAGS="-I${LINUX_KERNEL_PATH}/include -D__KERNEL__ $CPPFLAGS" AC_CACHE_VAL(ac_cv_linux_fs_struct_inode_has_i_cdev, [ AC_TRY_COMPILE( [#include ], [struct inode _inode; printf("%d\n", _inode.i_cdev);], ac_cv_linux_fs_struct_inode_has_i_cdev=yes, ac_cv_linux_fs_struct_inode_has_i_cdev=no)]) AC_MSG_RESULT($ac_cv_linux_fs_struct_inode_has_i_cdev) CPPFLAGS="$save_CPPFLAGS"]) AC_DEFUN(LINUX_FS_STRUCT_INODE_HAS_I_DEVICES, [ AC_MSG_CHECKING(for i_devices in struct inode) save_CPPFLAGS="$CPPFLAGS" CPPFLAGS="-I${LINUX_KERNEL_PATH}/include -D__KERNEL__ $CPPFLAGS" AC_CACHE_VAL(ac_cv_linux_fs_struct_inode_has_i_cdev, [ AC_TRY_COMPILE( [#include ], [struct inode _inode; printf("%d\n", _inode.i_devices);], ac_cv_linux_fs_struct_inode_has_i_devices=yes, ac_cv_linux_fs_struct_inode_has_i_devices=no)]) AC_MSG_RESULT($ac_cv_linux_fs_struct_inode_has_i_devices) CPPFLAGS="$save_CPPFLAGS"]) AC_DEFUN(LINUX_INODE_SETATTR_RETURN_TYPE,[ AC_MSG_CHECKING(for inode_setattr return type) save_CPPFLAGS="$CPPFLAGS" CPPFLAGS="-I${LINUX_KERNEL_PATH}/include -D__KERNEL__ $CPPFLAGS" AC_CACHE_VAL(ac_cv_linux_func_inode_setattr_returns_int, [ AC_TRY_COMPILE( [#include ], [struct inode _inode; struct iattr _iattr; int i; i = inode_setattr(&_inode, &_iattr);], ac_cv_linux_func_inode_setattr_returns_int=yes, ac_cv_linux_func_inode_setattr_returns_int=no)]) AC_MSG_RESULT($ac_cv_linux_func_inode_setattr_returns_int) CPPFLAGS="$save_CPPFLAGS"]) AC_DEFUN(LINUX_NEED_RHCONFIG,[ RHCONFIG_SP="" RHCONFIG_MP="" if test "x$enable_redhat_buildsys" = "xyes"; then AC_MSG_WARN(Configured to build from a Red Hat SPEC file) else AC_MSG_CHECKING(for redhat kernel configuration) if test -f "${LINUX_KERNEL_PATH}/include/linux/rhconfig.h"; then ac_linux_rhconfig=yes RHCONFIG_SP="-D__BOOT_KERNEL_UP=1 -D__BOOT_KERNEL_SMP=0" RHCONFIG_MP="-D__BOOT_KERNEL_UP=0 -D__BOOT_KERNEL_SMP=1" AC_MSG_RESULT($ac_linux_rhconfig) if test ! -f "/boot/kernel.h"; then AC_MSG_WARN([/boot/kernel.h does not exist. build may fail]) fi else ac_linux_rhconfig=no AC_MSG_RESULT($ac_linux_rhconfig) fi fi AC_SUBST(RHCONFIG_SP) AC_SUBST(RHCONFIG_MP) ]) AC_DEFUN(LINUX_WHICH_MODULES,[ if test "x$enable_redhat_buildsys" = "xyes"; then MPS=Default else save_CPPFLAGS="$CPPFLAGS" CPPFLAGS="-I${LINUX_KERNEL_PATH}/include -D__KERNEL__ $RHCONFIG_SP $CPPFLAGS" AC_MSG_CHECKING(if kernel uses MODVERSIONS) AC_CACHE_VAL(ac_cv_linux_config_modversions,[ AC_TRY_COMPILE( [#include ], [#ifndef CONFIG_MODVERSIONS lose; #endif ], ac_cv_linux_config_modversions=yes, ac_cv_linux_config_modversions=no)]) AC_MSG_RESULT($ac_cv_linux_config_modversions) AC_MSG_CHECKING(which kernel modules to build) if test "x$ac_linux_rhconfig" = "xyes" -o "x$ac_cv_linux_config_modversions" = "xno"; then MPS="MP SP" else AC_CACHE_VAL(ac_cv_linux_config_smp, [ AC_TRY_COMPILE( [#include ], [#ifndef CONFIG_SMP lose; #endif ], ac_cv_linux_config_smp=yes, ac_cv_linux_config_smp=no)]) dnl AC_MSG_RESULT($ac_cv_linux_config_smp) if test "x$ac_cv_linux_config_smp" = "xyes"; then MPS=MP else MPS=SP fi fi CPPFLAGS=$save_CPPFLAGS AC_MSG_RESULT($MPS) fi AC_SUBST(MPS) ]) AC_DEFUN(SOLARIS_UFSVFS_HAS_DQRWLOCK, [ AC_MSG_CHECKING(for vfs_dqrwlock in struct ufsvfs) AC_CACHE_VAL(ac_cv_solaris_ufsvfs_has_dqrwlock, [ AC_TRY_COMPILE( [#define _KERNEL #include ], [struct ufsvfs _ufsvfs; (void) _ufsvfs.vfs_dqrwlock;], ac_cv_solaris_ufsvfs_has_dqrwlock=yes, ac_cv_solaris_ufsvfs_has_dqrwlock=no)]) AC_MSG_RESULT($ac_cv_solaris_ufsvfs_has_dqrwlock) if test "$ac_cv_solaris_ufsvfs_has_dqrwlock" = "yes"; then AC_DEFINE(HAVE_VFS_DQRWLOCK, 1, [define if struct ufsvfs has vfs_dqrwlock]) fi ]) AC_DEFUN(SOLARIS_PROC_HAS_P_COREFILE, [ AC_MSG_CHECKING(for p_corefile in struct proc) AC_CACHE_VAL(ac_cv_solaris_proc_has_p_corefile, [ AC_TRY_COMPILE( [#define _KERNEL #include ], [struct proc _proc; (void) _proc.p_corefile;], ac_cv_solaris_proc_has_p_corefile=yes, ac_cv_solaris_proc_has_p_corefile=no)]) AC_MSG_RESULT($ac_cv_solaris_proc_has_p_corefile) if test "$ac_cv_solaris_proc_has_p_corefile" = "yes"; then AC_DEFINE(HAVE_P_COREFILE, 1, [define if struct proc has p_corefile]) fi ]) # Do all the work for Automake. This macro actually does too much -- # some checks are only needed if your package does certain things. # But this isn't really a big deal. # serial 1 dnl Usage: dnl AM_INIT_AUTOMAKE(package,version, [no-define]) AC_DEFUN(AM_INIT_AUTOMAKE, [AC_REQUIRE([AC_PROG_INSTALL]) PACKAGE=[$1] AC_SUBST(PACKAGE) VERSION=[$2] AC_SUBST(VERSION) dnl test to see if srcdir already configured if test "`cd $srcdir && pwd`" != "`pwd`" && test -f $srcdir/config.status; then AC_MSG_ERROR([source directory already configured; run "make distclean" there first]) fi ifelse([$3],, AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE", [Name of package]) AC_DEFINE_UNQUOTED(VERSION, "$VERSION", [Version number of package])) AC_REQUIRE([AM_SANITY_CHECK]) AC_REQUIRE([AC_ARG_PROGRAM]) dnl FIXME This is truly gross. missing_dir=`cd $ac_aux_dir && pwd` AM_MISSING_PROG(ACLOCAL, aclocal, $missing_dir) AM_MISSING_PROG(AUTOCONF, autoconf, $missing_dir) AM_MISSING_PROG(AUTOMAKE, automake, $missing_dir) AM_MISSING_PROG(AUTOHEADER, autoheader, $missing_dir) AM_MISSING_PROG(MAKEINFO, makeinfo, $missing_dir) AC_REQUIRE([AC_PROG_MAKE_SET])]) # # Check to make sure that the build environment is sane. # AC_DEFUN(AM_SANITY_CHECK, [AC_MSG_CHECKING([whether build environment is sane]) # Just in case sleep 1 echo timestamp > conftestfile # Do `set' in a subshell so we don't clobber the current shell's # arguments. Must try -L first in case configure is actually a # symlink; some systems play weird games with the mod time of symlinks # (eg FreeBSD returns the mod time of the symlink's containing # directory). if ( set X `ls -Lt $srcdir/configure conftestfile 2> /dev/null` if test "[$]*" = "X"; then # -L didn't work. set X `ls -t $srcdir/configure conftestfile` fi if test "[$]*" != "X $srcdir/configure conftestfile" \ && test "[$]*" != "X conftestfile $srcdir/configure"; then # If neither matched, then we have a broken ls. This can happen # if, for instance, CONFIG_SHELL is bash and it inherits a # broken ls alias from the environment. This has actually # happened. Such a system could not be considered "sane". AC_MSG_ERROR([ls -t appears to fail. Make sure there is not a broken alias in your environment]) fi test "[$]2" = conftestfile ) then # Ok. : else AC_MSG_ERROR([newly created file is older than distributed files! Check your system clock]) fi rm -f conftest* AC_MSG_RESULT(yes)]) dnl AM_MISSING_PROG(NAME, PROGRAM, DIRECTORY) dnl The program must properly implement --version. AC_DEFUN(AM_MISSING_PROG, [AC_MSG_CHECKING(for working $2) # Run test in a subshell; some versions of sh will print an error if # an executable is not found, even if stderr is redirected. # Redirect stdin to placate older versions of autoconf. Sigh. if ($2 --version) < /dev/null > /dev/null 2>&1; then $1=$2 AC_MSG_RESULT(found) else $1="$3/missing $2" AC_MSG_RESULT(missing) fi AC_SUBST($1)])