Check-in [095125b887]
Overview
Comment:Updated to set encoding from system (untested)
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1:095125b8871aec253246fa22027fa51ab0ce2fd3
User & Date: rkeene on 2010-09-26 04:45:24
Other Links: manifest | tags
Context
2010-09-26
04:45
Updated to check to see if required before building check-in: 0ed07039ad user: rkeene tags: trunk
04:45
Updated to set encoding from system (untested) check-in: 095125b887 user: rkeene tags: trunk
04:45
Corrected typo in ZipVFS check-in: 6e6c5fd01a user: rkeene tags: trunk
Changes

Modified kitsh/buildsrc/kitsh-0.0/boot.tcl from [fad62aecf7] to [877050aa4b].

    85     85   			librarypath [info library]
    86     86   		} else {
    87     87   			encoding dirs [list [file join [info library] encoding]] ;# TIP 258
    88     88   		}
    89     89   
    90     90   		# fix system encoding, if it wasn't properly set up (200207.004 bug)
    91     91   		if {[encoding system] eq "identity"} {
    92         -			switch $::tcl_platform(platform) {
    93         -				windows		{ encoding system cp1252 }
    94         -				macintosh	{ encoding system macRoman }
    95         -			        default		{ encoding system iso8859-1 }
           92  +			if {[info exists ::tclkit_system_encoding] && $::tclkit_system_encoding != ""} {
           93  +				encoding system $::tclkit_system_encoding
           94  +			} else {
           95  +				switch $::tcl_platform(platform) {
           96  +					windows		{ encoding system cp1252 }
           97  +					macintosh	{ encoding system macRoman }
           98  +				        default		{ encoding system iso8859-1 }
           99  +				}
    96    100   			}
          101  +
          102  +			unset -nocomplain ::tclkit_system_encoding
    97    103   		}
    98    104   
    99    105   		# now remount the executable with the correct encoding
   100    106   		vfs::filesystem unmount [lindex [::vfs::filesystem info] 0]
   101    107   
   102    108   		set noe [info nameofexecutable]
   103    109   

Modified kitsh/buildsrc/kitsh-0.0/configure.ac from [f480293811] to [77ec27d4ef].

    28     28   AC_CHECK_TOOL([RC], [windres], [false])
    29     29   
    30     30   dnl If we found the resource compiler, add "kit.res.o" to our list of objects to build
    31     31   if ! test "$RC" = "false"; then
    32     32   	EXTRA_OBJS="$EXTRA_OBJS kit.res.o"
    33     33   fi
    34     34   
    35         -dnl Determine if we have "Tcl_SetStartupScript" (8.6.x) or "TclSetStartupScriptPath" (8.4.x)
           35  +dnl Check for Tcl features
    36     36   SAVE_LIBS="${LIBS}"
    37     37   LIBS="${ARCHS} ${LIBS}"
           38  +dnl Determine if we have "Tcl_SetStartupScript" (8.6.x) or "TclSetStartupScriptPath" (8.4.x)
    38     39   AC_CHECK_FUNCS(Tcl_SetStartupScript TclSetStartupScriptPath)
           40  +dnl Check for the ability to get the current system encoding
           41  +AC_CHECK_FUNCS(Tcl_GetEncodingNameFromEnvironment Tcl_SetSystemEncoding)
    39     42   LIBS="${SAVE_LIBS}"
    40     43   
    41     44   dnl Find zlib
    42     45   AC_ARG_WITH(zlib, AC_HELP_STRING([--with-zlib], [directory containing zlib]), [
    43     46   	CPPFLAGS="${CPPFLAGS} -I${with_zlib}/include -I${with_zlib}"
    44     47   	CFLAGS="${CFLAGS} -I${with_zlib}/include -I${with_zlib}"
    45     48   	LDFLAGS="${LDFLAGS} -L${with_zlib}/lib -L${with_zlib}"

Modified kitsh/buildsrc/kitsh-0.0/kitInit.c from [a26486a2c9] to [8565374f0c].

    28     28   #endif /* _WIN32 */
    29     29   
    30     30   #ifndef MB_TASKMODAL
    31     31   #  define MB_TASKMODAL 0
    32     32   #endif /* MB_TASKMODAL */
    33     33   
    34     34   #include "tclInt.h"
           35  +
           36  +#if defined(HAVE_TCL_GETENCODINGNAMEFROMENVIRONMENT) && defined(HAVE_TCL_SETSYSTEMENCODING)
           37  +#  define TCLKIT_CAN_SET_ENCODING 1
           38  +#endif
           39  +#if 10 * TCL_MAJOR_VERSION + TCL_MINOR_VERSION < 85
           40  +#  define KIT_INCLUDES_PWB 1
           41  +#endif
           42  +#if 10 * TCL_MAJOR_VERSION + TCL_MINOR_VERSION < 86
           43  +#  define KIT_INCLUDES_ZLIB 1
           44  +#endif
    35     45   
    36     46   #ifdef KIT_INCLUDES_ITCL
    37     47   Tcl_AppInitProc	Itcl_Init;
    38     48   #endif
    39     49   #ifdef KIT_INCLUDES_MK4TCL
    40     50   Tcl_AppInitProc	Mk4tcl_Init;
    41     51   #endif
    42     52   Tcl_AppInitProc Vfs_Init, Rechan_Init;
    43         -#if 10 * TCL_MAJOR_VERSION + TCL_MINOR_VERSION < 85
           53  +#ifdef KIT_INCLUDES_PWB
    44     54   Tcl_AppInitProc	Pwb_Init;
    45     55   #endif
    46         -#if 10 * TCL_MAJOR_VERSION + TCL_MINOR_VERSION < 86
           56  +#ifdef KIT_INCLUDES_ZLIB
    47     57   Tcl_AppInitProc Zlib_Init;
    48     58   #endif
    49     59   #ifdef TCL_THREADS
    50     60   Tcl_AppInitProc	Thread_Init;
    51     61   #endif
    52     62   #ifdef _WIN32
    53     63   Tcl_AppInitProc	Dde_Init, Registry_Init;
................................................................................
   160    170   		execNameObj = Tcl_FSJoinToPath(Tcl_FSGetCwd(interp), 1, lobjv);
   161    171   
   162    172   		tclExecutableName = strdup(Tcl_GetStringFromObj(execNameObj, &len));
   163    173   	}
   164    174   }
   165    175   
   166    176   int TclKit_AppInit(Tcl_Interp *interp) {
          177  +#ifdef TCLKIT_CAN_SET_ENCODING
          178  +	Tcl_DString encodingName;
          179  +#endif
          180  +
   167    181   #ifdef KIT_INCLUDES_ITCL
   168    182   	Tcl_StaticPackage(0, "Itcl", Itcl_Init, NULL);
   169    183   #endif 
   170    184   #ifdef KIT_INCLUDES_MK4TCL
   171    185   	Tcl_StaticPackage(0, "Mk4tcl", Mk4tcl_Init, NULL);
   172    186   #endif
   173         -#if 10 * TCL_MAJOR_VERSION + TCL_MINOR_VERSION < 85
          187  +#ifdef KIT_INCLUDES_PWB
   174    188   	Tcl_StaticPackage(0, "pwb", Pwb_Init, NULL);
   175    189   #endif 
   176    190   	Tcl_StaticPackage(0, "rechan", Rechan_Init, NULL);
   177    191   	Tcl_StaticPackage(0, "vfs", Vfs_Init, NULL);
   178         -#if 10 * TCL_MAJOR_VERSION + TCL_MINOR_VERSION < 86
          192  +#ifdef KIT_INCLUDES_ZLIB
   179    193   	Tcl_StaticPackage(0, "zlib", Zlib_Init, NULL);
   180    194   #endif
   181    195   #ifdef TCL_THREADS
   182    196   	Tcl_StaticPackage(0, "Thread", Thread_Init, NULL);
   183    197   #endif
   184    198   #ifdef _WIN32
   185    199   	Tcl_StaticPackage(0, "dde", Dde_Init, NULL);
................................................................................
   191    205   
   192    206   	/* the tcl_rcFileName variable only exists in the initial interpreter */
   193    207   #ifdef _WIN32
   194    208   	Tcl_SetVar(interp, "tcl_rcFileName", "~/tclkitrc.tcl", TCL_GLOBAL_ONLY);
   195    209   #else
   196    210   	Tcl_SetVar(interp, "tcl_rcFileName", "~/.tclkitrc", TCL_GLOBAL_ONLY);
   197    211   #endif
          212  +
          213  +#ifdef TCLKIT_CAN_SET_ENCODING
          214  +	/* Set the encoding from the Environment */
          215  +	Tcl_GetEncodingNameFromEnvironment(&encodingName);
          216  +	Tcl_SetSystemEncoding(NULL, Tcl_DStringValue(&encodingName));
          217  +	Tcl_SetVar(interp, "tclkit_system_encoding", Tcl_DStringValue(&encodingName), 0);
          218  +	Tcl_DStringFree(&encodingName);
          219  +#endif
   198    220   
   199    221   	/* Hack to get around Tcl bug 1224888.  This must be run here and
   200    222   	 * in LibraryPathObjCmd because this information is needed both
   201    223   	 * before and after that command is run. */
   202    224   	SetExecName(interp);
   203    225   
   204    226   	TclSetPreInitScript(preInitCmd);