Check-in [5574242e95]
Overview
Comment:Merge updates from trunk.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | winFixes
Files: files | file ages | folders
SHA1:5574242e95f0d854d9191b989d7c1299b7f8c0c8
User & Date: mistachkin on 2015-02-09 18:39:28
Other Links: manifest | tags
Context
2015-02-09
19:00
Remove superfluous blank-line difference. Closed-Leaf check-in: 1b21d56df0 user: mistachkin tags: winFixes
18:39
Merge updates from trunk. check-in: 5574242e95 user: mistachkin tags: winFixes
2015-02-02
18:38
Updated build system to use new build-cc name for static compilers check-in: fe66a5f969 user: rkeene tags: trunk
2014-08-28
20:06
Remove obsolete differences that are no longer needed. check-in: b5def69863 user: mistachkin tags: winFixes
Changes

Modified .fossil-settings/ignore-glob from [5261fbbc36] to [e36d46f2b3].

   101    101   tls/build.log
   102    102   tls/inst
   103    103   tls/inst/*
   104    104   tls/out
   105    105   tls/out/*
   106    106   tls/src
   107    107   tls/src/*
          108  +tcllib/build
          109  +tcllib/build/*
          110  +tcllib/build.log
          111  +tcllib/inst
          112  +tcllib/inst/*
          113  +tcllib/out
          114  +tcllib/out/*
          115  +tcllib/src
          116  +tcllib/src/*
          117  +udp/build
          118  +udp/build/*
          119  +udp/build.log
          120  +udp/inst
          121  +udp/inst/*
          122  +udp/out
          123  +udp/out/*
          124  +udp/src
          125  +udp/src/*
          126  +yajltcl/build
          127  +yajltcl/build/*
          128  +yajltcl/build.log
          129  +yajltcl/inst
          130  +yajltcl/inst/*
          131  +yajltcl/out
          132  +yajltcl/out/*
          133  +yajltcl/src
          134  +yajltcl/src/*
   108    135   kitdll/buildsrc/kitdll-0.0/starpack.vfs
   109    136   kitdll/buildsrc/kitdll-0.0/starpack.vfs/*
   110    137   kitdll/buildsrc/kitdll-0.0/test
   111    138   kitdll/buildsrc/kitdll-0.0/configure
   112    139   kitdll/buildsrc/kitdll-0.0/libtcl*.so
   113    140   kitdll/buildsrc/kitdll-0.0/Makefile
   114    141   kitdll/buildsrc/kitdll-0.0/*.o

Modified README from [f2f8e3ce68] to [ac8cb7fd32].

   137    137   		packages from Tcl build.  This excludes the following packages:
   138    138   			tcltest
   139    139   
   140    140   		Additionally, any bundled packages (in the "pkgs" directory)
   141    141   		are excluded.  This typically includes (as of Tcl 8.6):
   142    142   			itcl thread
   143    143   
          144  +	10. KC_TCL_STATICPKGS
          145  +		Set this variable to the value "1" to attempt to force the
          146  +		packages included in the "pkgs" directory of Tcl 8.6+
          147  +		to be compiled statically
          148  +
   144    149   Cross compiling Environment Variables:
   145    150   
   146    151   	1. CC  
   147    152   		C compiler   e.g. i686-pc-mingw32-gcc
   148    153   
   149    154   	2. CXX
   150    155   		C++ compiler.  Required if you want to use mk4tcl. e.g. i686-pc-mingw32-g++
................................................................................
   169    174   On Windows we also need this:
   170    175   
   171    176   	1. RC
   172    177   		Resource compiler : e.g. i686-pc-mingw32-windres
   173    178   
   174    179   
   175    180   Kitsh Configure Options:
   176         -	1. --enable-kit-storage={zip|mk4|auto}
          181  +	1. --enable-kit-storage={zip|mk4|cvfs|auto}
   177    182   		Specify which type of storage to use with the Tclkit.  The
   178    183   		default is to auto-detect.  Auto-detection uses Mk4 if
   179    184   		available and built statically, otherwise it falls back to Zip.
          185  +	2. --with-obsfucated-cvfs
          186  +		Specify that CVFS should be obsfucated.  The contents of the
          187  +		CVFS are encrypted on disk and the encryption key is included
          188  +		in the executable.  Files are then transparently decrypted on
          189  +		access.
   180    190   
   181    191   --------------------
   182    192   Using the KitDLL SDK
   183    193   --------------------
   184    194   When you build a KitDLL, a "libtclkit-sdk-<tclvers>.tar.gz" tarball is also
   185    195   produced.  This tarball contains the Tcl (and Tk, if compiled) stubs libraries,
   186    196   and Tcl (and Tk, if compiled) header files needed to compile and link things

Modified build/make-kit-crosscompile from [b5df8646bf] to [db0b9b53a1].

    15     15   CXX="${CCROOTBIN}/${CROSS}-g++ ${CC_ADD}"
    16     16   RANLIB="${CCROOTBIN}/${CROSS}-ranlib"
    17     17   if [ -z "${STRIP}" ]; then
    18     18   	STRIP="${CCROOTBIN}/${CROSS}-strip"
    19     19   fi
    20     20   export PATH AR CC CXX RANLIB STRIP
    21     21   
           22  +# When cross-compiling Tcl it cannot detect these things and so assumes failure
           23  +# This in turn creates linking issues because it will define the replacements
           24  +# in the main library and stubs library, which we may both link to
           25  +ac_cv_func_memcmp_working=yes
           26  +tcl_cv_strstr_unbroken=ok
           27  +tcl_cv_strtoul_unbroken=ok
           28  +tcl_cv_strtod_unbroken=ok
           29  +tcl_cv_strtod_buggy=ok
           30  +export ac_cv_func_memcmp_working tcl_cv_strstr_unbroken tcl_cv_strtoul_unbroken tcl_cv_strtod_unbroken tcl_cv_strtod_buggy
           31  +
    22     32   ./kitcreator "$@" --host="${CROSS}"

Added build/make-kit-linux-amd64-static version [ec234cb947].

            1  +#! /bin/sh
            2  +
            3  +CROSS="x86_64-generic-linux-musl"
            4  +CC_ADD="-m64"
            5  +if ! echo " ${KITCREATOR_PKGS} " | grep ' kitdll ' >/dev/null; then
            6  +	KC_KITSH_LDFLAGS="${KC_KITSH_FLAGS} -static"
            7  +fi
            8  +export CROSS CC_ADD KC_KITSH_LDFLAGS
            9  +
           10  +./build/make-kit-crosscompile "$@" --enable-64bit

Added build/make-kit-linux-i386-static version [e2bdf96001].

            1  +#! /bin/sh
            2  +
            3  +CROSS="x86_64-generic-linux-musl"
            4  +CC_ADD='-m32'
            5  +if ! echo " ${KITCREATOR_PKGS} " | grep ' kitdll ' >/dev/null; then
            6  +	KC_KITSH_LDFLAGS="${KC_KITSH_FLAGS} -static"
            7  +fi
            8  +export CROSS CC_ADD KC_KITSH_LDFLAGS
            9  +
           10  +./build/make-kit-crosscompile "$@"

Added build/make-kits version [a9df02454d].

            1  +#! /usr/bin/env bash
            2  +
            3  +versions=(8.5.17 8.6.3)
            4  +
            5  +for version in ${versions[@]}; do
            6  +	for includetk in 0 1; do
            7  +		if [ "${includetk}" = '1' ]; then
            8  +			unset KITCREATOR_PKGS
            9  +
           10  +			add=''
           11  +			addurl=''
           12  +		else
           13  +			KITCREATOR_PKGS='itcl mk4tcl'
           14  +			export KITCREATOR_PKGS
           15  +
           16  +			add='sh'
           17  +			addurl='-notk'
           18  +		fi
           19  +
           20  +		case "$(hostname)" in
           21  +			powermacg5.home.rkeene.org)
           22  +				if [ ! -f "tclkit${add}-${version}-macosx10.5-ix86" ]; then
           23  +					echo "Building x86_64/ix86 Tclkit${add} version ${version}"
           24  +
           25  +					CXXFLAGS='-arch i386 -arch x86_64 -mmacosx-version-min=10.5' CFLAGS='-arch i386 -arch x86_64 -mmacosx-version-min=10.5' ./kitcreator ${version} --enable-aqua --host=x86_64-apple-darwin9
           26  +					mv tclkit-${version} tclkit${add}-${version}-macosx10.5-ix86
           27  +				fi
           28  +
           29  +				if [ ! -f "tclkit${add}-${version}-macosx10.5-powerpc" ]; then
           30  +					echo "Building ppc64/ppc Tclkit${add} version ${version}"
           31  +
           32  +					CXXFLAGS='-arch ppc -arch ppc64 -mmacosx-version-min=10.5' CFLAGS='-arch ppc -arch ppc64 -mmacosx-version-min=10.5' ./kitcreator ${version} --enable-aqua
           33  +					mv tclkit-${version} tclkit${add}-${version}-macosx10.5-powerpc
           34  +				fi
           35  +				;;
           36  +			maul)
           37  +				echo wget -O tclkit${add}-${version}-android-arm http://www.rkeene.org/devel/kitcreator/kitbuild/nightly/tclkit-${version}-android-arm${addurl}-xcompile 
           38  +				echo wget -O tclkit${add}-${version}-linux-mips http://www.rkeene.org/devel/kitcreator/kitbuild/nightly/tclkit-${version}-linux-mipsel${addurl}-xcompile
           39  +				echo wget -O tclkit${add}-${version}-solaris-sparc http://www.rkeene.org/devel/kitcreator/kitbuild/nightly/tclkit-${version}-solaris-sparc${addurl}-xcompile
           40  +				echo wget -O tclkit${add}-${version}-solaris-sparc64 http://www.rkeene.org/devel/kitcreator/kitbuild/nightly/tclkit-${version}-solaris-sparc64${addurl}-xcompile
           41  +				echo wget -O tclkit${add}-${version}-win32-ix86.exe http://www.rkeene.org/devel/kitcreator/kitbuild/nightly/tclkit-${version}-win32-i586${addurl}-xcompile
           42  +				echo wget -O tclkit${add}-${version}-win32-x86_64.exe http://www.rkeene.org/devel/kitcreator/kitbuild/nightly/tclkit-${version}-win64-amd64${addurl}-xcompile
           43  +				echo wget -O tclkit${add}-${version}-rhel5-ix86 http://www.rkeene.org/devel/kitcreator/kitbuild/nightly/tclkit-${version}-linux-i386${addurl}-xcompile
           44  +				echo wget -O tclkit${add}-${version}-rhel5-x86_64 http://www.rkeene.org/devel/kitcreator/kitbuild/nightly/tclkit-${version}-linux-amd64${addurl}
           45  +				;;
           46  +		esac
           47  +	done
           48  +done

Modified build/makearch.info from [06f247e1b9] to [fe83d4d792].

    12     12   # If set to "auto" it will be maintained in a file called .version
    13     13   # in the source directory and the revision will be incremented
    14     14   # each time a "makearch" is done.
    15     15   #
    16     16   # If @@SVNLCR@@ is used anywhere in this version number, it will be
    17     17   # replaced with the highest last-changed-rev from the output of
    18     18   #   svn info -R    (or 0)
    19         -VERS="0.9.0"
           19  +VERS="0.9.2"
    20     20   
    21     21   # Space sperated list of documents, if they exist, they will be
    22     22   # prefixed with the contents of the DOC_HDR file and substitution
    23     23   # will occur:
    24     24   #     @@UTIL@@ becomes the utility name ${UTIL}
    25     25   #     @@VERS@@ becomes the utility version
    26     26   #     @@DATE@@ becomes the current date

Modified build/test/publish-tests from [1af19dd257] to [a4cad57203].

   156    156   	set shortfile $file
   157    157   	set file [file join $WEBDIR $file]
   158    158   	if {[file isdirectory $file]} {
   159    159   		continue
   160    160   	}
   161    161   
   162    162   	switch -glob -- $file {
   163         -		"*.log" - "*.ttml" - "*.html" - "*.desc" - "*-origname" - "*-tclsh" - "*-sdk.tar.gz" - "*.new" {
          163  +		"*.log" - "*.ttml" - "*.html" - "*.desc" - "*-origname" - "*-tclsh" - "*-sdk.tar.gz" - "*.new" - "*.sha1" {
   164    164   			continue
   165    165   		}
   166    166   	}
   167    167   
   168    168   	# Derive what we can from the filename
   169    169   	set buildfile "${shortfile}-build.log"
   170    170   	set sdkshortfile "${shortfile}-sdk.tar.gz"

Modified build/test/test from [af8be2e90b] to [5e3684a6ac].

     1      1   #! /bin/bash
     2      2   
     3         -VERSIONS="8.5.15 8.6.2 cvs_HEAD"
            3  +VERSIONS="8.5.17 8.6.3 fossil_trunk"
     4      4   
     5      5   # Find the base directory
     6      6   for x in 1 2 3 4 __fail__; do
     7      7   	if [ "${x}" = "__fail__" ]; then
     8      8   		echo 'Unable to find KitCreator, aborting.' >&2
     9      9   
    10     10   		exit 1
................................................................................
   436    436   
   437    437   			# For KitDLL, make a note of the original name
   438    438   			if [ "${kitdll}" = "1" ]; then
   439    439   				echo "${createdkit}" > "${outputname}-origname"
   440    440   
   441    441   				if [ -f "${sdk}" ]; then
   442    442   					mv "${sdk}" "${outputname}-sdk.tar.gz"
          443  +					openssl sha1 "${outputname}-sdk.tar.gz" | sed 's@^.*= @@' > "${outputname}-sdk.tar.gz.sha1"
   443    444   				fi
   444    445   			fi
          446  +
          447  +			openssl sha1 "${outputname}" | sed 's@^.*= @@' > "${outputname}.sha1"
          448  +		fi
          449  +
          450  +		# Note the SHA1 has of the file
          451  +		if [ -f "${outputname}.sha1" ]; then
          452  +			echo "SHA1: $(cat "${outputname}.sha1")"
          453  +		else
          454  +			echo "SHA1: not recorded"
          455  +		fi
          456  +
          457  +		if [ -f "${outputname}-sdk.tar.gz" ]; then
          458  +			if [ -f "${outputname}-sdk.tar.gz.sha1" ]; then
          459  +				echo "SDK SHA1: $(cat "${outputname}-sdk.tar.gz.sha1")"
          460  +			else
          461  +				echo "SDK SHA1: not recorded"
          462  +			fi
   445    463   		fi
   446    464   
   447    465   		# Test zip status
   448    466   		if unzip -l "${outputname}" 2>&1 | grep 'boot\.tcl' >/dev/null; then
   449    467   			canunzip="1"
   450    468   		else
   451    469   			canunzip="0"

Modified build/test/tests/04-version.tcl from [d679aaf9ec] to [0fa9712117].

     1      1   #! /usr/bin/env tclsh
     2      2   
     3      3   set chkversion [lindex $argv 2]
     4      4   
     5      5   # We are unable to make a reasonable determination of the version from a CVS
     6      6   # tag.  Assume it's okay.
     7         -if {[string match "cvs_*" $chkversion]} {
            7  +if {[string match "cvs_*" $chkversion] || [string match "fossil_*" $chkversion]} {
     8      8   	exit 0
     9      9   }
    10     10   
    11     11   if {[info patchlevel] == $chkversion} {
    12     12   	exit 0
    13     13   }
    14     14   
    15     15   exit 1

Modified build/web/building.cgi from [b893b1086f] to [ceea8a8659].

    40     40   
    41     41   	foreach {option value} $buildinfo(options) {
    42     42   		switch -- $option {
    43     43   			"kitdll" {
    44     44   				if {$value} {
    45     45   					append description ", Built as a Library"
    46     46   				}
           47  +			}
           48  +			"dynamictk" {
           49  +				if {$value} {
           50  +					if {[lsearch -exact $buildinfo(packages) "tk"] != -1} {
           51  +						append description ", Forced Tk Dynamic Linking"
           52  +					}
           53  +				}
    47     54   			}
    48     55   			"threaded" {
    49     56   				if {$value} {
    50     57   					append description ", Threaded"
    51     58   				} else {
    52     59   					append description ", Unthreaded"
    53     60   				}
    54     61   			}
    55     62   			"debug" {
    56     63   				if {$value} {
    57     64   					append description ", With Symbols"
    58     65   				}
           66  +			}
           67  +			"minbuild" {
           68  +				if {$value} {
           69  +					append description ", Without Tcl pkgs/ and all encodings"
           70  +				}
           71  +			}
           72  +			"staticlibssl" {
           73  +				if {$value} {
           74  +					append description ", Statically linked to LibSSL"
           75  +				}
    59     76   			}
    60     77   			"storage" {
    61     78   				switch -- $value {
    62     79   					"mk4" {
    63     80   						append description ", Metakit-based"
    64     81   					}
    65     82   					"zip" {

Modified build/web/kitcreator.vfs/index.rvt from [8e0117b024] to [d57ac5659d].

    12     12   		set kitcreator_versions($vers) $vers
    13     13   	}
    14     14   	set kitcreator_version_selected [lindex [lsort -dictionary [array names kitcreator_versions]] end]
    15     15   
    16     16   	set kitcreator_versions(trunk) "Fossil Trunk Tip"
    17     17   
    18     18   	set tcl_versions(8.5.15) 8.5.15
           19  +	set tcl_versions(8.5.16) 8.5.16
           20  +	set tcl_versions(8.5.17) 8.5.17
    19     21   	set tcl_versions(8.6.1) 8.6.1
    20     22   	set tcl_versions(8.6.2) 8.6.2
           23  +	set tcl_versions(8.6.3) 8.6.3
    21     24   	set tcl_versions(fossil_trunk) "Fossil Trunk Tip"
    22     25   
    23     26   	set platforms(android-arm) "Android/ARM"
    24     27   	set platforms(freebsd-amd64) "FreeBSD/amd64"
    25     28   	set platforms(hpux-hppa64) "HP-UX/PA-RISC 2.0"
    26     29   	set platforms(linux-amd64) "Linux/amd64"
           30  +	set platforms(linux-amd64-static) "Linux/amd64 (static)"
    27     31   	set platforms(linux-arm) "Linux/ARM"
    28     32   	set platforms(linux-i386) "Linux/i386"
    29         -	set platforms(linux-mipsel) "Linux/MIPS"
           33  +	set platforms(linux-i386-static) "Linux/i386 (static)"
           34  +	set platforms(linux-mipsel) "Linux/MIPS (static)"
    30     35   	set platforms(netbsd-amd64) "NetBSD/amd64"
    31     36   	set platforms(netbsd-i386) "NetBSD/i386"
    32     37   	set platforms(solaris-amd64) "Solaris/amd64"
    33     38   	set platforms(solaris-i386) "Solaris/i386"
    34     39   	set platforms(solaris-sparc) "Solaris/SPARC"
    35     40   	set platforms(solaris-sparc64) "Solaris/SPARC64"
    36     41   	set platforms(win32) "Windows/i386"
................................................................................
    38     43   
    39     44   	set packages(tk) "Tk"
    40     45   	set packages(mk4tcl) "Metakit"
    41     46   	set packages(tcc4tcl) "tcc4tcl"
    42     47   	set packages(tls) TLS
    43     48   	set packages(dbus) D-BUS
    44     49   	set packages(tclx) TclX
           50  +	set packages(itcl) {[incr Tcl]}
           51  +	set packages(tcllib) "Tcllib"
           52  +	set packages(yajltcl) "YAJL-TCL"
           53  +	set packages(udp) "TclUDP"
    45     54   
    46     55   	set disable {
    47         -		platform linux-mipsel {tk tcc4tcl}
    48         -		platform android-arm tk
    49         -		platform netbsd-amd64 {tk tcc4tcl}
    50         -		platform netbsd-i386 {tk tcc4tcl}
    51         -		platform solaris-sparc tcc4tcl
    52         -		platform solaris-sparc64 tcc4tcl
    53         -		platform hpux-hppa64 tcc4tcl
    54         -		platform linux-arm tk
           56  +		platform linux-mipsel {package_tk package_tcc4tcl package_tclx kitdll}
           57  +		platform android-arm {package_tk package_tclx}
           58  +		platform netbsd-amd64 {package_tk package_tcc4tcl package_tclx}
           59  +		platform netbsd-i386 {package_tk package_tcc4tcl package_tclx}
           60  +		platform solaris-sparc {package_tcc4tcl package_tclx}
           61  +		platform solaris-sparc64 {package_tcc4tcl package_tclx}
           62  +		platform hpux-hppa64 {package_tcc4tcl package_tclx}
           63  +		platform linux-arm {package_tk package_tclx}
           64  +		platform linux-amd64-static {package_tk package_dbus kitdll}
           65  +		platform linux-i386-static {package_tk package_dbus kitdll}
    55     66   	}
    56     67   
    57     68   	set specific {
    58     69   		platform win32 file icon {Kit Icon}
    59     70   		platform win32 text description {Description}
    60     71   		platform win64 file icon {Kit Icon}
    61     72   		platform win64 text description {Description}
................................................................................
    69     80   		set build_kitcreator_version $args(kitcreator_version)
    70     81   
    71     82   		## Optional Arguments
    72     83   		set build_packages [list]
    73     84   		set build_options(threaded) 0
    74     85   		set build_options(kitdll) 0
    75     86   		set build_options(debug) 0
           87  +		set build_options(dynamictk) 0
           88  +		set build_options(minbuild) 0
    76     89   		foreach arg [array names args] {
    77     90   			switch -glob -- $arg {
    78     91   				"option_package_*" {
    79     92   					set package [join [lrange [split $arg _] 2 end] _]
    80     93   
    81     94   					lappend build_packages $package
    82     95   				}
................................................................................
    85     98   				}
    86     99   				"option_kitdll" {
    87    100   					set build_options(kitdll) 1
    88    101   				}
    89    102   				"option_debug" {
    90    103   					set build_options(debug) 1
    91    104   				}
          105  +				"option_dynamictk" {
          106  +					set build_options(dynamictk) 1
          107  +				}
          108  +				"option_minbuild" {
          109  +					set build_options(minbuild) 1
          110  +				}
          111  +				"option_staticlibssl" {
          112  +					set build_options(staticlibssl) 1
          113  +				}
    92    114   				"option_storage" {
    93    115   					switch -- $args($arg) {
    94    116   						"mk4" - "zip" - "cvfs" {
    95    117   							set build_options(storage) $args($arg)
    96    118   						}
    97    119   					}
    98    120   				}
................................................................................
   202    224   <?
   203    225   	} else {
   204    226   ?><html>
   205    227     <head>
   206    228       <title>KitCreator, Web Interface</title>
   207    229       <script>
   208    230   <!--
   209         -	function enablePackage(package) {
          231  +	function enableOption(option) {
   210    232   		var obj;
   211    233   
   212         -		obj = document.getElementById('option_package_' + package);
          234  +		obj = document.getElementById('option_' + option);
   213    235   		obj.disabled = false;
   214    236   	}
   215    237   
   216         -	function disablePackage(package) {
          238  +	function disableOption(option) {
   217    239   		var obj;
   218    240   
   219         -		obj = document.getElementById('option_package_' + package);
          241  +		obj = document.getElementById('option_' + option);
   220    242   		obj.checked = false;
   221    243   		obj.disabled = true;
   222    244   	}
   223    245   
   224    246   	function verifyOptions() {
   225    247   		var kitcreator_version;
   226    248   		var tcl_version;
................................................................................
   227    249   		var platform;
   228    250   
   229    251   		kitcreator_version = document.getElementsByName('kitcreator_version')[0].value;
   230    252   		tcl_version = document.getElementsByName('tcl_version')[0].value;
   231    253   		platform = document.getElementsByName('platform')[0].value;
   232    254   
   233    255   <?
   234         -		set alldisabledpackages [list]
   235         -		foreach {keyword value disablepackages} $disable {
   236         -			foreach package $disablepackages {
   237         -				if {[lsearch -exact $alldisabledpackages $package] == -1} {
   238         -					lappend alldisabledpackages $package
          256  +		set alldisabledoptions [list]
          257  +		foreach {keyword value disableoptions} $disable {
          258  +			foreach option $disableoptions {
          259  +				if {[lsearch -exact $alldisabledoptions $option] == -1} {
          260  +					lappend alldisabledoptions $option
   239    261   				}
   240    262   			}
   241    263   		}
   242    264   
   243         -		foreach package $alldisabledpackages {
   244         -			puts "\t\tenablePackage(\"$package\");"
          265  +		foreach option $alldisabledoptions {
          266  +			puts "\t\tenableOption(\"$option\");"
   245    267   		}
   246    268   
   247         -		foreach {keyword value disablepackages} $disable {
          269  +		foreach {keyword value disableoptions} $disable {
   248    270   			puts "\t\tif ($keyword == \"$value\") \{"
   249    271   
   250         -			foreach package $disablepackages {
   251         -				puts "\t\t\tdisablePackage(\"$package\");"
          272  +			foreach option $disableoptions {
          273  +				puts "\t\t\tdisableOption(\"$option\");"
   252    274   			}
   253    275   
   254    276   			puts "\t\t\}"
   255    277   		}
   256    278   ?>
   257    279   	}
   258    280   -->
................................................................................
   283    305             </td>
   284    306           </tr>
   285    307           <tr>
   286    308             <td>Tcl Version:</td>
   287    309             <td>
   288    310               <select name="tcl_version" onChange="verifyOptions();">
   289    311   <?
   290         -	foreach tcl_version [lsort -dictionary [array names tcl_versions]] {
          312  +	set tcl_version_list [lsort -dictionary [array names tcl_versions]]
          313  +	set tcl_version_selected [lindex $tcl_version_list end-1]
          314  +	foreach tcl_version $tcl_version_list {
   291    315   		set tcl_version_name $tcl_versions($tcl_version)
   292         -		puts "              <option value=\"${tcl_version}\">${tcl_version_name}</option>"
          316  +
          317  +		if {$tcl_version == $tcl_version_selected} {
          318  +			set selected " selected"
          319  +		} else {
          320  +			set selected ""
          321  +		}
          322  +
          323  +		puts "              <option value=\"${tcl_version}\"${selected}>${tcl_version_name}</option>"
   293    324   	}
   294    325   ?>
   295    326               </select>
   296    327             </td>
   297    328           </tr>
   298    329           <tr>
   299    330             <td>Platform:</td>
................................................................................
   312    343             <td>Kit Options:</td>
   313    344             <td>
   314    345   <?  foreach package [lsort -dictionary [array names packages]] { ?>
   315    346               <input type="checkbox" name="option_package_<? puts -nonewline $package ?>" id="option_package_<? puts -nonewline $package ?>">Package: <? puts -nonewline $packages($package) ?><br>
   316    347   <? } ?>
   317    348               <input type="checkbox" name="option_threaded">Kit: Threaded<br>
   318    349               <input type="checkbox" name="option_debug">Kit: Debugging Build<br>
   319         -            <input type="checkbox" name="option_kitdll">Kit: Build Library (KitDLL)<br>
          350  +            <input type="checkbox" name="option_kitdll" id="option_kitdll">Kit: Build Library (KitDLL)<br>
          351  +            <input type="checkbox" name="option_dynamictk" id="option_dynamictk">Kit: Always link Tk dynamically (if Tk is built)<br>
          352  +            <input type="checkbox" name="option_minbuild">Kit: "Minimal" build (remove extra packages shipped as part of Tcl and reduce encodings)<br>
          353  +            <input type="checkbox" name="option_staticlibssl">TLS: Statically link to LibSSL
   320    354             </td>
   321    355           </tr>
   322    356   	<tr>
   323    357   		<td>Kit Storage:</td>
   324    358   		<td>
   325    359   			<select name="option_storage">
   326    360   				<option value="auto">Automatically Determined</option>

Modified build/web/process_queue from [ad31dc7738] to [1edd04d78d].

     1      1   #! /usr/bin/env tclsh
     2      2   
     3      3   set queue "/home/rkeene/devel/kitcreator/build/web/queue"
     4      4   set outdir "/web/customers/kitcreator.rkeene.org/kits"
            5  +set builddir "/tmp/kitcreator-web/builds"
     5      6   
     6      7   if {![file exists "${queue}.old"]} {
     7      8   	if {![file exists $queue]} {
     8      9   		exit 0
     9     10   	}
    10     11   
    11     12   	file rename "$queue" "${queue}.old"
................................................................................
    35     36   	}
    36     37   
    37     38   	# Skip if build failed
    38     39   	if {[file exists $outfile.buildfail]} {
    39     40   		continue
    40     41   	}
    41     42   
    42         -	set workdir [file join $outdir $buildinfo(key) build]
    43         -	file delete -force $workdir
           43  +	# Set the build directory
           44  +	file delete -force -- $builddir
           45  +	set workdir [file join $builddir $buildinfo(key) build]
    44     46   	file mkdir $workdir
    45     47   	cd $workdir
    46     48   
    47         -	set fd [open ../buildinfo w]
           49  +	# Find place to store build info
           50  +	set keydir [file join $outdir $buildinfo(key)]
           51  +	file mkdir $keydir
           52  +	set fd [open [file join $keydir buildinfo] w]
    48     53   	puts $fd [array get buildinfo]
    49     54   	close $fd
    50     55   
    51     56   	set tarball kitcreator-${buildinfo(kitcreator_version)}.tar.gz
    52         -	exec wget -q -O $tarball http://kitcreator.rkeene.org/fossil/tarball/${tarball}?uuid=${buildinfo(kitcreator_version)}
    53         -	exec gzip -dc $tarball | tar -xf -
    54         -	cd kitcreator-${buildinfo(kitcreator_version)}
           57  +
           58  +	if {[catch {
           59  +		exec wget -q -O $tarball http://kitcreator.rkeene.org/fossil/tarball/${tarball}?uuid=${buildinfo(kitcreator_version)}
           60  +		exec gzip -dc $tarball | tar -xf -
           61  +		cd kitcreator-${buildinfo(kitcreator_version)}
           62  +	}]} {
           63  +		continue
           64  +	}
    55     65   
    56     66   	set script "./build/make-kit-${buildinfo(platform)}"
    57     67   	set args [list]
    58     68   
    59     69   	set ::env(KITCREATOR_PKGS) " [join $buildinfo(packages) " "] "
    60     70   
    61     71   	foreach {option value} $buildinfo(options) {
................................................................................
    77     87   					lappend args "--enable-symbols"
    78     88   					set ::env(STRIP) true
    79     89   				}
    80     90   			}
    81     91   			"storage" {
    82     92   				lappend args "--enable-kit-storage=$value"
    83     93   			}
    84         -			"staticmk4" {
           94  +			"dynamictk" {
           95  +				if {[lsearch -exact $buildinfo(packages) "tk"] != -1} {
           96  +					set ::env(STATICTK) -1
           97  +				}
           98  +			}
           99  +			"minbuild" {
          100  +				if {$value} {
          101  +					set ::env(KITCREATOR_MINENCODINGS) 1
          102  +					set ::env(KITCREATOR_MINBUILD) 1
          103  +				}
          104  +			}
          105  +			"staticlibssl" {
          106  +				if {$value} {
          107  +					set ::env(KC_TLS_LINKSSLSTATIC) 1
          108  +				}
    85    109   			}
    86         -			"statictk" {
          110  +			"staticmk4" {
    87    111   			}
    88    112   		}
    89    113   	}
    90    114   
    91    115   	catch {
    92    116   		exec ./build/pre.sh
    93    117   	}
................................................................................
    97    121   	}
    98    122   
    99    123   	catch {
   100    124   		set cmd [list $script $buildinfo(tcl_version) {*}$args]
   101    125   		set fd [open "${outfile}.log" w+]
   102    126   		puts $fd "Running: export KITCREATOR_PKGS=\"$::env(KITCREATOR_PKGS)\""
   103    127   
   104         -		if {[info exists ::env(STRIP)]} {
   105         -			puts $fd "Running: export STRIP=\"$::env(STRIP)\""
          128  +		foreach variable [list STRIP STATICTK KITCREATOR_MINENCODINGS KITCREATOR_MINBUILD KC_TLS_LINKSSLSTATIC] {
          129  +			if {[info exists ::env($variable)]} {
          130  +				puts $fd "Running: export $variable=\"$::env($variable)\""
          131  +			}
   106    132   		}
   107    133   
   108    134   		puts $fd "Running: $cmd"
   109    135   		close $fd
   110    136   	}
   111    137   
   112    138   	catch {
   113    139   		exec {*}$cmd >> "${outfile}.log" 2>@1
   114    140   	}
   115    141   
   116    142   	catch {
   117         -		exec grep ^ {*}[glob */build.log] >> "${outfile}.log"
          143  +		exec grep ^ {*}[lsort -dictionary [glob */build.log]] >> "${outfile}.log"
   118    144   	}
   119    145   
   120    146   	foreach file [list tclkit-$buildinfo(tcl_version) {*}[glob -nocomplain libtclkit*]] {
   121    147   		switch -glob -- $file {
   122    148   			"*.dylib" - "*.so" - "*.sl" - "*.dll" { }
   123    149   			"tclkit-*" {}
   124    150   			default {

Modified kitcreator from [de6501332a] to [d809d4a2f5].

     9      9   	clean|distclean|build|retry)
    10     10   		mode="$1"
    11     11   		shift
    12     12   		;;
    13     13   esac
    14     14   
    15     15   # Determine which Tcl version to build
    16         -TCLVERS="8.6.2"
           16  +TCLVERS="8.6.3"
    17     17   if echo "$1" | grep '^[0-9][0-9]*\.' >/dev/null || echo "$1" | egrep '^(cvs|fossil)_' >/dev/null; then
    18     18   	TCLVERS="$1"
    19     19   
    20     20   	shift
    21     21   fi
    22     22   export TCLVERS
    23     23   
................................................................................
    30     30   if [ -f 'build/pre.sh' ]; then
    31     31   	if ! find 'kitsh/buildsrc/' -name configure -type f 2>/dev/null | grep configure >/dev/null; then
    32     32   		echo "Please remember to run 'build/pre.sh' if you expect this build to work." >&2
    33     33   	fi
    34     34   fi
    35     35   
    36     36   # Define the list of all packages, for cleaning purposes
    37         -KITCREATOR_ALLPKGS="kitsh tcl tclvfs zlib tk itcl mk4tcl thread dbus tls tclx tcc4tcl"
           37  +KITCREATOR_ALLPKGS="kitsh tcl tclvfs zlib tk itcl mk4tcl thread dbus tls tclx tcc4tcl tcllib udp yajltcl"
    38     38   
    39     39   # Always rebuild kitsh
    40     40   rm -f "kitsh/.success"
    41         -for pkg in ${KITCREATOR_ALLPKGS}; do
           41  +for pkg in ${KITCREATOR_ALLPKGS} ${KITCREATOR_PKGS}; do
    42     42   	if [ "${mode}" != "retry" -o ! -f "${pkg}/.success" ]; then
    43     43   		rm -f "${pkg}/build.log" "${pkg}/.success"
    44     44   		rm -rf "${pkg}/out" "${pkg}/inst" "${pkg}/build"
    45     45   
    46     46   		rm -rf "${pkg}/src"/tmp-*
    47     47   	fi
    48     48   
................................................................................
   113    113   		if [ "${STATICTK}" != "1" -a "${STATICTK}" != "-1" ]; then
   114    114   			echo 'Warning: Linking Tk statically because you are building KitDLL' 2>&1
   115    115   			echo '         Set STATICTK to -1 if you really want to link Tk dynamically.' >&2
   116    116   
   117    117   			STATICTK="1"
   118    118   			export STATICTK
   119    119   		fi
          120  +	fi
   120    121   
          122  +	if echo " ${KITCREATOR_PKGS} " | grep ' mk4tcl ' >/dev/null 2>/dev/null; then
   121    123   		if [ -z "${STATICMK4}" ]; then
   122    124   			echo 'Warning: Linking Mk4tcl dynamically because you are building KitDLL' 2>&1
   123         -			echo '         Set STATICMK4 to 1 if you really want to link Mk4tcl statically.' >&2
          125  +			echo '         Set STATICMK4 to make this message go away.' >&2
          126  +			echo '         Set STATICMK4 to 1 if you really want to link Mk4tcl statically (normal default).' >&2
          127  +			echo '         Set STATICMK4 to 0 to link Mk4tcl dynamically if possible (this is what is happening now).' >&2
          128  +			echo '         Set STATICMK4 to -1 to build dynamically.' >&2
   124    129   
   125    130   			STATICMK4="0"
   126    131   			export STATICMK4
   127    132   		fi
   128    133   	fi
   129    134   fi
   130    135   
................................................................................
   163    168   		echo -n "Skipping ${pkg} ..."
   164    169   	else
   165    170   		echo -n "Building ${pkg} ..."
   166    171   
   167    172   		(
   168    173   			cd "${pkg}" >/dev/null 2>/dev/null || exit 1
   169    174   
   170         -			./build.sh 3>&1 4>&2 > build.log 2>&1 || exit 1
          175  +			build_script='./build.sh'
          176  +			if [ -x 'kitcreator-build.sh' ]; then
          177  +				build_script='./kitcreator-build.sh'
          178  +			fi
          179  +			"${build_script}" 3>&1 4>&2 > build.log 2>&1 || exit 1
   171    180   		) || failed="1"
   172    181   	fi
   173    182   
   174    183   	if [ "${failed}" = "1" ]; then
   175    184   		echo " failed."
   176    185   		failedpkgs="${failedpkgs} ${pkg}"
   177    186   	else

Modified kitsh/buildsrc/kitsh-0.0/Makefile.common.in from [60b5e343af] to [93d968f811].

    11     11   STRIPLIBS = @STRIPLIBS@ @EXTRA_OBJS@
    12     12   EXTRA_OBJS = @EXTRA_OBJS@
    13     13   LDRUNPATH = @LDRUNPATH@
    14     14   EXTRA_KIT_DEPS = @EXTRA_KIT_DEPS@
    15     15   EXTRA_VFS_OBJS = @EXTRA_VFS_OBJS@
    16     16   TCLSH_NATIVE = tclsh
    17     17   LDFLAGS_ADD = @LDFLAGS_ADD@
           18  +DIR2C_FLAGS = @DIR2C_FLAGS@
    18     19   
    19     20   # Build targets
    20     21   ## VFS Build
    21     22   cvfs_data_tcl.o: cvfs_data_tcl.c
    22     23   cvfs_data_tcl.c: dir2c.tcl starpack.vfs cvfs_data.c
    23         -	"$(TCLSH_NATIVE)" dir2c.tcl tcl starpack.vfs > cvfs_data_tcl.c
           24  +	"$(TCLSH_NATIVE)" dir2c.tcl tcl starpack.vfs $(DIR2C_FLAGS) > cvfs_data_tcl.c
    24     25   
    25     26   ## Tcl scripts that need to be converted to C headers
    26     27   cvfs.tcl.h: cvfs.tcl
    27     28   	"$(TCLSH_NATIVE)" ./stringify.tcl cvfs.tcl > cvfs.tcl.h
    28     29   
    29     30   boot.tcl.h: boot.tcl
    30     31   	"$(TCLSH_NATIVE)" ./stringify.tcl boot.tcl > boot.tcl.h

Modified kitsh/buildsrc/kitsh-0.0/aclocal.m4 from [4e978303f9] to [b344f06840].

   556    556   		])
   557    557   	done
   558    558   
   559    559   	LDFLAGS="${OLD_LDFLAGS}"
   560    560   
   561    561   	AC_SUBST(LDRUNPATH)
   562    562   ])
          563  +
          564  +AC_DEFUN(DC_SET_DIR2C_FLAGS, [
          565  +	AC_MSG_CHECKING([if we should obsufcate the CVFS])
          566  +
          567  +	AC_ARG_WITH(obsfucated-cvfs, AC_HELP_STRING([--with-obsfucated-cvfs], [Obsfucate CVFS filesystem (requires --enable-kit-storage=cvfs)]), [
          568  +		obsfucate_cvfs=$withval
          569  +	], [
          570  +		obsfucate_cvfs='no'
          571  +	])
          572  +
          573  +	case "$obsfucate_cvfs" in
          574  +		yes)
          575  +			AC_MSG_RESULT([yes])
          576  +			DIR2C_FLAGS='--obsfucate'
          577  +			;;
          578  +		*)
          579  +			AC_MSG_RESULT([no])
          580  +			DIR2C_FLAGS=''
          581  +			;;
          582  +	esac
          583  +
          584  +	AC_SUBST(DIR2C_FLAGS)
          585  +])

