1
0
mirror of https://github.com/weechat/weechat.git synced 2026-06-29 22:36:38 +02:00

- Add FindTCL.cmake to fix FreeBSD detection

- Only call Tcl_CreateNamespace when available in the public API,
  fix compatibility with older release
This commit is contained in:
Julien Louis
2008-10-18 13:54:59 +02:00
parent eab690aaaf
commit 1f10ee141a
4 changed files with 166 additions and 0 deletions
+5
View File
@@ -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)
@@ -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) ? */