From 7699e371d7119cd7238f14b82200254f9d607f28 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Wilfried=20G=C3=B6esgens?= Date: Mon, 12 Jan 2009 22:08:10 +0000 Subject: [PATCH] + link gettext.c into setup, so we know the servers locales + add dummy functions we don't have in setup.c --- webcit/Makefile.in | 5 +++-- webcit/configure.ac | 1 + webcit/gettext.c | 7 +++---- webcit/setup.c | 15 ++++++++++++++- webcit/wc_gettext.h | 8 ++++++++ 5 files changed, 29 insertions(+), 7 deletions(-) diff --git a/webcit/Makefile.in b/webcit/Makefile.in index bb2e11ebe..d75761da0 100644 --- a/webcit/Makefile.in +++ b/webcit/Makefile.in @@ -36,8 +36,9 @@ distclean: clean po/Makefile \ $(srcdir)/TAGS -setup: setup.o - $(CC) $(LDFLAGS) $(LIBOBJS) $(LIBS) $(SETUP_LIBS) setup.o -o setup +setup: setup.o gettext.o + $(CC) $(LDFLAGS) $(LIBOBJS) $(LIBS) $(SETUP_LIBS) \ + gettext.o setup.o -o setup webcit: webserver.o context_loop.o ical_dezonify.o \ cookie_conversion.o locate_host.o floors.o summary.o \ diff --git a/webcit/configure.ac b/webcit/configure.ac index 8f922ff66..61353f819 100644 --- a/webcit/configure.ac +++ b/webcit/configure.ac @@ -183,6 +183,7 @@ AC_CHECK_HEADER(libcitadel.h, [AC_CHECK_LIB(citadel, libcitadel_version_string, [ LIBS="-lcitadel $LIBS" + SETUP_LIBS="-lcitadel $SETUP_LIBS" ], [ AC_MSG_ERROR(libcitadel was not found or is not usable. Please install libcitadel.) diff --git a/webcit/gettext.c b/webcit/gettext.c index 930d9df38..e486fc4d9 100644 --- a/webcit/gettext.c +++ b/webcit/gettext.c @@ -6,10 +6,6 @@ #include "webserver.h" #ifdef ENABLE_NLS - -#define NUM_LANGS 10 /* how many different locales do we know? */ -#define SEARCH_LANG 20 /* how many langs should we parse? */ - /* actual supported locales */ const char *AvailLang[NUM_LANGS] = { "C", @@ -306,6 +302,9 @@ void ShutdownLocale(void) } #else /* ENABLE_NLS */ +const char *AvailLang[NUM_LANGS] = { + "C"}; + /** \brief dummy for non NLS enabled systems */ void tmplput_offer_languages(StrBuf *Target, WCTemplputParams *TP) { diff --git a/webcit/setup.c b/webcit/setup.c index 25690cee1..961177474 100644 --- a/webcit/setup.c +++ b/webcit/setup.c @@ -21,6 +21,18 @@ char setup_directory[SIZ]; int using_web_installer = 0; char suggested_url[SIZ]; +/* some copies... */ +int lprintf(int loglevel, const char *format, ...){return 0;} +void RegisterNS(const char *NSName, long len, + int nMinArgs, + int nMaxArgs, + WCHandlerFunc HandlerFunc, + int ContextRequired){} +pthread_key_t MyConKey; + +#include "wc_gettext.h" + + /* * Delete an entry from /etc/inittab */ @@ -445,7 +457,8 @@ void install_init_scripts(void) } - fp = fopen(initfile, "w"); +/// fp = fopen(initfile, "w"); + fp = stderr;/// TODO: weg fprintf(fp, "#!/bin/sh\n" "\n" diff --git a/webcit/wc_gettext.h b/webcit/wc_gettext.h index 5aee1f154..c976b8c2f 100644 --- a/webcit/wc_gettext.h +++ b/webcit/wc_gettext.h @@ -1,6 +1,14 @@ #ifdef ENABLE_NLS void initialize_locales(void); void ShutdownLocale(void); + +#define NUM_LANGS 10 /* how many different locales do we know? */ +#define SEARCH_LANG 20 /* how many langs should we parse? */ + +/* actual supported locales */ +extern const char *AvailLang[NUM_LANGS]; +#else +#define NUM_LANGS 1 /* how many different locales do we know? */ #endif void TmplGettext(StrBuf *Target, WCTemplputParams *TP); void offer_languages(StrBuf *Target, int nArgs, WCTemplateToken *Token, void *Context, int ContextType); -- 2.30.2