Updated configure scripts and Makefiles

This commit is contained in:
Michiel Broek 2003-12-23 14:01:22 +00:00
parent 79a4875bee
commit 74cf98c9c5
9 changed files with 140 additions and 123 deletions

View File

@ -15,6 +15,8 @@ ETCDIR = @prefix@/etc
DOCDIR = @prefix@/doc DOCDIR = @prefix@/doc
OWNER = @OWNER@ OWNER = @OWNER@
GROUP = @GROUP@ GROUP = @GROUP@
ROWNER = @ROWNER@
RGROUP = @RGROUP@
MODE = 0711 MODE = 0711
SMODE = 6711 SMODE = 6711

View File

@ -8,6 +8,9 @@
#undef VERSION_REVISION #undef VERSION_REVISION
#undef VERSION #undef VERSION
/* According to Sun we MUST define this in the source */
#define _REENTRANT 1
/* Compile experimental code (may not be present) */ /* Compile experimental code (may not be present) */
#undef USE_EXPERIMENT #undef USE_EXPERIMENT

164
configure vendored
View File

@ -309,7 +309,7 @@ ac_includes_default="\
# include <unistd.h> # include <unistd.h>
#endif" #endif"
ac_subst_vars='SHELL PATH_SEPARATOR PACKAGE_NAME PACKAGE_TARNAME PACKAGE_VERSION PACKAGE_STRING PACKAGE_BUGREPORT exec_prefix prefix program_transform_name bindir sbindir libexecdir datadir sysconfdir sharedstatedir localstatedir libdir includedir oldincludedir infodir mandir build_alias host_alias target_alias DEFS ECHO_C ECHO_N ECHO_T LIBS SUBDIRS PACKAGE MAJOR MINOR REVISION COPYRIGHT GROUP OWNER VERSION MAKE AWK INSTALL CC CFLAGS LDFLAGS CPPFLAGS ac_ct_CC EXEEXT OBJEXT SET_MAKE RANLIB ac_ct_RANLIB TAR ZIP CHOWN CPP EGREP LIBOBJS COMPRESS GZIP ARC NOMARCH ARJ UNARJ LHA RAR UNRAR UNZIP ZOO HA ANTIVIR FPROT UVSCAN RB SB RZ SZ GOLDEDBIN GOLDNODE CONVERT LOG_COMPRESS LOG_COMPRESSEXT joebin joelib LTLIBOBJS' ac_subst_vars='SHELL PATH_SEPARATOR PACKAGE_NAME PACKAGE_TARNAME PACKAGE_VERSION PACKAGE_STRING PACKAGE_BUGREPORT exec_prefix prefix program_transform_name bindir sbindir libexecdir datadir sysconfdir sharedstatedir localstatedir libdir includedir oldincludedir infodir mandir build_alias host_alias target_alias DEFS ECHO_C ECHO_N ECHO_T LIBS SUBDIRS PACKAGE MAJOR MINOR REVISION COPYRIGHT GROUP OWNER ROWNER RGROUP VERSION MAKE AWK INSTALL CC CFLAGS LDFLAGS CPPFLAGS ac_ct_CC EXEEXT OBJEXT SET_MAKE RANLIB ac_ct_RANLIB TAR ZIP CHOWN CPP EGREP LIBOBJS COMPRESS GZIP ARC NOMARCH ARJ UNARJ LHA RAR UNRAR UNZIP ZOO HA ANTIVIR FPROT UVSCAN RB SB RZ SZ GOLDEDBIN GOLDNODE CONVERT LOG_COMPRESS LOG_COMPRESSEXT joebin joelib LTLIBOBJS'
ac_subst_files='' ac_subst_files=''
# Initialize some variables set by options. # Initialize some variables set by options.
@ -1280,6 +1280,10 @@ COPYRIGHT="Copyright (C) 1997-2003 Michiel Broek, All Rights Reserved"
SHORTRIGHT="Copyright (C) 1997-2003 M. Broek" SHORTRIGHT="Copyright (C) 1997-2003 M. Broek"
GROUP="bbs" GROUP="bbs"
OWNER="mbse" OWNER="mbse"
ROWNER="`id -un root`"
RGROUP="`id -gn root`"
@ -2877,84 +2881,9 @@ else
debugging=no debugging=no
fi; fi;
if test "$debugging" = "yes"; then if test "$debugging" = "yes"; then
CFLAGS="-O -g -Wall -Wshadow -Wwrite-strings -Wstrict-prototypes -D_REENTRANT -D_POSIX_PTHREAD_SEMANTICS" CFLAGS="-O -g -Wall -Wshadow -Wwrite-strings -Wstrict-prototypes -D_REENTRANT"
else else
CFLAGS="-O3 -Wall -Wshadow -Wwrite-strings -Wstrict-prototypes -D_REENTRANT -D_POSIX_PTHREAD_SEMANTICS" CFLAGS="-O3 -Wall -Wshadow -Wwrite-strings -Wstrict-prototypes -D_REENTRANT"
fi
if test "$SYSTEM" = "NetBSD"; then
CFLAGS="$CFLAGS `pthread-config --cflags`"
LDFLAGS="$LDFLAGS `pthread-config --ldflags`"
fi
if test "$SYSTEM" = "FreeBSD"; then
CFLAGS="-pthread $CFLAGS"
else
echo "$as_me:$LINENO: checking for pthread_create in -lpthread" >&5
echo $ECHO_N "checking for pthread_create in -lpthread... $ECHO_C" >&6
if test "${ac_cv_lib_pthread_pthread_create+set}" = set; then
echo $ECHO_N "(cached) $ECHO_C" >&6
else
ac_check_lib_save_LIBS=$LIBS
LIBS="-lpthread $LIBS"
cat >conftest.$ac_ext <<_ACEOF
#line $LINENO "configure"
/* confdefs.h. */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h. */
/* Override any gcc2 internal prototype to avoid an error. */
#ifdef __cplusplus
extern "C"
#endif
/* We use char because int might match the return type of a gcc2
builtin and then its argument prototype would still apply. */
char pthread_create ();
int
main ()
{
pthread_create ();
;
return 0;
}
_ACEOF
rm -f conftest.$ac_objext conftest$ac_exeext
if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
(eval $ac_link) 2>&5
ac_status=$?
echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); } &&
{ ac_try='test -s conftest$ac_exeext'
{ (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
(eval $ac_try) 2>&5
ac_status=$?
echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); }; }; then
ac_cv_lib_pthread_pthread_create=yes
else
echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5
ac_cv_lib_pthread_pthread_create=no
fi
rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
LIBS=$ac_check_lib_save_LIBS
fi
echo "$as_me:$LINENO: result: $ac_cv_lib_pthread_pthread_create" >&5
echo "${ECHO_T}$ac_cv_lib_pthread_pthread_create" >&6
if test $ac_cv_lib_pthread_pthread_create = yes; then
result=yes
else
result=no
fi
if test "$result" = "yes"; then
LIBS="$LIBS -lpthread"
fi
fi fi
@ -4785,6 +4714,83 @@ done
fi fi
if test "$SYSTEM" = "NetBSD"; then
CFLAGS="$CFLAGS `pthread-config --cflags`"
LDFLAGS="$LDFLAGS `pthread-config --ldflags`"
fi
if test "$SYSTEM" = "FreeBSD"; then
CFLAGS="-pthread $CFLAGS"
else
echo "$as_me:$LINENO: checking for pthread_create in -lpthread" >&5
echo $ECHO_N "checking for pthread_create in -lpthread... $ECHO_C" >&6
if test "${ac_cv_lib_pthread_pthread_create+set}" = set; then
echo $ECHO_N "(cached) $ECHO_C" >&6
else
ac_check_lib_save_LIBS=$LIBS
LIBS="-lpthread $LIBS"
cat >conftest.$ac_ext <<_ACEOF
#line $LINENO "configure"
/* confdefs.h. */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h. */
/* Override any gcc2 internal prototype to avoid an error. */
#ifdef __cplusplus
extern "C"
#endif
/* We use char because int might match the return type of a gcc2
builtin and then its argument prototype would still apply. */
char pthread_create ();
int
main ()
{
pthread_create ();
;
return 0;
}
_ACEOF
rm -f conftest.$ac_objext conftest$ac_exeext
if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
(eval $ac_link) 2>&5
ac_status=$?
echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); } &&
{ ac_try='test -s conftest$ac_exeext'
{ (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
(eval $ac_try) 2>&5
ac_status=$?
echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); }; }; then
ac_cv_lib_pthread_pthread_create=yes
else
echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5
ac_cv_lib_pthread_pthread_create=no
fi
rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
LIBS=$ac_check_lib_save_LIBS
fi
echo "$as_me:$LINENO: result: $ac_cv_lib_pthread_pthread_create" >&5
echo "${ECHO_T}$ac_cv_lib_pthread_pthread_create" >&6
if test $ac_cv_lib_pthread_pthread_create = yes; then
result=yes
else
result=no
fi
if test "$result" = "yes"; then
LIBS="$LIBS -lpthread"
fi
fi
echo "$as_me:$LINENO: checking for ANSI C header files" >&5 echo "$as_me:$LINENO: checking for ANSI C header files" >&5
echo $ECHO_N "checking for ANSI C header files... $ECHO_C" >&6 echo $ECHO_N "checking for ANSI C header files... $ECHO_C" >&6
if test "${ac_cv_header_stdc+set}" = set; then if test "${ac_cv_header_stdc+set}" = set; then
@ -9705,6 +9711,8 @@ s,@REVISION@,$REVISION,;t t
s,@COPYRIGHT@,$COPYRIGHT,;t t s,@COPYRIGHT@,$COPYRIGHT,;t t
s,@GROUP@,$GROUP,;t t s,@GROUP@,$GROUP,;t t
s,@OWNER@,$OWNER,;t t s,@OWNER@,$OWNER,;t t
s,@ROWNER@,$ROWNER,;t t
s,@RGROUP@,$RGROUP,;t t
s,@VERSION@,$VERSION,;t t s,@VERSION@,$VERSION,;t t
s,@MAKE@,$MAKE,;t t s,@MAKE@,$MAKE,;t t
s,@AWK@,$AWK,;t t s,@AWK@,$AWK,;t t

