diff --git a/ext/src/mcde/pkgsrc/Makefile b/ext/src/mcde/pkgsrc/Makefile index 709fa37bbe..5cfc7f4652 100644 --- a/ext/src/mcde/pkgsrc/Makefile +++ b/ext/src/mcde/pkgsrc/Makefile @@ -110,6 +110,11 @@ MAKE_FLAGS+= LDFLAGS=${LDFLAGS:M*:Q} # Motif recipe's CFLAGS_FOR_BUILD) CFLAGS_FOR_BUILD= -O2 -std=gnu17 CPPFLAGS_FOR_BUILD= -DHAVE_FCNTL_H +# Nothing of the target in what links a build tool: no -L/-R of the sysroot, and +# not the X_LIBS configure would add (a bare -R, which the host's gcc rejects: +# build/logs/mcde-hosttools-2026-11-14b.log, "unrecognized command-line option -R"). +LDFLAGS_FOR_BUILD= -Wl,-O1 +CONFIGURE_ENV+= LDFLAGS_FOR_BUILD=${LDFLAGS_FOR_BUILD:Q} CONFIGURE_ENV+= CC_FOR_BUILD=${NATIVE_CC:Q:U${CC:Q}} CONFIGURE_ENV+= AR_FOR_BUILD=${NATIVE_AR:Q:U${AR:Q}} CONFIGURE_ENV+= RANLIB_FOR_BUILD=${NATIVE_RANLIB:Q:U${RANLIB:Q}} diff --git a/ext/src/mcde/programs/dtdocbook/dtsr/Makefile.am b/ext/src/mcde/programs/dtdocbook/dtsr/Makefile.am index 1953536009..8b6709f00f 100644 --- a/ext/src/mcde/programs/dtdocbook/dtsr/Makefile.am +++ b/ext/src/mcde/programs/dtdocbook/dtsr/Makefile.am @@ -20,6 +20,13 @@ dtsr_DATA = \ noinst_PROGRAMS = mkdbd +# mkdbd is a build tool (dtsearch.dbd is made with it below): compiled for the +# build host, not the target (util/tradcpp). +CC = $(CC_FOR_BUILD) +CPPFLAGS = $(CPPFLAGS_FOR_BUILD) +CFLAGS = $(CFLAGS_FOR_BUILD) +LDFLAGS = $(LDFLAGS_FOR_BUILD) + dtsearch = ../../../lib/DtSearch mkdbd_CPPFLAGS = -DBASE_FILE_NAME=\"dtsearch\" diff --git a/ext/src/mcde/programs/fontaliases/Makefile.am b/ext/src/mcde/programs/fontaliases/Makefile.am index df4947bd84..b9df81a393 100644 --- a/ext/src/mcde/programs/fontaliases/Makefile.am +++ b/ext/src/mcde/programs/fontaliases/Makefile.am @@ -10,7 +10,17 @@ CLEANFILES = $(BUILT_SOURCES) mk_fonts_alias_SOURCES = mk_fonts_alias.c test_fonts_alias_SOURCES = test_fonts_alias.c test_fonts_alias_LDADD = $(XTOOLLIB) -noinst_PROGRAMS = mk_fonts_alias test_fonts_alias +# mk_fonts_alias is a build tool (the alias files below are made with it): it is +# compiled for the build host, not the target (util/tradcpp). The test links +# the X toolkit, which the build host's compiler does not have for the target: +# it is only built by `make check'. +noinst_PROGRAMS = mk_fonts_alias +check_PROGRAMS = test_fonts_alias + +CC = $(CC_FOR_BUILD) +CPPFLAGS = $(CPPFLAGS_FOR_BUILD) +CFLAGS = $(CFLAGS_FOR_BUILD) +LDFLAGS = $(LDFLAGS_FOR_BUILD) if MISC_FIXED FONTS_ALIAS = fixed.alias