From 19ee32ce1139edad87516a51bef406c97f522d0d Mon Sep 17 00:00:00 2001 From: nishi Date: Sat, 13 Apr 2024 01:35:32 +0000 Subject: [PATCH] add syslog git-svn-id: file:///raid/svn-main/nishi-mandshurica/trunk@6 f982e544-4a7d-3444-ad1a-fde59a2a69f1 --- DevForge/config.c | 4 ++++ Makefile | 3 ++- Module/Makefile | 2 +- Module/syslog.c | 29 +++++++++++++++++++++++++++++ 4 files changed, 36 insertions(+), 2 deletions(-) create mode 100644 Module/syslog.c diff --git a/DevForge/config.c b/DevForge/config.c index 7b765fc..974e54c 100644 --- a/DevForge/config.c +++ b/DevForge/config.c @@ -30,6 +30,7 @@ #include "df_config.h" +#include "devforge.h" #include "df_log.h" #include "df_util.h" @@ -61,6 +62,9 @@ int devforge_create_config(const char* path) { FILE* f = fopen(path, "w"); if(f != NULL) { + fprintf(f, "# Generated by DevForge " DEVFORGE_VERSION "\n"); + fprintf(f, "ServerRoot %s\n", PREFIX); + fprintf(f, "LoadModule %s/syslog.so\n", MODULE_PREFIX); fclose(f); devforge_log(DF_LOG, "Created the config"); } else { diff --git a/Makefile b/Makefile index 5071817..a318824 100644 --- a/Makefile +++ b/Makefile @@ -1,8 +1,9 @@ # $Id$ PREFIX := /usr/local +MODULE_PREFIX := $(PREFIX)/lib/devforge CC := gcc -CFLAGS := -g -std=c99 -DPREFIX=\\\"$(PREFIX)\\\" +CFLAGS := -g -std=c99 -DPREFIX=\\\"$(PREFIX)\\\" -DMODULE_PREFIX=\\\"$(MODULE_PREFIX)\\\" LDFLAGS := LIBS := diff --git a/Module/Makefile b/Module/Makefile index c1a1c16..9e264a3 100644 --- a/Module/Makefile +++ b/Module/Makefile @@ -6,7 +6,7 @@ EXTRA_LIBS = .PHONY: all clean -all: ./subversion.so +all: ./subversion.so ./syslog.so ./%.so: ./%.o $(CC) $(LDFLAGS) $(EXTRA_LDFLAGS) -o $@ $^ $(LIBS) $(EXTRA_LIBS) diff --git a/Module/syslog.c b/Module/syslog.c new file mode 100644 index 0000000..98aac2a --- /dev/null +++ b/Module/syslog.c @@ -0,0 +1,29 @@ +/* $Id$ */ +/* --- START LICENSE --- */ +/* -------------------------------------------------------------------------- */ +/* DevForge - Build Automation */ +/* -------------------------------------------------------------------------- */ +/* Copyright (c) 2024 Nishi. */ +/* Redistribution and use in source and binary forms, with or without modific */ +/* ation, are permitted provided that the following conditions are met: */ +/* 1. Redistributions of source code must retain the above copyright noti */ +/* ce, this list of conditions and the following disclaimer. */ +/* 2. Redistributions in binary form must reproduce the above copyright n */ +/* otice, this list of conditions and the following disclaimer in the documen */ +/* tation and/or other materials provided with the distribution. */ +/* 3. Neither the name of the copyright holder nor the names of its contr */ +/* ibutors may be used to endorse or promote products derived from this softw */ +/* are 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, TH */ +/* E IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPO */ +/* SE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS */ +/* BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CON */ +/* SEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITU */ +/* TE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPT */ +/* ION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, S */ +/* TRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN AN */ +/* Y WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY */ +/* OF SUCH DAMAGE. */ +/* -------------------------------------------------------------------------- */ +/* --- END LICENSE --- */ -- 2.43.0