View File

@ -19,6 +19,8 @@ COPYRIGHT="Copyright (C) 1997-2003 Michiel Broek, All Rights Reserved"
SHORTRIGHT="Copyright (C) 1997-2003 M. Broek" SHORTRIGHT="Copyright (C) 1997-2003 M. Broek"
GROUP="bbs" GROUP="bbs"
OWNER="mbse" OWNER="mbse"
ROWNER="`id -un root`"
RGROUP="`id -gn root`"
AC_SUBST(PACKAGE) AC_SUBST(PACKAGE)
AC_SUBST(MAJOR) AC_SUBST(MAJOR)
AC_SUBST(MINOR) AC_SUBST(MINOR)
@ -26,6 +28,8 @@ AC_SUBST(REVISION)
AC_SUBST(COPYRIGHT) AC_SUBST(COPYRIGHT)
AC_SUBST(GROUP) AC_SUBST(GROUP)
AC_SUBST(OWNER) AC_SUBST(OWNER)
AC_SUBST(ROWNER)
AC_SUBST(RGROUP)
AC_PREFIX_DEFAULT(/opt/mbse) AC_PREFIX_DEFAULT(/opt/mbse)
AC_DEFINE_UNQUOTED(VERSION, "$VERSION") AC_DEFINE_UNQUOTED(VERSION, "$VERSION")
AC_DEFINE_UNQUOTED(VERSION_MAJOR, $MAJOR) AC_DEFINE_UNQUOTED(VERSION_MAJOR, $MAJOR)
@ -68,31 +72,9 @@ if test "$experiment" = "yes"; then
fi fi
AC_ARG_ENABLE(debugging, [ --enable-debugging Compile for debugging], [ debugging=$enableval ], [ debugging=no ]) AC_ARG_ENABLE(debugging, [ --enable-debugging Compile for debugging], [ debugging=$enableval ], [ debugging=no ])
if test "$debugging" = "yes"; then if test "$debugging" = "yes"; then
CFLAGS="-O -g -Wall -Wshadow -Wwrite-strings -Wstrict-prototypes -D_REENTRANT -D_POSIX_PTHREAD_SEMANTICS" CFLAGS="-O -g -Wall -Wshadow -Wwrite-strings -Wstrict-prototypes -D_REENTRANT"
else else
CFLAGS="-O3 -Wall -Wshadow -Wwrite-strings -Wstrict-prototypes -D_REENTRANT -D_POSIX_PTHREAD_SEMANTICS" CFLAGS="-O3 -Wall -Wshadow -Wwrite-strings -Wstrict-prototypes -D_REENTRANT"
fi
dnl
dnl On NetBSD we need to add the pkg dirs for posix threads
dnl
if test "$SYSTEM" = "NetBSD"; then
CFLAGS="$CFLAGS `pthread-config --cflags`"
LDFLAGS="$LDFLAGS `pthread-config --ldflags`"
fi
dnl
dnl For FreeBSD we need -pthread for gcc and don't need libpthread
dnl
if test "$SYSTEM" = "FreeBSD"; then
CFLAGS="-pthread $CFLAGS"
else
AC_CHECK_LIB(pthread,pthread_create,result=yes,result=no)
if test "$result" = "yes"; then
LIBS="$LIBS -lpthread"
fi
fi fi
@ -182,6 +164,34 @@ if test "$result" = "yes"; then
fi fi
dnl
dnl The last library to add, according to Sun the -lpthread must be the
dnl very last library specified on the gcc command line.
dnl
dnl
dnl On NetBSD we need to add the pkg dirs for posix threads
dnl
if test "$SYSTEM" = "NetBSD"; then
CFLAGS="$CFLAGS `pthread-config --cflags`"
LDFLAGS="$LDFLAGS `pthread-config --ldflags`"
fi
dnl
dnl For FreeBSD we need -pthread for gcc and don't need libpthread
dnl
if test "$SYSTEM" = "FreeBSD"; then
CFLAGS="-pthread $CFLAGS"
else
AC_CHECK_LIB(pthread,pthread_create,result=yes,result=no)
if test "$result" = "yes"; then
LIBS="$LIBS -lpthread"
fi
fi
dnl dnl
dnl Checks for header files. dnl Checks for header files.
dnl dnl

