From 906b0f62b9381b898fee516b9fb057e8dabea2ab Mon Sep 17 00:00:00 2001 From: Lon Hohberger Date: Tue, 15 Sep 2009 11:25:02 -0400 Subject: [PATCH] Initial port to autoconf Signed-off-by: Lon Hohberger --- Makefile => Makefile.in | 0 autogen.sh | 6 ++++ client/{Makefile => Makefile.in} | 0 common/{Makefile => Makefile.in} | 0 config/{Makefile => Makefile.in} | 14 ++++---- config/config.l | 2 +- configure.in | 59 ++++++++++++++++++++++++++++++++ server/{Makefile => Makefile.in} | 0 server/checkpoint.c | 5 ++- 9 files changed, 78 insertions(+), 8 deletions(-) rename Makefile => Makefile.in (100%) create mode 100755 autogen.sh rename client/{Makefile => Makefile.in} (100%) rename common/{Makefile => Makefile.in} (100%) rename config/{Makefile => Makefile.in} (89%) create mode 100644 configure.in rename server/{Makefile => Makefile.in} (100%) diff --git a/Makefile b/Makefile.in similarity index 100% rename from Makefile rename to Makefile.in diff --git a/autogen.sh b/autogen.sh new file mode 100755 index 0000000..3a03538 --- /dev/null +++ b/autogen.sh @@ -0,0 +1,6 @@ +#!/bin/bash + +aclocal +autoconf +autoheader +automake -a diff --git a/client/Makefile b/client/Makefile.in similarity index 100% rename from client/Makefile rename to client/Makefile.in diff --git a/common/Makefile b/common/Makefile.in similarity index 100% rename from common/Makefile rename to common/Makefile.in diff --git a/config/Makefile b/config/Makefile.in similarity index 89% rename from config/Makefile rename to config/Makefile.in index 52dff69..2997df5 100644 --- a/config/Makefile +++ b/config/Makefile.in @@ -9,12 +9,14 @@ ## ############################################################################### ############################################################################### - include ../Makefile.top +LEX=@LEX@ +YACC=@YACC@ + TARGETS=libsimpleconfig.a -libsimpleconfig_a_SOURCE= config.tab.c \ +libsimpleconfig_a_SOURCE= y.tab.c \ config.c simpleconfig.c INCLUDES=-I../include \ @@ -33,11 +35,11 @@ all: ${TARGETS} libsimpleconfig.a: ${libsimpleconfig_a_SOURCE:.c=.o} ar rc $@ $^ -config.tab.c config.tab.h: config.y - bison -d $^ +y.tab.c y.tab.h: config.y + $(YACC) -d $^ -config.c: config.tab.h config.l - flex -oconfig.c config.l +config.c: y.tab.h config.l + $(LEX) -oconfig.c config.l %.o: %.c gcc $(CFLAGS) -c -o $@ $^ $(INCLUDES) diff --git a/config/config.l b/config/config.l index 38d8890..dac305d 100644 --- a/config/config.l +++ b/config/config.l @@ -4,7 +4,7 @@ #include #include #include "config-stack.h" -#include "config.tab.h" +#include "y.tab.h" #include "simpleconfig.h" struct value *val_list = NULL; diff --git a/configure.in b/configure.in new file mode 100644 index 0000000..5c99e4e --- /dev/null +++ b/configure.in @@ -0,0 +1,59 @@ +# -*- Autoconf -*- +# Process this file with autoconf to produce a configure script. + +AC_PREREQ(2.59) +AC_INIT(fence_virt, 0.1, lon@metamorphism.com) +AC_CONFIG_SRCDIR([server/main.c]) +AC_CONFIG_HEADER([include/config.h]) + +# Checks for programs. +AC_PROG_YACC +AC_PROG_CC +AC_PROG_LEX +AC_PROG_INSTALL +AC_PROG_LN_S +AC_PROG_MAKE_SET + +# Checks for libraries. +# FIXME: Replace `main' with a function in `-lSaCkpt': +AC_CHECK_LIB([SaCkpt], [saCkptCheckpointOpen]) +# FIXME: Replace `main' with a function in `-lccs': +AC_CHECK_LIB([ccs], [ccs_get]) +# FIXME: Replace `main' with a function in `-lnss3': +AC_CHECK_LIB([nss3], [NSS_NoDB_Init]) +# FIXME: Replace `main' with a function in `-lpthread': +AC_CHECK_LIB([pthread], [pthread_create]) +# FIXME: Replace `main' with a function in `-lvirt': +AC_CHECK_LIB([virt], [virConnectOpen]) +# FIXME: Replace `main' with a function in `-lxml2': +AC_CHECK_LIB([xml2], [main]) + +# Checks for header files. +AC_HEADER_DIRENT +AC_HEADER_STDC +AC_HEADER_SYS_WAIT +AC_CHECK_HEADERS([arpa/inet.h fcntl.h malloc.h netdb.h netinet/in.h stdint.h stdlib.h string.h sys/ioctl.h sys/socket.h sys/time.h syslog.h termios.h unistd.h openais/cpg.h corosync/cpg.h]) + +# Checks for typedefs, structures, and compiler characteristics. +AC_C_CONST +AC_C_INLINE +AC_TYPE_OFF_T +AC_TYPE_SIZE_T +AC_HEADER_TIME + +# Checks for library functions. +AC_FUNC_CLOSEDIR_VOID +AC_PROG_GCC_TRADITIONAL +AC_FUNC_MALLOC +AC_FUNC_MEMCMP +AC_FUNC_SELECT_ARGTYPES +AC_TYPE_SIGNAL +AC_FUNC_STAT +AC_CHECK_FUNCS([gettimeofday memmove memset select socket strcasecmp strchr strdup strerror]) + +AC_CONFIG_FILES([Makefile + client/Makefile + common/Makefile + config/Makefile + server/Makefile]) +AC_OUTPUT diff --git a/server/Makefile b/server/Makefile.in similarity index 100% rename from server/Makefile rename to server/Makefile.in diff --git a/server/checkpoint.c b/server/checkpoint.c index a8d471f..6f4c115 100644 --- a/server/checkpoint.c +++ b/server/checkpoint.c @@ -19,6 +19,7 @@ /* * Author: Lon Hohberger */ +#include #include #include #include @@ -29,11 +30,13 @@ #include #include #include -#ifdef OPENAIS +#ifdef HAVE_OPENAIS_CPG_H #include #else +#ifdef HAVE_COROSYNC_CPG_H #include #endif +#endif #define NAME "checkpoint"