From: cek@sdc.boeing.com (Conrad Kimball)
Newsgroups: fj.mail-lists.x-window
Subject: Re: Compiling X11R4
Date: 6 Jan 93 10:32:15 GMT
Distribution: fj
Organization: Boeing Computer Services, Seattle, WA

Date: 5 Jan 93 19:55:52 GMT
Message-Id: <7722@fury.BOEING.COM>
Newsgroups: comp.windows.x

In article <2g4kwB1w165w@tmchome.UUCP>, tchal@tmchome.UUCP (Thomas M. Chalfant) writes:
|> Fellow netters:
|> 
|> I am experiencing some problems getting the standard MIT X11R4 distribution to
|> compile with no errors.  Could someone offer some help?  Here's a synopsis
|> of our setup.
|> 
|> Sun Server running SunOs 4.1.2, standard MIT X11R4 distribution.  I rlogin to
|> the server from my workstation, change to the appropriate directory and issue
|>    'make World >& make.world'
|> as instructed in the install docs.  This is after making changes to the
|> site.def, etc.; and after applying patches 1-18.  All patches seemed to apply
|> fine with the exception of one patch that was being applied to the IBM server
|> code (which I will not be using anyway).  Hence I ignored this problem.
|> 
|> After looking at make.world, it has a bunch of errors when compiling the
|> client programs.  The errors have to do with ld and a bunch of undefined
|> symbols mostly with names of Intrinisics functions prepended with an
|> underscore.  However, some of these same programs seem to run just fine with
|> casual observance.

The R4 Xmu shared library is being built incorrectly.  Sun changed the
way ld works in SunOS 4.1.2, and while MIT fixed the build problem in
R5, R4 exhibits problems.  Sun has binary patches for their R4-based
OPENWINDOWS 3.0 product (see the FAQ for details), but has not released
source code patches.  I have developed a patch that I use, which you
can find on export.lcs.mit.edu as file:
    contrib/X11R4_sunos4.1.2_patch_version3.Z
It essentially retrofits the R5 library build changes into R4.

|> By the way, there is a vendor's X11R4 distribution already installed on the
|> server in the default location.  I desire to no longer use the vendor supplied
|> version for various reasons (no source, not all patches applied, etc.), and
|> would also like to install X in other than the default location to make
|> upgrades easier in the future, and to facilitate having more than one version
|> available for testing purposes, etc.

You can, at build time, configure X11R4 to "live" in a non-standard
location.  I use the patches enclosed below to do this.  The compiled
libraries and executables will still contain compiled-in path names
reflecting this non-standard location, so if you want to change that
location again, you will need to rebuild everything.

