justinethier / cyclone

:cyclone: A brand-new compiler that allows practical application development using R7RS Scheme. We provide modern features and a stable system capable of generating fast native binaries.
http://justinethier.github.io/cyclone/
MIT License
823 stars 42 forks source link

Don't use conditional assignment operator for CFLAGS/LDFLAGS #474

Closed nmeum closed 3 years ago

nmeum commented 3 years ago

The conditional variable assignment operator in Makefiles (?=) will only assign a value if its not defined yet. However, CFLAGS/LDFLAGS are commonly defined as environment variables to pass custom compiler/linker flags (e.g. -Os). Unfortunately, Cyclone adds mandatory compiler flags (without which it doesn't compile) via the conditional variable assignment operator which is incorrect as these flags will not be added if CFLAGS/LDFLAGS is defined in the environment. This commit fixes this issue by appending flags to CFLAGS/LDFLAGS instead of using the conditional assignment operator.

This should also fix weird hacks such as this: https://aur.archlinux.org/cgit/aur.git/tree/PKGBUILD?h=cyclone-scheme#n27

justinethier commented 3 years ago

Pulled in. Thanks @nmeum !