Skip to content

Commit

Permalink
initial commit of complete revamp of sample extension for easier buil…
Browse files Browse the repository at this point in the history
…ding

and improved TEA configuration.
  • Loading branch information
hobbs committed Mar 6, 2002
1 parent 5fb264e commit 7ba0dea
Show file tree
Hide file tree
Showing 15 changed files with 4,092 additions and 2,613 deletions.
19 changes: 19 additions & 0 deletions ChangeLog
Original file line number Diff line number Diff line change
@@ -1,3 +1,22 @@
2002-03-05 Jeff Hobbs <[email protected]>

* README:
* README.cygwin:
* Makefile.in:
* aclocal.m4:
* configure (new):
* configure.in:
* install-sh, mkinstalldirs, tcl.m4 (removed): complete revamp to
use the tclconfig updated TEA module

* exampleA.c, sample.c:
* exampleA.h, sample.h:
* tclexampleA.c, tclsample.c: s/exampleA/sample/g

2001-05-21 Jeff Hobbs <[email protected]>

* tcl.m4: 419812

2000-06-26 Mike Thomas <[email protected]>

* Makefile.in: Changed TCLTESTARGS to TESTFLAGS in test: target.
Expand Down
83 changes: 34 additions & 49 deletions Makefile.in
Original file line number Diff line number Diff line change
Expand Up @@ -7,32 +7,33 @@
# replaced in the actual Makefile.
#
# Copyright (c) 1999 Scriptics Corporation.
# Copyright (c) 2002 ActiveState SRL.
#
# See the file "license.terms" for information on usage and redistribution
# of this file, and for a DISCLAIMER OF ALL WARRANTIES.
#
# RCS: @(#) $Id: Makefile.in,v 1.26 2000/06/26 23:28:15 wart Exp $
# RCS: @(#) $Id: Makefile.in,v 1.27 2002/03/06 05:35:30 hobbs Exp $

#========================================================================
# Edit the following few lines when writing a new extension
#========================================================================

#========================================================================
# Change the name of the variable "exampleA_LIB_FILE" to match the one
# Change the name of the variable "sample_LIB_FILE" to match the one
# used in the configure script. This is the parameterized name of the
# library that we are building.
#========================================================================

lib_BINARIES=$(exampleA_LIB_FILE)
lib_BINARIES=$(sample_LIB_FILE)
BINARIES=$(lib_BINARIES)

#========================================================================
# Enumerate the names of the source files included in this package.
# This will be used when a dist target is added to the Makefile.
#========================================================================

exampleA_SOURCES = exampleA.c tclexampleA.c
SOURCES = $(exampleA_SOURCES)
sample_SOURCES = sample.c tclsample.c
SOURCES = $(sample_SOURCES)

#========================================================================
# Enumerate the names of the object files included in this package.
Expand All @@ -42,26 +43,26 @@ SOURCES = $(exampleA_SOURCES)
#
#========================================================================

exampleA_OBJECTS = exampleA.$(OBJEXT) tclexampleA.$(OBJEXT)
OBJECTS = $(exampleA_OBJECTS)
sample_OBJECTS = sample.$(OBJEXT) tclsample.$(OBJEXT)
OBJECTS = $(sample_OBJECTS)

#========================================================================
# The substitution of "exampleA_LIB_FILE" into the variable name below
# The substitution of "sample_LIB_FILE" into the variable name below
# allows us to refer to the objects for the library without knowing the name
# of the library in advance. It also lets us use the "$@" variable in
# the rule for building the library, so we can refer to both the list of
# objects and the library itself in a platform-independent manner.
#========================================================================

exampleA_LIB_FILE = @exampleA_LIB_FILE@
$(exampleA_LIB_FILE)_OBJECTS = $(exampleA_OBJECTS)
sample_LIB_FILE = @sample_LIB_FILE@
$(sample_LIB_FILE)_OBJECTS = $(sample_OBJECTS)

