[darcs-devel] Curl build issues
Dmitry Kurochkin
dmitry.kurochkin at gmail.com
Wed Apr 16 07:29:53 UTC 2008
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;
>
> >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
> > hunk ./src/hscurl.c 43 >
> > - "darcs/" PACKAGE_VERSION " libcurl/" LIBCURL_VERSION; >
> > + " libcurl/" LIBCURL_VERSION; > >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
>
> And then darcs built and linked and could do darcs pulls without a problem.
The above code sets user-agent. So darcs would work perfectly without it.
> I've tried looking into the makefile to see what magic it is doing that it will compile unmodified, but I only saw:
>
> >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
> > ifeq ($(HAVE_LIBCURL),True) >
> > C_OBJS += src/hscurl.o >
> > GHCFLAGS += -DHAVE_CURL >
> > endif >
> >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
>
> and I don't know what good that does.
PACKAGE_VERSION comes from configure script:
PACKAGE_VERSION='2.0.0pre3'
And it is put into DEFS var. And passed to GHC as:
-optc-DPACKAGE_VERSION=\"2.0.0pre3\"
Looks like like with cabal this define is not passed. Or it has some
unexpected value.
Regards,
Dmitry
>
> --
> gwern
> nitrite CipherTAC-2000 SEAL TEXTA Marx York Gazprom Chobetsu of 007
>
> _______________________________________________
> darcs-devel mailing list
> darcs-devel at darcs.net
> http://lists.osuosl.org/mailman/listinfo/darcs-devel
>
>
More information about the darcs-devel
mailing list