Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 06 Feb 1998 12:03:41 +1030
From:      Mike Smith <mike@smith.net.au>
To:        Ruslan Shevchenko <Ruslan@Shevchenko.kiev.ua>
Cc:        config@FreeBSD.ORG, hackers@FreeBSD.ORG
Subject:   Re: TCL API published. 
Message-ID:  <199802060133.MAA01875@dingo.cdrom.com>
In-Reply-To: Your message of "Thu, 05 Feb 1998 00:41:54 %2B0200." <34D8EEB0.2AF4C769@Shevchenko.kiev.ua> 

next in thread | previous in thread | raw e-mail | index | archive | help
> 
> Anybody know, is dynamic library loading from Tcl in run-time work in
> FreeBSD ?

Yes.

> if work, how to do it, without  generation of Tcl Interpeter for each
> extension. ?

For an extension called "foo", export a single symbol from your library 
called "Foo_Init" (casing is important) which defines your new commands/
namespaces/etc.  Build a shared library using a Makefile, eg.

LIB=	foo
SRCS=	foo.c

SHLIB_MAJOR=	1
SHLIB_MINOR=	0

# No static library
INTERNALLIB=	yes

# No profiled library
NOPROFILE=	yes

.include <bsd.lib.mk>

Then load it with the 'load' command, or "package require".

-- 
\\  Sometimes you're ahead,       \\  Mike Smith
\\  sometimes you're behind.      \\  mike@smith.net.au
\\  The race is long, and in the  \\  msmith@freebsd.org
\\  end it's only with yourself.  \\ 





Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199802060133.MAA01875>