#========================================================================
# This is a list of header files to be installed
#========================================================================

GENERIC_HDRS= \
$(srcdir)/exampleA.h
$(srcdir)/sample.h

#========================================================================
# Add additional lines to handle any additional AC_SUBST cases that
Expand All @@ -79,28 +80,20 @@ SAMPLE_NEW_VAR=@SAMPLE_NEW_VAR@
SHELL = @SHELL@

srcdir = @srcdir@
top_srcdir = @top_srcdir@
prefix = @prefix@
exec_prefix = @exec_prefix@

bindir = @bindir@
sbindir = @sbindir@
libexecdir = @libexecdir@
datadir = @datadir@
sysconfdir = @sysconfdir@
sharedstatedir = @sharedstatedir@
localstatedir = @localstatedir@
libdir = @libdir@
infodir = @infodir@
datadir = @datadir@
mandir = @mandir@
includedir = @includedir@
oldincludedir = /usr/include

DESTDIR =

pkgdatadir = $(datadir)/@PACKAGE@@VERSION@
pkglibdir = $(libdir)/@PACKAGE@@VERSION@
pkgincludedir = $(includedir)/@PACKAGE@@VERSION@
pkgdatadir = $(datadir)/$(PACKAGE)$(VERSION)
pkglibdir = $(libdir)/$(PACKAGE)$(VERSION)
pkgincludedir = $(includedir)/$(PACKAGE)$(VERSION)

top_builddir = .

Expand Down Expand Up @@ -149,14 +142,6 @@ TCL_SRC_DIR = @TCL_SRC_DIR@
TCL_DBGX = @TCL_DBGX@
TCL_STUB_LIB_FILE = @TCL_STUB_LIB_FILE@
TCL_STUB_LIB_SPEC = @TCL_STUB_LIB_SPEC@
TCL_TOOL_DIR_NATIVE = @TCL_TOOL_DIR_NATIVE@
TCL_TOP_DIR_NATIVE = @TCL_TOP_DIR_NATIVE@
TCL_UNIX_DIR_NATIVE = @TCL_UNIX_DIR_NATIVE@
TCL_WIN_DIR_NATIVE = @TCL_WIN_DIR_NATIVE@
INCLUDE_DIR_NATIVE = @INCLUDE_DIR_NATIVE@
TCL_BMAP_DIR_NATIVE = @TCL_BMAP_DIR_NATIVE@
TCL_PLATFORM_DIR_NATIVE = @TCL_PLATFORM_DIR_NATIVE@
TCL_GENERIC_DIR_NATIVE = @TCL_GENERIC_DIR_NATIVE@
TCLSH_PROG = @TCLSH_PROG@
SHARED_BUILD = @SHARED_BUILD@

Expand All @@ -170,8 +155,8 @@ EXTRA_CFLAGS = $(TCL_DEFS) $(PROTO_FLAGS) $(SECURITY_FLAGS) $(MEM_DEBUG_FLAGS) $

DEFS = @DEFS@ $(EXTRA_CFLAGS)

ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
CONFIGDIR = $(top_srcdir)
ACLOCAL_M4 = $(srcdir)/aclocal.m4
CONFIGDIR = @CONFIGDIR@
mkinstalldirs = $(SHELL) $(CONFIGDIR)/mkinstalldirs
CONFIG_CLEAN_FILES = mkIndex.tcl

Expand Down Expand Up @@ -212,15 +197,15 @@ doc:
@echo "If you have documentation to create, place the commands to"
@echo "build the docs in the 'doc:' target. For example:"
@echo ""
@echo "xml2nroff exampleA.xml > exampleA.n"
@echo "xml2html exampleA.xml > exampleA.html"
@echo "xml2nroff sample.xml > sample.n"
@echo "xml2html sample.xml > sample.html"

install: all install-binaries install-libraries install-doc

