Newsgroups: comp.soft-sys.khoros

The following explains how to port khoros patch 5 to HP-UX for
s300/400 or s800/s700 workstations.

The file may look long, but it is very verbose, and includes diffs
for hp.cf. It assumes you want to use SharedLibraries since it
decreases the code size significantly (less than 35 MBytes for s700).
You actually need to edit a couple of lines in hp.cf, and do some other
minor editing.

Konstantin Konstantinides
----------------------------------------------------
To port khoros 1 patch 5 to HP-UX on an HP9000/s370, s400, s800, or s700
the following steps were taken.

1. Get the Xaw and Xmu libraries and include files 
   from hpcvaaz.cv.hp.com:~ftp/pub/MitX11R4/libs.s300.Z (or libs.s800.Z
   for the snakes) using anonymous ftp.

   As an alternative, you can also get the X11R5 libraries from
   ~ftp/pub/MitX11R5 (same machine). This is probably the preferred
   approach if you want to use X11 shared libraries.

   Uncompress and untar them into your favorite directory.

   NOTE: Don't mix those lib binaries with HP binaries in /usr/lib/X11R4
   and the include files with include files in /usr/include/X11R4.
   Unpredictable core dumbs may happen!
   Instead use /usr/local/X11R4 or /usr/lib/X11R5 or whatever else
   you like.

   (Ignore this step if you already have somehow the above
   include files and libraries in your system.)

2. Edit src/xvroutines/Lib/xvforms/Imakefile
   Remove:
   #define UnsharedObjs
   UNSHAREDOBJS =\
	   init.o

  and include init.o with the other objects.
      -------    
3. Edit /khoros/repos/config/imake_conf/hp.cf
  and /khoros/repos/config/imake_conf/Lib/hpLib.rules

  as shown in the diffs file below 
  The changes fix the following problems:
    a) Strip automatically the binaries (-s)
    b) On the s700 solve the "too much defining" error message. (-Wp,..)
    c) Include the appropriate Fortran libraries in the linking
       of C code, since some khoros libraries use FORTRAN routines too.
    d) Eliminate the -Dxxxx in f77 calls (with Shared Libraries).
    e) Point to the correct place for the X11 Libraries
    f) Install libraries with mode 555 (otherwise code with shared libraries
       will not run)

4. Depending on when you got your code you may want
    a) get the fixed src/dspl/Lib/ldfilter.c routine
      posted in the network. (4/9/92)
    b) rm khoros/src/dspl/Lib/poly_yacc.c
    Step (b) solves a linker problem on the s400.

5. Run make clean; installit. Everything should compile with no problems.
   After the compilation do
----------------------

1. edit bin/kinstall_csh, and replace "mail -s" with "mailx -s"
2. You may want to edit bin/prnmanual
(Even if you don't have troff or groff, but you have a postscript printer,
you can still print the man pages. Only set up the printer command and
always accept the default answers. It should print the existing xxxxx.ps files)

Distributed processing works, but start phantomd on the remote machine first.

Konstantinos Konstantinides

Hewlett-Packard Laboratories
P.O. Box 10490
Palo Alto, CA 94303
tel: (415) 857-4086
e-mail: kk@hpkronos.hpl.hp.com

PS. So far, my support of khoros is done at the expense of my other
    duties for which I am actually evaluated at HP.
    If you think, that this service is valuable to you, you may
    want to send me a little note I can forward to my managers :-)
    If khoros support on HP-UX influenced your decision to use or
   buy HP machines, then you may want to send them a note directly!!.
   Thanks.
------------------------Diffs----------------------------------------
*** hp.cf.orig	Fri Apr 10 10:44:33 1992
--- hp.cf	Fri Apr 10 10:44:33 1992
***************
*** 7,15 ****
   */
  
  
! #define OSName                 HP-UX 8.05
  #define OSMajorVersion         8
! #define OSMinorVersion         5
  
  #define SystemV                YES
  
--- 7,15 ----
   */
  
  
! #define OSName                 HP-UX 8.07
  #define OSMajorVersion         8
! #define OSMinorVersion         7
  
  #define SystemV                YES
  
***************
*** 76,87 ****
  #define InstallCmd $(SCRIPTSRC)/bsdinst.sh
  #define BaseName /bin/basename
  
  #ifdef hp9000s800