View File

@ -82,13 +82,13 @@ install: all
@if [ "`id -un`" != "root" ] ; then \ @if [ "`id -un`" != "root" ] ; then \
echo; echo " Must be root to install!"; echo; exit 3; \ echo; echo " Must be root to install!"; echo; exit 3; \
fi fi
${INSTALL} -c -s -o ${OWNER} -g ${GROUP} -m 0711 mbsebbs ${BINDIR} ${INSTALL} -c -s -o ${OWNER} -g ${GROUP} -m 0711 mbsebbs ${BINDIR}
${INSTALL} -c -s -o ${OWNER} -g ${GROUP} -m 6711 mbnewusr ${BINDIR} ${INSTALL} -c -s -o ${OWNER} -g ${GROUP} -m 6711 mbnewusr ${BINDIR}
${INSTALL} -c -s -o ${OWNER} -g ${GROUP} -m 0711 mball ${BINDIR} ${INSTALL} -c -s -o ${OWNER} -g ${GROUP} -m 0711 mball ${BINDIR}
${INSTALL} -c -s -o ${OWNER} -g ${GROUP} -m 0711 mblang ${BINDIR} ${INSTALL} -c -s -o ${OWNER} -g ${GROUP} -m 0711 mblang ${BINDIR}
${INSTALL} -c -s -o ${OWNER} -g ${GROUP} -m 0711 mbstat ${BINDIR} ${INSTALL} -c -s -o ${OWNER} -g ${GROUP} -m 0711 mbstat ${BINDIR}
${INSTALL} -c -s -o ${OWNER} -g ${GROUP} -m 0711 mbtoberep ${BINDIR} ${INSTALL} -c -s -o ${OWNER} -g ${GROUP} -m 0711 mbtoberep ${BINDIR}
${INSTALL} -c -s -o `id -un` -g `id -gn` -m 6711 mbuser ${BINDIR} ${INSTALL} -c -s -o ${ROWNER} -g ${RGROUP} -m 6711 mbuser ${BINDIR}
@rm -f mbchat @rm -f mbchat
filelist: Makefile filelist: Makefile

