xref: /freebsd/contrib/sqlite3/autosetup/find_tclconfig.tcl (revision 17f0f75308f287efea825457364e2a4de2e107d4)
1*17f0f753SCy Schubert#
2*17f0f753SCy Schubert# Run this TCL script to find and print the pathname for the tclConfig.sh
3*17f0f753SCy Schubert# file.  Used by ../configure
4*17f0f753SCy Schubert#
5*17f0f753SCy Schubertif {[catch {
6*17f0f753SCy Schubert  set libdir [tcl::pkgconfig get libdir,install]
7*17f0f753SCy Schubert}]} {
8*17f0f753SCy Schubert  puts stderr "tclsh too old:  does not support tcl::pkgconfig"
9*17f0f753SCy Schubert  exit 1
10*17f0f753SCy Schubert}
11*17f0f753SCy Schubertif {![file exists $libdir]} {
12*17f0f753SCy Schubert  puts stderr "tclsh reported library directory \"$libdir\" does not exist"
13*17f0f753SCy Schubert  exit 1
14*17f0f753SCy Schubert}
15*17f0f753SCy Schubertif {![file exists $libdir/tclConfig.sh]} {
16*17f0f753SCy Schubert  set n1 $libdir/tcl$::tcl_version
17*17f0f753SCy Schubert  if {[file exists $n1/tclConfig.sh]} {
18*17f0f753SCy Schubert    set libdir $n1
19*17f0f753SCy Schubert  } else {
20*17f0f753SCy Schubert    puts stderr "cannot find tclConfig.sh in either $libdir or $n1"
21*17f0f753SCy Schubert    exit 1
22*17f0f753SCy Schubert  }
23*17f0f753SCy Schubert}
24*17f0f753SCy Schubertputs $libdir
25