Sam wrote:
> > In file included from /usr/include/sys/time.h:198,
> > from /Users/fc/PDsrc/clisp/src/gllib/sys/time.h:39,
> > from /Users/fc/PDsrc/clisp/src/gllib/sys/select.h:59,
> > from /usr/include/unistd.h:515,
> > from /Users/fc/PDsrc/clisp/src/gllib/unistd.h:44,
> > from /Users/fc/PDsrc/clisp/src/gllib/stdlib.h:90,
> > from ../utils/comment5.c:29:
> > /Users/fc/PDsrc/clisp/src/gllib/time.h:469: error: syntax error before
> > ‘__timer’
> > /Users/fc/PDsrc/clisp/src/gllib/time.h:491: error: syntax error before
> > ‘__timer’
> > make: *** [comment5] Error 1
> >
> > The context of the offending line is:
> > # else
> > # if ! 0
> > _GL_FUNCDECL_SYS (localtime_r, struct tm *, (time_t const *restrict __timer,
> > struct tm *restrict __result)
> > _GL_ARG_NONNULL ((1, 2)));
> > # endif
>
> I think this is a gnulib problem (or, rather, my misuse thereof).
> Bruno, how did I screw up this time? :-(
The problem here is (most likely) that 'restrict' expands to something the
compiler doesn't understand.
But why is comment5.c including headers from gllib/ at all?
makemake.in is careful to distinguish native compilation (CC, CPPFLAGS, CFLAGS)
and cross-compilation (XCC, XCPPFLAGS, XCFLAGS). The values that configure
has determined are for the cross-compiler, i.e. for all source files that
include lispbibl.c or genclisp.h. These findings of configure do _not_
apply to the native compiler, that is used for compiling utils/comment5.c.
For this reason,
- comment5.c must not include config.h,
- comment5 must not be compiled with -I gllib,
- comment5 must not be linked with libgnu.a.
If you follow this rule, you will not get an
"undefined reference to `rpl_malloc'".
makemake.in may surely need one or more tweaks to fulfil this separation
between native and cross compilations.
Bruno
--
In memoriam Ludwig Beck <http://en.wikipedia.org/wiki/Ludwig_Beck&gt;