Re: [fossil-users] TH_ERROR Can't find a usable init.tcl

2014-09-01 Thread Jan Nijtmans
2014-09-01 7:58 GMT+02:00 Petr Ferdus petr...@centrum.cz:
 I try to compile fossil with FOSSIL_ENABLE_TCL support. Build environment is 
 mingw/msys on XP sp3.
 Build is based on fossil 75dcdd0bdb. If I build my version without TCL 
 support it works nicely.

 When I turn TCL related switches on (FOSSIL_ENABLE_TH1_HOOKS=1 
 FOSSIL_ENABLE_TCL=1; FOSSIL_TCL_SOURCE = 1 is defined)
 it builds fossil.exe but TCL support seems to be somewhat broken. It reports 
 error TH_ERROR: Tcl initialization error: Can't find a usable init.tcl ...
 on fossil version -v command, please see details bellow.

Whenever I build fossil with Tcl support, I always
use FOSSIL_ENABLE_TCL=1, FOSSIL_ENABLE_TCL_STUBS = 1,
FOSSIL_ENABLE_TCL_PRIVATE_STUBS = 1.

This is the easiest way to include Tcl support
in fossil. Then you don't need the Tcl sources
to be available, just install the (ActiveState)
build of Tcl (either 8.5.x or 8.6.x) and you are done.

Regards,
Jan Nijtmans
___
fossil-users mailing list
fossil-users@lists.fossil-scm.org
http://lists.fossil-scm.org:8080/cgi-bin/mailman/listinfo/fossil-users


Re: [fossil-users] TH_ERROR Can't find a usable init.tcl

2014-09-01 Thread Petr Ferdus
Jan Nijtmans jan.nijtm...@gmail.com
Whenever I build fossil with Tcl support, I always
use FOSSIL_ENABLE_TCL=1, FOSSIL_ENABLE_TCL_STUBS = 1,
FOSSIL_ENABLE_TCL_PRIVATE_STUBS = 1.

Hello Jan,

thank you for the tip. 
I would much prefer static solution, which would be more in fossil way of one 
single executable without external dependencies (single stand-alone executable 
that contains everything).
Is it with FOSSIL_TCL_SOURCE even possible?

Thanks

Peter
___
fossil-users mailing list
fossil-users@lists.fossil-scm.org
http://lists.fossil-scm.org:8080/cgi-bin/mailman/listinfo/fossil-users


Re: [fossil-users] TH_ERROR Can't find a usable init.tcl

2014-09-01 Thread Petr Ferdus
Datum: 01.09.2014 13:10 Od: Jan Nijtmans jan.nijtm...@gmail.com
No, FOSSIL_TCL_SOURCE means that fossil
expects Tcl to be installed in the indicated directory.
libtcl8.x.a will be included statically inside fossil,
but the other files (such as init.tcl) will not be
part of fossil. To me it is not usefull at all to
include the static Tcl library in fossil but not
the Tcl start-up code, except when running
fossil inside a chroot-jail (which cannot
be done on Windows anyway)

Does it mean, that to build chrooted version of fossil one must omit 
FOSSIL_TCL_SOURCE
(that would be my misundestandin)?
With unix build, will chrooted version containg TCL start-up code? (I can't 
test it)
Should not the same happen for windows build? 
I would like to try it later this evening. 

Thanks
Peter
___
fossil-users mailing list
fossil-users@lists.fossil-scm.org
http://lists.fossil-scm.org:8080/cgi-bin/mailman/listinfo/fossil-users


Re: [fossil-users] TH_ERROR Can't find a usable init.tcl

2014-09-01 Thread Joe Mistachkin

Petr Ferdus wrote:

 Does it mean, that to build chrooted version of fossil one must
 omit FOSSIL_TCL_SOURCE (that would be my misundestandin)?
 With unix build, will chrooted version containg TCL start-up code?
 (I can't test it)
 Should not the same happen for windows build? 
 I would like to try it later this evening.  
 

No.  There are three primary concerns in order to build Fossil with Tcl
integration enabled and make use of it at runtime:

1. Locating the necessary Tcl header file(s) at compile-time.

Currently, this is handled several different ways, depending on the
platform.  On Unix-like systems, it is handled via searching for an
installed Tcl and using those header files.  This behavior can be
overridden via the configure script; however, I have not needed to
do this for my non-Windows uses of Fossil.

2. Locating the necessary Tcl library file(s) at compile-time.

This is handled largely the same as #1.  The configure script (really
autosetup) should be capable of automatically locating the necessary
library on most Unix-like systems.

3. Locating the necessary Tcl library at runtime (which must be
   installed in order to locate its init.tcl, more on this
   later).

When Fossil is compiled with stubs-enabled, it will attempt to
dynamically load the Tcl library (i.e. via dlopen) and then call
the necessary exported functions to get everything going; otherwise,
it will just use the exported functions it was linked against.
Either way, the instance of Tcl being used needs to be able to locate
its script library (e.g. init.tcl).  Typically, this means it must
be installed via make install or similar mechanism so that all
the files are located in the right places.

