dnl Process this file with autoconf to produce a configure script dnl This requires autoconf 2.12 AC_REVISION($Revision: 1.77.2.1 $)dnl AC_PREREQ(2.12) AC_INIT(arlad/arla.c) AC_CONFIG_HEADER(include/config.h) # This may be overridden using --prefix=/usr to configure AC_PREFIX_DEFAULT(/usr/arla) CFLAGS="-g" AC_PROG_CC AC_PROG_CPP AC_PROG_MAKE_SET AC_PROG_INSTALL AC_PROG_RANLIB AC_PROG_LN_S AC_PROG_LEX AC_PROG_YACC AC_CANONICAL_HOST CANONICAL_HOST=$host AC_SUBST(CANONICAL_HOST) AC_CHECK_PROGS(SYMORDER, symorder, :) AC_MSG_CHECKING(for warning options) if test "$GCC" = "yes"; then CFLAGS="$CFLAGS -Wall" AC_MSG_RESULT(-Wall) else AC_MSG_RESULT(none) fi AC_FUNC_NTOHL AC_MSG_CHECKING(for kernel stuff) case "$target_os" in sunos4.1*) KERNEL_INCLUDE=`(cd $srcdir; pwd)`/xfs/sunos KERNEL_SRCS='sunos-subr.c' KERNEL_HDRS='' XFS_SUBDIR=sunos AC_MSG_RESULT(SunOS 4.1.x) ;; solaris*) KERNEL_INCLUDE=`(cd $srcdir; pwd)`/xfs/solaris KERNEL_SRCS='solaris-subr.c' KERNEL_HDRS='' XFS_SUBDIR=solaris AC_MSG_RESULT(Solaris) ;; irix*) KERNEL_SRCS='irix-subr.c' AC_MSG_RESULT(Irix) AC_MSG_WARN(No kernel support for $target_os, compiling only user-level stuff) ;; hpux*) KERNEL_SRCS='hpux-subr.c' AC_MSG_RESULT(hp-ux) AC_MSG_WARN(No kernel support for $target_os, compiling only user-level stuff) ;; openbsd2.3) KERNEL_INCLUDE=`(cd $srcdir; pwd)`/xfs/openbsd2.3 KERNEL_SRCS='bsd-subr.c' KERNEL_HDRS='' XFS_SUBDIR=openbsd2.3 AC_DEFINE(VFS_NEED_PROCP,1) AC_MSG_RESULT(OpenBSD-2.3) with_krb4_include=/usr/include/kerberosIV; ;; openbsd* | netbsd* | freebsd*) KERNEL_INCLUDE=`(cd $srcdir; pwd)`/xfs/bsd KERNEL_SRCS='bsd-subr.c' KERNEL_HDRS='' XFS_SUBDIR=bsd AC_MSG_RESULT([Free|Net|Open]BSD) ;; linux*) KERNEL_INCLUDE=`(cd $srcdir; pwd)`/xfs/linux KERNEL_SRCS='linux-subr.c' KERNEL_HDRS='' XFS_SUBDIR=linux AC_MSG_RESULT(Linux) ;; osf*) KERNEL_INCLUDE=`(cd $srcdir; pwd)`/xfs/unknown KERNEL_SRCS=unknown-subr.c KERNEL_HDRS= XFS_SUBDIR= AC_MSG_RESULT(osf) AC_MSG_WARN(No kernel support for $target_os, compiling only user-level stuff) case "$CC" in cc*) CFLAGS="-std1 $CFLAGS" ;; esac ;; *) AC_MSG_RESULT(none) AC_MSG_WARN(No kernel support for $target_os, compiling only user-level stuff) KERNEL_INCLUDE=`(cd $srcdir; pwd)`/xfs/unknown KERNEL_SRCS= KERNEL_HDRS= XFS_SUBDIR= ;; esac if test "$XFS_SUBDIR" != ""; then XFS_SUBDIR_Makefile=xfs/$XFS_SUBDIR/Makefile XFS_SUBDIR_BIN_Makefile=xfs/$XFS_SUBDIR/bin/Makefile fi # Check where to put the cache AC_ARG_WITH(arlacachedir, [ --with-arlacachedir=dir use dir as cachedir instead of \$prefix/cache], [ARLACACHEDIR=$withval], [ARLACACHEDIR='${prefix}/cache']) # Check where to find the configuration AC_ARG_WITH(arlaconffile, [ --with-arlaconffile=file use file for configuration instead of \$prefix/etc/arla.conf], [ARLACONFFILE=$withval], [ARLACONFFILE='${sysconfdir}/arla.conf']) # Check if the dog is alive AC_MSG_CHECKING(whether to include kerberos 4) AC_ARG_WITH(krb4, [ --with-krb4=dir use kerberos 4 in dir], [if test "X$with_krb4" = "X"; then with_krb4=yes fi] ) AC_ARG_WITH(krb4-lib, [ --with-krb4-lib=dir use krb4-lib in dir], [if test "$withval" = "yes" -o "$withval" = "no"; then AC_MSG_ERROR([No argument for --with-krb4-lib]) elif test "X$with_krb4" = "X"; then with_krb4=yes fi] ) AC_ARG_WITH(krb4-include, [ --with-krb4-include=dir use krb4-include in dir], [if test "$withval" = "yes" -o "$withval" = "no"; then AC_MSG_ERROR([No argument for --with-krb4-include]) elif test "X$with_krb4" = "X"; then with_krb4=yes fi] ) dnl echo "with_krb4: $with_krb4" dnl echo "with_krb4_lib: $with_krb4_lib" dnl echo "with_krb4_include: $with_krb4_include" if test "X$with_krb4" = "X" -o "$with_krb4" = "yes"; then with_krb4=/usr/athena fi if test "$with_krb4" = "no"; then AC_MSG_RESULT(no) else KRB_LIB_DIR=$with_krb4/lib KRB_INC_DIR=$with_krb4/include if test "X$with_krb4_lib" != "X";then KRB_LIB_DIR=$with_krb4_lib fi if test "X$with_krb4_include" != "X";then KRB_INC_DIR=$with_krb4_include fi RXKAD="rxkad" RXKAD_LIBS="-L../rxkad -lrxkad -L$KRB_LIB_DIR -lkrb -ldes" KAFS_LIBS="-L$KRB_LIB_DIR -lkafs" RXKAD_MAKEFILE="rxkad/Makefile" CFLAGS="$CFLAGS -DKERBEROS" AC_MSG_RESULT(yes) fi dnl echo "KRB_LIB_DIR: $KRB_LIB_DIR" dnl echo "KRB_INC_DIR: $KRB_INC_DIR" dnl Make sure we get config.h if test "$KRB_INC_DIR"; then CFLAGS="-I${KRB_INC_DIR} $CFLAGS" CPPFLAGS="-I${KRB_INC_DIR} $CPPFLAGS" fi CFLAGS="-I../include $CFLAGS" dnl dnl Tests for editline dnl AC_FIND_FUNC_NO_LIBS(tgetent, termcap curses) AC_FIND_FUNC_NO_LIBS(el_init, edit) AC_FIND_FUNC_NO_LIBS(readline, readline) if test "$with_readline"; then AC_DEFINE(HAVE_READLINE, 1) editline_OBJS= LIB_readline="$READLINELIB "'$(LIB_tgetent)' INCLUDE_readline="$READLINEINCLUDE" elif test "$ac_cv_func_el_init" = yes; then AC_DEFINE(HAVE_READLINE, 1) editline_OBJS=edit_compat.o LIB_readline='-L'`pwd`'/lib/editline -leditline '"$LIB_el_init"' $(LIB_tgetent)' INCLUDE_readline='-I'`pwd`'/lib/editline -I$(top_srcdir)/lib/editline' elif test "$ac_cv_func_readline" = yes; then AC_DEFINE(HAVE_READLINE, 1) editline_OBJS= LIB_readline='-lreadline $(LIB_tgetent)' INCLUDE_readline= else AC_DEFINE(HAVE_READLINE, 1) editline_OBJS="editline.o complete.o sysunix.o" LIB_readline='-L'`pwd`'/lib/editline -leditline $(LIB_tgetent)' INCLUDE_readline='-I'`pwd`'/lib/editline -I$(top_srcdir)/lib/editline' fi AC_SUBST(LIB_readline) AC_SUBST(INCLUDE_readline) AC_SUBST(editline_OBJS) AC_SUBST(CFLAGS) AC_SUBST(KERNEL_INCLUDE) AC_SUBST(KERNEL_SRCS) AC_SUBST(KERNEL_HDRS) AC_SUBST(XFS_SUBDIR) AC_SUBST(KRB_LIB_DIR) AC_SUBST(KRB_INC_DIR) AC_SUBST(RXKAD) AC_SUBST(RXKAD_LIBS) AC_SUBST(KAFS_LIBS) AC_SUBST(ARLACACHEDIR) AC_SUBST(ARLACONFFILE) AC_FUNC_MMAP dnl dnl Various checks for headers and their contents dnl AC_HEADER_STDC AC_CHECK_HEADERS(arpa/inet.h crypt.h dbm.h dirent.h errno.h fcntl.h grp.h) AC_CHECK_HEADERS(inttypes.h ktypes.h ndbm.h netdb.h) AC_CHECK_HEADERS(netinet6/in6.h netinet/in6.h netinet/in6_machtypes.h) AC_CHECK_HEADERS(netinet/in.h paths.h pwd.h rpcsvc/dbm.h shadow.h syslog.h) AC_CHECK_HEADERS(sys/bitypes.h sys/cdefs.h sys/ioccom.h sys/ioctl.h) AC_CHECK_HEADERS(sys/param.h sys/poll.h sys/proc.h sys/resource.h) AC_CHECK_HEADERS(sys/select.h sys/socket.h sys/sockio.h sys/stat.h) AC_CHECK_HEADERS(sys/sysctl.h sys/sysent.h sys/sysproto.h sys/time.h) AC_CHECK_HEADERS(sys/tty.h sys/types.h sys/uio.h) AC_CHECK_HEADERS(termios.h unistd.h winsock.h) dnl dnl Check for struct winsize dnl AC_KRB_STRUCT_WINSIZE dnl dnl Various checks for libraries and their contents dnl AC_FIND_FUNC(syslog, syslog) dnl dnl System V is have misplaced the socket routines, should really be in libc dnl AC_FIND_FUNC(socket, socket, [#ifdef HAVE_SYS_TYPES_H #include #endif #ifdef HAVE_SYS_SOCKET_H #include #endif], [0,0,0]) AC_FIND_FUNC(gethostbyname, nsl, [#ifdef HAVE_SYS_TYPES_H #include #endif #ifdef HAVE_SYS_SOCKET_H #include #endif], "foo") AC_FIND_FUNC(res_search, resolv, [ #include #ifdef HAVE_SYS_TYPES_H #include #endif #ifdef HAVE_NETINET_IN_H #include #endif #ifdef HAVE_ARPA_NAMESER_H #include #endif #ifdef HAVE_RESOLV_H #include #endif ], [0,0,0,0,0]) AC_FIND_FUNC(dn_expand, resolv, [ #include #ifdef HAVE_SYS_TYPES_H #include #endif #ifdef HAVE_NETINET_IN_H #include #endif #ifdef HAVE_ARPA_NAMESER_H #include #endif #ifdef HAVE_RESOLV_H #include #endif ], [0,0,0,0,0]) # # Check if we can include both dirent.h and sys/dir.h # AC_CACHE_CHECK(if we can include both dirent.h and sys/dir.h, ac_cv_header_dirent_and_sys_dir, AC_TRY_COMPILE([ #include #include #include ],[void foo(void) {}], ac_cv_header_dirent_and_sys_dir=yes, ac_cv_header_dirent_and_sys_dir=no)) if test "$ac_cv_header_dirent_and_sys_dir" = yes; then AC_DEFINE(USE_SYS_DIR_H, 1) fi # # Check for working snprint # libroken # AC_CACHE_CHECK(for working snprintf,ac_cv_func_snprintf_working, ac_cv_func_snprintf_working=yes AC_TRY_RUN([ #include #include int main() { changequote(`,')dnl char foo[3]; changequote([,])dnl snprintf(foo, 2, "12"); return strcmp(foo, "1"); }],:,ac_cv_func_snprintf_working=no,:)) : << END @@@funcs="$funcs snprintf"@@@ END if test "$ac_cv_func_snprintf_working" = yes; then foo=HAVE_SNPRINTF AC_DEFINE_UNQUOTED($foo) fi AC_CHECK_FUNCS(asnprintf asprintf vasprintf vasnprintf vsnprintf) AC_EGREP_HEADER(sigaction, signal.h, AC_DEFINE(HAVE_POSIX_SIGNALS)) AC_GROK_TYPES(int8_t int16_t int32_t int64_t) AC_GROK_TYPES(u_int8_t u_int16_t u_int32_t u_int64_t) AC_GROK_TYPES(bool ssize_t) AC_GROK_TYPES(int32 u_int32) AC_TYPE_SIGNAL # # libroken # AC_FIND_IF_NOT_BROKEN(hstrerror, resolv, [#ifdef HAVE_NETDB_H #include #endif], 17) AC_BROKEN(chown daemon err errx fchown flock getcwd getdtablesize getopt) AC_BROKEN(getusershell inet_aton initgroups lstat memmove mkstemp) AC_BROKEN(putenv rcmd readv setegid setenv seteuid strcasecmp strdup) AC_BROKEN(strerror strftime strlwr strnlen strsep strtok_r strupr unsetenv) AC_BROKEN(verr verrx vsyslog vwarn vwarnx warn warnx writev) AC_CHECK_FUNCS(fcntl getrlimit getspnam getspuid mktime setregid) AC_CHECK_FUNCS(setresuid setreuid setsid setsockopt sysconf sysctl) AC_CHECK_FUNCS(syslog) dnl dnl prototypes dnl AC_NEED_PROTO([ #include ], strtok_r) AC_NEED_PROTO([ #include #include #ifdef HAVE_UNISTD_H #include #endif ], select) # Almost done.... AC_OUTPUT(Makefile \ include/Makefile \ arlad/Makefile \ lwp/Makefile \ xfs/Makefile \ $XFS_SUBDIR_Makefile \ $XFS_SUBDIR_BIN_Makefile \ rx/Makefile \ $RXKAD_MAKEFILE \ rxdef/Makefile \ appl/Makefile \ lib/Makefile \ lib/roken/Makefile \ lib/sl/Makefile \ lib/editline/Makefile \ lib/ko/Makefile \ util/Makefile \ ydr/Makefile \ conf/Makefile )