Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

autotools with tcl

25 views
Skip to first unread message

Uwe Mayer

unread,
Nov 22, 2004, 6:27:56 AM11/22/04
to
Hi,

I'd like to use autotools with Tcl/Tk. The project also contains C code that
needs compling. Since automake does not support tcl, is the only possible
combination to program the Makefiles directly?

How does one specify default path's to system wide config files? i.e. during
development the config file is in the same directory as the tcl script.
Later it will be installed to /etc.
Hardcode "/etc/<prog>"? Or does one use AC_SUBST with @configure-variables@
on the source code?

Thanks for suggestions,
Ciao
Uwe
--

Bob Techentin

unread,
Nov 22, 2004, 4:23:02 PM11/22/04
to
"Uwe Mayer" <mer...@hadiko.de> wrote

> I'd like to use autotools with Tcl/Tk. The project also contains C
> code that needs compiling. Since automake does not support tcl, is

> the only possible combination to program the Makefiles directly?
>
> How does one specify default path's to system wide config files?
> i.e. during development the config file is in the same directory as
> the tcl script. Later it will be installed to /etc. Hardcode
> "/etc/<prog>"? Or does one use AC_SUBST with @configure-variables@
> on the source code?

Uwe,

I have successfully deployed applications using the autotools. But
you are correct when you say that automake doesn't support Tcl.
Automake seems to always want to use libtool, which has its own way of
creating shared libraries, and is incompatible with Tcl Stubs, at
least on Windows.

So for compiling Tcl extensions, I've had a lot of success copying the
TEA configuration and makefiles. I'm not sure how those would relate
to a system-wide config file. But you could probably use whatever
system-wide configure variables within the context of TEA.

Bob
--
Bob Techentin techenti...@NOSPAMmayo.edu
Mayo Foundation (507) 538-5495
200 First St. SW FAX (507) 284-9171
Rochester MN, 55901 USA http://www.mayo.edu/sppdg/

Uwe Mayer

unread,
Nov 25, 2004, 2:46:12 PM11/25/04
to
Monday 22 November 2004 22:23 pm Bob Techentin wrote:

> I have successfully deployed applications using the autotools. But
> you are correct when you say that automake doesn't support Tcl.
> Automake seems to always want to use libtool, which has its own way of
> creating shared libraries, and is incompatible with Tcl Stubs, at
> least on Windows.

Oh, I did not mean to use it in combination with Tcl extensions written in
C. I just wanted to use Automake for deploying and uninstalling my
software. Though there might be some autonomous C programs later on.

> So for compiling Tcl extensions, I've had a lot of success copying the
> TEA configuration and makefiles. I'm not sure how those would relate
> to a system-wide config file. But you could probably use whatever
> system-wide configure variables within the context of TEA.

Since Tcl is not supported I used the install-data-am hooks or used normal
Makefile target-dependency rules to "compile" and install my files.

The problem is that I want to be able to test-run the program without
having to install it. If I have my own packages I will have to adjust my
auto_path variable. To what value do I set it. During development phase its
in "./", after installing it, it might be almost any path. The only method
I can currently think of is to write an install-script which regex-scans
the input file and does path substitutions.
The input file may i.e. try to stat the path:

if {[file exists @tcl_libpath@]} {...}
else {lappend auto_path .}

otherwise to include a default path.

I just don't like the idea of using one script to set path values in
another.

Ciao
Uwe

Bob Techentin

unread,
Nov 29, 2004, 4:32:24 PM11/29/04
to
"Uwe Mayer" <mer...@hadiko.de> wrote

> The problem is that I want to be able to test-run the program
> without having to install it. If I have my own packages I will have
> to adjust my auto_path variable. To what value do I set it. During
> development phase its in "./", after installing it, it might be
> almost any path. The only method I can currently think of is to
> write an install-script which regex-scans the input file and does
> path substitutions. The input file may i.e. try to stat the path:
>
> if {[file exists @tcl_libpath@]} {...}
> else {lappend auto_path .}


I had the same problem, but I didn't try to solve it with automake.

You can check for installed or not-yet-installed in the main Tcl
script by looking for one of your packages. Then set the auto_path
accordingly.

set scriptDir [file dirname [info script]]
if { [file exists [file join $scriptDir myPkg pkgIndex.tcl]] } {
set auto_path [linsert $auto_path 0 $scriptDir]
} else {
set auto_path [linsert $auto_path 0 [file join $scriptDir ..
lib]]

0 new messages