Skip to content

Commit 9f5fd68

Browse files
committed
Patch Makefile.in to support SWIG
1 parent 58eaae8 commit 9f5fd68

File tree

2 files changed

+19
-2
lines changed

2 files changed

+19
-2
lines changed

Makefile.in

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -121,6 +121,14 @@ TCL_SRC_DIR = @TCL_SRC_DIR@
121121
# Not used, but retained for reference of what libs Tcl required
122122
#TCL_LIBS = @TCL_LIBS@
123123

124+
125+
# Variables for generating wrappers using SWIG
126+
SWIG = @SWIG@
127+
SWIGOUTPUT = @SWIGOUTPUT@
128+
SWIGINTERFACE = @SWIGINTERFACE@
129+
SWIGOBJECT = @SWIGOBJECT@
130+
131+
124132
#========================================================================
125133
# TCLLIBPATH seeds the auto_path in Tcl's init.tcl so we can test our
126134
# package without installing. The other environment variables allow us
@@ -190,7 +198,13 @@ VALGRINDARGS = --tool=memcheck --num-callers=8 --leak-resolution=high \
190198
# for the BINARIES that you specified above have already been done.
191199
#========================================================================
192200

193-
all: binaries libraries doc
201+
all: @@SWIG_WRAP@@ binaries libraries
202+
203+
204+
wrap: $(SWIGOUTPUT)
205+
206+
$(SWIGOUTPUT): $(SWIGINTERFACE)
207+
$(SWIG) -tcl -c++ -namespace $(PACKAGE_NAME) -o $(SWIGOUTPUT) $(SWIGINTERFACE)
194208

195209
#========================================================================
196210
# The binaries target builds executable programs, Windows .dll's, unix
@@ -453,7 +467,7 @@ uninstall-binaries:
453467
rm -f "$(DESTDIR)$(bindir)/$$p"; \
454468
done
455469

456-
.PHONY: all binaries clean depend distclean doc install libraries test
470+
.PHONY: all binaries clean depend distclean doc install libraries test wrap
457471
.PHONY: gdb gdb-test valgrind valgrindshell
458472

459473
# Tell versions [3.59,3.63) of GNU make to not export all variables.

tclconfig/tcl.m4

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2762,6 +2762,7 @@ The PACKAGE_NAME variable must be defined by your TEA configure.ac])
27622762
AC_SUBST(PKG_INCLUDES)
27632763
AC_SUBST(PKG_LIBS)
27642764
AC_SUBST(PKG_CFLAGS)
2765+
AC_SUBST(SWIG_WRAP)
27652766
27662767
# Configure the installer.
27672768
TEA_INSTALLER
@@ -3048,11 +3049,13 @@ AC_DEFUN([TEA_ADD_SWIGINTERFACE], [
30483049
SWIGOBJECT="${SWIGBASE}.\${OBJEXT}"
30493050
fi
30503051
PKG_OBJECTS="$PKG_OBJECTS $SWIGOBJECT"
3052+
SWIG_WRAP="wrap"
30513053
AC_SUBST(PKG_SOURCES)
30523054
AC_SUBST(PKG_OBJECTS)
30533055
AC_SUBST(SWIGOBJECT)
30543056
AC_SUBST(SWIGOUTPUT)
30553057
AC_SUBST(SWIGINTERFACE)
3058+
AC_SUBST(SWIG_WRAP)
30563059
])
30573060

30583061
#------------------------------------------------------------------------

0 commit comments

Comments
 (0)