]> git.ipfire.org Git - thirdparty/freeradius-server.git/commitdiff
Build build system libraries with HOST_CC
authorArran Cudbard-Bell <a.cudbardb@freeradius.org>
Thu, 5 May 2022 12:55:03 +0000 (14:55 +0200)
committerArran Cudbard-Bell <a.cudbardb@freeradius.org>
Sat, 7 May 2022 22:27:08 +0000 (17:27 -0500)
scripts/build/dlopen.mk
scripts/build/version.mk
scripts/libtool.mk

index b856432b8a2291dcd6d74cb2a3fa0c1ccdff1e4f..808a2cef73d6a8a37544e0f47d0a2f5c69a61ace 100644 (file)
@@ -1,13 +1,19 @@
-TARGET         := libfreeradius-make-dlopen.a
-SOURCES                := dlopen.c log.c
+TARGET                         := libfreeradius-make-dlopen.a
+SOURCES                                := dlopen.c log.c
 
 #
 #  This target is NOT built with static analyzer flags.
 #
-$(TARGET): CC      := $(HOST_CC)
-$(TARGET): CFLAGS   := $(filter-out -W%,$(filter-out -fsanitize%,$(CFLAGS)))
-$(TARGET): CPPFLAGS := $(filter-out -W%,$(CPPFLAGS))
-$(TARGET): LDFLAGS  := $(filter-out -fsanitize%,$(LDFLAGS))
+$(TARGET): CFLAGS              := $(filter-out -W%,$(filter-out -fsanitize%,$(CFLAGS)))
+$(TARGET): CPPFLAGS            := $(filter-out -W%,$(CPPFLAGS))
+$(TARGET): LDFLAGS             := $(filter-out -fsanitize%,$(LDFLAGS))
+
+#
+#  This gets built with the HOST_CC i.e. the one we use to bootstrap
+#  this build system.
+#
+SRC_CC := ${HOST_COMPILE.c}
+TGT_LINKER := ${HOST_LINK.c}
 
 #
 #  If we're building this target, then don't try to use it until we know
index 9c84a92bd1e2dbb22b940db669a2ef61251bf0b9..916369aff994e669b9fa27aadb0b270f07bc7ee4 100644 (file)
@@ -1,13 +1,19 @@
-TARGET                 := libfreeradius-make-version.a
-SOURCES                := version.c log.c
+TARGET                         := libfreeradius-make-version.a
+SOURCES                                := version.c log.c
 
 #
 #  This target is NOT built with static analyzer flags.
 #
-$(TARGET): CC      := $(HOST_CC)
-$(TARGET): CFLAGS   := $(filter-out -W%,$(filter-out -fsanitize%,$(CFLAGS)))
-$(TARGET): CPPFLAGS := $(filter-out -W%,$(CPPFLAGS))
-$(TARGET): LDFLAGS  := $(filter-out -fsanitize%,$(LDFLAGS))
+$(TARGET): CFLAGS              := $(filter-out -W%,$(filter-out -fsanitize%,$(CFLAGS)))
+$(TARGET): CPPFLAGS            := $(filter-out -W%,$(CPPFLAGS))
+$(TARGET): LDFLAGS             := $(filter-out -fsanitize%,$(LDFLAGS))
+
+#
+#  This gets built with the HOST_CC i.e. the one we use to bootstrap
+#  this build system.
+#
+SRC_CC := ${HOST_COMPILE.c}
+TGT_LINKER := ${HOST_LINK.c}
 
 #
 #  If we're building this target, then don't try to use it until we know
index 85d338d9915ac43ac9d288a75f73c487bb342ea2..9b59d018fff9ba1163fb4f1afa8d5b90a8e79881 100644 (file)
@@ -97,12 +97,19 @@ clean.libs:
 # Re-define compilers and linkers
 #
 LIBTOOL_VERBOSE=$(if ${VERBOSE},--debug,--silent)
+
 OBJ_EXT = lo
-COMPILE.c = ${LIBTOOL} ${LIBTOOL_VERBOSE} --mode=compile ${CC}
-COMPILE.cxx = ${LIBTOOL} ${LIBTOOL_VERBOSE} --mode=compile ${CXX}
-LINK.c = ${LIBTOOL} ${LIBTOOL_VERBOSE} --mode=link ${CC}
-LINK.cxx = ${LIBTOOL} ${LIBTOOL_VERBOSE} --mode=link ${CXX}
-PROGRAM_INSTALL = ${LIBTOOL} ${LIBTOOL_VERBOSE} --mode=install ${INSTALL}
+
+COMPILE.c = ${LIBTOOL} ${LIBTOOL_VERBOSE} --target=${TARGET_SYSTEM} --mode=compile ${TARGET_CC}
+HOST_COMPILE.c = ${LIBTOOL} ${LIBTOOL_VERBOSE} --mode=compile ${HOST_CC}
+
+LINK.c = ${LIBTOOL} ${LIBTOOL_VERBOSE} --target=${TARGET_SYSTEM} --mode=link ${TARGET_CC}
+HOST_LINK.c = ${LIBTOOL} ${LIBTOOL_VERBOSE} --mode=link ${HOST_CC}
+
+COMPILE.cxx = ${LIBTOOL} ${LIBTOOL_VERBOSE} --target=${TARGET_SYSTEM} --mode=compile ${CXX}
+LINK.cxx = ${LIBTOOL} ${LIBTOOL_VERBOSE} --target=${TARGET_SYSTEM} --mode=link ${CXX}
+
+PROGRAM_INSTALL = ${LIBTOOL} ${LIBTOOL_VERBOSE} --target=${TARGET_SYSTEM} --mode=install ${INSTALL}
 
 
 # LIBTOOL_ENDINGS - Given a library ending in ".a" or ".so", replace that