Here is the sequence of commands that I use to compile and install
Fossil on Unix-like systems with a locally installed Tcl enabled:

##
# PHASE 1: Download and install Tcl 8.6.1.
##

mv tcl tcl.old
wget http://prdownloads.sourceforge.net/tcl/tcl8.6.1-src.tar.gz
tar -zxvf tcl8.6.1-src.tar.gz
cd tcl8.6.1/unix
./configure --prefix=/home/yourusername/tcl
make all
make install

##
# PHASE 2: Download and install TclLib 1.15 (optional).
##

wget http://prdownloads.sourceforge.net/tcllib/tcllib-1.15.tar.gz
tar -zxvf tcllib-1.15.tar.gz
cd tcllib-1.15
export LD_LIBRARY_PATH=/home/yourusername/tcl/lib
/home/yourusername/tcl/bin/tclsh8.6 installer.tcl

##
# PHASE 3: Download and install Fossil.
##

wget --no-check-certificate --output-document=Fossil-trunk.tar.gz
https://www.fossil-scm.org/index.html/tarball/Fossil-trunk.tar.gz?name=trunk
tar -zxvf Fossil-trunk.tar.gz
cd trunk
./configure --with-zlib=/home/yourusername/trunk/compat/zlib
--with-openssl=auto --with-tcl=/home/yourusername/tcl --with-th1-hooks=1
--json=1
make
cp fossil /home/yourusername/bin/fossil

##
# PHASE 4: Setup integration with web server (Apache).
##

In the .htaccess file, you'll most likely need the following two lines:

SetEnv LD_LIBRARY_PATH /home/yourusername/tcl/lib
SetEnv HOME /home/yourusername

--
Joe Mistachkin

___
fossil-users mailing list
fossil-users@lists.fossil-scm.org
http://lists.fossil-scm.org:8080/cgi-bin/mailman/listinfo/fossil-users


Re: [fossil-users] TH_ERROR Can't find a usable init.tcl

2014-09-01 Thread Petr Ferdus
Joe Mistachkin sql...@mistachkin.com
No.  There are three primary concerns in order to build Fossil with Tcl
integration enabled and make use of it at runtime:

1. Locating the necessary Tcl header file(s) at compile-time.

Currently, this is handled several different ways, depending on the
platform.  On Unix-like systems, it is handled via searching for an
installed Tcl and using those header files.  This behavior can be
overridden via the configure script; however, I have not needed to
do this for my non-Windows uses of Fossil.

2. Locating the necessary Tcl library file(s) at compile-time.

This is handled largely the same as #1.  The configure script (really
autosetup) should be capable of automatically locating the necessary
library on most Unix-like systems.

3. Locating the necessary Tcl library at runtime (which must be
   installed in order to locate its init.tcl, more on this
   later).

When Fossil is compiled with stubs-enabled, it will attempt to
dynamically load the Tcl library (i.e. via dlopen) and then call
the necessary exported functions to get everything going; otherwise,
it will just use the exported functions it was linked against.
Either way, the instance of Tcl being used needs to be able to locate
its script library (e.g. init.tcl).  Typically, this means it must
be installed via make install or similar mechanism so that all
the files are located in the right places.

Here is the sequence of commands that I use to compile and install
Fossil on Unix-like systems with a locally installed Tcl enabled:

##
# PHASE 1: Download and install Tcl 8.6.1.
##

mv tcl tcl.old
wget http://prdownloads.sourceforge.net/tcl/tcl8.6.1-src.tar.gz
tar -zxvf tcl8.6.1-src.tar.gz
cd tcl8.6.1/unix
./configure --prefix=/home/yourusername/tcl
make all
make install

##
# PHASE 2: Download and install TclLib 1.15 (optional).
##

wget http://prdownloads.sourceforge.net/tcllib/tcllib-1.15.tar.gz
tar -zxvf tcllib-1.15.tar.gz
cd tcllib-1.15
export LD_LIBRARY_PATH=/home/yourusername/tcl/lib
/home/yourusername/tcl/bin/tclsh8.6 installer.tcl

##
# PHASE 3: Download and install Fossil.
##

wget --no-check-certificate --output-document=Fossil-trunk.tar.gz
https://www.fossil-scm.org/index.html/tarball/Fossil-trunk.tar.gz?name=trunk
tar -zxvf Fossil-trunk.tar.gz
cd trunk
./configure --with-zlib=/home/yourusername/trunk/compat/zlib
--with-openssl=auto --with-tcl=/home/yourusername/tcl --with-th1-hooks=1
--json=1
make
cp fossil /home/yourusername/bin/fossil

##
# PHASE 4: Setup integration with web server (Apache).
##

In the .htaccess file, you'll most likely need the following two lines:

SetEnv LD_LIBRARY_PATH /home/yourusername/tcl/lib
SetEnv HOME /home/yourusername


