Преглед изворни кода

Automake. The journey begins.

git-svn-id: http://svn.fedorahosted.org/svn/corosync/trunk@1798 fd59a12c-fef9-0310-b244-a6a79926bd2f
Steven Dake пре 17 година
родитељ
комит
0bc9cd90f6
20 измењених фајлова са 1534 додато и 984 уклоњено
  1. 0 205
      Makefile
  2. 65 0
      Makefile.am
  3. 0 126
      Makefile.inc
  4. 560 0
      configure.in
  5. 0 202
      exec/Makefile
  6. 107 0
      exec/Makefile.am
  7. 2 0
      exec/ipc.c
  8. 1 0
      exec/totemip.c
  9. 16 26
      include/Makefile.am
  10. 0 0
      include/corosync/cs_config.h.in
  11. 33 48
      lcr/Makefile.am
  12. 1 0
      lcr/lcr_ifact.c
  13. 0 139
      lib/Makefile
  14. 93 0
      lib/Makefile.am
  15. 2 0
      lib/coroipc.c
  16. 0 130
      services/Makefile
  17. 23 42
      services/Makefile.am
  18. 517 66
      test/Makefile
  19. 68 0
      test/Makefile.am
  20. 46 0
      tools/Makefile.am

+ 0 - 205
Makefile

