public inbox for cluster-cvs@sourceware.org
help / color / mirror / Atom feed
* fence-agents: master - build: convert to autoconf/automake/libtool
@ 2009-06-23 19:24 Fabio M. Di Nitto
  0 siblings, 0 replies; only message in thread
From: Fabio M. Di Nitto @ 2009-06-23 19:24 UTC (permalink / raw)
  To: cluster-cvs-relay

Gitweb:        http://git.fedorahosted.org/git/fence-agents.git?p=fence-agents.git;a=commitdiff;h=3032b147adf617ee204e4c837aeeed18e163969b
Commit:        3032b147adf617ee204e4c837aeeed18e163969b
Parent:        30f8c3188aee00402161ba657e7916e5ca88ebbf
Author:        Fabio M. Di Nitto <fdinitto@redhat.com>
AuthorDate:    Tue Jun 23 21:19:45 2009 +0200
Committer:     Fabio M. Di Nitto <fdinitto@redhat.com>
CommitterDate: Tue Jun 23 21:19:45 2009 +0200

build: convert to autoconf/automake/libtool

requires:
 - autoconf  2.63b
 - automake  1.11
 - libtool   2.2.7a
 - pkgconfig 0.23
 - m4        1.4.13

Signed-off-by: Fabio M. Di Nitto <fdinitto@redhat.com>
---
 .gitignore                                   |   81 ++++-
 Makefile                                     |   47 ---
 Makefile.am                                  |   28 ++
 autogen.sh                                   |    4 +
 configure                                    |  428 --------------------------
 configure.ac                                 |  279 +++++++++++++++++
 doc/Makefile                                 |   16 -
 doc/Makefile.am                              |   10 +
 fence/Makefile                               |    4 -
 fence/Makefile.am                            |    3 +
 fence/agents/Makefile                        |    4 -
 fence/agents/Makefile.am                     |   37 +++
 fence/agents/alom/Makefile                   |    5 -
 fence/agents/alom/Makefile.am                |   12 +
 fence/agents/apc/Makefile                    |    5 -
 fence/agents/apc/Makefile.am                 |   12 +
 fence/agents/apc_snmp/Makefile               |    4 -
 fence/agents/apc_snmp/Makefile.am            |   14 +
 fence/agents/baytech/Makefile                |    4 -
 fence/agents/baytech/Makefile.am             |   12 +
 fence/agents/bladecenter/Makefile            |    5 -
 fence/agents/bladecenter/Makefile.am         |   12 +
 fence/agents/brocade/Makefile                |    4 -
 fence/agents/brocade/Makefile.am             |   12 +
 fence/agents/bullpap/Makefile                |    4 -
 fence/agents/bullpap/Makefile.am             |   12 +
 fence/agents/cisco_mds/Makefile              |    5 -
 fence/agents/cisco_mds/Makefile.am           |   12 +
 fence/agents/cpint/Makefile                  |    4 -
 fence/agents/cpint/Makefile.am               |   12 +
 fence/agents/drac/Makefile                   |    5 -
 fence/agents/drac/Makefile.am                |   12 +
 fence/agents/egenera/Makefile                |    4 -
 fence/agents/egenera/Makefile.am             |   12 +
 fence/agents/eps/Makefile                    |    5 -
 fence/agents/eps/Makefile.am                 |   12 +
 fence/agents/ibmblade/Makefile               |    4 -
 fence/agents/ibmblade/Makefile.am            |   12 +
 fence/agents/ifmib/Makefile                  |    5 -
 fence/agents/ifmib/Makefile.am               |   12 +
 fence/agents/ilo/Makefile                    |    5 -
 fence/agents/ilo/Makefile.am                 |   12 +
 fence/agents/intelmodular/Makefile           |    4 -
 fence/agents/intelmodular/Makefile.am        |   12 +
 fence/agents/ipmilan/Makefile                |   25 --
 fence/agents/ipmilan/Makefile.am             |    7 +
 fence/agents/ipmilan/expect.c                |    1 +
 fence/agents/ipmilan/ipmilan.c               |    5 +-
 fence/agents/ldom/Makefile                   |    5 -
 fence/agents/ldom/Makefile.am                |   12 +
 fence/agents/lib/Makefile                    |    7 -
 fence/agents/lib/Makefile.am                 |   14 +
 fence/agents/lpar/Makefile                   |    5 -
 fence/agents/lpar/Makefile.am                |   12 +
 fence/agents/manual/Makefile                 |   19 --
 fence/agents/manual/Makefile.am              |    7 +
 fence/agents/manual/fence_ack_manual         |   37 +++
 fence/agents/manual/fence_ack_manual.sh      |   37 ---
 fence/agents/mcdata/Makefile                 |    4 -
 fence/agents/mcdata/Makefile.am              |   12 +
 fence/agents/nss_wrapper/Makefile            |   26 --
 fence/agents/nss_wrapper/Makefile.am         |    7 +
 fence/agents/nss_wrapper/fence_nss_wrapper.c |    2 +
 fence/agents/rackswitch/Makefile             |   24 --
 fence/agents/rackswitch/Makefile.am          |    7 +
 fence/agents/rackswitch/do_rack.c            |    4 +-
 fence/agents/rsa/Makefile                    |    4 -
 fence/agents/rsa/Makefile.am                 |   12 +
 fence/agents/rsb/Makefile                    |    4 -
 fence/agents/rsb/Makefile.am                 |   12 +
 fence/agents/sanbox2/Makefile                |    4 -
 fence/agents/sanbox2/Makefile.am             |   12 +
 fence/agents/scsi/Makefile                   |    7 -
 fence/agents/scsi/Makefile.am                |   12 +
 fence/agents/virsh/Makefile                  |    5 -
 fence/agents/virsh/Makefile.am               |   12 +
 fence/agents/vixel/Makefile                  |    4 -
 fence/agents/vixel/Makefile.am               |   12 +
 fence/agents/vmware/Makefile                 |    5 -
 fence/agents/vmware/Makefile.am              |   12 +
 fence/agents/wti/Makefile                    |    5 -
 fence/agents/wti/Makefile.am                 |   12 +
 fence/agents/xcat/Makefile                   |    4 -
 fence/agents/xcat/Makefile.am                |   12 +
 fence/agents/xvm/Makefile                    |   66 ----
 fence/agents/xvm/Makefile.am                 |   69 ++++
 fence/agents/xvm/debug.c                     |    2 +
 fence/agents/xvm/fence_xvm.c                 |    4 +-
 fence/agents/xvm/fence_xvmd.c                |   10 +-
 fence/agents/xvm/ip_lookup.c                 |    2 +
 fence/agents/xvm/mcast.c                     |    2 +
 fence/agents/xvm/options-ccs.c               |    2 +
 fence/agents/xvm/options.c                   |    2 +
 fence/agents/xvm/simple_auth.c               |    2 +
 fence/agents/xvm/tcp.c                       |    2 +
 fence/agents/xvm/virt.c                      |    2 +
 fence/agents/xvm/vm_states.c                 |    2 +
 fence/agents/xvm/xml.c                       |    6 +
 fence/agents/zvm/Makefile                    |    4 -
 fence/agents/zvm/Makefile.am                 |   12 +
 fence/man/Makefile                           |   37 ---
 fence/man/Makefile.am                        |   36 +++
 make/clean.mk                                |    7 -
 make/cobj.mk                                 |    6 -
 make/defines.mk.input                        |   49 ---
 make/fencebuild.mk                           |   30 +--
 make/install.mk                              |   31 --
 make/man.mk                                  |   18 -
 make/passthrough.mk                          |    7 -
 make/uninstall.mk                            |   16 -
 scripts/uninstall.pl                         |   71 -----
 111 files changed, 1015 insertions(+), 1118 deletions(-)

diff --git a/.gitignore b/.gitignore
index 4ca135d..d5dadff 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,14 +1,69 @@
-make/defines.mk
-.configure.sh
-*.d
+*.swp
+Makefile.in
+aclocal.m4
+autoconf
+autoheader
+autom4te.cache
+automake
+compile
+configure
+config.guess
+config.log
+config.sub
+config.status
+Makefile
+depcomp
+install-sh
+libtoolize
+ltmain.sh
+libtool
+make/stamp-h1
+m4
+make/clusterautoconfig.h*
+missing
+*.pc
+.deps
+.libs
 *.o
