1 I've learned I'm not yet clever enough to get IkiWiki to build in OpenSolaris (as running on a [Joyent Accelerator][ja]). Anyone figured this out already?
3 I think problem lies mostly, if not entirely, in getting ikiwiki.cgi.c to compile in an OpenSolaris context (this is ikiwiki-2.2):
5 > <code>$ ikiwiki --setup ~/etc/ikiwiki/ikiwiki-edit.setup
7 > Error: failed to compile /home/username/domains/domain.tld/cgi-bin/ikiwiki.cgi.c at /opt/local/lib/perl5/site_perl/IkiWiki.pm line 104.
8 BEGIN failed--compilation aborted at (eval 3) line 145.</code>
12 > <code>$ /usr/sfw/bin/gcc ikiwiki.cgi.c
13 > Undefined first referenced
15 > asprintf /var/tmp//cczPaG7R.o
16 > ld: fatal: Symbol referencing errors. No output written to a.out
17 > collect2: ld returned 1 exit status</code>
19 [ja]: <http://www.joyent.com/accelerator/technical-specifications/>
21 Thanks, Joey et al., for a really cool tool.
25 > Looks like the ikiwiki wrapper uses asprintf. glibc has that, and I think some other libc implementations have that, but apparently the Solaris libc does not. The same problem will come up on other platforms that don't use glibc. The ikiwiki wrapper needs to either avoid asprintf or use a portable asprintf implementation from somewhere like gnulib. --[[JoshTriplett]]
27 >> I used asprintf because it was easy, and safe. That is a good reason for
28 >> C libraries to support asprintf, IMHO. Note that both linux and *BSD
31 >> Of the possible patches to make this more portable, I'd generally prefer
32 >> one that uses portable functions (safely), rather than one that includes
33 >> an asprintf implementation in ikiwiki. --[[Joey]]
35 > I got ikiwiki working (sort of) on OpenSolaris today. I ran into this problem too, and wrote a version of asprintf() from scratch which uses more portable APIs:
38 #include <stdarg.h>
41 asprintf(char **string_ptr, const char *format, ...)
48 va_start(arg, format);
49 size = vsnprintf(NULL, 0, format, arg);
51 va_start(arg, format);
56 * Strictly speaking, GNU asprintf doesn't do this,
57 * but the caller isn't checking the return value.
59 fprintf(stderr, "failed to allocate memory\\n");
62 rv = vsnprintf(str, size, format, arg);
71 > I added this after the rest of the #include's in Wrapper.pm, and it seems to work. --Blake