Subject: Using the Apollo INLIB feature with X11
From: [email-masked] (fredrik hedman)
To: [email-masked]
Date: 4 Dec 89 17:02:11 GMT

Notes on how to use the X libraries through the INLIB facility.
===============================================================

I have been using the Apollo inlib facilities with the X11, Xaw
and Xt libraries under 9.7 AEGIS( bsd and sys5 installed); the
version of X is the version which Apollo calls: Apollo Domain/X11.

Statistics on the size given by 'ls -l':
Without INLIB				With INLIB	
254398 xboxes				2986 xboxes
230798 xbuttonbox			3060 xbuttonbox
226176 xcommand				1756 xcommand
221088 xhw				1264 xhw
50164  xhw0				3106 xhw0
54736  xhw1				4058 xhw1
221038 xhw3				1224 xhw3
221258 xlabel				1466 xlabel
224062 xscroll				2338 xscroll
230764 xsensitive			3036 xsensitive
297952 xtext				2270 xtext
340218 xwidgets				4542 xwidgets

Average of the ratio AFTER/BELOW = 0.0192712 or in other words
the size of the code is decreased by approximately 98%...

There are to things which has to be done to be able to use this
facility:
	1) produce a file which can be used by the /com/bind -inlib
		facility, and
	2) change makefiles when making applications.

Can anyone explain the undefined global below?

Well in any case I hope this will help. Any improvements of the
Makefile would be welcome.

Enjoy !
Fredrik Hedman
SPS-LEP Accelerator Computer Control
CERN
SWITZERLAND

1) INLIB: ( Put these lines into a C-shell script )
---- BEGIN CUT HERE -----
#
# Written by	Fredrik Hedman
#		SPS-LEP Accelerator Computer Control
#		CERN
#		SWITZERLAND
#
# The script does produce a lot of output, but in the
# end Undefined Globals:
#
#	XGrabKey                         First referenced in 2.inlib
# 
#
# The time to run the script is about 10 minutes.
#
# MARK use only lowercase letters in filenames and directories!
# 9.7 AEGIS feature...

# Make subdirectories for this operation
echo Making directories...
mkdir ~/inlibs test_inlib
cd test_inlib
mkdir x11_inlib xaw_inlib xt_inlib

# Extract binaries from the respective libraries
# and /com/bind them into one big file.
# I choose to go from the highest level and down;
# see 'DOMAIN binder librarian reference Multilevel binding'.
#
echo Inlibing Xaw
cd xaw_inlib
ar x /usr/lib/X11/libXaw.a 
/com/bind -allmark -exactcase -systype any *.*.bin -binary ../1.inlib
echo Xaw was inlibed

echo Inlibing Xt
cd ../xt_inlib
ar x /usr/lib/X11/libXt.a
/com/bind -allmark -exactcase -systype any *.*.bin -binary ../2.inlib
echo Xt was inlibed

echo Inlibing X11
cd ../x11_inlib
ar x /usr/lib/X11/libX11.a 
/com/bind -allmark -exactcase -systype any *.*.bin -binary ../3.inlib 
echo X11 was inlibed

cd ..
echo Inlibing Xaw,Xt and X11 into x_inlib
/com/bind -allmark -exactcase -systype any *.inlib -binary ~/inlibs/x_inlib 
echo ~/inlibs/x_inlib has been made
ls -l ~/inlibs/x_inlib 

# Clean up 
cd ..
echo Cleaning up !
/bin/rm -rf test_inlib
echo DONE

---- END CUT HERE -----

2) MAKEFILE
---- BEGIN CUT HERE -----
# Written by	Fredrik Hedman
#		SPS-LEP Accelerator Computer Control
#		CERN
#		SWITZERLAND
#
# Description: A sample makefile which will compile the Xaw
# examples using the INLIB feature. The file
# ~/inlibs/x_inlib is manufactured in
# the script above.
#
# MARK:			The version of the shell should be running bsd when
#	make is done.
#
#	There will be undefined globals due to the inlib utility...
#
#	The AEGIS command BIND does not
#	recognize big letters. More precisely,
#	when mixing AEGIS and UNIX do not use 
#	file names with big letters!
#
#	For more information See manpages of /bin/cc /com/cc,
#	/com/bind and /com/inlib.

CFLAGS =  -Ox -c -W0,-NDB,-NMAP,-MGBL,-STD,

# x_inlib contains libXaw.a libXt.a libX11.a
# This should really be in something like /usr/lib/x11 ( lower case ! )
# but I do not have the rights to put it there.
XINLIB = ~/inlibs/x_inlib

# My programs may use libraries which have been made in sys5, that is
# why I use -SYSTYPE sys5.
COMBINDFLAGS = -SYSTYPE sys5 -EXACTCASE -INLIB $(XINLIB)

# These are the Xaw examples ....
OBJS = xcommand.o hw.o hw1.o xboxes.o xbuttonbox.o xcommand.o\
		 xhw.o xhw0.o xhw1.o xhw3.o xlabel.o xscroll.o xsensitive.o xtext.o\
			xwidgets.o

.c.o:
	cc $(CFLAGS) $<
	/com/bind $(COMBINDFLAGS) $@ -BINARY $*
	size $*

all:    $(OBJS)	

clean:
	/bin/rm *.o
---- END CUT HERE -----