-*.a
-*.so*
-*.lcrso
-*.po
-.*.*o.cmd
-.tmp_versions
-*.ko
-Module.symvers
-modules.order
-*.mod.c
+*.la
+*.lo
+fence/agents/alom/fence_alom
+fence/agents/apc/fence_apc
+fence/agents/apc_snmp/fence_apc_snmp
+fence/agents/baytech/fence_baytech
+fence/agents/bladecenter/fence_bladecenter
+fence/agents/brocade/fence_brocade
+fence/agents/bullpap/fence_bullpap
+fence/agents/cisco_mds/fence_cisco_mds
+fence/agents/cpint/fence_cpint
+fence/agents/drac/fence_drac
+fence/agents/drac/fence_drac5
+fence/agents/egenera/fence_egenera
+fence/agents/eps/fence_eps
+fence/agents/ibmblade/fence_ibmblade
+fence/agents/ifmib/fence_ifmib
+fence/agents/ilo/fence_ilo
+fence/agents/intelmodular/fence_intelmodular
+fence/agents/ipmilan/fence_ipmilan
+fence/agents/ldom/fence_ldom
+fence/agents/lib/fencing.py
+fence/agents/lib/fencing_snmp.py
+fence/agents/lpar/fence_lpar
+fence/agents/mcdata/fence_mcdata
+fence/agents/nss_wrapper/fence_nss_wrapper
+fence/agents/rackswitch/fence_rackswitch
+fence/agents/rsa/fence_rsa
+fence/agents/rsb/fence_rsb
+fence/agents/sanbox2/fence_sanbox2
+fence/agents/scsi/fence_scsi
+fence/agents/scsi/fence_scsi_test
+fence/agents/virsh/fence_virsh
+fence/agents/vixel/fence_vixel
+fence/agents/vmware/fence_vmware
+fence/agents/vmware/fence_vmware_helper
+fence/agents/wti/fence_wti
+fence/agents/xcat/fence_xcat
+fence/agents/xvm/fence_xvm
+fence/agents/xvm/fence_xvmd
+fence/agents/xvm/testprog
+fence/agents/zvm/fence_zvm
diff --git a/Makefile b/Makefile
deleted file mode 100644
index 389f9a1..0000000
--- a/Makefile
+++ /dev/null
@@ -1,47 +0,0 @@
-include make/defines.mk
-
-
-REALSUBDIRS = fence doc
-
-SUBDIRS = $(REALSUBDIRS)
-
-all: ${SUBDIRS}
-
-${SUBDIRS}:
-	[ -n "${without_$@}" ] || ${MAKE} -C $@ all
-
-fence:
-
-oldconfig:
-	@if [ -f $(OBJDIR)/.configure.sh ]; then \
-		sh $(OBJDIR)/.configure.sh; \
-	else \
-		echo "Unable to find old configuration data"; \
-	fi
-
-install:
-	set -e && for i in ${SUBDIRS}; do ${MAKE} -C $$i $@; done
-	install -d ${logdir}
-	install -d ${DESTDIR}/var/lib/cluster
-	install -d ${DESTDIR}/var/run/cluster
-
-uninstall:
-	set -e && for i in ${SUBDIRS}; do ${MAKE} -C $$i $@; done
-	rmdir ${logdir} || :;
-	rmdir ${DESTDIR}/var/lib/cluster || :;
-	rmdir ${DESTDIR}/var/run/cluster || :;
-
-clean:
-	set -e && for i in ${REALSUBDIRS}; do \
-		contrib_code=1 \
-		legacy_code=1 \
-		${MAKE} -C $$i $@;\
-	done
-
-distclean: clean
-	rm -f make/defines.mk
-	rm -f .configure.sh
-	rm -f *tar.gz
-	rm -rf build
-
-.PHONY: ${REALSUBDIRS}
diff --git a/Makefile.am b/Makefile.am
new file mode 100644
index 0000000..583ff0e
--- /dev/null
+++ b/Makefile.am
@@ -0,0 +1,28 @@
+EXTRA_DIST		= autogen.sh make/fencebuild.mk scripts/fenceparse
+
+AUTOMAKE_OPTIONS	= foreign
+
+MAINTAINERCLEANFILES	= Makefile.in aclocal.m4 configure depcomp \
+			  config.guess config.sub missing install-sh \
+			  autoheader automake autoconf libtool libtoolize \
+			  ltmain.sh compile make/clusterautoconfig.h.in \
+			  make/clusterautoconfig.h.in~
+
+noinst_HEADERS		= make/copyright.cf
+
+ACLOCAL_AMFLAGS		= -I m4
+
+SUBDIRS			= fence doc
+
+install-exec-local:
+			$(INSTALL) -d $(DESTDIR)/$(LOGDIR)
+			$(INSTALL) -d $(DESTDIR)/$(CLUSTERVARRUN)
+			$(INSTALL) -d $(DESTDIR)/$(CLUSTERVARLIB)
+
+uninstall-local:
+			rmdir $(DESTDIR)/$(LOGDIR) || :;
+			rmdir $(DESTDIR)/$(CLUSTERVARRUN) || :;
+			rmdir $(DESTDIR)/$(CLUSTERVARLIB) || :;
+
+maintainer-clean-local:
+	rm -rf m4
diff --git a/autogen.sh b/autogen.sh
new file mode 100755
index 0000000..3c5e1d9
--- /dev/null
+++ b/autogen.sh
@@ -0,0 +1,4 @@
+#!/bin/sh
+# Run this to generate all the initial makefiles, etc.
+mkdir -p m4
+autoreconf -i -v && echo Now run ./configure and make
diff --git a/configure b/configure
deleted file mode 100755
index 6681a3c..0000000
--- a/configure
+++ /dev/null
@@ -1,428 +0,0 @@
-#!/usr/bin/perl -w
-
-use warnings;
-use Getopt::Long;
-use Cwd 'abs_path';
-use File::Basename;
-
-print "\nConfiguring Makefiles for your system...\n";
-
-# Set a bunch of variables
-
-my @invoke = @ARGV;
-
-my $ret = 0;
-
-my %options = (
-	help => \$help,
-	cc => \$cc,
-	debug => \$debug,
-	cflags => \$cflags,
-	extracflags => \$extracflags,
-	ldflags => \$ldflags,
-	extraldflags => \$extraldflags,
-	objdir => \$objdir,
-        incdir => \$incdir,
-	libdir => \$libdir,
-        ccsincdir => \$ccsincdir,
-	ccslibdir => \$ccslibdir,
-	cmanincdir => \$cmanincdir,
-	cmanlibdir => \$cmanlibdir,
-	logtincdir => \$logtincdir,
-	logtlibdir => \$logtlibdir,
-	openaisincdir => \$openaisincdir,
-	openaislibdir => \$openaislibdir,
-	virtincdir => \$virtincdir,
-	virtlibdir => \$virtlibdir,
-	nssincdir => \$nssincdir,
-	nsslibdir => \$nsslibdir,
-	nsprincdir => \$nsprincdir,
-	nsprlibdir => \$nsprlibdir,
-	mandir  => \$mandir,
-	prefix => \$prefix,
-	sbindir => \$sbindir,
-	initddir => \$initddir,
-	docdir => \$docdir,
-	logdir => \$logdir,
-	syslogfacility => \$syslogfacility,
-	sysloglevel => \$sysloglevel,
-	snmpbin => \$snmpbin,
-	confdir => \$confdir,
-	fence_agents => \$fence_agents,
-	fenceagentslibdir => \$fenceagentslibdir,
-	enable_crack_of_the_day => \$enable_crack_of_the_day,
-	enable_legacy_code => \$enable_legacy_code,
-	release_version => \$release_version,
-);
-
-my $err = &GetOptions (\%options,
-		    'help',
-		    'cc=s',
-		    'debug',
-		    'cflags=s',
-		    'extracflags=s',
-		    'ldflags=s',
-		    'extraldflags=s',
-		    'objdir=s',
-		    'incdir=s',
-		    'libdir=s',
-		    'ccsincdir=s',
-		    'ccslibdir=s',
-		    'cmanincdir=s',
-		    'cmanlibdir=s',
-		    'logtincdir=s',
-		    'logtlibdir=s',
-		    'openaisincdir=s',
-		    'openaislibdir=s',
-		    'virtincdir=s',
-		    'virtlibdir=s',
-		    'nssincdir=s',
-		    'nsslibdir=s',
-		    'nsprincdir=s',
-		    'nsprlibdir=s',
-		    'mandir=s',
-		    'prefix=s',
-		    'sbindir=s',
-		    'initddir=s',
-		    'docdir=s',
-		    'logdir=s',
-		    'syslogfacility=s',
-		    'sysloglevel=s',
-		    'snmpbin=s',
-		    'confdir=s',
-		    'release_version=s',
-		    'fence_agents=s',
-		    'fenceagentslibdir=s',
-		    'enable_crack_of_the_day',
-		    'enable_legacy_code');
-
-if(!$err) {
-  $ret = 1;
-  print "*** ERROR: Invalid option detected ***\n";
-}
-
-# Check for the --help flag
-if ($help || !$err) {
-  $_ = $0;
-  s/.*\.\/(.*)/$1/;
-  print "Usage: $_ [flags]\n";
-  print "--help\t\tPrints this usage information\n\n";
-  print "install flags:\n";
-  print "--prefix=\tthe base directory to install into.  (Default: /usr)\n";
-  print "--sbindir=\tthe base directory for system binaries.  (Default: {prefix}/sbin)\n";
-  print "--initddir=\tthe base directory for init.d scripts.  (Default: /etc/init.d)\n";
-  print "--libdir=\tthe base directory for libraries.  (Default: {prefix}/lib)\n";
-  print "--docdir=\tthe base directory for misc cluster documentation files.  (Default: {prefix}/share/doc/cluster)\n";
-  print "--logdir=\tthe base directory for cluster logging files.  (Default: /var/log/cluster/)\n";
-  print "--syslogfacility=\tset the default syslog facility.  (Default: LOG_LOCAL4)\n";
-  print "--sysloglevel=\tset the default syslog level.  (Default: LOG_INFO)\n";
-  print "--snmpbin=\tthe base directory for snmp binaries (Ex: /usr/bin/snmpwalk).  (Default: {prefix}/bin)\n";
-  print "--confdir=\tthe cluster config directory.  (Default: /etc/cluster)\n";
-  print "--mandir=\tthe base directory for man pages.  (Default: {prefix}/share/man)\n";
-  print "\nbuild flags:\n";
-  print "--cc=\t\tcompiler to use.  (Default: gcc)\n";
-  print "--debug\t\tEnable debugging build. Changes default CFLAGS to -Wall -O0 -DDEBUG -g.\n";
-  print "--cflags=\toverride default CFLAGS settings.  (Default: -Wall -O2 -g)\n";
-  print "--extracflags=\tadd extra compiler options to default CFLAGS setting.  (Default: none)\n";
-  print "--ldflags=\toverride default LDFLAGS settings.  (Default: none)\n";
-  print "--extraldflags=\tadd extra linking options to default LDFLAGS settings.  (Default: none)\n";
-  print "--objdir=\tspecify directory where to store object files.  (Defaults: current build dir)\n";
-  print "--incdir=\tthe base directory for include files.  (Default: {prefix}/include)\n";
-  print "--ccsincdir=\tthe base directory for ccs include files.  (Default: ./config/libs/libccsconfdb)\n";
-  print "--ccslibdir=\tthe base directory for ccs libraries.  (Default: ./config/libs/libccsconfdb)\n";
-  print "--cmanincdir=\tthe base directory for cman include files.  (Default: ./cman/lib)\n";
-  print "--cmanlibdir=\tthe base directory for cman libraries.  (Default: ./cman/lib)\n";
-  print "--logtincdir=\tthe base directory for logthread include files.  (Default: ./common/liblogthread)\n";
-  print "--logtlibdir=\tthe base directory for logthread libraries.  (Default: ./common/liblogthread)\n";
-  print "--openaisincdir=\tthe base directory for openais include files.  (Default: {incdir})\n";
-  print "--openaislibdir=\tthe base directory for openais libraries.  (Default: {libdir}/openais)\n";
-  print "--nssincdir=\tthe base directory for libnss include files.  (Default: {incdir}/nss3)\n";
-  print "--nsslibdir=\tthe base directory for libnss libraries.  (Default: {libdir})\n";
-  print "--nsprincdir=\tthe base directory for libnspr include files.  (Default: {incdir}/nspr4)\n";
-  print "--nsprlibdir=\tthe base directory for libnspr libraries.  (Default: {libdir})\n";
-  print "--virtincdir=\tthe base directory for libvirt include files.  (Default: {incdir}/libvirt)\n";
-  print "--virtlibdir=\tthe base directory for libvirt libraries.  (Default: {libdir})\n";
-  print "--fence_agents=\tlist of fence agents to configure.  (Default: all)\n";
-  print "\t\tUse --fence_agents=help for a list\n";
-  print "--fenceagentslibdir=\tspecify directory where to install common fence python lib.  (Default: {prefix}/share/fence)\n";
-  print "--enable_crack_of_the_day\tEnable build of highly experimental features that rely on code that is not yet available for general use. (Default: no)\n";
-  print "--enable_legacy_code\tEnable build of old/obsolete/unsupported code/tools.  (Default: no)\n";
-  exit $ret;
-}
-
-sub symlinks {
-  my $dir = shift;
-  my $pattern = shift;
-  @args = "find $dir -type f -name $pattern";
-  open (IFILE, "@args |");
-  while (<IFILE>) {
-    chomp;
-    s|\./||g;
-    s|.*make\/defines.mk||g;
-    $dirname = dirname($_);
-    $filename = basename($_);
-    system("mkdir -p $objdir/$dirname");
-    symlink("${cdir}/$_","$objdir/$dirname/$filename");
-  }
-  close IFILE;
-  return 0;
-}
-
-$pwd = `pwd`;
-chomp($pwd);
-
-if (!$cc) {
-  $cc="gcc";
-}
-if (!$cflags) {
-  $cflags="-Wall -Wformat=2 -MMD";
-  if (!$debug) {
-    $cflags="${cflags} -O2";
-  } else {
-    $cflags="${cflags} -O0 -DDEBUG";
-  }
-  $cflags="${cflags} -g";
-}
-if ($extracflags) {
-  $cflags="${cflags} ${extracflags}";
-}
-if (!$ldflags) {
-  $ldflags="";
-}
-if ($extraldflags) {
-  $ldflags="${ldflags} ${extraldflags}";
-}
-if (!$prefix) {
-  $prefix="/usr";
-}
-
-print "\nChecking tree: ";
-if (!$objdir) {
-  $objdir="${pwd}";
-}
-$objdir = abs_path( $objdir );
-$cdir = dirname ( abs_path( $0 ) );
-unless ("$cdir" eq "$objdir") {
-  chdir "$cdir";
-}
-
-if (! -d "$objdir/make") {
-  print "setting up $objdir\n";
-  mkdir "$objdir";
-  symlinks(".","Makefile");
-  symlinks(".","*.mk");
-} else {
-  print "nothing to do\n";
-}
-
-if (!$incdir) {
-  $incdir="${prefix}/include";
-}
-if (!$libdir) {
-  $libdir="${prefix}/lib";
-}
-if (!$ccsincdir) {
-  $ccsincdir="${incdir}";
-}
-if (!$ccslibdir) {
-  $ccslibdir="${libdir}";
-}
-if (!$cmanincdir) {
-  $cmanincdir="${incdir}";
-}
-if (!$cmanlibdir) {
-  $cmanlibdir="${libdir}";
-}
-if (!$logtincdir) {
-  $logtincdir="${incdir}";
-}
-if (!$logtlibdir) {
-  $logtlibdir="${libdir}";
-}
-if (!$openaisincdir) {
-  $openaisincdir="${incdir}";
-}
-if (!$openaislibdir) {
-  $openaislibdir="${libdir}/openais";
-}
-if (!$nssincdir) {
-  $nssincdir="${incdir}/nss3";
-}
-if (!$nsslibdir) {
-  $nsslibdir="${libdir}";
-}
-if (!$nsprincdir) {
-  $nsprincdir="${incdir}/nspr4";
-}
-if (!$nsprlibdir) {
-  $nsprlibdir="${libdir}";
-}
-if (!$virtincdir) {
-  $virtincdir="${incdir}/libvirt";
-}
-if (!$virtlibdir) {
-  $virtlibdir="${libdir}";
-}
-if (!$mandir) {
-  $mandir="${prefix}/share/man";
-}
-if (!$sbindir) {
-  $sbindir="${prefix}/sbin";
-}
-if (!$initddir) {
-  $initddir="/etc/init.d";
-}
-if (!$docdir) {
-  $docdir="${prefix}/share/doc/cluster";
-}
-if (!$logdir) {
-  $logdir="/var/log/cluster";
-}
-if (!$syslogfacility) {
-  $syslogfacility="LOG_LOCAL4";
-}
-if (!$sysloglevel) {
-  $sysloglevel="LOG_INFO";
-}
-if (!$snmpbin) {
-  $snmpbin="${prefix}/bin";
-}
-if (!$confdir) {
-  $confdir="/etc/cluster";
-}
-if (!$fence_agents) {
-  $fence_agents="all";
-}
-if (!$fenceagentslibdir) {
-  $fenceagentslibdir="${prefix}/share/fence";
-}
-if (!$enable_crack_of_the_day) {
-  $enable_crack_of_the_day="";
-} else {
-  print "\n********************************************************************************************\n";
-  print "WARNING: *you* have explicitly enabled all possible experimental features under development!\n";
-  print "         This code will have no mercy for your data and your machines. You have been warned!\n";
-  print "\n********************************************************************************************\n";
-  $cflags="${cflags} -DEXPERIMENTAL_BUILD";
-}
-if (!$enable_legacy_code) {
-  $enable_legacy_code="";
-} else {
-  print "\n********************************************************************************************\n";
-  print "WARNING: *you* have explicitly enabled the build of old/obsoleted/unsupported code/tools\n";
-  print "         This code is provided *only* for backward compatibility\n";
-  print "\n********************************************************************************************\n";
-  $cflags="${cflags} -DLEGACY_CODE";
-}
-if (defined($release_version) && not length $release_version) {
-  $release_version="";
-}
-
-if ((!$fence_agents) || ($fence_agents eq "all") || ($fence_agents eq "help")) {
-  @args = "find fence/agents -mindepth 2 -maxdepth 2 -name Makefile -printf '%h'";
-  open (IFILE, "@args |");
-  while (<IFILE>) {
-    chomp;
-    s|fence\/agents\/| |g;
-    s|lib ||g;
-    s|nss_wrapper ||g;
-    $all_fence = $_;
-  }
-  close IFILE;
-}
-
-if ($fence_agents eq "help") {
-  print "Available fence agents:\n$all_fence\n";
-  exit 0;
-}
-
-if ((!$fence_agents) || ($fence_agents eq "all")) {
-  print "\nThe following fence agents will be build on this system:\n$all_fence\n";
-  $fence_agents = $all_fence
-}
-
-open IFILE, "<make/defines.mk.input" or die "Can't redirect stdin";
-open OFILE, ">${objdir}/make/defines.mk" or die "Can't redirect stdout";
-
-print OFILE "# This file was generated by configure from defines.mk.input\n";
-
-while (<IFILE>) {
-  chomp;
-  $_ =~ s/\@SRCDIR\@/$cdir/;
-  $_ =~ s/\@CC\@/$cc/;
-  $_ =~ s/\@CFLAGS\@/$cflags/;
-  $_ =~ s/\@LDFLAGS\@/$ldflags/;
-  $_ =~ s/\@OBJDIR\@/$objdir/;
-  $_ =~ s/\@INCDIR\@/$incdir/;
-  $_ =~ s/\@LIBDIR\@/$libdir/;
-  $_ =~ s/\@CCSINCDIR\@/$ccsincdir/;
-  $_ =~ s/\@CCSLIBDIR\@/$ccslibdir/;
-  $_ =~ s/\@CMANINCDIR\@/$cmanincdir/;
-  $_ =~ s/\@CMANLIBDIR\@/$cmanlibdir/;
-  $_ =~ s/\@LOGTINCDIR\@/$logtincdir/;
-  $_ =~ s/\@LOGTLIBDIR\@/$logtlibdir/;
-  $_ =~ s/\@OPENAISINCDIR\@/$openaisincdir/;
-  $_ =~ s/\@OPENAISLIBDIR\@/$openaislibdir/;
-  $_ =~ s/\@NSSINCDIR\@/$nssincdir/;
-  $_ =~ s/\@NSSLIBDIR\@/$nsslibdir/;
-  $_ =~ s/\@NSPRINCDIR\@/$nsprincdir/;
-  $_ =~ s/\@NSPRLIBDIR\@/$nsprlibdir/;
-  $_ =~ s/\@VIRTINCDIR\@/$virtincdir/;
-  $_ =~ s/\@VIRTLIBDIR\@/$virtlibdir/;
-  $_ =~ s/\@MANDIR\@/$mandir/;
-  $_ =~ s/\@SBINDIR\@/$sbindir/;
-  $_ =~ s/\@INITDDIR\@/$initddir/;
-  $_ =~ s/\@CONFDIR\@/$confdir/;
-  $_ =~ s/\@DOCDIR\@/$docdir/;
-  $_ =~ s/\@LOGDIR\@/$logdir/;
-  $_ =~ s/\@SYSLOGFACILITY\@/$syslogfacility/;
-  $_ =~ s/\@SYSLOGLEVEL\@/$sysloglevel/;
-  $_ =~ s/\@SNMPBIN\@/$snmpbin/;
-  $_ =~ s/\@FENCE_AGENTS\@/$fence_agents/;
-  $_ =~ s/\@FENCEAGENTSLIBDIR\@/$fenceagentslibdir/;
-  $_ =~ s/\@ENABLE_CRACK_OF_THE_DAY\@/$enable_crack_of_the_day/;
-  $_ =~ s/\@ENABLE_LEGACY_CODE\@/$enable_legacy_code/;
-
-  print OFILE "$_\n";
-}
-
-close IFILE;
-
-if (not defined($release_version)) {
-
-  my $current_version;
-  if ( -f 'make/official_release_version' ) {
-    open OFFICIAL_VERSION, '<', "make/official_release_version";
-    while (<OFFICIAL_VERSION>) {
-      if ($_ =~ /VERSION/) {
-	$current_version = $_;
-      }
-    }
-    close OFFICIAL_VERSION;
-  }
-
-  if (not defined($release_version)) {
-    if (not defined($current_version)) {
-      $release_version = `date +%s`;
-      chomp $release_version;
-    } else {
-      $release_version = $current_version;
-      $release_version =~ s/.*"(.*)"\n/$1/;
-    }
-  }
-}
-
-print OFILE "RELEASE_VERSION = $release_version\n";
-print OFILE "CFLAGS += -DRELEASE_VERSION=\\\"$release_version\\\"\n";
-
-close OFILE;
-
-open OFILE, ">${objdir}/.configure.sh.tmp" or die "Can't redirect stdout";
-print OFILE "#!/bin/bash\n";
-print OFILE "$0 @invoke \$@\n";
-print OFILE "exit \$?\n";
-close OFILE;
-
-system("mv ${objdir}/.configure.sh.tmp ${objdir}/.configure.sh");
-
-print "Completed Makefile configuration\n\n";
diff --git a/configure.ac b/configure.ac
new file mode 100644
index 0000000..d143056
--- /dev/null
+++ b/configure.ac
@@ -0,0 +1,279 @@
+
+# Process this file with autoconf to produce a configure script.
+
+AC_PREREQ([2.63b])
+AC_INIT([fence-agents], [master], [linux-cluster@redhat.com])
+AM_INIT_AUTOMAKE([-Wno-portability])
+LT_PREREQ([2.2.7])
+LT_INIT
+
+AC_CONFIG_MACRO_DIR([m4])
+AC_CONFIG_SRCDIR([fence/agents/rackswitch/do_rack.h])
+AC_CONFIG_HEADERS([make/clusterautoconfig.h])
+
+AC_CANONICAL_HOST
+AC_PROG_LIBTOOL
+
+AC_LANG([C])
+
+# Sanitize path
+
+if test "$prefix" = "NONE"; then
+	prefix="/usr"
+	if test "$localstatedir" = "\${prefix}/var"; then
+		localstatedir="/var"
+	fi
+	if test "$sysconfdir" = "\${prefix}/etc"; then
+		sysconfdir="/etc"
+	fi
+	if test "$libdir" = "\${exec_prefix}/lib"; then
+		if test -e /usr/lib64; then
+			libdir="/usr/lib64"
+		else
+			libdir="/usr/lib"
+		fi
+	fi
+fi
+
+case $exec_prefix in
+  NONE)   exec_prefix=$prefix;;
+  prefix) exec_prefix=$prefix;;
+esac
+
+# Checks for programs.
+
+# check stolen from gnulib/m4/gnu-make.m4
+if ! ${MAKE-make} --version /cannot/make/this >/dev/null 2>&1; then
+	AC_MSG_ERROR([you don't seem to have GNU make; it is required])
+fi
+
+AC_PROG_CC
+AM_PROG_CC_C_O
+AC_PROG_LN_S
+AC_PROG_INSTALL
+AC_PROG_MAKE_SET
+
+## local helper functions
+
+# this function checks if CC support options passed as
+# args. Global CFLAGS are ignored during this test.
+cc_supports_flag() {
+	local CFLAGS="$@"
+	AC_MSG_CHECKING([whether $CC supports "$@"])
+	AC_COMPILE_IFELSE([int main(){return 0;}] ,
+			  [RC=0; AC_MSG_RESULT([yes])],
+			  [RC=1; AC_MSG_RESULT([no])])
+	return $RC
+}
+
+# this function tests if a library has a certain function
+# by using AC_CHECK_LIB but restores the original LIBS global
+# envvar. This is required to avoid libtool to link everything
+# with everything.
+check_lib_no_libs() {
+	AC_CHECK_LIB([$1], [$2],,
+		     [AC_MSG_ERROR([Unable to find $1 library])])
+	LIBS=$ac_check_lib_save_LIBS
+}
+
+# corosync libs
+PKG_CHECK_MODULES([corosync],[corosync])
+PKG_CHECK_MODULES([sackpt],[libSaCkpt])
+PKG_CHECK_MODULES([ccs],[libccs])
+PKG_CHECK_MODULES([cman],[libcman])
+PKG_CHECK_MODULES([logt],[liblogthread])
+PKG_CHECK_MODULES([nss],[nss])
+PKG_CHECK_MODULES([nspr],[nspr])
+PKG_CHECK_MODULES([virt],[libvirt])
+PKG_CHECK_MODULES([xml],[libxml-2.0])
+
+# external libs (no pkgconfig)
+check_lib_no_libs pthread pthread_mutex_lock
+check_lib_no_libs ldap ldap_initialize
+check_lib_no_libs rt clock_gettime
+check_lib_no_libs z crc32
+
+# Checks for header files.
+AC_CHECK_HEADERS([arpa/inet.h fcntl.h libintl.h limits.h malloc.h netdb.h netinet/in.h stddef.h stdint.h stdlib.h string.h sys/ioctl.h sys/socket.h sys/time.h syslog.h unistd.h])
+
+# Checks for typedefs, structures, and compiler characteristics.
+AC_C_INLINE
+AC_TYPE_INT32_T
+AC_TYPE_PID_T
+AC_TYPE_SIZE_T
+AC_TYPE_SSIZE_T
+AC_TYPE_UINT16_T
+AC_TYPE_UINT32_T
+AC_TYPE_UINT64_T
+AC_TYPE_UINT8_T
+
+# Checks for library functions.
+AC_FUNC_FORK
+AC_FUNC_LSTAT_FOLLOWS_SLASHED_SYMLINK
+AC_FUNC_MALLOC
+AC_CHECK_FUNCS([alarm atexit bzero dup2 memmove memset select socket strcasecmp strchr strdup strerror strtol])
+
+# local options
+AC_ARG_ENABLE([debug],
+	[  --enable-debug          enable debug build. ],
+	[ default="no" ])
+
+AC_ARG_WITH([syslogfacility],
+	[  --syslogfacility=FACILITY
+                          cluster default syslog facility. ],
+	[ SYSLOGFACILITY="$withval" ],
+	[ SYSLOGFACILITY="LOG_LOCAL4" ])
+
+AC_ARG_WITH([sysloglevel],
+	[  --sysloglevel=LEVEL
+                          cluster default syslog level. ],
+	[ SYSLOGLEVEL="$withval" ],
+	[ SYSLOGLEVEL="LOG_INFO" ])
+
+AC_ARG_WITH([fenceagentslibdir],
+	[  --fenceagentslibdir=PATH
+                          installation path for fence library. ],
+	[ FENCEAGENTSLIBDIR="$withval" ],
+	[ FENCEAGENTSLIBDIR="${datadir}/fence" ])
+
+AC_ARG_WITH([snmpbin],
+	[  --snmpbin=PATH
+                          path to snmp binaries (snmpwalk/get). ],
+	[ SNMPBIN="$withval" ],
+	[ SNMPBIN="${bindir}" ])
+
+AC_ARG_WITH([default-config-dir],
+	[  --default-config-dir=DIR
+			  cluster config directory. ],
+	[ DEFAULT_CONFIG_DIR="$withval" ],
+	[ DEFAULT_CONFIG_DIR="$sysconfdir/cluster" ])
+
+## random vars
+
+LOGDIR=${localstatedir}/log/cluster
+CLUSTERVARRUN=${localstatedir}/run/cluster
+CLUSTERVARLIB=${localstatedir}/lib/cluster
+
+## do subst
+
+AC_SUBST([DEFAULT_CONFIG_DIR])
+AC_DEFINE_UNQUOTED([DEFAULT_CONFIG_DIR], "$(eval echo ${DEFAULT_CONFIG_DIR})",
+		   [Default config directory])
+
+AC_SUBST([LOGDIR])
+AC_DEFINE_UNQUOTED([LOGDIR], "$(eval echo ${LOGDIR})",
+		   [Default logging directory])
+
+AC_SUBST([CLUSTERVARRUN])
+AC_DEFINE_UNQUOTED([CLUSTERVARRUN], "$(eval echo ${CLUSTERVARRUN})",
+		   [Default cluster var/run directory])
+
+AC_SUBST([CLUSTERVARLIB])
+
+AC_SUBST([FENCEAGENTSLIBDIR])
+AC_SUBST([SNMPBIN])
+
+AC_DEFINE_UNQUOTED([SYSLOGFACILITY], $(eval echo ${SYSLOGFACILITY}),
+		   [Default syslog facility])
+
+AC_DEFINE_UNQUOTED([SYSLOGLEVEL], $(eval echo ${SYSLOGLEVEL}),
+		   [Default syslog level])
+
+## *FLAGS handling
+
+ENV_CFLAGS="$CFLAGS"
+ENV_CPPFLAGS="$CPPFLAGS"
+ENV_LDFLAGS="$LDFLAGS"
+
+# debug build stuff
+if test "x${enable_debug}" = xyes; then
+	AC_DEFINE_UNQUOTED([DEBUG], [1], [Compiling Debugging code])
+	OPT_CFLAGS="-O0"
+else
+	OPT_CFLAGS="-O2"
+fi
+
+# gdb flags
+if test "x${GCC}" = xyes; then
+	GDB_FLAGS="-ggdb3"
+else
+	GDB_FLAGS="-g"
+fi
+
+# extra warnings
+EXTRA_WARNINGS=""
+
+WARNLIST="
+	all
+	shadow
+	missing-prototypes
+	missing-declarations
+	strict-prototypes
+	declaration-after-statement
+	pointer-arith
+	write-strings
+	cast-align
+	bad-function-cast
+	missing-format-attribute
+	format=2
+	format-security
+	format-nonliteral
+	no-long-long
+	unsigned-char
+	gnu89-inline
+	no-strict-aliasing
+	"
+
+for j in $WARNLIST; do
+	if cc_supports_flag -W$j; then
+		EXTRA_WARNINGS="$EXTRA_WARNINGS -W$j";
+	fi
+done
+
+CFLAGS="$ENV_CFLAGS $OPT_CFLAGS $GDB_FLAGS \
+	$EXTRA_WARNINGS $WERROR_CFLAGS"
+CPPFLAGS="-I\$(top_builddir)/make -I\$(top_srcdir)/make -I. $ENV_CPPFLAGS"
+LDFLAGS="$ENV_LDFLAGS"
+
+AC_CONFIG_FILES([Makefile
+		 fence/Makefile
+		 fence/agents/Makefile
+		 fence/agents/alom/Makefile
+		 fence/agents/apc/Makefile
+		 fence/agents/apc_snmp/Makefile
+		 fence/agents/baytech/Makefile
+		 fence/agents/bladecenter/Makefile
+		 fence/agents/brocade/Makefile
+		 fence/agents/bullpap/Makefile
+		 fence/agents/cisco_mds/Makefile
+		 fence/agents/cpint/Makefile
+		 fence/agents/drac/Makefile
+		 fence/agents/egenera/Makefile
+		 fence/agents/eps/Makefile
+		 fence/agents/ibmblade/Makefile
+		 fence/agents/ifmib/Makefile
+		 fence/agents/ilo/Makefile
+		 fence/agents/intelmodular/Makefile
+		 fence/agents/ipmilan/Makefile
+		 fence/agents/ldom/Makefile
+		 fence/agents/lib/Makefile
+		 fence/agents/lpar/Makefile
+		 fence/agents/manual/Makefile
+		 fence/agents/mcdata/Makefile
+		 fence/agents/nss_wrapper/Makefile
+		 fence/agents/rackswitch/Makefile
+		 fence/agents/rsa/Makefile
+		 fence/agents/rsb/Makefile
+		 fence/agents/sanbox2/Makefile
+		 fence/agents/scsi/Makefile
+		 fence/agents/virsh/Makefile
+		 fence/agents/vixel/Makefile
+		 fence/agents/vmware/Makefile
+		 fence/agents/wti/Makefile
+		 fence/agents/xcat/Makefile
+		 fence/agents/xvm/Makefile
+		 fence/agents/zvm/Makefile
+		 fence/man/Makefile
+		 doc/Makefile])
+
+AC_OUTPUT
diff --git a/doc/Makefile b/doc/Makefile
deleted file mode 100644
index 24192ba..0000000
--- a/doc/Makefile
+++ /dev/null
@@ -1,16 +0,0 @@
-DOCS =	gfs2.txt \
-	journaling.txt \
-	min-gfs.txt \
-	usage.txt \
-	COPYING.applications \
-	COPYING.libraries \
-	COPYRIGHT \
-	README.licence
-
-all:
-
-clean:
-
-include ../make/defines.mk
-include $(OBJDIR)/make/install.mk
-include $(OBJDIR)/make/uninstall.mk
diff --git a/doc/Makefile.am b/doc/Makefile.am
new file mode 100644
index 0000000..2e6a2ec
--- /dev/null
+++ b/doc/Makefile.am
@@ -0,0 +1,10 @@
+MAINTAINERCLEANFILES	= Makefile.in
+
+dist_doc_DATA		= gfs2.txt \
+			  journaling.txt \
+			  min-gfs.txt \
+			  usage.txt \
+			  COPYING.applications \
+			  COPYING.libraries \
+			  COPYRIGHT \
+			  README.licence
diff --git a/fence/Makefile b/fence/Makefile
deleted file mode 100644
index 1190851..0000000
--- a/fence/Makefile
+++ /dev/null
@@ -1,4 +0,0 @@
-include ../make/defines.mk
-include $(OBJDIR)/make/passthrough.mk
-
-SUBDIRS=agents man
diff --git a/fence/Makefile.am b/fence/Makefile.am
new file mode 100644
index 0000000..8c7caa8
--- /dev/null
+++ b/fence/Makefile.am
@@ -0,0 +1,3 @@
+MAINTAINERCLEANFILES	= Makefile.in
+
+SUBDIRS			= agents man
diff --git a/fence/agents/Makefile b/fence/agents/Makefile
deleted file mode 100644
index eab0664..0000000
--- a/fence/agents/Makefile
+++ /dev/null
@@ -1,4 +0,0 @@
-include ../../make/defines.mk
-include $(OBJDIR)/make/passthrough.mk
-
-SUBDIRS = ${fence_agents} lib nss_wrapper
diff --git a/fence/agents/Makefile.am b/fence/agents/Makefile.am
new file mode 100644
index 0000000..453993f
--- /dev/null
+++ b/fence/agents/Makefile.am
@@ -0,0 +1,37 @@
+MAINTAINERCLEANFILES	= Makefile.in
+
+SUBDIRS 		= alom \
+			  apc \
+			  apc_snmp \
+			  baytech \
+			  bladecenter \
+			  brocade \
+			  bullpap \
+			  cisco_mds \
+			  cpint \
+			  drac \
+			  egenera \
+			  eps \
+			  ibmblade \
+			  ifmib \
+			  ilo \
+			  intelmodular \
+			  ipmilan \
+			  ldom \
+			  lib \
+			  lpar \
+			  manual \
+			  mcdata \
+			  nss_wrapper \
+			  rackswitch \
+			  rsa \
+			  rsb \
+			  sanbox2 \
+			  scsi \
+			  virsh \
+			  vixel \
+			  vmware \
+			  wti \
+			  xcat \
+			  xvm \
+			  zvm
diff --git a/fence/agents/alom/Makefile b/fence/agents/alom/Makefile
deleted file mode 100644
index 6efc272..0000000
--- a/fence/agents/alom/Makefile
+++ /dev/null
@@ -1,5 +0,0 @@
-include ../../../make/defines.mk
-
-TARGET= fence_alom
-
-include $(OBJDIR)/make/fencebuild.mk
diff --git a/fence/agents/alom/Makefile.am b/fence/agents/alom/Makefile.am
new file mode 100644
index 0000000..d65f6a7
--- /dev/null
+++ b/fence/agents/alom/Makefile.am
@@ -0,0 +1,12 @@
+MAINTAINERCLEANFILES	= Makefile.in
+
+TARGET			= fence_alom
+
+EXTRA_DIST		= $(TARGET).py
+
+sbin_SCRIPTS		= $(TARGET)
+
+include $(top_srcdir)/make/fencebuild.mk
+
+clean-local:
+	rm -f $(TARGET)
diff --git a/fence/agents/apc/Makefile b/fence/agents/apc/Makefile
deleted file mode 100644
index 88cd004..0000000
--- a/fence/agents/apc/Makefile
+++ /dev/null
@@ -1,5 +0,0 @@
-include ../../../make/defines.mk
-
-TARGET= fence_apc
-
-include $(OBJDIR)/make/fencebuild.mk
diff --git a/fence/agents/apc/Makefile.am b/fence/agents/apc/Makefile.am
new file mode 100644
index 0000000..bd120b1
--- /dev/null
+++ b/fence/agents/apc/Makefile.am
@@ -0,0 +1,12 @@
+MAINTAINERCLEANFILES	= Makefile.in
+
+TARGET			= fence_apc
+
+EXTRA_DIST		= $(TARGET).py
+
+sbin_SCRIPTS		= $(TARGET)
+
+include $(top_srcdir)/make/fencebuild.mk
+
+clean-local:
+	rm -f $(TARGET)
diff --git a/fence/agents/apc_snmp/Makefile b/fence/agents/apc_snmp/Makefile
deleted file mode 100644
index 9d2e498..0000000
--- a/fence/agents/apc_snmp/Makefile
+++ /dev/null
@@ -1,4 +0,0 @@
-TARGET= fence_apc_snmp
-
-include ../../../make/defines.mk
-include $(OBJDIR)/make/fencebuild.mk
diff --git a/fence/agents/apc_snmp/Makefile.am b/fence/agents/apc_snmp/Makefile.am
new file mode 100644
index 0000000..16dd01c
--- /dev/null
+++ b/fence/agents/apc_snmp/Makefile.am
@@ -0,0 +1,14 @@
+MAINTAINERCLEANFILES	= Makefile.in
+
+TARGET			= fence_apc_snmp
+
+EXTRA_DIST		= $(TARGET).py \
+			  powernet369.mib \
+			  README
+
+sbin_SCRIPTS		= $(TARGET)
+
+include $(top_srcdir)/make/fencebuild.mk
+
+clean-local:
+	rm -f $(TARGET)
diff --git a/fence/agents/baytech/Makefile b/fence/agents/baytech/Makefile
deleted file mode 100644
index 2acfe58..0000000
--- a/fence/agents/baytech/Makefile
+++ /dev/null
@@ -1,4 +0,0 @@
-TARGET= fence_baytech
-
-include ../../../make/defines.mk
-include $(OBJDIR)/make/fencebuild.mk
diff --git a/fence/agents/baytech/Makefile.am b/fence/agents/baytech/Makefile.am
new file mode 100644
index 0000000..f48aa4d
--- /dev/null
+++ b/fence/agents/baytech/Makefile.am
@@ -0,0 +1,12 @@
+MAINTAINERCLEANFILES	= Makefile.in
+
+TARGET			= fence_baytech
+
+EXTRA_DIST		= $(TARGET).pl
+
+sbin_SCRIPTS		= $(TARGET)
+
+include $(top_srcdir)/make/fencebuild.mk
+
+clean-local:
+	rm -f $(TARGET)
diff --git a/fence/agents/bladecenter/Makefile b/fence/agents/bladecenter/Makefile
deleted file mode 100644
index a123a15..0000000
--- a/fence/agents/bladecenter/Makefile
+++ /dev/null
@@ -1,5 +0,0 @@
-include ../../../make/defines.mk
-
-TARGET= fence_bladecenter
-
-include $(OBJDIR)/make/fencebuild.mk
diff --git a/fence/agents/bladecenter/Makefile.am b/fence/agents/bladecenter/Makefile.am
new file mode 100644
index 0000000..99dcb84
--- /dev/null
+++ b/fence/agents/bladecenter/Makefile.am
@@ -0,0 +1,12 @@
+MAINTAINERCLEANFILES	= Makefile.in
+
+TARGET			= fence_bladecenter
+
+EXTRA_DIST		= $(TARGET).py
+
+sbin_SCRIPTS		= $(TARGET)
+
+include $(top_srcdir)/make/fencebuild.mk
+
+clean-local:
+	rm -f $(TARGET)
diff --git a/fence/agents/brocade/Makefile b/fence/agents/brocade/Makefile
deleted file mode 100644
index 74e96cc..0000000
--- a/fence/agents/brocade/Makefile
+++ /dev/null
@@ -1,4 +0,0 @@
-TARGET= fence_brocade
-
-include ../../../make/defines.mk
-include $(OBJDIR)/make/fencebuild.mk
diff --git a/fence/agents/brocade/Makefile.am b/fence/agents/brocade/Makefile.am
new file mode 100644
index 0000000..f3cdbd5
--- /dev/null
+++ b/fence/agents/brocade/Makefile.am
@@ -0,0 +1,12 @@
+MAINTAINERCLEANFILES	= Makefile.in
+
+TARGET			= fence_brocade
+
+EXTRA_DIST		= $(TARGET).pl
+
+sbin_SCRIPTS		= $(TARGET)
+
+include $(top_srcdir)/make/fencebuild.mk
+
+clean-local:
+	rm -f $(TARGET)
diff --git a/fence/agents/bullpap/Makefile b/fence/agents/bullpap/Makefile
deleted file mode 100644
index ac2754f..0000000
--- a/fence/agents/bullpap/Makefile
+++ /dev/null
@@ -1,4 +0,0 @@
-TARGET= fence_bullpap
-
-include ../../../make/defines.mk
-include $(OBJDIR)/make/fencebuild.mk
diff --git a/fence/agents/bullpap/Makefile.am b/fence/agents/bullpap/Makefile.am
new file mode 100644
index 0000000..a93e16b
--- /dev/null
+++ b/fence/agents/bullpap/Makefile.am
@@ -0,0 +1,12 @@
+MAINTAINERCLEANFILES	= Makefile.in
+
+TARGET			= fence_bullpap
+
+EXTRA_DIST		= $(TARGET).pl
+
+sbin_SCRIPTS		= $(TARGET)
+
+include $(top_srcdir)/make/fencebuild.mk
+
+clean-local:
+	rm -f $(TARGET)
diff --git a/fence/agents/cisco_mds/Makefile b/fence/agents/cisco_mds/Makefile
deleted file mode 100644
index e4e8c9f..0000000
--- a/fence/agents/cisco_mds/Makefile
+++ /dev/null
@@ -1,5 +0,0 @@
-include ../../../make/defines.mk
-
-TARGET= fence_cisco_mds
-
-include $(OBJDIR)/make/fencebuild.mk
diff --git a/fence/agents/cisco_mds/Makefile.am b/fence/agents/cisco_mds/Makefile.am
new file mode 100644
index 0000000..080cccf
--- /dev/null
+++ b/fence/agents/cisco_mds/Makefile.am
@@ -0,0 +1,12 @@
+MAINTAINERCLEANFILES	= Makefile.in
+
+TARGET			= fence_cisco_mds
+
+EXTRA_DIST		= $(TARGET).py
+
+sbin_SCRIPTS		= $(TARGET)
+
+include $(top_srcdir)/make/fencebuild.mk
+
+clean-local:
+	rm -f $(TARGET)
diff --git a/fence/agents/cpint/Makefile b/fence/agents/cpint/Makefile
deleted file mode 100644
index 0591ea8..0000000
--- a/fence/agents/cpint/Makefile
+++ /dev/null
@@ -1,4 +0,0 @@
-TARGET= fence_cpint
-
-include ../../../make/defines.mk
-include $(OBJDIR)/make/fencebuild.mk
diff --git a/fence/agents/cpint/Makefile.am b/fence/agents/cpint/Makefile.am
new file mode 100644
index 0000000..930639a
--- /dev/null
+++ b/fence/agents/cpint/Makefile.am
@@ -0,0 +1,12 @@
+MAINTAINERCLEANFILES	= Makefile.in
+
+TARGET			= fence_cpint
+
+EXTRA_DIST		= $(TARGET).pl
+
+sbin_SCRIPTS		= $(TARGET)
+
+include $(top_srcdir)/make/fencebuild.mk
+
+clean-local:
+	rm -f $(TARGET)
diff --git a/fence/agents/drac/Makefile b/fence/agents/drac/Makefile
deleted file mode 100644
index 9a752ae..0000000
--- a/fence/agents/drac/Makefile
+++ /dev/null
@@ -1,5 +0,0 @@
-include ../../../make/defines.mk
-
-TARGET= fence_drac fence_drac5
-
-include $(OBJDIR)/make/fencebuild.mk
diff --git a/fence/agents/drac/Makefile.am b/fence/agents/drac/Makefile.am
new file mode 100644
index 0000000..92098fa
--- /dev/null
+++ b/fence/agents/drac/Makefile.am
@@ -0,0 +1,12 @@
+MAINTAINERCLEANFILES	= Makefile.in
+
+TARGET			= fence_drac fence_drac5
+
+EXTRA_DIST		= fence_drac.pl fence_drac5.py
+
+sbin_SCRIPTS		= $(TARGET)
+
+include $(top_srcdir)/make/fencebuild.mk
+
+clean-local:
+	rm -f $(TARGET)
diff --git a/fence/agents/egenera/Makefile b/fence/agents/egenera/Makefile
deleted file mode 100644
index 655cc0c..0000000
--- a/fence/agents/egenera/Makefile
+++ /dev/null
@@ -1,4 +0,0 @@
-TARGET= fence_egenera
-
-include ../../../make/defines.mk
-include $(OBJDIR)/make/fencebuild.mk
diff --git a/fence/agents/egenera/Makefile.am b/fence/agents/egenera/Makefile.am
new file mode 100644
index 0000000..c31a38c
--- /dev/null
+++ b/fence/agents/egenera/Makefile.am
@@ -0,0 +1,12 @@
+MAINTAINERCLEANFILES	= Makefile.in
+
+TARGET			= fence_egenera
+
+EXTRA_DIST		= $(TARGET).pl
+
+sbin_SCRIPTS		= $(TARGET)
+
+include $(top_srcdir)/make/fencebuild.mk
+
+clean-local:
+	rm -f $(TARGET)
diff --git a/fence/agents/eps/Makefile b/fence/agents/eps/Makefile
deleted file mode 100644
index fc665bc..0000000
--- a/fence/agents/eps/Makefile
+++ /dev/null
@@ -1,5 +0,0 @@
-include ../../../make/defines.mk
-
-TARGET= fence_eps
-
-include $(OBJDIR)/make/fencebuild.mk
diff --git a/fence/agents/eps/Makefile.am b/fence/agents/eps/Makefile.am
new file mode 100644
index 0000000..4348755
--- /dev/null
+++ b/fence/agents/eps/Makefile.am
@@ -0,0 +1,12 @@
+MAINTAINERCLEANFILES	= Makefile.in
+
+TARGET			= fence_eps
+
+EXTRA_DIST		= $(TARGET).py
+
+sbin_SCRIPTS		= $(TARGET)
+
+include $(top_srcdir)/make/fencebuild.mk
+
+clean-local:
+	rm -f $(TARGET)
diff --git a/fence/agents/ibmblade/Makefile b/fence/agents/ibmblade/Makefile
deleted file mode 100644
index 522a24a..0000000
--- a/fence/agents/ibmblade/Makefile
+++ /dev/null
@@ -1,4 +0,0 @@
-TARGET= fence_ibmblade
-
-include ../../../make/defines.mk
-include $(OBJDIR)/make/fencebuild.mk
diff --git a/fence/agents/ibmblade/Makefile.am b/fence/agents/ibmblade/Makefile.am
new file mode 100644
index 0000000..53a452f
--- /dev/null
+++ b/fence/agents/ibmblade/Makefile.am
@@ -0,0 +1,12 @@
+MAINTAINERCLEANFILES	= Makefile.in
+
+TARGET			= fence_ibmblade
+
+EXTRA_DIST		= $(TARGET).py
+
+sbin_SCRIPTS		= $(TARGET)
+
+include $(top_srcdir)/make/fencebuild.mk
+
+clean-local:
+	rm -f $(TARGET)
diff --git a/fence/agents/ifmib/Makefile b/fence/agents/ifmib/Makefile
deleted file mode 100644
index 32a5657..0000000
--- a/fence/agents/ifmib/Makefile
+++ /dev/null
@@ -1,5 +0,0 @@
-include ../../../make/defines.mk
-
-TARGET= fence_ifmib
-
-include $(OBJDIR)/make/fencebuild.mk
diff --git a/fence/agents/ifmib/Makefile.am b/fence/agents/ifmib/Makefile.am
new file mode 100644
index 0000000..16dcc6b
--- /dev/null
+++ b/fence/agents/ifmib/Makefile.am
@@ -0,0 +1,12 @@
+MAINTAINERCLEANFILES	= Makefile.in
+
+TARGET			= fence_ifmib
+
+EXTRA_DIST		= $(TARGET).py README
+
+sbin_SCRIPTS		= $(TARGET)
+
+include $(top_srcdir)/make/fencebuild.mk
+
+clean-local:
+	rm -f $(TARGET)
diff --git a/fence/agents/ilo/Makefile b/fence/agents/ilo/Makefile
deleted file mode 100644
index 66420ab..0000000
--- a/fence/agents/ilo/Makefile
+++ /dev/null
@@ -1,5 +0,0 @@
-include ../../../make/defines.mk
-
-TARGET= fence_ilo
-
-include $(OBJDIR)/make/fencebuild.mk
diff --git a/fence/agents/ilo/Makefile.am b/fence/agents/ilo/Makefile.am
new file mode 100644
index 0000000..ce7ee1c
--- /dev/null
+++ b/fence/agents/ilo/Makefile.am
@@ -0,0 +1,12 @@
+MAINTAINERCLEANFILES	= Makefile.in
+
+TARGET			= fence_ilo
+
+EXTRA_DIST		= $(TARGET).py
+
+sbin_SCRIPTS		= $(TARGET)
+
+include $(top_srcdir)/make/fencebuild.mk
+
+clean-local:
+	rm -f $(TARGET)
diff --git a/fence/agents/intelmodular/Makefile b/fence/agents/intelmodular/Makefile
deleted file mode 100644
index ba22926..0000000
--- a/fence/agents/intelmodular/Makefile
+++ /dev/null
@@ -1,4 +0,0 @@
-TARGET= fence_intelmodular
-
-include ../../../make/defines.mk
-include $(OBJDIR)/make/fencebuild.mk
diff --git a/fence/agents/intelmodular/Makefile.am b/fence/agents/intelmodular/Makefile.am
new file mode 100644
index 0000000..690cdbd
--- /dev/null
+++ b/fence/agents/intelmodular/Makefile.am
@@ -0,0 +1,12 @@
+MAINTAINERCLEANFILES	= Makefile.in
+
+TARGET			= fence_intelmodular
+
+EXTRA_DIST		= $(TARGET).py
+
+sbin_SCRIPTS		= $(TARGET)
+
+include $(top_srcdir)/make/fencebuild.mk
+
+clean-local:
+	rm -f $(TARGET)
diff --git a/fence/agents/ipmilan/Makefile b/fence/agents/ipmilan/Makefile
deleted file mode 100644
index 1c2e9e9..0000000
--- a/fence/agents/ipmilan/Makefile
+++ /dev/null
@@ -1,25 +0,0 @@
-TARGET= fence_ipmilan
-
-SBINDIRT=$(TARGET)
-
-all: ${TARGET}
-
-include ../../../make/defines.mk
-include $(OBJDIR)/make/cobj.mk
-include $(OBJDIR)/make/clean.mk
-include $(OBJDIR)/make/install.mk
-include $(OBJDIR)/make/uninstall.mk
-
-OBJS=	expect.o \
-	ipmilan.o
-
-CFLAGS += -I${incdir}
-
-LDFLAGS += -L${libdir}
-
-${TARGET}: ${OBJS}
-	$(CC) -o $@ $^ $(LDFLAGS)
-
-clean: generalclean
-
--include $(OBJS:.o=.d)
diff --git a/fence/agents/ipmilan/Makefile.am b/fence/agents/ipmilan/Makefile.am
new file mode 100644
index 0000000..bee7669
--- /dev/null
+++ b/fence/agents/ipmilan/Makefile.am
@@ -0,0 +1,7 @@
+MAINTAINERCLEANFILES	= Makefile.in
+
+sbin_PROGRAMS		= fence_ipmilan
+
+noinst_HEADERS		= expect.h
+
+fence_ipmilan_SOURCES	= expect.c ipmilan.c
diff --git a/fence/agents/ipmilan/expect.c b/fence/agents/ipmilan/expect.c
index 85ba487..2ed40f0 100644
--- a/fence/agents/ipmilan/expect.c
+++ b/fence/agents/ipmilan/expect.c
@@ -1,6 +1,7 @@
 /** @file
  * Simple expect module for the STONITH library.
  */
+#include "clusterautoconfig.h"
 
 #include <stdio.h>
 #include <stdlib.h>
diff --git a/fence/agents/ipmilan/ipmilan.c b/fence/agents/ipmilan/ipmilan.c
index 681ba47..8238a11 100644
--- a/fence/agents/ipmilan/ipmilan.c
+++ b/fence/agents/ipmilan/ipmilan.c
@@ -9,6 +9,9 @@
  *  http://ipmitool.sourceforge.net
  *
  */
+
+#include "clusterautoconfig.h"
+
 #include <stdio.h>
 #include <stdlib.h>
 #include <unistd.h>
@@ -859,7 +862,7 @@ main(int argc, char **argv)
 				break;
 			case 'V':
         			printf("%s %s (built %s %s)\n", pname,
-				       RELEASE_VERSION,
+				       VERSION,
                				__DATE__, __TIME__);
         			printf("%s\n",
 				       REDHAT_COPYRIGHT);
diff --git a/fence/agents/ldom/Makefile b/fence/agents/ldom/Makefile
deleted file mode 100644
index a288025..0000000
--- a/fence/agents/ldom/Makefile
+++ /dev/null
@@ -1,5 +0,0 @@
-include ../../../make/defines.mk
-
-TARGET= fence_ldom
-
-include $(OBJDIR)/make/fencebuild.mk
diff --git a/fence/agents/ldom/Makefile.am b/fence/agents/ldom/Makefile.am
new file mode 100644
index 0000000..36517eb
--- /dev/null
+++ b/fence/agents/ldom/Makefile.am
@@ -0,0 +1,12 @@
+MAINTAINERCLEANFILES	= Makefile.in
+
+TARGET			= fence_ldom
+
+EXTRA_DIST		= $(TARGET).py
+
+sbin_SCRIPTS		= $(TARGET)
+
+include $(top_srcdir)/make/fencebuild.mk
+
+clean-local:
+	rm -f $(TARGET)
diff --git a/fence/agents/lib/Makefile b/fence/agents/lib/Makefile
deleted file mode 100644
index 2cccd98..0000000
--- a/fence/agents/lib/Makefile
+++ /dev/null
@@ -1,7 +0,0 @@
-include ../../../make/defines.mk
-
-TARGET= fencing.py fencing_snmp.py
-
-FENCEAGENTSLIB= $(TARGET)
-
-include $(OBJDIR)/make/fencebuild.mk
diff --git a/fence/agents/lib/Makefile.am b/fence/agents/lib/Makefile.am
new file mode 100644
index 0000000..35170e8
--- /dev/null
+++ b/fence/agents/lib/Makefile.am
@@ -0,0 +1,14 @@
+MAINTAINERCLEANFILES	= Makefile.in
+
+TARGET			= fencing.py fencing_snmp.py
+
+EXTRA_DIST		= fencing.py.py fencing_snmp.py.py
+
+fencelibdir		= ${FENCEAGENTSLIBDIR}
+
+fencelib_DATA		= $(TARGET)
+
+include $(top_srcdir)/make/fencebuild.mk
+
+clean-local:
+	rm -f $(TARGET)
diff --git a/fence/agents/lpar/Makefile b/fence/agents/lpar/Makefile
deleted file mode 100644
index ef7d91a..0000000
--- a/fence/agents/lpar/Makefile
+++ /dev/null
@@ -1,5 +0,0 @@
-include ../../../make/defines.mk
-
-TARGET= fence_lpar
-
-include $(OBJDIR)/make/fencebuild.mk
diff --git a/fence/agents/lpar/Makefile.am b/fence/agents/lpar/Makefile.am
new file mode 100644
index 0000000..ca106bf
--- /dev/null
+++ b/fence/agents/lpar/Makefile.am
@@ -0,0 +1,12 @@
+MAINTAINERCLEANFILES	= Makefile.in
+
+TARGET			= fence_lpar
+
+EXTRA_DIST		= $(TARGET).py
+
+sbin_SCRIPTS		= $(TARGET)
+
+include $(top_srcdir)/make/fencebuild.mk
+
+clean-local:
+	rm -f $(TARGET)
diff --git a/fence/agents/manual/Makefile b/fence/agents/manual/Makefile
deleted file mode 100644
index 490100f..0000000
--- a/fence/agents/manual/Makefile
+++ /dev/null
@@ -1,19 +0,0 @@
-TARGET= fence_ack_manual
-
-SBINDIRT=$(TARGET)
-
-all: ${TARGET}
-
-include ../../../make/defines.mk
-include $(OBJDIR)/make/clean.mk
-include $(OBJDIR)/make/install.mk
-include $(OBJDIR)/make/uninstall.mk
-
-
-# Using manual override instead of the binary version.
-# (this version does not require any configuration params
-# in cluster.conf, but fencing must fail first)
-${TARGET}: 
-	cp $(S)/$@.sh $@
-
-clean: generalclean
diff --git a/fence/agents/manual/Makefile.am b/fence/agents/manual/Makefile.am
new file mode 100644
index 0000000..b2552ab
--- /dev/null
+++ b/fence/agents/manual/Makefile.am
@@ -0,0 +1,7 @@
+MAINTAINERCLEANFILES	= Makefile.in
+
+TARGET			= fence_ack_manual
+
+sbin_SCRIPTS		= $(TARGET)
+
+EXTRA_DIST		= $(TARGET)
diff --git a/fence/agents/manual/fence_ack_manual b/fence/agents/manual/fence_ack_manual
new file mode 100644
index 0000000..83102aa
--- /dev/null
+++ b/fence/agents/manual/fence_ack_manual
@@ -0,0 +1,37 @@
+#!/bin/bash
+#
+# Manual override after fencing has failed.
+#
+
+if [ "$1" = "-n" ]; then
+	shift
+fi
+
+if [ -z "$1" ] || [ "$1" = "-h" ]; then
+	echo "usage:"
+        echo " 	$0 <nodename>"
+        echo " 	$0 -n <nodename>"
+	echo 
+	echo "The -n flag exists to preserve compatibility with previous "
+	echo "releases of $0, and is no longer required."
+	exit 1
+fi
+
+declare answer
+
+echo "About to override fencing for $1."
+echo "Improper use of this command can cause severe file system damage."
+echo
+read -p "Continue [NO/absolutely]? " answer
+
+if [ "$answer" != "absolutely" ]; then
+	echo "Aborted."
+	exit 1
+fi
+
+while ! [ -e /var/run/cluster/fenced_override ]; do
+	sleep 1
+done
+
+echo $1>/var/run/cluster/fenced_override
+echo Done
diff --git a/fence/agents/manual/fence_ack_manual.sh b/fence/agents/manual/fence_ack_manual.sh
deleted file mode 100644
index 83102aa..0000000
--- a/fence/agents/manual/fence_ack_manual.sh
+++ /dev/null
@@ -1,37 +0,0 @@
-#!/bin/bash
-#
-# Manual override after fencing has failed.
-#
-
-if [ "$1" = "-n" ]; then
-	shift
-fi
-
-if [ -z "$1" ] || [ "$1" = "-h" ]; then
-	echo "usage:"
-        echo " 	$0 <nodename>"
-        echo " 	$0 -n <nodename>"
-	echo 
-	echo "The -n flag exists to preserve compatibility with previous "
-	echo "releases of $0, and is no longer required."
-	exit 1
-fi
-
-declare answer
-
-echo "About to override fencing for $1."
-echo "Improper use of this command can cause severe file system damage."
-echo
-read -p "Continue [NO/absolutely]? " answer
-
-if [ "$answer" != "absolutely" ]; then
-	echo "Aborted."
-	exit 1
-fi
-
-while ! [ -e /var/run/cluster/fenced_override ]; do
-	sleep 1
-done
-
-echo $1>/var/run/cluster/fenced_override
-echo Done
diff --git a/fence/agents/mcdata/Makefile b/fence/agents/mcdata/Makefile
deleted file mode 100644
index ca2facf..0000000
--- a/fence/agents/mcdata/Makefile
+++ /dev/null
@@ -1,4 +0,0 @@
-TARGET= fence_mcdata
-
-include ../../../make/defines.mk
-include $(OBJDIR)/make/fencebuild.mk
diff --git a/fence/agents/mcdata/Makefile.am b/fence/agents/mcdata/Makefile.am
new file mode 100644
index 0000000..1e5f0f6
--- /dev/null
+++ b/fence/agents/mcdata/Makefile.am
@@ -0,0 +1,12 @@
+MAINTAINERCLEANFILES	= Makefile.in
+
+TARGET			= fence_mcdata
+
+EXTRA_DIST		= $(TARGET).pl
+
+sbin_SCRIPTS		= $(TARGET)
+
+include $(top_srcdir)/make/fencebuild.mk
+
+clean-local:
+	rm -f $(TARGET)
diff --git a/fence/agents/nss_wrapper/Makefile b/fence/agents/nss_wrapper/Makefile
deleted file mode 100644
index b3a53ae..0000000
--- a/fence/agents/nss_wrapper/Makefile
+++ /dev/null
@@ -1,26 +0,0 @@
-TARGET= fence_nss_wrapper
-
-SBINDIRT=$(TARGET)
-
-all: ${TARGET}
-
-include ../../../make/defines.mk
-include $(OBJDIR)/make/cobj.mk
-include $(OBJDIR)/make/clean.mk
-include $(OBJDIR)/make/install.mk
-include $(OBJDIR)/make/uninstall.mk
-
-OBJS=	$(TARGET).o
-
-CFLAGS += -I${nsprincdir} -I${nssincdir}
-CFLAGS += -I${incdir}
-
-LDFLAGS += -L${nsslibdir} -lnss3 -lssl3
-LDFLAGS += -L${libdir}
-
-${TARGET}: ${OBJS}
-	$(CC) -o $@ $^ $(LDFLAGS)
-
-clean: generalclean
-
--include $(OBJS:.o=.d)
diff --git a/fence/agents/nss_wrapper/Makefile.am b/fence/agents/nss_wrapper/Makefile.am
new file mode 100644
index 0000000..5e47f97
--- /dev/null
+++ b/fence/agents/nss_wrapper/Makefile.am
@@ -0,0 +1,7 @@
+MAINTAINERCLEANFILES	  = Makefile.in
+
+sbin_PROGRAMS		  = fence_nss_wrapper
+
+fence_nss_wrapper_CFLAGS  = $(nss_CFLAGS) $(nspr_CFLAGS)
+
+fence_nss_wrapper_LDFLAGS = $(nss_LIBS) $(nspr_LIBS)
diff --git a/fence/agents/nss_wrapper/fence_nss_wrapper.c b/fence/agents/nss_wrapper/fence_nss_wrapper.c
index 9571573..b960cf0 100644
--- a/fence/agents/nss_wrapper/fence_nss_wrapper.c
+++ b/fence/agents/nss_wrapper/fence_nss_wrapper.c
@@ -1,6 +1,8 @@
 /** @file fence_nss_wrapper.c - Main source code of hobbit like tool with
   support for NSS (SSL) connection.
 */
+#include "clusterautoconfig.h"
+
 #include <stdio.h>
 #include <nss.h>
 #include <ssl.h>
diff --git a/fence/agents/rackswitch/Makefile b/fence/agents/rackswitch/Makefile
deleted file mode 100644
index 71334d5..0000000
--- a/fence/agents/rackswitch/Makefile
+++ /dev/null
@@ -1,24 +0,0 @@
-TARGET= fence_rackswitch
-
-SBINDIRT=$(TARGET)
-
-all: ${TARGET}
-
-include ../../../make/defines.mk
-include $(OBJDIR)/make/cobj.mk
-include $(OBJDIR)/make/clean.mk
-include $(OBJDIR)/make/install.mk
-include $(OBJDIR)/make/uninstall.mk
-
-OBJS=	do_rack.o
-
-CFLAGS += -I${incdir}
-
-LDFLAGS += -L${libdir}
-
-${TARGET}: ${OBJS}
-	$(CC) -o $@ $^ $(LDFLAGS)
-
-clean: generalclean
-
--include $(OBJS:.o=.d)
diff --git a/fence/agents/rackswitch/Makefile.am b/fence/agents/rackswitch/Makefile.am
new file mode 100644
index 0000000..50dbf39
--- /dev/null
+++ b/fence/agents/rackswitch/Makefile.am
@@ -0,0 +1,7 @@
+MAINTAINERCLEANFILES	 = Makefile.in
+
+sbin_PROGRAMS		 = fence_rackswitch
+
+noinst_HEADERS		 = do_rack.h
+
+fence_rackswitch_SOURCES = do_rack.c
diff --git a/fence/agents/rackswitch/do_rack.c b/fence/agents/rackswitch/do_rack.c
index 2b5efe2..a4bad8d 100644
--- a/fence/agents/rackswitch/do_rack.c
+++ b/fence/agents/rackswitch/do_rack.c
@@ -1,3 +1,5 @@
+#include "clusterautoconfig.h"
+
 #include "do_rack.h"
 
 const char *pname = "fence_rack";
@@ -207,7 +209,7 @@ static void get_options(int argc, char **argv)
 	    break;
 
 	  case 'V':
-	    printf("%s %s (built %s %s)\n", pname, RELEASE_VERSION,
+	    printf("%s %s (built %s %s)\n", pname, VERSION,
 		   __DATE__, __TIME__);
 	    printf("%s\n", REDHAT_COPYRIGHT);
 	    exit(DID_SUCCESS);
diff --git a/fence/agents/rsa/Makefile b/fence/agents/rsa/Makefile
deleted file mode 100644
index e85ed97..0000000
--- a/fence/agents/rsa/Makefile
+++ /dev/null
@@ -1,4 +0,0 @@
-TARGET= fence_rsa
-
-include ../../../make/defines.mk
-include $(OBJDIR)/make/fencebuild.mk
diff --git a/fence/agents/rsa/Makefile.am b/fence/agents/rsa/Makefile.am
new file mode 100644
index 0000000..3ee9ca3
--- /dev/null
+++ b/fence/agents/rsa/Makefile.am
@@ -0,0 +1,12 @@
+MAINTAINERCLEANFILES	= Makefile.in
+
+TARGET			= fence_rsa
+
+EXTRA_DIST		= $(TARGET).py
+
+sbin_SCRIPTS		= $(TARGET)
+
+include $(top_srcdir)/make/fencebuild.mk
+
+clean-local:
+	rm -f $(TARGET)
diff --git a/fence/agents/rsb/Makefile b/fence/agents/rsb/Makefile
deleted file mode 100644
index 0f77de2..0000000
--- a/fence/agents/rsb/Makefile
+++ /dev/null
@@ -1,4 +0,0 @@
-TARGET= fence_rsb
-
-include ../../../make/defines.mk
-include $(OBJDIR)/make/fencebuild.mk
diff --git a/fence/agents/rsb/Makefile.am b/fence/agents/rsb/Makefile.am
new file mode 100644
index 0000000..f12c9a0
--- /dev/null
+++ b/fence/agents/rsb/Makefile.am
@@ -0,0 +1,12 @@
+MAINTAINERCLEANFILES	= Makefile.in
+
+TARGET			= fence_rsb
+
+EXTRA_DIST		= $(TARGET).py
+
+sbin_SCRIPTS		= $(TARGET)
+
+include $(top_srcdir)/make/fencebuild.mk
+
+clean-local:
+	rm -f $(TARGET)
diff --git a/fence/agents/sanbox2/Makefile b/fence/agents/sanbox2/Makefile
deleted file mode 100644
index 7f3fc0c..0000000
--- a/fence/agents/sanbox2/Makefile
+++ /dev/null
@@ -1,4 +0,0 @@
-TARGET= fence_sanbox2
-
-include ../../../make/defines.mk
-include $(OBJDIR)/make/fencebuild.mk
diff --git a/fence/agents/sanbox2/Makefile.am b/fence/agents/sanbox2/Makefile.am
new file mode 100644
index 0000000..b0d1b7b
--- /dev/null
+++ b/fence/agents/sanbox2/Makefile.am
@@ -0,0 +1,12 @@
+MAINTAINERCLEANFILES	= Makefile.in
+
+TARGET			= fence_sanbox2
+
+EXTRA_DIST		= $(TARGET).pl
+
+sbin_SCRIPTS		= $(TARGET)
+
+include $(top_srcdir)/make/fencebuild.mk
+
+clean-local:
+	rm -f $(TARGET)
diff --git a/fence/agents/scsi/Makefile b/fence/agents/scsi/Makefile
deleted file mode 100644
index 969e369..0000000
--- a/fence/agents/scsi/Makefile
+++ /dev/null
@@ -1,7 +0,0 @@
-include ../../../make/defines.mk
-
-TARGET= fence_scsi fence_scsi_test
-SBINDIRT=fence_scsi fence_scsi_test
-
-include $(OBJDIR)/make/fencebuild.mk
-
diff --git a/fence/agents/scsi/Makefile.am b/fence/agents/scsi/Makefile.am
new file mode 100644
index 0000000..0f74e8c
--- /dev/null
+++ b/fence/agents/scsi/Makefile.am
@@ -0,0 +1,12 @@
+MAINTAINERCLEANFILES	= Makefile.in
+
+TARGET			= fence_scsi fence_scsi_test
+
+EXTRA_DIST		= fence_scsi.pl fence_scsi_test.pl
+
+sbin_SCRIPTS		= $(TARGET)
+
+include $(top_srcdir)/make/fencebuild.mk
+
+clean-local:
+	rm -f $(TARGET)
diff --git a/fence/agents/virsh/Makefile b/fence/agents/virsh/Makefile
deleted file mode 100644
index bbea7b6..0000000
--- a/fence/agents/virsh/Makefile
+++ /dev/null
@@ -1,5 +0,0 @@
-include ../../../make/defines.mk
-
-TARGET= fence_virsh
-
-include $(OBJDIR)/make/fencebuild.mk
diff --git a/fence/agents/virsh/Makefile.am b/fence/agents/virsh/Makefile.am
new file mode 100644
index 0000000..0d79efd
--- /dev/null
+++ b/fence/agents/virsh/Makefile.am
@@ -0,0 +1,12 @@
+MAINTAINERCLEANFILES	= Makefile.in
+
+TARGET			= fence_virsh
+
+EXTRA_DIST		= $(TARGET).py
+
+sbin_SCRIPTS		= $(TARGET)
+
+include $(top_srcdir)/make/fencebuild.mk
+
+clean-local:
+	rm -f $(TARGET)
diff --git a/fence/agents/vixel/Makefile b/fence/agents/vixel/Makefile
deleted file mode 100644
index 6760e14..0000000
--- a/fence/agents/vixel/Makefile
+++ /dev/null
@@ -1,4 +0,0 @@
-TARGET= fence_vixel
-
-include ../../../make/defines.mk
-include $(OBJDIR)/make/fencebuild.mk
diff --git a/fence/agents/vixel/Makefile.am b/fence/agents/vixel/Makefile.am
new file mode 100644
index 0000000..7f9a623
--- /dev/null
+++ b/fence/agents/vixel/Makefile.am
@@ -0,0 +1,12 @@
+MAINTAINERCLEANFILES	= Makefile.in
+
+TARGET			= fence_vixel
+
+EXTRA_DIST		= $(TARGET).pl
+
+sbin_SCRIPTS		= $(TARGET)
+
+include $(top_srcdir)/make/fencebuild.mk
+
+clean-local:
+	rm -f $(TARGET)
diff --git a/fence/agents/vmware/Makefile b/fence/agents/vmware/Makefile
deleted file mode 100644
index 6d812a5..0000000
--- a/fence/agents/vmware/Makefile
+++ /dev/null
@@ -1,5 +0,0 @@
-include ../../../make/defines.mk
-
-TARGET= fence_vmware_helper fence_vmware
-
-include $(OBJDIR)/make/fencebuild.mk
diff --git a/fence/agents/vmware/Makefile.am b/fence/agents/vmware/Makefile.am
new file mode 100644
index 0000000..935735b
--- /dev/null
+++ b/fence/agents/vmware/Makefile.am
@@ -0,0 +1,12 @@
+MAINTAINERCLEANFILES	= Makefile.in
+
+TARGET			= fence_vmware_helper fence_vmware
+
+EXTRA_DIST		= fence_vmware_helper.pl fence_vmware.py
+
+sbin_SCRIPTS		= $(TARGET)
+
+include $(top_srcdir)/make/fencebuild.mk
+
+clean-local:
+	rm -f $(TARGET)
diff --git a/fence/agents/wti/Makefile b/fence/agents/wti/Makefile
deleted file mode 100644
index 2638d3f..0000000
--- a/fence/agents/wti/Makefile
+++ /dev/null
@@ -1,5 +0,0 @@
-include ../../../make/defines.mk
-
-TARGET= fence_wti
-
-include $(OBJDIR)/make/fencebuild.mk
diff --git a/fence/agents/wti/Makefile.am b/fence/agents/wti/Makefile.am
new file mode 100644
index 0000000..3704f72
--- /dev/null
+++ b/fence/agents/wti/Makefile.am
@@ -0,0 +1,12 @@
+MAINTAINERCLEANFILES	= Makefile.in
+
+TARGET			= fence_wti
+
+EXTRA_DIST		= $(TARGET).py
+
+sbin_SCRIPTS		= $(TARGET)
+
+include $(top_srcdir)/make/fencebuild.mk
+
+clean-local:
+	rm -f $(TARGET)
diff --git a/fence/agents/xcat/Makefile b/fence/agents/xcat/Makefile
deleted file mode 100644
index 0c1fed0..0000000
--- a/fence/agents/xcat/Makefile
+++ /dev/null
@@ -1,4 +0,0 @@
-TARGET= fence_xcat
-
-include ../../../make/defines.mk
-include $(OBJDIR)/make/fencebuild.mk
diff --git a/fence/agents/xcat/Makefile.am b/fence/agents/xcat/Makefile.am
new file mode 100644
index 0000000..46646f7
--- /dev/null
+++ b/fence/agents/xcat/Makefile.am
@@ -0,0 +1,12 @@
+MAINTAINERCLEANFILES	= Makefile.in
+
+TARGET			= fence_xcat
+
+EXTRA_DIST		= $(TARGET).pl
+
+sbin_SCRIPTS		= $(TARGET)
+
+include $(top_srcdir)/make/fencebuild.mk
+
+clean-local:
+	rm -f $(TARGET)
diff --git a/fence/agents/xvm/Makefile b/fence/agents/xvm/Makefile
deleted file mode 100644
index 6e6e4c9..0000000
--- a/fence/agents/xvm/Makefile
+++ /dev/null
@@ -1,66 +0,0 @@
-TARGET1= fence_xvm
-TARGET2= fence_xvmd
-TARGET3= testprog
-
-SBINDIRT=$(TARGET1) $(TARGET2)
-
-all: ${TARGET1} ${TARGET2}
-
-include ../../../make/defines.mk
-include $(OBJDIR)/make/cobj.mk
-include $(OBJDIR)/make/clean.mk
-include $(OBJDIR)/make/install.mk
-include $(OBJDIR)/make/uninstall.mk
-
-OBJS1=	fence_xvm.o \
-	ip_lookup.o
-
-OBJS2=	fence_xvmd.o \
-	virt.o \
-	options-ccs.o \
-	vm_states.o \
-	xml.o
-
-OBJS3=	xml-standalone.o
-
-SHAREDOBJS=	mcast.o \
-		simple_auth.o \
-		tcp.o \
-		options.o \
-		debug.o
-
-CFLAGS += -D_GNU_SOURCE
-CFLAGS += -Werror -Wstrict-prototypes -Wshadow
-CFLAGS += -I${ccsincdir} -I${cmanincdir}
-CFLAGS += -I${openaisincdir}
-CFLAGS += -I${logtincdir}
-CFLAGS += -I${virtincdir} -I${nssincdir} -I${nsprincdir}
-CFLAGS += `xml2-config --cflags`
-CFLAGS += -I${incdir}
-
-STANDALONE_CFLAGS += -DSTANDALONE
-
-LDFLAGS += -L${nsslibdir} -lnss3
-LDFLAGS += -L${logtlibdir} -llogthread
-LDFLAGS += -L${libdir}
-
-EXTRA_LDFLAGS += -L${ccslibdir} -lccs -L${cmanlibdir} -lcman
-EXTRA_LDFLAGS += -L${virtlibdir} -lvirt
-EXTRA_LDFLAGS += -L${openaislibdir} -lSaCkpt
-XML_LDFLAGS += `xml2-config --libs`
-
-${TARGET1}: ${SHAREDOBJS} ${OBJS1}
-	$(CC) -o $@ $^ $(LDFLAGS)
-
-${TARGET2}: ${SHAREDOBJS} ${OBJS2}
-	$(CC) -o $@ $^ $(EXTRA_LDFLAGS) $(XML_LDFLAGS) $(LDFLAGS)
-
-${TARGET3}: ${OBJS3}
-	$(CC) -o $@ $^ $(XML_LDFLAGS)
-
-clean: generalclean
-
--include $(OBJS1:.o=.d)
--include $(OBJS2:.o=.d)
--include $(OBJS3:.o=.d)
--include $(SHAREDOBJS:.o=.d)
diff --git a/fence/agents/xvm/Makefile.am b/fence/agents/xvm/Makefile.am
new file mode 100644
index 0000000..2a3ff88
--- /dev/null
+++ b/fence/agents/xvm/Makefile.am
@@ -0,0 +1,69 @@
+MAINTAINERCLEANFILES	= Makefile.in
+
+EXTRA_DIST		= README TODO tests/hvm.xml tests/linux.xml
+
+sbin_PROGRAMS		= fence_xvm fence_xvmd
+
+noinst_PROGRAMS		= testprog
+
+noinst_HEADERS		= debug.h \
+			  ip_lookup.h \
+			  mcast.h \
+			  options.h \
+			  simple_auth.h \
+			  tcp.h \
+			  virt.h \
+			  xvm.h
+
+sharedsources		= mcast.c \
+			  simple_auth.c \
+			  tcp.c \
+			  options.c \
+			  debug.c
+
+sharedcppflags		= -D_GNU_SOURCE
+
+sharedcflags		= $(nss_CFLAGS) $(logt_CFLAGS)
+
+sharedldflags		= $(nss_LIBS) $(logt_LIBS)
+
+fence_xvm_SOURCES	= $(sharedsources) \
+			  fence_xvm.c \
+			  ip_lookup.c
+
+fence_xvm_CPPFLAGS	= $(sharedcppflags)
+
+fence_xvm_CFLAGS	= $(sharedcflags)
+
+fence_xvm_LDFLAGS	= $(sharedldflags)
+
+fence_xvmd_SOURCES	= $(sharedsources) \
+			  fence_xvmd.c \
+			  virt.c \
+			  options-ccs.c \
+			  vm_states.c \
+			  xml.c
+
+fence_xvmd_CPPFLAGS	= $(sharedcppflags)
+
+fence_xvmd_CFLAGS	= $(sharedcflags) \
+			  $(virt_CFLAGS) \
+			  $(xml_CFLAGS) \
+			  $(cman_CFLAGS) \
+			  $(ccs_CFLAGS) \
+			  $(sackpt_CFLAGS)
+
+fence_xvmd_LDFLAGS	= $(sharedldflags) \
+			  $(virt_LIBS) \
+			  $(xml_LIBS) \
+			  $(cman_LIBS) \
+			  $(ccs_LIBS) \
+			  $(sackpt_LIBS)
+
+testprog_SOURCES	= xml.c
+
+testprog_CPPFLAGS	= -DSTANDALONE
+
+testprog_CFLAGS		= $(xml_CFLAGS)
+
+testprog_LDFLAGS	= $(xml_LIBS)
diff --git a/fence/agents/xvm/debug.c b/fence/agents/xvm/debug.c
index d8bd109..8cf00a3 100644
--- a/fence/agents/xvm/debug.c
+++ b/fence/agents/xvm/debug.c
@@ -1,3 +1,5 @@
+#include "clusterautoconfig.h"
+
 #include <stdio.h>
 #include "debug.h"
 
diff --git a/fence/agents/xvm/fence_xvm.c b/fence/agents/xvm/fence_xvm.c
index 3191718..029fb43 100644
--- a/fence/agents/xvm/fence_xvm.c
+++ b/fence/agents/xvm/fence_xvm.c
@@ -5,6 +5,8 @@
  *
  * Author: Lon Hohberger <lhh at redhat.com>
  */
+#include "clusterautoconfig.h"
+
 #include <stdio.h>
 #include <stdlib.h>
 #include <string.h>
@@ -345,7 +347,7 @@ main(int argc, char **argv)
 
 	if (args.flags & F_VERSION) {
 		printf("%s %s\n", basename(argv[0]), XVM_VERSION);
-		printf("fence release %s\n", RELEASE_VERSION);
+		printf("fence release %s\n", VERSION);
 		exit(0);
 	}
 
diff --git a/fence/agents/xvm/fence_xvmd.c b/fence/agents/xvm/fence_xvmd.c
index f2199d7..90af3ed 100644
--- a/fence/agents/xvm/fence_xvmd.c
+++ b/fence/agents/xvm/fence_xvmd.c
@@ -1,6 +1,8 @@
 /*
  * Author: Lon Hohberger <lhh at redhat.com>
  */
+#include "clusterautoconfig.h"
+
 #include <stdio.h>
 #include <stdlib.h>
 #include <string.h>
@@ -24,7 +26,7 @@
 #include <pthread.h>
 #define SYSLOG_NAMES
 #include <syslog.h>
-#include <virterror.h>
+#include <libvirt/virterror.h>
 #include <nss.h>
 #include <libgen.h>
 #include <ccs.h>
@@ -523,6 +525,8 @@ handle_remote_domain(cman_handle_t ch, void *h, fence_req_t *data,
 			return;
 		}
 
+#if 0
+		/* FIXME: must be ported to newer cman API */
 		fenced = 0;
 		cman_get_fenceinfo(ch, vst.s_owner, &fence_time, &fenced, NULL);
 		if (fenced == 0) {
@@ -533,7 +537,7 @@ handle_remote_domain(cman_handle_t ch, void *h, fence_req_t *data,
 
 		dbg_printf(1, "Node %d is dead & fenced\n", vst.s_owner);
 		ret = 0;
-					
+#endif					
 	} else if (vst.s_owner == my_id) {
 		dbg_printf(1, "I am the last owner of the domain\n");
 		ret = 0;
@@ -881,7 +885,7 @@ main(int argc, char **argv)
 
 	if (args.flags & F_VERSION) {
 		printf("%s %s\n", basename(argv[0]), XVM_VERSION);
-		printf("fence release %s\n", RELEASE_VERSION);
+		printf("fence release %s\n", VERSION);
 		logt_exit();
 		exit(0);
 	}
diff --git a/fence/agents/xvm/ip_lookup.c b/fence/agents/xvm/ip_lookup.c
index 3867c52..772b079 100644
--- a/fence/agents/xvm/ip_lookup.c
+++ b/fence/agents/xvm/ip_lookup.c
@@ -1,6 +1,8 @@
 /** @file
  * Build lists of IPs on the system, excepting loopback ipv6 link-local
  */
+#include "clusterautoconfig.h"
+
 #include <asm/types.h>
 #include <sys/types.h>
 #include <arpa/inet.h>
diff --git a/fence/agents/xvm/mcast.c b/fence/agents/xvm/mcast.c
index 1effa83..edb54fc 100644
--- a/fence/agents/xvm/mcast.c
+++ b/fence/agents/xvm/mcast.c
@@ -1,6 +1,8 @@
 /*
  * Author: Lon Hohberger <lhh at redhat.com>
  */
+#include "clusterautoconfig.h"
+
 #include <stdio.h>
 #include <stdlib.h>
 #include <string.h>
diff --git a/fence/agents/xvm/options-ccs.c b/fence/agents/xvm/options-ccs.c
index 01ca051..f1ef77e 100644
--- a/fence/agents/xvm/options-ccs.c
+++ b/fence/agents/xvm/options-ccs.c
@@ -1,3 +1,5 @@
+#include "clusterautoconfig.h"
+
 #include <stdio.h>
 #include <stdlib.h>
 #include <string.h>
diff --git a/fence/agents/xvm/options.c b/fence/agents/xvm/options.c
index 4a92179..7a0c126 100644
--- a/fence/agents/xvm/options.c
+++ b/fence/agents/xvm/options.c
@@ -1,3 +1,5 @@
+#include "clusterautoconfig.h"
+
 #include <stdio.h>
 #include <stdlib.h>
 #include <string.h>
diff --git a/fence/agents/xvm/simple_auth.c b/fence/agents/xvm/simple_auth.c
index 2d9b2e7..33726da 100644
--- a/fence/agents/xvm/simple_auth.c
+++ b/fence/agents/xvm/simple_auth.c
@@ -1,3 +1,5 @@
+#include "clusterautoconfig.h"
+
 #include <sys/types.h>
 #include <string.h>
 #include <stdlib.h>
diff --git a/fence/agents/xvm/tcp.c b/fence/agents/xvm/tcp.c
index 46aa844..9a8ccbb 100644
--- a/fence/agents/xvm/tcp.c
+++ b/fence/agents/xvm/tcp.c
@@ -3,6 +3,8 @@
  * @author Lon H. Hohberger <lhh at redhat.com>
  * @author Jeff Moyer <jmoyer at redhat.com>
  */
+#include "clusterautoconfig.h"
+
 #include <stdio.h>
 #include <stdlib.h>
 #include <string.h>
diff --git a/fence/agents/xvm/virt.c b/fence/agents/xvm/virt.c
index a836191..569628b 100644
--- a/fence/agents/xvm/virt.c
+++ b/fence/agents/xvm/virt.c
@@ -1,3 +1,5 @@
+#include "clusterautoconfig.h"
+
 #include <stdio.h>
 #include <sys/types.h>
 #include <stdlib.h>
diff --git a/fence/agents/xvm/vm_states.c b/fence/agents/xvm/vm_states.c
index 68272c6..ab24280 100644
--- a/fence/agents/xvm/vm_states.c
+++ b/fence/agents/xvm/vm_states.c
@@ -1,6 +1,8 @@
 /** @file
  * Distributed VM states using saCkpt interface
  */
+#include "clusterautoconfig.h"
+
 #include <string.h>
 #include <errno.h>
 #include <sys/types.h>
diff --git a/fence/agents/xvm/xml.c b/fence/agents/xvm/xml.c
index 2ed4a96..fad43e1 100644
--- a/fence/agents/xvm/xml.c
+++ b/fence/agents/xvm/xml.c
@@ -1,3 +1,5 @@
+#include "clusterautoconfig.h"
+
 #include <libxml/xmlmemory.h>
 #include <libxml/parser.h>
 #include <string.h>
@@ -7,6 +9,10 @@
 #include <stdlib.h>
 #include <unistd.h>
 #include <ctype.h>
+#ifdef STANDALONE
+#include <sys/types.h>
+#include <sys/stat.h>
+#endif
 
 #ifdef STANDALONE
 #define dbg_printf(x, fmt, args...) printf("<%d> " fmt, x, ##args)
diff --git a/fence/agents/zvm/Makefile b/fence/agents/zvm/Makefile
deleted file mode 100644
index 7f32889..0000000
--- a/fence/agents/zvm/Makefile
+++ /dev/null
@@ -1,4 +0,0 @@
-TARGET= fence_zvm
-
-include ../../../make/defines.mk
-include $(OBJDIR)/make/fencebuild.mk
diff --git a/fence/agents/zvm/Makefile.am b/fence/agents/zvm/Makefile.am
new file mode 100644
index 0000000..1e730af
--- /dev/null
+++ b/fence/agents/zvm/Makefile.am
@@ -0,0 +1,12 @@
+MAINTAINERCLEANFILES	= Makefile.in
+
+TARGET			= fence_zvm
+
+EXTRA_DIST		= $(TARGET).pl
+
+sbin_SCRIPTS		= $(TARGET)
+
+include $(top_srcdir)/make/fencebuild.mk
+
+clean-local:
+	rm -f $(TARGET)
diff --git a/fence/man/Makefile b/fence/man/Makefile
deleted file mode 100644
index 4f52854..0000000
--- a/fence/man/Makefile
+++ /dev/null
@@ -1,37 +0,0 @@
-TARGET=	fence_ack_manual.8 \
-	fence_alom.8 \
-	fence_apc.8 \
-	fence_apc_snmp.8 \
-	fence_baytech.8 \
-	fence_bladecenter.8 \
-	fence_brocade.8 \
-	fence_bullpap.8 \
-	fence_cisco_mds.8 \
-	fence_cpint.8 \
-	fence_drac.8 \
-	fence_egenera.8 \
-	fence_eps.8 \
-	fence_ibmblade.8 \
-	fence_ifmib.8 \
-	fence_ilo.8 \
-	fence_intelmodular.8 \
-	fence_ipmilan.8 \
-	fence_ldom.8 \
-	fence_mcdata.8 \
-	fence_rackswitch.8 \
-	fence_rib.8 \
-	fence_rsa.8 \
-	fence_rsb.8 \
-	fence_sanbox2.8 \
-	fence_scsi.8 \
-	fence_virsh.8 \
-	fence_vixel.8 \
-	fence_vmware.8 \
-	fence_wti.8 \
-	fence_xcat.8 \
-	fence_xvm.8 \
-	fence_xvmd.8 \
-	fence_zvm.8
-
-include ../../make/defines.mk
-include $(OBJDIR)/make/man.mk
diff --git a/fence/man/Makefile.am b/fence/man/Makefile.am
new file mode 100644
index 0000000..0d2bd72
--- /dev/null
+++ b/fence/man/Makefile.am
@@ -0,0 +1,36 @@
+MAINTAINERCLEANFILES	= Makefile.in
+
+dist_man_MANS		= fence_ack_manual.8 \
+			  fence_alom.8 \
+			  fence_apc.8 \
+			  fence_apc_snmp.8 \
+			  fence_baytech.8 \
+			  fence_bladecenter.8 \
+			  fence_brocade.8 \
+			  fence_bullpap.8 \
+			  fence_cisco_mds.8 \
+			  fence_cpint.8 \
+			  fence_drac.8 \
+			  fence_egenera.8 \
+			  fence_eps.8 \
+			  fence_ibmblade.8 \
+			  fence_ifmib.8 \
+			  fence_ilo.8 \
+			  fence_intelmodular.8 \
+			  fence_ipmilan.8 \
+			  fence_ldom.8 \
+			  fence_mcdata.8 \
+			  fence_rackswitch.8 \
+			  fence_rib.8 \
+			  fence_rsa.8 \
+			  fence_rsb.8 \
+			  fence_sanbox2.8 \
+			  fence_scsi.8 \
+			  fence_virsh.8 \
+			  fence_vixel.8 \
+			  fence_vmware.8 \
+			  fence_wti.8 \
+			  fence_xcat.8 \
+			  fence_xvm.8 \
+			  fence_xvmd.8 \
+			  fence_zvm.8
diff --git a/make/clean.mk b/make/clean.mk
deleted file mode 100644
index b31a3fa..0000000
--- a/make/clean.mk
+++ /dev/null
@@ -1,7 +0,0 @@
-generalclean:
-	rm -rf *~* *.o *.a *.so *.so.* a.out *.po *.s *.d *.pyc
-	rm -rf core core.* .depend cscope.* *.orig *.rej
-	rm -rf linux .*.o.cmd .*.ko.cmd *.mod.c .tmp_versions
-	rm -rf Module.symvers Module.markers .*.o.d modules.order
-	rm -rf ${TARGET} ${TARGETS} ${TARGET}_test
-	rm -rf ${TARGET1} ${TARGET2} ${TARGET3} ${TARGET4} ${TARGET5} ${TARGET6}
diff --git a/make/cobj.mk b/make/cobj.mk
deleted file mode 100644
index b398f6a..0000000
--- a/make/cobj.mk
+++ /dev/null
@@ -1,6 +0,0 @@
-%.o: $(S)/%.c
-	$(CC) $(CFLAGS) $(EXTRA_CFLAGS) $(REENT_CFLAGS) -c -o $@ $<
-
-# used by fence/agents/xvm
-%-standalone.o: $(S)/%.c
-	$(CC) $(CFLAGS) $(EXTRA_CFLAGS) $(STANDALONE_CFLAGS) -c -o $@ $<
diff --git a/make/defines.mk.input b/make/defines.mk.input
deleted file mode 100644
index 4cd4353..0000000
--- a/make/defines.mk.input
+++ /dev/null
@@ -1,49 +0,0 @@
-# Install Locations
-sbindir ?= ${DESTDIR}@SBINDIR@
-initddir ?= ${DESTDIR}@INITDDIR@
-libdir ?= ${DESTDIR}@LIBDIR@
-docdir ?= ${DESTDIR}@DOCDIR@
-logdir ?= ${DESTDIR}@LOGDIR@
-mandir ?= ${DESTDIR}@MANDIR@
-incdir ?= ${DESTDIR}@INCDIR@
-snmpbin ?= @SNMPBIN@
-
-# Build information
-
-# C Compiler defaults
-CC = @CC@
-AR = ar
-RANLIB = ranlib
-
-CFLAGS += @CFLAGS@ -I@SRCDIR@/make
-CFLAGS += -DDEFAULT_CONFIG_DIR=\"@CONFDIR@\"
-CFLAGS += -DLOGDIR=\"@LOGDIR@\" -DSYSLOGFACILITY=@SYSLOGFACILITY@ -DSYSLOGLEVEL=@SYSLOGLEVEL@
-LDFLAGS += @LDFLAGS@
-
-SRCDIR = @SRCDIR@
-OBJDIR = @OBJDIR@
-
-ccsincdir ?= @CCSINCDIR@
-ccslibdir ?= @CCSLIBDIR@
-cmanincdir ?= @CMANINCDIR@
-cmanlibdir ?= @CMANLIBDIR@
-logtincdir ?= @LOGTINCDIR@
-logtlibdir ?= @LOGTLIBDIR@
-nssincdir ?= @NSSINCDIR@
-nsslibdir ?= @NSSLIBDIR@
-nsprincdir ?= @NSPRINCDIR@
-nsprlibdir ?= @NSPRLIBDIR@
-openaisincdir ?= @OPENAISINCDIR@
-openaislibdir ?= @OPENAISLIBDIR@
-virtincdir ?= @VIRTINCDIR@
-virtlibdir ?= @VIRTLIBDIR@
-fence_agents ?= @FENCE_AGENTS@
-fenceagentslibdir ?= @FENCEAGENTSLIBDIR@
-experimental_build ?= @ENABLE_CRACK_OF_THE_DAY@
-legacy_code ?= @ENABLE_LEGACY_CODE@
-
-THISDIR = $(shell echo $(CURDIR) | sed -e 's|$(OBJDIR)/||g')
-S=$(SRCDIR)/$(THISDIR)
-
-UNINSTALL = perl @SRCDIR@/scripts/uninstall.pl
-FENCEPARSE = bash @SRCDIR@/scripts/fenceparse
diff --git a/make/fencebuild.mk b/make/fencebuild.mk
index 48145b7..c53d226 100644
--- a/make/fencebuild.mk
+++ b/make/fencebuild.mk
@@ -1,25 +1,11 @@
-ifndef FENCEAGENTSLIB
-	ifndef SBINDIRT
-		SBINDIRT=$(TARGET)
-	endif
-endif
-
-all: $(TARGET)
-
-include $(OBJDIR)/make/clean.mk
-include $(OBJDIR)/make/install.mk
-include $(OBJDIR)/make/uninstall.mk
-
 $(TARGET):
-	${FENCEPARSE} \
-		${SRCDIR}/make/copyright.cf REDHAT_COPYRIGHT \
-		${RELEASE_VERSION} \
-		$(S) $@ | \
+	sh $(top_srcdir)/scripts/fenceparse \
+		$(top_srcdir)/make/copyright.cf REDHAT_COPYRIGHT \
+		$(VERSION) \
+		$(abs_srcdir) $@ | \
 	sed \
-		-e 's#@FENCEAGENTSLIBDIR@#${fenceagentslibdir}#g' \
-		-e 's#@SNMPBIN@#${snmpbin}#g' \
-		-e 's#@LOGDIR@#${logdir}#g' \
-		-e 's#@SBINDIR@#${sbindir}#g' \
+		-e 's#@''FENCEAGENTSLIBDIR@#${FENCEAGENTSLIBDIR}#g' \
+		-e 's#@''SNMPBIN@#${SNMPBIN}#g' \
+		-e 's#@''LOGDIR@#${LOGDIR}#g' \
+		-e 's#@''SBINDIR@#${sbindir}#g' \
 	> $@
-
-clean: generalclean
diff --git a/make/install.mk b/make/install.mk
deleted file mode 100644
index f462e43..0000000
--- a/make/install.mk
+++ /dev/null
@@ -1,31 +0,0 @@
-install:
-ifdef SBINDIRT
-	install -d ${sbindir}
-	install -m755 ${SBINDIRT} ${sbindir}
-endif
-ifdef SBINSYMT
-	install -d ${sbindir}
-	cp -a ${SBINSYMT} ${sbindir}
-endif
-ifdef INITDT
-	install -d ${initddir}
-	set -e; \
-	for i in ${INITDT}; do \
-		if [ -f $$i ]; then \
-			install -m755 $$i ${initddir}; \
-		else \
-			install -m755 $(S)/$$i ${initddir}; \
-		fi; \
-	done
-endif
-ifdef FENCEAGENTSLIB
-	install -d ${DESTDIR}/${fenceagentslibdir}
-	install -m644 ${FENCEAGENTSLIB} ${DESTDIR}/${fenceagentslibdir}
-endif
-ifdef DOCS
-	install -d ${docdir}
-	set -e; \
-	for i in ${DOCS}; do \
-		install -m644 $(S)/$$i ${docdir}; \
-	done
-endif
diff --git a/make/man.mk b/make/man.mk
deleted file mode 100644
index 26f6401..0000000
--- a/make/man.mk
+++ /dev/null
@@ -1,18 +0,0 @@
-all:
-
-install:
-	set -e; \
-	for i in ${TARGET}; do \
-		p=`echo $$i | sed -e 's#.*\.##g'`; \
-		install -d ${mandir}/man$$p; \
-		install -m644 $(S)/$$i ${mandir}/man$$p; \
-	done
-
-uninstall:
-	set -e; \
-	for i in ${TARGET}; do \
-		p=`echo $$i | sed -e 's#.*\.##g'`; \
-		${UNINSTALL} $$i ${mandir}/man$$p; \
-	done
-
-clean:
diff --git a/make/official_release_version b/make/official_release_version
deleted file mode 100644
index e69de29..0000000
diff --git a/make/passthrough.mk b/make/passthrough.mk
deleted file mode 100644
index 979a86c..0000000
--- a/make/passthrough.mk
+++ /dev/null
@@ -1,7 +0,0 @@
-all: ${SUBDIRS}
-
-%:
-	set -e && \
-	for i in ${SUBDIRS}; do \
-		${MAKE} -C $$i $@; \
-	done
diff --git a/make/uninstall.mk b/make/uninstall.mk
deleted file mode 100644
index 33e40c3..0000000
--- a/make/uninstall.mk
+++ /dev/null
@@ -1,16 +0,0 @@
-uninstall:
-ifdef SBINDIRT
-	${UNINSTALL} ${SBINDIRT} ${sbindir}
-endif
-ifdef SBINSYMT
-	${UNINSTALL} ${SBINSYMT} ${sbindir}
-endif
-ifdef INITDT
-	${UNINSTALL} ${INITDT} ${initddir}
-endif
-ifdef FENCEAGENTSLIB
-	${UNINSTALL} ${FENCEAGENTSLIB}* ${DESTDIR}/${fenceagentslibdir}
-endif
-ifdef DOCS
-	${UNINSTALL} ${DOCS} ${docdir}
-endif
diff --git a/scripts/uninstall.pl b/scripts/uninstall.pl
deleted file mode 100644
index 4326e85..0000000
--- a/scripts/uninstall.pl
+++ /dev/null
@@ -1,71 +0,0 @@
-#!/usr/bin/perl
-
-##    Description: Basically the reverse of the install program, except it
-##                 only supports a list of files and a directory as arguments
-
-$| = 1;
-
-use Getopt::Std;
-
-# list all valid options here.  User will get errors if invalid options are 
-# specified on the command line
-getopts('hD');
-
-$args = 1;
-
-# We need at least two arguments to uninstall
-if(!defined($ARGV[1])) {
-    $args = 0;
-}
-    
-# if the user set the help flag or didn't provide enough args, print help 
-# and die.
-if(defined($opt_h) || ($args == 0)) {
-  $msg = "usage: $0 [OPTIONS] TARGET DIRECTORY\n";
-  $msg = $msg . "\t-D\tRemove specified directory if empty\n";
-  $msg = $msg . "\t-h\tDisplay this help message\n";
-  die $msg;
-}
-
-# find out how many command line arguments we have
-$length = $#ARGV;
-# We need a special case if there is only one file specified
-if($length > 1) {
-  @filelist = @ARGV;
-  $#filelist = $length - 1;
-}
-else {
-  @filelist = @ARGV[0];
-}
-
-# the last argument is the directory
-$dir = @ARGV[$length];
-
-# prepend the directory name to all files in the filelist
-$i = 0;
-print "Attempting to remove the following files from directory $dir/:\n";
-while($i < $length) {
-  print "@filelist[$i] ";
-  @filelist[$i] = "$dir/" . @filelist[$i];
-  $i++;
-}
-print "\n";
-  
-#print "Files:@filelist\n";
-#print "Directory: $dir\n";
-
-# delete the files in filelist
-$unlinked = unlink @filelist;
-if($unlinked < $length) {
-  print "Error! Unable to remove all files in $dir:\n\tYou may have to manually delete some of them.\n"
-}
-# if user specifed they want the directory deleted, try to delete it.  Print 
-# error message if not able to delete directory, including error.
-if(defined($opt_D)) {
-  $result = rmdir($dir);
-  if($result == FALSE) {
-    print "Error! Unable to remove directory $dir/:\n\t$!\n";
-  }
-}
-
-


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2009-06-23 19:24 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-06-23 19:24 fence-agents: master - build: convert to autoconf/automake/libtool Fabio M. Di Nitto

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).