Page MenuHome GnuPG

Tools needed during a build lack of CFLAGS was passed durring configure time
Closed, ResolvedPublic

Description

Hello.

I found described problem in three libraries:

  1. library libassuan, tool: mkheader, version: 2.5.3,
  2. library libgpg-error, tools: mkerrcodes, mkw32errmap, mkheader, version: 1.39
  3. library libgcrypt, tool: gost-s-box, version: 1.8.7

Problem context:
https://github.com/microsoft/vcpkg/pull/15605
https://github.com/microsoft/vcpkg/pull/17020
https://github.com/microsoft/vcpkg/pull/17023
https://github.com/microsoft/vcpkg/pull/17021

Operating system: mostly MacOs X

I try to make vcpkg configure autotools-packages with the same cflags (also cxxflags and ldflags, and compilers, and linkers) as cmake-packages. And found that some binaries do not use provided correct flags.

Event Timeline

xandox changed External Link from https://github.com/microsoft/vcpkg/pull/15605 https://github.com/microsoft/vcpkg/pull/17020 https://github.com/microsoft/vcpkg/pull/17023 https://github.com/microsoft/vcpkg/pull/17021 to https://github.com/microsoft/vcpkg/pull/15605.
werner added a subscriber: werner.

Sorry, I can't parse your message. Please describe the problem or feature requests. Referencing external patches is not sufficient. What is vcpkg?

What is vcpkg?

vcpkg is package manager for c/c++ (https://github.com/microsoft/vcpkg). But it does not matter much right now.

Problem is next.
All libraries I mentioned above for successful build also build some intermediate tools for it. Lets focus on libassuan. It builds mkheader executable.
Command for build is (in src/Makefile.am):

mkheader: mkheader.c Makefile
	$(CC_FOR_BUILD) -I. -I$(srcdir) -o $@ $(srcdir)/mkheader.c

Here CC_FOR_BUILD was taken from CC environment variable, but for MacOS if CC points to /Library/Developer/CommandLineTools/usr/bin/cc compiler from command line tools from xcode, this compiler also requires additional flags like -arch, -isysroot and set of -isystem include directories. I also pass all this flags through CFLAGS environment variable, but how you can see, this flags will not be applied for mkheader.

Referencing external patches is not sufficient

I do not suggest this patches as solution. I am not expert in autotools and my fixes is just fast fix and I absolutely not sure it's correct way to fix the problem. So why I am here.

CC_FOR_BUILD is used for building executables for the build machine.
CC_FOR_BUILD may be different to CC (for target).

Please use CFLAGS_FOR_BUILD to specify flags for building executables for the build machine.

gniibe triaged this task as Normal priority.

Ok.
But`CFLAGS_FOR_BUILD` not mentioned in build rule for mkheader

mkheader has CFLAGS_FOR_BUILD since libassuan 2.5.4.
gost-s-box has so since libgcrypt 1.9.0.

Ok, thank you. I think task can be closed.