View File

@ -33,7 +33,7 @@ install: all
@if [ "`id -un`" != "root" ] ; then \ @if [ "`id -un`" != "root" ] ; then \
echo; echo " Must be root to install!"; echo; exit 3; \ echo; echo " Must be root to install!"; echo; exit 3; \
fi fi
${INSTALL} -c -s -o `id -un` -g `id -gn` -m 6755 mbtask ${BINDIR} ${INSTALL} -c -s -o ${ROWNER} -g ${RGROUP} -m 6755 mbtask ${BINDIR}
@if [ ! -f ${ETCDIR}/issue ]; then \ @if [ ! -f ${ETCDIR}/issue ]; then \
${INSTALL} -c -o ${OWNER} -g ${GROUP} -m 0644 issue ${ETCDIR} ; \ ${INSTALL} -c -o ${OWNER} -g ${GROUP} -m 0644 issue ${ETCDIR} ; \
echo "${INSTALL} -c -o ${OWNER} -g ${GROUP} -m 0644 issue ${ETCDIR}"; \ echo "${INSTALL} -c -o ${OWNER} -g ${GROUP} -m 0644 issue ${ETCDIR}"; \

View File

@ -597,9 +597,6 @@ void *cmd_thread(void)
pfd.events = POLLIN; pfd.events = POLLIN;
pfd.revents = 0; pfd.revents = 0;
rc = poll(&pfd, 1, 1000); rc = poll(&pfd, 1, 1000);
#ifdef USE_EXPERIMENT
Syslog('c', "cmd_thread: poll interrupted rc=%d events=%04x", rc, pfd.revents);
#endif
if (rc == -1) { if (rc == -1) {
/* /*
* Poll can be interrupted by a finished child so that's not a real error. * Poll can be interrupted by a finished child so that's not a real error.
@ -615,9 +612,6 @@ void *cmd_thread(void)
memset(&buf, 0, sizeof(buf)); memset(&buf, 0, sizeof(buf));
fromlen = sizeof(from); fromlen = sizeof(from);
rlen = recvfrom(sock, buf, sizeof(buf) -1, 0, (struct sockaddr *)&from, &fromlen); rlen = recvfrom(sock, buf, sizeof(buf) -1, 0, (struct sockaddr *)&from, &fromlen);
#ifdef USE_EXPERIMENT
Syslog('c', "rcvd: \"%s\"", printable(buf, 0));
#endif
do_cmd(buf); do_cmd(buf);
} else { } else {
Syslog('-', "Return poll rc=%d, events=%04x", rc, pfd.revents); Syslog('-', "Return poll rc=%d, events=%04x", rc, pfd.revents);

View File

@ -50,10 +50,10 @@ install:
echo "${INSTALL} -c -o ${OWNER} -g ${GROUP} -m 0755 editor ${BINDIR}" ; \ echo "${INSTALL} -c -o ${OWNER} -g ${GROUP} -m 0755 editor ${BINDIR}" ; \
fi fi
@if [ -d ${JOELIB} ]; then \ @if [ -d ${JOELIB} ]; then \
${INSTALL} -c -o root -g root -m 0644 bbsjoerc ${JOELIB} ; \ ${INSTALL} -c -o ${ROWNER} -g ${RGROUP} -m 0644 bbsjoerc ${JOELIB} ; \
echo "${INSTALL} -c -o root -g root -m 0644 bbsjoerc ${JOELIB}" ; \ echo "${INSTALL} -c -o ${ROWNER} -g ${RGROUP} -m 0644 bbsjoerc ${JOELIB}" ; \
${INSTALL} -c -o root -g root -m 0644 bbsjmacsrc ${JOELIB} ; \ ${INSTALL} -c -o ${ROWNER} -g ${RGROUP} -m 0644 bbsjmacsrc ${JOELIB} ; \
echo "${INSTALL} -c -o root -g root -m 0644 bbsjmacsrc ${JOELIB}" ; \ echo "${INSTALL} -c -o ${ROWNER} -g ${RGROUP} -m 0644 bbsjmacsrc ${JOELIB}" ; \
fi fi
@if [ ! -x ${BINDIR}/bbsdoor.sh ]; then \ @if [ ! -x ${BINDIR}/bbsdoor.sh ]; then \
${INSTALL} -c -o ${OWNER} -g ${GROUP} -m 0755 bbsdoor.sh ${BINDIR} ; \ ${INSTALL} -c -o ${OWNER} -g ${GROUP} -m 0755 bbsdoor.sh ${BINDIR} ; \

View File

@ -44,9 +44,9 @@ install: all
@if [ "`id -un`" != "root" ] ; then \ @if [ "`id -un`" != "root" ] ; then \
echo; echo " Must be root to install!"; echo; exit 3; \ echo; echo " Must be root to install!"; echo; exit 3; \
fi fi
${INSTALL} -c -s -o `id -un` -g `id -gn` -m 6711 mbuseradd ${BINDIR} ${INSTALL} -c -s -o ${ROWNER} -g ${RGROUP} -m 6711 mbuseradd ${BINDIR}
${INSTALL} -c -s -o `id -un` -g `id -gn` -m 6711 mbpasswd ${BINDIR} ${INSTALL} -c -s -o ${ROWNER} -g ${RGROUP} -m 6711 mbpasswd ${BINDIR}
${INSTALL} -c -s -o `id -un` -g `id -gn` -m 0755 mblogin ${BINDIR} ${INSTALL} -c -s -o ${ROWNER} -g ${RGROUP} -m 0755 mblogin ${BINDIR}
@if [ ! -f ${ETCDIR}/login.defs ] ; then \ @if [ ! -f ${ETCDIR}/login.defs ] ; then \
${INSTALL} -c -o ${OWNER} -g ${GROUP} -m 0644 login.defs ${ETCDIR} ; \ ${INSTALL} -c -o ${OWNER} -g ${GROUP} -m 0644 login.defs ${ETCDIR} ; \
echo "${INSTALL} -c -o ${OWNER} -g ${GROUP} -m 0644 login.defs ${ETCDIR}" ; \ echo "${INSTALL} -c -o ${OWNER} -g ${GROUP} -m 0644 login.defs ${ETCDIR}" ; \