Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Fetching contributors…

Cannot retrieve contributors at this time

210 lines (184 sloc) 5.936 kB
dnl Process this file with autoconf to produce a configure script.
AC_INIT()
AM_INIT_AUTOMAKE(PACKAGE, VERSION)
AC_CONFIG_SUBDIRS(bin util)
dnl default install location
AC_PREFIX_DEFAULT(/usr/local/rancid)
AC_SUBST(PACKAGE)
PACKAGE=rancid
# VERSION needs to be updated such that 'make dist' uses the correct
# filename for the directory name and tarball.
AC_SUBST(VERSION)
VERSION=2.2b7
AM_MAINTAINER_MODE()
# Check for a preference for using mail addresses like rancid+admin-group
# instead of the standard rancid-admin-group
AC_MSG_CHECKING([whether mail addresses should be in the rancid+ form])
AC_ARG_ENABLE(mail-plus,
[ --enable-mail-plus enable mail to rancid+ addresses, instead of rancid-],
[if test "$enable_mail_plus" = yes; then
AC_MSG_RESULT(yes)
MAILPLUS="rancid+"
AC_SUBST(MAILPLUS)
else
AC_MSG_RESULT(no)
MAILPLUS="rancid-"
AC_SUBST(MAILPLUS)
fi],
[AC_MSG_RESULT(no)
MAILPLUS="rancid-"
AC_SUBST(MAILPLUS)
])
rd_cv_MAILPLUS=$MAILPLUS
AC_PATH_PROG(DIRNAME,dirname,no)
# locate GNU diff (-u option)
AC_PATH_PROG(DIFF,diff,no, /usr/local/bin:/usr/gnu/bin:/usr/bin:/usr/contrib/bin)
if test $DIFF = no; then
unset ac_cv_path_DIFF
AC_MSG_ERROR([can't locate diff.])
else
$DIFF -u /dev/null /dev/null > /dev/null 2>&1
if test $? -ne 0; then
$DIFF -C 2 /dev/null /dev/null > /dev/null 2>&1
if test $? -ne 0; then
$DIFF -c2 /dev/null /dev/null > /dev/null 2>&1
if test $? -ne 0; then
AC_MSG_ERROR([can't locate a diff which accepts the -u option.])
exit 1
else
DIFF_CMD="diff -c4"
fi
else
DIFF_CMD="diff -C 4"
fi
else
DIFF_CMD="diff -u -4"
fi
fi
rd_cv_DIFF_CMD=$DIFF_CMD
AC_SUBST(DIFF_CMD)
AC_PATH_PROG(SENDMAIL,sendmail,no, /usr/sbin:/usr/bin:/usr/lib)
AC_PATH_PROG(MAKE,gmake,no)
if test $MAKE = no; then
unset ac_cv_path_MAKE
AC_PATH_PROG(MAKE,make,no)
if test $MAKE = no; then
AC_MSG_ERROR([can't locate a make.])
exit 1
fi
fi
AC_PROG_MAKE_SET()
# Find an appropriate tar for use in "dist" targets. A "best guess"
# is good enough -- if we can't find GNU tar, we don't really care.
AC_CHECK_PROGS(TAR, gnutar gtar tar)
AC_CHECK_PROGS(AUTOMAKE, automake)
dnl locate perl 5 and expect.
AC_PROG_INSTALL
AC_PATH_PROG(PERLV_PATH,perl5,no)
if test $PERLV_PATH = no; then
unset ac_cv_path_PERLV_PATH
AC_PATH_PROG(PERLV_PATH,perl,no)
if test $PERLV_PATH = no; then
AC_MSG_ERROR([can't locate a suitable perl5.])
exit 1
else
$PERLV_PATH -e 'require 5;'
if test $? -ne 0 ; then
AC_MSG_ERROR([can't locate a suitable perl5.])
exit 1
fi
fi
fi
AC_SUBST(PERLV_PATH)
ac_cv_PERLV=`basename $PERLV_PATH`
AC_SUBST(PERLV)
AC_PATH_PROG(EXPECT_PATH,expect,no)
if test $EXPECT_PATH = no; then
AC_MSG_ERROR([can't locate expect.])
fi
AC_SUBST(EXPECT_PATH)
# locate ping and it's syntax
AC_PATH_PROG(PING_PATH,ping,no)
if test $PING_PATH = no; then
AC_MSG_ERROR([can't locate ping.])
exit 1
fi
# ping seems to take one of two formats for count (N)
# BSD: ping -c N host
# SVR: ping host N
$PING_PATH -c 1 -v 127.0.0.1 > /dev/null 2>&1
if test $? -ne 0 ; then
$PING_PATH 127.0.0.1 56 1 > /dev/null 2>&1
if test $? -ne 0 ; then
AC_MSG_ERROR([can't figure out how to pass count == 1 to $PING_PATH.])
exit 1
else
LG_PING_CMD="$PING_PATH"
AC_SUBST(LG_PING_CMD)
fi
else
LG_PING_CMD="$PING_PATH -c 1"
AC_SUBST(LG_PING_CMD)
fi
rd_cv_lg_ping_cmd=$LG_PING_CMD
# RD_BIN_DATAS are bin/ .in's that need to be installed without execute
# perms.
RD_BIN_DATAS=""
AC_SUBST(RD_BIN_DATAS)
rd_cv_rd_bin_datas=$RD_BIN_DATAS
# RD_BIN_PROGS are bin/ .in's that need to be installed with execute perms.
RD_BIN_PROGS="cat5rancid control_rancid \
alogin arancid clogin create_cvs blogin brancid do-diffs elogin erancid \
flogin francid jlogin jrancid par rancid-fe \
rancid rename rrancid xrancid"
AC_SUBST(RD_BIN_PROGS)
rd_cv_rd_bin_progs=$RD_BIN_PROGS
# RD_UTIL_PROGS are util/ .in's that need to be installed with execute perms.
RD_UTIL_PROGS="rtrfilter downreport"
AC_SUBST(RD_UTIL_PROGS)
rd_cv_rd_util_progs=$RD_UTIL_PROGS
# RD_UTIL_LG_PROGS are util/lg .in's that need to be installed with execute
# perms.
RD_UTIL_LG_PROGS="lg.cgi lgform.cgi"
AC_SUBST(RD_UTIL_LG_PROGS)
rd_cv_rd_util_lg_progs=$RD_UTIL_LG_PROGS
AC_SUBST(INST_PROGS)
INST_PROGS=$progs
# locate tools to build $PATH for env. order is significant. want to be
# sure that we pick up the the proper diff and ucbmail in bin/env.
ENV_PATH="`dirname $PERLV_PATH`:`dirname $EXPECT_PATH`:`dirname $SENDMAIL`"
ENV_PATH="$ENV_PATH:`dirname $DIRNAME`:`dirname $DIFF`"
AC_PATH_PROG(CVS,cvs,no)
ENV_PATH="$ENV_PATH:`dirname $ac_cv_path_CVS`"
AC_PATH_PROG(COMM,comm,no)
ENV_PATH="$ENV_PATH:`dirname $ac_cv_path_COMM`"
AC_PATH_PROG(FIND,find,no)
ENV_PATH="$ENV_PATH:`dirname $ac_cv_path_FIND`"
AC_PATH_PROG(GREP,grep,no)
ENV_PATH="$ENV_PATH:`dirname $ac_cv_path_GREP`"
AC_PATH_PROG(ID,id,no)
ENV_PATH="$ENV_PATH:`dirname $ac_cv_path_ID`"
AC_PATH_PROG(MKDIR,mkdir,no)
ENV_PATH="$ENV_PATH:`dirname $ac_cv_path_MKDIR`"
AC_PATH_PROG(RSH,rsh,no)
ENV_PATH="$ENV_PATH:`dirname $ac_cv_path_RSH`"
AC_PATH_PROG(SORT,sort,no)
ENV_PATH="$ENV_PATH:`dirname $ac_cv_path_SORT`"
AC_PATH_PROG(SSH,ssh,no)
if test $DIFF = no; then
ENV_PATH="$ENV_PATH:`dirname $ac_cv_path_SSH`"
fi
unset ac_cv_path_SSH
AC_PATH_PROG(TELNET,telnet,no)
ENV_PATH="$ENV_PATH:`dirname $ac_cv_path_TELNET`"
AC_PATH_PROG(TOUCH,touch,no)
ENV_PATH="$ENV_PATH:`dirname $ac_cv_path_TOUCH`"
ENV_PATH="$ENV_PATH:/usr/local/bin:/usr/bin"
AC_SUBST(ENV_PATH)
ENV_PATH=`echo $ENV_PATH | $PERLV_PATH -e 'foreach $x(split(":",<>)){next unless (length($x));push(@F, $x),$seen{$x}=1 unless (defined $seen{$x});}print join(":",@F);'`
ac_cv_env_path=$ENV_PATH
AC_SUBST(ENV_PATH)
AC_OUTPUT(Makefile \
man/Makefile man/env.5 man/lg.conf.5 man/lg_intro.1)
# fix permissions on scripts.
for file in $progs; do chmod a+x $file; done
Jump to Line
Something went wrong with that request. Please try again.