summaryrefslogtreecommitdiff
path: root/src/plugins
diff options
context:
space:
mode:
authorJulien Louis <ptitlouis@sysif.net>2008-10-18 13:54:59 +0200
committerJulien Louis <ptitlouis@sysif.net>2008-10-18 13:54:59 +0200
commit1f10ee141ae7376675758bc9d1792346f2728c3f (patch)
treedc323570cd2502a9456b73f388cabf6af58b6975 /src/plugins
parenteab690aaafcd31dfe9400f51548896aafad29817 (diff)
downloadweechat-1f10ee141ae7376675758bc9d1792346f2728c3f.zip
- Add FindTCL.cmake to fix FreeBSD detection
- Only call Tcl_CreateNamespace when available in the public API, fix compatibility with older release
Diffstat (limited to 'src/plugins')
-rw-r--r--src/plugins/scripts/tcl/CMakeLists.txt5
-rw-r--r--src/plugins/scripts/tcl/weechat-tcl-api.c2
2 files changed, 7 insertions, 0 deletions
diff --git a/src/plugins/scripts/tcl/CMakeLists.txt b/src/plugins/scripts/tcl/CMakeLists.txt
index 977a36d4f..9b69794c6 100644
--- a/src/plugins/scripts/tcl/CMakeLists.txt
+++ b/src/plugins/scripts/tcl/CMakeLists.txt
@@ -20,9 +20,14 @@ weechat-tcl-api.c weechat-tcl-api.h)
SET_TARGET_PROPERTIES(tcl PROPERTIES PREFIX "")
IF(TCL_FOUND)
+ SET(CMAKE_REQUIRED_INCLUDES "${TCL_INCLUDE_PATH}")
+ SET(CMAKE_REQUIRED_LIBRARIES "${TCL_LIBRARY}")
+ CHECK_SYMBOL_EXISTS(Tcl_CreateNamespace tcl.h HAVE_TCL_CREATE_NS)
+
INCLUDE_DIRECTORIES(${TCL_INCLUDE_PATH})
SET(CMAKE_MODULE_LINKER_FLAGS "${CMAKE_MODULE_LINKER_FLAGS} ${TCL_LFLAGS}")
TARGET_LINK_LIBRARIES(tcl ${TCL_LIBRARY} weechat_scripts)
+
ENDIF(TCL_FOUND)
INSTALL(TARGETS tcl LIBRARY DESTINATION lib/weechat/plugins)
diff --git a/src/plugins/scripts/tcl/weechat-tcl-api.c b/src/plugins/scripts/tcl/weechat-tcl-api.c
index 2de706169..dd391bd70 100644
--- a/src/plugins/scripts/tcl/weechat-tcl-api.c
+++ b/src/plugins/scripts/tcl/weechat-tcl-api.c
@@ -4896,8 +4896,10 @@ void weechat_tcl_api_init (Tcl_Interp *interp) {
/* standard initializer */
Tcl_Init (interp);
+#ifdef HAVE_TCL_CREATE_NS
/* create weechat namespace */
Tcl_CreateNamespace (interp, "weechat",(ClientData)0,NULL);
+#endif
/* interface constants */
/* set variables, TODO: make them unmodifiable (thru Tcl_TraceVar) ? */