diff --git a/pkgsrc-motif/Makefile b/pkgsrc-motif/Makefile index 6a0f3b21..7b27bab3 100644 --- a/pkgsrc-motif/Makefile +++ b/pkgsrc-motif/Makefile @@ -133,7 +133,17 @@ LDFLAGS_FOR_BUILD+= ${BUILDLINK_LDFLAGS} .else MAKE_FLAGS+= CROSS_COMPILING=yes # XXX should support independent cross PREFIX +# PREFIX is the target's (/usr/pkg). Where the build host has an X of its own, +# the build tools (makestrs, wml, wmldbcreate) must see THAT one: on Makronix +# /usr/pkg/include has no X11, and makestrs stopped with "X11/Xos.h: No such +# 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 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 ea0095a2..ecc851f7 100644 --- a/pkgsrc/Makefile +++ b/pkgsrc/Makefile @@ -151,6 +151,10 @@ PLIST.tttypes= yes # Motif recipe's CFLAGS_FOR_BUILD) CFLAGS_FOR_BUILD= -O2 -std=gnu17 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 # 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").