[comp.windows.x] X11 on the sun

drs@BNL.ARPA (David R. Stampf) (09/29/87)

I made some references to the hard time on bringing up X11 on a Sun last week.
I also promised some hard step by step directions. Here they are.  I am running
a Sun 2/50 with 2 MEG and OS3.4.  The server is a sun 2 with 4 Meg of memory.

This version seems a lot more sluggish, and the loss of tools like xperfmon
and the tex preveiwer is causing enough gnashing of teeth around here that I
may be forced back to XV10R4.  

Anyway - not to look a gift horse in the mouth, here are the notes I kept on
bringing it up on the sun.  Later this week I'll post the same for Ultrix.

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

This file has notes concerning the build of the X.V11 distribution on the suns.

1)	Untar the tape

		tar -xvf X.V11R1.tar >& tar.out

2) Edit util/imake.includes/Sun.macros

	turn off all of the server debug flags
	turn off the debuglibx flag too

3) make imake

	cd util/imake
	make imake >& make.imake

4) make the top level makefile

	cp Makefile Makefile.dist
	make Makefile

5) make all of the lower makefiles

	make Makefiles

6) past experience tells me to edit the file doc/Xlib/Xman/Makefile and
   add a dummy depend target - 

		depend::

   just to remove an unnecessary error.

7) make dependencies
	
	make depend

8) make

	Disregarding the advice to type make -k, do:

		make >& make.out.1

9) It did turn out to be a good idea!  The output of the above make command
	was 628 lines long, the last few dozen of which looked like:

	making ddx/sun
	cc -c  -I.  -I../../include -I../mfb -I../../dix -I../../../include  sunInit.c
	cc -c  -I.  -I../../include -I../mfb -I../../dix -I../../../include  kbd_mode.c
	rm -f kbd_mode
	cc -o kbd_mode kbd_mode.o   
	cc -c  -I.  -I../../include -I../mfb -I../../dix -I../../../include  sunBW2.c
	cc -c  -I.  -I../../include -I../mfb -I../../dix -I../../../include  sunBW2zoid.c

	< 8 lines removed >

	cc -c  -I.  -I../../include -I../mfb -I../../dix -I../../../include  sunKeyMap.crm -f libsun.a
	ar clq libsun.a kbd_mode.o
	ranlib libsun.a
	making os/4.2bsd
	cc -c  -I.  -I../../include -I../../../include -DTCPCONN -DUNIXCONN connection.ccc -c  -I.  -I../../include -I../../../include -DTCPCONN -DUNIXCONN WaitFor.c
	< 6 lines removed >

	cc -c  -I.  -I../../include -I../../../include -DTCPCONN -DUNIXCONN oscolor.c
	rm -f libos.a
	ar clq libos.a connection.o WaitFor.o utils.o io.o fileio.o filenames.o access.o  osinit.o oscolor.o
	ranlib libos.amv Xsun Xsun.bak
	mv: Xsun: Cannot access: No such file or directory
	*** Error code 1 (ignored)
	cc  -o Xsun ddx/sun/sunInit.o ddx/sun/libsun.a ddx/cfb/libcfb.a dix/libdix.a os/4.2bsd/libos.a ddx/mfb/libmfb.a ddx/mi/libmi.a ./../extensions/server/libext.a -lm -ldbm -lsunwindow -lpixrect
	Undefined:
	_sunBW2Probe
	_sunGetImage
	_sunDisplayCursor

	< 21 lines removed >

	_TimeSinceLastInputEvent
	_main: dix/libdix.a(main.o): multiply defined
	*** Error code 2

	Stop.
	*** Error code 1

	Stop.


	Clearly, it looks like the command `ar clq libsun.a kdb_mode.o' is a bit
	lacking in substance.  The makefile in the server/ddx/sun directory is
	very suspect. The problem seems to be that $OBJS is defined 2x inside of
	it.  The first time with all of the sun goodies and the second time with
	only OBJS = kbd_mode.o.  My solution this time is to comment out the
	second definition, and add kbd_mode.o in by hand to the libsun.a 
	definition.  That is, the following line: 
	
		OBJS = kbd_mode.o

	was changed to:

		KOBJS = kbn_mode.o

	The lines:

		kbd_mode: $(OBJS) $(LOCAL_LIBRARIES)
			rm -f $@
			$(CC) -o $@ $(OBJS) $(LOCAL_LIBRARIES) $(LDFLAGS)
						  
	changed to:

		kbd_mode: $(KOBJS) $(LOCAL_LIBRARIES)
			 rm -f $@
			 $(CC) -o $@ $(KOBJS) $(LOCAL_LIBRARIES) $(LDFLAGS)
						  

	Then I did a make clean in that directory, followed by a global make
	once again.

10)	Almost - gnuplot refused to compile - missing the `nm' library.  I just
	removed gnuplot from consideration in the client makefile, and remake
	from the top level again.

11)	Looking good!  Then installation process is next.  This is a bit time
	consuming - all of the lint stuff and all.  Actually, the n-th pass thru
	the installation fails early on due to the existance of a link that
	make tries to redo.  Easily solved by replacing:

		ln -s $(INCDIR) $(FUTUREINCDIR)

	with

		-ln -s $(INCDIR) $(FUTUREINCDIR)

	in the top level Makefile.


12)	Now to the acid test.  From a bare workstation (DISPALY = bnl-yoda:0)
	Type the command 'xinit -- Xsun'

13) 	That's all - Hope it is as good for you.

	< dave 

peterson@MCC.COM (James Peterson) (10/02/87)

In article <8709291943.AA03974@bnl.arpa>, drs@bnl.arpa (David R. Stampf) writes:
> 
> 10)	Almost - gnuplot refused to compile - missing the `nm' library.  I just
> 	removed gnuplot from consideration in the client makefile, and remake
> 	from the top level again.
> 
Trying to compile gnuplot without the missing 'nm' load switch creates
a long list of undefined externals, including sqrt, sin, cos, ... which
leads one to believe that the missing library is the math library.
Changing -lnm to -lm in the load line eliminates the unsatisfied
externals, and generates a working gnuplot.  (Presumably -lnm is a
'new' math library at MIT?)

A 'working' gnuplot is somewhat misleading.  It does compile and
run, but if you ask it for help, you get:

reading help file... /orpheus/u1/gnuplot/docs/gnuplot.info: No such file 

Looking in the directory, we find the wired-in path name in plot.h,
and the file gnuplot.info in the directory.  The Makefile needs to
be modified to install the help file and change the plot.h file to
point to the correct location for your site.
-- 
James Peterson
james.peterson@mcc.com  or  ...sally!im4u!milano!peterson