From owner-freebsd-ports Wed Dec 18 0:50:57 2002 Delivered-To: freebsd-ports@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id A967637B401; Wed, 18 Dec 2002 00:50:53 -0800 (PST) Received: from phalanx.trit.org (phalanx.trit.org [63.198.170.138]) by mx1.FreeBSD.org (Postfix) with ESMTP id 6D77643EDC; Wed, 18 Dec 2002 00:50:52 -0800 (PST) (envelope-from dima@trit.org) Received: from harpoon.trit.org (harpoon.trit.org [192.168.4.193]) by phalanx.trit.org (Postfix) with ESMTP id 1B3121A026; Wed, 18 Dec 2002 08:50:52 +0000 (UTC) Received: from harpoon.trit.org (localhost [127.0.0.1]) by harpoon.trit.org (8.12.6/8.12.5) with ESMTP id gBI8opnY023282; Wed, 18 Dec 2002 08:50:51 GMT (envelope-from dima@trit.org) Received: (from dima@localhost) by harpoon.trit.org (8.12.6/8.12.6/Submit) id gBI8ooMV023281; Wed, 18 Dec 2002 08:50:50 GMT X-Authentication-Warning: harpoon.trit.org: dima set sender to dima@trit.org using -f Date: Wed, 18 Dec 2002 08:50:50 +0000 From: Dima Dorfman To: Clive Lin Cc: ports@freebsd.org, portmgr@freebsd.org Subject: Re: ports/45755: /usr/ports/net/dictd does not build, at least on 4.7-RELEASE Message-ID: <20021218085050.GA23253@trit.org> References: <200212180830.gBI8U4V8042817@freefall.freebsd.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <200212180830.gBI8U4V8042817@freefall.freebsd.org> User-Agent: Mutt/1.4i Sender: owner-freebsd-ports@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.org [cc'd to ports in the hope that someone will make portmgr reply] Clive Lin wrote: > > cc -c -Ilibmaa -DHAVE_CONFIG_H -I. -O -pipe -I/usr/local/include -DDICT_VERSION=\"1.8.0\" -DDICT_CONFIG_PATH=\"/usr/local/etc/\" index.c > > In file included from index.c:26: > > utf8_ucs4.h:26: syntax error before `wint_t' > > utf8_ucs4.h:34: syntax error before `ucs4' > > index.c: In function `tolower_alnumspace_utf8': > > index.c:114: syntax error before `ucs4_char' > > index.c:117: `ucs4_char' undeclared (first use in this function) > > index.c:117: (Each undeclared identifier is reported only once > > index.c:117: for each function it appears in.) > > gmake: *** [index.o] Error 1 > > *** Error code 2 > > > > Stop in /usr/ports/net/dictd. > > netcom1# > > I think it's impossible to fix dictd on RELENG_4. I beg to differ. The attached patch makes it compile on RELENG_4, but possibly breaks UTF8 dictionaries (I haven't tried). It does not affect functionality on 5.0. I've sent this to portmgr three times (this message is the fourth), but have heard no reply. I think breaking a new feature is better than breaking it completely. If someone wants to use UTF8 dictionaries, they can install 5.0--we need more testers anyway. For most people, it will work just fine. E.g.: dima@harpoon% dict -Ih dict.trit.org dictd 1.8.0/rf on FreeBSD 4.7-STABLE On phalanx.trit.org: up 16+10:16:01, 987 forks (2.5/hour) Index: patch-break-utf8 =================================================================== RCS file: patch-break-utf8 diff -N patch-break-utf8 --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ patch-break-utf8 1 Dec 2002 22:45:21 -0000 @@ -0,0 +1,98 @@ +diff -ru ../dictd-freebsd/dictd.c ./dictd.c +--- ../dictd-freebsd/dictd.c Sun Nov 24 09:35:55 2002 ++++ ./dictd.c Sun Dec 1 22:29:55 2002 +@@ -662,6 +662,7 @@ + + static void set_utf8_mode (const char *locale) + { ++#if __FreeBSD__ > 4 + char *locale_copy; + locale_copy = strdup (locale); + strlwr_8bit (locale_copy); +@@ -671,6 +672,9 @@ + strstr (locale_copy, "utf8"); + + free (locale_copy); ++#else ++ utf8_mode = 0; ++#endif + } + + static void init (const char *fn) +diff -ru ../dictd-freebsd/index.c ./index.c +--- ../dictd-freebsd/index.c Sun Dec 1 22:12:49 2002 ++++ ./index.c Sun Dec 1 22:25:06 2002 +@@ -111,6 +111,9 @@ + const char *src, char *dest, + int allchars_mode) + { ++#if __FreeBSD__ < 5 ++ abort(); ++#else + wint_t ucs4_char; + + while (src && src [0]){ +@@ -130,6 +133,7 @@ + *dest = 0; + + return (src != NULL); ++#endif + } + + static void dict_table_init(void) +@@ -166,9 +170,11 @@ + p[i] = &s[2 * i]; + } + /* Sort those strings in the locale */ ++#if __FreeBSD__ > 4 + if (utf8_mode) + qsort(p, UCHAR_MAX + 1, sizeof(p[0]), dict_table_init_compare_utf8); + else ++#endif + qsort(p, UCHAR_MAX + 1, sizeof(p[0]), dict_table_init_compare_strcoll); + + /* Extract our unordered arrays */ +@@ -1126,6 +1132,9 @@ + */ + static int stranagram_utf8 (char *str) + { ++#if __FreeBSD__ < 5 ++ abort(); ++#else + size_t len; + char *p; + +@@ -1142,6 +1151,7 @@ + + stranagram_8bit (str, -1); + return 1; ++#endif + } + + /* makes anagram of utf-8 string 'str' */ +diff -ru ../dictd-freebsd/utf8_ucs4.c ./utf8_ucs4.c +--- ../dictd-freebsd/utf8_ucs4.c Sun Nov 24 09:35:55 2002 ++++ ./utf8_ucs4.c Sun Dec 1 22:44:40 2002 +@@ -1,3 +1,4 @@ ++#if __FreeBSD__ > 4 + #include + #include + #include +@@ -210,3 +211,4 @@ + else + return (size_t) -1; + } ++#endif // __FreeBSD__ > 4 +diff -ru ../dictd-freebsd/utf8_ucs4.h ./utf8_ucs4.h +--- ../dictd-freebsd/utf8_ucs4.h Sun Nov 24 09:35:55 2002 ++++ ./utf8_ucs4.h Sun Dec 1 22:26:15 2002 +@@ -1,3 +1,4 @@ ++#if __FreeBSD__ > 4 + #ifndef _UTF8_UCS4_H_ + #define _UTF8_UCS4_H_ + +@@ -73,3 +74,4 @@ + __END_DECLS + + #endif // _UTF8_UCS4_H_ ++#endif // __FreeBSD__ > 4 To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-ports" in the body of the message