@@ -1,205 +0,0 @@
-# Copyright (c) 2002-2006 MontaVista Software, Inc.
-# Copyright (c) 2006-2008 Red Hat, Inc.
-# 
-# All rights reserved.
-# 
-# This software licensed under BSD license, the text of which follows:
-# 
-# Redistribution and use in source and binary forms, with or without
-# modification, are permitted provided that the following conditions are met:
-# 
-# - Redistributions of source code must retain the above copyright notice,
-#   this list of conditions and the following disclaimer.
-# - Redistributions in binary form must reproduce the above copyright notice,
-#   this list of conditions and the following disclaimer in the documentation
-#   and/or other materials provided with the distribution.
-# - Neither the name of the MontaVista Software, Inc. nor the names of its
-#   contributors may be used to endorse or promote products derived from this
-#   software without specific prior written permission.
-#
-# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
-# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-# ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
-# LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
-# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
-# SUBSTITUTE GOODS OR ENGINES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
-# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
-# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
-# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
-# THE POSSIBILITY OF SUCH DAMAGE.
-
-builddir:=$(shell pwd)/
-ifneq ($(O),)
-# cleanup the path (make it absolute)
-$(shell mkdir -p $(O))
-builddir:=$(shell cd $(O) && pwd)/
-endif
-srcdir:=$(shell cd $(dir $(MAKEFILE_LIST)) && pwd)/
-
-include $(srcdir)/Makefile.inc
-
-SBINDIR=$(PREFIX)/sbin
-INCLUDEDIR=$(PREFIX)/include/corosync
-INCLUDEDIR_TOTEM=$(PREFIX)/include/corosync/totem
-INCLUDEDIR_LCR=$(PREFIX)/include/corosync/lcr
-INCLUDEDIR_ENGINE=$(PREFIX)/include/corosync/engine
-MANDIR=$(PREFIX)/share/man
-ETCDIR=/etc
-
-SUBDIRS:=$(builddir)lcr $(builddir)lib $(builddir)tools $(builddir)exec $(builddir)test $(builddir)services $(builddir)pkgconfig
-sub_make = srcdir=$(srcdir) builddir=$(builddir) subdir=$(1)/ $(MAKE) -I$(srcdir)$(1) -f $(srcdir)$(1)/Makefile $(2)
-
-all: $(SUBDIRS)
-	@(cd $(builddir)lcr; echo ==== `pwd` ===;  $(call sub_make,lcr,all));
-	@(cd $(builddir)lib; echo ==== `pwd` ===;  $(call sub_make,lib,all));
-	@(cd $(builddir)exec; echo ==== `pwd` ===; $(call sub_make,exec,all));
-	@(cd $(builddir)tools; echo ==== `pwd` ===;  $(call sub_make,tools,all));
-	@(cd $(builddir)services; echo ==== `pwd` ===; $(call sub_make,services,all));
-	@(cd $(builddir)test; echo ==== `pwd` ===; $(call sub_make,test,all));
-	@(cd $(builddir)pkgconfig; echo ==== `pwd` ===; $(call sub_make,pkgconfig,all));
-
-# subdirs are not phony
-.PHONY: all clean install doxygen
-
-$(builddir):
-	mkdir -p $@
-
-$(SUBDIRS):
-	mkdir -p $@
-
-help:
-	@echo 
-	@echo "Requirements: GCC, LD, and a Linux 2.4/2.6 kernel."
-	@echo "Tested on:"
-	@echo " Debian Sarge(i386), Redhat 9(i386), Fedora Core 2 (i386), Fedora Core"
-	@echo " 4, 5 (i386,x86_64), SOLARIS, MontaVista Carrier Grade Edition 3.1(i386, x86_64,"
-	@echo " classic ppc, ppc970, xscale) and buildroot/uclibc(ppc e500/603e)"
-	@echo 
-	@echo Targets:
-	@echo "  all     - build all targets"
-	@echo "  install - install corosync onto your system"
-	@echo "  clean   - remove generated files"
-	@echo "  doxygen - doxygen html docs"
-	@echo 
-	@echo "Options: (* - default)"
-	@echo "  COROSYNC_BUILD   [DEBUG/RELEASE*] - Enable/Disable debug symbols"
-	@echo "  DESTDIR          [directory]      - Install prefix."
-	@echo "  O                [directory]      - Locate all output files in \"dir\"."
-	@echo "  BUILD_DYNAMIC    [1*/0]           - Enable/disable dynamic loading of service handler modules"
-	@echo "  COROSYNC_PROFILE [1/0*]           - Enable profiling"
-	@echo 
- 
-
-clean:
-	(cd $(builddir)lcr; echo ==== `pwd` ===; $(call sub_make,lcr,clean));
-	(cd $(builddir)lib; echo ==== `pwd` ===; $(call sub_make,lib,clean));
-	(cd $(builddir)tools; echo ==== `pwd` ===; $(call sub_make,tools,clean));
-	(cd $(builddir)exec; echo ==== `pwd` ===; $(call sub_make,exec,clean));
-	(cd $(builddir)services; echo ==== `pwd` ===; $(call sub_make,services,clean));
-	(cd $(builddir)test; echo ==== `pwd` ===; $(call sub_make,test,clean));
-	(cd $(builddir)pkgconfig; echo ==== `pwd` ===; $(call sub_make,pkgconfig,clean));
-
-	rm -rf $(builddir)doc/api
-
-lint:
-	(cd $(builddir)exec; echo ==== `pwd` ===; $(call sub_make,exec,lint));
-	(cd $(builddir)services; echo ==== `pwd` ===; $(call sub_make,services,lint));
-	(cd $(builddir)lcr; echo ==== `pwd` ===; $(call sub_make,lcr,lint));
-	(cd $(builddir)lib; echo ==== `pwd` ===; $(call sub_make,lib,lint));
-	(cd $(builddir)tools; echo ==== `pwd` ===; $(call sub_make,tools,lint));
-
-COROSYNC_LIBS	= evs cpg cfg coroipc confdb quorum votequorum
-
-COROSYNC_HEADERS	= cpg.h cfg.h evs.h ipc_gen.h mar_gen.h swab.h \
-		  coroipc.h confdb.h quorum.h list.h corotypes.h votequorum.h
-
-EXEC_LIBS	= totem_pg logsys
-
-install: all
-	mkdir -p $(DESTDIR)$(SBINDIR)
-	mkdir -p $(DESTDIR)$(INCLUDEDIR)
-	mkdir -p $(DESTDIR)$(INCLUDEDIR_TOTEM)
-	mkdir -p $(DESTDIR)$(INCLUDEDIR_LCR)
-	mkdir -p $(DESTDIR)$(INCLUDEDIR_ENGINE)
-	mkdir -p $(DESTDIR)$(LIBDIR)
-	mkdir -p $(DESTDIR)$(LCRSODIR)
-	mkdir -p $(DESTDIR)$(MANDIR)/man3
-	mkdir -p $(DESTDIR)$(MANDIR)/man5
-	mkdir -p $(DESTDIR)$(MANDIR)/man8
-	mkdir -p $(DESTDIR)$(ETCDIR)/ld.so.conf.d
-	mkdir -p $(DESTDIR)$(PKGCONFIGDIR)
-
-
-	for eLib in $(EXEC_LIBS); do					\
-	    ( cd $(builddir) ;						\
-	    ln -sf lib$$eLib.so.2.0.0 exec/lib$$eLib.so;		\
-	    ln -sf lib$$eLib.so.2.0.0 exec/lib$$eLib.so.2;		\
-	    $(CP) -a exec/lib$$eLib.so $(DESTDIR)$(LIBDIR);		\
-	    $(CP) -a exec/lib$$eLib.so.2 $(DESTDIR)$(LIBDIR);		\
-	    install -m 755 exec/lib$$eLib.so.2.* $(DESTDIR)$(LIBDIR);	\
-	    if [ "xYES" = "x$(STATICLIBS)" ]; then			\
-		install -m 755 exec/lib$$eLib.a $(DESTDIR)$(LIBDIR);	\
-		if [ ${COROSYNC_COMPAT} = "DARWIN" ]; then		\
-		    ranlib $(DESTDIR)$(LIBDIR)/lib$$eLib.a;		\
-		fi							\
-	    fi								\
-	    ) \
-	done
-
-	for aLib in $(COROSYNC_LIBS); do					\
-	    ( cd $(builddir) ;                                          \
-	    ln -sf lib$$aLib.so.2.0.0 lib/lib$$aLib.so;			\
-	    ln -sf lib$$aLib.so.2.0.0 lib/lib$$aLib.so.2;		\
-	    $(CP) -a lib/lib$$aLib.so $(DESTDIR)$(LIBDIR);		\
-	    $(CP) -a lib/lib$$aLib.so.2 $(DESTDIR)$(LIBDIR);		\
-	    install -m 755 lib/lib$$aLib.so.2.* $(DESTDIR)$(LIBDIR);	\
-	    if [ "xYES" = "x$(STATICLIBS)" ]; then			\
-	        install -m 755 lib/lib$$aLib.a $(DESTDIR)$(LIBDIR);	\
-		if [ ${COROSYNC_COMPAT} = "DARWIN" ]; then		\
-		    ranlib $(DESTDIR)$(LIBDIR)/lib$$aLib.a;		\
-	        fi							\
-	    fi								\
-	    ) \
-	done
-
-	echo $(LIBDIR) > "$(DESTDIR)$(ETCDIR)/ld.so.conf.d/corosync-$(ARCH).conf"
-
-	install -m 755 $(builddir)exec/*lcrso $(DESTDIR)$(LCRSODIR)
-	install -m 755 $(builddir)services/*lcrso $(DESTDIR)$(LCRSODIR)
-	install -m 755 $(builddir)exec/corosync $(DESTDIR)$(SBINDIR)
-	install -m 755 $(builddir)tools/corosync-objctl $(DESTDIR)$(SBINDIR)
-	install -m 755 $(builddir)tools/corosync-cfgtool $(DESTDIR)$(SBINDIR)
-	install -m 755 $(builddir)tools/corosync-keygen $(DESTDIR)$(SBINDIR)
-	install -m 755 $(builddir)tools/corosync-fplay $(DESTDIR)$(SBINDIR)
-	install -m 755 $(builddir)tools/corosync-pload $(DESTDIR)$(SBINDIR)
-
-	if [ ! -f $(DESTDIR)$(ETCDIR)/corosync.conf ] ; then 	   \
-		install -m 644 $(srcdir)conf/corosync.conf $(DESTDIR)$(ETCDIR) ; \
-	fi
-
-	for aHeader in $(COROSYNC_HEADERS); do				\
-	    install -m 644 $(srcdir)include/corosync/$$aHeader $(DESTDIR)$(INCLUDEDIR);	\
-	done
-
-	install -m 644 $(srcdir)include/corosync/hdb.h $(DESTDIR)$(INCLUDEDIR)
-	install -m 644 $(srcdir)include/corosync/totem/coropoll.h $(DESTDIR)$(INCLUDEDIR_TOTEM)
-	install -m 644 $(srcdir)include/corosync/totem/totempg.h $(DESTDIR)$(INCLUDEDIR_TOTEM)
-	install -m 644 $(srcdir)include/corosync/totem/totem.h $(DESTDIR)$(INCLUDEDIR_TOTEM)
-	install -m 644 $(srcdir)include/corosync/totem/totemip.h $(DESTDIR)$(INCLUDEDIR_TOTEM)
-	install -m 644 $(srcdir)include/corosync/lcr/lcr_ckpt.h $(DESTDIR)$(INCLUDEDIR_LCR)
-	install -m 644 $(srcdir)include/corosync/lcr/lcr_comp.h $(DESTDIR)$(INCLUDEDIR_LCR)
-	install -m 644 $(srcdir)include/corosync/lcr/lcr_ifact.h $(DESTDIR)$(INCLUDEDIR_LCR)
-	install -m 644 $(srcdir)include/corosync/engine/coroapi.h $(DESTDIR)$(INCLUDEDIR_ENGINE)
-	install -m 644 $(srcdir)include/corosync/engine/objdb.h $(DESTDIR)$(INCLUDEDIR_ENGINE)
-	install -m 644 $(srcdir)include/corosync/engine/logsys.h $(DESTDIR)$(INCLUDEDIR_ENGINE)
-	install -m 644 $(srcdir)include/corosync/engine/quorum.h $(DESTDIR)$(INCLUDEDIR_ENGINE)
-	install -m 644 $(srcdir)include/corosync/engine/config.h $(DESTDIR)$(INCLUDEDIR_ENGINE)
-	install -m 644 $(srcdir)man/*.3 $(DESTDIR)$(MANDIR)/man3
-	install -m 644 $(srcdir)man/*.5 $(DESTDIR)$(MANDIR)/man5
-	install -m 644 $(srcdir)man/*.8 $(DESTDIR)$(MANDIR)/man8
-
-	install -m 644 $(builddir)/pkgconfig/*.pc $(DESTDIR)$(PKGCONFIGDIR)
-
-doxygen:
-	mkdir -p doc/api && doxygen

+ 65 - 0
Makefile.am

@@ -0,0 +1,65 @@
+# Copyright (c) 2009 Red Hat, Inc.
+# 
+# Authors: Andrew Beekhof
+#	   Steven Dake (sdake@redhat.com)
+#
+# This software licensed under BSD license, the text of which follows:
+# 
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions are met:
+# 
+# - Redistributions of source code must retain the above copyright notice,
+#   this list of conditions and the following disclaimer.
+# - Redistributions in binary form must reproduce the above copyright notice,
+#   this list of conditions and the following disclaimer in the documentation
+#   and/or other materials provided with the distribution.
+# - Neither the name of the MontaVista Software, Inc. nor the names of its
+#   contributors may be used to endorse or promote products derived from this
+#   software without specific prior written permission.
+#
+# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+# ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
+# LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+# THE POSSIBILITY OF SUCH DAMAGE.
+
+EXTRA_DIST              = autogen.sh
+AUTOMAKE_OPTIONS	= foreign
+
+MAINTAINERCLEANFILES    = Makefile.in aclocal.m4 configure
+
+ETCDIR = /etc
+MANDIR = /usr/share/man
+SUBDIRS	= include lcr lib exec services tools test 
+# man init conf
+
+lint:
+	for dir in lcr lib exec services tools test; do make -C $$dir lint; done
+
+doxygen:
+	mkdir -p doc/api && doxygen
+
+install-exec-local:
+	mkdir -p $(DESTDIR)$(ETCDIR)/ld.so.conf.d
+	echo $(pkglibdir) > "$(DESTDIR)$(ETCDIR)/ld.so.conf.d/corosync-$(host_cpu).conf"
+	if [ ! -f $(DESTDIR)$(ETCDIR)/corosync.conf ] ; then 	   \
+		$(INSTALL) -m 644 $(srcdir)/conf/corosync.conf $(DESTDIR)$(ETCDIR) ; \
+	fi
+	mkdir -p $(DESTDIR)$(MANDIR)/man3
+	$(INSTALL) -m 644 $(srcdir)/man/*.3 $(DESTDIR)$(MANDIR)/man3
+	mkdir -p $(DESTDIR)$(MANDIR)/man5
+	$(INSTALL) -m 644 $(srcdir)/man/*.5 $(DESTDIR)$(MANDIR)/man5
+	mkdir -p $(DESTDIR)$(MANDIR)/man8
+	$(INSTALL) -m 644 $(srcdir)/man/*.8 $(DESTDIR)$(MANDIR)/man8
+
+dist-clean-local:
+	rm -f autoconf automake autoheader $(TARFILE)
+
+clean-generic:
+	rm -rf doc/api

+ 0 - 126
Makefile.inc

@@ -1,126 +0,0 @@
-# Common options
-PREFIX=/usr
-DESTDIR=
-LCRSODIR=$(PREFIX)/libexec/lcrso
-
-ARCH=$(shell uname -p)
-ifeq (,$(findstring 64,$(ARCH)))
-PRELIBDIR=$(PREFIX)/lib
-else
-PRELIBDIR=$(PREFIX)/lib64
-endif
-ifeq (s390,$(ARCH))
-PRELIBDIR=$(PREFIX)/lib
-endif
-ifeq (s390x,$(ARCH))
-PRELIBDIR=$(PREFIX)/lib64
-endif
-ifeq (ia64,$(ARCH))
-PRELIBDIR=$(PREFIX)/lib
-endif
-
-LIBDIR=$(PRELIBDIR)/corosync
-PKGCONFIGDIR=$(PRELIBDIR)/pkgconfig
-
-# Do not modify below this line
-
-# Basic OS detection
-#
-UNAME=$(shell uname)
-CP=cp
-
-ifeq "$(UNAME)" "Linux"
-	COROSYNC_COMPAT=LINUX
-endif
-ifeq "$(UNAME)" "Darwin"
-	COROSYNC_COMPAT=DARWIN
-	CP=rsync
-endif
-ifneq "" "$(findstring BSD,$(UNAME))"
-	COROSYNC_COMPAT=BSD
-endif
-ifeq "$(UNAME)" "SunOS"
-	COROSYNC_COMPAT=SOLARIS
-	# Note that CC must be set to gcc compiled to link with gnu-ld 
-endif
-ifndef COROSYNC_COMPAT
-	$(error "COROSYNC_COMPAT cannot be detected, it must be manually defined")
-endif
-
-# BUILD_DYNAMIC can be defined to 1 to build for dynamic loading of service
-#	handler modules.  If the developer intends to debug, building without
-#	dynamic modules should provide an easier route.
-ifndef BUILD_DYNAMIC
-	BUILD_DYNAMIC=1
-endif
-
-# COROSYNC_BUILD can be defined as RELEASE or DEBUG
-#
-ifndef COROSYNC_BUILD
-	COROSYNC_BUILD=RELEASE
-endif
-
-# default CFLAGS, LDFLAGS
-#
-CFLAGS =
-LDFLAGS =
-DYFLAGS =
-LINT_FLAGS = -weak -unrecog +posixlib +ignoresigns -fcnuse -badflag -D__gnuc_va_list=va_list -D__attribute\(x\)= 
-
-override CFLAGS += -DLCRSODIR='"$(LCRSODIR)"'
-
-
-# Adding the TS_CLASS flag enables not being scheduled RR
-#CFLAGS += -DTS_CLASS
-
-# build CFLAGS, LDFLAGS
-#
-ifeq (${COROSYNC_BUILD}, RELEASE) 
-	override CFLAGS += -O3 -Wall
-	override LDFLAGS += 
-endif
-ifeq (${COROSYNC_BUILD}, DEBUG) 
-	override CFLAGS += -O0 -g -Wall
-	override LDFLAGS += -g
-	ifeq (${COROSYNC_COMPAT}, SOLARIS)
-		CFLAGS += -Werror -DTS_CLASS
-	endif
-endif
-ifeq (${COROSYNC_BUILD}, COVERAGE)
-	override CFLAGS += -O0 -g -ftest-coverage -fprofile-arcs
-	override LDFLAGS += -g -ftest-coverage -fprofile-arcs
-	BUILD_DYNAMIC=0
-endif
-
-# platform specific CFLAGS, LDFLAGS
-#
-ifeq (${COROSYNC_COMPAT}, LINUX) 
-	override CFLAGS += -DCOROSYNC_LINUX -D_XOPEN_SOURCE=600 -D_GNU_SOURCE
-	override LDFLAGS += -ldl -lpthread
-	override DYFLAGS += -rdynamic
-endif
-ifeq (${COROSYNC_COMPAT}, BSD)
-	override CFLAGS += -DCOROSYNC_BSD
-	override LDFLAGS += -pthread
-	override DYFLAGS += -export-dynamic
-endif
-ifeq (${COROSYNC_COMPAT}, DARWIN)
-	override CFLAGS += -DCOROSYNC_DARWIN
-	override LDFLAGS += -lpthread
-endif
-ifeq (${COROSYNC_COMPAT}, SOLARIS)
-	override CFLAGS += -DCOROSYNC_SOLARIS -D_REENTRANT
-	override LDFLAGS += -lpthread
-	# See http://sources.redhat.com/ml/bug-gnu-utils/2000-07/msg00168.html
-	override LDFLAGS += -Wl,--export-dynamic -Wl,-rpath-link=/usr/lib
-ifeq ($(shell uname -r), 5.10)
-	override CFLAGS += -DHAVE_GETPEERUCRED -DHAVE_SCANDIR -DHAVE_ALPHASORT
-endif
-ifeq ($(shell uname -r), 5.11)
-	override CFLAGS += -DHAVE_GETPEERUCRED -DHAVE_SCANDIR -DHAVE_ALPHASORT
-endif
-endif
-
-VPATH:=. $(srcdir) $(srcdir)$(subdir)
-override CFLAGS += -I$(srcdir)include -I$(srcdir)$(subdir)
-

+ 560 - 0
configure.in

@@ -0,0 +1,560 @@
+dnl
+dnl autoconf for Pacemaker
+dnl
+dnl License: GNU General Public License (GPL)
+
+dnl ===============================================
+dnl Bootstrap 
+dnl ===============================================
+
+dnl Initialiase, with sanity check of a unique file in the hierarchy
+AC_INIT(configure.in)
+AC_PREREQ(2.53)
+
+AC_CONFIG_AUX_DIR(.)
+AC_CANONICAL_HOST
+AC_MSG_NOTICE(Host: $host)
+AC_MSG_NOTICE(Host OS: $host_os)
+AC_MSG_NOTICE(Host CPU: $host_cpu)
+AC_MSG_NOTICE(Host Vendor: $host_vendor)
+
+dnl Where #defines go (e.g. `AC_CHECK_HEADERS' below)
+dnl
+dnl Internal header: include/corosync/config.h
+dnl   - Contains ALL defines
+dnl   - include/config.h.in is generated automatically by autoheader
+dnl   - NOT to be included in any header files except lha_internal.h
+dnl     (which is also not to be included in any other header files)
+dnl
+dnl External header: include/corosync/cs_config.h
+dnl   - Contains a subset of defines checked here
+dnl   - Manually edit include/corosync/cs_config.h.in to have configure include
+dnl     new defines
+dnl   - Should not include HAVE_* defines
+dnl   - Safe to include anywhere
+AM_CONFIG_HEADER(include/corosync/config.h include/corosync/cs_config.h)
+ALL_LINGUAS="en fr"
+
+AC_ARG_WITH(version,
+    [  --with-version=name     Override package version (if you're a packager needing to pretend) ],
+    [ CS_VERSION="$withval" ],
+    [ CS_VERSION="" ],
+)
+
+DTD_VERSION=1.0
+
+if test -z "$CS_VERSION" ; then
+   CS_VERSION="1.0.0"
+fi
+
+PKG_NAME=corosync
+PKG_FEATURES=""
+AM_INIT_AUTOMAKE($PKG_NAME, $CS_VERSION)
+AC_DEFINE_UNQUOTED(CS_VERSION, "$CS_VERSION", Current pacemaker version)
+AC_SUBST(PKG_NAME)
+
+
+LDD=ldd
+dnl Which C compiler?
+dnl Defaults to GNU C compiler if available.
+dnl Always tries to set the compiler to ANSI C via options (AM)
+dnl Can force other with environment variable "CC".
+AC_PROG_CC
+AC_PROG_CC_STDC
+AM_PROG_CC_C_O
+AC_PROG_RANLIB
+
+dnl ===============================================
+dnl Helpers 
+dnl ===============================================
+cc_supports_flag() {
+	  AC_MSG_CHECKING(whether $CC supports "$@")
+	  Cfile=/tmp/foo${$}
+	  touch ${Cfile}.c
+	  $CC -c "$@" ${Cfile}.c -o ${Cfile}.o >/dev/null 2>&1
+          rc=$?
+	  rm -f ${Cfile}.c ${Cfile}.o
+          case $rc in
+            0) AC_MSG_RESULT(yes);;
+            *) AC_MSG_RESULT(no);;
+          esac
+          return $rc
+}
+
+extract_header_define() {
+	  AC_MSG_CHECKING(for $2 in $1)
+	  Cfile=/tmp/extract_define.$2.${$}
+	  printf "#include <stdio.h>\n" > ${Cfile}.c
+	  printf "#include <%s>\n" $1 >> ${Cfile}.c
+	  printf "int main(int argc, char **argv) { printf(\"%%s\", %s); return 0; }\n" $2 >> ${Cfile}.c
+	  $CC $CFLAGS ${Cfile}.c -o ${Cfile}
+	  value=`${Cfile}`
+	  AC_MSG_RESULT($value)
+	  printf $value
+	  rm -f ${Cfile}.c ${Cfile}
+	}
+
+check_for_type() {
+  type="$1"
+  headers=""
+  shift
+  for arg
+  do
+    headers="${headers}${arg}
+"
+  done
+  program="if ((${type} *) 0)  return 0;
+    if (sizeof(${type}))  return 0; 
+    return 0;"
+  have="HAVE_`echo "$type" | tr ' ' '_' | dd conv=ucase 2>/dev/null`"
+  varhave="heartbeat_cv_$have"
+
+  AC_CACHE_CHECK([for type $type ],$varhave,[
+    AC_TRY_COMPILE([$headers], [$program], eval $varhave=yes, eval $varhave=no
+    , eval $varhave=cross)
+  ])
+  if test x"`eval echo '${'$varhave'}'`" = xyes; then
+    return 0
+  fi
+  return 1
+}
+
+check_for_type_member() {
+  type="$1"
+  member="$2"
+  headers=""
+  shift
+  shift
+  for arg
+  do
+    headers="${headers}${arg}
+"
+  done
+  program="${type} foo;
+    if ((${type} *) 0)  return 0;
+    if (sizeof(${type}))  return 0;
+    if (sizeof(foo))  return 0;
+    (void*)foo.${member};
+    return 0;"
+  have="HAVE_`echo "$type" | tr ' ' '_' | dd conv=ucase 2>/dev/null`"
+  varhave="heartbeat_cv_$have"
+
+  AC_CACHE_CHECK([for type $type ],$varhave,[
+    AC_TRY_COMPILE([$headers], [$program], eval $varhave=yes, eval $varhave=no
+    , eval $varhave=cross)
+  ])
+  if test x"`eval echo '${'$varhave'}'`" = xyes; then
+    return 0
+  fi
+  return 1
+}
+
+dnl ===============================================
+dnl Configure Options
+dnl ===============================================
+
+AC_ARG_ENABLE([ansi],
+[  --enable-ansi force GCC to compile to ANSI/ANSI standard for older compilers.
+     [default=no]])
+
+AC_ARG_ENABLE([fatal-warnings],
+[  --enable-fatal-warnings very pedantic and fatal warnings for gcc
+     [default=no]])
+
+AC_ARG_WITH(lcrso-dir, 
+    [  --with-lcrso-dir=DIR   Corosync lcrso files. ],
+    [ LCRSODIR="$withval" ])
+
+AC_ARG_ENABLE(static, 
+    [  --enable-static   Dont produce dynamic libraries. ],
+    [ default="no" ])
+
+AC_ARG_ENABLE(coverage, 
+    [  --enable-coverage   Coverage analysis of the codebase. ],
+    [ default="no" ])
+
+dnl ===============================================
+dnl General Processing
+dnl ===============================================
+
+CC_IN_CONFIGURE=yes
+export CC_IN_CONFIGURE
+
+AC_MSG_NOTICE(Sanitizing prefix: ${prefix})
+case $prefix in
+  NONE)	prefix=/usr;;
+esac
+
+AC_MSG_NOTICE(Sanitizing exec_prefix: ${exec_prefix})
+case $exec_prefix in
+  dnl For consistency with Heartbeat, map NONE->$prefix
+  NONE)	  exec_prefix=$prefix;;
+  prefix) exec_prefix=$prefix;;
+esac
+
+AC_MSG_NOTICE(Sanitizing ais_prefix: ${AISPREFIX})
+case $AISPREFIX in
+  dnl For consistency with Heartbeat, map NONE->$prefix
+  NONE)	  AISPREFIX=$prefix;;
+  prefix) AISPREFIX=$prefix;;
+esac
+
+AC_MSG_NOTICE(Sanitizing libdir: ${libdir})
+case $libdir in
+  dnl For consistency with Heartbeat, map NONE->$prefix
+  prefix|NONE|*exec_prefix*)
+    AC_MSG_CHECKING(which lib directory to use)
+    for aDir in lib64 lib
+    do
+      trydir="${exec_prefix}/${aDir}"
+      if
+        test -d ${trydir}
+      then
+        libdir=${trydir}
+        break
+      fi
+    done
+    AC_MSG_RESULT($libdir);
+    ;;
+esac
+
+
+dnl Expand autoconf variables so that we dont end up with '${prefix}' 
+dnl in #defines and python scripts
+dnl NOTE: Autoconf deliberately leaves them unexpanded to allow
+dnl    make exec_prefix=/foo install
+dnl No longer being able to do this seems like no great loss to me...
+
+eval prefix="`eval echo ${prefix}`"
+eval exec_prefix="`eval echo ${exec_prefix}`"
+eval bindir="`eval echo ${bindir}`"
+eval sbindir="`eval echo ${sbindir}`"
+eval libexecdir="`eval echo ${libexecdir}`"
+eval datadir="`eval echo ${datadir}`"
+eval sysconfdir="`eval echo ${sysconfdir}`"
+eval sharedstatedir="`eval echo ${sharedstatedir}`"
+eval localstatedir="`eval echo ${localstatedir}`"
+eval libdir="`eval echo ${libdir}`"
+eval includedir="`eval echo ${includedir}`"
+eval oldincludedir="`eval echo ${oldincludedir}`"
+eval infodir="`eval echo ${infodir}`"
+eval mandir="`eval echo ${mandir}`"
+eval docdir="`eval echo ${docdir}`"
+
+for j in prefix exec_prefix bindir sbindir libexecdir datadir sysconfdir \
+    sharedstatedir localstatedir libdir includedir oldincludedir infodir \
+    mandir docdir
+do 
+  dirname=`eval echo '${'${j}'}'`
+  if
+    test ! -d "$dirname"
+  then
+    AC_MSG_WARN([$j directory ($dirname) does not exist!])
+  fi
+done
+
+dnl This OS-based decision-making is poor autotools practice;
+dnl feature-based mechanisms are strongly preferred.
+dnl
+dnl So keep this section to a bare minimum; regard as a "necessary evil". 
+
+ON_DARWIN=0
+DYFLAGS=
+case "$host_os" in
+*bsd*)		LIBS="-L/usr/local/lib"
+		CPPFLAGS="$CPPFLAGS -I/usr/local/include"
+		AC_DEFINE_UNQUOTED(COROSYNC_BSD, 1, Compiling for BSD platform)
+		DYFLAGS="$DYFLAGS -export-dynamic"
+		;;
+*solaris*)
+		AC_DEFINE_UNQUOTED(COROSYNC_SOLARIS, 1, Compiling for Solaris platform)
+		AC_DEFINE_UNQUOTED(TS_CLASS, 1, Prevent being scheduled RR)
+		CFLAGS="$CFLAGS -D_REENTRANT"
+		LDFLAGS="$LDFLAGS -Wl,--export-dynamic -Wl,-rpath-link=/usr/lib"
+		;;
+*linux*)	
+		AC_DEFINE_UNQUOTED(COROSYNC_LINUX, 1, Compiling for Linux platform)
+		DYFLAGS="$DYFLAGS -rdynamic"
+ 		;;
+darwin*)	
+		ON_DARWIN=1
+		AC_DEFINE_UNQUOTED(COROSYNC_DARWIN, 1, Compiling for Darwin platform)
+#  		LIBS="$LIBS -L${prefix}/lib"
+#  		CFLAGS="$CFLAGS -I${prefix}/include"
+		;;
+esac
+AC_SUBST(DYFLAGS)
+
+case "$host_cpu" in
+  ppc64|powerpc64)
+    case $CFLAGS in
+     *powerpc64*)			;;
+     *)	if test "$GCC" = yes; then
+	  CFLAGS="$CFLAGS -m64"
+	fi				;;
+    esac
+esac
+
+AC_MSG_CHECKING(which format is needed to print uint64_t)
+case "$host_cpu" in
+  s390x)U64T="%lu";;
+  *64*) U64T="%lu";;
+  *)    U64T="%llu";;
+esac
+AC_MSG_RESULT($U64T)
+AC_DEFINE_UNQUOTED(U64T, "$U64T", Correct printf format for logging uint64_t)
+
+dnl Variables needed for substitution
+
+case x$LCRSODIR in
+     x) LCRSODIR=$libexecdir/corosync/lcrso;;
+esac
+AC_DEFINE_UNQUOTED(LCRSODIR, "$LCRSODIR", Location of Corosync lcrso plugins)
+AC_SUBST(LCRSODIR)
+
+
+dnl *************************************************************************
+PATH="$PATH:/sbin:/usr/sbin:/usr/local/sbin:/usr/local/bin"
+export PATH
+
+dnl ===============================================
+dnl Program Paths - Most of these need to go away
+dnl ===============================================
+
+
+AC_CHECK_PROGS(MAKE, gmake make)
+AC_PATH_PROGS(PKGCONFIG, pkg-config)
+AC_PATH_PROGS(SSH, ssh, /usr/bin/ssh)
+
+if test x"${MAKE}" = x""; then
+   AC_MSG_ERROR(You need (g)make installed in order to build ${PKG_NAME})
+fi
+
+AC_SUBST(MAKE)
+AC_SUBST(CC)
+
+dnl ===============================================
+dnl Libraries
+dnl ===============================================
+
+AC_CHECK_LIB(dl, dlopen)
+AC_CHECK_LIB(nsl, t_open)
+AC_CHECK_LIB(socket, socket)
+AC_CHECK_LIB(c, getpeereid)
+AC_CHECK_LIB(rt, sched_getscheduler)
+AC_CHECK_LIB(pthread, pthread_create)
+
+dnl if test x"${PKGCONFIG}" = x""; then
+dnl    AC_MSG_ERROR(You need pkgconfig installed in order to build ${PKG_NAME})
+dnl fi
+dnl
+dnl if test $PKGCONFIG --exists $GPKGNAME; then
+dnl 	CFLAGS="$CFLAGS `$GLIBCONFIG --cflags`"
+dnl 	LIBS="$LIBS `$GLIBCONFIG --libs`"
+dnl fi
+
+dnl ===============================================
+dnl Functions
+dnl ===============================================
+AC_CHECK_FUNCS(alphasort)
+AC_CHECK_FUNCS(scandir)
+AC_CHECK_FUNCS(getpeerucred)
+
+dnl ===============================================
+dnl Headers
+dnl ===============================================
+
+AC_HEADER_STDC
+
+AC_CHECK_HEADERS(sys/sockio.h)
+AC_CHECK_HEADERS(sys/types.h)
+AC_CHECK_HEADERS(sys/socket.h)
+AC_CHECK_HEADERS(malloc.h)
+AC_CHECK_HEADERS(getopt.h)
+
+dnl ===============================================
+dnl Typedefs
+dnl ===============================================
+
+dnl Check syslog.h for 'facilitynames' table
+dnl
+AC_CACHE_CHECK([for facilitynames in syslog.h],ac_cv_HAVE_SYSLOG_FACILITYNAMES,[
+AC_TRY_COMPILE([
+#define SYSLOG_NAMES
+#include <stdlib.h>
+#include <syslog.h>
+],
+[ void *fnames; fnames = facilitynames; ],
+ac_cv_HAVE_SYSLOG_FACILITYNAMES=yes,ac_cv_HAVE_SYSLOG_FACILITYNAMES=no,ac_cv_HAVE_SYSLOG_FACILITYNAMES=cross)])
+if test x"$ac_cv_HAVE_SYSLOG_FACILITYNAMES" = x"yes"; then
+    AC_DEFINE(HAVE_SYSLOG_FACILITYNAMES,1,[ ])
+fi
+
+dnl ===============================================
+dnl Compiler Characteristics
+dnl ===============================================
+
+dnl if not known on this system, #define size_t unsigned
+AC_TYPE_SIZE_T
+AC_CHECK_SIZEOF(char)
+AC_CHECK_SIZEOF(short)
+AC_CHECK_SIZEOF(int)
+AC_CHECK_SIZEOF(long)
+AC_CHECK_SIZEOF(long long)
+AC_C_STRINGIZE
+
+CC_WARNINGS=""
+
+dnl AC_CHECK_FUNCS(fcntl)
+
+dnl
+dnl Make sure that CFLAGS is not exported. If the user did
+dnl not have CFLAGS in their environment then this should have
+dnl no effect. However if CFLAGS was exported from the user's
+dnl environment, then the new CFLAGS will also be exported
+dnl to sub processes. 
+dnl
+
+if export | fgrep " CFLAGS=" > /dev/null; then
+	export -n CFLAGS || true # We don't want to bomb out if this fails
+fi
+
+if test "$GCC" != yes; then
+        CFLAGS="$CFLAGS -g"
+else
+        CFLAGS="$CFLAGS -ggdb3"
+
+	EXTRA_WARNINGS=""
+	# We had to eliminate -Wnested-externs because of libtool changes
+        WARNLIST="all missing-prototypes 
+		missing-declarations 
+		strict-prototypes 
+		declaration-after-statement
+		pointer-arith 
+		write-strings
+		cast-qual 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
+
+dnl Add any system specific options here.
+
+	case "$host_os" in
+  	*linux*|*bsd*)
+		if test "${enable_fatal_warnings}" = "unknown"; then
+        		enable_fatal_warnings=yes
+        	fi
+          	;;
+  	*solaris*)
+          	;;
+	esac
+
+	if test "x${enable_coverage}" = xyes && cc_supports_flag -ftest-coverage && cc_supports_flag -fprofile-arcs ; then
+	   echo "Enabling Coverage"
+	   CFLAGS="$CFLAGS -O0 -g -ftest-coverage -fprofile-arcs"
+	   LDFLAGS="$LDFLAGS -g -ftest-coverage -fprofile-arcs"
+	   enable_static=yes
+	   PKG_FEATURES="$PKG_FEATURES coverage"
+	fi
+
+	if test "x${enable_ansi}" = xyes && cc_supports_flag -std=iso9899:199409 ; then
+	  echo "Enabling ANSI Compatibility"
+	  ANSI="-ansi -D_GNU_SOURCE -DANSI_ONLY"
+	  PKG_FEATURES="$PKG_FEATURES ansi"
+	fi
+
+	if test "x${enable_fatal_warnings}" = xyes && cc_supports_flag -Werror ; then
+          echo "Enabling Fatal Warnings (-Werror)"
+    	  FATAL_WARNINGS="-Werror"
+	  PKG_FEATURES="$PKG_FEATURES fatal-warnings"
+        fi
+        
+	CC_WARNINGS="$EXTRA_WARNINGS $FATAL_WARNINGS $ANSI" 
+	NON_FATAL_CC_WARNINGS="$EXTRA_WARNINGS"
+
+fi
+dnl AC_SUBST(CC_WARNINGS)
+
+NON_FATAL_CFLAGS="$CFLAGS $NON_FATAL_CC_WARNINGS"
+AC_SUBST(NON_FATAL_CFLAGS)
+
+dnl
+dnl We reset CFLAGS to include our warnings *after* all function
+dnl checking goes on, so that our warning flags don't keep the
+dnl AC_*FUNCS() calls above from working.  In particular, -Werror will
+dnl *always* cause us troubles if we set it before here.
+dnl
+dnl
+CFLAGS="$CFLAGS $CC_WARNINGS"
+AC_SUBST(CFLAGS)
+
+dnl This is useful for use in Makefiles that need to remove one specific flag
+CFLAGS_COPY="$CFLAGS"
+AC_SUBST(CFLAGS_COPY)
+
+AM_CONDITIONAL(BUILD_DARWIN, test $ON_DARWIN = 1)
+AM_CONDITIONAL(BUILD_DYNAMIC, test "x${enable_static}" != xyes)
+
+if test "x${enable_static}" != xyes; then
+   PKG_FEATURES="$PKG_FEATURES static"
+fi
+
+LINT_FLAGS="-weak -unrecog +posixlib +ignoresigns -fcnuse -badflag -D__gnuc_va_list=va_list -D__attribute\(x\)="
+AC_SUBST(LINT_FLAGS)
+
+dnl ************************************************************************
+AC_SUBST(LOCALE)
+
+
+dnl The Makefiles and shell scripts we output
+AC_CONFIG_FILES(Makefile				        \
+include/Makefile						\
+lib/Makefile							\
+lcr/Makefile							\
+exec/Makefile							\
+test/Makefile							\
+tools/Makefile							\
+services/Makefile						\
+		)
+
+dnl Now process the entire list of files added by previous 
+dnl  calls to AC_CONFIG_FILES()
+AC_OUTPUT()
+
+dnl *****************
+dnl Configure summary
+dnl *****************
+
+AC_MSG_RESULT([])
+AC_MSG_RESULT([$PACKAGE configuration:])
+AC_MSG_RESULT([  Version                  = ${VERSION}])
+
+AC_MSG_RESULT([  Prefix                   = ${prefix}])
+AC_MSG_RESULT([  Executables              = ${sbindir}])
+AC_MSG_RESULT([  Man pages                = ${mandir}])
+AC_MSG_RESULT([  Libraries                = ${libdir}])
+AC_MSG_RESULT([  Header files             = ${includedir}])
+AC_MSG_RESULT([  Arch-independent files   = ${datadir}])
+AC_MSG_RESULT([  State information        = ${localstatedir}])
+AC_MSG_RESULT([  System configuration     = ${sysconfdir}])
+
+AC_MSG_RESULT([  Features                 =${PKG_FEATURES}])
+
+AC_MSG_RESULT([  CC_WARNINGS              = ${CC_WARNINGS}])
+AC_MSG_RESULT([  Mangled CFLAGS           = ${CFLAGS}])
+AC_MSG_RESULT([  Libraries                = ${LIBS}])

+ 0 - 202
exec/Makefile

@@ -1,202 +0,0 @@
-# Copyright (c) 2002-2006 MontaVista Software, Inc.
-# Copyright (c) 2006-2008 Red Hat, Inc.
-# 
-# All rights reserved.
-# 
-# This software licensed under BSD license, the text of which follows:
-# 
-# Redistribution and use in source and binary forms, with or without
-# modification, are permitted provided that the following conditions are met:
-# 
-# - Redistributions of source code must retain the above copyright notice,
-#   this list of conditions and the following disclaimer.
-# - Redistributions in binary form must reproduce the above copyright notice,
-#   this list of conditions and the following disclaimer in the documentation
-#   and/or other materials provided with the distribution.
-# - Neither the name of the MontaVista Software, Inc. nor the names of its
-#   contributors may be used to endorse or promote products derived from this
-#   software without specific prior written permission.
-#
-# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
-# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-# ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
-# LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
-# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
-# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
-# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
-# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
-# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
-# THE POSSIBILITY OF SUCH DAMAGE.
-
-# Include configuration
-#
-srcdir ?= $(CURDIR)/../
-subdir ?= exec/
-
-include $(srcdir)Makefile.inc
-
-override LDFLAGS += -L./ ${DYFLAGS}
-
-ifeq (${BUILD_DYNAMIC}, 1) 
-	override LDFLAGS += ${DYFLAGS}
-endif
-
-ifeq (${COROSYNC_COMPAT}, LINUX) 
-	override LDFLAGS += -ldl
-endif
-
-ifeq (${COROSYNC_COMPAT}, SOLARIS) 
-	override LDFLAGS += -lnsl -lsocket -lrt
-endif
-
-# Totem objects
-TOTEM_SRC = coropoll.c totemip.c totemnet.c totemrrp.c totemsrp.c totemmrp.c totempg.c crypto.c wthread.c
-TOTEM_OBJS = coropoll.o totemip.o totemnet.o totemrrp.o totemsrp.o totemmrp.o totempg.o crypto.o wthread.o
-LOGSYS_SRC = wthread.c logsys.c
-LOGSYS_OBJS = wthread.o logsys.o
-
-EXEC_LIBS = libtotem_pg.a liblogsys.a
-
-# LCR objects
-LCR_SRC = vsf_ykd.c objdb.c coroparse.c vsf_quorum.c
-LCR_OBJS = vsf_ykd.o objdb.o coroparse.o vsf_quorum.o
-
-# main executive objects
-MAIN_SRC = main.c mempool.c util.c sync.c apidef.c service.c ipc.c \
-	quorum.c timer.c totemconfig.c mainconfig.c
-MAIN_OBJS = main.o mempool.o util.o sync.o apidef.o service.o ipc.o \
-	quorum.o timer.o totemconfig.o mainconfig.o ../lcr/lcr_ifact.o
-
-ifeq (${BUILD_DYNAMIC}, 1) 
-#EXEC_OBJS = $(TOTEM_OBJS) $(LOGSYS_OBJS) $(MAIN_OBJS)
-EXEC_OBJS = $(MAIN_OBJS)
-override CFLAGS += -fPIC
-
-all:libtotem_pg.a libtotem_pg.so.2.0.0 liblogsys.a liblogsys.so.2.0.0 \
-	../lcr/lcr_ifact.o corosync_ \
-	objdb.lcrso vsf_ykd.lcrso coroparse.lcrso vsf_quorum.lcrso
-else
-EXEC_OBJS = $(MAIN_OBJS) $(LCR_OBJS)
-all: libtotem_pg.a liblogsys.a corosync
-endif
-
-
-ifeq (${COROSYNC_COMPAT}, DARWIN)
-
-objdb.lcrso: objdb.o
-	$(CC) -bundle -bundle_loader ./corosync -bind_at_load objdb.o -o $@
-
-vsf_ykd.lcrso: vsf_ykd.o
-	$(CC) $(LDFLAGS) -bundle $(LDFLAGS) -bundle_loader ./corosync -bind_at_load vsf_ykd.o -o $@
-
-vsf_quorum.lcrso: vsf_quorum.o
-	$(CC) $(LDFLAGS) -bundle $(LDFLAGS) -bundle_loader ./corosync -bind_at_load vsf_quorum.o -o $@
-
-coroparse.lcrso: coroparse.o
-	$(CC) -bundle -bundle_loader ./corosync -bind_at_load coroparse.o -o $@
-
-else
-
-vsf_ykd.lcrso: vsf_ykd.o
-	$(CC) -shared -Wl,-soname,vsf_ykd.lcrso vsf_ykd.o -o $@
-
-vsf_quorum.lcrso: vsf_quorum.o
-	$(CC) -shared -Wl,-soname,vsf_quorum.lcrso vsf_quorum.o -o $@
-
-objdb.lcrso: objdb.o
-	$(CC) -shared -Wl,-soname,objdb.lcrso objdb.o -o $@
-
-testquorum.lcrso: testquorum.o
-	$(CC) -shared -Wl,-soname,testquorum.lcrso objdb.o -o $@
-
-coroparse.lcrso: coroparse.o
-	$(CC) -shared -Wl,-soname,coroparse.lcrso coroparse.o -o $@
-endif
-
-corosync_: $(EXEC_OBJS) $(EXEC_LIBS)
-	$(CC) $(EXEC_OBJS) $(EXEC_LIBS) -o corosync $(LDFLAGS)
-
-libtotem_pg.a: $(TOTEM_OBJS)
-	$(AR) -rc libtotem_pg.a $(TOTEM_OBJS)
-
-liblogsys.a: $(LOGSYS_OBJS)
-	$(AR) -rc liblogsys.a $(LOGSYS_OBJS)
-
-ifeq (${COROSYNC_COMPAT}, DARWIN)
-
-libtotem_pg.so.2.0.0: $(TOTEM_OBJS)
-	$(CC) $(LDFLAGS) -bundle -bind_at_load $(TOTEM_OBJS) -o $@
-
-liblogsys.so.2.0.0: $(LOGSYS_OBJS)
-	$(CC) $(LDFLAGS) -bundle -bind_at_load $(LOGSYS_OBJS) -o $@
-else
-
-libtotem_pg.so.2.0.0: $(TOTEM_OBJS)
-	$(CC) $(LDFLAGS) -shared -Wl,-soname,libtotem_pg.so.2 $(TOTEM_OBJS) -o $@
-
-liblogsys.so.2.0.0: $(LIBLOGSYS_OBJS)
-	$(CC) -shared -Wl,-soname,liblogsys.so.2 $(LOGSYS_OBJS) -o $@ $(LDFLAGS)
-
-endif
-
-lint:
-	-splint $(LINT_FLAGS) $(CFLAGS) *.c
-
-clean:
-	rm -f corosync $(OBJS) *.o *.lcrso libtotem_pg.so* libtotem_pg.a gmon.out 
-	rm -f *.da *.bb *.bbg liblogsys.so* liblogsys.a
-
-depend:
-	makedepend -Y -- $(CFLAGS) $(CPPFLAGS) $(EXEC_SRC) $(TOTEM_SRC) $(LOGSYS_SRC) $(LCR_SRC) > /dev/null 2>&1
-
-# - fPIC rules required for service handler shared objects
-../lcr/lcr_ifact.o: $(srcdir)lcr/lcr_ifact.c
-	$(CC) $(CFLAGS) $(CPPFLAGS) -DPREFIX='"$(PREFIX)"' -c -o $@ $<
-
-vsf_ykd.o: vsf_ykd.c
-	$(CC) $(CFLAGS) $(CPPFLAGS) -c -o $@ $<
-
-vsf_quorum.o: vsf_quorum.c
-	$(CC) $(CFLAGS) $(CPPFLAGS) -c -o $@ $<
-
-objdb.o: objdb.c
-	$(CC) $(CFLAGS) -c -o $@ $<
-
-testquorum.o: testquorum.c
-	$(CC) $(CFLAGS) -c -o $@ $<
-
-coroparse.o: coroparse.c
-	$(CC) $(CFLAGS) -c -o $@ $<
-
-# -fPIC rules required for lib totem
-coropoll.o: coropoll.c
-	$(CC) $(CFLAGS) $(CPPFLAGS) -fPIC -c -o $@ $<
-
-totempg.o: totempg.c
-	$(CC) $(CFLAGS) $(CPPFLAGS) -fPIC -c -o $@ $<
-
-totemsrp.o: totemsrp.c
-	$(CC) $(CFLAGS) $(CPPFLAGS) -fPIC -c -o $@ $<
-
-totemrrp.o: totemrrp.c
-	$(CC) $(CFLAGS) $(CPPFLAGS) -fPIC -c -o $@ $<
-
-totemip.o: totemip.c
-	$(CC) $(CFLAGS) $(CPPFLAGS) -fPIC -c -o $@ $<
-
-totemnet.o: totemnet.c
-	$(CC) $(CFLAGS) $(CPPFLAGS) -fPIC -c -o $@ $<
-
-wthread.o: wthread.c
-	$(CC) $(CFLAGS) $(CPPFLAGS) -fPIC -c -o $@ $<
-
-crypto.o: crypto.c
-	$(CC) $(CFLAGS) $(CPPFLAGS) -fPIC -c -o $@ $<
-
-totemmrp.o: totemmrp.c
-	$(CC) $(CFLAGS) $(CPPFLAGS) -fPIC -c -o $@ $<
-
-totemconfig.o: totemconfig.c
-	$(CC) $(CFLAGS) $(CPPFLAGS) -fPIC -c -o $@ $<
-

+ 107 - 0
exec/Makefile.am

@@ -0,0 +1,107 @@
+# Copyright (c) 2009 Red Hat, Inc.
+# 
+# Authors: Andrew Beekhof
+#	   Steven Dake (sdake@redhat.com)
+#
+# This software licensed under BSD license, the text of which follows:
+# 
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions are met:
+# 
+# - Redistributions of source code must retain the above copyright notice,
+#   this list of conditions and the following disclaimer.
+# - Redistributions in binary form must reproduce the above copyright notice,
+#   this list of conditions and the following disclaimer in the documentation
+#   and/or other materials provided with the distribution.
+# - Neither the name of the MontaVista Software, Inc. nor the names of its
+#   contributors may be used to endorse or promote products derived from this
+#   software without specific prior written permission.
+#
+# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+# ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
+# LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+# THE POSSIBILITY OF SUCH DAMAGE.
+
+MAINTAINERCLEANFILES    = Makefile.in
+
+AM_CFLAGS	= -fPIC
+INCLUDES       	= -I$(top_builddir)/include  -I$(top_srcdir)/include
+DARWIN_OPTS	= -dynamiclib -bind_at_load -current_version 2.0.0 -compatibility_version 2.0.0
+
+LCRSO		= 
+LCR_SRC		= objdb.c vsf_ykd.c coroparse.c quorum.c vsf_quorum.c
+TOTEM_SRC	= coropoll.c totemip.c totemnet.c totemrrp.c totemsrp.c totemmrp.c totempg.c crypto.c wthread.c
+LOGSYS_SRC	= wthread.c logsys.c
+
+lib_LIBRARIES	= libtotem_pg.a liblogsys.a
+sbin_PROGRAMS	= corosync
+SHARED_LIBS	=
+
+libtotem_pg_a_SOURCES	= $(TOTEM_SRC)
+liblogsys_a_SOURCES	= $(LOGSYS_SRC)
+
+corosync_SOURCES = main.c mempool.c util.c sync.c apidef.c service.c ipc.c \
+		timer.c totemconfig.c mainconfig.c quorum.c ../lcr/lcr_ifact.c
+corosync_LDADD	  = -ltotem_pg -llogsys
+corosync_DEPENDENCIES = libtotem_pg.so.2.0.0 liblogsys.so.2.0.0
+corosync_LDFLAGS = $(DYFLAGS) -L./
+
+TOTEM_OBJS	= $(TOTEM_SRC:%.c=%.o)
+LOGSYS_OBJS	= $(LOGSYS_SRC:%.c=%.o)
+
+if BUILD_DYNAMIC
+SHARED_LIBS	+= $(lib_LIBRARIES:%.a=%.so.2.0.0)
+SHARED_LIBS_SO	= $(SHARED_LIBS:%.so.2.0.0=%.so)
+SHARED_LIBS_SO_TWO = $(SHARED_LIBS:%.so.2.0.0=%.so.2)
+LCRSO		+= $(LCR_SRC:%.c=%.lcrso)
+else
+corosync_SOURCES += $(LCR_SRC)
+endif
+
+if BUILD_DARWIN
+%.lcrso: %.o
+	$(CC) $(CFLAGS) -bundle -bind_at_load -bundle_loader ./corosync $^ -o $@
+
+libtotem_pg.so.2.0.0: $(TOTEM_OBJS)
+	$(CC) $(LDFLAGS) $(DARWIN_OPTS) $(TOTEM_OBJS) -o $@
+
+liblogsys.so.2.0.0: $(LOGSYS_OBJS)
+	$(CC) $(LDFLAGS) $(DARWIN_OPTS) $(LOGSYS_OBJS) -o $@
+
+else
+
+%.lcrso: %.o
+	$(CC) $(CFLAGS) -shared -Wl,-soname,$@ $^ -o $@
+
+libtotem_pg.so.2.0.0: $(TOTEM_OBJS)
+	$(CC) $(LDFLAGS) -shared -Wl,-soname,libtotem_pg.so.2 $^ -o $@
+	ln -sf libtotem_pg.so.2.0.0 libtotem_pg.so
+	ln -sf libtotem_pg.so.2.0.0 libtotem_pg.so.2
+
+liblogsys.so.2.0.0: $(LOGSYS_OBJS)
+	$(CC) $(LDFLAGS) -shared -Wl,-soname,liblogsys.so.2 $^ -o $@
+	ln -sf liblogsys.so.2.0.0 liblogsys.so
+	ln -sf liblogsys.so.2.0.0 liblogsys.so.2
+endif
+
+lint:
+	-splint $(LINT_FLAGS) $(CFLAGS) *.c
+
+all-local: $(LCRSO) $(SHARED_LIBS)
+	@echo Built corosync Executive
+
+install-exec-local:
+	for lib in $(SHARED_LIBS) $(SHARED_LIBS_SO) $(SHARED_LIBS_SO_TWO); do $(INSTALL) -m 644 $$lib $(DESTDIR)/$(libdir); done
+	for lib in $(LCRSO); do	$(INSTALL) -m 644 $$lib $(DESTDIR)/$(LCRSODIR); done
+
+clean-local:
+	rm -f corosync *.o *.lcrso gmon.out *.da *.bb *.bbg *.so*
+
+

+ 2 - 0
exec/ipc.c

@@ -87,6 +87,8 @@
 #include <corosync/engine/coroapi.h>
 #include "service.h"
 
+#include "config.h"
+
 LOGSYS_DECLARE_SUBSYS ("IPC", LOG_INFO);
 
 #include "util.h"

+ 1 - 0
exec/totemip.c

@@ -34,6 +34,7 @@
 
 /* IPv4/6 abstraction */
 
