aboutsummaryrefslogtreecommitdiff
path: root/auto.def
diff options
context:
space:
mode:
authorAlexander Shpilkin <ashpilkin@gmail.com>2011-08-27 19:14:40 +0400
committerSteve Bennett <steveb@workware.net.au>2011-08-31 12:15:46 +1000
commit8f31a1072a61595f99606fe6e709c0c93fd7bbce (patch)
tree93ed4b9e738bf8a3185439a0f80907c2b8f299ba /auto.def
parent1d88952b8911a903f9f6b748061264c38f1d1bcc (diff)
downloadjimtcl-8f31a1072a61595f99606fe6e709c0c93fd7bbce.zip
jimtcl-8f31a1072a61595f99606fe6e709c0c93fd7bbce.tar.gz
jimtcl-8f31a1072a61595f99606fe6e709c0c93fd7bbce.tar.bz2
Create a Metakit extension for Jim Tcl
Missing parts are binary properties and search.
Diffstat (limited to 'auto.def')
-rw-r--r--auto.def38
1 files changed, 34 insertions, 4 deletions
diff --git a/auto.def b/auto.def
index b066442..c24a009 100644
--- a/auto.def
+++ b/auto.def
@@ -43,6 +43,7 @@ options {
binary - Tcl-compatible 'binary' command
readline - Interface to libreadline
rlprompt - Tcl wrapper around the readline extension
+ mk - Interface to Metakit
sqlite - Interface to sqlite
sqlite3 - Interface to sqlite3
win32 - Interface to win32
@@ -133,6 +134,22 @@ if {[cctest -includes {sys/types.h sys/stat.h} -code {mkdir("/dummy");}]} {
msg-result no
}
+# autosetup can't handle C++ libraries
+proc check-metakit {} {
+ set found 0
+ cc-with {-lang c++} {
+ msg-checking "Checking for Metakit..."
+ if {[cctest -includes mk4.h -libs -lmk4 -code {c4_Storage dummy();}]} {
+ msg-result ok
+ define lib_mk -lmk4
+ incr found
+ } else {
+ msg-result "not found"
+ }
+ }
+ return $found
+}
+
set extra_objs {}
set jimregexp 0
@@ -184,13 +201,16 @@ set withmod [join [opt-val {with-mod with-jim-extmod}]]
# Tcl extensions
set ext_tcl "stdlib glob tclcompat tree rlprompt oo binary"
-# C extensions
-set ext_c "load package readdir array clock exec file posix regexp signal aio eventloop pack syslog nvp readline sqlite sqlite3 win32"
+# Native extensions
+set ext_c "load package readdir array clock exec file posix regexp signal aio eventloop pack syslog nvp readline mk sqlite sqlite3 win32"
+
+# C++ extensions
+set ext_cxx "mk"
# Tcl extensions which can be modules
set ext_tcl_mod "glob tree rlprompt oo binary"
-# C extensions which can be modules
-set ext_c_mod "readdir array clock file posix regexp syslog readline pack sqlite sqlite3 win32"
+# Native extensions which can be modules
+set ext_c_mod "readdir array clock file posix regexp syslog readline pack mk sqlite sqlite3 win32"
# All extensions
set ext_all [concat $ext_c $ext_tcl]
@@ -229,6 +249,8 @@ set needs(readdir) {have-feature opendir}
set needs(readline) {cc-check-function-in-lib readline readline}
set libdep(readline) lib_readline
set needs(signal) {expr {[have-feature sigaction] && [have-feature vfork]}}
+set needs(mk) {check-metakit}
+set libdep(mk) lib_mk
set needs(sqlite) {cc-check-function-in-lib sqlite_open sqlite}
set libdep(sqlite) lib_sqlite_open
set needs(sqlite3) {cc-check-function-in-lib sqlite3_open sqlite3}
@@ -386,6 +408,14 @@ foreach e $ext {
}
}
+# If there are any static C++ extensions, jimsh must be linked using
+# the C++ compiler
+foreach e $ext_static_c {
+ if {$e in $ext_cxx} {
+ define HAVE_CXX_EXTENSIONS
+ }
+}
+
define STATIC_EXTS [concat $ext_static_c $ext_static_tcl]
define C_EXT_OBJS [prefix jim- [suffix .o $ext_static_c]]
define TCL_EXT_OBJS [suffix .o $ext_static_tcl]