~asac/lsb/tet-harness

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
diff -Naur tet3-lite-3.7.orig/contrib/python_api/Makefile tet3-lite-3.7/contrib/python_api/Makefile
--- tet3-lite-3.7.orig/contrib/python_api/Makefile	2004-05-21 05:35:12.000000000 -0500
+++ tet3-lite-3.7/contrib/python_api/Makefile	2007-01-08 17:06:56.000000000 -0600
@@ -34,18 +34,19 @@
 #
 ########################################################################
 
+include ../../src/defines.mk
 TET_LIB_DIR	= $(TET_ROOT)/lib/tet3
 TET_LIBS	= $(TET_LIB_DIR)/tcm.o $(TET_LIB_DIR)/libapi.a
 PYTHON_INC	= /usr/include/python2.2
 CC		= /usr/bin/gcc
-CFLAGS		=  -D_POSIX_SOURCE -DNSIG=_NSIG -DTET_LITE
+CFLAGS		=  -D_POSIX_SOURCE -DTET_LITE $(COPTS)
 LDFLAGS		= -shared
 PYTET_LIB	= _pytet.so
 
 all:		$(PYTET_LIB)
 
 pytet_wrap.o:	pytet_wrap.c
-		$(CC) -I$(PYTHON_INC) -c $<
+		$(CC) $(CFLAGS) -I$(PYTHON_INC) -c $<
 
 $(PYTET_LIB):	pytet_wrap.o
 		$(CC) $(LDFLAGS) -o $@ $< $(TET_LIBS)
diff -Naur tet3-lite-3.7.orig/contrib/python_api/pytet_wrap.c tet3-lite-3.7/contrib/python_api/pytet_wrap.c
--- tet3-lite-3.7.orig/contrib/python_api/pytet_wrap.c	2004-05-21 02:24:51.000000000 -0500
+++ tet3-lite-3.7/contrib/python_api/pytet_wrap.c	2007-01-08 17:06:56.000000000 -0600
@@ -1253,15 +1253,13 @@
 static PyObject *_wrap_tet_vprintf(PyObject *self, PyObject *args) {
     PyObject *resultobj;
     char *arg1 ;
-    va_list arg2 ;
     int result;
     va_list *argp2 ;
     PyObject * obj1 = 0 ;
     
     if(!PyArg_ParseTuple(args,(char *)"sO:tet_vprintf",&arg1,&obj1)) goto fail;
     if ((SWIG_ConvertPtr(obj1,(void **) &argp2, SWIGTYPE_p_va_list,SWIG_POINTER_EXCEPTION) == -1)) SWIG_fail;
-    arg2 = *argp2; 
-    result = (int)tet_vprintf(arg1,arg2);
+    result = (int)tet_vprintf(arg1, *argp2);
     
     resultobj = PyInt_FromLong((long)result);
     return resultobj;
diff -Naur tet3-lite-3.7.orig/profile.skeleton tet3-lite-3.7/profile.skeleton
--- tet3-lite-3.7.orig/profile.skeleton	1969-12-31 18:00:00.000000000 -0600
+++ tet3-lite-3.7/profile.skeleton	2007-01-08 17:06:56.000000000 -0600
@@ -0,0 +1,33 @@
+# profile for building tet3
+HOME=`pwd`
+echo Unconfigured
+PATH=$TET_ROOT/bin:$PATH
+MANPATH=$MANPATH:$TET_ROOT/man
+PYTHONPATH=$TET_ROOT/lib/python
+export TET_ROOT PATH MANPATH PYTHONPATH
+
+# useful shell functions for TET
+tccb()
+{
+tcc -b -s $HOME/scen.bld $*
+}
+
+tcce()
+{
+tcc -e -s $HOME/scen.exec $*
+}
+
+tccc()
+{
+tcc -c -s $HOME/scen.bld $*
+}
+
+jrpt()
+{
+(cd $HOME/results; vrpt -l ${1-area} -HP `ls -d 0* | tail -1`/journal | less)
+}
+
+jx()
+{
+(cd $HOME/results; vres `ls -d 0* | tail -1`/journal | less)
+}
diff -Naur tet3-lite-3.7.orig/src/defines/linux.mk tet3-lite-3.7/src/defines/linux.mk
--- tet3-lite-3.7.orig/src/defines/linux.mk	2006-03-10 03:42:16.000000000 -0600
+++ tet3-lite-3.7/src/defines/linux.mk	2007-01-08 17:07:25.000000000 -0600
@@ -84,14 +84,20 @@
 #	    inet:  DTET_CDEFS = -D_ALL_SOURCE -DINETD
 #	    xti:   DTET_CDEFS = -D_ALL_SOURCE -DTCPTPI
 #
-TET_CDEFS = -D_POSIX_SOURCE -DNSIG=_NSIG
+# TET_CDEFS = -D_POSIX_SOURCE -DNSIG=_NSIG
+TET_CDEFS = -D_POSIX_SOURCE 
 DTET_CDEFS = -DINETD
 
 # CC - the name of the C compiler
 CC = gcc
 #
 # LD_R - the program that performs partial linking
-LD_R = ld -r
+BUILD_ARCH=$(shell uname -m)
+ifeq ($(BUILD_ARCH),ppc64)
+  LD_R = ld -r -m elf64ppc
+else
+  LD_R = ld -r
+endif
 #
 # CDEFS and COPTS - options that are always passed to cc when compiling
 # program and "ordinary" library files
@@ -101,7 +107,7 @@
 # and usually defines NSIG (the highest signal number plus one)
 # COPTS is used to specify other options (e.g.: -O)
 CDEFS = -I$(INC) -I$(DINC)
-COPTS = -O
+COPTS = -O -fPIC
 #
 # LDFLAGS - options that are always passed to cc when linking
 LDFLAGS =
diff -Naur tet3-lite-3.7.orig/src/scripts/tet_start.sh tet3-lite-3.7/src/scripts/tet_start.sh
--- tet3-lite-3.7.orig/src/scripts/tet_start.sh	2006-03-10 03:42:16.000000000 -0600
+++ tet3-lite-3.7/src/scripts/tet_start.sh	2007-01-08 17:06:56.000000000 -0600
@@ -1,5 +1,5 @@
 # -START-UNIX-ONLY-
-#!/bin/ksh
+#!/bin/sh
 # -END-UNIX-ONLY-
 # -START-WIN32-ONLY-
 : use the MKS shell