Subject: Re: [PATCH v2 1/2] Makefile: add NO_HOMEBREW

From: Junio C Hamano <[email-masked]>
Date: Sun, 14 Dec 2025 20:07:02 +0900

Torsten Bögershausen <[email-masked]> writes:

> The main question is still, where the HOMEBREW_XXX variables
> are used ?
> I see that we define them in config.mak.uname
> ...I understand these are purely _our_ thing
> That is what I don't get. It seems as if these are used when
> compiling under/with homebrew ?

In a part I did not quote from your message I was responding to, to
which you are responding to in the message I am responding to, there
is this gem.

>> +ifndef NO_HOMEBREW
>> +        ifdef HOMEBREW_PREFIX
>
>Question from a homebrew newbie, kind of:
>Where do the HOMEBREW_PREFIX (and other HOMEBREW...) come from,
>and what do they do ?
>
>Running
>git grep HOMEBREW
>gives
>ci/install-dependencies.sh:     export HOMEBREW_NO_AUTO_UPDATE=1 HOMEBREW_NO_INSTALL_CLEANUP=1
>
>Whould it make sense to have a few words here as a comment ?
>
>> +		BASIC_CFLAGS += -I$(HOMEBREW_PREFIX)/include
>> +		BASIC_LDFLAGS += -L$(HOMEBREW_PREFIX)/lib
>> +        endif
>> +        ifdef HOMEBREW_GETTEXT_PREFIX
>> +		BASIC_CFLAGS += -I$(HOMEBREW_GETTEXT_PREFIX)/include
>> +		BASIC_LDFLAGS += -L$(HOMEBREW_GETTEXT_PREFIX)/lib
>> +        endif
>> +        ifdef HOMEBREW_MSGFMT
>> +		MSGFMT = $(HOMEBREW_MSGFMT)
>> +        endif
>> +endif
>> +

So, unless NO_HOMEBREW is set, HOMEBREW_PREFIX can be set by the
builder, or from config.mak.uname (when homebrew is installed in the
default location), and is added to BASIC_CFLAGS etc., which is how
these are used, IIUC.