Closed nmeum closed 2 years ago
Thanks for the contributions @nmeum! This will take some time to review and test...
Thanks for the contributions @nmeum! This will take some time to review and test...
Sure, take your time :) See also: My inline comments above regarding stuff I wasn't entirely sure about.
Merged - thanks @nmeum !
This commit separates include/library search directory options from "normal" compiler/linker options and places options passed via the
-COPT
/-CLNK
command-line flags in-between. This allows overwriting the default search paths, since contrary to all other options, the search paths must be prepend for an-I
/-L
option to take precedence over an existing one.To test this, compare the new concatenation of linker/compiler options for
test.scm
with the previous one:The important thing to take away here is:
-Iinclude
(as specified via-COPT
) is added before the default-I/usr/include
but after-O2 -Wall
etc.-L.
(as specified via-CLNK
is added before the default-L/usr/lib
but after-Wl,--export-dynamic
etc.This should (hopefully) make it entirely unnecessary to ever build Cyclone twice in order to have all changes in the current source tree take effect. Without this change, Cyclone will always use system header/libraries of the previous installation since the library/include search path was previously appended instead of prepended (see #476).
Please review this with extra care.
Fixes #476