From 93486fcc20b2cde9828f5a23ed2ba54aede794c3 Mon Sep 17 00:00:00 2001 From: nishi Date: Sat, 11 May 2024 00:23:45 +0000 Subject: [PATCH] should work git-svn-id: file:///raid/svn-main/nishi-mandshurica/trunk@70 f982e544-4a7d-3444-ad1a-fde59a2a69f1 --- GNUmakefile | 3 ++- Mandshurica/config.c | 1 + build.sh | 13 +++++++++++++ 3 files changed, 16 insertions(+), 1 deletion(-) create mode 100755 build.sh diff --git a/GNUmakefile b/GNUmakefile index d798f50..260e893 100644 --- a/GNUmakefile +++ b/GNUmakefile @@ -2,9 +2,10 @@ PREFIX := /usr/local MODULE_PREFIX := $(PREFIX)/lib/mandshurica WEBROOT_PREFIX := $(PREFIX)/lib/mandshurica/webroot +PROJECTS_PREFIX := $(PREFIX)/lib/mandshurica/projects CC := gcc -CFLAGS := -g -std=c99 -DPREFIX=\\\"$(PREFIX)\\\" -DWEBROOT_PREFIX=\\\"$(WEBROOT_PREFIX)\\\" -DMODULE_PREFIX=\\\"$(MODULE_PREFIX)\\\" -D_DEFAULT_SOURCE +CFLAGS := -g -std=c99 -DPREFIX=\\\"$(PREFIX)\\\" -DWEBROOT_PREFIX=\\\"$(WEBROOT_PREFIX)\\\" -DMODULE_PREFIX=\\\"$(MODULE_PREFIX)\\\" -DPROJECTS_PREFIX=\\\"$(PROJECTS_PREFIX)\\\" -D_DEFAULT_SOURCE LDFLAGS := LIBS := diff --git a/Mandshurica/config.c b/Mandshurica/config.c index 94e5a69..c0f087f 100644 --- a/Mandshurica/config.c +++ b/Mandshurica/config.c @@ -211,6 +211,7 @@ int mandshurica_create_config(const char* path) { fprintf(f, "Set CookieDB %s/passwd.db\n", PREFIX); fprintf(f, "Set HTTPPort 1024\n"); fprintf(f, "Set HTTPRoot %s\n", WEBROOT_PREFIX); + fprintf(f, "Set ProjectRoot %s\n", WEBROOT_PREFIX); fprintf(f, "Set InstancecName Sumire\n"); fprintf(f, "\n"); fprintf(f, "Set HTTPMIME.html text/html\n"); diff --git a/build.sh b/build.sh new file mode 100755 index 0000000..234b49d --- /dev/null +++ b/build.sh @@ -0,0 +1,13 @@ +#!/bin/sh +which gmake 2>/dev/null +if [ "$?" = "0" ]; then + MAKE=gmake +else + MAKE=make +fi +if [ "`uname -s`" = "NetBSD" ]; then + $MAKE PREFIX=`pwd` MODULE_PREFIX=`pwd`/Module WEBROOT_PREFIX=`pwd`/Webroot PROJECTS_PREFIX=`pwd`/Projects -j`cat /proc/cpuinfo | grep proc | wc -l` +else + $MAKE PREFIX=`pwd` MODULE_PREFIX=`pwd`/Module WEBROOT_PREFIX=`pwd`/Webroot PROJECTS_PREFIX=`pwd`/Projects -j`nproc` +fi +exit $? -- 2.43.0