From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 16294 invoked by alias); 17 Jun 2009 14:25:07 -0000 Received: (qmail 16287 invoked by alias); 17 Jun 2009 14:25:06 -0000 X-SWARE-Spam-Status: No, hits=2.4 required=5.0 tests=AWL,BAYES_50,HK_OBFDOM,J_CHICKENPOX_13,J_CHICKENPOX_21,J_CHICKENPOX_41,J_CHICKENPOX_43,J_CHICKENPOX_54,J_CHICKENPOX_63,J_CHICKENPOX_65,J_CHICKENPOX_75,J_CHICKENPOX_92,SPF_HELO_PASS X-Spam-Status: No, hits=2.4 required=5.0 tests=AWL,BAYES_50,HK_OBFDOM,J_CHICKENPOX_13,J_CHICKENPOX_21,J_CHICKENPOX_41,J_CHICKENPOX_43,J_CHICKENPOX_54,J_CHICKENPOX_63,J_CHICKENPOX_65,J_CHICKENPOX_75,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: gfs2-utils: master - build: convert to autoconf/automake/libtool To: cluster-cvs-relay@redhat.com X-Project: Cluster Project X-Git-Module: gfs2-utils.git X-Git-Refname: refs/heads/master X-Git-Reftype: branch X-Git-Oldrev: 5572c03c5d09caf4b05747b1722bd75d64750298 X-Git-Newrev: 8eb292ccd2b1e5b10017e0b8daa79d675e29050f From: "Fabio M. Di Nitto" Message-Id: <20090617135738.A4D861201EA@lists.fedorahosted.org> Date: Wed, 17 Jun 2009 14:25: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/msg00551.txt.bz2 Gitweb: http://git.fedorahosted.org/git/gfs2-utils.git?p=gfs2-utils.git;a=commitdiff;h=8eb292ccd2b1e5b10017e0b8daa79d675e29050f Commit: 8eb292ccd2b1e5b10017e0b8daa79d675e29050f Parent: 5572c03c5d09caf4b05747b1722bd75d64750298 Author: Fabio M. Di Nitto AuthorDate: Mon Jun 15 17:17:28 2009 +0200 Committer: Fabio M. Di Nitto CommitterDate: Wed Jun 17 15:35:16 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 | 50 +++- Makefile | 54 ---- Makefile.am | 32 +++ autogen.sh | 153 +++++++++++ bindings/Makefile | 4 - bindings/perl/Makefile | 4 - bindings/python/Makefile | 4 - configure | 542 --------------------------------------- configure.ac | 292 +++++++++++++++++++++ contrib/Makefile | 6 - contrib/Makefile.am | 3 + contrib/askant/Makefile | 24 -- contrib/askant/Makefile.am | 57 ++++ doc/Makefile | 15 - doc/Makefile.am | 9 + gfs2/Makefile | 4 - gfs2/Makefile.am | 4 + gfs2/convert/Makefile | 33 --- gfs2/convert/Makefile.am | 9 + gfs2/convert/gfs2_convert.c | 4 +- gfs2/edit/Makefile | 37 --- gfs2/edit/Makefile.am | 17 ++ gfs2/edit/gfs2hex.c | 2 + gfs2/edit/hexedit.c | 4 +- gfs2/edit/savemeta.c | 2 + gfs2/fsck/Makefile | 62 ----- gfs2/fsck/Makefile.am | 27 ++ gfs2/fsck/eattr.c | 2 + gfs2/fsck/fs_recovery.c | 2 + gfs2/fsck/hash.c | 2 + gfs2/fsck/initialize.c | 2 + gfs2/fsck/inode_hash.c | 2 + gfs2/fsck/link.c | 2 + gfs2/fsck/lost_n_found.c | 2 + gfs2/fsck/main.c | 4 +- gfs2/fsck/metawalk.c | 2 + gfs2/fsck/pass1.c | 2 + gfs2/fsck/pass1b.c | 2 + gfs2/fsck/pass1c.c | 2 + gfs2/fsck/pass2.c | 2 + gfs2/fsck/pass3.c | 2 + gfs2/fsck/pass4.c | 2 + gfs2/fsck/pass5.c | 2 + gfs2/fsck/rgrepair.c | 2 + gfs2/fsck/test.c | 8 - gfs2/fsck/test_bitmap.c | 2 + gfs2/fsck/test_block_list.c | 2 + gfs2/fsck/util.c | 2 + gfs2/include/Makefile.am | 3 + gfs2/init.d/Makefile | 18 -- gfs2/libgfs2/Makefile | 33 --- gfs2/libgfs2/Makefile.am | 15 + gfs2/libgfs2/block_list.c | 2 + gfs2/libgfs2/buf.c | 2 + gfs2/libgfs2/device_geometry.c | 2 + gfs2/libgfs2/fs_bits.c | 2 + gfs2/libgfs2/fs_geometry.c | 2 + gfs2/libgfs2/fs_ops.c | 2 + gfs2/libgfs2/gfs1.c | 2 + gfs2/libgfs2/gfs2_disk_hash.c | 2 + gfs2/libgfs2/gfs2_log.c | 2 + gfs2/libgfs2/misc.c | 2 + gfs2/libgfs2/ondisk.c | 2 + gfs2/libgfs2/recovery.c | 2 + gfs2/libgfs2/rgrp.c | 2 + gfs2/libgfs2/size.c | 2 + gfs2/libgfs2/structures.c | 2 + gfs2/libgfs2/super.c | 2 + gfs2/man/Makefile | 13 - gfs2/man/Makefile.am | 12 + gfs2/mkfs/Makefile | 46 ---- gfs2/mkfs/Makefile.am | 36 +++ gfs2/mkfs/main.c | 2 + gfs2/mkfs/main_grow.c | 4 +- gfs2/mkfs/main_jadd.c | 4 +- gfs2/mkfs/main_mkfs.c | 4 +- gfs2/mount/Makefile | 34 --- gfs2/mount/Makefile.am | 22 ++ gfs2/mount/mount.gfs2.c | 4 +- gfs2/mount/mtab.c | 2 + gfs2/mount/ondisk1.c | 2 + gfs2/mount/util.c | 2 + gfs2/quota/Makefile | 35 --- gfs2/quota/Makefile.am | 14 + gfs2/quota/check.c | 2 + gfs2/quota/main.c | 4 +- gfs2/quota/names.c | 2 + gfs2/tool/Makefile | 37 --- gfs2/tool/Makefile.am | 13 + gfs2/tool/main.c | 4 +- gfs2/tool/misc.c | 2 + gfs2/tool/ondisk.c | 2 + gfs2/tool/sb.c | 2 + gfs2/tool/tune.c | 2 + group/Makefile | 4 - group/Makefile.am | 3 + group/gfs_control/Makefile | 31 --- group/gfs_control/Makefile.am | 9 + group/gfs_control/main.c | 4 +- group/gfs_controld/Makefile | 43 --- group/gfs_controld/Makefile.am | 24 ++ group/gfs_controld/config.c | 3 +- group/gfs_controld/gfs_daemon.h | 2 + group/gfs_controld/main.c | 6 +- group/include/Makefile.am | 3 + group/libgfscontrol/Makefile | 19 -- group/libgfscontrol/Makefile.am | 9 + group/libgfscontrol/main.c | 2 + group/man/Makefile | 4 - group/man/Makefile.am | 3 + make/binding-passthrough.mk | 7 - make/clean.mk | 7 - make/cobj.mk | 2 - make/defines.mk.input | 53 ---- make/install.mk | 45 ---- make/libs.mk | 47 ---- make/man.mk | 18 -- make/official_release_version | 1 - make/passthrough.mk | 7 - make/perl-binding-common.mk | 30 --- make/uninstall.mk | 25 -- scripts/uninstall.pl | 71 ----- 122 files changed, 939 insertions(+), 1454 deletions(-) diff --git a/.gitignore b/.gitignore index 4ca135d..cbda6f6 100644 --- a/.gitignore +++ b/.gitignore @@ -1,14 +1,38 @@ -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 +gfs2/convert/gfs2_convert +gfs2/edit/gfs2_edit +gfs2/fsck/fsck.gfs2 +gfs2/mkfs/mkfs.gfs2 +gfs2/mount/mount.gfs2 +gfs2/quota/gfs2_quota +gfs2/tool/gfs2_tool +group/gfs_control/gfs_control +group/gfs_controld/gfs_controld diff --git a/Makefile b/Makefile deleted file mode 100644 index 840b790..0000000 --- a/Makefile +++ /dev/null @@ -1,54 +0,0 @@ -include make/defines.mk - - -REALSUBDIRS = group gfs2 doc \ - bindings contrib - -SUBDIRS = $(filter-out \ - $(if ${without_group},group) \ - $(if ${without_gfs2},gfs2) \ - $(if ${without_bindings},bindings) \ - , $(REALSUBDIRS)) - -all: ${SUBDIRS} - -${SUBDIRS}: - [ -n "${without_$@}" ] || ${MAKE} -C $@ all - -group: -gfs2: group -contrib: gfs2 - -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..981319f --- /dev/null +++ b/Makefile.am @@ -0,0 +1,32 @@ +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 = group gfs2 doc + +if BUILD_CONTRIB +SUBDIRS += contrib +endif + +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 991f02e..0000000 --- a/configure +++ /dev/null @@ -1,542 +0,0 @@ -#!/usr/bin/perl -w - -use warnings; -use Getopt::Long; -use POSIX qw(uname); -use Cwd 'abs_path'; -use File::Basename; -use File::Spec; - -print "\nConfiguring Makefiles for your system...\n"; - -# Set a bunch of variables - -my @invoke = @ARGV; - -my $ret = 0; - -# this should be only the major version without the extra version -# eg. only the first 3 digits -my $required_kernelversion = '2.6.28'; - -my %options = ( - help => \$help, - cc => \$cc, - debug => \$debug, - cflags => \$cflags, - extracflags => \$extracflags, - ldflags => \$ldflags, - extraldflags => \$extraldflags, - objdir => \$objdir, - kernel_build => \$kernel_build, - kernel_src => \$kernel_src, - incdir => \$incdir, - libdir => \$libdir, - ccsincdir => \$ccsincdir, - ccslibdir => \$ccslibdir, - cmanincdir => \$cmanincdir, - cmanlibdir => \$cmanlibdir, - dlmcontrolincdir => \$dlmcontrolincdir, - dlmcontrollibdir => \$dlmcontrollibdir, - fencedincdir => \$fencedincdir, - fencedlibdir => \$fencedlibdir, - logtincdir => \$logtincdir, - logtlibdir => \$logtlibdir, - ncursesincdir => \$ncursesincdir, - ncurseslibdir => \$ncurseslibdir, - corosyncincdir => \$corosyncincdir, - corosynclibdir => \$corosynclibdir, - openaisincdir => \$openaisincdir, - openaislibdir => \$openaislibdir, - mandir => \$mandir, - prefix => \$prefix, - sbindir => \$sbindir, - initddir => \$initddir, - 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_group => \$without_group, - without_gfs2 => \$without_gfs2, - without_bindings => \$without_bindings, - disable_kernel_check => \$disable_kernel_check, -); - -my $err = &GetOptions (\%options, - 'help', - 'cc=s', - 'debug', - 'cflags=s', - 'extracflags=s', - 'ldflags=s', - 'extraldflags=s', - 'objdir=s', - 'kernel_build=s', - 'kernel_src=s', - 'incdir=s', - 'libdir=s', - 'ccsincdir=s', - 'ccslibdir=s', - 'cmanincdir=s', - 'cmanlibdir=s', - 'dlmcontrolincdir=s', - 'dlmcontrollibdir=s', - 'fencedincdir=s', - 'fencedlibdir=s', - 'logtincdir=s', - 'logtlibdir=s', - 'ncursesincdir=s', - 'ncurseslibdir=s', - 'corosyncincdir=s', - 'corosynclibdir=s', - 'openaisincdir=s', - 'openaislibdir=s', - 'mandir=s', - 'prefix=s', - 'sbindir=s', - 'initddir=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_group', - 'without_gfs2', - 'without_bindings', - 'disable_kernel_check'); - -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 "--kernel_build=\tthe directory containing the kernel object tree you wish to\n\t\tcompile against. (Default: /lib/modules/`uname -r`/build\n\t\tif available or /usr/src/linux as fallback)\n"; - print "--kernel_src=\tthe directory containing the kernel source you wish to\n\t\tcompile against. (Default: /lib/modules/`uname -r`/source\n\t\tif available or \$kernel_build as fallback)\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 "--dlmcontrolincdir=\tthe base directory for dlmcontrol include files. (Default: {incdir})\n"; - print "--dlmcontrollibdir=\tthe base directory for dlmcontrol libraries. (Default: {libdir})\n"; - print "--fencedincdir=\tthe base directory for fenced include files. (Default: {incdir})\n"; - print "--fencedlibdir=\tthe base directory for fenced libraries. (Default: {libdir})\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 "--ncursesincdir=\tthe base directory for ncurses include files. (Default: {incdir})\n"; - print "--ncurseslibdir=\tthe base directory for ncurses 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 "--openaisincdir=\tthe base directory for openais include files. (Default: {incdir})\n"; - print "--openaislibdir=\tthe base directory for openais libraries. (Default: {libdir}/openais)\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_group\tDisable group building (Default: enabled)\n"; - print "--without_gfs2\tDisable gfs2 building (Default: enabled)\n"; - print "--without_bindings\tDisable perl/python bindings building (Default: enabled)\n"; - print "--disable_kernel_check\tDisable kernel version check (Default: enabled)\n"; - exit $ret; -} - -sub kernel_version { - my $makefile_path = shift; - my $required_version = shift; - - print "\nChecking kernel:\n"; - - # add autoconf to the path - $makefile_path .= '/Makefile'; - my @version = split /\./, $required_version; - if ( -f $makefile_path ) { - # open the toplevel Makefile to feth VERSION, PATCHLEVEL and SUBLEVEL - open MAKEFILE, '<', $makefile_path; - while () { - $build_version = $1 if /^VERSION = (\d+)/; - $build_patchlevel = $1 if /^PATCHLEVEL = (\d+)/; - $build_sublevel = $1 if /^SUBLEVEL = (\d+)/; - last if (defined $build_version && defined $build_patchlevel && defined $build_sublevel); - } - close MAKEFILE; - # Warn and continue if kernel version was not found - if (!$build_version || !$build_patchlevel || !$build_sublevel) { - print " WARNING: Could not determine kernel version.\n"; - print " Build might fail!\n"; - return 1; - } - # checking VERSION, PATCHLEVEL and SUBLEVEL for the supplied kernel - if ($build_version >= $version[0] && - $build_patchlevel >= $version[1] && - $build_sublevel >= $version[2]) { - print " Current kernel version appears to be OK\n"; - return 1; - } else { - print " Current kernel version: ",$build_version, "." , $build_patchlevel, ".", $build_sublevel, "\n Minimum kernel version: ",$required_version,"\n"; - print " FAILED!\n"; - return 0; - } - } else { - print " Unable to find ($makefile_path)!\n"; - print " Make sure that:\n - the above path is correct\n"; - print " - your kernel is properly configured and prepared.\n"; - print " - kernel_build and kernel_src options to configure are set properly.\n"; - return 0; - } -} - -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"; -} - -my @un = POSIX::uname(); -if (!$kernel_build) { - if (-d "/lib/modules/$un[2]/build") { - $kernel_build="/lib/modules/$un[2]/build"; - } else { - $kernel_build="/usr/src/linux"; - } -} -if (!$kernel_src) { - if (-d "/lib/modules/$un[2]/source") { - $kernel_src="/lib/modules/$un[2]/source"; - } else { - $kernel_src=$kernel_build; - } -} -if (not $disable_kernel_check and !kernel_version($kernel_src,$required_kernelversion)) { - exit 1; -} -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 (!$dlmcontrolincdir) { - $dlmcontrolincdir="${incdir}"; -} -if (!$dlmcontrollibdir) { - $dlmcontrollibdir="${libdir}"; -} -if (!$fencedincdir) { - $fencedincdir="${incdir}"; -} -if (!$fencedlibdir) { - $fencedlibdir="${libdir}"; -} -if (!$logtincdir) { - $logtincdir="${incdir}"; -} -if (!$logtlibdir) { - $logtlibdir="${libdir}"; -} -if (!$ncursesincdir) { - $ncursesincdir="${incdir}"; -} -if (!$ncurseslibdir) { - $ncurseslibdir="${libdir}"; -} -if (!$corosyncincdir) { - $corosyncincdir="${incdir}"; -} -if (!$corosynclibdir) { - $corosynclibdir="${libdir}/corosync"; -} -if (!$openaisincdir) { - $openaisincdir="${incdir}"; -} -if (!$openaislibdir) { - $openaislibdir="${libdir}/openais"; -} -if (!$mandir) { - $mandir="${prefix}/share/man"; -} -if (!$sbindir) { - $sbindir="${prefix}/sbin"; -} -$relativesbin=File::Spec->abs2rel("/sbin", $sbindir); -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 (!$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_group) { - $without_group=""; -} -if (!$without_gfs2) { - $without_gfs2=""; -} -if (!$without_bindings) { - $without_bindings=""; -} -if (!$disable_kernel_check) { - $disable_kernel_check=0; -} -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/\@KERNEL_BUILD\@/$kernel_build/; - $_ =~ s/\@KERNEL_SRC\@/$kernel_src/; - $_ =~ s/\@INCDIR\@/$incdir/; - $_ =~ s/\@LIBDIR\@/$libdir/; - $_ =~ s/\@CCSINCDIR\@/$ccsincdir/; - $_ =~ s/\@CCSLIBDIR\@/$ccslibdir/; - $_ =~ s/\@CMANINCDIR\@/$cmanincdir/; - $_ =~ s/\@CMANLIBDIR\@/$cmanlibdir/; - $_ =~ s/\@DLMCONTROLINCDIR\@/$dlmcontrolincdir/; - $_ =~ s/\@DLMCONTROLLIBDIR\@/$dlmcontrollibdir/; - $_ =~ s/\@FENCEDINCDIR\@/$fencedincdir/; - $_ =~ s/\@FENCEDLIBDIR\@/$fencedlibdir/; - $_ =~ s/\@LOGTINCDIR\@/$logtincdir/; - $_ =~ s/\@LOGTLIBDIR\@/$logtlibdir/; - $_ =~ s/\@NCURSESINCDIR\@/$ncursesincdir/; - $_ =~ s/\@NCURSESLIBDIR\@/$ncurseslibdir/; - $_ =~ s/\@COROSYNCINCDIR\@/$corosyncincdir/; - $_ =~ s/\@COROSYNCLIBDIR\@/$corosynclibdir/; - $_ =~ s/\@OPENAISINCDIR\@/$openaisincdir/; - $_ =~ s/\@OPENAISLIBDIR\@/$openaislibdir/; - $_ =~ s/\@MANDIR\@/$mandir/; - $_ =~ s/\@SBINDIR\@/$sbindir/; - $_ =~ s/\@RELATIVESBIN\@/$relativesbin/; - $_ =~ s/\@PREFIX\@/$prefix/; - $_ =~ s/\@INITDDIR\@/$initddir/; - $_ =~ 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_GROUP\@/$without_group/; - $_ =~ s/\@DISABLE_GFS2\@/$without_gfs2/; - $_ =~ 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..662c17b --- /dev/null +++ b/configure.ac @@ -0,0 +1,292 @@ + +# Process this file with autoconf to produce a configure script. + +AC_PREREQ([2.63b]) +AC_INIT([gfs2-utils], [master], [linux-cluster@redhat.com]) +AM_INIT_AUTOMAKE +LT_PREREQ([2.2.7]) +LT_INIT +AM_PATH_PYTHON + +AC_CONFIG_MACRO_DIR([m4]) +AC_CONFIG_SRCDIR([group/gfs_controld/config.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 +} + +# check kernel headers path +uname="$(uname -r)" +if test -d "/lib/modules/$uname/source" -o -L "/lib/modules/$uname/source"; then + DEFAULT_KERNEL_DIR="/lib/modules/$uname/source" +elif test -d "/lib/modules/$uname/build" -o -L "/lib/modules/$uname -r/build"; then + DEFAULT_KERNEL_DIR="/lib/modules/$uname/build" +else + DEFAULT_KERNEL_DIR="/usr/src/linux" +fi + +# 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_ENABLE([contrib], + [ --enable-contrib enable contrib build. ], + [ default="no" ]) + +AC_ARG_WITH([kernel], + [ --with-kernel=path path to kernel source. ], + [ KERNEL_DIR="$withval" ], + [ KERNEL_DIR="$DEFAULT_KERNEL_DIR" ]) + +KERNEL_CPPFLAGS="-I$KERNEL_DIR/include" + +PKG_CHECK_MODULES([corosync],[corosync]) +PKG_CHECK_MODULES([cpg],[libcpg]) +PKG_CHECK_MODULES([sackpt],[libSaCkpt]) +PKG_CHECK_MODULES([logt],[liblogthread]) +PKG_CHECK_MODULES([ccs],[libccs]) +PKG_CHECK_MODULES([cfg],[libcfg]) +PKG_CHECK_MODULES([fenced],[libfenced]) +PKG_CHECK_MODULES([dlmcontrol],[libdlmcontrol]) + +# old versions of ncurses don't ship pkg-config files +PKG_CHECK_MODULES([ncurses],[ncurses],, + [check_lib_no_libs ncurses printw]) + +if test -z "$ncurses_CFLAGS" && test -z "$ncurses_LIBS"; then + ncurses_LIBS=-lncurses +fi + +# external libs (no pkgconfig) +check_lib_no_libs pthread pthread_mutex_lock + +# Checks for header files. + +AC_CHECK_HEADERS([arpa/inet.h fcntl.h inttypes.h libintl.h limits.h locale.h mntent.h netdb.h netinet/in.h stddef.h stdint.h stdlib.h string.h sys/file.h sys/ioctl.h sys/mount.h sys/param.h sys/socket.h sys/time.h sys/vfs.h syslog.h termios.h unistd.h]) + +BACKUP_CPPFLAGS="$CPPFLAGS" +CPPFLAGS="$KERNEL_CPPFLAGS" + +# check kernel headers +# 2.6.26 adds dlm_plock.h that's our checking barrier, instead +# of implementing some insane kernel version checks +AC_CHECK_HEADERS([linux/dlmconstants.h linux/dlm_plock.h linux/kdev_t.h linux/limits.h linux/types.h],, + [AC_MSG_ERROR([Unable to find required kernel headers. +Make sure to install kernel headers 2.6.26 (or higher) or use --with-kernel=path +configure option to point to the kernel source.])]) + +AC_CHECK_HEADERS([linux/gfs2_ondisk.h], + [AC_CHECK_MEMBERS([struct gfs2_sb.sb_uuid],, + [AC_MSG_ERROR([Unable to find gfs2 uuid support in your headers. +Please update your kernel headers to a more recent version])], + [#include ])], + [AC_MSG_ERROR([Unable to find required kernel headers. +Make sure to install kernel headers 2.6.26 (or higher) or use --with-kernel=path +configure option to point to the kernel source.])]) + +CPPFLAGS="$BACKUP_CPPFLAGS" + +# Checks for typedefs, structures, and compiler characteristics. +AC_C_INLINE +AC_TYPE_INT64_T +AC_TYPE_MODE_T +AC_TYPE_OFF_T +AC_TYPE_PID_T +AC_TYPE_SIZE_T +AC_TYPE_SSIZE_T +AC_STRUCT_ST_BLOCKS +AC_TYPE_UINT16_T +AC_TYPE_UINT32_T +AC_TYPE_UINT64_T +AC_TYPE_UINT8_T + +# Checks for library functions. +AC_FUNC_CHOWN +AC_FUNC_FORK +AC_FUNC_LSTAT_FOLLOWS_SLASHED_SYMLINK +AC_HEADER_MAJOR +AC_FUNC_MALLOC +AC_FUNC_REALLOC +AC_CHECK_FUNCS([ftruncate gettimeofday memset realpath rmdir select setlocale socket strcasecmp strchr strdup strerror strstr]) + +## 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]) + +AM_CONDITIONAL(BUILD_CONTRIB, test "x${enable_contrib}" = xyes) + +## *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="$KERNEL_CPPFLAGS -I\$(top_builddir)/make -I\$(top_srcdir)/make \ + -I. $ENV_CPPFLAGS" +LDFLAGS="$ENV_LDFLAGS" + +AC_CONFIG_FILES([Makefile + group/Makefile + group/libgfscontrol/Makefile + group/gfs_control/Makefile + group/gfs_controld/Makefile + group/man/Makefile + group/include/Makefile + gfs2/Makefile + gfs2/include/Makefile + gfs2/libgfs2/Makefile + gfs2/convert/Makefile + gfs2/edit/Makefile + gfs2/fsck/Makefile + gfs2/mkfs/Makefile + gfs2/mount/Makefile + gfs2/quota/Makefile + gfs2/tool/Makefile + gfs2/man/Makefile + contrib/Makefile + contrib/askant/Makefile + doc/Makefile + ]) + +AC_OUTPUT diff --git a/contrib/Makefile b/contrib/Makefile deleted file mode 100644 index 5504bd1..0000000 --- a/contrib/Makefile +++ /dev/null @@ -1,6 +0,0 @@ -include ../make/defines.mk -include $(OBJDIR)/make/passthrough.mk - -ifdef contrib_code -SUBDIRS=askant -endif diff --git a/contrib/Makefile.am b/contrib/Makefile.am new file mode 100644 index 0000000..28b39d5 --- /dev/null +++ b/contrib/Makefile.am @@ -0,0 +1,3 @@ +MAINTAINERCLEANFILES = Makefile.in + +SUBDIRS = askant diff --git a/contrib/askant/Makefile b/contrib/askant/Makefile deleted file mode 100644 index 9ba53df..0000000 --- a/contrib/askant/Makefile +++ /dev/null @@ -1,24 +0,0 @@ -include ../../make/defines.mk - -all: build - -include $(OBJDIR)/make/clean.mk - -CFLAGS += -I$(SRCDIR)/gfs2/libgfs2 -CFLAGS += -I$(SRCDIR)/gfs2/include - -LDFLAGS += -L$(OBJDIR)/gfs2/libgfs2 - -build: - CFLAGS="$(CFLAGS)" LDFLAGS="$(LDFLAGS)" python $(S)/setup.py build - -install: - python $(S)/setup.py install --root $(DESTDIR) - -uninstall: - @echo UNINSTALL TARGET UNSUPPORTED - -clean: - python $(S)/setup.py clean - rm -rf askant/*.pyc - rm -rf build diff --git a/contrib/askant/Makefile.am b/contrib/askant/Makefile.am new file mode 100644 index 0000000..59b4309 --- /dev/null +++ b/contrib/askant/Makefile.am @@ -0,0 +1,57 @@ +MAINTAINERCLEANFILES = Makefile.in + +EXTRA_DIST = setup.py INSTALL PLUGINAPI README \ + scripts/askant \ + askant/__init__.py askant/about.py \ + askant/askant.py askant/blktrace.py \ + askant/commands.py askant/sysfs.py \ + askant/fs/__init__.py \ + fsplugins/__init__.py \ + fsplugins/gfs2/gfs2.c fsplugins/gfs2/gfs2.h \ + fsplugins/gfs2/gfs2module.c + +CFLAGS += -I$(top_srcdir)/gfs2/libgfs2 +CFLAGS += -I$(top_srcdir)/gfs2/include + +LDFLAGS += -L$(abs_builddir)/$(top_builddir)/gfs2/libgfs2/.libs + +all-local: linkcode + CFLAGS="$(CFLAGS)" LDFLAGS="$(LDFLAGS)" \ + $(PYTHON) setup.py build + +install-exec-local: linkcode + if [ -n "$(DESTDIR)" ]; then \ + python setup.py install --root $(DESTDIR); \ + else \ + python setup.py install --prefix $(prefix); \ + fi + +uninstall-local: + if [ -n "$(DESTDIR)" ]; then \ + cd $(DESTDIR)/$(bindir) && \ + rm -f askant; \ + cd $(DESTDIR)/$(pythondir) && \ + rm -rf askant && rm askant*.egg-info; \ + else \ + cd $(prefix)/$(bindir) && \ + rm -f askant; \ + cd $(prefix)/$(pythondir) && \ + rm -rf askant && rm askant*.egg-info; \ + fi + +linkcode: Makefile + if [ ! -e setup.py ]; then \ + touch linkcode; \ + cd $(srcdir); \ + find . -type d -exec mkdir -p $(abs_builddir)/{} \; ; \ + find . -type f -exec ln -sf $(abs_srcdir)/{} $(abs_builddir)/{} \; ; \ + fi + +clean-local: + -$(PYTHON) setup.py clean + rm -rf askant/*.pyc + rm -rf build + if [ -e linkcode ]; then \ + find . -type l -exec rm -f {} \; ; \ + rm -rf askant fsplugins scripts linkcode; \ + fi diff --git a/doc/Makefile b/doc/Makefile deleted file mode 100644 index 8665d14..0000000 --- a/doc/Makefile +++ /dev/null @@ -1,15 +0,0 @@ -DOCS = gfs2.txt \ - journaling.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..05ec222 --- /dev/null +++ b/doc/Makefile.am @@ -0,0 +1,9 @@ +MAINTAINERCLEANFILES = Makefile.in + +dist_doc_DATA = gfs2.txt \ + journaling.txt \ + usage.txt \ + COPYING.applications \ + COPYING.libraries \ + COPYRIGHT \ + README.licence diff --git a/gfs2/Makefile b/gfs2/Makefile deleted file mode 100644 index 7daf231..0000000 --- a/gfs2/Makefile +++ /dev/null @@ -1,4 +0,0 @@ -include ../make/defines.mk -include $(OBJDIR)/make/passthrough.mk - -SUBDIRS=libgfs2 convert edit fsck mkfs mount quota tool man init.d diff --git a/gfs2/Makefile.am b/gfs2/Makefile.am new file mode 100644 index 0000000..d7c969d --- /dev/null +++ b/gfs2/Makefile.am @@ -0,0 +1,4 @@ +MAINTAINERCLEANFILES = Makefile.in + +SUBDIRS = libgfs2 convert edit fsck mkfs mount quota tool man \ + include #init.d diff --git a/gfs2/convert/Makefile b/gfs2/convert/Makefile deleted file mode 100644 index eddb79a..0000000 --- a/gfs2/convert/Makefile +++ /dev/null @@ -1,33 +0,0 @@ -TARGET= gfs2_convert - -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= gfs2_convert.o - -CFLAGS += -D_FILE_OFFSET_BITS=64 -DHELPER_PROGRAM -CFLAGS += -I${KERNEL_SRC}/fs/gfs2/ -I${KERNEL_SRC}/include/ -CFLAGS += -I$(S)/../include -I$(S)/../libgfs2 -CFLAGS += -I${incdir} - -LDFLAGS += -L../libgfs2 -lgfs2 -LDFLAGS += -L${libdir} - -LDDEPS += ../libgfs2/libgfs2.a - -${TARGET}: ${OBJS} ${LDDEPS} - $(CC) -o $@ $^ $(LDFLAGS) - -depends: - $(MAKE) -C ../libgfs2 all - -clean: generalclean - --include $(OBJS:.o=.d) diff --git a/gfs2/convert/Makefile.am b/gfs2/convert/Makefile.am new file mode 100644 index 0000000..eb3c330 --- /dev/null +++ b/gfs2/convert/Makefile.am @@ -0,0 +1,9 @@ +MAINTAINERCLEANFILES = Makefile.in + +sbin_PROGRAMS = gfs2_convert + +gfs2_convert_CPPFLAGS = -D_FILE_OFFSET_BITS=64 -DHELPER_PROGRAM \ + -I$(top_srcdir)/gfs2/include \ + -I$(top_srcdir)/gfs2/libgfs2 + +gfs2_convert_LDADD = $(top_builddir)/gfs2/libgfs2/libgfs2.la diff --git a/gfs2/convert/gfs2_convert.c b/gfs2/convert/gfs2_convert.c index 2f47f94..c795abc 100644 --- a/gfs2/convert/gfs2_convert.c +++ b/gfs2/convert/gfs2_convert.c @@ -6,6 +6,8 @@ ****************************************************************************** *****************************************************************************/ +#include "clusterautoconfig.h" + #include #include #include @@ -1197,7 +1199,7 @@ static void give_warning(void) /* ------------------------------------------------------------------------- */ static void version(void) { - log_notice("gfs2_convert version %s (built %s %s)\n", RELEASE_VERSION, + log_notice("gfs2_convert version %s (built %s %s)\n", VERSION, __DATE__, __TIME__); log_notice("%s\n\n", REDHAT_COPYRIGHT); } diff --git a/gfs2/edit/Makefile b/gfs2/edit/Makefile deleted file mode 100644 index b8a53cc..0000000 --- a/gfs2/edit/Makefile +++ /dev/null @@ -1,37 +0,0 @@ -TARGET= gfs2_edit - -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= gfs2hex.o \ - savemeta.o \ - hexedit.o - -CFLAGS += -DHELPER_PROGRAM -D_FILE_OFFSET_BITS=64 -CFLAGS += -I${ncursesincdir} -CFLAGS += -I${KERNEL_SRC}/fs/gfs2/ -I${KERNEL_SRC}/include/ -CFLAGS += -I$(S)/../include -I$(S)/../libgfs2 -CFLAGS += -I${incdir} - -LDFLAGS += -L${ncurseslibdir} -lncurses -LDFLAGS += -L../libgfs2/ -lgfs2 -LDFLAGS += -L${libdir} - -LDDEPS += ../libgfs2/libgfs2.a - -${TARGET}: ${OBJS} ${LDDEPS} - $(CC) -o $@ $^ $(LDFLAGS) - -depends: - $(MAKE) -C ../libgfs2 all - -clean: generalclean - --include $(OBJS:.o=.d) diff --git a/gfs2/edit/Makefile.am b/gfs2/edit/Makefile.am new file mode 100644 index 0000000..fcbe901 --- /dev/null +++ b/gfs2/edit/Makefile.am @@ -0,0 +1,17 @@ +MAINTAINERCLEANFILES = Makefile.in + +sbin_PROGRAMS = gfs2_edit + +noinst_HEADERS = gfs2hex.h hexedit.h + +gfs2_edit_SOURCES = gfs2hex.c hexedit.c savemeta.c + +gfs2_edit_CPPFLAGS = -D_FILE_OFFSET_BITS=64 -DHELPER_PROGRAM \ + -I$(top_srcdir)/gfs2/include \ + -I$(top_srcdir)/gfs2/libgfs2 + +gfs2_edit_CFLAGS = $(ncurses_CFLAGS) + +gfs2_edit_LDFLAGS = $(ncurses_LIBS) + +gfs2_edit_LDADD = $(top_builddir)/gfs2/libgfs2/libgfs2.la diff --git a/gfs2/edit/gfs2hex.c b/gfs2/edit/gfs2hex.c index 8de3bb8..5cd05e3 100644 --- a/gfs2/edit/gfs2hex.c +++ b/gfs2/edit/gfs2hex.c @@ -1,3 +1,5 @@ +#include "clusterautoconfig.h" + #include #include #include diff --git a/gfs2/edit/hexedit.c b/gfs2/edit/hexedit.c index d5d643d..e8c6030 100644 --- a/gfs2/edit/hexedit.c +++ b/gfs2/edit/hexedit.c @@ -1,3 +1,5 @@ +#include "clusterautoconfig.h" + #include #include #include @@ -3224,7 +3226,7 @@ static void parameterpass1(int argc, char *argv[], int i) { if (!strcasecmp(argv[i], "-V")) { printf("%s version %s (built %s %s)\n", - argv[0], RELEASE_VERSION, __DATE__, __TIME__); + argv[0], VERSION, __DATE__, __TIME__); printf("%s\n", REDHAT_COPYRIGHT); exit(0); } diff --git a/gfs2/edit/savemeta.c b/gfs2/edit/savemeta.c index d579b91..33c1f4c 100644 --- a/gfs2/edit/savemeta.c +++ b/gfs2/edit/savemeta.c @@ -1,3 +1,5 @@ +#include "clusterautoconfig.h" + #include #include #include diff --git a/gfs2/fsck/Makefile b/gfs2/fsck/Makefile deleted file mode 100644 index 7a99b36..0000000 --- a/gfs2/fsck/Makefile +++ /dev/null @@ -1,62 +0,0 @@ -TARGET= fsck.gfs2 - -FORCESBINT=$(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= eattr.o \ - fs_recovery.o \ - hash.o \ - initialize.o \ - inode_hash.o \ - link.o \ - lost_n_found.o \ - main.o \ - metawalk.o \ - pass1.o \ - pass1b.o \ - pass1c.o \ - pass2.o \ - pass3.o \ - pass4.o \ - pass5.o \ - rgrepair.o \ - util.o - -CFLAGS += -D_FILE_OFFSET_BITS=64 -DHELPER_PROGRAM -CFLAGS += -I${KERNEL_SRC}/fs/gfs2/ -I${KERNEL_SRC}/include/ -CFLAGS += -I$(S)/../include -I$(S)/../libgfs2 -CFLAGS += -I${incdir} - -LDFLAGS += -L../libgfs2 -lgfs2 -LDFLAGS += -L${libdir} - -LDDEPS += ../libgfs2/libgfs2.a - -${TARGET}: $(OBJS) ${LDDEPS} - $(CC) -o $@ $^ $(LDFLAGS) - -depends: - $(MAKE) -C ../libgfs2 all - -test_block_list: log.o test_block_list.o - $(CC) -o $@ $^ $(LDFLAGS) - -test_bitmap: test_bitmap.o log.o - $(CC) -o $@ $^ $(LDFLAGS) - -clean: generalclean - rm -f test_block_list test_bitmap - -${TARGET}.pot: $(OBJS:.o=.c) - xgettext -C -F --keyword=print_log --keyword=log_debug --keyword=log_info --keyword=_ \ - --keyword=log_notice --keyword=log_warn --keyword=log_err --keyword=log_crit \ - --keyword=log_debug --keyword=log_err --keyword=log_print -d - $(OBJS:.o=.c) > ${TARGET}.pot - --include $(OBJS:.o=.d) diff --git a/gfs2/fsck/Makefile.am b/gfs2/fsck/Makefile.am new file mode 100644 index 0000000..d24a2e0 --- /dev/null +++ b/gfs2/fsck/Makefile.am @@ -0,0 +1,27 @@ +MAINTAINERCLEANFILES = Makefile.in + +noinst_PROGRAMS = fsck.gfs2 + +# noinst_PROGRAMS = test_bitmap.c test_block_list.c + +noinst_HEADERS = eattr.h fs_bits.h fsck.h fs_recovery.h hash.h \ + inode_hash.h link.h lost_n_found.h metawalk.h util.h + +fsck_gfs2_SOURCES = eattr.c fs_recovery.c hash.c initialize.c \ + inode_hash.c link.c lost_n_found.c main.c metawalk.c \ + pass1b.c pass1.c pass1c.c pass2.c pass3.c pass4.c \ + pass5.c rgrepair.c util.c + +fsck_gfs2_CPPFLAGS = -D_FILE_OFFSET_BITS=64 -DHELPER_PROGRAM \ + -I$(top_srcdir)/gfs2/include \ + -I$(top_srcdir)/gfs2/libgfs2 + +fsck_gfs2_LDADD = $(top_builddir)/gfs2/libgfs2/libgfs2.la + +install-exec-local: + $(INSTALL) -d $(DESTDIR)/sbin + $(INSTALL) -m 755 fsck.gfs2 $(DESTDIR)/sbin + +uninstall-local: + cd $(DESTDIR)/sbin && \ + rm -f fsck.gfs2 diff --git a/gfs2/fsck/eattr.c b/gfs2/fsck/eattr.c index 6489e6d..23c12d2 100644 --- a/gfs2/fsck/eattr.c +++ b/gfs2/fsck/eattr.c @@ -1,3 +1,5 @@ +#include "clusterautoconfig.h" + #include #include #include diff --git a/gfs2/fsck/fs_recovery.c b/gfs2/fsck/fs_recovery.c index cbae916..d0ca88f 100644 --- a/gfs2/fsck/fs_recovery.c +++ b/gfs2/fsck/fs_recovery.c @@ -1,3 +1,5 @@ +#include "clusterautoconfig.h" + #include #include #include diff --git a/gfs2/fsck/hash.c b/gfs2/fsck/hash.c index 9f09111..f55c2a7 100644 --- a/gfs2/fsck/hash.c +++ b/gfs2/fsck/hash.c @@ -1,3 +1,5 @@ +#include "clusterautoconfig.h" + /* This is the same hash algorithm used by the glocks in gfs */ #include diff --git a/gfs2/fsck/initialize.c b/gfs2/fsck/initialize.c index 6239954..ef2463d 100644 --- a/gfs2/fsck/initialize.c +++ b/gfs2/fsck/initialize.c @@ -1,3 +1,5 @@ +#include "clusterautoconfig.h" + #include #include #include diff --git a/gfs2/fsck/inode_hash.c b/gfs2/fsck/inode_hash.c index 45efe09..f457b36 100644 --- a/gfs2/fsck/inode_hash.c +++ b/gfs2/fsck/inode_hash.c @@ -1,3 +1,5 @@ +#include "clusterautoconfig.h" + #include #include diff --git a/gfs2/fsck/link.c b/gfs2/fsck/link.c index 9666f63..b517fbc 100644 --- a/gfs2/fsck/link.c +++ b/gfs2/fsck/link.c @@ -1,3 +1,5 @@ +#include "clusterautoconfig.h" + #include #include #include diff --git a/gfs2/fsck/lost_n_found.c b/gfs2/fsck/lost_n_found.c index 4170380..4f334f4 100644 --- a/gfs2/fsck/lost_n_found.c +++ b/gfs2/fsck/lost_n_found.c @@ -1,3 +1,5 @@ +#include "clusterautoconfig.h" + #include #include #include diff --git a/gfs2/fsck/main.c b/gfs2/fsck/main.c index ad71ba5..ee73035 100644 --- a/gfs2/fsck/main.c +++ b/gfs2/fsck/main.c @@ -1,3 +1,5 @@ +#include "clusterautoconfig.h" + #include #include #include @@ -47,7 +49,7 @@ static void usage(char *name) static void version(void) { printf( _("GFS2 fsck %s (built %s %s)\n"), - RELEASE_VERSION, __DATE__, __TIME__); + VERSION, __DATE__, __TIME__); printf( _(REDHAT_COPYRIGHT "\n")); } diff --git a/gfs2/fsck/metawalk.c b/gfs2/fsck/metawalk.c index 7088d8f..64f98e0 100644 --- a/gfs2/fsck/metawalk.c +++ b/gfs2/fsck/metawalk.c @@ -1,3 +1,5 @@ +#include "clusterautoconfig.h" + #include #include #include diff --git a/gfs2/fsck/pass1.c b/gfs2/fsck/pass1.c index e53b666..1a635b6 100644 --- a/gfs2/fsck/pass1.c +++ b/gfs2/fsck/pass1.c @@ -1,3 +1,5 @@ +#include "clusterautoconfig.h" + /* pass1 checks inodes for format & type, duplicate blocks, & incorrect * block count. * diff --git a/gfs2/fsck/pass1b.c b/gfs2/fsck/pass1b.c index c02317b..c0181c1 100644 --- a/gfs2/fsck/pass1b.c +++ b/gfs2/fsck/pass1b.c @@ -1,3 +1,5 @@ +#include "clusterautoconfig.h" + #include #include #include diff --git a/gfs2/fsck/pass1c.c b/gfs2/fsck/pass1c.c index e0f4576..8e2d01a 100644 --- a/gfs2/fsck/pass1c.c +++ b/gfs2/fsck/pass1c.c @@ -1,3 +1,5 @@ +#include "clusterautoconfig.h" + #include #include #include diff --git a/gfs2/fsck/pass2.c b/gfs2/fsck/pass2.c index c6961b7..849a96e 100644 --- a/gfs2/fsck/pass2.c +++ b/gfs2/fsck/pass2.c @@ -1,3 +1,5 @@ +#include "clusterautoconfig.h" + #include #include #include diff --git a/gfs2/fsck/pass3.c b/gfs2/fsck/pass3.c index 9bb7cb4..4112024 100644 --- a/gfs2/fsck/pass3.c +++ b/gfs2/fsck/pass3.c @@ -1,3 +1,5 @@ +#include "clusterautoconfig.h" + #include #include #include diff --git a/gfs2/fsck/pass4.c b/gfs2/fsck/pass4.c index 809df91..fb0e0a5 100644 --- a/gfs2/fsck/pass4.c +++ b/gfs2/fsck/pass4.c @@ -1,3 +1,5 @@ +#include "clusterautoconfig.h" + #include #include #include diff --git a/gfs2/fsck/pass5.c b/gfs2/fsck/pass5.c index 9f879d0..bf774de 100644 --- a/gfs2/fsck/pass5.c +++ b/gfs2/fsck/pass5.c @@ -1,3 +1,5 @@ +#include "clusterautoconfig.h" + #include #include #include diff --git a/gfs2/fsck/rgrepair.c b/gfs2/fsck/rgrepair.c index ca16ba5..0aa20d4 100644 --- a/gfs2/fsck/rgrepair.c +++ b/gfs2/fsck/rgrepair.c @@ -1,3 +1,5 @@ +#include "clusterautoconfig.h" + #include #include #include diff --git a/gfs2/fsck/test.c b/gfs2/fsck/test.c deleted file mode 100644 index ae12429..0000000 --- a/gfs2/fsck/test.c +++ /dev/null @@ -1,8 +0,0 @@ -#include - -main() -{ - char test[10]; - - printf("%d\n", sizeof(test)); -} diff --git a/gfs2/fsck/test_bitmap.c b/gfs2/fsck/test_bitmap.c index 18e23bd..21bf961 100644 --- a/gfs2/fsck/test_bitmap.c +++ b/gfs2/fsck/test_bitmap.c @@ -1,3 +1,5 @@ +#include "clusterautoconfig.h" + #include #include #include "log.h" diff --git a/gfs2/fsck/test_block_list.c b/gfs2/fsck/test_block_list.c index cd25f05..3750837 100644 --- a/gfs2/fsck/test_block_list.c +++ b/gfs2/fsck/test_block_list.c @@ -1,3 +1,5 @@ +#include "clusterautoconfig.h" + #include #include #include "block_list.h" diff --git a/gfs2/fsck/util.c b/gfs2/fsck/util.c index eac0e1b..e6bb6af 100644 --- a/gfs2/fsck/util.c +++ b/gfs2/fsck/util.c @@ -1,3 +1,5 @@ +#include "clusterautoconfig.h" + #include #include #include diff --git a/gfs2/include/Makefile.am b/gfs2/include/Makefile.am new file mode 100644 index 0000000..fff2953 --- /dev/null +++ b/gfs2/include/Makefile.am @@ -0,0 +1,3 @@ +MAINTAINERCLEANFILES = Makefile.in + +noinst_HEADERS = osi_list.h diff --git a/gfs2/init.d/Makefile b/gfs2/init.d/Makefile deleted file mode 100644 index 23a57d9..0000000 --- a/gfs2/init.d/Makefile +++ /dev/null @@ -1,18 +0,0 @@ -TARGET= gfs2 - -INITDT=$(TARGET) - -all: $(TARGET) - -include ../../make/defines.mk -include $(OBJDIR)/make/clean.mk -include $(OBJDIR)/make/install.mk -include $(OBJDIR)/make/uninstall.mk - -$(TARGET): $(S)/$(TARGET).in - cat $(S)/$(TARGET).in | sed \ - -e 's#@SBINDIR@#${sbindir}#g' \ - -e 's#@INITDDIR@#${initddir}#g' \ - > $(TARGET) - -clean: generalclean diff --git a/gfs2/libgfs2/Makefile b/gfs2/libgfs2/Makefile deleted file mode 100644 index 9411130..0000000 --- a/gfs2/libgfs2/Makefile +++ /dev/null @@ -1,33 +0,0 @@ -TARGET= libgfs2 - -MAKESTATICLIB = 1 - -OBJS= block_list.o \ - buf.o \ - device_geometry.o \ - fs_bits.o \ - fs_geometry.o \ - fs_ops.o \ - gfs1.o \ - gfs2_log.o \ - gfs2_disk_hash.o \ - misc.o \ - ondisk.o \ - recovery.o \ - size.o \ - structures.o \ - super.o \ - rgrp.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 += -D_FILE_OFFSET_BITS=64 -D_LARGEFILE64_SOURCE -D_GNU_SOURCE -CFLAGS += -I${KERNEL_SRC}/fs/gfs2/ -I${KERNEL_SRC}/include/ -CFLAGS += -I$(S)/../include -CFLAGS += -I${incdir} -CFLAGS += -fPIC diff --git a/gfs2/libgfs2/Makefile.am b/gfs2/libgfs2/Makefile.am new file mode 100644 index 0000000..bb5b0c5 --- /dev/null +++ b/gfs2/libgfs2/Makefile.am @@ -0,0 +1,15 @@ +MAINTAINERCLEANFILES = Makefile.in + +noinst_HEADERS = libgfs2.h + +noinst_LTLIBRARIES = libgfs2.la + +libgfs2_la_SOURCES = block_list.c fs_bits.c gfs1.c misc.c rgrp.c super.c \ + buf.c fs_geometry.c gfs2_disk_hash.c ondisk.c size.c \ + device_geometry.c fs_ops.c gfs2_log.c recovery.c \ + structures.c + +libgfs2_la_CPPFLAGS = -D_FILE_OFFSET_BITS=64 \ + -D_LARGEFILE64_SOURCE \ + -D_GNU_SOURCE \ + -I$(top_srcdir)/gfs2/include diff --git a/gfs2/libgfs2/block_list.c b/gfs2/libgfs2/block_list.c index 571c737..7b89a80 100644 --- a/gfs2/libgfs2/block_list.c +++ b/gfs2/libgfs2/block_list.c @@ -1,3 +1,5 @@ +#include "clusterautoconfig.h" + #include #include #include diff --git a/gfs2/libgfs2/buf.c b/gfs2/libgfs2/buf.c index f0164b4..75f3586 100644 --- a/gfs2/libgfs2/buf.c +++ b/gfs2/libgfs2/buf.c @@ -1,3 +1,5 @@ +#include "clusterautoconfig.h" + #include #include #include diff --git a/gfs2/libgfs2/device_geometry.c b/gfs2/libgfs2/device_geometry.c index b2d5861..bb13e46 100644 --- a/gfs2/libgfs2/device_geometry.c +++ b/gfs2/libgfs2/device_geometry.c @@ -1,3 +1,5 @@ +#include "clusterautoconfig.h" + #include #include #include diff --git a/gfs2/libgfs2/fs_bits.c b/gfs2/libgfs2/fs_bits.c index dbbfdcb..fd9c655 100644 --- a/gfs2/libgfs2/fs_bits.c +++ b/gfs2/libgfs2/fs_bits.c @@ -1,3 +1,5 @@ +#include "clusterautoconfig.h" + #include #include #include diff --git a/gfs2/libgfs2/fs_geometry.c b/gfs2/libgfs2/fs_geometry.c index 394daed..e02cc22 100644 --- a/gfs2/libgfs2/fs_geometry.c +++ b/gfs2/libgfs2/fs_geometry.c @@ -1,3 +1,5 @@ +#include "clusterautoconfig.h" + #include #include #include diff --git a/gfs2/libgfs2/fs_ops.c b/gfs2/libgfs2/fs_ops.c index fc898ce..3307919 100644 --- a/gfs2/libgfs2/fs_ops.c +++ b/gfs2/libgfs2/fs_ops.c @@ -1,3 +1,5 @@ +#include "clusterautoconfig.h" + #include #include #include diff --git a/gfs2/libgfs2/gfs1.c b/gfs2/libgfs2/gfs1.c index 3375a6c..b87e895 100644 --- a/gfs2/libgfs2/gfs1.c +++ b/gfs2/libgfs2/gfs1.c @@ -1,3 +1,5 @@ +#include "clusterautoconfig.h" + #include #include #include diff --git a/gfs2/libgfs2/gfs2_disk_hash.c b/gfs2/libgfs2/gfs2_disk_hash.c index 5da6103..959f5dd 100644 --- a/gfs2/libgfs2/gfs2_disk_hash.c +++ b/gfs2/libgfs2/gfs2_disk_hash.c @@ -1,3 +1,5 @@ +#include "clusterautoconfig.h" + #include #include "libgfs2.h" diff --git a/gfs2/libgfs2/gfs2_log.c b/gfs2/libgfs2/gfs2_log.c index 49dd2e2..ba28fea 100644 --- a/gfs2/libgfs2/gfs2_log.c +++ b/gfs2/libgfs2/gfs2_log.c @@ -1,3 +1,5 @@ +#include "clusterautoconfig.h" + #include #include #include diff --git a/gfs2/libgfs2/misc.c b/gfs2/libgfs2/misc.c index 0d831d3..87e1e30 100644 --- a/gfs2/libgfs2/misc.c +++ b/gfs2/libgfs2/misc.c @@ -1,3 +1,5 @@ +#include "clusterautoconfig.h" + #include #include #include diff --git a/gfs2/libgfs2/ondisk.c b/gfs2/libgfs2/ondisk.c index f1c91fb..624fce6 100644 --- a/gfs2/libgfs2/ondisk.c +++ b/gfs2/libgfs2/ondisk.c @@ -1,3 +1,5 @@ +#include "clusterautoconfig.h" + #include #include #include diff --git a/gfs2/libgfs2/recovery.c b/gfs2/libgfs2/recovery.c index b10fe77..3b95f8d 100644 --- a/gfs2/libgfs2/recovery.c +++ b/gfs2/libgfs2/recovery.c @@ -1,3 +1,5 @@ +#include "clusterautoconfig.h" + /* * NOTE: * diff --git a/gfs2/libgfs2/rgrp.c b/gfs2/libgfs2/rgrp.c index fc548d1..8f7eab9 100644 --- a/gfs2/libgfs2/rgrp.c +++ b/gfs2/libgfs2/rgrp.c @@ -1,3 +1,5 @@ +#include "clusterautoconfig.h" + #include #include #include diff --git a/gfs2/libgfs2/size.c b/gfs2/libgfs2/size.c index d9d2c54..0cff065 100644 --- a/gfs2/libgfs2/size.c +++ b/gfs2/libgfs2/size.c @@ -1,3 +1,5 @@ +#include "clusterautoconfig.h" + #include #include #include diff --git a/gfs2/libgfs2/structures.c b/gfs2/libgfs2/structures.c index 734efde..d7eb6e0 100644 --- a/gfs2/libgfs2/structures.c +++ b/gfs2/libgfs2/structures.c @@ -1,3 +1,5 @@ +#include "clusterautoconfig.h" + #include #include #include diff --git a/gfs2/libgfs2/super.c b/gfs2/libgfs2/super.c index d521f99..496a337 100644 --- a/gfs2/libgfs2/super.c +++ b/gfs2/libgfs2/super.c @@ -1,3 +1,5 @@ +#include "clusterautoconfig.h" + #include #include #include diff --git a/gfs2/man/Makefile b/gfs2/man/Makefile deleted file mode 100644 index 2b81b70..0000000 --- a/gfs2/man/Makefile +++ /dev/null @@ -1,13 +0,0 @@ -TARGET= gfs2.8 \ - gfs2_convert.8 \ - gfs2_edit.8 \ - fsck.gfs2.8 \ - gfs2_grow.8 \ - gfs2_jadd.8 \ - mount.gfs2.8 \ - gfs2_quota.8 \ - gfs2_tool.8 \ - mkfs.gfs2.8 - -include ../../make/defines.mk -include $(OBJDIR)/make/man.mk diff --git a/gfs2/man/Makefile.am b/gfs2/man/Makefile.am new file mode 100644 index 0000000..ac7c2fc --- /dev/null +++ b/gfs2/man/Makefile.am @@ -0,0 +1,12 @@ +MAINTAINERCLEANFILES = Makefile.in + +dist_man_MANS = fsck.gfs2.8 \ + gfs2.8 \ + gfs2_convert.8 \ + gfs2_edit.8 \ + gfs2_grow.8 \ + gfs2_jadd.8 \ + gfs2_quota.8 \ + gfs2_tool.8 \ + mkfs.gfs2.8 \ + mount.gfs2.8 diff --git a/gfs2/mkfs/Makefile b/gfs2/mkfs/Makefile deleted file mode 100644 index 7a67898..0000000 --- a/gfs2/mkfs/Makefile +++ /dev/null @@ -1,46 +0,0 @@ -TARGET1= mkfs.gfs2 -TARGET2= gfs2_jadd -TARGET3= gfs2_grow - -FORCESBINT= $(TARGET1) - -SBINSYMT=$(TARGET2) $(TARGET3) - -all: depends ${TARGET1} ${TARGET2} ${TARGET3} - -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= main.o \ - main_mkfs.o \ - main_grow.o \ - main_jadd.o - -CFLAGS += -D_FILE_OFFSET_BITS=64 -D_LARGEFILE64_SOURCE -D_GNU_SOURCE -CFLAGS += -I${KERNEL_SRC}/include/ -CFLAGS += -I$(S)/../include -I$(S)/../libgfs2 -CFLAGS += -I${incdir} - -LDFLAGS += -L../libgfs2 -lgfs2 -LDFLAGS += -L${libdir} - -LDDEPS += ../libgfs2/libgfs2.a - -${TARGET1}: ${OBJS} ${LDDEPS} - $(CC) -o $@ $^ $(LDFLAGS) - -${TARGET2}: ${TARGET1} - ln -sf ${relativesbin}/${TARGET1} ${TARGET2} - -${TARGET3}: ${TARGET1} - ln -sf ${relativesbin}/${TARGET1} ${TARGET3} - -depends: - $(MAKE) -C ../libgfs2 all - -clean: generalclean - --include $(OBJS:.o=.d) diff --git a/gfs2/mkfs/Makefile.am b/gfs2/mkfs/Makefile.am new file mode 100644 index 0000000..dffa54a --- /dev/null +++ b/gfs2/mkfs/Makefile.am @@ -0,0 +1,36 @@ +MAINTAINERCLEANFILES = Makefile.in + +noinst_PROGRAMS = mkfs.gfs2 + +noinst_HEADERS = gfs2_mkfs.h + +mkfs_gfs2_SOURCES = main.c main_grow.c main_jadd.c main_mkfs.c + +mkfs_gfs2_CPPFLAGS = -D_FILE_OFFSET_BITS=64 -D_LARGEFILE64_SOURCE \ + -D_GNU_SOURCE \ + -I$(top_srcdir)/gfs2/include \ + -I$(top_srcdir)/gfs2/libgfs2 + +mkfs_gfs2_LDFLAGS = -lvolume_id + +mkfs_gfs2_LDADD = $(top_builddir)/gfs2/libgfs2/libgfs2.la + +relative_sbin = $(shell perl -MFile::Spec -le 'print File::Spec->abs2rel("/sbin", "$(sbindir)")') + +install-exec-local: + $(INSTALL) -d $(DESTDIR)/sbin + $(INSTALL) -m 755 mkfs.gfs2 $(DESTDIR)/sbin + +uninstall-local: + cd $(DESTDIR)/sbin && \ + rm -f mkfs.gfs2 + +install-exec-hook: + $(INSTALL) -d $(DESTDIR)/$(sbindir) + (cd $(DESTDIR)/$(sbindir) && \ + rm -f gfs2_grow gfs2_jadd && \ + $(LN_S) $(relative_sbin)/mkfs.gfs2 gfs2_grow && \ + $(LN_S) $(relative_sbin)/mkfs.gfs2 gfs2_jadd) + +uninstall-hook: + (cd $(DESTDIR)/$(sbindir) && rm -f gfs2_jadd gfs2_grow) diff --git a/gfs2/mkfs/main.c b/gfs2/mkfs/main.c index 58b933c..17b5fd4 100644 --- a/gfs2/mkfs/main.c +++ b/gfs2/mkfs/main.c @@ -1,3 +1,5 @@ +#include "clusterautoconfig.h" + #include #include #include diff --git a/gfs2/mkfs/main_grow.c b/gfs2/mkfs/main_grow.c index a3f6e47..08dc524 100644 --- a/gfs2/mkfs/main_grow.c +++ b/gfs2/mkfs/main_grow.c @@ -1,3 +1,5 @@ +#include "clusterautoconfig.h" + #include #include #include @@ -70,7 +72,7 @@ static void decode_arguments(int argc, char *argv[], struct gfs2_sbd *sdp) break; case 'V': printf("%s %s (built %s %s)\n", argv[0], - RELEASE_VERSION, __DATE__, __TIME__); + VERSION, __DATE__, __TIME__); printf( _(REDHAT_COPYRIGHT "\n")); exit(0); case 'h': diff --git a/gfs2/mkfs/main_jadd.c b/gfs2/mkfs/main_jadd.c index ff2ba28..661e893 100644 --- a/gfs2/mkfs/main_jadd.c +++ b/gfs2/mkfs/main_jadd.c @@ -1,3 +1,5 @@ +#include "clusterautoconfig.h" + #include #include #include @@ -117,7 +119,7 @@ static void decode_arguments(int argc, char *argv[], struct gfs2_sbd *sdp) sdp->quiet = TRUE; break; case 'V': - printf("gfs2_jadd %s (built %s %s)\n", RELEASE_VERSION, + printf("gfs2_jadd %s (built %s %s)\n", VERSION, __DATE__, __TIME__); printf( _(REDHAT_COPYRIGHT "\n")); exit(0); diff --git a/gfs2/mkfs/main_mkfs.c b/gfs2/mkfs/main_mkfs.c index 15a4bd5..4e90841 100644 --- a/gfs2/mkfs/main_mkfs.c +++ b/gfs2/mkfs/main_mkfs.c @@ -1,3 +1,5 @@ +#include "clusterautoconfig.h" + #include #include #include @@ -137,7 +139,7 @@ static void decode_arguments(int argc, char *argv[], struct gfs2_sbd *sdp) break; case 'V': - printf("gfs2_mkfs %s (built %s %s)\n", RELEASE_VERSION, + printf("gfs2_mkfs %s (built %s %s)\n", VERSION, __DATE__, __TIME__); printf( _(REDHAT_COPYRIGHT "\n")); exit(EXIT_SUCCESS); diff --git a/gfs2/mount/Makefile b/gfs2/mount/Makefile deleted file mode 100644 index 2dcbaa5..0000000 --- a/gfs2/mount/Makefile +++ /dev/null @@ -1,34 +0,0 @@ -TARGET= mount.gfs2 - -FORCESBINT= $(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= mount.gfs2.o \ - ondisk1.o \ - util.o \ - mtab.o - -CFLAGS += -DHELPER_PROGRAM -D_FILE_OFFSET_BITS=64 -D_GNU_SOURCE -CFLAGS += -I${KERNEL_SRC}/fs/gfs2/ -I${KERNEL_SRC}/include/ -CFLAGS += -I$(SRCDIR)/group/libgfscontrol -CFLAGS += -I$(S)/../include -CFLAGS += -I${incdir} - -LDFLAGS += -L../../group/libgfscontrol -lgfscontrol -LDFLAGS += -L${libdir} - -LDDEPS += ../../group/libgfscontrol/libgfscontrol.a - -${TARGET}: ${OBJS} ${LDDEPS} - $(CC) -o $@ $^ $(LDFLAGS) - -clean: generalclean - --include $(OBJS:.o=.d) diff --git a/gfs2/mount/Makefile.am b/gfs2/mount/Makefile.am new file mode 100644 index 0000000..fd927b6 --- /dev/null +++ b/gfs2/mount/Makefile.am @@ -0,0 +1,22 @@ +MAINTAINERCLEANFILES = Makefile.in + +noinst_PROGRAMS = mount.gfs2 + +noinst_HEADERS = gfs_ondisk.h util.h + +mount_gfs2_SOURCES = mount.gfs2.c mtab.c ondisk1.c util.c + +mount_gfs2_CPPFLAGS = -D_FILE_OFFSET_BITS=64 -DHELPER_PROGRAM \ + -D_GNU_SOURCE \ + -I$(top_srcdir)/gfs2/include \ + -I$(top_srcdir)/group/libgfscontrol + +mount_gfs2_LDADD = $(top_builddir)/group/libgfscontrol/libgfscontrol.la + +install-exec-local: + $(INSTALL) -d $(DESTDIR)/sbin + $(INSTALL) -m 755 mount.gfs2 $(DESTDIR)/sbin + +uninstall-local: + cd $(DESTDIR)/sbin && \ + rm -f mount.gfs2 diff --git a/gfs2/mount/mount.gfs2.c b/gfs2/mount/mount.gfs2.c index 2442f59..c24d056 100644 --- a/gfs2/mount/mount.gfs2.c +++ b/gfs2/mount/mount.gfs2.c @@ -1,3 +1,5 @@ +#include "clusterautoconfig.h" + #include "util.h" const char *fsname; @@ -6,7 +8,7 @@ static sigset_t old_sigset; static void print_version(void) { - printf("mount.gfs2 %s (built %s %s)\n", RELEASE_VERSION, + printf("mount.gfs2 %s (built %s %s)\n", VERSION, __DATE__, __TIME__); } diff --git a/gfs2/mount/mtab.c b/gfs2/mount/mtab.c index fe5c744..6db9785 100644 --- a/gfs2/mount/mtab.c +++ b/gfs2/mount/mtab.c @@ -1,3 +1,5 @@ +#include "clusterautoconfig.h" + #include "util.h" extern char *fsname; diff --git a/gfs2/mount/ondisk1.c b/gfs2/mount/ondisk1.c index 8b3d2c4..2779a0d 100644 --- a/gfs2/mount/ondisk1.c +++ b/gfs2/mount/ondisk1.c @@ -1,3 +1,5 @@ +#include "clusterautoconfig.h" + #include #include #include diff --git a/gfs2/mount/util.c b/gfs2/mount/util.c index 5c86027..57a432a 100644 --- a/gfs2/mount/util.c +++ b/gfs2/mount/util.c @@ -1,3 +1,5 @@ +#include "clusterautoconfig.h" + #include #include #include "util.h" diff --git a/gfs2/quota/Makefile b/gfs2/quota/Makefile deleted file mode 100644 index 165df2d..0000000 --- a/gfs2/quota/Makefile +++ /dev/null @@ -1,35 +0,0 @@ -TARGET= gfs2_quota - -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= main.o \ - names.o \ - check.o - -CFLAGS += -DHELPER_PROGRAM -D_FILE_OFFSET_BITS=64 -D_GNU_SOURCE -CFLAGS += -I${KERNEL_SRC}/fs/gfs2/ -I${KERNEL_SRC}/include/ -CFLAGS += -I$(S)/../include -I$(S)/../libgfs2 -CFLAGS += -I${incdir} - -LDFLAGS += -L../libgfs2 -lgfs2 -LDFLAGS += -L${libdir} - -LDDEPS += ../libgfs2/libgfs2.a - -${TARGET}: ${OBJS} ${LDDEPS} - $(CC) -o $@ $^ $(LDFLAGS) - -depends: - $(MAKE) -C ../libgfs2 all - -clean: generalclean - --include $(OBJS:.o=.d) diff --git a/gfs2/quota/Makefile.am b/gfs2/quota/Makefile.am new file mode 100644 index 0000000..9d75d20 --- /dev/null +++ b/gfs2/quota/Makefile.am @@ -0,0 +1,14 @@ +MAINTAINERCLEANFILES = Makefile.in + +sbin_PROGRAMS = gfs2_quota + +noinst_HEADERS = gfs2_quota.h + +gfs2_quota_SOURCES = check.c main.c names.c + +gfs2_quota_CPPFLAGS = -D_FILE_OFFSET_BITS=64 -D_GNU_SOURCE \ + -DHELPER_PROGRAM \ + -I$(top_srcdir)/gfs2/include \ + -I$(top_srcdir)/gfs2/libgfs2 + +gfs2_quota_LDADD = $(top_builddir)/gfs2/libgfs2/libgfs2.la diff --git a/gfs2/quota/check.c b/gfs2/quota/check.c index 7d1ec5b..6bb89b3 100644 --- a/gfs2/quota/check.c +++ b/gfs2/quota/check.c @@ -1,3 +1,5 @@ +#include "clusterautoconfig.h" + #include #include #include diff --git a/gfs2/quota/main.c b/gfs2/quota/main.c index a160897..16692dd 100644 --- a/gfs2/quota/main.c +++ b/gfs2/quota/main.c @@ -1,3 +1,5 @@ +#include "clusterautoconfig.h" + #include #include #include @@ -144,7 +146,7 @@ decode_arguments(int argc, char *argv[], commandline_t *comline) break; case 'V': - printf("gfs2_quota %s (built %s %s)\n", RELEASE_VERSION, + printf("gfs2_quota %s (built %s %s)\n", VERSION, __DATE__, __TIME__); printf("%s\n", REDHAT_COPYRIGHT); exit(EXIT_SUCCESS); diff --git a/gfs2/quota/names.c b/gfs2/quota/names.c index fd3c589..22474e0 100644 --- a/gfs2/quota/names.c +++ b/gfs2/quota/names.c @@ -1,3 +1,5 @@ +#include "clusterautoconfig.h" + #include #include #include diff --git a/gfs2/tool/Makefile b/gfs2/tool/Makefile deleted file mode 100644 index 11b8624..0000000 --- a/gfs2/tool/Makefile +++ /dev/null @@ -1,37 +0,0 @@ -TARGET= gfs2_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= main.o \ - misc.o \ - ondisk.o \ - sb.o \ - tune.o - -CFLAGS += -D_FILE_OFFSET_BITS=64 -CFLAGS += -I${KERNEL_SRC}/fs/gfs2/ -I${KERNEL_SRC}/include/ -CFLAGS += -I$(S)/../include -I$(S)/../libgfs2 -CFLAGS += -I${incdir} - -LDFLAGS += -L../libgfs2 -lgfs2 -LDFLAGS += -L${libdir} - -LDDEPS += ../libgfs2/libgfs2.a - -${TARGET}: ${OBJS} ${LDDEPS} - $(CC) -o $@ $^ $(LDFLAGS) - -depends: - $(MAKE) -C ../libgfs2 all - -clean: generalclean - --include $(OBJS:.o=.d) diff --git a/gfs2/tool/Makefile.am b/gfs2/tool/Makefile.am new file mode 100644 index 0000000..a659eea --- /dev/null +++ b/gfs2/tool/Makefile.am @@ -0,0 +1,13 @@ +MAINTAINERCLEANFILES = Makefile.in + +sbin_PROGRAMS = gfs2_tool + +noinst_HEADERS = gfs2_tool.h iflags.h + +gfs2_tool_SOURCES = main.c misc.c ondisk.c sb.c tune.c + +gfs2_tool_CPPFLAGS = -D_FILE_OFFSET_BITS=64 \ + -I$(top_srcdir)/gfs2/include \ + -I$(top_srcdir)/gfs2/libgfs2 + +gfs2_tool_LDADD = $(top_builddir)/gfs2/libgfs2/libgfs2.la diff --git a/gfs2/tool/main.c b/gfs2/tool/main.c index 5cad9da..829dc76 100644 --- a/gfs2/tool/main.c +++ b/gfs2/tool/main.c @@ -1,3 +1,5 @@ +#include "clusterautoconfig.h" + #include #include #include @@ -74,7 +76,7 @@ void print_usage(void) static void print_version(void) { - printf( _("gfs2_tool " RELEASE_VERSION " (built " __DATE__ " " __TIME__ ")\n")); + printf( _("gfs2_tool " VERSION " (built " __DATE__ " " __TIME__ ")\n")); puts( _(REDHAT_COPYRIGHT "\n") ); } diff --git a/gfs2/tool/misc.c b/gfs2/tool/misc.c index 359567c..216e4ed 100644 --- a/gfs2/tool/misc.c +++ b/gfs2/tool/misc.c @@ -1,3 +1,5 @@ +#include "clusterautoconfig.h" + #include #include #include diff --git a/gfs2/tool/ondisk.c b/gfs2/tool/ondisk.c index d10cfd8..d58c1ef 100644 --- a/gfs2/tool/ondisk.c +++ b/gfs2/tool/ondisk.c @@ -1,3 +1,5 @@ +#include "clusterautoconfig.h" + #include #include #include diff --git a/gfs2/tool/sb.c b/gfs2/tool/sb.c index 3d378e9..9c122b9 100644 --- a/gfs2/tool/sb.c +++ b/gfs2/tool/sb.c @@ -1,3 +1,5 @@ +#include "clusterautoconfig.h" + #include #include #include diff --git a/gfs2/tool/tune.c b/gfs2/tool/tune.c index 4666291..1bea4b2 100644 --- a/gfs2/tool/tune.c +++ b/gfs2/tool/tune.c @@ -1,3 +1,5 @@ +#include "clusterautoconfig.h" + #include #include #include diff --git a/group/Makefile b/group/Makefile deleted file mode 100644 index fe34807..0000000 --- a/group/Makefile +++ /dev/null @@ -1,4 +0,0 @@ -include ../make/defines.mk -include $(OBJDIR)/make/passthrough.mk - -SUBDIRS = libgfscontrol gfs_control gfs_controld man diff --git a/group/Makefile.am b/group/Makefile.am new file mode 100644 index 0000000..5b7d0f8 --- /dev/null +++ b/group/Makefile.am @@ -0,0 +1,3 @@ +MAINTAINERCLEANFILES = Makefile.in + +SUBDIRS = libgfscontrol gfs_control gfs_controld man include diff --git a/group/gfs_control/Makefile b/group/gfs_control/Makefile deleted file mode 100644 index a69860b..0000000 --- a/group/gfs_control/Makefile +++ /dev/null @@ -1,31 +0,0 @@ -TARGET= gfs_control - -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= main.o - -CFLAGS += -I$(S)/../libgfscontrol -CFLAGS += -I${incdir} - -LDFLAGS += -L../libgfscontrol -lgfscontrol -LDFLAGS += -L${libdir} - -LDDEPS += ../libgfscontrol/libgfscontrol.a - -${TARGET}: ${OBJS} ${LDDEPS} - $(CC) -o $@ $^ $(LDFLAGS) - -clean: generalclean - -depends: - $(MAKE) -C ../libgfscontrol all - --include $(OBJS:.o=.d) diff --git a/group/gfs_control/Makefile.am b/group/gfs_control/Makefile.am new file mode 100644 index 0000000..dd75f6f --- /dev/null +++ b/group/gfs_control/Makefile.am @@ -0,0 +1,9 @@ +MAINTAINERCLEANFILES = Makefile.in + +sbin_PROGRAMS = gfs_control + +gfs_control_SOURCES = main.c + +gfs_control_CPPFLAGS = -I$(top_srcdir)/group/libgfscontrol + +gfs_control_LDADD = $(top_builddir)/group/libgfscontrol/libgfscontrol.la diff --git a/group/gfs_control/main.c b/group/gfs_control/main.c index e754e81..fe4359f 100644 --- a/group/gfs_control/main.c +++ b/group/gfs_control/main.c @@ -1,3 +1,5 @@ +#include "clusterautoconfig.h" + #include #include #include @@ -69,7 +71,7 @@ static void decode_arguments(int argc, char **argv) case 'V': printf("%s %s (built %s %s)\n", - argv[0], RELEASE_VERSION, __DATE__, __TIME__); + argv[0], VERSION, __DATE__, __TIME__); /* printf("%s\n", REDHAT_COPYRIGHT); */ exit(EXIT_SUCCESS); break; diff --git a/group/gfs_controld/Makefile b/group/gfs_controld/Makefile deleted file mode 100644 index 7f9fa01..0000000 --- a/group/gfs_controld/Makefile +++ /dev/null @@ -1,43 +0,0 @@ -TARGET= gfs_controld - -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= main.o \ - member_cman.o \ - config.o \ - crc.o \ - cpg-new.o \ - util.o \ - logging.o - -CFLAGS += -I${ccsincdir} -I${logtincdir} -I${dlmcontrolincdir} -CFLAGS += -I${corosyncincdir} -I${openaisincdir} -I${fencedincdir} -CFLAGS += -I${KERNEL_SRC}/include/ -CFLAGS += -I$(S)/../libgfscontrol -CFLAGS += -I$(S)/../include/ -CFLAGS += -I${incdir} - -LDFLAGS += -L${ccslibdir} -lccs -LDFLAGS += -L${dlmcontrollibdir} -ldlmcontrol -LDFLAGS += -L${logtlibdir} -llogthread -LDFLAGS += -L${corosynclibdir} -lcpg -lcfg -lpthread -LDFLAGS += -L${openaislibdir} -lSaCkpt -LDFLAGS += -L${fencedlibdir} -lfenced -LDFLAGS += -L${libdir} - -LDDEPS += ${fencedlibdir}/libfenced.a - -${TARGET}: ${OBJS} ${LDDEPS} - $(CC) -o $@ $^ $(LDFLAGS) - -clean: generalclean - --include $(OBJS:.o=.d) diff --git a/group/gfs_controld/Makefile.am b/group/gfs_controld/Makefile.am new file mode 100644 index 0000000..6e20244 --- /dev/null +++ b/group/gfs_controld/Makefile.am @@ -0,0 +1,24 @@ +MAINTAINERCLEANFILES = Makefile.in + +sbin_PROGRAMS = gfs_controld + +noinst_HEADERS = config.h gfs_controld.h gfs_daemon.h + +gfs_controld_SOURCES = config.c \ + cpg-new.c \ + crc.c \ + logging.c \ + main.c \ + member_cman.c \ + util.c + +gfs_controld_CPPFLAGS = -I$(top_srcdir)/group/libgfscontrol \ + -I$(top_srcdir)/group/include + +gfs_controld_CFLAGS = $(ccs_CFLAGS) $(logt_CFLAGS) $(dlmcontrol_CFLAGS) \ + $(fenced_CFLAGS) $(sackpt_CFLAGS) $(cpg_CFLAGS) \ + $(cfg_CFLAGS) + +gfs_controld_LDFLAGS = $(ccs_LIBS) $(logt_LIBS) $(dlmcontrol_LIBS) \ + $(cpg_LIBS) $(cfg_LIBS) $(sackpt_LIBS) \ + $(fenced_LIBS) -lpthread diff --git a/group/gfs_controld/config.c b/group/gfs_controld/config.c index aafd01c..79c47f1 100644 --- a/group/gfs_controld/config.c +++ b/group/gfs_controld/config.c @@ -1,3 +1,5 @@ +#include "gfs_daemon.h" + #include #include #include @@ -21,7 +23,6 @@ #include #include -#include "gfs_daemon.h" #include "config.h" #include "ccs.h" diff --git a/group/gfs_controld/gfs_daemon.h b/group/gfs_controld/gfs_daemon.h index 08f42c3..7fa1837 100644 --- a/group/gfs_controld/gfs_daemon.h +++ b/group/gfs_controld/gfs_daemon.h @@ -1,6 +1,8 @@ #ifndef __GFS_DAEMON_DOT_H__ #define __GFS_DAEMON_DOT_H__ +#include "clusterautoconfig.h" + #include #include #include diff --git a/group/gfs_controld/main.c b/group/gfs_controld/main.c index c491424..a0b809d 100644 --- a/group/gfs_controld/main.c +++ b/group/gfs_controld/main.c @@ -5,7 +5,7 @@ #include -#define LOCKFILE_NAME "/var/run/gfs_controld.pid" +#define LOCKFILE_NAME CLUSTERVARRUN "/gfs_controld.pid" #define CLIENT_NALLOC 32 #define UEVENT_BUF_SIZE 4096 @@ -1245,7 +1245,7 @@ static void read_arguments(int argc, char **argv) case 'V': printf("gfs_controld %s (built %s %s)\n", - RELEASE_VERSION, __DATE__, __TIME__); + VERSION, __DATE__, __TIME__); printf("%s\n", REDHAT_COPYRIGHT); exit(EXIT_SUCCESS); break; @@ -1318,7 +1318,7 @@ int main(int argc, char **argv) } lockfile(); init_logging(); - log_level(LOG_INFO, "gfs_controld %s started", RELEASE_VERSION); + log_level(LOG_INFO, "gfs_controld %s started", VERSION); signal(SIGTERM, sigterm_handler); set_scheduler(); set_oom_adj(-16); diff --git a/group/include/Makefile.am b/group/include/Makefile.am new file mode 100644 index 0000000..b2c3ce5 --- /dev/null +++ b/group/include/Makefile.am @@ -0,0 +1,3 @@ +MAINTAINERCLEANFILES = Makefile.in + +noinst_HEADERS = linux_endian.h list.h diff --git a/group/libgfscontrol/Makefile b/group/libgfscontrol/Makefile deleted file mode 100644 index 51f5be0..0000000 --- a/group/libgfscontrol/Makefile +++ /dev/null @@ -1,19 +0,0 @@ -TARGET= libgfscontrol - -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)/../../group/gfs_controld -CFLAGS += -I${incdir} diff --git a/group/libgfscontrol/Makefile.am b/group/libgfscontrol/Makefile.am new file mode 100644 index 0000000..9e6eb0d --- /dev/null +++ b/group/libgfscontrol/Makefile.am @@ -0,0 +1,9 @@ +MAINTAINERCLEANFILES = Makefile.in + +noinst_HEADERS = libgfscontrol.h + +noinst_LTLIBRARIES = libgfscontrol.la + +libgfscontrol_la_SOURCES = main.c + +libgfscontrol_la_CPPFLAGS = -I$(top_srcdir)/group/gfs_controld diff --git a/group/libgfscontrol/main.c b/group/libgfscontrol/main.c index f45af9d..831c9e4 100644 --- a/group/libgfscontrol/main.c +++ b/group/libgfscontrol/main.c @@ -1,3 +1,5 @@ +#include "clusterautoconfig.h" + #include #include #include diff --git a/group/man/Makefile b/group/man/Makefile deleted file mode 100644 index 661f6a6..0000000 --- a/group/man/Makefile +++ /dev/null @@ -1,4 +0,0 @@ -TARGET= gfs_controld.8 - -include ../../make/defines.mk -include $(OBJDIR)/make/man.mk diff --git a/group/man/Makefile.am b/group/man/Makefile.am new file mode 100644 index 0000000..87d81e5 --- /dev/null +++ b/group/man/Makefile.am @@ -0,0 +1,3 @@ +MAINTAINERCLEANFILES = Makefile.in + +dist_man_MANS = gfs_controld.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 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 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 5f65f5c..0000000 --- a/make/defines.mk.input +++ /dev/null @@ -1,53 +0,0 @@ -# Install Locations -sbindir ?= ${DESTDIR}@SBINDIR@ -relativesbin ?= @RELATIVESBIN@ -initddir ?= ${DESTDIR}@INITDDIR@ -libdir ?= ${DESTDIR}@LIBDIR@ -docdir ?= ${DESTDIR}@DOCDIR@ -logdir ?= ${DESTDIR}@LOGDIR@ -mandir ?= ${DESTDIR}@MANDIR@ -incdir ?= ${DESTDIR}@INCDIR@ - -# 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@ - -KERNEL_BUILD = @KERNEL_BUILD@ -KERNEL_SRC = @KERNEL_SRC@ -ccsincdir ?= @CCSINCDIR@ -ccslibdir ?= @CCSLIBDIR@ -cmanincdir ?= @CMANINCDIR@ -cmanlibdir ?= @CMANLIBDIR@ -dlmcontrolincdir ?= @DLMCONTROLINCDIR@ -dlmcontrollibdir ?= @DLMCONTROLLIBDIR@ -fencedincdir ?= @FENCEDINCDIR@ -fencedlibdir ?= @FENCEDLIBDIR@ -logtincdir ?= @LOGTINCDIR@ -logtlibdir ?= @LOGTLIBDIR@ -ncursesincdir ?= @NCURSESINCDIR@ -ncurseslibdir ?= @NCURSESLIBDIR@ -corosyncincdir ?= @COROSYNCINCDIR@ -corosynclibdir ?= @COROSYNCLIBDIR@ -openaisincdir ?= @OPENAISINCDIR@ -openaislibdir ?= @OPENAISLIBDIR@ -experimental_build ?= @ENABLE_CRACK_OF_THE_DAY@ -legacy_code ?= @ENABLE_LEGACY_CODE@ -contrib_code ?= @ENABLE_CONTRIB@ -without_group ?= @DISABLE_GROUP@ -without_gfs2 ?= @DISABLE_GFS2@ -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 9d50eb4..0000000 --- a/make/install.mk +++ /dev/null @@ -1,45 +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 FORCESBINT - mkdir -p ${DESTDIR}/sbin - install ${FORCESBINT} ${DESTDIR}/sbin -endif -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 DOCS - install -d ${docdir} - set -e; \ - for i in ${DOCS}; do \ - install -m644 $(S)/$$i ${docdir}; \ - done -endif diff --git a/make/libs.mk b/make/libs.mk deleted file mode 100644 index cfe01c2..0000000 --- a/make/libs.mk +++ /dev/null @@ -1,47 +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 - -all: $(STATICLIB) $(SHAREDLIB) - -$(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) - -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 67cf408..0000000 --- a/make/uninstall.mk +++ /dev/null @@ -1,25 +0,0 @@ -uninstall: -ifdef LIBDIRT - ${UNINSTALL} ${LIBDIRT} ${libdir} -endif -ifdef LIBSYMT - ${UNINSTALL} ${LIBSYMT} ${libdir} -endif -ifdef INCDIRT - ${UNINSTALL} ${INCDIRT} ${incdir} -endif -ifdef FORCESBINT - ${UNINSTALL} ${FORCESBINT} ${DESTDIR}/sbin -endif -ifdef SBINDIRT - ${UNINSTALL} ${SBINDIRT} ${sbindir} -endif -ifdef SBINSYMT - ${UNINSTALL} ${SBINSYMT} ${sbindir} -endif -ifdef INITDT - ${UNINSTALL} ${INITDT} ${initddir} -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"; - } -} - -