+#include <config.h>
 #include <sys/ioctl.h>
 #include <sys/types.h>
 #include <sys/socket.h>

+ 16 - 26
Makefile.samples → include/Makefile.am

@@ -1,7 +1,8 @@
-# Copyright (c) 2002-2004 MontaVista Software, Inc.
-# 
-# All rights reserved.
+# Copyright (c) 2009 Red Hat, Inc.
 # 
+# Authors: Andrew Beekhof
+#	   Steven Dake (sdake@redhat.com)
+#
 # This software licensed under BSD license, the text of which follows:
 # 
 # Redistribution and use in source and binary forms, with or without
@@ -27,37 +28,26 @@
 # CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
 # ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
 # THE POSSIBILITY OF SUCH DAMAGE.
-CFLAGS = -c -O2 -I/usr/include/ais
-LDFLAGS = 
 
-all:clean testclm testamf testamf1 testamf2 testamf3 testamf4 testamf5 testamf6
+MAINTAINERCLEANFILES    = Makefile.in
 
-cleanup:
-	rm -f testclm testamf
+CS_H			= hdb.h cs_config.h cpg.h cfg.h evs.h ipc_gen.h mar_gen.h swab.h 	\
+		  	coroipc.h confdb.h list.h corotypes.h
 
-testclm: testclm.o
-	$(CC) $(LDFLAGS) -o testclm testclm.o -lais
+CS_INTERNAL_H		= ipc_cfg.h ipc_confdb.h ipc_cpg.h ipc_evs.h ipc_pload.h ipc_quorum.h 	\
+			jhash.h mar_cpg.h pload.h queue.h quorum.h rmd.h sq.h
 
