mcde recipes and the cross configuration: the X of the build host, named once
These are the changes the cross (Linux) path needed before the chroot path made them unnecessary on Makronix; they are kept because that path still builds for the same sysroot on a host that is not Makronix. tools/pkgsrc-cross.mk.conf names the host side in one place instead of in the recipes: HOST_TOOLS_BIN on PREPEND_PATH (autoreconf stopped with "Can't exec libtoolize"), HOST_X11BASE (the include path of the host's X), HOST_X11_LIBS and HOST_FL_A (the archives the host tools link) and HOST_BUILD_CFLAGS (-std=gnu17 -fPIE: the 1990s C of the forks, and NetBSD links PIE by default so tradcpp failed with "relocation R_X86_64_32 ... can not be used when making a PIE object"). /usr/pkg/lib comes before the base X when linking: a library pkgsrc builds because the base copy is too old must be the one a package links (the base freetype is 2.10.4, pkgsrc's 2.15.0 was ignored and libfontconfig.so needed .19). x11-links keeps the sysroot override only on a host without X of its own (on Makronix it doubled the path, 7 instead of 111 pkg-config links, x11/libXft then "Package 'x11' not found"). ext/src/mcde/pkgsrc-motif and ext/src/mcde/pkgsrc use those variables; the build tools (makestrs, wml, wmldbcreate) are built and run by the host, so their CFLAGS come from HOST_BUILD_CFLAGS and their include path from HOST_X11BASE. Measured on makronix-build before the chroot path: mcde-motif rc=0 in 529 s, wm/mcde rc=0 in 1506 s.
This commit is contained in:
1 parent
16826ffd01
commit
fd55404245
2 files changed
+13
-29
No files matched your search
+9
-24
@@ -75,7 +75,8 @@ MAKE_FLAGS+= CC_FOR_BUILD=${NATIVE_CC:Q:U${CC:Q}}
|
||||
# cross gcc defaults to C17, measured: __STDC_VERSION__ 201710L).
|
||||
# :Q is required -- without it make reads -std=gnu17 as an option of its own
|
||||
# ("invalid option -- '='", userland-2026-11-13x.log:396).
|
||||
CFLAGS_FOR_BUILD= -O2 -std=gnu17
|
||||
# the host's flags, from tools/pkgsrc-cross.mk.conf
|
||||
CFLAGS_FOR_BUILD= ${HOST_BUILD_CFLAGS}
|
||||
MAKE_FLAGS+= CFLAGS_FOR_BUILD=${CFLAGS_FOR_BUILD:Q}
|
||||
# wmluiltok is a host tool that links -lfl (wmluiltok_LDADD in tools/wml/Makefile).
|
||||
# In a cross build -L${LOCALBASE}/lib is rewritten to the buildlink directory, so
|
||||
@@ -84,11 +85,8 @@ MAKE_FLAGS+= CFLAGS_FOR_BUILD=${CFLAGS_FOR_BUILD:Q}
|
||||
# build/logs/userland-2026-11-14a.log:3678ff). The bootstrap prefix has a host
|
||||
# libfl.a; naming the file leaves no search path to pick the target's from.
|
||||
.if ${USE_CROSS_COMPILE:U:tl} == "yes"
|
||||
. if exists(/usr/lib/libfl.a)
|
||||
MAKE_FLAGS+= wmluiltok_LDADD=/usr/lib/libfl.a
|
||||
. else
|
||||
MAKE_FLAGS+= wmluiltok_LDADD=${MAKRONIX_TOP:Q}/build/pkg/lib/libfl.a
|
||||
. endif
|
||||
# the host's flex archive, named in tools/pkgsrc-cross.mk.conf
|
||||
MAKE_FLAGS+= wmluiltok_LDADD=${HOST_FL_A:Q}
|
||||
.endif
|
||||
MAKE_FLAGS+= AR_FOR_BUILD=${NATIVE_AR:Q:U${AR:Q}}
|
||||
MAKE_FLAGS+= RANLIB_FOR_BUILD=${NATIVE_RANLIB:Q:U${RANLIB:Q}}
|
||||
@@ -102,19 +100,9 @@ MAKE_FLAGS+= LDFLAGS_FOR_BUILD=${LDFLAGS_FOR_BUILD:Q}
|
||||
# the static archives there are named directly, which no search path can
|
||||
# redirect to the target's.
|
||||
.if ${USE_CROSS_COMPILE:U:tl} == "yes"
|
||||
. if exists(/usr/X11R7/lib/libXt.a)
|
||||
# The build host has its own X (Makronix): the host tool links the host's
|
||||
# archives, not the bootstrap's.
|
||||
LIBS_FOR_BUILD= /usr/X11R7/lib/libXt.a \
|
||||
/usr/X11R7/lib/libX11.a \
|
||||
/usr/X11R7/lib/libSM.a \
|
||||
/usr/X11R7/lib/libICE.a
|
||||
. else
|
||||
LIBS_FOR_BUILD= ${MAKRONIX_TOP:Q}/build/pkg/lib/libXt.a \
|
||||
${MAKRONIX_TOP:Q}/build/pkg/lib/libX11.a \
|
||||
${MAKRONIX_TOP:Q}/build/pkg/lib/libSM.a \
|
||||
${MAKRONIX_TOP:Q}/build/pkg/lib/libICE.a
|
||||
. endif
|
||||
# The host tool links the X of the build host; which one that is, is named in
|
||||
# tools/pkgsrc-cross.mk.conf (HOST_X11_LIBS) -- not decided here.
|
||||
LIBS_FOR_BUILD= ${HOST_X11_LIBS}
|
||||
.else
|
||||
LIBS_FOR_BUILD= -lXt
|
||||
.endif
|
||||
@@ -152,11 +140,8 @@ MAKE_FLAGS+= CROSS_COMPILING=yes
|
||||
# file or directory" (measured 2026-11-20 on makronix-build). On a Linux host
|
||||
# /usr/X11R7 does not exist and the buildlink's PREFIX/include is the answer,
|
||||
# as before.
|
||||
.if exists(/usr/X11R7/include/X11/Xos.h)
|
||||
CPPFLAGS_FOR_BUILD+= -I/usr/X11R7/include
|
||||
.else
|
||||
CPPFLAGS_FOR_BUILD+= -I${PREFIX:Q}/include
|
||||
.endif
|
||||
# the include path of the host's X, from tools/pkgsrc-cross.mk.conf
|
||||
CPPFLAGS_FOR_BUILD+= -I${HOST_X11BASE:Q}/include
|
||||
LDFLAGS_FOR_BUILD+= -L${PREFIX:Q}/lib
|
||||
LDFLAGS_FOR_BUILD+= ${COMPILER_RPATH_FLAG:Q}${PREFIX:Q}/lib
|
||||
CONFIGURE_ARGS.NetBSD+= ac_cv_file__usr_X_include_X11_X_h=no
|
||||
|
||||
+4
-5
@@ -149,12 +149,11 @@ PLIST.tttypes= yes
|
||||
.if ${USE_CROSS_COMPILE:U:tl} == "yes"
|
||||
# the build tools are 1990s C, and this host's compiler defaults to C23 (see the
|
||||
# Motif recipe's CFLAGS_FOR_BUILD)
|
||||
CFLAGS_FOR_BUILD= -O2 -std=gnu17
|
||||
# the host's flags, from tools/pkgsrc-cross.mk.conf
|
||||
CFLAGS_FOR_BUILD= ${HOST_BUILD_CFLAGS}
|
||||
CPPFLAGS_FOR_BUILD= -DHAVE_FCNTL_H
|
||||
# The build tools need the X of the build host (see the Motif recipe).
|
||||
.if exists(/usr/X11R7/include/X11/Xos.h)
|
||||
CPPFLAGS_FOR_BUILD+= -I/usr/X11R7/include
|
||||
.endif
|
||||
# the include path of the host's X, from tools/pkgsrc-cross.mk.conf
|
||||
CPPFLAGS_FOR_BUILD+= -I${HOST_X11BASE:Q}/include
|
||||
# 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").
|
||||
|
||||
Reference in new issue
Block a user