[darcs-devel] Curl build issues

Gwern Branwen gwern0 at gmail.com
Wed Apr 16 21:14:44 UTC 2008


On 2008.04.16 11:29:53 +0400, Dmitry Kurochkin <dmitry.kurochkin at gmail.com> scribbled 2.9K characters:
> Hi.
>
> On Wed, Apr 16, 2008 at 9:47 AM, Gwern Branwen <gwern0 at gmail.com> wrote:
> > So, my recent efforts to Cabalize Darcs have been going fairly well. I now have a setup which allows me compile from an sdist tarball through Cabal and not the GNUmakefile. But there are some puzzling problems and changes.
> >
> >  For example, while I was working on how to smuggle CPP options from the configure script to Cabal and cpp-options:, I ran into an issue with linking in Curl. The .cabal file reads, at the end:
> >
> >  >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
> >  > c-sources: src/atomic_create.c >
> >  >            src/c_compat.c      >
> >  >            src/fpstring.c      >
> >  >            src/maybe_relink.c  >
> >  >            src/umask.c         >
> >  >            src/Crypt/sha2.c    >
> >  >            src/hscurl.c        >
> >  > include-dirs:   src            >
> >  > includes: hscurl.h             >
> >  > extra-libraries: z, curl       >
> >  >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
> >
> >  Reasonable enough. We need to link them in, after all.
> >
> >  But curiously enough, this leads to the error:
> >
> >  >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
> >  > src/hscurl.c:43:0:                                       >
> >  >      error: expected ',' or ';' before 'PACKAGE_VERSION' > >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
> >
> >  (If one attempts to omit some of the cabal entries, that will just cause link errors at the end.)
> >
> >  I noticed in hslibwww.c that the analogous line had only one variable in it, so I tried making the following change:
>
> And hslibwww.c compiles fine without changes? That is strange because
> it is used there:
>
> static const char darcs_version[] = PACKAGE_VERSION;
...

Well, I don't find that odd at all. As far as I can tell, there is something syntactically wrong with the C file, not semantically. If I try to compile it with GCC all by itself, I would expect it to error out on various import and definition problems, as the function and variable names wouldn't *mean* anything without a larger context. But I instead get:

 gwern at localhost:1108~/darcs>gcc src/hscurl.c [ 5:09PM]
 src/hscurl.c:43: error: expected ‘,’ or ‘;’ before ‘PACKAGE_VERSION’

I mean, it's not even getting through the parsing stage there; how could it be worrying about whether PACKAGE_VERSION means anything? And as you say, it works fine in the other case.

--
gwern
napalm Lander Wackenhutt USCODE ISDS NIOG BUDS Tzvrif 3210 NAVWAN
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: not available
Url : http://lists.osuosl.org/pipermail/darcs-devel/attachments/20080416/fa495a07/attachment-0001.pgp 


More information about the darcs-devel mailing list