Index: .fossil-settings/ignore-glob
==================================================================
--- .fossil-settings/ignore-glob
+++ .fossil-settings/ignore-glob
@@ -8,7 +8,6 @@
 config.status
 configure
 install-sh
 Makefile
 pkgIndex.tcl
-pkgIndex.tcl.tmpl
 tcc/*

Index: Makefile.in
==================================================================
--- Makefile.in
+++ Makefile.in
@@ -40,13 +40,10 @@
 	cp tcc/libtcc.a tcltcc-static.new.a
 	$(AR) rcu tcltcc-static.new.a tcltcc.o
 	-$(RANLIB) tcltcc-static.new.a
 	mv tcltcc-static.new.a tcltcc-static.a
 
-pkgIndex.tcl: pkgIndex.tcl.tmpl
-	if [ "${TARGETS}" = 'tcltcc-static.a' ]; then awk '/^STATIC:/{ $$1 = ""; print }'; else awk '/^SHARED:/{ $$1 = ""; print }'; fi < pkgIndex.tcl.tmpl | sed 's@^ @@' > pkgIndex.tcl
-
 install: $(TARGETS) pkgIndex.tcl tcc/libtcc1.a
 	$(INSTALL) -d "$(DESTDIR)$(PACKAGE_INSTALL_DIR)"
 	$(INSTALL) -m 0755 $(TARGETS) "$(DESTDIR)$(PACKAGE_INSTALL_DIR)"
 	$(INSTALL) -m 0644 pkgIndex.tcl "$(DESTDIR)$(PACKAGE_INSTALL_DIR)"
 	$(INSTALL) -m 0644 tcc/libtcc1.a "$(DESTDIR)$(PACKAGE_INSTALL_DIR)"
@@ -58,11 +55,11 @@
 	-$(MAKE) -C tcc clean
 
 distclean: clean
 	rm -rf autom4te.cache
 	rm -f config.log config.status
-	rm -f pkgIndex.tcl pkgIndex.tcl.tmpl
+	rm -f pkgIndex.tcl
 	rm -f Makefile
 	-$(MAKE) -C tcc distclean
 
 mrproper: distclean
 	rm -rf __TMP__

Index: configure.ac
==================================================================
--- configure.ac
+++ configure.ac
@@ -39,6 +39,6 @@
 
 dnl Perform Tcl Extension required stuff
 TCLEXT_INIT
 
 dnl Produce output
-AC_OUTPUT(Makefile pkgIndex.tcl.tmpl)
+AC_OUTPUT(Makefile pkgIndex.tcl)

ADDED   pkgIndex.tcl.in
Index: pkgIndex.tcl.in
==================================================================
--- /dev/null
+++ pkgIndex.tcl.in
@@ -0,0 +1,1 @@
+package ifneeded tcc4tcl @PACKAGE_VERSION@ [list source [file join $dir tcc.tcl]]

DELETED pkgIndex.tcl.tmpl.in
Index: pkgIndex.tcl.tmpl.in
==================================================================
--- pkgIndex.tcl.tmpl.in
+++ /dev/null
@@ -1,2 +0,0 @@
-STATIC: package ifneeded tcc4tcl @PACKAGE_VERSION@ [list source [file join $dir tcc.tcl]]
-SHARED: package ifneeded tcc4tcl @PACKAGE_VERSION@ [list load [file join $dir tcc4tcl.@SHOBJEXT@]]\;\ [list source [file join $dir tcc.tcl]]

Index: tcc.tcl
==================================================================
--- tcc.tcl
+++ tcc.tcl
@@ -11,15 +11,11 @@
    set dir [file dirname [info script]]
    if {[info command ::tcc] == ""} {
       catch { load {} tcc }
    }
    if {[info command ::tcc] == ""} {
-       switch -exact -- $::tcl_platform(platform) {
-	       windows { load $dir/tcc04.dll tcc }
-	       unix { load $dir/libtcc0.4.so tcc }
-	       default {error "unsupport platform"}
-       }
+       load [file join $dir tcctcl[info sharedlibextension]] tcc
    }
    set libs $dir/lib
    set includes $dir/include
    set count 0
    set command_count 0