Modified kitsh/buildsrc/kitsh-0.0/configure.ac from [68bb20ca2d] to [42d57f3f66].

   186    186   
   187    187   		dnl Define that C-VFS should be make [load]-able
   188    188   		AC_DEFINE([CVFS_MAKE_LOADABLE], [1], [Specify that the C-VFS should be able to be loaded])
   189    189   
   190    190   		dnl Add appropriate dependencies
   191    191   		EXTRA_KIT_DEPS="cvfs.tcl.h"
   192    192   		EXTRA_VFS_OBJS="${EXTRA_VFS_OBJS} cvfs_data_tcl.o"
          193  +
          194  +		dnl Set any flags as required
          195  +		DC_SET_DIR2C_FLAGS
   193    196   	]
   194    197   )
   195    198   
   196    199   AC_SUBST(EXTRA_KIT_DEPS)
   197    200   AC_SUBST(LDFLAGS_ADD)
   198    201   
   199    202   dnl Put correct Makefile template in place
   200    203   rm -f Makefile.in
   201    204   cp Makefile.${TARGET}.in Makefile.in
   202    205   
   203    206   dnl Produce output
   204    207   AC_OUTPUT(Makefile Makefile.common)

Modified kitsh/buildsrc/kitsh-0.0/cvfs_data.c from [dcf0f1a5fd] to [010e908a77].

     2      2   
     3      3   #ifdef HAVE_STDLIB_H
     4      4   #  include <stdlib.h>
     5      5   #endif
     6      6   
     7      7   typedef struct cvfs_data *(cmd_getData_t)(const char *, unsigned long);
     8      8   typedef unsigned long (cmd_getChildren_t)(const char *, unsigned long *, unsigned long);
            9  +typedef void (cmd_decryptFile_t)(const char *, struct cvfs_data *); 
     9     10   
    10     11   /* Your implementation must provide these */
    11     12   static cmd_getData_t *getCmdData(const char *hashkey);
    12     13   static cmd_getChildren_t *getCmdChildren(const char *hashkey);
           14  +static cmd_decryptFile_t *getCmdDecryptFile(const char *hashkey);
    13     15   
    14     16   /* Tcl Commands */
    15     17   static int getMetadata(ClientData cd, Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[]) {
    16     18   	cmd_getData_t *cmd_getData;
    17     19   	cmd_getChildren_t *cmd_getChildren;
    18     20   	struct cvfs_data *finfo = NULL;
    19     21   	Tcl_Obj *ret_list, *ret_list_items[20];
    20     22   	unsigned long num_children;
    21     23   	const char *hashkey;
    22     24   	const char *file;
           25  +	int idx;
    23     26   
    24     27   	if (objc != 3) {
    25     28   		Tcl_SetResult(interp, "wrong # args: should be \"getMetadata hashKey fileName\"", TCL_STATIC);
    26     29   
    27     30   		return(TCL_ERROR);
    28     31   	}
    29     32   
................................................................................
    81     84   	ret_list_items[15] = Tcl_NewStringObj("0", 1);
    82     85   
    83     86   	ret_list_items[16] = Tcl_NewStringObj("mtime", 5);
    84     87   	ret_list_items[17] = Tcl_NewStringObj("0", 1);
    85     88   
    86     89   	ret_list_items[18] = Tcl_NewStringObj("ctime", 5);
    87     90   	ret_list_items[19] = Tcl_NewStringObj("0", 1);
           91  +
           92  +	for (idx = 0; idx < (sizeof(ret_list_items) / sizeof(ret_list_items[0])); idx++) {
           93  +		Tcl_IncrRefCount(ret_list_items[idx]);
           94  +	}
    88     95   
    89     96   	ret_list = Tcl_NewListObj(sizeof(ret_list_items) / sizeof(ret_list_items[0]), ret_list_items);
           97  +
           98  +	Tcl_IncrRefCount(ret_list);
    90     99   
    91    100   	Tcl_SetObjResult(interp, ret_list);
          101  +
          102  +	Tcl_DecrRefCount(ret_list);
          103  +
          104  +	for (idx = 0; idx < (sizeof(ret_list_items) / sizeof(ret_list_items[0])); idx++) {
          105  +		Tcl_DecrRefCount(ret_list_items[idx]);
          106  +	}
    92    107   
    93    108   	return(TCL_OK);
    94    109   }
    95    110   
    96    111   static int getData(ClientData cd, Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[]) {
    97    112   	struct cvfs_data *finfo = NULL;
    98    113   	cmd_getData_t *cmd_getData;
          114  +	cmd_decryptFile_t *cmd_decryptFile;
    99    115   	const char *hashkey;
   100    116   	const char *file;
   101    117   	const char *end_str;
   102    118   	Tcl_Obj *ret_str;
   103    119   	long start = 0;
   104    120   	long end = -1;
   105    121   	int tclGetLFO_ret;
................................................................................
   145    161   	finfo = cmd_getData(file, 0);
   146    162   
   147    163   	if (finfo == NULL) {
   148    164   		Tcl_SetResult(interp, "No such file or directory", TCL_STATIC);
   149    165   
   150    166   		return(TCL_ERROR);
   151    167   	}
          168  +
          169  +	if (finfo->type == CVFS_FILETYPE_ENCRYPTED_FILE) {
          170  +		cmd_decryptFile = getCmdDecryptFile(hashkey);
          171  +
          172  +		if (cmd_decryptFile != NULL) {
          173  +			cmd_decryptFile(file, finfo);
          174  +		}
          175  +	}
   152    176   
   153    177   	if (finfo->type != CVFS_FILETYPE_FILE) {
   154    178   		Tcl_SetResult(interp, "Not a file", TCL_STATIC);
   155    179   
   156    180   		return(TCL_ERROR);
   157    181   	}
   158    182   
................................................................................
   175    199   	if (end < start) {
   176    200   		Tcl_SetResult(interp, "Invalid arguments, start must be less than end", TCL_STATIC);
   177    201   
   178    202   		return(TCL_ERROR);
   179    203   	}
   180    204   
   181    205   	ret_str = Tcl_NewByteArrayObj(finfo->data + start, (end - start));
          206  +
          207  +	Tcl_IncrRefCount(ret_str);
   182    208   
   183    209   	Tcl_SetObjResult(interp, ret_str);
          210  +
          211  +	Tcl_DecrRefCount(ret_str);
   184    212   
   185    213   	return(TCL_OK);
   186    214   }
   187    215   
   188    216   static int getChildren(ClientData cd, Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[]) {
   189    217   	struct cvfs_data *finfo = NULL;
   190    218   	cmd_getChildren_t *cmd_getChildren;
................................................................................
   239    267   
   240    268   	ret_list = Tcl_NewObj();
   241    269   	if (ret_list == NULL) {
   242    270   		Tcl_SetResult(interp, "Failed to allocate new object", TCL_STATIC);
   243    271   
   244    272   		return(TCL_ERROR);
   245    273   	}
          274  +
          275  +	Tcl_IncrRefCount(ret_list);
   246    276   
   247    277   	children = malloc(sizeof(*children) * num_children);
   248    278   
   249    279   	num_children = cmd_getChildren(file, children, num_children);
   250    280   
   251    281   	for (idx = 0; idx < num_children; idx++) {
   252    282   		finfo = cmd_getData(NULL, children[idx]);
................................................................................
   254    284   		if (finfo == NULL || finfo->name == NULL) {
   255    285   			continue;
   256    286   		}
   257    287   
   258    288   		child = finfo->name;
   259    289   
   260    290   		ret_curr_obj = Tcl_NewStringObj(child, strlen(child));
          291  +
          292  +		Tcl_IncrRefCount(ret_curr_obj);
   261    293   
   262    294   		Tcl_ListObjAppendList(interp, ret_list, ret_curr_obj);
          295  +
          296  +		Tcl_DecrRefCount(ret_curr_obj);
   263    297   	}
   264    298   
   265    299   	free(children);
   266    300   
   267    301   	Tcl_SetObjResult(interp, ret_list);
          302  +
          303  +	Tcl_DecrRefCount(ret_list);
   268    304   
   269    305   	return(TCL_OK);
   270    306   }

