[Sheepdog] [PATCH 5/6] modify Makefile.in and configure.in to support collie

MORITA Kazutaka morita.kazutaka at lab.ntt.co.jp
Tue Dec 1 19:35:22 CET 2009


To use collie, please install corosync.
A Java dog daemon is no longer supported by this script.

Signed-off-by: MORITA Kazutaka <morita.kazutaka at lab.ntt.co.jp>
---
 Makefile.in        |    9 +++------
 collie/Makefile.in |   31 +++++++++++++++++++++++++++++++
 configure.in       |   41 +++++++++++++----------------------------
 3 files changed, 47 insertions(+), 34 deletions(-)
 create mode 100644 collie/Makefile.in

diff --git a/Makefile.in b/Makefile.in
index 2d12375..de52b54 100644
--- a/Makefile.in
+++ b/Makefile.in
@@ -1,18 +1,15 @@
 .PHONY:all
 all:
 	cd shepherd; make
-	cd sheep; make
-	cd dog; make
+	cd collie; make
 
 .PHONY:clean
 clean:
 	cd shepherd; make clean
-	cd sheep; make clean
-	cd dog; make clean
+	cd collie; make clean
 	cd lib; make clean
 
 .PHONY:install
 install:
 	cd shepherd; make install
-	cd sheep; make install
-	cd dog; make install
+	cd collie; make install
diff --git a/collie/Makefile.in b/collie/Makefile.in
new file mode 100644
index 0000000..35e2e5b
--- /dev/null
+++ b/collie/Makefile.in
@@ -0,0 +1,31 @@
+CFLAGS += -g -O2 -Wall -Wstrict-prototypes -I../include
+CFLAGS += -D_GNU_SOURCE
+LIBS += -lpthread -lcrypto -lcpg
+
+PROGRAMS = collie
+COLLIE_OBJS = collie.o net.o vdi.o group.o store.o work.o ../lib/event.o ../lib/net.o ../lib/logger.o
+COLLIE_DEP = $(COLLIE_OBJS:.o=.d)
+
+prefix = @prefix@
+exec_prefix = @exec_prefix@
+bindir = @bindir@
+
+.PHONY:all
+all: $(PROGRAMS)
+
+collie: $(COLLIE_OBJS)
+	$(CC) $^ -o $@ $(LIBS)
+
+-include $(COLLIE_DEP)
+
+%.o: %.c
+	$(CC) -c $(CFLAGS) $*.c -o $*.o
+	@$(CC) -MM $(CFLAGS) -MF $*.d -MT $*.o $*.c
+
+.PHONY:clean
+clean:
+	rm -f *.[od] $(PROGRAMS)
+
+.PHONY:install
+install: $(PROGRAMS)
+	install $< $(bindir)
diff --git a/configure.in b/configure.in
index a16677b..47de86d 100644
--- a/configure.in
+++ b/configure.in
@@ -1,7 +1,7 @@
 #                                               -*- Autoconf -*-
 # Process this file with autoconf to produce a configure script.
 
-AC_PREREQ([2.64])
+AC_PREREQ([2.61])
 AC_INIT
 AC_CONFIG_SRCDIR([lib/net.c])
 
@@ -9,48 +9,30 @@ AC_CONFIG_SRCDIR([lib/net.c])
 AC_PROG_CC
 AC_PROG_INSTALL
 AC_PROG_MAKE_SET