! #   define StandardDefines        -DSYSV
  #   define OptimizedCDebugFlags   +O1
  #else
  #  if OSMajorVersion == 8
! #      define StandardDefines        -DSYSV
  #  else
  #       define StandardDefines	-Wc,-Nd4000,-Ns4300,-Ne700,-Np300 -DSYSV -D_BSD -Drindex=strrchr -Dindex=strchr
  #  endif
--- 76,88 ----
  #define InstallCmd $(SCRIPTSRC)/bsdinst.sh
  #define BaseName /bin/basename
  
+ #define InstLibFlags -m 0555
  #ifdef hp9000s800
! #   define StandardDefines        -s -Wp,-H512000 -DSYSV
  #   define OptimizedCDebugFlags   +O1
  #else
  #  if OSMajorVersion == 8
! #  define StandardDefines         -s -DSYSV
  #  else
  #       define StandardDefines	-Wc,-Nd4000,-Ns4300,-Ne700,-Np300 -DSYSV -D_BSD -Drindex=strrchr -Dindex=strchr
  #  endif
***************
*** 89,98 ****
  
  #if OSMajorVersion == 8
  #  if defined (hp9000s300) || defined (hp9000s400)
! #    define SysLibs -lBSD -lmalloc -lm -ll
  #    define ForSysLibs -lFext -lF77 -lI77
  #  else
! #    define SysLibs -lBSD -lmalloc -lm -ll
  #    define ForSysLibs -lcl -lfsys
  #  endif
  #else
--- 90,99 ----
  
  #if OSMajorVersion == 8
  #  if defined (hp9000s300) || defined (hp9000s400)
! #    define SysLibs -lBSD -lmalloc -lm -ll -lIO77
  #    define ForSysLibs -lFext -lF77 -lI77
  #  else
! #    define SysLibs -lBSD -lmalloc -lm -ll -lcl
  #    define ForSysLibs -lcl -lfsys
  #  endif
  #else
***************
*** 100,106 ****
--- 101,114 ----
  #   define ForSysLibs -lFext -lF77 -lI77
  #endif
  
+ #define XLibDir  /usr/local/x11r4/lib.s300
+ #define XIncludes -I/usr/local/x11r4
  /*
+ #define XLibDir  /usr/lib/X11R5
+ #define XIncludes -I/usr/include/X11R5
+ */
+ 
+ /*
   * The Shared libaries for HP may not be complete.  We do not
   * have an HP. This Lib/hpLib.rules is a guess at how hp
   * shared libs should be made. Please mail and changes
***************
*** 108,114 ****
   * update for the next version. 
   */
  
! #define HasSharedLibraries NO
  
  #if HasSharedLibraries
  #  define SharedLibRev 1.1                /* Use Khoros revision number */
--- 116,122 ----
   * update for the next version. 
   */
  
! #define HasSharedLibraries YES
  
  #if HasSharedLibraries
  #  define SharedLibRev 1.1                /* Use Khoros revision number */
*** Lib/hpLib.rules.or	Mon Apr  6 13:38:05 1992
--- Lib/hpLib.rules	Mon Apr  6 13:38:05 1992
***************
*** 73,81 ****
  									@@\
  .f.o:									@@\
  	$(RM) $@ shared/$@						@@\
! 	$(FC) -c $(SHAREDCODEDEF) $(SHLIBDEF) $(FLIBFLAGS) $*.f		@@\
  	$(MV) $*.o shared/$*.o						@@\
! 	$(FC) -c $(SHLIBDEF) $(FLIBFLAGS) $*.f				@@\
                                                                          @@\
  clean::									@@\
  	-@if [ -d shared ]; then echo " $(RM) shared/?*.o"; \		@@\
--- 73,81 ----
  									@@\
  .f.o:									@@\
  	$(RM) $@ shared/$@						@@\
! 	$(FC) -c $(FLIBFLAGS) $*.f		@@\
  	$(MV) $*.o shared/$*.o						@@\
! 	$(FC) -c $(FLIBFLAGS) $*.f				@@\
                                                                          @@\
  clean::									@@\
  	-@if [ -d shared ]; then echo " $(RM) shared/?*.o"; \		@@\