Modified kitsh/buildsrc/kitsh-0.0/dir2c.tcl from [903b20a63c] to [18ee9a3f9a].

     1      1   #! /usr/bin/env tclsh
            2  +
            3  +set obsfucate 0
            4  +if {[lindex $argv end] == "--obsfucate"} {
            5  +	set obsfucate 1
            6  +
            7  +	set argv [lrange $argv 0 end-1]
            8  +}
     2      9   
     3     10   if {[llength $argv] != 2} {
     4         -	puts stderr "Usage: dir2c.tcl <hashkey> <startdir>"
           11  +	puts stderr "Usage: dir2c.tcl <hashkey> <startdir> \[--obsfucate\]"
     5     12   
     6     13   	exit 1
     7     14   }
     8     15   
     9     16   set hashkey [lindex $argv 0]
    10     17   set startdir [lindex $argv 1]
    11     18   
................................................................................
    70     77   
    71     78   	set ret [string trim $ret "\n\""]
    72     79   
    73     80   	set ret "\"$ret\""
    74     81   
    75     82   	return $ret
    76     83   }
           84  +
           85  +# Encrypt the data
           86  +proc random_byte {} {
           87  +	set value [expr {int(256 * rand())}]
           88  +
           89  +	return $value
           90  +}
           91  +
           92  +proc encrypt_key_generate {method} {
           93  +	switch -- $method {
           94  +		"rotate_subst" {
           95  +			set key(method) $method
           96  +			set key(rotate_length) [random_byte]
           97  +
           98  +			set key_data [list]
           99  +			while {[llength $key_data] != 256} {
          100  +				set value [random_byte]
          101  +				if {[lsearch -exact $key_data $value] != -1} {
          102  +					continue
          103  +				}
          104  +
          105  +				lappend key_data $value
          106  +			}
          107  +
          108  +			foreach value $key_data {
          109  +				append key(subst) [format %c $value]
          110  +			}
          111  +
          112  +			return [array get key]
          113  +		}
          114  +	}
          115  +	error "not implemented"
          116  +}
          117  +
          118  +proc encrypt_key_export {key_dict target} {
          119  +	array set key $key_dict
          120  +
          121  +	switch -- $key(method) {
          122  +		"rotate_subst" {
          123  +			switch -- $target {
          124  +				"c" {
          125  +					set retval ".type = CVFS_KEYTYPE_ROTATE_SUBST,\n"
          126  +					append retval ".typedata.rotate_subst.rotate_length = $key(rotate_length),\n"
          127  +					append retval ".typedata.rotate_subst.subst         = (unsigned char *) [stringify $key(subst)]\n"
          128  +
          129  +					return $retval
          130  +				}
          131  +			}
          132  +		}
          133  +	}
          134  +
          135  +	error "not implemented"
          136  +}
          137  +
          138  +proc encrypt {data key_dict {decrypt 0}} {
          139  +	array set key $key_dict
          140  +
          141  +	switch -- $key(method) {
          142  +		"rotate_subst" {
          143  +			set retval ""
          144  +			set datalen [string length $data]
          145  +
          146  +			for {set i 0} {$i < $datalen} {incr i $key(rotate_length)} {
          147  +				set map [list]
          148  +				for {set j 0} {$j < 256} {incr j} {
          149  +					if {$decrypt} {
          150  +						lappend map [format %c $j] [string index $key(subst) $j]
          151  +					} else {
          152  +						lappend map [string index $key(subst) $j] [format %c $j]
          153  +					}
          154  +				}
          155  +
          156  +				set end [expr {$i + $key(rotate_length) - 1}]
          157  +
          158  +				set block [string range $data $i $end]
          159  +				set block [string map $map $block]
          160  +
          161  +				append retval $block
          162  +
          163  +				set key_end [string index $key(subst) 0]
          164  +				set key(subst) [string range $key(subst) 1 end]$key_end
          165  +			}
          166  +
          167  +			return $retval
          168  +		}
          169  +		"aes" {
          170  +			package require aes
          171  +		}
          172  +	}
          173  +	error "not implemented"
          174  +}
          175  +
          176  +proc decrypt {data key_dict} {
          177  +	return [encrypt $data $key_dict 1]
          178  +}
    77    179   
    78    180   # This function must be kept in-sync with the generated C function below
    79    181   proc cvfs_hash {path} {
    80    182   	set h 0
    81    183   	set g 0
    82    184   
    83    185   	for {set idx 0} {$idx < [string length $path]} {incr idx} {
................................................................................
    91    193   		}
    92    194   
    93    195   		set h [expr {$h & ((~$g) & 0xffffffff)}]
    94    196   	}
    95    197   
    96    198   	return $h
    97    199   }
          200  +
          201  +# If encryption is requested, generate a key
          202  +if {$obsfucate} {
          203  +	set obsfucation_key [encrypt_key_generate "rotate_subst"]
          204  +}
    98    205   
    99    206   # Generate list of files to include in output
   100    207   set files [recursive_glob $startdir]
   101    208   
   102    209   # Insert dummy entry cooresponding to C dummy entry
   103    210   set files [linsert $files 0 "__DUMMY__"]
   104    211   
