Skip to content

Commit bab1334

Browse files
tuffnattyPaweł Salawa
authored andcommitted
Merged ScriptingTcl pro file from master.
1 parent f79eb57 commit bab1334

1 file changed

Lines changed: 31 additions & 79 deletions

File tree

Plugins/ScriptingTcl/ScriptingTcl.pro

Lines changed: 31 additions & 79 deletions
Original file line numberDiff line numberDiff line change
@@ -21,33 +21,40 @@ HEADERS += scriptingtcl.h\
2121
OTHER_FILES += \
2222
scriptingtcl.json
2323

24-
linux: {
25-
# Find tclsh
26-
TCLSH = $$system(echo "puts 1" | tclsh)
27-
!contains(TCLSH, 1): {
28-
error("Could not find tclsh executable. ScriptingTcl plugin requires it to find out all Tcl libraries and headers. Make tclsh available in PATH.")
29-
}
30-
TCLSH = $$system(which tclsh)
31-
32-
# Find its version
33-
TCL_VERSION = $$system(echo "puts [info tclversion]" | tclsh)
34-
#message("Found tclsh: $$TCLSH (version: $$TCL_VERSION)")
35-
36-
# Find tclConfig.sh
37-
TCL_CONFIG_DIR = $$system(echo "puts [info library]" | tclsh)
38-
TCL_CONFIG = $$TCL_CONFIG_DIR/tclConfig.sh
39-
message("Looking for $$TCL_CONFIG")
40-
!exists($$TCL_CONFIG) {
41-
TCL_CONFIG = $$TCL_CONFIG_DIR/../tclConfig.sh
42-
message("Looking for $$TCL_CONFIG")
43-
}
44-
!exists($$TCL_CONFIG) {
45-
# Debian, FreeBSD, Ubuntu Bionic case
46-
TCL_CONFIG = $$system(echo "puts [::tcl::pkgconfig get libdir,runtime]" | tclsh)/tcl$$TCL_VERSION/tclConfig.sh
24+
linux|macx {
25+
isEmpty(TCL_CONFIG) {
26+
# Find tclsh
27+
TCLSH = $$system(echo "puts 1" | tclsh)
28+
!contains(TCLSH, 1): {
29+
error("Could not find tclsh executable. ScriptingTcl plugin requires it to find out all Tcl libraries and headers. Make tclsh available in PATH or run qmake with TCL_CONFIG=/path/to/tclConfig.sh.")
30+
}
31+
TCLSH = $$system(which tclsh)
32+
33+
# Find its version
34+
TCL_VERSION = $$system(echo "puts [info tclversion]" | tclsh)
35+
message("Found tclsh: $$TCLSH (version: $$TCL_VERSION)")
36+
37+
# Find tclConfig.sh
38+
linux {
39+
TCL_CONFIG_DIR = $$system(echo "puts [info library]" | tclsh)
40+
TCL_CONFIG = $$TCL_CONFIG_DIR/tclConfig.sh
41+
message("Looking for $$TCL_CONFIG")
42+
!exists($$TCL_CONFIG) {
43+
TCL_CONFIG = $$TCL_CONFIG_DIR/../tclConfig.sh
44+
message("Looking for $$TCL_CONFIG")
45+
}
46+
!exists($$TCL_CONFIG) {
47+
# Debian, FreeBSD, Ubuntu Bionic case
48+
TCL_CONFIG = $$system(echo "puts [::tcl::pkgconfig get libdir,runtime]" | tclsh)/tcl$$TCL_VERSION/tclConfig.sh
49+
}
50+
}
51+
macx {
52+
TCL_CONFIG = $$system(echo "puts [::tcl::pkgconfig get libdir,runtime]" | tclsh)/tclConfig.sh
53+
}
4754
}
4855
message("Looking for $$TCL_CONFIG")
4956
!exists($$TCL_CONFIG) {
50-
error("Could not find tclConfig.sh file. You can define its absolute path by qmake parameter: TCL_CONFIG=/path/to/tclConfig.sh")
57+
error("Could not find tclConfig.sh file at '$$TCL_CONFIG'. You can define its absolute path by qmake parameter: TCL_CONFIG=/path/to/tclConfig.sh")
5158
}
5259
message("Using tclconfig: $$TCL_CONFIG")
5360

@@ -78,61 +85,6 @@ linux: {
7885
}
7986
}
8087

81-
macx: {
82-
# Find tclsh
83-
TCLSH = $$system(echo "puts 1" | tclsh)
84-
!contains(TCLSH, 1): {
85-
error("Could not find tclsh executable. ScriptingTcl plugin requires it to find out all Tcl libraries and headers. Make tclsh available in PATH.")
86-
}
87-
TCLSH = $$system(which tclsh)
88-
89-
# Find its version
90-
TCL_VERSION = $$system(echo "puts [info tclversion]" | tclsh)
91-
message("Found tclsh: $$TCLSH (version: $$TCL_VERSION)")
92-
93-
# Find tclConfig.sh
94-
!exists($$TCL_CONFIG) {
95-
TCL_CONFIG = $$system(echo "puts [::tcl::pkgconfig get libdir,runtime]" | tclsh)/tclConfig.sh
96-
!exists($$TCL_CONFIG) {
97-
TCL_CONFIG = $$system(echo "puts [::tcl::pkgconfig get libdir,install]" | tclsh)/tclConfig.sh
98-
message("Looking for $$TCL_CONFIG")
99-
}
100-
!exists($$TCL_CONFIG) {
101-
error("Could not find tclConfig.sh file. You can define its absolute path by qmake parameter: TCL_CONFIG=/path/to/tclConfig.sh")
102-
}
103-
}
104-
message("Using tclConfig: $$TCL_CONFIG")
105-
106-
# Define other libs required when linking with Tcl
107-
eval($$system(cat $$TCL_CONFIG | grep TCL_LIBS))
108-
eval(LIBS += $$TCL_LIBS)
109-
message("TCL_LIBS: $$TCL_LIBS")
110-
111-
# Define headers dir
112-
eval($$system(cat $$TCL_CONFIG | grep TCL_INCLUDE_SPEC))
113-
INCLUDEPATH += $$replace(TCL_INCLUDE_SPEC, -I/, /)
114-
DEPENDPATH += $$replace(TCL_INCLUDE_SPEC, -I/, /)
115-
message("TCL_INCLUDE_SPEC: $$TCL_INCLUDE_SPEC")
116-
117-
# Find static library
118-
eval($$system(cat $$TCL_CONFIG | grep TCL_STUB_LIB_PATH))
119-
STATIC_LIB = $$replace(TCL_STUB_LIB_PATH, tclstub, tcl)
120-
message("TCL_STUB_LIB_PATH: $$TCL_STUB_LIB_PATH")
121-
122-
# If found static lib, we link statically
123-
exists($$STATIC_LIB) {
124-
message("Static linking of libtcl: $$STATIC_LIB")
125-
LIBS += $$STATIC_LIB
126-
}
127-
128-
# If not found, use dynamic linking flags
129-
!exists($$STATIC_LIB) {
130-
eval($$system(cat $$TCL_CONFIG | grep TCL_LIB_SPEC))
131-
message("Dynamic linking of libtcl: $$TCL_LIB_SPEC")
132-
eval(LIBS += $$TCL_LIB_SPEC)
133-
}
134-
}
135-
13688
win32: {
13789
# Under Windows we don't do the research. We just assume we have everything in the lib/ and include/
13890
# directories, which contain all other dependencies for SQLiteStudio. Get them from any Tcl installation you want.

0 commit comments

Comments
 (0)