-testamf: testamf.o 
-	$(CC) $(LDFLAGS) -o testamf testamf.o -lais
+LCR_H			= lcr_ckpt.h lcr_comp.h	lcr_ifact.h
 
-testamf1: testamf1.o libais.a
-	$(CC) $(LDFLAGS) -o testamf1 testamf1.o libais.a
+ENGINE_H		= config.h coroapi.h logsys.h objdb.h
 
-testamf2: testamf2.o libais.a
-	$(CC) $(LDFLAGS) -o testamf2 testamf2.o libais.a
+TOTEM_H			= coropoll.h totem.h totemip.h totempg.h
 
-testamf3: testamf3.o libais.a
-	$(CC) $(LDFLAGS) -o testamf3 testamf3.o libais.a
+EXTRA_DIST 		= $(noinst_HEADERS)
 
-testamf4: testamf4.o libais.a
-	$(CC) $(LDFLAGS) -o testamf4 testamf4.o libais.a
+noinst_HEADERS          = $(CS_INTERNAL_H:%=corosync/%) 
 
-testamf5: testamf5.o libais.a
-	$(CC) $(LDFLAGS) -o testamf5 testamf5.o libais.a
+nobase_include_HEADERS	= $(CS_H:%=corosync/%) $(LCR_H:%=corosync/lcr/%) 			\
+			$(ENGINE_H:%=corosync/engine/%) $(TOTEM_H:%=corosync/totem/%)
 