-if test "$JAVA_HOME" = ""; then
-    JAVA_HOME=/usr/lib/jvm/java-6-sun
-fi
-AC_SUBST(JAVA_HOME, $JAVA_HOME)
-AC_CHECK_FILE($JAVA_HOME/bin/java, , AC_MSG_ERROR("install sun-java6-sdk and define JAVA_HOME to be the root of your Java installation"))
-AC_CHECK_FILE($JAVA_HOME/bin/javac, , AC_MSG_ERROR("install sun-java6-sdk and define JAVA_HOME to be the root of your Java installation"))
-AC_CHECK_FILE($JAVA_HOME/bin/jar, , AC_MSG_ERROR("install sun-java6-sdk and define JAVA_HOME to be the root of your Java installation"))
-if test "$JAVA_LIB" = ""; then
-    JAVA_LIB=/usr/share/java
-fi
-AC_SUBST(JAVA_LIB, $JAVA_LIB)
-AC_CHECK_FILE($JAVA_LIB/jgroups-all.jar, , AC_MSG_ERROR("install libjgroups-java and define JAVA_LIB to be the root of the installation"))
-AC_CHECK_FILE($JAVA_LIB/commons-daemon.jar, , AC_MSG_ERROR("install libcommons-daemon-java and define JAVA_LIB to be the root of the installation"))
-AC_CHECK_FILE($JAVA_LIB/commons-cli.jar, , AC_MSG_ERROR("install libcommons-cli-java and define JAVA_LIB to be the root of the installation"))
-AC_CHECK_FILE($JAVA_LIB/commons-logging.jar, , AC_MSG_ERROR("install libcommons-logging-java and define JAVA_LIB to be the root of the installation"))
-AC_CHECK_FILE($JAVA_LIB/log4j-1.2.jar, , AC_MSG_ERROR("install liblog4j1.2-java and define JAVA_LIB to be the root of the installation"))
-AC_CHECK_PROG(ANT, ant, ant, no)
-if test "$ANT" = no ; then
-   AC_MSG_ERROR(could not find ant)
-fi
-AC_CHECK_PROG(JSVC, jsvc, jsvc, no)
-if test "$JSVC" = no ; then
-   AC_MSG_ERROR(could not find jsvc)
-fi
 
 # Checks for libraries.
 AC_CHECK_LIB([crypto], [main], , AC_MSG_ERROR("could not find SSL development libraries"))
 AC_CHECK_LIB([ncurses], [main], , AC_MSG_ERROR("could not find ncurses libraries"))
 AC_CHECK_LIB([pthread], [main], , AC_MSG_ERROR("could not find pthread libraries"))
+AC_CHECK_LIB([cpg], [main], , AC_MSG_ERROR("could not find CPG library"))
 
 # Checks for header files.
+AC_HEADER_DIRENT
+AC_HEADER_SYS_WAIT
 AC_CHECK_HEADERS([arpa/inet.h fcntl.h inttypes.h mntent.h netdb.h netinet/in.h stdint.h stdlib.h string.h sys/ioctl.h sys/socket.h sys/statvfs.h sys/time.h syslog.h unistd.h])
 
 # Checks for archtecture. 
 AC_C_BIGENDIAN([AC_MSG_ERROR("big endian architecture is not supported")])
 
 # Checks for typedefs, structures, and compiler characteristics.
+AC_C_CONST
 AC_C_INLINE
 AC_TYPE_INT32_T
 AC_TYPE_INT64_T
 AC_TYPE_PID_T
 AC_TYPE_SIZE_T
+AC_HEADER_TIME
+AC_STRUCT_TM
 AC_TYPE_UINT16_T
 AC_TYPE_UINT32_T
 AC_TYPE_UINT64_T
@@ -60,11 +42,14 @@ AC_TYPE_UINT8_T
 AC_FUNC_FORK
 AC_FUNC_GETMNTENT
 AC_FUNC_MALLOC
-AC_CHECK_FUNCS([dup2 ftruncate getmntent localtime_r memset mkdir socket strcasecmp strchr strdup strerror strtoul])
+AC_FUNC_MEMCMP
+AC_FUNC_STAT
+AC_FUNC_STRFTIME
+AC_FUNC_VPRINTF
+AC_CHECK_FUNCS([dup2 ftruncate gethostname getmntent gettimeofday localtime_r memset mkdir socket strcasecmp strchr strdup strerror strtoul])
 
 AC_CONFIG_FILES([Makefile
-                 dog/Makefile
                  lib/Makefile
-                 sheep/Makefile
+                 collie/Makefile
                  shepherd/Makefile])
 AC_OUTPUT
-- 
1.5.6.5




More information about the sheepdog mailing list