From c4f159477d0f036c256a179ad6357db017754a01 Mon Sep 17 00:00:00 2001 From: lotherk Date: Sat, 14 Nov 2026 12:37:38 +0000 Subject: [PATCH] MCDE: a cross build installs the ToolTalk ptypes and dtlogin's rc script compiles them (t0210) Co-Authored-By: Claude Sonnet 5.5 --- configure.ac | 8 ++++++++ pkgsrc/Makefile | 10 ++++++++++ pkgsrc/PLIST | 12 +++++++++++- pkgsrc/files/dtlogin.sh | 18 ++++++++++++++++++ programs/tttypes/Makefile.am | 12 +++++++++++- 5 files changed, 58 insertions(+), 2 deletions(-) diff --git a/configure.ac b/configure.ac index 421e461d..a66bef79 100644 --- a/configure.ac +++ b/configure.ac @@ -295,6 +295,14 @@ AC_ARG_ENABLE([appbuilder], ) AM_CONDITIONAL([APPBUILDER], [test -z "$disable_appbuilder"]) +dnl Compile the ToolTalk types (types.xdr) while building? tt_type_comp runs for +dnl that, so a cross build cannot; the types are then compiled on the target. +AC_ARG_ENABLE([tttypes-build], + AS_HELP_STRING([--disable-tttypes-build], [Do not compile the ToolTalk types while building (default=no)]), + [disable_tttypes="yes"], [disable_tttypes=""] +) +AM_CONDITIONAL([TTTYPES_BUILD], [test -z "$disable_tttypes"]) + dnl Xrender usage AC_ARG_ENABLE([xrender], AS_HELP_STRING([--disable-xrender], [Disable use of the Xrender extension (default=auto)]), diff --git a/pkgsrc/Makefile b/pkgsrc/Makefile index 5cfc7f46..35226fb3 100644 --- a/pkgsrc/Makefile +++ b/pkgsrc/Makefile @@ -105,6 +105,16 @@ MAKE_FLAGS+= LDFLAGS=${LDFLAGS:M*:Q} # Makefiles and Makefile.am forwards them through AM_MAKEFLAGS; the MAKE_FLAGS are # the belt to that, and the CONFIGURE_ENV the braces -- configure's own default is # $CC, i.e. the target's compiler, whenever pkgsrc does not say otherwise. +# ToolTalk's tt_type_comp compiles the types while MCDE installs: a program of +# the target. A cross build installs the ptype files and the system compiles +# them (files/dtlogin.sh, before dtlogin starts); a native build does as upstream. +PLIST_VARS+= tttypes ptypes +.if ${USE_CROSS_COMPILE:U:tl} == "yes" +CONFIGURE_ARGS+= --disable-tttypes-build +PLIST.ptypes= yes +.else +PLIST.tttypes= yes +.endif .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) diff --git a/pkgsrc/PLIST b/pkgsrc/PLIST index 2f1557e9..8c9001eb 100644 --- a/pkgsrc/PLIST +++ b/pkgsrc/PLIST @@ -2416,7 +2416,17 @@ dt/appconfig/icons/ja/semilocked.xbm dt/appconfig/icons/ja/unlocked.xbm dt/appconfig/icons/ja/web_browse.xbm dt/appconfig/icons/ja/web_browse_ins.xbm -dt/appconfig/tttypes/types.xdr +${PLIST.tttypes}dt/appconfig/tttypes/types.xdr +${PLIST.ptypes}dt/appconfig/tttypes/dtcm.ptype +${PLIST.ptypes}dt/appconfig/tttypes/dtdbcache.ptype +${PLIST.ptypes}dt/appconfig/tttypes/dtfile.ptype +${PLIST.ptypes}dt/appconfig/tttypes/dticon.ptype +${PLIST.ptypes}dt/appconfig/tttypes/dtinfo.ptype +${PLIST.ptypes}dt/appconfig/tttypes/dtinfo_start.opnums +${PLIST.ptypes}dt/appconfig/tttypes/dtinfo_start.ptype +${PLIST.ptypes}dt/appconfig/tttypes/dtmail.ptype +${PLIST.ptypes}dt/appconfig/tttypes/dtpad.ptype +${PLIST.ptypes}dt/appconfig/tttypes/dtterm.ptype dt/appconfig/types/C/DisplayImage.dt dt/appconfig/types/C/DisplayPDF.dt dt/appconfig/types/C/DisplayPS.dt diff --git a/pkgsrc/files/dtlogin.sh b/pkgsrc/files/dtlogin.sh index 281d6ea4..05fcfdbf 100644 --- a/pkgsrc/files/dtlogin.sh +++ b/pkgsrc/files/dtlogin.sh @@ -15,6 +15,24 @@ command="@PREFIX@/dt/bin/${name}" command_args="-daemon" pidfile="@VARBASE@/dt/Xpid" extra_commands="reload" +start_precmd="dtlogin_tttypes" + +# The ToolTalk types are compiled here when the build could not (a cross build +# installs the *.ptype files only): tt_type_comp merges them into types.xdr in +# the directory, in the order the build uses (programs/tttypes/Makefile.am). +dtlogin_tttypes() +{ + tt=@PREFIX@/dt/appconfig/tttypes + [ -f $tt/types.xdr ] || [ ! -f $tt/dtfile.ptype ] || ( + cd $tt || exit 0 + for p in dtfile dticon dtpad dtcm dtmail dtdbcache dtterm dtinfo dtinfo_start + do + TTPATH=. @PREFIX@/dt/bin/tt_type_comp -sd user -m $p.ptype + done + rm -f .tt_lock + ) + return 0 +} load_rc_config $name run_rc_command "$1" diff --git a/programs/tttypes/Makefile.am b/programs/tttypes/Makefile.am index 47471a49..d75194fe 100644 --- a/programs/tttypes/Makefile.am +++ b/programs/tttypes/Makefile.am @@ -19,13 +19,23 @@ LOCALDEPFILES = \ dtinfo.done \ dtinfo_start.done -BUILT_SOURCES = types.xdr CLEANFILES = *.done types.xdr .tt_lock tttypesdir = $(CDE_INSTALLATION_TOP)/appconfig/tttypes + +if TTTYPES_BUILD +BUILT_SOURCES = types.xdr dist_tttypes_DATA = $(BUILT_SOURCES) types.xdr: $(LOCALDEPFILES) +else +# tt_type_comp is a program of the target: the ptype files are installed and +# compiled on the target (pkgsrc/files/dtlogin.sh, before dtlogin starts). +dist_tttypes_DATA = $(PTYPES) dtinfo_start.opnums +endif + +PTYPES = dtcm.ptype dtdbcache.ptype dtfile.ptype dticon.ptype dtinfo.ptype \ + dtinfo_start.ptype dtmail.ptype dtpad.ptype dtterm.ptype TT_TYPE_COMP = $(top_builddir)/lib/tt/bin/tt_type_comp/tt_type_comp