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
|
Description: Fix for FHS compliant file locations
Author: Margarita Manterola <marga@debian.org>
---
Makefile.am | 21 +++++++++++++--------
Makefile.in | 28 +++++++++++++++++-----------
lib/tcl/xcircuit.sh.in | 4 +++-
lib/tcl/xcircuit.tcl.in | 12 +++++++++---
4 files changed, 42 insertions(+), 23 deletions(-)
diff --git a/Makefile.am b/Makefile.am
index f29e863..c82c065 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -34,6 +34,9 @@ tmpdir = /tmp
appdefaultsdir = $(libdir)/$(PACKAGE)-$(VERSION)/app-defaults
appmandir = $(libdir)/$(PACKAGE)-$(VERSION)/man
+# Directory for binary library files
+exelibdir = $(libdir)/$(PACKAGE)-$(VERSION)
+
PATHNAMES = -DPROG_VERSION=$(VERSION) \
-DPROG_REVISION=$(REVISION) \
-DCAD_DIR=\"$(libdir)\" \
@@ -164,6 +167,7 @@ tcl:
lib/$(INTERP_PATH)/$(WRAPPER_SH): lib/$(INTERP_PATH)/$(WRAPPER_SH).in
sed -e '/XCLIBDIR/s#XCLIBDIR#$(librarydir)#' \
+ -e '/XCEXELIBDIR/s#XCEXELIBDIR#$(exelibdir)#' \
-e '/WRAPPER_INIT/s/WRAPPER_INIT/$(WRAPPER_INIT)/' \
-e '/CONSOLE_SCRIPT/s/CONSOLE_SCRIPT/$(CONSOLE_SCRIPT)/' \
-e '/CONSOLE/s/CONSOLE/$(CONSOLE)/' \
@@ -175,7 +179,7 @@ lib/$(INTERP_PATH)/$(WRAPPER_SH): lib/$(INTERP_PATH)/$(WRAPPER_SH).in
chmod 0755 $@
lib/$(INTERP_PATH)/$(WRAPPER_INIT): lib/$(INTERP_PATH)/$(WRAPPER_INIT).in
- sed -e '/LIBDIR/s#LIBDIR#$(librarydir)#' \
+ sed -e '/LIBDIR/s#LIBDIR#$(exelibdir)#' \
-e '/SCRIPTSDIR/s#SCRIPTSDIR#$(scriptsdir)#' \
lib/$(INTERP_PATH)/$(WRAPPER_INIT).in > $@
chmod 0755 $@
@@ -229,19 +233,20 @@ install-tcl: xcircexec$(EXEEXT) lib/$(INTERP_PATH)/$(WRAPPER_OBJ) lib/$(INTERP_P
@echo "Installing standard XCircuit library files"
$(MAKE) $(AM_MAKEFLAGS) install-data-local
@echo "Installing Tcl files"
- $(mkinstalldirs) $(DESTDIR)$(librarydir)
+ $(mkinstalldirs) $(DESTDIR)$(exelibdir)
$(mkinstalldirs) $(DESTDIR)$(scriptsdir)
- ( cd lib/$(INTERP_PATH) ; for i in $(WRAPPER_OBJ) *.tcl ; do \
+ ( cd lib/$(INTERP_PATH) ; for i in *.tcl ; do \
$(INSTALL_DATA) $$i $(DESTDIR)$(scriptsdir); \
- done )
- $(INSTALL_DATA) xcircexec$(EXEEXT) $(DESTDIR)$(librarydir)
+ done; \
+ $(INSTALL_DATA) $(WRAPPER_OBJ) $(DESTDIR)$(exelibdir) )
+ $(INSTALL_DATA) xcircexec$(EXEEXT) $(DESTDIR)$(exelibdir)
chmod 0755 $(DESTDIR)$(librarydir)/$(CONSOLE)
chmod 0755 $(DESTDIR)$(librarydir)/$(CONSOLE_SCRIPT)
- chmod 0755 $(DESTDIR)$(librarydir)/$(WRAPPER_OBJ)
- chmod 0755 $(DESTDIR)$(librarydir)/xcircexec$(EXEEXT)
+ chmod 0755 $(DESTDIR)$(exelibdir)/$(WRAPPER_OBJ)
+ chmod 0755 $(DESTDIR)$(exelibdir)/xcircexec$(EXEEXT)
if test "${SHDLIB_EXT}" != ".so"; then \
- ( cd $(DESTDIR)$(librarydir); \
+ ( cd $(DESTDIR)$(exelibdir); \
$(RM) $(WRAPPER_SO) ; \
ln -s $(WRAPPER_OBJ) $(WRAPPER_SO) ) ; \
fi
diff --git a/Makefile.in b/Makefile.in
index 2783bf2..40c5414 100644
--- a/Makefile.in
+++ b/Makefile.in
@@ -371,9 +371,6 @@ ac_aux_dir = dist
# Temporary directory (if not overridden by environment variable TMPDIR)
tmpdir = /tmp
-# Directories for app-defaults file and manual page
-appdefaultsdir = $(libdir)/$(PACKAGE)-$(VERSION)/app-defaults
-appmandir = $(libdir)/$(PACKAGE)-$(VERSION)/man
PATHNAMES = -DPROG_VERSION=$(VERSION) \
-DPROG_REVISION=$(REVISION) \
-DCAD_DIR=\"$(libdir)\" \
@@ -408,6 +405,13 @@ M4_DEFS = @M4_DEFS@ @DEFS@
man_MANS = lib/xcircuit.1
INCLUDES = -IXw ${INC_SPECS}
+# Directories for app-defaults file and manual page
+appdefaultsdir = $(libdir)/$(PACKAGE)-$(VERSION)/app-defaults
+appmandir = $(libdir)/$(PACKAGE)-$(VERSION)/man
+
+# Directory for binary library files
+exelibdir = $(libdir)/$(PACKAGE)-$(VERSION)
+
# Library directory and files
librarydir = $(libdir)/$(PACKAGE)-$(VERSION)
scriptsdir = $(libdir)/$(PACKAGE)-$(VERSION)
@@ -864,6 +868,7 @@ tcl:
lib/$(INTERP_PATH)/$(WRAPPER_SH): lib/$(INTERP_PATH)/$(WRAPPER_SH).in
sed -e '/XCLIBDIR/s#XCLIBDIR#$(librarydir)#' \
+ -e '/XCEXELIBDIR/s#XCEXELIBDIR#$(exelibdir)#' \
-e '/WRAPPER_INIT/s/WRAPPER_INIT/$(WRAPPER_INIT)/' \
-e '/CONSOLE_SCRIPT/s/CONSOLE_SCRIPT/$(CONSOLE_SCRIPT)/' \
-e '/CONSOLE/s/CONSOLE/$(CONSOLE)/' \
@@ -875,7 +880,7 @@ lib/$(INTERP_PATH)/$(WRAPPER_SH): lib/$(INTERP_PATH)/$(WRAPPER_SH).in
chmod 0755 $@
lib/$(INTERP_PATH)/$(WRAPPER_INIT): lib/$(INTERP_PATH)/$(WRAPPER_INIT).in
- sed -e '/LIBDIR/s#LIBDIR#$(librarydir)#' \
+ sed -e '/LIBDIR/s#LIBDIR#$(exelibdir)#' \
-e '/SCRIPTSDIR/s#SCRIPTSDIR#$(scriptsdir)#' \
lib/$(INTERP_PATH)/$(WRAPPER_INIT).in > $@
chmod 0755 $@
@@ -929,19 +934,20 @@ install-tcl: xcircexec$(EXEEXT) lib/$(INTERP_PATH)/$(WRAPPER_OBJ) lib/$(INTERP_P
@echo "Installing standard XCircuit library files"
$(MAKE) $(AM_MAKEFLAGS) install-data-local
@echo "Installing Tcl files"
- $(mkinstalldirs) $(DESTDIR)$(librarydir)
+ $(mkinstalldirs) $(DESTDIR)$(exelibdir)
$(mkinstalldirs) $(DESTDIR)$(scriptsdir)
- ( cd lib/$(INTERP_PATH) ; for i in $(WRAPPER_OBJ) *.tcl ; do \
+ ( cd lib/$(INTERP_PATH) ; for i in *.tcl ; do \
$(INSTALL_DATA) $$i $(DESTDIR)$(scriptsdir); \
- done )
- $(INSTALL_DATA) xcircexec$(EXEEXT) $(DESTDIR)$(librarydir)
+ done; \
+ $(INSTALL_DATA) $(WRAPPER_OBJ) $(DESTDIR)$(exelibdir) )
+ $(INSTALL_DATA) xcircexec$(EXEEXT) $(DESTDIR)$(exelibdir)
chmod 0755 $(DESTDIR)$(librarydir)/$(CONSOLE)
chmod 0755 $(DESTDIR)$(librarydir)/$(CONSOLE_SCRIPT)
- chmod 0755 $(DESTDIR)$(librarydir)/$(WRAPPER_OBJ)
- chmod 0755 $(DESTDIR)$(librarydir)/xcircexec$(EXEEXT)
+ chmod 0755 $(DESTDIR)$(exelibdir)/$(WRAPPER_OBJ)
+ chmod 0755 $(DESTDIR)$(exelibdir)/xcircexec$(EXEEXT)
if test "${SHDLIB_EXT}" != ".so"; then \
- ( cd $(DESTDIR)$(librarydir); \
+ ( cd $(DESTDIR)$(exelibdir); \
$(RM) $(WRAPPER_SO) ; \
ln -s $(WRAPPER_OBJ) $(WRAPPER_SO) ) ; \
fi
diff --git a/lib/tcl/xcircuit.sh.in b/lib/tcl/xcircuit.sh.in
index d9800c2..d22bb6c 100755
--- a/lib/tcl/xcircuit.sh.in
+++ b/lib/tcl/xcircuit.sh.in
@@ -6,7 +6,9 @@
#
loclibdir=${XCIRCUIT_LIB_DIR:=XCLIBDIR}
+exelibdir=${XCIRCUIT_LIB_DIR:=XCEXELIBDIR}
export XCIRCUIT_LIB_DIR
+export XCIRCUIT_EXELIB_DIR
XCIRCUIT_WISH=WISH_EXE
export XCIRCUIT_WISH
@@ -53,6 +55,6 @@ else
# *only* needed when running without the console; the console itself is
# capable of sourcing the startup script.
#
- exec ${loclibdir}/xcircexec -- $@
+ exec ${exelibdir}/xcircexec -- $@
fi
diff --git a/lib/tcl/xcircuit.tcl.in b/lib/tcl/xcircuit.tcl.in
index 5eee0d6..db44646 100755
--- a/lib/tcl/xcircuit.tcl.in
+++ b/lib/tcl/xcircuit.tcl.in
@@ -12,6 +12,11 @@ if {$envlibdir == {}} {
}
unset envlibdir
+set exelibdir [array get env "XCIRCUIT_EXELIB_DIR"]
+if {$exelibdir == {}} {
+ set exelibdir LIBDIR
+}
+
set envsrcdir [array get env "XCIRCUIT_SRC_DIR"]
if {$envsrcdir != {}} {
set path [lindex $envsrcdir 1]
@@ -28,13 +33,14 @@ if {[string compare $tcl_platform(platform) "windows"] == 0} {
}
set tcllibdir $path
-if {![file exists ${tcllibdir}/xcircuit$libext]} {
+
+if {![file exists ${exelibdir}/xcircuit$libext]} {
set tcllibdir ${path}/tcl
}
-if {![file exists ${tcllibdir}/xcircuit$libext]} {
+if {![file exists ${exelibdir}/xcircuit$libext]} {
puts stderr "Error: Cannot find file xcircuit$libext"
}
-load ${tcllibdir}/xcircuit$libext
+load ${exelibdir}/xcircuit$libext
package require Xcircuit
|