From 0ab3085f89e64eecd67d3179ea87f0463e918a10 Mon Sep 17 00:00:00 2001 From: Florian Forster Date: Wed, 16 Jun 2010 17:13:28 +0200 Subject: [PATCH] Autotoolization. --- AUTHORS | 0 ChangeLog | 0 Makefile | 54 ------------------- Makefile.am | 1 + NEWS | 0 README | 0 configure.ac | 33 ++++++++++++ src/Makefile.am | 25 +++++++++ action_graph.c => src/action_graph.c | 0 action_graph.h => src/action_graph.h | 0 .../action_list_graphs.c | 0 .../action_list_graphs.h | 0 aux_types.h => src/aux_types.h | 0 common.c => src/common.c | 0 common.h => src/common.h | 0 filesystem.c => src/filesystem.c | 0 filesystem.h => src/filesystem.h | 0 graph.c => src/graph.c | 0 graph.h => src/graph.h | 0 graph_config.c => src/graph_config.c | 0 graph_config.h => src/graph_config.h | 0 graph_def.c => src/graph_def.c | 0 graph_def.h => src/graph_def.h | 0 graph_ident.c => src/graph_ident.c | 0 graph_ident.h => src/graph_ident.h | 0 graph_instance.c => src/graph_instance.c | 0 graph_instance.h => src/graph_instance.h | 0 graph_list.c => src/graph_list.c | 0 graph_list.h => src/graph_list.h | 0 test.fcgi.c => src/main.c | 0 oconfig.c => src/oconfig.c | 1 + oconfig.h => src/oconfig.h | 0 parser.y => src/parser.y | 0 scanner.l => src/scanner.l | 0 utils_array.c => src/utils_array.c | 0 utils_array.h => src/utils_array.h | 0 utils_params.c => src/utils_params.c | 0 utils_params.h => src/utils_params.h | 0 38 files changed, 60 insertions(+), 54 deletions(-) create mode 100644 AUTHORS create mode 100644 ChangeLog delete mode 100644 Makefile create mode 100644 Makefile.am create mode 100644 NEWS create mode 100644 README create mode 100644 configure.ac create mode 100644 src/Makefile.am rename action_graph.c => src/action_graph.c (100%) rename action_graph.h => src/action_graph.h (100%) rename action_list_graphs.c => src/action_list_graphs.c (100%) rename action_list_graphs.h => src/action_list_graphs.h (100%) rename aux_types.h => src/aux_types.h (100%) rename common.c => src/common.c (100%) rename common.h => src/common.h (100%) rename filesystem.c => src/filesystem.c (100%) rename filesystem.h => src/filesystem.h (100%) rename graph.c => src/graph.c (100%) rename graph.h => src/graph.h (100%) rename graph_config.c => src/graph_config.c (100%) rename graph_config.h => src/graph_config.h (100%) rename graph_def.c => src/graph_def.c (100%) rename graph_def.h => src/graph_def.h (100%) rename graph_ident.c => src/graph_ident.c (100%) rename graph_ident.h => src/graph_ident.h (100%) rename graph_instance.c => src/graph_instance.c (100%) rename graph_instance.h => src/graph_instance.h (100%) rename graph_list.c => src/graph_list.c (100%) rename graph_list.h => src/graph_list.h (100%) rename test.fcgi.c => src/main.c (100%) rename oconfig.c => src/oconfig.c (99%) rename oconfig.h => src/oconfig.h (100%) rename parser.y => src/parser.y (100%) rename scanner.l => src/scanner.l (100%) rename utils_array.c => src/utils_array.c (100%) rename utils_array.h => src/utils_array.h (100%) rename utils_params.c => src/utils_params.c (100%) rename utils_params.h => src/utils_params.h (100%) diff --git a/AUTHORS b/AUTHORS new file mode 100644 index 0000000..e69de29 diff --git a/ChangeLog b/ChangeLog new file mode 100644 index 0000000..e69de29 diff --git a/Makefile b/Makefile deleted file mode 100644 index 356ae57..0000000 --- a/Makefile +++ /dev/null @@ -1,54 +0,0 @@ -CC = gcc -CPPFLAGS = -CFLAGS = -Wall -Wextra -O0 -g -LDFLAGS = -LDLIBS = - -all: test.fcgi - -clean: - rm -f test.cgi - -common.o: common.c common.h - -filesystem.o: filesystem.c filesystem.h - -graph.o: graph.c graph.h - -graph_config.o: graph_config.c graph_config.h - -graph_def.o: graph_def.c graph_def.h - -graph_ident.o: graph_ident.c graph_ident.h - -graph_instance.o: graph_instance.c graph_instance.h - -graph_list.o: graph_list.c graph_list.h - -utils_array.o: utils_array.c utils_array.h - -utils_params.o: utils_params.c utils_params.h - -action_graph.o: action_graph.c action_graph.h - -action_list_graphs.o: action_list_graphs.c action_list_graphs.h - -oconfig.o: oconfig.c oconfig.h - -scanner.c: scanner.l - flex --outfile=scanner.c scanner.l - -scanner.o: scanner.c parser.h - -parser.c parser.h: parser.y - bison --output=parser.c --defines=parser.h parser.y - -parser.o: parser.c - -test: test.c utils_params.o - -test.fcgi: LDLIBS = -lfcgi -lrrd -test.fcgi: test.fcgi.c common.o filesystem.o graph.o graph_config.o graph_def.o graph_ident.o graph_instance.o graph_list.o utils_array.o utils_params.o action_graph.o action_list_graphs.o scanner.o parser.o oconfig.o - -.PHONY: clean - diff --git a/Makefile.am b/Makefile.am new file mode 100644 index 0000000..af437a6 --- /dev/null +++ b/Makefile.am @@ -0,0 +1 @@ +SUBDIRS = src diff --git a/NEWS b/NEWS new file mode 100644 index 0000000..e69de29 diff --git a/README b/README new file mode 100644 index 0000000..e69de29 diff --git a/configure.ac b/configure.ac new file mode 100644 index 0000000..9c8b628 --- /dev/null +++ b/configure.ac @@ -0,0 +1,33 @@ +AC_INIT(collection, 4.0.0) +AC_CONFIG_SRCDIR(src/main.c) +AC_CONFIG_HEADERS(src/config.h) +AM_INIT_AUTOMAKE(dist-bzip2) +AC_LANG(C) + +AC_PREFIX_DEFAULT("/opt/collection4") + +# +# Check for programs/utilities +# +AC_PROG_CC +AC_PROG_CPP +AC_PROG_INSTALL +AC_PROG_LEX +AC_PROG_YACC +AM_CONDITIONAL(COMPILER_IS_GCC, test "x$GCC" = "xyes") + +# +# Checks for header files. +# +AC_HEADER_STDC +AC_CHECK_HEADERS(stdbool.h sys/types.h sys/socket.h netdb.h) + +AC_CHECK_HEADERS(fcgiapp.h fcgi_stdio.h rrd.h, [], + [AC_MSG_ERROR(a required header file cannot be found.)]) + +AC_CHECK_LIB(fcgi, FCGI_Accept, [], + [AC_MSG_ERROR(cannot find libfcgi.)]) +AC_CHECK_LIB(rrd_th, rrd_graph_v, [], + [AC_MSG_ERROR(cannot find librrd_th.)], [-lm]) + +AC_OUTPUT(Makefile src/Makefile) diff --git a/src/Makefile.am b/src/Makefile.am new file mode 100644 index 0000000..de0cb7e --- /dev/null +++ b/src/Makefile.am @@ -0,0 +1,25 @@ +AUTOMAKE_OPTIONS = foreign no-dependencies + +if COMPILER_IS_GCC +AM_CFLAGS = -Wall -Wextra +endif +AM_YFLAGS = -d + +BUILT_SOURCES = parser.h + +bin_PROGRAMS = collection.fcgi + +collection_fcgi_SOURCES = main.c \ + oconfig.c oconfig.h aux_types.h scanner.l parser.y \ + action_graph.c action_graph.h \ + action_list_graphs.c action_list_graphs.h \ + common.c common.h \ + filesystem.c filesystem.h \ + graph.c graph.h \ + graph_config.c graph_config.h \ + graph_def.c graph_def.h \ + graph_ident.c graph_ident.h \ + graph_instance.c graph_instance.h \ + graph_list.c graph_list.h \ + utils_array.c utils_array.h \ + utils_params.c utils_params.h diff --git a/action_graph.c b/src/action_graph.c similarity index 100% rename from action_graph.c rename to src/action_graph.c diff --git a/action_graph.h b/src/action_graph.h similarity index 100% rename from action_graph.h rename to src/action_graph.h diff --git a/action_list_graphs.c b/src/action_list_graphs.c similarity index 100% rename from action_list_graphs.c rename to src/action_list_graphs.c diff --git a/action_list_graphs.h b/src/action_list_graphs.h similarity index 100% rename from action_list_graphs.h rename to src/action_list_graphs.h diff --git a/aux_types.h b/src/aux_types.h similarity index 100% rename from aux_types.h rename to src/aux_types.h diff --git a/common.c b/src/common.c similarity index 100% rename from common.c rename to src/common.c diff --git a/common.h b/src/common.h similarity index 100% rename from common.h rename to src/common.h diff --git a/filesystem.c b/src/filesystem.c similarity index 100% rename from filesystem.c rename to src/filesystem.c diff --git a/filesystem.h b/src/filesystem.h similarity index 100% rename from filesystem.h rename to src/filesystem.h diff --git a/graph.c b/src/graph.c similarity index 100% rename from graph.c rename to src/graph.c diff --git a/graph.h b/src/graph.h similarity index 100% rename from graph.h rename to src/graph.h diff --git a/graph_config.c b/src/graph_config.c similarity index 100% rename from graph_config.c rename to src/graph_config.c diff --git a/graph_config.h b/src/graph_config.h similarity index 100% rename from graph_config.h rename to src/graph_config.h diff --git a/graph_def.c b/src/graph_def.c similarity index 100% rename from graph_def.c rename to src/graph_def.c diff --git a/graph_def.h b/src/graph_def.h similarity index 100% rename from graph_def.h rename to src/graph_def.h diff --git a/graph_ident.c b/src/graph_ident.c similarity index 100% rename from graph_ident.c rename to src/graph_ident.c diff --git a/graph_ident.h b/src/graph_ident.h similarity index 100% rename from graph_ident.h rename to src/graph_ident.h diff --git a/graph_instance.c b/src/graph_instance.c similarity index 100% rename from graph_instance.c rename to src/graph_instance.c diff --git a/graph_instance.h b/src/graph_instance.h similarity index 100% rename from graph_instance.h rename to src/graph_instance.h diff --git a/graph_list.c b/src/graph_list.c similarity index 100% rename from graph_list.c rename to src/graph_list.c diff --git a/graph_list.h b/src/graph_list.h similarity index 100% rename from graph_list.h rename to src/graph_list.h diff --git a/test.fcgi.c b/src/main.c similarity index 100% rename from test.fcgi.c rename to src/main.c diff --git a/oconfig.c b/src/oconfig.c similarity index 99% rename from oconfig.c rename to src/oconfig.c index b8087dd..79eec36 100644 --- a/oconfig.c +++ b/src/oconfig.c @@ -25,6 +25,7 @@ #include "oconfig.h" extern FILE *yyin; +int yyparse (void); oconfig_item_t *ci_root; const char *c_file; diff --git a/oconfig.h b/src/oconfig.h similarity index 100% rename from oconfig.h rename to src/oconfig.h diff --git a/parser.y b/src/parser.y similarity index 100% rename from parser.y rename to src/parser.y diff --git a/scanner.l b/src/scanner.l similarity index 100% rename from scanner.l rename to src/scanner.l diff --git a/utils_array.c b/src/utils_array.c similarity index 100% rename from utils_array.c rename to src/utils_array.c diff --git a/utils_array.h b/src/utils_array.h similarity index 100% rename from utils_array.h rename to src/utils_array.h diff --git a/utils_params.c b/src/utils_params.c similarity index 100% rename from utils_params.c rename to src/utils_params.c diff --git a/utils_params.h b/src/utils_params.h similarity index 100% rename from utils_params.h rename to src/utils_params.h -- 2.30.2