summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorkcwu <kcwu@63ad8ddf-47c3-0310-b6dd-a9e9d9715204>2003-08-10 20:23:11 +0800
committerkcwu <kcwu@63ad8ddf-47c3-0310-b6dd-a9e9d9715204>2003-08-10 20:23:11 +0800
commitda6382afa9cc31ed70b028839f8188953a061a9c (patch)
treed29c8ace07e370d3603a3ebec7f69b77204924fb
parent4ae3573244046eba0fc162f108738dce1f7299f4 (diff)
downloadpttbbs-da6382afa9cc31ed70b028839f8188953a061a9c.tar
pttbbs-da6382afa9cc31ed70b028839f8188953a061a9c.tar.gz
pttbbs-da6382afa9cc31ed70b028839f8188953a061a9c.tar.bz2
pttbbs-da6382afa9cc31ed70b028839f8188953a061a9c.tar.lz
pttbbs-da6382afa9cc31ed70b028839f8188953a061a9c.tar.xz
pttbbs-da6382afa9cc31ed70b028839f8188953a061a9c.tar.zst
pttbbs-da6382afa9cc31ed70b028839f8188953a061a9c.zip
replace FreeBSD macro with __FreeBSD__
replace Linux macro with __linux__ replace make with $(MAKE) OSTYPE in cmdline doesn't need anymore git-svn-id: http://opensvn.csie.org/pttbbs/trunk/pttbbs@1091 63ad8ddf-47c3-0310-b6dd-a9e9d9715204
-rw-r--r--Makefile2
-rw-r--r--docs/INSTALL4
-rw-r--r--include/bbs.h6
-rw-r--r--innbbsd/Makefile1
-rw-r--r--mbbsd/chat.c4
-rw-r--r--mbbsd/osdep.c4
-rw-r--r--mbbsd/term.c6
-rw-r--r--pttbbs.mk14
-rw-r--r--sample/Makefile2
-rw-r--r--sample/etc/Makefile2
-rw-r--r--util/bbsctl.c6
11 files changed, 23 insertions, 28 deletions
diff --git a/Makefile b/Makefile
index f294ae0d..e94a522e 100644
--- a/Makefile
+++ b/Makefile
@@ -5,6 +5,6 @@ OSTYPE!=uname
all install clean:
@for i in $(SUBDIR); do\
cd $$i;\
- make BBSHOME=$(BBSHOME) OSTYPE=$(OSTYPE) $@;\
+ $(MAKE) BBSHOME=$(BBSHOME) $@;\
cd ..;\
done
diff --git a/docs/INSTALL b/docs/INSTALL
index b1297830..4311cc70 100644
--- a/docs/INSTALL
+++ b/docs/INSTALL
@@ -42,9 +42,7 @@
9. 如果之前沒有設定過 pttbbs.conf 的話, 請 cp sample/pttbbs.conf pttbbs.conf
10.修改 pttbbs.conf
* 如果您是用 Linux系統, 請先安裝 pmake, 然後將 make alias 成 pmake *
- 11.執行 make OSTYPE=FreeBSD BBSHOME=/home/bbs all install
- (若是使用 FreeBSD 5.x的話, 請如上 FreeBSD5=1 )
- ( Linux使用者請把 "FreeBSD" 改成 "linux")
+ 11.執行 make BBSHOME=/home/bbs all install
(如果出現 iconv.h找不到的話, 請見 FAQ 7 )
12.如果是新架起來的站, 請執行 cd sample; make install
13.執行 cd /home/bbs; bin/initbbs
diff --git a/include/bbs.h b/include/bbs.h
index e119265d..71a3332f 100644
--- a/include/bbs.h
+++ b/include/bbs.h
@@ -35,15 +35,15 @@
#include <sys/msg.h>
/* os dependant include file, define */
-#ifdef FreeBSD
- #ifdef FreeBSD5
+#ifdef __FreeBSD__
+ #if __FreeBSD__ >=5
#include <sys/limits.h>
#else
#include <machine/limits.h>
#endif
#include <machine/param.h>
#endif
-#ifdef Linux
+#ifdef __linux__
#include <sys/param.h>
#include <limits.h>
#include <sys/file.h> // for flock()
diff --git a/innbbsd/Makefile b/innbbsd/Makefile
index 5fa6c566..1422ec65 100644
--- a/innbbsd/Makefile
+++ b/innbbsd/Makefile
@@ -7,6 +7,7 @@
# ------------------------------------------------------- #
# stdarg.h patch for pttbbs by in2 03/05/05 #
+OSTYPE!=uname
####################################################
# this is a bbs <--> news gateway
#####################################################
diff --git a/mbbsd/chat.c b/mbbsd/chat.c
index 6346335a..55d3129d 100644
--- a/mbbsd/chat.c
+++ b/mbbsd/chat.c
@@ -1,4 +1,4 @@
-/* $Id: chat.c,v 1.11 2003/02/23 16:39:27 victor Exp $ */
+/* $Id$ */
#include "bbs.h"
static int chatline, stop_line;
@@ -355,7 +355,7 @@ t_chat()
return -1;
}
memset(&sin, 0, sizeof sin);
-#ifdef FreeBSD
+#ifdef __FreeBSD__
sin.sin_len = sizeof(sin);
#endif
sin.sin_family = PF_INET;
diff --git a/mbbsd/osdep.c b/mbbsd/osdep.c
index 0c32db7a..4e6d286e 100644
--- a/mbbsd/osdep.c
+++ b/mbbsd/osdep.c
@@ -1,7 +1,7 @@
-/* $Id: osdep.c,v 1.7 2003/01/23 18:19:55 in2 Exp $ */
+/* $Id$ */
#include "bbs.h"
-#ifdef Linux
+#ifdef __linux__
#include <sys/types.h>
#include <string.h>
diff --git a/mbbsd/term.c b/mbbsd/term.c
index a0f83354..54acc2a6 100644
--- a/mbbsd/term.c
+++ b/mbbsd/term.c
@@ -1,4 +1,4 @@
-/* $Id: term.c,v 1.11 2002/11/08 21:12:58 in2 Exp $ */
+/* $Id$ */
#include "bbs.h"
int tgetent(const char *bp, char *name);
@@ -52,7 +52,7 @@ outcf(int ch)
}
#endif
-#ifndef Linux
+#ifndef __linux__
static void
term_resize(int sig)
{
@@ -90,7 +90,7 @@ term_resize(int sig)
int
term_init()
{
-#ifndef Linux
+#ifndef __linux__
signal(SIGWINCH, term_resize);
#endif
return YEA;
diff --git a/pttbbs.mk b/pttbbs.mk
index 265aaa46..90e9c36f 100644
--- a/pttbbs.mk
+++ b/pttbbs.mk
@@ -2,7 +2,7 @@
# 定義基本初值
BBSHOME?= $(HOME)
BBSHOME?= /home/bbs
-OSTYPE?= FreeBSD
+OSTYPE!= uname
CC?= gcc
CCACHE!= which ccache|sed -e 's/^.*\///'
PTT_CFLAGS= -Wall -pipe -DBBSHOME='"$(BBSHOME)"' -I../include
@@ -13,15 +13,15 @@ PTT_LIBS= -lcrypt
#PTT_CFLAGS+= -DNDEBUG
# FreeBSD特有的環境
-CFLAGS_FreeBSD= -DHAVE_SETPROCTITLE -DFreeBSD
+CFLAGS_FreeBSD= -DHAVE_SETPROCTITLE
LDFLAGS_FreeBSD=
LIBS_FreeBSD= -lkvm
# Linux特有的環境
# CFLAGS_linux= -DHAVE_DES_CRYPT -DLinux
-CFLAGS_linux= -DLinux
-LDFLAGS_linux= -pipe -Wall
-LIBS_linux=
+CFLAGS_Linux=
+LDFLAGS_Linux= -pipe -Wall
+LIBS_Linux=
# CFLAGS, LDFLAGS, LIBS 加入 OS 相關參數
PTT_CFLAGS+= $(CFLAGS_$(OSTYPE))
@@ -48,7 +48,3 @@ CFLAGS+= -DDEBUG
.if defined(NO_FORK)
CFLAGS+= -DNO_FORK
.endif
-
-.if defined(FreeBSD5)
-CFLAGS+= -DFreeBSD5
-.endif
diff --git a/sample/Makefile b/sample/Makefile
index 7ba47da6..832eba59 100644
--- a/sample/Makefile
+++ b/sample/Makefile
@@ -6,6 +6,6 @@ all:
install:
@for i in $(SUBDIR); do\
cd $$i;\
- make BBSHOME=$(BBSHOME) OSTYPE=$(OSTYPE) $@;\
+ $(MAKE) BBSHOME=$(BBSHOME) $@;\
cd ..;\
done
diff --git a/sample/etc/Makefile b/sample/etc/Makefile
index 154d39d9..6a2755ef 100644
--- a/sample/etc/Makefile
+++ b/sample/etc/Makefile
@@ -13,7 +13,7 @@ all:
install_sub:
@for i in $(SUBDIR); do\
cd $$i;\
- make BBSHOME=$(BBSHOME) OSTYPE=$(OSTYPE) install;\
+ $(MAKE) BBSHOME=$(BBSHOME) install;\
cd ..;\
done
diff --git a/util/bbsctl.c b/util/bbsctl.c
index 936547a3..53aaede3 100644
--- a/util/bbsctl.c
+++ b/util/bbsctl.c
@@ -12,7 +12,7 @@
#include "pttstruct.h"
#include "perm.h"
-#ifdef FreeBSD
+#ifdef __FreeBSD__
#include <sys/syslimits.h>
#define SU "/usr/bin/su"
#define CP "/bin/cp"
@@ -21,7 +21,7 @@
#define IPCRM "/usr/bin/ipcrm"
#define AWK "/usr/bin/awk"
#endif
-#ifdef Linux
+#ifdef __linux__
#include <linux/limits.h>
#define SU "/bin/su"
#define CP "/bin/cp"
@@ -187,7 +187,7 @@ int bbstest(int argc, char **argv)
int Xipcrm(int argc, char **argv)
{
-#ifdef FreeBSD
+#ifdef __FreeBSD__
char buf[256], cmd[256];
FILE *fp;
sprintf(buf, IPCS " | " AWK " '{print $1 $2}'");