summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorpiaip <piaip@63ad8ddf-47c3-0310-b6dd-a9e9d9715204>2005-09-11 11:51:16 +0800
committerpiaip <piaip@63ad8ddf-47c3-0310-b6dd-a9e9d9715204>2005-09-11 11:51:16 +0800
commit440a2643ed42f8be05450e0b00021d933f64e0b3 (patch)
treee689fda7ca76433967385e0423b84823f144b857
parentfa5b233767ca9d4e012839c28eb13628d2ebba63 (diff)
downloadpttbbs-piaip.automake.tar
pttbbs-piaip.automake.tar.gz
pttbbs-piaip.automake.tar.bz2
pttbbs-piaip.automake.tar.lz
pttbbs-piaip.automake.tar.xz
pttbbs-piaip.automake.tar.zst
pttbbs-piaip.automake.zip
moving forward!piaip.automake
git-svn-id: http://opensvn.csie.org/pttbbs/branches/piaip.automake@3154 63ad8ddf-47c3-0310-b6dd-a9e9d9715204
-rw-r--r--README.1st41
-rw-r--r--configure.in1
-rw-r--r--include/bbs.h2
-rw-r--r--include/bbsconf.h (renamed from include/defconf.h)0
-rw-r--r--mbbsd/Makefile.am14
-rw-r--r--mbbsd/chess.c4
-rw-r--r--mbbsd/mbbsd.c5
-rw-r--r--mbbsd/talk.c12
-rw-r--r--pttbbs.mk12
-rw-r--r--util/Makefile.am123
-rw-r--r--util/bbsrf.c2
11 files changed, 108 insertions, 108 deletions
diff --git a/README.1st b/README.1st
new file mode 100644
index 00000000..ba15b7b6
--- /dev/null
+++ b/README.1st
@@ -0,0 +1,41 @@
+------------------------------------------
+
+PTTBBS - 1.9 Branch
+
+Release Engineer: piaip
+
+------------------------------------------
+
+1.9 branch is a whole new generation.
+In this release we want to migrate old
+MAKE system from pmake(BSD flavor) to
+GNU Autoconf/Automake. And after this
+it is believed that we will be able to
+release faster and more stable.
+
+To apply this branch, please install:
+Autoconf 2.59
+Automake 1.9
+
+And run these commands in top level
+directory:
+
+aclocal
+autoheader
+autoconf
+automake -a
+
+Then you will be able to use
+./configure
+make
+
+------------------------------------------
+Warning: 1.9 Automake branch is STILL
+WORK IN PROGRESS. That is, it's not stable
+and may not be run/build/install.
+
+Any help is welcome to make it faster
+released!
+
+ piaip@csie.ntu.edu.tw,
+ Sun Sep 11 11:50:56 CST 2005
diff --git a/configure.in b/configure.in
index a1721948..2321e3ed 100644
--- a/configure.in
+++ b/configure.in
@@ -10,6 +10,7 @@ AC_PREFIX_DEFAULT(/home/bbs)
# Checks for programs.
AC_PROG_CC
+AC_PROG_RANLIB
# Checks for libraries.
diff --git a/include/bbs.h b/include/bbs.h
index 4931ef99..321ee425 100644
--- a/include/bbs.h
+++ b/include/bbs.h
@@ -38,7 +38,7 @@
#include <sys/msg.h>
/* our header */
-#include "config.h"
+#include "bbsconf.h"
#ifdef TIMET64
typedef uint32_t time4_t;
#else
diff --git a/include/defconf.h b/include/bbsconf.h
index 194e5dc9..194e5dc9 100644
--- a/include/defconf.h
+++ b/include/bbsconf.h
diff --git a/mbbsd/Makefile.am b/mbbsd/Makefile.am
index 8d19b6ff..6ab24ad3 100644
--- a/mbbsd/Makefile.am
+++ b/mbbsd/Makefile.am
@@ -4,7 +4,8 @@
########################################################################
# $Id$
-bin_PROGRAMS=mbbsd
+PROG=mbbsd
+bin_PROGRAMS=$(PROG)
mbbsd_SOURCES= \
../include/var.h \
@@ -19,6 +20,12 @@ mbbsd_SOURCES= \
../include/var.h: var.c
perl ../util/parsevar.pl < var.c > ../include/var.h
+test: $(PROG)
+ killall -9 test$(PROG) || true
+ cp $(PROG) test$(PROG)
+ ./test$(PROG) 9000
+ rm -f test$(PROG)
+
## reduce .bss align overhead
#.if !defined(DEBUG)
#LDFLAGS+=-Wl,--sort-common
@@ -28,11 +35,6 @@ mbbsd_SOURCES= \
# sh ../util/newvers.sh
# $(DIETCC) $(CC) $(LDFLAGS) -o $(PROG) $(OBJS) $(LIBS) $(EXT_LIBS) vers.c
-#test: $(PROG)
-# killall -9 testmbbsd || true
-# cp mbbsd testmbbsd
-# ./testmbbsd 9000
-# rm -f testmbbsd
#
#install: $(PROG)
# install -d $(BBSHOME)/bin/
diff --git a/mbbsd/chess.c b/mbbsd/chess.c
index b50ade04..ed6d6472 100644
--- a/mbbsd/chess.c
+++ b/mbbsd/chess.c
@@ -1120,11 +1120,7 @@ ChessWatchGame(void (*play)(int, ChessGameMode), int game, const char* title)
vmsg("無法建立連線");
return -1;
}
-#if defined(Solaris) && __OS_MAJOR_VERSION__ == 5 && __OS_MINOR_VERSION__ < 7
- msgsock = accept(sock, (struct sockaddr *) 0, 0);
-#else
msgsock = accept(sock, (struct sockaddr *) 0, (socklen_t *) 0);
-#endif
close(sock);
if (msgsock < 0)
return -1;
diff --git a/mbbsd/mbbsd.c b/mbbsd/mbbsd.c
index 83bdc709..595ba1a9 100644
--- a/mbbsd/mbbsd.c
+++ b/mbbsd/mbbsd.c
@@ -1535,13 +1535,8 @@ daemon_login(int argc, char *argv[], char *envp[])
/* main loop */
while( 1 ){
len_of_sock_addr = sizeof(xsin);
-#if defined(Solaris) && __OS_MAJOR_VERSION__ == 5 && __OS_MINOR_VERSION__ < 7
- if( (csock = accept(msock, (struct sockaddr *)&xsin,
- &len_of_sock_addr)) < 0 ){
-#else
if( (csock = accept(msock, (struct sockaddr *)&xsin,
(socklen_t *)&len_of_sock_addr)) < 0 ){
-#endif
if (errno != EINTR)
sleep(1);
continue;
diff --git a/mbbsd/talk.c b/mbbsd/talk.c
index 12d526bf..8d36d472 100644
--- a/mbbsd/talk.c
+++ b/mbbsd/talk.c
@@ -1390,11 +1390,7 @@ int make_connection_to_somebody(userinfo_t *uin, int timeout){
return -1;
}
length = sizeof(server);
-#if defined(Solaris) && __OS_MAJOR_VERSION__ == 5 && __OS_MINOR_VERSION__ < 7
- if (getsockname(sock, (struct sockaddr *) & server, & length) < 0) {
-#else
if (getsockname(sock, (struct sockaddr *) & server, (socklen_t *) & length) < 0) {
-#endif
close(sock);
perror("sock name err");
unlockutmpmode();
@@ -1492,11 +1488,7 @@ my_talk(userinfo_t * uin, int fri_stat, char defact)
if (sock < 0)
vmsg("無法建立連線");
else {
-#if defined(Solaris) && __OS_MAJOR_VERSION__ == 5 && __OS_MINOR_VERSION__ < 7
- msgsock = accept(sock, (struct sockaddr *) 0, 0);
-#else
msgsock = accept(sock, (struct sockaddr *) 0, (socklen_t *) 0);
-#endif
close(sock);
if (msgsock == -1) {
perror("accept");
@@ -1599,11 +1591,7 @@ my_talk(userinfo_t * uin, int fri_stat, char defact)
sock = make_connection_to_somebody(uin, 5);
-#if defined(Solaris) && __OS_MAJOR_VERSION__ == 5 && __OS_MINOR_VERSION__ < 7
- msgsock = accept(sock, (struct sockaddr *) 0, 0);
-#else
msgsock = accept(sock, (struct sockaddr *) 0, (socklen_t *) 0);
-#endif
if (msgsock == -1) {
perror("accept");
unlockutmpmode();
diff --git a/pttbbs.mk b/pttbbs.mk
index 7f88be49..851530ca 100644
--- a/pttbbs.mk
+++ b/pttbbs.mk
@@ -4,8 +4,6 @@ BBSHOME?= $(HOME)
BBSHOME?= /home/bbs
OS!= uname
-OS_MAJOR_VER!= uname -r|cut -d . -f 1
-OS_MINOR_VER!= uname -r|cut -d . -f 2
OSTYPE?= $(OS)
CC= gcc
@@ -22,19 +20,11 @@ CFLAGS_FreeBSD= -I/usr/local/include
LDFLAGS_FreeBSD=
LIBS_FreeBSD= -lkvm -liconv
-# Linux特有的環境
-CFLAGS_Linux=
-LDFLAGS_Linux=
-LIBS_Linux=
-
# SunOS特有的環境
CFLAGS_Solaris= -DSolaris -I/usr/local/include
LDFLAGS_Solaris= -L/usr/local/lib -L/usr/lib
LIBS_Solaris= -lnsl -lsocket -liconv -lkstat
-OS_FLAGS= -D__OS_MAJOR_VERSION__="$(OS_MAJOR_VER)" \
- -D__OS_MINOR_VERSION__="$(OS_MINOR_VER)"
-
# CFLAGS, LDFLAGS, LIBS 加入 OS 相關參數
PTT_CFLAGS+= $(CFLAGS_$(OSTYPE)) $(OS_FLAGS)
PTT_LDFLAGS+= $(LDFLAGS_$(OSTYPE))
@@ -62,7 +52,9 @@ CFLAGS= $(PTT_CFLAGS) -O1 -tpp6 -mcpu=pentiumpro -march=pentiumiii \
-ip -ipo
LDFLAGS+= -O1 -tpp6 -mcpu=pentiumpro -march=pentiumiii -ip -ipo \
$(PTT_LDFLAGS) $(PTT_LIBS)
+
.elif defined(GDB)
+
CFLAGS= -g -O0 $(PTT_CFLAGS)
LDFLAGS= -O0 $(PTT_LDFLAGS) $(PTT_LIBS)
.else
diff --git a/util/Makefile.am b/util/Makefile.am
index f1cdf95d..9a09eb71 100644
--- a/util/Makefile.am
+++ b/util/Makefile.am
@@ -4,8 +4,11 @@
########################################################################
# $Id$
+AUTOMAKE_OPTIONS=foreign
+
CFLAGS=-DPTTBBS_UTIL
BBSBASE=../include/var.h
+CFLAGS+=-Wall -pipe -DBBSHOME='"/home/bbs"' -I ../include
# Compile and build with BBS utility library.
CPROG_WITH_UTIL= \
@@ -17,13 +20,19 @@ CPROG_WITH_UTIL= \
reaper buildAnnounce inndBM mailangel \
outmail chkhbf checkmoney merge_dir \
transman angel gamblegive checkdir \
- chesscountry tunepasswd buildir xchatd
+ chesscountry tunepasswd buildir xchatd \
+ cleanpasswd \
+ shmctl
# Compile directly.
CPROG_WITHOUT_UTIL= \
countalldice bbsrf bbsmail initbbs \
gamble_fix merge_board merge_passwd showboard \
- userlist uhash_loader
+ userlist uhash_loader
+
+# migration, not used in general case.
+CPROG_NO_BUILD=r2014convert passwdconverter
+
# No need to be compiled.
SCRIPT_PROG = \
@@ -33,82 +42,58 @@ SCRIPT_PROG = \
dailybackup.pl tarqueue.pl waterball.pl filtermail.pl \
getbackup.pl udnnews.pl rebuildaloha.pl
-bin_PRORAMS=$(SCRIPT_PROG) $(CPROG_WITHOUT_UTIL) $(CPROG_WITH_UTIL) \
- shmctl
-
-UTIL_LIB= \
- util_cache.c util_record.c util_passwd.c util_var.c \
- util_stuff.c util_osdep.c util_args.c util_file.c \
- util_crypt.c
-
-MBBSD_OBJS= \
- cache record passwd var \
- stuff osdep args file \
- crypt
-
-../include/var.h: ../mbbsd/var.c
- cd ../mbbsd; $(MAKE) ../include/var.h
+MBBSD_PATH=../mbbsd
-.for fn in ${CPROG_WITH_UTIL}
-${fn}: ${BBSBASE} ${fn}.c ${UTIL_OBJS}
- $(CCACHE) ${CC} ${CFLAGS} ${LDFLAGS} -o ${fn} ${UTIL_OBJS} ${fn}.c
-.endfor
+MBBSD_LIB= \
+ $(MBBSD_PATH)/cache.c $(MBBSD_PATH)/record.c \
+ $(MBBSD_PATH)/passwd.c $(MBBSD_PATH)/var.c \
+ $(MBBSD_PATH)/stuff.c $(MBBSD_PATH)/osdep.c \
+ $(MBBSD_PATH)/args.c $(MBBSD_PATH)/file.c \
+ $(MBBSD_PATH)/crypt.c
-.for fn in ${MBBSD_OBJS}
-util_${fn}.o: ${BBSBASE} ../mbbsd/${fn}.c
- $(CCACHE) ${CC} ${CFLAGS} -D_BBS_UTIL_C_ -c -o $@ ../mbbsd/${fn}.c
-.endfor
+bin_PROGRAMS=$(CPROG_WITH_UTIL) $(CPROG_WITHOUT_UTIL)
-shmctl: ${BBSBASE} shmctl.c ${UTIL_OBJS}
- $(CCACHE) ${CC} ${CFLAGS} ${LDFLAGS} -o shmctl ${UTIL_OBJS} shmctl.c
+noinst_LIBRARIES=libmbbsd.a
+libmbbsd_a_SOURCES=$(MBBSD_LIB) $(BBSBASE)
+libmbbsd_a_CFLAGS=-D_BBS_UTIL_C_
-bbsmail: ${BBSBASE} bbsmail.c ../innbbsd/str_decode.c $(UTIL_OBJS)
- $(CCACHE) $(CC) $(CFLAGS) $(LDFLAGS) -o bbsmail -DUSE_ICONV \
- bbsmail.c ../innbbsd/str_decode.c $(UTIL_OBJS)
+LDADD=libmbbsd.a
-install: $(PROGS)
- install -d $(BBSHOME)/bin/
- install -c -m 755 $(PROGS) $(BBSHOME)/bin/
- chmod 4755 $(BBSHOME)/bin/post
-.if defined(WITHFILTERMAIL)
- $(MAKE) installfiltermail
-.endif
+$(BBSBASE): ../mbbsd/var.c
+ cd ../mbbsd; $(MAKE) ../include/var.h
-clean:
- rm -f *.o $(CPROGS) $(CPROG_WITH_UTIL) $(CPROG_WITHOUT_UTIL)
+#bbsmail: ${BBSBASE} bbsmail.c ../innbbsd/str_decode.c $(UTIL_OBJS)
+# $(CCACHE) $(CC) $(CFLAGS) $(LDFLAGS) -o bbsmail -DUSE_ICONV \
+# bbsmail.c ../innbbsd/str_decode.c $(UTIL_OBJS)
+#install: $(PROGS)
+# install -d $(BBSHOME)/bin/
+# install -c -m 755 $(PROGS) $(BBSHOME)/bin/
+# chmod 4755 $(BBSHOME)/bin/post
+#.if defined(WITHFILTERMAIL)
+# $(MAKE) installfiltermail
+#.endif
-installfiltermail:
- mv $(BBSHOME)/bin/bbsmail $(BBSHOME)/bin/realbbsmail
- ln -s $(BBSHOME)/bin/filtermail.pl $(BBSHOME)/bin/bbsmail
+#installfiltermail:
+# mv $(BBSHOME)/bin/bbsmail $(BBSHOME)/bin/realbbsmail
+# ln -s $(BBSHOME)/bin/filtermail.pl $(BBSHOME)/bin/bbsmail
-# for diskstat(FreeBSD 4.x only) .
-# diskstat should be compiled with bbs and installed with root
-diskstat: diskstat.c
- $(CCACHE) $(CC) $(CFLAGS) -o diskstat diskstat.c -ldevstat -lkvm
+## for diskstat(FreeBSD 4.x only) .
+## diskstat should be compiled with bbs and installed with root
+#diskstat: diskstat.c
+# $(CCACHE) $(CC) $(CFLAGS) -o diskstat diskstat.c -ldevstat -lkvm
-installdiskstat: diskstat
- cp -f diskstat /usr/local/bin/
- chgrp kmem /usr/local/bin/diskstat
- chmod 2755 /usr/local/bin/diskstat
+#installdiskstat: diskstat
+# cp -f diskstat /usr/local/bin/
+# chgrp kmem /usr/local/bin/diskstat
+# chmod 2755 /usr/local/bin/diskstat
# for bbsctl. bbsctl should be compiled with bbs and installed with root
-bbsctl: bbsctl.c
- $(CCACHE) $(CC) $(CFLAGS) -o $@ $@.c
-
-installbbsctl: bbsctl
- rm -f /home/bbs/bin/bbsctl
- cp /home/bbs/pttbbs/util/bbsctl /home/bbs/bin/bbsctl
- chown root /home/bbs/bin/bbsctl
- chmod 4755 /home/bbs/bin/bbsctl
-
-cleanpasswd: cleanpasswd.c ${UTIL_OBJS}
- $(CCACHE) ${CC} ${CFLAGS} ${LDFLAGS} -o cleanpasswd ${UTIL_OBJS} cleanpasswd.c
-
-r2014transfer: r2014convert
- $(CCACHE) ${CC} ${CFLAGS} ${LDFLAGS} -o r2014convert r2014convert.c
- ./r2014convert
- rm r2014convert
-
-passwdconverter: passwdconverter.c
- $(CCACHE) $(CC) $(CFLAGS) $(LDFLAGS) $(UTIL_OBJS) -o passwdconverter passwdconverter.c
+#bbsctl: bbsctl.c
+# $(CCACHE) $(CC) $(CFLAGS) -o $@ $@.c
+
+#installbbsctl: bbsctl
+# rm -f /home/bbs/bin/bbsctl
+# cp /home/bbs/pttbbs/util/bbsctl /home/bbs/bin/bbsctl
+# chown root /home/bbs/bin/bbsctl
+# chmod 4755 /home/bbs/bin/bbsctl
diff --git a/util/bbsrf.c b/util/bbsrf.c
index 27ed9e3a..7ecd0824 100644
--- a/util/bbsrf.c
+++ b/util/bbsrf.c
@@ -11,7 +11,7 @@
#include <fcntl.h>
#include <sys/types.h>
#include <sys/uio.h>
-#include "config.h"
+#include "bbsconf.h"
#ifdef Solaris
#include <utmpx.h>