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
OWNER = @OWNER@
GROUP = @GROUP@
ROWNER = @ROWNER@
RGROUP = @RGROUP@
MODE = 0711
SMODE = 6711

View File

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

164
configure vendored
View File

@ -309,7 +309,7 @@ ac_includes_default="\
# include <unistd.h>
#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=''
# 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"
GROUP="bbs"
OWNER="mbse"
ROWNER="`id -un root`"
RGROUP="`id -gn root`"
@ -2877,84 +2881,9 @@ else
debugging=no
fi;
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
CFLAGS="-O3 -Wall -Wshadow -Wwrite-strings -Wstrict-prototypes -D_REENTRANT -D_POSIX_PTHREAD_SEMANTICS"
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
CFLAGS="-O3 -Wall -Wshadow -Wwrite-strings -Wstrict-prototypes -D_REENTRANT"
fi
@ -4785,6 +4714,83 @@ done
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 $ECHO_N "checking for ANSI C header files... $ECHO_C" >&6
if test "${ac_cv_header_stdc+set}" = set; then
@ -9705,6 +9711,8 @@ s,@REVISION@,$REVISION,;t t
s,@COPYRIGHT@,$COPYRIGHT,;t t
s,@GROUP@,$GROUP,;t t
s,@OWNER@,$OWNER,;t t
s,@ROWNER@,$ROWNER,;t t
s,@RGROUP@,$RGROUP,;t t
s,@VERSION@,$VERSION,;t t
s,@MAKE@,$MAKE,;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"
GROUP="bbs"
OWNER="mbse"
ROWNER="`id -un root`"
RGROUP="`id -gn root`"
AC_SUBST(PACKAGE)
AC_SUBST(MAJOR)
AC_SUBST(MINOR)
@ -26,6 +28,8 @@ AC_SUBST(REVISION)
AC_SUBST(COPYRIGHT)
AC_SUBST(GROUP)
AC_SUBST(OWNER)
AC_SUBST(ROWNER)
AC_SUBST(RGROUP)
AC_PREFIX_DEFAULT(/opt/mbse)
AC_DEFINE_UNQUOTED(VERSION, "$VERSION")
AC_DEFINE_UNQUOTED(VERSION_MAJOR, $MAJOR)
@ -68,34 +72,12 @@ if test "$experiment" = "yes"; then
fi
AC_ARG_ENABLE(debugging, [ --enable-debugging Compile for debugging], [ debugging=$enableval ], [ debugging=no ])
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
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
dnl
dnl Defines for MBSE BBS (must use tests or --enable-stuff later)
dnl
@ -182,6 +164,34 @@ if test "$result" = "yes"; then
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 Checks for header files.
dnl

View File

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

View File

@ -33,7 +33,7 @@ install: all
@if [ "`id -un`" != "root" ] ; then \
echo; echo " Must be root to install!"; echo; exit 3; \
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 \
${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.revents = 0;
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) {
/*
* 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));
fromlen = sizeof(from);
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);
} else {
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}" ; \
fi
@if [ -d ${JOELIB} ]; then \
${INSTALL} -c -o root -g root -m 0644 bbsjoerc ${JOELIB} ; \
echo "${INSTALL} -c -o root -g root -m 0644 bbsjoerc ${JOELIB}" ; \
${INSTALL} -c -o root -g root -m 0644 bbsjmacsrc ${JOELIB} ; \
echo "${INSTALL} -c -o root -g root -m 0644 bbsjmacsrc ${JOELIB}" ; \
${INSTALL} -c -o ${ROWNER} -g ${RGROUP} -m 0644 bbsjoerc ${JOELIB} ; \
echo "${INSTALL} -c -o ${ROWNER} -g ${RGROUP} -m 0644 bbsjoerc ${JOELIB}" ; \
${INSTALL} -c -o ${ROWNER} -g ${RGROUP} -m 0644 bbsjmacsrc ${JOELIB} ; \
echo "${INSTALL} -c -o ${ROWNER} -g ${RGROUP} -m 0644 bbsjmacsrc ${JOELIB}" ; \
fi
@if [ ! -x ${BINDIR}/bbsdoor.sh ]; then \
${INSTALL} -c -o ${OWNER} -g ${GROUP} -m 0755 bbsdoor.sh ${BINDIR} ; \

View File

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