dnl dnl autoconf for heartbeat dnl Started by David Lee December 2000 dnl automake stuff dnl added by Michael Moerz February 2001 dnl Initialiase, with sanity check of a unique file in the hierarchy AC_INIT(heartbeat.spec.in) AC_CONFIG_AUX_DIR(.) AC_REVISION($Revision: 1.235.2.45 $) dnl cvs revision AC_CANONICAL_HOST dnl Where #defines go (e.g. `AC_CHECK_HEADERS' below) AM_CONFIG_HEADER(linux-ha/config.h include/ha_config.h) ALL_LINGUAS="en fr" AM_INIT_AUTOMAKE(heartbeat, 1.2.5) RPMREL=1 AC_SUBST(RPMREL) HB_PKG=heartbeat AC_SUBST(HB_PKG) CC_IN_CONFIGURE=yes export CC_IN_CONFIGURE INIT_EXT="" USE_MODULES=0 echo Our Host OS: $host_os case "$host_os" in solaris*) LIBS="-L/usr/local/lib $LIBS" CPPFLAGS="$CPPFLAGS -I/usr/local/include -I/opt/sfw/include" INIT_EXT=".sh" ;; *bsd*) LIBS="-L/usr/local/lib" CPPFLAGS="$CPPFLAGS -I/usr/local/include" INIT_EXT=".sh" ;; *linux*) USE_MODULES=1 ;; dnl anything? darwin*) LIBS="-L/usr/lib -L/sw/lib" CPPFLAGS="$CPPFLAGS -I/usr/include -I/sw/usr/include -I/sw/include" ;; esac MISSINGTHINGS="" FatalMissingThing() { if test X"$MISSINGTHINGS" = X; then MISSINGTHINGS="$MISSINGTHINGS $1" else MISSINGTHINGS="$MISSINGTHINGS, $1" fi shift for j in "$@" do AC_MSG_RESULT(configure: ERROR: $j ============) done } CheckMissingThings() { if test "X$MISSINGTHINGS" != "X" then AC_MSG_ERROR(The following required components noted earlier are missing: $MISSINGTHINGS Please supply them and try again.) fi } AC_SUBST(INIT_EXT) AC_SUBST(USE_MODULES) dnl dnl dnl Don't ya just hate working around buggy code? dnl dnl At least code that doesn't do what you want... dnl dnl This is to make substitutions work right in RPM specfiles. dnl dnl Horms says "This is pretty ugly". dnl Alanr says: "It works. s/ ugly//" dnl dnl Patches are being accepted... dnl prefix=`eval echo "$prefix"` case $prefix in NONE) prefix=/usr/local;; esac var() { case $1 in *'${'*) res=`eval echo "$1"`;; *) res="$1";; esac case "$res" in ""|NONE) echo "$2";; *) echo "$res";; esac } exec_prefix=`var "$exec_prefix" "$prefix"` bindir=`var "$bindir" "$exec_prefix/bin"` sbindir=`var "$sbindir" "$exec_prefix/sbin"` libexecdir=`var "$libexecdir" "$exec_prefix/libexec"` datadir=`var "$datadir" "$prefix/share"` sysconfdir=`var "$sysconfdir" "$prefix/etc"` sharedstatedir=`var "$sharedstatedir" "$prefix/com"` localstatedir=`var "$localstatedir" "$prefix/var"` libdir=`var "$libdir" "$exec_prefix/lib"` includedir=`var "$includedir" "$exec_prefix/include"` oldincludedir=`var "$oldincludedir" "$exec_prefix/include"` infodir=`var "$infodir" "$prefix/info"` mandir=`var "$mandir" "$exec_prefix/man"` docdir=${datadir}/doc/${HB_PKG}-${VERSION} HA_VARRUNDIR="${localstatedir}/run" AC_SUBST(HA_VARRUNDIR) AC_DEFINE_UNQUOTED(HA_VARRUNDIR,"$HA_VARRUNDIR", var run directory) HA_VARLIBDIR="${localstatedir}/lib" AC_SUBST(HA_VARLIBDIR) AC_DEFINE_UNQUOTED(HA_VARLIBDIR,"$HA_VARLIBDIR", var lib directory) HA_COREDIR="${HA_VARLIBDIR}/${HB_PKG}/cores" AC_SUBST(HA_COREDIR) AC_DEFINE_UNQUOTED(HA_COREDIR,"$HA_COREDIR", root directory to drop core files in) HA_LOGDAEMON_IPC="${HA_VARLIBDIR}/log_daemon" AC_SUBST(HA_LOGDAEMON_IPC) AC_DEFINE_UNQUOTED(HA_LOGDAEMON_IPC, "$HA_LOGDAEMON_IPC", Logging Daemon IPC) STONITHPKG=stonith AC_SUBST(STONITHPKG) PILSPKG=pils AC_SUBST(PILSPKG) pils_includedir="${includedir}/${PILSPKG}" pils_plugindir="${libdir}/${PILSPKG}/plugins" stonith_includedir="${includedir}/${STONITHPKG}" stonith_plugindir="${libdir}/${STONITHPKG}/plugins" base_includedir="${includedir}" saf_includedir="${includedir}/saf" AC_SUBST(pils_includedir) AC_SUBST(pils_plugindir) AC_SUBST(stonith_includedir) AC_SUBST(stonith_plugindir) AC_SUBST(base_includedir) AC_SUBST(saf_includedir) AC_SUBST(docdir) # # Other interesting variables: ${host_vendor} and ${host_os} # sample values: suse linux # dnl We use this in the RPM specfile... AC_SUBST(ac_configure_args) dnl ************************************************************************* PATH="$PATH:/sbin:/usr/sbin:/usr/local/sbin:/usr/local/bin" export PATH dnl checks for programs dnl dnl Which C compiler? dnl Defaults to GNU C compiler if available. dnl Always tries to set the compiler to ANSI C via options (AM) dnl Can force other with environment variable "CC". AC_PROG_CC AM_PROG_CC_STDC AC_LIBTOOL_DLOPEN dnl Enable dlopen support... AC_LIBLTDL_CONVENIENCE dnl make libltdl a convenience lib AM_PROG_LIBTOOL AC_PROG_YACC AC_DECL_YYTEXT AM_PROG_LEX AC_CHECK_PROG(MAKE, gmake, gmake, make) AC_MSG_CHECKING(for gmake or make) if test x"${MAKE}" = x""; then FatalMissingThing "[g]make" "You need gmake to build heartbeat." \ "You can get the source from ftp://www.gnu.org/pub/gnu/" \ "or you can locate it via http://www.gnu.org/software/make/" else AC_MSG_RESULT("$MAKE has been found.") fi AC_SYS_LARGEFILE AC_CHECK_PROG(HTML2TXT, lynx, lynx) AC_CHECK_PROG(POD2MAN, pod2man, pod2man) AC_PATH_PROGS(ROUTE, route) AC_PATH_PROGS(RPM, rpmbuild) if test x"${RPM}" = x""; then AC_PATH_PROGS(RPM, rpm) fi AC_DEFINE_UNQUOTED(ROUTE, "$ROUTE", path to route command) AC_PATH_PROGS(NETSTAT, netstat) AC_DEFINE_UNQUOTED(NETSTAT, "$NETSTAT", path to the netstat command) AC_PATH_PROGS(PING, ping) AC_PATH_PROGS(IFCONFIG, ifconfig) AC_PATH_PROGS(SSH, ssh) AC_PATH_PROGS(SCP, scp) AC_PATH_PROGS(PYTHON, python) dnl - Determine which mail program exists. Mailx is Solaris AC_PATH_PROGS(MAILCMD, mail, mailx) AC_SUBST(MAILCMD) AC_DEFINE_UNQUOTED(IFCONFIG, "$IFCONFIG", path to the ifconfig command) AC_PATH_PROGS(PKGCONFIG, pkg-config) AC_PATH_PROGS(BLOCKDEV, blockdev) AC_PATH_PROGS(FUSER, fuser) AC_PATH_PROGS(MOUNT, mount) AC_PATH_PROGS(UMOUNT, umount) AC_PATH_PROGS(FSCK, fsck) AC_PATH_PROGS(MODPROBE, modprobe) AC_PATH_PROGS(RAIDSTART, raidstart) AC_PATH_PROGS(RAIDSTOP, raidstop) AC_PATH_PROGS(LIBNETCONFIG, libnet-config) AC_PATH_PROGS(GETENT, getent) AC_PATH_PROGS(IP2UTIL, ip) AC_PATH_PROGS(XML2CONFIG, xml2-config) dnl "whoami", if it exists, may be hidden away on some System-V (e.g. Solaris) AC_PATH_PROGS(WHOAMI, whoami, , ${PATH}:/usr/ucb) AC_PATH_PROGS(IPTABLES, iptables) AC_PATH_PROGS(STRINGSCMD, strings) AC_DEFINE_UNQUOTED(STRINGSCMD, "$STRINGSCMD", path to strings command) AC_SUBST(STRINGSCMD) AC_PATH_PROGS(PERL, perl) AC_SUBST(PERL) AC_PATH_PROGS(SWIG, swig) AC_SUBST(SWIG) dnl ************************************************************************ dnl checks for libraries dnl Needed for libnet test. dnl ************************************************************************ AC_CHECK_LIB(nsl, t_open) dnl -lnsl AC_CHECK_LIB(socket, socket) dnl -lsocket AC_CHECK_LIB(posix4, sched_getscheduler) dnl -lposix4 AC_CHECK_LIB(c, dlopen) dnl if dlopen is in libc... AC_CHECK_LIB(dl, dlopen) dnl -ldl (for Linux) AC_CHECK_LIB(rt, sched_getscheduler) dnl -lrt (for Tru64) AC_CHECK_LIB(gnugetopt, getopt_long) dnl -lgnugetopt ( if available ) dnl ************ uuid ********************** dnl dnl In heartbeat 1.2.x, uuid is optional, being used only by lrm and crm, dnl themselves experimental. Only support the e2fsprogs implementation of uuid. dnl More flexibility is possible at 2.0.0 and beyond. AC_CHECK_LIB(uuid, uuid_parse) dnl - e2fsprog version of uuid if test "$enable_crm" = yes -o "$enable_lrm" = yes; then if test "$ac_cv_lib_uuid_uuid_parse" = yes; then AC_MSG_CHECKING(checking for uuid functionality:) AC_MSG_RESULT(using ex2fs uuid) else FatalMissingThing "uuid capability" "No UUID functionality found. Needed for CRM/LRM" enable_lrm="no"; enable_crm="no"; fi fi dnl ************ uuid ********************** AC_MSG_CHECKING(which glib config exists) if test "X${PKGCONFIG}" != "X"; then PKGNAME="" for arg in "glib" do if $PKGCONFIG --exists "$arg"; then GLIBCONFIG="$PKGCONFIG $arg" break fi done else AC_PATH_PROGS(GLIBCONFIG, glib-config, glib12-config) AC_PATH_PROGS(GLIBCONFIG, glib12-config, glib13-config) AC_PATH_PROGS(GLIBCONFIG, glib13-config) fi if test "X${GLIBCONFIG}" = "X"; then FatalMissingThing "glib-devel" \ "You need the glib 1.x development package to continue." "You can get the source from ftp://ftp.gtk.org/pub/gtk/v1.2/" "or you can locate it via http://www.gtk.org/download/" fi AC_MSG_RESULT("using $GLIBCONFIG") AC_MSG_CHECKING(which libnet version is installed) if test x"${LIBNETCONFIG}" = x""; then AC_MSG_RESULT(using old version of API) dnl The old version of the API REQUIRES $LIBNETCONFIG dnl so we can only deal with new API unless we have it. AC_CHECK_LIB(net, libnet_get_hwaddr, [], [FatalMissingThing "libnet[-devel]" "You need libnet to continue." "You can get libnet from http://www.packetfactory.net/libnet/" "Note that some RPMs split libnet up into libnet and libnet-devel." "In this case you have to install libnet-devel"]) LIBNETDEFINES="" LIBNETLIBS=" -lnet" if test "$ac_cv_lib_nsl_t_open" = yes; then LIBNETLIBS="-lnsl $LIBNETLIBS" fi if test "$ac_cv_lib_socket_socket" = yes; then LIBNETLIBS="-lsocket $LIBNETLIBS" fi libnet=net else LIBNETDEFINES="`$LIBNETCONFIG --defines` `$LIBNETCONFIG --cflags`"; LIBNETLIBS="`$LIBNETCONFIG --libs`"; AC_MSG_RESULT(using $LIBNETCONFIG) case $LIBNETLIBS in *-l*) libnet=`echo $LIBNETLIBS | sed 's%.*-l%%'`;; *) libnet=$LIBNETLIBS;; esac fi AC_SUBST(LIBNETDEFINES) AC_SUBST(LIBNETLIBS) AC_CHECK_LIB($libnet,libnet_init, [new_libnet=yes; AC_DEFINE(HAVE_LIBNET_1_1_API, 1, Libnet 1.1 API)], [new_libnet=no; AC_DEFINE(HAVE_LIBNET_1_0_API, 1, Libnet 1.0 API)],$LIBNETLIBS) AC_MSG_CHECKING(where is python installed) if test "x${PYTHON}" = x; then PYTHON="/usr/bin/env python"; fi AC_MSG_RESULT("using $PYTHON"); AC_MSG_CHECKING(if netstat supports -f inet flag) $NETSTAT -rn -f inet > /dev/null 2>&1 if test x"$?" = x"0"; then AC_DEFINE(NETSTATPARM, "-rn -f inet ", parameters to netstat to retrieve route information) AC_MSG_RESULT("yes") else AC_DEFINE(NETSTATPARM, "-rn ", parameters to netstat to retrieve route information) AC_MSG_RESULT("no") fi if test X${PING} = X then FatalMissingThing "ping" "ping command is mandantory" fi dnl Determine if we use -w1 or -t1 for ping (in PYTHON Scripts) AC_MSG_CHECKING(ping option for timeout - w or t) for PING_TIMEOUT_OPT in "-w1" "-t1" do $PING -nq -c1 $PING_TIMEOUT_OPT localhost > /dev/null 2>&1 if test "$?" = 0 then AC_DEFINE_UNQUOTED(PING_TIMEOUT_OPT, "$PING_TIMEOUT_OPT", option for ping timeout) AC_MSG_RESULT($PING_TIMEOUT_OPT) break fi done AC_SUBST(PING_TIMEOUT_OPT) dnl Determining a route (particularly for "findif"). dnl There are various mechanisms on different systems. dnl Some mechanisms require root access to evaluate, but configure is often dnl (indeed, some say should be always) running non-root. dnl dnl Therefore much of the determination has to be run-time. dnl So the principle here, at configure time, is to explore what might be dnl available, and offer as much as possible to run-time. dnl AC_DEFINE(ROUTEPARM, "-n get", paramters for route to retrieve route information) AC_DEFINE(PROCROUTE, "/proc/net/route", path were to find route information in proc) AC_MSG_CHECKING(ifconfig option to list interfaces) for IFCONFIG_A_OPT in "" "-A" "-a" do $IFCONFIG $IFCONFIG_A_OPT > /dev/null 2>&1 if test "$?" = 0 then AC_DEFINE_UNQUOTED(IFCONFIG_A_OPT, "$IFCONFIG_A_OPT", option for ifconfig command) AC_MSG_RESULT($IFCONFIG_A_OPT) break fi done AC_MSG_CHECKING(for the location of the lock directory) for TTY_LOCK_D in /var/lock /var/spool/lock /var/spool/locks do if test -d "$TTY_LOCK_D" then AC_MSG_RESULT($TTY_LOCK_D) AC_DEFINE_UNQUOTED(TTY_LOCK_D, "$TTY_LOCK_D", tty lock file directory) break fi done AC_SUBST(IFCONFIG_A_OPT) AC_SUBST(WHOAMI) AC_SUBST(HTML2TXT) AC_SUBST(POD2MAN) AC_SUBST(ROUTEPARM) AC_SUBST(PROCROUTE) dnl Locales check - is a real ugly workaround for now til I find dnl something more useful dnl dnl "Eric Z. Ayers" wrote: dnl > dnl > Here are some more data points: dnl > dnl > SUN: /usr/lib/locale/ dnl > HP : /usr/lib/nls/loc/ dnl > OSF: /usr/lib/nls/loc/ dnl > LINUX: /usr/share/locale/ dnl > UNIXWARE: /usr/lib/locale/ dnl > FREEBSD: /usr/share/locale dnl > VMS: just kidding dnl FindADir() { type="$1" whatfor="$2" shift; shift; AC_MSG_CHECKING(for $whatfor directory) for dir do if test -d "$dir" then AC_MSG_RESULT($dir) echo $dir return 0 fi done AC_MSG_RESULT(not found) return 1 } locale_locations="/usr/share/locale /usr/lib/locale /usr/lib/nls/loc" LOCALE=`FindADir error "locale" $locale_locations` if test "X$LOCALE" = X then FatalMissingThing "locale directory" "Locale directory is mandantory." fi RPMDIR=`FindADir warn "RPM" /usr/src/packages /usr/src/redhat` if test x"${HAVE_LIBRT}" = x""; then LIBRT="" else LIBRT=-lrt fi AC_SUBST(LIBRT) # # Where is dlopen? # if test "$ac_cv_lib_c_dlopen" = yes; then LIBADD_DL="" elif test "$ac_cv_lib_dl_dlopen" = yes; then LIBADD_DL=-ldl else LIBADD_DL=${lt_cv_dlopen_libs} fi dnl dnl Check for location of gettext dnl dnl On at least Solaris 2.x, where it is in libc, specifying lintl causes dnl grief. Ensure minimal result, not the sum of all possibilities. dnl And do libc first. dnl Known examples: dnl c: Linux, Solaris 2.6+ dnl intl: BSD, AIX FunIsInLib() { fun=$1 lib=$2 lib_var1="ac_cv_lib_${lib}_$fun" lib_var2="ac_cv_lib_${lib}___$fun" for v in $lib_var1 $lib_var2 do var=`eval echo '${'${v}'}'` case $var in yes) return 0;; no) return 1;; esac done return 0 } for gt_test_lib in c intl do AC_CHECK_LIB($gt_test_lib, gettext) if FunIsInLib gettext $gt_test_lib; then break fi done # # Where is gettext()? # if FunIsInLib gettext c ; then LIBADD_INTL="" elif FunIsInLib gettext intl ; then LIBADD_INTL=-lintl elif test -f /usr/local/lib/libintl.so -a -s /usr/local/lib/libintl.so; then # This was added for FreeBSD LIBADD_INTL="-lintl" elif test -f /sw/lib/libintl.a -a -s /sw/lib/libintl.la -a -s /sw/lib/libintl.dylib; then # This was added for Darwin + Fink LIBADD_INTL="-lintl" else FatalMissingThing "gettext" "no library providing gettext found" fi dnl dnl Glib allows its headers/libraries to be installed anywhere. dnl And they provide a command to let you know where they are. dnl This is nice, but having them in standard places is nicer ;-) dnl AC_MSG_CHECKING(for special glib includes: ) GLIBHEAD=`$GLIBCONFIG --cflags` AC_MSG_RESULT($GLIBHEAD) CPPFLAGS="$CPPFLAGS $GLIBHEAD" AC_SUBST(GLIBHEAD) dnl Note: Not bundling "GLIBLIB" with general "LIBS". dnl 1. Only very few programs require GLIBLIB dnl 2. Danger of creating run-time dependency on build-time LD_LIBRARY_PATH AC_MSG_CHECKING(for glib library flags) GLIBLIB=`$GLIBCONFIG --libs` AC_MSG_RESULT($GLIBLIB) AC_SUBST(GLIBLIB) dnl ************************************************************************ dnl checks for header files dnl dnl check for ANSI *.h files first dnl asm/page.h: Linux, for system PAGE_SIZE AC_HEADER_STDC AC_CHECK_HEADERS(db.h) AC_CHECK_HEADERS(asm/page.h) AC_CHECK_HEADERS(time.h) AC_CHECK_HEADERS(stdarg.h) AC_CHECK_HEADERS(uuid.h) AC_CHECK_HEADERS(uuid/uuid.h) AC_CHECK_HEADERS(sys/param.h) AC_CHECK_HEADERS(netinet/in.h) AC_CHECK_HEADERS([stdint.h unistd.h]) dnl ************************************************************************ dnl FreeBSD requires sys/param.h and in.h to compile test netinet headers. dnl ************************************************************************ if test "$ac_cv_header_sys_param_h" -a "$ac_cv_header_netinet_in_h" = no; then AC_CHECK_HEADERS(netinet/in_systm.h) AC_CHECK_HEADERS(netinet/ip.h) AC_CHECK_HEADERS(netinet/ip_var.h) AC_CHECK_HEADERS(netinet/ip_compat.h) AC_CHECK_HEADERS(netinet/ip_fw.h) else AC_CHECK_HEADERS(netinet/in_systm.h,[],[],[#include #include ]) if test "$ac_cv_header_in_systm_h" = no; then AC_CHECK_HEADERS(netinet/ip.h,[],[],[#include #include ]) else AC_CHECK_HEADERS(netinet/ip.h,[],[],[#include #include #include ]) fi AC_CHECK_HEADERS(netinet/ip_var.h,[],[],[#include #include ]) AC_CHECK_HEADERS(netinet/ip_compat.h,[],[],[#include #include ]) AC_CHECK_HEADERS(netinet/ip_fw.h,[],[],[#include #include ]) fi AC_CHECK_HEADERS(sys/sockio.h) AC_CHECK_HEADERS(libintl.h) AC_CHECK_HEADERS(sys/types.h) AC_CHECK_HEADERS(sys/socket.h) AC_CHECK_HEADERS(arpa/inet.h) AC_CHECK_HEADERS(net/ethernet.h) AC_CHECK_HEADERS(strings.h malloc.h) AC_CHECK_HEADERS(termio.h) AC_CHECK_HEADERS(getopt.h) AC_CHECK_HEADERS(linux/watchdog.h,[],[],[#include ]) dnl ************************************************************************ dnl checks for headers needed by clplumbing On BSD AC_CHECK_HEADERS(sys/syslimits.h) if test "$ac_cv_header_sys_param_h" = no; then AC_CHECK_HEADERS(sys/ucred.h) else AC_CHECK_HEADERS(sys/ucred.h,[],[],[#include ]) fi dnl ************************************************************************ dnl checks for headers needed by clplumbing On Solaris AC_CHECK_HEADERS(sys/cred.h xti.h) dnl ************************************************************************ dnl checks for headers needed by clplumbing On FreeBSD/Solaris AC_CHECK_HEADERS(sys/filio.h) dnl dnl These next two are used to help us figure out whether to include dnl some optional STONITH plugins... dnl AC_CHECK_HEADERS(vacm_client_api.h) AC_CHECK_HEADERS(curl/curl.h) AC_MSG_CHECKING(For libOpenIPMI version 2 or greater) AC_TRY_COMPILE([#include ], [ #if (OPENIPMI_VERSION_MAJOR < 2 ) #error "Too Old" #endif ], AC_MSG_RESULT("yes") AM_CONDITIONAL(USE_OPENIPMI, true), AC_MSG_RESULT("no") AM_CONDITIONAL(USE_OPENIPMI, false)) AC_MSG_CHECKING(for special libxml2 includes) if test "x$XML2CONFIG" = "x"; then AC_MSG_RESULT(libxml2 config not found) else XML2HEAD=`$XML2CONFIG --cflags` AC_MSG_RESULT($XML2HEAD) fi CPPFLAGS="$CPPFLAGS $XML2HEAD" dnl ************************************************************************ dnl * Check for linux/icmpv6.h to make enable the IPv6addr resource agent AC_CHECK_HEADERS(linux/icmpv6.h,[],[],[#include ]) AM_CONDITIONAL(USE_IPV6ADDR, test "$ac_cv_header_linux_icmpv6_h" = yes -a $new_libnet = yes ) AC_CHECK_HEADERS(libxml/xpath.h) AC_CHECK_HEADERS(openssl/md5.h) dnl dnl Could check for the libraries, but if you have the headers, dnl you're a dolt for not having installed the libs ;-) dnl AM_CONDITIONAL(USE_VACM, test "$ac_cv_header_vacm_client_h" = yes) AM_CONDITIONAL(USE_DRAC3, test "$ac_cv_header_curl_curl_h" = yes -a "$ac_cv_header_libxml_xpath_h" = yes -a "$ac_cv_header_openssl_md5_h" = yes) dnl dnl SNMP checks dnl SNMPLIB="" SNMPAGENTLIB="" SNMPCONFIG="" ENABLE_SNMP="yes" AC_CHECK_HEADERS(ucd-snmp/snmp.h,[],[],[#include #include ]) AC_CHECK_HEADERS(net-snmp/net-snmp-config.h) if test "x${ac_cv_header_net_snmp_net_snmp_config_h}" = "xyes"; then AC_PATH_PROGS(SNMPCONFIG, net-snmp-config) if test "X${SNMPCONFIG}" = "X"; then AC_MSG_RESULT(You need the net snmp development package to continue.) ENABLE_SNMP="no" else AC_MSG_CHECKING(for special snmp libraries) SNMPLIB=`net-snmp-config --libs` SNMPAGENTLIB=`net-snmp-config --agent-libs` AC_MSG_RESULT($SNMPLIB) fi elif test "x${ac_cv_header_ucd_snmp_snmp_h}" = "xyes"; then # UCD SNMP # ucd-snmp-config does not seem to exist, so just # rely on people having their LDFLAGS set to the path where AC_CHECK_LIB(snmp, init_snmp, SNMPLIB="-lsnmp") if test "X${SNMPLIB}" = "X"; then AC_CHECK_LIB(ucdsnmp, init_snmp, SNMPLIB="-lucdsnmp") fi SNMPAGENTLIB="$SNMPLIB" if test "X${SNMPLIB}" = "X"; then ENABLE_SNMP="no" AC_MSG_RESULT("Could not find ucdsnmp libary." "Please make sure that libsnmp or libucdsnmp" "are in your libaray path. Or the path to LDFLAGS") fi else ENABLE_SNMP="no" fi if test "$ENABLE_SNMP" = "no" -o "x${enable_snmp_subagent}" != "xyes"; then enable_snmp_subagent="no" RPM_ENABLE_SNMP_SUBAGENT="0" else RPM_ENABLE_SNMP_SUBAGENT="1" fi check_snmp_libs () { OLDLIBS="$LIBS" LIBS="$LIBS $@" AC_MSG_CHECKING(snmp libraries: $LIBS) AC_LINK_IFELSE([AC_LANG_PROGRAM([], [])], , AC_MSG_ERROR(cannot link with requested libraries. Reported errors follow: $(cat conftest.err))) AC_MSG_RESULT(ok) LIBS="$OLDLIBS" } if test "$ENABLE_SNMP" = "yes"; then check_snmp_libs $SNMPLIB fi if test "$enable_snmp_subagent" = "yes"; then check_snmp_libs $SNMPAGENTLIB fi AC_ARG_WITH(mibsdir, [ --with-mibsdir=DIR directory for mib files. ], [ MIBS_DIR="$withval" ]) if test "x${enable_snmp_subagent}" = "xyes" -a "X${MIBS_DIR}" = "X"; then AC_MSG_CHECKING(which MIB directory to use) for mibs_dir in /usr/share/snmp/mibs \ /usr/local/share/snmp/mibs; do if test -d "$mibs_dir"; then MIBS_DIR="$mibs_dir" fi done if test "X${MIBS_DIR}" = "X"; then AC_MSG_ERROR(Could not find mibs directory, please specify with --with-mibsdir); fi AC_MSG_RESULT($MIBS_DIR); fi AC_SUBST(MIBS_DIR) AC_SUBST(SNMPCONFIG) AC_SUBST(SNMPLIB) AC_SUBST(SNMPAGENTLIB) AC_SUBST(RPM_ENABLE_SNMP_SUBAGENT) AM_CONDITIONAL(USE_APC_SNMP, test "$ENABLE_SNMP" = "yes") AM_CONDITIONAL(SNMP_SUBAGENT_BUILD, test "x${enable_snmp_subagent}" = "xyes") dnl dnl On many systems libcrypto is needed when linking against libsnmp. dnl Check to see if it exists, and if so use it. dnl AC_CHECK_LIB(crypto, CRYPTO_free, CRYPTOLIB="-lcrypto",) AC_SUBST(CRYPTOLIB) dnl ************************************************************************ dnl Handy function for checking for typedefs or struct defs dnl ************************************************************************ check_for_type() { type="$1" headers="" shift for arg do headers="${headers}${arg} " done program="if ((${type} *) 0) return 0; if (sizeof(${type})) return 0; return 0;" have="HAVE_`echo "$type" | tr ' ' '_' | dd conv=ucase 2>/dev/null`" varhave="heartbeat_cv_$have" AC_CACHE_CHECK([for type $type ],$varhave,[ AC_TRY_COMPILE([$headers], [$program], eval $varhave=yes, eval $varhave=no , eval $varhave=cross) ]) if test x"`eval echo '${'$varhave'}'`" = xyes; then return 0 fi return 1 } check_for_type_member() { type="$1" member="$2" headers="" shift shift for arg do headers="${headers}${arg} " done program="${type} foo; if ((${type} *) 0) return 0; if (sizeof(${type})) return 0; if (sizeof(foo)) return 0; (void*)foo.${member}; return 0;" have="HAVE_`echo "$type" | tr ' ' '_' | dd conv=ucase 2>/dev/null`" varhave="heartbeat_cv_$have" AC_CACHE_CHECK([for type $type ],$varhave,[ AC_TRY_COMPILE([$headers], [$program], eval $varhave=yes, eval $varhave=no , eval $varhave=cross) ]) if test x"`eval echo '${'$varhave'}'`" = xyes; then return 0 fi return 1 } dnl ************************************************************************ dnl checks for typedefs dnl dnl dnl Check poll.h for nfds_t (Linux Only), if not define it as an unsigned long int. dnl if check_for_type "nfds_t" "#include "; then AC_DEFINE(HAVE_NFDS_T,1,[Do we have nfds_t?]) AC_DEFINE(HA_HAVE_NFDS_T,1,[Do we have nfds_t?]) fi dnl ************************************************************************ dnl checks for structures dnl # # Look for all the variants of local/UNIX socket credentials # # Include all of these headers that we can find... # headers="" for hdr in "sys/param.h" "sys/socket.h" "sys/ucred.h" do hdrvar=ac_cv_header_`echo $hdr | sed -e 's%\.%_%' -e 's%/%_%'` if test x"`eval echo '${'$hdrvar'}'`" = xyes; then headers="$headers #include <$hdr>" fi done if check_for_type_member "struct ucred" "cr_ref" "$headers"; then AC_DEFINE(HAVE_STRUCT_UCRED_DARWIN,1,[Do we have the Darwin version of struct ucred?]) fi if check_for_type "struct ucred" "$headers"; then AC_DEFINE(HAVE_STRUCT_UCRED,1,[Do we have struct ucred?]) fi if check_for_type "struct cmsgcred" "$headers" ; then AC_DEFINE(HAVE_STRUCT_CMSGCRED,1,[Do we have struct cmsgcred?]) fi if check_for_type "struct fcred" "$headers"; then AC_DEFINE(HAVE_STRUCT_FCRED,1,[Do we have struct fcred?]) fi if check_for_type "struct cred" "$headers"; then AC_DEFINE(HAVE_STRUCT_CRED,1,[Do we have struct cred?]) fi if check_for_type "struct sockcred" "$headers"; then AC_DEFINE(HAVE_STRUCT_SOCKCRED,1,[Do we have struct sockcred?]) fi dnl Check TERMIOS for components (e.g. c_line not present on Solaris) dnl AC_CACHE_CHECK([for c_line in termios],samba_cv_HAVE_TERMIOS_C_LINE,[ AC_TRY_COMPILE([#include #include ], [struct termios ti; ti.c_line = 'a';], samba_cv_HAVE_TERMIOS_C_LINE=yes,samba_cv_HAVE_TERMIOS_C_LINE=no,samba_cv_HAVE_TERMIOS_C_LINE=cross)]) if test x"$samba_cv_HAVE_TERMIOS_C_LINE" = x"yes"; then AC_DEFINE(HAVE_TERMIOS_C_LINE,1,[ ]) fi dnl Check sockaddr_in for components (e.g. sin_len not present on Solaris) dnl AC_CACHE_CHECK([for sin_len in sockaddr_in],samba_cv_HAVE_SOCKADDR_IN_SIN_LEN,[ AC_TRY_COMPILE([#include #include ], [struct sockaddr_in si; si.sin_len = 1;], samba_cv_HAVE_SOCKADDR_IN_SIN_LEN=yes,samba_cv_HAVE_SOCKADDR_IN_SIN_LEN=no,samba_cv_HAVE_SOCKADDR_IN_SIN_LEN=cross)]) if test x"$samba_cv_HAVE_SOCKADDR_IN_SIN_LEN" = x"yes"; then AC_DEFINE(HAVE_SOCKADDR_IN_SIN_LEN,1,[ ]) fi dnl Check msghdr for components (e.g. msg_control/msg_controlen not present on Solaris) dnl AC_CACHE_CHECK([for msg_control in msghdr],samba_cv_HAVE_MSG_CONTROL_MSGHDR,[ AC_TRY_COMPILE([#include #include ], [struct msghdr mh; mh.msg_control = (void *)0;], samba_cv_HAVE_MSG_CONTROL_MSGHDR=yes,samba_cv_HAVE_MSG_CONTROL_MSGHDR=no,samba_cv_HAVE_MSG_CONTROL_MSGHDR=cross)]) if test x"$samba_cv_HAVE_MSG_CONTROL_MSGHDR" = x"yes"; then MSGHDR_TYPE="msghdr" IPCSOCKET_C="ipcsocket.c" IPCSOCKET_LO="ipcsocket.lo" else MSGHDR_TYPE="nmsghdr" IPCSOCKET_C="" IPCSOCKET_LO="" fi dnl dnl Check for ALIGN in /sys/param.h dnl AC_MSG_CHECKING("for ALIGN in sys/param.h") AC_EGREP_CPP(FoundAlign, [#include #ifdef ALIGN FoundAlign #endif ], [ ALIGN="ALIGN" AC_MSG_RESULT("Yes") ], AC_MSG_RESULT("No")) AC_MSG_CHECKING("for T_ALIGN in xti.h") AC_EGREP_CPP(FoundAlign, [#include #ifdef T_ALIGN FoundAlign #endif ], [ ALIGN="T_ALIGN" AC_MSG_RESULT("Yes") ], AC_MSG_RESULT("No")) AC_SUBST(IPCSOCKET_C) AC_SUBST(IPCSOCKET_LO) AC_SUBST(ALIGN) AC_SUBST(MSGHDR_TYPE) dnl ************************************************************************ dnl checks for compiler characteristics dnl dnl Warnings for C compilers. Note: generic, portable warnings only. dnl Things likely to be specific to a particular OS or module should be dnl carefully handled afterwards. AC_C_STRINGIZE AC_ARG_ENABLE([fatal-warnings], [ --enable-fatal-warnings very pedantic and fatal warnings for gcc [default=yes]], [], [enable_fatal_warnings=unknown]) AC_ARG_ENABLE([ansi], [ --enable-ansi force GCC to compile to ANSI/ANSI standard for older compilers. [default=no]]) AC_ARG_ENABLE([no-long-long], [ --enable-no-long-long removes no long long warning for gcc [default=yes]], [], [enable_no_long_long=yes]) AC_ARG_ENABLE([traditional-warnings], [ --enable-traditional-warnings enable traditional warnings gcc (-Wtraditional) [default=no]]) AC_ARG_ENABLE([snmp-subagent], [ --enable-snmp-subagent Compile the snmp-subagent. This is still in the development stage. [default=no]]) AC_ARG_ENABLE([dmalloc], [ --enable-dmalloc enable use of dmalloc instead of malloc in selected code [default=no]]) CC_WARNINGS="" if test "$GCC" = yes; then dnl dnl We make sure warnings are carefully scrubbed out of the output if dnl you're running on some platforms. You can enable that behavior with dnl the option "fatal-warnings", by specifying --enable-fatal-warnings. dnl Or, you can disable it with --disable-fatal-warnings. dnl dnl Horms 10th August 2001 dnl Don't do this, it seems to cause configure in dnl the libltdl/ directory to die under Debian Woody dnl I'm suspecting it will be a problem on other systems too. dnl For this reason it now defaults to off. dnl AlanR 11 August 2001 dnl Show no mercy to broken OSes and other software. If you have broken dnl software, turn this feature off. dnl NO warnings WHATSOVER will be tolerated without good reason. dnl A distribution being broken isn't a good reason. dnl The cure for that is fix the distribution, not destroy the integrity dnl of the entire project by defaulting it to "off". dnl In my experience, there are ways of making individual warnings go dnl away. dnl The only way I know to keep them out is to make them an absolute dnl pain to deal with. Otherwise they're a pain to fix. dnl This policy is not an accident, nor was it chosen without significant dnl thought and experience. dnl cc_supports_flag() { AC_MSG_CHECKING(whether $CC supports "$@") Cfile=/tmp/foo${$} touch ${Cfile}.c $CC -c "$@" ${Cfile}.c -o ${Cfile}.o >/dev/null 2>&1 rc=$? rm -f ${Cfile}.c ${Cfile}.o case $rc in 0) AC_MSG_RESULT("yes");; *) AC_MSG_RESULT("no");; esac return $rc } EXTRA_WARNINGS="" # We had to eliminate -Wnested-externs because of libtool changes WARNLIST="all missing-prototypes missing-declarations strict-prototypes pointer-arith write-strings cast-qual cast-align bad-function-cast inline missing-format-attribute format=2 format-security format-nonliteral no-long-long" for j in $WARNLIST do if cc_supports_flag -W$j then case $j in "no-long-long") if test "${enable_no_long_long}" = "yes"; then EXTRA_WARNINGS="$EXTRA_WARNINGS -W$j" fi;; *) EXTRA_WARNINGS="$EXTRA_WARNINGS -W$j";; esac fi done dnl Add any system specific options here. case "$host_os" in *linux*|*bsd*) if test "${enable_fatal_warnings}" = "unknown"; then enable_fatal_warnings=yes fi ;; *solaris*) ;; esac if test "${enable_ansi}" = yes && cc_supports_flag -std=iso9899:199409 ; then echo "Enabling ANSI Compatibility on this platform" ANSI="-ansi" fi if test "${enable_fatal_warnings}" = yes && cc_supports_flag -Werror ; then echo "Enabling Fatal Warnings (-Werror) on this platform" FATAL_WARNINGS="-Werror" fi if test "$enable_traditional_warning" = yes && \ cc_supports_flag -Wtraditional; then echo "Enabling traditional warnings" EXTRA_WARNINGS="$EXTRA_WARNINGS -Wtraditional" fi CC_WARNINGS="$EXTRA_WARNINGS $FATAL_WARNINGS $ANSI" NON_FATAL_CC_WARNINGS="$EXTRA_WARNINGS" fi AC_MSG_CHECKING(which init (rc) directory to use) INITDIR="" for initdir in /etc/init.d /etc/rc.d/init.d /sbin/init.d \ /usr/local/etc/rc.d /etc/rc.d do if test -d $initdir then INITDIR=$initdir AC_MSG_RESULT($INITDIR); break fi done AC_ARG_WITH(initdir, [ --with-initdir=DIR directroy for init (rc) scripts [${INITDIR}]], [ if test x"$withval" = xprefix; then INITDIR=${prefix}; else INITDIR="$withval"; fi ]) if test "X$INITDIR" = X then FatalMissingThing "init directory" "Could not locate init directory" fi AC_SUBST(INITDIR) dnl ********************************************************************** dnl checks for group to install fifos as dnl dnl These checks aren't right. We need to locate the lowest dnl unused group id if haclient isn't in the /etc/group file dnl and no one has overridden group-id with a --with-group-id dnl option. dnl AC_ARG_WITH( group-name, [ --with-group-name=GROUP_NAME GROUP_NAME to own API fifos. [default=haclient] ], [ HA_APIGROUP="$withval" ], [ HA_APIGROUP="haclient" ], ) AC_SUBST(HA_APIGROUP) AC_DEFINE_UNQUOTED(HA_APIGROUP, "$HA_APIGROUP", group for api fifos) if test -z "${GETENT}" -o ! -x "${GETENT}" then GETENT=getent getent() { grep "^${2}:" /etc/$1 } fi if test -z "${IP2UTIL}" -o ! -x "${IP2UTIL}" then IP2UTIL=/sbin/ip fi AC_ARG_WITH( group-id, [ --with-group-id=GROUP_ID GROUP_ID to own API fifos. [default=60] ], [ HA_APIGID="$withval" ], [ HA_APIGID=65 ], ) if getent group "$HA_APIGROUP" > /dev/null then HA_APIGID=`getent group "$HA_APIGROUP" | cut -d: -f3` fi AC_SUBST(HA_APIGID) AC_DEFINE_UNQUOTED(HA_APIGID, "$HA_APIGID", id for api group) AC_ARG_WITH( ccmuser-name, [ --with-ccmuser-name=HA_CCMUSER_NAME HA_CCMUSER_NAME to run privileged non-root things as. [default=hacluster] ], [ HA_CCMUSER="$withval" ], [ HA_CCMUSER="hacluster" ], ) AC_SUBST(HA_CCMUSER) AC_DEFINE_UNQUOTED(HA_CCMUSER, "$HA_CCMUSER", user to run privileged non-root things as) AC_ARG_WITH( ccmuser-id, [ --with-ccmuser-id=HA_HA_CCMUSER_ID USER_ID to run privileged non-root things as. [default=17] ], [ HA_CCMUID="$withval" ], [ HA_CCMUID=17 ], ) if getent passwd "$HA_CCMUSER" >/dev/null then HA_CCMUID=`getent passwd "$HA_CCMUSER" | cut -d: -f3` fi AC_SUBST(HA_CCMUID) AC_DEFINE_UNQUOTED(HA_CCMUID, "$HA_CCMUID", id for ccm user) # # Priority for starting via init startup scripts # AC_ARG_WITH( start-init-priority, [ --with-start-init-priority=number Init start priority. [default=75] ], [ HB_INITSTARTPRI="$withval" ], [ HB_INITSTARTPRI=75 ], ) AC_SUBST(HB_INITSTARTPRI) AC_DEFINE_UNQUOTED(HB_INITSTARTPRI,"$HB_INITSTARTPRI", init start priority) # # Priority for stopping via init shutdown scripts # AC_ARG_WITH( stop-init-priority, [ --with-stop-init-priority=number Init stop priority. [default=5] ], [ HB_INITSTOPPRI="$withval" ], [ HB_INITSTOPPRI=05 ], ) AC_SUBST(HB_INITSTOPPRI) AC_DEFINE_UNQUOTED(HB_INITSTOPPRI,"$HB_INITSTOPPRI", init stop priority) # # Name of UCD-SNMP development package # AC_ARG_WITH( ucd-snmp-devel, [ --with-snmp-name=name Name of ucd snmp developemnt RPM. [default=ucd-snmp-devel] ], [ UCDSNMPDEVEL=$withval ], [ UCDSNMPDEVEL=ucd-snmp-devel ], ) if test "$ac_cv_header_ucd_snmp_snmp_h" = no; then UCDSNMPDEVEL="" fi AC_SUBST(UCDSNMPDEVEL) AC_DEFINE_UNQUOTED(UCDSNMPDEVEL, $UCDSNMPDEVEL, Name of UCD SNMP development package) dnl ************************************************************************ dnl checks for library functions to replace them dnl dnl alphasort: Only on BSD. dnl System-V systems may have it, but hidden and/or deprecated. dnl A replacement function is supplied for it. dnl dnl NoSuchFunctionName: dnl is a dummy function which no system supplies. It is here to make dnl the system compile semi-correctly on OpenBSD which doesn't know dnl how to create an empty archive dnl dnl scandir: Only on BSD. dnl System-V systems may have it, but hidden and/or deprecated. dnl A replacement function is supplied for it. dnl dnl setenv: is some bsdish function that should also be avoided (use dnl putenv instead) dnl On the other hand, putenv doesn't provide the right API for the dnl code and has memory leaks designed in (sigh...) Fortunately this dnl A replacement function is supplied for it. dnl dnl setproctitle: sets the process title to a given string dnl dnl strerror: returns a string that corresponds to an errno. dnl A replacement function is supplied for it. dnl dnl unsetenv: is some bsdish function that should also be avoided (No dnl replacement) dnl A replacement function is supplied for it. dnl dnl strnlen: is a gnu function similar to strlen, but safer. dnl We wrote a tolearably-fast replacement function for it. dnl dnl strndup: is a gnu function similar to strdup, but safer. dnl We wrote a tolearably-fast replacement function for it. dnl dnl daemon: is a GNU function. The daemon() function is for programs wishing to dnl detach themselves from the controlling terminal and run in the dnl background as system daemon dnl A replacement function is supplied for it. dnl dnl Check Only dnl dnl getopt: If this is valid, define HAVE_DECL_GETOPT to make the getopt.h header compile cleanly. dnl AC_REPLACE_FUNCS(alphasort inet_pton NoSuchFunctionName scandir setenv strerror unsetenv strnlen strndup daemon) AC_CHECK_FUNCS(alphasort, AC_DEFINE(HA_HAVE_ALPHASORT, 1, [Have alphasort function])) AC_CHECK_FUNCS(inet_pton, AC_DEFINE(HA_HAVE_INET_PTON, 1, [Have inet_pton function])) AC_CHECK_FUNCS(NoSuchFunctionName) AC_CHECK_FUNCS(scandir, AC_DEFINE(HA_HAVE_SCANDIR, 1, [Have scandir function])) AC_CHECK_FUNCS(setenv, AC_DEFINE(HA_HAVE_SETENV, 1, [Have setenv function])) AC_CHECK_FUNCS(strerror, AC_DEFINE(HA_HAVE_STRERROR, 1, [Have strerror function])) AC_CHECK_FUNCS(unsetenv, AC_DEFINE(HA_HAVE_UNSETENV, 1, [Have unsetenv function])) AC_CHECK_FUNCS(strnlen, AC_DEFINE(HA_HAVE_STRNLEN, 1, [Have strnlen function])) AC_CHECK_FUNCS(strndup, AC_DEFINE(HA_HAVE_STRNDUP, 1, [Have strndup function])) AC_CHECK_FUNCS(daemon, AC_DEFINE(HA_HAVE_DAEMON, 1, [Have daemon function])) AC_CHECK_FUNCS(getopt, AC_DEFINE(HAVE_DECL_GETOPT, 1, [Have getopt function])) AC_SUBST(HA_HAVE_ALPHASORT) AC_SUBST(HA_HAVE_INET_PTON) AC_SUBST(HA_HAVE_SCANDIR) AC_SUBST(HA_HAVE_SETENV) AC_SUBST(HA_HAVE_STRERROR) AC_SUBST(HA_HAVE_UNSETENV) AC_SUBST(HA_HAVE_STRNLEN) AC_SUBST(HA_HAVE_STRNDUP) AC_SUBST(HA_HAVE_DAEMON) AC_SUBST(HAVE_DECL_GETOPT) AC_CHECK_FUNCS(fcntl) AC_CHECK_FUNCS(flock) AC_CHECK_FUNCS(inet_aton) AC_CHECK_FUNCS(mallinfo) AC_CHECK_FUNCS(__default_morecore) AC_CHECK_FUNCS(seteuid) AC_CHECK_FUNCS(setegid) AC_CHECK_FUNCS(dmalloc) AC_CHECK_FUNCS(getpeereid) AM_CONDITIONAL(USE_DMALLOC, test "$ac_cv_func_dmalloc" = "yes" -a "${enable_dmalloc}" = "yes") if test "$ac_cv_func_dmalloc" = "yes" -a "${enable_dmalloc}" = "yes"; then AC_DEFINE(USE_DMALLOC, 1, [enable use of dmalloc function]) fi; dnl ********************************************************************** dnl Check for various argv[] replacing functions on various OSs dnl dnl Borrowed from Proftpd dnl Proftpd is Licenced under the terms of the GNU General Public Licence dnl and is available from http://www.proftpd.org/ dnl AC_CHECK_FUNCS(setproctitle) AC_CHECK_HEADERS(libutil.h) AC_CHECK_LIB(util, setproctitle, [AC_DEFINE(HAVE_SETPROCTITLE,1,[ ]) ac_cv_func_setproctitle="yes" ; LIBS="$LIBS -lutil"]) if test "$ac_cv_func_setproctitle" = "yes"; then AC_DEFINE(PF_ARGV_TYPE, PF_ARGV_NONE, [ ]) else pf_argv_set="no" AC_CHECK_HEADERS(sys/pstat.h,have_pstat_h="yes",have_pstat_h="no") if test "$have_pstat_h" = "yes"; then AC_CHECK_FUNCS(pstat) if test "$ac_cv_func_pstat" = "yes"; then AC_DEFINE(PF_ARGV_TYPE, PF_ARGV_PSTAT, [ ]) else AC_DEFINE(PF_ARGV_TYPE, PF_ARGV_WRITABLE, [ ]) fi pf_argv_set="yes" fi if test "$pf_argv_set" = "no"; then AC_EGREP_HEADER([#define.*PS_STRINGS.*],sys/exec.h, have_psstrings="yes",have_psstrings="no") if test "$have_psstrings" = "yes"; then AC_DEFINE(PF_ARGV_TYPE, PF_ARGV_PSSTRINGS, [ ]) pf_argv_set="yes" fi fi if test "$pf_argv_set" = "no"; then AC_CACHE_CHECK(whether __progname and __progname_full are available, pf_cv_var_progname, AC_TRY_LINK([extern char *__progname, *__progname_full;], [__progname = "foo"; __progname_full = "foo bar";], pf_cv_var_progname="yes", pf_cv_var_progname="no")) if test "$pf_cv_var_progname" = "yes"; then AC_DEFINE(HAVE___PROGNAME,1,[ ]) fi AC_CACHE_CHECK(which argv replacement method to use, pf_cv_argv_type, AC_EGREP_CPP(yes,[ #if defined(__GNU_HURD__) yes #endif ],pf_cv_argv_type="new", pf_cv_argv_type="writeable")) if test "$pf_cv_argv_type" = "new"; then AC_DEFINE(PF_ARGV_TYPE, PF_ARGV_NEW, [ ]) pf_argv_set="yes" fi if test "$pf_argv_set" = "no"; then AC_DEFINE(PF_ARGV_TYPE, PF_ARGV_WRITEABLE, [ ]) fi fi fi dnl End of tests borrowed from Proftpd dnl check if header file and lib are there for hbaping hbaping_build="yes" AC_CHECK_HEADERS(time.h hbaapi.h, , [hbaping_build="no"],[[#if HAVE_TIME_H #include #endif]]) AC_CHECK_LIB(HBAAPI, HBA_SendScsiInquiry, , [hbaping_build="no"]) AM_CONDITIONAL(HBAAPI_BUILD, test "x${hbaping_build}" = "xyes") dnl ********************************************************************** dnl Check the size of the integer types dnl So we can have integers of known sizes as needed dnl AC_CHECK_SIZEOF(char) AC_CHECK_SIZEOF(short) AC_CHECK_SIZEOF(int) AC_CHECK_SIZEOF(long) dnl Work-around for highly annoying strict aliasing rules in dnl recent gccs if cc_supports_flag -fno-strict-aliasing then CFLAGS="$CFLAGS -fno-strict-aliasing" fi dnl dnl Lex and yacc can't be trusted to produce code that won't produce dnl warnings dnl NON_FATAL_CFLAGS="$CFLAGS $NON_FATAL_CC_WARNINGS" AC_SUBST(NON_FATAL_CFLAGS) AC_CHECK_SIZEOF(long long) dnl dnl We reset CFLAGS to include our warnings *after* all function dnl checking goes on, so that our warning flags don't keep the dnl AC_*FUNCS() calls above from working. In particular, -Werror will dnl *always* cause us troubles if we set it before here. dnl dnl CFLAGS="$CFLAGS $CC_WARNINGS" dnl NOTE: dnl This check should only be done after CFLAGS is set. Otherwise dnl linux box will complain because of a warning of the undefined dnl function sigignore(). dnl dnl In theory, all function checks should be done after the CFLAGS is dnl set since we are enforcing the -Werror. But this would have a big dnl impact on the whole source tree so I am only moving the dnl sigignore for now. A bit of a hack. dnl dnl sigignore: Only on Solaris. dnl it is a solaris replacement for signal(s,SIG_IGN). dnl AC_CHECK_FUNCS(sigignore) dnl dnl Make sure that CFLAGS is not exported. If the user did dnl not have CFLAGS in their environment then this should have dnl no effect. However if CFLAGS was exported from the user's dnl environment, then the new CFLAGS will also be exported dnl to sub processes. This causes a problem when configure dnl is run in the libltdl directory. Horms 16th July 2002 dnl if export | fgrep " CFLAGS=" > /dev/null; then export -n CFLAGS || true # We don't want to bomb out if this fails fi if test "$GCC" = yes; then CFLAGS="$CFLAGS -ggdb3" else CFLAGS="$CFLAGS -g" fi dnl AC_SUBST(CC_WARNINGS) dnl ************************************************************************ dnl pre AC_OUTPUT stuff dnl dnl th aux dir (for holding config & autogenerated stuff) dnl AC_SUBST(ac_aux_dir) dnl for libtool to work LTLIBOJS is needed (currently bug of autoconf) Xsed="sed -e s/^X//" dnl This line breaks on every single version other than the newest Suse (United Linux) dnl the following lines are marked do not change because they are used dnl to provide context to a patch which adapts this script dnl to run with automake 2.53 so, make changes outside this range of lines, dnl or make sure you fix the diff autoconf-2.53.diff file. dnl do not change this line #1! dnl do not change this line #2! dnl do not change this line #3! dnl This version is this incompatible with older versions of autoconf AC_PREREQ(2.53) LTLIBOBJS=`echo X"$LIB@&t@OBJS"|[$Xsed -e "s,\.[^.]* ,.lo ,g;s,\.[^.]*$,.lo,"]` dnl LTLIBOBJS=`echo X"$LIBOBJS"|[$Xsed -e "s,\.[^.]* ,.lo ,g;s,\.[^.]*$,.lo,"]` dnl do not change this line #4! dnl do not change this line #5! dnl do not change this line #6! AC_SUBST(LTLIBOBJS) AC_SUBST(LIBADD_DL) dnl extra flags for dynamic linking libraries AC_SUBST(LIBADD_INTL) dnl extra flags for GNU gettext stuff... AC_SUBST(LOCALE) HB_RC_DIR=$sysconfdir/ha.d/rc.d AC_SUBST(HB_RC_DIR) AC_DEFINE_UNQUOTED(HB_RC_DIR,"$HB_RC_DIR", rc directory) dnl libltdl additions AC_SUBST(INCLTDL) AC_SUBST(LIBLTDL) dnl Some scripts require options to "echo" dnl This configure is already determining and using "ac_n" and "ac_c" dnl for internal use, so make available externally. dnl (Not sure how "future proof" this is, but it at least seems clean.) dnl n. b.: having this earlier in the configure.in messed up the configure output ECHO_N="$ac_n" ECHO_C="$ac_c" case $ac_n in -n) ECHO_E="-e";; *) ECHO_E="";; esac ECHO_CMD="echo" if test -x /usr/linux/bin/echo then # This is for AIX. I'm not sure it's necessary... ECHO_CMD="/usr/linux/bin/echo" ECHO_N="-n" ECHO_E="-e" fi AC_SUBST(ECHO_N) AC_SUBST(ECHO_C) AC_SUBST(ECHO_E) AC_SUBST(ECHO_CMD) # # AIS Event Service # AC_ARG_ENABLE([eventd], [ --enable-eventd AIS Event Service daemon. [default=no] ]) if test "x${enable_eventd}" = "xyes"; then echo "Enabling the AIS Event Service code..." RPM_FILES_LIBEVT="${libdir}/libevent.*" RPM_FILES_EVT="%dir %attr (755, root, $HA_APIGROUP) ${localstatedir}/lib/$HB_PKG/evt" else if test -z "${enable_eventd}"; then enable_eventd="no" fi fi AM_CONDITIONAL(EVENTD_BUILD, test "x${enable_eventd}" = "xyes") AC_SUBST(RPM_FILES_LIBEVT) AC_SUBST(RPM_FILES_EVT) # # AIS Checkpoint Service # AC_ARG_ENABLE([checkpointd], [ --enable-checkpointd AIS Checkpoint Service daemon. [default=no] ]) if test "x${enable_checkpointd}" = "xyes"; then echo "Enabling the AIS Checkpoint Service code..." RPM_FILES_LIBCKPT="${libdir}/libckpt.*" RPM_FILES_CKPT="%dir %attr (755, root, $HA_APIGROUP) ${localstatedir}/lib/$HB_PKG/ckpt" else if test -z "${enable_checkpointd}"; then enable_checkpointd="no" fi fi AM_CONDITIONAL(CHECKPOINTD_BUILD, test "x${enable_checkpointd}" = "xyes") AC_SUBST(RPM_FILES_LIBCKPT) AC_SUBST(RPM_FILES_CKPT) # # AIS Message Service # RPM_FILES_LIBCMS="" RPM_FILES_CMS="" AC_ARG_ENABLE([cms], [ --enable-cms compile ais message service daemon(cms). [default=no] ]) if test "x${enable_cms}" = "xyes"; then enable_cms="yes" RPM_FILES_LIBCMS="${libdir}/libcms.*" RPM_FILES_CMS="%dir %attr (755, root, $HA_APIGROUP) ${localstatedir}/lib/$HB_PKG/cms" else if test -z "${enable_cms}"; then enable_cms="no" fi fi AM_CONDITIONAL(CMS_BUILD, test "x${enable_cms}" = "xyes") AC_SUBST(RPM_FILES_LIBCMS) AC_SUBST(RPM_FILES_CMS) if test x"$VERSION" \> x"1.9"; then AC_DEFINE(HAVE_NEW_HB_API, 1, [have new heartbeat api]) fi AC_ARG_ENABLE([crm], [ --enable-crm Compile the new Cluster Resource Manager. This is still in very early development stage. [default=no]]) CRM_DIR="" CRM_LIBS="" CRM_ENABLED=0 if test "${enable_crm}" = "yes"; then if test -n "$XML2CONFIG"; then CRM_DIR="crm" CRM_ENABLED=1 AC_DEFINE_UNQUOTED(WITH_CRM, 1, Use the new Cluster Resource Manager) else enable_crm="no (libxml2 not found)" fi else AC_MSG_RESULT(no); if test -z "${enable_crm}"; then enable_crm="no" fi fi echo "$as_me:$LINENO: Enabling the new Cluster Resource Manager... ${enable_crm}" >&5 echo $ECHO_N "Enabling the new Cluster Resource Manager... ${enable_crm}" >&6 AC_SUBST(CRM_ENABLED) CRM_DEBUG_LIBS="" CRM_DEBUG_OPTS="" dnl CRM_DEBUG_FLAGS=-DDMALLOC_FUNC_CHECK dnl CRM_DEBUG_LIBS=-ldmalloc dnl CRM_DEBUG_LIBS=-lefence AC_SUBST(CRM_DEBUG_LIBS) AC_SUBST(CRM_DEBUG_FLAGS) dnl AC_DEFINE_UNQUOTED(CRM_DEBUG_DMALLOC, 1, Use the dmalloc libraries) AM_CONDITIONAL(CRM_BUILD, test "x${enable_crm}" = "xyes") dnl lrm configuration AC_ARG_ENABLE([lrm], [ --enable-lrm Compile the new Cluster Resource Manager. This is still in developement stage. [default=no]]) LRM_ENABLED=0 if test "x${enable_crm}" = "xyes"; then if test "x${enable_lrm}" = "xno"; then AC_MSG_WARN([crm enabled, overriding --enable-lrm=no with --enable-lrm=yes]) elif test -z "${enable_lrm}"; then AC_MSG_WARN([crm enabled, defaulting to --enable-lrm=yes]) fi enable_lrm="yes" elif test -z "${enable_lrm}"; then enable_lrm="no" fi if test "x${enable_lrm}" = "xyes"; then LRM_ENABLED=1 fi AC_SUBST(LRM_ENABLED) AM_CONDITIONAL(LRM_BUILD, test "x${enable_lrm}" = "xyes") echo "$as_me:$LINENO: Enabling the new Local Resource Manager... ${enable_lrm}" >&5 echo $ECHO_N "Enabling the new Local Resource Manager... ${enable_lrm}" >&6 dnl ********************************************************************** dnl Scripting language bindings AC_ARG_ENABLE([swig], [ --enable-swig Provide language bindings via SWIG [default=no]]) SWIG_OPTIONS="$GLIBHEAD" SWIG_ENABLED=0 if test -z "${enable_swig}"; then enable_swig="no" fi AC_MSG_CHECKING(which swig/perl version) if test "${enable_swig}" = "yes"; then if test -z "$SWIG"; then enable_swig="no (swig not found)" AC_MSG_RESULT(swig not found) else SWIG_VERSION="`$SWIG -version 2>&1 | sed -ne 's/SWIG Version 1.3.//p'`" if test "0$SWIG_VERSION" -lt "19" 2>&1 ; then enable_swig="no (version 1.3.x, x>=19 required)" AC_MSG_RESULT(swig version 1.3.x, x>=19 required) else if perl -e "use 5.008001;" >& /dev/null; then SWIG_ENABLED=1 AC_DEFINE_UNQUOTED(WITH_SWIG, 1, SWIG bindings enabled) else enable_swig="no (invalid perl version)" fi fi fi fi echo "$as_me:$LINENO: Enabling SWIG language bindings... ${enable_swig}" >&5 echo $ECHO_N "Enabling SWIG language bindings... ${enable_swig}" >&6 AC_SUBST(SWIG_ENABLED) AC_SUBST(SWIG_OPTIONS) AM_CONDITIONAL(SWIG_BUILD, test "x${enable_swig}" = "xyes") AC_ARG_ENABLE([perl-vendor], [ --enable-perl-vendor Install the Perl bindings as vendor extensions [default=no]]) PERL_INSTALL_TARGET="install" AC_SUBST(PERL_INSTALL_TARGET) if test "${enable_swig}" = "yes"; then if test -z "${enable_perl_vendor}"; then enable_perl_vendor="no" fi if test "${enable_perl_vendor}" = "yes"; then PERL_INSTALL_TARGET="install_vendor" AC_DEFINE_UNQUOTED(WITH_PERL_VENDOR, 1, Installing Perl modules as vendor) fi echo "$as_me:$LINENO: Install Perl modules as vendor... ${enable_perl_vendor}" >&5 echo $ECHO_N "Install Perl modules as vendor... ${enable_perl_vendor}" >&6 fi dnl ********************************************************************** dnl Enable optional, experimental directories here... dnl XPERIMENTALDIRS="" AC_SUBST(XPERIMENTALDIRS) AC_CONFIG_SUBDIRS(libltdl) CheckMissingThings dnl The Makefiles and shell scripts we output AC_CONFIG_FILES(heartbeat.spec \ Makefile \ README \ cts/Makefile \ cts/CM_fs.py \ cts/CM_hb.py \ cts/CTS.py \ cts/CTSaudits.py \ cts/CTSlab.py \ cts/CTStests.py \ crm/Makefile \ crm/common/Makefile \ crm/cib/Makefile \ crm/crmd/Makefile \ crm/pengine/Makefile \ crm/tengine/Makefile \ crm/admin/Makefile \ debian/Makefile \ doc/Makefile \ doc/startstop \ contrib/Makefile \ contrib/ipfail/Makefile \ include/Makefile \ include/clplumbing/Makefile \ include/crm/Makefile \ include/lrm/Makefile \ lrm/Makefile \ lrm/lrmd/Makefile \ lrm/admin/Makefile \ lrm/test/Makefile \ include/ocf/Makefile \ include/pils/Makefile \ include/pils/plugin.h \ include/checkpointd/Makefile \ include/saf/Makefile \ include/stonith/Makefile \ replace/Makefile \ linux-ha/Makefile \ lib/Makefile \ lib/apphb/Makefile \ lib/checkpointd/Makefile \ lib/cmsclient/Makefile \ lib/clplumbing/Makefile \ lib/eventd/Makefile \ lib/hbclient/Makefile \ lib/lrm/Makefile \ lib/pils/Makefile \ lib/plugins/Makefile \ lib/bindings/Makefile \ lib/bindings/perl/Makefile \ lib/bindings/perl/Makefile.PL \ lib/bindings/perl/cl_raw/Makefile.PL \ lib/plugins/InterfaceMgr/Makefile \ lib/plugins/HBauth/Makefile \ lib/plugins/HBcomm/Makefile \ lib/plugins/lrm/Makefile \ lib/plugins/stonith/Makefile \ lib/plugins/stonith/ribcl.py \ lib/plugins/AppHBNotification/Makefile \ lib/recoverymgr/Makefile \ lib/stonith/Makefile \ heartbeat/Makefile \ heartbeat/rc.d/Makefile \ heartbeat/rc.d/ask_resources \ heartbeat/rc.d/hb_takeover \ heartbeat/init.d/Makefile \ heartbeat/init.d/heartbeat \ heartbeat/lib/Makefile \ heartbeat/lib/BasicSanityCheck \ heartbeat/lib/ha_config \ heartbeat/lib/hb_standby \ heartbeat/lib/mach_down \ heartbeat/lib/req_resource \ heartbeat/lib/ResourceManager \ heartbeat/lib/TestHeartbeatComm \ heartbeat/lib/hb_takeover \ heartbeat/resource.d/Makefile \ heartbeat/resource.d/apache \ heartbeat/resource.d/AudibleAlarm \ heartbeat/resource.d/Delay \ heartbeat/resource.d/db2 \ heartbeat/resource.d/Filesystem \ heartbeat/resource.d/ICP \ heartbeat/resource.d/IPaddr \ heartbeat/resource.d/IPaddr2 \ heartbeat/resource.d/IPsrcaddr \ heartbeat/resource.d/LinuxSCSI \ heartbeat/resource.d/LVM \ heartbeat/resource.d/LVSSyncDaemonSwap \ heartbeat/resource.d/MailTo \ heartbeat/resource.d/OCF \ heartbeat/resource.d/portblock \ heartbeat/resource.d/Raid1 \ heartbeat/resource.d/ServeRAID \ heartbeat/resource.d/SendArp \ heartbeat/resource.d/WAS \ heartbeat/resource.d/WinPopup \ heartbeat/resource.d/Xinetd \ heartbeat/shellfuncs \ heartbeat/libnet_util/Makefile \ heartbeat/logrotate.d/Makefile \ ldirectord/Makefile \ ldirectord/init.d/Makefile \ ldirectord/logrotate.d/Makefile \ membership/Makefile \ membership/ccm/Makefile \ pkg/Makefile \ pkg/InfoFiles/pkginfo \ pkg/InfoFiles/preinstall \ pkg/InfoFiles/postinstall \ snmp_subagent/Makefile \ snmp_subagent/SNMPAgentSanityCheck \ telecom/Makefile \ telecom/apphbd/Makefile \ telecom/recoverymgrd/Makefile \ telecom/checkpointd/Makefile \ telecom/eventd/Makefile \ telecom/cms/Makefile \ telecom/cms/utils/Makefile \ telecom/cms/test/Makefile \ telecom/cms/doc/Makefile ) dnl Now process the entire list of files added by previous dnl calls to AC_CONFIG_FILES() AC_OUTPUT() dnl subpackages configuration - perhaps configure it properly some other time dnl when it has been discussed at linux-ha-dev dnl AC_CONFIG_SUBDIRS(stonith heartbeat) dnl ***************** dnl Configure summary dnl ***************** eval my_datadir="`eval echo ${datadir}`" eval my_includedir="`eval echo ${includedir}`" eval my_initdir="${INITDIR}" eval my_libdir="`eval echo ${libdir}`" eval my_localstatedir="`eval echo ${localstatedir}`" eval my_mandir="`eval echo ${mandir}`" eval my_sbindir="`eval echo ${sbindir}`" eval my_sysconfdir="`eval echo ${sysconfdir}`" AC_MSG_RESULT([]) AC_MSG_RESULT([$PACKAGE configuration:]) AC_MSG_RESULT([ Version = "$VERSION"]) AC_MSG_RESULT([ Executables = "$my_sbindir"]) AC_MSG_RESULT([ Man pages = "$my_mandir"]) AC_MSG_RESULT([ Libraries = "$my_libdir"]) AC_MSG_RESULT([ Header files = "$my_includedir"]) AC_MSG_RESULT([ Data files = "$my_datadir"]) AC_MSG_RESULT([ State information = "$my_localstatedir"]) AC_MSG_RESULT([ System configuration = "$my_sysconfdir"]) AC_MSG_RESULT([ Init (rc) scripts = "$my_initdir"]) AC_MSG_RESULT([ API fifo group name = "${HA_APIGROUP}"]) AC_MSG_RESULT([ API fifo group id = "${HA_APIGID}"]) AC_MSG_RESULT([ HA client user name = "${HA_CCMUSER}"]) AC_MSG_RESULT([ HA client user id = "${HA_CCMUID}"]) AC_MSG_RESULT([ Build snmp subagent = "${enable_snmp_subagent}"]) if test "x${enable_snmp_subagent}" = "xyes"; then AC_MSG_RESULT([ SNMP MIB directory = "${MIBS_DIR}"]) AC_MSG_RESULT([ SNMP agent libraries = "${SNMPAGENTLIB}"]) fi AC_MSG_RESULT([ SNMP libraries = "${SNMPLIB}"]) AC_MSG_RESULT([ ucd_snmp_devel name = "${UCDSNMPDEVEL}"]) AC_MSG_RESULT([ Build New CRM = "${enable_crm}"]) AC_MSG_RESULT([ Build New LRM = "${enable_lrm}"]) AC_MSG_RESULT([ Build SWIG bindings = "${enable_swig}"]) AC_MSG_RESULT([ Build Eventd = "${enable_eventd}"]) AC_MSG_RESULT([ Build Checkpointd = "${enable_checkpointd}"]) AC_MSG_RESULT([ Build cms = "${enable_cms}"]) AC_MSG_RESULT([ CC_WARNINGS = "${CC_WARNINGS}"]) AC_MSG_RESULT([ Mangled CFLAGS = "${CFLAGS}"])