From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 18371 invoked by alias); 8 Jun 2009 11:51:09 -0000 Received: (qmail 18362 invoked by alias); 8 Jun 2009 11:51:09 -0000 X-SWARE-Spam-Status: No, hits=1.5 required=5.0 tests=AWL,BAYES_05,HK_OBFDOM,J_CHICKENPOX_13,J_CHICKENPOX_41,J_CHICKENPOX_43,J_CHICKENPOX_63,J_CHICKENPOX_65,J_CHICKENPOX_75,J_CHICKENPOX_82,J_CHICKENPOX_92,SPF_HELO_PASS X-Spam-Status: No, hits=1.5 required=5.0 tests=AWL,BAYES_05,HK_OBFDOM,J_CHICKENPOX_13,J_CHICKENPOX_41,J_CHICKENPOX_43,J_CHICKENPOX_63,J_CHICKENPOX_65,J_CHICKENPOX_75,J_CHICKENPOX_82,J_CHICKENPOX_92,SPF_HELO_PASS X-Spam-Check-By: sourceware.org X-Spam-Checker-Version: SpamAssassin 3.2.5 (2008-06-10) on bastion2.fedora.phx.redhat.com Subject: fence: master - build: convert to autoconf/automake/libtool To: cluster-cvs-relay@redhat.com X-Project: Cluster Project X-Git-Module: fence.git X-Git-Refname: refs/heads/master X-Git-Reftype: branch X-Git-Oldrev: 4ba395aa28b46f4a99d467a53d918b0844c78d5a X-Git-Newrev: e3d0c9bcde468525c6e3fb068ea7d13ca2845b26 From: "Fabio M. Di Nitto" Message-Id: <20090608115036.9BC00120197@lists.fedorahosted.org> Date: Mon, 08 Jun 2009 11:51:00 -0000 X-Scanned-By: MIMEDefang 2.58 on 172.16.52.254 Mailing-List: contact cluster-cvs-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Post: List-Help: , Sender: cluster-cvs-owner@sourceware.org X-SW-Source: 2009-q2/txt/msg00477.txt.bz2 Gitweb: http://git.fedorahosted.org/git/fence.git?p=fence.git;a=commitdiff;h=e3d0c9bcde468525c6e3fb068ea7d13ca2845b26 Commit: e3d0c9bcde468525c6e3fb068ea7d13ca2845b26 Parent: 4ba395aa28b46f4a99d467a53d918b0844c78d5a Author: Fabio M. Di Nitto AuthorDate: Mon Jun 8 13:48:42 2009 +0200 Committer: Fabio M. Di Nitto CommitterDate: Mon Jun 8 13:48:42 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 --- .gitignore | 45 +++-- Makefile | 54 ------ Makefile.am | 28 +++ autogen.sh | 153 +++++++++++++++ bindings/Makefile | 4 - bindings/perl/Makefile | 4 - bindings/python/Makefile | 4 - configure | 402 --------------------------------------- configure.ac | 220 +++++++++++++++++++++ contrib/Makefile | 6 - doc/Makefile | 16 -- doc/Makefile.am | 10 + fence/Makefile | 4 - fence/Makefile.am | 4 + fence/fence_node/Makefile | 37 ---- fence/fence_node/Makefile.am | 15 ++ fence/fence_node/fence_node.c | 4 +- fence/fence_tool/Makefile | 36 ---- fence/fence_tool/Makefile.am | 13 ++ fence/fence_tool/fence_tool.c | 6 +- fence/fenced/Makefile | 39 ---- fence/fenced/Makefile.am | 20 ++ fence/fenced/config.c | 2 + fence/fenced/config.h | 4 +- fence/fenced/cpg.c | 2 + fence/fenced/logging.c | 2 + fence/fenced/main.c | 8 +- fence/fenced/member_cman.c | 2 + fence/fenced/recover.c | 2 + fence/include/Makefile.am | 3 + fence/libfence/Makefile | 20 -- fence/libfence/Makefile.am | 18 ++ fence/libfence/agent.c | 2 + fence/libfence/libfence.pc.in | 6 +- fence/libfenced/Makefile | 19 -- fence/libfenced/Makefile.am | 17 ++ fence/libfenced/libfenced.pc.in | 11 + fence/libfenced/main.c | 2 + fence/man/Makefile | 7 - fence/man/Makefile.am | 6 + make/binding-passthrough.mk | 7 - make/clean.mk | 7 - make/cobj.mk | 2 - make/defines.mk.input | 45 ----- make/install.mk | 34 ---- make/libs.mk | 59 ------ make/man.mk | 18 -- make/official_release_version | 1 - make/passthrough.mk | 7 - make/perl-binding-common.mk | 30 --- make/uninstall.mk | 22 -- scripts/uninstall.pl | 71 ------- 52 files changed, 581 insertions(+), 979 deletions(-) diff --git a/.gitignore b/.gitignore index 8b2a0ed..4c105a1 100644 --- a/.gitignore +++ b/.gitignore @@ -1,15 +1,32 @@ -make/defines.mk -.configure.sh -*.d -*.o -*.a -*.so* -*.lcrso -*.po -.*.*o.cmd -.tmp_versions -*.ko -Module.symvers -modules.order -*.mod.c +*.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 +*.la +*.lo +fence/fence_node/fence_node +fence/fence_tool/fence_tool +fence/fenced/fenced diff --git a/Makefile b/Makefile deleted file mode 100644 index 7c70258..0000000 --- a/Makefile +++ /dev/null @@ -1,54 +0,0 @@ -include make/defines.mk - -REALSUBDIRS = fence doc \ - bindings contrib - -SUBDIRS = $(filter-out \ - $(if ${without_fence},fence) \ - $(if ${without_bindings},bindings) \ - , $(REALSUBDIRS)) - -all: ${SUBDIRS} - -${SUBDIRS}: - [ -n "${without_$@}" ] || ${MAKE} -C $@ all - -# Dependencies - -fence: -bindings: -contrib: - -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..87b27d7 --- /dev/null +++ b/Makefile.am @@ -0,0 +1,28 @@ +EXTRA_DIST = autogen.sh + +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..647ec5e --- /dev/null +++ b/autogen.sh @@ -0,0 +1,153 @@ +#!/bin/sh +# Run this to generate all the initial makefiles, etc. + +testProgram() +{ + cmd=$1 + + if [ -z "$cmd" ]; then + return 1; + fi + + arch=`uname -s` + + # Make sure the which is in an if-block... on some platforms it throws exceptions + # + # The ERR trap is not executed if the failed command is part + # of an until or while loop, part of an if statement, part of a && + # or || list. + if + which $cmd /dev/null 2>&1 + then + : + else + return 1 + fi + + # The GNU standard is --version + if + $cmd --version /dev/null 2>&1 + then + return 0 + fi + + # Maybe it suppports -V instead + if + $cmd -V /dev/null 2>&1 + then + return 0 + fi + + # Nope, the program seems broken + return 1 +} + +arch=`uname -s` +# Disable the errors on FreeBSD until a fix can be found. +if [ ! "$arch" = "FreeBSD" ]; then +set -e +# +# All errors are fatal from here on out... +# The shell will complain and exit on any "uncaught" error code. +# +# +# And the trap will ensure sure some kind of error message comes out. +# +trap 'echo ""; echo "$0 exiting due to error (sorry!)." >&2' 0 +fi + +RC=0 + +gnu="ftp://ftp.gnu.org/pub/gnu" + +# Check for Autoconf +for command in autoconf autoconf213 autoconf253 autoconf259 +do + if + testProgram $command == 1 + then + autoconf=$command + autoheader=`echo "$autoconf" | sed -e 's/autoconf/autoheader/'` + autom4te=`echo "$autoconf" | sed -e 's/autoconf/autmo4te/'` + autoreconf=`echo "$autoconf" | sed -e 's/autoconf/autoreconf/'` + autoscan=`echo "$autoconf" | sed -e 's/autoconf/autoscan/'` + autoupdate=`echo "$autoconf" | sed -e 's/autoconf/autoupdate/'` + ifnames=`echo "$autoconf" | sed -e 's/autoconf/ifnames/'` + fi +done + +# Check for automake +for command in automake19 automake-1.9 automake +do + if + testProgram $command + then + automake=$command + aclocal=`echo "$automake" | sed -e 's/automake/aclocal/'` + + fi +done + +# Check for libtool +for command in libtoolize +do + if + testProgram $command + then + libtoolize=$command + fi +done + +if [ -z $autoconf ]; then + echo You must have autoconf installed to compile this package. + echo Download the appropriate package for your system, + echo or get the source tarball at: $gnu/autoconf/ + exit 1 + +elif [ -z $automake ]; then + echo You must have automake installed to compile this package. + echo Download the appropriate package for your system, + echo or get the source tarball at: $gnu/automake/ + exit 1 + +elif [ -z $libtoolize ]; then + echo You must have libtool installed to compile this package. + echo Download the appropriate package for your system, + echo or get the source tarball at: $gnu/libtool/ + exit 1 + +fi + +# Create local copies so that the incremental updates will work. +rm -f ./autoconf ./automake ./autoheader ./libtoolize +ln -s `which $autoconf` ./autoconf +ln -s `which $automake` ./automake +ln -s `which $autoheader` ./autoheader +ln -s `which $libtoolize` ./libtoolize + +printf "$autoconf:\t" +$autoconf --version | head -n 1 + +printf "$automake:\t" +$automake --version | head -n 1 + +printf "$libtoolize:\t" +$libtoolize --version | head -n 1 + +echo $libtoolize --copy --install +$libtoolize --copy --install + +echo $aclocal $ACLOCAL_FLAGS +$aclocal $ACLOCAL_FLAGS + +echo $autoheader +$autoheader + +echo $automake --add-missing --include-deps --copy +$automake --add-missing --include-deps --copy + +echo $autoconf +$autoconf + +echo Now run ./configure +trap '' 0 diff --git a/bindings/Makefile b/bindings/Makefile deleted file mode 100644 index 21085c2..0000000 --- a/bindings/Makefile +++ /dev/null @@ -1,4 +0,0 @@ -include ../make/defines.mk -include $(OBJDIR)/make/passthrough.mk - -SUBDIRS=perl python diff --git a/bindings/perl/Makefile b/bindings/perl/Makefile deleted file mode 100644 index 97dd817..0000000 --- a/bindings/perl/Makefile +++ /dev/null @@ -1,4 +0,0 @@ -include ../../make/defines.mk -include $(OBJDIR)/make/binding-passthrough.mk - -SUBDIRS= diff --git a/bindings/python/Makefile b/bindings/python/Makefile deleted file mode 100644 index 810b2d4..0000000 --- a/bindings/python/Makefile +++ /dev/null @@ -1,4 +0,0 @@ -include ../../make/defines.mk -include $(OBJDIR)/make/passthrough.mk - -SUBDIRS= diff --git a/configure b/configure deleted file mode 100755 index 1906740..0000000 --- a/configure +++ /dev/null @@ -1,402 +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, - fenceincdir => \$fenceincdir, - fencelibdir => \$fencelibdir, - logtincdir => \$logtincdir, - logtlibdir => \$logtlibdir, - corosyncincdir => \$corosyncincdir, - corosynclibdir => \$corosynclibdir, - mandir => \$mandir, - prefix => \$prefix, - sbindir => \$sbindir, - docdir => \$docdir, - logdir => \$logdir, - syslogfacility => \$syslogfacility, - sysloglevel => \$sysloglevel, - enable_crack_of_the_day => \$enable_crack_of_the_day, - enable_legacy_code => \$enable_legacy_code, - enable_contrib => \$enable_contrib, - somajor => \$somajor, - sominor => \$sominor, - release_version => \$release_version, - without_fence => \$without_fence, - without_bindings => \$without_bindings, -); - -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', - 'fenceincdir=s', - 'fencelibdir=s', - 'logtincdir=s', - 'logtlibdir=s', - 'corosyncincdir=s', - 'corosynclibdir=s', - 'mandir=s', - 'prefix=s', - 'sbindir=s', - 'docdir=s', - 'logdir=s', - 'syslogfacility=s', - 'sysloglevel=s', - 'somajor=s', - 'sominor=s', - 'release_version=s', - 'enable_crack_of_the_day', - 'enable_legacy_code', - 'enable_contrib', - 'without_fence', - 'without_bindings'); - -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 "--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: {incdir})\n"; - print "--ccslibdir=\tthe base directory for ccs libraries. (Default: {libdir})\n"; - print "--cmanincdir=\tthe base directory for cman include files. (Default: {incdir})\n"; - print "--cmanlibdir=\tthe base directory for cman libraries. (Default: {libdir})\n"; - print "--fenceincdir=\tthe base directory for fence include files. (Default: ./fence/libfence)\n"; - print "--fencelibdir=\tthe base directory for fence libraries. (Default: ./fence/libfence)\n"; - print "--logtincdir=\tthe base directory for logthread include files. (Default: {incdir})\n"; - print "--logtlibdir=\tthe base directory for logthread libraries. (Default: {libdir})\n"; - print "--corosyncincdir=\tthe base directory for corosync include files. (Default: {incdir})\n"; - print "--corosynclibdir=\tthe base directory for corosync libraries. (Default: {libdir}/corosync)\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_contrib\tEnable build of community contributed code/tools. (Default: no)\n"; - print "--enable_legacy_code\tEnable build of old/obsolete/unsupported code/tools. (Default: no)\n"; - print "--without_fence\tDisable fence building (Default: enabled)\n"; - print "--without_bindings\tDisable perl/python bindings building (Default: enabled)\n"; - exit $ret; -} - -sub symlinks { - my $dir = shift; - my $pattern = shift; - @args = "find $dir -type f -name $pattern"; - open (IFILE, "@args |"); - while () { - 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"); - symlinks("bindings","*.bindings"); - symlinks("bindings","*.pl"); - symlinks("bindings","*.xs"); - symlinks("bindings","*.PL"); - symlinks("bindings","MANIFEST"); - symlinks("bindings","typemap"); -} 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 (!$fenceincdir) { - $fenceincdir="${cdir}/fence/libfence"; -} -if (!$fencelibdir) { - $fencelibdir="${objdir}/fence/libfence"; -} -if (!$logtincdir) { - $logtincdir="${incdir}"; -} -if (!$logtlibdir) { - $logtlibdir="${libdir}"; -} -if (!$corosyncincdir) { - $corosyncincdir="${incdir}"; -} -if (!$corosynclibdir) { - $corosynclibdir="${libdir}/corosync"; -} -if (!$mandir) { - $mandir="${prefix}/share/man"; -} -if (!$sbindir) { - $sbindir="${prefix}/sbin"; -} -if (!$docdir) { - $docdir="${prefix}/share/doc/cluster"; -} -if (!$logdir) { - $logdir="/var/log/cluster"; -} -if (!$syslogfacility) { - $syslogfacility="LOG_LOCAL4"; -} -if (!$sysloglevel) { - $sysloglevel="LOG_INFO"; -} -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_contrib) { - $enable_contrib=""; -} -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 (!$without_fence) { - $without_fence=""; -} -if (!$without_bindings) { - $without_bindings=""; -} -if (defined($somajor) && not length $somajor) { - $somajor=""; -} -if (defined($sominor) && not length $sominor) { - $sominor=""; -} -if (defined($release_version) && not length $release_version) { - $release_version=""; -} - -open IFILE, "${objdir}/make/defines.mk" or die "Can't redirect stdout"; - -print OFILE "# This file was generated by configure from defines.mk.input\n"; - -while () { - 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/\@FENCEINCDIR\@/$fenceincdir/; - $_ =~ s/\@FENCELIBDIR\@/$fencelibdir/; - $_ =~ s/\@LOGTINCDIR\@/$logtincdir/; - $_ =~ s/\@LOGTLIBDIR\@/$logtlibdir/; - $_ =~ s/\@COROSYNCINCDIR\@/$corosyncincdir/; - $_ =~ s/\@COROSYNCLIBDIR\@/$corosynclibdir/; - $_ =~ s/\@MANDIR\@/$mandir/; - $_ =~ s/\@SBINDIR\@/$sbindir/; - $_ =~ s/\@PREFIX\@/$prefix/; - $_ =~ s/\@DOCDIR\@/$docdir/; - $_ =~ s/\@LOGDIR\@/$logdir/; - $_ =~ s/\@SYSLOGFACILITY\@/$syslogfacility/; - $_ =~ s/\@SYSLOGLEVEL\@/$sysloglevel/; - $_ =~ s/\@ENABLE_CRACK_OF_THE_DAY\@/$enable_crack_of_the_day/; - $_ =~ s/\@ENABLE_LEGACY_CODE\@/$enable_legacy_code/; - $_ =~ s/\@ENABLE_CONTRIB\@/$enable_contrib/; - $_ =~ s/\@DISABLE_FENCE\@/$without_fence/; - $_ =~ s/\@DISABLE_BINDINGS\@/$without_bindings/; - - print OFILE "$_\n"; -} - -close IFILE; - -if ((not defined($somajor)) || (not defined($sominor)) || (not defined($release_version))) { - - my $current_soname; - my $current_version; - if ( -f 'make/official_release_version' ) { - open OFFICIAL_VERSION, '<', "make/official_release_version"; - while () { - if ($_ =~ /SONAME/) { - $current_soname = $_; - } - if ($_ =~ /VERSION/) { - $current_version = $_; - } - } - close OFFICIAL_VERSION; - } - - if ((not defined($somajor)) || (not defined($sominor))) { - if (not defined($current_soname)) { - print "ERROR: SONAME not defined in make/official_release_version\n"; - exit 1; - } else { - $current_soname =~ s/.*"(.*)"\n/$1/; - my @release_soname = split /\./, $current_soname; - $somajor = $release_soname[0]; - $sominor = $release_soname[1]; - } - } - - 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 "ifndef SOMAJOR\n"; -print OFILE "SOMAJOR = $somajor\n"; -print OFILE "endif\n"; -print OFILE "ifndef SOMINOR\n"; -print OFILE "SOMINOR = $sominor\n"; -print OFILE "endif\n"; -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..203f0c6 --- /dev/null +++ b/configure.ac @@ -0,0 +1,220 @@ + +# Process this file with autoconf to produce a configure script. + +AC_PREREQ([2.63b]) +AC_INIT([fence], [master], [linux-cluster@redhat.com]) +AM_INIT_AUTOMAKE +LT_PREREQ([2.2.7]) +LT_INIT + +AC_CONFIG_MACRO_DIR([m4]) +AC_CONFIG_SRCDIR([fence/fence_node/fence_node.c]) +AC_CONFIG_HEADERS([make/clusterautoconfig.h]) + +AC_CANONICAL_HOST + +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([cfg],[libcfg]) +PKG_CHECK_MODULES([cpg],[libcpg]) +PKG_CHECK_MODULES([quorum],[libquorum]) + +# cluster libs +PKG_CHECK_MODULES([logt],[liblogthread]) +PKG_CHECK_MODULES([ccs],[libccs]) +PKG_CHECK_MODULES([cman],[libcman]) + +# external libs (no pkgconfig) +check_lib_no_libs pthread pthread_mutex_lock + +# Checks for header files. +AC_CHECK_HEADERS([fcntl.h limits.h stddef.h stdint.h stdlib.h string.h sys/ioctl.h sys/socket.h sys/time.h unistd.h]) + +# Checks for typedefs, structures, and compiler characteristics. +AC_C_INLINE +AC_TYPE_MODE_T +AC_TYPE_SIZE_T +AC_TYPE_UINT16_T +AC_TYPE_UINT32_T +AC_TYPE_UINT64_T + +# Checks for library functions. +AC_FUNC_FORK +AC_HEADER_MAJOR +AC_FUNC_MALLOC +AC_FUNC_REALLOC +AC_CHECK_FUNCS([ftruncate gettimeofday memset mkfifo select socket strcasecmp strdup strerror strstr]) + +# 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" ]) + +## random vars + +LOGDIR=${localstatedir}/log/cluster +CLUSTERVARRUN=${localstatedir}/run/cluster +CLUSTERVARLIB=${localstatedir}/lib/cluster + +## do subst + +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_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/include/Makefile + fence/libfence/Makefile + fence/libfence/libfence.pc + fence/libfenced/Makefile + fence/libfenced/libfenced.pc + fence/fenced/Makefile + fence/fence_node/Makefile + fence/fence_tool/Makefile + fence/man/Makefile + doc/Makefile + ]) + +AC_OUTPUT diff --git a/contrib/Makefile b/contrib/Makefile deleted file mode 100644 index 3f1d0e1..0000000 --- a/contrib/Makefile +++ /dev/null @@ -1,6 +0,0 @@ -include ../make/defines.mk -include $(OBJDIR)/make/passthrough.mk - -ifdef contrib_code -SUBDIRS= -endif 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 b3f9a61..0000000 --- a/fence/Makefile +++ /dev/null @@ -1,4 +0,0 @@ -include ../make/defines.mk -include $(OBJDIR)/make/passthrough.mk - -SUBDIRS=libfence libfenced fenced fence_node fence_tool man diff --git a/fence/Makefile.am b/fence/Makefile.am new file mode 100644 index 0000000..bcde822 --- /dev/null +++ b/fence/Makefile.am @@ -0,0 +1,4 @@ +MAINTAINERCLEANFILES = Makefile.in + +SUBDIRS = libfence libfenced fenced fence_node fence_tool man \ + include diff --git a/fence/fence_node/Makefile b/fence/fence_node/Makefile deleted file mode 100644 index 9f97089..0000000 --- a/fence/fence_node/Makefile +++ /dev/null @@ -1,37 +0,0 @@ -TARGET = fence_node - -SBINDIRT=$(TARGET) - -all: depends ${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= fence_node.o - -CFLAGS += -D_FILE_OFFSET_BITS=64 - -CFLAGS += -I${ccsincdir} -I${cmanincdir} -I${fenceincdir} -I${logtincdir} -CFLAGS += -I$(S)/../libfenced -CFLAGS += -I${incdir} - -LDFLAGS += -L${ccslibdir} -L${cmanlibdir} -L${fencelibdir} -lccs -lcman -lfence -LDFLAGS += -L${logtlibdir} -llogthread -LDFLAGS += -L../libfenced -lfenced -LDFLAGS += -L${libdir} - -LDDEPS += ../libfenced/libfenced.a - -${TARGET}: ${OBJS} ${LDDEPS} - $(CC) -o $@ $^ $(LDFLAGS) - -depends: - $(MAKE) -C ../libfence - $(MAKE) -C ../libfenced - -clean: generalclean - --include $(OBJS:.o=.d) diff --git a/fence/fence_node/Makefile.am b/fence/fence_node/Makefile.am new file mode 100644 index 0000000..70ecb39 --- /dev/null +++ b/fence/fence_node/Makefile.am @@ -0,0 +1,15 @@ +MAINTAINERCLEANFILES = Makefile.in + +sbin_PROGRAMS = fence_node + +fence_node_CPPFLAGS = -D_FILE_OFFSET_BITS=64 \ + -I$(top_srcdir)/fence/include \ + -I$(top_srcdir)/fence/libfence \ + -I$(top_srcdir)/fence/libfenced + +fence_node_CFLAGS = $(ccs_CFLAGS) $(logt_CFLAGS) $(cman_CFLAGS) + +fence_node_LDFLAGS = $(ccs_LIBS) $(logt_LIBS) $(cman_LIBS) + +fence_node_LDADD = $(top_builddir)/fence/libfence/libfence.la \ + $(top_builddir)/fence/libfenced/libfenced.la diff --git a/fence/fence_node/fence_node.c b/fence/fence_node/fence_node.c index 8ca2038..301d8b3 100644 --- a/fence/fence_node/fence_node.c +++ b/fence/fence_node/fence_node.c @@ -1,3 +1,5 @@ +#include "clusterautoconfig.h" + #include #include #include @@ -137,7 +139,7 @@ int main(int argc, char *argv[]) case 'V': printf("%s %s (built %s %s)\n", prog_name, - RELEASE_VERSION, __DATE__, __TIME__); + VERSION, __DATE__, __TIME__); printf("%s\n", REDHAT_COPYRIGHT); exit(EXIT_SUCCESS); break; diff --git a/fence/fence_tool/Makefile b/fence/fence_tool/Makefile deleted file mode 100644 index b21690a..0000000 --- a/fence/fence_tool/Makefile +++ /dev/null @@ -1,36 +0,0 @@ -TARGET = fence_tool - -SBINDIRT=$(TARGET) - -all: depends ${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=fence_tool.o - -CFLAGS += -D_FILE_OFFSET_BITS=64 -CFLAGS += -I${corosyncincdir} -CFLAGS += -I${ccsincdir} -CFLAGS += -I$(S)/../libfenced -I$(S)/../include -CFLAGS += -I${incdir} - -LDFLAGS += -L${corosynclibdir} -lquorum -LDFLAGS += -L${ccslibdir} -lccs -LDFLAGS += -L../libfenced -lfenced -LDFLAGS += -L${libdir} - -LDDEPS += ../libfenced/libfenced.a - -${TARGET}: ${OBJS} ${LDDEPS} - $(CC) -o $@ $^ $(LDFLAGS) - -depends: - $(MAKE) -C ../libfenced - -clean: generalclean - --include $(OBJS:.o=.d) diff --git a/fence/fence_tool/Makefile.am b/fence/fence_tool/Makefile.am new file mode 100644 index 0000000..89bc9c4 --- /dev/null +++ b/fence/fence_tool/Makefile.am @@ -0,0 +1,13 @@ +MAINTAINERCLEANFILES = Makefile.in + +sbin_PROGRAMS = fence_tool + +fence_tool_CPPFLAGS = -D_FILE_OFFSET_BITS=64 \ + -I$(top_srcdir)/fence/include \ + -I$(top_srcdir)/fence/libfenced + +fence_tool_CFLAGS = $(ccs_CFLAGS) $(quorum_CFLAGS) + +fence_tool_LDFLAGS = $(ccs_LIBS) $(quorum_LIBS) + +fence_tool_LDADD = $(top_builddir)/fence/libfenced/libfenced.la diff --git a/fence/fence_tool/fence_tool.c b/fence/fence_tool/fence_tool.c index 7a900c1..48dbe8b 100644 --- a/fence/fence_tool/fence_tool.c +++ b/fence/fence_tool/fence_tool.c @@ -1,3 +1,5 @@ +#include "clusterautoconfig.h" + #include #include #include @@ -75,7 +77,7 @@ static int do_write(int fd, void *buf, size_t count) return 0; } -#define LOCKFILE_NAME "/var/run/fenced.pid" +#define LOCKFILE_NAME CLUSTERVARRUN "/fenced.pid" static void check_fenced_running(void) { @@ -678,7 +680,7 @@ static void decode_arguments(int argc, char *argv[]) case 'V': printf("fence_tool %s (built %s %s)\n", - RELEASE_VERSION, __DATE__, __TIME__); + VERSION, __DATE__, __TIME__); printf("%s\n", REDHAT_COPYRIGHT); exit(EXIT_SUCCESS); break; diff --git a/fence/fenced/Makefile b/fence/fenced/Makefile deleted file mode 100644 index a4dd789..0000000 --- a/fence/fenced/Makefile +++ /dev/null @@ -1,39 +0,0 @@ -TARGET = fenced - -SBINDIRT=$(TARGET) - -all: depends ${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= config.o \ - cpg.o \ - main.o \ - member_cman.o \ - recover.o \ - logging.o - -CFLAGS += -D_FILE_OFFSET_BITS=64 -CFLAGS += -I$(S) -I$(S)/../include -I$(S)/../libfenced -CFLAGS += -I${ccsincdir} -I${logtincdir} -I${corosyncincdir} -CFLAGS += -I${fenceincdir} -CFLAGS += -I${incdir} - -LDFLAGS += -L${ccslibdir} -L${logtlibdir} -lccs -llogthread -LDFLAGS += -L${fencelibdir} -lfence -LDFLAGS += -L${corosynclibdir} -lcpg -lcfg -lquorum -lpthread -LDFLAGS += -L${libdir} - -${TARGET}: ${OBJS} ${LDDEPS} - $(CC) -o $@ $^ $(LDFLAGS) - -depends: - $(MAKE) -C ../libfence - -clean: generalclean - --include $(OBJS:.o=.d) diff --git a/fence/fenced/Makefile.am b/fence/fenced/Makefile.am new file mode 100644 index 0000000..3bb6dfe --- /dev/null +++ b/fence/fenced/Makefile.am @@ -0,0 +1,20 @@ +MAINTAINERCLEANFILES = Makefile.in + +sbin_PROGRAMS = fenced + +noinst_HEADERS = config.h fd.h fenced.h + +fenced_SOURCES = config.c cpg.c logging.c main.c member_cman.c recover.c + +fenced_CPPFLAGS = -D_FILE_OFFSET_BITS=64 \ + -I$(top_srcdir)/fence/include \ + -I$(top_srcdir)/fence/libfence \ + -I$(top_srcdir)/fence/libfenced + +fenced_CFLAGS = $(logt_CFLAGS) $(cfg_CFLAGS) \ + $(cpg_CFLAGS) $(quorum_CFLAGS) + +fenced_LDFLAGS = $(logt_LIBS) $(cfg_LIBS) $(cpg_LIBS) $(quorum_LIBS) \ + -lpthread + +fenced_LDADD = $(top_builddir)/fence/libfence/libfence.la diff --git a/fence/fenced/config.c b/fence/fenced/config.c index ce016cb..52d8a6f 100644 --- a/fence/fenced/config.c +++ b/fence/fenced/config.c @@ -1,3 +1,5 @@ +#include "clusterautoconfig.h" + #include "fd.h" #include "config.h" #include "ccs.h" diff --git a/fence/fenced/config.h b/fence/fenced/config.h index ee6f5cc..96c0078 100644 --- a/fence/fenced/config.h +++ b/fence/fenced/config.h @@ -1,13 +1,15 @@ #ifndef __CONFIG_DOT_H__ #define __CONFIG_DOT_H__ +#include "clusterautoconfig.h" + #define DEFAULT_DEBUG_LOGFILE 0 #define DEFAULT_CLEAN_START 0 #define DEFAULT_SKIP_UNDEFINED 0 #define DEFAULT_POST_JOIN_DELAY 6 #define DEFAULT_POST_FAIL_DELAY 0 #define DEFAULT_OVERRIDE_TIME 3 -#define DEFAULT_OVERRIDE_PATH "/var/run/cluster/fenced_override" +#define DEFAULT_OVERRIDE_PATH CLUSTERVARRUN "/fenced_override" extern int optd_debug_logfile; extern int optd_clean_start; diff --git a/fence/fenced/cpg.c b/fence/fenced/cpg.c index 91e2b59..9878866 100644 --- a/fence/fenced/cpg.c +++ b/fence/fenced/cpg.c @@ -1,3 +1,5 @@ +#include "clusterautoconfig.h" + #include "fd.h" #include "config.h" diff --git a/fence/fenced/logging.c b/fence/fenced/logging.c index a6a1a66..145d2fb 100644 --- a/fence/fenced/logging.c +++ b/fence/fenced/logging.c @@ -1,3 +1,5 @@ +#include "clusterautoconfig.h" + #include "fd.h" #include "config.h" #include "ccs.h" diff --git a/fence/fenced/main.c b/fence/fenced/main.c index 03734d6..c9794d3 100644 --- a/fence/fenced/main.c +++ b/fence/fenced/main.c @@ -1,9 +1,11 @@ +#include "clusterautoconfig.h" + #include "fd.h" #include "config.h" #include #include "copyright.cf" -#define LOCKFILE_NAME "/var/run/fenced.pid" +#define LOCKFILE_NAME CLUSTERVARRUN "/fenced.pid" #define CLIENT_NALLOC 32 static int client_maxi; @@ -925,7 +927,7 @@ static void read_arguments(int argc, char **argv) break; case 'V': - printf("fenced %s (built %s %s)\n", RELEASE_VERSION, + printf("fenced %s (built %s %s)\n", VERSION, __DATE__, __TIME__); printf("%s\n", REDHAT_COPYRIGHT); exit(EXIT_SUCCESS); @@ -981,7 +983,7 @@ int main(int argc, char **argv) } lockfile(); init_logging(); - log_level(LOG_INFO, "fenced %s started", RELEASE_VERSION); + log_level(LOG_INFO, "fenced %s started", VERSION); signal(SIGTERM, sigterm_handler); set_oom_adj(-16); diff --git a/fence/fenced/member_cman.c b/fence/fenced/member_cman.c index 176787a..b790103 100644 --- a/fence/fenced/member_cman.c +++ b/fence/fenced/member_cman.c @@ -1,3 +1,5 @@ +#include "clusterautoconfig.h" + #include "fd.h" #include "config.h" #include diff --git a/fence/fenced/recover.c b/fence/fenced/recover.c index 70a9047..b6efa96 100644 --- a/fence/fenced/recover.c +++ b/fence/fenced/recover.c @@ -1,3 +1,5 @@ +#include "clusterautoconfig.h" + #include "fd.h" #include "config.h" diff --git a/fence/include/Makefile.am b/fence/include/Makefile.am new file mode 100644 index 0000000..b2c3ce5 --- /dev/null +++ b/fence/include/Makefile.am @@ -0,0 +1,3 @@ +MAINTAINERCLEANFILES = Makefile.in + +noinst_HEADERS = linux_endian.h list.h diff --git a/fence/libfence/Makefile b/fence/libfence/Makefile deleted file mode 100644 index 93bf45c..0000000 --- a/fence/libfence/Makefile +++ /dev/null @@ -1,20 +0,0 @@ -TARGET= libfence - -SOMAJOR=4 -SOMINOR=0 - -OBJS= agent.o - -include ../../make/defines.mk -include $(OBJDIR)/make/libs.mk -include $(OBJDIR)/make/cobj.mk -include $(OBJDIR)/make/clean.mk -include $(OBJDIR)/make/install.mk -include $(OBJDIR)/make/uninstall.mk - -CFLAGS += -fPIC -CFLAGS += -I${ccsincdir} -CFLAGS += -I${incdir} - -LDFLAGS += -L${ccslibdir} -lccs -LDFLAGS += -L${libdir} diff --git a/fence/libfence/Makefile.am b/fence/libfence/Makefile.am new file mode 100644 index 0000000..dff9098 --- /dev/null +++ b/fence/libfence/Makefile.am @@ -0,0 +1,18 @@ +MAINTAINERCLEANFILES = Makefile.in + +libversion = 4:0:0 + +include_HEADERS = libfence.h + +pkgconfigdir = $(libdir)/pkgconfig + +pkgconfig_DATA = libfence.pc + +lib_LTLIBRARIES = libfence.la + +libfence_la_SOURCES = agent.c + +libfence_la_CFLAGS = $(css_CFLAGS) + +libfence_la_LDFLAGS = $(ccs_LIBS) \ + -version-info $(libversion) diff --git a/fence/libfence/agent.c b/fence/libfence/agent.c index 57163aa..4fa10cd 100644 --- a/fence/libfence/agent.c +++ b/fence/libfence/agent.c @@ -1,3 +1,5 @@ +#include "clusterautoconfig.h" + #include #include #include diff --git a/fence/libfence/libfence.pc.in b/fence/libfence/libfence.pc.in index 300ddf4..605f427 100644 --- a/fence/libfence/libfence.pc.in +++ b/fence/libfence/libfence.pc.in @@ -1,7 +1,7 @@ -prefix=@PREFIX@ +prefix=@prefix@ exec_prefix=${prefix} -libdir=@LIBDIR@ -includedir=@INCDIR@ +libdir=@libdir@ +includedir=${prefix}/include Name: libfence Version: @VERSION@ diff --git a/fence/libfenced/Makefile b/fence/libfenced/Makefile deleted file mode 100644 index 9081a5a..0000000 --- a/fence/libfenced/Makefile +++ /dev/null @@ -1,19 +0,0 @@ -TARGET= libfenced - -MAKESTATICLIB = 1 - -LIBDIRT=$(TARGET).a -INCDIRT=$(TARGET).h - -OBJS= main.o - -include ../../make/defines.mk -include $(OBJDIR)/make/libs.mk -include $(OBJDIR)/make/cobj.mk -include $(OBJDIR)/make/clean.mk -include $(OBJDIR)/make/install.mk -include $(OBJDIR)/make/uninstall.mk - -CFLAGS += -fPIC -CFLAGS += -I$(S)/../fenced -CFLAGS += -I${incdir} diff --git a/fence/libfenced/Makefile.am b/fence/libfenced/Makefile.am new file mode 100644 index 0000000..6834f55 --- /dev/null +++ b/fence/libfenced/Makefile.am @@ -0,0 +1,17 @@ +MAINTAINERCLEANFILES = Makefile.in + +libversion = 4:0:0 + +include_HEADERS = libfenced.h + +pkgconfigdir = $(libdir)/pkgconfig + +pkgconfig_DATA = libfenced.pc + +lib_LTLIBRARIES = libfenced.la + +libfenced_la_SOURCES = main.c + +libfenced_la_CPPFLAGS = -I$(top_srcdir)/fence/fenced + +libfenced_la_LDFLAGS = -version-info $(libversion) diff --git a/fence/libfenced/libfenced.pc.in b/fence/libfenced/libfenced.pc.in new file mode 100644 index 0000000..0a550fa --- /dev/null +++ b/fence/libfenced/libfenced.pc.in @@ -0,0 +1,11 @@ +prefix=@prefix@ +exec_prefix=${prefix} +libdir=@libdir@ +includedir=${prefix}/include + +Name: libfenced +Version: @VERSION@ +Description: Cluster Fence Daemon library +Requires: +Libs: -L${libdir} -lfenced +Cflags: -I${includedir} diff --git a/fence/libfenced/main.c b/fence/libfenced/main.c index d60647d..4f0d6cf 100644 --- a/fence/libfenced/main.c +++ b/fence/libfenced/main.c @@ -1,3 +1,5 @@ +#include "clusterautoconfig.h" + #include #include #include diff --git a/fence/man/Makefile b/fence/man/Makefile deleted file mode 100644 index 1d47c3f..0000000 --- a/fence/man/Makefile +++ /dev/null @@ -1,7 +0,0 @@ -TARGET= fence.8 \ - fenced.8 \ - fence_node.8 \ - fence_tool.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..a1d26eb --- /dev/null +++ b/fence/man/Makefile.am @@ -0,0 +1,6 @@ +MAINTAINERCLEANFILES = Makefile.in + +dist_man_MANS = fence.8 \ + fenced.8 \ + fence_node.8 \ + fence_tool.8 diff --git a/make/binding-passthrough.mk b/make/binding-passthrough.mk deleted file mode 100644 index 5f3a1bb..0000000 --- a/make/binding-passthrough.mk +++ /dev/null @@ -1,7 +0,0 @@ -all: ${SUBDIRS} - -%: - set -e && \ - for i in ${SUBDIRS}; do \ - ${MAKE} -C $$i -f Makefile.bindings $@; \ - done diff --git a/make/clean.mk b/make/clean.mk deleted file mode 100644 index adc25ca..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 ${TARGET}.pc - rm -rf ${TARGET1} ${TARGET2} ${TARGET3} ${TARGET4} ${TARGET5} ${TARGET6} diff --git a/make/cobj.mk b/make/cobj.mk deleted file mode 100644 index 1d8a03f..0000000 --- a/make/cobj.mk +++ /dev/null @@ -1,2 +0,0 @@ -%.o: $(S)/%.c - $(CC) $(CFLAGS) $(EXTRA_CFLAGS) $(REENT_CFLAGS) -c -o $@ $< diff --git a/make/defines.mk.input b/make/defines.mk.input deleted file mode 100644 index 381083f..0000000 --- a/make/defines.mk.input +++ /dev/null @@ -1,45 +0,0 @@ -# Install Locations -prefix ?= ${DESTDIR}@PREFIX@ -sbindir ?= ${DESTDIR}@SBINDIR@ -initddir ?= ${DESTDIR}@INITDDIR@ -libdir ?= ${DESTDIR}@LIBDIR@ -docdir ?= ${DESTDIR}@DOCDIR@ -logdir ?= ${DESTDIR}@LOGDIR@ -mandir ?= ${DESTDIR}@MANDIR@ -incdir ?= ${DESTDIR}@INCDIR@ -pkgconfigdir ?= ${DESTDIR}@LIBDIR@/pkgconfig - -# Build information - -# C Compiler defaults -CC = @CC@ -AR = ar -RANLIB = ranlib - -CFLAGS += @CFLAGS@ -I@SRCDIR@/make -CFLAGS += -DLOGDIR=\"@LOGDIR@\" -DSYSLOGFACILITY=@SYSLOGFACILITY@ -DSYSLOGLEVEL=@SYSLOGLEVEL@ -LDFLAGS += @LDFLAGS@ - -SRCDIR = @SRCDIR@ -OBJDIR = @OBJDIR@ - -ccsincdir ?= @CCSINCDIR@ -ccslibdir ?= @CCSLIBDIR@ -cmanincdir ?= @CMANINCDIR@ -cmanlibdir ?= @CMANLIBDIR@ -fenceincdir ?= @FENCEINCDIR@ -fencelibdir ?= @FENCELIBDIR@ -logtincdir ?= @LOGTINCDIR@ -logtlibdir ?= @LOGTLIBDIR@ -corosyncincdir ?= @COROSYNCINCDIR@ -corosynclibdir ?= @COROSYNCLIBDIR@ -experimental_build ?= @ENABLE_CRACK_OF_THE_DAY@ -legacy_code ?= @ENABLE_LEGACY_CODE@ -contrib_code ?= @ENABLE_CONTRIB@ -without_fence ?= @DISABLE_FENCE@ -without_bindings ?= @DISABLE_BINDINGS@ - -THISDIR = $(shell echo $(CURDIR) | sed -e 's|$(OBJDIR)/||g') -S=$(SRCDIR)/$(THISDIR) - -UNINSTALL = perl @SRCDIR@/scripts/uninstall.pl diff --git a/make/install.mk b/make/install.mk deleted file mode 100644 index de9a591..0000000 --- a/make/install.mk +++ /dev/null @@ -1,34 +0,0 @@ -install: -ifdef LIBDIRT - install -d ${libdir} - install -m644 ${LIBDIRT} ${libdir} -endif -ifdef LIBSYMT - cp -a ${LIBSYMT} ${libdir} -endif -ifdef INCDIRT - install -d ${incdir} - set -e; \ - for i in ${INCDIRT}; do \ - install -m644 $(S)/$$i ${incdir}; \ - done -endif -ifdef SBINDIRT - install -d ${sbindir} - install -m755 ${SBINDIRT} ${sbindir} -endif -ifdef SBINSYMT - install -d ${sbindir} - cp -a ${SBINSYMT} ${sbindir} -endif -ifdef DOCS - install -d ${docdir} - set -e; \ - for i in ${DOCS}; do \ - install -m644 $(S)/$$i ${docdir}; \ - done -endif -ifdef PKGCONF - install -d ${pkgconfigdir} - install -m644 ${PKGCONF} ${pkgconfigdir} -endif diff --git a/make/libs.mk b/make/libs.mk deleted file mode 100644 index 0cd8e82..0000000 --- a/make/libs.mk +++ /dev/null @@ -1,59 +0,0 @@ -# handle objects -ifndef OBJS - OBJS = $(TARGET).o -endif - -# we always build the static version -ifndef STATICLIB - STATICLIB = $(TARGET).a -endif - -# handle the shared version -ifndef MAKESTATICLIB - ifndef LIBDIRT - LIBDIRT=$(TARGET).a \ - $(TARGET).so.$(SOMAJOR).$(SOMINOR) - endif - ifndef LIBSYMT - LIBSYMT=$(TARGET).so \ - $(TARGET).so.$(SOMAJOR) - endif - ifndef INCDIRT - INCDIRT=$(TARGET).h - endif - ifndef SHAREDLIB - SHAREDLIB=$(TARGET).so.${SOMAJOR}.${SOMINOR} - endif - ifndef PKGCONF - PKGCONF=$(TARGET).pc - endif - -all: $(STATICLIB) $(SHAREDLIB) $(PKGCONF) - -$(SHAREDLIB): $(OBJS) - $(CC) -shared -o $@ -Wl,-soname=$(TARGET).so.$(SOMAJOR) $^ $(LDFLAGS) - ln -sf $(TARGET).so.$(SOMAJOR).$(SOMINOR) $(TARGET).so - ln -sf $(TARGET).so.$(SOMAJOR).$(SOMINOR) $(TARGET).so.$(SOMAJOR) - -$(PKGCONF): $(S)/$(PKGCONF).in - cat $(S)/$(PKGCONF).in | \ - sed \ - -e 's#@PREFIX@#${prefix}#g' \ - -e 's#@LIBDIR@#${libdir}#g' \ - -e 's#@INCDIR@#${incdir}#g' \ - -e 's#@VERSION@#${RELEASE_VERSION}#g' \ - > $@ - -else - -all: $(STATICLIB) - -endif - -$(STATICLIB): $(OBJS) - ${AR} cru $@ $^ - ${RANLIB} $@ - -clean: generalclean - --include $(OBJS:.o=.d) 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 211c0c2..0000000 --- a/make/official_release_version +++ /dev/null @@ -1 +0,0 @@ -SONAME "3.0" 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/perl-binding-common.mk b/make/perl-binding-common.mk deleted file mode 100644 index d51520c..0000000 --- a/make/perl-binding-common.mk +++ /dev/null @@ -1,30 +0,0 @@ -TARGET += Makefile \ - META.yml - -all: $(TARGET) - ${MAKE} LD_RUN_PATH=""; - -%.pm: $(S)/%.pm.in - cat $< | \ - sed \ - -e 's/@VERSION@/${RELEASE_VERSION}/g' \ - > $@ - -%.yml: $(S)/%.yml.in - cat $< | \ - sed \ - -e 's/@VERSION@/${RELEASE_VERSION}/g' \ - > $@ - -Makefile: META.yml $(PMTARGET) - perl Makefile.PL INC='$(CFLAGS)' LIBS='$(LDFLAGS)' INSTALLDIRS=vendor - -install: - ${MAKE} -f Makefile install - -uninstall: - echo uninstall target not supported yet - -clean: - -${MAKE} -f Makefile clean - rm -f $(TARGET) Makefile.old diff --git a/make/uninstall.mk b/make/uninstall.mk deleted file mode 100644 index caa0cfc..0000000 --- a/make/uninstall.mk +++ /dev/null @@ -1,22 +0,0 @@ -uninstall: -ifdef LIBDIRT - ${UNINSTALL} ${LIBDIRT} ${libdir} -endif -ifdef LIBSYMT - ${UNINSTALL} ${LIBSYMT} ${libdir} -endif -ifdef INCDIRT - ${UNINSTALL} ${INCDIRT} ${incdir} -endif -ifdef SBINDIRT - ${UNINSTALL} ${SBINDIRT} ${sbindir} -endif -ifdef SBINSYMT - ${UNINSTALL} ${SBINSYMT} ${sbindir} -endif -ifdef DOCS - ${UNINSTALL} ${DOCS} ${docdir} -endif -ifdef PKGCONF - ${UNINSTALL} ${PKGCONF} ${pkgconfigdir} -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"; - } -} - -