-testamf6: testamf6.o libais.a
-	$(CC) $(LDFLAGS) -o testamf6 testamf6.o libais.a
 
-clean:
-	rm -f *.o testclm testamf testamf1 testamf2 testamf3 testamf4 testamf5 testamf6

+ 0 - 0
include/corosync/cs_config.h.in


+ 33 - 48
lcr/Makefile → lcr/Makefile.am

@@ -1,3 +1,10 @@
+# Copyright (c) 2009 Red Hat, Inc.
+# 
+# Authors: Andrew Beekhof
+#	   Steven Dake (sdake@redhat.com)
+#
+# This software licensed under BSD license, the text of which follows:
+# 
 # Redistribution and use in source and binary forms, with or without
 # modification, are permitted provided that the following conditions are met:
 # 
@@ -21,69 +28,47 @@
 # CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
 # ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
 # THE POSSIBILITY OF SUCH DAMAGE.
+MAINTAINERCLEANFILES    = Makefile.in
 
-# Include configuration
-#
-include ../Makefile.inc
+AM_CFLAGS		= -fPIC
+INCLUDES       		= -I$(top_builddir)/include  -I$(top_srcdir)/include
 
-override LDFLAGS += -L./ ${DYFLAGS}
+LCRSO			= libtest_a.lcrso libtest_b.lcrso
 
-ifeq (${COROSYNC_COMPAT}, LINUX) 
-	LDFLAGS += -ldl
-endif
+lib_LIBRARIES		= liblcr.a
 
-ifeq (${COROSYNC_COMPAT}, SOLARIS)
-	override LDFLAGS += -lnsl -lsocket
-endif
+noinst_PROGRAMS		= test test_static uic
 
-all:liblcr.a test test_static uic libtest_a.lcrso libtest_b.lcrso
+noinst_LCRSO		= libtest_a.lcrso libtest_b.lcrso
 
-liblcr.a: lcr_ifact.o
-	$(AR) -rc liblcr.a lcr_ifact.o
+uic_SOURCES		= uic.c
 
-ifeq (${COROSYNC_COMPAT}, DARWIN)
+liblcr_a_SOURCES	= lcr_ifact.c
 
-libtest_a.lcrso: libtest_a.o
-	$(CC) $(CFLAGS) -bundle -bundle_loader ./test libtest_a.o -o $@
+test_SOURCES		= test.c uis.c
+test_LDADD		= liblcr.a
 
-libtest_b.lcrso: libtest_b.o
-	$(CC) $(CFLAGS) -bundle -bundle_loader ./test libtest_b.o -o $@
+test_static_SOURCES	= test.c libtest_a.c libtest_b.c uis.c lcr_ifact.c
 
+if BUILD_DARWIN
+%.lcrso: %.o
+	$(CC) $(CFLAGS) -bundle -bundle_loader ./test $^ -o $@
 else
-
-libtest_a.lcrso: libtest_a.o
-	$(CC) $(CFLAGS) -shared -Wl,-soname,libtest_b.lcrso libtest_a.o -o $@
-
-libtest_b.lcrso: libtest_b.o
-	$(CC) $(CFLAGS) -shared -Wl,-soname,libtest_b.lcrso libtest_b.o -o $@
-
+%.lcrso: %.o
+	$(CC) $(CFLAGS) -shared -Wl,-soname,$@ $^ -o $@
 endif
-	
-test: test.o uis.o lcr_ifact.o
-	$(CC) $(LDFLAGS) -fPIC test.o lcr_ifact.o uis.o -lpthread -o test
-
-test_static: test.o libtest_a.o libtest_b.o uis.o lcr_ifact.o
-	$(CC) $(LDFLAGS) test.o libtest_a.o libtest_b.o lcr_ifact.o -o test_static
-
-uic: uic.o
-	$(CC) $(LDFLAGS) uic.o -o uic
 
-libtest_a.o: libtest_a.c
-	$(CC) $(CFLAGS) $(CPPFLAGS) -fPIC -c -o $@ $<
-
-libtest_b.o: libtest_b.c
-	$(CC) $(CFLAGS) $(CPPFLAGS) -fPIC -c -o $@ $<
+lint:
+	-splint $(LINT_FLAGS) $(CFLAGS) *.c
 
-lcr_ifact.o: lcr_ifact.c
-	$(CC) $(CFLAGS) $(CPPFLAGS) -fPIC -c -o $@ $<
+all-local: $(LCRSO)
+	@echo Built Live Component Replacement System
 
-test.o: test.c
-	$(CC) $(CFLAGS) $(CPPFLAGS) -fPIC -c -o $@ $<
+install-exec-local:
+	mkdir -p $(DESTDIR)/$(LCRSODIR)
+	for lib in $(LCRSO); do	$(INSTALL) -m 644 $$lib $(DESTDIR)/$(LCRSODIR); done
 
-clean:
-	rm -f test libtest.so* *.o uic liblcr.so* liblcr.a *.lcrso *.da *.ba *.bb *.bbg \
-	test_static
+clean-local:
+	rm -f *.o *.a *.so* *.da *.bb *.bbg *.lcrso
 
-lint:
-	-splint $(LINT_FLAGS) $(CFLAGS) lcr_ifact.c uic.c uis.c
 

+ 1 - 0
lcr/lcr_ifact.c

@@ -43,6 +43,7 @@
 #include <corosync/lcr/lcr_ifact.h>
 #include <corosync/hdb.h>
 #include <stdlib.h>