install-binaries: binaries install-lib-binaries install-bin-binaries
$(TCLSH_PROG) mkIndex.tcl $(exampleA_LIB_FILE)
$(TCLSH_PROG) mkIndex.tcl $(sample_LIB_FILE)
if test "x$(SHARED_BUILD)" = "x1"; then \
$(TCLSH_PROG) mkIndex.tcl $(exampleA_LIB_FILE); \
$(TCLSH_PROG) mkIndex.tcl $(sample_LIB_FILE); \
fi

#========================================================================
Expand Down Expand Up @@ -254,7 +239,7 @@ install-doc: doc

test: binaries libraries
( echo \
pkg_mkIndex . $(exampleA_LIB_FILE) \;\
pkg_mkIndex . $(sample_LIB_FILE) \;\
exit; ) | \
$(TCLSH_PROG)
TCL_LIBRARY=$(TCL_LIBRARY_DIR) \
Expand All @@ -271,18 +256,18 @@ depend:
# most cases these object files will correspond to the source files
# above.
#
# $(exampleA_LIB_FILE) should be listed as part of the BINARIES variable
# $(sample_LIB_FILE) should be listed as part of the BINARIES variable
# at the top of the Makefile. That will ensure that this target is built
# when you run "make binaries".
#
# You shouldn't need to modify this target, except to change the package
# name from "exampleA" to your package's name.
# name from "sample" to your package's name.
#========================================================================

$(exampleA_LIB_FILE): $(exampleA_OBJECTS)
-rm -f $(exampleA_LIB_FILE)
$(sample_LIB_FILE): $(sample_OBJECTS)
-rm -f $(sample_LIB_FILE)
@MAKE_LIB@
$(RANLIB) $(exampleA_LIB_FILE)
$(RANLIB) $(sample_LIB_FILE)

#========================================================================
# We need to enumerate the list of .c to .o lines here.
Expand All @@ -294,15 +279,15 @@ $(exampleA_LIB_FILE): $(exampleA_OBJECTS)
# containing your extension. If your sources are in a subdirectory,
# you will have to modify the paths to reflect this:
#
# exampleA.$(OBJEXT): $(srcdir)/src/win/exampleA.c
# $(COMPILE) -c `@CYGPATH@ $(srcdir)/src/win/exampleA.c` -o $@
# sample.$(OBJEXT): $(srcdir)/src/win/sample.c
# $(COMPILE) -c `@CYGPATH@ $(srcdir)/src/win/sample.c` -o $@
#========================================================================

exampleA.$(OBJEXT): $(srcdir)/exampleA.c
$(COMPILE) -c `@CYGPATH@ $(srcdir)/exampleA.c` -o $@
sample.$(OBJEXT): $(srcdir)/sample.c
$(COMPILE) -c `@CYGPATH@ $(srcdir)/sample.c` -o $@

tclexampleA.$(OBJEXT): $(srcdir)/tclexampleA.c
$(COMPILE) -c `@CYGPATH@ $(srcdir)/tclexampleA.c` -o $@
tclsample.$(OBJEXT): $(srcdir)/tclsample.c
$(COMPILE) -c `@CYGPATH@ $(srcdir)/tclsample.c` -o $@


#========================================================================
Expand Down
45 changes: 25 additions & 20 deletions README
Original file line number Diff line number Diff line change
@@ -1,14 +1,15 @@
This is a sample extension showing an implementation of the Tcl Extension
Architecture. Please see the webpage
http://www.scriptics.com/products/tcltk/tea/
for more details on TEA. You can also read the enclose "tea.pdf" document
Architecture (TEA). Please see the webpage

http://www.tcl.tk/doc/tea/

for more details on TEA. You can also read the enclosed "tea.pdf" document
for instructions on how to adapt this sample extension to your extension.

This package is a freely available open source package. You can do
virtually anything you like with it, such as modifying it,
redistributing it, and selling it either in whole or in part. See the
file "license.terms" for complete information.

virtually anything you like with it, such as modifying it, redistributing
it, and selling it either in whole or in part. See the file
"license.terms" for complete information.

