diff options
-rw-r--r-- | Makefile.in | 1 | ||||
-rwxr-xr-x | configure | 6 | ||||
-rwxr-xr-x | configure.ac | 2 | ||||
-rw-r--r-- | jim.c | 3 | ||||
-rw-r--r-- | jim.h | 8 | ||||
-rw-r--r-- | tclcompat.tcl | 2 |
6 files changed, 20 insertions, 2 deletions
diff --git a/Makefile.in b/Makefile.in index 20e6126..0483227 100644 --- a/Makefile.in +++ b/Makefile.in @@ -19,6 +19,7 @@ EXTENSIONS := @JIM_EXTENSIONS@ # Set an initial, default library and auto_path CPPFLAGS += -DTCL_LIBRARY=\"/lib/jim\" +CPPFLAGS += -DTCL_PLATFORM_OS=\"@PLATFORM_OS@\" -DTCL_PLATFORM_PLATFORM=\"@PLATFORM_PLATFORM@\" CPPFLAGS += -DJIM_TCL_COMPAT -DJIM_REFERENCES -D_GNU_SOURCE CPPFLAGS += -Wall $(OPTIM) -I@SRCDIR@ -I. @EXTRA_CFLAGS@ @@ -603,6 +603,8 @@ ac_includes_default="\ ac_subst_vars='LTLIBOBJS LIBOBJS +PLATFORM_PLATFORM +PLATFORM_OS SRCDIR EXTRA_CFLAGS JIM_EXTENSIONS @@ -3958,6 +3960,10 @@ EXTRA_CFLAGS=$EXTRA_CFLAGS SRCDIR=`dirname $0` +PLATFORM_OS=`uname -s` + +PLATFORM_PLATFORM=unix + ac_config_files="$ac_config_files Makefile jimautoconfext.h" diff --git a/configure.ac b/configure.ac index 5c42568..202aa41 100755 --- a/configure.ac +++ b/configure.ac @@ -234,6 +234,8 @@ done AC_SUBST(EXTRA_CFLAGS,$EXTRA_CFLAGS) AC_SUBST(SRCDIR,`dirname $0`) +AC_SUBST(PLATFORM_OS,`uname -s`) +AC_SUBST(PLATFORM_PLATFORM,unix) AC_CONFIG_FILES([Makefile jimautoconfext.h]) AC_OUTPUT @@ -4668,6 +4668,9 @@ Jim_Interp *Jim_CreateInterp(void) Jim_SetVariableStrWithStr(i, JIM_LIBPATH, ". /lib/jim"); Jim_SetVariableStrWithStr(i, JIM_INTERACTIVE, "0"); + Jim_SetVariableStrWithStr(i, "tcl_platform(os)", TCL_PLATFORM_OS); + Jim_SetVariableStrWithStr(i, "tcl_platform(platform)", TCL_PLATFORM_PLATFORM); + return i; } @@ -192,6 +192,14 @@ extern "C" { #define JIM_INTERACTIVE "jim_interactive" #endif +#ifndef TCL_PLATFORM_OS +#define TCL_PLATFORM_OS "unknown" +#endif +#ifndef TCL_PLATFORM_PLATFORM +#define TCL_PLATFORM_PLATFORM "unknown" +#endif + + /* ----------------------------------------------------------------------------- * Stack * ---------------------------------------------------------------------------*/ diff --git a/tclcompat.tcl b/tclcompat.tcl index d6fa23e..aa4907e 100644 --- a/tclcompat.tcl +++ b/tclcompat.tcl @@ -261,5 +261,3 @@ proc try {args} { proc throw {code {msg ""}} { return -code $code $msg } - -set tcl_platform(platform) unix |