public inbox for cluster-cvs@sourceware.org
help / color / mirror / Atom feed
* dlm: master - build: convert to autoconf/automake/libtool
@ 2009-06-09 15:19 Fabio M. Di Nitto
0 siblings, 0 replies; only message in thread
From: Fabio M. Di Nitto @ 2009-06-09 15:19 UTC (permalink / raw)
To: cluster-cvs-relay
Gitweb: http://git.fedorahosted.org/git/dlm.git?p=dlm.git;a=commitdiff;h=1beb4e16982d076b7330561e5f75e1c2027935ab
Commit: 1beb4e16982d076b7330561e5f75e1c2027935ab
Parent: 7f8f1cafc233b252f2929cfa68624354505bb2e1
Author: Fabio M. Di Nitto <fdinitto@redhat.com>
AuthorDate: Tue Jun 9 17:12:25 2009 +0200
Committer: Fabio M. Di Nitto <fdinitto@redhat.com>
CommitterDate: Tue Jun 9 17:12:25 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
(openais svn r1948 is also required to build due to a bug in openais
pkg-config files)
Signed-off-by: Fabio M. Di Nitto <fdinitto@redhat.com>
---
.gitignore | 55 +++-
Makefile | 57 ----
Makefile.am | 28 ++
autogen.sh | 153 +++++++++
bindings/Makefile | 4 -
bindings/perl/Makefile | 4 -
bindings/python/Makefile | 4 -
configure | 542 ---------------------------------
configure.ac | 289 ++++++++++++++++++
contrib/Makefile | 6 -
contrib/libaislock/Makefile | 15 -
contrib/libaislock/libaislock.c | 466 ----------------------------
contrib/libaislock/libaislock.h | 190 ------------
contrib/libaislock/libaislock.pc.in | 11 -
dlm/Makefile | 4 -
dlm/Makefile.am | 3 +
dlm/doc/Makefile.am | 6 +
dlm/libdlm/Makefile | 81 -----
dlm/libdlm/Makefile.am | 28 ++
dlm/libdlm/libdlm.c | 2 +
dlm/libdlm/libdlm.pc.in | 6 +-
dlm/libdlm/libdlm_lt.pc.in | 8 +-
dlm/libdlmcontrol/Makefile | 15 -
dlm/libdlmcontrol/Makefile.am | 17 +
dlm/libdlmcontrol/libdlmcontrol.pc.in | 6 +-
dlm/libdlmcontrol/main.c | 2 +
dlm/man/Makefile | 24 --
dlm/man/Makefile.am | 23 ++
dlm/tests/Makefile | 4 -
dlm/tests/Makefile.am | 3 +
dlm/tests/usertest/Makefile | 23 --
dlm/tests/usertest/Makefile.am | 18 ++
dlm/tests/usertest/alternate-lvb.c | 2 +
dlm/tests/usertest/asttest.c | 2 +
dlm/tests/usertest/dlmtest.c | 2 +
dlm/tests/usertest/dlmtest2.c | 2 +
dlm/tests/usertest/flood.c | 3 +
dlm/tests/usertest/joinleave.c | 2 +
dlm/tests/usertest/lstest.c | 2 +
dlm/tests/usertest/lvb.c | 2 +
dlm/tests/usertest/pingtest.c | 2 +
dlm/tests/usertest/sublocks.c | 2 +
dlm/tests/usertest/threads.c | 2 +
dlm/tool/Makefile | 32 --
dlm/tool/Makefile.am | 12 +
dlm/tool/main.c | 4 +-
doc/Makefile | 16 -
doc/Makefile.am | 10 +
group/Makefile | 4 -
group/Makefile.am | 3 +
group/dlm_controld/Makefile | 70 -----
group/dlm_controld/Makefile.am | 75 +++++
group/dlm_controld/action.c | 2 +
group/dlm_controld/config.c | 2 +
group/dlm_controld/cpg.c | 2 +
group/dlm_controld/crc.c | 2 +
group/dlm_controld/deadlock.c | 2 +
group/dlm_controld/logging.c | 2 +
group/dlm_controld/main.c | 6 +-
group/dlm_controld/member_cman.c | 2 +
group/dlm_controld/netlink.c | 2 +
group/dlm_controld/pacemaker.c | 2 +
group/dlm_controld/plock.c | 2 +
group/include/Makefile.am | 3 +
group/man/Makefile | 4 -
group/man/Makefile.am | 3 +
make/binding-passthrough.mk | 7 -
make/clean.mk | 7 -
make/cobj.mk | 6 -
make/defines.mk.input | 55 ----
make/install.mk | 41 ---
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 | 25 --
scripts/uninstall.pl | 71 -----
78 files changed, 779 insertions(+), 1930 deletions(-)
diff --git a/.gitignore b/.gitignore
index 8b2a0ed..9b3b81a 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,15 +1,42 @@
-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
+dlm/tests/usertest/alternate-lvb
+dlm/tests/usertest/asttest
+dlm/tests/usertest/dlmtest
+dlm/tests/usertest/dlmtest2
+dlm/tests/usertest/flood
+dlm/tests/usertest/joinleave
+dlm/tests/usertest/lstest
+dlm/tests/usertest/lvb
+dlm/tests/usertest/pingtest
+dlm/tests/usertest/threads
+dlm/tool/dlm_tool
+group/dlm_controld/dlm_controld
+group/dlm_controld/dlm_controld.pcmk
diff --git a/Makefile b/Makefile
deleted file mode 100644
index c736105..0000000
--- a/Makefile
+++ /dev/null
@@ -1,57 +0,0 @@
-include make/defines.mk
-
-
-REALSUBDIRS = dlm group doc \
- bindings contrib
-
-SUBDIRS = $(filter-out \
- $(if ${without_dlm},dlm) \
- $(if ${without_group},group) \
- $(if ${without_bindings},bindings) \
- , $(REALSUBDIRS))
-
-all: ${SUBDIRS}
-
-${SUBDIRS}:
- [ -n "${without_$@}" ] || ${MAKE} -C $@ all
-
-# Dependencies
-
-dlm:
-group: dlm
-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..5bbbda4
--- /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 = dlm group 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 >/dev/null 2>&1
+ then
+ :
+ else
+ return 1
+ fi
+
+ # The GNU standard is --version
+ if
+ $cmd --version </dev/null >/dev/null 2>&1
+ then
+ return 0
+ fi
+
+ # Maybe it suppports -V instead
+ if
+ $cmd -V </dev/null >/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 afd34be..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;
-
-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.27';
-
-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,
- dlmincdir => \$dlmincdir,
- dlmlibdir => \$dlmlibdir,
- dlmcontrolincdir => \$dlmcontrolincdir,
- dlmcontrollibdir => \$dlmcontrollibdir,
- fencedincdir => \$fencedincdir,
- fencedlibdir => \$fencedlibdir,
- logtincdir => \$logtincdir,
- logtlibdir => \$logtlibdir,
- corosyncincdir => \$corosyncincdir,
- corosynclibdir => \$corosynclibdir,
- openaisincdir => \$openaisincdir,
- openaislibdir => \$openaislibdir,
- 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,
- enable_pacemaker => \$enable_pacemaker,
- somajor => \$somajor,
- sominor => \$sominor,
- release_version => \$release_version,
- without_dlm => \$without_dlm,
- without_group => \$without_group,
- 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',
- 'dlmincdir=s',
- 'dlmlibdir=s',
- 'dlmcontrolincdir=s',
- 'dlmcontrollibdir=s',
- 'fencedincdir=s',
- 'fencedlibdir=s',
- 'logtincdir=s',
- 'logtlibdir=s',
- 'corosyncincdir=s',
- 'corosynclibdir=s',
- 'openaisincdir=s',
- 'openaislibdir=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',
- 'enable_pacemaker',
- 'without_dlm',
- 'without_group',
- '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 "--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 "--dlmincdir=\tthe base directory for dlm include files. (Default: ./dlm/libdlm)\n";
- print "--dlmlibdir=\tthe base directory for dlm libraries. (Default: ./dlm/libdlm)\n";
- print "--dlmcontrolincdir=\tthe base directory for dlmcontrol include files. (Default: ./dlm/libdlmcontrol)\n";
- print "--dlmcontrollibdir=\tthe base directory for dlmcontrol libraries. (Default: ./dlm/libdlmcontrol)\n";
- print "--fencedincdir=\tthe base directory for fence include files. (Default: {incdir})\n";
- print "--fencedlibdir=\tthe base directory for fence 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 "--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 "--enable_pacemaker\tEnable building of Pacemaker-specific pieces\n";
- print "--without_dlm\tDisable dlm building (Default: enabled)\n";
- print "--without_group\tDisable group 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 (<MAKEFILE>) {
- $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 (<IFILE>) {
- chomp;
- s|\./||g;
- s|.*make\/defines.mk||g;
- $dirname = dirname($_);
- $filename = basename($_);
- system("mkdir -p $objdir/$dirname");
- symlink("${cdir}/$_","$objdir/$dirname/$filename");
- }
- close IFILE;
- return 0;
-}
-
-$pwd = `pwd`;
-chomp($pwd);
-
-if (!$cc) {
- $cc="gcc";
-}
-if (!$cflags) {
- $cflags="-Wall -Wformat=2 -MMD";
- if (!$debug) {
- $cflags="${cflags} -O2";
- } else {
- $cflags="${cflags} -O0 -DDEBUG";
- }
- $cflags="${cflags} -g";
-}
-if ($extracflags) {
- $cflags="${cflags} ${extracflags}";
-}
-if (!$ldflags) {
- $ldflags="";
-}
-if ($extraldflags) {
- $ldflags="${ldflags} ${extraldflags}";
-}
-if (!$prefix) {
- $prefix="/usr";
-}
-
-print "\nChecking tree: ";
-if (!$objdir) {
- $objdir="${pwd}";
-}
-$objdir = abs_path( $objdir );
-$cdir = dirname ( abs_path( $0 ) );
-unless ("$cdir" eq "$objdir") {
- chdir "$cdir";
-}
-
-if (! -d "$objdir/make") {
- print "setting up $objdir\n";
- mkdir "$objdir";
- symlinks(".","Makefile");
- symlinks(".","*.mk");
- 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 (!$module_dir) {
- $module_dir="/lib/modules/$un[2]/kernel";
-}
-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 (!$dlmincdir) {
- $dlmincdir="${cdir}/dlm/libdlm";
-}
-if (!$dlmlibdir) {
- $dlmlibdir="${objdir}/dlm/libdlm";
-}
-if (!$dlmcontrolincdir) {
- $dlmcontrolincdir="${cdir}/dlm/libdlmcontrol";
-}
-if (!$dlmcontrollibdir) {
- $dlmcontrollibdir="${objdir}/dlm/libdlmcontrol";
-}
-if (!$fencedincdir) {
- $fencedincdir="${incdir}";
-}
-if (!$fencedlibdir) {
- $fencedlibdir="${libdir}";
-}
-if (!$logtincdir) {
- $logtincdir="${incdir}";
-}
-if (!$logtlibdir) {
- $logtlibdir="${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";
-}
-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 (!$enable_pacemaker) {
- $enable_pacemaker=""
-}
-if (!$without_dlm) {
- $without_dlm="";
-}
-if (!$without_group) {
- $without_group="";
-}
-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, "<make/defines.mk.input" or die "Can't redirect stdin";
-open OFILE, ">${objdir}/make/defines.mk" or die "Can't redirect stdout";
-
-print OFILE "# This file was generated by configure from defines.mk.input\n";
-
-while (<IFILE>) {
- chomp;
- $_ =~ s/\@SRCDIR\@/$cdir/;
- $_ =~ s/\@CC\@/$cc/;
- $_ =~ s/\@CFLAGS\@/$cflags/;
- $_ =~ s/\@LDFLAGS\@/$ldflags/;
- $_ =~ s/\@OBJDIR\@/$objdir/;
- $_ =~ s/\@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/\@DLMINCDIR\@/$dlmincdir/;
- $_ =~ s/\@DLMLIBDIR\@/$dlmlibdir/;
- $_ =~ s/\@DLMCONTROLINCDIR\@/$dlmcontrolincdir/;
- $_ =~ s/\@DLMCONTROLLIBDIR\@/$dlmcontrollibdir/;
- $_ =~ s/\@FENCEDINCDIR\@/$fencedincdir/;
- $_ =~ s/\@FENCEDLIBDIR\@/$fencedlibdir/;
- $_ =~ s/\@LOGTINCDIR\@/$logtincdir/;
- $_ =~ s/\@LOGTLIBDIR\@/$logtlibdir/;
- $_ =~ s/\@COROSYNCINCDIR\@/$corosyncincdir/;
- $_ =~ s/\@COROSYNCLIBDIR\@/$corosynclibdir/;
- $_ =~ s/\@OPENAISINCDIR\@/$openaisincdir/;
- $_ =~ s/\@OPENAISLIBDIR\@/$openaislibdir/;
- $_ =~ 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/\@ENABLE_PACEMAKER\@/$enable_pacemaker/;
- $_ =~ s/\@DISABLE_DLM\@/$without_dlm/;
- $_ =~ s/\@DISABLE_GROUP\@/$without_group/;
- $_ =~ 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 (<OFFICIAL_VERSION>) {
- 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..a2a7b60
--- /dev/null
+++ b/configure.ac
@@ -0,0 +1,289 @@
+
+# Process this file with autoconf to produce a configure script.
+
+AC_PREREQ([2.63b])
+AC_INIT([dlm], [master], [linux-cluster@redhat.com])
+AM_INIT_AUTOMAKE
+LT_PREREQ([2.2.7])
+LT_INIT
+
+AC_CONFIG_MACRO_DIR([m4])
+AC_CONFIG_SRCDIR([dlm/libdlm/libdlm.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([pacemaker],
+ [ --enable-pacemaker enable dlm_controld pacemaker build. ],
+ [ default="no" ])
+
+AC_ARG_ENABLE([cman],
+ [ --enable-cman enable dlm_controld cman build. ],,
+ [ enable_cman="yes" ])
+
+if test "x${enable_pacemaker}" = xno && test "x${enable_cman}" = xno; then
+ AC_MSG_ERROR([At least one dlm_controld build method (cman or pacemaker) has to be selected])
+fi
+
+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])
+
+if test "x${enable_pacemaker}" = xyes; then
+ PKG_CHECK_MODULES([totempg],[libtotem_pg])
+ PKG_CHECK_MODULES([xml],[libxml-2.0])
+ PKG_CHECK_MODULES([glib],[glib-2.0])
+ check_lib_no_libs cib cib_new
+ check_lib_no_libs crmcluster crm_set_status_callback
+ check_lib_no_libs crmcommon init_server_ipc_comms
+fi
+
+if test "x${enable_cman}" = xyes; then
+ PKG_CHECK_MODULES([ccs],[libccs])
+ PKG_CHECK_MODULES([cfg],[libcfg])
+ PKG_CHECK_MODULES([quorum],[libquorum])
+ PKG_CHECK_MODULES([fenced],[libfenced])
+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 limits.h netdb.h netinet/in.h stddef.h stdint.h stdlib.h string.h sys/file.h sys/ioctl.h sys/param.h sys/socket.h sys/time.h syslog.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/major.h linux/types.h linux/dlmconstants.h linux/dlm.h linux/dlm_device.h linux/dlm_plock.h],,
+ [AC_MSG_ERROR([Unable to find dlm 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_INT8_T
+AC_TYPE_MODE_T
+AC_TYPE_SIZE_T
+AC_CHECK_MEMBERS([struct stat.st_rdev])
+AC_TYPE_UINT16_T
+AC_TYPE_UINT32_T
+AC_TYPE_UINT64_T
+AC_TYPE_UINT8_T
+
+# Checks for library functions.
+AC_FUNC_ERROR_AT_LINE
+AC_FUNC_FORK
+AC_FUNC_LSTAT_FOLLOWS_SLASHED_SYMLINK
+AC_FUNC_MALLOC
+AC_HEADER_MAJOR
+AC_FUNC_REALLOC
+AC_CHECK_FUNCS([ftruncate gettimeofday memset mkdir rmdir socket strchr strdup strerror strncasecmp 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(ENABLE_PACEMAKER, test "x${enable_pacemaker}" = xyes)
+AM_CONDITIONAL(ENABLE_CMAN, test "x${enable_cman}" = 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
+ dlm/Makefile
+ dlm/libdlm/Makefile
+ dlm/libdlm/libdlm.pc
+ dlm/libdlm/libdlm_lt.pc
+ dlm/libdlmcontrol/Makefile
+ dlm/libdlmcontrol/libdlmcontrol.pc
+ dlm/tool/Makefile
+ dlm/tests/Makefile
+ dlm/tests/usertest/Makefile
+ dlm/man/Makefile
+ dlm/doc/Makefile
+ doc/Makefile
+ group/Makefile
+ group/dlm_controld/Makefile
+ group/include/Makefile
+ group/man/Makefile
+ ])
+
+AC_OUTPUT
diff --git a/contrib/Makefile b/contrib/Makefile
deleted file mode 100644
index 368e035..0000000
--- a/contrib/Makefile
+++ /dev/null
@@ -1,6 +0,0 @@
-include ../make/defines.mk
-include $(OBJDIR)/make/passthrough.mk
-
-ifdef contrib_code
-SUBDIRS=libaislock
-endif
diff --git a/contrib/libaislock/Makefile b/contrib/libaislock/Makefile
deleted file mode 100644
index 269d845..0000000
--- a/contrib/libaislock/Makefile
+++ /dev/null
@@ -1,15 +0,0 @@
-TARGET= libaislock
-
-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${dlmincdir}
-CFLAGS += -I${incdir}
-
-LDFLAGS += -L${dlmlibdir} -ldlm
-LDFLAGS += -lpthread
diff --git a/contrib/libaislock/libaislock.c b/contrib/libaislock/libaislock.c
deleted file mode 100644
index 82f06ab..0000000
--- a/contrib/libaislock/libaislock.c
+++ /dev/null
@@ -1,466 +0,0 @@
-#include <pthread.h>
-#include <stdint.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include <errno.h>
-#include <string.h>
-#include <unistd.h>
-#include <fcntl.h>
-#include <sys/ioctl.h>
-#include <sys/param.h>
-#include <sys/types.h>
-#include <sys/file.h>
-#include <sys/stat.h>
-
-#include <linux/types.h>
-#include <linux/dlm.h>
-#define BUILDING_LIBDLM
-#include "libdlm.h"
-#include "libaislock.h"
-#include <linux/dlm_device.h>
-
-enum {
- SA_LCK_GRANT_CB = 1,
- SA_LCK_WAITER_CB = 2,
-};
-
-static struct dlm_ls_info *sa_default_ls = NULL;
-
-inline int lkmode_ais2dlm(SaLckLockModeT mode)
-{
- switch(mode)
- {
- case SA_LCK_PR_LOCK_MODE:
- return DLM_LOCK_PR;
- case SA_LCK_EX_LOCK_MODE:
- return DLM_LOCK_EX;
- default:
- return -1;
- }
-}
-
-inline SaLckLockModeT lkmode_dlm2ais(int mode)
-{
- switch(mode)
- {
- case DLM_LOCK_PR:
- return SA_LCK_PR_LOCK_MODE;
- case DLM_LOCK_EX:
- return SA_LCK_EX_LOCK_MODE;
- default:
- return -1;
- }
-}
-
-inline unsigned long lkflag_ais2dlm(SaLckLockFlagsT flag)
-{
- unsigned long dlm_flag = 0;
-
- if(flag & SA_LCK_LOCK_NO_QUEUE)
- dlm_flag |= DLM_LKF_NOQUEUE;
- if(flag & SA_LCK_LOCK_ORPHAN)
- dlm_flag |= DLM_LKF_ORPHAN;
-
- return dlm_flag;
-}
-
-inline SaLckLockStatusT lkstatus_dlm2ais(int status)
-{
- switch(status)
- {
- case -ENOMEM:
- return SA_LCK_LOCK_NO_MORE;
- case 0:
- return SA_LCK_LOCK_GRANTED;
- case -EAGAIN:
- return SA_LCK_LOCK_NOT_QUEUED;
- default:
- return -1;
- }
-}
-
-inline SaErrorT lkerr_dlm2ais(int status)
-{
- switch(status)
- {
- case -EINVAL:
- return SA_ERR_INVALID_PARAM;
- case 0:
- return SA_OK;
- default:
- return -1;
- }
-}
-
-
-SaErrorT
-saLckInitialize(SaLckHandleT *lckHandle, const SaLckCallbacksT *lckCallbacks,
- const SaVersionT *version)
-{
- dlm_lshandle_t ls = NULL;
-
- if (NULL == lckHandle)
- return SA_ERR_INVALID_PARAM;
-
- if (lckCallbacks) {
- lckHandle->callback.saLckLockGrantCallback =
- lckCallbacks->saLckLockGrantCallback;
- lckHandle->callback.saLckLockWaiterCallback =
- lckCallbacks->saLckLockWaiterCallback;
- lckHandle->callback.saLckResourceUnlockCallback =
- lckCallbacks->saLckResourceUnlockCallback;
- } else {
- lckHandle->callback.saLckLockGrantCallback = NULL;
- lckHandle->callback.saLckLockWaiterCallback = NULL;
- lckHandle->callback.saLckResourceUnlockCallback = NULL;
- }
- lckHandle->version.releaseCode = version->releaseCode;
- lckHandle->version.major = version->major;
- lckHandle->version.minor = version->minor;
-
- ls = dlm_create_lockspace("sa_default", 0600);
- if (!ls)
- return SA_ERR_LIBRARY;
-
- sa_default_ls = (struct dlm_ls_info *)ls;
- return SA_OK;
-}
-
-
-SaErrorT
-saLckFinalize(SaLckHandleT *lckHandle)
-{
- if ( NULL == sa_default_ls ) {
- return SA_ERR_LIBRARY;
- }
-
- if(!dlm_release_lockspace("sa_default", sa_default_ls, 1)) {
- return SA_OK;
- } else {
- return SA_ERR_LIBRARY;
- }
-}
-
-SaErrorT
-saLckResourceOpen(const SaLckHandleT *lckHandle, const SaNameT *lockName,
- SaLckResourceIdT *resourceId)
-{
- if ( NULL == sa_default_ls ) {
- return SA_ERR_LIBRARY;
- }
-
- if (lockName->length <= 31 ) /* OpenDLM only support namelen <= 31*/
- {
- resourceId->name.length = lockName->length;
- strncpy((char *)resourceId->name.value, (char *)lockName->value, lockName->length);
- } else {
- return SA_ERR_NO_MEMORY;
- }
-
- return SA_OK;
-}
-
-
-SaErrorT
-saLckResourceClose(SaLckHandleT *lckHandle, SaLckResourceIdT *resourceId)
-{
- if ( NULL == sa_default_ls ) {
- return SA_ERR_LIBRARY;
- }
-
- return SA_OK;
-}
-
-
-SaErrorT
-saLckSelectionObjectGet(const SaLckHandleT *lckHandle,
- SaSelectionObjectT *selectionObject)
-{
- int fd = -1;
-
- if ( NULL == sa_default_ls ) {
- return SA_ERR_LIBRARY;
- }
-
- fd = dlm_ls_get_fd(sa_default_ls);
-
- if(!fd)
- return SA_ERR_LIBRARY;
-
- *selectionObject = fd;
-
- return SA_OK;
-}
-
-
-SaErrorT
-saLckDispatch(const SaLckHandleT *lckHandle,
- const SaDispatchFlagsT dispatchFlags)
-{
- int status;
- int fdflags;
- char resultbuf[sizeof(struct dlm_lock_result)];
- struct dlm_lock_result *result = (struct dlm_lock_result *)resultbuf;
- char *fullresult=NULL;
- SaLckLockIdT *lkid;
- SaLckLockModeT lock_mode;
- int fd = -1;
-
- if ( NULL == sa_default_ls ) {
- return SA_ERR_LIBRARY;
- }
-
- fd = dlm_ls_get_fd(sa_default_ls);
-
- if(!fd)
- return SA_ERR_LIBRARY;
-
- fdflags = fcntl(fd, F_GETFL, 0);
- fcntl(fd, F_SETFL, fdflags | O_NONBLOCK);
-
- do
- {
-
- /* Just read the header first */
- status = read(fd, result, sizeof(struct dlm_lock_result));
- if (status <= 0)
- break;
-
- if (result->length != status)
- {
- int newstat;
-
- fullresult = malloc(result->length);
- if (!fullresult)
- break;
-
- newstat = read(fd, fullresult, result->length);
-
- /* If it read OK then use the new data. otherwise we can
- still deliver the AST, it just might not have all the
- info in it...hmmm */
- if (newstat == result->length)
- result = (struct dlm_lock_result *)fullresult;
- }
-
- /* Copy lksb to user's buffer - except the LVB ptr */
- memcpy(result->user_lksb, &result->lksb,
- sizeof(struct dlm_lksb) - sizeof(char*));
-
- /* Flip the status. Kernel space likes negative return codes,
- userspace positive ones */
- result->user_lksb->sb_status = -result->user_lksb->sb_status;
-
- /* Need not to care LVB*/
-#ifdef QUERY
- /* Copy optional items */
- if (result->qinfo_offset)
- {
- /* Just need the lockcount written out here */
- struct dlm_queryinfo *qi = (struct dlm_queryinfo *)
- (fullresult+result->qinfo_offset);
- result->user_qinfo->gqi_lockcount = qi->gqi_lockcount;
- }
-
- if (result->qresinfo_offset)
- memcpy(result->user_qinfo->gqi_resinfo,
- fullresult+result->qresinfo_offset,
- sizeof(struct dlm_resinfo));
-
- if (result->qlockinfo_offset)
- memcpy(result->user_qinfo->gqi_lockinfo,
- fullresult+result->qlockinfo_offset,
- sizeof(struct dlm_lockinfo) *
- result->user_qinfo->gqi_lockcount);
-#endif
- /* Call AST */
- lkid = (SaLckLockIdT *)result->user_astparam;
- if (lkid->unlock) {
- /* dispatch unlock ast */
- lkid->unlock = 0;
- lkid->held_mode = 0;
- if(lckHandle->callback.saLckResourceUnlockCallback)
- lckHandle->callback.
- saLckResourceUnlockCallback(
- lkid->args, lkid->resource, lkid,
- SA_LCK_LOCK_RELEASED, SA_OK);
-
- } else if (SA_LCK_GRANT_CB == (int)result->user_astaddr) {
- /* dispatch lock ast */
- if (0 == lkid->lksb.sb_status) {
- lkid->held_mode = lkid->requested_mode;
- lock_mode = lkid->requested_mode;
- } else {
- lock_mode = lkid->held_mode;
- }
-
- if(lckHandle->callback.saLckLockGrantCallback)
- lckHandle->callback.
- saLckLockGrantCallback(
- lkid->args, lkid->resource,
- lkid, lock_mode,
- lkstatus_dlm2ais(
- lkid->lksb.sb_status),
- SA_OK);
- } else if (SA_LCK_WAITER_CB == (int)result->user_astaddr) {
- /* dispatch waiter ast */
- if(lckHandle->callback.saLckLockWaiterCallback)
- lckHandle->callback.
- saLckLockWaiterCallback(
- lkid->args, lkid->resource,
- lkid, lkid->held_mode, result->bast_mode);
- } else {
- return SA_ERR_LIBRARY;
- }
- } while (0 !=status && SA_DISPATCH_ONE != dispatchFlags);
-
- /* EAGAIN is not an error */
- if (status < 0 && errno == EAGAIN)
- status = 0;
-
- fcntl(fd, F_SETFL, fdflags);
- return SA_OK;
-}
-
-SaErrorT
-SaLckResourceLockAsync(const SaLckHandleT *lckHandle, SaInvocationT invocation,
- const SaLckResourceIdT *resourceId, SaLckLockIdT *lockId,
- SaLckLockModeT lockMode, SaLckLockFlagsT lockFlags,
- SaTimeT timeout)
-{
- int ret_val; /* value to be returned from function */
-
- if ( NULL == sa_default_ls ) {
- return SA_ERR_LIBRARY;
- }
-
- /*FIXME deal with timeout in lock/lockasync/unlock.
- */
- lockId->resource = (SaLckResourceIdT *)resourceId;
- lockId->requested_mode = lockMode;
- lockId->args = invocation;
-
- ret_val = dlm_ls_lock(sa_default_ls, lkmode_ais2dlm(lockMode),
- &(lockId->lksb), lkflag_ais2dlm(lockFlags),
- (void *)(resourceId->name.value),
- resourceId->name.length, 0, (void *)SA_LCK_GRANT_CB,
- lockId, (void *)SA_LCK_WAITER_CB, NULL);
-
- return lkerr_dlm2ais(ret_val);
-}
-
-SaErrorT
-saLckResourceLock(const SaLckHandleT *lckHandle, SaInvocationT invocation,
- const SaLckResourceIdT *resourceId, SaLckLockIdT *lockId,
- SaLckLockModeT lockMode, SaLckLockFlagsT lockFlags,
- SaTimeT timeout, SaLckLockStatusT *lockStatus)
-
-{
- int ret_val; /* value to be returned from function */
-
- if ( NULL == sa_default_ls ) {
- return SA_ERR_LIBRARY;
- }
-
- lockId->resource = (SaLckResourceIdT *)resourceId;
- lockId->requested_mode = lockMode;
- lockId->args = invocation;
-
- ret_val = dlm_ls_lock_wait(sa_default_ls, lkmode_ais2dlm(lockMode),
- &(lockId->lksb), lkflag_ais2dlm(lockFlags),
- (void *)(resourceId->name.value),
- resourceId->name.length, 0, lockId,
- (void *)SA_LCK_WAITER_CB, NULL);
-
- *lockStatus = lkstatus_dlm2ais(lockId->lksb.sb_status);
- lockId->held_mode = lockId->requested_mode;
-
- return lkerr_dlm2ais(ret_val);
-}
-
-SaErrorT
-saLckResourceUnlock(const SaLckHandleT *lckHandle, SaLckLockIdT *lockId,
- SaTimeT timeout)
-{
- int ret_val; /* value to be returned from function */
-
- if ( NULL == sa_default_ls ) {
- return SA_ERR_LIBRARY;
- }
-
- ret_val = dlm_ls_unlock_wait(sa_default_ls, lockId->lksb.sb_lkid, 0,
- &(lockId->lksb));
- lockId->held_mode = 0;
-
- return lkerr_dlm2ais(ret_val);
-}
-
-SaErrorT
-saLckResourceUnlockAsync(const SaLckHandleT *lckHandle,
- SaInvocationT invocation, SaLckLockIdT *lockId)
-{
- int ret_val; /* value to be returned from function */
-
- if ( NULL == sa_default_ls ) {
- return SA_ERR_LIBRARY;
- }
-
- lockId->unlock = 1;
- lockId->args = invocation;
-
-
- ret_val = dlm_ls_unlock(sa_default_ls, lockId->lksb.sb_lkid, 0, &(lockId->lksb),
- lockId);
-
- return lkerr_dlm2ais(ret_val);
-}
-
-
-SaErrorT
-saLckLockPurge(const SaLckHandleT *lckHandle,
- const SaLckResourceIdT *resourceId)
-{
-#ifdef QUERY
- int ret_val; /* value to be returned from function */
- SaLckLockIdT lockId;
- struct dlm_lksb lksb;
- struct dlm_resinfo resinfo;
- static struct dlm_queryinfo qinfo;
- struct dlm_lockinfo *p;
-
- qinfo.gqi_resinfo = &resinfo;
- qinfo.gqi_lockinfo = malloc(sizeof(struct dlm_lockinfo) * 10);
- qinfo.gqi_locksize = 10;
-
-
- if ( NULL == sa_default_ls ) {
- return SA_ERR_LIBRARY;
- }
-
- lockId.resource = (SaLckResourceIdT *)resourceId;
- lockId.requested_mode = DLM_LOCK_NL;
-
- ret_val = dlm_ls_lock_wait(sa_default_ls, DLM_LOCK_NL,
- &(lockId.lksb), DLM_LKF_EXPEDITE,
- (void *)(resourceId->name.value),
- resourceId->name.length, 0, &lockId,
- (void *)SA_LCK_WAITER_CB, NULL);
-
- dlm_ls_query_wait(sa_default_ls, &(lockId.lksb),
- DLM_QUERY_QUEUE_ALL|DLM_QUERY_LOCKS_ORPHAN, &qinfo);
-
- for ( p = qinfo.gqi_lockinfo; 0 != p->lki_lkid; p++ ) {
- lksb.sb_lkid = p->lki_lkid;
- ret_val = dlm_ls_unlock_wait(sa_default_ls, p->lki_lkid, 0,
- &lksb);
- }
-
- ret_val = dlm_ls_unlock_wait(sa_default_ls, lockId.lksb.sb_lkid, 0,
- &(lockId.lksb));
-
- return lkerr_dlm2ais(ret_val);
-#else
- return -1;
-#endif
-}
-
diff --git a/contrib/libaislock/libaislock.h b/contrib/libaislock/libaislock.h
deleted file mode 100644
index 3faeffd..0000000
--- a/contrib/libaislock/libaislock.h
+++ /dev/null
@@ -1,190 +0,0 @@
-typedef char SaInt8T;
-typedef short SaInt16T;
-typedef long SaInt32T;
-typedef long long SaInt64T;
-typedef unsigned char SaUint8T;
-typedef unsigned short SaUint16T;
-typedef unsigned long SaUint32T;
-typedef unsigned long long SaUint64T;
-typedef SaInt64T SaTimeT;
-
-#define SA_MAX_NAME_LENGTH 256
-
-typedef struct {
- SaUint16T length;
- unsigned char value[SA_MAX_NAME_LENGTH];
-} SaNameT;
-
-typedef struct {
- char releaseCode;
- unsigned char major;
- unsigned char minor;
-} SaVersionT;
-
-typedef int SaSelectionObjectT;
-
-typedef void *SaInvocationT;
-
-typedef enum {
- SA_DISPATCH_ONE = 1,
- SA_DISPATCH_ALL = 2,
- SA_DISPATCH_BLOCKING = 3
-} SaDispatchFlagsT;
-
-typedef enum {
- SA_OK = 1,
- SA_ERR_LIBRARY = 2,
- SA_ERR_VERSION = 3,
- SA_ERR_INIT = 4,
- SA_ERR_TIMEOUT = 5,
- SA_ERR_TRY_AGAIN = 6,
- SA_ERR_INVALID_PARAM = 7,
- SA_ERR_NO_MEMORY = 8,
- SA_ERR_BAD_HANDLE = 9,
- SA_ERR_BUSY = 10,
- SA_ERR_ACCESS = 11,
- SA_ERR_NOT_EXIST = 12,
- SA_ERR_NAME_TOO_LONG = 13,
- SA_ERR_EXIST = 14,
- SA_ERR_NO_SPACE = 15,
- SA_ERR_INTERRUPT =16,
- SA_ERR_SYSTEM = 17,
- SA_ERR_NAME_NOT_FOUND = 18,
- SA_ERR_NO_RESOURCES = 19,
- SA_ERR_NOT_SUPPORTED = 20,
- SA_ERR_BAD_OPERATION = 21,
- SA_ERR_FAILED_OPERATION = 22,
- SA_ERR_MESSAGE_ERROR = 23,
- SA_ERR_NO_MESSAGE = 24,
- SA_ERR_QUEUE_FULL = 25,
- SA_ERR_QUEUE_NOT_AVAILABLE = 26,
- SA_ERR_BAD_CHECKPOINT = 27,
- SA_ERR_BAD_FLAGS = 28
-} SaErrorT;
-
-/* Chapter 10 */
-typedef enum {
- SA_LCK_PR_LOCK_MODE = 1,
- SA_LCK_EX_LOCK_MODE = 2
-} SaLckLockModeT;
-
-typedef struct{
- int site;
- int pid;
-} SaLckLockHolderT;
-
-typedef struct {
- SaLckLockHolderT orphan_holder;
- SaNameT name;
-} SaLckResourceIdT;
-
-typedef struct {
- struct dlm_lksb lksb;
- SaLckResourceIdT *resource;
- SaLckLockModeT held_mode;
- SaLckLockModeT requested_mode;
- int unlock;
- SaInvocationT args;
-} SaLckLockIdT;
-
-#define SA_LCK_LOCK_NO_QUEUE 0x1
-#define SA_LCK_LOCK_ORPHAN 0x2
-#define SA_LCK_LOCK_TIMEOUT 0X4
-typedef SaUint32T SaLckLockFlagsT;
-
-typedef enum {
- SA_LCK_LOCK_GRANTED = 1,
- SA_LCK_LOCK_RELEASED = 2,
- SA_LCK_LOCK_DEADLOCK = 3,
- SA_LCK_LOCK_NOT_QUEUED = 4,
- SA_LCK_LOCK_TIMED_OUT = 5,
- SA_LCK_LOCK_ORPHANED = 6,
- SA_LCK_LOCK_NO_MORE = 7
-} SaLckLockStatusT;
-
-typedef void
-(*SaLckLockGrantCallbackT)(SaInvocationT invocation,
- const SaLckResourceIdT *resourceId,
- const SaLckLockIdT *lockId,
- SaLckLockModeT lockMode,
- SaLckLockStatusT lockStatus,
- SaErrorT error);
-
-typedef void
-(*SaLckLockWaiterCallbackT)(SaInvocationT invocation,
- const SaLckResourceIdT *resourceId,
- const SaLckLockIdT *lockId,
- SaLckLockModeT modeHeld,
- SaLckLockModeT modeRequested);
-
-typedef void
-(*SaLckResourceUnlockCallbackT)(SaInvocationT invocation,
- const SaLckResourceIdT *resourceId,
- const SaLckLockIdT *lockId,
- SaLckLockStatusT lockStatus,
- SaErrorT error);
-typedef struct SaLckCallbacks {
- SaLckLockGrantCallbackT saLckLockGrantCallback;
- SaLckLockWaiterCallbackT saLckLockWaiterCallback;
- SaLckResourceUnlockCallbackT saLckResourceUnlockCallback;
-}SaLckCallbacksT;
-
-typedef struct {
- SaLckCallbacksT callback;
- SaVersionT version;
-} SaLckHandleT;
-
- SaErrorT
-saLckInitialize(SaLckHandleT *lckHandle, const SaLckCallbacksT *lckCallbacks,
- const SaVersionT *version);
-
- SaErrorT
-saLckSelectionObjectGet(const SaLckHandleT *lckHandle,
- SaSelectionObjectT *selectionObject);
-
- SaErrorT
-saLckDispatch(const SaLckHandleT *lckHandle,
- const SaDispatchFlagsT dispatchFlags);
-
- SaErrorT
-saLckFinalize(SaLckHandleT *lckHandle);
-
- SaErrorT
-saLckResourceOpen(const SaLckHandleT *lckHandle,
- const SaNameT *lockName,
- SaLckResourceIdT *resourceId);
-
- SaErrorT
-saLckResourceClose(SaLckHandleT *lckHandle, SaLckResourceIdT *resourceId);
-
- SaErrorT
-saLckResourceLock(const SaLckHandleT *lckHandle, SaInvocationT invocation,
- const SaLckResourceIdT *resourceId,
- SaLckLockIdT *lockId,
- SaLckLockModeT lockMode,
- SaLckLockFlagsT lockFlags,
- SaTimeT timeout,
- SaLckLockStatusT *lockStatus);
-
- SaErrorT
-SaLckResourceLockAsync(const SaLckHandleT *lckHandle,
- SaInvocationT invocation,
- const SaLckResourceIdT *resourceId,
- SaLckLockIdT *lockId,
- SaLckLockModeT lockMode,
- SaLckLockFlagsT lockFlags,
- SaTimeT timeout);
-
- SaErrorT
-saLckResourceUnlock(const SaLckHandleT *lckHandle,
- SaLckLockIdT *lockId,
- SaTimeT timeout);
-
- SaErrorT
-saLckResourceUnlockAsync(const SaLckHandleT *lckHandle,
- SaInvocationT invocation,
- SaLckLockIdT *lockId);
-
- SaErrorT
-saLckLockPurge(const SaLckHandleT *lckHandle,
- const SaLckResourceIdT *resourceId);
diff --git a/contrib/libaislock/libaislock.pc.in b/contrib/libaislock/libaislock.pc.in
deleted file mode 100644
index a4804a9..0000000
--- a/contrib/libaislock/libaislock.pc.in
+++ /dev/null
@@ -1,11 +0,0 @@
-prefix=@PREFIX@
-exec_prefix=${prefix}
-libdir=@LIBDIR@
-includedir=@INCDIR@
-
-Name: libaislock
-Version: @VERSION@
-Description: libaislock
-Requires:
-Libs: -L${libdir} -laislock
-Cflags: -I${includedir}
diff --git a/dlm/Makefile b/dlm/Makefile
deleted file mode 100644
index 7c8cc33..0000000
--- a/dlm/Makefile
+++ /dev/null
@@ -1,4 +0,0 @@
-include ../make/defines.mk
-include $(OBJDIR)/make/passthrough.mk
-
-SUBDIRS=libdlm libdlmcontrol tool man
diff --git a/dlm/Makefile.am b/dlm/Makefile.am
new file mode 100644
index 0000000..454f628
--- /dev/null
+++ b/dlm/Makefile.am
@@ -0,0 +1,3 @@
+MAINTAINERCLEANFILES = Makefile.in
+
+SUBDIRS = libdlm libdlmcontrol tool man doc tests
diff --git a/dlm/doc/Makefile.am b/dlm/doc/Makefile.am
new file mode 100644
index 0000000..40a1c79
--- /dev/null
+++ b/dlm/doc/Makefile.am
@@ -0,0 +1,6 @@
+MAINTAINERCLEANFILES = Makefile.in
+
+dist_doc_DATA = dlm_tool.txt \
+ example.c \
+ libdlm.txt \
+ user-dlm-overview.txt
diff --git a/dlm/libdlm/Makefile b/dlm/libdlm/Makefile
deleted file mode 100644
index dfbfaa5..0000000
--- a/dlm/libdlm/Makefile
+++ /dev/null
@@ -1,81 +0,0 @@
-TARGET= libdlm
-
-LIBDIRT=$(TARGET).a \
- $(TARGET)_lt.a \
- $(TARGET).so.${SOMAJOR}.${SOMINOR} \
- $(TARGET)_lt.so.${SOMAJOR}.${SOMINOR}
-
-LIBSYMT=$(TARGET).so \
- $(TARGET)_lt.so \
- $(TARGET).so.$(SOMAJOR) \
- $(TARGET)_lt.so.$(SOMAJOR)
-
-INCDIRT=$(TARGET).h
-
-UDEVT=51-dlm.rules
-
-PKGCONF=$(TARGET).pc $(TARGET)_lt.pc
-
-include ../../make/defines.mk
-
-SHAREDLIB=$(TARGET).so.${SOMAJOR}.${SOMINOR} $(TARGET)_lt.so.${SOMAJOR}.${SOMINOR}
-STATICLIB=$(TARGET).a $(TARGET)_lt.a
-
-all: $(STATICLIB) $(SHAREDLIB) $(PKGCONF)
-
-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)
-CFLAGS += -I${incdir}
-CFLAGS += -I$(KERNEL_SRC)/include
-
-REENT_CFLAGS += -D_REENTRANT
-
-LDFLAGS += -L${libdir}
-
-PTHREAD_LDFLAGS += -lpthread
-
-$(TARGET).a: $(TARGET).o
- ${AR} cru $@ $^
- ${RANLIB} $@
-
-$(TARGET)_lt.a: $(TARGET)_lt.o
- ${AR} cru $@ $^
- ${RANLIB} $@
-
-$(TARGET).so.${SOMAJOR}.${SOMINOR}: $(TARGET).o
- $(CC) -shared -o $@ -Wl,-soname=$(TARGET).so.$(SOMAJOR) $< $(PTHREAD_LDFLAGS) $(LDFLAGS)
- ln -sf $(TARGET).so.$(SOMAJOR).$(SOMINOR) $(TARGET).so
- ln -sf $(TARGET).so.$(SOMAJOR).$(SOMINOR) $(TARGET).so.$(SOMAJOR)
-
-$(TARGET)_lt.so.${SOMAJOR}.${SOMINOR}: $(TARGET)_lt.o
- $(CC) -shared -o $@ -Wl,-soname=$(TARGET)_lt.so.$(SOMAJOR) $< $(LDFLAGS)
- ln -sf $(TARGET)_lt.so.$(SOMAJOR).$(SOMINOR) $(TARGET)_lt.so
- ln -sf $(TARGET)_lt.so.$(SOMAJOR).$(SOMINOR) $(TARGET)_lt.so.$(SOMAJOR)
-
-$(TARGET).pc: $(S)/$(TARGET).pc.in
- cat $(S)/$(TARGET).pc.in | \
- sed \
- -e 's#@PREFIX@#${prefix}#g' \
- -e 's#@LIBDIR@#${libdir}#g' \
- -e 's#@INCDIR@#${incdir}#g' \
- -e 's#@VERSION@#${RELEASE_VERSION}#g' \
- > $@
-
-$(TARGET)_lt.pc: $(S)/$(TARGET)_lt.pc.in
- cat $(S)/$(TARGET)_lt.pc.in | \
- sed \
- -e 's#@PREFIX@#${prefix}#g' \
- -e 's#@LIBDIR@#${libdir}#g' \
- -e 's#@INCDIR@#${incdir}#g' \
- -e 's#@VERSION@#${RELEASE_VERSION}#g' \
- > $@
-
-clean: generalclean
-
--include $(TARGET).d
--include $(TARGET)_lt.d
diff --git a/dlm/libdlm/Makefile.am b/dlm/libdlm/Makefile.am
new file mode 100644
index 0000000..7236ee9
--- /dev/null
+++ b/dlm/libdlm/Makefile.am
@@ -0,0 +1,28 @@
+MAINTAINERCLEANFILES = Makefile.in
+
+libversion = 3:0:0
+
+include_HEADERS = libdlm.h
+
+noinst_HEADERS = libdlm_internal.h
+
+pkgconfigdir = $(libdir)/pkgconfig
+
+pkgconfig_DATA = libdlm.pc libdlm_lt.pc
+
+udevrulesdir = $(sysconfdir)/udev/rules.d
+
+udevrules_DATA = $(srcdir)/51-dlm.rules
+
+lib_LTLIBRARIES = libdlm.la libdlm_lt.la
+
+libdlm_la_SOURCES = libdlm.c
+
+libdlm_lt_la_SOURCES = libdlm.c
+
+libdlm_la_CPPFLAGS = -D_REENTRANT
+
+libdlm_la_LDFLAGS = -lpthread \
+ -version-info $(libversion)
+
+libdlm_lt_la_LDFLAGS = -version-info $(libversion)
diff --git a/dlm/libdlm/libdlm.c b/dlm/libdlm/libdlm.c
index c925233..03f4664 100644
--- a/dlm/libdlm/libdlm.c
+++ b/dlm/libdlm/libdlm.c
@@ -1,3 +1,5 @@
+#include "clusterautoconfig.h"
+
#ifdef _REENTRANT
#include <pthread.h>
#endif
diff --git a/dlm/libdlm/libdlm.pc.in b/dlm/libdlm/libdlm.pc.in
index bfda97e..5068aff 100644
--- a/dlm/libdlm/libdlm.pc.in
+++ b/dlm/libdlm/libdlm.pc.in
@@ -1,7 +1,7 @@
-prefix=@PREFIX@
+prefix=@prefix@
exec_prefix=${prefix}
-libdir=@LIBDIR@
-includedir=@INCDIR@
+libdir=@libdir@
+includedir=${prefix}/include
Name: libdlm
Version: @VERSION@
diff --git a/dlm/libdlm/libdlm_lt.pc.in b/dlm/libdlm/libdlm_lt.pc.in
index bc096e7..502cb00 100644
--- a/dlm/libdlm/libdlm_lt.pc.in
+++ b/dlm/libdlm/libdlm_lt.pc.in
@@ -1,9 +1,9 @@
-prefix=@PREFIX@
+prefix=@prefix@
exec_prefix=${prefix}
-libdir=@LIBDIR@
-includedir=@INCDIR@
+libdir=@libdir@
+includedir=${prefix}/include
-Name: libdlm
+Name: libdlm_lt
Version: @VERSION@
Description: Cluster Distributed Lock Manager non-threaded library
Requires:
diff --git a/dlm/libdlmcontrol/Makefile b/dlm/libdlmcontrol/Makefile
deleted file mode 100644
index 28faedd..0000000
--- a/dlm/libdlmcontrol/Makefile
+++ /dev/null
@@ -1,15 +0,0 @@
-TARGET= libdlmcontrol
-
-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/dlm_controld
-CFLAGS += -I${incdir}
-CFLAGS += -I$(KERNEL_SRC)/include
diff --git a/dlm/libdlmcontrol/Makefile.am b/dlm/libdlmcontrol/Makefile.am
new file mode 100644
index 0000000..3e3f48f
--- /dev/null
+++ b/dlm/libdlmcontrol/Makefile.am
@@ -0,0 +1,17 @@
+MAINTAINERCLEANFILES = Makefile.in
+
+libversion = 3:0:0
+
+include_HEADERS = libdlmcontrol.h
+
+pkgconfigdir = $(libdir)/pkgconfig
+
+pkgconfig_DATA = libdlmcontrol.pc
+
+lib_LTLIBRARIES = libdlmcontrol.la
+
+libdlmcontrol_la_SOURCES = main.c
+
+libdlmcontrol_la_CPPFLAGS = -I${top_srcdir}/group/dlm_controld
+
+libdlmcontrol_la_LDFLAGS = -version-info $(libversion)
diff --git a/dlm/libdlmcontrol/libdlmcontrol.pc.in b/dlm/libdlmcontrol/libdlmcontrol.pc.in
index db7dfa9..4273ee4 100644
--- a/dlm/libdlmcontrol/libdlmcontrol.pc.in
+++ b/dlm/libdlmcontrol/libdlmcontrol.pc.in
@@ -1,7 +1,7 @@
-prefix=@PREFIX@
+prefix=@prefix@
exec_prefix=${prefix}
-libdir=@LIBDIR@
-includedir=@INCDIR@
+libdir=@libdir@
+includedir=${prefix}/include
Name: libdlmcontrol
Version: @VERSION@
diff --git a/dlm/libdlmcontrol/main.c b/dlm/libdlmcontrol/main.c
index c31afb8..fcd44d5 100644
--- a/dlm/libdlmcontrol/main.c
+++ b/dlm/libdlmcontrol/main.c
@@ -1,3 +1,5 @@
+#include "clusterautoconfig.h"
+
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
diff --git a/dlm/man/Makefile b/dlm/man/Makefile
deleted file mode 100644
index 9041a93..0000000
--- a/dlm/man/Makefile
+++ /dev/null
@@ -1,24 +0,0 @@
-TARGET= dlm_cleanup.3 \
- dlm_close_lockspace.3 \
- dlm_create_lockspace.3 \
- dlm_dispatch.3 \
- dlm_get_fd.3 \
- dlm_lock.3 \
- dlm_lock_wait.3 \
- dlm_ls_lock.3 \
- dlm_ls_lockx.3 \
- dlm_ls_lock_wait.3 \
- dlm_ls_pthread_init.3 \
- dlm_ls_unlock.3 \
- dlm_ls_unlock_wait.3 \
- dlm_new_lockspace.3 \
- dlm_open_lockspace.3 \
- dlm_pthread_init.3 \
- dlm_release_lockspace.3 \
- dlm_unlock.3 \
- dlm_unlock_wait.3 \
- libdlm.3 \
- dlm_tool.8
-
-include ../../make/defines.mk
-include $(OBJDIR)/make/man.mk
diff --git a/dlm/man/Makefile.am b/dlm/man/Makefile.am
new file mode 100644
index 0000000..8502496
--- /dev/null
+++ b/dlm/man/Makefile.am
@@ -0,0 +1,23 @@
+MAINTAINERCLEANFILES = Makefile.in
+
+dist_man_MANS = dlm_cleanup.3 \
+ dlm_close_lockspace.3 \
+ dlm_create_lockspace.3 \
+ dlm_dispatch.3 \
+ dlm_get_fd.3 \
+ dlm_lock.3 \
+ dlm_lock_wait.3 \
+ dlm_ls_lock.3 \
+ dlm_ls_lockx.3 \
+ dlm_ls_lock_wait.3 \
+ dlm_ls_pthread_init.3 \
+ dlm_ls_unlock.3 \
+ dlm_ls_unlock_wait.3 \
+ dlm_new_lockspace.3 \
+ dlm_open_lockspace.3 \
+ dlm_pthread_init.3 \
+ dlm_release_lockspace.3 \
+ dlm_unlock.3 \
+ dlm_unlock_wait.3 \
+ libdlm.3 \
+ dlm_tool.8
diff --git a/dlm/tests/Makefile b/dlm/tests/Makefile
deleted file mode 100644
index 28685d2..0000000
--- a/dlm/tests/Makefile
+++ /dev/null
@@ -1,4 +0,0 @@
-include ../../make/defines.mk
-include $(OBJDIR)/make/passthrough.mk
-
-SUBDIRS=usertest
diff --git a/dlm/tests/Makefile.am b/dlm/tests/Makefile.am
new file mode 100644
index 0000000..78fd9bb
--- /dev/null
+++ b/dlm/tests/Makefile.am
@@ -0,0 +1,3 @@
+MAINTAINERCLEANFILES = Makefile.in
+
+SUBDIRS = usertest
diff --git a/dlm/tests/usertest/Makefile b/dlm/tests/usertest/Makefile
deleted file mode 100644
index 5e070f7..0000000
--- a/dlm/tests/usertest/Makefile
+++ /dev/null
@@ -1,23 +0,0 @@
-TARGETS= dlmtest asttest lstest pingtest lvb \
- dlmtest2 flood alternate-lvb joinleave threads
-
-all: depends ${TARGETS}
-
-include ../../../make/defines.mk
-include $(OBJDIR)/make/cobj.mk
-include $(OBJDIR)/make/clean.mk
-
-CFLAGS += -D_REENTRANT
-CFLAGS += -I${dlmincdir}
-CFLAGS += -I${incdir}
-
-LDFLAGS += -L${dlmlibdir} -ldlm -lpthread
-LDFLAGS += -L${libdir}
-
-depends:
- $(MAKE) -C ../../libdlm all
-
-%: %.o
- $(CC) -o $@ $^ $(LDFLAGS)
-
-clean: generalclean
diff --git a/dlm/tests/usertest/Makefile.am b/dlm/tests/usertest/Makefile.am
new file mode 100644
index 0000000..5b30f1c
--- /dev/null
+++ b/dlm/tests/usertest/Makefile.am
@@ -0,0 +1,18 @@
+MAINTAINERCLEANFILES = Makefile.in
+
+noinst_PROGRAMS = dlmtest asttest lstest pingtest lvb \
+ dlmtest2 flood alternate-lvb joinleave threads
+
+AM_CPPFLAGS = -D_REENTRANT \
+ -I$(top_srcdir)/dlm/libdlm
+
+dlmtest_LDADD = $(top_builddir)/dlm/libdlm/libdlm.la
+asttest_LDADD = $(top_builddir)/dlm/libdlm/libdlm.la
+lstest_LDADD = $(top_builddir)/dlm/libdlm/libdlm.la
+pingtest_LDADD = $(top_builddir)/dlm/libdlm/libdlm.la
+lvb_LDADD = $(top_builddir)/dlm/libdlm/libdlm.la
+dlmtest2_LDADD = $(top_builddir)/dlm/libdlm/libdlm.la
+flood_LDADD = $(top_builddir)/dlm/libdlm/libdlm.la
+alternate_lvb_LDADD = $(top_builddir)/dlm/libdlm/libdlm.la
+joinleave_LDADD = $(top_builddir)/dlm/libdlm/libdlm.la
+threads_LDADD = $(top_builddir)/dlm/libdlm/libdlm.la
diff --git a/dlm/tests/usertest/alternate-lvb.c b/dlm/tests/usertest/alternate-lvb.c
index 779125a..e8f2270 100644
--- a/dlm/tests/usertest/alternate-lvb.c
+++ b/dlm/tests/usertest/alternate-lvb.c
@@ -1,3 +1,5 @@
+#include "clusterautoconfig.h"
+
#include <unistd.h>
#include <stdio.h>
#include <stdlib.h>
diff --git a/dlm/tests/usertest/asttest.c b/dlm/tests/usertest/asttest.c
index da498f3..afe985c 100644
--- a/dlm/tests/usertest/asttest.c
+++ b/dlm/tests/usertest/asttest.c
@@ -5,6 +5,8 @@
FD parts fo the API!
*/
+#include "clusterautoconfig.h"
+
#ifdef _REENTRANT
#include <pthread.h>
#endif
diff --git a/dlm/tests/usertest/dlmtest.c b/dlm/tests/usertest/dlmtest.c
index 1c3e312..40fd3d3 100644
--- a/dlm/tests/usertest/dlmtest.c
+++ b/dlm/tests/usertest/dlmtest.c
@@ -1,5 +1,7 @@
/* Test program for userland DLM interface */
+#include "clusterautoconfig.h"
+
#include <sys/types.h>
#include <sys/uio.h>
#include <netinet/in.h>
diff --git a/dlm/tests/usertest/dlmtest2.c b/dlm/tests/usertest/dlmtest2.c
index da63b93..04532c4 100644
--- a/dlm/tests/usertest/dlmtest2.c
+++ b/dlm/tests/usertest/dlmtest2.c
@@ -1,3 +1,5 @@
+#include "clusterautoconfig.h"
+
#include <unistd.h>
#include <stdio.h>
#include <stdlib.h>
diff --git a/dlm/tests/usertest/flood.c b/dlm/tests/usertest/flood.c
index efe3a4b..a7e69ad 100644
--- a/dlm/tests/usertest/flood.c
+++ b/dlm/tests/usertest/flood.c
@@ -1,6 +1,9 @@
/* Flood the DLM !
but not too much...
*/
+
+#include "clusterautoconfig.h"
+
#include <pthread.h>
#include <sys/types.h>
#include <sys/uio.h>
diff --git a/dlm/tests/usertest/joinleave.c b/dlm/tests/usertest/joinleave.c
index b44116f..50ade83 100644
--- a/dlm/tests/usertest/joinleave.c
+++ b/dlm/tests/usertest/joinleave.c
@@ -1,3 +1,5 @@
+#include "clusterautoconfig.h"
+
#include <unistd.h>
#include <stdio.h>
#include <stdlib.h>
diff --git a/dlm/tests/usertest/lstest.c b/dlm/tests/usertest/lstest.c
index 025572a..eb4d558 100644
--- a/dlm/tests/usertest/lstest.c
+++ b/dlm/tests/usertest/lstest.c
@@ -1,5 +1,7 @@
/* Test program for userland lockspaces */
+#include "clusterautoconfig.h"
+
#ifdef _REENTRANT
#include <pthread.h>
#endif
diff --git a/dlm/tests/usertest/lvb.c b/dlm/tests/usertest/lvb.c
index 0683103..1a55a43 100644
--- a/dlm/tests/usertest/lvb.c
+++ b/dlm/tests/usertest/lvb.c
@@ -1,5 +1,7 @@
/* Simple LVB test prog */
+#include "clusterautoconfig.h"
+
#ifdef VMS
#include starlet
#include psldef
diff --git a/dlm/tests/usertest/pingtest.c b/dlm/tests/usertest/pingtest.c
index adf2042..fee9689 100644
--- a/dlm/tests/usertest/pingtest.c
+++ b/dlm/tests/usertest/pingtest.c
@@ -1,6 +1,8 @@
/* Ping Test the locking interface */
+#include "clusterautoconfig.h"
+
#ifdef __linux__
#include <pthread.h>
#include <errno.h>
diff --git a/dlm/tests/usertest/sublocks.c b/dlm/tests/usertest/sublocks.c
index d994b86..756b90d 100644
--- a/dlm/tests/usertest/sublocks.c
+++ b/dlm/tests/usertest/sublocks.c
@@ -1,5 +1,7 @@
/* Test program for userland DLM interface */
+#include "clusterautoconfig.h"
+
#include <sys/types.h>
#include <sys/uio.h>
#include <netinet/in.h>
diff --git a/dlm/tests/usertest/threads.c b/dlm/tests/usertest/threads.c
index 1d6ba5d..2d12c67 100644
--- a/dlm/tests/usertest/threads.c
+++ b/dlm/tests/usertest/threads.c
@@ -2,6 +2,8 @@
* Threaded DLM example
*/
+#include "clusterautoconfig.h"
+
#include <pthread.h>
#include <sys/types.h>
#include <sys/uio.h>
diff --git a/dlm/tool/Makefile b/dlm/tool/Makefile
deleted file mode 100644
index 9d75b6c..0000000
--- a/dlm/tool/Makefile
+++ /dev/null
@@ -1,32 +0,0 @@
-TARGET= dlm_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
-
-CFLAGS += -I${dlmincdir} -I${dlmcontrolincdir}
-CFLAGS += -I$(SRCDIR)/group/dlm_controld/
-CFLAGS += -I${incdir}
-CFLAGS += -I${KERNEL_SRC}/include/
-
-LDFLAGS += -L${dlmlibdir} -L${dlmcontrollibdir} -ldlm -ldlmcontrol
-LDFLAGS += -L${libdir}
-
-${TARGET}: ${OBJS}
- $(CC) -o $@ $^ $(LDFLAGS)
-
-clean: generalclean
-
-depends:
- $(MAKE) -C ../libdlm all
- $(MAKE) -C ../libdlmcontrol all
-
--include $(OBJS:.o=.d)
diff --git a/dlm/tool/Makefile.am b/dlm/tool/Makefile.am
new file mode 100644
index 0000000..091114f
--- /dev/null
+++ b/dlm/tool/Makefile.am
@@ -0,0 +1,12 @@
+MAINTAINERCLEANFILES = Makefile.in
+
+sbin_PROGRAMS = dlm_tool
+
+dlm_tool_SOURCES = main.c
+
+dlm_tool_CPPFLAGS = -I$(top_srcdir)/dlm/libdlm \
+ -I$(top_srcdir)/dlm/libdlmcontrol \
+ -I$(top_srcdir)/group/dlm_controld
+
+dlm_tool_LDADD = $(top_builddir)/dlm/libdlm/libdlm.la \
+ $(top_builddir)/dlm/libdlmcontrol/libdlmcontrol.la
diff --git a/dlm/tool/main.c b/dlm/tool/main.c
index b708946..838f31e 100644
--- a/dlm/tool/main.c
+++ b/dlm/tool/main.c
@@ -1,3 +1,5 @@
+#include "clusterautoconfig.h"
+
#include <sys/types.h>
#include <sys/un.h>
#include <inttypes.h>
@@ -248,7 +250,7 @@ static void decode_arguments(int argc, char **argv)
case 'V':
printf("%s %s (built %s %s)\n",
- prog_name, RELEASE_VERSION, __DATE__, __TIME__);
+ prog_name, VERSION, __DATE__, __TIME__);
printf("%s\n", REDHAT_COPYRIGHT);
exit(EXIT_SUCCESS);
break;
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/group/Makefile b/group/Makefile
deleted file mode 100644
index 2708823..0000000
--- a/group/Makefile
+++ /dev/null
@@ -1,4 +0,0 @@
-include ../make/defines.mk
-include $(OBJDIR)/make/passthrough.mk
-
-SUBDIRS = dlm_controld man
diff --git a/group/Makefile.am b/group/Makefile.am
new file mode 100644
index 0000000..d94a155
--- /dev/null
+++ b/group/Makefile.am
@@ -0,0 +1,3 @@
+MAINTAINERCLEANFILES = Makefile.in
+
+SUBDIRS = dlm_controld include man
diff --git a/group/dlm_controld/Makefile b/group/dlm_controld/Makefile
deleted file mode 100644
index 85b3d26..0000000
--- a/group/dlm_controld/Makefile
+++ /dev/null
@@ -1,70 +0,0 @@
-include ../../make/defines.mk
-
-ifdef enable_pacemaker
-TARGET = dlm_controld.pcmk
-SBINDIRT = dlm_controld.pcmk
-else
-TARGET = dlm_controld
-SBINDIRT = dlm_controld
-endif
-
-all: ${TARGET}
-
-include $(OBJDIR)/make/cobj.mk
-include $(OBJDIR)/make/clean.mk
-include $(OBJDIR)/make/install.mk
-include $(OBJDIR)/make/uninstall.mk
-
-OBJS= action.o \
- cpg.o \
- crc.o \
- deadlock.o \
- main.o \
- netlink.o \
- plock.o
-
-ifdef enable_pacemaker
-OBJS += pacemaker.o
-else
-OBJS += config.o \
- member_cman.o \
- logging.o
-endif
-
-CFLAGS += -I${ccsincdir} -I${logtincdir}
-CFLAGS += -I${dlmincdir} -I${dlmcontrolincdir}
-CFLAGS += -I${corosyncincdir} -I${openaisincdir}
-CFLAGS += -I${fencedincdir}
-CFLAGS += -I${KERNEL_SRC}/include/
-CFLAGS += -I$(S)/../include/
-ifdef enable_pacemaker
-CFLAGS += -I${incdir}/heartbeat -I${incdir}/pacemaker
-CFLAGS += `pkg-config glib-2.0 --cflags`
-CFLAGS += `xml2-config --cflags`
-endif
-CFLAGS += -I${incdir}
-
-LDFLAGS += -L${dlmlibdir} -ldlm
-LDFLAGS += -L${logtlibdir} -llogthread
-LDFLAGS += -L${openaislibdir} -lSaCkpt
-LDFLAGS += -L${corosynclibdir} -lcpg
-LDFLAGS += -L${libdir}
-
-PCMK_LDFLAGS += -lcib -lcrmcommon -lcrmcluster -ltotem_pg
-PCMK_LDFLAGS += `pkg-config glib-2.0 --libs`
-PCMK_LDFLAGS += `xml2-config --libs`
-
-CMAN_LDFLAGS += -L${ccslibdir} -lccs
-CMAN_LDFLAGS += -L${fencedlibdir} -lfenced
-CMAN_LDFLAGS += -lcfg -lquorum
-CMAN_LDDEPS += ${fencedlibdir}/libfenced.a
-
-dlm_controld: ${OBJS} ${LDDEPS} ${CMAN_LDDEPS}
- $(CC) -o $@ $^ $(LDFLAGS) $(CMAN_LDFLAGS)
-
-dlm_controld.pcmk: ${OBJS} ${LDDEPS} ${PCMK_LDDEPS}
- $(CC) -o $@ $^ $(LDFLAGS) $(PCMK_LDFLAGS)
-
-clean: generalclean
-
--include $(OBJS:.o=.d)
diff --git a/group/dlm_controld/Makefile.am b/group/dlm_controld/Makefile.am
new file mode 100644
index 0000000..c14ab89
--- /dev/null
+++ b/group/dlm_controld/Makefile.am
@@ -0,0 +1,75 @@
+MAINTAINERCLEANFILES = Makefile.in
+
+sbin_PROGRAMS =
+
+if ENABLE_CMAN
+sbin_PROGRAMS += dlm_controld
+endif
+
+if ENABLE_PACEMAKER
+sbin_PROGRAMS += dlm_controld.pcmk
+endif
+
+noinst_HEADERS = config.h dlm_controld.h dlm_daemon.h
+
+shared_SOURCES = action.c cpg.c crc.c deadlock.c main.c \
+ netlink.c plock.c
+
+shared_CPPFLAGS = -I$(top_srcdir)/dlm/libdlm \
+ -I$(top_srcdir)/dlm/libdlmcontrol \
+ -I$(top_srcdir)/group/include
+
+shared_CFLAGS = $(logt_CFLAGS) $(cpg_CFLAGS) $(sackpt_CFLAGS)
+
+shared_LIBS = $(logt_LIBS) $(cpg_LIBS) $(sackpt_LIBS) -lpthread
+
+shared_LDADD = $(top_builddir)/dlm/libdlm/libdlm.la \
+ $(top_builddir)/dlm/libdlmcontrol/libdlmcontrol.la
+
+if ENABLE_CMAN
+
+dlm_controld_SOURCES = $(shared_SOURCES) \
+ config.c member_cman.c logging.c
+
+dlm_controld_CPPFLAGS = $(shared_CPPFLAGS)
+
+dlm_controld_CFLAGS = $(shared_CFLAGS) \
+ $(ccs_CFLAGS) \
+ $(fenced_CFLAGS) \
+ $(cfg_CFLAGS) \
+ $(quorum_CFLAGS)
+
+dlm_controld_LDFLAGS = $(shared_LIBS) \
+ $(ccs_LIBS) \
+ $(fenced_LIBS) \
+ $(cfg_LIBS) \
+ $(quorum_LIBS)
+
+dlm_controld_LDADD = $(shared_LDADD)
+
+endif
+
+if ENABLE_PACEMAKER
+
+dlm_controld_pcmk_SOURCES = $(shared_SOURCES) \
+ pacemaker.c
+
+dlm_controld_pcmk_CPPFLAGS= $(shared_CPPFLAGS) \
+ -I$(prefix)/include/heartbeat \
+ -I$(prefix)/include/pacemaker \
+ -DENABLE_PACEMAKER=1
+
+dlm_controld_pcmk_CFLAGS = $(shared_CFLAGS) \
+ $(glib_CFLAGS) \
+ $(xml_CFLAGS) \
+ $(totempg_CFLAGS)
+
+dlm_controld_pcmk_LDFLAGS = $(shared_LIBS) \
+ $(glib_LIBS) \
+ $(xml_LIBS) \
+ $(totempg_LIBS) \
+ -lcib -lcrmcommon -lcrmcluster
+
+dlm_controld_pcmk_LDADD = $(shared_LDADD)
+
+endif
diff --git a/group/dlm_controld/action.c b/group/dlm_controld/action.c
index e4180d4..54faec1 100644
--- a/group/dlm_controld/action.c
+++ b/group/dlm_controld/action.c
@@ -1,3 +1,5 @@
+#include "clusterautoconfig.h"
+
#include "dlm_daemon.h"
#include "config.h"
diff --git a/group/dlm_controld/config.c b/group/dlm_controld/config.c
index 384499d..bd7b672 100644
--- a/group/dlm_controld/config.c
+++ b/group/dlm_controld/config.c
@@ -1,3 +1,5 @@
+#include "clusterautoconfig.h"
+
#include <sys/types.h>
#include <asm/types.h>
#include <sys/uio.h>
diff --git a/group/dlm_controld/cpg.c b/group/dlm_controld/cpg.c
index 43b36fd..6eced07 100644
--- a/group/dlm_controld/cpg.c
+++ b/group/dlm_controld/cpg.c
@@ -1,3 +1,5 @@
+#include "clusterautoconfig.h"
+
#include "dlm_daemon.h"
#include "config.h"
diff --git a/group/dlm_controld/crc.c b/group/dlm_controld/crc.c
index ff8c1d3..4cde27b 100644
--- a/group/dlm_controld/crc.c
+++ b/group/dlm_controld/crc.c
@@ -1,3 +1,5 @@
+#include "clusterautoconfig.h"
+
#include "dlm_daemon.h"
static const uint32_t crc_32_tab[] = {
diff --git a/group/dlm_controld/deadlock.c b/group/dlm_controld/deadlock.c
index 4671c8c..d213b7e 100644
--- a/group/dlm_controld/deadlock.c
+++ b/group/dlm_controld/deadlock.c
@@ -1,3 +1,5 @@
+#include "clusterautoconfig.h"
+
#include "dlm_daemon.h"
#include "config.h"
#include "libdlm.h"
diff --git a/group/dlm_controld/logging.c b/group/dlm_controld/logging.c
index cfcacb0..a77eb2c 100644
--- a/group/dlm_controld/logging.c
+++ b/group/dlm_controld/logging.c
@@ -1,3 +1,5 @@
+#include "clusterautoconfig.h"
+
#include "dlm_daemon.h"
#include "config.h"
#include "ccs.h"
diff --git a/group/dlm_controld/main.c b/group/dlm_controld/main.c
index c662403..b58ff2c 100644
--- a/group/dlm_controld/main.c
+++ b/group/dlm_controld/main.c
@@ -1,3 +1,5 @@
+#include "clusterautoconfig.h"
+
#include "dlm_daemon.h"
#include "config.h"
#include <pthread.h>
@@ -1142,7 +1144,7 @@ static void read_arguments(int argc, char **argv)
case 'V':
printf("dlm_controld %s (built %s %s)\n",
- RELEASE_VERSION, __DATE__, __TIME__);
+ VERSION, __DATE__, __TIME__);
printf("%s\n", REDHAT_COPYRIGHT);
exit(EXIT_SUCCESS);
break;
@@ -1215,7 +1217,7 @@ int main(int argc, char **argv)
}
lockfile();
init_logging();
- log_level(LOG_INFO, "dlm_controld %s started", RELEASE_VERSION);
+ log_level(LOG_INFO, "dlm_controld %s started", VERSION);
signal(SIGTERM, sigterm_handler);
set_scheduler();
set_oom_adj(-16);
diff --git a/group/dlm_controld/member_cman.c b/group/dlm_controld/member_cman.c
index 6d2f0ca..a196b8b 100644
--- a/group/dlm_controld/member_cman.c
+++ b/group/dlm_controld/member_cman.c
@@ -1,3 +1,5 @@
+#include "clusterautoconfig.h"
+
#include "dlm_daemon.h"
#include "config.h"
#include <corosync/corotypes.h>
diff --git a/group/dlm_controld/netlink.c b/group/dlm_controld/netlink.c
index 5a7c261..bdf329b 100644
--- a/group/dlm_controld/netlink.c
+++ b/group/dlm_controld/netlink.c
@@ -1,3 +1,5 @@
+#include "clusterautoconfig.h"
+
#include "dlm_daemon.h"
#include "config.h"
#include <linux/dlm.h>
diff --git a/group/dlm_controld/pacemaker.c b/group/dlm_controld/pacemaker.c
index 2118bec..272270c 100644
--- a/group/dlm_controld/pacemaker.c
+++ b/group/dlm_controld/pacemaker.c
@@ -1,3 +1,5 @@
+#include "clusterautoconfig.h"
+
#include <syslog.h>
#include "config.h"
diff --git a/group/dlm_controld/plock.c b/group/dlm_controld/plock.c
index 957d749..5e978f9 100644
--- a/group/dlm_controld/plock.c
+++ b/group/dlm_controld/plock.c
@@ -1,3 +1,5 @@
+#include "clusterautoconfig.h"
+
#include "dlm_daemon.h"
#include "config.h"
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/man/Makefile b/group/man/Makefile
deleted file mode 100644
index 44dbfdb..0000000
--- a/group/man/Makefile
+++ /dev/null
@@ -1,4 +0,0 @@
-TARGET= dlm_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..0ef74ae
--- /dev/null
+++ b/group/man/Makefile.am
@@ -0,0 +1,3 @@
+MAINTAINERCLEANFILES = Makefile.in
+
+dist_man_MANS = dlm_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 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 d2db208..0000000
--- a/make/cobj.mk
+++ /dev/null
@@ -1,6 +0,0 @@
-%.o: $(S)/%.c
- $(CC) $(CFLAGS) $(EXTRA_CFLAGS) $(REENT_CFLAGS) -c -o $@ $<
-
-# used by dlm/libdlm
-%_lt.o: $(S)/%.c
- $(CC) $(CFLAGS) $(EXTRA_CFLAGS) -c -o $@ $<
diff --git a/make/defines.mk.input b/make/defines.mk.input
deleted file mode 100644
index 40acb7d..0000000
--- a/make/defines.mk.input
+++ /dev/null
@@ -1,55 +0,0 @@
-# Install Locations
-prefix ?= ${DESTDIR}@PREFIX@
-sbindir ?= ${DESTDIR}@SBINDIR@
-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 += -DENABLE_PACEMAKER=@ENABLE_PACEMAKER@
-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@
-dlmincdir ?= @DLMINCDIR@
-dlmlibdir ?= @DLMLIBDIR@
-dlmcontrolincdir ?= @DLMCONTROLINCDIR@
-dlmcontrollibdir ?= @DLMCONTROLLIBDIR@
-fencedincdir ?= @FENCEDINCDIR@
-fencedlibdir ?= @FENCEDLIBDIR@
-logtincdir ?= @LOGTINCDIR@
-logtlibdir ?= @LOGTLIBDIR@
-corosyncincdir ?= @COROSYNCINCDIR@
-corosynclibdir ?= @COROSYNCLIBDIR@
-openaisincdir ?= @OPENAISINCDIR@
-openaislibdir ?= @OPENAISLIBDIR@
-experimental_build ?= @ENABLE_CRACK_OF_THE_DAY@
-legacy_code ?= @ENABLE_LEGACY_CODE@
-contrib_code ?= @ENABLE_CONTRIB@
-enable_pacemaker ?= @ENABLE_PACEMAKER@
-without_dlm ?= @DISABLE_DLM@
-without_group ?= @DISABLE_GROUP@
-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 77ea199..0000000
--- a/make/install.mk
+++ /dev/null
@@ -1,41 +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 UDEVT
- install -d ${DESTDIR}/etc/udev/rules.d
- set -e; \
- for i in ${UDEVT}; do \
- install -m644 $(S)/$$i ${DESTDIR}/etc/udev/rules.d; \
- done
-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 ab4bba9..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 SBINDIRT
- ${UNINSTALL} ${SBINDIRT} ${sbindir}
-endif
-ifdef SBINSYMT
- ${UNINSTALL} ${SBINSYMT} ${sbindir}
-endif
-ifdef UDEVT
- ${UNINSTALL} ${UDEVT} ${DESTDIR}/etc/udev/rules.d
-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";
- }
-}
-
-
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2009-06-09 15:19 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-06-09 15:19 dlm: master - build: convert to autoconf/automake/libtool Fabio M. Di Nitto
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).