Code Comments

Programming Forum and web based access to our favorite programming groups.
For Programmers: Free Programming Magazines | New: Database administration forum
Registration is free! Edit your profileCalendarFind other membersFrequently Asked QuestionsSearch -> 
Post New Thread











Thread
Author

Re: TEA - multiple packages and/or executables?
David N. Welton wrote:
>
>Is it possible, using TEA, to build multiple extensions from the same
>sources?

Yes, but you have to set things up differently than
how the sampleextension Makefile does it.  The main
thing is to not use TEA_MAKE_LIB, which is hardcoded
to generate a single shared library per project.

There are some extra M4 macros that make things a little
easier; see tclconfig/teax.m4 and generic/Makefile.in from
the tile CVS repository:

http://cvs.sourceforge.net/viewcvs.py/tktable/tile/

TEAX_CONFIG_LDFLAGS is the main one.  Then you can use
rules in the Makefile like this:

PKG1_LIB_FILE = pkg1$(SHLIB_SUFFIX)
PKG1_OBJECTS = pkg1Init.$(OBJEXT) ...

PKG2_LIB_FILE = pkg2$(SHLIB_SUFFIX)
PKG2_OBJECTS = ...
..

$(PKG1_LIB_FILE): $(PKG1_OBJECTS)
$(SHLIB_LD) @SHLIB_LD_OUT@$@ $(PKG1_OBJECTS) $(PKG_LIBRARIES)
$(PKG1_LIB_FILE): $(PKG1_OBJECTS)
$(SHLIB_LD) @SHLIB_LD_OUT@$@ $(PKG1_OBJECTS) $(PKG_LIBRARIES)


(Note: teax.m4 is still a work in progress.  I keep discovering
new quirks and hacks in tcl.m4 that I haven't untangled yet.
In particular, it doesn't get TCL_STUB_LIB_SPEC right if you're
building with MSVC, and there are probably more traps lurking.
But, it Works For Me (tm)).

>Also - is it possible to build executables?

It's been a long time since I tried this, but my guess: no.

Actually that's not entirely true.  You can use the normal
autoconf+make conventions to build executables, it's just that
if you need to link with the Tcl library (as opposed to the
Tcl stub library), then TEA doesn't really give you any help.


>Oddly enough I think I could do this with automake, but would like to
>stick to TEA if possible.

As long as "configure ; make ; make install" generates a
package that can successfully be "package require"d, then
it's TEA compliant.


--Joe English

Report this thread to moderator Post Follow-up to this message
Old Post
Joe English
12-24-04 09:16 AM


Re: TEA - multiple packages and/or executables?
Joe English <@> writes:

> David N. Welton wrote:
 

> Yes, but you have to set things up differently than how the
> sampleextension Makefile does it.  The main thing is to not use
> TEA_MAKE_LIB, which is hardcoded to generate a single shared library
> per project.

Aha...

> There are some extra M4 macros that make things a little
> easier; see tclconfig/teax.m4 and generic/Makefile.in from
> the tile CVS repository:

[ ... good advice snipped ... ]
 

> It's been a long time since I tried this, but my guess: no.

> Actually that's not entirely true.  You can use the normal
> autoconf+make conventions to build executables, it's just that if
> you need to link with the Tcl library (as opposed to the Tcl stub
> library), then TEA doesn't really give you any help.
 

> As long as "configure ; make ; make install" generates a package
> that can successfully be "package require"d, then it's TEA
> compliant.

I think it actually turns out to be a bit easier with automake:

lib_LTLIBRARIES = libcounter.la
bin_PROGRAMS = simple

libcounter_la_SOURCES = counter.c

libcounter_la_LDFLAGS = -no-undefined -module
libcounter_la_LIBADD = @TCL_LIBS@
libcounter_la_CPPFLAGS = @TCL_INCLUDES@ -DUSE_TCL_STUBS=1

simple_SOURCES = simple.c
simple_LDFLAGS = @TCL_LIB_SPEC@
simple_CPPFLAGS = @TCL_INCLUDES@

And a configure.ac file that does some substitutions so that you have
things like TCL_LIB_SPEC available.

One thing that's not perfect is the stubs bit.  You don't want that
for building an application, but you do want it for extensions...

Thanks,
--
David N. Welton
Personal:                   http://www.dedasys.com/davidw/
Apache Tcl:                 http://tcl.apache.org/
Free Software:              http://www.dedasys.com/freesoftware/
Linux Incompatibility List: http://www.leenooks.com/

Report this thread to moderator Post Follow-up to this message
Old Post
David N. Welton
12-24-04 02:06 PM


Sponsored Links




Last Thread Next Thread Next
Search this forum -> 
Post New Thread

Tcl archive

Show a Printable Version Send to friend Email This Page to Someone! subscribe to this thread Receive updates to this thread
Computer Consultants
Programming Jobs
Visual Basic Controls
SQL Server Programming
Webservices
Java Security
Visual Studio
C# Programming
Visual J++
Software engineering
Open source Software
Perl Programming
PHP Programming
ASP Programming
ASP .NET Programming
Visual Basic Programming
Windows Scripting Host
Java Programming
Java Help
Java Beans
VBScript
Cobol
MAC Applications
Unix Programming
Forum Jump:
All times are GMT. The time now is 08:30 AM.

 
Free MCSE Braindumps | Real Estate Topics

Programming forum archive

Copyrights CodeComments.com 2004 - 2006

Powered by vBulletin Copyright 2000-2006 Jelsoft Enterprises Limited.