................................................................................
   113    220   #  ifdef HAVE_STDC
   114    221   #    ifndef HAVE_UNISTD_H
   115    222   #      define HAVE_UNISTD_H 1
   116    223   #    endif
   117    224   #    ifndef HAVE_STRING_H
   118    225   #      define HAVE_STRING_H 1
   119    226   #    endif
          227  +#    ifndef HAVE_STDLIB_H
          228  +#      define HAVE_STDLIB_H 1
          229  +#    endif
   120    230   #  endif
   121    231   #  ifdef HAVE_UNISTD_H
   122    232   #    include <unistd.h>
   123    233   #  endif
   124    234   #  ifdef HAVE_STRING_H
   125    235   #    include <string.h>
   126    236   #  endif
          237  +#  ifdef HAVE_STDLIB_H
          238  +#    include <stdlib.h>
          239  +#  endif
   127    240   
   128    241   #  ifndef LOADED_CVFS_COMMON
   129    242   #    define LOADED_CVFS_COMMON 1
   130    243   
   131    244   typedef enum {
   132         -	CVFS_FILETYPE_FILE,
   133         -	CVFS_FILETYPE_DIR
          245  +	CVFS_FILETYPE_FILE            = 0,
          246  +	CVFS_FILETYPE_DIR             = 1,
          247  +	CVFS_FILETYPE_ENCRYPTED_FILE  = 2,
          248  +	CVFS_FILETYPE_COMPRESSED_FILE = 4,
   134    249   } cvfs_filetype_t;
   135    250   
   136    251   struct cvfs_data {
   137    252   	const char *             name;
   138    253   	unsigned long            index;
   139    254   	unsigned long            size;
   140    255   	cvfs_filetype_t          type;
   141    256   	const unsigned char *    data;
          257  +	int                      free;
          258  +};
          259  +
          260  +typedef enum {
          261  +	CVFS_KEYTYPE_ROTATE_SUBST     = 0,
          262  +} cvfs_keytype_t;
          263  +
          264  +struct cvfs_key {
          265  +	cvfs_keytype_t type;
          266  +	union {
          267  +		struct {
          268  +			int rotate_length;
          269  +			unsigned char *subst;
          270  +		} rotate_subst;
          271  +	} typedata;
   142    272   };
   143    273   
   144    274   static unsigned long cvfs_hash(const unsigned char *path) {
   145    275   	unsigned long i, h = 0, g = 0;
   146    276   
   147    277   	for (i = 0; path[i]; i++) {
   148    278   		h = (h << 4) + path[i];
................................................................................
   151    281   			h ^= (g >> 24);
   152    282   		}
   153    283   		h &= ((~g) & 0xffffffffLU);
   154    284   	}
   155    285           
   156    286           return(h);
   157    287   }
          288  +
          289  +static int cvfs_decrypt(unsigned char *out, const unsigned char *in, unsigned long in_out_length, struct cvfs_key *key) {
          290  +	unsigned long i;
          291  +	unsigned char in_ch, out_ch;
          292  +	int ch_idx;
          293  +
          294  +	for (i = 0; i < in_out_length; i++) {
          295  +		in_ch = in[i];
          296  +
          297  +		ch_idx = (in_ch + (i / key->typedata.rotate_subst.rotate_length)) % 256;
          298  +
          299  +		out_ch = key->typedata.rotate_subst.subst[ch_idx];
          300  +		out[i] = out_ch;
          301  +	}
          302  +
          303  +	return(0);
          304  +}
   158    305   
   159    306   #  endif /* !LOADED_CVFS_COMMON */}
   160    307   puts ""
   161    308   
   162    309   puts "static struct cvfs_data ${code_tag}_data\[\] = {"
   163    310   puts "\t{"
          311  +puts "\t\t/* Index 0 cannot be used because we use the value 0 to represent failure */"
   164    312   puts "\t\t.name  = NULL,"
   165    313   puts "\t\t.index = 0,"
   166    314   puts "\t\t.type  = 0,"
   167    315   puts "\t\t.size  = 0,"
   168    316   puts "\t\t.data  = NULL,"
          317  +puts "\t\t.free  = 0,"
   169    318   puts "\t},"
   170    319   for {set idx 1} {$idx < [llength $files]} {incr idx} {
   171    320   	set file [lindex $files $idx]
   172    321   	set shortfile [shorten_file $startdir $file]
   173    322   
   174    323   	unset -nocomplain finfo type
   175    324   	file stat $file finfo
   176    325   
   177    326   	switch -- $finfo(type) {
   178    327   		"file" {
   179         -			set type "CVFS_FILETYPE_FILE"
   180    328   			set size $finfo(size)
   181    329   
   182    330   			set fd [open $file]
   183    331   			fconfigure $fd -translation binary
   184    332   			set data [read $fd]
   185    333   			close $fd
   186    334   
   187         -			set data "(unsigned char *) [stringify $data]"
          335  +			if {$obsfucate} {
          336  +				set type "CVFS_FILETYPE_ENCRYPTED_FILE"
          337  +				set data "(unsigned char *) [stringify [encrypt $data $obsfucation_key]]"
          338  +			} else {
          339  +				set type "CVFS_FILETYPE_FILE"
          340  +				set data "(unsigned char *) [stringify $data]"
          341  +			}
   188    342   		}
   189    343   		"directory" {
   190    344   			set type "CVFS_FILETYPE_DIR"
   191    345   			set data "NULL"
   192    346   			set size 0
   193    347   		}
   194    348   	}
................................................................................
   195    349   
   196    350   	puts "\t{"
   197    351   	puts "\t\t.name  = \"$shortfile\","
   198    352   	puts "\t\t.index = $idx,"
   199    353   	puts "\t\t.type  = $type,"
   200    354   	puts "\t\t.size  = $size,"
   201    355   	puts "\t\t.data  = $data,"
          356  +	puts "\t\t.free  = 0,"
   202    357   	puts "\t},"
   203    358   }
   204    359   puts "};"
   205    360   puts ""
   206    361   
   207    362   puts "static unsigned long ${code_tag}_lookup_index(const char *path) {"
   208    363   puts "\tswitch (cvfs_hash((unsigned char *) path)) {"