I also have patches to R4 that change all the compiled-in path names
to use an environment variable, similar to the way Sun's OPENWINDOWS
uses $OPENWINHOME, but the patches are too extensive (~2000 lines) to
post here.  Then I can move the installed R4 anywhere and simply adjust
a single environment variable to point to that location.  (I'm working
on putting this facility into R5, too, but I'm not done yet.)

|> Also, I intend to compile OSF Motif next, and again would like to install
|> this in other than the default location to facilitate having multiple versions
|> for testing, etc.

I have corresponding patches to Motif 1.1.4 to allow it to live in a
nonstandard location, and to use an environment variable to point to
its installed location.  I'm not sure about how to distribute Motif
patches without running into license problems - can anyone help me
out here?

|> Does anyone have any suggestions for me to try?  I am open to anyone's
|> comments.

Following are the patches I use to build X11R4 to live in a nonstandard
location.  Some of these are configuration patches, others are fixes to
get several components to honor the nonstandard configuration settings.
-----------------------------------
This patch configures the MIT X-Window Version 11 Release 4 tape to have
X-Windows live in the directories:

    $(DESTDIR)/adm
    $(DESTDIR)/bin
    $(DESTDIR)/include/X11
    $(DESTDIR)/lib
    $(DESTDIR)/man

This allows X11R4 to coexist with another version of X-Windows that may
already be installed on the system.  The actual home location is determined
by another patch that #define-s the DestDir cpp symbol, which in turn
becomes the $(DESTDIR) make macro.


*** mit/config/site.def.orig	Sun Dec 17 15:06:24 1989
--- mit/config/site.def	Fri Sep 21 12:21:55 1990
***************
*** 169,171 ****
--- 169,194 ----
  #ifndef InstallXinitConfig
  #define InstallXinitConfig YES
  #endif
+ 
+ /*
+  * Install X11R4 in non-standard directory hierarchies.
+  */
+ #ifndef AdmDir
+ #define AdmDir $(DESTDIR)/adm
+ #endif
+ 
+ #ifndef BinDir
+ #define BinDir $(DESTDIR)/bin
+ #endif
+ 
+ #ifndef IncRoot
+ #define IncRoot $(DESTDIR)/include
+ #endif
+ 
+ #ifndef ManDirectoryRoot
+ #define ManDirectoryRoot /man
+ #endif
+ 
+ #ifndef UsrLibDir
+ #define UsrLibDir $(DESTDIR)/lib
+ #endif
-----------------------------------
This patch configures the MIT X-Window Version 11 Release 4 tape to have
X-Windows live in the directory tree rooted in "/usr/local/x11r4" rather
than "/".  This allows X11R4 to coexist with another version of X-Windows
that may already be installed on the system.


*** mit/config/site.def.orig	Sun Dec 17 15:06:24 1989
--- mit/config/site.def	Fri Sep 21 12:21:55 1990
***************
*** 192,194 ****
--- 192,201 ----
  #ifndef UsrLibDir
  #define UsrLibDir $(DESTDIR)/lib
  #endif
+ 
+ /*
+  * Install X11R4 under /usr/local/x11r4 rather than /
+  */
+ #ifndef	DestDir
+ #define	DestDir		/usr/local/x11r4
+ #endif
-----------------------------------
This patch fixes the "showrgb" command to default to reading its rgb
database from the one defined in the "config" directory files, rather
than always reading "/usr/lib/X11/rgb".


*** mit/rgb/Imakefile.orig	Sat Nov 18 12:44:51 1989
--- mit/rgb/Imakefile	Wed May 27 23:02:16 1992
***************
*** 1,5 ****
        DEPLIBS = 
!       DEFINES = NdbmDefines
       INCLUDES = -I$(TOP) -I$(SERVERSRC)/include
   INSTALLFLAGS = $(INSTLIBFLAGS)
          SRCS1 = rgb.c
--- 1,25 ----
+ /*
+  * The following configuration parameter may be set in the appropriate
+  * .macros files or site.def in the directory util/imake.includes/:
+  *
+  *     DefaultRGBDatabase             RGB_DB
+  *
+  * The sample util/imake.includes/Imake.tmpl will provide generic defaults.
+  * The values in site.h are simply a last line of defense and should not be
+  * changed.
+  */
+ 
+ #ifdef DefaultRGBDatabase
+     DEFAULTRGBDATABASE = DefaultRGBDatabase
+     SITE_RGB_DB = -DRGB_DB='"$(DEFAULTRGBDATABASE)"'
+ #else
+     SITE_RGB_DB = -DRGB_DB='"/usr/lib/X11/rgb"'
+ #endif
+ 
+  SITE_DEFINES = $(SITE_RGB_DB)
+ 
        DEPLIBS = 
!       DEFINES = NdbmDefines $(SITE_DEFINES)
       INCLUDES = -I$(TOP) -I$(SERVERSRC)/include
   INSTALLFLAGS = $(INSTLIBFLAGS)
          SRCS1 = rgb.c
-----------------------------------
This patch fixes xdm to correctly look in the configuration-defined
$(XDMDIR) for the DEF_KEY_FILE and DEF_REMOTE_AUTH_DIR definitions,
rather than always using "/usr/lib/X11/xdm/Xkeys" and "/usr/lib/X11/xdm".


*** mit/clients/xdm/Imakefile.orig	Sun Oct  6 20:49:49 1991
--- mit/clients/xdm/Imakefile	Thu May 28 22:40:51 1992
***************
*** 70,75 ****
--- 70,77 ----
  		  '-DDEF_FAILSAFE_CLIENT="$(BINDIR)/xterm"' \
  		  '-DDEF_XDM_CONFIG="$(XDMDIR)/xdm-config"' \
  		  '-DDEF_AUTH_FILE="$(XDMDIR)/auth-server"' \
+ 		  '-DDEF_REMOTE_AUTH_DIR="$(XDMDIR)"' \
+ 		  '-DDEF_KEY_FILE="$(XDMDIR)/Xkeys"' \
  		  '-DCPP_PROGRAM="$(CPP_PROGRAM)"'
  
  ComplexProgramTarget_1(xdm,$(LOCAL_LIBRARIES), /**/)
-----------------------------------
This patch fixes the Xmu library to look in the proper place for the
bitmap directory.  Previously it always compiled to look in the
"/usr/include/X11/bitmaps" directory, even when the rest of the X11R4
distribution had been told that the "include" directory was something
other than "/usr/include/X11".  Thanks go to Dan Greening of UCLA
for pointing out this problem to me.


*** mit/lib/Xmu/Imakefile.orig	Sun Jun  9 18:30:10 1991
--- mit/lib/Xmu/Imakefile	Sun Jun  9 18:53:03 1991
***************
*** 15,20 ****
--- 15,21 ----
  #ifdef OsNameDefines
  OS_NAME_DEFINES = OsNameDefines
  #endif
+         DEFINES = -DBITMAPDIR='"$(INCDIR)/bitmaps"'
          CSSDEFS = $(OS_NAME_DEFINES) ConnectionFlags
  
  HEADERS = \

--
Conrad Kimball       | Client Server Tech Services, Boeing Computer Services
cek@sdc.boeing.com   | P.O. Box 24346, MS 7A-35
(206) 865-6410       | Seattle, WA  98124-0346