From: Arran Cudbard-Bell Date: Thu, 5 May 2022 12:55:03 +0000 (+0200) Subject: Build build system libraries with HOST_CC X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=0c1f9996a82413e5feffb9b0eddbce8008fc016d;p=thirdparty%2Ffreeradius-server.git Build build system libraries with HOST_CC --- diff --git a/scripts/build/dlopen.mk b/scripts/build/dlopen.mk index b856432b8a2..808a2cef73d 100644 --- a/scripts/build/dlopen.mk +++ b/scripts/build/dlopen.mk @@ -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 diff --git a/scripts/build/version.mk b/scripts/build/version.mk index 9c84a92bd1e..916369aff99 100644 --- a/scripts/build/version.mk +++ b/scripts/build/version.mk @@ -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 diff --git a/scripts/libtool.mk b/scripts/libtool.mk index 85d338d9915..9b59d018fff 100644 --- a/scripts/libtool.mk +++ b/scripts/libtool.mk @@ -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