................................................................................
   346    501   }
   347    502   
   348    503   puts "\t}"
   349    504   puts ""
   350    505   puts "\treturn(num_children);"
   351    506   puts "}"
   352    507   puts ""
          508  +
          509  +if {$obsfucate} {
          510  +	puts "static void ${code_tag}_decryptFile(const char *path, struct cvfs_data *finfo) {"
          511  +	puts "\tstatic struct cvfs_key key = { [string map [list "\n" " "] [encrypt_key_export $obsfucation_key "c"]] };"
          512  +	puts "\tunsigned char *new_data, *old_data;"
          513  +	puts "\tint decrypt_ret, free_old_data;"
          514  +	puts ""
          515  +	puts "\tnew_data = malloc(finfo->size);"
          516  +	puts "\tdecrypt_ret = cvfs_decrypt(new_data, finfo->data, finfo->size, &key);"
          517  +	puts "\tif (decrypt_ret != 0) {"
          518  +	puts "\t\tfree(new_data);"
          519  +	puts ""
          520  +	puts "\t\treturn;"
          521  +	puts "\t}"
          522  +	puts ""
          523  +	puts "\tfree_old_data = finfo->free;"
          524  +	puts "\told_data = (void *) finfo->data;"
          525  +	puts ""
          526  +	puts "\tfinfo->data = new_data;"
          527  +	puts "\tfinfo->free = 1;"
          528  +	puts "\tfinfo->type = CVFS_FILETYPE_FILE;"
          529  +	puts ""
          530  +	puts "\tif (free_old_data) {"
          531  +	puts "\t\tfree(old_data);"
          532  +	puts "\t}"
          533  +	puts "\treturn;"
          534  +	puts "}"
          535  +	puts ""
          536  +}
   353    537   
   354    538   puts "#  ifdef CVFS_MAKE_LOADABLE"
   355    539   
   356    540   set fd [open "cvfs_data.c"]
   357    541   puts [read $fd]
   358    542   close $fd
   359         -
   360    543   
   361    544   puts "static cmd_getData_t *getCmdData(const char *hashkey) {"
   362    545   puts "\treturn(${code_tag}_getData);"
   363    546   puts "}"
   364    547   puts ""
   365    548   puts "static cmd_getChildren_t *getCmdChildren(const char *hashkey) {"
   366    549   puts "\treturn(${code_tag}_getChildren);"
          550  +puts "}"
          551  +puts ""
          552  +puts "static cmd_decryptFile_t *getCmdDecryptFile(const char *hashkey) {"
          553  +if {$obsfucate} {
          554  +	puts "\treturn(${code_tag}_decryptFile);"
          555  +} else {
          556  +	puts "\treturn(NULL);"
          557  +}
   367    558   puts "}"
   368    559   puts ""
   369    560   
   370    561   puts "int Cvfs_data_${hashkey}_Init(Tcl_Interp *interp) {"
   371    562   puts "\tTcl_Command tclCreatComm_ret;"
   372    563   puts "\tint tclPkgProv_ret;"
   373    564   puts ""

