How to: tcl7.5a1 and tk4.1a1 for Linux ELF

How to: tcl7.5a1 and tk4.1a1 for Linux ELF

Post by Mark Crimmi » Sat, 30 Sep 1995 04:00:00



How to compile tcl7.5 and tk4.1 for Linux ELF
---------------------------------------------

The stock tcl7.5a1 unix/configure script isn't set up for Linux ELF.
To fix that, you need to replace the linux shared library entry with
the following (look for "Linux*)" in the script):

    Linux*)
        SHLIB_CFLAGS="-fPIC"
        SHLIB_LD="gcc -shared"
        SHLIB_SUFFIX=".so"
        DL_OBJS="tclLoadDl.o"
        DL_LIBS="-ldl"
        LD_FLAGS=""
        ;;

Edit Makefile.in as follows:

1. Replace the line:  
        CFLAGS = -O
with
        CFLAGS = -O -fPIC

2. If you want to make a dynamically linked tcl shared library, and a
dynamically linked tclsh executable add the following after the "all:"
line:

libtcl7.5.so.1: ${OBJS}
        ${SHLIB_LD} -o libtcl7.5.so.1 ${OBJS}

tclsh-dynamic: ${TCLSH_OBJS} libtcl7.5.so.1
        ${CC} ${LD_FLAGS} ${TCLSH_OBJS} -L. -ltcl7.5 ${DL_LIBS} \
                ${LIBS} ${MATH_LIBS} -o tclsh-dynamic

Then run
     ./configure
     make tclsh-dynamic

Install tclsh-dynamic as tclsh7.5 in your binary directory, and install
libtcl7.5.so.1 in your library directory, and inform your loader about
it with:
   /sbin/ldconfig

To make tk4.1a1 (AFTER installing libtcl7.5.so.1): unpack it in the
same directory in which you've unpacked tcl7.5.  Edit Makefile.in as
follows:

1. Replace the line:

with:

2. Replace the line:  
        CFLAGS = -O
with
        CFLAGS = -O -fPIC

3. If you want to make a dynamic tk shared library, and a
dynamically-lined wish executable, add the following after the "all:"
line:

libtk4.1.so.1: ${OBJS}
        ${SHLIB_LD} -o libtk4.1.so.1 ${OBJS}

wish-dynamic: libtk4.1.so.1
        ${CC} ${LD_FLAGS} ${WISH_OBJS} -ltcl7.5 ${DL_LIBS} \
                ${LIBS} ${MATH_LIBS} -o wish-dynamic

Then run
     ./configure
     make wish-dynamic

Install wish-dynamic as wish4.1 in your binary directory, and install
libtk4.1.so.1 in your library directory, and inform the loader about
it with:
   /sbin/ldconfig

--

 
 
 

How to: tcl7.5a1 and tk4.1a1 for Linux ELF

Post by Carl D. Ro » Sat, 30 Sep 1995 04:00:00



Mark> How to compile tcl7.5 and tk4.1 for Linux ELF
Mark> ---------------------------------------------

Mark> The stock tcl7.5a1 unix/configure script isn't set up for Linux
Mark> ELF.  To fix that, you need to replace the linux shared library
Mark> entry with the following (look for "Linux*)" in the script) ...

There's one little thing you're missing, and that's the -rdynamic
option to let the shared objects reference symbols in the main
executable.  The revised patch for tcl7.5/unix/configure.in is
attached.

Overall, I'm really happy with the new dynamic loading capabilities.
I've been able to create demand-loaded modules so far for expect,
tcl-dp, tclX and MIT Otcl.  I'll never go back to a.out!

-- Carl


  configure.in.patch
1K Download


 
 
 

1. Compiling tcl7.4 and tk4.0 under LInux for ELF

Hello:

I'm compiling tcl 7.4 and tk 4.0 on Linux 1.3.59 here. They compile
just fine, yet when I try to compile the eggdrop 0.9r program it fails
with the following:

Which I'm told means that a library is compiled for a.out rather than
ELF. How can I get tcl.tk to compile for ELF and not a.out?? I need to
get an answer for this one, since we use eggdrop to maintain channels
on our irc server irc 2.8.21 - actually we also need to get the irc
server (ircd) compiled for linux as well...

Thanks,

===[George R. Kasica]===        +1 414 241 6745
Network Manager                 +1 414 241 6753 FAX
Preferred Emergency Physicians  Mequon, WI USA

2. ATI TV Wonder card under Debian 2.2?

3. tcl7.5, tk4.1, scotty-2.1.5, linux 2.0.22

4. My first kernel crash

5. Linux-Makefile shared [Tcl7.4/Tk4.0]b4 libs, used by tclsh+wish

6. ipchains with ipalias

7. Building Tcl7.4/Tk4.0 as shared libraries in Linux?

8. rpm packages in slack?which ones work?

9. Need help with Tcl7.6/Tk4.2, gcc, FORTRAN/C/C++ shared libraries (LONG)

10. When to get tcl7.6 and tk4.2 ?

11. problems compiling uudeview code with tcl7.5/tk4.1

12. tkgnuplot for tcl7.4/tk4.0/Tix4.0?

13. Tcl7.4/Tk4.0 extension a.out shared libraries