# TCL configuration script
. `echo '
proc tclConfigFile {} {
    global auto_path

    set d [info library]
    set dirs ""

    foreach d $auto_path {
        lappend dirs $d
        set f [file join $d "tclConfig.sh"]
        set f2 [file join $d lib "tclConfig.sh"]
        if {[file exists $f]} {return $f}
        if {[file exists $f2]} {return $f2}
    }

    for {set i 0} {$i < 4} {incr i} {
        lappend dirs $d
        lappend dirs [file join $d lib]
        set f [file join $d "tclConfig.sh"]
        set f2 [file join $d lib "tclConfig.sh"]
        if {[file exists $f]} {return $f}
        if {[file exists $f2]} {return $f2}
        set d [file dirname $d]
    }

    return "/usr/lib/tclConfig.sh"
}

puts [tclConfigFile]
' | tclsh`

MODULE_SOURCES="
    tcl.cpp
    commands.cpp
    events.cpp
    tclconsole.cpp
    tcllineedit.cpp
    tcltextedit.cpp
    tclmisc.cpp
    tclstring.cpp
    tclloaddialog.cpp
    tcllistbox.cpp
    tcltimer.cpp
"

MODULE_MOC_HEADERS="
    tcl_scripting.h
    events.h
    tclconsole.h
    tcllineedit.h
    tclloaddialog.h
    tcllistbox.h
    tcltimer.h
"

MODULE_LDFLAGS="$TCL_LIB_SPEC"
MODULE_CXXFLAGS="$TCL_INCLUDE_SPEC"
MODULE_MAKE_CMD="data/docs/makedocs.tcl"
MODULE_CONFIGURE_CMD="echo 'if {\$tcl_version < 8.4} {puts \"TCL version is too old! It is \$tcl_version and required is at least 8.4.\"; exit 1} else {puts \"TCL version is \$tcl_version. OK!\"; exit 0}' | tclsh"