+#include "config.h"
 
 struct lcr_component_instance {
 	struct lcr_iface *ifaces;

+ 0 - 139
lib/Makefile

@@ -1,139 +0,0 @@
-# Copyright (c) 2002-2005 MontaVista Software, Inc.
-# 
-# All rights reserved.
-# 
-# This software licensed under BSD license, the text of which follows:
-# 
-# Redistribution and use in source and binary forms, with or without
-# modification, are permitted provided that the following conditions are met:
-# 
-# - Redistributions of source code must retain the above copyright notice,
-#   this list of conditions and the following disclaimer.
-# - Redistributions in binary form must reproduce the above copyright notice,
-#   this list of conditions and the following disclaimer in the documentation
-#   and/or other materials provided with the distribution.
-# - Neither the name of the MontaVista Software, Inc. nor the names of its
-#   contributors may be used to endorse or promote products derived from this
-#   software without specific prior written permission.
-#
-# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
-# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-# ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
-# LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
-# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
-# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
-# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
-# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
-# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
-# THE POSSIBILITY OF SUCH DAMAGE.
-
-# Include configuration
-#
-srcdir ?= $(CURDIR)/../
-subdir ?= lib/
-
-include $(srcdir)Makefile.inc
-
-override LDFLAGS += -L./
-
-all: libcpg.a libcpg.so.2.0.0 \
-	libconfdb.a libconfdb.so.2.0.0 \
-	libevs.a libevs.so.2.0.0 \
-	libcfg.a libcfg.so.2.0.0 \
-	libquorum.a libquorum.so.2.0.0 \
-	libpload.a libpload.so.2.0.0 \
-	libcoroipc.a libcoroipc.so.2.0.0 \
-	libvotequorum.a libvotequorum.so.2.0.0
-
-libcoroipc.a: coroipc.o
-	$(AR) -rc libcoroipc.a coroipc.o
-
-ifeq (${COROSYNC_COMPAT}, DARWIN)
-
-DARWIN_OPTS=-dynamiclib -bind_at_load -current_version 2.0.0 -compatibility_version 2.0.0
-libcoroipc.so.2.0.0: coroipc.o
-	$(CC) $(LDFLAGS) $(DARWIN_OPTS) coroipc.o -o $@
-
-libevs.so.2.0.0: coroipc.o evs.o
-	$(CC) $(LDFLAGS) $(DARWIN_OPTS) coroipc.o evs.o -o $@
-
-libcpg.so.2.0.0: coroipc.o cpg.o
-	$(CC) $(DARWIN_OPTS) coroipc.o cpg.o -o $@
-
-libquorum.so.2.0.0: coroipc.o quorum.o
-	$(CC) $(DARWIN_OPTS) coroipc.o quorum.o -o $@
-
-libvotequorum.so.2.0.0: coroipc.o votequorum.o
-	$(CC) $(DARWIN_OPTS) coroipc.o votequorum.o -o $@
-
-libconfdb.so.2.0.0: coroipc.o confdb.o sa-confdb.o 
-	$(CC) $(LDFLAGS) $(DARWIN_OPTS) coroipc.o confdb.o sa-confdb.o ../lcr/lcr_ifact.o -o $@
-
-libcfg.so.2.0.0: coroipc.o cfg.o
-	$(CC) $(DARWIN_OPTS) coroipc.o cfg.o -o $@
-
-libpload.so.2.0.0: coroipc.o pload.o
-	$(CC) $(DARWIN_OPTS) coroipc.o pload.o -o $@
-
-else
-
-libcoroipc.so.2.0.0: coroipc.o
-	$(CC) $(LDFLAGS) -shared -Wl,-soname,libcoroipc.so.2,-version-script=$(srcdir)$(subdir)libcoroipc.versions coroipc.o -o $@
-
-libevs.so.2.0.0: coroipc.o evs.o
-	$(CC) $(LDFLAGS) -shared -Wl,-soname,libevs.so.2,-version-script=$(srcdir)$(subdir)libevs.versions coroipc.o evs.o -o $@
-
-libcpg.so.2.0.0: coroipc.o cpg.o
-	$(CC) -shared -Wl,-soname,libcpg.so.2,-version-script=$(srcdir)$(subdir)libcpg.versions coroipc.o cpg.o -o $@
-
-libquorum.so.2.0.0: coroipc.o quorum.o
-	$(CC) -shared -Wl,-soname,libquorum.so.2,-version-script=$(srcdir)$(subdir)libquorum.versions coroipc.o quorum.o -o $@
-
-libvotequorum.so.2.0.0: coroipc.o votequorum.o
-	$(CC) -shared -Wl,-soname,libvotequorum.so.2,-version-script=$(srcdir)$(subdir)libvotequorum.versions coroipc.o votequorum.o -o $@
-
-libconfdb.so.2.0.0: coroipc.o confdb.o sa-confdb.o 
-	$(CC) $(LDFLAGS) -shared -Wl,-soname,libconfdb.so.2,-version-script=$(srcdir)$(subdir)libconfdb.versions coroipc.o confdb.o sa-confdb.o ../lcr/lcr_ifact.o -o $@
-
-libcfg.so.2.0.0: coroipc.o cfg.o
-	$(CC) -shared -Wl,-soname,libcfg.so.2,-version-script=$(srcdir)$(subdir)libcfg.versions coroipc.o cfg.o -o $@
-
-libpload.so.2.0.0: coroipc.o pload.o
-	$(CC) -shared -Wl,-soname,libpload.so.2,-version-script=$(srcdir)$(subdir)libpload.versions coroipc.o cfg.o -o $@
-
-endif
-
-libevs.a: coroipc.o evs.o
-	$(AR) -rc libevs.a coroipc.o evs.o
-
-libcpg.a: coroipc.o cpg.o
-	$(AR) -rc libcpg.a coroipc.o cpg.o
-
-libquorum.a: coroipc.o quorum.o
-	$(AR) -rc libquorum.a coroipc.o quorum.o
-
-libvotequorum.a: coroipc.o votequorum.o
-	$(AR) -rc libvotequorum.a coroipc.o votequorum.o
-
-libconfdb.a: coroipc.o confdb.o sa-confdb.o
-	$(AR) -rc libconfdb.a coroipc.o confdb.o sa-confdb.o ../lcr/lcr_ifact.o
-
-libcfg.a: coroipc.o cfg.o
-	$(AR) -rc libcfg.a coroipc.o cfg.o
-
-libpload.a: coroipc.o pload.o
-	$(AR) -rc libpload.a coroipc.o pload.o
-
-clean:
-	rm -f *.o *.a *.so* *.da *.bb *.bbg
- 
-lint:
-	-splint $(LINT_FLAGS) $(CFLAGS) *.c
-
-# -fPIC rules required for all libraries
-%.o: %.c
-	$(CC) $(CFLAGS) $(CPPFLAGS) -fPIC -c -o $@ $<
-
-depend:
-	makedepend -Y -- $(CFLAGS) $(CPPFLAGS) $(LIBAIS_SRC) > /dev/null 2>&1

+ 93 - 0
lib/Makefile.am

@@ -0,0 +1,93 @@
+#
+# Copyright (c) 2009 Red Hat, Inc.
+# 
+# Authors: Andrew Beekhof
+#	   Steven Dake (sdake@redhat.com)
+#
+# This software licensed under BSD license, the text of which follows:
+# 
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions are met:
+# 
+# - Redistributions of source code must retain the above copyright notice,
+#   this list of conditions and the following disclaimer.
+# - Redistributions in binary form must reproduce the above copyright notice,
+#   this list of conditions and the following disclaimer in the documentation
+#   and/or other materials provided with the distribution.
+# - Neither the name of the MontaVista Software, Inc. nor the names of its
+#   contributors may be used to endorse or promote products derived from this
+#   software without specific prior written permission.
+#
+# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+# ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
+# LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+# THE POSSIBILITY OF SUCH DAMAGE.
+
+MAINTAINERCLEANFILES    = Makefile.in
+
+AM_CFLAGS		= -fPIC
+INCLUDES       		= -I$(top_builddir)/include  -I$(top_srcdir)/include
+DARWIN_OPTS		= -dynamiclib -bind_at_load -current_version 2.0.0 -compatibility_version 2.0.0
+
+lib_LIBRARIES	= libcpg.a libconfdb.a libevs.a libcfg.a libquorum.a libvotequorum.a libpload.a libcoroipc.a
+SHARED_LIBS		= $(lib_LIBRARIES:%.a=%.so.2.0.0)
+SHARED_LIBS_SO		= $(lib_LIBRARIES:%.a=%.so)
+SHARED_LIBS_SO_TWO	= $(lib_LIBRARIES:%.a=%.so.2)
+
+libcpg_a_SOURCES	= coroipc.c cpg.c
+libcfg_a_SOURCES	= coroipc.c cfg.c
+libevs_a_SOURCES	= coroipc.c evs.c
+libpload_a_SOURCES	= coroipc.c pload.c
+libquorum_a_SOURCES	= coroipc.c quorum.c
+libvotequorum_a_SOURCES	= coroipc.c votequorum.c
+libconfdb_a_SOURCES	= coroipc.c confdb.c sa-confdb.c
+libcoroipc_a_SOURCES	= coroipc.c
+
+
+if BUILD_DARWIN
+
+libcoroipc.so.2.0.0: coroipc.o
+	$(CC) $(LDFLAGS) $(DARWIN_OPTS) coroipc.o -o $@
+
+libconfdb.so.2.0.0: coroipc.o confdb.o sa-confdb.o 
+	$(CC) $(LDFLAGS) $(DARWIN_OPTS) coroipc.o confdb.o sa-confdb.o ../lcr/lcr_ifact.o -o $@
+
+lib%.so.2.0.0: coroipc.o %.o
+	$(CC) $(DARWIN_OPTS) $^ -o $@
+
+else
+
+libcoroipc.so.2.0.0: coroipc.o
+	$(CC) $(LDFLAGS) -shared -Wl,-soname,libcoroipc.so.2,-version-script=$(srcdir)/libcoroipc.versions coroipc.o -o $@
+	ln -sf libcoroipc.so.2.0.0 libcoroipc.so
+	ln -sf libcoroipc.so.2.0.0 libcoroipc.so.2
+
+libconfdb.so.2.0.0: coroipc.o confdb.o sa-confdb.o 
+	$(CC) $(LDFLAGS) $(DYFLAGS) -shared -Wl,-soname,libconfdb.so.2,-version-script=$(srcdir)/libconfdb.versions coroipc.o confdb.o sa-confdb.o ../lcr/lcr_ifact.o -o $@
+	ln -sf libconfdb.so.2.0.0 libconfdb.so
+	ln -sf libconfdb.so.2.0.0 libconfdb.so.2
+
+lib%.so.2.0.0: coroipc.o %.o
+	$(CC) -shared -Wl,-soname,lib$*.so.2,-version-script=$(srcdir)/lib$*.versions $^ -o $@
+	ln -sf lib$*.so.2.0.0 lib$*.so
+	ln -sf lib$*.so.2.0.0 lib$*.so.2
+
+endif
+
+all-local: $(SHARED_LIBS)
+	@echo Built shared libs
+
+install-exec-local:
+	for lib in $(SHARED_LIBS) $(SHARED_LIBS_SO) $(SHARED_LIBS_SO_TWO); do $(INSTALL) -m 644 $$lib $(DESTDIR)/$(libdir); done
+
+clean-local:
+	rm -f *.o *.a *.so* *.da *.bb *.bbg
+
+

+ 2 - 0
lib/coroipc.c

@@ -59,6 +59,8 @@
 #include <corosync/ipc_gen.h>
 #include <corosync/coroipc.h>
 
+#include "config.h"
+
 enum SA_HANDLE_STATE {
 	SA_HANDLE_STATE_EMPTY,
 	SA_HANDLE_STATE_PENDINGREMOVAL,

+ 0 - 130
services/Makefile

@@ -1,130 +0,0 @@
-# Copyright (c) 2006-2008 Red Hat, Inc.
-# 
-# All rights reserved.
-# 
-# This software licensed under BSD license, the text of which follows:
-# 
-# Redistribution and use in source and binary forms, with or without
-# modification, are permitted provided that the following conditions are met:
-# 
-# - Redistributions of source code must retain the above copyright notice,
-#   this list of conditions and the following disclaimer.
-# - Redistributions in binary form must reproduce the above copyright notice,
-#   this list of conditions and the following disclaimer in the documentation
-#   and/or other materials provided with the distribution.
-# - Neither the name of the MontaVista Software, Inc. nor the names of its
-#   contributors may be used to endorse or promote products derived from this
-#   software without specific prior written permission.
-#
-# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
-# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-# ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
-# LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
-# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
-# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
-# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
-# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
-# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
-# THE POSSIBILITY OF SUCH DAMAGE.
-
-# Include configuration
-#
-srcdir ?= $(CURDIR)/../
-subdir ?= services/
-
-include $(srcdir)Makefile.inc
-
-override LDFLAGS += -L./
-
-ifeq (${BUILD_DYNAMIC}, 1) 
-	override LDFLAGS += ${DYFLAGS}
-endif
-
-ifeq (${COROSYNC_COMPAT}, LINUX) 
-	override LDFLAGS += -ldl
-endif
-
-ifeq (${COROSYNC_COMPAT}, SOLARIS) 
-	override LDFLAGS += -lnsl -lsocket -lrt
-endif
-
-# LCR objects
-LCR_SRC = evs.c cfg.c cpg.c confdb.c pload.c
-LCR_OBJS = evs.o cfg.o cpg.o confdb.o $(AMF_OBJS) pload.o
-
-override CFLAGS += -fPIC
-
-all: service_evs.lcrso service_cfg.lcrso service_cpg.lcrso service_confdb.lcrso service_pload.lcrso testquorum.lcrso service_votequorum.lcrso
-
-ifeq (${COROSYNC_COMPAT}, DARWIN)
-
-service_evs.lcrso: evs.o
-	$(CC) $(LDFLAGS) -bundle $(LDFLAGS) -bundle_loader ../exec/corosync -bind_at_load evs.o -o $@
-
-service_cfg.lcrso: cfg.o
-	$(CC) $(LDFLAGS) -bundle $(LDFLAGS) -bundle_loader ../exec/corosync -bind_at_load cfg.o -o $@
-
-service_confdb.lcrso: confdb.o
-	$(CC) $(LDFLAGS) -bundle $(LDFLAGS) -bundle_loader ../exec/corosync -bind_at_load confdb.o -o $@
-
-service_cpg.lcrso: cpg.o
-	$(CC) $(LDFLAGS) -bundle $(LDFLAGS) -bundle_loader ../exec/corosync -bind_at_load cpg.o -o $@
-
-service_pload.lcrso: pload.o
-	$(CC) $(LDFLAGS) -bundle $(LDFLAGS) -bundle_loader ../exec/corosync -bind_at_load pload.o -o $@
-
-service_votequorum.lcrso: votequorum.o
-	$(CC) $(LDFLAGS) -bundle $(LDFLAGS) -bundle_loader ../exec/corosync -bind_at_load votequorum.o -o $@
-
-testquorum.lcrso: testquorum.o
-	$(CC) $(LDFLAGS) -bundle $(LDFLAGS) -bundle_loader ../exec/corosync -bind_at_load testquorum.o -o $@
-
-else
-
-service_evs.lcrso: evs.o
-	$(CC) -shared -Wl,-soname,service_evs.lcrso evs.o -o $@
-
-service_cfg.lcrso: cfg.o
-	$(CC) -shared -Wl,-soname,service_cfg.lcrso cfg.o -o $@
-
-service_confdb.lcrso: confdb.o
-	$(CC) -shared -Wl,-soname,service_confdb.lcrso confdb.o -o $@
-
-service_cpg.lcrso: cpg.o
-	$(CC) -shared -Wl,-soname,service_cpg.lcrso cpg.o -o $@
-
-service_pload.lcrso: pload.o
-	$(CC) -shared -Wl,-soname,service_pload.lcrso pload.o -o $@
-
-service_votequorum.lcrso: votequorum.o
-	$(CC) -shared -Wl,-soname,service_votequorum.lcrso votequorum.o -o $@
-
-testquorum.lcrso: testquorum.o
-	$(CC) -shared -Wl,-soname,testquorum.lcrso testquorum.o -o $@
-
-endif
-
-clean:
-	rm -f *.o *.lcrso 
-
-lint:
-	-splint $(LINT_FLAGS) $(CFLAGS) *.c
-
-depend:
-	makedepend -Y -- $(CFLAGS) $(CPPFLAGS) $(EXEC_SRC) $(TOTEM_SRC) $(LOGSYS_SRC) $(LCR_SRC) > /dev/null 2>&1
-
-evs.o: evs.c
-	$(CC) $(CFLAGS) $(CPPFLAGS) -c -o $@ $<
-
-cfg.o: cfg.c
-	$(CC) $(CFLAGS) $(CPPFLAGS) -c -o $@ $<
-
-confdb.o: confdb.c
-	$(CC) $(CFLAGS) $(CPPFLAGS) -c -o $@ $<
-
-cpg.o: cpg.c
-	$(CC) $(CFLAGS) $(CPPFLAGS) -c -o $@ $<
-
-testquorum.o: testquorum.c
-	$(CC) $(CFLAGS) $(CPPFLAGS) -c -o $@ $<

+ 23 - 42
tools/Makefile → services/Makefile.am

@@ -1,9 +1,8 @@
-# Copyright (c) 2008 Allied Telesis Labs NZ.
+# Copyright (c) 2009 Red Hat, Inc.
 # 
-# Author: Angus Salkeld
+# Authors: Andrew Beekhof
+#	   Steven Dake (sdake@redhat.com)
 #
-# All rights reserved.
-# 
 # This software licensed under BSD license, the text of which follows:
 # 
 # Redistribution and use in source and binary forms, with or without
@@ -30,51 +29,33 @@
 # ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
 # THE POSSIBILITY OF SUCH DAMAGE.
 
-# Include configuration
-#
-srcdir ?= $(CURDIR)/../
-subdir ?= apps/
+MAINTAINERCLEANFILES    = Makefile.in
 
-include $(srcdir)Makefile.inc
+AM_CFLAGS		= -fPIC
+INCLUDES       		= -I$(top_builddir)/include  -I$(top_srcdir)/include
+LCRSO			= service_evs.lcrso service_cfg.lcrso service_cpg.lcrso service_confdb.lcrso service_pload.lcrso service_votequorum.lcrso service_testquorum.lcrso
 
-ifeq (${COROSYNC_COMPAT}, SOLARIS)
-	override LDFLAGS += -lnsl -lsocket -lrt
+if BUILD_DARWIN
+service_%.lcrso: %.o
+	$(CC) $(CFLAGS) -bundle -bundle_loader ../exec/corosync $^ -o $@
+else
+service_%.lcrso: %.o
+	$(CC) $(CFLAGS) -shared -Wl,-soname,$@ $^ -o $@
 endif
 
-LIBS = ../lib/libconfdb.a ../lib/libcfg.a ../lib/libpload.a
-BINARIES=corosync-objctl corosync-cfgtool corosync-keygen corosync-fplay corosync-pload
-APPS_SRC=$(addsuffix .c,$(BINARIES))
-EXTRA_CFLAGS = -I$(srcdir)include
-
-all: $(BINARIES)
-
-corosync-objctl: corosync-objctl.o $(LIBS)
-	$(CC) $(LDFLAGS) -o $@ $< $(LIBS)
-
-corosync-cfgtool: corosync-cfgtool.o $(LIBS)
-	$(CC) $(LDFLAGS) -o $@ $< $(LIBS)
+%.o: %.c
+	$(CC) $(AM_CFLAGS) $(CFLAGS) $(CPPFLAGS) $(INCLUDES) -c -o $@ $<
 
-corosync-keygen: corosync-keygen.o
-	$(CC) $(LDFLAGS) -o $@ $<
+lint:
+	-splint $(LINT_FLAGS) $(CFLAGS) *.c
 
-corosync-fplay: corosync-fplay.o
-	$(CC) $(LDFLAGS) -o $@ $<
+all-local: $(LCRSO)
+	@echo Built Service Engines
 
-corosync-pload: corosync-pload.o
-	$(CC) $(LDFLAGS) -o $@ $< $(LIBS)
+install-exec-local:
+	for lib in $(LCRSO); do	$(INSTALL) -m 644 $$lib $(DESTDIR)/$(LCRSODIR); done
 
-clean:
-	rm -f *.o $(BINARIES)
+clean-local:
+	rm -f *.o *.a *.so* *.da *.bb *.bbg *.lcrso
 
-lint:
-	-splint $(LINT_FLAGS) $(CFLAGS) corosync-objctl.c
-	-splint $(LINT_FLAGS) $(CFLAGS) corosync-cfgtool.c
-	-splint $(LINT_FLAGS) $(CFLAGS) corosync-keygen.c
-	-splint $(LINT_FLAGS) $(CFLAGS) corosync-fplay.c
-	-splint $(LINT_FLAGS) $(CFLAGS) corosync-pload.c
-
-%.o: %.c
-	$(CC) $(CFLAGS) $(CPPFLAGS) $(EXTRA_CFLAGS) -c -o $@ $<
 
-depend:
-	makedepend -Y -- $(CFLAGS) $(CPPFLAGS) $(APPS_SRC) > /dev/null 2>&1

+ 517 - 66
test/Makefile

@@ -1,8 +1,25 @@
-# Copyright (c) 2002-2004 MontaVista Software, Inc.
-# Copyright (c) 2006-2008 Red Hat, Inc.
-# 
-# All rights reserved.
+# Makefile.in generated by automake 1.10.1 from Makefile.am.
+# test/Makefile.  Generated from Makefile.in by configure.
+
+# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
+# 2003, 2004, 2005, 2006, 2007, 2008  Free Software Foundation, Inc.
+# This Makefile.in is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
+# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+# PARTICULAR PURPOSE.
+
+
+
+#
+# Copyright (c) 2009 Red Hat, Inc.
 # 
+# Authors: Andrew Beekhof
+#	   Steven Dake (sdake@redhat.com)
+#
 # This software licensed under BSD license, the text of which follows:
 # 
 # Redistribution and use in source and binary forms, with or without
@@ -29,94 +46,528 @@
 # ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
 # THE POSSIBILITY OF SUCH DAMAGE.
 
-# Include configuration
-#
-srcdir ?= $(CURDIR)/../
-subdir ?= test/
 
-include $(srcdir)Makefile.inc
+pkgdatadir = $(datadir)/corosync
+pkglibdir = $(libdir)/corosync
+pkgincludedir = $(includedir)/corosync
+am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
+install_sh_DATA = $(install_sh) -c -m 644
+install_sh_PROGRAM = $(install_sh) -c
+install_sh_SCRIPT = $(install_sh) -c
+INSTALL_HEADER = $(INSTALL_DATA)
+transform = $(program_transform_name)
+NORMAL_INSTALL = :
+PRE_INSTALL = :
+POST_INSTALL = :
+NORMAL_UNINSTALL = :
+PRE_UNINSTALL = :
+POST_UNINSTALL = :
+build_triplet = i686-pc-linux-gnu
+host_triplet = i686-pc-linux-gnu
+noinst_PROGRAMS = testevs$(EXEEXT) evsbench$(EXEEXT) \
+	evsverify$(EXEEXT) testcpg$(EXEEXT) testcpg2$(EXEEXT) \
+	cpgbench$(EXEEXT) testconfdb$(EXEEXT) logsysbench$(EXEEXT) \
+	logsysrec$(EXEEXT) testquorum$(EXEEXT) \
+	testvotequorum1$(EXEEXT) testvotequorum2$(EXEEXT)
+subdir = test
+DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in
+ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
+am__aclocal_m4_deps = $(top_srcdir)/configure.in
+am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
+	$(ACLOCAL_M4)
+mkinstalldirs = $(install_sh) -d
+CONFIG_HEADER = $(top_builddir)/include/corosync/config.h \
+	$(top_builddir)/include/corosync/cs_config.h
+CONFIG_CLEAN_FILES =
+PROGRAMS = $(noinst_PROGRAMS)
+cpgbench_SOURCES = cpgbench.c
+cpgbench_OBJECTS = cpgbench.$(OBJEXT)
+cpgbench_DEPENDENCIES =
+cpgbench_LINK = $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(cpgbench_LDFLAGS) \
+	$(LDFLAGS) -o $@
+evsbench_SOURCES = evsbench.c
+evsbench_OBJECTS = evsbench.$(OBJEXT)
+evsbench_DEPENDENCIES =
+evsbench_LINK = $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(evsbench_LDFLAGS) \
+	$(LDFLAGS) -o $@
+evsverify_SOURCES = evsverify.c
+evsverify_OBJECTS = evsverify.$(OBJEXT)
+evsverify_DEPENDENCIES =
+evsverify_LINK = $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(evsverify_LDFLAGS) \
+	$(LDFLAGS) -o $@
+logsysbench_SOURCES = logsysbench.c
+logsysbench_OBJECTS = logsysbench.$(OBJEXT)
+logsysbench_DEPENDENCIES =
+logsysbench_LINK = $(CCLD) $(AM_CFLAGS) $(CFLAGS) \
+	$(logsysbench_LDFLAGS) $(LDFLAGS) -o $@
+logsysrec_SOURCES = logsysrec.c
+logsysrec_OBJECTS = logsysrec.$(OBJEXT)
+logsysrec_DEPENDENCIES =
+logsysrec_LINK = $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(logsysrec_LDFLAGS) \
+	$(LDFLAGS) -o $@
+testconfdb_SOURCES = testconfdb.c
+testconfdb_OBJECTS = testconfdb.$(OBJEXT)
+testconfdb_DEPENDENCIES = ../lcr/liblcr.a
+testconfdb_LINK = $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(testconfdb_LDFLAGS) \
+	$(LDFLAGS) -o $@
+testcpg_SOURCES = testcpg.c
+testcpg_OBJECTS = testcpg.$(OBJEXT)
+testcpg_DEPENDENCIES =
+testcpg_LINK = $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(testcpg_LDFLAGS) \
+	$(LDFLAGS) -o $@
+testcpg2_SOURCES = testcpg2.c
+testcpg2_OBJECTS = testcpg2.$(OBJEXT)
+testcpg2_DEPENDENCIES =
+testcpg2_LINK = $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(testcpg2_LDFLAGS) \
+	$(LDFLAGS) -o $@
+testevs_SOURCES = testevs.c
+testevs_OBJECTS = testevs.$(OBJEXT)
+testevs_DEPENDENCIES =
+testevs_LINK = $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(testevs_LDFLAGS) \
+	$(LDFLAGS) -o $@
+testquorum_SOURCES = testquorum.c
+testquorum_OBJECTS = testquorum.$(OBJEXT)
+testquorum_DEPENDENCIES =
+testquorum_LINK = $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(testquorum_LDFLAGS) \
+	$(LDFLAGS) -o $@
+testvotequorum1_SOURCES = testvotequorum1.c
+testvotequorum1_OBJECTS = testvotequorum1.$(OBJEXT)
+testvotequorum1_DEPENDENCIES =
+testvotequorum1_LINK = $(CCLD) $(AM_CFLAGS) $(CFLAGS) \
+	$(testvotequorum1_LDFLAGS) $(LDFLAGS) -o $@
+testvotequorum2_SOURCES = testvotequorum2.c
+testvotequorum2_OBJECTS = testvotequorum2.$(OBJEXT)
+testvotequorum2_DEPENDENCIES =
+testvotequorum2_LINK = $(CCLD) $(AM_CFLAGS) $(CFLAGS) \
+	$(testvotequorum2_LDFLAGS) $(LDFLAGS) -o $@
+DEFAULT_INCLUDES = -I. -I$(top_builddir)/include/corosync
+depcomp = $(SHELL) $(top_srcdir)/depcomp
+am__depfiles_maybe = depfiles
+COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \
+	$(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
+CCLD = $(CC)
+LINK = $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@
+SOURCES = cpgbench.c evsbench.c evsverify.c logsysbench.c logsysrec.c \
+	testconfdb.c testcpg.c testcpg2.c testevs.c testquorum.c \
+	testvotequorum1.c testvotequorum2.c
+DIST_SOURCES = cpgbench.c evsbench.c evsverify.c logsysbench.c \
+	logsysrec.c testconfdb.c testcpg.c testcpg2.c testevs.c \
+	testquorum.c testvotequorum1.c testvotequorum2.c
+ETAGS = etags
+CTAGS = ctags
+DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
+ACLOCAL = ${SHELL} /home/sdake/corosync-automake/missing --run aclocal-1.10
+AMTAR = ${SHELL} /home/sdake/corosync-automake/missing --run tar
+AUTOCONF = ${SHELL} /home/sdake/corosync-automake/missing --run autoconf
+AUTOHEADER = ${SHELL} /home/sdake/corosync-automake/missing --run autoheader
+AUTOMAKE = ${SHELL} /home/sdake/corosync-automake/missing --run automake-1.10
+AWK = mawk
+CC = gcc -std=gnu99
+CCDEPMODE = depmode=gcc3
+CFLAGS = -g -O2 -ggdb3  -Wall -Wmissing-prototypes -Wmissing-declarations -Wstrict-prototypes -Wdeclaration-after-statement -Wpointer-arith -Wwrite-strings -Wcast-qual -Wcast-align -Wbad-function-cast -Wmissing-format-attribute -Wformat=2 -Wformat-security -Wformat-nonliteral -Wno-long-long -Wno-strict-aliasing  
+CFLAGS_COPY = -g -O2 -ggdb3  -Wall -Wmissing-prototypes -Wmissing-declarations -Wstrict-prototypes -Wdeclaration-after-statement -Wpointer-arith -Wwrite-strings -Wcast-qual -Wcast-align -Wbad-function-cast -Wmissing-format-attribute -Wformat=2 -Wformat-security -Wformat-nonliteral -Wno-long-long -Wno-strict-aliasing  
+CPP = gcc -std=gnu99 -E
+CPPFLAGS = 
+CYGPATH_W = echo
+DEFS = -DHAVE_CONFIG_H
+DEPDIR = .deps
+DYFLAGS =  -rdynamic
+ECHO_C = 
+ECHO_N = -n
+ECHO_T = 
+EGREP = /bin/grep -E
+EXEEXT = 
+GREP = /bin/grep
+INSTALL = /usr/bin/install -c
+INSTALL_DATA = ${INSTALL} -m 644
+INSTALL_PROGRAM = ${INSTALL}
+INSTALL_SCRIPT = ${INSTALL}
+INSTALL_STRIP_PROGRAM = $(install_sh) -c -s
+LCRSODIR = /usr/libexec/corosync/lcrso
+LDFLAGS = 
+LIBOBJS = 
+LIBS = -lpthread -lrt -ldl 
+LINT_FLAGS = -weak -unrecog +posixlib +ignoresigns -fcnuse -badflag -D__gnuc_va_list=va_list -D__attribute\(x\)=
+LOCALE = 
+LTLIBOBJS = 
+MAKE = make
+MAKEINFO = ${SHELL} /home/sdake/corosync-automake/missing --run makeinfo
+MKDIR_P = /bin/mkdir -p
+NON_FATAL_CFLAGS = -g -O2 -ggdb3  -Wall -Wmissing-prototypes -Wmissing-declarations -Wstrict-prototypes -Wdeclaration-after-statement -Wpointer-arith -Wwrite-strings -Wcast-qual -Wcast-align -Wbad-function-cast -Wmissing-format-attribute -Wformat=2 -Wformat-security -Wformat-nonliteral -Wno-long-long -Wno-strict-aliasing
+OBJEXT = o
+PACKAGE = corosync
+PACKAGE_BUGREPORT = 
+PACKAGE_NAME = 
+PACKAGE_STRING = 
+PACKAGE_TARNAME = 
+PACKAGE_VERSION = 
+PATH_SEPARATOR = :
+PKGCONFIG = /usr/bin/pkg-config
+PKG_NAME = corosync
+RANLIB = ranlib
+SET_MAKE = 
+SHELL = /bin/bash
+SSH = /usr/bin/ssh
+STRIP = 
+VERSION = 1.0.0
+abs_builddir = /home/sdake/corosync-automake/test
+abs_srcdir = /home/sdake/corosync-automake/test
+abs_top_builddir = /home/sdake/corosync-automake
+abs_top_srcdir = /home/sdake/corosync-automake
+ac_ct_CC = gcc
+am__include = include
+am__leading_dot = .
+am__quote = 
+am__tar = ${AMTAR} chof - "$$tardir"
+am__untar = ${AMTAR} xf -
+bindir = /usr/bin
+build = i686-pc-linux-gnu
+build_alias = 
+build_cpu = i686
+build_os = linux-gnu
+build_vendor = pc
+builddir = .
+datadir = /usr/share
+datarootdir = ${prefix}/share
+docdir = /usr/share/doc/corosync
+dvidir = ${docdir}
+exec_prefix = /usr
+host = i686-pc-linux-gnu
+host_alias = 
+host_cpu = i686
+host_os = linux-gnu
+host_vendor = pc
+htmldir = ${docdir}
+includedir = /usr/include
+infodir = /usr/share/info
+install_sh = $(SHELL) /home/sdake/corosync-automake/install-sh
+libdir = /usr/lib
+libexecdir = /usr/libexec
+localedir = ${datarootdir}/locale
+localstatedir = /usr/var
+mandir = /usr/share/man
+mkdir_p = /bin/mkdir -p
+oldincludedir = /usr/include
+pdfdir = ${docdir}
+prefix = /usr
+program_transform_name = s,x,x,
+psdir = ${docdir}
+sbindir = /usr/sbin
+sharedstatedir = /usr/com
+srcdir = .
+sysconfdir = /usr/etc
+target_alias = 
+top_builddir = ..
+top_srcdir = ..
+MAINTAINERCLEANFILES = Makefile.in
+INCLUDES = -I$(top_builddir)/include  -I$(top_srcdir)/include
+testevs_LDADD = -levs
+testevs_LDFLAGS = -L../lib
+testcpg_LDADD = -lcpg
+testcpg_LDFLAGS = -L../lib
+testcpg2_LDADD = -lcpg
+testcpg2_LDFLAGS = -L../lib
+testconfdb_LDADD = -lconfdb ../lcr/liblcr.a
+testconfdb_LDFLAGS = -L../lib
+testquorum_LDADD = -lquorum
+testquorum_LDFLAGS = -L../lib
+testvotequorum1_LDADD = -lvotequorum
+testvotequorum1_LDFLAGS = -L../lib
+testvotequorum2_LDADD = -lvotequorum
+testvotequorum2_LDFLAGS = -L../lib
+evsverify_LDADD = -levs -ltotem_pg
+evsverify_LDFLAGS = -L../lib -L../exec
+evsbench_LDADD = -levs
+evsbench_LDFLAGS = -L../lib
+cpgbench_LDADD = -lcpg
+cpgbench_LDFLAGS = -L../lib
+logsysbench_LDADD = -llogsys
+logsysbench_LDFLAGS = -L../exec
+logsysrec_LDADD = -llogsys
+logsysrec_LDFLAGS = -L../exec
+all: all-am
+
+.SUFFIXES:
+.SUFFIXES: .c .o .obj
+$(srcdir)/Makefile.in:  $(srcdir)/Makefile.am  $(am__configure_deps)
+	@for dep in $?; do \
+	  case '$(am__configure_deps)' in \
+	    *$$dep*) \
+	      cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \
+		&& exit 0; \
+	      exit 1;; \
+	  esac; \
+	done; \
+	echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu  test/Makefile'; \
+	cd $(top_srcdir) && \
+	  $(AUTOMAKE) --gnu  test/Makefile
+.PRECIOUS: Makefile
+Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
+	@case '$?' in \
+	  *config.status*) \
+	    cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
+	  *) \
+	    echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
+	    cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
+	esac;
+
+$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
+	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+
+$(top_srcdir)/configure:  $(am__configure_deps)
+	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+$(ACLOCAL_M4):  $(am__aclocal_m4_deps)
+	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+
+clean-noinstPROGRAMS:
+	-test -z "$(noinst_PROGRAMS)" || rm -f $(noinst_PROGRAMS)
+cpgbench$(EXEEXT): $(cpgbench_OBJECTS) $(cpgbench_DEPENDENCIES) 
+	@rm -f cpgbench$(EXEEXT)
+	$(cpgbench_LINK) $(cpgbench_OBJECTS) $(cpgbench_LDADD) $(LIBS)
+evsbench$(EXEEXT): $(evsbench_OBJECTS) $(evsbench_DEPENDENCIES) 
+	@rm -f evsbench$(EXEEXT)
+	$(evsbench_LINK) $(evsbench_OBJECTS) $(evsbench_LDADD) $(LIBS)
+evsverify$(EXEEXT): $(evsverify_OBJECTS) $(evsverify_DEPENDENCIES) 
+	@rm -f evsverify$(EXEEXT)
+	$(evsverify_LINK) $(evsverify_OBJECTS) $(evsverify_LDADD) $(LIBS)
+logsysbench$(EXEEXT): $(logsysbench_OBJECTS) $(logsysbench_DEPENDENCIES) 
+	@rm -f logsysbench$(EXEEXT)
+	$(logsysbench_LINK) $(logsysbench_OBJECTS) $(logsysbench_LDADD) $(LIBS)
+logsysrec$(EXEEXT): $(logsysrec_OBJECTS) $(logsysrec_DEPENDENCIES) 
+	@rm -f logsysrec$(EXEEXT)
+	$(logsysrec_LINK) $(logsysrec_OBJECTS) $(logsysrec_LDADD) $(LIBS)
+testconfdb$(EXEEXT): $(testconfdb_OBJECTS) $(testconfdb_DEPENDENCIES) 
+	@rm -f testconfdb$(EXEEXT)
+	$(testconfdb_LINK) $(testconfdb_OBJECTS) $(testconfdb_LDADD) $(LIBS)
+testcpg$(EXEEXT): $(testcpg_OBJECTS) $(testcpg_DEPENDENCIES) 
+	@rm -f testcpg$(EXEEXT)
+	$(testcpg_LINK) $(testcpg_OBJECTS) $(testcpg_LDADD) $(LIBS)
+testcpg2$(EXEEXT): $(testcpg2_OBJECTS) $(testcpg2_DEPENDENCIES) 
+	@rm -f testcpg2$(EXEEXT)
+	$(testcpg2_LINK) $(testcpg2_OBJECTS) $(testcpg2_LDADD) $(LIBS)
+testevs$(EXEEXT): $(testevs_OBJECTS) $(testevs_DEPENDENCIES) 
+	@rm -f testevs$(EXEEXT)
+	$(testevs_LINK) $(testevs_OBJECTS) $(testevs_LDADD) $(LIBS)
+testquorum$(EXEEXT): $(testquorum_OBJECTS) $(testquorum_DEPENDENCIES) 
+	@rm -f testquorum$(EXEEXT)
+	$(testquorum_LINK) $(testquorum_OBJECTS) $(testquorum_LDADD) $(LIBS)
+testvotequorum1$(EXEEXT): $(testvotequorum1_OBJECTS) $(testvotequorum1_DEPENDENCIES) 
+	@rm -f testvotequorum1$(EXEEXT)
+	$(testvotequorum1_LINK) $(testvotequorum1_OBJECTS) $(testvotequorum1_LDADD) $(LIBS)
+testvotequorum2$(EXEEXT): $(testvotequorum2_OBJECTS) $(testvotequorum2_DEPENDENCIES) 
+	@rm -f testvotequorum2$(EXEEXT)
+	$(testvotequorum2_LINK) $(testvotequorum2_OBJECTS) $(testvotequorum2_LDADD) $(LIBS)
+
+mostlyclean-compile:
+	-rm -f *.$(OBJEXT)
+
+distclean-compile:
+	-rm -f *.tab.c
+
+include ./$(DEPDIR)/cpgbench.Po
+include ./$(DEPDIR)/evsbench.Po
+include ./$(DEPDIR)/evsverify.Po
+include ./$(DEPDIR)/logsysbench.Po
+include ./$(DEPDIR)/logsysrec.Po
+include ./$(DEPDIR)/testconfdb.Po
+include ./$(DEPDIR)/testcpg.Po
+include ./$(DEPDIR)/testcpg2.Po
+include ./$(DEPDIR)/testevs.Po
+include ./$(DEPDIR)/testquorum.Po
+include ./$(DEPDIR)/testvotequorum1.Po
+include ./$(DEPDIR)/testvotequorum2.Po
+
+.c.o:
+	$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
+	mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
+#	source='$<' object='$@' libtool=no \
+#	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) \
+#	$(COMPILE) -c $<
+
+.c.obj:
+	$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'`
+	mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
+#	source='$<' object='$@' libtool=no \
+#	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) \
+#	$(COMPILE) -c `$(CYGPATH_W) '$<'`
+
+ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
+	list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
+	unique=`for i in $$list; do \
+	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+	  done | \
+	  $(AWK) '{ files[$$0] = 1; nonemtpy = 1; } \
+	      END { if (nonempty) { for (i in files) print i; }; }'`; \
+	mkid -fID $$unique
+tags: TAGS
+
+TAGS:  $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
+		$(TAGS_FILES) $(LISP)
+	tags=; \
+	here=`pwd`; \
+	list='$(SOURCES) $(HEADERS)  $(LISP) $(TAGS_FILES)'; \
+	unique=`for i in $$list; do \
+	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+	  done | \
+	  $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
+	      END { if (nonempty) { for (i in files) print i; }; }'`; \
+	if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \
+	  test -n "$$unique" || unique=$$empty_fix; \
+	  $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
+	    $$tags $$unique; \
+	fi
+ctags: CTAGS
+CTAGS:  $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
+		$(TAGS_FILES) $(LISP)
+	tags=; \
+	list='$(SOURCES) $(HEADERS)  $(LISP) $(TAGS_FILES)'; \
+	unique=`for i in $$list; do \
+	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+	  done | \
+	  $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
+	      END { if (nonempty) { for (i in files) print i; }; }'`; \
+	test -z "$(CTAGS_ARGS)$$tags$$unique" \
+	  || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
+	     $$tags $$unique
+
+GTAGS:
+	here=`$(am__cd) $(top_builddir) && pwd` \
+	  && cd $(top_srcdir) \
+	  && gtags -i $(GTAGS_ARGS) $$here
+
+distclean-tags:
+	-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
+
+distdir: $(DISTFILES)
+	@srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
+	topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
+	list='$(DISTFILES)'; \
+	  dist_files=`for file in $$list; do echo $$file; done | \
+	  sed -e "s|^$$srcdirstrip/||;t" \
+	      -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \
+	case $$dist_files in \
+	  */*) $(MKDIR_P) `echo "$$dist_files" | \
+			   sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \
+			   sort -u` ;; \
+	esac; \
+	for file in $$dist_files; do \
+	  if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
+	  if test -d $$d/$$file; then \
+	    dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \
+	    if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
+	      cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \
+	    fi; \
+	    cp -pR $$d/$$file $(distdir)$$dir || exit 1; \
+	  else \
+	    test -f $(distdir)/$$file \
+	    || cp -p $$d/$$file $(distdir)/$$file \
+	    || exit 1; \
+	  fi; \
+	done
+check-am: all-am
+check: check-am
+all-am: Makefile $(PROGRAMS)
+installdirs:
+install: install-am
+install-exec: install-exec-am
+install-data: install-data-am
+uninstall: uninstall-am
+
+install-am: all-am
+	@$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
+
+installcheck: installcheck-am
+install-strip:
+	$(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+	  install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+	  `test -z '$(STRIP)' || \
+	    echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
+mostlyclean-generic:
+
+clean-generic:
+
+distclean-generic:
+	-test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
+
+maintainer-clean-generic:
+	@echo "This command is intended for maintainers to use"
+	@echo "it deletes files that may require special tools to rebuild."
+	-test -z "$(MAINTAINERCLEANFILES)" || rm -f $(MAINTAINERCLEANFILES)
+clean: clean-am
 
