Notes on making gtk-gnutella 0.93.3 stable build on OpenBSD 3.3
Original: January 27, 2004
Updated: January 31, 2004
Sections
Background
I hadn't used gnutella in awhile, and when I did I noticed that not only were there notices about a newer version but the newer clients were refusing to connect with gtk-gnutella-0.91.1. Of course I prefer to use official ports but that hasn't been updated at the time of this writing. Visitting the official gtk-gnutella homepage I see that:
Some serious bugs have been found in 0.93.1 and 0.93.2. A feature freeze is in place and a bugfix 0.93.3 release is expected soon.
And also the 0.93.3 stable source was available for download, so I went about trying to make that compile and install on my OpenBSD 3.3 patched system. When finished the program seems just fine and stable even, staying up overnight a couple times as a test.
Instructions
Now this isn't the proper fix and as such I've not created a patch. But it does get the source compiled and working on my system anyway. I'm outlining the steps in case it helps someone else to get the safer version of this software working on their system also. Note that the defaults during the ./Configure step result in the same warnings/errors on both OpenBSD 3.3 and 3.4 patch branch systems, and both systems build the software fine with the same workarounds that follow.
Notes
After downloading and bunziping the source, these are the notes I took while making gtk-gnutella 0.93.3 stable build on an OpenBSD 3.3 patch-branch system. They're here mainly as notes to myself in making more straightforward instructions.
cc -c -I.. -I/usr/local/include/gtk-1.2 -I/usr/local/include/glib-1.2 -I/usr/X11R6/include -I/usr/local/include -O2 utf8.c utf8.c: In function `locale_charset': utf8.c:529: `CODESET' undeclared (first use in this function) utf8.c:529: (Each undeclared identifier is reported only once utf8.c:529: for each function it appears in.) utf8.c: In function `g_iconv_complete': utf8.c:680: warning: passing arg 2 of `libiconv' from incompatible pointer type *** Error code 1 Stop in /home/anubis/gtk-gnutella-0.93.3/src. Making all in pixmaps... Making all in po...
extern size_t iconv (iconv_t cd, const char* * inbuf, size_t *inbytesleft, char* * outbuf, size_t *outbytesleft);so it seems the error above is a result of the char pointer not being const? so in src/utf8.c I change g_iconv_complete to:
static inline char *g_iconv_complete(GIConv cd,
const char *inbuf,
size_t inbytes_left,
char *outbuf,
size_t outbytes_left)
to get rid of that warning, then try to tackle the actual error.
anubis@ariel$ grep -r nl_langinfo /usr/local/include/*.h anubis@ariel$ grep -r CODESET /usr/local/include/*.h anubis@ariel$ grep -r nl_langinfo /usr/include/*.h /usr/include/langinfo.h:char *nl_langinfo(nl_item);and find that it depends on nl_item:
char *nl_langinfo(nl_item);but of course that's not defined there =) in /usr/include/nl_types.h it is simply a typedef to long, so... what should it's value be?
cs = nl_langinfo(CODESET)looking for a result on that page, such as: US-ASCII using a CODESET of 3 from the MIB defined on the IANA character-sets page, so in src/utf8.h I added:
#define CODESET 3and got past that error!
cc -o gtk-gnutella (skip a screenfull of object files) utf8.o: Undefined symbol `_libiconv_open' referenced (use -liconv ?) utf8.o: Undefined symbol `_libiconv' referenced (use -liconv ?) collect2: ld returned 1 exit status *** Error code 1 Stop in /home/anubis/gtk-gnutella-0.93.3/src (line 398 of Makefile). Making all in pixmaps... Making all in po...
Any additional libraries? [-lz -lintl -lresolv] -lz -lintl -lresolv -liconvThen after the warnings from make depend, make the changes listed above where needed (use /usr/bin/mkdep during Configure, and modify config.h to use the BSD value from sys/params.h)
make sudo make installall looks good so far, now to run it ...
1
Apparently the IANA naming convention used by gtk-gnutella in this case is GNU-specific. After digging around a little on the NetBSD mailing list from the post mentioned above, all I could do is point to additional discussion on it.