Thank you Joe for clarifications and your Unix-like system setup recipe. I'll 
try to absorb it and use it.
Meanwhile it seem that my simple idea of  fossil on windows with embedded tcl 
as a single exe
is not that easy as it seems. I have found notes from drh dated 2005 [1]. Still 
I thing it would be 
hugely useful as personal portable fossil with scripting included.

Thank again

Peter

[1] - Init Scripts In The DLL
http://wiki.tcl.tk/4156
___
fossil-users mailing list
fossil-users@lists.fossil-scm.org
http://lists.fossil-scm.org:8080/cgi-bin/mailman/listinfo/fossil-users


Re: [fossil-users] TH_ERROR Can't find a usable init.tcl

2014-09-01 Thread Joe Mistachkin

Petr Ferdus wrote:

 Thank you Joe for clarifications and your Unix-like system setup recipe.
 I'll try to absorb it and use it.
 Meanwhile it seem that my simple idea of  fossil on windows with embedded
 tcl as a single exe
 is not that easy as it seems. I have found notes from drh dated 2005 [1].
 Still I thing it would be 
 hugely useful as personal portable fossil with scripting included. 
 

At a bare minimum, two files would be needed on Windows: The Fossil EXE
itself
and a suitable Tcl library.  Since the Tcl library would need to include an
embedded script library, it will most likely need to be a TclKit DLL, e.g.
one of Roy Keene's daily builds:

http://www.rkeene.org/devel/kitcreator/kitbuild/nightly/

In order to use one of these TclKit DLLs, you would want to rename it to
tcl8X.dll where X is 4, 5, or 6.  Then, place it into the same directory
as
the Fossil EXE.

--
Joe Mistachkin

___
fossil-users mailing list
fossil-users@lists.fossil-scm.org
http://lists.fossil-scm.org:8080/cgi-bin/mailman/listinfo/fossil-users


[fossil-users] TH_ERROR Can't find a usable init.tcl

2014-08-31 Thread Petr Ferdus
I try to compile fossil with FOSSIL_ENABLE_TCL support. Build environment is 
mingw/msys on XP sp3. 
Build is based on fossil 75dcdd0bdb. If I build my version without TCL support 
it works nicely. 

When I turn TCL related switches on (FOSSIL_ENABLE_TH1_HOOKS=1 
FOSSIL_ENABLE_TCL=1; FOSSIL_TCL_SOURCE = 1 is defined)
it builds fossil.exe but TCL support seems to be somewhat broken. It reports 
error TH_ERROR: Tcl initialization error: Can't find a usable init.tcl ...  
on fossil version -v command, please see details bellow.

I used tcl862-src.zip from 
http://cznic.dl.sourceforge.net/project/tcl/Tcl/8.6.2/tcl862-src.zip
which was copied to fossil's compat directory.
In compat directory I tried both ways 
  - overwrite fossil compat files with files from tcl862-src.zip or
  - overwrite tcl862-src.zip files with fossil's compat files
The resulting exe always reported TH_ERROR: Tcl initialization error: Can't 
find a usable init.tcl ... error.

With TCL sources I did just 
./configure --enable-shared=no
make

What I might overlook? Could you recommend how to troubleshoot/fix this?

Thanks

Peter

--fossil extended version information
fossil.exe ver -v
This is fossil version 1.30 [cc4bac1221] 2014-08-31 23:04:30 UTC
Compiled on Sep  1 2014 07:03:02 using mingw32-3.20-gcc-4.8.1 (32-bit)
SQLite 3.8.6 2014-08-15 11:46:33 9491ba7d73
Schema version 2011-04-25 19:50
zlib 1.2.8, loaded 1.2.8
SSL (OpenSSL 1.0.0e 6 Sep 2011)
TH1_HOOKS
TCL (Tcl 8.6.0, loaded TH_ERROR: Tcl initialization error: Can't find a usable 
init.tcl in the following directories:
c:/soft/msys/home/user/lib/tcl8.6 c:/soft/msys/home/user/lib/tcl8.6 
c:/soft/msys/home/lib/tcl8.6 c:/soft/msys/home/user/library 
c:/soft/msys/home/lib
rary c:/soft/msys/home/tcl8.6.0/library c:/soft/msys/tcl8.6.0/library



This probably means that Tcl wasn't installed properly.
)
JSON (API 20120713)


-- switches
DBROKEN_MINGW_CMDLINE=1 -DFOSSIL_ENABLE_SSL=1 -DFOSSIL_ENABLE_TH1_HOOKS=1 
-DFOSSIL_ENABLE_TCL=1 -DSTATIC_BUILD -DFOSSIL_ENABLE_JSON=1 
-DSQLITE_ENABLE_FTS3=1 -DSQLITE_ENABLE_FTS3_PARENTHESIS=1
___
fossil-users mailing list
fossil-users@lists.fossil-scm.org
http://lists.fossil-scm.org:8080/cgi-bin/mailman/listinfo/fossil-users