-override LDFLAGS += -L./ ${DYFLAGS}
+clean-am: clean-generic clean-noinstPROGRAMS mostlyclean-am
 
-ifeq (${COROSYNC_COMPAT}, SOLARIS)
-	override LDFLAGS += -lnsl -lsocket -lrt
-endif
+distclean: distclean-am
+	-rm -rf ./$(DEPDIR)
+	-rm -f Makefile
+distclean-am: clean-am distclean-compile distclean-generic \
+	distclean-tags
 
-LIBRARIES= ../lib/libevs.a ../lib/libcpg.a ../lib/libcfg.a ../lib/libconfdb.a ../lib/libquorum.a ../lib/libvotequorum.a
-LIBS = $(LIBRARIES) 
-BINARIES= testevs evsbench evsverify testcpg testcpg2 cpgbench testconfdb logsysbench logsysrec testquorum \
-	testvotequorum1 testvotequorum2
+dvi: dvi-am
 
-override CFLAGS += -I../include
-override LDFLAGS += -L../lib
+dvi-am:
 
-EXTRA_CFLAGS = -I$(srcdir)include
-TEST_SRC = sa_error.c logsys_s1.c logsys_s2.c logsys_s.c logsys_t1.c logsys_t2.c
+html: html-am
 
-all: $(BINARIES)
+info: info-am
 
