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
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
|
diff -Nur saods9.orig/ds9/ds9.C saods9/ds9/ds9.C
--- saods9.orig/ds9/ds9.C 2009-11-04 02:32:16.000000000 +0000
+++ saods9/ds9/ds9.C 2009-11-04 02:58:59.000000000 +0000
@@ -13,8 +13,6 @@
void TclSetStartupScriptFileName(const char*);
- int Zvfs_Init(Tcl_Interp*);
- int Zvfs_Mount(Tcl_Interp*, char*, char *);
int Blt_Init(Tcl_Interp*);
int Tktable_Init(Tcl_Interp*);
@@ -73,15 +71,13 @@
appname = dupstr(argv[0]);
// set default encoding dir
- Tcl_SetDefaultEncodingDir("./zvfsmntpt/tcl8.4");
// so that tcl and tk know where to find their libs
// we do it here before InitLibraryPath is called
- putenv((char*)"TCL_LIBRARY=./zvfsmntpt/tcl8.4");
- putenv((char*)"TK_LIBRARY=./zvfsmntpt/tk8.4");
+
// invoke startup script
- TclSetStartupScriptFileName("./zvfsmntpt/src/ds9.tcl");
+ TclSetStartupScriptFileName("/usr/share/ds9/ds9.tcl");
}
Tcl_Interp *global_interp;
@@ -100,31 +96,8 @@
// We have to initialize the virtual filesystem before calling
// Tcl_Init(). Otherwise, Tcl_Init() will not be able to find
// its startup script files.
- if (Zvfs_Init(interp) == TCL_ERROR)
- return TCL_ERROR;
- Tcl_StaticPackage (interp, "zvfs", Zvfs_Init,
- (Tcl_PackageInitProc*)NULL);
// find current working directory, and set as mount point
- {
- Tcl_DString pwd;
- Tcl_DStringInit(&pwd);
- Tcl_GetCwd(interp, &pwd);
-#ifdef ZIPFILE
- ostringstream str;
- str << (char *)Tcl_GetNameOfExecutable()
- << "/../ds9.zip"
- << ends;
- if( Zvfs_Mount(interp, (char*)str.str().c_str(), Tcl_DStringValue(&pwd)) != TCL_OK ){
- cerr << "ERROR: The auxiliary ds9 file 'ds9.zip' is missing. If you moved the ds9 program from its original location, please also move the zip file to the same place." << endl;
- exit(1);
- }
-#else
- Zvfs_Mount(interp, (char *)Tcl_GetNameOfExecutable(),
- Tcl_DStringValue(&pwd));
-#endif
- Tcl_DStringFree(&pwd);
- }
// Initialize Tcl and Tk
if (Tcl_Init(interp))
@@ -133,7 +106,6 @@
// Tk
if (Tk_Init(interp))
return TCL_ERROR;
- Tcl_StaticPackage(interp,"Tk", Tk_Init, Tk_SafeInit);
{
Tcl_DString pwd;
@@ -142,18 +114,6 @@
Tcl_DStringFree(&pwd);
}
- // Blt
- if (Blt_Init(interp) == TCL_ERROR)
- return TCL_ERROR;
- Tcl_StaticPackage (interp, "BLT", Blt_Init,
- (Tcl_PackageInitProc*)NULL);
-
- // Tktable
- if (Tktable_Init(interp) == TCL_ERROR)
- return TCL_ERROR;
- Tcl_StaticPackage (interp, "Tktable", Tktable_Init,
- (Tcl_PackageInitProc*)NULL);
-
// Checkdns
if (Checkdns_Init(interp) == TCL_ERROR)
return TCL_ERROR;
@@ -171,13 +131,6 @@
return TCL_ERROR;
Tcl_StaticPackage (interp, "tkhtml", Tkhtml_Init,
(Tcl_PackageInitProc*)NULL);
-
- // Tclxpa
- if (Tclxpa_Init(interp) == TCL_ERROR)
- return TCL_ERROR;
- Tcl_StaticPackage (interp, "Tclxpa", Tclxpa_Init,
- (Tcl_PackageInitProc*)NULL);
-
// IIS
if (Iis_Init(interp) == TCL_ERROR)
return TCL_ERROR;
@@ -194,84 +147,6 @@
if (Tclxml_Init(interp) == TCL_ERROR)
return TCL_ERROR;
- // Tkimg
- if (Tkimg_Init(interp) == TCL_ERROR)
- return TCL_ERROR;
- Tcl_StaticPackage (interp, "img",
- Tkimg_Init,(Tcl_PackageInitProc*)NULL);
-
- // zlibtcl
- if (Zlibtcl_Init(interp) == TCL_ERROR)
- return TCL_ERROR;
- Tcl_StaticPackage (interp, "zlibtcl", Zlibtcl_Init,
- (Tcl_PackageInitProc*)NULL);
-
- // jpegtcl
- if (Jpegtcl_Init(interp) == TCL_ERROR)
- return TCL_ERROR;
- Tcl_StaticPackage (interp, "jpegtcl", Jpegtcl_Init,
- (Tcl_PackageInitProc*)NULL);
-
- // Tkimgjpeg
- if (Tkimgjpeg_Init(interp) == TCL_ERROR)
- return TCL_ERROR;
- Tcl_StaticPackage (interp, "jpeg", Tkimgjpeg_Init,
- (Tcl_PackageInitProc*)NULL);
-
- // Tifftcl
- if (Tifftcl_Init(interp) == TCL_ERROR)
- return TCL_ERROR;
- Tcl_StaticPackage (interp, "tifftcl", Tifftcl_Init,
- (Tcl_PackageInitProc*)NULL);
-
- // Tkimgtiff
- if (Tkimgtiff_Init(interp) == TCL_ERROR)
- return TCL_ERROR;
- Tcl_StaticPackage (interp, "tiff", Tkimgtiff_Init,
- (Tcl_PackageInitProc*)NULL);
-
- // Pngtcl
- if (Pngtcl_Init(interp) == TCL_ERROR)
- return TCL_ERROR;
- Tcl_StaticPackage (interp, "pngtcl", Pngtcl_Init,
- (Tcl_PackageInitProc*)NULL);
-
- // Tkimgpng
- if (Tkimgpng_Init(interp) == TCL_ERROR)
- return TCL_ERROR;
- Tcl_StaticPackage (interp, "png", Tkimgpng_Init,
- (Tcl_PackageInitProc*)NULL);
-
- // Tkimggif
- if (Tkimggif_Init(interp) == TCL_ERROR)
- return TCL_ERROR;
- Tcl_StaticPackage (interp, "gif", Tkimggif_Init,
- (Tcl_PackageInitProc*)NULL);
-
- // Tkimgppm
- if (Tkimgppm_Init(interp) == TCL_ERROR)
- return TCL_ERROR;
- Tcl_StaticPackage (interp, "ppm", Tkimgppm_Init,
- (Tcl_PackageInitProc*)NULL);
-
- // Tkimgbmp
- if (Tkimgbmp_Init(interp) == TCL_ERROR)
- return TCL_ERROR;
- Tcl_StaticPackage (interp, "bmp", Tkimgbmp_Init,
- (Tcl_PackageInitProc*)NULL);
-
- // Tkimgxbm
- if (Tkimgxbm_Init(interp) == TCL_ERROR)
- return TCL_ERROR;
- Tcl_StaticPackage (interp, "xbm", Tkimgxbm_Init,
- (Tcl_PackageInitProc*)NULL);
-
- // Tkimgwindow
- if (Tkimgwindow_Init(interp) == TCL_ERROR)
- return TCL_ERROR;
- Tcl_StaticPackage (interp, "window", Tkimgwindow_Init,
- (Tcl_PackageInitProc*)NULL);
-
// Signal_Ext
#ifndef _WIN32
if (Signal_ext_Init(interp) == TCL_ERROR)
@@ -294,15 +169,6 @@
(Tcl_PackageInitProc*)NULL);
#endif
- // Variables
- Tcl_SetVar(interp, "auto_path", "./zvfsmntpt/tcl8.4 ./zvfsmntpt/tk8.4 ./zvfsmntpt/blt2.4 ./zvfsmntpt/tcllib1.6 ./zvfsmntpt/src", TCL_GLOBAL_ONLY);
- Tcl_SetVar(interp, "tcl_libPath", "./zvfsmntpt/tcl8.4", TCL_GLOBAL_ONLY);
- Tcl_SetVar(interp, "blt_library", "./zvfsmntpt/blt2.4", TCL_GLOBAL_ONLY);
- Tcl_SetVar(interp, "blt_libPath", "./zvfsmntpt/blt2.4", TCL_GLOBAL_ONLY);
- Tcl_SetVar2(interp, "env", "TK_TABLE_LIBRARY", "", TCL_GLOBAL_ONLY);
-
- //Tcl_SetVar(interp, "tcl_rcFileName", "~/.wishrc", TCL_GLOBAL_ONLY);
-
return TCL_OK;
}
diff -Nur saods9.orig/ds9/Makefile saods9/ds9/Makefile
--- saods9.orig/ds9/Makefile 2009-11-04 02:32:16.000000000 +0000
+++ saods9/ds9/Makefile 2009-11-04 03:10:28.000000000 +0000
@@ -4,12 +4,7 @@
#--------------------------defines
ZDIR = zipdir/zvfsmntpt
-FFILES = $(ZDIR)/$(TCLVER) \
- $(ZDIR)/$(TKVER) \
- $(ZDIR)/$(BLTVER) \
- $(ZDIR)/$(TCLLIBVER) \
- $(ZDIR)/$(TKCONVER) \
- $(ZDIR)/$(XMLRPCVER) \
+FFILES = \
$(ZDIR)/src \
$(ZDIR)/msgs \
$(ZDIR)/doc \
@@ -30,39 +25,14 @@
../lib/libsaotk.a \
../lib/libtkhtml.a \
../lib/libtkmpeg.a \
- ../lib/$(TCLXMLVER)/libTclxml3.2.a \
- ../lib/$(TKIMGVER)/libtkimgwindow1.3.a \
- ../lib/$(TKIMGVER)/libtkimgjpeg1.3.a \
- ../lib/$(TKIMGVER)/libjpegtcl1.0.a \
- ../lib/$(TKIMGVER)/libtkimgtiff1.3.a \
- ../lib/$(TKIMGVER)/libtifftcl3.6.1.a \
- ../lib/$(TKIMGVER)/libtkimgpng1.3.a \
- ../lib/$(TKIMGVER)/libpngtcl1.2.6.a \
- ../lib/$(TKIMGVER)/libtkimgppm1.3.a \
- ../lib/$(TKIMGVER)/libtkimggif1.3.a \
- ../lib/$(TKIMGVER)/libtkimgbmp1.3.a \
- ../lib/$(TKIMGVER)/libtkimgxbm1.3.a \
- ../lib/$(TKIMGVER)/libzlibtcl1.2.1.a \
- ../lib/$(TKIMGVER)/libtkimg1.3.a \
- ../lib/$(TKTABLEVER)/libTktable2.9.a \
- ../lib/libfuntools.a \
../lib/librice.a \
../lib/libhcomp.a \
../lib/libplio.a \
- ../lib/libast.a \
../lib/libsaotk.a \
- ../lib/libwcs.a \
../lib/libsla.a \
- ../lib/libzvfs.a \
- ../lib/libzip.a \
- ../lib/libz.a \
- ../lib/libxpa.a \
../lib/libiis.a \
../lib/libcheckdns.a \
- ../lib/libsignal_ext.a \
- ../lib/libBLT24.a \
- ../lib/libtk8.4.a \
- ../lib/libtcl8.4.a
+ ../lib/libsignal_ext.a
endif
ifeq ($(OS),windows)
@@ -165,12 +135,9 @@
ifneq (,$(findstring leopard,$(ARCH)))
CXXFLAGS = $(CXXOPT) -I. -I../include -I$(X11INCLUDE) -DZIPFILE
-ds9 : ds9Base ds9.zip
+ds9 : ds9Base
$(RM) $@
- cp ds9Base ds9
- strip ds9
- cp ds9 ../bin/.
- cp ds9.zip ../bin/.
+ cp ds9Base ../bin/ds9
cd ../bin; $(CODESIGN) -s "SAOImage DS9" ds9
debug : ds9Base ds9.zip
@@ -180,14 +147,9 @@
ds9.zip : $(FILES)
cd zipdir; zip -r9 ../ds9.zip *
else
-ds9 : null.zip ds9Base $(FILES)
+ds9 : ds9Base $(FILES)
$(RM) $@
- cp ds9Base ds9.zip
- strip ds9.zip
- cat null.zip >> ds9.zip
- cd zipdir; zip -rA9 ../ds9.zip *
- mv ds9.zip ds9
- cp ds9 ../bin/.
+ cp ds9Base ../bin/ds9
debug : null.zip ds9Base $(FILES)
$(RM) $@
@@ -359,6 +321,23 @@
#--------------------------linux
+# for gentoo: get rid of bundled libs
+ifneq (,$(findstring gentoo,$(ARCH)))
+ds9Base : $(OBJS) $(LIBS)
+ $(RM) $@
+ rm -f libstdc++.a
+ ln -s `$(CXX) -print-file-name=libstdc++.a` .
+ $(CXX) ${LDFLAGS} \
+ $(OBJS) $(LIBS) -o $@ \
+ -Wl,-Bstatic -L. -lstdc++ \
+ -Wl,-Bdynamic -L$(X11LIB) -lX11 \
+ -ldl -lpthread -lxml2 -L/usr/lib/$(TCLXMLVER) -lTclxml3.2 \
+ -ltk -ltcl -lBLT24 \
+ -lfuntools `pkg-config --libs wcstools` -lz \
+ `ast_link`
+ rm -f libstdc++.a
+endif
+
ifneq (,$(findstring linux,$(ARCH)))
ds9Base : $(OBJS) $(LIBS)
$(RM) $@
|