threads / discuss / 14616

Not so happy about build system

Subject: Not so happy about build system

## tl;dr

3 messages between Jul 23, 2008 and Jul 23, 2008.

replies: 2people: 2as markdown or json

Jan Engelhardt· Jul 23, 2008, 09:33 UTC · lore
Hi,

I just tried git 1.5.6.4 on a Solaris 10 box. Building mostly went smooth, but a few unhappy edges turned up:

~/git-1.5.6.4>gmake MAKE=gmake
    LINK git-daemon
ld: fatal: library -lcurl: not found
ld: fatal: library -lcrypto: not found
ld: fatal: File processing errors. No output written to git-daemon
collect2: ld returned 1 exit status
gmake: *** [git-daemon] Error 1

Of course curl is available, it's just somewhere else. And that is where the fun begins that comes with plain Makefiles.

	"What's the variable I ought to set?"

Yes, usually it is LDFLAGS, and this is also true for git. But not everyone necessarily adheres to that, and looking through the Makefile is not fun. That also reminds me of CFLAGS, which about every Makefile write happily sets to

	CFLAGS = -g -O2 -Wall -Wmy-fancy-flags

which would give no way to keep -Wmy-fancy-flags while also overriding it. Autotools solved this whereby a developer puts -Wmy-fancy-flags that shall always be present into AM_CFLAGS instead and only puts the really freely choosable flags into CFLAGS. Of course I could list all the developers flags that are needed/wanted (-Wmy-fancy-flags) like

	make CFLAGS="-Wdevelopers-fancy-flags -O3 -g0"

but one would have to look them up first and and etc. Ok, enough Makefile ramblings, as there seems to be a configure script lurking. What's the Makefile good for then if configure will create it anyway?

Trying my luck with configure, I call
	./configure --prefix=$HOME/rt --with-openssl=/opt/csw 
	--with-curl=/opt/csw

but what I get is that it obviously did not find neither openssl nor curl, though they do exist in /opt/csw/include and /opt/csw/lib:

	checking for SHA1_Init in -lcrypto... no
	checking for SHA1_Init in -lssl... no
	checking for curl_global_init in -lcurl... no
	checking for XML_ParserCreate in -lexpat... no
(someone please fix that)
	./configure --prefix=$HOME/rt --with-openssl=/opt/csw 
	--with-curl=/opt/csw CFLAGS="-O2 -I/opt/csw/include -L/opt/csw/lib 
	-R/opt/csw/lib"
# using /usr/ccs/bin/ld, not GNU ld
That finally made it succeed in finding SHA1_Init. Then however,
	~/git-1.5.6.4>make
	make: Fatal error in reader: Makefile, line 158: Unexpected end 
	of line seen

So configure did not create a POSIX-compatible Makefile. Ok, I had gmake, so the story is successfully done here :)

Miklos Vajna· Jul 23, 2008, 10:33 UTC · re: Jan Engelhardt · lore

Re: Not so happy about build system

On Wed, Jul 23, 2008 at 11:33:56AM +0200, Jan Engelhardt <jengelh@medozas.de> wrote:
> 	./configure --prefix=$HOME/rt --with-openssl=/opt/csw 
> 	--with-curl=/opt/csw CFLAGS="-O2 -I/opt/csw/include -L/opt/csw/lib 
> 	-R/opt/csw/lib"
Why do you put -L/opt/csw/lib to CFLAGS instead of LDFLAGS?
Jan Engelhardt· Jul 23, 2008, 11:04 UTC · re: Miklos Vajna · lore

Re: Not so happy about build system

On Wednesday 2008-07-23 12:33, Miklos Vajna wrote:
Show 7 quoted lines
>On Wed, Jul 23, 2008 at 11:33:56AM +0200, Jan Engelhardt <jengelh@medozas.de> wrote:
>> 	./configure --prefix=$HOME/rt --with-openssl=/opt/csw 
>> 	--with-curl=/opt/csw CFLAGS="-O2 -I/opt/csw/include -L/opt/csw/lib 
>> 	-R/opt/csw/lib"
>
>Why do you put -L/opt/csw/lib to CFLAGS instead of LDFLAGS?
>

Oversight I guess. Had --with-{openssl,curl} any effect, I would not even need the -I and -L.

← back to recent threads