From 24b3e689cf6429d6a09ce8910d6b1735879bfdf4 Mon Sep 17 00:00:00 2001 From: victor Date: Sun, 5 Sep 2004 04:31:48 +0000 Subject: remove branch victor.screen add branch victor.solaris with some modification git-svn-id: http://opensvn.csie.org/pttbbs/branches/victor.solaris@2179 63ad8ddf-47c3-0310-b6dd-a9e9d9715204 --- Makefile | 3 ++- mbbsd/Makefile | 2 +- mbbsd/args.c | 2 +- mbbsd/register.c | 3 +++ mbbsd/user.c | 3 +++ pttbbs.mk | 14 ++++++++++---- util/Makefile | 6 +++--- util/merge_board.c | 4 ++++ util/reaper.c | 4 ++++ util/xchatd.h | 2 +- 10 files changed, 32 insertions(+), 11 deletions(-) diff --git a/Makefile b/Makefile index e94a522e..be024c8c 100644 --- a/Makefile +++ b/Makefile @@ -1,6 +1,7 @@ SUBDIR= mbbsd util innbbsd BBSHOME?=$(HOME) -OSTYPE!=uname +OS!=uname +OSTYPE?=$(OS) all install clean: @for i in $(SUBDIR); do\ diff --git a/mbbsd/Makefile b/mbbsd/Makefile index abfa1e0a..e6725456 100644 --- a/mbbsd/Makefile +++ b/mbbsd/Makefile @@ -44,7 +44,7 @@ install: $(PROG) install -d $(BBSHOME)/bin/ install -c -m 755 $(PROG) $(BBSHOME)/bin/ mv -f $(BBSHOME)/bin/mbbsd $(BBSHOME)/bin/mbbsd.`date '+%m%d%H'` - ln -sv $(BBSHOME)/bin/mbbsd.`date '+%m%d%H'` $(BBSHOME)/bin/mbbsd + ln -s $(BBSHOME)/bin/mbbsd.`date '+%m%d%H'` $(BBSHOME)/bin/mbbsd clean: rm -f $(OBJS) $(PROG) diff --git a/mbbsd/args.c b/mbbsd/args.c index bf36827b..32156517 100644 --- a/mbbsd/args.c +++ b/mbbsd/args.c @@ -1,4 +1,4 @@ -/* $Id: args.c,v 1.8 2003/06/26 01:04:03 kcwu Exp $ */ +/* $Id$ */ #include "bbs.h" #ifdef HAVE_SETPROCTITLE diff --git a/mbbsd/register.c b/mbbsd/register.c index a578f16a..f1e63a2b 100644 --- a/mbbsd/register.c +++ b/mbbsd/register.c @@ -1,5 +1,8 @@ /* $Id$ */ +#ifndef Solaris #define _XOPEN_SOURCE +#endif + #define _ISOC99_SOURCE #include "bbs.h" diff --git a/mbbsd/user.c b/mbbsd/user.c index 5ce60d71..a7a1eced 100644 --- a/mbbsd/user.c +++ b/mbbsd/user.c @@ -1,5 +1,8 @@ /* $Id$ */ +#ifndef Solaris #define _XOPEN_SOURCE +#endif + #define _ISOC99_SOURCE #include "bbs.h" diff --git a/pttbbs.mk b/pttbbs.mk index 9df09196..25d737d1 100644 --- a/pttbbs.mk +++ b/pttbbs.mk @@ -2,12 +2,13 @@ # 定義基本初值 BBSHOME?= $(HOME) BBSHOME?= /home/bbs -OSTYPE!= uname +OS!= uname +OSTYPE?= $(OS) CC?= gcc CCACHE!= which ccache|sed -e 's/^.*\///' PTT_CFLAGS= -Wall -pipe -DBBSHOME='"$(BBSHOME)"' -I../include PTT_LDFLAGS= -pipe -Wall -L/usr/local/lib -PTT_LIBS= -lcrypt -lhz +PTT_LIBS= -lcrypt # enable assert() #PTT_CFLAGS+= -DNDEBUG @@ -18,11 +19,16 @@ LDFLAGS_FreeBSD= LIBS_FreeBSD= -lkvm -liconv # Linux特有的環境 -# CFLAGS_linux= -DHAVE_DES_CRYPT -DLinux -CFLAGS_Linux= +CFLAGS_Linux= -DHAVE_DES_CRYPT LDFLAGS_Linux= -pipe -Wall LIBS_Linux= +# SunOS特有的環境 +CFLAGS_Solaris= -DSolaris -I/usr/local/include +LDFLAGS_Solaris= -L/usr/local/lib -L/usr/lib/ +LIBS_Solaris= -lnsl -lsocket -liconv + + # CFLAGS, LDFLAGS, LIBS 加入 OS 相關參數 PTT_CFLAGS+= $(CFLAGS_$(OSTYPE)) PTT_LDFLAGS+= $(LDFLAGS_$(OSTYPE)) diff --git a/util/Makefile b/util/Makefile index 54e26131..68eb7ad8 100644 --- a/util/Makefile +++ b/util/Makefile @@ -24,14 +24,14 @@ CPROG_WITH_UTIL= \ reaper buildAnnounce inndBM shmctl \ outmail chkhbf checkmoney merge_dir \ transman angel gamblegive checkdir \ - chesscountry + chesscountry tunepasswd buildir # 下面這些程式, 會直接被 compile CPROG_WITHOUT_UTIL= \ shmsweep uhash_loader showboard \ countalldice webgrep bbsrf initbbs \ - userlist tunepasswd buildir merge_passwd \ - merge_board xchatd bbsmail + userlist xchatd bbsmail merge_passwd \ + merge_board # 下面這些程式會被 install PROGS= ${UTIL_OBJS} ${CPROG_WITH_UTIL} ${CPROG_WITHOUT_UTIL} \ diff --git a/util/merge_board.c b/util/merge_board.c index 12f41346..b37f8c1a 100644 --- a/util/merge_board.c +++ b/util/merge_board.c @@ -7,6 +7,10 @@ #include "config.h" #include "pttstruct.h" +#ifdef Solaris +#include +#endif + typedef struct hash_t { char *brdname; struct hash_t *next; diff --git a/util/reaper.c b/util/reaper.c index 2fc587e0..7904566d 100644 --- a/util/reaper.c +++ b/util/reaper.c @@ -49,7 +49,11 @@ int check(int n, userec_t *u) { int main(int argc, char **argv) { now = time(NULL); +#ifdef Solaris + openlog("reaper", LOG_PID, SYSLOG_FACILITY); +#else openlog("reaper", LOG_PID | LOG_PERROR, SYSLOG_FACILITY); +#endif chdir(BBSHOME); attach_SHM(); diff --git a/util/xchatd.h b/util/xchatd.h index d0a6e1e4..fed869eb 100644 --- a/util/xchatd.h +++ b/util/xchatd.h @@ -1,4 +1,4 @@ -/* $Id: xchatd.h,v 1.1 2002/03/07 15:13:46 in2 Exp $ */ +/* $Id$ */ #ifndef _XCHAT_H_ #define _XCHAT_H_ -- cgit v1.2.3