Modified mk4tcl/build.sh from [b69a612055] to [c5265584d3].

    10     10   
    11     11   	exit 1
    12     12   fi
    13     13   
    14     14   MK4VERS="2.4.9.7"
    15     15   SRC="src/metakit-${MK4VERS}.tar.gz"
    16     16   SRCURL="http://www.equi4.com/pub/mk/metakit-${MK4VERS}.tar.gz"
           17  +SRCURL="http://pkgs.fedoraproject.org/repo/pkgs/metakit/metakit-${MK4VERS}.tar.gz/17330257376eea657827ed632ea62c9e/metakit-${MK4VERS}.tar.gz"
    17     18   BUILDDIR="$(pwd)/build/metakit-${MK4VERS}"
    18     19   OUTDIR="$(pwd)/out"
    19     20   INSTDIR="$(pwd)/inst"
    20     21   PATCHDIR="$(pwd)/patches"
    21     22   export MK4VERS SRC SRCURL BUILDDIR OUTDIR INSTDIR PATCHDIR
    22     23   
    23     24   # Set configure options for this sub-project

Modified tcc4tcl/build.sh from [ae573dea00] to [a8c1cbf0ad].

     7      7   fi
     8      8   if [ -z "${TCLVERS}" ]; then
     9      9   	echo 'ERROR: The TCLVERS environment variable is not set' >&2
    10     10   
    11     11   	exit 1
    12     12   fi
    13     13   
    14         -TCC4TCLVERS="0.22"
           14  +TCC4TCLVERS="0.23"
    15     15   SRC="src/tcc4tcl-${TCC4TCLVERS}.tar.gz"
    16     16   SRCURL="http://rkeene.org/devel/tcc4tcl/tcc4tcl-${TCC4TCLVERS}.tar.gz"
    17     17   BUILDDIR="$(pwd)/build/tcc4tcl-${TCC4TCLVERS}"
    18     18   OUTDIR="$(pwd)/out"
    19     19   INSTDIR="$(pwd)/inst"
    20     20   PATCHDIR="$(pwd)/patches"
    21     21   export TCC4TCLVERS SRC SRCURL BUILDDIR OUTDIR INSTDIR PATCHDIR

Added tcl/patchscripts/force-static-pkgs.sh version [068e7f94db].

            1  +#! /usr/bin/env bash
            2  +
            3  +if [ "${KC_TCL_STATICPKGS}" != '1' ]; then
            4  +	exit 0
            5  +fi
            6  +
            7  +for makefile in {unix,win,macosx}/Makefile.in; do
            8  +	sed 's@--enable-shared@--disable-shared CFLAGS="-fPIC" @g' "${makefile}" > "${makefile}.new"
            9  +	cat "${makefile}.new" > "${makefile}"
           10  +	rm -f "${makefile}.new"
           11  +done
           12  +
           13  +for pkgIndexFile in pkgs/*/pkgIndex*; do
           14  +	sed 's@load \[file join [^]]*\]@load {}@;s@\(Thread.* \[list load {}\)\]@\1 Thread]@' "${pkgIndexFile}" > "${pkgIndexFile}.new"
           15  +	cat "${pkgIndexFile}.new" > "${pkgIndexFile}"
           16  +	rm -f "${pkgIndexFile}.new"
           17  +done
           18  +
           19  +for makefile in pkgs/*/Makefile*; do
           20  +	sed 's@x\$(SHARED_BUILD)@x1@g' "${makefile}" > "${makefile}.new"
           21  +	cat "${makefile}.new" > "${makefile}"
           22  +	rm -f "${makefile}.new"
           23  +done