-testtimer: testtimer.o $(LIBRARIES)
-	$(CC) $(LDFLAGS) -o testtimer testtimer.o ../exec/timer.o
+info-am:
 
-testevs: testevs.o $(LIBS)
-	$(CC) $(LDFLAGS) -o testevs testevs.o $(LIBS)
+install-data-am:
 
-testevsth: testevsth.o $(LIBS)
-	$(CC) $(LDFLAGS) -o testevsth testevsth.o $(LIBS)
+install-dvi: install-dvi-am
 
-evsbench: evsbench.o $(LIBS)
-	$(CC) $(LDFLAGS) -o evsbench evsbench.o $(LIBS)
+install-exec-am:
 
-evsverify: evsverify.o $(LIBS) ../exec/crypto.o
-	$(CC) $(LDFLAGS) -o evsverify evsverify.o $(LIBS) ../exec/crypto.o
+install-html: install-html-am
 
-testcpg: testcpg.o $(LIBRARIES)
-	$(CC) $(LDFLAGS) -o testcpg testcpg.o $(LIBS)
+install-info: install-info-am
 
-testcpg2: testcpg2.o $(LIBRARIES)
-	$(CC) $(LDFLAGS) -o testcpg2 testcpg2.o $(LIBS)
+install-man:
 
-testquorum: testquorum.o $(LIBRARIES)
-	$(CC) $(LDFLAGS) -o testquorum testquorum.o $(LIBS)
+install-pdf: install-pdf-am
 
-cpgbench: cpgbench.o $(LIBRARIES)
-	$(CC) $(LDFLAGS) -o cpgbench cpgbench.o $(LIBS)
+install-ps: install-ps-am
 
-testconfdb: testconfdb.o $(LIBRARIES)
-	$(CC) $(LDFLAGS) -o testconfdb testconfdb.o $(LIBS) -rdynamic
+installcheck-am:
 
-logsysbench: logsysbench.o ../exec/liblogsys.a
-	$(CC) -o logsysbench logsysbench.o ../exec/liblogsys.a $(LDFLAGS)
+maintainer-clean: maintainer-clean-am
+	-rm -rf ./$(DEPDIR)
+	-rm -f Makefile
+maintainer-clean-am: distclean-am maintainer-clean-generic
 
-logsysrec: logsysrec.o ../exec/liblogsys.a
-	$(CC) -o logsysrec logsysrec.o ../exec/liblogsys.a $(LDFLAGS)
+mostlyclean: mostlyclean-am
 
-testquorum1: testquorum1.o $(LIBRARIES)
-	$(CC) $(LDFLAGS) -o testquorum1 testquorum1.o $(LIBS)
+mostlyclean-am: mostlyclean-compile mostlyclean-generic
 
-testquorum2: testquorum2.o $(LIBRARIES)
-	$(CC) $(LDFLAGS) -o testquorum2 testquorum2.o $(LIBS)
+pdf: pdf-am
 
-testvotequorum1: testvotequorum1.o $(LIBRARIES)
-	$(CC) $(LDFLAGS) -o testvotequorum1 testvotequorum1.o $(LIBS)
+pdf-am:
 
-testvotequorum2: testvotequorum2.o $(LIBRARIES)
-	$(CC) $(LDFLAGS) -o testvotequorum2 testvotequorum2.o $(LIBS)
+ps: ps-am
 
-logsys_s: logsys_s.o logsys_s1.o logsys_s2.o ../exec/liblogsys.a
-	$(CC) -o logsys_s logsys_s.o logsys_s1.o logsys_s2.o ../exec/liblogsys.a $(LDFLAGS)
+ps-am:
 
-logsys_t1: logsys_t1.o ../exec/liblogsys.a
-	$(CC) -o logsys_t1 logsys_t1.o ../exec/liblogsys.a $(LDFLAGS)
+uninstall-am:
 
-logsys_t2: logsys_t2.o ../exec/liblogsys.a
-	$(CC) -o logsys_t2 logsys_t2.o ../exec/liblogsys.a $(LDFLAGS)
+.MAKE: install-am install-strip
 
-clean:
-	rm -f *.o $(LIBRARIES) $(BINARIES)
+.PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \
+	clean-noinstPROGRAMS ctags distclean distclean-compile \
+	distclean-generic distclean-tags distdir dvi dvi-am html \
+	html-am info info-am install install-am install-data \
+	install-data-am install-dvi install-dvi-am install-exec \
+	install-exec-am install-html install-html-am install-info \
+	install-info-am install-man install-pdf install-pdf-am \
+	install-ps install-ps-am install-strip installcheck \
+	installcheck-am installdirs maintainer-clean \
+	maintainer-clean-generic mostlyclean mostlyclean-compile \
+	mostlyclean-generic pdf pdf-am ps ps-am tags uninstall \
+	uninstall-am
 
-%.o: %.c
-	$(CC) $(CFLAGS) $(CPPFLAGS) $(EXTRA_CFLAGS) -c -o $@ $<
 
-depend:
-	makedepend -Y -- $(CFLAGS) $(CPPFLAGS) $(TEST_SRC) > /dev/null 2>&1
+lint:
+	-splint $(LINT_FLAGS) $(CFLAGS) *.c
+# Tell versions [3.59,3.63) of GNU make to not export all variables.
+# Otherwise a system limit (for SysV at least) may be exceeded.
+.NOEXPORT:

+ 68 - 0
test/Makefile.am

@@ -0,0 +1,68 @@
+#
+# Copyright (c) 2009 Red Hat, Inc.
+# 
+# Authors: Andrew Beekhof
+#	   Steven Dake (sdake@redhat.com)
+#
+# This software licensed under BSD license, the text of which follows:
+# 
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions are met:
+# 
+# - Redistributions of source code must retain the above copyright notice,
+#   this list of conditions and the following disclaimer.
+# - Redistributions in binary form must reproduce the above copyright notice,
+#   this list of conditions and the following disclaimer in the documentation
+#   and/or other materials provided with the distribution.
+# - Neither the name of the MontaVista Software, Inc. nor the names of its
+#   contributors may be used to endorse or promote products derived from this
+#   software without specific prior written permission.
+#
+# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+# ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
+# LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+# THE POSSIBILITY OF SUCH DAMAGE.
+
+MAINTAINERCLEANFILES    = Makefile.in
+INCLUDES       		= -I$(top_builddir)/include  -I$(top_srcdir)/include
+
+noinst_PROGRAMS		= testevs evsbench evsverify testcpg testcpg2 cpgbench testconfdb	\
+			logsysbench logsysrec testquorum testvotequorum1 testvotequorum2
+
+testevs_LDADD		= -levs
+testevs_LDFLAGS		= -L../lib
+testcpg_LDADD		= -lcpg
+testcpg_LDFLAGS		= -L../lib
+testcpg2_LDADD		= -lcpg
+testcpg2_LDFLAGS	= -L../lib
+testconfdb_LDADD	= -lconfdb ../lcr/liblcr.a
+testconfdb_LDFLAGS	= -L../lib
+testquorum_LDADD	= -lquorum
+testquorum_LDFLAGS	= -L../lib
+testvotequorum1_LDADD	= -lvotequorum
+testvotequorum1_LDFLAGS	= -L../lib
+testvotequorum2_LDADD	= -lvotequorum
+testvotequorum2_LDFLAGS	= -L../lib
+evsverify_LDADD		= -levs -ltotem_pg
+evsverify_LDFLAGS	= -L../lib -L../exec
+evsbench_LDADD		= -levs
+evsbench_LDFLAGS	= -L../lib
+cpgbench_LDADD		= -lcpg
+cpgbench_LDFLAGS	= -L../lib
+logsysbench_LDADD	= -llogsys
+logsysbench_LDFLAGS	= -L../exec
+logsysrec_LDADD		= -llogsys
+logsysrec_LDFLAGS	= -L../exec
+
+lint:
+	-splint $(LINT_FLAGS) $(CFLAGS) *.c
+
+
+

+ 46 - 0
tools/Makefile.am

@@ -0,0 +1,46 @@
+# Copyright (c) 2009 Red Hat, Inc.
+# 
+# Authors: Andrew Beekhof
+#	   Steven Dake (sdake@redhat.com)
+#
+# This software licensed under BSD license, the text of which follows:
+# 
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions are met:
+# 
+# - Redistributions of source code must retain the above copyright notice,
+#   this list of conditions and the following disclaimer.
+# - Redistributions in binary form must reproduce the above copyright notice,
+#   this list of conditions and the following disclaimer in the documentation
+#   and/or other materials provided with the distribution.
+# - Neither the name of the MontaVista Software, Inc. nor the names of its
+#   contributors may be used to endorse or promote products derived from this
+#   software without specific prior written permission.
+#
+# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+# ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
+# LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+# THE POSSIBILITY OF SUCH DAMAGE.
+
+MAINTAINERCLEANFILES    = Makefile.in
+INCLUDES       		= -I$(top_builddir)/include  -I$(top_srcdir)/include
+
+noinst_PROGRAMS		= corosync-pload
+sbin_PROGRAMS		= corosync-fplay corosync-cfgtool corosync-keygen corosync-objctl 
+
+corosync_pload_LDADD	= ../lib/libpload.a
+corosync_objctl_LDADD	= ../lib/libconfdb.a ../lcr/liblcr.a 
+corosync_cfgtool_LDADD	= ../lib/libcfg.a
+
+lint:
+	-splint $(LINT_FLAGS) $(CFLAGS) *.c
+
+
+