[darcs-devel] Curl build issues
Gwern Branwen
gwern0 at gmail.com
Wed Apr 16 05:47:28 UTC 2008
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:
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
> 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. 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.
--
gwern
nitrite CipherTAC-2000 SEAL TEXTA Marx York Gazprom Chobetsu of 007
-------------- 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/62adf5c0/attachment.pgp
More information about the darcs-devel
mailing list