Jon Trulson <j...@radscan.com> writes:

> On 06/08/2018 07:16 PM, Matthew R. Trower wrote:
>>> As for the changes - if a locally compiled motif is required, and it's
>>> customary to install that in /opt, then that's what the changes should
>>> be in sun.cf.
>>>
>>> BTW, do you distinguish in sun.cf between various
>>> opensolaris/illuminos versions?
>> Nope; Sun is Sun.  We could start distinguishing, but I don't think we
>> need to, at least at this time.  A toggle for local Motif should be fine
>> --- maybe an option in host.def or site.def as that seems to be the
>> standard configuration method for such details.  Doing so would allow
>> Tribblix and SmartOS to use their modern system Motif, and OI Hipster to
>> potentially join the party at some later date, while providing support
>> for these older systems that require a local Motif.
>
>
> Yeah, that's what I was getting at.  As automatic as possible is nice,
> if you can manage it with the information available.
>
> It should definitely be documented on the wiki for those that need to
> make manual adjustments in order to build.

Alright, here's what I've got.

It flips the build over to UseInstalledMotif, retaining the necessary
stuff in imports/motif.  Then it gives linking priority to
MotifProjectRoot so that an legacy system Motif won't override it.

As far as use, an OpenSolaris/OpenIndiana user should be able to just
install their built Motif into /usr/X11 and be done (as that's the
default MotifProjectRoot on Sun systems).  You don't even need to
symlink imports/x11/include/Xm anymore.

If a user want to install Motif somewhere else (say /opt/motif), they
can just define MotifProjectRoot in host.def, and build as normal.  I
don't think installing Motif to /usr/X11 will cause conflict, but it's a
safer bet (and arguably more civilized) to use /opt or the like.  It's
really up to the system administrator...

Wiki should be updated to remove creation of that symlink and mention
MotifProjectRoot.


Lastly, this should all be platform-agnostic.  The only further work
required for other platforms to take advatage of it should be updating
TopMotifInclude (and possibly LdPreLib) in various .cf files; this
should probably be done, but I didn't want to disrupt defaults on other
systems that I can't currently test.


-- Matthew R. Trower

>From 10a416f35827f5a6b81ad83751fafdaddd6f29a6 Mon Sep 17 00:00:00 2001
From: "Matthew R. Trower" <d...@blackshard.net>
Date: Mon, 11 Jun 2018 19:59:44 -0500
Subject: [PATCH] Enable building against an arbitrary Motif installation

* Give MotifProjectRoot priority over system libs
* Switch to UseInstalledMotif (but retain necessary imports)
---
 cde/config/cf/Motif.rules | 2 +-
 cde/config/cf/Motif.tmpl  | 2 +-
 cde/config/cf/site.def    | 6 ++++--
 cde/config/cf/sun.cf      | 4 ++--
 4 files changed, 8 insertions(+), 6 deletions(-)

diff --git a/cde/config/cf/Motif.rules b/cde/config/cf/Motif.rules
index 8968f198..24ee12ad 100644
--- a/cde/config/cf/Motif.rules
+++ b/cde/config/cf/Motif.rules
@@ -653,7 +653,7 @@ clean::									@@\
 
 /* Search the Motif ProjectRoot too if it is different. */
 #ifdef MotifProjectRoot
-# define MUsrLibDirPath	Concat(XUsrLibDirPath,:$(MPROJECTROOT)/lib)
+# define MUsrLibDirPath	Concat($(MPROJECTROOT)/lib,:XUsrLibDirPath)
 #else
 # define MUsrLibDirPath	XUsrLibDirPath
 #endif
diff --git a/cde/config/cf/Motif.tmpl b/cde/config/cf/Motif.tmpl
index dc053ab8..f3d61265 100644
--- a/cde/config/cf/Motif.tmpl
+++ b/cde/config/cf/Motif.tmpl
@@ -73,7 +73,7 @@ XCOMM $TOG: Motif.tmpl /main/6 1999/05/19 17:00:05 mgreess $
 #endif
 
 #ifndef MTop
-# if ImportMotif
+# if ImportMotif || UseInstalledMotif
 #  define MTop $(TOP)/imports/motif
 # else
 #  define MTop $(TOP)
diff --git a/cde/config/cf/site.def b/cde/config/cf/site.def
index 785d2594..5f706e6a 100644
--- a/cde/config/cf/site.def
+++ b/cde/config/cf/site.def
@@ -21,9 +21,11 @@ XCOMM site:  $TOG: site.def /main/23 1998/03/19 18:43:26 mgreess $
 /* CDE uses a .C suffix for C++ source, not the default .cxx */
 # define CCsuf			C
 
-/* We will import x11 and Motif. */
+/* We will import x11. */
 # define ImportX11		YES
-# define ImportMotif		YES
+
+/* We will use installed Motif. */
+# define UseInstalledMotif	YES
 
 # ifndef TopLevelProject
 #  define TopLevelProject	cde
diff --git a/cde/config/cf/sun.cf b/cde/config/cf/sun.cf
index e238bd21..3be9684d 100644
--- a/cde/config/cf/sun.cf
+++ b/cde/config/cf/sun.cf
@@ -375,7 +375,7 @@ man_keywords::								@@\
 #define DependDefines		-D__BUILTIN_VA_ARG_INCR
 #endif
 
-#define LdPreLib		-L/usr/X11/lib -L$(BUILDLIBDIR)
+#define LdPreLib		-L$(BUILDLIBDIR)
 #define PamUnixDefines		-DPAM_NIS
 #define TtLargePICTable		YES
 #define DtSvcDefines		-DMULTIBYTE -DNO_REGCOMP
@@ -405,7 +405,7 @@ man_keywords::								@@\
 #define TtClientExtraLibs	ExtraLibraries -ldl -lintl
 
 #ifndef TopMotifInclude
-# define TopMotifInclude	/usr/X11/include
+# define TopMotifInclude	$(MPROJECTROOT)/include
 #endif
 
 #define ShlibExportListOpt(filename)	-M filename
-- 
2.16.2

------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
cdesktopenv-devel mailing list
cdesktopenv-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/cdesktopenv-devel

Reply via email to