From: Jon Trulson Date: Wed, 4 Dec 2019 21:28:44 +0000 (-0700) Subject: cpp revisited: look for a cpp binary in various locations for use at runtime X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=25035724afcd394f8d08013eb6cf2163f6a65eb1;p=oweals%2Fcde.git cpp revisited: look for a cpp binary in various locations for use at runtime Certain programs like dtlogin and tt_type_comp need access to the system's cpp command to process certain files at runtime. tradcpp is not installed on most systems, and is intended for use as a imake-cpp replacement which is all we are using it for. We still need an honest cpp for the CDE components to use. Now, we look in various places for a 'cpp' command and set CPP_COMMAND to it's value. This way tt_type_comp and other CDE programs can do required processing at runtime. --- diff --git a/cde/configure.ac b/cde/configure.ac index 00b7a444..16364cce 100644 --- a/cde/configure.ac +++ b/cde/configure.ac @@ -216,8 +216,11 @@ AC_PROG_CXX AC_PROG_CPP -dnl we need a real preprocessor, not gcc -E. We will call it GENCPP. We will -dnl go with BSD's tradcpp here... +dnl we need a real preprocessor, not gcc -E. We will call it GENCPP. +dnl We will go with BSD's tradcpp here... This is used for +dnl pre-processing during building of CDE - in the way imake used to +dnl do. This is not a replacement for cpp, used at runtime by +dnl software such as tt_type_comp. AC_SUBST(GENCPP, '$(top_builddir)/util/tradcpp/tradcpp') AM_PROG_LIBTOOL @@ -254,6 +257,13 @@ dnl programs with full paths AC_PATH_PROG(KSH, ksh) AC_PATH_PROG(XRDB, xrdb) +dnl we need to use cpp for some things, like tooltalk and other +dnl runtime uses. So look for the system's cpp. NOTE: this is NOT +dnl the CPP (gcc -E) set by AC_PROG_CPP. At this point I don't know +dnl if we should even bother looking for that as we can't really use +dnl it. +AC_PATH_PROG(CPP_PROGRAM, cpp, , + [/lib:/usr/bin:/usr/ccs/lib/:/usr/lib:/usr/libexec:/opt/langtools/lbin:$PATH]) dnl programs AC_CHECK_PROGS(BDFTOPCF, bdftopcf) diff --git a/cde/lib/tt/bin/tt_type_comp/Makefile.am b/cde/lib/tt/bin/tt_type_comp/Makefile.am index b79fd24c..1c9a73f4 100644 --- a/cde/lib/tt/bin/tt_type_comp/Makefile.am +++ b/cde/lib/tt/bin/tt_type_comp/Makefile.am @@ -12,7 +12,7 @@ mp_types_gram.h: bin_PROGRAMS = tt_type_comp tt_type_comp_CXXFLAGS = -I../../lib -I../../slib \ - $(TT_VERSION_DEFINE) -DCPP_PROGRAM="\"$(GENCPP)\"" + $(TT_VERSION_DEFINE) -DCPP_PROGRAM="\"$(CPP_PROGRAM)\"" tt_type_comp_SOURCES = mp_type_comp.C mp_types_table.C \ frozen.mp_types_lex.C frozen.mp_types_gram.C diff --git a/cde/programs/dtlogin/Makefile.am b/cde/programs/dtlogin/Makefile.am index ff48cfa3..488550a2 100644 --- a/cde/programs/dtlogin/Makefile.am +++ b/cde/programs/dtlogin/Makefile.am @@ -8,13 +8,11 @@ DEF_SERVER = $(XBINDIR)/X DEF_USER_PATH = $(PATH):$(XBINDIR) DEF_SYSTEM_PATH = $(PATH):$(XBINDIR) -CPP_PROGRAM = $(prefix)/bin/traddcpp - -DEF_BM_PATH = $(CDE_CONFIGURATION_TOP)/appconfig/icons/%L/%B%M.bm:$(CDE_CONFIGURATION_TOP)/appconfig/icons/%L/%B%M.pm:$(CDE_CONFIGURATION_TOP)/appconfig/icons/%L/%B:$(CDE_CONFIGURATION_TOP)/appconfig/icons/C/%B%M.bm:$(CDE_CONFIGURATION_TOP)/appconfig/icons/C/%B%M.pm:$(CDE_CONFIGURATION_TOP)/appconfig/icons/C/%B:${prefix}/appconfig/icons/%L/%B%M.bm:${prefix}/appconfig/icons/%L/%B%M.pm:${prefix}/appconfig/icons/%L/%B:${prefix}/appconfig/icons/C/%B%M.bm:${prefix}/appconfig/icons/C/%B%M.pm:${prefix}/appconfig/icons/C/%B -DEF_PM_PATH = $(CDE_CONFIGURATION_TOP)/appconfig/icons/%L/%B%M.pm:$(CDE_CONFIGURATION_TOP)/appconfig/icons/%L/%B%M.bm:$(CDE_CONFIGURATION_TOP)/appconfig/icons/%L/%B:$(CDE_CONFIGURATION_TOP)/appconfig/icons/C/%B%M.pm:$(CDE_CONFIGURATION_TOP)/appconfig/icons/C/%B%M.bm:$(CDE_CONFIGURATION_TOP)/appconfig/icons/C/%B:${prefix}/appconfig/icons/%L/%B%M.pm:${prefix}/appconfig/icons/%L/%B%M.bm:${prefix}/appconfig/icons/%L/%B:${prefix}/appconfig/icons/C/%B%M.pm:${prefix}/appconfig/icons/C/%B%M.bm:${prefix}/appconfig/icons/C/%B +DEF_BM_PATH = $(CDE_CONFIGURATION_TOP)/appconfig/icons/%L/%B%M.bm:$(CDE_CONFIGURATION_TOP)/appconfig/icons/%L/%B%M.pm:$(CDE_CONFIGURATION_TOP)/appconfig/icons/%L/%B:$(CDE_CONFIGURATION_TOP)/appconfig/icons/C/%B%M.bm:$(CDE_CONFIGURATION_TOP)/appconfig/icons/C/%B%M.pm:$(CDE_CONFIGURATION_TOP)/appconfig/icons/C/%B:$(CDE_INSTALLATION_TOP)/appconfig/icons/%L/%B%M.bm:$(CDE_INSTALLATION_TOP)/appconfig/icons/%L/%B%M.pm:$(CDE_INSTALLATION_TOP)/appconfig/icons/%L/%B:$(CDE_INSTALLATION_TOP)/appconfig/icons/C/%B%M.bm:$(CDE_INSTALLATION_TOP)/appconfig/icons/C/%B%M.pm:$(CDE_INSTALLATION_TOP)/appconfig/icons/C/%B +DEF_PM_PATH = $(CDE_CONFIGURATION_TOP)/appconfig/icons/%L/%B%M.pm:$(CDE_CONFIGURATION_TOP)/appconfig/icons/%L/%B%M.bm:$(CDE_CONFIGURATION_TOP)/appconfig/icons/%L/%B:$(CDE_CONFIGURATION_TOP)/appconfig/icons/C/%B%M.pm:$(CDE_CONFIGURATION_TOP)/appconfig/icons/C/%B%M.bm:$(CDE_CONFIGURATION_TOP)/appconfig/icons/C/%B:$(CDE_INSTALLATION_TOP)/appconfig/icons/%L/%B%M.pm:$(CDE_INSTALLATION_TOP)/appconfig/icons/%L/%B%M.bm:$(CDE_INSTALLATION_TOP)/appconfig/icons/%L/%B:$(CDE_INSTALLATION_TOP)/appconfig/icons/C/%B%M.pm:$(CDE_INSTALLATION_TOP)/appconfig/icons/C/%B%M.bm:$(CDE_INSTALLATION_TOP)/appconfig/icons/C/%B AM_CFLAGS = -DCDE_CONFIGURATION_TOP=\"$(CDE_CONFIGURATION_TOP)\" \ - -DCDE_INSTALLATION_TOP=\"${prefix}\" \ + -DCDE_INSTALLATION_TOP=\"$(CDE_INSTALLATION_TOP)\" \ -DCDE_LOGFILES_TOP=\"$(CDE_LOGFILES_TOP)\" \ -I/usr/include/freetype2 -DBINDIR=\"$(XBINDIR)\" \ -DXDMDIR=\"$(XDMDIR)\" \ @@ -30,9 +28,9 @@ dtlogin_SOURCES = access.c account.c auth.c genauth.c daemon.c dm.c \ noinst_LIBRARIES = libresource.a libresource_a_SOURCES = resource.c libresource_a_CFLAGS = $(AM_CFLAGS) \ - -DDEF_SESSION=\"${prefix}/bin/Xsession\" \ + -DDEF_SESSION=\"$(CDE_INSTALLATION_TOP)/bin/Xsession\" \ -DDEF_SYSTEM_SHELL=\"/bin/sh\" \ - -DDEF_CHOOSER=\"${prefix}/bin/dtchooser\" \ + -DDEF_CHOOSER=\"$(CDE_INSTALLATION_TOP)/bin/dtchooser\" \ -DDEF_XDM_CONFIG=\"Xconfig\" -DSIGNALRETURNSINT \ -DDEF_SERVER_LINE=\"":0 Local local $(DEF_SERVER) :0"\" \ -DXRDB_PROGRAM=\"$(XRDB)\" \