Ich habe mich nun selbst an die Übersetzung von Mesa-2.2 unter SunOS 4.1.4 (Solaris 1.1.2) gewagt:
Verbindung über rlogin zur SS2 hestellen:
aluma $ rlogin 192.168.60.2
Last login: Thu Dec 20 22:13:13 on console
SunOS Release 4.1.4 (GENERIC) #2: Fri Oct 14 11:08:06 PDT 1994
Type xterm-256color unknown
$ TERM=vt100
$ export TERM
$ echo $TERM
vt100
$ date
Fri Dec 21 01:57:46 MET 2012
$ showrev
*************** showrev version 1.15 *****************
* Hostname: "toosy"
* Hostid: "554374fa"
* Kernel Arch: "sun4c"
* Application Arch: "sun4"
* Kernel Revision:
4.1.4 (GENERIC) #2: Fri Oct 14 11:08:06 PDT 1994
* Release: 4.1.4
*******************************************************
$ uname -a
SunOS toosy 4.1.4 2 sun4c
$ echo $SHELL
/bin/sh
$ which acc
/usr/lang/acc
$ which cc
/bin/cc
$ echo $PATH
/bin:/usr/bin:/usr/lang:/usr/ucb:/etc:/usr/etc:/usr/openwin/bin:.
$ echo $LD_LIBRARY_PATH
/usr/lib:/usr/openwin/lib:.
Gut. Es geht los...
(i) INFO
cc ist der K&R C Compiler, welcher mit SunOS 1/2/3/4 i.d.R. unterhalb /bin mitgeliefert wird, z.B. Sun C 1.0/1.1 (K&R style)
acc ist der ANSI C Compiler (SPARCompiler C 1.x/2.x/3.x), welcher i.d.R. - ggf. mit SPARCworks zusammen - optional angeboten wurde und unterhalb /usr/lang installiert ist
1. Datei README lesen
Mesa works on most Unix workstations with ANSI C and X11.
[...]
Toolkits (X11 only):
Mesa includes the glaux and gltk libraries from SGI. Their only real
use is for writing simple demo programs. It is highly recommended that
you do _not_ use these libraries for your own programs. There are
several alternatives:
1. GLUT (OpenGL Utility Toolkit) was written by Mark Kilgard of SGI
as a replacement for glaux and gltk. It provides a simple, portable,
window-system independent interface allowing you to write OpenGL
applications quickly and easily. GLUT isn't included with Mesa but
you'll find instructions on how to get and build GLUT in the file
README.GLUT. The second edition of the OpenGL Programming Guide,
published by Addison Wesley uses GLUT instead of the glaux library.
2. Use an Xt/Motif widget. Look in the widgets-old/ or widgets-sgi
directories for more info.
[...]
2. Datei Makefile auf zu bauende Targets prüfen
aix aix-sl amix bsdos debug dgux freebsd gcc hpux hpux-gcc hpux-sl \
irix4 irix5 irix5-dso irix6-32 irix6-n32 irix6-64 irix6-32-dso irix6-n32-dso \
irix6-64-dso linux linux-debug linux-elf linux-alpha machten-2.2 machten-4.0 \
mklinux netbsd next-x86-x11 next-x11 osf1 osf1-sl openbsd qnx sco \
solaris-x86 solaris-x86-gcc sunos4 sunos4-sl sunos4-gcc sunos4-gcc-sl \
sunos5 sunos5-sl sunos5-gcc sunos5-gcc-sl sunos5-x11r6-gcc-sl \
ultrix-gcc unicos unixware vistra:
-mkdir lib
touch src/depend
touch src-glu/depend
cd src ; $(MAKE) $@
cd src-glu ; $(MAKE) $@
cd src-tk ; $(MAKE) $@
cd src-aux ; $(MAKE) $@
cd demos ; $(MAKE) $@
cd samples ; $(MAKE) $@
cd book ; $(MAKE) $@
3. Datei Make-config auf Einstellungen für die Übersetzung prüfen
[...]
sunos4:
$(MAKE) $(MFLAGS) targets \
"GL_LIB = libMesaGL.a" \
"GLU_LIB = libMesaGLU.a" \
"TK_LIB = libMesatk.a" \
"AUX_LIB = libMesaaux.a" \
"CC = acc" \
"CFLAGS = -O -DSHM -DSUNOS4" \
"MAKELIB = ar ruv" \
"RANLIB = ranlib" \
"XLIBS = -lX11 -lXext"
sunos4-sl:
$(MAKE) $(MFLAGS) targets \
"GL_LIB = libMesaGL.so" \
"GLU_LIB = libMesaGLU.so" \
"TK_LIB = libMesatk.so" \
"AUX_LIB = libMesaaux.so" \
"CC = acc" \
"CFLAGS = -Kpic -O -I/usr/include/X11R5 -DSHM -DSUNOS4" \
"MAKELIB = ld -assert pure-text -o" \
"RANLIB = true" \
"XLIBS = -L/usr/lib/X11R5 -lX11 -lXext"
sunos4-gcc:
[...]
Parameter für Target sunos4-sl prüfen:
"CFLAGS = -Kpic -O -I/usr/include/X11R5 -DSHM -DSUNOS4" \-Kpic
#PIC (Position Independed Code) with short offsets
Sun C (SunOS 4.1) not supported; use "-pic"
ANSI C (SunOS 4.1) not supported; use "-pic"
ANSI C (SunOS 5.0) supported => irrelevant für SunOS 4.x
-O
#Generate optimized code
-I/usr/include/X11R5
#(-Ix) Add x to include path
=> bei SunOS 4.1.4 unterhalb /usr/openwin/include
-DSHM
-DSUNOS4
#-Dsymbol[=def] Define symbol to def
"MAKELIB = ld -assert pure-text -o" \-assert pure-text
#"-assert" Check an assertion about the link editing being performed.
#"pure-text" The resulting load has no relocation items remaining in its text.
-o
#Set name of output file
"RANLIB = true" \ "XLIBS = -L/usr/lib/X11R5 -lX11 -lXext"-Lx
#Add x to ld library path
$ for f in `find . -name "libX11*" -print` ; do file $f ; done
./libX11.sa: symbolic link to libX11.sa.4.3
./libX11.sa.4.3: archive random library
./libX11.so: symbolic link to libX11.so.4.3
./libX11.so.4.3: sparc demand paged shared library executable not stripped
./libX11.a: archive random library
./libX11_p.a: archive random library
$ for f in `find . -name "libXext*" -print` ; do file $f ; done
./libXext.a: archive random library
./libXext_p.a: archive random library-lx
#Read object library x (for ld)
=> bei SunOS 4.1.4 nur X11R4.3 - kein X11R5 dabei (?); X11-/-Extension-Lib liegen unterhalb /usr/openwin/lib
$ diff Make-config.orig Make-config
638c638
< "CFLAGS = -Kpic -O -I/usr/include/X11R5 -DSHM -DSUNOS4" \
---
> "CFLAGS = -pic -O -I/usr/openwin/include/X11 -DSHM -DSUNOS4" \
641c641
< "XLIBS = -L/usr/lib/X11R5 -lX11 -lXext"
---
> "XLIBS = -L/usr/openwin/lib -lX11 -lXext"
Welches Target nehmen: sunos4 oder sunos4-sl?
$ cd Mesa-2.2
$ make | grep -i sun4
make sunos4 for Suns with SunOS 4.x
make sunos4-sl for Suns with SunOS 4.x, make shared libs
make sunos4-gcc for Suns with SunOS 4.x and GCC
make sunos4-gcc-sl for Suns with SunOS 4.x, GCC, make shared libs
Ich habe mich für sunos4-sl entschieden...und werde nach ca. 5-7 Minuten prompt mit einer Fehlermeldungen über Syntaxfehler sowie eine fehlende X11-Extension überhäuft...
$ cd src
$ time make sunos4-sl
make targets \
"GL_LIB = libMesaGL.so" \
"GLU_LIB = libMesaGLU.so" \
"TK_LIB = libMesatk.so" \
"AUX_LIB = libMesaaux.so" \
"CC = acc" \
"CFLAGS = -pic -O -I/usr/openwin/include -DSHM -DSUNOS4" \
"MAKELIB = ld -assert pure-text -o" \
"RANLIB = true" \
"XLIBS = -L/usr/openwin/lib -lX11 -lXext"
acc -c -I../include -pic -O -I/usr/openwin/include -DSHM -DSUNOS4 accum.c
acc: Warning: OS level 4.1.4 not in table -- using 4.1.1 include path
[...]
ld -assert pure-text -o libMesaGL.so accum.o alpha.o alphabuf.o api.o attrib.o bitmap.o blend.o bresenhm.o clip.o context.o copypix.o depth.o dlist.o draw.o drawpix.o enable.o eval.o feedback.o fog.o get.o interp.o image.o light.o lines.o logic.o masking.o matrix.o misc.o pb.o pixel.o points.o pointers.o polygon.o readpix.o scissor.o span.o stencil.o teximage.o texobj.o texture.o triangle.o varray.o vb.o vertex.o winpos.o xform.o cmesa.o glx.o osmesa.o svgamesa.o xfonts.o xmesa1.o xmesa2.o xmesa3.o
ld: GLOBAL_OFFSET_TABLE overflown: need to use -PIC
*** Error code 4
make: Fatal error: Command failed for target `../lib/libMesaGL.so'
Current working directory /home/sx/opengl/Mesa-2.2/src
*** Error code 1
make: Fatal error: Command failed for target `sunos4-sl'
1283.6 real 1164.7 user 92.4 sys
ld: GLOBAL_OFFSET_TABLE overflown: need to use -PICDatei Make-config anpassen:
$ diff Make-config.orig Make-config
638c638
< "CFLAGS = -Kpic -O -I/usr/include/X11R5 -DSHM -DSUNOS4" \
---
> "CFLAGS = -Xt -PIC -O -I/usr/openwin/include -DSHM -DSUNOS4" \
641c641
< "XLIBS = -L/usr/lib/X11R5 -lX11 -lXext"
---
> "XLIBS = -L/usr/openwin/lib -lX11 -lXext"
Übersetzungslauf wiederholen...
$ date +'%D, %T' ; /usr/5bin/time make sunos4-sl ; date +'%D, %T'
12/22/;2, 02:53:51
mkdir lib
mkdir: lib: File exists
*** Error code 1 (ignored)
touch src/depend
touch src-glu/depend
cd src ; make sunos4-sl
make targets \
"GL_LIB = libMesaGL.so" \
"GLU_LIB = libMesaGLU.so" \
"TK_LIB = libMesatk.so" \
"AUX_LIB = libMesaaux.so" \
"CC = acc" \
"CFLAGS = -Xt -PIC -O -I/usr/openwin/include -DSHM -DSUNOS4" \
"MAKELIB = ld -assert pure-text -o" \
"RANLIB = true" \
"XLIBS = -L/usr/openwin/lib -lX11 -lXext"
acc -c -I../include -Xt -PIC -O -I/usr/openwin/include -DSHM -DSUNOS4 accum.c
acc: Warning: OS level 4.1.4 not in table -- using 4.1.1 include path
[...]
ld -assert pure-text -o libMesaGL.so accum.o alpha.o alphabuf.o api.o attrib.o bitmap.o blend.o bresenhm.o clip.o context.o copypix.o depth.o dlist.o draw.o drawpix.o enable.o eval.o feedback.o fog.o get.o interp.o image.o light.o lines.o logic.o masking.o matrix.o misc.o pb.o pixel.o points.o pointers.o polygon.o readpix.o scissor.o span.o stencil.o teximage.o texobj.o texture.o triangle.o varray.o vb.o vertex.o winpos.o xform.o cmesa.o glx.o osmesa.o svgamesa.o xfonts.o xmesa1.o xmesa2.o xmesa3.o
true libMesaGL.so
mv libMesaGL.so* ../lib
cd src-glu ; make sunos4-sl
[...]
ld -assert pure-text -o libMesaGLU.so glu.o mipmap.o nurbs.o nurbscrv.o nurbssrf.o nurbsutl.o project.o quadric.o tess.o tesselat.o polytest.o
true libMesaGLU.so
mv libMesaGLU.so* ../lib
cd src-tk ; make sunos4-sl
[...]
ld -assert pure-text -o libMesatk.so cursor.o event.o font.o getset.o image.o shapes.o window.o
true libMesatk.so
mv libMesatk.so* ../lib
cd src-aux ; make sunos4-sl
[...]
ld -assert pure-text -o libMesaaux.so glaux.o font.o image.o shapes.o teapot.o vect3d.o xxform.o
true libMesaaux.so
mv libMesaaux.so* ../lib
cd demos ; make sunos4-sl
make targets \
"GL_LIB = libMesaGL.so" \
"GLU_LIB = libMesaGLU.so" \
"TK_LIB = libMesatk.so" \
"AUX_LIB = libMesaaux.so" \
"CC = acc" \
"CFLAGS = -Xt -PIC -O -I/usr/openwin/include -DSHM -DSUNOS4" \
"MAKELIB = ld -assert pure-text -o" \
"RANLIB = true" \
"XLIBS = -L/usr/openwin/lib -lX11 -lXext"
acc -I../include -Xt -PIC -O -I/usr/openwin/include -DSHM -DSUNOS4 bounce.c -L../lib -lMesaaux -lMesatk -lMesaGLU -lMesaGL -lm -L/usr/openwin/lib -lX11 -lXext -o bounce
acc: Warning: OS level 4.1.4 not in table -- using 4.1.1 include path
ld: -lMesaaux: No such file or directory
*** Error code 4
make: Fatal error: Command failed for target `bounce'
Current working directory /home/sx/opengl/Mesa-2.2/demos
*** Error code 1
make: Fatal error: Command failed for target `sunos4-sl'
Current working directory /home/sx/opengl/Mesa-2.2/demos
*** Error code 1
make: Fatal error: Command failed for target `sunos4-sl'
real 27:01.3
user 23:50.3
sys 2:07.8
12/22/;2, 03:20:53
acc -I../include -Xt -PIC -O -I/usr/openwin/include -DSHM -DSUNOS4 bounce.c -L../lib -lMesaaux -lMesatk -lMesaGLU -lMesaGL -lm -L/usr/openwin/lib -lX11 -lXext -o bounce
acc: Warning: OS level 4.1.4 not in table -- using 4.1.1 include path
ld: -lMesaaux: No such file or directory
*** Error code 4$ echo $LD_LIBRARY_PATH
/usr/lib:/usr/openwin/lib:/home/sx/opengl/Mesa-2.2/lib:.
$ pwd
/home/sx/opengl/Mesa-2.2/lib
$ ls -l
total 1274
lrwxrwxrwx 1 sx 12 Dec 22 03:49 libGL.so -> libMesaGL.so
lrwxrwxrwx 1 sx 13 Dec 22 03:49 libGLU.so -> libMesaGLU.so
-rwxr-xr-x 1 sx 942080 Dec 22 03:16 libMesaGL.so
-rwxr-xr-x 1 sx 98304 Dec 22 03:18 libMesaGLU.so
-rwxr-xr-x 1 sx 49152 Dec 22 03:20 libMesaaux.so
-rwxr-xr-x 1 sx 196608 Dec 22 03:19 libMesatk.so
$ pwd
/home/sx/opengl/Mesa-2.2/demos
$ acc -H -I../include -Xt -PIC -O -I/usr/openwin/include -DSHM -DSUNOS4 bounce.c -L../lib -lMesaaux -lMesatk -lMesaGLU -lMesaGL -lm -L/usr/openwin/lib -lX11 -lXext -o bounce
acc: Warning: OS level 4.1.4 not in table -- using 4.1.1 include path
/usr/lang/SC2.0.1/include/cc_411/math.h
/usr/lang/SC2.0.1/include/cc_411/floatingpoint.h
/usr/lang/SC2.0.1/include/cc_411/stdio.h
/usr/include/sys/stdtypes.h
/usr/lang/SC2.0.1/include/cc_411/sys/ieeefp.h
/usr/lang/SC2.0.1/include/cc_411/sunmath.h
/usr/lang/SC2.0.1/include/cc_411/stdio.h
/usr/lang/SC2.0.1/include/cc_411/floatingpoint.h
/usr/lang/SC2.0.1/include/cc_411/stdio.h
../include/gltk.h
../include/GL/gl.h
../include/GL/glu.h
../include/GL/gl.h
ld: -lMesaaux: No such file or directory
Hier komme ich jetzt nicht weiter. Warum findet er die Libs nicht?