Skip to content
GitLab
Projects Groups Snippets
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in / Register
  • abuild abuild
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 64
    • Issues 64
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 38
    • Merge requests 38
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
  • Deployments
    • Deployments
    • Environments
    • Releases
  • Packages and registries
    • Packages and registries
    • Container Registry
  • Monitor
    • Monitor
    • Incidents
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Repository
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • alpinealpine
  • abuildabuild
  • Merge requests
  • !112

functions.sh.in: Export original CC, CXX, CPPFLAGS, CXXFLAGS, CFLAGS, LDFLAGS

  • Review changes

  • Download
  • Email patches
  • Plain diff
Closed Thermi requested to merge Thermi/abuild:build-variables into master Aug 10, 2021
  • Overview 9
  • Commits 4
  • Pipelines 0
  • Changes 2

in BUILDCC, BUILDCXX, BUILDLD, BUILDCPPFLAGS, BUILDCXXFLAGS, BUILDCFLAGS, BUILDLDFLAGS Default CC to gcc, CXX to g++, LD to ld

This contains code that ensures that any variables exported by functions.sh are not by default empty. This can cause issues in Makefiles that only check if a variable is defined, but not if it is empty. The code ensures the variables are not empty by moving the defaulting to gcc, g+, and ld to the declaration of the local variables that are later used to export CC, CXX, LD, and their derived variables.

The BUILD* variables are exported with values of their associated non-BUILD* variables before any cross compilation changes are applied (like converting CC from gcc to ${CROSS_COMPILE}-$CC). This is done to enable users to use these variables in Makefiles of software that is cross compiled and run locally at build time to specify flags from abuild.conf and other variables. Otherwise, these variables would end up containing --sysroot=$CBUILDROOT, which points at an environment with files for the wrong architecture (and in the wrong format).

BUILDCC
BUILDCXX
BUILDLD
BUILDCPPFLAGS
BUILDCXXFLAGS
BUILDCFLAGS
BUILDLDFLAGS

Please consider that cross compiling is much faster than using qemu-user. I will later add a commit that adds a check that users know that cross compiling is not the best choice for building their packages from source for a foreign architecture.

Edited Aug 31, 2021 by Thermi
Assignee
Assign to
Reviewers
Request review from
Time tracking
Source branch: build-variables