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
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
|
#
# This file is a Makefile for XPA. If it has the name "Makefile.in"
# then it is a template for a Makefile; to generate the actual Makefile,
# run "./configure", which is a configuration script generated by the
# "autoconf" program (constructs like "@foo@" will get replaced in the
# actual Makefile.
#
PACKAGE = @PACKAGE_NAME@
VERSION = @PACKAGE_VERSION@
DISTNAME = xpa-${VERSION}
DISTDIR = ../export/${DISTNAME}
FTPDIR = ../ftp
#----------------------------------------------------------------
# Things you can change to personalize the Makefile for your own
# site (you can make these changes in either Makefile.in or
# Makefile, but changes to Makefile will get lost if you re-run
# the configuration script).
#----------------------------------------------------------------
# Default top-level directories in which to install architecture-
# specific files (exec_prefix) and machine-independent files such
# as scripts (prefix). The values specified here may be overridden
# at configure-time with the --exec-prefix and --prefix options
# to the "configure" script.
prefix = @prefix@
exec_prefix = @exec_prefix@
# The following definition can be set to non-null for special systems
# like AFS with replication. It allows the pathnames used for installation
# to be different than those used for actually reference files at
# run-time. INSTALL_ROOT is prepended to $prefix and $exec_prefix
# when installing files.
INSTALL_ROOT =
# Directory in which to install the .a or .so binary for the XPA library:
LIB_INSTALL_DIR = $(INSTALL_ROOT)$(exec_prefix)/lib
# Directory in which to install the program wish:
BIN_INSTALL_DIR = $(INSTALL_ROOT)$(exec_prefix)/bin
# Directory in which to install the include file xpa.h:
INCLUDE_INSTALL_DIR = $(INSTALL_ROOT)$(prefix)/include
# Top-level directory for manual entries:
MAN_INSTALL_DIR = $(INSTALL_ROOT)$(prefix)/man
# Top-level directory for share entries:
MAN_SHARE_DIR = $(INSTALL_ROOT)$(prefix)/share/xpa
# Platform-specific X compiler flags (include file specifications)
X_CFLAGS = @X_CFLAGS@
# Platform-specific link directive for X libraries (-L specification)
X_LIBS = @X_LIBS@
# Platform-specific libraries that must go before -lXt
X_PRE_LIBS = @X_PRE_LIBS@
# Platform-specific libraries that must go after -lXt
X_EXTRA_LIBS = @X_EXTRA_LIBS@
# Platform-specific include files for Tcl
TCL_CFLAGS = @TCL_CFLAGS@
# Platform-specific libraries for Tcl
TCL_LIBS = @TCL_LIBS@
# Platform-specific include files for Gtk
GTK_CFLAGS = @GTK_CFLAGS@
# Platform-specific libraries for Gtk
GTK_LIBS = @GTK_LIBS@
# combine package cflags
PKG_CFLAGS = $(X_CFLAGS) $(TCL_CFLAGS) $(GTK_CFLAGS)
# extra Libs required to link (e.g. socket libraries)
LIBS = @EXTRA_LIBS@
# pthread lib needed to xpans
TLIB = @TLIB@
# To change the compiler switches, for example to change from -O
# to -g, change the following line:
CFLAGS = @CFLAGS@
# To add ld switches, change the following line:
LDFLAGS = @LDFLAGS@
# Some versions of make, like SGI's, use the following variable to
# determine which shell to use for executing commands:
SHELL = /bin/sh
# if enabled-shared was specified, this will exand to "shlib" and trigger
# building of the shared library
DOSHARED = @DOSHARED@
# There are just too many different versions of "install" around;
# better to use the install-sh script that comes with the distribution,
# which is slower but guaranteed to work.
INSTALL = @srcdir@/install-sh -c
INSTALL_PROGRAM = ${INSTALL}
INSTALL_DATA = ${INSTALL} -m 644
#----------------------------------------------------------------
# The information below is modified by the configure script when
# Makefile is generated from Makefile.in. You shouldn't normally
# modify any of this stuff by hand.
#----------------------------------------------------------------
AC_FLAGS = @DEFS@
RANLIB = @RANLIB@
EXE = @EXEEXT@
#----------------------------------------------------------------
# The information below should be usable as is. The configure
# script won't modify it and you shouldn't need to modify it
# either.
#----------------------------------------------------------------
RM = rm -f
CC = @CC@
CC_SWITCHES = -I. ${CFLAGS} ${AC_FLAGS}
DEPEND_SWITCHES = -I. ${CFLAGS} ${PKG_CFLAGS} ${AC_FLAGS}
SRCS = xpa.c xpaio.c command.c acl.c remote.c clipboard.c port.c \
tcp.c client.c word.c xalloc.c find.c xlaunch.c timedconn.c \
tclloop.c tcl.c xtloop.c gtkloop.c \
xpaset.c xpaget.c xpainfo.c xpaaccess.c xpans.c xpamb.c
BASE_OBJS = xpa.o xpaio.o command.o acl.o remote.o clipboard.o port.o \
tcp.o client.o word.o xalloc.o find.o xlaunch.o timedconn.o
TCL_OBJS = tclloop.o tcl.o
XT_OBJS = xtloop.o
GTK_OBJS = gtkloop.o
INCL = xpa.h xpap.h
# these are all the modules going into the "normal" xpa library
LIBOBJS = ${BASE_OBJS} ${TCL_OBJS} ${XT_OBJS} ${GTK_OBJS}
LIB = libxpa.a
# used in link line
# LLIB= $(LIB)
LLIB= @LLIB@
PROGS = xpaset xpaget xpainfo xpaaccess xpans xpamb
TESTPROGS = ctest stest rtest
all: xpa.h lib $(PROGS)
testall: $(TESTPROGS)
All: all testall
install:: install-binaries
install:: $(DOSHARED)_install
install:: install-man
install:: install-share
install:: install-data
lib: $(LIB) $(DOSHARED)
$(LIB): $(LIBOBJS)
$(RM) $(LIB)
ar crv $(LIB) $(LIBOBJS)
$(RANLIB) $(LIB)
shlib: $(LIB)
@(rm -rf lib$(PACKAGE).tmp; mkdir lib$(PACKAGE).tmp; \
(cd lib$(PACKAGE).tmp && ar x ../lib$(PACKAGE).a); \
rm -f lib$(PACKAGE).tmp/xt*.o; \
rm -f lib$(PACKAGE).tmp/tcl*.o; \
CC='$(CC)' CXX=$(CXX) \
./mklib -o $(PACKAGE) lib$(PACKAGE).tmp/*.o; \
rm -rf lib$(PACKAGE).tmp)
mingw-dll: $(LIBOBJS)
$(CC) -I. -DHAVE_CONFIG_H -shared port.c tcp.c acl.c find.c \
remote.c timedconn.c client.c word.c xpaio.c clipboard.c \
xlaunch.c xalloc.c command.c xpa.c \
-Wl,--output-def,libxpa.def,--out-implib,libxpa_dll.a,-no-undefined,--enable-runtime-pseudo-reloc -o libxpa.dll \
-lwsock32
tclxpa: $(LIB)
@(rm -rf libtclxpa.tmp; mkdir libtclxpa.tmp; \
(cd libtclxpa.tmp && ar x ../lib$(PACKAGE).a); \
rm -f libtclxpa.tmp/xt*.o; \
CC='$(CC)' CXX=$(CXX) \
./mklib -o tclxpa libtclxpa.tmp/*.o $(TCL_LIBS); \
test -r libtclxpa.dylib && cp -p libtclxpa.dylib libtclxpa.so && echo "copying libtclxpa.dylib to libtclxpa.so"; \
rm -rf libtclxpa.tmp)
diff:
-(for f in `ls *.c`; \
do \
echo $$f; \
diff /soft/saord/xpa-2.1.[0-9]*/$$f .; \
done);
index: $(LIB)
@(test -r pkgIndex.tcl && mv pkgIndex.tcl pkgIndex.tcl-old; \
echo "pkg_mkIndex -direct -verbose . libtclxpa.so; exit"| tclsh)
xpaset: $(LIB) xpaset.o
$(CC) $(LDFLAGS) xpaset.o -o xpaset $(LLIB) $(LIBS)
xpaget: $(LIB) xpaget.o
$(CC) $(LDFLAGS) xpaget.o -o xpaget $(LLIB) $(LIBS)
xpainfo: $(LIB) xpainfo.o
$(CC) $(LDFLAGS) xpainfo.o -o xpainfo $(LLIB) $(LIBS)
xpaaccess: $(LIB) xpaaccess.o
$(CC) $(LDFLAGS) xpaaccess.o -o xpaaccess $(LLIB) $(LIBS)
xpans: $(LIB) xpans.o
$(CC) $(LDFLAGS) xpans.o -o xpans $(LLIB) $(LIBS) $(TLIB)
xpamb: $(LIB) xpamb.o
$(CC) $(LDFLAGS) xpamb.o -o xpamb $(LLIB) $(LIBS)
ctest: $(LIB) ctest.o
$(CC) $(LDFLAGS) ctest.o -o ctest $(LLIB) $(LIBS)
stest: $(LIB) stest.o
$(CC) $(LDFLAGS) stest.o -o stest $(LIB) $(LIBS)
rtest: $(LIB) rtest.o
$(CC) $(LDFLAGS) rtest.o -o rtest $(LIB) $(LIBS)
stestx: $(LIB) stest.o
$(CC) $(LDFLAGS) stest.o -o stest $(LIB) \
$(X_LIBS) -lXt $(X_PRE_LIBS) -lXext -lX11 $(LIBS)
# Smoke test: allows end-users to quickly discern basic usability
smoke: ctest stest
./stest smoke &
sleep 3
./ctest -e -b -l 1000 smoke
./xpaset -p smoke exit
# Note: before running ranlib below, must cd to target directory because
# some ranlibs write to current directory, and this might not always be
# possible (e.g. if installing as root).
# this nop-op gets executed if we are not building shared libraries
_install:
shlib_install:
@-(for i in `ls *.so* *.dylib *.sl 2>/dev/null` ; \
do \
if [ -h $$i ] ; then \
echo "Installing link $$i" ; \
tar cf - $$i | (cd $(LIB_INSTALL_DIR); tar xf -) ; \
else \
echo "Installing $$i" ; \
$(INSTALL_DATA) $$i $(LIB_INSTALL_DIR)/$$i ; \
chmod 555 $(LIB_INSTALL_DIR)/$$i; \
fi; \
done;)
install-binaries: $(LIB) $(PROGS)
@for i in $(LIB_INSTALL_DIR) $(INCLUDE_INSTALL_DIR) $(BIN_INSTALL_DIR) ; \
do \
if [ ! -d $$i ] ; then \
echo "Making directory $$i"; \
mkdir -p $$i; \
chmod 755 $$i; \
else true; \
fi; \
done;
@echo "Installing $(LIB)";
@$(INSTALL_DATA) $(LIB) $(LIB_INSTALL_DIR)/$(LIB);
@(cd $(LIB_INSTALL_DIR); $(RANLIB) $(LIB));
@chmod 555 $(LIB_INSTALL_DIR)/$(LIB);
@echo "Installing xpa.h"
@$(INSTALL_DATA) xpa.h $(INCLUDE_INSTALL_DIR)/xpa.h
@echo "Installing prsetup.h"
@$(INSTALL_DATA) prsetup.h $(INCLUDE_INSTALL_DIR)/prsetup.h
@for i in $(PROGS) ; \
do \
echo "Installing $$i$(EXE)" ; \
$(INSTALL_PROGRAM) $$i$(EXE) $(BIN_INSTALL_DIR)/$$i$(EXE) ; \
done;
install-man:
@if [ ! -d $(MAN_INSTALL_DIR) ] ; then \
echo "Making directory $(MAN_INSTALL_DIR)"; \
mkdir -p $(MAN_INSTALL_DIR); \
chmod 755 $(MAN_INSTALL_DIR); \
else true; \
fi;
@-(for i in `ls ./man/man?/*.?` ; \
do \
B=`basename $$i`; \
E=`echo $$i | awk -F. '{print $$NF}'`; \
M="$(MAN_INSTALL_DIR)/man$$E"; \
if [ ! -d $$M ] ; then \
echo "Making directory $$M"; \
mkdir -p $$M; \
chmod 755 $$M; \
else true; \
fi; \
echo "Installing $$B" ; \
$(INSTALL_DATA) $$i $$M/$$B; \
done;)
install-share:
@if [ ! -d $(MAN_SHARE_DIR) ] ; then \
echo "Making directory $(MAN_SHARE_DIR)"; \
mkdir -p $(MAN_SHARE_DIR); \
chmod 755 $(MAN_SHARE_DIR); \
else true; \
fi;
@-(for i in `ls ./doc/sman/xpa?.*` ; \
do \
B=`basename $$i`; \
echo "Installing $$B" ; \
$(INSTALL_DATA) $$i $(MAN_SHARE_DIR)/$$B; \
done;)
install-data: install-pkgconfig
install-pkgconfig:
@-(mkdir -p $(LIB_INSTALL_DIR)/pkgconfig; \
echo "Installing xpa.pc" ; \
$(INSTALL_DATA) xpa.pc $(LIB_INSTALL_DIR)/pkgconfig;)
Makefile: Makefile.in
$(SHELL) config.status
clean: FORCE
$(RM) *.a *.so *.so.* *.dylib *.o *.exe core \
errs *pure* .nfs* \
foo* *~ *.log \#* TAGS *.E a.out errors \
$(PROGS) $(TESTPROGS) dns \
gmon.out *.pg *.bak \
config.info config.log \
doc/*~ doc/*.bak man/*~
$(RM) -r autom4te.cache a.out.dSYM dns.dSYM
distclean: clean
$(RM) Makefile config.status config.cache config.log conf.h \
xpa.pc
maintainer-clean:: clean
$(RM) config.status config.cache config.log
depend:
makedepend -- $(DEPEND_SWITCHES) -- $(SRCS)
acl.o: acl.c $(INCL)
$(CC) -c $(CC_SWITCHES) acl.c
remote.o: remote.c $(INCL)
$(CC) -c $(CC_SWITCHES) remote.c
clipboard.o: clipboard.c $(INCL)
$(CC) -c $(CC_SWITCHES) clipboard.c
client.o: client.c $(INCL)
$(CC) -c $(CC_SWITCHES) client.c
command.o: command.c $(INCL)
$(CC) -c $(CC_SWITCHES) command.c
find.o: find.c
$(CC) -c $(CC_SWITCHES) find.c
xlaunch.o: xlaunch.c
$(CC) -c $(CC_SWITCHES) xlaunch.c
timedconn.o: timedconn.c
$(CC) -c $(CC_SWITCHES) timedconn.c
port.o: port.c $(INCL)
$(CC) -c $(CC_SWITCHES) port.c
tcl.o: tcl.c $(INCL)
$(CC) -c $(CC_SWITCHES) $(TCL_CFLAGS) tcl.c
tclloop.o: tclloop.c $(INCL)
$(CC) -c $(CC_SWITCHES) $(TCL_CFLAGS) tclloop.c
gtkloop.o: gtkloop.c $(INCL)
$(CC) -c $(CC_SWITCHES) $(GTK_CFLAGS) gtkloop.c
tcp.o: tcp.c
$(CC) -c $(CC_SWITCHES) tcp.c
word.o: word.c
$(CC) -c $(CC_SWITCHES) word.c
xalloc.o: xalloc.c
$(CC) -c $(CC_SWITCHES) xalloc.c
xpa.o: xpa.c $(INCL)
$(CC) -c $(CC_SWITCHES) xpa.c
xpaio.o: xpaio.c $(INCL)
$(CC) -c $(CC_SWITCHES) xpaio.c
xtloop.o: xtloop.c $(INCL)
$(CC) -c $(CC_SWITCHES) $(X_CFLAGS) xtloop.c
xpaaccess.o: xpaaccess.c $(INCL)
$(CC) -c $(CC_SWITCHES) xpaaccess.c
xpaget.o: xpaget.c $(INCL)
$(CC) -c $(CC_SWITCHES) xpaget.c
xpainfo.o: xpainfo.c $(INCL)
$(CC) -c $(CC_SWITCHES) xpainfo.c
xpans.o: xpans.c $(INCL)
$(CC) -c $(CC_SWITCHES) xpans.c
xpamb.o: xpamb.c $(INCL)
$(CC) -c $(CC_SWITCHES) xpamb.c
xpaset.o: xpaset.c $(INCL)
$(CC) -c $(CC_SWITCHES) xpaset.c
ctest.o: ctest.c
$(CC) -c $(CC_SWITCHES) ctest.c
stest.o: stest.c
$(CC) -c $(CC_SWITCHES) $(X_CFLAGS) stest.c
rtest.o: rtest.c
$(CC) -c $(CC_SWITCHES) $(X_CFLAGS) rtest.c
stestx.o: stest.c
$(CC) -o stest.o -c $(CC_SWITCHES) $(X_CFLAGS) \
-DBUILD_WITH_XT stest.c
strstr.o: ./compat/strstr.c
$(CC) -c $(CC_SWITCHES) -o strstr.o ./compat/strstr.c
xpa.h: configure.ac
@($(RM) -r oxpa.h; \
MAJOR=`echo "${VERSION}" | awk -F. '{print $$1}'`; \
MINOR=`echo "${VERSION}" | awk -F. '{print $$2}'`; \
PATCH=`echo "${VERSION}" | awk -F. '{print $$3}'`; \
sed "s/^#define XPA_VERSION.*/#define XPA_VERSION \"$(VERSION)\"/;s/^#define XPA_MAJOR_VERSION.*/#define XPA_MAJOR_VERSION $${MAJOR}/;s/^#define XPA_MINOR_VERSION.*/#define XPA_MINOR_VERSION $${MINOR}/;s/^#define XPA_PATCH_LEVEL.*/#define XPA_PATCH_LEVEL $${PATCH}/;" < xpa.h > nxpa.h; \
mv xpa.h oxpa.h; \
mv nxpa.h xpa.h)
configure: configure.ac
autoconf
dist: configure
($(RM) -r $(DISTDIR); \
mkdir -p $(DISTDIR); \
cp -p *.[ch] *.tcl $(DISTDIR)/.; \
cp -p pkgIndex.tcl $(DISTDIR)/.; \
cp -p Makefile.in $(DISTDIR)/.; \
chmod 664 $(DISTDIR)/Makefile.in; \
cp -p conf.h.in $(DISTDIR)/.; \
chmod 664 $(DISTDIR)/conf.h.in; \
cp -p configure.ac $(DISTDIR)/.; \
chmod 644 $(DISTDIR)/configure.ac; \
cp -p *.m4 $(DISTDIR)/.; \
chmod 644 $(DISTDIR)/*.m4; \
cp -p configure $(DISTDIR)/.; \
chmod 755 $(DISTDIR)/configure; \
cp -p config.sub config.guess $(DISTDIR)/.; \
chmod 755 $(DISTDIR)/config.sub $(DISTDIR)/config.guess; \
cp -p saoconfig $(DISTDIR)/.; \
chmod 755 $(DISTDIR)/saoconfig; \
cp -p mklib $(DISTDIR)/.; \
chmod 755 $(DISTDIR)/mklib; \
cp -p install-sh $(DISTDIR)/install-sh; \
chmod 755 $(DISTDIR)/install-sh; \
cp -p README INSTALL COPYING $(DISTDIR)/.; \
mkdir $(DISTDIR)/doc; \
cp -p ./doc/*.html $(DISTDIR)/doc/.; \
cp -p ./doc/*.ps ./doc/*.pdf $(DISTDIR)/doc/.; \
cp -p ./doc/Makefile $(DISTDIR)/doc/.; \
mkdir $(DISTDIR)/doc/sman; \
cp -p ./doc/sman/* $(DISTDIR)/doc/sman/.; \
mkdir $(DISTDIR)/man; \
cp -p -R ./man/* $(DISTDIR)/man/.)
release: dist
(cd $(DISTDIR); cd ..; \
tar cf - $(DISTNAME) | \
gzip -9 -c > $(FTPDIR)/$(DISTNAME).tar.gz)
tar: FORCE
($(RM) config.cache; \
cd ..; \
tar cf - $(DISTNAME) | gzip -9 -c > $(DISTNAME).tar.gz)
errcheck: FORCE
@(egrep '[^x]error|warning|ld:|collect2:|make:' foo | \
egrep -v "^lex.*but not used"; true)
itar: FORCE
(cd doc/sman; \
tar cf - . | gzip -9 -c > ../../../$(DISTNAME)-iman.tar.gz)
sman: FORCE
@(cd doc && $(MAKE) index)
docs:
@(cd doc; $(MAKE))
FORCE:
# DO NOT DELETE THIS LINE -- make depend depends on it.
|