Added tcllib/build.sh version [0558ed07b0].

            1  +#! /usr/bin/env bash
            2  +
            3  +TCLLIB_VERS='1.16'
            4  +SRC="src/tcllib-${TCLLIB_VERS}.tar.bz2"
            5  +SRCURL="http://sourceforge.net/projects/tcllib/files/tcllib/${TCLLIB_VERS}/Tcllib-${TCLLIB_VERS}.tar.bz2"
            6  +BUILDDIR="$(pwd)/build/Tcllib-${TCLLIB_VERS}"
            7  +OUTDIR="$(pwd)/out"
            8  +INSTDIR="$(pwd)/inst"
            9  +PATCHDIR="$(pwd)/patches"
           10  +export TCLLIB_VERS SRC SRCURL BUILDDIR OUTDIR INSTDIR PATCHDIR
           11  +
           12  +rm -rf 'build' 'out' 'inst'
           13  +mkdir 'build' 'out' 'inst' || exit 1
           14  +
           15  +if [ ! -f "${SRC}" ]; then
           16  +	mkdir 'src' >/dev/null 2>/dev/null
           17  +
           18  +	if [ ! -d 'buildsrc' ]; then
           19  +		rm -f "${SRC}.tmp"
           20  +		wget -O "${SRC}.tmp" "${SRCURL}" || exit 1
           21  +		mv "${SRC}.tmp" "${SRC}"
           22  +	fi
           23  +fi
           24  +
           25  +(
           26  +	cd 'build' || exit 1
           27  +
           28  +	if [ ! -d '../buildsrc' ]; then
           29  +		bzip2 -dc "../${SRC}" | tar -xf -
           30  +	else
           31  +		cp -rp ../buildsrc/* './'
           32  +	fi
           33  +
           34  +	cd "${BUILDDIR}" || exit 1
           35  +
           36  +	./configure --prefix="${INSTDIR}" || exit 1
           37  +
           38  +	make || exit 1
           39  +
           40  +	make install || exit 1
           41  +
           42  +	cp -rp "${INSTDIR}/lib" "${OUTDIR}"
           43  +) || exit 1
           44  +

Added tclvfs/patches/all/tclvfs-20080503-fixinternalrepuse.diff version [2689cdda92].

            1  +--- tclvfs-20080503.orig/generic/vfs.c	2006-08-30 19:38:03.000000000 +0000
            2  ++++ tclvfs-20080503-fixinternalrepuse/generic/vfs.c	2014-11-17 18:34:43.317025829 +0000
            3  +@@ -1986,16 +1986,17 @@
            4  +         return NULL;
            5  +     }
            6  +     
            7  +-    splitPosition = nativeRep->splitPosition;
            8  +-    normed = Tcl_FSGetNormalizedPath(NULL, pathPtr);
            9  +-    normedString = Tcl_GetStringFromObj(normed, &len);
           10  +-    
           11  +     mountCmd = Tcl_DuplicateObj(nativeRep->fsCmd->mountCmd);
           12  +     Tcl_IncrRefCount(mountCmd);
           13  +     if (Tcl_ListObjLength(NULL, mountCmd, &dummyLen) == TCL_ERROR) {
           14  + 	Tcl_DecrRefCount(mountCmd);
           15  + 	return NULL;
           16  +     }
           17  ++
           18  ++    splitPosition = nativeRep->splitPosition;
           19  ++    normed = Tcl_FSGetNormalizedPath(NULL, pathPtr);
           20  ++    normedString = Tcl_GetStringFromObj(normed, &len);
           21  ++    
           22  +     Tcl_ListObjAppendElement(NULL, mountCmd, Tcl_NewStringObj(cmd,-1));
           23  +     if (splitPosition == len) {
           24  + 	Tcl_ListObjAppendElement(NULL, mountCmd, normed);

Added tk/patches/all/tk-8.6-fixishellitem.diff version [988a4061b9].

            1  +--- tk8.6.3.orig/win/tkWinDialog.c	2014-10-25 11:50:40.000000000 -0500
            2  ++++ tk8.6.3-fixishellitem/win/tkWinDialog.c	2014-11-18 22:57:19.021033000 -0600
            3  +@@ -209,19 +209,9 @@
            4  +  * older compilers? Should we prefix definitions with Tcl_ instead
            5  +  * of using the same names as in the SDK?
            6  +  */
            7  +-#ifndef __IShellItemArray_INTERFACE_DEFINED__
            8  +-#define __IShellItemArray_INTERFACE_DEFINED__
            9  +-
           10  +-typedef enum SIATTRIBFLAGS {
           11  +-    SIATTRIBFLAGS_AND	= 0x1,
           12  +-    SIATTRIBFLAGS_OR	= 0x2,
           13  +-    SIATTRIBFLAGS_APPCOMPAT	= 0x3,
           14  +-    SIATTRIBFLAGS_MASK	= 0x3,
           15  +-    SIATTRIBFLAGS_ALLITEMS	= 0x4000
           16  +-} SIATTRIBFLAGS;
           17  ++#ifndef __IShellItem_INTERFACE_DEFINED__
           18  ++#  define __IShellItem_INTERFACE_DEFINED__
           19  + #ifdef __MSVCRT__
           20  +-typedef ULONG SFGAOF;
           21  +-
           22  + typedef struct IShellItem IShellItem;
           23  + 
           24  + typedef enum __MIDL_IShellItem_0001 {
           25  +@@ -250,6 +240,21 @@
           26  + struct IShellItem {
           27  +     CONST_VTBL struct IShellItemVtbl *lpVtbl;
           28  + };
           29  ++#endif
           30  ++#endif
           31  ++
           32  ++#ifndef __IShellItemArray_INTERFACE_DEFINED__
           33  ++#define __IShellItemArray_INTERFACE_DEFINED__
           34  ++
           35  ++typedef enum SIATTRIBFLAGS {
           36  ++    SIATTRIBFLAGS_AND	= 0x1,
           37  ++    SIATTRIBFLAGS_OR	= 0x2,
           38  ++    SIATTRIBFLAGS_APPCOMPAT	= 0x3,
           39  ++    SIATTRIBFLAGS_MASK	= 0x3,
           40  ++    SIATTRIBFLAGS_ALLITEMS	= 0x4000
           41  ++} SIATTRIBFLAGS;
           42  ++#ifdef __MSVCRT__
           43  ++typedef ULONG SFGAOF;
           44  + #endif /* __MSVCRT__ */
           45  + typedef struct IShellItemArray IShellItemArray;
           46  + typedef struct IShellItemArrayVtbl

Modified tls/build.sh from [425a7ec59e] to [f6144b21a4].

    79     79   		tryopts="--enable-shared --disable-shared"
    80     80   	elif [ "${STATICTLS}" = "-1" ]; then
    81     81   		tryopts="--enable-shared"
    82     82   	else
    83     83   		tryopts="--disable-shared"
    84     84   	fi
    85     85   
           86  +	# Disable SSLv2, newer SSL libraries drop support for it entirely
           87  +	CFLAGS="${CFLAGS} -DNO_SSL2=1"
           88  +
    86     89   	SAVE_CFLAGS="${CFLAGS}"
    87     90   	for tryopt in $tryopts __fail__; do
    88     91   		# Clean up, if needed
    89     92   		make distclean >/dev/null 2>/dev/null
    90     93   		rm -rf "${INSTDIR}"
    91     94   		mkdir "${INSTDIR}"
    92     95   
................................................................................
   136    139   		cat << _EOF_ > "${INSTDIR}/lib/tls${TLSVERS}/pkgIndex.tcl"
   137    140   package ifneeded tls ${TLSVERS} \
   138    141       "[list source [file join \$dir tls.tcl]] ; \
   139    142        [list load {} tls]"
   140    143   _EOF_
   141    144   	fi
   142    145   
          146  +	## XXX: TODO: Determine what we actually need to link against
          147  +	addlibs="-lssl -lcrypto"
          148  +	if [ "${KC_TLS_LINKSSLSTATIC}" = '1' ]; then
          149  +		echo "-Wl,-Bstatic ${addlibs} -Wl,-Bdynamic"
          150  +	else
          151  +		echo "${addlibs}"
          152  +	fi > "${INSTDIR}/lib/tls${TLSVERS}/libtls${TLSVERS}.a.linkadd"
          153  +
   143    154   	# Install files needed by installation
   144    155   	cp -r "${INSTDIR}/lib" "${OUTDIR}" || exit 1
   145    156   	find "${OUTDIR}" -name '*.a' -type f | xargs -n 1 rm -f --
   146    157   
   147         -	## XXX: TODO: Determine what we actually need to link against
   148         -	echo '-lssl -lcrypto' > "${INSTDIR}/lib/tls${TLSVERS}/libtls${TLSVERS}.a.linkadd"
   149         -
   150    158   	exit 0
   151    159   ) || exit 1
   152    160   
   153    161   exit 0

Added udp/build.sh version [0751b83164].

            1  +#! /usr/bin/env bash
            2  +
            3  +if [ ! -f 'build.sh' ]; then
            4  +	echo 'ERROR: This script must be run from the directory it is in' >&2
            5  +
            6  +	exit 1
            7  +fi
            8  +if [ -z "${TCLVERS}" ]; then
            9  +	echo 'ERROR: The TCLVERS environment variable is not set' >&2
           10  +
           11  +	exit 1
           12  +fi
           13  +
           14  +TCLUDPVERS="1.0.11"
           15  +SRC="src/tcludp-${TCLUDPVERS}.tar.gz"
           16  +SRCURL="http://sourceforge.net/projects/tcludp/files/tcludp/${TCLUDPVERS}/tcludp-${TCLUDPVERS}.tar.gz"
           17  +BUILDDIR="$(pwd)/build/tcludp"
           18  +OUTDIR="$(pwd)/out"
           19  +INSTDIR="$(pwd)/inst"
           20  +PATCHDIR="$(pwd)/patches"
           21  +export TCLUDPVERS SRC SRCURL BUILDDIR OUTDIR INSTDIR PATCHDIR
           22  +
           23  +# Set configure options for this sub-project
           24  +LDFLAGS="${LDFLAGS} ${KC_TCLUDP_LDFLAGS}"
           25  +CFLAGS="${CFLAGS} ${KC_TCLUDP_CFLAGS}"
           26  +CPPFLAGS="${CPPFLAGS} ${KC_TCLUDP_CPPFLAGS}"
           27  +LIBS="${LIBS} ${KC_TCLUDP_LIBS}"
           28  +export LDFLAGS CFLAGS CPPFLAGS LIBS
           29  +
           30  +rm -rf 'build' 'out' 'inst'
           31  +mkdir 'build' 'out' 'inst' || exit 1
           32  +
           33  +TCL_VERSION="unknown"
           34  +if [ -f "${TCLCONFIGDIR}/tclConfig.sh" ]; then
           35  +        source "${TCLCONFIGDIR}/tclConfig.sh"
           36  +fi
           37  +export TCL_VERSION
           38  +
           39  +if [ ! -f "${SRC}" ]; then
           40  +	mkdir 'src' >/dev/null 2>/dev/null
           41  +
           42  +	if [ ! -d 'buildsrc' ]; then
           43  +		rm -f "${SRC}.tmp"
           44  +		wget -O "${SRC}.tmp" "${SRCURL}" || exit 1
           45  +		mv "${SRC}.tmp" "${SRC}"
           46  +	fi
           47  +fi
           48  +
           49  +(
           50  +	cd 'build' || exit 1
           51  +
           52  +	if [ ! -d '../buildsrc' ]; then
           53  +		gzip -dc "../${SRC}" | tar -xf -
           54  +	else    
           55  +		cp -rp ../buildsrc/* './'
           56  +	fi
           57  +
           58  +	cd "${BUILDDIR}" || exit 1
           59  +
           60  +	# Try to build as a shared object if requested
           61  +	if [ "${STATICTCLUDP}" = "0" ]; then
           62  +		tryopts="--enable-shared --disable-shared"
           63  +	elif [ "${STATICTCLUDP}" = "-1" ]; then
           64  +		tryopts="--enable-shared"
           65  +	else
           66  +		tryopts="--disable-shared"
           67  +	fi
           68  +
           69  +	SAVE_CFLAGS="${CFLAGS}"
           70  +	for tryopt in $tryopts __fail__; do
           71  +		rm -rf "${INSTDIR}"
           72  +		mkdir "${INSTDIR}"
           73  +
           74  +		if [ "${tryopt}" = "__fail__" ]; then
           75  +			exit 1
           76  +		fi
           77  +
           78  +		# Clean up, if needed
           79  +		make distclean >/dev/null 2>/dev/null
           80  +		if [ "${tryopt}" == "--enable-shared" ]; then
           81  +			isshared="1"
           82  +		else
           83  +			isshared="0"
           84  +		fi
           85  +
           86  +		# If build a static TCLUDP for KitDLL, ensure that we use PIC
           87  +		# so that it can be linked into the shared object
           88  +		if [ "${isshared}" = "0" -a "${KITTARGET}" = "kitdll" ]; then
           89  +			CFLAGS="${SAVE_CFLAGS} -fPIC"
           90  +		else
           91  +			CFLAGS="${SAVE_CFLAGS}"
           92  +		fi
           93  +		export CFLAGS
           94  +
           95  +		if [ "${isshared}" = '0' ]; then
           96  +			sed 's@USE_TCL_STUBS@XXX_TCL_STUBS@g' configure > configure.new
           97  +		else
           98  +			sed 's@XXX_TCL_STUBS@USE_TCL_STUBS@g' configure > configure.new
           99  +		fi
          100  +		cat configure.new > configure
          101  +		rm -f configure.new
          102  +
          103  +		(
          104  +			echo "Running: ./configure $tryopt --prefix=\"${INSTDIR}\" --exec-prefix=\"${INSTDIR}\" --libdir=\"${INSTDIR}/lib\" --with-tcl=\"${TCLCONFIGDIR}\" ac_cv_path_DTPLITE=no ${CONFIGUREEXTRA}"
          105  +			./configure $tryopt --prefix="${INSTDIR}" --exec-prefix="${INSTDIR}" --libdir="${INSTDIR}/lib" --with-tcl="${TCLCONFIGDIR}" ac_cv_path_DTPLITE=no ${CONFIGUREEXTRA}
          106  +
          107  +			echo "Running: ${MAKE:-make} tcllibdir=\"${INSTDIR}/lib\""
          108  +			${MAKE:-make} tcllibdir="${INSTDIR}/lib" || exit 1
          109  +
          110  +			echo "Running: ${MAKE:-make} tcllibdir=\"${INSTDIR}/lib\" install"
          111  +			${MAKE:-make} tcllibdir="${INSTDIR}/lib" install || exit 1
          112  +		) || continue
          113  +
          114  +		break
          115  +	done
          116  +
          117  +	# Create pkgIndex if needed
          118  +	if [ ! -e "${INSTDIR}/lib/udp${TCLUDPVERS}/pkgIndex.tcl" ]; then
          119  +		cat << _EOF_ > "${INSTDIR}/lib/udp${TCLUDPVERS}/pkgIndex.tcl"
          120  +package ifneeded udp ${TCLUDPVERS} [list load {} udp]
          121  +_EOF_
          122  +	fi
          123  +
          124  +	# Install files needed by installation
          125  +	cp -r "${INSTDIR}/lib" "${OUTDIR}" || exit 1
          126  +	find "${OUTDIR}" -name '*.a' -type f | xargs -n 1 rm -f --
          127  +
          128  +	exit 0
          129  +) || exit 1
          130  +
          131  +exit 0

Added yajltcl/build.sh version [4f55cc724b].

            1  +#! /usr/bin/env bash
            2  +
            3  +if [ ! -f 'build.sh' ]; then
            4  +	echo 'ERROR: This script must be run from the directory it is in' >&2
            5  +
            6  +	exit 1
            7  +fi
            8  +if [ -z "${TCLVERS}" ]; then
            9  +	echo 'ERROR: The TCLVERS environment variable is not set' >&2
           10  +
           11  +	exit 1
           12  +fi
           13  +
           14  +YAJLTCLVERS="1.5"
           15  +YAJLVERS='2.1.0'
           16  +SRC="src/yajltcl-${YAJLTCLVERS}.tar.gz"
           17  +YAJLSRC="src/yajl-${YAJLVERS}.tar.gz"
           18  +SRCURL="https://github.com/flightaware/yajl-tcl/archive/v${YAJLTCLVERS}.tar.gz"
           19  +YAJLSRCURL="http://github.com/lloyd/yajl/tarball/${YAJLVERS}"
           20  +BUILDDIR="$(pwd)/build/yajl-tcl-${YAJLTCLVERS}"
           21  +YAJLBUILDDIR="$(pwd)/build/lloyd-yajl-66cb08c"
           22  +OUTDIR="$(pwd)/out"
           23  +INSTDIR="$(pwd)/inst"
           24  +PATCHDIR="$(pwd)/patches"
           25  +export YAJLTCLVERS SRC SRCURL BUILDDIR OUTDIR INSTDIR PATCHDIR
           26  +
           27  +# Set configure options for this sub-project
           28  +LDFLAGS="${LDFLAGS} ${KC_YAJLTCL_LDFLAGS}"
           29  +CFLAGS="${CFLAGS} ${KC_YAJLTCL_CFLAGS}"
           30  +CPPFLAGS="${CPPFLAGS} ${KC_YAJLTCL_CPPFLAGS}"
           31  +LIBS="${LIBS} ${KC_YAJLTCL_LIBS}"
           32  +export LDFLAGS CFLAGS CPPFLAGS LIBS
           33  +
           34  +rm -rf 'build' 'out' 'inst'
           35  +mkdir 'build' 'out' 'inst' || exit 1
           36  +
           37  +if [ ! -d 'buildsrc' ]; then
           38  +	mkdir 'src' >/dev/null 2>/dev/null
           39  +
           40  +	if [ ! -f "${SRC}" ]; then
           41  +		rm -f "${SRC}.tmp"
           42  +		wget -O "${SRC}.tmp" "${SRCURL}" || exit 1
           43  +		mv "${SRC}.tmp" "${SRC}"
           44  +	fi
           45  +
           46  +	if [ ! -f "${YAJLSRC}" ]; then
           47  +		rm -f "${YAJLSRC}.tmp"
           48  +		wget -O "${YAJLSRC}.tmp" "${YAJLSRCURL}" || exit 1
           49  +		mv "${YAJLSRC}.tmp" "${YAJLSRC}"
           50  +	fi
           51  +fi
           52  +
           53  +(
           54  +	cd 'build' || exit 1
           55  +
           56  +	if [ ! -d '../buildsrc' ]; then
           57  +		gzip -dc "../${SRC}" | tar -xf -
           58  +		gzip -dc "../${YAJLSRC}" | tar -xf -
           59  +	else    
           60  +		cp -rp ../buildsrc/* './'
           61  +	fi
           62  +
           63  +	# Build YAJL
           64  +	(
           65  +		cd "${YAJLBUILDDIR}" || exit 1
           66  +		./configure -p "$(pwd)/INST" || exit 1
           67  +		make install || exit 1
           68  +		rm -f INST/lib/*.so*
           69  +		mv INST/lib/libyajl_s.a INST/lib/libyajl.a || exit 1
           70  +	) || exit 1
           71  +
           72  +	# Include YAJL's build in our pkg-config path
           73  +	PKG_CONFIG_PATH="${YAJLBUILDDIR}/INST/share/pkgconfig"
           74  +	YAJL_CFLAGS="-I${YAJLBUILDDIR}/INST/include -I${YAJLBUILDDIR}/INST/include/yajl"
           75  +	export PKG_CONFIG_PATH YAJL_CFLAGS
           76  +
           77  +	# Build YAJL-TCL
           78  +	cd "${BUILDDIR}" || exit 1
           79  +
           80  +	# YAJLTCL releases are incomplete -- they lack a configure script
           81  +	autoconf || exit 1
           82  +
           83  +	# Try to build as a shared object if requested
           84  +	if [ "${STATICYAJLTCL}" = "0" ]; then
           85  +		tryopts="--enable-shared --disable-shared"
           86  +	elif [ "${STATICYAJLTCL}" = "-1" ]; then
           87  +		tryopts="--enable-shared"
           88  +	else
           89  +		tryopts="--disable-shared"
           90  +	fi
           91  +
           92  +	SAVE_CFLAGS="${CFLAGS}"
           93  +	for tryopt in $tryopts __fail__; do
           94  +		if [ "${tryopt}" = "__fail__" ]; then
           95  +			exit 1
           96  +		fi
           97  +		# Clean up, if needed
           98  +		make distclean >/dev/null 2>/dev/null
           99  +		rm -rf "${INSTDIR}"
          100  +		mkdir "${INSTDIR}"
          101  +
          102  +		if [ "${tryopt}" == "--enable-shared" ]; then
          103  +			isshared="1"
          104  +		else
          105  +			isshared="0"
          106  +		fi
          107  +
          108  +		# If build a static YAJLTCL for KitDLL, ensure that we use PIC
          109  +		# so that it can be linked into the shared object
          110  +		if [ "${isshared}" = "0" -a "${KITTARGET}" = "kitdll" ]; then
          111  +			CFLAGS="${SAVE_CFLAGS} -fPIC"
          112  +		else
          113  +			CFLAGS="${SAVE_CFLAGS}"
          114  +		fi
          115  +		export CFLAGS
          116  +
          117  +		if [ "${isshared}" = '0' ]; then
          118  +			sed 's@USE_TCL_STUBS@XXX_TCL_STUBS@g' configure > configure.new
          119  +		else
          120  +			sed 's@XXX_TCL_STUBS@USE_TCL_STUBS@g' configure > configure.new
          121  +		fi
          122  +		cat configure.new > configure
          123  +		rm -f configure.new
          124  +
          125  +		(
          126  +			echo "Running: ./configure $tryopt --prefix=\"${INSTDIR}\" --exec-prefix=\"${INSTDIR}\" --libdir=\"${INSTDIR}/lib\" --with-tcl=\"${TCLCONFIGDIR}\" ${CONFIGUREEXTRA}"
          127  +			./configure $tryopt --prefix="${INSTDIR}" --exec-prefix="${INSTDIR}" --libdir="${INSTDIR}/lib" --with-tcl="${TCLCONFIGDIR}" ${CONFIGUREEXTRA}
          128  +
          129  +			echo "Running: ${MAKE:-make} tcllibdir=\"${INSTDIR}/lib\""
          130  +			${MAKE:-make} tcllibdir="${INSTDIR}/lib" || exit 1
          131  +
          132  +			echo "Running: ${MAKE:-make} tcllibdir=\"${INSTDIR}/lib\" install"
          133  +			${MAKE:-make} tcllibdir="${INSTDIR}/lib" install || exit 1
          134  +		) || continue
          135  +
          136  +		if [ "${isshared}" = '0' ]; then
          137  +			# Copy static libyajl to INSTDIR
          138  +			mkdir -p "${INSTDIR}/lib/deps"
          139  +			cp "${YAJLBUILDDIR}/INST/lib/libyajl.a" "${INSTDIR}/lib/zz-libyajl.a" || exit 1
          140  +		fi
          141  +
          142  +		break
          143  +	done
          144  +
          145  +	# Create pkgIndex if needed
          146  +	if [ ! -e "${INSTDIR}/lib/yajltcl${YAJLTCLVERS}/pkgIndex.tcl" ]; then
          147  +		cat << _EOF_ > "${INSTDIR}/lib/yajltcl${YAJLTCLVERS}/pkgIndex.tcl"
          148  +package ifneeded yajltcl ${YAJLTCLVERS} \
          149  +    "[list load {} yajltcl]; \
          150  +    [list source [file join \$dir yajl.tcl]]"
          151  +_EOF_
          152  +	fi
          153  +
          154  +	# Install files needed by installation
          155  +	cp -r "${INSTDIR}/lib" "${OUTDIR}" || exit 1
          156  +	find "${OUTDIR}" -name '*.a' -type f | xargs -n 1 rm -f --
          157  +
          158  +	exit 0
          159  +) || exit 1
          160  +
          161  +exit 0