diff --git a/pkgsrc-motif/Makefile b/pkgsrc-motif/Makefile index 7e7cfad6..05df4e07 100644 --- a/pkgsrc-motif/Makefile +++ b/pkgsrc-motif/Makefile @@ -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 diff --git a/pkgsrc/Makefile b/pkgsrc/Makefile index ecc851f7..de1ac94c 100644 --- a/pkgsrc/Makefile +++ b/pkgsrc/Makefile @@ -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").