CONTENTS
========
Expand All @@ -29,31 +30,35 @@ aclocal.m4 Generated file. Do not edit. Autoconf uses this as input
when generating the final configure script. See "tcl.m4"
below.

configure Generated file. Do not edit.
configure Generated file. Do not edit. This must be regenerated
anytime configure.in or tclconfig/tcl.m4 changes.

configure.in Configure script template. Autoconf uses this file as input
to produce the final configure script.

install-sh Program used for copying binaries and script files to
their install locations.

mkIndex.tcl.in Script template used for generating an installed pkgIndex.tcl
file. The configure script uses this as input to produce the
actual mkIndex.tcl script.

mkinstalldirs Program used to create a directory hierarchy (because
mkdir -p is not portable)

exampleA.c Core Secure Hash Algorithm code.
sample.c Core Secure Hash Algorithm code.

exampleA.h Header file for functions in the C files.
sample.h Header file for functions in the C files.

sha1.n Unix nroff man page

tcl.m4 Collection of Tcl autoconf macros. This file should be copied
to aclocal.m4 before running autoconf.

tclexampleA.c Implementation of new Tcl command "sha1".
tclsample.c Implementation of new Tcl command "sha1".

tea.pdf PDF file describing the current implementation of the
Tcl Extension Architecture

tclconfig/ This directory contains various template files that build
the configure script. They should not need modification.

install-sh Program used for copying binaries and script files
to their install locations.

mkinstalldirs Program used to create a directory hierarchy
(because mkdir -p is not portable)

tcl.m4 Collection of Tcl autoconf macros. Included by
aclocal.m4 to define SC_* macros.
26 changes: 13 additions & 13 deletions README.cygwin
Original file line number Diff line number Diff line change
Expand Up @@ -4,26 +4,26 @@ you will need to do.
1. Make sure you have a working Visual C++ (version 5.0 or later) compiler.

2. Download and install the free Cygnus Cywgin full tools package from
ftp://go.cygnus.com/pub/sourceware.cygnus.com/pub/cygwin/cygwin-b20/full.exe
http://sources.redhat.com/cygwin/

3. Create a directory called "C:\bin". Copy the sh.exe
program from the cygnus bin directory
program from the cygnus bin directory
(C:\cygnus\cygwin-b20\H-i586-cygwin32\bin\sh.exe) to "C:\bin".
This will allow you to run shell scripts that use the
"#!/bin/sh" invocation.
This will allow you to run shell scripts that use the
"#!/bin/sh" invocation.

Create another directory called "C:\tmp". The bash.exe program
requires this directory for storing temporary files.
Create another directory called "C:\tmp". The bash.exe program
requires this directory for storing temporary files.

4. Set your environment variable "MAKE_MODE" to have the value "UNIX"
This will set up the "make" program to operate in a more sane manner.
4. Ensure your environment variable "MAKE_MODE" has the value "unix"
This will set up the "make" program to operate in a more sane manner.

5. Run vcvars32.bat. You must do this every time you wish to
perform a build of an extension. It is strongly recommended
that you modify your sytem environment so that you don't have to
run vcvars32.bat all the time. If you look in the vcvars32.bat
file you will see what system environment variables need to be
set in order to make this work.
perform a build of an extension. It is strongly recommended
that you modify your sytem environment so that you don't have to
run vcvars32.bat all the time. If you look in the vcvars32.bat
file you will see what system environment variables need to be
set in order to make this work.

6. If you are authoring a TEA extension, you will also want the GNU
autoconf package. This can be obtained from http://www.gnu.org
Expand Down
2 changes: 1 addition & 1 deletion aclocal.m4
Original file line number Diff line number Diff line change
@@ -1 +1 @@
builtin(include,tcl.m4)
builtin(include,tclconfig/tcl.m4)
Loading

0 comments on commit 7ba0dea

Please sign in to comment.