# arch-tag: automatic-ChangeLog--srvx@srvx.net--2006/srvx--devo--1.3
#
+2006-04-05 00:05:59 GMT Michael Poole <mdpoole@troilus.org> patch-3
+
+ Summary:
+ Update configure.in; support both baz and tla; avoid using dirent.
+ Revision:
+ srvx--devo--1.3--patch-3
+
+ configure.in: Remove AC_PROG_RANLIB since we never use ranlib. Add
+ AC_PROG_LIBTOOL since we do use libtool. Set GNU_ARCH and
+ HAS_GNU_ARCH based on whether the system has baz or tla. Do not
+ check for dirent.d_type.
+
+ src/Makefile.am: Make the "checkversion" target conditional on
+ HAS_GNU_ARCH, and use the detected $(GNU_ARCH).
+
+ src/helpfile.c (language_read): Report error text when unable to open a
+ language directory.
+ (language_read_list): Always stat the language entry to determine
+ whether it is a directory; Cygwin has no dirent.d_type and ReiserFS
+ has a broken one.
+
+ modified files:
+ ChangeLog configure.in src/Makefile.am src/helpfile.c
+
+
2006-04-05 00:00:57 GMT Michael Poole <mdpoole@troilus.org> patch-2
Summary:
dnl Checks for programs.
AC_PROG_AWK
AC_PROG_CC
-AC_PROG_RANLIB
AC_PROG_INSTALL
+AC_PROG_LIBTOOL
AC_PROG_LN_S
AC_PROG_MAKE_SET
AC_PROG_GCC_TRADITIONAL
+dnl Look for a GNU Arch program
+AC_CHECK_PROGS(GNU_ARCH, [baz tla])
+AM_CONDITIONAL(HAS_GNU_ARCH, test z$GNU_ARCH != z)
+
dnl nice that unixes can all follow a standard.
case $target in
*-freebsd2* | *-freebsdelf2* | *-freebsd*out3*)
dnl Would rather not bail on headers, BSD has alot of the functions elsewhere. -Jedi
AC_CHECK_HEADERS(fcntl.h malloc.h netdb.h netinet/in.h sys/resource.h sys/timeb.h sys/times.h sys/param.h sys/socket.h sys/time.h sys/types.h sys/wait.h unistd.h getopt.h memory.h regex.h arpa/inet.h sys/mman.h sys/stat.h dirent.h,,)
-dnl Cygwin does not have d_type in struct dirent. We use stat() as a fallback.
-AC_CHECK_MEMBER([struct dirent.d_type],
- [AC_DEFINE(HAVE_DIRENT_D_TYPE, 1, [Define if struct dirent exists and includes the d_type element.])],,[#include <dirent.h>])
-
dnl portability stuff, hurray! -Jedi
AC_CHECK_MEMBER([struct sockaddr.sa_len],
[AC_DEFINE([HAVE_SOCKADDR_SA_LEN],,[Define if struct sockaddr has sa_len field])],
BUILT_SOURCES = arch-version.h
noinst_HEADERS = arch-version.h
+if HAS_GNU_ARCH
.PHONY: checkversion
arch-version.h: checkversion
checkversion:
- @tla logs -f >/dev/null || exit 0; \
+ @$(GNU_ARCH) logs -f >/dev/null || exit 0; \
TMPFILE=`mktemp arch-version.h.XXXXXX` || exit 1 ; \
- echo "#define ARCH_VERSION \"`tla logs -f | tail -n 1`\"" >> $$TMPFILE ; \
+ echo "#define ARCH_VERSION \"`$(GNU_ARCH) logs -f | tail -n 1`\"" >> $$TMPFILE ; \
if diff -q arch-version.h $$TMPFILE >/dev/null 2>&1 ; then \
rm $$TMPFILE ; \
else \
rm -f arch-version.h ; \
mv $$TMPFILE arch-version.h ; \
fi
+endif
EXTRA_srvx_SOURCES = alloc-slab.c alloc-srvx.c proto-bahamut.c proto-common.c proto-p10.c mod-snoop.c mod-memoserv.c mod-helpserv.c mod-sockcheck.c
srvx_LDADD = @MODULE_OBJS@
/* Open the directory stream; if we can't, fail. */
snprintf(filename, sizeof(filename), "languages/%s", name);
- if (!(dir = opendir(filename)))
+ if (!(dir = opendir(filename))) {
+ log_module(MAIN_LOG, LOG_ERROR, "Unable to open language directory languages/%s: %s", name, strerror(errno));
return NULL;
+ }
if (!(lang = dict_find(languages, name, NULL)))
lang = language_alloc(name);
static void language_read_list(void)
{
+ struct stat sbuf;
struct dirent *dirent;
DIR *dir;
+ char namebuf[MAXLEN];
if (!(dir = opendir("languages")))
return;
while ((dirent = readdir(dir))) {
if (dirent->d_name[0] == '.')
continue;
-#ifdef HAVE_DIRENT_D_TYPE
- if (dirent->d_type != DT_DIR)
+ snprintf(namebuf, sizeof(namebuf), "languages/%s", dirent->d_name);
+ if (stat(namebuf, &sbuf) < 0) {
+ log_module(MAIN_LOG, LOG_INFO, "Skipping language entry '%s' (unable to stat).", dirent->d_name);
+ continue;
+ }
+ if (!S_ISDIR(sbuf.st_mode)) {
+ log_module(MAIN_LOG, LOG_INFO, "Skipping language entry '%s' (not directory).", dirent->d_name);
continue;
-#else
- {
- char namebuf[MAXLEN];
- struct stat sbuf;
- snprintf(namebuf, sizeof(namebuf), "languages/%s", dirent->d_name);
- if (stat(namebuf, &sbuf) < 0)
- continue;
- if (!S_ISDIR(sbuf.st_mode))
- continue;
}
-#endif
language_alloc(dirent->d_name);
}
closedir(dir);