Many hyperlinks are disabled.
Use anonymous login
to enable hyperlinks.
Overview
| Comment: | Updated practcl to 0.1.5 Eliminated the dependency on the fileutil module. Modified the build process to use a sandbox checkout of Tcl, Tk, and the core distributed packages sqlite and thread. Developed a new "fossil_sandbox" procedure to manage getting code out of fossil, and prepped for compilation. |
|---|---|
| Timelines: | family | ancestors | descendants | both | trunk |
| Files: | files | file ages | folders |
| SHA1: |
c220d36ad44d0758eb13d3d7b4ec9316 |
| User & Date: | hypnotoad 2016-03-04 15:19:48 |
Context
|
2016-03-04
| ||
| 16:48 | Worked out a mechanism to translate MSYS paths to tcl compadible paths, and thus accomdate tkimg check-in: e5abb0c87e user: hypnotoad tags: trunk | |
| 15:19 | Updated practcl to 0.1.5 Eliminated the dependency on the fileutil module. Modified the build process to use a sandbox checkout of Tcl, Tk, and the core distributed packages sqlite and thread. Developed a new "fossil_sandbox" procedure to manage getting code out of fossil, and prepped for compilation. check-in: c220d36ad4 user: hypnotoad tags: trunk | |
| 08:22 | Consolidated most of the build functions back to the practcl module check-in: 9978e472f1 user: hypnotoad tags: trunk | |
Changes
Changes to build.tcl.
| ︙ | ︙ | |||
8 9 10 11 12 13 14 | # BUILD THE INTERPRETER ENVIRONMENT # ######################################### set HERE [file dirname [file normalize [info script]]] set PWD [pwd] | < | | | | 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 |
# BUILD THE INTERPRETER ENVIRONMENT
#
#########################################
set HERE [file dirname [file normalize [info script]]]
set PWD [pwd]
package ifneeded practcl 0.1.5 [list source [file join $HERE .. odielib modules practcl practcl.tcl]]
package require practcl
#####
# Define procedures
#####
namespace eval ::practcl {}
proc ::COMPILE {which cfile {extras {}}} {
set objfile [file normalize [file join $::PWD build [file tail [file dirname $cfile]]_[file rootname [file tail $cfile]].o]]
lappend ::KIT(${which}_OBJS) $objfile
if {[file exists $objfile] && [file mtime $objfile] > [file mtime $cfile]} return
lappend cmd $::KIT(cc) {*}$::KIT(cflags_optimize) {*}$::KIT(shlib_cflags) {*}$::KIT(cflags_warning) {*}$::KIT(extra_cflags) {*}$::KIT(defs) {*}$extras
foreach path $::KIT(INCLUDES) {
lappend cmd -I./[::practcl::file_relative $::PWD $path]
}
lappend cmd {*}$::KIT(EXTRA_CFLAGS)
lappend cmd -c [::practcl::file_relative $::PWD $cfile] -o $objfile
puts [list [file tail $cfile] -> [file tail $objfile]]
puts $cmd
exec {*}$cmd >&@ stdout
}
proc ::practcl::wrap {PWD name vfspath args} {
cd $PWD
|
| ︙ | ︙ | |||
70 71 72 73 74 75 76 77 |
set _search_paths {{$PWD} {$PWD ..}}
if {![file exists [file join $::HERE odieConfig.tcl]]} {
# Build the local toolset
cd $HERE
exec [info nameofexecutable] [file join $HERE autosetup autosetup]
cd $PWD
}
source [file join $::HERE odieConfig.tcl]
| > > > > > > > > > > > > > > | | 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 |
set _search_paths {{$PWD} {$PWD ..}}
if {![file exists [file join $::HERE odieConfig.tcl]]} {
# Build the local toolset
cd $HERE
exec [info nameofexecutable] [file join $HERE autosetup autosetup]
cd $PWD
}
###
# Can *almost* get it working, but the broken installer
# leads to chaos under MinGW
#
# tkimg {tag trunk tk 1 broken_destroot 1}
###
set ::KIT(PACKAGES) {
thread {tag release}
sqlite {tag release}
udp {tag trunk}
canvas3d {tag trunk tk 1}
}
source [file join $::HERE odieConfig.tcl]
set ::KIT(platform) $::odie(platform)
set ::KIT(ORIG_TCL_SRC_DIR) $::odie_tcl(src_dir)
set ::KIT(ORIG_TK_SRC_DIR) $::odie_tk(src_dir)
set ::KIT(TCL_BUILD_OPTS) $::odie_tcl(config_flags)
set ::KIT(TK_BUILD_OPTS) $::odie_tk(config_flags)
set ::KIT(HOST) $::odie(host)
set ::KIT(TARGET) $::odie(target)
set ::KIT(TCL_VERSION) $::odie_tcl(version)
|
| ︙ | ︙ | |||
123 124 125 126 127 128 129 130 131 132 133 134 135 136 |
}
toadkit {
set build(toadkit) 1
}
basekit {
set build(toadkit) 1
}
wrap {
}
clean {
}
default {
error "Unknown command $COMMAND. Valid: clean tcl toadkit wrap"
| > > > | 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 |
}
toadkit {
set build(toadkit) 1
}
basekit {
set build(toadkit) 1
}
packages {
set build(packages) 1
}
wrap {
}
clean {
}
default {
error "Unknown command $COMMAND. Valid: clean tcl toadkit wrap"
|
| ︙ | ︙ | |||
150 151 152 153 154 155 156 157 158 159 160 161 162 163 |
foreach dpath $_search_paths {
set path [file normalize [file join {*}[subst $dpath] toadkit$::KIT(TCL_VERSION)$::KIT(TCL_PATCH_LEVEL)]]
set ::KIT(TCLSRCDIR) [file join $path tcl]
set ::KIT(TKSRCDIR) [file join $path tk]
set ::KIT(PKGROOT) [file join $path pkg]
set ::KIT(BASEVFS) [file join $path vfs]
if {[file exists $::KIT(TCLSRCDIR)]} {
break
}
}
###
| > > > | 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 |
foreach dpath $_search_paths {
set path [file normalize [file join {*}[subst $dpath] toadkit$::KIT(TCL_VERSION)$::KIT(TCL_PATCH_LEVEL)]]
set ::KIT(TCLSRCDIR) [file join $path tcl]
set ::KIT(TKSRCDIR) [file join $path tk]
set ::KIT(PKGROOT) [file join $path pkg]
set ::KIT(BASEVFS) [file join $path vfs]
set ::KIT(SANDBOX) [file join $path jni]
set ::KIT(DOWNLOAD) [file join $path download]
if {[file exists $::KIT(TCLSRCDIR)]} {
break
}
}
###
|
| ︙ | ︙ | |||
231 232 233 234 235 236 237 |
if {$build(tcl)} {
file mkdir build
file mkdir [file join $::KIT(BASEVFS) boot]
###
# Build a starter VFS for both Tcl and wish
###
| | < < < < | | < | < < < < | | | 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 |
if {$build(tcl)} {
file mkdir build
file mkdir [file join $::KIT(BASEVFS) boot]
###
# Build a starter VFS for both Tcl and wish
###
::practcl::fossil_sandbox tcl [list srcroot $::KIT(TCLSRCDIR) tag release]
if {$USEMSVC} {
puts "BUILDING Static Tcl $_TclSrcDir"
cd $_TclSrcDir
doexec nmake -f makefile.vc INSTALLDIR=$::KIT(PKGROOT) release
doexec nmake -f makefile.vc INSTALLDIR=$::KIT(PKGROOT) install
cd $PWD
} else {
if {![file exists $::TARGET(tclConfig.sh)]} {
puts "BUILDING Static Tcl $_TclSrcDir"
cd $_TclSrcDir
set opts {}
if {$::KIT(HOST) != $::KIT(TARGET)} {
lappend opts --host=$::KIT(TARGET)
}
lappend opts {*}$::KIT(TCL_BUILD_OPTS) --prefix=$::KIT(PKGPREFIX) --exec_prefix=$::KIT(PKGPREFIX) --with-tzdata --enable-shared=no
puts ***
puts "CONFIGURE {*}opts"
puts ***
doexec sh configure {*}$opts
domake binaries
cd $PWD
}
}
}
if {$build(tk)} {
set dat [::practcl::fossil_sandbox tk [list srcroot $::KIT(TKSRCDIR) tag release]]
if {$USEMSVC} {
cd $_TkSrcDir
puts "BUILD TK"
doexec nmake -f makefile.vc TCLDIR=[file nativename $::KIT(TKSRCDIR)] INSTALLDIR=$::KIT(PKGROOT) release
doexec nmake -f makefile.vc TCLDIR=[file nativename $::KIT(TKSRCDIR)] INSTALLDIR=$::KIT(PKGROOT) install
cd $PWD
} else {
if {![file exists $::TARGET(tkConfig.sh)]} {
puts "BUILD TK"
set opts {}
cd $_TkSrcDir
if {$::KIT(HOST) != $::KIT(TARGET)} {
|
| ︙ | ︙ | |||
450 451 452 453 454 455 456 |
}
if {$build(packages)} {
cd $PWD
if {[file exists $::KIT(PKGROOT)]} {
file delete -force $::KIT(PKGROOT)
}
| | > > | > | | > > > > > > | > > > > | 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 |
}
if {$build(packages)} {
cd $PWD
if {[file exists $::KIT(PKGROOT)]} {
file delete -force $::KIT(PKGROOT)
}
set fossilinfo [list download $::KIT(DOWNLOAD) sandbox $::KIT(SANDBOX)]
set tclconfiginfo [::practcl::fossil_sandbox tclconfig [dict merge $fossilinfo {}]]
set tclconfig_path [dict get $tclconfiginfo srcroot]
foreach {pkg info} $::KIT(PACKAGES) {
set pkginfo [::practcl::fossil_sandbox $pkg [dict merge $fossilinfo $info]]
set pkgpath [dict get $pkginfo srcroot]
puts [list BUILDING $pkg in $pkgpath]
cd $pkgpath
foreach m4file {tcl.m4 install-sh} {
if {![file exists [file join $pkgpath tclconfig $m4file]]} {
file mkdir [file join $pkgpath tclconfig]
file copy [file join $tclconfig_path $m4file] [file join $pkgpath tclconfig $m4file]
}
}
if {![file exists [file join $pkgpath Makefile]]} {
if {[file exists [file join $pkgpath Makefile.in]]} {
set opts [list --with-tcl=$_TclSrcDir --with-tclinclude=[file join $::KIT(TCLSRCDIR) generic] --with-tzdata --enable-shared --enable-threads]
if {[dict exists $info tk]} {
lappend opts --with-tk=$_TkSrcDir --with-tkinclude=[file join $::KIT(TKSRCDIR) generic]
}
doexec sh configure {*}$opts
} else {
continue
}
}
puts "INSTALLING to VFS [file tail $pkgpath]"
domake install DESTDIR=$::KIT(PKGROOT)
}
|
| ︙ | ︙ | |||
489 490 491 492 493 494 495 |
file delete -force $::KIT(BASEVFS)
}
puts "***
*** BASE KIT VFS PACKAGES
***"
puts [list COPY [file join $::KIT(PKGROOT) [string trimleft $::KIT(PKGPREFIX) /] lib]]
::practcl::copyDir [file join $::KIT(PKGROOT) [string trimleft $::KIT(PKGPREFIX) /] lib] [file join $::KIT(BASEVFS) pkgs]
| < | 512 513 514 515 516 517 518 519 520 521 522 523 524 525 |
file delete -force $::KIT(BASEVFS)
}
puts "***
*** BASE KIT VFS PACKAGES
***"
puts [list COPY [file join $::KIT(PKGROOT) [string trimleft $::KIT(PKGPREFIX) /] lib]]
::practcl::copyDir [file join $::KIT(PKGROOT) [string trimleft $::KIT(PKGPREFIX) /] lib] [file join $::KIT(BASEVFS) pkgs]
::practcl::copyDir [file join $::KIT(TCLSRCDIR) library] [file join $::KIT(BASEVFS) boot tcl]
if { $::KIT(platform) eq "windows" } {
set ddedll [glob -nocomplain [file join $_TclSrcDir tcldde*.dll]]
if {$ddedll != {}} {
file copy $ddedll [file join $::KIT(BASEVFS) boot tcl dde]
}
set regdll [glob -nocomplain [file join $_TclSrcDir tclreg*.dll]]
|
| ︙ | ︙ |
Changes to scripts/make_tcl.sh.
1 2 3 4 | #! /bin/bash source odieConfig.sh | | | | | | | | | | | | | < < < < < < < < < < < | | < < < < < < < < < < < < < < > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > | | | > > | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 |
#! /bin/bash
source odieConfig.sh
TCL_SRCPATH=${SANDBOX}/tcl/${ODIE_TCL_PLATFORM_DIR}
TK_SRCPATH=${SANDBOX}/tk/${ODIE_TCL_PLATFORM_DIR}
ODIE_SRCPATH=${SANDBOX}/odie
echo DOWNLOAD $DOWNLOAD
echo "Cloning Tcl/Tk Sources"
if [ ! -f "${DOWNLOAD}/tcl.fos" ]; then
${FOSSIL} clone ${ODIEMIRRORURL}/tcl ${DOWNLOAD}/tcl.fos
fi
if [ ! -f "${SANDBOX}/tcl/${FOSSIL_CHECKOUT}" ]; then
mkdir -p ${SANDBOX}/tcl
cd ${SANDBOX}/tcl
${FOSSIL} open ${DOWNLOAD}/tcl.fos
fi
echo "Building Local Tcl"
echo $ODIE_HOST
echo $ODIE_TARGET
cd ${SANDBOX}/tcl
${FOSSIL} update ${TCL_FOSSIL_BRANCH}
cd ${TCL_SRCPATH}
echo Build Dynamic Tcl
if [ "${ODIE_HOST}" != "${ODIE_TARGET}" ] ; then
sh ./configure --prefix=${LOCAL_REPO} --libdir=${LOCAL_REPO}/lib --with-tzdata --host=${ODIE_TARGET} ${TCL_CONFIG_FLAGS}
else
sh ./configure --prefix=${LOCAL_REPO} --libdir=${LOCAL_REPO}/lib --with-tzdata ${TCL_CONFIG_FLAGS}
fi
make clean
make binaries
make install
echo "Cloning TclConfig"
if [ ! -f "${DOWNLOAD}/tclconfig.fos" ]; then
${FOSSIL} clone ${ODIEMIRRORURL}/tclconfig ${DOWNLOAD}/tclconfig.fos
fi
if [ ! -f "${SANDBOX}/tclconfig/${FOSSIL_CHECKOUT}" ]; then
mkdir -p ${SANDBOX}/tclconfig
cd ${SANDBOX}/tclconfig
${FOSSIL} open ${DOWNLOAD}/tclconfig.fos
fi
cd ${SANDBOX}/tclconfig
${FOSSIL} update trunk
echo "Cloning Sqlite Sources"
if [ ! -f "${DOWNLOAD}/sqlite.fos" ]; then
${FOSSIL} clone ${ODIEMIRRORURL}/sqlite ${DOWNLOAD}/sqlite.fos
fi
if [ ! -f "${SANDBOX}/sqlite/${FOSSIL_CHECKOUT}" ]; then
mkdir -p ${SANDBOX}/sqlite
cd ${SANDBOX}/sqlite
${FOSSIL} open ${DOWNLOAD}/sqlite.fos
fi
if [ ! -f "${SANDBOX}/sqlite/tclconfig/tcl.m4" ]; then
cp -a ${SANDBOX}/tclconfig ${SANDBOX}/sqlite/tclconfig
fi
echo "Building Sqlite"
cd ${SANDBOX}/sqlite
${FOSSIL} update release
if [ "${ODIE_HOST}" != "${ODIE_TARGET}" ] ; then
sh ./configure --prefix=${LOCAL_REPO} --libdir=${LOCAL_REPO}/lib --with-tzdata --host=${ODIE_TARGET} ${TCL_CONFIG_FLAGS}
else
sh ./configure --prefix=${LOCAL_REPO} --libdir=${LOCAL_REPO}/lib --with-tzdata ${TCL_CONFIG_FLAGS}
fi
make clean
make binaries
make install
echo "Cloning Thread Sources"
if [ ! -f "${DOWNLOAD}/thread.fos" ]; then
${FOSSIL} clone ${ODIEMIRRORURL}/thread ${DOWNLOAD}/thread.fos
fi
if [ ! -f "${SANDBOX}/thread/${FOSSIL_CHECKOUT}" ]; then
mkdir -p ${SANDBOX}/thread
cd ${SANDBOX}/thread
${FOSSIL} open ${DOWNLOAD}/thread.fos
fi
if [ ! -f "${SANDBOX}/thread/tclconfig/tcl.m4" ]; then
cp -a ${SANDBOX}/tclconfig ${SANDBOX}/thread/tclconfig
fi
echo "Building Thread"
cd ${SANDBOX}/thread]
${FOSSIL} update release
if [ "${ODIE_HOST}" != "${ODIE_TARGET}" ] ; then
sh ./configure --prefix=${LOCAL_REPO} --libdir=${LOCAL_REPO}/lib --with-tzdata --host=${ODIE_TARGET} ${TCL_CONFIG_FLAGS}
else
sh ./configure --prefix=${LOCAL_REPO} --libdir=${LOCAL_REPO}/lib --with-tzdata ${TCL_CONFIG_FLAGS}
fi
make clean
make binaries
make install
if [ "${TK_FOSSIL_BRANCH}" != "none" ] ; then
TK_SRCPATH=${SANDBOX}/tk/${ODIE_TCL_PLATFORM_DIR}
if [ ! -f "${DOWNLOAD}/tk.fos" ] ; then
${FOSSIL} clone ${ODIEMIRRORURL}/tk ${DOWNLOAD}/tk.fos
fi
if [ ! -f "${SANDBOX}/tk/${FOSSIL_CHECKOUT}" ] ; then
mkdir -p ${SANDBOX}/tk
cd ${SANDBOX}/tk
${FOSSIL} open ${DOWNLOAD}/tk.fos ${TK_FOSSIL_BRANCH}
fi
echo "Building Local Tk"
cd ${SANDBOX}/tk
${FOSSIL} update ${TK_FOSSIL_BRANCH}
cd ${TK_SRCPATH}
echo Build Dynamic Tk
if [ "${ODIE_OS}" == "macosx" ] ; then
if [ "${ODIE_CONFIG_WINDOWSYSTEM}" == "x11" ] ; then
export CPPFLAGS=-I/opt/X11/include
fi
fi
if [ "${ODIE_HOST}" != "${ODIE_TARGET}" ] ; then
sh ./configure --prefix=${LOCAL_REPO} --libdir=${LOCAL_REPO}/lib --host=${ODIE_TARGET} ${TK_CONFIG_FLAGS}
else
sh ./configure --prefix=${LOCAL_REPO} --libdir=${LOCAL_REPO}/lib ${TK_CONFIG_FLAGS}
fi
make clean
make binaries
make install
fi
###
# Re-run our configure to learn new things from Tcl
###
cd ${ODIE_SRCPATH}
make reconfig
|