diff --git a/configure.ac b/configure.ac index 62c7340d..421e461d 100644 --- a/configure.ac +++ b/configure.ac @@ -287,6 +287,14 @@ AC_ARG_ENABLE([docs], ) AM_CONDITIONAL([BUILD_DOCS], [test -z "$disable_docs"]) +dnl Build the application builder (dtappbuilder) and ttsnoop? They run dtcodegen +dnl while building, so a cross build cannot have them. +AC_ARG_ENABLE([appbuilder], + AS_HELP_STRING([--disable-appbuilder], [Disable building dtappbuilder and ttsnoop (default=no)]), + [disable_appbuilder="yes"], [disable_appbuilder=""] +) +AM_CONDITIONAL([APPBUILDER], [test -z "$disable_appbuilder"]) + dnl Xrender usage AC_ARG_ENABLE([xrender], AS_HELP_STRING([--disable-xrender], [Disable use of the Xrender extension (default=auto)]), @@ -468,6 +476,11 @@ if test -z "$ac_cv_path_KSH"; then fi fi +dnl - the ksh that runs scripts while building (programs/dtprintinfo: sym2num). +dnl KSH above is the target's when cross building (KSH is a path in the +dnl installed system), and cannot run here; look on the build host. +AC_PATH_PROGS(KSH_FOR_BUILD, [ksh93 ksh mksh], [$KSH], [/usr/bin:/bin:/usr/local/bin:/usr/pkg/bin]) + AC_PATH_PROG(XRDB, xrdb) if test -z "$ac_cv_path_XRDB"; then MISSING_PROGS="xrdb ${MISSING_PROGS}" diff --git a/pkgsrc/options.mk b/pkgsrc/options.mk index 8cb1dd62..b4d9cea1 100644 --- a/pkgsrc/options.mk +++ b/pkgsrc/options.mk @@ -2,15 +2,15 @@ PKG_OPTIONS_VAR= PKG_OPTIONS.cde -PKG_SUPPORTED_OPTIONS= nls pam +PKG_SUPPORTED_OPTIONS= nls pam docs appbuilder .if ${OPSYS} == "NetBSD" || ${OPSYS} == "Linux" # upstream only supports pam on linux and netbsd -PKG_SUGGESTED_OPTIONS= pam +PKG_SUGGESTED_OPTIONS= pam docs appbuilder .else -PKG_SUGGESTED_OPTIONS= +PKG_SUGGESTED_OPTIONS= docs appbuilder .endif -PLIST_VARS+= nls pam +PLIST_VARS+= nls pam docs appbuilder .include "../../mk/bsd.options.mk" @@ -59,3 +59,25 @@ pam-install: CONFIGURE_ENV+= ac_cv_lib_pam_pam_start=no SPECIAL_PERMS+= ${PREFIX}/dt/bin/dtsession ${SETUID_ROOT_PERMS} .endif + +# +# Documentation (man pages, help volumes, guides). Built by programs that +# the build itself runs (instant, dtdocbook2infolib, the dthelp parsers): a +# cross build cannot run them (tools/pkgsrc-cross.mk.conf turns the option off +# there; the native build on NetBSD has it). +# +.if !empty(PKG_OPTIONS:Mdocs) +PLIST.docs= yes +.else +CONFIGURE_ARGS+= --disable-docs +.endif + +# +# The application builder (dtbuilder) and ttsnoop: the build runs their code +# generator, dtcodegen (a cross build cannot; the native build has them). +# +.if !empty(PKG_OPTIONS:Mappbuilder) +PLIST.appbuilder= yes +.else +CONFIGURE_ARGS+= --disable-appbuilder +.endif diff --git a/programs/Makefile.am b/programs/Makefile.am index 6483e272..afa65853 100644 --- a/programs/Makefile.am +++ b/programs/Makefile.am @@ -3,11 +3,18 @@ MAINTAINERCLEANFILES = Makefile.in SUBDIRS = backdrops icons dsdm dtmail dtpad dtfile dterror dtwm dtlogin \ dtsession dthello dtstyle dtexec dtdbcache dticon dtterm \ dtcalc dtaction dtspcd dtscreen dtcm dtsearchpath \ - dtappbuilder palettes dtappintegrate dtprintegrate dtconfig \ - dtcreate dtprintinfo fontaliases dtdspmsg ttsnoop dtimsstart \ + palettes dtappintegrate dtprintegrate dtconfig \ + dtcreate dtprintinfo fontaliases dtdspmsg dtimsstart \ dtpdm dtsr dtpdmd dtinfo types tttypes util dtopen localized \ dthelp dtdocbook dtlaunch dtbar dtsystemsettings dtdiskutility dtbackup dtappscan dtkeys dtthemesync dtphoto dtpaint dttoolbox mcdesoundd +# The application builder and ttsnoop, its demonstration, need dtcodegen, a +# program the build runs: not in a cross build (--disable-appbuilder; the native +# build on NetBSD has them). +if APPBUILDER +SUBDIRS += dtappbuilder ttsnoop +endif + install-data-hook: -if [ $(CDE_INSTALLATION_TOP)/bin != $(bindir) ];then \ cd $(DESTDIR)$(CDE_INSTALLATION_TOP) && $(LN_S) $(bindir) bin ; fi diff --git a/programs/dthelp/parser/canon1/util/Makefile.am b/programs/dthelp/parser/canon1/util/Makefile.am index 43214e5e..44043e9e 100644 --- a/programs/dthelp/parser/canon1/util/Makefile.am +++ b/programs/dthelp/parser/canon1/util/Makefile.am @@ -2,11 +2,23 @@ MAINTAINERCLEANFILES = Makefile.in noinst_LIBRARIES = libutil.a -noinst_PROGRAMS = context fclndir +# context and fclndir are build tools: the parsers' Makefiles run them to make +# their tables, so they must run on the build host, not on the target (Error 127 +# for a cross build, build/logs/mcde-nodocs-2026-11-14b.log). libutil.a is +# linked into target programs too, so these are not automake programs: the +# build host's compiler (the values come from AM_MAKEFLAGS in the top +# Makefile.am) compiles them with the sources of libutil. +HOSTUTIL_C = $(filter %.c,$(libutil_a_SOURCES)) +EXTRA_DIST = context.c +CLEANFILES = context fclndir -context_SOURCES = context.c +all-local: context fclndir -fclndir_SOURCES = context.c +context: context.c $(HOSTUTIL_C) + $(CC_FOR_BUILD) $(CFLAGS_FOR_BUILD) $(CPPFLAGS_FOR_BUILD) -I. -I$(srcdir) -o $@ $(srcdir)/context.c $(addprefix $(srcdir)/,$(HOSTUTIL_C)) $(LDFLAGS_FOR_BUILD) + +fclndir: context + cp context fclndir libutil_a_SOURCES = allwhite.c inctest.c letter.c triedump.c \ triepdmp.c trieplk.c trierset.c upcmp8.c upstrcmp.c wchar.c \ @@ -16,6 +28,3 @@ libutil_a_SOURCES = allwhite.c inctest.c letter.c triedump.c \ entext.h sref.h version.h # FIXME I think emptyfil.c and fclndir.c can be deleted? - -context_LDADD = libutil.a -fclndir_LDADD = libutil.a diff --git a/programs/dthelp/parser/pass1/util/Makefile.am b/programs/dthelp/parser/pass1/util/Makefile.am index 43214e5e..44043e9e 100644 --- a/programs/dthelp/parser/pass1/util/Makefile.am +++ b/programs/dthelp/parser/pass1/util/Makefile.am @@ -2,11 +2,23 @@ MAINTAINERCLEANFILES = Makefile.in noinst_LIBRARIES = libutil.a -noinst_PROGRAMS = context fclndir +# context and fclndir are build tools: the parsers' Makefiles run them to make +# their tables, so they must run on the build host, not on the target (Error 127 +# for a cross build, build/logs/mcde-nodocs-2026-11-14b.log). libutil.a is +# linked into target programs too, so these are not automake programs: the +# build host's compiler (the values come from AM_MAKEFLAGS in the top +# Makefile.am) compiles them with the sources of libutil. +HOSTUTIL_C = $(filter %.c,$(libutil_a_SOURCES)) +EXTRA_DIST = context.c +CLEANFILES = context fclndir -context_SOURCES = context.c +all-local: context fclndir -fclndir_SOURCES = context.c +context: context.c $(HOSTUTIL_C) + $(CC_FOR_BUILD) $(CFLAGS_FOR_BUILD) $(CPPFLAGS_FOR_BUILD) -I. -I$(srcdir) -o $@ $(srcdir)/context.c $(addprefix $(srcdir)/,$(HOSTUTIL_C)) $(LDFLAGS_FOR_BUILD) + +fclndir: context + cp context fclndir libutil_a_SOURCES = allwhite.c inctest.c letter.c triedump.c \ triepdmp.c trieplk.c trierset.c upcmp8.c upstrcmp.c wchar.c \ @@ -16,6 +28,3 @@ libutil_a_SOURCES = allwhite.c inctest.c letter.c triedump.c \ entext.h sref.h version.h # FIXME I think emptyfil.c and fclndir.c can be deleted? - -context_LDADD = libutil.a -fclndir_LDADD = libutil.a diff --git a/programs/dthelp/parser/pass2/util/Makefile.am b/programs/dthelp/parser/pass2/util/Makefile.am index 841b6bd9..1d8e1f07 100644 --- a/programs/dthelp/parser/pass2/util/Makefile.am +++ b/programs/dthelp/parser/pass2/util/Makefile.am @@ -4,11 +4,23 @@ MAINTAINERCLEANFILES = Makefile.in noinst_LIBRARIES = libutil.a -noinst_PROGRAMS = context fclndir +# context and fclndir are build tools: the parsers' Makefiles run them to make +# their tables, so they must run on the build host, not on the target (Error 127 +# for a cross build, build/logs/mcde-nodocs-2026-11-14b.log). libutil.a is +# linked into target programs too, so these are not automake programs: the +# build host's compiler (the values come from AM_MAKEFLAGS in the top +# Makefile.am) compiles them with the sources of libutil. +HOSTUTIL_C = $(filter %.c,$(libutil_a_SOURCES)) +EXTRA_DIST = context.c +CLEANFILES = context fclndir -context_SOURCES = context.c +all-local: context fclndir -fclndir_SOURCES = context.c +context: context.c $(HOSTUTIL_C) + $(CC_FOR_BUILD) $(CFLAGS_FOR_BUILD) $(CPPFLAGS_FOR_BUILD) -I. -I$(srcdir) -o $@ $(srcdir)/context.c $(addprefix $(srcdir)/,$(HOSTUTIL_C)) $(LDFLAGS_FOR_BUILD) + +fclndir: context + cp context fclndir libutil_a_SOURCES = allwhite.c inctest.c letter.c triedump.c \ triepdmp.c trieplk.c trierset.c upcmp8.c upstrcmp.c wchar.c \ @@ -18,6 +30,3 @@ libutil_a_SOURCES = allwhite.c inctest.c letter.c triedump.c \ entext.h sref.h version.h # FIXME I think emptyfil.c and fclndir.c can be deleted? - -context_LDADD = libutil.a -fclndir_LDADD = libutil.a diff --git a/programs/dtinfo/tools/misc/Makefile.am b/programs/dtinfo/tools/misc/Makefile.am index 3aa8dfd4..ac1b7c13 100644 --- a/programs/dtinfo/tools/misc/Makefile.am +++ b/programs/dtinfo/tools/misc/Makefile.am @@ -1,6 +1,15 @@ MAINTAINERCLEANFILES = Makefile.in -noinst_PROGRAMS = dfiles pmaker msgsets +# dfiles and pmaker are build tools (dtinfo/src/Makefile.am runs them), so they +# are compiled for the build host, not the target: the same as util/tradcpp. +# msgsets (a C++ program nothing runs) is no longer built; its source stays. +noinst_PROGRAMS = dfiles pmaker +EXTRA_DIST = msgsets.C msgsets.l reverse.c treecomp + +CC = $(CC_FOR_BUILD) +CPPFLAGS = $(CPPFLAGS_FOR_BUILD) +CFLAGS = $(CFLAGS_FOR_BUILD) +LDFLAGS = $(LDFLAGS_FOR_BUILD) noinst_SCRIPTS = treeres @@ -10,10 +19,6 @@ dfiles_SOURCES = dfiles.c pmaker_SOURCES = pmaker.c -# JET - this one migth need to be regenned via the lex file someday... -# Maybe it should always be regenned? -msgsets_SOURCES = msgsets.C - treeres: treeres.src $(RM) $@ $(SED) $(LOCAL_SED_DEFINES) $< > $@ diff --git a/programs/dtprintinfo/Makefile.am b/programs/dtprintinfo/Makefile.am index 3ec53d92..eb6946ba 100644 --- a/programs/dtprintinfo/Makefile.am +++ b/programs/dtprintinfo/Makefile.am @@ -52,7 +52,7 @@ dtprintinfo_SOURCES = $(UTIL_SRC) $(LIBUI_SRC) $(OBJ_SRC) $(UI_SRC) \ DtPrintinfo.C dtprintinfomsg.h # special processing for message files -SYM2NUM_CMD = CPP=$(GENCPP) $(KSH) sym2num +SYM2NUM_CMD = CPP=$(GENCPP) $(KSH_FOR_BUILD) sym2num BUILT_SOURCES = dtprintinfo_cat.h dtprintinfo_msg.h dtprintinfo.msg CLEANFILES = $(BUILT_SOURCES) diff --git a/programs/localized/util/Makefile.am b/programs/localized/util/Makefile.am index c0c92e0c..63d92753 100644 --- a/programs/localized/util/Makefile.am +++ b/programs/localized/util/Makefile.am @@ -1,5 +1,12 @@ noinst_PROGRAMS = merge mkcatdefs +# merge and mkcatdefs are build tools (the catalogs are made with them while +# building): 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) + BUILT_SOURCES = MsgCat.c CLEANFILES = MsgCat.c