Re: makefile for compiling ready-made tcl callable C source

From: Arjen Markus (arjen.markus_at_wldelft.nl)
Date: 03/26/04

  • Next message: Jan Vlcek: "Re: tclbench"
    Date: Fri, 26 Mar 2004 08:48:11 +0100
    
    

    John Douglas wrote:
    >
    > Can somebody direct me to a clear and simple 'barebones' example of how to
    > compile C code so its callable from tcl/tk? Preferably a makefile for
    > Borland on Windows. (I've combed through the wiki, SWIG, and archives of
    > this newsgroup and I've learned a lot about how to prepare and/or generate
    > the C source code to do this; but little is written on the compilation
    > part.) I have not been able to translate the various Makefiles into one
    > for use with Borland.
    >
    > Additionally, is it perhaps possible to do this with an older compiler that
    > is Dos based rather than windows based?
    >
    > Thanks,
    > Doug

    Have you had a look at TEA (Tcl Extension Architecture)?

    It is explained in detail in Brent Welch's book (at least from the third
    edition
    onwards).

    If you are merely targetting a single platform (the Borland C compiler
    on Windows),
    then why not do the following:
    - Define a project (AFAIU, Borland C comes with one of those IDEs - I am
    not overly
      fond of them in general and I will not comment on some of their
    properties as this
      is a very polite newsgroup - but they can be useful at times) that
    will build
      a DLL from your source code.
    - Add the following options:
      - The path to your Tcl include files
      - The macro USE_TCL_STUBS (if you use stubs, which I can recommend
    heartily!)
      - The path to your Tcl libraries (especially the stubs library) in the
    linkstep

    With this you should be able to get it a-going.

    (For my Tcl-Fortran combination - Fortran programs calling Tcl
    procedures -
    I have used a simple makefile like:

    TCL_INCLUDE = ...../markus/tcl/include
    TCL_LIB = ...../markus/tcl/lib
    calc : calc.o ftcl_c.o ftcl_mod.o
            f90 -o calc calc.o ftcl_c.o ftcl_mod.o -L$(TCL_LIB) -ltcl8.3

    ftcl_mod.o : ftcl_mod.f90
            f90 -c ftcl_mod.f90

    calc.o : calc.f90 ftcl_mod.o
            f90 -c calc.f90

    ftcl_c.o : ftcl_c.c ftcl.h
            cc -c ftcl_c.c -I$(TCL_INCLUDE)
     

    But that of course works the other way around ... and on Linux ...
    and does not do stubs. Oh and it is an old example, viz. 8.3 instead of
    8.4)

    Regards,

    Arjen


  • Next message: Jan Vlcek: "Re: tclbench"

    Relevant Pages

    • Re: Tcl no longer supports Borland Free C++ Compiler?
      ... I knew you'd been doing the work on compiling Tcl ... >source with Borland Tools. ... > and more and more extensions ... >support only M$ compiler in Win32 platform. ...
      (comp.lang.tcl)
    • Re: article: "Borland going after services revenue"
      ... >> Win64 compiler, updates to the linux compiler, I would wish they had more ... >> resources working on this. ... > I am not going to be so silly as to predict what Borland will or can do in ... entire ALM/SDO stack from Borland, or the Atlantic stack from Rational, or ...
      (borland.public.delphi.non-technical)
    • Re: Death of Kylix and migrating towards Java
      ... But it can't beat Delphi's compiler speed! ... app developers on non-Windows platforms. ... It is NOT Delphi. ... > I do agree that Kylix was a very good promise and concept, that Borland ...
      (borland.public.delphi.non-technical)
    • Delphi - does catastrophe loom ? (long)
      ... I've been buying and using Delphi since Turbo Pascal 5, and think that it is the ... However, I am beginning to think that Borland has made a major mistake going down the .NET path, and that Microsoft will be the beneficiary. ... however, when a 64-bit compiler was first mentioned at Borcon 2002 in Australia, it was targetted solely at Itanium. ... What Borland Marketing does not seem to comprehend is that while the market for an IA-64 compiler was probably several tens or even hundred of units, the market for an AMD64 compiler is in the range 10^4-10^5 units. ...
      (borland.public.delphi.non-technical)
    • Re: AJAX for Tcl web servers, like tclhttpd or wub
      ... The compiler runs as a Java servlet, ... maniplate those within TCL with easy to learn syntax. ... the plugin outputs JaveScript and has direct access to ... Lots and lots of responces and ideas are always welcome. ...
      (comp.lang.tcl)