git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: git build failure with libssl (OpenSSL) in custom directory

From
Jonathan Nieder <jrnieder@gmail.com>
Date
Nov 18, 2010, 18:24 UTC
Message-ID
<20101118182447.GF16610@burratino>
In-Reply-To
<AANLkTikZBcmbFoCmqT-eorGm3R0YYjkzotc414w_PHyd@mail.gmail.com>
Lars Buitinck wrote:
> Yes, that works fine with LDFLAGS= in the Makefile. Is this just a
> lack of Makefile-fu on my part?

In general, "make" likes to get its variable assignments on the command line rather than from the environment. This way, Makefile authors do not have to worry about keeping variable names in a tightly reined namespace.

On the other hand, it can be convenient to set up the environment with flags that would be used for multiple builds. Different projects deal with that differently:

./configure takes certain values (including LDFLAGS) from the environment in autotools-using projects. ./configure --help=short lists them.

The Linux kernel build system has a separate (namespaced) set of variables it reads from the environment. Example: exporting KBUILD_OUTPUT=$HOME/.cache/linux-2.6 in .profile would save me from typing "make O=$HOME/.cache/linux-2.6" every time I build the kernel. They are documented in Documentation/kbuild/kbuild.txt.

Git reads settings from a config.mak file in the toplevel of the git source tree. So one can set

	LDFLAGS = -L$(HOME)/opt/git/lib
there and it will be used for all builds.
Previous: Lars Buitinck
Message 4 of 4 in “git build failure with libssl (OpenSSL) in custom directory”
  1. Lars BuitinckNov 18, 2010
  2. Jonathan NiederNov 18, 2010
  3. Lars BuitinckNov 18, 2010
  4. Jonathan NiederNov 18, 2010

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.